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