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