@speclynx/apidom-datamodel 1.12.2

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 (46) hide show
  1. package/LICENSES/AFL-3.0.txt +182 -0
  2. package/LICENSES/Apache-2.0.txt +202 -0
  3. package/LICENSES/BSD-3-Clause.txt +26 -0
  4. package/LICENSES/MIT.txt +9 -0
  5. package/NOTICE +74 -0
  6. package/README.md +479 -0
  7. package/dist/apidom-datamodel.browser.js +2717 -0
  8. package/dist/apidom-datamodel.browser.min.js +1 -0
  9. package/package.json +53 -0
  10. package/src/KeyValuePair.cjs +38 -0
  11. package/src/KeyValuePair.mjs +34 -0
  12. package/src/Namespace.cjs +212 -0
  13. package/src/Namespace.mjs +206 -0
  14. package/src/ObjectSlice.cjs +206 -0
  15. package/src/ObjectSlice.mjs +202 -0
  16. package/src/elements/LinkElement.cjs +44 -0
  17. package/src/elements/LinkElement.mjs +39 -0
  18. package/src/elements/RefElement.cjs +31 -0
  19. package/src/elements/RefElement.mjs +26 -0
  20. package/src/index.cjs +25 -0
  21. package/src/index.mjs +6 -0
  22. package/src/primitives/ArrayElement.cjs +176 -0
  23. package/src/primitives/ArrayElement.mjs +169 -0
  24. package/src/primitives/BooleanElement.cjs +20 -0
  25. package/src/primitives/BooleanElement.mjs +15 -0
  26. package/src/primitives/CollectionElement.cjs +194 -0
  27. package/src/primitives/CollectionElement.mjs +187 -0
  28. package/src/primitives/Element.cjs +438 -0
  29. package/src/primitives/Element.mjs +433 -0
  30. package/src/primitives/MemberElement.cjs +54 -0
  31. package/src/primitives/MemberElement.mjs +49 -0
  32. package/src/primitives/NullElement.cjs +28 -0
  33. package/src/primitives/NullElement.mjs +23 -0
  34. package/src/primitives/NumberElement.cjs +20 -0
  35. package/src/primitives/NumberElement.mjs +15 -0
  36. package/src/primitives/ObjectElement.cjs +222 -0
  37. package/src/primitives/ObjectElement.mjs +216 -0
  38. package/src/primitives/StringElement.cjs +27 -0
  39. package/src/primitives/StringElement.mjs +22 -0
  40. package/src/registration.cjs +87 -0
  41. package/src/registration.mjs +70 -0
  42. package/src/serialisers/JSONSerialiser.cjs +144 -0
  43. package/src/serialisers/JSONSerialiser.mjs +140 -0
  44. package/src/types.cjs +3 -0
  45. package/src/types.mjs +1 -0
  46. package/types/apidom-datamodel.d.ts +887 -0
@@ -0,0 +1,2717 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["apidomDatamodel"] = factory();
8
+ else
9
+ root["apidomDatamodel"] = factory();
10
+ })(self, () => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 3:
16
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17
+
18
+ __webpack_require__.r(__webpack_exports__);
19
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
+ /* harmony export */ "default": () => (/* binding */ _isPlaceholder)
21
+ /* harmony export */ });
22
+ function _isPlaceholder(a) {
23
+ return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
24
+ }
25
+
26
+ /***/ }),
27
+
28
+ /***/ 18:
29
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
30
+
31
+ __webpack_require__.r(__webpack_exports__);
32
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33
+ /* harmony export */ ArrayElement: () => (/* reexport safe */ _primitives_ArrayElement_ts__WEBPACK_IMPORTED_MODULE_6__["default"]),
34
+ /* harmony export */ BooleanElement: () => (/* reexport safe */ _primitives_BooleanElement_ts__WEBPACK_IMPORTED_MODULE_5__["default"]),
35
+ /* harmony export */ CollectionElement: () => (/* reexport safe */ _primitives_CollectionElement_ts__WEBPACK_IMPORTED_MODULE_1__["default"]),
36
+ /* harmony export */ Element: () => (/* reexport safe */ _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"]),
37
+ /* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_12__["default"]),
38
+ /* harmony export */ LinkElement: () => (/* reexport safe */ _elements_LinkElement_ts__WEBPACK_IMPORTED_MODULE_9__["default"]),
39
+ /* harmony export */ MemberElement: () => (/* reexport safe */ _primitives_MemberElement_ts__WEBPACK_IMPORTED_MODULE_7__["default"]),
40
+ /* harmony export */ NullElement: () => (/* reexport safe */ _primitives_NullElement_ts__WEBPACK_IMPORTED_MODULE_2__["default"]),
41
+ /* harmony export */ NumberElement: () => (/* reexport safe */ _primitives_NumberElement_ts__WEBPACK_IMPORTED_MODULE_4__["default"]),
42
+ /* harmony export */ ObjectElement: () => (/* reexport safe */ _primitives_ObjectElement_ts__WEBPACK_IMPORTED_MODULE_8__["default"]),
43
+ /* harmony export */ ObjectSlice: () => (/* reexport safe */ _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_11__["default"]),
44
+ /* harmony export */ RefElement: () => (/* reexport safe */ _elements_RefElement_ts__WEBPACK_IMPORTED_MODULE_10__["default"]),
45
+ /* harmony export */ StringElement: () => (/* reexport safe */ _primitives_StringElement_ts__WEBPACK_IMPORTED_MODULE_3__["default"]),
46
+ /* harmony export */ refract: () => (/* binding */ refract)
47
+ /* harmony export */ });
48
+ /* harmony import */ var _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
49
+ /* harmony import */ var _primitives_CollectionElement_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(766);
50
+ /* harmony import */ var _primitives_NullElement_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(377);
51
+ /* harmony import */ var _primitives_StringElement_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(805);
52
+ /* harmony import */ var _primitives_NumberElement_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(933);
53
+ /* harmony import */ var _primitives_BooleanElement_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(492);
54
+ /* harmony import */ var _primitives_ArrayElement_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(603);
55
+ /* harmony import */ var _primitives_MemberElement_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(136);
56
+ /* harmony import */ var _primitives_ObjectElement_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(975);
57
+ /* harmony import */ var _elements_LinkElement_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(885);
58
+ /* harmony import */ var _elements_RefElement_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(474);
59
+ /* harmony import */ var _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(660);
60
+ /* harmony import */ var _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(807);
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+ /**
76
+ * Refracts an array item to ApiDOM element.
77
+ * Converts undefined to NullElement (aligned with JSON.stringify behavior).
78
+ */
79
+ function refractArrayItem(value) {
80
+ if (value === undefined) {
81
+ return new _primitives_NullElement_ts__WEBPACK_IMPORTED_MODULE_2__["default"]();
82
+ }
83
+ return refract(value);
84
+ }
85
+
86
+ /**
87
+ * Refracts a JSON type to ApiDOM elements.
88
+ * @public
89
+ */
90
+ function refract(value) {
91
+ if (value instanceof _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) {
92
+ return value;
93
+ }
94
+ if (typeof value === 'string') {
95
+ return new _primitives_StringElement_ts__WEBPACK_IMPORTED_MODULE_3__["default"](value);
96
+ }
97
+ if (typeof value === 'number') {
98
+ return new _primitives_NumberElement_ts__WEBPACK_IMPORTED_MODULE_4__["default"](value);
99
+ }
100
+ if (typeof value === 'boolean') {
101
+ return new _primitives_BooleanElement_ts__WEBPACK_IMPORTED_MODULE_5__["default"](value);
102
+ }
103
+ if (value === null) {
104
+ return new _primitives_NullElement_ts__WEBPACK_IMPORTED_MODULE_2__["default"]();
105
+ }
106
+ if (Array.isArray(value)) {
107
+ return new _primitives_ArrayElement_ts__WEBPACK_IMPORTED_MODULE_6__["default"](value.map(refractArrayItem));
108
+ }
109
+ if (typeof value === 'object') {
110
+ return new _primitives_ObjectElement_ts__WEBPACK_IMPORTED_MODULE_8__["default"](value);
111
+ }
112
+ throw new Error(`Cannot refract value of type ${typeof value}`);
113
+ }
114
+
115
+ // Set up prototype assignments for circular dependency resolution.
116
+ // These allow Element instances to create ObjectElement, MemberElement, RefElement
117
+ // without importing them directly (which would cause circular imports).
118
+ // Using 'declare' in the class definitions enables type-safe access to these properties.
119
+ _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ObjectElement = _primitives_ObjectElement_ts__WEBPACK_IMPORTED_MODULE_8__["default"];
120
+ _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ArrayElement = _primitives_ArrayElement_ts__WEBPACK_IMPORTED_MODULE_6__["default"];
121
+ _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.RefElement = _elements_RefElement_ts__WEBPACK_IMPORTED_MODULE_10__["default"];
122
+ _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.MemberElement = _primitives_MemberElement_ts__WEBPACK_IMPORTED_MODULE_7__["default"];
123
+ _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.refract = refract;
124
+
125
+ /**
126
+ * Contains all of the element classes, and related structures and methods
127
+ * for handling with element instances.
128
+ */
129
+
130
+
131
+ // Re-export types from element classes
132
+
133
+ /***/ }),
134
+
135
+ /***/ 27:
136
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
137
+
138
+ __webpack_require__.r(__webpack_exports__);
139
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
140
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
141
+ /* harmony export */ });
142
+ /**
143
+ * Serialized representation of an Element in JSON Refract format.
144
+ * @public
145
+ */
146
+
147
+ /**
148
+ * Serialized representation of a KeyValuePair in JSON Refract format.
149
+ * @public
150
+ */
151
+
152
+ /**
153
+ * Possible content types in a serialized element.
154
+ * @public
155
+ */
156
+
157
+ /**
158
+ * Input document format for deserialization.
159
+ * @public
160
+ */
161
+
162
+ /**
163
+ * JSONSerialiser handles serialization and deserialization of ApiDOM elements
164
+ * to and from JSON Refract format.
165
+ * @public
166
+ */
167
+ class JSONSerialiser {
168
+ namespace;
169
+
170
+ // This will be set via prototype assignment to avoid circular dependency
171
+
172
+ constructor(namespace) {
173
+ this.namespace = namespace || new this.Namespace();
174
+ }
175
+
176
+ /**
177
+ * Serializes an Element to JSON Refract format.
178
+ */
179
+ serialise(element) {
180
+ if (!(element instanceof this.namespace.elements.Element)) {
181
+ throw new TypeError(`Given element \`${element}\` is not an Element instance`);
182
+ }
183
+ const payload = {
184
+ element: element.element
185
+ };
186
+ if (element._meta && element._meta.length > 0) {
187
+ payload.meta = this.serialiseObject(element.meta);
188
+ }
189
+ if (element._attributes && element._attributes.length > 0) {
190
+ payload.attributes = this.serialiseObject(element.attributes);
191
+ }
192
+ const content = this.serialiseContent(element.content);
193
+ if (content !== undefined) {
194
+ payload.content = content;
195
+ }
196
+ return payload;
197
+ }
198
+
199
+ /**
200
+ * Deserializes a JSON Refract document to an Element.
201
+ */
202
+ deserialise(value) {
203
+ if (!value.element) {
204
+ throw new Error('Given value is not an object containing an element name');
205
+ }
206
+ const ElementClass = this.namespace.getElementClass(value.element);
207
+ const element = new ElementClass();
208
+ if (element.element !== value.element) {
209
+ element.element = value.element;
210
+ }
211
+ if (value.meta) {
212
+ this.deserialiseObject(value.meta, element.meta);
213
+ }
214
+ if (value.attributes) {
215
+ this.deserialiseObject(value.attributes, element.attributes);
216
+ }
217
+ const content = this.deserialiseContent(value.content);
218
+ if (content !== undefined || element.content === null) {
219
+ element.content = content;
220
+ }
221
+ return element;
222
+ }
223
+ serialiseContent(content) {
224
+ if (content instanceof this.namespace.elements.Element) {
225
+ return this.serialise(content);
226
+ }
227
+ if (content instanceof this.namespace.KeyValuePair) {
228
+ const kvp = content;
229
+ const pair = {
230
+ key: this.serialise(kvp.key)
231
+ };
232
+ if (kvp.value) {
233
+ pair.value = this.serialise(kvp.value);
234
+ }
235
+ return pair;
236
+ }
237
+ if (content && Array.isArray(content)) {
238
+ if (content.length === 0) {
239
+ return undefined;
240
+ }
241
+ return content.map(item => this.serialise(item));
242
+ }
243
+ return content;
244
+ }
245
+ deserialiseContent(content) {
246
+ if (content) {
247
+ if (content.element) {
248
+ return this.deserialise(content);
249
+ }
250
+ if (content.key) {
251
+ const pair = new this.namespace.KeyValuePair(this.deserialise(content.key));
252
+ if (content.value) {
253
+ pair.value = this.deserialise(content.value);
254
+ }
255
+ return pair;
256
+ }
257
+ if (Array.isArray(content)) {
258
+ return content.map(item => this.deserialise(item));
259
+ }
260
+ }
261
+ return content;
262
+ }
263
+ serialiseObject(obj) {
264
+ const result = {};
265
+ obj.forEach((value, key) => {
266
+ if (value) {
267
+ result[key.toValue()] = this.serialise(value);
268
+ }
269
+ });
270
+ if (Object.keys(result).length === 0) {
271
+ return undefined;
272
+ }
273
+ return result;
274
+ }
275
+ deserialiseObject(from, to) {
276
+ Object.keys(from).forEach(key => {
277
+ to.set(key, this.deserialise(from[key]));
278
+ });
279
+ }
280
+ }
281
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONSerialiser);
282
+
283
+ /***/ }),
284
+
285
+ /***/ 111:
286
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
287
+
288
+ __webpack_require__.r(__webpack_exports__);
289
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
290
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
291
+ /* harmony export */ });
292
+ // Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
293
+ function _objectIs(a, b) {
294
+ // SameValue algorithm
295
+ if (a === b) {
296
+ // Steps 1-5, 7-10
297
+ // Steps 6.b-6.e: +0 != -0
298
+ return a !== 0 || 1 / a === 1 / b;
299
+ } else {
300
+ // Step 6.a: NaN == NaN
301
+ return a !== a && b !== b;
302
+ }
303
+ }
304
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof Object.is === 'function' ? Object.is : _objectIs);
305
+
306
+ /***/ }),
307
+
308
+ /***/ 136:
309
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
310
+
311
+ __webpack_require__.r(__webpack_exports__);
312
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
313
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
314
+ /* harmony export */ });
315
+ /* harmony import */ var _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(807);
316
+ /* harmony import */ var _Element_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(370);
317
+
318
+
319
+
320
+ /**
321
+ * MemberElement represents a key-value pair member in an ObjectElement.
322
+ *
323
+ * The member's content is always a KeyValuePair containing:
324
+ * - `key`: The key element (typically a StringElement)
325
+ * - `value`: The value element (any Element type)
326
+ *
327
+ * @typeParam K - The key element type, defaults to Element
328
+ * @typeParam V - The value element type, defaults to Element
329
+ * @public
330
+ */
331
+ class MemberElement extends _Element_ts__WEBPACK_IMPORTED_MODULE_1__["default"] {
332
+ constructor(key, value, meta, attributes) {
333
+ super(new _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_0__["default"](), meta, attributes);
334
+ this.element = 'member';
335
+ if (key !== undefined) {
336
+ this.key = key;
337
+ }
338
+ if (value !== undefined) {
339
+ this.value = value;
340
+ }
341
+ }
342
+ primitive() {
343
+ return 'member';
344
+ }
345
+
346
+ /**
347
+ * The key element of this member.
348
+ */
349
+ get key() {
350
+ return this._content.key;
351
+ }
352
+ set key(value) {
353
+ this._content.key = this.refract(value);
354
+ }
355
+
356
+ /**
357
+ * The value element of this member.
358
+ */
359
+ get value() {
360
+ return this._content.value;
361
+ }
362
+ set value(value) {
363
+ this._content.value = this.refract(value);
364
+ }
365
+ }
366
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MemberElement);
367
+
368
+ /***/ }),
369
+
370
+ /***/ 333:
371
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
372
+
373
+ __webpack_require__.r(__webpack_exports__);
374
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
375
+ /* harmony export */ "default": () => (/* binding */ _includesWith)
376
+ /* harmony export */ });
377
+ function _includesWith(pred, x, list) {
378
+ var idx = 0;
379
+ var len = list.length;
380
+ while (idx < len) {
381
+ if (pred(x, list[idx])) {
382
+ return true;
383
+ }
384
+ idx += 1;
385
+ }
386
+ return false;
387
+ }
388
+
389
+ /***/ }),
390
+
391
+ /***/ 370:
392
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
393
+
394
+ __webpack_require__.r(__webpack_exports__);
395
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
396
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
397
+ /* harmony export */ });
398
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(654);
399
+ /* harmony import */ var _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(807);
400
+ /* harmony import */ var _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(660);
401
+
402
+
403
+
404
+
405
+ /**
406
+ * Valid content types for an Element.
407
+ * @public
408
+ */
409
+
410
+ /**
411
+ * Base Element class that all ApiDOM elements extend.
412
+ *
413
+ * Elements are the core building blocks of ApiDOM. Each element has:
414
+ * - An `element` property identifying its type
415
+ * - Optional `content` holding the element's value
416
+ * - Optional `meta` for metadata (id, classes, title, description, links)
417
+ * - Optional `attributes` for element-specific properties
418
+ *
419
+ * @public
420
+ */
421
+ class Element {
422
+ /**
423
+ * The element type identifier.
424
+ * @internal
425
+ */
426
+ _storedElement = 'element';
427
+
428
+ /**
429
+ * The element's content/value.
430
+ * @internal
431
+ */
432
+ _content;
433
+
434
+ /**
435
+ * Metadata about this element.
436
+ * @internal
437
+ */
438
+ _meta;
439
+
440
+ /**
441
+ * Element-specific attributes.
442
+ * @internal
443
+ */
444
+ _attributes;
445
+
446
+ /**
447
+ * Parent element reference (set when tree is frozen).
448
+ */
449
+ parent;
450
+
451
+ // ============================================================
452
+ // Prototype-assigned properties (set in elements.ts)
453
+ // Using 'declare' allows TypeScript to know about these
454
+ // without generating runtime code.
455
+ // ============================================================
456
+
457
+ /** @internal ObjectElement constructor for creating meta/attributes */
458
+
459
+ /** @internal ArrayElement constructor for creating arrays */
460
+
461
+ /** @internal MemberElement constructor for creating object members */
462
+
463
+ /** @internal RefElement constructor for creating references */
464
+
465
+ /** @internal Function to convert values to elements */
466
+
467
+ constructor(content, meta, attributes) {
468
+ if (meta !== undefined) {
469
+ this.meta = meta;
470
+ }
471
+ if (attributes !== undefined) {
472
+ this.attributes = attributes;
473
+ }
474
+ if (content !== undefined) {
475
+ this.content = content;
476
+ }
477
+ }
478
+
479
+ // ============================================================
480
+ // Core Properties
481
+ // ============================================================
482
+
483
+ /**
484
+ * The element type identifier (e.g., 'string', 'object', 'array').
485
+ */
486
+ get element() {
487
+ return this._storedElement;
488
+ }
489
+ set element(value) {
490
+ this._storedElement = value;
491
+ }
492
+
493
+ /**
494
+ * The element's content/value.
495
+ */
496
+ get content() {
497
+ return this._content;
498
+ }
499
+ set content(value) {
500
+ // Already an element
501
+ if (value instanceof Element) {
502
+ this._content = value;
503
+ return;
504
+ }
505
+
506
+ // Primitives (inlined for performance - avoids 8 function calls)
507
+ if (value === null || value === undefined || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint' || typeof value === 'symbol') {
508
+ this._content = value;
509
+ return;
510
+ }
511
+
512
+ // KeyValuePair
513
+ if (value instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
514
+ this._content = value;
515
+ return;
516
+ }
517
+
518
+ // ObjectSlice - extract elements array
519
+ if (value instanceof _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_2__["default"]) {
520
+ this._content = value.elements;
521
+ return;
522
+ }
523
+
524
+ // Array - refract each item
525
+ if (Array.isArray(value)) {
526
+ this._content = value.map(item => this.refract(item));
527
+ return;
528
+ }
529
+
530
+ // Plain object - convert to MemberElements
531
+ if (typeof value === 'object') {
532
+ this._content = Object.entries(value).map(([key, val]) => new this.MemberElement(key, val));
533
+ return;
534
+ }
535
+ throw new Error(`Cannot set content to value of type ${typeof value}`);
536
+ }
537
+
538
+ /**
539
+ * Metadata about this element (id, classes, title, description, links).
540
+ * Lazily creates an ObjectElement if not set.
541
+ */
542
+ get meta() {
543
+ if (!this._meta) {
544
+ if (this.isFrozen) {
545
+ const meta = new this.ObjectElement();
546
+ meta.freeze();
547
+ return meta;
548
+ }
549
+ this._meta = new this.ObjectElement();
550
+ }
551
+ return this._meta;
552
+ }
553
+ set meta(value) {
554
+ if (value instanceof Element) {
555
+ this._meta = value;
556
+ } else {
557
+ this.meta.set(value ?? {});
558
+ }
559
+ }
560
+
561
+ /**
562
+ * Element-specific attributes.
563
+ * Lazily creates an ObjectElement if not set.
564
+ */
565
+ get attributes() {
566
+ if (!this._attributes) {
567
+ if (this.isFrozen) {
568
+ const attributes = new this.ObjectElement();
569
+ attributes.freeze();
570
+ return attributes;
571
+ }
572
+ this._attributes = new this.ObjectElement();
573
+ }
574
+ return this._attributes;
575
+ }
576
+ set attributes(value) {
577
+ if (value instanceof Element) {
578
+ this._attributes = value;
579
+ } else {
580
+ this.attributes.set(value ?? {});
581
+ }
582
+ }
583
+
584
+ // ============================================================
585
+ // Meta Property Shortcuts
586
+ // ============================================================
587
+
588
+ /** Unique identifier for this element. */
589
+ get id() {
590
+ return this.getMetaProperty('id', '');
591
+ }
592
+ set id(value) {
593
+ this.setMetaProperty('id', value);
594
+ }
595
+
596
+ /** CSS-like class names. */
597
+ get classes() {
598
+ return this.getMetaProperty('classes', []);
599
+ }
600
+ set classes(value) {
601
+ this.setMetaProperty('classes', value);
602
+ }
603
+
604
+ /** Human-readable title. */
605
+ get title() {
606
+ return this.getMetaProperty('title', '');
607
+ }
608
+ set title(value) {
609
+ this.setMetaProperty('title', value);
610
+ }
611
+
612
+ /** Human-readable description. */
613
+ get description() {
614
+ return this.getMetaProperty('description', '');
615
+ }
616
+ set description(value) {
617
+ this.setMetaProperty('description', value);
618
+ }
619
+
620
+ /** Hyperlinks associated with this element. */
621
+ get links() {
622
+ return this.getMetaProperty('links', []);
623
+ }
624
+ set links(value) {
625
+ this.setMetaProperty('links', value);
626
+ }
627
+
628
+ // ============================================================
629
+ // Tree Navigation
630
+ // ============================================================
631
+
632
+ /** Returns direct children of this element. */
633
+ get children() {
634
+ const {
635
+ _content: content
636
+ } = this;
637
+ if (Array.isArray(content)) {
638
+ return content;
639
+ }
640
+ if (content instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
641
+ const children = [];
642
+ if (content.key) children.push(content.key);
643
+ if (content.value) children.push(content.value);
644
+ return children;
645
+ }
646
+ if (content instanceof Element) {
647
+ return [content];
648
+ }
649
+ return [];
650
+ }
651
+
652
+ // ============================================================
653
+ // Freezable Implementation
654
+ // ============================================================
655
+
656
+ /** Whether this element is frozen (immutable). */
657
+ get isFrozen() {
658
+ return Object.isFrozen(this);
659
+ }
660
+
661
+ /**
662
+ * Freezes the element tree, making it immutable.
663
+ * Sets up parent references for tree traversal.
664
+ */
665
+ freeze() {
666
+ if (this.isFrozen) return;
667
+
668
+ // Freeze meta and attributes
669
+ if (this._meta) {
670
+ this._meta.parent = this;
671
+ this._meta.freeze();
672
+ }
673
+ if (this._attributes) {
674
+ this._attributes.parent = this;
675
+ this._attributes.freeze();
676
+ }
677
+
678
+ // Freeze children
679
+ for (const child of this.children) {
680
+ child.parent = this;
681
+ child.freeze();
682
+ }
683
+
684
+ // Freeze content array if applicable
685
+ if (Array.isArray(this._content)) {
686
+ Object.freeze(this._content);
687
+ }
688
+ Object.freeze(this);
689
+ }
690
+
691
+ // ============================================================
692
+ // Cloneable Implementation
693
+ // ============================================================
694
+
695
+ /**
696
+ * Creates a deep clone of this element.
697
+ */
698
+ clone() {
699
+ const Ctor = this.constructor;
700
+ const copy = new Ctor();
701
+ copy.element = this.element;
702
+ if (this._meta) {
703
+ copy._meta = this._meta.clone();
704
+ }
705
+ if (this._attributes) {
706
+ copy._attributes = this._attributes.clone();
707
+ }
708
+
709
+ // Clone content based on its type
710
+ const {
711
+ _content
712
+ } = this;
713
+ if (_content instanceof Element) {
714
+ copy._content = _content.clone();
715
+ } else if (_content instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
716
+ copy._content = _content.clone();
717
+ } else if (Array.isArray(_content)) {
718
+ copy._content = _content.map(el => el.clone());
719
+ } else {
720
+ // Primitives are immutable, assign as-is
721
+ copy._content = _content;
722
+ }
723
+ return copy;
724
+ }
725
+
726
+ // ============================================================
727
+ // ToValue Implementation
728
+ // ============================================================
729
+
730
+ /**
731
+ * Converts the element to its JavaScript value representation.
732
+ */
733
+ toValue() {
734
+ const {
735
+ _content
736
+ } = this;
737
+ if (_content instanceof Element) {
738
+ return _content.toValue();
739
+ }
740
+ if (_content instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
741
+ return _content.toValue();
742
+ }
743
+ if (Array.isArray(_content)) {
744
+ return _content.map(el => el.toValue());
745
+ }
746
+ return _content;
747
+ }
748
+
749
+ // ============================================================
750
+ // Equatable Implementation
751
+ // ============================================================
752
+
753
+ /**
754
+ * Checks deep equality with another value.
755
+ */
756
+ equals(value) {
757
+ return (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(this.toValue(), value);
758
+ }
759
+
760
+ // ============================================================
761
+ // Element Type
762
+ // ============================================================
763
+
764
+ /**
765
+ * Returns the primitive type name for this element.
766
+ * Override in subclasses (e.g., 'string', 'number', 'array').
767
+ */
768
+ primitive() {
769
+ return undefined;
770
+ }
771
+
772
+ // ============================================================
773
+ // Content Operations
774
+ // ============================================================
775
+
776
+ /**
777
+ * Sets the content of this element.
778
+ * @returns this for chaining
779
+ */
780
+ set(content) {
781
+ this.content = content;
782
+ return this;
783
+ }
784
+
785
+ // ============================================================
786
+ // Reference Creation
787
+ // ============================================================
788
+
789
+ /**
790
+ * Creates a RefElement pointing to this element.
791
+ * @param path - Optional path within the referenced element
792
+ * @throws Error if this element has no ID
793
+ */
794
+ toRef(path) {
795
+ const idValue = this.id.toValue();
796
+ if (idValue === '') {
797
+ throw new Error('Cannot create reference to an element without an ID');
798
+ }
799
+ const ref = new this.RefElement(idValue);
800
+ if (typeof path === 'string') {
801
+ ref.path = this.refract(path);
802
+ }
803
+ return ref;
804
+ }
805
+
806
+ // ============================================================
807
+ // Protected Helpers
808
+ // ============================================================
809
+
810
+ /**
811
+ * Gets a meta property, creating it with default value if not present.
812
+ */
813
+ getMetaProperty(name, defaultValue) {
814
+ if (!this.meta.hasKey(name)) {
815
+ if (this.isFrozen) {
816
+ const element = this.refract(defaultValue);
817
+ element.freeze();
818
+ return element;
819
+ }
820
+ this.meta.set(name, defaultValue);
821
+ }
822
+ return this.meta.get(name);
823
+ }
824
+
825
+ /**
826
+ * Sets a meta property.
827
+ */
828
+ setMetaProperty(name, value) {
829
+ this.meta.set(name, value);
830
+ }
831
+ }
832
+
833
+ // Re-export types for convenience
834
+
835
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Element);
836
+
837
+ /***/ }),
838
+
839
+ /***/ 377:
840
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
841
+
842
+ __webpack_require__.r(__webpack_exports__);
843
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
844
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
845
+ /* harmony export */ });
846
+ /* harmony import */ var _Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
847
+
848
+
849
+ /**
850
+ * NullElement represents a null value in ApiDOM.
851
+ * @public
852
+ */
853
+ class NullElement extends _Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
854
+ constructor(content, meta, attributes) {
855
+ super(content ?? null, meta, attributes);
856
+ this.element = 'null';
857
+ }
858
+ primitive() {
859
+ return 'null';
860
+ }
861
+
862
+ /**
863
+ * NullElement cannot have its value changed.
864
+ * @throws Error - NullElement value cannot be modified
865
+ */
866
+ set(_content) {
867
+ throw new Error('Cannot set the value of null');
868
+ }
869
+ }
870
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NullElement);
871
+
872
+ /***/ }),
873
+
874
+ /***/ 415:
875
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
876
+
877
+ __webpack_require__.r(__webpack_exports__);
878
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
879
+ /* harmony export */ "default": () => (/* binding */ _functionName)
880
+ /* harmony export */ });
881
+ function _functionName(f) {
882
+ // String(x => x) evaluates to "x => x", so the pattern may not match.
883
+ var match = String(f).match(/^function (\w*)/);
884
+ return match == null ? '' : match[1];
885
+ }
886
+
887
+ /***/ }),
888
+
889
+ /***/ 474:
890
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
891
+
892
+ __webpack_require__.r(__webpack_exports__);
893
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
894
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
895
+ /* harmony export */ });
896
+ /* harmony import */ var _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
897
+
898
+
899
+ /**
900
+ * RefElement represents a reference to another element in ApiDOM.
901
+ * @public
902
+ */
903
+ class RefElement extends _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
904
+ constructor(content, meta, attributes) {
905
+ super(content || [], meta, attributes);
906
+ this.element = 'ref';
907
+ if (!this.path) {
908
+ this.path = 'element';
909
+ }
910
+ }
911
+
912
+ /**
913
+ * Path of referenced element to transclude instead of element itself.
914
+ * @defaultValue 'element'
915
+ */
916
+ get path() {
917
+ return this.attributes.get('path');
918
+ }
919
+ set path(newValue) {
920
+ this.attributes.set('path', newValue);
921
+ }
922
+ }
923
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RefElement);
924
+
925
+ /***/ }),
926
+
927
+ /***/ 492:
928
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
929
+
930
+ __webpack_require__.r(__webpack_exports__);
931
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
932
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
933
+ /* harmony export */ });
934
+ /* harmony import */ var _Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
935
+
936
+
937
+ /**
938
+ * BooleanElement represents a boolean value in ApiDOM.
939
+ * @public
940
+ */
941
+ class BooleanElement extends _Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
942
+ constructor(content, meta, attributes) {
943
+ super(content, meta, attributes);
944
+ this.element = 'boolean';
945
+ }
946
+ primitive() {
947
+ return 'boolean';
948
+ }
949
+ }
950
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BooleanElement);
951
+
952
+ /***/ }),
953
+
954
+ /***/ 497:
955
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
956
+
957
+ __webpack_require__.r(__webpack_exports__);
958
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
959
+ /* harmony export */ "default": () => (/* binding */ _equals)
960
+ /* harmony export */ });
961
+ /* harmony import */ var _arrayFromIterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(941);
962
+ /* harmony import */ var _includesWith_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(333);
963
+ /* harmony import */ var _functionName_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(415);
964
+ /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(722);
965
+ /* harmony import */ var _objectIs_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(111);
966
+ /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(783);
967
+ /* harmony import */ var _type_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(963);
968
+
969
+
970
+
971
+
972
+
973
+
974
+
975
+
976
+ /**
977
+ * private _uniqContentEquals function.
978
+ * That function is checking equality of 2 iterator contents with 2 assumptions
979
+ * - iterators lengths are the same
980
+ * - iterators values are unique
981
+ *
982
+ * false-positive result will be returned for comparison of, e.g.
983
+ * - [1,2,3] and [1,2,3,4]
984
+ * - [1,1,1] and [1,2,3]
985
+ * */
986
+
987
+ function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {
988
+ var a = (0,_arrayFromIterator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(aIterator);
989
+ var b = (0,_arrayFromIterator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(bIterator);
990
+ function eq(_a, _b) {
991
+ return _equals(_a, _b, stackA.slice(), stackB.slice());
992
+ }
993
+
994
+ // if *a* array contains any element that is not included in *b*
995
+ return !(0,_includesWith_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function (b, aItem) {
996
+ return !(0,_includesWith_js__WEBPACK_IMPORTED_MODULE_1__["default"])(eq, aItem, b);
997
+ }, b, a);
998
+ }
999
+ function _equals(a, b, stackA, stackB) {
1000
+ if ((0,_objectIs_js__WEBPACK_IMPORTED_MODULE_4__["default"])(a, b)) {
1001
+ return true;
1002
+ }
1003
+ var typeA = (0,_type_js__WEBPACK_IMPORTED_MODULE_6__["default"])(a);
1004
+ if (typeA !== (0,_type_js__WEBPACK_IMPORTED_MODULE_6__["default"])(b)) {
1005
+ return false;
1006
+ }
1007
+ if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {
1008
+ return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);
1009
+ }
1010
+ if (typeof a.equals === 'function' || typeof b.equals === 'function') {
1011
+ return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);
1012
+ }
1013
+ switch (typeA) {
1014
+ case 'Arguments':
1015
+ case 'Array':
1016
+ case 'Object':
1017
+ if (typeof a.constructor === 'function' && (0,_functionName_js__WEBPACK_IMPORTED_MODULE_2__["default"])(a.constructor) === 'Promise') {
1018
+ return a === b;
1019
+ }
1020
+ break;
1021
+ case 'Boolean':
1022
+ case 'Number':
1023
+ case 'String':
1024
+ if (!(typeof a === typeof b && (0,_objectIs_js__WEBPACK_IMPORTED_MODULE_4__["default"])(a.valueOf(), b.valueOf()))) {
1025
+ return false;
1026
+ }
1027
+ break;
1028
+ case 'Date':
1029
+ if (!(0,_objectIs_js__WEBPACK_IMPORTED_MODULE_4__["default"])(a.valueOf(), b.valueOf())) {
1030
+ return false;
1031
+ }
1032
+ break;
1033
+ case 'Error':
1034
+ return a.name === b.name && a.message === b.message;
1035
+ case 'RegExp':
1036
+ if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {
1037
+ return false;
1038
+ }
1039
+ break;
1040
+ }
1041
+ var idx = stackA.length - 1;
1042
+ while (idx >= 0) {
1043
+ if (stackA[idx] === a) {
1044
+ return stackB[idx] === b;
1045
+ }
1046
+ idx -= 1;
1047
+ }
1048
+ switch (typeA) {
1049
+ case 'Map':
1050
+ if (a.size !== b.size) {
1051
+ return false;
1052
+ }
1053
+ return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));
1054
+ case 'Set':
1055
+ if (a.size !== b.size) {
1056
+ return false;
1057
+ }
1058
+ return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));
1059
+ case 'Arguments':
1060
+ case 'Array':
1061
+ case 'Object':
1062
+ case 'Boolean':
1063
+ case 'Number':
1064
+ case 'String':
1065
+ case 'Date':
1066
+ case 'Error':
1067
+ case 'RegExp':
1068
+ case 'Int8Array':
1069
+ case 'Uint8Array':
1070
+ case 'Uint8ClampedArray':
1071
+ case 'Int16Array':
1072
+ case 'Uint16Array':
1073
+ case 'Int32Array':
1074
+ case 'Uint32Array':
1075
+ case 'Float32Array':
1076
+ case 'Float64Array':
1077
+ case 'ArrayBuffer':
1078
+ break;
1079
+ default:
1080
+ // Values of other types are only equal if identical.
1081
+ return false;
1082
+ }
1083
+ var keysA = (0,_keys_js__WEBPACK_IMPORTED_MODULE_5__["default"])(a);
1084
+ if (keysA.length !== (0,_keys_js__WEBPACK_IMPORTED_MODULE_5__["default"])(b).length) {
1085
+ return false;
1086
+ }
1087
+ var extendedStackA = stackA.concat([a]);
1088
+ var extendedStackB = stackB.concat([b]);
1089
+ idx = keysA.length - 1;
1090
+ while (idx >= 0) {
1091
+ var key = keysA[idx];
1092
+ if (!((0,_has_js__WEBPACK_IMPORTED_MODULE_3__["default"])(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {
1093
+ return false;
1094
+ }
1095
+ idx -= 1;
1096
+ }
1097
+ return true;
1098
+ }
1099
+
1100
+ /***/ }),
1101
+
1102
+ /***/ 576:
1103
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1104
+
1105
+ __webpack_require__.r(__webpack_exports__);
1106
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1107
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1108
+ /* harmony export */ });
1109
+ /* harmony import */ var _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
1110
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(370);
1111
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(377);
1112
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(805);
1113
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(933);
1114
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(492);
1115
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(603);
1116
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(136);
1117
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(975);
1118
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(885);
1119
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(474);
1120
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(807);
1121
+
1122
+
1123
+ const isNull = value => value === null;
1124
+ const isString = value => typeof value === 'string';
1125
+ const isNumber = value => typeof value === 'number';
1126
+ const isBoolean = value => typeof value === 'boolean';
1127
+ const isObject = value => value !== null && typeof value === 'object';
1128
+
1129
+ /**
1130
+ * Constructor type for Element classes.
1131
+ * @public
1132
+ */
1133
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1134
+
1135
+ /**
1136
+ * Function to test if a value should be converted to a specific element type.
1137
+ * @public
1138
+ */
1139
+
1140
+ /**
1141
+ * Tuple of detection test and element class.
1142
+ * @public
1143
+ */
1144
+
1145
+ /**
1146
+ * Options for Namespace constructor.
1147
+ * @public
1148
+ */
1149
+
1150
+ /**
1151
+ * Plugin interface for extending Namespace.
1152
+ * @public
1153
+ */
1154
+
1155
+ /**
1156
+ * Map of registered element classes.
1157
+ * @public
1158
+ */
1159
+
1160
+ /**
1161
+ * A refract element implementation with an extensible namespace, able to
1162
+ * load other namespaces into it.
1163
+ *
1164
+ * The namespace allows you to register your own classes to be instantiated
1165
+ * when a particular refract element is encountered, and allows you to specify
1166
+ * which elements get instantiated for existing JavaScript objects.
1167
+ *
1168
+ * @public
1169
+ */
1170
+ class Namespace {
1171
+ elementMap = {};
1172
+ elementDetection = [];
1173
+ Element;
1174
+ KeyValuePair;
1175
+ _elements;
1176
+ _attributeElementKeys = [];
1177
+ _attributeElementArrayKeys = [];
1178
+ constructor(options) {
1179
+ this.Element = _registration_ts__WEBPACK_IMPORTED_MODULE_1__["default"];
1180
+ this.KeyValuePair = _registration_ts__WEBPACK_IMPORTED_MODULE_11__["default"];
1181
+ if (!options || !options.noDefault) {
1182
+ this.useDefault();
1183
+ }
1184
+ }
1185
+
1186
+ /**
1187
+ * Use a namespace plugin or load a generic plugin.
1188
+ */
1189
+ use(plugin) {
1190
+ if (plugin.namespace) {
1191
+ plugin.namespace({
1192
+ base: this
1193
+ });
1194
+ }
1195
+ if (plugin.load) {
1196
+ plugin.load({
1197
+ base: this
1198
+ });
1199
+ }
1200
+ return this;
1201
+ }
1202
+
1203
+ /**
1204
+ * Use the default namespace. This preloads all the default elements
1205
+ * into this registry instance.
1206
+ */
1207
+ useDefault() {
1208
+ // Set up classes for default elements
1209
+ this.register('null', _registration_ts__WEBPACK_IMPORTED_MODULE_2__["default"]).register('string', _registration_ts__WEBPACK_IMPORTED_MODULE_3__["default"]).register('number', _registration_ts__WEBPACK_IMPORTED_MODULE_4__["default"]).register('boolean', _registration_ts__WEBPACK_IMPORTED_MODULE_5__["default"]).register('array', _registration_ts__WEBPACK_IMPORTED_MODULE_6__["default"]).register('object', _registration_ts__WEBPACK_IMPORTED_MODULE_8__["default"]).register('member', _registration_ts__WEBPACK_IMPORTED_MODULE_7__["default"]).register('ref', _registration_ts__WEBPACK_IMPORTED_MODULE_10__["default"]).register('link', _registration_ts__WEBPACK_IMPORTED_MODULE_9__["default"]);
1210
+
1211
+ // Add instance detection functions to convert existing objects into
1212
+ // the corresponding refract elements.
1213
+ this.detect(isNull, _registration_ts__WEBPACK_IMPORTED_MODULE_2__["default"], false).detect(isString, _registration_ts__WEBPACK_IMPORTED_MODULE_3__["default"], false).detect(isNumber, _registration_ts__WEBPACK_IMPORTED_MODULE_4__["default"], false).detect(isBoolean, _registration_ts__WEBPACK_IMPORTED_MODULE_5__["default"], false).detect(Array.isArray, _registration_ts__WEBPACK_IMPORTED_MODULE_6__["default"], false).detect(isObject, _registration_ts__WEBPACK_IMPORTED_MODULE_8__["default"], false);
1214
+ return this;
1215
+ }
1216
+
1217
+ /**
1218
+ * Register a new element class for an element.
1219
+ */
1220
+ register(name, ElementClass) {
1221
+ this._elements = undefined;
1222
+ this.elementMap[name] = ElementClass;
1223
+ return this;
1224
+ }
1225
+
1226
+ /**
1227
+ * Unregister a previously registered class for an element.
1228
+ */
1229
+ unregister(name) {
1230
+ this._elements = undefined;
1231
+ delete this.elementMap[name];
1232
+ return this;
1233
+ }
1234
+
1235
+ /**
1236
+ * Add a new detection function to determine which element
1237
+ * class to use when converting existing JS instances into
1238
+ * refract elements.
1239
+ */
1240
+ detect(test, ElementClass, givenPrepend) {
1241
+ const prepend = givenPrepend === undefined ? true : givenPrepend;
1242
+ if (prepend) {
1243
+ this.elementDetection.unshift([test, ElementClass]);
1244
+ } else {
1245
+ this.elementDetection.push([test, ElementClass]);
1246
+ }
1247
+ return this;
1248
+ }
1249
+
1250
+ /**
1251
+ * Convert an existing JavaScript object into refract element instances.
1252
+ * If the item passed in is already refracted, then it is returned unmodified.
1253
+ */
1254
+ toElement(value) {
1255
+ if (value instanceof this.Element) {
1256
+ return value;
1257
+ }
1258
+ let element;
1259
+ for (const [test, ElementClass] of this.elementDetection) {
1260
+ if (test(value)) {
1261
+ element = new ElementClass(value);
1262
+ break;
1263
+ }
1264
+ }
1265
+ return element;
1266
+ }
1267
+
1268
+ /**
1269
+ * Get an element class given an element name.
1270
+ */
1271
+ getElementClass(element) {
1272
+ const ElementClass = this.elementMap[element];
1273
+ if (ElementClass === undefined) {
1274
+ // Fall back to the base element. We may not know what
1275
+ // to do with the `content`, but downstream software
1276
+ // may know.
1277
+ return this.Element;
1278
+ }
1279
+ return ElementClass;
1280
+ }
1281
+
1282
+ /**
1283
+ * Convert a refract document into refract element instances.
1284
+ */
1285
+ fromRefract(doc) {
1286
+ return this.serialiser.deserialise(doc);
1287
+ }
1288
+
1289
+ /**
1290
+ * Convert an element to a Refracted JSON object.
1291
+ */
1292
+ toRefract(element) {
1293
+ return this.serialiser.serialise(element);
1294
+ }
1295
+
1296
+ /**
1297
+ * Get an object that contains all registered element classes, where
1298
+ * the key is the PascalCased element name and the value is the class.
1299
+ */
1300
+ get elements() {
1301
+ if (this._elements === undefined) {
1302
+ this._elements = {
1303
+ Element: this.Element
1304
+ };
1305
+ Object.keys(this.elementMap).forEach(name => {
1306
+ // Currently, all registered element types use a camelCaseName.
1307
+ // Converting to PascalCase is as simple as upper-casing the first letter.
1308
+ const pascal = name[0].toUpperCase() + name.substring(1);
1309
+ this._elements[pascal] = this.elementMap[name];
1310
+ });
1311
+ }
1312
+ return this._elements;
1313
+ }
1314
+
1315
+ /**
1316
+ * Convenience method for getting a JSON Serialiser configured with the
1317
+ * current namespace.
1318
+ */
1319
+ get serialiser() {
1320
+ return new _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_0__["default"](this);
1321
+ }
1322
+ }
1323
+
1324
+ // Set up the circular reference for JSONSerialiser
1325
+ _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.Namespace = Namespace;
1326
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Namespace);
1327
+
1328
+ /***/ }),
1329
+
1330
+ /***/ 590:
1331
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1332
+
1333
+ __webpack_require__.r(__webpack_exports__);
1334
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1335
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1336
+ /* harmony export */ });
1337
+ /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(722);
1338
+
1339
+ var toString = Object.prototype.toString;
1340
+ var _isArguments = /*#__PURE__*/function () {
1341
+ return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {
1342
+ return toString.call(x) === '[object Arguments]';
1343
+ } : function _isArguments(x) {
1344
+ return (0,_has_js__WEBPACK_IMPORTED_MODULE_0__["default"])('callee', x);
1345
+ };
1346
+ }();
1347
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_isArguments);
1348
+
1349
+ /***/ }),
1350
+
1351
+ /***/ 603:
1352
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1353
+
1354
+ __webpack_require__.r(__webpack_exports__);
1355
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1356
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1357
+ /* harmony export */ });
1358
+ /* harmony import */ var _CollectionElement_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(766);
1359
+
1360
+
1361
+ // Re-export types from CollectionElement
1362
+
1363
+ /**
1364
+ * ArrayElement represents an array/collection of elements in ApiDOM.
1365
+ *
1366
+ * @typeParam T - The element type contained in the array, defaults to Element
1367
+ * @public
1368
+ */
1369
+ class ArrayElement extends _CollectionElement_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
1370
+ // Static Fantasy Land methods
1371
+ static empty() {
1372
+ return new this();
1373
+ }
1374
+ static 'fantasy-land/empty'() {
1375
+ return ArrayElement.empty();
1376
+ }
1377
+ constructor(content, meta, attributes) {
1378
+ super(content || [], meta, attributes);
1379
+ this.element = 'array';
1380
+ }
1381
+ primitive() {
1382
+ return 'array';
1383
+ }
1384
+
1385
+ /**
1386
+ * Gets the element at the specified index.
1387
+ */
1388
+ get(index) {
1389
+ return this._content[index];
1390
+ }
1391
+
1392
+ /**
1393
+ * Helper for returning the value of an item.
1394
+ */
1395
+ getValue(index) {
1396
+ const item = this.get(index);
1397
+ if (item) {
1398
+ return item.toValue();
1399
+ }
1400
+ return undefined;
1401
+ }
1402
+
1403
+ /**
1404
+ * Sets the element at the specified index, or sets the content if called with one argument.
1405
+ */
1406
+ set(indexOrContent, value) {
1407
+ if (typeof indexOrContent === 'number' && value !== undefined) {
1408
+ this._content[indexOrContent] = this.refract(value);
1409
+ } else {
1410
+ // Delegate to parent set behavior
1411
+ this.content = indexOrContent;
1412
+ }
1413
+ return this;
1414
+ }
1415
+
1416
+ /**
1417
+ * Removes the element at the specified index.
1418
+ */
1419
+ remove(index) {
1420
+ return this._content.splice(index, 1)[0] ?? null;
1421
+ }
1422
+
1423
+ /**
1424
+ * Maps each element using the provided callback function.
1425
+ */
1426
+ map(callback, thisArg) {
1427
+ return this._content.map(callback, thisArg);
1428
+ }
1429
+
1430
+ /**
1431
+ * Maps and then flattens the results.
1432
+ */
1433
+ flatMap(callback, thisArg) {
1434
+ return this._content.flatMap(callback, thisArg);
1435
+ }
1436
+
1437
+ /**
1438
+ * Returns an array containing the truthy results of calling the given transformation.
1439
+ */
1440
+ compactMap(transform, thisArg) {
1441
+ const results = [];
1442
+ for (const element of this._content) {
1443
+ const result = transform.call(thisArg, element);
1444
+ if (result) {
1445
+ results.push(result);
1446
+ }
1447
+ }
1448
+ return results;
1449
+ }
1450
+
1451
+ /**
1452
+ * Filters elements using the provided callback.
1453
+ */
1454
+ filter(callback, thisArg) {
1455
+ const filtered = this._content.filter(callback, thisArg);
1456
+ return new this.constructor(filtered);
1457
+ }
1458
+
1459
+ /**
1460
+ * Rejects elements that match the provided callback.
1461
+ */
1462
+ reject(callback, thisArg) {
1463
+ const results = [];
1464
+ for (const element of this._content) {
1465
+ if (!callback.call(thisArg, element)) {
1466
+ results.push(element);
1467
+ }
1468
+ }
1469
+ return new this.constructor(results);
1470
+ }
1471
+
1472
+ /**
1473
+ * Reduces the array to a single value.
1474
+ * This is a reduce function specifically for datamodel arrays and objects.
1475
+ * It allows for returning normal values or datamodel instances.
1476
+ */
1477
+ reduce(callback, initialValue) {
1478
+ let startIndex;
1479
+ let memo;
1480
+
1481
+ // Allows for defining a starting value of the reduce
1482
+ if (initialValue !== undefined) {
1483
+ startIndex = 0;
1484
+ memo = this.refract(initialValue);
1485
+ } else {
1486
+ startIndex = 1;
1487
+ memo = this.first;
1488
+ }
1489
+
1490
+ // Sending each function call to the registry allows for passing datamodel
1491
+ // instances through the function return.
1492
+ for (let i = startIndex; i < this.length; i += 1) {
1493
+ const item = this._content[i];
1494
+ const result = callback(memo, item, i, this);
1495
+ memo = result === undefined ? result : this.refract(result);
1496
+ }
1497
+ return memo;
1498
+ }
1499
+
1500
+ /**
1501
+ * Executes a provided function once for each element.
1502
+ */
1503
+ forEach(callback, thisArg) {
1504
+ this._content.forEach((item, index) => {
1505
+ callback.call(thisArg, item, index);
1506
+ });
1507
+ }
1508
+
1509
+ // Fantasy Land
1510
+
1511
+ /**
1512
+ * Returns an empty array element.
1513
+ */
1514
+ empty() {
1515
+ return new this.constructor([]);
1516
+ }
1517
+ 'fantasy-land/map'(transform) {
1518
+ return new this.constructor(this.map(transform));
1519
+ }
1520
+ 'fantasy-land/chain'(transform) {
1521
+ return this.map(element => transform(element)).reduce((a, b) => a.concat(b), this.empty());
1522
+ }
1523
+ 'fantasy-land/filter'(callback) {
1524
+ return new this.constructor(this._content.filter(callback));
1525
+ }
1526
+ 'fantasy-land/reduce'(transform, initialValue) {
1527
+ return this._content.reduce(transform, initialValue);
1528
+ }
1529
+ }
1530
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ArrayElement);
1531
+
1532
+ /***/ }),
1533
+
1534
+ /***/ 654:
1535
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1536
+
1537
+ __webpack_require__.r(__webpack_exports__);
1538
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1539
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1540
+ /* harmony export */ });
1541
+ /* harmony import */ var _internal_curry2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(959);
1542
+ /* harmony import */ var _internal_equals_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(497);
1543
+
1544
+
1545
+
1546
+ /**
1547
+ * Returns `true` if its arguments are equivalent, `false` otherwise. Handles
1548
+ * cyclical data structures.
1549
+ *
1550
+ * Dispatches symmetrically to the `equals` methods of both arguments, if
1551
+ * present.
1552
+ *
1553
+ * @func
1554
+ * @memberOf R
1555
+ * @since v0.15.0
1556
+ * @category Relation
1557
+ * @sig a -> b -> Boolean
1558
+ * @param {*} a
1559
+ * @param {*} b
1560
+ * @return {Boolean}
1561
+ * @example
1562
+ *
1563
+ * R.equals(1, 1); //=> true
1564
+ * R.equals(1, '1'); //=> false
1565
+ * R.equals([1, 2, 3], [1, 2, 3]); //=> true
1566
+ *
1567
+ * const a = {}; a.v = a;
1568
+ * const b = {}; b.v = b;
1569
+ * R.equals(a, b); //=> true
1570
+ */
1571
+ var equals = /*#__PURE__*/(0,_internal_curry2_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function equals(a, b) {
1572
+ return (0,_internal_equals_js__WEBPACK_IMPORTED_MODULE_1__["default"])(a, b, [], []);
1573
+ });
1574
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (equals);
1575
+
1576
+ /***/ }),
1577
+
1578
+ /***/ 660:
1579
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1580
+
1581
+ __webpack_require__.r(__webpack_exports__);
1582
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1583
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1584
+ /* harmony export */ });
1585
+ /**
1586
+ * Callback type for ObjectSlice iteration methods.
1587
+ * Receives (value, key, member) - the standard pattern for object-like iteration.
1588
+ * @public
1589
+ */
1590
+
1591
+ /**
1592
+ * Callback type for ObjectSlice forEach that also receives the index.
1593
+ * @public
1594
+ */
1595
+
1596
+ /**
1597
+ * ObjectSlice is a collection wrapper for MemberElement arrays.
1598
+ * It provides functional methods with (value, key, member) callback signatures,
1599
+ * which is the standard pattern for iterating over object-like structures.
1600
+ *
1601
+ * Unlike ArraySlice, ObjectSlice uses composition rather than inheritance
1602
+ * because its callback signatures are fundamentally different.
1603
+ *
1604
+ * @public
1605
+ */
1606
+ class ObjectSlice {
1607
+ elements;
1608
+ constructor(elements) {
1609
+ this.elements = elements ?? [];
1610
+ }
1611
+
1612
+ /**
1613
+ * Converts all member elements to their JavaScript values.
1614
+ * Returns an array of \{ key, value \} objects.
1615
+ */
1616
+ toValue() {
1617
+ return this.elements.map(member => ({
1618
+ key: member.key?.toValue(),
1619
+ value: member.value?.toValue()
1620
+ }));
1621
+ }
1622
+
1623
+ /**
1624
+ * Maps over the member elements, calling callback with (value, key, member).
1625
+ * @param callback - Function to execute for each member
1626
+ * @param thisArg - Value to use as this when executing callback
1627
+ */
1628
+ map(callback, thisArg) {
1629
+ return this.elements.map(member => {
1630
+ const value = member.value;
1631
+ const key = member.key;
1632
+ if (value === undefined || key === undefined) {
1633
+ throw new Error('MemberElement must have both key and value');
1634
+ }
1635
+ return thisArg !== undefined ? callback.call(thisArg, value, key, member) : callback(value, key, member);
1636
+ });
1637
+ }
1638
+
1639
+ /**
1640
+ * Filters member elements using the provided callback.
1641
+ * @param callback - Function that receives (value, key, member) and returns boolean
1642
+ * @param thisArg - Value to use as this when executing callback
1643
+ */
1644
+ filter(callback, thisArg) {
1645
+ const filtered = this.elements.filter(member => {
1646
+ const value = member.value;
1647
+ const key = member.key;
1648
+ if (value === undefined || key === undefined) {
1649
+ return false; // Skip malformed members
1650
+ }
1651
+ return thisArg !== undefined ? callback.call(thisArg, value, key, member) : callback(value, key, member);
1652
+ });
1653
+ return new ObjectSlice(filtered);
1654
+ }
1655
+
1656
+ /**
1657
+ * Rejects member elements that match the provided callback.
1658
+ * @param callback - Function that receives (value, key, member) and returns boolean
1659
+ * @param thisArg - Value to use as this when executing callback
1660
+ */
1661
+ reject(callback, thisArg) {
1662
+ const results = [];
1663
+ for (const member of this.elements) {
1664
+ const value = member.value;
1665
+ const key = member.key;
1666
+ if (value === undefined || key === undefined) {
1667
+ continue;
1668
+ }
1669
+ if (!callback.call(thisArg, value, key, member)) {
1670
+ results.push(member);
1671
+ }
1672
+ }
1673
+ return new ObjectSlice(results);
1674
+ }
1675
+
1676
+ /**
1677
+ * Executes a provided function once for each member element.
1678
+ * @param callback - Function that receives (value, key, member, index)
1679
+ * @param thisArg - Value to use as this when executing callback
1680
+ */
1681
+ forEach(callback, thisArg) {
1682
+ this.elements.forEach((member, index) => {
1683
+ const value = member.value;
1684
+ const key = member.key;
1685
+ if (value === undefined || key === undefined) {
1686
+ return; // Skip malformed members
1687
+ }
1688
+ if (thisArg !== undefined) {
1689
+ callback.call(thisArg, value, key, member, index);
1690
+ } else {
1691
+ callback(value, key, member, index);
1692
+ }
1693
+ });
1694
+ }
1695
+
1696
+ /**
1697
+ * Returns the first member element that satisfies the callback.
1698
+ * @param callback - Function that receives (value, key, member) and returns boolean
1699
+ * @param thisArg - Value to use as this when executing callback
1700
+ */
1701
+ find(callback, thisArg) {
1702
+ return this.elements.find(member => {
1703
+ const value = member.value;
1704
+ const key = member.key;
1705
+ if (value === undefined || key === undefined) {
1706
+ return false;
1707
+ }
1708
+ return thisArg !== undefined ? callback.call(thisArg, value, key, member) : callback(value, key, member);
1709
+ });
1710
+ }
1711
+
1712
+ /**
1713
+ * Returns an array of all keys' values.
1714
+ */
1715
+ keys() {
1716
+ return this.elements.map(member => member.key?.toValue()).filter(key => key !== undefined);
1717
+ }
1718
+
1719
+ /**
1720
+ * Returns an array of all values' values.
1721
+ */
1722
+ values() {
1723
+ return this.elements.map(member => member.value?.toValue()).filter(value => value !== undefined);
1724
+ }
1725
+
1726
+ /**
1727
+ * Returns the number of elements in the slice.
1728
+ */
1729
+ get length() {
1730
+ return this.elements.length;
1731
+ }
1732
+
1733
+ /**
1734
+ * Returns whether the slice is empty.
1735
+ */
1736
+ get isEmpty() {
1737
+ return this.length === 0;
1738
+ }
1739
+
1740
+ /**
1741
+ * Returns the first element in the slice or undefined if empty.
1742
+ */
1743
+ get first() {
1744
+ return this.elements[0];
1745
+ }
1746
+
1747
+ /**
1748
+ * Gets the element at the specified index.
1749
+ * @param index - The index of the element to get
1750
+ */
1751
+ get(index) {
1752
+ return this.elements[index];
1753
+ }
1754
+
1755
+ /**
1756
+ * Adds the given member element to the end of the slice.
1757
+ * @param member - The member element to add
1758
+ */
1759
+ push(member) {
1760
+ this.elements.push(member);
1761
+ return this;
1762
+ }
1763
+
1764
+ /**
1765
+ * Creates a deep clone of the ObjectSlice.
1766
+ */
1767
+ clone() {
1768
+ return new ObjectSlice(this.elements.map(element => element.clone()));
1769
+ }
1770
+
1771
+ /**
1772
+ * Determines whether the slice includes a member with the given key value.
1773
+ * @param keyValue - The key value to search for
1774
+ */
1775
+ includesKey(keyValue) {
1776
+ return this.elements.some(member => member.key?.equals(keyValue));
1777
+ }
1778
+
1779
+ /**
1780
+ * Iterator support - allows for...of loops.
1781
+ */
1782
+ [Symbol.iterator]() {
1783
+ return this.elements[Symbol.iterator]();
1784
+ }
1785
+ }
1786
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ObjectSlice);
1787
+
1788
+ /***/ }),
1789
+
1790
+ /***/ 722:
1791
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1792
+
1793
+ __webpack_require__.r(__webpack_exports__);
1794
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1795
+ /* harmony export */ "default": () => (/* binding */ _has)
1796
+ /* harmony export */ });
1797
+ function _has(prop, obj) {
1798
+ return Object.prototype.hasOwnProperty.call(obj, prop);
1799
+ }
1800
+
1801
+ /***/ }),
1802
+
1803
+ /***/ 766:
1804
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1805
+
1806
+ __webpack_require__.r(__webpack_exports__);
1807
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1808
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1809
+ /* harmony export */ });
1810
+ /* harmony import */ var _Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
1811
+
1812
+
1813
+ /**
1814
+ * Condition function for finding elements.
1815
+ * @public
1816
+ */
1817
+
1818
+ /**
1819
+ * Options for finding elements.
1820
+ * @public
1821
+ */
1822
+
1823
+ /**
1824
+ * CollectionElement is an abstract base class for collection-like elements.
1825
+ * Both ArrayElement and ObjectElement extend this class.
1826
+ *
1827
+ * This class contains the shared functionality between arrays and objects,
1828
+ * while keeping the conflicting methods (get, set, remove, map, filter, etc.)
1829
+ * in the respective subclasses.
1830
+ *
1831
+ * @remarks
1832
+ * This is primarily an implementation detail. Use ArrayElement or ObjectElement directly.
1833
+ *
1834
+ * @typeParam T - The element type contained in the collection, defaults to Element
1835
+ * @public
1836
+ */
1837
+ class CollectionElement extends _Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
1838
+ constructor(content, meta, attributes) {
1839
+ super(content || [], meta, attributes);
1840
+ }
1841
+
1842
+ /**
1843
+ * Returns the length of the collection.
1844
+ */
1845
+ get length() {
1846
+ return this._content.length;
1847
+ }
1848
+
1849
+ /**
1850
+ * Returns whether the collection is empty.
1851
+ */
1852
+ get isEmpty() {
1853
+ return this.length === 0;
1854
+ }
1855
+
1856
+ /**
1857
+ * Return the first item in the collection.
1858
+ */
1859
+ get first() {
1860
+ return this._content[0];
1861
+ }
1862
+
1863
+ /**
1864
+ * Return the second item in the collection.
1865
+ */
1866
+ get second() {
1867
+ return this._content[1];
1868
+ }
1869
+
1870
+ /**
1871
+ * Return the last item in the collection.
1872
+ */
1873
+ get last() {
1874
+ return this._content.at(-1);
1875
+ }
1876
+
1877
+ /**
1878
+ * Adds the given element to the end of the collection.
1879
+ */
1880
+ push(value) {
1881
+ this._content.push(this.refract(value));
1882
+ return this;
1883
+ }
1884
+
1885
+ /**
1886
+ * Alias for push.
1887
+ */
1888
+ add(value) {
1889
+ this.push(value);
1890
+ }
1891
+
1892
+ /**
1893
+ * Removes the first element from the collection.
1894
+ */
1895
+ shift() {
1896
+ return this._content.shift();
1897
+ }
1898
+
1899
+ /**
1900
+ * Adds the given element to the beginning of the collection.
1901
+ */
1902
+ unshift(value) {
1903
+ this._content.unshift(this.refract(value));
1904
+ }
1905
+
1906
+ /**
1907
+ * Looks for matching children using deep equality.
1908
+ */
1909
+ includes(value) {
1910
+ return this._content.some(element => element.equals(value));
1911
+ }
1912
+
1913
+ /**
1914
+ * Recursively search all descendants using a condition function.
1915
+ */
1916
+ findElements(condition, givenOptions) {
1917
+ const options = givenOptions || {};
1918
+ const recursive = !!options.recursive;
1919
+ const results = options.results === undefined ? [] : options.results;
1920
+ for (let i = 0; i < this._content.length; i += 1) {
1921
+ const item = this._content[i];
1922
+
1923
+ // We use duck-typing here to support any registered class that
1924
+ // may contain other elements.
1925
+
1926
+ const itemWithFindElements = item;
1927
+ if (recursive && typeof itemWithFindElements.findElements === 'function') {
1928
+ itemWithFindElements.findElements(condition, {
1929
+ results,
1930
+ recursive
1931
+ });
1932
+ }
1933
+ if (condition(item, i, undefined)) {
1934
+ results.push(item);
1935
+ }
1936
+ }
1937
+ return results;
1938
+ }
1939
+
1940
+ /**
1941
+ * Recursively search all descendants using a condition function.
1942
+ */
1943
+ find(condition) {
1944
+ const results = this.findElements(condition, {
1945
+ recursive: true
1946
+ });
1947
+ return new this.ArrayElement(results);
1948
+ }
1949
+
1950
+ /**
1951
+ * Find elements by their element type name.
1952
+ */
1953
+ findByElement(element) {
1954
+ return this.find(item => item.element === element);
1955
+ }
1956
+
1957
+ /**
1958
+ * Find elements by class name.
1959
+ */
1960
+ findByClass(className) {
1961
+ return this.find(item => {
1962
+ const classes = item.classes;
1963
+ return typeof classes.includes === 'function' && classes.includes(className);
1964
+ });
1965
+ }
1966
+
1967
+ /**
1968
+ * Search the tree recursively and find the element with the matching ID.
1969
+ */
1970
+ getById(id) {
1971
+ return this.find(item => item.id.toValue() === id).first;
1972
+ }
1973
+
1974
+ // Fantasy Land - Monoid
1975
+
1976
+ /**
1977
+ * Returns an empty collection element.
1978
+ */
1979
+
1980
+ 'fantasy-land/empty'() {
1981
+ return this.empty();
1982
+ }
1983
+
1984
+ /**
1985
+ * Concatenates two collection elements.
1986
+ */
1987
+ concat(other) {
1988
+ const Ctor = this.constructor;
1989
+ return new Ctor(this._content.concat(other._content));
1990
+ }
1991
+ 'fantasy-land/concat'(other) {
1992
+ return this.concat(other);
1993
+ }
1994
+
1995
+ // Iterator support
1996
+ [Symbol.iterator]() {
1997
+ return this._content[Symbol.iterator]();
1998
+ }
1999
+ }
2000
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CollectionElement);
2001
+
2002
+ /***/ }),
2003
+
2004
+ /***/ 783:
2005
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2006
+
2007
+ __webpack_require__.r(__webpack_exports__);
2008
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2009
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2010
+ /* harmony export */ });
2011
+ /* harmony import */ var _internal_curry1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(938);
2012
+ /* harmony import */ var _internal_has_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(722);
2013
+ /* harmony import */ var _internal_isArguments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(590);
2014
+
2015
+
2016
+
2017
+
2018
+ // cover IE < 9 keys issues
2019
+ var hasEnumBug = ! /*#__PURE__*/{
2020
+ toString: null
2021
+ }.propertyIsEnumerable('toString');
2022
+ var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
2023
+ // Safari bug
2024
+ var hasArgsEnumBug = /*#__PURE__*/function () {
2025
+ 'use strict';
2026
+
2027
+ return arguments.propertyIsEnumerable('length');
2028
+ }();
2029
+ var contains = function contains(list, item) {
2030
+ var idx = 0;
2031
+ while (idx < list.length) {
2032
+ if (list[idx] === item) {
2033
+ return true;
2034
+ }
2035
+ idx += 1;
2036
+ }
2037
+ return false;
2038
+ };
2039
+
2040
+ /**
2041
+ * Returns a list containing the names of all the enumerable own properties of
2042
+ * the supplied object.
2043
+ * Note that the order of the output array is not guaranteed to be consistent
2044
+ * across different JS platforms.
2045
+ *
2046
+ * @func
2047
+ * @memberOf R
2048
+ * @since v0.1.0
2049
+ * @category Object
2050
+ * @sig {k: v} -> [k]
2051
+ * @param {Object} obj The object to extract properties from
2052
+ * @return {Array} An array of the object's own properties.
2053
+ * @see R.keysIn, R.values, R.toPairs
2054
+ * @example
2055
+ *
2056
+ * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']
2057
+ */
2058
+ var keys = typeof Object.keys === 'function' && !hasArgsEnumBug ? /*#__PURE__*/(0,_internal_curry1_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function keys(obj) {
2059
+ return Object(obj) !== obj ? [] : Object.keys(obj);
2060
+ }) : /*#__PURE__*/(0,_internal_curry1_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function keys(obj) {
2061
+ if (Object(obj) !== obj) {
2062
+ return [];
2063
+ }
2064
+ var prop, nIdx;
2065
+ var ks = [];
2066
+ var checkArgsLength = hasArgsEnumBug && (0,_internal_isArguments_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj);
2067
+ for (prop in obj) {
2068
+ if ((0,_internal_has_js__WEBPACK_IMPORTED_MODULE_1__["default"])(prop, obj) && (!checkArgsLength || prop !== 'length')) {
2069
+ ks[ks.length] = prop;
2070
+ }
2071
+ }
2072
+ if (hasEnumBug) {
2073
+ nIdx = nonEnumerableProps.length - 1;
2074
+ while (nIdx >= 0) {
2075
+ prop = nonEnumerableProps[nIdx];
2076
+ if ((0,_internal_has_js__WEBPACK_IMPORTED_MODULE_1__["default"])(prop, obj) && !contains(ks, prop)) {
2077
+ ks[ks.length] = prop;
2078
+ }
2079
+ nIdx -= 1;
2080
+ }
2081
+ }
2082
+ return ks;
2083
+ });
2084
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (keys);
2085
+
2086
+ /***/ }),
2087
+
2088
+ /***/ 805:
2089
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2090
+
2091
+ __webpack_require__.r(__webpack_exports__);
2092
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2093
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2094
+ /* harmony export */ });
2095
+ /* harmony import */ var _Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
2096
+
2097
+
2098
+ /**
2099
+ * StringElement represents a string value in ApiDOM.
2100
+ * @public
2101
+ */
2102
+ class StringElement extends _Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
2103
+ constructor(content, meta, attributes) {
2104
+ super(content, meta, attributes);
2105
+ this.element = 'string';
2106
+ }
2107
+ primitive() {
2108
+ return 'string';
2109
+ }
2110
+
2111
+ /**
2112
+ * The length of the string.
2113
+ */
2114
+ get length() {
2115
+ return this.content?.length ?? 0;
2116
+ }
2117
+ }
2118
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StringElement);
2119
+
2120
+ /***/ }),
2121
+
2122
+ /***/ 807:
2123
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2124
+
2125
+ __webpack_require__.r(__webpack_exports__);
2126
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2127
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2128
+ /* harmony export */ });
2129
+ /**
2130
+ * Represents a key-value pair used in MemberElement content.
2131
+ * This is used internally to store object member data.
2132
+ *
2133
+ * @typeParam K - Key element type
2134
+ * @typeParam V - Value element type
2135
+ * @public
2136
+ */
2137
+ class KeyValuePair {
2138
+ key;
2139
+ value;
2140
+ constructor(key, value) {
2141
+ this.key = key;
2142
+ this.value = value;
2143
+ }
2144
+
2145
+ /**
2146
+ * Creates a deep clone of the KeyValuePair.
2147
+ */
2148
+ clone() {
2149
+ return new KeyValuePair(this.key?.clone(), this.value?.clone());
2150
+ }
2151
+
2152
+ /**
2153
+ * Converts to a plain JavaScript object representation.
2154
+ */
2155
+ toValue() {
2156
+ return {
2157
+ key: this.key?.toValue(),
2158
+ value: this.value?.toValue()
2159
+ };
2160
+ }
2161
+ }
2162
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (KeyValuePair);
2163
+
2164
+ /***/ }),
2165
+
2166
+ /***/ 885:
2167
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2168
+
2169
+ __webpack_require__.r(__webpack_exports__);
2170
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2171
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2172
+ /* harmony export */ });
2173
+ /* harmony import */ var _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
2174
+
2175
+
2176
+ /**
2177
+ * LinkElement represents a hyperlink in ApiDOM.
2178
+ *
2179
+ * Hyperlinking MAY be used to link to other resources, provide links to
2180
+ * instructions on how to process a given element (by way of a profile or
2181
+ * other means), and may be used to provide meta data about the element in
2182
+ * which it's found. The meaning and purpose of the hyperlink is defined by
2183
+ * the link relation according to RFC 5988.
2184
+ *
2185
+ * @public
2186
+ */
2187
+ class LinkElement extends _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
2188
+ constructor(content, meta, attributes) {
2189
+ super(content || [], meta, attributes);
2190
+ this.element = 'link';
2191
+ }
2192
+
2193
+ /**
2194
+ * The relation identifier for the link, as defined in RFC 5988.
2195
+ */
2196
+ get relation() {
2197
+ return this.attributes.get('relation');
2198
+ }
2199
+ set relation(relation) {
2200
+ this.attributes.set('relation', relation);
2201
+ }
2202
+
2203
+ /**
2204
+ * The URI for the given link.
2205
+ */
2206
+ get href() {
2207
+ return this.attributes.get('href');
2208
+ }
2209
+ set href(href) {
2210
+ this.attributes.set('href', href);
2211
+ }
2212
+ }
2213
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LinkElement);
2214
+
2215
+ /***/ }),
2216
+
2217
+ /***/ 933:
2218
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2219
+
2220
+ __webpack_require__.r(__webpack_exports__);
2221
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2222
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2223
+ /* harmony export */ });
2224
+ /* harmony import */ var _Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
2225
+
2226
+
2227
+ /**
2228
+ * NumberElement represents a numeric value in ApiDOM.
2229
+ * @public
2230
+ */
2231
+ class NumberElement extends _Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
2232
+ constructor(content, meta, attributes) {
2233
+ super(content, meta, attributes);
2234
+ this.element = 'number';
2235
+ }
2236
+ primitive() {
2237
+ return 'number';
2238
+ }
2239
+ }
2240
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NumberElement);
2241
+
2242
+ /***/ }),
2243
+
2244
+ /***/ 938:
2245
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2246
+
2247
+ __webpack_require__.r(__webpack_exports__);
2248
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2249
+ /* harmony export */ "default": () => (/* binding */ _curry1)
2250
+ /* harmony export */ });
2251
+ /* harmony import */ var _isPlaceholder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
2252
+
2253
+
2254
+ /**
2255
+ * Optimized internal one-arity curry function.
2256
+ *
2257
+ * @private
2258
+ * @category Function
2259
+ * @param {Function} fn The function to curry.
2260
+ * @return {Function} The curried function.
2261
+ */
2262
+ function _curry1(fn) {
2263
+ return function f1(a) {
2264
+ if (arguments.length === 0 || (0,_isPlaceholder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a)) {
2265
+ return f1;
2266
+ } else {
2267
+ return fn.apply(this, arguments);
2268
+ }
2269
+ };
2270
+ }
2271
+
2272
+ /***/ }),
2273
+
2274
+ /***/ 941:
2275
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2276
+
2277
+ __webpack_require__.r(__webpack_exports__);
2278
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2279
+ /* harmony export */ "default": () => (/* binding */ _arrayFromIterator)
2280
+ /* harmony export */ });
2281
+ function _arrayFromIterator(iter) {
2282
+ var list = [];
2283
+ var next;
2284
+ while (!(next = iter.next()).done) {
2285
+ list.push(next.value);
2286
+ }
2287
+ return list;
2288
+ }
2289
+
2290
+ /***/ }),
2291
+
2292
+ /***/ 959:
2293
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2294
+
2295
+ __webpack_require__.r(__webpack_exports__);
2296
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2297
+ /* harmony export */ "default": () => (/* binding */ _curry2)
2298
+ /* harmony export */ });
2299
+ /* harmony import */ var _curry1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(938);
2300
+ /* harmony import */ var _isPlaceholder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
2301
+
2302
+
2303
+
2304
+ /**
2305
+ * Optimized internal two-arity curry function.
2306
+ *
2307
+ * @private
2308
+ * @category Function
2309
+ * @param {Function} fn The function to curry.
2310
+ * @return {Function} The curried function.
2311
+ */
2312
+ function _curry2(fn) {
2313
+ return function f2(a, b) {
2314
+ switch (arguments.length) {
2315
+ case 0:
2316
+ return f2;
2317
+ case 1:
2318
+ return (0,_isPlaceholder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(a) ? f2 : (0,_curry1_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function (_b) {
2319
+ return fn(a, _b);
2320
+ });
2321
+ default:
2322
+ return (0,_isPlaceholder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(a) && (0,_isPlaceholder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(b) ? f2 : (0,_isPlaceholder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(a) ? (0,_curry1_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function (_a) {
2323
+ return fn(_a, b);
2324
+ }) : (0,_isPlaceholder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(b) ? (0,_curry1_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function (_b) {
2325
+ return fn(a, _b);
2326
+ }) : fn(a, b);
2327
+ }
2328
+ };
2329
+ }
2330
+
2331
+ /***/ }),
2332
+
2333
+ /***/ 963:
2334
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2335
+
2336
+ __webpack_require__.r(__webpack_exports__);
2337
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2338
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2339
+ /* harmony export */ });
2340
+ /* harmony import */ var _internal_curry1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(938);
2341
+
2342
+
2343
+ /**
2344
+ * Gives a single-word string description of the (native) type of a value,
2345
+ * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not
2346
+ * attempt to distinguish user Object types any further, reporting them all as
2347
+ * 'Object'.
2348
+ *
2349
+ * @func
2350
+ * @memberOf R
2351
+ * @since v0.8.0
2352
+ * @category Type
2353
+ * @sig * -> String
2354
+ * @param {*} val The value to test
2355
+ * @return {String}
2356
+ * @example
2357
+ *
2358
+ * R.type({}); //=> "Object"
2359
+ * R.type(new Map); //=> "Map"
2360
+ * R.type(new Set); //=> "Set"
2361
+ * R.type(1); //=> "Number"
2362
+ * R.type(false); //=> "Boolean"
2363
+ * R.type('s'); //=> "String"
2364
+ * R.type(null); //=> "Null"
2365
+ * R.type([]); //=> "Array"
2366
+ * R.type(/[A-z]/); //=> "RegExp"
2367
+ * R.type(() => {}); //=> "Function"
2368
+ * R.type(async () => {}); //=> "AsyncFunction"
2369
+ * R.type(undefined); //=> "Undefined"
2370
+ * R.type(BigInt(123)); //=> "BigInt"
2371
+ */
2372
+ var type = /*#__PURE__*/(0,_internal_curry1_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function type(val) {
2373
+ return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);
2374
+ });
2375
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (type);
2376
+
2377
+ /***/ }),
2378
+
2379
+ /***/ 975:
2380
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2381
+
2382
+ __webpack_require__.r(__webpack_exports__);
2383
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2384
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2385
+ /* harmony export */ });
2386
+ /* harmony import */ var _CollectionElement_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(766);
2387
+ /* harmony import */ var _MemberElement_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(136);
2388
+ /* harmony import */ var _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(660);
2389
+
2390
+
2391
+
2392
+
2393
+ /**
2394
+ * Callback type for ObjectElement iteration methods.
2395
+ * @public
2396
+ */
2397
+
2398
+ /**
2399
+ * ObjectElement represents an object/dictionary of key-value pairs in ApiDOM.
2400
+ *
2401
+ * @typeParam K - The key element type, defaults to Element
2402
+ * @typeParam V - The value element type, defaults to Element
2403
+ * @public
2404
+ */
2405
+ class ObjectElement extends _CollectionElement_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
2406
+ constructor(content, meta, attributes) {
2407
+ super(content || [], meta, attributes);
2408
+ this.element = 'object';
2409
+ }
2410
+ primitive() {
2411
+ return 'object';
2412
+ }
2413
+ toValue() {
2414
+ return this._content.reduce((results, el) => {
2415
+ results[el.key.toValue()] = el.value ? el.value.toValue() : undefined;
2416
+ return results;
2417
+ }, {});
2418
+ }
2419
+
2420
+ /**
2421
+ * Gets the value element for the given key.
2422
+ */
2423
+ get(name) {
2424
+ const member = this.getMember(name);
2425
+ if (member) {
2426
+ return member.value;
2427
+ }
2428
+ return undefined;
2429
+ }
2430
+
2431
+ /**
2432
+ * Helper for returning the value of an item by key.
2433
+ */
2434
+ getValue(name) {
2435
+ const item = this.get(name);
2436
+ if (item) {
2437
+ return item.toValue();
2438
+ }
2439
+ return undefined;
2440
+ }
2441
+
2442
+ /**
2443
+ * Gets the member element for the given key.
2444
+ */
2445
+ getMember(name) {
2446
+ if (name === undefined) {
2447
+ return undefined;
2448
+ }
2449
+ return this._content.find(element => element.key.toValue() === name);
2450
+ }
2451
+
2452
+ /**
2453
+ * Removes the member with the given key.
2454
+ */
2455
+ remove(name) {
2456
+ let removed = null;
2457
+ this.content = this._content.filter(item => {
2458
+ if (item.key.toValue() === name) {
2459
+ removed = item;
2460
+ return false;
2461
+ }
2462
+ return true;
2463
+ });
2464
+ return removed;
2465
+ }
2466
+
2467
+ /**
2468
+ * Gets the key element for the given key name.
2469
+ */
2470
+ getKey(name) {
2471
+ const member = this.getMember(name);
2472
+ if (member) {
2473
+ return member.key;
2474
+ }
2475
+ return undefined;
2476
+ }
2477
+
2478
+ /**
2479
+ * Set allows either a key/value pair to be given or an object.
2480
+ * If an object is given, each key is set to its respective value.
2481
+ */
2482
+ set(keyOrObject, value) {
2483
+ if (typeof keyOrObject === 'string') {
2484
+ const member = this.getMember(keyOrObject);
2485
+ if (member) {
2486
+ member.value = value;
2487
+ } else {
2488
+ this._content.push(new _MemberElement_ts__WEBPACK_IMPORTED_MODULE_1__["default"](keyOrObject, value));
2489
+ }
2490
+ } else if (typeof keyOrObject === 'object' && !Array.isArray(keyOrObject)) {
2491
+ for (const objectKey of Object.keys(keyOrObject)) {
2492
+ this.set(objectKey, keyOrObject[objectKey]);
2493
+ }
2494
+ }
2495
+ return this;
2496
+ }
2497
+
2498
+ /**
2499
+ * Returns an array of all keys' values.
2500
+ */
2501
+ keys() {
2502
+ return this._content.map(item => item.key.toValue());
2503
+ }
2504
+
2505
+ /**
2506
+ * Returns an array of all values' values.
2507
+ */
2508
+ values() {
2509
+ return this._content.map(item => item.value.toValue());
2510
+ }
2511
+
2512
+ /**
2513
+ * Returns whether the object has the given key.
2514
+ */
2515
+ hasKey(value) {
2516
+ return this._content.some(member => member.key.equals(value));
2517
+ }
2518
+
2519
+ /**
2520
+ * Returns an array of [key, value] pairs.
2521
+ */
2522
+ items() {
2523
+ return this._content.map(item => [item.key.toValue(), item.value.toValue()]);
2524
+ }
2525
+
2526
+ /**
2527
+ * Maps over the member elements, calling callback with (value, key, member).
2528
+ */
2529
+ map(callback, thisArg) {
2530
+ return this._content.map(item => callback.call(thisArg, item.value, item.key, item));
2531
+ }
2532
+
2533
+ /**
2534
+ * Returns an array containing the truthy results of calling the given transformation.
2535
+ */
2536
+ compactMap(callback, thisArg) {
2537
+ const results = [];
2538
+ this.forEach((value, key, member) => {
2539
+ const result = callback.call(thisArg, value, key, member);
2540
+ if (result) {
2541
+ results.push(result);
2542
+ }
2543
+ });
2544
+ return results;
2545
+ }
2546
+
2547
+ /**
2548
+ * Filters member elements using the provided callback.
2549
+ */
2550
+ filter(callback, thisArg) {
2551
+ return new _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_2__["default"](this._content).filter(callback, thisArg);
2552
+ }
2553
+
2554
+ /**
2555
+ * Rejects member elements that match the provided callback.
2556
+ */
2557
+ reject(callback, thisArg) {
2558
+ const results = [];
2559
+ for (const member of this._content) {
2560
+ if (!callback.call(thisArg, member.value, member.key, member)) {
2561
+ results.push(member);
2562
+ }
2563
+ }
2564
+ return new _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_2__["default"](results);
2565
+ }
2566
+
2567
+ /**
2568
+ * Executes a provided function once for each member element.
2569
+ */
2570
+ forEach(callback, thisArg) {
2571
+ this._content.forEach(item => callback.call(thisArg, item.value, item.key, item));
2572
+ }
2573
+
2574
+ /**
2575
+ * Reduces the object to a single value.
2576
+ * Callback receives (memo, value, key, member, obj).
2577
+ */
2578
+ reduce(callback, initialValue) {
2579
+ let startIndex;
2580
+ let memo;
2581
+ if (initialValue !== undefined) {
2582
+ startIndex = 0;
2583
+ memo = this.refract(initialValue);
2584
+ } else {
2585
+ startIndex = 1;
2586
+ // For objects, memo starts as the first member's value
2587
+ memo = this._content[0]?.value;
2588
+ }
2589
+ for (let i = startIndex; i < this._content.length; i += 1) {
2590
+ const member = this._content[i];
2591
+ const result = callback(memo, member.value, member.key, member, this);
2592
+ memo = result === undefined ? result : this.refract(result);
2593
+ }
2594
+ return memo;
2595
+ }
2596
+
2597
+ // Fantasy Land
2598
+
2599
+ /**
2600
+ * Returns an empty object element.
2601
+ */
2602
+ empty() {
2603
+ return new this.constructor([]);
2604
+ }
2605
+ }
2606
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ObjectElement);
2607
+
2608
+ /***/ })
2609
+
2610
+ /******/ });
2611
+ /************************************************************************/
2612
+ /******/ // The module cache
2613
+ /******/ var __webpack_module_cache__ = {};
2614
+ /******/
2615
+ /******/ // The require function
2616
+ /******/ function __webpack_require__(moduleId) {
2617
+ /******/ // Check if module is in cache
2618
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
2619
+ /******/ if (cachedModule !== undefined) {
2620
+ /******/ return cachedModule.exports;
2621
+ /******/ }
2622
+ /******/ // Create a new module (and put it into the cache)
2623
+ /******/ var module = __webpack_module_cache__[moduleId] = {
2624
+ /******/ // no module.id needed
2625
+ /******/ // no module.loaded needed
2626
+ /******/ exports: {}
2627
+ /******/ };
2628
+ /******/
2629
+ /******/ // Execute the module function
2630
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
2631
+ /******/
2632
+ /******/ // Return the exports of the module
2633
+ /******/ return module.exports;
2634
+ /******/ }
2635
+ /******/
2636
+ /************************************************************************/
2637
+ /******/ /* webpack/runtime/define property getters */
2638
+ /******/ (() => {
2639
+ /******/ // define getter functions for harmony exports
2640
+ /******/ __webpack_require__.d = (exports, definition) => {
2641
+ /******/ for(var key in definition) {
2642
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
2643
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
2644
+ /******/ }
2645
+ /******/ }
2646
+ /******/ };
2647
+ /******/ })();
2648
+ /******/
2649
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2650
+ /******/ (() => {
2651
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
2652
+ /******/ })();
2653
+ /******/
2654
+ /******/ /* webpack/runtime/make namespace object */
2655
+ /******/ (() => {
2656
+ /******/ // define __esModule on exports
2657
+ /******/ __webpack_require__.r = (exports) => {
2658
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2659
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2660
+ /******/ }
2661
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
2662
+ /******/ };
2663
+ /******/ })();
2664
+ /******/
2665
+ /************************************************************************/
2666
+ var __webpack_exports__ = {};
2667
+ __webpack_require__.r(__webpack_exports__);
2668
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2669
+ /* harmony export */ ArrayElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_8__["default"]),
2670
+ /* harmony export */ BooleanElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_7__["default"]),
2671
+ /* harmony export */ CollectionElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_3__["default"]),
2672
+ /* harmony export */ Element: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_2__["default"]),
2673
+ /* harmony export */ JSONSerialiser: () => (/* reexport safe */ _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_15__["default"]),
2674
+ /* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]),
2675
+ /* harmony export */ LinkElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_11__["default"]),
2676
+ /* harmony export */ MemberElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_9__["default"]),
2677
+ /* harmony export */ Namespace: () => (/* reexport safe */ _Namespace_ts__WEBPACK_IMPORTED_MODULE_0__["default"]),
2678
+ /* harmony export */ NullElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_4__["default"]),
2679
+ /* harmony export */ NumberElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_6__["default"]),
2680
+ /* harmony export */ ObjectElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_10__["default"]),
2681
+ /* harmony export */ ObjectSlice: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_13__["default"]),
2682
+ /* harmony export */ RefElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_12__["default"]),
2683
+ /* harmony export */ StringElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_5__["default"]),
2684
+ /* harmony export */ refract: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_14__.refract)
2685
+ /* harmony export */ });
2686
+ /* harmony import */ var _Namespace_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(576);
2687
+ /* harmony import */ var _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(807);
2688
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(370);
2689
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(766);
2690
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(377);
2691
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(805);
2692
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(933);
2693
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(492);
2694
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(603);
2695
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(136);
2696
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(975);
2697
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(885);
2698
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(474);
2699
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(660);
2700
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(18);
2701
+ /* harmony import */ var _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(27);
2702
+
2703
+
2704
+
2705
+ // Re-export elements directly to preserve JSDoc
2706
+
2707
+
2708
+
2709
+ // Re-export types - essential public API
2710
+
2711
+ // Re-export types - for advanced users extending the library
2712
+
2713
+ // Re-export types - used in public method signatures
2714
+ /******/ return __webpack_exports__;
2715
+ /******/ })()
2716
+ ;
2717
+ });