@speclynx/apidom-ns-openapi-2 5.0.1 → 5.1.0

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 (24) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/apidom-ns-openapi-2.browser.js +73 -40
  3. package/dist/apidom-ns-openapi-2.browser.min.js +1 -1
  4. package/package.json +8 -8
  5. package/src/refractor/plugins/normalize-parameters.cjs +16 -1
  6. package/src/refractor/plugins/normalize-parameters.mjs +17 -2
  7. package/src/refractor/plugins/replace-empty-element.cjs +1 -1
  8. package/src/refractor/plugins/replace-empty-element.mjs +1 -1
  9. package/src/refractor/visitors/Visitor.cjs +1 -1
  10. package/src/refractor/visitors/Visitor.mjs +1 -1
  11. package/src/refractor/visitors/open-api-2/ConsumesVisitor.cjs +1 -0
  12. package/src/refractor/visitors/open-api-2/ConsumesVisitor.mjs +1 -0
  13. package/src/refractor/visitors/open-api-2/ProducesVisitor.cjs +1 -0
  14. package/src/refractor/visitors/open-api-2/ProducesVisitor.mjs +1 -0
  15. package/src/refractor/visitors/open-api-2/SchemesVisitor.cjs +1 -0
  16. package/src/refractor/visitors/open-api-2/SchemesVisitor.mjs +1 -0
  17. package/src/refractor/visitors/open-api-2/operation/ConsumesVisitor.cjs +1 -0
  18. package/src/refractor/visitors/open-api-2/operation/ConsumesVisitor.mjs +1 -0
  19. package/src/refractor/visitors/open-api-2/operation/ProducesVisitor.cjs +1 -0
  20. package/src/refractor/visitors/open-api-2/operation/ProducesVisitor.mjs +1 -0
  21. package/src/refractor/visitors/open-api-2/operation/SchemesVisitor.cjs +1 -0
  22. package/src/refractor/visitors/open-api-2/operation/SchemesVisitor.mjs +1 -0
  23. package/src/refractor/visitors/open-api-2/operation/TagsVisitor.cjs +1 -0
  24. package/src/refractor/visitors/open-api-2/operation/TagsVisitor.mjs +1 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.1.0](https://github.com/speclynx/apidom/compare/v5.0.2...v5.1.0) (2026-08-09)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **ns:** transfer style in refractor visitors using the concat pattern ([#442](https://github.com/speclynx/apidom/issues/442)) ([dc483cc](https://github.com/speclynx/apidom/commit/dc483ccebb80877d96e1c62b34781a96dd96b403))
11
+
12
+ ### Features
13
+
14
+ - **datamodel:** support Metadata in cloneDeep and cloneShallow ([#443](https://github.com/speclynx/apidom/issues/443)) ([8e7e27a](https://github.com/speclynx/apidom/commit/8e7e27a7b01223bba13e54c9703a0c1da34a47d6)), closes [cloneDeep/#cloneShallow](https://github.com/speclynx/apidom/issues/cloneShallow)
15
+
16
+ ## [5.0.2](https://github.com/speclynx/apidom/compare/v5.0.1...v5.0.2) (2026-08-04)
17
+
18
+ **Note:** Version bump only for package @speclynx/apidom-ns-openapi-2
19
+
6
20
  ## [5.0.1](https://github.com/speclynx/apidom/compare/v5.0.0...v5.0.1) (2026-07-07)
7
21
 
8
22
  **Note:** Version bump only for package @speclynx/apidom-ns-openapi-2
@@ -2793,9 +2793,12 @@ __webpack_require__.r(__webpack_exports__);
2793
2793
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1942);
2794
2794
  /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4673);
2795
2795
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5162);
2796
- /* harmony import */ var _elements_nces_OperationParameters_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8748);
2797
- /* harmony import */ var _normalize_storage_index_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3313);
2798
- /* harmony import */ var _predicates_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7269);
2796
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2111);
2797
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5810);
2798
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9686);
2799
+ /* harmony import */ var _elements_nces_OperationParameters_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8748);
2800
+ /* harmony import */ var _normalize_storage_index_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3313);
2801
+ /* harmony import */ var _predicates_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7269);
2799
2802
 
2800
2803
 
2801
2804
 
@@ -2824,8 +2827,8 @@ __webpack_require__.r(__webpack_exports__);
2824
2827
  * {@link https://spec.openapis.org/oas/v2.0.html#path-item-object}
2825
2828
  */
2826
2829
  const parameterEquals = (parameter1, parameter2) => {
2827
- if (!(0,_predicates_ts__WEBPACK_IMPORTED_MODULE_5__.isParameterElement)(parameter1)) return false;
2828
- if (!(0,_predicates_ts__WEBPACK_IMPORTED_MODULE_5__.isParameterElement)(parameter2)) return false;
2830
+ if (!(0,_predicates_ts__WEBPACK_IMPORTED_MODULE_8__.isParameterElement)(parameter1)) return false;
2831
+ if (!(0,_predicates_ts__WEBPACK_IMPORTED_MODULE_8__.isParameterElement)(parameter2)) return false;
2829
2832
  if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(parameter1.name)) return false;
2830
2833
  if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(parameter1.in)) return false;
2831
2834
  if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(parameter2.name)) return false;
@@ -2846,7 +2849,22 @@ const inheritParametersToOperation = (operationElement, pathItemElement) => {
2846
2849
 
2847
2850
  // prefers the first item if two items compare equal based on the predicate
2848
2851
  const mergedParameters = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(parameterEquals, [...operationParams, ...pathItemParams]);
2849
- operationElement.parameters = new _elements_nces_OperationParameters_ts__WEBPACK_IMPORTED_MODULE_3__["default"](mergedParameters);
2852
+ const originalParameters = operationElement.parameters;
2853
+ const mergedElement = new _elements_nces_OperationParameters_ts__WEBPACK_IMPORTED_MODULE_6__["default"](mergedParameters);
2854
+
2855
+ // the merged container may replace an existing source container — carry over
2856
+ // its meta, attributes, source map and style
2857
+ if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isArrayElement)(originalParameters)) {
2858
+ if (!originalParameters.isMetaEmpty) {
2859
+ mergedElement.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneDeep)(originalParameters.meta);
2860
+ }
2861
+ if (!originalParameters.isAttributesEmpty) {
2862
+ mergedElement.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneDeep)(originalParameters.attributes);
2863
+ }
2864
+ _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"].transfer(originalParameters, mergedElement);
2865
+ _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(originalParameters, mergedElement);
2866
+ }
2867
+ operationElement.parameters = mergedElement;
2850
2868
  };
2851
2869
 
2852
2870
  /**
@@ -2864,7 +2882,7 @@ const plugin = ({
2864
2882
  SwaggerElement: {
2865
2883
  enter(path) {
2866
2884
  const element = path.node;
2867
- storage = new _normalize_storage_index_ts__WEBPACK_IMPORTED_MODULE_4__["default"](element, storageField, 'parameters');
2885
+ storage = new _normalize_storage_index_ts__WEBPACK_IMPORTED_MODULE_7__["default"](element, storageField, 'parameters');
2868
2886
  },
2869
2887
  leave() {
2870
2888
  storage = undefined;
@@ -3454,7 +3472,7 @@ const plugin = () => () => ({
3454
3472
  if (typeof elementFactory !== 'function') return;
3455
3473
  const replacement = elementFactory.call({
3456
3474
  context
3457
- }, undefined, element.isMetaEmpty ? undefined : element.meta.cloneDeep(), element.isAttributesEmpty ? undefined : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes));
3475
+ }, undefined, element.isMetaEmpty ? undefined : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.meta), element.isAttributesEmpty ? undefined : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes));
3458
3476
  _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(element, replacement);
3459
3477
  _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__["default"].transfer(element, replacement);
3460
3478
  path.replaceWith(replacement);
@@ -4264,7 +4282,7 @@ class SpecificationVisitor extends _Visitor_ts__WEBPACK_IMPORTED_MODULE_6__["def
4264
4282
  if (visitor instanceof _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_7__["default"]) {
4265
4283
  return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
4266
4284
  }
4267
- (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor);
4285
+ ;(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor);
4268
4286
  return visitor.element;
4269
4287
  }
4270
4288
  }
@@ -4305,7 +4323,7 @@ class Visitor {
4305
4323
  if (!from.isMetaEmpty && !to.isMetaEmpty) {
4306
4324
  to.meta = to.meta.merge(from.meta);
4307
4325
  } else if (!from.isMetaEmpty) {
4308
- to.meta = from.meta.cloneDeep();
4326
+ to.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.meta);
4309
4327
  }
4310
4328
  if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
4311
4329
  to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
@@ -4703,6 +4721,7 @@ class ConsumesVisitor extends _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_2__["
4703
4721
  ArrayElement(path) {
4704
4722
  const arrayElement = path.node;
4705
4723
  this.element = this.element.concat((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(arrayElement));
4724
+ this.copyMetaAndAttributes(arrayElement, this.element);
4706
4725
  path.stop();
4707
4726
  }
4708
4727
  }
@@ -4758,6 +4777,7 @@ class ProducesVisitor extends _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_2__["
4758
4777
  ArrayElement(path) {
4759
4778
  const arrayElement = path.node;
4760
4779
  this.element = this.element.concat((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(arrayElement));
4780
+ this.copyMetaAndAttributes(arrayElement, this.element);
4761
4781
  path.stop();
4762
4782
  }
4763
4783
  }
@@ -4790,6 +4810,7 @@ class SchemesVisitor extends _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_2__["d
4790
4810
  ArrayElement(path) {
4791
4811
  const arrayElement = path.node;
4792
4812
  this.element = this.element.concat((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(arrayElement));
4813
+ this.copyMetaAndAttributes(arrayElement, this.element);
4793
4814
  path.stop();
4794
4815
  }
4795
4816
  }
@@ -5343,6 +5364,7 @@ class ConsumesVisitor extends _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_2__["
5343
5364
  ArrayElement(path) {
5344
5365
  const arrayElement = path.node;
5345
5366
  this.element = this.element.concat((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(arrayElement));
5367
+ this.copyMetaAndAttributes(arrayElement, this.element);
5346
5368
  path.stop();
5347
5369
  }
5348
5370
  }
@@ -5417,6 +5439,7 @@ class ProducesVisitor extends _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_2__["
5417
5439
  ArrayElement(path) {
5418
5440
  const arrayElement = path.node;
5419
5441
  this.element = this.element.concat((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(arrayElement));
5442
+ this.copyMetaAndAttributes(arrayElement, this.element);
5420
5443
  path.stop();
5421
5444
  }
5422
5445
  }
@@ -5449,6 +5472,7 @@ class SchemesVisitor extends _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_2__["d
5449
5472
  ArrayElement(path) {
5450
5473
  const arrayElement = path.node;
5451
5474
  this.element = this.element.concat((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(arrayElement));
5475
+ this.copyMetaAndAttributes(arrayElement, this.element);
5452
5476
  path.stop();
5453
5477
  }
5454
5478
  }
@@ -5516,6 +5540,7 @@ class TagsVisitor extends _FallbackVisitor_ts__WEBPACK_IMPORTED_MODULE_2__["defa
5516
5540
  ArrayElement(path) {
5517
5541
  const arrayElement = path.node;
5518
5542
  this.element = this.element.concat((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(arrayElement));
5543
+ this.copyMetaAndAttributes(arrayElement, this.element);
5519
5544
  path.stop();
5520
5545
  }
5521
5546
  }
@@ -7134,7 +7159,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
7134
7159
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
7135
7160
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7136
7161
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
7137
-
7162
+ ;
7138
7163
 
7139
7164
  var _CompositeEvaluationRealm_brand = /*#__PURE__*/new WeakSet();
7140
7165
  class CompositeEvaluationRealm extends _EvaluationRealm_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
@@ -15971,7 +15996,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
15971
15996
  function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
15972
15997
  function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
15973
15998
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15974
-
15999
+ ;
15975
16000
 
15976
16001
  /**
15977
16002
  * Can be used as a way to compose multiple invokers together to form polymorphic functions,
@@ -22300,7 +22325,7 @@ __webpack_require__.r(__webpack_exports__);
22300
22325
  * @public
22301
22326
  */
22302
22327
  const emptyElement = element => {
22303
- const meta = !element.isMetaEmpty ? element.meta.cloneDeep() : undefined;
22328
+ const meta = !element.isMetaEmpty ? (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.meta) : undefined;
22304
22329
  const attributes = !element.isAttributesEmpty ? (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes) : undefined;
22305
22330
 
22306
22331
  // @ts-ignore
@@ -22316,7 +22341,7 @@ const getMergeFunction = (keyElement, options) => {
22316
22341
  };
22317
22342
  const getMetaMergeFunction = options => {
22318
22343
  if (typeof options.customMetaMerge !== 'function') {
22319
- return targetMeta => targetMeta.cloneDeep();
22344
+ return targetMeta => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(targetMeta);
22320
22345
  }
22321
22346
  return options.customMetaMerge;
22322
22347
  };
@@ -22391,9 +22416,9 @@ const deepmerge = (targetElement, sourceElement, options) => {
22391
22416
  if (!targetElement.isMetaEmpty && !sourceElement.isMetaEmpty) {
22392
22417
  mergedElement.meta = getMetaMergeFunction(mergedOptions)(targetElement.meta, sourceElement.meta);
22393
22418
  } else if (!targetElement.isMetaEmpty) {
22394
- mergedElement.meta = targetElement.meta.cloneDeep();
22419
+ mergedElement.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(targetElement.meta);
22395
22420
  } else if (!sourceElement.isMetaEmpty) {
22396
- mergedElement.meta = sourceElement.meta.cloneDeep();
22421
+ mergedElement.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(sourceElement.meta);
22397
22422
  }
22398
22423
  if (!targetElement.isAttributesEmpty && !sourceElement.isAttributesEmpty) {
22399
22424
  mergedElement.attributes = getAttributesMergeFunction(mergedOptions)(targetElement.attributes, sourceElement.attributes);
@@ -23358,19 +23383,21 @@ class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["de
23358
23383
 
23359
23384
  __webpack_require__.r(__webpack_exports__);
23360
23385
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23361
- /* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
23362
- /* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]),
23363
- /* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"])
23386
+ /* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
23387
+ /* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
23388
+ /* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"])
23364
23389
  /* harmony export */ });
23365
23390
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
23366
23391
  /* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8504);
23367
23392
  /* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6663);
23368
- /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8252);
23369
- /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5162);
23370
- /* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5810);
23371
- /* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5018);
23372
- /* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3686);
23373
- /* harmony import */ var _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3772);
23393
+ /* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1844);
23394
+ /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8252);
23395
+ /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5162);
23396
+ /* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5810);
23397
+ /* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5018);
23398
+ /* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3686);
23399
+ /* harmony import */ var _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3772);
23400
+
23374
23401
 
23375
23402
 
23376
23403
 
@@ -23404,7 +23431,7 @@ const cloneDeepElement = (element, options) => {
23404
23431
  } = element;
23405
23432
  if (Array.isArray(content)) {
23406
23433
  copy.content = content.map(el => cloneDeepElement(el, passThroughOptions));
23407
- } else if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
23434
+ } else if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(content)) {
23408
23435
  copy.content = cloneDeepElement(content, passThroughOptions);
23409
23436
  } else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
23410
23437
  copy.content = cloneDeepKeyValuePair(content, passThroughOptions);
@@ -23452,7 +23479,7 @@ const cloneDeepObjectSlice = (slice, options) => {
23452
23479
  };
23453
23480
 
23454
23481
  /**
23455
- * Creates a deep clone of an ApiDOM Element, KeyValuePair, or ObjectSlice.
23482
+ * Creates a deep clone of an ApiDOM Element, KeyValuePair, ObjectSlice, or Metadata.
23456
23483
  * Handles cycles by memoizing visited objects.
23457
23484
  * @public
23458
23485
  */
@@ -23463,10 +23490,13 @@ const cloneDeep = (value, options = {}) => {
23463
23490
  if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
23464
23491
  return cloneDeepObjectSlice(value, options);
23465
23492
  }
23466
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
23493
+ if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
23494
+ return value.cloneDeep();
23495
+ }
23496
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(value)) {
23467
23497
  return cloneDeepElement(value, options);
23468
23498
  }
23469
- throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]("Value provided to cloneDeep function couldn't be cloned", {
23499
+ throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]("Value provided to cloneDeep function couldn't be cloned", {
23470
23500
  value
23471
23501
  });
23472
23502
  };
@@ -23493,21 +23523,21 @@ const cloneShallowElement = element => {
23493
23523
  const copy = new Ctor();
23494
23524
  copy.element = element.element;
23495
23525
  if (!element.isMetaEmpty) {
23496
- copy.meta = element.meta.cloneDeep();
23526
+ copy.meta = cloneDeep(element.meta);
23497
23527
  }
23498
23528
  if (!element.isAttributesEmpty) {
23499
23529
  copy.attributes = cloneDeep(element.attributes);
23500
23530
  }
23501
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.hasElementSourceMap)(element)) {
23502
- _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(element, copy);
23531
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.hasElementSourceMap)(element)) {
23532
+ _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_6__["default"].transfer(element, copy);
23503
23533
  }
23504
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.hasElementStyle)(element)) {
23534
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.hasElementStyle)(element)) {
23505
23535
  copy.style = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(element.style);
23506
23536
  }
23507
23537
  const {
23508
23538
  content
23509
23539
  } = element;
23510
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
23540
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(content)) {
23511
23541
  copy.content = cloneShallowElement(content);
23512
23542
  } else if (Array.isArray(content)) {
23513
23543
  copy.content = [...content];
@@ -23520,7 +23550,7 @@ const cloneShallowElement = element => {
23520
23550
  };
23521
23551
 
23522
23552
  /**
23523
- * Creates a shallow clone of an ApiDOM Element, KeyValuePair, or ObjectSlice.
23553
+ * Creates a shallow clone of an ApiDOM Element, KeyValuePair, ObjectSlice, or Metadata.
23524
23554
  * The element itself is cloned, but content references are shared.
23525
23555
  * Meta and attributes are deep cloned to preserve semantic information.
23526
23556
  * @public
@@ -23532,10 +23562,13 @@ const cloneShallow = value => {
23532
23562
  if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
23533
23563
  return cloneShallowObjectSlice(value);
23534
23564
  }
23535
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
23565
+ if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
23566
+ return value.cloneShallow();
23567
+ }
23568
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isElement)(value)) {
23536
23569
  return cloneShallowElement(value);
23537
23570
  }
23538
- throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]("Value provided to cloneShallow function couldn't be cloned", {
23571
+ throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]("Value provided to cloneShallow function couldn't be cloned", {
23539
23572
  value
23540
23573
  });
23541
23574
  };
@@ -27103,7 +27136,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
27103
27136
  if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
27104
27137
  return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
27105
27138
  }
27106
- (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
27139
+ ;(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
27107
27140
  return visitor.element;
27108
27141
  }
27109
27142
  }
@@ -27144,7 +27177,7 @@ class Visitor {
27144
27177
  if (!from.isMetaEmpty && !to.isMetaEmpty) {
27145
27178
  to.meta = to.meta.merge(from.meta);
27146
27179
  } else if (!from.isMetaEmpty) {
27147
- to.meta = from.meta.cloneDeep();
27180
+ to.meta = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.meta);
27148
27181
  }
27149
27182
  if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
27150
27183
  to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
@@ -28672,7 +28705,7 @@ const forEach = (element, options) => {
28672
28705
  callback = options.callback ?? (() => {});
28673
28706
  predicate = options.predicate ?? (() => true);
28674
28707
  }
28675
- (0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
28708
+ ;(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
28676
28709
  enter(path) {
28677
28710
  if (predicate(path)) {
28678
28711
  callback(path);