@rs-x/core 0.4.10 → 0.4.12

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 (4) hide show
  1. package/dist/index.d.ts +183 -95
  2. package/dist/index.js +1649 -1315
  3. package/package.json +1 -1
  4. package/readme.md +472 -494
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
5
5
  import { Observable } from "rxjs";
6
6
 
7
7
  // lib/dependency-injection.ts
8
- import "reflect-metadata";
9
8
  import { Container, ContainerModule, inject, injectable, multiInject, preDestroy, unmanaged } from "inversify";
9
+ import "reflect-metadata";
10
10
  var InjectionContainer = new Container();
11
11
  function registerMultiInjectService(container, target, options) {
12
12
  container.bind(target).to(target).inSingletonScope();
@@ -44,6 +44,152 @@ function overrideMultiInjectServices(container, multiInjectToken, services) {
44
44
  }
45
45
  __name(overrideMultiInjectServices, "overrideMultiInjectServices");
46
46
 
47
+ // lib/index-value-accessor/array-index-accessor.ts
48
+ function _ts_decorate(decorators, target, key, desc) {
49
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
50
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
51
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
52
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
53
+ }
54
+ __name(_ts_decorate, "_ts_decorate");
55
+ var ArrayIndexAccessor = class {
56
+ static {
57
+ __name(this, "ArrayIndexAccessor");
58
+ }
59
+ priority = 5;
60
+ getIndexes(array) {
61
+ return array.keys();
62
+ }
63
+ hasValue(array, index) {
64
+ return this.getValue(array, index) !== void 0;
65
+ }
66
+ getResolvedValue(array, index) {
67
+ return array[index];
68
+ }
69
+ getValue(array, index) {
70
+ return this.getResolvedValue(array, index);
71
+ }
72
+ setValue(array, index, value) {
73
+ array[index] = value;
74
+ }
75
+ applies(array) {
76
+ return Array.isArray(array);
77
+ }
78
+ };
79
+ ArrayIndexAccessor = _ts_decorate([
80
+ injectable()
81
+ ], ArrayIndexAccessor);
82
+
83
+ // lib/index-value-accessor/date-property-accessor.interface.ts
84
+ var dataProperties = [
85
+ "year",
86
+ "utcYear",
87
+ "month",
88
+ "utcMonth",
89
+ "date",
90
+ "utcDate",
91
+ "hours",
92
+ "utcHours",
93
+ "minutes",
94
+ "utcMinutes",
95
+ "seconds",
96
+ "utcSeconds",
97
+ "milliseconds",
98
+ "utcMilliseconds",
99
+ "time"
100
+ ];
101
+
102
+ // lib/index-value-accessor/date-property-accessor.ts
103
+ function _ts_decorate2(decorators, target, key, desc) {
104
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
105
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
106
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
107
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
108
+ }
109
+ __name(_ts_decorate2, "_ts_decorate");
110
+ var DatePropertyAccessor = class {
111
+ static {
112
+ __name(this, "DatePropertyAccessor");
113
+ }
114
+ priority = 0;
115
+ _setter = {
116
+ year: /* @__PURE__ */ __name((date, value) => date.setFullYear(value), "year"),
117
+ utcYear: /* @__PURE__ */ __name((date, value) => date.setUTCFullYear(value), "utcYear"),
118
+ month: /* @__PURE__ */ __name((date, value) => date.setMonth(value), "month"),
119
+ utcMonth: /* @__PURE__ */ __name((date, value) => date.setUTCMonth(value), "utcMonth"),
120
+ date: /* @__PURE__ */ __name((date, value) => date.setDate(value), "date"),
121
+ utcDate: /* @__PURE__ */ __name((date, value) => date.setUTCDate(value), "utcDate"),
122
+ hours: /* @__PURE__ */ __name((date, value) => date.setHours(value), "hours"),
123
+ utcHours: /* @__PURE__ */ __name((date, value) => date.setUTCHours(value), "utcHours"),
124
+ minutes: /* @__PURE__ */ __name((date, value) => date.setMinutes(value), "minutes"),
125
+ utcMinutes: /* @__PURE__ */ __name((date, value) => date.setUTCMinutes(value), "utcMinutes"),
126
+ seconds: /* @__PURE__ */ __name((date, value) => date.setSeconds(value), "seconds"),
127
+ utcSeconds: /* @__PURE__ */ __name((date, value) => date.setUTCSeconds(value), "utcSeconds"),
128
+ milliseconds: /* @__PURE__ */ __name((date, value) => date.setMilliseconds(value), "milliseconds"),
129
+ utcMilliseconds: /* @__PURE__ */ __name((date, value) => date.setUTCMilliseconds(value), "utcMilliseconds"),
130
+ time: /* @__PURE__ */ __name((date, value) => date.setTime(value), "time")
131
+ };
132
+ _getters = {
133
+ year: /* @__PURE__ */ __name((date) => date.getFullYear(), "year"),
134
+ utcYear: /* @__PURE__ */ __name((date) => date.getUTCFullYear(), "utcYear"),
135
+ month: /* @__PURE__ */ __name((date) => date.getMonth(), "month"),
136
+ utcMonth: /* @__PURE__ */ __name((date) => date.getUTCMonth(), "utcMonth"),
137
+ date: /* @__PURE__ */ __name((date) => date.getDate(), "date"),
138
+ utcDate: /* @__PURE__ */ __name((date) => date.getUTCDate(), "utcDate"),
139
+ hours: /* @__PURE__ */ __name((date) => date.getHours(), "hours"),
140
+ utcHours: /* @__PURE__ */ __name((date) => date.getUTCHours(), "utcHours"),
141
+ minutes: /* @__PURE__ */ __name((date) => date.getMinutes(), "minutes"),
142
+ utcMinutes: /* @__PURE__ */ __name((date) => date.getUTCMinutes(), "utcMinutes"),
143
+ seconds: /* @__PURE__ */ __name((date) => date.getSeconds(), "seconds"),
144
+ utcSeconds: /* @__PURE__ */ __name((date) => date.getUTCSeconds(), "utcSeconds"),
145
+ milliseconds: /* @__PURE__ */ __name((date) => date.getMilliseconds(), "milliseconds"),
146
+ utcMilliseconds: /* @__PURE__ */ __name((date) => date.getUTCMilliseconds(), "utcMilliseconds"),
147
+ time: /* @__PURE__ */ __name((date) => date.getTime(), "time")
148
+ };
149
+ getIndexes() {
150
+ return dataProperties.values();
151
+ }
152
+ hasValue(context, index) {
153
+ return this.getValue(context, index) !== void 0;
154
+ }
155
+ getResolvedValue(context, index) {
156
+ return this.getValue(context, index);
157
+ }
158
+ getValue(date, index) {
159
+ return this._getters[index]?.(date);
160
+ }
161
+ setValue(date, index, value) {
162
+ this._setter[index]?.(date, value);
163
+ }
164
+ applies(context, index) {
165
+ return context instanceof Date && !!this._getters[index];
166
+ }
167
+ };
168
+ DatePropertyAccessor = _ts_decorate2([
169
+ injectable()
170
+ ], DatePropertyAccessor);
171
+
172
+ // lib/exceptions/custome-error.ts
173
+ var CustomError = class extends Error {
174
+ static {
175
+ __name(this, "CustomError");
176
+ }
177
+ constructor(message, name) {
178
+ super(message);
179
+ this.name = name ?? this.constructor.name;
180
+ }
181
+ };
182
+
183
+ // lib/exceptions/unsupported-exception.ts
184
+ var UnsupportedException = class extends CustomError {
185
+ static {
186
+ __name(this, "UnsupportedException");
187
+ }
188
+ constructor(message) {
189
+ super(message, "UnsupportedException");
190
+ }
191
+ };
192
+
47
193
  // lib/rs-x-core.injection-tokens.ts
48
194
  var RsXCoreInjectionTokens = {
49
195
  IInjectionContainer: Symbol("IInjectionContainer"),
@@ -69,17 +215,26 @@ var RsXCoreInjectionTokens = {
69
215
  IDeepCloneList: Symbol("IDeepCloneList"),
70
216
  IResolvedValueCache: Symbol("IResolvedValueCache"),
71
217
  IDeepCloneExcept: Symbol("IDeepCloneExcept"),
72
- DefaultDeepCloneExcept: Symbol("DefaultDeepCloneExcept")
218
+ DefaultDeepCloneExcept: Symbol("DefaultDeepCloneExcept"),
219
+ IValueMetadataList: Symbol("IValueMetadataList"),
220
+ ArrayMetadata: Symbol("ArrayMetadata"),
221
+ DateMetadata: Symbol("DateMetadata"),
222
+ DummyMetadata: Symbol("DummyMetadata"),
223
+ MapMetadata: Symbol("MapMetadata"),
224
+ ObservableMetadata: Symbol("ObservableMetadata"),
225
+ PromiseMetadata: Symbol("PromiseMetadata"),
226
+ SetMetadata: Symbol("SetMetadata"),
227
+ IValueMetadata: Symbol("IValueMetadata")
73
228
  };
74
229
 
75
- // lib/deep-clone/deep-clone-except.ts
76
- function _ts_decorate(decorators, target, key, desc) {
230
+ // lib/index-value-accessor/index-value-accessor.ts
231
+ function _ts_decorate3(decorators, target, key, desc) {
77
232
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
78
233
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
79
234
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
80
235
  return c > 3 && r && Object.defineProperty(target, key, r), r;
81
236
  }
82
- __name(_ts_decorate, "_ts_decorate");
237
+ __name(_ts_decorate3, "_ts_decorate");
83
238
  function _ts_metadata(k, v) {
84
239
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
85
240
  }
@@ -90,627 +245,346 @@ function _ts_param(paramIndex, decorator) {
90
245
  };
91
246
  }
92
247
  __name(_ts_param, "_ts_param");
93
- var DeepCloneValueExcept = class {
248
+ var IndexValueAccessor = class {
94
249
  static {
95
- __name(this, "DeepCloneValueExcept");
250
+ __name(this, "IndexValueAccessor");
96
251
  }
97
- _resolvedValueCache;
98
- constructor(_resolvedValueCache) {
99
- this._resolvedValueCache = _resolvedValueCache;
252
+ priority = 0;
253
+ _accessors;
254
+ constructor(accessors) {
255
+ this._accessors = [
256
+ ...accessors
257
+ ].sort((a, b) => b.priority - a.priority);
100
258
  }
101
- except(source) {
102
- if (source instanceof Promise || source instanceof Observable) {
103
- return this._resolvedValueCache.get(source);
259
+ getIndexes(context, index) {
260
+ return this.getIndexAccessor(context, index).getIndexes(context, index);
261
+ }
262
+ hasValue(context, index) {
263
+ return this.getIndexAccessor(context, index).hasValue(context, index);
264
+ }
265
+ getResolvedValue(context, index) {
266
+ return this.getIndexAccessor(context, index).getResolvedValue(context, index);
267
+ }
268
+ getValue(context, index) {
269
+ return this.getIndexAccessor(context, index).getValue(context, index);
270
+ }
271
+ setValue(context, index, value) {
272
+ this.getIndexAccessor(context, index).setValue(context, index, value);
273
+ }
274
+ applies(context, index) {
275
+ return this.getIndexAccessor(context, index).applies(context, index);
276
+ }
277
+ getIndexAccessor(context, index) {
278
+ const accessor = this._accessors.find((accessor2) => accessor2.applies(context, index));
279
+ if (!accessor) {
280
+ if (typeof context === "object" && context !== null) {
281
+ throw new UnsupportedException(`No accessor found for ${context.constructor.name}.${String(index)}`);
282
+ } else {
283
+ throw new UnsupportedException(`No accessor found for non-object context: ${String(context)}.${String(index)}`);
284
+ }
104
285
  }
105
- return void 0;
286
+ return accessor;
106
287
  }
107
288
  };
108
- DeepCloneValueExcept = _ts_decorate([
289
+ IndexValueAccessor = _ts_decorate3([
109
290
  injectable(),
110
- _ts_param(0, inject(RsXCoreInjectionTokens.IResolvedValueCache)),
291
+ _ts_param(0, multiInject(RsXCoreInjectionTokens.IIndexValueAccessorList)),
111
292
  _ts_metadata("design:type", Function),
112
293
  _ts_metadata("design:paramtypes", [
113
- typeof IResolvedValueCache === "undefined" ? Object : IResolvedValueCache
294
+ Object
114
295
  ])
115
- ], DeepCloneValueExcept);
296
+ ], IndexValueAccessor);
116
297
 
117
- // lib/deep-clone/default-deep-clone.ts
118
- function _ts_decorate2(decorators, target, key, desc) {
298
+ // lib/index-value-accessor/map-key-accessor.ts
299
+ function _ts_decorate4(decorators, target, key, desc) {
119
300
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
120
301
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
121
302
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
122
303
  return c > 3 && r && Object.defineProperty(target, key, r), r;
123
304
  }
124
- __name(_ts_decorate2, "_ts_decorate");
125
- function _ts_metadata2(k, v) {
126
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
127
- }
128
- __name(_ts_metadata2, "_ts_metadata");
129
- function _ts_param2(paramIndex, decorator) {
130
- return function(target, key) {
131
- decorator(target, key, paramIndex);
132
- };
133
- }
134
- __name(_ts_param2, "_ts_param");
135
- var DefaultDeepClone = class {
305
+ __name(_ts_decorate4, "_ts_decorate");
306
+ var MapKeyAccessor = class {
136
307
  static {
137
- __name(this, "DefaultDeepClone");
308
+ __name(this, "MapKeyAccessor");
138
309
  }
139
- _deepCloneList;
140
- priority = 0;
141
- constructor(_deepCloneList) {
142
- this._deepCloneList = _deepCloneList;
310
+ priority = 4;
311
+ getIndexes(map) {
312
+ return map.keys();
143
313
  }
144
- clone(source) {
145
- let error = null;
146
- for (let i = 0; i < this._deepCloneList.length; i++) {
147
- try {
148
- return this._deepCloneList[i].clone(source);
149
- } catch (e) {
150
- error = e;
151
- }
152
- }
153
- throw error;
314
+ hasValue(map, key) {
315
+ return map.has(key);
316
+ }
317
+ getResolvedValue(map, key) {
318
+ return map.get(key);
319
+ }
320
+ getValue(map, key) {
321
+ return this.getResolvedValue(map, key);
322
+ }
323
+ setValue(map, key, value) {
324
+ map.set(key, value);
325
+ }
326
+ applies(map) {
327
+ return map instanceof Map;
154
328
  }
155
329
  };
156
- DefaultDeepClone = _ts_decorate2([
157
- injectable(),
158
- _ts_param2(0, multiInject(RsXCoreInjectionTokens.IDeepCloneList)),
159
- _ts_metadata2("design:type", Function),
160
- _ts_metadata2("design:paramtypes", [
161
- Object
162
- ])
163
- ], DefaultDeepClone);
330
+ MapKeyAccessor = _ts_decorate4([
331
+ injectable()
332
+ ], MapKeyAccessor);
164
333
 
165
- // lib/deep-clone/lodash-deep-clone.ts
166
- import cloneDeepWith from "lodash.clonedeepwith";
167
- function _ts_decorate3(decorators, target, key, desc) {
168
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
169
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
170
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
171
- return c > 3 && r && Object.defineProperty(target, key, r), r;
172
- }
173
- __name(_ts_decorate3, "_ts_decorate");
174
- function _ts_metadata3(k, v) {
175
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
176
- }
177
- __name(_ts_metadata3, "_ts_metadata");
178
- function _ts_param3(paramIndex, decorator) {
179
- return function(target, key) {
180
- decorator(target, key, paramIndex);
181
- };
182
- }
183
- __name(_ts_param3, "_ts_param");
184
- var LodashDeepClone = class {
334
+ // lib/exceptions/argument-exception.ts
335
+ var ArgumentException = class extends CustomError {
185
336
  static {
186
- __name(this, "LodashDeepClone");
187
- }
188
- _deepCloneExcept;
189
- priority = 1;
190
- constructor(_deepCloneExcept) {
191
- this._deepCloneExcept = _deepCloneExcept;
337
+ __name(this, "ArgumentException");
192
338
  }
193
- clone(source) {
194
- return cloneDeepWith(source, this.cloneExceptPredicate);
339
+ constructor(message) {
340
+ super(message, "ArgumentException");
195
341
  }
196
- cloneExceptPredicate = /* @__PURE__ */ __name((value) => {
197
- return this._deepCloneExcept.except(value);
198
- }, "cloneExceptPredicate");
199
342
  };
200
- LodashDeepClone = _ts_decorate3([
201
- injectable(),
202
- _ts_param3(0, inject(RsXCoreInjectionTokens.DefaultDeepCloneExcept)),
203
- _ts_metadata3("design:type", Function),
204
- _ts_metadata3("design:paramtypes", [
205
- typeof IDeepCloneExcept === "undefined" ? Object : IDeepCloneExcept
206
- ])
207
- ], LodashDeepClone);
208
343
 
209
- // lib/deep-clone/structured-deep-clone.ts
210
- function _ts_decorate4(decorators, target, key, desc) {
211
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
212
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
213
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
214
- return c > 3 && r && Object.defineProperty(target, key, r), r;
215
- }
216
- __name(_ts_decorate4, "_ts_decorate");
217
- var StructuredDeepClone = class {
344
+ // lib/exceptions/assert-exception.ts
345
+ var AssertionError = class extends CustomError {
218
346
  static {
219
- __name(this, "StructuredDeepClone");
347
+ __name(this, "AssertionError");
220
348
  }
221
- priority = 2;
222
- clone(source) {
223
- return structuredClone(source);
349
+ constructor(message) {
350
+ super(message, "AssertionError");
224
351
  }
225
352
  };
226
- StructuredDeepClone = _ts_decorate4([
227
- injectable()
228
- ], StructuredDeepClone);
229
353
 
230
- // lib/equality-service/equality-service.ts
231
- import { createCustomEqual } from "fast-equals";
232
- import { isObservable } from "rxjs";
233
- function _ts_decorate5(decorators, target, key, desc) {
234
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
235
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
236
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
237
- return c > 3 && r && Object.defineProperty(target, key, r), r;
238
- }
239
- __name(_ts_decorate5, "_ts_decorate");
240
- var EqualityService = class {
241
- static {
242
- __name(this, "EqualityService");
243
- }
244
- isEqual = createCustomEqual({
245
- createCustomConfig: /* @__PURE__ */ __name((baseConfig) => ({
246
- ...baseConfig,
247
- areObjectsEqual: /* @__PURE__ */ __name((a, b, equalityCheck) => {
248
- if (isObservable(a) && isObservable(b)) {
249
- return a === b;
250
- }
251
- return baseConfig.areObjectsEqual(a, b, equalityCheck);
252
- }, "areObjectsEqual")
253
- }), "createCustomConfig")
254
- });
255
- };
256
- EqualityService = _ts_decorate5([
257
- injectable()
258
- ], EqualityService);
354
+ // lib/types/property-descriptor-type.enum.ts
355
+ var PropertyDescriptorType = /* @__PURE__ */ (function(PropertyDescriptorType2) {
356
+ PropertyDescriptorType2["Function"] = "Function";
357
+ PropertyDescriptorType2["ReadonlyProperty"] = "ReadonlyProperty";
358
+ PropertyDescriptorType2["Property"] = "Property";
359
+ PropertyDescriptorType2["Field"] = "Field";
360
+ return PropertyDescriptorType2;
361
+ })({});
259
362
 
260
- // lib/error-log/error-log.ts
261
- import { Subject } from "rxjs";
262
- function _ts_decorate6(decorators, target, key, desc) {
263
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
264
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
265
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
266
- return c > 3 && r && Object.defineProperty(target, key, r), r;
267
- }
268
- __name(_ts_decorate6, "_ts_decorate");
269
- function _ts_metadata4(k, v) {
270
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
271
- }
272
- __name(_ts_metadata4, "_ts_metadata");
273
- var ErrorLog = class {
363
+ // lib/types/type.ts
364
+ var emptyValue = Symbol("empty");
365
+ var emptyFunction = /* @__PURE__ */ __name(() => {
366
+ }, "emptyFunction");
367
+ var truePredicate = /* @__PURE__ */ __name(() => true, "truePredicate");
368
+ var echo = /* @__PURE__ */ __name((value) => value, "echo");
369
+ var Type = class _Type {
274
370
  static {
275
- __name(this, "ErrorLog");
371
+ __name(this, "Type");
276
372
  }
277
- _error;
278
- constructor() {
279
- this._error = new Subject();
373
+ static isPositiveIntegerString(value) {
374
+ if (typeof value !== "string" || value.length === 0) {
375
+ return false;
376
+ }
377
+ if (value === "0") {
378
+ return true;
379
+ }
380
+ if (value[0] === "0") {
381
+ return false;
382
+ }
383
+ for (let i = 0; i < value.length; i++) {
384
+ const code = value.charCodeAt(i);
385
+ if (code < 48 || code > 57) {
386
+ return false;
387
+ }
388
+ }
389
+ return true;
280
390
  }
281
- get error() {
282
- return this._error;
391
+ static isPositiveInteger(value) {
392
+ return typeof value === "number" && Number.isInteger(value) && value >= 0 || _Type.isPositiveIntegerString(value);
283
393
  }
284
- add(error) {
285
- console.error(error);
286
- this._error.next(error);
394
+ static walkObjectTopToBottom(object, visit, recursive) {
395
+ if (typeof object !== "object" || object === null) {
396
+ return;
397
+ }
398
+ for (const [key, value] of Object.entries(object)) {
399
+ visit(object, key, value);
400
+ if (recursive && typeof value === "object" && value !== null) {
401
+ _Type.walkObjectTopToBottom(value, visit, recursive);
402
+ }
403
+ }
287
404
  }
288
- clear() {
289
- console.clear();
405
+ static walkObjectBottomToTop(object, visit, recursive) {
406
+ if (typeof object !== "object" || object === null) {
407
+ return;
408
+ }
409
+ for (const [key, value] of Object.entries(object)) {
410
+ if (recursive && typeof value === "object" && value !== null) {
411
+ _Type.walkObjectBottomToTop(value, visit, recursive);
412
+ }
413
+ visit(object, key, value);
414
+ }
415
+ }
416
+ static cast(instance) {
417
+ return instance;
418
+ }
419
+ static isFunction(value) {
420
+ return typeof value === "function";
421
+ }
422
+ static isMethod(value) {
423
+ return typeof value === "function" && !("prototype" in value);
424
+ }
425
+ static isArrowFunction(object) {
426
+ return _Type.isFunction(object) && !Object.prototype.hasOwnProperty.call(object, "prototype");
427
+ }
428
+ static isString(value) {
429
+ return typeof value === "string" || value instanceof String;
430
+ }
431
+ static isNullOrUndefined(value) {
432
+ return value === null || value === void 0;
433
+ }
434
+ static isEmpty(value) {
435
+ return _Type.isNullOrUndefined(value) || _Type.isString(value) && value.length === 0 || Array.isArray(value) && value.length === 0;
436
+ }
437
+ static isPlainObject(object) {
438
+ if (object !== null && typeof object === "object") {
439
+ const prototype = Object.getPrototypeOf(object);
440
+ return prototype === Object.prototype || prototype === null;
441
+ }
442
+ return false;
443
+ }
444
+ static hasProperty(root, name) {
445
+ for (let current = root; current && current !== Object.prototype; current = Object.getPrototypeOf(current)) {
446
+ if (Object.prototype.hasOwnProperty.call(current, name)) {
447
+ return true;
448
+ }
449
+ }
450
+ return false;
451
+ }
452
+ static hasOwnPropertyInPrototypeChain(target, key) {
453
+ if (target == null) {
454
+ return false;
455
+ }
456
+ let proto = typeof target === "function" ? target.prototype : Object.getPrototypeOf(target);
457
+ while (proto) {
458
+ if (Object.prototype.hasOwnProperty.call(proto, key)) {
459
+ return true;
460
+ }
461
+ proto = Object.getPrototypeOf(proto);
462
+ }
463
+ return false;
464
+ }
465
+ static getPropertyDescriptorType(propertyDescriptor) {
466
+ if (propertyDescriptor.set) {
467
+ return PropertyDescriptorType.Property;
468
+ }
469
+ if (propertyDescriptor.get) {
470
+ return PropertyDescriptorType.ReadonlyProperty;
471
+ }
472
+ if (_Type.isMethod(propertyDescriptor.value)) {
473
+ return PropertyDescriptorType.Function;
474
+ }
475
+ return PropertyDescriptorType.Field;
476
+ }
477
+ static getPropertyDescriptor(root, name) {
478
+ if (!root || typeof root !== "object") {
479
+ throw new ArgumentException(`Cannot get property '${String(name)}' from non-object root: ${String(root)}`);
480
+ }
481
+ let current = root;
482
+ while (current && current !== Object.prototype) {
483
+ const propertyDescriptor = Object.getOwnPropertyDescriptor(current, name);
484
+ if (propertyDescriptor) {
485
+ return {
486
+ type: _Type.getPropertyDescriptorType(propertyDescriptor),
487
+ descriptor: propertyDescriptor
488
+ };
489
+ }
490
+ current = Object.getPrototypeOf(current);
491
+ }
492
+ const constructorName = root.constructor?.name || "UnknownObject";
493
+ throw new ArgumentException(`${constructorName} does not have a property, method or field with name '${String(name)}'`);
494
+ }
495
+ static toObject(context) {
496
+ if (context && (typeof context === "object" || typeof context === "function")) {
497
+ return context;
498
+ }
499
+ return void 0;
500
+ }
501
+ static getConstructorName(value) {
502
+ if (typeof value === "object" && value !== null) {
503
+ return value.constructor.name;
504
+ }
505
+ return "unknown";
290
506
  }
291
507
  };
292
- ErrorLog = _ts_decorate6([
293
- injectable(),
294
- _ts_metadata4("design:type", Function),
295
- _ts_metadata4("design:paramtypes", [])
296
- ], ErrorLog);
297
508
 
298
- // lib/error-log/pretty-printer.ts
299
- function registerHandler(handler) {
300
- return {
301
- predicate: handler.predicate,
302
- action: /* @__PURE__ */ __name((value, level, quoteStrings) => handler.action(value, level, quoteStrings), "action")
303
- };
304
- }
305
- __name(registerHandler, "registerHandler");
306
- var PrettyPrinter = class {
509
+ // lib/exceptions/invalid-cast-exception.ts
510
+ var InvalidCastException = class extends CustomError {
307
511
  static {
308
- __name(this, "PrettyPrinter");
309
- }
310
- indent;
311
- handlers;
312
- constructor(indent = 4) {
313
- this.indent = indent;
314
- this.handlers = [
315
- registerHandler({
316
- predicate: /* @__PURE__ */ __name((v) => v === null || [
317
- "string",
318
- "number",
319
- "boolean",
320
- "bigint",
321
- "symbol",
322
- "undefined"
323
- ].includes(typeof v), "predicate"),
324
- action: /* @__PURE__ */ __name((v, level, quoteStrings) => [
325
- this.spaces(level) + this.formatPrimitive(v, quoteStrings ?? false)
326
- ], "action")
327
- }),
328
- registerHandler({
329
- predicate: /* @__PURE__ */ __name((v) => typeof v === "function", "predicate"),
330
- action: /* @__PURE__ */ __name((_, level) => [
331
- this.spaces(level) + "[[function]]"
332
- ], "action")
333
- }),
334
- registerHandler({
335
- predicate: Array.isArray,
336
- action: /* @__PURE__ */ __name((v, level, quoteStrings) => {
337
- if (v.length === 0) {
338
- return [
339
- this.spaces(level) + "[]"
340
- ];
341
- }
342
- const lines = [
343
- this.spaces(level) + "["
344
- ];
345
- for (let i = 0; i < v.length; i++) {
346
- const nested = this.toLines(v[i], level + 1, quoteStrings);
347
- lines.push(...nested);
348
- if (i < v.length - 1) {
349
- lines[lines.length - 1] += ",";
350
- }
351
- }
352
- lines.push(this.spaces(level) + "]");
353
- return lines;
354
- }, "action")
355
- }),
356
- registerHandler({
357
- predicate: /* @__PURE__ */ __name((v) => v instanceof Map, "predicate"),
358
- action: /* @__PURE__ */ __name((v, level, quoteStrings) => {
359
- if (v.size === 0) {
360
- return [
361
- this.spaces(level) + "{}"
362
- ];
363
- }
364
- const lines = [
365
- this.spaces(level) + "{"
366
- ];
367
- const next = this.spaces(level + 1);
368
- for (const [k, val] of v.entries()) {
369
- const nested = this.toLines(val, level + 1, quoteStrings);
370
- lines.push(`${next}${this.formatKey(k)}: ${nested[0].trimStart()}`);
371
- if (nested.length > 1) {
372
- lines.push(...nested.slice(1));
373
- }
374
- }
375
- lines.push(this.spaces(level) + "}");
376
- return lines;
377
- }, "action")
378
- }),
379
- registerHandler({
380
- predicate: /* @__PURE__ */ __name((v) => v instanceof Set, "predicate"),
381
- action: /* @__PURE__ */ __name((v, level, quoteStrings) => {
382
- if (v.size === 0) {
383
- return [
384
- this.spaces(level) + "{}"
385
- ];
386
- }
387
- const lines = [
388
- this.spaces(level) + "{"
389
- ];
390
- for (const item of v) {
391
- lines.push(...this.toLines(item, level + 1, quoteStrings));
392
- }
393
- lines.push(this.spaces(level) + "}");
394
- return lines;
395
- }, "action")
396
- }),
397
- registerHandler({
398
- predicate: /* @__PURE__ */ __name((v) => typeof v === "object" && v !== null && "toLines" in v, "predicate"),
399
- action: /* @__PURE__ */ __name((v, _level) => v.toLines(this.indent, _level), "action")
400
- }),
401
- registerHandler({
402
- predicate: /* @__PURE__ */ __name((v) => this.isCustomToString(v), "predicate"),
403
- action: /* @__PURE__ */ __name((v, level) => {
404
- const raw = v.toString(this.indent, level);
405
- const lines = Array.isArray(raw) ? raw : String(raw).split("\n");
406
- return lines.map((l) => this.spaces(level) + l);
407
- }, "action")
408
- }),
409
- registerHandler({
410
- predicate: /* @__PURE__ */ __name((v) => typeof v === "object" && v !== null && !Array.isArray(v), "predicate"),
411
- action: /* @__PURE__ */ __name((v, level, quoteStrings) => {
412
- const keys = Object.keys(v);
413
- if (keys.length === 0) {
414
- return [
415
- this.spaces(level) + "{}"
416
- ];
417
- }
418
- const lines = [
419
- this.spaces(level) + "{"
420
- ];
421
- const next = this.spaces(level + 1);
422
- for (const key of keys) {
423
- const nested = this.toLines(v[key], level + 1, quoteStrings);
424
- lines.push(`${next}${key}: ${nested[0].trimStart()}`);
425
- if (nested.length > 1) {
426
- lines.push(...nested.slice(1));
427
- }
428
- }
429
- lines.push(this.spaces(level) + "}");
430
- return lines;
431
- }, "action")
432
- })
433
- ];
434
- }
435
- toString(value, quoteStrings = true) {
436
- return this.toLines(value, 0, quoteStrings).join("\n");
437
- }
438
- toLines(value, level = 0, quoteStrings = true) {
439
- for (const handler of this.handlers) {
440
- if (handler.predicate(value)) {
441
- return handler.action(value, level, quoteStrings);
442
- }
443
- }
444
- return [
445
- this.spaces(level) + String(value)
446
- ];
447
- }
448
- formatPrimitive(value, quoteStrings) {
449
- if (typeof value === "string" && quoteStrings) {
450
- return `'${value}'`;
451
- }
452
- return String(value);
512
+ __name(this, "InvalidCastException");
453
513
  }
454
- formatKey(key) {
455
- return typeof key === "string" ? key : String(key);
514
+ constructor(message) {
515
+ super(message, "InvalidCastException");
456
516
  }
457
- spaces(level) {
458
- return " ".repeat(this.indent * level);
517
+ };
518
+
519
+ // lib/exceptions/null-or-empty-exception.ts
520
+ var NullOrEmptyException = class extends CustomError {
521
+ static {
522
+ __name(this, "NullOrEmptyException");
459
523
  }
460
- isCustomToString(value) {
461
- if (typeof value !== "object" || value === null) return false;
462
- const proto = Object.getPrototypeOf(value);
463
- if (!proto) return false;
464
- const desc = Object.getOwnPropertyDescriptor(proto, "toString");
465
- return !!desc && typeof desc.value === "function" && desc.value !== Object.prototype.toString;
524
+ constructor(argumentName) {
525
+ super(`'${argumentName}' cannot be null or empty`, "NullOrEmptyException");
466
526
  }
467
527
  };
468
528
 
469
- // lib/error-log/print-value.ts
470
- function printValue(value) {
471
- console.log(new PrettyPrinter().toString(value, false));
472
- }
473
- __name(printValue, "printValue");
474
-
475
- // lib/exceptions/argument-exception.ts
476
- var ArgumentException = class extends Error {
529
+ // lib/exceptions/null-or-undefined-exception.ts
530
+ var NullOrUndefinedException = class extends CustomError {
477
531
  static {
478
- __name(this, "ArgumentException");
532
+ __name(this, "NullOrUndefinedException");
479
533
  }
480
- constructor(message) {
481
- super(message);
534
+ constructor(argumentName) {
535
+ super(`'${argumentName}' cannot be null or undefined`, "NullOrEmptyException");
482
536
  }
483
537
  };
484
538
 
485
- // lib/types/property-descriptor-type.enum.ts
486
- var PropertyDescriptorType = /* @__PURE__ */ (function(PropertyDescriptorType2) {
487
- PropertyDescriptorType2["Function"] = "Function";
488
- PropertyDescriptorType2["ReadonlyProperty"] = "ReadonlyProperty";
489
- PropertyDescriptorType2["Property"] = "Property";
490
- PropertyDescriptorType2["Field"] = "Field";
491
- return PropertyDescriptorType2;
492
- })({});
493
-
494
- // lib/types/type.ts
495
- var emptyValue = Symbol("empty");
496
- var emptyFunction = /* @__PURE__ */ __name(() => {
497
- }, "emptyFunction");
498
- var truePredicate = /* @__PURE__ */ __name(() => true, "truePredicate");
499
- var echo = /* @__PURE__ */ __name((value) => value, "echo");
500
- var Type = class _Type {
539
+ // lib/exceptions/assertion.ts
540
+ var Assertion = class {
501
541
  static {
502
- __name(this, "Type");
503
- }
504
- static isPositiveIntegerString(value) {
505
- if (typeof value !== "string" || value.length === 0) {
506
- return false;
507
- }
508
- if (value === "0") {
509
- return true;
510
- }
511
- if (value[0] === "0") {
512
- return false;
513
- }
514
- for (let i = 0; i < value.length; i++) {
515
- const code = value.charCodeAt(i);
516
- if (code < 48 || code > 57) {
517
- return false;
518
- }
519
- }
520
- return true;
542
+ __name(this, "Assertion");
521
543
  }
522
- static isPositiveInteger(value) {
523
- return typeof value === "number" && Number.isInteger(value) && value >= 0 || _Type.isPositiveIntegerString(value);
544
+ constructor() {
524
545
  }
525
- static walkObjectTopToBottom(object, visit, recursive) {
526
- if (typeof object !== "object" || object === null) {
527
- return;
546
+ static assertIsFunction(value, name) {
547
+ if (!Type.isFunction(value)) {
548
+ const typeName = value && typeof value === "object" ? value.constructor?.name : typeof value;
549
+ throw new InvalidCastException(`${typeName}[${name}] is not a function`);
528
550
  }
529
- for (const [key, value] of Object.entries(object)) {
530
- visit(object, key, value);
531
- if (recursive && typeof value === "object" && value !== null) {
532
- _Type.walkObjectTopToBottom(value, visit, recursive);
533
- }
551
+ }
552
+ static assert(predicate, messsage) {
553
+ if (!predicate()) {
554
+ throw new AssertionError(messsage);
534
555
  }
535
556
  }
536
- static walkObjectBottomToTop(object, visit, recursive) {
537
- if (typeof object !== "object" || object === null) {
538
- return;
557
+ static assertNotNullOrUndefined(value, argumentName) {
558
+ if (Type.isNullOrUndefined(value)) {
559
+ throw new NullOrUndefinedException(argumentName);
539
560
  }
540
- for (const [key, value] of Object.entries(object)) {
541
- if (recursive && typeof value === "object" && value !== null) {
542
- _Type.walkObjectBottomToTop(value, visit, recursive);
543
- }
544
- visit(object, key, value);
561
+ }
562
+ static assertNotNullOrEmpty(value, argumentName) {
563
+ if (Type.isEmpty(value)) {
564
+ throw new NullOrEmptyException(argumentName);
545
565
  }
546
566
  }
547
- static cast(instance) {
548
- return instance;
549
- }
550
- static isFunction(value) {
551
- return typeof value === "function";
552
- }
553
- static isMethod(value) {
554
- return typeof value === "function" && !("prototype" in value);
555
- }
556
- static isArrowFunction(object) {
557
- return _Type.isFunction(object) && !Object.prototype.hasOwnProperty.call(object, "prototype");
558
- }
559
- static isString(value) {
560
- return typeof value === "string" || value instanceof String;
561
- }
562
- static isNullOrUndefined(value) {
563
- return value === null || value === void 0;
564
- }
565
- static isEmpty(value) {
566
- return _Type.isNullOrUndefined(value) || _Type.isString(value) && value.length === 0 || Array.isArray(value) && value.length === 0;
567
- }
568
- static isPlainObject(object) {
569
- if (object !== null && typeof object === "object") {
570
- const prototype = Object.getPrototypeOf(object);
571
- return prototype === Object.prototype || prototype === null;
572
- }
573
- return false;
574
- }
575
- static hasProperty(root, name) {
576
- for (let current = root; current && current !== Object.prototype; current = Object.getPrototypeOf(current)) {
577
- if (Object.prototype.hasOwnProperty.call(current, name)) {
578
- return true;
579
- }
580
- }
581
- return false;
582
- }
583
- static hasOwnPropertyInPrototypeChain(target, key) {
584
- if (target == null) {
585
- return false;
586
- }
587
- let proto = typeof target === "function" ? target.prototype : Object.getPrototypeOf(target);
588
- while (proto) {
589
- if (Object.prototype.hasOwnProperty.call(proto, key)) {
590
- return true;
591
- }
592
- proto = Object.getPrototypeOf(proto);
593
- }
594
- return false;
595
- }
596
- static getPropertyDescriptorType(propertyDescriptor) {
597
- if (propertyDescriptor.set) {
598
- return PropertyDescriptorType.Property;
599
- }
600
- if (propertyDescriptor.get) {
601
- return PropertyDescriptorType.ReadonlyProperty;
602
- }
603
- if (_Type.isMethod(propertyDescriptor.value)) {
604
- return PropertyDescriptorType.Function;
605
- }
606
- return PropertyDescriptorType.Field;
607
- }
608
- static getPropertyDescriptor(root, name) {
609
- if (!root || typeof root !== "object") {
610
- throw new ArgumentException(`Cannot get property '${String(name)}' from non-object root: ${String(root)}`);
611
- }
612
- let current = root;
613
- while (current && current !== Object.prototype) {
614
- const propertyDescriptor = Object.getOwnPropertyDescriptor(current, name);
615
- if (propertyDescriptor) {
616
- return {
617
- type: _Type.getPropertyDescriptorType(propertyDescriptor),
618
- descriptor: propertyDescriptor
619
- };
620
- }
621
- current = Object.getPrototypeOf(current);
622
- }
623
- const constructorName = root.constructor?.name || "UnknownObject";
624
- throw new ArgumentException(`${constructorName} does not have a property, method or field with name '${String(name)}'`);
625
- }
626
- static toObject(context) {
627
- if (context && (typeof context === "object" || typeof context === "function")) {
628
- return context;
629
- }
630
- return void 0;
631
- }
632
- static getConstructorName(value) {
633
- if (typeof value === "object" && value !== null) {
634
- return value.constructor.name;
635
- }
636
- return "unknown";
637
- }
638
- };
639
-
640
- // lib/exceptions/invalid-cast-exception.ts
641
- var InvalidCastException = class extends Error {
642
- static {
643
- __name(this, "InvalidCastException");
644
- }
645
- constructor(message) {
646
- super(message);
647
- }
648
- };
649
-
650
- // lib/exceptions/null-or-empty-exception.ts
651
- var NullOrEmptyException = class extends Error {
652
- static {
653
- __name(this, "NullOrEmptyException");
654
- }
655
- constructor(argumentName) {
656
- super(`'${argumentName}' cannot be null or empty`);
657
- }
658
- };
659
-
660
- // lib/exceptions/null-or-undefined-exception.ts
661
- var NullOrUndefinedException = class extends Error {
662
- static {
663
- __name(this, "NullOrUndefinedException");
664
- }
665
- constructor(argumentName) {
666
- super(`'${argumentName}' cannot be null or undefined`);
667
- }
668
- };
669
-
670
- // lib/exceptions/assertion.ts
671
- var Assertion = class {
672
- static {
673
- __name(this, "Assertion");
674
- }
675
- constructor() {
676
- }
677
- static assertIsFunction(value, name) {
678
- if (!Type.isFunction(value)) {
679
- const typeName = value && typeof value === "object" ? value.constructor?.name : typeof value;
680
- throw new InvalidCastException(`${typeName}[${name}] is not a function`);
681
- }
682
- }
683
- static assertNotNullOrUndefined(value, argumentName) {
684
- if (Type.isNullOrUndefined(value)) {
685
- throw new NullOrUndefinedException(argumentName);
686
- }
687
- }
688
- static assertNotNullOrEmpty(value, argumentName) {
689
- if (Type.isEmpty(value)) {
690
- throw new NullOrEmptyException(argumentName);
691
- }
692
- }
693
- };
694
-
695
- // lib/exceptions/invalid-operation-exception.ts
696
- var InvalidOperationException = class extends Error {
697
- static {
698
- __name(this, "InvalidOperationException");
567
+ };
568
+
569
+ // lib/exceptions/invalid-operation-exception.ts
570
+ var InvalidOperationException = class extends CustomError {
571
+ static {
572
+ __name(this, "InvalidOperationException");
699
573
  }
700
574
  constructor(message) {
701
- super(message);
575
+ super(message, "InvalidOperationException");
702
576
  }
703
577
  };
704
578
 
705
579
  // lib/exceptions/parser-exception.ts
706
- var ParserException = class extends Error {
580
+ var ParserException = class extends CustomError {
707
581
  static {
708
582
  __name(this, "ParserException");
709
583
  }
710
584
  expression;
711
585
  position;
712
586
  constructor(expression, message, position) {
713
- super(createMessage(expression, message, position ?? 0)), this.expression = expression, this.position = position;
587
+ super(createMessage(expression, message, position ?? 0), "ParserException"), this.expression = expression, this.position = position;
714
588
  }
715
589
  };
716
590
  function createMessage(expression, message, position) {
@@ -722,765 +596,968 @@ function createMessage(expression, message, position) {
722
596
  __name(createMessage, "createMessage");
723
597
 
724
598
  // lib/exceptions/unexpected-exception.ts
725
- var UnexpectedException = class extends Error {
599
+ var UnexpectedException = class extends CustomError {
726
600
  static {
727
601
  __name(this, "UnexpectedException");
728
602
  }
729
603
  constructor(message) {
730
- super(message);
731
- }
732
- };
733
-
734
- // lib/exceptions/unsupported-exception.ts
735
- var UnsupportedException = class extends Error {
736
- static {
737
- __name(this, "UnsupportedException");
738
- }
739
- constructor(message) {
740
- super(message);
604
+ super(message, "UnexpectedException");
741
605
  }
742
606
  };
743
607
 
744
- // lib/singleton-factory/singleton.factory.ts
745
- function _ts_decorate7(decorators, target, key, desc) {
608
+ // lib/index-value-accessor/method-accessor.ts
609
+ function _ts_decorate5(decorators, target, key, desc) {
746
610
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
747
611
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
748
612
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
749
613
  return c > 3 && r && Object.defineProperty(target, key, r), r;
750
614
  }
751
- __name(_ts_decorate7, "_ts_decorate");
752
- function _ts_metadata5(k, v) {
615
+ __name(_ts_decorate5, "_ts_decorate");
616
+ function _ts_metadata2(k, v) {
753
617
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
754
618
  }
755
- __name(_ts_metadata5, "_ts_metadata");
756
- var SingletonFactory = class {
619
+ __name(_ts_metadata2, "_ts_metadata");
620
+ function _ts_param2(paramIndex, decorator) {
621
+ return function(target, key) {
622
+ decorator(target, key, paramIndex);
623
+ };
624
+ }
625
+ __name(_ts_param2, "_ts_param");
626
+ var MethodAccessor = class {
757
627
  static {
758
- __name(this, "SingletonFactory");
759
- }
760
- _instances = /* @__PURE__ */ new Map();
761
- _referenceCounts = /* @__PURE__ */ new Map();
762
- constructor() {
763
- }
764
- exists(target) {
765
- for (const instance of this._instances.values()) {
766
- if (target === instance) {
767
- return true;
768
- }
769
- }
770
- return false;
771
- }
772
- toLines(indent = 4, level = 0) {
773
- const lines = [];
774
- const spaces = " ".repeat(indent * level);
775
- const spacesNext = " ".repeat(indent * (level + 1));
776
- const prettyPrinter = new PrettyPrinter();
777
- lines.push(spaces + "___________________________________________________________");
778
- lines.push(spaces + `${this.constructor.name}`);
779
- for (const [key, instance] of this._instances.entries()) {
780
- lines.push(spacesNext + "___________________________________________________________");
781
- lines.push(spacesNext + `key (ref. count = ${this._referenceCounts.get(key)}):`);
782
- const keyLines = prettyPrinter.toLines(key, level + 2, false);
783
- lines.push(...keyLines);
784
- lines.push(spacesNext + "instance:");
785
- const instanceLines = prettyPrinter.toLines(instance, level + 2, false);
786
- lines.push(...instanceLines);
787
- }
788
- return lines;
789
- }
790
- toString(indent = 4, level = 0) {
791
- return this.toLines(indent, level).map((l) => " ".repeat(indent * level) + l).join("\n");
792
- }
793
- [Symbol.for("nodejs.util.inspect.custom")]() {
794
- return `${this.constructor.name}`;
628
+ __name(this, "MethodAccessor");
795
629
  }
796
- get isEmpty() {
797
- return this._instances.size === 0;
630
+ _functionCallResultCacheFactory;
631
+ priority = 6;
632
+ constructor(_functionCallResultCacheFactory) {
633
+ this._functionCallResultCacheFactory = _functionCallResultCacheFactory;
798
634
  }
799
- ids() {
800
- return this._instances.keys();
635
+ getIndexes() {
636
+ return [].values();
801
637
  }
802
- getFromId(id) {
803
- return this._instances.get(id);
638
+ hasValue(context, index) {
639
+ return this._functionCallResultCacheFactory.has(context, index);
804
640
  }
805
- has(id) {
806
- return this._instances.has(id);
641
+ getResolvedValue(context, index) {
642
+ return this.getValue(context, index);
807
643
  }
808
- getFromData(data) {
809
- const id = this.getId(data);
810
- return id !== void 0 ? this.getFromId(id) : void 0;
644
+ getValue(context, index) {
645
+ return this._functionCallResultCacheFactory.get(context, index)?.result;
811
646
  }
812
- dispose() {
813
- for (const id of this._instances.keys()) {
814
- this.release(id, true);
815
- }
816
- this._instances.clear();
817
- this._referenceCounts.clear();
818
- this.onDipose();
647
+ setValue(_, index) {
648
+ throw new UnsupportedException(`Cannot set method '${index}'`);
819
649
  }
820
- getOrCreate(data) {
821
- let instance = this.getFromId(this.getOrCreateId(data));
822
- if (instance === void 0) {
823
- instance = this.create(data).instance;
650
+ applies(context, index) {
651
+ if (!index || typeof context !== "object" || context === null) {
652
+ return false;
824
653
  }
825
- return instance;
826
- }
827
- create(data) {
828
- const id = this.getOrCreateId(data);
829
- const instance = this.getOrCreateInstance(id, data);
830
- const result = {
831
- id,
832
- instance,
833
- referenceCount: this.updateReferenceCount(id, 1, instance)
834
- };
835
- if (result.referenceCount === 1) {
836
- this.onInstanceCreated(result.instance, data);
837
- }
838
- return result;
839
- }
840
- release(id, force) {
841
- const instance = this._instances.get(id);
842
- if (!instance) {
843
- return {
844
- instance: null,
845
- referenceCount: 0
846
- };
847
- }
848
- return {
849
- referenceCount: this.updateReferenceCount(id, -1, instance, force),
850
- instance
851
- };
852
- }
853
- get keys() {
854
- return Array.from(this._instances.keys());
855
- }
856
- onDisposeInstance = /* @__PURE__ */ __name((id, dispose) => {
857
- const { referenceCount } = this.release(id);
858
- if (referenceCount === 0) {
859
- dispose();
860
- }
861
- return referenceCount === 0;
862
- }, "onDisposeInstance");
863
- onDipose() {
864
- }
865
- onReleased() {
866
- }
867
- releaseInstance(_instance, _id) {
868
- }
869
- onInstanceCreated(_instance, _data) {
870
- }
871
- getOrCreateId(data) {
872
- return this.getId(data) ?? this.createId(data);
873
- }
874
- getReferenceCount(id) {
875
- return this._referenceCounts.get(id) ?? 0;
876
- }
877
- updateReferenceCount(id, change, instance, forceRelease) {
878
- const referenceCount = this.getReferenceCount(id) + change;
879
- if (change === -1 && (forceRelease || referenceCount === 0)) {
880
- this._instances.delete(id);
881
- this._referenceCounts.delete(id);
882
- this.releaseInstance(instance, id);
883
- this.onReleased();
884
- } else if (referenceCount > 0) {
885
- this._referenceCounts.set(id, referenceCount);
886
- }
887
- return referenceCount;
888
- }
889
- getOrCreateInstance(id, data) {
890
- let instance = this._instances.get(id);
891
- if (instance !== void 0) {
892
- return instance;
893
- }
894
- instance = this.createInstance(data, id);
895
- this._instances.set(id, instance);
896
- return instance;
654
+ const prop = context[index.functionName];
655
+ return Type.isFunction(prop) || Type.isArrowFunction(prop);
897
656
  }
898
657
  };
899
- _ts_decorate7([
900
- preDestroy(),
901
- _ts_metadata5("design:type", Function),
902
- _ts_metadata5("design:paramtypes", []),
903
- _ts_metadata5("design:returntype", void 0)
904
- ], SingletonFactory.prototype, "dispose", null);
658
+ MethodAccessor = _ts_decorate5([
659
+ injectable(),
660
+ _ts_param2(0, inject(RsXCoreInjectionTokens.IFunctionCallResultCacheFactory)),
661
+ _ts_metadata2("design:type", Function),
662
+ _ts_metadata2("design:paramtypes", [
663
+ typeof IFunctionCallResultCacheFactory === "undefined" ? Object : IFunctionCallResultCacheFactory
664
+ ])
665
+ ], MethodAccessor);
905
666
 
906
- // lib/function-call-index/function-call-index.ts
907
- var FunctionCallIndex = class {
908
- static {
909
- __name(this, "FunctionCallIndex");
910
- }
911
- context;
912
- functionName;
913
- _sequenceWithId;
914
- _owner;
915
- _isDisposed = false;
916
- _id;
917
- constructor(context, functionName, _sequenceWithId, _owner) {
918
- this.context = context;
919
- this.functionName = functionName;
920
- this._sequenceWithId = _sequenceWithId;
921
- this._owner = _owner;
922
- }
923
- get id() {
924
- if (!this._id) {
925
- this._id = `${this.functionName}${this._sequenceWithId.id}`;
926
- }
927
- return this._id;
928
- }
929
- get argumentsId() {
930
- return this._sequenceWithId;
931
- }
932
- dispose() {
933
- if (this._isDisposed) {
934
- return;
935
- }
936
- if (this._owner.canDispose?.()) {
937
- this._isDisposed = true;
938
- this._sequenceWithId.dispose();
939
- }
940
- this._owner.release();
667
+ // lib/index-value-accessor/observable-accessor.ts
668
+ import { BehaviorSubject, isObservable, Subject } from "rxjs";
669
+
670
+ // lib/types/set.ts
671
+ function replaceSetItemAt(set, oldValue, newValue) {
672
+ const values = Array.from(set);
673
+ const index = values.indexOf(oldValue);
674
+ if (index === -1) {
675
+ throw new RangeError("Index out of range");
941
676
  }
942
- };
677
+ values[index] = newValue;
678
+ set.clear();
679
+ values.forEach((value) => set.add(value));
680
+ return set;
681
+ }
682
+ __name(replaceSetItemAt, "replaceSetItemAt");
943
683
 
944
- // lib/function-call-index/function-call-index.factory.ts
945
- function _ts_decorate8(decorators, target, key, desc) {
684
+ // lib/types/utc-date.ts
685
+ function utCDate(year, month = 0, date = 1, hours = 0, minutes = 0, seconds = 0, millisecond = 0) {
686
+ return new Date(Date.UTC(year, month, date, hours, minutes, seconds, millisecond));
687
+ }
688
+ __name(utCDate, "utCDate");
689
+
690
+ // lib/index-value-accessor/pending.ts
691
+ var PENDING = Symbol("pending");
692
+
693
+ // lib/index-value-accessor/observable-accessor.ts
694
+ function _ts_decorate6(decorators, target, key, desc) {
946
695
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
947
696
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
948
697
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
949
698
  return c > 3 && r && Object.defineProperty(target, key, r), r;
950
699
  }
951
- __name(_ts_decorate8, "_ts_decorate");
952
- function _ts_metadata6(k, v) {
700
+ __name(_ts_decorate6, "_ts_decorate");
701
+ function _ts_metadata3(k, v) {
953
702
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
954
703
  }
955
- __name(_ts_metadata6, "_ts_metadata");
956
- function _ts_param4(paramIndex, decorator) {
704
+ __name(_ts_metadata3, "_ts_metadata");
705
+ function _ts_param3(paramIndex, decorator) {
957
706
  return function(target, key) {
958
707
  decorator(target, key, paramIndex);
959
708
  };
960
709
  }
961
- __name(_ts_param4, "_ts_param");
962
- var FunctionCallIndexFactory = class extends SingletonFactory {
710
+ __name(_ts_param3, "_ts_param");
711
+ var ObservableAccessor = class {
963
712
  static {
964
- __name(this, "FunctionCallIndexFactory");
713
+ __name(this, "ObservableAccessor");
965
714
  }
966
- _sequenceIdFactory;
967
- constructor(_sequenceIdFactory) {
968
- super(), this._sequenceIdFactory = _sequenceIdFactory;
715
+ _resolvedValueCache;
716
+ priority = 2;
717
+ constructor(_resolvedValueCache) {
718
+ this._resolvedValueCache = _resolvedValueCache;
969
719
  }
970
- getId(data) {
971
- return this._sequenceIdFactory.get(data.context, data.arguments);
720
+ getIndexes() {
721
+ return [].values();
972
722
  }
973
- createInstance(data, id) {
974
- return new FunctionCallIndex(data.context, data.functionName, id, {
975
- canDispose: /* @__PURE__ */ __name(() => this.getReferenceCount(id) === 1, "canDispose"),
976
- release: /* @__PURE__ */ __name(() => this.release(id), "release")
977
- });
723
+ getResolvedValue(context, index) {
724
+ if (context instanceof BehaviorSubject) return context.value;
725
+ const val = this.getIndexedValue(context, index);
726
+ if (val && typeof val === "object" || typeof val === "function") {
727
+ return this._resolvedValueCache.get(val) ?? PENDING;
728
+ }
729
+ return PENDING;
978
730
  }
979
- createId(data) {
980
- const context = data.context;
981
- if (!context || typeof context !== "object") {
982
- throw new ArgumentException(`Expected context to be an object, got ${String(context)}`);
731
+ hasValue(context, index) {
732
+ return this.getResolvedValue(context, index) !== PENDING;
733
+ }
734
+ getValue(context, index) {
735
+ return this.getIndexedValue(context, index);
736
+ }
737
+ setValue(context, index, value) {
738
+ const val = this.getIndexedValue(context, index);
739
+ if (val instanceof Subject) {
740
+ val.next(value);
741
+ return;
983
742
  }
984
- const fn = context[data.functionName];
985
- return this._sequenceIdFactory.create(fn, data.arguments);
743
+ throw new UnsupportedException("Cannot set value for an observable");
986
744
  }
987
- releaseInstance(_, id) {
988
- id.dispose();
745
+ applies(context, index) {
746
+ const val = this.getIndexedValue(context, index);
747
+ return isObservable(val);
748
+ }
749
+ setLastValue(observable, value) {
750
+ this._resolvedValueCache.set(observable, value);
751
+ }
752
+ clearLastValue(observable) {
753
+ this._resolvedValueCache.delete(observable);
754
+ }
755
+ getIndexedValue(context, index) {
756
+ return (Type.toObject(context) ?? {})[index];
989
757
  }
990
758
  };
991
- FunctionCallIndexFactory = _ts_decorate8([
759
+ ObservableAccessor = _ts_decorate6([
992
760
  injectable(),
993
- _ts_param4(0, inject(RsXCoreInjectionTokens.ISequenceIdFactory)),
994
- _ts_metadata6("design:type", Function),
995
- _ts_metadata6("design:paramtypes", [
996
- typeof ISequenceIdFactory === "undefined" ? Object : ISequenceIdFactory
761
+ _ts_param3(0, inject(RsXCoreInjectionTokens.IResolvedValueCache)),
762
+ _ts_metadata3("design:type", Function),
763
+ _ts_metadata3("design:paramtypes", [
764
+ typeof IResolvedValueCache === "undefined" ? Object : IResolvedValueCache
997
765
  ])
998
- ], FunctionCallIndexFactory);
766
+ ], ObservableAccessor);
999
767
 
1000
- // lib/function-call-result-cache/function-call-result-cache.factory.ts
1001
- function _ts_decorate9(decorators, target, key, desc) {
768
+ // lib/index-value-accessor/promise-accessor.ts
769
+ function _ts_decorate7(decorators, target, key, desc) {
1002
770
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1003
771
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1004
772
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1005
773
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1006
774
  }
1007
- __name(_ts_decorate9, "_ts_decorate");
1008
- function _ts_metadata7(k, v) {
775
+ __name(_ts_decorate7, "_ts_decorate");
776
+ function _ts_metadata4(k, v) {
1009
777
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1010
778
  }
1011
- __name(_ts_metadata7, "_ts_metadata");
1012
- function _ts_param5(paramIndex, decorator) {
779
+ __name(_ts_metadata4, "_ts_metadata");
780
+ function _ts_param4(paramIndex, decorator) {
1013
781
  return function(target, key) {
1014
782
  decorator(target, key, paramIndex);
1015
783
  };
1016
784
  }
1017
- __name(_ts_param5, "_ts_param");
1018
- var FunctionCallResultCache = class FunctionCallResultCache2 {
785
+ __name(_ts_param4, "_ts_param");
786
+ var PromiseAccessor = class {
1019
787
  static {
1020
- __name(this, "FunctionCallResultCache");
1021
- }
1022
- _disposeableIndex;
1023
- result;
1024
- _owner;
1025
- _isDisposed = false;
1026
- constructor(_disposeableIndex, result, _owner) {
1027
- this._disposeableIndex = _disposeableIndex;
1028
- this.result = result;
1029
- this._owner = _owner;
788
+ __name(this, "PromiseAccessor");
1030
789
  }
1031
- get index() {
1032
- return this._disposeableIndex;
790
+ _resolvedValueCache;
791
+ priority = 1;
792
+ constructor(_resolvedValueCache) {
793
+ this._resolvedValueCache = _resolvedValueCache;
1033
794
  }
1034
- dispose() {
1035
- if (this._isDisposed) {
1036
- return;
1037
- }
1038
- if (this._owner.canDispose?.()) {
1039
- this._disposeableIndex.dispose();
1040
- this._isDisposed = true;
1041
- }
1042
- this._owner.release();
795
+ getIndexes() {
796
+ return [].values();
1043
797
  }
1044
- };
1045
- var FunctionCallResultCacheForContextManager = class FunctionCallResultCacheForContextManager2 extends SingletonFactory {
1046
- static {
1047
- __name(this, "FunctionCallResultCacheForContextManager");
1048
- }
1049
- _context;
1050
- _functionCallIndexFactory;
1051
- releaseContext;
1052
- constructor(_context, _functionCallIndexFactory, releaseContext) {
1053
- super(), this._context = _context, this._functionCallIndexFactory = _functionCallIndexFactory, this.releaseContext = releaseContext;
1054
- }
1055
- getId(data) {
1056
- return this._functionCallIndexFactory.getFromData({
1057
- functionName: data.functionName,
1058
- context: this._context,
1059
- arguments: data.arguments
1060
- });
1061
- }
1062
- createInstance(data, id) {
1063
- return new FunctionCallResultCache(id, data.result, {
1064
- canDispose: /* @__PURE__ */ __name(() => this.getReferenceCount(id) === 1, "canDispose"),
1065
- release: /* @__PURE__ */ __name(() => this.release(id), "release")
1066
- });
798
+ hasValue(context, index) {
799
+ const val = this.getIndexedValue(context, index);
800
+ return this.isCacheable(val) && this._resolvedValueCache.get(val) !== PENDING;
1067
801
  }
1068
- createId(data) {
1069
- return this._functionCallIndexFactory.create({
1070
- functionName: data.functionName,
1071
- context: this._context,
1072
- arguments: data.arguments
1073
- }).instance;
802
+ getResolvedValue(context, index) {
803
+ const val = this.getIndexedValue(context, index);
804
+ return this.isCacheable(val) ? this._resolvedValueCache.get(val) ?? PENDING : PENDING;
1074
805
  }
1075
- releaseInstance(_, id) {
1076
- this._functionCallIndexFactory.release(id.argumentsId);
806
+ getValue(context, index) {
807
+ return this.getIndexedValue(context, index);
1077
808
  }
1078
- onReleased() {
1079
- this.releaseContext();
809
+ setValue() {
810
+ throw new UnsupportedException("Cannot set value for a Promise");
1080
811
  }
1081
- };
1082
- var FunctionCallResultCacheManager = class FunctionCallResultCacheManager2 extends SingletonFactory {
1083
- static {
1084
- __name(this, "FunctionCallResultCacheManager");
812
+ applies(context, index) {
813
+ const val = this.getIndexedValue(context, index);
814
+ return val instanceof Promise;
1085
815
  }
1086
- _functionCallIndexFactory;
1087
- constructor(_functionCallIndexFactory) {
1088
- super(), this._functionCallIndexFactory = _functionCallIndexFactory;
816
+ setLastValue(promise, value) {
817
+ this._resolvedValueCache.set(promise, value);
1089
818
  }
1090
- getId(contex) {
1091
- return this.createId(contex);
819
+ clearLastValue(promise) {
820
+ this._resolvedValueCache.delete(promise);
1092
821
  }
1093
- createInstance(context, id) {
1094
- return new FunctionCallResultCacheForContextManager(context, this._functionCallIndexFactory, () => this.release(id));
822
+ getIndexedValue(context, index) {
823
+ return (Type.toObject(context) ?? {})[index];
1095
824
  }
1096
- createId(contex) {
1097
- return contex;
825
+ isCacheable(value) {
826
+ return value !== null && (typeof value === "object" || typeof value === "function");
1098
827
  }
1099
828
  };
1100
- var FunctionCallResultCacheFactory = class {
829
+ PromiseAccessor = _ts_decorate7([
830
+ injectable(),
831
+ _ts_param4(0, inject(RsXCoreInjectionTokens.IResolvedValueCache)),
832
+ _ts_metadata4("design:type", Function),
833
+ _ts_metadata4("design:paramtypes", [
834
+ typeof IResolvedValueCache === "undefined" ? Object : IResolvedValueCache
835
+ ])
836
+ ], PromiseAccessor);
837
+
838
+ // lib/index-value-accessor/property-value-accessor.ts
839
+ import { isObservable as isObservable2 } from "rxjs";
840
+ var PropertyValueAccessor = class {
1101
841
  static {
1102
- __name(this, "FunctionCallResultCacheFactory");
842
+ __name(this, "PropertyValueAccessor");
1103
843
  }
1104
- _functionCallResultCacheManager;
1105
- constructor(functionCallIndexFactory) {
1106
- this._functionCallResultCacheManager = new FunctionCallResultCacheManager(functionCallIndexFactory);
844
+ priority = 7;
845
+ getIndexes(context) {
846
+ const obj = Type.toObject(context);
847
+ if (!obj) {
848
+ return [].values();
849
+ }
850
+ return Object.keys(obj).filter((key) => !Type.isMethod(obj[key])).values();
1107
851
  }
1108
- create(context, result) {
1109
- return this._functionCallResultCacheManager.create(context).instance.create(result).instance;
852
+ hasValue(context, index) {
853
+ const val = this.getValue(context, index);
854
+ return val !== void 0;
1110
855
  }
1111
- has(context, index) {
1112
- return this._functionCallResultCacheManager.getFromId(context)?.has(index) ?? false;
856
+ getResolvedValue(context, index) {
857
+ return this.getValue(context, index);
1113
858
  }
1114
- get(context, index) {
1115
- return this._functionCallResultCacheManager.getFromId(context)?.getFromId(index);
859
+ getValue(context, index) {
860
+ const obj = Type.toObject(context);
861
+ return obj ? obj[index] : void 0;
862
+ }
863
+ setValue(context, index, value) {
864
+ const obj = Type.toObject(context);
865
+ if (obj) {
866
+ obj[index] = value;
867
+ }
868
+ }
869
+ applies(context, index) {
870
+ const obj = Type.toObject(context);
871
+ if (!obj) {
872
+ return false;
873
+ }
874
+ return Type.hasProperty(obj, index) && !(obj instanceof Date) && !isObservable2(obj[index]) && !(obj[index] instanceof Promise);
1116
875
  }
1117
876
  };
1118
- FunctionCallResultCacheFactory = _ts_decorate9([
1119
- injectable(),
1120
- _ts_param5(0, inject(RsXCoreInjectionTokens.IFunctionCallIndexFactory)),
1121
- _ts_metadata7("design:type", Function),
1122
- _ts_metadata7("design:paramtypes", [
1123
- typeof IFunctionCallIndexFactory === "undefined" ? Object : IFunctionCallIndexFactory
1124
- ])
1125
- ], FunctionCallResultCacheFactory);
1126
877
 
1127
- // lib/guid/guid.factory.ts
1128
- function _ts_decorate10(decorators, target, key, desc) {
878
+ // lib/index-value-accessor/resolved-value-cache.ts
879
+ function _ts_decorate8(decorators, target, key, desc) {
1129
880
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1130
881
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1131
882
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1132
883
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1133
884
  }
1134
- __name(_ts_decorate10, "_ts_decorate");
1135
- var GuidFactory = class {
885
+ __name(_ts_decorate8, "_ts_decorate");
886
+ var ResolvedValueCache = class {
1136
887
  static {
1137
- __name(this, "GuidFactory");
888
+ __name(this, "ResolvedValueCache");
1138
889
  }
1139
- create() {
1140
- return crypto.randomUUID();
890
+ _resolvedValues = /* @__PURE__ */ new WeakMap();
891
+ set(source, value) {
892
+ this._resolvedValues.set(source, value);
893
+ }
894
+ get(source) {
895
+ return this._resolvedValues.get(source);
896
+ }
897
+ delete(source) {
898
+ this._resolvedValues.delete(source);
1141
899
  }
1142
900
  };
1143
- GuidFactory = _ts_decorate10([
901
+ ResolvedValueCache = _ts_decorate8([
1144
902
  injectable()
1145
- ], GuidFactory);
903
+ ], ResolvedValueCache);
1146
904
 
1147
- // lib/index-value-accessor/array-index-accessor.ts
1148
- function _ts_decorate11(decorators, target, key, desc) {
905
+ // lib/index-value-accessor/set-key-accessor.ts
906
+ function _ts_decorate9(decorators, target, key, desc) {
1149
907
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1150
908
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1151
909
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1152
910
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1153
911
  }
1154
- __name(_ts_decorate11, "_ts_decorate");
1155
- var ArrayIndexAccessor = class {
912
+ __name(_ts_decorate9, "_ts_decorate");
913
+ var SetKeyAccessor = class {
1156
914
  static {
1157
- __name(this, "ArrayIndexAccessor");
1158
- }
1159
- priority = 5;
1160
- isAsync() {
1161
- return false;
915
+ __name(this, "SetKeyAccessor");
1162
916
  }
1163
- getIndexes(array) {
1164
- return array.keys();
917
+ priority = 3;
918
+ getIndexes(set) {
919
+ return new Set(set).values();
1165
920
  }
1166
- hasValue(array, index) {
1167
- return this.getValue(array, index) !== void 0;
921
+ hasValue(set, key) {
922
+ return set.has(key);
1168
923
  }
1169
- getResolvedValue(array, index) {
1170
- return array[index];
924
+ getResolvedValue(set, key) {
925
+ return set.has(key) ? key : void 0;
1171
926
  }
1172
- getValue(array, index) {
1173
- return this.getResolvedValue(array, index);
927
+ getValue(set, key) {
928
+ return this.getResolvedValue(set, key);
1174
929
  }
1175
- setValue(array, index, value) {
1176
- array[index] = value;
930
+ setValue(set, key, value) {
931
+ replaceSetItemAt(set, key, value);
1177
932
  }
1178
- applies(array) {
1179
- return Array.isArray(array);
933
+ applies(map) {
934
+ return map instanceof Set;
1180
935
  }
1181
936
  };
1182
- ArrayIndexAccessor = _ts_decorate11([
937
+ SetKeyAccessor = _ts_decorate9([
1183
938
  injectable()
1184
- ], ArrayIndexAccessor);
1185
-
1186
- // lib/index-value-accessor/date-property-accessor.interface.ts
1187
- var dataProperties = [
1188
- "year",
1189
- "utcYear",
1190
- "month",
1191
- "utcMonth",
1192
- "date",
1193
- "utcDate",
1194
- "hours",
1195
- "utcHours",
1196
- "minutes",
1197
- "utcMinutes",
1198
- "seconds",
1199
- "utcSeconds",
1200
- "milliseconds",
1201
- "utcMilliseconds",
1202
- "time"
1203
- ];
939
+ ], SetKeyAccessor);
1204
940
 
1205
- // lib/index-value-accessor/date-property-accessor.ts
1206
- function _ts_decorate12(decorators, target, key, desc) {
941
+ // lib/deep-clone/deep-clone-except.ts
942
+ function _ts_decorate10(decorators, target, key, desc) {
1207
943
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1208
944
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1209
945
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1210
946
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1211
947
  }
1212
- __name(_ts_decorate12, "_ts_decorate");
1213
- var DatePropertyAccessor = class {
948
+ __name(_ts_decorate10, "_ts_decorate");
949
+ function _ts_metadata5(k, v) {
950
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
951
+ }
952
+ __name(_ts_metadata5, "_ts_metadata");
953
+ function _ts_param5(paramIndex, decorator) {
954
+ return function(target, key) {
955
+ decorator(target, key, paramIndex);
956
+ };
957
+ }
958
+ __name(_ts_param5, "_ts_param");
959
+ var DeepCloneValueExcept = class {
1214
960
  static {
1215
- __name(this, "DatePropertyAccessor");
961
+ __name(this, "DeepCloneValueExcept");
1216
962
  }
1217
- priority = 0;
1218
- _setter = {
1219
- year: /* @__PURE__ */ __name((date, value) => date.setFullYear(value), "year"),
1220
- utcYear: /* @__PURE__ */ __name((date, value) => date.setUTCFullYear(value), "utcYear"),
1221
- month: /* @__PURE__ */ __name((date, value) => date.setMonth(value), "month"),
1222
- utcMonth: /* @__PURE__ */ __name((date, value) => date.setUTCMonth(value), "utcMonth"),
1223
- date: /* @__PURE__ */ __name((date, value) => date.setDate(value), "date"),
1224
- utcDate: /* @__PURE__ */ __name((date, value) => date.setUTCDate(value), "utcDate"),
1225
- hours: /* @__PURE__ */ __name((date, value) => date.setHours(value), "hours"),
1226
- utcHours: /* @__PURE__ */ __name((date, value) => date.setUTCHours(value), "utcHours"),
1227
- minutes: /* @__PURE__ */ __name((date, value) => date.setMinutes(value), "minutes"),
1228
- utcMinutes: /* @__PURE__ */ __name((date, value) => date.setUTCMinutes(value), "utcMinutes"),
1229
- seconds: /* @__PURE__ */ __name((date, value) => date.setSeconds(value), "seconds"),
1230
- utcSeconds: /* @__PURE__ */ __name((date, value) => date.setUTCSeconds(value), "utcSeconds"),
1231
- milliseconds: /* @__PURE__ */ __name((date, value) => date.setMilliseconds(value), "milliseconds"),
1232
- utcMilliseconds: /* @__PURE__ */ __name((date, value) => date.setUTCMilliseconds(value), "utcMilliseconds"),
1233
- time: /* @__PURE__ */ __name((date, value) => date.setTime(value), "time")
1234
- };
1235
- _getters = {
1236
- year: /* @__PURE__ */ __name((date) => date.getFullYear(), "year"),
1237
- utcYear: /* @__PURE__ */ __name((date) => date.getUTCFullYear(), "utcYear"),
1238
- month: /* @__PURE__ */ __name((date) => date.getMonth(), "month"),
1239
- utcMonth: /* @__PURE__ */ __name((date) => date.getUTCMonth(), "utcMonth"),
1240
- date: /* @__PURE__ */ __name((date) => date.getDate(), "date"),
1241
- utcDate: /* @__PURE__ */ __name((date) => date.getUTCDate(), "utcDate"),
1242
- hours: /* @__PURE__ */ __name((date) => date.getHours(), "hours"),
1243
- utcHours: /* @__PURE__ */ __name((date) => date.getUTCHours(), "utcHours"),
1244
- minutes: /* @__PURE__ */ __name((date) => date.getMinutes(), "minutes"),
1245
- utcMinutes: /* @__PURE__ */ __name((date) => date.getUTCMinutes(), "utcMinutes"),
1246
- seconds: /* @__PURE__ */ __name((date) => date.getSeconds(), "seconds"),
1247
- utcSeconds: /* @__PURE__ */ __name((date) => date.getUTCSeconds(), "utcSeconds"),
1248
- milliseconds: /* @__PURE__ */ __name((date) => date.getMilliseconds(), "milliseconds"),
1249
- utcMilliseconds: /* @__PURE__ */ __name((date) => date.getUTCMilliseconds(), "utcMilliseconds"),
1250
- time: /* @__PURE__ */ __name((date) => date.getTime(), "time")
963
+ _resolvedValueCache;
964
+ constructor(_resolvedValueCache) {
965
+ this._resolvedValueCache = _resolvedValueCache;
966
+ }
967
+ except(source) {
968
+ if (source instanceof Promise || source instanceof Observable) {
969
+ const value = this._resolvedValueCache.get(source);
970
+ return value === void 0 ? PENDING : value;
971
+ }
972
+ return void 0;
973
+ }
974
+ };
975
+ DeepCloneValueExcept = _ts_decorate10([
976
+ injectable(),
977
+ _ts_param5(0, inject(RsXCoreInjectionTokens.IResolvedValueCache)),
978
+ _ts_metadata5("design:type", Function),
979
+ _ts_metadata5("design:paramtypes", [
980
+ typeof IResolvedValueCache === "undefined" ? Object : IResolvedValueCache
981
+ ])
982
+ ], DeepCloneValueExcept);
983
+
984
+ // lib/deep-clone/default-deep-clone.ts
985
+ function _ts_decorate11(decorators, target, key, desc) {
986
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
987
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
988
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
989
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
990
+ }
991
+ __name(_ts_decorate11, "_ts_decorate");
992
+ function _ts_metadata6(k, v) {
993
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
994
+ }
995
+ __name(_ts_metadata6, "_ts_metadata");
996
+ function _ts_param6(paramIndex, decorator) {
997
+ return function(target, key) {
998
+ decorator(target, key, paramIndex);
1251
999
  };
1252
- isAsync() {
1253
- return false;
1000
+ }
1001
+ __name(_ts_param6, "_ts_param");
1002
+ var DefaultDeepClone = class {
1003
+ static {
1004
+ __name(this, "DefaultDeepClone");
1254
1005
  }
1255
- getIndexes() {
1256
- return dataProperties.values();
1006
+ _deepCloneList;
1007
+ priority = 0;
1008
+ constructor(_deepCloneList) {
1009
+ this._deepCloneList = _deepCloneList;
1257
1010
  }
1258
- hasValue(context, index) {
1259
- return this.getValue(context, index) !== void 0;
1011
+ clone(source) {
1012
+ let error = null;
1013
+ for (let i = 0; i < this._deepCloneList.length; i++) {
1014
+ try {
1015
+ return this._deepCloneList[i].clone(source);
1016
+ } catch (e) {
1017
+ error = e;
1018
+ }
1019
+ }
1020
+ throw error;
1021
+ }
1022
+ };
1023
+ DefaultDeepClone = _ts_decorate11([
1024
+ injectable(),
1025
+ _ts_param6(0, multiInject(RsXCoreInjectionTokens.IDeepCloneList)),
1026
+ _ts_metadata6("design:type", Function),
1027
+ _ts_metadata6("design:paramtypes", [
1028
+ Object
1029
+ ])
1030
+ ], DefaultDeepClone);
1031
+
1032
+ // lib/deep-clone/lodash-deep-clone.ts
1033
+ import cloneDeepWith from "lodash.clonedeepwith";
1034
+ function _ts_decorate12(decorators, target, key, desc) {
1035
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1036
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1037
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1038
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1039
+ }
1040
+ __name(_ts_decorate12, "_ts_decorate");
1041
+ function _ts_metadata7(k, v) {
1042
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1043
+ }
1044
+ __name(_ts_metadata7, "_ts_metadata");
1045
+ function _ts_param7(paramIndex, decorator) {
1046
+ return function(target, key) {
1047
+ decorator(target, key, paramIndex);
1048
+ };
1049
+ }
1050
+ __name(_ts_param7, "_ts_param");
1051
+ var LodashDeepClone = class {
1052
+ static {
1053
+ __name(this, "LodashDeepClone");
1054
+ }
1055
+ _deepCloneExcept;
1056
+ priority = 1;
1057
+ constructor(_deepCloneExcept) {
1058
+ this._deepCloneExcept = _deepCloneExcept;
1059
+ }
1060
+ clone(source) {
1061
+ return cloneDeepWith(source, this.cloneExceptPredicate);
1062
+ }
1063
+ cloneExceptPredicate = /* @__PURE__ */ __name((value) => {
1064
+ return this._deepCloneExcept.except(value);
1065
+ }, "cloneExceptPredicate");
1066
+ };
1067
+ LodashDeepClone = _ts_decorate12([
1068
+ injectable(),
1069
+ _ts_param7(0, inject(RsXCoreInjectionTokens.DefaultDeepCloneExcept)),
1070
+ _ts_metadata7("design:type", Function),
1071
+ _ts_metadata7("design:paramtypes", [
1072
+ typeof IDeepCloneExcept === "undefined" ? Object : IDeepCloneExcept
1073
+ ])
1074
+ ], LodashDeepClone);
1075
+
1076
+ // lib/deep-clone/structured-deep-clone.ts
1077
+ function _ts_decorate13(decorators, target, key, desc) {
1078
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1079
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1080
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1081
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1082
+ }
1083
+ __name(_ts_decorate13, "_ts_decorate");
1084
+ var StructuredDeepClone = class {
1085
+ static {
1086
+ __name(this, "StructuredDeepClone");
1087
+ }
1088
+ priority = 2;
1089
+ clone(source) {
1090
+ return structuredClone(source);
1091
+ }
1092
+ };
1093
+ StructuredDeepClone = _ts_decorate13([
1094
+ injectable()
1095
+ ], StructuredDeepClone);
1096
+
1097
+ // lib/equality-service/equality-service.ts
1098
+ import { createCustomEqual } from "fast-equals";
1099
+ import { isObservable as isObservable3 } from "rxjs";
1100
+ function _ts_decorate14(decorators, target, key, desc) {
1101
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1102
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1103
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1104
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1105
+ }
1106
+ __name(_ts_decorate14, "_ts_decorate");
1107
+ var EqualityService = class {
1108
+ static {
1109
+ __name(this, "EqualityService");
1110
+ }
1111
+ isEqual = createCustomEqual({
1112
+ createCustomConfig: /* @__PURE__ */ __name((baseConfig) => ({
1113
+ ...baseConfig,
1114
+ areObjectsEqual: /* @__PURE__ */ __name((a, b, equalityCheck) => {
1115
+ if (isObservable3(a) && isObservable3(b)) {
1116
+ return a === b;
1117
+ }
1118
+ return baseConfig.areObjectsEqual(a, b, equalityCheck);
1119
+ }, "areObjectsEqual")
1120
+ }), "createCustomConfig")
1121
+ });
1122
+ };
1123
+ EqualityService = _ts_decorate14([
1124
+ injectable()
1125
+ ], EqualityService);
1126
+
1127
+ // lib/error-log/error-log.ts
1128
+ import { Subject as Subject2 } from "rxjs";
1129
+ function _ts_decorate15(decorators, target, key, desc) {
1130
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1131
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1132
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1133
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1134
+ }
1135
+ __name(_ts_decorate15, "_ts_decorate");
1136
+ function _ts_metadata8(k, v) {
1137
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1138
+ }
1139
+ __name(_ts_metadata8, "_ts_metadata");
1140
+ var ErrorLog = class {
1141
+ static {
1142
+ __name(this, "ErrorLog");
1143
+ }
1144
+ _error;
1145
+ constructor() {
1146
+ this._error = new Subject2();
1147
+ }
1148
+ get error() {
1149
+ return this._error;
1150
+ }
1151
+ add(error) {
1152
+ console.error(error);
1153
+ this._error.next(error);
1154
+ }
1155
+ clear() {
1156
+ console.clear();
1157
+ }
1158
+ };
1159
+ ErrorLog = _ts_decorate15([
1160
+ injectable(),
1161
+ _ts_metadata8("design:type", Function),
1162
+ _ts_metadata8("design:paramtypes", [])
1163
+ ], ErrorLog);
1164
+
1165
+ // lib/error-log/pretty-printer.ts
1166
+ function registerHandler(handler) {
1167
+ return {
1168
+ predicate: handler.predicate,
1169
+ action: /* @__PURE__ */ __name((value, level, quoteStrings) => handler.action(value, level, quoteStrings), "action")
1170
+ };
1171
+ }
1172
+ __name(registerHandler, "registerHandler");
1173
+ var PrettyPrinter = class {
1174
+ static {
1175
+ __name(this, "PrettyPrinter");
1176
+ }
1177
+ indent;
1178
+ handlers;
1179
+ constructor(indent = 4) {
1180
+ this.indent = indent;
1181
+ this.handlers = [
1182
+ registerHandler({
1183
+ predicate: /* @__PURE__ */ __name((v) => v === null || [
1184
+ "string",
1185
+ "number",
1186
+ "boolean",
1187
+ "bigint",
1188
+ "symbol",
1189
+ "undefined"
1190
+ ].includes(typeof v), "predicate"),
1191
+ action: /* @__PURE__ */ __name((v, level, quoteStrings) => [
1192
+ this.spaces(level) + this.formatPrimitive(v, quoteStrings ?? false)
1193
+ ], "action")
1194
+ }),
1195
+ registerHandler({
1196
+ predicate: /* @__PURE__ */ __name((v) => typeof v === "function", "predicate"),
1197
+ action: /* @__PURE__ */ __name((_, level) => [
1198
+ this.spaces(level) + "[[function]]"
1199
+ ], "action")
1200
+ }),
1201
+ registerHandler({
1202
+ predicate: Array.isArray,
1203
+ action: /* @__PURE__ */ __name((v, level, quoteStrings) => {
1204
+ if (v.length === 0) {
1205
+ return [
1206
+ this.spaces(level) + "[]"
1207
+ ];
1208
+ }
1209
+ const lines = [
1210
+ this.spaces(level) + "["
1211
+ ];
1212
+ for (let i = 0; i < v.length; i++) {
1213
+ const nested = this.toLines(v[i], level + 1, quoteStrings);
1214
+ lines.push(...nested);
1215
+ if (i < v.length - 1) {
1216
+ lines[lines.length - 1] += ",";
1217
+ }
1218
+ }
1219
+ lines.push(this.spaces(level) + "]");
1220
+ return lines;
1221
+ }, "action")
1222
+ }),
1223
+ registerHandler({
1224
+ predicate: /* @__PURE__ */ __name((v) => v instanceof Map, "predicate"),
1225
+ action: /* @__PURE__ */ __name((v, level, quoteStrings) => {
1226
+ if (v.size === 0) {
1227
+ return [
1228
+ this.spaces(level) + "{}"
1229
+ ];
1230
+ }
1231
+ const lines = [
1232
+ this.spaces(level) + "{"
1233
+ ];
1234
+ const next = this.spaces(level + 1);
1235
+ for (const [k, val] of v.entries()) {
1236
+ const nested = this.toLines(val, level + 1, quoteStrings);
1237
+ lines.push(`${next}${this.formatKey(k)}: ${nested[0].trimStart()}`);
1238
+ if (nested.length > 1) {
1239
+ lines.push(...nested.slice(1));
1240
+ }
1241
+ }
1242
+ lines.push(this.spaces(level) + "}");
1243
+ return lines;
1244
+ }, "action")
1245
+ }),
1246
+ registerHandler({
1247
+ predicate: /* @__PURE__ */ __name((v) => v instanceof Set, "predicate"),
1248
+ action: /* @__PURE__ */ __name((v, level, quoteStrings) => {
1249
+ if (v.size === 0) {
1250
+ return [
1251
+ this.spaces(level) + "{}"
1252
+ ];
1253
+ }
1254
+ const lines = [
1255
+ this.spaces(level) + "{"
1256
+ ];
1257
+ for (const item of v) {
1258
+ lines.push(...this.toLines(item, level + 1, quoteStrings));
1259
+ }
1260
+ lines.push(this.spaces(level) + "}");
1261
+ return lines;
1262
+ }, "action")
1263
+ }),
1264
+ registerHandler({
1265
+ predicate: /* @__PURE__ */ __name((v) => typeof v === "object" && v !== null && "toLines" in v, "predicate"),
1266
+ action: /* @__PURE__ */ __name((v, _level) => v.toLines(this.indent, _level), "action")
1267
+ }),
1268
+ registerHandler({
1269
+ predicate: /* @__PURE__ */ __name((v) => this.isCustomToString(v), "predicate"),
1270
+ action: /* @__PURE__ */ __name((v, level) => {
1271
+ const raw = v.toString(this.indent, level);
1272
+ const lines = Array.isArray(raw) ? raw : String(raw).split("\n");
1273
+ return lines.map((l) => this.spaces(level) + l);
1274
+ }, "action")
1275
+ }),
1276
+ registerHandler({
1277
+ predicate: /* @__PURE__ */ __name((v) => typeof v === "object" && v !== null && !Array.isArray(v), "predicate"),
1278
+ action: /* @__PURE__ */ __name((v, level, quoteStrings) => {
1279
+ const keys = Object.keys(v);
1280
+ if (keys.length === 0) {
1281
+ return [
1282
+ this.spaces(level) + "{}"
1283
+ ];
1284
+ }
1285
+ const lines = [
1286
+ this.spaces(level) + "{"
1287
+ ];
1288
+ const next = this.spaces(level + 1);
1289
+ for (const key of keys) {
1290
+ const nested = this.toLines(v[key], level + 1, quoteStrings);
1291
+ lines.push(`${next}${key}: ${nested[0].trimStart()}`);
1292
+ if (nested.length > 1) {
1293
+ lines.push(...nested.slice(1));
1294
+ }
1295
+ }
1296
+ lines.push(this.spaces(level) + "}");
1297
+ return lines;
1298
+ }, "action")
1299
+ })
1300
+ ];
1301
+ }
1302
+ toString(value, quoteStrings = true) {
1303
+ return this.toLines(value, 0, quoteStrings).join("\n");
1304
+ }
1305
+ toLines(value, level = 0, quoteStrings = true) {
1306
+ for (const handler of this.handlers) {
1307
+ if (handler.predicate(value)) {
1308
+ return handler.action(value, level, quoteStrings);
1309
+ }
1310
+ }
1311
+ return [
1312
+ this.spaces(level) + String(value)
1313
+ ];
1314
+ }
1315
+ formatPrimitive(value, quoteStrings) {
1316
+ if (typeof value === "string" && quoteStrings) {
1317
+ return `'${value}'`;
1318
+ }
1319
+ return String(value);
1320
+ }
1321
+ formatKey(key) {
1322
+ return typeof key === "string" ? key : String(key);
1323
+ }
1324
+ spaces(level) {
1325
+ return " ".repeat(this.indent * level);
1326
+ }
1327
+ isCustomToString(value) {
1328
+ if (typeof value !== "object" || value === null) return false;
1329
+ const proto = Object.getPrototypeOf(value);
1330
+ if (!proto) return false;
1331
+ const desc = Object.getOwnPropertyDescriptor(proto, "toString");
1332
+ return !!desc && typeof desc.value === "function" && desc.value !== Object.prototype.toString;
1333
+ }
1334
+ };
1335
+
1336
+ // lib/error-log/print-value.ts
1337
+ function printValue(value) {
1338
+ console.log(new PrettyPrinter().toString(value, false));
1339
+ }
1340
+ __name(printValue, "printValue");
1341
+
1342
+ // lib/function-call-index/function-call-index.ts
1343
+ var FunctionCallIndex = class {
1344
+ static {
1345
+ __name(this, "FunctionCallIndex");
1260
1346
  }
1261
- getResolvedValue(context, index) {
1262
- return this.getValue(context, index);
1347
+ context;
1348
+ functionName;
1349
+ _sequenceWithId;
1350
+ _owner;
1351
+ _isDisposed = false;
1352
+ _id;
1353
+ constructor(context, functionName, _sequenceWithId, _owner) {
1354
+ this.context = context;
1355
+ this.functionName = functionName;
1356
+ this._sequenceWithId = _sequenceWithId;
1357
+ this._owner = _owner;
1263
1358
  }
1264
- getValue(date, index) {
1265
- return this._getters[index]?.(date);
1359
+ get id() {
1360
+ if (!this._id) {
1361
+ this._id = `${this.functionName}${this._sequenceWithId.id}`;
1362
+ }
1363
+ return this._id;
1266
1364
  }
1267
- setValue(date, index, value) {
1268
- this._setter[index]?.(date, value);
1365
+ get argumentsId() {
1366
+ return this._sequenceWithId;
1269
1367
  }
1270
- applies(context, index) {
1271
- return context instanceof Date && !!this._getters[index];
1368
+ dispose() {
1369
+ if (this._isDisposed) {
1370
+ return;
1371
+ }
1372
+ if (this._owner.canDispose?.()) {
1373
+ this._isDisposed = true;
1374
+ this._sequenceWithId.dispose();
1375
+ }
1376
+ this._owner.release();
1272
1377
  }
1273
1378
  };
1274
- DatePropertyAccessor = _ts_decorate12([
1275
- injectable()
1276
- ], DatePropertyAccessor);
1277
1379
 
1278
- // lib/index-value-accessor/index-value-accessor.ts
1279
- function _ts_decorate13(decorators, target, key, desc) {
1380
+ // lib/singleton-factory/singleton.factory.ts
1381
+ function _ts_decorate16(decorators, target, key, desc) {
1280
1382
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1281
1383
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1282
1384
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1283
1385
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1284
1386
  }
1285
- __name(_ts_decorate13, "_ts_decorate");
1286
- function _ts_metadata8(k, v) {
1387
+ __name(_ts_decorate16, "_ts_decorate");
1388
+ function _ts_metadata9(k, v) {
1287
1389
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1288
1390
  }
1289
- __name(_ts_metadata8, "_ts_metadata");
1290
- function _ts_param6(paramIndex, decorator) {
1291
- return function(target, key) {
1292
- decorator(target, key, paramIndex);
1293
- };
1294
- }
1295
- __name(_ts_param6, "_ts_param");
1296
- var IndexValueAccessor = class {
1391
+ __name(_ts_metadata9, "_ts_metadata");
1392
+ var SingletonFactory = class {
1297
1393
  static {
1298
- __name(this, "IndexValueAccessor");
1299
- }
1300
- priority = 0;
1301
- _accessors;
1302
- constructor(accessors) {
1303
- this._accessors = [
1304
- ...accessors
1305
- ].sort((a, b) => b.priority - a.priority);
1394
+ __name(this, "SingletonFactory");
1306
1395
  }
1307
- getIndexes(context, index) {
1308
- return this.getIndexAccessor(context, index).getIndexes(context, index);
1396
+ _instances = /* @__PURE__ */ new Map();
1397
+ _referenceCounts = /* @__PURE__ */ new Map();
1398
+ constructor() {
1309
1399
  }
1310
- isAsync(context, index) {
1311
- return this.getIndexAccessor(context, index).isAsync(context, index);
1400
+ exists(target) {
1401
+ for (const instance of this._instances.values()) {
1402
+ if (target === instance) {
1403
+ return true;
1404
+ }
1405
+ }
1406
+ return false;
1312
1407
  }
1313
- hasValue(context, index) {
1314
- return this.getIndexAccessor(context, index).hasValue(context, index);
1408
+ toLines(indent = 4, level = 0) {
1409
+ const lines = [];
1410
+ const spaces = " ".repeat(indent * level);
1411
+ const spacesNext = " ".repeat(indent * (level + 1));
1412
+ const prettyPrinter = new PrettyPrinter();
1413
+ lines.push(spaces + "___________________________________________________________");
1414
+ lines.push(spaces + `${this.constructor.name}`);
1415
+ for (const [key, instance] of this._instances.entries()) {
1416
+ lines.push(spacesNext + "___________________________________________________________");
1417
+ lines.push(spacesNext + `key (ref. count = ${this._referenceCounts.get(key)}):`);
1418
+ const keyLines = prettyPrinter.toLines(key, level + 2, false);
1419
+ lines.push(...keyLines);
1420
+ lines.push(spacesNext + "instance:");
1421
+ const instanceLines = prettyPrinter.toLines(instance, level + 2, false);
1422
+ lines.push(...instanceLines);
1423
+ }
1424
+ return lines;
1315
1425
  }
1316
- getResolvedValue(context, index) {
1317
- return this.getIndexAccessor(context, index).getResolvedValue(context, index);
1426
+ toString(indent = 4, level = 0) {
1427
+ return this.toLines(indent, level).map((l) => " ".repeat(indent * level) + l).join("\n");
1318
1428
  }
1319
- getValue(context, index) {
1320
- return this.getIndexAccessor(context, index).getValue(context, index);
1429
+ [Symbol.for("nodejs.util.inspect.custom")]() {
1430
+ return `${this.constructor.name}`;
1321
1431
  }
1322
- setValue(context, index, value) {
1323
- this.getIndexAccessor(context, index).setValue(context, index, value);
1432
+ get isEmpty() {
1433
+ return this._instances.size === 0;
1324
1434
  }
1325
- applies(context, index) {
1326
- return this.getIndexAccessor(context, index).applies(context, index);
1435
+ ids() {
1436
+ return this._instances.keys();
1327
1437
  }
1328
- getIndexAccessor(context, index) {
1329
- const accessor = this._accessors.find((accessor2) => accessor2.applies(context, index));
1330
- if (!accessor) {
1331
- if (typeof context === "object" && context !== null) {
1332
- throw new UnsupportedException(`No accessor found for ${context.constructor.name}.${String(index)}`);
1333
- } else {
1334
- throw new UnsupportedException(`No accessor found for non-object context: ${String(context)}.${String(index)}`);
1335
- }
1336
- }
1337
- return accessor;
1438
+ getFromId(id) {
1439
+ return this._instances.get(id);
1338
1440
  }
1339
- };
1340
- IndexValueAccessor = _ts_decorate13([
1341
- injectable(),
1342
- _ts_param6(0, multiInject(RsXCoreInjectionTokens.IIndexValueAccessorList)),
1343
- _ts_metadata8("design:type", Function),
1344
- _ts_metadata8("design:paramtypes", [
1345
- Object
1346
- ])
1347
- ], IndexValueAccessor);
1348
-
1349
- // lib/index-value-accessor/map-key-accessor.ts
1350
- function _ts_decorate14(decorators, target, key, desc) {
1351
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1352
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1353
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1354
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1355
- }
1356
- __name(_ts_decorate14, "_ts_decorate");
1357
- var MapKeyAccessor = class {
1358
- static {
1359
- __name(this, "MapKeyAccessor");
1441
+ has(id) {
1442
+ return this._instances.has(id);
1360
1443
  }
1361
- priority = 4;
1362
- getIndexes(map) {
1363
- return map.keys();
1444
+ getFromData(data) {
1445
+ const id = this.getId(data);
1446
+ return id !== void 0 ? this.getFromId(id) : void 0;
1364
1447
  }
1365
- isAsync() {
1366
- return false;
1448
+ dispose() {
1449
+ for (const id of this._instances.keys()) {
1450
+ this.release(id, true);
1451
+ }
1452
+ this._instances.clear();
1453
+ this._referenceCounts.clear();
1454
+ this.onDipose();
1367
1455
  }
1368
- hasValue(map, key) {
1369
- return map.has(key);
1456
+ getOrCreate(data) {
1457
+ let instance = this.getFromId(this.getOrCreateId(data));
1458
+ if (instance === void 0) {
1459
+ instance = this.create(data).instance;
1460
+ }
1461
+ return instance;
1370
1462
  }
1371
- getResolvedValue(map, key) {
1372
- return map.get(key);
1463
+ create(data) {
1464
+ const id = this.getOrCreateId(data);
1465
+ const instance = this.getOrCreateInstance(id, data);
1466
+ const result = {
1467
+ id,
1468
+ instance,
1469
+ referenceCount: this.updateReferenceCount(id, 1, instance)
1470
+ };
1471
+ if (result.referenceCount === 1) {
1472
+ this.onInstanceCreated(result.instance, data);
1473
+ }
1474
+ return result;
1373
1475
  }
1374
- getValue(map, key) {
1375
- return this.getResolvedValue(map, key);
1476
+ release(id, force) {
1477
+ const instance = this._instances.get(id);
1478
+ if (!instance) {
1479
+ return {
1480
+ instance: null,
1481
+ referenceCount: 0
1482
+ };
1483
+ }
1484
+ return {
1485
+ referenceCount: this.updateReferenceCount(id, -1, instance, force),
1486
+ instance
1487
+ };
1376
1488
  }
1377
- setValue(map, key, value) {
1378
- map.set(key, value);
1489
+ getReferenceCount(id) {
1490
+ return this._referenceCounts.get(id) ?? 0;
1379
1491
  }
1380
- applies(map) {
1381
- return map instanceof Map;
1492
+ get keys() {
1493
+ return this._instances.keys();
1382
1494
  }
1383
- };
1384
- MapKeyAccessor = _ts_decorate14([
1385
- injectable()
1386
- ], MapKeyAccessor);
1387
-
1388
- // lib/index-value-accessor/method-accessor.ts
1389
- function _ts_decorate15(decorators, target, key, desc) {
1390
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1391
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1392
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1393
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1394
- }
1395
- __name(_ts_decorate15, "_ts_decorate");
1396
- function _ts_metadata9(k, v) {
1397
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1398
- }
1399
- __name(_ts_metadata9, "_ts_metadata");
1400
- function _ts_param7(paramIndex, decorator) {
1401
- return function(target, key) {
1402
- decorator(target, key, paramIndex);
1403
- };
1404
- }
1405
- __name(_ts_param7, "_ts_param");
1406
- var MethodAccessor = class {
1407
- static {
1408
- __name(this, "MethodAccessor");
1495
+ get instances() {
1496
+ return this._instances.values();
1409
1497
  }
1410
- _functionCallResultCacheFactory;
1411
- priority = 6;
1412
- constructor(_functionCallResultCacheFactory) {
1413
- this._functionCallResultCacheFactory = _functionCallResultCacheFactory;
1498
+ replaceKey(oldKey, newKey) {
1499
+ const instance = this.getFromId(oldKey);
1500
+ if (instance == void 0) {
1501
+ return;
1502
+ }
1503
+ this._instances.delete(oldKey);
1504
+ this._instances.set(newKey, instance);
1414
1505
  }
1415
- getIndexes() {
1416
- return [].values();
1506
+ onDisposeInstance = /* @__PURE__ */ __name((id, dispose) => {
1507
+ const { referenceCount } = this.release(id);
1508
+ if (referenceCount === 0) {
1509
+ dispose();
1510
+ }
1511
+ return referenceCount === 0;
1512
+ }, "onDisposeInstance");
1513
+ onDipose() {
1417
1514
  }
1418
- isAsync() {
1419
- return false;
1515
+ onReleased() {
1420
1516
  }
1421
- hasValue(context, index) {
1422
- return this._functionCallResultCacheFactory.has(context, index);
1517
+ releaseInstance(_instance, _id) {
1423
1518
  }
1424
- getResolvedValue(context, index) {
1425
- return this.getValue(context, index);
1519
+ onInstanceCreated(_instance, _data) {
1426
1520
  }
1427
- getValue(context, index) {
1428
- return this._functionCallResultCacheFactory.get(context, index)?.result;
1521
+ getOrCreateId(data) {
1522
+ return this.getId(data) ?? this.createId(data);
1429
1523
  }
1430
- setValue(_, index) {
1431
- throw new UnsupportedException(`Cannot set method '${index}'`);
1524
+ updateReferenceCount(id, change, instance, forceRelease) {
1525
+ const referenceCount = this.getReferenceCount(id) + change;
1526
+ if (change === -1 && (forceRelease || referenceCount === 0)) {
1527
+ this._instances.delete(id);
1528
+ this._referenceCounts.delete(id);
1529
+ this.releaseInstance(instance, id);
1530
+ this.onReleased();
1531
+ } else if (referenceCount > 0) {
1532
+ this._referenceCounts.set(id, referenceCount);
1533
+ }
1534
+ return referenceCount;
1432
1535
  }
1433
- applies(context, index) {
1434
- if (typeof context !== "object" || context === null) {
1435
- return false;
1536
+ getOrCreateInstance(id, data) {
1537
+ let instance = this._instances.get(id);
1538
+ if (instance !== void 0) {
1539
+ return instance;
1436
1540
  }
1437
- const prop = context[index.functionName];
1438
- return Type.isFunction(prop) || Type.isArrowFunction(prop);
1541
+ instance = this.createInstance(data, id);
1542
+ this._instances.set(id, instance);
1543
+ return instance;
1439
1544
  }
1440
1545
  };
1441
- MethodAccessor = _ts_decorate15([
1442
- injectable(),
1443
- _ts_param7(0, inject(RsXCoreInjectionTokens.IFunctionCallResultCacheFactory)),
1546
+ _ts_decorate16([
1547
+ preDestroy(),
1444
1548
  _ts_metadata9("design:type", Function),
1445
- _ts_metadata9("design:paramtypes", [
1446
- typeof IFunctionCallResultCacheFactory === "undefined" ? Object : IFunctionCallResultCacheFactory
1447
- ])
1448
- ], MethodAccessor);
1449
-
1450
- // lib/index-value-accessor/observable-accessor.ts
1451
- import { BehaviorSubject, isObservable as isObservable2, Subject as Subject2 } from "rxjs";
1452
-
1453
- // lib/types/set.ts
1454
- function replaceSetItemAt(set, oldValue, newValue) {
1455
- const values = Array.from(set);
1456
- const index = values.indexOf(oldValue);
1457
- if (index === -1) {
1458
- throw new RangeError("Index out of range");
1459
- }
1460
- values[index] = newValue;
1461
- set.clear();
1462
- values.forEach((value) => set.add(value));
1463
- return set;
1464
- }
1465
- __name(replaceSetItemAt, "replaceSetItemAt");
1466
-
1467
- // lib/types/utc-date.ts
1468
- function utCDate(year, month = 0, date = 1, hours = 0, minutes = 0, seconds = 0, millisecond = 0) {
1469
- return new Date(Date.UTC(year, month, date, hours, minutes, seconds, millisecond));
1470
- }
1471
- __name(utCDate, "utCDate");
1472
-
1473
- // lib/index-value-accessor/pending.ts
1474
- var PENDING = Symbol("pending");
1549
+ _ts_metadata9("design:paramtypes", []),
1550
+ _ts_metadata9("design:returntype", void 0)
1551
+ ], SingletonFactory.prototype, "dispose", null);
1475
1552
 
1476
- // lib/index-value-accessor/observable-accessor.ts
1477
- function _ts_decorate16(decorators, target, key, desc) {
1553
+ // lib/function-call-index/function-call-index.factory.ts
1554
+ function _ts_decorate17(decorators, target, key, desc) {
1478
1555
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1479
1556
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1480
1557
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1481
1558
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1482
1559
  }
1483
- __name(_ts_decorate16, "_ts_decorate");
1560
+ __name(_ts_decorate17, "_ts_decorate");
1484
1561
  function _ts_metadata10(k, v) {
1485
1562
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1486
1563
  }
@@ -1491,74 +1568,52 @@ function _ts_param8(paramIndex, decorator) {
1491
1568
  };
1492
1569
  }
1493
1570
  __name(_ts_param8, "_ts_param");
1494
- var ObservableAccessor = class {
1571
+ var FunctionCallIndexFactory = class extends SingletonFactory {
1495
1572
  static {
1496
- __name(this, "ObservableAccessor");
1497
- }
1498
- _resolvedValueCache;
1499
- priority = 2;
1500
- constructor(_resolvedValueCache) {
1501
- this._resolvedValueCache = _resolvedValueCache;
1502
- }
1503
- getIndexes() {
1504
- return [].values();
1505
- }
1506
- isAsync() {
1507
- return true;
1573
+ __name(this, "FunctionCallIndexFactory");
1508
1574
  }
1509
- getResolvedValue(context, index) {
1510
- if (context instanceof BehaviorSubject) return context.value;
1511
- const val = this.getIndexedValue(context, index);
1512
- if (val && typeof val === "object" || typeof val === "function") {
1513
- return this._resolvedValueCache.get(val) ?? PENDING;
1514
- }
1515
- return PENDING;
1575
+ _sequenceIdFactory;
1576
+ constructor(_sequenceIdFactory) {
1577
+ super(), this._sequenceIdFactory = _sequenceIdFactory;
1516
1578
  }
1517
- hasValue(context, index) {
1518
- return this.getResolvedValue(context, index) !== PENDING;
1579
+ getId(data) {
1580
+ return this._sequenceIdFactory.get(data.context, data.arguments);
1519
1581
  }
1520
- getValue(context, index) {
1521
- return this.getIndexedValue(context, index);
1582
+ createInstance(data, id) {
1583
+ return new FunctionCallIndex(data.context, data.functionName, id, {
1584
+ canDispose: /* @__PURE__ */ __name(() => this.getReferenceCount(id) === 1, "canDispose"),
1585
+ release: /* @__PURE__ */ __name(() => this.release(id), "release")
1586
+ });
1522
1587
  }
1523
- setValue(context, index, value) {
1524
- const val = this.getIndexedValue(context, index);
1525
- if (val instanceof Subject2) {
1526
- val.next(value);
1527
- return;
1588
+ createId(data) {
1589
+ const context = data.context;
1590
+ if (!context || typeof context !== "object") {
1591
+ throw new ArgumentException(`Expected context to be an object, got ${String(context)}`);
1528
1592
  }
1529
- throw new UnsupportedException("Cannot set value for an observable");
1530
- }
1531
- applies(context, index) {
1532
- const val = this.getIndexedValue(context, index);
1533
- return isObservable2(val);
1534
- }
1535
- setLastValue(observable, value) {
1536
- this._resolvedValueCache.set(observable, value);
1537
- }
1538
- clearLastValue(observable) {
1539
- this._resolvedValueCache.delete(observable);
1593
+ const fn = context[data.functionName];
1594
+ return this._sequenceIdFactory.create(fn, data.arguments);
1540
1595
  }
1541
- getIndexedValue(context, index) {
1542
- return (Type.toObject(context) ?? {})[index];
1596
+ releaseInstance(_, id) {
1597
+ id.dispose();
1543
1598
  }
1544
1599
  };
1545
- ObservableAccessor = _ts_decorate16([
1600
+ FunctionCallIndexFactory = _ts_decorate17([
1546
1601
  injectable(),
1547
- _ts_param8(0, inject(RsXCoreInjectionTokens.IResolvedValueCache)),
1602
+ _ts_param8(0, inject(RsXCoreInjectionTokens.ISequenceIdFactory)),
1548
1603
  _ts_metadata10("design:type", Function),
1549
1604
  _ts_metadata10("design:paramtypes", [
1550
- typeof IResolvedValueCache === "undefined" ? Object : IResolvedValueCache
1605
+ typeof ISequenceIdFactory === "undefined" ? Object : ISequenceIdFactory
1551
1606
  ])
1552
- ], ObservableAccessor);
1607
+ ], FunctionCallIndexFactory);
1553
1608
 
1554
- // lib/index-value-accessor/promise-accessor.ts
1555
- function _ts_decorate17(decorators, target, key, desc) {
1609
+ // lib/function-call-result-cache/function-call-result-cache.factory.ts
1610
+ function _ts_decorate18(decorators, target, key, desc) {
1556
1611
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1557
1612
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1558
1613
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1559
1614
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1560
1615
  }
1561
- __name(_ts_decorate17, "_ts_decorate");
1616
+ __name(_ts_decorate18, "_ts_decorate");
1562
1617
  function _ts_metadata11(k, v) {
1563
1618
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1564
1619
  }
@@ -1569,132 +1624,116 @@ function _ts_param9(paramIndex, decorator) {
1569
1624
  };
1570
1625
  }
1571
1626
  __name(_ts_param9, "_ts_param");
1572
- var PromiseAccessor = class {
1627
+ var FunctionCallResultCache = class FunctionCallResultCache2 {
1573
1628
  static {
1574
- __name(this, "PromiseAccessor");
1575
- }
1576
- _resolvedValueCache;
1577
- priority = 1;
1578
- constructor(_resolvedValueCache) {
1579
- this._resolvedValueCache = _resolvedValueCache;
1580
- }
1581
- getIndexes() {
1582
- return [].values();
1629
+ __name(this, "FunctionCallResultCache");
1583
1630
  }
1584
- isAsync() {
1585
- return true;
1631
+ _disposeableIndex;
1632
+ result;
1633
+ _owner;
1634
+ _isDisposed = false;
1635
+ constructor(_disposeableIndex, result, _owner) {
1636
+ this._disposeableIndex = _disposeableIndex;
1637
+ this.result = result;
1638
+ this._owner = _owner;
1586
1639
  }
1587
- hasValue(context, index) {
1588
- const val = this.getIndexedValue(context, index);
1589
- return this.isCacheable(val) && this._resolvedValueCache.get(val) !== PENDING;
1640
+ get index() {
1641
+ return this._disposeableIndex;
1590
1642
  }
1591
- getResolvedValue(context, index) {
1592
- const val = this.getIndexedValue(context, index);
1593
- return this.isCacheable(val) ? this._resolvedValueCache.get(val) ?? PENDING : PENDING;
1643
+ dispose() {
1644
+ if (this._isDisposed) {
1645
+ return;
1646
+ }
1647
+ if (this._owner.canDispose?.()) {
1648
+ this._disposeableIndex.dispose();
1649
+ this._isDisposed = true;
1650
+ }
1651
+ this._owner.release();
1594
1652
  }
1595
- getValue(context, index) {
1596
- return this.getIndexedValue(context, index);
1653
+ };
1654
+ var FunctionCallResultCacheForContextManager = class FunctionCallResultCacheForContextManager2 extends SingletonFactory {
1655
+ static {
1656
+ __name(this, "FunctionCallResultCacheForContextManager");
1597
1657
  }
1598
- setValue() {
1599
- throw new UnsupportedException("Cannot set value for a Promise");
1658
+ _context;
1659
+ _functionCallIndexFactory;
1660
+ releaseContext;
1661
+ constructor(_context, _functionCallIndexFactory, releaseContext) {
1662
+ super(), this._context = _context, this._functionCallIndexFactory = _functionCallIndexFactory, this.releaseContext = releaseContext;
1600
1663
  }
1601
- applies(context, index) {
1602
- const val = this.getIndexedValue(context, index);
1603
- return val instanceof Promise;
1664
+ getId(data) {
1665
+ return this._functionCallIndexFactory.getFromData({
1666
+ functionName: data.functionName,
1667
+ context: this._context,
1668
+ arguments: data.arguments
1669
+ });
1604
1670
  }
1605
- setLastValue(promise, value) {
1606
- this._resolvedValueCache.set(promise, value);
1671
+ createInstance(data, id) {
1672
+ return new FunctionCallResultCache(id, data.result, {
1673
+ canDispose: /* @__PURE__ */ __name(() => this.getReferenceCount(id) === 1, "canDispose"),
1674
+ release: /* @__PURE__ */ __name(() => this.release(id), "release")
1675
+ });
1607
1676
  }
1608
- clearLastValue(promise) {
1609
- this._resolvedValueCache.delete(promise);
1677
+ createId(data) {
1678
+ return this._functionCallIndexFactory.create({
1679
+ functionName: data.functionName,
1680
+ context: this._context,
1681
+ arguments: data.arguments
1682
+ }).instance;
1610
1683
  }
1611
- getIndexedValue(context, index) {
1612
- return (Type.toObject(context) ?? {})[index];
1684
+ releaseInstance(_, id) {
1685
+ this._functionCallIndexFactory.release(id.argumentsId);
1613
1686
  }
1614
- isCacheable(value) {
1615
- return value !== null && (typeof value === "object" || typeof value === "function");
1687
+ onReleased() {
1688
+ this.releaseContext();
1616
1689
  }
1617
1690
  };
1618
- PromiseAccessor = _ts_decorate17([
1619
- injectable(),
1620
- _ts_param9(0, inject(RsXCoreInjectionTokens.IResolvedValueCache)),
1621
- _ts_metadata11("design:type", Function),
1622
- _ts_metadata11("design:paramtypes", [
1623
- typeof IResolvedValueCache === "undefined" ? Object : IResolvedValueCache
1624
- ])
1625
- ], PromiseAccessor);
1626
-
1627
- // lib/index-value-accessor/property-value-accessor.ts
1628
- import { isObservable as isObservable3 } from "rxjs";
1629
- var PropertyValueAccessor = class {
1691
+ var FunctionCallResultCacheManager = class FunctionCallResultCacheManager2 extends SingletonFactory {
1630
1692
  static {
1631
- __name(this, "PropertyValueAccessor");
1632
- }
1633
- priority = 7;
1634
- isAsync() {
1635
- return false;
1636
- }
1637
- getIndexes(context) {
1638
- const obj = Type.toObject(context);
1639
- if (!obj) {
1640
- return [].values();
1641
- }
1642
- return Object.keys(obj).filter((key) => !Type.isMethod(obj[key])).values();
1643
- }
1644
- hasValue(context, index) {
1645
- const val = this.getValue(context, index);
1646
- return val !== void 0;
1693
+ __name(this, "FunctionCallResultCacheManager");
1647
1694
  }
1648
- getResolvedValue(context, index) {
1649
- return this.getValue(context, index);
1695
+ _functionCallIndexFactory;
1696
+ constructor(_functionCallIndexFactory) {
1697
+ super(), this._functionCallIndexFactory = _functionCallIndexFactory;
1650
1698
  }
1651
- getValue(context, index) {
1652
- const obj = Type.toObject(context);
1653
- return obj ? obj[index] : void 0;
1699
+ getId(contex) {
1700
+ return this.createId(contex);
1654
1701
  }
1655
- setValue(context, index, value) {
1656
- const obj = Type.toObject(context);
1657
- if (obj) {
1658
- obj[index] = value;
1659
- }
1702
+ createInstance(context, id) {
1703
+ return new FunctionCallResultCacheForContextManager(context, this._functionCallIndexFactory, () => this.release(id));
1660
1704
  }
1661
- applies(context, index) {
1662
- const obj = Type.toObject(context);
1663
- if (!obj) {
1664
- return false;
1665
- }
1666
- return Type.hasProperty(obj, index) && !(obj instanceof Date) && !isObservable3(obj[index]) && !(obj[index] instanceof Promise);
1705
+ createId(contex) {
1706
+ return contex;
1667
1707
  }
1668
1708
  };
1669
-
1670
- // lib/index-value-accessor/resolved-value-cache.ts
1671
- function _ts_decorate18(decorators, target, key, desc) {
1672
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1673
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1674
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1675
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1676
- }
1677
- __name(_ts_decorate18, "_ts_decorate");
1678
- var ResolvedValueCache = class {
1709
+ var FunctionCallResultCacheFactory = class {
1679
1710
  static {
1680
- __name(this, "ResolvedValueCache");
1711
+ __name(this, "FunctionCallResultCacheFactory");
1681
1712
  }
1682
- _resolvedValues = /* @__PURE__ */ new WeakMap();
1683
- set(source, value) {
1684
- this._resolvedValues.set(source, value);
1713
+ _functionCallResultCacheManager;
1714
+ constructor(functionCallIndexFactory) {
1715
+ this._functionCallResultCacheManager = new FunctionCallResultCacheManager(functionCallIndexFactory);
1685
1716
  }
1686
- get(source) {
1687
- return this._resolvedValues.get(source);
1717
+ create(context, result) {
1718
+ return this._functionCallResultCacheManager.create(context).instance.create(result).instance;
1688
1719
  }
1689
- delete(source) {
1690
- this._resolvedValues.delete(source);
1720
+ has(context, index) {
1721
+ return this._functionCallResultCacheManager.getFromId(context)?.has(index) ?? false;
1722
+ }
1723
+ get(context, index) {
1724
+ return this._functionCallResultCacheManager.getFromId(context)?.getFromId(index);
1691
1725
  }
1692
1726
  };
1693
- ResolvedValueCache = _ts_decorate18([
1694
- injectable()
1695
- ], ResolvedValueCache);
1727
+ FunctionCallResultCacheFactory = _ts_decorate18([
1728
+ injectable(),
1729
+ _ts_param9(0, inject(RsXCoreInjectionTokens.IFunctionCallIndexFactory)),
1730
+ _ts_metadata11("design:type", Function),
1731
+ _ts_metadata11("design:paramtypes", [
1732
+ typeof IFunctionCallIndexFactory === "undefined" ? Object : IFunctionCallIndexFactory
1733
+ ])
1734
+ ], FunctionCallResultCacheFactory);
1696
1735
 
1697
- // lib/index-value-accessor/set-key-accessor.ts
1736
+ // lib/guid/guid.factory.ts
1698
1737
  function _ts_decorate19(decorators, target, key, desc) {
1699
1738
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1700
1739
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1702,36 +1741,17 @@ function _ts_decorate19(decorators, target, key, desc) {
1702
1741
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1703
1742
  }
1704
1743
  __name(_ts_decorate19, "_ts_decorate");
1705
- var SetKeyAccessor = class {
1744
+ var GuidFactory = class {
1706
1745
  static {
1707
- __name(this, "SetKeyAccessor");
1708
- }
1709
- priority = 3;
1710
- getIndexes(set) {
1711
- return new Set(set).values();
1712
- }
1713
- isAsync() {
1714
- return false;
1715
- }
1716
- hasValue(set, key) {
1717
- return set.has(key);
1718
- }
1719
- getResolvedValue(set, key) {
1720
- return set.has(key) ? key : void 0;
1721
- }
1722
- getValue(set, key) {
1723
- return this.getResolvedValue(set, key);
1724
- }
1725
- setValue(set, key, value) {
1726
- replaceSetItemAt(set, key, value);
1746
+ __name(this, "GuidFactory");
1727
1747
  }
1728
- applies(map) {
1729
- return map instanceof Set;
1748
+ create() {
1749
+ return crypto.randomUUID();
1730
1750
  }
1731
1751
  };
1732
- SetKeyAccessor = _ts_decorate19([
1752
+ GuidFactory = _ts_decorate19([
1733
1753
  injectable()
1734
- ], SetKeyAccessor);
1754
+ ], GuidFactory);
1735
1755
 
1736
1756
  // lib/singleton-factory/singleton-factory-with-id-generation.ts
1737
1757
  var SingletonFactoryWithIdGeneration = class extends SingletonFactory {
@@ -1739,6 +1759,26 @@ var SingletonFactoryWithIdGeneration = class extends SingletonFactory {
1739
1759
  __name(this, "SingletonFactoryWithIdGeneration");
1740
1760
  }
1741
1761
  _groupedData = /* @__PURE__ */ new Map();
1762
+ *instanceGroupInfoEntries() {
1763
+ for (const groupId of this.groupIds) {
1764
+ const group = this.getGroup(groupId);
1765
+ if (!group) {
1766
+ continue;
1767
+ }
1768
+ for (const [groupMemberId, id] of group) {
1769
+ const instance = this.getFromId(id);
1770
+ if (!instance) {
1771
+ continue;
1772
+ }
1773
+ yield {
1774
+ groupId,
1775
+ groupMemberId,
1776
+ id,
1777
+ instance
1778
+ };
1779
+ }
1780
+ }
1781
+ }
1742
1782
  getId(data) {
1743
1783
  const groupId = this.getGroupId(data);
1744
1784
  const groupMemberId = this.getGroupMemberId(data);
@@ -1747,6 +1787,12 @@ var SingletonFactoryWithIdGeneration = class extends SingletonFactory {
1747
1787
  isGroupRegistered(groupId) {
1748
1788
  return this._groupedData.has(groupId);
1749
1789
  }
1790
+ get groupIds() {
1791
+ return this._groupedData.keys();
1792
+ }
1793
+ getGroup(groupId) {
1794
+ return this._groupedData.get(groupId);
1795
+ }
1750
1796
  createId(data) {
1751
1797
  const groupId = this.getGroupId(data);
1752
1798
  let dataGroup = this._groupedData.get(groupId);
@@ -2013,6 +2059,251 @@ SequenceIdFactory = _ts_decorate20([
2013
2059
  ])
2014
2060
  ], SequenceIdFactory);
2015
2061
 
2062
+ // lib/value-metadata/array-metadata.ts
2063
+ function _ts_decorate21(decorators, target, key, desc) {
2064
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2065
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2066
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2067
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2068
+ }
2069
+ __name(_ts_decorate21, "_ts_decorate");
2070
+ var ArrayMetadata = class {
2071
+ static {
2072
+ __name(this, "ArrayMetadata");
2073
+ }
2074
+ priority = 8;
2075
+ isAsync() {
2076
+ return false;
2077
+ }
2078
+ needsProxy() {
2079
+ return true;
2080
+ }
2081
+ applies(value) {
2082
+ return Array.isArray(value);
2083
+ }
2084
+ };
2085
+ ArrayMetadata = _ts_decorate21([
2086
+ injectable()
2087
+ ], ArrayMetadata);
2088
+
2089
+ // lib/value-metadata/date-metadata.ts
2090
+ function _ts_decorate22(decorators, target, key, desc) {
2091
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2092
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2093
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2094
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2095
+ }
2096
+ __name(_ts_decorate22, "_ts_decorate");
2097
+ var DateMetadata = class {
2098
+ static {
2099
+ __name(this, "DateMetadata");
2100
+ }
2101
+ priority = 7;
2102
+ isAsync() {
2103
+ return false;
2104
+ }
2105
+ needsProxy() {
2106
+ return true;
2107
+ }
2108
+ applies(value) {
2109
+ return value instanceof Date;
2110
+ }
2111
+ };
2112
+ DateMetadata = _ts_decorate22([
2113
+ injectable()
2114
+ ], DateMetadata);
2115
+
2116
+ // lib/value-metadata/dummy-metadata.ts
2117
+ function _ts_decorate23(decorators, target, key, desc) {
2118
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2119
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2120
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2121
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2122
+ }
2123
+ __name(_ts_decorate23, "_ts_decorate");
2124
+ var DummyMetadata = class {
2125
+ static {
2126
+ __name(this, "DummyMetadata");
2127
+ }
2128
+ priority = -1e3;
2129
+ isAsync() {
2130
+ return false;
2131
+ }
2132
+ needsProxy() {
2133
+ return false;
2134
+ }
2135
+ applies() {
2136
+ return true;
2137
+ }
2138
+ };
2139
+ DummyMetadata = _ts_decorate23([
2140
+ injectable()
2141
+ ], DummyMetadata);
2142
+
2143
+ // lib/value-metadata/map-metadata.ts
2144
+ function _ts_decorate24(decorators, target, key, desc) {
2145
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2146
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2147
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2148
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2149
+ }
2150
+ __name(_ts_decorate24, "_ts_decorate");
2151
+ var MapMetadata = class {
2152
+ static {
2153
+ __name(this, "MapMetadata");
2154
+ }
2155
+ priority = 6;
2156
+ isAsync() {
2157
+ return false;
2158
+ }
2159
+ needsProxy() {
2160
+ return true;
2161
+ }
2162
+ applies(value) {
2163
+ return value instanceof Map;
2164
+ }
2165
+ };
2166
+ MapMetadata = _ts_decorate24([
2167
+ injectable()
2168
+ ], MapMetadata);
2169
+
2170
+ // lib/value-metadata/observable-metadata.ts
2171
+ import { Observable as Observable2 } from "rxjs";
2172
+ function _ts_decorate25(decorators, target, key, desc) {
2173
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2174
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2175
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2176
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2177
+ }
2178
+ __name(_ts_decorate25, "_ts_decorate");
2179
+ var ObservableMetadata = class {
2180
+ static {
2181
+ __name(this, "ObservableMetadata");
2182
+ }
2183
+ priority = 5;
2184
+ isAsync() {
2185
+ return true;
2186
+ }
2187
+ needsProxy() {
2188
+ return true;
2189
+ }
2190
+ applies(value) {
2191
+ return value instanceof Observable2;
2192
+ }
2193
+ };
2194
+ ObservableMetadata = _ts_decorate25([
2195
+ injectable()
2196
+ ], ObservableMetadata);
2197
+
2198
+ // lib/value-metadata/promise-metadata.ts
2199
+ function _ts_decorate26(decorators, target, key, desc) {
2200
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2201
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2202
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2203
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2204
+ }
2205
+ __name(_ts_decorate26, "_ts_decorate");
2206
+ var PromiseMetadata = class {
2207
+ static {
2208
+ __name(this, "PromiseMetadata");
2209
+ }
2210
+ priority = 4;
2211
+ isAsync() {
2212
+ return true;
2213
+ }
2214
+ needsProxy() {
2215
+ return true;
2216
+ }
2217
+ applies(value) {
2218
+ return value instanceof Promise;
2219
+ }
2220
+ };
2221
+ PromiseMetadata = _ts_decorate26([
2222
+ injectable()
2223
+ ], PromiseMetadata);
2224
+
2225
+ // lib/value-metadata/set-metadata.ts
2226
+ function _ts_decorate27(decorators, target, key, desc) {
2227
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2228
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2229
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2230
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2231
+ }
2232
+ __name(_ts_decorate27, "_ts_decorate");
2233
+ var SetMetadata = class {
2234
+ static {
2235
+ __name(this, "SetMetadata");
2236
+ }
2237
+ priority = 3;
2238
+ isAsync() {
2239
+ return false;
2240
+ }
2241
+ needsProxy() {
2242
+ return true;
2243
+ }
2244
+ applies(value) {
2245
+ return value instanceof Set;
2246
+ }
2247
+ };
2248
+ SetMetadata = _ts_decorate27([
2249
+ injectable()
2250
+ ], SetMetadata);
2251
+
2252
+ // lib/value-metadata/value-metadata.ts
2253
+ function _ts_decorate28(decorators, target, key, desc) {
2254
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2255
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2256
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2257
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2258
+ }
2259
+ __name(_ts_decorate28, "_ts_decorate");
2260
+ function _ts_metadata13(k, v) {
2261
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2262
+ }
2263
+ __name(_ts_metadata13, "_ts_metadata");
2264
+ function _ts_param11(paramIndex, decorator) {
2265
+ return function(target, key) {
2266
+ decorator(target, key, paramIndex);
2267
+ };
2268
+ }
2269
+ __name(_ts_param11, "_ts_param");
2270
+ var ValueMetadata = class {
2271
+ static {
2272
+ __name(this, "ValueMetadata");
2273
+ }
2274
+ priority = 11;
2275
+ _valueMetadataList;
2276
+ constructor(valueMetadataList) {
2277
+ this._valueMetadataList = [
2278
+ ...valueMetadataList
2279
+ ].sort((a, b) => b.priority - a.priority);
2280
+ }
2281
+ isAsync(value) {
2282
+ return this.getValueMetadata(value).isAsync(value);
2283
+ }
2284
+ needsProxy(value) {
2285
+ return this.getValueMetadata(value).needsProxy(value);
2286
+ }
2287
+ applies(value) {
2288
+ return !!this.getValueMetadata(value);
2289
+ }
2290
+ getValueMetadata(value) {
2291
+ const valueMetadata = this._valueMetadataList.find((valueMetadata2) => valueMetadata2.applies(value));
2292
+ if (!valueMetadata) {
2293
+ throw new UnsupportedException(`No accessor found for ${Type.toObject(value)?.constructor.name}}`);
2294
+ }
2295
+ return valueMetadata;
2296
+ }
2297
+ };
2298
+ ValueMetadata = _ts_decorate28([
2299
+ injectable(),
2300
+ _ts_param11(0, multiInject(RsXCoreInjectionTokens.IValueMetadataList)),
2301
+ _ts_metadata13("design:type", Function),
2302
+ _ts_metadata13("design:paramtypes", [
2303
+ Object
2304
+ ])
2305
+ ], ValueMetadata);
2306
+
2016
2307
  // lib/rs-x-core.module.ts
2017
2308
  var defaultIndexValueAccessorList = [
2018
2309
  {
@@ -2058,6 +2349,36 @@ var defaultDeeoCloneList = [
2058
2349
  token: RsXCoreInjectionTokens.ILodashDeepClone
2059
2350
  }
2060
2351
  ];
2352
+ var defaultValueMetadataList = [
2353
+ {
2354
+ target: ArrayMetadata,
2355
+ token: RsXCoreInjectionTokens.ArrayMetadata
2356
+ },
2357
+ {
2358
+ target: DateMetadata,
2359
+ token: RsXCoreInjectionTokens.DateMetadata
2360
+ },
2361
+ {
2362
+ target: DummyMetadata,
2363
+ token: RsXCoreInjectionTokens.DummyMetadata
2364
+ },
2365
+ {
2366
+ target: MapMetadata,
2367
+ token: RsXCoreInjectionTokens.MapMetadata
2368
+ },
2369
+ {
2370
+ target: ObservableMetadata,
2371
+ token: RsXCoreInjectionTokens.ObservableMetadata
2372
+ },
2373
+ {
2374
+ target: PromiseMetadata,
2375
+ token: RsXCoreInjectionTokens.PromiseMetadata
2376
+ },
2377
+ {
2378
+ target: SetMetadata,
2379
+ token: RsXCoreInjectionTokens.SetMetadata
2380
+ }
2381
+ ];
2061
2382
  var RsXCoreModule = new ContainerModule((options) => {
2062
2383
  options.bind(RsXCoreInjectionTokens.IInjectionContainer).toConstantValue(InjectionContainer);
2063
2384
  options.bind(RsXCoreInjectionTokens.IErrorLog).to(ErrorLog).inSingletonScope();
@@ -2071,12 +2392,14 @@ var RsXCoreModule = new ContainerModule((options) => {
2071
2392
  options.bind(RsXCoreInjectionTokens.IResolvedValueCache).to(ResolvedValueCache).inSingletonScope();
2072
2393
  options.bind(RsXCoreInjectionTokens.IDeepCloneExcept).to(DeepCloneValueExcept).inSingletonScope();
2073
2394
  options.bind(RsXCoreInjectionTokens.DefaultDeepCloneExcept).to(DeepCloneValueExcept).inSingletonScope();
2395
+ options.bind(RsXCoreInjectionTokens.IValueMetadata).to(ValueMetadata).inSingletonScope();
2074
2396
  registerMultiInjectServices(options, RsXCoreInjectionTokens.IIndexValueAccessorList, defaultIndexValueAccessorList);
2075
2397
  registerMultiInjectServices(options, RsXCoreInjectionTokens.IDeepCloneList, defaultDeeoCloneList);
2398
+ registerMultiInjectServices(options, RsXCoreInjectionTokens.IValueMetadataList, defaultValueMetadataList);
2076
2399
  });
2077
2400
 
2078
2401
  // lib/wait-for-event.ts
2079
- import { firstValueFrom, Observable as Observable2 } from "rxjs";
2402
+ import { firstValueFrom, Observable as Observable3 } from "rxjs";
2080
2403
  var WaitForEvent = class {
2081
2404
  static {
2082
2405
  __name(this, "WaitForEvent");
@@ -2132,7 +2455,7 @@ var WaitForEvent = class {
2132
2455
  const result = trigger();
2133
2456
  if (result instanceof Promise) {
2134
2457
  await result;
2135
- } else if (result instanceof Observable2) {
2458
+ } else if (result instanceof Observable3) {
2136
2459
  await firstValueFrom(result);
2137
2460
  }
2138
2461
  } catch (error) {
@@ -2157,12 +2480,17 @@ var WaitForEvent = class {
2157
2480
  export {
2158
2481
  ArgumentException,
2159
2482
  ArrayIndexAccessor,
2483
+ ArrayMetadata,
2160
2484
  Assertion,
2485
+ AssertionError,
2161
2486
  Container,
2162
2487
  ContainerModule,
2488
+ CustomError,
2489
+ DateMetadata,
2163
2490
  DatePropertyAccessor,
2164
2491
  DeepCloneValueExcept,
2165
2492
  DefaultDeepClone,
2493
+ DummyMetadata,
2166
2494
  EqualityService,
2167
2495
  ErrorLog,
2168
2496
  FunctionCallIndex,
@@ -2177,16 +2505,19 @@ export {
2177
2505
  InvalidOperationException,
2178
2506
  LodashDeepClone,
2179
2507
  MapKeyAccessor,
2508
+ MapMetadata,
2180
2509
  MethodAccessor,
2181
2510
  multiInject as MultiInject,
2182
2511
  NullOrEmptyException,
2183
2512
  NullOrUndefinedException,
2184
2513
  ObservableAccessor,
2514
+ ObservableMetadata,
2185
2515
  PENDING,
2186
2516
  ParserException,
2187
2517
  preDestroy as PreDestroy,
2188
2518
  PrettyPrinter,
2189
2519
  PromiseAccessor,
2520
+ PromiseMetadata,
2190
2521
  PropertyDescriptorType,
2191
2522
  PropertyValueAccessor,
2192
2523
  ResolvedValueCache,
@@ -2195,6 +2526,7 @@ export {
2195
2526
  SequenceIdFactory,
2196
2527
  SequenceWithId,
2197
2528
  SetKeyAccessor,
2529
+ SetMetadata,
2198
2530
  SingletonFactory,
2199
2531
  SingletonFactoryWithGuid,
2200
2532
  SingletonFactoryWithIdGeneration,
@@ -2203,10 +2535,12 @@ export {
2203
2535
  UnexpectedException,
2204
2536
  unmanaged as Unmanaged,
2205
2537
  UnsupportedException,
2538
+ ValueMetadata,
2206
2539
  WaitForEvent,
2207
2540
  dataProperties,
2208
2541
  defaultDeeoCloneList,
2209
2542
  defaultIndexValueAccessorList,
2543
+ defaultValueMetadataList,
2210
2544
  echo,
2211
2545
  emptyFunction,
2212
2546
  emptyValue,