@yuneta/gobj-js 7.13.4 → 7.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-js.cjs.js +28 -5
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +861 -858
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +28 -6
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +896 -893
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +28 -5
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +861 -858
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +28 -5
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +861 -858
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.cjs.min.js
CHANGED
|
@@ -175,7 +175,7 @@ var h = class {
|
|
|
175
175
|
}
|
|
176
176
|
}, S = class {
|
|
177
177
|
constructor(e, t, n, r, o) {
|
|
178
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(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 =
|
|
178
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(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 = Qt(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
179
179
|
}
|
|
180
180
|
}, O = Object.freeze({
|
|
181
181
|
gcflag_manual_start: 1,
|
|
@@ -221,7 +221,7 @@ var h = class {
|
|
|
221
221
|
};
|
|
222
222
|
var I = 0;
|
|
223
223
|
function $(e) {
|
|
224
|
-
|
|
224
|
+
gn(e) && (e = JSON.stringify(e)), qt(" ".repeat(Math.max(1, 2 * m)) + String(e));
|
|
225
225
|
}
|
|
226
226
|
var C = Object.freeze({
|
|
227
227
|
TRACE_MACHINE: 65536,
|
|
@@ -317,7 +317,7 @@ var C = Object.freeze({
|
|
|
317
317
|
]
|
|
318
318
|
], P = 0, U = 0, F = 0;
|
|
319
319
|
function G(e, t) {
|
|
320
|
-
if (
|
|
320
|
+
if (yn(e)) return 268369920;
|
|
321
321
|
if (/^[0-9]+$/.test(String(e))) {
|
|
322
322
|
const t = Number(e);
|
|
323
323
|
if (t) return t;
|
|
@@ -325,7 +325,7 @@ function G(e, t) {
|
|
|
325
325
|
return function(e) {
|
|
326
326
|
for (const [t, n] of L) if (t === e) return n;
|
|
327
327
|
return 0;
|
|
328
|
-
}(String(e)) || (
|
|
328
|
+
}(String(e)) || (Bt(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
329
329
|
}
|
|
330
330
|
function V(e) {
|
|
331
331
|
if (F) return 4294967295;
|
|
@@ -339,11 +339,11 @@ function M(e) {
|
|
|
339
339
|
function W() {
|
|
340
340
|
if (!d || !d.jn_attrs) return 0;
|
|
341
341
|
let e = 0;
|
|
342
|
-
if (
|
|
343
|
-
const t = Number(
|
|
342
|
+
if (rt(d, "tracing")) {
|
|
343
|
+
const t = Number(ot(d, "tracing")) || 0;
|
|
344
344
|
t >= 1 && (e |= C.TRACE_MACHINE), t >= 2 && (e |= C.TRACE_EV_KW);
|
|
345
345
|
}
|
|
346
|
-
return
|
|
346
|
+
return rt(d, "trace_timer") && ot(d, "trace_timer") && (e |= C.TRACE_TIMER), rt(d, "trace_creation") && ot(d, "trace_creation") && (e |= C.TRACE_CREATE_DELETE), rt(d, "trace_start_stop") && ot(d, "trace_start_stop") && (e |= C.TRACE_START_STOP), e;
|
|
347
347
|
}
|
|
348
348
|
function K(e) {
|
|
349
349
|
return (V(e) | W()) & C.TRACE_CREATE_DELETE;
|
|
@@ -365,7 +365,7 @@ function J(e, t) {
|
|
|
365
365
|
}
|
|
366
366
|
function q(e, t) {
|
|
367
367
|
let n = {};
|
|
368
|
-
if (!
|
|
368
|
+
if (!pn(t)) return Bt("sdata_desc MUST be an array"), zt(t), n;
|
|
369
369
|
for (let r = 0; r < t.length; r++) {
|
|
370
370
|
const o = t[r];
|
|
371
371
|
o.name && H(e, n, o);
|
|
@@ -379,133 +379,133 @@ function H(e, t, n) {
|
|
|
379
379
|
r = String(o);
|
|
380
380
|
break;
|
|
381
381
|
case E.DTP_BOOLEAN:
|
|
382
|
-
r =
|
|
382
|
+
r = vn(o);
|
|
383
383
|
break;
|
|
384
384
|
case E.DTP_INTEGER:
|
|
385
|
-
r = parseInt(o), isNaN(r) &&
|
|
385
|
+
r = parseInt(o), isNaN(r) && Bt(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
386
386
|
break;
|
|
387
387
|
case E.DTP_REAL:
|
|
388
|
-
r = Number(o), isNaN(r) &&
|
|
388
|
+
r = Number(o), isNaN(r) && Bt(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
389
389
|
break;
|
|
390
390
|
case E.DTP_LIST:
|
|
391
|
-
if (
|
|
391
|
+
if (dn(o)) try {
|
|
392
392
|
r = JSON.parse(o);
|
|
393
393
|
} catch (e) {
|
|
394
|
-
|
|
394
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
395
395
|
}
|
|
396
396
|
else r = o;
|
|
397
|
-
|
|
397
|
+
pn(r) || (r = []);
|
|
398
398
|
break;
|
|
399
399
|
case E.DTP_DICT:
|
|
400
|
-
if (
|
|
400
|
+
if (dn(o)) try {
|
|
401
401
|
r = JSON.parse(o);
|
|
402
402
|
} catch (e) {
|
|
403
|
-
|
|
403
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
404
404
|
}
|
|
405
405
|
else r = o;
|
|
406
|
-
|
|
406
|
+
gn(r) || (r = {});
|
|
407
407
|
break;
|
|
408
408
|
case E.DTP_JSON:
|
|
409
|
-
if (
|
|
409
|
+
if (dn(o)) try {
|
|
410
410
|
r = JSON.parse(o);
|
|
411
411
|
} catch (e) {
|
|
412
|
-
|
|
412
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
413
413
|
}
|
|
414
414
|
else r = o;
|
|
415
415
|
break;
|
|
416
416
|
case E.DTP_POINTER: r = o;
|
|
417
417
|
}
|
|
418
|
-
return void 0 === r && (
|
|
418
|
+
return void 0 === r && (Bt(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
419
419
|
}
|
|
420
420
|
function z(e, t, n, r) {
|
|
421
421
|
let o;
|
|
422
422
|
switch (n.type) {
|
|
423
423
|
case E.DTP_STRING:
|
|
424
424
|
if (null == r) o = "";
|
|
425
|
-
else if (
|
|
425
|
+
else if (dn(r)) o = String(r);
|
|
426
426
|
else {
|
|
427
427
|
let e = JSON.stringify(r);
|
|
428
428
|
e && (o = String(e));
|
|
429
429
|
}
|
|
430
430
|
break;
|
|
431
431
|
case E.DTP_BOOLEAN:
|
|
432
|
-
o =
|
|
432
|
+
o = vn(r);
|
|
433
433
|
break;
|
|
434
434
|
case E.DTP_INTEGER:
|
|
435
|
-
o = parseInt(r), isNaN(o) &&
|
|
435
|
+
o = parseInt(r), isNaN(o) && Bt(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
436
436
|
break;
|
|
437
437
|
case E.DTP_REAL:
|
|
438
|
-
o = Number(r), isNaN(o) &&
|
|
438
|
+
o = Number(r), isNaN(o) && Bt(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
439
439
|
break;
|
|
440
440
|
case E.DTP_LIST:
|
|
441
|
-
if (
|
|
441
|
+
if (dn(r)) try {
|
|
442
442
|
o = JSON.parse(r);
|
|
443
443
|
} catch (e) {
|
|
444
|
-
|
|
444
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
445
445
|
}
|
|
446
446
|
else o = r;
|
|
447
|
-
if (!
|
|
447
|
+
if (!pn(o)) return Bt(`attr must be an array: ${n.name}`), -1;
|
|
448
448
|
break;
|
|
449
449
|
case E.DTP_DICT:
|
|
450
|
-
if (
|
|
450
|
+
if (dn(r)) try {
|
|
451
451
|
o = JSON.parse(r);
|
|
452
452
|
} catch (e) {
|
|
453
|
-
|
|
453
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
454
454
|
}
|
|
455
455
|
else o = r;
|
|
456
|
-
if (!
|
|
456
|
+
if (!gn(o)) return Bt(`attr must be an object: ${n.name}`), -1;
|
|
457
457
|
break;
|
|
458
458
|
case E.DTP_JSON:
|
|
459
|
-
if (
|
|
459
|
+
if (dn(r)) try {
|
|
460
460
|
o = JSON.parse(r);
|
|
461
461
|
} catch (e) {
|
|
462
|
-
|
|
462
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
463
463
|
}
|
|
464
464
|
else o = r;
|
|
465
|
-
if (!
|
|
465
|
+
if (!pn(o) && !gn(o)) return Bt(`attr must be a json dict/list: ${n.name}`), -1;
|
|
466
466
|
break;
|
|
467
467
|
case E.DTP_POINTER: o = r;
|
|
468
468
|
}
|
|
469
|
-
return void 0 === o &&
|
|
469
|
+
return void 0 === o && Bt(`${Fe(e)}: attr undefined: ${n.name}`), t[n.name] = o, gn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = o), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
470
470
|
}
|
|
471
471
|
function Q(e) {
|
|
472
472
|
return e.jn_attrs;
|
|
473
473
|
}
|
|
474
474
|
function X(e, t, n) {
|
|
475
|
-
return
|
|
475
|
+
return rt(e, t) ? Q(e) : e && e.bottom_gobj ? X(e.bottom_gobj, t, n) : (n && Bt(`GClass Attribute NOT FOUND: ${Fe(e)}, attr ${t}`), null);
|
|
476
476
|
}
|
|
477
477
|
function Z(e, t, n) {
|
|
478
|
-
if (!(e && e instanceof j)) return n &&
|
|
478
|
+
if (!(e && e instanceof j)) return n && Bt("gclass NULL"), null;
|
|
479
479
|
if (!t) return e.attrs_table;
|
|
480
480
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
481
481
|
const r = e.attrs_table[n];
|
|
482
482
|
if (r.name && r.name === t) return r;
|
|
483
483
|
}
|
|
484
|
-
return n &&
|
|
484
|
+
return n && Bt(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
485
485
|
}
|
|
486
486
|
function ee(e, t, n, r, o, s, i, l, _, a, u) {
|
|
487
|
-
if (
|
|
488
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
489
|
-
if (ue(e)) return
|
|
487
|
+
if (yn(e)) return Bt("gclass_name EMPTY"), null;
|
|
488
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return Bt(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
489
|
+
if (ue(e)) return Bt(`GClass ALREADY exists: ${e}`), null;
|
|
490
490
|
let c = new j(e, r, o, s, i, l, _, a, u);
|
|
491
491
|
(function(e, t) {
|
|
492
|
-
e && e instanceof j ? t ? g[t] ?
|
|
492
|
+
e && e instanceof j ? t ? g[t] ? Bt(`gclass ALREADY REGISTERED: ${t}`) : g[t] = e : Bt("gclass_name undefined") : Bt("gclass undefined");
|
|
493
493
|
})(c, e);
|
|
494
494
|
const f = n.length;
|
|
495
495
|
for (let e = 0; e < f; e++) {
|
|
496
496
|
let t = n[e][0], r = n[e][1];
|
|
497
|
-
if (
|
|
497
|
+
if (yn(t)) continue;
|
|
498
498
|
if (oe(c, t) < 0) return te(c), null;
|
|
499
499
|
const o = r.length;
|
|
500
500
|
for (let e = 0; e < o; e++) {
|
|
501
501
|
let n = r[e][0], o = r[e][1], s = r[e][2];
|
|
502
|
-
|
|
502
|
+
yn(n) || se(c, t, n, o, s);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
for (let e = 0; e < t.length; e++) {
|
|
506
506
|
let n = t[e][0], r = t[e][1];
|
|
507
|
-
if (!
|
|
508
|
-
if (_e(c, n)) return
|
|
507
|
+
if (!yn(n)) {
|
|
508
|
+
if (_e(c, n)) return Bt(`SMachine: event repeated in input_events: ${n}`), te(c), null;
|
|
509
509
|
le(c, n, r);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
@@ -517,13 +517,13 @@ function ee(e, t, n, r, o, s, i, l, _, a, u) {
|
|
|
517
517
|
}
|
|
518
518
|
function te(e) {
|
|
519
519
|
let t;
|
|
520
|
-
if (
|
|
520
|
+
if (dn(e)) t = e;
|
|
521
521
|
else {
|
|
522
|
-
if (!(e instanceof j)) return
|
|
522
|
+
if (!(e instanceof j)) return Bt("Cannot unregister gclass, type unknown"), -1;
|
|
523
523
|
t = e.gclass_name;
|
|
524
524
|
}
|
|
525
525
|
let n = g[t];
|
|
526
|
-
return n ? n.instances > 0 ? (
|
|
526
|
+
return n ? n.instances > 0 ? (Bt(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete g[t], 0) : (Bt(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
527
527
|
}
|
|
528
528
|
function ne(e, t) {
|
|
529
529
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -542,22 +542,22 @@ function re(e, t) {
|
|
|
542
542
|
return null;
|
|
543
543
|
}
|
|
544
544
|
function oe(e, t) {
|
|
545
|
-
return e instanceof j ? ne(e, t) ? (
|
|
545
|
+
return e instanceof j ? ne(e, t) ? (Bt(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (Bt("Cannot add state, typeof not GClass"), -1);
|
|
546
546
|
}
|
|
547
547
|
function se(e, t, n, r, o) {
|
|
548
|
-
if (!(e instanceof j)) return
|
|
549
|
-
if (
|
|
548
|
+
if (!(e instanceof j)) return Bt("Cannot add state, typeof not GClass"), -1;
|
|
549
|
+
if (yn(t)) return Bt("state_name EMPTY"), -1;
|
|
550
550
|
let s = ne(e, t);
|
|
551
|
-
return s ? re(s, n) ? (
|
|
551
|
+
return s ? re(s, n) ? (Bt(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (s.dl_actions.push(new x(n, r, o)), 0) : (Bt(`state not found: ${t}`), -1);
|
|
552
552
|
}
|
|
553
553
|
function ie(e, t, n) {
|
|
554
|
-
|
|
554
|
+
yn(t) || e.push(new k(t, n));
|
|
555
555
|
}
|
|
556
556
|
function le(e, t, n) {
|
|
557
|
-
return e instanceof j ? ie(e.dl_events, t, n) : (
|
|
557
|
+
return e instanceof j ? ie(e.dl_events, t, n) : (Bt("Cannot add state, typeof not GClass"), -1);
|
|
558
558
|
}
|
|
559
559
|
function _e(e, t) {
|
|
560
|
-
if (!(e instanceof j)) return
|
|
560
|
+
if (!(e instanceof j)) return Bt("Cannot add state, typeof not GClass"), 0;
|
|
561
561
|
const n = e.dl_events.length, r = e.dl_events;
|
|
562
562
|
for (let e = 0; e < n; e++) {
|
|
563
563
|
let n = r[e];
|
|
@@ -566,25 +566,25 @@ function _e(e, t) {
|
|
|
566
566
|
return null;
|
|
567
567
|
}
|
|
568
568
|
function ae(e) {
|
|
569
|
-
if (!(e instanceof j)) return
|
|
569
|
+
if (!(e instanceof j)) return Bt("Cannot add state, typeof not GClass"), -1;
|
|
570
570
|
let t = 0;
|
|
571
|
-
|
|
571
|
+
cn(e.dl_states) || (Bt(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
572
572
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
573
573
|
let r = e.dl_states[n];
|
|
574
|
-
if (!
|
|
574
|
+
if (!yn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
575
575
|
let o = r.dl_actions[n];
|
|
576
|
-
|
|
576
|
+
yn(o.event_name) || (_e(e, o.event_name) || (Bt(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${o.event_name}`), t += -1), o.next_state && (ne(e, o.next_state) || (Bt(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
580
580
|
let r = e.dl_events[n];
|
|
581
|
-
if (!
|
|
581
|
+
if (!yn(r.event_name) && (bn(r.event_flag) || (Bt(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & w.EVF_OUTPUT_EVENT))) {
|
|
582
582
|
let n = !1;
|
|
583
583
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
584
584
|
let o = e.dl_states[t];
|
|
585
|
-
|
|
585
|
+
yn(o.state_name) || re(o, r.event_name) && (n = !0);
|
|
586
586
|
}
|
|
587
|
-
n || (
|
|
587
|
+
n || (Bt(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
return t;
|
|
@@ -594,62 +594,62 @@ function ue(e, t) {
|
|
|
594
594
|
try {
|
|
595
595
|
n = g[e];
|
|
596
596
|
} catch (e) {}
|
|
597
|
-
return n || (t &&
|
|
597
|
+
return n || (t && Bt(`gclass not found: ${e}`), null);
|
|
598
598
|
}
|
|
599
599
|
function ce() {
|
|
600
600
|
return !b || b.obflag & R.obflag_destroyed ? null : b;
|
|
601
601
|
}
|
|
602
602
|
function fe(e, t) {
|
|
603
603
|
e = e.toLowerCase();
|
|
604
|
-
return p[e] || (t &&
|
|
604
|
+
return p[e] || (t && Bt(`gobj service not found: ${e}`), null);
|
|
605
605
|
}
|
|
606
606
|
function ge(e) {
|
|
607
607
|
let t = Pe(e);
|
|
608
|
-
return t = t.toLowerCase(), p[t] &&
|
|
608
|
+
return t = t.toLowerCase(), p[t] && Bt(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), p[t] = e, 0;
|
|
609
609
|
}
|
|
610
610
|
function pe(e, t) {
|
|
611
|
-
t.parent &&
|
|
611
|
+
t.parent && Bt(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
612
612
|
}
|
|
613
613
|
function de(e, t) {
|
|
614
|
-
let n =
|
|
615
|
-
n >= 0 && (
|
|
614
|
+
let n = lr(e.dl_children, t);
|
|
615
|
+
n >= 0 && (an(e.dl_children, n), t.parent = null);
|
|
616
616
|
}
|
|
617
617
|
function be(e, t) {
|
|
618
|
-
"__json_config_variables__" !== t &&
|
|
618
|
+
"__json_config_variables__" !== t && Bt(`GClass Attribute NOT FOUND: ${Fe(e)}, attr ${t}`);
|
|
619
619
|
}
|
|
620
620
|
function me(e, t, n) {
|
|
621
621
|
let r = t;
|
|
622
622
|
(function(e, t, n, r, o) {
|
|
623
|
-
if (!e || !t) return
|
|
623
|
+
if (!e || !t) return Bt("hsdata or kw NULL"), -1;
|
|
624
624
|
let s = 0;
|
|
625
625
|
for (const [i, l] of Object.entries(t)) {
|
|
626
626
|
const t = Z(o.gclass, i, !1);
|
|
627
|
-
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED &&
|
|
627
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && Jt(`${Fe(o)}: Deprecated attribute used in gobj creation: ${i}`), s += z(o, e, t, l)) : r && (r(o, i), s--);
|
|
628
628
|
}
|
|
629
629
|
return s;
|
|
630
|
-
})(Q(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : be, e) < 0 && (
|
|
630
|
+
})(Q(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : be, e) < 0 && (Bt(`${Fe(e)} json2data() FAILED`), zt(r));
|
|
631
631
|
}
|
|
632
632
|
function Ee(e, n, r, o, s) {
|
|
633
633
|
if (s & N.gobj_flag_yuno) {
|
|
634
|
-
if (d) return
|
|
634
|
+
if (d) return Bt("__yuno__ already created"), null;
|
|
635
635
|
s |= N.gobj_flag_service;
|
|
636
636
|
} else {
|
|
637
|
-
if (!o) return
|
|
638
|
-
if (!("string" == typeof o || o instanceof S)) return
|
|
639
|
-
if (
|
|
637
|
+
if (!o) return Bt("gobj NEEDS a parent!"), null;
|
|
638
|
+
if (!("string" == typeof o || o instanceof S)) return Bt(`BAD TYPE of parent: ${o}`), null;
|
|
639
|
+
if (dn(o) && !(o = fe(o))) return Jt(`parent service not found: ${o}`), null;
|
|
640
640
|
}
|
|
641
|
-
if (s & N.gobj_flag_service && fe(e, !1)) return
|
|
641
|
+
if (s & N.gobj_flag_service && fe(e, !1)) return Bt(`service ALREADY registered: ${n}^${e}`), null;
|
|
642
642
|
if (s & N.gobj_flag_default_service) {
|
|
643
|
-
if (b) return
|
|
643
|
+
if (b) return Bt(`default service ALREADY registered: ${n}^${e}`), null;
|
|
644
644
|
s |= N.gobj_flag_service;
|
|
645
645
|
}
|
|
646
|
-
if (
|
|
646
|
+
if (yn(n)) return Bt("gclass_name must be a string"), null;
|
|
647
647
|
let l = ue(n, !1);
|
|
648
|
-
if (!l) return
|
|
649
|
-
if (!
|
|
650
|
-
if (!
|
|
651
|
-
if (e.includes("`")) return
|
|
652
|
-
if (e.includes("^")) return
|
|
648
|
+
if (!l) return Bt(`GClass not registered: ${n}^${e}`), null;
|
|
649
|
+
if (!dn(e)) return Bt(`gobj_name must be a string: ${n}`), null;
|
|
650
|
+
if (!yn(e)) {
|
|
651
|
+
if (e.includes("`")) return Bt(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
652
|
+
if (e.includes("^")) return Bt(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
653
653
|
}
|
|
654
654
|
let _ = new S(e, l, r, o, s);
|
|
655
655
|
_.jn_attrs = q(_, l.attrs_table);
|
|
@@ -661,19 +661,19 @@ function Te(e, t, n, r) {
|
|
|
661
661
|
return Ee(e, t, n, r, N.gobj_flag_pure_child);
|
|
662
662
|
}
|
|
663
663
|
function he(e) {
|
|
664
|
-
if (Ke(e)) return void
|
|
665
|
-
e.__refs__ > 0 &&
|
|
666
|
-
if (0 ===
|
|
667
|
-
for (let t of
|
|
668
|
-
|
|
664
|
+
if (Ke(e)) return void Bt("gobj NULL or DESTROYED");
|
|
665
|
+
e.__refs__ > 0 && Bt(`${Fe(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Bt(`Destroying a PLAYING gobj: ${Ge(e)}`), we(e)), e.running && (Bt(`Destroying a RUNNING gobj: ${Ge(e)}`), Se(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
666
|
+
if (0 === Tt.length) return;
|
|
667
|
+
for (let t of Tt) t.src === e && (t.src = null);
|
|
668
|
+
Tt = Tt.filter((t) => t.dst !== e);
|
|
669
669
|
}(e);
|
|
670
670
|
let n = K(e);
|
|
671
671
|
n && $(t("💔💔⏩ destroying: %s", Ge(e)));
|
|
672
672
|
let r = Ve(e);
|
|
673
673
|
r && r.gclass.gmt.mt_child_removed && (n && $(t("👦👦🔴 child_removed(%s): %s", Ge(r), Fe(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & N.gobj_flag_service && function(e) {
|
|
674
674
|
let t = Pe(e);
|
|
675
|
-
t = t.toLowerCase(), p[t] ? delete p[t] :
|
|
676
|
-
}(e),
|
|
675
|
+
t = t.toLowerCase(), p[t] ? delete p[t] : Bt(`"service NOT found in register": ${t}`);
|
|
676
|
+
}(e), xt(e, e.dl_subscriptions, !0), xt(e, e.dl_subscribings, !0), r && (de(r, e), Me(e) && (Ye(r) !== e || Ke(r) || Be(r, null))), function(e) {
|
|
677
677
|
let t = e.dl_children.slice();
|
|
678
678
|
for (let e = 0; e < t.length; e++) {
|
|
679
679
|
let n = t[e];
|
|
@@ -682,9 +682,9 @@ function he(e) {
|
|
|
682
682
|
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && $(t("💔💔⏪ destroyed: %s", Ge(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
683
683
|
}
|
|
684
684
|
function ye(e) {
|
|
685
|
-
if (Ke(e)) return
|
|
686
|
-
if (e.running) return
|
|
687
|
-
if (e.disabled) return
|
|
685
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
686
|
+
if (e.running) return Bt(`${Fe(e)}: GObj ALREADY RUNNING`), -1;
|
|
687
|
+
if (e.disabled) return Bt(`${Fe(e)}: GObj DISABLED`), -1;
|
|
688
688
|
Y(e) && $(t("⏺ ⏺ start: %s", Ge(e))), e.running = !0;
|
|
689
689
|
let n = 0;
|
|
690
690
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
@@ -696,9 +696,9 @@ function je(e, t, n) {
|
|
|
696
696
|
return e.gclass.gclass_flag & O.gcflag_manual_start || xe(e) ? 1 : (De(e) || ye(e), 0);
|
|
697
697
|
}
|
|
698
698
|
function Se(e) {
|
|
699
|
-
if (Ke(e)) return
|
|
700
|
-
if (!e.running) return
|
|
701
|
-
e.playing && (
|
|
699
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
700
|
+
if (!e.running) return Bt(`${Fe(e)}: GObj NOT RUNNING`), -1;
|
|
701
|
+
e.playing && (Jt(`${Fe(e)}: GObj stopping without previous pause`), we(e)), Y(e) && $(t("⏹ ⏹ stop: %s", Ge(e))), e.running = !1;
|
|
702
702
|
let n = 0;
|
|
703
703
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
704
704
|
}
|
|
@@ -706,22 +706,22 @@ function Oe(e, t, n) {
|
|
|
706
706
|
return De(e) && Se(e), 0;
|
|
707
707
|
}
|
|
708
708
|
function Ne(e) {
|
|
709
|
-
return Ke(e) ? (
|
|
709
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : qe(e, D.WALK_FIRST2LAST, Oe, 0, 0);
|
|
710
710
|
}
|
|
711
711
|
function Re(e) {
|
|
712
|
-
if (Ke(e)) return
|
|
713
|
-
if (e.playing) return
|
|
714
|
-
if (e.disabled) return
|
|
712
|
+
if (Ke(e)) return Bt(`gobj NULL or DESTROYED: ${Fe(e)}`), -1;
|
|
713
|
+
if (e.playing) return Bt(`${Fe(e)}: GObj ALREADY PLAYING`), -1;
|
|
714
|
+
if (e.disabled) return Bt(`${Fe(e)}: GObj DISABLED`), -1;
|
|
715
715
|
if (!De(e)) {
|
|
716
|
-
if (e.gclass.gclass_flag & O.gcflag_required_start_to_play) return
|
|
717
|
-
|
|
716
|
+
if (e.gclass.gclass_flag & O.gcflag_required_start_to_play) return Bt(`${Fe(e)}: Cannot play, start not done`), -1;
|
|
717
|
+
Jt(`${Fe(e)}: GObj playing without previous start`), ye(e);
|
|
718
718
|
}
|
|
719
719
|
Y(e) && $(t("⏯ ⏯ play: %s", Ge(e))), e.playing = !0;
|
|
720
720
|
let n = 0;
|
|
721
721
|
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
722
722
|
}
|
|
723
723
|
function we(e) {
|
|
724
|
-
return Ke(e) ? (
|
|
724
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : e.playing ? (Y(e) && $(t("⏸ ⏸ pause: %s", Ge(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (Bt(`${Fe(e)}: GObj NOT PLAYING`), -1);
|
|
725
725
|
}
|
|
726
726
|
function De(e) {
|
|
727
727
|
return !Ke(e) && e.running;
|
|
@@ -744,92 +744,95 @@ function $e() {
|
|
|
744
744
|
}
|
|
745
745
|
function Ce() {
|
|
746
746
|
let e = Ie();
|
|
747
|
-
return e ?
|
|
747
|
+
return e ? _t(e, "yuno_role") : "";
|
|
748
748
|
}
|
|
749
749
|
function Le() {
|
|
750
750
|
let e = Ie();
|
|
751
|
-
return e ?
|
|
751
|
+
return e ? _t(e, "yuno_id") : "";
|
|
752
752
|
}
|
|
753
753
|
function Pe(e) {
|
|
754
|
-
return
|
|
754
|
+
return hn(e) ? e.gobj_name : (Bt("gobj bad type"), null);
|
|
755
755
|
}
|
|
756
756
|
function Ue(e) {
|
|
757
|
-
return
|
|
757
|
+
return hn(e) ? e.gclass.gclass_name : (Bt("gobj NULL of bad type"), null);
|
|
758
758
|
}
|
|
759
759
|
function Fe(e) {
|
|
760
|
-
return
|
|
760
|
+
return hn(e) ? e.gclass.gclass_name + "^" + Pe(e) : (Bt("gobj bad type"), null);
|
|
761
761
|
}
|
|
762
762
|
function Ge(e) {
|
|
763
|
-
if (!
|
|
763
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
764
764
|
let t = Fe(e), n = Ve(e);
|
|
765
765
|
for (; n;) t = Fe(n) + "`" + t, n = Ve(n);
|
|
766
766
|
return t;
|
|
767
767
|
}
|
|
768
768
|
function Ve(e) {
|
|
769
|
-
return
|
|
769
|
+
return hn(e) ? e.parent : (Bt("gobj NULL of bad type"), null);
|
|
770
770
|
}
|
|
771
771
|
function Me(e) {
|
|
772
|
-
return
|
|
772
|
+
return hn(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (Bt("gobj NULL of bad type"), null);
|
|
773
773
|
}
|
|
774
774
|
function We(e) {
|
|
775
|
-
return
|
|
775
|
+
return hn(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (Bt("gobj NULL of bad type"), null);
|
|
776
776
|
}
|
|
777
777
|
function Ke(e) {
|
|
778
|
-
return !
|
|
778
|
+
return !hn(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
779
779
|
}
|
|
780
780
|
function Ye(e) {
|
|
781
|
-
return
|
|
781
|
+
return hn(e) ? e.bottom_gobj : (Bt("gobj NULL of bad type"), null);
|
|
782
782
|
}
|
|
783
783
|
function Be(e, t) {
|
|
784
|
-
if (!
|
|
785
|
-
e.bottom_gobj &&
|
|
784
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
785
|
+
e.bottom_gobj && Jt(`${Fe(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
786
786
|
}
|
|
787
787
|
function Je(e, t, n) {
|
|
788
|
-
return
|
|
788
|
+
return hn(e) ? t ? Z(e.gclass, t, n) : e.gclass.attrs_table : (Bt("gobj NULL of bad type"), null);
|
|
789
789
|
}
|
|
790
790
|
function qe(e, t, n, r, o) {
|
|
791
|
-
return Ke(e) ? (
|
|
791
|
+
return Ke(e) ? (Bt("gobj NULL, destroying, or bad type"), 0) : Qe(e.dl_children, t, n, r, o);
|
|
792
792
|
}
|
|
793
793
|
function He(e, t, n, r, o) {
|
|
794
|
-
return Ke(e) ? (
|
|
794
|
+
return Ke(e) ? (Bt("gobj NULL, destroying, or bad type"), 0) : Ze(e.dl_children, t, n, r, o);
|
|
795
795
|
}
|
|
796
|
-
function ze(e
|
|
796
|
+
function ze(e) {
|
|
797
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || Bt(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
798
|
+
}
|
|
799
|
+
function Qe(e, t, n, r, o) {
|
|
797
800
|
let s, i = [...e];
|
|
798
801
|
if (t & D.WALK_LAST2FIRST) for (let e = i.length; e > 0; e--) {
|
|
799
802
|
s = i[e - 1];
|
|
800
|
-
let t = n(s, r, o);
|
|
803
|
+
let t = ze(n(s, r, o));
|
|
801
804
|
if (t < 0) return t;
|
|
802
805
|
}
|
|
803
806
|
else for (let e = 0; e < i.length; e++) {
|
|
804
807
|
s = i[e];
|
|
805
|
-
let t = n(s, r, o);
|
|
808
|
+
let t = ze(n(s, r, o));
|
|
806
809
|
if (t < 0) return t;
|
|
807
810
|
}
|
|
808
811
|
return 0;
|
|
809
812
|
}
|
|
810
|
-
function
|
|
811
|
-
let s, i =
|
|
813
|
+
function Xe(e, t, n, r, o) {
|
|
814
|
+
let s, i = Qe(e, t, n, r, o);
|
|
812
815
|
if (i < 0) return i;
|
|
813
816
|
if (t & D.WALK_LAST2FIRST) {
|
|
814
|
-
for (let l = e.length; l > 0; l--) if (s = e[l - 1], i =
|
|
815
|
-
} else for (let l = 0; l < e.length; l++) if (s = e[l], i =
|
|
817
|
+
for (let l = e.length; l > 0; l--) if (s = e[l - 1], i = Xe([...s.dl_children], t, n, r, o), i < 0) return i;
|
|
818
|
+
} else for (let l = 0; l < e.length; l++) if (s = e[l], i = Xe([...s.dl_children], t, n, r, o), i < 0) return i;
|
|
816
819
|
return i;
|
|
817
820
|
}
|
|
818
|
-
function
|
|
819
|
-
if (t & D.WALK_BYLEVEL) return
|
|
821
|
+
function Ze(e, t, n, r, o) {
|
|
822
|
+
if (t & D.WALK_BYLEVEL) return Xe(e, t, n, r, o);
|
|
820
823
|
let s, i;
|
|
821
824
|
if (t & D.WALK_BOTTOM2TOP) for (let l = e.length; l > 0; l--) {
|
|
822
|
-
if (i = e[l - 1], s =
|
|
823
|
-
if (s = n(i, r, o), s < 0) return s;
|
|
825
|
+
if (i = e[l - 1], s = Ze([...i.dl_children], t, n, r, o), s < 0) return s;
|
|
826
|
+
if (s = ze(n(i, r, o)), s < 0) return s;
|
|
824
827
|
}
|
|
825
828
|
else for (let l = 0; l < e.length; l++) {
|
|
826
|
-
if (i = e[l], s = n(i, r, o), s < 0) return s;
|
|
827
|
-
if (0 === s && (s =
|
|
829
|
+
if (i = e[l], s = ze(n(i, r, o)), s < 0) return s;
|
|
830
|
+
if (0 === s && (s = Ze([...i.dl_children], t, n, r, o), s < 0)) return s;
|
|
828
831
|
}
|
|
829
832
|
return 0;
|
|
830
833
|
}
|
|
831
|
-
function
|
|
832
|
-
if (!
|
|
834
|
+
function et(e, t) {
|
|
835
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), !1;
|
|
833
836
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
834
837
|
t.__disabled__;
|
|
835
838
|
let s = t.__state__;
|
|
@@ -839,21 +842,21 @@ function Ze(e, t) {
|
|
|
839
842
|
let t = o.length;
|
|
840
843
|
if (o !== Pe(e).substring(0, t)) return !1;
|
|
841
844
|
}
|
|
842
|
-
if (s && s !==
|
|
845
|
+
if (s && s !== dt(e)) return !1;
|
|
843
846
|
let i = e.jn_attrs;
|
|
844
|
-
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n &&
|
|
847
|
+
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && rt(e, n) && i[n] !== t[n]) return !1;
|
|
845
848
|
return !0;
|
|
846
849
|
}
|
|
847
|
-
function
|
|
848
|
-
if (Ke(e)) return
|
|
850
|
+
function tt(e, t) {
|
|
851
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
849
852
|
const n = e.dl_children;
|
|
850
853
|
for (let e = 0; e < n.length; e++) {
|
|
851
854
|
const r = n[e];
|
|
852
|
-
if (
|
|
855
|
+
if (et(r, t)) return r;
|
|
853
856
|
}
|
|
854
857
|
return null;
|
|
855
858
|
}
|
|
856
|
-
function
|
|
859
|
+
function nt(e, t) {
|
|
857
860
|
if (!t) return null;
|
|
858
861
|
let n = t.split("`");
|
|
859
862
|
if (!function(e, t) {
|
|
@@ -869,56 +872,56 @@ function tt(e, t) {
|
|
|
869
872
|
if (1 === n.length) return e;
|
|
870
873
|
let r = n[1].split("^"), o = {};
|
|
871
874
|
1 === r.length ? o.__gobj_name__ = r : (o.__gclass_name__ = r[0], o.__gobj_name__ = r[1]);
|
|
872
|
-
let s =
|
|
873
|
-
return s ? (n.splice(0, 1), n = n.join("`"),
|
|
875
|
+
let s = tt(e, o);
|
|
876
|
+
return s ? (n.splice(0, 1), n = n.join("`"), nt(s, n)) : null;
|
|
874
877
|
}
|
|
875
|
-
function
|
|
876
|
-
return !
|
|
878
|
+
function rt(e, t) {
|
|
879
|
+
return !yn(t) && !!Z(e.gclass, t, !1);
|
|
877
880
|
}
|
|
878
|
-
function
|
|
881
|
+
function ot(e, t, n) {
|
|
879
882
|
let r = e.jn_attrs;
|
|
880
883
|
if (t in r && r.hasOwnProperty(t)) {
|
|
881
884
|
let n = r[t];
|
|
882
885
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
883
886
|
}
|
|
884
|
-
return
|
|
887
|
+
return Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
885
888
|
}
|
|
886
|
-
function
|
|
889
|
+
function st(e, t, n) {
|
|
887
890
|
let r = {}, o = e.gclass.attrs_table;
|
|
888
891
|
for (let n = 0; n < o.length; n++) {
|
|
889
892
|
const s = o[n];
|
|
890
893
|
if (s.name && (-1 === t || s.flag & t)) {
|
|
891
894
|
let t;
|
|
892
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t =
|
|
895
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = nn(e.jn_attrs, s.name) : (t = e.gclass.gmt.mt_reading(e, s.name), void 0 === t && (t = nn(e.jn_attrs, s.name))), on(r, s.name, t);
|
|
893
896
|
}
|
|
894
897
|
}
|
|
895
898
|
return r;
|
|
896
899
|
}
|
|
897
|
-
function
|
|
900
|
+
function it(e, t) {
|
|
898
901
|
if (t) {
|
|
899
|
-
if (0 ===
|
|
900
|
-
if (0 ===
|
|
901
|
-
if (0 ===
|
|
902
|
-
if (0 ===
|
|
902
|
+
if (0 === Sn(t, "__disabled__")) return xe(e);
|
|
903
|
+
if (0 === Sn(t, "__running__")) return De(e);
|
|
904
|
+
if (0 === Sn(t, "__playing__")) return ke(e);
|
|
905
|
+
if (0 === Sn(t, "__service__")) return Ae(e);
|
|
903
906
|
}
|
|
904
907
|
let n = X(e, t, !1);
|
|
905
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
906
|
-
}
|
|
907
|
-
function it(e, t) {
|
|
908
|
-
t && jn(t, "__trace_level__");
|
|
909
|
-
let n = X(e, t, !1);
|
|
910
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? tn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Yt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
908
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
911
909
|
}
|
|
912
910
|
function lt(e, t) {
|
|
913
|
-
|
|
911
|
+
t && Sn(t, "__trace_level__");
|
|
914
912
|
let n = X(e, t, !1);
|
|
915
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
913
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
916
914
|
}
|
|
917
915
|
function _t(e, t) {
|
|
916
|
+
if (t && 0 === Sn(t, "__state__")) return dt(e);
|
|
917
|
+
let n = X(e, t, !1);
|
|
918
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
919
|
+
}
|
|
920
|
+
function at(e, t) {
|
|
918
921
|
let n = X(e, t, !1);
|
|
919
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
922
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
920
923
|
}
|
|
921
|
-
function
|
|
924
|
+
function ut(e, t, n, r) {
|
|
922
925
|
let o = Q(e), s = 0;
|
|
923
926
|
for (const [r, i] of Object.entries(t)) {
|
|
924
927
|
let t = Je(e, r, !0);
|
|
@@ -926,34 +929,34 @@ function at(e, t, n, r) {
|
|
|
926
929
|
}
|
|
927
930
|
return s;
|
|
928
931
|
}
|
|
929
|
-
function ut(e, t, n) {
|
|
930
|
-
let r = X(e, t, !1);
|
|
931
|
-
return r ? (r[t] = yn(n), fn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Yt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
932
|
-
}
|
|
933
932
|
function ct(e, t, n) {
|
|
934
933
|
let r = X(e, t, !1);
|
|
935
|
-
return r ? (r[t] =
|
|
934
|
+
return r ? (r[t] = vn(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
936
935
|
}
|
|
937
936
|
function ft(e, t, n) {
|
|
938
937
|
let r = X(e, t, !1);
|
|
939
|
-
return r ? (r[t] =
|
|
938
|
+
return r ? (r[t] = parseInt(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
939
|
+
}
|
|
940
|
+
function gt(e, t, n) {
|
|
941
|
+
let r = X(e, t, !1);
|
|
942
|
+
return r ? (r[t] = String(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
940
943
|
}
|
|
941
|
-
function
|
|
942
|
-
if (Ke(e)) return
|
|
944
|
+
function pt(e, n) {
|
|
945
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
943
946
|
if (e.current_state.state_name === n) return !1;
|
|
944
947
|
let r = ne(e.gclass, n);
|
|
945
|
-
if (!r) return
|
|
948
|
+
if (!r) return Bt(`${Fe(e)}: state unknown, state ${n}`), !1;
|
|
946
949
|
e.last_state = e.current_state, e.current_state = r;
|
|
947
950
|
let o = B(e, "EV_STATE_CHANGED"), s = !!function(e) {
|
|
948
951
|
return V(e) & C.TRACE_STATES;
|
|
949
952
|
}(e);
|
|
950
|
-
return (o || s) && $(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ue(e), Pe(e),
|
|
953
|
+
return (o || s) && $(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ue(e), Pe(e), dt(e), e.last_state.state_name)), !0;
|
|
951
954
|
}
|
|
952
|
-
function
|
|
953
|
-
return
|
|
955
|
+
function dt(e) {
|
|
956
|
+
return hn(e) ? e.current_state.state_name : (Bt("hgobj NULL"), "");
|
|
954
957
|
}
|
|
955
|
-
function
|
|
956
|
-
if (!
|
|
958
|
+
function bt(e, t, n) {
|
|
959
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
957
960
|
let r = _e(e.gclass, t);
|
|
958
961
|
if (r) return r;
|
|
959
962
|
if (n) {
|
|
@@ -965,51 +968,51 @@ function dt(e, t, n) {
|
|
|
965
968
|
}
|
|
966
969
|
return null;
|
|
967
970
|
}
|
|
968
|
-
function
|
|
969
|
-
let r =
|
|
971
|
+
function mt(e, t, n) {
|
|
972
|
+
let r = bt(e, t, !1);
|
|
970
973
|
return !!r && !(n && !(r.event_flag & n));
|
|
971
974
|
}
|
|
972
|
-
function
|
|
973
|
-
let r =
|
|
975
|
+
function Et(e, t, n) {
|
|
976
|
+
let r = bt(e, t, !1);
|
|
974
977
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & w.EVF_OUTPUT_EVENT);
|
|
975
978
|
}
|
|
976
|
-
var
|
|
977
|
-
function
|
|
978
|
-
|
|
979
|
-
let e =
|
|
980
|
-
|
|
979
|
+
var Tt = [], ht = !1;
|
|
980
|
+
function yt() {
|
|
981
|
+
ht = !1;
|
|
982
|
+
let e = Tt;
|
|
983
|
+
Tt = [];
|
|
981
984
|
let t = 0;
|
|
982
|
-
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (
|
|
983
|
-
return
|
|
985
|
+
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (vt(n.dst, n.event, n.kw, n.src), t++);
|
|
986
|
+
return Tt.length > 0 && !ht && (ht = !0, setTimeout(yt, 0)), t;
|
|
984
987
|
}
|
|
985
|
-
function
|
|
986
|
-
if (!(e && e instanceof S)) return
|
|
987
|
-
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return
|
|
988
|
+
function vt(e, n, r, o) {
|
|
989
|
+
if (!(e && e instanceof S)) return Bt("gobj dst NULL"), -1;
|
|
990
|
+
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return Bt("gobj dst DESTROYED"), -1;
|
|
988
991
|
let s = e.current_state;
|
|
989
|
-
if (!s) return
|
|
992
|
+
if (!s) return Bt(`${Fe(e)}: current_state NULL`), -1;
|
|
990
993
|
let i = B(e, n) && !J(o, n);
|
|
991
994
|
m++;
|
|
992
995
|
let l = re(s, n);
|
|
993
|
-
if (!l) return e.gclass.gmt.mt_inject_event ? (m--, i && ($(t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Fe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Fe(o))), r && i > 1 &&
|
|
996
|
+
if (!l) return e.gclass.gmt.mt_inject_event ? (m--, i && ($(t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Fe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Fe(o))), r && i > 1 && un(r) && zt(r)), e.gclass.gmt.mt_inject_event(e, n, r, o)) : (i && $(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ue(e), Pe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Ue(o), Pe(o))), Bt(`📛📛 Event NOT DEFINED in state 📛📛: ${Fe(e)}, ${s.state_name}, ${n}`), m--, -1);
|
|
994
997
|
if (i) {
|
|
995
998
|
if (1 === I) $(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Fe(e), s.state_name, o && !o.running ? "!!" : "", Fe(o)));
|
|
996
999
|
else {
|
|
997
1000
|
let r = "";
|
|
998
|
-
l.action && (r =
|
|
1001
|
+
l.action && (r = ar(l.action)), $(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ue(e), Pe(e), s.state_name, "", n || "", "", r, o && !o.running ? "!!" : "", Ue(o), Pe(o)));
|
|
999
1002
|
}
|
|
1000
|
-
r && (V(e) | W()) & C.TRACE_EV_KW &&
|
|
1003
|
+
r && (V(e) | W()) & C.TRACE_EV_KW && un(r) && zt(r);
|
|
1001
1004
|
}
|
|
1002
|
-
l.next_state &&
|
|
1005
|
+
l.next_state && pt(e, l.next_state);
|
|
1003
1006
|
let _ = -1;
|
|
1004
1007
|
try {
|
|
1005
1008
|
l.action && (_ = l.action(e, n, r, o));
|
|
1006
1009
|
} finally {}
|
|
1007
|
-
return !i || 1 === I || e.obflag & R.obflag_destroyed || $(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, n || "",
|
|
1010
|
+
return !i || 1 === I || e.obflag & R.obflag_destroyed || $(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, n || "", bn(_) ? _ : 0)), m--, _;
|
|
1008
1011
|
}
|
|
1009
|
-
var
|
|
1012
|
+
var jt = Object.freeze({
|
|
1010
1013
|
__hard_subscription__: 1,
|
|
1011
1014
|
__own_event__: 2
|
|
1012
|
-
}),
|
|
1015
|
+
}), St = [
|
|
1013
1016
|
v(E.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1014
1017
|
v(E.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1015
1018
|
v(E.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
@@ -1022,48 +1025,48 @@ var vt = Object.freeze({
|
|
|
1022
1025
|
v(E.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1023
1026
|
y()
|
|
1024
1027
|
];
|
|
1025
|
-
function
|
|
1026
|
-
let s =
|
|
1027
|
-
if (t && t !==
|
|
1028
|
-
let t =
|
|
1029
|
-
|
|
1028
|
+
function Ot(e, t, n, r, o) {
|
|
1029
|
+
let s = $n(t, r, "__config__", null), i = $n(t, r, "__global__", null), l = $n(t, r, "__local__", null), _ = Cn(t, r, "__filter__", null), a = !0;
|
|
1030
|
+
if (t && t !== In(null, e, "publisher", null) && (a = !1), o && o !== In(null, e, "subscriber", null) && (a = !1), n && n !== kn(null, e, "event", "") && (a = !1), fn(s) > 0) {
|
|
1031
|
+
let t = $n(null, e, "__config__", null);
|
|
1032
|
+
fn(t) > 0 && Xt(t, s) || (a = !1);
|
|
1030
1033
|
}
|
|
1031
|
-
if (
|
|
1032
|
-
let t =
|
|
1033
|
-
|
|
1034
|
+
if (fn(i) > 0) {
|
|
1035
|
+
let t = $n(null, e, "__global__", null);
|
|
1036
|
+
fn(t) > 0 && Xt(t, i) || (a = !1);
|
|
1034
1037
|
}
|
|
1035
|
-
if (
|
|
1036
|
-
let t =
|
|
1037
|
-
|
|
1038
|
+
if (fn(l) > 0) {
|
|
1039
|
+
let t = $n(null, e, "__local__", null);
|
|
1040
|
+
fn(t) > 0 && Xt(t, l) || (a = !1);
|
|
1038
1041
|
}
|
|
1039
|
-
if (
|
|
1040
|
-
let t =
|
|
1041
|
-
|
|
1042
|
+
if (fn(_) > 0) {
|
|
1043
|
+
let t = Cn(null, e, "__filter__", null);
|
|
1044
|
+
fn(t) > 0 && Xt(t, _) || (a = !1);
|
|
1042
1045
|
}
|
|
1043
1046
|
return a;
|
|
1044
1047
|
}
|
|
1045
|
-
function
|
|
1048
|
+
function Nt(e, t, n, r, o) {
|
|
1046
1049
|
let s = [];
|
|
1047
1050
|
for (let i = 0; i < e.length; i++) {
|
|
1048
1051
|
let l = e[i];
|
|
1049
|
-
|
|
1052
|
+
Ot(l, t, n, r, o) && ln(s, l);
|
|
1050
1053
|
}
|
|
1051
1054
|
return s;
|
|
1052
1055
|
}
|
|
1053
|
-
function
|
|
1054
|
-
for (let s = 0; s < e.length; s++) if (
|
|
1056
|
+
function Rt(e, t, n, r, o) {
|
|
1057
|
+
for (let s = 0; s < e.length; s++) if (Ot(e[s], t, n, r, o)) return s;
|
|
1055
1058
|
return -1;
|
|
1056
1059
|
}
|
|
1057
|
-
function Rt(e, n, r, o) {
|
|
1058
|
-
let s = kn(e, n, "publisher", null, It.KW_REQUIRED), i = kn(e, n, "subscriber", null, It.KW_REQUIRED), l = An(e, n, "event", "", It.KW_REQUIRED);
|
|
1059
|
-
if (!!(xn(e, n, "subs_flag", null, It.KW_REQUIRED) & vt.__hard_subscription__) && !r) return -1;
|
|
1060
|
-
d && st(d, "trace_subscriptions") && ($(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", l || "", Fe(s), Fe(i))), Ht(n)), s.obflag & R.obflag_destroyed || o || s.gclass.gmt.mt_subscription_deleted && s.gclass.gmt.mt_subscription_deleted(s, n);
|
|
1061
|
-
let _ = Nt(s.dl_subscriptions, s, l, n, i);
|
|
1062
|
-
return _ >= 0 ? _n(s.dl_subscriptions, _) : (Yt(`${Fe(e)}: subscription in publisher not found`), Ht(n)), _ = Nt(i.dl_subscribings, s, l, n, i), _ >= 0 ? _n(i.dl_subscribings, _) : (Yt(`${Fe(e)}: subscription in subscriber not found`), Ht(n)), 0;
|
|
1063
|
-
}
|
|
1064
1060
|
function wt(e, n, r, o) {
|
|
1065
|
-
|
|
1066
|
-
if (
|
|
1061
|
+
let s = In(e, n, "publisher", null, $t.KW_REQUIRED), i = In(e, n, "subscriber", null, $t.KW_REQUIRED), l = kn(e, n, "event", "", $t.KW_REQUIRED);
|
|
1062
|
+
if (!!(An(e, n, "subs_flag", null, $t.KW_REQUIRED) & jt.__hard_subscription__) && !r) return -1;
|
|
1063
|
+
d && it(d, "trace_subscriptions") && ($(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", l || "", Fe(s), Fe(i))), zt(n)), s.obflag & R.obflag_destroyed || o || s.gclass.gmt.mt_subscription_deleted && s.gclass.gmt.mt_subscription_deleted(s, n);
|
|
1064
|
+
let _ = Rt(s.dl_subscriptions, s, l, n, i);
|
|
1065
|
+
return _ >= 0 ? an(s.dl_subscriptions, _) : (Bt(`${Fe(e)}: subscription in publisher not found`), zt(n)), _ = Rt(i.dl_subscribings, s, l, n, i), _ >= 0 ? an(i.dl_subscribings, _) : (Bt(`${Fe(e)}: subscription in subscriber not found`), zt(n)), 0;
|
|
1066
|
+
}
|
|
1067
|
+
function Dt(e, n, r, o) {
|
|
1068
|
+
if (null == r && (r = {}), !e) return Bt(`publisher NULL: ev ${n}`), 0;
|
|
1069
|
+
if (!o) return Bt(`subscriber NULL: ev ${n}`), 0;
|
|
1067
1070
|
const s = /* @__PURE__ */ new Set([
|
|
1068
1071
|
"__config__",
|
|
1069
1072
|
"__global__",
|
|
@@ -1072,57 +1075,57 @@ function wt(e, n, r, o) {
|
|
|
1072
1075
|
"__service__"
|
|
1073
1076
|
]);
|
|
1074
1077
|
if (Object.keys(r).forEach((t) => {
|
|
1075
|
-
s.has(t) ||
|
|
1076
|
-
}),
|
|
1077
|
-
else if (!(
|
|
1078
|
-
let i =
|
|
1079
|
-
|
|
1078
|
+
s.has(t) || Bt(`${Fe(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1079
|
+
}), yn(n)) n = "";
|
|
1080
|
+
else if (!(Et(e, n, w.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Fe(e)}, ${n}`), 0;
|
|
1081
|
+
let i = Nt(e.dl_subscriptions, e, n, r, o);
|
|
1082
|
+
cn(i) > 0 && (Bt(`${Fe(e)}: ${cn(i)} subscription(s) REPEATED, will be deleted and override`), zt(i, "subscription REPEATED"), xt(e, i, !1));
|
|
1080
1083
|
let l = function(e, t, n, r) {
|
|
1081
|
-
let o = q(e,
|
|
1082
|
-
|
|
1084
|
+
let o = q(e, St);
|
|
1085
|
+
sn(o, "event", t), sn(o, "subscriber", r), sn(o, "publisher", e);
|
|
1083
1086
|
let s = 0;
|
|
1084
1087
|
if (n) {
|
|
1085
|
-
let t =
|
|
1086
|
-
if (
|
|
1087
|
-
let n =
|
|
1088
|
-
if (
|
|
1089
|
-
let t =
|
|
1090
|
-
|
|
1088
|
+
let t = $n(e, n, "__config__", null), r = $n(e, n, "__global__", null), i = $n(e, n, "__local__", null), l = Cn(e, n, "__filter__", null), _ = kn(e, n, "__service__", "");
|
|
1089
|
+
if (fn(r) > 0 && sn(o, "__global__", Qt(r)), fn(t) > 0) {
|
|
1090
|
+
let n = Qt(t);
|
|
1091
|
+
if (sn(o, "__config__", n), Rn(n, "__hard_subscription__")) {
|
|
1092
|
+
let t = xn(e, n, "__hard_subscription__", !1);
|
|
1093
|
+
rn(n, "__hard_subscription__"), t && (s |= jt.__hard_subscription__);
|
|
1091
1094
|
}
|
|
1092
|
-
if (
|
|
1093
|
-
let t =
|
|
1094
|
-
|
|
1095
|
+
if (Rn(n, "__own_event__")) {
|
|
1096
|
+
let t = xn(e, n, "__own_event__", !1);
|
|
1097
|
+
rn(n, "__own_event__"), t && (s |= jt.__own_event__);
|
|
1095
1098
|
}
|
|
1096
1099
|
}
|
|
1097
|
-
|
|
1100
|
+
fn(i) > 0 && sn(o, "__local__", Qt(i)), fn(l) > 0 && sn(o, "__filter__", Qt(l)), yn(_) || sn(o, "__service__", _);
|
|
1098
1101
|
}
|
|
1099
|
-
return
|
|
1102
|
+
return sn(o, "subs_flag", s), o;
|
|
1100
1103
|
}(e, n, r, o);
|
|
1101
|
-
if (!l) return
|
|
1102
|
-
if (
|
|
1104
|
+
if (!l) return Bt(`${Fe(e)}: _create_subscription() FAILED`), 0;
|
|
1105
|
+
if (ln(e.dl_subscriptions, l), ln(o.dl_subscribings, l), d && it(d, "trace_subscriptions") && ($(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Fe(e), Fe(o))), r && zt(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1103
1106
|
let t = e.gclass.gmt.mt_subscription_added(e, l);
|
|
1104
|
-
(t < 0 || !1 === t) && (
|
|
1107
|
+
(t < 0 || !1 === t) && (wt(e, l, !0, !0), l = 0);
|
|
1105
1108
|
}
|
|
1106
1109
|
return l;
|
|
1107
1110
|
}
|
|
1108
|
-
function
|
|
1111
|
+
function xt(e, t, n) {
|
|
1109
1112
|
let r = [...t];
|
|
1110
|
-
for (let t = 0; t < r.length; t++)
|
|
1113
|
+
for (let t = 0; t < r.length; t++) wt(e, r[t], n, !1);
|
|
1111
1114
|
return 0;
|
|
1112
1115
|
}
|
|
1113
|
-
function xt(e, t, n, r) {
|
|
1114
|
-
return null == n && (n = {}), Ot(e.dl_subscriptions, e, t, n, r);
|
|
1115
|
-
}
|
|
1116
1116
|
function At(e, t, n, r) {
|
|
1117
|
-
return
|
|
1118
|
-
}
|
|
1119
|
-
function kt(e, n, r) {
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
if (
|
|
1124
|
-
|
|
1125
|
-
|
|
1117
|
+
return null == n && (n = {}), Nt(e.dl_subscriptions, e, t, n, r);
|
|
1118
|
+
}
|
|
1119
|
+
function kt(e, t, n, r) {
|
|
1120
|
+
return Nt(e.dl_subscribings, r, t, n, e);
|
|
1121
|
+
}
|
|
1122
|
+
function It(e, n, r) {
|
|
1123
|
+
if (gn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
1124
|
+
if (yn(n)) return Bt(`${Fe(e)}: event EMPTY`), -1;
|
|
1125
|
+
let o = bt(e, n, !0);
|
|
1126
|
+
if (!(o && o.event_flag & (w.EVF_SYSTEM_EVENT | w.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Fe(e)}, ev ${n}`), -1;
|
|
1127
|
+
let s = d && it(d, "trace_subscriptions");
|
|
1128
|
+
if (s && ($(t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, "", n || "", "")), zt(r)), e.gclass.gmt.mt_publish_event) {
|
|
1126
1129
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1127
1130
|
if (t <= 0) return t;
|
|
1128
1131
|
}
|
|
@@ -1134,28 +1137,28 @@ function kt(e, n, r) {
|
|
|
1134
1137
|
if (t < 0) break;
|
|
1135
1138
|
if (!t) continue;
|
|
1136
1139
|
}
|
|
1137
|
-
let u =
|
|
1140
|
+
let u = In(e, a, "subscriber", null, $t.KW_REQUIRED);
|
|
1138
1141
|
if (!u || Ke(u)) continue;
|
|
1139
|
-
let c =
|
|
1140
|
-
if (
|
|
1141
|
-
|
|
1142
|
-
let o =
|
|
1143
|
-
if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) :
|
|
1142
|
+
let c = An(e, a, "subs_flag", 0, $t.KW_REQUIRED), f = kn(e, a, "event", "", $t.KW_REQUIRED);
|
|
1143
|
+
if (yn(f) || 0 === Sn(f, n)) {
|
|
1144
|
+
$n(e, a, "__config__", null, 0);
|
|
1145
|
+
let o = $n(e, a, "__global__", null, 0), i = $n(e, a, "__local__", null, 0), f = Cn(e, a, "__filter__", null, 0), g = r, p = 1;
|
|
1146
|
+
if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) : fn(f) > 0 && (p = Fn(g, f) ? 1 : 0, s && ($(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", p ? "👍" : "👎", n || "", Fe(u), Fe(e))), zt(f))), p < 0) break;
|
|
1144
1147
|
if (!p) continue;
|
|
1145
|
-
let d =
|
|
1146
|
-
if (d && d.event_flag & w.EVF_SYSTEM_EVENT && !
|
|
1147
|
-
i &&
|
|
1148
|
-
let b =
|
|
1149
|
-
if (b < 0 && c &
|
|
1148
|
+
let d = bt(u, n, !0);
|
|
1149
|
+
if (d && d.event_flag & w.EVF_SYSTEM_EVENT && !mt(u, d.event_name, 0)) continue;
|
|
1150
|
+
i && Nn(g, i), o && Zt(g, o), s && ($(t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", Fe(u), dt(u), n || "", e && !e.running ? "!!" : "", Fe(e))), zt(g));
|
|
1151
|
+
let b = vt(u, n, g, e);
|
|
1152
|
+
if (b < 0 && c & jt.__own_event__) {
|
|
1150
1153
|
l = -1;
|
|
1151
1154
|
break;
|
|
1152
1155
|
}
|
|
1153
1156
|
if (_ += b, l++, Ke(e)) break;
|
|
1154
1157
|
}
|
|
1155
1158
|
}
|
|
1156
|
-
return l || o && o.event_flag & w.EVF_NO_WARN_SUBS ||
|
|
1159
|
+
return l || o && o.event_flag & w.EVF_NO_WARN_SUBS || Jt(`${Fe(e)}: Publish event WITHOUT subscribers, ev ${n}`), _;
|
|
1157
1160
|
}
|
|
1158
|
-
var
|
|
1161
|
+
var $t = Object.freeze({
|
|
1159
1162
|
KW_REQUIRED: 1,
|
|
1160
1163
|
KW_CREATE: 2,
|
|
1161
1164
|
KW_WILD_NUMBER: 4,
|
|
@@ -1175,23 +1178,23 @@ Object.freeze({
|
|
|
1175
1178
|
JSON_FALSE: 7,
|
|
1176
1179
|
JSON_NULL: 8
|
|
1177
1180
|
});
|
|
1178
|
-
var
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1181
|
-
function
|
|
1182
|
-
if (
|
|
1183
|
-
|
|
1181
|
+
var Ct = "undefined" != typeof window ? window.console : console, Lt = Ct.error, Pt = Ct.warn, Ut = Ct.info, Ft = Ct.debug, Gt = null;
|
|
1182
|
+
var Vt = !0;
|
|
1183
|
+
var Mt = !1;
|
|
1184
|
+
function Wt(e, t, n) {
|
|
1185
|
+
if (Gt && !Mt) {
|
|
1186
|
+
Mt = !0;
|
|
1184
1187
|
try {
|
|
1185
|
-
|
|
1188
|
+
Gt(e, t, n);
|
|
1186
1189
|
} catch (e) {} finally {
|
|
1187
|
-
|
|
1190
|
+
Mt = !1;
|
|
1188
1191
|
}
|
|
1189
1192
|
}
|
|
1190
1193
|
}
|
|
1191
|
-
function Wt(e) {
|
|
1192
|
-
e ? (Ct = e, Lt = e) : (Ct = $t.error, Lt = $t.warn);
|
|
1193
|
-
}
|
|
1194
1194
|
function Kt(e) {
|
|
1195
|
+
e ? (Lt = e, Pt = e) : (Lt = Ct.error, Pt = Ct.warn);
|
|
1196
|
+
}
|
|
1197
|
+
function Yt(e) {
|
|
1195
1198
|
const t = Array.prototype.slice.call(arguments);
|
|
1196
1199
|
let n = "";
|
|
1197
1200
|
if ("string" == typeof e) {
|
|
@@ -1213,36 +1216,36 @@ function Kt(e) {
|
|
|
1213
1216
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1214
1217
|
return n;
|
|
1215
1218
|
}
|
|
1216
|
-
function Yt(e) {
|
|
1217
|
-
let t = Kt(e), n = sr();
|
|
1218
|
-
Ct && (Ct === $t.error ? Gt && Ct("%c" + n + " ERROR: " + String(t), "color:red") : (Gt && $t.error("%c" + n + " ERROR: " + String(t), "color:red"), Ct(`${n} ERROR: ${String(t)}`))), Mt("error", t, n);
|
|
1219
|
-
}
|
|
1220
1219
|
function Bt(e) {
|
|
1221
|
-
let t =
|
|
1222
|
-
Lt && (Lt ===
|
|
1220
|
+
let t = Yt(e), n = ir();
|
|
1221
|
+
Lt && (Lt === Ct.error ? Vt && Lt("%c" + n + " ERROR: " + String(t), "color:red") : (Vt && Ct.error("%c" + n + " ERROR: " + String(t), "color:red"), Lt(`${n} ERROR: ${String(t)}`))), Wt("error", t, n);
|
|
1223
1222
|
}
|
|
1224
1223
|
function Jt(e) {
|
|
1225
|
-
let t =
|
|
1226
|
-
|
|
1224
|
+
let t = Yt(e), n = ir();
|
|
1225
|
+
Pt && (Pt === Ct.warn ? Vt && Pt("%c" + n + " WARNING: " + String(t), "color:yellow") : (Vt && Ct.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Pt(`${n} WARNING: ${String(t)}`))), Wt("warning", t, n);
|
|
1227
1226
|
}
|
|
1228
1227
|
function qt(e) {
|
|
1229
|
-
let t =
|
|
1230
|
-
|
|
1228
|
+
let t = Yt(e), n = ir();
|
|
1229
|
+
Ft && Vt && Ft("%c" + n + " DEBUG: " + String(t), "color:silver"), Wt("debug", t, n);
|
|
1230
|
+
}
|
|
1231
|
+
function Ht(e) {
|
|
1232
|
+
let t = Yt(e), n = ir();
|
|
1233
|
+
Ft && Vt && Ft("%c" + n + " MSG: " + String(t), "color:cyan"), Wt("msg", t, n);
|
|
1231
1234
|
}
|
|
1232
|
-
function
|
|
1233
|
-
|
|
1235
|
+
function zt(e, t) {
|
|
1236
|
+
Vt && (t && window.console.warn("=====> " + t), window.console.dir(e)), Wt("json", e, ir());
|
|
1234
1237
|
}
|
|
1235
|
-
function
|
|
1238
|
+
function Qt(e) {
|
|
1236
1239
|
return structuredClone(e);
|
|
1237
1240
|
}
|
|
1238
|
-
function
|
|
1241
|
+
function Xt(e, t) {
|
|
1239
1242
|
if (e === t) return !0;
|
|
1240
1243
|
if (null === e || null === t) return e === t;
|
|
1241
1244
|
if (typeof e != typeof t) return !1;
|
|
1242
1245
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1243
1246
|
if (Array.isArray(e)) {
|
|
1244
1247
|
if (e.length !== t.length) return !1;
|
|
1245
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1248
|
+
for (let n = 0; n < e.length; n++) if (!Xt(e[n], t[n])) return !1;
|
|
1246
1249
|
return !0;
|
|
1247
1250
|
}
|
|
1248
1251
|
if ("object" == typeof e) {
|
|
@@ -1250,211 +1253,211 @@ function Qt(e, t) {
|
|
|
1250
1253
|
if (n.length !== r.length) return !1;
|
|
1251
1254
|
for (let o = 0; o < n.length; o++) {
|
|
1252
1255
|
if (n[o] !== r[o]) return !1;
|
|
1253
|
-
if (!
|
|
1256
|
+
if (!Xt(e[n[o]], t[r[o]])) return !1;
|
|
1254
1257
|
}
|
|
1255
1258
|
return !0;
|
|
1256
1259
|
}
|
|
1257
1260
|
return e === t;
|
|
1258
1261
|
}
|
|
1259
|
-
function
|
|
1262
|
+
function Zt(e, t) {
|
|
1260
1263
|
if (!t) return e;
|
|
1261
1264
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1262
1265
|
return e;
|
|
1263
1266
|
}
|
|
1264
|
-
function
|
|
1267
|
+
function en(e, t) {
|
|
1265
1268
|
if (!t) return e;
|
|
1266
1269
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1267
1270
|
return e;
|
|
1268
1271
|
}
|
|
1269
|
-
function
|
|
1272
|
+
function tn(e, t) {
|
|
1270
1273
|
if (!t) return e;
|
|
1271
1274
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1272
1275
|
return e;
|
|
1273
1276
|
}
|
|
1274
|
-
function
|
|
1277
|
+
function nn(e, t) {
|
|
1275
1278
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1276
1279
|
}
|
|
1277
|
-
function
|
|
1280
|
+
function rn(e, t) {
|
|
1278
1281
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1279
1282
|
}
|
|
1280
|
-
function rn(e, t, n) {
|
|
1281
|
-
e[t] = n;
|
|
1282
|
-
}
|
|
1283
1283
|
function on(e, t, n) {
|
|
1284
1284
|
e[t] = n;
|
|
1285
1285
|
}
|
|
1286
|
-
function sn(e, t) {
|
|
1287
|
-
e
|
|
1286
|
+
function sn(e, t, n) {
|
|
1287
|
+
e[t] = n;
|
|
1288
1288
|
}
|
|
1289
1289
|
function ln(e, t) {
|
|
1290
1290
|
e.push(t);
|
|
1291
1291
|
}
|
|
1292
1292
|
function _n(e, t) {
|
|
1293
|
-
e.
|
|
1293
|
+
e.push(t);
|
|
1294
1294
|
}
|
|
1295
|
-
function an(e) {
|
|
1296
|
-
|
|
1295
|
+
function an(e, t) {
|
|
1296
|
+
e.splice(t, 1);
|
|
1297
1297
|
}
|
|
1298
1298
|
function un(e) {
|
|
1299
|
-
return gn(e) ? e.length : 0;
|
|
1299
|
+
return gn(e) ? Object.keys(e).length : 0;
|
|
1300
1300
|
}
|
|
1301
1301
|
function cn(e) {
|
|
1302
|
-
return
|
|
1302
|
+
return pn(e) ? e.length : 0;
|
|
1303
1303
|
}
|
|
1304
1304
|
function fn(e) {
|
|
1305
|
-
return
|
|
1305
|
+
return gn(e) ? Object.keys(e).length : pn(e) ? e.length : dn(e) && e.length > 0 ? 1 : 0;
|
|
1306
1306
|
}
|
|
1307
1307
|
function gn(e) {
|
|
1308
|
-
return Array.isArray(e);
|
|
1308
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1309
1309
|
}
|
|
1310
1310
|
function pn(e) {
|
|
1311
|
-
return
|
|
1311
|
+
return Array.isArray(e);
|
|
1312
1312
|
}
|
|
1313
1313
|
function dn(e) {
|
|
1314
|
-
return "
|
|
1314
|
+
return "string" == typeof e;
|
|
1315
1315
|
}
|
|
1316
1316
|
function bn(e) {
|
|
1317
|
-
return "
|
|
1317
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1318
1318
|
}
|
|
1319
1319
|
function mn(e) {
|
|
1320
|
-
return
|
|
1320
|
+
return "boolean" == typeof e;
|
|
1321
1321
|
}
|
|
1322
1322
|
function En(e) {
|
|
1323
|
-
return
|
|
1323
|
+
return null == e;
|
|
1324
1324
|
}
|
|
1325
1325
|
function Tn(e) {
|
|
1326
|
-
return
|
|
1326
|
+
return "function" == typeof e;
|
|
1327
1327
|
}
|
|
1328
1328
|
function hn(e) {
|
|
1329
|
-
return
|
|
1329
|
+
return e instanceof S;
|
|
1330
1330
|
}
|
|
1331
1331
|
function yn(e) {
|
|
1332
|
-
return dn(e)
|
|
1332
|
+
return !dn(e) || 0 === e.length;
|
|
1333
1333
|
}
|
|
1334
|
-
function vn(e
|
|
1335
|
-
return e
|
|
1334
|
+
function vn(e) {
|
|
1335
|
+
return bn(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1336
1336
|
}
|
|
1337
1337
|
function jn(e, t) {
|
|
1338
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
1339
|
+
}
|
|
1340
|
+
function Sn(e, t) {
|
|
1338
1341
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1339
1342
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1340
1343
|
}
|
|
1341
|
-
function
|
|
1342
|
-
if (
|
|
1343
|
-
if (
|
|
1344
|
+
function On(e, t) {
|
|
1345
|
+
if (gn(e) || gn(t) || pn(e) || pn(t)) return 0;
|
|
1346
|
+
if (bn(e) || bn(t)) {
|
|
1344
1347
|
let n = Number(e), r = Number(t);
|
|
1345
1348
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1346
1349
|
}
|
|
1347
|
-
if (
|
|
1350
|
+
if (mn(e) || mn(t)) {
|
|
1348
1351
|
let n = Number(e), r = Number(t);
|
|
1349
1352
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1350
1353
|
}
|
|
1351
|
-
return
|
|
1354
|
+
return jn(String(e), String(t));
|
|
1352
1355
|
}
|
|
1353
|
-
function
|
|
1354
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1356
|
+
function Nn(e, t) {
|
|
1357
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Nn(e, n);
|
|
1355
1358
|
else "string" == typeof t && delete e[t];
|
|
1356
1359
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1357
1360
|
}
|
|
1358
|
-
function
|
|
1361
|
+
function Rn(e, t) {
|
|
1359
1362
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1360
1363
|
}
|
|
1361
|
-
function
|
|
1362
|
-
if (e && !
|
|
1363
|
-
if (!
|
|
1364
|
+
function wn(e, t, n, r) {
|
|
1365
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t) && !pn(t)) return Bt(`${Fe(e)}: kw must be list or dict`), 0;
|
|
1366
|
+
if (!dn(n)) return Bt(`${Fe(e)}: path must be a string: ${String(n)}`), 0;
|
|
1364
1367
|
let o = n.split("`");
|
|
1365
1368
|
if (o.length <= 1) return t[n];
|
|
1366
1369
|
let s = o.length;
|
|
1367
|
-
for (let i = 0; i < s; i++) if (void 0 === (t = t[o[i]])) return void (r &&
|
|
1370
|
+
for (let i = 0; i < s; i++) if (void 0 === (t = t[o[i]])) return void (r && Bt(`${Fe(e)}: path not found: ${String(n)}`));
|
|
1368
1371
|
return t;
|
|
1369
1372
|
}
|
|
1370
|
-
function
|
|
1371
|
-
e && !
|
|
1373
|
+
function Dn(e, t, n) {
|
|
1374
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1372
1375
|
let [r, o] = function(e, t) {
|
|
1373
1376
|
let n = e.lastIndexOf(t);
|
|
1374
1377
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1375
1378
|
}(n, "`");
|
|
1376
|
-
return
|
|
1379
|
+
return yn(o) ? rn(t, n) : rn(wn(e, t, r, !0), o), 0;
|
|
1377
1380
|
}
|
|
1378
|
-
function
|
|
1379
|
-
e && !
|
|
1380
|
-
let s =
|
|
1381
|
-
const i = o && o &
|
|
1381
|
+
function xn(e, t, n, r, o) {
|
|
1382
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1383
|
+
let s = wn(e, t, n, !1);
|
|
1384
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1382
1385
|
if (void 0 === s) {
|
|
1383
1386
|
if (l) {
|
|
1384
1387
|
let o = Boolean(r);
|
|
1385
|
-
return
|
|
1388
|
+
return Ln(e, t, n, o), o;
|
|
1386
1389
|
}
|
|
1387
|
-
return i && (
|
|
1390
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), Boolean(r);
|
|
1388
1391
|
}
|
|
1389
|
-
return _ &&
|
|
1392
|
+
return _ && Dn(e, t, n), Boolean(s);
|
|
1390
1393
|
}
|
|
1391
|
-
function
|
|
1392
|
-
e && !
|
|
1393
|
-
let s =
|
|
1394
|
-
const i = o && o &
|
|
1394
|
+
function An(e, t, n, r, o) {
|
|
1395
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1396
|
+
let s = wn(e, t, n, !1);
|
|
1397
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1395
1398
|
if (void 0 === s) {
|
|
1396
1399
|
if (l) {
|
|
1397
1400
|
let o = parseInt(r);
|
|
1398
|
-
return
|
|
1401
|
+
return Ln(e, t, n, o), o;
|
|
1399
1402
|
}
|
|
1400
|
-
return i && (
|
|
1403
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), parseInt(r);
|
|
1401
1404
|
}
|
|
1402
|
-
return _ &&
|
|
1405
|
+
return _ && Dn(e, t, n), bn(s) ? parseInt(s) : (i && (Bt(`path value MUST BE a number: ${n}`), Ht(t)), parseInt(r));
|
|
1403
1406
|
}
|
|
1404
|
-
function
|
|
1405
|
-
e && !
|
|
1406
|
-
let s =
|
|
1407
|
-
const i = o && o &
|
|
1407
|
+
function kn(e, t, n, r, o) {
|
|
1408
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1409
|
+
let s = wn(e, t, n, !1);
|
|
1410
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1408
1411
|
if (void 0 === s) {
|
|
1409
1412
|
if (l) {
|
|
1410
1413
|
let o = String(r);
|
|
1411
|
-
return
|
|
1414
|
+
return Ln(e, t, n, o), o;
|
|
1412
1415
|
}
|
|
1413
|
-
return i && (
|
|
1416
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), String(r);
|
|
1414
1417
|
}
|
|
1415
|
-
return _ &&
|
|
1418
|
+
return _ && Dn(e, t, n), dn(s) ? String(s) : (i && (Bt(`${Fe(e)}: path value MUST BE a string: ${n}`), Ht(t)), String(r));
|
|
1416
1419
|
}
|
|
1417
|
-
function
|
|
1418
|
-
e && !
|
|
1419
|
-
let s =
|
|
1420
|
-
const i = o && o &
|
|
1420
|
+
function In(e, t, n, r, o) {
|
|
1421
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1422
|
+
let s = wn(e, t, n, !1);
|
|
1423
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1421
1424
|
if (void 0 === s) {
|
|
1422
1425
|
if (l) {
|
|
1423
1426
|
let o = r;
|
|
1424
|
-
return
|
|
1427
|
+
return Ln(e, t, n, o), o;
|
|
1425
1428
|
}
|
|
1426
|
-
return i && (
|
|
1429
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), r;
|
|
1427
1430
|
}
|
|
1428
|
-
return _ &&
|
|
1431
|
+
return _ && Dn(e, t, n), s;
|
|
1429
1432
|
}
|
|
1430
|
-
function
|
|
1431
|
-
e && !
|
|
1432
|
-
let s =
|
|
1433
|
-
const i = o && o &
|
|
1433
|
+
function $n(e, t, n, r, o) {
|
|
1434
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1435
|
+
let s = wn(e, t, n, !1);
|
|
1436
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1434
1437
|
if (void 0 === s) {
|
|
1435
1438
|
if (l) {
|
|
1436
1439
|
let o = Object(r);
|
|
1437
|
-
return
|
|
1440
|
+
return Ln(e, t, n, o), o;
|
|
1438
1441
|
}
|
|
1439
|
-
return i && (
|
|
1442
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), Object(r);
|
|
1440
1443
|
}
|
|
1441
|
-
return _ &&
|
|
1444
|
+
return _ && Dn(e, t, n), gn(s) ? Object(s) : (i && (Bt(`path value MUST BE a dict: ${n}`), Ht(t)), Object(r));
|
|
1442
1445
|
}
|
|
1443
|
-
function
|
|
1444
|
-
e && !
|
|
1445
|
-
let s =
|
|
1446
|
-
const i = o && o &
|
|
1446
|
+
function Cn(e, t, n, r, o) {
|
|
1447
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1448
|
+
let s = wn(e, t, n, !1);
|
|
1449
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1447
1450
|
if (void 0 === s) {
|
|
1448
1451
|
if (l) {
|
|
1449
1452
|
let o = r;
|
|
1450
|
-
return
|
|
1453
|
+
return Ln(e, t, n, o), o;
|
|
1451
1454
|
}
|
|
1452
|
-
return i && (
|
|
1455
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), r;
|
|
1453
1456
|
}
|
|
1454
|
-
return _ &&
|
|
1457
|
+
return _ && Dn(e, t, n), s;
|
|
1455
1458
|
}
|
|
1456
|
-
function
|
|
1457
|
-
if (e && !
|
|
1459
|
+
function Ln(e, t, n, r) {
|
|
1460
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t)) return Bt("kw is not an object"), -1;
|
|
1458
1461
|
let o = n.split("`");
|
|
1459
1462
|
if (o.length <= 1) return t[n] = r, 0;
|
|
1460
1463
|
let s = o.length;
|
|
@@ -1464,34 +1467,34 @@ function Cn(e, t, n, r) {
|
|
|
1464
1467
|
}
|
|
1465
1468
|
return 0;
|
|
1466
1469
|
}
|
|
1467
|
-
function
|
|
1468
|
-
if (e && !
|
|
1469
|
-
let s =
|
|
1470
|
-
return
|
|
1470
|
+
function Pn(e, t, n, r, o) {
|
|
1471
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t)) return Bt("kw is not an object"), -1;
|
|
1472
|
+
let s = $n(e, t, n, {}, !0);
|
|
1473
|
+
return gn(s) ? (s[r] = o, 0) : (Bt("subdict is not an object"), -1);
|
|
1471
1474
|
}
|
|
1472
|
-
function
|
|
1475
|
+
function Un(e, n, r) {
|
|
1473
1476
|
let o = "", s = !1;
|
|
1474
|
-
if (
|
|
1477
|
+
if (pn(n)) {
|
|
1475
1478
|
s = !1;
|
|
1476
1479
|
for (let i = 0; i < n.length; i++) {
|
|
1477
1480
|
let l = n[i];
|
|
1478
|
-
if (o =
|
|
1481
|
+
if (o = yn(r) ? t("%s", r) : t("%s`%d", r, i), s = Un(e, l, o), s) break;
|
|
1479
1482
|
}
|
|
1480
|
-
} else if (
|
|
1483
|
+
} else if (gn(n)) {
|
|
1481
1484
|
s = !0;
|
|
1482
1485
|
let i = Object.keys(n);
|
|
1483
1486
|
for (let l = 0; l < i.length; l++) {
|
|
1484
1487
|
let _ = i[l], a = n[_];
|
|
1485
|
-
if (o =
|
|
1486
|
-
if (s =
|
|
1488
|
+
if (o = yn(r) ? t("%s", _) : t("%s`%s", r, _), pn(a) || gn(a)) {
|
|
1489
|
+
if (s = Un(e, a, o), !s) break;
|
|
1487
1490
|
continue;
|
|
1488
1491
|
}
|
|
1489
|
-
let u =
|
|
1490
|
-
if (u || (u =
|
|
1492
|
+
let u = Cn(0, e, o, 0, 0);
|
|
1493
|
+
if (u || (u = nn(e, o)), !u) {
|
|
1491
1494
|
s = !1;
|
|
1492
1495
|
break;
|
|
1493
1496
|
}
|
|
1494
|
-
if (0 !==
|
|
1497
|
+
if (0 !== On(u, a)) {
|
|
1495
1498
|
s = !1;
|
|
1496
1499
|
break;
|
|
1497
1500
|
}
|
|
@@ -1499,58 +1502,58 @@ function Pn(e, n, r) {
|
|
|
1499
1502
|
}
|
|
1500
1503
|
return s;
|
|
1501
1504
|
}
|
|
1502
|
-
function
|
|
1503
|
-
return 0 ===
|
|
1505
|
+
function Fn(e, t) {
|
|
1506
|
+
return 0 === fn(t) || Un(e, t, "");
|
|
1504
1507
|
}
|
|
1505
|
-
function
|
|
1506
|
-
e && !
|
|
1508
|
+
function Gn(e, t, n, r) {
|
|
1509
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1507
1510
|
let o = {};
|
|
1508
|
-
if (
|
|
1511
|
+
if (dn(n) && !yn(n)) {
|
|
1509
1512
|
let s = n;
|
|
1510
|
-
t.hasOwnProperty(s) ? o[s] = t[s] : r &&
|
|
1511
|
-
} else if (
|
|
1513
|
+
t.hasOwnProperty(s) ? o[s] = t[s] : r && Bt(`${Fe(e)}: key not found: ${s}`);
|
|
1514
|
+
} else if (gn(n) && un(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? o[s] = t[s] : r && Bt(`${Fe(e)}: key not found: ${s}`);
|
|
1512
1515
|
else {
|
|
1513
|
-
if (!(
|
|
1516
|
+
if (!(pn(n) && cn(n) > 0)) return t;
|
|
1514
1517
|
for (let s = 0; s < n.length; s++) {
|
|
1515
1518
|
let i = n[s];
|
|
1516
|
-
t.hasOwnProperty(i) ? o[i] = t[i] : r &&
|
|
1519
|
+
t.hasOwnProperty(i) ? o[i] = t[i] : r && Bt(`${Fe(e)}: key not found: ${i}`);
|
|
1517
1520
|
}
|
|
1518
1521
|
}
|
|
1519
1522
|
return o;
|
|
1520
1523
|
}
|
|
1521
|
-
function
|
|
1524
|
+
function Vn(e, t, n, r) {
|
|
1522
1525
|
let o = {};
|
|
1523
|
-
if (
|
|
1526
|
+
if (Zt(o, t), dn(n) && !yn(n)) {
|
|
1524
1527
|
let s = n;
|
|
1525
|
-
|
|
1526
|
-
} else if (
|
|
1528
|
+
Cn(e, t, s, 0, 0) ? rn(o, s) : r && Bt(`${Fe(e)}: key not found: ${s}`);
|
|
1529
|
+
} else if (gn(n) && un(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? rn(o, s) : r && Bt(`${Fe(e)}: key not found: ${s}`);
|
|
1527
1530
|
else {
|
|
1528
|
-
if (!(
|
|
1531
|
+
if (!(pn(n) && cn(n) > 0)) return {};
|
|
1529
1532
|
for (let s = 0; s < n.length; s++) {
|
|
1530
1533
|
let i = n[s];
|
|
1531
|
-
t.hasOwnProperty(i) ?
|
|
1534
|
+
t.hasOwnProperty(i) ? rn(o, i) : r && Bt(`${Fe(e)}: key not found: ${i}`);
|
|
1532
1535
|
}
|
|
1533
1536
|
}
|
|
1534
1537
|
return o;
|
|
1535
1538
|
}
|
|
1536
|
-
function
|
|
1539
|
+
function Mn(e, t, n = !1) {
|
|
1537
1540
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1538
1541
|
let r = window.localStorage.getItem(e);
|
|
1539
|
-
return null === r ? (n &&
|
|
1542
|
+
return null === r ? (n && Wn(e, t), t) : JSON.parse(r);
|
|
1540
1543
|
} catch (n) {
|
|
1541
1544
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1542
1545
|
}
|
|
1543
1546
|
}
|
|
1544
|
-
function
|
|
1547
|
+
function Wn(e, t) {
|
|
1545
1548
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1546
|
-
if (!e || void 0 === t) return
|
|
1549
|
+
if (!e || void 0 === t) return Bt(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1547
1550
|
try {
|
|
1548
1551
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1549
1552
|
} catch (t) {
|
|
1550
|
-
return
|
|
1553
|
+
return Bt(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1551
1554
|
}
|
|
1552
1555
|
}
|
|
1553
|
-
function
|
|
1556
|
+
function Kn(e) {
|
|
1554
1557
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1555
1558
|
window.localStorage.removeItem(e);
|
|
1556
1559
|
} catch (t) {
|
|
@@ -1558,46 +1561,46 @@ function Wn(e) {
|
|
|
1558
1561
|
}
|
|
1559
1562
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1560
1563
|
}
|
|
1561
|
-
function
|
|
1562
|
-
if (
|
|
1563
|
-
if (
|
|
1564
|
+
function Yn(e, t) {
|
|
1565
|
+
if (En(e) || En(t)) return !0;
|
|
1566
|
+
if (pn(e)) {
|
|
1564
1567
|
if (0 === e.length) return !0;
|
|
1565
1568
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1566
|
-
} else if (
|
|
1569
|
+
} else if (gn(e)) {
|
|
1567
1570
|
if (0 === Object.keys(e).length) return !0;
|
|
1568
1571
|
for (let n in e) if (n === t) return !0;
|
|
1569
|
-
} else if (
|
|
1572
|
+
} else if (dn(e) && e === t) return !0;
|
|
1570
1573
|
return !1;
|
|
1571
1574
|
}
|
|
1572
|
-
function
|
|
1573
|
-
if (e && !
|
|
1574
|
-
o || (o =
|
|
1575
|
+
function Bn(e, t, n, r, o) {
|
|
1576
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
1577
|
+
o || (o = Fn);
|
|
1575
1578
|
let s = [];
|
|
1576
|
-
if (
|
|
1579
|
+
if (pn(t)) for (let i = 0; i < t.length; i++) {
|
|
1577
1580
|
let l, _ = t[i];
|
|
1578
|
-
if (
|
|
1581
|
+
if (gn(_)) l = kn(e, _, "id", "", 0);
|
|
1579
1582
|
else {
|
|
1580
|
-
if (!
|
|
1583
|
+
if (!dn(_)) continue;
|
|
1581
1584
|
l = _;
|
|
1582
1585
|
}
|
|
1583
|
-
|
|
1586
|
+
Yn(n, l) && o(_, r) && s.push(_);
|
|
1584
1587
|
}
|
|
1585
1588
|
else {
|
|
1586
|
-
if (!
|
|
1589
|
+
if (!gn(t)) return Bt("kw_collect() BAD kw parameter"), null;
|
|
1587
1590
|
for (let e of Object.keys(t)) {
|
|
1588
1591
|
let i = t[e];
|
|
1589
|
-
|
|
1592
|
+
Yn(n, e) && o(i, r) && s.push(i);
|
|
1590
1593
|
}
|
|
1591
1594
|
}
|
|
1592
1595
|
return s;
|
|
1593
1596
|
}
|
|
1594
|
-
function
|
|
1597
|
+
function Jn(e, t) {
|
|
1595
1598
|
if (!e) return -1;
|
|
1596
1599
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1597
1600
|
return -1;
|
|
1598
1601
|
}
|
|
1599
|
-
function
|
|
1600
|
-
if (!e || !t) return
|
|
1602
|
+
function qn(e, t, n) {
|
|
1603
|
+
if (!e || !t) return Bt("ERROR: str_in_list() list or str empty"), !1;
|
|
1601
1604
|
let r = e.length;
|
|
1602
1605
|
if (n) {
|
|
1603
1606
|
t = t.toLowerCase();
|
|
@@ -1608,7 +1611,7 @@ function Jn(e, t, n) {
|
|
|
1608
1611
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1609
1612
|
return !1;
|
|
1610
1613
|
}
|
|
1611
|
-
function
|
|
1614
|
+
function Hn(e, t) {
|
|
1612
1615
|
try {
|
|
1613
1616
|
let n = e.__md_iev__;
|
|
1614
1617
|
if (n) return n[t];
|
|
@@ -1616,35 +1619,35 @@ function qn(e, t) {
|
|
|
1616
1619
|
return;
|
|
1617
1620
|
}
|
|
1618
1621
|
}
|
|
1619
|
-
function
|
|
1622
|
+
function zn(e, t, n) {
|
|
1620
1623
|
let r = e.__md_iev__;
|
|
1621
1624
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1622
1625
|
}
|
|
1623
|
-
function
|
|
1624
|
-
if (!
|
|
1626
|
+
function Qn(e, t, n, r) {
|
|
1627
|
+
if (!hn(e)) return Bt("gobj is not a GObj"), null;
|
|
1625
1628
|
if (!t) return;
|
|
1626
|
-
let o =
|
|
1627
|
-
o || (o = [],
|
|
1629
|
+
let o = Hn(t, n);
|
|
1630
|
+
o || (o = [], zn(t, n, o));
|
|
1628
1631
|
try {
|
|
1629
|
-
|
|
1632
|
+
pn(o) && o.unshift(r);
|
|
1630
1633
|
} catch (e) {
|
|
1631
|
-
|
|
1634
|
+
Bt(e);
|
|
1632
1635
|
}
|
|
1633
1636
|
}
|
|
1634
|
-
function
|
|
1635
|
-
if (!
|
|
1636
|
-
if (!
|
|
1637
|
-
let o =
|
|
1638
|
-
return o ? 0 === o.length ? (r &&
|
|
1637
|
+
function Xn(e, t, n, r) {
|
|
1638
|
+
if (!hn(e)) return Bt("gobj is not a GObj"), null;
|
|
1639
|
+
if (!gn(t)) return Bt("kw is not a dict"), null;
|
|
1640
|
+
let o = Hn(t, n);
|
|
1641
|
+
return o ? 0 === o.length ? (r && Bt(`stack empty: ${n}`), null) : o[0] : (r && Bt(`stack NOT FOUND: ${n}`), null);
|
|
1639
1642
|
}
|
|
1640
|
-
function
|
|
1641
|
-
return
|
|
1643
|
+
function Zn(e, t, n) {
|
|
1644
|
+
return yn(n) ? Dn(e, t, "__md_iev__`__msg_type__") : Pn(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1642
1645
|
}
|
|
1643
|
-
function
|
|
1644
|
-
return
|
|
1646
|
+
function er(e, t) {
|
|
1647
|
+
return kn(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1645
1648
|
}
|
|
1646
|
-
function
|
|
1647
|
-
void 0 !== n &&
|
|
1649
|
+
function tr(e, t, n) {
|
|
1650
|
+
void 0 !== n && dn(n) || (n = "");
|
|
1648
1651
|
for (let r of Object.keys(e)) {
|
|
1649
1652
|
if (!e.hasOwnProperty(r)) continue;
|
|
1650
1653
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -1653,10 +1656,10 @@ function er(e, t, n) {
|
|
|
1653
1656
|
r,
|
|
1654
1657
|
e[r],
|
|
1655
1658
|
n
|
|
1656
|
-
]),
|
|
1659
|
+
]), gn(e[r]) && tr(e[r], t, n), n = n.slice(0, -o.length);
|
|
1657
1660
|
}
|
|
1658
1661
|
}
|
|
1659
|
-
function
|
|
1662
|
+
function nr(e, t, n, r) {
|
|
1660
1663
|
if (!e) return null;
|
|
1661
1664
|
let o, s = e.length;
|
|
1662
1665
|
for (o = 0; o < s; o++) {
|
|
@@ -1664,15 +1667,15 @@ function tr(e, t, n, r) {
|
|
|
1664
1667
|
if (s) {
|
|
1665
1668
|
let e = s.id;
|
|
1666
1669
|
if (e && e === n) return s;
|
|
1667
|
-
if (r &&
|
|
1668
|
-
let e =
|
|
1670
|
+
if (r && Rn(s, t)) {
|
|
1671
|
+
let e = nr(s[t], t, n, r);
|
|
1669
1672
|
if (e) return e;
|
|
1670
1673
|
}
|
|
1671
1674
|
}
|
|
1672
1675
|
}
|
|
1673
1676
|
return null;
|
|
1674
1677
|
}
|
|
1675
|
-
function
|
|
1678
|
+
function rr(e) {
|
|
1676
1679
|
function t(e) {
|
|
1677
1680
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1678
1681
|
switch (t.length % 4) {
|
|
@@ -1703,38 +1706,38 @@ function nr(e) {
|
|
|
1703
1706
|
signature: t(n[2])
|
|
1704
1707
|
};
|
|
1705
1708
|
}
|
|
1706
|
-
function
|
|
1709
|
+
function or(e) {
|
|
1707
1710
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1708
1711
|
}
|
|
1709
|
-
function
|
|
1712
|
+
function sr(e) {
|
|
1710
1713
|
const t = document.createElement("template");
|
|
1711
1714
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1712
1715
|
}
|
|
1713
|
-
function
|
|
1716
|
+
function ir() {
|
|
1714
1717
|
const e = /* @__PURE__ */ new Date(), t = e.toISOString().slice(0, 19), n = String(e.getMilliseconds()).padStart(3, "0"), r = e.getTimezoneOffset();
|
|
1715
1718
|
return `${t}.${n}${r > 0 ? "-" : "+"}${String(Math.abs(r) / 60).padStart(2, "0")}${String(Math.abs(r) % 60).padStart(2, "0")}`;
|
|
1716
1719
|
}
|
|
1717
|
-
function
|
|
1720
|
+
function lr(e, t) {
|
|
1718
1721
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
1719
1722
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
1720
1723
|
return -1;
|
|
1721
1724
|
}
|
|
1722
|
-
function
|
|
1725
|
+
function _r() {
|
|
1723
1726
|
let e = "";
|
|
1724
1727
|
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;
|
|
1725
1728
|
}
|
|
1726
|
-
function
|
|
1729
|
+
function ar(e) {
|
|
1727
1730
|
let t = null;
|
|
1728
1731
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
1729
1732
|
}
|
|
1730
|
-
function
|
|
1733
|
+
function ur(e) {
|
|
1731
1734
|
return "persistent-attrs-" + Fe(e);
|
|
1732
1735
|
}
|
|
1733
|
-
function
|
|
1734
|
-
if (
|
|
1736
|
+
function cr(e, t) {
|
|
1737
|
+
if (dn(t)) {
|
|
1735
1738
|
if (-1 === t.indexOf("^")) {
|
|
1736
1739
|
let n, r, o = e.fkey;
|
|
1737
|
-
if (1 !==
|
|
1740
|
+
if (1 !== un(o)) return Bt("bad fkey 1"), Bt(e), Bt(t), null;
|
|
1738
1741
|
for (const e of Object.keys(o)) {
|
|
1739
1742
|
n = e, r = o[e];
|
|
1740
1743
|
break;
|
|
@@ -1747,20 +1750,20 @@ function ur(e, t) {
|
|
|
1747
1750
|
}
|
|
1748
1751
|
{
|
|
1749
1752
|
let n = t.split("^");
|
|
1750
|
-
return 3 !== n.length ? (
|
|
1753
|
+
return 3 !== n.length ? (Bt("bad fkey 2"), Bt(e), Bt(t), null) : {
|
|
1751
1754
|
topic_name: n[0],
|
|
1752
1755
|
id: n[1],
|
|
1753
1756
|
hook_name: n[2]
|
|
1754
1757
|
};
|
|
1755
1758
|
}
|
|
1756
1759
|
}
|
|
1757
|
-
return
|
|
1760
|
+
return gn(t) ? {
|
|
1758
1761
|
topic_name: t.topic_name,
|
|
1759
1762
|
id: t.id,
|
|
1760
1763
|
hook_name: t.hook_name
|
|
1761
|
-
} : (
|
|
1764
|
+
} : (Bt("bad fkey 3"), Bt(e), Bt(t), null);
|
|
1762
1765
|
}
|
|
1763
|
-
var
|
|
1766
|
+
var fr = [
|
|
1764
1767
|
"string",
|
|
1765
1768
|
"integer",
|
|
1766
1769
|
"object",
|
|
@@ -1770,7 +1773,7 @@ var cr = [
|
|
|
1770
1773
|
"real",
|
|
1771
1774
|
"boolean",
|
|
1772
1775
|
"blob"
|
|
1773
|
-
],
|
|
1776
|
+
], gr = [
|
|
1774
1777
|
"persistent",
|
|
1775
1778
|
"required",
|
|
1776
1779
|
"notnull",
|
|
@@ -1782,7 +1785,7 @@ var cr = [
|
|
|
1782
1785
|
"stats",
|
|
1783
1786
|
"rstats",
|
|
1784
1787
|
"pstats"
|
|
1785
|
-
],
|
|
1788
|
+
], pr = [
|
|
1786
1789
|
"hook",
|
|
1787
1790
|
"fkey",
|
|
1788
1791
|
"enum",
|
|
@@ -1809,7 +1812,7 @@ var cr = [
|
|
|
1809
1812
|
"coordinates",
|
|
1810
1813
|
"gbuffer"
|
|
1811
1814
|
];
|
|
1812
|
-
function
|
|
1815
|
+
function dr(e) {
|
|
1813
1816
|
let t = {
|
|
1814
1817
|
name: e.id,
|
|
1815
1818
|
header: e.header,
|
|
@@ -1827,7 +1830,7 @@ function pr(e) {
|
|
|
1827
1830
|
if (!e.flag) return t;
|
|
1828
1831
|
for (let n = 0; n < e.flag.length; n++) {
|
|
1829
1832
|
let r = e.flag[n];
|
|
1830
|
-
if (
|
|
1833
|
+
if (qn(pr, r)) {
|
|
1831
1834
|
switch (r) {
|
|
1832
1835
|
case "enum":
|
|
1833
1836
|
t.enum_list = e.enum;
|
|
@@ -1838,7 +1841,7 @@ function pr(e) {
|
|
|
1838
1841
|
case "table": t.enum_list = e.table;
|
|
1839
1842
|
}
|
|
1840
1843
|
t.type = r;
|
|
1841
|
-
} else if (
|
|
1844
|
+
} else if (qn(gr, r)) switch (r) {
|
|
1842
1845
|
case "writable":
|
|
1843
1846
|
t.is_writable = !0;
|
|
1844
1847
|
break;
|
|
@@ -1851,36 +1854,36 @@ function pr(e) {
|
|
|
1851
1854
|
}
|
|
1852
1855
|
return t;
|
|
1853
1856
|
}
|
|
1854
|
-
var
|
|
1857
|
+
var br = [
|
|
1855
1858
|
v(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1856
1859
|
v(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1857
1860
|
v(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1858
1861
|
y()
|
|
1859
|
-
],
|
|
1862
|
+
], mr = {
|
|
1860
1863
|
periodic: !1,
|
|
1861
1864
|
msec: 0,
|
|
1862
1865
|
timer_id: -1
|
|
1863
|
-
},
|
|
1864
|
-
function
|
|
1866
|
+
}, Er = null;
|
|
1867
|
+
function Tr(e, t, n, r) {
|
|
1865
1868
|
let o = e.priv, s = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1866
1869
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
1867
|
-
|
|
1868
|
-
}, o.msec) : o.timer_id = -1, We(e) ?
|
|
1870
|
+
vt(e, "EV_TIMEOUT", {}, e);
|
|
1871
|
+
}, o.msec) : o.timer_id = -1, We(e) ? vt(Ve(e), s, {}, e) : It(e, s, {}), o.periodic || -1 !== o.timer_id || De(e) && Se(e), 0;
|
|
1869
1872
|
}
|
|
1870
|
-
var
|
|
1873
|
+
var hr = {
|
|
1871
1874
|
mt_create: function(e) {
|
|
1872
1875
|
let t = e.priv;
|
|
1873
|
-
const n =
|
|
1874
|
-
n &&
|
|
1876
|
+
const n = at(e, "subscriber");
|
|
1877
|
+
n && Dt(e, null, {}, n), t.periodic = it(e, "periodic"), t.msec = lt(e, "msec");
|
|
1875
1878
|
},
|
|
1876
1879
|
mt_writing: function(e, t) {
|
|
1877
1880
|
let n = e.priv;
|
|
1878
1881
|
switch (t) {
|
|
1879
1882
|
case "periodic":
|
|
1880
|
-
n.periodic =
|
|
1883
|
+
n.periodic = it(e, "periodic");
|
|
1881
1884
|
break;
|
|
1882
|
-
case "msec": n.msec =
|
|
1883
|
-
|
|
1885
|
+
case "msec": n.msec = lt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
1886
|
+
vt(e, "EV_TIMEOUT", {}, e);
|
|
1884
1887
|
}, n.msec)), n.msec > 0 ? De(e) || ye(e) : De(e) && Se(e);
|
|
1885
1888
|
}
|
|
1886
1889
|
},
|
|
@@ -1888,20 +1891,20 @@ var Tr = {
|
|
|
1888
1891
|
return 0;
|
|
1889
1892
|
},
|
|
1890
1893
|
mt_stop: function(e) {
|
|
1891
|
-
return
|
|
1894
|
+
return ft(e, "msec", -1), 0;
|
|
1892
1895
|
},
|
|
1893
1896
|
mt_destroy: function(e) {}
|
|
1894
1897
|
};
|
|
1895
|
-
function hr(e, t) {
|
|
1896
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Yt("not C_TIMER GObj"), -1) : (ut(e, "periodic", !1), void ct(e, "msec", t)) : (Yt("not GObj TYPE"), -1);
|
|
1897
|
-
}
|
|
1898
1898
|
function yr(e, t) {
|
|
1899
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (
|
|
1899
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Bt("not C_TIMER GObj"), -1) : (ct(e, "periodic", !1), void ft(e, "msec", t)) : (Bt("not GObj TYPE"), -1);
|
|
1900
|
+
}
|
|
1901
|
+
function vr(e, t) {
|
|
1902
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Bt("not C_TIMER GObj"), -1) : (ct(e, "periodic", !0), void ft(e, "msec", t)) : (Bt("not GObj TYPE"), -1);
|
|
1900
1903
|
}
|
|
1901
|
-
function
|
|
1902
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (
|
|
1904
|
+
function jr(e) {
|
|
1905
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Bt("not C_TIMER GObj"), -1) : void ft(e, "msec", -1) : (Bt("not GObj TYPE"), -1);
|
|
1903
1906
|
}
|
|
1904
|
-
var
|
|
1907
|
+
var Sr = [
|
|
1905
1908
|
v(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
1906
1909
|
v(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
1907
1910
|
v(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -1927,21 +1930,21 @@ var jr = [
|
|
|
1927
1930
|
v(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
1928
1931
|
v(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
1929
1932
|
y()
|
|
1930
|
-
],
|
|
1931
|
-
function
|
|
1932
|
-
return
|
|
1933
|
+
], Or = { gobj_timer: null }, Nr = null;
|
|
1934
|
+
function Rr(e, t, n, r) {
|
|
1935
|
+
return It(e, t, n), 0;
|
|
1933
1936
|
}
|
|
1934
|
-
var
|
|
1937
|
+
var wr = {
|
|
1935
1938
|
mt_create: function(e) {
|
|
1936
1939
|
let t = e.priv;
|
|
1937
|
-
|
|
1940
|
+
gt(e, "start_date", ir()), gt(e, "node_uuid", _r()), e.priv.gobj_timer = Te(Pe(e), "C_TIMER", {}, e), t.periodic_timeout = ot(e, "periodic_timeout");
|
|
1938
1941
|
},
|
|
1939
1942
|
mt_writing: function(e, t) {},
|
|
1940
1943
|
mt_start: function(e) {
|
|
1941
|
-
return
|
|
1944
|
+
return vr(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
1942
1945
|
},
|
|
1943
1946
|
mt_stop: function(e) {
|
|
1944
|
-
return
|
|
1947
|
+
return jr(e.priv.gobj_timer), Ne(e), 0;
|
|
1945
1948
|
},
|
|
1946
1949
|
mt_destroy: function(e) {},
|
|
1947
1950
|
mt_play: function(e) {
|
|
@@ -1952,7 +1955,7 @@ var Rr = {
|
|
|
1952
1955
|
return we(ce()), 0;
|
|
1953
1956
|
}
|
|
1954
1957
|
};
|
|
1955
|
-
var
|
|
1958
|
+
var Dr = "ievent_gate_stack", xr = [
|
|
1956
1959
|
v(E.DTP_STRING, "wanted_yuno_role", T.SDF_RD, "", "wanted yuno role"),
|
|
1957
1960
|
v(E.DTP_STRING, "wanted_yuno_name", T.SDF_RD, "", "wanted yuno name"),
|
|
1958
1961
|
v(E.DTP_STRING, "wanted_yuno_service", T.SDF_RD, "", "wanted yuno service"),
|
|
@@ -1969,7 +1972,7 @@ var wr = "ievent_gate_stack", Dr = [
|
|
|
1969
1972
|
v(E.DTP_INTEGER, "timeout_idack", T.SDF_RD, "5000", "timeout waiting idAck"),
|
|
1970
1973
|
v(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
1971
1974
|
y()
|
|
1972
|
-
],
|
|
1975
|
+
], Ar = {
|
|
1973
1976
|
url: null,
|
|
1974
1977
|
remote_yuno_name: null,
|
|
1975
1978
|
remote_yuno_role: null,
|
|
@@ -1979,87 +1982,87 @@ var wr = "ievent_gate_stack", Dr = [
|
|
|
1979
1982
|
websocket: null,
|
|
1980
1983
|
inside_on_open: !1,
|
|
1981
1984
|
retry_ms: 0
|
|
1982
|
-
},
|
|
1983
|
-
function
|
|
1984
|
-
e.priv.websocket &&
|
|
1985
|
-
const t =
|
|
1985
|
+
}, kr = null;
|
|
1986
|
+
function Ir(e) {
|
|
1987
|
+
e.priv.websocket && Bt("Websocket ALREADY setup");
|
|
1988
|
+
const t = _t(e, "url");
|
|
1986
1989
|
let n;
|
|
1987
|
-
|
|
1990
|
+
qt(`====> Starting WebSocket to '${t}' (${Fe(e)})`);
|
|
1988
1991
|
try {
|
|
1989
1992
|
n = new WebSocket(t);
|
|
1990
1993
|
} catch (n) {
|
|
1991
|
-
return
|
|
1994
|
+
return Bt(`${Fe(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
1992
1995
|
}
|
|
1993
1996
|
return n ? (n.onopen = () => {
|
|
1994
|
-
|
|
1997
|
+
vt(e, "EV_ON_OPEN", { url: t }, e);
|
|
1995
1998
|
}, n.onmessage = (n) => {
|
|
1996
|
-
|
|
1999
|
+
vt(e, "EV_ON_MESSAGE", {
|
|
1997
2000
|
url: t,
|
|
1998
2001
|
data: n.data
|
|
1999
2002
|
}, e);
|
|
2000
2003
|
}, n.onclose = (n) => {
|
|
2001
|
-
Ke(e) || (
|
|
2004
|
+
Ke(e) || (it(Ie(), "browser_beforeunload") ? Jt("Close websocket by unload page") : vt(e, "EV_ON_CLOSE", {
|
|
2002
2005
|
url: t,
|
|
2003
2006
|
e: n
|
|
2004
2007
|
}, e));
|
|
2005
|
-
}, n) : (
|
|
2008
|
+
}, n) : (Bt(`${Fe(e)}: Failed to initialize WebSocket.`), null);
|
|
2006
2009
|
}
|
|
2007
|
-
function
|
|
2010
|
+
function $r(e, t = 1e3, n = "") {
|
|
2008
2011
|
let r = e.priv, o = r.websocket;
|
|
2009
2012
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
2010
|
-
|
|
2013
|
+
qt(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2011
2014
|
try {
|
|
2012
2015
|
o.close(t, n);
|
|
2013
2016
|
} catch (e) {
|
|
2014
|
-
|
|
2017
|
+
Bt("Error closing WebSocket:", e.message);
|
|
2015
2018
|
}
|
|
2016
|
-
} else
|
|
2019
|
+
} else Jt("WebSocket is already closed or in the process of closing.");
|
|
2017
2020
|
}
|
|
2018
|
-
function
|
|
2019
|
-
let r =
|
|
2021
|
+
function Cr(e, t, n) {
|
|
2022
|
+
let r = ir();
|
|
2020
2023
|
try {
|
|
2021
|
-
|
|
2024
|
+
qt("\n" + r + " " + t + "\n"), zt(n);
|
|
2022
2025
|
} catch (e) {
|
|
2023
|
-
|
|
2026
|
+
qt("ERROR in trace_inter_event: " + e);
|
|
2024
2027
|
}
|
|
2025
2028
|
}
|
|
2026
|
-
var
|
|
2029
|
+
var Lr = class {
|
|
2027
2030
|
constructor(e, t) {
|
|
2028
2031
|
this.event = e, this.kw = t || {};
|
|
2029
2032
|
}
|
|
2030
2033
|
};
|
|
2031
|
-
function
|
|
2034
|
+
function Pr(e, t, n, r) {
|
|
2032
2035
|
return function(e, t) {
|
|
2033
2036
|
let n = e.priv, r = JSON.stringify(t);
|
|
2034
|
-
if (
|
|
2035
|
-
let n =
|
|
2036
|
-
s ? s(o, t, 1, r.length) :
|
|
2037
|
+
if (it(Ie(), "trace_inter_event")) {
|
|
2038
|
+
let n = _t(e, "url"), o = Pe(Ie()) + " ==> " + n, s = ot(Ie(), "trace_ievent_callback");
|
|
2039
|
+
s ? s(o, t, 1, r.length) : Cr(0, o, t);
|
|
2037
2040
|
}
|
|
2038
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2041
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return Jt(`${Fe(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2039
2042
|
try {
|
|
2040
2043
|
n.websocket.send(r);
|
|
2041
2044
|
} catch (t) {
|
|
2042
|
-
|
|
2045
|
+
Bt(`${Fe(e)}: send_iev(): ${t}`);
|
|
2043
2046
|
}
|
|
2044
2047
|
return 0;
|
|
2045
2048
|
}(e, function(e, t) {
|
|
2046
|
-
return
|
|
2049
|
+
return yn(e) ? (Bt("iev_create() event NULL"), null) : new Lr(e, t);
|
|
2047
2050
|
}(t, n));
|
|
2048
2051
|
}
|
|
2049
|
-
function
|
|
2050
|
-
return
|
|
2051
|
-
dst_yuno:
|
|
2052
|
-
dst_role:
|
|
2052
|
+
function Ur(e, t, n) {
|
|
2053
|
+
return yn(n) && (n = _t(e, "wanted_yuno_service")), {
|
|
2054
|
+
dst_yuno: _t(e, "wanted_yuno_name"),
|
|
2055
|
+
dst_role: _t(e, "wanted_yuno_role"),
|
|
2053
2056
|
dst_service: n,
|
|
2054
2057
|
src_yuno: $e(),
|
|
2055
2058
|
src_role: Ce(),
|
|
2056
2059
|
src_service: t,
|
|
2057
|
-
host:
|
|
2060
|
+
host: _r()
|
|
2058
2061
|
};
|
|
2059
2062
|
}
|
|
2060
|
-
function
|
|
2061
|
-
let t = e.priv, n = ke(Ie()), r =
|
|
2062
|
-
l && l.length || (l =
|
|
2063
|
+
function Fr(e) {
|
|
2064
|
+
let t = e.priv, n = ke(Ie()), r = _t(Ie(), "yuno_version"), o = _t(Ie(), "yuno_release"), i = _t(Ie(), "yuno_tag"), l = ot(e, "required_services");
|
|
2065
|
+
l && l.length || (l = ot(Ie(), "required_services"));
|
|
2063
2066
|
let _ = {
|
|
2064
2067
|
yuno_role: Ce(),
|
|
2065
2068
|
yuno_id: Le(),
|
|
@@ -2071,38 +2074,38 @@ function Ur(e) {
|
|
|
2071
2074
|
playing: n,
|
|
2072
2075
|
pid: 0,
|
|
2073
2076
|
watcher_pid: 0,
|
|
2074
|
-
jwt:
|
|
2075
|
-
username:
|
|
2077
|
+
jwt: _t(e, "jwt"),
|
|
2078
|
+
username: _t(Ie(), "__username__"),
|
|
2076
2079
|
launch_id: 0,
|
|
2077
|
-
yuno_startdate:
|
|
2078
|
-
id:
|
|
2080
|
+
yuno_startdate: _t(Ie(), "start_date"),
|
|
2081
|
+
id: _r(),
|
|
2079
2082
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2080
2083
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2081
2084
|
required_services: l
|
|
2082
2085
|
};
|
|
2083
|
-
return
|
|
2086
|
+
return Qn(e, _, Dr, Ur(e, Pe(Ve(e)), null)), Zn(e, _, "__identity__"), yr(t.gobj_timer, lt(e, "timeout_idack")), Pr(e, "EV_IDENTITY_CARD", _);
|
|
2084
2087
|
}
|
|
2085
|
-
function
|
|
2086
|
-
if (
|
|
2088
|
+
function Gr(e, t) {
|
|
2089
|
+
if (yn(t.event)) return -1;
|
|
2087
2090
|
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, l = t.subscriber;
|
|
2088
2091
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
2089
|
-
return
|
|
2090
|
-
}
|
|
2091
|
-
function Gr(e, t, n, r) {
|
|
2092
|
-
let o = e.priv;
|
|
2093
|
-
return De(e) && (o.websocket = kr(e)), 0;
|
|
2092
|
+
return Qn(e, n, Dr, Ur(e, Pe(l), i)), Zn(e, n, "__subscribing__"), Pr(e, t.event, n);
|
|
2094
2093
|
}
|
|
2095
2094
|
function Vr(e, t, n, r) {
|
|
2096
|
-
|
|
2095
|
+
let o = e.priv;
|
|
2096
|
+
return De(e) && (o.websocket = Ir(e)), 0;
|
|
2097
2097
|
}
|
|
2098
2098
|
function Mr(e, t, n, r) {
|
|
2099
|
+
return qt("Websocket opened: " + e.priv.url), Fr(e), 0;
|
|
2100
|
+
}
|
|
2101
|
+
function Wr(e, t, n, r) {
|
|
2099
2102
|
let o = e.priv, s = n.e, i = n.url;
|
|
2100
|
-
return
|
|
2103
|
+
return Kt(), Jt(`${Fe(e)}: WebSocket closed ${i} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), o.websocket && (o.websocket.onopen = null, o.websocket.onmessage = null, o.websocket.onerror = null, o.websocket.onclose = null, o.websocket = null), o.inform_on_close ? (o.inform_on_close = !1, It(e, "EV_ON_CLOSE", {
|
|
2101
2104
|
url: i,
|
|
2102
2105
|
remote_yuno_name: o.remote_yuno_name,
|
|
2103
2106
|
remote_yuno_role: o.remote_yuno_role,
|
|
2104
2107
|
remote_yuno_service: o.remote_yuno_service
|
|
2105
|
-
})) : (
|
|
2108
|
+
})) : (Jt(`${Fe(e)}: EV_ON_OPEN_ERROR cannot open ${i} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), It(e, "EV_ON_OPEN_ERROR", {
|
|
2106
2109
|
url: i,
|
|
2107
2110
|
remote_yuno_name: o.remote_yuno_name,
|
|
2108
2111
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -2110,27 +2113,27 @@ function Mr(e, t, n, r) {
|
|
|
2110
2113
|
code: s.code,
|
|
2111
2114
|
reason: s.reason,
|
|
2112
2115
|
was_clean: s.wasClean
|
|
2113
|
-
})), De(e) &&
|
|
2114
|
-
let t = e.priv, n =
|
|
2116
|
+
})), De(e) && yr(o.gobj_timer, function(e) {
|
|
2117
|
+
let t = e.priv, n = lt(e, "timeout_retry"), r = lt(e, "timeout_retry_max");
|
|
2115
2118
|
r < n && (r = n);
|
|
2116
2119
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2117
2120
|
let o = .2 * t.retry_ms, s = t.retry_ms - o + 2 * Math.random() * o;
|
|
2118
2121
|
return Math.max(1, Math.round(s));
|
|
2119
2122
|
}(e)), 0;
|
|
2120
2123
|
}
|
|
2121
|
-
function Wr(e, t, n, r) {
|
|
2122
|
-
return Ur(e), 0;
|
|
2123
|
-
}
|
|
2124
2124
|
function Kr(e, t, n, r) {
|
|
2125
|
+
return Fr(e), 0;
|
|
2126
|
+
}
|
|
2127
|
+
function Yr(e, t, n, r) {
|
|
2125
2128
|
let o = e.priv;
|
|
2126
|
-
|
|
2127
|
-
let s =
|
|
2128
|
-
|
|
2129
|
-
let a =
|
|
2129
|
+
jr(o.gobj_timer);
|
|
2130
|
+
let s = Xn(e, n, Dr, !0), i = kn(e, s, "src_yuno", ""), l = kn(e, s, "src_role", ""), _ = kn(e, s, "src_service", "");
|
|
2131
|
+
gt(e, "remote_yuno_name", i), gt(e, "remote_yuno_role", l), gt(e, "remote_yuno_service", _);
|
|
2132
|
+
let a = An(e, n, "result", -1, 0), u = kn(e, n, "comment", "", 0), c = kn(e, n, "username", "", 0), f = Cn(e, n, "services_roles", {});
|
|
2130
2133
|
if (a < 0) {
|
|
2131
|
-
|
|
2134
|
+
$r(e);
|
|
2132
2135
|
let t = {
|
|
2133
|
-
url:
|
|
2136
|
+
url: _t(e, "url"),
|
|
2134
2137
|
result: a,
|
|
2135
2138
|
comment: u,
|
|
2136
2139
|
username: c,
|
|
@@ -2138,9 +2141,9 @@ function Kr(e, t, n, r) {
|
|
|
2138
2141
|
remote_yuno_role: l,
|
|
2139
2142
|
remote_yuno_service: _
|
|
2140
2143
|
};
|
|
2141
|
-
We(e) ?
|
|
2144
|
+
We(e) ? vt(Ve(e), "EV_ON_ID_NAK", t, e) : It(e, "EV_ON_ID_NAK", t);
|
|
2142
2145
|
} else {
|
|
2143
|
-
if (
|
|
2146
|
+
if (pt(e, "ST_SESSION"), o.inside_on_open = !0, o.retry_ms = 0, !o.inform_on_close) {
|
|
2144
2147
|
o.inform_on_close = !0;
|
|
2145
2148
|
let t = {
|
|
2146
2149
|
username: c,
|
|
@@ -2149,134 +2152,134 @@ function Kr(e, t, n, r) {
|
|
|
2149
2152
|
remote_yuno_service: _,
|
|
2150
2153
|
services_roles: f
|
|
2151
2154
|
};
|
|
2152
|
-
We(e) ?
|
|
2155
|
+
We(e) ? vt(Ve(e), "EV_ON_OPEN", t, e) : It(e, "EV_ON_OPEN", t);
|
|
2153
2156
|
}
|
|
2154
2157
|
o.inside_on_open = !1, function(e) {
|
|
2155
|
-
let t =
|
|
2156
|
-
for (let n = 0; n < t.length; n++)
|
|
2158
|
+
let t = At(e, null, null, null);
|
|
2159
|
+
for (let n = 0; n < t.length; n++) Gr(e, t[n]);
|
|
2157
2160
|
}(e);
|
|
2158
2161
|
}
|
|
2159
2162
|
return 0;
|
|
2160
2163
|
}
|
|
2161
|
-
function
|
|
2164
|
+
function Br(e, t, n, r) {
|
|
2162
2165
|
let o = e.priv.url, s = function(e, t) {
|
|
2163
2166
|
let n;
|
|
2164
2167
|
try {
|
|
2165
2168
|
n = JSON.parse(t);
|
|
2166
2169
|
} catch (e) {
|
|
2167
|
-
return
|
|
2170
|
+
return Bt("parsing inter_event json: " + e), null;
|
|
2168
2171
|
}
|
|
2169
|
-
if (!(n instanceof Object)) return
|
|
2172
|
+
if (!(n instanceof Object)) return Bt("parsing inter_event: websocket data not a json object"), null;
|
|
2170
2173
|
let r = n.event;
|
|
2171
|
-
if (!r) return
|
|
2172
|
-
if ("string" != typeof r) return
|
|
2174
|
+
if (!r) return Bt("parsing inter_event: no event"), null;
|
|
2175
|
+
if ("string" != typeof r) return Bt("parsing inter_event: event not a string"), null;
|
|
2173
2176
|
let o = n.kw;
|
|
2174
2177
|
return o ? o instanceof Object ? {
|
|
2175
2178
|
event: r,
|
|
2176
2179
|
kw: o || {}
|
|
2177
|
-
} : (
|
|
2180
|
+
} : (Bt("parsing inter_event: kw not a json object"), null) : (Bt("parsing inter_kw: no kw"), null);
|
|
2178
2181
|
}(0, n.data);
|
|
2179
|
-
if (
|
|
2180
|
-
let e = Pe(Ie()) + " <== " + o, t = n.data.length, r =
|
|
2181
|
-
r ? r(e, s, 2, t) :
|
|
2182
|
+
if (it(Ie(), "trace_inter_event")) {
|
|
2183
|
+
let e = Pe(Ie()) + " <== " + o, t = n.data.length, r = ot(Ie(), "trace_ievent_callback");
|
|
2184
|
+
r ? r(e, s, 2, t) : Cr(0, e, s);
|
|
2182
2185
|
}
|
|
2183
2186
|
let i = s.event, l = s.kw;
|
|
2184
|
-
if ("ST_SESSION" !==
|
|
2185
|
-
if (
|
|
2186
|
-
if (
|
|
2187
|
-
} else
|
|
2188
|
-
return
|
|
2187
|
+
if ("ST_SESSION" !== dt(e)) {
|
|
2188
|
+
if (mt(e, i, w.EVF_PUBLIC_EVENT)) {
|
|
2189
|
+
if (!(vt(e, i, l, e) < 0)) return 0;
|
|
2190
|
+
} else Bt(`${Fe(e)}: event UNKNOWN in not-session state ${i}`);
|
|
2191
|
+
return $r(e), -1;
|
|
2189
2192
|
}
|
|
2190
2193
|
s = null;
|
|
2191
|
-
let _ =
|
|
2192
|
-
if (u.toLowerCase() !== Ce().toLowerCase()) return
|
|
2193
|
-
let c =
|
|
2194
|
+
let _ = er(e, l), a = Xn(e, l, Dr), u = kn(e, a, "dst_role", "");
|
|
2195
|
+
if (u.toLowerCase() !== Ce().toLowerCase()) return Bt(`"It's not my role, dst_role: ${u}, my_role: ${Ce()}`), 0;
|
|
2196
|
+
let c = kn(e, a, "dst_service", "");
|
|
2194
2197
|
if ("__subscribing__" === _) return -1;
|
|
2195
2198
|
if ("__unsubscribing__" === _) return -1;
|
|
2196
|
-
if (
|
|
2199
|
+
if (mt(e, i, w.EVF_PUBLIC_EVENT)) return vt(e, i, l, e), 0;
|
|
2197
2200
|
let f = fe(c, !0);
|
|
2198
2201
|
if (f) {
|
|
2199
|
-
if (!
|
|
2200
|
-
|
|
2201
|
-
} else We(e) ?
|
|
2202
|
+
if (!mt(f, i, w.EVF_PUBLIC_EVENT)) return Bt(`${Fe(e)}: Service found but no event or not public, service '${Fe(f)}', ev '${i}'`), -1;
|
|
2203
|
+
vt(f, i, l, e);
|
|
2204
|
+
} else We(e) ? vt(Ve(e), i, l, e) : It(e, i, l);
|
|
2202
2205
|
return 0;
|
|
2203
2206
|
}
|
|
2204
|
-
function
|
|
2207
|
+
function Jr(e, t, n, r) {
|
|
2205
2208
|
return 0;
|
|
2206
2209
|
}
|
|
2207
|
-
function
|
|
2210
|
+
function qr(e, t, n, r) {
|
|
2208
2211
|
return 0;
|
|
2209
2212
|
}
|
|
2210
|
-
var
|
|
2213
|
+
var Hr = {
|
|
2211
2214
|
mt_create: function(e) {
|
|
2212
2215
|
let t = e.priv;
|
|
2213
|
-
t.gobj_timer = Te(Pe(e), "C_TIMER", {}, e), t.url =
|
|
2214
|
-
const n =
|
|
2215
|
-
n &&
|
|
2216
|
+
t.gobj_timer = Te(Pe(e), "C_TIMER", {}, e), t.url = _t(e, "url"), t.remote_yuno_name = _t(e, "remote_yuno_name"), t.remote_yuno_role = _t(e, "remote_yuno_role"), t.remote_yuno_service = _t(e, "remote_yuno_service"), gt(e, "wanted_yuno_name", t.remote_yuno_name), gt(e, "wanted_yuno_role", t.remote_yuno_role), gt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2217
|
+
const n = at(e, "subscriber");
|
|
2218
|
+
n && Dt(e, null, {}, n);
|
|
2216
2219
|
},
|
|
2217
2220
|
mt_writing: function(e, t) {
|
|
2218
2221
|
let n = e.priv;
|
|
2219
2222
|
switch (t) {
|
|
2220
2223
|
case "url":
|
|
2221
|
-
n.url =
|
|
2224
|
+
n.url = _t(e, "url");
|
|
2222
2225
|
break;
|
|
2223
2226
|
case "remote_yuno_name":
|
|
2224
|
-
n.remote_yuno_name =
|
|
2227
|
+
n.remote_yuno_name = _t(e, "remote_yuno_name");
|
|
2225
2228
|
break;
|
|
2226
2229
|
case "remote_yuno_role":
|
|
2227
|
-
n.remote_yuno_role =
|
|
2230
|
+
n.remote_yuno_role = _t(e, "remote_yuno_role");
|
|
2228
2231
|
break;
|
|
2229
|
-
case "remote_yuno_service": n.remote_yuno_service =
|
|
2232
|
+
case "remote_yuno_service": n.remote_yuno_service = _t(e, "remote_yuno_service");
|
|
2230
2233
|
}
|
|
2231
2234
|
},
|
|
2232
2235
|
mt_start: function(e) {
|
|
2233
2236
|
let t = e.priv;
|
|
2234
|
-
return t.retry_ms = 0, t.websocket =
|
|
2237
|
+
return t.retry_ms = 0, t.websocket = Ir(e), 0;
|
|
2235
2238
|
},
|
|
2236
2239
|
mt_stop: function(e) {
|
|
2237
2240
|
let t = e.priv;
|
|
2238
|
-
return
|
|
2241
|
+
return jr(t.gobj_timer), t.websocket && $r(e), 0;
|
|
2239
2242
|
},
|
|
2240
2243
|
mt_destroy: function(e) {},
|
|
2241
2244
|
mt_stats: function(e, t, n, r) {
|
|
2242
|
-
if ("ST_SESSION" !==
|
|
2245
|
+
if ("ST_SESSION" !== dt(e)) return Bt("Not in session"), null;
|
|
2243
2246
|
n || (n = {});
|
|
2244
|
-
let o =
|
|
2245
|
-
return s || (s = {}),
|
|
2247
|
+
let o = Ur(e, Pe(r), kn(e, n, "service", null, 0)), s = Cn(e, n, "__md_stats__", null, $t.KW_EXTRACT);
|
|
2248
|
+
return s || (s = {}), Qn(e, n, "stats_stack", {
|
|
2246
2249
|
stats: t,
|
|
2247
2250
|
kw: s
|
|
2248
|
-
}),
|
|
2251
|
+
}), Qn(e, n, Dr, o), n.__stats__ = t, Zn(e, n, "__stats__"), Pr(e, "EV_MT_STATS", n, r), null;
|
|
2249
2252
|
},
|
|
2250
2253
|
mt_command_parser: function(e, t, n, r) {
|
|
2251
|
-
if ("ST_SESSION" !==
|
|
2254
|
+
if ("ST_SESSION" !== dt(e)) return Bt("Not in session"), null;
|
|
2252
2255
|
n || (n = {});
|
|
2253
|
-
let o =
|
|
2254
|
-
return s || (s = {}),
|
|
2256
|
+
let o = Ur(e, Pe(r), kn(e, n, "service", "", 0)), s = Cn(e, n, "__md_command__", null, $t.KW_EXTRACT);
|
|
2257
|
+
return s || (s = {}), Qn(e, n, "command_stack", {
|
|
2255
2258
|
command: t,
|
|
2256
2259
|
kw: s
|
|
2257
|
-
}),
|
|
2260
|
+
}), Qn(e, n, Dr, o), n.__command__ = t, Zn(e, n, "__command__"), Pr(e, "EV_MT_COMMAND", n, r), null;
|
|
2258
2261
|
},
|
|
2259
2262
|
mt_inject_event: function(e, t, n, r) {
|
|
2260
|
-
if ("ST_SESSION" !==
|
|
2261
|
-
if (n || (n = {}),
|
|
2263
|
+
if ("ST_SESSION" !== dt(e)) return window.console.error("Not in session"), -1;
|
|
2264
|
+
if (n || (n = {}), Xn(e, n, Dr));
|
|
2262
2265
|
else {
|
|
2263
|
-
let o =
|
|
2264
|
-
|
|
2266
|
+
let o = Ur(e, Pe(r), kn(e, n, "__service__", 0, 0));
|
|
2267
|
+
rn(n, "__service__"), Qn(e, n, "__message__", t), Qn(e, n, Dr, o);
|
|
2265
2268
|
}
|
|
2266
|
-
return
|
|
2269
|
+
return Zn(e, n, "__message__"), Pr(e, t, n, r);
|
|
2267
2270
|
},
|
|
2268
2271
|
mt_subscription_added: function(e, t) {
|
|
2269
2272
|
let n = e.priv;
|
|
2270
|
-
return "ST_SESSION" ===
|
|
2273
|
+
return "ST_SESSION" === dt(e) && n.websocket ? n.inside_on_open ? 0 : Gr(e, t) : 0;
|
|
2271
2274
|
},
|
|
2272
2275
|
mt_subscription_deleted: function(e, t) {
|
|
2273
2276
|
let n = e.priv;
|
|
2274
|
-
if ("ST_SESSION" !==
|
|
2277
|
+
if ("ST_SESSION" !== dt(e) || !n.websocket) return 0;
|
|
2275
2278
|
if (n.inside_on_open) return 0;
|
|
2276
|
-
if (
|
|
2279
|
+
if (yn(t.event)) return 0;
|
|
2277
2280
|
let r = {}, o = t.__global__, s = t.__config__, i = t.__filter__, l = t.__service__, _ = t.subscriber;
|
|
2278
2281
|
s && (r.__config__ = s), o && (r.__global__ = o), i && (r.__filter__ = i);
|
|
2279
|
-
return
|
|
2282
|
+
return Qn(e, r, Dr, Ur(e, Pe(_), l)), Zn(e, r, "__unsubscribing__"), Pr(e, t.event, r, e);
|
|
2280
2283
|
}
|
|
2281
2284
|
};
|
|
2282
2285
|
exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) => new h(e, t, n, null, s, r, null, 0, null, o, null), exports.SDATACM = (e, t, n, r, o, s) => new h(e, t, 0, null, s, n, null, 0, o, r, null), exports.SDATACM2 = (e, t, n, r, o, s, i) => new h(e, t, n, null, i, r, null, 0, s, o, null), exports.SDATADF = (e, t, n, r, o, s) => new h(e, t, n, null, s, null, r, o), exports.SDATAPM = (e, t, n, r, o) => new h(e, t, n, r, o), exports.SDATAPM0 = (e, t, n, r, o) => new h(e, t, n, null, o, null, null, 0, null, null, r), exports.SDATA_END = y, exports.SDataDesc = h, exports.YUNETA_VERSION = s, Object.defineProperty(exports, "__yuno__", {
|
|
@@ -2290,50 +2293,50 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2290
2293
|
return t;
|
|
2291
2294
|
}, exports.build_stats_response = o, exports.clean_name = function(e) {
|
|
2292
2295
|
return e.replace(/[?# ^:]/g, "_");
|
|
2293
|
-
}, exports.clear_timeout =
|
|
2296
|
+
}, exports.clear_timeout = jr, exports.cmp_two_simple_json = On, exports.command_parser = function(e, t, n, r) {}, exports.createElement2 = function e(t, n) {
|
|
2294
2297
|
let [r, o, s, i] = t;
|
|
2295
|
-
if (!r) return void
|
|
2298
|
+
if (!r) return void Bt("Tag must be a valid HTML element.");
|
|
2296
2299
|
let l = document.createElement(r), _ = "";
|
|
2297
2300
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2298
2301
|
let t = "";
|
|
2299
2302
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
2300
2303
|
l.style.cssText = t;
|
|
2301
2304
|
} else "style" === e ? l.style.cssText = o[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== o[e] && void 0 !== o[e] && (_ = o[e], l.setAttribute("data-i18n", _)) : l.setAttribute(e, o[e]);
|
|
2302
|
-
if (
|
|
2305
|
+
if (dn(s)) if (s = s.trim(), s.length > 0 && "<" === s[0]) l.appendChild(sr(s));
|
|
2303
2306
|
else if (n && _) l.textContent = n(_) || s;
|
|
2304
2307
|
else l.textContent = s;
|
|
2305
|
-
else if (
|
|
2306
|
-
if (s.length > 0) if (
|
|
2308
|
+
else if (pn(s)) {
|
|
2309
|
+
if (s.length > 0) if (dn(s[0])) l.appendChild(e(s, n));
|
|
2307
2310
|
else for (let t of s) Array.isArray(t) && t.length > 0 ? l.appendChild(e(t, n)) : t instanceof HTMLElement && l.appendChild(t);
|
|
2308
|
-
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? l.appendChild(s) : null != s && (
|
|
2311
|
+
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? l.appendChild(s) : null != s && (Bt("content ignored"), zt(s));
|
|
2309
2312
|
if (i && "object" == typeof i) for (const e of Object.keys(i)) l.addEventListener(e, i[e]);
|
|
2310
2313
|
return l;
|
|
2311
|
-
}, exports.createOneHtml =
|
|
2312
|
-
let n =
|
|
2313
|
-
return
|
|
2314
|
+
}, exports.createOneHtml = sr, exports.create_json_record = function(e, t) {
|
|
2315
|
+
let n = Qt(e);
|
|
2316
|
+
return en(n, t), n;
|
|
2314
2317
|
}, exports.create_template_record = function(e, t) {
|
|
2315
2318
|
let n = {};
|
|
2316
2319
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2317
2320
|
let o;
|
|
2318
|
-
|
|
2319
|
-
let s =
|
|
2321
|
+
gn(r) && (o = r.default);
|
|
2322
|
+
let s = Cn(null, t, e, o);
|
|
2320
2323
|
n[e] = s;
|
|
2321
2324
|
}), n;
|
|
2322
|
-
}, exports.current_timestamp =
|
|
2323
|
-
let n =
|
|
2324
|
-
return n &&
|
|
2325
|
+
}, exports.current_timestamp = ir, exports.data_type_t = E, exports.db_list_persistent_attrs = function(e, t) {
|
|
2326
|
+
let n = Mn(ur(e), null, !1), r = {};
|
|
2327
|
+
return n && gn(n) && (r = Gn(e, n, t, !1)), r;
|
|
2325
2328
|
}, exports.db_load_persistent_attrs = function(e, t) {
|
|
2326
|
-
let n =
|
|
2327
|
-
if (r &&
|
|
2328
|
-
let o =
|
|
2329
|
-
o =
|
|
2329
|
+
let n = st(e, T.SDF_PERSIST), r = Mn(ur(e), null, !1);
|
|
2330
|
+
if (r && gn(r)) {
|
|
2331
|
+
let o = Gn(e, r, t, !1);
|
|
2332
|
+
o = Gn(e, o, n, !1), ut(e, o, T.SDF_PERSIST);
|
|
2330
2333
|
}
|
|
2331
2334
|
}, exports.db_remove_persistent_attrs = function(e, t) {
|
|
2332
|
-
let n =
|
|
2333
|
-
0 ===
|
|
2335
|
+
let n = Vn(e, Mn(ur(e), null, !1), t, !1);
|
|
2336
|
+
0 === un(n) ? Kn(ur(e)) : Wn(ur(e), n);
|
|
2334
2337
|
}, exports.db_save_persistent_attrs = function(e, t) {
|
|
2335
|
-
let n =
|
|
2336
|
-
return r &&
|
|
2338
|
+
let n = Gn(e, st(e, T.SDF_PERSIST), t, !1), r = Mn(ur(e), null, !1);
|
|
2339
|
+
return r && gn(r) && tn(n, r), Wn(ur(e), n);
|
|
2337
2340
|
}, exports.debounce = function(e, t = 0, n = !1) {
|
|
2338
2341
|
let r = null, o = null, s = null;
|
|
2339
2342
|
const i = (...i) => {
|
|
@@ -2358,7 +2361,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2358
2361
|
Object.assign(t, e);
|
|
2359
2362
|
}
|
|
2360
2363
|
return t;
|
|
2361
|
-
}, exports.empty_string =
|
|
2364
|
+
}, exports.empty_string = yn, exports.escapeHtml = or, exports.event_flag_t = w, exports.gclass_add_ev_action = se, exports.gclass_add_event_type = le, exports.gclass_add_state = oe, exports.gclass_check_fsm = ae, exports.gclass_create = ee, exports.gclass_event_type = _e, exports.gclass_find_by_name = ue, exports.gclass_flag_t = O, exports.gclass_unregister = te, exports.getPositionRelativeToBody = function(e) {
|
|
2362
2365
|
if (!e) return {
|
|
2363
2366
|
top: 0,
|
|
2364
2367
|
left: 0,
|
|
@@ -2377,14 +2380,14 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2377
2380
|
right: n + l + r,
|
|
2378
2381
|
bottom: t + i + o
|
|
2379
2382
|
};
|
|
2380
|
-
}, exports.get_function_name =
|
|
2383
|
+
}, exports.get_function_name = ar, exports.get_now = function() {
|
|
2381
2384
|
return Math.floor(Date.now() / 1e3);
|
|
2382
2385
|
}, exports.gobj_bottom_gobj = Ye, exports.gobj_change_parent = function(e, n) {
|
|
2383
|
-
return Ke(e) ? (
|
|
2384
|
-
}, exports.gobj_change_state =
|
|
2385
|
-
if (Ke(e)) return
|
|
2386
|
-
let i = d &&
|
|
2387
|
-
return i && ($(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", De(e) ? "" : "!!", Fe(e), n, Fe(s))), i > 1 &&
|
|
2386
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), null) : n instanceof S ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (de(e.parent, e), e.parent = null), pe(n, e), n.mt_child_added && (K(e) && qt(t("👦👦🔵 child_added(%s): %s", Ge(n), Fe(e))), n.mt_child_added(n, e)), 0) : (Bt(`${Fe(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2387
|
+
}, exports.gobj_change_state = pt, exports.gobj_command = function(e, n, o, s) {
|
|
2388
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
2389
|
+
let i = d && lt(d, "tracing");
|
|
2390
|
+
return i && ($(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", De(e) ? "" : "!!", Fe(e), n, Fe(s))), i > 1 && zt(o)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, o, s) : e.gclass.command_table ? u ? u(e, n, o, s) : r(0, -1, t("%s: global command parser not available", Fe(e)), 0, 0) : r(0, -1, t("%s: command table not available", Fe(e)), 0, 0);
|
|
2388
2391
|
}, exports.gobj_create = function(e, t, n, r) {
|
|
2389
2392
|
return Ee(e, t, n, r, 0);
|
|
2390
2393
|
}, exports.gobj_create2 = Ee, exports.gobj_create_default_service = function(e, t, n, r) {
|
|
@@ -2395,41 +2398,41 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2395
2398
|
return Ee(e, t, n, r, N.gobj_flag_volatil);
|
|
2396
2399
|
}, exports.gobj_create_yuno = function(e, t, n) {
|
|
2397
2400
|
return Ee(e, t, n, null, N.gobj_flag_yuno);
|
|
2398
|
-
}, exports.gobj_current_state =
|
|
2399
|
-
if (
|
|
2401
|
+
}, exports.gobj_current_state = dt, exports.gobj_default_service = ce, exports.gobj_deliver_posted_events = yt, exports.gobj_destroy = he, exports.gobj_find_child = tt, exports.gobj_find_gobj = function(e, t) {
|
|
2402
|
+
if (yn(t)) return null;
|
|
2400
2403
|
const n = t.toLowerCase();
|
|
2401
|
-
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d :
|
|
2402
|
-
}, exports.gobj_find_service = fe, exports.gobj_find_subscribings =
|
|
2404
|
+
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d : nt(d, t);
|
|
2405
|
+
}, exports.gobj_find_service = fe, exports.gobj_find_subscribings = kt, exports.gobj_find_subscriptions = At, exports.gobj_flag_t = N, exports.gobj_full_name = Ge, exports.gobj_gclass_name = Ue, exports.gobj_global_trace_level = function() {
|
|
2403
2406
|
return P;
|
|
2404
|
-
}, exports.gobj_has_attr =
|
|
2407
|
+
}, exports.gobj_has_attr = rt, exports.gobj_has_event = mt, exports.gobj_has_output_event = Et, exports.gobj_hsdata = Q, exports.gobj_is_destroying = Ke, exports.gobj_is_playing = ke, exports.gobj_is_pure_child = We, exports.gobj_is_running = De, exports.gobj_is_service = Ae, exports.gobj_is_volatil = Me, exports.gobj_list_persistent_attrs = function(e, t) {
|
|
2405
2408
|
return a ? a(e, t) : null;
|
|
2406
2409
|
}, exports.gobj_list_subscriptions = function(e) {
|
|
2407
|
-
let t =
|
|
2410
|
+
let t = At(e, null, null, null);
|
|
2408
2411
|
for (let n = 0; n < t.length; n++) {
|
|
2409
|
-
let r = t[n], o =
|
|
2410
|
-
|
|
2412
|
+
let r = t[n], o = In(e, r, "publisher", null, $t.KW_REQUIRED), s = In(e, r, "subscriber", null, $t.KW_REQUIRED);
|
|
2413
|
+
sn(r, "s_event", kn(e, r, "event", "", $t.KW_REQUIRED)), sn(r, "s_publisher", Fe(o)), sn(r, "s_subscriber", Fe(s));
|
|
2411
2414
|
}
|
|
2412
|
-
let n =
|
|
2415
|
+
let n = kt(e, 0, null, 0);
|
|
2413
2416
|
for (let t = 0; t < n.length; t++) {
|
|
2414
|
-
let r = n[t], o =
|
|
2415
|
-
|
|
2417
|
+
let r = n[t], o = In(e, r, "publisher", null, $t.KW_REQUIRED), s = In(e, r, "subscriber", null, $t.KW_REQUIRED);
|
|
2418
|
+
sn(r, "s_event", kn(e, r, "event", "", $t.KW_REQUIRED)), sn(r, "s_publisher", Fe(o)), sn(r, "s_subscriber", Fe(s));
|
|
2416
2419
|
}
|
|
2417
2420
|
return {
|
|
2418
2421
|
subscriptions: t,
|
|
2419
2422
|
subscribings: n,
|
|
2420
|
-
"total subscriptions":
|
|
2421
|
-
total_subscribings:
|
|
2423
|
+
"total subscriptions": cn(t),
|
|
2424
|
+
total_subscribings: cn(n)
|
|
2422
2425
|
};
|
|
2423
2426
|
}, exports.gobj_load_persistent_attrs = function(e, t) {
|
|
2424
|
-
return Ae(e) ? i ? i(e, t) : -1 : (
|
|
2427
|
+
return Ae(e) ? i ? i(e, t) : -1 : (Bt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2425
2428
|
}, exports.gobj_match_children = function(e, t) {
|
|
2426
|
-
if (Ke(e)) return
|
|
2429
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
2427
2430
|
t = t || {};
|
|
2428
2431
|
let n = [];
|
|
2429
2432
|
const r = e.dl_children;
|
|
2430
2433
|
for (let e = 0; e < r.length; e++) {
|
|
2431
2434
|
const o = r[e];
|
|
2432
|
-
|
|
2435
|
+
et(o, t) && n.push(o);
|
|
2433
2436
|
}
|
|
2434
2437
|
return n;
|
|
2435
2438
|
}, exports.gobj_match_children_tree = function(e, t) {
|
|
@@ -2439,20 +2442,20 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2439
2442
|
let o = r.dl_children;
|
|
2440
2443
|
for (let r = 0; r < o.length; r++) {
|
|
2441
2444
|
let s = o[r];
|
|
2442
|
-
|
|
2445
|
+
et(s, t) && n.push(s), e(n, s);
|
|
2443
2446
|
}
|
|
2444
2447
|
}(n, e), n;
|
|
2445
|
-
}, exports.gobj_match_gobj =
|
|
2446
|
-
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (
|
|
2448
|
+
}, exports.gobj_match_gobj = et, exports.gobj_name = Pe, exports.gobj_parent = Ve, exports.gobj_pause = we, exports.gobj_play = Re, exports.gobj_post_event = function(e, n, r, o) {
|
|
2449
|
+
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (Bt(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : yn(n) ? (Bt("gobj_post_event(): event EMPTY"), -1) : mt(e, n, 0) ? Tt.length >= 1e4 ? (Bt(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${Tt.length}`), -1) : (Tt.push({
|
|
2447
2450
|
dst: e,
|
|
2448
2451
|
event: n,
|
|
2449
2452
|
kw: r,
|
|
2450
2453
|
src: o
|
|
2451
|
-
}), B(e, n) && !J(o, n) && $(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Fe(e), n,
|
|
2454
|
+
}), B(e, n) && !J(o, n) && $(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Fe(e), n, Tt.length)), ht || (ht = !0, setTimeout(yt, 0)), 0) : (Bt(`gobj_post_event(): event NOT DEFINED in gclass ${Ue(e)}, event ${n}`), -1) : (Bt(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
2452
2455
|
}, exports.gobj_posted_events_size = function() {
|
|
2453
|
-
return
|
|
2454
|
-
}, exports.gobj_publish_event =
|
|
2455
|
-
return Ae(e) ? _ ? _(e, t) : -1 : (
|
|
2456
|
+
return Tt.length;
|
|
2457
|
+
}, exports.gobj_publish_event = It, exports.gobj_read_attr = ot, exports.gobj_read_attrs = st, exports.gobj_read_bool_attr = it, exports.gobj_read_integer_attr = lt, exports.gobj_read_pointer_attr = at, exports.gobj_read_str_attr = _t, exports.gobj_remove_persistent_attrs = function(e, t) {
|
|
2458
|
+
return Ae(e) ? _ ? _(e, t) : -1 : (Bt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2456
2459
|
}, exports.gobj_repr_global_trace_levels = function() {
|
|
2457
2460
|
return L.map(([e, t, n]) => ({
|
|
2458
2461
|
name: e,
|
|
@@ -2462,33 +2465,33 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2462
2465
|
}));
|
|
2463
2466
|
}, exports.gobj_reset_volatil_attrs = function(e) {
|
|
2464
2467
|
return function(e, t, n) {
|
|
2465
|
-
if (Ke(e)) return
|
|
2468
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
2466
2469
|
let r = e.gclass.attrs_table;
|
|
2467
2470
|
for (let o = 0; o < r.length; o++) {
|
|
2468
2471
|
const s = r[o];
|
|
2469
2472
|
if (s.name && !(n && s.flag & n) && (-1 === t || s.flag & t)) {
|
|
2470
2473
|
const t = H(e, e.jn_attrs, s);
|
|
2471
|
-
|
|
2474
|
+
gn(e.priv) && e.priv.hasOwnProperty(s.name) && (e.priv[s.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, s.name);
|
|
2472
2475
|
}
|
|
2473
2476
|
}
|
|
2474
2477
|
return 0;
|
|
2475
2478
|
}(e, T.SDF_VOLATIL, 0);
|
|
2476
2479
|
}, exports.gobj_save_persistent_attrs = function(e, t) {
|
|
2477
|
-
return Ae(e) ? l ? l(e, t) : -1 : (
|
|
2478
|
-
}, exports.gobj_search_path =
|
|
2480
|
+
return Ae(e) ? l ? l(e, t) : -1 : (Bt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2481
|
+
}, exports.gobj_search_path = nt, exports.gobj_send_event = vt, exports.gobj_services = function() {
|
|
2479
2482
|
let e = [];
|
|
2480
|
-
for (const t of Object.keys(p))
|
|
2483
|
+
for (const t of Object.keys(p)) _n(e, t);
|
|
2481
2484
|
return e;
|
|
2482
2485
|
}, exports.gobj_set_bottom_gobj = Be, exports.gobj_set_deep_trace = function(e) {
|
|
2483
2486
|
return F = Number(e) || 0, 0;
|
|
2484
2487
|
}, exports.gobj_set_gclass_no_trace = function(e, t, n) {
|
|
2485
|
-
const r =
|
|
2486
|
-
if (!r) return
|
|
2488
|
+
const r = dn(e) ? ue(e) : e;
|
|
2489
|
+
if (!r) return Bt(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2487
2490
|
const o = G(t, "gobj_set_gclass_no_trace");
|
|
2488
2491
|
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
2489
2492
|
}, exports.gobj_set_gclass_trace = function(e, t, n) {
|
|
2490
|
-
const r =
|
|
2491
|
-
if (!r) return
|
|
2493
|
+
const r = dn(e) ? ue(e) : e;
|
|
2494
|
+
if (!r) return Bt(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2492
2495
|
const o = G(t, "gobj_set_gclass_trace");
|
|
2493
2496
|
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
2494
2497
|
}, exports.gobj_set_global_no_trace = function(e, t) {
|
|
@@ -2498,19 +2501,19 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2498
2501
|
const n = G(e, "gobj_set_global_trace");
|
|
2499
2502
|
return n ? (t ? P |= n : P &= ~n, 0) : -1;
|
|
2500
2503
|
}, exports.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2501
|
-
if (!e) return
|
|
2504
|
+
if (!e) return Bt("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2502
2505
|
const r = G(t, "gobj_set_gobj_no_trace");
|
|
2503
2506
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
2504
2507
|
}, exports.gobj_set_gobj_trace = function(e, t, n) {
|
|
2505
|
-
if (!e) return
|
|
2508
|
+
if (!e) return Bt("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
2506
2509
|
const r = G(t, "gobj_set_gobj_trace");
|
|
2507
2510
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2508
2511
|
}, exports.gobj_set_trace_machine_format = function(e) {
|
|
2509
2512
|
I = 1 === Number(e) ? 1 : 0;
|
|
2510
2513
|
}, exports.gobj_short_name = Fe, exports.gobj_start = ye, exports.gobj_start_children = function(e) {
|
|
2511
|
-
return Ke(e) ? (
|
|
2514
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : qe(e, D.WALK_FIRST2LAST, ve, 0, 0);
|
|
2512
2515
|
}, exports.gobj_start_tree = function(e) {
|
|
2513
|
-
return Ke(e) ? (
|
|
2516
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Ge(e))), e.gclass.gclass_flag & O.gcflag_manual_start || e.disabled ? 0 : (e.running || ye(e), He(e, D.WALK_TOP2BOTTOM, je, 0, 0)));
|
|
2514
2517
|
}, exports.gobj_start_up = function(e, t, n, r, o, s, g) {
|
|
2515
2518
|
i = t, l = n, _ = r, a = o, u = s, c = g;
|
|
2516
2519
|
const p = [["EV_STATE_CHANGED", w.EVF_SYSTEM_EVENT | w.EVF_OUTPUT_EVENT | w.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -2520,14 +2523,14 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2520
2523
|
}
|
|
2521
2524
|
return 0;
|
|
2522
2525
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
2523
|
-
return Ke(e) ? (
|
|
2526
|
+
return Ke(e) ? (Bt("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", Fe(e)), 0, 0);
|
|
2524
2527
|
}, exports.gobj_stop = Se, exports.gobj_stop_children = Ne, exports.gobj_stop_tree = function(e) {
|
|
2525
|
-
return Ke(e) ? (
|
|
2526
|
-
}, exports.gobj_subscribe_event =
|
|
2528
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Ge(e))), De(e) && Se(e), He(e, D.WALK_TOP2BOTTOM, Oe, 0, 0));
|
|
2529
|
+
}, exports.gobj_subscribe_event = Dt, exports.gobj_trace_level = V, exports.gobj_trace_machine_format = function() {
|
|
2527
2530
|
return I;
|
|
2528
2531
|
}, exports.gobj_trace_no_level = M, exports.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2529
|
-
if (null == n && (n = {}), !e) return
|
|
2530
|
-
if (!r) return
|
|
2532
|
+
if (null == n && (n = {}), !e) return Bt(`publisher NULL: ev ${t}`), 0;
|
|
2533
|
+
if (!r) return Bt(`subscriber NULL: ev ${t}`), 0;
|
|
2531
2534
|
const o = /* @__PURE__ */ new Set([
|
|
2532
2535
|
"__config__",
|
|
2533
2536
|
"__global__",
|
|
@@ -2536,102 +2539,102 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2536
2539
|
"__service__"
|
|
2537
2540
|
]);
|
|
2538
2541
|
if (Object.keys(n).forEach((n) => {
|
|
2539
|
-
o.has(n) ||
|
|
2540
|
-
}),
|
|
2541
|
-
else if (!(
|
|
2542
|
-
let s =
|
|
2542
|
+
o.has(n) || Bt(`${Fe(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2543
|
+
}), yn(t)) t = "";
|
|
2544
|
+
else if (!(Et(e, t, w.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Fe(e)}, ev ${t}`), 0;
|
|
2545
|
+
let s = Nt(e.dl_subscriptions, e, t, n, r), i = 0;
|
|
2543
2546
|
for (let t = 0; t < s.length; t++) {
|
|
2544
2547
|
let n = s[t];
|
|
2545
|
-
|
|
2548
|
+
wt(e, n, !1, !1), i++;
|
|
2546
2549
|
}
|
|
2547
|
-
return i || (
|
|
2548
|
-
}, exports.gobj_unsubscribe_list =
|
|
2549
|
-
if (!
|
|
2550
|
+
return i || (Jt(`${Fe(e)}: No subscription found`), zt(n, "No subscription found")), 0;
|
|
2551
|
+
}, exports.gobj_unsubscribe_list = xt, exports.gobj_walk_gobj_children = qe, exports.gobj_walk_gobj_children_tree = He, exports.gobj_write_attr = function(e, n, r, o) {
|
|
2552
|
+
if (!dn(n)) return Bt(t("gobj_write_attr(%s): path must be a string", Fe(e))), -1;
|
|
2550
2553
|
let s, i = e.jn_attrs, l = n.split("`");
|
|
2551
2554
|
if (l.length <= 1) {
|
|
2552
2555
|
let o = n;
|
|
2553
|
-
return o in i && i.hasOwnProperty(o) ? (i[o] = r,
|
|
2556
|
+
return o in i && i.hasOwnProperty(o) ? (i[o] = r, gn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0) : (Bt(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), o)), -1);
|
|
2554
2557
|
}
|
|
2555
2558
|
let _ = l.length;
|
|
2556
2559
|
for (let t = 0; t < _; t++) {
|
|
2557
2560
|
s = l[t];
|
|
2558
|
-
let n =
|
|
2561
|
+
let n = tt(e, { __gobj_name__: s });
|
|
2559
2562
|
if (n && t < _ - 1) {
|
|
2560
2563
|
e = n;
|
|
2561
2564
|
continue;
|
|
2562
2565
|
}
|
|
2563
2566
|
let o = e.jn_attrs;
|
|
2564
|
-
if (s in o && o.hasOwnProperty(s)) return o[s] = r,
|
|
2567
|
+
if (s in o && o.hasOwnProperty(s)) return o[s] = r, gn(e.priv) && e.priv.hasOwnProperty(s) && (e.priv[s] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.mt_writing && e.mt_writing(e, s), 0;
|
|
2565
2568
|
break;
|
|
2566
2569
|
}
|
|
2567
|
-
return
|
|
2568
|
-
}, exports.gobj_write_attrs =
|
|
2570
|
+
return Bt(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), s)), -1;
|
|
2571
|
+
}, exports.gobj_write_attrs = ut, exports.gobj_write_bool_attr = ct, exports.gobj_write_integer_attr = ft, exports.gobj_write_str_attr = gt, exports.gobj_yuno = Ie, exports.gobj_yuno_id = Le, exports.gobj_yuno_name = $e, exports.gobj_yuno_role = Ce, exports.id_index_in_obj_list = Jn, exports.index_in_list = lr, exports.is_array = pn, exports.is_boolean = mn, exports.is_date = function(e) {
|
|
2569
2572
|
return e instanceof Date && !isNaN(e);
|
|
2570
|
-
}, exports.is_function =
|
|
2571
|
-
if (!
|
|
2573
|
+
}, exports.is_function = Tn, exports.is_gobj = hn, exports.is_metadata_key = function(e) {
|
|
2574
|
+
if (!dn(e)) return !1;
|
|
2572
2575
|
let t;
|
|
2573
2576
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2574
2577
|
return 2 === t;
|
|
2575
|
-
}, exports.is_null =
|
|
2576
|
-
if (!
|
|
2578
|
+
}, exports.is_null = En, exports.is_number = bn, exports.is_object = gn, exports.is_private_key = function(e) {
|
|
2579
|
+
if (!dn(e)) return !1;
|
|
2577
2580
|
let t;
|
|
2578
2581
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2579
2582
|
return 1 === t;
|
|
2580
2583
|
}, exports.is_pure_number = function(e) {
|
|
2581
|
-
if (
|
|
2582
|
-
if (!
|
|
2584
|
+
if (bn(e)) return !0;
|
|
2585
|
+
if (!dn(e)) return !1;
|
|
2583
2586
|
const t = Number(e);
|
|
2584
2587
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2585
|
-
}, exports.is_string =
|
|
2586
|
-
let o =
|
|
2587
|
-
if (!o) return
|
|
2588
|
-
if (
|
|
2588
|
+
}, exports.is_string = dn, exports.jdb_delete = function(e, t, n, r) {
|
|
2589
|
+
let o = Cn(null, Cn(null, e, "topics", null, 0), t, null, 0);
|
|
2590
|
+
if (!o) return Bt("jdb_delete: topic not found: " + t), null;
|
|
2591
|
+
if (yn(r.id)) return Bt("jdb_delete: record without id: " + r), Ht(r), null;
|
|
2589
2592
|
let s, i = n.split("`"), l = o;
|
|
2590
|
-
for (; (s = i.shift()) && !
|
|
2591
|
-
if (0 === i.length && l) if (
|
|
2592
|
-
let e =
|
|
2593
|
+
for (; (s = i.shift()) && !yn(s) && l;) gn(l) && (l = Cn(null, l, e.hook, null, 0)), l = nr(l, null, s, !1);
|
|
2594
|
+
if (0 === i.length && l) if (pn(l)) {
|
|
2595
|
+
let e = Jn(l, r.id);
|
|
2593
2596
|
e >= 0 && l.splice(e, 1);
|
|
2594
2597
|
} else {
|
|
2595
|
-
let t =
|
|
2598
|
+
let t = Cn(null, l, e.hook, null, 0), n = Jn(t, r.id);
|
|
2596
2599
|
n >= 0 && t.splice(n, 1);
|
|
2597
2600
|
}
|
|
2598
2601
|
return o;
|
|
2599
2602
|
}, exports.jdb_get = function(e, t, n, r) {
|
|
2600
|
-
let o =
|
|
2601
|
-
return o ? (void 0 === r && (r = !0),
|
|
2603
|
+
let o = Cn(null, Cn(null, e, "topics", null, 0), t, null, 0);
|
|
2604
|
+
return o ? (void 0 === r && (r = !0), nr(o, e.hook, n, r)) : (Bt("jdb_get: topic not found: " + t), null);
|
|
2602
2605
|
}, exports.jdb_get_by_idx = function(e, t, n) {
|
|
2603
|
-
let r =
|
|
2604
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2606
|
+
let r = Cn(null, Cn(null, e, "topics", null, 0), t, null, 0);
|
|
2607
|
+
return r ? n < r.length ? r[n] : {} : (Bt("jdb_get_by_idx: topic not found: " + t), null);
|
|
2605
2608
|
}, exports.jdb_get_topic = function(e, t) {
|
|
2606
|
-
let n =
|
|
2607
|
-
if (!n) return
|
|
2608
|
-
return
|
|
2609
|
+
let n = Cn(null, e, "topics", null, 0);
|
|
2610
|
+
if (!n) return Bt("jdb topics section not found"), Ht(e), null;
|
|
2611
|
+
return Cn(null, n, t, null, 0) || (Bt("jdb topic not found: " + t), Ht(n), null);
|
|
2609
2612
|
}, exports.jdb_init = function(e, t, n) {
|
|
2610
|
-
n && (e =
|
|
2611
|
-
let r =
|
|
2612
|
-
|
|
2613
|
-
let o =
|
|
2614
|
-
return
|
|
2615
|
-
"__" !== t.substring(0, 2) &&
|
|
2613
|
+
n && (e = Qt(e));
|
|
2614
|
+
let r = Cn(null, e, "type", [], 1);
|
|
2615
|
+
kn(null, e, "hook", "data", 1);
|
|
2616
|
+
let o = Cn(null, e, "schema", {}, 1), s = Cn(null, e, "topics", {}, 1);
|
|
2617
|
+
return tr(o, function(e, t, n, o) {
|
|
2618
|
+
"__" !== t.substring(0, 2) && Cn(null, s, o, Qt(r), 1);
|
|
2616
2619
|
}, t), e;
|
|
2617
2620
|
}, exports.jdb_update = function(e, t, n, r) {
|
|
2618
|
-
let o =
|
|
2619
|
-
if (!o) return
|
|
2620
|
-
if (
|
|
2621
|
+
let o = Cn(null, Cn(null, e, "topics", null, 0), t, null, 0);
|
|
2622
|
+
if (!o) return Bt("jdb_update: topic not found: " + t), null;
|
|
2623
|
+
if (yn(r.id)) return Bt("jdb_update: record without id: " + r), Ht(r), null;
|
|
2621
2624
|
let s, i = n.split("`"), l = o;
|
|
2622
|
-
for (; (s = i.shift()) && !
|
|
2623
|
-
if (0 === i.length && l) if (
|
|
2625
|
+
for (; (s = i.shift()) && !yn(s) && l;) gn(l) && (l = Cn(null, l, e.hook, [], 1)), l = nr(l, null, s, !1);
|
|
2626
|
+
if (0 === i.length && l) if (pn(l)) l.push(r);
|
|
2624
2627
|
else if (l.id === r.id) Object.assign(l, r);
|
|
2625
2628
|
else {
|
|
2626
|
-
let t =
|
|
2629
|
+
let t = Cn(null, l, e.hook, [], 1), n = nr(t, e.hook, r.id, !1);
|
|
2627
2630
|
n ? Object.assign(n, r) : t.push(r);
|
|
2628
2631
|
}
|
|
2629
2632
|
return o;
|
|
2630
|
-
}, exports.json_array_append =
|
|
2633
|
+
}, exports.json_array_append = ln, exports.json_array_append_new = _n, exports.json_array_extend = function(e, t) {
|
|
2631
2634
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2632
|
-
}, exports.json_array_remove =
|
|
2635
|
+
}, exports.json_array_remove = an, exports.json_array_size = cn, exports.json_deep_copy = Qt, exports.json_is_identical = Xt, exports.json_object_del = rn, exports.json_object_get = nn, exports.json_object_set = on, exports.json_object_set_new = sn, exports.json_object_size = un, exports.json_object_update = Zt, exports.json_object_update_existing = en, exports.json_object_update_missing = tn, exports.json_size = fn, exports.jwt2json = function(e, t) {
|
|
2633
2636
|
try {
|
|
2634
|
-
let n =
|
|
2637
|
+
let n = rr(e);
|
|
2635
2638
|
switch (t) {
|
|
2636
2639
|
case "header": return JSON.parse(n.header);
|
|
2637
2640
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2640,122 +2643,122 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2640
2643
|
} catch (e) {
|
|
2641
2644
|
return null;
|
|
2642
2645
|
}
|
|
2643
|
-
}, exports.jwtDecode =
|
|
2644
|
-
if (e && !
|
|
2645
|
-
r || (r =
|
|
2646
|
+
}, exports.jwtDecode = rr, exports.kw_clone_by_keys = Gn, exports.kw_clone_by_not_keys = Vn, exports.kw_collect = function(e, t, n, r) {
|
|
2647
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
2648
|
+
r || (r = Fn);
|
|
2646
2649
|
let o = [];
|
|
2647
|
-
if (
|
|
2650
|
+
if (pn(t)) for (let e = 0; e < t.length; e++) {
|
|
2648
2651
|
let s = t[e];
|
|
2649
2652
|
r(s, n) && o.push(s);
|
|
2650
2653
|
}
|
|
2651
2654
|
else {
|
|
2652
|
-
if (!
|
|
2655
|
+
if (!gn(t)) return Bt("kw_select() BAD kw parameter"), null;
|
|
2653
2656
|
r(t, n) && o.push(t);
|
|
2654
2657
|
}
|
|
2655
2658
|
return o;
|
|
2656
|
-
}, exports.kw_delete =
|
|
2657
|
-
if (!n || !
|
|
2658
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2659
|
-
return r &&
|
|
2660
|
-
}, exports.kw_find_path =
|
|
2661
|
-
e && !
|
|
2662
|
-
let s =
|
|
2663
|
-
const i = o && o &
|
|
2659
|
+
}, exports.kw_delete = Dn, exports.kw_find_json_in_list = function(e, t, n, r) {
|
|
2660
|
+
if (!n || !pn(t)) return r && Bt("item NULL or kw_list is not a list"), -1;
|
|
2661
|
+
for (let e = 0; e < t.length; e++) if (Xt(n, t[e])) return e;
|
|
2662
|
+
return r && Bt("item not found in this list"), -1;
|
|
2663
|
+
}, exports.kw_find_path = wn, exports.kw_flag_t = $t, exports.kw_get_bool = xn, exports.kw_get_dict = $n, exports.kw_get_dict_value = Cn, exports.kw_get_int = An, exports.kw_get_list = function(e, t, n, r, o) {
|
|
2664
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2665
|
+
let s = wn(e, t, n, !1);
|
|
2666
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2664
2667
|
if (void 0 === s) {
|
|
2665
2668
|
if (l) {
|
|
2666
2669
|
let o = Array(r);
|
|
2667
|
-
return
|
|
2670
|
+
return Ln(e, t, n, o), o;
|
|
2668
2671
|
}
|
|
2669
|
-
return i && (
|
|
2672
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), Array(r);
|
|
2670
2673
|
}
|
|
2671
|
-
return _ &&
|
|
2672
|
-
}, exports.kw_get_local_storage_value =
|
|
2673
|
-
e && !
|
|
2674
|
-
let s =
|
|
2675
|
-
const i = o && o &
|
|
2674
|
+
return _ && Dn(e, t, n), pn(s) ? Array(s) : (i && (Bt(`path value MUST BE an array: ${n}`), Ht(t)), Array(r));
|
|
2675
|
+
}, exports.kw_get_local_storage_value = Mn, exports.kw_get_pointer = In, exports.kw_get_real = function(e, t, n, r, o) {
|
|
2676
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2677
|
+
let s = wn(e, t, n, !1);
|
|
2678
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2676
2679
|
if (void 0 === s) {
|
|
2677
2680
|
if (l) {
|
|
2678
2681
|
let o = Number(r);
|
|
2679
|
-
return
|
|
2682
|
+
return Ln(e, t, n, o), o;
|
|
2680
2683
|
}
|
|
2681
|
-
return i && (
|
|
2684
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), Number(r);
|
|
2682
2685
|
}
|
|
2683
|
-
return _ &&
|
|
2684
|
-
}, exports.kw_get_str =
|
|
2685
|
-
if (e && !
|
|
2686
|
-
r || (r =
|
|
2686
|
+
return _ && Dn(e, t, n), bn(s) ? Number(s) : (i && (Bt(`path value MUST BE a number: ${n}`), Ht(t)), Number(r));
|
|
2687
|
+
}, exports.kw_get_str = kn, exports.kw_has_key = Rn, exports.kw_match_simple = Fn, exports.kw_pop = Nn, exports.kw_remove_local_storage_value = Kn, exports.kw_select = function(e, t, n, r) {
|
|
2688
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
2689
|
+
r || (r = Fn);
|
|
2687
2690
|
let o = [];
|
|
2688
|
-
if (
|
|
2691
|
+
if (pn(t)) for (let e = 0; e < t.length; e++) {
|
|
2689
2692
|
let s = t[e];
|
|
2690
|
-
r(s, n) && o.push(
|
|
2693
|
+
r(s, n) && o.push(Qt(s));
|
|
2691
2694
|
}
|
|
2692
2695
|
else {
|
|
2693
|
-
if (!
|
|
2694
|
-
r(t, n) && o.push(
|
|
2696
|
+
if (!gn(t)) return Bt("kw_select() BAD kw parameter"), null;
|
|
2697
|
+
r(t, n) && o.push(Qt(t));
|
|
2695
2698
|
}
|
|
2696
2699
|
return o;
|
|
2697
|
-
}, exports.kw_set_dict_value =
|
|
2698
|
-
e && !
|
|
2699
|
-
let s =
|
|
2700
|
+
}, exports.kw_set_dict_value = Ln, exports.kw_set_local_storage_value = Wn, exports.kw_set_subdict_value = Pn, exports.kwid_collect = Bn, exports.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2701
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2702
|
+
let s = Bn(e, t, n, r, o);
|
|
2700
2703
|
return s.length > 0 ? s[0] : null;
|
|
2701
2704
|
}, exports.kwid_get_ids = function(e, t) {
|
|
2702
|
-
if (e && !
|
|
2705
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return [];
|
|
2703
2706
|
let n = [];
|
|
2704
|
-
if (
|
|
2705
|
-
else if (
|
|
2706
|
-
else
|
|
2707
|
-
if (
|
|
2708
|
-
else if (
|
|
2709
|
-
let r =
|
|
2707
|
+
if (dn(t)) n.push(t);
|
|
2708
|
+
else if (gn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2709
|
+
else pn(t) && t.forEach(function(t) {
|
|
2710
|
+
if (dn(t)) yn(t) || n.push(t);
|
|
2711
|
+
else if (gn(t)) {
|
|
2712
|
+
let r = kn(e, t, "id", 0, 0);
|
|
2710
2713
|
r && n.push(r);
|
|
2711
2714
|
}
|
|
2712
2715
|
});
|
|
2713
2716
|
return n;
|
|
2714
|
-
}, exports.kwid_match_id =
|
|
2715
|
-
e && !
|
|
2717
|
+
}, exports.kwid_match_id = Yn, exports.kwid_new_dict = function(e, t, n) {
|
|
2718
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2716
2719
|
let r = {};
|
|
2717
|
-
if (
|
|
2718
|
-
else if (
|
|
2719
|
-
let o = t[n], s =
|
|
2720
|
-
|
|
2720
|
+
if (yn(n) || (t = wn(e, t, n)), gn(t)) r = t;
|
|
2721
|
+
else if (pn(t)) for (let n = 0; n < t.length; n++) {
|
|
2722
|
+
let o = t[n], s = kn(e, o, "id", "", 0);
|
|
2723
|
+
yn(s) || (r[s] = o);
|
|
2721
2724
|
}
|
|
2722
|
-
else
|
|
2725
|
+
else Bt(`${Fe(e)} kwid_new_dict: data type unknown`);
|
|
2723
2726
|
return r;
|
|
2724
2727
|
}, exports.list2options = function(e, t, n) {
|
|
2725
2728
|
t = t || "id", n = n || "value";
|
|
2726
2729
|
let r = [];
|
|
2727
|
-
if (
|
|
2730
|
+
if (pn(e)) for (let o = 0; o < e.length; o++) {
|
|
2728
2731
|
let s = e[o];
|
|
2729
|
-
if (
|
|
2732
|
+
if (dn(s)) r.push({
|
|
2730
2733
|
id: e[o],
|
|
2731
2734
|
value: e[o]
|
|
2732
2735
|
});
|
|
2733
|
-
else if (
|
|
2736
|
+
else if (gn(s)) {
|
|
2734
2737
|
let e = {};
|
|
2735
|
-
if (
|
|
2736
|
-
if (!
|
|
2737
|
-
if (!(
|
|
2738
|
-
|
|
2738
|
+
if (Rn(s, t)) {
|
|
2739
|
+
if (!Rn(s, n)) {
|
|
2740
|
+
if (!(fn(s) > 0)) {
|
|
2741
|
+
Bt("list2options(): object without field value: " + n);
|
|
2739
2742
|
continue;
|
|
2740
2743
|
}
|
|
2741
2744
|
n = Object.keys(s)[0];
|
|
2742
2745
|
}
|
|
2743
2746
|
e.id = s[t], e.value = s[n];
|
|
2744
2747
|
} else {
|
|
2745
|
-
if (!(
|
|
2746
|
-
|
|
2748
|
+
if (!(fn(s) > 0)) {
|
|
2749
|
+
Bt("list2options(): object without field id: " + t);
|
|
2747
2750
|
continue;
|
|
2748
2751
|
}
|
|
2749
2752
|
t = Object.keys(s)[0], e.id = t, e.value = s[t];
|
|
2750
2753
|
}
|
|
2751
2754
|
r.push(e);
|
|
2752
|
-
} else
|
|
2755
|
+
} else Bt("list2options(): case1 not implemented");
|
|
2753
2756
|
}
|
|
2754
|
-
else if (
|
|
2757
|
+
else if (gn(e)) for (let t of Object.keys(e)) r.push({
|
|
2755
2758
|
id: t,
|
|
2756
2759
|
value: t
|
|
2757
2760
|
});
|
|
2758
|
-
else
|
|
2761
|
+
else Bt("list2options(): case2 not implemented");
|
|
2759
2762
|
return r;
|
|
2760
2763
|
}, exports.load_json_file = function(e, t, n) {
|
|
2761
2764
|
let r = new XMLHttpRequest();
|
|
@@ -2763,18 +2766,18 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2763
2766
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2764
2767
|
t(JSON.parse(r.responseText));
|
|
2765
2768
|
} catch (e) {
|
|
2766
|
-
n && (
|
|
2769
|
+
n && (Bt(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2767
2770
|
}
|
|
2768
2771
|
else n && n(r.status);
|
|
2769
2772
|
var e;
|
|
2770
2773
|
}, r.send();
|
|
2771
|
-
}, exports.log_debug =
|
|
2772
|
-
let t =
|
|
2773
|
-
|
|
2774
|
-
}, exports.log_warning =
|
|
2774
|
+
}, exports.log_debug = qt, exports.log_error = Bt, exports.log_info = function(e) {
|
|
2775
|
+
let t = Yt(e), n = ir();
|
|
2776
|
+
Ut && Vt && Ut("%c" + n + " INFO: " + String(t), "color:cyan"), Wt("info", t, n);
|
|
2777
|
+
}, exports.log_warning = Jt, exports.msg_iev_get_msg_type = er, exports.msg_iev_get_stack = Xn, exports.msg_iev_push_stack = Qn, exports.msg_iev_read_key = Hn, exports.msg_iev_set_msg_type = Zn, exports.msg_iev_write_key = zn, exports.node_uuid = _r, exports.parseBoolean = vn, exports.parseSVG = function(e) {
|
|
2775
2778
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2776
2779
|
}, exports.refresh_language = function(e, t) {
|
|
2777
|
-
|
|
2780
|
+
Tn(t) ? (e || (e = document), e.querySelectorAll("[data-i18n]").forEach(function(e) {
|
|
2778
2781
|
let n = e.getAttribute("data-i18n");
|
|
2779
2782
|
for (let r of e.childNodes) if (r.nodeType === Node.TEXT_NODE) {
|
|
2780
2783
|
n || (n = r.nodeValue), r.nodeValue = t(n);
|
|
@@ -2789,25 +2792,25 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2789
2792
|
}), e.querySelectorAll("[data-i18n-placeholder]").forEach(function(e) {
|
|
2790
2793
|
let n = e.getAttribute("data-i18n-placeholder");
|
|
2791
2794
|
n && e.setAttribute("placeholder", t(n));
|
|
2792
|
-
})) :
|
|
2795
|
+
})) : Bt("You must supply a translation function");
|
|
2793
2796
|
}, exports.register_c_ievent_cli = function() {
|
|
2794
2797
|
return function(e) {
|
|
2795
|
-
if (
|
|
2798
|
+
if (kr) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2796
2799
|
const t = [
|
|
2797
2800
|
["ST_DISCONNECTED", [
|
|
2798
2801
|
[
|
|
2799
2802
|
"EV_ON_OPEN",
|
|
2800
|
-
|
|
2803
|
+
Mr,
|
|
2801
2804
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
2802
2805
|
],
|
|
2803
2806
|
[
|
|
2804
2807
|
"EV_ON_CLOSE",
|
|
2805
|
-
|
|
2808
|
+
Wr,
|
|
2806
2809
|
null
|
|
2807
2810
|
],
|
|
2808
2811
|
[
|
|
2809
2812
|
"EV_TIMEOUT",
|
|
2810
|
-
|
|
2813
|
+
Vr,
|
|
2811
2814
|
null
|
|
2812
2815
|
],
|
|
2813
2816
|
[
|
|
@@ -2819,22 +2822,22 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2819
2822
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
2820
2823
|
[
|
|
2821
2824
|
"EV_ON_MESSAGE",
|
|
2822
|
-
|
|
2825
|
+
Br,
|
|
2823
2826
|
null
|
|
2824
2827
|
],
|
|
2825
2828
|
[
|
|
2826
2829
|
"EV_IDENTITY_CARD_ACK",
|
|
2827
|
-
|
|
2830
|
+
Yr,
|
|
2828
2831
|
null
|
|
2829
2832
|
],
|
|
2830
2833
|
[
|
|
2831
2834
|
"EV_ON_CLOSE",
|
|
2832
|
-
|
|
2835
|
+
Wr,
|
|
2833
2836
|
"ST_DISCONNECTED"
|
|
2834
2837
|
],
|
|
2835
2838
|
[
|
|
2836
2839
|
"EV_TIMEOUT",
|
|
2837
|
-
|
|
2840
|
+
Kr,
|
|
2838
2841
|
null
|
|
2839
2842
|
],
|
|
2840
2843
|
[
|
|
@@ -2846,22 +2849,22 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2846
2849
|
["ST_SESSION", [
|
|
2847
2850
|
[
|
|
2848
2851
|
"EV_ON_MESSAGE",
|
|
2849
|
-
|
|
2852
|
+
Br,
|
|
2850
2853
|
null
|
|
2851
2854
|
],
|
|
2852
2855
|
[
|
|
2853
2856
|
"EV_MT_STATS",
|
|
2854
|
-
|
|
2857
|
+
Jr,
|
|
2855
2858
|
null
|
|
2856
2859
|
],
|
|
2857
2860
|
[
|
|
2858
2861
|
"EV_MT_COMMAND",
|
|
2859
|
-
|
|
2862
|
+
qr,
|
|
2860
2863
|
null
|
|
2861
2864
|
],
|
|
2862
2865
|
[
|
|
2863
2866
|
"EV_ON_CLOSE",
|
|
2864
|
-
|
|
2867
|
+
Wr,
|
|
2865
2868
|
"ST_DISCONNECTED"
|
|
2866
2869
|
],
|
|
2867
2870
|
[
|
|
@@ -2872,7 +2875,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2872
2875
|
]],
|
|
2873
2876
|
[null, null]
|
|
2874
2877
|
];
|
|
2875
|
-
return (
|
|
2878
|
+
return (kr = ee(e, [
|
|
2876
2879
|
["EV_ON_MESSAGE", w.EVF_OUTPUT_EVENT],
|
|
2877
2880
|
["EV_IDENTITY_CARD_ACK", w.EVF_PUBLIC_EVENT],
|
|
2878
2881
|
["EV_ON_ID_NAK", w.EVF_PUBLIC_EVENT | w.EVF_OUTPUT_EVENT],
|
|
@@ -2883,52 +2886,52 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2883
2886
|
["EV_ON_OPEN_ERROR", w.EVF_OUTPUT_EVENT | w.EVF_NO_WARN_SUBS],
|
|
2884
2887
|
["EV_TIMEOUT", 0],
|
|
2885
2888
|
[null, 0]
|
|
2886
|
-
], t,
|
|
2889
|
+
], t, Hr, 0, xr, Ar, 0, 0, 0, O.gcflag_no_check_output_events)) ? 0 : -1;
|
|
2887
2890
|
}("C_IEVENT_CLI");
|
|
2888
2891
|
}, exports.register_c_timer = function() {
|
|
2889
2892
|
return function(e) {
|
|
2890
|
-
if (
|
|
2893
|
+
if (Er) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2891
2894
|
const t = [["ST_IDLE", [[
|
|
2892
2895
|
"EV_TIMEOUT",
|
|
2893
|
-
|
|
2896
|
+
Tr,
|
|
2894
2897
|
null
|
|
2895
2898
|
]]]];
|
|
2896
|
-
return (
|
|
2899
|
+
return (Er = ee(e, [
|
|
2897
2900
|
["EV_TIMEOUT", w.EVF_OUTPUT_EVENT],
|
|
2898
2901
|
["EV_TIMEOUT_PERIODIC", w.EVF_OUTPUT_EVENT],
|
|
2899
2902
|
[0, 0]
|
|
2900
|
-
], t,
|
|
2903
|
+
], t, hr, 0, br, mr, 0, 0, 0, O.gcflag_manual_start)) ? 0 : -1;
|
|
2901
2904
|
}("C_TIMER");
|
|
2902
2905
|
}, exports.register_c_yuno = function() {
|
|
2903
2906
|
return function(e) {
|
|
2904
|
-
if (
|
|
2907
|
+
if (Nr) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2905
2908
|
const t = [["ST_IDLE", [[
|
|
2906
2909
|
"EV_TIMEOUT_PERIODIC",
|
|
2907
|
-
|
|
2910
|
+
Rr,
|
|
2908
2911
|
null
|
|
2909
2912
|
]]]];
|
|
2910
|
-
return (
|
|
2913
|
+
return (Nr = ee(e, [["EV_TIMEOUT_PERIODIC", w.EVF_OUTPUT_EVENT | w.EVF_NO_WARN_SUBS], [0, 0]], t, wr, 0, Sr, Or, 0, 0, 0, 0)) ? 0 : -1;
|
|
2911
2914
|
}("C_YUNO");
|
|
2912
2915
|
}, exports.safeSrc = function(e) {
|
|
2913
2916
|
if (!e) return "";
|
|
2914
2917
|
const t = String(e).trim();
|
|
2915
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
2918
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : or(t);
|
|
2916
2919
|
}, exports.sdata_flag_t = T, exports.send_http_json_post = function(e, t, n) {
|
|
2917
2920
|
let r = new XMLHttpRequest();
|
|
2918
2921
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
2919
2922
|
4 === r.readyState && n(r.status, r.responseText);
|
|
2920
2923
|
}, r.send(t);
|
|
2921
2924
|
}, exports.set_console_log_enabled = function(e) {
|
|
2922
|
-
|
|
2925
|
+
Vt = !!e;
|
|
2923
2926
|
}, exports.set_log_callback = function(e) {
|
|
2924
|
-
|
|
2925
|
-
}, exports.set_remote_log_functions =
|
|
2927
|
+
Gt = "function" == typeof e ? e : null;
|
|
2928
|
+
}, exports.set_remote_log_functions = Kt, exports.set_timeout = yr, exports.set_timeout_periodic = vr, exports.sprintf = t, exports.stats_parser = function(e, t, n, r) {}, exports.str_in_list = qn, exports.strcasecmp = Sn, exports.strcmp = jn, exports.strncmp = function(e, t, n) {
|
|
2926
2929
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
2927
2930
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
2928
2931
|
}, exports.strs_in_list = function(e, t, n) {
|
|
2929
|
-
if (!e) return
|
|
2930
|
-
if (!t) return
|
|
2931
|
-
for (let r = 0; r < t.length; r++) if (
|
|
2932
|
+
if (!e) return Bt("ERROR: strs_in_list() list empty"), !1;
|
|
2933
|
+
if (!t) return Bt("ERROR: strs_in_list() str empty"), !1;
|
|
2934
|
+
for (let r = 0; r < t.length; r++) if (qn(e, t[r], n)) return !0;
|
|
2932
2935
|
return !1;
|
|
2933
2936
|
}, exports.strstr = function(e, t, n) {
|
|
2934
2937
|
var r;
|
|
@@ -2947,13 +2950,13 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2947
2950
|
placeholder: void 0,
|
|
2948
2951
|
fkey: null
|
|
2949
2952
|
};
|
|
2950
|
-
if (
|
|
2953
|
+
if (dn(t)) {
|
|
2951
2954
|
let e = t.split(".");
|
|
2952
2955
|
for (let t = 0; t < e.length; t++) {
|
|
2953
2956
|
let r = e[t];
|
|
2954
|
-
if (
|
|
2955
|
-
else if (
|
|
2956
|
-
else if (
|
|
2957
|
+
if (qn(fr, r)) n.real_type || (n.real_type = r);
|
|
2958
|
+
else if (qn(pr, r)) n.type || (n.type = r);
|
|
2959
|
+
else if (qn(gr, r)) switch (r) {
|
|
2957
2960
|
case "writable":
|
|
2958
2961
|
n.is_writable = !0;
|
|
2959
2962
|
break;
|
|
@@ -2965,23 +2968,23 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2965
2968
|
}
|
|
2966
2969
|
}
|
|
2967
2970
|
n.real_type || (n.real_type = "string");
|
|
2968
|
-
} else
|
|
2971
|
+
} else gn(t) ? (n = dr(t), n.name || (n.name = e), n.header || (n.header = e)) : pn(t) && (n.real_type = "array", n.enum_list = t);
|
|
2969
2972
|
return n.type || (n.type = n.real_type), n;
|
|
2970
2973
|
}, exports.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
2971
2974
|
const n = e, r = performance.now();
|
|
2972
2975
|
let o = r;
|
|
2973
|
-
return t &&
|
|
2976
|
+
return t && Jt(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", s = "") => {
|
|
2974
2977
|
const i = performance.now(), l = (i - o) / 1e3, _ = (i - r) / 1e3;
|
|
2975
|
-
return t &&
|
|
2978
|
+
return t && Jt(`--\x3e ${n} ${e} - partial: ${l} sec, total: ${_} sec, ${s}`), o = i, {
|
|
2976
2979
|
partial: l,
|
|
2977
2980
|
total: _
|
|
2978
2981
|
};
|
|
2979
2982
|
} };
|
|
2980
|
-
}, exports.trace_json =
|
|
2981
|
-
if (
|
|
2983
|
+
}, exports.trace_json = zt, exports.trace_level_t = C, exports.trace_msg = Ht, exports.treedb_decoder_fkey = cr, exports.treedb_decoder_hook = function(e, t) {
|
|
2984
|
+
if (dn(t)) {
|
|
2982
2985
|
if (-1 === t.indexOf("^")) {
|
|
2983
2986
|
let n, r = e.hook;
|
|
2984
|
-
if (1 !==
|
|
2987
|
+
if (1 !== un(r)) return Bt("bad hook 1"), Bt(e), Bt(t), null;
|
|
2985
2988
|
for (let e of Object.keys(r)) {
|
|
2986
2989
|
n = e, r[e];
|
|
2987
2990
|
break;
|
|
@@ -2993,27 +2996,27 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2993
2996
|
}
|
|
2994
2997
|
{
|
|
2995
2998
|
let n = t.split("^");
|
|
2996
|
-
return 2 !== n.length ? (
|
|
2999
|
+
return 2 !== n.length ? (Bt("bad hook 2"), Bt(e), Bt(t), null) : {
|
|
2997
3000
|
topic_name: n[0],
|
|
2998
3001
|
id: n[1]
|
|
2999
3002
|
};
|
|
3000
3003
|
}
|
|
3001
3004
|
}
|
|
3002
|
-
return
|
|
3005
|
+
return gn(t) ? {
|
|
3003
3006
|
topic_name: t.topic_name,
|
|
3004
3007
|
id: t.id
|
|
3005
|
-
} : (
|
|
3008
|
+
} : (Bt("bad hook 3"), Bt(e), Bt(t), null);
|
|
3006
3009
|
}, exports.treedb_encoder_fkey = function(e, t) {
|
|
3007
|
-
let n =
|
|
3010
|
+
let n = cr(e, t);
|
|
3008
3011
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3009
|
-
}, exports.treedb_get_field_desc =
|
|
3010
|
-
if (
|
|
3012
|
+
}, exports.treedb_get_field_desc = dr, exports.treedb_hook_data_size = function(e) {
|
|
3013
|
+
if (pn(e) && 1 === fn(e)) {
|
|
3011
3014
|
let t = e[0];
|
|
3012
|
-
return
|
|
3015
|
+
return Rn(t, "size") ? t.size : 1;
|
|
3013
3016
|
}
|
|
3014
|
-
return
|
|
3017
|
+
return fn(e);
|
|
3015
3018
|
}, exports.vsprintf = function(e, n) {
|
|
3016
3019
|
return t.apply(null, [e].concat(n || []));
|
|
3017
|
-
};
|
|
3020
|
+
}, exports.walk_type_t = D;
|
|
3018
3021
|
|
|
3019
3022
|
//# sourceMappingURL=gobj-js.cjs.min.js.map
|