@yuneta/gobj-js 7.16.6 → 7.21.0
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 +63 -10
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +310 -299
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +63 -11
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +280 -268
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +63 -10
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +98 -87
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +63 -10
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +218 -207
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
data: o || []
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
var l = "7.0.0a", s = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b = {}, p = null, m = null, E = 0,
|
|
136
|
+
var l = "7.0.0a", s = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b = {}, p = null, m = null, E = 0, h = Object.freeze({
|
|
137
137
|
DTP_STRING: 1,
|
|
138
138
|
DTP_BOOLEAN: 2,
|
|
139
139
|
DTP_INTEGER: 3,
|
|
@@ -143,8 +143,8 @@
|
|
|
143
143
|
DTP_JSON: 7,
|
|
144
144
|
DTP_POINTER: 8
|
|
145
145
|
});
|
|
146
|
-
|
|
147
|
-
var
|
|
146
|
+
h.DTP_POINTER;
|
|
147
|
+
var T = Object.freeze({
|
|
148
148
|
SDF_NOTACCESS: 1,
|
|
149
149
|
SDF_RD: 2,
|
|
150
150
|
SDF_WR: 4,
|
|
@@ -167,16 +167,16 @@
|
|
|
167
167
|
SDF_AUTHZ_S: 524288,
|
|
168
168
|
SDF_AUTHZ_RS: 1048576
|
|
169
169
|
});
|
|
170
|
-
|
|
170
|
+
T.SDF_RD, T.SDF_WR, T.SDF_STATS, T.SDF_PERSIST, T.SDF_VOLATIL, T.SDF_RSTATS, T.SDF_PSTATS, T.SDF_WR, T.SDF_PERSIST;
|
|
171
171
|
var y = class {
|
|
172
172
|
constructor(e, t, n = 0, r = null, o = "", i = null, l = null, s = 0, _ = null, a = null, u = null) {
|
|
173
173
|
this.type = e, this.name = t, this.alias = i, this.flag = n, this.default_value = r, this.header = l, this.fillspace = s, this.description = o, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
174
174
|
}
|
|
175
|
-
}, j = () => new y(0, null), v = (e, t, n, r, o) => new y(e, t, n, r, o),
|
|
175
|
+
}, j = () => new y(0, null), v = (e, t, n, r, o) => new y(e, t, n, r, o), O = class {
|
|
176
176
|
constructor(e, t, n, r, o, i, l, s, _) {
|
|
177
177
|
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = o, this.authz_table = i, this.command_table = l, this.s_user_trace_level = s, this.gclass_flag = Number(_) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
178
178
|
}
|
|
179
|
-
},
|
|
179
|
+
}, S = class {
|
|
180
180
|
constructor(e, t, n, r, o) {
|
|
181
181
|
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 = en(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
182
182
|
}
|
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
]
|
|
321
321
|
], F = 0, G = 0, V = 0;
|
|
322
322
|
function M(e, t) {
|
|
323
|
-
if (
|
|
323
|
+
if (On(e)) return 268369920;
|
|
324
324
|
if (/^[0-9]+$/.test(String(e))) {
|
|
325
325
|
const t = Number(e);
|
|
326
326
|
if (t) return t;
|
|
@@ -378,19 +378,19 @@
|
|
|
378
378
|
function z(e, t, n) {
|
|
379
379
|
let r, o = n.default_value;
|
|
380
380
|
switch (n.type) {
|
|
381
|
-
case
|
|
381
|
+
case h.DTP_STRING:
|
|
382
382
|
r = String(o);
|
|
383
383
|
break;
|
|
384
|
-
case
|
|
385
|
-
r =
|
|
384
|
+
case h.DTP_BOOLEAN:
|
|
385
|
+
r = Sn(o);
|
|
386
386
|
break;
|
|
387
|
-
case
|
|
387
|
+
case h.DTP_INTEGER:
|
|
388
388
|
r = parseInt(o), isNaN(r) && qt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
389
389
|
break;
|
|
390
|
-
case
|
|
390
|
+
case h.DTP_REAL:
|
|
391
391
|
r = Number(o), isNaN(r) && qt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
392
392
|
break;
|
|
393
|
-
case
|
|
393
|
+
case h.DTP_LIST:
|
|
394
394
|
if (En(o)) try {
|
|
395
395
|
r = JSON.parse(o);
|
|
396
396
|
} catch (e) {
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
else r = o;
|
|
400
400
|
mn(r) || (r = []);
|
|
401
401
|
break;
|
|
402
|
-
case
|
|
402
|
+
case h.DTP_DICT:
|
|
403
403
|
if (En(o)) try {
|
|
404
404
|
r = JSON.parse(o);
|
|
405
405
|
} catch (e) {
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
else r = o;
|
|
409
409
|
pn(r) || (r = {});
|
|
410
410
|
break;
|
|
411
|
-
case
|
|
411
|
+
case h.DTP_JSON:
|
|
412
412
|
if (En(o)) try {
|
|
413
413
|
r = JSON.parse(o);
|
|
414
414
|
} catch (e) {
|
|
@@ -416,14 +416,14 @@
|
|
|
416
416
|
}
|
|
417
417
|
else r = o;
|
|
418
418
|
break;
|
|
419
|
-
case
|
|
419
|
+
case h.DTP_POINTER: r = o;
|
|
420
420
|
}
|
|
421
421
|
return void 0 === r && (qt(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
422
422
|
}
|
|
423
423
|
function Q(e, t, n, r) {
|
|
424
424
|
let o;
|
|
425
425
|
switch (n.type) {
|
|
426
|
-
case
|
|
426
|
+
case h.DTP_STRING:
|
|
427
427
|
if (null == r) o = "";
|
|
428
428
|
else if (En(r)) o = String(r);
|
|
429
429
|
else {
|
|
@@ -431,16 +431,16 @@
|
|
|
431
431
|
e && (o = String(e));
|
|
432
432
|
}
|
|
433
433
|
break;
|
|
434
|
-
case
|
|
435
|
-
o =
|
|
434
|
+
case h.DTP_BOOLEAN:
|
|
435
|
+
o = Sn(r);
|
|
436
436
|
break;
|
|
437
|
-
case
|
|
437
|
+
case h.DTP_INTEGER:
|
|
438
438
|
o = parseInt(r), isNaN(o) && qt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
439
439
|
break;
|
|
440
|
-
case
|
|
440
|
+
case h.DTP_REAL:
|
|
441
441
|
o = Number(r), isNaN(o) && qt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
442
442
|
break;
|
|
443
|
-
case
|
|
443
|
+
case h.DTP_LIST:
|
|
444
444
|
if (En(r)) try {
|
|
445
445
|
o = JSON.parse(r);
|
|
446
446
|
} catch (e) {
|
|
@@ -449,7 +449,7 @@
|
|
|
449
449
|
else o = r;
|
|
450
450
|
if (!mn(o)) return qt(`attr must be an array: ${n.name}`), -1;
|
|
451
451
|
break;
|
|
452
|
-
case
|
|
452
|
+
case h.DTP_DICT:
|
|
453
453
|
if (En(r)) try {
|
|
454
454
|
o = JSON.parse(r);
|
|
455
455
|
} catch (e) {
|
|
@@ -458,7 +458,7 @@
|
|
|
458
458
|
else o = r;
|
|
459
459
|
if (!pn(o)) return qt(`attr must be an object: ${n.name}`), -1;
|
|
460
460
|
break;
|
|
461
|
-
case
|
|
461
|
+
case h.DTP_JSON:
|
|
462
462
|
if (En(r)) try {
|
|
463
463
|
o = JSON.parse(r);
|
|
464
464
|
} catch (e) {
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
else o = r;
|
|
468
468
|
if (!mn(o) && !pn(o)) return qt(`attr must be a json dict/list: ${n.name}`), -1;
|
|
469
469
|
break;
|
|
470
|
-
case
|
|
470
|
+
case h.DTP_POINTER: o = r;
|
|
471
471
|
}
|
|
472
472
|
return void 0 === o && qt(`${Ve(e)}: attr undefined: ${n.name}`), t[n.name] = o, pn(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;
|
|
473
473
|
}
|
|
@@ -478,7 +478,7 @@
|
|
|
478
478
|
return ot(e, t) ? X(e) : e && e.bottom_gobj ? Z(e.bottom_gobj, t, n) : (n && qt(`GClass Attribute NOT FOUND: ${Ve(e)}, attr ${t}`), null);
|
|
479
479
|
}
|
|
480
480
|
function ee(e, t, n) {
|
|
481
|
-
if (!(e && e instanceof
|
|
481
|
+
if (!(e && e instanceof O)) return n && qt("gclass NULL"), null;
|
|
482
482
|
if (!t) return e.attrs_table;
|
|
483
483
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
484
484
|
const r = e.attrs_table[n];
|
|
@@ -487,27 +487,27 @@
|
|
|
487
487
|
return n && qt(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
488
488
|
}
|
|
489
489
|
function te(e, t, n, r, o, i, l, s, _, a, u) {
|
|
490
|
-
if (
|
|
490
|
+
if (On(e)) return qt("gclass_name EMPTY"), null;
|
|
491
491
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return qt(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
492
492
|
if (ce(e)) return qt(`GClass ALREADY exists: ${e}`), null;
|
|
493
|
-
let c = new
|
|
493
|
+
let c = new O(e, r, o, i, l, s, _, a, u);
|
|
494
494
|
(function(e, t) {
|
|
495
|
-
e && e instanceof
|
|
495
|
+
e && e instanceof O ? t ? d[t] ? qt(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : qt("gclass_name undefined") : qt("gclass undefined");
|
|
496
496
|
})(c, e);
|
|
497
497
|
const f = n.length;
|
|
498
498
|
for (let e = 0; e < f; e++) {
|
|
499
499
|
let t = n[e][0], r = n[e][1];
|
|
500
|
-
if (
|
|
500
|
+
if (On(t)) continue;
|
|
501
501
|
if (ie(c, t) < 0) return ne(c), null;
|
|
502
502
|
const o = r.length;
|
|
503
503
|
for (let e = 0; e < o; e++) {
|
|
504
504
|
let n = r[e][0], o = r[e][1], i = r[e][2];
|
|
505
|
-
|
|
505
|
+
On(n) || le(c, t, n, o, i);
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
for (let e = 0; e < t.length; e++) {
|
|
509
509
|
let n = t[e][0], r = t[e][1];
|
|
510
|
-
if (!
|
|
510
|
+
if (!On(n)) {
|
|
511
511
|
if (ae(c, n)) return qt(`SMachine: event repeated in input_events: ${n}`), ne(c), null;
|
|
512
512
|
_e(c, n, r);
|
|
513
513
|
}
|
|
@@ -522,7 +522,7 @@
|
|
|
522
522
|
let t;
|
|
523
523
|
if (En(e)) t = e;
|
|
524
524
|
else {
|
|
525
|
-
if (!(e instanceof
|
|
525
|
+
if (!(e instanceof O)) return qt("Cannot unregister gclass, type unknown"), -1;
|
|
526
526
|
t = e.gclass_name;
|
|
527
527
|
}
|
|
528
528
|
let n = d[t];
|
|
@@ -545,22 +545,22 @@
|
|
|
545
545
|
return null;
|
|
546
546
|
}
|
|
547
547
|
function ie(e, t) {
|
|
548
|
-
return e instanceof
|
|
548
|
+
return e instanceof O ? re(e, t) ? (qt(`state already exists: ${t}`), -1) : (e.dl_states.push(new I(t)), 0) : (qt("Cannot add state, typeof not GClass"), -1);
|
|
549
549
|
}
|
|
550
550
|
function le(e, t, n, r, o) {
|
|
551
|
-
if (!(e instanceof
|
|
552
|
-
if (
|
|
551
|
+
if (!(e instanceof O)) return qt("Cannot add state, typeof not GClass"), -1;
|
|
552
|
+
if (On(t)) return qt("state_name EMPTY"), -1;
|
|
553
553
|
let i = re(e, t);
|
|
554
554
|
return i ? oe(i, n) ? (qt(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (i.dl_actions.push(new k(n, r, o)), 0) : (qt(`state not found: ${t}`), -1);
|
|
555
555
|
}
|
|
556
556
|
function se(e, t, n) {
|
|
557
|
-
|
|
557
|
+
On(t) || e.push(new $(t, n));
|
|
558
558
|
}
|
|
559
559
|
function _e(e, t, n) {
|
|
560
|
-
return e instanceof
|
|
560
|
+
return e instanceof O ? se(e.dl_events, t, n) : (qt("Cannot add state, typeof not GClass"), -1);
|
|
561
561
|
}
|
|
562
562
|
function ae(e, t) {
|
|
563
|
-
if (!(e instanceof
|
|
563
|
+
if (!(e instanceof O)) return qt("Cannot add state, typeof not GClass"), 0;
|
|
564
564
|
const n = e.dl_events.length, r = e.dl_events;
|
|
565
565
|
for (let e = 0; e < n; e++) {
|
|
566
566
|
let n = r[e];
|
|
@@ -569,23 +569,23 @@
|
|
|
569
569
|
return null;
|
|
570
570
|
}
|
|
571
571
|
function ue(e) {
|
|
572
|
-
if (!(e instanceof
|
|
572
|
+
if (!(e instanceof O)) return qt("Cannot add state, typeof not GClass"), -1;
|
|
573
573
|
let t = 0;
|
|
574
574
|
dn(e.dl_states) || (qt(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
575
575
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
576
576
|
let r = e.dl_states[n];
|
|
577
|
-
if (!
|
|
577
|
+
if (!On(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
578
578
|
let o = r.dl_actions[n];
|
|
579
|
-
|
|
579
|
+
On(o.event_name) || (ae(e, o.event_name) || (qt(`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 && (re(e, o.next_state) || (qt(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
583
583
|
let r = e.dl_events[n];
|
|
584
|
-
if (!
|
|
584
|
+
if (!On(r.event_name) && (hn(r.event_flag) || (qt(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & D.EVF_OUTPUT_EVENT))) {
|
|
585
585
|
let n = !1;
|
|
586
586
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
587
587
|
let o = e.dl_states[t];
|
|
588
|
-
|
|
588
|
+
On(o.state_name) || oe(o, r.event_name) && (n = !0);
|
|
589
589
|
}
|
|
590
590
|
n || (qt(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
591
591
|
}
|
|
@@ -627,18 +627,18 @@
|
|
|
627
627
|
let i = 0;
|
|
628
628
|
for (const [l, s] of Object.entries(t)) {
|
|
629
629
|
const t = ee(o.gclass, l, !1);
|
|
630
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
630
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && zt(`${Ve(o)}: Deprecated attribute used in gobj creation: ${l}`), i += Q(o, e, t, s)) : r && (r(o, l), i--);
|
|
631
631
|
}
|
|
632
632
|
return i;
|
|
633
633
|
})(X(e), r, -1, e.gclass.gclass_flag & N.gcflag_ignore_unknown_attrs ? 0 : me, e) < 0 && (qt(`${Ve(e)} json2data() FAILED`), Zt(r));
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function he(e, t, r, o, i) {
|
|
636
636
|
if (i & w.gobj_flag_yuno) {
|
|
637
637
|
if (p) return qt("__yuno__ already created"), null;
|
|
638
638
|
i |= w.gobj_flag_service;
|
|
639
639
|
} else {
|
|
640
640
|
if (!o) return qt("gobj NEEDS a parent!"), null;
|
|
641
|
-
if (!("string" == typeof o || o instanceof
|
|
641
|
+
if (!("string" == typeof o || o instanceof S)) return qt(`BAD TYPE of parent: ${o}`), null;
|
|
642
642
|
if (En(o) && !(o = ge(o))) return zt(`parent service not found: ${o}`), null;
|
|
643
643
|
}
|
|
644
644
|
if (i & w.gobj_flag_service && ge(e, !1)) return qt(`service ALREADY registered: ${t}^${e}`), null;
|
|
@@ -646,29 +646,29 @@
|
|
|
646
646
|
if (m) return qt(`default service ALREADY registered: ${t}^${e}`), null;
|
|
647
647
|
i |= w.gobj_flag_service;
|
|
648
648
|
}
|
|
649
|
-
if (
|
|
649
|
+
if (On(t)) return qt("gclass_name must be a string"), null;
|
|
650
650
|
let l = ce(t, !1);
|
|
651
651
|
if (!l) return qt(`GClass not registered: ${t}^${e}`), null;
|
|
652
652
|
if (!En(e)) return qt(`gobj_name must be a string: ${t}`), null;
|
|
653
|
-
if (!
|
|
653
|
+
if (!On(e)) {
|
|
654
654
|
if (e.includes("`")) return qt(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
655
655
|
if (e.includes("^")) return qt(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
656
656
|
}
|
|
657
|
-
let _ = new
|
|
657
|
+
let _ = new S(e, l, r, o, i);
|
|
658
658
|
_.jn_attrs = q(_, l.attrs_table);
|
|
659
659
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
660
660
|
let a = Y(_);
|
|
661
661
|
return a && L(n("💙💙⏩ creating: %s^%s", l.gclass_name, e)), _.gobj_flag & w.gobj_flag_service && de(_), _.gobj_flag & w.gobj_flag_yuno && (p = _), _.gobj_flag & w.gobj_flag_default_service && (m = _), _.gobj_flag & w.gobj_flag_yuno || be(o, _), _.obflag |= R.obflag_created, _.gclass.instances++, Ee(_, r), _.gobj_flag & w.gobj_flag_service && s && s(_, null), _.gclass.gmt.mt_create2 ? _.gclass.gmt.mt_create2(_, r) : _.gclass.gmt.mt_create && _.gclass.gmt.mt_create(_), o && o.gclass.gmt.mt_child_added && (a && L(n("👦👦🔵 child_added(%s): %s", Me(o), Ve(_))), o.gclass.gmt.mt_child_added(o, _)), a && L(n("💙💙⏪ created: %s", Me(_))), _;
|
|
662
662
|
}
|
|
663
|
-
function
|
|
664
|
-
return
|
|
663
|
+
function Te(e, t, n, r) {
|
|
664
|
+
return he(e, t, n, r, w.gobj_flag_pure_child);
|
|
665
665
|
}
|
|
666
666
|
function ye(e) {
|
|
667
667
|
if (Ye(e)) return void qt("gobj NULL or DESTROYED");
|
|
668
|
-
e.__refs__ > 0 && qt(`${Ve(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (qt(`Destroying a PLAYING gobj: ${Me(e)}`), De(e)), e.running && (qt(`Destroying a RUNNING gobj: ${Me(e)}`),
|
|
669
|
-
if (0 ===
|
|
670
|
-
for (let t of
|
|
671
|
-
|
|
668
|
+
e.__refs__ > 0 && qt(`${Ve(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (qt(`Destroying a PLAYING gobj: ${Me(e)}`), De(e)), e.running && (qt(`Destroying a RUNNING gobj: ${Me(e)}`), Se(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
669
|
+
if (0 === Tt.length) return;
|
|
670
|
+
for (let t of Tt) t.src === e && (t.src = null);
|
|
671
|
+
Tt = Tt.filter((t) => t.dst !== e);
|
|
672
672
|
}(e);
|
|
673
673
|
let t = Y(e);
|
|
674
674
|
t && L(n("💔💔⏩ destroying: %s", Me(e)));
|
|
@@ -695,10 +695,10 @@
|
|
|
695
695
|
function ve(e, t, n) {
|
|
696
696
|
return e.gclass.gclass_flag & N.gcflag_manual_start || Ye(e) || Ae(e) || ke(e) || je(e), 0;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Oe(e, t, n) {
|
|
699
699
|
return e.gclass.gclass_flag & N.gcflag_manual_start || ke(e) ? 1 : (Ae(e) || je(e), 0);
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function Se(e) {
|
|
702
702
|
if (Ye(e)) return qt("gobj NULL or DESTROYED"), -1;
|
|
703
703
|
if (!e.running) return qt(`${Ve(e)}: GObj NOT RUNNING`), -1;
|
|
704
704
|
e.playing && (zt(`${Ve(e)}: GObj stopping without previous pause`), De(e)), B(e) && L(n("⏹ ⏹ stop: %s", Me(e))), e.running = !1;
|
|
@@ -706,7 +706,7 @@
|
|
|
706
706
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
707
707
|
}
|
|
708
708
|
function Ne(e, t, n) {
|
|
709
|
-
return Ae(e) &&
|
|
709
|
+
return Ae(e) && Se(e), 0;
|
|
710
710
|
}
|
|
711
711
|
function we(e) {
|
|
712
712
|
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : qe(e, A.WALK_FIRST2LAST, Ne, 0, 0);
|
|
@@ -879,7 +879,7 @@
|
|
|
879
879
|
return i ? (n.splice(0, 1), n = n.join("`"), rt(i, n)) : null;
|
|
880
880
|
}
|
|
881
881
|
function ot(e, t) {
|
|
882
|
-
return !
|
|
882
|
+
return !On(t) && !!ee(e.gclass, t, !1);
|
|
883
883
|
}
|
|
884
884
|
function it(e, t, n) {
|
|
885
885
|
let r = e.jn_attrs;
|
|
@@ -934,7 +934,7 @@
|
|
|
934
934
|
}
|
|
935
935
|
function ft(e, t, n) {
|
|
936
936
|
let r = Z(e, t, !1);
|
|
937
|
-
return r ? (r[t] =
|
|
937
|
+
return r ? (r[t] = Sn(n), pn(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) : (qt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
938
938
|
}
|
|
939
939
|
function gt(e, t, n) {
|
|
940
940
|
let r = Z(e, t, !1);
|
|
@@ -975,21 +975,21 @@
|
|
|
975
975
|
let r = mt(e, t, !1);
|
|
976
976
|
return !!r && !(n && !(r.event_flag & n));
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function ht(e, t, n) {
|
|
979
979
|
let r = mt(e, t, !1);
|
|
980
980
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & D.EVF_OUTPUT_EVENT);
|
|
981
981
|
}
|
|
982
|
-
var
|
|
982
|
+
var Tt = [], yt = !1;
|
|
983
983
|
function jt() {
|
|
984
984
|
yt = !1;
|
|
985
|
-
let e =
|
|
986
|
-
|
|
985
|
+
let e = Tt;
|
|
986
|
+
Tt = [];
|
|
987
987
|
let t = 0;
|
|
988
988
|
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (vt(n.dst, n.event, n.kw, n.src), t++);
|
|
989
|
-
return
|
|
989
|
+
return Tt.length > 0 && !yt && (yt = !0, setTimeout(jt, 0)), t;
|
|
990
990
|
}
|
|
991
991
|
function vt(e, t, r, o) {
|
|
992
|
-
if (!(e && e instanceof
|
|
992
|
+
if (!(e && e instanceof S)) return qt("gobj dst NULL"), -1;
|
|
993
993
|
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return qt("gobj dst DESTROYED"), -1;
|
|
994
994
|
let i = e.current_state;
|
|
995
995
|
if (!i) return qt(`${Ve(e)}: current_state NULL`), -1;
|
|
@@ -1010,22 +1010,22 @@
|
|
|
1010
1010
|
try {
|
|
1011
1011
|
s.action && (_ = s.action(e, t, r, o));
|
|
1012
1012
|
} finally {}
|
|
1013
|
-
return !l || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ge(e), Fe(e), e.current_state.state_name, t || "",
|
|
1013
|
+
return !l || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ge(e), Fe(e), e.current_state.state_name, t || "", hn(_) ? _ : 0)), E--, _;
|
|
1014
1014
|
}
|
|
1015
|
-
var
|
|
1015
|
+
var Ot = Object.freeze({
|
|
1016
1016
|
__hard_subscription__: 1,
|
|
1017
1017
|
__own_event__: 2
|
|
1018
|
-
}),
|
|
1019
|
-
v(
|
|
1020
|
-
v(
|
|
1021
|
-
v(
|
|
1022
|
-
v(
|
|
1023
|
-
v(
|
|
1024
|
-
v(
|
|
1025
|
-
v(
|
|
1026
|
-
v(
|
|
1027
|
-
v(
|
|
1028
|
-
v(
|
|
1018
|
+
}), St = [
|
|
1019
|
+
v(h.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1020
|
+
v(h.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1021
|
+
v(h.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
1022
|
+
v(h.DTP_STRING, "renamed_event", 0, "", "rename event name"),
|
|
1023
|
+
v(h.DTP_INTEGER, "subs_flag", 0, 0, "subscription flag"),
|
|
1024
|
+
v(h.DTP_JSON, "__config__", 0, null, "subscription config"),
|
|
1025
|
+
v(h.DTP_JSON, "__global__", 0, null, "global kw, merge in publishing"),
|
|
1026
|
+
v(h.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1027
|
+
v(h.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1028
|
+
v(h.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1029
1029
|
j()
|
|
1030
1030
|
];
|
|
1031
1031
|
function Nt(e, t, n, r, o) {
|
|
@@ -1062,7 +1062,7 @@
|
|
|
1062
1062
|
}
|
|
1063
1063
|
function Dt(e, t, r, o) {
|
|
1064
1064
|
let i = Pn(e, t, "publisher", null, Lt.KW_REQUIRED), l = Pn(e, t, "subscriber", null, Lt.KW_REQUIRED), s = Ln(e, t, "event", "", Lt.KW_REQUIRED);
|
|
1065
|
-
if (!!(Cn(e, t, "subs_flag", null, Lt.KW_REQUIRED) &
|
|
1065
|
+
if (!!(Cn(e, t, "subs_flag", null, Lt.KW_REQUIRED) & Ot.__hard_subscription__) && !r) return -1;
|
|
1066
1066
|
p && st(p, "trace_subscriptions") && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Ve(i), Ve(l))), Zt(t)), i.obflag & R.obflag_destroyed || o || i.gclass.gmt.mt_subscription_deleted && i.gclass.gmt.mt_subscription_deleted(i, t);
|
|
1067
1067
|
let _ = Rt(i.dl_subscriptions, i, s, t, l);
|
|
1068
1068
|
return _ >= 0 ? fn(i.dl_subscriptions, _) : (qt(`${Ve(e)}: subscription in publisher not found`), Zt(t)), _ = Rt(l.dl_subscribings, i, s, t, l), _ >= 0 ? fn(l.dl_subscribings, _) : (qt(`${Ve(e)}: subscription in subscriber not found`), Zt(t)), 0;
|
|
@@ -1079,12 +1079,12 @@
|
|
|
1079
1079
|
]);
|
|
1080
1080
|
if (Object.keys(r).forEach((n) => {
|
|
1081
1081
|
i.has(n) || qt(`${Ve(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1082
|
-
}),
|
|
1083
|
-
else if (!(
|
|
1082
|
+
}), On(t)) t = "";
|
|
1083
|
+
else if (!(ht(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Ve(e)}, ${t}`), 0;
|
|
1084
1084
|
let l = wt(e.dl_subscriptions, e, t, r, o);
|
|
1085
1085
|
dn(l) > 0 && (qt(`${Ve(e)}: ${dn(l)} subscription(s) REPEATED, will be deleted and override`), Zt(l, "subscription REPEATED"), kt(e, l, !1));
|
|
1086
1086
|
let s = function(e, t, n, r) {
|
|
1087
|
-
let o = q(e,
|
|
1087
|
+
let o = q(e, St);
|
|
1088
1088
|
an(o, "event", t), an(o, "subscriber", r), an(o, "publisher", e);
|
|
1089
1089
|
let i = 0;
|
|
1090
1090
|
if (n) {
|
|
@@ -1093,14 +1093,14 @@
|
|
|
1093
1093
|
let n = en(t);
|
|
1094
1094
|
if (an(o, "__config__", n), An(n, "__hard_subscription__")) {
|
|
1095
1095
|
let t = $n(e, n, "__hard_subscription__", !1);
|
|
1096
|
-
sn(n, "__hard_subscription__"), t && (i |=
|
|
1096
|
+
sn(n, "__hard_subscription__"), t && (i |= Ot.__hard_subscription__);
|
|
1097
1097
|
}
|
|
1098
1098
|
if (An(n, "__own_event__")) {
|
|
1099
1099
|
let t = $n(e, n, "__own_event__", !1);
|
|
1100
|
-
sn(n, "__own_event__"), t && (i |=
|
|
1100
|
+
sn(n, "__own_event__"), t && (i |= Ot.__own_event__);
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
bn(l) > 0 && an(o, "__local__", en(l)), bn(s) > 0 && an(o, "__filter__", en(s)),
|
|
1103
|
+
bn(l) > 0 && an(o, "__local__", en(l)), bn(s) > 0 && an(o, "__filter__", en(s)), On(_) || an(o, "__service__", _);
|
|
1104
1104
|
}
|
|
1105
1105
|
return an(o, "subs_flag", i), o;
|
|
1106
1106
|
}(e, t, r, o);
|
|
@@ -1124,7 +1124,7 @@
|
|
|
1124
1124
|
}
|
|
1125
1125
|
function Ct(e, t, r) {
|
|
1126
1126
|
if (pn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return qt("gobj NULL or DESTROYED"), -1;
|
|
1127
|
-
if (
|
|
1127
|
+
if (On(t)) return qt(`${Ve(e)}: event EMPTY`), -1;
|
|
1128
1128
|
let o = mt(e, t, !0);
|
|
1129
1129
|
if (!(o && o.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Ve(e)}, ev ${t}`), -1;
|
|
1130
1130
|
let i = p && st(p, "trace_subscriptions");
|
|
@@ -1143,7 +1143,7 @@
|
|
|
1143
1143
|
let u = Pn(e, a, "subscriber", null, Lt.KW_REQUIRED);
|
|
1144
1144
|
if (!u || Ye(u)) continue;
|
|
1145
1145
|
let c = Cn(e, a, "subs_flag", 0, Lt.KW_REQUIRED), f = Ln(e, a, "event", "", Lt.KW_REQUIRED);
|
|
1146
|
-
if (
|
|
1146
|
+
if (On(f) || 0 === wn(f, t)) {
|
|
1147
1147
|
Un(e, a, "__config__", null, 0);
|
|
1148
1148
|
let o = Un(e, a, "__global__", null, 0), l = Un(e, a, "__local__", null, 0), f = Fn(e, a, "__filter__", null, 0), g = r, d = 1;
|
|
1149
1149
|
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : bn(f) > 0 && (d = Wn(g, f) ? 1 : 0, i && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", Ve(u), Ve(e))), Zt(f))), d < 0) break;
|
|
@@ -1152,7 +1152,7 @@
|
|
|
1152
1152
|
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !Et(u, b.event_name, 0)) continue;
|
|
1153
1153
|
l && Dn(g, l), o && nn(g, o), i && (L(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", t || "", u.running ? "" : "!!", Ve(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", Ve(u), pt(u), t || "", e && !e.running ? "!!" : "", Ve(e))), gn(g) && Zt(g));
|
|
1154
1154
|
let p = vt(u, t, g, e);
|
|
1155
|
-
if (p < 0 && c &
|
|
1155
|
+
if (p < 0 && c & Ot.__own_event__) {
|
|
1156
1156
|
s = -1;
|
|
1157
1157
|
break;
|
|
1158
1158
|
}
|
|
@@ -1326,10 +1326,10 @@
|
|
|
1326
1326
|
function En(e) {
|
|
1327
1327
|
return "string" == typeof e;
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1329
|
+
function hn(e) {
|
|
1330
1330
|
return "number" == typeof e && Number.isFinite(e);
|
|
1331
1331
|
}
|
|
1332
|
-
function
|
|
1332
|
+
function Tn(e) {
|
|
1333
1333
|
return "boolean" == typeof e;
|
|
1334
1334
|
}
|
|
1335
1335
|
function yn(e) {
|
|
@@ -1339,13 +1339,13 @@
|
|
|
1339
1339
|
return "function" == typeof e;
|
|
1340
1340
|
}
|
|
1341
1341
|
function vn(e) {
|
|
1342
|
-
return e instanceof
|
|
1342
|
+
return e instanceof S;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function On(e) {
|
|
1345
1345
|
return !En(e) || 0 === e.length;
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1348
|
-
return
|
|
1347
|
+
function Sn(e) {
|
|
1348
|
+
return hn(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1349
1349
|
}
|
|
1350
1350
|
function Nn(e, t) {
|
|
1351
1351
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
@@ -1356,11 +1356,11 @@
|
|
|
1356
1356
|
}
|
|
1357
1357
|
function Rn(e, t) {
|
|
1358
1358
|
if (pn(e) || pn(t) || mn(e) || mn(t)) return 0;
|
|
1359
|
-
if (
|
|
1359
|
+
if (hn(e) || hn(t)) {
|
|
1360
1360
|
let n = Number(e), r = Number(t);
|
|
1361
1361
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1362
1362
|
}
|
|
1363
|
-
if (
|
|
1363
|
+
if (Tn(e) || Tn(t)) {
|
|
1364
1364
|
let n = Number(e), r = Number(t);
|
|
1365
1365
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1366
1366
|
}
|
|
@@ -1389,7 +1389,7 @@
|
|
|
1389
1389
|
let n = e.lastIndexOf(t);
|
|
1390
1390
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1391
1391
|
}(n, "`");
|
|
1392
|
-
return
|
|
1392
|
+
return On(o) ? sn(t, n) : sn(kn(e, t, r, !0), o), 0;
|
|
1393
1393
|
}
|
|
1394
1394
|
function $n(e, t, n, r, o) {
|
|
1395
1395
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
@@ -1415,7 +1415,7 @@
|
|
|
1415
1415
|
}
|
|
1416
1416
|
return l && (qt(`path not found: '${n}'`), Zt(t)), parseInt(r);
|
|
1417
1417
|
}
|
|
1418
|
-
return _ && In(e, t, n),
|
|
1418
|
+
return _ && In(e, t, n), hn(i) ? parseInt(i) : (l && (qt(`path value MUST BE a number: ${n}`), Xt(t)), parseInt(r));
|
|
1419
1419
|
}
|
|
1420
1420
|
function Ln(e, t, n, r, o) {
|
|
1421
1421
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
@@ -1491,14 +1491,14 @@
|
|
|
1491
1491
|
i = !1;
|
|
1492
1492
|
for (let l = 0; l < t.length; l++) {
|
|
1493
1493
|
let s = t[l];
|
|
1494
|
-
if (o =
|
|
1494
|
+
if (o = On(r) ? n("%s", r) : n("%s`%d", r, l), i = Mn(e, s, o), i) break;
|
|
1495
1495
|
}
|
|
1496
1496
|
} else if (pn(t)) {
|
|
1497
1497
|
i = !0;
|
|
1498
1498
|
let l = Object.keys(t);
|
|
1499
1499
|
for (let s = 0; s < l.length; s++) {
|
|
1500
1500
|
let _ = l[s], a = t[_];
|
|
1501
|
-
if (o =
|
|
1501
|
+
if (o = On(r) ? n("%s", _) : n("%s`%s", r, _), mn(a) || pn(a)) {
|
|
1502
1502
|
if (i = Mn(e, a, o), !i) break;
|
|
1503
1503
|
continue;
|
|
1504
1504
|
}
|
|
@@ -1521,7 +1521,7 @@
|
|
|
1521
1521
|
function Kn(e, t, n, r) {
|
|
1522
1522
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
1523
1523
|
let o = {};
|
|
1524
|
-
if (En(n) && !
|
|
1524
|
+
if (En(n) && !On(n)) {
|
|
1525
1525
|
let i = n;
|
|
1526
1526
|
t.hasOwnProperty(i) ? o[i] = t[i] : r && qt(`${Ve(e)}: key not found: ${i}`);
|
|
1527
1527
|
} else if (pn(n) && gn(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? o[i] = t[i] : r && qt(`${Ve(e)}: key not found: ${i}`);
|
|
@@ -1536,7 +1536,7 @@
|
|
|
1536
1536
|
}
|
|
1537
1537
|
function xn(e, t, n, r) {
|
|
1538
1538
|
let o = {};
|
|
1539
|
-
if (nn(o, t), En(n) && !
|
|
1539
|
+
if (nn(o, t), En(n) && !On(n)) {
|
|
1540
1540
|
let i = n;
|
|
1541
1541
|
Fn(e, t, i, 0, 0) ? sn(o, i) : r && qt(`${Ve(e)}: key not found: ${i}`);
|
|
1542
1542
|
} else if (pn(n) && gn(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? sn(o, i) : r && qt(`${Ve(e)}: key not found: ${i}`);
|
|
@@ -1654,7 +1654,7 @@
|
|
|
1654
1654
|
return o ? 0 === o.length ? (r && qt(`stack empty: ${n}`), null) : o[0] : (r && qt(`stack NOT FOUND: ${n}`), null);
|
|
1655
1655
|
}
|
|
1656
1656
|
function nr(e, t, n) {
|
|
1657
|
-
return
|
|
1657
|
+
return On(n) ? In(e, t, "__md_iev__`__msg_type__") : Vn(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1658
1658
|
}
|
|
1659
1659
|
function rr(e, t) {
|
|
1660
1660
|
return Ln(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
@@ -1775,7 +1775,7 @@
|
|
|
1775
1775
|
function Er(e) {
|
|
1776
1776
|
return "persistent-attrs-" + Ve(e);
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function hr(e, t) {
|
|
1779
1779
|
if (En(t)) {
|
|
1780
1780
|
if (-1 === t.indexOf("^")) {
|
|
1781
1781
|
let n, r, o = e.fkey;
|
|
@@ -1805,7 +1805,7 @@
|
|
|
1805
1805
|
hook_name: t.hook_name
|
|
1806
1806
|
} : (qt("bad fkey 3"), qt(e), qt(t), null);
|
|
1807
1807
|
}
|
|
1808
|
-
var
|
|
1808
|
+
var Tr = [
|
|
1809
1809
|
"string",
|
|
1810
1810
|
"integer",
|
|
1811
1811
|
"object",
|
|
@@ -1902,12 +1902,12 @@
|
|
|
1902
1902
|
}
|
|
1903
1903
|
return t.is_file && (t.type = "file"), t;
|
|
1904
1904
|
}
|
|
1905
|
-
var
|
|
1906
|
-
v(
|
|
1907
|
-
v(
|
|
1908
|
-
v(
|
|
1905
|
+
var Or = [
|
|
1906
|
+
v(h.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1907
|
+
v(h.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1908
|
+
v(h.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1909
1909
|
j()
|
|
1910
|
-
],
|
|
1910
|
+
], Sr = {
|
|
1911
1911
|
periodic: !1,
|
|
1912
1912
|
msec: 0,
|
|
1913
1913
|
timer_id: -1
|
|
@@ -1916,7 +1916,7 @@
|
|
|
1916
1916
|
let o = e.priv, i = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1917
1917
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
1918
1918
|
vt(e, "EV_TIMEOUT", {}, e);
|
|
1919
|
-
}, o.msec) : o.timer_id = -1, xe(e) ? vt(We(e), i, {}, e) : Ct(e, i, {}), o.periodic || -1 !== o.timer_id || Ae(e) &&
|
|
1919
|
+
}, o.msec) : o.timer_id = -1, xe(e) ? vt(We(e), i, {}, e) : Ct(e, i, {}), o.periodic || -1 !== o.timer_id || Ae(e) && Se(e), 0;
|
|
1920
1920
|
}
|
|
1921
1921
|
var Rr = {
|
|
1922
1922
|
mt_create: function(e) {
|
|
@@ -1932,7 +1932,7 @@
|
|
|
1932
1932
|
break;
|
|
1933
1933
|
case "msec": n.msec = _t(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
1934
1934
|
vt(e, "EV_TIMEOUT", {}, e);
|
|
1935
|
-
}, n.msec)), n.msec > 0 ? Ae(e) || je(e) : Ae(e) &&
|
|
1935
|
+
}, n.msec)), n.msec > 0 ? Ae(e) || je(e) : Ae(e) && Se(e);
|
|
1936
1936
|
}
|
|
1937
1937
|
},
|
|
1938
1938
|
mt_start: function(e) {
|
|
@@ -1944,39 +1944,39 @@
|
|
|
1944
1944
|
mt_destroy: function(e) {}
|
|
1945
1945
|
};
|
|
1946
1946
|
function Dr(e, t) {
|
|
1947
|
-
return e instanceof
|
|
1947
|
+
return e instanceof S ? "C_TIMER" !== Ge(e) ? (qt("not C_TIMER GObj"), -1) : (ft(e, "periodic", !1), void gt(e, "msec", t)) : (qt("not GObj TYPE"), -1);
|
|
1948
1948
|
}
|
|
1949
1949
|
function Ar(e, t) {
|
|
1950
|
-
return e instanceof
|
|
1950
|
+
return e instanceof S ? "C_TIMER" !== Ge(e) ? (qt("not C_TIMER GObj"), -1) : (ft(e, "periodic", !0), void gt(e, "msec", t)) : (qt("not GObj TYPE"), -1);
|
|
1951
1951
|
}
|
|
1952
1952
|
function kr(e) {
|
|
1953
|
-
return e instanceof
|
|
1953
|
+
return e instanceof S ? "C_TIMER" !== Ge(e) ? (qt("not C_TIMER GObj"), -1) : void gt(e, "msec", -1) : (qt("not GObj TYPE"), -1);
|
|
1954
1954
|
}
|
|
1955
1955
|
var Ir = [
|
|
1956
|
-
v(
|
|
1957
|
-
v(
|
|
1958
|
-
v(
|
|
1959
|
-
v(
|
|
1960
|
-
v(
|
|
1961
|
-
v(
|
|
1962
|
-
v(
|
|
1963
|
-
v(
|
|
1964
|
-
v(
|
|
1965
|
-
v(
|
|
1966
|
-
v(
|
|
1967
|
-
v(
|
|
1968
|
-
v(
|
|
1969
|
-
v(
|
|
1970
|
-
v(
|
|
1971
|
-
v(
|
|
1972
|
-
v(
|
|
1973
|
-
v(
|
|
1974
|
-
v(
|
|
1975
|
-
v(
|
|
1976
|
-
v(
|
|
1977
|
-
v(
|
|
1978
|
-
v(
|
|
1979
|
-
v(
|
|
1956
|
+
v(h.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
1957
|
+
v(h.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
1958
|
+
v(h.DTP_STRING, "__username__", 0, "", "Username"),
|
|
1959
|
+
v(h.DTP_STRING, "start_date", 0, "", "Yuno starting date"),
|
|
1960
|
+
v(h.DTP_STRING, "node_uuid", 0, "", "uuid of node"),
|
|
1961
|
+
v(h.DTP_STRING, "yuno_role", 0, "", "Yuno role"),
|
|
1962
|
+
v(h.DTP_STRING, "yuno_id", 0, "", "Yuno Id. Set by agent"),
|
|
1963
|
+
v(h.DTP_STRING, "yuno_name", 0, "", "Yuno name. Set by agent"),
|
|
1964
|
+
v(h.DTP_STRING, "yuno_tag", 0, "", "Tags of yuno. Set by agent"),
|
|
1965
|
+
v(h.DTP_STRING, "yuno_release", 0, "", "Yuno Release. Set by agent"),
|
|
1966
|
+
v(h.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
1967
|
+
v(h.DTP_STRING, "yuneta_version", 0, l, "Yuneta version"),
|
|
1968
|
+
v(h.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
1969
|
+
v(h.DTP_INTEGER, "tracing", 0, 0, "Tracing level"),
|
|
1970
|
+
v(h.DTP_BOOLEAN, "trace_timer", 0, 0, "Trace timers"),
|
|
1971
|
+
v(h.DTP_BOOLEAN, "trace_inter_event", 0, 0, "Trace traffic"),
|
|
1972
|
+
v(h.DTP_POINTER, "trace_ievent_callback", 0, null, "Trace traffic callback"),
|
|
1973
|
+
v(h.DTP_BOOLEAN, "trace_creation", 0, 0, "Trace creation"),
|
|
1974
|
+
v(h.DTP_BOOLEAN, "trace_start_stop", 0, 0, "Trace start/stop"),
|
|
1975
|
+
v(h.DTP_BOOLEAN, "trace_subscriptions", 0, 0, "Trace subscription"),
|
|
1976
|
+
v(h.DTP_BOOLEAN, "trace_i18n", 0, 0, "Trace i18n"),
|
|
1977
|
+
v(h.DTP_BOOLEAN, "no_poll", 0, 0, "no poll"),
|
|
1978
|
+
v(h.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
1979
|
+
v(h.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
1980
1980
|
j()
|
|
1981
1981
|
], $r = { gobj_timer: null }, Cr = null;
|
|
1982
1982
|
function Lr(e, t, n, r) {
|
|
@@ -1985,7 +1985,7 @@
|
|
|
1985
1985
|
var Pr = {
|
|
1986
1986
|
mt_create: function(e) {
|
|
1987
1987
|
let t = e.priv;
|
|
1988
|
-
dt(e, "start_date", ar()), dt(e, "node_uuid", cr()), e.priv.gobj_timer =
|
|
1988
|
+
dt(e, "start_date", ar()), dt(e, "node_uuid", cr()), e.priv.gobj_timer = Te(Fe(e), "C_TIMER", {}, e), t.periodic_timeout = it(e, "periodic_timeout");
|
|
1989
1989
|
},
|
|
1990
1990
|
mt_writing: function(e, t) {},
|
|
1991
1991
|
mt_start: function(e) {
|
|
@@ -2004,21 +2004,21 @@
|
|
|
2004
2004
|
}
|
|
2005
2005
|
};
|
|
2006
2006
|
var Ur = "ievent_gate_stack", Fr = [
|
|
2007
|
-
v(
|
|
2008
|
-
v(
|
|
2009
|
-
v(
|
|
2010
|
-
v(
|
|
2011
|
-
v(
|
|
2012
|
-
v(
|
|
2013
|
-
v(
|
|
2014
|
-
v(
|
|
2015
|
-
v(
|
|
2016
|
-
v(
|
|
2017
|
-
v(
|
|
2018
|
-
v(
|
|
2019
|
-
v(
|
|
2020
|
-
v(
|
|
2021
|
-
v(
|
|
2007
|
+
v(h.DTP_STRING, "wanted_yuno_role", T.SDF_RD, "", "wanted yuno role"),
|
|
2008
|
+
v(h.DTP_STRING, "wanted_yuno_name", T.SDF_RD, "", "wanted yuno name"),
|
|
2009
|
+
v(h.DTP_STRING, "wanted_yuno_service", T.SDF_RD, "", "wanted yuno service"),
|
|
2010
|
+
v(h.DTP_STRING, "remote_yuno_role", T.SDF_RD, "", "confirmed remote yuno role"),
|
|
2011
|
+
v(h.DTP_STRING, "remote_yuno_name", T.SDF_RD, "", "confirmed remote yuno name"),
|
|
2012
|
+
v(h.DTP_STRING, "remote_yuno_service", T.SDF_RD, "", "confirmed remote yuno service"),
|
|
2013
|
+
v(h.DTP_STRING, "url", T.SDF_RD, "", "Url to connect"),
|
|
2014
|
+
v(h.DTP_STRING, "jwt", T.SDF_PERSIST, "", "JWT"),
|
|
2015
|
+
v(h.DTP_STRING, "cert_pem", T.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2016
|
+
v(h.DTP_JSON, "extra_info", T.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2017
|
+
v(h.DTP_LIST, "required_services", T.SDF_RD, "[]", "Services this LINK requires (identity card). Empty = the yuno's `required_services`, as before. A yuno with several links to DIFFERENT backends must set it per link: the yuno-wide list is the union, so every backend is told the service names of all the others."),
|
|
2018
|
+
v(h.DTP_INTEGER, "timeout_retry", T.SDF_RD, "5000", "First reconnect delay (ms). It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
2019
|
+
v(h.DTP_INTEGER, "timeout_retry_max", T.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2020
|
+
v(h.DTP_INTEGER, "timeout_idack", T.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2021
|
+
v(h.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2022
2022
|
j()
|
|
2023
2023
|
], Gr = {
|
|
2024
2024
|
url: null,
|
|
@@ -2094,11 +2094,11 @@
|
|
|
2094
2094
|
}
|
|
2095
2095
|
return 0;
|
|
2096
2096
|
}(e, function(e, t) {
|
|
2097
|
-
return
|
|
2097
|
+
return On(e) ? (qt("iev_create() event NULL"), null) : new xr(e, t);
|
|
2098
2098
|
}(t, n));
|
|
2099
2099
|
}
|
|
2100
2100
|
function Br(e, t, n) {
|
|
2101
|
-
return
|
|
2101
|
+
return On(n) && (n = at(e, "wanted_yuno_service")), {
|
|
2102
2102
|
dst_yuno: at(e, "wanted_yuno_name"),
|
|
2103
2103
|
dst_role: at(e, "wanted_yuno_role"),
|
|
2104
2104
|
dst_service: n,
|
|
@@ -2134,7 +2134,7 @@
|
|
|
2134
2134
|
return er(e, _, Ur, Br(e, Fe(We(e)), null)), nr(e, _, "__identity__"), Dr(t.gobj_timer, _t(e, "timeout_idack")), Yr(e, "EV_IDENTITY_CARD", _);
|
|
2135
2135
|
}
|
|
2136
2136
|
function Hr(e, t) {
|
|
2137
|
-
if (
|
|
2137
|
+
if (On(t.event)) return -1;
|
|
2138
2138
|
let n = {}, r = t.__global__, o = t.__config__, i = t.__filter__, l = t.__service__, s = t.subscriber;
|
|
2139
2139
|
o && (n.__config__ = o), r && (n.__global__ = r), i && (n.__filter__ = i);
|
|
2140
2140
|
return er(e, n, Ur, Br(e, Fe(s), l)), nr(e, n, "__subscribing__"), Yr(e, t.event, n);
|
|
@@ -2245,7 +2245,7 @@
|
|
|
2245
2245
|
if ("__subscribing__" === _) return -1;
|
|
2246
2246
|
if ("__unsubscribing__" === _) return -1;
|
|
2247
2247
|
if (Et(e, l, D.EVF_PUBLIC_EVENT)) return vt(e, l, s, e), 0;
|
|
2248
|
-
if (!
|
|
2248
|
+
if (!On(c)) {
|
|
2249
2249
|
let t = ge(c, !1);
|
|
2250
2250
|
return t ? Et(t, l, D.EVF_PUBLIC_EVENT) ? (vt(t, l, s, e), 0) : (qt(`${Ve(e)}: Service found but no event or not public, service '${Ve(t)}', ev '${l}'`), -1) : (zt(`${Ve(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${l}'`), 0);
|
|
2251
2251
|
}
|
|
@@ -2260,7 +2260,7 @@
|
|
|
2260
2260
|
var ro = {
|
|
2261
2261
|
mt_create: function(e) {
|
|
2262
2262
|
let t = e.priv;
|
|
2263
|
-
t.gobj_timer =
|
|
2263
|
+
t.gobj_timer = Te(Fe(e), "C_TIMER", {}, e), t.url = at(e, "url"), t.remote_yuno_name = at(e, "remote_yuno_name"), t.remote_yuno_role = at(e, "remote_yuno_role"), t.remote_yuno_service = at(e, "remote_yuno_service"), dt(e, "wanted_yuno_name", t.remote_yuno_name), dt(e, "wanted_yuno_role", t.remote_yuno_role), dt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2264
2264
|
const n = ut(e, "subscriber");
|
|
2265
2265
|
n && At(e, null, {}, n);
|
|
2266
2266
|
},
|
|
@@ -2323,13 +2323,13 @@
|
|
|
2323
2323
|
let n = e.priv;
|
|
2324
2324
|
if ("ST_SESSION" !== pt(e) || !n.websocket) return 0;
|
|
2325
2325
|
if (n.inside_on_open) return 0;
|
|
2326
|
-
if (
|
|
2326
|
+
if (On(t.event)) return 0;
|
|
2327
2327
|
let r = {}, o = t.__global__, i = t.__config__, l = t.__filter__, s = t.__service__, _ = t.subscriber;
|
|
2328
2328
|
i && (r.__config__ = i), o && (r.__global__ = o), l && (r.__filter__ = l);
|
|
2329
2329
|
return er(e, r, Ur, Br(e, Fe(_), s)), nr(e, r, "__unsubscribing__"), Yr(e, t.event, r, e);
|
|
2330
2330
|
}
|
|
2331
2331
|
};
|
|
2332
|
-
e.GObj =
|
|
2332
|
+
e.GObj = S, e.SDATA = v, e.SDATAAUTHZ = (e, t, n, r, o, i) => new y(e, t, n, null, i, r, null, 0, null, o, null), e.SDATACM = (e, t, n, r, o, i) => new y(e, t, 0, null, i, n, null, 0, o, r, null), e.SDATACM2 = (e, t, n, r, o, i, l) => new y(e, t, n, null, l, r, null, 0, i, o, null), e.SDATADF = (e, t, n, r, o, i) => new y(e, t, n, null, i, null, r, o), e.SDATAPM = (e, t, n, r, o) => new y(e, t, n, r, o), e.SDATAPM0 = (e, t, n, r, o) => new y(e, t, n, null, o, null, null, 0, null, null, r), e.SDATA_END = j, e.SDataDesc = y, e.YUNETA_VERSION = l, Object.defineProperty(e, "__yuno__", {
|
|
2333
2333
|
enumerable: !0,
|
|
2334
2334
|
get: function() {
|
|
2335
2335
|
return p;
|
|
@@ -2369,20 +2369,20 @@
|
|
|
2369
2369
|
let i = Fn(null, t, e, o);
|
|
2370
2370
|
n[e] = i;
|
|
2371
2371
|
}), n;
|
|
2372
|
-
}, e.current_timestamp = ar, e.data_type_t =
|
|
2372
|
+
}, e.current_timestamp = ar, e.data_type_t = h, e.db_list_persistent_attrs = function(e, t) {
|
|
2373
2373
|
let n = Yn(Er(e), null, !1), r = {};
|
|
2374
2374
|
return n && pn(n) && (r = Kn(e, n, t, !1)), r;
|
|
2375
2375
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2376
|
-
let n = lt(e,
|
|
2376
|
+
let n = lt(e, T.SDF_PERSIST), r = Yn(Er(e), null, !1);
|
|
2377
2377
|
if (r && pn(r)) {
|
|
2378
2378
|
let o = Kn(e, r, t, !1);
|
|
2379
|
-
o = Kn(e, o, n, !1), ct(e, o,
|
|
2379
|
+
o = Kn(e, o, n, !1), ct(e, o, T.SDF_PERSIST);
|
|
2380
2380
|
}
|
|
2381
2381
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2382
2382
|
let n = xn(e, Yn(Er(e), null, !1), t, !1);
|
|
2383
2383
|
0 === gn(n) ? Jn(Er(e)) : Bn(Er(e), n);
|
|
2384
2384
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2385
|
-
let n = Kn(e, lt(e,
|
|
2385
|
+
let n = Kn(e, lt(e, T.SDF_PERSIST), t, !1), r = Yn(Er(e), null, !1);
|
|
2386
2386
|
return r && pn(r) && on(n, r), Bn(Er(e), n);
|
|
2387
2387
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2388
2388
|
let r = null, o = null, i = null;
|
|
@@ -2410,7 +2410,7 @@
|
|
|
2410
2410
|
return t;
|
|
2411
2411
|
}, e.empty_json = function(e) {
|
|
2412
2412
|
return 0 === bn(e);
|
|
2413
|
-
}, e.empty_string =
|
|
2413
|
+
}, e.empty_string = On, e.escapeHtml = sr, e.event_flag_t = D, e.flat2json = function(e) {
|
|
2414
2414
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2415
2415
|
let t = null;
|
|
2416
2416
|
for (const n of Object.keys(e)) {
|
|
@@ -2493,28 +2493,28 @@
|
|
|
2493
2493
|
}, e.get_function_name = fr, e.get_now = function() {
|
|
2494
2494
|
return Math.floor(Date.now() / 1e3);
|
|
2495
2495
|
}, e.gobj_bottom_gobj = Be, e.gobj_change_parent = function(e, t) {
|
|
2496
|
-
return Ye(e) ? (qt("gobj NULL or DESTROYED"), null) : t instanceof
|
|
2496
|
+
return Ye(e) ? (qt("gobj NULL or DESTROYED"), null) : t instanceof S ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (pe(e.parent, e), e.parent = null), be(t, e), t.mt_child_added && (Y(e) && Qt(n("👦👦🔵 child_added(%s): %s", Me(t), Ve(e))), t.mt_child_added(t, e)), 0) : (qt(`${Ve(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2497
2497
|
}, e.gobj_change_state = bt, e.gobj_command = function(e, t, r, i) {
|
|
2498
2498
|
if (Ye(e)) return qt("gobj NULL or DESTROYED"), -1;
|
|
2499
2499
|
let l = p && _t(p, "tracing");
|
|
2500
2500
|
return l && (L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ae(e) ? "" : "!!", Ve(e), t, Ve(i))), l > 1 && Zt(r)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, i) : e.gclass.command_table ? c ? c(e, t, r, i) : o(0, -1, n("%s: global command parser not available", Ve(e)), 0, 0) : o(0, -1, n("%s: command table not available", Ve(e)), 0, 0);
|
|
2501
2501
|
}, e.gobj_create = function(e, t, n, r) {
|
|
2502
|
-
return
|
|
2503
|
-
}, e.gobj_create2 =
|
|
2504
|
-
return
|
|
2505
|
-
}, e.gobj_create_pure_child =
|
|
2506
|
-
return
|
|
2502
|
+
return he(e, t, n, r, 0);
|
|
2503
|
+
}, e.gobj_create2 = he, e.gobj_create_default_service = function(e, t, n, r) {
|
|
2504
|
+
return he(e, t, n, r, w.gobj_flag_default_service | w.gobj_flag_autostart);
|
|
2505
|
+
}, e.gobj_create_pure_child = Te, e.gobj_create_service = function(e, t, n, r) {
|
|
2506
|
+
return he(e, t, n, r, w.gobj_flag_service);
|
|
2507
2507
|
}, e.gobj_create_volatil = function(e, t, n, r) {
|
|
2508
|
-
return
|
|
2508
|
+
return he(e, t, n, r, w.gobj_flag_volatil);
|
|
2509
2509
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2510
|
-
return
|
|
2510
|
+
return he(e, t, n, null, w.gobj_flag_yuno);
|
|
2511
2511
|
}, e.gobj_current_state = pt, e.gobj_default_service = fe, e.gobj_deliver_posted_events = jt, e.gobj_destroy = ye, e.gobj_find_child = nt, e.gobj_find_gobj = function(e, t) {
|
|
2512
|
-
if (
|
|
2512
|
+
if (On(t)) return null;
|
|
2513
2513
|
const n = t.toLowerCase();
|
|
2514
2514
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : rt(p, t);
|
|
2515
2515
|
}, e.gobj_find_service = ge, e.gobj_find_subscribings = $t, e.gobj_find_subscriptions = It, e.gobj_flag_t = w, e.gobj_full_name = Me, e.gobj_gclass_name = Ge, e.gobj_global_trace_level = function() {
|
|
2516
2516
|
return F;
|
|
2517
|
-
}, e.gobj_has_attr = ot, e.gobj_has_event = Et, e.gobj_has_output_event =
|
|
2517
|
+
}, e.gobj_has_attr = ot, e.gobj_has_event = Et, e.gobj_has_output_event = ht, e.gobj_hsdata = X, e.gobj_is_destroying = Ye, e.gobj_is_playing = $e, e.gobj_is_pure_child = xe, e.gobj_is_running = Ae, e.gobj_is_service = Ie, e.gobj_is_volatil = Ke, e.gobj_list_persistent_attrs = function(e, t) {
|
|
2518
2518
|
return u ? u(e, t) : null;
|
|
2519
2519
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2520
2520
|
let t = It(e, null, null, null);
|
|
@@ -2556,14 +2556,14 @@
|
|
|
2556
2556
|
}
|
|
2557
2557
|
}(n, e), n;
|
|
2558
2558
|
}, e.gobj_match_gobj = tt, e.gobj_name = Fe, e.gobj_parent = We, e.gobj_pause = De, e.gobj_play = Re, e.gobj_post_event = function(e, t, r, o) {
|
|
2559
|
-
return e && e instanceof
|
|
2559
|
+
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (qt(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : On(t) ? (qt("gobj_post_event(): event EMPTY"), -1) : Et(e, t, 0) ? Tt.length >= 1e4 ? (qt(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Tt.length}`), -1) : (Tt.push({
|
|
2560
2560
|
dst: e,
|
|
2561
2561
|
event: t,
|
|
2562
2562
|
kw: r,
|
|
2563
2563
|
src: o
|
|
2564
|
-
}), J(e, t) && !H(o, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Ve(e), t,
|
|
2564
|
+
}), J(e, t) && !H(o, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Ve(e), t, Tt.length)), yt || (yt = !0, setTimeout(jt, 0)), 0) : (qt(`gobj_post_event(): event NOT DEFINED in gclass ${Ge(e)}, event ${t}`), -1) : (qt(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
2565
2565
|
}, e.gobj_posted_events_size = function() {
|
|
2566
|
-
return
|
|
2566
|
+
return Tt.length;
|
|
2567
2567
|
}, e.gobj_publish_event = Ct, e.gobj_read_attr = it, e.gobj_read_attrs = lt, e.gobj_read_bool_attr = st, e.gobj_read_integer_attr = _t, e.gobj_read_pointer_attr = ut, e.gobj_read_str_attr = at, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
2568
2568
|
return Ie(e) ? a ? a(e, t) : -1 : (qt(`${Ve(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2569
2569
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
@@ -2585,7 +2585,7 @@
|
|
|
2585
2585
|
}
|
|
2586
2586
|
}
|
|
2587
2587
|
return 0;
|
|
2588
|
-
}(e,
|
|
2588
|
+
}(e, T.SDF_VOLATIL, 0);
|
|
2589
2589
|
}, e.gobj_save_persistent_attrs = function(e, t) {
|
|
2590
2590
|
return Ie(e) ? _ ? _(e, t) : -1 : (qt(`${Ve(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2591
2591
|
}, e.gobj_search_path = rt, e.gobj_send_event = vt, e.gobj_services = function() {
|
|
@@ -2623,7 +2623,7 @@
|
|
|
2623
2623
|
}, e.gobj_short_name = Ve, e.gobj_start = je, e.gobj_start_children = function(e) {
|
|
2624
2624
|
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : qe(e, A.WALK_FIRST2LAST, ve, 0, 0);
|
|
2625
2625
|
}, e.gobj_start_tree = function(e) {
|
|
2626
|
-
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", Me(e))), e.gclass.gclass_flag & N.gcflag_manual_start || e.disabled ? 0 : (e.running || je(e), ze(e, A.WALK_TOP2BOTTOM,
|
|
2626
|
+
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", Me(e))), e.gclass.gclass_flag & N.gcflag_manual_start || e.disabled ? 0 : (e.running || je(e), ze(e, A.WALK_TOP2BOTTOM, Oe, 0, 0)));
|
|
2627
2627
|
}, e.gobj_start_up = function(e, t, n, r, o, i, l) {
|
|
2628
2628
|
s = t, _ = n, a = r, u = o, c = i, f = l;
|
|
2629
2629
|
const d = [["EV_STATE_CHANGED", D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -2634,8 +2634,8 @@
|
|
|
2634
2634
|
return 0;
|
|
2635
2635
|
}, e.gobj_stats = function(e, t, r, o) {
|
|
2636
2636
|
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, o) : f ? f(e, t, r, o) : i(0, -1, n("%s, stats parser not available", Ve(e)), 0, 0);
|
|
2637
|
-
}, e.gobj_stop =
|
|
2638
|
-
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Me(e))), Ae(e) &&
|
|
2637
|
+
}, e.gobj_stop = Se, e.gobj_stop_children = we, e.gobj_stop_tree = function(e) {
|
|
2638
|
+
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Me(e))), Ae(e) && Se(e), ze(e, A.WALK_TOP2BOTTOM, Ne, 0, 0));
|
|
2639
2639
|
}, e.gobj_subscribe_event = At, e.gobj_trace_level = W, e.gobj_trace_machine_format = function() {
|
|
2640
2640
|
return C;
|
|
2641
2641
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
@@ -2650,8 +2650,8 @@
|
|
|
2650
2650
|
]);
|
|
2651
2651
|
if (Object.keys(n).forEach((n) => {
|
|
2652
2652
|
o.has(n) || qt(`${Ve(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2653
|
-
}),
|
|
2654
|
-
else if (!(
|
|
2653
|
+
}), On(t)) t = "";
|
|
2654
|
+
else if (!(ht(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Ve(e)}, ev ${t}`), 0;
|
|
2655
2655
|
let i = wt(e.dl_subscriptions, e, t, n, r), l = 0;
|
|
2656
2656
|
for (let t = 0; t < i.length; t++) {
|
|
2657
2657
|
let n = i[t];
|
|
@@ -2678,29 +2678,29 @@
|
|
|
2678
2678
|
break;
|
|
2679
2679
|
}
|
|
2680
2680
|
return qt(n("gobj_write_attr(%s): attr not found '%s'", Ve(e), i)), -1;
|
|
2681
|
-
}, e.gobj_write_attrs = ct, e.gobj_write_bool_attr = ft, e.gobj_write_integer_attr = gt, e.gobj_write_str_attr = dt, e.gobj_yuno = Ce, e.gobj_yuno_id = Ue, e.gobj_yuno_name = Le, e.gobj_yuno_role = Pe, e.id_index_in_obj_list = zn, e.index_in_list = ur, e.is_array = mn, e.is_boolean =
|
|
2681
|
+
}, e.gobj_write_attrs = ct, e.gobj_write_bool_attr = ft, e.gobj_write_integer_attr = gt, e.gobj_write_str_attr = dt, e.gobj_yuno = Ce, e.gobj_yuno_id = Ue, e.gobj_yuno_name = Le, e.gobj_yuno_role = Pe, e.id_index_in_obj_list = zn, e.index_in_list = ur, e.is_array = mn, e.is_boolean = Tn, e.is_date = function(e) {
|
|
2682
2682
|
return e instanceof Date && !isNaN(e);
|
|
2683
2683
|
}, e.is_function = jn, e.is_gobj = vn, e.is_metadata_key = function(e) {
|
|
2684
2684
|
if (!En(e)) return !1;
|
|
2685
2685
|
let t;
|
|
2686
2686
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2687
2687
|
return 2 === t;
|
|
2688
|
-
}, e.is_null = yn, e.is_number =
|
|
2688
|
+
}, e.is_null = yn, e.is_number = hn, e.is_object = pn, e.is_private_key = function(e) {
|
|
2689
2689
|
if (!En(e)) return !1;
|
|
2690
2690
|
let t;
|
|
2691
2691
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2692
2692
|
return 1 === t;
|
|
2693
2693
|
}, e.is_pure_number = function(e) {
|
|
2694
|
-
if (
|
|
2694
|
+
if (hn(e)) return !0;
|
|
2695
2695
|
if (!En(e)) return !1;
|
|
2696
2696
|
const t = Number(e);
|
|
2697
2697
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2698
2698
|
}, e.is_string = En, e.jdb_delete = function(e, t, n, r) {
|
|
2699
2699
|
let o = Fn(null, Fn(null, e, "topics", null, 0), t, null, 0);
|
|
2700
2700
|
if (!o) return qt("jdb_delete: topic not found: " + t), null;
|
|
2701
|
-
if (
|
|
2701
|
+
if (On(r.id)) return qt("jdb_delete: record without id: " + r), Xt(r), null;
|
|
2702
2702
|
let i, l = n.split("`"), s = o;
|
|
2703
|
-
for (; (i = l.shift()) && !
|
|
2703
|
+
for (; (i = l.shift()) && !On(i) && s;) pn(s) && (s = Fn(null, s, e.hook, null, 0)), s = ir(s, null, i, !1);
|
|
2704
2704
|
if (0 === l.length && s) if (mn(s)) {
|
|
2705
2705
|
let e = zn(s, r.id);
|
|
2706
2706
|
e >= 0 && s.splice(e, 1);
|
|
@@ -2730,9 +2730,9 @@
|
|
|
2730
2730
|
}, e.jdb_update = function(e, t, n, r) {
|
|
2731
2731
|
let o = Fn(null, Fn(null, e, "topics", null, 0), t, null, 0);
|
|
2732
2732
|
if (!o) return qt("jdb_update: topic not found: " + t), null;
|
|
2733
|
-
if (
|
|
2733
|
+
if (On(r.id)) return qt("jdb_update: record without id: " + r), Xt(r), null;
|
|
2734
2734
|
let i, l = n.split("`"), s = o;
|
|
2735
|
-
for (; (i = l.shift()) && !
|
|
2735
|
+
for (; (i = l.shift()) && !On(i) && s;) pn(s) && (s = Fn(null, s, e.hook, [], 1)), s = ir(s, null, i, !1);
|
|
2736
2736
|
if (0 === l.length && s) if (mn(s)) s.push(r);
|
|
2737
2737
|
else if (s.id === r.id) Object.assign(s, r);
|
|
2738
2738
|
else {
|
|
@@ -2814,7 +2814,7 @@
|
|
|
2814
2814
|
}
|
|
2815
2815
|
return l && (qt(`path not found: '${n}'`), Zt(t)), Number(r);
|
|
2816
2816
|
}
|
|
2817
|
-
return _ && In(e, t, n),
|
|
2817
|
+
return _ && In(e, t, n), hn(i) ? Number(i) : (l && (qt(`path value MUST BE a number: ${n}`), Xt(t)), Number(r));
|
|
2818
2818
|
}, e.kw_get_str = Ln, e.kw_has_key = An, e.kw_match_simple = Wn, e.kw_pop = Dn, e.kw_remove_local_storage_value = Jn, e.kw_select = function(e, t, n, r) {
|
|
2819
2819
|
if (e && !vn(e) && qt("GObj bad instanceof"), !t) return null;
|
|
2820
2820
|
r || (r = Wn);
|
|
@@ -2831,14 +2831,14 @@
|
|
|
2831
2831
|
}, e.kw_set_dict_value = Gn, e.kw_set_local_storage_value = Bn, e.kw_set_subdict_value = Vn, e.kwid_collect = qn, e.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2832
2832
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
2833
2833
|
let i = qn(e, t, n, r, o);
|
|
2834
|
-
return i
|
|
2834
|
+
return i && 0 !== i.length ? i[0] : null;
|
|
2835
2835
|
}, e.kwid_get_ids = function(e, t) {
|
|
2836
2836
|
if (e && !vn(e) && qt("GObj bad instanceof"), !t) return [];
|
|
2837
2837
|
let n = [];
|
|
2838
2838
|
if (En(t)) n.push(t);
|
|
2839
2839
|
else if (pn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2840
2840
|
else mn(t) && t.forEach(function(t) {
|
|
2841
|
-
if (En(t))
|
|
2841
|
+
if (En(t)) On(t) || n.push(t);
|
|
2842
2842
|
else if (pn(t)) {
|
|
2843
2843
|
let r = Ln(e, t, "id", 0, 0);
|
|
2844
2844
|
r && n.push(r);
|
|
@@ -2848,13 +2848,24 @@
|
|
|
2848
2848
|
}, e.kwid_match_id = Hn, e.kwid_new_dict = function(e, t, n) {
|
|
2849
2849
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
2850
2850
|
let r = {};
|
|
2851
|
-
if (
|
|
2851
|
+
if (On(n) || (t = kn(e, t, n)), pn(t)) r = t;
|
|
2852
2852
|
else if (mn(t)) for (let n = 0; n < t.length; n++) {
|
|
2853
|
-
let o = t[n], i = Ln(e, o, "id", "",
|
|
2854
|
-
|
|
2853
|
+
let o = t[n], i = Ln(e, o, "id", "", Lt.KW_REQUIRED);
|
|
2854
|
+
On(i) || (r[i] = o);
|
|
2855
2855
|
}
|
|
2856
2856
|
else qt(`${Ve(e)} kwid_new_dict: data type unknown`);
|
|
2857
2857
|
return r;
|
|
2858
|
+
}, e.kwid_new_list = function(e, t, n) {
|
|
2859
|
+
if (e && !vn(e) && qt("GObj bad instanceof"), On(n) || (t = kn(e, t, n)), mn(t)) return t;
|
|
2860
|
+
if (pn(t)) {
|
|
2861
|
+
let n = [];
|
|
2862
|
+
for (let r of Object.keys(t)) {
|
|
2863
|
+
let o = t[r];
|
|
2864
|
+
pn(o) ? (o.id = r, n.push(o)) : qt(`${Ve(e)} kwid_new_list: not a record: '${r}'`);
|
|
2865
|
+
}
|
|
2866
|
+
return n;
|
|
2867
|
+
}
|
|
2868
|
+
return qt(`${Ve(e)} kwid_new_list: wrong type for list`), [];
|
|
2858
2869
|
}, e.list2options = function(e, t, n) {
|
|
2859
2870
|
t = t || "id", n = n || "value";
|
|
2860
2871
|
let r = [];
|
|
@@ -2905,7 +2916,7 @@
|
|
|
2905
2916
|
}, e.log_debug = Qt, e.log_error = qt, e.log_info = function(e) {
|
|
2906
2917
|
let t = Ht(e), n = ar();
|
|
2907
2918
|
Gt && xt("info", t) && Gt("%c" + n + " INFO: " + String(t), "color:cyan"), Bt("info", t, n);
|
|
2908
|
-
}, e.log_warning = zt, e.msg_iev_get_msg_type = rr, e.msg_iev_get_stack = tr, e.msg_iev_push_stack = er, e.msg_iev_read_key = Xn, e.msg_iev_set_msg_type = nr, e.msg_iev_write_key = Zn, e.node_uuid = cr, e.parseBoolean =
|
|
2919
|
+
}, e.log_warning = zt, e.msg_iev_get_msg_type = rr, e.msg_iev_get_stack = tr, e.msg_iev_push_stack = er, e.msg_iev_read_key = Xn, e.msg_iev_set_msg_type = nr, e.msg_iev_write_key = Zn, e.node_uuid = cr, e.parseBoolean = Sn, e.parseSVG = function(e) {
|
|
2909
2920
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2910
2921
|
}, e.refresh_language = function(e, t) {
|
|
2911
2922
|
if (!jn(t)) return void qt("You must supply a translation function");
|
|
@@ -3037,7 +3048,7 @@
|
|
|
3037
3048
|
["EV_TIMEOUT", D.EVF_OUTPUT_EVENT],
|
|
3038
3049
|
["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT],
|
|
3039
3050
|
[0, 0]
|
|
3040
|
-
], t, Rr, 0,
|
|
3051
|
+
], t, Rr, 0, Or, Sr, 0, 0, 0, N.gcflag_manual_start)) ? 0 : -1;
|
|
3041
3052
|
}("C_TIMER");
|
|
3042
3053
|
}, e.register_c_yuno = function() {
|
|
3043
3054
|
return function(e) {
|
|
@@ -3053,7 +3064,7 @@
|
|
|
3053
3064
|
if (!e) return "";
|
|
3054
3065
|
const t = String(e).trim();
|
|
3055
3066
|
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : sr(t);
|
|
3056
|
-
}, e.sdata_flag_t =
|
|
3067
|
+
}, e.sdata_flag_t = T, e.send_http_json_post = function(e, t, n) {
|
|
3057
3068
|
let r = new XMLHttpRequest();
|
|
3058
3069
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
3059
3070
|
4 === r.readyState && n(r.status, r.responseText);
|
|
@@ -3093,7 +3104,7 @@
|
|
|
3093
3104
|
let e = t.split(".");
|
|
3094
3105
|
for (let t = 0; t < e.length; t++) {
|
|
3095
3106
|
let r = e[t];
|
|
3096
|
-
if (Qn(
|
|
3107
|
+
if (Qn(Tr, r)) n.real_type || (n.real_type = r);
|
|
3097
3108
|
else if (Qn(jr, r)) n.type || (n.type = r);
|
|
3098
3109
|
else if (Qn(yr, r)) switch (r) {
|
|
3099
3110
|
case "writable":
|
|
@@ -3119,7 +3130,7 @@
|
|
|
3119
3130
|
total: _
|
|
3120
3131
|
};
|
|
3121
3132
|
} };
|
|
3122
|
-
}, e.trace_json = Zt, e.trace_level_t = P, e.trace_msg = Xt, e.treedb_decoder_fkey =
|
|
3133
|
+
}, e.trace_json = Zt, e.trace_level_t = P, e.trace_msg = Xt, e.treedb_decoder_fkey = hr, e.treedb_decoder_hook = function(e, t) {
|
|
3123
3134
|
if (En(t)) {
|
|
3124
3135
|
if (-1 === t.indexOf("^")) {
|
|
3125
3136
|
let n, r = e.hook;
|
|
@@ -3146,7 +3157,7 @@
|
|
|
3146
3157
|
id: t.id
|
|
3147
3158
|
} : (qt("bad hook 3"), qt(e), qt(t), null);
|
|
3148
3159
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3149
|
-
let n =
|
|
3160
|
+
let n = hr(e, t);
|
|
3150
3161
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3151
3162
|
}, e.treedb_get_field_desc = vr, e.treedb_hook_data_size = function(e) {
|
|
3152
3163
|
if (mn(e) && 1 === bn(e)) {
|