@yuneta/gobj-js 7.26.17 → 7.26.18
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 +6 -1
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +877 -871
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +6 -1
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +915 -909
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +6 -1
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +877 -871
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +6 -1
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +877 -871
- 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 = Gn(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
|
+
nr(e) && (e = JSON.stringify(e)), jn(" ".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 (ur(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) || (Tn(`${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 = or(e) ? je(e) : e;
|
|
393
|
+
return t ? V(t.trace_level | P, t.s_user_trace_level) : (Tn(`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 = or(e) ? je(e) : e;
|
|
397
|
+
return t ? V(t.trace_level, t.s_user_trace_level) : (Tn(`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 = or(e) ? je(e) : e;
|
|
401
|
+
return t ? V(t.no_trace_level, t.s_user_trace_level) : (Tn(`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 = or(e) ? je(e) : e;
|
|
405
|
+
if (!r) return Tn(`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 = or(e) ? je(e) : e;
|
|
411
|
+
if (!r) return Tn(`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 (!rr(t)) return Tn("sdata_desc MUST be an array"), Sn(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 = cr(o);
|
|
432
432
|
break;
|
|
433
433
|
case h.DTP_INTEGER:
|
|
434
|
-
r = parseInt(o), isNaN(r) &&
|
|
434
|
+
r = parseInt(o), isNaN(r) && Tn(`${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) && Tn(`${Ze(e)}: attr NaN: ${n.name}`);
|
|
438
438
|
break;
|
|
439
439
|
case h.DTP_LIST:
|
|
440
|
-
if (
|
|
440
|
+
if (or(o)) try {
|
|
441
441
|
r = JSON.parse(o);
|
|
442
442
|
} catch (e) {
|
|
443
|
-
|
|
443
|
+
Tn(`JSON parse error: ${e.message}`);
|
|
444
444
|
}
|
|
445
445
|
else r = o;
|
|
446
|
-
|
|
446
|
+
rr(r) || (r = []);
|
|
447
447
|
break;
|
|
448
448
|
case h.DTP_DICT:
|
|
449
|
-
if (
|
|
449
|
+
if (or(o)) try {
|
|
450
450
|
r = JSON.parse(o);
|
|
451
451
|
} catch (e) {
|
|
452
|
-
|
|
452
|
+
Tn(`JSON parse error: ${e.message}`);
|
|
453
453
|
}
|
|
454
454
|
else r = o;
|
|
455
|
-
|
|
455
|
+
nr(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 (or(o)) try {
|
|
460
460
|
r = JSON.parse(o);
|
|
461
461
|
} catch (e) {
|
|
462
|
-
|
|
462
|
+
Tn(`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 && (Tn(`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 (or(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 = cr(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 Tn(`${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 Tn(`${Ze(e)}: attr NaN: ${n.name}`), -1;
|
|
489
489
|
break;
|
|
490
490
|
case h.DTP_LIST:
|
|
491
|
-
if (
|
|
491
|
+
if (or(r)) try {
|
|
492
492
|
o = JSON.parse(r);
|
|
493
493
|
} catch (e) {
|
|
494
|
-
|
|
494
|
+
Tn(`JSON parse error: ${e.message}`);
|
|
495
495
|
}
|
|
496
496
|
else o = r;
|
|
497
|
-
if (!
|
|
497
|
+
if (!rr(o)) return Tn(`attr must be an array: ${n.name}`), -1;
|
|
498
498
|
break;
|
|
499
499
|
case h.DTP_DICT:
|
|
500
|
-
if (
|
|
500
|
+
if (or(r)) try {
|
|
501
501
|
o = JSON.parse(r);
|
|
502
502
|
} catch (e) {
|
|
503
|
-
|
|
503
|
+
Tn(`JSON parse error: ${e.message}`);
|
|
504
504
|
}
|
|
505
505
|
else o = r;
|
|
506
|
-
if (!
|
|
506
|
+
if (!nr(o)) return Tn(`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, or(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 && Tn(`${Ze(e)}: attr undefined: ${n.name}`), t[n.name] = o, nr(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 && Tn(`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 && Tn("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 && Tn(`${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 (ur(e)) return Tn("gclass_name EMPTY"), null;
|
|
539
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return Tn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
540
|
+
if (je(e)) return Tn(`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] ? Tn(`gclass ALREADY REGISTERED: ${t}`) : g[t] = e : Tn("gclass_name undefined") : Tn("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 (ur(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
|
+
ur(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 (!ur(n)) {
|
|
559
|
+
if (Te(c, n)) return Tn(`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 (or(e)) t = e;
|
|
572
572
|
else {
|
|
573
|
-
if (!(e instanceof j)) return
|
|
573
|
+
if (!(e instanceof j)) return Tn("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 ? (Tn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete g[t], 0) : (Tn(`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) ? (Tn(`state already exists: ${t}`), -1) : (e.dl_states.push(new D(t)), 0) : (Tn("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 Tn("Cannot add state, typeof not GClass"), -1;
|
|
600
|
+
if (ur(t)) return Tn("state_name EMPTY"), -1;
|
|
601
601
|
let s = de(e, t);
|
|
602
|
-
return s ? be(s, n) ? (
|
|
602
|
+
return s ? be(s, n) ? (Tn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (s.dl_actions.push(new x(n, r, o)), 0) : (Tn(`state not found: ${t}`), -1);
|
|
603
603
|
}
|
|
604
604
|
function ye(e, t, n) {
|
|
605
|
-
|
|
605
|
+
ur(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) : (Tn("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 Tn("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 Tn("Cannot add state, typeof not GClass"), -1;
|
|
621
621
|
let t = 0;
|
|
622
|
-
|
|
622
|
+
er(e.dl_states) || (Tn(`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 (!ur(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
626
626
|
let o = r.dl_actions[n];
|
|
627
|
-
|
|
627
|
+
ur(o.event_name) || (Te(e, o.event_name) || (Tn(`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) || (Tn(`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 (!ur(r.event_name) && (sr(r.event_flag) || (Tn(`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
|
+
ur(o.state_name) || be(o, r.event_name) && (n = !0);
|
|
637
637
|
}
|
|
638
|
-
n || (
|
|
638
|
+
n || (Tn(`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 && Tn(`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 (!or(e)) return Tn(`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 && Tn(`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] && Tn(`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 && Tn(`_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 = oo(e.dl_children, t);
|
|
667
|
+
n >= 0 && (Xn(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 : (Tn(`${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 && Tn(`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 Tn("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 && vn(`${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 && (Tn(`${Ze(e)} json2data() FAILED`), Vn(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 Tn("__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 Tn("gobj NEEDS a parent!"), null;
|
|
693
|
+
if (!("string" == typeof o || o instanceof O)) return Tn(`BAD TYPE of parent: ${o}`), null;
|
|
694
|
+
if (or(o)) {
|
|
695
695
|
const e = o;
|
|
696
|
-
if (!(o = Se(e))) return
|
|
696
|
+
if (!(o = Se(e))) return vn(`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 Tn(`service ALREADY registered: ${n}^${e}`), null;
|
|
700
700
|
if (s & w.gobj_flag_default_service) {
|
|
701
|
-
if (b) return
|
|
701
|
+
if (b) return Tn(`default service ALREADY registered: ${n}^${e}`), null;
|
|
702
702
|
s |= w.gobj_flag_service;
|
|
703
703
|
}
|
|
704
|
-
if (
|
|
704
|
+
if (ur(n)) return Tn("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 Tn(`GClass not registered: ${n}^${e}`), null;
|
|
707
|
+
if (!or(e)) return Tn(`gobj_name must be a string: ${n}`), null;
|
|
708
|
+
if (!ur(e)) {
|
|
709
|
+
if (e.includes("`")) return Tn(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
710
|
+
if (e.includes("^")) return Tn(`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 Tn("gobj NULL or DESTROYED");
|
|
723
|
+
e.__refs__ > 0 && Tn(`${Ze(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Tn(`Destroying a PLAYING gobj: ${et(e)}`), Me(e)), e.running && (Tn(`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] : Tn(`"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 Tn("gobj NULL or DESTROYED"), -1;
|
|
744
|
+
if (e.running) return Tn(`${Ze(e)}: GObj ALREADY RUNNING`), -1;
|
|
745
|
+
if (e.disabled) return Tn(`${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 Tn("gobj NULL or DESTROYED"), -1;
|
|
758
|
+
if (!e.running) return Tn(`${Ze(e)}: GObj NOT RUNNING`), -1;
|
|
759
|
+
e.playing && (vn(`${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) ? (Tn("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 Tn(`gobj NULL or DESTROYED: ${Ze(e)}`), -1;
|
|
771
|
+
if (e.playing) return Tn(`${Ze(e)}: GObj ALREADY PLAYING`), -1;
|
|
772
|
+
if (e.disabled) return Tn(`${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 Tn(`${Ze(e)}: Cannot play, start not done`), -1;
|
|
775
|
+
vn(`${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) ? (Tn("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) : (Tn(`${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 ar(e) ? e.gobj_name : (Tn("gobj bad type"), null);
|
|
813
813
|
}
|
|
814
814
|
function Xe(e) {
|
|
815
|
-
return
|
|
815
|
+
return ar(e) ? e.gclass.gclass_name : (Tn("gobj NULL of bad type"), null);
|
|
816
816
|
}
|
|
817
817
|
function Ze(e) {
|
|
818
|
-
return
|
|
818
|
+
return ar(e) ? e.gclass.gclass_name + "^" + Qe(e) : (Tn("gobj bad type"), null);
|
|
819
819
|
}
|
|
820
820
|
function et(e) {
|
|
821
|
-
if (!
|
|
821
|
+
if (!ar(e)) return Tn("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 ar(e) ? e.parent : (Tn("gobj NULL of bad type"), null);
|
|
828
828
|
}
|
|
829
829
|
function nt(e) {
|
|
830
|
-
return
|
|
830
|
+
return ar(e) ? !!(e.gobj_flag & w.gobj_flag_volatil) : (Tn("gobj NULL of bad type"), null);
|
|
831
831
|
}
|
|
832
832
|
function rt(e) {
|
|
833
|
-
return
|
|
833
|
+
return ar(e) ? !!(e.gobj_flag & w.gobj_flag_pure_child) : (Tn("gobj NULL of bad type"), null);
|
|
834
834
|
}
|
|
835
835
|
function ot(e) {
|
|
836
|
-
return !
|
|
836
|
+
return !ar(e) || !!(e.obflag & (N.obflag_destroyed | N.obflag_destroying));
|
|
837
837
|
}
|
|
838
838
|
function st(e) {
|
|
839
|
-
return
|
|
839
|
+
return ar(e) ? e.bottom_gobj : (Tn("gobj NULL of bad type"), null);
|
|
840
840
|
}
|
|
841
841
|
function lt(e, t) {
|
|
842
|
-
if (!
|
|
843
|
-
e.bottom_gobj && t &&
|
|
842
|
+
if (!ar(e)) return Tn("gobj NULL of bad type"), null;
|
|
843
|
+
e.bottom_gobj && t && vn(`${Ze(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
844
844
|
}
|
|
845
845
|
function it(e, t, n) {
|
|
846
|
-
return
|
|
846
|
+
return ar(e) ? t ? fe(e.gclass, t, n) : e.gclass.attrs_table : (Tn("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) ? (Tn("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) ? (Tn("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 || Tn(`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 (!ar(e)) return Tn("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 Tn("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 !ur(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 Tn(`${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 = Bn(e.jn_attrs, s.name) : (t = e.gclass.gmt.mt_reading(e, s.name), void 0 === t && (t = Bn(e.jn_attrs, s.name))), qn(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 === gr(t, "__disabled__")) return Ke(e);
|
|
961
|
+
if (0 === gr(t, "__running__")) return We(e);
|
|
962
|
+
if (0 === gr(t, "__playing__")) return Be(e);
|
|
963
|
+
if (0 === gr(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 ? Bn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Tn(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
967
967
|
}
|
|
968
968
|
function Tt(e, t) {
|
|
969
|
-
t &&
|
|
969
|
+
t && gr(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 ? Bn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Tn(`${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 === gr(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 ? Bn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Tn(`${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 ? Bn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Tn(`${Ze(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
981
981
|
}
|
|
982
982
|
function Ot(e, n, r, o) {
|
|
983
|
-
if (!
|
|
983
|
+
if (!or(n)) return Tn(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, nr(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) : (Tn(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, nr(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 Tn(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] = cr(n), nr(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) : (Tn(`${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), nr(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) : (Tn(`${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), nr(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) : (Tn(`${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 Tn("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 Tn(`${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 ar(e) ? e.current_state.state_name : (Tn("hgobj NULL"), "");
|
|
1036
1036
|
}
|
|
1037
1037
|
function Dt(e, t, n) {
|
|
1038
|
-
if (!
|
|
1038
|
+
if (!ar(e)) return Tn("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) ? (Tn(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : ur(n) ? (Tn("gobj_post_event(): event EMPTY"), -1) : kt(e, n, 0) ? It.length >= 1e4 ? (Tn(`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) : (Tn(`gobj_post_event(): event NOT DEFINED in gclass ${Xe(e)}, event ${n}`), -1) : (Tn(`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 Tn("gobj dst NULL"), -1;
|
|
1087
|
+
if (e.obflag & (N.obflag_destroyed | N.obflag_destroying)) return Tn("gobj dst DESTROYED"), -1;
|
|
1088
1088
|
let s = e.current_state;
|
|
1089
|
-
if (!s) return
|
|
1089
|
+
if (!s) return Tn(`${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) && Zn(r) && Vn(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))), Tn(`📛📛 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 = lo(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) && Zn(r) && Vn(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
|
+
Tn(`${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 || "", sr(_) ? _ : 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 (!nr(n) || !br(n, "__hard_subscription__") && !br(n, "__own_event__") && !br(n, "__rename_event_name__")) return {
|
|
1149
1149
|
kw: e,
|
|
1150
1150
|
renamed_event: ""
|
|
1151
1151
|
};
|
|
1152
|
-
let r =
|
|
1152
|
+
let r = Wn({}, e), o = Wn({}, 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 || ur(l) ? null : Vt(l);
|
|
1155
|
+
return i && (s = i.event_name, delete o.__rename_event_name__, t && tr(r.__global__) > 0 && (r.__global__ = Wn(Wn({}, 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 = wr(t, o, "__config__", null), i = wr(t, o, "__global__", null), _ = wr(t, o, "__local__", null), a = Nr(t, o, "__filter__", null), u = !0;
|
|
1162
|
+
if (t && t !== Sr(null, e, "publisher", null) && (u = !1), s && s !== Sr(null, e, "subscriber", null) && (u = !1), n && n !== Or(null, e, "event", "") && (u = !1), r && r !== Or(null, e, "renamed_event", "") && (u = !1), tr(l) > 0) {
|
|
1163
|
+
let t = wr(null, e, "__config__", null);
|
|
1164
|
+
tr(t) > 0 && Mn(t, l) || (u = !1);
|
|
1165
1165
|
}
|
|
1166
|
-
if (
|
|
1167
|
-
let t =
|
|
1168
|
-
|
|
1166
|
+
if (tr(i) > 0) {
|
|
1167
|
+
let t = wr(null, e, "__global__", null);
|
|
1168
|
+
tr(t) > 0 && Mn(t, i) || (u = !1);
|
|
1169
1169
|
}
|
|
1170
|
-
if (
|
|
1171
|
-
let t =
|
|
1172
|
-
|
|
1170
|
+
if (tr(_) > 0) {
|
|
1171
|
+
let t = wr(null, e, "__local__", null);
|
|
1172
|
+
tr(t) > 0 && Mn(t, _) || (u = !1);
|
|
1173
1173
|
}
|
|
1174
|
-
if (
|
|
1175
|
-
let t =
|
|
1176
|
-
|
|
1174
|
+
if (tr(a) > 0) {
|
|
1175
|
+
let t = Nr(null, e, "__filter__", null);
|
|
1176
|
+
tr(t) > 0 && Mn(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) && zn(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 = Sr(e, n, "publisher", null, Xt.KW_REQUIRED), l = Sr(e, n, "subscriber", null, Xt.KW_REQUIRED), i = Or(e, n, "event", "", Xt.KW_REQUIRED);
|
|
1193
|
+
if (!!(jr(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))), Sn(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 ? Xn(s.dl_subscriptions, a) : (Tn(`${Ze(e)}: subscription in publisher not found`), Sn(n)), a = Yt(l.dl_subscribings, n), a >= 0 ? Xn(l.dl_subscribings, a) : (Tn(`${Ze(e)}: subscription in subscriber not found`), Sn(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 Tn(`publisher NULL: ev ${n}`), 0;
|
|
1202
|
+
if (!o) return Tn(`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) || Tn(`${Ze(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1212
|
+
}), ur(n)) n = "";
|
|
1213
|
+
else if (!(At(e, n, $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & S.gcflag_no_check_output_events)) return Tn(`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 (jr(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 vn(`${Ze(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${n}, subscriber: ${Ze(o)})`), _;
|
|
1220
|
+
er(i) > 0 && (Tn(`${Ze(e)}: ${er(i)} subscription(s) REPEATED, will be deleted and override`), Sn(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
|
+
Hn(o, "event", t), Hn(o, "subscriber", r), Hn(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 = wr(e, n, "__config__", null), l = wr(e, n, "__global__", null), i = wr(e, n, "__local__", null), _ = Nr(e, n, "__filter__", null), a = Or(e, n, "__service__", "");
|
|
1227
|
+
if (tr(l) > 0 && Hn(o, "__global__", Gn(l)), tr(r) > 0) {
|
|
1228
|
+
let n = Gn(r);
|
|
1229
|
+
Hn(o, "__config__", n);
|
|
1230
|
+
let l = Or(e, n, "__rename_event_name__", "");
|
|
1231
|
+
if (!ur(l)) {
|
|
1232
1232
|
let r = Vt(l);
|
|
1233
1233
|
if (r) {
|
|
1234
|
-
|
|
1235
|
-
let l =
|
|
1236
|
-
|
|
1237
|
-
} else
|
|
1234
|
+
Hn(o, "renamed_event", r.event_name), delete n.__rename_event_name__, s |= Ft.__rename_event_name__;
|
|
1235
|
+
let l = wr(e, o, "__global__", null);
|
|
1236
|
+
nr(l) || (l = {}, Hn(o, "__global__", l)), l.__original_event_name__ = t;
|
|
1237
|
+
} else Tn(`${Ze(e)}: EVENT NOT FOUND (__rename_event_name__: ${l})`);
|
|
1238
1238
|
}
|
|
1239
|
-
if (
|
|
1240
|
-
let t =
|
|
1241
|
-
|
|
1239
|
+
if (br(n, "__hard_subscription__")) {
|
|
1240
|
+
let t = vr(e, n, "__hard_subscription__", !1);
|
|
1241
|
+
Jn(n, "__hard_subscription__"), t && (s |= Ft.__hard_subscription__);
|
|
1242
1242
|
}
|
|
1243
|
-
if (
|
|
1244
|
-
let t =
|
|
1245
|
-
|
|
1243
|
+
if (br(n, "__own_event__")) {
|
|
1244
|
+
let t = vr(e, n, "__own_event__", !1);
|
|
1245
|
+
Jn(n, "__own_event__"), t && (s |= Ft.__own_event__);
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
-
|
|
1248
|
+
tr(i) > 0 && Hn(o, "__local__", Gn(i)), tr(_) > 0 && Hn(o, "__filter__", Gn(_)), ur(a) || Hn(o, "__service__", a);
|
|
1249
1249
|
}
|
|
1250
|
-
return
|
|
1250
|
+
return Hn(o, "subs_flag", s), o;
|
|
1251
1251
|
}(e, n, r, o);
|
|
1252
|
-
if (!a) return
|
|
1253
|
-
if (
|
|
1252
|
+
if (!a) return Tn(`${Ze(e)}: _create_subscription() FAILED`), 0;
|
|
1253
|
+
if (zn(e.dl_subscriptions, a), zn(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)) && Vn(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 && vn(`${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 (nr(r) || (r = {}), !e || e.obflag & (N.obflag_destroyed | N.obflag_destroying)) return Tn("gobj NULL or DESTROYED"), -1;
|
|
1272
|
+
if (ur(n)) return Tn(`${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 Tn(`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) && Zn(r) && Vn(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 = Sr(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 = jr(e, a, "subs_flag", 0, Xt.KW_REQUIRED), f = Or(e, a, "event", "", Xt.KW_REQUIRED);
|
|
1291
|
+
if (ur(f) || 0 === gr(f, n)) {
|
|
1292
|
+
wr(e, a, "__config__", null, 0);
|
|
1293
|
+
let o = wr(e, a, "__global__", null, 0), l = wr(e, a, "__local__", null, 0), f = Nr(e, a, "__filter__", null, 0), g = a.renamed_event;
|
|
1294
|
+
ur(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) : tr(f) > 0 && (p = Dr(r, f) ? 1 : 0, s && (I(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", p ? "👍" : "👎", n || "", Ze(u), Ze(e))), Sn(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
|
+
(tr(l) > 0 || tr(o) > 0) && (b = Wn({}, r)), tr(l) > 0 && dr(b, l), tr(o) > 0 && Wn(b, Gn(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) && Zn(b) && Vn(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 || vn(`${Ze(e)}: Publish event WITHOUT subscribers, ev ${n}`), _;
|
|
1311
1311
|
}
|
|
1312
1312
|
var Xt = Object.freeze({
|
|
1313
1313
|
KW_REQUIRED: 1,
|
|
@@ -1367,7 +1367,7 @@ function pn(e) {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
function dn(e) {
|
|
1369
1369
|
try {
|
|
1370
|
-
return JSON.stringify(e);
|
|
1370
|
+
return JSON.stringify(e, (e, t) => "bigint" == typeof t ? t.toString() : t);
|
|
1371
1371
|
} catch (t) {
|
|
1372
1372
|
try {
|
|
1373
1373
|
return String(e);
|
|
@@ -1415,35 +1415,41 @@ 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
|
+
var yn = !1;
|
|
1419
|
+
function En(e, ...t) {
|
|
1420
|
+
if (!yn) {
|
|
1421
|
+
yn = !0;
|
|
1422
1422
|
try {
|
|
1423
|
-
|
|
1424
|
-
} catch (e) {
|
|
1423
|
+
e(...t);
|
|
1424
|
+
} catch (e) {
|
|
1425
|
+
try {
|
|
1426
|
+
Zt.error("a log function threw:", e);
|
|
1427
|
+
} catch (e) {}
|
|
1428
|
+
} finally {
|
|
1429
|
+
yn = !1;
|
|
1430
|
+
}
|
|
1425
1431
|
}
|
|
1426
1432
|
}
|
|
1427
|
-
function En(e, ...t) {
|
|
1428
|
-
let n = hn(e, ...t), r = no();
|
|
1429
|
-
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"), yn(en, `${r} ERROR: ${String(n)}`))), fn("error", n, r);
|
|
1430
|
-
}
|
|
1431
1433
|
function Tn(e, ...t) {
|
|
1432
|
-
let n = hn(e, ...t), r =
|
|
1433
|
-
|
|
1434
|
+
let n = hn(e, ...t), r = ro();
|
|
1435
|
+
en && (en === Zt.error ? un("error", n) && En(en, "%c" + r + " ERROR: " + String(n), "color:red") : (un("error", n) && Zt.error("%c" + r + " ERROR: " + String(n), "color:red"), En(en, `${r} ERROR: ${String(n)}`))), fn("error", n, r);
|
|
1434
1436
|
}
|
|
1435
1437
|
function vn(e, ...t) {
|
|
1436
|
-
let n = hn(e, ...t), r =
|
|
1437
|
-
|
|
1438
|
+
let n = hn(e, ...t), r = ro();
|
|
1439
|
+
tn && (tn === Zt.warn ? un("warning", n) && En(tn, "%c" + r + " WARNING: " + String(n), "color:yellow") : (un("warning", n) && Zt.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), En(tn, `${r} WARNING: ${String(n)}`))), fn("warning", n, r);
|
|
1438
1440
|
}
|
|
1439
1441
|
function jn(e, ...t) {
|
|
1440
|
-
let n = hn(e, ...t), r =
|
|
1441
|
-
rn && un("
|
|
1442
|
+
let n = hn(e, ...t), r = ro();
|
|
1443
|
+
rn && un("debug", n) && En(rn, "%c" + r + " DEBUG: " + String(n), "color:silver"), fn("debug", n, r);
|
|
1442
1444
|
}
|
|
1443
|
-
function On(e, t) {
|
|
1444
|
-
|
|
1445
|
+
function On(e, ...t) {
|
|
1446
|
+
let n = hn(e, ...t), r = ro();
|
|
1447
|
+
rn && un("msg", n) && En(rn, "%c" + r + " MSG: " + String(n), "color:cyan"), fn("msg", n, r);
|
|
1445
1448
|
}
|
|
1446
|
-
|
|
1449
|
+
function Sn(e, t) {
|
|
1450
|
+
un("json", t) && (t && En(Zt.warn, "=====> " + bn(t)), En(Zt.dir, e)), fn("json", e, ro());
|
|
1451
|
+
}
|
|
1452
|
+
var wn = [
|
|
1447
1453
|
"passw",
|
|
1448
1454
|
"pwd",
|
|
1449
1455
|
"passphrase",
|
|
@@ -1455,12 +1461,12 @@ var Sn = [
|
|
|
1455
1461
|
"cookie",
|
|
1456
1462
|
"credential",
|
|
1457
1463
|
"salt"
|
|
1458
|
-
],
|
|
1464
|
+
], Nn = [
|
|
1459
1465
|
"apikey",
|
|
1460
1466
|
"sessionid",
|
|
1461
1467
|
"sessionkey",
|
|
1462
1468
|
"authdata"
|
|
1463
|
-
],
|
|
1469
|
+
], $n = /* @__PURE__ */ new Set([
|
|
1464
1470
|
"endpoint",
|
|
1465
1471
|
"url",
|
|
1466
1472
|
"uri",
|
|
@@ -1484,25 +1490,25 @@ var Sn = [
|
|
|
1484
1490
|
"expires",
|
|
1485
1491
|
"mode"
|
|
1486
1492
|
]);
|
|
1487
|
-
function
|
|
1493
|
+
function Rn(e) {
|
|
1488
1494
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1489
1495
|
let t = e.toLowerCase(), n = !1;
|
|
1490
|
-
for (const e of
|
|
1496
|
+
for (const e of wn) if (t.indexOf(e) >= 0) {
|
|
1491
1497
|
n = !0;
|
|
1492
1498
|
break;
|
|
1493
1499
|
}
|
|
1494
1500
|
if (!n) {
|
|
1495
1501
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1496
|
-
for (const t of
|
|
1502
|
+
for (const t of Nn) if (e.indexOf(t) >= 0) {
|
|
1497
1503
|
n = !0;
|
|
1498
1504
|
break;
|
|
1499
1505
|
}
|
|
1500
1506
|
}
|
|
1501
1507
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1502
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1508
|
+
for (const e of t.split(/[_\-. \t]/)) if ($n.has(e)) return !1;
|
|
1503
1509
|
return !0;
|
|
1504
1510
|
}
|
|
1505
|
-
function
|
|
1511
|
+
function xn(e, t, n) {
|
|
1506
1512
|
const r = (e) => " " === e || " " === e, o = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1507
1513
|
let s = t;
|
|
1508
1514
|
for (;;) {
|
|
@@ -1518,12 +1524,12 @@ function Rn(e, t, n) {
|
|
|
1518
1524
|
s = t;
|
|
1519
1525
|
}
|
|
1520
1526
|
}
|
|
1521
|
-
var
|
|
1522
|
-
function
|
|
1527
|
+
var Dn = 128, kn = 4194304, An = "<not shown: too large to mask>";
|
|
1528
|
+
function In(e) {
|
|
1523
1529
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1524
|
-
if (e.length >
|
|
1530
|
+
if (e.length > kn) return An;
|
|
1525
1531
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1526
|
-
for (; null !== (t = r.exec(e));)
|
|
1532
|
+
for (; null !== (t = r.exec(e));) Rn(t[2].slice(-128)) && (n = !0);
|
|
1527
1533
|
let o = [], s = 0, l = !1, i = "", _ = 0, a = 0;
|
|
1528
1534
|
const u = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1529
1535
|
for (; a < e.length;) {
|
|
@@ -1536,8 +1542,8 @@ function An(e) {
|
|
|
1536
1542
|
a++;
|
|
1537
1543
|
continue;
|
|
1538
1544
|
}
|
|
1539
|
-
let r = e.substring(Math.max(_, a -
|
|
1540
|
-
if (_ = a + 1, !(
|
|
1545
|
+
let r = e.substring(Math.max(_, a - Dn), a);
|
|
1546
|
+
if (_ = a + 1, !(Rn(r) || n && "value" === r.toLowerCase())) {
|
|
1541
1547
|
a++;
|
|
1542
1548
|
continue;
|
|
1543
1549
|
}
|
|
@@ -1546,18 +1552,18 @@ function An(e) {
|
|
|
1546
1552
|
if (f) {
|
|
1547
1553
|
for (c = a + 1; c < e.length && e[c] !== f;) c++;
|
|
1548
1554
|
e[c] === f && c++;
|
|
1549
|
-
} else c =
|
|
1555
|
+
} else c = xn(e, a, i);
|
|
1550
1556
|
c > a && (o.push(e.substring(s, a)), o.push("********"), s = c, l = !0), a = c, _ = a;
|
|
1551
1557
|
}
|
|
1552
1558
|
return l ? (o.push(e.substring(s)), o.join("")) : null;
|
|
1553
1559
|
}
|
|
1554
|
-
var
|
|
1555
|
-
var
|
|
1556
|
-
function
|
|
1560
|
+
var Cn = 64, Ln = "<not shown: the masking failed>";
|
|
1561
|
+
var Pn = Symbol("mask-in-progress");
|
|
1562
|
+
function Un(e, t, n, r) {
|
|
1557
1563
|
if ("string" == typeof e) {
|
|
1558
|
-
if (e.length > r.left) return r.left = 0,
|
|
1564
|
+
if (e.length > r.left) return r.left = 0, An;
|
|
1559
1565
|
r.left -= e.length;
|
|
1560
|
-
let t =
|
|
1566
|
+
let t = In(e);
|
|
1561
1567
|
return null !== t ? t : e;
|
|
1562
1568
|
}
|
|
1563
1569
|
let o = Array.isArray(e);
|
|
@@ -1566,13 +1572,13 @@ function Pn(e, t, n, r) {
|
|
|
1566
1572
|
let t = Object.getPrototypeOf(e);
|
|
1567
1573
|
return t === Object.prototype || null === t;
|
|
1568
1574
|
}(e)) return e;
|
|
1569
|
-
if (r.left <= 0) return
|
|
1575
|
+
if (r.left <= 0) return An;
|
|
1570
1576
|
if (t.has(e)) {
|
|
1571
1577
|
let n = t.get(e);
|
|
1572
|
-
return n ===
|
|
1578
|
+
return n === Pn ? "<cycle>" : n;
|
|
1573
1579
|
}
|
|
1574
|
-
if (n >=
|
|
1575
|
-
r.left -= 1, t.set(e,
|
|
1580
|
+
if (n >= Cn) return "<deeper not shown>";
|
|
1581
|
+
r.left -= 1, t.set(e, Pn);
|
|
1576
1582
|
let s, l = !1, i = !1;
|
|
1577
1583
|
if (o) {
|
|
1578
1584
|
s = [];
|
|
@@ -1582,13 +1588,13 @@ function Pn(e, t, n, r) {
|
|
|
1582
1588
|
break;
|
|
1583
1589
|
}
|
|
1584
1590
|
r.left -= 1;
|
|
1585
|
-
let _ =
|
|
1591
|
+
let _ = Un(e[o], t, n + 1, r);
|
|
1586
1592
|
_ !== e[o] && (l = !0), s.push(_);
|
|
1587
1593
|
}
|
|
1588
|
-
i && s.push(
|
|
1594
|
+
i && s.push(An);
|
|
1589
1595
|
} else {
|
|
1590
1596
|
s = Object.create(Object.getPrototypeOf(e));
|
|
1591
|
-
let o = "string" == typeof e.attribute &&
|
|
1597
|
+
let o = "string" == typeof e.attribute && Rn(e.attribute.slice(-128));
|
|
1592
1598
|
for (const _ in e) {
|
|
1593
1599
|
if (!Object.prototype.hasOwnProperty.call(e, _)) continue;
|
|
1594
1600
|
if (r.left <= 0) {
|
|
@@ -1597,33 +1603,33 @@ function Pn(e, t, n, r) {
|
|
|
1597
1603
|
}
|
|
1598
1604
|
r.left -= 1 + _.length;
|
|
1599
1605
|
let a, u = e[_];
|
|
1600
|
-
a = (
|
|
1606
|
+
a = (Rn(_.slice(-128)) || o && "value" === _) && null != u && "" !== u ? "********" : Un(u, t, n + 1, r), a !== u && (l = !0), hr(s, _, a);
|
|
1601
1607
|
}
|
|
1602
|
-
i && (s["<more>"] =
|
|
1608
|
+
i && (s["<more>"] = An);
|
|
1603
1609
|
}
|
|
1604
1610
|
return l || i || (s = e), t.set(e, s), s;
|
|
1605
1611
|
}
|
|
1606
|
-
function
|
|
1612
|
+
function Fn(e) {
|
|
1607
1613
|
try {
|
|
1608
|
-
return
|
|
1614
|
+
return Un(e, /* @__PURE__ */ new WeakMap(), 0, { left: kn });
|
|
1609
1615
|
} catch (e) {
|
|
1610
|
-
return
|
|
1616
|
+
return Ln;
|
|
1611
1617
|
}
|
|
1612
1618
|
}
|
|
1613
|
-
function
|
|
1614
|
-
|
|
1619
|
+
function Vn(e, t) {
|
|
1620
|
+
Sn(Fn(e), t);
|
|
1615
1621
|
}
|
|
1616
|
-
function
|
|
1622
|
+
function Gn(e) {
|
|
1617
1623
|
return structuredClone(e);
|
|
1618
1624
|
}
|
|
1619
|
-
function
|
|
1625
|
+
function Mn(e, t) {
|
|
1620
1626
|
if (e === t) return !0;
|
|
1621
1627
|
if (null === e || null === t) return e === t;
|
|
1622
1628
|
if (typeof e != typeof t) return !1;
|
|
1623
1629
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1624
1630
|
if (Array.isArray(e)) {
|
|
1625
1631
|
if (e.length !== t.length) return !1;
|
|
1626
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1632
|
+
for (let n = 0; n < e.length; n++) if (!Mn(e[n], t[n])) return !1;
|
|
1627
1633
|
return !0;
|
|
1628
1634
|
}
|
|
1629
1635
|
if ("object" == typeof e) {
|
|
@@ -1631,118 +1637,118 @@ function Gn(e, t) {
|
|
|
1631
1637
|
if (n.length !== r.length) return !1;
|
|
1632
1638
|
for (let o = 0; o < n.length; o++) {
|
|
1633
1639
|
if (n[o] !== r[o]) return !1;
|
|
1634
|
-
if (!
|
|
1640
|
+
if (!Mn(e[n[o]], t[r[o]])) return !1;
|
|
1635
1641
|
}
|
|
1636
1642
|
return !0;
|
|
1637
1643
|
}
|
|
1638
1644
|
return e === t;
|
|
1639
1645
|
}
|
|
1640
|
-
function Mn(e, t) {
|
|
1641
|
-
if (!t) return e;
|
|
1642
|
-
for (let n of Object.keys(t)) mr(e, n, t[n]);
|
|
1643
|
-
return e;
|
|
1644
|
-
}
|
|
1645
1646
|
function Wn(e, t) {
|
|
1646
1647
|
if (!t) return e;
|
|
1647
|
-
for (let n
|
|
1648
|
+
for (let n of Object.keys(t)) hr(e, n, t[n]);
|
|
1648
1649
|
return e;
|
|
1649
1650
|
}
|
|
1650
1651
|
function Kn(e, t) {
|
|
1651
1652
|
if (!t) return e;
|
|
1652
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) &&
|
|
1653
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && hr(e, n, t[n]);
|
|
1653
1654
|
return e;
|
|
1654
1655
|
}
|
|
1655
1656
|
function Yn(e, t) {
|
|
1656
|
-
if (
|
|
1657
|
+
if (!t) return e;
|
|
1658
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && hr(e, n, t[n]);
|
|
1659
|
+
return e;
|
|
1657
1660
|
}
|
|
1658
1661
|
function Bn(e, t) {
|
|
1659
|
-
e && Object.prototype.hasOwnProperty.call(e, t)
|
|
1662
|
+
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1660
1663
|
}
|
|
1661
|
-
function Jn(e, t
|
|
1662
|
-
|
|
1664
|
+
function Jn(e, t) {
|
|
1665
|
+
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
1663
1666
|
}
|
|
1664
1667
|
function qn(e, t, n) {
|
|
1665
|
-
|
|
1668
|
+
hr(e, t, n);
|
|
1666
1669
|
}
|
|
1667
|
-
function Hn(e, t) {
|
|
1668
|
-
e
|
|
1670
|
+
function Hn(e, t, n) {
|
|
1671
|
+
hr(e, t, n);
|
|
1669
1672
|
}
|
|
1670
1673
|
function zn(e, t) {
|
|
1671
1674
|
e.push(t);
|
|
1672
1675
|
}
|
|
1673
1676
|
function Qn(e, t) {
|
|
1674
|
-
e.
|
|
1677
|
+
e.push(t);
|
|
1675
1678
|
}
|
|
1676
|
-
function Xn(e) {
|
|
1677
|
-
|
|
1679
|
+
function Xn(e, t) {
|
|
1680
|
+
e.splice(t, 1);
|
|
1678
1681
|
}
|
|
1679
1682
|
function Zn(e) {
|
|
1680
|
-
return nr(e) ? e.length : 0;
|
|
1683
|
+
return nr(e) ? Object.keys(e).length : 0;
|
|
1681
1684
|
}
|
|
1682
1685
|
function er(e) {
|
|
1683
|
-
return
|
|
1686
|
+
return rr(e) ? e.length : 0;
|
|
1684
1687
|
}
|
|
1685
1688
|
function tr(e) {
|
|
1686
|
-
return
|
|
1689
|
+
return nr(e) ? Object.keys(e).length : rr(e) ? e.length : or(e) && e.length > 0 ? 1 : 0;
|
|
1687
1690
|
}
|
|
1688
1691
|
function nr(e) {
|
|
1689
|
-
return Array.isArray(e);
|
|
1692
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1690
1693
|
}
|
|
1691
1694
|
function rr(e) {
|
|
1692
|
-
return
|
|
1695
|
+
return Array.isArray(e);
|
|
1693
1696
|
}
|
|
1694
1697
|
function or(e) {
|
|
1695
|
-
return "
|
|
1698
|
+
return "string" == typeof e;
|
|
1696
1699
|
}
|
|
1697
1700
|
function sr(e) {
|
|
1698
|
-
return "
|
|
1701
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1699
1702
|
}
|
|
1700
1703
|
function lr(e) {
|
|
1701
|
-
return
|
|
1704
|
+
return "boolean" == typeof e;
|
|
1702
1705
|
}
|
|
1703
1706
|
function ir(e) {
|
|
1704
|
-
return
|
|
1707
|
+
return null == e;
|
|
1705
1708
|
}
|
|
1706
1709
|
function _r(e) {
|
|
1707
|
-
return
|
|
1710
|
+
return "function" == typeof e;
|
|
1708
1711
|
}
|
|
1709
1712
|
function ar(e) {
|
|
1710
|
-
return
|
|
1713
|
+
return e instanceof O;
|
|
1711
1714
|
}
|
|
1712
1715
|
function ur(e) {
|
|
1713
|
-
return or(e)
|
|
1716
|
+
return !or(e) || 0 === e.length;
|
|
1714
1717
|
}
|
|
1715
|
-
function cr(e
|
|
1716
|
-
return e
|
|
1718
|
+
function cr(e) {
|
|
1719
|
+
return sr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1717
1720
|
}
|
|
1718
1721
|
function fr(e, t) {
|
|
1722
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
1723
|
+
}
|
|
1724
|
+
function gr(e, t) {
|
|
1719
1725
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1720
1726
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1721
1727
|
}
|
|
1722
|
-
function
|
|
1723
|
-
if (
|
|
1724
|
-
if (
|
|
1728
|
+
function pr(e, t) {
|
|
1729
|
+
if (nr(e) || nr(t) || rr(e) || rr(t)) return 0;
|
|
1730
|
+
if (sr(e) || sr(t)) {
|
|
1725
1731
|
let n = Number(e), r = Number(t);
|
|
1726
1732
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1727
1733
|
}
|
|
1728
|
-
if (
|
|
1734
|
+
if (lr(e) || lr(t)) {
|
|
1729
1735
|
let n = Number(e), r = Number(t);
|
|
1730
1736
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1731
1737
|
}
|
|
1732
|
-
return
|
|
1738
|
+
return fr(String(e), String(t));
|
|
1733
1739
|
}
|
|
1734
|
-
function
|
|
1735
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1740
|
+
function dr(e, t) {
|
|
1741
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) dr(e, n);
|
|
1736
1742
|
else "string" == typeof t && delete e[t];
|
|
1737
1743
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1738
1744
|
}
|
|
1739
|
-
function
|
|
1745
|
+
function br(e, t) {
|
|
1740
1746
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
1741
1747
|
}
|
|
1742
|
-
function
|
|
1748
|
+
function mr(e, t) {
|
|
1743
1749
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
1744
1750
|
}
|
|
1745
|
-
function
|
|
1751
|
+
function hr(e, t, n) {
|
|
1746
1752
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1747
1753
|
value: n,
|
|
1748
1754
|
writable: !0,
|
|
@@ -1750,205 +1756,205 @@ function mr(e, t, n) {
|
|
|
1750
1756
|
configurable: !0
|
|
1751
1757
|
}) : e[t] = n;
|
|
1752
1758
|
}
|
|
1753
|
-
function
|
|
1759
|
+
function yr(e, t) {
|
|
1754
1760
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
1755
1761
|
const n = Number(t);
|
|
1756
1762
|
return n >= e.length ? -1 : n;
|
|
1757
1763
|
}
|
|
1758
|
-
function
|
|
1759
|
-
e && !
|
|
1764
|
+
function Er(e, t, n, r) {
|
|
1765
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1760
1766
|
const o = e ? `${Ze(e)}: ` : "";
|
|
1761
|
-
if (!
|
|
1762
|
-
if (!
|
|
1767
|
+
if (!nr(t) && !rr(t)) return void Tn(`${o}kw must be list or dict: '${String(n)}'`);
|
|
1768
|
+
if (!or(n)) return void Tn(`${o}path must be a string: ${String(n)}`);
|
|
1763
1769
|
let s = n.split("`"), l = s.length;
|
|
1764
1770
|
for (let e = 0; e < l; e++) {
|
|
1765
|
-
if (
|
|
1766
|
-
const l =
|
|
1767
|
-
if (l < 0) return void (r &&
|
|
1771
|
+
if (rr(t)) {
|
|
1772
|
+
const l = yr(t, s[e]);
|
|
1773
|
+
if (l < 0) return void (r && Tn(`${o}path not found: '${n}'`));
|
|
1768
1774
|
s[e] = String(l);
|
|
1769
1775
|
}
|
|
1770
|
-
if (
|
|
1776
|
+
if (mr(t, s[e])) return void (r && Tn(`${o}path not found: '${n}'`));
|
|
1771
1777
|
if (e === l - 1) break;
|
|
1772
|
-
if (null == (t = t[s[e]])) return void (r &&
|
|
1773
|
-
if (!
|
|
1778
|
+
if (null == (t = t[s[e]])) return void (r && Tn(`${o}path not found: '${n}'`));
|
|
1779
|
+
if (!nr(t) && !rr(t)) return void Tn(`${o}kw must be list or dict: '${n}'`);
|
|
1774
1780
|
}
|
|
1775
1781
|
let i = t[s[l - 1]];
|
|
1776
|
-
return void 0 === i && r &&
|
|
1782
|
+
return void 0 === i && r && Tn(`${o}path not found: '${n}'`), i;
|
|
1777
1783
|
}
|
|
1778
|
-
function
|
|
1779
|
-
e && !
|
|
1784
|
+
function Tr(e, t, n) {
|
|
1785
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1780
1786
|
const r = e ? Ze(e) + ": " : "";
|
|
1781
|
-
if (!
|
|
1787
|
+
if (!or(n)) return Tn(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
1782
1788
|
let [o, s] = function(e, t) {
|
|
1783
1789
|
let n = e.lastIndexOf(t);
|
|
1784
1790
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1785
1791
|
}(n, "`"), l = t;
|
|
1786
|
-
if (
|
|
1787
|
-
else if (l =
|
|
1788
|
-
return
|
|
1792
|
+
if (ur(s)) s = n;
|
|
1793
|
+
else if (l = Er(e, t, o, !0), void 0 === l) return -1;
|
|
1794
|
+
return rr(l) ? (Tn(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : nr(l) && Object.prototype.hasOwnProperty.call(l, s) ? (delete l[s], 0) : (Tn(`${r}kw_delete(): path not found: '${n}'`), -1);
|
|
1789
1795
|
}
|
|
1790
|
-
function
|
|
1791
|
-
e && !
|
|
1792
|
-
let s =
|
|
1796
|
+
function vr(e, t, n, r, o) {
|
|
1797
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1798
|
+
let s = Er(e, t, n, !1);
|
|
1793
1799
|
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;
|
|
1794
1800
|
if (void 0 === s) {
|
|
1795
1801
|
if (i && t) {
|
|
1796
1802
|
let o = Boolean(r);
|
|
1797
|
-
return
|
|
1803
|
+
return $r(e, t, n, o), o;
|
|
1798
1804
|
}
|
|
1799
|
-
return l && (
|
|
1805
|
+
return l && (Tn(`path not found: '${n}'`), Vn(t)), Boolean(r);
|
|
1800
1806
|
}
|
|
1801
1807
|
let u;
|
|
1802
|
-
if (
|
|
1803
|
-
else if (a &&
|
|
1804
|
-
else if (a &&
|
|
1808
|
+
if (lr(s)) u = s;
|
|
1809
|
+
else if (a && sr(s)) u = 0 !== s;
|
|
1810
|
+
else if (a && or(s)) u = "true" === s.toLowerCase() || "false" !== s.toLowerCase() && 0 !== (parseInt(s, 10) || 0);
|
|
1805
1811
|
else {
|
|
1806
|
-
if (!a || null !== s) return a ? (
|
|
1812
|
+
if (!a || null !== s) return a ? (Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Vn(t), !1) : (Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), Vn(t), Boolean(r));
|
|
1807
1813
|
u = !1;
|
|
1808
1814
|
}
|
|
1809
|
-
return _ &&
|
|
1815
|
+
return _ && Tr(e, t, n), u;
|
|
1810
1816
|
}
|
|
1811
|
-
function
|
|
1812
|
-
e && !
|
|
1813
|
-
let s =
|
|
1817
|
+
function jr(e, t, n, r, o) {
|
|
1818
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1819
|
+
let s = Er(e, t, n, !1);
|
|
1814
1820
|
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;
|
|
1815
1821
|
if (void 0 === s) {
|
|
1816
1822
|
if (i && t) {
|
|
1817
1823
|
let o = parseInt(r);
|
|
1818
|
-
return
|
|
1824
|
+
return $r(e, t, n, o), o;
|
|
1819
1825
|
}
|
|
1820
|
-
return l && (
|
|
1826
|
+
return l && (Tn(`path not found: '${n}'`), Vn(t)), parseInt(r);
|
|
1821
1827
|
}
|
|
1822
1828
|
let u;
|
|
1823
|
-
if (
|
|
1829
|
+
if (sr(s)) u = Math.trunc(s);
|
|
1824
1830
|
else {
|
|
1825
|
-
if (!a) return
|
|
1826
|
-
if (
|
|
1827
|
-
else if (
|
|
1831
|
+
if (!a) return Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a json integer: '${n}'`), Vn(t), parseInt(r);
|
|
1832
|
+
if (lr(s)) u = s ? 1 : 0;
|
|
1833
|
+
else if (or(s)) u = function(e) {
|
|
1828
1834
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
1829
1835
|
if (!t) return 0;
|
|
1830
1836
|
let n, r = t[2];
|
|
1831
1837
|
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;
|
|
1832
1838
|
}(s);
|
|
1833
1839
|
else {
|
|
1834
|
-
if (null !== s) return
|
|
1840
|
+
if (null !== s) return Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Vn(t), 0;
|
|
1835
1841
|
u = 0;
|
|
1836
1842
|
}
|
|
1837
1843
|
}
|
|
1838
|
-
return _ &&
|
|
1844
|
+
return _ && Tr(e, t, n), u;
|
|
1839
1845
|
}
|
|
1840
|
-
function
|
|
1841
|
-
e && !
|
|
1842
|
-
let s =
|
|
1846
|
+
function Or(e, t, n, r, o) {
|
|
1847
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1848
|
+
let s = Er(e, t, n, !1);
|
|
1843
1849
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
1844
|
-
return void 0 === s ? i && t ? (
|
|
1845
|
-
let n =
|
|
1850
|
+
return void 0 === s ? i && t ? ($r(e, t, n, or(r) ? r : null), r) : (l && !function(e, t) {
|
|
1851
|
+
let n = or(t) ? t.split("`") : [], r = e;
|
|
1846
1852
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1847
|
-
if (!
|
|
1853
|
+
if (!nr(r) && !rr(r)) return !1;
|
|
1848
1854
|
r = r[n[e]];
|
|
1849
1855
|
}
|
|
1850
|
-
return !(!
|
|
1851
|
-
}(t, n) && (
|
|
1856
|
+
return !(!nr(r) && !rr(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
1857
|
+
}(t, n) && (Tn(`path not found: '${n}'`), Vn(t)), r) : or(s) ? (_ && Tr(e, t, n), s) : (null !== s && (Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a json str: '${n}'`), Vn(t)), r);
|
|
1852
1858
|
}
|
|
1853
|
-
function
|
|
1854
|
-
e && !
|
|
1855
|
-
let s =
|
|
1859
|
+
function Sr(e, t, n, r, o) {
|
|
1860
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1861
|
+
let s = Er(e, t, n, !1);
|
|
1856
1862
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
1857
1863
|
if (void 0 === s) {
|
|
1858
1864
|
if (i) {
|
|
1859
1865
|
let o = r;
|
|
1860
|
-
return
|
|
1866
|
+
return $r(e, t, n, o), o;
|
|
1861
1867
|
}
|
|
1862
|
-
return l && (
|
|
1868
|
+
return l && (Tn(`path not found: '${n}'`), Vn(t)), r;
|
|
1863
1869
|
}
|
|
1864
|
-
return _ &&
|
|
1870
|
+
return _ && Tr(e, t, n), s;
|
|
1865
1871
|
}
|
|
1866
|
-
function
|
|
1867
|
-
e && !
|
|
1868
|
-
let s =
|
|
1872
|
+
function wr(e, t, n, r, o) {
|
|
1873
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1874
|
+
let s = Er(e, t, n, !1);
|
|
1869
1875
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
1870
|
-
return void 0 === s ? i &&
|
|
1876
|
+
return void 0 === s ? i && nr(r) && t ? ($r(e, t, n, r), r) : (l && (Tn(`path not found: '${n}'`), Vn(t)), r) : nr(s) ? (_ && Tr(e, t, n), s) : i && null === s && nr(r) ? ($r(e, t, n, r), r) : i && null === s ? (l && (Tn(`path not found: '${n}'`), Vn(t)), r) : ((l || i) && (Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (i ? ", cannot create" : "")), Vn(t)), r);
|
|
1871
1877
|
}
|
|
1872
|
-
function
|
|
1873
|
-
e && !
|
|
1874
|
-
let s =
|
|
1878
|
+
function Nr(e, t, n, r, o) {
|
|
1879
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1880
|
+
let s = Er(e, t, n, !1);
|
|
1875
1881
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
1876
1882
|
if (void 0 === s) {
|
|
1877
1883
|
if (i) {
|
|
1878
1884
|
let o = r;
|
|
1879
|
-
return
|
|
1885
|
+
return $r(e, t, n, o), o;
|
|
1880
1886
|
}
|
|
1881
|
-
return l && (
|
|
1887
|
+
return l && (Tn(`path not found: '${n}'`), Vn(t)), r;
|
|
1882
1888
|
}
|
|
1883
|
-
return _ &&
|
|
1889
|
+
return _ && Tr(e, t, n), s;
|
|
1884
1890
|
}
|
|
1885
|
-
function
|
|
1886
|
-
if (e && !
|
|
1887
|
-
if (!
|
|
1888
|
-
if ("" === n) return
|
|
1889
|
-
if (n.split("`").includes("")) return
|
|
1891
|
+
function $r(e, t, n, r) {
|
|
1892
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !nr(t)) return Tn("kw is not an object"), -1;
|
|
1893
|
+
if (!or(n)) return Tn(`${e ? Ze(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
1894
|
+
if ("" === n) return Tn((e ? Ze(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
1895
|
+
if (n.split("`").includes("")) return Tn(`${e ? Ze(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
1890
1896
|
let o = n.split("`"), s = o.length;
|
|
1891
1897
|
for (let l = 0; l < s; l++) {
|
|
1892
1898
|
let i = o[l];
|
|
1893
|
-
if (
|
|
1894
|
-
const r =
|
|
1895
|
-
if (r < 0) return
|
|
1899
|
+
if (rr(t)) {
|
|
1900
|
+
const r = yr(t, i);
|
|
1901
|
+
if (r < 0) return Tn(`${e ? Ze(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not an index of its list: '${n}'`), -1;
|
|
1896
1902
|
i = String(r);
|
|
1897
1903
|
}
|
|
1898
|
-
if (l === s - 1)
|
|
1904
|
+
if (l === s - 1) hr(t, i, r);
|
|
1899
1905
|
else {
|
|
1900
|
-
let r =
|
|
1901
|
-
if (void 0 === r)
|
|
1902
|
-
else if (!
|
|
1906
|
+
let r = mr(t, i) ? void 0 : t[i];
|
|
1907
|
+
if (void 0 === r) hr(t, i, {});
|
|
1908
|
+
else if (!nr(r) && !rr(r)) return Tn(`${e ? Ze(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not a dict or a list: '${n}'`), -1;
|
|
1903
1909
|
t = t[i];
|
|
1904
1910
|
}
|
|
1905
1911
|
}
|
|
1906
1912
|
return 0;
|
|
1907
1913
|
}
|
|
1908
|
-
function
|
|
1909
|
-
if (e && !
|
|
1910
|
-
let s =
|
|
1914
|
+
function Rr(e, t, n, r, o) {
|
|
1915
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !nr(t)) return Tn("kw is not an object"), -1;
|
|
1916
|
+
let s = Er(e, t, n, !1);
|
|
1911
1917
|
if (void 0 === s) {
|
|
1912
|
-
if (!
|
|
1918
|
+
if (!or(n) || function(e, t) {
|
|
1913
1919
|
let n = t.split("`"), r = e;
|
|
1914
1920
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1915
|
-
if (
|
|
1916
|
-
const t =
|
|
1921
|
+
if (rr(r)) {
|
|
1922
|
+
const t = yr(r, n[e]);
|
|
1917
1923
|
if (t < 0) return !1;
|
|
1918
1924
|
r = r[t];
|
|
1919
1925
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
1920
1926
|
if (null == r) return !1;
|
|
1921
|
-
if (!
|
|
1927
|
+
if (!nr(r) && !rr(r)) return !0;
|
|
1922
1928
|
}
|
|
1923
1929
|
return !1;
|
|
1924
1930
|
}(t, n)) return -1;
|
|
1925
|
-
if (s = {},
|
|
1931
|
+
if (s = {}, $r(e, t, n, s) < 0) return -1;
|
|
1926
1932
|
}
|
|
1927
|
-
return
|
|
1933
|
+
return nr(s) ? (hr(s, r, o), 0) : (Tn(`subdict is not an object: '${n}'`), -1);
|
|
1928
1934
|
}
|
|
1929
|
-
function
|
|
1935
|
+
function xr(e, n, r) {
|
|
1930
1936
|
let o = "", s = !1;
|
|
1931
|
-
if (
|
|
1937
|
+
if (rr(n)) {
|
|
1932
1938
|
s = !1;
|
|
1933
1939
|
for (let l = 0; l < n.length; l++) {
|
|
1934
1940
|
let i = n[l];
|
|
1935
|
-
if (o =
|
|
1941
|
+
if (o = ur(r) ? t("%s", r) : t("%s`%d", r, l), s = xr(e, i, o), s) break;
|
|
1936
1942
|
}
|
|
1937
|
-
} else if (
|
|
1943
|
+
} else if (nr(n)) {
|
|
1938
1944
|
s = !0;
|
|
1939
1945
|
let l = Object.keys(n);
|
|
1940
1946
|
for (let i = 0; i < l.length; i++) {
|
|
1941
1947
|
let _ = l[i], a = n[_];
|
|
1942
|
-
if (o =
|
|
1943
|
-
if (s =
|
|
1948
|
+
if (o = ur(r) ? t("%s", _) : t("%s`%s", r, _), rr(a) || nr(a)) {
|
|
1949
|
+
if (s = xr(e, a, o), !s) break;
|
|
1944
1950
|
continue;
|
|
1945
1951
|
}
|
|
1946
|
-
let u =
|
|
1947
|
-
if (void 0 === u && (u =
|
|
1952
|
+
let u = Nr(0, e, o, void 0, 0);
|
|
1953
|
+
if (void 0 === u && (u = Bn(e, o)), void 0 === u) {
|
|
1948
1954
|
s = !1;
|
|
1949
1955
|
break;
|
|
1950
1956
|
}
|
|
1951
|
-
if (0 !==
|
|
1957
|
+
if (0 !== pr(u, a)) {
|
|
1952
1958
|
s = !1;
|
|
1953
1959
|
break;
|
|
1954
1960
|
}
|
|
@@ -1956,59 +1962,59 @@ function Rr(e, n, r) {
|
|
|
1956
1962
|
}
|
|
1957
1963
|
return s;
|
|
1958
1964
|
}
|
|
1959
|
-
function
|
|
1960
|
-
return 0 ===
|
|
1965
|
+
function Dr(e, t) {
|
|
1966
|
+
return 0 === tr(t) || xr(e, t, "");
|
|
1961
1967
|
}
|
|
1962
|
-
function
|
|
1963
|
-
e && !
|
|
1968
|
+
function kr(e, t, n, r) {
|
|
1969
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1964
1970
|
let o = {};
|
|
1965
|
-
if (
|
|
1971
|
+
if (or(n) && !ur(n)) {
|
|
1966
1972
|
let s = n;
|
|
1967
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1968
|
-
} else if (
|
|
1973
|
+
Object.prototype.hasOwnProperty.call(t, s) ? hr(o, s, t[s]) : r && Tn(`${Ze(e)}: key not found: ${s}`);
|
|
1974
|
+
} else if (nr(n) && Zn(n) > 0) for (let s of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, s) ? hr(o, s, t[s]) : r && Tn(`${Ze(e)}: key not found: ${s}`);
|
|
1969
1975
|
else {
|
|
1970
|
-
if (!(
|
|
1976
|
+
if (!(rr(n) && er(n) > 0)) return t;
|
|
1971
1977
|
for (let s = 0; s < n.length; s++) {
|
|
1972
1978
|
let l = n[s];
|
|
1973
|
-
Object.prototype.hasOwnProperty.call(t, l) ?
|
|
1979
|
+
Object.prototype.hasOwnProperty.call(t, l) ? hr(o, l, t[l]) : r && Tn(`${Ze(e)}: key not found: ${l}`);
|
|
1974
1980
|
}
|
|
1975
1981
|
}
|
|
1976
1982
|
return o;
|
|
1977
1983
|
}
|
|
1978
|
-
function
|
|
1984
|
+
function Ar(e, t, n, r) {
|
|
1979
1985
|
let o = {};
|
|
1980
|
-
if (!
|
|
1981
|
-
if (
|
|
1986
|
+
if (!nr(t)) return o;
|
|
1987
|
+
if (Wn(o, t), or(n) && !ur(n)) {
|
|
1982
1988
|
let s = n;
|
|
1983
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1984
|
-
} else if (
|
|
1989
|
+
Object.prototype.hasOwnProperty.call(t, s) ? Jn(o, s) : r && Tn(`${Ze(e)}: key not found: ${s}`);
|
|
1990
|
+
} else if (nr(n) && Zn(n) > 0) for (let s of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, s) ? Jn(o, s) : r && Tn(`${Ze(e)}: key not found: ${s}`);
|
|
1985
1991
|
else {
|
|
1986
|
-
if (!(
|
|
1992
|
+
if (!(rr(n) && er(n) > 0)) return {};
|
|
1987
1993
|
for (let s = 0; s < n.length; s++) {
|
|
1988
1994
|
let l = n[s];
|
|
1989
|
-
Object.prototype.hasOwnProperty.call(t, l) ?
|
|
1995
|
+
Object.prototype.hasOwnProperty.call(t, l) ? Jn(o, l) : r && Tn(`${Ze(e)}: key not found: ${l}`);
|
|
1990
1996
|
}
|
|
1991
1997
|
}
|
|
1992
1998
|
return o;
|
|
1993
1999
|
}
|
|
1994
|
-
function
|
|
2000
|
+
function Ir(e, t, n = !1) {
|
|
1995
2001
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1996
2002
|
let r = window.localStorage.getItem(e);
|
|
1997
|
-
return null === r ? (n &&
|
|
2003
|
+
return null === r ? (n && Cr(e, t), t) : JSON.parse(r);
|
|
1998
2004
|
} catch (n) {
|
|
1999
2005
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
2000
2006
|
}
|
|
2001
2007
|
}
|
|
2002
|
-
function
|
|
2008
|
+
function Cr(e, t) {
|
|
2003
2009
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
2004
|
-
if (!e || void 0 === t) return
|
|
2010
|
+
if (!e || void 0 === t) return Tn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
2005
2011
|
try {
|
|
2006
2012
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
2007
2013
|
} catch (t) {
|
|
2008
|
-
return
|
|
2014
|
+
return Tn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
2009
2015
|
}
|
|
2010
2016
|
}
|
|
2011
|
-
function
|
|
2017
|
+
function Lr(e) {
|
|
2012
2018
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
2013
2019
|
window.localStorage.removeItem(e);
|
|
2014
2020
|
} catch (t) {
|
|
@@ -2016,46 +2022,46 @@ function Cr(e) {
|
|
|
2016
2022
|
}
|
|
2017
2023
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
2018
2024
|
}
|
|
2019
|
-
function
|
|
2020
|
-
if (
|
|
2021
|
-
if (
|
|
2025
|
+
function Pr(e, t) {
|
|
2026
|
+
if (ir(e) || ir(t)) return !0;
|
|
2027
|
+
if (rr(e)) {
|
|
2022
2028
|
if (0 === e.length) return !0;
|
|
2023
2029
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
2024
|
-
} else if (
|
|
2030
|
+
} else if (nr(e)) {
|
|
2025
2031
|
if (0 === Object.keys(e).length) return !0;
|
|
2026
2032
|
for (let n in e) if (n === t) return !0;
|
|
2027
|
-
} else if (
|
|
2033
|
+
} else if (or(e) && e === t) return !0;
|
|
2028
2034
|
return !1;
|
|
2029
2035
|
}
|
|
2030
|
-
function
|
|
2031
|
-
if (e && !
|
|
2032
|
-
o || (o =
|
|
2036
|
+
function Ur(e, t, n, r, o) {
|
|
2037
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !t) return null;
|
|
2038
|
+
o || (o = Dr);
|
|
2033
2039
|
let s = [];
|
|
2034
|
-
if (
|
|
2040
|
+
if (rr(t)) for (let l = 0; l < t.length; l++) {
|
|
2035
2041
|
let i, _ = t[l];
|
|
2036
|
-
if (
|
|
2042
|
+
if (nr(_)) i = Or(e, _, "id", "", 0);
|
|
2037
2043
|
else {
|
|
2038
|
-
if (!
|
|
2044
|
+
if (!or(_)) continue;
|
|
2039
2045
|
i = _;
|
|
2040
2046
|
}
|
|
2041
|
-
|
|
2047
|
+
Pr(n, i) && o(_, r) && s.push(_);
|
|
2042
2048
|
}
|
|
2043
2049
|
else {
|
|
2044
|
-
if (!
|
|
2050
|
+
if (!nr(t)) return Tn("kw_collect() BAD kw parameter"), null;
|
|
2045
2051
|
for (let e of Object.keys(t)) {
|
|
2046
2052
|
let l = t[e];
|
|
2047
|
-
|
|
2053
|
+
Pr(n, e) && o(l, r) && s.push(l);
|
|
2048
2054
|
}
|
|
2049
2055
|
}
|
|
2050
2056
|
return s;
|
|
2051
2057
|
}
|
|
2052
|
-
function
|
|
2058
|
+
function Fr(e, t) {
|
|
2053
2059
|
if (!e) return -1;
|
|
2054
2060
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
2055
2061
|
return -1;
|
|
2056
2062
|
}
|
|
2057
|
-
function
|
|
2058
|
-
if (!e || !t) return
|
|
2063
|
+
function Vr(e, t, n) {
|
|
2064
|
+
if (!e || !t) return Tn("ERROR: str_in_list() list or str empty"), !1;
|
|
2059
2065
|
let r = e.length;
|
|
2060
2066
|
if (n) {
|
|
2061
2067
|
t = t.toLowerCase();
|
|
@@ -2066,7 +2072,7 @@ function Fr(e, t, n) {
|
|
|
2066
2072
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
2067
2073
|
return !1;
|
|
2068
2074
|
}
|
|
2069
|
-
function
|
|
2075
|
+
function Gr(e, t) {
|
|
2070
2076
|
try {
|
|
2071
2077
|
let n = e.__md_iev__;
|
|
2072
2078
|
if (n) return n[t];
|
|
@@ -2074,35 +2080,35 @@ function Vr(e, t) {
|
|
|
2074
2080
|
return;
|
|
2075
2081
|
}
|
|
2076
2082
|
}
|
|
2077
|
-
function
|
|
2083
|
+
function Mr(e, t, n) {
|
|
2078
2084
|
let r = e.__md_iev__;
|
|
2079
2085
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2080
2086
|
}
|
|
2081
|
-
function
|
|
2082
|
-
if (!
|
|
2087
|
+
function Wr(e, t, n, r) {
|
|
2088
|
+
if (!ar(e)) return Tn("gobj is not a GObj"), null;
|
|
2083
2089
|
if (!t) return;
|
|
2084
|
-
let o =
|
|
2085
|
-
o || (o = [],
|
|
2090
|
+
let o = Gr(t, n);
|
|
2091
|
+
o || (o = [], Mr(t, n, o));
|
|
2086
2092
|
try {
|
|
2087
|
-
|
|
2093
|
+
rr(o) && o.unshift(r);
|
|
2088
2094
|
} catch (e) {
|
|
2089
|
-
|
|
2095
|
+
Tn(e);
|
|
2090
2096
|
}
|
|
2091
2097
|
}
|
|
2092
|
-
function
|
|
2093
|
-
if (!
|
|
2094
|
-
if (!
|
|
2095
|
-
let o =
|
|
2096
|
-
return o ? 0 === o.length ? (r &&
|
|
2098
|
+
function Kr(e, t, n, r) {
|
|
2099
|
+
if (!ar(e)) return Tn("gobj is not a GObj"), null;
|
|
2100
|
+
if (!nr(t)) return Tn("kw is not a dict"), null;
|
|
2101
|
+
let o = Gr(t, n);
|
|
2102
|
+
return o ? 0 === o.length ? (r && Tn(`stack empty: ${n}`), null) : o[0] : (r && Tn(`stack NOT FOUND: ${n}`), null);
|
|
2097
2103
|
}
|
|
2098
|
-
function
|
|
2099
|
-
return
|
|
2104
|
+
function Yr(e, t, n) {
|
|
2105
|
+
return ur(n) ? Tr(e, t, "__md_iev__`__msg_type__") : Rr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2100
2106
|
}
|
|
2101
|
-
function
|
|
2102
|
-
return
|
|
2107
|
+
function Br(e, t) {
|
|
2108
|
+
return Or(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2103
2109
|
}
|
|
2104
|
-
function
|
|
2105
|
-
void 0 !== n &&
|
|
2110
|
+
function Jr(e, t, n) {
|
|
2111
|
+
void 0 !== n && or(n) || (n = "");
|
|
2106
2112
|
for (let r of Object.keys(e)) {
|
|
2107
2113
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
2108
2114
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -2111,10 +2117,10 @@ function Br(e, t, n) {
|
|
|
2111
2117
|
r,
|
|
2112
2118
|
e[r],
|
|
2113
2119
|
n
|
|
2114
|
-
]),
|
|
2120
|
+
]), nr(e[r]) && Jr(e[r], t, n), n = n.slice(0, -o.length);
|
|
2115
2121
|
}
|
|
2116
2122
|
}
|
|
2117
|
-
function
|
|
2123
|
+
function qr(e, t, n, r) {
|
|
2118
2124
|
if (!e) return null;
|
|
2119
2125
|
let o, s = e.length;
|
|
2120
2126
|
for (o = 0; o < s; o++) {
|
|
@@ -2122,15 +2128,15 @@ function Jr(e, t, n, r) {
|
|
|
2122
2128
|
if (s) {
|
|
2123
2129
|
let e = s.id;
|
|
2124
2130
|
if (e && e === n) return s;
|
|
2125
|
-
if (r &&
|
|
2126
|
-
let e =
|
|
2131
|
+
if (r && br(s, t)) {
|
|
2132
|
+
let e = qr(s[t], t, n, r);
|
|
2127
2133
|
if (e) return e;
|
|
2128
2134
|
}
|
|
2129
2135
|
}
|
|
2130
2136
|
}
|
|
2131
2137
|
return null;
|
|
2132
2138
|
}
|
|
2133
|
-
function
|
|
2139
|
+
function Hr(e) {
|
|
2134
2140
|
function t(e) {
|
|
2135
2141
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2136
2142
|
switch (t.length % 4) {
|
|
@@ -2161,10 +2167,10 @@ function qr(e) {
|
|
|
2161
2167
|
signature: t(n[2])
|
|
2162
2168
|
};
|
|
2163
2169
|
}
|
|
2164
|
-
function
|
|
2170
|
+
function zr(e) {
|
|
2165
2171
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2166
2172
|
}
|
|
2167
|
-
var
|
|
2173
|
+
var Qr = class {
|
|
2168
2174
|
constructor(e) {
|
|
2169
2175
|
this.html = e, Object.freeze(this);
|
|
2170
2176
|
}
|
|
@@ -2172,41 +2178,41 @@ var zr = class {
|
|
|
2172
2178
|
return this.html;
|
|
2173
2179
|
}
|
|
2174
2180
|
};
|
|
2175
|
-
function Qr(e) {
|
|
2176
|
-
return e instanceof zr;
|
|
2177
|
-
}
|
|
2178
2181
|
function Xr(e) {
|
|
2182
|
+
return e instanceof Qr;
|
|
2183
|
+
}
|
|
2184
|
+
function Zr(e) {
|
|
2179
2185
|
const t = document.createElement("template");
|
|
2180
2186
|
return t.innerHTML = e.html.trim(), t.content;
|
|
2181
2187
|
}
|
|
2182
|
-
var
|
|
2183
|
-
function
|
|
2188
|
+
var eo = !1, to = /* @__PURE__ */ new Set();
|
|
2189
|
+
function no(e) {
|
|
2184
2190
|
const t = document.createElement("template");
|
|
2185
2191
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2186
2192
|
}
|
|
2187
|
-
function
|
|
2193
|
+
function ro(e) {
|
|
2188
2194
|
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();
|
|
2189
2195
|
return `${n}.${r}${o > 0 ? "-" : "+"}${t(Math.floor(Math.abs(o) / 60), 2)}${t(Math.abs(o) % 60, 2)}`;
|
|
2190
2196
|
}
|
|
2191
|
-
function
|
|
2197
|
+
function oo(e, t) {
|
|
2192
2198
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2193
2199
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2194
2200
|
return -1;
|
|
2195
2201
|
}
|
|
2196
|
-
function
|
|
2202
|
+
function so() {
|
|
2197
2203
|
let e = "";
|
|
2198
2204
|
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;
|
|
2199
2205
|
}
|
|
2200
|
-
function
|
|
2206
|
+
function lo(e) {
|
|
2201
2207
|
let t = null;
|
|
2202
2208
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2203
2209
|
}
|
|
2204
|
-
var
|
|
2205
|
-
function
|
|
2210
|
+
var io = 256, _o = 1e5;
|
|
2211
|
+
function ao(e) {
|
|
2206
2212
|
const t = String(e).replace(/`/g, "``");
|
|
2207
2213
|
return "[" === t[0] ? "[" + t : t;
|
|
2208
2214
|
}
|
|
2209
|
-
function
|
|
2215
|
+
function uo(e) {
|
|
2210
2216
|
if ("string" != typeof e) return null;
|
|
2211
2217
|
let t = [], n = "";
|
|
2212
2218
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2227,17 +2233,17 @@ function ao(e) {
|
|
|
2227
2233
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2228
2234
|
});
|
|
2229
2235
|
}
|
|
2230
|
-
function
|
|
2236
|
+
function co(e, t) {
|
|
2231
2237
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2232
2238
|
}
|
|
2233
|
-
function
|
|
2239
|
+
function fo(e) {
|
|
2234
2240
|
return "persistent-attrs-" + Ze(e);
|
|
2235
2241
|
}
|
|
2236
|
-
function
|
|
2237
|
-
if (
|
|
2242
|
+
function go(e, t) {
|
|
2243
|
+
if (or(t)) {
|
|
2238
2244
|
if (-1 === t.indexOf("^")) {
|
|
2239
2245
|
let n, r, o = e.fkey;
|
|
2240
|
-
if (1 !==
|
|
2246
|
+
if (1 !== Zn(o)) return Tn("bad fkey 1"), Tn(e), Tn(t), null;
|
|
2241
2247
|
for (const e of Object.keys(o)) {
|
|
2242
2248
|
n = e, r = o[e];
|
|
2243
2249
|
break;
|
|
@@ -2250,20 +2256,20 @@ function fo(e, t) {
|
|
|
2250
2256
|
}
|
|
2251
2257
|
{
|
|
2252
2258
|
let n = t.split("^");
|
|
2253
|
-
return 3 !== n.length ? (
|
|
2259
|
+
return 3 !== n.length ? (Tn("bad fkey 2"), Tn(e), Tn(t), null) : {
|
|
2254
2260
|
topic_name: n[0],
|
|
2255
2261
|
id: n[1],
|
|
2256
2262
|
hook_name: n[2]
|
|
2257
2263
|
};
|
|
2258
2264
|
}
|
|
2259
2265
|
}
|
|
2260
|
-
return
|
|
2266
|
+
return nr(t) ? {
|
|
2261
2267
|
topic_name: t.topic_name,
|
|
2262
2268
|
id: t.id,
|
|
2263
2269
|
hook_name: t.hook_name
|
|
2264
|
-
} : (
|
|
2270
|
+
} : (Tn("bad fkey 3"), Tn(e), Tn(t), null);
|
|
2265
2271
|
}
|
|
2266
|
-
var
|
|
2272
|
+
var po = [
|
|
2267
2273
|
"string",
|
|
2268
2274
|
"integer",
|
|
2269
2275
|
"object",
|
|
@@ -2273,7 +2279,7 @@ var go = [
|
|
|
2273
2279
|
"real",
|
|
2274
2280
|
"boolean",
|
|
2275
2281
|
"blob"
|
|
2276
|
-
],
|
|
2282
|
+
], bo = [
|
|
2277
2283
|
"persistent",
|
|
2278
2284
|
"required",
|
|
2279
2285
|
"notnull",
|
|
@@ -2285,7 +2291,7 @@ var go = [
|
|
|
2285
2291
|
"stats",
|
|
2286
2292
|
"rstats",
|
|
2287
2293
|
"pstats"
|
|
2288
|
-
],
|
|
2294
|
+
], mo = [
|
|
2289
2295
|
"hook",
|
|
2290
2296
|
"fkey",
|
|
2291
2297
|
"enum",
|
|
@@ -2314,7 +2320,7 @@ var go = [
|
|
|
2314
2320
|
"coordinates",
|
|
2315
2321
|
"gbuffer"
|
|
2316
2322
|
];
|
|
2317
|
-
function
|
|
2323
|
+
function ho(e) {
|
|
2318
2324
|
let t = {
|
|
2319
2325
|
name: e.id,
|
|
2320
2326
|
header: e.header,
|
|
@@ -2333,7 +2339,7 @@ function mo(e) {
|
|
|
2333
2339
|
if (!e.flag) return t;
|
|
2334
2340
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2335
2341
|
let r = e.flag[n];
|
|
2336
|
-
if (
|
|
2342
|
+
if (Vr(mo, r)) {
|
|
2337
2343
|
switch (r) {
|
|
2338
2344
|
case "enum":
|
|
2339
2345
|
t.enum_list = e.enum;
|
|
@@ -2347,7 +2353,7 @@ function mo(e) {
|
|
|
2347
2353
|
case "file": t.is_file = !0;
|
|
2348
2354
|
}
|
|
2349
2355
|
t.type = r;
|
|
2350
|
-
} else if (
|
|
2356
|
+
} else if (Vr(bo, r)) switch (r) {
|
|
2351
2357
|
case "writable":
|
|
2352
2358
|
t.is_writable = !0;
|
|
2353
2359
|
break;
|
|
@@ -2360,23 +2366,23 @@ function mo(e) {
|
|
|
2360
2366
|
}
|
|
2361
2367
|
return t.is_file && (t.type = "file"), t;
|
|
2362
2368
|
}
|
|
2363
|
-
var
|
|
2369
|
+
var yo = [
|
|
2364
2370
|
v(h.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2365
2371
|
v(h.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2366
2372
|
v(h.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2367
2373
|
T()
|
|
2368
|
-
],
|
|
2374
|
+
], Eo = {
|
|
2369
2375
|
periodic: !1,
|
|
2370
2376
|
msec: 0,
|
|
2371
2377
|
timer_id: -1
|
|
2372
|
-
},
|
|
2373
|
-
function
|
|
2378
|
+
}, To = null;
|
|
2379
|
+
function vo(e, t, n, r) {
|
|
2374
2380
|
let o = e.priv, s = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2375
2381
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
2376
2382
|
Ut(e, "EV_TIMEOUT", {}, e);
|
|
2377
2383
|
}, 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;
|
|
2378
2384
|
}
|
|
2379
|
-
var
|
|
2385
|
+
var jo = {
|
|
2380
2386
|
mt_create: function(e) {
|
|
2381
2387
|
let t = e.priv;
|
|
2382
2388
|
const n = jt(e, "subscriber");
|
|
@@ -2401,16 +2407,16 @@ var vo = {
|
|
|
2401
2407
|
},
|
|
2402
2408
|
mt_destroy: function(e) {}
|
|
2403
2409
|
};
|
|
2404
|
-
function jo(e, t) {
|
|
2405
|
-
return e instanceof O ? "C_TIMER" !== Xe(e) ? (En("not C_TIMER GObj"), -1) : (wt(e, "periodic", !1), void Nt(e, "msec", t)) : (En("not GObj TYPE"), -1);
|
|
2406
|
-
}
|
|
2407
2410
|
function Oo(e, t) {
|
|
2408
|
-
return e instanceof O ? "C_TIMER" !== Xe(e) ? (
|
|
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);
|
|
2409
2412
|
}
|
|
2410
|
-
function So(e) {
|
|
2411
|
-
return e instanceof O ? "C_TIMER" !== Xe(e) ? (
|
|
2413
|
+
function So(e, t) {
|
|
2414
|
+
return e instanceof O ? "C_TIMER" !== Xe(e) ? (Tn("not C_TIMER GObj"), -1) : (wt(e, "periodic", !0), void Nt(e, "msec", t)) : (Tn("not GObj TYPE"), -1);
|
|
2412
2415
|
}
|
|
2413
|
-
|
|
2416
|
+
function wo(e) {
|
|
2417
|
+
return e instanceof O ? "C_TIMER" !== Xe(e) ? (Tn("not C_TIMER GObj"), -1) : void Nt(e, "msec", -1) : (Tn("not GObj TYPE"), -1);
|
|
2418
|
+
}
|
|
2419
|
+
var No = [
|
|
2414
2420
|
v(h.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2415
2421
|
v(h.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2416
2422
|
v(h.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2430,63 +2436,63 @@ var wo = [
|
|
|
2430
2436
|
v(h.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2431
2437
|
v(h.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2432
2438
|
T()
|
|
2433
|
-
],
|
|
2434
|
-
function
|
|
2439
|
+
], $o = { gobj_timer: null }, Ro = null;
|
|
2440
|
+
function xo(e, t, n, r) {
|
|
2435
2441
|
let o = ht(e, t);
|
|
2436
|
-
return
|
|
2442
|
+
return nr(o) || (o = {}), o[n] = r, Ot(e, t, o), Re(e, t);
|
|
2437
2443
|
}
|
|
2438
|
-
function
|
|
2444
|
+
function Do(e) {
|
|
2439
2445
|
if (!0 === e || !1 === e) return e;
|
|
2440
2446
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2441
2447
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2442
2448
|
}
|
|
2443
|
-
function
|
|
2449
|
+
function ko() {
|
|
2444
2450
|
return `${He()}^${qe()}`;
|
|
2445
2451
|
}
|
|
2446
|
-
function
|
|
2452
|
+
function Ao(e, t, n, r) {
|
|
2447
2453
|
return Qt(e, t, n), 0;
|
|
2448
2454
|
}
|
|
2449
|
-
var
|
|
2455
|
+
var Io = {
|
|
2450
2456
|
mt_create: function(e) {
|
|
2451
2457
|
let t = e.priv;
|
|
2452
|
-
$t(e, "start_date",
|
|
2458
|
+
$t(e, "start_date", ro()), $t(e, "node_uuid", so()), e.priv.gobj_timer = Ae(Qe(e), "C_TIMER", {}, e), t.periodic_timeout = ht(e, "periodic_timeout"), function(e) {
|
|
2453
2459
|
let t = ht(e, "trace_levels");
|
|
2454
|
-
if (!
|
|
2460
|
+
if (!nr(t)) return 0;
|
|
2455
2461
|
let n = t.__global_trace__;
|
|
2456
|
-
if (
|
|
2462
|
+
if (rr(n)) {
|
|
2457
2463
|
X(4294967295, !1);
|
|
2458
2464
|
for (let e of n) z(e, !0);
|
|
2459
2465
|
}
|
|
2460
2466
|
for (const [n, r] of Object.entries(t)) {
|
|
2461
2467
|
let t = je(n);
|
|
2462
|
-
if (t) if (
|
|
2468
|
+
if (t) if (rr(r)) {
|
|
2463
2469
|
se(t, null, !1);
|
|
2464
2470
|
for (let e of r) se(t, e, !0);
|
|
2465
|
-
} else
|
|
2471
|
+
} else Tn(`${Qe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2466
2472
|
}
|
|
2467
2473
|
}(e), function(e) {
|
|
2468
2474
|
let t = ht(e, "no_trace_levels");
|
|
2469
|
-
if (!
|
|
2475
|
+
if (!nr(t)) return 0;
|
|
2470
2476
|
let n = t.__global_no_trace__;
|
|
2471
|
-
if (
|
|
2477
|
+
if (rr(n)) {
|
|
2472
2478
|
Z(4294967295, !1);
|
|
2473
2479
|
for (let e of n) Q(e, !0);
|
|
2474
2480
|
}
|
|
2475
2481
|
for (const [n, r] of Object.entries(t)) {
|
|
2476
2482
|
let t = je(n);
|
|
2477
|
-
if (t) if (
|
|
2483
|
+
if (t) if (rr(r)) {
|
|
2478
2484
|
le(t, null, !1);
|
|
2479
2485
|
for (let e of r) le(t, e, !0);
|
|
2480
|
-
} else
|
|
2486
|
+
} else Tn(`${Qe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2481
2487
|
}
|
|
2482
2488
|
}(e);
|
|
2483
2489
|
},
|
|
2484
2490
|
mt_writing: function(e, t) {},
|
|
2485
2491
|
mt_start: function(e) {
|
|
2486
|
-
return
|
|
2492
|
+
return So(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2487
2493
|
},
|
|
2488
2494
|
mt_stop: function(e) {
|
|
2489
|
-
return
|
|
2495
|
+
return wo(e.priv.gobj_timer), Ve(e), 0;
|
|
2490
2496
|
},
|
|
2491
2497
|
mt_destroy: function(e) {},
|
|
2492
2498
|
mt_play: function(e) {
|
|
@@ -2503,24 +2509,24 @@ var Ao = {
|
|
|
2503
2509
|
case "get-global-no-trace": return r(0, 0, null, null, te());
|
|
2504
2510
|
case "set-global-trace":
|
|
2505
2511
|
case "set-global-no-trace": {
|
|
2506
|
-
let o = "set-global-no-trace" === t, s = n.level, l =
|
|
2507
|
-
return s ? null === l ? r(0, -1, `${
|
|
2512
|
+
let o = "set-global-no-trace" === t, s = n.level, l = Do(n.set);
|
|
2513
|
+
return s ? null === l ? r(0, -1, `${ko()}: bitmask set or re-set?`, null, null) : (o ? Q(s, l) : z(s, l)) < 0 ? r(0, -1, `${ko()}: global trace level not found: ${s}`, null, null) : o ? (xo(e, "no_trace_levels", "__global_no_trace__", te()), r(0, 0, null, null, te())) : (xo(e, "trace_levels", "__global_trace__", ee()), r(0, 0, null, null, ee())) : r(0, -1, `${ko()}: what level?`, null, null);
|
|
2508
2514
|
}
|
|
2509
2515
|
case "get-gclass-trace":
|
|
2510
2516
|
case "get-gclass-no-trace":
|
|
2511
2517
|
case "set-gclass-trace":
|
|
2512
2518
|
case "set-gclass-no-trace": {
|
|
2513
2519
|
let o = t.indexOf("no-trace") >= 0, s = n.gclass_name || n.gclass || "", l = je(s);
|
|
2514
|
-
if (!l) return r(0, -1, `${
|
|
2520
|
+
if (!l) return r(0, -1, `${ko()}: what gclass is '${s}'?`, null, null);
|
|
2515
2521
|
if (0 === t.indexOf("get-")) return r(0, 0, null, null, o ? oe(l) : ne(l));
|
|
2516
|
-
let i = n.level, _ =
|
|
2517
|
-
return i ? null === _ ? r(0, -1, `${
|
|
2522
|
+
let i = n.level, _ = Do(n.set);
|
|
2523
|
+
return i ? null === _ ? r(0, -1, `${ko()}: bitmask set or re-set?`, null, null) : (o ? le(l, i, _) : se(l, i, _)) < 0 ? r(0, -1, `${ko()}: trace level of ${s} not found: ${i}`, null, null) : o ? (xo(e, "no_trace_levels", s, oe(l)), r(0, 0, null, null, oe(l))) : (xo(e, "trace_levels", s, re(l)), r(0, 0, null, null, ne(l))) : r(0, -1, `${ko()}: what level?`, null, null);
|
|
2518
2524
|
}
|
|
2519
|
-
default: return r(0, -1, `${
|
|
2525
|
+
default: return r(0, -1, `${ko()}: command not available: ${t}`, null, null);
|
|
2520
2526
|
}
|
|
2521
2527
|
}
|
|
2522
2528
|
};
|
|
2523
|
-
var
|
|
2529
|
+
var Co = "ievent_gate_stack", Lo = [
|
|
2524
2530
|
v(h.DTP_STRING, "wanted_yuno_role", y.SDF_RD, "", "wanted yuno role"),
|
|
2525
2531
|
v(h.DTP_STRING, "wanted_yuno_name", y.SDF_RD, "", "wanted yuno name"),
|
|
2526
2532
|
v(h.DTP_STRING, "wanted_yuno_service", y.SDF_RD, "", "wanted yuno service"),
|
|
@@ -2537,15 +2543,15 @@ var Io = "ievent_gate_stack", Co = [
|
|
|
2537
2543
|
v(h.DTP_INTEGER, "timeout_idack", y.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2538
2544
|
v(h.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2539
2545
|
T()
|
|
2540
|
-
],
|
|
2546
|
+
], Po = [
|
|
2541
2547
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2542
2548
|
["ievents2", "Trace inter-events with full kw"],
|
|
2543
2549
|
["identity-card", "Trace identity_card messages"]
|
|
2544
2550
|
];
|
|
2545
|
-
function
|
|
2551
|
+
function Uo(e) {
|
|
2546
2552
|
return !!(3 & M(e));
|
|
2547
2553
|
}
|
|
2548
|
-
var
|
|
2554
|
+
var Fo = {
|
|
2549
2555
|
url: null,
|
|
2550
2556
|
remote_yuno_name: null,
|
|
2551
2557
|
remote_yuno_role: null,
|
|
@@ -2555,23 +2561,23 @@ var Uo = {
|
|
|
2555
2561
|
websocket: null,
|
|
2556
2562
|
inside_on_open: !1,
|
|
2557
2563
|
retry_ms: 0
|
|
2558
|
-
},
|
|
2559
|
-
function
|
|
2560
|
-
e.priv.websocket &&
|
|
2564
|
+
}, Vo = null;
|
|
2565
|
+
function Go(e) {
|
|
2566
|
+
e.priv.websocket && Tn("Websocket ALREADY setup");
|
|
2561
2567
|
const t = vt(e, "url");
|
|
2562
|
-
|
|
2568
|
+
jn(`====> Starting WebSocket to '${t}' (${Ze(e)})`);
|
|
2563
2569
|
const n = ++e.priv.ws_seq;
|
|
2564
2570
|
let r;
|
|
2565
2571
|
try {
|
|
2566
2572
|
r = new WebSocket(t);
|
|
2567
2573
|
} catch (r) {
|
|
2568
|
-
return
|
|
2574
|
+
return Tn(`${Ze(e)}: Cannot open WebSocket to '${t}', Error: ${r.message}`), Lt(e, "EV_ON_CLOSE", {
|
|
2569
2575
|
url: t,
|
|
2570
2576
|
ws_seq: n,
|
|
2571
2577
|
code: 1006,
|
|
2572
2578
|
reason: r.message,
|
|
2573
2579
|
was_clean: !1
|
|
2574
|
-
}, e) < 0 &&
|
|
2580
|
+
}, e) < 0 && Oo(e.priv.gobj_timer, Xo(e)), null;
|
|
2575
2581
|
}
|
|
2576
2582
|
return r ? (r.onopen = () => {
|
|
2577
2583
|
n !== e.priv.ws_seq || ot(e) || Ut(e, "EV_ON_OPEN", {
|
|
@@ -2584,69 +2590,69 @@ function Vo(e) {
|
|
|
2584
2590
|
data: r.data
|
|
2585
2591
|
}, e);
|
|
2586
2592
|
}, r.onclose = (r) => {
|
|
2587
|
-
ot(e) || n === e.priv.ws_seq && (Et(Je(), "browser_beforeunload") ?
|
|
2593
|
+
ot(e) || n === e.priv.ws_seq && (Et(Je(), "browser_beforeunload") ? vn("Close websocket by unload page") : Ut(e, "EV_ON_CLOSE", {
|
|
2588
2594
|
url: t,
|
|
2589
2595
|
ws_seq: n,
|
|
2590
2596
|
code: r.code,
|
|
2591
2597
|
reason: r.reason,
|
|
2592
2598
|
was_clean: r.wasClean
|
|
2593
2599
|
}, e));
|
|
2594
|
-
}, r) : (
|
|
2600
|
+
}, r) : (Tn(`${Ze(e)}: Failed to initialize WebSocket.`), null);
|
|
2595
2601
|
}
|
|
2596
|
-
function
|
|
2602
|
+
function Mo(e, t = 1e3, n = "") {
|
|
2597
2603
|
let r = e.priv, o = r.websocket;
|
|
2598
2604
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
2599
|
-
|
|
2605
|
+
jn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2600
2606
|
try {
|
|
2601
2607
|
o.close(t, n);
|
|
2602
2608
|
} catch (t) {
|
|
2603
|
-
|
|
2609
|
+
Tn(`${Ze(e)}: Error closing WebSocket: ${t.message}`);
|
|
2604
2610
|
}
|
|
2605
|
-
} else
|
|
2611
|
+
} else vn("WebSocket is already closed or in the process of closing.");
|
|
2606
2612
|
}
|
|
2607
|
-
function
|
|
2608
|
-
let r =
|
|
2613
|
+
function Wo(e, t, n) {
|
|
2614
|
+
let r = ro();
|
|
2609
2615
|
try {
|
|
2610
|
-
|
|
2616
|
+
jn("\n" + r + " " + t + "\n"), Vn(n);
|
|
2611
2617
|
} catch (e) {
|
|
2612
|
-
|
|
2618
|
+
jn("ERROR in trace_inter_event: " + e);
|
|
2613
2619
|
}
|
|
2614
2620
|
}
|
|
2615
|
-
var
|
|
2621
|
+
var Ko = class {
|
|
2616
2622
|
constructor(e, t) {
|
|
2617
2623
|
this.event = e, this.kw = t || {};
|
|
2618
2624
|
}
|
|
2619
2625
|
};
|
|
2620
|
-
function
|
|
2626
|
+
function Yo(e, t, n, r) {
|
|
2621
2627
|
return function(e, t) {
|
|
2622
2628
|
let n = e.priv, r = JSON.stringify(t);
|
|
2623
|
-
if (
|
|
2629
|
+
if (Uo(e)) {
|
|
2624
2630
|
let n = vt(e, "url"), o = Qe(Je()) + " ==> " + n, s = ht(Je(), "trace_ievent_callback");
|
|
2625
|
-
s ? s(o, t, 1, r.length) :
|
|
2631
|
+
s ? s(o, t, 1, r.length) : Wo(0, o, t);
|
|
2626
2632
|
}
|
|
2627
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2633
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return vn(`${Ze(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2628
2634
|
try {
|
|
2629
2635
|
n.websocket.send(r);
|
|
2630
2636
|
} catch (t) {
|
|
2631
|
-
|
|
2637
|
+
Tn(`${Ze(e)}: send_iev(): ${t}`);
|
|
2632
2638
|
}
|
|
2633
2639
|
return 0;
|
|
2634
2640
|
}(e, function(e, t) {
|
|
2635
|
-
return
|
|
2641
|
+
return ur(e) ? (Tn("iev_create() event NULL"), null) : new Ko(e, t);
|
|
2636
2642
|
}(t, n));
|
|
2637
2643
|
}
|
|
2638
|
-
function
|
|
2639
|
-
return
|
|
2644
|
+
function Bo(e, t, n) {
|
|
2645
|
+
return ur(n) && (n = vt(e, "wanted_yuno_service")), {
|
|
2640
2646
|
dst_yuno: vt(e, "wanted_yuno_name"),
|
|
2641
2647
|
dst_role: vt(e, "wanted_yuno_role"),
|
|
2642
2648
|
dst_service: n,
|
|
2643
2649
|
src_yuno: qe(),
|
|
2644
2650
|
src_role: He(),
|
|
2645
2651
|
src_service: t,
|
|
2646
|
-
host:
|
|
2652
|
+
host: so()
|
|
2647
2653
|
};
|
|
2648
2654
|
}
|
|
2649
|
-
function
|
|
2655
|
+
function Jo(e) {
|
|
2650
2656
|
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");
|
|
2651
2657
|
i && i.length || (i = ht(Je(), "required_services"));
|
|
2652
2658
|
let _ = {
|
|
@@ -2664,34 +2670,34 @@ function Bo(e) {
|
|
|
2664
2670
|
username: vt(Je(), "__username__"),
|
|
2665
2671
|
launch_id: 0,
|
|
2666
2672
|
yuno_startdate: vt(Je(), "start_date"),
|
|
2667
|
-
id:
|
|
2673
|
+
id: so(),
|
|
2668
2674
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2669
2675
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2670
2676
|
required_services: i
|
|
2671
2677
|
};
|
|
2672
|
-
return
|
|
2678
|
+
return Wr(e, _, Co, Bo(e, Qe(tt(e)), null)), Yr(e, _, "__identity__"), Oo(t.gobj_timer, Tt(e, "timeout_idack")), Yo(e, "EV_IDENTITY_CARD", _);
|
|
2673
2679
|
}
|
|
2674
|
-
function
|
|
2675
|
-
if (
|
|
2680
|
+
function qo(e, t) {
|
|
2681
|
+
if (ur(t.event)) return -1;
|
|
2676
2682
|
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__, l = t.__service__, i = t.subscriber;
|
|
2677
2683
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
2678
|
-
return
|
|
2679
|
-
}
|
|
2680
|
-
function qo(e, t, n, r) {
|
|
2681
|
-
let o = e.priv;
|
|
2682
|
-
return We(e) && (o.websocket = Vo(e)), 0;
|
|
2684
|
+
return Wr(e, n, Co, Bo(e, Qe(i), l)), Yr(e, n, "__subscribing__"), Yo(e, t.event, n);
|
|
2683
2685
|
}
|
|
2684
2686
|
function Ho(e, t, n, r) {
|
|
2685
|
-
|
|
2687
|
+
let o = e.priv;
|
|
2688
|
+
return We(e) && (o.websocket = Go(e)), 0;
|
|
2686
2689
|
}
|
|
2687
2690
|
function zo(e, t, n, r) {
|
|
2691
|
+
return jn("Websocket opened: " + e.priv.url), Jo(e), 0;
|
|
2692
|
+
}
|
|
2693
|
+
function Qo(e, t, n, r) {
|
|
2688
2694
|
let o = e.priv, s = n.url;
|
|
2689
|
-
return void 0 !== n.ws_seq && n.ws_seq !== o.ws_seq || (pn(),
|
|
2695
|
+
return void 0 !== n.ws_seq && n.ws_seq !== o.ws_seq || (pn(), vn(`${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", {
|
|
2690
2696
|
url: s,
|
|
2691
2697
|
remote_yuno_name: o.remote_yuno_name,
|
|
2692
2698
|
remote_yuno_role: o.remote_yuno_role,
|
|
2693
2699
|
remote_yuno_service: o.remote_yuno_service
|
|
2694
|
-
})) : We(e) && (
|
|
2700
|
+
})) : We(e) && (vn(`${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", {
|
|
2695
2701
|
url: s,
|
|
2696
2702
|
remote_yuno_name: o.remote_yuno_name,
|
|
2697
2703
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -2699,25 +2705,25 @@ function zo(e, t, n, r) {
|
|
|
2699
2705
|
code: n.code,
|
|
2700
2706
|
reason: n.reason,
|
|
2701
2707
|
was_clean: n.was_clean
|
|
2702
|
-
})), We(e) &&
|
|
2708
|
+
})), We(e) && Oo(o.gobj_timer, Xo(e))), 0;
|
|
2703
2709
|
}
|
|
2704
|
-
function
|
|
2710
|
+
function Xo(e) {
|
|
2705
2711
|
let t = e.priv, n = Tt(e, "timeout_retry"), r = Tt(e, "timeout_retry_max");
|
|
2706
2712
|
r < n && (r = n), t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2707
2713
|
let o = .2 * t.retry_ms, s = t.retry_ms - o + 2 * Math.random() * o;
|
|
2708
2714
|
return Math.max(1, Math.round(s));
|
|
2709
2715
|
}
|
|
2710
|
-
function Xo(e, t, n, r) {
|
|
2711
|
-
return Bo(e), 0;
|
|
2712
|
-
}
|
|
2713
2716
|
function Zo(e, t, n, r) {
|
|
2717
|
+
return Jo(e), 0;
|
|
2718
|
+
}
|
|
2719
|
+
function es(e, t, n, r) {
|
|
2714
2720
|
let o = e.priv;
|
|
2715
|
-
|
|
2716
|
-
let s =
|
|
2721
|
+
wo(o.gobj_timer);
|
|
2722
|
+
let s = Kr(e, n, Co, !0), l = Or(e, s, "src_yuno", ""), i = Or(e, s, "src_role", ""), _ = Or(e, s, "src_service", "");
|
|
2717
2723
|
$t(e, "remote_yuno_name", l), $t(e, "remote_yuno_role", i), $t(e, "remote_yuno_service", _);
|
|
2718
|
-
let a =
|
|
2724
|
+
let a = jr(e, n, "result", -1, 0), u = Or(e, n, "comment", "", 0), c = Or(e, n, "username", "", 0), f = Nr(e, n, "services_roles", {});
|
|
2719
2725
|
if (a < 0) {
|
|
2720
|
-
|
|
2726
|
+
Mo(e);
|
|
2721
2727
|
let t = {
|
|
2722
2728
|
url: vt(e, "url"),
|
|
2723
2729
|
result: a,
|
|
@@ -2742,61 +2748,61 @@ function Zo(e, t, n, r) {
|
|
|
2742
2748
|
}
|
|
2743
2749
|
o.inside_on_open = !1, function(e) {
|
|
2744
2750
|
let t = Ht(e, null, null, null);
|
|
2745
|
-
for (let n = 0; n < t.length; n++)
|
|
2751
|
+
for (let n = 0; n < t.length; n++) qo(e, t[n]);
|
|
2746
2752
|
}(e);
|
|
2747
2753
|
}
|
|
2748
2754
|
return 0;
|
|
2749
2755
|
}
|
|
2750
|
-
function
|
|
2756
|
+
function ts(e, t, n, r) {
|
|
2751
2757
|
let o = e.priv.url, s = function(e, t) {
|
|
2752
2758
|
let n;
|
|
2753
2759
|
try {
|
|
2754
2760
|
n = JSON.parse(t);
|
|
2755
2761
|
} catch (t) {
|
|
2756
|
-
return
|
|
2762
|
+
return vn(`${Ze(e)}: parsing inter_event json: ${t}`), null;
|
|
2757
2763
|
}
|
|
2758
|
-
if (!(n instanceof Object)) return
|
|
2764
|
+
if (!(n instanceof Object)) return vn(`${Ze(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
2759
2765
|
let r = n.event;
|
|
2760
|
-
if (!r) return
|
|
2761
|
-
if ("string" != typeof r) return
|
|
2766
|
+
if (!r) return vn(`${Ze(e)}: parsing inter_event: no event`), null;
|
|
2767
|
+
if ("string" != typeof r) return vn(`${Ze(e)}: parsing inter_event: event not a string`), null;
|
|
2762
2768
|
let o = n.kw;
|
|
2763
2769
|
return o ? o instanceof Object ? {
|
|
2764
2770
|
event: r,
|
|
2765
2771
|
kw: o || {}
|
|
2766
|
-
} : (
|
|
2772
|
+
} : (vn(`${Ze(e)}: parsing inter_event: kw not a json object`), null) : (vn(`${Ze(e)}: parsing inter_kw: no kw`), null);
|
|
2767
2773
|
}(e, n.data);
|
|
2768
|
-
if (!s) return
|
|
2769
|
-
if (
|
|
2774
|
+
if (!s) return vn(`${Ze(e)}: frame dropped from ${o}: ${String(n.data).substring(0, 256)}`), -1;
|
|
2775
|
+
if (Uo(e)) {
|
|
2770
2776
|
let e = Qe(Je()) + " <== " + o, t = n.data.length, r = ht(Je(), "trace_ievent_callback");
|
|
2771
|
-
r ? r(e, s, 2, t) :
|
|
2777
|
+
r ? r(e, s, 2, t) : Wo(0, e, s);
|
|
2772
2778
|
}
|
|
2773
2779
|
let l = s.event, i = s.kw;
|
|
2774
2780
|
if ("ST_SESSION" !== xt(e)) {
|
|
2775
2781
|
if (kt(e, l, $.EVF_PUBLIC_EVENT)) {
|
|
2776
2782
|
if (!(Ut(e, l, i, e) < 0)) return 0;
|
|
2777
|
-
} else
|
|
2778
|
-
return
|
|
2783
|
+
} else Tn(`${Ze(e)}: event UNKNOWN in not-session state ${l}`);
|
|
2784
|
+
return Mo(e), -1;
|
|
2779
2785
|
}
|
|
2780
2786
|
s = null;
|
|
2781
|
-
let _ =
|
|
2782
|
-
if (u.toLowerCase() !== He().toLowerCase()) return
|
|
2783
|
-
let c =
|
|
2784
|
-
if ("__subscribing__" === _) return
|
|
2785
|
-
if ("__unsubscribing__" === _) return
|
|
2787
|
+
let _ = Br(e, i), a = Kr(e, i, Co), u = Or(e, a, "dst_role", "");
|
|
2788
|
+
if (u.toLowerCase() !== He().toLowerCase()) return Tn(`"It's not my role, dst_role: ${u}, my_role: ${He()}`), 0;
|
|
2789
|
+
let c = Or(e, a, "dst_service", "");
|
|
2790
|
+
if ("__subscribing__" === _) return vn(`${Ze(e)}: subscription event ignored, I'm client (service: ${c}, event: ${l})`), -1;
|
|
2791
|
+
if ("__unsubscribing__" === _) return vn(`${Ze(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${l})`), -1;
|
|
2786
2792
|
if (kt(e, l, $.EVF_PUBLIC_EVENT)) return Ut(e, l, i, e), 0;
|
|
2787
|
-
if (!
|
|
2793
|
+
if (!ur(c)) {
|
|
2788
2794
|
let t = Se(c, !1);
|
|
2789
|
-
return t ? kt(t, l, $.EVF_PUBLIC_EVENT) ? (Ut(t, l, i, e), 0) : (
|
|
2795
|
+
return t ? kt(t, l, $.EVF_PUBLIC_EVENT) ? (Ut(t, l, i, e), 0) : (Tn(`${Ze(e)}: Service found but no event or not public, service '${Ze(t)}', ev '${l}'`), -1) : (vn(`${Ze(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${l}'`), 0);
|
|
2790
2796
|
}
|
|
2791
2797
|
return rt(e) ? Ut(tt(e), l, i, e) : Qt(e, l, i), 0;
|
|
2792
2798
|
}
|
|
2793
|
-
function
|
|
2799
|
+
function ns(e, t, n, r) {
|
|
2794
2800
|
return 0;
|
|
2795
2801
|
}
|
|
2796
|
-
function
|
|
2802
|
+
function rs(e, t, n, r) {
|
|
2797
2803
|
return 0;
|
|
2798
2804
|
}
|
|
2799
|
-
var
|
|
2805
|
+
var os = {
|
|
2800
2806
|
mt_create: function(e) {
|
|
2801
2807
|
let t = e.priv;
|
|
2802
2808
|
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);
|
|
@@ -2826,52 +2832,52 @@ var rs = {
|
|
|
2826
2832
|
code: 1e3,
|
|
2827
2833
|
reason: "restarted",
|
|
2828
2834
|
was_clean: !0
|
|
2829
|
-
}, e),
|
|
2835
|
+
}, e), wo(t.gobj_timer)), t.websocket = Go(e), 0;
|
|
2830
2836
|
},
|
|
2831
2837
|
mt_stop: function(e) {
|
|
2832
2838
|
let t = e.priv;
|
|
2833
|
-
return
|
|
2839
|
+
return wo(t.gobj_timer), t.websocket && Mo(e), 0;
|
|
2834
2840
|
},
|
|
2835
2841
|
mt_destroy: function(e) {},
|
|
2836
2842
|
mt_stats: function(e, t, n, r) {
|
|
2837
|
-
if ("ST_SESSION" !== xt(e)) return
|
|
2843
|
+
if ("ST_SESSION" !== xt(e)) return Tn("Not in session"), null;
|
|
2838
2844
|
n || (n = {});
|
|
2839
|
-
let o =
|
|
2840
|
-
return s || (s = {}),
|
|
2845
|
+
let o = Bo(e, Qe(r), Or(e, n, "service", null, 0)), s = Nr(e, n, "__md_stats__", null, Xt.KW_EXTRACT);
|
|
2846
|
+
return s || (s = {}), Wr(e, n, "stats_stack", {
|
|
2841
2847
|
stats: t,
|
|
2842
2848
|
kw: s
|
|
2843
|
-
}),
|
|
2849
|
+
}), Wr(e, n, Co, o), n.__stats__ = t, Yr(e, n, "__stats__"), Yo(e, "EV_MT_STATS", n, r), null;
|
|
2844
2850
|
},
|
|
2845
2851
|
mt_command_parser: function(e, t, n, r) {
|
|
2846
|
-
if ("ST_SESSION" !== xt(e)) return
|
|
2852
|
+
if ("ST_SESSION" !== xt(e)) return Tn("Not in session"), null;
|
|
2847
2853
|
n || (n = {});
|
|
2848
|
-
let o =
|
|
2849
|
-
return s || (s = {}),
|
|
2854
|
+
let o = Bo(e, Qe(r), Or(e, n, "service", "", 0)), s = Nr(e, n, "__md_command__", null, Xt.KW_EXTRACT);
|
|
2855
|
+
return s || (s = {}), Wr(e, n, "command_stack", {
|
|
2850
2856
|
command: t,
|
|
2851
2857
|
kw: s
|
|
2852
|
-
}),
|
|
2858
|
+
}), Wr(e, n, Co, o), n.__command__ = t, Yr(e, n, "__command__"), Yo(e, "EV_MT_COMMAND", n, r), null;
|
|
2853
2859
|
},
|
|
2854
2860
|
mt_inject_event: function(e, t, n, r) {
|
|
2855
2861
|
if ("ST_SESSION" !== xt(e)) return window.console.error("Not in session"), -1;
|
|
2856
|
-
if (n =
|
|
2862
|
+
if (n = Wn({}, nr(n) ? n : {}), nr(n.__md_iev__) && (n.__md_iev__ = Gn(n.__md_iev__)), Kr(e, n, Co));
|
|
2857
2863
|
else {
|
|
2858
|
-
let o =
|
|
2859
|
-
|
|
2864
|
+
let o = Bo(e, Qe(r), Or(e, n, "__service__", 0, 0));
|
|
2865
|
+
Jn(n, "__service__"), Wr(e, n, "__message__", t), Wr(e, n, Co, o);
|
|
2860
2866
|
}
|
|
2861
|
-
return
|
|
2867
|
+
return Yr(e, n, "__message__"), Yo(e, t, n, r);
|
|
2862
2868
|
},
|
|
2863
2869
|
mt_subscription_added: function(e, t) {
|
|
2864
2870
|
let n = e.priv;
|
|
2865
|
-
return "ST_SESSION" === xt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2871
|
+
return "ST_SESSION" === xt(e) && n.websocket ? n.inside_on_open ? 0 : qo(e, t) : 0;
|
|
2866
2872
|
},
|
|
2867
2873
|
mt_subscription_deleted: function(e, t) {
|
|
2868
2874
|
let n = e.priv;
|
|
2869
2875
|
if ("ST_SESSION" !== xt(e) || !n.websocket) return 0;
|
|
2870
2876
|
if (n.inside_on_open) return 0;
|
|
2871
|
-
if (
|
|
2877
|
+
if (ur(t.event)) return 0;
|
|
2872
2878
|
let r = {}, o = t.__global__, s = t.__config__, l = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2873
2879
|
s && (r.__config__ = s), o && (r.__global__ = o), l && (r.__filter__ = l);
|
|
2874
|
-
return
|
|
2880
|
+
return Wr(e, r, Co, Bo(e, Qe(_), i)), Yr(e, r, "__unsubscribing__"), Yo(e, t.event, r, e);
|
|
2875
2881
|
}
|
|
2876
2882
|
};
|
|
2877
2883
|
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__", {
|
|
@@ -2885,55 +2891,55 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2885
2891
|
return t;
|
|
2886
2892
|
}, exports.build_stats_response = o, exports.clean_name = function(e) {
|
|
2887
2893
|
return e.replace(/[?# ^:]/g, "_");
|
|
2888
|
-
}, exports.clear_timeout =
|
|
2894
|
+
}, exports.clear_timeout = wo, exports.cmp_two_simple_json = pr, exports.command_parser = function(e, t, n, r) {}, exports.createElement2 = function e(t, n) {
|
|
2889
2895
|
let [r, o, s, l] = t;
|
|
2890
|
-
if (!r) return void
|
|
2896
|
+
if (!r) return void Tn("Tag must be a valid HTML element.");
|
|
2891
2897
|
let i = document.createElement(r), _ = "";
|
|
2892
2898
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2893
2899
|
let t = "";
|
|
2894
2900
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
2895
2901
|
i.style.cssText = t;
|
|
2896
2902
|
} 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]);
|
|
2897
|
-
if (
|
|
2898
|
-
else if (
|
|
2903
|
+
if (Xr(s)) i.appendChild(Zr(s));
|
|
2904
|
+
else if (or(s)) if (s = s.trim(), s.length > 0 && "<" === s[0] && !eo) i.appendChild(no(s));
|
|
2899
2905
|
else if (s.length > 0 && "<" === s[0] && function(e) {
|
|
2900
|
-
if (
|
|
2906
|
+
if (to.size >= 100) return;
|
|
2901
2907
|
const t = e.slice(0, 80);
|
|
2902
|
-
|
|
2908
|
+
to.has(t) || (to.add(t), vn(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
2903
2909
|
}(s), n && _) i.textContent = n(_) || s;
|
|
2904
2910
|
else i.textContent = s;
|
|
2905
|
-
else if (
|
|
2906
|
-
if (s.length > 0) if (
|
|
2907
|
-
else for (let t of s) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) :
|
|
2908
|
-
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? i.appendChild(s) : null != s && (
|
|
2911
|
+
else if (rr(s)) {
|
|
2912
|
+
if (s.length > 0) if (or(s[0])) i.appendChild(e(s, n));
|
|
2913
|
+
else for (let t of s) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) : Xr(t) ? i.appendChild(Zr(t)) : or(t) ? i.appendChild(document.createTextNode(t)) : null != t && !1 !== t && Tn("createElement2: child ignored, type " + typeof t);
|
|
2914
|
+
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? i.appendChild(s) : null != s && (Tn("content ignored"), Sn(s));
|
|
2909
2915
|
if (l && "object" == typeof l) for (const e of Object.keys(l)) i.addEventListener(e, l[e]);
|
|
2910
2916
|
return i;
|
|
2911
|
-
}, exports.createOneHtml =
|
|
2912
|
-
let n =
|
|
2913
|
-
return
|
|
2917
|
+
}, exports.createOneHtml = no, exports.create_json_record = function(e, t) {
|
|
2918
|
+
let n = Gn(e);
|
|
2919
|
+
return Kn(n, t), n;
|
|
2914
2920
|
}, exports.create_template_record = function(e, t) {
|
|
2915
2921
|
let n = {};
|
|
2916
2922
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2917
2923
|
let o;
|
|
2918
|
-
|
|
2919
|
-
let s =
|
|
2920
|
-
|
|
2924
|
+
nr(r) && (o = r.default);
|
|
2925
|
+
let s = Nr(null, t, e, o);
|
|
2926
|
+
qn(n, e, s);
|
|
2921
2927
|
}), n;
|
|
2922
|
-
}, exports.current_timestamp =
|
|
2923
|
-
let n =
|
|
2924
|
-
return n &&
|
|
2928
|
+
}, exports.current_timestamp = ro, exports.data_type_t = h, exports.db_list_persistent_attrs = function(e, t) {
|
|
2929
|
+
let n = Ir(fo(e), null, !1), r = {};
|
|
2930
|
+
return n && nr(n) && (r = kr(e, n, t, !1)), r;
|
|
2925
2931
|
}, exports.db_load_persistent_attrs = function(e, t) {
|
|
2926
|
-
let n = yt(e, y.SDF_PERSIST), r =
|
|
2927
|
-
if (r &&
|
|
2928
|
-
let o =
|
|
2929
|
-
o =
|
|
2932
|
+
let n = yt(e, y.SDF_PERSIST), r = Ir(fo(e), null, !1);
|
|
2933
|
+
if (r && nr(r)) {
|
|
2934
|
+
let o = kr(e, r, t, !1);
|
|
2935
|
+
o = kr(e, o, n, !1), St(e, o, y.SDF_PERSIST);
|
|
2930
2936
|
}
|
|
2931
2937
|
}, exports.db_remove_persistent_attrs = function(e, t) {
|
|
2932
|
-
let n =
|
|
2933
|
-
0 ===
|
|
2938
|
+
let n = Ar(e, Ir(fo(e), null, !1), t, !1);
|
|
2939
|
+
0 === Zn(n) ? Lr(fo(e)) : Cr(fo(e), n);
|
|
2934
2940
|
}, exports.db_save_persistent_attrs = function(e, t) {
|
|
2935
|
-
let n =
|
|
2936
|
-
return r &&
|
|
2941
|
+
let n = kr(e, yt(e, y.SDF_PERSIST), t, !1), r = Ir(fo(e), null, !1);
|
|
2942
|
+
return r && nr(r) && Yn(n, r), Cr(fo(e), n);
|
|
2937
2943
|
}, exports.debounce = function(e, t = 0, n = !1) {
|
|
2938
2944
|
let r = null, o = null, s = null;
|
|
2939
2945
|
const l = (...l) => {
|
|
@@ -2953,24 +2959,24 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2953
2959
|
return !1;
|
|
2954
2960
|
}, exports.duplicate_objects = function(...e) {
|
|
2955
2961
|
const t = {};
|
|
2956
|
-
for (const n of e)
|
|
2962
|
+
for (const n of e) Wn(t, structuredClone(n));
|
|
2957
2963
|
return t;
|
|
2958
2964
|
}, exports.empty_json = function(e) {
|
|
2959
|
-
return 0 ===
|
|
2960
|
-
}, exports.empty_string =
|
|
2965
|
+
return 0 === tr(e);
|
|
2966
|
+
}, exports.empty_string = ur, exports.escapeHtml = zr, exports.event_flag_t = $, exports.flat2json = function(e) {
|
|
2961
2967
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2962
2968
|
let t = null;
|
|
2963
2969
|
for (const n of Object.keys(e)) {
|
|
2964
|
-
const r =
|
|
2970
|
+
const r = uo(n);
|
|
2965
2971
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2966
|
-
if (r.length >
|
|
2972
|
+
if (r.length > io) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2967
2973
|
const o = "number" == typeof r[0];
|
|
2968
2974
|
if (null === t) t = o ? [] : {};
|
|
2969
2975
|
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2970
2976
|
let s = t;
|
|
2971
2977
|
for (let t = 0; t < r.length; t++) {
|
|
2972
2978
|
const o = r[t], l = "number" == typeof o, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2973
|
-
if (l && o >
|
|
2979
|
+
if (l && o > _o) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
2974
2980
|
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"}`);
|
|
2975
2981
|
if (i) {
|
|
2976
2982
|
if (Array.isArray(s)) {
|
|
@@ -2978,7 +2984,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2978
2984
|
s[o] = e[n];
|
|
2979
2985
|
} else {
|
|
2980
2986
|
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`);
|
|
2981
|
-
|
|
2987
|
+
hr(s, o, e[n]);
|
|
2982
2988
|
}
|
|
2983
2989
|
break;
|
|
2984
2990
|
}
|
|
@@ -2986,7 +2992,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2986
2992
|
if (Array.isArray(s)) {
|
|
2987
2993
|
for (; s.length <= o;) s.push(null);
|
|
2988
2994
|
a = s[o], null == a && (a = _ ? [] : {}, s[o] = a);
|
|
2989
|
-
} else a =
|
|
2995
|
+
} else a = mr(s, o) ? void 0 : s[o], void 0 === a && (a = _ ? [] : {}, hr(s, o, a));
|
|
2990
2996
|
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`);
|
|
2991
2997
|
if (_ !== Array.isArray(a)) throw new Error(`flat2json: '${n}' needs a ${_ ? "array" : "object"} where the tree already has a ${Array.isArray(a) ? "array" : "object"}`);
|
|
2992
2998
|
s = a;
|
|
@@ -2997,11 +3003,11 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2997
3003
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2998
3004
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2999
3005
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
3000
|
-
for (const n of Object.keys(t.added || {}))
|
|
3006
|
+
for (const n of Object.keys(t.added || {})) hr(e, n, t.added[n]);
|
|
3001
3007
|
for (const n of Object.keys(t.changed || {})) {
|
|
3002
3008
|
const r = t.changed[n];
|
|
3003
3009
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
3004
|
-
|
|
3010
|
+
hr(e, n, r.to);
|
|
3005
3011
|
}
|
|
3006
3012
|
return e;
|
|
3007
3013
|
}, exports.flat_diff = function(e, t) {
|
|
@@ -3010,15 +3016,15 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3010
3016
|
removed: {},
|
|
3011
3017
|
changed: {}
|
|
3012
3018
|
};
|
|
3013
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
3019
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? co(n[e], r[e]) || hr(o.changed, e, {
|
|
3014
3020
|
from: n[e],
|
|
3015
3021
|
to: r[e]
|
|
3016
|
-
}) :
|
|
3017
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
3022
|
+
}) : hr(o.removed, e, n[e]);
|
|
3023
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || hr(o.added, e, r[e]);
|
|
3018
3024
|
return o;
|
|
3019
3025
|
}, exports.flat_key_join = function(e) {
|
|
3020
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
3021
|
-
}, exports.flat_key_split =
|
|
3026
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : ao(e)).join("`") : "";
|
|
3027
|
+
}, exports.flat_key_split = uo, 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) {
|
|
3022
3028
|
if (!e) return {
|
|
3023
3029
|
top: 0,
|
|
3024
3030
|
left: 0,
|
|
@@ -3037,17 +3043,17 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3037
3043
|
right: n + i + r,
|
|
3038
3044
|
bottom: t + l + o
|
|
3039
3045
|
};
|
|
3040
|
-
}, exports.get_function_name =
|
|
3046
|
+
}, exports.get_function_name = lo, exports.get_now = function() {
|
|
3041
3047
|
return Math.floor(Date.now() / 1e3);
|
|
3042
3048
|
}, exports.gobj_bottom_gobj = st, exports.gobj_change_parent = function(e, n) {
|
|
3043
|
-
return ot(e) ? (
|
|
3049
|
+
return ot(e) ? (Tn("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) && jn(t("👦👦🔵 child_added(%s): %s", et(n), Ze(e))), n.gclass.gmt.mt_child_added(n, e)), 0) : (Tn(`${Ze(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
3044
3050
|
}, exports.gobj_change_state = Rt, exports.gobj_command = function(e, n, o, s) {
|
|
3045
|
-
if (ot(e)) return
|
|
3051
|
+
if (ot(e)) return Tn("gobj NULL or DESTROYED"), -1;
|
|
3046
3052
|
if (function(e) {
|
|
3047
3053
|
return F > 1 || !!e && !!(M(e) & C.TRACE_COMMANDS);
|
|
3048
3054
|
}(e) || q(e, null) && !H(s, null)) {
|
|
3049
|
-
let r =
|
|
3050
|
-
I(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", We(e) ? "" : "!!", Ze(e), null !== r ? r : n, Ze(s))), J(e) &&
|
|
3055
|
+
let r = In(n);
|
|
3056
|
+
I(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", We(e) ? "" : "!!", Ze(e), null !== r ? r : n, Ze(s))), J(e) && Vn(o);
|
|
3051
3057
|
}
|
|
3052
3058
|
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);
|
|
3053
3059
|
}, exports.gobj_create = function(e, t, n, r) {
|
|
@@ -3061,7 +3067,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3061
3067
|
}, exports.gobj_create_yuno = function(e, t, n) {
|
|
3062
3068
|
return ke(e, t, n, null, w.gobj_flag_yuno);
|
|
3063
3069
|
}, 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) {
|
|
3064
|
-
if (
|
|
3070
|
+
if (ur(t)) return null;
|
|
3065
3071
|
const n = t.toLowerCase();
|
|
3066
3072
|
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d : bt(d, t);
|
|
3067
3073
|
}, 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() {
|
|
@@ -3073,24 +3079,24 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3073
3079
|
}, exports.gobj_list_subscriptions = function(e) {
|
|
3074
3080
|
let t = Ht(e, null, null, null);
|
|
3075
3081
|
for (let n = 0; n < t.length; n++) {
|
|
3076
|
-
let r = t[n], o =
|
|
3077
|
-
|
|
3082
|
+
let r = t[n], o = Sr(e, r, "publisher", null, Xt.KW_REQUIRED), s = Sr(e, r, "subscriber", null, Xt.KW_REQUIRED);
|
|
3083
|
+
Hn(r, "s_event", Or(e, r, "event", "", Xt.KW_REQUIRED)), Hn(r, "s_publisher", Ze(o)), Hn(r, "s_subscriber", Ze(s));
|
|
3078
3084
|
}
|
|
3079
3085
|
let n = zt(e, 0, null, 0);
|
|
3080
3086
|
for (let t = 0; t < n.length; t++) {
|
|
3081
|
-
let r = n[t], o =
|
|
3082
|
-
|
|
3087
|
+
let r = n[t], o = Sr(e, r, "publisher", null, Xt.KW_REQUIRED), s = Sr(e, r, "subscriber", null, Xt.KW_REQUIRED);
|
|
3088
|
+
Hn(r, "s_event", Or(e, r, "event", "", Xt.KW_REQUIRED)), Hn(r, "s_publisher", Ze(o)), Hn(r, "s_subscriber", Ze(s));
|
|
3083
3089
|
}
|
|
3084
3090
|
return {
|
|
3085
3091
|
subscriptions: t,
|
|
3086
3092
|
subscribings: n,
|
|
3087
|
-
"total subscriptions":
|
|
3088
|
-
total_subscribings:
|
|
3093
|
+
"total subscriptions": er(t),
|
|
3094
|
+
total_subscribings: er(n)
|
|
3089
3095
|
};
|
|
3090
3096
|
}, exports.gobj_load_persistent_attrs = function(e, t) {
|
|
3091
|
-
return Ye(e) ? l ? l(e, t) : -1 : (
|
|
3097
|
+
return Ye(e) ? l ? l(e, t) : -1 : (Tn(`${Ze(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
3092
3098
|
}, exports.gobj_match_children = function(e, t) {
|
|
3093
|
-
if (ot(e)) return
|
|
3099
|
+
if (ot(e)) return Tn("gobj NULL or DESTROYED"), null;
|
|
3094
3100
|
t = t || {};
|
|
3095
3101
|
let n = [];
|
|
3096
3102
|
const r = e.dl_children;
|
|
@@ -3112,7 +3118,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3112
3118
|
}, 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() {
|
|
3113
3119
|
return It.length;
|
|
3114
3120
|
}, 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) {
|
|
3115
|
-
return Ye(e) ? _ ? _(e, t) : -1 : (
|
|
3121
|
+
return Ye(e) ? _ ? _(e, t) : -1 : (Tn(`${Ze(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
3116
3122
|
}, exports.gobj_repr_global_trace_levels = function() {
|
|
3117
3123
|
return L.map(([e, t, n]) => ({
|
|
3118
3124
|
name: e,
|
|
@@ -3122,34 +3128,34 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3122
3128
|
}));
|
|
3123
3129
|
}, exports.gobj_reset_volatil_attrs = function(e) {
|
|
3124
3130
|
return function(e, t, n) {
|
|
3125
|
-
if (ot(e)) return
|
|
3131
|
+
if (ot(e)) return Tn("gobj NULL or DESTROYED"), -1;
|
|
3126
3132
|
let r = e.gclass.attrs_table;
|
|
3127
3133
|
for (let o = 0; o < r.length; o++) {
|
|
3128
3134
|
const s = r[o];
|
|
3129
|
-
s.name && (n && s.flag & n || (-1 === t || s.flag & t) && (_e(e, e.jn_attrs, s),
|
|
3135
|
+
s.name && (n && s.flag & n || (-1 === t || s.flag & t) && (_e(e, e.jn_attrs, s), nr(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)));
|
|
3130
3136
|
}
|
|
3131
3137
|
return 0;
|
|
3132
3138
|
}(e, y.SDF_VOLATIL, 0);
|
|
3133
3139
|
}, exports.gobj_save_persistent_attrs = Re, exports.gobj_search_path = bt, exports.gobj_send_event = Ut, exports.gobj_services = function() {
|
|
3134
3140
|
let e = [];
|
|
3135
|
-
for (const t of Object.keys(p))
|
|
3141
|
+
for (const t of Object.keys(p)) Qn(e, t);
|
|
3136
3142
|
return e;
|
|
3137
3143
|
}, exports.gobj_set_bottom_gobj = lt, exports.gobj_set_deep_trace = function(e) {
|
|
3138
3144
|
return F = Number(e) || 0, 0;
|
|
3139
3145
|
}, 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) {
|
|
3140
|
-
if (!e) return
|
|
3146
|
+
if (!e) return Tn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
3141
3147
|
const r = G(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3142
3148
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
3143
3149
|
}, exports.gobj_set_gobj_trace = function(e, t, n) {
|
|
3144
|
-
if (!e) return
|
|
3150
|
+
if (!e) return Tn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
3145
3151
|
const r = G(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3146
3152
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
3147
3153
|
}, exports.gobj_set_trace_machine_format = function(e) {
|
|
3148
3154
|
A = 1 === Number(e) ? 1 : 0;
|
|
3149
3155
|
}, exports.gobj_short_name = Ze, exports.gobj_start = Ce, exports.gobj_start_children = function(e) {
|
|
3150
|
-
return ot(e) ? (
|
|
3156
|
+
return ot(e) ? (Tn("gobj NULL or DESTROYED"), -1) : _t(e, R.WALK_FIRST2LAST, Le, 0, 0);
|
|
3151
3157
|
}, exports.gobj_start_tree = function(e) {
|
|
3152
|
-
return ot(e) ? (
|
|
3158
|
+
return ot(e) ? (Tn("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)));
|
|
3153
3159
|
}, exports.gobj_start_up = function(e, t, n, r, o, s, g) {
|
|
3154
3160
|
l = t, i = n, _ = r, a = o, u = s, c = g;
|
|
3155
3161
|
const p = [["EV_STATE_CHANGED", $.EVF_SYSTEM_EVENT | $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -3159,14 +3165,14 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3159
3165
|
}
|
|
3160
3166
|
return 0;
|
|
3161
3167
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
3162
|
-
return ot(e) ? (
|
|
3168
|
+
return ot(e) ? (Tn("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);
|
|
3163
3169
|
}, exports.gobj_stop = Ue, exports.gobj_stop_children = Ve, exports.gobj_stop_tree = function(e) {
|
|
3164
|
-
return ot(e) ? (
|
|
3170
|
+
return ot(e) ? (Tn("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));
|
|
3165
3171
|
}, exports.gobj_subscribe_event = Jt, exports.gobj_trace_level = M, exports.gobj_trace_machine_format = function() {
|
|
3166
3172
|
return A;
|
|
3167
3173
|
}, exports.gobj_trace_no_level = W, exports.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
3168
|
-
if (null == n && (n = {}), !e) return
|
|
3169
|
-
if (!r) return
|
|
3174
|
+
if (null == n && (n = {}), !e) return Tn(`publisher NULL: ev ${t}`), 0;
|
|
3175
|
+
if (!r) return Tn(`subscriber NULL: ev ${t}`), 0;
|
|
3170
3176
|
const o = /* @__PURE__ */ new Set([
|
|
3171
3177
|
"__config__",
|
|
3172
3178
|
"__global__",
|
|
@@ -3175,83 +3181,83 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3175
3181
|
"__service__"
|
|
3176
3182
|
]);
|
|
3177
3183
|
if (Object.keys(n).forEach((n) => {
|
|
3178
|
-
o.has(n) ||
|
|
3179
|
-
}),
|
|
3180
|
-
else if (!(At(e, t, $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & S.gcflag_no_check_output_events)) return
|
|
3184
|
+
o.has(n) || Tn(`${Ze(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
3185
|
+
}), ur(t)) t = "";
|
|
3186
|
+
else if (!(At(e, t, $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & S.gcflag_no_check_output_events)) return Tn(`event NOT in output event list: ${Ze(e)}, ev ${t}`), 0;
|
|
3181
3187
|
let s = Mt(n, t), l = Kt(e.dl_subscriptions, e, t, s.renamed_event, s.kw, r), i = 0, _ = 0, a = 0;
|
|
3182
3188
|
for (let t = 0; t < l.length; t++) {
|
|
3183
3189
|
let n = l[t], r = Bt(e, n, !1, !1);
|
|
3184
3190
|
0 === r ? i++ : r < 0 ? _++ : a++;
|
|
3185
3191
|
}
|
|
3186
|
-
return _ ?
|
|
3192
|
+
return _ ? vn(`${Ze(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${_})`) : i || a || (vn(`${Ze(e)}: No subscription found`), Vn(n, "No subscription found")), 0;
|
|
3187
3193
|
}, 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) {
|
|
3188
|
-
return "string" != typeof e ? (
|
|
3189
|
-
}, exports.id_index_in_obj_list =
|
|
3194
|
+
return "string" != typeof e ? (Tn("html_markup: not a string, type " + typeof e), new Qr("")) : new Qr(e);
|
|
3195
|
+
}, exports.id_index_in_obj_list = Fr, exports.index_in_list = oo, exports.is_array = rr, exports.is_boolean = lr, exports.is_date = function(e) {
|
|
3190
3196
|
return e instanceof Date && !isNaN(e);
|
|
3191
|
-
}, exports.is_function =
|
|
3192
|
-
if (!
|
|
3197
|
+
}, exports.is_function = _r, exports.is_gobj = ar, exports.is_html_markup = Xr, exports.is_metadata_key = function(e) {
|
|
3198
|
+
if (!or(e)) return !1;
|
|
3193
3199
|
let t = 0;
|
|
3194
3200
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3195
3201
|
return 2 === t;
|
|
3196
|
-
}, exports.is_null =
|
|
3197
|
-
if (!
|
|
3202
|
+
}, exports.is_null = ir, exports.is_number = sr, exports.is_object = nr, exports.is_private_key = function(e) {
|
|
3203
|
+
if (!or(e)) return !1;
|
|
3198
3204
|
let t = 0;
|
|
3199
3205
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3200
3206
|
return 1 === t;
|
|
3201
3207
|
}, exports.is_pure_number = function(e) {
|
|
3202
|
-
if (
|
|
3203
|
-
if (!
|
|
3208
|
+
if (sr(e)) return !0;
|
|
3209
|
+
if (!or(e)) return !1;
|
|
3204
3210
|
const t = Number(e);
|
|
3205
3211
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
3206
|
-
}, exports.is_secret_name =
|
|
3207
|
-
let o =
|
|
3208
|
-
if (!o) return
|
|
3209
|
-
if (!
|
|
3210
|
-
if (!
|
|
3211
|
-
if ("" !== n && n.split("`").includes("")) return
|
|
3212
|
+
}, exports.is_secret_name = Rn, exports.is_string = or, exports.jdb_delete = function(e, t, n, r) {
|
|
3213
|
+
let o = Nr(null, Nr(null, e, "topics", null, 0), t, null, 0);
|
|
3214
|
+
if (!o) return Tn("jdb_delete: topic not found: " + t), null;
|
|
3215
|
+
if (!nr(r) || ur(r.id)) return Tn(`jdb_delete: record without id: ${dn(r)}`), null;
|
|
3216
|
+
if (!or(n)) return Tn(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
3217
|
+
if ("" !== n && n.split("`").includes("")) return Tn(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
3212
3218
|
let s, l = n.split("`"), i = o;
|
|
3213
|
-
for (; (s = l.shift()) && !
|
|
3214
|
-
if (!i || 0 !== l.length) return
|
|
3215
|
-
let _ =
|
|
3216
|
-
return a < 0 ? (
|
|
3219
|
+
for (; (s = l.shift()) && !ur(s) && i;) nr(i) && (i = Nr(null, i, e.hook, null, 0)), i = qr(i, null, s, !1);
|
|
3220
|
+
if (!i || 0 !== l.length) return Tn(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
3221
|
+
let _ = rr(i) ? i : Nr(null, i, e.hook, null, 0), a = Fr(_, r.id);
|
|
3222
|
+
return a < 0 ? (Tn(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (_.splice(a, 1), o);
|
|
3217
3223
|
}, exports.jdb_get = function(e, t, n, r) {
|
|
3218
|
-
let o =
|
|
3219
|
-
return o ? (void 0 === r && (r = !0),
|
|
3224
|
+
let o = Nr(null, Nr(null, e, "topics", null, 0), t, null, 0);
|
|
3225
|
+
return o ? (void 0 === r && (r = !0), qr(o, e.hook, n, r)) : (Tn("jdb_get: topic not found: " + t), null);
|
|
3220
3226
|
}, exports.jdb_get_by_idx = function(e, t, n) {
|
|
3221
|
-
let r =
|
|
3222
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
3227
|
+
let r = Nr(null, Nr(null, e, "topics", null, 0), t, null, 0);
|
|
3228
|
+
return r ? n < r.length ? r[n] : {} : (Tn("jdb_get_by_idx: topic not found: " + t), null);
|
|
3223
3229
|
}, exports.jdb_get_topic = function(e, t) {
|
|
3224
|
-
let n =
|
|
3225
|
-
if (!n) return
|
|
3226
|
-
return
|
|
3230
|
+
let n = Nr(null, e, "topics", null, 0);
|
|
3231
|
+
if (!n) return Tn("jdb topics section not found"), On(e), null;
|
|
3232
|
+
return Nr(null, n, t, null, 0) || (Tn("jdb topic not found: " + t), On(n), null);
|
|
3227
3233
|
}, exports.jdb_init = function(e, t, n) {
|
|
3228
|
-
n && (e =
|
|
3229
|
-
let r =
|
|
3230
|
-
|
|
3231
|
-
let o =
|
|
3232
|
-
return
|
|
3233
|
-
"__" === t.substring(0, 2) ||
|
|
3234
|
+
n && (e = Gn(e));
|
|
3235
|
+
let r = Nr(null, e, "type", [], Xt.KW_CREATE);
|
|
3236
|
+
Or(null, e, "hook", "data", Xt.KW_CREATE);
|
|
3237
|
+
let o = Nr(null, e, "schema", {}, Xt.KW_CREATE), s = Nr(null, e, "topics", {}, Xt.KW_CREATE);
|
|
3238
|
+
return Jr(o, function(e, t, n, o) {
|
|
3239
|
+
"__" === t.substring(0, 2) || nr(n) || Nr(null, s, o, Gn(r), Xt.KW_CREATE);
|
|
3234
3240
|
}, t), e;
|
|
3235
3241
|
}, exports.jdb_update = function(e, t, n, r) {
|
|
3236
|
-
let o =
|
|
3237
|
-
if (!o) return
|
|
3238
|
-
if (!
|
|
3239
|
-
if (!
|
|
3240
|
-
if ("" !== n && n.split("`").includes("")) return
|
|
3242
|
+
let o = Nr(null, Nr(null, e, "topics", null, 0), t, null, 0);
|
|
3243
|
+
if (!o) return Tn("jdb_update: topic not found: " + t), null;
|
|
3244
|
+
if (!nr(r) || ur(r.id)) return Tn(`jdb_update: record without id: ${dn(r)}`), null;
|
|
3245
|
+
if (!or(n)) return Tn(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
3246
|
+
if ("" !== n && n.split("`").includes("")) return Tn(`jdb_update: empty segment in path: '${n}'`), null;
|
|
3241
3247
|
let s, l, i = n.split("`"), _ = o;
|
|
3242
|
-
for (; (s = i.shift()) && !
|
|
3243
|
-
if (!_ || 0 !== i.length) return
|
|
3244
|
-
if (
|
|
3248
|
+
for (; (s = i.shift()) && !ur(s) && _;) nr(_) && (_ = Nr(null, _, e.hook, null, 0)), _ = qr(_, null, s, !1);
|
|
3249
|
+
if (!_ || 0 !== i.length) return Tn(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
3250
|
+
if (rr(_)) l = _;
|
|
3245
3251
|
else {
|
|
3246
|
-
if (_.id === r.id) return
|
|
3247
|
-
if (l =
|
|
3248
|
-
else if (!
|
|
3252
|
+
if (_.id === r.id) return Wn(_, r), o;
|
|
3253
|
+
if (l = Nr(null, _, e.hook, null, 0), null == l) l = [], qn(_, e.hook, l);
|
|
3254
|
+
else if (!rr(l)) return Tn(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
3249
3255
|
}
|
|
3250
|
-
let a =
|
|
3251
|
-
return a ?
|
|
3256
|
+
let a = qr(l, e.hook, r.id, !1);
|
|
3257
|
+
return a ? Wn(a, r) : l.push(r), o;
|
|
3252
3258
|
}, exports.json2flat = function(e) {
|
|
3253
3259
|
const t = {}, n = (e, r, o) => {
|
|
3254
|
-
if (o >
|
|
3260
|
+
if (o > io) throw new Error("json2flat: deeper than 256");
|
|
3255
3261
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
3256
3262
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
3257
3263
|
const s = `[${t}]`;
|
|
@@ -3261,20 +3267,20 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3261
3267
|
const t = Object.keys(e);
|
|
3262
3268
|
if (t.length > 0) {
|
|
3263
3269
|
for (const s of t) {
|
|
3264
|
-
const t =
|
|
3270
|
+
const t = ao(s);
|
|
3265
3271
|
n(e[s], 0 === o ? t : r + "`" + t, o + 1);
|
|
3266
3272
|
}
|
|
3267
3273
|
return;
|
|
3268
3274
|
}
|
|
3269
3275
|
}
|
|
3270
|
-
0 !== o &&
|
|
3276
|
+
0 !== o && hr(t, r, e);
|
|
3271
3277
|
};
|
|
3272
3278
|
return null == e || n(e, "", 0), t;
|
|
3273
|
-
}, exports.json_array_append =
|
|
3279
|
+
}, exports.json_array_append = zn, exports.json_array_append_new = Qn, exports.json_array_extend = function(e, t) {
|
|
3274
3280
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
3275
|
-
}, exports.json_array_remove =
|
|
3281
|
+
}, exports.json_array_remove = Xn, exports.json_array_size = er, exports.json_deep_copy = Gn, exports.json_is_identical = Mn, exports.json_mask_secrets = Fn, exports.json_object_del = Jn, exports.json_object_get = Bn, exports.json_object_set = qn, exports.json_object_set_new = Hn, exports.json_object_size = Zn, exports.json_object_update = Wn, exports.json_object_update_existing = Kn, exports.json_object_update_missing = Yn, exports.json_size = tr, exports.jwt2json = function(e, t) {
|
|
3276
3282
|
try {
|
|
3277
|
-
let n =
|
|
3283
|
+
let n = Hr(e);
|
|
3278
3284
|
switch (t) {
|
|
3279
3285
|
case "header": return JSON.parse(n.header);
|
|
3280
3286
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -3283,137 +3289,137 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3283
3289
|
} catch (e) {
|
|
3284
3290
|
return null;
|
|
3285
3291
|
}
|
|
3286
|
-
}, exports.jwtDecode =
|
|
3287
|
-
if (e && !
|
|
3288
|
-
r || (r =
|
|
3292
|
+
}, exports.jwtDecode = Hr, exports.kw_clone_by_keys = kr, exports.kw_clone_by_not_keys = Ar, exports.kw_collect = function(e, t, n, r) {
|
|
3293
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !t) return null;
|
|
3294
|
+
r || (r = Dr);
|
|
3289
3295
|
let o = [];
|
|
3290
|
-
if (
|
|
3296
|
+
if (rr(t)) for (let e = 0; e < t.length; e++) {
|
|
3291
3297
|
let s = t[e];
|
|
3292
3298
|
r(s, n) && o.push(s);
|
|
3293
3299
|
}
|
|
3294
3300
|
else {
|
|
3295
|
-
if (!
|
|
3301
|
+
if (!nr(t)) return Tn("kw_select() BAD kw parameter"), null;
|
|
3296
3302
|
r(t, n) && o.push(t);
|
|
3297
3303
|
}
|
|
3298
3304
|
return o;
|
|
3299
|
-
}, exports.kw_delete =
|
|
3300
|
-
if (!n || !
|
|
3301
|
-
for (let e = 0; e < t.length; e++) if (
|
|
3302
|
-
return r &&
|
|
3303
|
-
}, exports.kw_find_path =
|
|
3304
|
-
e && !
|
|
3305
|
-
let s =
|
|
3305
|
+
}, exports.kw_delete = Tr, exports.kw_find_json_in_list = function(e, t, n, r) {
|
|
3306
|
+
if (!n || !rr(t)) return r && Tn("item NULL or kw_list is not a list"), -1;
|
|
3307
|
+
for (let e = 0; e < t.length; e++) if (Mn(n, t[e])) return e;
|
|
3308
|
+
return r && Tn("item not found in this list"), -1;
|
|
3309
|
+
}, exports.kw_find_path = Er, exports.kw_flag_t = Xt, exports.kw_get_bool = vr, exports.kw_get_dict = wr, exports.kw_get_dict_value = Nr, exports.kw_get_int = jr, exports.kw_get_list = function(e, t, n, r, o) {
|
|
3310
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
3311
|
+
let s = Er(e, t, n, !1);
|
|
3306
3312
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
3307
|
-
return void 0 === s ? i &&
|
|
3308
|
-
}, exports.kw_get_local_storage_value =
|
|
3309
|
-
e && !
|
|
3310
|
-
let s =
|
|
3313
|
+
return void 0 === s ? i && rr(r) && t ? ($r(e, t, n, r), r) : (l && (Tn(`path not found: '${n}'`), Vn(t)), r) : rr(s) ? (_ && Tr(e, t, n), s) : i && null === s && rr(r) ? ($r(e, t, n, r), r) : i && null === s ? (l && (Tn(`path not found: '${n}'`), Vn(t)), r) : ((l || i) && (Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a json list: '${n}'` + (i ? ", cannot create" : "")), Vn(t)), r);
|
|
3314
|
+
}, exports.kw_get_local_storage_value = Ir, exports.kw_get_pointer = Sr, exports.kw_get_real = function(e, t, n, r, o) {
|
|
3315
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
3316
|
+
let s = Er(e, t, n, !1);
|
|
3311
3317
|
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;
|
|
3312
3318
|
if (void 0 === s) {
|
|
3313
3319
|
if (i && t) {
|
|
3314
3320
|
let o = Number(r);
|
|
3315
|
-
return
|
|
3321
|
+
return $r(e, t, n, o), o;
|
|
3316
3322
|
}
|
|
3317
|
-
return l && (
|
|
3323
|
+
return l && (Tn(`path not found: '${n}'`), Vn(t)), Number(r);
|
|
3318
3324
|
}
|
|
3319
3325
|
let u;
|
|
3320
|
-
if (
|
|
3326
|
+
if (sr(s)) u = s;
|
|
3321
3327
|
else {
|
|
3322
|
-
if (!a) return
|
|
3323
|
-
if (
|
|
3324
|
-
else if (
|
|
3328
|
+
if (!a) return Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a json real: '${n}'`), Vn(t), Number(r);
|
|
3329
|
+
if (lr(s)) u = s ? 1 : 0;
|
|
3330
|
+
else if (or(s)) u = parseFloat(s), Number.isNaN(u) && (u = 0);
|
|
3325
3331
|
else {
|
|
3326
|
-
if (null !== s) return
|
|
3332
|
+
if (null !== s) return Tn(`${e ? Ze(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Vn(t), 0;
|
|
3327
3333
|
u = 0;
|
|
3328
3334
|
}
|
|
3329
3335
|
}
|
|
3330
|
-
return _ &&
|
|
3331
|
-
}, exports.kw_get_str =
|
|
3332
|
-
if (e && !
|
|
3333
|
-
r || (r =
|
|
3336
|
+
return _ && Tr(e, t, n), u;
|
|
3337
|
+
}, exports.kw_get_str = Or, exports.kw_has_key = br, exports.kw_match_simple = Dr, exports.kw_pop = dr, exports.kw_remove_local_storage_value = Lr, exports.kw_select = function(e, t, n, r) {
|
|
3338
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !t) return null;
|
|
3339
|
+
r || (r = Dr);
|
|
3334
3340
|
let o = [];
|
|
3335
|
-
if (
|
|
3341
|
+
if (rr(t)) for (let e = 0; e < t.length; e++) {
|
|
3336
3342
|
let s = t[e];
|
|
3337
|
-
r(s, n) && o.push(
|
|
3343
|
+
r(s, n) && o.push(Gn(s));
|
|
3338
3344
|
}
|
|
3339
3345
|
else {
|
|
3340
|
-
if (!
|
|
3341
|
-
r(t, n) && o.push(
|
|
3346
|
+
if (!nr(t)) return Tn("kw_select() BAD kw parameter"), null;
|
|
3347
|
+
r(t, n) && o.push(Gn(t));
|
|
3342
3348
|
}
|
|
3343
3349
|
return o;
|
|
3344
|
-
}, exports.kw_set_dict_value =
|
|
3345
|
-
e && !
|
|
3346
|
-
let s =
|
|
3350
|
+
}, exports.kw_set_dict_value = $r, exports.kw_set_local_storage_value = Cr, exports.kw_set_subdict_value = Rr, exports.kwid_collect = Ur, exports.kwid_find_one_record = function(e, t, n, r, o) {
|
|
3351
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
3352
|
+
let s = Ur(e, t, n, r, o);
|
|
3347
3353
|
return s && 0 !== s.length ? s[0] : null;
|
|
3348
3354
|
}, exports.kwid_get_ids = function(e, t) {
|
|
3349
|
-
if (e && !
|
|
3355
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !t) return [];
|
|
3350
3356
|
let n = [];
|
|
3351
|
-
if (
|
|
3352
|
-
else if (
|
|
3353
|
-
else
|
|
3354
|
-
if (
|
|
3355
|
-
else if (
|
|
3356
|
-
let r =
|
|
3357
|
+
if (or(t)) n.push(t);
|
|
3358
|
+
else if (nr(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
3359
|
+
else rr(t) && t.forEach(function(t) {
|
|
3360
|
+
if (or(t)) ur(t) || n.push(t);
|
|
3361
|
+
else if (nr(t)) {
|
|
3362
|
+
let r = Or(e, t, "id", 0, 0);
|
|
3357
3363
|
r && n.push(r);
|
|
3358
3364
|
}
|
|
3359
3365
|
});
|
|
3360
3366
|
return n;
|
|
3361
|
-
}, exports.kwid_match_id =
|
|
3362
|
-
e && !
|
|
3367
|
+
}, exports.kwid_match_id = Pr, exports.kwid_new_dict = function(e, t, n) {
|
|
3368
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
3363
3369
|
let r = {};
|
|
3364
|
-
if (
|
|
3365
|
-
else if (
|
|
3366
|
-
let o = t[n], s =
|
|
3367
|
-
|
|
3370
|
+
if (ur(n) || (t = Er(e, t, n)), nr(t)) r = t;
|
|
3371
|
+
else if (rr(t)) for (let n = 0; n < t.length; n++) {
|
|
3372
|
+
let o = t[n], s = Or(e, o, "id", "", Xt.KW_REQUIRED);
|
|
3373
|
+
ur(s) || hr(r, s, o);
|
|
3368
3374
|
}
|
|
3369
|
-
else
|
|
3375
|
+
else Tn(`${Ze(e)} kwid_new_dict: data type unknown`);
|
|
3370
3376
|
return r;
|
|
3371
3377
|
}, exports.kwid_new_list = function(e, t, n) {
|
|
3372
|
-
if (e && !
|
|
3373
|
-
if (
|
|
3378
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), ur(n) || (t = Er(e, t, n)), rr(t)) return t;
|
|
3379
|
+
if (nr(t)) {
|
|
3374
3380
|
let n = [];
|
|
3375
3381
|
for (let r of Object.keys(t)) {
|
|
3376
3382
|
let o = t[r];
|
|
3377
|
-
|
|
3383
|
+
nr(o) ? (o.id = r, n.push(o)) : Tn(`${Ze(e)} kwid_new_list: not a record: '${r}'`);
|
|
3378
3384
|
}
|
|
3379
3385
|
return n;
|
|
3380
3386
|
}
|
|
3381
|
-
return
|
|
3387
|
+
return Tn(`${Ze(e)} kwid_new_list: wrong type for list`), [];
|
|
3382
3388
|
}, exports.list2options = function(e, t, n) {
|
|
3383
3389
|
t = t || "id", n = n || "value";
|
|
3384
3390
|
let r = [];
|
|
3385
|
-
if (
|
|
3391
|
+
if (rr(e)) for (let o = 0; o < e.length; o++) {
|
|
3386
3392
|
let s = e[o];
|
|
3387
|
-
if (
|
|
3393
|
+
if (or(s)) r.push({
|
|
3388
3394
|
id: e[o],
|
|
3389
3395
|
value: e[o]
|
|
3390
3396
|
});
|
|
3391
|
-
else if (
|
|
3397
|
+
else if (nr(s)) {
|
|
3392
3398
|
let e = {};
|
|
3393
|
-
if (
|
|
3394
|
-
if (!
|
|
3395
|
-
if (!(
|
|
3396
|
-
|
|
3399
|
+
if (br(s, t)) {
|
|
3400
|
+
if (!br(s, n)) {
|
|
3401
|
+
if (!(tr(s) > 0)) {
|
|
3402
|
+
Tn("list2options(): object without field value: " + n);
|
|
3397
3403
|
continue;
|
|
3398
3404
|
}
|
|
3399
3405
|
n = Object.keys(s)[0];
|
|
3400
3406
|
}
|
|
3401
3407
|
e.id = s[t], e.value = s[n];
|
|
3402
3408
|
} else {
|
|
3403
|
-
if (!(
|
|
3404
|
-
|
|
3409
|
+
if (!(tr(s) > 0)) {
|
|
3410
|
+
Tn("list2options(): object without field id: " + t);
|
|
3405
3411
|
continue;
|
|
3406
3412
|
}
|
|
3407
3413
|
t = Object.keys(s)[0], e.id = t, e.value = s[t];
|
|
3408
3414
|
}
|
|
3409
3415
|
r.push(e);
|
|
3410
|
-
} else
|
|
3416
|
+
} else Tn("list2options(): case1 not implemented");
|
|
3411
3417
|
}
|
|
3412
|
-
else if (
|
|
3418
|
+
else if (nr(e)) for (let t of Object.keys(e)) r.push({
|
|
3413
3419
|
id: t,
|
|
3414
3420
|
value: t
|
|
3415
3421
|
});
|
|
3416
|
-
else
|
|
3422
|
+
else Tn("list2options(): case2 not implemented");
|
|
3417
3423
|
return r;
|
|
3418
3424
|
}, exports.load_json_file = function(e, t, n) {
|
|
3419
3425
|
let r = new XMLHttpRequest();
|
|
@@ -3421,18 +3427,18 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3421
3427
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
3422
3428
|
t(JSON.parse(r.responseText));
|
|
3423
3429
|
} catch (e) {
|
|
3424
|
-
n && (
|
|
3430
|
+
n && (Tn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
3425
3431
|
}
|
|
3426
3432
|
else n && n(r.status);
|
|
3427
3433
|
var e;
|
|
3428
3434
|
}, r.send();
|
|
3429
|
-
}, exports.log_debug =
|
|
3430
|
-
let n = hn(e, ...t), r =
|
|
3431
|
-
nn && un("info", n) &&
|
|
3432
|
-
}, exports.log_warning =
|
|
3435
|
+
}, exports.log_debug = jn, exports.log_error = Tn, exports.log_info = function(e, ...t) {
|
|
3436
|
+
let n = hn(e, ...t), r = ro();
|
|
3437
|
+
nn && un("info", n) && En(nn, "%c" + r + " INFO: " + String(n), "color:cyan"), fn("info", n, r);
|
|
3438
|
+
}, exports.log_warning = vn, exports.mask_secrets_inline = In, exports.msg_iev_get_msg_type = Br, exports.msg_iev_get_stack = Kr, exports.msg_iev_push_stack = Wr, exports.msg_iev_read_key = Gr, exports.msg_iev_set_msg_type = Yr, exports.msg_iev_write_key = Mr, exports.node_uuid = so, exports.parseBoolean = cr, exports.parseSVG = function(e) {
|
|
3433
3439
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3434
3440
|
}, exports.refresh_language = function(e, t) {
|
|
3435
|
-
if (!
|
|
3441
|
+
if (!_r(t)) return void Tn("You must supply a translation function");
|
|
3436
3442
|
e || (e = document);
|
|
3437
3443
|
const n = (t) => {
|
|
3438
3444
|
let n = [];
|
|
@@ -3456,22 +3462,22 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3456
3462
|
});
|
|
3457
3463
|
}, exports.register_c_ievent_cli = function() {
|
|
3458
3464
|
return function(e) {
|
|
3459
|
-
if (
|
|
3465
|
+
if (Vo) return Tn(`GClass ALREADY created: ${e}`), -1;
|
|
3460
3466
|
const t = [
|
|
3461
3467
|
["ST_DISCONNECTED", [
|
|
3462
3468
|
[
|
|
3463
3469
|
"EV_ON_OPEN",
|
|
3464
|
-
|
|
3470
|
+
zo,
|
|
3465
3471
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3466
3472
|
],
|
|
3467
3473
|
[
|
|
3468
3474
|
"EV_ON_CLOSE",
|
|
3469
|
-
|
|
3475
|
+
Qo,
|
|
3470
3476
|
null
|
|
3471
3477
|
],
|
|
3472
3478
|
[
|
|
3473
3479
|
"EV_TIMEOUT",
|
|
3474
|
-
|
|
3480
|
+
Ho,
|
|
3475
3481
|
null
|
|
3476
3482
|
],
|
|
3477
3483
|
[
|
|
@@ -3483,22 +3489,22 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3483
3489
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3484
3490
|
[
|
|
3485
3491
|
"EV_ON_MESSAGE",
|
|
3486
|
-
|
|
3492
|
+
ts,
|
|
3487
3493
|
null
|
|
3488
3494
|
],
|
|
3489
3495
|
[
|
|
3490
3496
|
"EV_IDENTITY_CARD_ACK",
|
|
3491
|
-
|
|
3497
|
+
es,
|
|
3492
3498
|
null
|
|
3493
3499
|
],
|
|
3494
3500
|
[
|
|
3495
3501
|
"EV_ON_CLOSE",
|
|
3496
|
-
|
|
3502
|
+
Qo,
|
|
3497
3503
|
"ST_DISCONNECTED"
|
|
3498
3504
|
],
|
|
3499
3505
|
[
|
|
3500
3506
|
"EV_TIMEOUT",
|
|
3501
|
-
|
|
3507
|
+
Zo,
|
|
3502
3508
|
null
|
|
3503
3509
|
],
|
|
3504
3510
|
[
|
|
@@ -3510,22 +3516,22 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3510
3516
|
["ST_SESSION", [
|
|
3511
3517
|
[
|
|
3512
3518
|
"EV_ON_MESSAGE",
|
|
3513
|
-
|
|
3519
|
+
ts,
|
|
3514
3520
|
null
|
|
3515
3521
|
],
|
|
3516
3522
|
[
|
|
3517
3523
|
"EV_MT_STATS",
|
|
3518
|
-
|
|
3524
|
+
ns,
|
|
3519
3525
|
null
|
|
3520
3526
|
],
|
|
3521
3527
|
[
|
|
3522
3528
|
"EV_MT_COMMAND",
|
|
3523
|
-
|
|
3529
|
+
rs,
|
|
3524
3530
|
null
|
|
3525
3531
|
],
|
|
3526
3532
|
[
|
|
3527
3533
|
"EV_ON_CLOSE",
|
|
3528
|
-
|
|
3534
|
+
Qo,
|
|
3529
3535
|
"ST_DISCONNECTED"
|
|
3530
3536
|
],
|
|
3531
3537
|
[
|
|
@@ -3536,7 +3542,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3536
3542
|
]],
|
|
3537
3543
|
[null, null]
|
|
3538
3544
|
];
|
|
3539
|
-
return (
|
|
3545
|
+
return (Vo = ge(e, [
|
|
3540
3546
|
["EV_ON_MESSAGE", $.EVF_OUTPUT_EVENT],
|
|
3541
3547
|
["EV_IDENTITY_CARD_ACK", $.EVF_PUBLIC_EVENT],
|
|
3542
3548
|
["EV_ON_ID_NAK", $.EVF_PUBLIC_EVENT | $.EVF_OUTPUT_EVENT],
|
|
@@ -3547,36 +3553,36 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3547
3553
|
["EV_ON_OPEN_ERROR", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3548
3554
|
["EV_TIMEOUT", 0],
|
|
3549
3555
|
[null, 0]
|
|
3550
|
-
], t,
|
|
3556
|
+
], t, os, 0, Lo, Fo, 0, 0, Po, S.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3551
3557
|
}("C_IEVENT_CLI");
|
|
3552
3558
|
}, exports.register_c_timer = function() {
|
|
3553
3559
|
return function(e) {
|
|
3554
|
-
if (
|
|
3560
|
+
if (To) return Tn(`GClass ALREADY created: ${e}`), -1;
|
|
3555
3561
|
const t = [["ST_IDLE", [[
|
|
3556
3562
|
"EV_TIMEOUT",
|
|
3557
|
-
|
|
3563
|
+
vo,
|
|
3558
3564
|
null
|
|
3559
3565
|
]]]];
|
|
3560
|
-
return (
|
|
3566
|
+
return (To = ge(e, [
|
|
3561
3567
|
["EV_TIMEOUT", $.EVF_OUTPUT_EVENT],
|
|
3562
3568
|
["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT],
|
|
3563
3569
|
[0, 0]
|
|
3564
|
-
], t,
|
|
3570
|
+
], t, jo, 0, yo, Eo, 0, 0, 0, S.gcflag_manual_start)) ? 0 : -1;
|
|
3565
3571
|
}("C_TIMER");
|
|
3566
3572
|
}, exports.register_c_yuno = function() {
|
|
3567
3573
|
return function(e) {
|
|
3568
|
-
if (
|
|
3574
|
+
if (Ro) return Tn(`GClass ALREADY created: ${e}`), -1;
|
|
3569
3575
|
const t = [["ST_IDLE", [[
|
|
3570
3576
|
"EV_TIMEOUT_PERIODIC",
|
|
3571
|
-
|
|
3577
|
+
Ao,
|
|
3572
3578
|
null
|
|
3573
3579
|
]]]];
|
|
3574
|
-
return (
|
|
3580
|
+
return (Ro = ge(e, [["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS], [0, 0]], t, Io, 0, No, $o, 0, 0, 0, 0)) ? 0 : -1;
|
|
3575
3581
|
}("C_YUNO");
|
|
3576
3582
|
}, exports.safeSrc = function(e) {
|
|
3577
3583
|
if (!e) return "";
|
|
3578
3584
|
const t = String(e).trim();
|
|
3579
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3585
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : zr(t);
|
|
3580
3586
|
}, exports.sdata_flag_t = y, exports.send_http_json_post = function(e, t, n) {
|
|
3581
3587
|
let r = new XMLHttpRequest();
|
|
3582
3588
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -3600,16 +3606,16 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3600
3606
|
}
|
|
3601
3607
|
} else on = e;
|
|
3602
3608
|
}, exports.set_remote_log_functions = pn, exports.set_strings_are_text = function(e) {
|
|
3603
|
-
|
|
3604
|
-
}, exports.set_timeout =
|
|
3605
|
-
return
|
|
3609
|
+
eo = !!e;
|
|
3610
|
+
}, exports.set_timeout = Oo, exports.set_timeout_periodic = So, exports.sprintf = t, exports.stats_parser = function(e, t, n, r) {}, exports.str_in_list = Vr, exports.strcasecmp = gr, exports.strcmp = fr, exports.strings_are_text = function() {
|
|
3611
|
+
return eo;
|
|
3606
3612
|
}, exports.strncmp = function(e, t, n) {
|
|
3607
3613
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
3608
3614
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
3609
3615
|
}, exports.strs_in_list = function(e, t, n) {
|
|
3610
|
-
if (!e) return
|
|
3611
|
-
if (!t) return
|
|
3612
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3616
|
+
if (!e) return Tn("ERROR: strs_in_list() list empty"), !1;
|
|
3617
|
+
if (!t) return Tn("ERROR: strs_in_list() str empty"), !1;
|
|
3618
|
+
for (let r = 0; r < t.length; r++) if (Vr(e, t[r], n)) return !0;
|
|
3613
3619
|
return !1;
|
|
3614
3620
|
}, exports.strstr = function(e, t, n) {
|
|
3615
3621
|
var r;
|
|
@@ -3628,13 +3634,13 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3628
3634
|
placeholder: void 0,
|
|
3629
3635
|
fkey: null
|
|
3630
3636
|
};
|
|
3631
|
-
if (
|
|
3637
|
+
if (or(t)) {
|
|
3632
3638
|
let e = t.split(".");
|
|
3633
3639
|
for (let t = 0; t < e.length; t++) {
|
|
3634
3640
|
let r = e[t];
|
|
3635
|
-
if (
|
|
3636
|
-
else if (
|
|
3637
|
-
else if (
|
|
3641
|
+
if (Vr(po, r)) n.real_type || (n.real_type = r);
|
|
3642
|
+
else if (Vr(mo, r)) n.type || (n.type = r);
|
|
3643
|
+
else if (Vr(bo, r)) switch (r) {
|
|
3638
3644
|
case "writable":
|
|
3639
3645
|
n.is_writable = !0;
|
|
3640
3646
|
break;
|
|
@@ -3646,23 +3652,23 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3646
3652
|
}
|
|
3647
3653
|
}
|
|
3648
3654
|
n.real_type || (n.real_type = "string");
|
|
3649
|
-
} else
|
|
3655
|
+
} else nr(t) ? (n = ho(t), n.name || (n.name = e), n.header || (n.header = e)) : rr(t) && (n.real_type = "array", n.enum_list = t);
|
|
3650
3656
|
return n.type || (n.type = n.real_type), n;
|
|
3651
3657
|
}, exports.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3652
3658
|
const n = e, r = performance.now();
|
|
3653
3659
|
let o = r;
|
|
3654
|
-
return t &&
|
|
3660
|
+
return t && vn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", s = "") => {
|
|
3655
3661
|
const l = performance.now(), i = (l - o) / 1e3, _ = (l - r) / 1e3;
|
|
3656
|
-
return t &&
|
|
3662
|
+
return t && vn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${s}`), o = l, {
|
|
3657
3663
|
partial: i,
|
|
3658
3664
|
total: _
|
|
3659
3665
|
};
|
|
3660
3666
|
} };
|
|
3661
|
-
}, exports.trace_json =
|
|
3662
|
-
if (
|
|
3667
|
+
}, exports.trace_json = Sn, exports.trace_json_masked = Vn, exports.trace_level_t = C, exports.trace_msg = On, exports.treedb_decoder_fkey = go, exports.treedb_decoder_hook = function(e, t) {
|
|
3668
|
+
if (or(t)) {
|
|
3663
3669
|
if (-1 === t.indexOf("^")) {
|
|
3664
3670
|
let n, r = e.hook;
|
|
3665
|
-
if (1 !==
|
|
3671
|
+
if (1 !== Zn(r)) return Tn("bad hook 1"), Tn(e), Tn(t), null;
|
|
3666
3672
|
for (let e of Object.keys(r)) {
|
|
3667
3673
|
n = e, r[e];
|
|
3668
3674
|
break;
|
|
@@ -3674,25 +3680,25 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3674
3680
|
}
|
|
3675
3681
|
{
|
|
3676
3682
|
let n = t.split("^");
|
|
3677
|
-
return 2 !== n.length ? (
|
|
3683
|
+
return 2 !== n.length ? (Tn("bad hook 2"), Tn(e), Tn(t), null) : {
|
|
3678
3684
|
topic_name: n[0],
|
|
3679
3685
|
id: n[1]
|
|
3680
3686
|
};
|
|
3681
3687
|
}
|
|
3682
3688
|
}
|
|
3683
|
-
return
|
|
3689
|
+
return nr(t) ? {
|
|
3684
3690
|
topic_name: t.topic_name,
|
|
3685
3691
|
id: t.id
|
|
3686
|
-
} : (
|
|
3692
|
+
} : (Tn("bad hook 3"), Tn(e), Tn(t), null);
|
|
3687
3693
|
}, exports.treedb_encoder_fkey = function(e, t) {
|
|
3688
|
-
let n =
|
|
3694
|
+
let n = go(e, t);
|
|
3689
3695
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3690
|
-
}, exports.treedb_get_field_desc =
|
|
3691
|
-
if (
|
|
3696
|
+
}, exports.treedb_get_field_desc = ho, exports.treedb_hook_data_size = function(e) {
|
|
3697
|
+
if (rr(e) && 1 === tr(e)) {
|
|
3692
3698
|
let t = e[0];
|
|
3693
|
-
return
|
|
3699
|
+
return br(t, "size") ? t.size : 1;
|
|
3694
3700
|
}
|
|
3695
|
-
return
|
|
3701
|
+
return tr(e);
|
|
3696
3702
|
}, exports.vsprintf = function(e, n) {
|
|
3697
3703
|
return t.apply(null, [e].concat(n || []));
|
|
3698
3704
|
}, exports.walk_type_t = R;
|