@xpell/core 2.0.1 → 2.0.3

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.
@@ -1,9 +1,9 @@
1
- var T = (o) => {
1
+ var B = (o) => {
2
2
  throw TypeError(o);
3
3
  };
4
- var q = (o, e, t) => e.has(o) || T("Cannot " + t);
5
- var p = (o, e, t) => (q(o, e, "read from private field"), t ? t.call(o) : e.get(o)), B = (o, e, t) => e.has(o) ? T("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), W = (o, e, t, s) => (q(o, e, "write to private field"), s ? s.call(o, t) : e.set(o, t), t);
6
- class Q {
4
+ var z = (o, e, t) => e.has(o) || B("Cannot " + t);
5
+ var f = (o, e, t) => (z(o, e, "read from private field"), t ? t.call(o) : e.get(o)), J = (o, e, t) => e.has(o) ? B("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), V = (o, e, t, s) => (z(o, e, "write to private field"), s ? s.call(o, t) : e.set(o, t), t);
6
+ class Y {
7
7
  /**
8
8
  * Create ignore list for parser to ignore spell words
9
9
  * @param list - comma-separated list of words
@@ -11,8 +11,8 @@ class Q {
11
11
  */
12
12
  createIgnoreList(e, t) {
13
13
  if (!e) return t;
14
- const s = e.split(",").map((n) => n.trim()).filter(Boolean);
15
- for (const n of s) t[n] = "";
14
+ const s = e.split(",").map((r) => r.trim()).filter(Boolean);
15
+ for (const r of s) t[r] = "";
16
16
  return t;
17
17
  }
18
18
  /**
@@ -30,15 +30,15 @@ class Q {
30
30
  if (t && typeof t.getRandomValues == "function") {
31
31
  const i = new Uint8Array(16);
32
32
  t.getRandomValues(i), i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128;
33
- const a = Array.from(i, (_) => _.toString(16).padStart(2, "0"));
34
- return a.slice(0, 4).join("") + "-" + a.slice(4, 6).join("") + "-" + a.slice(6, 8).join("") + "-" + a.slice(8, 10).join("") + "-" + a.slice(10, 16).join("");
33
+ const c = Array.from(i, (a) => a.toString(16).padStart(2, "0"));
34
+ return c.slice(0, 4).join("") + "-" + c.slice(4, 6).join("") + "-" + c.slice(6, 8).join("") + "-" + c.slice(8, 10).join("") + "-" + c.slice(10, 16).join("");
35
35
  }
36
- const s = "0123456789abcdef".split(""), n = [];
37
- let r;
38
- n[8] = n[13] = n[18] = n[23] = "-", n[14] = "4";
36
+ const s = "0123456789abcdef".split(""), r = [];
37
+ let n;
38
+ r[8] = r[13] = r[18] = r[23] = "-", r[14] = "4";
39
39
  for (let i = 0; i < 36; i++)
40
- n[i] || (r = (0 | Math.random() * 16) >>> 0, n[i] = s[i === 19 ? r & 3 | 8 : r & 15]);
41
- return n.join("");
40
+ r[i] || (n = (0 | Math.random() * 16) >>> 0, r[i] = s[i === 19 ? n & 3 | 8 : n & 15]);
41
+ return r.join("");
42
42
  }
43
43
  /**
44
44
  * Merge defaults into data object (mutates data)
@@ -49,10 +49,20 @@ class Q {
49
49
  mergeDefaultsWithData(e, t, s = !1) {
50
50
  if (!e) return t;
51
51
  e._id || (e._id = e.id ?? this.guid());
52
- for (const n of Object.keys(t))
53
- (!(n in e) || s) && (e[n] = t[n]);
52
+ for (const r of Object.keys(t))
53
+ (!(r in e) || s) && (e[r] = t[r]);
54
54
  return e;
55
55
  }
56
+ deepMergeDefaults(e, t) {
57
+ if (!e || typeof e != "object" || Array.isArray(e))
58
+ return structuredClone(t);
59
+ const s = structuredClone(t);
60
+ for (const r of Object.keys(e)) {
61
+ const n = e[r], i = t?.[r];
62
+ n && typeof n == "object" && !Array.isArray(n) && i && typeof i == "object" && !Array.isArray(i) ? s[r] = this.deepMergeDefaults(n, i) : s[r] = n;
63
+ }
64
+ return s;
65
+ }
56
66
  /**
57
67
  * Encode string to Base64 (UTF-8 safe, cross-platform)
58
68
  */
@@ -61,7 +71,7 @@ class Q {
61
71
  if (typeof t.btoa == "function") {
62
72
  const s = encodeURIComponent(String(e)).replace(
63
73
  /%([0-9A-F]{2})/g,
64
- (n, r) => String.fromCharCode(parseInt(r, 16))
74
+ (r, n) => String.fromCharCode(parseInt(n, 16))
65
75
  );
66
76
  return t.btoa(s);
67
77
  }
@@ -75,8 +85,8 @@ class Q {
75
85
  decode(e) {
76
86
  const t = globalThis;
77
87
  if (typeof t.atob == "function") {
78
- const s = t.atob(String(e)), n = Array.prototype.map.call(s, (r) => "%" + r.charCodeAt(0).toString(16).padStart(2, "0")).join("");
79
- return decodeURIComponent(n);
88
+ const s = t.atob(String(e)), r = Array.prototype.map.call(s, (n) => "%" + n.charCodeAt(0).toString(16).padStart(2, "0")).join("");
89
+ return decodeURIComponent(r);
80
90
  }
81
91
  if (t.Buffer && typeof t.Buffer.from == "function")
82
92
  return t.Buffer.from(String(e), "base64").toString("utf8");
@@ -103,12 +113,12 @@ class Q {
103
113
  createDefaultScheduler(e) {
104
114
  const t = globalThis;
105
115
  if (typeof t.requestAnimationFrame == "function")
106
- return (r) => t.requestAnimationFrame(r);
116
+ return (n) => t.requestAnimationFrame(n);
107
117
  const s = typeof e == "number" && isFinite(e) && e > 0 ? e : 60;
108
118
  if (typeof t.setImmediate == "function" && (!e || e >= 60))
109
- return (r) => t.setImmediate(r);
110
- const n = Math.max(1, Math.round(1e3 / s));
111
- return (r) => t.setTimeout(r, n);
119
+ return (n) => t.setImmediate(n);
120
+ const r = Math.max(1, Math.round(1e3 / s));
121
+ return (n) => t.setTimeout(n, r);
112
122
  }
113
123
  to_iso_now() {
114
124
  return (/* @__PURE__ */ new Date()).toISOString();
@@ -116,11 +126,28 @@ class Q {
116
126
  is_plain_object(e) {
117
127
  return typeof e == "object" && e !== null && !Array.isArray(e);
118
128
  }
129
+ ensure_object(e, t) {
130
+ if (!this.is_plain_object(e))
131
+ throw new Error(`Invalid '${t}'`);
132
+ return e;
133
+ }
119
134
  ensure_string(e, t) {
120
135
  if (typeof e != "string" || !e.trim())
121
136
  throw new Error(`Invalid '${t}'`);
122
137
  return e.trim();
123
138
  }
139
+ ensure_boolean(e, t) {
140
+ if (typeof e == "boolean") return e;
141
+ if (e === "true") return !0;
142
+ if (e === "false") return !1;
143
+ throw new Error(`Invalid '${t}'`);
144
+ }
145
+ ensure_number(e, t) {
146
+ const s = Number(e);
147
+ if (isNaN(s))
148
+ throw new Error(`Invalid '${t}'`);
149
+ return s;
150
+ }
124
151
  ensure_params(e) {
125
152
  return this.is_plain_object(e) ? e : {};
126
153
  }
@@ -130,9 +157,9 @@ class Q {
130
157
  */
131
158
  addIfNotNull(e, t, s) {
132
159
  if (!(!e || !t || !Array.isArray(s)))
133
- for (const n of s) {
134
- const r = e[n];
135
- r != null && (t[n] = r);
160
+ for (const r of s) {
161
+ const n = e[r];
162
+ n != null && (t[r] = n);
136
163
  }
137
164
  }
138
165
  /**
@@ -175,38 +202,269 @@ class Q {
175
202
  calculateExpiration(e) {
176
203
  const s = String(e ?? "").trim().match(/^(\d+)([hdy])$/);
177
204
  if (!s) throw new Error("Invalid expiration format. Use: 1h | 2d | 3y");
178
- const n = Number.parseInt(s[1], 10), r = s[2], i = Date.now();
179
- let a = 0;
180
- switch (r) {
205
+ const r = Number.parseInt(s[1], 10), n = s[2], i = Date.now();
206
+ let c = 0;
207
+ switch (n) {
181
208
  case "h":
182
- a = n * 60 * 60 * 1e3;
209
+ c = r * 60 * 60 * 1e3;
183
210
  break;
184
211
  case "d":
185
- a = n * 24 * 60 * 60 * 1e3;
212
+ c = r * 24 * 60 * 60 * 1e3;
186
213
  break;
187
214
  case "y":
188
- a = n * 365 * 24 * 60 * 60 * 1e3;
215
+ c = r * 365 * 24 * 60 * 60 * 1e3;
189
216
  break;
190
217
  }
191
- return i + a;
218
+ return i + c;
219
+ }
220
+ // ============================================================================
221
+ // AI / Runtime Primitive Helpers
222
+ // ============================================================================
223
+ normalize_prompt(e) {
224
+ return String(e ?? "").normalize("NFKC").replace(/\s+/g, " ").trim();
225
+ }
226
+ normalize_prompt_key(e) {
227
+ return this.normalize_prompt(e).toLowerCase().replace(/[_/]+/g, " ");
228
+ }
229
+ is_non_empty_string(e) {
230
+ return typeof e == "string" && e.trim().length > 0;
231
+ }
232
+ has_value(e) {
233
+ return e == null ? !1 : Array.isArray(e) ? e.length > 0 : typeof e == "object" ? Object.keys(e).length > 0 : !0;
234
+ }
235
+ ensure_array(e) {
236
+ return Array.isArray(e) ? e : e == null ? [] : [e];
237
+ }
238
+ to_record(e) {
239
+ return this.is_plain_object(e) ? e : {};
240
+ }
241
+ safe_json_parse(e, t) {
242
+ if (typeof e != "string") return t;
243
+ try {
244
+ return JSON.parse(e);
245
+ } catch {
246
+ return t;
247
+ }
248
+ }
249
+ safe_json_stringify(e, t = "{}") {
250
+ try {
251
+ return JSON.stringify(e);
252
+ } catch {
253
+ return t;
254
+ }
255
+ }
256
+ clone_json(e) {
257
+ return this.safe_json_parse(
258
+ this.safe_json_stringify(e, "null"),
259
+ e
260
+ );
261
+ }
262
+ get_path(e, t, s) {
263
+ const r = Array.isArray(t) ? t : String(t ?? "").split(".").filter(Boolean);
264
+ let n = e;
265
+ for (const i of r) {
266
+ if (n == null) return s;
267
+ n = n[i];
268
+ }
269
+ return n === void 0 ? s : n;
270
+ }
271
+ set_path(e, t, s) {
272
+ const r = Array.isArray(t) ? t : String(t ?? "").split(".").filter(Boolean);
273
+ if (!r.length) return e;
274
+ let n = e;
275
+ for (let i = 0; i < r.length - 1; i++) {
276
+ const c = r[i];
277
+ this.is_plain_object(n[c]) || (n[c] = {}), n = n[c];
278
+ }
279
+ return n[r[r.length - 1]] = s, e;
280
+ }
281
+ pick_defined(e, t) {
282
+ const s = {};
283
+ if (!this.is_plain_object(e) || !Array.isArray(t)) return s;
284
+ for (const r of t) {
285
+ const n = e[r];
286
+ n != null && (s[r] = n);
287
+ }
288
+ return s;
289
+ }
290
+ omit_undefined(e) {
291
+ const t = {};
292
+ if (!this.is_plain_object(e)) return t;
293
+ for (const [s, r] of Object.entries(e))
294
+ r !== void 0 && (t[s] = r);
295
+ return t;
296
+ }
297
+ escape_regexp(e) {
298
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
299
+ }
300
+ matches_keyword(e, t) {
301
+ const s = /^[a-z0-9]+$/.test(t) ? "s?" : "";
302
+ return new RegExp(
303
+ `(^|[^a-z0-9])${this.escape_regexp(t)}${s}($|[^a-z0-9])`
304
+ ).test(e);
305
+ }
306
+ match_keywords(e, t) {
307
+ return t.filter((s) => this.matches_keyword(e, s));
308
+ }
309
+ contains_keyword(e, t) {
310
+ return this.match_keywords(e, t).length > 0;
311
+ }
312
+ read_optional_string(e, t) {
313
+ if (e != null) {
314
+ if (typeof e != "string" || e.trim().length === 0)
315
+ throw new Error(`Invalid '${t}': expected non-empty string`);
316
+ return e.trim();
317
+ }
318
+ }
319
+ read_optional_boolean(e, t) {
320
+ if (e != null) {
321
+ if (typeof e != "boolean")
322
+ throw new Error(`Invalid '${t}': expected boolean`);
323
+ return e;
324
+ }
325
+ }
326
+ read_optional_number(e, t) {
327
+ if (e != null) {
328
+ if (typeof e != "number" || !isFinite(e))
329
+ throw new Error(`Invalid '${t}': expected finite number`);
330
+ return e;
331
+ }
332
+ }
333
+ read_optional_object(e, t) {
334
+ if (e != null) {
335
+ if (!this.is_plain_object(e))
336
+ throw new Error(`Invalid '${t}': expected plain object`);
337
+ return e;
338
+ }
339
+ }
340
+ /**
341
+ * Returns unique string values while preserving insertion order.
342
+ *
343
+ * Example:
344
+ * ["a", "b", "a"] -> ["a", "b"]
345
+ */
346
+ unique_strings(e) {
347
+ return Array.from(new Set(e));
348
+ }
349
+ /**
350
+ * Normalizes IDs (trim + lowercase) and removes duplicates.
351
+ *
352
+ * Example:
353
+ * [" User ", "user", "ADMIN"] -> ["user", "admin"]
354
+ */
355
+ unique_normalized_ids(e) {
356
+ return Array.from(
357
+ new Set(
358
+ e.map((t) => t.trim().toLowerCase()).filter((t) => t.length > 0)
359
+ )
360
+ );
361
+ }
362
+ /**
363
+ * Truncates long text while preserving the beginning.
364
+ * Appends a truncation marker when the text exceeds max_chars.
365
+ */
366
+ truncate_text(e, t) {
367
+ return e.length <= t ? e : `${e.slice(0, Math.max(0, t - 18))}
368
+ ...[truncated]`;
369
+ }
370
+ /**
371
+ * Serializes a value as formatted JSON and truncates the result
372
+ * when it exceeds the specified character limit.
373
+ */
374
+ compact_json(e, t = 5e3) {
375
+ return this.truncate_text(
376
+ JSON.stringify(e, null, 2),
377
+ t
378
+ );
379
+ }
380
+ /**
381
+ * Serializes a value as compact single-line JSON and truncates
382
+ * the result when it exceeds the specified character limit.
383
+ */
384
+ compact_inline_json(e, t = 5e3) {
385
+ return this.truncate_text(
386
+ JSON.stringify(e),
387
+ t
388
+ );
389
+ }
390
+ /**
391
+ * Safe version of compact_inline_json().
392
+ * Returns an empty string when serialization fails.
393
+ */
394
+ safe_compact_inline_json(e, t = 5e3) {
395
+ try {
396
+ return this.compact_inline_json(e, t);
397
+ } catch {
398
+ return "";
399
+ }
400
+ }
401
+ /**
402
+ * Returns the first max_items items from an array.
403
+ * Returns an empty array for non-array values.
404
+ */
405
+ compact_array(e, t = 20) {
406
+ return Array.isArray(e) ? e.slice(0, t) : [];
407
+ }
408
+ /**
409
+ * Normalizes arbitrary text into a stable identifier.
410
+ *
411
+ * Example:
412
+ * "User Profile" -> "user-profile"
413
+ * "user_profile" -> "user-profile"
414
+ */
415
+ normalize_id(e) {
416
+ if (typeof e != "string") return;
417
+ const t = e.toLowerCase().trim().replace(/[_\s]+/gu, "-").replace(/[^a-z0-9-]+/gu, "-").replace(/-+/gu, "-").replace(/^-|-$/gu, "");
418
+ return t.length > 0 ? t : void 0;
419
+ }
420
+ /**
421
+ * Normalizes an array of identifiers and removes duplicates.
422
+ *
423
+ * Example:
424
+ * ["User Profile", "user-profile"]
425
+ * -> ["user-profile"]
426
+ */
427
+ normalize_id_array(e) {
428
+ return Array.isArray(e) ? e.map((t) => this.normalize_id(t)).filter((t) => typeof t == "string").filter((t, s, r) => r.indexOf(t) === s) : [];
429
+ }
430
+ /**
431
+ * @deprecated Use normalize_id_array().
432
+ */
433
+ normalize_string_array(e) {
434
+ return this.normalize_id_array(e);
435
+ }
436
+ /**
437
+ * Returns only plain object items from an array.
438
+ * Non-object values, nulls, and arrays are ignored.
439
+ */
440
+ ensure_object_array(e) {
441
+ return Array.isArray(e) ? e.filter(
442
+ (t) => this.is_plain_object(t)
443
+ ) : [];
444
+ }
445
+ /**
446
+ * @deprecated Use ensure_object_array().
447
+ */
448
+ read_object_array(e) {
449
+ return this.ensure_object_array(e);
192
450
  }
193
451
  }
194
- const z = new Q(), l = z;
195
- class Y {
452
+ const Z = new Y(), u = Z;
453
+ class ee {
196
454
  #e = 0;
197
455
  // displayed fps (stable)
198
456
  #t = 0;
199
457
  // EMA of ms/frame
200
458
  #s = 0;
201
- #n;
202
- // weight of new samples (0..1)
203
459
  #r;
460
+ // weight of new samples (0..1)
461
+ #n;
204
462
  // minimum integer change to update displayed fps
205
463
  constructor(e = 0.05, t = 1) {
206
464
  const s = Number(e);
207
- this.#n = Number.isFinite(s) ? Math.min(1, Math.max(1e-3, s)) : 0.05;
208
- const n = Number(t);
209
- this.#r = Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 1;
465
+ this.#r = Number.isFinite(s) ? Math.min(1, Math.max(1e-3, s)) : 0.05;
466
+ const r = Number(t);
467
+ this.#n = Number.isFinite(r) ? Math.max(0, Math.floor(r)) : 1;
210
468
  }
211
469
  now() {
212
470
  const e = globalThis.performance;
@@ -218,17 +476,17 @@ class Y {
218
476
  return this.#s = e, this.#e;
219
477
  const t = e - this.#s;
220
478
  if (this.#s = e, !Number.isFinite(t) || t <= 0) return this.#e;
221
- this.#t === 0 ? this.#t = t : this.#t = (1 - this.#n) * this.#t + this.#n * t;
479
+ this.#t === 0 ? this.#t = t : this.#t = (1 - this.#r) * this.#t + this.#r * t;
222
480
  const s = 1e3 / this.#t;
223
481
  if (!Number.isFinite(s) || s <= 0) return this.#e;
224
- const n = Math.round(s);
225
- return this.#e !== 0 && this.#r > 0 && Math.abs(n - this.#e) < this.#r ? this.#e : (this.#e = n, this.#e);
482
+ const r = Math.round(s);
483
+ return this.#e !== 0 && this.#n > 0 && Math.abs(r - this.#e) < this.#n ? this.#e : (this.#e = r, this.#e);
226
484
  }
227
485
  reset() {
228
486
  this.#e = 0, this.#t = 0, this.#s = 0;
229
487
  }
230
488
  }
231
- class Z {
489
+ class te {
232
490
  constructor(e) {
233
491
  this._enabled = !0, this._show_date = !1, this._show_time = !0, this._debug = !1, e && this.configure(e);
234
492
  }
@@ -252,12 +510,12 @@ class Z {
252
510
  !this._enabled || !this._debug || console.debug(this._dt(), e, ...t);
253
511
  }
254
512
  }
255
- const c = new Z(), G = typeof process < "u" && !!process?.env && process.env.NODE_ENV === "production";
256
- G || console.info(
513
+ const h = new te(), Q = typeof process < "u" && !!process?.env && process.env.NODE_ENV === "production";
514
+ Q || console.info(
257
515
  "[Xpell] _xlog is redirected to console in development mode. Tip: enable 'Show timestamps' in DevTools → Console for timed logs."
258
516
  );
259
- const j = G ? c : console;
260
- class ee {
517
+ const x = Q ? h : console;
518
+ class se {
261
519
  constructor() {
262
520
  this._objects = {}, this._listeners = /* @__PURE__ */ new Map(), this._any_listeners = /* @__PURE__ */ new Set(), this._compat_writes = !0, this._warn_legacy_writes = !0, this._verbose = !1, this._compat_legacy_keys = !0, this._o_proxy = null, this._objects = {};
263
521
  }
@@ -269,10 +527,10 @@ class ee {
269
527
  get _o() {
270
528
  return !this._compat_writes && !this._warn_legacy_writes ? this._objects : (this._o_proxy || (this._o_proxy = new Proxy(this._objects, {
271
529
  set: (e, t, s) => {
272
- const n = String(t);
530
+ const r = String(t);
273
531
  return this._warn_legacy_writes && console.warn(
274
- `[XData] Legacy write: _o["${n}"] = ... ; prefer XData.set("${n}", value).`
275
- ), this._compat_writes ? this.set(n, s, { source: "legacy:_o" }) : e[n] = s, !0;
532
+ `[XData] Legacy write: _o["${r}"] = ... ; prefer XData.set("${r}", value).`
533
+ ), this._compat_writes ? this.set(r, s, { source: "legacy:_o" }) : e[r] = s, !0;
276
534
  },
277
535
  deleteProperty: (e, t) => {
278
536
  const s = String(t);
@@ -288,13 +546,13 @@ class ee {
288
546
  }
289
547
  /** Preferred write API */
290
548
  set(e, t, s) {
291
- const n = this._objects[e];
292
- this._objects[e] = t, this._emit({ key: e, value: t, prev: n, ts: Date.now(), op: "set", meta: s });
549
+ const r = this._objects[e];
550
+ this._objects[e] = t, this._emit({ key: e, value: t, prev: r, ts: Date.now(), op: "set", meta: s });
293
551
  }
294
552
  /** Shallow merge helper (nice for state objects) */
295
553
  patch(e, t, s) {
296
- const n = this._objects[e], i = { ...n && typeof n == "object" ? n : {}, ...t };
297
- this._objects[e] = i, this._emit({ key: e, value: i, prev: n, ts: Date.now(), op: "patch", meta: s });
554
+ const r = this._objects[e], i = { ...r && typeof r == "object" ? r : {}, ...t };
555
+ this._objects[e] = i, this._emit({ key: e, value: i, prev: r, ts: Date.now(), op: "patch", meta: s });
298
556
  }
299
557
  /** In-place mutation notifier */
300
558
  touch(e, t) {
@@ -339,8 +597,8 @@ class ee {
339
597
  for (const s of this._any_listeners) s(e);
340
598
  }
341
599
  }
342
- const x = new ee(), f = x;
343
- class I {
600
+ const v = new se(), m = v;
601
+ class N {
344
602
  constructor(e) {
345
603
  e && Object.keys(e).forEach((t) => {
346
604
  this[t] = e[t];
@@ -360,17 +618,17 @@ class I {
360
618
  return this._params?.hasOwnProperty(t) ? this._params[t] : this._params?.hasOwnProperty(e) ? this._params[e] : s;
361
619
  }
362
620
  }
363
- const X = {
621
+ const E = {
364
622
  type: "_type",
365
623
  children: "_children"
366
- }, b = class b {
624
+ }, j = class j {
367
625
  /**
368
626
  * Adds HTML-Xpell Mapping item
369
627
  * @param htmlElement HTML element to change from
370
628
  * @param xpellElement Xpell element to change to
371
629
  */
372
630
  static addHtml2XpellMapItem(e, t) {
373
- b.html2XMap.elements[e] = t;
631
+ j.html2XMap.elements[e] = t;
374
632
  }
375
633
  /**
376
634
  * convert text command to Xpell json command
@@ -378,62 +636,62 @@ const X = {
378
636
  */
379
637
  static parse(e, t) {
380
638
  const s = e.split(" ");
381
- let n = new I();
382
- if (t ? (n._module = t, n._op = s[0]) : (n._module = s[0], n._op = s[1]), n._params = {}, s.length > 1)
383
- for (let r = 2; r < s.length; ++r) {
384
- const i = s[r];
639
+ let r = new N();
640
+ if (t ? (r._module = t, r._op = s[0]) : (r._module = s[0], r._op = s[1]), r._params = {}, s.length > 1)
641
+ for (let n = 2; n < s.length; ++n) {
642
+ const i = s[n];
385
643
  if (i.indexOf(":") > -1) {
386
- const _ = i.split(":");
387
- n._params[_[0]] = _[1];
644
+ const a = i.split(":");
645
+ r._params[a[0]] = a[1];
388
646
  } else
389
- n._params[r - 1] = s[r];
647
+ r._params[n - 1] = s[n];
390
648
  }
391
- return n;
649
+ return r;
392
650
  }
393
651
  static replaceSpacesInQuotes(e, t = "_%20_") {
394
- return e.replace(/(['"])(.*?)\1/g, (s, n, r) => {
395
- const i = String(r).replace(/\s/g, t);
396
- return `${n}${i}${n}`;
652
+ return e.replace(/(['"])(.*?)\1/g, (s, r, n) => {
653
+ const i = String(n).replace(/\s/g, t);
654
+ return `${r}${i}${r}`;
397
655
  });
398
656
  }
399
657
  static parseObjectCommand(e, t) {
400
- e = b.replaceSpacesInQuotes(e);
401
- const s = e.trim().split(/\s+/), n = t || s.shift();
402
- if (!n) throw new Error("Missing module name");
403
- let r;
404
- if (s[0]?.startsWith("#") && (r = s.shift().slice(1), !r))
658
+ e = j.replaceSpacesInQuotes(e);
659
+ const s = e.trim().split(/\s+/), r = t || s.shift();
660
+ if (!r) throw new Error("Missing module name");
661
+ let n;
662
+ if (s[0]?.startsWith("#") && (n = s.shift().slice(1), !n))
405
663
  throw new Error("Invalid object selector '#'. Use '#<id>'");
406
664
  const i = s.shift();
407
665
  if (!i) throw new Error("Missing operation");
408
- const a = {};
409
- let _ = null, h = null;
410
- if (s.forEach((u) => {
411
- if (h) {
412
- if (h += ` ${u}`, u.endsWith(h[0])) {
413
- const m = h.slice(1, -1).replace(/_%20_/g, " ");
414
- a[_] = m, h = null;
666
+ const c = {};
667
+ let a = null, _ = null;
668
+ if (s.forEach((l) => {
669
+ if (_) {
670
+ if (_ += ` ${l}`, l.endsWith(_[0])) {
671
+ const d = _.slice(1, -1).replace(/_%20_/g, " ");
672
+ c[a] = d, _ = null;
415
673
  }
416
674
  return;
417
675
  }
418
- if (u.startsWith('"') || u.startsWith("'")) {
419
- if (h = u, u.endsWith(u[0]) && u.length > 1) {
420
- const m = u.slice(1, -1).replace(/_%20_/g, " ");
421
- a[_] = m, h = null;
676
+ if (l.startsWith('"') || l.startsWith("'")) {
677
+ if (_ = l, l.endsWith(l[0]) && l.length > 1) {
678
+ const d = l.slice(1, -1).replace(/_%20_/g, " ");
679
+ c[a] = d, _ = null;
422
680
  }
423
681
  return;
424
682
  }
425
- if (u.includes(":")) {
426
- const m = u.split(":"), O = m[0], H = m.slice(1).join(":").replace(/_%20_/g, " ");
427
- a[O] = H, _ = null;
683
+ if (l.includes(":")) {
684
+ const d = l.split(":"), y = d[0], g = d.slice(1).join(":").replace(/_%20_/g, " ");
685
+ c[y] = g, a = null;
428
686
  return;
429
687
  }
430
- _ = u.replace(/_%20_/g, " ");
431
- }), h) throw new Error("Unclosed quoted parameter value");
688
+ a = l.replace(/_%20_/g, " ");
689
+ }), _) throw new Error("Unclosed quoted parameter value");
432
690
  return {
433
- _module: n,
434
- _object: r,
691
+ _module: r,
692
+ _object: n,
435
693
  _op: i,
436
- _params: a
694
+ _params: c
437
695
  };
438
696
  }
439
697
  /**
@@ -443,7 +701,7 @@ const X = {
443
701
  */
444
702
  static xmlString2Xpell(e) {
445
703
  const s = new DOMParser().parseFromString(e, "text/xml");
446
- return s.childNodes.length > 0 ? b.xml2Xpell(s.childNodes[0]) : {};
704
+ return s.childNodes.length > 0 ? j.xml2Xpell(s.childNodes[0]) : {};
447
705
  }
448
706
  /**
449
707
  * Converts XML/HTML Document to Xpell JSON
@@ -452,25 +710,25 @@ const X = {
452
710
  * @returns {} Xpell JSON
453
711
  */
454
712
  static xml2Xpell(e, t) {
455
- const s = b.html2XMap;
456
- let n = {};
457
- n._children = [];
458
- const r = e.nodeName, i = e.nodeName;
459
- let a = t;
460
- if (t ? (n[X.type] = "xhtml", n._html_ns = "http://www.w3.org/2000/svg") : n._type = s.elements[r] ? s.elements[r] : r, e.attributes)
461
- for (let _ = 0; _ < e.attributes.length; ++_) {
462
- const h = e.attributes[_], u = s.attributes[h.name] ? s.attributes[h.name] : h.name;
463
- n[u] = h.value;
713
+ const s = j.html2XMap;
714
+ let r = {};
715
+ r._children = [];
716
+ const n = e.nodeName, i = e.nodeName;
717
+ let c = t;
718
+ if (t ? (r[E.type] = "xhtml", r._html_ns = "http://www.w3.org/2000/svg") : r._type = s.elements[n] ? s.elements[n] : n, e.attributes)
719
+ for (let a = 0; a < e.attributes.length; ++a) {
720
+ const _ = e.attributes[a], l = s.attributes[_.name] ? s.attributes[_.name] : _.name;
721
+ r[l] = _.value;
464
722
  }
465
- if (e?.firstChild?.nodeValue && (n.text = e?.firstChild.nodeValue.trim()), n[X.type] == "xhtml" ? n._html_tag = i : n[X.type] == "svg" && (a = !0, n._html_ns = "http://www.w3.org/2000/svg"), e?.childNodes.length > 0)
466
- for (let _ = 0; _ < e.childNodes.length; ++_) {
467
- const h = e.childNodes[_];
468
- h.nodeName.startsWith("#") || n[X.children].push(b.xml2Xpell(h, a));
723
+ if (e?.firstChild?.nodeValue && (r.text = e?.firstChild.nodeValue.trim()), r[E.type] == "xhtml" ? r._html_tag = i : r[E.type] == "svg" && (c = !0, r._html_ns = "http://www.w3.org/2000/svg"), e?.childNodes.length > 0)
724
+ for (let a = 0; a < e.childNodes.length; ++a) {
725
+ const _ = e.childNodes[a];
726
+ _.nodeName.startsWith("#") || r[E.children].push(j.xml2Xpell(_, c));
469
727
  }
470
- return n;
728
+ return r;
471
729
  }
472
730
  };
473
- b.html2XMap = {
731
+ j.html2XMap = {
474
732
  elements: {
475
733
  div: "view",
476
734
  a: "link",
@@ -500,8 +758,8 @@ b.html2XMap = {
500
758
  id: "_id"
501
759
  }
502
760
  };
503
- let w = b;
504
- class te {
761
+ let O = j;
762
+ class re {
505
763
  #e;
506
764
  #t;
507
765
  #s;
@@ -569,7 +827,7 @@ class te {
569
827
  * @param xObject XObject to maintain
570
828
  */
571
829
  addObject(e) {
572
- e && e._id ? (this.#t[e._id] = e, (!e._name || e._name.length == 0) && (e._name = e._id), this.#s[e._name] = e._id) : c.log("unable to add object");
830
+ e && e._id ? (this.#t[e._id] = e, (!e._name || e._name.length == 0) && (e._name = e._id), this.#s[e._name] = e._id) : h.log("unable to add object");
573
831
  }
574
832
  /**
575
833
  * Remove XObject from the manager
@@ -604,7 +862,7 @@ class te {
604
862
  return this.#s[e] ? this.getObject(this.#s[e]) : null;
605
863
  }
606
864
  }
607
- class ue {
865
+ class pe {
608
866
  constructor() {
609
867
  this._log_rules = {
610
868
  register: !1,
@@ -619,16 +877,16 @@ class ue {
619
877
  * - Canonical: on(name, cb, { _once, _owner, _tag })
620
878
  * - Legacy: on(name, cb, { _once }, owner)
621
879
  */
622
- on(e, t, s = {}, n) {
880
+ on(e, t, s = {}, r) {
623
881
  this._events[e] || (this._events[e] = []);
624
- const r = s?._owner ?? n, i = l.guid(), a = {
882
+ const n = s?._owner ?? r, i = u.guid(), c = {
625
883
  _id: i,
626
884
  _callback: t,
627
885
  _options: s,
628
- _owner: r,
886
+ _owner: n,
629
887
  _tag: s?._tag
630
888
  };
631
- return this._events[e].push(a), this._listener_index[i] = e, this._log_rules.register && j.log("XEM Register", e, i), i;
889
+ return this._events[e].push(c), this._listener_index[i] = e, this._log_rules.register && x.log("XEM Register", e, i), i;
632
890
  }
633
891
  /**
634
892
  * Register a listener that will be removed after first fire.
@@ -642,17 +900,17 @@ class ue {
642
900
  async fire(e, t) {
643
901
  const s = this._events[e];
644
902
  if (!s || s.length === 0) return;
645
- this._log_rules.fire && j.log("XEM Fire", e, t);
646
- const n = s.slice(), r = [];
647
- for (const i of n) {
903
+ this._log_rules.fire && x.log("XEM Fire", e, t);
904
+ const r = s.slice(), n = [];
905
+ for (const i of r) {
648
906
  try {
649
907
  i && i._callback && i._callback(t);
650
- } catch (a) {
651
- j.error(a);
908
+ } catch (c) {
909
+ x.error(c);
652
910
  }
653
- i?._options?._once && r.push(i._id);
911
+ i?._options?._once && n.push(i._id);
654
912
  }
655
- for (const i of r) this.remove(i);
913
+ for (const i of n) this.remove(i);
656
914
  }
657
915
  /**
658
916
  * Remove a listener by id.
@@ -662,10 +920,10 @@ class ue {
662
920
  if (!t) return;
663
921
  const s = this._events[t];
664
922
  if (s && s.length) {
665
- const n = s.findIndex((r) => r?._id === e);
666
- n >= 0 && s.splice(n, 1), s.length === 0 && delete this._events[t];
923
+ const r = s.findIndex((n) => n?._id === e);
924
+ r >= 0 && s.splice(r, 1), s.length === 0 && delete this._events[t];
667
925
  }
668
- delete this._listener_index[e], this._log_rules.remove && j.log("XEM Remove", t, e);
926
+ delete this._listener_index[e], this._log_rules.remove && x.log("XEM Remove", t, e);
669
927
  }
670
928
  /**
671
929
  * Remove all listeners for a given owner reference.
@@ -674,8 +932,8 @@ class ue {
674
932
  if (!e) return;
675
933
  const t = [];
676
934
  for (const s of Object.values(this._events))
677
- for (const n of s)
678
- (n?._owner ?? n?._options?._owner) === e && t.push(n._id);
935
+ for (const r of s)
936
+ (r?._owner ?? r?._options?._owner) === e && t.push(r._id);
679
937
  t.forEach((s) => this.remove(s));
680
938
  }
681
939
  /**
@@ -685,16 +943,16 @@ class ue {
685
943
  this._events = {}, this._listener_index = {};
686
944
  }
687
945
  }
688
- let P;
689
- function de(o) {
690
- P = o;
946
+ let R;
947
+ function fe(o) {
948
+ R = o;
691
949
  }
692
- function D() {
693
- if (!P)
950
+ function X() {
951
+ if (!R)
694
952
  throw new Error("XEventManager not set");
695
- return P;
953
+ return R;
696
954
  }
697
- const se = [
955
+ const ne = [
698
956
  "_nano_commands",
699
957
  "_cache_cmd_txt",
700
958
  "_cache_jcmd",
@@ -703,21 +961,21 @@ const se = [
703
961
  "_parent",
704
962
  "_children"
705
963
  ];
706
- function E(o) {
707
- return se.includes(o);
964
+ function $(o) {
965
+ return ne.includes(o);
708
966
  }
709
- function J(o) {
967
+ function K(o) {
710
968
  if (!o || typeof o != "object" || Array.isArray(o)) return !1;
711
969
  const e = Object.getPrototypeOf(o);
712
970
  return e === Object.prototype || e === null;
713
971
  }
714
- function g(o, e) {
972
+ function b(o, e) {
715
973
  return o._skill = e, o.getSkill = () => e, o;
716
974
  }
717
- const V = {
718
- info: g(
975
+ const G = {
976
+ info: b(
719
977
  (o, e) => {
720
- c.log("XObject id " + e?._id);
978
+ h.log("XObject id " + e?._id);
721
979
  },
722
980
  {
723
981
  _name: "info",
@@ -725,9 +983,9 @@ const V = {
725
983
  _description: "Logs the current object's id."
726
984
  }
727
985
  ),
728
- log: g(
986
+ log: b(
729
987
  (o, e) => {
730
- o._params && o._params[1] ? c.log(o._params[1]) : c.log(e);
988
+ o._params && o._params[1] ? h.log(o._params[1]) : h.log(e);
731
989
  },
732
990
  {
733
991
  _name: "log",
@@ -738,12 +996,12 @@ const V = {
738
996
  }
739
997
  }
740
998
  ),
741
- fire: g(
999
+ fire: b(
742
1000
  (o, e) => {
743
- o._params && o._params[1] ? D().fire(
1001
+ o._params && o._params[1] ? X().fire(
744
1002
  String(o._params[1]),
745
1003
  o._params[2]
746
- ) : o._params && o._params.event && D().fire(
1004
+ ) : o._params && o._params.event && X().fire(
747
1005
  String(o._params.event),
748
1006
  o._params.data
749
1007
  );
@@ -769,7 +1027,7 @@ const V = {
769
1027
  }
770
1028
  }
771
1029
  ),
772
- noop: g(
1030
+ noop: b(
773
1031
  () => {
774
1032
  },
775
1033
  {
@@ -778,12 +1036,12 @@ const V = {
778
1036
  _description: "No-op command. Useful as a placeholder in sequences."
779
1037
  }
780
1038
  ),
781
- "set-field": g(
1039
+ "set-field": b(
782
1040
  (o, e) => {
783
1041
  const t = o._params?.name, s = o._params?.value;
784
1042
  if (!(!e || typeof t != "string" || t.length === 0)) {
785
- if (E(t)) {
786
- c.error(`set-field denied for protected field: ${t}`);
1043
+ if ($(t)) {
1044
+ h.error(`set-field denied for protected field: ${t}`);
787
1045
  return;
788
1046
  }
789
1047
  e[t] = s;
@@ -806,12 +1064,12 @@ const V = {
806
1064
  }
807
1065
  }
808
1066
  ),
809
- "delete-field": g(
1067
+ "delete-field": b(
810
1068
  (o, e) => {
811
1069
  const t = o._params?.name;
812
1070
  if (!(!e || typeof t != "string" || t.length === 0)) {
813
- if (E(t)) {
814
- c.error(`delete-field denied for protected field: ${t}`);
1071
+ if ($(t)) {
1072
+ h.error(`delete-field denied for protected field: ${t}`);
815
1073
  return;
816
1074
  }
817
1075
  delete e[t];
@@ -826,12 +1084,12 @@ const V = {
826
1084
  }
827
1085
  }
828
1086
  ),
829
- "toggle-field": g(
1087
+ "toggle-field": b(
830
1088
  (o, e) => {
831
1089
  const t = o._params?.name;
832
1090
  if (!e || typeof t != "string" || t.length === 0) return;
833
- if (E(t)) {
834
- c.error(`toggle-field denied for protected field: ${t}`);
1091
+ if ($(t)) {
1092
+ h.error(`toggle-field denied for protected field: ${t}`);
835
1093
  return;
836
1094
  }
837
1095
  const s = e[t];
@@ -846,20 +1104,20 @@ const V = {
846
1104
  }
847
1105
  }
848
1106
  ),
849
- merge: g(
1107
+ merge: b(
850
1108
  (o, e) => {
851
1109
  const t = o._params?.name, s = o._params?.value;
852
1110
  if (!e || typeof t != "string" || t.length === 0) return;
853
- if (E(t)) {
854
- c.error(`merge denied for protected field: ${t}`);
1111
+ if ($(t)) {
1112
+ h.error(`merge denied for protected field: ${t}`);
855
1113
  return;
856
1114
  }
857
- if (!J(s)) {
858
- c.error("merge expects _params.value as a plain object");
1115
+ if (!K(s)) {
1116
+ h.error("merge expects _params.value as a plain object");
859
1117
  return;
860
1118
  }
861
- const n = e[t];
862
- J(n) || (e[t] = {}), Object.assign(e[t], s);
1119
+ const r = e[t];
1120
+ K(r) || (e[t] = {}), Object.assign(e[t], s);
863
1121
  },
864
1122
  {
865
1123
  _name: "merge",
@@ -871,12 +1129,12 @@ const V = {
871
1129
  }
872
1130
  }
873
1131
  ),
874
- "run-seq": g(
1132
+ "run-seq": b(
875
1133
  async (o, e) => {
876
1134
  if (!e) return;
877
1135
  const t = o._params?.seq;
878
1136
  if (!Array.isArray(t)) {
879
- c.error("run-seq expects _params.seq as an array");
1137
+ h.error("run-seq expects _params.seq as an array");
880
1138
  return;
881
1139
  }
882
1140
  for (const s of t) {
@@ -885,9 +1143,9 @@ const V = {
885
1143
  continue;
886
1144
  }
887
1145
  if (s && typeof s == "object" && s._op) {
888
- const n = s._object;
889
- if (!(n == null || n === "this" || n === e._id)) {
890
- c.error("run-seq rejected non-self _object target");
1146
+ const r = s._object;
1147
+ if (!(r == null || r === "this" || r === e._id)) {
1148
+ h.error("run-seq rejected non-self _object target");
891
1149
  return;
892
1150
  }
893
1151
  const i = {
@@ -897,7 +1155,7 @@ const V = {
897
1155
  await e.execute(i);
898
1156
  continue;
899
1157
  }
900
- c.error(
1158
+ h.error(
901
1159
  "run-seq skipped invalid step; expected string or object with _op"
902
1160
  );
903
1161
  }
@@ -932,16 +1190,16 @@ const V = {
932
1190
  }
933
1191
  )
934
1192
  };
935
- let $;
936
- function ne(o) {
937
- $ = o;
1193
+ let L;
1194
+ function ie(o) {
1195
+ L = o;
938
1196
  }
939
- function re() {
940
- if (!$)
1197
+ function oe() {
1198
+ if (!L)
941
1199
  throw new Error("XRuntime not set");
942
- return $;
1200
+ return L;
943
1201
  }
944
- const R = {
1202
+ const U = {
945
1203
  _id: "xobject",
946
1204
  _title: "XObject Core Runtime Contract",
947
1205
  _version: "1.0.0",
@@ -993,7 +1251,7 @@ const R = {
993
1251
  "Runtime methods include parse, append, run, execute, bindDataSource, unbindDataSource, toXData, dispose, and removeChild.",
994
1252
  "Most prompts should use this skill as a compact dependency summary, not full context."
995
1253
  ]
996
- }, M = { _children: "child nodes" }, S = class S {
1254
+ }, P = { _children: "child nodes" }, A = class A {
997
1255
  /**
998
1256
  * XObject constructor is creating the object and adding all the data keys to the XObject instance
999
1257
  * @param data constructor input data (object)
@@ -1022,14 +1280,14 @@ const R = {
1022
1280
  "_debug"
1023
1281
  ],
1024
1282
  _instance_xporters: {}
1025
- }, t && l.mergeDefaultsWithData(e, t), this._id = e && e._id ? e._id : "xo-" + l.guid(), this._type = "object", this._children = [], this._nano_commands = {}, this.addNanoCommandPack(V), e && e.hasOwnProperty("_nano_commands") && e._nano_commands && (this.addNanoCommandPack(e._nano_commands), delete e._nano_commands), this.addXporterDataIgnoreFields(["_nano_commands"]), this.addXporterInstanceXporter(S, (n) => n.toXData()), this._xem_options = {
1283
+ }, t && u.mergeDefaultsWithData(e, t), this._id = e && e._id ? e._id : "xo-" + u.guid(), this._type = "object", this._children = [], this._nano_commands = {}, this.addNanoCommandPack(G), e && e.hasOwnProperty("_nano_commands") && e._nano_commands && (this.addNanoCommandPack(e._nano_commands), delete e._nano_commands), this.addXporterDataIgnoreFields(["_nano_commands"]), this.addXporterInstanceXporter(A, (r) => r.toXData()), this._xem_options = {
1026
1284
  // _instance:_xem
1027
1285
  // _object: this
1028
1286
  // _support_html: true
1029
- }, !s && e && this.parse(e, M);
1287
+ }, !s && e && this.parse(e, P);
1030
1288
  }
1031
1289
  static getOwnSkill() {
1032
- const e = this, t = e._skill ?? R;
1290
+ const e = this, t = e._skill ?? U;
1033
1291
  return {
1034
1292
  ...t,
1035
1293
  _exports: {
@@ -1044,7 +1302,7 @@ const R = {
1044
1302
  }
1045
1303
  static getOwnNanoCommands() {
1046
1304
  return {
1047
- ...V
1305
+ ...G
1048
1306
  };
1049
1307
  }
1050
1308
  static getNanoCommands() {
@@ -1060,8 +1318,32 @@ const R = {
1060
1318
  (t) => t.getSkill?.() ?? t._skill
1061
1319
  ).filter(Boolean) : [];
1062
1320
  }
1321
+ static getArtifactStrategy() {
1322
+ return "canonical";
1323
+ }
1324
+ static generateArtifact(e = {}) {
1325
+ const t = this.getOwnSkill?.(), s = t?._canonical_examples?.[0], r = s ? this.cloneArtifact(s) : { _type: this._xtype ?? t?._id ?? "object" };
1326
+ return this.applyArtifactIntent(r, e);
1327
+ }
1328
+ static cloneArtifact(e) {
1329
+ return typeof structuredClone == "function" ? structuredClone(e) : JSON.parse(JSON.stringify(e));
1330
+ }
1331
+ static applyArtifactIntent(e, t = {}) {
1332
+ const s = e;
1333
+ return t._id && (s._id = t._id), t._label && ("_label" in s ? s._label = t._label : "_text" in s ? s._text = t._label : "_title" in s && (s._title = t._label)), t._text && "_text" in s && (s._text = t._text), t._title && "_title" in s && (s._title = t._title), t._description && "_description" in s && (s._description = t._description), t._variant && "_variant" in s && (s._variant = t._variant), t._tone && "_tone" in s && (s._tone = t._tone), t._size && "_size" in s && (s._size = t._size), t._density && "_density" in s && (s._density = t._density), t._elevation && "_elevation" in s && (s._elevation = t._elevation), t.class && (s.class = t.class), t._placeholder && ("placeholder" in s ? s.placeholder = t._placeholder : "_placeholder" in s && (s._placeholder = t._placeholder)), t._data_output && "_data_output" in s && (s._data_output = t._data_output), Array.isArray(t._children) && (s._children = t._children), Array.isArray(t._actions) && (s._actions = t._actions), Array.isArray(t._items) && (s._items = t._items), t._flow_id && (s._flow = {
1334
+ _id: t._flow_id,
1335
+ _payload: t._payload ?? {}
1336
+ }), t._flow_event && (s._flow_event = t._flow_event), s;
1337
+ }
1338
+ static validateArtifact(e) {
1339
+ const t = [];
1340
+ return (!e || typeof e != "object") && t.push("artifact must be an object"), e._type || t.push("artifact requires _type"), {
1341
+ _ok: t.length === 0,
1342
+ _errors: t
1343
+ };
1344
+ }
1063
1345
  log(e, ...t) {
1064
- this._debug && e && c.log(this._type + "->" + this._id + "]", e, ...t);
1346
+ this._debug && e && h.log(this._type + "->" + this._id + "]", e, ...t);
1065
1347
  }
1066
1348
  /**
1067
1349
  * Initialize the XObject
@@ -1070,7 +1352,7 @@ const R = {
1070
1352
  * @deprecated - use parse method instead
1071
1353
  */
1072
1354
  init(e, t) {
1073
- !t && e && this.parse(e, M);
1355
+ !t && e && this.parse(e, P);
1074
1356
  }
1075
1357
  parseEvents(e) {
1076
1358
  if (!this._event_parsed) {
@@ -1085,19 +1367,36 @@ const R = {
1085
1367
  }
1086
1368
  addEventListener(e, t, s) {
1087
1369
  s || (s = this._xem_options);
1088
- const n = async (i) => {
1370
+ const r = async (i) => {
1089
1371
  await this.checkAndRunInternalFunction(t, i);
1090
- }, r = D().on(e, n, s, this);
1091
- return this._event_listeners_ids[e] || (this._event_listeners_ids[e] = []), this._event_listeners_ids[e].push(r), r;
1372
+ }, n = X().on(e, r, s, this);
1373
+ return this._event_listeners_ids[e] || (this._event_listeners_ids[e] = []), this._event_listeners_ids[e].push(n), n;
1092
1374
  }
1093
1375
  removeEventListener(e) {
1094
- const t = this._event_listeners_ids[e];
1095
- t && t.length && (t.forEach((s) => {
1096
- D().remove(s);
1097
- }), delete this._event_listeners_ids[e]);
1376
+ const t = this._event_listeners_ids;
1377
+ if (!t || typeof t != "object" || Array.isArray(t)) {
1378
+ this._event_listeners_ids = {};
1379
+ return;
1380
+ }
1381
+ (Array.isArray(t[e]) ? [...t[e]] : []).forEach((r) => {
1382
+ try {
1383
+ X().remove(r);
1384
+ } catch {
1385
+ }
1386
+ }), delete t[e];
1098
1387
  }
1099
- removeAllEventListeners() {
1100
- Object.keys(this._event_listeners_ids).forEach((t) => this.removeEventListener(t));
1388
+ removeAllEventListeners(e) {
1389
+ const t = this._event_listeners_ids;
1390
+ if (!t || typeof t != "object" || Array.isArray(t)) {
1391
+ this._event_listeners_ids = {};
1392
+ return;
1393
+ }
1394
+ (e ? [e] : Object.keys(t)).forEach((r) => {
1395
+ try {
1396
+ this.removeEventListener(r);
1397
+ } catch {
1398
+ }
1399
+ });
1101
1400
  }
1102
1401
  /**
1103
1402
  * Append a child XObject to this XObject
@@ -1131,7 +1430,7 @@ const R = {
1131
1430
  * @param <XDataInstanceXporter> ie - the instance exporter object
1132
1431
  */
1133
1432
  addXporterInstanceXporter(e, t) {
1134
- const s = l.guid();
1433
+ const s = u.guid();
1135
1434
  this._xporter._instance_xporters[s] = {
1136
1435
  cls: e,
1137
1436
  handler: t
@@ -1142,9 +1441,9 @@ const R = {
1142
1441
  * @param data data to parse
1143
1442
  * @param ignore - lis of words to ignore in the parse process
1144
1443
  */
1145
- parse(e, t = M) {
1146
- Object.keys(e).forEach((n) => {
1147
- !t.hasOwnProperty(n) && e.hasOwnProperty(n) && (this[n] = e[n]);
1444
+ parse(e, t = P) {
1445
+ Object.keys(e).forEach((r) => {
1446
+ !t.hasOwnProperty(r) && e.hasOwnProperty(r) && (this[r] = e[r]);
1148
1447
  });
1149
1448
  }
1150
1449
  /**
@@ -1158,8 +1457,8 @@ const R = {
1158
1457
  * }
1159
1458
  */
1160
1459
  parseFieldsFromXDataObject(e, t) {
1161
- Object.keys(t).forEach((n) => {
1162
- e.hasOwnProperty(n) ? this[n] = e[n] : this[n] = t[n];
1460
+ Object.keys(t).forEach((r) => {
1461
+ e.hasOwnProperty(r) ? this[r] = e[r] : this[r] = t[r];
1163
1462
  });
1164
1463
  }
1165
1464
  /**
@@ -1169,12 +1468,12 @@ const R = {
1169
1468
  * @param checkNonXParams - also check non Xpell fields (fields that not starting with "_" sign)
1170
1469
  */
1171
1470
  parseFields(e, t, s) {
1172
- t.forEach((n) => {
1173
- if (e.hasOwnProperty(n))
1174
- this[n] = e[n];
1175
- else if (s && n.startsWith("_")) {
1176
- const r = n.substring(1);
1177
- e.hasOwnProperty(r) && (this[n] = e[r], this[r] = e[r]);
1471
+ t.forEach((r) => {
1472
+ if (e.hasOwnProperty(r))
1473
+ this[r] = e[r];
1474
+ else if (s && r.startsWith("_")) {
1475
+ const n = r.substring(1);
1476
+ e.hasOwnProperty(n) && (this[r] = e[n], this[n] = e[n]);
1178
1477
  }
1179
1478
  });
1180
1479
  }
@@ -1192,137 +1491,168 @@ const R = {
1192
1491
  this._on_create ? this.checkAndRunInternalFunction(this._on_create) : this._on && this._on.create ? this.checkAndRunInternalFunction(this._on.create) : this._once && this._once.create && this.checkAndRunInternalFunction(this._once.create);
1193
1492
  }
1194
1493
  async runCmd(e) {
1195
- const t = e instanceof I ? e : new I(e);
1494
+ const t = e instanceof N ? e : new N(e);
1196
1495
  await this.execute(t);
1197
1496
  }
1198
1497
  async checkAndRunInternalFunction(e, ...t) {
1199
- const s = (r) => {
1200
- if (typeof r == "string") {
1201
- if (r === "$event") return t[0];
1202
- if (r.startsWith("$event.")) {
1203
- const i = r.slice(7).split(".");
1204
- let a = t[0];
1205
- for (const _ of i) {
1206
- if (a == null) return;
1207
- a = a[_];
1498
+ const s = (i, c) => {
1499
+ const a = c.split(".");
1500
+ let _ = i;
1501
+ for (const l of a) {
1502
+ if (_ == null) return;
1503
+ _ = _[l];
1504
+ }
1505
+ return _;
1506
+ }, r = (i, c, a) => {
1507
+ if (typeof i == "string") {
1508
+ if (i === "$prev") return c;
1509
+ if (i.startsWith("$prev."))
1510
+ return s(
1511
+ c,
1512
+ i.slice(6)
1513
+ );
1514
+ if (i === "$event") return t[0];
1515
+ if (i.startsWith("$event."))
1516
+ return s(
1517
+ t[0],
1518
+ i.slice(7)
1519
+ );
1520
+ if (i === "$data") return t[0];
1521
+ if (i.startsWith("$data."))
1522
+ return s(
1523
+ t[0],
1524
+ i.slice(6)
1525
+ );
1526
+ if (i.startsWith("$xdata:") || i.startsWith("$xdata.")) {
1527
+ const l = (i.startsWith("$xdata:"), i.slice(7)).split(".");
1528
+ for (let d = l.length; d > 0; d--) {
1529
+ const y = l.slice(0, d).join(".");
1530
+ if (v.has(y)) {
1531
+ const g = v.get(y), w = l.slice(d).join(".");
1532
+ return w ? u.get_path(g, w) : g;
1533
+ }
1208
1534
  }
1209
- return a;
1535
+ return;
1210
1536
  }
1211
- if (r === "$data") return t[0];
1212
- if (r.startsWith("$data.")) {
1213
- const i = r.slice(6).split(".");
1214
- let a = t[0];
1215
- for (const _ of i) {
1216
- if (a == null) return;
1217
- a = a[_];
1537
+ if (i.startsWith("$") && a && typeof a == "object") {
1538
+ const _ = i.slice(1), l = _.indexOf("."), d = l === -1 ? _ : _.slice(0, l), y = l === -1 ? "" : _.slice(l + 1);
1539
+ if (Object.prototype.hasOwnProperty.call(
1540
+ a,
1541
+ d
1542
+ )) {
1543
+ const g = a[d];
1544
+ return y ? s(g, y) : g;
1218
1545
  }
1219
- return a;
1220
1546
  }
1221
- return r;
1222
- }
1223
- if (Array.isArray(r))
1224
- return r.map(s);
1225
- if (r && typeof r == "object") {
1226
- const i = {};
1227
- for (const a of Object.keys(r))
1228
- i[a] = s(r[a]);
1229
1547
  return i;
1230
1548
  }
1231
- return r;
1232
- }, n = async (r, i) => (i !== void 0 && r && typeof r == "object" && !Array.isArray(r) && (r = {
1233
- ...r,
1234
- _params: {
1235
- ...r._params ?? {},
1236
- _prev: i
1237
- }
1238
- }), await this.checkAndRunInternalFunction(
1239
- r,
1240
- ...t
1241
- ));
1242
- if (Array.isArray(e)) {
1243
- let r;
1244
- for (const i of e)
1245
- r = await n(
1246
- i,
1247
- r
1549
+ if (Array.isArray(i))
1550
+ return i.map(
1551
+ (_) => r(
1552
+ _,
1553
+ c,
1554
+ a
1555
+ )
1248
1556
  );
1249
- return r;
1250
- }
1251
- if (typeof e == "function")
1252
- return await e(this, ...t);
1253
- if (typeof e == "string") {
1254
- const r = w.parseObjectCommand(
1255
- `${this._id} ${e}`
1256
- );
1257
- if (t.length > 0) {
1258
- r._params = r._params || {};
1259
- const i = t[0];
1260
- r._params._event = i, !r._params.data && !i?.target && (r._params.data = i);
1557
+ if (i && typeof i == "object") {
1558
+ const _ = {};
1559
+ for (const l of Object.keys(i))
1560
+ _[l] = r(
1561
+ i[l],
1562
+ c,
1563
+ a
1564
+ );
1565
+ return _;
1261
1566
  }
1262
- return await this.execute(r);
1263
- }
1264
- if (e && typeof e == "object" && Array.isArray(e._commands)) {
1265
- const r = e, i = typeof r._mode == "string" ? r._mode : "sequence", a = r._stop_on_error !== !1, _ = r._commands;
1266
- if (i === "parallel") {
1267
- const u = await Promise.allSettled(
1268
- _.map(
1269
- (O) => n(O)
1270
- )
1271
- ), m = u.find(
1272
- (O) => O.status === "rejected"
1567
+ return i;
1568
+ }, n = async (i, c) => {
1569
+ if (Array.isArray(i)) {
1570
+ let a;
1571
+ for (const _ of i)
1572
+ a = await n(_, a);
1573
+ return a;
1574
+ }
1575
+ if (typeof i == "function")
1576
+ return await i(this, ...t);
1577
+ if (typeof i == "string") {
1578
+ const a = O.parseObjectCommand(
1579
+ `${this._id} ${i}`
1273
1580
  );
1274
- if (m && a)
1275
- throw m.reason;
1276
- return u;
1581
+ if (t.length > 0) {
1582
+ a._params = a._params || {};
1583
+ const _ = t[0];
1584
+ a._params._event = _, !a._params.data && !_?.target && (a._params.data = _);
1585
+ }
1586
+ return await this.execute(a);
1277
1587
  }
1278
- let h;
1279
- for (const u of _)
1280
- try {
1281
- h = await n(
1282
- u,
1283
- i === "chain" ? h : void 0
1588
+ if (i && typeof i == "object" && Array.isArray(i._commands)) {
1589
+ const a = i, _ = typeof a._mode == "string" ? a._mode : "sequence", l = a._stop_on_error !== !1, d = a._commands;
1590
+ if (_ === "parallel") {
1591
+ const g = await Promise.allSettled(
1592
+ d.map(
1593
+ (M) => n(M, c)
1594
+ )
1595
+ ), w = g.find(
1596
+ (M) => M.status === "rejected"
1284
1597
  );
1285
- } catch (m) {
1286
- if (c.error(
1287
- this._type + "->" + this._id + "] command sequence failed",
1288
- m
1289
- ), a)
1290
- throw m;
1598
+ if (w && l)
1599
+ throw w.reason;
1600
+ return g;
1291
1601
  }
1292
- return h;
1293
- }
1294
- if (e && typeof e == "object" && e._op) {
1295
- const r = e;
1296
- if ((r._object === void 0 || r._object === null || r._object === "this" ? this._id : r._object) !== this._id) {
1297
- c.error(
1298
- "XObject JSON handler target not supported; expected _object omitted/'this'/" + this._id
1299
- );
1300
- return;
1602
+ let y = c;
1603
+ for (const g of d)
1604
+ try {
1605
+ y = await n(
1606
+ g,
1607
+ _ === "chain" ? y : c
1608
+ );
1609
+ } catch (w) {
1610
+ if (h.error(
1611
+ this._type + "->" + this._id + "] command sequence failed",
1612
+ w
1613
+ ), l)
1614
+ throw w;
1615
+ }
1616
+ return y;
1301
1617
  }
1302
- const a = {
1303
- ...r,
1304
- _params: r._params ? { ...r._params } : {}
1305
- };
1306
- if (t.length > 0) {
1307
- const _ = t[0];
1308
- Object.prototype.hasOwnProperty.call(
1309
- a._params,
1310
- "data"
1311
- ) || (a._params.data = _), Object.prototype.hasOwnProperty.call(
1312
- a._params,
1313
- "_event"
1314
- ) || (a._params._event = _);
1618
+ if (i && typeof i == "object" && i._op) {
1619
+ const a = i;
1620
+ if ((a._object === void 0 || a._object === null || a._object === "this" ? this._id : a._object) !== this._id) {
1621
+ h.error(
1622
+ "XObject JSON handler target not supported; expected _object omitted/'this'/" + this._id
1623
+ );
1624
+ return;
1625
+ }
1626
+ const l = {
1627
+ ...a,
1628
+ _params: a._params ? { ...a._params } : {}
1629
+ };
1630
+ if (t.length > 0) {
1631
+ const d = t[0];
1632
+ Object.prototype.hasOwnProperty.call(
1633
+ l._params,
1634
+ "data"
1635
+ ) || (l._params.data = d), Object.prototype.hasOwnProperty.call(
1636
+ l._params,
1637
+ "_event"
1638
+ ) || (l._params._event = d);
1639
+ }
1640
+ return l._params = r(
1641
+ l._params,
1642
+ c,
1643
+ this._context
1644
+ ), this._debug && h.log(
1645
+ this._type + "->" + this._id + "]",
1646
+ "JSON handler executed locally",
1647
+ l
1648
+ ), await this.execute(l);
1315
1649
  }
1316
- return a._params = s(a._params), this._debug && c.log(
1317
- this._type + "->" + this._id + "]",
1318
- "JSON handler executed locally",
1319
- a
1320
- ), await this.execute(a);
1321
- }
1322
- c.error(
1323
- this._type + "->" + this._id + "] invalid handler in checkAndRunInternalFunction",
1324
- e
1325
- );
1650
+ h.error(
1651
+ this._type + "->" + this._id + "] invalid handler in checkAndRunInternalFunction",
1652
+ i
1653
+ );
1654
+ };
1655
+ return await n(e);
1326
1656
  }
1327
1657
  /**
1328
1658
  * Triggers when the object is being mounted to other element
@@ -1344,7 +1674,7 @@ const R = {
1344
1674
  const e = this._data_source;
1345
1675
  if (typeof e != "string" || e.length === 0) return;
1346
1676
  const t = this._type ?? this.constructor.name, s = this._id ?? "no-id";
1347
- x.delete(e, { source: `${t}#${s}.emptyDataSource` });
1677
+ v.delete(e, { source: `${t}#${s}.emptyDataSource` });
1348
1678
  }
1349
1679
  /**
1350
1680
  * Triggers when new data is being received from the data source
@@ -1385,7 +1715,7 @@ const R = {
1385
1715
  * @param cache - cache last command to prevent multiple parsing on the same command
1386
1716
  */
1387
1717
  async run(e, t = !0) {
1388
- let s = this._cache_cmd_txt && this._cache_cmd_txt == e ? this._cache_jcmd : w.parseObjectCommand(e);
1718
+ let s = this._cache_cmd_txt && this._cache_cmd_txt == e ? this._cache_jcmd : O.parseObjectCommand(e);
1389
1719
  t && (this._cache_cmd_txt = e, this._cache_jcmd = s), await this.execute(s);
1390
1720
  }
1391
1721
  /**
@@ -1400,37 +1730,42 @@ const R = {
1400
1730
  *
1401
1731
  */
1402
1732
  async execute(e) {
1403
- const t = e?._op;
1404
- if (!t) {
1405
- c.error(this._id + " missing _op in command");
1733
+ const t = e?._op, s = typeof t == "string" && t.startsWith("_") && t.length > 1 ? t.slice(1) : t;
1734
+ if (!s) {
1735
+ h.error(this._id + " missing _op in command");
1406
1736
  return;
1407
1737
  }
1408
- const s = e?._module;
1409
- if (s)
1738
+ const r = e?._module;
1739
+ if (r)
1410
1740
  try {
1411
- return await re().execute({
1741
+ return await oe().execute({
1412
1742
  ...e,
1413
- _module: s
1743
+ _module: r,
1744
+ _op: s
1414
1745
  });
1415
1746
  } catch (n) {
1416
- c.error(
1417
- this._id + " module execution failed: " + s + "." + t + " " + n
1747
+ h.error(
1748
+ this._id + " module execution failed: " + r + "." + s + " " + n
1418
1749
  );
1419
1750
  return;
1420
1751
  }
1421
- if (this._nano_commands[t])
1752
+ if (this._nano_commands[s])
1422
1753
  try {
1423
- return await this._nano_commands[t](
1424
- e,
1754
+ const n = {
1755
+ ...e,
1756
+ _op: s
1757
+ };
1758
+ return await this._nano_commands[s](
1759
+ n,
1425
1760
  this
1426
1761
  );
1427
1762
  } catch (n) {
1428
- c.error(
1429
- this._id + " has error with command name " + t + " " + n
1763
+ h.error(
1764
+ this._id + " has error with command name " + s + " " + n
1430
1765
  );
1431
1766
  return;
1432
1767
  }
1433
- c.error(this._id + " has no command name " + t);
1768
+ h.error(this._id + " has no command name " + s);
1434
1769
  }
1435
1770
  /**
1436
1771
  * Return an IXObjectData JSON representation of the XObject
@@ -1444,11 +1779,11 @@ const R = {
1444
1779
  if (typeof s == "function")
1445
1780
  return;
1446
1781
  if (typeof s == "object") {
1447
- const n = Object.keys(this._xporter._instance_xporters);
1448
- let r = !0;
1449
- n.forEach((i) => {
1450
- this._xporter._instance_xporters[i], s instanceof this._xporter._instance_xporters[i].cls && (e[t] = this._xporter._instance_xporters[i].handler(s), r = !1);
1451
- }), r && (e[t] = s);
1782
+ const r = Object.keys(this._xporter._instance_xporters);
1783
+ let n = !0;
1784
+ r.forEach((i) => {
1785
+ this._xporter._instance_xporters[i], s instanceof this._xporter._instance_xporters[i].cls && (e[t] = this._xporter._instance_xporters[i].handler(s), n = !1);
1786
+ }), n && (e[t] = s);
1452
1787
  } else
1453
1788
  e[t] = s;
1454
1789
  }
@@ -1469,10 +1804,10 @@ const R = {
1469
1804
  });
1470
1805
  }
1471
1806
  bindDataSource(e, t) {
1472
- const s = t?.initial ?? !0, n = e ?? this._data_source;
1473
- typeof n != "string" || n.length === 0 || this._process_data && (this._xd_bound_key === n && this._xd_unsub || (this.unbindDataSource(), this._data_source = n, this._xd_bound_key = n, this._type ?? this.constructor.name, this._id, this._xd_unsub = x.on(n, async (r) => {
1474
- await this.onData(r.value);
1475
- }), s && x.has(n) && this.onData(x.get(n))));
1807
+ const s = t?.initial ?? !0, r = e ?? this._data_source;
1808
+ typeof r != "string" || r.length === 0 || this._process_data && (this._xd_bound_key === r && this._xd_unsub || (this.unbindDataSource(), this._data_source = r, this._xd_bound_key = r, this._type ?? this.constructor.name, this._id, this._xd_unsub = v.on(r, async (n) => {
1809
+ await this.onData(n.value);
1810
+ }), s && v.has(r) && this.onData(v.get(r))));
1476
1811
  }
1477
1812
  unbindDataSource() {
1478
1813
  this._xd_unsub?.(), this._xd_unsub = void 0, this._xd_bound_key = void 0;
@@ -1510,20 +1845,20 @@ const R = {
1510
1845
  this.append(e);
1511
1846
  }
1512
1847
  };
1513
- S._xtype = "object", S._skill = R;
1514
- let F = S;
1515
- class pe {
1848
+ A._xtype = "object", A._skill = U;
1849
+ let C = A;
1850
+ class me {
1516
1851
  /**
1517
1852
  * Get all registered object in this ObjectPack
1518
1853
  * @returns XObject dictionary
1519
1854
  */
1520
1855
  static getObjects() {
1521
1856
  return {
1522
- object: F
1857
+ object: C
1523
1858
  };
1524
1859
  }
1525
1860
  }
1526
- const ie = "engine:module:num-of-objects:", N = {
1861
+ const ae = "engine:module:num-of-objects:", W = {
1527
1862
  _id: "xmodule",
1528
1863
  _title: "XModule Runtime Contract",
1529
1864
  _version: "1.0.0",
@@ -1538,14 +1873,14 @@ const ie = "engine:module:num-of-objects:", N = {
1538
1873
  "Do not mutate another module's objects directly."
1539
1874
  ]
1540
1875
  };
1541
- var d;
1542
- const C = class C {
1876
+ var p;
1877
+ const I = class I {
1543
1878
  constructor(e) {
1544
- B(this, d);
1879
+ J(this, p);
1545
1880
  this._loaded = !1, this._loading = !1, this._log_rules = {
1546
1881
  createObject: !1,
1547
1882
  removeObject: !1
1548
- }, W(this, d, new te()), this._name = e._name, this._id = l.guid();
1883
+ }, V(this, p, new re()), this._name = e._name, this._id = u.guid();
1549
1884
  }
1550
1885
  static getOwnSkillBase() {
1551
1886
  return {
@@ -1553,7 +1888,7 @@ const C = class C {
1553
1888
  };
1554
1889
  }
1555
1890
  getOwnSkill() {
1556
- const t = this.constructor._skill ?? N;
1891
+ const t = this.constructor._skill ?? W;
1557
1892
  return {
1558
1893
  ...t,
1559
1894
  _exports: {
@@ -1574,23 +1909,23 @@ const C = class C {
1574
1909
  }
1575
1910
  getObjectSkills() {
1576
1911
  const e = [], t = /* @__PURE__ */ new Set();
1577
- for (const s of Object.values(p(this, d).getObjectClasses())) {
1912
+ for (const s of Object.values(f(this, p).getObjectClasses())) {
1578
1913
  if (typeof s.getOwnSkill != "function") continue;
1579
- const n = s.getOwnSkill();
1580
- n?._id && (t.has(n._id) || (t.add(n._id), e.push(n)));
1914
+ const r = s.getOwnSkill();
1915
+ r?._id && (t.has(r._id) || (t.add(r._id), e.push(r)));
1581
1916
  }
1582
1917
  return e;
1583
1918
  }
1584
1919
  getCommandSkills() {
1585
1920
  const e = Object.getPrototypeOf(this), s = this.constructor._ops ?? {};
1586
1921
  return Object.getOwnPropertyNames(e).filter(
1587
- (n) => n.startsWith("_") && !n.startsWith("__") && typeof this[n] == "function"
1588
- ).map((n) => {
1589
- const r = n.slice(1).replaceAll("_", "-");
1590
- return s[r] ?? {
1591
- _name: r,
1922
+ (r) => r.startsWith("_") && !r.startsWith("__") && typeof this[r] == "function"
1923
+ ).map((r) => {
1924
+ const n = r.slice(1).replaceAll("_", "-");
1925
+ return s[n] ?? {
1926
+ _name: n,
1592
1927
  _scope: "module",
1593
- _description: `Runtime module command: ${r}`
1928
+ _description: `Runtime module command: ${n}`
1594
1929
  };
1595
1930
  });
1596
1931
  }
@@ -1598,7 +1933,7 @@ const C = class C {
1598
1933
  if (!(this._loaded || this._loading)) {
1599
1934
  this._loading = !0;
1600
1935
  try {
1601
- await this.onLoad(), this._loaded = !0, c.log("Module " + this._name + " loaded");
1936
+ await this.onLoad(), this._loaded = !0, h.log("Module " + this._name + " loaded");
1602
1937
  } finally {
1603
1938
  this._loading = !1;
1604
1939
  }
@@ -1612,22 +1947,22 @@ const C = class C {
1612
1947
  * @return {XObject|*}
1613
1948
  */
1614
1949
  create(e) {
1615
- e._debug && c.log("Creating object with data", e);
1950
+ e._debug && h.log("Creating object with data", e);
1616
1951
  let t;
1617
1952
  if (e.hasOwnProperty("_type")) {
1618
- e._debug && c.log("Object type is", e._type, this.hasObject(e._type) ? "found" : "not found", "in module", this._name);
1619
- const s = String(e._type), n = p(this, d).getObjectClass(s);
1620
- if (!n)
1953
+ e._debug && h.log("Object type is", e._type, this.hasObject(e._type) ? "found" : "not found", "in module", this._name);
1954
+ const s = String(e._type), r = f(this, p).getObjectClass(s);
1955
+ if (!r)
1621
1956
  throw `Xpell object '${s}' not found in module '${this._name}'`;
1622
- typeof n == "function" && n.hasOwnProperty("defaults") && l.mergeDefaultsWithData(
1957
+ typeof r == "function" && r.hasOwnProperty("defaults") && u.mergeDefaultsWithData(
1623
1958
  e,
1624
- n.defaults
1625
- ), t = new n(e);
1959
+ r.defaults
1960
+ ), t = new r(e);
1626
1961
  } else
1627
- t = new F(e);
1628
- return p(this, d).addObject(t), e._children && e._children.forEach((s) => {
1629
- const n = this.create(s);
1630
- t.append(n);
1962
+ t = new C(e);
1963
+ return f(this, p).addObject(t), e._children && e._children.forEach((s) => {
1964
+ const r = this.create(s);
1965
+ t.append(r);
1631
1966
  }), t.onCreate(), t;
1632
1967
  }
1633
1968
  /**
@@ -1635,15 +1970,15 @@ const C = class C {
1635
1970
  * @param objectId op
1636
1971
  */
1637
1972
  remove(e) {
1638
- const t = p(this, d).getObject(e);
1973
+ const t = f(this, p).getObject(e);
1639
1974
  if (!t) return;
1640
- const s = [], n = (r) => {
1641
- r?._id && (s.push(r._id), (r._children ?? []).forEach((i) => n(i)));
1975
+ const s = [], r = (n) => {
1976
+ n?._id && (s.push(n._id), (n._children ?? []).forEach((i) => r(i)));
1642
1977
  };
1643
- n(t), typeof t.dispose == "function" && t.dispose(), s.reverse().forEach((r) => p(this, d).removeObject(r));
1978
+ r(t), typeof t.dispose == "function" && t.dispose(), s.reverse().forEach((n) => f(this, p).removeObject(n));
1644
1979
  }
1645
1980
  _info(e) {
1646
- c.log("module info");
1981
+ h.log("module info");
1647
1982
  }
1648
1983
  //xpell interpreter
1649
1984
  /**
@@ -1656,7 +1991,7 @@ const C = class C {
1656
1991
  if (e) {
1657
1992
  let t = e.trim();
1658
1993
  t.startsWith(this._name) || (t = this._name + " " + t);
1659
- let s = w.parse(t);
1994
+ let s = O.parse(t);
1660
1995
  return await this.execute(s);
1661
1996
  } else
1662
1997
  throw "Unable to parse Xpell Command";
@@ -1672,14 +2007,14 @@ const C = class C {
1672
2007
  throw new Error(`Invalid XCommand: missing _op (module: ${this._name})`);
1673
2008
  const t = e._object;
1674
2009
  if (t) {
1675
- const r = p(this, d).getObject(t);
1676
- if (!r)
2010
+ const c = f(this, p).getObject(t);
2011
+ if (!c)
1677
2012
  throw new Error(`Module '${this._name}' cant find object id: ${t}`);
1678
- return await r.execute(e);
2013
+ return await c.execute(e);
1679
2014
  }
1680
- const s = "_" + e._op.replaceAll("-", "_"), n = this[s];
1681
- if (typeof n == "function")
1682
- return await n.call(this, e);
2015
+ const s = e._op, n = "_" + (s.startsWith("_") && s.length > 1 ? s.slice(1) : s).replaceAll("-", "_"), i = this[n];
2016
+ if (typeof i == "function")
2017
+ return await i.call(this, e);
1683
2018
  throw new Error(`Module '${this._name}' cant find op: ${e._op}`);
1684
2019
  }
1685
2020
  /**
@@ -1688,11 +2023,11 @@ const C = class C {
1688
2023
  * @param frameNumber Current frame number
1689
2024
  */
1690
2025
  async onFrame(e) {
1691
- const t = p(this, d)._objects, s = Object.keys(t);
1692
- s.forEach((n) => {
1693
- const r = t[n];
1694
- r && r.onFrame && typeof r.onFrame == "function" && r?.onFrame(e);
1695
- }), f.set(ie + this._id, s.length, {
2026
+ const t = f(this, p)._objects, s = Object.keys(t);
2027
+ s.forEach((r) => {
2028
+ const n = t[r];
2029
+ n && n.onFrame && typeof n.onFrame == "function" && n?.onFrame(e);
2030
+ }), m.set(ae + this._id, s.length, {
1696
2031
  source: "xmodule"
1697
2032
  });
1698
2033
  }
@@ -1707,10 +2042,10 @@ const C = class C {
1707
2042
  * getObject directly on the module instead of om.getObject
1708
2043
  */
1709
2044
  get om() {
1710
- return p(this, d);
2045
+ return f(this, p);
1711
2046
  }
1712
2047
  get _object_manager() {
1713
- return p(this, d);
2048
+ return f(this, p);
1714
2049
  }
1715
2050
  /**
1716
2051
  * Returns the XObject instance from the module Object Manager
@@ -1718,10 +2053,10 @@ const C = class C {
1718
2053
  * @returns XObject
1719
2054
  */
1720
2055
  getObject(e) {
1721
- return p(this, d).getObject(e);
2056
+ return f(this, p).getObject(e);
1722
2057
  }
1723
2058
  hasObject(e) {
1724
- return p(this, d).hasObjectClass(e);
2059
+ return f(this, p).hasObjectClass(e);
1725
2060
  }
1726
2061
  /**
1727
2062
  * Returns the XObject instance from the module Object Manager
@@ -1729,7 +2064,7 @@ const C = class C {
1729
2064
  * xmodule._o["object-id"] is equivalent to xmodule.getObject("object-id")
1730
2065
  */
1731
2066
  get _o() {
1732
- return p(this, d)._objects;
2067
+ return f(this, p)._objects;
1733
2068
  }
1734
2069
  /**
1735
2070
  * Imports external object pack to the engine
@@ -1737,7 +2072,7 @@ const C = class C {
1737
2072
  * @param {XObjects} xObjectPack
1738
2073
  */
1739
2074
  importObjectPack(e) {
1740
- p(this, d).registerObjects(e.getObjects());
2075
+ f(this, p).registerObjects(e.getObjects());
1741
2076
  }
1742
2077
  /**
1743
2078
  * Imports external object pack to the engine
@@ -1754,7 +2089,7 @@ const C = class C {
1754
2089
  * @param xObject
1755
2090
  */
1756
2091
  importObject(e, t) {
1757
- p(this, d).registerObject(e, t);
2092
+ f(this, p).registerObject(e, t);
1758
2093
  }
1759
2094
  // In XModule
1760
2095
  async _help(e) {
@@ -1774,7 +2109,7 @@ const C = class C {
1774
2109
  };
1775
2110
  }
1776
2111
  };
1777
- d = new WeakMap(), C._skill = N, C._ops = {
2112
+ p = new WeakMap(), I._skill = W, I._ops = {
1778
2113
  help: {
1779
2114
  _name: "help",
1780
2115
  _scope: "module",
@@ -1786,8 +2121,8 @@ d = new WeakMap(), C._skill = N, C._ops = {
1786
2121
  _description: "Log basic module information."
1787
2122
  }
1788
2123
  };
1789
- let A = C;
1790
- const oe = {
2124
+ let F = I;
2125
+ const ce = {
1791
2126
  _id: "xdata",
1792
2127
  _title: "XData Runtime State Contract",
1793
2128
  _version: "1.0.0",
@@ -1806,20 +2141,20 @@ const oe = {
1806
2141
  _data_source: "XData key used by XObject/XUIObject for reactive data binding.",
1807
2142
  "$xdata.key": "Runtime payload reference to an XData value."
1808
2143
  }
1809
- }, v = class v extends A {
2144
+ }, S = class S extends F {
1810
2145
  constructor() {
1811
- super({ _name: v._name });
2146
+ super({ _name: S._name });
1812
2147
  }
1813
2148
  async _get(e) {
1814
- const t = l.ensure_params(e?._params), s = l.ensure_string(t.key, "key");
2149
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.key, "key");
1815
2150
  return {
1816
2151
  _ok: !0,
1817
- _result: f.get(s)
2152
+ _result: m.get(s)
1818
2153
  };
1819
2154
  }
1820
2155
  async _set(e) {
1821
- const t = l.ensure_params(e?._params), s = l.ensure_string(t.key, "key");
1822
- return t._debug && j.log("XD SET", { key: s, value: t.value }), f.set(s, t.value, {
2156
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.key, "key");
2157
+ return t._debug && x.log("XD SET", { key: s, value: t.value }), m.set(s, t.value, {
1823
2158
  source: t.source ?? "xd:set"
1824
2159
  }), {
1825
2160
  _ok: !0,
@@ -1827,10 +2162,10 @@ const oe = {
1827
2162
  };
1828
2163
  }
1829
2164
  async _patch(e) {
1830
- const t = l.ensure_params(e?._params), s = l.ensure_string(t.key, "key");
1831
- if (!l.is_plain_object(t.value))
2165
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.key, "key");
2166
+ if (!u.is_plain_object(t.value))
1832
2167
  throw new Error("xd patch expects value as plain object");
1833
- return f.patch(s, t.value, {
2168
+ return m.patch(s, t.value, {
1834
2169
  source: t.source ?? "xd:patch"
1835
2170
  }), {
1836
2171
  _ok: !0,
@@ -1838,8 +2173,8 @@ const oe = {
1838
2173
  };
1839
2174
  }
1840
2175
  async _delete(e) {
1841
- const t = l.ensure_params(e?._params), s = l.ensure_string(t.key, "key");
1842
- return f.delete(s, {
2176
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.key, "key");
2177
+ return m.delete(s, {
1843
2178
  source: t.source ?? "xd:delete"
1844
2179
  }), {
1845
2180
  _ok: !0,
@@ -1847,8 +2182,8 @@ const oe = {
1847
2182
  };
1848
2183
  }
1849
2184
  async _touch(e) {
1850
- const t = l.ensure_params(e?._params), s = l.ensure_string(t.key, "key");
1851
- return f.touch(s, {
2185
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.key, "key");
2186
+ return m.touch(s, {
1852
2187
  source: t.source ?? "xd:touch"
1853
2188
  }), {
1854
2189
  _ok: !0,
@@ -1856,14 +2191,47 @@ const oe = {
1856
2191
  };
1857
2192
  }
1858
2193
  async _has(e) {
1859
- const t = l.ensure_params(e?._params), s = l.ensure_string(t.key, "key");
2194
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.key, "key");
1860
2195
  return {
1861
2196
  _ok: !0,
1862
- _result: f.has(s)
2197
+ _result: m.has(s)
2198
+ };
2199
+ }
2200
+ async _get_path(e) {
2201
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.key, "key"), r = u.ensure_string(t.path, "path"), n = m.get(s);
2202
+ return {
2203
+ _ok: !0,
2204
+ _result: u.get_path(
2205
+ n,
2206
+ r,
2207
+ t.fallback
2208
+ )
2209
+ };
2210
+ }
2211
+ async _log(e) {
2212
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.key, "key"), r = m.get(s), n = u.read_optional_string(
2213
+ t.path,
2214
+ "path"
2215
+ ), i = n ? u.get_path(
2216
+ r,
2217
+ n,
2218
+ t.fallback
2219
+ ) : r;
2220
+ return x.log("XDATA LOG", {
2221
+ key: s,
2222
+ path: n,
2223
+ value: i
2224
+ }), {
2225
+ _ok: !0,
2226
+ _result: {
2227
+ key: s,
2228
+ path: n,
2229
+ value: i
2230
+ }
1863
2231
  };
1864
2232
  }
1865
2233
  };
1866
- v._name = "xd", v._skill = oe, v._ops = {
2234
+ S._name = "xd", S._skill = ce, S._ops = {
1867
2235
  get: {
1868
2236
  _name: "get",
1869
2237
  _scope: "module",
@@ -1917,10 +2285,20 @@ v._name = "xd", v._skill = oe, v._ops = {
1917
2285
  _params: {
1918
2286
  key: "XData key."
1919
2287
  }
2288
+ },
2289
+ get_path: {
2290
+ _name: "get_path",
2291
+ _scope: "module",
2292
+ _description: "Get nested value from an XData value.",
2293
+ _params: {
2294
+ key: "XData key.",
2295
+ path: "Nested path inside the stored value.",
2296
+ fallback: "Optional fallback value."
2297
+ }
1920
2298
  }
1921
2299
  };
1922
- let L = v;
1923
- const ae = {
2300
+ let q = S;
2301
+ const _e = {
1924
2302
  _id: "xem",
1925
2303
  _title: "XEventManager Runtime Event Bus",
1926
2304
  _version: "1.0.0",
@@ -1945,16 +2323,16 @@ const ae = {
1945
2323
  "XEM is process-wide and listener order should not be assumed.",
1946
2324
  "Event payloads should be JSON/data-only."
1947
2325
  ]
1948
- }, k = class k extends A {
2326
+ }, D = class D extends F {
1949
2327
  constructor() {
1950
- super({ _name: k._name });
2328
+ super({ _name: D._name });
1951
2329
  }
1952
2330
  async _fire(e) {
1953
- const t = l.ensure_params(e?._params), s = l.ensure_string(t.event, "event"), n = t.data;
1954
- t._debug && j.log("xem fire 🔥 ", s, n), await D().fire(s, n);
2331
+ const t = u.ensure_params(e?._params), s = u.ensure_string(t.event, "event"), r = t.data;
2332
+ t._debug && x.log("xem fire 🔥 ", s, r), await X().fire(s, r);
1955
2333
  }
1956
2334
  };
1957
- k._name = "xem", k._skill = ae, k._ops = {
2335
+ D._name = "xem", D._skill = _e, D._ops = {
1958
2336
  fire: {
1959
2337
  _name: "fire",
1960
2338
  _scope: "module",
@@ -1976,59 +2354,58 @@ k._name = "xem", k._skill = ae, k._ops = {
1976
2354
  }
1977
2355
  }
1978
2356
  };
1979
- let U = k;
1980
- class me {
2357
+ let T = D;
2358
+ class ge {
1981
2359
  /* -------------------------------------------------- */
1982
2360
  /* core helpers */
1983
2361
  /* -------------------------------------------------- */
1984
2362
  static get(e, t, s) {
1985
- if (!e?._params) return s;
1986
- const n = e._params[t];
2363
+ const n = (e?._params ?? e)?.[t];
1987
2364
  return n !== void 0 ? n : s;
1988
2365
  }
1989
2366
  static has(e, t) {
1990
- return (e?._params || e)[t] !== void 0;
2367
+ return (e?._params ?? e)[t] !== void 0;
1991
2368
  }
1992
2369
  static str(e, ...t) {
1993
- const s = e?._params || e;
1994
- for (const n of t) {
1995
- const r = s?.[n];
1996
- if (r != null)
1997
- return String(r);
2370
+ const s = e?._params ?? e;
2371
+ for (const r of t) {
2372
+ const n = s?.[r];
2373
+ if (n != null)
2374
+ return String(n);
1998
2375
  }
1999
2376
  }
2000
2377
  /* -------------------------------------------------- */
2001
2378
  /* typed params */
2002
2379
  /* -------------------------------------------------- */
2003
2380
  static bool(e, t, s = !1) {
2004
- const n = e?._params || e, r = this.get(n, t, s);
2005
- if (typeof r == "boolean") return r;
2006
- if (typeof r == "number") return r !== 0;
2007
- if (typeof r == "string") {
2008
- const i = r.toLowerCase();
2381
+ const r = e?._params ?? e, n = this.get(r, t, s);
2382
+ if (typeof n == "boolean") return n;
2383
+ if (typeof n == "number") return n !== 0;
2384
+ if (typeof n == "string") {
2385
+ const i = n.toLowerCase();
2009
2386
  if (["1", "true", "yes", "on"].includes(i)) return !0;
2010
2387
  if (["0", "false", "no", "off"].includes(i)) return !1;
2011
2388
  }
2012
- return !!r;
2389
+ return !!n;
2013
2390
  }
2014
2391
  static int(e, t, s = 0) {
2015
- const n = e?._params || e, r = this.get(n, t, s), i = parseInt(String(r), 10);
2392
+ const r = e?._params ?? e, n = this.get(r, t, s), i = parseInt(String(n), 10);
2016
2393
  return Number.isFinite(i) ? i : s;
2017
2394
  }
2018
2395
  static json(e, t, s) {
2019
- const n = e?._params || e, r = this.get(n, t, s);
2020
- if (r == null) return s;
2021
- if (typeof r == "object") return r;
2022
- if (typeof r == "string")
2396
+ const r = e?._params ?? e, n = this.get(r, t, s);
2397
+ if (n == null) return s;
2398
+ if (typeof n == "object") return n;
2399
+ if (typeof n == "string")
2023
2400
  try {
2024
- return JSON.parse(r);
2401
+ return JSON.parse(n);
2025
2402
  } catch {
2026
2403
  return s;
2027
2404
  }
2028
2405
  return s;
2029
2406
  }
2030
2407
  }
2031
- class K extends Error {
2408
+ class H extends Error {
2032
2409
  constructor(e, t, s) {
2033
2410
  super(t), this.name = "XError", this._code = e, this._level = s?._level ?? "error", this._meta = s?._meta, this._cause = s?._cause;
2034
2411
  }
@@ -2051,7 +2428,7 @@ class K extends Error {
2051
2428
  };
2052
2429
  }
2053
2430
  }
2054
- class y {
2431
+ class k {
2055
2432
  constructor(e) {
2056
2433
  this._ok = !1, this._ts = Date.now(), this._pt = 0, e && this.setXData(e);
2057
2434
  }
@@ -2059,23 +2436,23 @@ class y {
2059
2436
  // Factories
2060
2437
  // ---------------------------------------------------------------------------
2061
2438
  static create(e) {
2062
- return new y(e);
2439
+ return new k(e);
2063
2440
  }
2064
2441
  static ok(e) {
2065
- return new y({ _ok: !0, _result: e });
2442
+ return new k({ _ok: !0, _result: e });
2066
2443
  }
2067
2444
  static error(e) {
2068
- if (e instanceof K)
2069
- return new y({
2445
+ if (e instanceof H)
2446
+ return new k({
2070
2447
  _ok: !1,
2071
2448
  _result: e.toXData()
2072
2449
  });
2073
- const t = new K(
2450
+ const t = new H(
2074
2451
  "E_INTERNAL",
2075
2452
  e?.message ?? String(e),
2076
2453
  { _cause: e }
2077
2454
  );
2078
- return new y({
2455
+ return new k({
2079
2456
  _ok: !1,
2080
2457
  _result: t.toXData()
2081
2458
  });
@@ -2108,33 +2485,33 @@ class y {
2108
2485
  e && ("_ok" in e && (this._ok = !!e._ok), "_ts" in e && typeof e._ts == "number" && (this._ts = e._ts), "_pt" in e && typeof e._pt == "number" && (this._pt = e._pt), "_result" in e && (this._result = e._result));
2109
2486
  }
2110
2487
  }
2111
- class fe extends y {
2488
+ class ye extends k {
2112
2489
  constructor(e) {
2113
- super(y.error(e).toXData());
2490
+ super(k.error(e).toXData());
2114
2491
  }
2115
2492
  }
2116
- class ge extends y {
2493
+ class be extends k {
2117
2494
  constructor(e) {
2118
2495
  super({ _ok: !0, _result: e });
2119
2496
  }
2120
2497
  }
2121
- const ce = "engine:frame-number", _e = "engine:fps";
2122
- class le {
2498
+ const le = "engine:frame-number", he = "engine:fps";
2499
+ class ue {
2123
2500
  constructor(e) {
2124
- this._log_rules = {}, this._modules = {}, this._schedule_frame = e?._schedule_frame ?? l.createDefaultScheduler(e?._target_fps), this._version = "0.0.1", this._engine_id = l.guid(), this._frame_number = 0, this._fps_calc = new Y(), this.parser = w, this._modules = {}, c._enabled = !1, ne(this);
2501
+ this._log_rules = {}, this._modules = {}, this._schedule_frame = e?._schedule_frame ?? u.createDefaultScheduler(e?._target_fps), this._version = "0.0.1", this._engine_id = u.guid(), this._frame_number = 0, this._fps_calc = new ee(), this.parser = O, this._modules = {}, h._enabled = !1, ie(this);
2125
2502
  }
2126
2503
  /**
2127
2504
  * @deprecated use _verbose instead
2128
2505
  * Enable Xpell logs to console
2129
2506
  */
2130
2507
  set verbose(e) {
2131
- c._enabled = e;
2508
+ h._enabled = e;
2132
2509
  }
2133
2510
  /**
2134
2511
  * Enable Xpell logs to console
2135
2512
  */
2136
2513
  set _verbose(e) {
2137
- c._enabled = e;
2514
+ h._enabled = e;
2138
2515
  }
2139
2516
  /**
2140
2517
  * Logs message to console using Xpell logger
@@ -2144,7 +2521,7 @@ class le {
2144
2521
  * @param optionalParams
2145
2522
  */
2146
2523
  log(e, ...t) {
2147
- c.log(e, ...t);
2524
+ h.log(e, ...t);
2148
2525
  }
2149
2526
  /**
2150
2527
  * Delay the execution of the next command
@@ -2161,7 +2538,7 @@ class le {
2161
2538
  * Use loadModuleAsync() for deterministic startup.
2162
2539
  */
2163
2540
  addModule(e) {
2164
- return this._modules.hasOwnProperty(e._name) ? (c.log("Module " + e._name + " already loaded"), !1) : (this._modules[e._name] = e, !0);
2541
+ return this._modules.hasOwnProperty(e._name) ? (h.log("Module " + e._name + " already loaded"), !1) : (this._modules[e._name] = e, !0);
2165
2542
  }
2166
2543
  /**
2167
2544
  * Loads Xpell module into the engine
@@ -2188,7 +2565,7 @@ class le {
2188
2565
  * Display information about the Xpell engine to the console
2189
2566
  */
2190
2567
  info() {
2191
- c.log(`Xpell information:
2568
+ h.log(`Xpell information:
2192
2569
  - Engine Id: ` + this._engine_id + `
2193
2570
  - Version ` + this._version);
2194
2571
  }
@@ -2198,7 +2575,7 @@ class le {
2198
2575
  */
2199
2576
  run(e) {
2200
2577
  if (e?.length > 2) {
2201
- let t = w.parse(e);
2578
+ let t = O.parse(e);
2202
2579
  return this.execute(t);
2203
2580
  } else
2204
2581
  throw "Unable to parse Xpell command";
@@ -2223,7 +2600,7 @@ class le {
2223
2600
  s?.onFrame && typeof s.onFrame == "function" && s.onFrame(this._frame_number);
2224
2601
  }
2225
2602
  const e = this._fps_calc.calc();
2226
- f.set(ce, this._frame_number, { source: "engine" }), f.set(_e, e, { source: "engine" }), f._compat_legacy_keys && (f.set("frame-number", this._frame_number, { source: "engine:legacy" }), f.set("fps", e, { source: "engine:legacy" })), this._schedule_frame(() => this.onFrame());
2603
+ m.set(le, this._frame_number, { source: "engine" }), m.set(he, e, { source: "engine" }), m._compat_legacy_keys && (m.set("frame-number", this._frame_number, { source: "engine:legacy" }), m.set("fps", e, { source: "engine:legacy" })), this._schedule_frame(() => this.onFrame());
2227
2604
  }
2228
2605
  /**
2229
2606
  * Gets Xpell module by name
@@ -2237,12 +2614,12 @@ class le {
2237
2614
  * Start Xpell engine for web browsers using requestAnimationFrame
2238
2615
  */
2239
2616
  start() {
2240
- c.log("Loading Xpell core modules...[xd, xem]"), this.loadModule(new L()), this.loadModule(new U()), c.log("Starting Xpell"), this.onFrame();
2617
+ h.log("Loading Xpell core modules...[xd, xem]"), this.loadModule(new q()), this.loadModule(new T()), h.log("Starting Xpell"), this.onFrame();
2241
2618
  }
2242
2619
  getCoreSkills() {
2243
2620
  return [
2244
- N,
2245
- R
2621
+ W,
2622
+ U
2246
2623
  ];
2247
2624
  }
2248
2625
  getModuleSkills() {
@@ -2265,38 +2642,38 @@ class le {
2265
2642
  };
2266
2643
  }
2267
2644
  }
2268
- const be = new le();
2645
+ const we = new ue();
2269
2646
  export {
2270
- I as XCommand,
2271
- _e as XD_FPS,
2272
- ce as XD_FRAME_NUMBER,
2273
- x as XData,
2274
- L as XDataModule,
2275
- K as XError,
2276
- U as XEventManagerModule,
2277
- c as XLogger,
2278
- A as XModule,
2279
- F as XObject,
2280
- te as XObjectManager,
2281
- pe as XObjectPack,
2282
- me as XParams,
2283
- w as XParser,
2284
- y as XResponse,
2285
- fe as XResponseError,
2286
- ge as XResponseOK,
2287
- z as XUtils,
2288
- be as Xpell,
2289
- le as XpellEngine,
2290
- ee as _XData,
2291
- ue as _XEventManager,
2292
- Z as _XLogger,
2293
- Q as _XUtils,
2294
- be as _x,
2295
- f as _xd,
2296
- c as _xlog,
2297
- l as _xu,
2298
- g as createNanoCommandWithSkill,
2299
- be as default,
2300
- D as getXEventManager,
2301
- de as setXEventManager
2647
+ N as XCommand,
2648
+ he as XD_FPS,
2649
+ le as XD_FRAME_NUMBER,
2650
+ v as XData,
2651
+ q as XDataModule,
2652
+ H as XError,
2653
+ T as XEventManagerModule,
2654
+ h as XLogger,
2655
+ F as XModule,
2656
+ C as XObject,
2657
+ re as XObjectManager,
2658
+ me as XObjectPack,
2659
+ ge as XParams,
2660
+ O as XParser,
2661
+ k as XResponse,
2662
+ ye as XResponseError,
2663
+ be as XResponseOK,
2664
+ Z as XUtils,
2665
+ we as Xpell,
2666
+ ue as XpellEngine,
2667
+ se as _XData,
2668
+ pe as _XEventManager,
2669
+ te as _XLogger,
2670
+ Y as _XUtils,
2671
+ we as _x,
2672
+ m as _xd,
2673
+ h as _xlog,
2674
+ u as _xu,
2675
+ b as createNanoCommandWithSkill,
2676
+ we as default,
2677
+ X as getXEventManager,
2678
+ fe as setXEventManager
2302
2679
  };