@yuneta/gobj-js 7.26.1 → 7.26.2
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 +49 -30
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +981 -973
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +49 -30
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +176 -169
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +49 -30
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +1037 -1029
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +49 -30
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +1037 -1029
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +3 -3
package/dist/gobj-js.iife.min.js
CHANGED
|
@@ -130,7 +130,7 @@ var gobjJs = function(e) {
|
|
|
130
130
|
data: l || []
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
var s = "7.0.0a", i = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b = Object.create(null), p = null, m = null, h = 0,
|
|
133
|
+
var s = "7.0.0a", i = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b = Object.create(null), p = null, m = null, h = 0, y = Object.freeze({
|
|
134
134
|
DTP_STRING: 1,
|
|
135
135
|
DTP_BOOLEAN: 2,
|
|
136
136
|
DTP_INTEGER: 3,
|
|
@@ -140,8 +140,8 @@ var gobjJs = function(e) {
|
|
|
140
140
|
DTP_JSON: 7,
|
|
141
141
|
DTP_POINTER: 8
|
|
142
142
|
});
|
|
143
|
-
|
|
144
|
-
var
|
|
143
|
+
y.DTP_POINTER;
|
|
144
|
+
var E = Object.freeze({
|
|
145
145
|
SDF_NOTACCESS: 1,
|
|
146
146
|
SDF_RD: 2,
|
|
147
147
|
SDF_WR: 4,
|
|
@@ -164,7 +164,7 @@ var gobjJs = function(e) {
|
|
|
164
164
|
SDF_AUTHZ_S: 524288,
|
|
165
165
|
SDF_AUTHZ_RS: 1048576
|
|
166
166
|
});
|
|
167
|
-
|
|
167
|
+
E.SDF_RD, E.SDF_WR, E.SDF_STATS, E.SDF_PERSIST, E.SDF_VOLATIL, E.SDF_RSTATS, E.SDF_PSTATS, E.SDF_WR, E.SDF_PERSIST;
|
|
168
168
|
var T = class {
|
|
169
169
|
constructor(e, t, n = 0, r = null, l = "", o = null, s = null, i = 0, _ = null, a = null, u = null) {
|
|
170
170
|
this.type = e, this.name = t, this.alias = o, this.flag = n, this.default_value = r, this.header = s, this.fillspace = i, this.description = l, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
@@ -175,7 +175,7 @@ var gobjJs = function(e) {
|
|
|
175
175
|
}
|
|
176
176
|
}, S = class {
|
|
177
177
|
constructor(e, t, n, r, l) {
|
|
178
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv =
|
|
178
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = Fn(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
179
179
|
}
|
|
180
180
|
}, w = Object.freeze({
|
|
181
181
|
gcflag_manual_start: 1,
|
|
@@ -195,12 +195,12 @@ var gobjJs = function(e) {
|
|
|
195
195
|
obflag_destroying: 1,
|
|
196
196
|
obflag_destroyed: 2,
|
|
197
197
|
obflag_created: 4
|
|
198
|
-
}),
|
|
198
|
+
}), $ = Object.freeze({
|
|
199
199
|
EVF_NO_WARN_SUBS: 1,
|
|
200
200
|
EVF_OUTPUT_EVENT: 2,
|
|
201
201
|
EVF_SYSTEM_EVENT: 4,
|
|
202
202
|
EVF_PUBLIC_EVENT: 8
|
|
203
|
-
}),
|
|
203
|
+
}), D = Object.freeze({
|
|
204
204
|
WALK_TOP2BOTTOM: 1,
|
|
205
205
|
WALK_BOTTOM2TOP: 2,
|
|
206
206
|
WALK_BYLEVEL: 4,
|
|
@@ -221,7 +221,7 @@ var gobjJs = function(e) {
|
|
|
221
221
|
};
|
|
222
222
|
var C = 1;
|
|
223
223
|
function L(e) {
|
|
224
|
-
|
|
224
|
+
Zn(e) && (e = JSON.stringify(e)), En(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
225
225
|
}
|
|
226
226
|
var P = Object.freeze({
|
|
227
227
|
TRACE_MACHINE: 65536,
|
|
@@ -323,7 +323,7 @@ var gobjJs = function(e) {
|
|
|
323
323
|
return n;
|
|
324
324
|
}
|
|
325
325
|
function W(e, t, n) {
|
|
326
|
-
if (
|
|
326
|
+
if (ir(e)) return void 0 === n ? 268369920 : 65535;
|
|
327
327
|
if (/^[0-9]+$/.test(String(e))) {
|
|
328
328
|
const t = Number(e);
|
|
329
329
|
if (t) return t;
|
|
@@ -334,7 +334,7 @@ var gobjJs = function(e) {
|
|
|
334
334
|
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
335
335
|
}
|
|
336
336
|
return 0;
|
|
337
|
-
}(String(e), n) || (
|
|
337
|
+
}(String(e), n) || (hn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
338
338
|
}
|
|
339
339
|
function x(e) {
|
|
340
340
|
if (G) return 4294967295;
|
|
@@ -390,32 +390,32 @@ var gobjJs = function(e) {
|
|
|
390
390
|
return M(V, null);
|
|
391
391
|
}
|
|
392
392
|
function re(e) {
|
|
393
|
-
const t =
|
|
394
|
-
return t ? M(t.trace_level | F, t.s_user_trace_level) : (
|
|
393
|
+
const t = tr(e) ? Oe(e) : e;
|
|
394
|
+
return t ? M(t.trace_level | F, t.s_user_trace_level) : (hn(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
395
395
|
}
|
|
396
396
|
function le(e) {
|
|
397
|
-
const t =
|
|
398
|
-
return t ? M(t.trace_level, t.s_user_trace_level) : (
|
|
397
|
+
const t = tr(e) ? Oe(e) : e;
|
|
398
|
+
return t ? M(t.trace_level, t.s_user_trace_level) : (hn(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
399
399
|
}
|
|
400
400
|
function oe(e) {
|
|
401
|
-
const t =
|
|
402
|
-
return t ? M(t.no_trace_level, t.s_user_trace_level) : (
|
|
401
|
+
const t = tr(e) ? Oe(e) : e;
|
|
402
|
+
return t ? M(t.no_trace_level, t.s_user_trace_level) : (hn(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
403
403
|
}
|
|
404
404
|
function se(e, t, n) {
|
|
405
|
-
const r =
|
|
406
|
-
if (!r) return
|
|
405
|
+
const r = tr(e) ? Oe(e) : e;
|
|
406
|
+
if (!r) return hn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
407
407
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
408
408
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
409
409
|
}
|
|
410
410
|
function ie(e, t, n) {
|
|
411
|
-
const r =
|
|
412
|
-
if (!r) return
|
|
411
|
+
const r = tr(e) ? Oe(e) : e;
|
|
412
|
+
if (!r) return hn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
413
413
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
414
414
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
415
415
|
}
|
|
416
416
|
function _e(e, t) {
|
|
417
417
|
let n = {};
|
|
418
|
-
if (!
|
|
418
|
+
if (!er(t)) return hn("sdata_desc MUST be an array"), vn(t), n;
|
|
419
419
|
for (let r = 0; r < t.length; r++) {
|
|
420
420
|
const l = t[r];
|
|
421
421
|
l.name && ae(e, n, l);
|
|
@@ -425,89 +425,89 @@ var gobjJs = function(e) {
|
|
|
425
425
|
function ae(e, t, n) {
|
|
426
426
|
let r, l = n.default_value;
|
|
427
427
|
switch (n.type) {
|
|
428
|
-
case
|
|
428
|
+
case y.DTP_STRING:
|
|
429
429
|
r = String(l);
|
|
430
430
|
break;
|
|
431
|
-
case
|
|
432
|
-
r =
|
|
431
|
+
case y.DTP_BOOLEAN:
|
|
432
|
+
r = _r(l);
|
|
433
433
|
break;
|
|
434
|
-
case
|
|
435
|
-
r = parseInt(l), isNaN(r) &&
|
|
434
|
+
case y.DTP_INTEGER:
|
|
435
|
+
r = parseInt(l), isNaN(r) && hn(`${et(e)}: attr NaN: ${n.name}`);
|
|
436
436
|
break;
|
|
437
|
-
case
|
|
438
|
-
r = Number(l), isNaN(r) &&
|
|
437
|
+
case y.DTP_REAL:
|
|
438
|
+
r = Number(l), isNaN(r) && hn(`${et(e)}: attr NaN: ${n.name}`);
|
|
439
439
|
break;
|
|
440
|
-
case
|
|
441
|
-
if (
|
|
440
|
+
case y.DTP_LIST:
|
|
441
|
+
if (tr(l)) try {
|
|
442
442
|
r = JSON.parse(l);
|
|
443
443
|
} catch (e) {
|
|
444
|
-
|
|
444
|
+
hn(`JSON parse error: ${e.message}`);
|
|
445
445
|
}
|
|
446
446
|
else r = l;
|
|
447
|
-
|
|
447
|
+
er(r) || (r = []);
|
|
448
448
|
break;
|
|
449
|
-
case
|
|
450
|
-
if (
|
|
449
|
+
case y.DTP_DICT:
|
|
450
|
+
if (tr(l)) try {
|
|
451
451
|
r = JSON.parse(l);
|
|
452
452
|
} catch (e) {
|
|
453
|
-
|
|
453
|
+
hn(`JSON parse error: ${e.message}`);
|
|
454
454
|
}
|
|
455
455
|
else r = l;
|
|
456
|
-
|
|
456
|
+
Zn(r) || (r = {});
|
|
457
457
|
break;
|
|
458
|
-
case
|
|
458
|
+
case y.DTP_JSON:
|
|
459
459
|
if ("" === l || void 0 === l) r = null;
|
|
460
|
-
else if (
|
|
460
|
+
else if (tr(l)) try {
|
|
461
461
|
r = JSON.parse(l);
|
|
462
462
|
} catch (e) {
|
|
463
|
-
|
|
463
|
+
hn(`JSON parse error: ${e.message}`);
|
|
464
464
|
}
|
|
465
465
|
else r = l;
|
|
466
466
|
break;
|
|
467
|
-
case
|
|
467
|
+
case y.DTP_POINTER: r = l;
|
|
468
468
|
}
|
|
469
|
-
return void 0 === r && (
|
|
469
|
+
return void 0 === r && (hn(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
470
470
|
}
|
|
471
471
|
function ue(e, t, n, r) {
|
|
472
472
|
let l;
|
|
473
473
|
switch (n.type) {
|
|
474
|
-
case
|
|
474
|
+
case y.DTP_STRING:
|
|
475
475
|
if (null == r) l = "";
|
|
476
|
-
else if (
|
|
476
|
+
else if (tr(r)) l = String(r);
|
|
477
477
|
else {
|
|
478
478
|
let e = JSON.stringify(r);
|
|
479
479
|
e && (l = String(e));
|
|
480
480
|
}
|
|
481
481
|
break;
|
|
482
|
-
case
|
|
483
|
-
l =
|
|
482
|
+
case y.DTP_BOOLEAN:
|
|
483
|
+
l = _r(r);
|
|
484
484
|
break;
|
|
485
|
-
case
|
|
486
|
-
if (l = parseInt(r), isNaN(l)) return
|
|
485
|
+
case y.DTP_INTEGER:
|
|
486
|
+
if (l = parseInt(r), isNaN(l)) return hn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
487
487
|
break;
|
|
488
|
-
case
|
|
489
|
-
if (l = Number(r), isNaN(l)) return
|
|
488
|
+
case y.DTP_REAL:
|
|
489
|
+
if (l = Number(r), isNaN(l)) return hn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
490
490
|
break;
|
|
491
|
-
case
|
|
492
|
-
if (
|
|
491
|
+
case y.DTP_LIST:
|
|
492
|
+
if (tr(r)) try {
|
|
493
493
|
l = JSON.parse(r);
|
|
494
494
|
} catch (e) {
|
|
495
|
-
|
|
495
|
+
hn(`JSON parse error: ${e.message}`);
|
|
496
496
|
}
|
|
497
497
|
else l = r;
|
|
498
|
-
if (!
|
|
498
|
+
if (!er(l)) return hn(`attr must be an array: ${n.name}`), -1;
|
|
499
499
|
break;
|
|
500
|
-
case
|
|
501
|
-
if (
|
|
500
|
+
case y.DTP_DICT:
|
|
501
|
+
if (tr(r)) try {
|
|
502
502
|
l = JSON.parse(r);
|
|
503
503
|
} catch (e) {
|
|
504
|
-
|
|
504
|
+
hn(`JSON parse error: ${e.message}`);
|
|
505
505
|
}
|
|
506
506
|
else l = r;
|
|
507
|
-
if (!
|
|
507
|
+
if (!Zn(l)) return hn(`attr must be an object: ${n.name}`), -1;
|
|
508
508
|
break;
|
|
509
|
-
case
|
|
510
|
-
if (l = r,
|
|
509
|
+
case y.DTP_JSON:
|
|
510
|
+
if (l = r, tr(r)) {
|
|
511
511
|
const e = r.trim();
|
|
512
512
|
if (e.startsWith("{") || e.startsWith("[")) try {
|
|
513
513
|
l = JSON.parse(e);
|
|
@@ -516,48 +516,48 @@ var gobjJs = function(e) {
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
break;
|
|
519
|
-
case
|
|
519
|
+
case y.DTP_POINTER: l = r;
|
|
520
520
|
}
|
|
521
|
-
return void 0 === l &&
|
|
521
|
+
return void 0 === l && hn(`${et(e)}: attr undefined: ${n.name}`), t[n.name] = l, Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, n.name) && (e.priv[n.name] = l), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
522
522
|
}
|
|
523
523
|
function ce(e) {
|
|
524
524
|
return e.jn_attrs;
|
|
525
525
|
}
|
|
526
526
|
function fe(e, t, n) {
|
|
527
|
-
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n &&
|
|
527
|
+
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n && hn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`), null);
|
|
528
528
|
}
|
|
529
529
|
function ge(e, t, n) {
|
|
530
|
-
if (!(e && e instanceof O)) return n &&
|
|
530
|
+
if (!(e && e instanceof O)) return n && hn("gclass NULL"), null;
|
|
531
531
|
if (!t) return e.attrs_table;
|
|
532
532
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
533
533
|
const r = e.attrs_table[n];
|
|
534
534
|
if (r.name && r.name === t) return r;
|
|
535
535
|
}
|
|
536
|
-
return n &&
|
|
536
|
+
return n && hn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
537
537
|
}
|
|
538
538
|
function de(e, t, n, r, l, o, s, i, _, a, u) {
|
|
539
|
-
if (
|
|
540
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
541
|
-
if (Oe(e)) return
|
|
539
|
+
if (ir(e)) return hn("gclass_name EMPTY"), null;
|
|
540
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return hn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
541
|
+
if (Oe(e)) return hn(`GClass ALREADY exists: ${e}`), null;
|
|
542
542
|
let c = new O(e, r, l, o, s, i, _, a, u);
|
|
543
543
|
(function(e, t) {
|
|
544
|
-
e && e instanceof O ? t ? d[t] ?
|
|
544
|
+
e && e instanceof O ? t ? d[t] ? hn(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : hn("gclass_name undefined") : hn("gclass undefined");
|
|
545
545
|
})(c, e);
|
|
546
546
|
const f = n.length;
|
|
547
547
|
for (let e = 0; e < f; e++) {
|
|
548
548
|
let t = n[e][0], r = n[e][1];
|
|
549
|
-
if (
|
|
549
|
+
if (ir(t)) continue;
|
|
550
550
|
if (he(c, t) < 0) return be(c), null;
|
|
551
551
|
const l = r.length;
|
|
552
552
|
for (let e = 0; e < l; e++) {
|
|
553
553
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
554
|
-
|
|
554
|
+
ir(n) || ye(c, t, n, l, o);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
for (let e = 0; e < t.length; e++) {
|
|
558
558
|
let n = t[e][0], r = t[e][1];
|
|
559
|
-
if (!
|
|
560
|
-
if (ve(c, n)) return
|
|
559
|
+
if (!ir(n)) {
|
|
560
|
+
if (ve(c, n)) return hn(`SMachine: event repeated in input_events: ${n}`), be(c), null;
|
|
561
561
|
Te(c, n, r);
|
|
562
562
|
}
|
|
563
563
|
}
|
|
@@ -569,13 +569,13 @@ var gobjJs = function(e) {
|
|
|
569
569
|
}
|
|
570
570
|
function be(e) {
|
|
571
571
|
let t;
|
|
572
|
-
if (
|
|
572
|
+
if (tr(e)) t = e;
|
|
573
573
|
else {
|
|
574
|
-
if (!(e instanceof O)) return
|
|
574
|
+
if (!(e instanceof O)) return hn("Cannot unregister gclass, type unknown"), -1;
|
|
575
575
|
t = e.gclass_name;
|
|
576
576
|
}
|
|
577
577
|
let n = d[t];
|
|
578
|
-
return n ? n.instances > 0 ? (
|
|
578
|
+
return n ? n.instances > 0 ? (hn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete d[t], 0) : (hn(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
579
579
|
}
|
|
580
580
|
function pe(e, t) {
|
|
581
581
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -594,22 +594,22 @@ var gobjJs = function(e) {
|
|
|
594
594
|
return null;
|
|
595
595
|
}
|
|
596
596
|
function he(e, t) {
|
|
597
|
-
return e instanceof O ? pe(e, t) ? (
|
|
597
|
+
return e instanceof O ? pe(e, t) ? (hn(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (hn("Cannot add state, typeof not GClass"), -1);
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
if (!(e instanceof O)) return
|
|
601
|
-
if (
|
|
599
|
+
function ye(e, t, n, r, l) {
|
|
600
|
+
if (!(e instanceof O)) return hn("Cannot add state, typeof not GClass"), -1;
|
|
601
|
+
if (ir(t)) return hn("state_name EMPTY"), -1;
|
|
602
602
|
let o = pe(e, t);
|
|
603
|
-
return o ? me(o, n) ? (
|
|
603
|
+
return o ? me(o, n) ? (hn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (hn(`state not found: ${t}`), -1);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
|
|
605
|
+
function Ee(e, t, n) {
|
|
606
|
+
ir(t) || e.push(new I(t, n));
|
|
607
607
|
}
|
|
608
608
|
function Te(e, t, n) {
|
|
609
|
-
return e instanceof O ?
|
|
609
|
+
return e instanceof O ? Ee(e.dl_events, t, n) : (hn("Cannot add state, typeof not GClass"), -1);
|
|
610
610
|
}
|
|
611
611
|
function ve(e, t) {
|
|
612
|
-
if (!(e instanceof O)) return
|
|
612
|
+
if (!(e instanceof O)) return hn("Cannot add state, typeof not GClass"), 0;
|
|
613
613
|
const n = e.dl_events.length, r = e.dl_events;
|
|
614
614
|
for (let e = 0; e < n; e++) {
|
|
615
615
|
let n = r[e];
|
|
@@ -618,25 +618,25 @@ var gobjJs = function(e) {
|
|
|
618
618
|
return null;
|
|
619
619
|
}
|
|
620
620
|
function je(e) {
|
|
621
|
-
if (!(e instanceof O)) return
|
|
621
|
+
if (!(e instanceof O)) return hn("Cannot add state, typeof not GClass"), -1;
|
|
622
622
|
let t = 0;
|
|
623
|
-
|
|
623
|
+
Qn(e.dl_states) || (hn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
624
624
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
625
625
|
let r = e.dl_states[n];
|
|
626
|
-
if (!
|
|
626
|
+
if (!ir(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
627
627
|
let l = r.dl_actions[n];
|
|
628
|
-
|
|
628
|
+
ir(l.event_name) || (ve(e, l.event_name) || (hn(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${l.event_name}`), t += -1), l.next_state && (pe(e, l.next_state) || (hn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
632
632
|
let r = e.dl_events[n];
|
|
633
|
-
if (!
|
|
633
|
+
if (!ir(r.event_name) && (nr(r.event_flag) || (hn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & $.EVF_OUTPUT_EVENT))) {
|
|
634
634
|
let n = !1;
|
|
635
635
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
636
636
|
let l = e.dl_states[t];
|
|
637
|
-
|
|
637
|
+
ir(l.state_name) || me(l, r.event_name) && (n = !0);
|
|
638
638
|
}
|
|
639
|
-
n || (
|
|
639
|
+
n || (hn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
return t;
|
|
@@ -646,69 +646,69 @@ var gobjJs = function(e) {
|
|
|
646
646
|
try {
|
|
647
647
|
n = d[e];
|
|
648
648
|
} catch (e) {}
|
|
649
|
-
return n || (t &&
|
|
649
|
+
return n || (t && hn(`gclass not found: ${e}`), null);
|
|
650
650
|
}
|
|
651
651
|
function Se() {
|
|
652
652
|
return !m || m.obflag & R.obflag_destroyed ? null : m;
|
|
653
653
|
}
|
|
654
654
|
function we(e, t) {
|
|
655
|
-
if (!
|
|
655
|
+
if (!tr(e)) return hn(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
656
656
|
e = e.toLowerCase();
|
|
657
|
-
return b[e] || (t &&
|
|
657
|
+
return b[e] || (t && hn(`gobj service not found: ${e}`), null);
|
|
658
658
|
}
|
|
659
659
|
function Ne(e) {
|
|
660
660
|
let t = Xe(e);
|
|
661
|
-
return t = t.toLowerCase(), b[t] &&
|
|
661
|
+
return t = t.toLowerCase(), b[t] && hn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
662
662
|
}
|
|
663
663
|
function Re(e, t) {
|
|
664
|
-
t.parent &&
|
|
665
|
-
}
|
|
666
|
-
function De(e, t) {
|
|
667
|
-
let n = qr(e.dl_children, t);
|
|
668
|
-
n >= 0 && (qn(e.dl_children, n), t.parent = null);
|
|
664
|
+
t.parent && hn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
669
665
|
}
|
|
670
666
|
function $e(e, t) {
|
|
671
|
-
|
|
667
|
+
let n = Hr(e.dl_children, t);
|
|
668
|
+
n >= 0 && (Hn(e.dl_children, n), t.parent = null);
|
|
669
|
+
}
|
|
670
|
+
function De(e, t) {
|
|
671
|
+
return Be(e) ? _ ? _(e, t) : -1 : (hn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
672
672
|
}
|
|
673
673
|
function ke(e, t) {
|
|
674
|
-
"__json_config_variables__" !== t &&
|
|
674
|
+
"__json_config_variables__" !== t && hn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`);
|
|
675
675
|
}
|
|
676
676
|
function Ae(e, t, n) {
|
|
677
677
|
let r = t;
|
|
678
678
|
(function(e, t, n, r, l) {
|
|
679
|
-
if (!e || !t) return
|
|
679
|
+
if (!e || !t) return hn("hsdata or kw NULL"), -1;
|
|
680
680
|
let o = 0;
|
|
681
681
|
for (const [s, i] of Object.entries(t)) {
|
|
682
682
|
const t = ge(l.gclass, s, !1);
|
|
683
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
683
|
+
t ? (-1 === n || t.flag & n) && (t.flag & E.SDF_DEPRECATED && yn(`${et(l)}: Deprecated attribute used in gobj creation: ${s}`), o += ue(l, e, t, i)) : r && (r(l, s), o--);
|
|
684
684
|
}
|
|
685
685
|
return o;
|
|
686
|
-
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (
|
|
686
|
+
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (hn(`${et(e)} json2data() FAILED`), Un(r));
|
|
687
687
|
}
|
|
688
688
|
function Ie(e, t, r, l, o) {
|
|
689
689
|
if (o & N.gobj_flag_yuno) {
|
|
690
|
-
if (p) return
|
|
690
|
+
if (p) return hn("__yuno__ already created"), null;
|
|
691
691
|
o |= N.gobj_flag_service;
|
|
692
692
|
} else {
|
|
693
|
-
if (!l) return
|
|
694
|
-
if (!("string" == typeof l || l instanceof S)) return
|
|
695
|
-
if (
|
|
693
|
+
if (!l) return hn("gobj NEEDS a parent!"), null;
|
|
694
|
+
if (!("string" == typeof l || l instanceof S)) return hn(`BAD TYPE of parent: ${l}`), null;
|
|
695
|
+
if (tr(l)) {
|
|
696
696
|
const e = l;
|
|
697
|
-
if (!(l = we(e))) return
|
|
697
|
+
if (!(l = we(e))) return yn(`parent service not found: ${e}`), null;
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
-
if (o & N.gobj_flag_service && we(e, !1)) return
|
|
700
|
+
if (o & N.gobj_flag_service && we(e, !1)) return hn(`service ALREADY registered: ${t}^${e}`), null;
|
|
701
701
|
if (o & N.gobj_flag_default_service) {
|
|
702
|
-
if (m) return
|
|
702
|
+
if (m) return hn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
703
703
|
o |= N.gobj_flag_service;
|
|
704
704
|
}
|
|
705
|
-
if (
|
|
705
|
+
if (ir(t)) return hn("gclass_name must be a string"), null;
|
|
706
706
|
let s = Oe(t, !1);
|
|
707
|
-
if (!s) return
|
|
708
|
-
if (!
|
|
709
|
-
if (!
|
|
710
|
-
if (e.includes("`")) return
|
|
711
|
-
if (e.includes("^")) return
|
|
707
|
+
if (!s) return hn(`GClass not registered: ${t}^${e}`), null;
|
|
708
|
+
if (!tr(e)) return hn(`gobj_name must be a string: ${t}`), null;
|
|
709
|
+
if (!ir(e)) {
|
|
710
|
+
if (e.includes("`")) return hn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
711
|
+
if (e.includes("^")) return hn(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
712
712
|
}
|
|
713
713
|
let _ = new S(e, s, r, l, o);
|
|
714
714
|
_.jn_attrs = _e(_, s.attrs_table);
|
|
@@ -720,8 +720,8 @@ var gobjJs = function(e) {
|
|
|
720
720
|
return Ie(e, t, n, r, N.gobj_flag_pure_child);
|
|
721
721
|
}
|
|
722
722
|
function Le(e) {
|
|
723
|
-
if (ot(e)) return void
|
|
724
|
-
e.__refs__ > 0 &&
|
|
723
|
+
if (ot(e)) return void hn("gobj NULL or DESTROYED");
|
|
724
|
+
e.__refs__ > 0 && hn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (hn(`Destroying a PLAYING gobj: ${tt(e)}`), xe(e)), e.running && (hn(`Destroying a RUNNING gobj: ${tt(e)}`), Ve(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
725
725
|
if (0 === Lt.length) return;
|
|
726
726
|
for (let t of Lt) t.src === e && (t.src = null);
|
|
727
727
|
Lt = Lt.filter((t) => t.dst !== e);
|
|
@@ -731,8 +731,8 @@ var gobjJs = function(e) {
|
|
|
731
731
|
let r = nt(e);
|
|
732
732
|
r && r.gclass.gmt.mt_child_removed && (t && L(n("👦👦🔴 child_removed(%s): %s", tt(r), et(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & N.gobj_flag_service && function(e) {
|
|
733
733
|
let t = Xe(e);
|
|
734
|
-
t = t.toLowerCase(), b[t] ? delete b[t] :
|
|
735
|
-
}(e), e === m && (m = null),
|
|
734
|
+
t = t.toLowerCase(), b[t] ? delete b[t] : hn(`"service NOT found in register": ${t}`);
|
|
735
|
+
}(e), e === m && (m = null), Ht(e, e.dl_subscriptions, !0), Ht(e, e.dl_subscribings, !0), r && ($e(r, e), rt(e) && (st(r) !== e || ot(r) || it(r, null))), function(e) {
|
|
736
736
|
let t = e.dl_children.slice();
|
|
737
737
|
for (let e = 0; e < t.length; e++) {
|
|
738
738
|
let n = t[e];
|
|
@@ -741,9 +741,9 @@ var gobjJs = function(e) {
|
|
|
741
741
|
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && L(n("💔💔⏪ destroyed: %s", tt(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
742
742
|
}
|
|
743
743
|
function Pe(e) {
|
|
744
|
-
if (ot(e)) return
|
|
745
|
-
if (e.running) return
|
|
746
|
-
if (e.disabled) return
|
|
744
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), -1;
|
|
745
|
+
if (e.running) return hn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
746
|
+
if (e.disabled) return hn(`${et(e)}: GObj DISABLED`), -1;
|
|
747
747
|
J(e) && L(n("⏺ ⏺ start: %s", tt(e))), e.running = !0;
|
|
748
748
|
let t = 0;
|
|
749
749
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
@@ -755,9 +755,9 @@ var gobjJs = function(e) {
|
|
|
755
755
|
return e.gclass.gclass_flag & w.gcflag_manual_start || Ye(e) ? 1 : (Ke(e) || Pe(e), 0);
|
|
756
756
|
}
|
|
757
757
|
function Ve(e) {
|
|
758
|
-
if (ot(e)) return
|
|
759
|
-
if (!e.running) return
|
|
760
|
-
e.playing && (
|
|
758
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), -1;
|
|
759
|
+
if (!e.running) return hn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
760
|
+
e.playing && (yn(`${et(e)}: GObj stopping without previous pause`), xe(e)), J(e) && L(n("⏹ ⏹ stop: %s", tt(e))), e.running = !1;
|
|
761
761
|
let t = 0;
|
|
762
762
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
763
763
|
}
|
|
@@ -765,22 +765,22 @@ var gobjJs = function(e) {
|
|
|
765
765
|
return Ke(e) && Ve(e), 0;
|
|
766
766
|
}
|
|
767
767
|
function Me(e) {
|
|
768
|
-
return ot(e) ? (
|
|
768
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : at(e, D.WALK_FIRST2LAST, Ge, 0, 0);
|
|
769
769
|
}
|
|
770
770
|
function We(e) {
|
|
771
|
-
if (ot(e)) return
|
|
772
|
-
if (e.playing) return
|
|
773
|
-
if (e.disabled) return
|
|
771
|
+
if (ot(e)) return hn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
772
|
+
if (e.playing) return hn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
773
|
+
if (e.disabled) return hn(`${et(e)}: GObj DISABLED`), -1;
|
|
774
774
|
if (!Ke(e)) {
|
|
775
|
-
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return
|
|
776
|
-
|
|
775
|
+
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return hn(`${et(e)}: Cannot play, start not done`), -1;
|
|
776
|
+
yn(`${et(e)}: GObj playing without previous start`), Pe(e);
|
|
777
777
|
}
|
|
778
778
|
J(e) && L(n("⏯ ⏯ play: %s", tt(e))), e.playing = !0;
|
|
779
779
|
let t = 0;
|
|
780
780
|
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), (t < 0 || !1 === t) && (e.playing = !1)), t;
|
|
781
781
|
}
|
|
782
782
|
function xe(e) {
|
|
783
|
-
return ot(e) ? (
|
|
783
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && L(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (hn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
784
784
|
}
|
|
785
785
|
function Ke(e) {
|
|
786
786
|
return !ot(e) && e.running;
|
|
@@ -810,54 +810,54 @@ var gobjJs = function(e) {
|
|
|
810
810
|
return e ? jt(e, "yuno_id") : "";
|
|
811
811
|
}
|
|
812
812
|
function Xe(e) {
|
|
813
|
-
return
|
|
813
|
+
return sr(e) ? e.gobj_name : (hn("gobj bad type"), null);
|
|
814
814
|
}
|
|
815
815
|
function Ze(e) {
|
|
816
|
-
return
|
|
816
|
+
return sr(e) ? e.gclass.gclass_name : (hn("gobj NULL of bad type"), null);
|
|
817
817
|
}
|
|
818
818
|
function et(e) {
|
|
819
|
-
return
|
|
819
|
+
return sr(e) ? e.gclass.gclass_name + "^" + Xe(e) : (hn("gobj bad type"), null);
|
|
820
820
|
}
|
|
821
821
|
function tt(e) {
|
|
822
|
-
if (!
|
|
822
|
+
if (!sr(e)) return hn("gobj NULL of bad type"), null;
|
|
823
823
|
let t = et(e), n = nt(e);
|
|
824
824
|
for (; n;) t = et(n) + "`" + t, n = nt(n);
|
|
825
825
|
return t;
|
|
826
826
|
}
|
|
827
827
|
function nt(e) {
|
|
828
|
-
return
|
|
828
|
+
return sr(e) ? e.parent : (hn("gobj NULL of bad type"), null);
|
|
829
829
|
}
|
|
830
830
|
function rt(e) {
|
|
831
|
-
return
|
|
831
|
+
return sr(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (hn("gobj NULL of bad type"), null);
|
|
832
832
|
}
|
|
833
833
|
function lt(e) {
|
|
834
|
-
return
|
|
834
|
+
return sr(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (hn("gobj NULL of bad type"), null);
|
|
835
835
|
}
|
|
836
836
|
function ot(e) {
|
|
837
|
-
return !
|
|
837
|
+
return !sr(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
838
838
|
}
|
|
839
839
|
function st(e) {
|
|
840
|
-
return
|
|
840
|
+
return sr(e) ? e.bottom_gobj : (hn("gobj NULL of bad type"), null);
|
|
841
841
|
}
|
|
842
842
|
function it(e, t) {
|
|
843
|
-
if (!
|
|
844
|
-
e.bottom_gobj && t &&
|
|
843
|
+
if (!sr(e)) return hn("gobj NULL of bad type"), null;
|
|
844
|
+
e.bottom_gobj && t && yn(`${et(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
845
845
|
}
|
|
846
846
|
function _t(e, t, n) {
|
|
847
|
-
return
|
|
847
|
+
return sr(e) ? t ? ge(e.gclass, t, n) : e.gclass.attrs_table : (hn("gobj NULL of bad type"), null);
|
|
848
848
|
}
|
|
849
849
|
function at(e, t, n, r, l) {
|
|
850
|
-
return ot(e) ? (
|
|
850
|
+
return ot(e) ? (hn("gobj NULL, destroying, or bad type"), 0) : ft(e.dl_children, t, n, r, l);
|
|
851
851
|
}
|
|
852
852
|
function ut(e, t, n, r, l) {
|
|
853
|
-
return ot(e) ? (
|
|
853
|
+
return ot(e) ? (hn("gobj NULL, destroying, or bad type"), 0) : dt(e.dl_children, t, n, r, l);
|
|
854
854
|
}
|
|
855
855
|
function ct(e) {
|
|
856
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
856
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || hn(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
857
857
|
}
|
|
858
858
|
function ft(e, t, n, r, l) {
|
|
859
859
|
let o, s = [...e];
|
|
860
|
-
if (t &
|
|
860
|
+
if (t & D.WALK_LAST2FIRST) for (let e = s.length; e > 0; e--) {
|
|
861
861
|
o = s[e - 1];
|
|
862
862
|
let t = ct(n(o, r, l));
|
|
863
863
|
if (t < 0) return t;
|
|
@@ -872,15 +872,15 @@ var gobjJs = function(e) {
|
|
|
872
872
|
function gt(e, t, n, r, l) {
|
|
873
873
|
let o, s = ft(e, t, n, r, l);
|
|
874
874
|
if (s < 0) return s;
|
|
875
|
-
if (t &
|
|
875
|
+
if (t & D.WALK_LAST2FIRST) {
|
|
876
876
|
for (let i = e.length; i > 0; i--) if (o = e[i - 1], s = gt([...o.dl_children], t, n, r, l), s < 0) return s;
|
|
877
877
|
} else for (let i = 0; i < e.length; i++) if (o = e[i], s = gt([...o.dl_children], t, n, r, l), s < 0) return s;
|
|
878
878
|
return s;
|
|
879
879
|
}
|
|
880
880
|
function dt(e, t, n, r, l) {
|
|
881
|
-
if (t &
|
|
881
|
+
if (t & D.WALK_BYLEVEL) return gt(e, t, n, r, l);
|
|
882
882
|
let o, s;
|
|
883
|
-
if (t &
|
|
883
|
+
if (t & D.WALK_BOTTOM2TOP) for (let i = e.length; i > 0; i--) {
|
|
884
884
|
if (s = e[i - 1], o = dt([...s.dl_children], t, n, r, l), o < 0) return o;
|
|
885
885
|
if (o = ct(n(s, r, l)), o < 0) return o;
|
|
886
886
|
}
|
|
@@ -891,7 +891,7 @@ var gobjJs = function(e) {
|
|
|
891
891
|
return 0;
|
|
892
892
|
}
|
|
893
893
|
function bt(e, t) {
|
|
894
|
-
if (!
|
|
894
|
+
if (!sr(e)) return hn("gobj NULL of bad type"), !1;
|
|
895
895
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
896
896
|
t.__disabled__;
|
|
897
897
|
let o = t.__state__;
|
|
@@ -907,7 +907,7 @@ var gobjJs = function(e) {
|
|
|
907
907
|
return !0;
|
|
908
908
|
}
|
|
909
909
|
function pt(e, t) {
|
|
910
|
-
if (ot(e)) return
|
|
910
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), null;
|
|
911
911
|
const n = e.dl_children;
|
|
912
912
|
for (let e = 0; e < n.length; e++) {
|
|
913
913
|
const r = n[e];
|
|
@@ -935,57 +935,57 @@ var gobjJs = function(e) {
|
|
|
935
935
|
return o ? (n.splice(0, 1), n = n.join("`"), mt(o, n)) : null;
|
|
936
936
|
}
|
|
937
937
|
function ht(e, t) {
|
|
938
|
-
return !
|
|
938
|
+
return !ir(t) && !!ge(e.gclass, t, !1);
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function yt(e, t, n) {
|
|
941
941
|
let r = e.jn_attrs;
|
|
942
|
-
if (t in r &&
|
|
942
|
+
if (t in r && Object.prototype.hasOwnProperty.call(r, t)) {
|
|
943
943
|
let n = r[t];
|
|
944
944
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
945
945
|
}
|
|
946
|
-
return
|
|
946
|
+
return hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
947
947
|
}
|
|
948
|
-
function
|
|
948
|
+
function Et(e, t, n) {
|
|
949
949
|
let r = {}, l = e.gclass.attrs_table;
|
|
950
950
|
for (let n = 0; n < l.length; n++) {
|
|
951
951
|
const o = l[n];
|
|
952
952
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
953
953
|
let t;
|
|
954
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t =
|
|
954
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = xn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = xn(e.jn_attrs, o.name))), Yn(r, o.name, t);
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
957
|
return r;
|
|
958
958
|
}
|
|
959
959
|
function Tt(e, t) {
|
|
960
960
|
if (t) {
|
|
961
|
-
if (0 ===
|
|
962
|
-
if (0 ===
|
|
963
|
-
if (0 ===
|
|
964
|
-
if (0 ===
|
|
961
|
+
if (0 === ur(t, "__disabled__")) return Ye(e);
|
|
962
|
+
if (0 === ur(t, "__running__")) return Ke(e);
|
|
963
|
+
if (0 === ur(t, "__playing__")) return Je(e);
|
|
964
|
+
if (0 === ur(t, "__service__")) return Be(e);
|
|
965
965
|
}
|
|
966
966
|
let n = fe(e, t, !1);
|
|
967
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
967
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
968
968
|
}
|
|
969
969
|
function vt(e, t) {
|
|
970
|
-
t &&
|
|
970
|
+
t && ur(t, "__trace_level__");
|
|
971
971
|
let n = fe(e, t, !1);
|
|
972
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
972
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
973
973
|
}
|
|
974
974
|
function jt(e, t) {
|
|
975
|
-
if (t && 0 ===
|
|
975
|
+
if (t && 0 === ur(t, "__state__")) return kt(e);
|
|
976
976
|
let n = fe(e, t, !1);
|
|
977
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
977
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
978
978
|
}
|
|
979
979
|
function Ot(e, t) {
|
|
980
980
|
let n = fe(e, t, !1);
|
|
981
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
981
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
982
982
|
}
|
|
983
983
|
function St(e, t, r, l) {
|
|
984
|
-
if (!
|
|
984
|
+
if (!tr(t)) return hn(n("gobj_write_attr(%s): path must be a string", et(e))), -1;
|
|
985
985
|
let o, s = e.jn_attrs, i = t.split("`");
|
|
986
986
|
if (i.length <= 1) {
|
|
987
987
|
let l = t;
|
|
988
|
-
return l in s &&
|
|
988
|
+
return l in s && Object.prototype.hasOwnProperty.call(s, l) ? (s[l] = r, Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, l) && (e.priv[l] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (hn(n("gobj_write_attr(%s): attr not found '%s'", et(e), l)), -1);
|
|
989
989
|
}
|
|
990
990
|
let _ = i.length;
|
|
991
991
|
for (let t = 0; t < _; t++) {
|
|
@@ -996,10 +996,10 @@ var gobjJs = function(e) {
|
|
|
996
996
|
continue;
|
|
997
997
|
}
|
|
998
998
|
let l = e.jn_attrs;
|
|
999
|
-
if (o in l &&
|
|
999
|
+
if (o in l && Object.prototype.hasOwnProperty.call(l, o)) return l[o] = r, Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o) && (e.priv[o] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0;
|
|
1000
1000
|
break;
|
|
1001
1001
|
}
|
|
1002
|
-
return
|
|
1002
|
+
return hn(n("gobj_write_attr(%s): attr not found '%s'", et(e), o)), -1;
|
|
1003
1003
|
}
|
|
1004
1004
|
function wt(e, t, n, r) {
|
|
1005
1005
|
let l = ce(e), o = 0;
|
|
@@ -1011,21 +1011,21 @@ var gobjJs = function(e) {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
function Nt(e, t, n) {
|
|
1013
1013
|
let r = fe(e, t, !1);
|
|
1014
|
-
return r ? (r[t] =
|
|
1014
|
+
return r ? (r[t] = _r(n), Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1015
1015
|
}
|
|
1016
1016
|
function Rt(e, t, n) {
|
|
1017
1017
|
let r = fe(e, t, !1);
|
|
1018
|
-
return r ? (r[t] = parseInt(n),
|
|
1018
|
+
return r ? (r[t] = parseInt(n), Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1020
|
+
function $t(e, t, n) {
|
|
1021
1021
|
let r = fe(e, t, !1);
|
|
1022
|
-
return r ? (r[t] = String(n),
|
|
1022
|
+
return r ? (r[t] = String(n), Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1025
|
-
if (ot(e)) return
|
|
1024
|
+
function Dt(e, t) {
|
|
1025
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), null;
|
|
1026
1026
|
if (e.current_state.state_name === t) return !1;
|
|
1027
1027
|
let r = pe(e.gclass, t);
|
|
1028
|
-
if (!r) return
|
|
1028
|
+
if (!r) return hn(`${et(e)}: state unknown, state ${t}`), !1;
|
|
1029
1029
|
e.last_state = e.current_state, e.current_state = r;
|
|
1030
1030
|
let l = H(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1031
1031
|
return x(e) & P.TRACE_STATES;
|
|
@@ -1033,10 +1033,10 @@ var gobjJs = function(e) {
|
|
|
1033
1033
|
return (l || o) && (1 === C || L(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ze(e), Xe(e), kt(e), e.last_state.state_name))), !0;
|
|
1034
1034
|
}
|
|
1035
1035
|
function kt(e) {
|
|
1036
|
-
return
|
|
1036
|
+
return sr(e) ? e.current_state.state_name : (hn("hgobj NULL"), "");
|
|
1037
1037
|
}
|
|
1038
1038
|
function At(e, t, n) {
|
|
1039
|
-
if (!
|
|
1039
|
+
if (!sr(e)) return hn("gobj NULL of bad type"), null;
|
|
1040
1040
|
let r = ve(e.gclass, t);
|
|
1041
1041
|
if (r) return r;
|
|
1042
1042
|
if (n) {
|
|
@@ -1054,10 +1054,18 @@ var gobjJs = function(e) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
function Ct(e, t, n) {
|
|
1056
1056
|
let r = At(e, t, !1);
|
|
1057
|
-
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag &
|
|
1057
|
+
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & $.EVF_OUTPUT_EVENT);
|
|
1058
1058
|
}
|
|
1059
1059
|
var Lt = [], Pt = !1;
|
|
1060
|
-
function Ut() {
|
|
1060
|
+
function Ut(e, t, r, l) {
|
|
1061
|
+
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (hn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : ir(t) ? (hn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (hn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Lt.length}`), -1) : (Lt.push({
|
|
1062
|
+
dst: e,
|
|
1063
|
+
event: t,
|
|
1064
|
+
kw: r,
|
|
1065
|
+
src: l
|
|
1066
|
+
}), H(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ft, 0)), 0) : (hn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (hn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
1067
|
+
}
|
|
1068
|
+
function Ft() {
|
|
1061
1069
|
Pt = !1;
|
|
1062
1070
|
let e = Lt;
|
|
1063
1071
|
Lt = [];
|
|
@@ -1066,53 +1074,53 @@ var gobjJs = function(e) {
|
|
|
1066
1074
|
const r = e[n];
|
|
1067
1075
|
if (!(r.dst.obflag & (R.obflag_destroyed | R.obflag_destroying))) {
|
|
1068
1076
|
try {
|
|
1069
|
-
|
|
1077
|
+
Vt(r.dst, r.event, r.kw, r.src);
|
|
1070
1078
|
} catch (t) {
|
|
1071
|
-
throw (Lt = e.slice(n + 1).concat(Lt)).length > 0 && !Pt && (Pt = !0, setTimeout(
|
|
1079
|
+
throw (Lt = e.slice(n + 1).concat(Lt)).length > 0 && !Pt && (Pt = !0, setTimeout(Ft, 0)), t;
|
|
1072
1080
|
}
|
|
1073
1081
|
t++;
|
|
1074
1082
|
}
|
|
1075
1083
|
}
|
|
1076
|
-
return Lt.length > 0 && !Pt && (Pt = !0, setTimeout(
|
|
1084
|
+
return Lt.length > 0 && !Pt && (Pt = !0, setTimeout(Ft, 0)), t;
|
|
1077
1085
|
}
|
|
1078
|
-
function
|
|
1079
|
-
if (!(e && e instanceof S)) return
|
|
1080
|
-
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return
|
|
1086
|
+
function Vt(e, t, r, l) {
|
|
1087
|
+
if (!(e && e instanceof S)) return hn("gobj dst NULL"), -1;
|
|
1088
|
+
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return hn("gobj dst DESTROYED"), -1;
|
|
1081
1089
|
let o = e.current_state;
|
|
1082
|
-
if (!o) return
|
|
1090
|
+
if (!o) return hn(`${et(e)}: current_state NULL`), -1;
|
|
1083
1091
|
let s = H(e, t) && !z(l, t);
|
|
1084
1092
|
h++;
|
|
1085
1093
|
let i = me(o, t);
|
|
1086
|
-
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && q(e) &&
|
|
1094
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && q(e) && zn(r) && Un(r)), e.gclass.gmt.mt_inject_event(e, t, r, l)) : (s && L(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, t || "", l && !l.running ? "!!" : "", Ze(l), Xe(l))), hn(`📛📛 Event NOT DEFINED in state 📛📛: ${et(e)}, ${o.state_name}, ${t}`), h--, -1);
|
|
1087
1095
|
if (s) {
|
|
1088
1096
|
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1089
1097
|
else {
|
|
1090
1098
|
let r = "";
|
|
1091
|
-
i.action && (r =
|
|
1099
|
+
i.action && (r = Qr(i.action)), L(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, "", t || "", "", r, l && !l.running ? "!!" : "", Ze(l), Xe(l)));
|
|
1092
1100
|
}
|
|
1093
|
-
r && q(e) &&
|
|
1101
|
+
r && q(e) && zn(r) && Un(r);
|
|
1094
1102
|
}
|
|
1095
|
-
i.next_state &&
|
|
1103
|
+
i.next_state && Dt(e, i.next_state);
|
|
1096
1104
|
let _ = -1;
|
|
1097
1105
|
try {
|
|
1098
1106
|
i.action && (_ = i.action(e, t, r, l));
|
|
1099
1107
|
} catch (n) {
|
|
1100
1108
|
if (h--, !n || !n.__gobj_logged__) {
|
|
1101
|
-
|
|
1109
|
+
hn(`${et(e)}: action of ${t} in ${o.state_name} THREW: ${n && n.stack ? n.stack : n}`);
|
|
1102
1110
|
try {
|
|
1103
1111
|
n.__gobj_logged__ = !0;
|
|
1104
1112
|
} catch (e) {}
|
|
1105
1113
|
}
|
|
1106
1114
|
throw n;
|
|
1107
1115
|
}
|
|
1108
|
-
return !s || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "",
|
|
1116
|
+
return !s || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "", nr(_) ? _ : 0)), h--, _;
|
|
1109
1117
|
}
|
|
1110
|
-
var
|
|
1118
|
+
var Gt = Object.freeze({
|
|
1111
1119
|
__rename_event_name__: 1,
|
|
1112
1120
|
__hard_subscription__: 2,
|
|
1113
1121
|
__own_event__: 4
|
|
1114
1122
|
});
|
|
1115
|
-
function
|
|
1123
|
+
function Mt(e) {
|
|
1116
1124
|
let t = String(e).toLowerCase();
|
|
1117
1125
|
for (let e in d) {
|
|
1118
1126
|
let n = d[e].dl_events;
|
|
@@ -1123,76 +1131,76 @@ var gobjJs = function(e) {
|
|
|
1123
1131
|
}
|
|
1124
1132
|
return null;
|
|
1125
1133
|
}
|
|
1126
|
-
var
|
|
1127
|
-
j(
|
|
1128
|
-
j(
|
|
1129
|
-
j(
|
|
1130
|
-
j(
|
|
1131
|
-
j(
|
|
1132
|
-
j(
|
|
1133
|
-
j(
|
|
1134
|
-
j(
|
|
1135
|
-
j(
|
|
1136
|
-
j(
|
|
1134
|
+
var Wt = [
|
|
1135
|
+
j(y.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1136
|
+
j(y.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1137
|
+
j(y.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
1138
|
+
j(y.DTP_STRING, "renamed_event", 0, "", "rename event name"),
|
|
1139
|
+
j(y.DTP_INTEGER, "subs_flag", 0, 0, "subscription flag"),
|
|
1140
|
+
j(y.DTP_JSON, "__config__", 0, null, "subscription config"),
|
|
1141
|
+
j(y.DTP_JSON, "__global__", 0, null, "global kw, merge in publishing"),
|
|
1142
|
+
j(y.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1143
|
+
j(y.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1144
|
+
j(y.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1137
1145
|
v()
|
|
1138
1146
|
];
|
|
1139
|
-
function
|
|
1147
|
+
function xt(e, t) {
|
|
1140
1148
|
let n = e ? e.__config__ : null;
|
|
1141
|
-
if (!
|
|
1149
|
+
if (!Zn(n) || !gr(n, "__hard_subscription__") && !gr(n, "__own_event__") && !gr(n, "__rename_event_name__")) return {
|
|
1142
1150
|
kw: e,
|
|
1143
1151
|
renamed_event: ""
|
|
1144
1152
|
};
|
|
1145
|
-
let r =
|
|
1153
|
+
let r = Gn({}, e), l = Gn({}, n);
|
|
1146
1154
|
r.__config__ = l;
|
|
1147
|
-
let o = "", s = l.__rename_event_name__, i = "string" != typeof s ||
|
|
1148
|
-
return i && (o = i.event_name, delete l.__rename_event_name__, t &&
|
|
1155
|
+
let o = "", s = l.__rename_event_name__, i = "string" != typeof s || ir(s) ? null : Mt(s);
|
|
1156
|
+
return i && (o = i.event_name, delete l.__rename_event_name__, t && Xn(r.__global__) > 0 && (r.__global__ = Gn(Gn({}, r.__global__), { __original_event_name__: t }))), delete l.__hard_subscription__, delete l.__own_event__, {
|
|
1149
1157
|
kw: r,
|
|
1150
1158
|
renamed_event: o
|
|
1151
1159
|
};
|
|
1152
1160
|
}
|
|
1153
|
-
function
|
|
1154
|
-
let s =
|
|
1155
|
-
if (t && t !==
|
|
1156
|
-
let t =
|
|
1157
|
-
|
|
1161
|
+
function Kt(e, t, n, r, l, o) {
|
|
1162
|
+
let s = vr(t, l, "__config__", null), i = vr(t, l, "__global__", null), _ = vr(t, l, "__local__", null), a = jr(t, l, "__filter__", null), u = !0;
|
|
1163
|
+
if (t && t !== Tr(null, e, "publisher", null) && (u = !1), o && o !== Tr(null, e, "subscriber", null) && (u = !1), n && n !== Er(null, e, "event", "") && (u = !1), r && r !== Er(null, e, "renamed_event", "") && (u = !1), Xn(s) > 0) {
|
|
1164
|
+
let t = vr(null, e, "__config__", null);
|
|
1165
|
+
Xn(t) > 0 && Vn(t, s) || (u = !1);
|
|
1158
1166
|
}
|
|
1159
|
-
if (
|
|
1160
|
-
let t =
|
|
1161
|
-
|
|
1167
|
+
if (Xn(i) > 0) {
|
|
1168
|
+
let t = vr(null, e, "__global__", null);
|
|
1169
|
+
Xn(t) > 0 && Vn(t, i) || (u = !1);
|
|
1162
1170
|
}
|
|
1163
|
-
if (
|
|
1164
|
-
let t =
|
|
1165
|
-
|
|
1171
|
+
if (Xn(_) > 0) {
|
|
1172
|
+
let t = vr(null, e, "__local__", null);
|
|
1173
|
+
Xn(t) > 0 && Vn(t, _) || (u = !1);
|
|
1166
1174
|
}
|
|
1167
|
-
if (
|
|
1168
|
-
let t =
|
|
1169
|
-
|
|
1175
|
+
if (Xn(a) > 0) {
|
|
1176
|
+
let t = jr(null, e, "__filter__", null);
|
|
1177
|
+
Xn(t) > 0 && Vn(t, a) || (u = !1);
|
|
1170
1178
|
}
|
|
1171
1179
|
return u;
|
|
1172
1180
|
}
|
|
1173
|
-
function
|
|
1181
|
+
function Yt(e, t, n, r, l, o) {
|
|
1174
1182
|
let s = [];
|
|
1175
1183
|
for (let i = 0; i < e.length; i++) {
|
|
1176
1184
|
let _ = e[i];
|
|
1177
|
-
|
|
1185
|
+
Kt(_, t, n, r, l, o) && Jn(s, _);
|
|
1178
1186
|
}
|
|
1179
1187
|
return s;
|
|
1180
1188
|
}
|
|
1181
|
-
function
|
|
1189
|
+
function Bt(e, t) {
|
|
1182
1190
|
return e.indexOf(t);
|
|
1183
1191
|
}
|
|
1184
|
-
function Bt(e, t, r, l) {
|
|
1185
|
-
let o = yr(e, t, "publisher", null, Xt.KW_REQUIRED), s = yr(e, t, "subscriber", null, Xt.KW_REQUIRED), i = Er(e, t, "event", "", Xt.KW_REQUIRED);
|
|
1186
|
-
if (!!(hr(e, t, "subs_flag", null, Xt.KW_REQUIRED) & Vt.__hard_subscription__) && !r) return -1;
|
|
1187
|
-
let _ = B(s) || B(o);
|
|
1188
|
-
if (Yt(o.dl_subscriptions, t) < 0) return _ && L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", i || "", et(o), et(s))), 1;
|
|
1189
|
-
_ && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), Tn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1190
|
-
let a = Yt(o.dl_subscriptions, t);
|
|
1191
|
-
return a >= 0 ? qn(o.dl_subscriptions, a) : (mn(`${et(e)}: subscription in publisher not found`), Tn(t)), a = Yt(s.dl_subscribings, t), a >= 0 ? qn(s.dl_subscribings, a) : (mn(`${et(e)}: subscription in subscriber not found`), Tn(t)), 0;
|
|
1192
|
-
}
|
|
1193
1192
|
function Jt(e, t, r, l) {
|
|
1194
|
-
|
|
1195
|
-
if (
|
|
1193
|
+
let o = Tr(e, t, "publisher", null, Zt.KW_REQUIRED), s = Tr(e, t, "subscriber", null, Zt.KW_REQUIRED), i = Er(e, t, "event", "", Zt.KW_REQUIRED);
|
|
1194
|
+
if (!!(yr(e, t, "subs_flag", null, Zt.KW_REQUIRED) & Gt.__hard_subscription__) && !r) return -1;
|
|
1195
|
+
let _ = B(s) || B(o);
|
|
1196
|
+
if (Bt(o.dl_subscriptions, t) < 0) return _ && L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", i || "", et(o), et(s))), 1;
|
|
1197
|
+
_ && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), vn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1198
|
+
let a = Bt(o.dl_subscriptions, t);
|
|
1199
|
+
return a >= 0 ? Hn(o.dl_subscriptions, a) : (hn(`${et(e)}: subscription in publisher not found`), vn(t)), a = Bt(s.dl_subscribings, t), a >= 0 ? Hn(s.dl_subscribings, a) : (hn(`${et(e)}: subscription in subscriber not found`), vn(t)), 0;
|
|
1200
|
+
}
|
|
1201
|
+
function qt(e, t, r, l) {
|
|
1202
|
+
if (null == r && (r = {}), !e) return hn(`publisher NULL: ev ${t}`), 0;
|
|
1203
|
+
if (!l) return hn(`subscriber NULL: ev ${t}`), 0;
|
|
1196
1204
|
const o = /* @__PURE__ */ new Set([
|
|
1197
1205
|
"__config__",
|
|
1198
1206
|
"__global__",
|
|
@@ -1201,72 +1209,72 @@ var gobjJs = function(e) {
|
|
|
1201
1209
|
"__service__"
|
|
1202
1210
|
]);
|
|
1203
1211
|
if (Object.keys(r).forEach((n) => {
|
|
1204
|
-
o.has(n) ||
|
|
1205
|
-
}),
|
|
1206
|
-
else if (!(Ct(e, t,
|
|
1207
|
-
let s =
|
|
1208
|
-
for (let t = 0; t < i.length; t++) if (
|
|
1212
|
+
o.has(n) || hn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1213
|
+
}), ir(t)) t = "";
|
|
1214
|
+
else if (!(Ct(e, t, $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return hn(`event NOT in output event list: ${et(e)}, ${t}`), 0;
|
|
1215
|
+
let s = xt(r, t), i = Yt(e.dl_subscriptions, e, t, s.renamed_event, s.kw, l), _ = null;
|
|
1216
|
+
for (let t = 0; t < i.length; t++) if (yr(e, i[t], "subs_flag", 0, Zt.KW_REQUIRED) & Gt.__hard_subscription__) {
|
|
1209
1217
|
_ = i[t];
|
|
1210
1218
|
break;
|
|
1211
1219
|
}
|
|
1212
|
-
if (_) return
|
|
1213
|
-
|
|
1220
|
+
if (_) return yn(`${et(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${t}, subscriber: ${et(l)})`), _;
|
|
1221
|
+
Qn(i) > 0 && (hn(`${et(e)}: ${Qn(i)} subscription(s) REPEATED, will be deleted and override`), vn(i, "subscription REPEATED"), Ht(e, i, !1));
|
|
1214
1222
|
let a = function(e, t, n, r) {
|
|
1215
|
-
let l = _e(e,
|
|
1216
|
-
|
|
1223
|
+
let l = _e(e, Wt);
|
|
1224
|
+
Bn(l, "event", t), Bn(l, "subscriber", r), Bn(l, "publisher", e);
|
|
1217
1225
|
let o = 0;
|
|
1218
1226
|
if (n) {
|
|
1219
|
-
let r =
|
|
1220
|
-
if (
|
|
1221
|
-
let n =
|
|
1222
|
-
|
|
1227
|
+
let r = vr(e, n, "__config__", null), s = vr(e, n, "__global__", null), i = vr(e, n, "__local__", null), _ = jr(e, n, "__filter__", null), a = Er(e, n, "__service__", "");
|
|
1228
|
+
if (Xn(s) > 0 && Bn(l, "__global__", Fn(s)), Xn(r) > 0) {
|
|
1229
|
+
let n = Fn(r);
|
|
1230
|
+
Bn(l, "__config__", n);
|
|
1223
1231
|
let s = Er(e, n, "__rename_event_name__", "");
|
|
1224
|
-
if (!
|
|
1225
|
-
let r =
|
|
1232
|
+
if (!ir(s)) {
|
|
1233
|
+
let r = Mt(s);
|
|
1226
1234
|
if (r) {
|
|
1227
|
-
|
|
1228
|
-
let s =
|
|
1229
|
-
|
|
1230
|
-
} else
|
|
1235
|
+
Bn(l, "renamed_event", r.event_name), delete n.__rename_event_name__, o |= Gt.__rename_event_name__;
|
|
1236
|
+
let s = vr(e, l, "__global__", null);
|
|
1237
|
+
Zn(s) || (s = {}, Bn(l, "__global__", s)), s.__original_event_name__ = t;
|
|
1238
|
+
} else hn(`${et(e)}: EVENT NOT FOUND (__rename_event_name__: ${s})`);
|
|
1231
1239
|
}
|
|
1232
|
-
if (
|
|
1233
|
-
let t =
|
|
1234
|
-
|
|
1240
|
+
if (gr(n, "__hard_subscription__")) {
|
|
1241
|
+
let t = hr(e, n, "__hard_subscription__", !1);
|
|
1242
|
+
Kn(n, "__hard_subscription__"), t && (o |= Gt.__hard_subscription__);
|
|
1235
1243
|
}
|
|
1236
|
-
if (
|
|
1237
|
-
let t =
|
|
1238
|
-
|
|
1244
|
+
if (gr(n, "__own_event__")) {
|
|
1245
|
+
let t = hr(e, n, "__own_event__", !1);
|
|
1246
|
+
Kn(n, "__own_event__"), t && (o |= Gt.__own_event__);
|
|
1239
1247
|
}
|
|
1240
1248
|
}
|
|
1241
|
-
|
|
1249
|
+
Xn(i) > 0 && Bn(l, "__local__", Fn(i)), Xn(_) > 0 && Bn(l, "__filter__", Fn(_)), ir(a) || Bn(l, "__service__", a);
|
|
1242
1250
|
}
|
|
1243
|
-
return
|
|
1251
|
+
return Bn(l, "subs_flag", o), l;
|
|
1244
1252
|
}(e, t, r, l);
|
|
1245
|
-
if (!a) return
|
|
1246
|
-
if (
|
|
1253
|
+
if (!a) return hn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1254
|
+
if (Jn(e.dl_subscriptions, a), Jn(l.dl_subscribings, a), (B(l) || B(e)) && (L(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", et(e), et(l))), r && (q(l) || q(e)) && Un(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1247
1255
|
let t = e.gclass.gmt.mt_subscription_added(e, a);
|
|
1248
|
-
(t < 0 || !1 === t) && (
|
|
1256
|
+
(t < 0 || !1 === t) && (Jt(e, a, !0, !0), a = 0);
|
|
1249
1257
|
}
|
|
1250
1258
|
return a;
|
|
1251
1259
|
}
|
|
1252
|
-
function
|
|
1260
|
+
function Ht(e, t, n) {
|
|
1253
1261
|
let r = [...t], l = 0;
|
|
1254
|
-
for (let t = 0; t < r.length; t++)
|
|
1255
|
-
return l &&
|
|
1256
|
-
}
|
|
1257
|
-
function Ht(e, t, n, r) {
|
|
1258
|
-
return null == n && (n = {}), Kt(e.dl_subscriptions, e, t, null, n, r);
|
|
1262
|
+
for (let t = 0; t < r.length; t++) Jt(e, r[t], n, !1) > 0 && l++;
|
|
1263
|
+
return l && yn(`${et(e)}: Subscription(s) already removed, nothing to remove (count: ${l})`), 0;
|
|
1259
1264
|
}
|
|
1260
1265
|
function zt(e, t, n, r) {
|
|
1261
|
-
return
|
|
1266
|
+
return null == n && (n = {}), Yt(e.dl_subscriptions, e, t, null, n, r);
|
|
1267
|
+
}
|
|
1268
|
+
function Qt(e, t, n, r) {
|
|
1269
|
+
return Yt(e.dl_subscribings, r, t, null, n, e);
|
|
1262
1270
|
}
|
|
1263
|
-
function
|
|
1264
|
-
if (
|
|
1265
|
-
if (
|
|
1271
|
+
function Xt(e, t, r) {
|
|
1272
|
+
if (Zn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return hn("gobj NULL or DESTROYED"), -1;
|
|
1273
|
+
if (ir(t)) return hn(`${et(e)}: event EMPTY`), -1;
|
|
1266
1274
|
let l = At(e, t, !0);
|
|
1267
|
-
if (!(l && l.event_flag & (
|
|
1275
|
+
if (!(l && l.event_flag & ($.EVF_SYSTEM_EVENT | $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return hn(`event NOT in output event list: ${et(e)}, ev ${t}`), -1;
|
|
1268
1276
|
let o = (B(e) || H(e, t)) && !z(e, t);
|
|
1269
|
-
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), q(e) &&
|
|
1277
|
+
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), q(e) && zn(r) && Un(r)), e.gclass.gmt.mt_publish_event) {
|
|
1270
1278
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1271
1279
|
if (n <= 0) return n;
|
|
1272
1280
|
}
|
|
@@ -1278,31 +1286,31 @@ var gobjJs = function(e) {
|
|
|
1278
1286
|
if (n < 0) break;
|
|
1279
1287
|
if (!n) continue;
|
|
1280
1288
|
}
|
|
1281
|
-
let u =
|
|
1289
|
+
let u = Tr(e, a, "subscriber", null, Zt.KW_REQUIRED);
|
|
1282
1290
|
if (!u || ot(u)) continue;
|
|
1283
|
-
let c =
|
|
1284
|
-
if (
|
|
1285
|
-
|
|
1286
|
-
let l =
|
|
1287
|
-
|
|
1291
|
+
let c = yr(e, a, "subs_flag", 0, Zt.KW_REQUIRED), f = Er(e, a, "event", "", Zt.KW_REQUIRED);
|
|
1292
|
+
if (ir(f) || 0 === ur(f, t)) {
|
|
1293
|
+
vr(e, a, "__config__", null, 0);
|
|
1294
|
+
let l = vr(e, a, "__global__", null, 0), s = vr(e, a, "__local__", null, 0), f = jr(e, a, "__filter__", null, 0), g = a.renamed_event;
|
|
1295
|
+
ir(g) && (g = t);
|
|
1288
1296
|
let d = 1;
|
|
1289
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, r, u) :
|
|
1297
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, r, u) : Xn(f) > 0 && (d = Nr(r, f) ? 1 : 0, o && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), vn(f))), d < 0) break;
|
|
1290
1298
|
if (!d) continue;
|
|
1291
1299
|
let b = At(u, t, !0);
|
|
1292
|
-
if (b && b.event_flag &
|
|
1300
|
+
if (b && b.event_flag & $.EVF_SYSTEM_EVENT && !It(u, b.event_name, 0)) continue;
|
|
1293
1301
|
let p = r;
|
|
1294
|
-
(
|
|
1295
|
-
let m =
|
|
1296
|
-
if (m < 0 && c &
|
|
1302
|
+
(Xn(s) > 0 || Xn(l) > 0) && (p = Gn({}, r)), Xn(s) > 0 && fr(p, s), Xn(l) > 0 && Gn(p, Fn(l)), o && (L(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", g || "", u.running ? "" : "!!", et(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", u.running ? "" : "!!", et(u), kt(u), t || "", g || "", e && !e.running ? "!!" : "", et(e))), q(e) && zn(p) && Un(p));
|
|
1303
|
+
let m = Vt(u, g, p, e);
|
|
1304
|
+
if (m < 0 && c & Gt.__own_event__) {
|
|
1297
1305
|
i = -1;
|
|
1298
1306
|
break;
|
|
1299
1307
|
}
|
|
1300
1308
|
if (_ += m, i++, ot(e)) break;
|
|
1301
1309
|
}
|
|
1302
1310
|
}
|
|
1303
|
-
return i || l && l.event_flag &
|
|
1311
|
+
return i || l && l.event_flag & $.EVF_NO_WARN_SUBS || yn(`${et(e)}: Publish event WITHOUT subscribers, ev ${t}`), _;
|
|
1304
1312
|
}
|
|
1305
|
-
var
|
|
1313
|
+
var Zt = Object.freeze({
|
|
1306
1314
|
KW_REQUIRED: 1,
|
|
1307
1315
|
KW_CREATE: 2,
|
|
1308
1316
|
KW_WILD_NUMBER: 4,
|
|
@@ -1322,55 +1330,55 @@ var gobjJs = function(e) {
|
|
|
1322
1330
|
JSON_FALSE: 7,
|
|
1323
1331
|
JSON_NULL: 8
|
|
1324
1332
|
});
|
|
1325
|
-
var
|
|
1326
|
-
var
|
|
1327
|
-
var
|
|
1328
|
-
function
|
|
1329
|
-
if (!
|
|
1330
|
-
if (!
|
|
1333
|
+
var en = "undefined" != typeof window ? window.console : console, tn = en.error, nn = en.warn, rn = en.info, ln = en.debug, on = null, sn = 600, _n = [];
|
|
1334
|
+
var an = !0;
|
|
1335
|
+
var un = null;
|
|
1336
|
+
function cn(e, t) {
|
|
1337
|
+
if (!an) return !1;
|
|
1338
|
+
if (!un) return !0;
|
|
1331
1339
|
try {
|
|
1332
|
-
return !!
|
|
1340
|
+
return !!un(e, t);
|
|
1333
1341
|
} catch (e) {
|
|
1334
1342
|
return !0;
|
|
1335
1343
|
}
|
|
1336
1344
|
}
|
|
1337
|
-
var
|
|
1338
|
-
function
|
|
1339
|
-
|
|
1345
|
+
var fn = !1;
|
|
1346
|
+
function gn(e, t, n) {
|
|
1347
|
+
fn || (function(e, t, n) {
|
|
1340
1348
|
let r = t;
|
|
1341
1349
|
if ("json" === e) try {
|
|
1342
1350
|
r = JSON.stringify(t);
|
|
1343
1351
|
} catch (e) {
|
|
1344
1352
|
r = String(t);
|
|
1345
1353
|
}
|
|
1346
|
-
|
|
1354
|
+
_n.push([
|
|
1347
1355
|
e,
|
|
1348
1356
|
r,
|
|
1349
1357
|
n
|
|
1350
|
-
]),
|
|
1351
|
-
}(e, t, n),
|
|
1358
|
+
]), _n.length > sn && _n.shift();
|
|
1359
|
+
}(e, t, n), dn(e, t, n));
|
|
1352
1360
|
}
|
|
1353
|
-
function
|
|
1354
|
-
if (
|
|
1355
|
-
|
|
1361
|
+
function dn(e, t, n) {
|
|
1362
|
+
if (on && !fn) {
|
|
1363
|
+
fn = !0;
|
|
1356
1364
|
try {
|
|
1357
|
-
|
|
1365
|
+
on(e, t, n);
|
|
1358
1366
|
} catch (e) {} finally {
|
|
1359
|
-
|
|
1367
|
+
fn = !1;
|
|
1360
1368
|
}
|
|
1361
1369
|
}
|
|
1362
1370
|
}
|
|
1363
|
-
function dn(e) {
|
|
1364
|
-
e ? (en = e, tn = e) : (en = Zt.error, tn = Zt.warn);
|
|
1365
|
-
}
|
|
1366
1371
|
function bn(e) {
|
|
1372
|
+
e ? (tn = e, nn = e) : (tn = en.error, nn = en.warn);
|
|
1373
|
+
}
|
|
1374
|
+
function pn(e) {
|
|
1367
1375
|
try {
|
|
1368
1376
|
return JSON.stringify(e);
|
|
1369
1377
|
} catch (t) {
|
|
1370
1378
|
return String(e);
|
|
1371
1379
|
}
|
|
1372
1380
|
}
|
|
1373
|
-
function
|
|
1381
|
+
function mn(e) {
|
|
1374
1382
|
const t = Array.prototype.slice.call(arguments);
|
|
1375
1383
|
let n = "";
|
|
1376
1384
|
if ("string" == typeof e) {
|
|
@@ -1384,35 +1392,35 @@ var gobjJs = function(e) {
|
|
|
1384
1392
|
case "%i": return parseInt(n);
|
|
1385
1393
|
case "%f": return parseFloat(n);
|
|
1386
1394
|
case "%o":
|
|
1387
|
-
case "%O": return "object" == typeof n ?
|
|
1395
|
+
case "%O": return "object" == typeof n ? pn(n) : String(n);
|
|
1388
1396
|
default: return e;
|
|
1389
1397
|
}
|
|
1390
1398
|
});
|
|
1391
|
-
const l = t.slice(r).map((e) => "object" == typeof e ?
|
|
1399
|
+
const l = t.slice(r).map((e) => "object" == typeof e ? pn(e) : String(e));
|
|
1392
1400
|
l.length > 0 && (n += " " + l.join(" "));
|
|
1393
|
-
} else n = t.map((e) => "object" == typeof e ?
|
|
1401
|
+
} else n = t.map((e) => "object" == typeof e ? pn(e) : String(e)).join(" ");
|
|
1394
1402
|
return n;
|
|
1395
1403
|
}
|
|
1396
|
-
function mn(e, ...t) {
|
|
1397
|
-
let n = pn(e, ...t), r = Jr();
|
|
1398
|
-
en && (en === Zt.error ? un("error", n) && en("%c" + r + " ERROR: " + String(n), "color:red") : (un("error", n) && Zt.error("%c" + r + " ERROR: " + String(n), "color:red"), en(`${r} ERROR: ${String(n)}`))), fn("error", n, r);
|
|
1399
|
-
}
|
|
1400
1404
|
function hn(e, ...t) {
|
|
1401
|
-
let n =
|
|
1402
|
-
tn && (tn ===
|
|
1405
|
+
let n = mn(e, ...t), r = qr();
|
|
1406
|
+
tn && (tn === en.error ? cn("error", n) && tn("%c" + r + " ERROR: " + String(n), "color:red") : (cn("error", n) && en.error("%c" + r + " ERROR: " + String(n), "color:red"), tn(`${r} ERROR: ${String(n)}`))), gn("error", n, r);
|
|
1407
|
+
}
|
|
1408
|
+
function yn(e, ...t) {
|
|
1409
|
+
let n = mn(e, ...t), r = qr();
|
|
1410
|
+
nn && (nn === en.warn ? cn("warning", n) && nn("%c" + r + " WARNING: " + String(n), "color:yellow") : (cn("warning", n) && en.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), nn(`${r} WARNING: ${String(n)}`))), gn("warning", n, r);
|
|
1403
1411
|
}
|
|
1404
1412
|
function En(e, ...t) {
|
|
1405
|
-
let n =
|
|
1406
|
-
|
|
1413
|
+
let n = mn(e, ...t), r = qr();
|
|
1414
|
+
ln && cn("debug", n) && ln("%c" + r + " DEBUG: " + String(n), "color:silver"), gn("debug", n, r);
|
|
1407
1415
|
}
|
|
1408
|
-
function
|
|
1409
|
-
let n =
|
|
1410
|
-
|
|
1416
|
+
function Tn(e, ...t) {
|
|
1417
|
+
let n = mn(e, ...t), r = qr();
|
|
1418
|
+
ln && cn("msg", n) && ln("%c" + r + " MSG: " + String(n), "color:cyan"), gn("msg", n, r);
|
|
1411
1419
|
}
|
|
1412
|
-
function
|
|
1413
|
-
|
|
1420
|
+
function vn(e, t) {
|
|
1421
|
+
cn("json", t) && (t && en.warn("=====> " + t), en.dir(e)), gn("json", e, qr());
|
|
1414
1422
|
}
|
|
1415
|
-
var
|
|
1423
|
+
var jn = [
|
|
1416
1424
|
"passw",
|
|
1417
1425
|
"pwd",
|
|
1418
1426
|
"passphrase",
|
|
@@ -1424,12 +1432,12 @@ var gobjJs = function(e) {
|
|
|
1424
1432
|
"cookie",
|
|
1425
1433
|
"credential",
|
|
1426
1434
|
"salt"
|
|
1427
|
-
],
|
|
1435
|
+
], On = [
|
|
1428
1436
|
"apikey",
|
|
1429
1437
|
"sessionid",
|
|
1430
1438
|
"sessionkey",
|
|
1431
1439
|
"authdata"
|
|
1432
|
-
],
|
|
1440
|
+
], Sn = /* @__PURE__ */ new Set([
|
|
1433
1441
|
"endpoint",
|
|
1434
1442
|
"url",
|
|
1435
1443
|
"uri",
|
|
@@ -1453,25 +1461,25 @@ var gobjJs = function(e) {
|
|
|
1453
1461
|
"expires",
|
|
1454
1462
|
"mode"
|
|
1455
1463
|
]);
|
|
1456
|
-
function
|
|
1464
|
+
function wn(e) {
|
|
1457
1465
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1458
1466
|
let t = e.toLowerCase(), n = !1;
|
|
1459
|
-
for (const e of
|
|
1467
|
+
for (const e of jn) if (t.indexOf(e) >= 0) {
|
|
1460
1468
|
n = !0;
|
|
1461
1469
|
break;
|
|
1462
1470
|
}
|
|
1463
1471
|
if (!n) {
|
|
1464
1472
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1465
|
-
for (const t of
|
|
1473
|
+
for (const t of On) if (e.indexOf(t) >= 0) {
|
|
1466
1474
|
n = !0;
|
|
1467
1475
|
break;
|
|
1468
1476
|
}
|
|
1469
1477
|
}
|
|
1470
1478
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1471
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1479
|
+
for (const e of t.split(/[_\-. \t]/)) if (Sn.has(e)) return !1;
|
|
1472
1480
|
return !0;
|
|
1473
1481
|
}
|
|
1474
|
-
function
|
|
1482
|
+
function Nn(e, t, n) {
|
|
1475
1483
|
const r = (e) => " " === e || " " === e, l = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1476
1484
|
let o = t;
|
|
1477
1485
|
for (;;) {
|
|
@@ -1487,12 +1495,12 @@ var gobjJs = function(e) {
|
|
|
1487
1495
|
o = t;
|
|
1488
1496
|
}
|
|
1489
1497
|
}
|
|
1490
|
-
var
|
|
1491
|
-
function
|
|
1498
|
+
var Rn = 128, $n = 4194304, Dn = "<not shown: too large to mask>";
|
|
1499
|
+
function kn(e) {
|
|
1492
1500
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1493
|
-
if (e.length >
|
|
1501
|
+
if (e.length > $n) return Dn;
|
|
1494
1502
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1495
|
-
for (; null !== (t = r.exec(e));)
|
|
1503
|
+
for (; null !== (t = r.exec(e));) wn(t[2].slice(-128)) && (n = !0);
|
|
1496
1504
|
let l = [], o = 0, s = !1, i = "", _ = 0, a = 0;
|
|
1497
1505
|
const u = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1498
1506
|
for (; a < e.length;) {
|
|
@@ -1505,8 +1513,8 @@ var gobjJs = function(e) {
|
|
|
1505
1513
|
a++;
|
|
1506
1514
|
continue;
|
|
1507
1515
|
}
|
|
1508
|
-
let r = e.substring(Math.max(_, a -
|
|
1509
|
-
if (_ = a + 1, !(
|
|
1516
|
+
let r = e.substring(Math.max(_, a - Rn), a);
|
|
1517
|
+
if (_ = a + 1, !(wn(r) || n && "value" === r.toLowerCase())) {
|
|
1510
1518
|
a++;
|
|
1511
1519
|
continue;
|
|
1512
1520
|
}
|
|
@@ -1515,18 +1523,18 @@ var gobjJs = function(e) {
|
|
|
1515
1523
|
if (f) {
|
|
1516
1524
|
for (c = a + 1; c < e.length && e[c] !== f;) c++;
|
|
1517
1525
|
e[c] === f && c++;
|
|
1518
|
-
} else c =
|
|
1526
|
+
} else c = Nn(e, a, i);
|
|
1519
1527
|
c > a && (l.push(e.substring(o, a)), l.push("********"), o = c, s = !0), a = c, _ = a;
|
|
1520
1528
|
}
|
|
1521
1529
|
return s ? (l.push(e.substring(o)), l.join("")) : null;
|
|
1522
1530
|
}
|
|
1523
|
-
var
|
|
1524
|
-
var
|
|
1525
|
-
function
|
|
1531
|
+
var An = 64, In = "<not shown: the masking failed>";
|
|
1532
|
+
var Cn = Symbol("mask-in-progress");
|
|
1533
|
+
function Ln(e, t, n, r) {
|
|
1526
1534
|
if ("string" == typeof e) {
|
|
1527
1535
|
if (e.length > r.left) return r.left = 0, Dn;
|
|
1528
1536
|
r.left -= e.length;
|
|
1529
|
-
let t =
|
|
1537
|
+
let t = kn(e);
|
|
1530
1538
|
return null !== t ? t : e;
|
|
1531
1539
|
}
|
|
1532
1540
|
let l = Array.isArray(e);
|
|
@@ -1538,10 +1546,10 @@ var gobjJs = function(e) {
|
|
|
1538
1546
|
if (r.left <= 0) return Dn;
|
|
1539
1547
|
if (t.has(e)) {
|
|
1540
1548
|
let n = t.get(e);
|
|
1541
|
-
return n ===
|
|
1549
|
+
return n === Cn ? "<cycle>" : n;
|
|
1542
1550
|
}
|
|
1543
|
-
if (n >=
|
|
1544
|
-
r.left -= 1, t.set(e,
|
|
1551
|
+
if (n >= An) return "<deeper not shown>";
|
|
1552
|
+
r.left -= 1, t.set(e, Cn);
|
|
1545
1553
|
let o, s = !1, i = !1;
|
|
1546
1554
|
if (l) {
|
|
1547
1555
|
o = [];
|
|
@@ -1551,13 +1559,13 @@ var gobjJs = function(e) {
|
|
|
1551
1559
|
break;
|
|
1552
1560
|
}
|
|
1553
1561
|
r.left -= 1;
|
|
1554
|
-
let _ =
|
|
1562
|
+
let _ = Ln(e[l], t, n + 1, r);
|
|
1555
1563
|
_ !== e[l] && (s = !0), o.push(_);
|
|
1556
1564
|
}
|
|
1557
1565
|
i && o.push(Dn);
|
|
1558
1566
|
} else {
|
|
1559
1567
|
o = Object.create(Object.getPrototypeOf(e));
|
|
1560
|
-
let l = "string" == typeof e.attribute &&
|
|
1568
|
+
let l = "string" == typeof e.attribute && wn(e.attribute.slice(-128));
|
|
1561
1569
|
for (const _ in e) {
|
|
1562
1570
|
if (!Object.prototype.hasOwnProperty.call(e, _)) continue;
|
|
1563
1571
|
if (r.left <= 0) {
|
|
@@ -1566,33 +1574,33 @@ var gobjJs = function(e) {
|
|
|
1566
1574
|
}
|
|
1567
1575
|
r.left -= 1 + _.length;
|
|
1568
1576
|
let a, u = e[_];
|
|
1569
|
-
a = (
|
|
1577
|
+
a = (wn(_.slice(-128)) || l && "value" === _) && null != u && "" !== u ? "********" : Ln(u, t, n + 1, r), a !== u && (s = !0), br(o, _, a);
|
|
1570
1578
|
}
|
|
1571
1579
|
i && (o["<more>"] = Dn);
|
|
1572
1580
|
}
|
|
1573
1581
|
return s || i || (o = e), t.set(e, o), o;
|
|
1574
1582
|
}
|
|
1575
|
-
function
|
|
1583
|
+
function Pn(e) {
|
|
1576
1584
|
try {
|
|
1577
|
-
return
|
|
1585
|
+
return Ln(e, /* @__PURE__ */ new WeakMap(), 0, { left: $n });
|
|
1578
1586
|
} catch (e) {
|
|
1579
|
-
return
|
|
1587
|
+
return In;
|
|
1580
1588
|
}
|
|
1581
1589
|
}
|
|
1582
|
-
function
|
|
1583
|
-
|
|
1590
|
+
function Un(e, t) {
|
|
1591
|
+
vn(Pn(e), t);
|
|
1584
1592
|
}
|
|
1585
|
-
function
|
|
1593
|
+
function Fn(e) {
|
|
1586
1594
|
return structuredClone(e);
|
|
1587
1595
|
}
|
|
1588
|
-
function
|
|
1596
|
+
function Vn(e, t) {
|
|
1589
1597
|
if (e === t) return !0;
|
|
1590
1598
|
if (null === e || null === t) return e === t;
|
|
1591
1599
|
if (typeof e != typeof t) return !1;
|
|
1592
1600
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1593
1601
|
if (Array.isArray(e)) {
|
|
1594
1602
|
if (e.length !== t.length) return !1;
|
|
1595
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1603
|
+
for (let n = 0; n < e.length; n++) if (!Vn(e[n], t[n])) return !1;
|
|
1596
1604
|
return !0;
|
|
1597
1605
|
}
|
|
1598
1606
|
if ("object" == typeof e) {
|
|
@@ -1600,118 +1608,118 @@ var gobjJs = function(e) {
|
|
|
1600
1608
|
if (n.length !== r.length) return !1;
|
|
1601
1609
|
for (let l = 0; l < n.length; l++) {
|
|
1602
1610
|
if (n[l] !== r[l]) return !1;
|
|
1603
|
-
if (!
|
|
1611
|
+
if (!Vn(e[n[l]], t[r[l]])) return !1;
|
|
1604
1612
|
}
|
|
1605
1613
|
return !0;
|
|
1606
1614
|
}
|
|
1607
1615
|
return e === t;
|
|
1608
1616
|
}
|
|
1609
|
-
function Vn(e, t) {
|
|
1610
|
-
if (!t) return e;
|
|
1611
|
-
for (let n of Object.keys(t)) dr(e, n, t[n]);
|
|
1612
|
-
return e;
|
|
1613
|
-
}
|
|
1614
1617
|
function Gn(e, t) {
|
|
1615
1618
|
if (!t) return e;
|
|
1616
|
-
for (let n
|
|
1619
|
+
for (let n of Object.keys(t)) br(e, n, t[n]);
|
|
1617
1620
|
return e;
|
|
1618
1621
|
}
|
|
1619
1622
|
function Mn(e, t) {
|
|
1620
1623
|
if (!t) return e;
|
|
1621
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) &&
|
|
1624
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && br(e, n, t[n]);
|
|
1622
1625
|
return e;
|
|
1623
1626
|
}
|
|
1624
1627
|
function Wn(e, t) {
|
|
1625
|
-
if (
|
|
1628
|
+
if (!t) return e;
|
|
1629
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && br(e, n, t[n]);
|
|
1630
|
+
return e;
|
|
1626
1631
|
}
|
|
1627
1632
|
function xn(e, t) {
|
|
1628
|
-
e && Object.prototype.hasOwnProperty.call(e, t)
|
|
1633
|
+
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1629
1634
|
}
|
|
1630
|
-
function Kn(e, t
|
|
1631
|
-
|
|
1635
|
+
function Kn(e, t) {
|
|
1636
|
+
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
1632
1637
|
}
|
|
1633
1638
|
function Yn(e, t, n) {
|
|
1634
|
-
|
|
1639
|
+
br(e, t, n);
|
|
1635
1640
|
}
|
|
1636
|
-
function Bn(e, t) {
|
|
1637
|
-
e
|
|
1641
|
+
function Bn(e, t, n) {
|
|
1642
|
+
br(e, t, n);
|
|
1638
1643
|
}
|
|
1639
1644
|
function Jn(e, t) {
|
|
1640
1645
|
e.push(t);
|
|
1641
1646
|
}
|
|
1642
1647
|
function qn(e, t) {
|
|
1643
|
-
e.
|
|
1648
|
+
e.push(t);
|
|
1644
1649
|
}
|
|
1645
|
-
function Hn(e) {
|
|
1646
|
-
|
|
1650
|
+
function Hn(e, t) {
|
|
1651
|
+
e.splice(t, 1);
|
|
1647
1652
|
}
|
|
1648
1653
|
function zn(e) {
|
|
1649
|
-
return Zn(e) ? e.length : 0;
|
|
1654
|
+
return Zn(e) ? Object.keys(e).length : 0;
|
|
1650
1655
|
}
|
|
1651
1656
|
function Qn(e) {
|
|
1652
|
-
return
|
|
1657
|
+
return er(e) ? e.length : 0;
|
|
1653
1658
|
}
|
|
1654
1659
|
function Xn(e) {
|
|
1655
|
-
return
|
|
1660
|
+
return Zn(e) ? Object.keys(e).length : er(e) ? e.length : tr(e) && e.length > 0 ? 1 : 0;
|
|
1656
1661
|
}
|
|
1657
1662
|
function Zn(e) {
|
|
1658
|
-
return Array.isArray(e);
|
|
1663
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1659
1664
|
}
|
|
1660
1665
|
function er(e) {
|
|
1661
|
-
return
|
|
1666
|
+
return Array.isArray(e);
|
|
1662
1667
|
}
|
|
1663
1668
|
function tr(e) {
|
|
1664
|
-
return "
|
|
1669
|
+
return "string" == typeof e;
|
|
1665
1670
|
}
|
|
1666
1671
|
function nr(e) {
|
|
1667
|
-
return "
|
|
1672
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1668
1673
|
}
|
|
1669
1674
|
function rr(e) {
|
|
1670
|
-
return
|
|
1675
|
+
return "boolean" == typeof e;
|
|
1671
1676
|
}
|
|
1672
1677
|
function lr(e) {
|
|
1673
|
-
return
|
|
1678
|
+
return null == e;
|
|
1674
1679
|
}
|
|
1675
1680
|
function or(e) {
|
|
1676
|
-
return
|
|
1681
|
+
return "function" == typeof e;
|
|
1677
1682
|
}
|
|
1678
1683
|
function sr(e) {
|
|
1679
|
-
return
|
|
1684
|
+
return e instanceof S;
|
|
1680
1685
|
}
|
|
1681
1686
|
function ir(e) {
|
|
1682
|
-
return tr(e)
|
|
1687
|
+
return !tr(e) || 0 === e.length;
|
|
1683
1688
|
}
|
|
1684
|
-
function _r(e
|
|
1685
|
-
return e
|
|
1689
|
+
function _r(e) {
|
|
1690
|
+
return nr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1686
1691
|
}
|
|
1687
1692
|
function ar(e, t) {
|
|
1693
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
1694
|
+
}
|
|
1695
|
+
function ur(e, t) {
|
|
1688
1696
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1689
1697
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1690
1698
|
}
|
|
1691
|
-
function
|
|
1692
|
-
if (
|
|
1693
|
-
if (
|
|
1699
|
+
function cr(e, t) {
|
|
1700
|
+
if (Zn(e) || Zn(t) || er(e) || er(t)) return 0;
|
|
1701
|
+
if (nr(e) || nr(t)) {
|
|
1694
1702
|
let n = Number(e), r = Number(t);
|
|
1695
1703
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1696
1704
|
}
|
|
1697
|
-
if (
|
|
1705
|
+
if (rr(e) || rr(t)) {
|
|
1698
1706
|
let n = Number(e), r = Number(t);
|
|
1699
1707
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1700
1708
|
}
|
|
1701
|
-
return
|
|
1709
|
+
return ar(String(e), String(t));
|
|
1702
1710
|
}
|
|
1703
|
-
function
|
|
1704
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1711
|
+
function fr(e, t) {
|
|
1712
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) fr(e, n);
|
|
1705
1713
|
else "string" == typeof t && delete e[t];
|
|
1706
1714
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1707
1715
|
}
|
|
1708
|
-
function
|
|
1716
|
+
function gr(e, t) {
|
|
1709
1717
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
1710
1718
|
}
|
|
1711
|
-
function
|
|
1719
|
+
function dr(e, t) {
|
|
1712
1720
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
1713
1721
|
}
|
|
1714
|
-
function
|
|
1722
|
+
function br(e, t, n) {
|
|
1715
1723
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1716
1724
|
value: n,
|
|
1717
1725
|
writable: !0,
|
|
@@ -1719,167 +1727,171 @@ var gobjJs = function(e) {
|
|
|
1719
1727
|
configurable: !0
|
|
1720
1728
|
}) : e[t] = n;
|
|
1721
1729
|
}
|
|
1722
|
-
function
|
|
1723
|
-
e && !
|
|
1730
|
+
function pr(e, t, n, r) {
|
|
1731
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1724
1732
|
const l = e ? `${et(e)}: ` : "";
|
|
1725
|
-
if (!
|
|
1726
|
-
if (!
|
|
1733
|
+
if (!Zn(t) && !er(t)) return void hn(`${l}kw must be list or dict: '${String(n)}'`);
|
|
1734
|
+
if (!tr(n)) return void hn(`${l}path must be a string: ${String(n)}`);
|
|
1727
1735
|
let o = n.split("`"), s = o.length;
|
|
1728
1736
|
for (let e = 0; e < s; e++) {
|
|
1729
|
-
if (
|
|
1737
|
+
if (er(t)) {
|
|
1738
|
+
if (!/^[0-9]+$/.test(o[e])) return void (r && hn(`${l}path not found: '${n}'`));
|
|
1739
|
+
o[e] = String(Number(o[e]));
|
|
1740
|
+
}
|
|
1741
|
+
if (dr(t, o[e])) return void (r && hn(`${l}path not found: '${n}'`));
|
|
1730
1742
|
if (e === s - 1) break;
|
|
1731
|
-
if (null == (t = t[o[e]])) return void (r &&
|
|
1732
|
-
if (!
|
|
1743
|
+
if (null == (t = t[o[e]])) return void (r && hn(`${l}path not found: '${n}'`));
|
|
1744
|
+
if (!Zn(t) && !er(t)) return void hn(`${l}kw must be list or dict: '${n}'`);
|
|
1733
1745
|
}
|
|
1734
1746
|
let i = t[o[s - 1]];
|
|
1735
|
-
return void 0 === i && r &&
|
|
1747
|
+
return void 0 === i && r && hn(`${l}path not found: '${n}'`), i;
|
|
1736
1748
|
}
|
|
1737
|
-
function
|
|
1738
|
-
e && !
|
|
1749
|
+
function mr(e, t, n) {
|
|
1750
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1739
1751
|
let [r, l] = function(e, t) {
|
|
1740
1752
|
let n = e.lastIndexOf(t);
|
|
1741
1753
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1742
1754
|
}(n, "`");
|
|
1743
|
-
return
|
|
1755
|
+
return ir(l) ? Kn(t, n) : Kn(pr(e, t, r, !0), l), 0;
|
|
1744
1756
|
}
|
|
1745
|
-
function
|
|
1746
|
-
e && !
|
|
1747
|
-
let o =
|
|
1748
|
-
const s = l && l &
|
|
1757
|
+
function hr(e, t, n, r, l) {
|
|
1758
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1759
|
+
let o = pr(e, t, n, !1);
|
|
1760
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
1749
1761
|
if (void 0 === o) {
|
|
1750
1762
|
if (i && t) {
|
|
1751
1763
|
let l = Boolean(r);
|
|
1752
|
-
return
|
|
1764
|
+
return Or(e, t, n, l), l;
|
|
1753
1765
|
}
|
|
1754
|
-
return s && (
|
|
1766
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), Boolean(r);
|
|
1755
1767
|
}
|
|
1756
1768
|
let u;
|
|
1757
|
-
if (
|
|
1758
|
-
else if (a &&
|
|
1759
|
-
else if (a &&
|
|
1769
|
+
if (rr(o)) u = o;
|
|
1770
|
+
else if (a && nr(o)) u = 0 !== o;
|
|
1771
|
+
else if (a && tr(o)) u = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o, 10) || 0);
|
|
1760
1772
|
else {
|
|
1761
|
-
if (!a || null !== o) return a ? (
|
|
1773
|
+
if (!a || null !== o) return a ? (hn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Un(t), !1) : (hn(`${e ? et(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), Un(t), Boolean(r));
|
|
1762
1774
|
u = !1;
|
|
1763
1775
|
}
|
|
1764
|
-
return _ &&
|
|
1776
|
+
return _ && mr(e, t, n), u;
|
|
1765
1777
|
}
|
|
1766
|
-
function
|
|
1767
|
-
e && !
|
|
1768
|
-
let o =
|
|
1769
|
-
const s = l && l &
|
|
1778
|
+
function yr(e, t, n, r, l) {
|
|
1779
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1780
|
+
let o = pr(e, t, n, !1);
|
|
1781
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
1770
1782
|
if (void 0 === o) {
|
|
1771
1783
|
if (i && t) {
|
|
1772
1784
|
let l = parseInt(r);
|
|
1773
|
-
return
|
|
1785
|
+
return Or(e, t, n, l), l;
|
|
1774
1786
|
}
|
|
1775
|
-
return s && (
|
|
1787
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), parseInt(r);
|
|
1776
1788
|
}
|
|
1777
1789
|
let u;
|
|
1778
|
-
if (
|
|
1790
|
+
if (nr(o)) u = Math.trunc(o);
|
|
1779
1791
|
else {
|
|
1780
|
-
if (!a) return
|
|
1781
|
-
if (
|
|
1782
|
-
else if (
|
|
1792
|
+
if (!a) return hn(`${e ? et(e) + ": " : ""}path MUST BE a json integer: '${n}'`), Un(t), parseInt(r);
|
|
1793
|
+
if (rr(o)) u = o ? 1 : 0;
|
|
1794
|
+
else if (tr(o)) u = function(e) {
|
|
1783
1795
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
1784
1796
|
if (!t) return 0;
|
|
1785
1797
|
let n, r = t[2];
|
|
1786
1798
|
return n = r.length > 1 && ("x" === r[1] || "X" === r[1]) ? parseInt(r.substring(2), 16) : "0" === r[0] ? parseInt(r, 8) : parseInt(r, 10), "-" === t[1] ? -n : n;
|
|
1787
1799
|
}(o);
|
|
1788
1800
|
else {
|
|
1789
|
-
if (null !== o) return
|
|
1801
|
+
if (null !== o) return hn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Un(t), 0;
|
|
1790
1802
|
u = 0;
|
|
1791
1803
|
}
|
|
1792
1804
|
}
|
|
1793
|
-
return _ &&
|
|
1805
|
+
return _ && mr(e, t, n), u;
|
|
1794
1806
|
}
|
|
1795
1807
|
function Er(e, t, n, r, l) {
|
|
1796
|
-
e && !
|
|
1797
|
-
let o =
|
|
1798
|
-
const s = l && l &
|
|
1799
|
-
return void 0 === o ? i && t ? (
|
|
1800
|
-
let n =
|
|
1808
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1809
|
+
let o = pr(e, t, n, !1);
|
|
1810
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1811
|
+
return void 0 === o ? i && t ? (Or(e, t, n, tr(r) ? r : null), r) : (s && !function(e, t) {
|
|
1812
|
+
let n = tr(t) ? t.split("`") : [], r = e;
|
|
1801
1813
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1802
|
-
if (!
|
|
1814
|
+
if (!Zn(r) && !er(r)) return !1;
|
|
1803
1815
|
r = r[n[e]];
|
|
1804
1816
|
}
|
|
1805
|
-
return !(!
|
|
1806
|
-
}(t, n) && (
|
|
1817
|
+
return !(!Zn(r) && !er(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
1818
|
+
}(t, n) && (hn(`path not found: '${n}'`), Un(t)), r) : tr(o) ? (_ && mr(e, t, n), o) : (null !== o && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json str: '${n}'`), Un(t)), r);
|
|
1807
1819
|
}
|
|
1808
|
-
function
|
|
1809
|
-
e && !
|
|
1810
|
-
let o =
|
|
1811
|
-
const s = l && l &
|
|
1820
|
+
function Tr(e, t, n, r, l) {
|
|
1821
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1822
|
+
let o = pr(e, t, n, !1);
|
|
1823
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1812
1824
|
if (void 0 === o) {
|
|
1813
1825
|
if (i) {
|
|
1814
1826
|
let l = r;
|
|
1815
|
-
return
|
|
1827
|
+
return Or(e, t, n, l), l;
|
|
1816
1828
|
}
|
|
1817
|
-
return s && (
|
|
1829
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), r;
|
|
1818
1830
|
}
|
|
1819
|
-
return _ &&
|
|
1820
|
-
}
|
|
1821
|
-
function Tr(e, t, n, r, l) {
|
|
1822
|
-
e && !or(e) && mn("GObj bad instanceof");
|
|
1823
|
-
let o = br(e, t, n, !1);
|
|
1824
|
-
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT;
|
|
1825
|
-
return void 0 === o ? i && Xn(r) && t ? (jr(e, t, n, r), r) : (s && (mn(`path not found: '${n}'`), Pn(t)), r) : Xn(o) ? (_ && pr(e, t, n), o) : (s && (mn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'`), Pn(t)), r);
|
|
1831
|
+
return _ && mr(e, t, n), o;
|
|
1826
1832
|
}
|
|
1827
1833
|
function vr(e, t, n, r, l) {
|
|
1828
|
-
e && !
|
|
1829
|
-
let o =
|
|
1830
|
-
const s = l && l &
|
|
1834
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1835
|
+
let o = pr(e, t, n, !1);
|
|
1836
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1837
|
+
return void 0 === o ? i && Zn(r) && t ? (Or(e, t, n, r), r) : (s && (hn(`path not found: '${n}'`), Un(t)), r) : Zn(o) ? (_ && mr(e, t, n), o) : (s && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'`), Un(t)), r);
|
|
1838
|
+
}
|
|
1839
|
+
function jr(e, t, n, r, l) {
|
|
1840
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1841
|
+
let o = pr(e, t, n, !1);
|
|
1842
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1831
1843
|
if (void 0 === o) {
|
|
1832
1844
|
if (i) {
|
|
1833
1845
|
let l = r;
|
|
1834
|
-
return
|
|
1846
|
+
return Or(e, t, n, l), l;
|
|
1835
1847
|
}
|
|
1836
|
-
return s && (
|
|
1848
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), r;
|
|
1837
1849
|
}
|
|
1838
|
-
return _ &&
|
|
1850
|
+
return _ && mr(e, t, n), o;
|
|
1839
1851
|
}
|
|
1840
|
-
function
|
|
1841
|
-
if (e && !
|
|
1852
|
+
function Or(e, t, n, r) {
|
|
1853
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !Zn(t)) return hn("kw is not an object"), -1;
|
|
1842
1854
|
let l = n.split("`"), o = l.length;
|
|
1843
1855
|
for (let s = 0; s < o; s++) {
|
|
1844
1856
|
let i = l[s];
|
|
1845
|
-
if (s === o - 1)
|
|
1857
|
+
if (s === o - 1) br(t, i, r);
|
|
1846
1858
|
else {
|
|
1847
|
-
let r =
|
|
1848
|
-
if (void 0 === r)
|
|
1849
|
-
else if (!
|
|
1859
|
+
let r = dr(t, i) ? void 0 : t[i];
|
|
1860
|
+
if (void 0 === r) br(t, i, {});
|
|
1861
|
+
else if (!Zn(r) && !er(r)) return hn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not a dict or a list: '${n}'`), -1;
|
|
1850
1862
|
t = t[i];
|
|
1851
1863
|
}
|
|
1852
1864
|
}
|
|
1853
1865
|
return 0;
|
|
1854
1866
|
}
|
|
1855
|
-
function
|
|
1856
|
-
if (e && !
|
|
1857
|
-
let o =
|
|
1858
|
-
return
|
|
1867
|
+
function Sr(e, t, n, r, l) {
|
|
1868
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !Zn(t)) return hn("kw is not an object"), -1;
|
|
1869
|
+
let o = vr(e, t, n, {}, Zt.KW_CREATE);
|
|
1870
|
+
return Zn(o) ? (br(o, r, l), 0) : (hn("subdict is not an object"), -1);
|
|
1859
1871
|
}
|
|
1860
|
-
function
|
|
1872
|
+
function wr(e, t, r) {
|
|
1861
1873
|
let l = "", o = !1;
|
|
1862
|
-
if (
|
|
1874
|
+
if (er(t)) {
|
|
1863
1875
|
o = !1;
|
|
1864
1876
|
for (let s = 0; s < t.length; s++) {
|
|
1865
1877
|
let i = t[s];
|
|
1866
|
-
if (l =
|
|
1878
|
+
if (l = ir(r) ? n("%s", r) : n("%s`%d", r, s), o = wr(e, i, l), o) break;
|
|
1867
1879
|
}
|
|
1868
|
-
} else if (
|
|
1880
|
+
} else if (Zn(t)) {
|
|
1869
1881
|
o = !0;
|
|
1870
1882
|
let s = Object.keys(t);
|
|
1871
1883
|
for (let i = 0; i < s.length; i++) {
|
|
1872
1884
|
let _ = s[i], a = t[_];
|
|
1873
|
-
if (l =
|
|
1874
|
-
if (o =
|
|
1885
|
+
if (l = ir(r) ? n("%s", _) : n("%s`%s", r, _), er(a) || Zn(a)) {
|
|
1886
|
+
if (o = wr(e, a, l), !o) break;
|
|
1875
1887
|
continue;
|
|
1876
1888
|
}
|
|
1877
|
-
let u =
|
|
1878
|
-
if (void 0 === u && (u =
|
|
1889
|
+
let u = jr(0, e, l, void 0, 0);
|
|
1890
|
+
if (void 0 === u && (u = xn(e, l)), void 0 === u) {
|
|
1879
1891
|
o = !1;
|
|
1880
1892
|
break;
|
|
1881
1893
|
}
|
|
1882
|
-
if (0 !==
|
|
1894
|
+
if (0 !== cr(u, a)) {
|
|
1883
1895
|
o = !1;
|
|
1884
1896
|
break;
|
|
1885
1897
|
}
|
|
@@ -1887,37 +1899,37 @@ var gobjJs = function(e) {
|
|
|
1887
1899
|
}
|
|
1888
1900
|
return o;
|
|
1889
1901
|
}
|
|
1890
|
-
function
|
|
1891
|
-
return 0 ===
|
|
1902
|
+
function Nr(e, t) {
|
|
1903
|
+
return 0 === Xn(t) || wr(e, t, "");
|
|
1892
1904
|
}
|
|
1893
|
-
function
|
|
1894
|
-
e && !
|
|
1905
|
+
function Rr(e, t, n, r) {
|
|
1906
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1895
1907
|
let l = {};
|
|
1896
|
-
if (
|
|
1908
|
+
if (tr(n) && !ir(n)) {
|
|
1897
1909
|
let o = n;
|
|
1898
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
1899
|
-
} else if (
|
|
1910
|
+
Object.prototype.hasOwnProperty.call(t, o) ? br(l, o, t[o]) : r && hn(`${et(e)}: key not found: ${o}`);
|
|
1911
|
+
} else if (Zn(n) && zn(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? br(l, o, t[o]) : r && hn(`${et(e)}: key not found: ${o}`);
|
|
1900
1912
|
else {
|
|
1901
|
-
if (!(
|
|
1913
|
+
if (!(er(n) && Qn(n) > 0)) return t;
|
|
1902
1914
|
for (let o = 0; o < n.length; o++) {
|
|
1903
1915
|
let s = n[o];
|
|
1904
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1916
|
+
Object.prototype.hasOwnProperty.call(t, s) ? br(l, s, t[s]) : r && hn(`${et(e)}: key not found: ${s}`);
|
|
1905
1917
|
}
|
|
1906
1918
|
}
|
|
1907
1919
|
return l;
|
|
1908
1920
|
}
|
|
1909
|
-
function
|
|
1921
|
+
function $r(e, t, n, r) {
|
|
1910
1922
|
let l = {};
|
|
1911
|
-
if (!
|
|
1912
|
-
if (
|
|
1923
|
+
if (!Zn(t)) return l;
|
|
1924
|
+
if (Gn(l, t), tr(n) && !ir(n)) {
|
|
1913
1925
|
let o = n;
|
|
1914
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
1915
|
-
} else if (
|
|
1926
|
+
Object.prototype.hasOwnProperty.call(t, o) ? Kn(l, o) : r && hn(`${et(e)}: key not found: ${o}`);
|
|
1927
|
+
} else if (Zn(n) && zn(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? Kn(l, o) : r && hn(`${et(e)}: key not found: ${o}`);
|
|
1916
1928
|
else {
|
|
1917
|
-
if (!(
|
|
1929
|
+
if (!(er(n) && Qn(n) > 0)) return {};
|
|
1918
1930
|
for (let o = 0; o < n.length; o++) {
|
|
1919
1931
|
let s = n[o];
|
|
1920
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1932
|
+
Object.prototype.hasOwnProperty.call(t, s) ? Kn(l, s) : r && hn(`${et(e)}: key not found: ${s}`);
|
|
1921
1933
|
}
|
|
1922
1934
|
}
|
|
1923
1935
|
return l;
|
|
@@ -1925,21 +1937,21 @@ var gobjJs = function(e) {
|
|
|
1925
1937
|
function Dr(e, t, n = !1) {
|
|
1926
1938
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1927
1939
|
let r = window.localStorage.getItem(e);
|
|
1928
|
-
return null === r ? (n &&
|
|
1940
|
+
return null === r ? (n && kr(e, t), t) : JSON.parse(r);
|
|
1929
1941
|
} catch (n) {
|
|
1930
1942
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1931
1943
|
}
|
|
1932
1944
|
}
|
|
1933
|
-
function
|
|
1945
|
+
function kr(e, t) {
|
|
1934
1946
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1935
|
-
if (!e || void 0 === t) return
|
|
1947
|
+
if (!e || void 0 === t) return hn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1936
1948
|
try {
|
|
1937
1949
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1938
1950
|
} catch (t) {
|
|
1939
|
-
return
|
|
1951
|
+
return hn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1940
1952
|
}
|
|
1941
1953
|
}
|
|
1942
|
-
function
|
|
1954
|
+
function Ar(e) {
|
|
1943
1955
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1944
1956
|
window.localStorage.removeItem(e);
|
|
1945
1957
|
} catch (t) {
|
|
@@ -1947,46 +1959,46 @@ var gobjJs = function(e) {
|
|
|
1947
1959
|
}
|
|
1948
1960
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1949
1961
|
}
|
|
1950
|
-
function
|
|
1951
|
-
if (
|
|
1952
|
-
if (
|
|
1962
|
+
function Ir(e, t) {
|
|
1963
|
+
if (lr(e) || lr(t)) return !0;
|
|
1964
|
+
if (er(e)) {
|
|
1953
1965
|
if (0 === e.length) return !0;
|
|
1954
1966
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1955
|
-
} else if (
|
|
1967
|
+
} else if (Zn(e)) {
|
|
1956
1968
|
if (0 === Object.keys(e).length) return !0;
|
|
1957
1969
|
for (let n in e) if (n === t) return !0;
|
|
1958
|
-
} else if (
|
|
1970
|
+
} else if (tr(e) && e === t) return !0;
|
|
1959
1971
|
return !1;
|
|
1960
1972
|
}
|
|
1961
|
-
function
|
|
1962
|
-
if (e && !
|
|
1963
|
-
l || (l =
|
|
1973
|
+
function Cr(e, t, n, r, l) {
|
|
1974
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !t) return null;
|
|
1975
|
+
l || (l = Nr);
|
|
1964
1976
|
let o = [];
|
|
1965
|
-
if (
|
|
1977
|
+
if (er(t)) for (let s = 0; s < t.length; s++) {
|
|
1966
1978
|
let i, _ = t[s];
|
|
1967
|
-
if (
|
|
1979
|
+
if (Zn(_)) i = Er(e, _, "id", "", 0);
|
|
1968
1980
|
else {
|
|
1969
|
-
if (!
|
|
1981
|
+
if (!tr(_)) continue;
|
|
1970
1982
|
i = _;
|
|
1971
1983
|
}
|
|
1972
|
-
|
|
1984
|
+
Ir(n, i) && l(_, r) && o.push(_);
|
|
1973
1985
|
}
|
|
1974
1986
|
else {
|
|
1975
|
-
if (!
|
|
1987
|
+
if (!Zn(t)) return hn("kw_collect() BAD kw parameter"), null;
|
|
1976
1988
|
for (let e of Object.keys(t)) {
|
|
1977
1989
|
let s = t[e];
|
|
1978
|
-
|
|
1990
|
+
Ir(n, e) && l(s, r) && o.push(s);
|
|
1979
1991
|
}
|
|
1980
1992
|
}
|
|
1981
1993
|
return o;
|
|
1982
1994
|
}
|
|
1983
|
-
function
|
|
1995
|
+
function Lr(e, t) {
|
|
1984
1996
|
if (!e) return -1;
|
|
1985
1997
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1986
1998
|
return -1;
|
|
1987
1999
|
}
|
|
1988
|
-
function
|
|
1989
|
-
if (!e || !t) return
|
|
2000
|
+
function Pr(e, t, n) {
|
|
2001
|
+
if (!e || !t) return hn("ERROR: str_in_list() list or str empty"), !1;
|
|
1990
2002
|
let r = e.length;
|
|
1991
2003
|
if (n) {
|
|
1992
2004
|
t = t.toLowerCase();
|
|
@@ -1997,7 +2009,7 @@ var gobjJs = function(e) {
|
|
|
1997
2009
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1998
2010
|
return !1;
|
|
1999
2011
|
}
|
|
2000
|
-
function
|
|
2012
|
+
function Ur(e, t) {
|
|
2001
2013
|
try {
|
|
2002
2014
|
let n = e.__md_iev__;
|
|
2003
2015
|
if (n) return n[t];
|
|
@@ -2005,35 +2017,35 @@ var gobjJs = function(e) {
|
|
|
2005
2017
|
return;
|
|
2006
2018
|
}
|
|
2007
2019
|
}
|
|
2008
|
-
function
|
|
2020
|
+
function Fr(e, t, n) {
|
|
2009
2021
|
let r = e.__md_iev__;
|
|
2010
2022
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2011
2023
|
}
|
|
2012
|
-
function
|
|
2013
|
-
if (!
|
|
2024
|
+
function Vr(e, t, n, r) {
|
|
2025
|
+
if (!sr(e)) return hn("gobj is not a GObj"), null;
|
|
2014
2026
|
if (!t) return;
|
|
2015
|
-
let l =
|
|
2016
|
-
l || (l = [],
|
|
2027
|
+
let l = Ur(t, n);
|
|
2028
|
+
l || (l = [], Fr(t, n, l));
|
|
2017
2029
|
try {
|
|
2018
|
-
|
|
2030
|
+
er(l) && l.unshift(r);
|
|
2019
2031
|
} catch (e) {
|
|
2020
|
-
|
|
2032
|
+
hn(e);
|
|
2021
2033
|
}
|
|
2022
2034
|
}
|
|
2023
|
-
function
|
|
2024
|
-
if (!
|
|
2025
|
-
if (!
|
|
2026
|
-
let l =
|
|
2027
|
-
return l ? 0 === l.length ? (r &&
|
|
2035
|
+
function Gr(e, t, n, r) {
|
|
2036
|
+
if (!sr(e)) return hn("gobj is not a GObj"), null;
|
|
2037
|
+
if (!Zn(t)) return hn("kw is not a dict"), null;
|
|
2038
|
+
let l = Ur(t, n);
|
|
2039
|
+
return l ? 0 === l.length ? (r && hn(`stack empty: ${n}`), null) : l[0] : (r && hn(`stack NOT FOUND: ${n}`), null);
|
|
2028
2040
|
}
|
|
2029
|
-
function
|
|
2030
|
-
return
|
|
2041
|
+
function Mr(e, t, n) {
|
|
2042
|
+
return ir(n) ? mr(e, t, "__md_iev__`__msg_type__") : Sr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2031
2043
|
}
|
|
2032
|
-
function
|
|
2044
|
+
function Wr(e, t) {
|
|
2033
2045
|
return Er(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2034
2046
|
}
|
|
2035
|
-
function
|
|
2036
|
-
void 0 !== n &&
|
|
2047
|
+
function xr(e, t, n) {
|
|
2048
|
+
void 0 !== n && tr(n) || (n = "");
|
|
2037
2049
|
for (let r of Object.keys(e)) {
|
|
2038
2050
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
2039
2051
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2042,10 +2054,10 @@ var gobjJs = function(e) {
|
|
|
2042
2054
|
r,
|
|
2043
2055
|
e[r],
|
|
2044
2056
|
n
|
|
2045
|
-
]),
|
|
2057
|
+
]), Zn(e[r]) && xr(e[r], t, n), n = n.slice(0, -l.length);
|
|
2046
2058
|
}
|
|
2047
2059
|
}
|
|
2048
|
-
function
|
|
2060
|
+
function Kr(e, t, n, r) {
|
|
2049
2061
|
if (!e) return null;
|
|
2050
2062
|
let l, o = e.length;
|
|
2051
2063
|
for (l = 0; l < o; l++) {
|
|
@@ -2053,15 +2065,15 @@ var gobjJs = function(e) {
|
|
|
2053
2065
|
if (o) {
|
|
2054
2066
|
let e = o.id;
|
|
2055
2067
|
if (e && e === n) return o;
|
|
2056
|
-
if (r &&
|
|
2057
|
-
let e =
|
|
2068
|
+
if (r && gr(o, t)) {
|
|
2069
|
+
let e = Kr(o[t], t, n, r);
|
|
2058
2070
|
if (e) return e;
|
|
2059
2071
|
}
|
|
2060
2072
|
}
|
|
2061
2073
|
}
|
|
2062
2074
|
return null;
|
|
2063
2075
|
}
|
|
2064
|
-
function
|
|
2076
|
+
function Yr(e) {
|
|
2065
2077
|
function t(e) {
|
|
2066
2078
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2067
2079
|
switch (t.length % 4) {
|
|
@@ -2092,36 +2104,36 @@ var gobjJs = function(e) {
|
|
|
2092
2104
|
signature: t(n[2])
|
|
2093
2105
|
};
|
|
2094
2106
|
}
|
|
2095
|
-
function
|
|
2107
|
+
function Br(e) {
|
|
2096
2108
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2097
2109
|
}
|
|
2098
|
-
function
|
|
2110
|
+
function Jr(e) {
|
|
2099
2111
|
const t = document.createElement("template");
|
|
2100
2112
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2101
2113
|
}
|
|
2102
|
-
function
|
|
2114
|
+
function qr(e) {
|
|
2103
2115
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), l = e.getTimezoneOffset();
|
|
2104
2116
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2105
2117
|
}
|
|
2106
|
-
function
|
|
2118
|
+
function Hr(e, t) {
|
|
2107
2119
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2108
2120
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2109
2121
|
return -1;
|
|
2110
2122
|
}
|
|
2111
|
-
function
|
|
2123
|
+
function zr() {
|
|
2112
2124
|
let e = "";
|
|
2113
2125
|
return "undefined" != typeof window && window.localStorage ? (e = window.localStorage.getItem("host_uuid"), !e && window.crypto?.randomUUID && (e = window.crypto.randomUUID(), window.localStorage.setItem("host_uuid", e))) : e = "undefined" != typeof globalThis && globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : "00000000-0000-0000-0000-000000000000", e;
|
|
2114
2126
|
}
|
|
2115
|
-
function
|
|
2127
|
+
function Qr(e) {
|
|
2116
2128
|
let t = null;
|
|
2117
2129
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2118
2130
|
}
|
|
2119
|
-
var
|
|
2120
|
-
function
|
|
2131
|
+
var Xr = 256, Zr = 1e5;
|
|
2132
|
+
function el(e) {
|
|
2121
2133
|
const t = String(e).replace(/`/g, "``");
|
|
2122
2134
|
return "[" === t[0] ? "[" + t : t;
|
|
2123
2135
|
}
|
|
2124
|
-
function
|
|
2136
|
+
function tl(e) {
|
|
2125
2137
|
if ("string" != typeof e) return null;
|
|
2126
2138
|
let t = [], n = "";
|
|
2127
2139
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2142,17 +2154,17 @@ var gobjJs = function(e) {
|
|
|
2142
2154
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2143
2155
|
});
|
|
2144
2156
|
}
|
|
2145
|
-
function
|
|
2157
|
+
function nl(e, t) {
|
|
2146
2158
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2147
2159
|
}
|
|
2148
|
-
function
|
|
2160
|
+
function rl(e) {
|
|
2149
2161
|
return "persistent-attrs-" + et(e);
|
|
2150
2162
|
}
|
|
2151
|
-
function
|
|
2152
|
-
if (
|
|
2163
|
+
function ll(e, t) {
|
|
2164
|
+
if (tr(t)) {
|
|
2153
2165
|
if (-1 === t.indexOf("^")) {
|
|
2154
2166
|
let n, r, l = e.fkey;
|
|
2155
|
-
if (1 !==
|
|
2167
|
+
if (1 !== zn(l)) return hn("bad fkey 1"), hn(e), hn(t), null;
|
|
2156
2168
|
for (const e of Object.keys(l)) {
|
|
2157
2169
|
n = e, r = l[e];
|
|
2158
2170
|
break;
|
|
@@ -2165,20 +2177,20 @@ var gobjJs = function(e) {
|
|
|
2165
2177
|
}
|
|
2166
2178
|
{
|
|
2167
2179
|
let n = t.split("^");
|
|
2168
|
-
return 3 !== n.length ? (
|
|
2180
|
+
return 3 !== n.length ? (hn("bad fkey 2"), hn(e), hn(t), null) : {
|
|
2169
2181
|
topic_name: n[0],
|
|
2170
2182
|
id: n[1],
|
|
2171
2183
|
hook_name: n[2]
|
|
2172
2184
|
};
|
|
2173
2185
|
}
|
|
2174
2186
|
}
|
|
2175
|
-
return
|
|
2187
|
+
return Zn(t) ? {
|
|
2176
2188
|
topic_name: t.topic_name,
|
|
2177
2189
|
id: t.id,
|
|
2178
2190
|
hook_name: t.hook_name
|
|
2179
|
-
} : (
|
|
2191
|
+
} : (hn("bad fkey 3"), hn(e), hn(t), null);
|
|
2180
2192
|
}
|
|
2181
|
-
var
|
|
2193
|
+
var ol = [
|
|
2182
2194
|
"string",
|
|
2183
2195
|
"integer",
|
|
2184
2196
|
"object",
|
|
@@ -2188,7 +2200,7 @@ var gobjJs = function(e) {
|
|
|
2188
2200
|
"real",
|
|
2189
2201
|
"boolean",
|
|
2190
2202
|
"blob"
|
|
2191
|
-
],
|
|
2203
|
+
], sl = [
|
|
2192
2204
|
"persistent",
|
|
2193
2205
|
"required",
|
|
2194
2206
|
"notnull",
|
|
@@ -2200,7 +2212,7 @@ var gobjJs = function(e) {
|
|
|
2200
2212
|
"stats",
|
|
2201
2213
|
"rstats",
|
|
2202
2214
|
"pstats"
|
|
2203
|
-
],
|
|
2215
|
+
], il = [
|
|
2204
2216
|
"hook",
|
|
2205
2217
|
"fkey",
|
|
2206
2218
|
"enum",
|
|
@@ -2229,7 +2241,7 @@ var gobjJs = function(e) {
|
|
|
2229
2241
|
"coordinates",
|
|
2230
2242
|
"gbuffer"
|
|
2231
2243
|
];
|
|
2232
|
-
function
|
|
2244
|
+
function _l(e) {
|
|
2233
2245
|
let t = {
|
|
2234
2246
|
name: e.id,
|
|
2235
2247
|
header: e.header,
|
|
@@ -2248,7 +2260,7 @@ var gobjJs = function(e) {
|
|
|
2248
2260
|
if (!e.flag) return t;
|
|
2249
2261
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2250
2262
|
let r = e.flag[n];
|
|
2251
|
-
if (
|
|
2263
|
+
if (Pr(il, r)) {
|
|
2252
2264
|
switch (r) {
|
|
2253
2265
|
case "enum":
|
|
2254
2266
|
t.enum_list = e.enum;
|
|
@@ -2262,7 +2274,7 @@ var gobjJs = function(e) {
|
|
|
2262
2274
|
case "file": t.is_file = !0;
|
|
2263
2275
|
}
|
|
2264
2276
|
t.type = r;
|
|
2265
|
-
} else if (
|
|
2277
|
+
} else if (Pr(sl, r)) switch (r) {
|
|
2266
2278
|
case "writable":
|
|
2267
2279
|
t.is_writable = !0;
|
|
2268
2280
|
break;
|
|
@@ -2275,27 +2287,27 @@ var gobjJs = function(e) {
|
|
|
2275
2287
|
}
|
|
2276
2288
|
return t.is_file && (t.type = "file"), t;
|
|
2277
2289
|
}
|
|
2278
|
-
var
|
|
2279
|
-
j(
|
|
2280
|
-
j(
|
|
2281
|
-
j(
|
|
2290
|
+
var al = [
|
|
2291
|
+
j(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2292
|
+
j(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2293
|
+
j(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2282
2294
|
v()
|
|
2283
|
-
],
|
|
2295
|
+
], ul = {
|
|
2284
2296
|
periodic: !1,
|
|
2285
2297
|
msec: 0,
|
|
2286
2298
|
timer_id: -1
|
|
2287
|
-
},
|
|
2288
|
-
function
|
|
2299
|
+
}, cl = null;
|
|
2300
|
+
function fl(e, t, n, r) {
|
|
2289
2301
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2290
2302
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2291
|
-
|
|
2292
|
-
}, l.msec) : l.timer_id = -1, lt(e) ?
|
|
2303
|
+
Vt(e, "EV_TIMEOUT", {}, e);
|
|
2304
|
+
}, l.msec) : l.timer_id = -1, lt(e) ? Vt(nt(e), o, {}, e) : Xt(e, o, {}), l.periodic || -1 !== l.timer_id || Ke(e) && Ve(e), 0;
|
|
2293
2305
|
}
|
|
2294
|
-
var
|
|
2306
|
+
var gl = {
|
|
2295
2307
|
mt_create: function(e) {
|
|
2296
2308
|
let t = e.priv;
|
|
2297
2309
|
const n = Ot(e, "subscriber");
|
|
2298
|
-
n &&
|
|
2310
|
+
n && qt(e, null, {}, n), t.periodic = Tt(e, "periodic"), t.msec = vt(e, "msec");
|
|
2299
2311
|
},
|
|
2300
2312
|
mt_writing: function(e, t) {
|
|
2301
2313
|
let n = e.priv;
|
|
@@ -2304,7 +2316,7 @@ var gobjJs = function(e) {
|
|
|
2304
2316
|
n.periodic = Tt(e, "periodic");
|
|
2305
2317
|
break;
|
|
2306
2318
|
case "msec": n.msec = vt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2307
|
-
|
|
2319
|
+
Vt(e, "EV_TIMEOUT", {}, e);
|
|
2308
2320
|
}, n.msec)), n.msec > 0 ? Ke(e) || Pe(e) : Ke(e) && Ve(e);
|
|
2309
2321
|
}
|
|
2310
2322
|
},
|
|
@@ -2316,92 +2328,92 @@ var gobjJs = function(e) {
|
|
|
2316
2328
|
},
|
|
2317
2329
|
mt_destroy: function(e) {}
|
|
2318
2330
|
};
|
|
2319
|
-
function gl(e, t) {
|
|
2320
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (mn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void Rt(e, "msec", t)) : (mn("not GObj TYPE"), -1);
|
|
2321
|
-
}
|
|
2322
2331
|
function dl(e, t) {
|
|
2323
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2324
|
-
}
|
|
2325
|
-
function bl(e) {
|
|
2326
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
j(
|
|
2333
|
-
j(
|
|
2334
|
-
j(
|
|
2335
|
-
j(
|
|
2336
|
-
j(
|
|
2337
|
-
j(
|
|
2338
|
-
j(
|
|
2339
|
-
j(
|
|
2340
|
-
j(
|
|
2341
|
-
j(
|
|
2342
|
-
j(
|
|
2343
|
-
j(
|
|
2344
|
-
j(
|
|
2345
|
-
j(
|
|
2346
|
-
j(
|
|
2332
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void Rt(e, "msec", t)) : (hn("not GObj TYPE"), -1);
|
|
2333
|
+
}
|
|
2334
|
+
function bl(e, t) {
|
|
2335
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !0), void Rt(e, "msec", t)) : (hn("not GObj TYPE"), -1);
|
|
2336
|
+
}
|
|
2337
|
+
function pl(e) {
|
|
2338
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (hn("not GObj TYPE"), -1);
|
|
2339
|
+
}
|
|
2340
|
+
var ml = [
|
|
2341
|
+
j(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2342
|
+
j(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2343
|
+
j(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
2344
|
+
j(y.DTP_STRING, "start_date", 0, "", "Yuno starting date"),
|
|
2345
|
+
j(y.DTP_STRING, "node_uuid", 0, "", "uuid of node"),
|
|
2346
|
+
j(y.DTP_STRING, "yuno_role", 0, "", "Yuno role"),
|
|
2347
|
+
j(y.DTP_STRING, "yuno_id", 0, "", "Yuno Id. Set by agent"),
|
|
2348
|
+
j(y.DTP_STRING, "yuno_name", 0, "", "Yuno name. Set by agent"),
|
|
2349
|
+
j(y.DTP_STRING, "yuno_tag", 0, "", "Tags of yuno. Set by agent"),
|
|
2350
|
+
j(y.DTP_STRING, "yuno_release", 0, "", "Yuno Release. Set by agent"),
|
|
2351
|
+
j(y.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
2352
|
+
j(y.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
2353
|
+
j(y.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
2354
|
+
j(y.DTP_DICT, "trace_levels", E.SDF_PERSIST, "{}", "Trace levels"),
|
|
2355
|
+
j(y.DTP_DICT, "no_trace_levels", E.SDF_PERSIST, "{}", "No trace levels"),
|
|
2356
|
+
j(y.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
2357
|
+
j(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2358
|
+
j(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2347
2359
|
v()
|
|
2348
|
-
],
|
|
2360
|
+
], hl = { gobj_timer: null }, yl = null;
|
|
2349
2361
|
function El(e, t, n, r) {
|
|
2350
|
-
let l =
|
|
2351
|
-
return
|
|
2362
|
+
let l = yt(e, t);
|
|
2363
|
+
return Zn(l) || (l = {}), l[n] = r, St(e, t, l), De(e, t);
|
|
2352
2364
|
}
|
|
2353
|
-
function
|
|
2365
|
+
function Tl(e) {
|
|
2354
2366
|
if (!0 === e || !1 === e) return e;
|
|
2355
2367
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2356
2368
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2357
2369
|
}
|
|
2358
|
-
function
|
|
2370
|
+
function vl() {
|
|
2359
2371
|
return `${ze()}^${He()}`;
|
|
2360
2372
|
}
|
|
2361
|
-
function
|
|
2362
|
-
return
|
|
2373
|
+
function jl(e, t, n, r) {
|
|
2374
|
+
return Xt(e, t, n), 0;
|
|
2363
2375
|
}
|
|
2364
|
-
var
|
|
2376
|
+
var Ol = {
|
|
2365
2377
|
mt_create: function(e) {
|
|
2366
2378
|
let t = e.priv;
|
|
2367
|
-
|
|
2368
|
-
let t =
|
|
2369
|
-
if (!
|
|
2379
|
+
$t(e, "start_date", qr()), $t(e, "node_uuid", zr()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = yt(e, "periodic_timeout"), function(e) {
|
|
2380
|
+
let t = yt(e, "trace_levels");
|
|
2381
|
+
if (!Zn(t)) return 0;
|
|
2370
2382
|
let n = t.__global_trace__;
|
|
2371
|
-
if (
|
|
2383
|
+
if (er(n)) {
|
|
2372
2384
|
Z(4294967295, !1);
|
|
2373
2385
|
for (let e of n) Q(e, !0);
|
|
2374
2386
|
}
|
|
2375
2387
|
for (const [n, r] of Object.entries(t)) {
|
|
2376
2388
|
let t = Oe(n);
|
|
2377
|
-
if (t) if (
|
|
2389
|
+
if (t) if (er(r)) {
|
|
2378
2390
|
se(t, null, !1);
|
|
2379
2391
|
for (let e of r) se(t, e, !0);
|
|
2380
|
-
} else
|
|
2392
|
+
} else hn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2381
2393
|
}
|
|
2382
2394
|
}(e), function(e) {
|
|
2383
|
-
let t =
|
|
2384
|
-
if (!
|
|
2395
|
+
let t = yt(e, "no_trace_levels");
|
|
2396
|
+
if (!Zn(t)) return 0;
|
|
2385
2397
|
let n = t.__global_no_trace__;
|
|
2386
|
-
if (
|
|
2398
|
+
if (er(n)) {
|
|
2387
2399
|
ee(4294967295, !1);
|
|
2388
2400
|
for (let e of n) X(e, !0);
|
|
2389
2401
|
}
|
|
2390
2402
|
for (const [n, r] of Object.entries(t)) {
|
|
2391
2403
|
let t = Oe(n);
|
|
2392
|
-
if (t) if (
|
|
2404
|
+
if (t) if (er(r)) {
|
|
2393
2405
|
ie(t, null, !1);
|
|
2394
2406
|
for (let e of r) ie(t, e, !0);
|
|
2395
|
-
} else
|
|
2407
|
+
} else hn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2396
2408
|
}
|
|
2397
2409
|
}(e);
|
|
2398
2410
|
},
|
|
2399
2411
|
mt_writing: function(e, t) {},
|
|
2400
2412
|
mt_start: function(e) {
|
|
2401
|
-
return
|
|
2413
|
+
return bl(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2402
2414
|
},
|
|
2403
2415
|
mt_stop: function(e) {
|
|
2404
|
-
return
|
|
2416
|
+
return pl(e.priv.gobj_timer), Me(e), 0;
|
|
2405
2417
|
},
|
|
2406
2418
|
mt_destroy: function(e) {},
|
|
2407
2419
|
mt_play: function(e) {
|
|
@@ -2418,49 +2430,49 @@ var gobjJs = function(e) {
|
|
|
2418
2430
|
case "get-global-no-trace": return l(0, 0, null, null, ne());
|
|
2419
2431
|
case "set-global-trace":
|
|
2420
2432
|
case "set-global-no-trace": {
|
|
2421
|
-
let r = "set-global-no-trace" === t, o = n.level, s =
|
|
2422
|
-
return o ? null === s ? l(0, -1, `${
|
|
2433
|
+
let r = "set-global-no-trace" === t, o = n.level, s = Tl(n.set);
|
|
2434
|
+
return o ? null === s ? l(0, -1, `${vl()}: bitmask set or re-set?`, null, null) : (r ? X(o, s) : Q(o, s)) < 0 ? l(0, -1, `${vl()}: global trace level not found: ${o}`, null, null) : r ? (El(e, "no_trace_levels", "__global_no_trace__", ne()), l(0, 0, null, null, ne())) : (El(e, "trace_levels", "__global_trace__", te()), l(0, 0, null, null, te())) : l(0, -1, `${vl()}: what level?`, null, null);
|
|
2423
2435
|
}
|
|
2424
2436
|
case "get-gclass-trace":
|
|
2425
2437
|
case "get-gclass-no-trace":
|
|
2426
2438
|
case "set-gclass-trace":
|
|
2427
2439
|
case "set-gclass-no-trace": {
|
|
2428
2440
|
let r = t.indexOf("no-trace") >= 0, o = n.gclass_name || n.gclass || "", s = Oe(o);
|
|
2429
|
-
if (!s) return l(0, -1, `${
|
|
2441
|
+
if (!s) return l(0, -1, `${vl()}: what gclass is '${o}'?`, null, null);
|
|
2430
2442
|
if (0 === t.indexOf("get-")) return l(0, 0, null, null, r ? oe(s) : re(s));
|
|
2431
|
-
let i = n.level, _ =
|
|
2432
|
-
return i ? null === _ ? l(0, -1, `${
|
|
2443
|
+
let i = n.level, _ = Tl(n.set);
|
|
2444
|
+
return i ? null === _ ? l(0, -1, `${vl()}: bitmask set or re-set?`, null, null) : (r ? ie(s, i, _) : se(s, i, _)) < 0 ? l(0, -1, `${vl()}: trace level of ${o} not found: ${i}`, null, null) : r ? (El(e, "no_trace_levels", o, oe(s)), l(0, 0, null, null, oe(s))) : (El(e, "trace_levels", o, le(s)), l(0, 0, null, null, re(s))) : l(0, -1, `${vl()}: what level?`, null, null);
|
|
2433
2445
|
}
|
|
2434
|
-
default: return l(0, -1, `${
|
|
2446
|
+
default: return l(0, -1, `${vl()}: command not available: ${t}`, null, null);
|
|
2435
2447
|
}
|
|
2436
2448
|
}
|
|
2437
2449
|
};
|
|
2438
|
-
var
|
|
2439
|
-
j(
|
|
2440
|
-
j(
|
|
2441
|
-
j(
|
|
2442
|
-
j(
|
|
2443
|
-
j(
|
|
2444
|
-
j(
|
|
2445
|
-
j(
|
|
2446
|
-
j(
|
|
2447
|
-
j(
|
|
2448
|
-
j(
|
|
2449
|
-
j(
|
|
2450
|
-
j(
|
|
2451
|
-
j(
|
|
2452
|
-
j(
|
|
2453
|
-
j(
|
|
2450
|
+
var Sl = "ievent_gate_stack", wl = [
|
|
2451
|
+
j(y.DTP_STRING, "wanted_yuno_role", E.SDF_RD, "", "wanted yuno role"),
|
|
2452
|
+
j(y.DTP_STRING, "wanted_yuno_name", E.SDF_RD, "", "wanted yuno name"),
|
|
2453
|
+
j(y.DTP_STRING, "wanted_yuno_service", E.SDF_RD, "", "wanted yuno service"),
|
|
2454
|
+
j(y.DTP_STRING, "remote_yuno_role", E.SDF_RD, "", "confirmed remote yuno role"),
|
|
2455
|
+
j(y.DTP_STRING, "remote_yuno_name", E.SDF_RD, "", "confirmed remote yuno name"),
|
|
2456
|
+
j(y.DTP_STRING, "remote_yuno_service", E.SDF_RD, "", "confirmed remote yuno service"),
|
|
2457
|
+
j(y.DTP_STRING, "url", E.SDF_RD, "", "Url to connect"),
|
|
2458
|
+
j(y.DTP_STRING, "jwt", E.SDF_PERSIST, "", "JWT"),
|
|
2459
|
+
j(y.DTP_STRING, "cert_pem", E.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2460
|
+
j(y.DTP_JSON, "extra_info", E.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2461
|
+
j(y.DTP_LIST, "required_services", E.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."),
|
|
2462
|
+
j(y.DTP_INTEGER, "timeout_retry", E.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"),
|
|
2463
|
+
j(y.DTP_INTEGER, "timeout_retry_max", E.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2464
|
+
j(y.DTP_INTEGER, "timeout_idack", E.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2465
|
+
j(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2454
2466
|
v()
|
|
2455
|
-
],
|
|
2467
|
+
], Nl = [
|
|
2456
2468
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2457
2469
|
["ievents2", "Trace inter-events with full kw"],
|
|
2458
2470
|
["identity-card", "Trace identity_card messages"]
|
|
2459
2471
|
];
|
|
2460
|
-
function
|
|
2472
|
+
function Rl(e) {
|
|
2461
2473
|
return !!(3 & x(e));
|
|
2462
2474
|
}
|
|
2463
|
-
var
|
|
2475
|
+
var $l = {
|
|
2464
2476
|
url: null,
|
|
2465
2477
|
remote_yuno_name: null,
|
|
2466
2478
|
remote_yuno_role: null,
|
|
@@ -2471,93 +2483,99 @@ var gobjJs = function(e) {
|
|
|
2471
2483
|
inside_on_open: !1,
|
|
2472
2484
|
retry_ms: 0
|
|
2473
2485
|
}, Dl = null;
|
|
2474
|
-
function
|
|
2475
|
-
e.priv.websocket &&
|
|
2486
|
+
function kl(e) {
|
|
2487
|
+
e.priv.websocket && hn("Websocket ALREADY setup");
|
|
2476
2488
|
const t = jt(e, "url");
|
|
2477
2489
|
En(`====> Starting WebSocket to '${t}' (${et(e)})`);
|
|
2478
2490
|
const n = ++e.priv.ws_seq;
|
|
2479
2491
|
let r;
|
|
2480
2492
|
try {
|
|
2481
2493
|
r = new WebSocket(t);
|
|
2482
|
-
} catch (
|
|
2483
|
-
return
|
|
2494
|
+
} catch (r) {
|
|
2495
|
+
return hn(`${et(e)}: Cannot open WebSocket to '${t}', Error: ${r.message}`), Ut(e, "EV_ON_CLOSE", {
|
|
2496
|
+
url: t,
|
|
2497
|
+
ws_seq: n,
|
|
2498
|
+
code: 1006,
|
|
2499
|
+
reason: r.message,
|
|
2500
|
+
was_clean: !1
|
|
2501
|
+
}, e), null;
|
|
2484
2502
|
}
|
|
2485
2503
|
return r ? (r.onopen = () => {
|
|
2486
|
-
n !== e.priv.ws_seq || ot(e) ||
|
|
2504
|
+
n !== e.priv.ws_seq || ot(e) || Vt(e, "EV_ON_OPEN", {
|
|
2487
2505
|
url: t,
|
|
2488
2506
|
ws_seq: n
|
|
2489
2507
|
}, e);
|
|
2490
2508
|
}, r.onmessage = (r) => {
|
|
2491
|
-
n !== e.priv.ws_seq || ot(e) ||
|
|
2509
|
+
n !== e.priv.ws_seq || ot(e) || Vt(e, "EV_ON_MESSAGE", {
|
|
2492
2510
|
url: t,
|
|
2493
2511
|
data: r.data
|
|
2494
2512
|
}, e);
|
|
2495
2513
|
}, r.onclose = (r) => {
|
|
2496
|
-
ot(e) || n === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ?
|
|
2514
|
+
ot(e) || n === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ? yn("Close websocket by unload page") : Vt(e, "EV_ON_CLOSE", {
|
|
2497
2515
|
url: t,
|
|
2498
2516
|
ws_seq: n,
|
|
2499
2517
|
code: r.code,
|
|
2500
2518
|
reason: r.reason,
|
|
2501
2519
|
was_clean: r.wasClean
|
|
2502
2520
|
}, e));
|
|
2503
|
-
}, r) : (
|
|
2521
|
+
}, r) : (hn(`${et(e)}: Failed to initialize WebSocket.`), null);
|
|
2504
2522
|
}
|
|
2505
|
-
function
|
|
2523
|
+
function Al(e, t = 1e3, n = "") {
|
|
2506
2524
|
let r = e.priv, l = r.websocket;
|
|
2507
2525
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2508
2526
|
En(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2509
2527
|
try {
|
|
2510
2528
|
l.close(t, n);
|
|
2511
2529
|
} catch (t) {
|
|
2512
|
-
|
|
2530
|
+
hn(`${et(e)}: Error closing WebSocket: ${t.message}`);
|
|
2513
2531
|
}
|
|
2514
|
-
} else
|
|
2532
|
+
} else yn("WebSocket is already closed or in the process of closing.");
|
|
2515
2533
|
}
|
|
2516
|
-
function
|
|
2517
|
-
let r =
|
|
2534
|
+
function Il(e, t, n) {
|
|
2535
|
+
let r = qr();
|
|
2518
2536
|
try {
|
|
2519
|
-
En("\n" + r + " " + t + "\n"),
|
|
2537
|
+
En("\n" + r + " " + t + "\n"), Un(n);
|
|
2520
2538
|
} catch (e) {
|
|
2521
2539
|
En("ERROR in trace_inter_event: " + e);
|
|
2522
2540
|
}
|
|
2523
2541
|
}
|
|
2524
|
-
var
|
|
2542
|
+
var Cl = class {
|
|
2525
2543
|
constructor(e, t) {
|
|
2526
2544
|
this.event = e, this.kw = t || {};
|
|
2527
2545
|
}
|
|
2528
2546
|
};
|
|
2529
|
-
function
|
|
2547
|
+
function Ll(e, t, n, r) {
|
|
2530
2548
|
return function(e, t) {
|
|
2531
2549
|
let n = e.priv, r = JSON.stringify(t);
|
|
2532
|
-
if (
|
|
2533
|
-
let n = jt(e, "url"), l = Xe(qe()) + " ==> " + n, o =
|
|
2534
|
-
o ? o(l, t, 1, r.length) :
|
|
2550
|
+
if (Rl(e)) {
|
|
2551
|
+
let n = jt(e, "url"), l = Xe(qe()) + " ==> " + n, o = yt(qe(), "trace_ievent_callback");
|
|
2552
|
+
o ? o(l, t, 1, r.length) : Il(0, l, t);
|
|
2535
2553
|
}
|
|
2536
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2554
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return yn(`${et(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2537
2555
|
try {
|
|
2538
2556
|
n.websocket.send(r);
|
|
2539
2557
|
} catch (t) {
|
|
2540
|
-
|
|
2558
|
+
hn(`${et(e)}: send_iev(): ${t}`);
|
|
2541
2559
|
}
|
|
2542
2560
|
return 0;
|
|
2543
2561
|
}(e, function(e, t) {
|
|
2544
|
-
return
|
|
2562
|
+
return ir(e) ? (hn("iev_create() event NULL"), null) : new Cl(e, t);
|
|
2545
2563
|
}(t, n));
|
|
2546
2564
|
}
|
|
2547
|
-
function
|
|
2548
|
-
return
|
|
2565
|
+
function Pl(e, t, n) {
|
|
2566
|
+
return ir(n) && (n = jt(e, "wanted_yuno_service")), {
|
|
2549
2567
|
dst_yuno: jt(e, "wanted_yuno_name"),
|
|
2550
2568
|
dst_role: jt(e, "wanted_yuno_role"),
|
|
2551
2569
|
dst_service: n,
|
|
2552
2570
|
src_yuno: He(),
|
|
2553
2571
|
src_role: ze(),
|
|
2554
2572
|
src_service: t,
|
|
2555
|
-
host:
|
|
2573
|
+
host: zr()
|
|
2556
2574
|
};
|
|
2557
2575
|
}
|
|
2558
|
-
function
|
|
2559
|
-
let t = e.priv, n = Je(qe()), r = jt(qe(), "yuno_version"), l = jt(qe(), "yuno_release"), o = jt(qe(), "yuno_tag"), i =
|
|
2560
|
-
i && i.length || (i =
|
|
2576
|
+
function Ul(e) {
|
|
2577
|
+
let t = e.priv, n = Je(qe()), r = jt(qe(), "yuno_version"), l = jt(qe(), "yuno_release"), o = jt(qe(), "yuno_tag"), i = yt(e, "required_services");
|
|
2578
|
+
i && i.length || (i = yt(qe(), "required_services"));
|
|
2561
2579
|
let _ = {
|
|
2562
2580
|
yuno_role: ze(),
|
|
2563
2581
|
yuno_id: Qe(),
|
|
@@ -2573,34 +2591,34 @@ var gobjJs = function(e) {
|
|
|
2573
2591
|
username: jt(qe(), "__username__"),
|
|
2574
2592
|
launch_id: 0,
|
|
2575
2593
|
yuno_startdate: jt(qe(), "start_date"),
|
|
2576
|
-
id:
|
|
2594
|
+
id: zr(),
|
|
2577
2595
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2578
2596
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2579
2597
|
required_services: i
|
|
2580
2598
|
};
|
|
2581
|
-
return
|
|
2599
|
+
return Vr(e, _, Sl, Pl(e, Xe(nt(e)), null)), Mr(e, _, "__identity__"), dl(t.gobj_timer, vt(e, "timeout_idack")), Ll(e, "EV_IDENTITY_CARD", _);
|
|
2582
2600
|
}
|
|
2583
|
-
function
|
|
2584
|
-
if (
|
|
2601
|
+
function Fl(e, t) {
|
|
2602
|
+
if (ir(t.event)) return -1;
|
|
2585
2603
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2586
2604
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2587
|
-
return
|
|
2588
|
-
}
|
|
2589
|
-
function Fl(e, t, n, r) {
|
|
2590
|
-
let l = e.priv;
|
|
2591
|
-
return Ke(e) && (l.websocket = $l(e)), 0;
|
|
2605
|
+
return Vr(e, n, Sl, Pl(e, Xe(i), s)), Mr(e, n, "__subscribing__"), Ll(e, t.event, n);
|
|
2592
2606
|
}
|
|
2593
2607
|
function Vl(e, t, n, r) {
|
|
2594
|
-
|
|
2608
|
+
let l = e.priv;
|
|
2609
|
+
return Ke(e) && (l.websocket = kl(e)), 0;
|
|
2595
2610
|
}
|
|
2596
2611
|
function Gl(e, t, n, r) {
|
|
2612
|
+
return En("Websocket opened: " + e.priv.url), Ul(e), 0;
|
|
2613
|
+
}
|
|
2614
|
+
function Ml(e, t, n, r) {
|
|
2597
2615
|
let l = e.priv, o = n.url;
|
|
2598
|
-
return
|
|
2616
|
+
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (bn(), yn(`${et(e)}: WebSocket closed ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, Xt(e, "EV_ON_CLOSE", {
|
|
2599
2617
|
url: o,
|
|
2600
2618
|
remote_yuno_name: l.remote_yuno_name,
|
|
2601
2619
|
remote_yuno_role: l.remote_yuno_role,
|
|
2602
2620
|
remote_yuno_service: l.remote_yuno_service
|
|
2603
|
-
})) : (
|
|
2621
|
+
})) : Ke(e) && (yn(`${et(e)}: EV_ON_OPEN_ERROR cannot open ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), Xt(e, "EV_ON_OPEN_ERROR", {
|
|
2604
2622
|
url: o,
|
|
2605
2623
|
remote_yuno_name: l.remote_yuno_name,
|
|
2606
2624
|
remote_yuno_role: l.remote_yuno_role,
|
|
@@ -2608,25 +2626,25 @@ var gobjJs = function(e) {
|
|
|
2608
2626
|
code: n.code,
|
|
2609
2627
|
reason: n.reason,
|
|
2610
2628
|
was_clean: n.was_clean
|
|
2611
|
-
})), Ke(e) &&
|
|
2629
|
+
})), Ke(e) && dl(l.gobj_timer, function(e) {
|
|
2612
2630
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2613
2631
|
r < n && (r = n);
|
|
2614
2632
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2615
2633
|
let l = .2 * t.retry_ms, o = t.retry_ms - l + 2 * Math.random() * l;
|
|
2616
2634
|
return Math.max(1, Math.round(o));
|
|
2617
|
-
}(e)), 0;
|
|
2618
|
-
}
|
|
2619
|
-
function Ml(e, t, n, r) {
|
|
2620
|
-
return Pl(e), 0;
|
|
2635
|
+
}(e))), 0;
|
|
2621
2636
|
}
|
|
2622
2637
|
function Wl(e, t, n, r) {
|
|
2638
|
+
return Ul(e), 0;
|
|
2639
|
+
}
|
|
2640
|
+
function xl(e, t, n, r) {
|
|
2623
2641
|
let l = e.priv;
|
|
2624
|
-
|
|
2625
|
-
let o =
|
|
2626
|
-
|
|
2627
|
-
let a =
|
|
2642
|
+
pl(l.gobj_timer);
|
|
2643
|
+
let o = Gr(e, n, Sl, !0), s = Er(e, o, "src_yuno", ""), i = Er(e, o, "src_role", ""), _ = Er(e, o, "src_service", "");
|
|
2644
|
+
$t(e, "remote_yuno_name", s), $t(e, "remote_yuno_role", i), $t(e, "remote_yuno_service", _);
|
|
2645
|
+
let a = yr(e, n, "result", -1, 0), u = Er(e, n, "comment", "", 0), c = Er(e, n, "username", "", 0), f = jr(e, n, "services_roles", {});
|
|
2628
2646
|
if (a < 0) {
|
|
2629
|
-
|
|
2647
|
+
Al(e);
|
|
2630
2648
|
let t = {
|
|
2631
2649
|
url: jt(e, "url"),
|
|
2632
2650
|
result: a,
|
|
@@ -2636,9 +2654,9 @@ var gobjJs = function(e) {
|
|
|
2636
2654
|
remote_yuno_role: i,
|
|
2637
2655
|
remote_yuno_service: _
|
|
2638
2656
|
};
|
|
2639
|
-
lt(e) ?
|
|
2657
|
+
lt(e) ? Vt(nt(e), "EV_ON_ID_NAK", t, e) : Xt(e, "EV_ON_ID_NAK", t);
|
|
2640
2658
|
} else {
|
|
2641
|
-
if (
|
|
2659
|
+
if (Dt(e, "ST_SESSION"), l.inside_on_open = !0, l.retry_ms = 0, !l.inform_on_close) {
|
|
2642
2660
|
l.inform_on_close = !0;
|
|
2643
2661
|
let t = {
|
|
2644
2662
|
username: c,
|
|
@@ -2647,70 +2665,70 @@ var gobjJs = function(e) {
|
|
|
2647
2665
|
remote_yuno_service: _,
|
|
2648
2666
|
services_roles: f
|
|
2649
2667
|
};
|
|
2650
|
-
lt(e) ?
|
|
2668
|
+
lt(e) ? Vt(nt(e), "EV_ON_OPEN", t, e) : Xt(e, "EV_ON_OPEN", t);
|
|
2651
2669
|
}
|
|
2652
2670
|
l.inside_on_open = !1, function(e) {
|
|
2653
|
-
let t =
|
|
2654
|
-
for (let n = 0; n < t.length; n++)
|
|
2671
|
+
let t = zt(e, null, null, null);
|
|
2672
|
+
for (let n = 0; n < t.length; n++) Fl(e, t[n]);
|
|
2655
2673
|
}(e);
|
|
2656
2674
|
}
|
|
2657
2675
|
return 0;
|
|
2658
2676
|
}
|
|
2659
|
-
function
|
|
2677
|
+
function Kl(e, t, n, r) {
|
|
2660
2678
|
let l = e.priv.url, o = function(e, t) {
|
|
2661
2679
|
let n;
|
|
2662
2680
|
try {
|
|
2663
2681
|
n = JSON.parse(t);
|
|
2664
2682
|
} catch (t) {
|
|
2665
|
-
return
|
|
2683
|
+
return yn(`${et(e)}: parsing inter_event json: ${t}`), null;
|
|
2666
2684
|
}
|
|
2667
|
-
if (!(n instanceof Object)) return
|
|
2685
|
+
if (!(n instanceof Object)) return yn(`${et(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
2668
2686
|
let r = n.event;
|
|
2669
|
-
if (!r) return
|
|
2670
|
-
if ("string" != typeof r) return
|
|
2687
|
+
if (!r) return yn(`${et(e)}: parsing inter_event: no event`), null;
|
|
2688
|
+
if ("string" != typeof r) return yn(`${et(e)}: parsing inter_event: event not a string`), null;
|
|
2671
2689
|
let l = n.kw;
|
|
2672
2690
|
return l ? l instanceof Object ? {
|
|
2673
2691
|
event: r,
|
|
2674
2692
|
kw: l || {}
|
|
2675
|
-
} : (
|
|
2693
|
+
} : (yn(`${et(e)}: parsing inter_event: kw not a json object`), null) : (yn(`${et(e)}: parsing inter_kw: no kw`), null);
|
|
2676
2694
|
}(e, n.data);
|
|
2677
|
-
if (!o) return
|
|
2678
|
-
if (
|
|
2679
|
-
let e = Xe(qe()) + " <== " + l, t = n.data.length, r =
|
|
2680
|
-
r ? r(e, o, 2, t) :
|
|
2695
|
+
if (!o) return yn(`${et(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
2696
|
+
if (Rl(e)) {
|
|
2697
|
+
let e = Xe(qe()) + " <== " + l, t = n.data.length, r = yt(qe(), "trace_ievent_callback");
|
|
2698
|
+
r ? r(e, o, 2, t) : Il(0, e, o);
|
|
2681
2699
|
}
|
|
2682
2700
|
let s = o.event, i = o.kw;
|
|
2683
2701
|
if ("ST_SESSION" !== kt(e)) {
|
|
2684
|
-
if (It(e, s,
|
|
2685
|
-
if (!(
|
|
2686
|
-
} else
|
|
2687
|
-
return
|
|
2702
|
+
if (It(e, s, $.EVF_PUBLIC_EVENT)) {
|
|
2703
|
+
if (!(Vt(e, s, i, e) < 0)) return 0;
|
|
2704
|
+
} else hn(`${et(e)}: event UNKNOWN in not-session state ${s}`);
|
|
2705
|
+
return Al(e), -1;
|
|
2688
2706
|
}
|
|
2689
2707
|
o = null;
|
|
2690
|
-
let _ =
|
|
2691
|
-
if (u.toLowerCase() !== ze().toLowerCase()) return
|
|
2708
|
+
let _ = Wr(e, i), a = Gr(e, i, Sl), u = Er(e, a, "dst_role", "");
|
|
2709
|
+
if (u.toLowerCase() !== ze().toLowerCase()) return hn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2692
2710
|
let c = Er(e, a, "dst_service", "");
|
|
2693
|
-
if ("__subscribing__" === _) return
|
|
2694
|
-
if ("__unsubscribing__" === _) return
|
|
2695
|
-
if (It(e, s,
|
|
2696
|
-
if (!
|
|
2711
|
+
if ("__subscribing__" === _) return yn(`${et(e)}: subscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2712
|
+
if ("__unsubscribing__" === _) return yn(`${et(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2713
|
+
if (It(e, s, $.EVF_PUBLIC_EVENT)) return Vt(e, s, i, e), 0;
|
|
2714
|
+
if (!ir(c)) {
|
|
2697
2715
|
let t = we(c, !1);
|
|
2698
|
-
return t ? It(t, s,
|
|
2716
|
+
return t ? It(t, s, $.EVF_PUBLIC_EVENT) ? (Vt(t, s, i, e), 0) : (hn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (yn(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2699
2717
|
}
|
|
2700
|
-
return lt(e) ?
|
|
2718
|
+
return lt(e) ? Vt(nt(e), s, i, e) : Xt(e, s, i), 0;
|
|
2701
2719
|
}
|
|
2702
|
-
function
|
|
2720
|
+
function Yl(e, t, n, r) {
|
|
2703
2721
|
return 0;
|
|
2704
2722
|
}
|
|
2705
|
-
function
|
|
2723
|
+
function Bl(e, t, n, r) {
|
|
2706
2724
|
return 0;
|
|
2707
2725
|
}
|
|
2708
|
-
var
|
|
2726
|
+
var Jl = {
|
|
2709
2727
|
mt_create: function(e) {
|
|
2710
2728
|
let t = e.priv;
|
|
2711
|
-
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"),
|
|
2729
|
+
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), $t(e, "wanted_yuno_name", t.remote_yuno_name), $t(e, "wanted_yuno_role", t.remote_yuno_role), $t(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2712
2730
|
const n = Ot(e, "subscriber");
|
|
2713
|
-
n &&
|
|
2731
|
+
n && qt(e, null, {}, n);
|
|
2714
2732
|
},
|
|
2715
2733
|
mt_writing: function(e, t) {
|
|
2716
2734
|
let n = e.priv;
|
|
@@ -2729,58 +2747,58 @@ var gobjJs = function(e) {
|
|
|
2729
2747
|
},
|
|
2730
2748
|
mt_start: function(e) {
|
|
2731
2749
|
let t = e.priv;
|
|
2732
|
-
return t.retry_ms = 0, "ST_DISCONNECTED" !== kt(e) && (
|
|
2750
|
+
return t.retry_ms = 0, "ST_DISCONNECTED" !== kt(e) && (Vt(e, "EV_ON_CLOSE", {
|
|
2733
2751
|
url: t.url,
|
|
2734
2752
|
ws_seq: t.ws_seq,
|
|
2735
2753
|
code: 1e3,
|
|
2736
2754
|
reason: "restarted",
|
|
2737
2755
|
was_clean: !0
|
|
2738
|
-
}, e),
|
|
2756
|
+
}, e), pl(t.gobj_timer)), t.websocket = kl(e), 0;
|
|
2739
2757
|
},
|
|
2740
2758
|
mt_stop: function(e) {
|
|
2741
2759
|
let t = e.priv;
|
|
2742
|
-
return
|
|
2760
|
+
return pl(t.gobj_timer), t.websocket && Al(e), 0;
|
|
2743
2761
|
},
|
|
2744
2762
|
mt_destroy: function(e) {},
|
|
2745
2763
|
mt_stats: function(e, t, n, r) {
|
|
2746
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2764
|
+
if ("ST_SESSION" !== kt(e)) return hn("Not in session"), null;
|
|
2747
2765
|
n || (n = {});
|
|
2748
|
-
let l =
|
|
2749
|
-
return o || (o = {}),
|
|
2766
|
+
let l = Pl(e, Xe(r), Er(e, n, "service", null, 0)), o = jr(e, n, "__md_stats__", null, Zt.KW_EXTRACT);
|
|
2767
|
+
return o || (o = {}), Vr(e, n, "stats_stack", {
|
|
2750
2768
|
stats: t,
|
|
2751
2769
|
kw: o
|
|
2752
|
-
}),
|
|
2770
|
+
}), Vr(e, n, Sl, l), n.__stats__ = t, Mr(e, n, "__stats__"), Ll(e, "EV_MT_STATS", n, r), null;
|
|
2753
2771
|
},
|
|
2754
2772
|
mt_command_parser: function(e, t, n, r) {
|
|
2755
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2773
|
+
if ("ST_SESSION" !== kt(e)) return hn("Not in session"), null;
|
|
2756
2774
|
n || (n = {});
|
|
2757
|
-
let l =
|
|
2758
|
-
return o || (o = {}),
|
|
2775
|
+
let l = Pl(e, Xe(r), Er(e, n, "service", "", 0)), o = jr(e, n, "__md_command__", null, Zt.KW_EXTRACT);
|
|
2776
|
+
return o || (o = {}), Vr(e, n, "command_stack", {
|
|
2759
2777
|
command: t,
|
|
2760
2778
|
kw: o
|
|
2761
|
-
}),
|
|
2779
|
+
}), Vr(e, n, Sl, l), n.__command__ = t, Mr(e, n, "__command__"), Ll(e, "EV_MT_COMMAND", n, r), null;
|
|
2762
2780
|
},
|
|
2763
2781
|
mt_inject_event: function(e, t, n, r) {
|
|
2764
2782
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
2765
|
-
if (n =
|
|
2783
|
+
if (n = Gn({}, Zn(n) ? n : {}), Zn(n.__md_iev__) && (n.__md_iev__ = Fn(n.__md_iev__)), Gr(e, n, Sl));
|
|
2766
2784
|
else {
|
|
2767
|
-
let l =
|
|
2768
|
-
|
|
2785
|
+
let l = Pl(e, Xe(r), Er(e, n, "__service__", 0, 0));
|
|
2786
|
+
Kn(n, "__service__"), Vr(e, n, "__message__", t), Vr(e, n, Sl, l);
|
|
2769
2787
|
}
|
|
2770
|
-
return
|
|
2788
|
+
return Mr(e, n, "__message__"), Ll(e, t, n, r);
|
|
2771
2789
|
},
|
|
2772
2790
|
mt_subscription_added: function(e, t) {
|
|
2773
2791
|
let n = e.priv;
|
|
2774
|
-
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2792
|
+
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 : Fl(e, t) : 0;
|
|
2775
2793
|
},
|
|
2776
2794
|
mt_subscription_deleted: function(e, t) {
|
|
2777
2795
|
let n = e.priv;
|
|
2778
2796
|
if ("ST_SESSION" !== kt(e) || !n.websocket) return 0;
|
|
2779
2797
|
if (n.inside_on_open) return 0;
|
|
2780
|
-
if (
|
|
2798
|
+
if (ir(t.event)) return 0;
|
|
2781
2799
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2782
2800
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2783
|
-
return
|
|
2801
|
+
return Vr(e, r, Sl, Pl(e, Xe(_), i)), Mr(e, r, "__unsubscribing__"), Ll(e, t.event, r, e);
|
|
2784
2802
|
}
|
|
2785
2803
|
};
|
|
2786
2804
|
return e.GObj = S, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new T(e, t, n, null, o, r, null, 0, null, l, null), e.SDATACM = (e, t, n, r, l, o) => new T(e, t, 0, null, o, n, null, 0, l, r, null), e.SDATACM2 = (e, t, n, r, l, o, s) => new T(e, t, n, null, s, r, null, 0, o, l, null), e.SDATADF = (e, t, n, r, l, o) => new T(e, t, n, null, o, null, r, l), e.SDATAPM = (e, t, n, r, l) => new T(e, t, n, r, l), e.SDATAPM0 = (e, t, n, r, l) => new T(e, t, n, null, l, null, null, 0, null, null, r), e.SDATA_END = v, e.SDataDesc = T, e.YUNETA_VERSION = s, Object.defineProperty(e, "__yuno__", {
|
|
@@ -2794,50 +2812,50 @@ var gobjJs = function(e) {
|
|
|
2794
2812
|
return t;
|
|
2795
2813
|
}, e.build_stats_response = o, e.clean_name = function(e) {
|
|
2796
2814
|
return e.replace(/[?# ^:]/g, "_");
|
|
2797
|
-
}, e.clear_timeout =
|
|
2815
|
+
}, e.clear_timeout = pl, e.cmp_two_simple_json = cr, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2798
2816
|
let [r, l, o, s] = t;
|
|
2799
|
-
if (!r) return void
|
|
2817
|
+
if (!r) return void hn("Tag must be a valid HTML element.");
|
|
2800
2818
|
let i = document.createElement(r), _ = "";
|
|
2801
2819
|
if (l && "object" == typeof l) for (let e of Object.keys(l)) if ("style" === e && "object" == typeof l[e]) {
|
|
2802
2820
|
let t = "";
|
|
2803
2821
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2804
2822
|
i.style.cssText = t;
|
|
2805
2823
|
} else "style" === e ? i.style.cssText = l[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== l[e] && void 0 !== l[e] && (_ = l[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, l[e]);
|
|
2806
|
-
if (
|
|
2824
|
+
if (tr(o)) if (o = o.trim(), o.length > 0 && "<" === o[0]) i.appendChild(Jr(o));
|
|
2807
2825
|
else if (n && _) i.textContent = n(_) || o;
|
|
2808
2826
|
else i.textContent = o;
|
|
2809
|
-
else if (
|
|
2810
|
-
if (o.length > 0) if (
|
|
2811
|
-
else for (let t of o) Array.isArray(t)
|
|
2812
|
-
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (
|
|
2827
|
+
else if (er(o)) {
|
|
2828
|
+
if (o.length > 0) if (tr(o[0])) i.appendChild(e(o, n));
|
|
2829
|
+
else for (let t of o) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) : tr(t) ? i.appendChild(document.createTextNode(t)) : null != t && !1 !== t && hn("createElement2: child ignored, type " + typeof t);
|
|
2830
|
+
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (hn("content ignored"), vn(o));
|
|
2813
2831
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2814
2832
|
return i;
|
|
2815
|
-
}, e.createOneHtml =
|
|
2816
|
-
let n =
|
|
2817
|
-
return
|
|
2833
|
+
}, e.createOneHtml = Jr, e.create_json_record = function(e, t) {
|
|
2834
|
+
let n = Fn(e);
|
|
2835
|
+
return Mn(n, t), n;
|
|
2818
2836
|
}, e.create_template_record = function(e, t) {
|
|
2819
2837
|
let n = {};
|
|
2820
2838
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2821
2839
|
let l;
|
|
2822
|
-
|
|
2823
|
-
let o =
|
|
2840
|
+
Zn(r) && (l = r.default);
|
|
2841
|
+
let o = jr(null, t, e, l);
|
|
2824
2842
|
n[e] = o;
|
|
2825
2843
|
}), n;
|
|
2826
|
-
}, e.current_timestamp =
|
|
2827
|
-
let n = Dr(
|
|
2828
|
-
return n &&
|
|
2844
|
+
}, e.current_timestamp = qr, e.data_type_t = y, e.db_list_persistent_attrs = function(e, t) {
|
|
2845
|
+
let n = Dr(rl(e), null, !1), r = {};
|
|
2846
|
+
return n && Zn(n) && (r = Rr(e, n, t, !1)), r;
|
|
2829
2847
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2830
|
-
let n =
|
|
2831
|
-
if (r &&
|
|
2832
|
-
let l =
|
|
2833
|
-
l =
|
|
2848
|
+
let n = Et(e, E.SDF_PERSIST), r = Dr(rl(e), null, !1);
|
|
2849
|
+
if (r && Zn(r)) {
|
|
2850
|
+
let l = Rr(e, r, t, !1);
|
|
2851
|
+
l = Rr(e, l, n, !1), wt(e, l, E.SDF_PERSIST);
|
|
2834
2852
|
}
|
|
2835
2853
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2836
|
-
let n =
|
|
2837
|
-
0 ===
|
|
2854
|
+
let n = $r(e, Dr(rl(e), null, !1), t, !1);
|
|
2855
|
+
0 === zn(n) ? Ar(rl(e)) : kr(rl(e), n);
|
|
2838
2856
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2839
|
-
let n =
|
|
2840
|
-
return r &&
|
|
2857
|
+
let n = Rr(e, Et(e, E.SDF_PERSIST), t, !1), r = Dr(rl(e), null, !1);
|
|
2858
|
+
return r && Zn(r) && Wn(n, r), kr(rl(e), n);
|
|
2841
2859
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2842
2860
|
let r = null, l = null, o = null;
|
|
2843
2861
|
const s = (...s) => {
|
|
@@ -2857,27 +2875,24 @@ var gobjJs = function(e) {
|
|
|
2857
2875
|
return !1;
|
|
2858
2876
|
}, e.duplicate_objects = function(...e) {
|
|
2859
2877
|
const t = {};
|
|
2860
|
-
for (const n of e)
|
|
2861
|
-
const e = structuredClone(n);
|
|
2862
|
-
Object.assign(t, e);
|
|
2863
|
-
}
|
|
2878
|
+
for (const n of e) Gn(t, structuredClone(n));
|
|
2864
2879
|
return t;
|
|
2865
2880
|
}, e.empty_json = function(e) {
|
|
2866
|
-
return 0 ===
|
|
2867
|
-
}, e.empty_string =
|
|
2881
|
+
return 0 === Xn(e);
|
|
2882
|
+
}, e.empty_string = ir, e.escapeHtml = Br, e.event_flag_t = $, e.flat2json = function(e) {
|
|
2868
2883
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2869
2884
|
let t = null;
|
|
2870
2885
|
for (const n of Object.keys(e)) {
|
|
2871
|
-
const r =
|
|
2886
|
+
const r = tl(n);
|
|
2872
2887
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2873
|
-
if (r.length >
|
|
2888
|
+
if (r.length > Xr) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2874
2889
|
const l = "number" == typeof r[0];
|
|
2875
2890
|
if (null === t) t = l ? [] : {};
|
|
2876
2891
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2877
2892
|
let o = t;
|
|
2878
2893
|
for (let t = 0; t < r.length; t++) {
|
|
2879
2894
|
const l = r[t], s = "number" == typeof l, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2880
|
-
if (s && l >
|
|
2895
|
+
if (s && l > Zr) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2881
2896
|
if (s !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${s ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2882
2897
|
if (i) {
|
|
2883
2898
|
if (Array.isArray(o)) {
|
|
@@ -2885,7 +2900,7 @@ var gobjJs = function(e) {
|
|
|
2885
2900
|
o[l] = e[n];
|
|
2886
2901
|
} else {
|
|
2887
2902
|
if (Object.prototype.hasOwnProperty.call(o, l)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
2888
|
-
|
|
2903
|
+
br(o, l, e[n]);
|
|
2889
2904
|
}
|
|
2890
2905
|
break;
|
|
2891
2906
|
}
|
|
@@ -2893,7 +2908,7 @@ var gobjJs = function(e) {
|
|
|
2893
2908
|
if (Array.isArray(o)) {
|
|
2894
2909
|
for (; o.length <= l;) o.push(null);
|
|
2895
2910
|
a = o[l], null == a && (a = _ ? [] : {}, o[l] = a);
|
|
2896
|
-
} else a =
|
|
2911
|
+
} else a = dr(o, l) ? void 0 : o[l], void 0 === a && (a = _ ? [] : {}, br(o, l, a));
|
|
2897
2912
|
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`);
|
|
2898
2913
|
if (_ !== Array.isArray(a)) throw new Error(`flat2json: '${n}' needs a ${_ ? "array" : "object"} where the tree already has a ${Array.isArray(a) ? "array" : "object"}`);
|
|
2899
2914
|
o = a;
|
|
@@ -2904,11 +2919,11 @@ var gobjJs = function(e) {
|
|
|
2904
2919
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2905
2920
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2906
2921
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
2907
|
-
for (const n of Object.keys(t.added || {}))
|
|
2922
|
+
for (const n of Object.keys(t.added || {})) br(e, n, t.added[n]);
|
|
2908
2923
|
for (const n of Object.keys(t.changed || {})) {
|
|
2909
2924
|
const r = t.changed[n];
|
|
2910
2925
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
2911
|
-
|
|
2926
|
+
br(e, n, r.to);
|
|
2912
2927
|
}
|
|
2913
2928
|
return e;
|
|
2914
2929
|
}, e.flat_diff = function(e, t) {
|
|
@@ -2917,15 +2932,15 @@ var gobjJs = function(e) {
|
|
|
2917
2932
|
removed: {},
|
|
2918
2933
|
changed: {}
|
|
2919
2934
|
};
|
|
2920
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2935
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? nl(n[e], r[e]) || br(l.changed, e, {
|
|
2921
2936
|
from: n[e],
|
|
2922
2937
|
to: r[e]
|
|
2923
|
-
}) : l.removed
|
|
2924
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (l.added
|
|
2938
|
+
}) : br(l.removed, e, n[e]);
|
|
2939
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || br(l.added, e, r[e]);
|
|
2925
2940
|
return l;
|
|
2926
2941
|
}, e.flat_key_join = function(e) {
|
|
2927
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2928
|
-
}, e.flat_key_split =
|
|
2942
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : el(e)).join("`") : "";
|
|
2943
|
+
}, e.flat_key_split = tl, e.gclass_add_ev_action = ye, e.gclass_add_event_type = Te, e.gclass_add_state = he, e.gclass_check_fsm = je, e.gclass_create = de, e.gclass_event_type = ve, e.gclass_find_by_name = Oe, e.gclass_flag_t = w, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
2929
2944
|
if (!e) return {
|
|
2930
2945
|
top: 0,
|
|
2931
2946
|
left: 0,
|
|
@@ -2944,17 +2959,17 @@ var gobjJs = function(e) {
|
|
|
2944
2959
|
right: n + i + r,
|
|
2945
2960
|
bottom: t + s + l
|
|
2946
2961
|
};
|
|
2947
|
-
}, e.get_function_name =
|
|
2962
|
+
}, e.get_function_name = Qr, e.get_now = function() {
|
|
2948
2963
|
return Math.floor(Date.now() / 1e3);
|
|
2949
2964
|
}, e.gobj_bottom_gobj = st, e.gobj_change_parent = function(e, t) {
|
|
2950
|
-
return ot(e) ? (
|
|
2951
|
-
}, e.gobj_change_state =
|
|
2952
|
-
if (ot(e)) return
|
|
2965
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), null) : t instanceof S ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && ($e(e.parent, e), e.parent = null), Re(t, e), t.gclass.gmt.mt_child_added && (Y(e) && En(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.gclass.gmt.mt_child_added(t, e)), 0) : (hn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2966
|
+
}, e.gobj_change_state = Dt, e.gobj_command = function(e, t, r, o) {
|
|
2967
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), -1;
|
|
2953
2968
|
if (function(e) {
|
|
2954
2969
|
return G > 1 || !!e && !!(x(e) & P.TRACE_COMMANDS);
|
|
2955
2970
|
}(e) || H(e, null) && !z(o, null)) {
|
|
2956
|
-
let l =
|
|
2957
|
-
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) &&
|
|
2971
|
+
let l = kn(t);
|
|
2972
|
+
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) && Un(r);
|
|
2958
2973
|
}
|
|
2959
2974
|
return e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, o) : e.gclass.command_table ? c ? c(e, t, r, o) : l(0, -1, n("%s: global command parser not available", et(e)), 0, 0) : l(0, -1, n("%s: command table not available", et(e)), 0, 0);
|
|
2960
2975
|
}, e.gobj_create = function(e, t, n, r) {
|
|
@@ -2967,37 +2982,37 @@ var gobjJs = function(e) {
|
|
|
2967
2982
|
return Ie(e, t, n, r, N.gobj_flag_volatil);
|
|
2968
2983
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2969
2984
|
return Ie(e, t, n, null, N.gobj_flag_yuno);
|
|
2970
|
-
}, e.gobj_current_state = kt, e.gobj_default_service = Se, e.gobj_deliver_posted_events =
|
|
2971
|
-
if (
|
|
2985
|
+
}, e.gobj_current_state = kt, e.gobj_default_service = Se, e.gobj_deliver_posted_events = Ft, e.gobj_destroy = Le, e.gobj_find_child = pt, e.gobj_find_gobj = function(e, t) {
|
|
2986
|
+
if (ir(t)) return null;
|
|
2972
2987
|
const n = t.toLowerCase();
|
|
2973
2988
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
2974
|
-
}, e.gobj_find_service = we, e.gobj_find_subscribings =
|
|
2989
|
+
}, e.gobj_find_service = we, e.gobj_find_subscribings = Qt, e.gobj_find_subscriptions = zt, e.gobj_flag_t = N, e.gobj_full_name = tt, e.gobj_gclass_name = Ze, e.gobj_get_gclass_trace_level = re, e.gobj_get_gclass_trace_level2 = le, e.gobj_get_gclass_trace_no_level = oe, e.gobj_get_global_trace_level = te, e.gobj_get_global_trace_no_level = ne, e.gobj_global_trace_level = function() {
|
|
2975
2990
|
return F;
|
|
2976
2991
|
}, e.gobj_global_trace_no_level = function() {
|
|
2977
2992
|
return V;
|
|
2978
2993
|
}, e.gobj_has_attr = ht, e.gobj_has_event = It, e.gobj_has_output_event = Ct, e.gobj_hsdata = ce, e.gobj_is_destroying = ot, e.gobj_is_playing = Je, e.gobj_is_pure_child = lt, e.gobj_is_running = Ke, e.gobj_is_service = Be, e.gobj_is_volatil = rt, e.gobj_list_persistent_attrs = function(e, t) {
|
|
2979
2994
|
return u ? u(e, t) : null;
|
|
2980
2995
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2981
|
-
let t =
|
|
2996
|
+
let t = zt(e, null, null, null);
|
|
2982
2997
|
for (let n = 0; n < t.length; n++) {
|
|
2983
|
-
let r = t[n], l =
|
|
2984
|
-
|
|
2998
|
+
let r = t[n], l = Tr(e, r, "publisher", null, Zt.KW_REQUIRED), o = Tr(e, r, "subscriber", null, Zt.KW_REQUIRED);
|
|
2999
|
+
Bn(r, "s_event", Er(e, r, "event", "", Zt.KW_REQUIRED)), Bn(r, "s_publisher", et(l)), Bn(r, "s_subscriber", et(o));
|
|
2985
3000
|
}
|
|
2986
|
-
let n =
|
|
3001
|
+
let n = Qt(e, 0, null, 0);
|
|
2987
3002
|
for (let t = 0; t < n.length; t++) {
|
|
2988
|
-
let r = n[t], l =
|
|
2989
|
-
|
|
3003
|
+
let r = n[t], l = Tr(e, r, "publisher", null, Zt.KW_REQUIRED), o = Tr(e, r, "subscriber", null, Zt.KW_REQUIRED);
|
|
3004
|
+
Bn(r, "s_event", Er(e, r, "event", "", Zt.KW_REQUIRED)), Bn(r, "s_publisher", et(l)), Bn(r, "s_subscriber", et(o));
|
|
2990
3005
|
}
|
|
2991
3006
|
return {
|
|
2992
3007
|
subscriptions: t,
|
|
2993
3008
|
subscribings: n,
|
|
2994
|
-
"total subscriptions":
|
|
2995
|
-
total_subscribings:
|
|
3009
|
+
"total subscriptions": Qn(t),
|
|
3010
|
+
total_subscribings: Qn(n)
|
|
2996
3011
|
};
|
|
2997
3012
|
}, e.gobj_load_persistent_attrs = function(e, t) {
|
|
2998
|
-
return Be(e) ? i ? i(e, t) : -1 : (
|
|
3013
|
+
return Be(e) ? i ? i(e, t) : -1 : (hn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2999
3014
|
}, e.gobj_match_children = function(e, t) {
|
|
3000
|
-
if (ot(e)) return
|
|
3015
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), null;
|
|
3001
3016
|
t = t || {};
|
|
3002
3017
|
let n = [];
|
|
3003
3018
|
const r = e.dl_children;
|
|
@@ -3016,17 +3031,10 @@ var gobjJs = function(e) {
|
|
|
3016
3031
|
bt(o, t) && n.push(o), e(n, o);
|
|
3017
3032
|
}
|
|
3018
3033
|
}(n, e), n;
|
|
3019
|
-
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause = xe, e.gobj_play = We, e.gobj_post_event =
|
|
3020
|
-
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (mn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : sr(t) ? (mn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (mn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Lt.length}`), -1) : (Lt.push({
|
|
3021
|
-
dst: e,
|
|
3022
|
-
event: t,
|
|
3023
|
-
kw: r,
|
|
3024
|
-
src: l
|
|
3025
|
-
}), H(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ut, 0)), 0) : (mn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (mn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
3026
|
-
}, e.gobj_posted_events_size = function() {
|
|
3034
|
+
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause = xe, e.gobj_play = We, e.gobj_post_event = Ut, e.gobj_posted_events_size = function() {
|
|
3027
3035
|
return Lt.length;
|
|
3028
|
-
}, e.gobj_publish_event =
|
|
3029
|
-
return Be(e) ? a ? a(e, t) : -1 : (
|
|
3036
|
+
}, e.gobj_publish_event = Xt, e.gobj_read_attr = yt, e.gobj_read_attrs = Et, e.gobj_read_bool_attr = Tt, e.gobj_read_integer_attr = vt, e.gobj_read_pointer_attr = Ot, e.gobj_read_str_attr = jt, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
3037
|
+
return Be(e) ? a ? a(e, t) : -1 : (hn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
3030
3038
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
3031
3039
|
return U.map(([e, t, n]) => ({
|
|
3032
3040
|
name: e,
|
|
@@ -3036,51 +3044,51 @@ var gobjJs = function(e) {
|
|
|
3036
3044
|
}));
|
|
3037
3045
|
}, e.gobj_reset_volatil_attrs = function(e) {
|
|
3038
3046
|
return function(e, t, n) {
|
|
3039
|
-
if (ot(e)) return
|
|
3047
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), -1;
|
|
3040
3048
|
let r = e.gclass.attrs_table;
|
|
3041
3049
|
for (let l = 0; l < r.length; l++) {
|
|
3042
3050
|
const o = r[l];
|
|
3043
|
-
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o),
|
|
3051
|
+
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o), Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o.name) && (e.priv[o.name] = e.jn_attrs[o.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name)));
|
|
3044
3052
|
}
|
|
3045
3053
|
return 0;
|
|
3046
|
-
}(e,
|
|
3047
|
-
}, e.gobj_save_persistent_attrs =
|
|
3054
|
+
}(e, E.SDF_VOLATIL, 0);
|
|
3055
|
+
}, e.gobj_save_persistent_attrs = De, e.gobj_search_path = mt, e.gobj_send_event = Vt, e.gobj_services = function() {
|
|
3048
3056
|
let e = [];
|
|
3049
|
-
for (const t of Object.keys(b))
|
|
3057
|
+
for (const t of Object.keys(b)) qn(e, t);
|
|
3050
3058
|
return e;
|
|
3051
3059
|
}, e.gobj_set_bottom_gobj = it, e.gobj_set_deep_trace = function(e) {
|
|
3052
3060
|
return G = Number(e) || 0, 0;
|
|
3053
3061
|
}, e.gobj_set_gclass_no_trace = ie, e.gobj_set_gclass_trace = se, e.gobj_set_global_no_trace = X, e.gobj_set_global_no_trace2 = ee, e.gobj_set_global_trace = Q, e.gobj_set_global_trace2 = Z, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
3054
|
-
if (!e) return
|
|
3062
|
+
if (!e) return hn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
3055
3063
|
const r = W(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3056
3064
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
3057
3065
|
}, e.gobj_set_gobj_trace = function(e, t, n) {
|
|
3058
|
-
if (!e) return
|
|
3066
|
+
if (!e) return hn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
3059
3067
|
const r = W(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3060
3068
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
3061
3069
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
3062
3070
|
C = 1 === Number(e) ? 1 : 0;
|
|
3063
3071
|
}, e.gobj_short_name = et, e.gobj_start = Pe, e.gobj_start_children = function(e) {
|
|
3064
|
-
return ot(e) ? (
|
|
3072
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : at(e, D.WALK_FIRST2LAST, Ue, 0, 0);
|
|
3065
3073
|
}, e.gobj_start_tree = function(e) {
|
|
3066
|
-
return ot(e) ? (
|
|
3074
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", tt(e))), e.gclass.gclass_flag & w.gcflag_manual_start || e.disabled ? 0 : (e.running || Pe(e), ut(e, D.WALK_TOP2BOTTOM, Fe, 0, 0)));
|
|
3067
3075
|
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
3068
3076
|
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
3069
|
-
const d = [["EV_STATE_CHANGED",
|
|
3077
|
+
const d = [["EV_STATE_CHANGED", $.EVF_SYSTEM_EVENT | $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS], [0, 0]];
|
|
3070
3078
|
for (let e = 0; e < d.length; e++) {
|
|
3071
3079
|
let t = d[e][0], n = d[e][1];
|
|
3072
|
-
|
|
3080
|
+
Ee(g, t, n);
|
|
3073
3081
|
}
|
|
3074
3082
|
return 0;
|
|
3075
3083
|
}, e.gobj_stats = function(e, t, r, l) {
|
|
3076
|
-
return ot(e) ? (
|
|
3084
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, l) : f ? f(e, t, r, l) : o(0, -1, n("%s, stats parser not available", et(e)), 0, 0);
|
|
3077
3085
|
}, e.gobj_stop = Ve, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
3078
|
-
return ot(e) ? (
|
|
3079
|
-
}, e.gobj_subscribe_event =
|
|
3086
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", tt(e))), Ke(e) && Ve(e), ut(e, D.WALK_TOP2BOTTOM, Ge, 0, 0));
|
|
3087
|
+
}, e.gobj_subscribe_event = qt, e.gobj_trace_level = x, e.gobj_trace_machine_format = function() {
|
|
3080
3088
|
return C;
|
|
3081
3089
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
3082
|
-
if (null == n && (n = {}), !e) return
|
|
3083
|
-
if (!r) return
|
|
3090
|
+
if (null == n && (n = {}), !e) return hn(`publisher NULL: ev ${t}`), 0;
|
|
3091
|
+
if (!r) return hn(`subscriber NULL: ev ${t}`), 0;
|
|
3084
3092
|
const l = /* @__PURE__ */ new Set([
|
|
3085
3093
|
"__config__",
|
|
3086
3094
|
"__global__",
|
|
@@ -3089,80 +3097,80 @@ var gobjJs = function(e) {
|
|
|
3089
3097
|
"__service__"
|
|
3090
3098
|
]);
|
|
3091
3099
|
if (Object.keys(n).forEach((n) => {
|
|
3092
|
-
l.has(n) ||
|
|
3093
|
-
}),
|
|
3094
|
-
else if (!(Ct(e, t,
|
|
3095
|
-
let o =
|
|
3100
|
+
l.has(n) || hn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
3101
|
+
}), ir(t)) t = "";
|
|
3102
|
+
else if (!(Ct(e, t, $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return hn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
3103
|
+
let o = xt(n, t), s = Yt(e.dl_subscriptions, e, t, o.renamed_event, o.kw, r), i = 0, _ = 0, a = 0;
|
|
3096
3104
|
for (let t = 0; t < s.length; t++) {
|
|
3097
|
-
let n = s[t], r =
|
|
3105
|
+
let n = s[t], r = Jt(e, n, !1, !1);
|
|
3098
3106
|
0 === r ? i++ : r < 0 ? _++ : a++;
|
|
3099
3107
|
}
|
|
3100
|
-
return _ ?
|
|
3101
|
-
}, e.gobj_unsubscribe_list =
|
|
3108
|
+
return _ ? yn(`${et(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${_})`) : i || a || (yn(`${et(e)}: No subscription found`), Un(n, "No subscription found")), 0;
|
|
3109
|
+
}, e.gobj_unsubscribe_list = Ht, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = St, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = $t, e.gobj_yuno = qe, e.gobj_yuno_id = Qe, e.gobj_yuno_name = He, e.gobj_yuno_role = ze, e.id_index_in_obj_list = Lr, e.index_in_list = Hr, e.is_array = er, e.is_boolean = rr, e.is_date = function(e) {
|
|
3102
3110
|
return e instanceof Date && !isNaN(e);
|
|
3103
|
-
}, e.is_function =
|
|
3104
|
-
if (!
|
|
3111
|
+
}, e.is_function = or, e.is_gobj = sr, e.is_metadata_key = function(e) {
|
|
3112
|
+
if (!tr(e)) return !1;
|
|
3105
3113
|
let t = 0;
|
|
3106
3114
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3107
3115
|
return 2 === t;
|
|
3108
|
-
}, e.is_null =
|
|
3109
|
-
if (!
|
|
3116
|
+
}, e.is_null = lr, e.is_number = nr, e.is_object = Zn, e.is_private_key = function(e) {
|
|
3117
|
+
if (!tr(e)) return !1;
|
|
3110
3118
|
let t = 0;
|
|
3111
3119
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3112
3120
|
return 1 === t;
|
|
3113
3121
|
}, e.is_pure_number = function(e) {
|
|
3114
|
-
if (
|
|
3115
|
-
if (!
|
|
3122
|
+
if (nr(e)) return !0;
|
|
3123
|
+
if (!tr(e)) return !1;
|
|
3116
3124
|
const t = Number(e);
|
|
3117
3125
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
3118
|
-
}, e.is_secret_name =
|
|
3119
|
-
let l =
|
|
3120
|
-
if (!l) return
|
|
3121
|
-
if (
|
|
3126
|
+
}, e.is_secret_name = wn, e.is_string = tr, e.jdb_delete = function(e, t, n, r) {
|
|
3127
|
+
let l = jr(null, jr(null, e, "topics", null, 0), t, null, 0);
|
|
3128
|
+
if (!l) return hn("jdb_delete: topic not found: " + t), null;
|
|
3129
|
+
if (ir(r.id)) return hn("jdb_delete: record without id: " + r), Tn(r), null;
|
|
3122
3130
|
let o, s = n.split("`"), i = l;
|
|
3123
|
-
for (; (o = s.shift()) && !
|
|
3124
|
-
if (0 === s.length && i) if (
|
|
3125
|
-
let e =
|
|
3131
|
+
for (; (o = s.shift()) && !ir(o) && i;) Zn(i) && (i = jr(null, i, e.hook, null, 0)), i = Kr(i, null, o, !1);
|
|
3132
|
+
if (0 === s.length && i) if (er(i)) {
|
|
3133
|
+
let e = Lr(i, r.id);
|
|
3126
3134
|
e >= 0 && i.splice(e, 1);
|
|
3127
3135
|
} else {
|
|
3128
|
-
let t =
|
|
3136
|
+
let t = jr(null, i, e.hook, null, 0), n = Lr(t, r.id);
|
|
3129
3137
|
n >= 0 && t.splice(n, 1);
|
|
3130
3138
|
}
|
|
3131
3139
|
return l;
|
|
3132
3140
|
}, e.jdb_get = function(e, t, n, r) {
|
|
3133
|
-
let l =
|
|
3134
|
-
return l ? (void 0 === r && (r = !0),
|
|
3141
|
+
let l = jr(null, jr(null, e, "topics", null, 0), t, null, 0);
|
|
3142
|
+
return l ? (void 0 === r && (r = !0), Kr(l, e.hook, n, r)) : (hn("jdb_get: topic not found: " + t), null);
|
|
3135
3143
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
3136
|
-
let r =
|
|
3137
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
3144
|
+
let r = jr(null, jr(null, e, "topics", null, 0), t, null, 0);
|
|
3145
|
+
return r ? n < r.length ? r[n] : {} : (hn("jdb_get_by_idx: topic not found: " + t), null);
|
|
3138
3146
|
}, e.jdb_get_topic = function(e, t) {
|
|
3139
|
-
let n =
|
|
3140
|
-
if (!n) return
|
|
3141
|
-
return
|
|
3147
|
+
let n = jr(null, e, "topics", null, 0);
|
|
3148
|
+
if (!n) return hn("jdb topics section not found"), Tn(e), null;
|
|
3149
|
+
return jr(null, n, t, null, 0) || (hn("jdb topic not found: " + t), Tn(n), null);
|
|
3142
3150
|
}, e.jdb_init = function(e, t, n) {
|
|
3143
|
-
n && (e =
|
|
3144
|
-
let r =
|
|
3151
|
+
n && (e = Fn(e));
|
|
3152
|
+
let r = jr(null, e, "type", [], 1);
|
|
3145
3153
|
Er(null, e, "hook", "data", 1);
|
|
3146
|
-
let l =
|
|
3147
|
-
return
|
|
3148
|
-
"__" !== t.substring(0, 2) &&
|
|
3154
|
+
let l = jr(null, e, "schema", {}, 1), o = jr(null, e, "topics", {}, 1);
|
|
3155
|
+
return xr(l, function(e, t, n, l) {
|
|
3156
|
+
"__" !== t.substring(0, 2) && jr(null, o, l, Fn(r), 1);
|
|
3149
3157
|
}, t), e;
|
|
3150
3158
|
}, e.jdb_update = function(e, t, n, r) {
|
|
3151
|
-
let l =
|
|
3152
|
-
if (!l) return
|
|
3153
|
-
if (
|
|
3159
|
+
let l = jr(null, jr(null, e, "topics", null, 0), t, null, 0);
|
|
3160
|
+
if (!l) return hn("jdb_update: topic not found: " + t), null;
|
|
3161
|
+
if (ir(r.id)) return hn("jdb_update: record without id: " + r), Tn(r), null;
|
|
3154
3162
|
let o, s = n.split("`"), i = l;
|
|
3155
|
-
for (; (o = s.shift()) && !
|
|
3156
|
-
if (0 === s.length && i) if (
|
|
3157
|
-
else if (i.id === r.id)
|
|
3163
|
+
for (; (o = s.shift()) && !ir(o) && i;) Zn(i) && (i = jr(null, i, e.hook, [], 1)), i = Kr(i, null, o, !1);
|
|
3164
|
+
if (0 === s.length && i) if (er(i)) i.push(r);
|
|
3165
|
+
else if (i.id === r.id) Gn(i, r);
|
|
3158
3166
|
else {
|
|
3159
|
-
let t =
|
|
3160
|
-
n ?
|
|
3167
|
+
let t = jr(null, i, e.hook, [], 1), n = Kr(t, e.hook, r.id, !1);
|
|
3168
|
+
n ? Gn(n, r) : t.push(r);
|
|
3161
3169
|
}
|
|
3162
3170
|
return l;
|
|
3163
3171
|
}, e.json2flat = function(e) {
|
|
3164
3172
|
const t = {}, n = (e, r, l) => {
|
|
3165
|
-
if (l >
|
|
3173
|
+
if (l > Xr) throw new Error("json2flat: deeper than 256");
|
|
3166
3174
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
3167
3175
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
3168
3176
|
const o = `[${t}]`;
|
|
@@ -3172,20 +3180,20 @@ var gobjJs = function(e) {
|
|
|
3172
3180
|
const t = Object.keys(e);
|
|
3173
3181
|
if (t.length > 0) {
|
|
3174
3182
|
for (const o of t) {
|
|
3175
|
-
const t =
|
|
3183
|
+
const t = el(o);
|
|
3176
3184
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
3177
3185
|
}
|
|
3178
3186
|
return;
|
|
3179
3187
|
}
|
|
3180
3188
|
}
|
|
3181
|
-
0 !== l &&
|
|
3189
|
+
0 !== l && br(t, r, e);
|
|
3182
3190
|
};
|
|
3183
3191
|
return null == e || n(e, "", 0), t;
|
|
3184
|
-
}, e.json_array_append =
|
|
3192
|
+
}, e.json_array_append = Jn, e.json_array_append_new = qn, e.json_array_extend = function(e, t) {
|
|
3185
3193
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
3186
|
-
}, e.json_array_remove =
|
|
3194
|
+
}, e.json_array_remove = Hn, e.json_array_size = Qn, e.json_deep_copy = Fn, e.json_is_identical = Vn, e.json_mask_secrets = Pn, e.json_object_del = Kn, e.json_object_get = xn, e.json_object_set = Yn, e.json_object_set_new = Bn, e.json_object_size = zn, e.json_object_update = Gn, e.json_object_update_existing = Mn, e.json_object_update_missing = Wn, e.json_size = Xn, e.jwt2json = function(e, t) {
|
|
3187
3195
|
try {
|
|
3188
|
-
let n =
|
|
3196
|
+
let n = Yr(e);
|
|
3189
3197
|
switch (t) {
|
|
3190
3198
|
case "header": return JSON.parse(n.header);
|
|
3191
3199
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -3194,137 +3202,137 @@ var gobjJs = function(e) {
|
|
|
3194
3202
|
} catch (e) {
|
|
3195
3203
|
return null;
|
|
3196
3204
|
}
|
|
3197
|
-
}, e.jwtDecode =
|
|
3198
|
-
if (e && !
|
|
3199
|
-
r || (r =
|
|
3205
|
+
}, e.jwtDecode = Yr, e.kw_clone_by_keys = Rr, e.kw_clone_by_not_keys = $r, e.kw_collect = function(e, t, n, r) {
|
|
3206
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !t) return null;
|
|
3207
|
+
r || (r = Nr);
|
|
3200
3208
|
let l = [];
|
|
3201
|
-
if (
|
|
3209
|
+
if (er(t)) for (let e = 0; e < t.length; e++) {
|
|
3202
3210
|
let o = t[e];
|
|
3203
3211
|
r(o, n) && l.push(o);
|
|
3204
3212
|
}
|
|
3205
3213
|
else {
|
|
3206
|
-
if (!
|
|
3214
|
+
if (!Zn(t)) return hn("kw_select() BAD kw parameter"), null;
|
|
3207
3215
|
r(t, n) && l.push(t);
|
|
3208
3216
|
}
|
|
3209
3217
|
return l;
|
|
3210
|
-
}, e.kw_delete =
|
|
3211
|
-
if (!n || !
|
|
3212
|
-
for (let e = 0; e < t.length; e++) if (
|
|
3213
|
-
return r &&
|
|
3214
|
-
}, e.kw_find_path =
|
|
3215
|
-
e && !
|
|
3216
|
-
let o =
|
|
3217
|
-
const s = l && l &
|
|
3218
|
-
return void 0 === o ? i &&
|
|
3219
|
-
}, e.kw_get_local_storage_value = Dr, e.kw_get_pointer =
|
|
3220
|
-
e && !
|
|
3221
|
-
let o =
|
|
3222
|
-
const s = l && l &
|
|
3218
|
+
}, e.kw_delete = mr, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
3219
|
+
if (!n || !er(t)) return r && hn("item NULL or kw_list is not a list"), -1;
|
|
3220
|
+
for (let e = 0; e < t.length; e++) if (Vn(n, t[e])) return e;
|
|
3221
|
+
return r && hn("item not found in this list"), -1;
|
|
3222
|
+
}, e.kw_find_path = pr, e.kw_flag_t = Zt, e.kw_get_bool = hr, e.kw_get_dict = vr, e.kw_get_dict_value = jr, e.kw_get_int = yr, e.kw_get_list = function(e, t, n, r, l) {
|
|
3223
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
3224
|
+
let o = pr(e, t, n, !1);
|
|
3225
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
3226
|
+
return void 0 === o ? i && er(r) && t ? (Or(e, t, n, r), r) : (s && (hn(`path not found: '${n}'`), Un(t)), r) : er(o) ? (_ && mr(e, t, n), o) : (s && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json list: '${n}'`), Un(t)), r);
|
|
3227
|
+
}, e.kw_get_local_storage_value = Dr, e.kw_get_pointer = Tr, e.kw_get_real = function(e, t, n, r, l) {
|
|
3228
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
3229
|
+
let o = pr(e, t, n, !1);
|
|
3230
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
3223
3231
|
if (void 0 === o) {
|
|
3224
3232
|
if (i && t) {
|
|
3225
3233
|
let l = Number(r);
|
|
3226
|
-
return
|
|
3234
|
+
return Or(e, t, n, l), l;
|
|
3227
3235
|
}
|
|
3228
|
-
return s && (
|
|
3236
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), Number(r);
|
|
3229
3237
|
}
|
|
3230
3238
|
let u;
|
|
3231
|
-
if (
|
|
3239
|
+
if (nr(o)) u = o;
|
|
3232
3240
|
else {
|
|
3233
|
-
if (!a) return
|
|
3234
|
-
if (
|
|
3235
|
-
else if (
|
|
3241
|
+
if (!a) return hn(`${e ? et(e) + ": " : ""}path MUST BE a json real: '${n}'`), Un(t), Number(r);
|
|
3242
|
+
if (rr(o)) u = o ? 1 : 0;
|
|
3243
|
+
else if (tr(o)) u = parseFloat(o), Number.isNaN(u) && (u = 0);
|
|
3236
3244
|
else {
|
|
3237
|
-
if (null !== o) return
|
|
3245
|
+
if (null !== o) return hn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Un(t), 0;
|
|
3238
3246
|
u = 0;
|
|
3239
3247
|
}
|
|
3240
3248
|
}
|
|
3241
|
-
return _ &&
|
|
3242
|
-
}, e.kw_get_str = Er, e.kw_has_key =
|
|
3243
|
-
if (e && !
|
|
3244
|
-
r || (r =
|
|
3249
|
+
return _ && mr(e, t, n), u;
|
|
3250
|
+
}, e.kw_get_str = Er, e.kw_has_key = gr, e.kw_match_simple = Nr, e.kw_pop = fr, e.kw_remove_local_storage_value = Ar, e.kw_select = function(e, t, n, r) {
|
|
3251
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !t) return null;
|
|
3252
|
+
r || (r = Nr);
|
|
3245
3253
|
let l = [];
|
|
3246
|
-
if (
|
|
3254
|
+
if (er(t)) for (let e = 0; e < t.length; e++) {
|
|
3247
3255
|
let o = t[e];
|
|
3248
|
-
r(o, n) && l.push(
|
|
3256
|
+
r(o, n) && l.push(Fn(o));
|
|
3249
3257
|
}
|
|
3250
3258
|
else {
|
|
3251
|
-
if (!
|
|
3252
|
-
r(t, n) && l.push(
|
|
3259
|
+
if (!Zn(t)) return hn("kw_select() BAD kw parameter"), null;
|
|
3260
|
+
r(t, n) && l.push(Fn(t));
|
|
3253
3261
|
}
|
|
3254
3262
|
return l;
|
|
3255
|
-
}, e.kw_set_dict_value =
|
|
3256
|
-
e && !
|
|
3257
|
-
let o =
|
|
3263
|
+
}, e.kw_set_dict_value = Or, e.kw_set_local_storage_value = kr, e.kw_set_subdict_value = Sr, e.kwid_collect = Cr, e.kwid_find_one_record = function(e, t, n, r, l) {
|
|
3264
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
3265
|
+
let o = Cr(e, t, n, r, l);
|
|
3258
3266
|
return o && 0 !== o.length ? o[0] : null;
|
|
3259
3267
|
}, e.kwid_get_ids = function(e, t) {
|
|
3260
|
-
if (e && !
|
|
3268
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !t) return [];
|
|
3261
3269
|
let n = [];
|
|
3262
|
-
if (
|
|
3263
|
-
else if (
|
|
3264
|
-
else
|
|
3265
|
-
if (
|
|
3266
|
-
else if (
|
|
3270
|
+
if (tr(t)) n.push(t);
|
|
3271
|
+
else if (Zn(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
3272
|
+
else er(t) && t.forEach(function(t) {
|
|
3273
|
+
if (tr(t)) ir(t) || n.push(t);
|
|
3274
|
+
else if (Zn(t)) {
|
|
3267
3275
|
let r = Er(e, t, "id", 0, 0);
|
|
3268
3276
|
r && n.push(r);
|
|
3269
3277
|
}
|
|
3270
3278
|
});
|
|
3271
3279
|
return n;
|
|
3272
|
-
}, e.kwid_match_id =
|
|
3273
|
-
e && !
|
|
3280
|
+
}, e.kwid_match_id = Ir, e.kwid_new_dict = function(e, t, n) {
|
|
3281
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
3274
3282
|
let r = {};
|
|
3275
|
-
if (
|
|
3276
|
-
else if (
|
|
3277
|
-
let l = t[n], o = Er(e, l, "id", "",
|
|
3278
|
-
|
|
3283
|
+
if (ir(n) || (t = pr(e, t, n)), Zn(t)) r = t;
|
|
3284
|
+
else if (er(t)) for (let n = 0; n < t.length; n++) {
|
|
3285
|
+
let l = t[n], o = Er(e, l, "id", "", Zt.KW_REQUIRED);
|
|
3286
|
+
ir(o) || br(r, o, l);
|
|
3279
3287
|
}
|
|
3280
|
-
else
|
|
3288
|
+
else hn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
3281
3289
|
return r;
|
|
3282
3290
|
}, e.kwid_new_list = function(e, t, n) {
|
|
3283
|
-
if (e && !
|
|
3284
|
-
if (
|
|
3291
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), ir(n) || (t = pr(e, t, n)), er(t)) return t;
|
|
3292
|
+
if (Zn(t)) {
|
|
3285
3293
|
let n = [];
|
|
3286
3294
|
for (let r of Object.keys(t)) {
|
|
3287
3295
|
let l = t[r];
|
|
3288
|
-
|
|
3296
|
+
Zn(l) ? (l.id = r, n.push(l)) : hn(`${et(e)} kwid_new_list: not a record: '${r}'`);
|
|
3289
3297
|
}
|
|
3290
3298
|
return n;
|
|
3291
3299
|
}
|
|
3292
|
-
return
|
|
3300
|
+
return hn(`${et(e)} kwid_new_list: wrong type for list`), [];
|
|
3293
3301
|
}, e.list2options = function(e, t, n) {
|
|
3294
3302
|
t = t || "id", n = n || "value";
|
|
3295
3303
|
let r = [];
|
|
3296
|
-
if (
|
|
3304
|
+
if (er(e)) for (let l = 0; l < e.length; l++) {
|
|
3297
3305
|
let o = e[l];
|
|
3298
|
-
if (
|
|
3306
|
+
if (tr(o)) r.push({
|
|
3299
3307
|
id: e[l],
|
|
3300
3308
|
value: e[l]
|
|
3301
3309
|
});
|
|
3302
|
-
else if (
|
|
3310
|
+
else if (Zn(o)) {
|
|
3303
3311
|
let e = {};
|
|
3304
|
-
if (
|
|
3305
|
-
if (!
|
|
3306
|
-
if (!(
|
|
3307
|
-
|
|
3312
|
+
if (gr(o, t)) {
|
|
3313
|
+
if (!gr(o, n)) {
|
|
3314
|
+
if (!(Xn(o) > 0)) {
|
|
3315
|
+
hn("list2options(): object without field value: " + n);
|
|
3308
3316
|
continue;
|
|
3309
3317
|
}
|
|
3310
3318
|
n = Object.keys(o)[0];
|
|
3311
3319
|
}
|
|
3312
3320
|
e.id = o[t], e.value = o[n];
|
|
3313
3321
|
} else {
|
|
3314
|
-
if (!(
|
|
3315
|
-
|
|
3322
|
+
if (!(Xn(o) > 0)) {
|
|
3323
|
+
hn("list2options(): object without field id: " + t);
|
|
3316
3324
|
continue;
|
|
3317
3325
|
}
|
|
3318
3326
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
3319
3327
|
}
|
|
3320
3328
|
r.push(e);
|
|
3321
|
-
} else
|
|
3329
|
+
} else hn("list2options(): case1 not implemented");
|
|
3322
3330
|
}
|
|
3323
|
-
else if (
|
|
3331
|
+
else if (Zn(e)) for (let t of Object.keys(e)) r.push({
|
|
3324
3332
|
id: t,
|
|
3325
3333
|
value: t
|
|
3326
3334
|
});
|
|
3327
|
-
else
|
|
3335
|
+
else hn("list2options(): case2 not implemented");
|
|
3328
3336
|
return r;
|
|
3329
3337
|
}, e.load_json_file = function(e, t, n) {
|
|
3330
3338
|
let r = new XMLHttpRequest();
|
|
@@ -3332,18 +3340,18 @@ var gobjJs = function(e) {
|
|
|
3332
3340
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
3333
3341
|
t(JSON.parse(r.responseText));
|
|
3334
3342
|
} catch (e) {
|
|
3335
|
-
n && (
|
|
3343
|
+
n && (hn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
3336
3344
|
}
|
|
3337
3345
|
else n && n(r.status);
|
|
3338
3346
|
var e;
|
|
3339
3347
|
}, r.send();
|
|
3340
|
-
}, e.log_debug = En, e.log_error =
|
|
3341
|
-
let n =
|
|
3342
|
-
|
|
3343
|
-
}, e.log_warning =
|
|
3348
|
+
}, e.log_debug = En, e.log_error = hn, e.log_info = function(e, ...t) {
|
|
3349
|
+
let n = mn(e, ...t), r = qr();
|
|
3350
|
+
rn && cn("info", n) && rn("%c" + r + " INFO: " + String(n), "color:cyan"), gn("info", n, r);
|
|
3351
|
+
}, e.log_warning = yn, e.mask_secrets_inline = kn, e.msg_iev_get_msg_type = Wr, e.msg_iev_get_stack = Gr, e.msg_iev_push_stack = Vr, e.msg_iev_read_key = Ur, e.msg_iev_set_msg_type = Mr, e.msg_iev_write_key = Fr, e.node_uuid = zr, e.parseBoolean = _r, e.parseSVG = function(e) {
|
|
3344
3352
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3345
3353
|
}, e.refresh_language = function(e, t) {
|
|
3346
|
-
if (!
|
|
3354
|
+
if (!or(t)) return void hn("You must supply a translation function");
|
|
3347
3355
|
e || (e = document);
|
|
3348
3356
|
const n = (t) => {
|
|
3349
3357
|
let n = [];
|
|
@@ -3367,22 +3375,22 @@ var gobjJs = function(e) {
|
|
|
3367
3375
|
});
|
|
3368
3376
|
}, e.register_c_ievent_cli = function() {
|
|
3369
3377
|
return function(e) {
|
|
3370
|
-
if (Dl) return
|
|
3378
|
+
if (Dl) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3371
3379
|
const t = [
|
|
3372
3380
|
["ST_DISCONNECTED", [
|
|
3373
3381
|
[
|
|
3374
3382
|
"EV_ON_OPEN",
|
|
3375
|
-
|
|
3383
|
+
Gl,
|
|
3376
3384
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3377
3385
|
],
|
|
3378
3386
|
[
|
|
3379
3387
|
"EV_ON_CLOSE",
|
|
3380
|
-
|
|
3388
|
+
Ml,
|
|
3381
3389
|
null
|
|
3382
3390
|
],
|
|
3383
3391
|
[
|
|
3384
3392
|
"EV_TIMEOUT",
|
|
3385
|
-
|
|
3393
|
+
Vl,
|
|
3386
3394
|
null
|
|
3387
3395
|
],
|
|
3388
3396
|
[
|
|
@@ -3394,22 +3402,22 @@ var gobjJs = function(e) {
|
|
|
3394
3402
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3395
3403
|
[
|
|
3396
3404
|
"EV_ON_MESSAGE",
|
|
3397
|
-
|
|
3405
|
+
Kl,
|
|
3398
3406
|
null
|
|
3399
3407
|
],
|
|
3400
3408
|
[
|
|
3401
3409
|
"EV_IDENTITY_CARD_ACK",
|
|
3402
|
-
|
|
3410
|
+
xl,
|
|
3403
3411
|
null
|
|
3404
3412
|
],
|
|
3405
3413
|
[
|
|
3406
3414
|
"EV_ON_CLOSE",
|
|
3407
|
-
|
|
3415
|
+
Ml,
|
|
3408
3416
|
"ST_DISCONNECTED"
|
|
3409
3417
|
],
|
|
3410
3418
|
[
|
|
3411
3419
|
"EV_TIMEOUT",
|
|
3412
|
-
|
|
3420
|
+
Wl,
|
|
3413
3421
|
null
|
|
3414
3422
|
],
|
|
3415
3423
|
[
|
|
@@ -3421,22 +3429,22 @@ var gobjJs = function(e) {
|
|
|
3421
3429
|
["ST_SESSION", [
|
|
3422
3430
|
[
|
|
3423
3431
|
"EV_ON_MESSAGE",
|
|
3424
|
-
|
|
3432
|
+
Kl,
|
|
3425
3433
|
null
|
|
3426
3434
|
],
|
|
3427
3435
|
[
|
|
3428
3436
|
"EV_MT_STATS",
|
|
3429
|
-
|
|
3437
|
+
Yl,
|
|
3430
3438
|
null
|
|
3431
3439
|
],
|
|
3432
3440
|
[
|
|
3433
3441
|
"EV_MT_COMMAND",
|
|
3434
|
-
|
|
3442
|
+
Bl,
|
|
3435
3443
|
null
|
|
3436
3444
|
],
|
|
3437
3445
|
[
|
|
3438
3446
|
"EV_ON_CLOSE",
|
|
3439
|
-
|
|
3447
|
+
Ml,
|
|
3440
3448
|
"ST_DISCONNECTED"
|
|
3441
3449
|
],
|
|
3442
3450
|
[
|
|
@@ -3448,75 +3456,75 @@ var gobjJs = function(e) {
|
|
|
3448
3456
|
[null, null]
|
|
3449
3457
|
];
|
|
3450
3458
|
return (Dl = de(e, [
|
|
3451
|
-
["EV_ON_MESSAGE",
|
|
3452
|
-
["EV_IDENTITY_CARD_ACK",
|
|
3453
|
-
["EV_ON_ID_NAK",
|
|
3454
|
-
["EV_MT_STATS",
|
|
3455
|
-
["EV_MT_COMMAND",
|
|
3456
|
-
["EV_ON_OPEN",
|
|
3457
|
-
["EV_ON_CLOSE",
|
|
3458
|
-
["EV_ON_OPEN_ERROR",
|
|
3459
|
+
["EV_ON_MESSAGE", $.EVF_OUTPUT_EVENT],
|
|
3460
|
+
["EV_IDENTITY_CARD_ACK", $.EVF_PUBLIC_EVENT],
|
|
3461
|
+
["EV_ON_ID_NAK", $.EVF_PUBLIC_EVENT | $.EVF_OUTPUT_EVENT],
|
|
3462
|
+
["EV_MT_STATS", $.EVF_PUBLIC_EVENT],
|
|
3463
|
+
["EV_MT_COMMAND", $.EVF_PUBLIC_EVENT],
|
|
3464
|
+
["EV_ON_OPEN", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3465
|
+
["EV_ON_CLOSE", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3466
|
+
["EV_ON_OPEN_ERROR", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3459
3467
|
["EV_TIMEOUT", 0],
|
|
3460
3468
|
[null, 0]
|
|
3461
|
-
], t,
|
|
3469
|
+
], t, Jl, 0, wl, $l, 0, 0, Nl, w.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3462
3470
|
}("C_IEVENT_CLI");
|
|
3463
3471
|
}, e.register_c_timer = function() {
|
|
3464
3472
|
return function(e) {
|
|
3465
|
-
if (
|
|
3473
|
+
if (cl) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3466
3474
|
const t = [["ST_IDLE", [[
|
|
3467
3475
|
"EV_TIMEOUT",
|
|
3468
|
-
|
|
3476
|
+
fl,
|
|
3469
3477
|
null
|
|
3470
3478
|
]]]];
|
|
3471
|
-
return (
|
|
3472
|
-
["EV_TIMEOUT",
|
|
3473
|
-
["EV_TIMEOUT_PERIODIC",
|
|
3479
|
+
return (cl = de(e, [
|
|
3480
|
+
["EV_TIMEOUT", $.EVF_OUTPUT_EVENT],
|
|
3481
|
+
["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT],
|
|
3474
3482
|
[0, 0]
|
|
3475
|
-
], t,
|
|
3483
|
+
], t, gl, 0, al, ul, 0, 0, 0, w.gcflag_manual_start)) ? 0 : -1;
|
|
3476
3484
|
}("C_TIMER");
|
|
3477
3485
|
}, e.register_c_yuno = function() {
|
|
3478
3486
|
return function(e) {
|
|
3479
|
-
if (
|
|
3487
|
+
if (yl) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3480
3488
|
const t = [["ST_IDLE", [[
|
|
3481
3489
|
"EV_TIMEOUT_PERIODIC",
|
|
3482
|
-
|
|
3490
|
+
jl,
|
|
3483
3491
|
null
|
|
3484
3492
|
]]]];
|
|
3485
|
-
return (
|
|
3493
|
+
return (yl = de(e, [["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS], [0, 0]], t, Ol, 0, ml, hl, 0, 0, 0, 0)) ? 0 : -1;
|
|
3486
3494
|
}("C_YUNO");
|
|
3487
3495
|
}, e.safeSrc = function(e) {
|
|
3488
3496
|
if (!e) return "";
|
|
3489
3497
|
const t = String(e).trim();
|
|
3490
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3491
|
-
}, e.sdata_flag_t =
|
|
3498
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Br(t);
|
|
3499
|
+
}, e.sdata_flag_t = E, e.send_http_json_post = function(e, t, n) {
|
|
3492
3500
|
let r = new XMLHttpRequest();
|
|
3493
3501
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
3494
3502
|
4 === r.readyState && n(r.status, r.responseText);
|
|
3495
3503
|
}, r.send(t);
|
|
3496
3504
|
}, e.set_console_log_enabled = function(e) {
|
|
3497
|
-
|
|
3505
|
+
an = !!e;
|
|
3498
3506
|
}, e.set_console_log_filter = function(e) {
|
|
3499
|
-
|
|
3507
|
+
un = "function" == typeof e ? e : null;
|
|
3500
3508
|
}, e.set_log_callback = function(e) {
|
|
3501
|
-
if ((e = "function" == typeof e ? e : null) && e !==
|
|
3502
|
-
|
|
3503
|
-
for (const [e, t, n] of
|
|
3509
|
+
if ((e = "function" == typeof e ? e : null) && e !== on) {
|
|
3510
|
+
on = e;
|
|
3511
|
+
for (const [e, t, n] of _n.slice()) {
|
|
3504
3512
|
let r = t;
|
|
3505
3513
|
if ("json" === e) try {
|
|
3506
3514
|
r = JSON.parse(t);
|
|
3507
3515
|
} catch (e) {
|
|
3508
3516
|
r = t;
|
|
3509
3517
|
}
|
|
3510
|
-
|
|
3518
|
+
dn(e, r, n);
|
|
3511
3519
|
}
|
|
3512
|
-
} else
|
|
3513
|
-
}, e.set_remote_log_functions =
|
|
3520
|
+
} else on = e;
|
|
3521
|
+
}, e.set_remote_log_functions = bn, e.set_timeout = dl, e.set_timeout_periodic = bl, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = Pr, e.strcasecmp = ur, e.strcmp = ar, e.strncmp = function(e, t, n) {
|
|
3514
3522
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3515
3523
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3516
3524
|
}, e.strs_in_list = function(e, t, n) {
|
|
3517
|
-
if (!e) return
|
|
3518
|
-
if (!t) return
|
|
3519
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3525
|
+
if (!e) return hn("ERROR: strs_in_list() list empty"), !1;
|
|
3526
|
+
if (!t) return hn("ERROR: strs_in_list() str empty"), !1;
|
|
3527
|
+
for (let r = 0; r < t.length; r++) if (Pr(e, t[r], n)) return !0;
|
|
3520
3528
|
return !1;
|
|
3521
3529
|
}, e.strstr = function(e, t, n) {
|
|
3522
3530
|
var r;
|
|
@@ -3535,13 +3543,13 @@ var gobjJs = function(e) {
|
|
|
3535
3543
|
placeholder: void 0,
|
|
3536
3544
|
fkey: null
|
|
3537
3545
|
};
|
|
3538
|
-
if (
|
|
3546
|
+
if (tr(t)) {
|
|
3539
3547
|
let e = t.split(".");
|
|
3540
3548
|
for (let t = 0; t < e.length; t++) {
|
|
3541
3549
|
let r = e[t];
|
|
3542
|
-
if (
|
|
3543
|
-
else if (
|
|
3544
|
-
else if (
|
|
3550
|
+
if (Pr(ol, r)) n.real_type || (n.real_type = r);
|
|
3551
|
+
else if (Pr(il, r)) n.type || (n.type = r);
|
|
3552
|
+
else if (Pr(sl, r)) switch (r) {
|
|
3545
3553
|
case "writable":
|
|
3546
3554
|
n.is_writable = !0;
|
|
3547
3555
|
break;
|
|
@@ -3553,23 +3561,23 @@ var gobjJs = function(e) {
|
|
|
3553
3561
|
}
|
|
3554
3562
|
}
|
|
3555
3563
|
n.real_type || (n.real_type = "string");
|
|
3556
|
-
} else
|
|
3564
|
+
} else Zn(t) ? (n = _l(t), n.name || (n.name = e), n.header || (n.header = e)) : er(t) && (n.real_type = "array", n.enum_list = t);
|
|
3557
3565
|
return n.type || (n.type = n.real_type), n;
|
|
3558
3566
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3559
3567
|
const n = e, r = performance.now();
|
|
3560
3568
|
let l = r;
|
|
3561
|
-
return t &&
|
|
3569
|
+
return t && yn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
3562
3570
|
const s = performance.now(), i = (s - l) / 1e3, _ = (s - r) / 1e3;
|
|
3563
|
-
return t &&
|
|
3571
|
+
return t && yn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${o}`), l = s, {
|
|
3564
3572
|
partial: i,
|
|
3565
3573
|
total: _
|
|
3566
3574
|
};
|
|
3567
3575
|
} };
|
|
3568
|
-
}, e.trace_json =
|
|
3569
|
-
if (
|
|
3576
|
+
}, e.trace_json = vn, e.trace_json_masked = Un, e.trace_level_t = P, e.trace_msg = Tn, e.treedb_decoder_fkey = ll, e.treedb_decoder_hook = function(e, t) {
|
|
3577
|
+
if (tr(t)) {
|
|
3570
3578
|
if (-1 === t.indexOf("^")) {
|
|
3571
3579
|
let n, r = e.hook;
|
|
3572
|
-
if (1 !==
|
|
3580
|
+
if (1 !== zn(r)) return hn("bad hook 1"), hn(e), hn(t), null;
|
|
3573
3581
|
for (let e of Object.keys(r)) {
|
|
3574
3582
|
n = e, r[e];
|
|
3575
3583
|
break;
|
|
@@ -3581,28 +3589,28 @@ var gobjJs = function(e) {
|
|
|
3581
3589
|
}
|
|
3582
3590
|
{
|
|
3583
3591
|
let n = t.split("^");
|
|
3584
|
-
return 2 !== n.length ? (
|
|
3592
|
+
return 2 !== n.length ? (hn("bad hook 2"), hn(e), hn(t), null) : {
|
|
3585
3593
|
topic_name: n[0],
|
|
3586
3594
|
id: n[1]
|
|
3587
3595
|
};
|
|
3588
3596
|
}
|
|
3589
3597
|
}
|
|
3590
|
-
return
|
|
3598
|
+
return Zn(t) ? {
|
|
3591
3599
|
topic_name: t.topic_name,
|
|
3592
3600
|
id: t.id
|
|
3593
|
-
} : (
|
|
3601
|
+
} : (hn("bad hook 3"), hn(e), hn(t), null);
|
|
3594
3602
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3595
|
-
let n =
|
|
3603
|
+
let n = ll(e, t);
|
|
3596
3604
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3597
|
-
}, e.treedb_get_field_desc =
|
|
3598
|
-
if (
|
|
3605
|
+
}, e.treedb_get_field_desc = _l, e.treedb_hook_data_size = function(e) {
|
|
3606
|
+
if (er(e) && 1 === Xn(e)) {
|
|
3599
3607
|
let t = e[0];
|
|
3600
|
-
return
|
|
3608
|
+
return gr(t, "size") ? t.size : 1;
|
|
3601
3609
|
}
|
|
3602
|
-
return
|
|
3610
|
+
return Xn(e);
|
|
3603
3611
|
}, e.vsprintf = function(e, t) {
|
|
3604
3612
|
return n.apply(null, [e].concat(t || []));
|
|
3605
|
-
}, e.walk_type_t =
|
|
3613
|
+
}, e.walk_type_t = D, e;
|
|
3606
3614
|
}({});
|
|
3607
3615
|
|
|
3608
3616
|
//# sourceMappingURL=gobj-js.iife.min.js.map
|