@adaas/are-html 0.0.19 → 0.0.21

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.
Files changed (74) hide show
  1. package/dist/browser/index.d.mts +161 -5
  2. package/dist/browser/index.mjs +357 -55
  3. package/dist/browser/index.mjs.map +1 -1
  4. package/dist/node/directives/AreDirectiveFor.directive.d.mts +7 -0
  5. package/dist/node/directives/AreDirectiveFor.directive.d.ts +7 -0
  6. package/dist/node/directives/AreDirectiveFor.directive.js +17 -2
  7. package/dist/node/directives/AreDirectiveFor.directive.js.map +1 -1
  8. package/dist/node/directives/AreDirectiveFor.directive.mjs +17 -2
  9. package/dist/node/directives/AreDirectiveFor.directive.mjs.map +1 -1
  10. package/dist/node/directives/AreDirectiveShow.directive.d.mts +32 -0
  11. package/dist/node/directives/AreDirectiveShow.directive.d.ts +32 -0
  12. package/dist/node/directives/AreDirectiveShow.directive.js +81 -0
  13. package/dist/node/directives/AreDirectiveShow.directive.js.map +1 -0
  14. package/dist/node/directives/AreDirectiveShow.directive.mjs +71 -0
  15. package/dist/node/directives/AreDirectiveShow.directive.mjs.map +1 -0
  16. package/dist/node/engine/AreHTML.engine.d.mts +2 -1
  17. package/dist/node/engine/AreHTML.engine.d.ts +2 -1
  18. package/dist/node/engine/AreHTML.engine.js +8 -2
  19. package/dist/node/engine/AreHTML.engine.js.map +1 -1
  20. package/dist/node/engine/AreHTML.engine.mjs +8 -2
  21. package/dist/node/engine/AreHTML.engine.mjs.map +1 -1
  22. package/dist/node/engine/AreHTML.interpreter.d.mts +3 -0
  23. package/dist/node/engine/AreHTML.interpreter.d.ts +3 -0
  24. package/dist/node/engine/AreHTML.interpreter.js +29 -0
  25. package/dist/node/engine/AreHTML.interpreter.js.map +1 -1
  26. package/dist/node/engine/AreHTML.interpreter.mjs +29 -0
  27. package/dist/node/engine/AreHTML.interpreter.mjs.map +1 -1
  28. package/dist/node/index.d.mts +4 -1
  29. package/dist/node/index.d.ts +4 -1
  30. package/dist/node/index.js +21 -0
  31. package/dist/node/index.mjs +3 -0
  32. package/dist/node/instructions/AreHTML.instructions.constants.d.mts +1 -0
  33. package/dist/node/instructions/AreHTML.instructions.constants.d.ts +1 -0
  34. package/dist/node/instructions/AreHTML.instructions.constants.js +2 -1
  35. package/dist/node/instructions/AreHTML.instructions.constants.js.map +1 -1
  36. package/dist/node/instructions/AreHTML.instructions.constants.mjs +2 -1
  37. package/dist/node/instructions/AreHTML.instructions.constants.mjs.map +1 -1
  38. package/dist/node/instructions/AreHTML.instructions.types.d.mts +9 -1
  39. package/dist/node/instructions/AreHTML.instructions.types.d.ts +9 -1
  40. package/dist/node/instructions/HideElement.instruction.d.mts +13 -0
  41. package/dist/node/instructions/HideElement.instruction.d.ts +13 -0
  42. package/dist/node/instructions/HideElement.instruction.js +31 -0
  43. package/dist/node/instructions/HideElement.instruction.js.map +1 -0
  44. package/dist/node/instructions/HideElement.instruction.mjs +24 -0
  45. package/dist/node/instructions/HideElement.instruction.mjs.map +1 -0
  46. package/dist/node/lib/AreRoot/AreRoot.component.d.mts +57 -3
  47. package/dist/node/lib/AreRoot/AreRoot.component.d.ts +57 -3
  48. package/dist/node/lib/AreRoot/AreRoot.component.js +137 -48
  49. package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -1
  50. package/dist/node/lib/AreRoot/AreRoot.component.mjs +139 -50
  51. package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -1
  52. package/dist/node/lib/AreRoot/AreRootCache.context.d.mts +58 -0
  53. package/dist/node/lib/AreRoot/AreRootCache.context.d.ts +58 -0
  54. package/dist/node/lib/AreRoot/AreRootCache.context.js +106 -0
  55. package/dist/node/lib/AreRoot/AreRootCache.context.js.map +1 -0
  56. package/dist/node/lib/AreRoot/AreRootCache.context.mjs +99 -0
  57. package/dist/node/lib/AreRoot/AreRootCache.context.mjs.map +1 -0
  58. package/examples/jumpstart/dist/index.html +1 -1
  59. package/examples/jumpstart/dist/{mq1a0fv0-ccgtz6.js → mq7hqrxy-4kus50.js} +629 -433
  60. package/examples/signal-routing/dist/index.html +1 -1
  61. package/examples/signal-routing/dist/{mq1bzrik-4lec86.js → mq7k53th-qiwy4x.js} +903 -486
  62. package/examples/signal-routing/src/components/SettingsPage.component.ts +39 -0
  63. package/examples/signal-routing/src/concept.ts +2 -0
  64. package/package.json +9 -9
  65. package/src/directives/AreDirectiveFor.directive.ts +44 -2
  66. package/src/directives/AreDirectiveShow.directive.ts +127 -0
  67. package/src/engine/AreHTML.engine.ts +11 -1
  68. package/src/engine/AreHTML.interpreter.ts +50 -0
  69. package/src/index.ts +3 -0
  70. package/src/instructions/AreHTML.instructions.constants.ts +1 -0
  71. package/src/instructions/AreHTML.instructions.types.ts +9 -0
  72. package/src/instructions/HideElement.instruction.ts +29 -0
  73. package/src/lib/AreRoot/AreRoot.component.ts +201 -71
  74. package/src/lib/AreRoot/AreRootCache.context.ts +133 -0
@@ -116,10 +116,10 @@ var k = (_a5 = class {
116
116
  this.verifyInput(e), this.getInitializer(e).call(this, e);
117
117
  }
118
118
  get concept() {
119
- return this._concept || _.concept;
119
+ return this._concept || c.concept;
120
120
  }
121
121
  get scope() {
122
- return this._scope || _.root.name;
122
+ return this._scope || c.root.name;
123
123
  }
124
124
  get entity() {
125
125
  return this._entity;
@@ -147,11 +147,11 @@ var k = (_a5 = class {
147
147
  }
148
148
  }
149
149
  fromString(e) {
150
- let [t4, r8, n6] = e.split("@"), [o3, s4, a4] = r8.split(":"), c3 = a4.includes(".") ? a4.split(".")[0] : void 0, d4 = a4.includes(".") ? a4.split(".")[1] : a4;
151
- this._concept = t4 || _.root.name, this._scope = o3 || _.root.name, this._entity = s4, this._id = d4, this._version = n6, this._shard = c3;
150
+ let [t4, r8, n6] = e.split("@"), [o3, s4, a4] = r8.split(":"), _4 = a4.includes(".") ? a4.split(".")[0] : void 0, d4 = a4.includes(".") ? a4.split(".")[1] : a4;
151
+ this._concept = t4 || c.root.name, this._scope = o3 || c.root.name, this._entity = s4, this._id = d4, this._version = n6, this._shard = _4;
152
152
  }
153
153
  fromObject(e) {
154
- this._concept = e.concept ? _a5.isASEID(e.concept) ? new _a5(e.concept).id : e.concept : _.concept, this._scope = e.scope ? I.isNumber(e.scope) ? W.formatWithLeadingZeros(e.scope) : _a5.isASEID(e.scope) ? new _a5(e.scope).id : e.scope : _.root.name, this._entity = e.entity, this._id = I.isNumber(e.id) ? W.formatWithLeadingZeros(e.id) : e.id, this._version = e.version, this._shard = e.shard;
154
+ this._concept = e.concept ? _a5.isASEID(e.concept) ? new _a5(e.concept).id : e.concept : c.concept, this._scope = e.scope ? I.isNumber(e.scope) ? W.formatWithLeadingZeros(e.scope) : _a5.isASEID(e.scope) ? new _a5(e.scope).id : e.scope : c.root.name, this._entity = e.entity, this._id = I.isNumber(e.id) ? W.formatWithLeadingZeros(e.id) : e.id, this._version = e.version, this._shard = e.shard;
155
155
  }
156
156
  toString() {
157
157
  return `${this.concept}@${this.scope}:${this.entity}:${this.shard ? this.shard + "." + this.id : this.id}${this.version ? "@" + this.version : ""}`;
@@ -262,10 +262,10 @@ var j = (_a8 = class extends Error {
262
262
  return P.toKebabCase(this.name);
263
263
  }
264
264
  static get concept() {
265
- return _.concept;
265
+ return c.concept;
266
266
  }
267
267
  static get scope() {
268
- return _.root.name;
268
+ return c.root.name;
269
269
  }
270
270
  constructor(e, t4) {
271
271
  switch (true) {
@@ -416,10 +416,10 @@ var ke = (_a10 = class {
416
416
  return P.toKebabCase(this.name);
417
417
  }
418
418
  static get concept() {
419
- return _.concept;
419
+ return c.concept;
420
420
  }
421
421
  static get scope() {
422
- return _.root.name;
422
+ return c.root.name;
423
423
  }
424
424
  constructor(e) {
425
425
  this.getInitializer(e).call(this, e);
@@ -485,7 +485,7 @@ p(ke, "A_Entity");
485
485
  var D = ke;
486
486
  function je(u2) {
487
487
  return function(e) {
488
- return _.setMeta(e, new u2()), e;
488
+ return c.setMeta(e, new u2()), e;
489
489
  };
490
490
  }
491
491
  __name(je, "je");
@@ -594,10 +594,10 @@ var Le = (_a13 = class {
594
594
  return this.config?.name || this.constructor.name;
595
595
  }
596
596
  get scope() {
597
- return _.scope(this);
597
+ return c.scope(this);
598
598
  }
599
599
  constructor(e = {}) {
600
- this.config = e, _.allocate(this, this.config);
600
+ this.config = e, c.allocate(this, this.config);
601
601
  }
602
602
  async call(e, t4) {
603
603
  return await new N({ name: e, component: this }).process(t4);
@@ -618,8 +618,8 @@ var ze = (_a14 = class extends f {
618
618
  let t4 = [], r8 = this.get("a-container-abstractions"), n6 = this.get("a-container-injections");
619
619
  return r8?.find(`CONCEPT_ABSTRACTION::${e}`).forEach(([o3, s4]) => {
620
620
  s4.forEach((a4) => {
621
- let c3 = n6?.get(a4.handler) || [];
622
- t4.push({ ...a4, args: c3 });
621
+ let _4 = n6?.get(a4.handler) || [];
622
+ t4.push({ ...a4, args: _4 });
623
623
  });
624
624
  }), t4;
625
625
  }
@@ -818,8 +818,8 @@ function Je(...u2) {
818
818
  s4 = "a-component-injections";
819
819
  break;
820
820
  }
821
- let a4 = _.meta(e).get(s4), c3 = a4 ? a4.clone() : new f(), d4 = c3.get(o3) ? [...c3.get(o3)] : [];
822
- d4[r8].resolutionStrategy = { create: true, args: u2 }, c3.set(o3, d4), _.meta(e).set(s4, c3);
821
+ let a4 = c.meta(e).get(s4), _4 = a4 ? a4.clone() : new f(), d4 = _4.get(o3) ? [..._4.get(o3)] : [];
822
+ d4[r8].resolutionStrategy = { create: true, args: u2 }, _4.set(o3, d4), c.meta(e).set(s4, _4);
823
823
  };
824
824
  }
825
825
  __name(Je, "Je");
@@ -840,8 +840,8 @@ function Ke() {
840
840
  o3 = "a-component-injections";
841
841
  break;
842
842
  }
843
- let s4 = _.meta(u2).get(o3), a4 = s4 ? s4.clone() : new f(), c3 = a4.get(n6) ? [...a4.get(n6)] : [];
844
- c3[t4].resolutionStrategy = { flat: true }, a4.set(n6, c3), _.meta(u2).set(o3, a4);
843
+ let s4 = c.meta(u2).get(o3), a4 = s4 ? s4.clone() : new f(), _4 = a4.get(n6) ? [...a4.get(n6)] : [];
844
+ _4[t4].resolutionStrategy = { flat: true }, a4.set(n6, _4), c.meta(u2).set(o3, a4);
845
845
  };
846
846
  }
847
847
  __name(Ke, "Ke");
@@ -862,8 +862,8 @@ function qe() {
862
862
  o3 = "a-component-injections";
863
863
  break;
864
864
  }
865
- let s4 = _.meta(u2).get(o3), a4 = s4 ? s4.clone() : new f(), c3 = a4.get(n6) ? [...a4.get(n6)] : [];
866
- c3[t4].resolutionStrategy = { load: true }, a4.set(n6, c3), _.meta(u2).set(o3, a4);
865
+ let s4 = c.meta(u2).get(o3), a4 = s4 ? s4.clone() : new f(), _4 = a4.get(n6) ? [...a4.get(n6)] : [];
866
+ _4[t4].resolutionStrategy = { load: true }, a4.set(n6, _4), c.meta(u2).set(o3, a4);
867
867
  };
868
868
  }
869
869
  __name(qe, "qe");
@@ -884,8 +884,8 @@ function Be(u2 = -1) {
884
884
  s4 = "a-component-injections";
885
885
  break;
886
886
  }
887
- let a4 = _.meta(e).get(s4), c3 = a4 ? a4.clone() : new f(), d4 = c3.get(o3) ? [...c3.get(o3)] : [];
888
- d4[r8].resolutionStrategy = { parent: u2 }, c3.set(o3, d4), _.meta(e).set(s4, c3);
887
+ let a4 = c.meta(e).get(s4), _4 = a4 ? a4.clone() : new f(), d4 = _4.get(o3) ? [..._4.get(o3)] : [];
888
+ d4[r8].resolutionStrategy = { parent: u2 }, _4.set(o3, d4), c.meta(e).set(s4, _4);
889
889
  };
890
890
  }
891
891
  __name(Be, "Be");
@@ -906,8 +906,8 @@ function We() {
906
906
  o3 = "a-component-injections";
907
907
  break;
908
908
  }
909
- let s4 = _.meta(u2).get(o3), a4 = s4 ? s4.clone() : new f(), c3 = a4.get(n6) ? [...a4.get(n6)] : [];
910
- c3[t4].resolutionStrategy = { require: true }, a4.set(n6, c3), _.meta(u2).set(o3, a4);
909
+ let s4 = c.meta(u2).get(o3), a4 = s4 ? s4.clone() : new f(), _4 = a4.get(n6) ? [...a4.get(n6)] : [];
910
+ _4[t4].resolutionStrategy = { require: true }, a4.set(n6, _4), c.meta(u2).set(o3, a4);
911
911
  };
912
912
  }
913
913
  __name(We, "We");
@@ -928,8 +928,8 @@ function He() {
928
928
  o3 = "a-component-injections";
929
929
  break;
930
930
  }
931
- let s4 = _.meta(u2).get(o3), a4 = s4 ? s4.clone() : new f(), c3 = a4.get(n6) ? [...a4.get(n6)] : [];
932
- c3[t4].resolutionStrategy = { pagination: { ...c3[t4].resolutionStrategy.pagination, count: -1 } }, a4.set(n6, c3), _.meta(u2).set(o3, a4);
931
+ let s4 = c.meta(u2).get(o3), a4 = s4 ? s4.clone() : new f(), _4 = a4.get(n6) ? [...a4.get(n6)] : [];
932
+ _4[t4].resolutionStrategy = { pagination: { ..._4[t4].resolutionStrategy.pagination, count: -1 } }, a4.set(n6, _4), c.meta(u2).set(o3, a4);
933
933
  };
934
934
  }
935
935
  __name(He, "He");
@@ -950,8 +950,8 @@ function Ge(u2, e) {
950
950
  a4 = "a-component-injections";
951
951
  break;
952
952
  }
953
- let c3 = _.meta(t4).get(a4), d4 = c3 ? c3.clone() : new f(), m6 = d4.get(s4) ? [...d4.get(s4)] : [];
954
- m6[n6].resolutionStrategy = { query: { ...m6[n6].resolutionStrategy.query, ...u2 }, pagination: { ...m6[n6].resolutionStrategy.pagination, ...e } }, d4.set(s4, m6), _.meta(t4).set(a4, d4);
953
+ let _4 = c.meta(t4).get(a4), d4 = _4 ? _4.clone() : new f(), m6 = d4.get(s4) ? [...d4.get(s4)] : [];
954
+ m6[n6].resolutionStrategy = { query: { ...m6[n6].resolutionStrategy.query, ...u2 }, pagination: { ...m6[n6].resolutionStrategy.pagination, ...e } }, d4.set(s4, m6), c.meta(t4).set(a4, d4);
955
955
  };
956
956
  }
957
957
  __name(Ge, "Ge");
@@ -1165,7 +1165,7 @@ function Xe(u2 = {}) {
1165
1165
  return function(e, t4, r8) {
1166
1166
  let n6 = A.getComponentName(e);
1167
1167
  if (!i.isAllowedForFeatureDefinition(e)) throw new T(T.FeatureDefinitionError, `A-Feature cannot be defined on the ${n6} level`);
1168
- let o3 = _.meta(e.constructor), s4;
1168
+ let o3 = c.meta(e.constructor), s4;
1169
1169
  switch (true) {
1170
1170
  case i.isEntityInstance(e):
1171
1171
  s4 = "a-component-features";
@@ -1177,13 +1177,13 @@ function Xe(u2 = {}) {
1177
1177
  s4 = "a-component-features";
1178
1178
  break;
1179
1179
  }
1180
- let a4 = o3.get(s4) || new f(), c3 = u2.name || t4, d4 = u2.invoke || false;
1181
- a4.set(t4, { name: `${e.constructor.name}.${c3}`, handler: t4, invoke: d4, template: u2.template && u2.template.length ? u2.template.map((g4) => ({ ...g4, before: g4.before || "", after: g4.after || "", behavior: g4.behavior || "sync", throwOnError: true, override: g4.override || "" })) : [] }), _.meta(e.constructor).set(s4, a4);
1180
+ let a4 = o3.get(s4) || new f(), _4 = u2.name || t4, d4 = u2.invoke || false;
1181
+ a4.set(t4, { name: `${e.constructor.name}.${_4}`, handler: t4, invoke: d4, template: u2.template && u2.template.length ? u2.template.map((g4) => ({ ...g4, before: g4.before || "", after: g4.after || "", behavior: g4.behavior || "sync", throwOnError: true, override: g4.override || "" })) : [] }), c.meta(e.constructor).set(s4, a4);
1182
1182
  let m6 = r8.value;
1183
1183
  return r8.value = function(...g4) {
1184
1184
  if (d4) m6.apply(this, g4);
1185
1185
  else return m6.apply(this, g4);
1186
- if (typeof this.call == "function" && d4) return this.call(c3);
1186
+ if (typeof this.call == "function" && d4) return this.call(_4);
1187
1187
  }, r8;
1188
1188
  };
1189
1189
  }
@@ -1193,7 +1193,7 @@ function Qe(u2) {
1193
1193
  return function(e, t4, r8) {
1194
1194
  let n6 = A.getComponentName(e);
1195
1195
  if (!i.isAllowedForFeatureExtension(e)) throw new T(T.FeatureExtensionError, `A-Feature-Extend cannot be applied on the ${n6} level`);
1196
- let o3, s4 = "sync", a4 = "", c3 = "", d4 = "", m6 = [], g4 = [], F3 = true, L2;
1196
+ let o3, s4 = "sync", a4 = "", _4 = "", d4 = "", m6 = [], g4 = [], v6 = true, L2;
1197
1197
  switch (true) {
1198
1198
  case i.isEntityInstance(e):
1199
1199
  L2 = "a-component-extensions";
@@ -1210,13 +1210,13 @@ function Qe(u2) {
1210
1210
  o3 = u2;
1211
1211
  break;
1212
1212
  case (!!u2 && typeof u2 == "object"):
1213
- Array.isArray(u2.scope) ? m6 = u2.scope : u2.scope && typeof u2.scope == "object" && (Array.isArray(u2.scope.include) && (m6 = u2.scope.include), Array.isArray(u2.scope.exclude) && (g4 = u2.scope.exclude)), o3 = gt(u2, m6, g4, t4), s4 = u2.behavior || s4, F3 = u2.throwOnError !== void 0 ? u2.throwOnError : F3, a4 = i.isArray(u2.before) ? new RegExp(`^${u2.before.join("|").replace(/\./g, "\\.")}$`).source : u2.before instanceof RegExp ? u2.before.source : "", c3 = i.isArray(u2.after) ? new RegExp(`^${u2.after.join("|").replace(/\./g, "\\.")}$`).source : u2.after instanceof RegExp ? u2.after.source : "", d4 = i.isArray(u2.override) ? new RegExp(`^${u2.override.join("|").replace(/\./g, "\\.")}$`).source : u2.override instanceof RegExp ? u2.override.source : "";
1213
+ Array.isArray(u2.scope) ? m6 = u2.scope : u2.scope && typeof u2.scope == "object" && (Array.isArray(u2.scope.include) && (m6 = u2.scope.include), Array.isArray(u2.scope.exclude) && (g4 = u2.scope.exclude)), o3 = gt(u2, m6, g4, t4), s4 = u2.behavior || s4, v6 = u2.throwOnError !== void 0 ? u2.throwOnError : v6, a4 = i.isArray(u2.before) ? new RegExp(`^${u2.before.join("|").replace(/\./g, "\\.")}$`).source : u2.before instanceof RegExp ? u2.before.source : "", _4 = i.isArray(u2.after) ? new RegExp(`^${u2.after.join("|").replace(/\./g, "\\.")}$`).source : u2.after instanceof RegExp ? u2.after.source : "", d4 = i.isArray(u2.override) ? new RegExp(`^${u2.override.join("|").replace(/\./g, "\\.")}$`).source : u2.override instanceof RegExp ? u2.override.source : "";
1214
1214
  break;
1215
1215
  default:
1216
1216
  o3 = new RegExp(`^.*${t4.replace(/\./g, "\\.")}$`);
1217
1217
  break;
1218
1218
  }
1219
- let ae = _.meta(e).get(L2), ge = _.meta(e), K2 = ge.get(L2) ? new f().from(ge.get(L2)) : new f();
1219
+ let ae = c.meta(e).get(L2), ge = c.meta(e), K2 = ge.get(L2) ? new f().from(ge.get(L2)) : new f();
1220
1220
  if (ae && ae.size() && ae.has(t4) && ae.get(t4).invoke) throw new T(T.FeatureExtensionError, `A-Feature-Extend cannot be used on the method "${t4}" because it is already defined as a Feature with "invoke" set to true. Please remove the A-Feature-Extend decorator or set "invoke" to false in the A-Feature decorator.`);
1221
1221
  let fe = [...K2.get(o3.source) || []], E3 = u2 && typeof u2 == "object" && !i.isRegExp(u2) && u2.name || t4;
1222
1222
  for (let [q2, H] of K2.entries()) {
@@ -1226,8 +1226,8 @@ function Qe(u2) {
1226
1226
  (Z ? Z[1] : null) === E3 && (H.splice(G2, 1), H.length === 0 ? K2.delete(q2) : K2.set(q2, H));
1227
1227
  }
1228
1228
  }
1229
- let C3 = fe.findIndex((q2) => q2.handler === t4), _e2 = { name: o3.source, handler: t4, behavior: s4, before: a4, after: c3, throwOnError: F3, override: d4 };
1230
- C3 !== -1 ? fe[C3] = _e2 : fe.push(_e2), K2.set(o3.source, fe), _.meta(e).set(L2, K2);
1229
+ let C3 = fe.findIndex((q2) => q2.handler === t4), _e2 = { name: o3.source, handler: t4, behavior: s4, before: a4, after: _4, throwOnError: v6, override: d4 };
1230
+ C3 !== -1 ? fe[C3] = _e2 : fe.push(_e2), K2.set(o3.source, fe), c.meta(e).set(L2, K2);
1231
1231
  };
1232
1232
  }
1233
1233
  __name(Qe, "Qe");
@@ -1273,7 +1273,7 @@ var et = (_a24 = class {
1273
1273
  }
1274
1274
  getStepArgs(e, t4) {
1275
1275
  let r8 = t4.dependency.target || e.resolveConstructor(t4.dependency.name), n6 = this._feature.caller?.component;
1276
- return _.meta(r8).injections(t4.handler).map((o3) => {
1276
+ return c.meta(r8).injections(t4.handler).map((o3) => {
1277
1277
  switch (true) {
1278
1278
  case i.isCallerConstructor(o3.target):
1279
1279
  return this._feature.caller.component;
@@ -1334,11 +1334,11 @@ var et = (_a24 = class {
1334
1334
  return;
1335
1335
  }
1336
1336
  let { handler: n6, params: o3 } = r8, s4 = n6(...o3);
1337
- if (i.isPromiseInstance(s4)) return new Promise(async (a4, c3) => {
1337
+ if (i.isPromiseInstance(s4)) return new Promise(async (a4, _4) => {
1338
1338
  try {
1339
1339
  return await s4, this.completed(), a4();
1340
1340
  } catch (d4) {
1341
- return this.failed(d4), this._definition.throwOnError ? a4() : c3(d4);
1341
+ return this.failed(d4), this._definition.throwOnError ? a4() : _4(d4);
1342
1342
  }
1343
1343
  });
1344
1344
  this.completed();
@@ -1466,7 +1466,7 @@ var Se = (_a27 = class {
1466
1466
  return this._caller;
1467
1467
  }
1468
1468
  get scope() {
1469
- return this._scopeAllocated || (this._scopeAllocated = true, _.allocate(this).inherit(this._effectiveScope)), _.scope(this);
1469
+ return this._scopeAllocated || (this._scopeAllocated = true, c.allocate(this).inherit(this._effectiveScope)), c.scope(this);
1470
1470
  }
1471
1471
  get size() {
1472
1472
  return this._stages.length;
@@ -1499,26 +1499,26 @@ var Se = (_a27 = class {
1499
1499
  this._name = e.name;
1500
1500
  let t4, r8 = e.scope;
1501
1501
  try {
1502
- e.component && (t4 = _.scope(e.component));
1502
+ e.component && (t4 = c.scope(e.component));
1503
1503
  } catch (o3) {
1504
1504
  if (!r8) throw o3;
1505
1505
  }
1506
1506
  t4 && r8 && !r8.isInheritedFrom(t4) && r8.inherit(t4), this._caller = new te(e.component || new O()), this._effectiveScope = t4 || r8;
1507
- let n6 = _.getSortedStepsFor(e.template);
1508
- n6 || (this._SM = new me(e.template), n6 = this._SM.toSortedSteps(), _.setSortedStepsFor(e.template, n6)), this._stages = n6.map((o3) => new ne(this, o3)), this._current = this._stages[0];
1507
+ let n6 = c.getSortedStepsFor(e.template);
1508
+ n6 || (this._SM = new me(e.template), n6 = this._SM.toSortedSteps(), c.setSortedStepsFor(e.template, n6)), this._stages = n6.map((o3) => new ne(this, o3)), this._current = this._stages[0];
1509
1509
  }
1510
1510
  fromComponent(e) {
1511
1511
  if (!e.component || !i.isAllowedForFeatureDefinition(e.component)) throw new T(T.FeatureInitializationError, `Invalid A-Feature component provided of type: ${typeof e.component} with value: ${JSON.stringify(e.component)?.slice(0, 100)}...`);
1512
1512
  this._name = e.name;
1513
1513
  let t4, r8 = e.scope;
1514
1514
  try {
1515
- t4 = _.scope(e.component);
1515
+ t4 = c.scope(e.component);
1516
1516
  } catch (a4) {
1517
1517
  if (!r8) throw a4;
1518
1518
  }
1519
1519
  t4 && r8 && !r8.isInheritedFrom(t4) && r8.inherit(t4), this._caller = new te(e.component);
1520
- let n6 = t4 || r8, o3 = _.featureTemplate(this._name, this._caller.component, n6), s4 = _.getSortedStepsFor(o3);
1521
- s4 || (this._SM = new me(o3), s4 = this._SM.toSortedSteps(), _.setSortedStepsFor(o3, s4)), this._effectiveScope = n6, this._stages = s4.map((a4) => new ne(this, a4)), this._current = this._stages[0];
1520
+ let n6 = t4 || r8, o3 = c.featureTemplate(this._name, this._caller.component, n6), s4 = c.getSortedStepsFor(o3);
1521
+ s4 || (this._SM = new me(o3), s4 = this._SM.toSortedSteps(), c.setSortedStepsFor(o3, s4)), this._effectiveScope = n6, this._stages = s4.map((a4) => new ne(this, a4)), this._current = this._stages[0];
1522
1522
  }
1523
1523
  process(e) {
1524
1524
  try {
@@ -1591,8 +1591,8 @@ var Se = (_a27 = class {
1591
1591
  let s4 = o3 || this.scope;
1592
1592
  n6._caller = this._caller;
1593
1593
  let a4 = n6.process(s4);
1594
- return i.isPromiseInstance(a4) ? a4.catch((c3) => {
1595
- throw c3;
1594
+ return i.isPromiseInstance(a4) ? a4.catch((_4) => {
1595
+ throw _4;
1596
1596
  }) : a4;
1597
1597
  }
1598
1598
  toString() {
@@ -1630,8 +1630,8 @@ var ot = (_a29 = class extends f {
1630
1630
  let t4 = [], r8 = this.get("a-component-abstractions"), n6 = this.get("a-component-injections");
1631
1631
  return r8?.find(`CONCEPT_ABSTRACTION::${e}`).forEach(([o3, s4]) => {
1632
1632
  s4.forEach((a4) => {
1633
- let c3 = n6?.get(a4.handler) || [];
1634
- t4.push({ ...a4, args: c3 });
1633
+ let _4 = n6?.get(a4.handler) || [];
1634
+ t4.push({ ...a4, args: _4 });
1635
1635
  });
1636
1636
  }), t4;
1637
1637
  }
@@ -1750,8 +1750,8 @@ var st = (_a30 = class {
1750
1750
  t4.push("AR:" + s4.join(","));
1751
1751
  let a4 = Array.from(this._imports).map((m6) => m6.computeFingerprint(e)).sort();
1752
1752
  t4.push("I:" + a4.join(","));
1753
- let c3 = t4.join("|"), d4 = 5381;
1754
- for (let m6 = 0; m6 < c3.length; m6++) d4 = (d4 << 5) + d4 + c3.charCodeAt(m6) | 0;
1753
+ let _4 = t4.join("|"), d4 = 5381;
1754
+ for (let m6 = 0; m6 < _4.length; m6++) d4 = (d4 << 5) + d4 + _4.charCodeAt(m6) | 0;
1755
1755
  return (d4 >>> 0).toString(16);
1756
1756
  }
1757
1757
  *parents() {
@@ -1794,7 +1794,7 @@ var st = (_a30 = class {
1794
1794
  });
1795
1795
  }
1796
1796
  destroy() {
1797
- this._components.forEach((e) => _.deregister(e)), this._fragments.forEach((e) => _.deregister(e)), this._entities.forEach((e) => _.deregister(e)), this._components.clear(), this._errors.clear(), this._fragments.clear(), this._entities.clear(), this._allowedComponents.clear(), this._allowedFragments.clear(), this._allowedEntities.clear(), this._allowedErrors.clear();
1797
+ this._components.forEach((e) => c.deregister(e)), this._fragments.forEach((e) => c.deregister(e)), this._entities.forEach((e) => c.deregister(e)), this._components.clear(), this._errors.clear(), this._fragments.clear(), this._entities.clear(), this._allowedComponents.clear(), this._allowedFragments.clear(), this._allowedEntities.clear(), this._allowedErrors.clear();
1798
1798
  for (let e of this._imports) e._removeSubscriber(this);
1799
1799
  if (this._imports.clear(), this._parent && (this._parent._removeSubscriber(this), this._parent = void 0), this._subscribers.size > 0) {
1800
1800
  for (let e of this._subscribers) {
@@ -1803,7 +1803,7 @@ var st = (_a30 = class {
1803
1803
  }
1804
1804
  this._subscribers.clear();
1805
1805
  }
1806
- this.issuer() && _.deallocate(this), this.bumpVersion();
1806
+ this.issuer() && c.deallocate(this), this.bumpVersion();
1807
1807
  }
1808
1808
  get(e) {
1809
1809
  return this._meta.get(e);
@@ -1812,7 +1812,7 @@ var st = (_a30 = class {
1812
1812
  this._meta.set(e, t4);
1813
1813
  }
1814
1814
  issuer() {
1815
- return _.issuer(this);
1815
+ return c.issuer(this);
1816
1816
  }
1817
1817
  inherit(e) {
1818
1818
  if (!e) throw new S(S.InitializationError, "Invalid parent scope provided");
@@ -1852,22 +1852,22 @@ var st = (_a30 = class {
1852
1852
  break;
1853
1853
  }
1854
1854
  case i.isComponentConstructor(e): {
1855
- t4 = this.isAllowedComponent(e) || !!_.findDescendantIn(e, this.allowedComponents);
1855
+ t4 = this.isAllowedComponent(e) || !!c.findDescendantIn(e, this.allowedComponents);
1856
1856
  break;
1857
1857
  }
1858
1858
  case i.isEntityConstructor(e): {
1859
- t4 = this.isAllowedEntity(e) || !!_.findDescendantIn(e, this.allowedEntities);
1859
+ t4 = this.isAllowedEntity(e) || !!c.findDescendantIn(e, this.allowedEntities);
1860
1860
  break;
1861
1861
  }
1862
1862
  case i.isFragmentConstructor(e): {
1863
- t4 = this.isAllowedFragment(e) || !!_.findDescendantIn(e, this.allowedFragments);
1863
+ t4 = this.isAllowedFragment(e) || !!c.findDescendantIn(e, this.allowedFragments);
1864
1864
  break;
1865
1865
  }
1866
1866
  case i.isErrorConstructor(e): {
1867
- t4 = this.isAllowedError(e) || !!_.findDescendantIn(e, this.allowedErrors);
1867
+ t4 = this.isAllowedError(e) || !!c.findDescendantIn(e, this.allowedErrors);
1868
1868
  break;
1869
1869
  }
1870
- case (this.issuer() && (this.issuer().constructor === e || _.isIndexedInheritedFrom(this.issuer().constructor, e))): {
1870
+ case (this.issuer() && (this.issuer().constructor === e || c.isIndexedInheritedFrom(this.issuer().constructor, e))): {
1871
1871
  t4 = true;
1872
1872
  break;
1873
1873
  }
@@ -1905,21 +1905,21 @@ var st = (_a30 = class {
1905
1905
  if (e.require && !t4.length) throw new S(S.ResolutionError, `Dependency ${e.name} is required but could not be resolved in scope ${r8.name}`);
1906
1906
  e.query.aseid ? t4 = t4.filter((d4) => i.hasASEID(d4) && w.compare(d4.aseid, e.query.aseid)) : Object.keys(e.query).length > 0 && (t4 = t4.filter((d4) => {
1907
1907
  let m6 = e.query;
1908
- return m6 ? Object.entries(m6).every(([g4, F3]) => d4[g4] === F3) : true;
1908
+ return m6 ? Object.entries(m6).every(([g4, v6]) => d4[g4] === v6) : true;
1909
1909
  }));
1910
- let n6 = e.pagination.count, o3 = e.pagination.from, s4 = o3 === "end" ? n6 === -1 ? 0 : Math.max(t4.length - n6, 0) : 0, a4 = o3 === "end" || n6 === -1 ? t4.length : Math.min(n6, t4.length), c3 = t4.slice(s4, a4);
1911
- return n6 === -1 ? c3 : c3.length === 1 ? c3[0] : c3.length ? c3 : void 0;
1910
+ let n6 = e.pagination.count, o3 = e.pagination.from, s4 = o3 === "end" ? n6 === -1 ? 0 : Math.max(t4.length - n6, 0) : 0, a4 = o3 === "end" || n6 === -1 ? t4.length : Math.min(n6, t4.length), _4 = t4.slice(s4, a4);
1911
+ return n6 === -1 ? _4 : _4.length === 1 ? _4[0] : _4.length ? _4 : void 0;
1912
1912
  }
1913
1913
  resolveConstructor(e) {
1914
1914
  switch (true) {
1915
1915
  case i.isComponentConstructor(e):
1916
- return _.findDescendantIn(e, this.allowedComponents);
1916
+ return c.findDescendantIn(e, this.allowedComponents);
1917
1917
  case i.isEntityConstructor(e):
1918
- return _.findDescendantIn(e, this.allowedEntities);
1918
+ return c.findDescendantIn(e, this.allowedEntities);
1919
1919
  case i.isFragmentConstructor(e):
1920
- return _.findDescendantIn(e, this.allowedFragments);
1920
+ return c.findDescendantIn(e, this.allowedFragments);
1921
1921
  case i.isErrorConstructor(e):
1922
- return _.findDescendantIn(e, this.allowedErrors);
1922
+ return c.findDescendantIn(e, this.allowedErrors);
1923
1923
  }
1924
1924
  if (!i.isString(e)) throw new S(S.ResolutionError, `Invalid constructor name provided: ${e}`);
1925
1925
  let t4 = e;
@@ -1935,9 +1935,9 @@ var st = (_a30 = class {
1935
1935
  if (t4) return t4;
1936
1936
  {
1937
1937
  let o3 = P.toPascalCase(e), s4 = Array.from(this.allowedComponents).find((a4) => {
1938
- let c3 = _.getAncestors(a4);
1939
- if (!c3) return false;
1940
- for (let d4 of c3) if (d4.name === e || d4.name === o3) return true;
1938
+ let _4 = c.getAncestors(a4);
1939
+ if (!_4) return false;
1940
+ for (let d4 of _4) if (d4.name === e || d4.name === o3) return true;
1941
1941
  return false;
1942
1942
  });
1943
1943
  if (s4) return s4;
@@ -1946,9 +1946,9 @@ var st = (_a30 = class {
1946
1946
  if (r8) return r8;
1947
1947
  {
1948
1948
  let o3 = P.toPascalCase(e), s4 = Array.from(this.allowedEntities).find((a4) => {
1949
- let c3 = _.getAncestors(a4);
1950
- if (!c3) return false;
1951
- for (let d4 of c3) if (d4.name === e || d4.name === o3) return true;
1949
+ let _4 = c.getAncestors(a4);
1950
+ if (!_4) return false;
1951
+ for (let d4 of _4) if (d4.name === e || d4.name === o3) return true;
1952
1952
  return false;
1953
1953
  });
1954
1954
  if (s4) return s4;
@@ -1957,9 +1957,9 @@ var st = (_a30 = class {
1957
1957
  if (n6) return n6;
1958
1958
  {
1959
1959
  let o3 = P.toPascalCase(e), s4 = Array.from(this.allowedFragments).find((a4) => {
1960
- let c3 = _.getAncestors(a4);
1961
- if (!c3) return false;
1962
- for (let d4 of c3) if (d4.name === e || d4.name === o3) return true;
1960
+ let _4 = c.getAncestors(a4);
1961
+ if (!_4) return false;
1962
+ for (let d4 of _4) if (d4.name === e || d4.name === o3) return true;
1963
1963
  return false;
1964
1964
  });
1965
1965
  if (s4) return s4;
@@ -1973,12 +1973,12 @@ var st = (_a30 = class {
1973
1973
  resolveAll(e) {
1974
1974
  if (this._resolveAllCache.has(e)) return this._resolveAllCache.get(e);
1975
1975
  if (i.isContainerConstructor(e)) {
1976
- let s4 = _.containers(e);
1976
+ let s4 = c.containers(e);
1977
1977
  return this._resolveAllCache.set(e, s4), s4;
1978
1978
  }
1979
1979
  let t4 = /* @__PURE__ */ new Set();
1980
1980
  this.resolveFlatAll(e).forEach((s4) => t4.add(s4)), this._imports.forEach((s4) => {
1981
- s4.has(e) && s4.resolveFlatAll(e).forEach((c3) => t4.add(c3));
1981
+ s4.has(e) && s4.resolveFlatAll(e).forEach((_4) => t4.add(_4));
1982
1982
  });
1983
1983
  let n6 = this._parent;
1984
1984
  for (; n6 && n6.has(e); ) n6.resolveAll(e).forEach((a4) => t4.add(a4)), n6 = n6._parent;
@@ -1991,7 +1991,7 @@ var st = (_a30 = class {
1991
1991
  switch (true) {
1992
1992
  case i.isComponentConstructor(e): {
1993
1993
  this.allowedComponents.forEach((r8) => {
1994
- if (_.isIndexedInheritedFrom(r8, e)) {
1994
+ if (c.isIndexedInheritedFrom(r8, e)) {
1995
1995
  let n6 = this.resolveOnce(r8);
1996
1996
  n6 && t4.push(n6);
1997
1997
  }
@@ -2000,7 +2000,7 @@ var st = (_a30 = class {
2000
2000
  }
2001
2001
  case i.isFragmentConstructor(e): {
2002
2002
  this.allowedFragments.forEach((r8) => {
2003
- if (_.isIndexedInheritedFrom(r8, e)) {
2003
+ if (c.isIndexedInheritedFrom(r8, e)) {
2004
2004
  let n6 = this.resolveOnce(r8);
2005
2005
  n6 && t4.push(n6);
2006
2006
  }
@@ -2009,7 +2009,7 @@ var st = (_a30 = class {
2009
2009
  }
2010
2010
  case i.isEntityConstructor(e): {
2011
2011
  this.entities.forEach((r8) => {
2012
- _.isIndexedInheritedFrom(r8.constructor, e) && t4.push(r8);
2012
+ c.isIndexedInheritedFrom(r8.constructor, e) && t4.push(r8);
2013
2013
  });
2014
2014
  break;
2015
2015
  }
@@ -2045,7 +2045,7 @@ var st = (_a30 = class {
2045
2045
  if (r8) return this._resolveCache.set(e, r8), r8;
2046
2046
  }
2047
2047
  if (!t4 && i.isContainerConstructor(e)) {
2048
- let n6 = _.containers(e)[0];
2048
+ let n6 = c.containers(e)[0];
2049
2049
  return this._resolveCache.set(e, n6), n6;
2050
2050
  }
2051
2051
  return this._resolveCache.set(e, t4), t4;
@@ -2103,7 +2103,7 @@ var st = (_a30 = class {
2103
2103
  }
2104
2104
  resolveIssuer(e) {
2105
2105
  let t4 = this.issuer();
2106
- if (t4 && (t4.constructor === e || _.isIndexedInheritedFrom(t4?.constructor, e))) return t4;
2106
+ if (t4 && (t4.constructor === e || c.isIndexedInheritedFrom(t4?.constructor, e))) return t4;
2107
2107
  }
2108
2108
  resolveEntity(e) {
2109
2109
  return this.entities.find((t4) => t4 instanceof e);
@@ -2117,7 +2117,7 @@ var st = (_a30 = class {
2117
2117
  case (t4 && this._fragments.has(e)):
2118
2118
  return t4;
2119
2119
  case !t4: {
2120
- let r8 = _.findDescendantIn(e, this._allowedFragments);
2120
+ let r8 = c.findDescendantIn(e, this._allowedFragments);
2121
2121
  return r8 ? this.resolveFragment(r8) : void 0;
2122
2122
  }
2123
2123
  default:
@@ -2132,11 +2132,11 @@ var st = (_a30 = class {
2132
2132
  case (this.allowedComponents.has(e) && this._components.has(e)):
2133
2133
  return this._components.get(e);
2134
2134
  case (this.allowedComponents.has(e) && !this._components.has(e)): {
2135
- let n6 = (_.meta(e).get("a-component-injections")?.get("constructor") || []).map((s4) => this.resolve(s4)), o3 = new e(...n6);
2135
+ let n6 = (c.meta(e).get("a-component-injections")?.get("constructor") || []).map((s4) => this.resolve(s4)), o3 = new e(...n6);
2136
2136
  return this.register(o3), this._components.get(e);
2137
2137
  }
2138
2138
  case !this.allowedComponents.has(e): {
2139
- let t4 = _.findDescendantIn(e, this.allowedComponents);
2139
+ let t4 = c.findDescendantIn(e, this.allowedComponents);
2140
2140
  return t4 ? this.resolveComponent(t4) : void 0;
2141
2141
  }
2142
2142
  default:
@@ -2146,35 +2146,35 @@ var st = (_a30 = class {
2146
2146
  register(e) {
2147
2147
  switch (true) {
2148
2148
  case e instanceof O: {
2149
- _.indexConstructor(e.constructor), _.register(this, e), this.allowedComponents.has(e.constructor) || this.allowedComponents.add(e.constructor), this._components.set(e.constructor, e), this.bumpVersion();
2149
+ c.indexConstructor(e.constructor), c.register(this, e), this.allowedComponents.has(e.constructor) || this.allowedComponents.add(e.constructor), this._components.set(e.constructor, e), this.bumpVersion();
2150
2150
  break;
2151
2151
  }
2152
2152
  case (i.isEntityInstance(e) && !this._entities.has(e.aseid.toString())): {
2153
- _.indexConstructor(e.constructor), _.register(this, e), this.allowedEntities.has(e.constructor) || this.allowedEntities.add(e.constructor), this._entities.set(e.aseid.toString(), e), this.bumpVersion();
2153
+ c.indexConstructor(e.constructor), c.register(this, e), this.allowedEntities.has(e.constructor) || this.allowedEntities.add(e.constructor), this._entities.set(e.aseid.toString(), e), this.bumpVersion();
2154
2154
  break;
2155
2155
  }
2156
2156
  case i.isFragmentInstance(e): {
2157
- _.indexConstructor(e.constructor), _.register(this, e), this.allowedFragments.has(e.constructor) || this.allowedFragments.add(e.constructor), this._fragments.set(e.constructor, e), this.bumpVersion();
2157
+ c.indexConstructor(e.constructor), c.register(this, e), this.allowedFragments.has(e.constructor) || this.allowedFragments.add(e.constructor), this._fragments.set(e.constructor, e), this.bumpVersion();
2158
2158
  break;
2159
2159
  }
2160
2160
  case i.isErrorInstance(e): {
2161
- _.indexConstructor(e.constructor), _.register(this, e), this.allowedErrors.has(e.constructor) || this.allowedErrors.add(e.constructor), this._errors.set(e.code, e), this.bumpVersion();
2161
+ c.indexConstructor(e.constructor), c.register(this, e), this.allowedErrors.has(e.constructor) || this.allowedErrors.add(e.constructor), this._errors.set(e.code, e), this.bumpVersion();
2162
2162
  break;
2163
2163
  }
2164
2164
  case i.isComponentConstructor(e): {
2165
- this.allowedComponents.has(e) || (this.allowedComponents.add(e), _.indexConstructor(e), this.bumpVersion());
2165
+ this.allowedComponents.has(e) || (this.allowedComponents.add(e), c.indexConstructor(e), this.bumpVersion());
2166
2166
  break;
2167
2167
  }
2168
2168
  case i.isFragmentConstructor(e): {
2169
- this.allowedFragments.has(e) || (this.allowedFragments.add(e), _.indexConstructor(e), this.bumpVersion());
2169
+ this.allowedFragments.has(e) || (this.allowedFragments.add(e), c.indexConstructor(e), this.bumpVersion());
2170
2170
  break;
2171
2171
  }
2172
2172
  case i.isEntityConstructor(e): {
2173
- this.allowedEntities.has(e) || (this.allowedEntities.add(e), _.indexConstructor(e), this.bumpVersion());
2173
+ this.allowedEntities.has(e) || (this.allowedEntities.add(e), c.indexConstructor(e), this.bumpVersion());
2174
2174
  break;
2175
2175
  }
2176
2176
  case i.isErrorConstructor(e): {
2177
- this.allowedErrors.has(e) || (this.allowedErrors.add(e), _.indexConstructor(e), this.bumpVersion());
2177
+ this.allowedErrors.has(e) || (this.allowedErrors.add(e), c.indexConstructor(e), this.bumpVersion());
2178
2178
  break;
2179
2179
  }
2180
2180
  default:
@@ -2189,19 +2189,19 @@ var st = (_a30 = class {
2189
2189
  deregister(e) {
2190
2190
  switch (true) {
2191
2191
  case i.isComponentInstance(e): {
2192
- this._components.delete(e.constructor), _.deregister(e), this.bumpVersion();
2192
+ this._components.delete(e.constructor), c.deregister(e), this.bumpVersion();
2193
2193
  break;
2194
2194
  }
2195
2195
  case i.isEntityInstance(e): {
2196
- this._entities.delete(e.aseid.toString()), _.deregister(e), this.bumpVersion();
2196
+ this._entities.delete(e.aseid.toString()), c.deregister(e), this.bumpVersion();
2197
2197
  break;
2198
2198
  }
2199
2199
  case i.isFragmentInstance(e): {
2200
- this._fragments.delete(e.constructor), _.deregister(e), this.bumpVersion();
2200
+ this._fragments.delete(e.constructor), c.deregister(e), this.bumpVersion();
2201
2201
  break;
2202
2202
  }
2203
2203
  case i.isErrorInstance(e): {
2204
- this._errors.delete(e.code), _.deregister(e), this.bumpVersion();
2204
+ this._errors.delete(e.code), c.deregister(e), this.bumpVersion();
2205
2205
  break;
2206
2206
  }
2207
2207
  case i.isComponentConstructor(e): {
@@ -2210,19 +2210,19 @@ var st = (_a30 = class {
2210
2210
  }
2211
2211
  case i.isFragmentConstructor(e): {
2212
2212
  this.allowedFragments.delete(e), Array.from(this._fragments.entries()).forEach(([r8, n6]) => {
2213
- _.isIndexedInheritedFrom(r8, e) && (this._fragments.delete(r8), _.deregister(n6));
2213
+ c.isIndexedInheritedFrom(r8, e) && (this._fragments.delete(r8), c.deregister(n6));
2214
2214
  }), this.bumpVersion();
2215
2215
  break;
2216
2216
  }
2217
2217
  case i.isEntityConstructor(e): {
2218
2218
  this.allowedEntities.delete(e), Array.from(this._entities.entries()).forEach(([r8, n6]) => {
2219
- _.isIndexedInheritedFrom(n6.constructor, e) && (this._entities.delete(r8), _.deregister(n6));
2219
+ c.isIndexedInheritedFrom(n6.constructor, e) && (this._entities.delete(r8), c.deregister(n6));
2220
2220
  }), this.bumpVersion();
2221
2221
  break;
2222
2222
  }
2223
2223
  case i.isErrorConstructor(e): {
2224
2224
  this.allowedErrors.delete(e), Array.from(this._errors.entries()).forEach(([r8, n6]) => {
2225
- _.isIndexedInheritedFrom(n6.constructor, e) && (this._errors.delete(r8), _.deregister(n6));
2225
+ c.isIndexedInheritedFrom(n6.constructor, e) && (this._errors.delete(r8), c.deregister(n6));
2226
2226
  }), this.bumpVersion();
2227
2227
  break;
2228
2228
  }
@@ -2284,7 +2284,7 @@ var Y = (_a32 = class extends b {
2284
2284
  p(Y, "A_ContextError"), Y.NotAllowedForScopeAllocationError = "Component is not allowed for scope allocation", Y.ComponentAlreadyHasScopeAllocatedError = "Component already has scope allocated", Y.InvalidMetaParameterError = "Invalid parameter provided to get meta", Y.InvalidScopeParameterError = "Invalid parameter provided to get scope", Y.ScopeNotFoundError = "Scope not found", Y.InvalidFeatureParameterError = "Invalid parameter provided to get feature", Y.InvalidFeatureDefinitionParameterError = "Invalid parameter provided to define feature", Y.InvalidFeatureTemplateParameterError = "Invalid parameter provided to get feature template", Y.InvalidFeatureExtensionParameterError = "Invalid parameter provided to extend feature", Y.InvalidAbstractionParameterError = "Invalid parameter provided to get abstraction", Y.InvalidAbstractionDefinitionParameterError = "Invalid parameter provided to define abstraction", Y.InvalidAbstractionTemplateParameterError = "Invalid parameter provided to get abstraction template", Y.InvalidAbstractionExtensionParameterError = "Invalid parameter provided to extend abstraction", Y.InvalidInjectionParameterError = "Invalid parameter provided to get injections", Y.InvalidExtensionParameterError = "Invalid parameter provided to get extensions", Y.InvalidRegisterParameterError = "Invalid parameter provided to register component", Y.InvalidComponentParameterError = "Invalid component provided", Y.ComponentNotRegisteredError = "Component not registered in the context", Y.InvalidDeregisterParameterError = "Invalid parameter provided to deregister component", Y.ComponentAlreadyRegisteredInOtherScopeError = "Instance already owned by another scope";
2285
2285
  var l = Y;
2286
2286
  var _a33;
2287
- var x = (_a33 = class {
2287
+ var F = (_a33 = class {
2288
2288
  constructor() {
2289
2289
  this._registry = /* @__PURE__ */ new WeakMap();
2290
2290
  this._containers = /* @__PURE__ */ new Set();
@@ -2397,9 +2397,9 @@ var x = (_a33 = class {
2397
2397
  if (!r8._metaStorage.has(n6)) {
2398
2398
  let s4, a4 = n6;
2399
2399
  for (; !s4; ) {
2400
- let c3 = Object.getPrototypeOf(a4);
2401
- if (!c3) break;
2402
- s4 = r8._metaStorage.get(c3), a4 = c3;
2400
+ let _4 = Object.getPrototypeOf(a4);
2401
+ if (!_4) break;
2402
+ s4 = r8._metaStorage.get(_4), a4 = _4;
2403
2403
  }
2404
2404
  s4 || (s4 = new o3()), r8._metaStorage.set(n6, s4.clone()), r8._metaVersion++, this.indexConstructor(n6);
2405
2405
  }
@@ -2455,30 +2455,30 @@ var x = (_a33 = class {
2455
2455
  if (s4) {
2456
2456
  let m6 = `${String(e)}::s${r8.fingerprint}::m${n6._metaVersion}`, g4 = s4.get(m6);
2457
2457
  if (g4) return g4;
2458
- let F3 = [...this.featureDefinition(e, t4), ...this.featureExtensions(e, t4, r8)];
2459
- return s4.size >= _a33.FEATURE_EXTENSIONS_CACHE_MAX_SIZE && s4.clear(), s4.set(m6, F3), F3;
2458
+ let v6 = [...this.featureDefinition(e, t4), ...this.featureExtensions(e, t4, r8)];
2459
+ return s4.size >= _a33.FEATURE_EXTENSIONS_CACHE_MAX_SIZE && s4.clear(), s4.set(m6, v6), v6;
2460
2460
  }
2461
- let a4 = `${String(e)}::s${r8.fingerprint}::m${n6._metaVersion}`, c3 = [...this.featureDefinition(e, t4), ...this.featureExtensions(e, t4, r8)], d4 = /* @__PURE__ */ new Map();
2462
- return d4.set(a4, c3), n6._featureCache.set(o3, d4), c3;
2461
+ let a4 = `${String(e)}::s${r8.fingerprint}::m${n6._metaVersion}`, _4 = [...this.featureDefinition(e, t4), ...this.featureExtensions(e, t4, r8)], d4 = /* @__PURE__ */ new Map();
2462
+ return d4.set(a4, _4), n6._featureCache.set(o3, d4), _4;
2463
2463
  }
2464
2464
  static featureExtensions(e, t4, r8) {
2465
2465
  let n6 = this.getInstance();
2466
2466
  if (!t4) throw new l(l.InvalidFeatureExtensionParameterError, "Unable to get feature template. Component cannot be null or undefined.");
2467
2467
  if (!e) throw new l(l.InvalidFeatureExtensionParameterError, "Unable to get feature template. Feature name cannot be null or undefined.");
2468
2468
  if (!i.isAllowedForFeatureDefinition(t4)) throw new l(l.InvalidFeatureExtensionParameterError, `Unable to get feature template. Component of type ${A.getComponentName(t4)} is not allowed for feature definition.`);
2469
- let o3 = A.getClassInheritanceChain(t4).filter((E3) => E3 !== O && E3 !== U && E3 !== D).map((E3) => `${E3.name}.${e}`), s4 = /* @__PURE__ */ new Map(), a4 = /* @__PURE__ */ new Set(), c3 = /* @__PURE__ */ new Map(), d4 = /* @__PURE__ */ new Map(), m6 = p((E3) => {
2470
- let C3 = c3.get(E3);
2471
- return C3 === void 0 && (C3 = A.getComponentName(E3), c3.set(E3, C3)), C3;
2469
+ let o3 = A.getClassInheritanceChain(t4).filter((E3) => E3 !== O && E3 !== U && E3 !== D).map((E3) => `${E3.name}.${e}`), s4 = /* @__PURE__ */ new Map(), a4 = /* @__PURE__ */ new Set(), _4 = /* @__PURE__ */ new Map(), d4 = /* @__PURE__ */ new Map(), m6 = p((E3) => {
2470
+ let C3 = _4.get(E3);
2471
+ return C3 === void 0 && (C3 = A.getComponentName(E3), _4.set(E3, C3)), C3;
2472
2472
  }, "getNameCached"), g4 = p((E3) => {
2473
2473
  let C3 = d4.get(E3);
2474
2474
  return C3 || (C3 = new M(E3), d4.set(E3, C3)), C3;
2475
- }, "getDependencyCached"), F3 = new Set(A.getClassInheritanceChain(t4).filter((E3) => E3 !== O && E3 !== U && E3 !== D)), L2 = p((E3) => {
2476
- if (F3.has(E3)) return false;
2475
+ }, "getDependencyCached"), v6 = new Set(A.getClassInheritanceChain(t4).filter((E3) => E3 !== O && E3 !== U && E3 !== D)), L2 = p((E3) => {
2476
+ if (v6.has(E3)) return false;
2477
2477
  let C3 = _a33.getAncestors(E3);
2478
2478
  if (!C3) return false;
2479
- for (let _e2 of F3) if (C3.has(_e2)) return true;
2479
+ for (let _e2 of v6) if (C3.has(_e2)) return true;
2480
2480
  return false;
2481
- }, "isSiblingOrUnrelatedDescendant"), ae = t4 instanceof D, ge = p((E3) => !ae || F3.has(E3) || typeof E3 != "function" ? false : E3.prototype instanceof D || E3 === D, "isForeignEntityClass"), K2 = [];
2481
+ }, "isSiblingOrUnrelatedDescendant"), ae = t4 instanceof D, ge = p((E3) => !ae || v6.has(E3) || typeof E3 != "function" ? false : E3.prototype instanceof D || E3 === D, "isForeignEntityClass"), K2 = [];
2482
2482
  for (let [E3, C3] of n6._metaStorage) if (r8.has(E3) && (i.isComponentMetaInstance(C3) || i.isContainerMetaInstance(C3))) {
2483
2483
  if (L2(E3) || ge(E3)) continue;
2484
2484
  K2.push([E3, C3]);
@@ -2501,14 +2501,14 @@ var x = (_a33 = class {
2501
2501
  if (t4.length <= 1) return t4;
2502
2502
  let r8 = /* @__PURE__ */ new Map(), n6 = /* @__PURE__ */ new Set();
2503
2503
  for (let a4 of t4) {
2504
- let c3 = a4.dependency.name;
2505
- r8.has(c3) || r8.set(c3, e.resolveConstructor(c3)), n6.add(c3);
2504
+ let _4 = a4.dependency.name;
2505
+ r8.has(_4) || r8.set(_4, e.resolveConstructor(_4)), n6.add(_4);
2506
2506
  }
2507
2507
  let o3 = /* @__PURE__ */ new Set(), s4 = /* @__PURE__ */ new Map();
2508
- for (let [a4, c3] of r8) c3 && s4.set(c3, a4);
2509
- for (let [a4, c3] of r8) {
2510
- if (!c3) continue;
2511
- let d4 = _a33.getAncestors(c3);
2508
+ for (let [a4, _4] of r8) _4 && s4.set(_4, a4);
2509
+ for (let [a4, _4] of r8) {
2510
+ if (!_4) continue;
2511
+ let d4 = _a33.getAncestors(_4);
2512
2512
  if (d4) for (let m6 of d4) {
2513
2513
  let g4 = s4.get(m6);
2514
2514
  g4 && g4 !== a4 && n6.has(g4) && o3.add(g4);
@@ -2548,9 +2548,9 @@ var x = (_a33 = class {
2548
2548
  if (!e) throw new l(l.InvalidAbstractionExtensionParameterError, "Unable to get feature template. Abstraction stage cannot be null or undefined.");
2549
2549
  if (!i.isAllowedForAbstractionDefinition(t4)) throw new l(l.InvalidAbstractionExtensionParameterError, `Unable to get feature template. Component of type ${n6} is not allowed for feature definition.`);
2550
2550
  let o3 = /* @__PURE__ */ new Map(), s4 = this.scope(t4), a4 = /* @__PURE__ */ new Set();
2551
- for (let [c3, d4] of r8._metaStorage) s4.has(c3) && (i.isComponentMetaInstance(d4) || i.isContainerMetaInstance(d4)) && (a4.add(c3), d4.abstractions(e).forEach((m6) => {
2552
- let g4 = Array.from(a4).reverse().find((F3) => _a33.isIndexedInheritedFrom(c3, F3) && F3 !== c3);
2553
- g4 && o3.delete(`${A.getComponentName(g4)}.${m6.handler}`), o3.set(`${A.getComponentName(c3)}.${m6.handler}`, { dependency: new M(c3), ...m6 });
2551
+ for (let [_4, d4] of r8._metaStorage) s4.has(_4) && (i.isComponentMetaInstance(d4) || i.isContainerMetaInstance(d4)) && (a4.add(_4), d4.abstractions(e).forEach((m6) => {
2552
+ let g4 = Array.from(a4).reverse().find((v6) => _a33.isIndexedInheritedFrom(_4, v6) && v6 !== _4);
2553
+ g4 && o3.delete(`${A.getComponentName(g4)}.${m6.handler}`), o3.set(`${A.getComponentName(_4)}.${m6.handler}`, { dependency: new M(_4), ...m6 });
2554
2554
  }));
2555
2555
  return r8.filterToMostDerived(s4, Array.from(o3.values()));
2556
2556
  }
@@ -2572,8 +2572,8 @@ var x = (_a33 = class {
2572
2572
  if (s4) {
2573
2573
  for (let a4 of s4) {
2574
2574
  r8.add(a4);
2575
- let c3 = t4._descendants.get(a4);
2576
- c3 || (c3 = /* @__PURE__ */ new Set(), t4._descendants.set(a4, c3)), c3.add(e);
2575
+ let _4 = t4._descendants.get(a4);
2576
+ _4 || (_4 = /* @__PURE__ */ new Set(), t4._descendants.set(a4, _4)), _4.add(e);
2577
2577
  }
2578
2578
  break;
2579
2579
  }
@@ -2594,24 +2594,24 @@ var x = (_a33 = class {
2594
2594
  let n6 = this.getInstance(), o3 = n6._descendants.get(e), s4 = o3 ? o3.size : 0;
2595
2595
  if (s4 === 0) {
2596
2596
  if (t4 instanceof Set) for (let a4 of t4) {
2597
- let c3 = n6._ancestors.get(a4);
2598
- if (c3 && c3.has(e)) return a4;
2597
+ let _4 = n6._ancestors.get(a4);
2598
+ if (_4 && _4.has(e)) return a4;
2599
2599
  }
2600
2600
  else for (let a4 of t4) {
2601
- let c3 = n6._ancestors.get(a4);
2602
- if (c3 && c3.has(e)) return a4;
2601
+ let _4 = n6._ancestors.get(a4);
2602
+ if (_4 && _4.has(e)) return a4;
2603
2603
  }
2604
2604
  return;
2605
2605
  }
2606
2606
  if (r8 <= s4) if (t4 instanceof Set) for (let a4 of t4) {
2607
2607
  if (a4 === e) return a4;
2608
- let c3 = n6._ancestors.get(a4);
2609
- if (c3 && c3.has(e)) return a4;
2608
+ let _4 = n6._ancestors.get(a4);
2609
+ if (_4 && _4.has(e)) return a4;
2610
2610
  }
2611
2611
  else for (let a4 of t4) {
2612
2612
  if (a4 === e) return a4;
2613
- let c3 = n6._ancestors.get(a4);
2614
- if (c3 && c3.has(e)) return a4;
2613
+ let _4 = n6._ancestors.get(a4);
2614
+ if (_4 && _4.has(e)) return a4;
2615
2615
  }
2616
2616
  else for (let a4 of o3) if (t4 instanceof Set) {
2617
2617
  if (t4.has(a4)) return a4;
@@ -2632,9 +2632,9 @@ var x = (_a33 = class {
2632
2632
  static isAllowedForMetaConstructor(e) {
2633
2633
  return i.isContainerConstructor(e) || i.isComponentConstructor(e) || i.isEntityConstructor(e);
2634
2634
  }
2635
- }, __name(_a33, "x"), _a33);
2636
- p(x, "A_Context"), x.FEATURE_EXTENSIONS_CACHE_MAX_SIZE = 1024;
2637
- var _ = x;
2635
+ }, __name(_a33, "F"), _a33);
2636
+ p(F, "A_Context"), F.FEATURE_EXTENSIONS_CACHE_MAX_SIZE = 1024;
2637
+ var c = F;
2638
2638
  var _a34;
2639
2639
  var xe = (_a34 = class extends b {
2640
2640
  }, __name(_a34, "xe"), _a34);
@@ -2645,7 +2645,7 @@ function it(u2, e = {}) {
2645
2645
  let o3 = A.getComponentName(t4);
2646
2646
  if (!u2) throw new oe(oe.AbstractionExtensionError, `Abstraction name must be provided to extend abstraction for '${o3}'.`);
2647
2647
  if (!i.isConstructorAvailableForAbstraction(t4)) throw new oe(oe.AbstractionExtensionError, `Unable to extend Abstraction '${u2}' for '${o3}'. Only A-Containers and A-Components can extend Abstractions.`);
2648
- let s4, a4 = _.meta(t4);
2648
+ let s4, a4 = c.meta(t4);
2649
2649
  switch (true) {
2650
2650
  case (i.isContainerConstructor(t4) || i.isContainerInstance(t4)):
2651
2651
  s4 = "a-container-abstractions";
@@ -2654,8 +2654,8 @@ function it(u2, e = {}) {
2654
2654
  s4 = "a-component-abstractions";
2655
2655
  break;
2656
2656
  }
2657
- let c3 = `CONCEPT_ABSTRACTION::${u2}`, d4 = a4.get(s4) ? new f().from(a4.get(s4)) : new f(), m6 = [...d4.get(c3) || []], g4 = m6.findIndex((L2) => L2.handler === r8), F3 = { name: c3, handler: r8, behavior: e.behavior || "sync", throwOnError: e.throwOnError !== void 0 ? e.throwOnError : true, before: i.isArray(e.before) ? new RegExp(`^${e.before.join("|").replace(/\./g, "\\.")}$`).source : e.before instanceof RegExp ? e.before.source : "", after: i.isArray(e.after) ? new RegExp(`^${e.after.join("|").replace(/\./g, "\\.")}$`).source : e.after instanceof RegExp ? e.after.source : "", override: i.isArray(e.override) ? new RegExp(`^${e.override.join("|").replace(/\./g, "\\.")}$`).source : e.after instanceof RegExp ? e.after.source : "" };
2658
- g4 !== -1 ? m6[g4] = F3 : m6.push(F3), d4.set(c3, m6), _.meta(t4).set(s4, d4);
2657
+ let _4 = `CONCEPT_ABSTRACTION::${u2}`, d4 = a4.get(s4) ? new f().from(a4.get(s4)) : new f(), m6 = [...d4.get(_4) || []], g4 = m6.findIndex((L2) => L2.handler === r8), v6 = { name: _4, handler: r8, behavior: e.behavior || "sync", throwOnError: e.throwOnError !== void 0 ? e.throwOnError : true, before: i.isArray(e.before) ? new RegExp(`^${e.before.join("|").replace(/\./g, "\\.")}$`).source : e.before instanceof RegExp ? e.before.source : "", after: i.isArray(e.after) ? new RegExp(`^${e.after.join("|").replace(/\./g, "\\.")}$`).source : e.after instanceof RegExp ? e.after.source : "", override: i.isArray(e.override) ? new RegExp(`^${e.override.join("|").replace(/\./g, "\\.")}$`).source : e.override instanceof RegExp ? e.override.source : "" };
2658
+ g4 !== -1 ? m6[g4] = v6 : m6.push(v6), d4.set(_4, m6), c.meta(t4).set(s4, d4);
2659
2659
  };
2660
2660
  }
2661
2661
  __name(it, "it");
@@ -2666,7 +2666,7 @@ var at = (_a35 = class {
2666
2666
  this._featuresMap = /* @__PURE__ */ new Map();
2667
2667
  this._index = 0;
2668
2668
  this._name = e.name, e.containers.map((t4) => {
2669
- let r8 = _.abstractionTemplate(this._name, t4), n6 = new N({ name: this._name, component: t4, template: r8 });
2669
+ let r8 = c.abstractionTemplate(this._name, t4), n6 = new N({ name: this._name, component: t4, template: r8 });
2670
2670
  return this._featuresMap.set(t4, n6), n6;
2671
2671
  }), this._current = this._featuresMap.values().next().value;
2672
2672
  }
@@ -2695,41 +2695,44 @@ var at = (_a35 = class {
2695
2695
  }
2696
2696
  }, __name(_a35, "at"), _a35);
2697
2697
  p(at, "A_Abstraction");
2698
- var v = at;
2699
- var Ct = ((a4) => (a4.Run = "run", a4.Build = "build", a4.Publish = "publish", a4.Deploy = "deploy", a4.Load = "load", a4.Start = "start", a4.Stop = "stop", a4))(Ct || {});
2698
+ var x = at;
2699
+ var Ct = ((_4) => (_4.Run = "run", _4.Build = "build", _4.Publish = "publish", _4.Deploy = "deploy", _4.Load = "load", _4.Start = "start", _4.Stop = "stop", _4.Debug = "debug", _4))(Ct || {});
2700
2700
  var Pt = ((e) => (e.LIFECYCLE = "a-component-extensions", e))(Pt || {});
2701
2701
  var _a36;
2702
2702
  var ct = (_a36 = class {
2703
2703
  constructor(e) {
2704
2704
  this.props = e;
2705
- this._name = e.name || _.root.name, e.components && e.components.length && e.components.forEach((t4) => this.scope.register(t4)), e.fragments && e.fragments.length && e.fragments.forEach((t4) => this.scope.register(t4)), e.entities && e.entities.length && e.entities.forEach((t4) => this.scope.register(t4)), this._containers = e.containers || [];
2705
+ this._name = e.name || c.root.name, e.components && e.components.length && e.components.forEach((t4) => this.scope.register(t4)), e.fragments && e.fragments.length && e.fragments.forEach((t4) => this.scope.register(t4)), e.entities && e.entities.length && e.entities.forEach((t4) => this.scope.register(t4)), this._containers = e.containers || [];
2706
2706
  }
2707
2707
  static Load(e) {
2708
- return v.Extend("load", e);
2708
+ return x.Extend("load", e);
2709
2709
  }
2710
2710
  static Publish(e) {
2711
- return v.Extend("publish");
2711
+ return x.Extend("publish");
2712
2712
  }
2713
2713
  static Deploy(e) {
2714
- return v.Extend("deploy", e);
2714
+ return x.Extend("deploy", e);
2715
2715
  }
2716
2716
  static Build(e) {
2717
- return v.Extend("build", e);
2717
+ return x.Extend("build", e);
2718
2718
  }
2719
2719
  static Run(e) {
2720
- return v.Extend("run", e);
2720
+ return x.Extend("run", e);
2721
2721
  }
2722
2722
  static Start(e) {
2723
- return v.Extend("start", e);
2723
+ return x.Extend("start", e);
2724
2724
  }
2725
2725
  static Stop(e) {
2726
- return v.Extend("stop", e);
2726
+ return x.Extend("stop", e);
2727
+ }
2728
+ static Debug(e) {
2729
+ return x.Extend("debug", e);
2727
2730
  }
2728
2731
  get name() {
2729
- return _.root.name;
2732
+ return c.root.name;
2730
2733
  }
2731
2734
  get scope() {
2732
- return _.root;
2735
+ return c.root;
2733
2736
  }
2734
2737
  get register() {
2735
2738
  return this.scope.register.bind(this.scope);
@@ -2738,25 +2741,28 @@ var ct = (_a36 = class {
2738
2741
  return this.scope.resolve.bind(this.scope);
2739
2742
  }
2740
2743
  async load(e) {
2741
- await new v({ name: "load", containers: this._containers }).process(e);
2744
+ await new x({ name: "load", containers: this._containers }).process(e);
2742
2745
  }
2743
2746
  async run(e) {
2744
- await new v({ name: "run", containers: this._containers }).process(e);
2747
+ await new x({ name: "run", containers: this._containers }).process(e);
2745
2748
  }
2746
2749
  async start(e) {
2747
- await new v({ name: "start", containers: this._containers }).process(e);
2750
+ await new x({ name: "start", containers: this._containers }).process(e);
2748
2751
  }
2749
2752
  async stop(e) {
2750
- await new v({ name: "stop", containers: this._containers }).process(e);
2753
+ await new x({ name: "stop", containers: this._containers }).process(e);
2751
2754
  }
2752
2755
  async build(e) {
2753
- await new v({ name: "build", containers: this._containers }).process(e);
2756
+ await new x({ name: "build", containers: this._containers }).process(e);
2754
2757
  }
2755
2758
  async deploy(e) {
2756
- await new v({ name: "deploy", containers: this._containers }).process(e);
2759
+ await new x({ name: "deploy", containers: this._containers }).process(e);
2757
2760
  }
2758
2761
  async publish(e) {
2759
- await new v({ name: "publish", containers: this._containers }).process(e);
2762
+ await new x({ name: "publish", containers: this._containers }).process(e);
2763
+ }
2764
+ async debug(e) {
2765
+ await new x({ name: "debug", containers: this._containers }).process(e);
2760
2766
  }
2761
2767
  async call(e, t4) {
2762
2768
  return await new N({ name: e, component: t4 }).process();
@@ -2794,8 +2800,8 @@ function It(u2, e) {
2794
2800
  a4 = "a-component-injections";
2795
2801
  break;
2796
2802
  }
2797
- let c3 = _.meta(t4).get(a4), d4 = c3 ? c3.clone() : new f(), m6 = d4.get(s4) ? [...d4.get(s4)] : [];
2798
- m6[n6] = u2 instanceof M ? u2 : new M(u2, e), d4.set(s4, m6), _.meta(t4).set(a4, d4);
2803
+ let _4 = c.meta(t4).get(a4), d4 = _4 ? _4.clone() : new f(), m6 = d4.get(s4) ? [...d4.get(s4)] : [];
2804
+ m6[n6] = u2 instanceof M ? u2 : new M(u2, e), d4.set(s4, m6), c.meta(t4).set(a4, d4);
2799
2805
  };
2800
2806
  }
2801
2807
  __name(It, "It");
@@ -2814,22 +2820,22 @@ var __decorateClass2 = /* @__PURE__ */ __name((decorators, target, key, kind) =>
2814
2820
  }, "__decorateClass");
2815
2821
  var __decorateParam2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam");
2816
2822
 
2817
- // node_modules/@adaas/a-frame/dist/browser/chunk-P7ZVJXAS.mjs
2818
- var t = "0.1.7";
2823
+ // node_modules/@adaas/a-frame/dist/browser/chunk-S4GNIOPF.mjs
2824
+ var t = "0.1.13";
2819
2825
 
2820
2826
  // node_modules/@adaas/a-frame/dist/browser/chunk-IKIN4MJV.mjs
2821
2827
  var h2 = Object.defineProperty;
2822
2828
  var i2 = Object.getOwnPropertyDescriptor;
2823
- var j2 = /* @__PURE__ */ __name((c3, a4) => h2(c3, "name", { value: a4, configurable: true }), "j");
2824
- var k2 = /* @__PURE__ */ __name((c3, a4, e, d4) => {
2825
- for (var b3 = d4 > 1 ? void 0 : d4 ? i2(a4, e) : a4, f5 = c3.length - 1, g4; f5 >= 0; f5--) (g4 = c3[f5]) && (b3 = (d4 ? g4(a4, e, b3) : g4(b3)) || b3);
2829
+ var j2 = /* @__PURE__ */ __name((c4, a4) => h2(c4, "name", { value: a4, configurable: true }), "j");
2830
+ var k2 = /* @__PURE__ */ __name((c4, a4, e, d4) => {
2831
+ for (var b3 = d4 > 1 ? void 0 : d4 ? i2(a4, e) : a4, f5 = c4.length - 1, g4; f5 >= 0; f5--) (g4 = c4[f5]) && (b3 = (d4 ? g4(a4, e, b3) : g4(b3)) || b3);
2826
2832
  return d4 && b3 && h2(a4, e, b3), b3;
2827
2833
  }, "k");
2828
- var l2 = /* @__PURE__ */ __name((c3, a4) => (e, d4) => a4(e, d4, c3), "l");
2834
+ var l2 = /* @__PURE__ */ __name((c4, a4) => (e, d4) => a4(e, d4, c4), "l");
2829
2835
 
2830
- // node_modules/@adaas/a-frame/dist/browser/chunk-SV7DRIZK.mjs
2836
+ // node_modules/@adaas/a-frame/dist/browser/chunk-QUXQVTLG.mjs
2831
2837
  var _a39;
2832
- var _2 = (_a39 = class extends B {
2838
+ var _ = (_a39 = class extends B {
2833
2839
  get A_FRAME_TOKEN() {
2834
2840
  return window.A_FRAME_TOKEN || "";
2835
2841
  }
@@ -2849,8 +2855,8 @@ var _2 = (_a39 = class extends B {
2849
2855
  return "";
2850
2856
  }
2851
2857
  }, __name(_a39, "_"), _a39);
2852
- j2(_2, "A_FrameEnv");
2853
- var R2 = _2;
2858
+ j2(_, "A_FrameEnv");
2859
+ var R2 = _;
2854
2860
 
2855
2861
  // node_modules/@adaas/a-frame/dist/browser/chunk-HPVKDLXO.mjs
2856
2862
  var t2 = { Load: "_A_FRAME_CREDENTIALS_LOAD", Save: "_A_FRAME_CREDENTIALS_SAVE", Destroy: "_A_FRAME_CREDENTIALS_DESTROY" };
@@ -2924,8 +2930,8 @@ var r2 = (_a41 = class extends O {
2924
2930
  static async encryptBytes(t4, e) {
2925
2931
  let n6 = await _a41.importKey(e), s4 = new Uint8Array(12);
2926
2932
  globalThis.crypto.getRandomValues(s4);
2927
- let i6 = new Uint8Array(await _a41.getSubtle().encrypt({ name: "AES-GCM", iv: s4, tagLength: 128 }, n6, _a41.bytes(t4))), a4 = i6.slice(0, i6.length - 16), c3 = i6.slice(i6.length - 16), o3 = new Uint8Array(28 + a4.length);
2928
- return o3.set(s4, 0), o3.set(c3, 12), o3.set(a4, 28), o3;
2933
+ let i6 = new Uint8Array(await _a41.getSubtle().encrypt({ name: "AES-GCM", iv: s4, tagLength: 128 }, n6, _a41.bytes(t4))), a4 = i6.slice(0, i6.length - 16), c4 = i6.slice(i6.length - 16), o3 = new Uint8Array(28 + a4.length);
2934
+ return o3.set(s4, 0), o3.set(c4, 12), o3.set(a4, 28), o3;
2929
2935
  }
2930
2936
  static async encrypt(t4, e) {
2931
2937
  let n6 = new TextEncoder().encode(t4), s4 = await _a41.encryptBytes(n6, e);
@@ -2933,9 +2939,9 @@ var r2 = (_a41 = class extends O {
2933
2939
  }
2934
2940
  static async decryptBytes(t4, e) {
2935
2941
  if (t4.length < 28) throw new Error("Payload too short to decrypt");
2936
- let n6 = await _a41.importKey(e), s4 = t4.slice(0, 12), i6 = t4.slice(12, 28), a4 = t4.slice(28), c3 = new Uint8Array(a4.length + 16);
2937
- c3.set(a4, 0), c3.set(i6, a4.length);
2938
- let o3 = await _a41.getSubtle().decrypt({ name: "AES-GCM", iv: _a41.bytes(s4), tagLength: 128 }, n6, c3);
2942
+ let n6 = await _a41.importKey(e), s4 = t4.slice(0, 12), i6 = t4.slice(12, 28), a4 = t4.slice(28), c4 = new Uint8Array(a4.length + 16);
2943
+ c4.set(a4, 0), c4.set(i6, a4.length);
2944
+ let o3 = await _a41.getSubtle().decrypt({ name: "AES-GCM", iv: _a41.bytes(s4), tagLength: 128 }, n6, c4);
2939
2945
  return new Uint8Array(o3);
2940
2946
  }
2941
2947
  static async decrypt(t4, e) {
@@ -3044,7 +3050,7 @@ var i3 = (_a42 = class extends O {
3044
3050
  }
3045
3051
  }, __name(_a42, "i"), _a42);
3046
3052
  j2(i3, "A_FrameLoggerBase");
3047
- var c = i3;
3053
+ var c2 = i3;
3048
3054
 
3049
3055
  // node_modules/@adaas/a-frame/dist/browser/chunk-CMS3MVT4.mjs
3050
3056
  var _a43;
@@ -3121,15 +3127,15 @@ var n2 = (_a45 = class extends D {
3121
3127
  j2(n2, "A_FrameVector");
3122
3128
  var i5 = n2;
3123
3129
 
3124
- // node_modules/@adaas/a-frame/dist/browser/chunk-G7MKGKG5.mjs
3125
- var a2 = { ANTARES: "adaas-antares-v1", VEGA: "adaas-vega-v1", RIGEL: "adaas-rigel-v1", PULSAR: "adaas-pulsar-v1", LYRA: "adaas-lyra-v1", NOVA: "adaas-nova-v1" };
3130
+ // node_modules/@adaas/a-frame/dist/browser/chunk-IOR4CVQW.mjs
3131
+ var a2 = { ANTARES: "adaas-antares-v1", VEGA: "adaas-vega-v1", RIGEL: "adaas-rigel-v1", RIGEL_SMALL: "adaas-rigel-small-v1", PULSAR: "adaas-pulsar-v1", LYRA: "adaas-lyra-v1", NOVA: "adaas-nova-v1" };
3126
3132
 
3127
- // node_modules/@adaas/a-frame/dist/browser/chunk-6KGTMA34.mjs
3133
+ // node_modules/@adaas/a-frame/dist/browser/chunk-AOPOEK3V.mjs
3128
3134
  var C = "default";
3129
3135
  var m2 = { Load: "_A_FRAME_NAMESPACE_LOAD", Save: "_A_FRAME_NAMESPACE_SAVE", Embed: "_A_FRAME_NAMESPACE_EMBED", Destroy: "_A_FRAME_NAMESPACE_DESTROY" };
3130
3136
  var V2 = { debug: u.gray, info: u.cyan, success: u.green, warn: u.yellow, error: u.red };
3131
3137
  var _a46;
3132
- var f2 = (_a46 = class extends c {
3138
+ var f2 = (_a46 = class extends c2 {
3133
3139
  constructor(e = {}) {
3134
3140
  super(e), this.useColor = e.color ?? !!(process.stdout && process.stdout.isTTY);
3135
3141
  }
@@ -3196,7 +3202,7 @@ var f2 = (_a46 = class extends c {
3196
3202
  console.log(` ${this.c(u.gray, "elapsed".padEnd(s4))} ${this.c(u.bold, this.elapsed())}`), this.divider();
3197
3203
  }
3198
3204
  progress(e, r8) {
3199
- let s4 = this.useColor, a$1 = m.progressBarWidth, l6 = Date.now(), o3 = 0, d$1 = "", c3 = j2((i6) => {
3205
+ let s4 = this.useColor, a$1 = m.progressBarWidth, l6 = Date.now(), o3 = 0, d$1 = "", c4 = j2((i6) => {
3200
3206
  if (r8 === 0) {
3201
3207
  i6 === "done" && console.log(`${this.c(u.green, "\u2714")} ${e} (0/0)`);
3202
3208
  return;
@@ -3213,21 +3219,21 @@ var f2 = (_a46 = class extends c {
3213
3219
  (o3 === r8 || o3 % p5 === 0) && console.log(`[${e}] ${o3}/${r8}${d$1 ? ` \u2014 ${d$1}` : ""}`);
3214
3220
  }
3215
3221
  }, "render");
3216
- return c3(), { tick: j2((i6) => {
3217
- o3 = Math.min(r8, o3 + 1), i6 && (d$1 = i6), c3();
3222
+ return c4(), { tick: j2((i6) => {
3223
+ o3 = Math.min(r8, o3 + 1), i6 && (d$1 = i6), c4();
3218
3224
  }, "tick"), succeed: j2((i6) => {
3219
- i6 && (d$1 = i6), o3 = r8, c3("done");
3225
+ i6 && (d$1 = i6), o3 = r8, c4("done");
3220
3226
  }, "succeed"), fail: j2((i6) => {
3221
- i6 && (d$1 = i6), c3("fail");
3227
+ i6 && (d$1 = i6), c4("fail");
3222
3228
  }, "fail"), update: j2((i6, h6) => {
3223
- o3 = Math.min(r8, Math.max(0, i6)), h6 && (d$1 = h6), c3();
3229
+ o3 = Math.min(r8, Math.max(0, i6)), h6 && (d$1 = h6), c4();
3224
3230
  }, "update") };
3225
3231
  }
3226
3232
  }, __name(_a46, "f"), _a46);
3227
3233
  j2(f2, "A_FrameLogger");
3228
- var _3 = f2;
3234
+ var _2 = f2;
3229
3235
  var _a47;
3230
- var v2 = (_a47 = class extends D {
3236
+ var v = (_a47 = class extends D {
3231
3237
  static get concept() {
3232
3238
  return "a-frame";
3233
3239
  }
@@ -3274,7 +3280,7 @@ var v2 = (_a47 = class extends D {
3274
3280
  return this.call(m2.Load, e);
3275
3281
  }
3276
3282
  async saveTo(e) {
3277
- let r8 = new a({ filePath: e }), s4 = new R({ name: `${this.aseid.id}-save-to`, fragments: [r8] }).inherit(_.scope(this));
3283
+ let r8 = new a({ filePath: e }), s4 = new R({ name: `${this.aseid.id}-save-to`, fragments: [r8] }).inherit(c.scope(this));
3278
3284
  try {
3279
3285
  await this.call(m2.Save, s4);
3280
3286
  } finally {
@@ -3282,7 +3288,7 @@ var v2 = (_a47 = class extends D {
3282
3288
  }
3283
3289
  }
3284
3290
  async loadFrom(e) {
3285
- let r8 = new a({ filePath: e }), s4 = new R({ name: `${this.aseid.id}-load-from`, fragments: [r8] }).inherit(_.scope(this));
3291
+ let r8 = new a({ filePath: e }), s4 = new R({ name: `${this.aseid.id}-load-from`, fragments: [r8] }).inherit(c.scope(this));
3286
3292
  try {
3287
3293
  await this.call(m2.Load, s4);
3288
3294
  } finally {
@@ -3293,7 +3299,7 @@ var v2 = (_a47 = class extends D {
3293
3299
  e.name && (this._name = e.name), e.description !== void 0 && (this._description = e.description), e.metadata !== void 0 && (this._metadata = e.metadata);
3294
3300
  }
3295
3301
  embed(e) {
3296
- return _.scope(this).resolve(_3)?.debug(`Embedding namespace "${this._name}"...`), this.call(m2.Embed, e);
3302
+ return c.scope(this).resolve(_2)?.debug(`Embedding namespace "${this._name}"...`), this.call(m2.Embed, e);
3297
3303
  }
3298
3304
  fromNew(e) {
3299
3305
  this.aseid = this.generateASEID({ id: P.toKebabCase(e.name), scope: "a-frame" }), this._name = e.name;
@@ -3319,10 +3325,10 @@ var v2 = (_a47 = class extends D {
3319
3325
  `);
3320
3326
  }
3321
3327
  }, __name(_a47, "v"), _a47);
3322
- j2(v2, "A_FrameNamespace");
3323
- var w2 = v2;
3328
+ j2(v, "A_FrameNamespace");
3329
+ var w2 = v;
3324
3330
 
3325
- // node_modules/@adaas/a-frame/dist/browser/chunk-MU3Y5CRL.mjs
3331
+ // node_modules/@adaas/a-frame/dist/browser/chunk-3MWPOKGL.mjs
3326
3332
  var r4 = { Load: "_A_FRAME_DEFINITION_LOAD", Save: "_A_FRAME_DEFINITION_SAVE", Embed: "_A_FRAME_DEFINITION_EMBED", Destroy: "_A_FRAME_DEFINITION_DESTROY" };
3327
3333
  var _a48;
3328
3334
  var n3 = (_a48 = class extends D {
@@ -3393,7 +3399,7 @@ var n3 = (_a48 = class extends D {
3393
3399
  return this.call(r4.Load, e);
3394
3400
  }
3395
3401
  async saveTo(e) {
3396
- let t4 = new a({ filePath: e }), i6 = new R({ name: `${this.aseid.id}-save-to`, fragments: [t4] }).inherit(_.scope(this));
3402
+ let t4 = new a({ filePath: e }), i6 = new R({ name: `${this.aseid.id}-save-to`, fragments: [t4] }).inherit(c.scope(this));
3397
3403
  try {
3398
3404
  await this.call(r4.Save, i6);
3399
3405
  } finally {
@@ -3401,7 +3407,7 @@ var n3 = (_a48 = class extends D {
3401
3407
  }
3402
3408
  }
3403
3409
  async loadFrom(e) {
3404
- let t4 = new a({ filePath: e }), i6 = new R({ name: `${this.aseid.id}-load-from`, fragments: [t4] }).inherit(_.scope(this));
3410
+ let t4 = new a({ filePath: e }), i6 = new R({ name: `${this.aseid.id}-load-from`, fragments: [t4] }).inherit(c.scope(this));
3405
3411
  try {
3406
3412
  await this.call(r4.Load, i6);
3407
3413
  } finally {
@@ -3437,7 +3443,7 @@ var n3 = (_a48 = class extends D {
3437
3443
  j2(n3, "A_FrameDefinition");
3438
3444
  var h3 = n3;
3439
3445
 
3440
- // node_modules/@adaas/a-frame/dist/browser/chunk-IDKY6WSM.mjs
3446
+ // node_modules/@adaas/a-frame/dist/browser/chunk-4Y5KVIAV.mjs
3441
3447
  var _a49;
3442
3448
  var z2 = (_a49 = class extends B {
3443
3449
  constructor() {
@@ -3461,7 +3467,7 @@ var z2 = (_a49 = class extends B {
3461
3467
  }
3462
3468
  }, __name(_a49, "z"), _a49);
3463
3469
  j2(z2, "A_FrameContext");
3464
- var v3 = z2;
3470
+ var v2 = z2;
3465
3471
  var S2 = { SaveDefinitions: "_A_FRAME_STORAGE_SAVE", LoadDefinitions: "_A_FRAME_STORAGE_LOAD", DestroyDefinitions: "_A_FRAME_STORAGE_DESTROY", SaveNamespaces: "_A_FRAME_STORAGE_SAVE_NAMESPACES", LoadNamespaces: "_A_FRAME_STORAGE_LOAD_NAMESPACES", DestroyNamespaces: "_A_FRAME_STORAGE_DESTROY_NAMESPACES", SaveKnowledge: "_A_FRAME_STORAGE_SAVE_KNOWLEDGE", LoadKnowledge: "_A_FRAME_STORAGE_LOAD_KNOWLEDGE", DestroyKnowledge: "_A_FRAME_STORAGE_DESTROY_KNOWLEDGE" };
3466
3472
  var _a50;
3467
3473
  var T2 = (_a50 = class extends B {
@@ -3485,7 +3491,7 @@ var T2 = (_a50 = class extends B {
3485
3491
  }
3486
3492
  }, __name(_a50, "T"), _a50);
3487
3493
  j2(T2, "A_FrameStorageOperation");
3488
- var F = T2;
3494
+ var F2 = T2;
3489
3495
  var _a51;
3490
3496
  var w3 = (_a51 = class extends b {
3491
3497
  }, __name(_a51, "w"), _a51);
@@ -3498,10 +3504,10 @@ var G = (_a52 = class extends O {
3498
3504
  }
3499
3505
  _buildExecutionScope(o3, e, a4, r8) {
3500
3506
  let t4 = [e];
3501
- return a4 && !_.has(a4) && t4.push(a4), new R({ name: o3, fragments: t4 }).inherit(r8 || _.scope(this));
3507
+ return a4 && !c.has(a4) && t4.push(a4), new R({ name: o3, fragments: t4 }).inherit(r8 || c.scope(this));
3502
3508
  }
3503
3509
  async saveDefinitions(o3, e, a4) {
3504
- let r8 = new F({ records: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.saveDefinitions", r8, this._resolveFileStore(e), a4);
3510
+ let r8 = new F2({ records: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.saveDefinitions", r8, this._resolveFileStore(e), a4);
3505
3511
  try {
3506
3512
  return await this.call(S2.SaveDefinitions, t4), r8;
3507
3513
  } catch {
@@ -3511,7 +3517,7 @@ var G = (_a52 = class extends O {
3511
3517
  }
3512
3518
  }
3513
3519
  async loadDefinitions(o3, e, a4, r8) {
3514
- let t4 = new F({ namespaceId: o3 }), i6 = this._buildExecutionScope("A_FrameStorage.loadDefinitions", t4, this._resolveFileStore(a4), r8);
3520
+ let t4 = new F2({ namespaceId: o3 }), i6 = this._buildExecutionScope("A_FrameStorage.loadDefinitions", t4, this._resolveFileStore(a4), r8);
3515
3521
  try {
3516
3522
  return await this.call(S2.LoadDefinitions, i6), t4;
3517
3523
  } catch {
@@ -3521,7 +3527,7 @@ var G = (_a52 = class extends O {
3521
3527
  }
3522
3528
  }
3523
3529
  async destroyDefinitions(o3, e, a4, r8) {
3524
- let t4 = new F({ namespaceId: o3, definitionId: e }), i6 = this._buildExecutionScope("A_FrameStorage.destroyDefinitions", t4, this._resolveFileStore(a4), r8);
3530
+ let t4 = new F2({ namespaceId: o3, definitionId: e }), i6 = this._buildExecutionScope("A_FrameStorage.destroyDefinitions", t4, this._resolveFileStore(a4), r8);
3525
3531
  try {
3526
3532
  return await this.call(S2.DestroyDefinitions, i6), t4;
3527
3533
  } catch {
@@ -3531,7 +3537,7 @@ var G = (_a52 = class extends O {
3531
3537
  }
3532
3538
  }
3533
3539
  async saveNamespaces(o3, e, a4) {
3534
- let r8 = new F({ records: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.saveNamespaces", r8, this._resolveFileStore(e), a4);
3540
+ let r8 = new F2({ records: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.saveNamespaces", r8, this._resolveFileStore(e), a4);
3535
3541
  try {
3536
3542
  return await this.call(S2.SaveNamespaces, t4), r8;
3537
3543
  } catch {
@@ -3541,7 +3547,7 @@ var G = (_a52 = class extends O {
3541
3547
  }
3542
3548
  }
3543
3549
  async loadNamespaces(o3, e, a4) {
3544
- let r8 = new F({ namespaces: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.loadNamespaces", r8, this._resolveFileStore(e), a4);
3550
+ let r8 = new F2({ namespaces: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.loadNamespaces", r8, this._resolveFileStore(e), a4);
3545
3551
  try {
3546
3552
  return await this.call(S2.LoadNamespaces, t4), r8;
3547
3553
  } catch {
@@ -3551,7 +3557,7 @@ var G = (_a52 = class extends O {
3551
3557
  }
3552
3558
  }
3553
3559
  async destroyNamespaces(o3, e, a4) {
3554
- let r8 = new F({ namespaces: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.destroyNamespaces", r8, this._resolveFileStore(e), a4);
3560
+ let r8 = new F2({ namespaces: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.destroyNamespaces", r8, this._resolveFileStore(e), a4);
3555
3561
  try {
3556
3562
  return await this.call(S2.DestroyNamespaces, t4), r8;
3557
3563
  } catch {
@@ -3561,7 +3567,7 @@ var G = (_a52 = class extends O {
3561
3567
  }
3562
3568
  }
3563
3569
  async saveKnowledge(o3, e, a4, r8) {
3564
- let t4 = new F({ id: o3, record: e }), i6 = this._buildExecutionScope("A_FrameStorage.saveKnowledge", t4, this._resolveFileStore(a4), r8);
3570
+ let t4 = new F2({ id: o3, record: e }), i6 = this._buildExecutionScope("A_FrameStorage.saveKnowledge", t4, this._resolveFileStore(a4), r8);
3565
3571
  try {
3566
3572
  return await this.call(S2.SaveKnowledge, i6), t4;
3567
3573
  } catch {
@@ -3571,7 +3577,7 @@ var G = (_a52 = class extends O {
3571
3577
  }
3572
3578
  }
3573
3579
  async loadKnowledge(o3, e, a4) {
3574
- let r8 = new F({ id: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.loadKnowledge", r8, this._resolveFileStore(e), a4);
3580
+ let r8 = new F2({ id: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.loadKnowledge", r8, this._resolveFileStore(e), a4);
3575
3581
  try {
3576
3582
  return await this.call(S2.LoadKnowledge, t4), r8;
3577
3583
  } catch {
@@ -3581,7 +3587,7 @@ var G = (_a52 = class extends O {
3581
3587
  }
3582
3588
  }
3583
3589
  async destroyKnowledge(o3, e, a4) {
3584
- let r8 = new F({ id: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.destroyKnowledge", r8, this._resolveFileStore(e), a4);
3590
+ let r8 = new F2({ id: o3 }), t4 = this._buildExecutionScope("A_FrameStorage.destroyKnowledge", r8, this._resolveFileStore(e), a4);
3585
3591
  try {
3586
3592
  return await this.call(S2.DestroyKnowledge, t4), r8;
3587
3593
  } catch {
@@ -3669,12 +3675,12 @@ var b2 = (_a54 = class extends B {
3669
3675
  let i6 = e[0]?.embedding.length ?? 0;
3670
3676
  t4.setUint16(9, i6, true), a4.push(r8);
3671
3677
  for (let n6 of e) {
3672
- let _5 = C2.encode(n6.aseid.toString()), f5 = C2.encode(n6.name), M3 = JSON.stringify({ hash: n6.hash, source: n6.source, type: n6.type, description: n6.description, metadata: n6.metadata, namespace: n6.namespace, date: n6.date, model: n6.model, credentialId: n6.credentialId, aFrameVersion: n6.aFrameVersion, aFrameServerVersion: n6.aFrameServerVersion }), N3 = C2.encode(M3), L2 = 2 + _5.length + 2 + f5.length + n6.embedding.length * 4 + 4 + N3.length, g4 = new Uint8Array(L2), h6 = new DataView(g4.buffer), m6 = 0;
3673
- h6.setUint16(m6, _5.length, true), m6 += 2, g4.set(_5, m6), m6 += _5.length, h6.setUint16(m6, f5.length, true), m6 += 2, g4.set(f5, m6), m6 += f5.length;
3678
+ let _4 = C2.encode(n6.aseid.toString()), f5 = C2.encode(n6.name), M3 = JSON.stringify({ hash: n6.hash, source: n6.source, type: n6.type, description: n6.description, metadata: n6.metadata, namespace: n6.namespace, date: n6.date, model: n6.model, credentialId: n6.credentialId, aFrameVersion: n6.aFrameVersion, aFrameServerVersion: n6.aFrameServerVersion }), N3 = C2.encode(M3), L2 = 2 + _4.length + 2 + f5.length + n6.embedding.length * 4 + 4 + N3.length, g4 = new Uint8Array(L2), h6 = new DataView(g4.buffer), m6 = 0;
3679
+ h6.setUint16(m6, _4.length, true), m6 += 2, g4.set(_4, m6), m6 += _4.length, h6.setUint16(m6, f5.length, true), m6 += 2, g4.set(f5, m6), m6 += f5.length;
3674
3680
  for (let y3 = 0; y3 < n6.embedding.length; y3++) h6.setFloat32(m6, n6.embedding[y3], true), m6 += 4;
3675
3681
  h6.setUint32(m6, N3.length, true), m6 += 4, g4.set(N3, m6), a4.push(g4);
3676
3682
  }
3677
- let c3 = a4.reduce((n6, _5) => n6 + _5.length, 0), p5 = new Uint8Array(c3), s4 = 0;
3683
+ let c4 = a4.reduce((n6, _4) => n6 + _4.length, 0), p5 = new Uint8Array(c4), s4 = 0;
3678
3684
  for (let n6 of a4) p5.set(n6, s4), s4 += n6.length;
3679
3685
  return p5;
3680
3686
  }
@@ -3684,18 +3690,18 @@ var b2 = (_a54 = class extends B {
3684
3690
  if (r8 !== this.A_FRAME_FILE_MAGIC) throw new Error(`Corrupt index: bad magic 0x${r8.toString(16)}`);
3685
3691
  let t4 = e[4];
3686
3692
  if (t4 !== this.A_FRAME_FILE_VERSION) throw new Error(`Unsupported index version: ${t4}`);
3687
- let i6 = a4.getUint32(5, true), c3 = a4.getUint16(9, true), p5 = [], s4 = this.A_FRAME_HEADER_SIZE;
3693
+ let i6 = a4.getUint32(5, true), c4 = a4.getUint16(9, true), p5 = [], s4 = this.A_FRAME_HEADER_SIZE;
3688
3694
  for (let n6 = 0; n6 < i6; n6++) {
3689
- let _5 = a4.getUint16(s4, true);
3695
+ let _4 = a4.getUint16(s4, true);
3690
3696
  s4 += 2;
3691
- let f5 = P2.decode(e.slice(s4, s4 + _5));
3692
- s4 += _5;
3697
+ let f5 = P2.decode(e.slice(s4, s4 + _4));
3698
+ s4 += _4;
3693
3699
  let M3 = a4.getUint16(s4, true);
3694
3700
  s4 += 2;
3695
3701
  let N3 = P2.decode(e.slice(s4, s4 + M3));
3696
3702
  s4 += M3;
3697
- let L2 = new Float32Array(c3);
3698
- for (let y3 = 0; y3 < c3; y3++) L2[y3] = a4.getFloat32(s4, true), s4 += 4;
3703
+ let L2 = new Float32Array(c4);
3704
+ for (let y3 = 0; y3 < c4; y3++) L2[y3] = a4.getFloat32(s4, true), s4 += 4;
3699
3705
  let g4 = a4.getUint32(s4, true);
3700
3706
  s4 += 4;
3701
3707
  let h6 = P2.decode(e.slice(s4, s4 + g4));
@@ -3713,12 +3719,12 @@ var b2 = (_a54 = class extends B {
3713
3719
  let i6 = e[0]?.embedding.length ?? 0;
3714
3720
  t4.setUint16(9, i6, true), a4.push(r8);
3715
3721
  for (let n6 of e) {
3716
- let _5 = C2.encode(n6.aseid.toString()), f5 = C2.encode(n6.name), M3 = JSON.stringify({ hash: n6.hash, description: n6.description, metadata: n6.metadata, embeddedAt: n6.embeddedAt, embeddingModel: n6.embeddingModel, credentialId: n6.credentialId, aFrameVersion: n6.aFrameVersion, aFrameServerVersion: n6.aFrameServerVersion }), N3 = C2.encode(M3), L2 = 2 + _5.length + 2 + f5.length + n6.embedding.length * 4 + 4 + N3.length, g4 = new Uint8Array(L2), h6 = new DataView(g4.buffer), m6 = 0;
3717
- h6.setUint16(m6, _5.length, true), m6 += 2, g4.set(_5, m6), m6 += _5.length, h6.setUint16(m6, f5.length, true), m6 += 2, g4.set(f5, m6), m6 += f5.length;
3722
+ let _4 = C2.encode(n6.aseid.toString()), f5 = C2.encode(n6.name), M3 = JSON.stringify({ hash: n6.hash, description: n6.description, metadata: n6.metadata, embeddedAt: n6.embeddedAt, embeddingModel: n6.embeddingModel, credentialId: n6.credentialId, aFrameVersion: n6.aFrameVersion, aFrameServerVersion: n6.aFrameServerVersion }), N3 = C2.encode(M3), L2 = 2 + _4.length + 2 + f5.length + n6.embedding.length * 4 + 4 + N3.length, g4 = new Uint8Array(L2), h6 = new DataView(g4.buffer), m6 = 0;
3723
+ h6.setUint16(m6, _4.length, true), m6 += 2, g4.set(_4, m6), m6 += _4.length, h6.setUint16(m6, f5.length, true), m6 += 2, g4.set(f5, m6), m6 += f5.length;
3718
3724
  for (let y3 = 0; y3 < n6.embedding.length; y3++) h6.setFloat32(m6, n6.embedding[y3], true), m6 += 4;
3719
3725
  h6.setUint32(m6, N3.length, true), m6 += 4, g4.set(N3, m6), a4.push(g4);
3720
3726
  }
3721
- let c3 = a4.reduce((n6, _5) => n6 + _5.length, 0), p5 = new Uint8Array(c3), s4 = 0;
3727
+ let c4 = a4.reduce((n6, _4) => n6 + _4.length, 0), p5 = new Uint8Array(c4), s4 = 0;
3722
3728
  for (let n6 of a4) p5.set(n6, s4), s4 += n6.length;
3723
3729
  return p5;
3724
3730
  }
@@ -3728,18 +3734,18 @@ var b2 = (_a54 = class extends B {
3728
3734
  if (r8 !== this.A_FRAME_FILE_MAGIC) throw new Error(`Corrupt namespace index: bad magic 0x${r8.toString(16)}`);
3729
3735
  let t4 = e[4];
3730
3736
  if (t4 !== this.A_FRAME_FILE_VERSION) throw new Error(`Unsupported namespace index version: ${t4}`);
3731
- let i6 = a4.getUint32(5, true), c3 = a4.getUint16(9, true), p5 = [], s4 = this.A_FRAME_HEADER_SIZE;
3737
+ let i6 = a4.getUint32(5, true), c4 = a4.getUint16(9, true), p5 = [], s4 = this.A_FRAME_HEADER_SIZE;
3732
3738
  for (let n6 = 0; n6 < i6; n6++) {
3733
- let _5 = a4.getUint16(s4, true);
3739
+ let _4 = a4.getUint16(s4, true);
3734
3740
  s4 += 2;
3735
- let f5 = P2.decode(e.slice(s4, s4 + _5));
3736
- s4 += _5;
3741
+ let f5 = P2.decode(e.slice(s4, s4 + _4));
3742
+ s4 += _4;
3737
3743
  let M3 = a4.getUint16(s4, true);
3738
3744
  s4 += 2;
3739
3745
  let N3 = P2.decode(e.slice(s4, s4 + M3));
3740
3746
  s4 += M3;
3741
- let L2 = new Float32Array(c3);
3742
- for (let y3 = 0; y3 < c3; y3++) L2[y3] = a4.getFloat32(s4, true), s4 += 4;
3747
+ let L2 = new Float32Array(c4);
3748
+ for (let y3 = 0; y3 < c4; y3++) L2[y3] = a4.getFloat32(s4, true), s4 += 4;
3743
3749
  let g4 = a4.getUint32(s4, true);
3744
3750
  s4 += 4;
3745
3751
  let h6 = P2.decode(e.slice(s4, s4 + g4));
@@ -3750,7 +3756,7 @@ var b2 = (_a54 = class extends B {
3750
3756
  return p5;
3751
3757
  }
3752
3758
  encodeKnowledgePayload(e) {
3753
- let a4 = JSON.parse(JSON.stringify(e, (c3, p5) => p5 instanceof Float32Array ? Array.from(p5) : p5)), r8 = C2.encode(JSON.stringify(a4)), t4 = new Uint8Array(this.A_FRAME_HEADER_SIZE + 4 + r8.length), i6 = new DataView(t4.buffer);
3759
+ let a4 = JSON.parse(JSON.stringify(e, (c4, p5) => p5 instanceof Float32Array ? Array.from(p5) : p5)), r8 = C2.encode(JSON.stringify(a4)), t4 = new Uint8Array(this.A_FRAME_HEADER_SIZE + 4 + r8.length), i6 = new DataView(t4.buffer);
3754
3760
  return i6.setUint32(0, this.A_FRAME_FILE_MAGIC, true), t4[4] = this.A_FRAME_KNOWLEDGE_VERSION, i6.setUint32(5, 1, true), i6.setUint16(9, 0, true), i6.setUint32(this.A_FRAME_HEADER_SIZE, r8.length, true), t4.set(r8, this.A_FRAME_HEADER_SIZE + 4), t4;
3755
3761
  }
3756
3762
  decodeKnowledgePayload(e) {
@@ -3759,9 +3765,9 @@ var b2 = (_a54 = class extends B {
3759
3765
  if (r8 !== this.A_FRAME_FILE_MAGIC) throw new Error(`Corrupt knowledge file: bad magic 0x${r8.toString(16)}`);
3760
3766
  let t4 = e[4];
3761
3767
  if (t4 !== this.A_FRAME_KNOWLEDGE_VERSION) throw new Error(`Unsupported knowledge file version: 0x${t4.toString(16)}`);
3762
- let i6 = a4.getUint32(this.A_FRAME_HEADER_SIZE, true), c3 = this.A_FRAME_HEADER_SIZE + 4;
3763
- if (e.length < c3 + i6) throw new Error("Corrupt knowledge file: truncated payload");
3764
- let p5 = P2.decode(e.slice(c3, c3 + i6));
3768
+ let i6 = a4.getUint32(this.A_FRAME_HEADER_SIZE, true), c4 = this.A_FRAME_HEADER_SIZE + 4;
3769
+ if (e.length < c4 + i6) throw new Error("Corrupt knowledge file: truncated payload");
3770
+ let p5 = P2.decode(e.slice(c4, c4 + i6));
3765
3771
  return JSON.parse(p5);
3766
3772
  }
3767
3773
  }, __name(_a54, "b"), _a54);
@@ -3773,30 +3779,30 @@ var D2 = (_a55 = class extends x2 {
3773
3779
  e || o3.register(E.instance);
3774
3780
  }
3775
3781
  async saveDefinitionsToMemory(o3, e, a4, r8, t4) {
3776
- let i6 = e.params.records, c3 = i6[0].namespace, p5 = await this._loadDefinitionsFromMemory(t4.store, c3, a4.encryptionKey, r8), s4 = /* @__PURE__ */ new Map();
3777
- for (let _5 of p5) s4.set(_5.aseid, _5);
3778
- for (let _5 of i6) s4.set(_5.aseid.toString(), _5);
3782
+ let i6 = e.params.records, c4 = i6[0].namespace, p5 = await this._loadDefinitionsFromMemory(t4.store, c4, a4.encryptionKey, r8), s4 = /* @__PURE__ */ new Map();
3783
+ for (let _4 of p5) s4.set(_4.aseid, _4);
3784
+ for (let _4 of i6) s4.set(_4.aseid.toString(), _4);
3779
3785
  let n6 = r8.encodePayload(Array.from(s4.values()));
3780
- t4.store.set(c3, await g.encryptBytes(n6, a4.encryptionKey)), e.complete({ saved: i6.length });
3786
+ t4.store.set(c4, await g.encryptBytes(n6, a4.encryptionKey)), e.complete({ saved: i6.length });
3781
3787
  }
3782
3788
  async loadDefinitionsFromMemory(o3, e, a4, r8, t4) {
3783
- let i6 = e.params.namespaceId, c3 = await this._loadDefinitionsFromMemory(t4.store, i6, a4.encryptionKey, r8);
3784
- e.complete({ records: c3 });
3789
+ let i6 = e.params.namespaceId, c4 = await this._loadDefinitionsFromMemory(t4.store, i6, a4.encryptionKey, r8);
3790
+ e.complete({ records: c4 });
3785
3791
  }
3786
3792
  async destroyDefinitionsFromMemory(o3, e, a4, r8, t4) {
3787
- let i6 = e.params.namespaceId, c3 = e.params.definitionId, s4 = (await this._loadDefinitionsFromMemory(t4.store, i6, a4.encryptionKey, r8)).filter((_5) => _5.aseid !== c3), n6 = r8.encodePayload(s4);
3793
+ let i6 = e.params.namespaceId, c4 = e.params.definitionId, s4 = (await this._loadDefinitionsFromMemory(t4.store, i6, a4.encryptionKey, r8)).filter((_4) => _4.aseid !== c4), n6 = r8.encodePayload(s4);
3788
3794
  t4.store.set(i6, await g.encryptBytes(n6, a4.encryptionKey)), e.complete({ records: s4 });
3789
3795
  }
3790
3796
  async saveNamespacesToMemory(o3, e, a4, r8, t4) {
3791
- let i6 = e.params.records, c3 = await this._loadNamespacesFromMemory(t4, a4.encryptionKey, r8), p5 = /* @__PURE__ */ new Map();
3792
- for (let n6 of c3) p5.set(n6.aseid, n6);
3797
+ let i6 = e.params.records, c4 = await this._loadNamespacesFromMemory(t4, a4.encryptionKey, r8), p5 = /* @__PURE__ */ new Map();
3798
+ for (let n6 of c4) p5.set(n6.aseid, n6);
3793
3799
  for (let n6 of i6) p5.set(n6.aseid.toString(), n6);
3794
3800
  let s4 = r8.encodeNamespacePayload(Array.from(p5.values()));
3795
3801
  t4.namespaceBlob = await g.encryptBytes(s4, a4.encryptionKey), e.complete({ success: true });
3796
3802
  }
3797
3803
  async loadNamespacesFromMemory(o3, e, a4, r8, t4) {
3798
- let i6 = e.params.namespaces, c3 = await this._loadNamespacesFromMemory(t4, a4.encryptionKey, r8);
3799
- e.complete({ records: i6 ? c3.filter((p5) => i6.includes(p5.name)) : c3 });
3804
+ let i6 = e.params.namespaces, c4 = await this._loadNamespacesFromMemory(t4, a4.encryptionKey, r8);
3805
+ e.complete({ records: i6 ? c4.filter((p5) => i6.includes(p5.name)) : c4 });
3800
3806
  }
3801
3807
  async destroyNamespacesFromMemory(o3, e, a4, r8, t4) {
3802
3808
  let i6 = e.params.namespaces, p5 = (await this._loadNamespacesFromMemory(t4, a4.encryptionKey, r8)).filter((n6) => !i6.includes(n6.aseid)), s4 = r8.encodeNamespacePayload(p5);
@@ -3820,21 +3826,21 @@ var D2 = (_a55 = class extends x2 {
3820
3826
  if (!e.encryptionKey) return;
3821
3827
  let i6 = await this._loadDefinitionsFromMemory(r8.store, o3.namespace.id, e.encryptionKey, a4);
3822
3828
  if (i6.length === 0) return;
3823
- let c3 = i6.find((p5) => p5.aseid === o3.aseid.toString());
3824
- c3 && c3.hash === o3.hash && c3.aFrameServerVersion === e.serverVersion && o3.fromJSON(c3);
3829
+ let c4 = i6.find((p5) => p5.aseid === o3.aseid.toString());
3830
+ c4 && c4.hash === o3.hash && c4.aFrameServerVersion === e.serverVersion && o3.fromJSON(c4);
3825
3831
  }
3826
3832
  async loadNamespaceFromBlobs(o3, e, a4, r8) {
3827
3833
  if (r8.plainNamespaceRecords?.length) {
3828
- let c3 = r8.plainNamespaceRecords.find((p5) => p5.aseid === o3.aseid.toString());
3829
- if (c3 && c3.hash === o3.hash) {
3830
- o3.fromJSON(c3);
3834
+ let c4 = r8.plainNamespaceRecords.find((p5) => p5.aseid === o3.aseid.toString());
3835
+ if (c4 && c4.hash === o3.hash) {
3836
+ o3.fromJSON(c4);
3831
3837
  return;
3832
3838
  }
3833
3839
  }
3834
3840
  if (!e.encryptionKey) return;
3835
3841
  let t4 = await this._loadNamespacesFromMemory(r8, e.encryptionKey, a4);
3836
3842
  if (t4.length === 0) return;
3837
- let i6 = t4.find((c3) => c3.aseid === o3.aseid.toString());
3843
+ let i6 = t4.find((c4) => c4.aseid === o3.aseid.toString());
3838
3844
  i6 && i6.hash === o3.hash && i6.aFrameServerVersion === e.serverVersion && o3.fromJSON(i6);
3839
3845
  }
3840
3846
  async _loadDefinitionsFromMemory(o3, e, a4, r8) {
@@ -3858,12 +3864,12 @@ var D2 = (_a55 = class extends x2 {
3858
3864
  }
3859
3865
  }
3860
3866
  }, __name(_a55, "D"), _a55);
3861
- j2(D2, "A_FrameBrowserStorageProvider"), k2([_t.Load(), l2(0, It(R)), l2(1, It(E))], D2.prototype, "onLoad", 1), k2([N.Extend({ name: S2.SaveDefinitions, scope: [x2] }), l2(0, It(R2)), l2(1, It(F)), l2(2, It(v3)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "saveDefinitionsToMemory", 1), k2([N.Extend({ name: S2.LoadDefinitions, scope: [x2] }), l2(0, It(R2)), l2(1, It(F)), l2(2, It(v3)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "loadDefinitionsFromMemory", 1), k2([N.Extend({ name: S2.DestroyDefinitions, scope: [x2] }), l2(0, It(R2)), l2(1, It(F)), l2(2, It(v3)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "destroyDefinitionsFromMemory", 1), k2([N.Extend({ name: S2.SaveNamespaces, scope: [x2] }), l2(0, It(R2)), l2(1, It(F)), l2(2, It(v3)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "saveNamespacesToMemory", 1), k2([N.Extend({ name: S2.LoadNamespaces, scope: [x2] }), l2(0, It(R2)), l2(1, It(F)), l2(2, It(v3)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "loadNamespacesFromMemory", 1), k2([N.Extend({ name: S2.DestroyNamespaces, scope: [x2] }), l2(0, It(R2)), l2(1, It(F)), l2(2, It(v3)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "destroyNamespacesFromMemory", 1), k2([N.Extend({ name: r4.Load, scope: [h3] }), l2(0, It(te)), l2(1, It(v3)), l2(2, It(O2)), l2(3, It(E))], D2.prototype, "loadDefinitionFromBlobs", 1), k2([N.Extend({ name: m2.Load, scope: [w2] }), l2(0, It(te)), l2(1, It(v3)), l2(2, It(O2)), l2(3, It(E))], D2.prototype, "loadNamespaceFromBlobs", 1);
3867
+ j2(D2, "A_FrameBrowserStorageProvider"), k2([_t.Load(), l2(0, It(R)), l2(1, It(E))], D2.prototype, "onLoad", 1), k2([N.Extend({ name: S2.SaveDefinitions, scope: [x2] }), l2(0, It(R2)), l2(1, It(F2)), l2(2, It(v2)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "saveDefinitionsToMemory", 1), k2([N.Extend({ name: S2.LoadDefinitions, scope: [x2] }), l2(0, It(R2)), l2(1, It(F2)), l2(2, It(v2)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "loadDefinitionsFromMemory", 1), k2([N.Extend({ name: S2.DestroyDefinitions, scope: [x2] }), l2(0, It(R2)), l2(1, It(F2)), l2(2, It(v2)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "destroyDefinitionsFromMemory", 1), k2([N.Extend({ name: S2.SaveNamespaces, scope: [x2] }), l2(0, It(R2)), l2(1, It(F2)), l2(2, It(v2)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "saveNamespacesToMemory", 1), k2([N.Extend({ name: S2.LoadNamespaces, scope: [x2] }), l2(0, It(R2)), l2(1, It(F2)), l2(2, It(v2)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "loadNamespacesFromMemory", 1), k2([N.Extend({ name: S2.DestroyNamespaces, scope: [x2] }), l2(0, It(R2)), l2(1, It(F2)), l2(2, It(v2)), l2(3, It(O2)), l2(4, It(E))], D2.prototype, "destroyNamespacesFromMemory", 1), k2([N.Extend({ name: r4.Load, scope: [h3] }), l2(0, It(te)), l2(1, It(v2)), l2(2, It(O2)), l2(3, It(E))], D2.prototype, "loadDefinitionFromBlobs", 1), k2([N.Extend({ name: m2.Load, scope: [w2] }), l2(0, It(te)), l2(1, It(v2)), l2(2, It(O2)), l2(3, It(E))], D2.prototype, "loadNamespaceFromBlobs", 1);
3862
3868
  var Y2 = D2;
3863
3869
 
3864
3870
  // node_modules/@adaas/a-frame/dist/browser/chunk-2GSDZE4W.mjs
3865
3871
  var _a56;
3866
- var d = (_a56 = class extends c {
3872
+ var d = (_a56 = class extends c2 {
3867
3873
  constructor(e = {}) {
3868
3874
  super(e);
3869
3875
  }
@@ -3884,28 +3890,28 @@ var d = (_a56 = class extends c {
3884
3890
  o3.elapsed = this.elapsed(), console.table(o3), this.divider();
3885
3891
  }
3886
3892
  progress(e$1, o3) {
3887
- let t4 = Date.now(), s4 = 0, i6 = "", f$1 = 0, c3 = j2((r8 = false, a4) => {
3893
+ let t4 = Date.now(), s4 = 0, i6 = "", f$1 = 0, c4 = j2((r8 = false, a4) => {
3888
3894
  let g4 = Date.now();
3889
3895
  if (!r8 && g4 - f$1 < m.progressThrottleMs) return;
3890
3896
  f$1 = g4;
3891
3897
  let $2 = o3 > 0 ? Math.min(100, Math.round(s4 / o3 * 100)) : 100, A5 = i6 ? ` \u2014 ${i6}` : "";
3892
3898
  a4 === "done" ? console.log(`%c\u2714 ${e$1} ${s4}/${o3} (${$2}%)%c \u2014 ${((g4 - t4) / 1e3).toFixed(2)}s`, L.success, "color: #888;") : a4 === "fail" ? console.log(`%c\u2716 ${e$1} FAILED at ${s4}/${o3}`, L.error) : console.log(`%c\u27F3 ${e$1} ${s4}/${o3} (${$2}%)${A5}`, L.info);
3893
3899
  }, "emit");
3894
- return c3(true), { tick: j2((r8) => {
3895
- s4 = Math.min(o3, s4 + 1), r8 && (i6 = r8), c3();
3900
+ return c4(true), { tick: j2((r8) => {
3901
+ s4 = Math.min(o3, s4 + 1), r8 && (i6 = r8), c4();
3896
3902
  }, "tick"), succeed: j2((r8) => {
3897
- r8 && (i6 = r8), s4 = o3, c3(true, "done");
3903
+ r8 && (i6 = r8), s4 = o3, c4(true, "done");
3898
3904
  }, "succeed"), fail: j2((r8) => {
3899
- r8 && (i6 = r8), c3(true, "fail");
3905
+ r8 && (i6 = r8), c4(true, "fail");
3900
3906
  }, "fail"), update: j2((r8, a4) => {
3901
- s4 = Math.min(o3, Math.max(0, r8)), a4 && (i6 = a4), c3();
3907
+ s4 = Math.min(o3, Math.max(0, r8)), a4 && (i6 = a4), c4();
3902
3908
  }, "update") };
3903
3909
  }
3904
3910
  }, __name(_a56, "d"), _a56);
3905
3911
  j2(d, "A_FrameLogger");
3906
- var v4 = d;
3912
+ var v3 = d;
3907
3913
 
3908
- // node_modules/@adaas/a-frame/dist/browser/chunk-36EOUJTU.mjs
3914
+ // node_modules/@adaas/a-frame/dist/browser/chunk-V4KTR56I.mjs
3909
3915
  var r5 = { Load: "_A_FRAME_SEGMENT_LOAD", Save: "_A_FRAME_SEGMENT_SAVE", Embed: "_A_FRAME_SEGMENT_EMBED", Destroy: "_A_FRAME_SEGMENT_DESTROY" };
3910
3916
  var _a57;
3911
3917
  var o = (_a57 = class extends D {
@@ -3996,7 +4002,7 @@ var o = (_a57 = class extends D {
3996
4002
  j2(o, "A_FrameSegment");
3997
4003
  var d2 = o;
3998
4004
 
3999
- // node_modules/@adaas/a-frame/dist/browser/chunk-NZWNJOZ2.mjs
4005
+ // node_modules/@adaas/a-frame/dist/browser/chunk-P6CBKLGQ.mjs
4000
4006
  var _a58;
4001
4007
  var A3 = (_a58 = class extends D {
4002
4008
  static get concept() {
@@ -4011,7 +4017,7 @@ var A3 = (_a58 = class extends D {
4011
4017
  }, __name(_a58, "A"), _a58);
4012
4018
  j2(A3, "A_FrameDynamicPatch");
4013
4019
  var l3 = A3;
4014
- var F2 = { Generate: "_A_FRAME_DYNAMIC_CONTENT_GENERATE", Patch: "_A_FRAME_DYNAMIC_CONTENT_PATCH" };
4020
+ var F3 = { Generate: "_A_FRAME_DYNAMIC_CONTENT_GENERATE", Patch: "_A_FRAME_DYNAMIC_CONTENT_PATCH" };
4015
4021
  var _a59;
4016
4022
  var S3 = (_a59 = class extends B {
4017
4023
  constructor(e = {}) {
@@ -4141,7 +4147,7 @@ var p3 = (_a61 = class extends B {
4141
4147
  searchByKeywords(e, t4 = _a61.PATCH_PIECE_LIMIT) {
4142
4148
  let n6 = e.toLowerCase().split(/\W+/).filter((r8) => r8.length > 3);
4143
4149
  return n6.length === 0 ? [] : this.list().map((r8) => {
4144
- let o3 = r8.content.toLowerCase(), s4 = n6.reduce((a4, c3) => a4 + (o3.includes(c3) ? 1 : 0), 0);
4150
+ let o3 = r8.content.toLowerCase(), s4 = n6.reduce((a4, c4) => a4 + (o3.includes(c4) ? 1 : 0), 0);
4145
4151
  return { segment: r8, score: s4 };
4146
4152
  }).filter((r8) => r8.score > 0).sort((r8, o3) => o3.score - r8.score).slice(0, t4);
4147
4153
  }
@@ -4150,7 +4156,7 @@ var p3 = (_a61 = class extends B {
4150
4156
  if (r8.length <= n6) return r8;
4151
4157
  if (e && r8.some((a4) => a4.isEmbed)) {
4152
4158
  let a4 = this.search(e, n6);
4153
- if (a4.length > 0) return a4.map((c3) => c3.segment);
4159
+ if (a4.length > 0) return a4.map((c4) => c4.segment);
4154
4160
  }
4155
4161
  let o3 = this.searchByKeywords(t4, n6);
4156
4162
  return o3.length > 0 ? o3.map((s4) => s4.segment) : r8.slice(0, n6);
@@ -4162,22 +4168,22 @@ var p3 = (_a61 = class extends B {
4162
4168
  }
4163
4169
  }, __name(_a61, "p"), _a61);
4164
4170
  j2(p3, "A_FrameDynamicContentIndex"), p3.PATCH_PIECE_LIMIT = 5;
4165
- var _4 = p3;
4171
+ var _3 = p3;
4166
4172
  var _a62;
4167
4173
  var g2 = (_a62 = class extends D {
4168
4174
  static get concept() {
4169
4175
  return "a-frame";
4170
4176
  }
4171
4177
  get scope() {
4172
- return this._scope || (this._scope = _.allocate(this, new R({ name: `${this.aseid.id}-scope` }))), this._scope;
4178
+ return this._scope || (this._scope = c.allocate(this, new R({ name: `${this.aseid.id}-scope` }))), this._scope;
4173
4179
  }
4174
4180
  get index() {
4175
- return this.scope.resolve(_4);
4181
+ return this.scope.resolve(_3);
4176
4182
  }
4177
4183
  fromNew(i6) {
4178
4184
  super.fromNew(i6);
4179
- let e = new _4({ name: `${this.aseid.id}` });
4180
- this.scope.register(e), this.createdAt = Date.now(), this.prompt = i6.prompt, this.model = i6.options?.model || a2.LYRA, this._system = i6.options?.system, this._patchPieceLimit = i6.options?.patchPieceLimit || _4.PATCH_PIECE_LIMIT, this._splitStrategy = i6.options?.splitStrategy ?? "paragraph", this._history = [], this._version = 0;
4185
+ let e = new _3({ name: `${this.aseid.id}` });
4186
+ this.scope.register(e), this.createdAt = Date.now(), this.prompt = i6.prompt, this.model = i6.options?.model || a2.LYRA, this._system = i6.options?.system, this._patchPieceLimit = i6.options?.patchPieceLimit || _3.PATCH_PIECE_LIMIT, this._splitStrategy = i6.options?.splitStrategy ?? "paragraph", this._history = [], this._version = 0;
4181
4187
  }
4182
4188
  get segments() {
4183
4189
  return this.index.list();
@@ -4206,16 +4212,16 @@ var g2 = (_a62 = class extends D {
4206
4212
  }
4207
4213
  async generate() {
4208
4214
  let i6 = new f3();
4209
- this.scope.isInheritedFrom(_.scope(this)) || this.scope.inherit(_.scope(this));
4215
+ this.scope.isInheritedFrom(c.scope(this)) || this.scope.inherit(c.scope(this));
4210
4216
  let e = new R({ name: "a-frame-dynamic-content-generate", fragments: [i6] }).inherit(this.scope);
4211
4217
  try {
4212
- await this.call(F2.Generate, e), e.destroy();
4218
+ await this.call(F3.Generate, e), e.destroy();
4213
4219
  } catch (t4) {
4214
4220
  throw e.destroy(), new m3({ title: m3.GenerationFailed, description: `Failed to generate content: ${t4 instanceof Error ? t4.message : String(t4)}` });
4215
4221
  }
4216
4222
  }
4217
4223
  async patch(i6, e) {
4218
- this.scope.isInheritedFrom(_.scope(this)) || this.scope.inherit(_.scope(this));
4224
+ this.scope.isInheritedFrom(c.scope(this)) || this.scope.inherit(c.scope(this));
4219
4225
  let t4 = new R({ name: "a-frame-dynamic-content-patch" }).inherit(this.scope), n6;
4220
4226
  if (e !== void 0) {
4221
4227
  let o3 = Array.isArray(e) ? e : [e], s4 = o3.filter((a4) => !this.index.get(a4.id));
@@ -4228,7 +4234,7 @@ var g2 = (_a62 = class extends D {
4228
4234
  let r8 = new f3({ instruction: i6, segments: n6 });
4229
4235
  t4.register(r8);
4230
4236
  try {
4231
- await this.call(F2.Patch, t4), t4.destroy();
4237
+ await this.call(F3.Patch, t4), t4.destroy();
4232
4238
  } catch (o3) {
4233
4239
  throw t4.destroy(), new m3({ title: m3.PatchFailed, description: `Failed to patch content: ${o3 instanceof Error ? o3.message : String(o3)}` });
4234
4240
  }
@@ -4255,7 +4261,7 @@ var g2 = (_a62 = class extends D {
4255
4261
  hydrateFromPatch(i6, e) {
4256
4262
  let t4 = this.index.size, n6 = j2((s4) => s4.toLowerCase().replace(/[^\w\s]/g, "").replace(/\s+/g, " ").trim(), "normalize"), r8 = this.index.list().map((s4) => n6(s4.content)), o3 = j2((s4) => {
4257
4263
  let a4 = n6(s4);
4258
- return a4.length < 8 ? false : r8.some((c3) => c3 === a4 || c3.includes(a4));
4264
+ return a4.length < 8 ? false : r8.some((c4) => c4 === a4 || c4.includes(a4));
4259
4265
  }, "isNearDuplicate");
4260
4266
  for (let s4 of i6.operations) {
4261
4267
  if (!["add", "replace", "remove"].includes(s4.action)) continue;
@@ -4275,7 +4281,7 @@ var g2 = (_a62 = class extends D {
4275
4281
  j2(g2, "A_FrameDynamicContent"), g2.SPLITTERS = { paragraph: j2((i6) => i6.split(/\n\s*\n+/).map((e) => e.trim()), "paragraph"), line: j2((i6) => i6.split(/\r?\n/).map((e) => e.trim()), "line"), sentence: j2((i6) => i6.split(/(?<=[.!?])\s+/).map((e) => e.trim()), "sentence"), none: j2((i6) => [i6], "none") };
4276
4282
  var w4 = g2;
4277
4283
 
4278
- // node_modules/@adaas/a-frame/dist/browser/chunk-SQMVQ4WZ.mjs
4284
+ // node_modules/@adaas/a-frame/dist/browser/chunk-WZPDJK3P.mjs
4279
4285
  var r6 = { Extract: "_A_FRAME_SCHEMA_EXTRACT", ExtractMultiple: "_A_FRAME_SCHEMA_EXTRACT_MULTIPLE" };
4280
4286
  var _a63;
4281
4287
  var a3 = (_a63 = class extends D {
@@ -4334,7 +4340,7 @@ var a3 = (_a63 = class extends D {
4334
4340
  j2(a3, "A_FrameSchema");
4335
4341
  var s2 = a3;
4336
4342
 
4337
- // node_modules/@adaas/a-frame/dist/browser/chunk-6NAYM62O.mjs
4343
+ // node_modules/@adaas/a-frame/dist/browser/chunk-3NPQJZT7.mjs
4338
4344
  var n4 = { Generate: "_A_FRAME_COMPLETION_GENERATE" };
4339
4345
  var _a64;
4340
4346
  var o2 = (_a64 = class extends D {
@@ -4384,7 +4390,7 @@ var o2 = (_a64 = class extends D {
4384
4390
  j2(o2, "A_FrameCompletion");
4385
4391
  var m4 = o2;
4386
4392
 
4387
- // node_modules/@adaas/a-frame/dist/browser/chunk-WASEJBER.mjs
4393
+ // node_modules/@adaas/a-frame/dist/browser/chunk-R6QZBD5O.mjs
4388
4394
  var d3 = { Request: "_A_FRAME_REQUEST", Socket: "_A_FRAME_SOCKET", Stream: "_A_FRAME_STREAM", Send: "_A_FRAME_SEND" };
4389
4395
  var _a65;
4390
4396
  var k3 = (_a65 = class extends B {
@@ -4408,7 +4414,7 @@ var k3 = (_a65 = class extends B {
4408
4414
  }
4409
4415
  }, __name(_a65, "k"), _a65);
4410
4416
  j2(k3, "A_FrameChannelRequest");
4411
- var c2 = k3;
4417
+ var c3 = k3;
4412
4418
  var _a66;
4413
4419
  var N2 = (_a66 = class extends b {
4414
4420
  }, __name(_a66, "N"), _a66);
@@ -4527,7 +4533,7 @@ var X2 = (_a70 = class extends D {
4527
4533
  return this._version;
4528
4534
  }
4529
4535
  async generate() {
4530
- let e = new R3(), t4 = new R({ name: "a-frame-dynamic-structure-generate", fragments: [e] }).inherit(_.scope(this));
4536
+ let e = new R3(), t4 = new R({ name: "a-frame-dynamic-structure-generate", fragments: [e] }).inherit(c.scope(this));
4531
4537
  try {
4532
4538
  await this.call(D3.Generate, t4), t4.destroy();
4533
4539
  } catch (r8) {
@@ -4535,7 +4541,7 @@ var X2 = (_a70 = class extends D {
4535
4541
  }
4536
4542
  }
4537
4543
  async patch(e) {
4538
- let t4 = new R3({ instruction: e }), r8 = new R({ name: "a-frame-dynamic-structure-patch", fragments: [t4] }).inherit(_.scope(this));
4544
+ let t4 = new R3({ instruction: e }), r8 = new R({ name: "a-frame-dynamic-structure-patch", fragments: [t4] }).inherit(c.scope(this));
4539
4545
  try {
4540
4546
  await this.call(D3.Patch, r8), r8.destroy();
4541
4547
  } catch (a4) {
@@ -4543,7 +4549,7 @@ var X2 = (_a70 = class extends D {
4543
4549
  }
4544
4550
  }
4545
4551
  async map() {
4546
- let e = new q(), t4 = new R({ name: "a-frame-dynamic-structure-map", fragments: [e] }).inherit(_.scope(this));
4552
+ let e = new q(), t4 = new R({ name: "a-frame-dynamic-structure-map", fragments: [e] }).inherit(c.scope(this));
4547
4553
  try {
4548
4554
  await this.call(D3.Map, t4), t4.destroy();
4549
4555
  } catch (r8) {
@@ -4596,7 +4602,7 @@ var j3 = (_a71 = class extends B {
4596
4602
  }
4597
4603
  }, __name(_a71, "j"), _a71);
4598
4604
  j2(j3, "A_FrameDynamicFeatureOperation");
4599
- var v5 = j3;
4605
+ var v4 = j3;
4600
4606
  var _a72;
4601
4607
  var w5 = (_a72 = class extends b {
4602
4608
  }, __name(_a72, "w"), _a72);
@@ -4694,7 +4700,7 @@ var ne2 = (_a74 = class extends D {
4694
4700
  return this._version;
4695
4701
  }
4696
4702
  async generate() {
4697
- let e = new v5(), t4 = new R({ name: "a-frame-dynamic-feature-generate", fragments: [e] }).inherit(_.scope(this));
4703
+ let e = new v4(), t4 = new R({ name: "a-frame-dynamic-feature-generate", fragments: [e] }).inherit(c.scope(this));
4698
4704
  try {
4699
4705
  await this.call(x3.Generate, t4), t4.destroy();
4700
4706
  } catch (r8) {
@@ -4702,7 +4708,7 @@ var ne2 = (_a74 = class extends D {
4702
4708
  }
4703
4709
  }
4704
4710
  async patch(e) {
4705
- let t4 = new v5({ instruction: e }), r8 = new R({ name: "a-frame-dynamic-feature-patch", fragments: [t4] }).inherit(_.scope(this));
4711
+ let t4 = new v4({ instruction: e }), r8 = new R({ name: "a-frame-dynamic-feature-patch", fragments: [t4] }).inherit(c.scope(this));
4706
4712
  try {
4707
4713
  await this.call(x3.Patch, r8), r8.destroy();
4708
4714
  } catch (a4) {
@@ -4710,7 +4716,7 @@ var ne2 = (_a74 = class extends D {
4710
4716
  }
4711
4717
  }
4712
4718
  async map() {
4713
- let e = new B2(), t4 = new R({ name: "a-frame-dynamic-feature-map", fragments: [e] }).inherit(_.scope(this));
4719
+ let e = new B2(), t4 = new R({ name: "a-frame-dynamic-feature-map", fragments: [e] }).inherit(c.scope(this));
4714
4720
  try {
4715
4721
  await this.call(x3.Map, t4), t4.destroy();
4716
4722
  } catch (r8) {
@@ -4779,7 +4785,7 @@ var f4 = re2;
4779
4785
  var _a76;
4780
4786
  var l4 = (_a76 = class extends O {
4781
4787
  async generate(e) {
4782
- let t4 = new c2("POST", "/api/v1/completions", { prompt: e, max_tokens: 512 }), r8 = new R({ name: "A_FrameChannel.generate", fragments: [t4] }).inherit(_.scope(this));
4788
+ let t4 = new c3("POST", "/api/v1/completions", { prompt: e, max_tokens: 512 }), r8 = new R({ name: "A_FrameChannel.generate", fragments: [t4] }).inherit(c.scope(this));
4783
4789
  try {
4784
4790
  return await this.call(d3.Request, r8), r8.destroy(), t4;
4785
4791
  } catch (a4) {
@@ -4787,7 +4793,7 @@ var l4 = (_a76 = class extends O {
4787
4793
  }
4788
4794
  }
4789
4795
  async embed(e, t4) {
4790
- let r8 = new c2("POST", "/api/v1/embeddings", { input: e, ...t4?.model && { model: t4.model }, ...t4?.task && { task: t4.task } }), a4 = new R({ name: "A_FrameChannel.embed", fragments: [r8] }).inherit(_.scope(this));
4796
+ let r8 = new c3("POST", "/api/v1/embeddings", { input: e, ...t4?.model && { model: t4.model }, ...t4?.task && { task: t4.task } }), a4 = new R({ name: "A_FrameChannel.embed", fragments: [r8] }).inherit(c.scope(this));
4791
4797
  try {
4792
4798
  return await this.call(d3.Request, a4), a4.destroy(), r8;
4793
4799
  } catch (n6) {
@@ -4795,7 +4801,7 @@ var l4 = (_a76 = class extends O {
4795
4801
  }
4796
4802
  }
4797
4803
  async getCredentials() {
4798
- let e = new c2("GET", "/api/v1/credentials/me"), t4 = new R({ name: "A_FrameChannel.getCredentials", fragments: [e] }).inherit(_.scope(this));
4804
+ let e = new c3("GET", "/api/v1/credentials/me"), t4 = new R({ name: "A_FrameChannel.getCredentials", fragments: [e] }).inherit(c.scope(this));
4799
4805
  try {
4800
4806
  return await this.call(d3.Request, t4), t4.destroy(), e;
4801
4807
  } catch (r8) {
@@ -4803,7 +4809,7 @@ var l4 = (_a76 = class extends O {
4803
4809
  }
4804
4810
  }
4805
4811
  async ping() {
4806
- let e = new c2("GET", "/health"), t4 = new R({ name: "A_FrameChannel.ping", fragments: [e] }).inherit(_.scope(this));
4812
+ let e = new c3("GET", "/health"), t4 = new R({ name: "A_FrameChannel.ping", fragments: [e] }).inherit(c.scope(this));
4807
4813
  try {
4808
4814
  return await this.call(d3.Request, t4), t4.destroy(), e;
4809
4815
  } catch {
@@ -4811,7 +4817,7 @@ var l4 = (_a76 = class extends O {
4811
4817
  }
4812
4818
  }
4813
4819
  async embedDefinition(e, t4) {
4814
- let r8 = new c2("POST", "/api/v1/definition/embed", { definition: e.toJSON(), model: e.requestedModel }), a4 = new R({ name: "A_FrameChannel.embedDefinition", fragments: [r8] }).inherit(_.scope(this));
4820
+ let r8 = new c3("POST", "/api/v1/definition/embed", { definition: e.toJSON(), model: e.requestedModel }), a4 = new R({ name: "A_FrameChannel.embedDefinition", fragments: [r8] }).inherit(c.scope(this));
4815
4821
  try {
4816
4822
  await this.call(d3.Request, a4), a4.destroy();
4817
4823
  let n6 = r8.response;
@@ -4823,7 +4829,7 @@ var l4 = (_a76 = class extends O {
4823
4829
  }
4824
4830
  }
4825
4831
  async embedNamespace(e, t4) {
4826
- let r8 = new c2("POST", "/api/v1/namespace/embed", { namespace: e.toJSON(), model: e.requestedModel }), a4 = new R({ name: "A_FrameChannel.embedNamespace", fragments: [r8] }).inherit(_.scope(this));
4832
+ let r8 = new c3("POST", "/api/v1/namespace/embed", { namespace: e.toJSON(), model: e.requestedModel }), a4 = new R({ name: "A_FrameChannel.embedNamespace", fragments: [r8] }).inherit(c.scope(this));
4827
4833
  try {
4828
4834
  await this.call(d3.Request, a4), a4.destroy();
4829
4835
  let n6 = r8.response;
@@ -4835,7 +4841,7 @@ var l4 = (_a76 = class extends O {
4835
4841
  }
4836
4842
  }
4837
4843
  async embedSegment(e, t4) {
4838
- let r8 = new c2("POST", "/api/v1/segment/embed", { segment: e.toJSON(), task: e.options?.task, model: e.options?.model }), a4 = new R({ name: "A_FrameChannel.embedNamespace", fragments: [r8] }).inherit(_.scope(this));
4844
+ let r8 = new c3("POST", "/api/v1/segment/embed", { segment: e.toJSON(), task: e.options?.task, model: e.options?.model }), a4 = new R({ name: "A_FrameChannel.embedNamespace", fragments: [r8] }).inherit(c.scope(this));
4839
4845
  try {
4840
4846
  await this.call(d3.Request, a4), a4.destroy();
4841
4847
  let n6 = r8.response;
@@ -4847,13 +4853,13 @@ var l4 = (_a76 = class extends O {
4847
4853
  }
4848
4854
  }
4849
4855
  async generateDynamicStructure(e, t4) {
4850
- let r8 = new c2("POST", "/api/v1/structure/generate", { prompt: e.prompt, model: e.modelName, context: e.contextHint, metaHint: e.metaHintValue, includeBases: e.includedBases, excludeBases: e.excludedBases, enabledComponents: e.enabledComponentsList }), a4 = new R({ name: "A_FrameChannel.generateDynamicStructure", fragments: [r8] }).inherit(_.scope(this));
4856
+ let r8 = new c3("POST", "/api/v1/structure/generate", { prompt: e.prompt, model: e.modelName, context: e.contextHint, metaHint: e.metaHintValue, includeBases: e.includedBases, excludeBases: e.excludedBases, enabledComponents: e.enabledComponentsList }), a4 = new R({ name: "A_FrameChannel.generateDynamicStructure", fragments: [r8] }).inherit(c.scope(this));
4851
4857
  await this.call(d3.Request, a4), a4.destroy();
4852
4858
  let n6 = r8.response;
4853
4859
  e.hydrateFromGeneration(n6.definition, { model: n6.model, serverVersion: n6.meta?.server_version ?? "0.0.0" });
4854
4860
  }
4855
4861
  async patchDynamicStructure(e, t4) {
4856
- let { instruction: r8 } = t4.params, a4 = new c2("POST", "/api/v1/structure/patch", { originalPrompt: e.prompt, definition: this._stripStructureEmbeddings(e.definition ?? { containers: [], components: [], fragments: [], entities: [] }), patchInstruction: r8, model: e.modelName, context: e.contextHint, metaHint: e.metaHintValue, includeBases: e.includedBases, excludeBases: e.excludedBases, enabledComponents: e.enabledComponentsList }), n6 = new R({ name: "A_FrameChannel.patchDynamicStructure", fragments: [a4] }).inherit(_.scope(this));
4862
+ let { instruction: r8 } = t4.params, a4 = new c3("POST", "/api/v1/structure/patch", { originalPrompt: e.prompt, definition: this._stripStructureEmbeddings(e.definition ?? { containers: [], components: [], fragments: [], entities: [] }), patchInstruction: r8, model: e.modelName, context: e.contextHint, metaHint: e.metaHintValue, includeBases: e.includedBases, excludeBases: e.excludedBases, enabledComponents: e.enabledComponentsList }), n6 = new R({ name: "A_FrameChannel.patchDynamicStructure", fragments: [a4] }).inherit(c.scope(this));
4857
4863
  await this.call(d3.Request, n6), n6.destroy();
4858
4864
  let o3 = a4.response;
4859
4865
  e.hydrateFromPatch(o3.definition, o3.patchSummary, { model: o3.model, serverVersion: o3.meta?.server_version ?? "0.0.0" });
@@ -4866,13 +4872,13 @@ var l4 = (_a76 = class extends O {
4866
4872
  return { containers: e.containers.map((r8) => ({ ...t4(r8), components: (r8.components ?? []).map(t4), fragments: (r8.fragments ?? []).map(t4), entities: (r8.entities ?? []).map(t4) })), components: e.components.map(t4), fragments: e.fragments.map(t4), entities: e.entities.map(t4) };
4867
4873
  }
4868
4874
  async generateDynamicFeature(e, t4) {
4869
- let r8 = new c2("POST", "/api/v1/feature/generate", { prompt: e.prompt, model: e.modelName, context: e.contextHint }), a4 = new R({ name: "A_FrameChannel.generateDynamicFeature", fragments: [r8] }).inherit(_.scope(this));
4875
+ let r8 = new c3("POST", "/api/v1/feature/generate", { prompt: e.prompt, model: e.modelName, context: e.contextHint }), a4 = new R({ name: "A_FrameChannel.generateDynamicFeature", fragments: [r8] }).inherit(c.scope(this));
4870
4876
  await this.call(d3.Request, a4), a4.destroy();
4871
4877
  let n6 = r8.response;
4872
4878
  e.hydrateFromGeneration(n6.definition, { model: n6.model, serverVersion: n6.meta?.server_version ?? "0.0.0" });
4873
4879
  }
4874
4880
  async patchDynamicFeature(e, t4) {
4875
- let { instruction: r8 } = t4.params, a4 = new c2("POST", "/api/v1/feature/patch", { originalPrompt: e.prompt, definition: this._stripFeatureEmbeddings(e.definition ?? { title: "", description: "", steps: [], components: [], fragments: [], entities: [] }), patchInstruction: r8, model: e.modelName, context: e.contextHint }), n6 = new R({ name: "A_FrameChannel.patchDynamicFeature", fragments: [a4] }).inherit(_.scope(this));
4881
+ let { instruction: r8 } = t4.params, a4 = new c3("POST", "/api/v1/feature/patch", { originalPrompt: e.prompt, definition: this._stripFeatureEmbeddings(e.definition ?? { title: "", description: "", steps: [], components: [], fragments: [], entities: [] }), patchInstruction: r8, model: e.modelName, context: e.contextHint }), n6 = new R({ name: "A_FrameChannel.patchDynamicFeature", fragments: [a4] }).inherit(c.scope(this));
4876
4882
  await this.call(d3.Request, n6), n6.destroy();
4877
4883
  let o3 = a4.response;
4878
4884
  e.hydrateFromPatch(o3.definition, o3.patchSummary, { model: o3.model, serverVersion: o3.meta?.server_version ?? "0.0.0" });
@@ -4885,7 +4891,7 @@ var l4 = (_a76 = class extends O {
4885
4891
  return { ...e, steps: e.steps.map(t4), components: e.components.map(t4), fragments: e.fragments.map(t4), entities: e.entities.map(t4) };
4886
4892
  }
4887
4893
  async generateDynamicContent(e, t4) {
4888
- let r8 = new c2("POST", "/api/v1/content/generate", { prompt: e.prompt, model: e.modelName, ...e.systemPrompt !== void 0 ? { system: e.systemPrompt } : {} }), a4 = new R({ name: "A_FrameChannel.generateDynamicContent", fragments: [r8] }).inherit(_.scope(this));
4894
+ let r8 = new c3("POST", "/api/v1/content/generate", { prompt: e.prompt, model: e.modelName, ...e.systemPrompt !== void 0 ? { system: e.systemPrompt } : {} }), a4 = new R({ name: "A_FrameChannel.generateDynamicContent", fragments: [r8] }).inherit(c.scope(this));
4889
4895
  await this.call(d3.Request, a4), a4.destroy();
4890
4896
  let n6 = r8.response, o3 = (n6.segments ?? []).map((C3) => {
4891
4897
  let b3 = new d2({ content: C3.content, options: { task: "document" } });
@@ -4897,13 +4903,13 @@ var l4 = (_a76 = class extends O {
4897
4903
  let { instruction: r8, segments: a4 } = t4.params, n6 = /* @__PURE__ */ new Map(), o3 = a4.map((g4, ae) => {
4898
4904
  let se2 = `s${ae}`;
4899
4905
  return n6.set(se2, String(g4.id)), { id: se2, index: ae, text: g4.content, vector: g4.vector ? Array.from(g4.vector.values) : void 0 };
4900
- }), C3 = new c2("POST", "/api/v1/content/patch", { prompt: e.prompt, segments: o3, instruction: r8, model: e.modelName, ...e.systemPrompt !== void 0 ? { system: e.systemPrompt } : {} }), b3 = new R({ name: "A_FrameChannel.patchDynamicContent", fragments: [C3] }).inherit(_.scope(this));
4906
+ }), C3 = new c3("POST", "/api/v1/content/patch", { prompt: e.prompt, segments: o3, instruction: r8, model: e.modelName, ...e.systemPrompt !== void 0 ? { system: e.systemPrompt } : {} }), b3 = new R({ name: "A_FrameChannel.patchDynamicContent", fragments: [C3] }).inherit(c.scope(this));
4901
4907
  await this.call(d3.Request, b3), b3.destroy();
4902
4908
  let I2 = C3.response, he2 = I2.operations.map((g4) => ({ ...g4, targetId: g4.targetId ? n6.get(g4.targetId) ?? g4.targetId : g4.targetId }));
4903
4909
  e.hydrateFromPatch({ ...I2, operations: he2 }, { model: I2.model, serverVersion: I2.meta?.server_version ?? "0.0.0" });
4904
4910
  }
4905
4911
  async generateCompletion(e, t4) {
4906
- let r8 = new c2("POST", "/api/v1/completions/generate", { prompt: e.prompt, options: e.options }), a4 = new R({ name: "A_FrameChannel.generateCompletion", fragments: [r8] }).inherit(_.scope(this));
4912
+ let r8 = new c3("POST", "/api/v1/completions/generate", { prompt: e.prompt, options: e.options }), a4 = new R({ name: "A_FrameChannel.generateCompletion", fragments: [r8] }).inherit(c.scope(this));
4907
4913
  try {
4908
4914
  await this.call(d3.Request, a4), a4.destroy();
4909
4915
  let n6 = r8.response;
@@ -4914,7 +4920,7 @@ var l4 = (_a76 = class extends O {
4914
4920
  }
4915
4921
  }
4916
4922
  async extractSchema(e, t4) {
4917
- let r8 = new c2("POST", "/api/v1/schema/extract", { prompt: e.prompt, schema: e.schema, options: e.options }), a4 = new R({ name: "A_FrameChannel.extractSchema", fragments: [r8] }).inherit(_.scope(this));
4923
+ let r8 = new c3("POST", "/api/v1/schema/extract", { prompt: e.prompt, schema: e.schema, options: e.options }), a4 = new R({ name: "A_FrameChannel.extractSchema", fragments: [r8] }).inherit(c.scope(this));
4918
4924
  try {
4919
4925
  await this.call(d3.Request, a4), a4.destroy();
4920
4926
  let n6 = r8.response;
@@ -4925,7 +4931,7 @@ var l4 = (_a76 = class extends O {
4925
4931
  }
4926
4932
  }
4927
4933
  async extractSchemaMultiple(e, t4) {
4928
- let r8 = new c2("POST", "/api/v1/schema/extract-multiple", { prompt: e.prompt, schema: e.schema, options: e.options }), a4 = new R({ name: "A_FrameChannel.extractSchemaMultiple", fragments: [r8] }).inherit(_.scope(this));
4934
+ let r8 = new c3("POST", "/api/v1/schema/extract-multiple", { prompt: e.prompt, schema: e.schema, options: e.options }), a4 = new R({ name: "A_FrameChannel.extractSchemaMultiple", fragments: [r8] }).inherit(c.scope(this));
4929
4935
  try {
4930
4936
  await this.call(d3.Request, a4), a4.destroy();
4931
4937
  let n6 = r8.response;
@@ -4936,14 +4942,14 @@ var l4 = (_a76 = class extends O {
4936
4942
  }
4937
4943
  }
4938
4944
  }, __name(_a76, "l"), _a76);
4939
- j2(l4, "A_FrameChannel"), k2([N.Extend({ name: r4.Embed, scope: [h3] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "embedDefinition", 1), k2([N.Extend({ name: m2.Embed, scope: [w2] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "embedNamespace", 1), k2([N.Extend({ name: r5.Embed, scope: [d2] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "embedSegment", 1), k2([N.Extend({ name: D3.Generate, scope: [O3] }), l2(0, It(te)), l2(1, It(R3))], l4.prototype, "generateDynamicStructure", 1), k2([N.Extend({ name: D3.Patch, scope: [O3] }), l2(0, It(te)), l2(1, It(R3))], l4.prototype, "patchDynamicStructure", 1), k2([N.Extend({ name: x3.Generate, scope: [P3] }), l2(0, It(te)), l2(1, It(v5))], l4.prototype, "generateDynamicFeature", 1), k2([N.Extend({ name: x3.Patch, scope: [P3] }), l2(0, It(te)), l2(1, It(v5))], l4.prototype, "patchDynamicFeature", 1), k2([N.Extend({ name: F2.Generate, scope: [w4] }), l2(0, It(te)), l2(1, It(f3))], l4.prototype, "generateDynamicContent", 1), k2([N.Extend({ name: F2.Patch, scope: [w4] }), l2(0, It(te)), l2(1, It(f3))], l4.prototype, "patchDynamicContent", 1), k2([N.Extend({ name: n4.Generate, scope: [m4] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "generateCompletion", 1), k2([N.Extend({ name: r6.Extract, scope: [s2] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "extractSchema", 1), k2([N.Extend({ name: r6.ExtractMultiple, scope: [s2] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "extractSchemaMultiple", 1);
4945
+ j2(l4, "A_FrameChannel"), k2([N.Extend({ name: r4.Embed, scope: [h3] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "embedDefinition", 1), k2([N.Extend({ name: m2.Embed, scope: [w2] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "embedNamespace", 1), k2([N.Extend({ name: r5.Embed, scope: [d2] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "embedSegment", 1), k2([N.Extend({ name: D3.Generate, scope: [O3] }), l2(0, It(te)), l2(1, It(R3))], l4.prototype, "generateDynamicStructure", 1), k2([N.Extend({ name: D3.Patch, scope: [O3] }), l2(0, It(te)), l2(1, It(R3))], l4.prototype, "patchDynamicStructure", 1), k2([N.Extend({ name: x3.Generate, scope: [P3] }), l2(0, It(te)), l2(1, It(v4))], l4.prototype, "generateDynamicFeature", 1), k2([N.Extend({ name: x3.Patch, scope: [P3] }), l2(0, It(te)), l2(1, It(v4))], l4.prototype, "patchDynamicFeature", 1), k2([N.Extend({ name: F3.Generate, scope: [w4] }), l2(0, It(te)), l2(1, It(f3))], l4.prototype, "generateDynamicContent", 1), k2([N.Extend({ name: F3.Patch, scope: [w4] }), l2(0, It(te)), l2(1, It(f3))], l4.prototype, "patchDynamicContent", 1), k2([N.Extend({ name: n4.Generate, scope: [m4] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "generateCompletion", 1), k2([N.Extend({ name: r6.Extract, scope: [s2] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "extractSchema", 1), k2([N.Extend({ name: r6.ExtractMultiple, scope: [s2] }), l2(0, It(te)), l2(1, It(f4))], l4.prototype, "extractSchemaMultiple", 1);
4940
4946
  var le2 = l4;
4941
4947
 
4942
- // node_modules/@adaas/a-frame/dist/browser/chunk-X7TQYO7H.mjs
4948
+ // node_modules/@adaas/a-frame/dist/browser/chunk-KVXQ2OCC.mjs
4943
4949
  var _a77;
4944
4950
  var r7 = (_a77 = class extends le2 {
4945
4951
  async request(e, a4) {
4946
- let R5 = `${a4.A_FRAME_SERVER_URL}${e.path}`, m6 = new AbortController(), _5 = setTimeout(() => {
4952
+ let R5 = `${a4.A_FRAME_SERVER_URL}${e.path}`, m6 = new AbortController(), _4 = setTimeout(() => {
4947
4953
  m6.abort(), e.fail(new s3({ title: s3.Timeout, description: `Request to ${e.path} timed out after 15 seconds` }));
4948
4954
  }, 15e3);
4949
4955
  try {
@@ -4952,14 +4958,14 @@ var r7 = (_a77 = class extends le2 {
4952
4958
  } catch {
4953
4959
  e.fail(new s3({ title: s3.RequestFailed, description: `Request to ${e.path} failed or timed out` }));
4954
4960
  } finally {
4955
- clearTimeout(_5);
4961
+ clearTimeout(_4);
4956
4962
  }
4957
4963
  }
4958
4964
  }, __name(_a77, "r"), _a77);
4959
- j2(r7, "A_FrameBrowserChannel"), k2([N.Extend({ name: d3.Request, scope: [le2] }), l2(0, It(c2)), l2(1, It(R2))], r7.prototype, "request", 1);
4965
+ j2(r7, "A_FrameBrowserChannel"), k2([N.Extend({ name: d3.Request, scope: [le2] }), l2(0, It(c3)), l2(1, It(R2))], r7.prototype, "request", 1);
4960
4966
  var A4 = r7;
4961
4967
 
4962
- // node_modules/@adaas/a-frame/dist/browser/chunk-NXZZIWC6.mjs
4968
+ // node_modules/@adaas/a-frame/dist/browser/chunk-V44ZFIUA.mjs
4963
4969
  var _a78;
4964
4970
  var n5 = (_a78 = class extends B {
4965
4971
  constructor() {
@@ -4976,7 +4982,7 @@ var n5 = (_a78 = class extends B {
4976
4982
  return _a78.instance.indexSize;
4977
4983
  }
4978
4984
  static get scope() {
4979
- return _.scope(this);
4985
+ return c.scope(this);
4980
4986
  }
4981
4987
  static inherit(e) {
4982
4988
  _a78.instance.inherit(e);
@@ -5055,14 +5061,14 @@ var n5 = (_a78 = class extends B {
5055
5061
  this.scope.deregister(e), this.namespaces.delete(e.id);
5056
5062
  }
5057
5063
  search(e, i6 = {}) {
5058
- let { topK: a4 = 10, namespace: t4, minScore: r8 = 0, inherit: c3 } = i6, d4 = c3 ? Array.isArray(c3) ? c3 : [c3] : void 0;
5064
+ let { topK: a4 = 10, namespace: t4, minScore: r8 = 0, inherit: c4 } = i6, d4 = c4 ? Array.isArray(c4) ? c4 : [c4] : void 0;
5059
5065
  return [...this.definitions.values()].filter((s4) => !(t4 && s4.namespace.id !== t4 || d4 && !this.matchesInheritanceFilters(s4, d4))).map((s4) => ({ record: s4, score: this.cosineSimilarity(e, s4.vector) })).filter((s4) => s4.score >= r8).sort((s4, m6) => m6.score - s4.score).slice(0, a4).map(({ record: s4, score: m6 }) => ({ record: s4, score: m6 }));
5060
5066
  }
5061
5067
  matchesInheritanceFilters(e, i6) {
5062
5068
  let a4 = this.scope.resolveConstructor(e.name);
5063
5069
  return a4 ? i6.some((t4) => {
5064
5070
  let r8 = t4.class;
5065
- return t4.strict ? Object.getPrototypeOf(a4) === r8 : _.isIndexedInheritedFrom(a4, r8);
5071
+ return t4.strict ? Object.getPrototypeOf(a4) === r8 : c.isIndexedInheritedFrom(a4, r8);
5066
5072
  }) : false;
5067
5073
  }
5068
5074
  cosineSimilarity(e, i6) {
@@ -5137,12 +5143,12 @@ function k4(n6) {
5137
5143
  }
5138
5144
  let a4 = n6.namespace ? n6.namespace instanceof w2 ? n6.namespace : h5.getNamespace(n6.namespace) || new w2({ name: n6.namespace }) : h5.getDefaultNamespace();
5139
5145
  if (r8 && t4) {
5140
- let c3 = e.constructor, H = String(r8), $2 = t4.value.toString();
5141
- return h5.addDefinition(new h3({ name: H, dependency: c3.name, description: n6.description, source: $2, metadata: n6.metadata, type: "method", namespace: a4 })), t4;
5146
+ let c4 = e.constructor, H = String(r8), $2 = t4.value.toString();
5147
+ return h5.addDefinition(new h3({ name: H, dependency: c4.name, description: n6.description, source: $2, metadata: n6.metadata, type: "method", namespace: a4 })), t4;
5142
5148
  }
5143
5149
  if (!g3.isAllowedTarget(e)) throw new m5(m5.InvalidTarget, `@A_Frame.${o3} decorator cannot be applied to the target : ${A.getComponentName(e)}. It can only be applied to allowed targets.`);
5144
- let F3 = A.getComponentName(e), f5 = g3.getTargetConstructor(e), u2 = e.toString();
5145
- return h5.addDefinition(new h3({ name: F3, description: n6.description, dependency: f5.name, source: u2, metadata: n6.metadata, type: o3, namespace: a4 })), e;
5150
+ let F4 = A.getComponentName(e), f5 = g3.getTargetConstructor(e), u2 = e.toString();
5151
+ return h5.addDefinition(new h3({ name: F4, description: n6.description, dependency: f5.name, source: u2, metadata: n6.metadata, type: o3, namespace: a4 })), e;
5146
5152
  };
5147
5153
  }
5148
5154
  __name(k4, "k");
@@ -5157,7 +5163,7 @@ function B3(n6 = {}) {
5157
5163
  __name(B3, "B");
5158
5164
  j2(B3, "A_FrameNamespaceDecorator");
5159
5165
  var _a81;
5160
- var v6 = (_a81 = class extends O {
5166
+ var v5 = (_a81 = class extends O {
5161
5167
  static Define(e) {
5162
5168
  return k4(e);
5163
5169
  }
@@ -5171,15 +5177,15 @@ var v6 = (_a81 = class extends O {
5171
5177
  e.resolve(r8) || e.register(t4);
5172
5178
  }
5173
5179
  }, __name(_a81, "v"), _a81);
5174
- j2(v6, "A_FrameBase");
5175
- var P4 = v6;
5180
+ j2(v5, "A_FrameBase");
5181
+ var P4 = v5;
5176
5182
  var _a82;
5177
5183
  var l5 = (_a82 = class extends P4 {
5178
5184
  get package() {
5179
- return [{ ctor: v3, instance: new v3() }, { ctor: R2, instance: new R2() }, { ctor: O2, instance: new O2() }, { ctor: Y2, instance: Y2 }, { ctor: v4, instance: new v4() }, { ctor: A4, instance: A4 }];
5185
+ return [{ ctor: v2, instance: new v2() }, { ctor: R2, instance: new R2() }, { ctor: O2, instance: new O2() }, { ctor: Y2, instance: Y2 }, { ctor: v3, instance: new v3() }, { ctor: A4, instance: A4 }];
5180
5186
  }
5181
5187
  async injectDependencies() {
5182
- let e = _.root;
5188
+ let e = c.root;
5183
5189
  if (this.package.forEach(({ ctor: r8, instance: t4 }) => this.packDependency(e, r8, t4)), e.resolve(E) || e.register(E.instance), !e.resolve(h5)) {
5184
5190
  let r8 = new h5();
5185
5191
  r8.inherit(e), e.register(r8);
@@ -5191,11 +5197,11 @@ var l5 = (_a82 = class extends P4 {
5191
5197
  return;
5192
5198
  }
5193
5199
  a4.bundleMeta && t4.serverVersion && a4.bundleMeta.serverVersion !== t4.serverVersion && o3.warn(`A_Frame bundle was built against server v${a4.bundleMeta.serverVersion} but the current credentials report v${t4.serverVersion}. Hydration may skip records \u2014 rebuild the bundle.`);
5194
- let F3 = r8.listNamespaces(), f5 = r8.listDefinitions();
5195
- await Promise.all([...F3.map((c3) => Promise.resolve(c3.load()).catch(() => {
5196
- })), ...f5.map((c3) => Promise.resolve(c3.load()).catch(() => {
5200
+ let F4 = r8.listNamespaces(), f5 = r8.listDefinitions();
5201
+ await Promise.all([...F4.map((c4) => Promise.resolve(c4.load()).catch(() => {
5202
+ })), ...f5.map((c4) => Promise.resolve(c4.load()).catch(() => {
5197
5203
  }))]);
5198
- let u2 = F3.filter((c3) => !c3.isEmbed).length + f5.filter((c3) => !c3.isEmbed).length;
5204
+ let u2 = F4.filter((c4) => !c4.isEmbed).length + f5.filter((c4) => !c4.isEmbed).length;
5199
5205
  u2 > 0 && o3.warn(`${u2} A-Frame entit${u2 === 1 ? "y" : "ies"} could not be hydrated from the bundle. Rebuild the bundle on the Node side to include them.`);
5200
5206
  }
5201
5207
  async build(e) {
@@ -5203,7 +5209,7 @@ var l5 = (_a82 = class extends P4 {
5203
5209
  async start(e) {
5204
5210
  }
5205
5211
  }, __name(_a82, "l"), _a82);
5206
- j2(l5, "A_Frame"), k2([_t.Load()], l5.prototype, "injectDependencies", 1), k2([_t.Load(), l2(0, It(R)), l2(1, It(h5)), l2(2, It(v3)), l2(3, It(v4)), l2(4, It(E))], l5.prototype, "load", 1), k2([_t.Build(), l2(0, It(R))], l5.prototype, "build", 1), k2([_t.Start(), l2(0, It(R))], l5.prototype, "start", 1);
5212
+ j2(l5, "A_Frame"), k2([_t.Load()], l5.prototype, "injectDependencies", 1), k2([_t.Load(), l2(0, It(R)), l2(1, It(h5)), l2(2, It(v2)), l2(3, It(v3)), l2(4, It(E))], l5.prototype, "load", 1), k2([_t.Build(), l2(0, It(R))], l5.prototype, "build", 1), k2([_t.Start(), l2(0, It(R))], l5.prototype, "start", 1);
5207
5213
  var R4 = l5;
5208
5214
 
5209
5215
  // node_modules/@adaas/a-utils/dist/browser/chunk-ZSD77J3W.mjs
@@ -5746,7 +5752,7 @@ var A_Polyfill = (_a99 = class extends O {
5746
5752
  await this.ready;
5747
5753
  }
5748
5754
  async attachToWindow() {
5749
- if (_.environment !== "browser") return;
5755
+ if (c.environment !== "browser") return;
5750
5756
  globalThis.A_Polyfill = this;
5751
5757
  globalThis.process = { env: { NODE_ENV: "production" }, cwd: /* @__PURE__ */ __name(() => "/", "cwd") };
5752
5758
  globalThis.__dirname = "/";
@@ -6046,7 +6052,7 @@ var FileConfigReader = (_a104 = class extends ConfigReader {
6046
6052
  async read(variables) {
6047
6053
  const fs = await this.polyfill.fs();
6048
6054
  try {
6049
- const data = fs.readFileSync(`${_.concept}.conf.json`, "utf8");
6055
+ const data = fs.readFileSync(`${c.concept}.conf.json`, "utf8");
6050
6056
  const config = JSON.parse(data);
6051
6057
  this.FileData = new Map(Object.entries(config));
6052
6058
  return config;
@@ -6125,26 +6131,26 @@ var A_ConfigLoader = (_a106 = class extends U {
6125
6131
  const fs = await polyfill.fs();
6126
6132
  try {
6127
6133
  switch (true) {
6128
- case (_.environment === "server" && !!fs.existsSync(`${_.concept}.conf.json`)):
6134
+ case (c.environment === "server" && !!fs.existsSync(`${c.concept}.conf.json`)):
6129
6135
  this.reader = this.scope.resolve(FileConfigReader);
6130
6136
  break;
6131
- case (_.environment === "server" && !fs.existsSync(`${_.concept}.conf.json`)):
6137
+ case (c.environment === "server" && !fs.existsSync(`${c.concept}.conf.json`)):
6132
6138
  this.reader = this.scope.resolve(ENVConfigReader);
6133
6139
  break;
6134
- case _.environment === "browser":
6140
+ case c.environment === "browser":
6135
6141
  this.reader = this.scope.resolve(ENVConfigReader);
6136
6142
  break;
6137
6143
  default:
6138
6144
  throw new A_ConfigError(
6139
6145
  A_ConfigError.InitializationError,
6140
- `Environment ${_.environment} is not supported`
6146
+ `Environment ${c.environment} is not supported`
6141
6147
  );
6142
6148
  }
6143
6149
  } catch (error) {
6144
6150
  if (error instanceof S) {
6145
6151
  throw new A_ConfigError({
6146
6152
  title: A_ConfigError.InitializationError,
6147
- description: `Failed to initialize A_ConfigLoader. Reader not found for environment ${_.environment}`,
6153
+ description: `Failed to initialize A_ConfigLoader. Reader not found for environment ${c.environment}`,
6148
6154
  originalError: error
6149
6155
  });
6150
6156
  }
@@ -6164,7 +6170,7 @@ A_ConfigLoader = __decorateClass2([
6164
6170
  })
6165
6171
  ], A_ConfigLoader);
6166
6172
 
6167
- // node_modules/@adaas/a-utils/dist/browser/chunk-2UT5WCOA.mjs
6173
+ // node_modules/@adaas/a-utils/dist/browser/chunk-JRE2HUWA.mjs
6168
6174
  var A_LOGGER_DEFAULT_SCOPE_LENGTH = 20;
6169
6175
  var A_LOGGER_COLOR_CODES = {
6170
6176
  // System colors (reserved for specific purposes)
@@ -6419,7 +6425,7 @@ var A_Logger = (_a108 = class extends O {
6419
6425
  */
6420
6426
  detectTerminalWidth() {
6421
6427
  try {
6422
- if (_.environment === "browser") {
6428
+ if (c.environment === "browser") {
6423
6429
  return A_LOGGER_TERMINAL.BROWSER_DEFAULT_WIDTH;
6424
6430
  }
6425
6431
  if (typeof process !== "undefined" && process.stdout && process.stdout.columns) {
@@ -6440,7 +6446,7 @@ var A_Logger = (_a108 = class extends O {
6440
6446
  * @returns Array of wrapped lines with proper indentation
6441
6447
  */
6442
6448
  wrapText(text, scopePadding, isFirstLine = true) {
6443
- if (_.environment === "browser") {
6449
+ if (c.environment === "browser") {
6444
6450
  return [text];
6445
6451
  }
6446
6452
  const scopeHeaderLength = this.formattedScope.length + 4 + this.getTime().length + 4;
@@ -6581,7 +6587,7 @@ ${scopePadding}${A_LOGGER_FORMAT.TIME_OPEN}${A_LOGGER_FORMAT.SEPARATOR}${A_LOGGE
6581
6587
  * @returns Formatted object string or the object itself for browser environments
6582
6588
  */
6583
6589
  formatObject(obj, shouldAddNewline, scopePadding) {
6584
- if (_.environment === "browser") {
6590
+ if (c.environment === "browser") {
6585
6591
  return obj;
6586
6592
  }
6587
6593
  if (obj === null) {
@@ -6653,7 +6659,7 @@ ${scopePadding}${A_LOGGER_FORMAT.PIPE}undefined` : "undefined";
6653
6659
  * @returns Formatted string
6654
6660
  */
6655
6661
  formatString(str, shouldAddNewline, scopePadding) {
6656
- if (_.environment === "browser") {
6662
+ if (c.environment === "browser") {
6657
6663
  const prefix = shouldAddNewline ? "\n" : "";
6658
6664
  return (prefix + str).replace(/\n/g, `
6659
6665
  ${scopePadding}${A_LOGGER_FORMAT.PIPE}`);
@@ -6708,16 +6714,13 @@ ${scopePadding}${A_LOGGER_FORMAT.PIPE}`);
6708
6714
  }
6709
6715
  debug(param1, ...args) {
6710
6716
  if (!this.shouldLog("debug")) return;
6717
+ const isColor = typeof param1 === "string" && !!this.COLORS[param1];
6718
+ const messageArgs = isColor ? args : [param1, ...args];
6711
6719
  const callScope = new R({
6712
6720
  name: this.scope.name + ":debug",
6713
- fragments: [new A_LoggerLogContext("debug", ...args)]
6721
+ fragments: [new A_LoggerLogContext("debug", ...messageArgs)]
6714
6722
  }).inherit(this.scope);
6715
- let compiled = [];
6716
- if (typeof param1 === "string" && this.COLORS[param1]) {
6717
- compiled = this.compile(param1, ...args);
6718
- } else {
6719
- compiled = this.compile(this.DEFAULT_LOG_COLOR, param1, ...args);
6720
- }
6723
+ const compiled = isColor ? this.compile(param1, ...args) : this.compile(this.DEFAULT_LOG_COLOR, param1, ...args);
6721
6724
  try {
6722
6725
  console.log(...compiled);
6723
6726
  this.call(A_LOGGER_FEATURES.onLog, callScope);
@@ -6727,16 +6730,13 @@ ${scopePadding}${A_LOGGER_FORMAT.PIPE}`);
6727
6730
  }
6728
6731
  info(param1, ...args) {
6729
6732
  if (!this.shouldLog("info")) return;
6733
+ const isColor = typeof param1 === "string" && !!this.COLORS[param1];
6734
+ const messageArgs = isColor ? args : [param1, ...args];
6730
6735
  const callScope = new R({
6731
6736
  name: this.scope.name + ":info",
6732
- fragments: [new A_LoggerLogContext("info", ...args)]
6737
+ fragments: [new A_LoggerLogContext("info", ...messageArgs)]
6733
6738
  }).inherit(this.scope);
6734
- let compiled = [];
6735
- if (typeof param1 === "string" && this.COLORS[param1]) {
6736
- compiled = this.compile(param1, ...args);
6737
- } else {
6738
- compiled = this.compile(this.DEFAULT_LOG_COLOR, param1, ...args);
6739
- }
6739
+ const compiled = isColor ? this.compile(param1, ...args) : this.compile(this.DEFAULT_LOG_COLOR, param1, ...args);
6740
6740
  try {
6741
6741
  console.log(...compiled);
6742
6742
  this.call(A_LOGGER_FEATURES.onLog, callScope);
@@ -6940,14 +6940,14 @@ ${scopePadding}|-------------------------------
6940
6940
  * The input line is the already-padded/wrapped output of
6941
6941
  * `formatStackTrace` (starts with the scope padding + PIPE).
6942
6942
  */
6943
- colorizeStackLine(line, c3) {
6943
+ colorizeStackLine(line, c4) {
6944
6944
  const locRegex = /(\(?)([^()\s:]+\.(?:ts|tsx|js|jsx|mjs|cjs)):(\d+):(\d+)(\)?)/g;
6945
6945
  const colorized = line.replace(
6946
6946
  locRegex,
6947
- (_5, openP, file, ln, col, closeP) => `${openP}${c3.CYAN}${file}${c3.RESET}${c3.RED}:${c3.YELLOW}${ln}${c3.RED}:${c3.YELLOW}${col}${c3.RED}${closeP}`
6947
+ (_4, openP, file, ln, col, closeP) => `${openP}${c4.CYAN}${file}${c4.RESET}${c4.RED}:${c4.YELLOW}${ln}${c4.RED}:${c4.YELLOW}${col}${c4.RED}${closeP}`
6948
6948
  );
6949
- const baseColor = /caused by:/i.test(line) ? c3.RED_BOLD : c3.RED;
6950
- return `${baseColor}${colorized}${c3.RESET}`;
6949
+ const baseColor = /caused by:/i.test(line) ? c4.RED_BOLD : c4.RED;
6950
+ return `${baseColor}${colorized}${c4.RESET}`;
6951
6951
  }
6952
6952
  /**
6953
6953
  * Format stack trace with proper terminal width wrapping and indentation
@@ -7124,11 +7124,11 @@ var A_UtilsHelper = (_a109 = class extends O {
7124
7124
  return `fn:${value.toString()}`;
7125
7125
  }
7126
7126
  if (value instanceof Map) {
7127
- const entries = Array.from(value.entries()).map(([k5, v7]) => `${A_UtilsHelper.serialize(k5)}=>${A_UtilsHelper.serialize(v7)}`).sort().join(",");
7127
+ const entries = Array.from(value.entries()).map(([k5, v6]) => `${A_UtilsHelper.serialize(k5)}=>${A_UtilsHelper.serialize(v6)}`).sort().join(",");
7128
7128
  return `Map{${entries}}`;
7129
7129
  }
7130
7130
  if (value instanceof Set) {
7131
- const items = Array.from(value.values()).map((v7) => A_UtilsHelper.serialize(v7)).sort().join(",");
7131
+ const items = Array.from(value.values()).map((v6) => A_UtilsHelper.serialize(v6)).sort().join(",");
7132
7132
  return `Set{${items}}`;
7133
7133
  }
7134
7134
  if (value instanceof Date) {
@@ -7138,7 +7138,7 @@ var A_UtilsHelper = (_a109 = class extends O {
7138
7138
  return `RegExp:${value.toString()}`;
7139
7139
  }
7140
7140
  if (Array.isArray(value)) {
7141
- const items = value.map((v7) => A_UtilsHelper.serialize(v7)).join(",");
7141
+ const items = value.map((v6) => A_UtilsHelper.serialize(v6)).join(",");
7142
7142
  return `[${items}]`;
7143
7143
  }
7144
7144
  if (typeof value.toJSON === "function") {
@@ -7736,7 +7736,7 @@ var A_SignalConfig = (_a113 = class extends B {
7736
7736
  if (this._structure) {
7737
7737
  return this._structure;
7738
7738
  }
7739
- const scope = _.scope(this);
7739
+ const scope = c.scope(this);
7740
7740
  const constructors = [...scope.allowedEntities].filter((e) => A.isInheritedFrom(e, A_Signal)).sort((a4, b3) => a4.constructor.name.localeCompare(b3.name)).map((s4) => scope.resolveConstructor(s4.name));
7741
7741
  return constructors.filter((s4) => s4);
7742
7742
  }
@@ -7772,7 +7772,7 @@ var A_SignalConfig = (_a113 = class extends B {
7772
7772
  this._structure = this._config.structure;
7773
7773
  } else if (this._config.stringStructure) {
7774
7774
  const stringStructure = this._config.stringStructure.split(",").map((s4) => s4.trim());
7775
- this._structure = stringStructure.map((name) => _.scope(this).resolveConstructor(name)).filter((s4) => s4);
7775
+ this._structure = stringStructure.map((name) => c.scope(this).resolveConstructor(name)).filter((s4) => s4);
7776
7776
  }
7777
7777
  }
7778
7778
  }, __name(_a113, "A_SignalConfig"), _a113);
@@ -7801,9 +7801,9 @@ var A_SignalBus = (_a116 = class extends O {
7801
7801
  const scope = new R({
7802
7802
  name: `A_SignalBus-Next-Scope`,
7803
7803
  entities: signals
7804
- }).inherit(_.scope(this));
7804
+ }).inherit(c.scope(this));
7805
7805
  try {
7806
- await this.call("_A_SignalBusFeatures_onBeforeNext", _.scope(this));
7806
+ await this.call("_A_SignalBusFeatures_onBeforeNext", c.scope(this));
7807
7807
  await this.call("_A_SignalBusFeatures_onNext", scope);
7808
7808
  scope.destroy();
7809
7809
  } catch (error) {
@@ -7838,10 +7838,10 @@ var A_SignalBus = (_a116 = class extends O {
7838
7838
  _b = "_A_SignalBusFeatures_onBeforeNext"
7839
7839
  /* onBeforeNext */
7840
7840
  ](scope, globalConfig, state, logger, config) {
7841
- const componentContext = _.scope(this);
7841
+ const componentContext = c.scope(this);
7842
7842
  if (!config) {
7843
7843
  const entries = componentContext.allowedEntities.entries();
7844
- const signalTypes = Array.from(entries).filter(([_5, entity]) => A.isInheritedFrom(entity, A_Signal)).map(([ctor, _5]) => ctor);
7844
+ const signalTypes = Array.from(entries).filter(([_4, entity]) => A.isInheritedFrom(entity, A_Signal)).map(([ctor, _4]) => ctor);
7845
7845
  config = new A_SignalConfig({
7846
7846
  structure: signalTypes.length ? signalTypes : void 0,
7847
7847
  stringStructure: globalConfig?.get("A_SIGNAL_VECTOR_STRUCTURE") || void 0
@@ -8345,7 +8345,7 @@ var AreContext = (_a121 = class extends A_ExecutionContext {
8345
8345
  * The scope of the context, which can be used to access other entities and features within the same scope. This is particularly useful for components that need to interact with other parts of the scene or component, as it allows them to access shared data and functionality without needing to pass it explicitly through parameters.
8346
8346
  */
8347
8347
  get scope() {
8348
- return _.scope(this);
8348
+ return c.scope(this);
8349
8349
  }
8350
8350
  /**
8351
8351
  * The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.
@@ -8494,6 +8494,11 @@ var AreFeatures = {
8494
8494
  //===================================================================================
8495
8495
  onSignal: "_Are_onSignal"
8496
8496
  };
8497
+ function AreSignalFeatureKey(ctor) {
8498
+ const key = ctor.entity || ctor.name;
8499
+ return `${AreFeatures.onSignal}:${key}`;
8500
+ }
8501
+ __name(AreSignalFeatureKey, "AreSignalFeatureKey");
8497
8502
  var AreInstructionFeatures = {
8498
8503
  /**
8499
8504
  * The 'Apply' feature indicates that the instruction has been applied to the scene or component, meaning that its effects have been executed and are now reflected in the state of the scene or component. This status is typically used to track the lifecycle of an instruction, allowing for proper management and potential reversal of changes if needed.
@@ -8552,7 +8557,7 @@ var AreInstruction = (_a122 = class extends D {
8552
8557
  return this.aseid.id;
8553
8558
  }
8554
8559
  get owner() {
8555
- return _.scope(this).issuer();
8560
+ return c.scope(this).issuer();
8556
8561
  }
8557
8562
  fromNew(newEntity) {
8558
8563
  this.aseid = this.generateASEID({
@@ -8750,7 +8755,7 @@ var AreScene = (_a127 = class extends B {
8750
8755
  * The scope where scene is registered. This scope is owned by AreNode
8751
8756
  */
8752
8757
  get scope() {
8753
- return _.scope(this);
8758
+ return c.scope(this);
8754
8759
  }
8755
8760
  /**
8756
8761
  * The owner node of the scene, which is the node that registered the scene in its scope.
@@ -9070,7 +9075,7 @@ var AreAttribute = (_a128 = class extends D {
9070
9075
  * The scope where the attribute is defined, which can be used to access other entities and features within the same scope. This is particularly useful for attributes that need to interact with other parts of the scene or component, as it allows them to access shared data and functionality without needing to pass it explicitly through parameters.
9071
9076
  */
9072
9077
  get scope() {
9073
- return _.scope(this);
9078
+ return c.scope(this);
9074
9079
  }
9075
9080
  /**
9076
9081
  * The owner node of the attribute, which is the node that the attribute is attached to. This can be used to access the properties and features of the owner node, as well as to determine the context in which the attribute is being used. For example, if the attribute is attached to a button element, the owner would be that button node, and the attribute could use this information to modify the button's behavior or appearance based on its content and context.
@@ -9307,7 +9312,7 @@ var AreNode = (_a129 = class extends D {
9307
9312
  */
9308
9313
  get scope() {
9309
9314
  if (!this._scope) {
9310
- this._scope = _.allocate(this, new R({ name: `${this.aseid.id}-scope` }));
9315
+ this._scope = c.allocate(this, new R({ name: `${this.aseid.id}-scope` }));
9311
9316
  }
9312
9317
  return this._scope;
9313
9318
  }
@@ -9552,7 +9557,7 @@ var AreNode = (_a129 = class extends D {
9552
9557
  }
9553
9558
  cloneWithScope() {
9554
9559
  const currentScope = this.scope;
9555
- _.deallocate(currentScope);
9560
+ c.deallocate(currentScope);
9556
9561
  const newNode = new this.constructor({
9557
9562
  opening: this._opening,
9558
9563
  closing: this._closing,
@@ -9562,10 +9567,10 @@ var AreNode = (_a129 = class extends D {
9562
9567
  raw: this._markup
9563
9568
  });
9564
9569
  if (newNode._scope)
9565
- _.deallocate(newNode._scope);
9570
+ c.deallocate(newNode._scope);
9566
9571
  newNode._scope = currentScope;
9567
- _.allocate(newNode, currentScope);
9568
- this._scope = _.allocate(this);
9572
+ c.allocate(newNode, currentScope);
9573
+ this._scope = c.allocate(this);
9569
9574
  return newNode;
9570
9575
  }
9571
9576
  reset() {
@@ -9633,7 +9638,7 @@ var AreNode = (_a129 = class extends D {
9633
9638
  checkScopeInheritance() {
9634
9639
  let attachedScope;
9635
9640
  try {
9636
- attachedScope = _.scope(this);
9641
+ attachedScope = c.scope(this);
9637
9642
  } catch (error) {
9638
9643
  throw new b({
9639
9644
  title: `A_UI_Node Scope Inheritance Error`,
@@ -9660,7 +9665,26 @@ AreEvent = __decorateClass3([
9660
9665
  ], AreEvent);
9661
9666
  var _a131;
9662
9667
  var AreSignalsMeta = (_a131 = class extends z {
9663
- registerCondition(component, vector) {
9668
+ /**
9669
+ * Registers a condition vector for a component.
9670
+ *
9671
+ * @param component The component constructor to render when the condition matches.
9672
+ * @param vector The signal vector that activates the component.
9673
+ * @param root Optional root id. When provided, the condition only
9674
+ * applies to the outlet with that id (per-root targeting).
9675
+ * When omitted, the condition applies to ALL roots — this
9676
+ * is the original, root-agnostic behavior.
9677
+ */
9678
+ registerCondition(component, vector, root) {
9679
+ if (root) {
9680
+ const rootScopedConditions = this.get("rootScopedConditions") || /* @__PURE__ */ new Map();
9681
+ if (!rootScopedConditions.has(root)) {
9682
+ rootScopedConditions.set(root, /* @__PURE__ */ new Map());
9683
+ }
9684
+ rootScopedConditions.get(root).set(vector, component);
9685
+ this.set("rootScopedConditions", rootScopedConditions);
9686
+ return;
9687
+ }
9664
9688
  const vectorToComponent = this.get("vectorToComponent") || /* @__PURE__ */ new Map();
9665
9689
  const componentToVector = this.get("componentToVector") || /* @__PURE__ */ new Map();
9666
9690
  vectorToComponent.set(vector, component);
@@ -9685,33 +9709,55 @@ var AreSignalsMeta = (_a131 = class extends z {
9685
9709
  * @param vector The incoming signal vector.
9686
9710
  * @param allowed Optional set/array of component constructors to consider.
9687
9711
  * When omitted, every registered component is eligible.
9712
+ * @param root Optional root id. When provided, conditions registered
9713
+ * specifically for that root (via `@Are.Condition(vector,
9714
+ * { root })`) are considered FIRST and take priority over
9715
+ * global, root-agnostic conditions. Conditions scoped to a
9716
+ * DIFFERENT root are never returned here.
9688
9717
  */
9689
- findComponentByVector(vector, allowed) {
9718
+ findComponentByVector(vector, allowed, root) {
9690
9719
  if (!vector) return void 0;
9691
9720
  const allowedSet = allowed ? allowed instanceof Set ? allowed : new Set(allowed) : void 0;
9692
9721
  const isAllowed = /* @__PURE__ */ __name((component) => !allowedSet || allowedSet.has(component), "isAllowed");
9722
+ if (root) {
9723
+ const rootScoped = this.get("rootScopedConditions")?.get(root);
9724
+ if (rootScoped) {
9725
+ const match = this.matchInMap(rootScoped, vector, isAllowed);
9726
+ if (match) return match;
9727
+ }
9728
+ }
9693
9729
  const vectorToComponent = this.get("vectorToComponent");
9694
9730
  if (vectorToComponent) {
9695
- const component = vectorToComponent.get(vector);
9696
- if (component && isAllowed(component)) {
9731
+ return this.matchInMap(vectorToComponent, vector, isAllowed);
9732
+ }
9733
+ return void 0;
9734
+ }
9735
+ /**
9736
+ * Resolves the best component from a vector→component map using the
9737
+ * three-tier priority shared by all condition matching:
9738
+ * 1. Simple identity lookup (same vector instance).
9739
+ * 2. Full equivalence (`vector.equals`).
9740
+ * 3. Logical match (`vector.match`, order-independent).
9741
+ * 4. Inclusion (`vector.includes`, provided vector is a subset).
9742
+ */
9743
+ matchInMap(map, vector, isAllowed) {
9744
+ const direct = map.get(vector);
9745
+ if (direct && isAllowed(direct)) {
9746
+ return direct;
9747
+ }
9748
+ for (const [registeredVector, component] of map.entries()) {
9749
+ if (isAllowed(component) && vector.equals(registeredVector)) {
9697
9750
  return component;
9698
9751
  }
9699
9752
  }
9700
- if (vectorToComponent) {
9701
- for (const [registeredVector, component] of vectorToComponent.entries()) {
9702
- if (isAllowed(component) && vector.equals(registeredVector)) {
9703
- return component;
9704
- }
9705
- }
9706
- for (const [registeredVector, component] of vectorToComponent.entries()) {
9707
- if (isAllowed(component) && vector.match(registeredVector)) {
9708
- return component;
9709
- }
9753
+ for (const [registeredVector, component] of map.entries()) {
9754
+ if (isAllowed(component) && vector.match(registeredVector)) {
9755
+ return component;
9710
9756
  }
9711
- for (const [registeredVector, component] of vectorToComponent.entries()) {
9712
- if (isAllowed(component) && vector.includes(registeredVector)) {
9713
- return component;
9714
- }
9757
+ }
9758
+ for (const [registeredVector, component] of map.entries()) {
9759
+ if (isAllowed(component) && vector.includes(registeredVector)) {
9760
+ return component;
9715
9761
  }
9716
9762
  }
9717
9763
  return void 0;
@@ -9737,7 +9783,7 @@ var AreSignalsContext = (_a132 = class extends B {
9737
9783
  }
9738
9784
  }
9739
9785
  signalsMeta() {
9740
- const signalsMeta = _.meta(AreSignals);
9786
+ const signalsMeta = c.meta(AreSignals);
9741
9787
  if (!signalsMeta) {
9742
9788
  throw new Error("AreSignalsMeta not found in context. Please ensure that AreSignalsMeta is properly registered in the A-Concept context.");
9743
9789
  }
@@ -9870,6 +9916,20 @@ var AreSignals = (_a133 = class extends O {
9870
9916
  logger?.debug("Emitting signal for root node:", vector);
9871
9917
  await root.emit(callScope);
9872
9918
  callScope.destroy();
9919
+ const dispatchedSignals = scope.resolveFlatAll(A_Signal);
9920
+ for (const signal of dispatchedSignals) {
9921
+ if (!signal) continue;
9922
+ const ctor = signal.constructor;
9923
+ const typedFeatureName = AreSignalFeatureKey(ctor);
9924
+ const typedScope = new R({
9925
+ fragments: [new AreEvent(typedFeatureName, {
9926
+ vector,
9927
+ signal
9928
+ })]
9929
+ }).import(scope, root.scope);
9930
+ await root.emit(typedScope);
9931
+ typedScope.destroy();
9932
+ }
9873
9933
  }
9874
9934
  } catch (error) {
9875
9935
  logger?.error(error);
@@ -9899,7 +9959,7 @@ var AreSignals = (_a133 = class extends O {
9899
9959
  * @param event - The event to emit to all matching nodes
9900
9960
  */
9901
9961
  async notifyExact(ctor, event) {
9902
- const context = _.scope(this).resolve(AreContext);
9962
+ const context = c.scope(this).resolve(AreContext);
9903
9963
  if (!context) return;
9904
9964
  for (const root of context.roots) {
9905
9965
  await this.traverseAndNotify(root, event, (component) => component.constructor === ctor);
@@ -9913,7 +9973,7 @@ var AreSignals = (_a133 = class extends O {
9913
9973
  * @param event - The event to emit to all matching nodes
9914
9974
  */
9915
9975
  async notifyAll(ctor, event) {
9916
- const context = _.scope(this).resolve(AreContext);
9976
+ const context = c.scope(this).resolve(AreContext);
9917
9977
  if (!context) return;
9918
9978
  for (const root of context.roots) {
9919
9979
  await this.traverseAndNotify(root, event, (component) => component instanceof ctor);
@@ -9981,10 +10041,10 @@ var Are = (_a135 = class extends O {
9981
10041
  super(...arguments);
9982
10042
  this.props = {};
9983
10043
  }
9984
- static Condition(signals) {
10044
+ static Condition(signals, options) {
9985
10045
  return function(target) {
9986
- const componentMeta = _.meta(target);
9987
- const signalsMeta = _.meta(AreSignals);
10046
+ const componentMeta = c.meta(target);
10047
+ const signalsMeta = c.meta(AreSignals);
9988
10048
  let vector;
9989
10049
  switch (true) {
9990
10050
  case signals instanceof A_SignalVector:
@@ -9998,7 +10058,7 @@ var Are = (_a135 = class extends O {
9998
10058
  }
9999
10059
  if (vector) {
10000
10060
  componentMeta.vector = vector;
10001
- signalsMeta.registerCondition(target, vector);
10061
+ signalsMeta.registerCondition(target, vector, options?.root);
10002
10062
  }
10003
10063
  return target;
10004
10064
  };
@@ -10138,15 +10198,21 @@ var Are = (_a135 = class extends O {
10138
10198
  })(target, propertyKey, descriptor);
10139
10199
  };
10140
10200
  }
10141
- /**
10142
- * Allows to define a custom method for handling signals emitted by the component or other parts of the application. This method can be used to implement custom logic for responding to specific signals, such as user interactions, state changes, or other events that may affect the component's behavior or appearance. By defining this method, developers can create more dynamic and interactive components that can react to changes in the application state or user input in a flexible and efficient way.
10143
- */
10144
- static get Signal() {
10145
- return (target, propertyKey, descriptor) => {
10201
+ static Signal(...args) {
10202
+ if (args.length >= 3 && typeof args[1] === "string") {
10203
+ const [target, propertyKey, descriptor] = args;
10146
10204
  return N.Extend({
10147
10205
  name: AreFeatures.onSignal,
10148
10206
  scope: [target.constructor]
10149
10207
  })(target, propertyKey, descriptor);
10208
+ }
10209
+ const ctor = args[0];
10210
+ const featureName = AreSignalFeatureKey(ctor);
10211
+ return function(target, propertyKey, descriptor) {
10212
+ return N.Extend({
10213
+ name: featureName,
10214
+ scope: [target.constructor]
10215
+ })(target, propertyKey, descriptor);
10150
10216
  };
10151
10217
  }
10152
10218
  template(...args) {
@@ -10418,11 +10484,11 @@ var AreSyntax = (_a136 = class extends B {
10418
10484
  // ── Sandbox ───────────────────────────────────────────────────────────────
10419
10485
  createSandbox(store, scope) {
10420
10486
  return new Proxy({}, {
10421
- has: /* @__PURE__ */ __name((_5, key) => {
10487
+ has: /* @__PURE__ */ __name((_4, key) => {
10422
10488
  if (typeof key === "string" && this.BLOCKED_GLOBALS.has(key)) return false;
10423
10489
  return true;
10424
10490
  }, "has"),
10425
- get: /* @__PURE__ */ __name((_5, key) => {
10491
+ get: /* @__PURE__ */ __name((_4, key) => {
10426
10492
  if (typeof key !== "string") return void 0;
10427
10493
  if (scope && key in scope) return scope[key];
10428
10494
  this.assertSafeKey(key);
@@ -10622,7 +10688,7 @@ var AreStore = (_a140 = class extends A_ExecutionContext {
10622
10688
  */
10623
10689
  static get Function() {
10624
10690
  return (target, propertyKey, descriptor) => {
10625
- const targetMeta = _.meta(target.constructor);
10691
+ const targetMeta = c.meta(target.constructor);
10626
10692
  const originalMethod = descriptor.value;
10627
10693
  const allExtensions = targetMeta.get(AreStoreAreComponentMetaKeys.StoreExtensions) || {};
10628
10694
  allExtensions[propertyKey] = originalMethod;
@@ -10631,13 +10697,13 @@ var AreStore = (_a140 = class extends A_ExecutionContext {
10631
10697
  };
10632
10698
  }
10633
10699
  get owner() {
10634
- return _.scope(this).issuer();
10700
+ return c.scope(this).issuer();
10635
10701
  }
10636
10702
  get parent() {
10637
10703
  return this.owner.parent?.scope.resolve(AreStore);
10638
10704
  }
10639
10705
  get context() {
10640
- return _.scope(this).resolve(AreContext);
10706
+ return c.scope(this).resolve(AreContext);
10641
10707
  }
10642
10708
  get watchers() {
10643
10709
  return this.context.get("watchers") || /* @__PURE__ */ new Set();
@@ -10826,7 +10892,7 @@ var AreStore = (_a140 = class extends A_ExecutionContext {
10826
10892
  * @param component
10827
10893
  */
10828
10894
  loadExtensions(component) {
10829
- const targetMeta = _.meta(component);
10895
+ const targetMeta = c.meta(component);
10830
10896
  const allExtensions = targetMeta.get(AreStoreAreComponentMetaKeys.StoreExtensions) || {};
10831
10897
  this.set(allExtensions);
10832
10898
  }
@@ -11318,7 +11384,7 @@ var AreTokenizer = (_a145 = class extends O {
11318
11384
  * Get the AreSyntax from the current scope. The AreSyntax defines the syntax rules and structures for tokenizing templates. It provides mechanisms for parsing and interpreting templates, attributes, directives, interpolations, and event listeners, enabling dynamic and interactive UI rendering within the ARE framework. If no AreSyntax is found in the scope, an error is thrown indicating that AreTokenizer requires an AreSyntax to function properly.
11319
11385
  */
11320
11386
  get config() {
11321
- const syntax = _.scope(this).resolve(AreSyntax);
11387
+ const syntax = c.scope(this).resolve(AreSyntax);
11322
11388
  if (!syntax) throw new AreTokenizerError({
11323
11389
  title: "Syntax Context Not Found",
11324
11390
  description: "AreTokenizer requires an AreSyntax to be present in the same scope. Ensure that an AreSyntax fragment is included in the concept and is accessible from the scope where AreTokenizer is used."
@@ -11582,20 +11648,20 @@ var AreEngine = (_a148 = class extends O {
11582
11648
  };
11583
11649
  }
11584
11650
  async load(scope) {
11585
- const context = scope?.resolve(AreContext) || _.scope(this).resolve(AreContext);
11651
+ const context = scope?.resolve(AreContext) || c.scope(this).resolve(AreContext);
11586
11652
  context?.startPerformance();
11587
- await this.call(AreEngineFeatures.Load, scope || _.scope(this));
11653
+ await this.call(AreEngineFeatures.Load, scope || c.scope(this));
11588
11654
  }
11589
11655
  async build(scope) {
11590
- const context = scope?.resolve(AreContext) || _.scope(this).resolve(AreContext);
11656
+ const context = scope?.resolve(AreContext) || c.scope(this).resolve(AreContext);
11591
11657
  context?.startPerformance("Build Total");
11592
- await this.call(AreEngineFeatures.Build, scope || _.scope(this));
11658
+ await this.call(AreEngineFeatures.Build, scope || c.scope(this));
11593
11659
  context?.endPerformance("Build Total");
11594
11660
  }
11595
11661
  async execute(scope) {
11596
- const context = scope?.resolve(AreContext) || _.scope(this).resolve(AreContext);
11662
+ const context = scope?.resolve(AreContext) || c.scope(this).resolve(AreContext);
11597
11663
  context?.startPerformance("Execute Total");
11598
- await this.call(AreEngineFeatures.Execute, scope || _.scope(this));
11664
+ await this.call(AreEngineFeatures.Execute, scope || c.scope(this));
11599
11665
  context?.endPerformance("Execute Total");
11600
11666
  context?.endPerformance("Total");
11601
11667
  }
@@ -11970,7 +12036,7 @@ var AreDirective = class extends O {
11970
12036
  */
11971
12037
  static Priority(priority) {
11972
12038
  return function(target) {
11973
- const meta = _.meta(target);
12039
+ const meta = c.meta(target);
11974
12040
  meta.priority = priority;
11975
12041
  return target;
11976
12042
  };
@@ -12017,19 +12083,19 @@ var AreDirective = class extends O {
12017
12083
  * @param args - Additional arguments that may be required for the transformation process.
12018
12084
  */
12019
12085
  transform(attribute, ...args) {
12020
- const logger = _.scope(this).resolve(A_Logger);
12086
+ const logger = c.scope(this).resolve(A_Logger);
12021
12087
  if (logger) {
12022
12088
  logger.warning(`No transforming logic defined for directive: ${attribute.name} with content: ${attribute.content}`);
12023
12089
  }
12024
12090
  }
12025
12091
  compile(attribute, ...args) {
12026
- const logger = _.scope(this).resolve(A_Logger);
12092
+ const logger = c.scope(this).resolve(A_Logger);
12027
12093
  if (logger) {
12028
12094
  logger.warning(`No compiling logic defined for directive: ${attribute.name} with content: ${attribute.content}`);
12029
12095
  }
12030
12096
  }
12031
12097
  update(attribute, ...args) {
12032
- const logger = _.scope(this).resolve(A_Logger);
12098
+ const logger = c.scope(this).resolve(A_Logger);
12033
12099
  if (logger) {
12034
12100
  logger.warning(`No update logic defined for directive: ${attribute.name} with content: ${attribute.content}`);
12035
12101
  }
@@ -12069,7 +12135,8 @@ var AreHTMLInstructions = {
12069
12135
  AddStyle: "_AreHTML_AddStyle",
12070
12136
  AddListener: "_AreHTML_AddListener",
12071
12137
  AddInterpolation: "_AreHTML_AddInterpolation",
12072
- AddComment: "_AreHTML_AddComment"
12138
+ AddComment: "_AreHTML_AddComment",
12139
+ HideElement: "_AreHTML_HideElement"
12073
12140
  };
12074
12141
 
12075
12142
  // src/instructions/AddComment.instruction.ts
@@ -12137,6 +12204,7 @@ var AreDirectiveFor = class extends AreDirective {
12137
12204
  const owner = attribute.owner;
12138
12205
  const currentChildren = [...owner.children];
12139
12206
  attribute.value = newArray;
12207
+ const attached = this.isAttached(owner);
12140
12208
  const computeKey = this.makeKeyFn(key, index, trackExpr);
12141
12209
  const childByKey = /* @__PURE__ */ new Map();
12142
12210
  const remaining = /* @__PURE__ */ new Set();
@@ -12173,15 +12241,29 @@ var AreDirectiveFor = class extends AreDirective {
12173
12241
  }
12174
12242
  }
12175
12243
  for (const child of remaining) {
12176
- child.unmount();
12244
+ if (attached) child.unmount();
12177
12245
  owner.removeChild(child);
12178
12246
  }
12179
12247
  for (const child of newOnes) {
12180
12248
  child.transform();
12181
12249
  child.compile();
12182
- child.mount();
12250
+ if (attached) child.mount();
12183
12251
  }
12184
12252
  }
12253
+ /**
12254
+ * Walks the node's ancestor chain (inclusive) and reports whether the
12255
+ * whole path is currently active — i.e. the subtree is actually rendered
12256
+ * into the DOM. A single inactive ancestor scene (e.g. a `$if` whose
12257
+ * condition is false) means the subtree is detached.
12258
+ */
12259
+ isAttached(node) {
12260
+ let current = node;
12261
+ while (current) {
12262
+ if (current.scene?.isInactive) return false;
12263
+ current = current.parent;
12264
+ }
12265
+ return true;
12266
+ }
12185
12267
  // ─────────────────────────────────────────────────────────────────────────────
12186
12268
  // ── Helpers ──────────────────────────────────────────────────────────────────
12187
12269
  // ─────────────────────────────────────────────────────────────────────────────
@@ -12199,12 +12281,12 @@ var AreDirectiveFor = class extends AreDirective {
12199
12281
  if (item == null) return i6;
12200
12282
  if (path === key || path === "$index") return path === "$index" ? i6 : item;
12201
12283
  const parts = path.split(".");
12202
- let v7 = item;
12284
+ let v6 = item;
12203
12285
  for (const p5 of parts) {
12204
- if (v7 == null) return i6;
12205
- v7 = v7[p5];
12286
+ if (v6 == null) return i6;
12287
+ v6 = v6[p5];
12206
12288
  }
12207
- return v7 ?? i6;
12289
+ return v6 ?? i6;
12208
12290
  };
12209
12291
  }
12210
12292
  /**
@@ -12433,6 +12515,85 @@ AreDirectiveIf = __decorateClass([
12433
12515
  AreDirective.Priority(2)
12434
12516
  ], AreDirectiveIf);
12435
12517
 
12518
+ // src/instructions/HideElement.instruction.ts
12519
+ var HideElementInstruction = class extends AreMutation {
12520
+ constructor(parent, props) {
12521
+ if ("aseid" in props) {
12522
+ super(props);
12523
+ } else {
12524
+ super(AreHTMLInstructions.HideElement, parent, props);
12525
+ }
12526
+ }
12527
+ };
12528
+ __name(HideElementInstruction, "HideElementInstruction");
12529
+ HideElementInstruction = __decorateClass([
12530
+ R4.Define({
12531
+ namespace: "a-are-html",
12532
+ description: 'Toggles the visibility of an existing element by setting its inline display to "none" on apply and restoring the previous inline display on revert. Used by the $show directive to hide/show an element without unmounting it, preserving its subtree, listeners and scene state.'
12533
+ })
12534
+ ], HideElementInstruction);
12535
+
12536
+ // src/directives/AreDirectiveShow.directive.ts
12537
+ var AreDirectiveShow = class extends AreDirective {
12538
+ transform(attribute, logger, ...args) {
12539
+ logger.debug(`[Transform] directive $SHOW for <${attribute.owner.aseid.toString()}> (no structural change)`);
12540
+ }
12541
+ compile(attribute, store, scene, syntax, directiveContext, ...args) {
12542
+ const visible = !!syntax.evaluate(attribute.content, store, {
12543
+ ...directiveContext?.scope || {}
12544
+ });
12545
+ attribute.value = visible;
12546
+ const hide = new HideElementInstruction(scene.host, {});
12547
+ attribute.cache = hide;
12548
+ if (!visible)
12549
+ scene.plan(hide);
12550
+ }
12551
+ update(attribute, store, scene, syntax, directiveContext, ...args) {
12552
+ const previous = !!attribute.value;
12553
+ const next = !!syntax.evaluate(attribute.content, store, {
12554
+ ...directiveContext?.scope || {}
12555
+ });
12556
+ attribute.value = next;
12557
+ if (previous === next) return;
12558
+ const hide = attribute.cache;
12559
+ if (!hide) return;
12560
+ if (next)
12561
+ scene.unPlan(hide);
12562
+ else
12563
+ scene.plan(hide);
12564
+ attribute.owner.interpret();
12565
+ }
12566
+ };
12567
+ __name(AreDirectiveShow, "AreDirectiveShow");
12568
+ __decorateClass([
12569
+ AreDirective.Transform,
12570
+ __decorateParam(0, It(te)),
12571
+ __decorateParam(1, It(A_Logger))
12572
+ ], AreDirectiveShow.prototype, "transform", 1);
12573
+ __decorateClass([
12574
+ AreDirective.Compile,
12575
+ __decorateParam(0, It(te)),
12576
+ __decorateParam(1, It(AreStore)),
12577
+ __decorateParam(2, It(AreScene)),
12578
+ __decorateParam(3, It(AreSyntax)),
12579
+ __decorateParam(4, It(AreDirectiveContext))
12580
+ ], AreDirectiveShow.prototype, "compile", 1);
12581
+ __decorateClass([
12582
+ AreDirective.Update,
12583
+ __decorateParam(0, It(te)),
12584
+ __decorateParam(1, It(AreStore)),
12585
+ __decorateParam(2, It(AreScene)),
12586
+ __decorateParam(3, It(AreSyntax)),
12587
+ __decorateParam(4, It(AreDirectiveContext))
12588
+ ], AreDirectiveShow.prototype, "update", 1);
12589
+ AreDirectiveShow = __decorateClass([
12590
+ R4.Define({
12591
+ namespace: "a-are-html",
12592
+ description: "Built-in $show directive. Toggles an element's visibility by flipping its inline display value based on a store expression, keeping the element mounted (subtree, listeners and scene state preserved) instead of unmounting it like $if."
12593
+ }),
12594
+ AreDirective.Priority(3)
12595
+ ], AreDirectiveShow);
12596
+
12436
12597
  // src/instructions/AddAttribute.instruction.ts
12437
12598
  var AddAttributeInstruction = class extends AreMutation {
12438
12599
  constructor(parent, props) {
@@ -12555,8 +12716,8 @@ var AreHTMLNode = class extends AreNode {
12555
12716
  get directives() {
12556
12717
  const directives = this.scope.resolveFlatAll(AreDirectiveAttribute);
12557
12718
  return directives.filter((d4) => d4.component).sort((a4, b3) => {
12558
- const aMeta = _.meta(a4.component);
12559
- const bMeta = _.meta(b3.component);
12719
+ const aMeta = c.meta(a4.component);
12720
+ const bMeta = c.meta(b3.component);
12560
12721
  const aPriority = aMeta.priority ?? 0;
12561
12722
  const bPriority = bMeta.priority ?? 0;
12562
12723
  return bPriority - aPriority;
@@ -12828,10 +12989,10 @@ function normalizeStyleValue(value) {
12828
12989
  if (typeof value === "object") {
12829
12990
  const parts = [];
12830
12991
  for (const key of Object.keys(value)) {
12831
- const v7 = value[key];
12832
- if (v7 === null || v7 === void 0 || v7 === false) continue;
12992
+ const v6 = value[key];
12993
+ if (v6 === null || v6 === void 0 || v6 === false) continue;
12833
12994
  const kebab = key.replace(/[A-Z]/g, (m6) => "-" + m6.toLowerCase());
12834
- parts.push(`${kebab}: ${v7}`);
12995
+ parts.push(`${kebab}: ${v6}`);
12835
12996
  }
12836
12997
  return parts.join("; ");
12837
12998
  }
@@ -13380,6 +13541,19 @@ var AreHTMLInterpreter = class extends AreInterpreter {
13380
13541
  console.log("Error removing attribute:", error);
13381
13542
  }
13382
13543
  }
13544
+ hideElement(mutation, context) {
13545
+ const element = context.getElementByInstruction(mutation.parent);
13546
+ if (!element || element.nodeType !== Node.ELEMENT_NODE) return;
13547
+ const el = element;
13548
+ mutation.cache = el.style.display;
13549
+ el.style.display = "none";
13550
+ }
13551
+ showElement(mutation, context) {
13552
+ const element = context.getElementByInstruction(mutation.parent);
13553
+ if (!element || element.nodeType !== Node.ELEMENT_NODE) return;
13554
+ const el = element;
13555
+ el.style.display = mutation.payload?.display ?? mutation.cache ?? "";
13556
+ }
13383
13557
  addEventListener(mutation, context, store, syntax, directiveContext, logger) {
13384
13558
  const element = context.getElementByInstruction(mutation.parent);
13385
13559
  if (!element) {
@@ -13633,6 +13807,22 @@ __decorateClass([
13633
13807
  __decorateParam(0, It(te)),
13634
13808
  __decorateParam(1, It(AreHTMLEngineContext))
13635
13809
  ], AreHTMLInterpreter.prototype, "removeAttribute", 1);
13810
+ __decorateClass([
13811
+ R4.Define({
13812
+ description: "Hide an element by setting inline display:none, caching its previous inline display value for restoration on revert."
13813
+ }),
13814
+ AreInterpreter.Apply(AreHTMLInstructions.HideElement),
13815
+ __decorateParam(0, It(te)),
13816
+ __decorateParam(1, It(AreHTMLEngineContext))
13817
+ ], AreHTMLInterpreter.prototype, "hideElement", 1);
13818
+ __decorateClass([
13819
+ R4.Define({
13820
+ description: "Restore an element hidden by a HideElement instruction back to its previous inline display value."
13821
+ }),
13822
+ AreInterpreter.Revert(AreHTMLInstructions.HideElement),
13823
+ __decorateParam(0, It(te)),
13824
+ __decorateParam(1, It(AreHTMLEngineContext))
13825
+ ], AreHTMLInterpreter.prototype, "showElement", 1);
13636
13826
  __decorateClass([
13637
13827
  R4.Define({
13638
13828
  description: "Add an event listener to an HTML element based on the provided mutation instruction."
@@ -13908,6 +14098,100 @@ AreHTMLTransformer = __decorateClass([
13908
14098
  })
13909
14099
  ], AreHTMLTransformer);
13910
14100
 
14101
+ // src/lib/AreRoot/AreRootCache.context.ts
14102
+ var AreRootCache = class extends B {
14103
+ constructor(limit = 10) {
14104
+ super({ name: "AreRootCache" });
14105
+ /**
14106
+ * rootId -> (component tag -> cache entry). The inner Map preserves
14107
+ * insertion order which is used as the LRU recency order: the first key is
14108
+ * the least-recently-used entry, the last key the most-recently-used.
14109
+ */
14110
+ this._cache = /* @__PURE__ */ new Map();
14111
+ this._limit = Math.max(0, Math.floor(limit));
14112
+ }
14113
+ /**
14114
+ * Maximum number of cached subtrees kept per root.
14115
+ */
14116
+ get limit() {
14117
+ return this._limit;
14118
+ }
14119
+ bucket(rootId) {
14120
+ let bucket = this._cache.get(rootId);
14121
+ if (!bucket) {
14122
+ bucket = /* @__PURE__ */ new Map();
14123
+ this._cache.set(rootId, bucket);
14124
+ }
14125
+ return bucket;
14126
+ }
14127
+ /**
14128
+ * Whether a subtree for the given component tag is currently cached.
14129
+ */
14130
+ has(rootId, tag) {
14131
+ return this.bucket(rootId).has(tag);
14132
+ }
14133
+ /**
14134
+ * Retrieve AND remove a cached subtree so it can become live again. Returns
14135
+ * `undefined` on a cache miss.
14136
+ */
14137
+ take(rootId, tag) {
14138
+ const bucket = this.bucket(rootId);
14139
+ const entry = bucket.get(tag);
14140
+ if (entry) {
14141
+ bucket.delete(tag);
14142
+ }
14143
+ return entry;
14144
+ }
14145
+ /**
14146
+ * Stash a detached subtree under the given component tag. Returns any entries
14147
+ * that were evicted to honour the LRU limit (or replaced for the same tag) so
14148
+ * the caller can `destroy()` them.
14149
+ */
14150
+ put(rootId, tag, entry) {
14151
+ const bucket = this.bucket(rootId);
14152
+ const evicted = [];
14153
+ const existing = bucket.get(tag);
14154
+ if (existing) {
14155
+ bucket.delete(tag);
14156
+ if (existing.node !== entry.node) {
14157
+ evicted.push(existing);
14158
+ }
14159
+ }
14160
+ bucket.set(tag, entry);
14161
+ while (bucket.size > this._limit) {
14162
+ const oldestKey = bucket.keys().next().value;
14163
+ if (oldestKey === void 0) {
14164
+ break;
14165
+ }
14166
+ const oldest = bucket.get(oldestKey);
14167
+ bucket.delete(oldestKey);
14168
+ evicted.push(oldest);
14169
+ }
14170
+ return evicted;
14171
+ }
14172
+ /**
14173
+ * Remove and return every cached entry for a root (e.g. on teardown) so the
14174
+ * caller can destroy them.
14175
+ */
14176
+ clear(rootId) {
14177
+ const bucket = this._cache.get(rootId);
14178
+ if (!bucket) {
14179
+ return [];
14180
+ }
14181
+ const entries = [...bucket.values()];
14182
+ bucket.clear();
14183
+ this._cache.delete(rootId);
14184
+ return entries;
14185
+ }
14186
+ };
14187
+ __name(AreRootCache, "AreRootCache");
14188
+ AreRootCache = __decorateClass([
14189
+ R4.Define({
14190
+ namespace: "a-are-html",
14191
+ description: "AreRootCache is a fragment that keeps a small per-root LRU of previously rendered are-root subtrees. When an are-root swaps the component it displays, the outgoing subtree is stashed here (unmounted + detached, but not destroyed) so that routing back to it can re-inject the preserved scene instantly instead of rebuilding from scratch."
14192
+ })
14193
+ ], AreRootCache);
14194
+
13911
14195
  // src/engine/AreHTML.engine.ts
13912
14196
  var AreHTMLEngine = class extends AreEngine {
13913
14197
  get DefaultSyntax() {
@@ -13931,7 +14215,7 @@ var AreHTMLEngine = class extends AreEngine {
13931
14215
  component: AreInterpolation,
13932
14216
  priority: 9,
13933
14217
  nested: false,
13934
- extract: /* @__PURE__ */ __name((_5, match) => ({ key: match.content }), "extract")
14218
+ extract: /* @__PURE__ */ __name((_4, match) => ({ key: match.content }), "extract")
13935
14219
  },
13936
14220
  // are-root — matched before generic elements, produces AreRootNode
13937
14221
  {
@@ -13953,7 +14237,7 @@ var AreHTMLEngine = class extends AreEngine {
13953
14237
  ]
13954
14238
  });
13955
14239
  }
13956
- async init(scope, signalContext) {
14240
+ async init(scope, signalContext, rootCache) {
13957
14241
  this.package(scope, {
13958
14242
  context: new AreHTMLEngineContext({}),
13959
14243
  syntax: this.DefaultSyntax,
@@ -13967,6 +14251,10 @@ var AreHTMLEngine = class extends AreEngine {
13967
14251
  signalContext = new AreSignalsContext();
13968
14252
  scope.register(signalContext);
13969
14253
  }
14254
+ if (!rootCache) {
14255
+ rootCache = new AreRootCache();
14256
+ scope.register(rootCache);
14257
+ }
13970
14258
  }
13971
14259
  rootElementMatcher(source, from, to, build) {
13972
14260
  const rootTag = "are-root";
@@ -14077,7 +14365,8 @@ __decorateClass([
14077
14365
  before: /.*/
14078
14366
  }),
14079
14367
  __decorateParam(0, It(R)),
14080
- __decorateParam(1, It(AreSignalsContext))
14368
+ __decorateParam(1, It(AreSignalsContext)),
14369
+ __decorateParam(2, It(AreRootCache))
14081
14370
  ], AreHTMLEngine.prototype, "init", 1);
14082
14371
  AreHTMLEngine = __decorateClass([
14083
14372
  R4.Define({
@@ -14088,7 +14377,7 @@ AreHTMLEngine = __decorateClass([
14088
14377
 
14089
14378
  // src/lib/AreRoot/AreRoot.component.ts
14090
14379
  var AreRoot = class extends Are {
14091
- async template(root, logger, signalsContext) {
14380
+ async template(root, logger, signalsContext, signalState) {
14092
14381
  const rootId = root.id;
14093
14382
  if (signalsContext && !signalsContext.hasRoot(rootId)) {
14094
14383
  if (!root.content?.trim()) {
@@ -14100,26 +14389,9 @@ var AreRoot = class extends Are {
14100
14389
  }
14101
14390
  return;
14102
14391
  }
14103
- const currentRoute = AreRoute.default();
14104
- let componentName;
14105
- if (currentRoute) {
14106
- const initialVector = new A_SignalVector([currentRoute]);
14107
- let renderTarget = signalsContext?.findComponentByVector(rootId, initialVector);
14108
- if (!renderTarget) {
14109
- const signalsMeta = _.meta(AreSignals);
14110
- const pool = signalsContext?.getComponentById(rootId);
14111
- const metaTarget = signalsMeta?.findComponentByVector(
14112
- initialVector,
14113
- pool?.length ? pool : void 0
14114
- );
14115
- if (metaTarget && (!pool?.length || pool.includes(metaTarget))) {
14116
- renderTarget = metaTarget;
14117
- }
14118
- }
14119
- if (renderTarget?.name) {
14120
- componentName = P.toKebabCase(renderTarget.name);
14121
- }
14122
- }
14392
+ const initialVector = this.buildInitialVector(signalState);
14393
+ const renderTarget = this.matchComponent(rootId, initialVector, signalsContext);
14394
+ let componentName = renderTarget?.name ? P.toKebabCase(renderTarget.name) : void 0;
14123
14395
  if (!componentName) {
14124
14396
  if (root.content?.trim()) {
14125
14397
  return;
@@ -14141,32 +14413,17 @@ var AreRoot = class extends Are {
14141
14413
  }
14142
14414
  root.setContent(`<${componentName}></${componentName}>`);
14143
14415
  }
14144
- async onSignal(root, vector, logger, signalsContext) {
14416
+ async onSignal(root, vector, logger, signalsContext, cache) {
14145
14417
  const rootId = root.id;
14146
14418
  if (signalsContext && !signalsContext.hasRoot(rootId)) {
14147
14419
  return;
14148
14420
  }
14149
- let renderTarget = signalsContext?.findComponentByVector(rootId, vector);
14150
- if (!renderTarget) {
14151
- const signalsMeta = _.meta(AreSignals);
14152
- const pool = signalsContext?.getComponentById(rootId);
14153
- const metaTarget = signalsMeta?.findComponentByVector(
14154
- vector,
14155
- pool?.length ? pool : void 0
14156
- );
14157
- if (metaTarget && (!pool?.length || pool.includes(metaTarget))) {
14158
- renderTarget = metaTarget;
14159
- }
14160
- }
14421
+ const renderTarget = this.matchComponent(rootId, vector, signalsContext);
14161
14422
  const def = signalsContext?.getDefault(rootId);
14162
14423
  const componentName = renderTarget?.name ? P.toKebabCase(renderTarget.name) : def?.name ? P.toKebabCase(def.name) : void 0;
14163
14424
  if (!componentName) {
14164
- for (let i6 = 0; i6 < root.children.length; i6++) {
14165
- const child = root.children[i6];
14166
- signalsContext?.unsubscribe(child);
14167
- child.unmount();
14168
- child.destroy();
14169
- root.removeChild(child);
14425
+ for (const child of [...root.children]) {
14426
+ this.stashChild(root, child, signalsContext, cache);
14170
14427
  }
14171
14428
  root.setContent("");
14172
14429
  return;
@@ -14175,13 +14432,14 @@ var AreRoot = class extends Are {
14175
14432
  if (currentChild?.type === componentName) {
14176
14433
  return;
14177
14434
  }
14435
+ for (const child of [...root.children]) {
14436
+ this.stashChild(root, child, signalsContext, cache);
14437
+ }
14178
14438
  root.setContent(`<${componentName}></${componentName}>`);
14179
- for (let i6 = 0; i6 < root.children.length; i6++) {
14180
- const child = root.children[i6];
14181
- signalsContext?.unsubscribe(child);
14182
- child.unmount();
14183
- child.destroy();
14184
- root.removeChild(child);
14439
+ const cached = cache?.take(root.id, componentName);
14440
+ if (cached) {
14441
+ this.restoreChild(root, cached, signalsContext);
14442
+ return;
14185
14443
  }
14186
14444
  root.tokenize();
14187
14445
  for (let i6 = 0; i6 < root.children.length; i6++) {
@@ -14196,20 +14454,139 @@ var AreRoot = class extends Are {
14196
14454
  child.mount();
14197
14455
  }
14198
14456
  }
14457
+ /**
14458
+ * Resolves the component a vector should render for the given root, mirroring
14459
+ * the priority used everywhere in the routing system:
14460
+ * 1. Root-specific conditions registered on AreSignalsContext.
14461
+ * 2. The global AreSignalsMeta map, restricted to this outlet's pool.
14462
+ *
14463
+ * Passing the pool *into* the meta lookup is critical: without it, the first
14464
+ * globally matching component wins and may belong to a different outlet
14465
+ * (e.g. AisRequirementsPanel for the meta-outlet matching
14466
+ * AisEditorCursorScope) — the pool check would then reject it and the outlet
14467
+ * would fall back to its default, hiding a valid in-pool match (e.g.
14468
+ * AisDiagramTab matching AisSetPrimaryDisplay).
14469
+ *
14470
+ * Returns `undefined` when nothing matches — callers decide whether to use a
14471
+ * configured default, body content, or clear the outlet.
14472
+ */
14473
+ matchComponent(rootId, vector, signalsContext) {
14474
+ if (!vector) return void 0;
14475
+ let renderTarget = signalsContext?.findComponentByVector(rootId, vector);
14476
+ if (!renderTarget) {
14477
+ const signalsMeta = c.meta(AreSignals);
14478
+ const pool = signalsContext?.getComponentById(rootId);
14479
+ const metaTarget = signalsMeta?.findComponentByVector(
14480
+ vector,
14481
+ pool?.length ? pool : void 0,
14482
+ rootId
14483
+ );
14484
+ if (metaTarget && (!pool?.length || pool.includes(metaTarget))) {
14485
+ renderTarget = metaTarget;
14486
+ }
14487
+ }
14488
+ return renderTarget;
14489
+ }
14490
+ /**
14491
+ * Builds the vector used for the INITIAL render. It is seeded from the
14492
+ * accumulated signal state (every signal dispatched on the bus so far) so a
14493
+ * freshly-mounted outlet reflects the live application state immediately,
14494
+ * not just on the next signal tick. The current URL route is appended when
14495
+ * no AreRoute is already present in the state, so route-driven outlets still
14496
+ * resolve on the very first paint (before AreRouteWatcher has dispatched).
14497
+ */
14498
+ buildInitialVector(signalState) {
14499
+ const signals = [];
14500
+ if (signalState) {
14501
+ for (const signal of signalState.toVector()) {
14502
+ if (signal) signals.push(signal);
14503
+ }
14504
+ }
14505
+ if (!signals.some((signal) => signal instanceof AreRoute)) {
14506
+ try {
14507
+ const currentRoute = AreRoute.default();
14508
+ if (currentRoute) signals.push(currentRoute);
14509
+ } catch {
14510
+ }
14511
+ }
14512
+ return new A_SignalVector(signals);
14513
+ }
14514
+ /**
14515
+ * Detach a displayed child subtree from the outlet and stash it in the cache
14516
+ * for fast re-injection later. The subtree is unmounted (its scene plan is
14517
+ * preserved) and deregistered from the root scope, but NOT destroyed. The
14518
+ * nodes that were subscribed to the signal bus are unsubscribed while cached
14519
+ * so the detached DOM never reacts to signals, and recorded so they can be
14520
+ * re-subscribed verbatim on restore.
14521
+ *
14522
+ * When no cache is available, or the LRU evicts an entry, the affected
14523
+ * subtree is fully destroyed.
14524
+ */
14525
+ stashChild(root, child, signalsContext, cache) {
14526
+ const tag = child.type;
14527
+ child.unmount();
14528
+ const subscribers = signalsContext ? this.collectSubscribers(child, signalsContext) : [];
14529
+ for (const node of subscribers) {
14530
+ signalsContext?.unsubscribe(node);
14531
+ }
14532
+ root.removeChild(child);
14533
+ if (!cache) {
14534
+ void child.destroy();
14535
+ return;
14536
+ }
14537
+ const evicted = cache.put(root.id, tag, { node: child, subscribers });
14538
+ for (const entry of evicted) {
14539
+ void entry.node.destroy();
14540
+ }
14541
+ }
14542
+ /**
14543
+ * Re-attach a cached subtree to the outlet and re-mount it from its preserved
14544
+ * scene plan, re-subscribing exactly the nodes that were subscribed before it
14545
+ * was cached.
14546
+ */
14547
+ restoreChild(root, entry, signalsContext) {
14548
+ const child = entry.node;
14549
+ root.addChild(child);
14550
+ for (const node of entry.subscribers) {
14551
+ signalsContext?.subscribe(node);
14552
+ }
14553
+ child.mount();
14554
+ }
14555
+ /**
14556
+ * Walk a subtree and collect the nodes currently registered as signal
14557
+ * subscribers. Mirrors the subscription performed at init time in
14558
+ * AreHTMLLifecycle (component nodes and root nodes) without depending on the
14559
+ * concrete node classes — it simply intersects the subtree with the live
14560
+ * subscriber registry.
14561
+ */
14562
+ collectSubscribers(node, signalsContext) {
14563
+ const result = [];
14564
+ const queue = [node];
14565
+ while (queue.length > 0) {
14566
+ const current = queue.shift();
14567
+ if (signalsContext.subscribers.has(current)) {
14568
+ result.push(current);
14569
+ }
14570
+ queue.push(...current.children);
14571
+ }
14572
+ return result;
14573
+ }
14199
14574
  };
14200
14575
  __name(AreRoot, "AreRoot");
14201
14576
  __decorateClass([
14202
14577
  Are.Template,
14203
14578
  __decorateParam(0, It(te)),
14204
14579
  __decorateParam(1, It(A_Logger)),
14205
- __decorateParam(2, It(AreSignalsContext))
14580
+ __decorateParam(2, It(AreSignalsContext)),
14581
+ __decorateParam(3, It(A_SignalState))
14206
14582
  ], AreRoot.prototype, "template", 1);
14207
14583
  __decorateClass([
14208
14584
  Are.Signal,
14209
14585
  __decorateParam(0, It(te)),
14210
14586
  __decorateParam(1, It(A_SignalVector)),
14211
14587
  __decorateParam(2, It(A_Logger)),
14212
- __decorateParam(3, It(AreSignalsContext))
14588
+ __decorateParam(3, It(AreSignalsContext)),
14589
+ __decorateParam(4, It(AreRootCache))
14213
14590
  ], AreRoot.prototype, "onSignal", 1);
14214
14591
  AreRoot = __decorateClass([
14215
14592
  R4.Define({
@@ -14580,6 +14957,33 @@ var SettingsPage = class extends Are {
14580
14957
  </label>
14581
14958
  </div>
14582
14959
 
14960
+ <div class="settings-group">
14961
+ <h2>Directive demo \xB7 <code>$show</code> vs <code>$if</code></h2>
14962
+ <p class="hint">
14963
+ Type something into both boxes below, then toggle <strong>Compact layout</strong>
14964
+ twice. Both panels react to the same <code>compact</code> store flag, but:
14965
+ </p>
14966
+
14967
+ <div class="demo-panel demo-show" $show="!compact">
14968
+ <span class="demo-tag">$show</span>
14969
+ <p>
14970
+ Toggled with <code>$show</code> \u2014 I stay <strong>mounted</strong> and only my
14971
+ inline <code>display</code> flips. Your text below <strong>survives</strong>
14972
+ the toggle because the DOM node is never destroyed.
14973
+ </p>
14974
+ <input type="text" placeholder="Scratch text (survives toggle)\u2026" />
14975
+ </div>
14976
+
14977
+ <div class="demo-panel demo-if" $if="!compact">
14978
+ <span class="demo-tag">$if</span>
14979
+ <p>
14980
+ Toggled with <code>$if</code> \u2014 I am <strong>unmounted</strong> and rebuilt
14981
+ each time I reappear. Your text below is <strong>wiped</strong> on every toggle.
14982
+ </p>
14983
+ <input type="text" placeholder="Scratch text (lost on toggle)\u2026" />
14984
+ </div>
14985
+ </div>
14986
+
14583
14987
  <div class="settings-group">
14584
14988
  <h2>Display name</h2>
14585
14989
  <div class="input-row">
@@ -14621,6 +15025,18 @@ var SettingsPage = class extends Are {
14621
15025
  .preview strong { color: #a78bfa; }
14622
15026
  .hint { font-size: 13px; color: #71717a; line-height: 1.7; }
14623
15027
  .hint code { background: #27272a; padding: 1px 6px; border-radius: 4px; color: #a78bfa; font-size: 12px; }
15028
+ .settings-group h2 code { background: #27272a; padding: 1px 6px; border-radius: 4px; color: #a78bfa; font-size: 12px; font-weight: 600; }
15029
+ .demo-panel { position: relative; background: #1c1c1f; border: 1px solid #27272a; border-radius: 10px; padding: 18px 18px 18px 20px; margin-top: 14px; }
15030
+ .demo-panel p { font-size: 13px; color: #a1a1aa; line-height: 1.7; margin: 0 0 12px; }
15031
+ .demo-panel p code { background: #27272a; padding: 1px 5px; border-radius: 3px; color: #a78bfa; font-size: 12px; }
15032
+ .demo-panel strong { color: #e4e4e7; }
15033
+ .demo-panel input[type="text"] { background: #131316; border: 1px solid #3f3f46; border-radius: 8px; color: #f4f4f5; padding: 8px 14px; font-size: 13px; outline: none; width: 100%; box-sizing: border-box; }
15034
+ .demo-panel input[type="text"]:focus { border-color: #a78bfa; }
15035
+ .demo-tag { display: inline-block; font-family: monospace; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-bottom: 10px; }
15036
+ .demo-show { border-left: 3px solid #34d399; }
15037
+ .demo-show .demo-tag { background: rgba(52, 211, 153, 0.12); color: #34d399; }
15038
+ .demo-if { border-left: 3px solid #f59e0b; }
15039
+ .demo-if .demo-tag { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
14624
15040
  `);
14625
15041
  }
14626
15042
  onNameInput(store, event) {
@@ -14683,6 +15099,7 @@ SettingsPage = __decorateClass([
14683
15099
  // ── Directives ───────────────────────────────────────────
14684
15100
  AreDirectiveIf,
14685
15101
  AreDirectiveFor,
15102
+ AreDirectiveShow,
14686
15103
  // ── Engine ───────────────────────────────────────────────
14687
15104
  A_SignalBus,
14688
15105
  AreRoot,
@@ -14724,7 +15141,7 @@ SettingsPage = __decorateClass([
14724
15141
  await concept.load();
14725
15142
  await concept.start();
14726
15143
  } catch (error) {
14727
- const logger = _.root.resolve(A_Logger);
15144
+ const logger = c.root.resolve(A_Logger);
14728
15145
  logger.error(error);
14729
15146
  }
14730
15147
  })();