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