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