@yuneta/gobj-js 7.13.8 → 7.16.1
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 +245 -5
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +660 -550
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +240 -6
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +958 -843
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +245 -5
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +796 -686
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +245 -5
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +796 -686
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +2 -2
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, l, i, _, 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 ((i = n[s]).keys) for (o = r[g], l = 0; l < i.keys.length; l++) {
|
|
25
|
+
if (null == o) throw new Error(t("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"", i.keys[l], i.keys[l - 1]));
|
|
26
|
+
o = o[i.keys[l]];
|
|
27
27
|
}
|
|
28
|
-
else o =
|
|
29
|
-
if (e.not_type.test(
|
|
30
|
-
switch (e.number.test(
|
|
28
|
+
else o = i.param_no ? r[i.param_no] : r[g++];
|
|
29
|
+
if (e.not_type.test(i.type) && e.not_primitive.test(i.type) && o instanceof Function && (o = o()), e.numeric_arg.test(i.type) && "number" != typeof o && isNaN(o)) throw new TypeError(t("[sprintf] expecting number but found %T", o));
|
|
30
|
+
switch (e.number.test(i.type) && (c = o >= 0), i.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, i.width ? parseInt(i.width) : 0);
|
|
43
43
|
break;
|
|
44
44
|
case "e":
|
|
45
|
-
o =
|
|
45
|
+
o = i.precision ? parseFloat(o).toExponential(i.precision) : parseFloat(o).toExponential();
|
|
46
46
|
break;
|
|
47
47
|
case "f":
|
|
48
|
-
o =
|
|
48
|
+
o = i.precision ? parseFloat(o).toFixed(i.precision) : parseFloat(o);
|
|
49
49
|
break;
|
|
50
50
|
case "g":
|
|
51
|
-
o =
|
|
51
|
+
o = i.precision ? String(Number(o.toPrecision(i.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 = i.precision ? o.substring(0, i.precision) : o;
|
|
58
58
|
break;
|
|
59
59
|
case "t":
|
|
60
|
-
o = String(!!o), o =
|
|
60
|
+
o = String(!!o), o = i.precision ? o.substring(0, i.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 = i.precision ? o.substring(0, i.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 = i.precision ? o.substring(0, i.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(i.type) ? d += o : (!e.number.test(i.type) || c && !i.sign ? f = "" : (f = c ? "+" : "-", o = o.toString().replace(e.sign, "")), a = i.pad_char ? "0" === i.pad_char ? "0" : i.pad_char.charAt(1) : " ", u = i.width - (f + o).length, _ = i.width && u > 0 ? a.repeat(u) : "", d += i.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 = [], l = 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
|
+
l |= 1;
|
|
89
|
+
var i = [], _ = 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 (i.push(a[1]); "" !== (_ = _.substring(a[0].length));) if (null !== (a = e.key_access.exec(_))) i.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
|
+
i.push(a[1]);
|
|
95
95
|
}
|
|
96
|
-
r[2] =
|
|
97
|
-
} else
|
|
98
|
-
if (3 ===
|
|
96
|
+
r[2] = i;
|
|
97
|
+
} else l |= 2;
|
|
98
|
+
if (3 === l) 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", l = null, i = 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,12 +166,12 @@ 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, l = null, i = 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 = l, this.fillspace = i, this.description = o, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
171
171
|
}
|
|
172
|
-
}, y = () => new h(0, null),
|
|
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 =
|
|
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, l, i, _) {
|
|
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 = l, this.s_user_trace_level = i, 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
|
}, S = class {
|
|
177
177
|
constructor(e, t, n, r, o) {
|
|
@@ -191,11 +191,11 @@ var h = class {
|
|
|
191
191
|
gobj_flag_pure_child: 16,
|
|
192
192
|
gobj_flag_autostart: 32,
|
|
193
193
|
gobj_flag_autoplay: 64
|
|
194
|
-
}),
|
|
194
|
+
}), w = Object.freeze({
|
|
195
195
|
obflag_destroying: 1,
|
|
196
196
|
obflag_destroyed: 2,
|
|
197
197
|
obflag_created: 4
|
|
198
|
-
}),
|
|
198
|
+
}), R = Object.freeze({
|
|
199
199
|
EVF_NO_WARN_SUBS: 1,
|
|
200
200
|
EVF_OUTPUT_EVENT: 2,
|
|
201
201
|
EVF_SYSTEM_EVENT: 4,
|
|
@@ -317,7 +317,7 @@ var C = Object.freeze({
|
|
|
317
317
|
]
|
|
318
318
|
], P = 0, U = 0, F = 0;
|
|
319
319
|
function G(e, t) {
|
|
320
|
-
if (
|
|
320
|
+
if (vn(e)) return 268369920;
|
|
321
321
|
if (/^[0-9]+$/.test(String(e))) {
|
|
322
322
|
const t = Number(e);
|
|
323
323
|
if (t) return t;
|
|
@@ -466,7 +466,7 @@ function z(e, t, n, r) {
|
|
|
466
466
|
break;
|
|
467
467
|
case E.DTP_POINTER: o = r;
|
|
468
468
|
}
|
|
469
|
-
return void 0 === o && qt(`${Fe(e)}: attr undefined: ${n.name}`), t[n.name] = o, dn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = o), e.obflag &
|
|
469
|
+
return void 0 === o && qt(`${Fe(e)}: attr undefined: ${n.name}`), t[n.name] = o, dn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = o), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
470
470
|
}
|
|
471
471
|
function Q(e) {
|
|
472
472
|
return e.jn_attrs;
|
|
@@ -475,7 +475,7 @@ function X(e, t, n) {
|
|
|
475
475
|
return rt(e, t) ? Q(e) : e && e.bottom_gobj ? X(e.bottom_gobj, t, n) : (n && qt(`GClass Attribute NOT FOUND: ${Fe(e)}, attr ${t}`), null);
|
|
476
476
|
}
|
|
477
477
|
function Z(e, t, n) {
|
|
478
|
-
if (!(e && e instanceof
|
|
478
|
+
if (!(e && e instanceof v)) return n && qt("gclass NULL"), null;
|
|
479
479
|
if (!t) return e.attrs_table;
|
|
480
480
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
481
481
|
const r = e.attrs_table[n];
|
|
@@ -483,30 +483,30 @@ function Z(e, t, n) {
|
|
|
483
483
|
}
|
|
484
484
|
return n && qt(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
485
485
|
}
|
|
486
|
-
function ee(e, t, n, r, o, s,
|
|
487
|
-
if (
|
|
486
|
+
function ee(e, t, n, r, o, s, l, i, _, a, u) {
|
|
487
|
+
if (vn(e)) return qt("gclass_name EMPTY"), null;
|
|
488
488
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return qt(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
489
489
|
if (ue(e)) return qt(`GClass ALREADY exists: ${e}`), null;
|
|
490
|
-
let c = new
|
|
490
|
+
let c = new v(e, r, o, s, l, i, _, a, u);
|
|
491
491
|
(function(e, t) {
|
|
492
|
-
e && e instanceof
|
|
492
|
+
e && e instanceof v ? t ? g[t] ? qt(`gclass ALREADY REGISTERED: ${t}`) : g[t] = e : qt("gclass_name undefined") : qt("gclass undefined");
|
|
493
493
|
})(c, e);
|
|
494
494
|
const f = n.length;
|
|
495
495
|
for (let e = 0; e < f; e++) {
|
|
496
496
|
let t = n[e][0], r = n[e][1];
|
|
497
|
-
if (
|
|
497
|
+
if (vn(t)) continue;
|
|
498
498
|
if (oe(c, t) < 0) return te(c), null;
|
|
499
499
|
const o = r.length;
|
|
500
500
|
for (let e = 0; e < o; e++) {
|
|
501
501
|
let n = r[e][0], o = r[e][1], s = r[e][2];
|
|
502
|
-
|
|
502
|
+
vn(n) || se(c, t, n, o, s);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
for (let e = 0; e < t.length; e++) {
|
|
506
506
|
let n = t[e][0], r = t[e][1];
|
|
507
|
-
if (!
|
|
507
|
+
if (!vn(n)) {
|
|
508
508
|
if (_e(c, n)) return qt(`SMachine: event repeated in input_events: ${n}`), te(c), null;
|
|
509
|
-
|
|
509
|
+
ie(c, n, r);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
if (!c.fsm_checked) {
|
|
@@ -519,7 +519,7 @@ function te(e) {
|
|
|
519
519
|
let t;
|
|
520
520
|
if (mn(e)) t = e;
|
|
521
521
|
else {
|
|
522
|
-
if (!(e instanceof
|
|
522
|
+
if (!(e instanceof v)) return qt("Cannot unregister gclass, type unknown"), -1;
|
|
523
523
|
t = e.gclass_name;
|
|
524
524
|
}
|
|
525
525
|
let n = g[t];
|
|
@@ -542,22 +542,22 @@ function re(e, t) {
|
|
|
542
542
|
return null;
|
|
543
543
|
}
|
|
544
544
|
function oe(e, t) {
|
|
545
|
-
return e instanceof
|
|
545
|
+
return e instanceof v ? ne(e, t) ? (qt(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (qt("Cannot add state, typeof not GClass"), -1);
|
|
546
546
|
}
|
|
547
547
|
function se(e, t, n, r, o) {
|
|
548
|
-
if (!(e instanceof
|
|
549
|
-
if (
|
|
548
|
+
if (!(e instanceof v)) return qt("Cannot add state, typeof not GClass"), -1;
|
|
549
|
+
if (vn(t)) return qt("state_name EMPTY"), -1;
|
|
550
550
|
let s = ne(e, t);
|
|
551
551
|
return s ? re(s, n) ? (qt(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (s.dl_actions.push(new x(n, r, o)), 0) : (qt(`state not found: ${t}`), -1);
|
|
552
552
|
}
|
|
553
|
-
function ie(e, t, n) {
|
|
554
|
-
jn(t) || e.push(new k(t, n));
|
|
555
|
-
}
|
|
556
553
|
function le(e, t, n) {
|
|
557
|
-
|
|
554
|
+
vn(t) || e.push(new k(t, n));
|
|
555
|
+
}
|
|
556
|
+
function ie(e, t, n) {
|
|
557
|
+
return e instanceof v ? le(e.dl_events, t, n) : (qt("Cannot add state, typeof not GClass"), -1);
|
|
558
558
|
}
|
|
559
559
|
function _e(e, t) {
|
|
560
|
-
if (!(e instanceof
|
|
560
|
+
if (!(e instanceof v)) return qt("Cannot add state, typeof not GClass"), 0;
|
|
561
561
|
const n = e.dl_events.length, r = e.dl_events;
|
|
562
562
|
for (let e = 0; e < n; e++) {
|
|
563
563
|
let n = r[e];
|
|
@@ -566,23 +566,23 @@ function _e(e, t) {
|
|
|
566
566
|
return null;
|
|
567
567
|
}
|
|
568
568
|
function ae(e) {
|
|
569
|
-
if (!(e instanceof
|
|
569
|
+
if (!(e instanceof v)) return qt("Cannot add state, typeof not GClass"), -1;
|
|
570
570
|
let t = 0;
|
|
571
571
|
gn(e.dl_states) || (qt(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
572
572
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
573
573
|
let r = e.dl_states[n];
|
|
574
|
-
if (!
|
|
574
|
+
if (!vn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
575
575
|
let o = r.dl_actions[n];
|
|
576
|
-
|
|
576
|
+
vn(o.event_name) || (_e(e, o.event_name) || (qt(`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 && (ne(e, o.next_state) || (qt(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
580
580
|
let r = e.dl_events[n];
|
|
581
|
-
if (!
|
|
581
|
+
if (!vn(r.event_name) && (En(r.event_flag) || (qt(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & R.EVF_OUTPUT_EVENT))) {
|
|
582
582
|
let n = !1;
|
|
583
583
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
584
584
|
let o = e.dl_states[t];
|
|
585
|
-
|
|
585
|
+
vn(o.state_name) || re(o, r.event_name) && (n = !0);
|
|
586
586
|
}
|
|
587
587
|
n || (qt(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
588
588
|
}
|
|
@@ -597,7 +597,7 @@ function ue(e, t) {
|
|
|
597
597
|
return n || (t && qt(`gclass not found: ${e}`), null);
|
|
598
598
|
}
|
|
599
599
|
function ce() {
|
|
600
|
-
return !b || b.obflag &
|
|
600
|
+
return !b || b.obflag & w.obflag_destroyed ? null : b;
|
|
601
601
|
}
|
|
602
602
|
function fe(e, t) {
|
|
603
603
|
e = e.toLowerCase();
|
|
@@ -622,9 +622,9 @@ function me(e, t, n) {
|
|
|
622
622
|
(function(e, t, n, r, o) {
|
|
623
623
|
if (!e || !t) return qt("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 && Ht(`${Fe(o)}: Deprecated attribute used in gobj creation: ${
|
|
625
|
+
for (const [l, i] of Object.entries(t)) {
|
|
626
|
+
const t = Z(o.gclass, l, !1);
|
|
627
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && Ht(`${Fe(o)}: Deprecated attribute used in gobj creation: ${l}`), s += z(o, e, t, i)) : r && (r(o, l), s--);
|
|
628
628
|
}
|
|
629
629
|
return s;
|
|
630
630
|
})(Q(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : be, e) < 0 && (qt(`${Fe(e)} json2data() FAILED`), Xt(r));
|
|
@@ -643,26 +643,26 @@ function Ee(e, n, r, o, s) {
|
|
|
643
643
|
if (b) return qt(`default service ALREADY registered: ${n}^${e}`), null;
|
|
644
644
|
s |= N.gobj_flag_service;
|
|
645
645
|
}
|
|
646
|
-
if (
|
|
647
|
-
let
|
|
648
|
-
if (!
|
|
646
|
+
if (vn(n)) return qt("gclass_name must be a string"), null;
|
|
647
|
+
let i = ue(n, !1);
|
|
648
|
+
if (!i) return qt(`GClass not registered: ${n}^${e}`), null;
|
|
649
649
|
if (!mn(e)) return qt(`gobj_name must be a string: ${n}`), null;
|
|
650
|
-
if (!
|
|
650
|
+
if (!vn(e)) {
|
|
651
651
|
if (e.includes("`")) return qt(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
652
652
|
if (e.includes("^")) return qt(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
653
653
|
}
|
|
654
|
-
let _ = new S(e,
|
|
655
|
-
_.jn_attrs = q(_,
|
|
654
|
+
let _ = new S(e, i, r, o, s);
|
|
655
|
+
_.jn_attrs = q(_, i.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", i.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 && l && l(_, 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 qt("gobj NULL or DESTROYED");
|
|
665
|
-
e.__refs__ > 0 && qt(`${Fe(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (qt(`Destroying a PLAYING gobj: ${Ge(e)}`),
|
|
665
|
+
e.__refs__ > 0 && qt(`${Fe(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (qt(`Destroying a PLAYING gobj: ${Ge(e)}`), Re(e)), e.running && (qt(`Destroying a RUNNING gobj: ${Ge(e)}`), Se(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);
|
|
@@ -679,7 +679,7 @@ function he(e) {
|
|
|
679
679
|
let n = t[e];
|
|
680
680
|
Ke(n) || he(n);
|
|
681
681
|
}
|
|
682
|
-
}(e), e.obflag &
|
|
682
|
+
}(e), e.obflag & w.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && $(t("💔💔⏪ destroyed: %s", Ge(e))), e.obflag |= w.obflag_destroyed, e.obflag & w.obflag_created && e.gclass.instances--;
|
|
683
683
|
}
|
|
684
684
|
function ye(e) {
|
|
685
685
|
if (Ke(e)) return qt("gobj NULL or DESTROYED"), -1;
|
|
@@ -689,16 +689,16 @@ function ye(e) {
|
|
|
689
689
|
let n = 0;
|
|
690
690
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function je(e, t, n) {
|
|
693
693
|
return e.gclass.gclass_flag & O.gcflag_manual_start || Ke(e) || De(e) || xe(e) || ye(e), 0;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function ve(e, t, n) {
|
|
696
696
|
return e.gclass.gclass_flag & O.gcflag_manual_start || xe(e) ? 1 : (De(e) || ye(e), 0);
|
|
697
697
|
}
|
|
698
698
|
function Se(e) {
|
|
699
699
|
if (Ke(e)) return qt("gobj NULL or DESTROYED"), -1;
|
|
700
700
|
if (!e.running) return qt(`${Fe(e)}: GObj NOT RUNNING`), -1;
|
|
701
|
-
e.playing && (Ht(`${Fe(e)}: GObj stopping without previous pause`),
|
|
701
|
+
e.playing && (Ht(`${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
|
}
|
|
@@ -708,7 +708,7 @@ function Oe(e, t, n) {
|
|
|
708
708
|
function Ne(e) {
|
|
709
709
|
return Ke(e) ? (qt("gobj NULL or DESTROYED"), -1) : qe(e, D.WALK_FIRST2LAST, Oe, 0, 0);
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function we(e) {
|
|
712
712
|
if (Ke(e)) return qt(`gobj NULL or DESTROYED: ${Fe(e)}`), -1;
|
|
713
713
|
if (e.playing) return qt(`${Fe(e)}: GObj ALREADY PLAYING`), -1;
|
|
714
714
|
if (e.disabled) return qt(`${Fe(e)}: GObj DISABLED`), -1;
|
|
@@ -720,7 +720,7 @@ function Re(e) {
|
|
|
720
720
|
let n = 0;
|
|
721
721
|
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function Re(e) {
|
|
724
724
|
return Ke(e) ? (qt("gobj NULL or DESTROYED"), -1) : e.playing ? (Y(e) && $(t("⏸ ⏸ pause: %s", Ge(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (qt(`${Fe(e)}: GObj NOT PLAYING`), -1);
|
|
725
725
|
}
|
|
726
726
|
function De(e) {
|
|
@@ -736,7 +736,7 @@ function ke(e) {
|
|
|
736
736
|
return !Ke(e) && e.playing;
|
|
737
737
|
}
|
|
738
738
|
function Ie() {
|
|
739
|
-
return !d || d.obflag &
|
|
739
|
+
return !d || d.obflag & w.obflag_destroyed ? null : d;
|
|
740
740
|
}
|
|
741
741
|
function $e() {
|
|
742
742
|
let e = Ie();
|
|
@@ -751,41 +751,41 @@ function Le() {
|
|
|
751
751
|
return e ? _t(e, "yuno_id") : "";
|
|
752
752
|
}
|
|
753
753
|
function Pe(e) {
|
|
754
|
-
return
|
|
754
|
+
return jn(e) ? e.gobj_name : (qt("gobj bad type"), null);
|
|
755
755
|
}
|
|
756
756
|
function Ue(e) {
|
|
757
|
-
return
|
|
757
|
+
return jn(e) ? e.gclass.gclass_name : (qt("gobj NULL of bad type"), null);
|
|
758
758
|
}
|
|
759
759
|
function Fe(e) {
|
|
760
|
-
return
|
|
760
|
+
return jn(e) ? e.gclass.gclass_name + "^" + Pe(e) : (qt("gobj bad type"), null);
|
|
761
761
|
}
|
|
762
762
|
function Ge(e) {
|
|
763
|
-
if (!
|
|
763
|
+
if (!jn(e)) return qt("gobj NULL of bad type"), null;
|
|
764
764
|
let t = Fe(e), n = Ve(e);
|
|
765
765
|
for (; n;) t = Fe(n) + "`" + t, n = Ve(n);
|
|
766
766
|
return t;
|
|
767
767
|
}
|
|
768
768
|
function Ve(e) {
|
|
769
|
-
return
|
|
769
|
+
return jn(e) ? e.parent : (qt("gobj NULL of bad type"), null);
|
|
770
770
|
}
|
|
771
771
|
function Me(e) {
|
|
772
|
-
return
|
|
772
|
+
return jn(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (qt("gobj NULL of bad type"), null);
|
|
773
773
|
}
|
|
774
774
|
function We(e) {
|
|
775
|
-
return
|
|
775
|
+
return jn(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (qt("gobj NULL of bad type"), null);
|
|
776
776
|
}
|
|
777
777
|
function Ke(e) {
|
|
778
|
-
return !
|
|
778
|
+
return !jn(e) || !!(e.obflag & (w.obflag_destroyed | w.obflag_destroying));
|
|
779
779
|
}
|
|
780
780
|
function Ye(e) {
|
|
781
|
-
return
|
|
781
|
+
return jn(e) ? e.bottom_gobj : (qt("gobj NULL of bad type"), null);
|
|
782
782
|
}
|
|
783
783
|
function Be(e, t) {
|
|
784
|
-
if (!
|
|
784
|
+
if (!jn(e)) return qt("gobj NULL of bad type"), null;
|
|
785
785
|
e.bottom_gobj && Ht(`${Fe(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
786
786
|
}
|
|
787
787
|
function Je(e, t, n) {
|
|
788
|
-
return
|
|
788
|
+
return jn(e) ? t ? Z(e.gclass, t, n) : e.gclass.attrs_table : (qt("gobj NULL of bad type"), null);
|
|
789
789
|
}
|
|
790
790
|
function qe(e, t, n, r, o) {
|
|
791
791
|
return Ke(e) ? (qt("gobj NULL, destroying, or bad type"), 0) : Qe(e.dl_children, t, n, r, o);
|
|
@@ -797,42 +797,42 @@ function ze(e) {
|
|
|
797
797
|
return "number" == typeof e && isFinite(e) ? e : (null == e || qt(`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 & D.WALK_LAST2FIRST) for (let e =
|
|
802
|
-
s =
|
|
800
|
+
let s, l = [...e];
|
|
801
|
+
if (t & D.WALK_LAST2FIRST) for (let e = l.length; e > 0; e--) {
|
|
802
|
+
s = l[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 < l.length; e++) {
|
|
807
|
+
s = l[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, l = Qe(e, t, n, r, o);
|
|
815
|
+
if (l < 0) return l;
|
|
816
816
|
if (t & D.WALK_LAST2FIRST) {
|
|
817
|
-
for (let
|
|
818
|
-
} else for (let
|
|
819
|
-
return
|
|
817
|
+
for (let i = e.length; i > 0; i--) if (s = e[i - 1], l = Xe([...s.dl_children], t, n, r, o), l < 0) return l;
|
|
818
|
+
} else for (let i = 0; i < e.length; i++) if (s = e[i], l = Xe([...s.dl_children], t, n, r, o), l < 0) return l;
|
|
819
|
+
return l;
|
|
820
820
|
}
|
|
821
821
|
function Ze(e, t, n, r, o) {
|
|
822
822
|
if (t & D.WALK_BYLEVEL) return Xe(e, t, n, r, o);
|
|
823
|
-
let s,
|
|
824
|
-
if (t & D.WALK_BOTTOM2TOP) for (let
|
|
825
|
-
if (
|
|
826
|
-
if (s = ze(n(
|
|
823
|
+
let s, l;
|
|
824
|
+
if (t & D.WALK_BOTTOM2TOP) for (let i = e.length; i > 0; i--) {
|
|
825
|
+
if (l = e[i - 1], s = Ze([...l.dl_children], t, n, r, o), s < 0) return s;
|
|
826
|
+
if (s = ze(n(l, r, o)), s < 0) return s;
|
|
827
827
|
}
|
|
828
|
-
else for (let
|
|
829
|
-
if (
|
|
830
|
-
if (0 === s && (s = Ze([...
|
|
828
|
+
else for (let i = 0; i < e.length; i++) {
|
|
829
|
+
if (l = e[i], s = ze(n(l, r, o)), s < 0) return s;
|
|
830
|
+
if (0 === s && (s = Ze([...l.dl_children], t, n, r, o), s < 0)) return s;
|
|
831
831
|
}
|
|
832
832
|
return 0;
|
|
833
833
|
}
|
|
834
834
|
function et(e, t) {
|
|
835
|
-
if (!
|
|
835
|
+
if (!jn(e)) return qt("gobj NULL of bad type"), !1;
|
|
836
836
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
837
837
|
t.__disabled__;
|
|
838
838
|
let s = t.__state__;
|
|
@@ -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 l = 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) && l[n] !== t[n]) return !1;
|
|
848
848
|
return !0;
|
|
849
849
|
}
|
|
850
850
|
function tt(e, t) {
|
|
@@ -876,7 +876,7 @@ function nt(e, t) {
|
|
|
876
876
|
return s ? (n.splice(0, 1), n = n.join("`"), nt(s, n)) : null;
|
|
877
877
|
}
|
|
878
878
|
function rt(e, t) {
|
|
879
|
-
return !
|
|
879
|
+
return !vn(t) && !!Z(e.gclass, t, !1);
|
|
880
880
|
}
|
|
881
881
|
function ot(e, t, n) {
|
|
882
882
|
let r = e.jn_attrs;
|
|
@@ -892,12 +892,12 @@ function st(e, t, n) {
|
|
|
892
892
|
const s = o[n];
|
|
893
893
|
if (s.name && (-1 === t || s.flag & t)) {
|
|
894
894
|
let t;
|
|
895
|
-
!e.gclass.gmt.mt_reading || e.obflag &
|
|
895
|
+
!e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? t = on(e.jn_attrs, s.name) : (t = e.gclass.gmt.mt_reading(e, s.name), void 0 === t && (t = on(e.jn_attrs, s.name))), ln(r, s.name, t);
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
return r;
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function lt(e, t) {
|
|
901
901
|
if (t) {
|
|
902
902
|
if (0 === Nn(t, "__disabled__")) return xe(e);
|
|
903
903
|
if (0 === Nn(t, "__running__")) return De(e);
|
|
@@ -905,41 +905,41 @@ function it(e, t) {
|
|
|
905
905
|
if (0 === Nn(t, "__service__")) return Ae(e);
|
|
906
906
|
}
|
|
907
907
|
let n = X(e, t, !1);
|
|
908
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag &
|
|
908
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (qt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function it(e, t) {
|
|
911
911
|
t && Nn(t, "__trace_level__");
|
|
912
912
|
let n = X(e, t, !1);
|
|
913
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag &
|
|
913
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (qt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
914
914
|
}
|
|
915
915
|
function _t(e, t) {
|
|
916
916
|
if (t && 0 === Nn(t, "__state__")) return dt(e);
|
|
917
917
|
let n = X(e, t, !1);
|
|
918
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag &
|
|
918
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (qt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
919
919
|
}
|
|
920
920
|
function at(e, t) {
|
|
921
921
|
let n = X(e, t, !1);
|
|
922
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag &
|
|
922
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (qt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
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, l] 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, l));
|
|
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] = Sn(n), dn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag &
|
|
934
|
+
return r ? (r[t] = Sn(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) : (qt(`${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);
|
|
938
|
-
return r ? (r[t] = parseInt(n), dn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag &
|
|
938
|
+
return r ? (r[t] = parseInt(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) : (qt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
939
939
|
}
|
|
940
940
|
function gt(e, t, n) {
|
|
941
941
|
let r = X(e, t, !1);
|
|
942
|
-
return r ? (r[t] = String(n), dn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag &
|
|
942
|
+
return r ? (r[t] = String(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) : (qt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
943
943
|
}
|
|
944
944
|
function pt(e, n) {
|
|
945
945
|
if (Ke(e)) return qt("gobj NULL or DESTROYED"), null;
|
|
@@ -953,10 +953,10 @@ function pt(e, n) {
|
|
|
953
953
|
return (o || s) && (1 === I || $(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ue(e), Pe(e), dt(e), e.last_state.state_name))), !0;
|
|
954
954
|
}
|
|
955
955
|
function dt(e) {
|
|
956
|
-
return
|
|
956
|
+
return jn(e) ? e.current_state.state_name : (qt("hgobj NULL"), "");
|
|
957
957
|
}
|
|
958
958
|
function bt(e, t, n) {
|
|
959
|
-
if (!
|
|
959
|
+
if (!jn(e)) return qt("gobj NULL of bad type"), null;
|
|
960
960
|
let r = _e(e.gclass, t);
|
|
961
961
|
if (r) return r;
|
|
962
962
|
if (n) {
|
|
@@ -974,7 +974,7 @@ function mt(e, t, n) {
|
|
|
974
974
|
}
|
|
975
975
|
function Et(e, t, n) {
|
|
976
976
|
let r = bt(e, t, !1);
|
|
977
|
-
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag &
|
|
977
|
+
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & R.EVF_OUTPUT_EVENT);
|
|
978
978
|
}
|
|
979
979
|
var Tt = [], ht = !1;
|
|
980
980
|
function yt() {
|
|
@@ -982,62 +982,62 @@ function yt() {
|
|
|
982
982
|
let e = Tt;
|
|
983
983
|
Tt = [];
|
|
984
984
|
let t = 0;
|
|
985
|
-
for (let n of e) n.dst.obflag & (
|
|
985
|
+
for (let n of e) n.dst.obflag & (w.obflag_destroyed | w.obflag_destroying) || (jt(n.dst, n.event, n.kw, n.src), t++);
|
|
986
986
|
return Tt.length > 0 && !ht && (ht = !0, setTimeout(yt, 0)), t;
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function jt(e, n, r, o) {
|
|
989
989
|
if (!(e && e instanceof S)) return qt("gobj dst NULL"), -1;
|
|
990
|
-
if (e.obflag & (
|
|
990
|
+
if (e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return qt("gobj dst DESTROYED"), -1;
|
|
991
991
|
let s = e.current_state;
|
|
992
992
|
if (!s) return qt(`${Fe(e)}: current_state NULL`), -1;
|
|
993
|
-
let
|
|
993
|
+
let l = B(e, n) && !J(o, n);
|
|
994
994
|
m++;
|
|
995
|
-
let
|
|
996
|
-
if (!
|
|
997
|
-
if (
|
|
995
|
+
let i = re(s, n);
|
|
996
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (m--, l && ($(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 && l > 1 && fn(r) && Xt(r)), e.gclass.gmt.mt_inject_event(e, n, r, o)) : (l && $(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))), qt(`📛📛 Event NOT DEFINED in state 📛📛: ${Fe(e)}, ${s.state_name}, ${n}`), m--, -1);
|
|
997
|
+
if (l) {
|
|
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
|
+
i.action && (r = cr(i.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
|
+
i.next_state && pt(e, i.next_state);
|
|
1006
1006
|
let _ = -1;
|
|
1007
1007
|
try {
|
|
1008
|
-
|
|
1008
|
+
i.action && (_ = i.action(e, n, r, o));
|
|
1009
1009
|
} finally {}
|
|
1010
|
-
return !
|
|
1010
|
+
return !l || 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
|
-
var
|
|
1012
|
+
var vt = Object.freeze({
|
|
1013
1013
|
__hard_subscription__: 1,
|
|
1014
1014
|
__own_event__: 2
|
|
1015
1015
|
}), St = [
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1016
|
+
j(E.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1017
|
+
j(E.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1018
|
+
j(E.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
1019
|
+
j(E.DTP_STRING, "renamed_event", 0, "", "rename event name"),
|
|
1020
|
+
j(E.DTP_INTEGER, "subs_flag", 0, 0, "subscription flag"),
|
|
1021
|
+
j(E.DTP_JSON, "__config__", 0, null, "subscription config"),
|
|
1022
|
+
j(E.DTP_JSON, "__global__", 0, null, "global kw, merge in publishing"),
|
|
1023
|
+
j(E.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1024
|
+
j(E.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1025
|
+
j(E.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1026
1026
|
y()
|
|
1027
1027
|
];
|
|
1028
1028
|
function Ot(e, t, n, r, o) {
|
|
1029
|
-
let s = Ln(t, r, "__config__", null),
|
|
1029
|
+
let s = Ln(t, r, "__config__", null), l = Ln(t, r, "__global__", null), i = 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(l) > 0) {
|
|
1035
1035
|
let t = Ln(null, e, "__global__", null);
|
|
1036
|
-
pn(t) > 0 && en(t,
|
|
1036
|
+
pn(t) > 0 && en(t, l) || (a = !1);
|
|
1037
1037
|
}
|
|
1038
|
-
if (pn(
|
|
1038
|
+
if (pn(i) > 0) {
|
|
1039
1039
|
let t = Ln(null, e, "__local__", null);
|
|
1040
|
-
pn(t) > 0 && en(t,
|
|
1040
|
+
pn(t) > 0 && en(t, i) || (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
|
-
Ot(
|
|
1050
|
+
for (let l = 0; l < e.length; l++) {
|
|
1051
|
+
let i = e[l];
|
|
1052
|
+
Ot(i, t, n, r, o) && an(s, i);
|
|
1053
1053
|
}
|
|
1054
1054
|
return s;
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function wt(e, t, n, r, o) {
|
|
1057
1057
|
for (let s = 0; s < e.length; s++) if (Ot(e[s], t, n, r, o)) return s;
|
|
1058
1058
|
return -1;
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
let s = Cn(e, n, "publisher", null, $t.KW_REQUIRED),
|
|
1062
|
-
if (!!(In(e, n, "subs_flag", null, $t.KW_REQUIRED) &
|
|
1063
|
-
d &&
|
|
1064
|
-
let _ =
|
|
1065
|
-
return _ >= 0 ? cn(s.dl_subscriptions, _) : (qt(`${Fe(e)}: subscription in publisher not found`), Xt(n)), _ =
|
|
1060
|
+
function Rt(e, n, r, o) {
|
|
1061
|
+
let s = Cn(e, n, "publisher", null, $t.KW_REQUIRED), l = Cn(e, n, "subscriber", null, $t.KW_REQUIRED), i = $n(e, n, "event", "", $t.KW_REQUIRED);
|
|
1062
|
+
if (!!(In(e, n, "subs_flag", null, $t.KW_REQUIRED) & vt.__hard_subscription__) && !r) return -1;
|
|
1063
|
+
d && lt(d, "trace_subscriptions") && ($(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", Fe(s), Fe(l))), 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, i, n, l);
|
|
1065
|
+
return _ >= 0 ? cn(s.dl_subscriptions, _) : (qt(`${Fe(e)}: subscription in publisher not found`), Xt(n)), _ = wt(l.dl_subscribings, s, i, n, l), _ >= 0 ? cn(l.dl_subscribings, _) : (qt(`${Fe(e)}: subscription in subscriber not found`), Xt(n)), 0;
|
|
1066
1066
|
}
|
|
1067
1067
|
function Dt(e, n, r, o) {
|
|
1068
1068
|
if (null == r && (r = {}), !e) return qt(`publisher NULL: ev ${n}`), 0;
|
|
@@ -1076,41 +1076,41 @@ function Dt(e, n, r, o) {
|
|
|
1076
1076
|
]);
|
|
1077
1077
|
if (Object.keys(r).forEach((t) => {
|
|
1078
1078
|
s.has(t) || qt(`${Fe(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1079
|
-
}),
|
|
1080
|
-
else if (!(Et(e, n,
|
|
1081
|
-
let
|
|
1082
|
-
gn(
|
|
1083
|
-
let
|
|
1079
|
+
}), vn(n)) n = "";
|
|
1080
|
+
else if (!(Et(e, n, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Fe(e)}, ${n}`), 0;
|
|
1081
|
+
let l = Nt(e.dl_subscriptions, e, n, r, o);
|
|
1082
|
+
gn(l) > 0 && (qt(`${Fe(e)}: ${gn(l)} subscription(s) REPEATED, will be deleted and override`), Xt(l, "subscription REPEATED"), xt(e, l, !1));
|
|
1083
|
+
let i = function(e, t, n, r) {
|
|
1084
1084
|
let o = q(e, St);
|
|
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), l = Ln(e, n, "__local__", null), i = 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), Dn(n, "__hard_subscription__")) {
|
|
1092
1092
|
let t = kn(e, n, "__hard_subscription__", !1);
|
|
1093
|
-
sn(n, "__hard_subscription__"), t && (s |=
|
|
1093
|
+
sn(n, "__hard_subscription__"), t && (s |= vt.__hard_subscription__);
|
|
1094
1094
|
}
|
|
1095
1095
|
if (Dn(n, "__own_event__")) {
|
|
1096
1096
|
let t = kn(e, n, "__own_event__", !1);
|
|
1097
|
-
sn(n, "__own_event__"), t && (s |=
|
|
1097
|
+
sn(n, "__own_event__"), t && (s |= vt.__own_event__);
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
|
-
pn(
|
|
1100
|
+
pn(l) > 0 && _n(o, "__local__", Zt(l)), pn(i) > 0 && _n(o, "__filter__", Zt(i)), 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) && (
|
|
1104
|
+
if (!i) return qt(`${Fe(e)}: _create_subscription() FAILED`), 0;
|
|
1105
|
+
if (an(e.dl_subscriptions, i), an(o.dl_subscribings, i), d && lt(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, i);
|
|
1107
|
+
(t < 0 || !1 === t) && (Rt(e, i, !0, !0), i = 0);
|
|
1108
1108
|
}
|
|
1109
|
-
return
|
|
1109
|
+
return i;
|
|
1110
1110
|
}
|
|
1111
1111
|
function xt(e, t, n) {
|
|
1112
1112
|
let r = [...t];
|
|
1113
|
-
for (let t = 0; t < r.length; t++)
|
|
1113
|
+
for (let t = 0; t < r.length; t++) Rt(e, r[t], n, !1);
|
|
1114
1114
|
return 0;
|
|
1115
1115
|
}
|
|
1116
1116
|
function At(e, t, n, r) {
|
|
@@ -1120,18 +1120,18 @@ function kt(e, t, n, r) {
|
|
|
1120
1120
|
return Nt(e.dl_subscribings, r, t, n, e);
|
|
1121
1121
|
}
|
|
1122
1122
|
function It(e, n, r) {
|
|
1123
|
-
if (dn(r) || (r = {}), !e || e.obflag & (
|
|
1124
|
-
if (
|
|
1123
|
+
if (dn(r) || (r = {}), !e || e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return qt("gobj NULL or DESTROYED"), -1;
|
|
1124
|
+
if (vn(n)) return qt(`${Fe(e)}: event EMPTY`), -1;
|
|
1125
1125
|
let o = bt(e, n, !0);
|
|
1126
|
-
if (!(o && o.event_flag & (
|
|
1127
|
-
let s = d &&
|
|
1126
|
+
if (!(o && o.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Fe(e)}, ev ${n}`), -1;
|
|
1127
|
+
let s = d && lt(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 l = [...e.dl_subscriptions], i = 0, _ = 0;
|
|
1133
|
+
for (let o = 0; o < l.length; o++) {
|
|
1134
|
+
let a = l[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;
|
|
@@ -1140,23 +1140,23 @@ function It(e, n, r) {
|
|
|
1140
1140
|
let u = Cn(e, a, "subscriber", null, $t.KW_REQUIRED);
|
|
1141
1141
|
if (!u || Ke(u)) continue;
|
|
1142
1142
|
let c = In(e, a, "subs_flag", 0, $t.KW_REQUIRED), f = $n(e, a, "event", "", $t.KW_REQUIRED);
|
|
1143
|
-
if (
|
|
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), l = 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
|
-
if (d && d.event_flag &
|
|
1150
|
-
|
|
1151
|
-
let b =
|
|
1152
|
-
if (b < 0 && c &
|
|
1153
|
-
|
|
1149
|
+
if (d && d.event_flag & R.EVF_SYSTEM_EVENT && !mt(u, d.event_name, 0)) continue;
|
|
1150
|
+
l && Rn(g, l), 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
|
+
let b = jt(u, n, g, e);
|
|
1152
|
+
if (b < 0 && c & vt.__own_event__) {
|
|
1153
|
+
i = -1;
|
|
1154
1154
|
break;
|
|
1155
1155
|
}
|
|
1156
|
-
if (_ += b,
|
|
1156
|
+
if (_ += b, i++, Ke(e)) break;
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
|
-
return
|
|
1159
|
+
return i || o && o.event_flag & R.EVF_NO_WARN_SUBS || Ht(`${Fe(e)}: Publish event WITHOUT subscribers, ev ${n}`), _;
|
|
1160
1160
|
}
|
|
1161
1161
|
var $t = Object.freeze({
|
|
1162
1162
|
KW_REQUIRED: 1,
|
|
@@ -1335,10 +1335,10 @@ function hn(e) {
|
|
|
1335
1335
|
function yn(e) {
|
|
1336
1336
|
return "function" == typeof e;
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function jn(e) {
|
|
1339
1339
|
return e instanceof S;
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function vn(e) {
|
|
1342
1342
|
return !mn(e) || 0 === e.length;
|
|
1343
1343
|
}
|
|
1344
1344
|
function Sn(e) {
|
|
@@ -1351,7 +1351,7 @@ function Nn(e, t) {
|
|
|
1351
1351
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1352
1352
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1354
|
+
function wn(e, t) {
|
|
1355
1355
|
if (dn(e) || dn(t) || bn(e) || bn(t)) return 0;
|
|
1356
1356
|
if (En(e) || En(t)) {
|
|
1357
1357
|
let n = Number(e), r = Number(t);
|
|
@@ -1363,8 +1363,8 @@ function Rn(e, t) {
|
|
|
1363
1363
|
}
|
|
1364
1364
|
return On(String(e), String(t));
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1367
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1366
|
+
function Rn(e, t) {
|
|
1367
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Rn(e, n);
|
|
1368
1368
|
else "string" == typeof t && delete e[t];
|
|
1369
1369
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1370
1370
|
}
|
|
@@ -1372,102 +1372,102 @@ function Dn(e, t) {
|
|
|
1372
1372
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1373
1373
|
}
|
|
1374
1374
|
function xn(e, t, n, r) {
|
|
1375
|
-
if (e && !
|
|
1375
|
+
if (e && !jn(e) && qt("GObj bad instanceof"), !dn(t) && !bn(t)) return qt(`${Fe(e)}: kw must be list or dict`), 0;
|
|
1376
1376
|
if (!mn(n)) return qt(`${Fe(e)}: path must be a string: ${String(n)}`), 0;
|
|
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 l = 0; l < s; l++) if (void 0 === (t = t[o[l]])) return void (r && qt(`${Fe(e)}: path not found: ${String(n)}`));
|
|
1381
1381
|
return t;
|
|
1382
1382
|
}
|
|
1383
1383
|
function An(e, t, n) {
|
|
1384
|
-
e && !
|
|
1384
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
1385
1385
|
let [r, o] = function(e, t) {
|
|
1386
1386
|
let n = e.lastIndexOf(t);
|
|
1387
1387
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1388
1388
|
}(n, "`");
|
|
1389
|
-
return
|
|
1389
|
+
return vn(o) ? sn(t, n) : sn(xn(e, t, r, !0), o), 0;
|
|
1390
1390
|
}
|
|
1391
1391
|
function kn(e, t, n, r, o) {
|
|
1392
|
-
e && !
|
|
1392
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
1393
1393
|
let s = xn(e, t, n, !1);
|
|
1394
|
-
const
|
|
1394
|
+
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1395
1395
|
if (void 0 === s) {
|
|
1396
|
-
if (
|
|
1396
|
+
if (i) {
|
|
1397
1397
|
let o = Boolean(r);
|
|
1398
1398
|
return Un(e, t, n, o), o;
|
|
1399
1399
|
}
|
|
1400
|
-
return
|
|
1400
|
+
return l && (qt(`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
|
-
e && !
|
|
1405
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
1406
1406
|
let s = xn(e, t, n, !1);
|
|
1407
|
-
const
|
|
1407
|
+
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1408
1408
|
if (void 0 === s) {
|
|
1409
|
-
if (
|
|
1409
|
+
if (i) {
|
|
1410
1410
|
let o = parseInt(r);
|
|
1411
1411
|
return Un(e, t, n, o), o;
|
|
1412
1412
|
}
|
|
1413
|
-
return
|
|
1413
|
+
return l && (qt(`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) : (l && (qt(`path value MUST BE a number: ${n}`), Qt(t)), parseInt(r));
|
|
1416
1416
|
}
|
|
1417
1417
|
function $n(e, t, n, r, o) {
|
|
1418
|
-
e && !
|
|
1418
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
1419
1419
|
let s = xn(e, t, n, !1);
|
|
1420
|
-
const
|
|
1420
|
+
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1421
1421
|
if (void 0 === s) {
|
|
1422
|
-
if (
|
|
1422
|
+
if (i) {
|
|
1423
1423
|
let o = String(r);
|
|
1424
1424
|
return Un(e, t, n, o), o;
|
|
1425
1425
|
}
|
|
1426
|
-
return
|
|
1426
|
+
return l && (qt(`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) : (l && (qt(`${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
|
-
e && !
|
|
1431
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
1432
1432
|
let s = xn(e, t, n, !1);
|
|
1433
|
-
const
|
|
1433
|
+
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1434
1434
|
if (void 0 === s) {
|
|
1435
|
-
if (
|
|
1435
|
+
if (i) {
|
|
1436
1436
|
let o = r;
|
|
1437
1437
|
return Un(e, t, n, o), o;
|
|
1438
1438
|
}
|
|
1439
|
-
return
|
|
1439
|
+
return l && (qt(`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
|
-
e && !
|
|
1444
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
1445
1445
|
let s = xn(e, t, n, !1);
|
|
1446
|
-
const
|
|
1446
|
+
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1447
1447
|
if (void 0 === s) {
|
|
1448
|
-
if (
|
|
1448
|
+
if (i) {
|
|
1449
1449
|
let o = Object(r);
|
|
1450
1450
|
return Un(e, t, n, o), o;
|
|
1451
1451
|
}
|
|
1452
|
-
return
|
|
1452
|
+
return l && (qt(`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) : (l && (qt(`path value MUST BE a dict: ${n}`), Qt(t)), Object(r));
|
|
1455
1455
|
}
|
|
1456
1456
|
function Pn(e, t, n, r, o) {
|
|
1457
|
-
e && !
|
|
1457
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
1458
1458
|
let s = xn(e, t, n, !1);
|
|
1459
|
-
const
|
|
1459
|
+
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1460
1460
|
if (void 0 === s) {
|
|
1461
|
-
if (
|
|
1461
|
+
if (i) {
|
|
1462
1462
|
let o = r;
|
|
1463
1463
|
return Un(e, t, n, o), o;
|
|
1464
1464
|
}
|
|
1465
|
-
return
|
|
1465
|
+
return l && (qt(`path not found: '${n}'`), Xt(t)), r;
|
|
1466
1466
|
}
|
|
1467
1467
|
return _ && An(e, t, n), s;
|
|
1468
1468
|
}
|
|
1469
1469
|
function Un(e, t, n, r) {
|
|
1470
|
-
if (e && !
|
|
1470
|
+
if (e && !jn(e) && qt("GObj bad instanceof"), !dn(t)) return qt("kw is not an object"), -1;
|
|
1471
1471
|
let o = n.split("`");
|
|
1472
1472
|
if (o.length <= 1) return t[n] = r, 0;
|
|
1473
1473
|
let s = o.length;
|
|
@@ -1478,7 +1478,7 @@ function Un(e, t, n, r) {
|
|
|
1478
1478
|
return 0;
|
|
1479
1479
|
}
|
|
1480
1480
|
function Fn(e, t, n, r, o) {
|
|
1481
|
-
if (e && !
|
|
1481
|
+
if (e && !jn(e) && qt("GObj bad instanceof"), !dn(t)) return qt("kw is not an object"), -1;
|
|
1482
1482
|
let s = Ln(e, t, n, {}, !0);
|
|
1483
1483
|
return dn(s) ? (s[r] = o, 0) : (qt("subdict is not an object"), -1);
|
|
1484
1484
|
}
|
|
@@ -1486,16 +1486,16 @@ 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 =
|
|
1489
|
+
for (let l = 0; l < n.length; l++) {
|
|
1490
|
+
let i = n[l];
|
|
1491
|
+
if (o = vn(r) ? t("%s", r) : t("%s`%d", r, l), s = Gn(e, i, o), s) break;
|
|
1492
1492
|
}
|
|
1493
1493
|
} else if (dn(n)) {
|
|
1494
1494
|
s = !0;
|
|
1495
|
-
let
|
|
1496
|
-
for (let
|
|
1497
|
-
let _ = i
|
|
1498
|
-
if (o =
|
|
1495
|
+
let l = Object.keys(n);
|
|
1496
|
+
for (let i = 0; i < l.length; i++) {
|
|
1497
|
+
let _ = l[i], a = n[_];
|
|
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;
|
|
1501
1501
|
}
|
|
@@ -1504,7 +1504,7 @@ function Gn(e, n, r) {
|
|
|
1504
1504
|
s = !1;
|
|
1505
1505
|
break;
|
|
1506
1506
|
}
|
|
1507
|
-
if (0 !==
|
|
1507
|
+
if (0 !== wn(u, a)) {
|
|
1508
1508
|
s = !1;
|
|
1509
1509
|
break;
|
|
1510
1510
|
}
|
|
@@ -1516,32 +1516,32 @@ function Vn(e, t) {
|
|
|
1516
1516
|
return 0 === pn(t) || Gn(e, t, "");
|
|
1517
1517
|
}
|
|
1518
1518
|
function Mn(e, t, n, r) {
|
|
1519
|
-
e && !
|
|
1519
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
1520
1520
|
let o = {};
|
|
1521
|
-
if (mn(n) && !
|
|
1521
|
+
if (mn(n) && !vn(n)) {
|
|
1522
1522
|
let s = n;
|
|
1523
1523
|
t.hasOwnProperty(s) ? o[s] = t[s] : r && qt(`${Fe(e)}: key not found: ${s}`);
|
|
1524
1524
|
} else if (dn(n) && fn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? o[s] = t[s] : r && qt(`${Fe(e)}: key not found: ${s}`);
|
|
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 l = n[s];
|
|
1529
|
+
t.hasOwnProperty(l) ? o[l] = t[l] : r && qt(`${Fe(e)}: key not found: ${l}`);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
return o;
|
|
1533
1533
|
}
|
|
1534
1534
|
function Wn(e, t, n, r) {
|
|
1535
1535
|
let o = {};
|
|
1536
|
-
if (tn(o, t), mn(n) && !
|
|
1536
|
+
if (tn(o, t), mn(n) && !vn(n)) {
|
|
1537
1537
|
let s = n;
|
|
1538
1538
|
Pn(e, t, s, 0, 0) ? sn(o, s) : r && qt(`${Fe(e)}: key not found: ${s}`);
|
|
1539
1539
|
} else if (dn(n) && fn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? sn(o, s) : r && qt(`${Fe(e)}: key not found: ${s}`);
|
|
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 l = n[s];
|
|
1544
|
+
t.hasOwnProperty(l) ? sn(o, l) : r && qt(`${Fe(e)}: key not found: ${l}`);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
return o;
|
|
@@ -1583,23 +1583,23 @@ function Jn(e, t) {
|
|
|
1583
1583
|
return !1;
|
|
1584
1584
|
}
|
|
1585
1585
|
function qn(e, t, n, r, o) {
|
|
1586
|
-
if (e && !
|
|
1586
|
+
if (e && !jn(e) && qt("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 l = 0; l < t.length; l++) {
|
|
1590
|
+
let i, _ = t[l];
|
|
1591
|
+
if (dn(_)) i = $n(e, _, "id", "", 0);
|
|
1592
1592
|
else {
|
|
1593
1593
|
if (!mn(_)) continue;
|
|
1594
|
-
|
|
1594
|
+
i = _;
|
|
1595
1595
|
}
|
|
1596
|
-
Jn(n,
|
|
1596
|
+
Jn(n, i) && o(_, r) && s.push(_);
|
|
1597
1597
|
}
|
|
1598
1598
|
else {
|
|
1599
1599
|
if (!dn(t)) return qt("kw_collect() BAD kw parameter"), null;
|
|
1600
1600
|
for (let e of Object.keys(t)) {
|
|
1601
|
-
let
|
|
1602
|
-
Jn(n, e) && o(
|
|
1601
|
+
let l = t[e];
|
|
1602
|
+
Jn(n, e) && o(l, r) && s.push(l);
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
1605
|
return s;
|
|
@@ -1634,7 +1634,7 @@ function Xn(e, t, n) {
|
|
|
1634
1634
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1635
1635
|
}
|
|
1636
1636
|
function Zn(e, t, n, r) {
|
|
1637
|
-
if (!
|
|
1637
|
+
if (!jn(e)) return qt("gobj is not a GObj"), null;
|
|
1638
1638
|
if (!t) return;
|
|
1639
1639
|
let o = Qn(t, n);
|
|
1640
1640
|
o || (o = [], Xn(t, n, o));
|
|
@@ -1645,13 +1645,13 @@ function Zn(e, t, n, r) {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
1647
|
function er(e, t, n, r) {
|
|
1648
|
-
if (!
|
|
1648
|
+
if (!jn(e)) return qt("gobj is not a GObj"), null;
|
|
1649
1649
|
if (!dn(t)) return qt("kw is not a dict"), null;
|
|
1650
1650
|
let o = Qn(t, n);
|
|
1651
1651
|
return o ? 0 === o.length ? (r && qt(`stack empty: ${n}`), null) : o[0] : (r && qt(`stack NOT FOUND: ${n}`), null);
|
|
1652
1652
|
}
|
|
1653
1653
|
function tr(e, t, n) {
|
|
1654
|
-
return
|
|
1654
|
+
return vn(n) ? An(e, t, "__md_iev__`__msg_type__") : Fn(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1655
1655
|
}
|
|
1656
1656
|
function nr(e, t) {
|
|
1657
1657
|
return $n(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
@@ -1716,10 +1716,10 @@ function sr(e) {
|
|
|
1716
1716
|
signature: t(n[2])
|
|
1717
1717
|
};
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1719
|
+
function lr(e) {
|
|
1720
1720
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1721
1721
|
}
|
|
1722
|
-
function
|
|
1722
|
+
function ir(e) {
|
|
1723
1723
|
const t = document.createElement("template");
|
|
1724
1724
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1725
1725
|
}
|
|
@@ -1740,10 +1740,39 @@ function cr(e) {
|
|
|
1740
1740
|
let t = null;
|
|
1741
1741
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
1742
1742
|
}
|
|
1743
|
-
|
|
1743
|
+
var fr = 256, gr = 1e5;
|
|
1744
|
+
function pr(e) {
|
|
1745
|
+
const t = String(e).replace(/`/g, "``");
|
|
1746
|
+
return "[" === t[0] ? "[" + t : t;
|
|
1747
|
+
}
|
|
1748
|
+
function dr(e) {
|
|
1749
|
+
if ("string" != typeof e) return null;
|
|
1750
|
+
let t = [], n = "";
|
|
1751
|
+
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
1752
|
+
else {
|
|
1753
|
+
if ("`" === e[r + 1]) {
|
|
1754
|
+
n += "`", r++;
|
|
1755
|
+
continue;
|
|
1756
|
+
}
|
|
1757
|
+
t.push(n), n = "";
|
|
1758
|
+
}
|
|
1759
|
+
return t.push(n), t.map((e) => {
|
|
1760
|
+
const t = function(e) {
|
|
1761
|
+
if ("string" != typeof e || e.length < 3 || "[" !== e[0]) return null;
|
|
1762
|
+
if ("]" !== e[e.length - 1]) return null;
|
|
1763
|
+
const t = e.slice(1, -1);
|
|
1764
|
+
return /^[0-9]+$/.test(t) ? t.length > 1 && "0" === t[0] ? null : parseInt(t, 10) : null;
|
|
1765
|
+
}(e);
|
|
1766
|
+
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
function br(e, t) {
|
|
1770
|
+
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
1771
|
+
}
|
|
1772
|
+
function mr(e) {
|
|
1744
1773
|
return "persistent-attrs-" + Fe(e);
|
|
1745
1774
|
}
|
|
1746
|
-
function
|
|
1775
|
+
function Er(e, t) {
|
|
1747
1776
|
if (mn(t)) {
|
|
1748
1777
|
if (-1 === t.indexOf("^")) {
|
|
1749
1778
|
let n, r, o = e.fkey;
|
|
@@ -1773,7 +1802,7 @@ function gr(e, t) {
|
|
|
1773
1802
|
hook_name: t.hook_name
|
|
1774
1803
|
} : (qt("bad fkey 3"), qt(e), qt(t), null);
|
|
1775
1804
|
}
|
|
1776
|
-
var
|
|
1805
|
+
var Tr = [
|
|
1777
1806
|
"string",
|
|
1778
1807
|
"integer",
|
|
1779
1808
|
"object",
|
|
@@ -1783,7 +1812,7 @@ var pr = [
|
|
|
1783
1812
|
"real",
|
|
1784
1813
|
"boolean",
|
|
1785
1814
|
"blob"
|
|
1786
|
-
],
|
|
1815
|
+
], hr = [
|
|
1787
1816
|
"persistent",
|
|
1788
1817
|
"required",
|
|
1789
1818
|
"notnull",
|
|
@@ -1795,7 +1824,7 @@ var pr = [
|
|
|
1795
1824
|
"stats",
|
|
1796
1825
|
"rstats",
|
|
1797
1826
|
"pstats"
|
|
1798
|
-
],
|
|
1827
|
+
], yr = [
|
|
1799
1828
|
"hook",
|
|
1800
1829
|
"fkey",
|
|
1801
1830
|
"enum",
|
|
@@ -1822,7 +1851,7 @@ var pr = [
|
|
|
1822
1851
|
"coordinates",
|
|
1823
1852
|
"gbuffer"
|
|
1824
1853
|
];
|
|
1825
|
-
function
|
|
1854
|
+
function jr(e) {
|
|
1826
1855
|
let t = {
|
|
1827
1856
|
name: e.id,
|
|
1828
1857
|
header: e.header,
|
|
@@ -1840,7 +1869,7 @@ function mr(e) {
|
|
|
1840
1869
|
if (!e.flag) return t;
|
|
1841
1870
|
for (let n = 0; n < e.flag.length; n++) {
|
|
1842
1871
|
let r = e.flag[n];
|
|
1843
|
-
if (zn(
|
|
1872
|
+
if (zn(yr, r)) {
|
|
1844
1873
|
switch (r) {
|
|
1845
1874
|
case "enum":
|
|
1846
1875
|
t.enum_list = e.enum;
|
|
@@ -1851,7 +1880,7 @@ function mr(e) {
|
|
|
1851
1880
|
case "table": t.enum_list = e.table;
|
|
1852
1881
|
}
|
|
1853
1882
|
t.type = r;
|
|
1854
|
-
} else if (zn(
|
|
1883
|
+
} else if (zn(hr, r)) switch (r) {
|
|
1855
1884
|
case "writable":
|
|
1856
1885
|
t.is_writable = !0;
|
|
1857
1886
|
break;
|
|
@@ -1864,36 +1893,36 @@ function mr(e) {
|
|
|
1864
1893
|
}
|
|
1865
1894
|
return t;
|
|
1866
1895
|
}
|
|
1867
|
-
var
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1896
|
+
var vr = [
|
|
1897
|
+
j(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1898
|
+
j(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1899
|
+
j(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1871
1900
|
y()
|
|
1872
|
-
],
|
|
1901
|
+
], Sr = {
|
|
1873
1902
|
periodic: !1,
|
|
1874
1903
|
msec: 0,
|
|
1875
1904
|
timer_id: -1
|
|
1876
|
-
},
|
|
1877
|
-
function
|
|
1905
|
+
}, Or = null;
|
|
1906
|
+
function Nr(e, t, n, r) {
|
|
1878
1907
|
let o = e.priv, s = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1879
1908
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
1880
|
-
|
|
1881
|
-
}, o.msec) : o.timer_id = -1, We(e) ?
|
|
1909
|
+
jt(e, "EV_TIMEOUT", {}, e);
|
|
1910
|
+
}, o.msec) : o.timer_id = -1, We(e) ? jt(Ve(e), s, {}, e) : It(e, s, {}), o.periodic || -1 !== o.timer_id || De(e) && Se(e), 0;
|
|
1882
1911
|
}
|
|
1883
|
-
var
|
|
1912
|
+
var wr = {
|
|
1884
1913
|
mt_create: function(e) {
|
|
1885
1914
|
let t = e.priv;
|
|
1886
1915
|
const n = at(e, "subscriber");
|
|
1887
|
-
n && Dt(e, null, {}, n), t.periodic =
|
|
1916
|
+
n && Dt(e, null, {}, n), t.periodic = lt(e, "periodic"), t.msec = it(e, "msec");
|
|
1888
1917
|
},
|
|
1889
1918
|
mt_writing: function(e, t) {
|
|
1890
1919
|
let n = e.priv;
|
|
1891
1920
|
switch (t) {
|
|
1892
1921
|
case "periodic":
|
|
1893
|
-
n.periodic =
|
|
1922
|
+
n.periodic = lt(e, "periodic");
|
|
1894
1923
|
break;
|
|
1895
|
-
case "msec": n.msec =
|
|
1896
|
-
|
|
1924
|
+
case "msec": n.msec = it(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
1925
|
+
jt(e, "EV_TIMEOUT", {}, e);
|
|
1897
1926
|
}, n.msec)), n.msec > 0 ? De(e) || ye(e) : De(e) && Se(e);
|
|
1898
1927
|
}
|
|
1899
1928
|
},
|
|
@@ -1905,84 +1934,84 @@ var vr = {
|
|
|
1905
1934
|
},
|
|
1906
1935
|
mt_destroy: function(e) {}
|
|
1907
1936
|
};
|
|
1908
|
-
function
|
|
1937
|
+
function Rr(e, t) {
|
|
1909
1938
|
return e instanceof S ? "C_TIMER" !== Ue(e) ? (qt("not C_TIMER GObj"), -1) : (ct(e, "periodic", !1), void ft(e, "msec", t)) : (qt("not GObj TYPE"), -1);
|
|
1910
1939
|
}
|
|
1911
|
-
function
|
|
1940
|
+
function Dr(e, t) {
|
|
1912
1941
|
return e instanceof S ? "C_TIMER" !== Ue(e) ? (qt("not C_TIMER GObj"), -1) : (ct(e, "periodic", !0), void ft(e, "msec", t)) : (qt("not GObj TYPE"), -1);
|
|
1913
1942
|
}
|
|
1914
|
-
function
|
|
1943
|
+
function xr(e) {
|
|
1915
1944
|
return e instanceof S ? "C_TIMER" !== Ue(e) ? (qt("not C_TIMER GObj"), -1) : void ft(e, "msec", -1) : (qt("not GObj TYPE"), -1);
|
|
1916
1945
|
}
|
|
1917
|
-
var
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1946
|
+
var Ar = [
|
|
1947
|
+
j(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
1948
|
+
j(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
1949
|
+
j(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
1950
|
+
j(E.DTP_STRING, "start_date", 0, "", "Yuno starting date"),
|
|
1951
|
+
j(E.DTP_STRING, "node_uuid", 0, "", "uuid of node"),
|
|
1952
|
+
j(E.DTP_STRING, "yuno_role", 0, "", "Yuno role"),
|
|
1953
|
+
j(E.DTP_STRING, "yuno_id", 0, "", "Yuno Id. Set by agent"),
|
|
1954
|
+
j(E.DTP_STRING, "yuno_name", 0, "", "Yuno name. Set by agent"),
|
|
1955
|
+
j(E.DTP_STRING, "yuno_tag", 0, "", "Tags of yuno. Set by agent"),
|
|
1956
|
+
j(E.DTP_STRING, "yuno_release", 0, "", "Yuno Release. Set by agent"),
|
|
1957
|
+
j(E.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
1958
|
+
j(E.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
1959
|
+
j(E.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
1960
|
+
j(E.DTP_INTEGER, "tracing", 0, 0, "Tracing level"),
|
|
1961
|
+
j(E.DTP_BOOLEAN, "trace_timer", 0, 0, "Trace timers"),
|
|
1962
|
+
j(E.DTP_BOOLEAN, "trace_inter_event", 0, 0, "Trace traffic"),
|
|
1963
|
+
j(E.DTP_POINTER, "trace_ievent_callback", 0, null, "Trace traffic callback"),
|
|
1964
|
+
j(E.DTP_BOOLEAN, "trace_creation", 0, 0, "Trace creation"),
|
|
1965
|
+
j(E.DTP_BOOLEAN, "trace_start_stop", 0, 0, "Trace start/stop"),
|
|
1966
|
+
j(E.DTP_BOOLEAN, "trace_subscriptions", 0, 0, "Trace subscription"),
|
|
1967
|
+
j(E.DTP_BOOLEAN, "trace_i18n", 0, 0, "Trace i18n"),
|
|
1968
|
+
j(E.DTP_BOOLEAN, "no_poll", 0, 0, "no poll"),
|
|
1969
|
+
j(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
1970
|
+
j(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
1942
1971
|
y()
|
|
1943
|
-
],
|
|
1944
|
-
function
|
|
1972
|
+
], kr = { gobj_timer: null }, Ir = null;
|
|
1973
|
+
function $r(e, t, n, r) {
|
|
1945
1974
|
return It(e, t, n), 0;
|
|
1946
1975
|
}
|
|
1947
|
-
var
|
|
1976
|
+
var Cr = {
|
|
1948
1977
|
mt_create: function(e) {
|
|
1949
1978
|
let t = e.priv;
|
|
1950
1979
|
gt(e, "start_date", _r()), gt(e, "node_uuid", ur()), e.priv.gobj_timer = Te(Pe(e), "C_TIMER", {}, e), t.periodic_timeout = ot(e, "periodic_timeout");
|
|
1951
1980
|
},
|
|
1952
1981
|
mt_writing: function(e, t) {},
|
|
1953
1982
|
mt_start: function(e) {
|
|
1954
|
-
return
|
|
1983
|
+
return Dr(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
1955
1984
|
},
|
|
1956
1985
|
mt_stop: function(e) {
|
|
1957
|
-
return
|
|
1986
|
+
return xr(e.priv.gobj_timer), Ne(e), 0;
|
|
1958
1987
|
},
|
|
1959
1988
|
mt_destroy: function(e) {},
|
|
1960
1989
|
mt_play: function(e) {
|
|
1961
1990
|
let t = ce();
|
|
1962
|
-
return De(t) || ye(t), ke(t) ||
|
|
1991
|
+
return De(t) || ye(t), ke(t) || we(t), 0;
|
|
1963
1992
|
},
|
|
1964
1993
|
mt_pause: function(e) {
|
|
1965
|
-
return
|
|
1994
|
+
return Re(ce()), 0;
|
|
1966
1995
|
}
|
|
1967
1996
|
};
|
|
1968
|
-
var
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1997
|
+
var Lr = "ievent_gate_stack", Pr = [
|
|
1998
|
+
j(E.DTP_STRING, "wanted_yuno_role", T.SDF_RD, "", "wanted yuno role"),
|
|
1999
|
+
j(E.DTP_STRING, "wanted_yuno_name", T.SDF_RD, "", "wanted yuno name"),
|
|
2000
|
+
j(E.DTP_STRING, "wanted_yuno_service", T.SDF_RD, "", "wanted yuno service"),
|
|
2001
|
+
j(E.DTP_STRING, "remote_yuno_role", T.SDF_RD, "", "confirmed remote yuno role"),
|
|
2002
|
+
j(E.DTP_STRING, "remote_yuno_name", T.SDF_RD, "", "confirmed remote yuno name"),
|
|
2003
|
+
j(E.DTP_STRING, "remote_yuno_service", T.SDF_RD, "", "confirmed remote yuno service"),
|
|
2004
|
+
j(E.DTP_STRING, "url", T.SDF_RD, "", "Url to connect"),
|
|
2005
|
+
j(E.DTP_STRING, "jwt", T.SDF_PERSIST, "", "JWT"),
|
|
2006
|
+
j(E.DTP_STRING, "cert_pem", T.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2007
|
+
j(E.DTP_JSON, "extra_info", T.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2008
|
+
j(E.DTP_LIST, "required_services", T.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."),
|
|
2009
|
+
j(E.DTP_INTEGER, "timeout_retry", T.SDF_RD, "5000", "First reconnect delay (ms). It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
2010
|
+
j(E.DTP_INTEGER, "timeout_retry_max", T.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2011
|
+
j(E.DTP_INTEGER, "timeout_idack", T.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2012
|
+
j(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
1984
2013
|
y()
|
|
1985
|
-
],
|
|
2014
|
+
], Ur = {
|
|
1986
2015
|
url: null,
|
|
1987
2016
|
remote_yuno_name: null,
|
|
1988
2017
|
remote_yuno_role: null,
|
|
@@ -1992,8 +2021,8 @@ var Ar = "ievent_gate_stack", kr = [
|
|
|
1992
2021
|
websocket: null,
|
|
1993
2022
|
inside_on_open: !1,
|
|
1994
2023
|
retry_ms: 0
|
|
1995
|
-
},
|
|
1996
|
-
function
|
|
2024
|
+
}, Fr = null;
|
|
2025
|
+
function Gr(e) {
|
|
1997
2026
|
e.priv.websocket && qt("Websocket ALREADY setup");
|
|
1998
2027
|
const t = _t(e, "url");
|
|
1999
2028
|
let n;
|
|
@@ -2004,20 +2033,20 @@ function Cr(e) {
|
|
|
2004
2033
|
return qt(`${Fe(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
2005
2034
|
}
|
|
2006
2035
|
return n ? (n.onopen = () => {
|
|
2007
|
-
|
|
2036
|
+
jt(e, "EV_ON_OPEN", { url: t }, e);
|
|
2008
2037
|
}, n.onmessage = (n) => {
|
|
2009
|
-
|
|
2038
|
+
jt(e, "EV_ON_MESSAGE", {
|
|
2010
2039
|
url: t,
|
|
2011
2040
|
data: n.data
|
|
2012
2041
|
}, e);
|
|
2013
2042
|
}, n.onclose = (n) => {
|
|
2014
|
-
Ke(e) || (
|
|
2043
|
+
Ke(e) || (lt(Ie(), "browser_beforeunload") ? Ht("Close websocket by unload page") : jt(e, "EV_ON_CLOSE", {
|
|
2015
2044
|
url: t,
|
|
2016
2045
|
e: n
|
|
2017
2046
|
}, e));
|
|
2018
2047
|
}, n) : (qt(`${Fe(e)}: Failed to initialize WebSocket.`), null);
|
|
2019
2048
|
}
|
|
2020
|
-
function
|
|
2049
|
+
function Vr(e, t = 1e3, n = "") {
|
|
2021
2050
|
let r = e.priv, o = r.websocket;
|
|
2022
2051
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
2023
2052
|
zt(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
@@ -2028,7 +2057,7 @@ function Lr(e, t = 1e3, n = "") {
|
|
|
2028
2057
|
}
|
|
2029
2058
|
} else Ht("WebSocket is already closed or in the process of closing.");
|
|
2030
2059
|
}
|
|
2031
|
-
function
|
|
2060
|
+
function Mr(e, t, n) {
|
|
2032
2061
|
let r = _r();
|
|
2033
2062
|
try {
|
|
2034
2063
|
zt("\n" + r + " " + t + "\n"), Xt(n);
|
|
@@ -2036,17 +2065,17 @@ function Pr(e, t, n) {
|
|
|
2036
2065
|
zt("ERROR in trace_inter_event: " + e);
|
|
2037
2066
|
}
|
|
2038
2067
|
}
|
|
2039
|
-
var
|
|
2068
|
+
var Wr = class {
|
|
2040
2069
|
constructor(e, t) {
|
|
2041
2070
|
this.event = e, this.kw = t || {};
|
|
2042
2071
|
}
|
|
2043
2072
|
};
|
|
2044
|
-
function
|
|
2073
|
+
function Kr(e, t, n, r) {
|
|
2045
2074
|
return function(e, t) {
|
|
2046
2075
|
let n = e.priv, r = JSON.stringify(t);
|
|
2047
|
-
if (
|
|
2076
|
+
if (lt(Ie(), "trace_inter_event")) {
|
|
2048
2077
|
let n = _t(e, "url"), o = Pe(Ie()) + " ==> " + n, s = ot(Ie(), "trace_ievent_callback");
|
|
2049
|
-
s ? s(o, t, 1, r.length) :
|
|
2078
|
+
s ? s(o, t, 1, r.length) : Mr(0, o, t);
|
|
2050
2079
|
}
|
|
2051
2080
|
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return Ht(`${Fe(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2052
2081
|
try {
|
|
@@ -2056,11 +2085,11 @@ function Fr(e, t, n, r) {
|
|
|
2056
2085
|
}
|
|
2057
2086
|
return 0;
|
|
2058
2087
|
}(e, function(e, t) {
|
|
2059
|
-
return
|
|
2088
|
+
return vn(e) ? (qt("iev_create() event NULL"), null) : new Wr(e, t);
|
|
2060
2089
|
}(t, n));
|
|
2061
2090
|
}
|
|
2062
|
-
function
|
|
2063
|
-
return
|
|
2091
|
+
function Yr(e, t, n) {
|
|
2092
|
+
return vn(n) && (n = _t(e, "wanted_yuno_service")), {
|
|
2064
2093
|
dst_yuno: _t(e, "wanted_yuno_name"),
|
|
2065
2094
|
dst_role: _t(e, "wanted_yuno_role"),
|
|
2066
2095
|
dst_service: n,
|
|
@@ -2070,14 +2099,14 @@ function Gr(e, t, n) {
|
|
|
2070
2099
|
host: ur()
|
|
2071
2100
|
};
|
|
2072
2101
|
}
|
|
2073
|
-
function
|
|
2074
|
-
let t = e.priv, n = ke(Ie()), r = _t(Ie(), "yuno_version"), o = _t(Ie(), "yuno_release"),
|
|
2075
|
-
|
|
2102
|
+
function Br(e) {
|
|
2103
|
+
let t = e.priv, n = ke(Ie()), r = _t(Ie(), "yuno_version"), o = _t(Ie(), "yuno_release"), l = _t(Ie(), "yuno_tag"), i = ot(e, "required_services");
|
|
2104
|
+
i && i.length || (i = ot(Ie(), "required_services"));
|
|
2076
2105
|
let _ = {
|
|
2077
2106
|
yuno_role: Ce(),
|
|
2078
2107
|
yuno_id: Le(),
|
|
2079
2108
|
yuno_name: $e(),
|
|
2080
|
-
yuno_tag:
|
|
2109
|
+
yuno_tag: l,
|
|
2081
2110
|
yuno_version: r,
|
|
2082
2111
|
yuno_release: o,
|
|
2083
2112
|
yuneta_version: s,
|
|
@@ -2091,87 +2120,87 @@ function Vr(e) {
|
|
|
2091
2120
|
id: ur(),
|
|
2092
2121
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2093
2122
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2094
|
-
required_services:
|
|
2123
|
+
required_services: i
|
|
2095
2124
|
};
|
|
2096
|
-
return Zn(e, _,
|
|
2125
|
+
return Zn(e, _, Lr, Yr(e, Pe(Ve(e)), null)), tr(e, _, "__identity__"), Rr(t.gobj_timer, it(e, "timeout_idack")), Kr(e, "EV_IDENTITY_CARD", _);
|
|
2097
2126
|
}
|
|
2098
|
-
function
|
|
2099
|
-
if (
|
|
2100
|
-
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__,
|
|
2127
|
+
function Jr(e, t) {
|
|
2128
|
+
if (vn(t.event)) return -1;
|
|
2129
|
+
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__, l = t.__service__, i = t.subscriber;
|
|
2101
2130
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
2102
|
-
return Zn(e, n,
|
|
2131
|
+
return Zn(e, n, Lr, Yr(e, Pe(i), l)), tr(e, n, "__subscribing__"), Kr(e, t.event, n);
|
|
2103
2132
|
}
|
|
2104
|
-
function
|
|
2133
|
+
function qr(e, t, n, r) {
|
|
2105
2134
|
let o = e.priv;
|
|
2106
|
-
return De(e) && (o.websocket =
|
|
2135
|
+
return De(e) && (o.websocket = Gr(e)), 0;
|
|
2107
2136
|
}
|
|
2108
|
-
function
|
|
2109
|
-
return zt("Websocket opened: " + e.priv.url),
|
|
2137
|
+
function Hr(e, t, n, r) {
|
|
2138
|
+
return zt("Websocket opened: " + e.priv.url), Br(e), 0;
|
|
2110
2139
|
}
|
|
2111
|
-
function
|
|
2112
|
-
let o = e.priv, s = n.e,
|
|
2113
|
-
return Bt(), Ht(`${Fe(e)}: WebSocket closed ${
|
|
2114
|
-
url:
|
|
2140
|
+
function zr(e, t, n, r) {
|
|
2141
|
+
let o = e.priv, s = n.e, l = n.url;
|
|
2142
|
+
return Bt(), Ht(`${Fe(e)}: WebSocket closed ${l} (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", {
|
|
2143
|
+
url: l,
|
|
2115
2144
|
remote_yuno_name: o.remote_yuno_name,
|
|
2116
2145
|
remote_yuno_role: o.remote_yuno_role,
|
|
2117
2146
|
remote_yuno_service: o.remote_yuno_service
|
|
2118
|
-
})) : (Ht(`${Fe(e)}: EV_ON_OPEN_ERROR cannot open ${
|
|
2119
|
-
url:
|
|
2147
|
+
})) : (Ht(`${Fe(e)}: EV_ON_OPEN_ERROR cannot open ${l} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), It(e, "EV_ON_OPEN_ERROR", {
|
|
2148
|
+
url: l,
|
|
2120
2149
|
remote_yuno_name: o.remote_yuno_name,
|
|
2121
2150
|
remote_yuno_role: o.remote_yuno_role,
|
|
2122
2151
|
remote_yuno_service: o.remote_yuno_service,
|
|
2123
2152
|
code: s.code,
|
|
2124
2153
|
reason: s.reason,
|
|
2125
2154
|
was_clean: s.wasClean
|
|
2126
|
-
})), De(e) &&
|
|
2127
|
-
let t = e.priv, n =
|
|
2155
|
+
})), De(e) && Rr(o.gobj_timer, function(e) {
|
|
2156
|
+
let t = e.priv, n = it(e, "timeout_retry"), r = it(e, "timeout_retry_max");
|
|
2128
2157
|
r < n && (r = n);
|
|
2129
2158
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2130
2159
|
let o = .2 * t.retry_ms, s = t.retry_ms - o + 2 * Math.random() * o;
|
|
2131
2160
|
return Math.max(1, Math.round(s));
|
|
2132
2161
|
}(e)), 0;
|
|
2133
2162
|
}
|
|
2134
|
-
function
|
|
2135
|
-
return
|
|
2163
|
+
function Qr(e, t, n, r) {
|
|
2164
|
+
return Br(e), 0;
|
|
2136
2165
|
}
|
|
2137
|
-
function
|
|
2166
|
+
function Xr(e, t, n, r) {
|
|
2138
2167
|
let o = e.priv;
|
|
2139
|
-
|
|
2140
|
-
let s = er(e, n,
|
|
2141
|
-
gt(e, "remote_yuno_name",
|
|
2168
|
+
xr(o.gobj_timer);
|
|
2169
|
+
let s = er(e, n, Lr, !0), l = $n(e, s, "src_yuno", ""), i = $n(e, s, "src_role", ""), _ = $n(e, s, "src_service", "");
|
|
2170
|
+
gt(e, "remote_yuno_name", l), gt(e, "remote_yuno_role", i), gt(e, "remote_yuno_service", _);
|
|
2142
2171
|
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", {});
|
|
2143
2172
|
if (a < 0) {
|
|
2144
|
-
|
|
2173
|
+
Vr(e);
|
|
2145
2174
|
let t = {
|
|
2146
2175
|
url: _t(e, "url"),
|
|
2147
2176
|
result: a,
|
|
2148
2177
|
comment: u,
|
|
2149
2178
|
username: c,
|
|
2150
|
-
remote_yuno_name:
|
|
2151
|
-
remote_yuno_role:
|
|
2179
|
+
remote_yuno_name: l,
|
|
2180
|
+
remote_yuno_role: i,
|
|
2152
2181
|
remote_yuno_service: _
|
|
2153
2182
|
};
|
|
2154
|
-
We(e) ?
|
|
2183
|
+
We(e) ? jt(Ve(e), "EV_ON_ID_NAK", t, e) : It(e, "EV_ON_ID_NAK", t);
|
|
2155
2184
|
} else {
|
|
2156
2185
|
if (pt(e, "ST_SESSION"), o.inside_on_open = !0, o.retry_ms = 0, !o.inform_on_close) {
|
|
2157
2186
|
o.inform_on_close = !0;
|
|
2158
2187
|
let t = {
|
|
2159
2188
|
username: c,
|
|
2160
|
-
remote_yuno_name:
|
|
2161
|
-
remote_yuno_role:
|
|
2189
|
+
remote_yuno_name: l,
|
|
2190
|
+
remote_yuno_role: i,
|
|
2162
2191
|
remote_yuno_service: _,
|
|
2163
2192
|
services_roles: f
|
|
2164
2193
|
};
|
|
2165
|
-
We(e) ?
|
|
2194
|
+
We(e) ? jt(Ve(e), "EV_ON_OPEN", t, e) : It(e, "EV_ON_OPEN", t);
|
|
2166
2195
|
}
|
|
2167
2196
|
o.inside_on_open = !1, function(e) {
|
|
2168
2197
|
let t = At(e, null, null, null);
|
|
2169
|
-
for (let n = 0; n < t.length; n++)
|
|
2198
|
+
for (let n = 0; n < t.length; n++) Jr(e, t[n]);
|
|
2170
2199
|
}(e);
|
|
2171
2200
|
}
|
|
2172
2201
|
return 0;
|
|
2173
2202
|
}
|
|
2174
|
-
function
|
|
2203
|
+
function Zr(e, t, n, r) {
|
|
2175
2204
|
let o = e.priv.url, s = function(e, t) {
|
|
2176
2205
|
let n;
|
|
2177
2206
|
try {
|
|
@@ -2189,38 +2218,37 @@ function qr(e, t, n, r) {
|
|
|
2189
2218
|
kw: o || {}
|
|
2190
2219
|
} : (qt("parsing inter_event: kw not a json object"), null) : (qt("parsing inter_kw: no kw"), null);
|
|
2191
2220
|
}(0, n.data);
|
|
2192
|
-
if (
|
|
2221
|
+
if (lt(Ie(), "trace_inter_event")) {
|
|
2193
2222
|
let e = Pe(Ie()) + " <== " + o, t = n.data.length, r = ot(Ie(), "trace_ievent_callback");
|
|
2194
|
-
r ? r(e, s, 2, t) :
|
|
2223
|
+
r ? r(e, s, 2, t) : Mr(0, e, s);
|
|
2195
2224
|
}
|
|
2196
|
-
let
|
|
2225
|
+
let l = s.event, i = s.kw;
|
|
2197
2226
|
if ("ST_SESSION" !== dt(e)) {
|
|
2198
|
-
if (mt(e,
|
|
2199
|
-
if (!(
|
|
2200
|
-
} else qt(`${Fe(e)}: event UNKNOWN in not-session state ${
|
|
2201
|
-
return
|
|
2227
|
+
if (mt(e, l, R.EVF_PUBLIC_EVENT)) {
|
|
2228
|
+
if (!(jt(e, l, i, e) < 0)) return 0;
|
|
2229
|
+
} else qt(`${Fe(e)}: event UNKNOWN in not-session state ${l}`);
|
|
2230
|
+
return Vr(e), -1;
|
|
2202
2231
|
}
|
|
2203
2232
|
s = null;
|
|
2204
|
-
let _ = nr(e,
|
|
2233
|
+
let _ = nr(e, i), a = er(e, i, Lr), u = $n(e, a, "dst_role", "");
|
|
2205
2234
|
if (u.toLowerCase() !== Ce().toLowerCase()) return qt(`"It's not my role, dst_role: ${u}, my_role: ${Ce()}`), 0;
|
|
2206
2235
|
let c = $n(e, a, "dst_service", "");
|
|
2207
2236
|
if ("__subscribing__" === _) return -1;
|
|
2208
2237
|
if ("__unsubscribing__" === _) return -1;
|
|
2209
|
-
if (mt(e,
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
return 0;
|
|
2238
|
+
if (mt(e, l, R.EVF_PUBLIC_EVENT)) return jt(e, l, i, e), 0;
|
|
2239
|
+
if (!vn(c)) {
|
|
2240
|
+
let t = fe(c, !1);
|
|
2241
|
+
return t ? mt(t, l, R.EVF_PUBLIC_EVENT) ? (jt(t, l, i, e), 0) : (qt(`${Fe(e)}: Service found but no event or not public, service '${Fe(t)}', ev '${l}'`), -1) : (Ht(`${Fe(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${l}'`), 0);
|
|
2242
|
+
}
|
|
2243
|
+
return We(e) ? jt(Ve(e), l, i, e) : It(e, l, i), 0;
|
|
2216
2244
|
}
|
|
2217
|
-
function
|
|
2245
|
+
function eo(e, t, n, r) {
|
|
2218
2246
|
return 0;
|
|
2219
2247
|
}
|
|
2220
|
-
function
|
|
2248
|
+
function to(e, t, n, r) {
|
|
2221
2249
|
return 0;
|
|
2222
2250
|
}
|
|
2223
|
-
var
|
|
2251
|
+
var no = {
|
|
2224
2252
|
mt_create: function(e) {
|
|
2225
2253
|
let t = e.priv;
|
|
2226
2254
|
t.gobj_timer = Te(Pe(e), "C_TIMER", {}, e), t.url = _t(e, "url"), t.remote_yuno_name = _t(e, "remote_yuno_name"), t.remote_yuno_role = _t(e, "remote_yuno_role"), t.remote_yuno_service = _t(e, "remote_yuno_service"), gt(e, "wanted_yuno_name", t.remote_yuno_name), gt(e, "wanted_yuno_role", t.remote_yuno_role), gt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -2244,55 +2272,55 @@ var Qr = {
|
|
|
2244
2272
|
},
|
|
2245
2273
|
mt_start: function(e) {
|
|
2246
2274
|
let t = e.priv;
|
|
2247
|
-
return t.retry_ms = 0, t.websocket =
|
|
2275
|
+
return t.retry_ms = 0, t.websocket = Gr(e), 0;
|
|
2248
2276
|
},
|
|
2249
2277
|
mt_stop: function(e) {
|
|
2250
2278
|
let t = e.priv;
|
|
2251
|
-
return
|
|
2279
|
+
return xr(t.gobj_timer), t.websocket && Vr(e), 0;
|
|
2252
2280
|
},
|
|
2253
2281
|
mt_destroy: function(e) {},
|
|
2254
2282
|
mt_stats: function(e, t, n, r) {
|
|
2255
2283
|
if ("ST_SESSION" !== dt(e)) return qt("Not in session"), null;
|
|
2256
2284
|
n || (n = {});
|
|
2257
|
-
let o =
|
|
2285
|
+
let o = Yr(e, Pe(r), $n(e, n, "service", null, 0)), s = Pn(e, n, "__md_stats__", null, $t.KW_EXTRACT);
|
|
2258
2286
|
return s || (s = {}), Zn(e, n, "stats_stack", {
|
|
2259
2287
|
stats: t,
|
|
2260
2288
|
kw: s
|
|
2261
|
-
}), Zn(e, n,
|
|
2289
|
+
}), Zn(e, n, Lr, o), n.__stats__ = t, tr(e, n, "__stats__"), Kr(e, "EV_MT_STATS", n, r), null;
|
|
2262
2290
|
},
|
|
2263
2291
|
mt_command_parser: function(e, t, n, r) {
|
|
2264
2292
|
if ("ST_SESSION" !== dt(e)) return qt("Not in session"), null;
|
|
2265
2293
|
n || (n = {});
|
|
2266
|
-
let o =
|
|
2294
|
+
let o = Yr(e, Pe(r), $n(e, n, "service", "", 0)), s = Pn(e, n, "__md_command__", null, $t.KW_EXTRACT);
|
|
2267
2295
|
return s || (s = {}), Zn(e, n, "command_stack", {
|
|
2268
2296
|
command: t,
|
|
2269
2297
|
kw: s
|
|
2270
|
-
}), Zn(e, n,
|
|
2298
|
+
}), Zn(e, n, Lr, o), n.__command__ = t, tr(e, n, "__command__"), Kr(e, "EV_MT_COMMAND", n, r), null;
|
|
2271
2299
|
},
|
|
2272
2300
|
mt_inject_event: function(e, t, n, r) {
|
|
2273
2301
|
if ("ST_SESSION" !== dt(e)) return window.console.error("Not in session"), -1;
|
|
2274
|
-
if (n || (n = {}), er(e, n,
|
|
2302
|
+
if (n || (n = {}), er(e, n, Lr));
|
|
2275
2303
|
else {
|
|
2276
|
-
let o =
|
|
2277
|
-
sn(n, "__service__"), Zn(e, n, "__message__", t), Zn(e, n,
|
|
2304
|
+
let o = Yr(e, Pe(r), $n(e, n, "__service__", 0, 0));
|
|
2305
|
+
sn(n, "__service__"), Zn(e, n, "__message__", t), Zn(e, n, Lr, o);
|
|
2278
2306
|
}
|
|
2279
|
-
return tr(e, n, "__message__"),
|
|
2307
|
+
return tr(e, n, "__message__"), Kr(e, t, n, r);
|
|
2280
2308
|
},
|
|
2281
2309
|
mt_subscription_added: function(e, t) {
|
|
2282
2310
|
let n = e.priv;
|
|
2283
|
-
return "ST_SESSION" === dt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2311
|
+
return "ST_SESSION" === dt(e) && n.websocket ? n.inside_on_open ? 0 : Jr(e, t) : 0;
|
|
2284
2312
|
},
|
|
2285
2313
|
mt_subscription_deleted: function(e, t) {
|
|
2286
2314
|
let n = e.priv;
|
|
2287
2315
|
if ("ST_SESSION" !== dt(e) || !n.websocket) return 0;
|
|
2288
2316
|
if (n.inside_on_open) return 0;
|
|
2289
|
-
if (
|
|
2290
|
-
let r = {}, o = t.__global__, s = t.__config__,
|
|
2291
|
-
s && (r.__config__ = s), o && (r.__global__ = o),
|
|
2292
|
-
return Zn(e, r,
|
|
2317
|
+
if (vn(t.event)) return 0;
|
|
2318
|
+
let r = {}, o = t.__global__, s = t.__config__, l = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2319
|
+
s && (r.__config__ = s), o && (r.__global__ = o), l && (r.__filter__ = l);
|
|
2320
|
+
return Zn(e, r, Lr, Yr(e, Pe(_), i)), tr(e, r, "__unsubscribing__"), Kr(e, t.event, r, e);
|
|
2293
2321
|
}
|
|
2294
2322
|
};
|
|
2295
|
-
exports.GObj = S, exports.SDATA =
|
|
2323
|
+
exports.GObj = S, 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, l) => new h(e, t, n, null, l, 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__", {
|
|
2296
2324
|
enumerable: !0,
|
|
2297
2325
|
get: function() {
|
|
2298
2326
|
return d;
|
|
@@ -2303,25 +2331,25 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2303
2331
|
return t;
|
|
2304
2332
|
}, exports.build_stats_response = o, exports.clean_name = function(e) {
|
|
2305
2333
|
return e.replace(/[?# ^:]/g, "_");
|
|
2306
|
-
}, exports.clear_timeout =
|
|
2307
|
-
let [r, o, s,
|
|
2334
|
+
}, exports.clear_timeout = xr, exports.cmp_two_simple_json = wn, exports.command_parser = function(e, t, n, r) {}, exports.createElement2 = function e(t, n) {
|
|
2335
|
+
let [r, o, s, l] = t;
|
|
2308
2336
|
if (!r) return void qt("Tag must be a valid HTML element.");
|
|
2309
|
-
let
|
|
2337
|
+
let i = document.createElement(r), _ = "";
|
|
2310
2338
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2311
2339
|
let t = "";
|
|
2312
2340
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
2313
|
-
|
|
2314
|
-
} else "style" === e ?
|
|
2315
|
-
if (mn(s)) if (s = s.trim(), s.length > 0 && "<" === s[0])
|
|
2316
|
-
else if (n && _)
|
|
2317
|
-
else
|
|
2341
|
+
i.style.cssText = t;
|
|
2342
|
+
} 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] && (_ = o[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, o[e]);
|
|
2343
|
+
if (mn(s)) if (s = s.trim(), s.length > 0 && "<" === s[0]) i.appendChild(ir(s));
|
|
2344
|
+
else if (n && _) i.textContent = n(_) || s;
|
|
2345
|
+
else i.textContent = s;
|
|
2318
2346
|
else if (bn(s)) {
|
|
2319
|
-
if (s.length > 0) if (mn(s[0]))
|
|
2320
|
-
else for (let t of s) Array.isArray(t) && t.length > 0 ?
|
|
2321
|
-
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ?
|
|
2322
|
-
if (
|
|
2323
|
-
return
|
|
2324
|
-
}, exports.createOneHtml =
|
|
2347
|
+
if (s.length > 0) if (mn(s[0])) i.appendChild(e(s, n));
|
|
2348
|
+
else for (let t of s) Array.isArray(t) && t.length > 0 ? i.appendChild(e(t, n)) : t instanceof HTMLElement && i.appendChild(t);
|
|
2349
|
+
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? i.appendChild(s) : null != s && (qt("content ignored"), Xt(s));
|
|
2350
|
+
if (l && "object" == typeof l) for (const e of Object.keys(l)) i.addEventListener(e, l[e]);
|
|
2351
|
+
return i;
|
|
2352
|
+
}, exports.createOneHtml = ir, exports.create_json_record = function(e, t) {
|
|
2325
2353
|
let n = Zt(e);
|
|
2326
2354
|
return nn(n, t), n;
|
|
2327
2355
|
}, exports.create_template_record = function(e, t) {
|
|
@@ -2333,34 +2361,34 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2333
2361
|
n[e] = s;
|
|
2334
2362
|
}), n;
|
|
2335
2363
|
}, exports.current_timestamp = _r, exports.data_type_t = E, exports.db_list_persistent_attrs = function(e, t) {
|
|
2336
|
-
let n = Kn(
|
|
2364
|
+
let n = Kn(mr(e), null, !1), r = {};
|
|
2337
2365
|
return n && dn(n) && (r = Mn(e, n, t, !1)), r;
|
|
2338
2366
|
}, exports.db_load_persistent_attrs = function(e, t) {
|
|
2339
|
-
let n = st(e, T.SDF_PERSIST), r = Kn(
|
|
2367
|
+
let n = st(e, T.SDF_PERSIST), r = Kn(mr(e), null, !1);
|
|
2340
2368
|
if (r && dn(r)) {
|
|
2341
2369
|
let o = Mn(e, r, t, !1);
|
|
2342
2370
|
o = Mn(e, o, n, !1), ut(e, o, T.SDF_PERSIST);
|
|
2343
2371
|
}
|
|
2344
2372
|
}, exports.db_remove_persistent_attrs = function(e, t) {
|
|
2345
|
-
let n = Wn(e, Kn(
|
|
2346
|
-
0 === fn(n) ? Bn(
|
|
2373
|
+
let n = Wn(e, Kn(mr(e), null, !1), t, !1);
|
|
2374
|
+
0 === fn(n) ? Bn(mr(e)) : Yn(mr(e), n);
|
|
2347
2375
|
}, exports.db_save_persistent_attrs = function(e, t) {
|
|
2348
|
-
let n = Mn(e, st(e, T.SDF_PERSIST), t, !1), r = Kn(
|
|
2349
|
-
return r && dn(r) && rn(n, r), Yn(
|
|
2376
|
+
let n = Mn(e, st(e, T.SDF_PERSIST), t, !1), r = Kn(mr(e), null, !1);
|
|
2377
|
+
return r && dn(r) && rn(n, r), Yn(mr(e), n);
|
|
2350
2378
|
}, exports.debounce = function(e, t = 0, n = !1) {
|
|
2351
2379
|
let r = null, o = null, s = null;
|
|
2352
|
-
const
|
|
2353
|
-
s = this, o =
|
|
2354
|
-
const
|
|
2380
|
+
const l = (...l) => {
|
|
2381
|
+
s = this, o = l;
|
|
2382
|
+
const i = n && !r;
|
|
2355
2383
|
clearTimeout(r), r = setTimeout(() => {
|
|
2356
2384
|
r = null, n || e.apply(s, o);
|
|
2357
|
-
}, t),
|
|
2385
|
+
}, t), i && e.apply(s, o);
|
|
2358
2386
|
};
|
|
2359
|
-
return
|
|
2387
|
+
return l.flush = () => {
|
|
2360
2388
|
r && (clearTimeout(r), r = null, e.apply(s, o));
|
|
2361
|
-
},
|
|
2389
|
+
}, l.cancel = () => {
|
|
2362
2390
|
clearTimeout(r), r = null, o = null, s = null;
|
|
2363
|
-
},
|
|
2391
|
+
}, l;
|
|
2364
2392
|
}, exports.delete_from_list = function(e, t) {
|
|
2365
2393
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
2366
2394
|
return !1;
|
|
@@ -2371,7 +2399,68 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2371
2399
|
Object.assign(t, e);
|
|
2372
2400
|
}
|
|
2373
2401
|
return t;
|
|
2374
|
-
}, exports.empty_string =
|
|
2402
|
+
}, exports.empty_string = vn, exports.escapeHtml = lr, exports.event_flag_t = R, exports.flat2json = function(e) {
|
|
2403
|
+
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2404
|
+
let t = null;
|
|
2405
|
+
for (const n of Object.keys(e)) {
|
|
2406
|
+
const r = dr(n);
|
|
2407
|
+
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2408
|
+
if (r.length > fr) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2409
|
+
const o = "number" == typeof r[0];
|
|
2410
|
+
if (null === t) t = o ? [] : {};
|
|
2411
|
+
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2412
|
+
let s = t;
|
|
2413
|
+
for (let t = 0; t < r.length; t++) {
|
|
2414
|
+
const o = r[t], l = "number" == typeof o, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2415
|
+
if (l && o > gr) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
2416
|
+
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"}`);
|
|
2417
|
+
if (i) {
|
|
2418
|
+
if (Array.isArray(s)) {
|
|
2419
|
+
for (; s.length <= o;) s.push(null);
|
|
2420
|
+
s[o] = e[n];
|
|
2421
|
+
} else {
|
|
2422
|
+
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`);
|
|
2423
|
+
s[o] = e[n];
|
|
2424
|
+
}
|
|
2425
|
+
break;
|
|
2426
|
+
}
|
|
2427
|
+
let a;
|
|
2428
|
+
if (Array.isArray(s)) {
|
|
2429
|
+
for (; s.length <= o;) s.push(null);
|
|
2430
|
+
a = s[o], null == a && (a = _ ? [] : {}, s[o] = a);
|
|
2431
|
+
} else a = s[o], void 0 === a && (a = _ ? [] : {}, s[o] = a);
|
|
2432
|
+
if (null === a || "object" != typeof a) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
2433
|
+
if (_ !== Array.isArray(a)) throw new Error(`flat2json: '${n}' needs a ${_ ? "array" : "object"} where the tree already has a ${Array.isArray(a) ? "array" : "object"}`);
|
|
2434
|
+
s = a;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
return null === t ? {} : t;
|
|
2438
|
+
}, exports.flat_apply = function(e, t) {
|
|
2439
|
+
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2440
|
+
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2441
|
+
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
2442
|
+
for (const n of Object.keys(t.added || {})) e[n] = t.added[n];
|
|
2443
|
+
for (const n of Object.keys(t.changed || {})) {
|
|
2444
|
+
const r = t.changed[n];
|
|
2445
|
+
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
2446
|
+
e[n] = r.to;
|
|
2447
|
+
}
|
|
2448
|
+
return e;
|
|
2449
|
+
}, exports.flat_diff = function(e, t) {
|
|
2450
|
+
const n = e && "object" == typeof e ? e : {}, r = t && "object" == typeof t ? t : {}, o = {
|
|
2451
|
+
added: {},
|
|
2452
|
+
removed: {},
|
|
2453
|
+
changed: {}
|
|
2454
|
+
};
|
|
2455
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? br(n[e], r[e]) || (o.changed[e] = {
|
|
2456
|
+
from: n[e],
|
|
2457
|
+
to: r[e]
|
|
2458
|
+
}) : o.removed[e] = n[e];
|
|
2459
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (o.added[e] = r[e]);
|
|
2460
|
+
return o;
|
|
2461
|
+
}, exports.flat_key_join = function(e) {
|
|
2462
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : pr(e)).join("`") : "";
|
|
2463
|
+
}, exports.flat_key_split = dr, exports.gclass_add_ev_action = se, exports.gclass_add_event_type = ie, 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 = O, exports.gclass_unregister = te, exports.getPositionRelativeToBody = function(e) {
|
|
2375
2464
|
if (!e) return {
|
|
2376
2465
|
top: 0,
|
|
2377
2466
|
left: 0,
|
|
@@ -2383,12 +2472,12 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2383
2472
|
left: 0,
|
|
2384
2473
|
width: 0,
|
|
2385
2474
|
height: 0
|
|
2386
|
-
}, s = "undefined" != typeof window,
|
|
2475
|
+
}, s = "undefined" != typeof window, l = s && (window.scrollY || document.documentElement?.scrollTop || document.body?.scrollTop) || 0, i = s && (window.scrollX || document.documentElement?.scrollLeft || document.body?.scrollLeft) || 0;
|
|
2387
2476
|
return {
|
|
2388
|
-
top: t +
|
|
2389
|
-
left: n +
|
|
2390
|
-
right: n +
|
|
2391
|
-
bottom: t +
|
|
2477
|
+
top: t + l,
|
|
2478
|
+
left: n + i,
|
|
2479
|
+
right: n + i + r,
|
|
2480
|
+
bottom: t + l + o
|
|
2392
2481
|
};
|
|
2393
2482
|
}, exports.get_function_name = cr, exports.get_now = function() {
|
|
2394
2483
|
return Math.floor(Date.now() / 1e3);
|
|
@@ -2396,8 +2485,8 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2396
2485
|
return Ke(e) ? (qt("gobj NULL or DESTROYED"), null) : n instanceof S ? (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) : (qt(`${Fe(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2397
2486
|
}, exports.gobj_change_state = pt, exports.gobj_command = function(e, n, o, s) {
|
|
2398
2487
|
if (Ke(e)) return qt("gobj NULL or DESTROYED"), -1;
|
|
2399
|
-
let
|
|
2400
|
-
return
|
|
2488
|
+
let l = d && it(d, "tracing");
|
|
2489
|
+
return l && ($(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", De(e) ? "" : "!!", Fe(e), n, Fe(s))), l > 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);
|
|
2401
2490
|
}, exports.gobj_create = function(e, t, n, r) {
|
|
2402
2491
|
return Ee(e, t, n, r, 0);
|
|
2403
2492
|
}, exports.gobj_create2 = Ee, exports.gobj_create_default_service = function(e, t, n, r) {
|
|
@@ -2409,7 +2498,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2409
2498
|
}, exports.gobj_create_yuno = function(e, t, n) {
|
|
2410
2499
|
return Ee(e, t, n, null, N.gobj_flag_yuno);
|
|
2411
2500
|
}, exports.gobj_current_state = dt, exports.gobj_default_service = ce, exports.gobj_deliver_posted_events = yt, exports.gobj_destroy = he, exports.gobj_find_child = tt, exports.gobj_find_gobj = function(e, t) {
|
|
2412
|
-
if (
|
|
2501
|
+
if (vn(t)) return null;
|
|
2413
2502
|
const n = t.toLowerCase();
|
|
2414
2503
|
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d : nt(d, t);
|
|
2415
2504
|
}, exports.gobj_find_service = fe, exports.gobj_find_subscribings = kt, exports.gobj_find_subscriptions = At, exports.gobj_flag_t = N, exports.gobj_full_name = Ge, exports.gobj_gclass_name = Ue, exports.gobj_global_trace_level = function() {
|
|
@@ -2434,7 +2523,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2434
2523
|
total_subscribings: gn(n)
|
|
2435
2524
|
};
|
|
2436
2525
|
}, exports.gobj_load_persistent_attrs = function(e, t) {
|
|
2437
|
-
return Ae(e) ?
|
|
2526
|
+
return Ae(e) ? l ? l(e, t) : -1 : (qt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2438
2527
|
}, exports.gobj_match_children = function(e, t) {
|
|
2439
2528
|
if (Ke(e)) return qt("gobj NULL or DESTROYED"), null;
|
|
2440
2529
|
t = t || {};
|
|
@@ -2455,8 +2544,8 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2455
2544
|
et(s, t) && n.push(s), e(n, s);
|
|
2456
2545
|
}
|
|
2457
2546
|
}(n, e), n;
|
|
2458
|
-
}, exports.gobj_match_gobj = et, exports.gobj_name = Pe, exports.gobj_parent = Ve, exports.gobj_pause =
|
|
2459
|
-
return e && e instanceof S ? e.obflag & (
|
|
2547
|
+
}, 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) {
|
|
2548
|
+
return e && e instanceof S ? e.obflag & (w.obflag_destroyed | w.obflag_destroying) ? (qt(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : vn(n) ? (qt("gobj_post_event(): event EMPTY"), -1) : mt(e, n, 0) ? Tt.length >= 1e4 ? (qt(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${Tt.length}`), -1) : (Tt.push({
|
|
2460
2549
|
dst: e,
|
|
2461
2550
|
event: n,
|
|
2462
2551
|
kw: r,
|
|
@@ -2464,7 +2553,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2464
2553
|
}), 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) : (qt(`gobj_post_event(): event NOT DEFINED in gclass ${Ue(e)}, event ${n}`), -1) : (qt(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
2465
2554
|
}, exports.gobj_posted_events_size = function() {
|
|
2466
2555
|
return Tt.length;
|
|
2467
|
-
}, exports.gobj_publish_event = It, exports.gobj_read_attr = ot, exports.gobj_read_attrs = st, exports.gobj_read_bool_attr =
|
|
2556
|
+
}, exports.gobj_publish_event = It, exports.gobj_read_attr = ot, exports.gobj_read_attrs = st, exports.gobj_read_bool_attr = lt, exports.gobj_read_integer_attr = it, exports.gobj_read_pointer_attr = at, exports.gobj_read_str_attr = _t, exports.gobj_remove_persistent_attrs = function(e, t) {
|
|
2468
2557
|
return Ae(e) ? _ ? _(e, t) : -1 : (qt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2469
2558
|
}, exports.gobj_repr_global_trace_levels = function() {
|
|
2470
2559
|
return L.map(([e, t, n]) => ({
|
|
@@ -2487,8 +2576,8 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2487
2576
|
return 0;
|
|
2488
2577
|
}(e, T.SDF_VOLATIL, 0);
|
|
2489
2578
|
}, exports.gobj_save_persistent_attrs = function(e, t) {
|
|
2490
|
-
return Ae(e) ?
|
|
2491
|
-
}, exports.gobj_search_path = nt, exports.gobj_send_event =
|
|
2579
|
+
return Ae(e) ? i ? i(e, t) : -1 : (qt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2580
|
+
}, exports.gobj_search_path = nt, exports.gobj_send_event = jt, exports.gobj_services = function() {
|
|
2492
2581
|
let e = [];
|
|
2493
2582
|
for (const t of Object.keys(p)) un(e, t);
|
|
2494
2583
|
return e;
|
|
@@ -2521,15 +2610,15 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2521
2610
|
}, exports.gobj_set_trace_machine_format = function(e) {
|
|
2522
2611
|
I = 1 === Number(e) ? 1 : 0;
|
|
2523
2612
|
}, exports.gobj_short_name = Fe, exports.gobj_start = ye, exports.gobj_start_children = function(e) {
|
|
2524
|
-
return Ke(e) ? (qt("gobj NULL or DESTROYED"), -1) : qe(e, D.WALK_FIRST2LAST,
|
|
2613
|
+
return Ke(e) ? (qt("gobj NULL or DESTROYED"), -1) : qe(e, D.WALK_FIRST2LAST, je, 0, 0);
|
|
2525
2614
|
}, exports.gobj_start_tree = function(e) {
|
|
2526
|
-
return Ke(e) ? (qt("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Ge(e))), e.gclass.gclass_flag & O.gcflag_manual_start || e.disabled ? 0 : (e.running || ye(e), He(e, D.WALK_TOP2BOTTOM,
|
|
2615
|
+
return Ke(e) ? (qt("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Ge(e))), e.gclass.gclass_flag & O.gcflag_manual_start || e.disabled ? 0 : (e.running || ye(e), He(e, D.WALK_TOP2BOTTOM, ve, 0, 0)));
|
|
2527
2616
|
}, exports.gobj_start_up = function(e, t, n, r, o, s, g) {
|
|
2528
|
-
|
|
2529
|
-
const p = [["EV_STATE_CHANGED",
|
|
2617
|
+
l = t, i = n, _ = r, a = o, u = s, c = g;
|
|
2618
|
+
const p = [["EV_STATE_CHANGED", R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]];
|
|
2530
2619
|
for (let e = 0; e < p.length; e++) {
|
|
2531
2620
|
let t = p[e][0], n = p[e][1];
|
|
2532
|
-
|
|
2621
|
+
le(f, t, n);
|
|
2533
2622
|
}
|
|
2534
2623
|
return 0;
|
|
2535
2624
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
@@ -2550,37 +2639,37 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2550
2639
|
]);
|
|
2551
2640
|
if (Object.keys(n).forEach((n) => {
|
|
2552
2641
|
o.has(n) || qt(`${Fe(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2553
|
-
}),
|
|
2554
|
-
else if (!(Et(e, t,
|
|
2555
|
-
let s = Nt(e.dl_subscriptions, e, t, n, r),
|
|
2642
|
+
}), vn(t)) t = "";
|
|
2643
|
+
else if (!(Et(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Fe(e)}, ev ${t}`), 0;
|
|
2644
|
+
let s = Nt(e.dl_subscriptions, e, t, n, r), l = 0;
|
|
2556
2645
|
for (let t = 0; t < s.length; t++) {
|
|
2557
2646
|
let n = s[t];
|
|
2558
|
-
|
|
2647
|
+
Rt(e, n, !1, !1), l++;
|
|
2559
2648
|
}
|
|
2560
|
-
return
|
|
2649
|
+
return l || (Ht(`${Fe(e)}: No subscription found`), Xt(n, "No subscription found")), 0;
|
|
2561
2650
|
}, exports.gobj_unsubscribe_list = xt, exports.gobj_walk_gobj_children = qe, exports.gobj_walk_gobj_children_tree = He, exports.gobj_write_attr = function(e, n, r, o) {
|
|
2562
2651
|
if (!mn(n)) return qt(t("gobj_write_attr(%s): path must be a string", Fe(e))), -1;
|
|
2563
|
-
let s,
|
|
2564
|
-
if (
|
|
2652
|
+
let s, l = e.jn_attrs, i = n.split("`");
|
|
2653
|
+
if (i.length <= 1) {
|
|
2565
2654
|
let o = n;
|
|
2566
|
-
return o in
|
|
2655
|
+
return o in l && l.hasOwnProperty(o) ? (l[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) : (qt(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), o)), -1);
|
|
2567
2656
|
}
|
|
2568
|
-
let _ =
|
|
2657
|
+
let _ = i.length;
|
|
2569
2658
|
for (let t = 0; t < _; t++) {
|
|
2570
|
-
s =
|
|
2659
|
+
s = i[t];
|
|
2571
2660
|
let n = tt(e, { __gobj_name__: s });
|
|
2572
2661
|
if (n && t < _ - 1) {
|
|
2573
2662
|
e = n;
|
|
2574
2663
|
continue;
|
|
2575
2664
|
}
|
|
2576
2665
|
let o = e.jn_attrs;
|
|
2577
|
-
if (s in o && o.hasOwnProperty(s)) return o[s] = r, dn(e.priv) && e.priv.hasOwnProperty(s) && (e.priv[s] = r), e.obflag &
|
|
2666
|
+
if (s in o && o.hasOwnProperty(s)) return o[s] = r, dn(e.priv) && e.priv.hasOwnProperty(s) && (e.priv[s] = r), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.mt_writing && e.mt_writing(e, s), 0;
|
|
2578
2667
|
break;
|
|
2579
2668
|
}
|
|
2580
2669
|
return qt(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), s)), -1;
|
|
2581
2670
|
}, exports.gobj_write_attrs = ut, exports.gobj_write_bool_attr = ct, exports.gobj_write_integer_attr = ft, exports.gobj_write_str_attr = gt, exports.gobj_yuno = Ie, exports.gobj_yuno_id = Le, exports.gobj_yuno_name = $e, exports.gobj_yuno_role = Ce, exports.id_index_in_obj_list = Hn, exports.index_in_list = ar, exports.is_array = bn, exports.is_boolean = Tn, exports.is_date = function(e) {
|
|
2582
2671
|
return e instanceof Date && !isNaN(e);
|
|
2583
|
-
}, exports.is_function = yn, exports.is_gobj =
|
|
2672
|
+
}, exports.is_function = yn, exports.is_gobj = jn, exports.is_metadata_key = function(e) {
|
|
2584
2673
|
if (!mn(e)) return !1;
|
|
2585
2674
|
let t;
|
|
2586
2675
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
@@ -2598,14 +2687,14 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2598
2687
|
}, exports.is_string = mn, exports.jdb_delete = function(e, t, n, r) {
|
|
2599
2688
|
let o = Pn(null, Pn(null, e, "topics", null, 0), t, null, 0);
|
|
2600
2689
|
if (!o) return qt("jdb_delete: topic not found: " + t), null;
|
|
2601
|
-
if (
|
|
2602
|
-
let s,
|
|
2603
|
-
for (; (s =
|
|
2604
|
-
if (0 ===
|
|
2605
|
-
let e = Hn(
|
|
2606
|
-
e >= 0 &&
|
|
2690
|
+
if (vn(r.id)) return qt("jdb_delete: record without id: " + r), Qt(r), null;
|
|
2691
|
+
let s, l = n.split("`"), i = o;
|
|
2692
|
+
for (; (s = l.shift()) && !vn(s) && i;) dn(i) && (i = Pn(null, i, e.hook, null, 0)), i = or(i, null, s, !1);
|
|
2693
|
+
if (0 === l.length && i) if (bn(i)) {
|
|
2694
|
+
let e = Hn(i, r.id);
|
|
2695
|
+
e >= 0 && i.splice(e, 1);
|
|
2607
2696
|
} else {
|
|
2608
|
-
let t = Pn(null,
|
|
2697
|
+
let t = Pn(null, i, e.hook, null, 0), n = Hn(t, r.id);
|
|
2609
2698
|
n >= 0 && t.splice(n, 1);
|
|
2610
2699
|
}
|
|
2611
2700
|
return o;
|
|
@@ -2630,16 +2719,37 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2630
2719
|
}, exports.jdb_update = function(e, t, n, r) {
|
|
2631
2720
|
let o = Pn(null, Pn(null, e, "topics", null, 0), t, null, 0);
|
|
2632
2721
|
if (!o) return qt("jdb_update: topic not found: " + t), null;
|
|
2633
|
-
if (
|
|
2634
|
-
let s,
|
|
2635
|
-
for (; (s =
|
|
2636
|
-
if (0 ===
|
|
2637
|
-
else if (
|
|
2722
|
+
if (vn(r.id)) return qt("jdb_update: record without id: " + r), Qt(r), null;
|
|
2723
|
+
let s, l = n.split("`"), i = o;
|
|
2724
|
+
for (; (s = l.shift()) && !vn(s) && i;) dn(i) && (i = Pn(null, i, e.hook, [], 1)), i = or(i, null, s, !1);
|
|
2725
|
+
if (0 === l.length && i) if (bn(i)) i.push(r);
|
|
2726
|
+
else if (i.id === r.id) Object.assign(i, r);
|
|
2638
2727
|
else {
|
|
2639
|
-
let t = Pn(null,
|
|
2728
|
+
let t = Pn(null, i, e.hook, [], 1), n = or(t, e.hook, r.id, !1);
|
|
2640
2729
|
n ? Object.assign(n, r) : t.push(r);
|
|
2641
2730
|
}
|
|
2642
2731
|
return o;
|
|
2732
|
+
}, exports.json2flat = function(e) {
|
|
2733
|
+
const t = {}, n = (e, r, o) => {
|
|
2734
|
+
if (o > fr) throw new Error("json2flat: deeper than 256");
|
|
2735
|
+
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2736
|
+
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2737
|
+
const s = `[${t}]`;
|
|
2738
|
+
n(e, 0 === o ? s : r + "`" + s, o + 1);
|
|
2739
|
+
});
|
|
2740
|
+
} else {
|
|
2741
|
+
const t = Object.keys(e);
|
|
2742
|
+
if (t.length > 0) {
|
|
2743
|
+
for (const s of t) {
|
|
2744
|
+
const t = pr(s);
|
|
2745
|
+
n(e[s], 0 === o ? t : r + "`" + t, o + 1);
|
|
2746
|
+
}
|
|
2747
|
+
return;
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
0 !== o && (t[r] = e);
|
|
2751
|
+
};
|
|
2752
|
+
return null == e || n(e, "", 0), t;
|
|
2643
2753
|
}, exports.json_array_append = an, exports.json_array_append_new = un, exports.json_array_extend = function(e, t) {
|
|
2644
2754
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2645
2755
|
}, exports.json_array_remove = cn, exports.json_array_size = gn, exports.json_deep_copy = Zt, exports.json_is_identical = en, exports.json_object_del = sn, exports.json_object_get = on, exports.json_object_set = ln, exports.json_object_set_new = _n, exports.json_object_size = fn, exports.json_object_update = tn, exports.json_object_update_existing = nn, exports.json_object_update_missing = rn, exports.json_size = pn, exports.jwt2json = function(e, t) {
|
|
@@ -2654,7 +2764,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2654
2764
|
return null;
|
|
2655
2765
|
}
|
|
2656
2766
|
}, exports.jwtDecode = sr, exports.kw_clone_by_keys = Mn, exports.kw_clone_by_not_keys = Wn, exports.kw_collect = function(e, t, n, r) {
|
|
2657
|
-
if (e && !
|
|
2767
|
+
if (e && !jn(e) && qt("GObj bad instanceof"), !t) return null;
|
|
2658
2768
|
r || (r = Vn);
|
|
2659
2769
|
let o = [];
|
|
2660
2770
|
if (bn(t)) for (let e = 0; e < t.length; e++) {
|
|
@@ -2671,31 +2781,31 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2671
2781
|
for (let e = 0; e < t.length; e++) if (en(n, t[e])) return e;
|
|
2672
2782
|
return r && qt("item not found in this list"), -1;
|
|
2673
2783
|
}, exports.kw_find_path = xn, 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) {
|
|
2674
|
-
e && !
|
|
2784
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
2675
2785
|
let s = xn(e, t, n, !1);
|
|
2676
|
-
const
|
|
2786
|
+
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2677
2787
|
if (void 0 === s) {
|
|
2678
|
-
if (
|
|
2788
|
+
if (i) {
|
|
2679
2789
|
let o = Array(r);
|
|
2680
2790
|
return Un(e, t, n, o), o;
|
|
2681
2791
|
}
|
|
2682
|
-
return
|
|
2792
|
+
return l && (qt(`path not found: '${n}'`), Xt(t)), Array(r);
|
|
2683
2793
|
}
|
|
2684
|
-
return _ && An(e, t, n), bn(s) ? Array(s) : (
|
|
2794
|
+
return _ && An(e, t, n), bn(s) ? Array(s) : (l && (qt(`path value MUST BE an array: ${n}`), Qt(t)), Array(r));
|
|
2685
2795
|
}, exports.kw_get_local_storage_value = Kn, exports.kw_get_pointer = Cn, exports.kw_get_real = function(e, t, n, r, o) {
|
|
2686
|
-
e && !
|
|
2796
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
2687
2797
|
let s = xn(e, t, n, !1);
|
|
2688
|
-
const
|
|
2798
|
+
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2689
2799
|
if (void 0 === s) {
|
|
2690
|
-
if (
|
|
2800
|
+
if (i) {
|
|
2691
2801
|
let o = Number(r);
|
|
2692
2802
|
return Un(e, t, n, o), o;
|
|
2693
2803
|
}
|
|
2694
|
-
return
|
|
2804
|
+
return l && (qt(`path not found: '${n}'`), Xt(t)), Number(r);
|
|
2695
2805
|
}
|
|
2696
|
-
return _ && An(e, t, n), En(s) ? Number(s) : (
|
|
2697
|
-
}, exports.kw_get_str = $n, exports.kw_has_key = Dn, exports.kw_match_simple = Vn, exports.kw_pop =
|
|
2698
|
-
if (e && !
|
|
2806
|
+
return _ && An(e, t, n), En(s) ? Number(s) : (l && (qt(`path value MUST BE a number: ${n}`), Qt(t)), Number(r));
|
|
2807
|
+
}, exports.kw_get_str = $n, exports.kw_has_key = Dn, exports.kw_match_simple = Vn, exports.kw_pop = Rn, exports.kw_remove_local_storage_value = Bn, exports.kw_select = function(e, t, n, r) {
|
|
2808
|
+
if (e && !jn(e) && qt("GObj bad instanceof"), !t) return null;
|
|
2699
2809
|
r || (r = Vn);
|
|
2700
2810
|
let o = [];
|
|
2701
2811
|
if (bn(t)) for (let e = 0; e < t.length; e++) {
|
|
@@ -2708,16 +2818,16 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2708
2818
|
}
|
|
2709
2819
|
return o;
|
|
2710
2820
|
}, exports.kw_set_dict_value = Un, exports.kw_set_local_storage_value = Yn, exports.kw_set_subdict_value = Fn, exports.kwid_collect = qn, exports.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2711
|
-
e && !
|
|
2821
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
2712
2822
|
let s = qn(e, t, n, r, o);
|
|
2713
2823
|
return s.length > 0 ? s[0] : null;
|
|
2714
2824
|
}, exports.kwid_get_ids = function(e, t) {
|
|
2715
|
-
if (e && !
|
|
2825
|
+
if (e && !jn(e) && qt("GObj bad instanceof"), !t) return [];
|
|
2716
2826
|
let n = [];
|
|
2717
2827
|
if (mn(t)) n.push(t);
|
|
2718
2828
|
else if (dn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2719
2829
|
else bn(t) && t.forEach(function(t) {
|
|
2720
|
-
if (mn(t))
|
|
2830
|
+
if (mn(t)) vn(t) || n.push(t);
|
|
2721
2831
|
else if (dn(t)) {
|
|
2722
2832
|
let r = $n(e, t, "id", 0, 0);
|
|
2723
2833
|
r && n.push(r);
|
|
@@ -2725,12 +2835,12 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2725
2835
|
});
|
|
2726
2836
|
return n;
|
|
2727
2837
|
}, exports.kwid_match_id = Jn, exports.kwid_new_dict = function(e, t, n) {
|
|
2728
|
-
e && !
|
|
2838
|
+
e && !jn(e) && qt("GObj bad instanceof");
|
|
2729
2839
|
let r = {};
|
|
2730
|
-
if (
|
|
2840
|
+
if (vn(n) || (t = xn(e, t, n)), dn(t)) r = t;
|
|
2731
2841
|
else if (bn(t)) for (let n = 0; n < t.length; n++) {
|
|
2732
2842
|
let o = t[n], s = $n(e, o, "id", "", 0);
|
|
2733
|
-
|
|
2843
|
+
vn(s) || (r[s] = o);
|
|
2734
2844
|
}
|
|
2735
2845
|
else qt(`${Fe(e)} kwid_new_dict: data type unknown`);
|
|
2736
2846
|
return r;
|
|
@@ -2805,22 +2915,22 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2805
2915
|
})) : qt("You must supply a translation function");
|
|
2806
2916
|
}, exports.register_c_ievent_cli = function() {
|
|
2807
2917
|
return function(e) {
|
|
2808
|
-
if (
|
|
2918
|
+
if (Fr) return qt(`GClass ALREADY created: ${e}`), -1;
|
|
2809
2919
|
const t = [
|
|
2810
2920
|
["ST_DISCONNECTED", [
|
|
2811
2921
|
[
|
|
2812
2922
|
"EV_ON_OPEN",
|
|
2813
|
-
|
|
2923
|
+
Hr,
|
|
2814
2924
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
2815
2925
|
],
|
|
2816
2926
|
[
|
|
2817
2927
|
"EV_ON_CLOSE",
|
|
2818
|
-
|
|
2928
|
+
zr,
|
|
2819
2929
|
null
|
|
2820
2930
|
],
|
|
2821
2931
|
[
|
|
2822
2932
|
"EV_TIMEOUT",
|
|
2823
|
-
|
|
2933
|
+
qr,
|
|
2824
2934
|
null
|
|
2825
2935
|
],
|
|
2826
2936
|
[
|
|
@@ -2832,22 +2942,22 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2832
2942
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
2833
2943
|
[
|
|
2834
2944
|
"EV_ON_MESSAGE",
|
|
2835
|
-
|
|
2945
|
+
Zr,
|
|
2836
2946
|
null
|
|
2837
2947
|
],
|
|
2838
2948
|
[
|
|
2839
2949
|
"EV_IDENTITY_CARD_ACK",
|
|
2840
|
-
|
|
2950
|
+
Xr,
|
|
2841
2951
|
null
|
|
2842
2952
|
],
|
|
2843
2953
|
[
|
|
2844
2954
|
"EV_ON_CLOSE",
|
|
2845
|
-
|
|
2955
|
+
zr,
|
|
2846
2956
|
"ST_DISCONNECTED"
|
|
2847
2957
|
],
|
|
2848
2958
|
[
|
|
2849
2959
|
"EV_TIMEOUT",
|
|
2850
|
-
|
|
2960
|
+
Qr,
|
|
2851
2961
|
null
|
|
2852
2962
|
],
|
|
2853
2963
|
[
|
|
@@ -2859,22 +2969,22 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2859
2969
|
["ST_SESSION", [
|
|
2860
2970
|
[
|
|
2861
2971
|
"EV_ON_MESSAGE",
|
|
2862
|
-
|
|
2972
|
+
Zr,
|
|
2863
2973
|
null
|
|
2864
2974
|
],
|
|
2865
2975
|
[
|
|
2866
2976
|
"EV_MT_STATS",
|
|
2867
|
-
|
|
2977
|
+
eo,
|
|
2868
2978
|
null
|
|
2869
2979
|
],
|
|
2870
2980
|
[
|
|
2871
2981
|
"EV_MT_COMMAND",
|
|
2872
|
-
|
|
2982
|
+
to,
|
|
2873
2983
|
null
|
|
2874
2984
|
],
|
|
2875
2985
|
[
|
|
2876
2986
|
"EV_ON_CLOSE",
|
|
2877
|
-
|
|
2987
|
+
zr,
|
|
2878
2988
|
"ST_DISCONNECTED"
|
|
2879
2989
|
],
|
|
2880
2990
|
[
|
|
@@ -2885,47 +2995,47 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2885
2995
|
]],
|
|
2886
2996
|
[null, null]
|
|
2887
2997
|
];
|
|
2888
|
-
return (
|
|
2889
|
-
["EV_ON_MESSAGE",
|
|
2890
|
-
["EV_IDENTITY_CARD_ACK",
|
|
2891
|
-
["EV_ON_ID_NAK",
|
|
2892
|
-
["EV_MT_STATS",
|
|
2893
|
-
["EV_MT_COMMAND",
|
|
2894
|
-
["EV_ON_OPEN",
|
|
2895
|
-
["EV_ON_CLOSE",
|
|
2896
|
-
["EV_ON_OPEN_ERROR",
|
|
2998
|
+
return (Fr = ee(e, [
|
|
2999
|
+
["EV_ON_MESSAGE", R.EVF_OUTPUT_EVENT],
|
|
3000
|
+
["EV_IDENTITY_CARD_ACK", R.EVF_PUBLIC_EVENT],
|
|
3001
|
+
["EV_ON_ID_NAK", R.EVF_PUBLIC_EVENT | R.EVF_OUTPUT_EVENT],
|
|
3002
|
+
["EV_MT_STATS", R.EVF_PUBLIC_EVENT],
|
|
3003
|
+
["EV_MT_COMMAND", R.EVF_PUBLIC_EVENT],
|
|
3004
|
+
["EV_ON_OPEN", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS],
|
|
3005
|
+
["EV_ON_CLOSE", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS],
|
|
3006
|
+
["EV_ON_OPEN_ERROR", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS],
|
|
2897
3007
|
["EV_TIMEOUT", 0],
|
|
2898
3008
|
[null, 0]
|
|
2899
|
-
], t,
|
|
3009
|
+
], t, no, 0, Pr, Ur, 0, 0, 0, O.gcflag_no_check_output_events)) ? 0 : -1;
|
|
2900
3010
|
}("C_IEVENT_CLI");
|
|
2901
3011
|
}, exports.register_c_timer = function() {
|
|
2902
3012
|
return function(e) {
|
|
2903
|
-
if (
|
|
3013
|
+
if (Or) return qt(`GClass ALREADY created: ${e}`), -1;
|
|
2904
3014
|
const t = [["ST_IDLE", [[
|
|
2905
3015
|
"EV_TIMEOUT",
|
|
2906
|
-
|
|
3016
|
+
Nr,
|
|
2907
3017
|
null
|
|
2908
3018
|
]]]];
|
|
2909
|
-
return (
|
|
2910
|
-
["EV_TIMEOUT",
|
|
2911
|
-
["EV_TIMEOUT_PERIODIC",
|
|
3019
|
+
return (Or = ee(e, [
|
|
3020
|
+
["EV_TIMEOUT", R.EVF_OUTPUT_EVENT],
|
|
3021
|
+
["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT],
|
|
2912
3022
|
[0, 0]
|
|
2913
|
-
], t,
|
|
3023
|
+
], t, wr, 0, vr, Sr, 0, 0, 0, O.gcflag_manual_start)) ? 0 : -1;
|
|
2914
3024
|
}("C_TIMER");
|
|
2915
3025
|
}, exports.register_c_yuno = function() {
|
|
2916
3026
|
return function(e) {
|
|
2917
|
-
if (
|
|
3027
|
+
if (Ir) return qt(`GClass ALREADY created: ${e}`), -1;
|
|
2918
3028
|
const t = [["ST_IDLE", [[
|
|
2919
3029
|
"EV_TIMEOUT_PERIODIC",
|
|
2920
|
-
|
|
3030
|
+
$r,
|
|
2921
3031
|
null
|
|
2922
3032
|
]]]];
|
|
2923
|
-
return (
|
|
3033
|
+
return (Ir = ee(e, [["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]], t, Cr, 0, Ar, kr, 0, 0, 0, 0)) ? 0 : -1;
|
|
2924
3034
|
}("C_YUNO");
|
|
2925
3035
|
}, exports.safeSrc = function(e) {
|
|
2926
3036
|
if (!e) return "";
|
|
2927
3037
|
const t = String(e).trim();
|
|
2928
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3038
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : lr(t);
|
|
2929
3039
|
}, exports.sdata_flag_t = T, exports.send_http_json_post = function(e, t, n) {
|
|
2930
3040
|
let r = new XMLHttpRequest();
|
|
2931
3041
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -2937,7 +3047,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2937
3047
|
Mt = "function" == typeof e ? e : null;
|
|
2938
3048
|
}, exports.set_log_callback = function(e) {
|
|
2939
3049
|
Gt = "function" == typeof e ? e : null;
|
|
2940
|
-
}, exports.set_remote_log_functions = Bt, exports.set_timeout =
|
|
3050
|
+
}, exports.set_remote_log_functions = Bt, exports.set_timeout = Rr, exports.set_timeout_periodic = Dr, exports.sprintf = t, exports.stats_parser = function(e, t, n, r) {}, exports.str_in_list = zn, exports.strcasecmp = Nn, exports.strcmp = On, exports.strncmp = function(e, t, n) {
|
|
2941
3051
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
2942
3052
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
2943
3053
|
}, exports.strs_in_list = function(e, t, n) {
|
|
@@ -2966,9 +3076,9 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2966
3076
|
let e = t.split(".");
|
|
2967
3077
|
for (let t = 0; t < e.length; t++) {
|
|
2968
3078
|
let r = e[t];
|
|
2969
|
-
if (zn(
|
|
2970
|
-
else if (zn(
|
|
2971
|
-
else if (zn(
|
|
3079
|
+
if (zn(Tr, r)) n.real_type || (n.real_type = r);
|
|
3080
|
+
else if (zn(yr, r)) n.type || (n.type = r);
|
|
3081
|
+
else if (zn(hr, r)) switch (r) {
|
|
2972
3082
|
case "writable":
|
|
2973
3083
|
n.is_writable = !0;
|
|
2974
3084
|
break;
|
|
@@ -2980,19 +3090,19 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2980
3090
|
}
|
|
2981
3091
|
}
|
|
2982
3092
|
n.real_type || (n.real_type = "string");
|
|
2983
|
-
} else dn(t) ? (n =
|
|
3093
|
+
} else dn(t) ? (n = jr(t), n.name || (n.name = e), n.header || (n.header = e)) : bn(t) && (n.real_type = "array", n.enum_list = t);
|
|
2984
3094
|
return n.type || (n.type = n.real_type), n;
|
|
2985
3095
|
}, exports.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
2986
3096
|
const n = e, r = performance.now();
|
|
2987
3097
|
let o = r;
|
|
2988
3098
|
return t && Ht(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", s = "") => {
|
|
2989
|
-
const
|
|
2990
|
-
return t && Ht(`--\x3e ${n} ${e} - partial: ${
|
|
2991
|
-
partial:
|
|
3099
|
+
const l = performance.now(), i = (l - o) / 1e3, _ = (l - r) / 1e3;
|
|
3100
|
+
return t && Ht(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${s}`), o = l, {
|
|
3101
|
+
partial: i,
|
|
2992
3102
|
total: _
|
|
2993
3103
|
};
|
|
2994
3104
|
} };
|
|
2995
|
-
}, exports.trace_json = Xt, exports.trace_level_t = C, exports.trace_msg = Qt, exports.treedb_decoder_fkey =
|
|
3105
|
+
}, exports.trace_json = Xt, exports.trace_level_t = C, exports.trace_msg = Qt, exports.treedb_decoder_fkey = Er, exports.treedb_decoder_hook = function(e, t) {
|
|
2996
3106
|
if (mn(t)) {
|
|
2997
3107
|
if (-1 === t.indexOf("^")) {
|
|
2998
3108
|
let n, r = e.hook;
|
|
@@ -3019,9 +3129,9 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3019
3129
|
id: t.id
|
|
3020
3130
|
} : (qt("bad hook 3"), qt(e), qt(t), null);
|
|
3021
3131
|
}, exports.treedb_encoder_fkey = function(e, t) {
|
|
3022
|
-
let n =
|
|
3132
|
+
let n = Er(e, t);
|
|
3023
3133
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3024
|
-
}, exports.treedb_get_field_desc =
|
|
3134
|
+
}, exports.treedb_get_field_desc = jr, exports.treedb_hook_data_size = function(e) {
|
|
3025
3135
|
if (bn(e) && 1 === pn(e)) {
|
|
3026
3136
|
let t = e[0];
|
|
3027
3137
|
return Dn(t, "size") ? t.size : 1;
|