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