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