@yuneta/gobj-js 7.16.6 → 7.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-js.cjs.js +63 -10
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +310 -299
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +63 -11
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +280 -268
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +63 -10
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +98 -87
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +63 -10
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +218 -207
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.cjs.min.js
CHANGED
|
@@ -18,16 +18,16 @@ var e = {
|
|
|
18
18
|
};
|
|
19
19
|
function t(r) {
|
|
20
20
|
return function(n, r) {
|
|
21
|
-
var o, s,
|
|
21
|
+
var o, s, i, l, _, a, u, c, f, g = 1, p = n.length, d = "";
|
|
22
22
|
for (s = 0; s < p; s++) if ("string" == typeof n[s]) d += n[s];
|
|
23
23
|
else if ("object" == typeof n[s]) {
|
|
24
|
-
if ((
|
|
25
|
-
if (null == o) throw new Error(t("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"",
|
|
26
|
-
o = o[
|
|
24
|
+
if ((l = n[s]).keys) for (o = r[g], i = 0; i < l.keys.length; i++) {
|
|
25
|
+
if (null == o) throw new Error(t("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"", l.keys[i], l.keys[i - 1]));
|
|
26
|
+
o = o[l.keys[i]];
|
|
27
27
|
}
|
|
28
|
-
else o =
|
|
29
|
-
if (e.not_type.test(
|
|
30
|
-
switch (e.number.test(
|
|
28
|
+
else o = l.param_no ? r[l.param_no] : r[g++];
|
|
29
|
+
if (e.not_type.test(l.type) && e.not_primitive.test(l.type) && o instanceof Function && (o = o()), e.numeric_arg.test(l.type) && "number" != typeof o && isNaN(o)) throw new TypeError(t("[sprintf] expecting number but found %T", o));
|
|
30
|
+
switch (e.number.test(l.type) && (c = o >= 0), l.type) {
|
|
31
31
|
case "b":
|
|
32
32
|
o = parseInt(o, 10).toString(2);
|
|
33
33
|
break;
|
|
@@ -39,63 +39,63 @@ function t(r) {
|
|
|
39
39
|
o = parseInt(o, 10);
|
|
40
40
|
break;
|
|
41
41
|
case "j":
|
|
42
|
-
o = JSON.stringify(o, null,
|
|
42
|
+
o = JSON.stringify(o, null, l.width ? parseInt(l.width) : 0);
|
|
43
43
|
break;
|
|
44
44
|
case "e":
|
|
45
|
-
o =
|
|
45
|
+
o = l.precision ? parseFloat(o).toExponential(l.precision) : parseFloat(o).toExponential();
|
|
46
46
|
break;
|
|
47
47
|
case "f":
|
|
48
|
-
o =
|
|
48
|
+
o = l.precision ? parseFloat(o).toFixed(l.precision) : parseFloat(o);
|
|
49
49
|
break;
|
|
50
50
|
case "g":
|
|
51
|
-
o =
|
|
51
|
+
o = l.precision ? String(Number(o.toPrecision(l.precision))) : parseFloat(o);
|
|
52
52
|
break;
|
|
53
53
|
case "o":
|
|
54
54
|
o = (parseInt(o, 10) >>> 0).toString(8);
|
|
55
55
|
break;
|
|
56
56
|
case "s":
|
|
57
|
-
o = String(o), o =
|
|
57
|
+
o = String(o), o = l.precision ? o.substring(0, l.precision) : o;
|
|
58
58
|
break;
|
|
59
59
|
case "t":
|
|
60
|
-
o = String(!!o), o =
|
|
60
|
+
o = String(!!o), o = l.precision ? o.substring(0, l.precision) : o;
|
|
61
61
|
break;
|
|
62
62
|
case "T":
|
|
63
|
-
o = Object.prototype.toString.call(o).slice(8, -1).toLowerCase(), o =
|
|
63
|
+
o = Object.prototype.toString.call(o).slice(8, -1).toLowerCase(), o = l.precision ? o.substring(0, l.precision) : o;
|
|
64
64
|
break;
|
|
65
65
|
case "u":
|
|
66
66
|
o = parseInt(o, 10) >>> 0;
|
|
67
67
|
break;
|
|
68
68
|
case "v":
|
|
69
|
-
o = o.valueOf(), o =
|
|
69
|
+
o = o.valueOf(), o = l.precision ? o.substring(0, l.precision) : o;
|
|
70
70
|
break;
|
|
71
71
|
case "x":
|
|
72
72
|
o = (parseInt(o, 10) >>> 0).toString(16);
|
|
73
73
|
break;
|
|
74
74
|
case "X": o = (parseInt(o, 10) >>> 0).toString(16).toUpperCase();
|
|
75
75
|
}
|
|
76
|
-
e.json.test(
|
|
76
|
+
e.json.test(l.type) ? d += o : (!e.number.test(l.type) || c && !l.sign ? f = "" : (f = c ? "+" : "-", o = o.toString().replace(e.sign, "")), a = l.pad_char ? "0" === l.pad_char ? "0" : l.pad_char.charAt(1) : " ", u = l.width - (f + o).length, _ = l.width && u > 0 ? a.repeat(u) : "", d += l.align ? f + o + _ : "0" === a ? f + _ + o : _ + f + o);
|
|
77
77
|
}
|
|
78
78
|
return d;
|
|
79
79
|
}(function(t) {
|
|
80
80
|
if (n[t]) return n[t];
|
|
81
|
-
let r, o = t, s = [],
|
|
81
|
+
let r, o = t, s = [], i = 0;
|
|
82
82
|
for (; o;) {
|
|
83
83
|
if (null !== (r = e.text.exec(o))) s.push(r[0]);
|
|
84
84
|
else if (null !== (r = e.modulo.exec(o))) s.push("%");
|
|
85
85
|
else {
|
|
86
86
|
if (null === (r = e.placeholder.exec(o))) throw new SyntaxError("[sprintf] unexpected placeholder");
|
|
87
87
|
if (r[2]) {
|
|
88
|
-
|
|
89
|
-
var
|
|
88
|
+
i |= 1;
|
|
89
|
+
var l = [], _ = r[2], a = [];
|
|
90
90
|
if (null === (a = e.key.exec(_))) throw new SyntaxError("[sprintf] failed to parse named argument key");
|
|
91
|
-
for (
|
|
91
|
+
for (l.push(a[1]); "" !== (_ = _.substring(a[0].length));) if (null !== (a = e.key_access.exec(_))) l.push(a[1]);
|
|
92
92
|
else {
|
|
93
93
|
if (null === (a = e.index_access.exec(_))) throw new SyntaxError("[sprintf] failed to parse named argument key");
|
|
94
|
-
|
|
94
|
+
l.push(a[1]);
|
|
95
95
|
}
|
|
96
|
-
r[2] =
|
|
97
|
-
} else
|
|
98
|
-
if (3 ===
|
|
96
|
+
r[2] = l;
|
|
97
|
+
} else i |= 2;
|
|
98
|
+
if (3 === i) throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");
|
|
99
99
|
s.push({
|
|
100
100
|
placeholder: r[0],
|
|
101
101
|
param_no: r[1],
|
|
@@ -130,7 +130,7 @@ function o(e, t, n, r, o) {
|
|
|
130
130
|
data: o || []
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
var s = "7.0.0a",
|
|
133
|
+
var s = "7.0.0a", i = null, l = null, _ = null, a = null, u = null, c = null, f = [], g = Object.create(null), p = {}, d = null, b = null, m = 0, E = Object.freeze({
|
|
134
134
|
DTP_STRING: 1,
|
|
135
135
|
DTP_BOOLEAN: 2,
|
|
136
136
|
DTP_INTEGER: 3,
|
|
@@ -166,18 +166,18 @@ var T = Object.freeze({
|
|
|
166
166
|
});
|
|
167
167
|
T.SDF_RD, T.SDF_WR, T.SDF_STATS, T.SDF_PERSIST, T.SDF_VOLATIL, T.SDF_RSTATS, T.SDF_PSTATS, T.SDF_WR, T.SDF_PERSIST;
|
|
168
168
|
var h = class {
|
|
169
|
-
constructor(e, t, n = 0, r = null, o = "", s = null,
|
|
170
|
-
this.type = e, this.name = t, this.alias = s, this.flag = n, this.default_value = r, this.header =
|
|
169
|
+
constructor(e, t, n = 0, r = null, o = "", s = null, i = null, l = 0, _ = null, a = null, u = null) {
|
|
170
|
+
this.type = e, this.name = t, this.alias = s, this.flag = n, this.default_value = r, this.header = i, this.fillspace = l, this.description = o, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
171
171
|
}
|
|
172
172
|
}, y = () => new h(0, null), j = (e, t, n, r, o) => new h(e, t, n, r, o), v = class {
|
|
173
|
-
constructor(e, t, n, r, o, s,
|
|
174
|
-
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = o, this.authz_table = s, this.command_table =
|
|
173
|
+
constructor(e, t, n, r, o, s, i, l, _) {
|
|
174
|
+
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = o, this.authz_table = s, this.command_table = i, this.s_user_trace_level = l, this.gclass_flag = Number(_) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
175
175
|
}
|
|
176
|
-
},
|
|
176
|
+
}, O = class {
|
|
177
177
|
constructor(e, t, n, r, o) {
|
|
178
178
|
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(o) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = Zt(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
179
179
|
}
|
|
180
|
-
},
|
|
180
|
+
}, S = Object.freeze({
|
|
181
181
|
gcflag_manual_start: 1,
|
|
182
182
|
gcflag_no_check_output_events: 2,
|
|
183
183
|
gcflag_ignore_unknown_attrs: 4,
|
|
@@ -379,7 +379,7 @@ function q(e, t, n) {
|
|
|
379
379
|
r = String(o);
|
|
380
380
|
break;
|
|
381
381
|
case E.DTP_BOOLEAN:
|
|
382
|
-
r =
|
|
382
|
+
r = On(o);
|
|
383
383
|
break;
|
|
384
384
|
case E.DTP_INTEGER:
|
|
385
385
|
r = parseInt(o), isNaN(r) && Ht(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
@@ -429,7 +429,7 @@ function z(e, t, n, r) {
|
|
|
429
429
|
}
|
|
430
430
|
break;
|
|
431
431
|
case E.DTP_BOOLEAN:
|
|
432
|
-
o =
|
|
432
|
+
o = On(r);
|
|
433
433
|
break;
|
|
434
434
|
case E.DTP_INTEGER:
|
|
435
435
|
o = parseInt(r), isNaN(o) && Ht(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
@@ -483,11 +483,11 @@ function Z(e, t, n) {
|
|
|
483
483
|
}
|
|
484
484
|
return n && Ht(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
485
485
|
}
|
|
486
|
-
function ee(e, t, n, r, o, s,
|
|
486
|
+
function ee(e, t, n, r, o, s, i, l, _, a, u) {
|
|
487
487
|
if (vn(e)) return Ht("gclass_name EMPTY"), null;
|
|
488
488
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return Ht(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
489
489
|
if (ue(e)) return Ht(`GClass ALREADY exists: ${e}`), null;
|
|
490
|
-
let c = new v(e, r, o, s,
|
|
490
|
+
let c = new v(e, r, o, s, i, l, _, a, u);
|
|
491
491
|
(function(e, t) {
|
|
492
492
|
e && e instanceof v ? t ? g[t] ? Ht(`gclass ALREADY REGISTERED: ${t}`) : g[t] = e : Ht("gclass_name undefined") : Ht("gclass undefined");
|
|
493
493
|
})(c, e);
|
|
@@ -506,7 +506,7 @@ function ee(e, t, n, r, o, s, l, i, _, a, u) {
|
|
|
506
506
|
let n = t[e][0], r = t[e][1];
|
|
507
507
|
if (!vn(n)) {
|
|
508
508
|
if (_e(c, n)) return Ht(`SMachine: event repeated in input_events: ${n}`), te(c), null;
|
|
509
|
-
|
|
509
|
+
le(c, n, r);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
if (!c.fsm_checked) {
|
|
@@ -550,11 +550,11 @@ function se(e, t, n, r, o) {
|
|
|
550
550
|
let s = ne(e, t);
|
|
551
551
|
return s ? re(s, n) ? (Ht(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (s.dl_actions.push(new D(n, r, o)), 0) : (Ht(`state not found: ${t}`), -1);
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function ie(e, t, n) {
|
|
554
554
|
vn(t) || e.push(new k(t, n));
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
return e instanceof v ?
|
|
556
|
+
function le(e, t, n) {
|
|
557
|
+
return e instanceof v ? ie(e.dl_events, t, n) : (Ht("Cannot add state, typeof not GClass"), -1);
|
|
558
558
|
}
|
|
559
559
|
function _e(e, t) {
|
|
560
560
|
if (!(e instanceof v)) return Ht("Cannot add state, typeof not GClass"), 0;
|
|
@@ -622,12 +622,12 @@ function me(e, t, n) {
|
|
|
622
622
|
(function(e, t, n, r, o) {
|
|
623
623
|
if (!e || !t) return Ht("hsdata or kw NULL"), -1;
|
|
624
624
|
let s = 0;
|
|
625
|
-
for (const [
|
|
626
|
-
const t = Z(o.gclass,
|
|
627
|
-
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && qt(`${Fe(o)}: Deprecated attribute used in gobj creation: ${
|
|
625
|
+
for (const [i, l] of Object.entries(t)) {
|
|
626
|
+
const t = Z(o.gclass, i, !1);
|
|
627
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && qt(`${Fe(o)}: Deprecated attribute used in gobj creation: ${i}`), s += z(o, e, t, l)) : r && (r(o, i), s--);
|
|
628
628
|
}
|
|
629
629
|
return s;
|
|
630
|
-
})(Q(e), r, -1, e.gclass.gclass_flag &
|
|
630
|
+
})(Q(e), r, -1, e.gclass.gclass_flag & S.gcflag_ignore_unknown_attrs ? 0 : be, e) < 0 && (Ht(`${Fe(e)} json2data() FAILED`), Xt(r));
|
|
631
631
|
}
|
|
632
632
|
function Ee(e, n, r, o, s) {
|
|
633
633
|
if (s & N.gobj_flag_yuno) {
|
|
@@ -635,7 +635,7 @@ function Ee(e, n, r, o, s) {
|
|
|
635
635
|
s |= N.gobj_flag_service;
|
|
636
636
|
} else {
|
|
637
637
|
if (!o) return Ht("gobj NEEDS a parent!"), null;
|
|
638
|
-
if (!("string" == typeof o || o instanceof
|
|
638
|
+
if (!("string" == typeof o || o instanceof O)) return Ht(`BAD TYPE of parent: ${o}`), null;
|
|
639
639
|
if (mn(o) && !(o = fe(o))) return qt(`parent service not found: ${o}`), null;
|
|
640
640
|
}
|
|
641
641
|
if (s & N.gobj_flag_service && fe(e, !1)) return Ht(`service ALREADY registered: ${n}^${e}`), null;
|
|
@@ -644,25 +644,25 @@ function Ee(e, n, r, o, s) {
|
|
|
644
644
|
s |= N.gobj_flag_service;
|
|
645
645
|
}
|
|
646
646
|
if (vn(n)) return Ht("gclass_name must be a string"), null;
|
|
647
|
-
let
|
|
648
|
-
if (!
|
|
647
|
+
let l = ue(n, !1);
|
|
648
|
+
if (!l) return Ht(`GClass not registered: ${n}^${e}`), null;
|
|
649
649
|
if (!mn(e)) return Ht(`gobj_name must be a string: ${n}`), null;
|
|
650
650
|
if (!vn(e)) {
|
|
651
651
|
if (e.includes("`")) return Ht(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
652
652
|
if (e.includes("^")) return Ht(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
653
653
|
}
|
|
654
|
-
let _ = new
|
|
655
|
-
_.jn_attrs = H(_,
|
|
654
|
+
let _ = new O(e, l, r, o, s);
|
|
655
|
+
_.jn_attrs = H(_, l.attrs_table);
|
|
656
656
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
657
657
|
let a = K(_);
|
|
658
|
-
return a && $(t("💙💙⏩ creating: %s^%s",
|
|
658
|
+
return a && $(t("💙💙⏩ creating: %s^%s", l.gclass_name, e)), _.gobj_flag & N.gobj_flag_service && ge(_), _.gobj_flag & N.gobj_flag_yuno && (d = _), _.gobj_flag & N.gobj_flag_default_service && (b = _), _.gobj_flag & N.gobj_flag_yuno || pe(o, _), _.obflag |= w.obflag_created, _.gclass.instances++, me(_, r), _.gobj_flag & N.gobj_flag_service && i && i(_, null), _.gclass.gmt.mt_create2 ? _.gclass.gmt.mt_create2(_, r) : _.gclass.gmt.mt_create && _.gclass.gmt.mt_create(_), o && o.gclass.gmt.mt_child_added && (a && $(t("👦👦🔵 child_added(%s): %s", Ge(o), Fe(_))), o.gclass.gmt.mt_child_added(o, _)), a && $(t("💙💙⏪ created: %s", Ge(_))), _;
|
|
659
659
|
}
|
|
660
660
|
function Te(e, t, n, r) {
|
|
661
661
|
return Ee(e, t, n, r, N.gobj_flag_pure_child);
|
|
662
662
|
}
|
|
663
663
|
function he(e) {
|
|
664
664
|
if (Ke(e)) return void Ht("gobj NULL or DESTROYED");
|
|
665
|
-
e.__refs__ > 0 && Ht(`${Fe(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Ht(`Destroying a PLAYING gobj: ${Ge(e)}`), Re(e)), e.running && (Ht(`Destroying a RUNNING gobj: ${Ge(e)}`),
|
|
665
|
+
e.__refs__ > 0 && Ht(`${Fe(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Ht(`Destroying a PLAYING gobj: ${Ge(e)}`), Re(e)), e.running && (Ht(`Destroying a RUNNING gobj: ${Ge(e)}`), Oe(e)), e.obflag |= w.obflag_destroying, function(e) {
|
|
666
666
|
if (0 === Tt.length) return;
|
|
667
667
|
for (let t of Tt) t.src === e && (t.src = null);
|
|
668
668
|
Tt = Tt.filter((t) => t.dst !== e);
|
|
@@ -690,30 +690,30 @@ function ye(e) {
|
|
|
690
690
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
691
691
|
}
|
|
692
692
|
function je(e, t, n) {
|
|
693
|
-
return e.gclass.gclass_flag &
|
|
693
|
+
return e.gclass.gclass_flag & S.gcflag_manual_start || Ke(e) || xe(e) || De(e) || ye(e), 0;
|
|
694
694
|
}
|
|
695
695
|
function ve(e, t, n) {
|
|
696
|
-
return e.gclass.gclass_flag &
|
|
696
|
+
return e.gclass.gclass_flag & S.gcflag_manual_start || De(e) ? 1 : (xe(e) || ye(e), 0);
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Oe(e) {
|
|
699
699
|
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), -1;
|
|
700
700
|
if (!e.running) return Ht(`${Fe(e)}: GObj NOT RUNNING`), -1;
|
|
701
701
|
e.playing && (qt(`${Fe(e)}: GObj stopping without previous pause`), Re(e)), Y(e) && $(t("⏹ ⏹ stop: %s", Ge(e))), e.running = !1;
|
|
702
702
|
let n = 0;
|
|
703
703
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
return xe(e) &&
|
|
705
|
+
function Se(e, t, n) {
|
|
706
|
+
return xe(e) && Oe(e), 0;
|
|
707
707
|
}
|
|
708
708
|
function Ne(e) {
|
|
709
|
-
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : He(e, x.WALK_FIRST2LAST,
|
|
709
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : He(e, x.WALK_FIRST2LAST, Se, 0, 0);
|
|
710
710
|
}
|
|
711
711
|
function we(e) {
|
|
712
712
|
if (Ke(e)) return Ht(`gobj NULL or DESTROYED: ${Fe(e)}`), -1;
|
|
713
713
|
if (e.playing) return Ht(`${Fe(e)}: GObj ALREADY PLAYING`), -1;
|
|
714
714
|
if (e.disabled) return Ht(`${Fe(e)}: GObj DISABLED`), -1;
|
|
715
715
|
if (!xe(e)) {
|
|
716
|
-
if (e.gclass.gclass_flag &
|
|
716
|
+
if (e.gclass.gclass_flag & S.gcflag_required_start_to_play) return Ht(`${Fe(e)}: Cannot play, start not done`), -1;
|
|
717
717
|
qt(`${Fe(e)}: GObj playing without previous start`), ye(e);
|
|
718
718
|
}
|
|
719
719
|
Y(e) && $(t("⏯ ⏯ play: %s", Ge(e))), e.playing = !0;
|
|
@@ -797,37 +797,37 @@ function ze(e) {
|
|
|
797
797
|
return "number" == typeof e && isFinite(e) ? e : (null == e || Ht(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
798
798
|
}
|
|
799
799
|
function Qe(e, t, n, r, o) {
|
|
800
|
-
let s,
|
|
801
|
-
if (t & x.WALK_LAST2FIRST) for (let e =
|
|
802
|
-
s =
|
|
800
|
+
let s, i = [...e];
|
|
801
|
+
if (t & x.WALK_LAST2FIRST) for (let e = i.length; e > 0; e--) {
|
|
802
|
+
s = i[e - 1];
|
|
803
803
|
let t = ze(n(s, r, o));
|
|
804
804
|
if (t < 0) return t;
|
|
805
805
|
}
|
|
806
|
-
else for (let e = 0; e <
|
|
807
|
-
s =
|
|
806
|
+
else for (let e = 0; e < i.length; e++) {
|
|
807
|
+
s = i[e];
|
|
808
808
|
let t = ze(n(s, r, o));
|
|
809
809
|
if (t < 0) return t;
|
|
810
810
|
}
|
|
811
811
|
return 0;
|
|
812
812
|
}
|
|
813
813
|
function Xe(e, t, n, r, o) {
|
|
814
|
-
let s,
|
|
815
|
-
if (
|
|
814
|
+
let s, i = Qe(e, t, n, r, o);
|
|
815
|
+
if (i < 0) return i;
|
|
816
816
|
if (t & x.WALK_LAST2FIRST) {
|
|
817
|
-
for (let
|
|
818
|
-
} else for (let
|
|
819
|
-
return
|
|
817
|
+
for (let l = e.length; l > 0; l--) if (s = e[l - 1], i = Xe([...s.dl_children], t, n, r, o), i < 0) return i;
|
|
818
|
+
} else for (let l = 0; l < e.length; l++) if (s = e[l], i = Xe([...s.dl_children], t, n, r, o), i < 0) return i;
|
|
819
|
+
return i;
|
|
820
820
|
}
|
|
821
821
|
function Ze(e, t, n, r, o) {
|
|
822
822
|
if (t & x.WALK_BYLEVEL) return Xe(e, t, n, r, o);
|
|
823
|
-
let s,
|
|
824
|
-
if (t & x.WALK_BOTTOM2TOP) for (let
|
|
825
|
-
if (
|
|
826
|
-
if (s = ze(n(
|
|
823
|
+
let s, i;
|
|
824
|
+
if (t & x.WALK_BOTTOM2TOP) for (let l = e.length; l > 0; l--) {
|
|
825
|
+
if (i = e[l - 1], s = Ze([...i.dl_children], t, n, r, o), s < 0) return s;
|
|
826
|
+
if (s = ze(n(i, r, o)), s < 0) return s;
|
|
827
827
|
}
|
|
828
|
-
else for (let
|
|
829
|
-
if (
|
|
830
|
-
if (0 === s && (s = Ze([...
|
|
828
|
+
else for (let l = 0; l < e.length; l++) {
|
|
829
|
+
if (i = e[l], s = ze(n(i, r, o)), s < 0) return s;
|
|
830
|
+
if (0 === s && (s = Ze([...i.dl_children], t, n, r, o), s < 0)) return s;
|
|
831
831
|
}
|
|
832
832
|
return 0;
|
|
833
833
|
}
|
|
@@ -843,8 +843,8 @@ function et(e, t) {
|
|
|
843
843
|
if (o !== Pe(e).substring(0, t)) return !1;
|
|
844
844
|
}
|
|
845
845
|
if (s && s !== dt(e)) return !1;
|
|
846
|
-
let
|
|
847
|
-
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && rt(e, n) &&
|
|
846
|
+
let i = e.jn_attrs;
|
|
847
|
+
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && rt(e, n) && i[n] !== t[n]) return !1;
|
|
848
848
|
return !0;
|
|
849
849
|
}
|
|
850
850
|
function tt(e, t) {
|
|
@@ -897,7 +897,7 @@ function st(e, t, n) {
|
|
|
897
897
|
}
|
|
898
898
|
return r;
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function it(e, t) {
|
|
901
901
|
if (t) {
|
|
902
902
|
if (0 === Nn(t, "__disabled__")) return De(e);
|
|
903
903
|
if (0 === Nn(t, "__running__")) return xe(e);
|
|
@@ -907,7 +907,7 @@ function lt(e, t) {
|
|
|
907
907
|
let n = X(e, t, !1);
|
|
908
908
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function lt(e, t) {
|
|
911
911
|
t && Nn(t, "__trace_level__");
|
|
912
912
|
let n = X(e, t, !1);
|
|
913
913
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
@@ -923,15 +923,15 @@ function at(e, t) {
|
|
|
923
923
|
}
|
|
924
924
|
function ut(e, t, n, r) {
|
|
925
925
|
let o = Q(e), s = 0;
|
|
926
|
-
for (const [r,
|
|
926
|
+
for (const [r, i] of Object.entries(t)) {
|
|
927
927
|
let t = Je(e, r, !0);
|
|
928
|
-
t && (-1 === n || t.flag & n) && (s += z(e, o, t,
|
|
928
|
+
t && (-1 === n || t.flag & n) && (s += z(e, o, t, i));
|
|
929
929
|
}
|
|
930
930
|
return s;
|
|
931
931
|
}
|
|
932
932
|
function ct(e, t, n) {
|
|
933
933
|
let r = X(e, t, !1);
|
|
934
|
-
return r ? (r[t] =
|
|
934
|
+
return r ? (r[t] = On(n), dn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
935
935
|
}
|
|
936
936
|
function ft(e, t, n) {
|
|
937
937
|
let r = X(e, t, !1);
|
|
@@ -986,33 +986,33 @@ function yt() {
|
|
|
986
986
|
return Tt.length > 0 && !ht && (ht = !0, setTimeout(yt, 0)), t;
|
|
987
987
|
}
|
|
988
988
|
function jt(e, n, r, o) {
|
|
989
|
-
if (!(e && e instanceof
|
|
989
|
+
if (!(e && e instanceof O)) return Ht("gobj dst NULL"), -1;
|
|
990
990
|
if (e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return Ht("gobj dst DESTROYED"), -1;
|
|
991
991
|
let s = e.current_state;
|
|
992
992
|
if (!s) return Ht(`${Fe(e)}: current_state NULL`), -1;
|
|
993
|
-
let
|
|
993
|
+
let i = B(e, n) && !J(o, n);
|
|
994
994
|
m++;
|
|
995
|
-
let
|
|
996
|
-
if (!
|
|
997
|
-
if (
|
|
995
|
+
let l = re(s, n);
|
|
996
|
+
if (!l) return e.gclass.gmt.mt_inject_event ? (m--, i && ($(1 === I ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Fe(e), s.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Fe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Fe(o))), r && i > 1 && fn(r) && Xt(r)), e.gclass.gmt.mt_inject_event(e, n, r, o)) : (i && $(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ue(e), Pe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Ue(o), Pe(o))), Ht(`📛📛 Event NOT DEFINED in state 📛📛: ${Fe(e)}, ${s.state_name}, ${n}`), m--, -1);
|
|
997
|
+
if (i) {
|
|
998
998
|
if (1 === I) $(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Fe(e), s.state_name, o && !o.running ? "!!" : "", Fe(o)));
|
|
999
999
|
else {
|
|
1000
1000
|
let r = "";
|
|
1001
|
-
|
|
1001
|
+
l.action && (r = cr(l.action)), $(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ue(e), Pe(e), s.state_name, "", n || "", "", r, o && !o.running ? "!!" : "", Ue(o), Pe(o)));
|
|
1002
1002
|
}
|
|
1003
1003
|
r && (V(e) | W()) & C.TRACE_EV_KW && fn(r) && Xt(r);
|
|
1004
1004
|
}
|
|
1005
|
-
|
|
1005
|
+
l.next_state && pt(e, l.next_state);
|
|
1006
1006
|
let _ = -1;
|
|
1007
1007
|
try {
|
|
1008
|
-
|
|
1008
|
+
l.action && (_ = l.action(e, n, r, o));
|
|
1009
1009
|
} finally {}
|
|
1010
|
-
return !
|
|
1010
|
+
return !i || 1 === I || e.obflag & w.obflag_destroyed || $(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, n || "", En(_) ? _ : 0)), m--, _;
|
|
1011
1011
|
}
|
|
1012
1012
|
var vt = Object.freeze({
|
|
1013
1013
|
__hard_subscription__: 1,
|
|
1014
1014
|
__own_event__: 2
|
|
1015
|
-
}),
|
|
1015
|
+
}), Ot = [
|
|
1016
1016
|
j(E.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1017
1017
|
j(E.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1018
1018
|
j(E.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
@@ -1025,19 +1025,19 @@ var vt = Object.freeze({
|
|
|
1025
1025
|
j(E.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1026
1026
|
y()
|
|
1027
1027
|
];
|
|
1028
|
-
function
|
|
1029
|
-
let s = Ln(t, r, "__config__", null),
|
|
1028
|
+
function St(e, t, n, r, o) {
|
|
1029
|
+
let s = Ln(t, r, "__config__", null), i = Ln(t, r, "__global__", null), l = Ln(t, r, "__local__", null), _ = Pn(t, r, "__filter__", null), a = !0;
|
|
1030
1030
|
if (t && t !== Cn(null, e, "publisher", null) && (a = !1), o && o !== Cn(null, e, "subscriber", null) && (a = !1), n && n !== $n(null, e, "event", "") && (a = !1), pn(s) > 0) {
|
|
1031
1031
|
let t = Ln(null, e, "__config__", null);
|
|
1032
1032
|
pn(t) > 0 && en(t, s) || (a = !1);
|
|
1033
1033
|
}
|
|
1034
|
-
if (pn(
|
|
1034
|
+
if (pn(i) > 0) {
|
|
1035
1035
|
let t = Ln(null, e, "__global__", null);
|
|
1036
|
-
pn(t) > 0 && en(t,
|
|
1036
|
+
pn(t) > 0 && en(t, i) || (a = !1);
|
|
1037
1037
|
}
|
|
1038
|
-
if (pn(
|
|
1038
|
+
if (pn(l) > 0) {
|
|
1039
1039
|
let t = Ln(null, e, "__local__", null);
|
|
1040
|
-
pn(t) > 0 && en(t,
|
|
1040
|
+
pn(t) > 0 && en(t, l) || (a = !1);
|
|
1041
1041
|
}
|
|
1042
1042
|
if (pn(_) > 0) {
|
|
1043
1043
|
let t = Pn(null, e, "__filter__", null);
|
|
@@ -1047,22 +1047,22 @@ function Ot(e, t, n, r, o) {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
function Nt(e, t, n, r, o) {
|
|
1049
1049
|
let s = [];
|
|
1050
|
-
for (let
|
|
1051
|
-
let
|
|
1052
|
-
|
|
1050
|
+
for (let i = 0; i < e.length; i++) {
|
|
1051
|
+
let l = e[i];
|
|
1052
|
+
St(l, t, n, r, o) && an(s, l);
|
|
1053
1053
|
}
|
|
1054
1054
|
return s;
|
|
1055
1055
|
}
|
|
1056
1056
|
function wt(e, t, n, r, o) {
|
|
1057
|
-
for (let s = 0; s < e.length; s++) if (
|
|
1057
|
+
for (let s = 0; s < e.length; s++) if (St(e[s], t, n, r, o)) return s;
|
|
1058
1058
|
return -1;
|
|
1059
1059
|
}
|
|
1060
1060
|
function Rt(e, n, r, o) {
|
|
1061
|
-
let s = Cn(e, n, "publisher", null, $t.KW_REQUIRED),
|
|
1061
|
+
let s = Cn(e, n, "publisher", null, $t.KW_REQUIRED), i = Cn(e, n, "subscriber", null, $t.KW_REQUIRED), l = $n(e, n, "event", "", $t.KW_REQUIRED);
|
|
1062
1062
|
if (!!(In(e, n, "subs_flag", null, $t.KW_REQUIRED) & vt.__hard_subscription__) && !r) return -1;
|
|
1063
|
-
d &&
|
|
1064
|
-
let _ = wt(s.dl_subscriptions, s,
|
|
1065
|
-
return _ >= 0 ? cn(s.dl_subscriptions, _) : (Ht(`${Fe(e)}: subscription in publisher not found`), Xt(n)), _ = wt(
|
|
1063
|
+
d && it(d, "trace_subscriptions") && ($(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", l || "", Fe(s), Fe(i))), Xt(n)), s.obflag & w.obflag_destroyed || o || s.gclass.gmt.mt_subscription_deleted && s.gclass.gmt.mt_subscription_deleted(s, n);
|
|
1064
|
+
let _ = wt(s.dl_subscriptions, s, l, n, i);
|
|
1065
|
+
return _ >= 0 ? cn(s.dl_subscriptions, _) : (Ht(`${Fe(e)}: subscription in publisher not found`), Xt(n)), _ = wt(i.dl_subscribings, s, l, n, i), _ >= 0 ? cn(i.dl_subscribings, _) : (Ht(`${Fe(e)}: subscription in subscriber not found`), Xt(n)), 0;
|
|
1066
1066
|
}
|
|
1067
1067
|
function xt(e, n, r, o) {
|
|
1068
1068
|
if (null == r && (r = {}), !e) return Ht(`publisher NULL: ev ${n}`), 0;
|
|
@@ -1077,15 +1077,15 @@ function xt(e, n, r, o) {
|
|
|
1077
1077
|
if (Object.keys(r).forEach((t) => {
|
|
1078
1078
|
s.has(t) || Ht(`${Fe(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1079
1079
|
}), vn(n)) n = "";
|
|
1080
|
-
else if (!(Et(e, n, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
1081
|
-
let
|
|
1082
|
-
gn(
|
|
1083
|
-
let
|
|
1084
|
-
let o = H(e,
|
|
1080
|
+
else if (!(Et(e, n, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & S.gcflag_no_check_output_events)) return Ht(`event NOT in output event list: ${Fe(e)}, ${n}`), 0;
|
|
1081
|
+
let i = Nt(e.dl_subscriptions, e, n, r, o);
|
|
1082
|
+
gn(i) > 0 && (Ht(`${Fe(e)}: ${gn(i)} subscription(s) REPEATED, will be deleted and override`), Xt(i, "subscription REPEATED"), Dt(e, i, !1));
|
|
1083
|
+
let l = function(e, t, n, r) {
|
|
1084
|
+
let o = H(e, Ot);
|
|
1085
1085
|
_n(o, "event", t), _n(o, "subscriber", r), _n(o, "publisher", e);
|
|
1086
1086
|
let s = 0;
|
|
1087
1087
|
if (n) {
|
|
1088
|
-
let t = Ln(e, n, "__config__", null), r = Ln(e, n, "__global__", null),
|
|
1088
|
+
let t = Ln(e, n, "__config__", null), r = Ln(e, n, "__global__", null), i = Ln(e, n, "__local__", null), l = Pn(e, n, "__filter__", null), _ = $n(e, n, "__service__", "");
|
|
1089
1089
|
if (pn(r) > 0 && _n(o, "__global__", Zt(r)), pn(t) > 0) {
|
|
1090
1090
|
let n = Zt(t);
|
|
1091
1091
|
if (_n(o, "__config__", n), xn(n, "__hard_subscription__")) {
|
|
@@ -1097,16 +1097,16 @@ function xt(e, n, r, o) {
|
|
|
1097
1097
|
sn(n, "__own_event__"), t && (s |= vt.__own_event__);
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
|
-
pn(
|
|
1100
|
+
pn(i) > 0 && _n(o, "__local__", Zt(i)), pn(l) > 0 && _n(o, "__filter__", Zt(l)), vn(_) || _n(o, "__service__", _);
|
|
1101
1101
|
}
|
|
1102
1102
|
return _n(o, "subs_flag", s), o;
|
|
1103
1103
|
}(e, n, r, o);
|
|
1104
|
-
if (!
|
|
1105
|
-
if (an(e.dl_subscriptions,
|
|
1106
|
-
let t = e.gclass.gmt.mt_subscription_added(e,
|
|
1107
|
-
(t < 0 || !1 === t) && (Rt(e,
|
|
1104
|
+
if (!l) return Ht(`${Fe(e)}: _create_subscription() FAILED`), 0;
|
|
1105
|
+
if (an(e.dl_subscriptions, l), an(o.dl_subscribings, l), d && it(d, "trace_subscriptions") && ($(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Fe(e), Fe(o))), r && Xt(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1106
|
+
let t = e.gclass.gmt.mt_subscription_added(e, l);
|
|
1107
|
+
(t < 0 || !1 === t) && (Rt(e, l, !0, !0), l = 0);
|
|
1108
1108
|
}
|
|
1109
|
-
return
|
|
1109
|
+
return l;
|
|
1110
1110
|
}
|
|
1111
1111
|
function Dt(e, t, n) {
|
|
1112
1112
|
let r = [...t];
|
|
@@ -1123,15 +1123,15 @@ function It(e, n, r) {
|
|
|
1123
1123
|
if (dn(r) || (r = {}), !e || e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return Ht("gobj NULL or DESTROYED"), -1;
|
|
1124
1124
|
if (vn(n)) return Ht(`${Fe(e)}: event EMPTY`), -1;
|
|
1125
1125
|
let o = bt(e, n, !0);
|
|
1126
|
-
if (!(o && o.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
1127
|
-
let s = d &&
|
|
1126
|
+
if (!(o && o.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & S.gcflag_no_check_output_events)) return Ht(`event NOT in output event list: ${Fe(e)}, ev ${n}`), -1;
|
|
1127
|
+
let s = d && it(d, "trace_subscriptions");
|
|
1128
1128
|
if (s && ($(1 === I ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Fe(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, "", n || "", "")), fn(r) && Xt(r)), e.gclass.gmt.mt_publish_event) {
|
|
1129
1129
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1130
1130
|
if (t <= 0) return t;
|
|
1131
1131
|
}
|
|
1132
|
-
let
|
|
1133
|
-
for (let o = 0; o <
|
|
1134
|
-
let a =
|
|
1132
|
+
let i = [...e.dl_subscriptions], l = 0, _ = 0;
|
|
1133
|
+
for (let o = 0; o < i.length; o++) {
|
|
1134
|
+
let a = i[o];
|
|
1135
1135
|
if (e.gclass.gmt.mt_publication_pre_filter) {
|
|
1136
1136
|
let t = e.gclass.gmt.mt_publication_pre_filter(e, a, n, r);
|
|
1137
1137
|
if (t < 0) break;
|
|
@@ -1142,21 +1142,21 @@ function It(e, n, r) {
|
|
|
1142
1142
|
let c = In(e, a, "subs_flag", 0, $t.KW_REQUIRED), f = $n(e, a, "event", "", $t.KW_REQUIRED);
|
|
1143
1143
|
if (vn(f) || 0 === Nn(f, n)) {
|
|
1144
1144
|
Ln(e, a, "__config__", null, 0);
|
|
1145
|
-
let o = Ln(e, a, "__global__", null, 0),
|
|
1145
|
+
let o = Ln(e, a, "__global__", null, 0), i = Ln(e, a, "__local__", null, 0), f = Pn(e, a, "__filter__", null, 0), g = r, p = 1;
|
|
1146
1146
|
if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) : pn(f) > 0 && (p = Vn(g, f) ? 1 : 0, s && ($(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", p ? "👍" : "👎", n || "", Fe(u), Fe(e))), Xt(f))), p < 0) break;
|
|
1147
1147
|
if (!p) continue;
|
|
1148
1148
|
let d = bt(u, n, !0);
|
|
1149
1149
|
if (d && d.event_flag & R.EVF_SYSTEM_EVENT && !mt(u, d.event_name, 0)) continue;
|
|
1150
|
-
|
|
1150
|
+
i && Rn(g, i), o && tn(g, o), s && ($(1 === I ? t("🔝🔄 %s (%s) %s%s", n || "", n || "", u.running ? "" : "!!", Fe(u)) : t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", Fe(u), dt(u), n || "", e && !e.running ? "!!" : "", Fe(e))), fn(g) && Xt(g));
|
|
1151
1151
|
let b = jt(u, n, g, e);
|
|
1152
1152
|
if (b < 0 && c & vt.__own_event__) {
|
|
1153
|
-
|
|
1153
|
+
l = -1;
|
|
1154
1154
|
break;
|
|
1155
1155
|
}
|
|
1156
|
-
if (_ += b,
|
|
1156
|
+
if (_ += b, l++, Ke(e)) break;
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
|
-
return
|
|
1159
|
+
return l || o && o.event_flag & R.EVF_NO_WARN_SUBS || qt(`${Fe(e)}: Publish event WITHOUT subscribers, ev ${n}`), _;
|
|
1160
1160
|
}
|
|
1161
1161
|
var $t = Object.freeze({
|
|
1162
1162
|
KW_REQUIRED: 1,
|
|
@@ -1336,15 +1336,15 @@ function yn(e) {
|
|
|
1336
1336
|
return "function" == typeof e;
|
|
1337
1337
|
}
|
|
1338
1338
|
function jn(e) {
|
|
1339
|
-
return e instanceof
|
|
1339
|
+
return e instanceof O;
|
|
1340
1340
|
}
|
|
1341
1341
|
function vn(e) {
|
|
1342
1342
|
return !mn(e) || 0 === e.length;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function On(e) {
|
|
1345
1345
|
return En(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Sn(e, t) {
|
|
1348
1348
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1349
1349
|
}
|
|
1350
1350
|
function Nn(e, t) {
|
|
@@ -1361,7 +1361,7 @@ function wn(e, t) {
|
|
|
1361
1361
|
let n = Number(e), r = Number(t);
|
|
1362
1362
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1363
1363
|
}
|
|
1364
|
-
return
|
|
1364
|
+
return Sn(String(e), String(t));
|
|
1365
1365
|
}
|
|
1366
1366
|
function Rn(e, t) {
|
|
1367
1367
|
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Rn(e, n);
|
|
@@ -1377,7 +1377,7 @@ function Dn(e, t, n, r) {
|
|
|
1377
1377
|
let o = n.split("`");
|
|
1378
1378
|
if (o.length <= 1) return t[n];
|
|
1379
1379
|
let s = o.length;
|
|
1380
|
-
for (let
|
|
1380
|
+
for (let i = 0; i < s; i++) if (void 0 === (t = t[o[i]])) return void (r && Ht(`${Fe(e)}: path not found: ${String(n)}`));
|
|
1381
1381
|
return t;
|
|
1382
1382
|
}
|
|
1383
1383
|
function An(e, t, n) {
|
|
@@ -1391,78 +1391,78 @@ function An(e, t, n) {
|
|
|
1391
1391
|
function kn(e, t, n, r, o) {
|
|
1392
1392
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1393
1393
|
let s = Dn(e, t, n, !1);
|
|
1394
|
-
const
|
|
1394
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1395
1395
|
if (void 0 === s) {
|
|
1396
|
-
if (
|
|
1396
|
+
if (l) {
|
|
1397
1397
|
let o = Boolean(r);
|
|
1398
1398
|
return Un(e, t, n, o), o;
|
|
1399
1399
|
}
|
|
1400
|
-
return
|
|
1400
|
+
return i && (Ht(`path not found: '${n}'`), Xt(t)), Boolean(r);
|
|
1401
1401
|
}
|
|
1402
1402
|
return _ && An(e, t, n), Boolean(s);
|
|
1403
1403
|
}
|
|
1404
1404
|
function In(e, t, n, r, o) {
|
|
1405
1405
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1406
1406
|
let s = Dn(e, t, n, !1);
|
|
1407
|
-
const
|
|
1407
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1408
1408
|
if (void 0 === s) {
|
|
1409
|
-
if (
|
|
1409
|
+
if (l) {
|
|
1410
1410
|
let o = parseInt(r);
|
|
1411
1411
|
return Un(e, t, n, o), o;
|
|
1412
1412
|
}
|
|
1413
|
-
return
|
|
1413
|
+
return i && (Ht(`path not found: '${n}'`), Xt(t)), parseInt(r);
|
|
1414
1414
|
}
|
|
1415
|
-
return _ && An(e, t, n), En(s) ? parseInt(s) : (
|
|
1415
|
+
return _ && An(e, t, n), En(s) ? parseInt(s) : (i && (Ht(`path value MUST BE a number: ${n}`), Qt(t)), parseInt(r));
|
|
1416
1416
|
}
|
|
1417
1417
|
function $n(e, t, n, r, o) {
|
|
1418
1418
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1419
1419
|
let s = Dn(e, t, n, !1);
|
|
1420
|
-
const
|
|
1420
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1421
1421
|
if (void 0 === s) {
|
|
1422
|
-
if (
|
|
1422
|
+
if (l) {
|
|
1423
1423
|
let o = String(r);
|
|
1424
1424
|
return Un(e, t, n, o), o;
|
|
1425
1425
|
}
|
|
1426
|
-
return
|
|
1426
|
+
return i && (Ht(`path not found: '${n}'`), Xt(t)), String(r);
|
|
1427
1427
|
}
|
|
1428
|
-
return _ && An(e, t, n), mn(s) ? String(s) : (
|
|
1428
|
+
return _ && An(e, t, n), mn(s) ? String(s) : (i && (Ht(`${Fe(e)}: path value MUST BE a string: ${n}`), Qt(t)), String(r));
|
|
1429
1429
|
}
|
|
1430
1430
|
function Cn(e, t, n, r, o) {
|
|
1431
1431
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1432
1432
|
let s = Dn(e, t, n, !1);
|
|
1433
|
-
const
|
|
1433
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1434
1434
|
if (void 0 === s) {
|
|
1435
|
-
if (
|
|
1435
|
+
if (l) {
|
|
1436
1436
|
let o = r;
|
|
1437
1437
|
return Un(e, t, n, o), o;
|
|
1438
1438
|
}
|
|
1439
|
-
return
|
|
1439
|
+
return i && (Ht(`path not found: '${n}'`), Xt(t)), r;
|
|
1440
1440
|
}
|
|
1441
1441
|
return _ && An(e, t, n), s;
|
|
1442
1442
|
}
|
|
1443
1443
|
function Ln(e, t, n, r, o) {
|
|
1444
1444
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1445
1445
|
let s = Dn(e, t, n, !1);
|
|
1446
|
-
const
|
|
1446
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1447
1447
|
if (void 0 === s) {
|
|
1448
|
-
if (
|
|
1448
|
+
if (l) {
|
|
1449
1449
|
let o = Object(r);
|
|
1450
1450
|
return Un(e, t, n, o), o;
|
|
1451
1451
|
}
|
|
1452
|
-
return
|
|
1452
|
+
return i && (Ht(`path not found: '${n}'`), Xt(t)), Object(r);
|
|
1453
1453
|
}
|
|
1454
|
-
return _ && An(e, t, n), dn(s) ? Object(s) : (
|
|
1454
|
+
return _ && An(e, t, n), dn(s) ? Object(s) : (i && (Ht(`path value MUST BE a dict: ${n}`), Qt(t)), Object(r));
|
|
1455
1455
|
}
|
|
1456
1456
|
function Pn(e, t, n, r, o) {
|
|
1457
1457
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1458
1458
|
let s = Dn(e, t, n, !1);
|
|
1459
|
-
const
|
|
1459
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1460
1460
|
if (void 0 === s) {
|
|
1461
|
-
if (
|
|
1461
|
+
if (l) {
|
|
1462
1462
|
let o = r;
|
|
1463
1463
|
return Un(e, t, n, o), o;
|
|
1464
1464
|
}
|
|
1465
|
-
return
|
|
1465
|
+
return i && (Ht(`path not found: '${n}'`), Xt(t)), r;
|
|
1466
1466
|
}
|
|
1467
1467
|
return _ && An(e, t, n), s;
|
|
1468
1468
|
}
|
|
@@ -1486,15 +1486,15 @@ function Gn(e, n, r) {
|
|
|
1486
1486
|
let o = "", s = !1;
|
|
1487
1487
|
if (bn(n)) {
|
|
1488
1488
|
s = !1;
|
|
1489
|
-
for (let
|
|
1490
|
-
let
|
|
1491
|
-
if (o = vn(r) ? t("%s", r) : t("%s`%d", r,
|
|
1489
|
+
for (let i = 0; i < n.length; i++) {
|
|
1490
|
+
let l = n[i];
|
|
1491
|
+
if (o = vn(r) ? t("%s", r) : t("%s`%d", r, i), s = Gn(e, l, o), s) break;
|
|
1492
1492
|
}
|
|
1493
1493
|
} else if (dn(n)) {
|
|
1494
1494
|
s = !0;
|
|
1495
|
-
let
|
|
1496
|
-
for (let
|
|
1497
|
-
let _ = l
|
|
1495
|
+
let i = Object.keys(n);
|
|
1496
|
+
for (let l = 0; l < i.length; l++) {
|
|
1497
|
+
let _ = i[l], a = n[_];
|
|
1498
1498
|
if (o = vn(r) ? t("%s", _) : t("%s`%s", r, _), bn(a) || dn(a)) {
|
|
1499
1499
|
if (s = Gn(e, a, o), !s) break;
|
|
1500
1500
|
continue;
|
|
@@ -1525,8 +1525,8 @@ function Mn(e, t, n, r) {
|
|
|
1525
1525
|
else {
|
|
1526
1526
|
if (!(bn(n) && gn(n) > 0)) return t;
|
|
1527
1527
|
for (let s = 0; s < n.length; s++) {
|
|
1528
|
-
let
|
|
1529
|
-
t.hasOwnProperty(
|
|
1528
|
+
let i = n[s];
|
|
1529
|
+
t.hasOwnProperty(i) ? o[i] = t[i] : r && Ht(`${Fe(e)}: key not found: ${i}`);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
return o;
|
|
@@ -1540,8 +1540,8 @@ function Wn(e, t, n, r) {
|
|
|
1540
1540
|
else {
|
|
1541
1541
|
if (!(bn(n) && gn(n) > 0)) return {};
|
|
1542
1542
|
for (let s = 0; s < n.length; s++) {
|
|
1543
|
-
let
|
|
1544
|
-
t.hasOwnProperty(
|
|
1543
|
+
let i = n[s];
|
|
1544
|
+
t.hasOwnProperty(i) ? sn(o, i) : r && Ht(`${Fe(e)}: key not found: ${i}`);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
return o;
|
|
@@ -1586,20 +1586,20 @@ function Hn(e, t, n, r, o) {
|
|
|
1586
1586
|
if (e && !jn(e) && Ht("GObj bad instanceof"), !t) return null;
|
|
1587
1587
|
o || (o = Vn);
|
|
1588
1588
|
let s = [];
|
|
1589
|
-
if (bn(t)) for (let
|
|
1590
|
-
let
|
|
1591
|
-
if (dn(_))
|
|
1589
|
+
if (bn(t)) for (let i = 0; i < t.length; i++) {
|
|
1590
|
+
let l, _ = t[i];
|
|
1591
|
+
if (dn(_)) l = $n(e, _, "id", "", 0);
|
|
1592
1592
|
else {
|
|
1593
1593
|
if (!mn(_)) continue;
|
|
1594
|
-
|
|
1594
|
+
l = _;
|
|
1595
1595
|
}
|
|
1596
|
-
Jn(n,
|
|
1596
|
+
Jn(n, l) && o(_, r) && s.push(_);
|
|
1597
1597
|
}
|
|
1598
1598
|
else {
|
|
1599
1599
|
if (!dn(t)) return Ht("kw_collect() BAD kw parameter"), null;
|
|
1600
1600
|
for (let e of Object.keys(t)) {
|
|
1601
|
-
let
|
|
1602
|
-
Jn(n, e) && o(
|
|
1601
|
+
let i = t[e];
|
|
1602
|
+
Jn(n, e) && o(i, r) && s.push(i);
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
1605
|
return s;
|
|
@@ -1716,10 +1716,10 @@ function sr(e) {
|
|
|
1716
1716
|
signature: t(n[2])
|
|
1717
1717
|
};
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1719
|
+
function ir(e) {
|
|
1720
1720
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1721
1721
|
}
|
|
1722
|
-
function
|
|
1722
|
+
function lr(e) {
|
|
1723
1723
|
const t = document.createElement("template");
|
|
1724
1724
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1725
1725
|
}
|
|
@@ -1904,32 +1904,32 @@ var vr = [
|
|
|
1904
1904
|
j(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1905
1905
|
j(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1906
1906
|
y()
|
|
1907
|
-
],
|
|
1907
|
+
], Or = {
|
|
1908
1908
|
periodic: !1,
|
|
1909
1909
|
msec: 0,
|
|
1910
1910
|
timer_id: -1
|
|
1911
|
-
},
|
|
1911
|
+
}, Sr = null;
|
|
1912
1912
|
function Nr(e, t, n, r) {
|
|
1913
1913
|
let o = e.priv, s = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1914
1914
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
1915
1915
|
jt(e, "EV_TIMEOUT", {}, e);
|
|
1916
|
-
}, o.msec) : o.timer_id = -1, We(e) ? jt(Ve(e), s, {}, e) : It(e, s, {}), o.periodic || -1 !== o.timer_id || xe(e) &&
|
|
1916
|
+
}, o.msec) : o.timer_id = -1, We(e) ? jt(Ve(e), s, {}, e) : It(e, s, {}), o.periodic || -1 !== o.timer_id || xe(e) && Oe(e), 0;
|
|
1917
1917
|
}
|
|
1918
1918
|
var wr = {
|
|
1919
1919
|
mt_create: function(e) {
|
|
1920
1920
|
let t = e.priv;
|
|
1921
1921
|
const n = at(e, "subscriber");
|
|
1922
|
-
n && xt(e, null, {}, n), t.periodic =
|
|
1922
|
+
n && xt(e, null, {}, n), t.periodic = it(e, "periodic"), t.msec = lt(e, "msec");
|
|
1923
1923
|
},
|
|
1924
1924
|
mt_writing: function(e, t) {
|
|
1925
1925
|
let n = e.priv;
|
|
1926
1926
|
switch (t) {
|
|
1927
1927
|
case "periodic":
|
|
1928
|
-
n.periodic =
|
|
1928
|
+
n.periodic = it(e, "periodic");
|
|
1929
1929
|
break;
|
|
1930
|
-
case "msec": n.msec =
|
|
1930
|
+
case "msec": n.msec = lt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
1931
1931
|
jt(e, "EV_TIMEOUT", {}, e);
|
|
1932
|
-
}, n.msec)), n.msec > 0 ? xe(e) || ye(e) : xe(e) &&
|
|
1932
|
+
}, n.msec)), n.msec > 0 ? xe(e) || ye(e) : xe(e) && Oe(e);
|
|
1933
1933
|
}
|
|
1934
1934
|
},
|
|
1935
1935
|
mt_start: function(e) {
|
|
@@ -1941,13 +1941,13 @@ var wr = {
|
|
|
1941
1941
|
mt_destroy: function(e) {}
|
|
1942
1942
|
};
|
|
1943
1943
|
function Rr(e, t) {
|
|
1944
|
-
return e instanceof
|
|
1944
|
+
return e instanceof O ? "C_TIMER" !== Ue(e) ? (Ht("not C_TIMER GObj"), -1) : (ct(e, "periodic", !1), void ft(e, "msec", t)) : (Ht("not GObj TYPE"), -1);
|
|
1945
1945
|
}
|
|
1946
1946
|
function xr(e, t) {
|
|
1947
|
-
return e instanceof
|
|
1947
|
+
return e instanceof O ? "C_TIMER" !== Ue(e) ? (Ht("not C_TIMER GObj"), -1) : (ct(e, "periodic", !0), void ft(e, "msec", t)) : (Ht("not GObj TYPE"), -1);
|
|
1948
1948
|
}
|
|
1949
1949
|
function Dr(e) {
|
|
1950
|
-
return e instanceof
|
|
1950
|
+
return e instanceof O ? "C_TIMER" !== Ue(e) ? (Ht("not C_TIMER GObj"), -1) : void ft(e, "msec", -1) : (Ht("not GObj TYPE"), -1);
|
|
1951
1951
|
}
|
|
1952
1952
|
var Ar = [
|
|
1953
1953
|
j(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
@@ -2046,7 +2046,7 @@ function Gr(e) {
|
|
|
2046
2046
|
data: n.data
|
|
2047
2047
|
}, e);
|
|
2048
2048
|
}, n.onclose = (n) => {
|
|
2049
|
-
Ke(e) || (
|
|
2049
|
+
Ke(e) || (it(Ie(), "browser_beforeunload") ? qt("Close websocket by unload page") : jt(e, "EV_ON_CLOSE", {
|
|
2050
2050
|
url: t,
|
|
2051
2051
|
e: n
|
|
2052
2052
|
}, e));
|
|
@@ -2079,7 +2079,7 @@ var Wr = class {
|
|
|
2079
2079
|
function Kr(e, t, n, r) {
|
|
2080
2080
|
return function(e, t) {
|
|
2081
2081
|
let n = e.priv, r = JSON.stringify(t);
|
|
2082
|
-
if (
|
|
2082
|
+
if (it(Ie(), "trace_inter_event")) {
|
|
2083
2083
|
let n = _t(e, "url"), o = Pe(Ie()) + " ==> " + n, s = ot(Ie(), "trace_ievent_callback");
|
|
2084
2084
|
s ? s(o, t, 1, r.length) : Mr(0, o, t);
|
|
2085
2085
|
}
|
|
@@ -2106,13 +2106,13 @@ function Yr(e, t, n) {
|
|
|
2106
2106
|
};
|
|
2107
2107
|
}
|
|
2108
2108
|
function Br(e) {
|
|
2109
|
-
let t = e.priv, n = ke(Ie()), r = _t(Ie(), "yuno_version"), o = _t(Ie(), "yuno_release"),
|
|
2110
|
-
|
|
2109
|
+
let t = e.priv, n = ke(Ie()), r = _t(Ie(), "yuno_version"), o = _t(Ie(), "yuno_release"), i = _t(Ie(), "yuno_tag"), l = ot(e, "required_services");
|
|
2110
|
+
l && l.length || (l = ot(Ie(), "required_services"));
|
|
2111
2111
|
let _ = {
|
|
2112
2112
|
yuno_role: Ce(),
|
|
2113
2113
|
yuno_id: Le(),
|
|
2114
2114
|
yuno_name: $e(),
|
|
2115
|
-
yuno_tag:
|
|
2115
|
+
yuno_tag: i,
|
|
2116
2116
|
yuno_version: r,
|
|
2117
2117
|
yuno_release: o,
|
|
2118
2118
|
yuneta_version: s,
|
|
@@ -2126,15 +2126,15 @@ function Br(e) {
|
|
|
2126
2126
|
id: ur(),
|
|
2127
2127
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2128
2128
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2129
|
-
required_services:
|
|
2129
|
+
required_services: l
|
|
2130
2130
|
};
|
|
2131
|
-
return Zn(e, _, Lr, Yr(e, Pe(Ve(e)), null)), tr(e, _, "__identity__"), Rr(t.gobj_timer,
|
|
2131
|
+
return Zn(e, _, Lr, Yr(e, Pe(Ve(e)), null)), tr(e, _, "__identity__"), Rr(t.gobj_timer, lt(e, "timeout_idack")), Kr(e, "EV_IDENTITY_CARD", _);
|
|
2132
2132
|
}
|
|
2133
2133
|
function Jr(e, t) {
|
|
2134
2134
|
if (vn(t.event)) return -1;
|
|
2135
|
-
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__,
|
|
2135
|
+
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, l = t.subscriber;
|
|
2136
2136
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
2137
|
-
return Zn(e, n, Lr, Yr(e, Pe(
|
|
2137
|
+
return Zn(e, n, Lr, Yr(e, Pe(l), i)), tr(e, n, "__subscribing__"), Kr(e, t.event, n);
|
|
2138
2138
|
}
|
|
2139
2139
|
function Hr(e, t, n, r) {
|
|
2140
2140
|
let o = e.priv;
|
|
@@ -2144,14 +2144,14 @@ function qr(e, t, n, r) {
|
|
|
2144
2144
|
return zt("Websocket opened: " + e.priv.url), Br(e), 0;
|
|
2145
2145
|
}
|
|
2146
2146
|
function zr(e, t, n, r) {
|
|
2147
|
-
let o = e.priv, s = n.e,
|
|
2148
|
-
return Bt(), qt(`${Fe(e)}: WebSocket closed ${
|
|
2149
|
-
url:
|
|
2147
|
+
let o = e.priv, s = n.e, i = n.url;
|
|
2148
|
+
return Bt(), qt(`${Fe(e)}: WebSocket closed ${i} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), 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, It(e, "EV_ON_CLOSE", {
|
|
2149
|
+
url: i,
|
|
2150
2150
|
remote_yuno_name: o.remote_yuno_name,
|
|
2151
2151
|
remote_yuno_role: o.remote_yuno_role,
|
|
2152
2152
|
remote_yuno_service: o.remote_yuno_service
|
|
2153
|
-
})) : (qt(`${Fe(e)}: EV_ON_OPEN_ERROR cannot open ${
|
|
2154
|
-
url:
|
|
2153
|
+
})) : (qt(`${Fe(e)}: EV_ON_OPEN_ERROR cannot open ${i} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), It(e, "EV_ON_OPEN_ERROR", {
|
|
2154
|
+
url: i,
|
|
2155
2155
|
remote_yuno_name: o.remote_yuno_name,
|
|
2156
2156
|
remote_yuno_role: o.remote_yuno_role,
|
|
2157
2157
|
remote_yuno_service: o.remote_yuno_service,
|
|
@@ -2159,7 +2159,7 @@ function zr(e, t, n, r) {
|
|
|
2159
2159
|
reason: s.reason,
|
|
2160
2160
|
was_clean: s.wasClean
|
|
2161
2161
|
})), xe(e) && Rr(o.gobj_timer, function(e) {
|
|
2162
|
-
let t = e.priv, n =
|
|
2162
|
+
let t = e.priv, n = lt(e, "timeout_retry"), r = lt(e, "timeout_retry_max");
|
|
2163
2163
|
r < n && (r = n);
|
|
2164
2164
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2165
2165
|
let o = .2 * t.retry_ms, s = t.retry_ms - o + 2 * Math.random() * o;
|
|
@@ -2172,8 +2172,8 @@ function Qr(e, t, n, r) {
|
|
|
2172
2172
|
function Xr(e, t, n, r) {
|
|
2173
2173
|
let o = e.priv;
|
|
2174
2174
|
Dr(o.gobj_timer);
|
|
2175
|
-
let s = er(e, n, Lr, !0),
|
|
2176
|
-
gt(e, "remote_yuno_name",
|
|
2175
|
+
let s = er(e, n, Lr, !0), i = $n(e, s, "src_yuno", ""), l = $n(e, s, "src_role", ""), _ = $n(e, s, "src_service", "");
|
|
2176
|
+
gt(e, "remote_yuno_name", i), gt(e, "remote_yuno_role", l), gt(e, "remote_yuno_service", _);
|
|
2177
2177
|
let a = In(e, n, "result", -1, 0), u = $n(e, n, "comment", "", 0), c = $n(e, n, "username", "", 0), f = Pn(e, n, "services_roles", {});
|
|
2178
2178
|
if (a < 0) {
|
|
2179
2179
|
Vr(e);
|
|
@@ -2182,8 +2182,8 @@ function Xr(e, t, n, r) {
|
|
|
2182
2182
|
result: a,
|
|
2183
2183
|
comment: u,
|
|
2184
2184
|
username: c,
|
|
2185
|
-
remote_yuno_name:
|
|
2186
|
-
remote_yuno_role:
|
|
2185
|
+
remote_yuno_name: i,
|
|
2186
|
+
remote_yuno_role: l,
|
|
2187
2187
|
remote_yuno_service: _
|
|
2188
2188
|
};
|
|
2189
2189
|
We(e) ? jt(Ve(e), "EV_ON_ID_NAK", t, e) : It(e, "EV_ON_ID_NAK", t);
|
|
@@ -2192,8 +2192,8 @@ function Xr(e, t, n, r) {
|
|
|
2192
2192
|
o.inform_on_close = !0;
|
|
2193
2193
|
let t = {
|
|
2194
2194
|
username: c,
|
|
2195
|
-
remote_yuno_name:
|
|
2196
|
-
remote_yuno_role:
|
|
2195
|
+
remote_yuno_name: i,
|
|
2196
|
+
remote_yuno_role: l,
|
|
2197
2197
|
remote_yuno_service: _,
|
|
2198
2198
|
services_roles: f
|
|
2199
2199
|
};
|
|
@@ -2224,29 +2224,29 @@ function Zr(e, t, n, r) {
|
|
|
2224
2224
|
kw: o || {}
|
|
2225
2225
|
} : (Ht("parsing inter_event: kw not a json object"), null) : (Ht("parsing inter_kw: no kw"), null);
|
|
2226
2226
|
}(0, n.data);
|
|
2227
|
-
if (
|
|
2227
|
+
if (it(Ie(), "trace_inter_event")) {
|
|
2228
2228
|
let e = Pe(Ie()) + " <== " + o, t = n.data.length, r = ot(Ie(), "trace_ievent_callback");
|
|
2229
2229
|
r ? r(e, s, 2, t) : Mr(0, e, s);
|
|
2230
2230
|
}
|
|
2231
|
-
let
|
|
2231
|
+
let i = s.event, l = s.kw;
|
|
2232
2232
|
if ("ST_SESSION" !== dt(e)) {
|
|
2233
|
-
if (mt(e,
|
|
2234
|
-
if (!(jt(e,
|
|
2235
|
-
} else Ht(`${Fe(e)}: event UNKNOWN in not-session state ${
|
|
2233
|
+
if (mt(e, i, R.EVF_PUBLIC_EVENT)) {
|
|
2234
|
+
if (!(jt(e, i, l, e) < 0)) return 0;
|
|
2235
|
+
} else Ht(`${Fe(e)}: event UNKNOWN in not-session state ${i}`);
|
|
2236
2236
|
return Vr(e), -1;
|
|
2237
2237
|
}
|
|
2238
2238
|
s = null;
|
|
2239
|
-
let _ = nr(e,
|
|
2239
|
+
let _ = nr(e, l), a = er(e, l, Lr), u = $n(e, a, "dst_role", "");
|
|
2240
2240
|
if (u.toLowerCase() !== Ce().toLowerCase()) return Ht(`"It's not my role, dst_role: ${u}, my_role: ${Ce()}`), 0;
|
|
2241
2241
|
let c = $n(e, a, "dst_service", "");
|
|
2242
2242
|
if ("__subscribing__" === _) return -1;
|
|
2243
2243
|
if ("__unsubscribing__" === _) return -1;
|
|
2244
|
-
if (mt(e,
|
|
2244
|
+
if (mt(e, i, R.EVF_PUBLIC_EVENT)) return jt(e, i, l, e), 0;
|
|
2245
2245
|
if (!vn(c)) {
|
|
2246
2246
|
let t = fe(c, !1);
|
|
2247
|
-
return t ? mt(t,
|
|
2247
|
+
return t ? mt(t, i, R.EVF_PUBLIC_EVENT) ? (jt(t, i, l, e), 0) : (Ht(`${Fe(e)}: Service found but no event or not public, service '${Fe(t)}', ev '${i}'`), -1) : (qt(`${Fe(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${i}'`), 0);
|
|
2248
2248
|
}
|
|
2249
|
-
return We(e) ? jt(Ve(e),
|
|
2249
|
+
return We(e) ? jt(Ve(e), i, l, e) : It(e, i, l), 0;
|
|
2250
2250
|
}
|
|
2251
2251
|
function eo(e, t, n, r) {
|
|
2252
2252
|
return 0;
|
|
@@ -2321,12 +2321,12 @@ var no = {
|
|
|
2321
2321
|
if ("ST_SESSION" !== dt(e) || !n.websocket) return 0;
|
|
2322
2322
|
if (n.inside_on_open) return 0;
|
|
2323
2323
|
if (vn(t.event)) return 0;
|
|
2324
|
-
let r = {}, o = t.__global__, s = t.__config__,
|
|
2325
|
-
s && (r.__config__ = s), o && (r.__global__ = o),
|
|
2326
|
-
return Zn(e, r, Lr, Yr(e, Pe(_),
|
|
2324
|
+
let r = {}, o = t.__global__, s = t.__config__, i = t.__filter__, l = t.__service__, _ = t.subscriber;
|
|
2325
|
+
s && (r.__config__ = s), o && (r.__global__ = o), i && (r.__filter__ = i);
|
|
2326
|
+
return Zn(e, r, Lr, Yr(e, Pe(_), l)), tr(e, r, "__unsubscribing__"), Kr(e, t.event, r, e);
|
|
2327
2327
|
}
|
|
2328
2328
|
};
|
|
2329
|
-
exports.GObj =
|
|
2329
|
+
exports.GObj = O, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) => new h(e, t, n, null, s, r, null, 0, null, o, null), exports.SDATACM = (e, t, n, r, o, s) => new h(e, t, 0, null, s, n, null, 0, o, r, null), exports.SDATACM2 = (e, t, n, r, o, s, i) => new h(e, t, n, null, i, r, null, 0, s, o, null), exports.SDATADF = (e, t, n, r, o, s) => new h(e, t, n, null, s, null, r, o), exports.SDATAPM = (e, t, n, r, o) => new h(e, t, n, r, o), exports.SDATAPM0 = (e, t, n, r, o) => new h(e, t, n, null, o, null, null, 0, null, null, r), exports.SDATA_END = y, exports.SDataDesc = h, exports.YUNETA_VERSION = s, Object.defineProperty(exports, "__yuno__", {
|
|
2330
2330
|
enumerable: !0,
|
|
2331
2331
|
get: function() {
|
|
2332
2332
|
return d;
|
|
@@ -2338,24 +2338,24 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2338
2338
|
}, exports.build_stats_response = o, exports.clean_name = function(e) {
|
|
2339
2339
|
return e.replace(/[?# ^:]/g, "_");
|
|
2340
2340
|
}, exports.clear_timeout = Dr, exports.cmp_two_simple_json = wn, exports.command_parser = function(e, t, n, r) {}, exports.createElement2 = function e(t, n) {
|
|
2341
|
-
let [r, o, s,
|
|
2341
|
+
let [r, o, s, i] = t;
|
|
2342
2342
|
if (!r) return void Ht("Tag must be a valid HTML element.");
|
|
2343
|
-
let
|
|
2343
|
+
let l = document.createElement(r), _ = "";
|
|
2344
2344
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2345
2345
|
let t = "";
|
|
2346
2346
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
2347
|
-
|
|
2348
|
-
} else "style" === e ?
|
|
2349
|
-
if (mn(s)) if (s = s.trim(), s.length > 0 && "<" === s[0])
|
|
2350
|
-
else if (n && _)
|
|
2351
|
-
else
|
|
2347
|
+
l.style.cssText = t;
|
|
2348
|
+
} else "style" === e ? l.style.cssText = o[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== o[e] && void 0 !== o[e] && (_ = o[e], l.setAttribute("data-i18n", _)) : l.setAttribute(e, o[e]);
|
|
2349
|
+
if (mn(s)) if (s = s.trim(), s.length > 0 && "<" === s[0]) l.appendChild(lr(s));
|
|
2350
|
+
else if (n && _) l.textContent = n(_) || s;
|
|
2351
|
+
else l.textContent = s;
|
|
2352
2352
|
else if (bn(s)) {
|
|
2353
|
-
if (s.length > 0) if (mn(s[0]))
|
|
2354
|
-
else for (let t of s) Array.isArray(t) && t.length > 0 ?
|
|
2355
|
-
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ?
|
|
2356
|
-
if (
|
|
2357
|
-
return
|
|
2358
|
-
}, exports.createOneHtml =
|
|
2353
|
+
if (s.length > 0) if (mn(s[0])) l.appendChild(e(s, n));
|
|
2354
|
+
else for (let t of s) Array.isArray(t) && t.length > 0 ? l.appendChild(e(t, n)) : t instanceof HTMLElement && l.appendChild(t);
|
|
2355
|
+
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? l.appendChild(s) : null != s && (Ht("content ignored"), Xt(s));
|
|
2356
|
+
if (i && "object" == typeof i) for (const e of Object.keys(i)) l.addEventListener(e, i[e]);
|
|
2357
|
+
return l;
|
|
2358
|
+
}, exports.createOneHtml = lr, exports.create_json_record = function(e, t) {
|
|
2359
2359
|
let n = Zt(e);
|
|
2360
2360
|
return nn(n, t), n;
|
|
2361
2361
|
}, exports.create_template_record = function(e, t) {
|
|
@@ -2383,18 +2383,18 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2383
2383
|
return r && dn(r) && rn(n, r), Yn(mr(e), n);
|
|
2384
2384
|
}, exports.debounce = function(e, t = 0, n = !1) {
|
|
2385
2385
|
let r = null, o = null, s = null;
|
|
2386
|
-
const
|
|
2387
|
-
s = this, o =
|
|
2388
|
-
const
|
|
2386
|
+
const i = (...i) => {
|
|
2387
|
+
s = this, o = i;
|
|
2388
|
+
const l = n && !r;
|
|
2389
2389
|
clearTimeout(r), r = setTimeout(() => {
|
|
2390
2390
|
r = null, n || e.apply(s, o);
|
|
2391
|
-
}, t),
|
|
2391
|
+
}, t), l && e.apply(s, o);
|
|
2392
2392
|
};
|
|
2393
|
-
return
|
|
2393
|
+
return i.flush = () => {
|
|
2394
2394
|
r && (clearTimeout(r), r = null, e.apply(s, o));
|
|
2395
|
-
},
|
|
2395
|
+
}, i.cancel = () => {
|
|
2396
2396
|
clearTimeout(r), r = null, o = null, s = null;
|
|
2397
|
-
},
|
|
2397
|
+
}, i;
|
|
2398
2398
|
}, exports.delete_from_list = function(e, t) {
|
|
2399
2399
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
2400
2400
|
return !1;
|
|
@@ -2407,7 +2407,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2407
2407
|
return t;
|
|
2408
2408
|
}, exports.empty_json = function(e) {
|
|
2409
2409
|
return 0 === pn(e);
|
|
2410
|
-
}, exports.empty_string = vn, exports.escapeHtml =
|
|
2410
|
+
}, exports.empty_string = vn, exports.escapeHtml = ir, exports.event_flag_t = R, exports.flat2json = function(e) {
|
|
2411
2411
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2412
2412
|
let t = null;
|
|
2413
2413
|
for (const n of Object.keys(e)) {
|
|
@@ -2419,10 +2419,10 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2419
2419
|
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2420
2420
|
let s = t;
|
|
2421
2421
|
for (let t = 0; t < r.length; t++) {
|
|
2422
|
-
const o = r[t],
|
|
2423
|
-
if (
|
|
2424
|
-
if (
|
|
2425
|
-
if (
|
|
2422
|
+
const o = r[t], i = "number" == typeof o, l = t === r.length - 1, _ = !l && "number" == typeof r[t + 1];
|
|
2423
|
+
if (i && o > gr) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
2424
|
+
if (i !== Array.isArray(s)) throw new Error(`flat2json: '${n}' uses a ${i ? "array index" : "key"} where the tree already has a ${Array.isArray(s) ? "array" : "object"}`);
|
|
2425
|
+
if (l) {
|
|
2426
2426
|
if (Array.isArray(s)) {
|
|
2427
2427
|
for (; s.length <= o;) s.push(null);
|
|
2428
2428
|
s[o] = e[n];
|
|
@@ -2468,7 +2468,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2468
2468
|
return o;
|
|
2469
2469
|
}, exports.flat_key_join = function(e) {
|
|
2470
2470
|
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : pr(e)).join("`") : "";
|
|
2471
|
-
}, exports.flat_key_split = dr, exports.gclass_add_ev_action = se, exports.gclass_add_event_type =
|
|
2471
|
+
}, exports.flat_key_split = dr, exports.gclass_add_ev_action = se, exports.gclass_add_event_type = le, exports.gclass_add_state = oe, exports.gclass_check_fsm = ae, exports.gclass_create = ee, exports.gclass_event_type = _e, exports.gclass_find_by_name = ue, exports.gclass_flag_t = S, exports.gclass_unregister = te, exports.getPositionRelativeToBody = function(e) {
|
|
2472
2472
|
if (!e) return {
|
|
2473
2473
|
top: 0,
|
|
2474
2474
|
left: 0,
|
|
@@ -2480,21 +2480,21 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2480
2480
|
left: 0,
|
|
2481
2481
|
width: 0,
|
|
2482
2482
|
height: 0
|
|
2483
|
-
}, s = "undefined" != typeof window,
|
|
2483
|
+
}, s = "undefined" != typeof window, i = s && (window.scrollY || document.documentElement?.scrollTop || document.body?.scrollTop) || 0, l = s && (window.scrollX || document.documentElement?.scrollLeft || document.body?.scrollLeft) || 0;
|
|
2484
2484
|
return {
|
|
2485
|
-
top: t +
|
|
2486
|
-
left: n +
|
|
2487
|
-
right: n +
|
|
2488
|
-
bottom: t +
|
|
2485
|
+
top: t + i,
|
|
2486
|
+
left: n + l,
|
|
2487
|
+
right: n + l + r,
|
|
2488
|
+
bottom: t + i + o
|
|
2489
2489
|
};
|
|
2490
2490
|
}, exports.get_function_name = cr, exports.get_now = function() {
|
|
2491
2491
|
return Math.floor(Date.now() / 1e3);
|
|
2492
2492
|
}, exports.gobj_bottom_gobj = Ye, exports.gobj_change_parent = function(e, n) {
|
|
2493
|
-
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), null) : n instanceof
|
|
2493
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), null) : n instanceof O ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (de(e.parent, e), e.parent = null), pe(n, e), n.mt_child_added && (K(e) && zt(t("👦👦🔵 child_added(%s): %s", Ge(n), Fe(e))), n.mt_child_added(n, e)), 0) : (Ht(`${Fe(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2494
2494
|
}, exports.gobj_change_state = pt, exports.gobj_command = function(e, n, o, s) {
|
|
2495
2495
|
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), -1;
|
|
2496
|
-
let
|
|
2497
|
-
return
|
|
2496
|
+
let i = d && lt(d, "tracing");
|
|
2497
|
+
return i && ($(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", xe(e) ? "" : "!!", Fe(e), n, Fe(s))), i > 1 && Xt(o)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, o, s) : e.gclass.command_table ? u ? u(e, n, o, s) : r(0, -1, t("%s: global command parser not available", Fe(e)), 0, 0) : r(0, -1, t("%s: command table not available", Fe(e)), 0, 0);
|
|
2498
2498
|
}, exports.gobj_create = function(e, t, n, r) {
|
|
2499
2499
|
return Ee(e, t, n, r, 0);
|
|
2500
2500
|
}, exports.gobj_create2 = Ee, exports.gobj_create_default_service = function(e, t, n, r) {
|
|
@@ -2531,7 +2531,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2531
2531
|
total_subscribings: gn(n)
|
|
2532
2532
|
};
|
|
2533
2533
|
}, exports.gobj_load_persistent_attrs = function(e, t) {
|
|
2534
|
-
return Ae(e) ?
|
|
2534
|
+
return Ae(e) ? i ? i(e, t) : -1 : (Ht(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2535
2535
|
}, exports.gobj_match_children = function(e, t) {
|
|
2536
2536
|
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), null;
|
|
2537
2537
|
t = t || {};
|
|
@@ -2553,7 +2553,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2553
2553
|
}
|
|
2554
2554
|
}(n, e), n;
|
|
2555
2555
|
}, exports.gobj_match_gobj = et, exports.gobj_name = Pe, exports.gobj_parent = Ve, exports.gobj_pause = Re, exports.gobj_play = we, exports.gobj_post_event = function(e, n, r, o) {
|
|
2556
|
-
return e && e instanceof
|
|
2556
|
+
return e && e instanceof O ? e.obflag & (w.obflag_destroyed | w.obflag_destroying) ? (Ht(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : vn(n) ? (Ht("gobj_post_event(): event EMPTY"), -1) : mt(e, n, 0) ? Tt.length >= 1e4 ? (Ht(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${Tt.length}`), -1) : (Tt.push({
|
|
2557
2557
|
dst: e,
|
|
2558
2558
|
event: n,
|
|
2559
2559
|
kw: r,
|
|
@@ -2561,7 +2561,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2561
2561
|
}), B(e, n) && !J(o, n) && $(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Fe(e), n, Tt.length)), ht || (ht = !0, setTimeout(yt, 0)), 0) : (Ht(`gobj_post_event(): event NOT DEFINED in gclass ${Ue(e)}, event ${n}`), -1) : (Ht(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
2562
2562
|
}, exports.gobj_posted_events_size = function() {
|
|
2563
2563
|
return Tt.length;
|
|
2564
|
-
}, exports.gobj_publish_event = It, exports.gobj_read_attr = ot, exports.gobj_read_attrs = st, exports.gobj_read_bool_attr =
|
|
2564
|
+
}, exports.gobj_publish_event = It, exports.gobj_read_attr = ot, exports.gobj_read_attrs = st, exports.gobj_read_bool_attr = it, exports.gobj_read_integer_attr = lt, exports.gobj_read_pointer_attr = at, exports.gobj_read_str_attr = _t, exports.gobj_remove_persistent_attrs = function(e, t) {
|
|
2565
2565
|
return Ae(e) ? _ ? _(e, t) : -1 : (Ht(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2566
2566
|
}, exports.gobj_repr_global_trace_levels = function() {
|
|
2567
2567
|
return L.map(([e, t, n]) => ({
|
|
@@ -2584,7 +2584,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2584
2584
|
return 0;
|
|
2585
2585
|
}(e, T.SDF_VOLATIL, 0);
|
|
2586
2586
|
}, exports.gobj_save_persistent_attrs = function(e, t) {
|
|
2587
|
-
return Ae(e) ?
|
|
2587
|
+
return Ae(e) ? l ? l(e, t) : -1 : (Ht(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2588
2588
|
}, exports.gobj_search_path = nt, exports.gobj_send_event = jt, exports.gobj_services = function() {
|
|
2589
2589
|
let e = [];
|
|
2590
2590
|
for (const t of Object.keys(p)) un(e, t);
|
|
@@ -2620,19 +2620,19 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2620
2620
|
}, exports.gobj_short_name = Fe, exports.gobj_start = ye, exports.gobj_start_children = function(e) {
|
|
2621
2621
|
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : He(e, x.WALK_FIRST2LAST, je, 0, 0);
|
|
2622
2622
|
}, exports.gobj_start_tree = function(e) {
|
|
2623
|
-
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Ge(e))), e.gclass.gclass_flag &
|
|
2623
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Ge(e))), e.gclass.gclass_flag & S.gcflag_manual_start || e.disabled ? 0 : (e.running || ye(e), qe(e, x.WALK_TOP2BOTTOM, ve, 0, 0)));
|
|
2624
2624
|
}, exports.gobj_start_up = function(e, t, n, r, o, s, g) {
|
|
2625
|
-
|
|
2625
|
+
i = t, l = n, _ = r, a = o, u = s, c = g;
|
|
2626
2626
|
const p = [["EV_STATE_CHANGED", R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]];
|
|
2627
2627
|
for (let e = 0; e < p.length; e++) {
|
|
2628
2628
|
let t = p[e][0], n = p[e][1];
|
|
2629
|
-
|
|
2629
|
+
ie(f, t, n);
|
|
2630
2630
|
}
|
|
2631
2631
|
return 0;
|
|
2632
2632
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
2633
2633
|
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, n, r, s) : c ? c(e, n, r, s) : o(0, -1, t("%s, stats parser not available", Fe(e)), 0, 0);
|
|
2634
|
-
}, exports.gobj_stop =
|
|
2635
|
-
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Ge(e))), xe(e) &&
|
|
2634
|
+
}, exports.gobj_stop = Oe, exports.gobj_stop_children = Ne, exports.gobj_stop_tree = function(e) {
|
|
2635
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Ge(e))), xe(e) && Oe(e), qe(e, x.WALK_TOP2BOTTOM, Se, 0, 0));
|
|
2636
2636
|
}, exports.gobj_subscribe_event = xt, exports.gobj_trace_level = V, exports.gobj_trace_machine_format = function() {
|
|
2637
2637
|
return I;
|
|
2638
2638
|
}, exports.gobj_trace_no_level = M, exports.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
@@ -2648,23 +2648,23 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2648
2648
|
if (Object.keys(n).forEach((n) => {
|
|
2649
2649
|
o.has(n) || Ht(`${Fe(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2650
2650
|
}), vn(t)) t = "";
|
|
2651
|
-
else if (!(Et(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
2652
|
-
let s = Nt(e.dl_subscriptions, e, t, n, r),
|
|
2651
|
+
else if (!(Et(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & S.gcflag_no_check_output_events)) return Ht(`event NOT in output event list: ${Fe(e)}, ev ${t}`), 0;
|
|
2652
|
+
let s = Nt(e.dl_subscriptions, e, t, n, r), i = 0;
|
|
2653
2653
|
for (let t = 0; t < s.length; t++) {
|
|
2654
2654
|
let n = s[t];
|
|
2655
|
-
Rt(e, n, !1, !1),
|
|
2655
|
+
Rt(e, n, !1, !1), i++;
|
|
2656
2656
|
}
|
|
2657
|
-
return
|
|
2657
|
+
return i || (qt(`${Fe(e)}: No subscription found`), Xt(n, "No subscription found")), 0;
|
|
2658
2658
|
}, exports.gobj_unsubscribe_list = Dt, exports.gobj_walk_gobj_children = He, exports.gobj_walk_gobj_children_tree = qe, exports.gobj_write_attr = function(e, n, r, o) {
|
|
2659
2659
|
if (!mn(n)) return Ht(t("gobj_write_attr(%s): path must be a string", Fe(e))), -1;
|
|
2660
|
-
let s,
|
|
2661
|
-
if (
|
|
2660
|
+
let s, i = e.jn_attrs, l = n.split("`");
|
|
2661
|
+
if (l.length <= 1) {
|
|
2662
2662
|
let o = n;
|
|
2663
|
-
return o in
|
|
2663
|
+
return o in i && i.hasOwnProperty(o) ? (i[o] = r, dn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0) : (Ht(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), o)), -1);
|
|
2664
2664
|
}
|
|
2665
|
-
let _ =
|
|
2665
|
+
let _ = l.length;
|
|
2666
2666
|
for (let t = 0; t < _; t++) {
|
|
2667
|
-
s =
|
|
2667
|
+
s = l[t];
|
|
2668
2668
|
let n = tt(e, { __gobj_name__: s });
|
|
2669
2669
|
if (n && t < _ - 1) {
|
|
2670
2670
|
e = n;
|
|
@@ -2696,13 +2696,13 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2696
2696
|
let o = Pn(null, Pn(null, e, "topics", null, 0), t, null, 0);
|
|
2697
2697
|
if (!o) return Ht("jdb_delete: topic not found: " + t), null;
|
|
2698
2698
|
if (vn(r.id)) return Ht("jdb_delete: record without id: " + r), Qt(r), null;
|
|
2699
|
-
let s,
|
|
2700
|
-
for (; (s =
|
|
2701
|
-
if (0 ===
|
|
2702
|
-
let e = qn(
|
|
2703
|
-
e >= 0 &&
|
|
2699
|
+
let s, i = n.split("`"), l = o;
|
|
2700
|
+
for (; (s = i.shift()) && !vn(s) && l;) dn(l) && (l = Pn(null, l, e.hook, null, 0)), l = or(l, null, s, !1);
|
|
2701
|
+
if (0 === i.length && l) if (bn(l)) {
|
|
2702
|
+
let e = qn(l, r.id);
|
|
2703
|
+
e >= 0 && l.splice(e, 1);
|
|
2704
2704
|
} else {
|
|
2705
|
-
let t = Pn(null,
|
|
2705
|
+
let t = Pn(null, l, e.hook, null, 0), n = qn(t, r.id);
|
|
2706
2706
|
n >= 0 && t.splice(n, 1);
|
|
2707
2707
|
}
|
|
2708
2708
|
return o;
|
|
@@ -2728,12 +2728,12 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2728
2728
|
let o = Pn(null, Pn(null, e, "topics", null, 0), t, null, 0);
|
|
2729
2729
|
if (!o) return Ht("jdb_update: topic not found: " + t), null;
|
|
2730
2730
|
if (vn(r.id)) return Ht("jdb_update: record without id: " + r), Qt(r), null;
|
|
2731
|
-
let s,
|
|
2732
|
-
for (; (s =
|
|
2733
|
-
if (0 ===
|
|
2734
|
-
else if (
|
|
2731
|
+
let s, i = n.split("`"), l = o;
|
|
2732
|
+
for (; (s = i.shift()) && !vn(s) && l;) dn(l) && (l = Pn(null, l, e.hook, [], 1)), l = or(l, null, s, !1);
|
|
2733
|
+
if (0 === i.length && l) if (bn(l)) l.push(r);
|
|
2734
|
+
else if (l.id === r.id) Object.assign(l, r);
|
|
2735
2735
|
else {
|
|
2736
|
-
let t = Pn(null,
|
|
2736
|
+
let t = Pn(null, l, e.hook, [], 1), n = or(t, e.hook, r.id, !1);
|
|
2737
2737
|
n ? Object.assign(n, r) : t.push(r);
|
|
2738
2738
|
}
|
|
2739
2739
|
return o;
|
|
@@ -2791,27 +2791,27 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2791
2791
|
}, exports.kw_find_path = Dn, exports.kw_flag_t = $t, exports.kw_get_bool = kn, exports.kw_get_dict = Ln, exports.kw_get_dict_value = Pn, exports.kw_get_int = In, exports.kw_get_list = function(e, t, n, r, o) {
|
|
2792
2792
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
2793
2793
|
let s = Dn(e, t, n, !1);
|
|
2794
|
-
const
|
|
2794
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2795
2795
|
if (void 0 === s) {
|
|
2796
|
-
if (
|
|
2796
|
+
if (l) {
|
|
2797
2797
|
let o = Array(r);
|
|
2798
2798
|
return Un(e, t, n, o), o;
|
|
2799
2799
|
}
|
|
2800
|
-
return
|
|
2800
|
+
return i && (Ht(`path not found: '${n}'`), Xt(t)), Array(r);
|
|
2801
2801
|
}
|
|
2802
|
-
return _ && An(e, t, n), bn(s) ? Array(s) : (
|
|
2802
|
+
return _ && An(e, t, n), bn(s) ? Array(s) : (i && (Ht(`path value MUST BE an array: ${n}`), Qt(t)), Array(r));
|
|
2803
2803
|
}, exports.kw_get_local_storage_value = Kn, exports.kw_get_pointer = Cn, exports.kw_get_real = function(e, t, n, r, o) {
|
|
2804
2804
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
2805
2805
|
let s = Dn(e, t, n, !1);
|
|
2806
|
-
const
|
|
2806
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2807
2807
|
if (void 0 === s) {
|
|
2808
|
-
if (
|
|
2808
|
+
if (l) {
|
|
2809
2809
|
let o = Number(r);
|
|
2810
2810
|
return Un(e, t, n, o), o;
|
|
2811
2811
|
}
|
|
2812
|
-
return
|
|
2812
|
+
return i && (Ht(`path not found: '${n}'`), Xt(t)), Number(r);
|
|
2813
2813
|
}
|
|
2814
|
-
return _ && An(e, t, n), En(s) ? Number(s) : (
|
|
2814
|
+
return _ && An(e, t, n), En(s) ? Number(s) : (i && (Ht(`path value MUST BE a number: ${n}`), Qt(t)), Number(r));
|
|
2815
2815
|
}, exports.kw_get_str = $n, exports.kw_has_key = xn, exports.kw_match_simple = Vn, exports.kw_pop = Rn, exports.kw_remove_local_storage_value = Bn, exports.kw_select = function(e, t, n, r) {
|
|
2816
2816
|
if (e && !jn(e) && Ht("GObj bad instanceof"), !t) return null;
|
|
2817
2817
|
r || (r = Vn);
|
|
@@ -2828,7 +2828,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2828
2828
|
}, exports.kw_set_dict_value = Un, exports.kw_set_local_storage_value = Yn, exports.kw_set_subdict_value = Fn, exports.kwid_collect = Hn, exports.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2829
2829
|
e && !jn(e) && Ht("GObj bad instanceof");
|
|
2830
2830
|
let s = Hn(e, t, n, r, o);
|
|
2831
|
-
return s
|
|
2831
|
+
return s && 0 !== s.length ? s[0] : null;
|
|
2832
2832
|
}, exports.kwid_get_ids = function(e, t) {
|
|
2833
2833
|
if (e && !jn(e) && Ht("GObj bad instanceof"), !t) return [];
|
|
2834
2834
|
let n = [];
|
|
@@ -2847,11 +2847,22 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2847
2847
|
let r = {};
|
|
2848
2848
|
if (vn(n) || (t = Dn(e, t, n)), dn(t)) r = t;
|
|
2849
2849
|
else if (bn(t)) for (let n = 0; n < t.length; n++) {
|
|
2850
|
-
let o = t[n], s = $n(e, o, "id", "",
|
|
2850
|
+
let o = t[n], s = $n(e, o, "id", "", $t.KW_REQUIRED);
|
|
2851
2851
|
vn(s) || (r[s] = o);
|
|
2852
2852
|
}
|
|
2853
2853
|
else Ht(`${Fe(e)} kwid_new_dict: data type unknown`);
|
|
2854
2854
|
return r;
|
|
2855
|
+
}, exports.kwid_new_list = function(e, t, n) {
|
|
2856
|
+
if (e && !jn(e) && Ht("GObj bad instanceof"), vn(n) || (t = Dn(e, t, n)), bn(t)) return t;
|
|
2857
|
+
if (dn(t)) {
|
|
2858
|
+
let n = [];
|
|
2859
|
+
for (let r of Object.keys(t)) {
|
|
2860
|
+
let o = t[r];
|
|
2861
|
+
dn(o) ? (o.id = r, n.push(o)) : Ht(`${Fe(e)} kwid_new_list: not a record: '${r}'`);
|
|
2862
|
+
}
|
|
2863
|
+
return n;
|
|
2864
|
+
}
|
|
2865
|
+
return Ht(`${Fe(e)} kwid_new_list: wrong type for list`), [];
|
|
2855
2866
|
}, exports.list2options = function(e, t, n) {
|
|
2856
2867
|
t = t || "id", n = n || "value";
|
|
2857
2868
|
let r = [];
|
|
@@ -2902,7 +2913,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2902
2913
|
}, exports.log_debug = zt, exports.log_error = Ht, exports.log_info = function(e) {
|
|
2903
2914
|
let t = Jt(e), n = _r();
|
|
2904
2915
|
Ut && Wt("info", t) && Ut("%c" + n + " INFO: " + String(t), "color:cyan"), Yt("info", t, n);
|
|
2905
|
-
}, exports.log_warning = qt, exports.msg_iev_get_msg_type = nr, exports.msg_iev_get_stack = er, exports.msg_iev_push_stack = Zn, exports.msg_iev_read_key = Qn, exports.msg_iev_set_msg_type = tr, exports.msg_iev_write_key = Xn, exports.node_uuid = ur, exports.parseBoolean =
|
|
2916
|
+
}, exports.log_warning = qt, exports.msg_iev_get_msg_type = nr, exports.msg_iev_get_stack = er, exports.msg_iev_push_stack = Zn, exports.msg_iev_read_key = Qn, exports.msg_iev_set_msg_type = tr, exports.msg_iev_write_key = Xn, exports.node_uuid = ur, exports.parseBoolean = On, exports.parseSVG = function(e) {
|
|
2906
2917
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2907
2918
|
}, exports.refresh_language = function(e, t) {
|
|
2908
2919
|
if (!yn(t)) return void Ht("You must supply a translation function");
|
|
@@ -3020,21 +3031,21 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3020
3031
|
["EV_ON_OPEN_ERROR", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS],
|
|
3021
3032
|
["EV_TIMEOUT", 0],
|
|
3022
3033
|
[null, 0]
|
|
3023
|
-
], t, no, 0, Pr, Ur, 0, 0, 0,
|
|
3034
|
+
], t, no, 0, Pr, Ur, 0, 0, 0, S.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3024
3035
|
}("C_IEVENT_CLI");
|
|
3025
3036
|
}, exports.register_c_timer = function() {
|
|
3026
3037
|
return function(e) {
|
|
3027
|
-
if (
|
|
3038
|
+
if (Sr) return Ht(`GClass ALREADY created: ${e}`), -1;
|
|
3028
3039
|
const t = [["ST_IDLE", [[
|
|
3029
3040
|
"EV_TIMEOUT",
|
|
3030
3041
|
Nr,
|
|
3031
3042
|
null
|
|
3032
3043
|
]]]];
|
|
3033
|
-
return (
|
|
3044
|
+
return (Sr = ee(e, [
|
|
3034
3045
|
["EV_TIMEOUT", R.EVF_OUTPUT_EVENT],
|
|
3035
3046
|
["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT],
|
|
3036
3047
|
[0, 0]
|
|
3037
|
-
], t, wr, 0, vr,
|
|
3048
|
+
], t, wr, 0, vr, Or, 0, 0, 0, S.gcflag_manual_start)) ? 0 : -1;
|
|
3038
3049
|
}("C_TIMER");
|
|
3039
3050
|
}, exports.register_c_yuno = function() {
|
|
3040
3051
|
return function(e) {
|
|
@@ -3049,7 +3060,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3049
3060
|
}, exports.safeSrc = function(e) {
|
|
3050
3061
|
if (!e) return "";
|
|
3051
3062
|
const t = String(e).trim();
|
|
3052
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3063
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : ir(t);
|
|
3053
3064
|
}, exports.sdata_flag_t = T, exports.send_http_json_post = function(e, t, n) {
|
|
3054
3065
|
let r = new XMLHttpRequest();
|
|
3055
3066
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -3061,7 +3072,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3061
3072
|
Mt = "function" == typeof e ? e : null;
|
|
3062
3073
|
}, exports.set_log_callback = function(e) {
|
|
3063
3074
|
Gt = "function" == typeof e ? e : null;
|
|
3064
|
-
}, exports.set_remote_log_functions = Bt, exports.set_timeout = Rr, exports.set_timeout_periodic = xr, exports.sprintf = t, exports.stats_parser = function(e, t, n, r) {}, exports.str_in_list = zn, exports.strcasecmp = Nn, exports.strcmp =
|
|
3075
|
+
}, exports.set_remote_log_functions = Bt, exports.set_timeout = Rr, exports.set_timeout_periodic = xr, exports.sprintf = t, exports.stats_parser = function(e, t, n, r) {}, exports.str_in_list = zn, exports.strcasecmp = Nn, exports.strcmp = Sn, exports.strncmp = function(e, t, n) {
|
|
3065
3076
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
3066
3077
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
3067
3078
|
}, exports.strs_in_list = function(e, t, n) {
|
|
@@ -3110,9 +3121,9 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3110
3121
|
const n = e, r = performance.now();
|
|
3111
3122
|
let o = r;
|
|
3112
3123
|
return t && qt(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", s = "") => {
|
|
3113
|
-
const
|
|
3114
|
-
return t && qt(`--\x3e ${n} ${e} - partial: ${
|
|
3115
|
-
partial:
|
|
3124
|
+
const i = performance.now(), l = (i - o) / 1e3, _ = (i - r) / 1e3;
|
|
3125
|
+
return t && qt(`--\x3e ${n} ${e} - partial: ${l} sec, total: ${_} sec, ${s}`), o = i, {
|
|
3126
|
+
partial: l,
|
|
3116
3127
|
total: _
|
|
3117
3128
|
};
|
|
3118
3129
|
} };
|