@yuneta/gobj-js 7.21.0 → 7.22.1
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 +21 -3
- package/dist/gobj-js.cjs.js +245 -52
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +1398 -1294
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +238 -53
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +1221 -1122
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +245 -52
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +1657 -1553
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +245 -52
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +1650 -1546
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.cjs.min.js
CHANGED
|
@@ -18,16 +18,16 @@ var e = {
|
|
|
18
18
|
};
|
|
19
19
|
function t(r) {
|
|
20
20
|
return function(n, r) {
|
|
21
|
-
var o, s,
|
|
21
|
+
var o, s, l, i, _, a, u, c, f, g = 1, p = n.length, d = "";
|
|
22
22
|
for (s = 0; s < p; s++) if ("string" == typeof n[s]) d += n[s];
|
|
23
23
|
else if ("object" == typeof n[s]) {
|
|
24
|
-
if ((
|
|
25
|
-
if (null == o) throw new Error(t("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"",
|
|
26
|
-
o = o[
|
|
24
|
+
if ((i = n[s]).keys) for (o = r[g], l = 0; l < i.keys.length; l++) {
|
|
25
|
+
if (null == o) throw new Error(t("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"", i.keys[l], i.keys[l - 1]));
|
|
26
|
+
o = o[i.keys[l]];
|
|
27
27
|
}
|
|
28
|
-
else o =
|
|
29
|
-
if (e.not_type.test(
|
|
30
|
-
switch (e.number.test(
|
|
28
|
+
else o = i.param_no ? r[i.param_no] : r[g++];
|
|
29
|
+
if (e.not_type.test(i.type) && e.not_primitive.test(i.type) && o instanceof Function && (o = o()), e.numeric_arg.test(i.type) && "number" != typeof o && isNaN(o)) throw new TypeError(t("[sprintf] expecting number but found %T", o));
|
|
30
|
+
switch (e.number.test(i.type) && (c = o >= 0), i.type) {
|
|
31
31
|
case "b":
|
|
32
32
|
o = parseInt(o, 10).toString(2);
|
|
33
33
|
break;
|
|
@@ -39,63 +39,63 @@ function t(r) {
|
|
|
39
39
|
o = parseInt(o, 10);
|
|
40
40
|
break;
|
|
41
41
|
case "j":
|
|
42
|
-
o = JSON.stringify(o, null,
|
|
42
|
+
o = JSON.stringify(o, null, i.width ? parseInt(i.width) : 0);
|
|
43
43
|
break;
|
|
44
44
|
case "e":
|
|
45
|
-
o =
|
|
45
|
+
o = i.precision ? parseFloat(o).toExponential(i.precision) : parseFloat(o).toExponential();
|
|
46
46
|
break;
|
|
47
47
|
case "f":
|
|
48
|
-
o =
|
|
48
|
+
o = i.precision ? parseFloat(o).toFixed(i.precision) : parseFloat(o);
|
|
49
49
|
break;
|
|
50
50
|
case "g":
|
|
51
|
-
o =
|
|
51
|
+
o = i.precision ? String(Number(o.toPrecision(i.precision))) : parseFloat(o);
|
|
52
52
|
break;
|
|
53
53
|
case "o":
|
|
54
54
|
o = (parseInt(o, 10) >>> 0).toString(8);
|
|
55
55
|
break;
|
|
56
56
|
case "s":
|
|
57
|
-
o = String(o), o =
|
|
57
|
+
o = String(o), o = i.precision ? o.substring(0, i.precision) : o;
|
|
58
58
|
break;
|
|
59
59
|
case "t":
|
|
60
|
-
o = String(!!o), o =
|
|
60
|
+
o = String(!!o), o = i.precision ? o.substring(0, i.precision) : o;
|
|
61
61
|
break;
|
|
62
62
|
case "T":
|
|
63
|
-
o = Object.prototype.toString.call(o).slice(8, -1).toLowerCase(), o =
|
|
63
|
+
o = Object.prototype.toString.call(o).slice(8, -1).toLowerCase(), o = i.precision ? o.substring(0, i.precision) : o;
|
|
64
64
|
break;
|
|
65
65
|
case "u":
|
|
66
66
|
o = parseInt(o, 10) >>> 0;
|
|
67
67
|
break;
|
|
68
68
|
case "v":
|
|
69
|
-
o = o.valueOf(), o =
|
|
69
|
+
o = o.valueOf(), o = i.precision ? o.substring(0, i.precision) : o;
|
|
70
70
|
break;
|
|
71
71
|
case "x":
|
|
72
72
|
o = (parseInt(o, 10) >>> 0).toString(16);
|
|
73
73
|
break;
|
|
74
74
|
case "X": o = (parseInt(o, 10) >>> 0).toString(16).toUpperCase();
|
|
75
75
|
}
|
|
76
|
-
e.json.test(
|
|
76
|
+
e.json.test(i.type) ? d += o : (!e.number.test(i.type) || c && !i.sign ? f = "" : (f = c ? "+" : "-", o = o.toString().replace(e.sign, "")), a = i.pad_char ? "0" === i.pad_char ? "0" : i.pad_char.charAt(1) : " ", u = i.width - (f + o).length, _ = i.width && u > 0 ? a.repeat(u) : "", d += i.align ? f + o + _ : "0" === a ? f + _ + o : _ + f + o);
|
|
77
77
|
}
|
|
78
78
|
return d;
|
|
79
79
|
}(function(t) {
|
|
80
80
|
if (n[t]) return n[t];
|
|
81
|
-
let r, o = t, s = [],
|
|
81
|
+
let r, o = t, s = [], l = 0;
|
|
82
82
|
for (; o;) {
|
|
83
83
|
if (null !== (r = e.text.exec(o))) s.push(r[0]);
|
|
84
84
|
else if (null !== (r = e.modulo.exec(o))) s.push("%");
|
|
85
85
|
else {
|
|
86
86
|
if (null === (r = e.placeholder.exec(o))) throw new SyntaxError("[sprintf] unexpected placeholder");
|
|
87
87
|
if (r[2]) {
|
|
88
|
-
|
|
89
|
-
var
|
|
88
|
+
l |= 1;
|
|
89
|
+
var i = [], _ = r[2], a = [];
|
|
90
90
|
if (null === (a = e.key.exec(_))) throw new SyntaxError("[sprintf] failed to parse named argument key");
|
|
91
|
-
for (
|
|
91
|
+
for (i.push(a[1]); "" !== (_ = _.substring(a[0].length));) if (null !== (a = e.key_access.exec(_))) i.push(a[1]);
|
|
92
92
|
else {
|
|
93
93
|
if (null === (a = e.index_access.exec(_))) throw new SyntaxError("[sprintf] failed to parse named argument key");
|
|
94
|
-
|
|
94
|
+
i.push(a[1]);
|
|
95
95
|
}
|
|
96
|
-
r[2] =
|
|
97
|
-
} else
|
|
98
|
-
if (3 ===
|
|
96
|
+
r[2] = i;
|
|
97
|
+
} else l |= 2;
|
|
98
|
+
if (3 === l) throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");
|
|
99
99
|
s.push({
|
|
100
100
|
placeholder: r[0],
|
|
101
101
|
param_no: r[1],
|
|
@@ -130,7 +130,7 @@ function o(e, t, n, r, o) {
|
|
|
130
130
|
data: o || []
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
var s = "7.0.0a",
|
|
133
|
+
var s = "7.0.0a", l = null, i = null, _ = null, a = null, u = null, c = null, f = [], g = Object.create(null), p = {}, d = null, b = null, m = 0, h = Object.freeze({
|
|
134
134
|
DTP_STRING: 1,
|
|
135
135
|
DTP_BOOLEAN: 2,
|
|
136
136
|
DTP_INTEGER: 3,
|
|
@@ -140,8 +140,8 @@ var s = "7.0.0a", i = null, l = null, _ = null, a = null, u = null, c = null, f
|
|
|
140
140
|
DTP_JSON: 7,
|
|
141
141
|
DTP_POINTER: 8
|
|
142
142
|
});
|
|
143
|
-
|
|
144
|
-
var
|
|
143
|
+
h.DTP_POINTER;
|
|
144
|
+
var E = Object.freeze({
|
|
145
145
|
SDF_NOTACCESS: 1,
|
|
146
146
|
SDF_RD: 2,
|
|
147
147
|
SDF_WR: 4,
|
|
@@ -164,26 +164,26 @@ var T = Object.freeze({
|
|
|
164
164
|
SDF_AUTHZ_S: 524288,
|
|
165
165
|
SDF_AUTHZ_RS: 1048576
|
|
166
166
|
});
|
|
167
|
-
|
|
168
|
-
var
|
|
169
|
-
constructor(e, t, n = 0, r = null, o = "", s = null,
|
|
170
|
-
this.type = e, this.name = t, this.alias = s, this.flag = n, this.default_value = r, this.header =
|
|
167
|
+
E.SDF_RD, E.SDF_WR, E.SDF_STATS, E.SDF_PERSIST, E.SDF_VOLATIL, E.SDF_RSTATS, E.SDF_PSTATS, E.SDF_WR, E.SDF_PERSIST;
|
|
168
|
+
var T = class {
|
|
169
|
+
constructor(e, t, n = 0, r = null, o = "", s = null, l = null, i = 0, _ = null, a = null, u = null) {
|
|
170
|
+
this.type = e, this.name = t, this.alias = s, this.flag = n, this.default_value = r, this.header = l, this.fillspace = i, this.description = o, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
171
171
|
}
|
|
172
|
-
}, y = () => new
|
|
173
|
-
constructor(e, t, n, r, o, s,
|
|
174
|
-
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = o, this.authz_table = s, this.command_table =
|
|
172
|
+
}, y = () => new T(0, null), v = (e, t, n, r, o) => new T(e, t, n, r, o), j = class {
|
|
173
|
+
constructor(e, t, n, r, o, s, l, i, _) {
|
|
174
|
+
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = o, this.authz_table = s, this.command_table = l, this.s_user_trace_level = i, this.gclass_flag = Number(_) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
175
175
|
}
|
|
176
|
-
},
|
|
176
|
+
}, S = class {
|
|
177
177
|
constructor(e, t, n, r, o) {
|
|
178
|
-
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(o) || 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 =
|
|
178
|
+
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(o) || 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 = dn(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
179
179
|
}
|
|
180
|
-
},
|
|
180
|
+
}, O = Object.freeze({
|
|
181
181
|
gcflag_manual_start: 1,
|
|
182
182
|
gcflag_no_check_output_events: 2,
|
|
183
183
|
gcflag_ignore_unknown_attrs: 4,
|
|
184
184
|
gcflag_required_start_to_play: 8,
|
|
185
185
|
gcflag_singleton: 16
|
|
186
|
-
}),
|
|
186
|
+
}), w = Object.freeze({
|
|
187
187
|
gobj_flag_yuno: 1,
|
|
188
188
|
gobj_flag_default_service: 2,
|
|
189
189
|
gobj_flag_service: 4,
|
|
@@ -191,7 +191,7 @@ var h = class {
|
|
|
191
191
|
gobj_flag_pure_child: 16,
|
|
192
192
|
gobj_flag_autostart: 32,
|
|
193
193
|
gobj_flag_autoplay: 64
|
|
194
|
-
}),
|
|
194
|
+
}), N = Object.freeze({
|
|
195
195
|
obflag_destroying: 1,
|
|
196
196
|
obflag_destroyed: 2,
|
|
197
197
|
obflag_created: 4
|
|
@@ -219,9 +219,9 @@ var h = class {
|
|
|
219
219
|
this.event_name = e, this.event_flag = Number(t) || 0;
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
|
-
var
|
|
223
|
-
function
|
|
224
|
-
|
|
222
|
+
var $ = 1;
|
|
223
|
+
function I(e) {
|
|
224
|
+
Dn(e) && (e = JSON.stringify(e)), fn(" ".repeat(Math.max(1, 2 * m)) + String(e));
|
|
225
225
|
}
|
|
226
226
|
var C = Object.freeze({
|
|
227
227
|
TRACE_MACHINE: 65536,
|
|
@@ -239,7 +239,7 @@ var C = Object.freeze({
|
|
|
239
239
|
TRACE_TIMER_PERIODIC: 268435456,
|
|
240
240
|
TRACE_URING_TIME: 536870912,
|
|
241
241
|
TRACE_COMMANDS: 1073741824
|
|
242
|
-
}),
|
|
242
|
+
}), P = [
|
|
243
243
|
[
|
|
244
244
|
"machine",
|
|
245
245
|
C.TRACE_MACHINE,
|
|
@@ -315,217 +315,267 @@ var C = Object.freeze({
|
|
|
315
315
|
C.TRACE_COMMANDS,
|
|
316
316
|
"Trace commands"
|
|
317
317
|
]
|
|
318
|
-
],
|
|
318
|
+
], L = 0, U = 0, F = 0;
|
|
319
319
|
function G(e, t) {
|
|
320
|
-
|
|
320
|
+
let n = [];
|
|
321
|
+
for (const [t, r] of P) e & r && n.push(t);
|
|
322
|
+
if (Array.isArray(t)) for (let r = 0; r < t.length && r < 16; r++) t[r] && e & 1 << r && n.push(t[r][0]);
|
|
323
|
+
return n;
|
|
324
|
+
}
|
|
325
|
+
function V(e, t, n) {
|
|
326
|
+
if (Un(e)) return void 0 === n ? 268369920 : 65535;
|
|
321
327
|
if (/^[0-9]+$/.test(String(e))) {
|
|
322
328
|
const t = Number(e);
|
|
323
329
|
if (t) return t;
|
|
324
330
|
}
|
|
325
|
-
return function(e) {
|
|
326
|
-
for (const [t, n] of
|
|
331
|
+
return function(e, t) {
|
|
332
|
+
for (const [t, n] of P) if (t === e) return n;
|
|
333
|
+
if (Array.isArray(t)) {
|
|
334
|
+
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
335
|
+
}
|
|
327
336
|
return 0;
|
|
328
|
-
}(String(e)) || (
|
|
337
|
+
}(String(e), n) || (un(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
329
338
|
}
|
|
330
|
-
function
|
|
339
|
+
function M(e) {
|
|
331
340
|
if (F) return 4294967295;
|
|
332
|
-
let t =
|
|
341
|
+
let t = L;
|
|
333
342
|
return e && (t |= e.trace_level || 0, e.gclass && (t |= e.gclass.trace_level || 0)), t;
|
|
334
343
|
}
|
|
335
|
-
function
|
|
344
|
+
function W(e) {
|
|
336
345
|
let t = U;
|
|
337
346
|
return e && (t |= e.no_trace_level || 0, e.gclass && (t |= e.gclass.no_trace_level || 0)), t;
|
|
338
347
|
}
|
|
339
|
-
function W() {
|
|
340
|
-
if (!d || !d.jn_attrs) return 0;
|
|
341
|
-
let e = 0;
|
|
342
|
-
if (rt(d, "tracing")) {
|
|
343
|
-
const t = Number(ot(d, "tracing")) || 0;
|
|
344
|
-
t >= 1 && (e |= C.TRACE_MACHINE), t >= 2 && (e |= C.TRACE_EV_KW);
|
|
345
|
-
}
|
|
346
|
-
return rt(d, "trace_timer") && ot(d, "trace_timer") && (e |= C.TRACE_TIMER), rt(d, "trace_creation") && ot(d, "trace_creation") && (e |= C.TRACE_CREATE_DELETE), rt(d, "trace_start_stop") && ot(d, "trace_start_stop") && (e |= C.TRACE_START_STOP), e;
|
|
347
|
-
}
|
|
348
348
|
function K(e) {
|
|
349
|
-
return (
|
|
349
|
+
return M(e) & C.TRACE_CREATE_DELETE;
|
|
350
350
|
}
|
|
351
351
|
function Y(e) {
|
|
352
|
-
return (
|
|
352
|
+
return M(e) & C.TRACE_SUBSCRIPTIONS;
|
|
353
353
|
}
|
|
354
|
-
function B(e
|
|
354
|
+
function B(e) {
|
|
355
|
+
return M(e) & C.TRACE_START_STOP;
|
|
356
|
+
}
|
|
357
|
+
function J(e) {
|
|
358
|
+
return M(e) & C.TRACE_EV_KW;
|
|
359
|
+
}
|
|
360
|
+
function H(e, t) {
|
|
355
361
|
if (F > 1) return !0;
|
|
356
362
|
if (!e) return !1;
|
|
357
|
-
const n =
|
|
363
|
+
const n = M(e);
|
|
358
364
|
return !!(n & C.TRACE_MACHINE || n & C.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & C.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
359
365
|
}
|
|
360
|
-
function
|
|
366
|
+
function q(e, t) {
|
|
361
367
|
if (F > 1) return !1;
|
|
362
368
|
if (!e) return !0;
|
|
363
|
-
const n =
|
|
369
|
+
const n = W(e);
|
|
364
370
|
return !!(n & C.TRACE_MACHINE || n & C.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & C.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
365
371
|
}
|
|
366
|
-
function
|
|
372
|
+
function z(e, t) {
|
|
373
|
+
const n = V(e, "gobj_set_global_trace");
|
|
374
|
+
return n ? (t ? L |= n : L &= ~n, 0) : -1;
|
|
375
|
+
}
|
|
376
|
+
function Q(e, t) {
|
|
377
|
+
const n = V(e, "gobj_set_global_no_trace");
|
|
378
|
+
return n ? (t ? U |= n : U &= ~n, 0) : -1;
|
|
379
|
+
}
|
|
380
|
+
function X(e, t) {
|
|
381
|
+
return L = t ? (L | e) >>> 0 : (L & ~e) >>> 0, 0;
|
|
382
|
+
}
|
|
383
|
+
function Z(e, t) {
|
|
384
|
+
return U = t ? (U | e) >>> 0 : (U & ~e) >>> 0, 0;
|
|
385
|
+
}
|
|
386
|
+
function ee() {
|
|
387
|
+
return G(L, null);
|
|
388
|
+
}
|
|
389
|
+
function te() {
|
|
390
|
+
return G(U, null);
|
|
391
|
+
}
|
|
392
|
+
function ne(e) {
|
|
393
|
+
const t = kn(e) ? je(e) : e;
|
|
394
|
+
return t ? G(t.trace_level | L, t.s_user_trace_level) : (un(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
395
|
+
}
|
|
396
|
+
function re(e) {
|
|
397
|
+
const t = kn(e) ? je(e) : e;
|
|
398
|
+
return t ? G(t.trace_level, t.s_user_trace_level) : (un(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
399
|
+
}
|
|
400
|
+
function oe(e) {
|
|
401
|
+
const t = kn(e) ? je(e) : e;
|
|
402
|
+
return t ? G(t.no_trace_level, t.s_user_trace_level) : (un(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
403
|
+
}
|
|
404
|
+
function se(e, t, n) {
|
|
405
|
+
const r = kn(e) ? je(e) : e;
|
|
406
|
+
if (!r) return un(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
407
|
+
const o = null === t ? 4294967295 : V(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
408
|
+
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
409
|
+
}
|
|
410
|
+
function le(e, t, n) {
|
|
411
|
+
const r = kn(e) ? je(e) : e;
|
|
412
|
+
if (!r) return un(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
413
|
+
const o = null === t ? 4294967295 : V(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
414
|
+
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
415
|
+
}
|
|
416
|
+
function ie(e, t) {
|
|
367
417
|
let n = {};
|
|
368
|
-
if (!
|
|
418
|
+
if (!An(t)) return un("sdata_desc MUST be an array"), pn(t), n;
|
|
369
419
|
for (let r = 0; r < t.length; r++) {
|
|
370
420
|
const o = t[r];
|
|
371
|
-
o.name &&
|
|
421
|
+
o.name && _e(e, n, o);
|
|
372
422
|
}
|
|
373
423
|
return n;
|
|
374
424
|
}
|
|
375
|
-
function
|
|
425
|
+
function _e(e, t, n) {
|
|
376
426
|
let r, o = n.default_value;
|
|
377
427
|
switch (n.type) {
|
|
378
|
-
case
|
|
428
|
+
case h.DTP_STRING:
|
|
379
429
|
r = String(o);
|
|
380
430
|
break;
|
|
381
|
-
case
|
|
382
|
-
r =
|
|
431
|
+
case h.DTP_BOOLEAN:
|
|
432
|
+
r = Fn(o);
|
|
383
433
|
break;
|
|
384
|
-
case
|
|
385
|
-
r = parseInt(o), isNaN(r) &&
|
|
434
|
+
case h.DTP_INTEGER:
|
|
435
|
+
r = parseInt(o), isNaN(r) && un(`${Ze(e)}: attr NaN: ${n.name}`);
|
|
386
436
|
break;
|
|
387
|
-
case
|
|
388
|
-
r = Number(o), isNaN(r) &&
|
|
437
|
+
case h.DTP_REAL:
|
|
438
|
+
r = Number(o), isNaN(r) && un(`${Ze(e)}: attr NaN: ${n.name}`);
|
|
389
439
|
break;
|
|
390
|
-
case
|
|
391
|
-
if (
|
|
440
|
+
case h.DTP_LIST:
|
|
441
|
+
if (kn(o)) try {
|
|
392
442
|
r = JSON.parse(o);
|
|
393
443
|
} catch (e) {
|
|
394
|
-
|
|
444
|
+
un(`JSON parse error: ${e.message}`);
|
|
395
445
|
}
|
|
396
446
|
else r = o;
|
|
397
|
-
|
|
447
|
+
An(r) || (r = []);
|
|
398
448
|
break;
|
|
399
|
-
case
|
|
400
|
-
if (
|
|
449
|
+
case h.DTP_DICT:
|
|
450
|
+
if (kn(o)) try {
|
|
401
451
|
r = JSON.parse(o);
|
|
402
452
|
} catch (e) {
|
|
403
|
-
|
|
453
|
+
un(`JSON parse error: ${e.message}`);
|
|
404
454
|
}
|
|
405
455
|
else r = o;
|
|
406
|
-
|
|
456
|
+
Dn(r) || (r = {});
|
|
407
457
|
break;
|
|
408
|
-
case
|
|
409
|
-
if (
|
|
458
|
+
case h.DTP_JSON:
|
|
459
|
+
if (kn(o)) try {
|
|
410
460
|
r = JSON.parse(o);
|
|
411
461
|
} catch (e) {
|
|
412
|
-
|
|
462
|
+
un(`JSON parse error: ${e.message}`);
|
|
413
463
|
}
|
|
414
464
|
else r = o;
|
|
415
465
|
break;
|
|
416
|
-
case
|
|
466
|
+
case h.DTP_POINTER: r = o;
|
|
417
467
|
}
|
|
418
|
-
return void 0 === r && (
|
|
468
|
+
return void 0 === r && (un(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
419
469
|
}
|
|
420
|
-
function
|
|
470
|
+
function ae(e, t, n, r) {
|
|
421
471
|
let o;
|
|
422
472
|
switch (n.type) {
|
|
423
|
-
case
|
|
473
|
+
case h.DTP_STRING:
|
|
424
474
|
if (null == r) o = "";
|
|
425
|
-
else if (
|
|
475
|
+
else if (kn(r)) o = String(r);
|
|
426
476
|
else {
|
|
427
477
|
let e = JSON.stringify(r);
|
|
428
478
|
e && (o = String(e));
|
|
429
479
|
}
|
|
430
480
|
break;
|
|
431
|
-
case
|
|
432
|
-
o =
|
|
481
|
+
case h.DTP_BOOLEAN:
|
|
482
|
+
o = Fn(r);
|
|
433
483
|
break;
|
|
434
|
-
case
|
|
435
|
-
o = parseInt(r), isNaN(o) &&
|
|
484
|
+
case h.DTP_INTEGER:
|
|
485
|
+
o = parseInt(r), isNaN(o) && un(`${Ze(e)}: attr NaN: ${n.name}`);
|
|
436
486
|
break;
|
|
437
|
-
case
|
|
438
|
-
o = Number(r), isNaN(o) &&
|
|
487
|
+
case h.DTP_REAL:
|
|
488
|
+
o = Number(r), isNaN(o) && un(`${Ze(e)}: attr NaN: ${n.name}`);
|
|
439
489
|
break;
|
|
440
|
-
case
|
|
441
|
-
if (
|
|
490
|
+
case h.DTP_LIST:
|
|
491
|
+
if (kn(r)) try {
|
|
442
492
|
o = JSON.parse(r);
|
|
443
493
|
} catch (e) {
|
|
444
|
-
|
|
494
|
+
un(`JSON parse error: ${e.message}`);
|
|
445
495
|
}
|
|
446
496
|
else o = r;
|
|
447
|
-
if (!
|
|
497
|
+
if (!An(o)) return un(`attr must be an array: ${n.name}`), -1;
|
|
448
498
|
break;
|
|
449
|
-
case
|
|
450
|
-
if (
|
|
499
|
+
case h.DTP_DICT:
|
|
500
|
+
if (kn(r)) try {
|
|
451
501
|
o = JSON.parse(r);
|
|
452
502
|
} catch (e) {
|
|
453
|
-
|
|
503
|
+
un(`JSON parse error: ${e.message}`);
|
|
454
504
|
}
|
|
455
505
|
else o = r;
|
|
456
|
-
if (!
|
|
506
|
+
if (!Dn(o)) return un(`attr must be an object: ${n.name}`), -1;
|
|
457
507
|
break;
|
|
458
|
-
case
|
|
459
|
-
if (
|
|
508
|
+
case h.DTP_JSON:
|
|
509
|
+
if (kn(r)) try {
|
|
460
510
|
o = JSON.parse(r);
|
|
461
511
|
} catch (e) {
|
|
462
|
-
|
|
512
|
+
un(`JSON parse error: ${e.message}`);
|
|
463
513
|
}
|
|
464
514
|
else o = r;
|
|
465
|
-
if (!
|
|
515
|
+
if (!An(o) && !Dn(o)) return un(`attr must be a json dict/list: ${n.name}`), -1;
|
|
466
516
|
break;
|
|
467
|
-
case
|
|
517
|
+
case h.DTP_POINTER: o = r;
|
|
468
518
|
}
|
|
469
|
-
return void 0 === o &&
|
|
519
|
+
return void 0 === o && un(`${Ze(e)}: attr undefined: ${n.name}`), t[n.name] = o, Dn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = o), e.obflag & N.obflag_created && !(e.obflag & N.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
470
520
|
}
|
|
471
|
-
function
|
|
521
|
+
function ue(e) {
|
|
472
522
|
return e.jn_attrs;
|
|
473
523
|
}
|
|
474
|
-
function
|
|
475
|
-
return
|
|
524
|
+
function ce(e, t, n) {
|
|
525
|
+
return mt(e, t) ? ue(e) : e && e.bottom_gobj ? ce(e.bottom_gobj, t, n) : (n && un(`GClass Attribute NOT FOUND: ${Ze(e)}, attr ${t}`), null);
|
|
476
526
|
}
|
|
477
|
-
function
|
|
478
|
-
if (!(e && e instanceof
|
|
527
|
+
function fe(e, t, n) {
|
|
528
|
+
if (!(e && e instanceof j)) return n && un("gclass NULL"), null;
|
|
479
529
|
if (!t) return e.attrs_table;
|
|
480
530
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
481
531
|
const r = e.attrs_table[n];
|
|
482
532
|
if (r.name && r.name === t) return r;
|
|
483
533
|
}
|
|
484
|
-
return n &&
|
|
534
|
+
return n && un(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
485
535
|
}
|
|
486
|
-
function
|
|
487
|
-
if (
|
|
488
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
489
|
-
if (
|
|
490
|
-
let c = new
|
|
536
|
+
function ge(e, t, n, r, o, s, l, i, _, a, u) {
|
|
537
|
+
if (Un(e)) return un("gclass_name EMPTY"), null;
|
|
538
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return un(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
539
|
+
if (je(e)) return un(`GClass ALREADY exists: ${e}`), null;
|
|
540
|
+
let c = new j(e, r, o, s, l, i, _, a, u);
|
|
491
541
|
(function(e, t) {
|
|
492
|
-
e && e instanceof
|
|
542
|
+
e && e instanceof j ? t ? g[t] ? un(`gclass ALREADY REGISTERED: ${t}`) : g[t] = e : un("gclass_name undefined") : un("gclass undefined");
|
|
493
543
|
})(c, e);
|
|
494
544
|
const f = n.length;
|
|
495
545
|
for (let e = 0; e < f; e++) {
|
|
496
546
|
let t = n[e][0], r = n[e][1];
|
|
497
|
-
if (
|
|
498
|
-
if (
|
|
547
|
+
if (Un(t)) continue;
|
|
548
|
+
if (me(c, t) < 0) return pe(c), null;
|
|
499
549
|
const o = r.length;
|
|
500
550
|
for (let e = 0; e < o; e++) {
|
|
501
551
|
let n = r[e][0], o = r[e][1], s = r[e][2];
|
|
502
|
-
|
|
552
|
+
Un(n) || he(c, t, n, o, s);
|
|
503
553
|
}
|
|
504
554
|
}
|
|
505
555
|
for (let e = 0; e < t.length; e++) {
|
|
506
556
|
let n = t[e][0], r = t[e][1];
|
|
507
|
-
if (!
|
|
508
|
-
if (
|
|
509
|
-
|
|
557
|
+
if (!Un(n)) {
|
|
558
|
+
if (ye(c, n)) return un(`SMachine: event repeated in input_events: ${n}`), pe(c), null;
|
|
559
|
+
Te(c, n, r);
|
|
510
560
|
}
|
|
511
561
|
}
|
|
512
562
|
if (!c.fsm_checked) {
|
|
513
|
-
if (
|
|
563
|
+
if (ve(c) < 0) return pe(c), null;
|
|
514
564
|
c.fsm_checked = !0;
|
|
515
565
|
}
|
|
516
566
|
return c;
|
|
517
567
|
}
|
|
518
|
-
function
|
|
568
|
+
function pe(e) {
|
|
519
569
|
let t;
|
|
520
|
-
if (
|
|
570
|
+
if (kn(e)) t = e;
|
|
521
571
|
else {
|
|
522
|
-
if (!(e instanceof
|
|
572
|
+
if (!(e instanceof j)) return un("Cannot unregister gclass, type unknown"), -1;
|
|
523
573
|
t = e.gclass_name;
|
|
524
574
|
}
|
|
525
575
|
let n = g[t];
|
|
526
|
-
return n ? n.instances > 0 ? (
|
|
576
|
+
return n ? n.instances > 0 ? (un(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete g[t], 0) : (un(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
527
577
|
}
|
|
528
|
-
function
|
|
578
|
+
function de(e, t) {
|
|
529
579
|
const n = e.dl_states.length, r = e.dl_states;
|
|
530
580
|
for (let e = 0; e < n; e++) {
|
|
531
581
|
let n = r[e];
|
|
@@ -533,7 +583,7 @@ function ne(e, t) {
|
|
|
533
583
|
}
|
|
534
584
|
return null;
|
|
535
585
|
}
|
|
536
|
-
function
|
|
586
|
+
function be(e, t) {
|
|
537
587
|
const n = e.dl_actions.length, r = e.dl_actions;
|
|
538
588
|
for (let e = 0; e < n; e++) {
|
|
539
589
|
let n = r[e];
|
|
@@ -541,23 +591,23 @@ function re(e, t) {
|
|
|
541
591
|
}
|
|
542
592
|
return null;
|
|
543
593
|
}
|
|
544
|
-
function
|
|
545
|
-
return e instanceof
|
|
594
|
+
function me(e, t) {
|
|
595
|
+
return e instanceof j ? de(e, t) ? (un(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (un("Cannot add state, typeof not GClass"), -1);
|
|
546
596
|
}
|
|
547
|
-
function
|
|
548
|
-
if (!(e instanceof
|
|
549
|
-
if (
|
|
550
|
-
let s =
|
|
551
|
-
return s ?
|
|
597
|
+
function he(e, t, n, r, o) {
|
|
598
|
+
if (!(e instanceof j)) return un("Cannot add state, typeof not GClass"), -1;
|
|
599
|
+
if (Un(t)) return un("state_name EMPTY"), -1;
|
|
600
|
+
let s = de(e, t);
|
|
601
|
+
return s ? be(s, n) ? (un(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (s.dl_actions.push(new D(n, r, o)), 0) : (un(`state not found: ${t}`), -1);
|
|
552
602
|
}
|
|
553
|
-
function
|
|
554
|
-
|
|
603
|
+
function Ee(e, t, n) {
|
|
604
|
+
Un(t) || e.push(new k(t, n));
|
|
555
605
|
}
|
|
556
|
-
function
|
|
557
|
-
return e instanceof
|
|
606
|
+
function Te(e, t, n) {
|
|
607
|
+
return e instanceof j ? Ee(e.dl_events, t, n) : (un("Cannot add state, typeof not GClass"), -1);
|
|
558
608
|
}
|
|
559
|
-
function
|
|
560
|
-
if (!(e instanceof
|
|
609
|
+
function ye(e, t) {
|
|
610
|
+
if (!(e instanceof j)) return un("Cannot add state, typeof not GClass"), 0;
|
|
561
611
|
const n = e.dl_events.length, r = e.dl_events;
|
|
562
612
|
for (let e = 0; e < n; e++) {
|
|
563
613
|
let n = r[e];
|
|
@@ -565,399 +615,423 @@ function _e(e, t) {
|
|
|
565
615
|
}
|
|
566
616
|
return null;
|
|
567
617
|
}
|
|
568
|
-
function
|
|
569
|
-
if (!(e instanceof
|
|
618
|
+
function ve(e) {
|
|
619
|
+
if (!(e instanceof j)) return un("Cannot add state, typeof not GClass"), -1;
|
|
570
620
|
let t = 0;
|
|
571
|
-
|
|
621
|
+
Rn(e.dl_states) || (un(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
572
622
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
573
623
|
let r = e.dl_states[n];
|
|
574
|
-
if (!
|
|
624
|
+
if (!Un(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
575
625
|
let o = r.dl_actions[n];
|
|
576
|
-
|
|
626
|
+
Un(o.event_name) || (ye(e, o.event_name) || (un(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${o.event_name}`), t += -1), o.next_state && (de(e, o.next_state) || (un(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
577
627
|
}
|
|
578
628
|
}
|
|
579
629
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
580
630
|
let r = e.dl_events[n];
|
|
581
|
-
if (!
|
|
631
|
+
if (!Un(r.event_name) && ($n(r.event_flag) || (un(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & R.EVF_OUTPUT_EVENT))) {
|
|
582
632
|
let n = !1;
|
|
583
633
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
584
634
|
let o = e.dl_states[t];
|
|
585
|
-
|
|
635
|
+
Un(o.state_name) || be(o, r.event_name) && (n = !0);
|
|
586
636
|
}
|
|
587
|
-
n || (
|
|
637
|
+
n || (un(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
588
638
|
}
|
|
589
639
|
}
|
|
590
640
|
return t;
|
|
591
641
|
}
|
|
592
|
-
function
|
|
642
|
+
function je(e, t) {
|
|
593
643
|
let n = null;
|
|
594
644
|
try {
|
|
595
645
|
n = g[e];
|
|
596
646
|
} catch (e) {}
|
|
597
|
-
return n || (t &&
|
|
647
|
+
return n || (t && un(`gclass not found: ${e}`), null);
|
|
598
648
|
}
|
|
599
|
-
function
|
|
600
|
-
return !b || b.obflag &
|
|
649
|
+
function Se() {
|
|
650
|
+
return !b || b.obflag & N.obflag_destroyed ? null : b;
|
|
601
651
|
}
|
|
602
|
-
function
|
|
652
|
+
function Oe(e, t) {
|
|
603
653
|
e = e.toLowerCase();
|
|
604
|
-
return p[e] || (t &&
|
|
654
|
+
return p[e] || (t && un(`gobj service not found: ${e}`), null);
|
|
605
655
|
}
|
|
606
|
-
function
|
|
607
|
-
let t =
|
|
608
|
-
return t = t.toLowerCase(), p[t] &&
|
|
656
|
+
function we(e) {
|
|
657
|
+
let t = Qe(e);
|
|
658
|
+
return t = t.toLowerCase(), p[t] && un(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), p[t] = e, 0;
|
|
609
659
|
}
|
|
610
|
-
function
|
|
611
|
-
t.parent &&
|
|
660
|
+
function Ne(e, t) {
|
|
661
|
+
t.parent && un(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
612
662
|
}
|
|
613
|
-
function
|
|
614
|
-
let n =
|
|
615
|
-
n >= 0 && (
|
|
663
|
+
function Re(e, t) {
|
|
664
|
+
let n = Sr(e.dl_children, t);
|
|
665
|
+
n >= 0 && (wn(e.dl_children, n), t.parent = null);
|
|
616
666
|
}
|
|
617
|
-
function
|
|
618
|
-
|
|
667
|
+
function xe(e, t) {
|
|
668
|
+
return Ye(e) ? i ? i(e, t) : -1 : (un(`${Ze(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
619
669
|
}
|
|
620
|
-
function
|
|
670
|
+
function De(e, t) {
|
|
671
|
+
"__json_config_variables__" !== t && un(`GClass Attribute NOT FOUND: ${Ze(e)}, attr ${t}`);
|
|
672
|
+
}
|
|
673
|
+
function Ae(e, t, n) {
|
|
621
674
|
let r = t;
|
|
622
675
|
(function(e, t, n, r, o) {
|
|
623
|
-
if (!e || !t) return
|
|
676
|
+
if (!e || !t) return un("hsdata or kw NULL"), -1;
|
|
624
677
|
let s = 0;
|
|
625
|
-
for (const [
|
|
626
|
-
const t =
|
|
627
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
678
|
+
for (const [l, i] of Object.entries(t)) {
|
|
679
|
+
const t = fe(o.gclass, l, !1);
|
|
680
|
+
t ? (-1 === n || t.flag & n) && (t.flag & E.SDF_DEPRECATED && cn(`${Ze(o)}: Deprecated attribute used in gobj creation: ${l}`), s += ae(o, e, t, i)) : r && (r(o, l), s--);
|
|
628
681
|
}
|
|
629
682
|
return s;
|
|
630
|
-
})(
|
|
683
|
+
})(ue(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : De, e) < 0 && (un(`${Ze(e)} json2data() FAILED`), pn(r));
|
|
631
684
|
}
|
|
632
|
-
function
|
|
633
|
-
if (s &
|
|
634
|
-
if (d) return
|
|
635
|
-
s |=
|
|
685
|
+
function ke(e, n, r, o, s) {
|
|
686
|
+
if (s & w.gobj_flag_yuno) {
|
|
687
|
+
if (d) return un("__yuno__ already created"), null;
|
|
688
|
+
s |= w.gobj_flag_service;
|
|
636
689
|
} else {
|
|
637
|
-
if (!o) return
|
|
638
|
-
if (!("string" == typeof o || o instanceof
|
|
639
|
-
if (
|
|
640
|
-
}
|
|
641
|
-
if (s &
|
|
642
|
-
if (s &
|
|
643
|
-
if (b) return
|
|
644
|
-
s |=
|
|
645
|
-
}
|
|
646
|
-
if (
|
|
647
|
-
let
|
|
648
|
-
if (!
|
|
649
|
-
if (!
|
|
650
|
-
if (!
|
|
651
|
-
if (e.includes("`")) return
|
|
652
|
-
if (e.includes("^")) return
|
|
653
|
-
}
|
|
654
|
-
let _ = new
|
|
655
|
-
_.jn_attrs =
|
|
690
|
+
if (!o) return un("gobj NEEDS a parent!"), null;
|
|
691
|
+
if (!("string" == typeof o || o instanceof S)) return un(`BAD TYPE of parent: ${o}`), null;
|
|
692
|
+
if (kn(o) && !(o = Oe(o))) return cn(`parent service not found: ${o}`), null;
|
|
693
|
+
}
|
|
694
|
+
if (s & w.gobj_flag_service && Oe(e, !1)) return un(`service ALREADY registered: ${n}^${e}`), null;
|
|
695
|
+
if (s & w.gobj_flag_default_service) {
|
|
696
|
+
if (b) return un(`default service ALREADY registered: ${n}^${e}`), null;
|
|
697
|
+
s |= w.gobj_flag_service;
|
|
698
|
+
}
|
|
699
|
+
if (Un(n)) return un("gclass_name must be a string"), null;
|
|
700
|
+
let i = je(n, !1);
|
|
701
|
+
if (!i) return un(`GClass not registered: ${n}^${e}`), null;
|
|
702
|
+
if (!kn(e)) return un(`gobj_name must be a string: ${n}`), null;
|
|
703
|
+
if (!Un(e)) {
|
|
704
|
+
if (e.includes("`")) return un(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
705
|
+
if (e.includes("^")) return un(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
706
|
+
}
|
|
707
|
+
let _ = new S(e, i, r, o, s);
|
|
708
|
+
_.jn_attrs = ie(_, i.attrs_table);
|
|
656
709
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
657
710
|
let a = K(_);
|
|
658
|
-
return a &&
|
|
711
|
+
return a && I(t("💙💙⏩ creating: %s^%s", i.gclass_name, e)), _.gobj_flag & w.gobj_flag_service && we(_), _.gobj_flag & w.gobj_flag_yuno && (d = _), _.gobj_flag & w.gobj_flag_default_service && (b = _), _.gobj_flag & w.gobj_flag_yuno || Ne(o, _), _.obflag |= N.obflag_created, _.gclass.instances++, Ae(_, r), _.gobj_flag & w.gobj_flag_service && l && l(_, null), _.gclass.gmt.mt_create2 ? _.gclass.gmt.mt_create2(_, r) : _.gclass.gmt.mt_create && _.gclass.gmt.mt_create(_), o && o.gclass.gmt.mt_child_added && (a && I(t("👦👦🔵 child_added(%s): %s", et(o), Ze(_))), o.gclass.gmt.mt_child_added(o, _)), a && I(t("💙💙⏪ created: %s", et(_))), _;
|
|
659
712
|
}
|
|
660
|
-
function
|
|
661
|
-
return
|
|
713
|
+
function $e(e, t, n, r) {
|
|
714
|
+
return ke(e, t, n, r, w.gobj_flag_pure_child);
|
|
662
715
|
}
|
|
663
|
-
function
|
|
664
|
-
if (
|
|
665
|
-
e.__refs__ > 0 &&
|
|
666
|
-
if (0 ===
|
|
667
|
-
for (let t of
|
|
668
|
-
|
|
716
|
+
function Ie(e) {
|
|
717
|
+
if (ot(e)) return void un("gobj NULL or DESTROYED");
|
|
718
|
+
e.__refs__ > 0 && un(`${Ze(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (un(`Destroying a PLAYING gobj: ${et(e)}`), Me(e)), e.running && (un(`Destroying a RUNNING gobj: ${et(e)}`), Ue(e)), e.obflag |= N.obflag_destroying, function(e) {
|
|
719
|
+
if (0 === It.length) return;
|
|
720
|
+
for (let t of It) t.src === e && (t.src = null);
|
|
721
|
+
It = It.filter((t) => t.dst !== e);
|
|
669
722
|
}(e);
|
|
670
723
|
let n = K(e);
|
|
671
|
-
n &&
|
|
672
|
-
let r =
|
|
673
|
-
r && r.gclass.gmt.mt_child_removed && (n &&
|
|
674
|
-
let t =
|
|
675
|
-
t = t.toLowerCase(), p[t] ? delete p[t] :
|
|
676
|
-
}(e),
|
|
724
|
+
n && I(t("💔💔⏩ destroying: %s", et(e)));
|
|
725
|
+
let r = tt(e);
|
|
726
|
+
r && r.gclass.gmt.mt_child_removed && (n && I(t("👦👦🔴 child_removed(%s): %s", et(r), Ze(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & w.gobj_flag_service && function(e) {
|
|
727
|
+
let t = Qe(e);
|
|
728
|
+
t = t.toLowerCase(), p[t] ? delete p[t] : un(`"service NOT found in register": ${t}`);
|
|
729
|
+
}(e), Yt(e, e.dl_subscriptions, !0), Yt(e, e.dl_subscribings, !0), r && (Re(r, e), nt(e) && (st(r) !== e || ot(r) || lt(r, null))), function(e) {
|
|
677
730
|
let t = e.dl_children.slice();
|
|
678
731
|
for (let e = 0; e < t.length; e++) {
|
|
679
732
|
let n = t[e];
|
|
680
|
-
|
|
733
|
+
ot(n) || Ie(n);
|
|
681
734
|
}
|
|
682
|
-
}(e), e.obflag &
|
|
735
|
+
}(e), e.obflag & N.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && I(t("💔💔⏪ destroyed: %s", et(e))), e.obflag |= N.obflag_destroyed, e.obflag & N.obflag_created && e.gclass.instances--;
|
|
683
736
|
}
|
|
684
|
-
function
|
|
685
|
-
if (
|
|
686
|
-
if (e.running) return
|
|
687
|
-
if (e.disabled) return
|
|
688
|
-
|
|
737
|
+
function Ce(e) {
|
|
738
|
+
if (ot(e)) return un("gobj NULL or DESTROYED"), -1;
|
|
739
|
+
if (e.running) return un(`${Ze(e)}: GObj ALREADY RUNNING`), -1;
|
|
740
|
+
if (e.disabled) return un(`${Ze(e)}: GObj DISABLED`), -1;
|
|
741
|
+
B(e) && I(t("⏺ ⏺ start: %s", et(e))), e.running = !0;
|
|
689
742
|
let n = 0;
|
|
690
743
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
691
744
|
}
|
|
692
|
-
function
|
|
693
|
-
return e.gclass.gclass_flag &
|
|
745
|
+
function Pe(e, t, n) {
|
|
746
|
+
return e.gclass.gclass_flag & O.gcflag_manual_start || ot(e) || We(e) || Ke(e) || Ce(e), 0;
|
|
694
747
|
}
|
|
695
|
-
function
|
|
696
|
-
return e.gclass.gclass_flag &
|
|
748
|
+
function Le(e, t, n) {
|
|
749
|
+
return e.gclass.gclass_flag & O.gcflag_manual_start || Ke(e) ? 1 : (We(e) || Ce(e), 0);
|
|
697
750
|
}
|
|
698
|
-
function
|
|
699
|
-
if (
|
|
700
|
-
if (!e.running) return
|
|
701
|
-
e.playing && (
|
|
751
|
+
function Ue(e) {
|
|
752
|
+
if (ot(e)) return un("gobj NULL or DESTROYED"), -1;
|
|
753
|
+
if (!e.running) return un(`${Ze(e)}: GObj NOT RUNNING`), -1;
|
|
754
|
+
e.playing && (cn(`${Ze(e)}: GObj stopping without previous pause`), Me(e)), B(e) && I(t("⏹ ⏹ stop: %s", et(e))), e.running = !1;
|
|
702
755
|
let n = 0;
|
|
703
756
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
704
757
|
}
|
|
705
|
-
function
|
|
706
|
-
return
|
|
758
|
+
function Fe(e, t, n) {
|
|
759
|
+
return We(e) && Ue(e), 0;
|
|
707
760
|
}
|
|
708
|
-
function
|
|
709
|
-
return
|
|
761
|
+
function Ge(e) {
|
|
762
|
+
return ot(e) ? (un("gobj NULL or DESTROYED"), -1) : _t(e, x.WALK_FIRST2LAST, Fe, 0, 0);
|
|
710
763
|
}
|
|
711
|
-
function
|
|
712
|
-
if (
|
|
713
|
-
if (e.playing) return
|
|
714
|
-
if (e.disabled) return
|
|
715
|
-
if (!
|
|
716
|
-
if (e.gclass.gclass_flag &
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
|
|
764
|
+
function Ve(e) {
|
|
765
|
+
if (ot(e)) return un(`gobj NULL or DESTROYED: ${Ze(e)}`), -1;
|
|
766
|
+
if (e.playing) return un(`${Ze(e)}: GObj ALREADY PLAYING`), -1;
|
|
767
|
+
if (e.disabled) return un(`${Ze(e)}: GObj DISABLED`), -1;
|
|
768
|
+
if (!We(e)) {
|
|
769
|
+
if (e.gclass.gclass_flag & O.gcflag_required_start_to_play) return un(`${Ze(e)}: Cannot play, start not done`), -1;
|
|
770
|
+
cn(`${Ze(e)}: GObj playing without previous start`), Ce(e);
|
|
771
|
+
}
|
|
772
|
+
B(e) && I(t("⏯ ⏯ play: %s", et(e))), e.playing = !0;
|
|
720
773
|
let n = 0;
|
|
721
774
|
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
722
775
|
}
|
|
723
|
-
function
|
|
724
|
-
return
|
|
776
|
+
function Me(e) {
|
|
777
|
+
return ot(e) ? (un("gobj NULL or DESTROYED"), -1) : e.playing ? (B(e) && I(t("⏸ ⏸ pause: %s", et(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (un(`${Ze(e)}: GObj NOT PLAYING`), -1);
|
|
725
778
|
}
|
|
726
|
-
function
|
|
727
|
-
return !
|
|
779
|
+
function We(e) {
|
|
780
|
+
return !ot(e) && e.running;
|
|
728
781
|
}
|
|
729
|
-
function
|
|
730
|
-
return !!
|
|
782
|
+
function Ke(e) {
|
|
783
|
+
return !!ot(e) || e.disabled;
|
|
731
784
|
}
|
|
732
|
-
function
|
|
733
|
-
return !!(e && e.gobj_flag &
|
|
785
|
+
function Ye(e) {
|
|
786
|
+
return !!(e && e.gobj_flag & w.gobj_flag_service);
|
|
734
787
|
}
|
|
735
|
-
function
|
|
736
|
-
return !
|
|
788
|
+
function Be(e) {
|
|
789
|
+
return !ot(e) && e.playing;
|
|
737
790
|
}
|
|
738
|
-
function
|
|
739
|
-
return !d || d.obflag &
|
|
791
|
+
function Je() {
|
|
792
|
+
return !d || d.obflag & N.obflag_destroyed ? null : d;
|
|
740
793
|
}
|
|
741
|
-
function
|
|
742
|
-
let e =
|
|
743
|
-
return e ?
|
|
794
|
+
function He() {
|
|
795
|
+
let e = Je();
|
|
796
|
+
return e ? Qe(e) : "";
|
|
744
797
|
}
|
|
745
|
-
function
|
|
746
|
-
let e =
|
|
747
|
-
return e ?
|
|
798
|
+
function qe() {
|
|
799
|
+
let e = Je();
|
|
800
|
+
return e ? vt(e, "yuno_role") : "";
|
|
748
801
|
}
|
|
749
|
-
function
|
|
750
|
-
let e =
|
|
751
|
-
return e ?
|
|
802
|
+
function ze() {
|
|
803
|
+
let e = Je();
|
|
804
|
+
return e ? vt(e, "yuno_id") : "";
|
|
752
805
|
}
|
|
753
|
-
function
|
|
754
|
-
return
|
|
806
|
+
function Qe(e) {
|
|
807
|
+
return Ln(e) ? e.gobj_name : (un("gobj bad type"), null);
|
|
755
808
|
}
|
|
756
|
-
function
|
|
757
|
-
return
|
|
809
|
+
function Xe(e) {
|
|
810
|
+
return Ln(e) ? e.gclass.gclass_name : (un("gobj NULL of bad type"), null);
|
|
758
811
|
}
|
|
759
|
-
function
|
|
760
|
-
return
|
|
812
|
+
function Ze(e) {
|
|
813
|
+
return Ln(e) ? e.gclass.gclass_name + "^" + Qe(e) : (un("gobj bad type"), null);
|
|
761
814
|
}
|
|
762
|
-
function
|
|
763
|
-
if (!
|
|
764
|
-
let t =
|
|
765
|
-
for (; n;) t =
|
|
815
|
+
function et(e) {
|
|
816
|
+
if (!Ln(e)) return un("gobj NULL of bad type"), null;
|
|
817
|
+
let t = Ze(e), n = tt(e);
|
|
818
|
+
for (; n;) t = Ze(n) + "`" + t, n = tt(n);
|
|
766
819
|
return t;
|
|
767
820
|
}
|
|
768
|
-
function
|
|
769
|
-
return
|
|
821
|
+
function tt(e) {
|
|
822
|
+
return Ln(e) ? e.parent : (un("gobj NULL of bad type"), null);
|
|
770
823
|
}
|
|
771
|
-
function
|
|
772
|
-
return
|
|
824
|
+
function nt(e) {
|
|
825
|
+
return Ln(e) ? !!(e.gobj_flag & w.gobj_flag_volatil) : (un("gobj NULL of bad type"), null);
|
|
773
826
|
}
|
|
774
|
-
function
|
|
775
|
-
return
|
|
827
|
+
function rt(e) {
|
|
828
|
+
return Ln(e) ? !!(e.gobj_flag & w.gobj_flag_pure_child) : (un("gobj NULL of bad type"), null);
|
|
776
829
|
}
|
|
777
|
-
function
|
|
778
|
-
return !
|
|
830
|
+
function ot(e) {
|
|
831
|
+
return !Ln(e) || !!(e.obflag & (N.obflag_destroyed | N.obflag_destroying));
|
|
779
832
|
}
|
|
780
|
-
function
|
|
781
|
-
return
|
|
833
|
+
function st(e) {
|
|
834
|
+
return Ln(e) ? e.bottom_gobj : (un("gobj NULL of bad type"), null);
|
|
782
835
|
}
|
|
783
|
-
function
|
|
784
|
-
if (!
|
|
785
|
-
e.bottom_gobj &&
|
|
836
|
+
function lt(e, t) {
|
|
837
|
+
if (!Ln(e)) return un("gobj NULL of bad type"), null;
|
|
838
|
+
e.bottom_gobj && cn(`${Ze(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
786
839
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
840
|
+
function it(e, t, n) {
|
|
841
|
+
return Ln(e) ? t ? fe(e.gclass, t, n) : e.gclass.attrs_table : (un("gobj NULL of bad type"), null);
|
|
789
842
|
}
|
|
790
|
-
function
|
|
791
|
-
return
|
|
843
|
+
function _t(e, t, n, r, o) {
|
|
844
|
+
return ot(e) ? (un("gobj NULL, destroying, or bad type"), 0) : ct(e.dl_children, t, n, r, o);
|
|
792
845
|
}
|
|
793
|
-
function
|
|
794
|
-
return
|
|
846
|
+
function at(e, t, n, r, o) {
|
|
847
|
+
return ot(e) ? (un("gobj NULL, destroying, or bad type"), 0) : gt(e.dl_children, t, n, r, o);
|
|
795
848
|
}
|
|
796
|
-
function
|
|
797
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
849
|
+
function ut(e) {
|
|
850
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || un(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
798
851
|
}
|
|
799
|
-
function
|
|
800
|
-
let s,
|
|
801
|
-
if (t & x.WALK_LAST2FIRST) for (let e =
|
|
802
|
-
s =
|
|
803
|
-
let t =
|
|
852
|
+
function ct(e, t, n, r, o) {
|
|
853
|
+
let s, l = [...e];
|
|
854
|
+
if (t & x.WALK_LAST2FIRST) for (let e = l.length; e > 0; e--) {
|
|
855
|
+
s = l[e - 1];
|
|
856
|
+
let t = ut(n(s, r, o));
|
|
804
857
|
if (t < 0) return t;
|
|
805
858
|
}
|
|
806
|
-
else for (let e = 0; e <
|
|
807
|
-
s =
|
|
808
|
-
let t =
|
|
859
|
+
else for (let e = 0; e < l.length; e++) {
|
|
860
|
+
s = l[e];
|
|
861
|
+
let t = ut(n(s, r, o));
|
|
809
862
|
if (t < 0) return t;
|
|
810
863
|
}
|
|
811
864
|
return 0;
|
|
812
865
|
}
|
|
813
|
-
function
|
|
814
|
-
let s,
|
|
815
|
-
if (
|
|
866
|
+
function ft(e, t, n, r, o) {
|
|
867
|
+
let s, l = ct(e, t, n, r, o);
|
|
868
|
+
if (l < 0) return l;
|
|
816
869
|
if (t & x.WALK_LAST2FIRST) {
|
|
817
|
-
for (let
|
|
818
|
-
} else for (let
|
|
819
|
-
return
|
|
870
|
+
for (let i = e.length; i > 0; i--) if (s = e[i - 1], l = ft([...s.dl_children], t, n, r, o), l < 0) return l;
|
|
871
|
+
} else for (let i = 0; i < e.length; i++) if (s = e[i], l = ft([...s.dl_children], t, n, r, o), l < 0) return l;
|
|
872
|
+
return l;
|
|
820
873
|
}
|
|
821
|
-
function
|
|
822
|
-
if (t & x.WALK_BYLEVEL) return
|
|
823
|
-
let s,
|
|
824
|
-
if (t & x.WALK_BOTTOM2TOP) for (let
|
|
825
|
-
if (
|
|
826
|
-
if (s =
|
|
874
|
+
function gt(e, t, n, r, o) {
|
|
875
|
+
if (t & x.WALK_BYLEVEL) return ft(e, t, n, r, o);
|
|
876
|
+
let s, l;
|
|
877
|
+
if (t & x.WALK_BOTTOM2TOP) for (let i = e.length; i > 0; i--) {
|
|
878
|
+
if (l = e[i - 1], s = gt([...l.dl_children], t, n, r, o), s < 0) return s;
|
|
879
|
+
if (s = ut(n(l, r, o)), s < 0) return s;
|
|
827
880
|
}
|
|
828
|
-
else for (let
|
|
829
|
-
if (
|
|
830
|
-
if (0 === s && (s =
|
|
881
|
+
else for (let i = 0; i < e.length; i++) {
|
|
882
|
+
if (l = e[i], s = ut(n(l, r, o)), s < 0) return s;
|
|
883
|
+
if (0 === s && (s = gt([...l.dl_children], t, n, r, o), s < 0)) return s;
|
|
831
884
|
}
|
|
832
885
|
return 0;
|
|
833
886
|
}
|
|
834
|
-
function
|
|
835
|
-
if (!
|
|
887
|
+
function pt(e, t) {
|
|
888
|
+
if (!Ln(e)) return un("gobj NULL of bad type"), !1;
|
|
836
889
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
837
890
|
t.__disabled__;
|
|
838
891
|
let s = t.__state__;
|
|
839
|
-
if (n && n !==
|
|
840
|
-
if (r && r !==
|
|
892
|
+
if (n && n !== Xe(e)) return !1;
|
|
893
|
+
if (r && r !== Qe(e)) return !1;
|
|
841
894
|
if (o) {
|
|
842
895
|
let t = o.length;
|
|
843
|
-
if (o !==
|
|
896
|
+
if (o !== Qe(e).substring(0, t)) return !1;
|
|
844
897
|
}
|
|
845
|
-
if (s && s !==
|
|
846
|
-
let
|
|
847
|
-
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n &&
|
|
898
|
+
if (s && s !== Dt(e)) return !1;
|
|
899
|
+
let l = e.jn_attrs;
|
|
900
|
+
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && mt(e, n) && l[n] !== t[n]) return !1;
|
|
848
901
|
return !0;
|
|
849
902
|
}
|
|
850
|
-
function
|
|
851
|
-
if (
|
|
903
|
+
function dt(e, t) {
|
|
904
|
+
if (ot(e)) return un("gobj NULL or DESTROYED"), null;
|
|
852
905
|
const n = e.dl_children;
|
|
853
906
|
for (let e = 0; e < n.length; e++) {
|
|
854
907
|
const r = n[e];
|
|
855
|
-
if (
|
|
908
|
+
if (pt(r, t)) return r;
|
|
856
909
|
}
|
|
857
910
|
return null;
|
|
858
911
|
}
|
|
859
|
-
function
|
|
912
|
+
function bt(e, t) {
|
|
860
913
|
if (!t) return null;
|
|
861
914
|
let n = t.split("`");
|
|
862
915
|
if (!function(e, t) {
|
|
863
916
|
let n = t.split("^"), r = null, o = null;
|
|
864
917
|
if (2 === n.length) {
|
|
865
|
-
if (o = n[0], r = n[1], o !==
|
|
918
|
+
if (o = n[0], r = n[1], o !== Xe(e)) return !1;
|
|
866
919
|
} else {
|
|
867
920
|
if (1 !== n.length) return !1;
|
|
868
921
|
r = n[0];
|
|
869
922
|
}
|
|
870
|
-
return r ===
|
|
923
|
+
return r === Qe(e);
|
|
871
924
|
}(e, n[0])) return null;
|
|
872
925
|
if (1 === n.length) return e;
|
|
873
926
|
let r = n[1].split("^"), o = {};
|
|
874
927
|
1 === r.length ? o.__gobj_name__ = r : (o.__gclass_name__ = r[0], o.__gobj_name__ = r[1]);
|
|
875
|
-
let s =
|
|
876
|
-
return s ? (n.splice(0, 1), n = n.join("`"),
|
|
928
|
+
let s = dt(e, o);
|
|
929
|
+
return s ? (n.splice(0, 1), n = n.join("`"), bt(s, n)) : null;
|
|
877
930
|
}
|
|
878
|
-
function
|
|
879
|
-
return !
|
|
931
|
+
function mt(e, t) {
|
|
932
|
+
return !Un(t) && !!fe(e.gclass, t, !1);
|
|
880
933
|
}
|
|
881
|
-
function
|
|
934
|
+
function ht(e, t, n) {
|
|
882
935
|
let r = e.jn_attrs;
|
|
883
936
|
if (t in r && r.hasOwnProperty(t)) {
|
|
884
937
|
let n = r[t];
|
|
885
938
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
886
939
|
}
|
|
887
|
-
return
|
|
940
|
+
return un(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
888
941
|
}
|
|
889
|
-
function
|
|
942
|
+
function Et(e, t, n) {
|
|
890
943
|
let r = {}, o = e.gclass.attrs_table;
|
|
891
944
|
for (let n = 0; n < o.length; n++) {
|
|
892
945
|
const s = o[n];
|
|
893
946
|
if (s.name && (-1 === t || s.flag & t)) {
|
|
894
947
|
let t;
|
|
895
|
-
!e.gclass.gmt.mt_reading || e.obflag &
|
|
948
|
+
!e.gclass.gmt.mt_reading || e.obflag & N.obflag_destroyed ? t = Tn(e.jn_attrs, s.name) : (t = e.gclass.gmt.mt_reading(e, s.name), void 0 === t && (t = Tn(e.jn_attrs, s.name))), vn(r, s.name, t);
|
|
896
949
|
}
|
|
897
950
|
}
|
|
898
951
|
return r;
|
|
899
952
|
}
|
|
900
|
-
function
|
|
953
|
+
function Tt(e, t) {
|
|
901
954
|
if (t) {
|
|
902
|
-
if (0 ===
|
|
903
|
-
if (0 ===
|
|
904
|
-
if (0 ===
|
|
905
|
-
if (0 ===
|
|
955
|
+
if (0 === Vn(t, "__disabled__")) return Ke(e);
|
|
956
|
+
if (0 === Vn(t, "__running__")) return We(e);
|
|
957
|
+
if (0 === Vn(t, "__playing__")) return Be(e);
|
|
958
|
+
if (0 === Vn(t, "__service__")) return Ye(e);
|
|
959
|
+
}
|
|
960
|
+
let n = ce(e, t, !1);
|
|
961
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & N.obflag_destroyed ? Tn(n, t) : e.gclass.gmt.mt_reading(e, t) : (un(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
962
|
+
}
|
|
963
|
+
function yt(e, t) {
|
|
964
|
+
t && Vn(t, "__trace_level__");
|
|
965
|
+
let n = ce(e, t, !1);
|
|
966
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & N.obflag_destroyed ? Tn(n, t) : e.gclass.gmt.mt_reading(e, t) : (un(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
967
|
+
}
|
|
968
|
+
function vt(e, t) {
|
|
969
|
+
if (t && 0 === Vn(t, "__state__")) return Dt(e);
|
|
970
|
+
let n = ce(e, t, !1);
|
|
971
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & N.obflag_destroyed ? Tn(n, t) : e.gclass.gmt.mt_reading(e, t) : (un(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
972
|
+
}
|
|
973
|
+
function jt(e, t) {
|
|
974
|
+
let n = ce(e, t, !1);
|
|
975
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & N.obflag_destroyed ? Tn(n, t) : e.gclass.gmt.mt_reading(e, t) : (un(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
976
|
+
}
|
|
977
|
+
function St(e, n, r, o) {
|
|
978
|
+
if (!kn(n)) return un(t("gobj_write_attr(%s): path must be a string", Ze(e))), -1;
|
|
979
|
+
let s, l = e.jn_attrs, i = n.split("`");
|
|
980
|
+
if (i.length <= 1) {
|
|
981
|
+
let o = n;
|
|
982
|
+
return o in l && l.hasOwnProperty(o) ? (l[o] = r, Dn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & N.obflag_created && !(e.obflag & N.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0) : (un(t("gobj_write_attr(%s): attr not found '%s'", Ze(e), o)), -1);
|
|
906
983
|
}
|
|
907
|
-
let
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
function at(e, t) {
|
|
921
|
-
let n = X(e, t, !1);
|
|
922
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
984
|
+
let _ = i.length;
|
|
985
|
+
for (let t = 0; t < _; t++) {
|
|
986
|
+
s = i[t];
|
|
987
|
+
let n = dt(e, { __gobj_name__: s });
|
|
988
|
+
if (n && t < _ - 1) {
|
|
989
|
+
e = n;
|
|
990
|
+
continue;
|
|
991
|
+
}
|
|
992
|
+
let o = e.jn_attrs;
|
|
993
|
+
if (s in o && o.hasOwnProperty(s)) return o[s] = r, Dn(e.priv) && e.priv.hasOwnProperty(s) && (e.priv[s] = r), e.obflag & N.obflag_created && !(e.obflag & N.obflag_destroyed) && e.mt_writing && e.mt_writing(e, s), 0;
|
|
994
|
+
break;
|
|
995
|
+
}
|
|
996
|
+
return un(t("gobj_write_attr(%s): attr not found '%s'", Ze(e), s)), -1;
|
|
923
997
|
}
|
|
924
|
-
function
|
|
925
|
-
let o =
|
|
926
|
-
for (const [r,
|
|
927
|
-
let t =
|
|
928
|
-
t && (-1 === n || t.flag & n) && (s +=
|
|
998
|
+
function Ot(e, t, n, r) {
|
|
999
|
+
let o = ue(e), s = 0;
|
|
1000
|
+
for (const [r, l] of Object.entries(t)) {
|
|
1001
|
+
let t = it(e, r, !0);
|
|
1002
|
+
t && (-1 === n || t.flag & n) && (s += ae(e, o, t, l));
|
|
929
1003
|
}
|
|
930
1004
|
return s;
|
|
931
1005
|
}
|
|
932
|
-
function
|
|
933
|
-
let r =
|
|
934
|
-
return r ? (r[t] =
|
|
1006
|
+
function wt(e, t, n) {
|
|
1007
|
+
let r = ce(e, t, !1);
|
|
1008
|
+
return r ? (r[t] = Fn(n), Dn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & N.obflag_created && !(e.obflag & N.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (un(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
935
1009
|
}
|
|
936
|
-
function
|
|
937
|
-
let r =
|
|
938
|
-
return r ? (r[t] = parseInt(n),
|
|
1010
|
+
function Nt(e, t, n) {
|
|
1011
|
+
let r = ce(e, t, !1);
|
|
1012
|
+
return r ? (r[t] = parseInt(n), Dn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & N.obflag_created && !(e.obflag & N.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (un(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
939
1013
|
}
|
|
940
|
-
function
|
|
941
|
-
let r =
|
|
942
|
-
return r ? (r[t] = String(n),
|
|
1014
|
+
function Rt(e, t, n) {
|
|
1015
|
+
let r = ce(e, t, !1);
|
|
1016
|
+
return r ? (r[t] = String(n), Dn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & N.obflag_created && !(e.obflag & N.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (un(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
943
1017
|
}
|
|
944
|
-
function
|
|
945
|
-
if (
|
|
1018
|
+
function xt(e, n) {
|
|
1019
|
+
if (ot(e)) return un("gobj NULL or DESTROYED"), null;
|
|
946
1020
|
if (e.current_state.state_name === n) return !1;
|
|
947
|
-
let r =
|
|
948
|
-
if (!r) return
|
|
1021
|
+
let r = de(e.gclass, n);
|
|
1022
|
+
if (!r) return un(`${Ze(e)}: state unknown, state ${n}`), !1;
|
|
949
1023
|
e.last_state = e.current_state, e.current_state = r;
|
|
950
|
-
let o =
|
|
951
|
-
return
|
|
1024
|
+
let o = H(e, "EV_STATE_CHANGED"), s = !!function(e) {
|
|
1025
|
+
return M(e) & C.TRACE_STATES;
|
|
952
1026
|
}(e);
|
|
953
|
-
return (o || s) && (1 ===
|
|
1027
|
+
return (o || s) && (1 === $ || I(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Xe(e), Qe(e), Dt(e), e.last_state.state_name))), !0;
|
|
954
1028
|
}
|
|
955
|
-
function
|
|
956
|
-
return
|
|
1029
|
+
function Dt(e) {
|
|
1030
|
+
return Ln(e) ? e.current_state.state_name : (un("hgobj NULL"), "");
|
|
957
1031
|
}
|
|
958
|
-
function
|
|
959
|
-
if (!
|
|
960
|
-
let r =
|
|
1032
|
+
function At(e, t, n) {
|
|
1033
|
+
if (!Ln(e)) return un("gobj NULL of bad type"), null;
|
|
1034
|
+
let r = ye(e.gclass, t);
|
|
961
1035
|
if (r) return r;
|
|
962
1036
|
if (n) {
|
|
963
1037
|
const e = f.length, n = f;
|
|
@@ -968,105 +1042,105 @@ function bt(e, t, n) {
|
|
|
968
1042
|
}
|
|
969
1043
|
return null;
|
|
970
1044
|
}
|
|
971
|
-
function
|
|
972
|
-
let r =
|
|
1045
|
+
function kt(e, t, n) {
|
|
1046
|
+
let r = At(e, t, !1);
|
|
973
1047
|
return !!r && !(n && !(r.event_flag & n));
|
|
974
1048
|
}
|
|
975
|
-
function
|
|
976
|
-
let r =
|
|
1049
|
+
function $t(e, t, n) {
|
|
1050
|
+
let r = At(e, t, !1);
|
|
977
1051
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & R.EVF_OUTPUT_EVENT);
|
|
978
1052
|
}
|
|
979
|
-
var
|
|
980
|
-
function
|
|
981
|
-
|
|
982
|
-
let e =
|
|
983
|
-
|
|
1053
|
+
var It = [], Ct = !1;
|
|
1054
|
+
function Pt() {
|
|
1055
|
+
Ct = !1;
|
|
1056
|
+
let e = It;
|
|
1057
|
+
It = [];
|
|
984
1058
|
let t = 0;
|
|
985
|
-
for (let n of e) n.dst.obflag & (
|
|
986
|
-
return
|
|
1059
|
+
for (let n of e) n.dst.obflag & (N.obflag_destroyed | N.obflag_destroying) || (Lt(n.dst, n.event, n.kw, n.src), t++);
|
|
1060
|
+
return It.length > 0 && !Ct && (Ct = !0, setTimeout(Pt, 0)), t;
|
|
987
1061
|
}
|
|
988
|
-
function
|
|
989
|
-
if (!(e && e instanceof
|
|
990
|
-
if (e.obflag & (
|
|
1062
|
+
function Lt(e, n, r, o) {
|
|
1063
|
+
if (!(e && e instanceof S)) return un("gobj dst NULL"), -1;
|
|
1064
|
+
if (e.obflag & (N.obflag_destroyed | N.obflag_destroying)) return un("gobj dst DESTROYED"), -1;
|
|
991
1065
|
let s = e.current_state;
|
|
992
|
-
if (!s) return
|
|
993
|
-
let
|
|
1066
|
+
if (!s) return un(`${Ze(e)}: current_state NULL`), -1;
|
|
1067
|
+
let l = H(e, n) && !q(o, n);
|
|
994
1068
|
m++;
|
|
995
|
-
let
|
|
996
|
-
if (!
|
|
997
|
-
if (
|
|
998
|
-
if (1 ===
|
|
1069
|
+
let i = be(s, n);
|
|
1070
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (m--, l && (I(1 === $ ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Ze(e), s.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Ze(e), s.state_name, n || "", o && !o.running ? "!!" : "", Ze(o))), r && l > 1 && Nn(r) && pn(r)), e.gclass.gmt.mt_inject_event(e, n, r, o)) : (l && I(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Xe(e), Qe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Xe(o), Qe(o))), un(`📛📛 Event NOT DEFINED in state 📛📛: ${Ze(e)}, ${s.state_name}, ${n}`), m--, -1);
|
|
1071
|
+
if (l) {
|
|
1072
|
+
if (1 === $) I(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Ze(e), s.state_name, o && !o.running ? "!!" : "", Ze(o)));
|
|
999
1073
|
else {
|
|
1000
1074
|
let r = "";
|
|
1001
|
-
|
|
1075
|
+
i.action && (r = wr(i.action)), I(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Xe(e), Qe(e), s.state_name, "", n || "", "", r, o && !o.running ? "!!" : "", Xe(o), Qe(o)));
|
|
1002
1076
|
}
|
|
1003
|
-
r && (
|
|
1077
|
+
r && J(e) && Nn(r) && pn(r);
|
|
1004
1078
|
}
|
|
1005
|
-
|
|
1079
|
+
i.next_state && xt(e, i.next_state);
|
|
1006
1080
|
let _ = -1;
|
|
1007
1081
|
try {
|
|
1008
|
-
|
|
1082
|
+
i.action && (_ = i.action(e, n, r, o));
|
|
1009
1083
|
} finally {}
|
|
1010
|
-
return !
|
|
1084
|
+
return !l || 1 === $ || e.obflag & N.obflag_destroyed || I(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Xe(e), Qe(e), e.current_state.state_name, n || "", $n(_) ? _ : 0)), m--, _;
|
|
1011
1085
|
}
|
|
1012
|
-
var
|
|
1086
|
+
var Ut = Object.freeze({
|
|
1013
1087
|
__hard_subscription__: 1,
|
|
1014
1088
|
__own_event__: 2
|
|
1015
|
-
}),
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1089
|
+
}), Ft = [
|
|
1090
|
+
v(h.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1091
|
+
v(h.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1092
|
+
v(h.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
1093
|
+
v(h.DTP_STRING, "renamed_event", 0, "", "rename event name"),
|
|
1094
|
+
v(h.DTP_INTEGER, "subs_flag", 0, 0, "subscription flag"),
|
|
1095
|
+
v(h.DTP_JSON, "__config__", 0, null, "subscription config"),
|
|
1096
|
+
v(h.DTP_JSON, "__global__", 0, null, "global kw, merge in publishing"),
|
|
1097
|
+
v(h.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1098
|
+
v(h.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1099
|
+
v(h.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1026
1100
|
y()
|
|
1027
1101
|
];
|
|
1028
|
-
function
|
|
1029
|
-
let s =
|
|
1030
|
-
if (t && t !==
|
|
1031
|
-
let t =
|
|
1032
|
-
|
|
1102
|
+
function Gt(e, t, n, r, o) {
|
|
1103
|
+
let s = Qn(t, r, "__config__", null), l = Qn(t, r, "__global__", null), i = Qn(t, r, "__local__", null), _ = Xn(t, r, "__filter__", null), a = !0;
|
|
1104
|
+
if (t && t !== zn(null, e, "publisher", null) && (a = !1), o && o !== zn(null, e, "subscriber", null) && (a = !1), n && n !== qn(null, e, "event", "") && (a = !1), xn(s) > 0) {
|
|
1105
|
+
let t = Qn(null, e, "__config__", null);
|
|
1106
|
+
xn(t) > 0 && bn(t, s) || (a = !1);
|
|
1033
1107
|
}
|
|
1034
|
-
if (
|
|
1035
|
-
let t =
|
|
1036
|
-
|
|
1108
|
+
if (xn(l) > 0) {
|
|
1109
|
+
let t = Qn(null, e, "__global__", null);
|
|
1110
|
+
xn(t) > 0 && bn(t, l) || (a = !1);
|
|
1037
1111
|
}
|
|
1038
|
-
if (
|
|
1039
|
-
let t =
|
|
1040
|
-
|
|
1112
|
+
if (xn(i) > 0) {
|
|
1113
|
+
let t = Qn(null, e, "__local__", null);
|
|
1114
|
+
xn(t) > 0 && bn(t, i) || (a = !1);
|
|
1041
1115
|
}
|
|
1042
|
-
if (
|
|
1043
|
-
let t =
|
|
1044
|
-
|
|
1116
|
+
if (xn(_) > 0) {
|
|
1117
|
+
let t = Xn(null, e, "__filter__", null);
|
|
1118
|
+
xn(t) > 0 && bn(t, _) || (a = !1);
|
|
1045
1119
|
}
|
|
1046
1120
|
return a;
|
|
1047
1121
|
}
|
|
1048
|
-
function
|
|
1122
|
+
function Vt(e, t, n, r, o) {
|
|
1049
1123
|
let s = [];
|
|
1050
|
-
for (let
|
|
1051
|
-
let
|
|
1052
|
-
|
|
1124
|
+
for (let l = 0; l < e.length; l++) {
|
|
1125
|
+
let i = e[l];
|
|
1126
|
+
Gt(i, t, n, r, o) && Sn(s, i);
|
|
1053
1127
|
}
|
|
1054
1128
|
return s;
|
|
1055
1129
|
}
|
|
1056
|
-
function
|
|
1057
|
-
for (let s = 0; s < e.length; s++) if (
|
|
1130
|
+
function Mt(e, t, n, r, o) {
|
|
1131
|
+
for (let s = 0; s < e.length; s++) if (Gt(e[s], t, n, r, o)) return s;
|
|
1058
1132
|
return -1;
|
|
1059
1133
|
}
|
|
1060
|
-
function
|
|
1061
|
-
let s =
|
|
1062
|
-
if (!!(
|
|
1063
|
-
|
|
1064
|
-
let _ =
|
|
1065
|
-
return _ >= 0 ?
|
|
1134
|
+
function Wt(e, n, r, o) {
|
|
1135
|
+
let s = zn(e, n, "publisher", null, qt.KW_REQUIRED), l = zn(e, n, "subscriber", null, qt.KW_REQUIRED), i = qn(e, n, "event", "", qt.KW_REQUIRED);
|
|
1136
|
+
if (!!(Hn(e, n, "subs_flag", null, qt.KW_REQUIRED) & Ut.__hard_subscription__) && !r) return -1;
|
|
1137
|
+
(Y(l) || Y(s)) && (I(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", Ze(s), Ze(l))), pn(n)), s.obflag & N.obflag_destroyed || o || s.gclass.gmt.mt_subscription_deleted && s.gclass.gmt.mt_subscription_deleted(s, n);
|
|
1138
|
+
let _ = Mt(s.dl_subscriptions, s, i, n, l);
|
|
1139
|
+
return _ >= 0 ? wn(s.dl_subscriptions, _) : (un(`${Ze(e)}: subscription in publisher not found`), pn(n)), _ = Mt(l.dl_subscribings, s, i, n, l), _ >= 0 ? wn(l.dl_subscribings, _) : (un(`${Ze(e)}: subscription in subscriber not found`), pn(n)), 0;
|
|
1066
1140
|
}
|
|
1067
|
-
function
|
|
1068
|
-
if (null == r && (r = {}), !e) return
|
|
1069
|
-
if (!o) return
|
|
1141
|
+
function Kt(e, n, r, o) {
|
|
1142
|
+
if (null == r && (r = {}), !e) return un(`publisher NULL: ev ${n}`), 0;
|
|
1143
|
+
if (!o) return un(`subscriber NULL: ev ${n}`), 0;
|
|
1070
1144
|
const s = /* @__PURE__ */ new Set([
|
|
1071
1145
|
"__config__",
|
|
1072
1146
|
"__global__",
|
|
@@ -1075,90 +1149,90 @@ function xt(e, n, r, o) {
|
|
|
1075
1149
|
"__service__"
|
|
1076
1150
|
]);
|
|
1077
1151
|
if (Object.keys(r).forEach((t) => {
|
|
1078
|
-
s.has(t) ||
|
|
1079
|
-
}),
|
|
1080
|
-
else if (!(
|
|
1081
|
-
let
|
|
1082
|
-
|
|
1083
|
-
let
|
|
1084
|
-
let o =
|
|
1085
|
-
|
|
1152
|
+
s.has(t) || un(`${Ze(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1153
|
+
}), Un(n)) n = "";
|
|
1154
|
+
else if (!($t(e, n, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return un(`event NOT in output event list: ${Ze(e)}, ${n}`), 0;
|
|
1155
|
+
let l = Vt(e.dl_subscriptions, e, n, r, o);
|
|
1156
|
+
Rn(l) > 0 && (un(`${Ze(e)}: ${Rn(l)} subscription(s) REPEATED, will be deleted and override`), pn(l, "subscription REPEATED"), Yt(e, l, !1));
|
|
1157
|
+
let i = function(e, t, n, r) {
|
|
1158
|
+
let o = ie(e, Ft);
|
|
1159
|
+
jn(o, "event", t), jn(o, "subscriber", r), jn(o, "publisher", e);
|
|
1086
1160
|
let s = 0;
|
|
1087
1161
|
if (n) {
|
|
1088
|
-
let t =
|
|
1089
|
-
if (
|
|
1090
|
-
let n =
|
|
1091
|
-
if (
|
|
1092
|
-
let t =
|
|
1093
|
-
|
|
1162
|
+
let t = Qn(e, n, "__config__", null), r = Qn(e, n, "__global__", null), l = Qn(e, n, "__local__", null), i = Xn(e, n, "__filter__", null), _ = qn(e, n, "__service__", "");
|
|
1163
|
+
if (xn(r) > 0 && jn(o, "__global__", dn(r)), xn(t) > 0) {
|
|
1164
|
+
let n = dn(t);
|
|
1165
|
+
if (jn(o, "__config__", n), Kn(n, "__hard_subscription__")) {
|
|
1166
|
+
let t = Jn(e, n, "__hard_subscription__", !1);
|
|
1167
|
+
yn(n, "__hard_subscription__"), t && (s |= Ut.__hard_subscription__);
|
|
1094
1168
|
}
|
|
1095
|
-
if (
|
|
1096
|
-
let t =
|
|
1097
|
-
|
|
1169
|
+
if (Kn(n, "__own_event__")) {
|
|
1170
|
+
let t = Jn(e, n, "__own_event__", !1);
|
|
1171
|
+
yn(n, "__own_event__"), t && (s |= Ut.__own_event__);
|
|
1098
1172
|
}
|
|
1099
1173
|
}
|
|
1100
|
-
|
|
1174
|
+
xn(l) > 0 && jn(o, "__local__", dn(l)), xn(i) > 0 && jn(o, "__filter__", dn(i)), Un(_) || jn(o, "__service__", _);
|
|
1101
1175
|
}
|
|
1102
|
-
return
|
|
1176
|
+
return jn(o, "subs_flag", s), o;
|
|
1103
1177
|
}(e, n, r, o);
|
|
1104
|
-
if (!
|
|
1105
|
-
if (
|
|
1106
|
-
let t = e.gclass.gmt.mt_subscription_added(e,
|
|
1107
|
-
(t < 0 || !1 === t) && (
|
|
1178
|
+
if (!i) return un(`${Ze(e)}: _create_subscription() FAILED`), 0;
|
|
1179
|
+
if (Sn(e.dl_subscriptions, i), Sn(o.dl_subscribings, i), (Y(o) || Y(e)) && (I(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Ze(e), Ze(o))), r && pn(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1180
|
+
let t = e.gclass.gmt.mt_subscription_added(e, i);
|
|
1181
|
+
(t < 0 || !1 === t) && (Wt(e, i, !0, !0), i = 0);
|
|
1108
1182
|
}
|
|
1109
|
-
return
|
|
1183
|
+
return i;
|
|
1110
1184
|
}
|
|
1111
|
-
function
|
|
1185
|
+
function Yt(e, t, n) {
|
|
1112
1186
|
let r = [...t];
|
|
1113
|
-
for (let t = 0; t < r.length; t++)
|
|
1187
|
+
for (let t = 0; t < r.length; t++) Wt(e, r[t], n, !1);
|
|
1114
1188
|
return 0;
|
|
1115
1189
|
}
|
|
1116
|
-
function
|
|
1117
|
-
return null == n && (n = {}),
|
|
1190
|
+
function Bt(e, t, n, r) {
|
|
1191
|
+
return null == n && (n = {}), Vt(e.dl_subscriptions, e, t, n, r);
|
|
1118
1192
|
}
|
|
1119
|
-
function
|
|
1120
|
-
return
|
|
1193
|
+
function Jt(e, t, n, r) {
|
|
1194
|
+
return Vt(e.dl_subscribings, r, t, n, e);
|
|
1121
1195
|
}
|
|
1122
|
-
function
|
|
1123
|
-
if (
|
|
1124
|
-
if (
|
|
1125
|
-
let o =
|
|
1126
|
-
if (!(o && o.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
1127
|
-
let s =
|
|
1128
|
-
if (s && (
|
|
1196
|
+
function Ht(e, n, r) {
|
|
1197
|
+
if (Dn(r) || (r = {}), !e || e.obflag & (N.obflag_destroyed | N.obflag_destroying)) return un("gobj NULL or DESTROYED"), -1;
|
|
1198
|
+
if (Un(n)) return un(`${Ze(e)}: event EMPTY`), -1;
|
|
1199
|
+
let o = At(e, n, !0);
|
|
1200
|
+
if (!(o && o.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return un(`event NOT in output event list: ${Ze(e)}, ev ${n}`), -1;
|
|
1201
|
+
let s = (Y(e) || H(e, n)) && !q(e, n);
|
|
1202
|
+
if (s && (I(1 === $ ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Ze(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Xe(e), Qe(e), e.current_state.state_name, "", n || "", "")), Nn(r) && pn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1129
1203
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1130
1204
|
if (t <= 0) return t;
|
|
1131
1205
|
}
|
|
1132
|
-
let
|
|
1133
|
-
for (let o = 0; o <
|
|
1134
|
-
let a =
|
|
1206
|
+
let l = [...e.dl_subscriptions], i = 0, _ = 0;
|
|
1207
|
+
for (let o = 0; o < l.length; o++) {
|
|
1208
|
+
let a = l[o];
|
|
1135
1209
|
if (e.gclass.gmt.mt_publication_pre_filter) {
|
|
1136
1210
|
let t = e.gclass.gmt.mt_publication_pre_filter(e, a, n, r);
|
|
1137
1211
|
if (t < 0) break;
|
|
1138
1212
|
if (!t) continue;
|
|
1139
1213
|
}
|
|
1140
|
-
let u =
|
|
1141
|
-
if (!u ||
|
|
1142
|
-
let c =
|
|
1143
|
-
if (
|
|
1144
|
-
|
|
1145
|
-
let o =
|
|
1146
|
-
if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) :
|
|
1214
|
+
let u = zn(e, a, "subscriber", null, qt.KW_REQUIRED);
|
|
1215
|
+
if (!u || ot(u)) continue;
|
|
1216
|
+
let c = Hn(e, a, "subs_flag", 0, qt.KW_REQUIRED), f = qn(e, a, "event", "", qt.KW_REQUIRED);
|
|
1217
|
+
if (Un(f) || 0 === Vn(f, n)) {
|
|
1218
|
+
Qn(e, a, "__config__", null, 0);
|
|
1219
|
+
let o = Qn(e, a, "__global__", null, 0), l = Qn(e, a, "__local__", null, 0), f = Xn(e, a, "__filter__", null, 0), g = r, p = 1;
|
|
1220
|
+
if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) : xn(f) > 0 && (p = nr(g, f) ? 1 : 0, s && (I(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", p ? "👍" : "👎", n || "", Ze(u), Ze(e))), pn(f))), p < 0) break;
|
|
1147
1221
|
if (!p) continue;
|
|
1148
|
-
let d =
|
|
1149
|
-
if (d && d.event_flag & R.EVF_SYSTEM_EVENT && !
|
|
1150
|
-
|
|
1151
|
-
let b =
|
|
1152
|
-
if (b < 0 && c &
|
|
1153
|
-
|
|
1222
|
+
let d = At(u, n, !0);
|
|
1223
|
+
if (d && d.event_flag & R.EVF_SYSTEM_EVENT && !kt(u, d.event_name, 0)) continue;
|
|
1224
|
+
l && Wn(g, l), o && mn(g, o), s && (I(1 === $ ? t("🔝🔄 %s (%s) %s%s", n || "", n || "", u.running ? "" : "!!", Ze(u)) : t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", Ze(u), Dt(u), n || "", e && !e.running ? "!!" : "", Ze(e))), Nn(g) && pn(g));
|
|
1225
|
+
let b = Lt(u, n, g, e);
|
|
1226
|
+
if (b < 0 && c & Ut.__own_event__) {
|
|
1227
|
+
i = -1;
|
|
1154
1228
|
break;
|
|
1155
1229
|
}
|
|
1156
|
-
if (_ += b,
|
|
1230
|
+
if (_ += b, i++, ot(e)) break;
|
|
1157
1231
|
}
|
|
1158
1232
|
}
|
|
1159
|
-
return
|
|
1233
|
+
return i || o && o.event_flag & R.EVF_NO_WARN_SUBS || cn(`${Ze(e)}: Publish event WITHOUT subscribers, ev ${n}`), _;
|
|
1160
1234
|
}
|
|
1161
|
-
var
|
|
1235
|
+
var qt = Object.freeze({
|
|
1162
1236
|
KW_REQUIRED: 1,
|
|
1163
1237
|
KW_CREATE: 2,
|
|
1164
1238
|
KW_WILD_NUMBER: 4,
|
|
@@ -1178,33 +1252,33 @@ Object.freeze({
|
|
|
1178
1252
|
JSON_FALSE: 7,
|
|
1179
1253
|
JSON_NULL: 8
|
|
1180
1254
|
});
|
|
1181
|
-
var
|
|
1182
|
-
var
|
|
1183
|
-
var
|
|
1184
|
-
function
|
|
1185
|
-
if (!
|
|
1186
|
-
if (!
|
|
1255
|
+
var zt = "undefined" != typeof window ? window.console : console, Qt = zt.error, Xt = zt.warn, Zt = zt.info, en = zt.debug, tn = null;
|
|
1256
|
+
var nn = !0;
|
|
1257
|
+
var rn = null;
|
|
1258
|
+
function on(e, t) {
|
|
1259
|
+
if (!nn) return !1;
|
|
1260
|
+
if (!rn) return !0;
|
|
1187
1261
|
try {
|
|
1188
|
-
return !!
|
|
1262
|
+
return !!rn(e, t);
|
|
1189
1263
|
} catch (e) {
|
|
1190
1264
|
return !0;
|
|
1191
1265
|
}
|
|
1192
1266
|
}
|
|
1193
|
-
var
|
|
1194
|
-
function
|
|
1195
|
-
if (
|
|
1196
|
-
|
|
1267
|
+
var sn = !1;
|
|
1268
|
+
function ln(e, t, n) {
|
|
1269
|
+
if (tn && !sn) {
|
|
1270
|
+
sn = !0;
|
|
1197
1271
|
try {
|
|
1198
|
-
|
|
1272
|
+
tn(e, t, n);
|
|
1199
1273
|
} catch (e) {} finally {
|
|
1200
|
-
|
|
1274
|
+
sn = !1;
|
|
1201
1275
|
}
|
|
1202
1276
|
}
|
|
1203
1277
|
}
|
|
1204
|
-
function
|
|
1205
|
-
e ? (
|
|
1278
|
+
function _n(e) {
|
|
1279
|
+
e ? (Qt = e, Xt = e) : (Qt = zt.error, Xt = zt.warn);
|
|
1206
1280
|
}
|
|
1207
|
-
function
|
|
1281
|
+
function an(e) {
|
|
1208
1282
|
const t = Array.prototype.slice.call(arguments);
|
|
1209
1283
|
let n = "";
|
|
1210
1284
|
if ("string" == typeof e) {
|
|
@@ -1226,36 +1300,36 @@ function Jt(e) {
|
|
|
1226
1300
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1227
1301
|
return n;
|
|
1228
1302
|
}
|
|
1229
|
-
function
|
|
1230
|
-
let t =
|
|
1231
|
-
|
|
1303
|
+
function un(e) {
|
|
1304
|
+
let t = an(e), n = jr();
|
|
1305
|
+
Qt && (Qt === zt.error ? on("error", t) && Qt("%c" + n + " ERROR: " + String(t), "color:red") : (on("error", t) && zt.error("%c" + n + " ERROR: " + String(t), "color:red"), Qt(`${n} ERROR: ${String(t)}`))), ln("error", t, n);
|
|
1232
1306
|
}
|
|
1233
|
-
function
|
|
1234
|
-
let t =
|
|
1235
|
-
|
|
1307
|
+
function cn(e) {
|
|
1308
|
+
let t = an(e), n = jr();
|
|
1309
|
+
Xt && (Xt === zt.warn ? on("warning", t) && Xt("%c" + n + " WARNING: " + String(t), "color:yellow") : (on("warning", t) && zt.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Xt(`${n} WARNING: ${String(t)}`))), ln("warning", t, n);
|
|
1236
1310
|
}
|
|
1237
|
-
function
|
|
1238
|
-
let t =
|
|
1239
|
-
|
|
1311
|
+
function fn(e) {
|
|
1312
|
+
let t = an(e), n = jr();
|
|
1313
|
+
en && on("debug", t) && en("%c" + n + " DEBUG: " + String(t), "color:silver"), ln("debug", t, n);
|
|
1240
1314
|
}
|
|
1241
|
-
function
|
|
1242
|
-
let t =
|
|
1243
|
-
|
|
1315
|
+
function gn(e) {
|
|
1316
|
+
let t = an(e), n = jr();
|
|
1317
|
+
en && on("msg", t) && en("%c" + n + " MSG: " + String(t), "color:cyan"), ln("msg", t, n);
|
|
1244
1318
|
}
|
|
1245
|
-
function
|
|
1246
|
-
|
|
1319
|
+
function pn(e, t) {
|
|
1320
|
+
on("json", t) && (t && window.console.warn("=====> " + t), window.console.dir(e)), ln("json", e, jr());
|
|
1247
1321
|
}
|
|
1248
|
-
function
|
|
1322
|
+
function dn(e) {
|
|
1249
1323
|
return structuredClone(e);
|
|
1250
1324
|
}
|
|
1251
|
-
function
|
|
1325
|
+
function bn(e, t) {
|
|
1252
1326
|
if (e === t) return !0;
|
|
1253
1327
|
if (null === e || null === t) return e === t;
|
|
1254
1328
|
if (typeof e != typeof t) return !1;
|
|
1255
1329
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1256
1330
|
if (Array.isArray(e)) {
|
|
1257
1331
|
if (e.length !== t.length) return !1;
|
|
1258
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1332
|
+
for (let n = 0; n < e.length; n++) if (!bn(e[n], t[n])) return !1;
|
|
1259
1333
|
return !0;
|
|
1260
1334
|
}
|
|
1261
1335
|
if ("object" == typeof e) {
|
|
@@ -1263,211 +1337,211 @@ function en(e, t) {
|
|
|
1263
1337
|
if (n.length !== r.length) return !1;
|
|
1264
1338
|
for (let o = 0; o < n.length; o++) {
|
|
1265
1339
|
if (n[o] !== r[o]) return !1;
|
|
1266
|
-
if (!
|
|
1340
|
+
if (!bn(e[n[o]], t[r[o]])) return !1;
|
|
1267
1341
|
}
|
|
1268
1342
|
return !0;
|
|
1269
1343
|
}
|
|
1270
1344
|
return e === t;
|
|
1271
1345
|
}
|
|
1272
|
-
function
|
|
1346
|
+
function mn(e, t) {
|
|
1273
1347
|
if (!t) return e;
|
|
1274
1348
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1275
1349
|
return e;
|
|
1276
1350
|
}
|
|
1277
|
-
function
|
|
1351
|
+
function hn(e, t) {
|
|
1278
1352
|
if (!t) return e;
|
|
1279
1353
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1280
1354
|
return e;
|
|
1281
1355
|
}
|
|
1282
|
-
function
|
|
1356
|
+
function En(e, t) {
|
|
1283
1357
|
if (!t) return e;
|
|
1284
1358
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1285
1359
|
return e;
|
|
1286
1360
|
}
|
|
1287
|
-
function
|
|
1361
|
+
function Tn(e, t) {
|
|
1288
1362
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1289
1363
|
}
|
|
1290
|
-
function
|
|
1364
|
+
function yn(e, t) {
|
|
1291
1365
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1292
1366
|
}
|
|
1293
|
-
function
|
|
1367
|
+
function vn(e, t, n) {
|
|
1294
1368
|
e[t] = n;
|
|
1295
1369
|
}
|
|
1296
|
-
function
|
|
1370
|
+
function jn(e, t, n) {
|
|
1297
1371
|
e[t] = n;
|
|
1298
1372
|
}
|
|
1299
|
-
function
|
|
1373
|
+
function Sn(e, t) {
|
|
1300
1374
|
e.push(t);
|
|
1301
1375
|
}
|
|
1302
|
-
function
|
|
1376
|
+
function On(e, t) {
|
|
1303
1377
|
e.push(t);
|
|
1304
1378
|
}
|
|
1305
|
-
function
|
|
1379
|
+
function wn(e, t) {
|
|
1306
1380
|
e.splice(t, 1);
|
|
1307
1381
|
}
|
|
1308
|
-
function
|
|
1309
|
-
return
|
|
1382
|
+
function Nn(e) {
|
|
1383
|
+
return Dn(e) ? Object.keys(e).length : 0;
|
|
1310
1384
|
}
|
|
1311
|
-
function
|
|
1312
|
-
return
|
|
1385
|
+
function Rn(e) {
|
|
1386
|
+
return An(e) ? e.length : 0;
|
|
1313
1387
|
}
|
|
1314
|
-
function
|
|
1315
|
-
return
|
|
1388
|
+
function xn(e) {
|
|
1389
|
+
return Dn(e) ? Object.keys(e).length : An(e) ? e.length : kn(e) && e.length > 0 ? 1 : 0;
|
|
1316
1390
|
}
|
|
1317
|
-
function
|
|
1391
|
+
function Dn(e) {
|
|
1318
1392
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1319
1393
|
}
|
|
1320
|
-
function
|
|
1394
|
+
function An(e) {
|
|
1321
1395
|
return Array.isArray(e);
|
|
1322
1396
|
}
|
|
1323
|
-
function
|
|
1397
|
+
function kn(e) {
|
|
1324
1398
|
return "string" == typeof e;
|
|
1325
1399
|
}
|
|
1326
|
-
function
|
|
1400
|
+
function $n(e) {
|
|
1327
1401
|
return "number" == typeof e && Number.isFinite(e);
|
|
1328
1402
|
}
|
|
1329
|
-
function
|
|
1403
|
+
function In(e) {
|
|
1330
1404
|
return "boolean" == typeof e;
|
|
1331
1405
|
}
|
|
1332
|
-
function
|
|
1406
|
+
function Cn(e) {
|
|
1333
1407
|
return null == e;
|
|
1334
1408
|
}
|
|
1335
|
-
function
|
|
1409
|
+
function Pn(e) {
|
|
1336
1410
|
return "function" == typeof e;
|
|
1337
1411
|
}
|
|
1338
|
-
function
|
|
1339
|
-
return e instanceof
|
|
1412
|
+
function Ln(e) {
|
|
1413
|
+
return e instanceof S;
|
|
1340
1414
|
}
|
|
1341
|
-
function
|
|
1342
|
-
return !
|
|
1415
|
+
function Un(e) {
|
|
1416
|
+
return !kn(e) || 0 === e.length;
|
|
1343
1417
|
}
|
|
1344
|
-
function
|
|
1345
|
-
return
|
|
1418
|
+
function Fn(e) {
|
|
1419
|
+
return $n(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1346
1420
|
}
|
|
1347
|
-
function
|
|
1421
|
+
function Gn(e, t) {
|
|
1348
1422
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1349
1423
|
}
|
|
1350
|
-
function
|
|
1424
|
+
function Vn(e, t) {
|
|
1351
1425
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1352
1426
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1353
1427
|
}
|
|
1354
|
-
function
|
|
1355
|
-
if (
|
|
1356
|
-
if (
|
|
1428
|
+
function Mn(e, t) {
|
|
1429
|
+
if (Dn(e) || Dn(t) || An(e) || An(t)) return 0;
|
|
1430
|
+
if ($n(e) || $n(t)) {
|
|
1357
1431
|
let n = Number(e), r = Number(t);
|
|
1358
1432
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1359
1433
|
}
|
|
1360
|
-
if (
|
|
1434
|
+
if (In(e) || In(t)) {
|
|
1361
1435
|
let n = Number(e), r = Number(t);
|
|
1362
1436
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1363
1437
|
}
|
|
1364
|
-
return
|
|
1438
|
+
return Gn(String(e), String(t));
|
|
1365
1439
|
}
|
|
1366
|
-
function
|
|
1367
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1440
|
+
function Wn(e, t) {
|
|
1441
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Wn(e, n);
|
|
1368
1442
|
else "string" == typeof t && delete e[t];
|
|
1369
1443
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1370
1444
|
}
|
|
1371
|
-
function
|
|
1445
|
+
function Kn(e, t) {
|
|
1372
1446
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1373
1447
|
}
|
|
1374
|
-
function
|
|
1375
|
-
if (e && !
|
|
1376
|
-
if (!
|
|
1448
|
+
function Yn(e, t, n, r) {
|
|
1449
|
+
if (e && !Ln(e) && un("GObj bad instanceof"), !Dn(t) && !An(t)) return un(`${Ze(e)}: kw must be list or dict`), 0;
|
|
1450
|
+
if (!kn(n)) return un(`${Ze(e)}: path must be a string: ${String(n)}`), 0;
|
|
1377
1451
|
let o = n.split("`");
|
|
1378
1452
|
if (o.length <= 1) return t[n];
|
|
1379
1453
|
let s = o.length;
|
|
1380
|
-
for (let
|
|
1454
|
+
for (let l = 0; l < s; l++) if (void 0 === (t = t[o[l]])) return void (r && un(`${Ze(e)}: path not found: ${String(n)}`));
|
|
1381
1455
|
return t;
|
|
1382
1456
|
}
|
|
1383
|
-
function
|
|
1384
|
-
e && !
|
|
1457
|
+
function Bn(e, t, n) {
|
|
1458
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
1385
1459
|
let [r, o] = function(e, t) {
|
|
1386
1460
|
let n = e.lastIndexOf(t);
|
|
1387
1461
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1388
1462
|
}(n, "`");
|
|
1389
|
-
return
|
|
1463
|
+
return Un(o) ? yn(t, n) : yn(Yn(e, t, r, !0), o), 0;
|
|
1390
1464
|
}
|
|
1391
|
-
function
|
|
1392
|
-
e && !
|
|
1393
|
-
let s =
|
|
1394
|
-
const
|
|
1465
|
+
function Jn(e, t, n, r, o) {
|
|
1466
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
1467
|
+
let s = Yn(e, t, n, !1);
|
|
1468
|
+
const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
|
|
1395
1469
|
if (void 0 === s) {
|
|
1396
|
-
if (
|
|
1470
|
+
if (i) {
|
|
1397
1471
|
let o = Boolean(r);
|
|
1398
|
-
return
|
|
1472
|
+
return Zn(e, t, n, o), o;
|
|
1399
1473
|
}
|
|
1400
|
-
return
|
|
1474
|
+
return l && (un(`path not found: '${n}'`), pn(t)), Boolean(r);
|
|
1401
1475
|
}
|
|
1402
|
-
return _ &&
|
|
1476
|
+
return _ && Bn(e, t, n), Boolean(s);
|
|
1403
1477
|
}
|
|
1404
|
-
function
|
|
1405
|
-
e && !
|
|
1406
|
-
let s =
|
|
1407
|
-
const
|
|
1478
|
+
function Hn(e, t, n, r, o) {
|
|
1479
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
1480
|
+
let s = Yn(e, t, n, !1);
|
|
1481
|
+
const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
|
|
1408
1482
|
if (void 0 === s) {
|
|
1409
|
-
if (
|
|
1483
|
+
if (i) {
|
|
1410
1484
|
let o = parseInt(r);
|
|
1411
|
-
return
|
|
1485
|
+
return Zn(e, t, n, o), o;
|
|
1412
1486
|
}
|
|
1413
|
-
return
|
|
1487
|
+
return l && (un(`path not found: '${n}'`), pn(t)), parseInt(r);
|
|
1414
1488
|
}
|
|
1415
|
-
return _ &&
|
|
1489
|
+
return _ && Bn(e, t, n), $n(s) ? parseInt(s) : (l && (un(`path value MUST BE a number: ${n}`), gn(t)), parseInt(r));
|
|
1416
1490
|
}
|
|
1417
|
-
function
|
|
1418
|
-
e && !
|
|
1419
|
-
let s =
|
|
1420
|
-
const
|
|
1491
|
+
function qn(e, t, n, r, o) {
|
|
1492
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
1493
|
+
let s = Yn(e, t, n, !1);
|
|
1494
|
+
const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
|
|
1421
1495
|
if (void 0 === s) {
|
|
1422
|
-
if (
|
|
1496
|
+
if (i) {
|
|
1423
1497
|
let o = String(r);
|
|
1424
|
-
return
|
|
1498
|
+
return Zn(e, t, n, o), o;
|
|
1425
1499
|
}
|
|
1426
|
-
return
|
|
1500
|
+
return l && (un(`path not found: '${n}'`), pn(t)), String(r);
|
|
1427
1501
|
}
|
|
1428
|
-
return _ &&
|
|
1502
|
+
return _ && Bn(e, t, n), kn(s) ? String(s) : (l && (un(`${Ze(e)}: path value MUST BE a string: ${n}`), gn(t)), String(r));
|
|
1429
1503
|
}
|
|
1430
|
-
function
|
|
1431
|
-
e && !
|
|
1432
|
-
let s =
|
|
1433
|
-
const
|
|
1504
|
+
function zn(e, t, n, r, o) {
|
|
1505
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
1506
|
+
let s = Yn(e, t, n, !1);
|
|
1507
|
+
const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
|
|
1434
1508
|
if (void 0 === s) {
|
|
1435
|
-
if (
|
|
1509
|
+
if (i) {
|
|
1436
1510
|
let o = r;
|
|
1437
|
-
return
|
|
1511
|
+
return Zn(e, t, n, o), o;
|
|
1438
1512
|
}
|
|
1439
|
-
return
|
|
1513
|
+
return l && (un(`path not found: '${n}'`), pn(t)), r;
|
|
1440
1514
|
}
|
|
1441
|
-
return _ &&
|
|
1515
|
+
return _ && Bn(e, t, n), s;
|
|
1442
1516
|
}
|
|
1443
|
-
function
|
|
1444
|
-
e && !
|
|
1445
|
-
let s =
|
|
1446
|
-
const
|
|
1517
|
+
function Qn(e, t, n, r, o) {
|
|
1518
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
1519
|
+
let s = Yn(e, t, n, !1);
|
|
1520
|
+
const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
|
|
1447
1521
|
if (void 0 === s) {
|
|
1448
|
-
if (
|
|
1522
|
+
if (i) {
|
|
1449
1523
|
let o = Object(r);
|
|
1450
|
-
return
|
|
1524
|
+
return Zn(e, t, n, o), o;
|
|
1451
1525
|
}
|
|
1452
|
-
return
|
|
1526
|
+
return l && (un(`path not found: '${n}'`), pn(t)), Object(r);
|
|
1453
1527
|
}
|
|
1454
|
-
return _ &&
|
|
1528
|
+
return _ && Bn(e, t, n), Dn(s) ? Object(s) : (l && (un(`path value MUST BE a dict: ${n}`), gn(t)), Object(r));
|
|
1455
1529
|
}
|
|
1456
|
-
function
|
|
1457
|
-
e && !
|
|
1458
|
-
let s =
|
|
1459
|
-
const
|
|
1530
|
+
function Xn(e, t, n, r, o) {
|
|
1531
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
1532
|
+
let s = Yn(e, t, n, !1);
|
|
1533
|
+
const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
|
|
1460
1534
|
if (void 0 === s) {
|
|
1461
|
-
if (
|
|
1535
|
+
if (i) {
|
|
1462
1536
|
let o = r;
|
|
1463
|
-
return
|
|
1537
|
+
return Zn(e, t, n, o), o;
|
|
1464
1538
|
}
|
|
1465
|
-
return
|
|
1539
|
+
return l && (un(`path not found: '${n}'`), pn(t)), r;
|
|
1466
1540
|
}
|
|
1467
|
-
return _ &&
|
|
1541
|
+
return _ && Bn(e, t, n), s;
|
|
1468
1542
|
}
|
|
1469
|
-
function
|
|
1470
|
-
if (e && !
|
|
1543
|
+
function Zn(e, t, n, r) {
|
|
1544
|
+
if (e && !Ln(e) && un("GObj bad instanceof"), !Dn(t)) return un("kw is not an object"), -1;
|
|
1471
1545
|
let o = n.split("`");
|
|
1472
1546
|
if (o.length <= 1) return t[n] = r, 0;
|
|
1473
1547
|
let s = o.length;
|
|
@@ -1477,34 +1551,34 @@ function Un(e, t, n, r) {
|
|
|
1477
1551
|
}
|
|
1478
1552
|
return 0;
|
|
1479
1553
|
}
|
|
1480
|
-
function
|
|
1481
|
-
if (e && !
|
|
1482
|
-
let s =
|
|
1483
|
-
return
|
|
1554
|
+
function er(e, t, n, r, o) {
|
|
1555
|
+
if (e && !Ln(e) && un("GObj bad instanceof"), !Dn(t)) return un("kw is not an object"), -1;
|
|
1556
|
+
let s = Qn(e, t, n, {}, !0);
|
|
1557
|
+
return Dn(s) ? (s[r] = o, 0) : (un("subdict is not an object"), -1);
|
|
1484
1558
|
}
|
|
1485
|
-
function
|
|
1559
|
+
function tr(e, n, r) {
|
|
1486
1560
|
let o = "", s = !1;
|
|
1487
|
-
if (
|
|
1561
|
+
if (An(n)) {
|
|
1488
1562
|
s = !1;
|
|
1489
|
-
for (let
|
|
1490
|
-
let
|
|
1491
|
-
if (o =
|
|
1563
|
+
for (let l = 0; l < n.length; l++) {
|
|
1564
|
+
let i = n[l];
|
|
1565
|
+
if (o = Un(r) ? t("%s", r) : t("%s`%d", r, l), s = tr(e, i, o), s) break;
|
|
1492
1566
|
}
|
|
1493
|
-
} else if (
|
|
1567
|
+
} else if (Dn(n)) {
|
|
1494
1568
|
s = !0;
|
|
1495
|
-
let
|
|
1496
|
-
for (let
|
|
1497
|
-
let _ = i
|
|
1498
|
-
if (o =
|
|
1499
|
-
if (s =
|
|
1569
|
+
let l = Object.keys(n);
|
|
1570
|
+
for (let i = 0; i < l.length; i++) {
|
|
1571
|
+
let _ = l[i], a = n[_];
|
|
1572
|
+
if (o = Un(r) ? t("%s", _) : t("%s`%s", r, _), An(a) || Dn(a)) {
|
|
1573
|
+
if (s = tr(e, a, o), !s) break;
|
|
1500
1574
|
continue;
|
|
1501
1575
|
}
|
|
1502
|
-
let u =
|
|
1503
|
-
if (u || (u =
|
|
1576
|
+
let u = Xn(0, e, o, 0, 0);
|
|
1577
|
+
if (u || (u = Tn(e, o)), !u) {
|
|
1504
1578
|
s = !1;
|
|
1505
1579
|
break;
|
|
1506
1580
|
}
|
|
1507
|
-
if (0 !==
|
|
1581
|
+
if (0 !== Mn(u, a)) {
|
|
1508
1582
|
s = !1;
|
|
1509
1583
|
break;
|
|
1510
1584
|
}
|
|
@@ -1512,58 +1586,58 @@ function Gn(e, n, r) {
|
|
|
1512
1586
|
}
|
|
1513
1587
|
return s;
|
|
1514
1588
|
}
|
|
1515
|
-
function
|
|
1516
|
-
return 0 ===
|
|
1589
|
+
function nr(e, t) {
|
|
1590
|
+
return 0 === xn(t) || tr(e, t, "");
|
|
1517
1591
|
}
|
|
1518
|
-
function
|
|
1519
|
-
e && !
|
|
1592
|
+
function rr(e, t, n, r) {
|
|
1593
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
1520
1594
|
let o = {};
|
|
1521
|
-
if (
|
|
1595
|
+
if (kn(n) && !Un(n)) {
|
|
1522
1596
|
let s = n;
|
|
1523
|
-
t.hasOwnProperty(s) ? o[s] = t[s] : r &&
|
|
1524
|
-
} else if (
|
|
1597
|
+
t.hasOwnProperty(s) ? o[s] = t[s] : r && un(`${Ze(e)}: key not found: ${s}`);
|
|
1598
|
+
} else if (Dn(n) && Nn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? o[s] = t[s] : r && un(`${Ze(e)}: key not found: ${s}`);
|
|
1525
1599
|
else {
|
|
1526
|
-
if (!(
|
|
1600
|
+
if (!(An(n) && Rn(n) > 0)) return t;
|
|
1527
1601
|
for (let s = 0; s < n.length; s++) {
|
|
1528
|
-
let
|
|
1529
|
-
t.hasOwnProperty(
|
|
1602
|
+
let l = n[s];
|
|
1603
|
+
t.hasOwnProperty(l) ? o[l] = t[l] : r && un(`${Ze(e)}: key not found: ${l}`);
|
|
1530
1604
|
}
|
|
1531
1605
|
}
|
|
1532
1606
|
return o;
|
|
1533
1607
|
}
|
|
1534
|
-
function
|
|
1608
|
+
function or(e, t, n, r) {
|
|
1535
1609
|
let o = {};
|
|
1536
|
-
if (
|
|
1610
|
+
if (mn(o, t), kn(n) && !Un(n)) {
|
|
1537
1611
|
let s = n;
|
|
1538
|
-
|
|
1539
|
-
} else if (
|
|
1612
|
+
Xn(e, t, s, 0, 0) ? yn(o, s) : r && un(`${Ze(e)}: key not found: ${s}`);
|
|
1613
|
+
} else if (Dn(n) && Nn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? yn(o, s) : r && un(`${Ze(e)}: key not found: ${s}`);
|
|
1540
1614
|
else {
|
|
1541
|
-
if (!(
|
|
1615
|
+
if (!(An(n) && Rn(n) > 0)) return {};
|
|
1542
1616
|
for (let s = 0; s < n.length; s++) {
|
|
1543
|
-
let
|
|
1544
|
-
t.hasOwnProperty(
|
|
1617
|
+
let l = n[s];
|
|
1618
|
+
t.hasOwnProperty(l) ? yn(o, l) : r && un(`${Ze(e)}: key not found: ${l}`);
|
|
1545
1619
|
}
|
|
1546
1620
|
}
|
|
1547
1621
|
return o;
|
|
1548
1622
|
}
|
|
1549
|
-
function
|
|
1623
|
+
function sr(e, t, n = !1) {
|
|
1550
1624
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1551
1625
|
let r = window.localStorage.getItem(e);
|
|
1552
|
-
return null === r ? (n &&
|
|
1626
|
+
return null === r ? (n && lr(e, t), t) : JSON.parse(r);
|
|
1553
1627
|
} catch (n) {
|
|
1554
1628
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1555
1629
|
}
|
|
1556
1630
|
}
|
|
1557
|
-
function
|
|
1631
|
+
function lr(e, t) {
|
|
1558
1632
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1559
|
-
if (!e || void 0 === t) return
|
|
1633
|
+
if (!e || void 0 === t) return un(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1560
1634
|
try {
|
|
1561
1635
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1562
1636
|
} catch (t) {
|
|
1563
|
-
return
|
|
1637
|
+
return un(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1564
1638
|
}
|
|
1565
1639
|
}
|
|
1566
|
-
function
|
|
1640
|
+
function ir(e) {
|
|
1567
1641
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1568
1642
|
window.localStorage.removeItem(e);
|
|
1569
1643
|
} catch (t) {
|
|
@@ -1571,46 +1645,46 @@ function Bn(e) {
|
|
|
1571
1645
|
}
|
|
1572
1646
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1573
1647
|
}
|
|
1574
|
-
function
|
|
1575
|
-
if (
|
|
1576
|
-
if (
|
|
1648
|
+
function _r(e, t) {
|
|
1649
|
+
if (Cn(e) || Cn(t)) return !0;
|
|
1650
|
+
if (An(e)) {
|
|
1577
1651
|
if (0 === e.length) return !0;
|
|
1578
1652
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1579
|
-
} else if (
|
|
1653
|
+
} else if (Dn(e)) {
|
|
1580
1654
|
if (0 === Object.keys(e).length) return !0;
|
|
1581
1655
|
for (let n in e) if (n === t) return !0;
|
|
1582
|
-
} else if (
|
|
1656
|
+
} else if (kn(e) && e === t) return !0;
|
|
1583
1657
|
return !1;
|
|
1584
1658
|
}
|
|
1585
|
-
function
|
|
1586
|
-
if (e && !
|
|
1587
|
-
o || (o =
|
|
1659
|
+
function ar(e, t, n, r, o) {
|
|
1660
|
+
if (e && !Ln(e) && un("GObj bad instanceof"), !t) return null;
|
|
1661
|
+
o || (o = nr);
|
|
1588
1662
|
let s = [];
|
|
1589
|
-
if (
|
|
1590
|
-
let
|
|
1591
|
-
if (
|
|
1663
|
+
if (An(t)) for (let l = 0; l < t.length; l++) {
|
|
1664
|
+
let i, _ = t[l];
|
|
1665
|
+
if (Dn(_)) i = qn(e, _, "id", "", 0);
|
|
1592
1666
|
else {
|
|
1593
|
-
if (!
|
|
1594
|
-
|
|
1667
|
+
if (!kn(_)) continue;
|
|
1668
|
+
i = _;
|
|
1595
1669
|
}
|
|
1596
|
-
|
|
1670
|
+
_r(n, i) && o(_, r) && s.push(_);
|
|
1597
1671
|
}
|
|
1598
1672
|
else {
|
|
1599
|
-
if (!
|
|
1673
|
+
if (!Dn(t)) return un("kw_collect() BAD kw parameter"), null;
|
|
1600
1674
|
for (let e of Object.keys(t)) {
|
|
1601
|
-
let
|
|
1602
|
-
|
|
1675
|
+
let l = t[e];
|
|
1676
|
+
_r(n, e) && o(l, r) && s.push(l);
|
|
1603
1677
|
}
|
|
1604
1678
|
}
|
|
1605
1679
|
return s;
|
|
1606
1680
|
}
|
|
1607
|
-
function
|
|
1681
|
+
function ur(e, t) {
|
|
1608
1682
|
if (!e) return -1;
|
|
1609
1683
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1610
1684
|
return -1;
|
|
1611
1685
|
}
|
|
1612
|
-
function
|
|
1613
|
-
if (!e || !t) return
|
|
1686
|
+
function cr(e, t, n) {
|
|
1687
|
+
if (!e || !t) return un("ERROR: str_in_list() list or str empty"), !1;
|
|
1614
1688
|
let r = e.length;
|
|
1615
1689
|
if (n) {
|
|
1616
1690
|
t = t.toLowerCase();
|
|
@@ -1621,7 +1695,7 @@ function zn(e, t, n) {
|
|
|
1621
1695
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1622
1696
|
return !1;
|
|
1623
1697
|
}
|
|
1624
|
-
function
|
|
1698
|
+
function fr(e, t) {
|
|
1625
1699
|
try {
|
|
1626
1700
|
let n = e.__md_iev__;
|
|
1627
1701
|
if (n) return n[t];
|
|
@@ -1629,35 +1703,35 @@ function Qn(e, t) {
|
|
|
1629
1703
|
return;
|
|
1630
1704
|
}
|
|
1631
1705
|
}
|
|
1632
|
-
function
|
|
1706
|
+
function gr(e, t, n) {
|
|
1633
1707
|
let r = e.__md_iev__;
|
|
1634
1708
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1635
1709
|
}
|
|
1636
|
-
function
|
|
1637
|
-
if (!
|
|
1710
|
+
function pr(e, t, n, r) {
|
|
1711
|
+
if (!Ln(e)) return un("gobj is not a GObj"), null;
|
|
1638
1712
|
if (!t) return;
|
|
1639
|
-
let o =
|
|
1640
|
-
o || (o = [],
|
|
1713
|
+
let o = fr(t, n);
|
|
1714
|
+
o || (o = [], gr(t, n, o));
|
|
1641
1715
|
try {
|
|
1642
|
-
|
|
1716
|
+
An(o) && o.unshift(r);
|
|
1643
1717
|
} catch (e) {
|
|
1644
|
-
|
|
1718
|
+
un(e);
|
|
1645
1719
|
}
|
|
1646
1720
|
}
|
|
1647
|
-
function
|
|
1648
|
-
if (!
|
|
1649
|
-
if (!
|
|
1650
|
-
let o =
|
|
1651
|
-
return o ? 0 === o.length ? (r &&
|
|
1721
|
+
function dr(e, t, n, r) {
|
|
1722
|
+
if (!Ln(e)) return un("gobj is not a GObj"), null;
|
|
1723
|
+
if (!Dn(t)) return un("kw is not a dict"), null;
|
|
1724
|
+
let o = fr(t, n);
|
|
1725
|
+
return o ? 0 === o.length ? (r && un(`stack empty: ${n}`), null) : o[0] : (r && un(`stack NOT FOUND: ${n}`), null);
|
|
1652
1726
|
}
|
|
1653
|
-
function
|
|
1654
|
-
return
|
|
1727
|
+
function br(e, t, n) {
|
|
1728
|
+
return Un(n) ? Bn(e, t, "__md_iev__`__msg_type__") : er(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1655
1729
|
}
|
|
1656
|
-
function
|
|
1657
|
-
return
|
|
1730
|
+
function mr(e, t) {
|
|
1731
|
+
return qn(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1658
1732
|
}
|
|
1659
|
-
function
|
|
1660
|
-
void 0 !== n &&
|
|
1733
|
+
function hr(e, t, n) {
|
|
1734
|
+
void 0 !== n && kn(n) || (n = "");
|
|
1661
1735
|
for (let r of Object.keys(e)) {
|
|
1662
1736
|
if (!e.hasOwnProperty(r)) continue;
|
|
1663
1737
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -1666,10 +1740,10 @@ function rr(e, t, n) {
|
|
|
1666
1740
|
r,
|
|
1667
1741
|
e[r],
|
|
1668
1742
|
n
|
|
1669
|
-
]),
|
|
1743
|
+
]), Dn(e[r]) && hr(e[r], t, n), n = n.slice(0, -o.length);
|
|
1670
1744
|
}
|
|
1671
1745
|
}
|
|
1672
|
-
function
|
|
1746
|
+
function Er(e, t, n, r) {
|
|
1673
1747
|
if (!e) return null;
|
|
1674
1748
|
let o, s = e.length;
|
|
1675
1749
|
for (o = 0; o < s; o++) {
|
|
@@ -1677,15 +1751,15 @@ function or(e, t, n, r) {
|
|
|
1677
1751
|
if (s) {
|
|
1678
1752
|
let e = s.id;
|
|
1679
1753
|
if (e && e === n) return s;
|
|
1680
|
-
if (r &&
|
|
1681
|
-
let e =
|
|
1754
|
+
if (r && Kn(s, t)) {
|
|
1755
|
+
let e = Er(s[t], t, n, r);
|
|
1682
1756
|
if (e) return e;
|
|
1683
1757
|
}
|
|
1684
1758
|
}
|
|
1685
1759
|
}
|
|
1686
1760
|
return null;
|
|
1687
1761
|
}
|
|
1688
|
-
function
|
|
1762
|
+
function Tr(e) {
|
|
1689
1763
|
function t(e) {
|
|
1690
1764
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1691
1765
|
switch (t.length % 4) {
|
|
@@ -1716,36 +1790,36 @@ function sr(e) {
|
|
|
1716
1790
|
signature: t(n[2])
|
|
1717
1791
|
};
|
|
1718
1792
|
}
|
|
1719
|
-
function
|
|
1793
|
+
function yr(e) {
|
|
1720
1794
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1721
1795
|
}
|
|
1722
|
-
function
|
|
1796
|
+
function vr(e) {
|
|
1723
1797
|
const t = document.createElement("template");
|
|
1724
1798
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1725
1799
|
}
|
|
1726
|
-
function
|
|
1727
|
-
const e = /* @__PURE__ */ new Date(), t
|
|
1728
|
-
return `${
|
|
1800
|
+
function jr(e) {
|
|
1801
|
+
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), o = e.getTimezoneOffset();
|
|
1802
|
+
return `${n}.${r}${o > 0 ? "-" : "+"}${t(Math.floor(Math.abs(o) / 60), 2)}${t(Math.abs(o) % 60, 2)}`;
|
|
1729
1803
|
}
|
|
1730
|
-
function
|
|
1804
|
+
function Sr(e, t) {
|
|
1731
1805
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
1732
1806
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
1733
1807
|
return -1;
|
|
1734
1808
|
}
|
|
1735
|
-
function
|
|
1809
|
+
function Or() {
|
|
1736
1810
|
let e = "";
|
|
1737
1811
|
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;
|
|
1738
1812
|
}
|
|
1739
|
-
function
|
|
1813
|
+
function wr(e) {
|
|
1740
1814
|
let t = null;
|
|
1741
1815
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
1742
1816
|
}
|
|
1743
|
-
var
|
|
1744
|
-
function
|
|
1817
|
+
var Nr = 256, Rr = 1e5;
|
|
1818
|
+
function xr(e) {
|
|
1745
1819
|
const t = String(e).replace(/`/g, "``");
|
|
1746
1820
|
return "[" === t[0] ? "[" + t : t;
|
|
1747
1821
|
}
|
|
1748
|
-
function
|
|
1822
|
+
function Dr(e) {
|
|
1749
1823
|
if ("string" != typeof e) return null;
|
|
1750
1824
|
let t = [], n = "";
|
|
1751
1825
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -1766,17 +1840,17 @@ function dr(e) {
|
|
|
1766
1840
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
1767
1841
|
});
|
|
1768
1842
|
}
|
|
1769
|
-
function
|
|
1843
|
+
function Ar(e, t) {
|
|
1770
1844
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
1771
1845
|
}
|
|
1772
|
-
function
|
|
1773
|
-
return "persistent-attrs-" +
|
|
1846
|
+
function kr(e) {
|
|
1847
|
+
return "persistent-attrs-" + Ze(e);
|
|
1774
1848
|
}
|
|
1775
|
-
function
|
|
1776
|
-
if (
|
|
1849
|
+
function $r(e, t) {
|
|
1850
|
+
if (kn(t)) {
|
|
1777
1851
|
if (-1 === t.indexOf("^")) {
|
|
1778
1852
|
let n, r, o = e.fkey;
|
|
1779
|
-
if (1 !==
|
|
1853
|
+
if (1 !== Nn(o)) return un("bad fkey 1"), un(e), un(t), null;
|
|
1780
1854
|
for (const e of Object.keys(o)) {
|
|
1781
1855
|
n = e, r = o[e];
|
|
1782
1856
|
break;
|
|
@@ -1789,20 +1863,20 @@ function Er(e, t) {
|
|
|
1789
1863
|
}
|
|
1790
1864
|
{
|
|
1791
1865
|
let n = t.split("^");
|
|
1792
|
-
return 3 !== n.length ? (
|
|
1866
|
+
return 3 !== n.length ? (un("bad fkey 2"), un(e), un(t), null) : {
|
|
1793
1867
|
topic_name: n[0],
|
|
1794
1868
|
id: n[1],
|
|
1795
1869
|
hook_name: n[2]
|
|
1796
1870
|
};
|
|
1797
1871
|
}
|
|
1798
1872
|
}
|
|
1799
|
-
return
|
|
1873
|
+
return Dn(t) ? {
|
|
1800
1874
|
topic_name: t.topic_name,
|
|
1801
1875
|
id: t.id,
|
|
1802
1876
|
hook_name: t.hook_name
|
|
1803
|
-
} : (
|
|
1877
|
+
} : (un("bad fkey 3"), un(e), un(t), null);
|
|
1804
1878
|
}
|
|
1805
|
-
var
|
|
1879
|
+
var Ir = [
|
|
1806
1880
|
"string",
|
|
1807
1881
|
"integer",
|
|
1808
1882
|
"object",
|
|
@@ -1812,7 +1886,7 @@ var Tr = [
|
|
|
1812
1886
|
"real",
|
|
1813
1887
|
"boolean",
|
|
1814
1888
|
"blob"
|
|
1815
|
-
],
|
|
1889
|
+
], Cr = [
|
|
1816
1890
|
"persistent",
|
|
1817
1891
|
"required",
|
|
1818
1892
|
"notnull",
|
|
@@ -1824,7 +1898,7 @@ var Tr = [
|
|
|
1824
1898
|
"stats",
|
|
1825
1899
|
"rstats",
|
|
1826
1900
|
"pstats"
|
|
1827
|
-
],
|
|
1901
|
+
], Pr = [
|
|
1828
1902
|
"hook",
|
|
1829
1903
|
"fkey",
|
|
1830
1904
|
"enum",
|
|
@@ -1853,7 +1927,7 @@ var Tr = [
|
|
|
1853
1927
|
"coordinates",
|
|
1854
1928
|
"gbuffer"
|
|
1855
1929
|
];
|
|
1856
|
-
function
|
|
1930
|
+
function Lr(e) {
|
|
1857
1931
|
let t = {
|
|
1858
1932
|
name: e.id,
|
|
1859
1933
|
header: e.header,
|
|
@@ -1872,7 +1946,7 @@ function jr(e) {
|
|
|
1872
1946
|
if (!e.flag) return t;
|
|
1873
1947
|
for (let n = 0; n < e.flag.length; n++) {
|
|
1874
1948
|
let r = e.flag[n];
|
|
1875
|
-
if (
|
|
1949
|
+
if (cr(Pr, r)) {
|
|
1876
1950
|
switch (r) {
|
|
1877
1951
|
case "enum":
|
|
1878
1952
|
t.enum_list = e.enum;
|
|
@@ -1886,7 +1960,7 @@ function jr(e) {
|
|
|
1886
1960
|
case "file": t.is_file = !0;
|
|
1887
1961
|
}
|
|
1888
1962
|
t.type = r;
|
|
1889
|
-
} else if (
|
|
1963
|
+
} else if (cr(Cr, r)) switch (r) {
|
|
1890
1964
|
case "writable":
|
|
1891
1965
|
t.is_writable = !0;
|
|
1892
1966
|
break;
|
|
@@ -1899,125 +1973,191 @@ function jr(e) {
|
|
|
1899
1973
|
}
|
|
1900
1974
|
return t.is_file && (t.type = "file"), t;
|
|
1901
1975
|
}
|
|
1902
|
-
var
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1976
|
+
var Ur = [
|
|
1977
|
+
v(h.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1978
|
+
v(h.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1979
|
+
v(h.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1906
1980
|
y()
|
|
1907
|
-
],
|
|
1981
|
+
], Fr = {
|
|
1908
1982
|
periodic: !1,
|
|
1909
1983
|
msec: 0,
|
|
1910
1984
|
timer_id: -1
|
|
1911
|
-
},
|
|
1912
|
-
function
|
|
1985
|
+
}, Gr = null;
|
|
1986
|
+
function Vr(e, t, n, r) {
|
|
1913
1987
|
let o = e.priv, s = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1914
1988
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
1915
|
-
|
|
1916
|
-
}, o.msec) : o.timer_id = -1,
|
|
1989
|
+
Lt(e, "EV_TIMEOUT", {}, e);
|
|
1990
|
+
}, o.msec) : o.timer_id = -1, rt(e) ? Lt(tt(e), s, {}, e) : Ht(e, s, {}), o.periodic || -1 !== o.timer_id || We(e) && Ue(e), 0;
|
|
1917
1991
|
}
|
|
1918
|
-
var
|
|
1992
|
+
var Mr = {
|
|
1919
1993
|
mt_create: function(e) {
|
|
1920
1994
|
let t = e.priv;
|
|
1921
|
-
const n =
|
|
1922
|
-
n &&
|
|
1995
|
+
const n = jt(e, "subscriber");
|
|
1996
|
+
n && Kt(e, null, {}, n), t.periodic = Tt(e, "periodic"), t.msec = yt(e, "msec");
|
|
1923
1997
|
},
|
|
1924
1998
|
mt_writing: function(e, t) {
|
|
1925
1999
|
let n = e.priv;
|
|
1926
2000
|
switch (t) {
|
|
1927
2001
|
case "periodic":
|
|
1928
|
-
n.periodic =
|
|
2002
|
+
n.periodic = Tt(e, "periodic");
|
|
1929
2003
|
break;
|
|
1930
|
-
case "msec": n.msec =
|
|
1931
|
-
|
|
1932
|
-
}, n.msec)), n.msec > 0 ?
|
|
2004
|
+
case "msec": n.msec = yt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2005
|
+
Lt(e, "EV_TIMEOUT", {}, e);
|
|
2006
|
+
}, n.msec)), n.msec > 0 ? We(e) || Ce(e) : We(e) && Ue(e);
|
|
1933
2007
|
}
|
|
1934
2008
|
},
|
|
1935
2009
|
mt_start: function(e) {
|
|
1936
2010
|
return 0;
|
|
1937
2011
|
},
|
|
1938
2012
|
mt_stop: function(e) {
|
|
1939
|
-
return
|
|
2013
|
+
return Nt(e, "msec", -1), 0;
|
|
1940
2014
|
},
|
|
1941
2015
|
mt_destroy: function(e) {}
|
|
1942
2016
|
};
|
|
1943
|
-
function
|
|
1944
|
-
return e instanceof
|
|
2017
|
+
function Wr(e, t) {
|
|
2018
|
+
return e instanceof S ? "C_TIMER" !== Xe(e) ? (un("not C_TIMER GObj"), -1) : (wt(e, "periodic", !1), void Nt(e, "msec", t)) : (un("not GObj TYPE"), -1);
|
|
2019
|
+
}
|
|
2020
|
+
function Kr(e, t) {
|
|
2021
|
+
return e instanceof S ? "C_TIMER" !== Xe(e) ? (un("not C_TIMER GObj"), -1) : (wt(e, "periodic", !0), void Nt(e, "msec", t)) : (un("not GObj TYPE"), -1);
|
|
2022
|
+
}
|
|
2023
|
+
function Yr(e) {
|
|
2024
|
+
return e instanceof S ? "C_TIMER" !== Xe(e) ? (un("not C_TIMER GObj"), -1) : void Nt(e, "msec", -1) : (un("not GObj TYPE"), -1);
|
|
2025
|
+
}
|
|
2026
|
+
var Br = [
|
|
2027
|
+
v(h.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2028
|
+
v(h.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2029
|
+
v(h.DTP_STRING, "__username__", 0, "", "Username"),
|
|
2030
|
+
v(h.DTP_STRING, "start_date", 0, "", "Yuno starting date"),
|
|
2031
|
+
v(h.DTP_STRING, "node_uuid", 0, "", "uuid of node"),
|
|
2032
|
+
v(h.DTP_STRING, "yuno_role", 0, "", "Yuno role"),
|
|
2033
|
+
v(h.DTP_STRING, "yuno_id", 0, "", "Yuno Id. Set by agent"),
|
|
2034
|
+
v(h.DTP_STRING, "yuno_name", 0, "", "Yuno name. Set by agent"),
|
|
2035
|
+
v(h.DTP_STRING, "yuno_tag", 0, "", "Tags of yuno. Set by agent"),
|
|
2036
|
+
v(h.DTP_STRING, "yuno_release", 0, "", "Yuno Release. Set by agent"),
|
|
2037
|
+
v(h.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
2038
|
+
v(h.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
2039
|
+
v(h.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
2040
|
+
v(h.DTP_DICT, "trace_levels", E.SDF_PERSIST, "{}", "Trace levels"),
|
|
2041
|
+
v(h.DTP_DICT, "no_trace_levels", E.SDF_PERSIST, "{}", "No trace levels"),
|
|
2042
|
+
v(h.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
2043
|
+
v(h.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2044
|
+
v(h.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2045
|
+
y()
|
|
2046
|
+
], Jr = { gobj_timer: null }, Hr = null;
|
|
2047
|
+
function qr(e, t, n, r) {
|
|
2048
|
+
let o = ht(e, t);
|
|
2049
|
+
return Dn(o) || (o = {}), o[n] = r, St(e, t, o), xe(e, t);
|
|
1945
2050
|
}
|
|
1946
|
-
function
|
|
1947
|
-
|
|
2051
|
+
function zr(e) {
|
|
2052
|
+
if (!0 === e || !1 === e) return e;
|
|
2053
|
+
let t = String(null == e ? "" : e).toLowerCase();
|
|
2054
|
+
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
1948
2055
|
}
|
|
1949
|
-
function
|
|
1950
|
-
return
|
|
1951
|
-
}
|
|
1952
|
-
var Ar = [
|
|
1953
|
-
j(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
1954
|
-
j(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
1955
|
-
j(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
1956
|
-
j(E.DTP_STRING, "start_date", 0, "", "Yuno starting date"),
|
|
1957
|
-
j(E.DTP_STRING, "node_uuid", 0, "", "uuid of node"),
|
|
1958
|
-
j(E.DTP_STRING, "yuno_role", 0, "", "Yuno role"),
|
|
1959
|
-
j(E.DTP_STRING, "yuno_id", 0, "", "Yuno Id. Set by agent"),
|
|
1960
|
-
j(E.DTP_STRING, "yuno_name", 0, "", "Yuno name. Set by agent"),
|
|
1961
|
-
j(E.DTP_STRING, "yuno_tag", 0, "", "Tags of yuno. Set by agent"),
|
|
1962
|
-
j(E.DTP_STRING, "yuno_release", 0, "", "Yuno Release. Set by agent"),
|
|
1963
|
-
j(E.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
1964
|
-
j(E.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
1965
|
-
j(E.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
1966
|
-
j(E.DTP_INTEGER, "tracing", 0, 0, "Tracing level"),
|
|
1967
|
-
j(E.DTP_BOOLEAN, "trace_timer", 0, 0, "Trace timers"),
|
|
1968
|
-
j(E.DTP_BOOLEAN, "trace_inter_event", 0, 0, "Trace traffic"),
|
|
1969
|
-
j(E.DTP_POINTER, "trace_ievent_callback", 0, null, "Trace traffic callback"),
|
|
1970
|
-
j(E.DTP_BOOLEAN, "trace_creation", 0, 0, "Trace creation"),
|
|
1971
|
-
j(E.DTP_BOOLEAN, "trace_start_stop", 0, 0, "Trace start/stop"),
|
|
1972
|
-
j(E.DTP_BOOLEAN, "trace_subscriptions", 0, 0, "Trace subscription"),
|
|
1973
|
-
j(E.DTP_BOOLEAN, "trace_i18n", 0, 0, "Trace i18n"),
|
|
1974
|
-
j(E.DTP_BOOLEAN, "no_poll", 0, 0, "no poll"),
|
|
1975
|
-
j(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
1976
|
-
j(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
1977
|
-
y()
|
|
1978
|
-
], kr = { gobj_timer: null }, Ir = null;
|
|
1979
|
-
function $r(e, t, n, r) {
|
|
1980
|
-
return It(e, t, n), 0;
|
|
2056
|
+
function Qr() {
|
|
2057
|
+
return `${qe()}^${He()}`;
|
|
1981
2058
|
}
|
|
1982
|
-
|
|
2059
|
+
function Xr(e, t, n, r) {
|
|
2060
|
+
return Ht(e, t, n), 0;
|
|
2061
|
+
}
|
|
2062
|
+
var Zr = {
|
|
1983
2063
|
mt_create: function(e) {
|
|
1984
2064
|
let t = e.priv;
|
|
1985
|
-
|
|
2065
|
+
Rt(e, "start_date", jr()), Rt(e, "node_uuid", Or()), e.priv.gobj_timer = $e(Qe(e), "C_TIMER", {}, e), t.periodic_timeout = ht(e, "periodic_timeout"), function(e) {
|
|
2066
|
+
let t = ht(e, "trace_levels");
|
|
2067
|
+
if (!Dn(t)) return 0;
|
|
2068
|
+
let n = t.__global_trace__;
|
|
2069
|
+
if (An(n)) {
|
|
2070
|
+
X(4294967295, !1);
|
|
2071
|
+
for (let e of n) z(e, !0);
|
|
2072
|
+
}
|
|
2073
|
+
for (const [n, r] of Object.entries(t)) {
|
|
2074
|
+
let t = je(n);
|
|
2075
|
+
if (t) if (An(r)) {
|
|
2076
|
+
se(t, null, !1);
|
|
2077
|
+
for (let e of r) se(t, e, !0);
|
|
2078
|
+
} else un(`${Qe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2079
|
+
}
|
|
2080
|
+
}(e), function(e) {
|
|
2081
|
+
let t = ht(e, "no_trace_levels");
|
|
2082
|
+
if (!Dn(t)) return 0;
|
|
2083
|
+
let n = t.__global_no_trace__;
|
|
2084
|
+
if (An(n)) {
|
|
2085
|
+
Z(4294967295, !1);
|
|
2086
|
+
for (let e of n) Q(e, !0);
|
|
2087
|
+
}
|
|
2088
|
+
for (const [n, r] of Object.entries(t)) {
|
|
2089
|
+
let t = je(n);
|
|
2090
|
+
if (t) if (An(r)) {
|
|
2091
|
+
le(t, null, !1);
|
|
2092
|
+
for (let e of r) le(t, e, !0);
|
|
2093
|
+
} else un(`${Qe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2094
|
+
}
|
|
2095
|
+
}(e);
|
|
1986
2096
|
},
|
|
1987
2097
|
mt_writing: function(e, t) {},
|
|
1988
2098
|
mt_start: function(e) {
|
|
1989
|
-
return
|
|
2099
|
+
return Kr(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
1990
2100
|
},
|
|
1991
2101
|
mt_stop: function(e) {
|
|
1992
|
-
return
|
|
2102
|
+
return Yr(e.priv.gobj_timer), Ge(e), 0;
|
|
1993
2103
|
},
|
|
1994
2104
|
mt_destroy: function(e) {},
|
|
1995
2105
|
mt_play: function(e) {
|
|
1996
|
-
let t =
|
|
1997
|
-
return
|
|
2106
|
+
let t = Se();
|
|
2107
|
+
return We(t) || Ce(t), Be(t) || Ve(t), 0;
|
|
1998
2108
|
},
|
|
1999
2109
|
mt_pause: function(e) {
|
|
2000
|
-
return
|
|
2110
|
+
return Me(Se()), 0;
|
|
2111
|
+
},
|
|
2112
|
+
mt_command_parser: function(e, t, n, o) {
|
|
2113
|
+
switch (n = n || {}, t) {
|
|
2114
|
+
case "get-global-trace": return r(0, 0, null, null, ee());
|
|
2115
|
+
case "get-global-no-trace": return r(0, 0, null, null, te());
|
|
2116
|
+
case "set-global-trace":
|
|
2117
|
+
case "set-global-no-trace": {
|
|
2118
|
+
let o = "set-global-no-trace" === t, s = n.level, l = zr(n.set);
|
|
2119
|
+
return s ? null === l ? r(0, -1, `${Qr()}: bitmask set or re-set?`, null, null) : (o ? Q(s, l) : z(s, l)) < 0 ? r(0, -1, `${Qr()}: global trace level not found: ${s}`, null, null) : o ? (qr(e, "no_trace_levels", "__global_no_trace__", te()), r(0, 0, null, null, te())) : (qr(e, "trace_levels", "__global_trace__", ee()), r(0, 0, null, null, ee())) : r(0, -1, `${Qr()}: what level?`, null, null);
|
|
2120
|
+
}
|
|
2121
|
+
case "get-gclass-trace":
|
|
2122
|
+
case "get-gclass-no-trace":
|
|
2123
|
+
case "set-gclass-trace":
|
|
2124
|
+
case "set-gclass-no-trace": {
|
|
2125
|
+
let o = t.indexOf("no-trace") >= 0, s = n.gclass_name || n.gclass || "", l = je(s);
|
|
2126
|
+
if (!l) return r(0, -1, `${Qr()}: what gclass is '${s}'?`, null, null);
|
|
2127
|
+
if (0 === t.indexOf("get-")) return r(0, 0, null, null, o ? oe(l) : ne(l));
|
|
2128
|
+
let i = n.level, _ = zr(n.set);
|
|
2129
|
+
return i ? null === _ ? r(0, -1, `${Qr()}: bitmask set or re-set?`, null, null) : (o ? le(l, i, _) : se(l, i, _)) < 0 ? r(0, -1, `${Qr()}: trace level of ${s} not found: ${i}`, null, null) : o ? (qr(e, "no_trace_levels", s, oe(l)), r(0, 0, null, null, oe(l))) : (qr(e, "trace_levels", s, re(l)), r(0, 0, null, null, ne(l))) : r(0, -1, `${Qr()}: what level?`, null, null);
|
|
2130
|
+
}
|
|
2131
|
+
default: return r(0, -1, `${Qr()}: command not available: ${t}`, null, null);
|
|
2132
|
+
}
|
|
2001
2133
|
}
|
|
2002
2134
|
};
|
|
2003
|
-
var
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2135
|
+
var eo = "ievent_gate_stack", to = [
|
|
2136
|
+
v(h.DTP_STRING, "wanted_yuno_role", E.SDF_RD, "", "wanted yuno role"),
|
|
2137
|
+
v(h.DTP_STRING, "wanted_yuno_name", E.SDF_RD, "", "wanted yuno name"),
|
|
2138
|
+
v(h.DTP_STRING, "wanted_yuno_service", E.SDF_RD, "", "wanted yuno service"),
|
|
2139
|
+
v(h.DTP_STRING, "remote_yuno_role", E.SDF_RD, "", "confirmed remote yuno role"),
|
|
2140
|
+
v(h.DTP_STRING, "remote_yuno_name", E.SDF_RD, "", "confirmed remote yuno name"),
|
|
2141
|
+
v(h.DTP_STRING, "remote_yuno_service", E.SDF_RD, "", "confirmed remote yuno service"),
|
|
2142
|
+
v(h.DTP_STRING, "url", E.SDF_RD, "", "Url to connect"),
|
|
2143
|
+
v(h.DTP_STRING, "jwt", E.SDF_PERSIST, "", "JWT"),
|
|
2144
|
+
v(h.DTP_STRING, "cert_pem", E.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2145
|
+
v(h.DTP_JSON, "extra_info", E.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2146
|
+
v(h.DTP_LIST, "required_services", E.SDF_RD, "[]", "Services this LINK requires (identity card). Empty = the yuno's `required_services`, as before. A yuno with several links to DIFFERENT backends must set it per link: the yuno-wide list is the union, so every backend is told the service names of all the others."),
|
|
2147
|
+
v(h.DTP_INTEGER, "timeout_retry", E.SDF_RD, "5000", "First reconnect delay (ms). It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
2148
|
+
v(h.DTP_INTEGER, "timeout_retry_max", E.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2149
|
+
v(h.DTP_INTEGER, "timeout_idack", E.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2150
|
+
v(h.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2019
2151
|
y()
|
|
2020
|
-
],
|
|
2152
|
+
], no = [
|
|
2153
|
+
["ievents", "Trace inter-events with metadata of kw"],
|
|
2154
|
+
["ievents2", "Trace inter-events with full kw"],
|
|
2155
|
+
["identity-card", "Trace identity_card messages"]
|
|
2156
|
+
];
|
|
2157
|
+
function ro(e) {
|
|
2158
|
+
return !!(3 & M(e));
|
|
2159
|
+
}
|
|
2160
|
+
var oo = {
|
|
2021
2161
|
url: null,
|
|
2022
2162
|
remote_yuno_name: null,
|
|
2023
2163
|
remote_yuno_role: null,
|
|
@@ -2027,306 +2167,306 @@ var Lr = "ievent_gate_stack", Pr = [
|
|
|
2027
2167
|
websocket: null,
|
|
2028
2168
|
inside_on_open: !1,
|
|
2029
2169
|
retry_ms: 0
|
|
2030
|
-
},
|
|
2031
|
-
function
|
|
2032
|
-
e.priv.websocket &&
|
|
2033
|
-
const t =
|
|
2170
|
+
}, so = null;
|
|
2171
|
+
function lo(e) {
|
|
2172
|
+
e.priv.websocket && un("Websocket ALREADY setup");
|
|
2173
|
+
const t = vt(e, "url");
|
|
2034
2174
|
let n;
|
|
2035
|
-
|
|
2175
|
+
fn(`====> Starting WebSocket to '${t}' (${Ze(e)})`);
|
|
2036
2176
|
try {
|
|
2037
2177
|
n = new WebSocket(t);
|
|
2038
2178
|
} catch (n) {
|
|
2039
|
-
return
|
|
2179
|
+
return un(`${Ze(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
2040
2180
|
}
|
|
2041
2181
|
return n ? (n.onopen = () => {
|
|
2042
|
-
|
|
2182
|
+
Lt(e, "EV_ON_OPEN", { url: t }, e);
|
|
2043
2183
|
}, n.onmessage = (n) => {
|
|
2044
|
-
|
|
2184
|
+
Lt(e, "EV_ON_MESSAGE", {
|
|
2045
2185
|
url: t,
|
|
2046
2186
|
data: n.data
|
|
2047
2187
|
}, e);
|
|
2048
2188
|
}, n.onclose = (n) => {
|
|
2049
|
-
|
|
2189
|
+
ot(e) || (Tt(Je(), "browser_beforeunload") ? cn("Close websocket by unload page") : Lt(e, "EV_ON_CLOSE", {
|
|
2050
2190
|
url: t,
|
|
2051
2191
|
e: n
|
|
2052
2192
|
}, e));
|
|
2053
|
-
}, n) : (
|
|
2193
|
+
}, n) : (un(`${Ze(e)}: Failed to initialize WebSocket.`), null);
|
|
2054
2194
|
}
|
|
2055
|
-
function
|
|
2195
|
+
function io(e, t = 1e3, n = "") {
|
|
2056
2196
|
let r = e.priv, o = r.websocket;
|
|
2057
2197
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
2058
|
-
|
|
2198
|
+
fn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2059
2199
|
try {
|
|
2060
2200
|
o.close(t, n);
|
|
2061
2201
|
} catch (e) {
|
|
2062
|
-
|
|
2202
|
+
un("Error closing WebSocket:", e.message);
|
|
2063
2203
|
}
|
|
2064
|
-
} else
|
|
2204
|
+
} else cn("WebSocket is already closed or in the process of closing.");
|
|
2065
2205
|
}
|
|
2066
|
-
function
|
|
2067
|
-
let r =
|
|
2206
|
+
function _o(e, t, n) {
|
|
2207
|
+
let r = jr();
|
|
2068
2208
|
try {
|
|
2069
|
-
|
|
2209
|
+
fn("\n" + r + " " + t + "\n"), pn(n);
|
|
2070
2210
|
} catch (e) {
|
|
2071
|
-
|
|
2211
|
+
fn("ERROR in trace_inter_event: " + e);
|
|
2072
2212
|
}
|
|
2073
2213
|
}
|
|
2074
|
-
var
|
|
2214
|
+
var ao = class {
|
|
2075
2215
|
constructor(e, t) {
|
|
2076
2216
|
this.event = e, this.kw = t || {};
|
|
2077
2217
|
}
|
|
2078
2218
|
};
|
|
2079
|
-
function
|
|
2219
|
+
function uo(e, t, n, r) {
|
|
2080
2220
|
return function(e, t) {
|
|
2081
2221
|
let n = e.priv, r = JSON.stringify(t);
|
|
2082
|
-
if (
|
|
2083
|
-
let n =
|
|
2084
|
-
s ? s(o, t, 1, r.length) :
|
|
2222
|
+
if (ro(e)) {
|
|
2223
|
+
let n = vt(e, "url"), o = Qe(Je()) + " ==> " + n, s = ht(Je(), "trace_ievent_callback");
|
|
2224
|
+
s ? s(o, t, 1, r.length) : _o(0, o, t);
|
|
2085
2225
|
}
|
|
2086
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2226
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return cn(`${Ze(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2087
2227
|
try {
|
|
2088
2228
|
n.websocket.send(r);
|
|
2089
2229
|
} catch (t) {
|
|
2090
|
-
|
|
2230
|
+
un(`${Ze(e)}: send_iev(): ${t}`);
|
|
2091
2231
|
}
|
|
2092
2232
|
return 0;
|
|
2093
2233
|
}(e, function(e, t) {
|
|
2094
|
-
return
|
|
2234
|
+
return Un(e) ? (un("iev_create() event NULL"), null) : new ao(e, t);
|
|
2095
2235
|
}(t, n));
|
|
2096
2236
|
}
|
|
2097
|
-
function
|
|
2098
|
-
return
|
|
2099
|
-
dst_yuno:
|
|
2100
|
-
dst_role:
|
|
2237
|
+
function co(e, t, n) {
|
|
2238
|
+
return Un(n) && (n = vt(e, "wanted_yuno_service")), {
|
|
2239
|
+
dst_yuno: vt(e, "wanted_yuno_name"),
|
|
2240
|
+
dst_role: vt(e, "wanted_yuno_role"),
|
|
2101
2241
|
dst_service: n,
|
|
2102
|
-
src_yuno:
|
|
2103
|
-
src_role:
|
|
2242
|
+
src_yuno: He(),
|
|
2243
|
+
src_role: qe(),
|
|
2104
2244
|
src_service: t,
|
|
2105
|
-
host:
|
|
2245
|
+
host: Or()
|
|
2106
2246
|
};
|
|
2107
2247
|
}
|
|
2108
|
-
function
|
|
2109
|
-
let t = e.priv, n =
|
|
2110
|
-
|
|
2248
|
+
function fo(e) {
|
|
2249
|
+
let t = e.priv, n = Be(Je()), r = vt(Je(), "yuno_version"), o = vt(Je(), "yuno_release"), l = vt(Je(), "yuno_tag"), i = ht(e, "required_services");
|
|
2250
|
+
i && i.length || (i = ht(Je(), "required_services"));
|
|
2111
2251
|
let _ = {
|
|
2112
|
-
yuno_role:
|
|
2113
|
-
yuno_id:
|
|
2114
|
-
yuno_name:
|
|
2115
|
-
yuno_tag:
|
|
2252
|
+
yuno_role: qe(),
|
|
2253
|
+
yuno_id: ze(),
|
|
2254
|
+
yuno_name: He(),
|
|
2255
|
+
yuno_tag: l,
|
|
2116
2256
|
yuno_version: r,
|
|
2117
2257
|
yuno_release: o,
|
|
2118
2258
|
yuneta_version: s,
|
|
2119
2259
|
playing: n,
|
|
2120
2260
|
pid: 0,
|
|
2121
2261
|
watcher_pid: 0,
|
|
2122
|
-
jwt:
|
|
2123
|
-
username:
|
|
2262
|
+
jwt: vt(e, "jwt"),
|
|
2263
|
+
username: vt(Je(), "__username__"),
|
|
2124
2264
|
launch_id: 0,
|
|
2125
|
-
yuno_startdate:
|
|
2126
|
-
id:
|
|
2265
|
+
yuno_startdate: vt(Je(), "start_date"),
|
|
2266
|
+
id: Or(),
|
|
2127
2267
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2128
2268
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2129
|
-
required_services:
|
|
2269
|
+
required_services: i
|
|
2130
2270
|
};
|
|
2131
|
-
return
|
|
2271
|
+
return pr(e, _, eo, co(e, Qe(tt(e)), null)), br(e, _, "__identity__"), Wr(t.gobj_timer, yt(e, "timeout_idack")), uo(e, "EV_IDENTITY_CARD", _);
|
|
2132
2272
|
}
|
|
2133
|
-
function
|
|
2134
|
-
if (
|
|
2135
|
-
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__,
|
|
2273
|
+
function go(e, t) {
|
|
2274
|
+
if (Un(t.event)) return -1;
|
|
2275
|
+
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__, l = t.__service__, i = t.subscriber;
|
|
2136
2276
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
2137
|
-
return
|
|
2277
|
+
return pr(e, n, eo, co(e, Qe(i), l)), br(e, n, "__subscribing__"), uo(e, t.event, n);
|
|
2138
2278
|
}
|
|
2139
|
-
function
|
|
2279
|
+
function po(e, t, n, r) {
|
|
2140
2280
|
let o = e.priv;
|
|
2141
|
-
return
|
|
2281
|
+
return We(e) && (o.websocket = lo(e)), 0;
|
|
2142
2282
|
}
|
|
2143
|
-
function
|
|
2144
|
-
return
|
|
2283
|
+
function bo(e, t, n, r) {
|
|
2284
|
+
return fn("Websocket opened: " + e.priv.url), fo(e), 0;
|
|
2145
2285
|
}
|
|
2146
|
-
function
|
|
2147
|
-
let o = e.priv, s = n.e,
|
|
2148
|
-
return
|
|
2149
|
-
url:
|
|
2286
|
+
function mo(e, t, n, r) {
|
|
2287
|
+
let o = e.priv, s = n.e, l = n.url;
|
|
2288
|
+
return _n(), cn(`${Ze(e)}: WebSocket closed ${l} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), o.websocket && (o.websocket.onopen = null, o.websocket.onmessage = null, o.websocket.onerror = null, o.websocket.onclose = null, o.websocket = null), o.inform_on_close ? (o.inform_on_close = !1, Ht(e, "EV_ON_CLOSE", {
|
|
2289
|
+
url: l,
|
|
2150
2290
|
remote_yuno_name: o.remote_yuno_name,
|
|
2151
2291
|
remote_yuno_role: o.remote_yuno_role,
|
|
2152
2292
|
remote_yuno_service: o.remote_yuno_service
|
|
2153
|
-
})) : (
|
|
2154
|
-
url:
|
|
2293
|
+
})) : (cn(`${Ze(e)}: EV_ON_OPEN_ERROR cannot open ${l} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), Ht(e, "EV_ON_OPEN_ERROR", {
|
|
2294
|
+
url: l,
|
|
2155
2295
|
remote_yuno_name: o.remote_yuno_name,
|
|
2156
2296
|
remote_yuno_role: o.remote_yuno_role,
|
|
2157
2297
|
remote_yuno_service: o.remote_yuno_service,
|
|
2158
2298
|
code: s.code,
|
|
2159
2299
|
reason: s.reason,
|
|
2160
2300
|
was_clean: s.wasClean
|
|
2161
|
-
})),
|
|
2162
|
-
let t = e.priv, n =
|
|
2301
|
+
})), We(e) && Wr(o.gobj_timer, function(e) {
|
|
2302
|
+
let t = e.priv, n = yt(e, "timeout_retry"), r = yt(e, "timeout_retry_max");
|
|
2163
2303
|
r < n && (r = n);
|
|
2164
2304
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2165
2305
|
let o = .2 * t.retry_ms, s = t.retry_ms - o + 2 * Math.random() * o;
|
|
2166
2306
|
return Math.max(1, Math.round(s));
|
|
2167
2307
|
}(e)), 0;
|
|
2168
2308
|
}
|
|
2169
|
-
function
|
|
2170
|
-
return
|
|
2309
|
+
function ho(e, t, n, r) {
|
|
2310
|
+
return fo(e), 0;
|
|
2171
2311
|
}
|
|
2172
|
-
function
|
|
2312
|
+
function Eo(e, t, n, r) {
|
|
2173
2313
|
let o = e.priv;
|
|
2174
|
-
|
|
2175
|
-
let s =
|
|
2176
|
-
|
|
2177
|
-
let a =
|
|
2314
|
+
Yr(o.gobj_timer);
|
|
2315
|
+
let s = dr(e, n, eo, !0), l = qn(e, s, "src_yuno", ""), i = qn(e, s, "src_role", ""), _ = qn(e, s, "src_service", "");
|
|
2316
|
+
Rt(e, "remote_yuno_name", l), Rt(e, "remote_yuno_role", i), Rt(e, "remote_yuno_service", _);
|
|
2317
|
+
let a = Hn(e, n, "result", -1, 0), u = qn(e, n, "comment", "", 0), c = qn(e, n, "username", "", 0), f = Xn(e, n, "services_roles", {});
|
|
2178
2318
|
if (a < 0) {
|
|
2179
|
-
|
|
2319
|
+
io(e);
|
|
2180
2320
|
let t = {
|
|
2181
|
-
url:
|
|
2321
|
+
url: vt(e, "url"),
|
|
2182
2322
|
result: a,
|
|
2183
2323
|
comment: u,
|
|
2184
2324
|
username: c,
|
|
2185
|
-
remote_yuno_name:
|
|
2186
|
-
remote_yuno_role:
|
|
2325
|
+
remote_yuno_name: l,
|
|
2326
|
+
remote_yuno_role: i,
|
|
2187
2327
|
remote_yuno_service: _
|
|
2188
2328
|
};
|
|
2189
|
-
|
|
2329
|
+
rt(e) ? Lt(tt(e), "EV_ON_ID_NAK", t, e) : Ht(e, "EV_ON_ID_NAK", t);
|
|
2190
2330
|
} else {
|
|
2191
|
-
if (
|
|
2331
|
+
if (xt(e, "ST_SESSION"), o.inside_on_open = !0, o.retry_ms = 0, !o.inform_on_close) {
|
|
2192
2332
|
o.inform_on_close = !0;
|
|
2193
2333
|
let t = {
|
|
2194
2334
|
username: c,
|
|
2195
|
-
remote_yuno_name:
|
|
2196
|
-
remote_yuno_role:
|
|
2335
|
+
remote_yuno_name: l,
|
|
2336
|
+
remote_yuno_role: i,
|
|
2197
2337
|
remote_yuno_service: _,
|
|
2198
2338
|
services_roles: f
|
|
2199
2339
|
};
|
|
2200
|
-
|
|
2340
|
+
rt(e) ? Lt(tt(e), "EV_ON_OPEN", t, e) : Ht(e, "EV_ON_OPEN", t);
|
|
2201
2341
|
}
|
|
2202
2342
|
o.inside_on_open = !1, function(e) {
|
|
2203
|
-
let t =
|
|
2204
|
-
for (let n = 0; n < t.length; n++)
|
|
2343
|
+
let t = Bt(e, null, null, null);
|
|
2344
|
+
for (let n = 0; n < t.length; n++) go(e, t[n]);
|
|
2205
2345
|
}(e);
|
|
2206
2346
|
}
|
|
2207
2347
|
return 0;
|
|
2208
2348
|
}
|
|
2209
|
-
function
|
|
2349
|
+
function To(e, t, n, r) {
|
|
2210
2350
|
let o = e.priv.url, s = function(e, t) {
|
|
2211
2351
|
let n;
|
|
2212
2352
|
try {
|
|
2213
2353
|
n = JSON.parse(t);
|
|
2214
2354
|
} catch (e) {
|
|
2215
|
-
return
|
|
2355
|
+
return un("parsing inter_event json: " + e), null;
|
|
2216
2356
|
}
|
|
2217
|
-
if (!(n instanceof Object)) return
|
|
2357
|
+
if (!(n instanceof Object)) return un("parsing inter_event: websocket data not a json object"), null;
|
|
2218
2358
|
let r = n.event;
|
|
2219
|
-
if (!r) return
|
|
2220
|
-
if ("string" != typeof r) return
|
|
2359
|
+
if (!r) return un("parsing inter_event: no event"), null;
|
|
2360
|
+
if ("string" != typeof r) return un("parsing inter_event: event not a string"), null;
|
|
2221
2361
|
let o = n.kw;
|
|
2222
2362
|
return o ? o instanceof Object ? {
|
|
2223
2363
|
event: r,
|
|
2224
2364
|
kw: o || {}
|
|
2225
|
-
} : (
|
|
2365
|
+
} : (un("parsing inter_event: kw not a json object"), null) : (un("parsing inter_kw: no kw"), null);
|
|
2226
2366
|
}(0, n.data);
|
|
2227
|
-
if (
|
|
2228
|
-
let e =
|
|
2229
|
-
r ? r(e, s, 2, t) :
|
|
2367
|
+
if (ro(e)) {
|
|
2368
|
+
let e = Qe(Je()) + " <== " + o, t = n.data.length, r = ht(Je(), "trace_ievent_callback");
|
|
2369
|
+
r ? r(e, s, 2, t) : _o(0, e, s);
|
|
2230
2370
|
}
|
|
2231
|
-
let
|
|
2232
|
-
if ("ST_SESSION" !==
|
|
2233
|
-
if (
|
|
2234
|
-
if (!(
|
|
2235
|
-
} else
|
|
2236
|
-
return
|
|
2371
|
+
let l = s.event, i = s.kw;
|
|
2372
|
+
if ("ST_SESSION" !== Dt(e)) {
|
|
2373
|
+
if (kt(e, l, R.EVF_PUBLIC_EVENT)) {
|
|
2374
|
+
if (!(Lt(e, l, i, e) < 0)) return 0;
|
|
2375
|
+
} else un(`${Ze(e)}: event UNKNOWN in not-session state ${l}`);
|
|
2376
|
+
return io(e), -1;
|
|
2237
2377
|
}
|
|
2238
2378
|
s = null;
|
|
2239
|
-
let _ =
|
|
2240
|
-
if (u.toLowerCase() !==
|
|
2241
|
-
let c =
|
|
2379
|
+
let _ = mr(e, i), a = dr(e, i, eo), u = qn(e, a, "dst_role", "");
|
|
2380
|
+
if (u.toLowerCase() !== qe().toLowerCase()) return un(`"It's not my role, dst_role: ${u}, my_role: ${qe()}`), 0;
|
|
2381
|
+
let c = qn(e, a, "dst_service", "");
|
|
2242
2382
|
if ("__subscribing__" === _) return -1;
|
|
2243
2383
|
if ("__unsubscribing__" === _) return -1;
|
|
2244
|
-
if (
|
|
2245
|
-
if (!
|
|
2246
|
-
let t =
|
|
2247
|
-
return t ?
|
|
2384
|
+
if (kt(e, l, R.EVF_PUBLIC_EVENT)) return Lt(e, l, i, e), 0;
|
|
2385
|
+
if (!Un(c)) {
|
|
2386
|
+
let t = Oe(c, !1);
|
|
2387
|
+
return t ? kt(t, l, R.EVF_PUBLIC_EVENT) ? (Lt(t, l, i, e), 0) : (un(`${Ze(e)}: Service found but no event or not public, service '${Ze(t)}', ev '${l}'`), -1) : (cn(`${Ze(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${l}'`), 0);
|
|
2248
2388
|
}
|
|
2249
|
-
return
|
|
2389
|
+
return rt(e) ? Lt(tt(e), l, i, e) : Ht(e, l, i), 0;
|
|
2250
2390
|
}
|
|
2251
|
-
function
|
|
2391
|
+
function yo(e, t, n, r) {
|
|
2252
2392
|
return 0;
|
|
2253
2393
|
}
|
|
2254
|
-
function
|
|
2394
|
+
function vo(e, t, n, r) {
|
|
2255
2395
|
return 0;
|
|
2256
2396
|
}
|
|
2257
|
-
var
|
|
2397
|
+
var jo = {
|
|
2258
2398
|
mt_create: function(e) {
|
|
2259
2399
|
let t = e.priv;
|
|
2260
|
-
t.gobj_timer =
|
|
2261
|
-
const n =
|
|
2262
|
-
n &&
|
|
2400
|
+
t.gobj_timer = $e(Qe(e), "C_TIMER", {}, e), t.url = vt(e, "url"), t.remote_yuno_name = vt(e, "remote_yuno_name"), t.remote_yuno_role = vt(e, "remote_yuno_role"), t.remote_yuno_service = vt(e, "remote_yuno_service"), Rt(e, "wanted_yuno_name", t.remote_yuno_name), Rt(e, "wanted_yuno_role", t.remote_yuno_role), Rt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2401
|
+
const n = jt(e, "subscriber");
|
|
2402
|
+
n && Kt(e, null, {}, n);
|
|
2263
2403
|
},
|
|
2264
2404
|
mt_writing: function(e, t) {
|
|
2265
2405
|
let n = e.priv;
|
|
2266
2406
|
switch (t) {
|
|
2267
2407
|
case "url":
|
|
2268
|
-
n.url =
|
|
2408
|
+
n.url = vt(e, "url");
|
|
2269
2409
|
break;
|
|
2270
2410
|
case "remote_yuno_name":
|
|
2271
|
-
n.remote_yuno_name =
|
|
2411
|
+
n.remote_yuno_name = vt(e, "remote_yuno_name");
|
|
2272
2412
|
break;
|
|
2273
2413
|
case "remote_yuno_role":
|
|
2274
|
-
n.remote_yuno_role =
|
|
2414
|
+
n.remote_yuno_role = vt(e, "remote_yuno_role");
|
|
2275
2415
|
break;
|
|
2276
|
-
case "remote_yuno_service": n.remote_yuno_service =
|
|
2416
|
+
case "remote_yuno_service": n.remote_yuno_service = vt(e, "remote_yuno_service");
|
|
2277
2417
|
}
|
|
2278
2418
|
},
|
|
2279
2419
|
mt_start: function(e) {
|
|
2280
2420
|
let t = e.priv;
|
|
2281
|
-
return t.retry_ms = 0, t.websocket =
|
|
2421
|
+
return t.retry_ms = 0, t.websocket = lo(e), 0;
|
|
2282
2422
|
},
|
|
2283
2423
|
mt_stop: function(e) {
|
|
2284
2424
|
let t = e.priv;
|
|
2285
|
-
return
|
|
2425
|
+
return Yr(t.gobj_timer), t.websocket && io(e), 0;
|
|
2286
2426
|
},
|
|
2287
2427
|
mt_destroy: function(e) {},
|
|
2288
2428
|
mt_stats: function(e, t, n, r) {
|
|
2289
|
-
if ("ST_SESSION" !==
|
|
2429
|
+
if ("ST_SESSION" !== Dt(e)) return un("Not in session"), null;
|
|
2290
2430
|
n || (n = {});
|
|
2291
|
-
let o =
|
|
2292
|
-
return s || (s = {}),
|
|
2431
|
+
let o = co(e, Qe(r), qn(e, n, "service", null, 0)), s = Xn(e, n, "__md_stats__", null, qt.KW_EXTRACT);
|
|
2432
|
+
return s || (s = {}), pr(e, n, "stats_stack", {
|
|
2293
2433
|
stats: t,
|
|
2294
2434
|
kw: s
|
|
2295
|
-
}),
|
|
2435
|
+
}), pr(e, n, eo, o), n.__stats__ = t, br(e, n, "__stats__"), uo(e, "EV_MT_STATS", n, r), null;
|
|
2296
2436
|
},
|
|
2297
2437
|
mt_command_parser: function(e, t, n, r) {
|
|
2298
|
-
if ("ST_SESSION" !==
|
|
2438
|
+
if ("ST_SESSION" !== Dt(e)) return un("Not in session"), null;
|
|
2299
2439
|
n || (n = {});
|
|
2300
|
-
let o =
|
|
2301
|
-
return s || (s = {}),
|
|
2440
|
+
let o = co(e, Qe(r), qn(e, n, "service", "", 0)), s = Xn(e, n, "__md_command__", null, qt.KW_EXTRACT);
|
|
2441
|
+
return s || (s = {}), pr(e, n, "command_stack", {
|
|
2302
2442
|
command: t,
|
|
2303
2443
|
kw: s
|
|
2304
|
-
}),
|
|
2444
|
+
}), pr(e, n, eo, o), n.__command__ = t, br(e, n, "__command__"), uo(e, "EV_MT_COMMAND", n, r), null;
|
|
2305
2445
|
},
|
|
2306
2446
|
mt_inject_event: function(e, t, n, r) {
|
|
2307
|
-
if ("ST_SESSION" !==
|
|
2308
|
-
if (n || (n = {}),
|
|
2447
|
+
if ("ST_SESSION" !== Dt(e)) return window.console.error("Not in session"), -1;
|
|
2448
|
+
if (n || (n = {}), dr(e, n, eo));
|
|
2309
2449
|
else {
|
|
2310
|
-
let o =
|
|
2311
|
-
|
|
2450
|
+
let o = co(e, Qe(r), qn(e, n, "__service__", 0, 0));
|
|
2451
|
+
yn(n, "__service__"), pr(e, n, "__message__", t), pr(e, n, eo, o);
|
|
2312
2452
|
}
|
|
2313
|
-
return
|
|
2453
|
+
return br(e, n, "__message__"), uo(e, t, n, r);
|
|
2314
2454
|
},
|
|
2315
2455
|
mt_subscription_added: function(e, t) {
|
|
2316
2456
|
let n = e.priv;
|
|
2317
|
-
return "ST_SESSION" ===
|
|
2457
|
+
return "ST_SESSION" === Dt(e) && n.websocket ? n.inside_on_open ? 0 : go(e, t) : 0;
|
|
2318
2458
|
},
|
|
2319
2459
|
mt_subscription_deleted: function(e, t) {
|
|
2320
2460
|
let n = e.priv;
|
|
2321
|
-
if ("ST_SESSION" !==
|
|
2461
|
+
if ("ST_SESSION" !== Dt(e) || !n.websocket) return 0;
|
|
2322
2462
|
if (n.inside_on_open) return 0;
|
|
2323
|
-
if (
|
|
2324
|
-
let r = {}, o = t.__global__, s = t.__config__,
|
|
2325
|
-
s && (r.__config__ = s), o && (r.__global__ = o),
|
|
2326
|
-
return
|
|
2463
|
+
if (Un(t.event)) return 0;
|
|
2464
|
+
let r = {}, o = t.__global__, s = t.__config__, l = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2465
|
+
s && (r.__config__ = s), o && (r.__global__ = o), l && (r.__filter__ = l);
|
|
2466
|
+
return pr(e, r, eo, co(e, Qe(_), i)), br(e, r, "__unsubscribing__"), uo(e, t.event, r, e);
|
|
2327
2467
|
}
|
|
2328
2468
|
};
|
|
2329
|
-
exports.GObj =
|
|
2469
|
+
exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) => new T(e, t, n, null, s, r, null, 0, null, o, null), exports.SDATACM = (e, t, n, r, o, s) => new T(e, t, 0, null, s, n, null, 0, o, r, null), exports.SDATACM2 = (e, t, n, r, o, s, l) => new T(e, t, n, null, l, r, null, 0, s, o, null), exports.SDATADF = (e, t, n, r, o, s) => new T(e, t, n, null, s, null, r, o), exports.SDATAPM = (e, t, n, r, o) => new T(e, t, n, r, o), exports.SDATAPM0 = (e, t, n, r, o) => new T(e, t, n, null, o, null, null, 0, null, null, r), exports.SDATA_END = y, exports.SDataDesc = T, exports.YUNETA_VERSION = s, Object.defineProperty(exports, "__yuno__", {
|
|
2330
2470
|
enumerable: !0,
|
|
2331
2471
|
get: function() {
|
|
2332
2472
|
return d;
|
|
@@ -2337,64 +2477,64 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2337
2477
|
return t;
|
|
2338
2478
|
}, exports.build_stats_response = o, exports.clean_name = function(e) {
|
|
2339
2479
|
return e.replace(/[?# ^:]/g, "_");
|
|
2340
|
-
}, exports.clear_timeout =
|
|
2341
|
-
let [r, o, s,
|
|
2342
|
-
if (!r) return void
|
|
2343
|
-
let
|
|
2480
|
+
}, exports.clear_timeout = Yr, exports.cmp_two_simple_json = Mn, exports.command_parser = function(e, t, n, r) {}, exports.createElement2 = function e(t, n) {
|
|
2481
|
+
let [r, o, s, l] = t;
|
|
2482
|
+
if (!r) return void un("Tag must be a valid HTML element.");
|
|
2483
|
+
let i = document.createElement(r), _ = "";
|
|
2344
2484
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2345
2485
|
let t = "";
|
|
2346
2486
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
2347
|
-
|
|
2348
|
-
} else "style" === e ?
|
|
2349
|
-
if (
|
|
2350
|
-
else if (n && _)
|
|
2351
|
-
else
|
|
2352
|
-
else if (
|
|
2353
|
-
if (s.length > 0) if (
|
|
2354
|
-
else for (let t of s) Array.isArray(t) && t.length > 0 ?
|
|
2355
|
-
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ?
|
|
2356
|
-
if (
|
|
2357
|
-
return
|
|
2358
|
-
}, exports.createOneHtml =
|
|
2359
|
-
let n =
|
|
2360
|
-
return
|
|
2487
|
+
i.style.cssText = t;
|
|
2488
|
+
} else "style" === e ? i.style.cssText = o[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== o[e] && void 0 !== o[e] && (_ = o[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, o[e]);
|
|
2489
|
+
if (kn(s)) if (s = s.trim(), s.length > 0 && "<" === s[0]) i.appendChild(vr(s));
|
|
2490
|
+
else if (n && _) i.textContent = n(_) || s;
|
|
2491
|
+
else i.textContent = s;
|
|
2492
|
+
else if (An(s)) {
|
|
2493
|
+
if (s.length > 0) if (kn(s[0])) i.appendChild(e(s, n));
|
|
2494
|
+
else for (let t of s) Array.isArray(t) && t.length > 0 ? i.appendChild(e(t, n)) : t instanceof HTMLElement && i.appendChild(t);
|
|
2495
|
+
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? i.appendChild(s) : null != s && (un("content ignored"), pn(s));
|
|
2496
|
+
if (l && "object" == typeof l) for (const e of Object.keys(l)) i.addEventListener(e, l[e]);
|
|
2497
|
+
return i;
|
|
2498
|
+
}, exports.createOneHtml = vr, exports.create_json_record = function(e, t) {
|
|
2499
|
+
let n = dn(e);
|
|
2500
|
+
return hn(n, t), n;
|
|
2361
2501
|
}, exports.create_template_record = function(e, t) {
|
|
2362
2502
|
let n = {};
|
|
2363
2503
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2364
2504
|
let o;
|
|
2365
|
-
|
|
2366
|
-
let s =
|
|
2505
|
+
Dn(r) && (o = r.default);
|
|
2506
|
+
let s = Xn(null, t, e, o);
|
|
2367
2507
|
n[e] = s;
|
|
2368
2508
|
}), n;
|
|
2369
|
-
}, exports.current_timestamp =
|
|
2370
|
-
let n =
|
|
2371
|
-
return n &&
|
|
2509
|
+
}, exports.current_timestamp = jr, exports.data_type_t = h, exports.db_list_persistent_attrs = function(e, t) {
|
|
2510
|
+
let n = sr(kr(e), null, !1), r = {};
|
|
2511
|
+
return n && Dn(n) && (r = rr(e, n, t, !1)), r;
|
|
2372
2512
|
}, exports.db_load_persistent_attrs = function(e, t) {
|
|
2373
|
-
let n =
|
|
2374
|
-
if (r &&
|
|
2375
|
-
let o =
|
|
2376
|
-
o =
|
|
2513
|
+
let n = Et(e, E.SDF_PERSIST), r = sr(kr(e), null, !1);
|
|
2514
|
+
if (r && Dn(r)) {
|
|
2515
|
+
let o = rr(e, r, t, !1);
|
|
2516
|
+
o = rr(e, o, n, !1), Ot(e, o, E.SDF_PERSIST);
|
|
2377
2517
|
}
|
|
2378
2518
|
}, exports.db_remove_persistent_attrs = function(e, t) {
|
|
2379
|
-
let n =
|
|
2380
|
-
0 ===
|
|
2519
|
+
let n = or(e, sr(kr(e), null, !1), t, !1);
|
|
2520
|
+
0 === Nn(n) ? ir(kr(e)) : lr(kr(e), n);
|
|
2381
2521
|
}, exports.db_save_persistent_attrs = function(e, t) {
|
|
2382
|
-
let n =
|
|
2383
|
-
return r &&
|
|
2522
|
+
let n = rr(e, Et(e, E.SDF_PERSIST), t, !1), r = sr(kr(e), null, !1);
|
|
2523
|
+
return r && Dn(r) && En(n, r), lr(kr(e), n);
|
|
2384
2524
|
}, exports.debounce = function(e, t = 0, n = !1) {
|
|
2385
2525
|
let r = null, o = null, s = null;
|
|
2386
|
-
const
|
|
2387
|
-
s = this, o =
|
|
2388
|
-
const
|
|
2526
|
+
const l = (...l) => {
|
|
2527
|
+
s = this, o = l;
|
|
2528
|
+
const i = n && !r;
|
|
2389
2529
|
clearTimeout(r), r = setTimeout(() => {
|
|
2390
2530
|
r = null, n || e.apply(s, o);
|
|
2391
|
-
}, t),
|
|
2531
|
+
}, t), i && e.apply(s, o);
|
|
2392
2532
|
};
|
|
2393
|
-
return
|
|
2533
|
+
return l.flush = () => {
|
|
2394
2534
|
r && (clearTimeout(r), r = null, e.apply(s, o));
|
|
2395
|
-
},
|
|
2535
|
+
}, l.cancel = () => {
|
|
2396
2536
|
clearTimeout(r), r = null, o = null, s = null;
|
|
2397
|
-
},
|
|
2537
|
+
}, l;
|
|
2398
2538
|
}, exports.delete_from_list = function(e, t) {
|
|
2399
2539
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
2400
2540
|
return !1;
|
|
@@ -2406,23 +2546,23 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2406
2546
|
}
|
|
2407
2547
|
return t;
|
|
2408
2548
|
}, exports.empty_json = function(e) {
|
|
2409
|
-
return 0 ===
|
|
2410
|
-
}, exports.empty_string =
|
|
2549
|
+
return 0 === xn(e);
|
|
2550
|
+
}, exports.empty_string = Un, exports.escapeHtml = yr, exports.event_flag_t = R, exports.flat2json = function(e) {
|
|
2411
2551
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2412
2552
|
let t = null;
|
|
2413
2553
|
for (const n of Object.keys(e)) {
|
|
2414
|
-
const r =
|
|
2554
|
+
const r = Dr(n);
|
|
2415
2555
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2416
|
-
if (r.length >
|
|
2556
|
+
if (r.length > Nr) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2417
2557
|
const o = "number" == typeof r[0];
|
|
2418
2558
|
if (null === t) t = o ? [] : {};
|
|
2419
2559
|
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2420
2560
|
let s = t;
|
|
2421
2561
|
for (let t = 0; t < r.length; t++) {
|
|
2422
|
-
const o = r[t],
|
|
2423
|
-
if (
|
|
2424
|
-
if (
|
|
2425
|
-
if (
|
|
2562
|
+
const o = r[t], l = "number" == typeof o, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2563
|
+
if (l && o > Rr) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
2564
|
+
if (l !== Array.isArray(s)) throw new Error(`flat2json: '${n}' uses a ${l ? "array index" : "key"} where the tree already has a ${Array.isArray(s) ? "array" : "object"}`);
|
|
2565
|
+
if (i) {
|
|
2426
2566
|
if (Array.isArray(s)) {
|
|
2427
2567
|
for (; s.length <= o;) s.push(null);
|
|
2428
2568
|
s[o] = e[n];
|
|
@@ -2460,15 +2600,15 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2460
2600
|
removed: {},
|
|
2461
2601
|
changed: {}
|
|
2462
2602
|
};
|
|
2463
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2603
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? Ar(n[e], r[e]) || (o.changed[e] = {
|
|
2464
2604
|
from: n[e],
|
|
2465
2605
|
to: r[e]
|
|
2466
2606
|
}) : o.removed[e] = n[e];
|
|
2467
2607
|
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (o.added[e] = r[e]);
|
|
2468
2608
|
return o;
|
|
2469
2609
|
}, exports.flat_key_join = function(e) {
|
|
2470
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2471
|
-
}, exports.flat_key_split =
|
|
2610
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : xr(e)).join("`") : "";
|
|
2611
|
+
}, exports.flat_key_split = Dr, exports.gclass_add_ev_action = he, exports.gclass_add_event_type = Te, exports.gclass_add_state = me, exports.gclass_check_fsm = ve, exports.gclass_create = ge, exports.gclass_event_type = ye, exports.gclass_find_by_name = je, exports.gclass_flag_t = O, exports.gclass_unregister = pe, exports.getPositionRelativeToBody = function(e) {
|
|
2472
2612
|
if (!e) return {
|
|
2473
2613
|
top: 0,
|
|
2474
2614
|
left: 0,
|
|
@@ -2480,66 +2620,68 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2480
2620
|
left: 0,
|
|
2481
2621
|
width: 0,
|
|
2482
2622
|
height: 0
|
|
2483
|
-
}, s = "undefined" != typeof window,
|
|
2623
|
+
}, s = "undefined" != typeof window, l = s && (window.scrollY || document.documentElement?.scrollTop || document.body?.scrollTop) || 0, i = s && (window.scrollX || document.documentElement?.scrollLeft || document.body?.scrollLeft) || 0;
|
|
2484
2624
|
return {
|
|
2485
|
-
top: t +
|
|
2486
|
-
left: n +
|
|
2487
|
-
right: n +
|
|
2488
|
-
bottom: t +
|
|
2625
|
+
top: t + l,
|
|
2626
|
+
left: n + i,
|
|
2627
|
+
right: n + i + r,
|
|
2628
|
+
bottom: t + l + o
|
|
2489
2629
|
};
|
|
2490
|
-
}, exports.get_function_name =
|
|
2630
|
+
}, exports.get_function_name = wr, exports.get_now = function() {
|
|
2491
2631
|
return Math.floor(Date.now() / 1e3);
|
|
2492
|
-
}, exports.gobj_bottom_gobj =
|
|
2493
|
-
return
|
|
2494
|
-
}, exports.gobj_change_state =
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2632
|
+
}, exports.gobj_bottom_gobj = st, exports.gobj_change_parent = function(e, n) {
|
|
2633
|
+
return ot(e) ? (un("gobj NULL or DESTROYED"), null) : n instanceof S ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (Re(e.parent, e), e.parent = null), Ne(n, e), n.mt_child_added && (K(e) && fn(t("👦👦🔵 child_added(%s): %s", et(n), Ze(e))), n.mt_child_added(n, e)), 0) : (un(`${Ze(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2634
|
+
}, exports.gobj_change_state = xt, exports.gobj_command = function(e, n, o, s) {
|
|
2635
|
+
return ot(e) ? (un("gobj NULL or DESTROYED"), -1) : ((function(e) {
|
|
2636
|
+
return F > 1 || !!e && !!(M(e) & C.TRACE_COMMANDS);
|
|
2637
|
+
}(e) || H(e, null) && !q(s, null)) && (I(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", We(e) ? "" : "!!", Ze(e), n, Ze(s))), J(e) && pn(o)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, o, s) : e.gclass.command_table ? u ? u(e, n, o, s) : r(0, -1, t("%s: global command parser not available", Ze(e)), 0, 0) : r(0, -1, t("%s: command table not available", Ze(e)), 0, 0));
|
|
2498
2638
|
}, exports.gobj_create = function(e, t, n, r) {
|
|
2499
|
-
return
|
|
2500
|
-
}, exports.gobj_create2 =
|
|
2501
|
-
return
|
|
2502
|
-
}, exports.gobj_create_pure_child =
|
|
2503
|
-
return
|
|
2639
|
+
return ke(e, t, n, r, 0);
|
|
2640
|
+
}, exports.gobj_create2 = ke, exports.gobj_create_default_service = function(e, t, n, r) {
|
|
2641
|
+
return ke(e, t, n, r, w.gobj_flag_default_service | w.gobj_flag_autostart);
|
|
2642
|
+
}, exports.gobj_create_pure_child = $e, exports.gobj_create_service = function(e, t, n, r) {
|
|
2643
|
+
return ke(e, t, n, r, w.gobj_flag_service);
|
|
2504
2644
|
}, exports.gobj_create_volatil = function(e, t, n, r) {
|
|
2505
|
-
return
|
|
2645
|
+
return ke(e, t, n, r, w.gobj_flag_volatil);
|
|
2506
2646
|
}, exports.gobj_create_yuno = function(e, t, n) {
|
|
2507
|
-
return
|
|
2508
|
-
}, exports.gobj_current_state =
|
|
2509
|
-
if (
|
|
2647
|
+
return ke(e, t, n, null, w.gobj_flag_yuno);
|
|
2648
|
+
}, exports.gobj_current_state = Dt, exports.gobj_default_service = Se, exports.gobj_deliver_posted_events = Pt, exports.gobj_destroy = Ie, exports.gobj_find_child = dt, exports.gobj_find_gobj = function(e, t) {
|
|
2649
|
+
if (Un(t)) return null;
|
|
2510
2650
|
const n = t.toLowerCase();
|
|
2511
|
-
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d :
|
|
2512
|
-
}, exports.gobj_find_service =
|
|
2513
|
-
return
|
|
2514
|
-
}, exports.
|
|
2651
|
+
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d : bt(d, t);
|
|
2652
|
+
}, exports.gobj_find_service = Oe, exports.gobj_find_subscribings = Jt, exports.gobj_find_subscriptions = Bt, exports.gobj_flag_t = w, exports.gobj_full_name = et, exports.gobj_gclass_name = Xe, exports.gobj_get_gclass_trace_level = ne, exports.gobj_get_gclass_trace_level2 = re, exports.gobj_get_gclass_trace_no_level = oe, exports.gobj_get_global_trace_level = ee, exports.gobj_get_global_trace_no_level = te, exports.gobj_global_trace_level = function() {
|
|
2653
|
+
return L;
|
|
2654
|
+
}, exports.gobj_global_trace_no_level = function() {
|
|
2655
|
+
return U;
|
|
2656
|
+
}, exports.gobj_has_attr = mt, exports.gobj_has_event = kt, exports.gobj_has_output_event = $t, exports.gobj_hsdata = ue, exports.gobj_is_destroying = ot, exports.gobj_is_playing = Be, exports.gobj_is_pure_child = rt, exports.gobj_is_running = We, exports.gobj_is_service = Ye, exports.gobj_is_volatil = nt, exports.gobj_list_persistent_attrs = function(e, t) {
|
|
2515
2657
|
return a ? a(e, t) : null;
|
|
2516
2658
|
}, exports.gobj_list_subscriptions = function(e) {
|
|
2517
|
-
let t =
|
|
2659
|
+
let t = Bt(e, null, null, null);
|
|
2518
2660
|
for (let n = 0; n < t.length; n++) {
|
|
2519
|
-
let r = t[n], o =
|
|
2520
|
-
|
|
2661
|
+
let r = t[n], o = zn(e, r, "publisher", null, qt.KW_REQUIRED), s = zn(e, r, "subscriber", null, qt.KW_REQUIRED);
|
|
2662
|
+
jn(r, "s_event", qn(e, r, "event", "", qt.KW_REQUIRED)), jn(r, "s_publisher", Ze(o)), jn(r, "s_subscriber", Ze(s));
|
|
2521
2663
|
}
|
|
2522
|
-
let n =
|
|
2664
|
+
let n = Jt(e, 0, null, 0);
|
|
2523
2665
|
for (let t = 0; t < n.length; t++) {
|
|
2524
|
-
let r = n[t], o =
|
|
2525
|
-
|
|
2666
|
+
let r = n[t], o = zn(e, r, "publisher", null, qt.KW_REQUIRED), s = zn(e, r, "subscriber", null, qt.KW_REQUIRED);
|
|
2667
|
+
jn(r, "s_event", qn(e, r, "event", "", qt.KW_REQUIRED)), jn(r, "s_publisher", Ze(o)), jn(r, "s_subscriber", Ze(s));
|
|
2526
2668
|
}
|
|
2527
2669
|
return {
|
|
2528
2670
|
subscriptions: t,
|
|
2529
2671
|
subscribings: n,
|
|
2530
|
-
"total subscriptions":
|
|
2531
|
-
total_subscribings:
|
|
2672
|
+
"total subscriptions": Rn(t),
|
|
2673
|
+
total_subscribings: Rn(n)
|
|
2532
2674
|
};
|
|
2533
2675
|
}, exports.gobj_load_persistent_attrs = function(e, t) {
|
|
2534
|
-
return
|
|
2676
|
+
return Ye(e) ? l ? l(e, t) : -1 : (un(`${Ze(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2535
2677
|
}, exports.gobj_match_children = function(e, t) {
|
|
2536
|
-
if (
|
|
2678
|
+
if (ot(e)) return un("gobj NULL or DESTROYED"), null;
|
|
2537
2679
|
t = t || {};
|
|
2538
2680
|
let n = [];
|
|
2539
2681
|
const r = e.dl_children;
|
|
2540
2682
|
for (let e = 0; e < r.length; e++) {
|
|
2541
2683
|
const o = r[e];
|
|
2542
|
-
|
|
2684
|
+
pt(o, t) && n.push(o);
|
|
2543
2685
|
}
|
|
2544
2686
|
return n;
|
|
2545
2687
|
}, exports.gobj_match_children_tree = function(e, t) {
|
|
@@ -2549,95 +2691,77 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2549
2691
|
let o = r.dl_children;
|
|
2550
2692
|
for (let r = 0; r < o.length; r++) {
|
|
2551
2693
|
let s = o[r];
|
|
2552
|
-
|
|
2694
|
+
pt(s, t) && n.push(s), e(n, s);
|
|
2553
2695
|
}
|
|
2554
2696
|
}(n, e), n;
|
|
2555
|
-
}, exports.gobj_match_gobj =
|
|
2556
|
-
return e && e instanceof
|
|
2697
|
+
}, exports.gobj_match_gobj = pt, exports.gobj_name = Qe, exports.gobj_parent = tt, exports.gobj_pause = Me, exports.gobj_play = Ve, exports.gobj_post_event = function(e, n, r, o) {
|
|
2698
|
+
return e && e instanceof S ? e.obflag & (N.obflag_destroyed | N.obflag_destroying) ? (un(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : Un(n) ? (un("gobj_post_event(): event EMPTY"), -1) : kt(e, n, 0) ? It.length >= 1e4 ? (un(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${It.length}`), -1) : (It.push({
|
|
2557
2699
|
dst: e,
|
|
2558
2700
|
event: n,
|
|
2559
2701
|
kw: r,
|
|
2560
2702
|
src: o
|
|
2561
|
-
}),
|
|
2703
|
+
}), H(e, n) && !q(o, n) && I(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Ze(e), n, It.length)), Ct || (Ct = !0, setTimeout(Pt, 0)), 0) : (un(`gobj_post_event(): event NOT DEFINED in gclass ${Xe(e)}, event ${n}`), -1) : (un(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
2562
2704
|
}, exports.gobj_posted_events_size = function() {
|
|
2563
|
-
return
|
|
2564
|
-
}, exports.gobj_publish_event =
|
|
2565
|
-
return
|
|
2705
|
+
return It.length;
|
|
2706
|
+
}, exports.gobj_publish_event = Ht, exports.gobj_read_attr = ht, exports.gobj_read_attrs = Et, exports.gobj_read_bool_attr = Tt, exports.gobj_read_integer_attr = yt, exports.gobj_read_pointer_attr = jt, exports.gobj_read_str_attr = vt, exports.gobj_remove_persistent_attrs = function(e, t) {
|
|
2707
|
+
return Ye(e) ? _ ? _(e, t) : -1 : (un(`${Ze(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2566
2708
|
}, exports.gobj_repr_global_trace_levels = function() {
|
|
2567
|
-
return
|
|
2709
|
+
return P.map(([e, t, n]) => ({
|
|
2568
2710
|
name: e,
|
|
2569
2711
|
bit: t,
|
|
2570
2712
|
description: n,
|
|
2571
|
-
set: !!(
|
|
2713
|
+
set: !!(L & t)
|
|
2572
2714
|
}));
|
|
2573
2715
|
}, exports.gobj_reset_volatil_attrs = function(e) {
|
|
2574
2716
|
return function(e, t, n) {
|
|
2575
|
-
if (
|
|
2717
|
+
if (ot(e)) return un("gobj NULL or DESTROYED"), -1;
|
|
2576
2718
|
let r = e.gclass.attrs_table;
|
|
2577
2719
|
for (let o = 0; o < r.length; o++) {
|
|
2578
2720
|
const s = r[o];
|
|
2579
2721
|
if (s.name && !(n && s.flag & n) && (-1 === t || s.flag & t)) {
|
|
2580
|
-
const t =
|
|
2581
|
-
|
|
2722
|
+
const t = _e(e, e.jn_attrs, s);
|
|
2723
|
+
Dn(e.priv) && e.priv.hasOwnProperty(s.name) && (e.priv[s.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, s.name);
|
|
2582
2724
|
}
|
|
2583
2725
|
}
|
|
2584
2726
|
return 0;
|
|
2585
|
-
}(e,
|
|
2586
|
-
}, exports.gobj_save_persistent_attrs = function(
|
|
2587
|
-
return Ae(e) ? l ? l(e, t) : -1 : (Ht(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2588
|
-
}, exports.gobj_search_path = nt, exports.gobj_send_event = jt, exports.gobj_services = function() {
|
|
2727
|
+
}(e, E.SDF_VOLATIL, 0);
|
|
2728
|
+
}, exports.gobj_save_persistent_attrs = xe, exports.gobj_search_path = bt, exports.gobj_send_event = Lt, exports.gobj_services = function() {
|
|
2589
2729
|
let e = [];
|
|
2590
|
-
for (const t of Object.keys(p))
|
|
2730
|
+
for (const t of Object.keys(p)) On(e, t);
|
|
2591
2731
|
return e;
|
|
2592
|
-
}, exports.gobj_set_bottom_gobj =
|
|
2732
|
+
}, exports.gobj_set_bottom_gobj = lt, exports.gobj_set_deep_trace = function(e) {
|
|
2593
2733
|
return F = Number(e) || 0, 0;
|
|
2594
|
-
}, exports.gobj_set_gclass_no_trace = function(e, t, n) {
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
const o = G(t, "gobj_set_gclass_no_trace");
|
|
2598
|
-
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
2599
|
-
}, exports.gobj_set_gclass_trace = function(e, t, n) {
|
|
2600
|
-
const r = mn(e) ? ue(e) : e;
|
|
2601
|
-
if (!r) return Ht(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2602
|
-
const o = G(t, "gobj_set_gclass_trace");
|
|
2603
|
-
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
2604
|
-
}, exports.gobj_set_global_no_trace = function(e, t) {
|
|
2605
|
-
const n = G(e, "gobj_set_global_no_trace");
|
|
2606
|
-
return n ? (t ? U |= n : U &= ~n, 0) : -1;
|
|
2607
|
-
}, exports.gobj_set_global_trace = function(e, t) {
|
|
2608
|
-
const n = G(e, "gobj_set_global_trace");
|
|
2609
|
-
return n ? (t ? P |= n : P &= ~n, 0) : -1;
|
|
2610
|
-
}, exports.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2611
|
-
if (!e) return Ht("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2612
|
-
const r = G(t, "gobj_set_gobj_no_trace");
|
|
2734
|
+
}, exports.gobj_set_gclass_no_trace = le, exports.gobj_set_gclass_trace = se, exports.gobj_set_global_no_trace = Q, exports.gobj_set_global_no_trace2 = Z, exports.gobj_set_global_trace = z, exports.gobj_set_global_trace2 = X, exports.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2735
|
+
if (!e) return un("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2736
|
+
const r = V(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
2613
2737
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
2614
2738
|
}, exports.gobj_set_gobj_trace = function(e, t, n) {
|
|
2615
|
-
if (!e) return
|
|
2616
|
-
const r =
|
|
2739
|
+
if (!e) return un("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
2740
|
+
const r = V(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
2617
2741
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2618
2742
|
}, exports.gobj_set_trace_machine_format = function(e) {
|
|
2619
|
-
|
|
2620
|
-
}, exports.gobj_short_name =
|
|
2621
|
-
return
|
|
2743
|
+
$ = 1 === Number(e) ? 1 : 0;
|
|
2744
|
+
}, exports.gobj_short_name = Ze, exports.gobj_start = Ce, exports.gobj_start_children = function(e) {
|
|
2745
|
+
return ot(e) ? (un("gobj NULL or DESTROYED"), -1) : _t(e, x.WALK_FIRST2LAST, Pe, 0, 0);
|
|
2622
2746
|
}, exports.gobj_start_tree = function(e) {
|
|
2623
|
-
return
|
|
2747
|
+
return ot(e) ? (un("gobj NULL or DESTROYED"), -1) : (B(e) && I(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", et(e))), e.gclass.gclass_flag & O.gcflag_manual_start || e.disabled ? 0 : (e.running || Ce(e), at(e, x.WALK_TOP2BOTTOM, Le, 0, 0)));
|
|
2624
2748
|
}, exports.gobj_start_up = function(e, t, n, r, o, s, g) {
|
|
2625
|
-
|
|
2749
|
+
l = t, i = n, _ = r, a = o, u = s, c = g;
|
|
2626
2750
|
const p = [["EV_STATE_CHANGED", R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]];
|
|
2627
2751
|
for (let e = 0; e < p.length; e++) {
|
|
2628
2752
|
let t = p[e][0], n = p[e][1];
|
|
2629
|
-
|
|
2753
|
+
Ee(f, t, n);
|
|
2630
2754
|
}
|
|
2631
2755
|
return 0;
|
|
2632
2756
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
2633
|
-
return
|
|
2634
|
-
}, exports.gobj_stop =
|
|
2635
|
-
return
|
|
2636
|
-
}, exports.gobj_subscribe_event =
|
|
2637
|
-
return
|
|
2638
|
-
}, exports.gobj_trace_no_level =
|
|
2639
|
-
if (null == n && (n = {}), !e) return
|
|
2640
|
-
if (!r) return
|
|
2757
|
+
return ot(e) ? (un("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, n, r, s) : c ? c(e, n, r, s) : o(0, -1, t("%s, stats parser not available", Ze(e)), 0, 0);
|
|
2758
|
+
}, exports.gobj_stop = Ue, exports.gobj_stop_children = Ge, exports.gobj_stop_tree = function(e) {
|
|
2759
|
+
return ot(e) ? (un("gobj NULL or DESTROYED"), -1) : (B(e) && I(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", et(e))), We(e) && Ue(e), at(e, x.WALK_TOP2BOTTOM, Fe, 0, 0));
|
|
2760
|
+
}, exports.gobj_subscribe_event = Kt, exports.gobj_trace_level = M, exports.gobj_trace_machine_format = function() {
|
|
2761
|
+
return $;
|
|
2762
|
+
}, exports.gobj_trace_no_level = W, exports.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2763
|
+
if (null == n && (n = {}), !e) return un(`publisher NULL: ev ${t}`), 0;
|
|
2764
|
+
if (!r) return un(`subscriber NULL: ev ${t}`), 0;
|
|
2641
2765
|
const o = /* @__PURE__ */ new Set([
|
|
2642
2766
|
"__config__",
|
|
2643
2767
|
"__global__",
|
|
@@ -2646,100 +2770,80 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2646
2770
|
"__service__"
|
|
2647
2771
|
]);
|
|
2648
2772
|
if (Object.keys(n).forEach((n) => {
|
|
2649
|
-
o.has(n) ||
|
|
2650
|
-
}),
|
|
2651
|
-
else if (!(
|
|
2652
|
-
let s =
|
|
2773
|
+
o.has(n) || un(`${Ze(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2774
|
+
}), Un(t)) t = "";
|
|
2775
|
+
else if (!($t(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return un(`event NOT in output event list: ${Ze(e)}, ev ${t}`), 0;
|
|
2776
|
+
let s = Vt(e.dl_subscriptions, e, t, n, r), l = 0;
|
|
2653
2777
|
for (let t = 0; t < s.length; t++) {
|
|
2654
2778
|
let n = s[t];
|
|
2655
|
-
|
|
2656
|
-
}
|
|
2657
|
-
return i || (qt(`${Fe(e)}: No subscription found`), Xt(n, "No subscription found")), 0;
|
|
2658
|
-
}, exports.gobj_unsubscribe_list = Dt, exports.gobj_walk_gobj_children = He, exports.gobj_walk_gobj_children_tree = qe, exports.gobj_write_attr = function(e, n, r, o) {
|
|
2659
|
-
if (!mn(n)) return Ht(t("gobj_write_attr(%s): path must be a string", Fe(e))), -1;
|
|
2660
|
-
let s, i = e.jn_attrs, l = n.split("`");
|
|
2661
|
-
if (l.length <= 1) {
|
|
2662
|
-
let o = n;
|
|
2663
|
-
return o in i && i.hasOwnProperty(o) ? (i[o] = r, dn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0) : (Ht(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), o)), -1);
|
|
2664
|
-
}
|
|
2665
|
-
let _ = l.length;
|
|
2666
|
-
for (let t = 0; t < _; t++) {
|
|
2667
|
-
s = l[t];
|
|
2668
|
-
let n = tt(e, { __gobj_name__: s });
|
|
2669
|
-
if (n && t < _ - 1) {
|
|
2670
|
-
e = n;
|
|
2671
|
-
continue;
|
|
2672
|
-
}
|
|
2673
|
-
let o = e.jn_attrs;
|
|
2674
|
-
if (s in o && o.hasOwnProperty(s)) return o[s] = r, dn(e.priv) && e.priv.hasOwnProperty(s) && (e.priv[s] = r), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.mt_writing && e.mt_writing(e, s), 0;
|
|
2675
|
-
break;
|
|
2779
|
+
Wt(e, n, !1, !1), l++;
|
|
2676
2780
|
}
|
|
2677
|
-
return
|
|
2678
|
-
}, exports.gobj_write_attrs =
|
|
2781
|
+
return l || (cn(`${Ze(e)}: No subscription found`), pn(n, "No subscription found")), 0;
|
|
2782
|
+
}, exports.gobj_unsubscribe_list = Yt, exports.gobj_walk_gobj_children = _t, exports.gobj_walk_gobj_children_tree = at, exports.gobj_write_attr = St, exports.gobj_write_attrs = Ot, exports.gobj_write_bool_attr = wt, exports.gobj_write_integer_attr = Nt, exports.gobj_write_str_attr = Rt, exports.gobj_yuno = Je, exports.gobj_yuno_id = ze, exports.gobj_yuno_name = He, exports.gobj_yuno_role = qe, exports.id_index_in_obj_list = ur, exports.index_in_list = Sr, exports.is_array = An, exports.is_boolean = In, exports.is_date = function(e) {
|
|
2679
2783
|
return e instanceof Date && !isNaN(e);
|
|
2680
|
-
}, exports.is_function =
|
|
2681
|
-
if (!
|
|
2784
|
+
}, exports.is_function = Pn, exports.is_gobj = Ln, exports.is_metadata_key = function(e) {
|
|
2785
|
+
if (!kn(e)) return !1;
|
|
2682
2786
|
let t;
|
|
2683
2787
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2684
2788
|
return 2 === t;
|
|
2685
|
-
}, exports.is_null =
|
|
2686
|
-
if (!
|
|
2789
|
+
}, exports.is_null = Cn, exports.is_number = $n, exports.is_object = Dn, exports.is_private_key = function(e) {
|
|
2790
|
+
if (!kn(e)) return !1;
|
|
2687
2791
|
let t;
|
|
2688
2792
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2689
2793
|
return 1 === t;
|
|
2690
2794
|
}, exports.is_pure_number = function(e) {
|
|
2691
|
-
if (
|
|
2692
|
-
if (!
|
|
2795
|
+
if ($n(e)) return !0;
|
|
2796
|
+
if (!kn(e)) return !1;
|
|
2693
2797
|
const t = Number(e);
|
|
2694
2798
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2695
|
-
}, exports.is_string =
|
|
2696
|
-
let o =
|
|
2697
|
-
if (!o) return
|
|
2698
|
-
if (
|
|
2699
|
-
let s,
|
|
2700
|
-
for (; (s =
|
|
2701
|
-
if (0 ===
|
|
2702
|
-
let e =
|
|
2703
|
-
e >= 0 &&
|
|
2799
|
+
}, exports.is_string = kn, exports.jdb_delete = function(e, t, n, r) {
|
|
2800
|
+
let o = Xn(null, Xn(null, e, "topics", null, 0), t, null, 0);
|
|
2801
|
+
if (!o) return un("jdb_delete: topic not found: " + t), null;
|
|
2802
|
+
if (Un(r.id)) return un("jdb_delete: record without id: " + r), gn(r), null;
|
|
2803
|
+
let s, l = n.split("`"), i = o;
|
|
2804
|
+
for (; (s = l.shift()) && !Un(s) && i;) Dn(i) && (i = Xn(null, i, e.hook, null, 0)), i = Er(i, null, s, !1);
|
|
2805
|
+
if (0 === l.length && i) if (An(i)) {
|
|
2806
|
+
let e = ur(i, r.id);
|
|
2807
|
+
e >= 0 && i.splice(e, 1);
|
|
2704
2808
|
} else {
|
|
2705
|
-
let t =
|
|
2809
|
+
let t = Xn(null, i, e.hook, null, 0), n = ur(t, r.id);
|
|
2706
2810
|
n >= 0 && t.splice(n, 1);
|
|
2707
2811
|
}
|
|
2708
2812
|
return o;
|
|
2709
2813
|
}, exports.jdb_get = function(e, t, n, r) {
|
|
2710
|
-
let o =
|
|
2711
|
-
return o ? (void 0 === r && (r = !0),
|
|
2814
|
+
let o = Xn(null, Xn(null, e, "topics", null, 0), t, null, 0);
|
|
2815
|
+
return o ? (void 0 === r && (r = !0), Er(o, e.hook, n, r)) : (un("jdb_get: topic not found: " + t), null);
|
|
2712
2816
|
}, exports.jdb_get_by_idx = function(e, t, n) {
|
|
2713
|
-
let r =
|
|
2714
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2817
|
+
let r = Xn(null, Xn(null, e, "topics", null, 0), t, null, 0);
|
|
2818
|
+
return r ? n < r.length ? r[n] : {} : (un("jdb_get_by_idx: topic not found: " + t), null);
|
|
2715
2819
|
}, exports.jdb_get_topic = function(e, t) {
|
|
2716
|
-
let n =
|
|
2717
|
-
if (!n) return
|
|
2718
|
-
return
|
|
2820
|
+
let n = Xn(null, e, "topics", null, 0);
|
|
2821
|
+
if (!n) return un("jdb topics section not found"), gn(e), null;
|
|
2822
|
+
return Xn(null, n, t, null, 0) || (un("jdb topic not found: " + t), gn(n), null);
|
|
2719
2823
|
}, exports.jdb_init = function(e, t, n) {
|
|
2720
|
-
n && (e =
|
|
2721
|
-
let r =
|
|
2722
|
-
|
|
2723
|
-
let o =
|
|
2724
|
-
return
|
|
2725
|
-
"__" !== t.substring(0, 2) &&
|
|
2824
|
+
n && (e = dn(e));
|
|
2825
|
+
let r = Xn(null, e, "type", [], 1);
|
|
2826
|
+
qn(null, e, "hook", "data", 1);
|
|
2827
|
+
let o = Xn(null, e, "schema", {}, 1), s = Xn(null, e, "topics", {}, 1);
|
|
2828
|
+
return hr(o, function(e, t, n, o) {
|
|
2829
|
+
"__" !== t.substring(0, 2) && Xn(null, s, o, dn(r), 1);
|
|
2726
2830
|
}, t), e;
|
|
2727
2831
|
}, exports.jdb_update = function(e, t, n, r) {
|
|
2728
|
-
let o =
|
|
2729
|
-
if (!o) return
|
|
2730
|
-
if (
|
|
2731
|
-
let s,
|
|
2732
|
-
for (; (s =
|
|
2733
|
-
if (0 ===
|
|
2734
|
-
else if (
|
|
2832
|
+
let o = Xn(null, Xn(null, e, "topics", null, 0), t, null, 0);
|
|
2833
|
+
if (!o) return un("jdb_update: topic not found: " + t), null;
|
|
2834
|
+
if (Un(r.id)) return un("jdb_update: record without id: " + r), gn(r), null;
|
|
2835
|
+
let s, l = n.split("`"), i = o;
|
|
2836
|
+
for (; (s = l.shift()) && !Un(s) && i;) Dn(i) && (i = Xn(null, i, e.hook, [], 1)), i = Er(i, null, s, !1);
|
|
2837
|
+
if (0 === l.length && i) if (An(i)) i.push(r);
|
|
2838
|
+
else if (i.id === r.id) Object.assign(i, r);
|
|
2735
2839
|
else {
|
|
2736
|
-
let t =
|
|
2840
|
+
let t = Xn(null, i, e.hook, [], 1), n = Er(t, e.hook, r.id, !1);
|
|
2737
2841
|
n ? Object.assign(n, r) : t.push(r);
|
|
2738
2842
|
}
|
|
2739
2843
|
return o;
|
|
2740
2844
|
}, exports.json2flat = function(e) {
|
|
2741
2845
|
const t = {}, n = (e, r, o) => {
|
|
2742
|
-
if (o >
|
|
2846
|
+
if (o > Nr) throw new Error("json2flat: deeper than 256");
|
|
2743
2847
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2744
2848
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2745
2849
|
const s = `[${t}]`;
|
|
@@ -2749,7 +2853,7 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2749
2853
|
const t = Object.keys(e);
|
|
2750
2854
|
if (t.length > 0) {
|
|
2751
2855
|
for (const s of t) {
|
|
2752
|
-
const t =
|
|
2856
|
+
const t = xr(s);
|
|
2753
2857
|
n(e[s], 0 === o ? t : r + "`" + t, o + 1);
|
|
2754
2858
|
}
|
|
2755
2859
|
return;
|
|
@@ -2758,11 +2862,11 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2758
2862
|
0 !== o && (t[r] = e);
|
|
2759
2863
|
};
|
|
2760
2864
|
return null == e || n(e, "", 0), t;
|
|
2761
|
-
}, exports.json_array_append =
|
|
2865
|
+
}, exports.json_array_append = Sn, exports.json_array_append_new = On, exports.json_array_extend = function(e, t) {
|
|
2762
2866
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2763
|
-
}, exports.json_array_remove =
|
|
2867
|
+
}, exports.json_array_remove = wn, exports.json_array_size = Rn, exports.json_deep_copy = dn, exports.json_is_identical = bn, exports.json_object_del = yn, exports.json_object_get = Tn, exports.json_object_set = vn, exports.json_object_set_new = jn, exports.json_object_size = Nn, exports.json_object_update = mn, exports.json_object_update_existing = hn, exports.json_object_update_missing = En, exports.json_size = xn, exports.jwt2json = function(e, t) {
|
|
2764
2868
|
try {
|
|
2765
|
-
let n =
|
|
2869
|
+
let n = Tr(e);
|
|
2766
2870
|
switch (t) {
|
|
2767
2871
|
case "header": return JSON.parse(n.header);
|
|
2768
2872
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2771,133 +2875,133 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2771
2875
|
} catch (e) {
|
|
2772
2876
|
return null;
|
|
2773
2877
|
}
|
|
2774
|
-
}, exports.jwtDecode =
|
|
2775
|
-
if (e && !
|
|
2776
|
-
r || (r =
|
|
2878
|
+
}, exports.jwtDecode = Tr, exports.kw_clone_by_keys = rr, exports.kw_clone_by_not_keys = or, exports.kw_collect = function(e, t, n, r) {
|
|
2879
|
+
if (e && !Ln(e) && un("GObj bad instanceof"), !t) return null;
|
|
2880
|
+
r || (r = nr);
|
|
2777
2881
|
let o = [];
|
|
2778
|
-
if (
|
|
2882
|
+
if (An(t)) for (let e = 0; e < t.length; e++) {
|
|
2779
2883
|
let s = t[e];
|
|
2780
2884
|
r(s, n) && o.push(s);
|
|
2781
2885
|
}
|
|
2782
2886
|
else {
|
|
2783
|
-
if (!
|
|
2887
|
+
if (!Dn(t)) return un("kw_select() BAD kw parameter"), null;
|
|
2784
2888
|
r(t, n) && o.push(t);
|
|
2785
2889
|
}
|
|
2786
2890
|
return o;
|
|
2787
|
-
}, exports.kw_delete =
|
|
2788
|
-
if (!n || !
|
|
2789
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2790
|
-
return r &&
|
|
2791
|
-
}, exports.kw_find_path =
|
|
2792
|
-
e && !
|
|
2793
|
-
let s =
|
|
2794
|
-
const
|
|
2891
|
+
}, exports.kw_delete = Bn, exports.kw_find_json_in_list = function(e, t, n, r) {
|
|
2892
|
+
if (!n || !An(t)) return r && un("item NULL or kw_list is not a list"), -1;
|
|
2893
|
+
for (let e = 0; e < t.length; e++) if (bn(n, t[e])) return e;
|
|
2894
|
+
return r && un("item not found in this list"), -1;
|
|
2895
|
+
}, exports.kw_find_path = Yn, exports.kw_flag_t = qt, exports.kw_get_bool = Jn, exports.kw_get_dict = Qn, exports.kw_get_dict_value = Xn, exports.kw_get_int = Hn, exports.kw_get_list = function(e, t, n, r, o) {
|
|
2896
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
2897
|
+
let s = Yn(e, t, n, !1);
|
|
2898
|
+
const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
|
|
2795
2899
|
if (void 0 === s) {
|
|
2796
|
-
if (
|
|
2900
|
+
if (i) {
|
|
2797
2901
|
let o = Array(r);
|
|
2798
|
-
return
|
|
2902
|
+
return Zn(e, t, n, o), o;
|
|
2799
2903
|
}
|
|
2800
|
-
return
|
|
2904
|
+
return l && (un(`path not found: '${n}'`), pn(t)), Array(r);
|
|
2801
2905
|
}
|
|
2802
|
-
return _ &&
|
|
2803
|
-
}, exports.kw_get_local_storage_value =
|
|
2804
|
-
e && !
|
|
2805
|
-
let s =
|
|
2806
|
-
const
|
|
2906
|
+
return _ && Bn(e, t, n), An(s) ? Array(s) : (l && (un(`path value MUST BE an array: ${n}`), gn(t)), Array(r));
|
|
2907
|
+
}, exports.kw_get_local_storage_value = sr, exports.kw_get_pointer = zn, exports.kw_get_real = function(e, t, n, r, o) {
|
|
2908
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
2909
|
+
let s = Yn(e, t, n, !1);
|
|
2910
|
+
const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
|
|
2807
2911
|
if (void 0 === s) {
|
|
2808
|
-
if (
|
|
2912
|
+
if (i) {
|
|
2809
2913
|
let o = Number(r);
|
|
2810
|
-
return
|
|
2914
|
+
return Zn(e, t, n, o), o;
|
|
2811
2915
|
}
|
|
2812
|
-
return
|
|
2916
|
+
return l && (un(`path not found: '${n}'`), pn(t)), Number(r);
|
|
2813
2917
|
}
|
|
2814
|
-
return _ &&
|
|
2815
|
-
}, exports.kw_get_str =
|
|
2816
|
-
if (e && !
|
|
2817
|
-
r || (r =
|
|
2918
|
+
return _ && Bn(e, t, n), $n(s) ? Number(s) : (l && (un(`path value MUST BE a number: ${n}`), gn(t)), Number(r));
|
|
2919
|
+
}, exports.kw_get_str = qn, exports.kw_has_key = Kn, exports.kw_match_simple = nr, exports.kw_pop = Wn, exports.kw_remove_local_storage_value = ir, exports.kw_select = function(e, t, n, r) {
|
|
2920
|
+
if (e && !Ln(e) && un("GObj bad instanceof"), !t) return null;
|
|
2921
|
+
r || (r = nr);
|
|
2818
2922
|
let o = [];
|
|
2819
|
-
if (
|
|
2923
|
+
if (An(t)) for (let e = 0; e < t.length; e++) {
|
|
2820
2924
|
let s = t[e];
|
|
2821
|
-
r(s, n) && o.push(
|
|
2925
|
+
r(s, n) && o.push(dn(s));
|
|
2822
2926
|
}
|
|
2823
2927
|
else {
|
|
2824
|
-
if (!
|
|
2825
|
-
r(t, n) && o.push(
|
|
2928
|
+
if (!Dn(t)) return un("kw_select() BAD kw parameter"), null;
|
|
2929
|
+
r(t, n) && o.push(dn(t));
|
|
2826
2930
|
}
|
|
2827
2931
|
return o;
|
|
2828
|
-
}, exports.kw_set_dict_value =
|
|
2829
|
-
e && !
|
|
2830
|
-
let s =
|
|
2932
|
+
}, exports.kw_set_dict_value = Zn, exports.kw_set_local_storage_value = lr, exports.kw_set_subdict_value = er, exports.kwid_collect = ar, exports.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2933
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
2934
|
+
let s = ar(e, t, n, r, o);
|
|
2831
2935
|
return s && 0 !== s.length ? s[0] : null;
|
|
2832
2936
|
}, exports.kwid_get_ids = function(e, t) {
|
|
2833
|
-
if (e && !
|
|
2937
|
+
if (e && !Ln(e) && un("GObj bad instanceof"), !t) return [];
|
|
2834
2938
|
let n = [];
|
|
2835
|
-
if (
|
|
2836
|
-
else if (
|
|
2837
|
-
else
|
|
2838
|
-
if (
|
|
2839
|
-
else if (
|
|
2840
|
-
let r =
|
|
2939
|
+
if (kn(t)) n.push(t);
|
|
2940
|
+
else if (Dn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2941
|
+
else An(t) && t.forEach(function(t) {
|
|
2942
|
+
if (kn(t)) Un(t) || n.push(t);
|
|
2943
|
+
else if (Dn(t)) {
|
|
2944
|
+
let r = qn(e, t, "id", 0, 0);
|
|
2841
2945
|
r && n.push(r);
|
|
2842
2946
|
}
|
|
2843
2947
|
});
|
|
2844
2948
|
return n;
|
|
2845
|
-
}, exports.kwid_match_id =
|
|
2846
|
-
e && !
|
|
2949
|
+
}, exports.kwid_match_id = _r, exports.kwid_new_dict = function(e, t, n) {
|
|
2950
|
+
e && !Ln(e) && un("GObj bad instanceof");
|
|
2847
2951
|
let r = {};
|
|
2848
|
-
if (
|
|
2849
|
-
else if (
|
|
2850
|
-
let o = t[n], s =
|
|
2851
|
-
|
|
2952
|
+
if (Un(n) || (t = Yn(e, t, n)), Dn(t)) r = t;
|
|
2953
|
+
else if (An(t)) for (let n = 0; n < t.length; n++) {
|
|
2954
|
+
let o = t[n], s = qn(e, o, "id", "", qt.KW_REQUIRED);
|
|
2955
|
+
Un(s) || (r[s] = o);
|
|
2852
2956
|
}
|
|
2853
|
-
else
|
|
2957
|
+
else un(`${Ze(e)} kwid_new_dict: data type unknown`);
|
|
2854
2958
|
return r;
|
|
2855
2959
|
}, exports.kwid_new_list = function(e, t, n) {
|
|
2856
|
-
if (e && !
|
|
2857
|
-
if (
|
|
2960
|
+
if (e && !Ln(e) && un("GObj bad instanceof"), Un(n) || (t = Yn(e, t, n)), An(t)) return t;
|
|
2961
|
+
if (Dn(t)) {
|
|
2858
2962
|
let n = [];
|
|
2859
2963
|
for (let r of Object.keys(t)) {
|
|
2860
2964
|
let o = t[r];
|
|
2861
|
-
|
|
2965
|
+
Dn(o) ? (o.id = r, n.push(o)) : un(`${Ze(e)} kwid_new_list: not a record: '${r}'`);
|
|
2862
2966
|
}
|
|
2863
2967
|
return n;
|
|
2864
2968
|
}
|
|
2865
|
-
return
|
|
2969
|
+
return un(`${Ze(e)} kwid_new_list: wrong type for list`), [];
|
|
2866
2970
|
}, exports.list2options = function(e, t, n) {
|
|
2867
2971
|
t = t || "id", n = n || "value";
|
|
2868
2972
|
let r = [];
|
|
2869
|
-
if (
|
|
2973
|
+
if (An(e)) for (let o = 0; o < e.length; o++) {
|
|
2870
2974
|
let s = e[o];
|
|
2871
|
-
if (
|
|
2975
|
+
if (kn(s)) r.push({
|
|
2872
2976
|
id: e[o],
|
|
2873
2977
|
value: e[o]
|
|
2874
2978
|
});
|
|
2875
|
-
else if (
|
|
2979
|
+
else if (Dn(s)) {
|
|
2876
2980
|
let e = {};
|
|
2877
|
-
if (
|
|
2878
|
-
if (!
|
|
2879
|
-
if (!(
|
|
2880
|
-
|
|
2981
|
+
if (Kn(s, t)) {
|
|
2982
|
+
if (!Kn(s, n)) {
|
|
2983
|
+
if (!(xn(s) > 0)) {
|
|
2984
|
+
un("list2options(): object without field value: " + n);
|
|
2881
2985
|
continue;
|
|
2882
2986
|
}
|
|
2883
2987
|
n = Object.keys(s)[0];
|
|
2884
2988
|
}
|
|
2885
2989
|
e.id = s[t], e.value = s[n];
|
|
2886
2990
|
} else {
|
|
2887
|
-
if (!(
|
|
2888
|
-
|
|
2991
|
+
if (!(xn(s) > 0)) {
|
|
2992
|
+
un("list2options(): object without field id: " + t);
|
|
2889
2993
|
continue;
|
|
2890
2994
|
}
|
|
2891
2995
|
t = Object.keys(s)[0], e.id = t, e.value = s[t];
|
|
2892
2996
|
}
|
|
2893
2997
|
r.push(e);
|
|
2894
|
-
} else
|
|
2998
|
+
} else un("list2options(): case1 not implemented");
|
|
2895
2999
|
}
|
|
2896
|
-
else if (
|
|
3000
|
+
else if (Dn(e)) for (let t of Object.keys(e)) r.push({
|
|
2897
3001
|
id: t,
|
|
2898
3002
|
value: t
|
|
2899
3003
|
});
|
|
2900
|
-
else
|
|
3004
|
+
else un("list2options(): case2 not implemented");
|
|
2901
3005
|
return r;
|
|
2902
3006
|
}, exports.load_json_file = function(e, t, n) {
|
|
2903
3007
|
let r = new XMLHttpRequest();
|
|
@@ -2905,18 +3009,18 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2905
3009
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2906
3010
|
t(JSON.parse(r.responseText));
|
|
2907
3011
|
} catch (e) {
|
|
2908
|
-
n && (
|
|
3012
|
+
n && (un(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2909
3013
|
}
|
|
2910
3014
|
else n && n(r.status);
|
|
2911
3015
|
var e;
|
|
2912
3016
|
}, r.send();
|
|
2913
|
-
}, exports.log_debug =
|
|
2914
|
-
let t =
|
|
2915
|
-
|
|
2916
|
-
}, exports.log_warning =
|
|
3017
|
+
}, exports.log_debug = fn, exports.log_error = un, exports.log_info = function(e) {
|
|
3018
|
+
let t = an(e), n = jr();
|
|
3019
|
+
Zt && on("info", t) && Zt("%c" + n + " INFO: " + String(t), "color:cyan"), ln("info", t, n);
|
|
3020
|
+
}, exports.log_warning = cn, exports.msg_iev_get_msg_type = mr, exports.msg_iev_get_stack = dr, exports.msg_iev_push_stack = pr, exports.msg_iev_read_key = fr, exports.msg_iev_set_msg_type = br, exports.msg_iev_write_key = gr, exports.node_uuid = Or, exports.parseBoolean = Fn, exports.parseSVG = function(e) {
|
|
2917
3021
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2918
3022
|
}, exports.refresh_language = function(e, t) {
|
|
2919
|
-
if (!
|
|
3023
|
+
if (!Pn(t)) return void un("You must supply a translation function");
|
|
2920
3024
|
e || (e = document);
|
|
2921
3025
|
const n = (t) => {
|
|
2922
3026
|
let n = [];
|
|
@@ -2940,22 +3044,22 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2940
3044
|
});
|
|
2941
3045
|
}, exports.register_c_ievent_cli = function() {
|
|
2942
3046
|
return function(e) {
|
|
2943
|
-
if (
|
|
3047
|
+
if (so) return un(`GClass ALREADY created: ${e}`), -1;
|
|
2944
3048
|
const t = [
|
|
2945
3049
|
["ST_DISCONNECTED", [
|
|
2946
3050
|
[
|
|
2947
3051
|
"EV_ON_OPEN",
|
|
2948
|
-
|
|
3052
|
+
bo,
|
|
2949
3053
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
2950
3054
|
],
|
|
2951
3055
|
[
|
|
2952
3056
|
"EV_ON_CLOSE",
|
|
2953
|
-
|
|
3057
|
+
mo,
|
|
2954
3058
|
null
|
|
2955
3059
|
],
|
|
2956
3060
|
[
|
|
2957
3061
|
"EV_TIMEOUT",
|
|
2958
|
-
|
|
3062
|
+
po,
|
|
2959
3063
|
null
|
|
2960
3064
|
],
|
|
2961
3065
|
[
|
|
@@ -2967,22 +3071,22 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2967
3071
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
2968
3072
|
[
|
|
2969
3073
|
"EV_ON_MESSAGE",
|
|
2970
|
-
|
|
3074
|
+
To,
|
|
2971
3075
|
null
|
|
2972
3076
|
],
|
|
2973
3077
|
[
|
|
2974
3078
|
"EV_IDENTITY_CARD_ACK",
|
|
2975
|
-
|
|
3079
|
+
Eo,
|
|
2976
3080
|
null
|
|
2977
3081
|
],
|
|
2978
3082
|
[
|
|
2979
3083
|
"EV_ON_CLOSE",
|
|
2980
|
-
|
|
3084
|
+
mo,
|
|
2981
3085
|
"ST_DISCONNECTED"
|
|
2982
3086
|
],
|
|
2983
3087
|
[
|
|
2984
3088
|
"EV_TIMEOUT",
|
|
2985
|
-
|
|
3089
|
+
ho,
|
|
2986
3090
|
null
|
|
2987
3091
|
],
|
|
2988
3092
|
[
|
|
@@ -2994,22 +3098,22 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2994
3098
|
["ST_SESSION", [
|
|
2995
3099
|
[
|
|
2996
3100
|
"EV_ON_MESSAGE",
|
|
2997
|
-
|
|
3101
|
+
To,
|
|
2998
3102
|
null
|
|
2999
3103
|
],
|
|
3000
3104
|
[
|
|
3001
3105
|
"EV_MT_STATS",
|
|
3002
|
-
|
|
3106
|
+
yo,
|
|
3003
3107
|
null
|
|
3004
3108
|
],
|
|
3005
3109
|
[
|
|
3006
3110
|
"EV_MT_COMMAND",
|
|
3007
|
-
|
|
3111
|
+
vo,
|
|
3008
3112
|
null
|
|
3009
3113
|
],
|
|
3010
3114
|
[
|
|
3011
3115
|
"EV_ON_CLOSE",
|
|
3012
|
-
|
|
3116
|
+
mo,
|
|
3013
3117
|
"ST_DISCONNECTED"
|
|
3014
3118
|
],
|
|
3015
3119
|
[
|
|
@@ -3020,7 +3124,7 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3020
3124
|
]],
|
|
3021
3125
|
[null, null]
|
|
3022
3126
|
];
|
|
3023
|
-
return (
|
|
3127
|
+
return (so = ge(e, [
|
|
3024
3128
|
["EV_ON_MESSAGE", R.EVF_OUTPUT_EVENT],
|
|
3025
3129
|
["EV_IDENTITY_CARD_ACK", R.EVF_PUBLIC_EVENT],
|
|
3026
3130
|
["EV_ON_ID_NAK", R.EVF_PUBLIC_EVENT | R.EVF_OUTPUT_EVENT],
|
|
@@ -3031,54 +3135,54 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3031
3135
|
["EV_ON_OPEN_ERROR", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS],
|
|
3032
3136
|
["EV_TIMEOUT", 0],
|
|
3033
3137
|
[null, 0]
|
|
3034
|
-
], t,
|
|
3138
|
+
], t, jo, 0, to, oo, 0, 0, no, O.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3035
3139
|
}("C_IEVENT_CLI");
|
|
3036
3140
|
}, exports.register_c_timer = function() {
|
|
3037
3141
|
return function(e) {
|
|
3038
|
-
if (
|
|
3142
|
+
if (Gr) return un(`GClass ALREADY created: ${e}`), -1;
|
|
3039
3143
|
const t = [["ST_IDLE", [[
|
|
3040
3144
|
"EV_TIMEOUT",
|
|
3041
|
-
|
|
3145
|
+
Vr,
|
|
3042
3146
|
null
|
|
3043
3147
|
]]]];
|
|
3044
|
-
return (
|
|
3148
|
+
return (Gr = ge(e, [
|
|
3045
3149
|
["EV_TIMEOUT", R.EVF_OUTPUT_EVENT],
|
|
3046
3150
|
["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT],
|
|
3047
3151
|
[0, 0]
|
|
3048
|
-
], t,
|
|
3152
|
+
], t, Mr, 0, Ur, Fr, 0, 0, 0, O.gcflag_manual_start)) ? 0 : -1;
|
|
3049
3153
|
}("C_TIMER");
|
|
3050
3154
|
}, exports.register_c_yuno = function() {
|
|
3051
3155
|
return function(e) {
|
|
3052
|
-
if (
|
|
3156
|
+
if (Hr) return un(`GClass ALREADY created: ${e}`), -1;
|
|
3053
3157
|
const t = [["ST_IDLE", [[
|
|
3054
3158
|
"EV_TIMEOUT_PERIODIC",
|
|
3055
|
-
|
|
3159
|
+
Xr,
|
|
3056
3160
|
null
|
|
3057
3161
|
]]]];
|
|
3058
|
-
return (
|
|
3162
|
+
return (Hr = ge(e, [["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]], t, Zr, 0, Br, Jr, 0, 0, 0, 0)) ? 0 : -1;
|
|
3059
3163
|
}("C_YUNO");
|
|
3060
3164
|
}, exports.safeSrc = function(e) {
|
|
3061
3165
|
if (!e) return "";
|
|
3062
3166
|
const t = String(e).trim();
|
|
3063
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3064
|
-
}, exports.sdata_flag_t =
|
|
3167
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : yr(t);
|
|
3168
|
+
}, exports.sdata_flag_t = E, exports.send_http_json_post = function(e, t, n) {
|
|
3065
3169
|
let r = new XMLHttpRequest();
|
|
3066
3170
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
3067
3171
|
4 === r.readyState && n(r.status, r.responseText);
|
|
3068
3172
|
}, r.send(t);
|
|
3069
3173
|
}, exports.set_console_log_enabled = function(e) {
|
|
3070
|
-
|
|
3174
|
+
nn = !!e;
|
|
3071
3175
|
}, exports.set_console_log_filter = function(e) {
|
|
3072
|
-
|
|
3176
|
+
rn = "function" == typeof e ? e : null;
|
|
3073
3177
|
}, exports.set_log_callback = function(e) {
|
|
3074
|
-
|
|
3075
|
-
}, exports.set_remote_log_functions =
|
|
3178
|
+
tn = "function" == typeof e ? e : null;
|
|
3179
|
+
}, exports.set_remote_log_functions = _n, exports.set_timeout = Wr, exports.set_timeout_periodic = Kr, exports.sprintf = t, exports.stats_parser = function(e, t, n, r) {}, exports.str_in_list = cr, exports.strcasecmp = Vn, exports.strcmp = Gn, exports.strncmp = function(e, t, n) {
|
|
3076
3180
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
3077
3181
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
3078
3182
|
}, exports.strs_in_list = function(e, t, n) {
|
|
3079
|
-
if (!e) return
|
|
3080
|
-
if (!t) return
|
|
3081
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3183
|
+
if (!e) return un("ERROR: strs_in_list() list empty"), !1;
|
|
3184
|
+
if (!t) return un("ERROR: strs_in_list() str empty"), !1;
|
|
3185
|
+
for (let r = 0; r < t.length; r++) if (cr(e, t[r], n)) return !0;
|
|
3082
3186
|
return !1;
|
|
3083
3187
|
}, exports.strstr = function(e, t, n) {
|
|
3084
3188
|
var r;
|
|
@@ -3097,13 +3201,13 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3097
3201
|
placeholder: void 0,
|
|
3098
3202
|
fkey: null
|
|
3099
3203
|
};
|
|
3100
|
-
if (
|
|
3204
|
+
if (kn(t)) {
|
|
3101
3205
|
let e = t.split(".");
|
|
3102
3206
|
for (let t = 0; t < e.length; t++) {
|
|
3103
3207
|
let r = e[t];
|
|
3104
|
-
if (
|
|
3105
|
-
else if (
|
|
3106
|
-
else if (
|
|
3208
|
+
if (cr(Ir, r)) n.real_type || (n.real_type = r);
|
|
3209
|
+
else if (cr(Pr, r)) n.type || (n.type = r);
|
|
3210
|
+
else if (cr(Cr, r)) switch (r) {
|
|
3107
3211
|
case "writable":
|
|
3108
3212
|
n.is_writable = !0;
|
|
3109
3213
|
break;
|
|
@@ -3115,23 +3219,23 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3115
3219
|
}
|
|
3116
3220
|
}
|
|
3117
3221
|
n.real_type || (n.real_type = "string");
|
|
3118
|
-
} else
|
|
3222
|
+
} else Dn(t) ? (n = Lr(t), n.name || (n.name = e), n.header || (n.header = e)) : An(t) && (n.real_type = "array", n.enum_list = t);
|
|
3119
3223
|
return n.type || (n.type = n.real_type), n;
|
|
3120
3224
|
}, exports.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3121
3225
|
const n = e, r = performance.now();
|
|
3122
3226
|
let o = r;
|
|
3123
|
-
return t &&
|
|
3124
|
-
const
|
|
3125
|
-
return t &&
|
|
3126
|
-
partial:
|
|
3227
|
+
return t && cn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", s = "") => {
|
|
3228
|
+
const l = performance.now(), i = (l - o) / 1e3, _ = (l - r) / 1e3;
|
|
3229
|
+
return t && cn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${s}`), o = l, {
|
|
3230
|
+
partial: i,
|
|
3127
3231
|
total: _
|
|
3128
3232
|
};
|
|
3129
3233
|
} };
|
|
3130
|
-
}, exports.trace_json =
|
|
3131
|
-
if (
|
|
3234
|
+
}, exports.trace_json = pn, exports.trace_level_t = C, exports.trace_msg = gn, exports.treedb_decoder_fkey = $r, exports.treedb_decoder_hook = function(e, t) {
|
|
3235
|
+
if (kn(t)) {
|
|
3132
3236
|
if (-1 === t.indexOf("^")) {
|
|
3133
3237
|
let n, r = e.hook;
|
|
3134
|
-
if (1 !==
|
|
3238
|
+
if (1 !== Nn(r)) return un("bad hook 1"), un(e), un(t), null;
|
|
3135
3239
|
for (let e of Object.keys(r)) {
|
|
3136
3240
|
n = e, r[e];
|
|
3137
3241
|
break;
|
|
@@ -3143,25 +3247,25 @@ exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3143
3247
|
}
|
|
3144
3248
|
{
|
|
3145
3249
|
let n = t.split("^");
|
|
3146
|
-
return 2 !== n.length ? (
|
|
3250
|
+
return 2 !== n.length ? (un("bad hook 2"), un(e), un(t), null) : {
|
|
3147
3251
|
topic_name: n[0],
|
|
3148
3252
|
id: n[1]
|
|
3149
3253
|
};
|
|
3150
3254
|
}
|
|
3151
3255
|
}
|
|
3152
|
-
return
|
|
3256
|
+
return Dn(t) ? {
|
|
3153
3257
|
topic_name: t.topic_name,
|
|
3154
3258
|
id: t.id
|
|
3155
|
-
} : (
|
|
3259
|
+
} : (un("bad hook 3"), un(e), un(t), null);
|
|
3156
3260
|
}, exports.treedb_encoder_fkey = function(e, t) {
|
|
3157
|
-
let n =
|
|
3261
|
+
let n = $r(e, t);
|
|
3158
3262
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3159
|
-
}, exports.treedb_get_field_desc =
|
|
3160
|
-
if (
|
|
3263
|
+
}, exports.treedb_get_field_desc = Lr, exports.treedb_hook_data_size = function(e) {
|
|
3264
|
+
if (An(e) && 1 === xn(e)) {
|
|
3161
3265
|
let t = e[0];
|
|
3162
|
-
return
|
|
3266
|
+
return Kn(t, "size") ? t.size : 1;
|
|
3163
3267
|
}
|
|
3164
|
-
return
|
|
3268
|
+
return xn(e);
|
|
3165
3269
|
}, exports.vsprintf = function(e, n) {
|
|
3166
3270
|
return t.apply(null, [e].concat(n || []));
|
|
3167
3271
|
}, exports.walk_type_t = x;
|