@yuneta/gobj-js 7.26.27 → 7.26.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/dist/gobj-js.cjs.js +157 -51
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +826 -767
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +157 -51
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +1480 -1422
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +157 -51
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +825 -766
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +157 -51
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +825 -766
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
DTP_POINTER: 8
|
|
149
149
|
}), T = (e) => e === E.DTP_STRING, j = (e) => e === E.DTP_BOOLEAN, O = (e) => e === E.DTP_REAL, S = (e) => e === E.DTP_LIST, w = (e) => e === E.DTP_DICT, N = (e) => e === E.DTP_JSON;
|
|
150
150
|
E.DTP_POINTER;
|
|
151
|
-
var $ = (e) => ((e) => e === E.DTP_INTEGER)(e) || O(e) || j(e),
|
|
151
|
+
var $ = (e) => ((e) => e === E.DTP_INTEGER)(e) || O(e) || j(e), R = Object.freeze({
|
|
152
152
|
SDF_NOTACCESS: 1,
|
|
153
153
|
SDF_RD: 2,
|
|
154
154
|
SDF_WR: 4,
|
|
@@ -172,18 +172,18 @@
|
|
|
172
172
|
SDF_AUTHZ_RS: 1048576,
|
|
173
173
|
SDF_SECRET: 2097152
|
|
174
174
|
});
|
|
175
|
-
|
|
176
|
-
var
|
|
175
|
+
R.SDF_RD, R.SDF_WR, R.SDF_STATS, R.SDF_PERSIST, R.SDF_VOLATIL, R.SDF_RSTATS, R.SDF_PSTATS, R.SDF_WR, R.SDF_PERSIST;
|
|
176
|
+
var A = class {
|
|
177
177
|
constructor(e, t, n = 0, r = null, o = "", l = null, i = null, s = 0, a = null, u = null, _ = null) {
|
|
178
178
|
this.type = e, this.name = t, this.alias = l, this.flag = n, this.default_value = r, this.header = i, this.fillspace = s, this.description = o, this.json_fn = a, this.schema = u, this.authpth = _;
|
|
179
179
|
}
|
|
180
|
-
}, D = () => new
|
|
180
|
+
}, D = () => new A(0, null), k = (e, t, n, r, o) => new A(e, t, n, r, o), C = class {
|
|
181
181
|
constructor(e, t, n, r, o, l, i, s, a) {
|
|
182
182
|
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = o, this.authz_table = l, this.command_table = i, this.s_user_trace_level = s, this.gclass_flag = Number(a) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
183
183
|
}
|
|
184
184
|
}, I = class {
|
|
185
185
|
constructor(e, t, n, r, o) {
|
|
186
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(o) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv =
|
|
186
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(o) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = Ro(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
187
187
|
}
|
|
188
188
|
}, P = Object.freeze({
|
|
189
189
|
gcflag_manual_start: 1,
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
};
|
|
230
230
|
var x = 1;
|
|
231
231
|
function K(e) {
|
|
232
|
-
|
|
232
|
+
Bo(e) && (e = JSON.stringify(e)), ar(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
233
233
|
}
|
|
234
234
|
var B = Object.freeze({
|
|
235
235
|
TRACE_MACHINE: 65536,
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
B.TRACE_COMMANDS,
|
|
324
324
|
"Trace commands"
|
|
325
325
|
]
|
|
326
|
-
], J = 0,
|
|
326
|
+
], J = 0, q = 0, H = 0;
|
|
327
327
|
function z(e, t) {
|
|
328
328
|
let n = [];
|
|
329
329
|
for (const [t, r] of Y) e & r && n.push(t);
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
return n;
|
|
332
332
|
}
|
|
333
333
|
function Q(e, t, n) {
|
|
334
|
-
if (
|
|
334
|
+
if (Zo(e)) return void 0 === n ? 268369920 : 65535;
|
|
335
335
|
if (/^[0-9]+$/.test(String(e))) {
|
|
336
336
|
const t = Number(e);
|
|
337
337
|
if (t) return t;
|
|
@@ -345,12 +345,12 @@
|
|
|
345
345
|
}(String(e), n) || (ir(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
346
346
|
}
|
|
347
347
|
function X(e) {
|
|
348
|
-
if (
|
|
348
|
+
if (H) return 4294967295;
|
|
349
349
|
let t = J;
|
|
350
350
|
return e && (t |= e.trace_level || 0, e.gclass && (t |= e.gclass.trace_level || 0)), t;
|
|
351
351
|
}
|
|
352
352
|
function Z(e) {
|
|
353
|
-
let t =
|
|
353
|
+
let t = q;
|
|
354
354
|
return e && (t |= e.no_trace_level || 0, e.gclass && (t |= e.gclass.no_trace_level || 0)), t;
|
|
355
355
|
}
|
|
356
356
|
function ee(e) {
|
|
@@ -366,13 +366,13 @@
|
|
|
366
366
|
return X(e) & B.TRACE_EV_KW;
|
|
367
367
|
}
|
|
368
368
|
function oe(e, t) {
|
|
369
|
-
if (
|
|
369
|
+
if (H > 1) return !0;
|
|
370
370
|
if (!e) return !1;
|
|
371
371
|
const n = X(e);
|
|
372
372
|
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
373
373
|
}
|
|
374
374
|
function le(e, t) {
|
|
375
|
-
if (
|
|
375
|
+
if (H > 1) return !1;
|
|
376
376
|
if (!e) return !0;
|
|
377
377
|
const n = Z(e);
|
|
378
378
|
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
@@ -383,47 +383,47 @@
|
|
|
383
383
|
}
|
|
384
384
|
function se(e, t) {
|
|
385
385
|
const n = Q(e, "gobj_set_global_no_trace");
|
|
386
|
-
return n ? (t ?
|
|
386
|
+
return n ? (t ? q |= n : q &= ~n, 0) : -1;
|
|
387
387
|
}
|
|
388
388
|
function ae(e, t) {
|
|
389
389
|
return J = t ? (J | e) >>> 0 : (J & ~e) >>> 0, 0;
|
|
390
390
|
}
|
|
391
391
|
function ue(e, t) {
|
|
392
|
-
return
|
|
392
|
+
return q = t ? (q | e) >>> 0 : (q & ~e) >>> 0, 0;
|
|
393
393
|
}
|
|
394
394
|
function _e() {
|
|
395
395
|
return z(J, null);
|
|
396
396
|
}
|
|
397
397
|
function ce() {
|
|
398
|
-
return z(
|
|
398
|
+
return z(q, null);
|
|
399
399
|
}
|
|
400
400
|
function fe(e) {
|
|
401
|
-
const t =
|
|
401
|
+
const t = Jo(e) ? et(e) : e;
|
|
402
402
|
return t ? z(t.trace_level | J, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
403
403
|
}
|
|
404
404
|
function ge(e) {
|
|
405
|
-
const t =
|
|
405
|
+
const t = Jo(e) ? et(e) : e;
|
|
406
406
|
return t ? z(t.trace_level, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
407
407
|
}
|
|
408
408
|
function de(e) {
|
|
409
|
-
const t =
|
|
409
|
+
const t = Jo(e) ? et(e) : e;
|
|
410
410
|
return t ? z(t.no_trace_level, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
411
411
|
}
|
|
412
412
|
function be(e, t, n) {
|
|
413
|
-
const r =
|
|
413
|
+
const r = Jo(e) ? et(e) : e;
|
|
414
414
|
if (!r) return ir(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
415
415
|
const o = null === t ? 4294967295 : Q(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
416
416
|
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
417
417
|
}
|
|
418
418
|
function pe(e, t, n) {
|
|
419
|
-
const r =
|
|
419
|
+
const r = Jo(e) ? et(e) : e;
|
|
420
420
|
if (!r) return ir(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
421
421
|
const o = null === t ? 4294967295 : Q(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
422
422
|
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
423
423
|
}
|
|
424
424
|
function me(e, t) {
|
|
425
425
|
let n = {};
|
|
426
|
-
if (!
|
|
426
|
+
if (!Yo(t)) return ir("sdata_desc MUST be an array"), _r(t), n;
|
|
427
427
|
for (let r = 0; r < t.length; r++) {
|
|
428
428
|
const o = t[r];
|
|
429
429
|
o.name && he(e, n, o);
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
r = String(o);
|
|
438
438
|
break;
|
|
439
439
|
case E.DTP_BOOLEAN:
|
|
440
|
-
r =
|
|
440
|
+
r = el(o);
|
|
441
441
|
break;
|
|
442
442
|
case E.DTP_INTEGER:
|
|
443
443
|
r = parseInt(o), isNaN(r) && ir(`${kt(e)}: attr NaN: ${n.name}`);
|
|
@@ -446,26 +446,26 @@
|
|
|
446
446
|
r = Number(o), isNaN(r) && ir(`${kt(e)}: attr NaN: ${n.name}`);
|
|
447
447
|
break;
|
|
448
448
|
case E.DTP_LIST:
|
|
449
|
-
if (
|
|
449
|
+
if (Jo(o)) try {
|
|
450
450
|
r = JSON.parse(o);
|
|
451
451
|
} catch (e) {
|
|
452
452
|
ir(`JSON parse error: ${e.message}`);
|
|
453
453
|
}
|
|
454
454
|
else r = o;
|
|
455
|
-
|
|
455
|
+
Yo(r) || (r = []);
|
|
456
456
|
break;
|
|
457
457
|
case E.DTP_DICT:
|
|
458
|
-
if (
|
|
458
|
+
if (Jo(o)) try {
|
|
459
459
|
r = JSON.parse(o);
|
|
460
460
|
} catch (e) {
|
|
461
461
|
ir(`JSON parse error: ${e.message}`);
|
|
462
462
|
}
|
|
463
463
|
else r = o;
|
|
464
|
-
|
|
464
|
+
Bo(r) || (r = {});
|
|
465
465
|
break;
|
|
466
466
|
case E.DTP_JSON:
|
|
467
467
|
if ("" === o || void 0 === o) r = null;
|
|
468
|
-
else if (
|
|
468
|
+
else if (Jo(o)) try {
|
|
469
469
|
r = JSON.parse(o);
|
|
470
470
|
} catch (e) {
|
|
471
471
|
ir(`JSON parse error: ${e.message}`);
|
|
@@ -554,16 +554,16 @@
|
|
|
554
554
|
}(e)) return t;
|
|
555
555
|
}
|
|
556
556
|
function $e(e, t) {
|
|
557
|
-
return T(e) ?
|
|
557
|
+
return T(e) ? Jo(t) : w(e) ? Bo(t) : S(e) ? Yo(t) : !$(e) || "number" == typeof t || "boolean" == typeof t;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Re(e) {
|
|
560
560
|
return e >= -0x8000000000000000 && e < 0x8000000000000000;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
563
|
-
return
|
|
562
|
+
function Ae(e) {
|
|
563
|
+
return Yo(e) ? "an array" : Bo(e) ? "an object" : Jo(e) ? je : "number" == typeof e ? Number.isInteger(e) && Re(e) ? "an integer" : "a real" : "boolean" == typeof e ? "a boolean" : "null";
|
|
564
564
|
}
|
|
565
565
|
function De(e, t, n) {
|
|
566
|
-
if (
|
|
566
|
+
if (Jo(t) || (t = ""), T(e)) return {
|
|
567
567
|
value: t,
|
|
568
568
|
refused: null
|
|
569
569
|
};
|
|
@@ -610,7 +610,7 @@
|
|
|
610
610
|
refused: null
|
|
611
611
|
};
|
|
612
612
|
const o = Number(r);
|
|
613
|
-
return
|
|
613
|
+
return Re(o) ? {
|
|
614
614
|
value: o,
|
|
615
615
|
refused: null
|
|
616
616
|
} : {
|
|
@@ -658,9 +658,9 @@
|
|
|
658
658
|
value: void 0,
|
|
659
659
|
refused: null
|
|
660
660
|
};
|
|
661
|
-
const n =
|
|
661
|
+
const n = Jo(t) && t.indexOf("\0") >= 0;
|
|
662
662
|
if (N(e)) {
|
|
663
|
-
if (!
|
|
663
|
+
if (!Jo(t) || n) return {
|
|
664
664
|
value: t,
|
|
665
665
|
refused: null
|
|
666
666
|
};
|
|
@@ -673,7 +673,7 @@
|
|
|
673
673
|
return T(e) || w(e) || S(e) || $(e) ? n ? {
|
|
674
674
|
value: void 0,
|
|
675
675
|
refused: "a text with a NUL in it"
|
|
676
|
-
} :
|
|
676
|
+
} : Jo(t) && !T(e) ? De(e, t, !0) : $e(e, t) ? $(e) ? function(e, t) {
|
|
677
677
|
return "number" != typeof t || Number.isFinite(t) ? j(e) ? {
|
|
678
678
|
value: "boolean" == typeof t ? t : 0 !== t,
|
|
679
679
|
refused: null
|
|
@@ -683,7 +683,7 @@
|
|
|
683
683
|
} : "boolean" == typeof t ? {
|
|
684
684
|
value: t ? 1 : 0,
|
|
685
685
|
refused: null
|
|
686
|
-
} :
|
|
686
|
+
} : Re(t) ? Number.isInteger(t) ? {
|
|
687
687
|
value: t,
|
|
688
688
|
refused: null
|
|
689
689
|
} : {
|
|
@@ -704,7 +704,7 @@
|
|
|
704
704
|
refused: Ue
|
|
705
705
|
} : {
|
|
706
706
|
value: void 0,
|
|
707
|
-
refused:
|
|
707
|
+
refused: Ae(t)
|
|
708
708
|
} : {
|
|
709
709
|
value: t,
|
|
710
710
|
refused: null
|
|
@@ -777,7 +777,7 @@
|
|
|
777
777
|
function Fe(e) {
|
|
778
778
|
if (Le(e)) try {
|
|
779
779
|
const t = JSON.stringify(e);
|
|
780
|
-
return
|
|
780
|
+
return Jo(t) ? t : void 0;
|
|
781
781
|
} catch (e) {
|
|
782
782
|
return;
|
|
783
783
|
}
|
|
@@ -792,9 +792,9 @@
|
|
|
792
792
|
[E.DTP_DICT]: "a json object"
|
|
793
793
|
};
|
|
794
794
|
let l;
|
|
795
|
-
if (t.flag &
|
|
795
|
+
if (t.flag & R.SDF_SECRET) l = "********";
|
|
796
796
|
else {
|
|
797
|
-
l =
|
|
797
|
+
l = Jo(n) ? n : Fe(void 0 === n ? null : n), void 0 === l && (l = `<${Ue}>`);
|
|
798
798
|
const e = To(l);
|
|
799
799
|
if (null !== e && (l = e), l.length > 64) {
|
|
800
800
|
let e = 64;
|
|
@@ -809,7 +809,7 @@
|
|
|
809
809
|
switch (n.type) {
|
|
810
810
|
case E.DTP_STRING:
|
|
811
811
|
if (null == r) o = "";
|
|
812
|
-
else if (
|
|
812
|
+
else if (Jo(r)) o = String(r);
|
|
813
813
|
else if (o = Fe(r), void 0 === o) return Me(e, n, r, Ue), -1;
|
|
814
814
|
break;
|
|
815
815
|
case E.DTP_BOOLEAN:
|
|
@@ -825,7 +825,7 @@
|
|
|
825
825
|
}
|
|
826
826
|
break;
|
|
827
827
|
case E.DTP_JSON:
|
|
828
|
-
if (o = r,
|
|
828
|
+
if (o = r, Jo(r)) {
|
|
829
829
|
const e = r.trim();
|
|
830
830
|
if (e.startsWith("{") || e.startsWith("[")) try {
|
|
831
831
|
o = JSON.parse(e);
|
|
@@ -836,7 +836,7 @@
|
|
|
836
836
|
break;
|
|
837
837
|
case E.DTP_POINTER: o = r;
|
|
838
838
|
}
|
|
839
|
-
return void 0 === o && ir(`${kt(e)}: attr undefined: ${n.name}`), t[n.name] = o,
|
|
839
|
+
return void 0 === o && ir(`${kt(e)}: attr undefined: ${n.name}`), t[n.name] = o, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, n.name) && (e.priv[n.name] = o), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
840
840
|
}
|
|
841
841
|
function Ve(e) {
|
|
842
842
|
return e.jn_attrs;
|
|
@@ -854,7 +854,7 @@
|
|
|
854
854
|
return n && ir(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
855
855
|
}
|
|
856
856
|
function Ke(e, t, n, r, o, l, i, s, a, u, _) {
|
|
857
|
-
if (
|
|
857
|
+
if (Zo(e)) return ir("gclass_name EMPTY"), null;
|
|
858
858
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return ir(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
859
859
|
if (et(e)) return ir(`GClass ALREADY exists: ${e}`), null;
|
|
860
860
|
let c = new C(e, r, o, l, i, s, a, u, _);
|
|
@@ -864,17 +864,17 @@
|
|
|
864
864
|
const f = n.length;
|
|
865
865
|
for (let e = 0; e < f; e++) {
|
|
866
866
|
let t = n[e][0], r = n[e][1];
|
|
867
|
-
if (
|
|
868
|
-
if (
|
|
867
|
+
if (Zo(t)) continue;
|
|
868
|
+
if (qe(c, t) < 0) return Be(c), null;
|
|
869
869
|
const o = r.length;
|
|
870
870
|
for (let e = 0; e < o; e++) {
|
|
871
871
|
let n = r[e][0], o = r[e][1], l = r[e][2];
|
|
872
|
-
|
|
872
|
+
Zo(n) || He(c, t, n, o, l);
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
for (let e = 0; e < t.length; e++) {
|
|
876
876
|
let n = t[e][0], r = t[e][1];
|
|
877
|
-
if (!
|
|
877
|
+
if (!Zo(n)) {
|
|
878
878
|
if (Xe(c, n)) return ir(`SMachine: event repeated in input_events: ${n}`), Be(c), null;
|
|
879
879
|
Qe(c, n, r);
|
|
880
880
|
}
|
|
@@ -887,7 +887,7 @@
|
|
|
887
887
|
}
|
|
888
888
|
function Be(e) {
|
|
889
889
|
let t;
|
|
890
|
-
if (
|
|
890
|
+
if (Jo(e)) t = e;
|
|
891
891
|
else {
|
|
892
892
|
if (!(e instanceof C)) return ir("Cannot unregister gclass, type unknown"), -1;
|
|
893
893
|
t = e.gclass_name;
|
|
@@ -911,17 +911,17 @@
|
|
|
911
911
|
}
|
|
912
912
|
return null;
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function qe(e, t) {
|
|
915
915
|
return e instanceof C ? Ye(e, t) ? (ir(`state already exists: ${t}`), -1) : (e.dl_states.push(new V(t)), 0) : (ir("Cannot add state, typeof not GClass"), -1);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function He(e, t, n, r, o) {
|
|
918
918
|
if (!(e instanceof C)) return ir("Cannot add state, typeof not GClass"), -1;
|
|
919
|
-
if (
|
|
919
|
+
if (Zo(t)) return ir("state_name EMPTY"), -1;
|
|
920
920
|
let l = Ye(e, t);
|
|
921
921
|
return l ? Je(l, n) ? (ir(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (l.dl_actions.push(new G(n, r, o)), 0) : (ir(`state not found: ${t}`), -1);
|
|
922
922
|
}
|
|
923
923
|
function ze(e, t, n) {
|
|
924
|
-
|
|
924
|
+
Zo(t) || e.push(new W(t, n));
|
|
925
925
|
}
|
|
926
926
|
function Qe(e, t, n) {
|
|
927
927
|
return e instanceof C ? ze(e.dl_events, t, n) : (ir("Cannot add state, typeof not GClass"), -1);
|
|
@@ -941,18 +941,18 @@
|
|
|
941
941
|
Wo(e.dl_states) || (ir(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
942
942
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
943
943
|
let r = e.dl_states[n];
|
|
944
|
-
if (!
|
|
944
|
+
if (!Zo(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
945
945
|
let o = r.dl_actions[n];
|
|
946
|
-
|
|
946
|
+
Zo(o.event_name) || (Xe(e, o.event_name) || (ir(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${o.event_name}`), t += -1), o.next_state && (Ye(e, o.next_state) || (ir(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
950
950
|
let r = e.dl_events[n];
|
|
951
|
-
if (!
|
|
951
|
+
if (!Zo(r.event_name) && (qo(r.event_flag) || (ir(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & F.EVF_OUTPUT_EVENT))) {
|
|
952
952
|
let n = !1;
|
|
953
953
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
954
954
|
let o = e.dl_states[t];
|
|
955
|
-
|
|
955
|
+
Zo(o.state_name) || Je(o, r.event_name) && (n = !0);
|
|
956
956
|
}
|
|
957
957
|
n || (ir(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
958
958
|
}
|
|
@@ -970,19 +970,19 @@
|
|
|
970
970
|
return !m || m.obflag & U.obflag_destroyed ? null : m;
|
|
971
971
|
}
|
|
972
972
|
function nt(e, t) {
|
|
973
|
-
if (!
|
|
973
|
+
if (!Jo(e)) return ir(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
974
974
|
e = e.toLowerCase();
|
|
975
975
|
return b[e] || (t && ir(`gobj service not found: ${e}`), null);
|
|
976
976
|
}
|
|
977
977
|
function rt(e) {
|
|
978
|
-
let t =
|
|
978
|
+
let t = At(e);
|
|
979
979
|
return t = t.toLowerCase(), b[t] && ir(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
980
980
|
}
|
|
981
981
|
function ot(e, t) {
|
|
982
982
|
t.parent && ir(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
983
983
|
}
|
|
984
984
|
function lt(e, t) {
|
|
985
|
-
let n =
|
|
985
|
+
let n = zl(e.dl_children, t);
|
|
986
986
|
n >= 0 && (Go(e.dl_children, n), t.parent = null);
|
|
987
987
|
}
|
|
988
988
|
function it(e, t) {
|
|
@@ -998,7 +998,7 @@
|
|
|
998
998
|
let l = 0;
|
|
999
999
|
for (const [i, s] of Object.entries(t)) {
|
|
1000
1000
|
const t = xe(o.gclass, i, !1);
|
|
1001
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
1001
|
+
t ? (-1 === n || t.flag & n) && (t.flag & R.SDF_DEPRECATED && sr(`${kt(o)}: Deprecated attribute used in gobj creation: ${i}`), l += Ge(o, e, t, s)) : r && (r(o, i), l--);
|
|
1002
1002
|
}
|
|
1003
1003
|
return l;
|
|
1004
1004
|
})(Ve(e), r, -1, e.gclass.gclass_flag & P.gcflag_ignore_unknown_attrs ? 0 : st, e) < 0 && (ir(`${kt(e)} json2data() FAILED`), $o(r));
|
|
@@ -1010,7 +1010,7 @@
|
|
|
1010
1010
|
} else {
|
|
1011
1011
|
if (!o) return ir("gobj NEEDS a parent!"), null;
|
|
1012
1012
|
if (!("string" == typeof o || o instanceof I)) return ir(`BAD TYPE of parent: ${o}`), null;
|
|
1013
|
-
if (
|
|
1013
|
+
if (Jo(o)) {
|
|
1014
1014
|
const e = o;
|
|
1015
1015
|
if (!(o = nt(e))) return sr(`parent service not found: ${e}`), null;
|
|
1016
1016
|
}
|
|
@@ -1020,11 +1020,11 @@
|
|
|
1020
1020
|
if (m) return ir(`default service ALREADY registered: ${t}^${e}`), null;
|
|
1021
1021
|
l |= L.gobj_flag_service;
|
|
1022
1022
|
}
|
|
1023
|
-
if (
|
|
1023
|
+
if (Zo(t)) return ir("gclass_name must be a string"), null;
|
|
1024
1024
|
let i = et(t, !1);
|
|
1025
1025
|
if (!i) return ir(`GClass not registered: ${t}^${e}`), null;
|
|
1026
|
-
if (!
|
|
1027
|
-
if (!
|
|
1026
|
+
if (!Jo(e)) return ir(`gobj_name must be a string: ${t}`), null;
|
|
1027
|
+
if (!Zo(e)) {
|
|
1028
1028
|
if (e.includes("`")) return ir(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
1029
1029
|
if (e.includes("^")) return ir(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
1030
1030
|
}
|
|
@@ -1066,7 +1066,7 @@
|
|
|
1066
1066
|
t && K(n("💔💔⏩ destroying: %s", Ct(e)));
|
|
1067
1067
|
let r = It(e);
|
|
1068
1068
|
r && r.gclass.gmt.mt_child_removed && (t && K(n("👦👦🔴 child_removed(%s): %s", Ct(r), kt(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & L.gobj_flag_service && function(e) {
|
|
1069
|
-
let t =
|
|
1069
|
+
let t = At(e);
|
|
1070
1070
|
t = t.toLowerCase(), b[t] ? delete b[t] : ir(`"service NOT found in register": ${t}`);
|
|
1071
1071
|
}(e), e === m && (m = null), Cn(e, e.dl_subscriptions, !0), Cn(e, e.dl_subscribings, !0), r && (lt(r, e), Pt(e) && (Ft(r) !== e || Ut(r) || Mt(r, null))), function(e) {
|
|
1072
1072
|
let t = e.dl_children.slice();
|
|
@@ -1080,17 +1080,38 @@
|
|
|
1080
1080
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1081
1081
|
if (e.running) return ir(`${kt(e)}: GObj ALREADY RUNNING`), -1;
|
|
1082
1082
|
if (e.disabled) return ir(`${kt(e)}: GObj DISABLED`), -1;
|
|
1083
|
+
const t = function(e) {
|
|
1084
|
+
const t = Ve(e), n = [];
|
|
1085
|
+
if (!Yo(e.gclass.attrs_table)) return null;
|
|
1086
|
+
for (const r of e.gclass.attrs_table) {
|
|
1087
|
+
if (!(r.name && r.flag & R.SDF_REQUIRED)) continue;
|
|
1088
|
+
const e = t[r.name];
|
|
1089
|
+
switch (r.type) {
|
|
1090
|
+
case E.DTP_STRING:
|
|
1091
|
+
Jo(e) && !Zo(e) || n.push(r.name);
|
|
1092
|
+
break;
|
|
1093
|
+
case E.DTP_LIST:
|
|
1094
|
+
case E.DTP_DICT:
|
|
1095
|
+
case E.DTP_JSON:
|
|
1096
|
+
Ko(e) && n.push(r.name);
|
|
1097
|
+
break;
|
|
1098
|
+
case E.DTP_POINTER: e || n.push(r.name);
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return n.length ? n : null;
|
|
1102
|
+
}(e);
|
|
1103
|
+
if (t) return ir(`${kt(e)}: Cannot start without all required attributes: ` + JSON.stringify(t)), -1;
|
|
1083
1104
|
ne(e) && K(n("⏺ ⏺ start: %s", Ct(e))), e.running = !0;
|
|
1084
|
-
let
|
|
1105
|
+
let r = 0;
|
|
1085
1106
|
if (e.gclass.gmt.mt_start) {
|
|
1086
|
-
const
|
|
1107
|
+
const t = vn(e, "mt_start", y.FRAME_METHOD);
|
|
1087
1108
|
try {
|
|
1088
|
-
|
|
1109
|
+
r = e.gclass.gmt.mt_start(e);
|
|
1089
1110
|
} finally {
|
|
1090
|
-
En(
|
|
1111
|
+
En(t);
|
|
1091
1112
|
}
|
|
1092
1113
|
}
|
|
1093
|
-
return
|
|
1114
|
+
return r;
|
|
1094
1115
|
}
|
|
1095
1116
|
function gt(e) {
|
|
1096
1117
|
const t = vn(e, "gobj_start", y.FRAME_WATCH);
|
|
@@ -1143,7 +1164,8 @@
|
|
|
1143
1164
|
if (e.disabled) return ir(`${kt(e)}: GObj DISABLED`), -1;
|
|
1144
1165
|
if (!Tt(e)) {
|
|
1145
1166
|
if (e.gclass.gclass_flag & P.gcflag_required_start_to_play) return ir(`${kt(e)}: Cannot play, start not done`), -1;
|
|
1146
|
-
sr(`${kt(e)}: GObj playing without previous start`),
|
|
1167
|
+
if (sr(`${kt(e)}: GObj playing without previous start`), gt(e)) return -1;
|
|
1168
|
+
if (!e.running) return -1;
|
|
1147
1169
|
}
|
|
1148
1170
|
ne(e) && K(n("⏯ ⏯ play: %s", Ct(e))), e.playing = !0;
|
|
1149
1171
|
let t = 0;
|
|
@@ -1188,115 +1210,128 @@
|
|
|
1188
1210
|
}
|
|
1189
1211
|
function Nt() {
|
|
1190
1212
|
let e = wt();
|
|
1191
|
-
return e ?
|
|
1213
|
+
return e ? At(e) : "";
|
|
1192
1214
|
}
|
|
1193
1215
|
function $t() {
|
|
1194
1216
|
let e = wt();
|
|
1195
1217
|
return e ? tn(e, "yuno_role") : "";
|
|
1196
1218
|
}
|
|
1197
|
-
function
|
|
1219
|
+
function Rt() {
|
|
1198
1220
|
let e = wt();
|
|
1199
1221
|
return e ? tn(e, "yuno_id") : "";
|
|
1200
1222
|
}
|
|
1201
|
-
function
|
|
1202
|
-
return
|
|
1223
|
+
function At(e) {
|
|
1224
|
+
return Xo(e) ? e.gobj_name : (ir("gobj bad type"), null);
|
|
1203
1225
|
}
|
|
1204
1226
|
function Dt(e) {
|
|
1205
|
-
return
|
|
1227
|
+
return Xo(e) ? e.gclass.gclass_name : (ir("gobj NULL of bad type"), null);
|
|
1206
1228
|
}
|
|
1207
1229
|
function kt(e) {
|
|
1208
|
-
return
|
|
1230
|
+
return Xo(e) ? e.gclass.gclass_name + "^" + At(e) : (ir("gobj bad type"), null);
|
|
1209
1231
|
}
|
|
1210
1232
|
function Ct(e) {
|
|
1211
|
-
if (!
|
|
1233
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1212
1234
|
let t = kt(e), n = It(e);
|
|
1213
1235
|
for (; n;) t = kt(n) + "`" + t, n = It(n);
|
|
1214
1236
|
return t;
|
|
1215
1237
|
}
|
|
1216
1238
|
function It(e) {
|
|
1217
|
-
return
|
|
1239
|
+
return Xo(e) ? e.parent : (ir("gobj NULL of bad type"), null);
|
|
1218
1240
|
}
|
|
1219
1241
|
function Pt(e) {
|
|
1220
|
-
return
|
|
1242
|
+
return Xo(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (ir("gobj NULL of bad type"), null);
|
|
1221
1243
|
}
|
|
1222
1244
|
function Lt(e) {
|
|
1223
|
-
return
|
|
1245
|
+
return Xo(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (ir("gobj NULL of bad type"), null);
|
|
1224
1246
|
}
|
|
1225
1247
|
function Ut(e) {
|
|
1226
|
-
return !
|
|
1248
|
+
return !Xo(e) || !!(e.obflag & (U.obflag_destroyed | U.obflag_destroying));
|
|
1227
1249
|
}
|
|
1228
1250
|
function Ft(e) {
|
|
1229
|
-
return
|
|
1251
|
+
return Xo(e) ? e.bottom_gobj : (ir("gobj NULL of bad type"), null);
|
|
1230
1252
|
}
|
|
1231
1253
|
function Mt(e, t) {
|
|
1232
|
-
if (!
|
|
1254
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1233
1255
|
e.bottom_gobj && t && sr(`${kt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
1234
1256
|
}
|
|
1235
1257
|
function Gt(e, t, n) {
|
|
1236
|
-
return
|
|
1258
|
+
return Xo(e) ? t ? xe(e.gclass, t, n) : e.gclass.attrs_table : (ir("gobj NULL of bad type"), null);
|
|
1237
1259
|
}
|
|
1238
1260
|
function Vt(e, t, n, r, o) {
|
|
1239
|
-
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) :
|
|
1261
|
+
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : function(e, t, n, r, o, l) {
|
|
1262
|
+
let i, s = [...e.dl_children];
|
|
1263
|
+
if (n & M.WALK_LAST2FIRST) for (let n = s.length; n > 0; n--) {
|
|
1264
|
+
if (i = s[n - 1], Kt(i, e, t)) continue;
|
|
1265
|
+
t.add(i);
|
|
1266
|
+
let a = xt(r(i, o, l));
|
|
1267
|
+
if (a < 0) return a;
|
|
1268
|
+
}
|
|
1269
|
+
else for (let n = 0; n < s.length; n++) {
|
|
1270
|
+
if (i = s[n], Kt(i, e, t)) continue;
|
|
1271
|
+
t.add(i);
|
|
1272
|
+
let a = xt(r(i, o, l));
|
|
1273
|
+
if (a < 0) return a;
|
|
1274
|
+
}
|
|
1275
|
+
return 0;
|
|
1276
|
+
}(e, /* @__PURE__ */ new Set(), t, n, r, o);
|
|
1240
1277
|
}
|
|
1241
1278
|
function Wt(e, t, n, r, o) {
|
|
1242
|
-
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : Yt(e
|
|
1279
|
+
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : Yt(e, /* @__PURE__ */ new Set(), t, n, r, o);
|
|
1243
1280
|
}
|
|
1244
1281
|
function xt(e) {
|
|
1245
1282
|
return "number" == typeof e && isFinite(e) ? e : (null == e || ir(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
1246
1283
|
}
|
|
1247
|
-
function Kt(e, t, n
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1284
|
+
function Kt(e, t, n) {
|
|
1285
|
+
return Ut(e) || e.parent !== t || n.has(e);
|
|
1286
|
+
}
|
|
1287
|
+
function Bt(e, t, n, r, o, l) {
|
|
1288
|
+
let i = [...e.dl_children];
|
|
1289
|
+
n & M.WALK_LAST2FIRST && i.reverse();
|
|
1290
|
+
let s = [];
|
|
1291
|
+
for (const n of i) {
|
|
1292
|
+
if (Kt(n, e, t)) continue;
|
|
1293
|
+
t.add(n), s.push(n);
|
|
1294
|
+
let i = xt(r(n, o, l));
|
|
1295
|
+
if (i < 0) return i;
|
|
1253
1296
|
}
|
|
1254
|
-
|
|
1255
|
-
if (
|
|
1256
|
-
let
|
|
1257
|
-
if (
|
|
1297
|
+
for (const e of s) {
|
|
1298
|
+
if (Ut(e)) continue;
|
|
1299
|
+
let i = Bt(e, t, n, r, o, l);
|
|
1300
|
+
if (i < 0) return i;
|
|
1258
1301
|
}
|
|
1259
1302
|
return 0;
|
|
1260
1303
|
}
|
|
1261
|
-
function
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
if (
|
|
1265
|
-
for (let
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
}
|
|
1269
|
-
function Yt(e, t, n, r, o) {
|
|
1270
|
-
if (t & M.WALK_BYLEVEL) return Bt(e, t, n, r, o);
|
|
1271
|
-
let l, i, s = [...e];
|
|
1272
|
-
if (t & M.WALK_BOTTOM2TOP) {
|
|
1273
|
-
for (let e = s.length; e > 0; e--) if (i = s[e - 1], !Ut(i)) {
|
|
1274
|
-
if (l = Yt(i.dl_children, t, n, r, o), l < 0) return l;
|
|
1275
|
-
if (!Ut(i) && (l = xt(n(i, r, o)), l < 0)) return l;
|
|
1304
|
+
function Yt(e, t, n, r, o, l) {
|
|
1305
|
+
if (n & M.WALK_BYLEVEL) return Bt(e, t, n, r, o, l);
|
|
1306
|
+
let i, s, a = [...e.dl_children];
|
|
1307
|
+
if (n & M.WALK_BOTTOM2TOP) {
|
|
1308
|
+
for (let u = a.length; u > 0; u--) if (s = a[u - 1], !Kt(s, e, t)) {
|
|
1309
|
+
if (i = Yt(s, t, n, r, o, l), i < 0) return i;
|
|
1310
|
+
if (!Ut(s) && (t.add(s), i = xt(r(s, o, l)), i < 0)) return i;
|
|
1276
1311
|
}
|
|
1277
|
-
} else for (let
|
|
1278
|
-
if (
|
|
1279
|
-
if (0 ===
|
|
1312
|
+
} else for (let u = 0; u < a.length; u++) if (s = a[u], !Kt(s, e, t)) {
|
|
1313
|
+
if (t.add(s), i = xt(r(s, o, l)), i < 0) return i;
|
|
1314
|
+
if (0 === i && !Ut(s) && (i = Yt(s, t, n, r, o, l), i < 0)) return i;
|
|
1280
1315
|
}
|
|
1281
1316
|
return 0;
|
|
1282
1317
|
}
|
|
1283
1318
|
function Jt(e, t) {
|
|
1284
|
-
if (!
|
|
1319
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), !1;
|
|
1285
1320
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
1286
1321
|
t.__disabled__;
|
|
1287
1322
|
let l = t.__state__;
|
|
1288
1323
|
if (n && n !== Dt(e)) return !1;
|
|
1289
|
-
if (r && r !==
|
|
1324
|
+
if (r && r !== At(e)) return !1;
|
|
1290
1325
|
if (o) {
|
|
1291
1326
|
let t = o.length;
|
|
1292
|
-
if (o !==
|
|
1327
|
+
if (o !== At(e).substring(0, t)) return !1;
|
|
1293
1328
|
}
|
|
1294
1329
|
if (l && l !== fn(e)) return !1;
|
|
1295
1330
|
let i = e.jn_attrs;
|
|
1296
1331
|
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && zt(e, n) && i[n] !== t[n]) return !1;
|
|
1297
1332
|
return !0;
|
|
1298
1333
|
}
|
|
1299
|
-
function
|
|
1334
|
+
function qt(e, t) {
|
|
1300
1335
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), null;
|
|
1301
1336
|
const n = e.dl_children;
|
|
1302
1337
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -1305,7 +1340,7 @@
|
|
|
1305
1340
|
}
|
|
1306
1341
|
return null;
|
|
1307
1342
|
}
|
|
1308
|
-
function
|
|
1343
|
+
function Ht(e, t) {
|
|
1309
1344
|
if (!t) return null;
|
|
1310
1345
|
let n = t.split("`");
|
|
1311
1346
|
if (!function(e, t) {
|
|
@@ -1316,16 +1351,16 @@
|
|
|
1316
1351
|
if (1 !== n.length) return !1;
|
|
1317
1352
|
r = n[0];
|
|
1318
1353
|
}
|
|
1319
|
-
return r ===
|
|
1354
|
+
return r === At(e);
|
|
1320
1355
|
}(e, n[0])) return null;
|
|
1321
1356
|
if (1 === n.length) return e;
|
|
1322
1357
|
let r = n[1].split("^"), o = {};
|
|
1323
1358
|
1 === r.length ? o.__gobj_name__ = r : (o.__gclass_name__ = r[0], o.__gobj_name__ = r[1]);
|
|
1324
|
-
let l =
|
|
1325
|
-
return l ? (n.splice(0, 1), n = n.join("`"),
|
|
1359
|
+
let l = qt(e, o);
|
|
1360
|
+
return l ? (n.splice(0, 1), n = n.join("`"), Ht(l, n)) : null;
|
|
1326
1361
|
}
|
|
1327
1362
|
function zt(e, t) {
|
|
1328
|
-
return !
|
|
1363
|
+
return !Zo(t) && !!xe(e.gclass, t, !1);
|
|
1329
1364
|
}
|
|
1330
1365
|
function Qt(e, t, n) {
|
|
1331
1366
|
let r = e.jn_attrs;
|
|
@@ -1348,21 +1383,21 @@
|
|
|
1348
1383
|
}
|
|
1349
1384
|
function Zt(e, t) {
|
|
1350
1385
|
if (t) {
|
|
1351
|
-
if (0 ===
|
|
1352
|
-
if (0 ===
|
|
1353
|
-
if (0 ===
|
|
1354
|
-
if (0 ===
|
|
1386
|
+
if (0 === nl(t, "__disabled__")) return jt(e);
|
|
1387
|
+
if (0 === nl(t, "__running__")) return Tt(e);
|
|
1388
|
+
if (0 === nl(t, "__playing__")) return St(e);
|
|
1389
|
+
if (0 === nl(t, "__service__")) return Ot(e);
|
|
1355
1390
|
}
|
|
1356
1391
|
let n = We(e, t, !1);
|
|
1357
1392
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1358
1393
|
}
|
|
1359
1394
|
function en(e, t) {
|
|
1360
|
-
t &&
|
|
1395
|
+
t && nl(t, "__trace_level__");
|
|
1361
1396
|
let n = We(e, t, !1);
|
|
1362
1397
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1363
1398
|
}
|
|
1364
1399
|
function tn(e, t) {
|
|
1365
|
-
if (t && 0 ===
|
|
1400
|
+
if (t && 0 === nl(t, "__state__")) return fn(e);
|
|
1366
1401
|
let n = We(e, t, !1);
|
|
1367
1402
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1368
1403
|
}
|
|
@@ -1371,7 +1406,7 @@
|
|
|
1371
1406
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1372
1407
|
}
|
|
1373
1408
|
function rn(e, t, r, o) {
|
|
1374
|
-
if (!
|
|
1409
|
+
if (!Jo(t)) return ir(n("gobj_write_attr(%s): path must be a string", kt(e))), -1;
|
|
1375
1410
|
let l, i = e.jn_attrs, s = t.split("`");
|
|
1376
1411
|
if (s.length <= 1) {
|
|
1377
1412
|
let o = t;
|
|
@@ -1380,7 +1415,7 @@
|
|
|
1380
1415
|
let a = s.length;
|
|
1381
1416
|
for (let t = 0; t < a; t++) {
|
|
1382
1417
|
l = s[t];
|
|
1383
|
-
let n =
|
|
1418
|
+
let n = qt(e, { __gobj_name__: l });
|
|
1384
1419
|
if (n && t < a - 1) {
|
|
1385
1420
|
e = n;
|
|
1386
1421
|
continue;
|
|
@@ -1399,7 +1434,7 @@
|
|
|
1399
1434
|
let o;
|
|
1400
1435
|
if (T(n)) {
|
|
1401
1436
|
if (null == r) return { value: "" };
|
|
1402
|
-
if (
|
|
1437
|
+
if (Jo(r)) return { value: r };
|
|
1403
1438
|
o = {
|
|
1404
1439
|
value: Fe(r),
|
|
1405
1440
|
refused: Ue
|
|
@@ -1429,7 +1464,7 @@
|
|
|
1429
1464
|
let r = We(e, t, !1);
|
|
1430
1465
|
if (r) {
|
|
1431
1466
|
const o = ln(e, t, E.DTP_BOOLEAN, n);
|
|
1432
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1467
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1433
1468
|
}
|
|
1434
1469
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1435
1470
|
}
|
|
@@ -1437,7 +1472,7 @@
|
|
|
1437
1472
|
let r = We(e, t, !1);
|
|
1438
1473
|
if (r) {
|
|
1439
1474
|
const o = ln(e, t, E.DTP_INTEGER, n);
|
|
1440
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1475
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1441
1476
|
}
|
|
1442
1477
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1443
1478
|
}
|
|
@@ -1445,7 +1480,7 @@
|
|
|
1445
1480
|
let r = We(e, t, !1);
|
|
1446
1481
|
if (r) {
|
|
1447
1482
|
const o = ln(e, t, E.DTP_STRING, n);
|
|
1448
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1483
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1449
1484
|
}
|
|
1450
1485
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1451
1486
|
}
|
|
@@ -1458,13 +1493,13 @@
|
|
|
1458
1493
|
let o = oe(e, "EV_STATE_CHANGED"), l = !!function(e) {
|
|
1459
1494
|
return X(e) & B.TRACE_STATES;
|
|
1460
1495
|
}(e);
|
|
1461
|
-
return (o || l) && (1 === x || K(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Dt(e),
|
|
1496
|
+
return (o || l) && (1 === x || K(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Dt(e), At(e), fn(e), e.last_state.state_name))), !0;
|
|
1462
1497
|
}
|
|
1463
1498
|
function fn(e) {
|
|
1464
|
-
return
|
|
1499
|
+
return Xo(e) ? e.current_state.state_name : (ir("hgobj NULL"), "");
|
|
1465
1500
|
}
|
|
1466
1501
|
function gn(e, t, n) {
|
|
1467
|
-
if (!
|
|
1502
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1468
1503
|
let r = Xe(e.gclass, t);
|
|
1469
1504
|
if (r) return r;
|
|
1470
1505
|
if (n) {
|
|
@@ -1486,7 +1521,7 @@
|
|
|
1486
1521
|
}
|
|
1487
1522
|
var pn = [], mn = !1;
|
|
1488
1523
|
function hn(e, t, r, o) {
|
|
1489
|
-
return e && e instanceof I ? e.obflag & (U.obflag_destroyed | U.obflag_destroying) ? (ir(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) :
|
|
1524
|
+
return e && e instanceof I ? e.obflag & (U.obflag_destroyed | U.obflag_destroying) ? (ir(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Zo(t) ? (ir("gobj_post_event(): event EMPTY"), -1) : dn(e, t, 0) ? pn.length >= 1e4 ? (ir(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${pn.length}`), -1) : (pn.push({
|
|
1490
1525
|
dst: e,
|
|
1491
1526
|
event: t,
|
|
1492
1527
|
kw: r,
|
|
@@ -1546,13 +1581,13 @@
|
|
|
1546
1581
|
En(s);
|
|
1547
1582
|
}
|
|
1548
1583
|
}
|
|
1549
|
-
return i && K(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Dt(e),
|
|
1584
|
+
return i && K(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Dt(e), At(e), l.state_name, t || "", o && !o.running ? "!!" : "", Dt(o), At(o))), ir(`📛📛 Event NOT DEFINED in state 📛📛: ${kt(e)}, ${l.state_name}, ${t}`), h--, -1;
|
|
1550
1585
|
}
|
|
1551
1586
|
if (i) {
|
|
1552
1587
|
if (1 === x) K(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", kt(e), l.state_name, o && !o.running ? "!!" : "", kt(o)));
|
|
1553
1588
|
else {
|
|
1554
1589
|
let r = "";
|
|
1555
|
-
s.action && (r =
|
|
1590
|
+
s.action && (r = ti(s.action)), K(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Dt(e), At(e), l.state_name, "", t || "", "", r, o && !o.running ? "!!" : "", Dt(o), At(o)));
|
|
1556
1591
|
}
|
|
1557
1592
|
r && re(e) && Vo(r) && $o(r);
|
|
1558
1593
|
}
|
|
@@ -1571,7 +1606,7 @@
|
|
|
1571
1606
|
} finally {
|
|
1572
1607
|
En(a);
|
|
1573
1608
|
}
|
|
1574
|
-
return i && 1 !== x && !a.destroyed && K(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Dt(e),
|
|
1609
|
+
return i && 1 !== x && !a.destroyed && K(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Dt(e), At(e), e.current_state.state_name, t || "", qo(u) ? u : 0)), h--, u;
|
|
1575
1610
|
}
|
|
1576
1611
|
var On = Object.freeze({
|
|
1577
1612
|
__rename_event_name__: 1,
|
|
@@ -1604,39 +1639,39 @@
|
|
|
1604
1639
|
];
|
|
1605
1640
|
function Nn(e, t) {
|
|
1606
1641
|
let n = e ? e.__config__ : null;
|
|
1607
|
-
if (!
|
|
1642
|
+
if (!Bo(n) || !ll(n, "__hard_subscription__") && !ll(n, "__own_event__") && !ll(n, "__rename_event_name__")) return {
|
|
1608
1643
|
kw: e,
|
|
1609
1644
|
renamed_event: ""
|
|
1610
1645
|
};
|
|
1611
1646
|
let r = Do({}, e), o = Do({}, n);
|
|
1612
1647
|
r.__config__ = o;
|
|
1613
|
-
let l = "", i = o.__rename_event_name__, s = "string" != typeof i ||
|
|
1648
|
+
let l = "", i = o.__rename_event_name__, s = "string" != typeof i || Zo(i) ? null : Sn(i, 0, !1);
|
|
1614
1649
|
return s && (l = s.event_name, delete o.__rename_event_name__, t && xo(r.__global__) > 0 && (r.__global__ = Do(Do({}, r.__global__), { __original_event_name__: t }))), delete o.__hard_subscription__, delete o.__own_event__, {
|
|
1615
1650
|
kw: r,
|
|
1616
1651
|
renamed_event: l
|
|
1617
1652
|
};
|
|
1618
1653
|
}
|
|
1619
1654
|
function $n(e, t, n, r, o, l) {
|
|
1620
|
-
let i =
|
|
1621
|
-
if (t && t !==
|
|
1622
|
-
let t =
|
|
1623
|
-
xo(t) > 0 &&
|
|
1655
|
+
let i = bl(t, o, "__config__", null), s = bl(t, o, "__global__", null), a = bl(t, o, "__local__", null), u = pl(t, o, "__filter__", null), _ = !0;
|
|
1656
|
+
if (t && t !== dl(null, e, "publisher", null) && (_ = !1), l && l !== dl(null, e, "subscriber", null) && (_ = !1), n && n !== gl(null, e, "event", "") && (_ = !1), r && r !== gl(null, e, "renamed_event", "") && (_ = !1), xo(i) > 0) {
|
|
1657
|
+
let t = bl(null, e, "__config__", null);
|
|
1658
|
+
xo(t) > 0 && Ao(t, i) || (_ = !1);
|
|
1624
1659
|
}
|
|
1625
1660
|
if (xo(s) > 0) {
|
|
1626
|
-
let t =
|
|
1627
|
-
xo(t) > 0 &&
|
|
1661
|
+
let t = bl(null, e, "__global__", null);
|
|
1662
|
+
xo(t) > 0 && Ao(t, s) || (_ = !1);
|
|
1628
1663
|
}
|
|
1629
1664
|
if (xo(a) > 0) {
|
|
1630
|
-
let t =
|
|
1631
|
-
xo(t) > 0 &&
|
|
1665
|
+
let t = bl(null, e, "__local__", null);
|
|
1666
|
+
xo(t) > 0 && Ao(t, a) || (_ = !1);
|
|
1632
1667
|
}
|
|
1633
1668
|
if (xo(u) > 0) {
|
|
1634
|
-
let t =
|
|
1635
|
-
xo(t) > 0 &&
|
|
1669
|
+
let t = pl(null, e, "__filter__", null);
|
|
1670
|
+
xo(t) > 0 && Ao(t, u) || (_ = !1);
|
|
1636
1671
|
}
|
|
1637
1672
|
return _;
|
|
1638
1673
|
}
|
|
1639
|
-
function
|
|
1674
|
+
function Rn(e, t, n, r, o, l) {
|
|
1640
1675
|
let i = [];
|
|
1641
1676
|
for (let s = 0; s < e.length; s++) {
|
|
1642
1677
|
let a = e[s];
|
|
@@ -1644,17 +1679,17 @@
|
|
|
1644
1679
|
}
|
|
1645
1680
|
return i;
|
|
1646
1681
|
}
|
|
1647
|
-
function
|
|
1682
|
+
function An(e, t) {
|
|
1648
1683
|
return e.indexOf(t);
|
|
1649
1684
|
}
|
|
1650
1685
|
function Dn(e, t, r, o) {
|
|
1651
|
-
let l =
|
|
1652
|
-
if (!!(
|
|
1686
|
+
let l = dl(e, t, "publisher", null, Un.KW_REQUIRED), i = dl(e, t, "subscriber", null, Un.KW_REQUIRED), s = gl(e, t, "event", "", Un.KW_REQUIRED);
|
|
1687
|
+
if (!!(fl(e, t, "subs_flag", null, Un.KW_REQUIRED) & On.__hard_subscription__) && !r) return -1;
|
|
1653
1688
|
let a = te(i) || te(l);
|
|
1654
|
-
if (
|
|
1689
|
+
if (An(l.dl_subscriptions, t) < 0) return a && K(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", s || "", kt(l), kt(i))), 1;
|
|
1655
1690
|
a && (K(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", kt(l), kt(i))), _r(t)), l.obflag & U.obflag_destroyed || o || l.gclass.gmt.mt_subscription_deleted && l.gclass.gmt.mt_subscription_deleted(l, t);
|
|
1656
|
-
let u =
|
|
1657
|
-
return u >= 0 ? Go(l.dl_subscriptions, u) : (ir(`${kt(e)}: subscription in publisher not found`), _r(t)), u =
|
|
1691
|
+
let u = An(l.dl_subscriptions, t);
|
|
1692
|
+
return u >= 0 ? Go(l.dl_subscriptions, u) : (ir(`${kt(e)}: subscription in publisher not found`), _r(t)), u = An(i.dl_subscribings, t), u >= 0 ? Go(i.dl_subscribings, u) : (ir(`${kt(e)}: subscription in subscriber not found`), _r(t)), 0;
|
|
1658
1693
|
}
|
|
1659
1694
|
function kn(e, t, r, o) {
|
|
1660
1695
|
if (null == r && (r = {}), !e) return ir(`publisher NULL: ev ${t}`), 0;
|
|
@@ -1668,10 +1703,10 @@
|
|
|
1668
1703
|
]);
|
|
1669
1704
|
if (Object.keys(r).forEach((n) => {
|
|
1670
1705
|
l.has(n) || ir(`${kt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1671
|
-
}),
|
|
1706
|
+
}), Zo(t)) t = "";
|
|
1672
1707
|
else if (!(bn(e, t, F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ${t}`), 0;
|
|
1673
|
-
let i = Nn(r, t), s =
|
|
1674
|
-
for (let t = 0; t < s.length; t++) if (
|
|
1708
|
+
let i = Nn(r, t), s = Rn(e.dl_subscriptions, e, t, i.renamed_event, i.kw, o), a = null;
|
|
1709
|
+
for (let t = 0; t < s.length; t++) if (fl(e, s[t], "subs_flag", 0, Un.KW_REQUIRED) & On.__hard_subscription__) {
|
|
1675
1710
|
a = s[t];
|
|
1676
1711
|
break;
|
|
1677
1712
|
}
|
|
@@ -1682,29 +1717,29 @@
|
|
|
1682
1717
|
Uo(o, "event", t), Uo(o, "subscriber", r), Uo(o, "publisher", e);
|
|
1683
1718
|
let l = 0;
|
|
1684
1719
|
if (n) {
|
|
1685
|
-
let r =
|
|
1686
|
-
if (xo(i) > 0 && Uo(o, "__global__",
|
|
1687
|
-
let n =
|
|
1720
|
+
let r = bl(e, n, "__config__", null), i = bl(e, n, "__global__", null), s = bl(e, n, "__local__", null), a = pl(e, n, "__filter__", null), u = gl(e, n, "__service__", "");
|
|
1721
|
+
if (xo(i) > 0 && Uo(o, "__global__", Ro(i)), xo(r) > 0) {
|
|
1722
|
+
let n = Ro(r);
|
|
1688
1723
|
Uo(o, "__config__", n);
|
|
1689
|
-
let i =
|
|
1690
|
-
if (!
|
|
1724
|
+
let i = gl(e, n, "__rename_event_name__", "");
|
|
1725
|
+
if (!Zo(i)) {
|
|
1691
1726
|
let r = Sn(i, 0, !1);
|
|
1692
1727
|
if (r) {
|
|
1693
1728
|
Uo(o, "renamed_event", r.event_name), delete n.__rename_event_name__, l |= On.__rename_event_name__;
|
|
1694
|
-
let i =
|
|
1695
|
-
|
|
1729
|
+
let i = bl(e, o, "__global__", null);
|
|
1730
|
+
Bo(i) || (i = {}, Uo(o, "__global__", i)), i.__original_event_name__ = t;
|
|
1696
1731
|
} else ir(`${kt(e)}: EVENT NOT FOUND (__rename_event_name__: ${i})`);
|
|
1697
1732
|
}
|
|
1698
|
-
if (
|
|
1699
|
-
let t =
|
|
1733
|
+
if (ll(n, "__hard_subscription__")) {
|
|
1734
|
+
let t = cl(e, n, "__hard_subscription__", !1);
|
|
1700
1735
|
Po(n, "__hard_subscription__"), t && (l |= On.__hard_subscription__);
|
|
1701
1736
|
}
|
|
1702
|
-
if (
|
|
1703
|
-
let t =
|
|
1737
|
+
if (ll(n, "__own_event__")) {
|
|
1738
|
+
let t = cl(e, n, "__own_event__", !1);
|
|
1704
1739
|
Po(n, "__own_event__"), t && (l |= On.__own_event__);
|
|
1705
1740
|
}
|
|
1706
1741
|
}
|
|
1707
|
-
xo(s) > 0 && Uo(o, "__local__",
|
|
1742
|
+
xo(s) > 0 && Uo(o, "__local__", Ro(s)), xo(a) > 0 && Uo(o, "__filter__", Ro(a)), Zo(u) || Uo(o, "__service__", u);
|
|
1708
1743
|
}
|
|
1709
1744
|
return Uo(o, "subs_flag", l), o;
|
|
1710
1745
|
}(e, t, r, o);
|
|
@@ -1721,18 +1756,18 @@
|
|
|
1721
1756
|
return o && sr(`${kt(e)}: Subscription(s) already removed, nothing to remove (count: ${o})`), 0;
|
|
1722
1757
|
}
|
|
1723
1758
|
function In(e, t, n, r) {
|
|
1724
|
-
return null == n && (n = {}),
|
|
1759
|
+
return null == n && (n = {}), Rn(e.dl_subscriptions, e, t, null, n, r);
|
|
1725
1760
|
}
|
|
1726
1761
|
function Pn(e, t, n, r) {
|
|
1727
|
-
return
|
|
1762
|
+
return Rn(e.dl_subscribings, r, t, null, n, e);
|
|
1728
1763
|
}
|
|
1729
1764
|
function Ln(e, t, r) {
|
|
1730
|
-
if (
|
|
1731
|
-
if (
|
|
1765
|
+
if (Bo(r) || (r = {}), !e || e.obflag & (U.obflag_destroyed | U.obflag_destroying)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1766
|
+
if (Zo(t)) return ir(`${kt(e)}: event EMPTY`), -1;
|
|
1732
1767
|
let o = gn(e, t, !0);
|
|
1733
1768
|
if (!(o && o.event_flag & (F.EVF_SYSTEM_EVENT | F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ev ${t}`), -1;
|
|
1734
1769
|
let l = (te(e) || oe(e, t)) && !le(e, t);
|
|
1735
|
-
if (l && (K(1 === x ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", kt(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Dt(e),
|
|
1770
|
+
if (l && (K(1 === x ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", kt(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Dt(e), At(e), e.current_state.state_name, "", t || "", "")), re(e) && Vo(r) && $o(r)), e.gclass.gmt.mt_publish_event) {
|
|
1736
1771
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1737
1772
|
if (n <= 0) return n;
|
|
1738
1773
|
}
|
|
@@ -1746,20 +1781,20 @@
|
|
|
1746
1781
|
if (n < 0) break;
|
|
1747
1782
|
if (!n) continue;
|
|
1748
1783
|
}
|
|
1749
|
-
let c =
|
|
1784
|
+
let c = dl(e, _, "subscriber", null, Un.KW_REQUIRED);
|
|
1750
1785
|
if (!c || Ut(c)) continue;
|
|
1751
|
-
let f =
|
|
1752
|
-
if (
|
|
1753
|
-
|
|
1754
|
-
let o =
|
|
1755
|
-
|
|
1786
|
+
let f = fl(e, _, "subs_flag", 0, Un.KW_REQUIRED), g = gl(e, _, "event", "", Un.KW_REQUIRED);
|
|
1787
|
+
if (Zo(g) || 0 === nl(g, t)) {
|
|
1788
|
+
bl(e, _, "__config__", null, 0);
|
|
1789
|
+
let o = bl(e, _, "__global__", null, 0), i = bl(e, _, "__local__", null, 0), g = pl(e, _, "__filter__", null, 0), d = _.renamed_event;
|
|
1790
|
+
Zo(d) && (d = t);
|
|
1756
1791
|
let b = 1;
|
|
1757
|
-
if (e.gclass.gmt.mt_publication_filter ? b = e.gclass.gmt.mt_publication_filter(e, t, r, c) : xo(g) > 0 && (b =
|
|
1792
|
+
if (e.gclass.gmt.mt_publication_filter ? b = e.gclass.gmt.mt_publication_filter(e, t, r, c) : xo(g) > 0 && (b = vl(r, g) ? 1 : 0, l && (K(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", b ? "👍" : "👎", t || "", kt(c), kt(e))), _r(g))), b < 0) break;
|
|
1758
1793
|
if (!b) continue;
|
|
1759
1794
|
let p = gn(c, t, !0);
|
|
1760
1795
|
if (p && p.event_flag & F.EVF_SYSTEM_EVENT && !dn(c, p.event_name, 0)) continue;
|
|
1761
1796
|
let m = r;
|
|
1762
|
-
(xo(i) > 0 || xo(o) > 0) && (m = Do({}, r)), xo(i) > 0 &&
|
|
1797
|
+
(xo(i) > 0 || xo(o) > 0) && (m = Do({}, r)), xo(i) > 0 && ol(m, i), xo(o) > 0 && Do(m, Ro(o)), l && (K(1 === x ? n("🔝🔄 %s (%s) %s%s", t || "", d || "", c.running ? "" : "!!", kt(c)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", c.running ? "" : "!!", kt(c), fn(c), t || "", d || "", e && !e.running ? "!!" : "", kt(e))), re(e) && Vo(m) && $o(m));
|
|
1763
1798
|
let h = jn(c, d, m, e);
|
|
1764
1799
|
if (h < 0 && f & On.__own_event__) {
|
|
1765
1800
|
s = -1;
|
|
@@ -1796,7 +1831,7 @@
|
|
|
1796
1831
|
var Fn = "undefined" != typeof window ? window.console : console, Mn = Fn.error, Gn = Fn.warn, Vn = Fn.info, Wn = Fn.debug, xn = null, Kn = 600, Bn = [];
|
|
1797
1832
|
var Yn = !0;
|
|
1798
1833
|
var Jn = null;
|
|
1799
|
-
function
|
|
1834
|
+
function qn(e, t) {
|
|
1800
1835
|
if (!Yn) return !1;
|
|
1801
1836
|
if (!Jn) return !0;
|
|
1802
1837
|
try {
|
|
@@ -1805,9 +1840,9 @@
|
|
|
1805
1840
|
return !0;
|
|
1806
1841
|
}
|
|
1807
1842
|
}
|
|
1808
|
-
var
|
|
1843
|
+
var Hn = !1;
|
|
1809
1844
|
function zn(e, t, n) {
|
|
1810
|
-
|
|
1845
|
+
Hn || (function(e, t, n) {
|
|
1811
1846
|
let r = t;
|
|
1812
1847
|
"json" === e && (r = Zn(t)), Bn.push([
|
|
1813
1848
|
e,
|
|
@@ -1817,12 +1852,12 @@
|
|
|
1817
1852
|
}(e, t, n), Qn(e, t, n));
|
|
1818
1853
|
}
|
|
1819
1854
|
function Qn(e, t, n) {
|
|
1820
|
-
if (xn && !
|
|
1821
|
-
|
|
1855
|
+
if (xn && !Hn) {
|
|
1856
|
+
Hn = !0;
|
|
1822
1857
|
try {
|
|
1823
1858
|
xn(e, t, n);
|
|
1824
1859
|
} catch (e) {} finally {
|
|
1825
|
-
|
|
1860
|
+
Hn = !1;
|
|
1826
1861
|
}
|
|
1827
1862
|
}
|
|
1828
1863
|
}
|
|
@@ -1901,22 +1936,22 @@
|
|
|
1901
1936
|
}
|
|
1902
1937
|
function ir(e, ...t) {
|
|
1903
1938
|
let n = nr(e, ...t), r = Hl();
|
|
1904
|
-
Mn && (Mn === Fn.error ?
|
|
1939
|
+
Mn && (Mn === Fn.error ? qn("error", n) && rr(Mn, "%c" + r + " ERROR: " + String(n), "color:red") : (qn("error", n) && Fn.error("%c" + r + " ERROR: " + String(n), "color:red"), lr(Mn, `${r} ERROR: ${String(n)}`))), zn("error", n, r);
|
|
1905
1940
|
}
|
|
1906
1941
|
function sr(e, ...t) {
|
|
1907
1942
|
let n = nr(e, ...t), r = Hl();
|
|
1908
|
-
Gn && (Gn === Fn.warn ?
|
|
1943
|
+
Gn && (Gn === Fn.warn ? qn("warning", n) && rr(Gn, "%c" + r + " WARNING: " + String(n), "color:yellow") : (qn("warning", n) && Fn.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), lr(Gn, `${r} WARNING: ${String(n)}`))), zn("warning", n, r);
|
|
1909
1944
|
}
|
|
1910
1945
|
function ar(e, ...t) {
|
|
1911
1946
|
let n = nr(e, ...t), r = Hl();
|
|
1912
|
-
Wn &&
|
|
1947
|
+
Wn && qn("debug", n) && rr(Wn, "%c" + r + " DEBUG: " + String(n), "color:silver"), zn("debug", n, r);
|
|
1913
1948
|
}
|
|
1914
1949
|
function ur(e, ...t) {
|
|
1915
1950
|
let n = nr(e, ...t), r = Hl();
|
|
1916
|
-
Wn &&
|
|
1951
|
+
Wn && qn("msg", n) && rr(Wn, "%c" + r + " MSG: " + String(n), "color:cyan"), zn("msg", n, r);
|
|
1917
1952
|
}
|
|
1918
1953
|
function _r(e, t) {
|
|
1919
|
-
|
|
1954
|
+
qn("json", t) && (t && rr(Fn.warn, "=====> " + er(t)), rr(Fn.dir, e)), zn("json", e, Hl());
|
|
1920
1955
|
}
|
|
1921
1956
|
function cr(e) {
|
|
1922
1957
|
const t = new Array(128).fill(null);
|
|
@@ -2098,10 +2133,10 @@
|
|
|
2098
2133
|
function $r(e) {
|
|
2099
2134
|
return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2100
2135
|
}
|
|
2101
|
-
function
|
|
2136
|
+
function Rr(e) {
|
|
2102
2137
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2103
2138
|
}
|
|
2104
|
-
function
|
|
2139
|
+
function Ar(e) {
|
|
2105
2140
|
return e >= 65 && e <= 90;
|
|
2106
2141
|
}
|
|
2107
2142
|
function Dr(e) {
|
|
@@ -2162,9 +2197,9 @@
|
|
|
2162
2197
|
const o = t + n;
|
|
2163
2198
|
for (;;) {
|
|
2164
2199
|
let t = r, n = !0, l = !0;
|
|
2165
|
-
for (; t < o &&
|
|
2200
|
+
for (; t < o && Rr(e.charCodeAt(t));) t > r && (Ar(e.charCodeAt(t)) ? l = !1 : n = !1), t++;
|
|
2166
2201
|
if (t === r) return !1;
|
|
2167
|
-
if (!(l || n &&
|
|
2202
|
+
if (!(l || n && Ar(e.charCodeAt(r)))) return !1;
|
|
2168
2203
|
if (t === o) return !0;
|
|
2169
2204
|
if ("-" !== e[t] && "." !== e[t] && "/" !== e[t] || t + 1 === o) return !1;
|
|
2170
2205
|
r = t + 1;
|
|
@@ -2260,9 +2295,9 @@
|
|
|
2260
2295
|
function Br(e, t, n) {
|
|
2261
2296
|
for (let r = t; r < n; r++) e[r] = 1;
|
|
2262
2297
|
}
|
|
2263
|
-
var Yr = 0, Jr = 1,
|
|
2264
|
-
function
|
|
2265
|
-
const l = n ===
|
|
2298
|
+
var Yr = 0, Jr = 1, qr = 2;
|
|
2299
|
+
function Hr(e, t, n, r, o) {
|
|
2300
|
+
const l = n === qr ? Tr : Er;
|
|
2266
2301
|
let i = !1;
|
|
2267
2302
|
const s = (t) => t >= e.length || " " === e[t] || " " === e[t] || "\0" === e[t];
|
|
2268
2303
|
let a = "", u = 0, _ = 0;
|
|
@@ -2476,7 +2511,7 @@
|
|
|
2476
2511
|
const s = i.join(""), a = new Uint8Array(s.length);
|
|
2477
2512
|
(function(e, t) {
|
|
2478
2513
|
const n = po(e, Er), r = new Uint8Array(e.length);
|
|
2479
|
-
|
|
2514
|
+
Hr(e, n, Yr, t, r), _o(e, t, r), fo(e, t), go(e, t), bo(e, t);
|
|
2480
2515
|
})(s, a), vo(s, a, n + 1);
|
|
2481
2516
|
let u = 0;
|
|
2482
2517
|
for (let n = 0; n < s.length; n++) {
|
|
@@ -2486,13 +2521,13 @@
|
|
|
2486
2521
|
}
|
|
2487
2522
|
function Eo(e, t) {
|
|
2488
2523
|
const n = po(e, Er), r = po(e, Tr), o = new Uint8Array(e.length);
|
|
2489
|
-
(
|
|
2524
|
+
(Hr(e, n, Yr, t, o) || n !== r) && Hr(e, r, qr, t, null), function(e) {
|
|
2490
2525
|
for (let t = 0; t < e.length; t++) {
|
|
2491
2526
|
const n = e.charCodeAt(t);
|
|
2492
2527
|
if ((101 === n || 98 === n || 66 === n) && Mr(e, t)[1]) return !0;
|
|
2493
2528
|
}
|
|
2494
2529
|
return !1;
|
|
2495
|
-
}(e) &&
|
|
2530
|
+
}(e) && Hr(e, n, Jr, t, null), _o(e, t, o), fo(e, t), go(e, t), bo(e, t), vo(e, t, 0);
|
|
2496
2531
|
}
|
|
2497
2532
|
function To(e) {
|
|
2498
2533
|
if ("string" != typeof e) return null;
|
|
@@ -2564,7 +2599,7 @@
|
|
|
2564
2599
|
}
|
|
2565
2600
|
r.left -= 1 + a.length;
|
|
2566
2601
|
let u, _ = e[a];
|
|
2567
|
-
u = (jr(a, 0, a.length, Er) || o && "value" === a) && null != _ && "" !== _ ? "********" : wo(_, t, n + 1, r), u !== _ && (i = !0),
|
|
2602
|
+
u = (jr(a, 0, a.length, Er) || o && "value" === a) && null != _ && "" !== _ ? "********" : wo(_, t, n + 1, r), u !== _ && (i = !0), sl(l, a, u);
|
|
2568
2603
|
}
|
|
2569
2604
|
s && (l["<more>"] = Kr);
|
|
2570
2605
|
}
|
|
@@ -2580,17 +2615,17 @@
|
|
|
2580
2615
|
function $o(e, t) {
|
|
2581
2616
|
_r(No(e), t);
|
|
2582
2617
|
}
|
|
2583
|
-
function
|
|
2618
|
+
function Ro(e) {
|
|
2584
2619
|
return structuredClone(e);
|
|
2585
2620
|
}
|
|
2586
|
-
function
|
|
2621
|
+
function Ao(e, t) {
|
|
2587
2622
|
if (e === t) return !0;
|
|
2588
2623
|
if (null === e || null === t) return e === t;
|
|
2589
2624
|
if (typeof e != typeof t) return !1;
|
|
2590
2625
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
2591
2626
|
if (Array.isArray(e)) {
|
|
2592
2627
|
if (e.length !== t.length) return !1;
|
|
2593
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
2628
|
+
for (let n = 0; n < e.length; n++) if (!Ao(e[n], t[n])) return !1;
|
|
2594
2629
|
return !0;
|
|
2595
2630
|
}
|
|
2596
2631
|
if ("object" == typeof e) {
|
|
@@ -2598,7 +2633,7 @@
|
|
|
2598
2633
|
if (n.length !== r.length) return !1;
|
|
2599
2634
|
for (let o = 0; o < n.length; o++) {
|
|
2600
2635
|
if (n[o] !== r[o]) return !1;
|
|
2601
|
-
if (!
|
|
2636
|
+
if (!Ao(e[n[o]], t[r[o]])) return !1;
|
|
2602
2637
|
}
|
|
2603
2638
|
return !0;
|
|
2604
2639
|
}
|
|
@@ -2606,17 +2641,17 @@
|
|
|
2606
2641
|
}
|
|
2607
2642
|
function Do(e, t) {
|
|
2608
2643
|
if (!t) return e;
|
|
2609
|
-
for (let n of Object.keys(t))
|
|
2644
|
+
for (let n of Object.keys(t)) sl(e, n, t[n]);
|
|
2610
2645
|
return e;
|
|
2611
2646
|
}
|
|
2612
2647
|
function ko(e, t) {
|
|
2613
2648
|
if (!t) return e;
|
|
2614
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) &&
|
|
2649
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && sl(e, n, t[n]);
|
|
2615
2650
|
return e;
|
|
2616
2651
|
}
|
|
2617
2652
|
function Co(e, t) {
|
|
2618
2653
|
if (!t) return e;
|
|
2619
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) &&
|
|
2654
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && sl(e, n, t[n]);
|
|
2620
2655
|
return e;
|
|
2621
2656
|
}
|
|
2622
2657
|
function Io(e, t) {
|
|
@@ -2626,10 +2661,10 @@
|
|
|
2626
2661
|
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
2627
2662
|
}
|
|
2628
2663
|
function Lo(e, t, n) {
|
|
2629
|
-
|
|
2664
|
+
sl(e, t, n);
|
|
2630
2665
|
}
|
|
2631
2666
|
function Uo(e, t, n) {
|
|
2632
|
-
|
|
2667
|
+
sl(e, t, n);
|
|
2633
2668
|
}
|
|
2634
2669
|
function Fo(e, t) {
|
|
2635
2670
|
e.push(t);
|
|
@@ -2641,54 +2676,57 @@
|
|
|
2641
2676
|
e.splice(t, 1);
|
|
2642
2677
|
}
|
|
2643
2678
|
function Vo(e) {
|
|
2644
|
-
return
|
|
2679
|
+
return Bo(e) ? Object.keys(e).length : 0;
|
|
2645
2680
|
}
|
|
2646
2681
|
function Wo(e) {
|
|
2647
|
-
return
|
|
2682
|
+
return Yo(e) ? e.length : 0;
|
|
2648
2683
|
}
|
|
2649
2684
|
function xo(e) {
|
|
2650
|
-
return
|
|
2685
|
+
return Bo(e) ? Object.keys(e).length : Yo(e) ? e.length : Jo(e) && e.length > 0 ? 1 : 0;
|
|
2651
2686
|
}
|
|
2652
2687
|
function Ko(e) {
|
|
2653
|
-
return
|
|
2688
|
+
return 0 === xo(e);
|
|
2654
2689
|
}
|
|
2655
2690
|
function Bo(e) {
|
|
2656
|
-
return Array.isArray(e);
|
|
2691
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
2657
2692
|
}
|
|
2658
2693
|
function Yo(e) {
|
|
2659
|
-
return
|
|
2694
|
+
return Array.isArray(e);
|
|
2660
2695
|
}
|
|
2661
2696
|
function Jo(e) {
|
|
2697
|
+
return "string" == typeof e;
|
|
2698
|
+
}
|
|
2699
|
+
function qo(e) {
|
|
2662
2700
|
return "number" == typeof e && Number.isFinite(e);
|
|
2663
2701
|
}
|
|
2664
2702
|
function Ho(e) {
|
|
2665
2703
|
return "boolean" == typeof e;
|
|
2666
2704
|
}
|
|
2667
|
-
function qo(e) {
|
|
2668
|
-
return null == e;
|
|
2669
|
-
}
|
|
2670
2705
|
function zo(e) {
|
|
2671
|
-
return
|
|
2706
|
+
return null == e;
|
|
2672
2707
|
}
|
|
2673
2708
|
function Qo(e) {
|
|
2674
|
-
return
|
|
2709
|
+
return "function" == typeof e;
|
|
2675
2710
|
}
|
|
2676
2711
|
function Xo(e) {
|
|
2677
|
-
return
|
|
2712
|
+
return e instanceof I;
|
|
2678
2713
|
}
|
|
2679
2714
|
function Zo(e) {
|
|
2680
|
-
return Jo(e)
|
|
2715
|
+
return !Jo(e) || 0 === e.length;
|
|
2681
2716
|
}
|
|
2682
|
-
function el(e
|
|
2683
|
-
return e
|
|
2717
|
+
function el(e) {
|
|
2718
|
+
return qo(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
2684
2719
|
}
|
|
2685
2720
|
function tl(e, t) {
|
|
2721
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
2722
|
+
}
|
|
2723
|
+
function nl(e, t) {
|
|
2686
2724
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
2687
2725
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
2688
2726
|
}
|
|
2689
|
-
function
|
|
2690
|
-
if (
|
|
2691
|
-
if (
|
|
2727
|
+
function rl(e, t) {
|
|
2728
|
+
if (Bo(e) || Bo(t) || Yo(e) || Yo(t)) return 0;
|
|
2729
|
+
if (qo(e) || qo(t)) {
|
|
2692
2730
|
let n = Number(e), r = Number(t);
|
|
2693
2731
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
2694
2732
|
}
|
|
@@ -2696,20 +2734,20 @@
|
|
|
2696
2734
|
let n = Number(e), r = Number(t);
|
|
2697
2735
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
2698
2736
|
}
|
|
2699
|
-
return
|
|
2737
|
+
return tl(String(e), String(t));
|
|
2700
2738
|
}
|
|
2701
|
-
function
|
|
2702
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
2739
|
+
function ol(e, t) {
|
|
2740
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) ol(e, n);
|
|
2703
2741
|
else "string" == typeof t && delete e[t];
|
|
2704
2742
|
else for (const n of Object.keys(t)) delete e[n];
|
|
2705
2743
|
}
|
|
2706
|
-
function
|
|
2744
|
+
function ll(e, t) {
|
|
2707
2745
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
2708
2746
|
}
|
|
2709
|
-
function
|
|
2747
|
+
function il(e, t) {
|
|
2710
2748
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
2711
2749
|
}
|
|
2712
|
-
function
|
|
2750
|
+
function sl(e, t, n) {
|
|
2713
2751
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
2714
2752
|
value: n,
|
|
2715
2753
|
writable: !0,
|
|
@@ -2717,81 +2755,81 @@
|
|
|
2717
2755
|
configurable: !0
|
|
2718
2756
|
}) : e[t] = n;
|
|
2719
2757
|
}
|
|
2720
|
-
function
|
|
2758
|
+
function al(e, t) {
|
|
2721
2759
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
2722
2760
|
const n = Number(t);
|
|
2723
2761
|
return n >= e.length ? -1 : n;
|
|
2724
2762
|
}
|
|
2725
|
-
function
|
|
2726
|
-
e && !
|
|
2763
|
+
function ul(e, t, n, r) {
|
|
2764
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2727
2765
|
const o = e ? `${kt(e)}: ` : "";
|
|
2728
|
-
if (!
|
|
2729
|
-
if (!
|
|
2766
|
+
if (!Bo(t) && !Yo(t)) return void ir(`${o}kw must be list or dict: '${String(n)}'`);
|
|
2767
|
+
if (!Jo(n)) return void ir(`${o}path must be a string: ${String(n)}`);
|
|
2730
2768
|
let l = n.split("`"), i = l.length;
|
|
2731
2769
|
for (let e = 0; e < i; e++) {
|
|
2732
|
-
if (
|
|
2733
|
-
const i =
|
|
2770
|
+
if (Yo(t)) {
|
|
2771
|
+
const i = al(t, l[e]);
|
|
2734
2772
|
if (i < 0) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2735
2773
|
l[e] = String(i);
|
|
2736
2774
|
}
|
|
2737
|
-
if (
|
|
2775
|
+
if (il(t, l[e])) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2738
2776
|
if (e === i - 1) break;
|
|
2739
2777
|
if (null == (t = t[l[e]])) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2740
|
-
if (!
|
|
2778
|
+
if (!Bo(t) && !Yo(t)) return void ir(`${o}kw must be list or dict: '${n}'`);
|
|
2741
2779
|
}
|
|
2742
2780
|
let s = t[l[i - 1]];
|
|
2743
2781
|
return void 0 === s && r && ir(`${o}path not found: '${n}'`), s;
|
|
2744
2782
|
}
|
|
2745
|
-
function
|
|
2746
|
-
e && !
|
|
2783
|
+
function _l(e, t, n) {
|
|
2784
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2747
2785
|
const r = e ? kt(e) + ": " : "";
|
|
2748
|
-
if (!
|
|
2786
|
+
if (!Jo(n)) return ir(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
2749
2787
|
let [o, l] = function(e, t) {
|
|
2750
2788
|
let n = e.lastIndexOf(t);
|
|
2751
2789
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
2752
2790
|
}(n, "`"), i = t;
|
|
2753
|
-
if (
|
|
2754
|
-
else if (i =
|
|
2755
|
-
return
|
|
2791
|
+
if (Zo(l)) l = n;
|
|
2792
|
+
else if (i = ul(e, t, o, !0), void 0 === i) return -1;
|
|
2793
|
+
return Yo(i) ? (ir(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : Bo(i) && Object.prototype.hasOwnProperty.call(i, l) ? (delete i[l], 0) : (ir(`${r}kw_delete(): path not found: '${n}'`), -1);
|
|
2756
2794
|
}
|
|
2757
|
-
function
|
|
2758
|
-
e && !
|
|
2759
|
-
let l =
|
|
2795
|
+
function cl(e, t, n, r, o) {
|
|
2796
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2797
|
+
let l = ul(e, t, n, !1);
|
|
2760
2798
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
2761
2799
|
if (void 0 === l) {
|
|
2762
2800
|
if (s && t) {
|
|
2763
2801
|
let o = Boolean(r);
|
|
2764
|
-
return
|
|
2802
|
+
return ml(e, t, n, o), o;
|
|
2765
2803
|
}
|
|
2766
2804
|
return i && (ir(`path not found: '${n}'`), $o(t)), Boolean(r);
|
|
2767
2805
|
}
|
|
2768
2806
|
let _;
|
|
2769
2807
|
if (Ho(l)) _ = l;
|
|
2770
|
-
else if (u &&
|
|
2771
|
-
else if (u &&
|
|
2808
|
+
else if (u && qo(l)) _ = 0 !== l;
|
|
2809
|
+
else if (u && Jo(l)) _ = "true" === l.toLowerCase() || "false" !== l.toLowerCase() && 0 !== (parseInt(l, 10) || 0);
|
|
2772
2810
|
else {
|
|
2773
2811
|
if (!u || null !== l) return u ? (ir(`${e ? kt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $o(t), !1) : (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), $o(t), Boolean(r));
|
|
2774
2812
|
_ = !1;
|
|
2775
2813
|
}
|
|
2776
|
-
return a &&
|
|
2814
|
+
return a && _l(e, t, n), _;
|
|
2777
2815
|
}
|
|
2778
|
-
function
|
|
2779
|
-
e && !
|
|
2780
|
-
let l =
|
|
2816
|
+
function fl(e, t, n, r, o) {
|
|
2817
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2818
|
+
let l = ul(e, t, n, !1);
|
|
2781
2819
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
2782
2820
|
if (void 0 === l) {
|
|
2783
2821
|
if (s && t) {
|
|
2784
2822
|
let o = parseInt(r);
|
|
2785
|
-
return
|
|
2823
|
+
return ml(e, t, n, o), o;
|
|
2786
2824
|
}
|
|
2787
2825
|
return i && (ir(`path not found: '${n}'`), $o(t)), parseInt(r);
|
|
2788
2826
|
}
|
|
2789
2827
|
let _;
|
|
2790
|
-
if (
|
|
2828
|
+
if (qo(l)) _ = Math.trunc(l);
|
|
2791
2829
|
else {
|
|
2792
2830
|
if (!u) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a json integer: '${n}'`), $o(t), parseInt(r);
|
|
2793
2831
|
if (Ho(l)) _ = l ? 1 : 0;
|
|
2794
|
-
else if (
|
|
2832
|
+
else if (Jo(l)) _ = function(e) {
|
|
2795
2833
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
2796
2834
|
if (!t) return 0;
|
|
2797
2835
|
let n, r = t[2];
|
|
@@ -2802,120 +2840,120 @@
|
|
|
2802
2840
|
_ = 0;
|
|
2803
2841
|
}
|
|
2804
2842
|
}
|
|
2805
|
-
return a &&
|
|
2843
|
+
return a && _l(e, t, n), _;
|
|
2806
2844
|
}
|
|
2807
|
-
function
|
|
2808
|
-
e && !
|
|
2809
|
-
let l =
|
|
2845
|
+
function gl(e, t, n, r, o) {
|
|
2846
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2847
|
+
let l = ul(e, t, n, !1);
|
|
2810
2848
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2811
|
-
return void 0 === l ? s && t ? (
|
|
2812
|
-
let n =
|
|
2849
|
+
return void 0 === l ? s && t ? (ml(e, t, n, Jo(r) ? r : null), r) : (i && !function(e, t) {
|
|
2850
|
+
let n = Jo(t) ? t.split("`") : [], r = e;
|
|
2813
2851
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2814
|
-
if (!
|
|
2852
|
+
if (!Bo(r) && !Yo(r)) return !1;
|
|
2815
2853
|
r = r[n[e]];
|
|
2816
2854
|
}
|
|
2817
|
-
return !(!
|
|
2818
|
-
}(t, n) && (ir(`path not found: '${n}'`), $o(t)), r) :
|
|
2855
|
+
return !(!Bo(r) && !Yo(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
2856
|
+
}(t, n) && (ir(`path not found: '${n}'`), $o(t)), r) : Jo(l) ? (a && _l(e, t, n), l) : (null !== l && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json str: '${n}'`), $o(t)), r);
|
|
2819
2857
|
}
|
|
2820
|
-
function
|
|
2821
|
-
e && !
|
|
2822
|
-
let l =
|
|
2858
|
+
function dl(e, t, n, r, o) {
|
|
2859
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2860
|
+
let l = ul(e, t, n, !1);
|
|
2823
2861
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2824
2862
|
if (void 0 === l) {
|
|
2825
2863
|
if (s) {
|
|
2826
2864
|
let o = r;
|
|
2827
|
-
return
|
|
2865
|
+
return ml(e, t, n, o), o;
|
|
2828
2866
|
}
|
|
2829
2867
|
return i && (ir(`path not found: '${n}'`), $o(t)), r;
|
|
2830
2868
|
}
|
|
2831
|
-
return a &&
|
|
2869
|
+
return a && _l(e, t, n), l;
|
|
2832
2870
|
}
|
|
2833
|
-
function
|
|
2834
|
-
e && !
|
|
2835
|
-
let l =
|
|
2871
|
+
function bl(e, t, n, r, o) {
|
|
2872
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2873
|
+
let l = ul(e, t, n, !1);
|
|
2836
2874
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2837
|
-
return void 0 === l ? s &&
|
|
2875
|
+
return void 0 === l ? s && Bo(r) && t ? (ml(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), $o(t)), r) : Bo(l) ? (a && _l(e, t, n), l) : s && null === l && Bo(r) ? (ml(e, t, n, r), r) : s && null === l ? (i && (ir(`path not found: '${n}'`), $o(t)), r) : ((i || s) && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (s ? ", cannot create" : "")), $o(t)), r);
|
|
2838
2876
|
}
|
|
2839
|
-
function
|
|
2840
|
-
e && !
|
|
2841
|
-
let l =
|
|
2877
|
+
function pl(e, t, n, r, o) {
|
|
2878
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2879
|
+
let l = ul(e, t, n, !1);
|
|
2842
2880
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2843
2881
|
if (void 0 === l) {
|
|
2844
2882
|
if (s) {
|
|
2845
2883
|
let o = r;
|
|
2846
|
-
return
|
|
2884
|
+
return ml(e, t, n, o), o;
|
|
2847
2885
|
}
|
|
2848
2886
|
return i && (ir(`path not found: '${n}'`), $o(t)), r;
|
|
2849
2887
|
}
|
|
2850
|
-
return a &&
|
|
2888
|
+
return a && _l(e, t, n), l;
|
|
2851
2889
|
}
|
|
2852
|
-
function
|
|
2853
|
-
if (e && !
|
|
2854
|
-
if (!
|
|
2890
|
+
function ml(e, t, n, r) {
|
|
2891
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !Bo(t)) return ir("kw is not an object"), -1;
|
|
2892
|
+
if (!Jo(n)) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
2855
2893
|
if ("" === n) return ir((e ? kt(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
2856
2894
|
if (n.split("`").includes("")) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
2857
2895
|
let o = n.split("`"), l = o.length;
|
|
2858
2896
|
for (let i = 0; i < l; i++) {
|
|
2859
2897
|
let s = o[i];
|
|
2860
|
-
if (
|
|
2861
|
-
const r =
|
|
2898
|
+
if (Yo(t)) {
|
|
2899
|
+
const r = al(t, s);
|
|
2862
2900
|
if (r < 0) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not an index of its list: '${n}'`), -1;
|
|
2863
2901
|
s = String(r);
|
|
2864
2902
|
}
|
|
2865
|
-
if (i === l - 1)
|
|
2903
|
+
if (i === l - 1) sl(t, s, r);
|
|
2866
2904
|
else {
|
|
2867
|
-
let r =
|
|
2868
|
-
if (void 0 === r)
|
|
2869
|
-
else if (!
|
|
2905
|
+
let r = il(t, s) ? void 0 : t[s];
|
|
2906
|
+
if (void 0 === r) sl(t, s, {});
|
|
2907
|
+
else if (!Bo(r) && !Yo(r)) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not a dict or a list: '${n}'`), -1;
|
|
2870
2908
|
t = t[s];
|
|
2871
2909
|
}
|
|
2872
2910
|
}
|
|
2873
2911
|
return 0;
|
|
2874
2912
|
}
|
|
2875
|
-
function
|
|
2876
|
-
if (e && !
|
|
2877
|
-
let l =
|
|
2913
|
+
function hl(e, t, n, r, o) {
|
|
2914
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !Bo(t)) return ir("kw is not an object"), -1;
|
|
2915
|
+
let l = ul(e, t, n, !1);
|
|
2878
2916
|
if (void 0 === l) {
|
|
2879
|
-
if (!
|
|
2917
|
+
if (!Jo(n) || function(e, t) {
|
|
2880
2918
|
let n = t.split("`"), r = e;
|
|
2881
2919
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2882
|
-
if (
|
|
2883
|
-
const t =
|
|
2920
|
+
if (Yo(r)) {
|
|
2921
|
+
const t = al(r, n[e]);
|
|
2884
2922
|
if (t < 0) return !1;
|
|
2885
2923
|
r = r[t];
|
|
2886
2924
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
2887
2925
|
if (null == r) return !1;
|
|
2888
|
-
if (!
|
|
2926
|
+
if (!Bo(r) && !Yo(r)) return !0;
|
|
2889
2927
|
}
|
|
2890
2928
|
return !1;
|
|
2891
2929
|
}(t, n)) return -1;
|
|
2892
|
-
if (l = {},
|
|
2930
|
+
if (l = {}, ml(e, t, n, l) < 0) return -1;
|
|
2893
2931
|
}
|
|
2894
|
-
return
|
|
2932
|
+
return Bo(l) ? (sl(l, r, o), 0) : (ir(`subdict is not an object: '${n}'`), -1);
|
|
2895
2933
|
}
|
|
2896
|
-
function
|
|
2934
|
+
function yl(e, t, r) {
|
|
2897
2935
|
let o = "", l = !1;
|
|
2898
|
-
if (
|
|
2936
|
+
if (Yo(t)) {
|
|
2899
2937
|
l = !1;
|
|
2900
2938
|
for (let i = 0; i < t.length; i++) {
|
|
2901
2939
|
let s = t[i];
|
|
2902
|
-
if (o =
|
|
2940
|
+
if (o = Zo(r) ? n("%s", r) : n("%s`%d", r, i), l = yl(e, s, o), l) break;
|
|
2903
2941
|
}
|
|
2904
|
-
} else if (
|
|
2942
|
+
} else if (Bo(t)) {
|
|
2905
2943
|
l = !0;
|
|
2906
2944
|
let i = Object.keys(t);
|
|
2907
2945
|
for (let s = 0; s < i.length; s++) {
|
|
2908
2946
|
let a = i[s], u = t[a];
|
|
2909
|
-
if (o =
|
|
2910
|
-
if (l =
|
|
2947
|
+
if (o = Zo(r) ? n("%s", a) : n("%s`%s", r, a), Yo(u) || Bo(u)) {
|
|
2948
|
+
if (l = yl(e, u, o), !l) break;
|
|
2911
2949
|
continue;
|
|
2912
2950
|
}
|
|
2913
|
-
let _ =
|
|
2951
|
+
let _ = pl(0, e, o, void 0, 0);
|
|
2914
2952
|
if (void 0 === _ && (_ = Io(e, o)), void 0 === _) {
|
|
2915
2953
|
l = !1;
|
|
2916
2954
|
break;
|
|
2917
2955
|
}
|
|
2918
|
-
if (0 !==
|
|
2956
|
+
if (0 !== rl(_, u)) {
|
|
2919
2957
|
l = !1;
|
|
2920
2958
|
break;
|
|
2921
2959
|
}
|
|
@@ -2923,34 +2961,34 @@
|
|
|
2923
2961
|
}
|
|
2924
2962
|
return l;
|
|
2925
2963
|
}
|
|
2926
|
-
function
|
|
2927
|
-
return 0 === xo(t) ||
|
|
2964
|
+
function vl(e, t) {
|
|
2965
|
+
return 0 === xo(t) || yl(e, t, "");
|
|
2928
2966
|
}
|
|
2929
|
-
function
|
|
2930
|
-
e && !
|
|
2967
|
+
function El(e, t, n, r) {
|
|
2968
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2931
2969
|
let o = {};
|
|
2932
|
-
if (
|
|
2970
|
+
if (Jo(n) && !Zo(n)) {
|
|
2933
2971
|
let l = n;
|
|
2934
|
-
Object.prototype.hasOwnProperty.call(t, l) ?
|
|
2935
|
-
} else if (
|
|
2972
|
+
Object.prototype.hasOwnProperty.call(t, l) ? sl(o, l, t[l]) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2973
|
+
} else if (Bo(n) && Vo(n) > 0) for (let l of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, l) ? sl(o, l, t[l]) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2936
2974
|
else {
|
|
2937
|
-
if (!(
|
|
2975
|
+
if (!(Yo(n) && Wo(n) > 0)) return t;
|
|
2938
2976
|
for (let l = 0; l < n.length; l++) {
|
|
2939
2977
|
let i = n[l];
|
|
2940
|
-
Object.prototype.hasOwnProperty.call(t, i) ?
|
|
2978
|
+
Object.prototype.hasOwnProperty.call(t, i) ? sl(o, i, t[i]) : r && ir(`${kt(e)}: key not found: ${i}`);
|
|
2941
2979
|
}
|
|
2942
2980
|
}
|
|
2943
2981
|
return o;
|
|
2944
2982
|
}
|
|
2945
|
-
function
|
|
2983
|
+
function Tl(e, t, n, r) {
|
|
2946
2984
|
let o = {};
|
|
2947
|
-
if (!
|
|
2948
|
-
if (Do(o, t),
|
|
2985
|
+
if (!Bo(t)) return o;
|
|
2986
|
+
if (Do(o, t), Jo(n) && !Zo(n)) {
|
|
2949
2987
|
let l = n;
|
|
2950
2988
|
Object.prototype.hasOwnProperty.call(t, l) ? Po(o, l) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2951
|
-
} else if (
|
|
2989
|
+
} else if (Bo(n) && Vo(n) > 0) for (let l of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, l) ? Po(o, l) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2952
2990
|
else {
|
|
2953
|
-
if (!(
|
|
2991
|
+
if (!(Yo(n) && Wo(n) > 0)) return {};
|
|
2954
2992
|
for (let l = 0; l < n.length; l++) {
|
|
2955
2993
|
let i = n[l];
|
|
2956
2994
|
Object.prototype.hasOwnProperty.call(t, i) ? Po(o, i) : r && ir(`${kt(e)}: key not found: ${i}`);
|
|
@@ -2958,7 +2996,7 @@
|
|
|
2958
2996
|
}
|
|
2959
2997
|
return o;
|
|
2960
2998
|
}
|
|
2961
|
-
function
|
|
2999
|
+
function jl() {
|
|
2962
3000
|
if ("undefined" == typeof window) return null;
|
|
2963
3001
|
let e;
|
|
2964
3002
|
try {
|
|
@@ -2975,39 +3013,47 @@
|
|
|
2975
3013
|
}
|
|
2976
3014
|
return e || null;
|
|
2977
3015
|
}
|
|
2978
|
-
var
|
|
2979
|
-
function
|
|
2980
|
-
|
|
3016
|
+
var Ol = /* @__PURE__ */ new Set();
|
|
3017
|
+
function Sl(e, t) {
|
|
3018
|
+
Ol.has(e) || (Ol.add(e), sr(t));
|
|
2981
3019
|
}
|
|
2982
|
-
function
|
|
2983
|
-
const r =
|
|
3020
|
+
function wl(e, t, n = !1) {
|
|
3021
|
+
const r = jl();
|
|
2984
3022
|
if (!r) return t;
|
|
2985
3023
|
const o = `kw_get_local_storage_value(): localStorage key "${e}"`;
|
|
2986
3024
|
let l;
|
|
2987
3025
|
try {
|
|
2988
3026
|
l = r.getItem(e);
|
|
2989
3027
|
} catch (n) {
|
|
2990
|
-
return
|
|
3028
|
+
return Sl(e, `${o} cannot be read (storage blocked?): the default is used`), t;
|
|
2991
3029
|
}
|
|
2992
|
-
let i = null;
|
|
3030
|
+
let i = !0, s = null;
|
|
2993
3031
|
if (null !== l) try {
|
|
2994
|
-
|
|
3032
|
+
s = JSON.parse(l);
|
|
2995
3033
|
} catch (t) {
|
|
2996
|
-
|
|
3034
|
+
s = null;
|
|
2997
3035
|
try {
|
|
2998
|
-
r.removeItem(e), sr(`${o} does not hold json: removed, the default is used`)
|
|
3036
|
+
r.removeItem(e), sr(`${o} does not hold json: removed, the default is used`);
|
|
2999
3037
|
} catch (t) {
|
|
3000
|
-
|
|
3038
|
+
i = !1, Sl(e, `${o} does not hold json and cannot be removed: the default is used`);
|
|
3001
3039
|
}
|
|
3002
|
-
l = void 0;
|
|
3003
3040
|
}
|
|
3004
|
-
|
|
3041
|
+
if (null === s && (s = t, n)) {
|
|
3042
|
+
const n = Fe(t);
|
|
3043
|
+
if (void 0 === n) ir(`${o}: cannot write the default: a value with no json text`);
|
|
3044
|
+
else try {
|
|
3045
|
+
r.setItem(e, n);
|
|
3046
|
+
} catch (t) {
|
|
3047
|
+
i = !1, Sl(e, `${o} cannot be written (storage full or blocked?): the default is used, not kept`);
|
|
3048
|
+
}
|
|
3049
|
+
}
|
|
3050
|
+
return i && Ol.delete(e), s;
|
|
3005
3051
|
}
|
|
3006
|
-
function
|
|
3052
|
+
function Nl(e, t) {
|
|
3007
3053
|
if (!e) return ir(`kw_set_local_storage_value(): invalid key: key=${e}`), -1;
|
|
3008
3054
|
const n = Fe(t);
|
|
3009
3055
|
if (void 0 === n) return ir(`kw_set_local_storage_value(): cannot save "${e}": a value with no json text`), -1;
|
|
3010
|
-
const r =
|
|
3056
|
+
const r = jl();
|
|
3011
3057
|
if (!r) return 0;
|
|
3012
3058
|
try {
|
|
3013
3059
|
return r.setItem(e, n), 0;
|
|
@@ -3015,8 +3061,8 @@
|
|
|
3015
3061
|
return ir(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
3016
3062
|
}
|
|
3017
3063
|
}
|
|
3018
|
-
function
|
|
3019
|
-
const t =
|
|
3064
|
+
function $l(e) {
|
|
3065
|
+
const t = jl();
|
|
3020
3066
|
if (t) if (e) try {
|
|
3021
3067
|
t.removeItem(e);
|
|
3022
3068
|
} catch (t) {
|
|
@@ -3024,45 +3070,45 @@
|
|
|
3024
3070
|
}
|
|
3025
3071
|
else ir(`kw_remove_local_storage_value(): invalid key: key=${e}`);
|
|
3026
3072
|
}
|
|
3027
|
-
function
|
|
3028
|
-
if (
|
|
3029
|
-
if (
|
|
3073
|
+
function Rl(e, t) {
|
|
3074
|
+
if (zo(e) || zo(t)) return !0;
|
|
3075
|
+
if (Yo(e)) {
|
|
3030
3076
|
if (0 === e.length) return !0;
|
|
3031
3077
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
3032
|
-
} else if (
|
|
3078
|
+
} else if (Bo(e)) {
|
|
3033
3079
|
if (0 === Object.keys(e).length) return !0;
|
|
3034
3080
|
for (let n in e) if (n === t) return !0;
|
|
3035
|
-
} else if (
|
|
3081
|
+
} else if (Jo(e) && e === t) return !0;
|
|
3036
3082
|
return !1;
|
|
3037
3083
|
}
|
|
3038
3084
|
function Al(e, t, n, r, o) {
|
|
3039
|
-
if (e && !
|
|
3040
|
-
o || (o =
|
|
3085
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
3086
|
+
o || (o = vl);
|
|
3041
3087
|
let l = [];
|
|
3042
|
-
if (
|
|
3088
|
+
if (Yo(t)) for (let i = 0; i < t.length; i++) {
|
|
3043
3089
|
let s, a = t[i];
|
|
3044
|
-
if (
|
|
3090
|
+
if (Bo(a)) s = gl(e, a, "id", "", 0);
|
|
3045
3091
|
else {
|
|
3046
|
-
if (!
|
|
3092
|
+
if (!Jo(a)) continue;
|
|
3047
3093
|
s = a;
|
|
3048
3094
|
}
|
|
3049
|
-
|
|
3095
|
+
Rl(n, s) && o(a, r) && l.push(a);
|
|
3050
3096
|
}
|
|
3051
3097
|
else {
|
|
3052
|
-
if (!
|
|
3098
|
+
if (!Bo(t)) return ir("kw_collect() BAD kw parameter"), null;
|
|
3053
3099
|
for (let e of Object.keys(t)) {
|
|
3054
3100
|
let i = t[e];
|
|
3055
|
-
|
|
3101
|
+
Rl(n, e) && o(i, r) && l.push(i);
|
|
3056
3102
|
}
|
|
3057
3103
|
}
|
|
3058
3104
|
return l;
|
|
3059
3105
|
}
|
|
3060
|
-
function
|
|
3106
|
+
function Dl(e, t) {
|
|
3061
3107
|
if (!e) return -1;
|
|
3062
3108
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
3063
3109
|
return -1;
|
|
3064
3110
|
}
|
|
3065
|
-
function
|
|
3111
|
+
function kl(e, t, n) {
|
|
3066
3112
|
if (!e || !t) return ir("ERROR: str_in_list() list or str empty"), !1;
|
|
3067
3113
|
let r = e.length;
|
|
3068
3114
|
if (n) {
|
|
@@ -3074,7 +3120,7 @@
|
|
|
3074
3120
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
3075
3121
|
return !1;
|
|
3076
3122
|
}
|
|
3077
|
-
function
|
|
3123
|
+
function Cl(e, t) {
|
|
3078
3124
|
try {
|
|
3079
3125
|
let n = e.__md_iev__;
|
|
3080
3126
|
if (n) return n[t];
|
|
@@ -3082,35 +3128,35 @@
|
|
|
3082
3128
|
return;
|
|
3083
3129
|
}
|
|
3084
3130
|
}
|
|
3085
|
-
function
|
|
3131
|
+
function Il(e, t, n) {
|
|
3086
3132
|
let r = e.__md_iev__;
|
|
3087
3133
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
3088
3134
|
}
|
|
3089
|
-
function
|
|
3090
|
-
if (!
|
|
3135
|
+
function Pl(e, t, n, r) {
|
|
3136
|
+
if (!Xo(e)) return ir("gobj is not a GObj"), null;
|
|
3091
3137
|
if (!t) return;
|
|
3092
|
-
let o =
|
|
3093
|
-
o || (o = [],
|
|
3138
|
+
let o = Cl(t, n);
|
|
3139
|
+
o || (o = [], Il(t, n, o));
|
|
3094
3140
|
try {
|
|
3095
|
-
|
|
3141
|
+
Yo(o) && o.unshift(r);
|
|
3096
3142
|
} catch (e) {
|
|
3097
3143
|
ir(e);
|
|
3098
3144
|
}
|
|
3099
3145
|
}
|
|
3100
|
-
function
|
|
3101
|
-
if (!
|
|
3102
|
-
if (!
|
|
3103
|
-
let o =
|
|
3146
|
+
function Ll(e, t, n, r) {
|
|
3147
|
+
if (!Xo(e)) return ir("gobj is not a GObj"), null;
|
|
3148
|
+
if (!Bo(t)) return ir("kw is not a dict"), null;
|
|
3149
|
+
let o = Cl(t, n);
|
|
3104
3150
|
return o ? 0 === o.length ? (r && ir(`stack empty: ${n}`), null) : o[0] : (r && ir(`stack NOT FOUND: ${n}`), null);
|
|
3105
3151
|
}
|
|
3106
|
-
function
|
|
3107
|
-
return
|
|
3152
|
+
function Ul(e, t, n) {
|
|
3153
|
+
return Zo(n) ? _l(e, t, "__md_iev__`__msg_type__") : hl(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
3108
3154
|
}
|
|
3109
|
-
function
|
|
3110
|
-
return
|
|
3155
|
+
function Fl(e, t) {
|
|
3156
|
+
return gl(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
3111
3157
|
}
|
|
3112
|
-
function
|
|
3113
|
-
void 0 !== n &&
|
|
3158
|
+
function Ml(e, t, n) {
|
|
3159
|
+
void 0 !== n && Jo(n) || (n = "");
|
|
3114
3160
|
for (let r of Object.keys(e)) {
|
|
3115
3161
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
3116
3162
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -3119,10 +3165,10 @@
|
|
|
3119
3165
|
r,
|
|
3120
3166
|
e[r],
|
|
3121
3167
|
n
|
|
3122
|
-
]),
|
|
3168
|
+
]), Bo(e[r]) && Ml(e[r], t, n), n = n.slice(0, -o.length);
|
|
3123
3169
|
}
|
|
3124
3170
|
}
|
|
3125
|
-
function
|
|
3171
|
+
function Gl(e, t, n, r) {
|
|
3126
3172
|
if (!e) return null;
|
|
3127
3173
|
let o, l = e.length;
|
|
3128
3174
|
for (o = 0; o < l; o++) {
|
|
@@ -3130,15 +3176,15 @@
|
|
|
3130
3176
|
if (l) {
|
|
3131
3177
|
let e = l.id;
|
|
3132
3178
|
if (e && e === n) return l;
|
|
3133
|
-
if (r &&
|
|
3134
|
-
let e =
|
|
3179
|
+
if (r && ll(l, t)) {
|
|
3180
|
+
let e = Gl(l[t], t, n, r);
|
|
3135
3181
|
if (e) return e;
|
|
3136
3182
|
}
|
|
3137
3183
|
}
|
|
3138
3184
|
}
|
|
3139
3185
|
return null;
|
|
3140
3186
|
}
|
|
3141
|
-
function
|
|
3187
|
+
function Vl(e) {
|
|
3142
3188
|
function t(e) {
|
|
3143
3189
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
3144
3190
|
switch (t.length % 4) {
|
|
@@ -3169,10 +3215,10 @@
|
|
|
3169
3215
|
signature: t(n[2])
|
|
3170
3216
|
};
|
|
3171
3217
|
}
|
|
3172
|
-
function
|
|
3218
|
+
function Wl(e) {
|
|
3173
3219
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3174
3220
|
}
|
|
3175
|
-
var
|
|
3221
|
+
var xl = class {
|
|
3176
3222
|
constructor(e) {
|
|
3177
3223
|
this.html = e, Object.freeze(this);
|
|
3178
3224
|
}
|
|
@@ -3180,15 +3226,15 @@
|
|
|
3180
3226
|
return this.html;
|
|
3181
3227
|
}
|
|
3182
3228
|
};
|
|
3183
|
-
function xl(e) {
|
|
3184
|
-
return e instanceof Wl;
|
|
3185
|
-
}
|
|
3186
3229
|
function Kl(e) {
|
|
3230
|
+
return e instanceof xl;
|
|
3231
|
+
}
|
|
3232
|
+
function Bl(e) {
|
|
3187
3233
|
const t = document.createElement("template");
|
|
3188
3234
|
return t.innerHTML = e.html.trim(), t.content;
|
|
3189
3235
|
}
|
|
3190
|
-
var
|
|
3191
|
-
function
|
|
3236
|
+
var Yl = !1, Jl = /* @__PURE__ */ new Set();
|
|
3237
|
+
function ql(e) {
|
|
3192
3238
|
const t = document.createElement("template");
|
|
3193
3239
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
3194
3240
|
}
|
|
@@ -3196,41 +3242,52 @@
|
|
|
3196
3242
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), o = e.getTimezoneOffset();
|
|
3197
3243
|
return `${n}.${r}${o > 0 ? "-" : "+"}${t(Math.floor(Math.abs(o) / 60), 2)}${t(Math.abs(o) % 60, 2)}`;
|
|
3198
3244
|
}
|
|
3199
|
-
function
|
|
3245
|
+
function zl(e, t) {
|
|
3200
3246
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
3201
3247
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
3202
3248
|
return -1;
|
|
3203
3249
|
}
|
|
3204
|
-
function
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3250
|
+
function Ql() {
|
|
3251
|
+
const e = "undefined" != typeof window && window.crypto || globalThis.crypto;
|
|
3252
|
+
if (e && "function" == typeof e.randomUUID) return e.randomUUID();
|
|
3253
|
+
const t = /* @__PURE__ */ new Uint8Array(16);
|
|
3254
|
+
if (e && "function" == typeof e.getRandomValues) e.getRandomValues(t);
|
|
3255
|
+
else for (let e = 0; e < t.length; e++) t[e] = Math.floor(256 * Math.random());
|
|
3256
|
+
t[6] = 15 & t[6] | 64, t[8] = 63 & t[8] | 128;
|
|
3257
|
+
const n = Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
3258
|
+
return `${n.slice(0, 8)}-${n.slice(8, 12)}-${n.slice(12, 16)}-${n.slice(16, 20)}-${n.slice(20)}`;
|
|
3259
|
+
}
|
|
3260
|
+
var Xl = null, Zl = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
3261
|
+
function ei() {
|
|
3262
|
+
if (Xl) return Xl;
|
|
3263
|
+
const e = jl();
|
|
3264
|
+
if (!e) return Xl = Ql();
|
|
3265
|
+
let t = null;
|
|
3266
|
+
try {
|
|
3267
|
+
t = e.getItem("host_uuid");
|
|
3268
|
+
} catch (e) {
|
|
3269
|
+
return Sl("host_uuid", "node_uuid(): localStorage cannot be read (storage blocked?): a uuid of this page only"), Xl = Ql();
|
|
3270
|
+
}
|
|
3271
|
+
if (t && !Zl.test(t) && (sr("node_uuid(): the stored host_uuid is not a uuid: a new one replaces it"), t = null), !t) {
|
|
3272
|
+
t = Ql();
|
|
3208
3273
|
try {
|
|
3209
|
-
e
|
|
3210
|
-
} catch (
|
|
3211
|
-
|
|
3212
|
-
}
|
|
3213
|
-
if (!e && window.crypto?.randomUUID) {
|
|
3214
|
-
e = window.crypto.randomUUID();
|
|
3215
|
-
try {
|
|
3216
|
-
t.setItem("host_uuid", e);
|
|
3217
|
-
} catch (e) {
|
|
3218
|
-
Ol("host_uuid", "node_uuid(): localStorage cannot be written (storage full or blocked?): a uuid of this page only");
|
|
3219
|
-
}
|
|
3274
|
+
e.setItem("host_uuid", t);
|
|
3275
|
+
} catch (e) {
|
|
3276
|
+
Sl("host_uuid", "node_uuid(): localStorage cannot be written (storage full or blocked?): a uuid of this page only");
|
|
3220
3277
|
}
|
|
3221
|
-
}
|
|
3222
|
-
return
|
|
3278
|
+
}
|
|
3279
|
+
return Xl = t;
|
|
3223
3280
|
}
|
|
3224
|
-
function
|
|
3281
|
+
function ti(e) {
|
|
3225
3282
|
let t = null;
|
|
3226
3283
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
3227
3284
|
}
|
|
3228
|
-
var
|
|
3229
|
-
function
|
|
3285
|
+
var ni = 256, ri = 1e5;
|
|
3286
|
+
function oi(e) {
|
|
3230
3287
|
const t = String(e).replace(/`/g, "``");
|
|
3231
3288
|
return "[" === t[0] ? "[" + t : t;
|
|
3232
3289
|
}
|
|
3233
|
-
function
|
|
3290
|
+
function li(e) {
|
|
3234
3291
|
if ("string" != typeof e) return null;
|
|
3235
3292
|
let t = [], n = "";
|
|
3236
3293
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -3251,14 +3308,14 @@
|
|
|
3251
3308
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
3252
3309
|
});
|
|
3253
3310
|
}
|
|
3254
|
-
function
|
|
3311
|
+
function ii(e, t) {
|
|
3255
3312
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
3256
3313
|
}
|
|
3257
|
-
function
|
|
3314
|
+
function si(e) {
|
|
3258
3315
|
return "persistent-attrs-" + kt(e);
|
|
3259
3316
|
}
|
|
3260
|
-
function
|
|
3261
|
-
if (
|
|
3317
|
+
function ai(e, t) {
|
|
3318
|
+
if (Jo(t)) {
|
|
3262
3319
|
if (-1 === t.indexOf("^")) {
|
|
3263
3320
|
let n, r, o = e.fkey;
|
|
3264
3321
|
if (1 !== Vo(o)) return ir("bad fkey 1"), ir(e), ir(t), null;
|
|
@@ -3281,13 +3338,13 @@
|
|
|
3281
3338
|
};
|
|
3282
3339
|
}
|
|
3283
3340
|
}
|
|
3284
|
-
return
|
|
3341
|
+
return Bo(t) ? {
|
|
3285
3342
|
topic_name: t.topic_name,
|
|
3286
3343
|
id: t.id,
|
|
3287
3344
|
hook_name: t.hook_name
|
|
3288
3345
|
} : (ir("bad fkey 3"), ir(e), ir(t), null);
|
|
3289
3346
|
}
|
|
3290
|
-
var
|
|
3347
|
+
var ui = [
|
|
3291
3348
|
"string",
|
|
3292
3349
|
"integer",
|
|
3293
3350
|
"object",
|
|
@@ -3297,7 +3354,7 @@
|
|
|
3297
3354
|
"real",
|
|
3298
3355
|
"boolean",
|
|
3299
3356
|
"blob"
|
|
3300
|
-
],
|
|
3357
|
+
], _i = [
|
|
3301
3358
|
"persistent",
|
|
3302
3359
|
"required",
|
|
3303
3360
|
"notnull",
|
|
@@ -3309,7 +3366,7 @@
|
|
|
3309
3366
|
"stats",
|
|
3310
3367
|
"rstats",
|
|
3311
3368
|
"pstats"
|
|
3312
|
-
],
|
|
3369
|
+
], ci = [
|
|
3313
3370
|
"hook",
|
|
3314
3371
|
"fkey",
|
|
3315
3372
|
"enum",
|
|
@@ -3338,7 +3395,7 @@
|
|
|
3338
3395
|
"coordinates",
|
|
3339
3396
|
"gbuffer"
|
|
3340
3397
|
];
|
|
3341
|
-
function
|
|
3398
|
+
function fi(e) {
|
|
3342
3399
|
let t = {
|
|
3343
3400
|
name: e.id,
|
|
3344
3401
|
header: e.header,
|
|
@@ -3357,7 +3414,7 @@
|
|
|
3357
3414
|
if (!e.flag) return t;
|
|
3358
3415
|
for (let n = 0; n < e.flag.length; n++) {
|
|
3359
3416
|
let r = e.flag[n];
|
|
3360
|
-
if (
|
|
3417
|
+
if (kl(ci, r)) {
|
|
3361
3418
|
switch (r) {
|
|
3362
3419
|
case "enum":
|
|
3363
3420
|
t.enum_list = e.enum;
|
|
@@ -3371,7 +3428,7 @@
|
|
|
3371
3428
|
case "file": t.is_file = !0;
|
|
3372
3429
|
}
|
|
3373
3430
|
t.type = r;
|
|
3374
|
-
} else if (
|
|
3431
|
+
} else if (kl(_i, r)) switch (r) {
|
|
3375
3432
|
case "writable":
|
|
3376
3433
|
t.is_writable = !0;
|
|
3377
3434
|
break;
|
|
@@ -3384,23 +3441,23 @@
|
|
|
3384
3441
|
}
|
|
3385
3442
|
return t.is_file && (t.type = "file"), t;
|
|
3386
3443
|
}
|
|
3387
|
-
var
|
|
3444
|
+
var gi = [
|
|
3388
3445
|
k(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
3389
3446
|
k(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
3390
3447
|
k(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
3391
3448
|
D()
|
|
3392
|
-
],
|
|
3449
|
+
], di = {
|
|
3393
3450
|
periodic: !1,
|
|
3394
3451
|
msec: 0,
|
|
3395
3452
|
timer_id: -1
|
|
3396
|
-
},
|
|
3397
|
-
function
|
|
3453
|
+
}, bi = null;
|
|
3454
|
+
function pi(e, t, n, r) {
|
|
3398
3455
|
let o = e.priv, l = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
3399
3456
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
3400
3457
|
jn(e, "EV_TIMEOUT", {}, e);
|
|
3401
3458
|
}, o.msec) : o.timer_id = -1, Ln(e, l, {}), o.periodic || -1 !== o.timer_id || Tt(e) && mt(e), 0;
|
|
3402
3459
|
}
|
|
3403
|
-
var
|
|
3460
|
+
var mi = {
|
|
3404
3461
|
mt_create: function(e) {
|
|
3405
3462
|
let t = e.priv, n = nn(e, "subscriber");
|
|
3406
3463
|
n ? kn(e, null, {}, n) : Lt(e) && (n = It(e), kn(e, null, {}, n)), t.periodic = Zt(e, "periodic"), t.msec = en(e, "msec");
|
|
@@ -3424,19 +3481,19 @@
|
|
|
3424
3481
|
},
|
|
3425
3482
|
mt_destroy: function(e) {}
|
|
3426
3483
|
};
|
|
3427
|
-
function
|
|
3484
|
+
function hi(e) {
|
|
3428
3485
|
return "number" == typeof e && Number.isFinite(e) ? Math.round(e) : e;
|
|
3429
3486
|
}
|
|
3430
|
-
function
|
|
3431
|
-
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !1), void un(e, "msec",
|
|
3487
|
+
function yi(e, t) {
|
|
3488
|
+
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !1), void un(e, "msec", hi(t))) : (ir("not GObj TYPE"), -1);
|
|
3432
3489
|
}
|
|
3433
|
-
function
|
|
3434
|
-
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !0), void un(e, "msec",
|
|
3490
|
+
function vi(e, t) {
|
|
3491
|
+
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !0), void un(e, "msec", hi(t))) : (ir("not GObj TYPE"), -1);
|
|
3435
3492
|
}
|
|
3436
|
-
function
|
|
3493
|
+
function Ei(e) {
|
|
3437
3494
|
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : void un(e, "msec", -1) : (ir("not GObj TYPE"), -1);
|
|
3438
3495
|
}
|
|
3439
|
-
var
|
|
3496
|
+
var Ti = [
|
|
3440
3497
|
k(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
3441
3498
|
k(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
3442
3499
|
k(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -3450,78 +3507,78 @@
|
|
|
3450
3507
|
k(E.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
3451
3508
|
k(E.DTP_STRING, "yuneta_version", 0, i, "Yuneta version"),
|
|
3452
3509
|
k(E.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
3453
|
-
k(E.DTP_DICT, "trace_levels",
|
|
3454
|
-
k(E.DTP_DICT, "no_trace_levels",
|
|
3510
|
+
k(E.DTP_DICT, "trace_levels", R.SDF_PERSIST, "{}", "Trace levels"),
|
|
3511
|
+
k(E.DTP_DICT, "no_trace_levels", R.SDF_PERSIST, "{}", "No trace levels"),
|
|
3455
3512
|
k(E.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
3456
3513
|
k(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
3457
3514
|
k(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
3458
3515
|
D()
|
|
3459
|
-
],
|
|
3460
|
-
function
|
|
3516
|
+
], ji = { gobj_timer: null }, Oi = null;
|
|
3517
|
+
function Si(e, t, n, r) {
|
|
3461
3518
|
let o = Qt(e, t);
|
|
3462
|
-
return
|
|
3519
|
+
return Bo(o) || (o = {}), o[n] = r, rn(e, t, o), it(e, t);
|
|
3463
3520
|
}
|
|
3464
|
-
var
|
|
3465
|
-
function
|
|
3521
|
+
var wi = -2147483648, Ni = 2147483647;
|
|
3522
|
+
function $i(e) {
|
|
3466
3523
|
if (!0 === e || !1 === e) return e;
|
|
3467
|
-
if ("number" == typeof e) return !Number.isInteger(e) || e <
|
|
3524
|
+
if ("number" == typeof e) return !Number.isInteger(e) || e < wi || e > Ni ? null : 0 !== e;
|
|
3468
3525
|
if ("string" != typeof e || "" === e) return null;
|
|
3469
3526
|
let t = e.toLowerCase();
|
|
3470
3527
|
if ("set" === t) return !0;
|
|
3471
3528
|
if ("reset" === t) return !1;
|
|
3472
3529
|
if (/^-?(0|[1-9][0-9]*)$/.test(e)) {
|
|
3473
3530
|
let t = Number(e);
|
|
3474
|
-
return t <
|
|
3531
|
+
return t < wi || t > Ni ? null : 0 !== t;
|
|
3475
3532
|
}
|
|
3476
3533
|
return "true" === t || "yes" === t || "on" === t || "false" !== t && "no" !== t && "off" !== t && null;
|
|
3477
3534
|
}
|
|
3478
|
-
function
|
|
3535
|
+
function Ri() {
|
|
3479
3536
|
return `${$t()}^${Nt()}`;
|
|
3480
3537
|
}
|
|
3481
|
-
function
|
|
3538
|
+
function Ai(e, t, n, r) {
|
|
3482
3539
|
return Ln(e, t, n), 0;
|
|
3483
3540
|
}
|
|
3484
|
-
var
|
|
3541
|
+
var Di = {
|
|
3485
3542
|
mt_create: function(e) {
|
|
3486
3543
|
let t = e.priv;
|
|
3487
|
-
_n(e, "start_date", Hl()), _n(e, "node_uuid",
|
|
3544
|
+
_n(e, "start_date", Hl()), _n(e, "node_uuid", ei()), e.priv.gobj_timer = _t(At(e), "C_TIMER", {}, e), t.periodic_timeout = Qt(e, "periodic_timeout"), function(e) {
|
|
3488
3545
|
let t = Qt(e, "trace_levels");
|
|
3489
|
-
if (!
|
|
3546
|
+
if (!Bo(t)) return 0;
|
|
3490
3547
|
let n = t.__global_trace__;
|
|
3491
|
-
if (
|
|
3548
|
+
if (Yo(n)) {
|
|
3492
3549
|
ae(4294967295, !1);
|
|
3493
3550
|
for (let e of n) ie(e, !0);
|
|
3494
3551
|
}
|
|
3495
3552
|
for (const [n, r] of Object.entries(t)) {
|
|
3496
3553
|
let t = et(n);
|
|
3497
|
-
if (t) if (
|
|
3554
|
+
if (t) if (Yo(r)) {
|
|
3498
3555
|
be(t, null, !1);
|
|
3499
3556
|
for (let e of r) be(t, e, !0);
|
|
3500
|
-
} else ir(`${
|
|
3557
|
+
} else ir(`${At(e)}: trace_levels of ${n} MUST be a list`);
|
|
3501
3558
|
}
|
|
3502
3559
|
}(e), function(e) {
|
|
3503
3560
|
let t = Qt(e, "no_trace_levels");
|
|
3504
|
-
if (!
|
|
3561
|
+
if (!Bo(t)) return 0;
|
|
3505
3562
|
let n = t.__global_no_trace__;
|
|
3506
|
-
if (
|
|
3563
|
+
if (Yo(n)) {
|
|
3507
3564
|
ue(4294967295, !1);
|
|
3508
3565
|
for (let e of n) se(e, !0);
|
|
3509
3566
|
}
|
|
3510
3567
|
for (const [n, r] of Object.entries(t)) {
|
|
3511
3568
|
let t = et(n);
|
|
3512
|
-
if (t) if (
|
|
3569
|
+
if (t) if (Yo(r)) {
|
|
3513
3570
|
pe(t, null, !1);
|
|
3514
3571
|
for (let e of r) pe(t, e, !0);
|
|
3515
|
-
} else ir(`${
|
|
3572
|
+
} else ir(`${At(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
3516
3573
|
}
|
|
3517
3574
|
}(e);
|
|
3518
3575
|
},
|
|
3519
3576
|
mt_writing: function(e, t) {},
|
|
3520
3577
|
mt_start: function(e) {
|
|
3521
|
-
return
|
|
3578
|
+
return vi(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
3522
3579
|
},
|
|
3523
3580
|
mt_stop: function(e) {
|
|
3524
|
-
return
|
|
3581
|
+
return Ei(e.priv.gobj_timer), yt(e), 0;
|
|
3525
3582
|
},
|
|
3526
3583
|
mt_destroy: function(e) {},
|
|
3527
3584
|
mt_play: function(e) {
|
|
@@ -3538,49 +3595,49 @@
|
|
|
3538
3595
|
case "get-global-no-trace": return o(0, 0, null, null, ce());
|
|
3539
3596
|
case "set-global-trace":
|
|
3540
3597
|
case "set-global-no-trace": {
|
|
3541
|
-
let r = "set-global-no-trace" === t, l = n.level, i =
|
|
3542
|
-
return l ? null === i ? o(0, -1, `${
|
|
3598
|
+
let r = "set-global-no-trace" === t, l = n.level, i = $i(n.set);
|
|
3599
|
+
return l ? null === i ? o(0, -1, `${Ri()}: bitmask set or re-set?`, null, null) : (r ? se(l, i) : ie(l, i)) < 0 ? o(0, -1, `${Ri()}: global trace level not found: ${l}`, null, null) : r ? (Si(e, "no_trace_levels", "__global_no_trace__", ce()), o(0, 0, null, null, ce())) : (Si(e, "trace_levels", "__global_trace__", _e()), o(0, 0, null, null, _e())) : o(0, -1, `${Ri()}: what level?`, null, null);
|
|
3543
3600
|
}
|
|
3544
3601
|
case "get-gclass-trace":
|
|
3545
3602
|
case "get-gclass-no-trace":
|
|
3546
3603
|
case "set-gclass-trace":
|
|
3547
3604
|
case "set-gclass-no-trace": {
|
|
3548
3605
|
let r = t.indexOf("no-trace") >= 0, l = n.gclass_name || n.gclass || "", i = et(l);
|
|
3549
|
-
if (!i) return o(0, -1, `${
|
|
3606
|
+
if (!i) return o(0, -1, `${Ri()}: what gclass is '${l}'?`, null, null);
|
|
3550
3607
|
if (0 === t.indexOf("get-")) return o(0, 0, null, null, r ? de(i) : fe(i));
|
|
3551
|
-
let s = n.level, a =
|
|
3552
|
-
return s ? null === a ? o(0, -1, `${
|
|
3608
|
+
let s = n.level, a = $i(n.set);
|
|
3609
|
+
return s ? null === a ? o(0, -1, `${Ri()}: bitmask set or re-set?`, null, null) : (r ? pe(i, s, a) : be(i, s, a)) < 0 ? o(0, -1, `${Ri()}: trace level of ${l} not found: ${s}`, null, null) : r ? (Si(e, "no_trace_levels", l, de(i)), o(0, 0, null, null, de(i))) : (Si(e, "trace_levels", l, ge(i)), o(0, 0, null, null, fe(i))) : o(0, -1, `${Ri()}: what level?`, null, null);
|
|
3553
3610
|
}
|
|
3554
|
-
default: return o(0, -1, `${
|
|
3611
|
+
default: return o(0, -1, `${Ri()}: command not available: ${t}`, null, null);
|
|
3555
3612
|
}
|
|
3556
3613
|
}
|
|
3557
3614
|
};
|
|
3558
|
-
var
|
|
3559
|
-
k(E.DTP_STRING, "wanted_yuno_role",
|
|
3560
|
-
k(E.DTP_STRING, "wanted_yuno_name",
|
|
3561
|
-
k(E.DTP_STRING, "wanted_yuno_service",
|
|
3562
|
-
k(E.DTP_STRING, "remote_yuno_role",
|
|
3563
|
-
k(E.DTP_STRING, "remote_yuno_name",
|
|
3564
|
-
k(E.DTP_STRING, "remote_yuno_service",
|
|
3565
|
-
k(E.DTP_STRING, "url",
|
|
3566
|
-
k(E.DTP_STRING, "jwt",
|
|
3567
|
-
k(E.DTP_STRING, "cert_pem",
|
|
3568
|
-
k(E.DTP_JSON, "extra_info",
|
|
3569
|
-
k(E.DTP_LIST, "required_services",
|
|
3570
|
-
k(E.DTP_INTEGER, "timeout_retry",
|
|
3571
|
-
k(E.DTP_INTEGER, "timeout_retry_max",
|
|
3572
|
-
k(E.DTP_INTEGER, "timeout_idack",
|
|
3615
|
+
var ki = "ievent_gate_stack", Ci = [
|
|
3616
|
+
k(E.DTP_STRING, "wanted_yuno_role", R.SDF_RD, "", "wanted yuno role"),
|
|
3617
|
+
k(E.DTP_STRING, "wanted_yuno_name", R.SDF_RD, "", "wanted yuno name"),
|
|
3618
|
+
k(E.DTP_STRING, "wanted_yuno_service", R.SDF_RD, "", "wanted yuno service"),
|
|
3619
|
+
k(E.DTP_STRING, "remote_yuno_role", R.SDF_RD, "", "confirmed remote yuno role"),
|
|
3620
|
+
k(E.DTP_STRING, "remote_yuno_name", R.SDF_RD, "", "confirmed remote yuno name"),
|
|
3621
|
+
k(E.DTP_STRING, "remote_yuno_service", R.SDF_RD, "", "confirmed remote yuno service"),
|
|
3622
|
+
k(E.DTP_STRING, "url", R.SDF_RD, "", "Url to connect"),
|
|
3623
|
+
k(E.DTP_STRING, "jwt", R.SDF_PERSIST, "", "JWT"),
|
|
3624
|
+
k(E.DTP_STRING, "cert_pem", R.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
3625
|
+
k(E.DTP_JSON, "extra_info", R.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
3626
|
+
k(E.DTP_LIST, "required_services", R.SDF_RD, "[]", "Services this LINK requires (identity card). Empty = the yuno's `required_services`, as before. A yuno with several links to DIFFERENT backends must set it per link: the yuno-wide list is the union, so every backend is told the service names of all the others."),
|
|
3627
|
+
k(E.DTP_INTEGER, "timeout_retry", R.SDF_RD, "5000", "Base of the first reconnect delay (ms, ±20% jitter), at least 1000. It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
3628
|
+
k(E.DTP_INTEGER, "timeout_retry_max", R.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
3629
|
+
k(E.DTP_INTEGER, "timeout_idack", R.SDF_RD, "5000", "timeout waiting idAck"),
|
|
3573
3630
|
k(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
3574
3631
|
D()
|
|
3575
|
-
],
|
|
3632
|
+
], Ii = [
|
|
3576
3633
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
3577
3634
|
["ievents2", "Trace inter-events with full kw"],
|
|
3578
3635
|
["identity-card", "Trace identity_card messages"]
|
|
3579
3636
|
];
|
|
3580
|
-
function
|
|
3637
|
+
function Pi(e) {
|
|
3581
3638
|
return !!(3 & X(e));
|
|
3582
3639
|
}
|
|
3583
|
-
var
|
|
3640
|
+
var Li = {
|
|
3584
3641
|
url: null,
|
|
3585
3642
|
remote_yuno_name: null,
|
|
3586
3643
|
remote_yuno_role: null,
|
|
@@ -3593,8 +3650,8 @@
|
|
|
3593
3650
|
retry_ms_before_session: 0,
|
|
3594
3651
|
session_since: 0,
|
|
3595
3652
|
retry_floor_warned: !1
|
|
3596
|
-
},
|
|
3597
|
-
function
|
|
3653
|
+
}, Ui = null;
|
|
3654
|
+
function Fi(e) {
|
|
3598
3655
|
e.priv.websocket && ir("Websocket ALREADY setup");
|
|
3599
3656
|
const t = tn(e, "url");
|
|
3600
3657
|
ar(`====> Starting WebSocket to '${t}' (${kt(e)})`);
|
|
@@ -3609,7 +3666,7 @@
|
|
|
3609
3666
|
code: 1006,
|
|
3610
3667
|
reason: r.message,
|
|
3611
3668
|
was_clean: !1
|
|
3612
|
-
}, e) < 0 &&
|
|
3669
|
+
}, e) < 0 && yi(e.priv.gobj_timer, es(e)), null;
|
|
3613
3670
|
}
|
|
3614
3671
|
return r ? (r.onopen = () => {
|
|
3615
3672
|
n !== e.priv.ws_seq || Ut(e) || jn(e, "EV_ON_OPEN", {
|
|
@@ -3631,7 +3688,7 @@
|
|
|
3631
3688
|
}, e));
|
|
3632
3689
|
}, r) : (ir(`${kt(e)}: Failed to initialize WebSocket.`), null);
|
|
3633
3690
|
}
|
|
3634
|
-
function
|
|
3691
|
+
function Mi(e, t = 1e3, n = "") {
|
|
3635
3692
|
let r = e.priv, o = r.websocket;
|
|
3636
3693
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
3637
3694
|
ar(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
@@ -3642,12 +3699,12 @@
|
|
|
3642
3699
|
}
|
|
3643
3700
|
} else sr("WebSocket is already closed or in the process of closing.");
|
|
3644
3701
|
}
|
|
3645
|
-
function
|
|
3702
|
+
function Gi(e, t) {
|
|
3646
3703
|
let n = e.priv;
|
|
3647
|
-
"ST_SESSION" === fn(e) && (performance.now() - n.session_since <
|
|
3704
|
+
"ST_SESSION" === fn(e) && (performance.now() - n.session_since < Zi(e).max && (n.retry_ms = n.retry_ms_before_session), n.retry_ms_before_session = 0), Mi(e, 4002, t);
|
|
3648
3705
|
}
|
|
3649
|
-
var
|
|
3650
|
-
function
|
|
3706
|
+
var Vi = 128;
|
|
3707
|
+
function Wi(e, t) {
|
|
3651
3708
|
let n = String(e), r = To(n);
|
|
3652
3709
|
if (null !== r && (n = r), n.length > t) {
|
|
3653
3710
|
let e = t, r = n.charCodeAt(e);
|
|
@@ -3655,7 +3712,7 @@
|
|
|
3655
3712
|
}
|
|
3656
3713
|
return n;
|
|
3657
3714
|
}
|
|
3658
|
-
function
|
|
3715
|
+
function xi(e, t, n) {
|
|
3659
3716
|
let r = Hl();
|
|
3660
3717
|
try {
|
|
3661
3718
|
ar("\n" + r + " " + t + "\n"), $o(n);
|
|
@@ -3663,17 +3720,17 @@
|
|
|
3663
3720
|
ar("ERROR in trace_inter_event: " + e);
|
|
3664
3721
|
}
|
|
3665
3722
|
}
|
|
3666
|
-
var
|
|
3723
|
+
var Ki = class {
|
|
3667
3724
|
constructor(e, t) {
|
|
3668
3725
|
this.event = e, this.kw = t || {};
|
|
3669
3726
|
}
|
|
3670
3727
|
};
|
|
3671
|
-
function
|
|
3728
|
+
function Bi(e, t, n, r) {
|
|
3672
3729
|
return function(e, t) {
|
|
3673
3730
|
let n = e.priv, r = JSON.stringify(t);
|
|
3674
|
-
if (
|
|
3675
|
-
let n = tn(e, "url"), o =
|
|
3676
|
-
l ? l(o, t, 1, r.length) :
|
|
3731
|
+
if (Pi(e)) {
|
|
3732
|
+
let n = tn(e, "url"), o = At(wt()) + " ==> " + n, l = Qt(wt(), "trace_ievent_callback");
|
|
3733
|
+
l ? l(o, t, 1, r.length) : xi(0, o, t);
|
|
3677
3734
|
}
|
|
3678
3735
|
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return sr(`${kt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
3679
3736
|
try {
|
|
@@ -3683,26 +3740,26 @@
|
|
|
3683
3740
|
}
|
|
3684
3741
|
return 0;
|
|
3685
3742
|
}(e, function(e, t) {
|
|
3686
|
-
return
|
|
3743
|
+
return Zo(e) ? (ir("iev_create() event NULL"), null) : new Ki(e, t);
|
|
3687
3744
|
}(t, n));
|
|
3688
3745
|
}
|
|
3689
|
-
function
|
|
3690
|
-
return
|
|
3746
|
+
function Yi(e, t, n) {
|
|
3747
|
+
return Zo(n) && (n = tn(e, "wanted_yuno_service")), {
|
|
3691
3748
|
dst_yuno: tn(e, "wanted_yuno_name"),
|
|
3692
3749
|
dst_role: tn(e, "wanted_yuno_role"),
|
|
3693
3750
|
dst_service: n,
|
|
3694
3751
|
src_yuno: Nt(),
|
|
3695
3752
|
src_role: $t(),
|
|
3696
3753
|
src_service: t,
|
|
3697
|
-
host:
|
|
3754
|
+
host: ei()
|
|
3698
3755
|
};
|
|
3699
3756
|
}
|
|
3700
|
-
function
|
|
3757
|
+
function Ji(e) {
|
|
3701
3758
|
let t = e.priv, n = St(wt()), r = tn(wt(), "yuno_version"), o = tn(wt(), "yuno_release"), l = tn(wt(), "yuno_tag"), s = Qt(e, "required_services");
|
|
3702
3759
|
s && s.length || (s = Qt(wt(), "required_services"));
|
|
3703
3760
|
let a = {
|
|
3704
3761
|
yuno_role: $t(),
|
|
3705
|
-
yuno_id:
|
|
3762
|
+
yuno_id: Rt(),
|
|
3706
3763
|
yuno_name: Nt(),
|
|
3707
3764
|
yuno_tag: l,
|
|
3708
3765
|
yuno_version: r,
|
|
@@ -3715,32 +3772,32 @@
|
|
|
3715
3772
|
username: tn(wt(), "__username__"),
|
|
3716
3773
|
launch_id: 0,
|
|
3717
3774
|
yuno_startdate: tn(wt(), "start_date"),
|
|
3718
|
-
id:
|
|
3775
|
+
id: ei(),
|
|
3719
3776
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
3720
3777
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
3721
3778
|
required_services: s
|
|
3722
3779
|
};
|
|
3723
|
-
return
|
|
3780
|
+
return Pl(e, a, ki, Yi(e, At(It(e)), null)), Ul(e, a, "__identity__"), yi(t.gobj_timer, en(e, "timeout_idack")), Bi(e, "EV_IDENTITY_CARD", a);
|
|
3724
3781
|
}
|
|
3725
|
-
function
|
|
3726
|
-
if (
|
|
3782
|
+
function qi(e, t) {
|
|
3783
|
+
if (Zo(t.event)) return -1;
|
|
3727
3784
|
let n = {}, r = t.__global__, o = t.__config__, l = t.__filter__, i = t.__service__, s = t.subscriber;
|
|
3728
3785
|
o && (n.__config__ = o), r && (n.__global__ = r), l && (n.__filter__ = l);
|
|
3729
|
-
return
|
|
3786
|
+
return Pl(e, n, ki, Yi(e, At(s), i)), Ul(e, n, "__subscribing__"), Bi(e, t.event, n);
|
|
3730
3787
|
}
|
|
3731
|
-
function
|
|
3788
|
+
function Hi(e, t, n, r) {
|
|
3732
3789
|
let o = e.priv;
|
|
3733
|
-
return Tt(e) && (o.websocket =
|
|
3790
|
+
return Tt(e) && (o.websocket = Fi(e)), 0;
|
|
3734
3791
|
}
|
|
3735
|
-
function
|
|
3736
|
-
return ar("Websocket opened: " + e.priv.url),
|
|
3792
|
+
function zi(e, t, n, r) {
|
|
3793
|
+
return ar("Websocket opened: " + e.priv.url), Ji(e), 0;
|
|
3737
3794
|
}
|
|
3738
|
-
function
|
|
3795
|
+
function Qi(e, t, n, r) {
|
|
3739
3796
|
let o = e.priv, l = n.url;
|
|
3740
3797
|
if (void 0 !== n.ws_seq && n.ws_seq !== o.ws_seq) return 0;
|
|
3741
3798
|
Xn();
|
|
3742
|
-
const i =
|
|
3743
|
-
return
|
|
3799
|
+
const i = Wi(void 0 === n.reason ? "" : n.reason, 256);
|
|
3800
|
+
return Pi(e) && ur(`${kt(e)}: WebSocket closed ${l} (Code: ${n.code}, Reason: "${i}", Clean: ${n.was_clean})`), o.websocket && (o.websocket.onopen = null, o.websocket.onmessage = null, o.websocket.onerror = null, o.websocket.onclose = null, o.websocket = null), o.inform_on_close ? (o.inform_on_close = !1, (!n.was_clean || 1e3 !== n.code && 1001 !== n.code) && Tt(e) && sr(`${kt(e)}: session closed ${l} (Code: ${n.code}, Reason: "${i}", Clean: ${n.was_clean})`), Ln(e, "EV_ON_CLOSE", {
|
|
3744
3801
|
url: l,
|
|
3745
3802
|
remote_yuno_name: o.remote_yuno_name,
|
|
3746
3803
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -3756,33 +3813,33 @@
|
|
|
3756
3813
|
code: n.code,
|
|
3757
3814
|
reason: i,
|
|
3758
3815
|
was_clean: n.was_clean
|
|
3759
|
-
})), Tt(e) &&
|
|
3816
|
+
})), Tt(e) && yi(o.gobj_timer, es(e)), 0;
|
|
3760
3817
|
}
|
|
3761
|
-
var
|
|
3762
|
-
function
|
|
3818
|
+
var Xi = 1e3;
|
|
3819
|
+
function Zi(e) {
|
|
3763
3820
|
let t = e.priv, n = en(e, "timeout_retry"), r = en(e, "timeout_retry_max");
|
|
3764
|
-
return n >=
|
|
3821
|
+
return n >= Xi || (t.retry_floor_warned || (t.retry_floor_warned = !0, sr(`${kt(e)}: timeout_retry ${n} ms is below ${Xi} ms: ${Xi} ms is used`)), n = Xi), r >= n || (r = n), {
|
|
3765
3822
|
base: n,
|
|
3766
3823
|
max: r
|
|
3767
3824
|
};
|
|
3768
3825
|
}
|
|
3769
|
-
function
|
|
3826
|
+
function es(e) {
|
|
3770
3827
|
let t = e.priv;
|
|
3771
|
-
const { base: n, max: r } =
|
|
3828
|
+
const { base: n, max: r } = Zi(e);
|
|
3772
3829
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
3773
3830
|
let o = .2 * t.retry_ms, l = t.retry_ms - o + 2 * Math.random() * o;
|
|
3774
3831
|
return Math.max(1, Math.round(l));
|
|
3775
3832
|
}
|
|
3776
|
-
function
|
|
3777
|
-
return
|
|
3833
|
+
function ts(e, t, n, r) {
|
|
3834
|
+
return Ji(e), 0;
|
|
3778
3835
|
}
|
|
3779
|
-
function
|
|
3836
|
+
function ns(e, t, n, r) {
|
|
3780
3837
|
let o = e.priv;
|
|
3781
|
-
|
|
3782
|
-
let l =
|
|
3838
|
+
Ei(o.gobj_timer);
|
|
3839
|
+
let l = Ll(e, n, ki, !0), i = gl(e, l, "src_yuno", ""), s = gl(e, l, "src_role", ""), a = gl(e, l, "src_service", "");
|
|
3783
3840
|
_n(e, "remote_yuno_name", i), _n(e, "remote_yuno_role", s), _n(e, "remote_yuno_service", a);
|
|
3784
|
-
let u =
|
|
3785
|
-
if (u < 0)
|
|
3841
|
+
let u = fl(e, n, "result", -1, 0), _ = gl(e, n, "comment", "", 0), c = gl(e, n, "username", "", 0), f = pl(e, n, "services_roles", {});
|
|
3842
|
+
if (u < 0) Mi(e), Ln(e, "EV_ON_ID_NAK", {
|
|
3786
3843
|
url: tn(e, "url"),
|
|
3787
3844
|
result: u,
|
|
3788
3845
|
comment: _,
|
|
@@ -3799,11 +3856,11 @@
|
|
|
3799
3856
|
services_roles: f
|
|
3800
3857
|
})), o.inside_on_open = !1, function(e) {
|
|
3801
3858
|
let t = In(e, null, null, null);
|
|
3802
|
-
for (let n = 0; n < t.length; n++)
|
|
3859
|
+
for (let n = 0; n < t.length; n++) qi(e, t[n]);
|
|
3803
3860
|
}(e);
|
|
3804
3861
|
return 0;
|
|
3805
3862
|
}
|
|
3806
|
-
function
|
|
3863
|
+
function rs(e, t, n, r) {
|
|
3807
3864
|
let o = e.priv.url, l = function(e, t) {
|
|
3808
3865
|
let n;
|
|
3809
3866
|
try {
|
|
@@ -3822,52 +3879,52 @@
|
|
|
3822
3879
|
kw: o || {}
|
|
3823
3880
|
} : (sr(`${kt(e)}: parsing inter_event: kw not a json object`), null) : (sr(`${kt(e)}: parsing inter_kw: no kw`), null);
|
|
3824
3881
|
}(e, n.data);
|
|
3825
|
-
if (!l) return sr(`${kt(e)}: frame dropped from ${o}: ${
|
|
3826
|
-
if (
|
|
3827
|
-
let e =
|
|
3828
|
-
r ? r(e, l, 2, t) :
|
|
3882
|
+
if (!l) return sr(`${kt(e)}: frame dropped from ${o}: ${Wi(n.data, 256)}`), -1;
|
|
3883
|
+
if (Pi(e)) {
|
|
3884
|
+
let e = At(wt()) + " <== " + o, t = n.data.length, r = Qt(wt(), "trace_ievent_callback");
|
|
3885
|
+
r ? r(e, l, 2, t) : xi(0, e, l);
|
|
3829
3886
|
}
|
|
3830
3887
|
let i = l.event, s = l.kw;
|
|
3831
3888
|
if ("ST_SESSION" !== fn(e)) {
|
|
3832
3889
|
if ("ev_identity_card_ack" === String(i).toLowerCase()) {
|
|
3833
3890
|
if (!(jn(e, "EV_IDENTITY_CARD_ACK", s, e) < 0)) return 0;
|
|
3834
|
-
} else sr(`${kt(e)}: event UNKNOWN in not-session state ${
|
|
3835
|
-
return
|
|
3891
|
+
} else sr(`${kt(e)}: event UNKNOWN in not-session state ${Wi(i, Vi)}`);
|
|
3892
|
+
return Gi(e, "event out of session"), -1;
|
|
3836
3893
|
}
|
|
3837
3894
|
l = null;
|
|
3838
|
-
let a =
|
|
3839
|
-
if (!
|
|
3840
|
-
let c =
|
|
3841
|
-
if (!
|
|
3842
|
-
let f =
|
|
3843
|
-
if ("__subscribing__" === a) return sr(`${kt(e)}: subscription event ignored, I'm client (service: ${
|
|
3844
|
-
if ("__unsubscribing__" === a) return sr(`${kt(e)}: unsubscription event ignored, I'm client (service: ${
|
|
3895
|
+
let a = Fl(e, s), u = Ll(e, s, ki), _ = gl(e, u, "dst_role", "");
|
|
3896
|
+
if (!Zo(_) && _.toLowerCase() !== String($t()).toLowerCase()) return sr(`${kt(e)}: It's not my role, dst_role: ${Wi(_, Vi)}, my_role: ${$t()}, event: ${Wi(i, Vi)}`), Gi(e, "not my role"), -1;
|
|
3897
|
+
let c = gl(e, u, "dst_yuno", "");
|
|
3898
|
+
if (!Zo(c) && c.toLowerCase() !== String(Nt()).toLowerCase()) return sr(`${kt(e)}: It's not my name, dst_yuno: ${Wi(c, Vi)}, my_name: ${Nt()}, event: ${Wi(i, Vi)}`), Gi(e, "not my name"), -1;
|
|
3899
|
+
let f = gl(e, u, "dst_service", "");
|
|
3900
|
+
if ("__subscribing__" === a) return sr(`${kt(e)}: subscription event ignored, I'm client (service: ${Wi(f, Vi)}, event: ${Wi(i, Vi)})`), -1;
|
|
3901
|
+
if ("__unsubscribing__" === a) return sr(`${kt(e)}: unsubscription event ignored, I'm client (service: ${Wi(f, Vi)}, event: ${Wi(i, Vi)})`), -1;
|
|
3845
3902
|
const g = Sn(i, 0, !1);
|
|
3846
3903
|
if (g && dn(e, g.event_name, 0)) {
|
|
3847
3904
|
const t = g.event_name;
|
|
3848
|
-
return dn(e, t, F.EVF_PUBLIC_EVENT) && "EV_IDENTITY_CARD_ACK" !== t ? (jn(e, t, s, e), 0) : (sr(`${kt(e)}: event of the transport itself, or out of its place, DROPPED: ev '${
|
|
3905
|
+
return dn(e, t, F.EVF_PUBLIC_EVENT) && "EV_IDENTITY_CARD_ACK" !== t ? (jn(e, t, s, e), 0) : (sr(`${kt(e)}: event of the transport itself, or out of its place, DROPPED: ev '${Wi(i, Vi)}'`), -1);
|
|
3849
3906
|
}
|
|
3850
|
-
if (!
|
|
3907
|
+
if (!Zo(f)) {
|
|
3851
3908
|
let t = nt(f, !1);
|
|
3852
|
-
return t ? dn(t, i, F.EVF_PUBLIC_EVENT) ? (jn(t, i, s, e), 0) : (sr(`${kt(e)}: Service found but no event or not public, DROPPED: service '${kt(t)}', ev '${
|
|
3909
|
+
return t ? dn(t, i, F.EVF_PUBLIC_EVENT) ? (jn(t, i, s, e), 0) : (sr(`${kt(e)}: Service found but no event or not public, DROPPED: service '${kt(t)}', ev '${Wi(i, Vi)}'`), -1) : (sr(`${kt(e)}: event for a service that is gone, DROPPED: service '${Wi(f, Vi)}', ev '${Wi(i, Vi)}'`), 0);
|
|
3853
3910
|
}
|
|
3854
3911
|
let d = Sn(i, F.EVF_PUBLIC_EVENT, !1);
|
|
3855
|
-
return d ? (Ln(e, d.event_name, s), 0) : (sr(`${kt(e)}: event that no gclass declares public, DROPPED: ev '${
|
|
3912
|
+
return d ? (Ln(e, d.event_name, s), 0) : (sr(`${kt(e)}: event that no gclass declares public, DROPPED: ev '${Wi(i, Vi)}'`), -1);
|
|
3856
3913
|
}
|
|
3857
|
-
function
|
|
3914
|
+
function os(e, t, n, r) {
|
|
3858
3915
|
const o = n && "string" == typeof n[r] ? n[r] : "", l = n && "string" == typeof n.service ? n.service : "";
|
|
3859
|
-
return sr(`${kt(e)}: ${t} not served by this client, DROPPED: ${r.replace(/_/g, "")} '${
|
|
3916
|
+
return sr(`${kt(e)}: ${t} not served by this client, DROPPED: ${r.replace(/_/g, "")} '${Wi(o, Vi)}', service '${Wi(l, Vi)}'`), -1;
|
|
3860
3917
|
}
|
|
3861
|
-
function
|
|
3862
|
-
return
|
|
3918
|
+
function ls(e, t, n, r) {
|
|
3919
|
+
return os(e, t, n, "__stats__");
|
|
3863
3920
|
}
|
|
3864
|
-
function
|
|
3865
|
-
return
|
|
3921
|
+
function is(e, t, n, r) {
|
|
3922
|
+
return os(e, t, n, "__command__");
|
|
3866
3923
|
}
|
|
3867
|
-
var
|
|
3924
|
+
var ss = {
|
|
3868
3925
|
mt_create: function(e) {
|
|
3869
3926
|
let t = e.priv;
|
|
3870
|
-
t.gobj_timer = _t(
|
|
3927
|
+
t.gobj_timer = _t(At(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"), _n(e, "wanted_yuno_name", t.remote_yuno_name), _n(e, "wanted_yuno_role", t.remote_yuno_role), _n(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
3871
3928
|
let n = nn(e, "subscriber");
|
|
3872
3929
|
n ? kn(e, null, {}, n) : Lt(e) && (n = It(e), kn(e, null, {}, n));
|
|
3873
3930
|
},
|
|
@@ -3894,55 +3951,55 @@
|
|
|
3894
3951
|
code: 1e3,
|
|
3895
3952
|
reason: "restarted",
|
|
3896
3953
|
was_clean: !0
|
|
3897
|
-
}, e),
|
|
3954
|
+
}, e), Ei(t.gobj_timer)), t.websocket = Fi(e), 0;
|
|
3898
3955
|
},
|
|
3899
3956
|
mt_stop: function(e) {
|
|
3900
3957
|
let t = e.priv;
|
|
3901
|
-
return
|
|
3958
|
+
return Ei(t.gobj_timer), t.websocket && Mi(e), 0;
|
|
3902
3959
|
},
|
|
3903
3960
|
mt_destroy: function(e) {},
|
|
3904
3961
|
mt_stats: function(e, t, n, r) {
|
|
3905
3962
|
if ("ST_SESSION" !== fn(e)) return ir("Not in session"), null;
|
|
3906
3963
|
n || (n = {});
|
|
3907
|
-
let o =
|
|
3908
|
-
return l || (l = {}),
|
|
3964
|
+
let o = Yi(e, At(r), gl(e, n, "service", null, 0)), l = pl(e, n, "__md_stats__", null, Un.KW_EXTRACT);
|
|
3965
|
+
return l || (l = {}), Pl(e, n, "stats_stack", {
|
|
3909
3966
|
stats: t,
|
|
3910
3967
|
kw: l
|
|
3911
|
-
}),
|
|
3968
|
+
}), Pl(e, n, ki, o), n.__stats__ = t, Ul(e, n, "__stats__"), Bi(e, "EV_MT_STATS", n, r), null;
|
|
3912
3969
|
},
|
|
3913
3970
|
mt_command_parser: function(e, t, n, r) {
|
|
3914
3971
|
if ("ST_SESSION" !== fn(e)) return ir("Not in session"), null;
|
|
3915
3972
|
n || (n = {});
|
|
3916
|
-
let o =
|
|
3917
|
-
return l || (l = {}),
|
|
3973
|
+
let o = Yi(e, At(r), gl(e, n, "service", "", 0)), l = pl(e, n, "__md_command__", null, Un.KW_EXTRACT);
|
|
3974
|
+
return l || (l = {}), Pl(e, n, "command_stack", {
|
|
3918
3975
|
command: t,
|
|
3919
3976
|
kw: l
|
|
3920
|
-
}),
|
|
3977
|
+
}), Pl(e, n, ki, o), n.__command__ = t, Ul(e, n, "__command__"), Bi(e, "EV_MT_COMMAND", n, r), null;
|
|
3921
3978
|
},
|
|
3922
3979
|
mt_inject_event: function(e, t, n, r) {
|
|
3923
3980
|
if ("ST_SESSION" !== fn(e)) return window.console.error("Not in session"), -1;
|
|
3924
|
-
if (n = Do({},
|
|
3981
|
+
if (n = Do({}, Bo(n) ? n : {}), Bo(n.__md_iev__) && (n.__md_iev__ = Ro(n.__md_iev__)), Ll(e, n, ki));
|
|
3925
3982
|
else {
|
|
3926
|
-
let o =
|
|
3927
|
-
Po(n, "__service__"),
|
|
3983
|
+
let o = Yi(e, At(r), gl(e, n, "__service__", 0, 0));
|
|
3984
|
+
Po(n, "__service__"), Pl(e, n, "__message__", t), Pl(e, n, ki, o);
|
|
3928
3985
|
}
|
|
3929
|
-
return
|
|
3986
|
+
return Ul(e, n, "__message__"), Bi(e, t, n, r);
|
|
3930
3987
|
},
|
|
3931
3988
|
mt_subscription_added: function(e, t) {
|
|
3932
3989
|
let n = e.priv;
|
|
3933
|
-
return "ST_SESSION" === fn(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3990
|
+
return "ST_SESSION" === fn(e) && n.websocket ? n.inside_on_open ? 0 : qi(e, t) : 0;
|
|
3934
3991
|
},
|
|
3935
3992
|
mt_subscription_deleted: function(e, t) {
|
|
3936
3993
|
let n = e.priv;
|
|
3937
3994
|
if ("ST_SESSION" !== fn(e) || !n.websocket) return 0;
|
|
3938
3995
|
if (n.inside_on_open) return 0;
|
|
3939
|
-
if (
|
|
3996
|
+
if (Zo(t.event)) return 0;
|
|
3940
3997
|
let r = {}, o = t.__global__, l = t.__config__, i = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
3941
3998
|
l && (r.__config__ = l), o && (r.__global__ = o), i && (r.__filter__ = i);
|
|
3942
|
-
return
|
|
3999
|
+
return Pl(e, r, ki, Yi(e, At(a), s)), Ul(e, r, "__unsubscribing__"), Bi(e, t.event, r, e);
|
|
3943
4000
|
}
|
|
3944
4001
|
};
|
|
3945
|
-
e.GObj = I, e.SDATA = k, e.SDATAAUTHZ = (e, t, n, r, o, l) => new
|
|
4002
|
+
e.GObj = I, e.SDATA = k, e.SDATAAUTHZ = (e, t, n, r, o, l) => new A(e, t, n, null, l, r, null, 0, null, o, null), e.SDATACM = (e, t, n, r, o, l) => new A(e, t, 0, null, l, n, null, 0, o, r, null), e.SDATACM2 = (e, t, n, r, o, l, i) => new A(e, t, n, null, i, r, null, 0, l, o, null), e.SDATADF = (e, t, n, r, o, l) => new A(e, t, n, null, l, null, r, o), e.SDATAPM = (e, t, n, r, o) => new A(e, t, n, r, o), e.SDATAPM0 = (e, t, n, r, o) => new A(e, t, n, null, o, null, null, 0, null, null, r), e.SDATA_END = D, e.SDataDesc = A, e.YUNETA_VERSION = i, Object.defineProperty(e, "__yuno__", {
|
|
3946
4003
|
enumerable: !0,
|
|
3947
4004
|
get: function() {
|
|
3948
4005
|
return p;
|
|
@@ -3953,7 +4010,7 @@
|
|
|
3953
4010
|
return t;
|
|
3954
4011
|
}, e.build_stats_response = l, e.clean_name = function(e) {
|
|
3955
4012
|
return e.replace(/[?# ^:]/g, "_");
|
|
3956
|
-
}, e.clear_timeout =
|
|
4013
|
+
}, e.clear_timeout = Ei, e.cmp_two_simple_json = rl, e.command_parameter_from_json = ke, e.command_parameter_from_text = function(e, t) {
|
|
3957
4014
|
const n = De(e, t, !1);
|
|
3958
4015
|
return void 0 !== n.value || n.refused || (n.refused = je), n;
|
|
3959
4016
|
}, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
@@ -3965,46 +4022,46 @@
|
|
|
3965
4022
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
3966
4023
|
s.style.cssText = t;
|
|
3967
4024
|
} else "style" === e ? s.style.cssText = o[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== o[e] && void 0 !== o[e] && (a = o[e], s.setAttribute("data-i18n", a)) : s.setAttribute(e, o[e]);
|
|
3968
|
-
if (
|
|
3969
|
-
else if (
|
|
4025
|
+
if (Kl(l)) s.appendChild(Bl(l));
|
|
4026
|
+
else if (Jo(l)) if (l = l.trim(), l.length > 0 && "<" === l[0] && !Yl) s.appendChild(ql(l));
|
|
3970
4027
|
else if (l.length > 0 && "<" === l[0] && function(e) {
|
|
3971
|
-
if (
|
|
4028
|
+
if (Jl.size >= 100) return;
|
|
3972
4029
|
const t = e.slice(0, 80);
|
|
3973
|
-
|
|
4030
|
+
Jl.has(t) || (Jl.add(t), sr(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
3974
4031
|
}(l), n && a) s.textContent = n(a) || l;
|
|
3975
4032
|
else s.textContent = l;
|
|
3976
|
-
else if (
|
|
3977
|
-
if (l.length > 0) if (
|
|
3978
|
-
else for (let t of l) Array.isArray(t) ? t.length > 0 && s.appendChild(e(t, n)) : t instanceof Node ? s.appendChild(t) :
|
|
4033
|
+
else if (Yo(l)) {
|
|
4034
|
+
if (l.length > 0) if (Jo(l[0])) s.appendChild(e(l, n));
|
|
4035
|
+
else for (let t of l) Array.isArray(t) ? t.length > 0 && s.appendChild(e(t, n)) : t instanceof Node ? s.appendChild(t) : Kl(t) ? s.appendChild(Bl(t)) : Jo(t) ? s.appendChild(document.createTextNode(t)) : null != t && !1 !== t && ir("createElement2: child ignored, type " + typeof t);
|
|
3979
4036
|
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? s.appendChild(l) : null != l && (ir("content ignored"), _r(l));
|
|
3980
4037
|
if (i && "object" == typeof i) for (const e of Object.keys(i)) s.addEventListener(e, i[e]);
|
|
3981
4038
|
return s;
|
|
3982
|
-
}, e.createOneHtml =
|
|
3983
|
-
let n =
|
|
4039
|
+
}, e.createOneHtml = ql, e.create_json_record = function(e, t) {
|
|
4040
|
+
let n = Ro(e);
|
|
3984
4041
|
return ko(n, t), n;
|
|
3985
4042
|
}, e.create_template_record = function(e, t) {
|
|
3986
4043
|
let n = {};
|
|
3987
4044
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
3988
4045
|
let o;
|
|
3989
|
-
|
|
3990
|
-
let l =
|
|
4046
|
+
Bo(r) && (o = r.default);
|
|
4047
|
+
let l = pl(null, t, e, o);
|
|
3991
4048
|
Lo(n, e, l);
|
|
3992
4049
|
}), n;
|
|
3993
4050
|
}, e.current_timestamp = Hl, e.data_type_t = E, e.db_list_persistent_attrs = function(e, t) {
|
|
3994
|
-
let n =
|
|
3995
|
-
return n &&
|
|
4051
|
+
let n = wl(si(e), null, !1), r = {};
|
|
4052
|
+
return n && Bo(n) && (r = El(e, n, t, !1)), r;
|
|
3996
4053
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
3997
|
-
let n = Xt(e,
|
|
3998
|
-
if (r &&
|
|
3999
|
-
let o =
|
|
4000
|
-
o =
|
|
4054
|
+
let n = Xt(e, R.SDF_PERSIST), r = wl(si(e), null, !1);
|
|
4055
|
+
if (r && Bo(r)) {
|
|
4056
|
+
let o = El(e, r, t, !1);
|
|
4057
|
+
o = El(e, o, n, !1), sn(e, o, R.SDF_PERSIST);
|
|
4001
4058
|
}
|
|
4002
4059
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
4003
|
-
let n =
|
|
4004
|
-
0 === Vo(n) ?
|
|
4060
|
+
let n = Tl(e, wl(si(e), null, !1), t, !1);
|
|
4061
|
+
0 === Vo(n) ? $l(si(e)) : Nl(si(e), n);
|
|
4005
4062
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
4006
|
-
let n =
|
|
4007
|
-
return r &&
|
|
4063
|
+
let n = El(e, Xt(e, R.SDF_PERSIST), t, !1), r = wl(si(e), null, !1);
|
|
4064
|
+
return r && Bo(r) && Co(n, r), Nl(si(e), n);
|
|
4008
4065
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
4009
4066
|
let r = null, o = null, l = null;
|
|
4010
4067
|
const i = (...i) => {
|
|
@@ -4026,22 +4083,20 @@
|
|
|
4026
4083
|
const t = {};
|
|
4027
4084
|
for (const n of e) Do(t, structuredClone(n));
|
|
4028
4085
|
return t;
|
|
4029
|
-
}, e.empty_json = function(e) {
|
|
4030
|
-
return 0 === xo(e);
|
|
4031
|
-
}, e.empty_string = Xo, e.escapeHtml = Vl, e.event_flag_t = F, e.flat2json = function(e) {
|
|
4086
|
+
}, e.empty_json = Ko, e.empty_string = Zo, e.escapeHtml = Wl, e.event_flag_t = F, e.flat2json = function(e) {
|
|
4032
4087
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
4033
4088
|
let t = null;
|
|
4034
4089
|
for (const n of Object.keys(e)) {
|
|
4035
|
-
const r =
|
|
4090
|
+
const r = li(n);
|
|
4036
4091
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
4037
|
-
if (r.length >
|
|
4092
|
+
if (r.length > ni) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
4038
4093
|
const o = "number" == typeof r[0];
|
|
4039
4094
|
if (null === t) t = o ? [] : {};
|
|
4040
4095
|
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
4041
4096
|
let l = t;
|
|
4042
4097
|
for (let t = 0; t < r.length; t++) {
|
|
4043
4098
|
const o = r[t], i = "number" == typeof o, s = t === r.length - 1, a = !s && "number" == typeof r[t + 1];
|
|
4044
|
-
if (i && o >
|
|
4099
|
+
if (i && o > ri) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
4045
4100
|
if (i !== Array.isArray(l)) throw new Error(`flat2json: '${n}' uses a ${i ? "array index" : "key"} where the tree already has a ${Array.isArray(l) ? "array" : "object"}`);
|
|
4046
4101
|
if (s) {
|
|
4047
4102
|
if (Array.isArray(l)) {
|
|
@@ -4049,7 +4104,7 @@
|
|
|
4049
4104
|
l[o] = e[n];
|
|
4050
4105
|
} else {
|
|
4051
4106
|
if (Object.prototype.hasOwnProperty.call(l, o)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
4052
|
-
|
|
4107
|
+
sl(l, o, e[n]);
|
|
4053
4108
|
}
|
|
4054
4109
|
break;
|
|
4055
4110
|
}
|
|
@@ -4057,7 +4112,7 @@
|
|
|
4057
4112
|
if (Array.isArray(l)) {
|
|
4058
4113
|
for (; l.length <= o;) l.push(null);
|
|
4059
4114
|
u = l[o], null == u && (u = a ? [] : {}, l[o] = u);
|
|
4060
|
-
} else u =
|
|
4115
|
+
} else u = il(l, o) ? void 0 : l[o], void 0 === u && (u = a ? [] : {}, sl(l, o, u));
|
|
4061
4116
|
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`);
|
|
4062
4117
|
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"}`);
|
|
4063
4118
|
l = u;
|
|
@@ -4068,11 +4123,11 @@
|
|
|
4068
4123
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
4069
4124
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
4070
4125
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
4071
|
-
for (const n of Object.keys(t.added || {}))
|
|
4126
|
+
for (const n of Object.keys(t.added || {})) sl(e, n, t.added[n]);
|
|
4072
4127
|
for (const n of Object.keys(t.changed || {})) {
|
|
4073
4128
|
const r = t.changed[n];
|
|
4074
4129
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
4075
|
-
|
|
4130
|
+
sl(e, n, r.to);
|
|
4076
4131
|
}
|
|
4077
4132
|
return e;
|
|
4078
4133
|
}, e.flat_diff = function(e, t) {
|
|
@@ -4081,15 +4136,15 @@
|
|
|
4081
4136
|
removed: {},
|
|
4082
4137
|
changed: {}
|
|
4083
4138
|
};
|
|
4084
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
4139
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? ii(n[e], r[e]) || sl(o.changed, e, {
|
|
4085
4140
|
from: n[e],
|
|
4086
4141
|
to: r[e]
|
|
4087
|
-
}) :
|
|
4088
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
4142
|
+
}) : sl(o.removed, e, n[e]);
|
|
4143
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || sl(o.added, e, r[e]);
|
|
4089
4144
|
return o;
|
|
4090
4145
|
}, e.flat_key_join = function(e) {
|
|
4091
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
4092
|
-
}, e.flat_key_split =
|
|
4146
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : oi(e)).join("`") : "";
|
|
4147
|
+
}, e.flat_key_split = li, e.gclass_add_ev_action = He, e.gclass_add_event_type = Qe, e.gclass_add_state = qe, e.gclass_check_fsm = Ze, e.gclass_create = Ke, e.gclass_event_type = Xe, e.gclass_find_by_name = et, e.gclass_flag_t = P, e.gclass_unregister = Be, e.getPositionRelativeToBody = function(e) {
|
|
4093
4148
|
if (!e) return {
|
|
4094
4149
|
top: 0,
|
|
4095
4150
|
left: 0,
|
|
@@ -4108,14 +4163,18 @@
|
|
|
4108
4163
|
right: n + s + r,
|
|
4109
4164
|
bottom: t + i + o
|
|
4110
4165
|
};
|
|
4111
|
-
}, e.get_function_name =
|
|
4166
|
+
}, e.get_function_name = ti, e.get_now = function() {
|
|
4112
4167
|
return Math.floor(Date.now() / 1e3);
|
|
4113
4168
|
}, e.gobj_bottom_gobj = Ft, e.gobj_change_parent = function(e, t) {
|
|
4114
|
-
|
|
4169
|
+
if (Ut(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
4170
|
+
if (!(t instanceof I)) return ir(`${kt(e)}: gobj_change_parent() BAD TYPE of parent`), -1;
|
|
4171
|
+
if (Ut(t)) return ir(`${kt(e)}: gobj_change_parent() parent NULL or DESTROYED`), -1;
|
|
4172
|
+
for (let n = t; n; n = n.parent) if (n === e) return ir(`${kt(e)}: gobj_change_parent() a gobj cannot be its own ancestor: ${kt(t)}`), -1;
|
|
4173
|
+
return e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (lt(e.parent, e), e.parent = null), ot(t, e), t.gclass.gmt.mt_child_added && (ee(e) && ar(n("👦👦🔵 child_added(%s): %s", Ct(t), kt(e))), t.gclass.gmt.mt_child_added(t, e)), 0;
|
|
4115
4174
|
}, e.gobj_change_state = cn, e.gobj_command = function(e, t, r, l) {
|
|
4116
4175
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
4117
4176
|
if (function(e) {
|
|
4118
|
-
return
|
|
4177
|
+
return H > 1 || !!e && !!(X(e) & B.TRACE_COMMANDS);
|
|
4119
4178
|
}(e) || oe(e, null) && !le(l, null)) {
|
|
4120
4179
|
let o = To(t);
|
|
4121
4180
|
K(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Tt(e) ? "" : "!!", kt(e), null !== o ? o : t, kt(l))), re(e) && $o(r);
|
|
@@ -4131,26 +4190,26 @@
|
|
|
4131
4190
|
return ut(e, t, n, r, L.gobj_flag_volatil);
|
|
4132
4191
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
4133
4192
|
return ut(e, t, n, null, L.gobj_flag_yuno);
|
|
4134
|
-
}, e.gobj_current_state = fn, e.gobj_default_service = tt, e.gobj_deliver_posted_events = yn, e.gobj_destroy = ct, e.gobj_find_child =
|
|
4135
|
-
if (
|
|
4193
|
+
}, e.gobj_current_state = fn, e.gobj_default_service = tt, e.gobj_deliver_posted_events = yn, e.gobj_destroy = ct, e.gobj_find_child = qt, e.gobj_find_event_type = Sn, e.gobj_find_gobj = function(e, t) {
|
|
4194
|
+
if (Zo(t)) return null;
|
|
4136
4195
|
const n = t.toLowerCase();
|
|
4137
|
-
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p :
|
|
4196
|
+
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : Ht(p, t);
|
|
4138
4197
|
}, e.gobj_find_service = nt, e.gobj_find_subscribings = Pn, e.gobj_find_subscriptions = In, e.gobj_flag_t = L, e.gobj_full_name = Ct, e.gobj_gclass_name = Dt, e.gobj_get_gclass_trace_level = fe, e.gobj_get_gclass_trace_level2 = ge, e.gobj_get_gclass_trace_no_level = de, e.gobj_get_global_trace_level = _e, e.gobj_get_global_trace_no_level = ce, e.gobj_global_trace_level = function() {
|
|
4139
4198
|
return J;
|
|
4140
4199
|
}, e.gobj_global_trace_no_level = function() {
|
|
4141
|
-
return
|
|
4200
|
+
return q;
|
|
4142
4201
|
}, e.gobj_has_attr = zt, e.gobj_has_event = dn, e.gobj_has_output_event = bn, e.gobj_hsdata = Ve, e.gobj_is_destroying = Ut, e.gobj_is_playing = St, e.gobj_is_pure_child = Lt, e.gobj_is_running = Tt, e.gobj_is_service = Ot, e.gobj_is_volatil = Pt, e.gobj_list_persistent_attrs = function(e, t) {
|
|
4143
4202
|
return _ ? _(e, t) : null;
|
|
4144
4203
|
}, e.gobj_list_subscriptions = function(e) {
|
|
4145
4204
|
let t = In(e, null, null, null);
|
|
4146
4205
|
for (let n = 0; n < t.length; n++) {
|
|
4147
|
-
let r = t[n], o =
|
|
4148
|
-
Uo(r, "s_event",
|
|
4206
|
+
let r = t[n], o = dl(e, r, "publisher", null, Un.KW_REQUIRED), l = dl(e, r, "subscriber", null, Un.KW_REQUIRED);
|
|
4207
|
+
Uo(r, "s_event", gl(e, r, "event", "", Un.KW_REQUIRED)), Uo(r, "s_publisher", kt(o)), Uo(r, "s_subscriber", kt(l));
|
|
4149
4208
|
}
|
|
4150
4209
|
let n = Pn(e, 0, null, 0);
|
|
4151
4210
|
for (let t = 0; t < n.length; t++) {
|
|
4152
|
-
let r = n[t], o =
|
|
4153
|
-
Uo(r, "s_event",
|
|
4211
|
+
let r = n[t], o = dl(e, r, "publisher", null, Un.KW_REQUIRED), l = dl(e, r, "subscriber", null, Un.KW_REQUIRED);
|
|
4212
|
+
Uo(r, "s_event", gl(e, r, "event", "", Un.KW_REQUIRED)), Uo(r, "s_publisher", kt(o)), Uo(r, "s_subscriber", kt(l));
|
|
4154
4213
|
}
|
|
4155
4214
|
return {
|
|
4156
4215
|
subscriptions: t,
|
|
@@ -4180,7 +4239,7 @@
|
|
|
4180
4239
|
Jt(l, t) && n.push(l), e(n, l);
|
|
4181
4240
|
}
|
|
4182
4241
|
}(n, e), n;
|
|
4183
|
-
}, e.gobj_match_gobj = Jt, e.gobj_name =
|
|
4242
|
+
}, e.gobj_match_gobj = Jt, e.gobj_name = At, e.gobj_parent = It, e.gobj_pause = Et, e.gobj_play = vt, e.gobj_post_event = hn, e.gobj_posted_events_size = function() {
|
|
4184
4243
|
return pn.length;
|
|
4185
4244
|
}, e.gobj_publish_event = Ln, e.gobj_read_attr = Qt, e.gobj_read_attrs = Xt, e.gobj_read_bool_attr = Zt, e.gobj_read_integer_attr = en, e.gobj_read_pointer_attr = nn, e.gobj_read_str_attr = tn, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
4186
4245
|
return Ot(e) ? u ? u(e, t) : -1 : (ir(`${kt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
@@ -4197,16 +4256,16 @@
|
|
|
4197
4256
|
let r = e.gclass.attrs_table;
|
|
4198
4257
|
for (let o = 0; o < r.length; o++) {
|
|
4199
4258
|
const l = r[o];
|
|
4200
|
-
l.name && (n && l.flag & n || (-1 === t || l.flag & t) && (he(e, e.jn_attrs, l),
|
|
4259
|
+
l.name && (n && l.flag & n || (-1 === t || l.flag & t) && (he(e, e.jn_attrs, l), Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, l.name) && (e.priv[l.name] = e.jn_attrs[l.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l.name)));
|
|
4201
4260
|
}
|
|
4202
4261
|
return 0;
|
|
4203
|
-
}(e,
|
|
4204
|
-
}, e.gobj_save_persistent_attrs = it, e.gobj_search_path =
|
|
4262
|
+
}(e, R.SDF_VOLATIL, 0);
|
|
4263
|
+
}, e.gobj_save_persistent_attrs = it, e.gobj_search_path = Ht, e.gobj_send_event = jn, e.gobj_services = function() {
|
|
4205
4264
|
let e = [];
|
|
4206
4265
|
for (const t of Object.keys(b)) Mo(e, t);
|
|
4207
4266
|
return e;
|
|
4208
4267
|
}, e.gobj_set_bottom_gobj = Mt, e.gobj_set_deep_trace = function(e) {
|
|
4209
|
-
return
|
|
4268
|
+
return H = Number(e) || 0, 0;
|
|
4210
4269
|
}, e.gobj_set_gclass_no_trace = pe, e.gobj_set_gclass_trace = be, e.gobj_set_global_no_trace = se, e.gobj_set_global_no_trace2 = ue, e.gobj_set_global_trace = ie, e.gobj_set_global_trace2 = ae, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
4211
4270
|
if (!e) return ir("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
4212
4271
|
const r = Q(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
@@ -4247,84 +4306,84 @@
|
|
|
4247
4306
|
]);
|
|
4248
4307
|
if (Object.keys(n).forEach((n) => {
|
|
4249
4308
|
o.has(n) || ir(`${kt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
4250
|
-
}),
|
|
4309
|
+
}), Zo(t)) t = "";
|
|
4251
4310
|
else if (!(bn(e, t, F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ev ${t}`), 0;
|
|
4252
|
-
let l = Nn(n, t), i =
|
|
4311
|
+
let l = Nn(n, t), i = Rn(e.dl_subscriptions, e, t, l.renamed_event, l.kw, r), s = 0, a = 0, u = 0;
|
|
4253
4312
|
for (let t = 0; t < i.length; t++) {
|
|
4254
4313
|
let n = i[t], r = Dn(e, n, !1, !1);
|
|
4255
4314
|
0 === r ? s++ : r < 0 ? a++ : u++;
|
|
4256
4315
|
}
|
|
4257
4316
|
return a ? sr(`${kt(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${a})`) : s || u || (sr(`${kt(e)}: No subscription found`), $o(n, "No subscription found")), 0;
|
|
4258
|
-
}, e.gobj_unsubscribe_list = Cn, e.gobj_walk_gobj_children = Vt, e.gobj_walk_gobj_children_tree = Wt, e.gobj_write_attr = rn, e.gobj_write_attrs = sn, e.gobj_write_bool_attr = an, e.gobj_write_integer_attr = un, e.gobj_write_str_attr = _n, e.gobj_yuno = wt, e.gobj_yuno_id =
|
|
4259
|
-
return "string" != typeof e ? (ir("html_markup: not a string, type " + typeof e), new
|
|
4260
|
-
}, e.id_index_in_obj_list =
|
|
4317
|
+
}, e.gobj_unsubscribe_list = Cn, e.gobj_walk_gobj_children = Vt, e.gobj_walk_gobj_children_tree = Wt, e.gobj_write_attr = rn, e.gobj_write_attrs = sn, e.gobj_write_bool_attr = an, e.gobj_write_integer_attr = un, e.gobj_write_str_attr = _n, e.gobj_yuno = wt, e.gobj_yuno_id = Rt, e.gobj_yuno_name = Nt, e.gobj_yuno_role = $t, e.html_markup = function(e) {
|
|
4318
|
+
return "string" != typeof e ? (ir("html_markup: not a string, type " + typeof e), new xl("")) : new xl(e);
|
|
4319
|
+
}, e.id_index_in_obj_list = Dl, e.index_in_list = zl, e.is_array = Yo, e.is_boolean = Ho, e.is_date = function(e) {
|
|
4261
4320
|
return e instanceof Date && !isNaN(e);
|
|
4262
|
-
}, e.is_function =
|
|
4263
|
-
if (!
|
|
4321
|
+
}, e.is_function = Qo, e.is_gobj = Xo, e.is_html_markup = Kl, e.is_metadata_key = function(e) {
|
|
4322
|
+
if (!Jo(e)) return !1;
|
|
4264
4323
|
let t = 0;
|
|
4265
4324
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
4266
4325
|
return 2 === t;
|
|
4267
|
-
}, e.is_null =
|
|
4268
|
-
if (!
|
|
4326
|
+
}, e.is_null = zo, e.is_number = qo, e.is_object = Bo, e.is_private_key = function(e) {
|
|
4327
|
+
if (!Jo(e)) return !1;
|
|
4269
4328
|
let t = 0;
|
|
4270
4329
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
4271
4330
|
return 1 === t;
|
|
4272
4331
|
}, e.is_pure_number = function(e) {
|
|
4273
|
-
if (
|
|
4274
|
-
if (!
|
|
4332
|
+
if (qo(e)) return !0;
|
|
4333
|
+
if (!Jo(e)) return !1;
|
|
4275
4334
|
const t = Number(e);
|
|
4276
4335
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
4277
4336
|
}, e.is_secret_name = function(e) {
|
|
4278
4337
|
return "string" == typeof e && vr(e, 0, e.length, !0, !0);
|
|
4279
|
-
}, e.is_string =
|
|
4280
|
-
let o =
|
|
4338
|
+
}, e.is_string = Jo, e.jdb_delete = function(e, t, n, r) {
|
|
4339
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4281
4340
|
if (!o) return ir("jdb_delete: topic not found: " + t), null;
|
|
4282
|
-
if (!
|
|
4283
|
-
if (!
|
|
4341
|
+
if (!Bo(r) || Zo(r.id)) return ir(`jdb_delete: record without id: ${Zn(r)}`), null;
|
|
4342
|
+
if (!Jo(n)) return ir(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
4284
4343
|
if ("" !== n && n.split("`").includes("")) return ir(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
4285
4344
|
let l, i = n.split("`"), s = o;
|
|
4286
|
-
for (; (l = i.shift()) && !
|
|
4345
|
+
for (; (l = i.shift()) && !Zo(l) && s;) Bo(s) && (s = pl(null, s, e.hook, null, 0)), s = Gl(s, null, l, !1);
|
|
4287
4346
|
if (!s || 0 !== i.length) return ir(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
4288
|
-
let a =
|
|
4347
|
+
let a = Yo(s) ? s : pl(null, s, e.hook, null, 0), u = Dl(a, r.id);
|
|
4289
4348
|
return u < 0 ? (ir(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (a.splice(u, 1), o);
|
|
4290
4349
|
}, e.jdb_get = function(e, t, n, r) {
|
|
4291
|
-
let o =
|
|
4292
|
-
return o ? (void 0 === r && (r = !0),
|
|
4350
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4351
|
+
return o ? (void 0 === r && (r = !0), Gl(o, e.hook, n, r)) : (ir("jdb_get: topic not found: " + t), null);
|
|
4293
4352
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
4294
|
-
let r =
|
|
4353
|
+
let r = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4295
4354
|
return r ? n < r.length ? r[n] : {} : (ir("jdb_get_by_idx: topic not found: " + t), null);
|
|
4296
4355
|
}, e.jdb_get_topic = function(e, t) {
|
|
4297
|
-
let n =
|
|
4356
|
+
let n = pl(null, e, "topics", null, 0);
|
|
4298
4357
|
if (!n) return ir("jdb topics section not found"), ur(e), null;
|
|
4299
|
-
return
|
|
4358
|
+
return pl(null, n, t, null, 0) || (ir("jdb topic not found: " + t), ur(n), null);
|
|
4300
4359
|
}, e.jdb_init = function(e, t, n) {
|
|
4301
|
-
n && (e =
|
|
4302
|
-
let r =
|
|
4303
|
-
|
|
4304
|
-
let o =
|
|
4305
|
-
return
|
|
4306
|
-
"__" === t.substring(0, 2) ||
|
|
4360
|
+
n && (e = Ro(e));
|
|
4361
|
+
let r = pl(null, e, "type", [], Un.KW_CREATE);
|
|
4362
|
+
gl(null, e, "hook", "data", Un.KW_CREATE);
|
|
4363
|
+
let o = pl(null, e, "schema", {}, Un.KW_CREATE), l = pl(null, e, "topics", {}, Un.KW_CREATE);
|
|
4364
|
+
return Ml(o, function(e, t, n, o) {
|
|
4365
|
+
"__" === t.substring(0, 2) || Bo(n) || pl(null, l, o, Ro(r), Un.KW_CREATE);
|
|
4307
4366
|
}, t), e;
|
|
4308
4367
|
}, e.jdb_update = function(e, t, n, r) {
|
|
4309
|
-
let o =
|
|
4368
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4310
4369
|
if (!o) return ir("jdb_update: topic not found: " + t), null;
|
|
4311
|
-
if (!
|
|
4312
|
-
if (!
|
|
4370
|
+
if (!Bo(r) || Zo(r.id)) return ir(`jdb_update: record without id: ${Zn(r)}`), null;
|
|
4371
|
+
if (!Jo(n)) return ir(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
4313
4372
|
if ("" !== n && n.split("`").includes("")) return ir(`jdb_update: empty segment in path: '${n}'`), null;
|
|
4314
4373
|
let l, i, s = n.split("`"), a = o;
|
|
4315
|
-
for (; (l = s.shift()) && !
|
|
4374
|
+
for (; (l = s.shift()) && !Zo(l) && a;) Bo(a) && (a = pl(null, a, e.hook, null, 0)), a = Gl(a, null, l, !1);
|
|
4316
4375
|
if (!a || 0 !== s.length) return ir(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
4317
|
-
if (
|
|
4376
|
+
if (Yo(a)) i = a;
|
|
4318
4377
|
else {
|
|
4319
4378
|
if (a.id === r.id) return Do(a, r), o;
|
|
4320
|
-
if (i =
|
|
4321
|
-
else if (!
|
|
4379
|
+
if (i = pl(null, a, e.hook, null, 0), null == i) i = [], Lo(a, e.hook, i);
|
|
4380
|
+
else if (!Yo(i)) return ir(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
4322
4381
|
}
|
|
4323
|
-
let u =
|
|
4382
|
+
let u = Gl(i, e.hook, r.id, !1);
|
|
4324
4383
|
return u ? Do(u, r) : i.push(r), o;
|
|
4325
4384
|
}, e.json2flat = function(e) {
|
|
4326
4385
|
const t = {}, n = (e, r, o) => {
|
|
4327
|
-
if (o >
|
|
4386
|
+
if (o > ni) throw new Error("json2flat: deeper than 256");
|
|
4328
4387
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
4329
4388
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
4330
4389
|
const l = `[${t}]`;
|
|
@@ -4334,20 +4393,20 @@
|
|
|
4334
4393
|
const t = Object.keys(e);
|
|
4335
4394
|
if (t.length > 0) {
|
|
4336
4395
|
for (const l of t) {
|
|
4337
|
-
const t =
|
|
4396
|
+
const t = oi(l);
|
|
4338
4397
|
n(e[l], 0 === o ? t : r + "`" + t, o + 1);
|
|
4339
4398
|
}
|
|
4340
4399
|
return;
|
|
4341
4400
|
}
|
|
4342
4401
|
}
|
|
4343
|
-
0 !== o &&
|
|
4402
|
+
0 !== o && sl(t, r, e);
|
|
4344
4403
|
};
|
|
4345
4404
|
return null == e || n(e, "", 0), t;
|
|
4346
4405
|
}, e.json_array_append = Fo, e.json_array_append_new = Mo, e.json_array_extend = function(e, t) {
|
|
4347
4406
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
4348
|
-
}, e.json_array_remove = Go, e.json_array_size = Wo, e.json_deep_copy =
|
|
4407
|
+
}, e.json_array_remove = Go, e.json_array_size = Wo, e.json_deep_copy = Ro, e.json_is_identical = Ao, e.json_mask_secrets = No, e.json_object_del = Po, e.json_object_get = Io, e.json_object_set = Lo, e.json_object_set_new = Uo, e.json_object_size = Vo, e.json_object_update = Do, e.json_object_update_existing = ko, e.json_object_update_missing = Co, e.json_size = xo, e.json_text_of = Fe, e.jwt2json = function(e, t) {
|
|
4349
4408
|
try {
|
|
4350
|
-
let n =
|
|
4409
|
+
let n = Vl(e);
|
|
4351
4410
|
switch (t) {
|
|
4352
4411
|
case "header": return JSON.parse(n.header);
|
|
4353
4412
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -4356,98 +4415,98 @@
|
|
|
4356
4415
|
} catch (e) {
|
|
4357
4416
|
return null;
|
|
4358
4417
|
}
|
|
4359
|
-
}, e.jwtDecode =
|
|
4360
|
-
if (e && !
|
|
4361
|
-
r || (r =
|
|
4418
|
+
}, e.jwtDecode = Vl, e.kw_clone_by_keys = El, e.kw_clone_by_not_keys = Tl, e.kw_collect = function(e, t, n, r) {
|
|
4419
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
4420
|
+
r || (r = vl);
|
|
4362
4421
|
let o = [];
|
|
4363
|
-
if (
|
|
4422
|
+
if (Yo(t)) for (let e = 0; e < t.length; e++) {
|
|
4364
4423
|
let l = t[e];
|
|
4365
4424
|
r(l, n) && o.push(l);
|
|
4366
4425
|
}
|
|
4367
4426
|
else {
|
|
4368
|
-
if (!
|
|
4427
|
+
if (!Bo(t)) return ir("kw_select() BAD kw parameter"), null;
|
|
4369
4428
|
r(t, n) && o.push(t);
|
|
4370
4429
|
}
|
|
4371
4430
|
return o;
|
|
4372
|
-
}, e.kw_delete =
|
|
4373
|
-
if (!n || !
|
|
4374
|
-
for (let e = 0; e < t.length; e++) if (
|
|
4431
|
+
}, e.kw_delete = _l, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
4432
|
+
if (!n || !Yo(t)) return r && ir("item NULL or kw_list is not a list"), -1;
|
|
4433
|
+
for (let e = 0; e < t.length; e++) if (Ao(n, t[e])) return e;
|
|
4375
4434
|
return r && ir("item not found in this list"), -1;
|
|
4376
|
-
}, e.kw_find_path =
|
|
4377
|
-
e && !
|
|
4378
|
-
let l =
|
|
4435
|
+
}, e.kw_find_path = ul, e.kw_flag_t = Un, e.kw_get_bool = cl, e.kw_get_dict = bl, e.kw_get_dict_value = pl, e.kw_get_int = fl, e.kw_get_list = function(e, t, n, r, o) {
|
|
4436
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4437
|
+
let l = ul(e, t, n, !1);
|
|
4379
4438
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
4380
|
-
return void 0 === l ? s &&
|
|
4381
|
-
}, e.kw_get_local_storage_value =
|
|
4382
|
-
e && !
|
|
4383
|
-
let l =
|
|
4439
|
+
return void 0 === l ? s && Yo(r) && t ? (ml(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), $o(t)), r) : Yo(l) ? (a && _l(e, t, n), l) : s && null === l && Yo(r) ? (ml(e, t, n, r), r) : s && null === l ? (i && (ir(`path not found: '${n}'`), $o(t)), r) : ((i || s) && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json list: '${n}'` + (s ? ", cannot create" : "")), $o(t)), r);
|
|
4440
|
+
}, e.kw_get_local_storage_value = wl, e.kw_get_pointer = dl, e.kw_get_real = function(e, t, n, r, o) {
|
|
4441
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4442
|
+
let l = ul(e, t, n, !1);
|
|
4384
4443
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
4385
4444
|
if (void 0 === l) {
|
|
4386
4445
|
if (s && t) {
|
|
4387
4446
|
let o = Number(r);
|
|
4388
|
-
return
|
|
4447
|
+
return ml(e, t, n, o), o;
|
|
4389
4448
|
}
|
|
4390
4449
|
return i && (ir(`path not found: '${n}'`), $o(t)), Number(r);
|
|
4391
4450
|
}
|
|
4392
4451
|
let _;
|
|
4393
|
-
if (
|
|
4452
|
+
if (qo(l)) _ = l;
|
|
4394
4453
|
else {
|
|
4395
4454
|
if (!u) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a json real: '${n}'`), $o(t), Number(r);
|
|
4396
4455
|
if (Ho(l)) _ = l ? 1 : 0;
|
|
4397
|
-
else if (
|
|
4456
|
+
else if (Jo(l)) _ = parseFloat(l), Number.isNaN(_) && (_ = 0);
|
|
4398
4457
|
else {
|
|
4399
4458
|
if (null !== l) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $o(t), 0;
|
|
4400
4459
|
_ = 0;
|
|
4401
4460
|
}
|
|
4402
4461
|
}
|
|
4403
|
-
return a &&
|
|
4404
|
-
}, e.kw_get_str =
|
|
4405
|
-
if (e && !
|
|
4406
|
-
r || (r =
|
|
4462
|
+
return a && _l(e, t, n), _;
|
|
4463
|
+
}, e.kw_get_str = gl, e.kw_has_key = ll, e.kw_match_simple = vl, e.kw_pop = ol, e.kw_remove_local_storage_value = $l, e.kw_select = function(e, t, n, r) {
|
|
4464
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
4465
|
+
r || (r = vl);
|
|
4407
4466
|
let o = [];
|
|
4408
|
-
if (
|
|
4467
|
+
if (Yo(t)) for (let e = 0; e < t.length; e++) {
|
|
4409
4468
|
let l = t[e];
|
|
4410
|
-
r(l, n) && o.push(
|
|
4469
|
+
r(l, n) && o.push(Ro(l));
|
|
4411
4470
|
}
|
|
4412
4471
|
else {
|
|
4413
|
-
if (!
|
|
4414
|
-
r(t, n) && o.push(
|
|
4472
|
+
if (!Bo(t)) return ir("kw_select() BAD kw parameter"), null;
|
|
4473
|
+
r(t, n) && o.push(Ro(t));
|
|
4415
4474
|
}
|
|
4416
4475
|
return o;
|
|
4417
|
-
}, e.kw_set_dict_value =
|
|
4418
|
-
e && !
|
|
4476
|
+
}, e.kw_set_dict_value = ml, e.kw_set_local_storage_value = Nl, e.kw_set_subdict_value = hl, e.kwid_collect = Al, e.kwid_find_one_record = function(e, t, n, r, o) {
|
|
4477
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4419
4478
|
let l = Al(e, t, n, r, o);
|
|
4420
4479
|
return l && 0 !== l.length ? l[0] : null;
|
|
4421
4480
|
}, e.kwid_get_ids = function(e, t) {
|
|
4422
|
-
if (e && !
|
|
4481
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return [];
|
|
4423
4482
|
let n = [];
|
|
4424
|
-
if (
|
|
4425
|
-
else if (
|
|
4426
|
-
else
|
|
4427
|
-
if (
|
|
4428
|
-
else if (
|
|
4429
|
-
let r =
|
|
4483
|
+
if (Jo(t)) n.push(t);
|
|
4484
|
+
else if (Bo(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
4485
|
+
else Yo(t) && t.forEach(function(t) {
|
|
4486
|
+
if (Jo(t)) Zo(t) || n.push(t);
|
|
4487
|
+
else if (Bo(t)) {
|
|
4488
|
+
let r = gl(e, t, "id", 0, 0);
|
|
4430
4489
|
r && n.push(r);
|
|
4431
4490
|
}
|
|
4432
4491
|
});
|
|
4433
4492
|
return n;
|
|
4434
|
-
}, e.kwid_match_id =
|
|
4435
|
-
e && !
|
|
4493
|
+
}, e.kwid_match_id = Rl, e.kwid_new_dict = function(e, t, n) {
|
|
4494
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4436
4495
|
let r = {};
|
|
4437
|
-
if (
|
|
4438
|
-
else if (
|
|
4439
|
-
let o = t[n], l =
|
|
4440
|
-
|
|
4496
|
+
if (Zo(n) || (t = ul(e, t, n)), Bo(t)) r = t;
|
|
4497
|
+
else if (Yo(t)) for (let n = 0; n < t.length; n++) {
|
|
4498
|
+
let o = t[n], l = gl(e, o, "id", "", Un.KW_REQUIRED);
|
|
4499
|
+
Zo(l) || sl(r, l, o);
|
|
4441
4500
|
}
|
|
4442
4501
|
else ir(`${kt(e)} kwid_new_dict: data type unknown`);
|
|
4443
4502
|
return r;
|
|
4444
4503
|
}, e.kwid_new_list = function(e, t, n) {
|
|
4445
|
-
if (e && !
|
|
4446
|
-
if (
|
|
4504
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), Zo(n) || (t = ul(e, t, n)), Yo(t)) return t;
|
|
4505
|
+
if (Bo(t)) {
|
|
4447
4506
|
let n = [];
|
|
4448
4507
|
for (let r of Object.keys(t)) {
|
|
4449
4508
|
let o = t[r];
|
|
4450
|
-
|
|
4509
|
+
Bo(o) ? (o.id = r, n.push(o)) : ir(`${kt(e)} kwid_new_list: not a record: '${r}'`);
|
|
4451
4510
|
}
|
|
4452
4511
|
return n;
|
|
4453
4512
|
}
|
|
@@ -4455,16 +4514,16 @@
|
|
|
4455
4514
|
}, e.list2options = function(e, t, n) {
|
|
4456
4515
|
t = t || "id", n = n || "value";
|
|
4457
4516
|
let r = [];
|
|
4458
|
-
if (
|
|
4517
|
+
if (Yo(e)) for (let o = 0; o < e.length; o++) {
|
|
4459
4518
|
let l = e[o];
|
|
4460
|
-
if (
|
|
4519
|
+
if (Jo(l)) r.push({
|
|
4461
4520
|
id: e[o],
|
|
4462
4521
|
value: e[o]
|
|
4463
4522
|
});
|
|
4464
|
-
else if (
|
|
4523
|
+
else if (Bo(l)) {
|
|
4465
4524
|
let e = {};
|
|
4466
|
-
if (
|
|
4467
|
-
if (!
|
|
4525
|
+
if (ll(l, t)) {
|
|
4526
|
+
if (!ll(l, n)) {
|
|
4468
4527
|
if (!(xo(l) > 0)) {
|
|
4469
4528
|
ir("list2options(): object without field value: " + n);
|
|
4470
4529
|
continue;
|
|
@@ -4482,7 +4541,7 @@
|
|
|
4482
4541
|
r.push(e);
|
|
4483
4542
|
} else ir("list2options(): case1 not implemented");
|
|
4484
4543
|
}
|
|
4485
|
-
else if (
|
|
4544
|
+
else if (Bo(e)) for (let t of Object.keys(e)) r.push({
|
|
4486
4545
|
id: t,
|
|
4487
4546
|
value: t
|
|
4488
4547
|
});
|
|
@@ -4501,11 +4560,11 @@
|
|
|
4501
4560
|
}, r.send();
|
|
4502
4561
|
}, e.log_debug = ar, e.log_error = ir, e.log_info = function(e, ...t) {
|
|
4503
4562
|
let n = nr(e, ...t), r = Hl();
|
|
4504
|
-
Vn &&
|
|
4505
|
-
}, e.log_warning = sr, e.mask_secrets_inline = To, e.msg_iev_get_msg_type =
|
|
4563
|
+
Vn && qn("info", n) && rr(Vn, "%c" + r + " INFO: " + String(n), "color:cyan"), zn("info", n, r);
|
|
4564
|
+
}, e.log_warning = sr, e.mask_secrets_inline = To, e.msg_iev_get_msg_type = Fl, e.msg_iev_get_stack = Ll, e.msg_iev_push_stack = Pl, e.msg_iev_read_key = Cl, e.msg_iev_set_msg_type = Ul, e.msg_iev_write_key = Il, e.node_uuid = ei, e.parseBoolean = el, e.parseSVG = function(e) {
|
|
4506
4565
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
4507
4566
|
}, e.refresh_language = function(e, t) {
|
|
4508
|
-
if (!
|
|
4567
|
+
if (!Qo(t)) return void ir("You must supply a translation function");
|
|
4509
4568
|
e || (e = document);
|
|
4510
4569
|
const n = (t) => {
|
|
4511
4570
|
let n = [];
|
|
@@ -4529,22 +4588,22 @@
|
|
|
4529
4588
|
});
|
|
4530
4589
|
}, e.register_c_ievent_cli = function() {
|
|
4531
4590
|
return function(e) {
|
|
4532
|
-
if (
|
|
4591
|
+
if (Ui) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4533
4592
|
const t = [
|
|
4534
4593
|
["ST_DISCONNECTED", [
|
|
4535
4594
|
[
|
|
4536
4595
|
"EV_ON_OPEN",
|
|
4537
|
-
|
|
4596
|
+
zi,
|
|
4538
4597
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
4539
4598
|
],
|
|
4540
4599
|
[
|
|
4541
4600
|
"EV_ON_CLOSE",
|
|
4542
|
-
|
|
4601
|
+
Qi,
|
|
4543
4602
|
null
|
|
4544
4603
|
],
|
|
4545
4604
|
[
|
|
4546
4605
|
"EV_TIMEOUT",
|
|
4547
|
-
|
|
4606
|
+
Hi,
|
|
4548
4607
|
null
|
|
4549
4608
|
],
|
|
4550
4609
|
[
|
|
@@ -4556,22 +4615,22 @@
|
|
|
4556
4615
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
4557
4616
|
[
|
|
4558
4617
|
"EV_ON_MESSAGE",
|
|
4559
|
-
|
|
4618
|
+
rs,
|
|
4560
4619
|
null
|
|
4561
4620
|
],
|
|
4562
4621
|
[
|
|
4563
4622
|
"EV_IDENTITY_CARD_ACK",
|
|
4564
|
-
|
|
4623
|
+
ns,
|
|
4565
4624
|
null
|
|
4566
4625
|
],
|
|
4567
4626
|
[
|
|
4568
4627
|
"EV_ON_CLOSE",
|
|
4569
|
-
|
|
4628
|
+
Qi,
|
|
4570
4629
|
"ST_DISCONNECTED"
|
|
4571
4630
|
],
|
|
4572
4631
|
[
|
|
4573
4632
|
"EV_TIMEOUT",
|
|
4574
|
-
|
|
4633
|
+
ts,
|
|
4575
4634
|
null
|
|
4576
4635
|
],
|
|
4577
4636
|
[
|
|
@@ -4583,22 +4642,22 @@
|
|
|
4583
4642
|
["ST_SESSION", [
|
|
4584
4643
|
[
|
|
4585
4644
|
"EV_ON_MESSAGE",
|
|
4586
|
-
|
|
4645
|
+
rs,
|
|
4587
4646
|
null
|
|
4588
4647
|
],
|
|
4589
4648
|
[
|
|
4590
4649
|
"EV_MT_STATS",
|
|
4591
|
-
|
|
4650
|
+
ls,
|
|
4592
4651
|
null
|
|
4593
4652
|
],
|
|
4594
4653
|
[
|
|
4595
4654
|
"EV_MT_COMMAND",
|
|
4596
|
-
|
|
4655
|
+
is,
|
|
4597
4656
|
null
|
|
4598
4657
|
],
|
|
4599
4658
|
[
|
|
4600
4659
|
"EV_ON_CLOSE",
|
|
4601
|
-
|
|
4660
|
+
Qi,
|
|
4602
4661
|
"ST_DISCONNECTED"
|
|
4603
4662
|
],
|
|
4604
4663
|
[
|
|
@@ -4609,7 +4668,7 @@
|
|
|
4609
4668
|
]],
|
|
4610
4669
|
[null, null]
|
|
4611
4670
|
];
|
|
4612
|
-
return (
|
|
4671
|
+
return (Ui = Ke(e, [
|
|
4613
4672
|
["EV_ON_MESSAGE", F.EVF_OUTPUT_EVENT],
|
|
4614
4673
|
["EV_IDENTITY_CARD_ACK", F.EVF_PUBLIC_EVENT],
|
|
4615
4674
|
["EV_ON_ID_NAK", F.EVF_OUTPUT_EVENT],
|
|
@@ -4620,37 +4679,37 @@
|
|
|
4620
4679
|
["EV_ON_OPEN_ERROR", F.EVF_OUTPUT_EVENT | F.EVF_NO_WARN_SUBS],
|
|
4621
4680
|
["EV_TIMEOUT", 0],
|
|
4622
4681
|
[null, 0]
|
|
4623
|
-
], t,
|
|
4682
|
+
], t, ss, 0, Ci, Li, 0, 0, Ii, P.gcflag_no_check_output_events)) ? 0 : -1;
|
|
4624
4683
|
}("C_IEVENT_CLI");
|
|
4625
4684
|
}, e.register_c_timer = function() {
|
|
4626
4685
|
return function(e) {
|
|
4627
|
-
if (
|
|
4686
|
+
if (bi) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4628
4687
|
const t = [["ST_IDLE", [[
|
|
4629
4688
|
"EV_TIMEOUT",
|
|
4630
|
-
|
|
4689
|
+
pi,
|
|
4631
4690
|
null
|
|
4632
4691
|
]]]];
|
|
4633
|
-
return (
|
|
4692
|
+
return (bi = Ke(e, [
|
|
4634
4693
|
["EV_TIMEOUT", F.EVF_OUTPUT_EVENT],
|
|
4635
4694
|
["EV_TIMEOUT_PERIODIC", F.EVF_OUTPUT_EVENT],
|
|
4636
4695
|
[0, 0]
|
|
4637
|
-
], t,
|
|
4696
|
+
], t, mi, 0, gi, di, 0, 0, 0, P.gcflag_manual_start)) ? 0 : -1;
|
|
4638
4697
|
}("C_TIMER");
|
|
4639
4698
|
}, e.register_c_yuno = function() {
|
|
4640
4699
|
return function(e) {
|
|
4641
|
-
if (
|
|
4700
|
+
if (Oi) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4642
4701
|
const t = [["ST_IDLE", [[
|
|
4643
4702
|
"EV_TIMEOUT_PERIODIC",
|
|
4644
|
-
|
|
4703
|
+
Ai,
|
|
4645
4704
|
null
|
|
4646
4705
|
]]]];
|
|
4647
|
-
return (
|
|
4706
|
+
return (Oi = Ke(e, [["EV_TIMEOUT_PERIODIC", F.EVF_OUTPUT_EVENT | F.EVF_NO_WARN_SUBS], [0, 0]], t, Di, 0, Ti, ji, 0, 0, 0, 0)) ? 0 : -1;
|
|
4648
4707
|
}("C_YUNO");
|
|
4649
4708
|
}, e.safeSrc = function(e) {
|
|
4650
4709
|
if (!e) return "";
|
|
4651
4710
|
const t = String(e).trim();
|
|
4652
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
4653
|
-
}, e.sdata_flag_t =
|
|
4711
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Wl(t);
|
|
4712
|
+
}, e.sdata_flag_t = R, e.send_http_json_post = function(e, t, n) {
|
|
4654
4713
|
let r = new XMLHttpRequest();
|
|
4655
4714
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
4656
4715
|
4 === r.readyState && n(r.status, r.responseText);
|
|
@@ -4673,16 +4732,16 @@
|
|
|
4673
4732
|
}
|
|
4674
4733
|
} else xn = e;
|
|
4675
4734
|
}, e.set_remote_log_functions = Xn, e.set_strings_are_text = function(e) {
|
|
4676
|
-
|
|
4677
|
-
}, e.set_timeout =
|
|
4678
|
-
return
|
|
4735
|
+
Yl = !!e;
|
|
4736
|
+
}, e.set_timeout = yi, e.set_timeout_periodic = vi, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = kl, e.strcasecmp = nl, e.strcmp = tl, e.strings_are_text = function() {
|
|
4737
|
+
return Yl;
|
|
4679
4738
|
}, e.strncmp = function(e, t, n) {
|
|
4680
4739
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
4681
4740
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
4682
4741
|
}, e.strs_in_list = function(e, t, n) {
|
|
4683
4742
|
if (!e) return ir("ERROR: strs_in_list() list empty"), !1;
|
|
4684
4743
|
if (!t) return ir("ERROR: strs_in_list() str empty"), !1;
|
|
4685
|
-
for (let r = 0; r < t.length; r++) if (
|
|
4744
|
+
for (let r = 0; r < t.length; r++) if (kl(e, t[r], n)) return !0;
|
|
4686
4745
|
return !1;
|
|
4687
4746
|
}, e.strstr = function(e, t, n) {
|
|
4688
4747
|
var r;
|
|
@@ -4701,13 +4760,13 @@
|
|
|
4701
4760
|
placeholder: void 0,
|
|
4702
4761
|
fkey: null
|
|
4703
4762
|
};
|
|
4704
|
-
if (
|
|
4763
|
+
if (Jo(t)) {
|
|
4705
4764
|
let e = t.split(".");
|
|
4706
4765
|
for (let t = 0; t < e.length; t++) {
|
|
4707
4766
|
let r = e[t];
|
|
4708
|
-
if (
|
|
4709
|
-
else if (
|
|
4710
|
-
else if (
|
|
4767
|
+
if (kl(ui, r)) n.real_type || (n.real_type = r);
|
|
4768
|
+
else if (kl(ci, r)) n.type || (n.type = r);
|
|
4769
|
+
else if (kl(_i, r)) switch (r) {
|
|
4711
4770
|
case "writable":
|
|
4712
4771
|
n.is_writable = !0;
|
|
4713
4772
|
break;
|
|
@@ -4719,7 +4778,7 @@
|
|
|
4719
4778
|
}
|
|
4720
4779
|
}
|
|
4721
4780
|
n.real_type || (n.real_type = "string");
|
|
4722
|
-
} else
|
|
4781
|
+
} else Bo(t) ? (n = fi(t), n.name || (n.name = e), n.header || (n.header = e)) : Yo(t) && (n.real_type = "array", n.enum_list = t);
|
|
4723
4782
|
return n.type || (n.type = n.real_type), n;
|
|
4724
4783
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
4725
4784
|
const n = e, r = performance.now();
|
|
@@ -4731,8 +4790,8 @@
|
|
|
4731
4790
|
total: a
|
|
4732
4791
|
};
|
|
4733
4792
|
} };
|
|
4734
|
-
}, e.trace_json = _r, e.trace_json_masked = $o, e.trace_level_t = B, e.trace_msg = ur, e.treedb_decoder_fkey =
|
|
4735
|
-
if (
|
|
4793
|
+
}, e.trace_json = _r, e.trace_json_masked = $o, e.trace_level_t = B, e.trace_msg = ur, e.treedb_decoder_fkey = ai, e.treedb_decoder_hook = function(e, t) {
|
|
4794
|
+
if (Jo(t)) {
|
|
4736
4795
|
if (-1 === t.indexOf("^")) {
|
|
4737
4796
|
let n, r = e.hook;
|
|
4738
4797
|
if (1 !== Vo(r)) return ir("bad hook 1"), ir(e), ir(t), null;
|
|
@@ -4753,17 +4812,17 @@
|
|
|
4753
4812
|
};
|
|
4754
4813
|
}
|
|
4755
4814
|
}
|
|
4756
|
-
return
|
|
4815
|
+
return Bo(t) ? {
|
|
4757
4816
|
topic_name: t.topic_name,
|
|
4758
4817
|
id: t.id
|
|
4759
4818
|
} : (ir("bad hook 3"), ir(e), ir(t), null);
|
|
4760
4819
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
4761
|
-
let n =
|
|
4820
|
+
let n = ai(e, t);
|
|
4762
4821
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
4763
|
-
}, e.treedb_get_field_desc =
|
|
4764
|
-
if (
|
|
4822
|
+
}, e.treedb_get_field_desc = fi, e.treedb_hook_data_size = function(e) {
|
|
4823
|
+
if (Yo(e) && 1 === xo(e)) {
|
|
4765
4824
|
let t = e[0];
|
|
4766
|
-
return
|
|
4825
|
+
return ll(t, "size") ? t.size : 1;
|
|
4767
4826
|
}
|
|
4768
4827
|
return xo(e);
|
|
4769
4828
|
}, e.vsprintf = function(e, t) {
|