@yuneta/gobj-js 7.26.27 → 7.26.28
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 +140 -49
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +755 -701
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +140 -49
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +292 -239
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +140 -49
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +742 -688
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +140 -49
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +742 -688
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.cjs.min.js
CHANGED
|
@@ -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
559
|
function Ae(e) {
|
|
560
|
-
return
|
|
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
562
|
function Re(e, t, n) {
|
|
563
|
-
if (
|
|
563
|
+
if (Yo(t) || (t = ""), E(e)) return {
|
|
564
564
|
value: t,
|
|
565
565
|
refused: null
|
|
566
566
|
};
|
|
@@ -655,9 +655,9 @@ 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
|
};
|
|
@@ -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) ? Re(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
|
|
@@ -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,7 +967,7 @@ 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
|
}
|
|
@@ -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
|
}
|
|
@@ -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);
|
|
@@ -1196,89 +1217,102 @@ function $t() {
|
|
|
1196
1217
|
return e ? en(e, "yuno_id") : "";
|
|
1197
1218
|
}
|
|
1198
1219
|
function At(e) {
|
|
1199
|
-
return
|
|
1220
|
+
return Qo(e) ? e.gobj_name : (sr("gobj bad type"), null);
|
|
1200
1221
|
}
|
|
1201
1222
|
function Rt(e) {
|
|
1202
|
-
return
|
|
1223
|
+
return Qo(e) ? e.gclass.gclass_name : (sr("gobj NULL of bad type"), null);
|
|
1203
1224
|
}
|
|
1204
1225
|
function xt(e) {
|
|
1205
|
-
return
|
|
1226
|
+
return Qo(e) ? e.gclass.gclass_name + "^" + At(e) : (sr("gobj bad type"), null);
|
|
1206
1227
|
}
|
|
1207
1228
|
function Dt(e) {
|
|
1208
|
-
if (!
|
|
1229
|
+
if (!Qo(e)) return sr("gobj NULL of bad type"), null;
|
|
1209
1230
|
let t = xt(e), n = kt(e);
|
|
1210
1231
|
for (; n;) t = xt(n) + "`" + t, n = kt(n);
|
|
1211
1232
|
return t;
|
|
1212
1233
|
}
|
|
1213
1234
|
function kt(e) {
|
|
1214
|
-
return
|
|
1235
|
+
return Qo(e) ? e.parent : (sr("gobj NULL of bad type"), null);
|
|
1215
1236
|
}
|
|
1216
1237
|
function Ct(e) {
|
|
1217
|
-
return
|
|
1238
|
+
return Qo(e) ? !!(e.gobj_flag & I.gobj_flag_volatil) : (sr("gobj NULL of bad type"), null);
|
|
1218
1239
|
}
|
|
1219
1240
|
function It(e) {
|
|
1220
|
-
return
|
|
1241
|
+
return Qo(e) ? !!(e.gobj_flag & I.gobj_flag_pure_child) : (sr("gobj NULL of bad type"), null);
|
|
1221
1242
|
}
|
|
1222
1243
|
function Pt(e) {
|
|
1223
|
-
return !
|
|
1244
|
+
return !Qo(e) || !!(e.obflag & (P.obflag_destroyed | P.obflag_destroying));
|
|
1224
1245
|
}
|
|
1225
1246
|
function Lt(e) {
|
|
1226
|
-
return
|
|
1247
|
+
return Qo(e) ? e.bottom_gobj : (sr("gobj NULL of bad type"), null);
|
|
1227
1248
|
}
|
|
1228
1249
|
function Ut(e, t) {
|
|
1229
|
-
if (!
|
|
1250
|
+
if (!Qo(e)) return sr("gobj NULL of bad type"), null;
|
|
1230
1251
|
e.bottom_gobj && t && lr(`${xt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
1231
1252
|
}
|
|
1232
1253
|
function Ft(e, t, n) {
|
|
1233
|
-
return
|
|
1254
|
+
return Qo(e) ? t ? Ve(e.gclass, t, n) : e.gclass.attrs_table : (sr("gobj NULL of bad type"), null);
|
|
1234
1255
|
}
|
|
1235
1256
|
function Mt(e, t, n, r, o) {
|
|
1236
|
-
return Pt(e) ? (sr("gobj NULL, destroying, or bad type"), 0) :
|
|
1257
|
+
return Pt(e) ? (sr("gobj NULL, destroying, or bad type"), 0) : function(e, t, n, r, o, s) {
|
|
1258
|
+
let l, i = [...e.dl_children];
|
|
1259
|
+
if (n & U.WALK_LAST2FIRST) for (let n = i.length; n > 0; n--) {
|
|
1260
|
+
if (l = i[n - 1], Wt(l, e, t)) continue;
|
|
1261
|
+
t.add(l);
|
|
1262
|
+
let a = Vt(r(l, o, s));
|
|
1263
|
+
if (a < 0) return a;
|
|
1264
|
+
}
|
|
1265
|
+
else for (let n = 0; n < i.length; n++) {
|
|
1266
|
+
if (l = i[n], Wt(l, e, t)) continue;
|
|
1267
|
+
t.add(l);
|
|
1268
|
+
let a = Vt(r(l, o, s));
|
|
1269
|
+
if (a < 0) return a;
|
|
1270
|
+
}
|
|
1271
|
+
return 0;
|
|
1272
|
+
}(e, /* @__PURE__ */ new Set(), t, n, r, o);
|
|
1237
1273
|
}
|
|
1238
1274
|
function Gt(e, t, n, r, o) {
|
|
1239
|
-
return Pt(e) ? (sr("gobj NULL, destroying, or bad type"), 0) : Bt(e
|
|
1275
|
+
return Pt(e) ? (sr("gobj NULL, destroying, or bad type"), 0) : Bt(e, /* @__PURE__ */ new Set(), t, n, r, o);
|
|
1240
1276
|
}
|
|
1241
1277
|
function Vt(e) {
|
|
1242
1278
|
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
1279
|
}
|
|
1244
|
-
function Wt(e, t, n
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1280
|
+
function Wt(e, t, n) {
|
|
1281
|
+
return Pt(e) || e.parent !== t || n.has(e);
|
|
1282
|
+
}
|
|
1283
|
+
function Kt(e, t, n, r, o, s) {
|
|
1284
|
+
let l = [...e.dl_children];
|
|
1285
|
+
n & U.WALK_LAST2FIRST && l.reverse();
|
|
1286
|
+
let i = [];
|
|
1287
|
+
for (const n of l) {
|
|
1288
|
+
if (Wt(n, e, t)) continue;
|
|
1289
|
+
t.add(n), i.push(n);
|
|
1290
|
+
let l = Vt(r(n, o, s));
|
|
1291
|
+
if (l < 0) return l;
|
|
1250
1292
|
}
|
|
1251
|
-
|
|
1252
|
-
if (
|
|
1253
|
-
let
|
|
1254
|
-
if (
|
|
1293
|
+
for (const e of i) {
|
|
1294
|
+
if (Pt(e)) continue;
|
|
1295
|
+
let l = Kt(e, t, n, r, o, s);
|
|
1296
|
+
if (l < 0) return l;
|
|
1255
1297
|
}
|
|
1256
1298
|
return 0;
|
|
1257
1299
|
}
|
|
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;
|
|
1300
|
+
function Bt(e, t, n, r, o, s) {
|
|
1301
|
+
if (n & U.WALK_BYLEVEL) return Kt(e, t, n, r, o, s);
|
|
1302
|
+
let l, i, a = [...e.dl_children];
|
|
1303
|
+
if (n & U.WALK_BOTTOM2TOP) {
|
|
1304
|
+
for (let u = a.length; u > 0; u--) if (i = a[u - 1], !Wt(i, e, t)) {
|
|
1305
|
+
if (l = Bt(i, t, n, r, o, s), l < 0) return l;
|
|
1306
|
+
if (!Pt(i) && (t.add(i), l = Vt(r(i, o, s)), l < 0)) return l;
|
|
1273
1307
|
}
|
|
1274
|
-
} else for (let
|
|
1275
|
-
if (
|
|
1276
|
-
if (0 ===
|
|
1308
|
+
} else for (let u = 0; u < a.length; u++) if (i = a[u], !Wt(i, e, t)) {
|
|
1309
|
+
if (t.add(i), l = Vt(r(i, o, s)), l < 0) return l;
|
|
1310
|
+
if (0 === l && !Pt(i) && (l = Bt(i, t, n, r, o, s), l < 0)) return l;
|
|
1277
1311
|
}
|
|
1278
1312
|
return 0;
|
|
1279
1313
|
}
|
|
1280
1314
|
function Yt(e, t) {
|
|
1281
|
-
if (!
|
|
1315
|
+
if (!Qo(e)) return sr("gobj NULL of bad type"), !1;
|
|
1282
1316
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
1283
1317
|
t.__disabled__;
|
|
1284
1318
|
let s = t.__state__;
|
|
@@ -1290,7 +1324,7 @@ function Yt(e, t) {
|
|
|
1290
1324
|
}
|
|
1291
1325
|
if (s && s !== cn(e)) return !1;
|
|
1292
1326
|
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 &&
|
|
1327
|
+
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
1328
|
return !0;
|
|
1295
1329
|
}
|
|
1296
1330
|
function Jt(e, t) {
|
|
@@ -1302,7 +1336,7 @@ function Jt(e, t) {
|
|
|
1302
1336
|
}
|
|
1303
1337
|
return null;
|
|
1304
1338
|
}
|
|
1305
|
-
function
|
|
1339
|
+
function qt(e, t) {
|
|
1306
1340
|
if (!t) return null;
|
|
1307
1341
|
let n = t.split("`");
|
|
1308
1342
|
if (!function(e, t) {
|
|
@@ -1319,10 +1353,10 @@ function Ht(e, t) {
|
|
|
1319
1353
|
let r = n[1].split("^"), o = {};
|
|
1320
1354
|
1 === r.length ? o.__gobj_name__ = r : (o.__gclass_name__ = r[0], o.__gobj_name__ = r[1]);
|
|
1321
1355
|
let s = Jt(e, o);
|
|
1322
|
-
return s ? (n.splice(0, 1), n = n.join("`"),
|
|
1356
|
+
return s ? (n.splice(0, 1), n = n.join("`"), qt(s, n)) : null;
|
|
1323
1357
|
}
|
|
1324
|
-
function
|
|
1325
|
-
return !
|
|
1358
|
+
function Ht(e, t) {
|
|
1359
|
+
return !Xo(t) && !!Ve(e.gclass, t, !1);
|
|
1326
1360
|
}
|
|
1327
1361
|
function zt(e, t, n) {
|
|
1328
1362
|
let r = e.jn_attrs;
|
|
@@ -1345,21 +1379,21 @@ function Qt(e, t, n) {
|
|
|
1345
1379
|
}
|
|
1346
1380
|
function Xt(e, t) {
|
|
1347
1381
|
if (t) {
|
|
1348
|
-
if (0 ===
|
|
1349
|
-
if (0 ===
|
|
1350
|
-
if (0 ===
|
|
1351
|
-
if (0 ===
|
|
1382
|
+
if (0 === ts(t, "__disabled__")) return Tt(e);
|
|
1383
|
+
if (0 === ts(t, "__running__")) return Et(e);
|
|
1384
|
+
if (0 === ts(t, "__playing__")) return Ot(e);
|
|
1385
|
+
if (0 === ts(t, "__service__")) return jt(e);
|
|
1352
1386
|
}
|
|
1353
1387
|
let n = Ge(e, t, !1);
|
|
1354
1388
|
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
1389
|
}
|
|
1356
1390
|
function Zt(e, t) {
|
|
1357
|
-
t &&
|
|
1391
|
+
t && ts(t, "__trace_level__");
|
|
1358
1392
|
let n = Ge(e, t, !1);
|
|
1359
1393
|
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
1394
|
}
|
|
1361
1395
|
function en(e, t) {
|
|
1362
|
-
if (t && 0 ===
|
|
1396
|
+
if (t && 0 === ts(t, "__state__")) return cn(e);
|
|
1363
1397
|
let n = Ge(e, t, !1);
|
|
1364
1398
|
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
1399
|
}
|
|
@@ -1368,7 +1402,7 @@ function tn(e, t) {
|
|
|
1368
1402
|
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
1403
|
}
|
|
1370
1404
|
function nn(e, n, r, o) {
|
|
1371
|
-
if (!
|
|
1405
|
+
if (!Yo(n)) return sr(t("gobj_write_attr(%s): path must be a string", xt(e))), -1;
|
|
1372
1406
|
let s, l = e.jn_attrs, i = n.split("`");
|
|
1373
1407
|
if (i.length <= 1) {
|
|
1374
1408
|
let o = n;
|
|
@@ -1396,7 +1430,7 @@ function on(e, t, n, r) {
|
|
|
1396
1430
|
let o;
|
|
1397
1431
|
if (E(n)) {
|
|
1398
1432
|
if (null == r) return { value: "" };
|
|
1399
|
-
if (
|
|
1433
|
+
if (Yo(r)) return { value: r };
|
|
1400
1434
|
o = {
|
|
1401
1435
|
value: Le(r),
|
|
1402
1436
|
refused: Pe
|
|
@@ -1404,7 +1438,7 @@ function on(e, t, n, r) {
|
|
|
1404
1438
|
} else o = xe(n, r);
|
|
1405
1439
|
if (void 0 === o.value) {
|
|
1406
1440
|
let s = e;
|
|
1407
|
-
for (; s && !
|
|
1441
|
+
for (; s && !Ht(s, t);) s = s.bottom_gobj;
|
|
1408
1442
|
const l = s ? Ft(s, t, !1) : null;
|
|
1409
1443
|
return Ue(e, {
|
|
1410
1444
|
name: t,
|
|
@@ -1426,7 +1460,7 @@ function ln(e, t, n) {
|
|
|
1426
1460
|
let r = Ge(e, t, !1);
|
|
1427
1461
|
if (r) {
|
|
1428
1462
|
const o = on(e, t, v.DTP_BOOLEAN, n);
|
|
1429
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1463
|
+
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
1464
|
}
|
|
1431
1465
|
return sr(`${xt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1432
1466
|
}
|
|
@@ -1434,7 +1468,7 @@ function an(e, t, n) {
|
|
|
1434
1468
|
let r = Ge(e, t, !1);
|
|
1435
1469
|
if (r) {
|
|
1436
1470
|
const o = on(e, t, v.DTP_INTEGER, n);
|
|
1437
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1471
|
+
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
1472
|
}
|
|
1439
1473
|
return sr(`${xt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1440
1474
|
}
|
|
@@ -1442,7 +1476,7 @@ function un(e, t, n) {
|
|
|
1442
1476
|
let r = Ge(e, t, !1);
|
|
1443
1477
|
if (r) {
|
|
1444
1478
|
const o = on(e, t, v.DTP_STRING, n);
|
|
1445
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1479
|
+
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
1480
|
}
|
|
1447
1481
|
return sr(`${xt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1448
1482
|
}
|
|
@@ -1458,10 +1492,10 @@ function _n(e, n) {
|
|
|
1458
1492
|
return (o || s) && (1 === V || W(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Rt(e), At(e), cn(e), e.last_state.state_name))), !0;
|
|
1459
1493
|
}
|
|
1460
1494
|
function cn(e) {
|
|
1461
|
-
return
|
|
1495
|
+
return Qo(e) ? e.current_state.state_name : (sr("hgobj NULL"), "");
|
|
1462
1496
|
}
|
|
1463
1497
|
function fn(e, t, n) {
|
|
1464
|
-
if (!
|
|
1498
|
+
if (!Qo(e)) return sr("gobj NULL of bad type"), null;
|
|
1465
1499
|
let r = Qe(e.gclass, t);
|
|
1466
1500
|
if (r) return r;
|
|
1467
1501
|
if (n) {
|
|
@@ -1483,7 +1517,7 @@ function dn(e, t, n) {
|
|
|
1483
1517
|
}
|
|
1484
1518
|
var pn = [], bn = !1;
|
|
1485
1519
|
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) :
|
|
1520
|
+
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
1521
|
dst: e,
|
|
1488
1522
|
event: n,
|
|
1489
1523
|
kw: r,
|
|
@@ -1549,7 +1583,7 @@ function Tn(e, n, r, o) {
|
|
|
1549
1583
|
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
1584
|
else {
|
|
1551
1585
|
let r = "";
|
|
1552
|
-
i.action && (r =
|
|
1586
|
+
i.action && (r = Zs(i.action)), W(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Rt(e), At(e), s.state_name, "", n || "", "", r, o && !o.running ? "!!" : "", Rt(o), At(o)));
|
|
1553
1587
|
}
|
|
1554
1588
|
r && ne(e) && Mo(r) && No(r);
|
|
1555
1589
|
}
|
|
@@ -1568,7 +1602,7 @@ function Tn(e, n, r, o) {
|
|
|
1568
1602
|
} finally {
|
|
1569
1603
|
vn(a);
|
|
1570
1604
|
}
|
|
1571
|
-
return l && 1 !== V && !a.destroyed && W(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Rt(e), At(e), e.current_state.state_name, n || "",
|
|
1605
|
+
return l && 1 !== V && !a.destroyed && W(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Rt(e), At(e), e.current_state.state_name, n || "", Jo(u) ? u : 0)), m--, u;
|
|
1572
1606
|
}
|
|
1573
1607
|
var jn = Object.freeze({
|
|
1574
1608
|
__rename_event_name__: 1,
|
|
@@ -1601,34 +1635,34 @@ var Sn = [
|
|
|
1601
1635
|
];
|
|
1602
1636
|
function wn(e, t) {
|
|
1603
1637
|
let n = e ? e.__config__ : null;
|
|
1604
|
-
if (!
|
|
1638
|
+
if (!Ko(n) || !os(n, "__hard_subscription__") && !os(n, "__own_event__") && !os(n, "__rename_event_name__")) return {
|
|
1605
1639
|
kw: e,
|
|
1606
1640
|
renamed_event: ""
|
|
1607
1641
|
};
|
|
1608
1642
|
let r = Ro({}, e), o = Ro({}, n);
|
|
1609
1643
|
r.__config__ = o;
|
|
1610
|
-
let s = "", l = o.__rename_event_name__, i = "string" != typeof l ||
|
|
1644
|
+
let s = "", l = o.__rename_event_name__, i = "string" != typeof l || Xo(l) ? null : On(l, 0, !1);
|
|
1611
1645
|
return i && (s = i.event_name, delete o.__rename_event_name__, t && Vo(r.__global__) > 0 && (r.__global__ = Ro(Ro({}, r.__global__), { __original_event_name__: t }))), delete o.__hard_subscription__, delete o.__own_event__, {
|
|
1612
1646
|
kw: r,
|
|
1613
1647
|
renamed_event: s
|
|
1614
1648
|
};
|
|
1615
1649
|
}
|
|
1616
1650
|
function Nn(e, t, n, r, o, s) {
|
|
1617
|
-
let l =
|
|
1618
|
-
if (t && t !==
|
|
1619
|
-
let t =
|
|
1651
|
+
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;
|
|
1652
|
+
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) {
|
|
1653
|
+
let t = ds(null, e, "__config__", null);
|
|
1620
1654
|
Vo(t) > 0 && Ao(t, l) || (_ = !1);
|
|
1621
1655
|
}
|
|
1622
1656
|
if (Vo(i) > 0) {
|
|
1623
|
-
let t =
|
|
1657
|
+
let t = ds(null, e, "__global__", null);
|
|
1624
1658
|
Vo(t) > 0 && Ao(t, i) || (_ = !1);
|
|
1625
1659
|
}
|
|
1626
1660
|
if (Vo(a) > 0) {
|
|
1627
|
-
let t =
|
|
1661
|
+
let t = ds(null, e, "__local__", null);
|
|
1628
1662
|
Vo(t) > 0 && Ao(t, a) || (_ = !1);
|
|
1629
1663
|
}
|
|
1630
1664
|
if (Vo(u) > 0) {
|
|
1631
|
-
let t =
|
|
1665
|
+
let t = ps(null, e, "__filter__", null);
|
|
1632
1666
|
Vo(t) > 0 && Ao(t, u) || (_ = !1);
|
|
1633
1667
|
}
|
|
1634
1668
|
return _;
|
|
@@ -1645,8 +1679,8 @@ function An(e, t) {
|
|
|
1645
1679
|
return e.indexOf(t);
|
|
1646
1680
|
}
|
|
1647
1681
|
function Rn(e, n, r, o) {
|
|
1648
|
-
let s =
|
|
1649
|
-
if (!!(
|
|
1682
|
+
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);
|
|
1683
|
+
if (!!(cs(e, n, "subs_flag", null, Pn.KW_REQUIRED) & jn.__hard_subscription__) && !r) return -1;
|
|
1650
1684
|
let a = ee(l) || ee(s);
|
|
1651
1685
|
if (An(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
1686
|
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);
|
|
@@ -1665,10 +1699,10 @@ function xn(e, n, r, o) {
|
|
|
1665
1699
|
]);
|
|
1666
1700
|
if (Object.keys(r).forEach((t) => {
|
|
1667
1701
|
s.has(t) || sr(`${xt(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1668
|
-
}),
|
|
1702
|
+
}), Xo(n)) n = "";
|
|
1669
1703
|
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
1704
|
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 (
|
|
1705
|
+
for (let t = 0; t < i.length; t++) if (cs(e, i[t], "subs_flag", 0, Pn.KW_REQUIRED) & jn.__hard_subscription__) {
|
|
1672
1706
|
a = i[t];
|
|
1673
1707
|
break;
|
|
1674
1708
|
}
|
|
@@ -1679,29 +1713,29 @@ function xn(e, n, r, o) {
|
|
|
1679
1713
|
Po(o, "event", t), Po(o, "subscriber", r), Po(o, "publisher", e);
|
|
1680
1714
|
let s = 0;
|
|
1681
1715
|
if (n) {
|
|
1682
|
-
let r =
|
|
1716
|
+
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
1717
|
if (Vo(l) > 0 && Po(o, "__global__", $o(l)), Vo(r) > 0) {
|
|
1684
1718
|
let n = $o(r);
|
|
1685
1719
|
Po(o, "__config__", n);
|
|
1686
|
-
let l =
|
|
1687
|
-
if (!
|
|
1720
|
+
let l = fs(e, n, "__rename_event_name__", "");
|
|
1721
|
+
if (!Xo(l)) {
|
|
1688
1722
|
let r = On(l, 0, !1);
|
|
1689
1723
|
if (r) {
|
|
1690
1724
|
Po(o, "renamed_event", r.event_name), delete n.__rename_event_name__, s |= jn.__rename_event_name__;
|
|
1691
|
-
let l =
|
|
1692
|
-
|
|
1725
|
+
let l = ds(e, o, "__global__", null);
|
|
1726
|
+
Ko(l) || (l = {}, Po(o, "__global__", l)), l.__original_event_name__ = t;
|
|
1693
1727
|
} else sr(`${xt(e)}: EVENT NOT FOUND (__rename_event_name__: ${l})`);
|
|
1694
1728
|
}
|
|
1695
|
-
if (
|
|
1696
|
-
let t =
|
|
1729
|
+
if (os(n, "__hard_subscription__")) {
|
|
1730
|
+
let t = _s(e, n, "__hard_subscription__", !1);
|
|
1697
1731
|
Co(n, "__hard_subscription__"), t && (s |= jn.__hard_subscription__);
|
|
1698
1732
|
}
|
|
1699
|
-
if (
|
|
1700
|
-
let t =
|
|
1733
|
+
if (os(n, "__own_event__")) {
|
|
1734
|
+
let t = _s(e, n, "__own_event__", !1);
|
|
1701
1735
|
Co(n, "__own_event__"), t && (s |= jn.__own_event__);
|
|
1702
1736
|
}
|
|
1703
1737
|
}
|
|
1704
|
-
Vo(i) > 0 && Po(o, "__local__", $o(i)), Vo(a) > 0 && Po(o, "__filter__", $o(a)),
|
|
1738
|
+
Vo(i) > 0 && Po(o, "__local__", $o(i)), Vo(a) > 0 && Po(o, "__filter__", $o(a)), Xo(u) || Po(o, "__service__", u);
|
|
1705
1739
|
}
|
|
1706
1740
|
return Po(o, "subs_flag", s), o;
|
|
1707
1741
|
}(e, n, r, o);
|
|
@@ -1724,8 +1758,8 @@ function Cn(e, t, n, r) {
|
|
|
1724
1758
|
return $n(e.dl_subscribings, r, t, null, n, e);
|
|
1725
1759
|
}
|
|
1726
1760
|
function In(e, n, r) {
|
|
1727
|
-
if (
|
|
1728
|
-
if (
|
|
1761
|
+
if (Ko(r) || (r = {}), !e || e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return sr("gobj NULL or DESTROYED"), -1;
|
|
1762
|
+
if (Xo(n)) return sr(`${xt(e)}: event EMPTY`), -1;
|
|
1729
1763
|
let o = fn(e, n, !0);
|
|
1730
1764
|
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
1765
|
let s = (ee(e) || re(e, n)) && !oe(e, n);
|
|
@@ -1743,20 +1777,20 @@ function In(e, n, r) {
|
|
|
1743
1777
|
if (t < 0) break;
|
|
1744
1778
|
if (!t) continue;
|
|
1745
1779
|
}
|
|
1746
|
-
let c =
|
|
1780
|
+
let c = gs(e, _, "subscriber", null, Pn.KW_REQUIRED);
|
|
1747
1781
|
if (!c || Pt(c)) continue;
|
|
1748
|
-
let f =
|
|
1749
|
-
if (
|
|
1750
|
-
|
|
1751
|
-
let o =
|
|
1752
|
-
|
|
1782
|
+
let f = cs(e, _, "subs_flag", 0, Pn.KW_REQUIRED), g = fs(e, _, "event", "", Pn.KW_REQUIRED);
|
|
1783
|
+
if (Xo(g) || 0 === ts(g, n)) {
|
|
1784
|
+
ds(e, _, "__config__", null, 0);
|
|
1785
|
+
let o = ds(e, _, "__global__", null, 0), l = ds(e, _, "__local__", null, 0), g = ps(e, _, "__filter__", null, 0), d = _.renamed_event;
|
|
1786
|
+
Xo(d) && (d = n);
|
|
1753
1787
|
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 =
|
|
1788
|
+
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
1789
|
if (!p) continue;
|
|
1756
1790
|
let b = fn(c, n, !0);
|
|
1757
1791
|
if (b && b.event_flag & L.EVF_SYSTEM_EVENT && !gn(c, b.event_name, 0)) continue;
|
|
1758
1792
|
let m = r;
|
|
1759
|
-
(Vo(l) > 0 || Vo(o) > 0) && (m = Ro({}, r)), Vo(l) > 0 &&
|
|
1793
|
+
(Vo(l) > 0 || Vo(o) > 0) && (m = Ro({}, r)), Vo(l) > 0 && rs(m, l), Vo(o) > 0 && Ro(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
1794
|
let h = Tn(c, d, m, e);
|
|
1761
1795
|
if (h < 0 && f & jn.__own_event__) {
|
|
1762
1796
|
i = -1;
|
|
@@ -1802,9 +1836,9 @@ function Jn(e, t) {
|
|
|
1802
1836
|
return !0;
|
|
1803
1837
|
}
|
|
1804
1838
|
}
|
|
1805
|
-
var
|
|
1806
|
-
function
|
|
1807
|
-
|
|
1839
|
+
var qn = !1;
|
|
1840
|
+
function Hn(e, t, n) {
|
|
1841
|
+
qn || (function(e, t, n) {
|
|
1808
1842
|
let r = t;
|
|
1809
1843
|
"json" === e && (r = Xn(t)), Kn.push([
|
|
1810
1844
|
e,
|
|
@@ -1814,12 +1848,12 @@ function qn(e, t, n) {
|
|
|
1814
1848
|
}(e, t, n), zn(e, t, n));
|
|
1815
1849
|
}
|
|
1816
1850
|
function zn(e, t, n) {
|
|
1817
|
-
if (Vn && !
|
|
1818
|
-
|
|
1851
|
+
if (Vn && !qn) {
|
|
1852
|
+
qn = !0;
|
|
1819
1853
|
try {
|
|
1820
1854
|
Vn(e, t, n);
|
|
1821
1855
|
} catch (e) {} finally {
|
|
1822
|
-
|
|
1856
|
+
qn = !1;
|
|
1823
1857
|
}
|
|
1824
1858
|
}
|
|
1825
1859
|
}
|
|
@@ -1897,23 +1931,23 @@ function or(e, ...t) {
|
|
|
1897
1931
|
}
|
|
1898
1932
|
}
|
|
1899
1933
|
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)}`))),
|
|
1934
|
+
let n = tr(e, ...t), r = qs();
|
|
1935
|
+
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
1936
|
}
|
|
1903
1937
|
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)}`))),
|
|
1938
|
+
let n = tr(e, ...t), r = qs();
|
|
1939
|
+
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
1940
|
}
|
|
1907
1941
|
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"),
|
|
1942
|
+
let n = tr(e, ...t), r = qs();
|
|
1943
|
+
Gn && Jn("debug", n) && nr(Gn, "%c" + r + " DEBUG: " + String(n), "color:silver"), Hn("debug", n, r);
|
|
1910
1944
|
}
|
|
1911
1945
|
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"),
|
|
1946
|
+
let n = tr(e, ...t), r = qs();
|
|
1947
|
+
Gn && Jn("msg", n) && nr(Gn, "%c" + r + " MSG: " + String(n), "color:cyan"), Hn("msg", n, r);
|
|
1914
1948
|
}
|
|
1915
1949
|
function ur(e, t) {
|
|
1916
|
-
Jn("json", t) && (t && nr(Ln.warn, "=====> " + Zn(t)), nr(Ln.dir, e)),
|
|
1950
|
+
Jn("json", t) && (t && nr(Ln.warn, "=====> " + Zn(t)), nr(Ln.dir, e)), Hn("json", e, qs());
|
|
1917
1951
|
}
|
|
1918
1952
|
function _r(e) {
|
|
1919
1953
|
const t = new Array(128).fill(null);
|
|
@@ -2258,7 +2292,7 @@ function Kr(e, t, n) {
|
|
|
2258
2292
|
for (let r = t; r < n; r++) e[r] = 1;
|
|
2259
2293
|
}
|
|
2260
2294
|
var Br = 0, Yr = 1, Jr = 2;
|
|
2261
|
-
function
|
|
2295
|
+
function qr(e, t, n, r, o) {
|
|
2262
2296
|
const s = n === Jr ? Er : vr;
|
|
2263
2297
|
let l = !1;
|
|
2264
2298
|
const i = (t) => t >= e.length || " " === e[t] || " " === e[t] || "\0" === e[t];
|
|
@@ -2298,14 +2332,14 @@ function Hr(e, t, n, r, o) {
|
|
|
2298
2332
|
}
|
|
2299
2333
|
return l;
|
|
2300
2334
|
}
|
|
2301
|
-
function
|
|
2335
|
+
function Hr(e) {
|
|
2302
2336
|
const t = /* @__PURE__ */ new Uint8Array(128);
|
|
2303
2337
|
for (const n of e + "\r\n\0") t[n.charCodeAt(0)] = 1;
|
|
2304
2338
|
return t;
|
|
2305
2339
|
}
|
|
2306
|
-
var zr =
|
|
2307
|
-
"\"":
|
|
2308
|
-
"'":
|
|
2340
|
+
var zr = Hr("&; ,\"'<>"), Qr = {
|
|
2341
|
+
"\"": Hr("\""),
|
|
2342
|
+
"'": Hr("'")
|
|
2309
2343
|
};
|
|
2310
2344
|
function Xr(e, t, n, r) {
|
|
2311
2345
|
let o = t;
|
|
@@ -2386,7 +2420,7 @@ function uo(e, t, n) {
|
|
|
2386
2420
|
s >= o && lo(e, s) && (o = io(e, s, t)), s = e.indexOf("=", s + 1);
|
|
2387
2421
|
}
|
|
2388
2422
|
}
|
|
2389
|
-
var _o =
|
|
2423
|
+
var _o = Hr("/?#\"'<> ");
|
|
2390
2424
|
function co(e, t) {
|
|
2391
2425
|
let n = e.indexOf("://", 1);
|
|
2392
2426
|
for (; n > 0;) {
|
|
@@ -2473,7 +2507,7 @@ function yo(e, t, n) {
|
|
|
2473
2507
|
const i = l.join(""), a = new Uint8Array(i.length);
|
|
2474
2508
|
(function(e, t) {
|
|
2475
2509
|
const n = po(e, vr), r = new Uint8Array(e.length);
|
|
2476
|
-
|
|
2510
|
+
qr(e, n, Br, t, r), uo(e, t, r), co(e, t), fo(e, t), go(e, t);
|
|
2477
2511
|
})(i, a), yo(i, a, n + 1);
|
|
2478
2512
|
let u = 0;
|
|
2479
2513
|
for (let n = 0; n < i.length; n++) {
|
|
@@ -2483,13 +2517,13 @@ function yo(e, t, n) {
|
|
|
2483
2517
|
}
|
|
2484
2518
|
function vo(e, t) {
|
|
2485
2519
|
const n = po(e, vr), r = po(e, Er), o = new Uint8Array(e.length);
|
|
2486
|
-
(
|
|
2520
|
+
(qr(e, n, Br, t, o) || n !== r) && qr(e, r, Jr, t, null), function(e) {
|
|
2487
2521
|
for (let t = 0; t < e.length; t++) {
|
|
2488
2522
|
const n = e.charCodeAt(t);
|
|
2489
2523
|
if ((101 === n || 98 === n || 66 === n) && Ur(e, t)[1]) return !0;
|
|
2490
2524
|
}
|
|
2491
2525
|
return !1;
|
|
2492
|
-
}(e) &&
|
|
2526
|
+
}(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
2527
|
}
|
|
2494
2528
|
function Eo(e) {
|
|
2495
2529
|
if ("string" != typeof e) return null;
|
|
@@ -2561,7 +2595,7 @@ function So(e, t, n, r) {
|
|
|
2561
2595
|
}
|
|
2562
2596
|
r.left -= 1 + a.length;
|
|
2563
2597
|
let u, _ = e[a];
|
|
2564
|
-
u = (Tr(a, 0, a.length, vr) || o && "value" === a) && null != _ && "" !== _ ? "********" : So(_, t, n + 1, r), u !== _ && (l = !0),
|
|
2598
|
+
u = (Tr(a, 0, a.length, vr) || o && "value" === a) && null != _ && "" !== _ ? "********" : So(_, t, n + 1, r), u !== _ && (l = !0), ls(s, a, u);
|
|
2565
2599
|
}
|
|
2566
2600
|
i && (s["<more>"] = Wr);
|
|
2567
2601
|
}
|
|
@@ -2603,17 +2637,17 @@ function Ao(e, t) {
|
|
|
2603
2637
|
}
|
|
2604
2638
|
function Ro(e, t) {
|
|
2605
2639
|
if (!t) return e;
|
|
2606
|
-
for (let n of Object.keys(t))
|
|
2640
|
+
for (let n of Object.keys(t)) ls(e, n, t[n]);
|
|
2607
2641
|
return e;
|
|
2608
2642
|
}
|
|
2609
2643
|
function xo(e, t) {
|
|
2610
2644
|
if (!t) return e;
|
|
2611
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) &&
|
|
2645
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && ls(e, n, t[n]);
|
|
2612
2646
|
return e;
|
|
2613
2647
|
}
|
|
2614
2648
|
function Do(e, t) {
|
|
2615
2649
|
if (!t) return e;
|
|
2616
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) &&
|
|
2650
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && ls(e, n, t[n]);
|
|
2617
2651
|
return e;
|
|
2618
2652
|
}
|
|
2619
2653
|
function ko(e, t) {
|
|
@@ -2623,10 +2657,10 @@ function Co(e, t) {
|
|
|
2623
2657
|
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
2624
2658
|
}
|
|
2625
2659
|
function Io(e, t, n) {
|
|
2626
|
-
|
|
2660
|
+
ls(e, t, n);
|
|
2627
2661
|
}
|
|
2628
2662
|
function Po(e, t, n) {
|
|
2629
|
-
|
|
2663
|
+
ls(e, t, n);
|
|
2630
2664
|
}
|
|
2631
2665
|
function Lo(e, t) {
|
|
2632
2666
|
e.push(t);
|
|
@@ -2638,75 +2672,78 @@ function Fo(e, t) {
|
|
|
2638
2672
|
e.splice(t, 1);
|
|
2639
2673
|
}
|
|
2640
2674
|
function Mo(e) {
|
|
2641
|
-
return
|
|
2675
|
+
return Ko(e) ? Object.keys(e).length : 0;
|
|
2642
2676
|
}
|
|
2643
2677
|
function Go(e) {
|
|
2644
|
-
return
|
|
2678
|
+
return Bo(e) ? e.length : 0;
|
|
2645
2679
|
}
|
|
2646
2680
|
function Vo(e) {
|
|
2647
|
-
return
|
|
2681
|
+
return Ko(e) ? Object.keys(e).length : Bo(e) ? e.length : Yo(e) && e.length > 0 ? 1 : 0;
|
|
2648
2682
|
}
|
|
2649
2683
|
function Wo(e) {
|
|
2650
|
-
return
|
|
2684
|
+
return 0 === Vo(e);
|
|
2651
2685
|
}
|
|
2652
2686
|
function Ko(e) {
|
|
2653
|
-
return Array.isArray(e);
|
|
2687
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
2654
2688
|
}
|
|
2655
2689
|
function Bo(e) {
|
|
2656
|
-
return
|
|
2690
|
+
return Array.isArray(e);
|
|
2657
2691
|
}
|
|
2658
2692
|
function Yo(e) {
|
|
2659
|
-
return "
|
|
2693
|
+
return "string" == typeof e;
|
|
2660
2694
|
}
|
|
2661
2695
|
function Jo(e) {
|
|
2696
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
2697
|
+
}
|
|
2698
|
+
function qo(e) {
|
|
2662
2699
|
return "boolean" == typeof e;
|
|
2663
2700
|
}
|
|
2664
2701
|
function Ho(e) {
|
|
2665
2702
|
return null == e;
|
|
2666
2703
|
}
|
|
2667
|
-
function qo(e) {
|
|
2668
|
-
return "function" == typeof e;
|
|
2669
|
-
}
|
|
2670
2704
|
function zo(e) {
|
|
2671
|
-
return
|
|
2705
|
+
return "function" == typeof e;
|
|
2672
2706
|
}
|
|
2673
2707
|
function Qo(e) {
|
|
2674
|
-
return
|
|
2708
|
+
return e instanceof k;
|
|
2675
2709
|
}
|
|
2676
2710
|
function Xo(e) {
|
|
2677
|
-
return Yo(e)
|
|
2711
|
+
return !Yo(e) || 0 === e.length;
|
|
2678
2712
|
}
|
|
2679
|
-
function Zo(e
|
|
2680
|
-
return e
|
|
2713
|
+
function Zo(e) {
|
|
2714
|
+
return Jo(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
2681
2715
|
}
|
|
2682
2716
|
function es(e, t) {
|
|
2717
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
2718
|
+
}
|
|
2719
|
+
function ts(e, t) {
|
|
2683
2720
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
2684
2721
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
2685
2722
|
}
|
|
2686
|
-
function
|
|
2687
|
-
if (
|
|
2688
|
-
if (
|
|
2723
|
+
function ns(e, t) {
|
|
2724
|
+
if (Ko(e) || Ko(t) || Bo(e) || Bo(t)) return 0;
|
|
2725
|
+
if (Jo(e) || Jo(t)) {
|
|
2689
2726
|
let n = Number(e), r = Number(t);
|
|
2690
2727
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
2691
2728
|
}
|
|
2692
|
-
if (
|
|
2729
|
+
if (qo(e) || qo(t)) {
|
|
2693
2730
|
let n = Number(e), r = Number(t);
|
|
2694
2731
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
2695
2732
|
}
|
|
2696
|
-
return
|
|
2733
|
+
return es(String(e), String(t));
|
|
2697
2734
|
}
|
|
2698
|
-
function
|
|
2699
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
2735
|
+
function rs(e, t) {
|
|
2736
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) rs(e, n);
|
|
2700
2737
|
else "string" == typeof t && delete e[t];
|
|
2701
2738
|
else for (const n of Object.keys(t)) delete e[n];
|
|
2702
2739
|
}
|
|
2703
|
-
function
|
|
2740
|
+
function os(e, t) {
|
|
2704
2741
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
2705
2742
|
}
|
|
2706
|
-
function
|
|
2743
|
+
function ss(e, t) {
|
|
2707
2744
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
2708
2745
|
}
|
|
2709
|
-
function
|
|
2746
|
+
function ls(e, t, n) {
|
|
2710
2747
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
2711
2748
|
value: n,
|
|
2712
2749
|
writable: !0,
|
|
@@ -2714,81 +2751,81 @@ function ss(e, t, n) {
|
|
|
2714
2751
|
configurable: !0
|
|
2715
2752
|
}) : e[t] = n;
|
|
2716
2753
|
}
|
|
2717
|
-
function
|
|
2754
|
+
function is(e, t) {
|
|
2718
2755
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
2719
2756
|
const n = Number(t);
|
|
2720
2757
|
return n >= e.length ? -1 : n;
|
|
2721
2758
|
}
|
|
2722
|
-
function
|
|
2723
|
-
e && !
|
|
2759
|
+
function as(e, t, n, r) {
|
|
2760
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2724
2761
|
const o = e ? `${xt(e)}: ` : "";
|
|
2725
|
-
if (!
|
|
2726
|
-
if (!
|
|
2762
|
+
if (!Ko(t) && !Bo(t)) return void sr(`${o}kw must be list or dict: '${String(n)}'`);
|
|
2763
|
+
if (!Yo(n)) return void sr(`${o}path must be a string: ${String(n)}`);
|
|
2727
2764
|
let s = n.split("`"), l = s.length;
|
|
2728
2765
|
for (let e = 0; e < l; e++) {
|
|
2729
|
-
if (
|
|
2730
|
-
const l =
|
|
2766
|
+
if (Bo(t)) {
|
|
2767
|
+
const l = is(t, s[e]);
|
|
2731
2768
|
if (l < 0) return void (r && sr(`${o}path not found: '${n}'`));
|
|
2732
2769
|
s[e] = String(l);
|
|
2733
2770
|
}
|
|
2734
|
-
if (
|
|
2771
|
+
if (ss(t, s[e])) return void (r && sr(`${o}path not found: '${n}'`));
|
|
2735
2772
|
if (e === l - 1) break;
|
|
2736
2773
|
if (null == (t = t[s[e]])) return void (r && sr(`${o}path not found: '${n}'`));
|
|
2737
|
-
if (!
|
|
2774
|
+
if (!Ko(t) && !Bo(t)) return void sr(`${o}kw must be list or dict: '${n}'`);
|
|
2738
2775
|
}
|
|
2739
2776
|
let i = t[s[l - 1]];
|
|
2740
2777
|
return void 0 === i && r && sr(`${o}path not found: '${n}'`), i;
|
|
2741
2778
|
}
|
|
2742
|
-
function
|
|
2743
|
-
e && !
|
|
2779
|
+
function us(e, t, n) {
|
|
2780
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2744
2781
|
const r = e ? xt(e) + ": " : "";
|
|
2745
|
-
if (!
|
|
2782
|
+
if (!Yo(n)) return sr(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
2746
2783
|
let [o, s] = function(e, t) {
|
|
2747
2784
|
let n = e.lastIndexOf(t);
|
|
2748
2785
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
2749
2786
|
}(n, "`"), l = t;
|
|
2750
|
-
if (
|
|
2751
|
-
else if (l =
|
|
2752
|
-
return
|
|
2787
|
+
if (Xo(s)) s = n;
|
|
2788
|
+
else if (l = as(e, t, o, !0), void 0 === l) return -1;
|
|
2789
|
+
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
2790
|
}
|
|
2754
|
-
function
|
|
2755
|
-
e && !
|
|
2756
|
-
let s =
|
|
2791
|
+
function _s(e, t, n, r, o) {
|
|
2792
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2793
|
+
let s = as(e, t, n, !1);
|
|
2757
2794
|
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
2795
|
if (void 0 === s) {
|
|
2759
2796
|
if (i && t) {
|
|
2760
2797
|
let o = Boolean(r);
|
|
2761
|
-
return
|
|
2798
|
+
return bs(e, t, n, o), o;
|
|
2762
2799
|
}
|
|
2763
2800
|
return l && (sr(`path not found: '${n}'`), No(t)), Boolean(r);
|
|
2764
2801
|
}
|
|
2765
2802
|
let _;
|
|
2766
|
-
if (
|
|
2767
|
-
else if (u &&
|
|
2768
|
-
else if (u &&
|
|
2803
|
+
if (qo(s)) _ = s;
|
|
2804
|
+
else if (u && Jo(s)) _ = 0 !== s;
|
|
2805
|
+
else if (u && Yo(s)) _ = "true" === s.toLowerCase() || "false" !== s.toLowerCase() && 0 !== (parseInt(s, 10) || 0);
|
|
2769
2806
|
else {
|
|
2770
2807
|
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
2808
|
_ = !1;
|
|
2772
2809
|
}
|
|
2773
|
-
return a &&
|
|
2810
|
+
return a && us(e, t, n), _;
|
|
2774
2811
|
}
|
|
2775
|
-
function
|
|
2776
|
-
e && !
|
|
2777
|
-
let s =
|
|
2812
|
+
function cs(e, t, n, r, o) {
|
|
2813
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2814
|
+
let s = as(e, t, n, !1);
|
|
2778
2815
|
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
2816
|
if (void 0 === s) {
|
|
2780
2817
|
if (i && t) {
|
|
2781
2818
|
let o = parseInt(r);
|
|
2782
|
-
return
|
|
2819
|
+
return bs(e, t, n, o), o;
|
|
2783
2820
|
}
|
|
2784
2821
|
return l && (sr(`path not found: '${n}'`), No(t)), parseInt(r);
|
|
2785
2822
|
}
|
|
2786
2823
|
let _;
|
|
2787
|
-
if (
|
|
2824
|
+
if (Jo(s)) _ = Math.trunc(s);
|
|
2788
2825
|
else {
|
|
2789
2826
|
if (!u) return sr(`${e ? xt(e) + ": " : ""}path MUST BE a json integer: '${n}'`), No(t), parseInt(r);
|
|
2790
|
-
if (
|
|
2791
|
-
else if (
|
|
2827
|
+
if (qo(s)) _ = s ? 1 : 0;
|
|
2828
|
+
else if (Yo(s)) _ = function(e) {
|
|
2792
2829
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
2793
2830
|
if (!t) return 0;
|
|
2794
2831
|
let n, r = t[2];
|
|
@@ -2799,120 +2836,120 @@ function _s(e, t, n, r, o) {
|
|
|
2799
2836
|
_ = 0;
|
|
2800
2837
|
}
|
|
2801
2838
|
}
|
|
2802
|
-
return a &&
|
|
2839
|
+
return a && us(e, t, n), _;
|
|
2803
2840
|
}
|
|
2804
|
-
function
|
|
2805
|
-
e && !
|
|
2806
|
-
let s =
|
|
2841
|
+
function fs(e, t, n, r, o) {
|
|
2842
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2843
|
+
let s = as(e, t, n, !1);
|
|
2807
2844
|
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 =
|
|
2845
|
+
return void 0 === s ? i && t ? (bs(e, t, n, Yo(r) ? r : null), r) : (l && !function(e, t) {
|
|
2846
|
+
let n = Yo(t) ? t.split("`") : [], r = e;
|
|
2810
2847
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2811
|
-
if (!
|
|
2848
|
+
if (!Ko(r) && !Bo(r)) return !1;
|
|
2812
2849
|
r = r[n[e]];
|
|
2813
2850
|
}
|
|
2814
|
-
return !(!
|
|
2815
|
-
}(t, n) && (sr(`path not found: '${n}'`), No(t)), r) :
|
|
2851
|
+
return !(!Ko(r) && !Bo(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
2852
|
+
}(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
2853
|
}
|
|
2817
|
-
function
|
|
2818
|
-
e && !
|
|
2819
|
-
let s =
|
|
2854
|
+
function gs(e, t, n, r, o) {
|
|
2855
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2856
|
+
let s = as(e, t, n, !1);
|
|
2820
2857
|
const l = o && o & Pn.KW_REQUIRED, i = o && o & Pn.KW_CREATE, a = o && o & Pn.KW_EXTRACT;
|
|
2821
2858
|
if (void 0 === s) {
|
|
2822
2859
|
if (i) {
|
|
2823
2860
|
let o = r;
|
|
2824
|
-
return
|
|
2861
|
+
return bs(e, t, n, o), o;
|
|
2825
2862
|
}
|
|
2826
2863
|
return l && (sr(`path not found: '${n}'`), No(t)), r;
|
|
2827
2864
|
}
|
|
2828
|
-
return a &&
|
|
2865
|
+
return a && us(e, t, n), s;
|
|
2829
2866
|
}
|
|
2830
|
-
function
|
|
2831
|
-
e && !
|
|
2832
|
-
let s =
|
|
2867
|
+
function ds(e, t, n, r, o) {
|
|
2868
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2869
|
+
let s = as(e, t, n, !1);
|
|
2833
2870
|
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 &&
|
|
2871
|
+
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
2872
|
}
|
|
2836
|
-
function
|
|
2837
|
-
e && !
|
|
2838
|
-
let s =
|
|
2873
|
+
function ps(e, t, n, r, o) {
|
|
2874
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2875
|
+
let s = as(e, t, n, !1);
|
|
2839
2876
|
const l = o && o & Pn.KW_REQUIRED, i = o && o & Pn.KW_CREATE, a = o && o & Pn.KW_EXTRACT;
|
|
2840
2877
|
if (void 0 === s) {
|
|
2841
2878
|
if (i) {
|
|
2842
2879
|
let o = r;
|
|
2843
|
-
return
|
|
2880
|
+
return bs(e, t, n, o), o;
|
|
2844
2881
|
}
|
|
2845
2882
|
return l && (sr(`path not found: '${n}'`), No(t)), r;
|
|
2846
2883
|
}
|
|
2847
|
-
return a &&
|
|
2884
|
+
return a && us(e, t, n), s;
|
|
2848
2885
|
}
|
|
2849
|
-
function
|
|
2850
|
-
if (e && !
|
|
2851
|
-
if (!
|
|
2886
|
+
function bs(e, t, n, r) {
|
|
2887
|
+
if (e && !Qo(e) && sr("GObj bad instanceof"), !Ko(t)) return sr("kw is not an object"), -1;
|
|
2888
|
+
if (!Yo(n)) return sr(`${e ? xt(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
2852
2889
|
if ("" === n) return sr((e ? xt(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
2853
2890
|
if (n.split("`").includes("")) return sr(`${e ? xt(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
2854
2891
|
let o = n.split("`"), s = o.length;
|
|
2855
2892
|
for (let l = 0; l < s; l++) {
|
|
2856
2893
|
let i = o[l];
|
|
2857
|
-
if (
|
|
2858
|
-
const r =
|
|
2894
|
+
if (Bo(t)) {
|
|
2895
|
+
const r = is(t, i);
|
|
2859
2896
|
if (r < 0) return sr(`${e ? xt(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not an index of its list: '${n}'`), -1;
|
|
2860
2897
|
i = String(r);
|
|
2861
2898
|
}
|
|
2862
|
-
if (l === s - 1)
|
|
2899
|
+
if (l === s - 1) ls(t, i, r);
|
|
2863
2900
|
else {
|
|
2864
|
-
let r =
|
|
2865
|
-
if (void 0 === r)
|
|
2866
|
-
else if (!
|
|
2901
|
+
let r = ss(t, i) ? void 0 : t[i];
|
|
2902
|
+
if (void 0 === r) ls(t, i, {});
|
|
2903
|
+
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
2904
|
t = t[i];
|
|
2868
2905
|
}
|
|
2869
2906
|
}
|
|
2870
2907
|
return 0;
|
|
2871
2908
|
}
|
|
2872
|
-
function
|
|
2873
|
-
if (e && !
|
|
2874
|
-
let s =
|
|
2909
|
+
function ms(e, t, n, r, o) {
|
|
2910
|
+
if (e && !Qo(e) && sr("GObj bad instanceof"), !Ko(t)) return sr("kw is not an object"), -1;
|
|
2911
|
+
let s = as(e, t, n, !1);
|
|
2875
2912
|
if (void 0 === s) {
|
|
2876
|
-
if (!
|
|
2913
|
+
if (!Yo(n) || function(e, t) {
|
|
2877
2914
|
let n = t.split("`"), r = e;
|
|
2878
2915
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2879
|
-
if (
|
|
2880
|
-
const t =
|
|
2916
|
+
if (Bo(r)) {
|
|
2917
|
+
const t = is(r, n[e]);
|
|
2881
2918
|
if (t < 0) return !1;
|
|
2882
2919
|
r = r[t];
|
|
2883
2920
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
2884
2921
|
if (null == r) return !1;
|
|
2885
|
-
if (!
|
|
2922
|
+
if (!Ko(r) && !Bo(r)) return !0;
|
|
2886
2923
|
}
|
|
2887
2924
|
return !1;
|
|
2888
2925
|
}(t, n)) return -1;
|
|
2889
|
-
if (s = {},
|
|
2926
|
+
if (s = {}, bs(e, t, n, s) < 0) return -1;
|
|
2890
2927
|
}
|
|
2891
|
-
return
|
|
2928
|
+
return Ko(s) ? (ls(s, r, o), 0) : (sr(`subdict is not an object: '${n}'`), -1);
|
|
2892
2929
|
}
|
|
2893
|
-
function
|
|
2930
|
+
function hs(e, n, r) {
|
|
2894
2931
|
let o = "", s = !1;
|
|
2895
|
-
if (
|
|
2932
|
+
if (Bo(n)) {
|
|
2896
2933
|
s = !1;
|
|
2897
2934
|
for (let l = 0; l < n.length; l++) {
|
|
2898
2935
|
let i = n[l];
|
|
2899
|
-
if (o =
|
|
2936
|
+
if (o = Xo(r) ? t("%s", r) : t("%s`%d", r, l), s = hs(e, i, o), s) break;
|
|
2900
2937
|
}
|
|
2901
|
-
} else if (
|
|
2938
|
+
} else if (Ko(n)) {
|
|
2902
2939
|
s = !0;
|
|
2903
2940
|
let l = Object.keys(n);
|
|
2904
2941
|
for (let i = 0; i < l.length; i++) {
|
|
2905
2942
|
let a = l[i], u = n[a];
|
|
2906
|
-
if (o =
|
|
2907
|
-
if (s =
|
|
2943
|
+
if (o = Xo(r) ? t("%s", a) : t("%s`%s", r, a), Bo(u) || Ko(u)) {
|
|
2944
|
+
if (s = hs(e, u, o), !s) break;
|
|
2908
2945
|
continue;
|
|
2909
2946
|
}
|
|
2910
|
-
let _ =
|
|
2947
|
+
let _ = ps(0, e, o, void 0, 0);
|
|
2911
2948
|
if (void 0 === _ && (_ = ko(e, o)), void 0 === _) {
|
|
2912
2949
|
s = !1;
|
|
2913
2950
|
break;
|
|
2914
2951
|
}
|
|
2915
|
-
if (0 !==
|
|
2952
|
+
if (0 !== ns(_, u)) {
|
|
2916
2953
|
s = !1;
|
|
2917
2954
|
break;
|
|
2918
2955
|
}
|
|
@@ -2920,34 +2957,34 @@ function ms(e, n, r) {
|
|
|
2920
2957
|
}
|
|
2921
2958
|
return s;
|
|
2922
2959
|
}
|
|
2923
|
-
function
|
|
2924
|
-
return 0 === Vo(t) ||
|
|
2960
|
+
function ys(e, t) {
|
|
2961
|
+
return 0 === Vo(t) || hs(e, t, "");
|
|
2925
2962
|
}
|
|
2926
|
-
function
|
|
2927
|
-
e && !
|
|
2963
|
+
function vs(e, t, n, r) {
|
|
2964
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
2928
2965
|
let o = {};
|
|
2929
|
-
if (
|
|
2966
|
+
if (Yo(n) && !Xo(n)) {
|
|
2930
2967
|
let s = n;
|
|
2931
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
2932
|
-
} else if (
|
|
2968
|
+
Object.prototype.hasOwnProperty.call(t, s) ? ls(o, s, t[s]) : r && sr(`${xt(e)}: key not found: ${s}`);
|
|
2969
|
+
} 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
2970
|
else {
|
|
2934
|
-
if (!(
|
|
2971
|
+
if (!(Bo(n) && Go(n) > 0)) return t;
|
|
2935
2972
|
for (let s = 0; s < n.length; s++) {
|
|
2936
2973
|
let l = n[s];
|
|
2937
|
-
Object.prototype.hasOwnProperty.call(t, l) ?
|
|
2974
|
+
Object.prototype.hasOwnProperty.call(t, l) ? ls(o, l, t[l]) : r && sr(`${xt(e)}: key not found: ${l}`);
|
|
2938
2975
|
}
|
|
2939
2976
|
}
|
|
2940
2977
|
return o;
|
|
2941
2978
|
}
|
|
2942
|
-
function
|
|
2979
|
+
function Es(e, t, n, r) {
|
|
2943
2980
|
let o = {};
|
|
2944
|
-
if (!
|
|
2945
|
-
if (Ro(o, t),
|
|
2981
|
+
if (!Ko(t)) return o;
|
|
2982
|
+
if (Ro(o, t), Yo(n) && !Xo(n)) {
|
|
2946
2983
|
let s = n;
|
|
2947
2984
|
Object.prototype.hasOwnProperty.call(t, s) ? Co(o, s) : r && sr(`${xt(e)}: key not found: ${s}`);
|
|
2948
|
-
} else if (
|
|
2985
|
+
} 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
2986
|
else {
|
|
2950
|
-
if (!(
|
|
2987
|
+
if (!(Bo(n) && Go(n) > 0)) return {};
|
|
2951
2988
|
for (let s = 0; s < n.length; s++) {
|
|
2952
2989
|
let l = n[s];
|
|
2953
2990
|
Object.prototype.hasOwnProperty.call(t, l) ? Co(o, l) : r && sr(`${xt(e)}: key not found: ${l}`);
|
|
@@ -2955,7 +2992,7 @@ function vs(e, t, n, r) {
|
|
|
2955
2992
|
}
|
|
2956
2993
|
return o;
|
|
2957
2994
|
}
|
|
2958
|
-
function
|
|
2995
|
+
function Ts() {
|
|
2959
2996
|
if ("undefined" == typeof window) return null;
|
|
2960
2997
|
let e;
|
|
2961
2998
|
try {
|
|
@@ -2972,39 +3009,47 @@ function Es() {
|
|
|
2972
3009
|
}
|
|
2973
3010
|
return e || null;
|
|
2974
3011
|
}
|
|
2975
|
-
var
|
|
2976
|
-
function
|
|
2977
|
-
|
|
3012
|
+
var js = /* @__PURE__ */ new Set();
|
|
3013
|
+
function Os(e, t) {
|
|
3014
|
+
js.has(e) || (js.add(e), lr(t));
|
|
2978
3015
|
}
|
|
2979
|
-
function
|
|
2980
|
-
const r =
|
|
3016
|
+
function Ss(e, t, n = !1) {
|
|
3017
|
+
const r = Ts();
|
|
2981
3018
|
if (!r) return t;
|
|
2982
3019
|
const o = `kw_get_local_storage_value(): localStorage key "${e}"`;
|
|
2983
3020
|
let s;
|
|
2984
3021
|
try {
|
|
2985
3022
|
s = r.getItem(e);
|
|
2986
3023
|
} catch (n) {
|
|
2987
|
-
return
|
|
3024
|
+
return Os(e, `${o} cannot be read (storage blocked?): the default is used`), t;
|
|
2988
3025
|
}
|
|
2989
|
-
let l = null;
|
|
3026
|
+
let l = !0, i = null;
|
|
2990
3027
|
if (null !== s) try {
|
|
2991
|
-
|
|
3028
|
+
i = JSON.parse(s);
|
|
2992
3029
|
} catch (t) {
|
|
2993
|
-
|
|
3030
|
+
i = null;
|
|
2994
3031
|
try {
|
|
2995
|
-
r.removeItem(e), lr(`${o} does not hold json: removed, the default is used`)
|
|
3032
|
+
r.removeItem(e), lr(`${o} does not hold json: removed, the default is used`);
|
|
2996
3033
|
} catch (t) {
|
|
2997
|
-
|
|
3034
|
+
l = !1, Os(e, `${o} does not hold json and cannot be removed: the default is used`);
|
|
2998
3035
|
}
|
|
2999
|
-
s = void 0;
|
|
3000
3036
|
}
|
|
3001
|
-
|
|
3037
|
+
if (null === i && (i = t, n)) {
|
|
3038
|
+
const n = Le(t);
|
|
3039
|
+
if (void 0 === n) sr(`${o}: cannot write the default: a value with no json text`);
|
|
3040
|
+
else try {
|
|
3041
|
+
r.setItem(e, n);
|
|
3042
|
+
} catch (t) {
|
|
3043
|
+
l = !1, Os(e, `${o} cannot be written (storage full or blocked?): the default is used, not kept`);
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
return l && js.delete(e), i;
|
|
3002
3047
|
}
|
|
3003
|
-
function
|
|
3048
|
+
function ws(e, t) {
|
|
3004
3049
|
if (!e) return sr(`kw_set_local_storage_value(): invalid key: key=${e}`), -1;
|
|
3005
3050
|
const n = Le(t);
|
|
3006
3051
|
if (void 0 === n) return sr(`kw_set_local_storage_value(): cannot save "${e}": a value with no json text`), -1;
|
|
3007
|
-
const r =
|
|
3052
|
+
const r = Ts();
|
|
3008
3053
|
if (!r) return 0;
|
|
3009
3054
|
try {
|
|
3010
3055
|
return r.setItem(e, n), 0;
|
|
@@ -3012,8 +3057,8 @@ function Ss(e, t) {
|
|
|
3012
3057
|
return sr(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
3013
3058
|
}
|
|
3014
3059
|
}
|
|
3015
|
-
function
|
|
3016
|
-
const t =
|
|
3060
|
+
function Ns(e) {
|
|
3061
|
+
const t = Ts();
|
|
3017
3062
|
if (t) if (e) try {
|
|
3018
3063
|
t.removeItem(e);
|
|
3019
3064
|
} catch (t) {
|
|
@@ -3021,45 +3066,45 @@ function ws(e) {
|
|
|
3021
3066
|
}
|
|
3022
3067
|
else sr(`kw_remove_local_storage_value(): invalid key: key=${e}`);
|
|
3023
3068
|
}
|
|
3024
|
-
function
|
|
3069
|
+
function $s(e, t) {
|
|
3025
3070
|
if (Ho(e) || Ho(t)) return !0;
|
|
3026
|
-
if (
|
|
3071
|
+
if (Bo(e)) {
|
|
3027
3072
|
if (0 === e.length) return !0;
|
|
3028
3073
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
3029
|
-
} else if (
|
|
3074
|
+
} else if (Ko(e)) {
|
|
3030
3075
|
if (0 === Object.keys(e).length) return !0;
|
|
3031
3076
|
for (let n in e) if (n === t) return !0;
|
|
3032
|
-
} else if (
|
|
3077
|
+
} else if (Yo(e) && e === t) return !0;
|
|
3033
3078
|
return !1;
|
|
3034
3079
|
}
|
|
3035
|
-
function
|
|
3036
|
-
if (e && !
|
|
3037
|
-
o || (o =
|
|
3080
|
+
function As(e, t, n, r, o) {
|
|
3081
|
+
if (e && !Qo(e) && sr("GObj bad instanceof"), !t) return null;
|
|
3082
|
+
o || (o = ys);
|
|
3038
3083
|
let s = [];
|
|
3039
|
-
if (
|
|
3084
|
+
if (Bo(t)) for (let l = 0; l < t.length; l++) {
|
|
3040
3085
|
let i, a = t[l];
|
|
3041
|
-
if (
|
|
3086
|
+
if (Ko(a)) i = fs(e, a, "id", "", 0);
|
|
3042
3087
|
else {
|
|
3043
|
-
if (!
|
|
3088
|
+
if (!Yo(a)) continue;
|
|
3044
3089
|
i = a;
|
|
3045
3090
|
}
|
|
3046
|
-
|
|
3091
|
+
$s(n, i) && o(a, r) && s.push(a);
|
|
3047
3092
|
}
|
|
3048
3093
|
else {
|
|
3049
|
-
if (!
|
|
3094
|
+
if (!Ko(t)) return sr("kw_collect() BAD kw parameter"), null;
|
|
3050
3095
|
for (let e of Object.keys(t)) {
|
|
3051
3096
|
let l = t[e];
|
|
3052
|
-
|
|
3097
|
+
$s(n, e) && o(l, r) && s.push(l);
|
|
3053
3098
|
}
|
|
3054
3099
|
}
|
|
3055
3100
|
return s;
|
|
3056
3101
|
}
|
|
3057
|
-
function
|
|
3102
|
+
function Rs(e, t) {
|
|
3058
3103
|
if (!e) return -1;
|
|
3059
3104
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
3060
3105
|
return -1;
|
|
3061
3106
|
}
|
|
3062
|
-
function
|
|
3107
|
+
function xs(e, t, n) {
|
|
3063
3108
|
if (!e || !t) return sr("ERROR: str_in_list() list or str empty"), !1;
|
|
3064
3109
|
let r = e.length;
|
|
3065
3110
|
if (n) {
|
|
@@ -3071,7 +3116,7 @@ function Rs(e, t, n) {
|
|
|
3071
3116
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
3072
3117
|
return !1;
|
|
3073
3118
|
}
|
|
3074
|
-
function
|
|
3119
|
+
function Ds(e, t) {
|
|
3075
3120
|
try {
|
|
3076
3121
|
let n = e.__md_iev__;
|
|
3077
3122
|
if (n) return n[t];
|
|
@@ -3079,35 +3124,35 @@ function xs(e, t) {
|
|
|
3079
3124
|
return;
|
|
3080
3125
|
}
|
|
3081
3126
|
}
|
|
3082
|
-
function
|
|
3127
|
+
function ks(e, t, n) {
|
|
3083
3128
|
let r = e.__md_iev__;
|
|
3084
3129
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
3085
3130
|
}
|
|
3086
|
-
function
|
|
3087
|
-
if (!
|
|
3131
|
+
function Cs(e, t, n, r) {
|
|
3132
|
+
if (!Qo(e)) return sr("gobj is not a GObj"), null;
|
|
3088
3133
|
if (!t) return;
|
|
3089
|
-
let o =
|
|
3090
|
-
o || (o = [],
|
|
3134
|
+
let o = Ds(t, n);
|
|
3135
|
+
o || (o = [], ks(t, n, o));
|
|
3091
3136
|
try {
|
|
3092
|
-
|
|
3137
|
+
Bo(o) && o.unshift(r);
|
|
3093
3138
|
} catch (e) {
|
|
3094
3139
|
sr(e);
|
|
3095
3140
|
}
|
|
3096
3141
|
}
|
|
3097
|
-
function
|
|
3098
|
-
if (!
|
|
3099
|
-
if (!
|
|
3100
|
-
let o =
|
|
3142
|
+
function Is(e, t, n, r) {
|
|
3143
|
+
if (!Qo(e)) return sr("gobj is not a GObj"), null;
|
|
3144
|
+
if (!Ko(t)) return sr("kw is not a dict"), null;
|
|
3145
|
+
let o = Ds(t, n);
|
|
3101
3146
|
return o ? 0 === o.length ? (r && sr(`stack empty: ${n}`), null) : o[0] : (r && sr(`stack NOT FOUND: ${n}`), null);
|
|
3102
3147
|
}
|
|
3103
|
-
function
|
|
3104
|
-
return
|
|
3148
|
+
function Ps(e, t, n) {
|
|
3149
|
+
return Xo(n) ? us(e, t, "__md_iev__`__msg_type__") : ms(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
3105
3150
|
}
|
|
3106
|
-
function
|
|
3107
|
-
return
|
|
3151
|
+
function Ls(e, t) {
|
|
3152
|
+
return fs(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
3108
3153
|
}
|
|
3109
|
-
function
|
|
3110
|
-
void 0 !== n &&
|
|
3154
|
+
function Us(e, t, n) {
|
|
3155
|
+
void 0 !== n && Yo(n) || (n = "");
|
|
3111
3156
|
for (let r of Object.keys(e)) {
|
|
3112
3157
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
3113
3158
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -3116,10 +3161,10 @@ function Ls(e, t, n) {
|
|
|
3116
3161
|
r,
|
|
3117
3162
|
e[r],
|
|
3118
3163
|
n
|
|
3119
|
-
]),
|
|
3164
|
+
]), Ko(e[r]) && Us(e[r], t, n), n = n.slice(0, -o.length);
|
|
3120
3165
|
}
|
|
3121
3166
|
}
|
|
3122
|
-
function
|
|
3167
|
+
function Fs(e, t, n, r) {
|
|
3123
3168
|
if (!e) return null;
|
|
3124
3169
|
let o, s = e.length;
|
|
3125
3170
|
for (o = 0; o < s; o++) {
|
|
@@ -3127,15 +3172,15 @@ function Us(e, t, n, r) {
|
|
|
3127
3172
|
if (s) {
|
|
3128
3173
|
let e = s.id;
|
|
3129
3174
|
if (e && e === n) return s;
|
|
3130
|
-
if (r &&
|
|
3131
|
-
let e =
|
|
3175
|
+
if (r && os(s, t)) {
|
|
3176
|
+
let e = Fs(s[t], t, n, r);
|
|
3132
3177
|
if (e) return e;
|
|
3133
3178
|
}
|
|
3134
3179
|
}
|
|
3135
3180
|
}
|
|
3136
3181
|
return null;
|
|
3137
3182
|
}
|
|
3138
|
-
function
|
|
3183
|
+
function Ms(e) {
|
|
3139
3184
|
function t(e) {
|
|
3140
3185
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
3141
3186
|
switch (t.length % 4) {
|
|
@@ -3166,10 +3211,10 @@ function Fs(e) {
|
|
|
3166
3211
|
signature: t(n[2])
|
|
3167
3212
|
};
|
|
3168
3213
|
}
|
|
3169
|
-
function
|
|
3214
|
+
function Gs(e) {
|
|
3170
3215
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3171
3216
|
}
|
|
3172
|
-
var
|
|
3217
|
+
var Vs = class {
|
|
3173
3218
|
constructor(e) {
|
|
3174
3219
|
this.html = e, Object.freeze(this);
|
|
3175
3220
|
}
|
|
@@ -3177,19 +3222,19 @@ var Gs = class {
|
|
|
3177
3222
|
return this.html;
|
|
3178
3223
|
}
|
|
3179
3224
|
};
|
|
3180
|
-
function Vs(e) {
|
|
3181
|
-
return e instanceof Gs;
|
|
3182
|
-
}
|
|
3183
3225
|
function Ws(e) {
|
|
3226
|
+
return e instanceof Vs;
|
|
3227
|
+
}
|
|
3228
|
+
function Ks(e) {
|
|
3184
3229
|
const t = document.createElement("template");
|
|
3185
3230
|
return t.innerHTML = e.html.trim(), t.content;
|
|
3186
3231
|
}
|
|
3187
|
-
var
|
|
3188
|
-
function
|
|
3232
|
+
var Bs = !1, Ys = /* @__PURE__ */ new Set();
|
|
3233
|
+
function Js(e) {
|
|
3189
3234
|
const t = document.createElement("template");
|
|
3190
3235
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
3191
3236
|
}
|
|
3192
|
-
function
|
|
3237
|
+
function qs(e) {
|
|
3193
3238
|
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
3239
|
return `${n}.${r}${o > 0 ? "-" : "+"}${t(Math.floor(Math.abs(o) / 60), 2)}${t(Math.abs(o) % 60, 2)}`;
|
|
3195
3240
|
}
|
|
@@ -3198,36 +3243,47 @@ function Hs(e, t) {
|
|
|
3198
3243
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
3199
3244
|
return -1;
|
|
3200
3245
|
}
|
|
3201
|
-
function
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3246
|
+
function zs() {
|
|
3247
|
+
const e = "undefined" != typeof window && window.crypto || globalThis.crypto;
|
|
3248
|
+
if (e && "function" == typeof e.randomUUID) return e.randomUUID();
|
|
3249
|
+
const t = /* @__PURE__ */ new Uint8Array(16);
|
|
3250
|
+
if (e && "function" == typeof e.getRandomValues) e.getRandomValues(t);
|
|
3251
|
+
else for (let e = 0; e < t.length; e++) t[e] = Math.floor(256 * Math.random());
|
|
3252
|
+
t[6] = 15 & t[6] | 64, t[8] = 63 & t[8] | 128;
|
|
3253
|
+
const n = Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
3254
|
+
return `${n.slice(0, 8)}-${n.slice(8, 12)}-${n.slice(12, 16)}-${n.slice(16, 20)}-${n.slice(20)}`;
|
|
3255
|
+
}
|
|
3256
|
+
var Qs = null;
|
|
3257
|
+
function Xs() {
|
|
3258
|
+
if (Qs) return Qs;
|
|
3259
|
+
const e = Ts();
|
|
3260
|
+
if (!e) return Qs = zs();
|
|
3261
|
+
let t = null;
|
|
3262
|
+
try {
|
|
3263
|
+
t = e.getItem("host_uuid");
|
|
3264
|
+
} catch (e) {
|
|
3265
|
+
return Os("host_uuid", "node_uuid(): localStorage cannot be read (storage blocked?): a uuid of this page only"), Qs = zs();
|
|
3266
|
+
}
|
|
3267
|
+
if (!t) {
|
|
3268
|
+
t = zs();
|
|
3205
3269
|
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
|
-
}
|
|
3270
|
+
e.setItem("host_uuid", t);
|
|
3271
|
+
} catch (e) {
|
|
3272
|
+
Os("host_uuid", "node_uuid(): localStorage cannot be written (storage full or blocked?): a uuid of this page only");
|
|
3217
3273
|
}
|
|
3218
|
-
}
|
|
3219
|
-
return
|
|
3274
|
+
}
|
|
3275
|
+
return Qs = t;
|
|
3220
3276
|
}
|
|
3221
|
-
function
|
|
3277
|
+
function Zs(e) {
|
|
3222
3278
|
let t = null;
|
|
3223
3279
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
3224
3280
|
}
|
|
3225
|
-
var
|
|
3226
|
-
function
|
|
3281
|
+
var el = 256, tl = 1e5;
|
|
3282
|
+
function nl(e) {
|
|
3227
3283
|
const t = String(e).replace(/`/g, "``");
|
|
3228
3284
|
return "[" === t[0] ? "[" + t : t;
|
|
3229
3285
|
}
|
|
3230
|
-
function
|
|
3286
|
+
function rl(e) {
|
|
3231
3287
|
if ("string" != typeof e) return null;
|
|
3232
3288
|
let t = [], n = "";
|
|
3233
3289
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -3248,14 +3304,14 @@ function el(e) {
|
|
|
3248
3304
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
3249
3305
|
});
|
|
3250
3306
|
}
|
|
3251
|
-
function
|
|
3307
|
+
function ol(e, t) {
|
|
3252
3308
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
3253
3309
|
}
|
|
3254
|
-
function
|
|
3310
|
+
function sl(e) {
|
|
3255
3311
|
return "persistent-attrs-" + xt(e);
|
|
3256
3312
|
}
|
|
3257
|
-
function
|
|
3258
|
-
if (
|
|
3313
|
+
function ll(e, t) {
|
|
3314
|
+
if (Yo(t)) {
|
|
3259
3315
|
if (-1 === t.indexOf("^")) {
|
|
3260
3316
|
let n, r, o = e.fkey;
|
|
3261
3317
|
if (1 !== Mo(o)) return sr("bad fkey 1"), sr(e), sr(t), null;
|
|
@@ -3278,13 +3334,13 @@ function rl(e, t) {
|
|
|
3278
3334
|
};
|
|
3279
3335
|
}
|
|
3280
3336
|
}
|
|
3281
|
-
return
|
|
3337
|
+
return Ko(t) ? {
|
|
3282
3338
|
topic_name: t.topic_name,
|
|
3283
3339
|
id: t.id,
|
|
3284
3340
|
hook_name: t.hook_name
|
|
3285
3341
|
} : (sr("bad fkey 3"), sr(e), sr(t), null);
|
|
3286
3342
|
}
|
|
3287
|
-
var
|
|
3343
|
+
var il = [
|
|
3288
3344
|
"string",
|
|
3289
3345
|
"integer",
|
|
3290
3346
|
"object",
|
|
@@ -3294,7 +3350,7 @@ var ol = [
|
|
|
3294
3350
|
"real",
|
|
3295
3351
|
"boolean",
|
|
3296
3352
|
"blob"
|
|
3297
|
-
],
|
|
3353
|
+
], al = [
|
|
3298
3354
|
"persistent",
|
|
3299
3355
|
"required",
|
|
3300
3356
|
"notnull",
|
|
@@ -3306,7 +3362,7 @@ var ol = [
|
|
|
3306
3362
|
"stats",
|
|
3307
3363
|
"rstats",
|
|
3308
3364
|
"pstats"
|
|
3309
|
-
],
|
|
3365
|
+
], ul = [
|
|
3310
3366
|
"hook",
|
|
3311
3367
|
"fkey",
|
|
3312
3368
|
"enum",
|
|
@@ -3335,7 +3391,7 @@ var ol = [
|
|
|
3335
3391
|
"coordinates",
|
|
3336
3392
|
"gbuffer"
|
|
3337
3393
|
];
|
|
3338
|
-
function
|
|
3394
|
+
function _l(e) {
|
|
3339
3395
|
let t = {
|
|
3340
3396
|
name: e.id,
|
|
3341
3397
|
header: e.header,
|
|
@@ -3354,7 +3410,7 @@ function il(e) {
|
|
|
3354
3410
|
if (!e.flag) return t;
|
|
3355
3411
|
for (let n = 0; n < e.flag.length; n++) {
|
|
3356
3412
|
let r = e.flag[n];
|
|
3357
|
-
if (
|
|
3413
|
+
if (xs(ul, r)) {
|
|
3358
3414
|
switch (r) {
|
|
3359
3415
|
case "enum":
|
|
3360
3416
|
t.enum_list = e.enum;
|
|
@@ -3368,7 +3424,7 @@ function il(e) {
|
|
|
3368
3424
|
case "file": t.is_file = !0;
|
|
3369
3425
|
}
|
|
3370
3426
|
t.type = r;
|
|
3371
|
-
} else if (
|
|
3427
|
+
} else if (xs(al, r)) switch (r) {
|
|
3372
3428
|
case "writable":
|
|
3373
3429
|
t.is_writable = !0;
|
|
3374
3430
|
break;
|
|
@@ -3381,23 +3437,23 @@ function il(e) {
|
|
|
3381
3437
|
}
|
|
3382
3438
|
return t.is_file && (t.type = "file"), t;
|
|
3383
3439
|
}
|
|
3384
|
-
var
|
|
3440
|
+
var cl = [
|
|
3385
3441
|
x(v.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
3386
3442
|
x(v.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
3387
3443
|
x(v.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
3388
3444
|
R()
|
|
3389
|
-
],
|
|
3445
|
+
], fl = {
|
|
3390
3446
|
periodic: !1,
|
|
3391
3447
|
msec: 0,
|
|
3392
3448
|
timer_id: -1
|
|
3393
|
-
},
|
|
3394
|
-
function
|
|
3449
|
+
}, gl = null;
|
|
3450
|
+
function dl(e, t, n, r) {
|
|
3395
3451
|
let o = e.priv, s = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
3396
3452
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
3397
3453
|
Tn(e, "EV_TIMEOUT", {}, e);
|
|
3398
3454
|
}, o.msec) : o.timer_id = -1, In(e, s, {}), o.periodic || -1 !== o.timer_id || Et(e) && bt(e), 0;
|
|
3399
3455
|
}
|
|
3400
|
-
var
|
|
3456
|
+
var pl = {
|
|
3401
3457
|
mt_create: function(e) {
|
|
3402
3458
|
let t = e.priv, n = tn(e, "subscriber");
|
|
3403
3459
|
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 +3477,19 @@ var fl = {
|
|
|
3421
3477
|
},
|
|
3422
3478
|
mt_destroy: function(e) {}
|
|
3423
3479
|
};
|
|
3424
|
-
function
|
|
3480
|
+
function bl(e) {
|
|
3425
3481
|
return "number" == typeof e && Number.isFinite(e) ? Math.round(e) : e;
|
|
3426
3482
|
}
|
|
3427
|
-
function
|
|
3428
|
-
return e instanceof k ? "C_TIMER" !== Rt(e) ? (sr("not C_TIMER GObj"), -1) : (ln(e, "periodic", !1), void an(e, "msec",
|
|
3483
|
+
function ml(e, t) {
|
|
3484
|
+
return e instanceof k ? "C_TIMER" !== Rt(e) ? (sr("not C_TIMER GObj"), -1) : (ln(e, "periodic", !1), void an(e, "msec", bl(t))) : (sr("not GObj TYPE"), -1);
|
|
3429
3485
|
}
|
|
3430
|
-
function
|
|
3431
|
-
return e instanceof k ? "C_TIMER" !== Rt(e) ? (sr("not C_TIMER GObj"), -1) : (ln(e, "periodic", !0), void an(e, "msec",
|
|
3486
|
+
function hl(e, t) {
|
|
3487
|
+
return e instanceof k ? "C_TIMER" !== Rt(e) ? (sr("not C_TIMER GObj"), -1) : (ln(e, "periodic", !0), void an(e, "msec", bl(t))) : (sr("not GObj TYPE"), -1);
|
|
3432
3488
|
}
|
|
3433
|
-
function
|
|
3489
|
+
function yl(e) {
|
|
3434
3490
|
return e instanceof k ? "C_TIMER" !== Rt(e) ? (sr("not C_TIMER GObj"), -1) : void an(e, "msec", -1) : (sr("not GObj TYPE"), -1);
|
|
3435
3491
|
}
|
|
3436
|
-
var
|
|
3492
|
+
var vl = [
|
|
3437
3493
|
x(v.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
3438
3494
|
x(v.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
3439
3495
|
x(v.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -3453,60 +3509,60 @@ var ml = [
|
|
|
3453
3509
|
x(v.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
3454
3510
|
x(v.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
3455
3511
|
R()
|
|
3456
|
-
],
|
|
3457
|
-
function
|
|
3512
|
+
], El = { gobj_timer: null }, Tl = null;
|
|
3513
|
+
function jl(e, t, n, r) {
|
|
3458
3514
|
let o = zt(e, t);
|
|
3459
|
-
return
|
|
3515
|
+
return Ko(o) || (o = {}), o[n] = r, nn(e, t, o), st(e, t);
|
|
3460
3516
|
}
|
|
3461
|
-
var
|
|
3462
|
-
function
|
|
3517
|
+
var Ol = -2147483648, Sl = 2147483647;
|
|
3518
|
+
function wl(e) {
|
|
3463
3519
|
if (!0 === e || !1 === e) return e;
|
|
3464
|
-
if ("number" == typeof e) return !Number.isInteger(e) || e <
|
|
3520
|
+
if ("number" == typeof e) return !Number.isInteger(e) || e < Ol || e > Sl ? null : 0 !== e;
|
|
3465
3521
|
if ("string" != typeof e || "" === e) return null;
|
|
3466
3522
|
let t = e.toLowerCase();
|
|
3467
3523
|
if ("set" === t) return !0;
|
|
3468
3524
|
if ("reset" === t) return !1;
|
|
3469
3525
|
if (/^-?(0|[1-9][0-9]*)$/.test(e)) {
|
|
3470
3526
|
let t = Number(e);
|
|
3471
|
-
return t <
|
|
3527
|
+
return t < Ol || t > Sl ? null : 0 !== t;
|
|
3472
3528
|
}
|
|
3473
3529
|
return "true" === t || "yes" === t || "on" === t || "false" !== t && "no" !== t && "off" !== t && null;
|
|
3474
3530
|
}
|
|
3475
|
-
function
|
|
3531
|
+
function Nl() {
|
|
3476
3532
|
return `${Nt()}^${wt()}`;
|
|
3477
3533
|
}
|
|
3478
|
-
function
|
|
3534
|
+
function $l(e, t, n, r) {
|
|
3479
3535
|
return In(e, t, n), 0;
|
|
3480
3536
|
}
|
|
3481
|
-
var
|
|
3537
|
+
var Al = {
|
|
3482
3538
|
mt_create: function(e) {
|
|
3483
3539
|
let t = e.priv;
|
|
3484
|
-
un(e, "start_date",
|
|
3540
|
+
un(e, "start_date", qs()), un(e, "node_uuid", Xs()), e.priv.gobj_timer = ut(At(e), "C_TIMER", {}, e), t.periodic_timeout = zt(e, "periodic_timeout"), function(e) {
|
|
3485
3541
|
let t = zt(e, "trace_levels");
|
|
3486
|
-
if (!
|
|
3542
|
+
if (!Ko(t)) return 0;
|
|
3487
3543
|
let n = t.__global_trace__;
|
|
3488
|
-
if (
|
|
3544
|
+
if (Bo(n)) {
|
|
3489
3545
|
ie(4294967295, !1);
|
|
3490
3546
|
for (let e of n) se(e, !0);
|
|
3491
3547
|
}
|
|
3492
3548
|
for (const [n, r] of Object.entries(t)) {
|
|
3493
3549
|
let t = Ze(n);
|
|
3494
|
-
if (t) if (
|
|
3550
|
+
if (t) if (Bo(r)) {
|
|
3495
3551
|
de(t, null, !1);
|
|
3496
3552
|
for (let e of r) de(t, e, !0);
|
|
3497
3553
|
} else sr(`${At(e)}: trace_levels of ${n} MUST be a list`);
|
|
3498
3554
|
}
|
|
3499
3555
|
}(e), function(e) {
|
|
3500
3556
|
let t = zt(e, "no_trace_levels");
|
|
3501
|
-
if (!
|
|
3557
|
+
if (!Ko(t)) return 0;
|
|
3502
3558
|
let n = t.__global_no_trace__;
|
|
3503
|
-
if (
|
|
3559
|
+
if (Bo(n)) {
|
|
3504
3560
|
ae(4294967295, !1);
|
|
3505
3561
|
for (let e of n) le(e, !0);
|
|
3506
3562
|
}
|
|
3507
3563
|
for (const [n, r] of Object.entries(t)) {
|
|
3508
3564
|
let t = Ze(n);
|
|
3509
|
-
if (t) if (
|
|
3565
|
+
if (t) if (Bo(r)) {
|
|
3510
3566
|
pe(t, null, !1);
|
|
3511
3567
|
for (let e of r) pe(t, e, !0);
|
|
3512
3568
|
} else sr(`${At(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
@@ -3515,10 +3571,10 @@ var wl = {
|
|
|
3515
3571
|
},
|
|
3516
3572
|
mt_writing: function(e, t) {},
|
|
3517
3573
|
mt_start: function(e) {
|
|
3518
|
-
return
|
|
3574
|
+
return hl(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
3519
3575
|
},
|
|
3520
3576
|
mt_stop: function(e) {
|
|
3521
|
-
return
|
|
3577
|
+
return yl(e.priv.gobj_timer), ht(e), 0;
|
|
3522
3578
|
},
|
|
3523
3579
|
mt_destroy: function(e) {},
|
|
3524
3580
|
mt_play: function(e) {
|
|
@@ -3535,24 +3591,24 @@ var wl = {
|
|
|
3535
3591
|
case "get-global-no-trace": return r(0, 0, null, null, _e());
|
|
3536
3592
|
case "set-global-trace":
|
|
3537
3593
|
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, `${
|
|
3594
|
+
let o = "set-global-no-trace" === t, s = n.level, l = wl(n.set);
|
|
3595
|
+
return s ? null === l ? r(0, -1, `${Nl()}: bitmask set or re-set?`, null, null) : (o ? le(s, l) : se(s, l)) < 0 ? r(0, -1, `${Nl()}: global trace level not found: ${s}`, null, null) : o ? (jl(e, "no_trace_levels", "__global_no_trace__", _e()), r(0, 0, null, null, _e())) : (jl(e, "trace_levels", "__global_trace__", ue()), r(0, 0, null, null, ue())) : r(0, -1, `${Nl()}: what level?`, null, null);
|
|
3540
3596
|
}
|
|
3541
3597
|
case "get-gclass-trace":
|
|
3542
3598
|
case "get-gclass-no-trace":
|
|
3543
3599
|
case "set-gclass-trace":
|
|
3544
3600
|
case "set-gclass-no-trace": {
|
|
3545
3601
|
let o = t.indexOf("no-trace") >= 0, s = n.gclass_name || n.gclass || "", l = Ze(s);
|
|
3546
|
-
if (!l) return r(0, -1, `${
|
|
3602
|
+
if (!l) return r(0, -1, `${Nl()}: what gclass is '${s}'?`, null, null);
|
|
3547
3603
|
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, `${
|
|
3604
|
+
let i = n.level, a = wl(n.set);
|
|
3605
|
+
return i ? null === a ? r(0, -1, `${Nl()}: bitmask set or re-set?`, null, null) : (o ? pe(l, i, a) : de(l, i, a)) < 0 ? r(0, -1, `${Nl()}: trace level of ${s} not found: ${i}`, null, null) : o ? (jl(e, "no_trace_levels", s, ge(l)), r(0, 0, null, null, ge(l))) : (jl(e, "trace_levels", s, fe(l)), r(0, 0, null, null, ce(l))) : r(0, -1, `${Nl()}: what level?`, null, null);
|
|
3550
3606
|
}
|
|
3551
|
-
default: return r(0, -1, `${
|
|
3607
|
+
default: return r(0, -1, `${Nl()}: command not available: ${t}`, null, null);
|
|
3552
3608
|
}
|
|
3553
3609
|
}
|
|
3554
3610
|
};
|
|
3555
|
-
var
|
|
3611
|
+
var Rl = "ievent_gate_stack", xl = [
|
|
3556
3612
|
x(v.DTP_STRING, "wanted_yuno_role", $.SDF_RD, "", "wanted yuno role"),
|
|
3557
3613
|
x(v.DTP_STRING, "wanted_yuno_name", $.SDF_RD, "", "wanted yuno name"),
|
|
3558
3614
|
x(v.DTP_STRING, "wanted_yuno_service", $.SDF_RD, "", "wanted yuno service"),
|
|
@@ -3564,20 +3620,20 @@ var Nl = "ievent_gate_stack", $l = [
|
|
|
3564
3620
|
x(v.DTP_STRING, "cert_pem", $.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
3565
3621
|
x(v.DTP_JSON, "extra_info", $.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
3566
3622
|
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", "
|
|
3623
|
+
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
3624
|
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
3625
|
x(v.DTP_INTEGER, "timeout_idack", $.SDF_RD, "5000", "timeout waiting idAck"),
|
|
3570
3626
|
x(v.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
3571
3627
|
R()
|
|
3572
|
-
],
|
|
3628
|
+
], Dl = [
|
|
3573
3629
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
3574
3630
|
["ievents2", "Trace inter-events with full kw"],
|
|
3575
3631
|
["identity-card", "Trace identity_card messages"]
|
|
3576
3632
|
];
|
|
3577
|
-
function
|
|
3633
|
+
function kl(e) {
|
|
3578
3634
|
return !!(3 & Q(e));
|
|
3579
3635
|
}
|
|
3580
|
-
var
|
|
3636
|
+
var Cl = {
|
|
3581
3637
|
url: null,
|
|
3582
3638
|
remote_yuno_name: null,
|
|
3583
3639
|
remote_yuno_role: null,
|
|
@@ -3590,8 +3646,8 @@ var xl = {
|
|
|
3590
3646
|
retry_ms_before_session: 0,
|
|
3591
3647
|
session_since: 0,
|
|
3592
3648
|
retry_floor_warned: !1
|
|
3593
|
-
},
|
|
3594
|
-
function
|
|
3649
|
+
}, Il = null;
|
|
3650
|
+
function Pl(e) {
|
|
3595
3651
|
e.priv.websocket && sr("Websocket ALREADY setup");
|
|
3596
3652
|
const t = en(e, "url");
|
|
3597
3653
|
ir(`====> Starting WebSocket to '${t}' (${xt(e)})`);
|
|
@@ -3606,7 +3662,7 @@ function kl(e) {
|
|
|
3606
3662
|
code: 1006,
|
|
3607
3663
|
reason: r.message,
|
|
3608
3664
|
was_clean: !1
|
|
3609
|
-
}, e) < 0 &&
|
|
3665
|
+
}, e) < 0 && ml(e.priv.gobj_timer, Xl(e)), null;
|
|
3610
3666
|
}
|
|
3611
3667
|
return r ? (r.onopen = () => {
|
|
3612
3668
|
n !== e.priv.ws_seq || Pt(e) || Tn(e, "EV_ON_OPEN", {
|
|
@@ -3628,7 +3684,7 @@ function kl(e) {
|
|
|
3628
3684
|
}, e));
|
|
3629
3685
|
}, r) : (sr(`${xt(e)}: Failed to initialize WebSocket.`), null);
|
|
3630
3686
|
}
|
|
3631
|
-
function
|
|
3687
|
+
function Ll(e, t = 1e3, n = "") {
|
|
3632
3688
|
let r = e.priv, o = r.websocket;
|
|
3633
3689
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
3634
3690
|
ir(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
@@ -3639,12 +3695,12 @@ function Cl(e, t = 1e3, n = "") {
|
|
|
3639
3695
|
}
|
|
3640
3696
|
} else lr("WebSocket is already closed or in the process of closing.");
|
|
3641
3697
|
}
|
|
3642
|
-
function
|
|
3698
|
+
function Ul(e, t) {
|
|
3643
3699
|
let n = e.priv;
|
|
3644
|
-
"ST_SESSION" === cn(e) && (performance.now() - n.session_since <
|
|
3700
|
+
"ST_SESSION" === cn(e) && (performance.now() - n.session_since < Ql(e).max && (n.retry_ms = n.retry_ms_before_session), n.retry_ms_before_session = 0), Ll(e, 4002, t);
|
|
3645
3701
|
}
|
|
3646
|
-
var
|
|
3647
|
-
function
|
|
3702
|
+
var Fl = 128;
|
|
3703
|
+
function Ml(e, t) {
|
|
3648
3704
|
let n = String(e), r = Eo(n);
|
|
3649
3705
|
if (null !== r && (n = r), n.length > t) {
|
|
3650
3706
|
let e = t, r = n.charCodeAt(e);
|
|
@@ -3652,25 +3708,25 @@ function Ll(e, t) {
|
|
|
3652
3708
|
}
|
|
3653
3709
|
return n;
|
|
3654
3710
|
}
|
|
3655
|
-
function
|
|
3656
|
-
let r =
|
|
3711
|
+
function Gl(e, t, n) {
|
|
3712
|
+
let r = qs();
|
|
3657
3713
|
try {
|
|
3658
3714
|
ir("\n" + r + " " + t + "\n"), No(n);
|
|
3659
3715
|
} catch (e) {
|
|
3660
3716
|
ir("ERROR in trace_inter_event: " + e);
|
|
3661
3717
|
}
|
|
3662
3718
|
}
|
|
3663
|
-
var
|
|
3719
|
+
var Vl = class {
|
|
3664
3720
|
constructor(e, t) {
|
|
3665
3721
|
this.event = e, this.kw = t || {};
|
|
3666
3722
|
}
|
|
3667
3723
|
};
|
|
3668
|
-
function
|
|
3724
|
+
function Wl(e, t, n, r) {
|
|
3669
3725
|
return function(e, t) {
|
|
3670
3726
|
let n = e.priv, r = JSON.stringify(t);
|
|
3671
|
-
if (
|
|
3727
|
+
if (kl(e)) {
|
|
3672
3728
|
let n = en(e, "url"), o = At(St()) + " ==> " + n, s = zt(St(), "trace_ievent_callback");
|
|
3673
|
-
s ? s(o, t, 1, r.length) :
|
|
3729
|
+
s ? s(o, t, 1, r.length) : Gl(0, o, t);
|
|
3674
3730
|
}
|
|
3675
3731
|
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return lr(`${xt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
3676
3732
|
try {
|
|
@@ -3680,21 +3736,21 @@ function Ml(e, t, n, r) {
|
|
|
3680
3736
|
}
|
|
3681
3737
|
return 0;
|
|
3682
3738
|
}(e, function(e, t) {
|
|
3683
|
-
return
|
|
3739
|
+
return Xo(e) ? (sr("iev_create() event NULL"), null) : new Vl(e, t);
|
|
3684
3740
|
}(t, n));
|
|
3685
3741
|
}
|
|
3686
|
-
function
|
|
3687
|
-
return
|
|
3742
|
+
function Kl(e, t, n) {
|
|
3743
|
+
return Xo(n) && (n = en(e, "wanted_yuno_service")), {
|
|
3688
3744
|
dst_yuno: en(e, "wanted_yuno_name"),
|
|
3689
3745
|
dst_role: en(e, "wanted_yuno_role"),
|
|
3690
3746
|
dst_service: n,
|
|
3691
3747
|
src_yuno: wt(),
|
|
3692
3748
|
src_role: Nt(),
|
|
3693
3749
|
src_service: t,
|
|
3694
|
-
host:
|
|
3750
|
+
host: Xs()
|
|
3695
3751
|
};
|
|
3696
3752
|
}
|
|
3697
|
-
function
|
|
3753
|
+
function Bl(e) {
|
|
3698
3754
|
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
3755
|
i && i.length || (i = zt(St(), "required_services"));
|
|
3700
3756
|
let a = {
|
|
@@ -3712,32 +3768,32 @@ function Vl(e) {
|
|
|
3712
3768
|
username: en(St(), "__username__"),
|
|
3713
3769
|
launch_id: 0,
|
|
3714
3770
|
yuno_startdate: en(St(), "start_date"),
|
|
3715
|
-
id:
|
|
3771
|
+
id: Xs(),
|
|
3716
3772
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
3717
3773
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
3718
3774
|
required_services: i
|
|
3719
3775
|
};
|
|
3720
|
-
return
|
|
3776
|
+
return Cs(e, a, Rl, Kl(e, At(kt(e)), null)), Ps(e, a, "__identity__"), ml(t.gobj_timer, Zt(e, "timeout_idack")), Wl(e, "EV_IDENTITY_CARD", a);
|
|
3721
3777
|
}
|
|
3722
|
-
function
|
|
3723
|
-
if (
|
|
3778
|
+
function Yl(e, t) {
|
|
3779
|
+
if (Xo(t.event)) return -1;
|
|
3724
3780
|
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__, l = t.__service__, i = t.subscriber;
|
|
3725
3781
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
3726
|
-
return
|
|
3782
|
+
return Cs(e, n, Rl, Kl(e, At(i), l)), Ps(e, n, "__subscribing__"), Wl(e, t.event, n);
|
|
3727
3783
|
}
|
|
3728
|
-
function
|
|
3784
|
+
function Jl(e, t, n, r) {
|
|
3729
3785
|
let o = e.priv;
|
|
3730
|
-
return Et(e) && (o.websocket =
|
|
3786
|
+
return Et(e) && (o.websocket = Pl(e)), 0;
|
|
3731
3787
|
}
|
|
3732
|
-
function
|
|
3733
|
-
return ir("Websocket opened: " + e.priv.url),
|
|
3788
|
+
function ql(e, t, n, r) {
|
|
3789
|
+
return ir("Websocket opened: " + e.priv.url), Bl(e), 0;
|
|
3734
3790
|
}
|
|
3735
|
-
function
|
|
3791
|
+
function Hl(e, t, n, r) {
|
|
3736
3792
|
let o = e.priv, s = n.url;
|
|
3737
3793
|
if (void 0 !== n.ws_seq && n.ws_seq !== o.ws_seq) return 0;
|
|
3738
3794
|
Qn();
|
|
3739
|
-
const l =
|
|
3740
|
-
return
|
|
3795
|
+
const l = Ml(void 0 === n.reason ? "" : n.reason, 256);
|
|
3796
|
+
return kl(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
3797
|
url: s,
|
|
3742
3798
|
remote_yuno_name: o.remote_yuno_name,
|
|
3743
3799
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -3753,33 +3809,33 @@ function Yl(e, t, n, r) {
|
|
|
3753
3809
|
code: n.code,
|
|
3754
3810
|
reason: l,
|
|
3755
3811
|
was_clean: n.was_clean
|
|
3756
|
-
})), Et(e) &&
|
|
3812
|
+
})), Et(e) && ml(o.gobj_timer, Xl(e)), 0;
|
|
3757
3813
|
}
|
|
3758
|
-
var
|
|
3759
|
-
function
|
|
3814
|
+
var zl = 1e3;
|
|
3815
|
+
function Ql(e) {
|
|
3760
3816
|
let t = e.priv, n = Zt(e, "timeout_retry"), r = Zt(e, "timeout_retry_max");
|
|
3761
|
-
return n >=
|
|
3817
|
+
return n >= zl || (t.retry_floor_warned || (t.retry_floor_warned = !0, lr(`${xt(e)}: timeout_retry ${n} ms is below ${zl} ms: ${zl} ms is used`)), n = zl), r >= n || (r = n), {
|
|
3762
3818
|
base: n,
|
|
3763
3819
|
max: r
|
|
3764
3820
|
};
|
|
3765
3821
|
}
|
|
3766
|
-
function
|
|
3822
|
+
function Xl(e) {
|
|
3767
3823
|
let t = e.priv;
|
|
3768
|
-
const { base: n, max: r } =
|
|
3824
|
+
const { base: n, max: r } = Ql(e);
|
|
3769
3825
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
3770
3826
|
let o = .2 * t.retry_ms, s = t.retry_ms - o + 2 * Math.random() * o;
|
|
3771
3827
|
return Math.max(1, Math.round(s));
|
|
3772
3828
|
}
|
|
3773
|
-
function
|
|
3774
|
-
return
|
|
3829
|
+
function Zl(e, t, n, r) {
|
|
3830
|
+
return Bl(e), 0;
|
|
3775
3831
|
}
|
|
3776
|
-
function
|
|
3832
|
+
function ei(e, t, n, r) {
|
|
3777
3833
|
let o = e.priv;
|
|
3778
|
-
|
|
3779
|
-
let s =
|
|
3834
|
+
yl(o.gobj_timer);
|
|
3835
|
+
let s = Is(e, n, Rl, !0), l = fs(e, s, "src_yuno", ""), i = fs(e, s, "src_role", ""), a = fs(e, s, "src_service", "");
|
|
3780
3836
|
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)
|
|
3837
|
+
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", {});
|
|
3838
|
+
if (u < 0) Ll(e), In(e, "EV_ON_ID_NAK", {
|
|
3783
3839
|
url: en(e, "url"),
|
|
3784
3840
|
result: u,
|
|
3785
3841
|
comment: _,
|
|
@@ -3796,11 +3852,11 @@ function Ql(e, t, n, r) {
|
|
|
3796
3852
|
services_roles: f
|
|
3797
3853
|
})), o.inside_on_open = !1, function(e) {
|
|
3798
3854
|
let t = kn(e, null, null, null);
|
|
3799
|
-
for (let n = 0; n < t.length; n++)
|
|
3855
|
+
for (let n = 0; n < t.length; n++) Yl(e, t[n]);
|
|
3800
3856
|
}(e);
|
|
3801
3857
|
return 0;
|
|
3802
3858
|
}
|
|
3803
|
-
function
|
|
3859
|
+
function ti(e, t, n, r) {
|
|
3804
3860
|
let o = e.priv.url, s = function(e, t) {
|
|
3805
3861
|
let n;
|
|
3806
3862
|
try {
|
|
@@ -3819,49 +3875,49 @@ function Xl(e, t, n, r) {
|
|
|
3819
3875
|
kw: o || {}
|
|
3820
3876
|
} : (lr(`${xt(e)}: parsing inter_event: kw not a json object`), null) : (lr(`${xt(e)}: parsing inter_kw: no kw`), null);
|
|
3821
3877
|
}(e, n.data);
|
|
3822
|
-
if (!s) return lr(`${xt(e)}: frame dropped from ${o}: ${
|
|
3823
|
-
if (
|
|
3878
|
+
if (!s) return lr(`${xt(e)}: frame dropped from ${o}: ${Ml(n.data, 256)}`), -1;
|
|
3879
|
+
if (kl(e)) {
|
|
3824
3880
|
let e = At(St()) + " <== " + o, t = n.data.length, r = zt(St(), "trace_ievent_callback");
|
|
3825
|
-
r ? r(e, s, 2, t) :
|
|
3881
|
+
r ? r(e, s, 2, t) : Gl(0, e, s);
|
|
3826
3882
|
}
|
|
3827
3883
|
let l = s.event, i = s.kw;
|
|
3828
3884
|
if ("ST_SESSION" !== cn(e)) {
|
|
3829
3885
|
if ("ev_identity_card_ack" === String(l).toLowerCase()) {
|
|
3830
3886
|
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
|
|
3887
|
+
} else lr(`${xt(e)}: event UNKNOWN in not-session state ${Ml(l, Fl)}`);
|
|
3888
|
+
return Ul(e, "event out of session"), -1;
|
|
3833
3889
|
}
|
|
3834
3890
|
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: ${
|
|
3891
|
+
let a = Ls(e, i), u = Is(e, i, Rl), _ = fs(e, u, "dst_role", "");
|
|
3892
|
+
if (!Xo(_) && _.toLowerCase() !== String(Nt()).toLowerCase()) return lr(`${xt(e)}: It's not my role, dst_role: ${Ml(_, Fl)}, my_role: ${Nt()}, event: ${Ml(l, Fl)}`), Ul(e, "not my role"), -1;
|
|
3893
|
+
let c = fs(e, u, "dst_yuno", "");
|
|
3894
|
+
if (!Xo(c) && c.toLowerCase() !== String(wt()).toLowerCase()) return lr(`${xt(e)}: It's not my name, dst_yuno: ${Ml(c, Fl)}, my_name: ${wt()}, event: ${Ml(l, Fl)}`), Ul(e, "not my name"), -1;
|
|
3895
|
+
let f = fs(e, u, "dst_service", "");
|
|
3896
|
+
if ("__subscribing__" === a) return lr(`${xt(e)}: subscription event ignored, I'm client (service: ${Ml(f, Fl)}, event: ${Ml(l, Fl)})`), -1;
|
|
3897
|
+
if ("__unsubscribing__" === a) return lr(`${xt(e)}: unsubscription event ignored, I'm client (service: ${Ml(f, Fl)}, event: ${Ml(l, Fl)})`), -1;
|
|
3842
3898
|
const g = On(l, 0, !1);
|
|
3843
3899
|
if (g && gn(e, g.event_name, 0)) {
|
|
3844
3900
|
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 '${
|
|
3901
|
+
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 '${Ml(l, Fl)}'`), -1);
|
|
3846
3902
|
}
|
|
3847
|
-
if (!
|
|
3903
|
+
if (!Xo(f)) {
|
|
3848
3904
|
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 '${
|
|
3905
|
+
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 '${Ml(l, Fl)}'`), -1) : (lr(`${xt(e)}: event for a service that is gone, DROPPED: service '${Ml(f, Fl)}', ev '${Ml(l, Fl)}'`), 0);
|
|
3850
3906
|
}
|
|
3851
3907
|
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 '${
|
|
3908
|
+
return d ? (In(e, d.event_name, i), 0) : (lr(`${xt(e)}: event that no gclass declares public, DROPPED: ev '${Ml(l, Fl)}'`), -1);
|
|
3853
3909
|
}
|
|
3854
|
-
function
|
|
3910
|
+
function ni(e, t, n, r) {
|
|
3855
3911
|
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, "")} '${
|
|
3912
|
+
return lr(`${xt(e)}: ${t} not served by this client, DROPPED: ${r.replace(/_/g, "")} '${Ml(o, Fl)}', service '${Ml(s, Fl)}'`), -1;
|
|
3857
3913
|
}
|
|
3858
|
-
function
|
|
3859
|
-
return
|
|
3914
|
+
function ri(e, t, n, r) {
|
|
3915
|
+
return ni(e, t, n, "__stats__");
|
|
3860
3916
|
}
|
|
3861
|
-
function
|
|
3862
|
-
return
|
|
3917
|
+
function oi(e, t, n, r) {
|
|
3918
|
+
return ni(e, t, n, "__command__");
|
|
3863
3919
|
}
|
|
3864
|
-
var
|
|
3920
|
+
var si = {
|
|
3865
3921
|
mt_create: function(e) {
|
|
3866
3922
|
let t = e.priv;
|
|
3867
3923
|
t.gobj_timer = ut(At(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);
|
|
@@ -3891,52 +3947,52 @@ var ni = {
|
|
|
3891
3947
|
code: 1e3,
|
|
3892
3948
|
reason: "restarted",
|
|
3893
3949
|
was_clean: !0
|
|
3894
|
-
}, e),
|
|
3950
|
+
}, e), yl(t.gobj_timer)), t.websocket = Pl(e), 0;
|
|
3895
3951
|
},
|
|
3896
3952
|
mt_stop: function(e) {
|
|
3897
3953
|
let t = e.priv;
|
|
3898
|
-
return
|
|
3954
|
+
return yl(t.gobj_timer), t.websocket && Ll(e), 0;
|
|
3899
3955
|
},
|
|
3900
3956
|
mt_destroy: function(e) {},
|
|
3901
3957
|
mt_stats: function(e, t, n, r) {
|
|
3902
3958
|
if ("ST_SESSION" !== cn(e)) return sr("Not in session"), null;
|
|
3903
3959
|
n || (n = {});
|
|
3904
|
-
let o =
|
|
3905
|
-
return s || (s = {}),
|
|
3960
|
+
let o = Kl(e, At(r), fs(e, n, "service", null, 0)), s = ps(e, n, "__md_stats__", null, Pn.KW_EXTRACT);
|
|
3961
|
+
return s || (s = {}), Cs(e, n, "stats_stack", {
|
|
3906
3962
|
stats: t,
|
|
3907
3963
|
kw: s
|
|
3908
|
-
}),
|
|
3964
|
+
}), Cs(e, n, Rl, o), n.__stats__ = t, Ps(e, n, "__stats__"), Wl(e, "EV_MT_STATS", n, r), null;
|
|
3909
3965
|
},
|
|
3910
3966
|
mt_command_parser: function(e, t, n, r) {
|
|
3911
3967
|
if ("ST_SESSION" !== cn(e)) return sr("Not in session"), null;
|
|
3912
3968
|
n || (n = {});
|
|
3913
|
-
let o =
|
|
3914
|
-
return s || (s = {}),
|
|
3969
|
+
let o = Kl(e, At(r), fs(e, n, "service", "", 0)), s = ps(e, n, "__md_command__", null, Pn.KW_EXTRACT);
|
|
3970
|
+
return s || (s = {}), Cs(e, n, "command_stack", {
|
|
3915
3971
|
command: t,
|
|
3916
3972
|
kw: s
|
|
3917
|
-
}),
|
|
3973
|
+
}), Cs(e, n, Rl, o), n.__command__ = t, Ps(e, n, "__command__"), Wl(e, "EV_MT_COMMAND", n, r), null;
|
|
3918
3974
|
},
|
|
3919
3975
|
mt_inject_event: function(e, t, n, r) {
|
|
3920
3976
|
if ("ST_SESSION" !== cn(e)) return window.console.error("Not in session"), -1;
|
|
3921
|
-
if (n = Ro({},
|
|
3977
|
+
if (n = Ro({}, Ko(n) ? n : {}), Ko(n.__md_iev__) && (n.__md_iev__ = $o(n.__md_iev__)), Is(e, n, Rl));
|
|
3922
3978
|
else {
|
|
3923
|
-
let o =
|
|
3924
|
-
Co(n, "__service__"),
|
|
3979
|
+
let o = Kl(e, At(r), fs(e, n, "__service__", 0, 0));
|
|
3980
|
+
Co(n, "__service__"), Cs(e, n, "__message__", t), Cs(e, n, Rl, o);
|
|
3925
3981
|
}
|
|
3926
|
-
return
|
|
3982
|
+
return Ps(e, n, "__message__"), Wl(e, t, n, r);
|
|
3927
3983
|
},
|
|
3928
3984
|
mt_subscription_added: function(e, t) {
|
|
3929
3985
|
let n = e.priv;
|
|
3930
|
-
return "ST_SESSION" === cn(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3986
|
+
return "ST_SESSION" === cn(e) && n.websocket ? n.inside_on_open ? 0 : Yl(e, t) : 0;
|
|
3931
3987
|
},
|
|
3932
3988
|
mt_subscription_deleted: function(e, t) {
|
|
3933
3989
|
let n = e.priv;
|
|
3934
3990
|
if ("ST_SESSION" !== cn(e) || !n.websocket) return 0;
|
|
3935
3991
|
if (n.inside_on_open) return 0;
|
|
3936
|
-
if (
|
|
3992
|
+
if (Xo(t.event)) return 0;
|
|
3937
3993
|
let r = {}, o = t.__global__, s = t.__config__, l = t.__filter__, i = t.__service__, a = t.subscriber;
|
|
3938
3994
|
s && (r.__config__ = s), o && (r.__global__ = o), l && (r.__filter__ = l);
|
|
3939
|
-
return
|
|
3995
|
+
return Cs(e, r, Rl, Kl(e, At(a), i)), Ps(e, r, "__unsubscribing__"), Wl(e, t.event, r, e);
|
|
3940
3996
|
}
|
|
3941
3997
|
};
|
|
3942
3998
|
exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) => new A(e, t, n, null, s, r, null, 0, null, o, null), exports.SDATACM = (e, t, n, r, o, s) => new A(e, t, 0, null, s, n, null, 0, o, r, null), exports.SDATACM2 = (e, t, n, r, o, s, l) => new A(e, t, n, null, l, r, null, 0, s, o, null), exports.SDATADF = (e, t, n, r, o, s) => new A(e, t, n, null, s, null, r, o), exports.SDATAPM = (e, t, n, r, o) => new A(e, t, n, r, o), exports.SDATAPM0 = (e, t, n, r, o) => new A(e, t, n, null, o, null, null, 0, null, null, r), exports.SDATA_END = R, exports.SDataDesc = A, exports.YUNETA_VERSION = s, Object.defineProperty(exports, "__yuno__", {
|
|
@@ -3950,7 +4006,7 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3950
4006
|
return t;
|
|
3951
4007
|
}, exports.build_stats_response = o, exports.clean_name = function(e) {
|
|
3952
4008
|
return e.replace(/[?# ^:]/g, "_");
|
|
3953
|
-
}, exports.clear_timeout =
|
|
4009
|
+
}, exports.clear_timeout = yl, exports.cmp_two_simple_json = ns, exports.command_parameter_from_json = xe, exports.command_parameter_from_text = function(e, t) {
|
|
3954
4010
|
const n = Re(e, t, !1);
|
|
3955
4011
|
return void 0 !== n.value || n.refused || (n.refused = Te), n;
|
|
3956
4012
|
}, exports.command_parser = function(e, t, n, r) {}, exports.createElement2 = function e(t, n) {
|
|
@@ -3962,46 +4018,46 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3962
4018
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
3963
4019
|
i.style.cssText = t;
|
|
3964
4020
|
} 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 (
|
|
4021
|
+
if (Ws(s)) i.appendChild(Ks(s));
|
|
4022
|
+
else if (Yo(s)) if (s = s.trim(), s.length > 0 && "<" === s[0] && !Bs) i.appendChild(Js(s));
|
|
3967
4023
|
else if (s.length > 0 && "<" === s[0] && function(e) {
|
|
3968
|
-
if (
|
|
4024
|
+
if (Ys.size >= 100) return;
|
|
3969
4025
|
const t = e.slice(0, 80);
|
|
3970
|
-
|
|
4026
|
+
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
4027
|
}(s), n && a) i.textContent = n(a) || s;
|
|
3972
4028
|
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) :
|
|
4029
|
+
else if (Bo(s)) {
|
|
4030
|
+
if (s.length > 0) if (Yo(s[0])) i.appendChild(e(s, n));
|
|
4031
|
+
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
4032
|
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? i.appendChild(s) : null != s && (sr("content ignored"), ur(s));
|
|
3977
4033
|
if (l && "object" == typeof l) for (const e of Object.keys(l)) i.addEventListener(e, l[e]);
|
|
3978
4034
|
return i;
|
|
3979
|
-
}, exports.createOneHtml =
|
|
4035
|
+
}, exports.createOneHtml = Js, exports.create_json_record = function(e, t) {
|
|
3980
4036
|
let n = $o(e);
|
|
3981
4037
|
return xo(n, t), n;
|
|
3982
4038
|
}, exports.create_template_record = function(e, t) {
|
|
3983
4039
|
let n = {};
|
|
3984
4040
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
3985
4041
|
let o;
|
|
3986
|
-
|
|
3987
|
-
let s =
|
|
4042
|
+
Ko(r) && (o = r.default);
|
|
4043
|
+
let s = ps(null, t, e, o);
|
|
3988
4044
|
Io(n, e, s);
|
|
3989
4045
|
}), n;
|
|
3990
|
-
}, exports.current_timestamp =
|
|
3991
|
-
let n =
|
|
3992
|
-
return n &&
|
|
4046
|
+
}, exports.current_timestamp = qs, exports.data_type_t = v, exports.db_list_persistent_attrs = function(e, t) {
|
|
4047
|
+
let n = Ss(sl(e), null, !1), r = {};
|
|
4048
|
+
return n && Ko(n) && (r = vs(e, n, t, !1)), r;
|
|
3993
4049
|
}, exports.db_load_persistent_attrs = function(e, t) {
|
|
3994
|
-
let n = Qt(e, $.SDF_PERSIST), r =
|
|
3995
|
-
if (r &&
|
|
3996
|
-
let o =
|
|
3997
|
-
o =
|
|
4050
|
+
let n = Qt(e, $.SDF_PERSIST), r = Ss(sl(e), null, !1);
|
|
4051
|
+
if (r && Ko(r)) {
|
|
4052
|
+
let o = vs(e, r, t, !1);
|
|
4053
|
+
o = vs(e, o, n, !1), sn(e, o, $.SDF_PERSIST);
|
|
3998
4054
|
}
|
|
3999
4055
|
}, exports.db_remove_persistent_attrs = function(e, t) {
|
|
4000
|
-
let n =
|
|
4001
|
-
0 === Mo(n) ?
|
|
4056
|
+
let n = Es(e, Ss(sl(e), null, !1), t, !1);
|
|
4057
|
+
0 === Mo(n) ? Ns(sl(e)) : ws(sl(e), n);
|
|
4002
4058
|
}, exports.db_save_persistent_attrs = function(e, t) {
|
|
4003
|
-
let n =
|
|
4004
|
-
return r &&
|
|
4059
|
+
let n = vs(e, Qt(e, $.SDF_PERSIST), t, !1), r = Ss(sl(e), null, !1);
|
|
4060
|
+
return r && Ko(r) && Do(n, r), ws(sl(e), n);
|
|
4005
4061
|
}, exports.debounce = function(e, t = 0, n = !1) {
|
|
4006
4062
|
let r = null, o = null, s = null;
|
|
4007
4063
|
const l = (...l) => {
|
|
@@ -4023,22 +4079,20 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4023
4079
|
const t = {};
|
|
4024
4080
|
for (const n of e) Ro(t, structuredClone(n));
|
|
4025
4081
|
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) {
|
|
4082
|
+
}, exports.empty_json = Wo, exports.empty_string = Xo, exports.escapeHtml = Gs, exports.event_flag_t = L, exports.flat2json = function(e) {
|
|
4029
4083
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
4030
4084
|
let t = null;
|
|
4031
4085
|
for (const n of Object.keys(e)) {
|
|
4032
|
-
const r =
|
|
4086
|
+
const r = rl(n);
|
|
4033
4087
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
4034
|
-
if (r.length >
|
|
4088
|
+
if (r.length > el) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
4035
4089
|
const o = "number" == typeof r[0];
|
|
4036
4090
|
if (null === t) t = o ? [] : {};
|
|
4037
4091
|
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
4038
4092
|
let s = t;
|
|
4039
4093
|
for (let t = 0; t < r.length; t++) {
|
|
4040
4094
|
const o = r[t], l = "number" == typeof o, i = t === r.length - 1, a = !i && "number" == typeof r[t + 1];
|
|
4041
|
-
if (l && o >
|
|
4095
|
+
if (l && o > tl) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
4042
4096
|
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
4097
|
if (i) {
|
|
4044
4098
|
if (Array.isArray(s)) {
|
|
@@ -4046,7 +4100,7 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4046
4100
|
s[o] = e[n];
|
|
4047
4101
|
} else {
|
|
4048
4102
|
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
|
-
|
|
4103
|
+
ls(s, o, e[n]);
|
|
4050
4104
|
}
|
|
4051
4105
|
break;
|
|
4052
4106
|
}
|
|
@@ -4054,7 +4108,7 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4054
4108
|
if (Array.isArray(s)) {
|
|
4055
4109
|
for (; s.length <= o;) s.push(null);
|
|
4056
4110
|
u = s[o], null == u && (u = a ? [] : {}, s[o] = u);
|
|
4057
|
-
} else u =
|
|
4111
|
+
} else u = ss(s, o) ? void 0 : s[o], void 0 === u && (u = a ? [] : {}, ls(s, o, u));
|
|
4058
4112
|
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
4113
|
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
4114
|
s = u;
|
|
@@ -4065,11 +4119,11 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4065
4119
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
4066
4120
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
4067
4121
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
4068
|
-
for (const n of Object.keys(t.added || {}))
|
|
4122
|
+
for (const n of Object.keys(t.added || {})) ls(e, n, t.added[n]);
|
|
4069
4123
|
for (const n of Object.keys(t.changed || {})) {
|
|
4070
4124
|
const r = t.changed[n];
|
|
4071
4125
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
4072
|
-
|
|
4126
|
+
ls(e, n, r.to);
|
|
4073
4127
|
}
|
|
4074
4128
|
return e;
|
|
4075
4129
|
}, exports.flat_diff = function(e, t) {
|
|
@@ -4078,15 +4132,15 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4078
4132
|
removed: {},
|
|
4079
4133
|
changed: {}
|
|
4080
4134
|
};
|
|
4081
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
4135
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? ol(n[e], r[e]) || ls(o.changed, e, {
|
|
4082
4136
|
from: n[e],
|
|
4083
4137
|
to: r[e]
|
|
4084
|
-
}) :
|
|
4085
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
4138
|
+
}) : ls(o.removed, e, n[e]);
|
|
4139
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || ls(o.added, e, r[e]);
|
|
4086
4140
|
return o;
|
|
4087
4141
|
}, 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 =
|
|
4142
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : nl(e)).join("`") : "";
|
|
4143
|
+
}, exports.flat_key_split = rl, 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
4144
|
if (!e) return {
|
|
4091
4145
|
top: 0,
|
|
4092
4146
|
left: 0,
|
|
@@ -4105,14 +4159,14 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4105
4159
|
right: n + i + r,
|
|
4106
4160
|
bottom: t + l + o
|
|
4107
4161
|
};
|
|
4108
|
-
}, exports.get_function_name =
|
|
4162
|
+
}, exports.get_function_name = Zs, exports.get_now = function() {
|
|
4109
4163
|
return Math.floor(Date.now() / 1e3);
|
|
4110
4164
|
}, exports.gobj_bottom_gobj = Lt, exports.gobj_change_parent = function(e, n) {
|
|
4111
4165
|
return Pt(e) ? (sr("gobj NULL or DESTROYED"), null) : n instanceof k ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (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) : (sr(`${xt(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
4112
4166
|
}, exports.gobj_change_state = _n, exports.gobj_command = function(e, n, o, s) {
|
|
4113
4167
|
if (Pt(e)) return sr("gobj NULL or DESTROYED"), -1;
|
|
4114
4168
|
if (function(e) {
|
|
4115
|
-
return
|
|
4169
|
+
return q > 1 || !!e && !!(Q(e) & K.TRACE_COMMANDS);
|
|
4116
4170
|
}(e) || re(e, null) && !oe(s, null)) {
|
|
4117
4171
|
let r = Eo(n);
|
|
4118
4172
|
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 +4183,25 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4129
4183
|
}, exports.gobj_create_yuno = function(e, t, n) {
|
|
4130
4184
|
return at(e, t, n, null, I.gobj_flag_yuno);
|
|
4131
4185
|
}, 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 (
|
|
4186
|
+
if (Xo(t)) return null;
|
|
4133
4187
|
const n = t.toLowerCase();
|
|
4134
|
-
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? p :
|
|
4188
|
+
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? p : qt(p, t);
|
|
4135
4189
|
}, 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 = Rt, 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
4190
|
return Y;
|
|
4137
4191
|
}, exports.gobj_global_trace_no_level = function() {
|
|
4138
4192
|
return J;
|
|
4139
|
-
}, exports.gobj_has_attr =
|
|
4193
|
+
}, 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
4194
|
return u ? u(e, t) : null;
|
|
4141
4195
|
}, exports.gobj_list_subscriptions = function(e) {
|
|
4142
4196
|
let t = kn(e, null, null, null);
|
|
4143
4197
|
for (let n = 0; n < t.length; n++) {
|
|
4144
|
-
let r = t[n], o =
|
|
4145
|
-
Po(r, "s_event",
|
|
4198
|
+
let r = t[n], o = gs(e, r, "publisher", null, Pn.KW_REQUIRED), s = gs(e, r, "subscriber", null, Pn.KW_REQUIRED);
|
|
4199
|
+
Po(r, "s_event", fs(e, r, "event", "", Pn.KW_REQUIRED)), Po(r, "s_publisher", xt(o)), Po(r, "s_subscriber", xt(s));
|
|
4146
4200
|
}
|
|
4147
4201
|
let n = Cn(e, 0, null, 0);
|
|
4148
4202
|
for (let t = 0; t < n.length; t++) {
|
|
4149
|
-
let r = n[t], o =
|
|
4150
|
-
Po(r, "s_event",
|
|
4203
|
+
let r = n[t], 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));
|
|
4151
4205
|
}
|
|
4152
4206
|
return {
|
|
4153
4207
|
subscriptions: t,
|
|
@@ -4194,16 +4248,16 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4194
4248
|
let r = e.gclass.attrs_table;
|
|
4195
4249
|
for (let o = 0; o < r.length; o++) {
|
|
4196
4250
|
const s = r[o];
|
|
4197
|
-
s.name && (n && s.flag & n || (-1 === t || s.flag & t) && (me(e, e.jn_attrs, s),
|
|
4251
|
+
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
4252
|
}
|
|
4199
4253
|
return 0;
|
|
4200
4254
|
}(e, $.SDF_VOLATIL, 0);
|
|
4201
|
-
}, exports.gobj_save_persistent_attrs = st, exports.gobj_search_path =
|
|
4255
|
+
}, exports.gobj_save_persistent_attrs = st, exports.gobj_search_path = qt, exports.gobj_send_event = Tn, exports.gobj_services = function() {
|
|
4202
4256
|
let e = [];
|
|
4203
4257
|
for (const t of Object.keys(d)) Uo(e, t);
|
|
4204
4258
|
return e;
|
|
4205
4259
|
}, exports.gobj_set_bottom_gobj = Ut, exports.gobj_set_deep_trace = function(e) {
|
|
4206
|
-
return
|
|
4260
|
+
return q = Number(e) || 0, 0;
|
|
4207
4261
|
}, 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
4262
|
if (!e) return sr("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
4209
4263
|
const r = z(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
@@ -4223,7 +4277,7 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4223
4277
|
const d = [["EV_STATE_CHANGED", L.EVF_SYSTEM_EVENT | L.EVF_OUTPUT_EVENT | L.EVF_NO_WARN_SUBS], [0, 0]];
|
|
4224
4278
|
for (let e = 0; e < d.length; e++) {
|
|
4225
4279
|
let t = d[e][0], n = d[e][1];
|
|
4226
|
-
|
|
4280
|
+
He(f, t, n);
|
|
4227
4281
|
}
|
|
4228
4282
|
return 0;
|
|
4229
4283
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
@@ -4244,7 +4298,7 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4244
4298
|
]);
|
|
4245
4299
|
if (Object.keys(n).forEach((n) => {
|
|
4246
4300
|
o.has(n) || sr(`${xt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
4247
|
-
}),
|
|
4301
|
+
}), Xo(t)) t = "";
|
|
4248
4302
|
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
4303
|
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
4304
|
for (let t = 0; t < l.length; t++) {
|
|
@@ -4253,75 +4307,75 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4253
4307
|
}
|
|
4254
4308
|
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
4309
|
}, 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 =
|
|
4310
|
+
return "string" != typeof e ? (sr("html_markup: not a string, type " + typeof e), new Vs("")) : new Vs(e);
|
|
4311
|
+
}, exports.id_index_in_obj_list = Rs, exports.index_in_list = Hs, exports.is_array = Bo, exports.is_boolean = qo, exports.is_date = function(e) {
|
|
4258
4312
|
return e instanceof Date && !isNaN(e);
|
|
4259
|
-
}, exports.is_function =
|
|
4260
|
-
if (!
|
|
4313
|
+
}, exports.is_function = zo, exports.is_gobj = Qo, exports.is_html_markup = Ws, exports.is_metadata_key = function(e) {
|
|
4314
|
+
if (!Yo(e)) return !1;
|
|
4261
4315
|
let t = 0;
|
|
4262
4316
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
4263
4317
|
return 2 === t;
|
|
4264
|
-
}, exports.is_null = Ho, exports.is_number =
|
|
4265
|
-
if (!
|
|
4318
|
+
}, exports.is_null = Ho, exports.is_number = Jo, exports.is_object = Ko, exports.is_private_key = function(e) {
|
|
4319
|
+
if (!Yo(e)) return !1;
|
|
4266
4320
|
let t = 0;
|
|
4267
4321
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
4268
4322
|
return 1 === t;
|
|
4269
4323
|
}, exports.is_pure_number = function(e) {
|
|
4270
|
-
if (
|
|
4271
|
-
if (!
|
|
4324
|
+
if (Jo(e)) return !0;
|
|
4325
|
+
if (!Yo(e)) return !1;
|
|
4272
4326
|
const t = Number(e);
|
|
4273
4327
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
4274
4328
|
}, exports.is_secret_name = function(e) {
|
|
4275
4329
|
return "string" == typeof e && yr(e, 0, e.length, !0, !0);
|
|
4276
|
-
}, exports.is_string =
|
|
4277
|
-
let o =
|
|
4330
|
+
}, exports.is_string = Yo, exports.jdb_delete = function(e, t, n, r) {
|
|
4331
|
+
let o = ps(null, ps(null, e, "topics", null, 0), t, null, 0);
|
|
4278
4332
|
if (!o) return sr("jdb_delete: topic not found: " + t), null;
|
|
4279
|
-
if (!
|
|
4280
|
-
if (!
|
|
4333
|
+
if (!Ko(r) || Xo(r.id)) return sr(`jdb_delete: record without id: ${Xn(r)}`), null;
|
|
4334
|
+
if (!Yo(n)) return sr(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
4281
4335
|
if ("" !== n && n.split("`").includes("")) return sr(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
4282
4336
|
let s, l = n.split("`"), i = o;
|
|
4283
|
-
for (; (s = l.shift()) && !
|
|
4337
|
+
for (; (s = l.shift()) && !Xo(s) && i;) Ko(i) && (i = ps(null, i, e.hook, null, 0)), i = Fs(i, null, s, !1);
|
|
4284
4338
|
if (!i || 0 !== l.length) return sr(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
4285
|
-
let a =
|
|
4339
|
+
let a = Bo(i) ? i : ps(null, i, e.hook, null, 0), u = Rs(a, r.id);
|
|
4286
4340
|
return u < 0 ? (sr(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (a.splice(u, 1), o);
|
|
4287
4341
|
}, exports.jdb_get = function(e, t, n, r) {
|
|
4288
|
-
let o =
|
|
4289
|
-
return o ? (void 0 === r && (r = !0),
|
|
4342
|
+
let o = ps(null, ps(null, e, "topics", null, 0), t, null, 0);
|
|
4343
|
+
return o ? (void 0 === r && (r = !0), Fs(o, e.hook, n, r)) : (sr("jdb_get: topic not found: " + t), null);
|
|
4290
4344
|
}, exports.jdb_get_by_idx = function(e, t, n) {
|
|
4291
|
-
let r =
|
|
4345
|
+
let r = ps(null, ps(null, e, "topics", null, 0), t, null, 0);
|
|
4292
4346
|
return r ? n < r.length ? r[n] : {} : (sr("jdb_get_by_idx: topic not found: " + t), null);
|
|
4293
4347
|
}, exports.jdb_get_topic = function(e, t) {
|
|
4294
|
-
let n =
|
|
4348
|
+
let n = ps(null, e, "topics", null, 0);
|
|
4295
4349
|
if (!n) return sr("jdb topics section not found"), ar(e), null;
|
|
4296
|
-
return
|
|
4350
|
+
return ps(null, n, t, null, 0) || (sr("jdb topic not found: " + t), ar(n), null);
|
|
4297
4351
|
}, exports.jdb_init = function(e, t, n) {
|
|
4298
4352
|
n && (e = $o(e));
|
|
4299
|
-
let r =
|
|
4300
|
-
|
|
4301
|
-
let o =
|
|
4302
|
-
return
|
|
4303
|
-
"__" === t.substring(0, 2) ||
|
|
4353
|
+
let r = ps(null, e, "type", [], Pn.KW_CREATE);
|
|
4354
|
+
fs(null, e, "hook", "data", Pn.KW_CREATE);
|
|
4355
|
+
let o = ps(null, e, "schema", {}, Pn.KW_CREATE), s = ps(null, e, "topics", {}, Pn.KW_CREATE);
|
|
4356
|
+
return Us(o, function(e, t, n, o) {
|
|
4357
|
+
"__" === t.substring(0, 2) || Ko(n) || ps(null, s, o, $o(r), Pn.KW_CREATE);
|
|
4304
4358
|
}, t), e;
|
|
4305
4359
|
}, exports.jdb_update = function(e, t, n, r) {
|
|
4306
|
-
let o =
|
|
4360
|
+
let o = ps(null, ps(null, e, "topics", null, 0), t, null, 0);
|
|
4307
4361
|
if (!o) return sr("jdb_update: topic not found: " + t), null;
|
|
4308
|
-
if (!
|
|
4309
|
-
if (!
|
|
4362
|
+
if (!Ko(r) || Xo(r.id)) return sr(`jdb_update: record without id: ${Xn(r)}`), null;
|
|
4363
|
+
if (!Yo(n)) return sr(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
4310
4364
|
if ("" !== n && n.split("`").includes("")) return sr(`jdb_update: empty segment in path: '${n}'`), null;
|
|
4311
4365
|
let s, l, i = n.split("`"), a = o;
|
|
4312
|
-
for (; (s = i.shift()) && !
|
|
4366
|
+
for (; (s = i.shift()) && !Xo(s) && a;) Ko(a) && (a = ps(null, a, e.hook, null, 0)), a = Fs(a, null, s, !1);
|
|
4313
4367
|
if (!a || 0 !== i.length) return sr(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
4314
|
-
if (
|
|
4368
|
+
if (Bo(a)) l = a;
|
|
4315
4369
|
else {
|
|
4316
4370
|
if (a.id === r.id) return Ro(a, r), o;
|
|
4317
|
-
if (l =
|
|
4318
|
-
else if (!
|
|
4371
|
+
if (l = ps(null, a, e.hook, null, 0), null == l) l = [], Io(a, e.hook, l);
|
|
4372
|
+
else if (!Bo(l)) return sr(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
4319
4373
|
}
|
|
4320
|
-
let u =
|
|
4374
|
+
let u = Fs(l, e.hook, r.id, !1);
|
|
4321
4375
|
return u ? Ro(u, r) : l.push(r), o;
|
|
4322
4376
|
}, exports.json2flat = function(e) {
|
|
4323
4377
|
const t = {}, n = (e, r, o) => {
|
|
4324
|
-
if (o >
|
|
4378
|
+
if (o > el) throw new Error("json2flat: deeper than 256");
|
|
4325
4379
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
4326
4380
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
4327
4381
|
const s = `[${t}]`;
|
|
@@ -4331,20 +4385,20 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4331
4385
|
const t = Object.keys(e);
|
|
4332
4386
|
if (t.length > 0) {
|
|
4333
4387
|
for (const s of t) {
|
|
4334
|
-
const t =
|
|
4388
|
+
const t = nl(s);
|
|
4335
4389
|
n(e[s], 0 === o ? t : r + "`" + t, o + 1);
|
|
4336
4390
|
}
|
|
4337
4391
|
return;
|
|
4338
4392
|
}
|
|
4339
4393
|
}
|
|
4340
|
-
0 !== o &&
|
|
4394
|
+
0 !== o && ls(t, r, e);
|
|
4341
4395
|
};
|
|
4342
4396
|
return null == e || n(e, "", 0), t;
|
|
4343
4397
|
}, exports.json_array_append = Lo, exports.json_array_append_new = Uo, exports.json_array_extend = function(e, t) {
|
|
4344
4398
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
4345
4399
|
}, exports.json_array_remove = Fo, exports.json_array_size = Go, exports.json_deep_copy = $o, exports.json_is_identical = Ao, 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 = Ro, 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
4400
|
try {
|
|
4347
|
-
let n =
|
|
4401
|
+
let n = Ms(e);
|
|
4348
4402
|
switch (t) {
|
|
4349
4403
|
case "header": return JSON.parse(n.header);
|
|
4350
4404
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -4353,98 +4407,98 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4353
4407
|
} catch (e) {
|
|
4354
4408
|
return null;
|
|
4355
4409
|
}
|
|
4356
|
-
}, exports.jwtDecode =
|
|
4357
|
-
if (e && !
|
|
4358
|
-
r || (r =
|
|
4410
|
+
}, exports.jwtDecode = Ms, exports.kw_clone_by_keys = vs, exports.kw_clone_by_not_keys = Es, exports.kw_collect = function(e, t, n, r) {
|
|
4411
|
+
if (e && !Qo(e) && sr("GObj bad instanceof"), !t) return null;
|
|
4412
|
+
r || (r = ys);
|
|
4359
4413
|
let o = [];
|
|
4360
|
-
if (
|
|
4414
|
+
if (Bo(t)) for (let e = 0; e < t.length; e++) {
|
|
4361
4415
|
let s = t[e];
|
|
4362
4416
|
r(s, n) && o.push(s);
|
|
4363
4417
|
}
|
|
4364
4418
|
else {
|
|
4365
|
-
if (!
|
|
4419
|
+
if (!Ko(t)) return sr("kw_select() BAD kw parameter"), null;
|
|
4366
4420
|
r(t, n) && o.push(t);
|
|
4367
4421
|
}
|
|
4368
4422
|
return o;
|
|
4369
|
-
}, exports.kw_delete =
|
|
4370
|
-
if (!n || !
|
|
4423
|
+
}, exports.kw_delete = us, exports.kw_find_json_in_list = function(e, t, n, r) {
|
|
4424
|
+
if (!n || !Bo(t)) return r && sr("item NULL or kw_list is not a list"), -1;
|
|
4371
4425
|
for (let e = 0; e < t.length; e++) if (Ao(n, t[e])) return e;
|
|
4372
4426
|
return r && sr("item not found in this list"), -1;
|
|
4373
|
-
}, exports.kw_find_path =
|
|
4374
|
-
e && !
|
|
4375
|
-
let s =
|
|
4427
|
+
}, 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) {
|
|
4428
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
4429
|
+
let s = as(e, t, n, !1);
|
|
4376
4430
|
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 =
|
|
4431
|
+
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);
|
|
4432
|
+
}, exports.kw_get_local_storage_value = Ss, exports.kw_get_pointer = gs, exports.kw_get_real = function(e, t, n, r, o) {
|
|
4433
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
4434
|
+
let s = as(e, t, n, !1);
|
|
4381
4435
|
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
4436
|
if (void 0 === s) {
|
|
4383
4437
|
if (i && t) {
|
|
4384
4438
|
let o = Number(r);
|
|
4385
|
-
return
|
|
4439
|
+
return bs(e, t, n, o), o;
|
|
4386
4440
|
}
|
|
4387
4441
|
return l && (sr(`path not found: '${n}'`), No(t)), Number(r);
|
|
4388
4442
|
}
|
|
4389
4443
|
let _;
|
|
4390
|
-
if (
|
|
4444
|
+
if (Jo(s)) _ = s;
|
|
4391
4445
|
else {
|
|
4392
4446
|
if (!u) return sr(`${e ? xt(e) + ": " : ""}path MUST BE a json real: '${n}'`), No(t), Number(r);
|
|
4393
|
-
if (
|
|
4394
|
-
else if (
|
|
4447
|
+
if (qo(s)) _ = s ? 1 : 0;
|
|
4448
|
+
else if (Yo(s)) _ = parseFloat(s), Number.isNaN(_) && (_ = 0);
|
|
4395
4449
|
else {
|
|
4396
4450
|
if (null !== s) return sr(`${e ? xt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), No(t), 0;
|
|
4397
4451
|
_ = 0;
|
|
4398
4452
|
}
|
|
4399
4453
|
}
|
|
4400
|
-
return a &&
|
|
4401
|
-
}, exports.kw_get_str =
|
|
4402
|
-
if (e && !
|
|
4403
|
-
r || (r =
|
|
4454
|
+
return a && us(e, t, n), _;
|
|
4455
|
+
}, 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) {
|
|
4456
|
+
if (e && !Qo(e) && sr("GObj bad instanceof"), !t) return null;
|
|
4457
|
+
r || (r = ys);
|
|
4404
4458
|
let o = [];
|
|
4405
|
-
if (
|
|
4459
|
+
if (Bo(t)) for (let e = 0; e < t.length; e++) {
|
|
4406
4460
|
let s = t[e];
|
|
4407
4461
|
r(s, n) && o.push($o(s));
|
|
4408
4462
|
}
|
|
4409
4463
|
else {
|
|
4410
|
-
if (!
|
|
4464
|
+
if (!Ko(t)) return sr("kw_select() BAD kw parameter"), null;
|
|
4411
4465
|
r(t, n) && o.push($o(t));
|
|
4412
4466
|
}
|
|
4413
4467
|
return o;
|
|
4414
|
-
}, exports.kw_set_dict_value =
|
|
4415
|
-
e && !
|
|
4416
|
-
let s =
|
|
4468
|
+
}, exports.kw_set_dict_value = bs, exports.kw_set_local_storage_value = ws, exports.kw_set_subdict_value = ms, exports.kwid_collect = As, exports.kwid_find_one_record = function(e, t, n, r, o) {
|
|
4469
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
4470
|
+
let s = As(e, t, n, r, o);
|
|
4417
4471
|
return s && 0 !== s.length ? s[0] : null;
|
|
4418
4472
|
}, exports.kwid_get_ids = function(e, t) {
|
|
4419
|
-
if (e && !
|
|
4473
|
+
if (e && !Qo(e) && sr("GObj bad instanceof"), !t) return [];
|
|
4420
4474
|
let n = [];
|
|
4421
|
-
if (
|
|
4422
|
-
else if (
|
|
4423
|
-
else
|
|
4424
|
-
if (
|
|
4425
|
-
else if (
|
|
4426
|
-
let r =
|
|
4475
|
+
if (Yo(t)) n.push(t);
|
|
4476
|
+
else if (Ko(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
4477
|
+
else Bo(t) && t.forEach(function(t) {
|
|
4478
|
+
if (Yo(t)) Xo(t) || n.push(t);
|
|
4479
|
+
else if (Ko(t)) {
|
|
4480
|
+
let r = fs(e, t, "id", 0, 0);
|
|
4427
4481
|
r && n.push(r);
|
|
4428
4482
|
}
|
|
4429
4483
|
});
|
|
4430
4484
|
return n;
|
|
4431
|
-
}, exports.kwid_match_id =
|
|
4432
|
-
e && !
|
|
4485
|
+
}, exports.kwid_match_id = $s, exports.kwid_new_dict = function(e, t, n) {
|
|
4486
|
+
e && !Qo(e) && sr("GObj bad instanceof");
|
|
4433
4487
|
let r = {};
|
|
4434
|
-
if (
|
|
4435
|
-
else if (
|
|
4436
|
-
let o = t[n], s =
|
|
4437
|
-
|
|
4488
|
+
if (Xo(n) || (t = as(e, t, n)), Ko(t)) r = t;
|
|
4489
|
+
else if (Bo(t)) for (let n = 0; n < t.length; n++) {
|
|
4490
|
+
let o = t[n], s = fs(e, o, "id", "", Pn.KW_REQUIRED);
|
|
4491
|
+
Xo(s) || ls(r, s, o);
|
|
4438
4492
|
}
|
|
4439
4493
|
else sr(`${xt(e)} kwid_new_dict: data type unknown`);
|
|
4440
4494
|
return r;
|
|
4441
4495
|
}, exports.kwid_new_list = function(e, t, n) {
|
|
4442
|
-
if (e && !
|
|
4443
|
-
if (
|
|
4496
|
+
if (e && !Qo(e) && sr("GObj bad instanceof"), Xo(n) || (t = as(e, t, n)), Bo(t)) return t;
|
|
4497
|
+
if (Ko(t)) {
|
|
4444
4498
|
let n = [];
|
|
4445
4499
|
for (let r of Object.keys(t)) {
|
|
4446
4500
|
let o = t[r];
|
|
4447
|
-
|
|
4501
|
+
Ko(o) ? (o.id = r, n.push(o)) : sr(`${xt(e)} kwid_new_list: not a record: '${r}'`);
|
|
4448
4502
|
}
|
|
4449
4503
|
return n;
|
|
4450
4504
|
}
|
|
@@ -4452,16 +4506,16 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4452
4506
|
}, exports.list2options = function(e, t, n) {
|
|
4453
4507
|
t = t || "id", n = n || "value";
|
|
4454
4508
|
let r = [];
|
|
4455
|
-
if (
|
|
4509
|
+
if (Bo(e)) for (let o = 0; o < e.length; o++) {
|
|
4456
4510
|
let s = e[o];
|
|
4457
|
-
if (
|
|
4511
|
+
if (Yo(s)) r.push({
|
|
4458
4512
|
id: e[o],
|
|
4459
4513
|
value: e[o]
|
|
4460
4514
|
});
|
|
4461
|
-
else if (
|
|
4515
|
+
else if (Ko(s)) {
|
|
4462
4516
|
let e = {};
|
|
4463
|
-
if (
|
|
4464
|
-
if (!
|
|
4517
|
+
if (os(s, t)) {
|
|
4518
|
+
if (!os(s, n)) {
|
|
4465
4519
|
if (!(Vo(s) > 0)) {
|
|
4466
4520
|
sr("list2options(): object without field value: " + n);
|
|
4467
4521
|
continue;
|
|
@@ -4479,7 +4533,7 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4479
4533
|
r.push(e);
|
|
4480
4534
|
} else sr("list2options(): case1 not implemented");
|
|
4481
4535
|
}
|
|
4482
|
-
else if (
|
|
4536
|
+
else if (Ko(e)) for (let t of Object.keys(e)) r.push({
|
|
4483
4537
|
id: t,
|
|
4484
4538
|
value: t
|
|
4485
4539
|
});
|
|
@@ -4497,12 +4551,12 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4497
4551
|
var e;
|
|
4498
4552
|
}, r.send();
|
|
4499
4553
|
}, 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 =
|
|
4554
|
+
let n = tr(e, ...t), r = qs();
|
|
4555
|
+
Mn && Jn("info", n) && nr(Mn, "%c" + r + " INFO: " + String(n), "color:cyan"), Hn("info", n, r);
|
|
4556
|
+
}, 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 = Xs, exports.parseBoolean = Zo, exports.parseSVG = function(e) {
|
|
4503
4557
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
4504
4558
|
}, exports.refresh_language = function(e, t) {
|
|
4505
|
-
if (!
|
|
4559
|
+
if (!zo(t)) return void sr("You must supply a translation function");
|
|
4506
4560
|
e || (e = document);
|
|
4507
4561
|
const n = (t) => {
|
|
4508
4562
|
let n = [];
|
|
@@ -4526,22 +4580,22 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4526
4580
|
});
|
|
4527
4581
|
}, exports.register_c_ievent_cli = function() {
|
|
4528
4582
|
return function(e) {
|
|
4529
|
-
if (
|
|
4583
|
+
if (Il) return sr(`GClass ALREADY created: ${e}`), -1;
|
|
4530
4584
|
const t = [
|
|
4531
4585
|
["ST_DISCONNECTED", [
|
|
4532
4586
|
[
|
|
4533
4587
|
"EV_ON_OPEN",
|
|
4534
|
-
|
|
4588
|
+
ql,
|
|
4535
4589
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
4536
4590
|
],
|
|
4537
4591
|
[
|
|
4538
4592
|
"EV_ON_CLOSE",
|
|
4539
|
-
|
|
4593
|
+
Hl,
|
|
4540
4594
|
null
|
|
4541
4595
|
],
|
|
4542
4596
|
[
|
|
4543
4597
|
"EV_TIMEOUT",
|
|
4544
|
-
|
|
4598
|
+
Jl,
|
|
4545
4599
|
null
|
|
4546
4600
|
],
|
|
4547
4601
|
[
|
|
@@ -4553,22 +4607,22 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4553
4607
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
4554
4608
|
[
|
|
4555
4609
|
"EV_ON_MESSAGE",
|
|
4556
|
-
|
|
4610
|
+
ti,
|
|
4557
4611
|
null
|
|
4558
4612
|
],
|
|
4559
4613
|
[
|
|
4560
4614
|
"EV_IDENTITY_CARD_ACK",
|
|
4561
|
-
|
|
4615
|
+
ei,
|
|
4562
4616
|
null
|
|
4563
4617
|
],
|
|
4564
4618
|
[
|
|
4565
4619
|
"EV_ON_CLOSE",
|
|
4566
|
-
|
|
4620
|
+
Hl,
|
|
4567
4621
|
"ST_DISCONNECTED"
|
|
4568
4622
|
],
|
|
4569
4623
|
[
|
|
4570
4624
|
"EV_TIMEOUT",
|
|
4571
|
-
|
|
4625
|
+
Zl,
|
|
4572
4626
|
null
|
|
4573
4627
|
],
|
|
4574
4628
|
[
|
|
@@ -4580,22 +4634,22 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4580
4634
|
["ST_SESSION", [
|
|
4581
4635
|
[
|
|
4582
4636
|
"EV_ON_MESSAGE",
|
|
4583
|
-
|
|
4637
|
+
ti,
|
|
4584
4638
|
null
|
|
4585
4639
|
],
|
|
4586
4640
|
[
|
|
4587
4641
|
"EV_MT_STATS",
|
|
4588
|
-
|
|
4642
|
+
ri,
|
|
4589
4643
|
null
|
|
4590
4644
|
],
|
|
4591
4645
|
[
|
|
4592
4646
|
"EV_MT_COMMAND",
|
|
4593
|
-
|
|
4647
|
+
oi,
|
|
4594
4648
|
null
|
|
4595
4649
|
],
|
|
4596
4650
|
[
|
|
4597
4651
|
"EV_ON_CLOSE",
|
|
4598
|
-
|
|
4652
|
+
Hl,
|
|
4599
4653
|
"ST_DISCONNECTED"
|
|
4600
4654
|
],
|
|
4601
4655
|
[
|
|
@@ -4606,7 +4660,7 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4606
4660
|
]],
|
|
4607
4661
|
[null, null]
|
|
4608
4662
|
];
|
|
4609
|
-
return (
|
|
4663
|
+
return (Il = We(e, [
|
|
4610
4664
|
["EV_ON_MESSAGE", L.EVF_OUTPUT_EVENT],
|
|
4611
4665
|
["EV_IDENTITY_CARD_ACK", L.EVF_PUBLIC_EVENT],
|
|
4612
4666
|
["EV_ON_ID_NAK", L.EVF_OUTPUT_EVENT],
|
|
@@ -4617,36 +4671,36 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4617
4671
|
["EV_ON_OPEN_ERROR", L.EVF_OUTPUT_EVENT | L.EVF_NO_WARN_SUBS],
|
|
4618
4672
|
["EV_TIMEOUT", 0],
|
|
4619
4673
|
[null, 0]
|
|
4620
|
-
], t,
|
|
4674
|
+
], t, si, 0, xl, Cl, 0, 0, Dl, C.gcflag_no_check_output_events)) ? 0 : -1;
|
|
4621
4675
|
}("C_IEVENT_CLI");
|
|
4622
4676
|
}, exports.register_c_timer = function() {
|
|
4623
4677
|
return function(e) {
|
|
4624
|
-
if (
|
|
4678
|
+
if (gl) return sr(`GClass ALREADY created: ${e}`), -1;
|
|
4625
4679
|
const t = [["ST_IDLE", [[
|
|
4626
4680
|
"EV_TIMEOUT",
|
|
4627
|
-
|
|
4681
|
+
dl,
|
|
4628
4682
|
null
|
|
4629
4683
|
]]]];
|
|
4630
|
-
return (
|
|
4684
|
+
return (gl = We(e, [
|
|
4631
4685
|
["EV_TIMEOUT", L.EVF_OUTPUT_EVENT],
|
|
4632
4686
|
["EV_TIMEOUT_PERIODIC", L.EVF_OUTPUT_EVENT],
|
|
4633
4687
|
[0, 0]
|
|
4634
|
-
], t,
|
|
4688
|
+
], t, pl, 0, cl, fl, 0, 0, 0, C.gcflag_manual_start)) ? 0 : -1;
|
|
4635
4689
|
}("C_TIMER");
|
|
4636
4690
|
}, exports.register_c_yuno = function() {
|
|
4637
4691
|
return function(e) {
|
|
4638
|
-
if (
|
|
4692
|
+
if (Tl) return sr(`GClass ALREADY created: ${e}`), -1;
|
|
4639
4693
|
const t = [["ST_IDLE", [[
|
|
4640
4694
|
"EV_TIMEOUT_PERIODIC",
|
|
4641
|
-
|
|
4695
|
+
$l,
|
|
4642
4696
|
null
|
|
4643
4697
|
]]]];
|
|
4644
|
-
return (
|
|
4698
|
+
return (Tl = We(e, [["EV_TIMEOUT_PERIODIC", L.EVF_OUTPUT_EVENT | L.EVF_NO_WARN_SUBS], [0, 0]], t, Al, 0, vl, El, 0, 0, 0, 0)) ? 0 : -1;
|
|
4645
4699
|
}("C_YUNO");
|
|
4646
4700
|
}, exports.safeSrc = function(e) {
|
|
4647
4701
|
if (!e) return "";
|
|
4648
4702
|
const t = String(e).trim();
|
|
4649
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
4703
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Gs(t);
|
|
4650
4704
|
}, exports.sdata_flag_t = $, exports.send_http_json_post = function(e, t, n) {
|
|
4651
4705
|
let r = new XMLHttpRequest();
|
|
4652
4706
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -4670,16 +4724,16 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4670
4724
|
}
|
|
4671
4725
|
} else Vn = e;
|
|
4672
4726
|
}, exports.set_remote_log_functions = Qn, exports.set_strings_are_text = function(e) {
|
|
4673
|
-
|
|
4674
|
-
}, exports.set_timeout =
|
|
4675
|
-
return
|
|
4727
|
+
Bs = !!e;
|
|
4728
|
+
}, exports.set_timeout = ml, exports.set_timeout_periodic = hl, 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() {
|
|
4729
|
+
return Bs;
|
|
4676
4730
|
}, exports.strncmp = function(e, t, n) {
|
|
4677
4731
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
4678
4732
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
4679
4733
|
}, exports.strs_in_list = function(e, t, n) {
|
|
4680
4734
|
if (!e) return sr("ERROR: strs_in_list() list empty"), !1;
|
|
4681
4735
|
if (!t) return sr("ERROR: strs_in_list() str empty"), !1;
|
|
4682
|
-
for (let r = 0; r < t.length; r++) if (
|
|
4736
|
+
for (let r = 0; r < t.length; r++) if (xs(e, t[r], n)) return !0;
|
|
4683
4737
|
return !1;
|
|
4684
4738
|
}, exports.strstr = function(e, t, n) {
|
|
4685
4739
|
var r;
|
|
@@ -4698,13 +4752,13 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4698
4752
|
placeholder: void 0,
|
|
4699
4753
|
fkey: null
|
|
4700
4754
|
};
|
|
4701
|
-
if (
|
|
4755
|
+
if (Yo(t)) {
|
|
4702
4756
|
let e = t.split(".");
|
|
4703
4757
|
for (let t = 0; t < e.length; t++) {
|
|
4704
4758
|
let r = e[t];
|
|
4705
|
-
if (
|
|
4706
|
-
else if (
|
|
4707
|
-
else if (
|
|
4759
|
+
if (xs(il, r)) n.real_type || (n.real_type = r);
|
|
4760
|
+
else if (xs(ul, r)) n.type || (n.type = r);
|
|
4761
|
+
else if (xs(al, r)) switch (r) {
|
|
4708
4762
|
case "writable":
|
|
4709
4763
|
n.is_writable = !0;
|
|
4710
4764
|
break;
|
|
@@ -4716,7 +4770,7 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4716
4770
|
}
|
|
4717
4771
|
}
|
|
4718
4772
|
n.real_type || (n.real_type = "string");
|
|
4719
|
-
} else
|
|
4773
|
+
} else Ko(t) ? (n = _l(t), n.name || (n.name = e), n.header || (n.header = e)) : Bo(t) && (n.real_type = "array", n.enum_list = t);
|
|
4720
4774
|
return n.type || (n.type = n.real_type), n;
|
|
4721
4775
|
}, exports.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
4722
4776
|
const n = e, r = performance.now();
|
|
@@ -4728,8 +4782,8 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4728
4782
|
total: a
|
|
4729
4783
|
};
|
|
4730
4784
|
} };
|
|
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 (
|
|
4785
|
+
}, exports.trace_json = ur, exports.trace_json_masked = No, exports.trace_level_t = K, exports.trace_msg = ar, exports.treedb_decoder_fkey = ll, exports.treedb_decoder_hook = function(e, t) {
|
|
4786
|
+
if (Yo(t)) {
|
|
4733
4787
|
if (-1 === t.indexOf("^")) {
|
|
4734
4788
|
let n, r = e.hook;
|
|
4735
4789
|
if (1 !== Mo(r)) return sr("bad hook 1"), sr(e), sr(t), null;
|
|
@@ -4750,17 +4804,17 @@ exports.GObj = k, exports.SDATA = x, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
4750
4804
|
};
|
|
4751
4805
|
}
|
|
4752
4806
|
}
|
|
4753
|
-
return
|
|
4807
|
+
return Ko(t) ? {
|
|
4754
4808
|
topic_name: t.topic_name,
|
|
4755
4809
|
id: t.id
|
|
4756
4810
|
} : (sr("bad hook 3"), sr(e), sr(t), null);
|
|
4757
4811
|
}, exports.treedb_encoder_fkey = function(e, t) {
|
|
4758
|
-
let n =
|
|
4812
|
+
let n = ll(e, t);
|
|
4759
4813
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
4760
|
-
}, exports.treedb_get_field_desc =
|
|
4761
|
-
if (
|
|
4814
|
+
}, exports.treedb_get_field_desc = _l, exports.treedb_hook_data_size = function(e) {
|
|
4815
|
+
if (Bo(e) && 1 === Vo(e)) {
|
|
4762
4816
|
let t = e[0];
|
|
4763
|
-
return
|
|
4817
|
+
return os(t, "size") ? t.size : 1;
|
|
4764
4818
|
}
|
|
4765
4819
|
return Vo(e);
|
|
4766
4820
|
}, exports.vsprintf = function(e, n) {
|