@rio-cloud/cdk-v2-constructs 7.13.12-alpha.0 → 7.13.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/.jsii +9 -9
  2. package/lib/contributions/team-transport-two/datadog-synthetics/datadog-synthetics-test-custom-resource/handler.cjs +289 -240
  3. package/lib/datadogv2/secret-locator-custom-resource/on-create.cjs +302 -253
  4. package/lib/datadogv2/service-catalog-custom-resource/on-create.cjs +289 -240
  5. package/lib/fargate/codedeploy-custom-resources/create-deployment-is-complete.cjs +288 -239
  6. package/lib/fargate/codedeploy-custom-resources/create-deployment-on-create.cjs +288 -239
  7. package/lib/fargate/codedeploy-custom-resources/run-monitoring-test-suite-runner.cjs +288 -239
  8. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@smithy/util-retry/package.json +3 -3
  9. package/node_modules/@aws-sdk/client-cloudformation/package.json +13 -13
  10. package/node_modules/@aws-sdk/client-codedeploy/node_modules/@smithy/util-retry/package.json +3 -3
  11. package/node_modules/@aws-sdk/client-codedeploy/package.json +13 -13
  12. package/node_modules/@aws-sdk/client-ecs/node_modules/@smithy/util-retry/package.json +3 -3
  13. package/node_modules/@aws-sdk/client-ecs/package.json +13 -13
  14. package/node_modules/@aws-sdk/client-organizations/node_modules/@smithy/util-retry/package.json +3 -3
  15. package/node_modules/@aws-sdk/client-organizations/package.json +13 -13
  16. package/node_modules/@aws-sdk/client-secrets-manager/node_modules/@smithy/util-retry/package.json +3 -3
  17. package/node_modules/@aws-sdk/client-secrets-manager/package.json +14 -14
  18. package/node_modules/@aws-sdk/client-ssm/node_modules/@smithy/util-retry/package.json +3 -3
  19. package/node_modules/@aws-sdk/client-ssm/package.json +13 -13
  20. package/node_modules/@aws-sdk/core/dist-cjs/index.js +7 -15
  21. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +7 -15
  22. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +2 -8
  23. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +5 -7
  24. package/node_modules/@aws-sdk/core/package.json +4 -4
  25. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  26. package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -6
  27. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  28. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  29. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  30. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  31. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  32. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  33. package/node_modules/@aws-sdk/middleware-user-agent/package.json +3 -3
  34. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-retry/package.json +3 -3
  35. package/node_modules/@aws-sdk/nested-clients/package.json +12 -12
  36. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  37. package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +36 -19
  38. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getSanitizedTypeScriptVersion.js +9 -0
  39. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptPackageJsonPaths.js +17 -0
  40. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js +17 -12
  41. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getSanitizedTypeScriptVersion.d.ts +8 -0
  42. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getTypeScriptPackageJsonPaths.d.ts +10 -0
  43. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getSanitizedTypeScriptVersion.d.ts +3 -0
  44. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getTypeScriptPackageJsonPaths.d.ts +3 -0
  45. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  46. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +1 -0
  47. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +1 -0
  48. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  49. package/node_modules/@smithy/abort-controller/package.json +2 -2
  50. package/node_modules/@smithy/config-resolver/package.json +6 -6
  51. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +2 -8
  52. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +2 -8
  53. package/node_modules/@smithy/core/package.json +11 -11
  54. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  55. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +18 -4
  56. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +18 -4
  57. package/node_modules/@smithy/fetch-http-handler/package.json +6 -6
  58. package/node_modules/@smithy/hash-node/package.json +4 -4
  59. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  60. package/node_modules/@smithy/is-array-buffer/package.json +2 -2
  61. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  62. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  63. package/node_modules/@smithy/middleware-retry/node_modules/@smithy/util-retry/package.json +3 -3
  64. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  65. package/node_modules/@smithy/middleware-serde/package.json +3 -3
  66. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  67. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  68. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +21 -8
  69. package/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +16 -0
  70. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +3 -4
  71. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +3 -4
  72. package/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +9 -0
  73. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +9 -0
  74. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  75. package/node_modules/@smithy/property-provider/package.json +2 -2
  76. package/node_modules/@smithy/protocol-http/package.json +2 -2
  77. package/node_modules/@smithy/querystring-builder/package.json +3 -3
  78. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  79. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  80. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  81. package/node_modules/@smithy/signature-v4/package.json +8 -8
  82. package/node_modules/@smithy/smithy-client/package.json +7 -7
  83. package/node_modules/@smithy/url-parser/package.json +3 -3
  84. package/node_modules/@smithy/util-base64/package.json +4 -4
  85. package/node_modules/@smithy/util-body-length-browser/package.json +2 -2
  86. package/node_modules/@smithy/util-body-length-node/package.json +2 -2
  87. package/node_modules/@smithy/util-buffer-from/package.json +3 -3
  88. package/node_modules/@smithy/util-config-provider/package.json +2 -2
  89. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  90. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  91. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  92. package/node_modules/@smithy/util-hex-encoding/package.json +2 -2
  93. package/node_modules/@smithy/util-middleware/package.json +2 -2
  94. package/node_modules/@smithy/util-stream/package.json +8 -8
  95. package/node_modules/@smithy/util-uri-escape/package.json +2 -2
  96. package/node_modules/@smithy/util-utf8/package.json +3 -3
  97. package/node_modules/@smithy/util-waiter/package.json +3 -3
  98. package/node_modules/@smithy/uuid/package.json +2 -2
  99. package/node_modules/fast-xml-builder/LICENSE +21 -0
  100. package/node_modules/fast-xml-builder/README.md +23 -0
  101. package/node_modules/fast-xml-builder/lib/builder.cjs +1 -0
  102. package/node_modules/fast-xml-builder/lib/builder.min.js +2 -0
  103. package/node_modules/fast-xml-builder/lib/builder.min.js.map +1 -0
  104. package/node_modules/fast-xml-builder/lib/fxb.d.cts +167 -0
  105. package/node_modules/fast-xml-builder/package.json +78 -0
  106. package/node_modules/fast-xml-builder/src/fxb.d.ts +156 -0
  107. package/node_modules/fast-xml-builder/src/fxb.js +285 -0
  108. package/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
  109. package/node_modules/{fast-xml-parser/src/xmlbuilder → fast-xml-builder/src}/orderedJs2Xml.js +14 -3
  110. package/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  111. package/node_modules/fast-xml-parser/CHANGELOG.md +23 -0
  112. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
  113. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -1
  114. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
  115. package/node_modules/fast-xml-parser/lib/fxp.d.cts +15 -1
  116. package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
  117. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
  118. package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
  119. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
  120. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +1 -1
  121. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -1
  122. package/node_modules/fast-xml-parser/package.json +3 -2
  123. package/node_modules/fast-xml-parser/src/fxp.d.ts +16 -0
  124. package/node_modules/fast-xml-parser/src/fxp.js +1 -1
  125. package/node_modules/fast-xml-parser/src/util.js +1 -26
  126. package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +87 -87
  127. package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +10 -10
  128. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +23 -23
  129. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +29 -29
  130. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +39 -39
  131. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +17 -17
  132. package/node_modules/fast-xml-parser/src/v6/XMLParser.js +22 -22
  133. package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +85 -85
  134. package/node_modules/fast-xml-parser/src/validator.js +34 -34
  135. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -284
  136. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +1 -1
  137. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +2 -0
  138. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +27 -5
  139. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +21 -21
  140. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +38 -34
  141. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +10 -10
  142. package/package.json +12 -15
  143. package/version.json +1 -1
  144. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptPackageJsonPath.js +0 -14
  145. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/getTypeScriptPackageJsonPath.d.ts +0 -9
  146. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/getTypeScriptPackageJsonPath.d.ts +0 -1
  147. /package/node_modules/{fast-xml-parser/src/xmlbuilder/prettifyJs2Xml.js → fast-xml-builder/CHANGELOG.md} +0 -0
@@ -1677,6 +1677,20 @@ var require_dist_cjs14 = __commonJS({
1677
1677
  var https = require("https");
1678
1678
  var stream = require("stream");
1679
1679
  var http2 = require("http2");
1680
+ function buildAbortError(abortSignal) {
1681
+ const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : void 0;
1682
+ if (reason) {
1683
+ if (reason instanceof Error) {
1684
+ return reason;
1685
+ }
1686
+ const abortError2 = new Error(String(reason));
1687
+ abortError2.name = "AbortError";
1688
+ return abortError2;
1689
+ }
1690
+ const abortError = new Error("Request aborted");
1691
+ abortError.name = "AbortError";
1692
+ return abortError;
1693
+ }
1680
1694
  var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
1681
1695
  var getTransformedHeaders = (headers) => {
1682
1696
  const transformedHeaders = {};
@@ -1937,8 +1951,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
1937
1951
  _reject(arg);
1938
1952
  };
1939
1953
  if (abortSignal?.aborted) {
1940
- const abortError = new Error("Request aborted");
1941
- abortError.name = "AbortError";
1954
+ const abortError = buildAbortError(abortSignal);
1942
1955
  reject(abortError);
1943
1956
  return;
1944
1957
  }
@@ -2004,8 +2017,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2004
2017
  if (abortSignal) {
2005
2018
  const onAbort = () => {
2006
2019
  req.destroy();
2007
- const abortError = new Error("Request aborted");
2008
- abortError.name = "AbortError";
2020
+ const abortError = buildAbortError(abortSignal);
2009
2021
  reject(abortError);
2010
2022
  };
2011
2023
  if (typeof abortSignal.addEventListener === "function") {
@@ -2208,8 +2220,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2208
2220
  };
2209
2221
  if (abortSignal?.aborted) {
2210
2222
  fulfilled = true;
2211
- const abortError = new Error("Request aborted");
2212
- abortError.name = "AbortError";
2223
+ const abortError = buildAbortError(abortSignal);
2213
2224
  reject(abortError);
2214
2225
  return;
2215
2226
  }
@@ -2271,8 +2282,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2271
2282
  if (abortSignal) {
2272
2283
  const onAbort = () => {
2273
2284
  req.close();
2274
- const abortError = new Error("Request aborted");
2275
- abortError.name = "AbortError";
2285
+ const abortError = buildAbortError(abortSignal);
2276
2286
  rejectWithDestroy(abortError);
2277
2287
  };
2278
2288
  if (typeof abortSignal.addEventListener === "function") {
@@ -2428,8 +2438,7 @@ var require_dist_cjs15 = __commonJS({
2428
2438
  const keepAlive = this.config.keepAlive === true;
2429
2439
  const credentials = this.config.credentials;
2430
2440
  if (abortSignal?.aborted) {
2431
- const abortError = new Error("Request aborted");
2432
- abortError.name = "AbortError";
2441
+ const abortError = buildAbortError(abortSignal);
2433
2442
  return Promise.reject(abortError);
2434
2443
  }
2435
2444
  let path = request.path;
@@ -2505,8 +2514,7 @@ var require_dist_cjs15 = __commonJS({
2505
2514
  if (abortSignal) {
2506
2515
  raceOfPromises.push(new Promise((resolve, reject) => {
2507
2516
  const onAbort = () => {
2508
- const abortError = new Error("Request aborted");
2509
- abortError.name = "AbortError";
2517
+ const abortError = buildAbortError(abortSignal);
2510
2518
  reject(abortError);
2511
2519
  };
2512
2520
  if (typeof abortSignal.addEventListener === "function") {
@@ -2531,6 +2539,20 @@ var require_dist_cjs15 = __commonJS({
2531
2539
  return this.config ?? {};
2532
2540
  }
2533
2541
  };
2542
+ function buildAbortError(abortSignal) {
2543
+ const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : void 0;
2544
+ if (reason) {
2545
+ if (reason instanceof Error) {
2546
+ return reason;
2547
+ }
2548
+ const abortError2 = new Error(String(reason));
2549
+ abortError2.name = "AbortError";
2550
+ return abortError2;
2551
+ }
2552
+ const abortError = new Error("Request aborted");
2553
+ abortError.name = "AbortError";
2554
+ return abortError;
2555
+ }
2534
2556
  var streamCollector5 = async (stream) => {
2535
2557
  if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") {
2536
2558
  if (Blob.prototype.arrayBuffer !== void 0) {
@@ -9343,24 +9365,18 @@ var init_CborCodec = __esm({
9343
9365
  if (ns.isListSchema()) {
9344
9366
  const newArray = [];
9345
9367
  const memberSchema = ns.getValueSchema();
9346
- const sparse = !!ns.getMergedTraits().sparse;
9347
9368
  for (const item of value) {
9348
9369
  const itemValue = this.readValue(memberSchema, item);
9349
- if (itemValue != null || sparse) {
9350
- newArray.push(itemValue);
9351
- }
9370
+ newArray.push(itemValue);
9352
9371
  }
9353
9372
  return newArray;
9354
9373
  }
9355
9374
  const newObject = {};
9356
9375
  if (ns.isMapSchema()) {
9357
- const sparse = !!ns.getMergedTraits().sparse;
9358
9376
  const targetSchema = ns.getValueSchema();
9359
9377
  for (const key of Object.keys(value)) {
9360
9378
  const itemValue = this.readValue(targetSchema, value[key]);
9361
- if (itemValue != null || sparse) {
9362
- newObject[key] = itemValue;
9363
- }
9379
+ newObject[key] = itemValue;
9364
9380
  }
9365
9381
  } else if (ns.isStructSchema()) {
9366
9382
  const isUnion = ns.isUnionSchema();
@@ -10839,22 +10855,16 @@ var init_JsonShapeDeserializer = __esm({
10839
10855
  if (Array.isArray(value) && ns.isListSchema()) {
10840
10856
  const listMember = ns.getValueSchema();
10841
10857
  const out = [];
10842
- const sparse = !!ns.getMergedTraits().sparse;
10843
10858
  for (const item of value) {
10844
- if (sparse || item != null) {
10845
- out.push(this._read(listMember, item));
10846
- }
10859
+ out.push(this._read(listMember, item));
10847
10860
  }
10848
10861
  return out;
10849
10862
  }
10850
10863
  if (ns.isMapSchema()) {
10851
10864
  const mapMember = ns.getValueSchema();
10852
10865
  const out = {};
10853
- const sparse = !!ns.getMergedTraits().sparse;
10854
10866
  for (const [_k, _v] of Object.entries(value)) {
10855
- if (sparse || _v != null) {
10856
- out[_k] = this._read(mapMember, _v);
10857
- }
10867
+ out[_k] = this._read(mapMember, _v);
10858
10868
  }
10859
10869
  return out;
10860
10870
  }
@@ -11449,7 +11459,7 @@ var require_fxp = __commonJS({
11449
11459
  }, o: (t6, e6) => Object.prototype.hasOwnProperty.call(t6, e6), r: (t6) => {
11450
11460
  "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t6, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t6, "__esModule", { value: true });
11451
11461
  } }, e5 = {};
11452
- t5.r(e5), t5.d(e5, { XMLBuilder: () => dt, XMLParser: () => it, XMLValidator: () => gt });
11462
+ t5.r(e5), t5.d(e5, { XMLBuilder: () => gt, XMLParser: () => it, XMLValidator: () => xt });
11453
11463
  const n5 = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i5 = new RegExp("^[" + n5 + "][" + n5 + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");
11454
11464
  function s5(t6, e6) {
11455
11465
  const n6 = [];
@@ -11471,90 +11481,90 @@ var require_fxp = __commonJS({
11471
11481
  const n6 = [];
11472
11482
  let i6 = false, s6 = false;
11473
11483
  "\uFEFF" === t6[0] && (t6 = t6.substr(1));
11474
- for (let o6 = 0; o6 < t6.length; o6++) if ("<" === t6[o6] && "?" === t6[o6 + 1]) {
11475
- if (o6 += 2, o6 = u5(t6, o6), o6.err) return o6;
11484
+ for (let r6 = 0; r6 < t6.length; r6++) if ("<" === t6[r6] && "?" === t6[r6 + 1]) {
11485
+ if (r6 += 2, r6 = u5(t6, r6), r6.err) return r6;
11476
11486
  } else {
11477
- if ("<" !== t6[o6]) {
11478
- if (l5(t6[o6])) continue;
11479
- return m5("InvalidChar", "char '" + t6[o6] + "' is not expected.", b5(t6, o6));
11487
+ if ("<" !== t6[r6]) {
11488
+ if (l5(t6[r6])) continue;
11489
+ return m5("InvalidChar", "char '" + t6[r6] + "' is not expected.", N(t6, r6));
11480
11490
  }
11481
11491
  {
11482
- let a6 = o6;
11483
- if (o6++, "!" === t6[o6]) {
11484
- o6 = h5(t6, o6);
11492
+ let o6 = r6;
11493
+ if (r6++, "!" === t6[r6]) {
11494
+ r6 = d5(t6, r6);
11485
11495
  continue;
11486
11496
  }
11487
11497
  {
11488
- let d6 = false;
11489
- "/" === t6[o6] && (d6 = true, o6++);
11490
- let p6 = "";
11491
- for (; o6 < t6.length && ">" !== t6[o6] && " " !== t6[o6] && " " !== t6[o6] && "\n" !== t6[o6] && "\r" !== t6[o6]; o6++) p6 += t6[o6];
11492
- if (p6 = p6.trim(), "/" === p6[p6.length - 1] && (p6 = p6.substring(0, p6.length - 1), o6--), !r5(p6)) {
11498
+ let a6 = false;
11499
+ "/" === t6[r6] && (a6 = true, r6++);
11500
+ let h6 = "";
11501
+ for (; r6 < t6.length && ">" !== t6[r6] && " " !== t6[r6] && " " !== t6[r6] && "\n" !== t6[r6] && "\r" !== t6[r6]; r6++) h6 += t6[r6];
11502
+ if (h6 = h6.trim(), "/" === h6[h6.length - 1] && (h6 = h6.substring(0, h6.length - 1), r6--), !b5(h6)) {
11493
11503
  let e7;
11494
- return e7 = 0 === p6.trim().length ? "Invalid space after '<'." : "Tag '" + p6 + "' is an invalid name.", m5("InvalidTag", e7, b5(t6, o6));
11504
+ return e7 = 0 === h6.trim().length ? "Invalid space after '<'." : "Tag '" + h6 + "' is an invalid name.", m5("InvalidTag", e7, N(t6, r6));
11495
11505
  }
11496
- const c6 = f5(t6, o6);
11497
- if (false === c6) return m5("InvalidAttr", "Attributes for '" + p6 + "' have open quote.", b5(t6, o6));
11498
- let E3 = c6.value;
11499
- if (o6 = c6.index, "/" === E3[E3.length - 1]) {
11500
- const n7 = o6 - E3.length;
11501
- E3 = E3.substring(0, E3.length - 1);
11502
- const s7 = g5(E3, e6);
11503
- if (true !== s7) return m5(s7.err.code, s7.err.msg, b5(t6, n7 + s7.err.line));
11506
+ const p6 = c5(t6, r6);
11507
+ if (false === p6) return m5("InvalidAttr", "Attributes for '" + h6 + "' have open quote.", N(t6, r6));
11508
+ let f6 = p6.value;
11509
+ if (r6 = p6.index, "/" === f6[f6.length - 1]) {
11510
+ const n7 = r6 - f6.length;
11511
+ f6 = f6.substring(0, f6.length - 1);
11512
+ const s7 = g5(f6, e6);
11513
+ if (true !== s7) return m5(s7.err.code, s7.err.msg, N(t6, n7 + s7.err.line));
11504
11514
  i6 = true;
11505
- } else if (d6) {
11506
- if (!c6.tagClosed) return m5("InvalidTag", "Closing tag '" + p6 + "' doesn't have proper closing.", b5(t6, o6));
11507
- if (E3.trim().length > 0) return m5("InvalidTag", "Closing tag '" + p6 + "' can't have attributes or invalid starting.", b5(t6, a6));
11508
- if (0 === n6.length) return m5("InvalidTag", "Closing tag '" + p6 + "' has not been opened.", b5(t6, a6));
11515
+ } else if (a6) {
11516
+ if (!p6.tagClosed) return m5("InvalidTag", "Closing tag '" + h6 + "' doesn't have proper closing.", N(t6, r6));
11517
+ if (f6.trim().length > 0) return m5("InvalidTag", "Closing tag '" + h6 + "' can't have attributes or invalid starting.", N(t6, o6));
11518
+ if (0 === n6.length) return m5("InvalidTag", "Closing tag '" + h6 + "' has not been opened.", N(t6, o6));
11509
11519
  {
11510
11520
  const e7 = n6.pop();
11511
- if (p6 !== e7.tagName) {
11512
- let n7 = b5(t6, e7.tagStartPos);
11513
- return m5("InvalidTag", "Expected closing tag '" + e7.tagName + "' (opened in line " + n7.line + ", col " + n7.col + ") instead of closing tag '" + p6 + "'.", b5(t6, a6));
11521
+ if (h6 !== e7.tagName) {
11522
+ let n7 = N(t6, e7.tagStartPos);
11523
+ return m5("InvalidTag", "Expected closing tag '" + e7.tagName + "' (opened in line " + n7.line + ", col " + n7.col + ") instead of closing tag '" + h6 + "'.", N(t6, o6));
11514
11524
  }
11515
11525
  0 == n6.length && (s6 = true);
11516
11526
  }
11517
11527
  } else {
11518
- const r6 = g5(E3, e6);
11519
- if (true !== r6) return m5(r6.err.code, r6.err.msg, b5(t6, o6 - E3.length + r6.err.line));
11520
- if (true === s6) return m5("InvalidXml", "Multiple possible root nodes found.", b5(t6, o6));
11521
- -1 !== e6.unpairedTags.indexOf(p6) || n6.push({ tagName: p6, tagStartPos: a6 }), i6 = true;
11528
+ const a7 = g5(f6, e6);
11529
+ if (true !== a7) return m5(a7.err.code, a7.err.msg, N(t6, r6 - f6.length + a7.err.line));
11530
+ if (true === s6) return m5("InvalidXml", "Multiple possible root nodes found.", N(t6, r6));
11531
+ -1 !== e6.unpairedTags.indexOf(h6) || n6.push({ tagName: h6, tagStartPos: o6 }), i6 = true;
11522
11532
  }
11523
- for (o6++; o6 < t6.length; o6++) if ("<" === t6[o6]) {
11524
- if ("!" === t6[o6 + 1]) {
11525
- o6++, o6 = h5(t6, o6);
11533
+ for (r6++; r6 < t6.length; r6++) if ("<" === t6[r6]) {
11534
+ if ("!" === t6[r6 + 1]) {
11535
+ r6++, r6 = d5(t6, r6);
11526
11536
  continue;
11527
11537
  }
11528
- if ("?" !== t6[o6 + 1]) break;
11529
- if (o6 = u5(t6, ++o6), o6.err) return o6;
11530
- } else if ("&" === t6[o6]) {
11531
- const e7 = x5(t6, o6);
11532
- if (-1 == e7) return m5("InvalidChar", "char '&' is not expected.", b5(t6, o6));
11533
- o6 = e7;
11534
- } else if (true === s6 && !l5(t6[o6])) return m5("InvalidXml", "Extra text at the end", b5(t6, o6));
11535
- "<" === t6[o6] && o6--;
11538
+ if ("?" !== t6[r6 + 1]) break;
11539
+ if (r6 = u5(t6, ++r6), r6.err) return r6;
11540
+ } else if ("&" === t6[r6]) {
11541
+ const e7 = x5(t6, r6);
11542
+ if (-1 == e7) return m5("InvalidChar", "char '&' is not expected.", N(t6, r6));
11543
+ r6 = e7;
11544
+ } else if (true === s6 && !l5(t6[r6])) return m5("InvalidXml", "Extra text at the end", N(t6, r6));
11545
+ "<" === t6[r6] && r6--;
11536
11546
  }
11537
11547
  }
11538
11548
  }
11539
- return i6 ? 1 == n6.length ? m5("InvalidTag", "Unclosed tag '" + n6[0].tagName + "'.", b5(t6, n6[0].tagStartPos)) : !(n6.length > 0) || m5("InvalidXml", "Invalid '" + JSON.stringify(n6.map((t7) => t7.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m5("InvalidXml", "Start tag expected.", 1);
11549
+ return i6 ? 1 == n6.length ? m5("InvalidTag", "Unclosed tag '" + n6[0].tagName + "'.", N(t6, n6[0].tagStartPos)) : !(n6.length > 0) || m5("InvalidXml", "Invalid '" + JSON.stringify(n6.map((t7) => t7.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m5("InvalidXml", "Start tag expected.", 1);
11540
11550
  }
11541
11551
  function l5(t6) {
11542
11552
  return " " === t6 || " " === t6 || "\n" === t6 || "\r" === t6;
11543
11553
  }
11544
11554
  function u5(t6, e6) {
11545
11555
  const n6 = e6;
11546
- for (; e6 < t6.length; e6++) if ("?" != t6[e6] && " " != t6[e6]) ;
11547
- else {
11556
+ for (; e6 < t6.length; e6++) if ("?" == t6[e6] || " " == t6[e6]) {
11548
11557
  const i6 = t6.substr(n6, e6 - n6);
11549
- if (e6 > 5 && "xml" === i6) return m5("InvalidXml", "XML declaration allowed only at the start of the document.", b5(t6, e6));
11558
+ if (e6 > 5 && "xml" === i6) return m5("InvalidXml", "XML declaration allowed only at the start of the document.", N(t6, e6));
11550
11559
  if ("?" == t6[e6] && ">" == t6[e6 + 1]) {
11551
11560
  e6++;
11552
11561
  break;
11553
11562
  }
11563
+ continue;
11554
11564
  }
11555
11565
  return e6;
11556
11566
  }
11557
- function h5(t6, e6) {
11567
+ function d5(t6, e6) {
11558
11568
  if (t6.length > e6 + 5 && "-" === t6[e6 + 1] && "-" === t6[e6 + 2]) {
11559
11569
  for (e6 += 3; e6 < t6.length; e6++) if ("-" === t6[e6] && "-" === t6[e6 + 1] && ">" === t6[e6 + 2]) {
11560
11570
  e6 += 2;
@@ -11572,11 +11582,11 @@ var require_fxp = __commonJS({
11572
11582
  }
11573
11583
  return e6;
11574
11584
  }
11575
- const d5 = '"', p5 = "'";
11576
- function f5(t6, e6) {
11585
+ const h5 = '"', p5 = "'";
11586
+ function c5(t6, e6) {
11577
11587
  let n6 = "", i6 = "", s6 = false;
11578
11588
  for (; e6 < t6.length; e6++) {
11579
- if (t6[e6] === d5 || t6[e6] === p5) "" === i6 ? i6 = t6[e6] : i6 !== t6[e6] || (i6 = "");
11589
+ if (t6[e6] === h5 || t6[e6] === p5) "" === i6 ? i6 = t6[e6] : i6 !== t6[e6] || (i6 = "");
11580
11590
  else if (">" === t6[e6] && "" === i6) {
11581
11591
  s6 = true;
11582
11592
  break;
@@ -11585,16 +11595,16 @@ var require_fxp = __commonJS({
11585
11595
  }
11586
11596
  return "" === i6 && { value: n6, index: e6, tagClosed: s6 };
11587
11597
  }
11588
- const c5 = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
11598
+ const f5 = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
11589
11599
  function g5(t6, e6) {
11590
- const n6 = s5(t6, c5), i6 = {};
11600
+ const n6 = s5(t6, f5), i6 = {};
11591
11601
  for (let t7 = 0; t7 < n6.length; t7++) {
11592
- if (0 === n6[t7][1].length) return m5("InvalidAttr", "Attribute '" + n6[t7][2] + "' has no space in starting.", N(n6[t7]));
11593
- if (void 0 !== n6[t7][3] && void 0 === n6[t7][4]) return m5("InvalidAttr", "Attribute '" + n6[t7][2] + "' is without value.", N(n6[t7]));
11594
- if (void 0 === n6[t7][3] && !e6.allowBooleanAttributes) return m5("InvalidAttr", "boolean attribute '" + n6[t7][2] + "' is not allowed.", N(n6[t7]));
11602
+ if (0 === n6[t7][1].length) return m5("InvalidAttr", "Attribute '" + n6[t7][2] + "' has no space in starting.", y2(n6[t7]));
11603
+ if (void 0 !== n6[t7][3] && void 0 === n6[t7][4]) return m5("InvalidAttr", "Attribute '" + n6[t7][2] + "' is without value.", y2(n6[t7]));
11604
+ if (void 0 === n6[t7][3] && !e6.allowBooleanAttributes) return m5("InvalidAttr", "boolean attribute '" + n6[t7][2] + "' is not allowed.", y2(n6[t7]));
11595
11605
  const s6 = n6[t7][2];
11596
- if (!E2(s6)) return m5("InvalidAttr", "Attribute '" + s6 + "' is an invalid name.", N(n6[t7]));
11597
- if (i6.hasOwnProperty(s6)) return m5("InvalidAttr", "Attribute '" + s6 + "' is repeated.", N(n6[t7]));
11606
+ if (!E2(s6)) return m5("InvalidAttr", "Attribute '" + s6 + "' is an invalid name.", y2(n6[t7]));
11607
+ if (Object.prototype.hasOwnProperty.call(i6, s6)) return m5("InvalidAttr", "Attribute '" + s6 + "' is repeated.", y2(n6[t7]));
11598
11608
  i6[s6] = 1;
11599
11609
  }
11600
11610
  return true;
@@ -11622,49 +11632,52 @@ var require_fxp = __commonJS({
11622
11632
  function E2(t6) {
11623
11633
  return r5(t6);
11624
11634
  }
11625
- function b5(t6, e6) {
11635
+ function b5(t6) {
11636
+ return r5(t6);
11637
+ }
11638
+ function N(t6, e6) {
11626
11639
  const n6 = t6.substring(0, e6).split(/\r?\n/);
11627
11640
  return { line: n6.length, col: n6[n6.length - 1].length + 1 };
11628
11641
  }
11629
- function N(t6) {
11642
+ function y2(t6) {
11630
11643
  return t6.startIndex + t6[1].length;
11631
11644
  }
11632
- const y2 = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(t6, e6) {
11645
+ const T = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(t6, e6) {
11633
11646
  return e6;
11634
11647
  }, attributeValueProcessor: function(t6, e6) {
11635
11648
  return e6;
11636
11649
  }, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t6, e6, n6) {
11637
11650
  return t6;
11638
- }, captureMetaData: false };
11639
- function T(t6) {
11640
- return "boolean" == typeof t6 ? { enabled: t6, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t6 && null !== t6 ? { enabled: false !== t6.enabled, maxEntitySize: t6.maxEntitySize ?? 1e4, maxExpansionDepth: t6.maxExpansionDepth ?? 10, maxTotalExpansions: t6.maxTotalExpansions ?? 1e3, maxExpandedLength: t6.maxExpandedLength ?? 1e5, allowedTags: t6.allowedTags ?? null, tagFilter: t6.tagFilter ?? null } : T(true);
11651
+ }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true };
11652
+ function w5(t6) {
11653
+ return "boolean" == typeof t6 ? { enabled: t6, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1e3, maxExpandedLength: 1e5, allowedTags: null, tagFilter: null } : "object" == typeof t6 && null !== t6 ? { enabled: false !== t6.enabled, maxEntitySize: t6.maxEntitySize ?? 1e4, maxExpansionDepth: t6.maxExpansionDepth ?? 10, maxTotalExpansions: t6.maxTotalExpansions ?? 1e3, maxExpandedLength: t6.maxExpandedLength ?? 1e5, allowedTags: t6.allowedTags ?? null, tagFilter: t6.tagFilter ?? null } : w5(true);
11641
11654
  }
11642
- const w5 = function(t6) {
11643
- const e6 = Object.assign({}, y2, t6);
11644
- return e6.processEntities = T(e6.processEntities), e6;
11655
+ const v5 = function(t6) {
11656
+ const e6 = Object.assign({}, T, t6);
11657
+ return e6.processEntities = w5(e6.processEntities), e6;
11645
11658
  };
11646
- let v5;
11647
- v5 = "function" != typeof Symbol ? "@@xmlMetadata" : Symbol("XML Node Metadata");
11659
+ let O;
11660
+ O = "function" != typeof Symbol ? "@@xmlMetadata" : Symbol("XML Node Metadata");
11648
11661
  class I2 {
11649
11662
  constructor(t6) {
11650
- this.tagname = t6, this.child = [], this[":@"] = {};
11663
+ this.tagname = t6, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null);
11651
11664
  }
11652
11665
  add(t6, e6) {
11653
11666
  "__proto__" === t6 && (t6 = "#__proto__"), this.child.push({ [t6]: e6 });
11654
11667
  }
11655
11668
  addChild(t6, e6) {
11656
- "__proto__" === t6.tagname && (t6.tagname = "#__proto__"), t6[":@"] && Object.keys(t6[":@"]).length > 0 ? this.child.push({ [t6.tagname]: t6.child, ":@": t6[":@"] }) : this.child.push({ [t6.tagname]: t6.child }), void 0 !== e6 && (this.child[this.child.length - 1][v5] = { startIndex: e6 });
11669
+ "__proto__" === t6.tagname && (t6.tagname = "#__proto__"), t6[":@"] && Object.keys(t6[":@"]).length > 0 ? this.child.push({ [t6.tagname]: t6.child, ":@": t6[":@"] }) : this.child.push({ [t6.tagname]: t6.child }), void 0 !== e6 && (this.child[this.child.length - 1][O] = { startIndex: e6 });
11657
11670
  }
11658
11671
  static getMetaDataSymbol() {
11659
- return v5;
11672
+ return O;
11660
11673
  }
11661
11674
  }
11662
- class O {
11675
+ class P {
11663
11676
  constructor(t6) {
11664
11677
  this.suppressValidationErr = !t6, this.options = t6;
11665
11678
  }
11666
11679
  readDocType(t6, e6) {
11667
- const n6 = {};
11680
+ const n6 = /* @__PURE__ */ Object.create(null);
11668
11681
  if ("O" !== t6[e6 + 3] || "C" !== t6[e6 + 4] || "T" !== t6[e6 + 5] || "Y" !== t6[e6 + 6] || "P" !== t6[e6 + 7] || "E" !== t6[e6 + 8]) throw new Error("Invalid Tag instead of DOCTYPE");
11669
11682
  {
11670
11683
  e6 += 9;
@@ -11673,23 +11686,23 @@ var require_fxp = __commonJS({
11673
11686
  if (r6 ? "-" === t6[e6 - 1] && "-" === t6[e6 - 2] && (r6 = false, i6--) : i6--, 0 === i6) break;
11674
11687
  } else "[" === t6[e6] ? s6 = true : o6 += t6[e6];
11675
11688
  else {
11676
- if (s6 && A2(t6, "!ENTITY", e6)) {
11689
+ if (s6 && S(t6, "!ENTITY", e6)) {
11677
11690
  let i7, s7;
11678
11691
  if (e6 += 7, [i7, s7, e6] = this.readEntityExp(t6, e6 + 1, this.suppressValidationErr), -1 === s7.indexOf("&")) {
11679
11692
  const t7 = i7.replace(/[.\-+*:]/g, "\\.");
11680
11693
  n6[i7] = { regx: RegExp(`&${t7};`, "g"), val: s7 };
11681
11694
  }
11682
- } else if (s6 && A2(t6, "!ELEMENT", e6)) {
11695
+ } else if (s6 && S(t6, "!ELEMENT", e6)) {
11683
11696
  e6 += 8;
11684
11697
  const { index: n7 } = this.readElementExp(t6, e6 + 1);
11685
11698
  e6 = n7;
11686
- } else if (s6 && A2(t6, "!ATTLIST", e6)) e6 += 8;
11687
- else if (s6 && A2(t6, "!NOTATION", e6)) {
11699
+ } else if (s6 && S(t6, "!ATTLIST", e6)) e6 += 8;
11700
+ else if (s6 && S(t6, "!NOTATION", e6)) {
11688
11701
  e6 += 9;
11689
11702
  const { index: n7 } = this.readNotationExp(t6, e6 + 1, this.suppressValidationErr);
11690
11703
  e6 = n7;
11691
11704
  } else {
11692
- if (!A2(t6, "!--", e6)) throw new Error("Invalid DOCTYPE");
11705
+ if (!S(t6, "!--", e6)) throw new Error("Invalid DOCTYPE");
11693
11706
  r6 = true;
11694
11707
  }
11695
11708
  i6++, o6 = "";
@@ -11699,10 +11712,10 @@ var require_fxp = __commonJS({
11699
11712
  return { entities: n6, i: e6 };
11700
11713
  }
11701
11714
  readEntityExp(t6, e6) {
11702
- e6 = P(t6, e6);
11715
+ e6 = A2(t6, e6);
11703
11716
  let n6 = "";
11704
11717
  for (; e6 < t6.length && !/\s/.test(t6[e6]) && '"' !== t6[e6] && "'" !== t6[e6]; ) n6 += t6[e6], e6++;
11705
- if (S(n6), e6 = P(t6, e6), !this.suppressValidationErr) {
11718
+ if (C2(n6), e6 = A2(t6, e6), !this.suppressValidationErr) {
11706
11719
  if ("SYSTEM" === t6.substring(e6, e6 + 6).toUpperCase()) throw new Error("External entities are not supported");
11707
11720
  if ("%" === t6[e6]) throw new Error("Parameter entities are not supported");
11708
11721
  }
@@ -11711,15 +11724,15 @@ var require_fxp = __commonJS({
11711
11724
  return [n6, i6, --e6];
11712
11725
  }
11713
11726
  readNotationExp(t6, e6) {
11714
- e6 = P(t6, e6);
11727
+ e6 = A2(t6, e6);
11715
11728
  let n6 = "";
11716
11729
  for (; e6 < t6.length && !/\s/.test(t6[e6]); ) n6 += t6[e6], e6++;
11717
- !this.suppressValidationErr && S(n6), e6 = P(t6, e6);
11730
+ !this.suppressValidationErr && C2(n6), e6 = A2(t6, e6);
11718
11731
  const i6 = t6.substring(e6, e6 + 6).toUpperCase();
11719
11732
  if (!this.suppressValidationErr && "SYSTEM" !== i6 && "PUBLIC" !== i6) throw new Error(`Expected SYSTEM or PUBLIC, found "${i6}"`);
11720
- e6 += i6.length, e6 = P(t6, e6);
11733
+ e6 += i6.length, e6 = A2(t6, e6);
11721
11734
  let s6 = null, r6 = null;
11722
- if ("PUBLIC" === i6) [e6, s6] = this.readIdentifierVal(t6, e6, "publicIdentifier"), '"' !== t6[e6 = P(t6, e6)] && "'" !== t6[e6] || ([e6, r6] = this.readIdentifierVal(t6, e6, "systemIdentifier"));
11735
+ if ("PUBLIC" === i6) [e6, s6] = this.readIdentifierVal(t6, e6, "publicIdentifier"), '"' !== t6[e6 = A2(t6, e6)] && "'" !== t6[e6] || ([e6, r6] = this.readIdentifierVal(t6, e6, "systemIdentifier"));
11723
11736
  else if ("SYSTEM" === i6 && ([e6, r6] = this.readIdentifierVal(t6, e6, "systemIdentifier"), !this.suppressValidationErr && !r6)) throw new Error("Missing mandatory system identifier for SYSTEM notation");
11724
11737
  return { notationName: n6, publicIdentifier: s6, systemIdentifier: r6, index: --e6 };
11725
11738
  }
@@ -11732,13 +11745,13 @@ var require_fxp = __commonJS({
11732
11745
  return [++e6, i6];
11733
11746
  }
11734
11747
  readElementExp(t6, e6) {
11735
- e6 = P(t6, e6);
11748
+ e6 = A2(t6, e6);
11736
11749
  let n6 = "";
11737
11750
  for (; e6 < t6.length && !/\s/.test(t6[e6]); ) n6 += t6[e6], e6++;
11738
11751
  if (!this.suppressValidationErr && !r5(n6)) throw new Error(`Invalid element name: "${n6}"`);
11739
11752
  let i6 = "";
11740
- if ("E" === t6[e6 = P(t6, e6)] && A2(t6, "MPTY", e6)) e6 += 4;
11741
- else if ("A" === t6[e6] && A2(t6, "NY", e6)) e6 += 2;
11753
+ if ("E" === t6[e6 = A2(t6, e6)] && S(t6, "MPTY", e6)) e6 += 4;
11754
+ else if ("A" === t6[e6] && S(t6, "NY", e6)) e6 += 2;
11742
11755
  else if ("(" === t6[e6]) {
11743
11756
  for (e6++; e6 < t6.length && ")" !== t6[e6]; ) i6 += t6[e6], e6++;
11744
11757
  if (")" !== t6[e6]) throw new Error("Unterminated content model");
@@ -11746,24 +11759,24 @@ var require_fxp = __commonJS({
11746
11759
  return { elementName: n6, contentModel: i6.trim(), index: e6 };
11747
11760
  }
11748
11761
  readAttlistExp(t6, e6) {
11749
- e6 = P(t6, e6);
11762
+ e6 = A2(t6, e6);
11750
11763
  let n6 = "";
11751
11764
  for (; e6 < t6.length && !/\s/.test(t6[e6]); ) n6 += t6[e6], e6++;
11752
- S(n6), e6 = P(t6, e6);
11765
+ C2(n6), e6 = A2(t6, e6);
11753
11766
  let i6 = "";
11754
11767
  for (; e6 < t6.length && !/\s/.test(t6[e6]); ) i6 += t6[e6], e6++;
11755
- if (!S(i6)) throw new Error(`Invalid attribute name: "${i6}"`);
11756
- e6 = P(t6, e6);
11768
+ if (!C2(i6)) throw new Error(`Invalid attribute name: "${i6}"`);
11769
+ e6 = A2(t6, e6);
11757
11770
  let s6 = "";
11758
11771
  if ("NOTATION" === t6.substring(e6, e6 + 8).toUpperCase()) {
11759
- if (s6 = "NOTATION", "(" !== t6[e6 = P(t6, e6 += 8)]) throw new Error(`Expected '(', found "${t6[e6]}"`);
11772
+ if (s6 = "NOTATION", "(" !== t6[e6 = A2(t6, e6 += 8)]) throw new Error(`Expected '(', found "${t6[e6]}"`);
11760
11773
  e6++;
11761
11774
  let n7 = [];
11762
11775
  for (; e6 < t6.length && ")" !== t6[e6]; ) {
11763
11776
  let i7 = "";
11764
11777
  for (; e6 < t6.length && "|" !== t6[e6] && ")" !== t6[e6]; ) i7 += t6[e6], e6++;
11765
- if (i7 = i7.trim(), !S(i7)) throw new Error(`Invalid notation name: "${i7}"`);
11766
- n7.push(i7), "|" === t6[e6] && (e6++, e6 = P(t6, e6));
11778
+ if (i7 = i7.trim(), !C2(i7)) throw new Error(`Invalid notation name: "${i7}"`);
11779
+ n7.push(i7), "|" === t6[e6] && (e6++, e6 = A2(t6, e6));
11767
11780
  }
11768
11781
  if (")" !== t6[e6]) throw new Error("Unterminated list of notations");
11769
11782
  e6++, s6 += " (" + n7.join("|") + ")";
@@ -11772,45 +11785,43 @@ var require_fxp = __commonJS({
11772
11785
  const n7 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
11773
11786
  if (!this.suppressValidationErr && !n7.includes(s6.toUpperCase())) throw new Error(`Invalid attribute type: "${s6}"`);
11774
11787
  }
11775
- e6 = P(t6, e6);
11788
+ e6 = A2(t6, e6);
11776
11789
  let r6 = "";
11777
11790
  return "#REQUIRED" === t6.substring(e6, e6 + 8).toUpperCase() ? (r6 = "#REQUIRED", e6 += 8) : "#IMPLIED" === t6.substring(e6, e6 + 7).toUpperCase() ? (r6 = "#IMPLIED", e6 += 7) : [e6, r6] = this.readIdentifierVal(t6, e6, "ATTLIST"), { elementName: n6, attributeName: i6, attributeType: s6, defaultValue: r6, index: e6 };
11778
11791
  }
11779
11792
  }
11780
- const P = (t6, e6) => {
11793
+ const A2 = (t6, e6) => {
11781
11794
  for (; e6 < t6.length && /\s/.test(t6[e6]); ) e6++;
11782
11795
  return e6;
11783
11796
  };
11784
- function A2(t6, e6, n6) {
11797
+ function S(t6, e6, n6) {
11785
11798
  for (let i6 = 0; i6 < e6.length; i6++) if (e6[i6] !== t6[n6 + i6 + 1]) return false;
11786
11799
  return true;
11787
11800
  }
11788
- function S(t6) {
11801
+ function C2(t6) {
11789
11802
  if (r5(t6)) return t6;
11790
11803
  throw new Error(`Invalid entity name ${t6}`);
11791
11804
  }
11792
- const C2 = /^[-+]?0x[a-fA-F0-9]+$/, $ = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true };
11793
- const D2 = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
11794
- function L(t6) {
11795
- return "function" == typeof t6 ? t6 : Array.isArray(t6) ? (e6) => {
11796
- for (const n6 of t6) {
11797
- if ("string" == typeof n6 && e6 === n6) return true;
11798
- if (n6 instanceof RegExp && n6.test(e6)) return true;
11799
- }
11800
- } : () => false;
11801
- }
11802
- class F2 {
11805
+ const $ = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, D2 = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true };
11806
+ const j5 = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
11807
+ class L {
11803
11808
  constructor(t6) {
11804
- if (this.options = t6, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t7, e6) => K(e6, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t7, e6) => K(e6, 16, "&#x") } }, this.addExternalEntities = j5, this.parseXml = B2, this.parseTextData = M, this.resolveNameSpace = _, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q5, this.saveTextToParentTag = G2, this.addChild = R, this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) {
11809
+ var e6;
11810
+ if (this.options = t6, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t7, e7) => K(e7, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t7, e7) => K(e7, 16, "&#x") } }, this.addExternalEntities = F2, this.parseXml = R, this.parseTextData = M, this.resolveNameSpace = k5, this.buildAttributesMap = U, this.isItStopNode = X, this.replaceEntitiesValue = Y, this.readStopNodeData = q5, this.saveTextToParentTag = G2, this.addChild = B2, this.ignoreAttributesFn = "function" == typeof (e6 = this.options.ignoreAttributes) ? e6 : Array.isArray(e6) ? (t7) => {
11811
+ for (const n6 of e6) {
11812
+ if ("string" == typeof n6 && t7 === n6) return true;
11813
+ if (n6 instanceof RegExp && n6.test(t7)) return true;
11814
+ }
11815
+ } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.options.stopNodes && this.options.stopNodes.length > 0) {
11805
11816
  this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set();
11806
11817
  for (let t7 = 0; t7 < this.options.stopNodes.length; t7++) {
11807
- const e6 = this.options.stopNodes[t7];
11808
- "string" == typeof e6 && (e6.startsWith("*.") ? this.stopNodesWildcard.add(e6.substring(2)) : this.stopNodesExact.add(e6));
11818
+ const e7 = this.options.stopNodes[t7];
11819
+ "string" == typeof e7 && (e7.startsWith("*.") ? this.stopNodesWildcard.add(e7.substring(2)) : this.stopNodesExact.add(e7));
11809
11820
  }
11810
11821
  }
11811
11822
  }
11812
11823
  }
11813
- function j5(t6) {
11824
+ function F2(t6) {
11814
11825
  const e6 = Object.keys(t6);
11815
11826
  for (let n6 = 0; n6 < e6.length; n6++) {
11816
11827
  const i6 = e6[n6], s6 = i6.replace(/[.\-+*:]/g, "\\.");
@@ -11824,7 +11835,7 @@ var require_fxp = __commonJS({
11824
11835
  return null == i7 ? t6 : typeof i7 != typeof t6 || i7 !== t6 ? i7 : this.options.trimValues || t6.trim() === t6 ? Z(t6, this.options.parseTagValue, this.options.numberParseOptions) : t6;
11825
11836
  }
11826
11837
  }
11827
- function _(t6) {
11838
+ function k5(t6) {
11828
11839
  if (this.options.removeNSPrefix) {
11829
11840
  const e6 = t6.split(":"), n6 = "/" === t6.charAt(0) ? "/" : "";
11830
11841
  if ("xmlns" === e6[0]) return "";
@@ -11832,10 +11843,10 @@ var require_fxp = __commonJS({
11832
11843
  }
11833
11844
  return t6;
11834
11845
  }
11835
- const k5 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
11846
+ const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
11836
11847
  function U(t6, e6, n6) {
11837
11848
  if (true !== this.options.ignoreAttributes && "string" == typeof t6) {
11838
- const i6 = s5(t6, k5), r6 = i6.length, o6 = {};
11849
+ const i6 = s5(t6, _), r6 = i6.length, o6 = {};
11839
11850
  for (let t7 = 0; t7 < r6; t7++) {
11840
11851
  const s6 = this.resolveNameSpace(i6[t7][1]);
11841
11852
  if (this.ignoreAttributesFn(s6, e6)) continue;
@@ -11854,12 +11865,12 @@ var require_fxp = __commonJS({
11854
11865
  return o6;
11855
11866
  }
11856
11867
  }
11857
- const B2 = function(t6) {
11868
+ const R = function(t6) {
11858
11869
  t6 = t6.replace(/\r\n?/g, "\n");
11859
11870
  const e6 = new I2("!xml");
11860
11871
  let n6 = e6, i6 = "", s6 = "";
11861
11872
  this.entityExpansionCount = 0, this.currentExpandedLength = 0;
11862
- const r6 = new O(this.options.processEntities);
11873
+ const r6 = new P(this.options.processEntities);
11863
11874
  for (let o6 = 0; o6 < t6.length; o6++) if ("<" === t6[o6]) if ("/" === t6[o6 + 1]) {
11864
11875
  const e7 = z2(t6, ">", o6, "Closing Tag is not closed.");
11865
11876
  let r7 = t6.substring(o6 + 2, e7).trim();
@@ -11899,26 +11910,27 @@ var require_fxp = __commonJS({
11899
11910
  } else {
11900
11911
  let r7 = W(t6, o6, this.options.removeNSPrefix), a6 = r7.tagName;
11901
11912
  const l6 = r7.rawTagName;
11902
- let u6 = r7.tagExp, h6 = r7.attrExpPresent, d6 = r7.closeIndex;
11913
+ let u6 = r7.tagExp, d6 = r7.attrExpPresent, h6 = r7.closeIndex;
11903
11914
  if (this.options.transformTagName) {
11904
11915
  const t7 = this.options.transformTagName(a6);
11905
11916
  u6 === a6 && (u6 = t7), a6 = t7;
11906
11917
  }
11918
+ if (this.options.strictReservedNames && (a6 === this.options.commentPropName || a6 === this.options.cdataPropName)) throw new Error(`Invalid tag name: ${a6}`);
11907
11919
  n6 && i6 && "!xml" !== n6.tagname && (i6 = this.saveTextToParentTag(i6, n6, s6, false));
11908
11920
  const p6 = n6;
11909
11921
  p6 && -1 !== this.options.unpairedTags.indexOf(p6.tagname) && (n6 = this.tagsNodeStack.pop(), s6 = s6.substring(0, s6.lastIndexOf("."))), a6 !== e6.tagname && (s6 += s6 ? "." + a6 : a6);
11910
- const f6 = o6;
11922
+ const c6 = o6;
11911
11923
  if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s6, a6)) {
11912
11924
  let e7 = "";
11913
11925
  if (u6.length > 0 && u6.lastIndexOf("/") === u6.length - 1) "/" === a6[a6.length - 1] ? (a6 = a6.substr(0, a6.length - 1), s6 = s6.substr(0, s6.length - 1), u6 = a6) : u6 = u6.substr(0, u6.length - 1), o6 = r7.closeIndex;
11914
11926
  else if (-1 !== this.options.unpairedTags.indexOf(a6)) o6 = r7.closeIndex;
11915
11927
  else {
11916
- const n7 = this.readStopNodeData(t6, l6, d6 + 1);
11928
+ const n7 = this.readStopNodeData(t6, l6, h6 + 1);
11917
11929
  if (!n7) throw new Error(`Unexpected end of ${l6}`);
11918
11930
  o6 = n7.i, e7 = n7.tagContent;
11919
11931
  }
11920
11932
  const i7 = new I2(a6);
11921
- a6 !== u6 && h6 && (i7[":@"] = this.buildAttributesMap(u6, s6, a6)), e7 && (e7 = this.parseTextData(e7, a6, s6, true, h6, true, true)), s6 = s6.substr(0, s6.lastIndexOf(".")), i7.add(this.options.textNodeName, e7), this.addChild(n6, i7, s6, f6);
11933
+ a6 !== u6 && d6 && (i7[":@"] = this.buildAttributesMap(u6, s6, a6)), e7 && (e7 = this.parseTextData(e7, a6, s6, true, d6, true, true)), s6 = s6.substr(0, s6.lastIndexOf(".")), i7.add(this.options.textNodeName, e7), this.addChild(n6, i7, s6, c6);
11922
11934
  } else {
11923
11935
  if (u6.length > 0 && u6.lastIndexOf("/") === u6.length - 1) {
11924
11936
  if ("/" === a6[a6.length - 1] ? (a6 = a6.substr(0, a6.length - 1), s6 = s6.substr(0, s6.length - 1), u6 = a6) : u6 = u6.substr(0, u6.length - 1), this.options.transformTagName) {
@@ -11926,18 +11938,26 @@ var require_fxp = __commonJS({
11926
11938
  u6 === a6 && (u6 = t8), a6 = t8;
11927
11939
  }
11928
11940
  const t7 = new I2(a6);
11929
- a6 !== u6 && h6 && (t7[":@"] = this.buildAttributesMap(u6, s6, a6)), this.addChild(n6, t7, s6, f6), s6 = s6.substr(0, s6.lastIndexOf("."));
11941
+ a6 !== u6 && d6 && (t7[":@"] = this.buildAttributesMap(u6, s6, a6)), this.addChild(n6, t7, s6, c6), s6 = s6.substr(0, s6.lastIndexOf("."));
11930
11942
  } else {
11931
- const t7 = new I2(a6);
11932
- this.tagsNodeStack.push(n6), a6 !== u6 && h6 && (t7[":@"] = this.buildAttributesMap(u6, s6, a6)), this.addChild(n6, t7, s6, f6), n6 = t7;
11943
+ if (-1 !== this.options.unpairedTags.indexOf(a6)) {
11944
+ const t7 = new I2(a6);
11945
+ a6 !== u6 && d6 && (t7[":@"] = this.buildAttributesMap(u6, s6)), this.addChild(n6, t7, s6, c6), s6 = s6.substr(0, s6.lastIndexOf(".")), o6 = r7.closeIndex;
11946
+ continue;
11947
+ }
11948
+ {
11949
+ const t7 = new I2(a6);
11950
+ if (this.tagsNodeStack.length > this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded");
11951
+ this.tagsNodeStack.push(n6), a6 !== u6 && d6 && (t7[":@"] = this.buildAttributesMap(u6, s6, a6)), this.addChild(n6, t7, s6, c6), n6 = t7;
11952
+ }
11933
11953
  }
11934
- i6 = "", o6 = d6;
11954
+ i6 = "", o6 = h6;
11935
11955
  }
11936
11956
  }
11937
11957
  else i6 += t6[o6];
11938
11958
  return e6.child;
11939
11959
  };
11940
- function R(t6, e6, n6, i6) {
11960
+ function B2(t6, e6, n6, i6) {
11941
11961
  this.options.captureMetaData || (i6 = void 0);
11942
11962
  const s6 = this.options.updateTag(e6.tagname, n6, e6[":@"]);
11943
11963
  false === s6 || ("string" == typeof s6 ? (e6.tagname = s6, t6.addChild(e6, i6)) : t6.addChild(e6, i6));
@@ -11998,12 +12018,12 @@ var require_fxp = __commonJS({
11998
12018
  const o6 = s6.index, a6 = r6.search(/\s/);
11999
12019
  let l6 = r6, u6 = true;
12000
12020
  -1 !== a6 && (l6 = r6.substring(0, a6), r6 = r6.substring(a6 + 1).trimStart());
12001
- const h6 = l6;
12021
+ const d6 = l6;
12002
12022
  if (n6) {
12003
12023
  const t7 = l6.indexOf(":");
12004
12024
  -1 !== t7 && (l6 = l6.substr(t7 + 1), u6 = l6 !== s6.data.substr(t7 + 1));
12005
12025
  }
12006
- return { tagName: l6, tagExp: r6, closeIndex: o6, attrExpPresent: u6, rawTagName: h6 };
12026
+ return { tagName: l6, tagExp: r6, closeIndex: o6, attrExpPresent: u6, rawTagName: d6 };
12007
12027
  }
12008
12028
  function q5(t6, e6, n6) {
12009
12029
  const i6 = n6;
@@ -12024,19 +12044,19 @@ var require_fxp = __commonJS({
12024
12044
  if (e6 && "string" == typeof t6) {
12025
12045
  const e7 = t6.trim();
12026
12046
  return "true" === e7 || "false" !== e7 && function(t7, e8 = {}) {
12027
- if (e8 = Object.assign({}, V, e8), !t7 || "string" != typeof t7) return t7;
12047
+ if (e8 = Object.assign({}, D2, e8), !t7 || "string" != typeof t7) return t7;
12028
12048
  let n7 = t7.trim();
12029
12049
  if (void 0 !== e8.skipLike && e8.skipLike.test(n7)) return t7;
12030
12050
  if ("0" === t7) return 0;
12031
- if (e8.hex && C2.test(n7)) return function(t8) {
12051
+ if (e8.hex && $.test(n7)) return function(t8) {
12032
12052
  if (parseInt) return parseInt(t8, 16);
12033
12053
  if (Number.parseInt) return Number.parseInt(t8, 16);
12034
12054
  if (window && window.parseInt) return window.parseInt(t8, 16);
12035
12055
  throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
12036
12056
  }(n7);
12037
- if (-1 !== n7.search(/.+[eE].+/)) return function(t8, e9, n8) {
12057
+ if (n7.includes("e") || n7.includes("E")) return function(t8, e9, n8) {
12038
12058
  if (!n8.eNotation) return t8;
12039
- const i7 = e9.match(D2);
12059
+ const i7 = e9.match(j5);
12040
12060
  if (i7) {
12041
12061
  let s6 = i7[1] || "";
12042
12062
  const r6 = -1 === i7[3].indexOf("e") ? "E" : "e", o6 = i7[2], a6 = s6 ? t8[o6.length + 1] === r6 : t8[o6.length] === r6;
@@ -12045,7 +12065,7 @@ var require_fxp = __commonJS({
12045
12065
  return t8;
12046
12066
  }(t7, n7, e8);
12047
12067
  {
12048
- const s6 = $.exec(n7);
12068
+ const s6 = V.exec(n7);
12049
12069
  if (s6) {
12050
12070
  const r6 = s6[1] || "", o6 = s6[2];
12051
12071
  let a6 = (i6 = s6[3]) && -1 !== i6.indexOf(".") ? ("." === (i6 = i6.replace(/0+$/, "")) ? i6 = "0" : "." === i6[0] ? i6 = "0" + i6 : "." === i6[i6.length - 1] && (i6 = i6.substring(0, i6.length - 1)), i6) : i6;
@@ -12053,7 +12073,7 @@ var require_fxp = __commonJS({
12053
12073
  if (!e8.leadingZeros && (o6.length > 1 || 1 === o6.length && !l6)) return t7;
12054
12074
  {
12055
12075
  const i7 = Number(n7), s7 = String(i7);
12056
- if (0 === i7 || -0 === i7) return i7;
12076
+ if (0 === i7) return i7;
12057
12077
  if (-1 !== s7.search(/[eE]/)) return e8.eNotation ? i7 : t7;
12058
12078
  if (-1 !== n7.indexOf(".")) return "0" === s7 || s7 === a6 || s7 === `${r6}${a6}` ? i7 : t7;
12059
12079
  let l7 = o6 ? a6 : n7;
@@ -12087,7 +12107,7 @@ var require_fxp = __commonJS({
12087
12107
  if (o6[a6]) {
12088
12108
  let t7 = H2(o6[a6], e6, l6);
12089
12109
  const n7 = nt(t7, e6);
12090
- void 0 !== o6[Q] && (t7[Q] = o6[Q]), o6[":@"] ? et(t7, o6[":@"], l6, e6) : 1 !== Object.keys(t7).length || void 0 === t7[e6.textNodeName] || e6.alwaysCreateTextNode ? 0 === Object.keys(t7).length && (e6.alwaysCreateTextNode ? t7[e6.textNodeName] = "" : t7 = "") : t7 = t7[e6.textNodeName], void 0 !== s6[a6] && s6.hasOwnProperty(a6) ? (Array.isArray(s6[a6]) || (s6[a6] = [s6[a6]]), s6[a6].push(t7)) : e6.isArray(a6, l6, n7) ? s6[a6] = [t7] : s6[a6] = t7;
12110
+ o6[":@"] ? et(t7, o6[":@"], l6, e6) : 1 !== Object.keys(t7).length || void 0 === t7[e6.textNodeName] || e6.alwaysCreateTextNode ? 0 === Object.keys(t7).length && (e6.alwaysCreateTextNode ? t7[e6.textNodeName] = "" : t7 = "") : t7 = t7[e6.textNodeName], void 0 !== o6[Q] && "object" == typeof t7 && null !== t7 && (t7[Q] = o6[Q]), void 0 !== s6[a6] && Object.prototype.hasOwnProperty.call(s6, a6) ? (Array.isArray(s6[a6]) || (s6[a6] = [s6[a6]]), s6[a6].push(t7)) : e6.isArray(a6, l6, n7) ? s6[a6] = [t7] : s6[a6] = t7;
12091
12111
  }
12092
12112
  }
12093
12113
  }
@@ -12115,7 +12135,7 @@ var require_fxp = __commonJS({
12115
12135
  }
12116
12136
  class it {
12117
12137
  constructor(t6) {
12118
- this.externalEntities = {}, this.options = w5(t6);
12138
+ this.externalEntities = {}, this.options = v5(t6);
12119
12139
  }
12120
12140
  parse(t6, e6) {
12121
12141
  if ("string" != typeof t6 && t6.toString) t6 = t6.toString();
@@ -12125,7 +12145,7 @@ var require_fxp = __commonJS({
12125
12145
  const n7 = a5(t6, e6);
12126
12146
  if (true !== n7) throw Error(`${n7.err.msg}:${n7.err.line}:${n7.err.col}`);
12127
12147
  }
12128
- const n6 = new F2(this.options);
12148
+ const n6 = new L(this.options);
12129
12149
  n6.addExternalEntities(this.externalEntities);
12130
12150
  const i6 = n6.parseXml(t6);
12131
12151
  return this.options.preserveOrder || void 0 === i6 ? i6 : J2(i6, this.options);
@@ -12146,6 +12166,13 @@ var require_fxp = __commonJS({
12146
12166
  }
12147
12167
  function rt(t6, e6, n6, i6) {
12148
12168
  let s6 = "", r6 = false;
12169
+ if (!Array.isArray(t6)) {
12170
+ if (null != t6) {
12171
+ let n7 = t6.toString();
12172
+ return n7 = ut(n7, e6), n7;
12173
+ }
12174
+ return "";
12175
+ }
12149
12176
  for (let o6 = 0; o6 < t6.length; o6++) {
12150
12177
  const a6 = t6[o6], l6 = ot(a6);
12151
12178
  if (void 0 === l6) continue;
@@ -12169,10 +12196,10 @@ var require_fxp = __commonJS({
12169
12196
  o7 = 0 !== o7.length ? " " + o7 : "", s6 += n7 + `<${l6}${o7}${t7}?>`, r6 = true;
12170
12197
  continue;
12171
12198
  }
12172
- let h6 = i6;
12173
- "" !== h6 && (h6 += e6.indentBy);
12174
- const d6 = i6 + `<${l6}${at(a6[":@"], e6)}`, p6 = rt(a6[l6], e6, u6, h6);
12175
- -1 !== e6.unpairedTags.indexOf(l6) ? e6.suppressUnpairedNode ? s6 += d6 + ">" : s6 += d6 + "/>" : p6 && 0 !== p6.length || !e6.suppressEmptyNode ? p6 && p6.endsWith(">") ? s6 += d6 + `>${p6}${i6}</${l6}>` : (s6 += d6 + ">", p6 && "" !== i6 && (p6.includes("/>") || p6.includes("</")) ? s6 += i6 + e6.indentBy + p6 + i6 : s6 += p6, s6 += `</${l6}>`) : s6 += d6 + "/>", r6 = true;
12199
+ let d6 = i6;
12200
+ "" !== d6 && (d6 += e6.indentBy);
12201
+ const h6 = i6 + `<${l6}${at(a6[":@"], e6)}`, p6 = rt(a6[l6], e6, u6, d6);
12202
+ -1 !== e6.unpairedTags.indexOf(l6) ? e6.suppressUnpairedNode ? s6 += h6 + ">" : s6 += h6 + "/>" : p6 && 0 !== p6.length || !e6.suppressEmptyNode ? p6 && p6.endsWith(">") ? s6 += h6 + `>${p6}${i6}</${l6}>` : (s6 += h6 + ">", p6 && "" !== i6 && (p6.includes("/>") || p6.includes("</")) ? s6 += i6 + e6.indentBy + p6 + i6 : s6 += p6, s6 += `</${l6}>`) : s6 += h6 + "/>", r6 = true;
12176
12203
  }
12177
12204
  return s6;
12178
12205
  }
@@ -12180,13 +12207,13 @@ var require_fxp = __commonJS({
12180
12207
  const e6 = Object.keys(t6);
12181
12208
  for (let n6 = 0; n6 < e6.length; n6++) {
12182
12209
  const i6 = e6[n6];
12183
- if (t6.hasOwnProperty(i6) && ":@" !== i6) return i6;
12210
+ if (Object.prototype.hasOwnProperty.call(t6, i6) && ":@" !== i6) return i6;
12184
12211
  }
12185
12212
  }
12186
12213
  function at(t6, e6) {
12187
12214
  let n6 = "";
12188
12215
  if (t6 && !e6.ignoreAttributes) for (let i6 in t6) {
12189
- if (!t6.hasOwnProperty(i6)) continue;
12216
+ if (!Object.prototype.hasOwnProperty.call(t6, i6)) continue;
12190
12217
  let s6 = e6.attributeValueProcessor(i6, t6[i6]);
12191
12218
  s6 = ut(s6, e6), true === s6 && e6.suppressBooleanAttributes ? n6 += ` ${i6.substr(e6.attributeNamePrefix.length)}` : n6 += ` ${i6.substr(e6.attributeNamePrefix.length)}="${s6}"`;
12192
12219
  }
@@ -12204,15 +12231,21 @@ var require_fxp = __commonJS({
12204
12231
  }
12205
12232
  return t6;
12206
12233
  }
12207
- const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t6, e6) {
12234
+ const dt = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t6, e6) {
12208
12235
  return e6;
12209
12236
  }, attributeValueProcessor: function(t6, e6) {
12210
12237
  return e6;
12211
12238
  }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&amp;" }, { regex: new RegExp(">", "g"), val: "&gt;" }, { regex: new RegExp("<", "g"), val: "&lt;" }, { regex: new RegExp("'", "g"), val: "&apos;" }, { regex: new RegExp('"', "g"), val: "&quot;" }], processEntities: true, stopNodes: [], oneListGroup: false };
12212
- function dt(t6) {
12213
- this.options = Object.assign({}, ht, t6), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
12239
+ function ht(t6) {
12240
+ var e6;
12241
+ this.options = Object.assign({}, dt, t6), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
12214
12242
  return false;
12215
- } : (this.ignoreAttributesFn = L(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ct), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ft, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
12243
+ } : (this.ignoreAttributesFn = "function" == typeof (e6 = this.options.ignoreAttributes) ? e6 : Array.isArray(e6) ? (t7) => {
12244
+ for (const n6 of e6) {
12245
+ if ("string" == typeof n6 && t7 === n6) return true;
12246
+ if (n6 instanceof RegExp && n6.test(t7)) return true;
12247
+ }
12248
+ } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = pt, this.options.format ? (this.indentate = ct, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
12216
12249
  return "";
12217
12250
  }, this.tagEndChar = ">", this.newLine = "");
12218
12251
  }
@@ -12220,15 +12253,15 @@ var require_fxp = __commonJS({
12220
12253
  const s6 = this.j2x(t6, n6 + 1, i6.concat(e6));
12221
12254
  return void 0 !== t6[this.options.textNodeName] && 1 === Object.keys(t6).length ? this.buildTextValNode(t6[this.options.textNodeName], e6, s6.attrStr, n6) : this.buildObjectNode(s6.val, e6, s6.attrStr, n6);
12222
12255
  }
12223
- function ft(t6) {
12256
+ function ct(t6) {
12224
12257
  return this.options.indentBy.repeat(t6);
12225
12258
  }
12226
- function ct(t6) {
12259
+ function ft(t6) {
12227
12260
  return !(!t6.startsWith(this.options.attributeNamePrefix) || t6 === this.options.textNodeName) && t6.substr(this.attrPrefixLen);
12228
12261
  }
12229
- dt.prototype.build = function(t6) {
12262
+ ht.prototype.build = function(t6) {
12230
12263
  return this.options.preserveOrder ? st(t6, this.options) : (Array.isArray(t6) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t6 = { [this.options.arrayNodeName]: t6 }), this.j2x(t6, 0, []).val);
12231
- }, dt.prototype.j2x = function(t6, e6, n6) {
12264
+ }, ht.prototype.j2x = function(t6, e6, n6) {
12232
12265
  let i6 = "", s6 = "";
12233
12266
  const r6 = n6.join(".");
12234
12267
  for (let o6 in t6) if (Object.prototype.hasOwnProperty.call(t6, o6)) if (void 0 === t6[o6]) this.isAttribute(o6) && (s6 += "");
@@ -12263,18 +12296,18 @@ var require_fxp = __commonJS({
12263
12296
  for (let s7 = 0; s7 < n7; s7++) i6 += this.buildAttrPairStr(e7[s7], "" + t6[o6][e7[s7]]);
12264
12297
  } else s6 += this.processTextOrObjNode(t6[o6], o6, e6, n6);
12265
12298
  return { attrStr: i6, val: s6 };
12266
- }, dt.prototype.buildAttrPairStr = function(t6, e6) {
12299
+ }, ht.prototype.buildAttrPairStr = function(t6, e6) {
12267
12300
  return e6 = this.options.attributeValueProcessor(t6, "" + e6), e6 = this.replaceEntitiesValue(e6), this.options.suppressBooleanAttributes && "true" === e6 ? " " + t6 : " " + t6 + '="' + e6 + '"';
12268
- }, dt.prototype.buildObjectNode = function(t6, e6, n6, i6) {
12301
+ }, ht.prototype.buildObjectNode = function(t6, e6, n6, i6) {
12269
12302
  if ("" === t6) return "?" === e6[0] ? this.indentate(i6) + "<" + e6 + n6 + "?" + this.tagEndChar : this.indentate(i6) + "<" + e6 + n6 + this.closeTag(e6) + this.tagEndChar;
12270
12303
  {
12271
12304
  let s6 = "</" + e6 + this.tagEndChar, r6 = "";
12272
12305
  return "?" === e6[0] && (r6 = "?", s6 = ""), !n6 && "" !== n6 || -1 !== t6.indexOf("<") ? false !== this.options.commentPropName && e6 === this.options.commentPropName && 0 === r6.length ? this.indentate(i6) + `<!--${t6}-->` + this.newLine : this.indentate(i6) + "<" + e6 + n6 + r6 + this.tagEndChar + t6 + this.indentate(i6) + s6 : this.indentate(i6) + "<" + e6 + n6 + r6 + ">" + t6 + s6;
12273
12306
  }
12274
- }, dt.prototype.closeTag = function(t6) {
12307
+ }, ht.prototype.closeTag = function(t6) {
12275
12308
  let e6 = "";
12276
12309
  return -1 !== this.options.unpairedTags.indexOf(t6) ? this.options.suppressUnpairedNode || (e6 = "/") : e6 = this.options.suppressEmptyNode ? "/" : `></${t6}`, e6;
12277
- }, dt.prototype.buildTextValNode = function(t6, e6, n6, i6) {
12310
+ }, ht.prototype.buildTextValNode = function(t6, e6, n6, i6) {
12278
12311
  if (false !== this.options.cdataPropName && e6 === this.options.cdataPropName) return this.indentate(i6) + `<![CDATA[${t6}]]>` + this.newLine;
12279
12312
  if (false !== this.options.commentPropName && e6 === this.options.commentPropName) return this.indentate(i6) + `<!--${t6}-->` + this.newLine;
12280
12313
  if ("?" === e6[0]) return this.indentate(i6) + "<" + e6 + n6 + "?" + this.tagEndChar;
@@ -12282,14 +12315,14 @@ var require_fxp = __commonJS({
12282
12315
  let s6 = this.options.tagValueProcessor(e6, t6);
12283
12316
  return s6 = this.replaceEntitiesValue(s6), "" === s6 ? this.indentate(i6) + "<" + e6 + n6 + this.closeTag(e6) + this.tagEndChar : this.indentate(i6) + "<" + e6 + n6 + ">" + s6 + "</" + e6 + this.tagEndChar;
12284
12317
  }
12285
- }, dt.prototype.replaceEntitiesValue = function(t6) {
12318
+ }, ht.prototype.replaceEntitiesValue = function(t6) {
12286
12319
  if (t6 && t6.length > 0 && this.options.processEntities) for (let e6 = 0; e6 < this.options.entities.length; e6++) {
12287
12320
  const n6 = this.options.entities[e6];
12288
12321
  t6 = t6.replace(n6.regex, n6.val);
12289
12322
  }
12290
12323
  return t6;
12291
12324
  };
12292
- const gt = { validate: a5 };
12325
+ const gt = ht, xt = { validate: a5 };
12293
12326
  module2.exports = e5;
12294
12327
  })();
12295
12328
  }
@@ -12309,7 +12342,8 @@ var require_xml_parser = __commonJS({
12309
12342
  ignoreDeclaration: true,
12310
12343
  parseTagValue: false,
12311
12344
  trimValues: false,
12312
- tagValueProcessor: (_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0
12345
+ tagValueProcessor: (_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0,
12346
+ maxNestedTags: 1024
12313
12347
  });
12314
12348
  parser.addEntity("#xD", "\r");
12315
12349
  parser.addEntity("#10", "\n");
@@ -12489,18 +12523,18 @@ var init_XmlShapeDeserializer = __esm({
12489
12523
  return value;
12490
12524
  }
12491
12525
  if (typeof value === "object") {
12492
- const sparse = !!traits.sparse;
12493
12526
  const flat = !!traits.xmlFlattened;
12494
12527
  if (ns.isListSchema()) {
12495
12528
  const listValue = ns.getValueSchema();
12496
12529
  const buffer2 = [];
12497
12530
  const sourceKey = listValue.getMergedTraits().xmlName ?? "member";
12498
12531
  const source = flat ? value : (value[0] ?? value)[sourceKey];
12532
+ if (source == null) {
12533
+ return buffer2;
12534
+ }
12499
12535
  const sourceArray = Array.isArray(source) ? source : [source];
12500
12536
  for (const v5 of sourceArray) {
12501
- if (v5 != null || sparse) {
12502
- buffer2.push(this.readSchema(listValue, v5));
12503
- }
12537
+ buffer2.push(this.readSchema(listValue, v5));
12504
12538
  }
12505
12539
  return buffer2;
12506
12540
  }
@@ -12519,9 +12553,7 @@ var init_XmlShapeDeserializer = __esm({
12519
12553
  for (const entry of entries) {
12520
12554
  const key = entry[keyProperty];
12521
12555
  const value2 = entry[valueProperty];
12522
- if (value2 != null || sparse) {
12523
- buffer[key] = this.readSchema(memberNs, value2);
12524
- }
12556
+ buffer[key] = this.readSchema(memberNs, value2);
12525
12557
  }
12526
12558
  return buffer;
12527
12559
  }
@@ -15278,7 +15310,7 @@ var require_package = __commonJS({
15278
15310
  module2.exports = {
15279
15311
  name: "@aws-sdk/client-codedeploy",
15280
15312
  description: "AWS SDK for JavaScript Codedeploy Client for Node.js, Browser and React Native",
15281
- version: "3.1000.0",
15313
+ version: "3.1002.0",
15282
15314
  scripts: {
15283
15315
  build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
15284
15316
  "build:cjs": "node ../../scripts/compilation/inline client-codedeploy",
@@ -15300,38 +15332,38 @@ var require_package = __commonJS({
15300
15332
  dependencies: {
15301
15333
  "@aws-crypto/sha256-browser": "5.2.0",
15302
15334
  "@aws-crypto/sha256-js": "5.2.0",
15303
- "@aws-sdk/core": "^3.973.15",
15304
- "@aws-sdk/credential-provider-node": "^3.972.14",
15335
+ "@aws-sdk/core": "^3.973.17",
15336
+ "@aws-sdk/credential-provider-node": "^3.972.16",
15305
15337
  "@aws-sdk/middleware-host-header": "^3.972.6",
15306
15338
  "@aws-sdk/middleware-logger": "^3.972.6",
15307
15339
  "@aws-sdk/middleware-recursion-detection": "^3.972.6",
15308
- "@aws-sdk/middleware-user-agent": "^3.972.15",
15340
+ "@aws-sdk/middleware-user-agent": "^3.972.17",
15309
15341
  "@aws-sdk/region-config-resolver": "^3.972.6",
15310
15342
  "@aws-sdk/types": "^3.973.4",
15311
15343
  "@aws-sdk/util-endpoints": "^3.996.3",
15312
15344
  "@aws-sdk/util-user-agent-browser": "^3.972.6",
15313
- "@aws-sdk/util-user-agent-node": "^3.973.0",
15345
+ "@aws-sdk/util-user-agent-node": "^3.973.2",
15314
15346
  "@smithy/config-resolver": "^4.4.9",
15315
- "@smithy/core": "^3.23.6",
15316
- "@smithy/fetch-http-handler": "^5.3.11",
15347
+ "@smithy/core": "^3.23.7",
15348
+ "@smithy/fetch-http-handler": "^5.3.12",
15317
15349
  "@smithy/hash-node": "^4.2.10",
15318
15350
  "@smithy/invalid-dependency": "^4.2.10",
15319
15351
  "@smithy/middleware-content-length": "^4.2.10",
15320
- "@smithy/middleware-endpoint": "^4.4.20",
15321
- "@smithy/middleware-retry": "^4.4.37",
15352
+ "@smithy/middleware-endpoint": "^4.4.21",
15353
+ "@smithy/middleware-retry": "^4.4.38",
15322
15354
  "@smithy/middleware-serde": "^4.2.11",
15323
15355
  "@smithy/middleware-stack": "^4.2.10",
15324
15356
  "@smithy/node-config-provider": "^4.3.10",
15325
- "@smithy/node-http-handler": "^4.4.12",
15357
+ "@smithy/node-http-handler": "^4.4.13",
15326
15358
  "@smithy/protocol-http": "^5.3.10",
15327
- "@smithy/smithy-client": "^4.12.0",
15359
+ "@smithy/smithy-client": "^4.12.1",
15328
15360
  "@smithy/types": "^4.13.0",
15329
15361
  "@smithy/url-parser": "^4.2.10",
15330
15362
  "@smithy/util-base64": "^4.3.1",
15331
15363
  "@smithy/util-body-length-browser": "^4.2.1",
15332
15364
  "@smithy/util-body-length-node": "^4.2.2",
15333
- "@smithy/util-defaults-mode-browser": "^4.3.36",
15334
- "@smithy/util-defaults-mode-node": "^4.2.39",
15365
+ "@smithy/util-defaults-mode-browser": "^4.3.37",
15366
+ "@smithy/util-defaults-mode-node": "^4.2.40",
15335
15367
  "@smithy/util-endpoints": "^3.3.1",
15336
15368
  "@smithy/util-middleware": "^4.2.10",
15337
15369
  "@smithy/util-retry": "^4.2.10",
@@ -16056,7 +16088,7 @@ var init_package = __esm({
16056
16088
  "node_modules/@aws-sdk/nested-clients/package.json"() {
16057
16089
  package_default = {
16058
16090
  name: "@aws-sdk/nested-clients",
16059
- version: "3.996.3",
16091
+ version: "3.996.5",
16060
16092
  description: "Nested clients for AWS SDK packages.",
16061
16093
  main: "./dist-cjs/index.js",
16062
16094
  module: "./dist-es/index.js",
@@ -16085,37 +16117,37 @@ var init_package = __esm({
16085
16117
  dependencies: {
16086
16118
  "@aws-crypto/sha256-browser": "5.2.0",
16087
16119
  "@aws-crypto/sha256-js": "5.2.0",
16088
- "@aws-sdk/core": "^3.973.15",
16120
+ "@aws-sdk/core": "^3.973.17",
16089
16121
  "@aws-sdk/middleware-host-header": "^3.972.6",
16090
16122
  "@aws-sdk/middleware-logger": "^3.972.6",
16091
16123
  "@aws-sdk/middleware-recursion-detection": "^3.972.6",
16092
- "@aws-sdk/middleware-user-agent": "^3.972.15",
16124
+ "@aws-sdk/middleware-user-agent": "^3.972.17",
16093
16125
  "@aws-sdk/region-config-resolver": "^3.972.6",
16094
16126
  "@aws-sdk/types": "^3.973.4",
16095
16127
  "@aws-sdk/util-endpoints": "^3.996.3",
16096
16128
  "@aws-sdk/util-user-agent-browser": "^3.972.6",
16097
- "@aws-sdk/util-user-agent-node": "^3.973.0",
16129
+ "@aws-sdk/util-user-agent-node": "^3.973.2",
16098
16130
  "@smithy/config-resolver": "^4.4.9",
16099
- "@smithy/core": "^3.23.6",
16100
- "@smithy/fetch-http-handler": "^5.3.11",
16131
+ "@smithy/core": "^3.23.7",
16132
+ "@smithy/fetch-http-handler": "^5.3.12",
16101
16133
  "@smithy/hash-node": "^4.2.10",
16102
16134
  "@smithy/invalid-dependency": "^4.2.10",
16103
16135
  "@smithy/middleware-content-length": "^4.2.10",
16104
- "@smithy/middleware-endpoint": "^4.4.20",
16105
- "@smithy/middleware-retry": "^4.4.37",
16136
+ "@smithy/middleware-endpoint": "^4.4.21",
16137
+ "@smithy/middleware-retry": "^4.4.38",
16106
16138
  "@smithy/middleware-serde": "^4.2.11",
16107
16139
  "@smithy/middleware-stack": "^4.2.10",
16108
16140
  "@smithy/node-config-provider": "^4.3.10",
16109
- "@smithy/node-http-handler": "^4.4.12",
16141
+ "@smithy/node-http-handler": "^4.4.13",
16110
16142
  "@smithy/protocol-http": "^5.3.10",
16111
- "@smithy/smithy-client": "^4.12.0",
16143
+ "@smithy/smithy-client": "^4.12.1",
16112
16144
  "@smithy/types": "^4.13.0",
16113
16145
  "@smithy/url-parser": "^4.2.10",
16114
16146
  "@smithy/util-base64": "^4.3.1",
16115
16147
  "@smithy/util-body-length-browser": "^4.2.1",
16116
16148
  "@smithy/util-body-length-node": "^4.2.2",
16117
- "@smithy/util-defaults-mode-browser": "^4.3.36",
16118
- "@smithy/util-defaults-mode-node": "^4.2.39",
16149
+ "@smithy/util-defaults-mode-browser": "^4.3.37",
16150
+ "@smithy/util-defaults-mode-node": "^4.2.40",
16119
16151
  "@smithy/util-endpoints": "^3.3.1",
16120
16152
  "@smithy/util-middleware": "^4.2.10",
16121
16153
  "@smithy/util-retry": "^4.2.10",
@@ -16220,17 +16252,30 @@ var require_dist_cjs41 = __commonJS({
16220
16252
  }
16221
16253
  return ["md/nodejs", node_process.versions.node];
16222
16254
  };
16223
- var getTypeScriptPackageJsonPath = (dirname = "") => {
16224
- let nodeModulesPath;
16255
+ var SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
16256
+ var getSanitizedTypeScriptVersion = (version = "") => {
16257
+ const match = version.match(SEMVER_REGEX);
16258
+ if (!match) {
16259
+ return void 0;
16260
+ }
16261
+ const [major, minor, patch, prerelease] = [match[1], match[2], match[3], match[4]];
16262
+ return prerelease ? `${major}.${minor}.${patch}-${prerelease}` : `${major}.${minor}.${patch}`;
16263
+ };
16264
+ var typescriptPackageJsonPath = node_path.join("node_modules", "typescript", "package.json");
16265
+ var getTypeScriptPackageJsonPaths = (dirname) => {
16266
+ const cwdPath = node_path.join(process.cwd(), typescriptPackageJsonPath);
16267
+ if (!dirname) {
16268
+ return [cwdPath];
16269
+ }
16225
16270
  const normalizedPath = node_path.normalize(dirname);
16226
16271
  const parts = normalizedPath.split(node_path.sep);
16227
16272
  const nodeModulesIndex = parts.indexOf("node_modules");
16228
- if (nodeModulesIndex !== -1) {
16229
- nodeModulesPath = parts.slice(0, nodeModulesIndex).join(node_path.sep);
16230
- } else {
16231
- nodeModulesPath = dirname;
16273
+ const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(node_path.sep) : dirname;
16274
+ const parentDirPath = node_path.join(parentDir, typescriptPackageJsonPath);
16275
+ if (cwdPath === parentDirPath) {
16276
+ return [cwdPath];
16232
16277
  }
16233
- return node_path.join(nodeModulesPath, "node_modules", "typescript", "package.json");
16278
+ return [parentDirPath, cwdPath];
16234
16279
  };
16235
16280
  var tscVersion;
16236
16281
  var getTypeScriptUserAgentPair = async () => {
@@ -16239,18 +16284,22 @@ var require_dist_cjs41 = __commonJS({
16239
16284
  } else if (typeof tscVersion === "string") {
16240
16285
  return ["md/tsc", tscVersion];
16241
16286
  }
16242
- try {
16243
- const packageJson = await promises.readFile(getTypeScriptPackageJsonPath(__dirname), "utf-8");
16244
- const { version } = JSON.parse(packageJson);
16245
- if (typeof version !== "string") {
16246
- tscVersion = null;
16247
- return void 0;
16287
+ const dirname = typeof __dirname !== "undefined" ? __dirname : void 0;
16288
+ for (const typescriptPackageJsonPath2 of getTypeScriptPackageJsonPaths(dirname)) {
16289
+ try {
16290
+ const packageJson = await promises.readFile(typescriptPackageJsonPath2, "utf-8");
16291
+ const { version } = JSON.parse(packageJson);
16292
+ const sanitizedVersion = getSanitizedTypeScriptVersion(version);
16293
+ if (typeof sanitizedVersion !== "string") {
16294
+ continue;
16295
+ }
16296
+ tscVersion = sanitizedVersion;
16297
+ return ["md/tsc", tscVersion];
16298
+ } catch {
16248
16299
  }
16249
- tscVersion = version;
16250
- return ["md/tsc", tscVersion];
16251
- } catch {
16252
- tscVersion = null;
16253
16300
  }
16301
+ tscVersion = null;
16302
+ return void 0;
16254
16303
  };
16255
16304
  var crtAvailability = {
16256
16305
  isCrtAvailable: false