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