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