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