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