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