replicas-engine 0.1.144 → 0.1.146
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.
- package/dist/src/{chunk-XCFRYWEV.js → chunk-2Y7PD56W.js} +12 -12
- package/dist/src/{chunk-JFXVYYQY.js → chunk-5VUQ55WW.js} +19 -19
- package/dist/src/{chunk-NPXMDMPW.js → chunk-AAVVX4U5.js} +6 -6
- package/dist/src/{chunk-J3WZZOOL.js → chunk-BUG7ZAQW.js} +72 -355
- package/dist/src/{chunk-TY2FR253.js → chunk-SGITM26Q.js} +309 -22
- package/dist/src/{chunk-YDW6RZI2.js → chunk-ST5JVROM.js} +2 -2
- package/dist/src/{chunk-WCAERHFE.js → chunk-SWX24AGM.js} +1 -1
- package/dist/src/{chunk-7RS3TOFT.js → chunk-TU2SAX7Z.js} +1072 -1228
- package/dist/src/{chunk-MCYTXPBZ.js → chunk-WPAL27HA.js} +2 -2
- package/dist/src/{chunk-N2BGF5AZ.js → chunk-ZNARSMJG.js} +1 -1
- package/dist/src/{dist-es-UV765YRF.js → dist-es-BUG4C6LP.js} +18 -18
- package/dist/src/{dist-es-3LYC7DO3.js → dist-es-F6RG3S4O.js} +12 -14
- package/dist/src/{dist-es-KHBICPEM.js → dist-es-GGHPJZ3K.js} +19 -19
- package/dist/src/{dist-es-7DTYZ3KD.js → dist-es-GZBSW2H3.js} +27 -27
- package/dist/src/{dist-es-YWO2URNL.js → dist-es-JIV2SPEM.js} +7 -7
- package/dist/src/{dist-es-BNJQGHZR.js → dist-es-Q3YZVSCP.js} +7 -7
- package/dist/src/{dist-es-EVINFDC2.js → dist-es-YKS4LXBO.js} +3 -3
- package/dist/src/index.js +480 -510
- package/dist/src/{loadSso-ZRFAKENS.js → loadSso-3WFGTQV7.js} +109 -148
- package/dist/src/{signin-PNR24U2H.js → signin-RSKKVVIS.js} +123 -177
- package/dist/src/{sso-oidc-O55BGCVQ.js → sso-oidc-LBVW2ORP.js} +111 -150
- package/dist/src/{sts-MRC7OH6Z.js → sts-DKGAU6YE.js} +2911 -718
- package/package.json +1 -1
- package/dist/src/chunk-5V5ZNFZK.js +0 -178
- package/dist/src/event-streams-IFAW3KBX.js +0 -244
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
dateToUtcString
|
|
4
|
-
} from "./chunk-5V5ZNFZK.js";
|
|
5
2
|
import {
|
|
6
3
|
createAggregatedClient
|
|
7
4
|
} from "./chunk-ZDZBYCXV.js";
|
|
8
5
|
import {
|
|
6
|
+
AwsSdkSigV4ASigner,
|
|
9
7
|
AwsSdkSigV4Signer,
|
|
8
|
+
BinaryDecisionDiagram,
|
|
10
9
|
Client,
|
|
11
10
|
Command,
|
|
12
11
|
DEFAULT_RETRY_MODE,
|
|
@@ -21,6 +20,7 @@ import {
|
|
|
21
20
|
NODE_REGION_CONFIG_FILE_OPTIONS,
|
|
22
21
|
NODE_REGION_CONFIG_OPTIONS,
|
|
23
22
|
NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
23
|
+
NODE_SIGV4A_CONFIG_OPTIONS,
|
|
24
24
|
NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
|
|
25
25
|
NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
|
|
26
26
|
NoAuthSigner,
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
ProtocolLib,
|
|
31
31
|
SerdeContextConfig,
|
|
32
32
|
ServiceException,
|
|
33
|
+
SignatureV4,
|
|
33
34
|
TypeRegistry,
|
|
34
35
|
UnionSerde,
|
|
35
36
|
awsEndpointFunctions,
|
|
@@ -37,6 +38,7 @@ import {
|
|
|
37
38
|
collectBody,
|
|
38
39
|
createDefaultUserAgentProvider,
|
|
39
40
|
customEndpointFunctions,
|
|
41
|
+
decideEndpoint,
|
|
40
42
|
deref,
|
|
41
43
|
determineTimestampFormat,
|
|
42
44
|
emitWarningIfUnsupportedVersion,
|
|
@@ -60,43 +62,45 @@ import {
|
|
|
60
62
|
normalizeProvider,
|
|
61
63
|
package_default,
|
|
62
64
|
resolveAwsRegionExtensionConfiguration,
|
|
65
|
+
resolveAwsSdkSigV4AConfig,
|
|
63
66
|
resolveAwsSdkSigV4Config,
|
|
64
67
|
resolveDefaultRuntimeConfig,
|
|
65
68
|
resolveDefaultsModeConfig,
|
|
66
|
-
resolveEndpoint,
|
|
67
69
|
resolveEndpointConfig,
|
|
68
70
|
resolveHostHeaderConfig,
|
|
69
71
|
resolveHttpHandlerRuntimeConfig,
|
|
72
|
+
resolveParams,
|
|
70
73
|
resolveRegionConfig,
|
|
71
74
|
resolveRetryConfig,
|
|
72
75
|
resolveUserAgentConfig,
|
|
73
76
|
v4
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-TU2SAX7Z.js";
|
|
75
78
|
import {
|
|
76
79
|
loadConfig,
|
|
77
80
|
parseUrl
|
|
78
|
-
} from "./chunk-
|
|
79
|
-
import "./chunk-
|
|
80
|
-
import "./chunk-JFXVYYQY.js";
|
|
81
|
+
} from "./chunk-2Y7PD56W.js";
|
|
82
|
+
import "./chunk-WPAL27HA.js";
|
|
81
83
|
import {
|
|
82
84
|
NodeHttpHandler,
|
|
85
|
+
dateToUtcString,
|
|
83
86
|
fromBase64,
|
|
84
87
|
streamCollector,
|
|
85
88
|
toBase64
|
|
86
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-SGITM26Q.js";
|
|
87
90
|
import {
|
|
88
91
|
HttpRequest
|
|
89
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-SWX24AGM.js";
|
|
90
93
|
import {
|
|
91
94
|
fromUtf8,
|
|
92
95
|
toUtf8
|
|
93
96
|
} from "./chunk-ERL3EC7G.js";
|
|
97
|
+
import "./chunk-5VUQ55WW.js";
|
|
94
98
|
import {
|
|
95
99
|
setCredentialFeature
|
|
96
|
-
} from "./chunk-
|
|
97
|
-
import "./chunk-
|
|
100
|
+
} from "./chunk-ZNARSMJG.js";
|
|
101
|
+
import "./chunk-ST5JVROM.js";
|
|
98
102
|
|
|
99
|
-
// ../node_modules/.bun/@smithy+core@3.23.
|
|
103
|
+
// ../node_modules/.bun/@smithy+core@3.23.17/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js
|
|
100
104
|
var RpcProtocol = class extends HttpProtocol {
|
|
101
105
|
async serializeRequest(operationSchema, _input, context) {
|
|
102
106
|
const serializer = this.serializer;
|
|
@@ -197,77 +201,57 @@ var getValueFromTextNode = (obj) => {
|
|
|
197
201
|
return obj;
|
|
198
202
|
};
|
|
199
203
|
|
|
200
|
-
// ../node_modules/.bun/@
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
operation: getSmithyContext(context).operation,
|
|
204
|
-
region: await normalizeProvider(config.region)() || (() => {
|
|
205
|
-
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
206
|
-
})()
|
|
207
|
-
};
|
|
204
|
+
// ../node_modules/.bun/@smithy+signature-v4@5.3.14/node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js
|
|
205
|
+
var signatureV4aContainer = {
|
|
206
|
+
SignatureV4a: null
|
|
208
207
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
})
|
|
208
|
+
|
|
209
|
+
// ../node_modules/.bun/@aws-sdk+middleware-sdk-s3@3.972.37/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js
|
|
210
|
+
var SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
|
|
211
|
+
var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
|
|
212
|
+
|
|
213
|
+
// ../node_modules/.bun/@aws-sdk+middleware-sdk-s3@3.972.37/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js
|
|
214
|
+
var SignatureV4S3Express = class extends SignatureV4 {
|
|
215
|
+
async signWithCredentials(requestToSign, credentials, options) {
|
|
216
|
+
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
217
|
+
requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
|
|
218
|
+
const privateAccess = this;
|
|
219
|
+
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
220
|
+
return privateAccess.signRequest(requestToSign, options ?? {});
|
|
221
|
+
}
|
|
222
|
+
async presignWithCredentials(requestToSign, credentials, options) {
|
|
223
|
+
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
224
|
+
delete requestToSign.headers[SESSION_TOKEN_HEADER];
|
|
225
|
+
requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
226
|
+
requestToSign.query = requestToSign.query ?? {};
|
|
227
|
+
requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
228
|
+
const privateAccess = this;
|
|
229
|
+
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
230
|
+
return this.presign(requestToSign, options);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
function getCredentialsWithoutSessionToken(credentials) {
|
|
234
|
+
const credentialsWithoutSessionToken = {
|
|
235
|
+
accessKeyId: credentials.accessKeyId,
|
|
236
|
+
secretAccessKey: credentials.secretAccessKey,
|
|
237
|
+
expiration: credentials.expiration
|
|
222
238
|
};
|
|
239
|
+
return credentialsWithoutSessionToken;
|
|
223
240
|
}
|
|
224
|
-
function
|
|
225
|
-
|
|
226
|
-
|
|
241
|
+
function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
|
|
242
|
+
const id = setTimeout(() => {
|
|
243
|
+
throw new Error("SignatureV4S3Express credential override was created but not called.");
|
|
244
|
+
}, 10);
|
|
245
|
+
const currentCredentialProvider = privateAccess.credentialProvider;
|
|
246
|
+
const overrideCredentialsProviderOnce = () => {
|
|
247
|
+
clearTimeout(id);
|
|
248
|
+
privateAccess.credentialProvider = currentCredentialProvider;
|
|
249
|
+
return Promise.resolve(credentialsWithoutSessionToken);
|
|
227
250
|
};
|
|
251
|
+
privateAccess.credentialProvider = overrideCredentialsProviderOnce;
|
|
228
252
|
}
|
|
229
|
-
var defaultSTSHttpAuthSchemeProvider = (authParameters) => {
|
|
230
|
-
const options = [];
|
|
231
|
-
switch (authParameters.operation) {
|
|
232
|
-
case "AssumeRoleWithWebIdentity": {
|
|
233
|
-
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
default: {
|
|
237
|
-
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return options;
|
|
241
|
-
};
|
|
242
|
-
var resolveStsAuthConfig = (input) => Object.assign(input, {
|
|
243
|
-
stsClientCtor: STSClient
|
|
244
|
-
});
|
|
245
|
-
var resolveHttpAuthSchemeConfig = (config) => {
|
|
246
|
-
const config_0 = resolveStsAuthConfig(config);
|
|
247
|
-
const config_1 = resolveAwsSdkSigV4Config(config_0);
|
|
248
|
-
return Object.assign(config_1, {
|
|
249
|
-
authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js
|
|
254
|
-
var resolveClientEndpointParameters = (options) => {
|
|
255
|
-
return Object.assign(options, {
|
|
256
|
-
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
257
|
-
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
258
|
-
useGlobalEndpoint: options.useGlobalEndpoint ?? false,
|
|
259
|
-
defaultSigningName: "sts"
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
var commonParams = {
|
|
263
|
-
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
|
|
264
|
-
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
265
|
-
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
266
|
-
Region: { type: "builtInParams", name: "region" },
|
|
267
|
-
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
|
|
268
|
-
};
|
|
269
253
|
|
|
270
|
-
// ../node_modules/.bun/fast-xml-parser@5.
|
|
254
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/util.js
|
|
271
255
|
var nameStartChar = ":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";
|
|
272
256
|
var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
273
257
|
var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*";
|
|
@@ -291,8 +275,8 @@ var isName = function(string) {
|
|
|
291
275
|
const match = regexName.exec(string);
|
|
292
276
|
return !(match === null || typeof match === "undefined");
|
|
293
277
|
};
|
|
294
|
-
function isExist(
|
|
295
|
-
return typeof
|
|
278
|
+
function isExist(v) {
|
|
279
|
+
return typeof v !== "undefined";
|
|
296
280
|
}
|
|
297
281
|
var DANGEROUS_PROPERTY_NAMES = [
|
|
298
282
|
// '__proto__',
|
|
@@ -308,7 +292,7 @@ var DANGEROUS_PROPERTY_NAMES = [
|
|
|
308
292
|
];
|
|
309
293
|
var criticalProperties = ["__proto__", "constructor", "prototype"];
|
|
310
294
|
|
|
311
|
-
// ../node_modules/.bun/fast-xml-parser@5.
|
|
295
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/validator.js
|
|
312
296
|
var defaultOptions = {
|
|
313
297
|
allowBooleanAttributes: false,
|
|
314
298
|
//A tag can have attributes without any value
|
|
@@ -445,7 +429,7 @@ function validate(xmlData, options) {
|
|
|
445
429
|
} else if (tags.length == 1) {
|
|
446
430
|
return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
|
|
447
431
|
} else if (tags.length > 0) {
|
|
448
|
-
return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((
|
|
432
|
+
return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
|
|
449
433
|
}
|
|
450
434
|
return true;
|
|
451
435
|
}
|
|
@@ -614,7 +598,1476 @@ function getPositionFromMatch(match) {
|
|
|
614
598
|
return match.startIndex + match[1].length;
|
|
615
599
|
}
|
|
616
600
|
|
|
617
|
-
// ../node_modules/.bun
|
|
601
|
+
// ../node_modules/.bun/@nodable+entities@2.1.0/node_modules/@nodable/entities/src/entities.js
|
|
602
|
+
var BASIC_LATIN = {
|
|
603
|
+
amp: "&",
|
|
604
|
+
AMP: "&",
|
|
605
|
+
lt: "<",
|
|
606
|
+
LT: "<",
|
|
607
|
+
gt: ">",
|
|
608
|
+
GT: ">",
|
|
609
|
+
quot: '"',
|
|
610
|
+
QUOT: '"',
|
|
611
|
+
apos: "'",
|
|
612
|
+
lsquo: "\u2018",
|
|
613
|
+
rsquo: "\u2019",
|
|
614
|
+
ldquo: "\u201C",
|
|
615
|
+
rdquo: "\u201D",
|
|
616
|
+
lsquor: "\u201A",
|
|
617
|
+
rsquor: "\u2019",
|
|
618
|
+
ldquor: "\u201E",
|
|
619
|
+
bdquo: "\u201E",
|
|
620
|
+
comma: ",",
|
|
621
|
+
period: ".",
|
|
622
|
+
colon: ":",
|
|
623
|
+
semi: ";",
|
|
624
|
+
excl: "!",
|
|
625
|
+
quest: "?",
|
|
626
|
+
num: "#",
|
|
627
|
+
dollar: "$",
|
|
628
|
+
percent: "%",
|
|
629
|
+
amp: "&",
|
|
630
|
+
ast: "*",
|
|
631
|
+
commat: "@",
|
|
632
|
+
lowbar: "_",
|
|
633
|
+
verbar: "|",
|
|
634
|
+
vert: "|",
|
|
635
|
+
sol: "/",
|
|
636
|
+
bsol: "\\",
|
|
637
|
+
lbrace: "{",
|
|
638
|
+
rbrace: "}",
|
|
639
|
+
lbrack: "[",
|
|
640
|
+
rbrack: "]",
|
|
641
|
+
lpar: "(",
|
|
642
|
+
rpar: ")",
|
|
643
|
+
nbsp: "\xA0",
|
|
644
|
+
iexcl: "\xA1",
|
|
645
|
+
cent: "\xA2",
|
|
646
|
+
pound: "\xA3",
|
|
647
|
+
curren: "\xA4",
|
|
648
|
+
yen: "\xA5",
|
|
649
|
+
brvbar: "\xA6",
|
|
650
|
+
sect: "\xA7",
|
|
651
|
+
uml: "\xA8",
|
|
652
|
+
copy: "\xA9",
|
|
653
|
+
COPY: "\xA9",
|
|
654
|
+
ordf: "\xAA",
|
|
655
|
+
laquo: "\xAB",
|
|
656
|
+
not: "\xAC",
|
|
657
|
+
shy: "\xAD",
|
|
658
|
+
reg: "\xAE",
|
|
659
|
+
REG: "\xAE",
|
|
660
|
+
macr: "\xAF",
|
|
661
|
+
deg: "\xB0",
|
|
662
|
+
plusmn: "\xB1",
|
|
663
|
+
sup2: "\xB2",
|
|
664
|
+
sup3: "\xB3",
|
|
665
|
+
acute: "\xB4",
|
|
666
|
+
micro: "\xB5",
|
|
667
|
+
para: "\xB6",
|
|
668
|
+
middot: "\xB7",
|
|
669
|
+
cedil: "\xB8",
|
|
670
|
+
sup1: "\xB9",
|
|
671
|
+
ordm: "\xBA",
|
|
672
|
+
raquo: "\xBB",
|
|
673
|
+
frac14: "\xBC",
|
|
674
|
+
frac12: "\xBD",
|
|
675
|
+
half: "\xBD",
|
|
676
|
+
frac34: "\xBE",
|
|
677
|
+
iquest: "\xBF",
|
|
678
|
+
times: "\xD7",
|
|
679
|
+
div: "\xF7",
|
|
680
|
+
divide: "\xF7"
|
|
681
|
+
};
|
|
682
|
+
var LATIN_ACCENTS = {
|
|
683
|
+
Agrave: "\xC0",
|
|
684
|
+
agrave: "\xE0",
|
|
685
|
+
Aacute: "\xC1",
|
|
686
|
+
aacute: "\xE1",
|
|
687
|
+
Acirc: "\xC2",
|
|
688
|
+
acirc: "\xE2",
|
|
689
|
+
Atilde: "\xC3",
|
|
690
|
+
atilde: "\xE3",
|
|
691
|
+
Auml: "\xC4",
|
|
692
|
+
auml: "\xE4",
|
|
693
|
+
Aring: "\xC5",
|
|
694
|
+
aring: "\xE5",
|
|
695
|
+
AElig: "\xC6",
|
|
696
|
+
aelig: "\xE6",
|
|
697
|
+
Ccedil: "\xC7",
|
|
698
|
+
ccedil: "\xE7",
|
|
699
|
+
Egrave: "\xC8",
|
|
700
|
+
egrave: "\xE8",
|
|
701
|
+
Eacute: "\xC9",
|
|
702
|
+
eacute: "\xE9",
|
|
703
|
+
Ecirc: "\xCA",
|
|
704
|
+
ecirc: "\xEA",
|
|
705
|
+
Euml: "\xCB",
|
|
706
|
+
euml: "\xEB",
|
|
707
|
+
Igrave: "\xCC",
|
|
708
|
+
igrave: "\xEC",
|
|
709
|
+
Iacute: "\xCD",
|
|
710
|
+
iacute: "\xED",
|
|
711
|
+
Icirc: "\xCE",
|
|
712
|
+
icirc: "\xEE",
|
|
713
|
+
Iuml: "\xCF",
|
|
714
|
+
iuml: "\xEF",
|
|
715
|
+
ETH: "\xD0",
|
|
716
|
+
eth: "\xF0",
|
|
717
|
+
Ntilde: "\xD1",
|
|
718
|
+
ntilde: "\xF1",
|
|
719
|
+
Ograve: "\xD2",
|
|
720
|
+
ograve: "\xF2",
|
|
721
|
+
Oacute: "\xD3",
|
|
722
|
+
oacute: "\xF3",
|
|
723
|
+
Ocirc: "\xD4",
|
|
724
|
+
ocirc: "\xF4",
|
|
725
|
+
Otilde: "\xD5",
|
|
726
|
+
otilde: "\xF5",
|
|
727
|
+
Ouml: "\xD6",
|
|
728
|
+
ouml: "\xF6",
|
|
729
|
+
Oslash: "\xD8",
|
|
730
|
+
oslash: "\xF8",
|
|
731
|
+
Ugrave: "\xD9",
|
|
732
|
+
ugrave: "\xF9",
|
|
733
|
+
Uacute: "\xDA",
|
|
734
|
+
uacute: "\xFA",
|
|
735
|
+
Ucirc: "\xDB",
|
|
736
|
+
ucirc: "\xFB",
|
|
737
|
+
Uuml: "\xDC",
|
|
738
|
+
uuml: "\xFC",
|
|
739
|
+
Yacute: "\xDD",
|
|
740
|
+
yacute: "\xFD",
|
|
741
|
+
THORN: "\xDE",
|
|
742
|
+
thorn: "\xFE",
|
|
743
|
+
szlig: "\xDF",
|
|
744
|
+
yuml: "\xFF",
|
|
745
|
+
Yuml: "\u0178"
|
|
746
|
+
};
|
|
747
|
+
var LATIN_EXTENDED = {
|
|
748
|
+
Amacr: "\u0100",
|
|
749
|
+
amacr: "\u0101",
|
|
750
|
+
Abreve: "\u0102",
|
|
751
|
+
abreve: "\u0103",
|
|
752
|
+
Aogon: "\u0104",
|
|
753
|
+
aogon: "\u0105",
|
|
754
|
+
Cacute: "\u0106",
|
|
755
|
+
cacute: "\u0107",
|
|
756
|
+
Ccirc: "\u0108",
|
|
757
|
+
ccirc: "\u0109",
|
|
758
|
+
Cdot: "\u010A",
|
|
759
|
+
cdot: "\u010B",
|
|
760
|
+
Ccaron: "\u010C",
|
|
761
|
+
ccaron: "\u010D",
|
|
762
|
+
Dcaron: "\u010E",
|
|
763
|
+
dcaron: "\u010F",
|
|
764
|
+
Dstrok: "\u0110",
|
|
765
|
+
dstrok: "\u0111",
|
|
766
|
+
Emacr: "\u0112",
|
|
767
|
+
emacr: "\u0113",
|
|
768
|
+
Ecaron: "\u011A",
|
|
769
|
+
ecaron: "\u011B",
|
|
770
|
+
Edot: "\u0116",
|
|
771
|
+
edot: "\u0117",
|
|
772
|
+
Eogon: "\u0118",
|
|
773
|
+
eogon: "\u0119",
|
|
774
|
+
Gcirc: "\u011C",
|
|
775
|
+
gcirc: "\u011D",
|
|
776
|
+
Gbreve: "\u011E",
|
|
777
|
+
gbreve: "\u011F",
|
|
778
|
+
Gdot: "\u0120",
|
|
779
|
+
gdot: "\u0121",
|
|
780
|
+
Gcedil: "\u0122",
|
|
781
|
+
Hcirc: "\u0124",
|
|
782
|
+
hcirc: "\u0125",
|
|
783
|
+
Hstrok: "\u0126",
|
|
784
|
+
hstrok: "\u0127",
|
|
785
|
+
Itilde: "\u0128",
|
|
786
|
+
itilde: "\u0129",
|
|
787
|
+
Imacr: "\u012A",
|
|
788
|
+
imacr: "\u012B",
|
|
789
|
+
Iogon: "\u012E",
|
|
790
|
+
iogon: "\u012F",
|
|
791
|
+
Idot: "\u0130",
|
|
792
|
+
IJlig: "\u0132",
|
|
793
|
+
ijlig: "\u0133",
|
|
794
|
+
Jcirc: "\u0134",
|
|
795
|
+
jcirc: "\u0135",
|
|
796
|
+
Kcedil: "\u0136",
|
|
797
|
+
kcedil: "\u0137",
|
|
798
|
+
kgreen: "\u0138",
|
|
799
|
+
Lacute: "\u0139",
|
|
800
|
+
lacute: "\u013A",
|
|
801
|
+
Lcedil: "\u013B",
|
|
802
|
+
lcedil: "\u013C",
|
|
803
|
+
Lcaron: "\u013D",
|
|
804
|
+
lcaron: "\u013E",
|
|
805
|
+
Lmidot: "\u013F",
|
|
806
|
+
lmidot: "\u0140",
|
|
807
|
+
Lstrok: "\u0141",
|
|
808
|
+
lstrok: "\u0142",
|
|
809
|
+
Nacute: "\u0143",
|
|
810
|
+
nacute: "\u0144",
|
|
811
|
+
Ncaron: "\u0147",
|
|
812
|
+
ncaron: "\u0148",
|
|
813
|
+
Ncedil: "\u0145",
|
|
814
|
+
ncedil: "\u0146",
|
|
815
|
+
ENG: "\u014A",
|
|
816
|
+
eng: "\u014B",
|
|
817
|
+
Omacr: "\u014C",
|
|
818
|
+
omacr: "\u014D",
|
|
819
|
+
Odblac: "\u0150",
|
|
820
|
+
odblac: "\u0151",
|
|
821
|
+
OElig: "\u0152",
|
|
822
|
+
oelig: "\u0153",
|
|
823
|
+
Racute: "\u0154",
|
|
824
|
+
racute: "\u0155",
|
|
825
|
+
Rcaron: "\u0158",
|
|
826
|
+
rcaron: "\u0159",
|
|
827
|
+
Rcedil: "\u0156",
|
|
828
|
+
rcedil: "\u0157",
|
|
829
|
+
Sacute: "\u015A",
|
|
830
|
+
sacute: "\u015B",
|
|
831
|
+
Scirc: "\u015C",
|
|
832
|
+
scirc: "\u015D",
|
|
833
|
+
Scedil: "\u015E",
|
|
834
|
+
scedil: "\u015F",
|
|
835
|
+
Scaron: "\u0160",
|
|
836
|
+
scaron: "\u0161",
|
|
837
|
+
Tcedil: "\u0162",
|
|
838
|
+
tcedil: "\u0163",
|
|
839
|
+
Tcaron: "\u0164",
|
|
840
|
+
tcaron: "\u0165",
|
|
841
|
+
Tstrok: "\u0166",
|
|
842
|
+
tstrok: "\u0167",
|
|
843
|
+
Utilde: "\u0168",
|
|
844
|
+
utilde: "\u0169",
|
|
845
|
+
Umacr: "\u016A",
|
|
846
|
+
umacr: "\u016B",
|
|
847
|
+
Ubreve: "\u016C",
|
|
848
|
+
ubreve: "\u016D",
|
|
849
|
+
Uring: "\u016E",
|
|
850
|
+
uring: "\u016F",
|
|
851
|
+
Udblac: "\u0170",
|
|
852
|
+
udblac: "\u0171",
|
|
853
|
+
Uogon: "\u0172",
|
|
854
|
+
uogon: "\u0173",
|
|
855
|
+
Wcirc: "\u0174",
|
|
856
|
+
wcirc: "\u0175",
|
|
857
|
+
Ycirc: "\u0176",
|
|
858
|
+
ycirc: "\u0177",
|
|
859
|
+
Zacute: "\u0179",
|
|
860
|
+
zacute: "\u017A",
|
|
861
|
+
Zdot: "\u017B",
|
|
862
|
+
zdot: "\u017C",
|
|
863
|
+
Zcaron: "\u017D",
|
|
864
|
+
zcaron: "\u017E"
|
|
865
|
+
};
|
|
866
|
+
var GREEK = {
|
|
867
|
+
Alpha: "\u0391",
|
|
868
|
+
alpha: "\u03B1",
|
|
869
|
+
Beta: "\u0392",
|
|
870
|
+
beta: "\u03B2",
|
|
871
|
+
Gamma: "\u0393",
|
|
872
|
+
gamma: "\u03B3",
|
|
873
|
+
Delta: "\u0394",
|
|
874
|
+
delta: "\u03B4",
|
|
875
|
+
Epsilon: "\u0395",
|
|
876
|
+
epsilon: "\u03B5",
|
|
877
|
+
epsiv: "\u03F5",
|
|
878
|
+
varepsilon: "\u03F5",
|
|
879
|
+
Zeta: "\u0396",
|
|
880
|
+
zeta: "\u03B6",
|
|
881
|
+
Eta: "\u0397",
|
|
882
|
+
eta: "\u03B7",
|
|
883
|
+
Theta: "\u0398",
|
|
884
|
+
theta: "\u03B8",
|
|
885
|
+
thetasym: "\u03D1",
|
|
886
|
+
vartheta: "\u03D1",
|
|
887
|
+
Iota: "\u0399",
|
|
888
|
+
iota: "\u03B9",
|
|
889
|
+
Kappa: "\u039A",
|
|
890
|
+
kappa: "\u03BA",
|
|
891
|
+
kappav: "\u03F0",
|
|
892
|
+
varkappa: "\u03F0",
|
|
893
|
+
Lambda: "\u039B",
|
|
894
|
+
lambda: "\u03BB",
|
|
895
|
+
Mu: "\u039C",
|
|
896
|
+
mu: "\u03BC",
|
|
897
|
+
Nu: "\u039D",
|
|
898
|
+
nu: "\u03BD",
|
|
899
|
+
Xi: "\u039E",
|
|
900
|
+
xi: "\u03BE",
|
|
901
|
+
Omicron: "\u039F",
|
|
902
|
+
omicron: "\u03BF",
|
|
903
|
+
Pi: "\u03A0",
|
|
904
|
+
pi: "\u03C0",
|
|
905
|
+
piv: "\u03D6",
|
|
906
|
+
varpi: "\u03D6",
|
|
907
|
+
Rho: "\u03A1",
|
|
908
|
+
rho: "\u03C1",
|
|
909
|
+
rhov: "\u03F1",
|
|
910
|
+
varrho: "\u03F1",
|
|
911
|
+
Sigma: "\u03A3",
|
|
912
|
+
sigma: "\u03C3",
|
|
913
|
+
sigmaf: "\u03C2",
|
|
914
|
+
sigmav: "\u03C2",
|
|
915
|
+
varsigma: "\u03C2",
|
|
916
|
+
Tau: "\u03A4",
|
|
917
|
+
tau: "\u03C4",
|
|
918
|
+
Upsilon: "\u03A5",
|
|
919
|
+
upsilon: "\u03C5",
|
|
920
|
+
upsi: "\u03C5",
|
|
921
|
+
Upsi: "\u03D2",
|
|
922
|
+
upsih: "\u03D2",
|
|
923
|
+
Phi: "\u03A6",
|
|
924
|
+
phi: "\u03C6",
|
|
925
|
+
phiv: "\u03D5",
|
|
926
|
+
varphi: "\u03D5",
|
|
927
|
+
Chi: "\u03A7",
|
|
928
|
+
chi: "\u03C7",
|
|
929
|
+
Psi: "\u03A8",
|
|
930
|
+
psi: "\u03C8",
|
|
931
|
+
Omega: "\u03A9",
|
|
932
|
+
omega: "\u03C9",
|
|
933
|
+
ohm: "\u03A9",
|
|
934
|
+
Gammad: "\u03DC",
|
|
935
|
+
gammad: "\u03DD",
|
|
936
|
+
digamma: "\u03DD"
|
|
937
|
+
};
|
|
938
|
+
var CYRILLIC = {
|
|
939
|
+
Afr: "\u{1D504}",
|
|
940
|
+
afr: "\u{1D51E}",
|
|
941
|
+
Acy: "\u0410",
|
|
942
|
+
acy: "\u0430",
|
|
943
|
+
Bcy: "\u0411",
|
|
944
|
+
bcy: "\u0431",
|
|
945
|
+
Vcy: "\u0412",
|
|
946
|
+
vcy: "\u0432",
|
|
947
|
+
Gcy: "\u0413",
|
|
948
|
+
gcy: "\u0433",
|
|
949
|
+
Dcy: "\u0414",
|
|
950
|
+
dcy: "\u0434",
|
|
951
|
+
IEcy: "\u0415",
|
|
952
|
+
iecy: "\u0435",
|
|
953
|
+
IOcy: "\u0401",
|
|
954
|
+
iocy: "\u0451",
|
|
955
|
+
ZHcy: "\u0416",
|
|
956
|
+
zhcy: "\u0436",
|
|
957
|
+
Zcy: "\u0417",
|
|
958
|
+
zcy: "\u0437",
|
|
959
|
+
Icy: "\u0418",
|
|
960
|
+
icy: "\u0438",
|
|
961
|
+
Jcy: "\u0419",
|
|
962
|
+
jcy: "\u0439",
|
|
963
|
+
Kcy: "\u041A",
|
|
964
|
+
kcy: "\u043A",
|
|
965
|
+
Lcy: "\u041B",
|
|
966
|
+
lcy: "\u043B",
|
|
967
|
+
Mcy: "\u041C",
|
|
968
|
+
mcy: "\u043C",
|
|
969
|
+
Ncy: "\u041D",
|
|
970
|
+
ncy: "\u043D",
|
|
971
|
+
Ocy: "\u041E",
|
|
972
|
+
ocy: "\u043E",
|
|
973
|
+
Pcy: "\u041F",
|
|
974
|
+
pcy: "\u043F",
|
|
975
|
+
Rcy: "\u0420",
|
|
976
|
+
rcy: "\u0440",
|
|
977
|
+
Scy: "\u0421",
|
|
978
|
+
scy: "\u0441",
|
|
979
|
+
Tcy: "\u0422",
|
|
980
|
+
tcy: "\u0442",
|
|
981
|
+
Ucy: "\u0423",
|
|
982
|
+
ucy: "\u0443",
|
|
983
|
+
Fcy: "\u0424",
|
|
984
|
+
fcy: "\u0444",
|
|
985
|
+
KHcy: "\u0425",
|
|
986
|
+
khcy: "\u0445",
|
|
987
|
+
TScy: "\u0426",
|
|
988
|
+
tscy: "\u0446",
|
|
989
|
+
CHcy: "\u0427",
|
|
990
|
+
chcy: "\u0447",
|
|
991
|
+
SHcy: "\u0428",
|
|
992
|
+
shcy: "\u0448",
|
|
993
|
+
SHCHcy: "\u0429",
|
|
994
|
+
shchcy: "\u0449",
|
|
995
|
+
HARDcy: "\u042A",
|
|
996
|
+
hardcy: "\u044A",
|
|
997
|
+
Ycy: "\u042B",
|
|
998
|
+
ycy: "\u044B",
|
|
999
|
+
SOFTcy: "\u042C",
|
|
1000
|
+
softcy: "\u044C",
|
|
1001
|
+
Ecy: "\u042D",
|
|
1002
|
+
ecy: "\u044D",
|
|
1003
|
+
YUcy: "\u042E",
|
|
1004
|
+
yucy: "\u044E",
|
|
1005
|
+
YAcy: "\u042F",
|
|
1006
|
+
yacy: "\u044F",
|
|
1007
|
+
DJcy: "\u0402",
|
|
1008
|
+
djcy: "\u0452",
|
|
1009
|
+
GJcy: "\u0403",
|
|
1010
|
+
gjcy: "\u0453",
|
|
1011
|
+
Jukcy: "\u0404",
|
|
1012
|
+
jukcy: "\u0454",
|
|
1013
|
+
DScy: "\u0405",
|
|
1014
|
+
dscy: "\u0455",
|
|
1015
|
+
Iukcy: "\u0406",
|
|
1016
|
+
iukcy: "\u0456",
|
|
1017
|
+
YIcy: "\u0407",
|
|
1018
|
+
yicy: "\u0457",
|
|
1019
|
+
Jsercy: "\u0408",
|
|
1020
|
+
jsercy: "\u0458",
|
|
1021
|
+
LJcy: "\u0409",
|
|
1022
|
+
ljcy: "\u0459",
|
|
1023
|
+
NJcy: "\u040A",
|
|
1024
|
+
njcy: "\u045A",
|
|
1025
|
+
TSHcy: "\u040B",
|
|
1026
|
+
tshcy: "\u045B",
|
|
1027
|
+
KJcy: "\u040C",
|
|
1028
|
+
kjcy: "\u045C",
|
|
1029
|
+
Ubrcy: "\u040E",
|
|
1030
|
+
ubrcy: "\u045E",
|
|
1031
|
+
DZcy: "\u040F",
|
|
1032
|
+
dzcy: "\u045F"
|
|
1033
|
+
};
|
|
1034
|
+
var MATH = {
|
|
1035
|
+
plus: "+",
|
|
1036
|
+
minus: "\u2212",
|
|
1037
|
+
mnplus: "\u2213",
|
|
1038
|
+
mp: "\u2213",
|
|
1039
|
+
pm: "\xB1",
|
|
1040
|
+
times: "\xD7",
|
|
1041
|
+
div: "\xF7",
|
|
1042
|
+
divide: "\xF7",
|
|
1043
|
+
sdot: "\u22C5",
|
|
1044
|
+
star: "\u2606",
|
|
1045
|
+
starf: "\u2605",
|
|
1046
|
+
bigstar: "\u2605",
|
|
1047
|
+
lowast: "\u2217",
|
|
1048
|
+
ast: "*",
|
|
1049
|
+
midast: "*",
|
|
1050
|
+
compfn: "\u2218",
|
|
1051
|
+
smallcircle: "\u2218",
|
|
1052
|
+
bullet: "\u2022",
|
|
1053
|
+
bull: "\u2022",
|
|
1054
|
+
nbsp: "\xA0",
|
|
1055
|
+
hellip: "\u2026",
|
|
1056
|
+
mldr: "\u2026",
|
|
1057
|
+
prime: "\u2032",
|
|
1058
|
+
Prime: "\u2033",
|
|
1059
|
+
tprime: "\u2034",
|
|
1060
|
+
bprime: "\u2035",
|
|
1061
|
+
backprime: "\u2035",
|
|
1062
|
+
minus: "\u2212",
|
|
1063
|
+
minusd: "\u2238",
|
|
1064
|
+
dotminus: "\u2238",
|
|
1065
|
+
plusdo: "\u2214",
|
|
1066
|
+
dotplus: "\u2214",
|
|
1067
|
+
plusmn: "\xB1",
|
|
1068
|
+
minusplus: "\u2213",
|
|
1069
|
+
mnplus: "\u2213",
|
|
1070
|
+
mp: "\u2213",
|
|
1071
|
+
setminus: "\u2216",
|
|
1072
|
+
smallsetminus: "\u2216",
|
|
1073
|
+
Backslash: "\u2216",
|
|
1074
|
+
setmn: "\u2216",
|
|
1075
|
+
ssetmn: "\u2216",
|
|
1076
|
+
lowbar: "_",
|
|
1077
|
+
verbar: "|",
|
|
1078
|
+
vert: "|",
|
|
1079
|
+
VerticalLine: "|",
|
|
1080
|
+
colon: ":",
|
|
1081
|
+
Colon: "\u2237",
|
|
1082
|
+
Proportion: "\u2237",
|
|
1083
|
+
ratio: "\u2236",
|
|
1084
|
+
equals: "=",
|
|
1085
|
+
ne: "\u2260",
|
|
1086
|
+
nequiv: "\u2262",
|
|
1087
|
+
equiv: "\u2261",
|
|
1088
|
+
Congruent: "\u2261",
|
|
1089
|
+
sim: "\u223C",
|
|
1090
|
+
thicksim: "\u223C",
|
|
1091
|
+
thksim: "\u223C",
|
|
1092
|
+
sime: "\u2243",
|
|
1093
|
+
simeq: "\u2243",
|
|
1094
|
+
TildeEqual: "\u2243",
|
|
1095
|
+
asymp: "\u2248",
|
|
1096
|
+
approx: "\u2248",
|
|
1097
|
+
thickapprox: "\u2248",
|
|
1098
|
+
thkap: "\u2248",
|
|
1099
|
+
TildeTilde: "\u2248",
|
|
1100
|
+
ncong: "\u2247",
|
|
1101
|
+
cong: "\u2245",
|
|
1102
|
+
TildeFullEqual: "\u2245",
|
|
1103
|
+
asympeq: "\u224D",
|
|
1104
|
+
CupCap: "\u224D",
|
|
1105
|
+
bump: "\u224E",
|
|
1106
|
+
Bumpeq: "\u224E",
|
|
1107
|
+
HumpDownHump: "\u224E",
|
|
1108
|
+
bumpe: "\u224F",
|
|
1109
|
+
bumpeq: "\u224F",
|
|
1110
|
+
HumpEqual: "\u224F",
|
|
1111
|
+
dotminus: "\u2238",
|
|
1112
|
+
minusd: "\u2238",
|
|
1113
|
+
plusdo: "\u2214",
|
|
1114
|
+
dotplus: "\u2214",
|
|
1115
|
+
le: "\u2264",
|
|
1116
|
+
LessEqual: "\u2264",
|
|
1117
|
+
ge: "\u2265",
|
|
1118
|
+
GreaterEqual: "\u2265",
|
|
1119
|
+
lesseqgtr: "\u22DA",
|
|
1120
|
+
lesseqqgtr: "\u2A8B",
|
|
1121
|
+
greater: ">",
|
|
1122
|
+
less: "<"
|
|
1123
|
+
};
|
|
1124
|
+
var MATH_ADVANCED = {
|
|
1125
|
+
alefsym: "\u2135",
|
|
1126
|
+
aleph: "\u2135",
|
|
1127
|
+
beth: "\u2136",
|
|
1128
|
+
gimel: "\u2137",
|
|
1129
|
+
daleth: "\u2138",
|
|
1130
|
+
forall: "\u2200",
|
|
1131
|
+
ForAll: "\u2200",
|
|
1132
|
+
part: "\u2202",
|
|
1133
|
+
PartialD: "\u2202",
|
|
1134
|
+
exist: "\u2203",
|
|
1135
|
+
Exists: "\u2203",
|
|
1136
|
+
nexist: "\u2204",
|
|
1137
|
+
nexists: "\u2204",
|
|
1138
|
+
empty: "\u2205",
|
|
1139
|
+
emptyset: "\u2205",
|
|
1140
|
+
emptyv: "\u2205",
|
|
1141
|
+
varnothing: "\u2205",
|
|
1142
|
+
nabla: "\u2207",
|
|
1143
|
+
Del: "\u2207",
|
|
1144
|
+
isin: "\u2208",
|
|
1145
|
+
isinv: "\u2208",
|
|
1146
|
+
in: "\u2208",
|
|
1147
|
+
Element: "\u2208",
|
|
1148
|
+
notin: "\u2209",
|
|
1149
|
+
notinva: "\u2209",
|
|
1150
|
+
ni: "\u220B",
|
|
1151
|
+
niv: "\u220B",
|
|
1152
|
+
SuchThat: "\u220B",
|
|
1153
|
+
ReverseElement: "\u220B",
|
|
1154
|
+
notni: "\u220C",
|
|
1155
|
+
notniva: "\u220C",
|
|
1156
|
+
prod: "\u220F",
|
|
1157
|
+
Product: "\u220F",
|
|
1158
|
+
coprod: "\u2210",
|
|
1159
|
+
Coproduct: "\u2210",
|
|
1160
|
+
sum: "\u2211",
|
|
1161
|
+
Sum: "\u2211",
|
|
1162
|
+
minus: "\u2212",
|
|
1163
|
+
mp: "\u2213",
|
|
1164
|
+
plusdo: "\u2214",
|
|
1165
|
+
dotplus: "\u2214",
|
|
1166
|
+
setminus: "\u2216",
|
|
1167
|
+
lowast: "\u2217",
|
|
1168
|
+
radic: "\u221A",
|
|
1169
|
+
Sqrt: "\u221A",
|
|
1170
|
+
prop: "\u221D",
|
|
1171
|
+
propto: "\u221D",
|
|
1172
|
+
Proportional: "\u221D",
|
|
1173
|
+
varpropto: "\u221D",
|
|
1174
|
+
infin: "\u221E",
|
|
1175
|
+
infintie: "\u29DD",
|
|
1176
|
+
ang: "\u2220",
|
|
1177
|
+
angle: "\u2220",
|
|
1178
|
+
angmsd: "\u2221",
|
|
1179
|
+
measuredangle: "\u2221",
|
|
1180
|
+
angsph: "\u2222",
|
|
1181
|
+
mid: "\u2223",
|
|
1182
|
+
VerticalBar: "\u2223",
|
|
1183
|
+
nmid: "\u2224",
|
|
1184
|
+
nsmid: "\u2224",
|
|
1185
|
+
npar: "\u2226",
|
|
1186
|
+
parallel: "\u2225",
|
|
1187
|
+
spar: "\u2225",
|
|
1188
|
+
nparallel: "\u2226",
|
|
1189
|
+
nspar: "\u2226",
|
|
1190
|
+
and: "\u2227",
|
|
1191
|
+
wedge: "\u2227",
|
|
1192
|
+
or: "\u2228",
|
|
1193
|
+
vee: "\u2228",
|
|
1194
|
+
cap: "\u2229",
|
|
1195
|
+
cup: "\u222A",
|
|
1196
|
+
int: "\u222B",
|
|
1197
|
+
Integral: "\u222B",
|
|
1198
|
+
conint: "\u222E",
|
|
1199
|
+
ContourIntegral: "\u222E",
|
|
1200
|
+
Conint: "\u222F",
|
|
1201
|
+
DoubleContourIntegral: "\u222F",
|
|
1202
|
+
Cconint: "\u2230",
|
|
1203
|
+
there4: "\u2234",
|
|
1204
|
+
therefore: "\u2234",
|
|
1205
|
+
Therefore: "\u2234",
|
|
1206
|
+
becaus: "\u2235",
|
|
1207
|
+
because: "\u2235",
|
|
1208
|
+
Because: "\u2235",
|
|
1209
|
+
ratio: "\u2236",
|
|
1210
|
+
Proportion: "\u2237",
|
|
1211
|
+
minusd: "\u2238",
|
|
1212
|
+
dotminus: "\u2238",
|
|
1213
|
+
mDDot: "\u223A",
|
|
1214
|
+
homtht: "\u223B",
|
|
1215
|
+
sim: "\u223C",
|
|
1216
|
+
bsimg: "\u223D",
|
|
1217
|
+
backsim: "\u223D",
|
|
1218
|
+
ac: "\u223E",
|
|
1219
|
+
mstpos: "\u223E",
|
|
1220
|
+
acd: "\u223F",
|
|
1221
|
+
VerticalTilde: "\u2240",
|
|
1222
|
+
wr: "\u2240",
|
|
1223
|
+
wreath: "\u2240",
|
|
1224
|
+
nsime: "\u2244",
|
|
1225
|
+
nsimeq: "\u2244",
|
|
1226
|
+
nsimeq: "\u2244",
|
|
1227
|
+
ncong: "\u2247",
|
|
1228
|
+
simne: "\u2246",
|
|
1229
|
+
ncongdot: "\u2A6D\u0338",
|
|
1230
|
+
ngsim: "\u2275",
|
|
1231
|
+
nsim: "\u2241",
|
|
1232
|
+
napprox: "\u2249",
|
|
1233
|
+
nap: "\u2249",
|
|
1234
|
+
ngeq: "\u2271",
|
|
1235
|
+
nge: "\u2271",
|
|
1236
|
+
nleq: "\u2270",
|
|
1237
|
+
nle: "\u2270",
|
|
1238
|
+
ngtr: "\u226F",
|
|
1239
|
+
ngt: "\u226F",
|
|
1240
|
+
nless: "\u226E",
|
|
1241
|
+
nlt: "\u226E",
|
|
1242
|
+
nprec: "\u2280",
|
|
1243
|
+
npr: "\u2280",
|
|
1244
|
+
nsucc: "\u2281",
|
|
1245
|
+
nsc: "\u2281"
|
|
1246
|
+
};
|
|
1247
|
+
var ARROWS = {
|
|
1248
|
+
larr: "\u2190",
|
|
1249
|
+
leftarrow: "\u2190",
|
|
1250
|
+
LeftArrow: "\u2190",
|
|
1251
|
+
uarr: "\u2191",
|
|
1252
|
+
uparrow: "\u2191",
|
|
1253
|
+
UpArrow: "\u2191",
|
|
1254
|
+
rarr: "\u2192",
|
|
1255
|
+
rightarrow: "\u2192",
|
|
1256
|
+
RightArrow: "\u2192",
|
|
1257
|
+
darr: "\u2193",
|
|
1258
|
+
downarrow: "\u2193",
|
|
1259
|
+
DownArrow: "\u2193",
|
|
1260
|
+
harr: "\u2194",
|
|
1261
|
+
leftrightarrow: "\u2194",
|
|
1262
|
+
LeftRightArrow: "\u2194",
|
|
1263
|
+
varr: "\u2195",
|
|
1264
|
+
updownarrow: "\u2195",
|
|
1265
|
+
UpDownArrow: "\u2195",
|
|
1266
|
+
nwarr: "\u2196",
|
|
1267
|
+
nwarrow: "\u2196",
|
|
1268
|
+
UpperLeftArrow: "\u2196",
|
|
1269
|
+
nearr: "\u2197",
|
|
1270
|
+
nearrow: "\u2197",
|
|
1271
|
+
UpperRightArrow: "\u2197",
|
|
1272
|
+
searr: "\u2198",
|
|
1273
|
+
searrow: "\u2198",
|
|
1274
|
+
LowerRightArrow: "\u2198",
|
|
1275
|
+
swarr: "\u2199",
|
|
1276
|
+
swarrow: "\u2199",
|
|
1277
|
+
LowerLeftArrow: "\u2199",
|
|
1278
|
+
lArr: "\u21D0",
|
|
1279
|
+
Leftarrow: "\u21D0",
|
|
1280
|
+
uArr: "\u21D1",
|
|
1281
|
+
Uparrow: "\u21D1",
|
|
1282
|
+
rArr: "\u21D2",
|
|
1283
|
+
Rightarrow: "\u21D2",
|
|
1284
|
+
dArr: "\u21D3",
|
|
1285
|
+
Downarrow: "\u21D3",
|
|
1286
|
+
hArr: "\u21D4",
|
|
1287
|
+
Leftrightarrow: "\u21D4",
|
|
1288
|
+
iff: "\u21D4",
|
|
1289
|
+
vArr: "\u21D5",
|
|
1290
|
+
Updownarrow: "\u21D5",
|
|
1291
|
+
lAarr: "\u21DA",
|
|
1292
|
+
Lleftarrow: "\u21DA",
|
|
1293
|
+
rAarr: "\u21DB",
|
|
1294
|
+
Rrightarrow: "\u21DB",
|
|
1295
|
+
lrarr: "\u21C6",
|
|
1296
|
+
leftrightarrows: "\u21C6",
|
|
1297
|
+
rlarr: "\u21C4",
|
|
1298
|
+
rightleftarrows: "\u21C4",
|
|
1299
|
+
lrhar: "\u21CB",
|
|
1300
|
+
leftrightharpoons: "\u21CB",
|
|
1301
|
+
ReverseEquilibrium: "\u21CB",
|
|
1302
|
+
rlhar: "\u21CC",
|
|
1303
|
+
rightleftharpoons: "\u21CC",
|
|
1304
|
+
Equilibrium: "\u21CC",
|
|
1305
|
+
udarr: "\u21C5",
|
|
1306
|
+
UpArrowDownArrow: "\u21C5",
|
|
1307
|
+
duarr: "\u21F5",
|
|
1308
|
+
DownArrowUpArrow: "\u21F5",
|
|
1309
|
+
llarr: "\u21C7",
|
|
1310
|
+
leftleftarrows: "\u21C7",
|
|
1311
|
+
rrarr: "\u21C9",
|
|
1312
|
+
rightrightarrows: "\u21C9",
|
|
1313
|
+
ddarr: "\u21CA",
|
|
1314
|
+
downdownarrows: "\u21CA",
|
|
1315
|
+
har: "\u21BD",
|
|
1316
|
+
lhard: "\u21BD",
|
|
1317
|
+
leftharpoondown: "\u21BD",
|
|
1318
|
+
lharu: "\u21BC",
|
|
1319
|
+
leftharpoonup: "\u21BC",
|
|
1320
|
+
rhard: "\u21C1",
|
|
1321
|
+
rightharpoondown: "\u21C1",
|
|
1322
|
+
rharu: "\u21C0",
|
|
1323
|
+
rightharpoonup: "\u21C0",
|
|
1324
|
+
lsh: "\u21B0",
|
|
1325
|
+
Lsh: "\u21B0",
|
|
1326
|
+
rsh: "\u21B1",
|
|
1327
|
+
Rsh: "\u21B1",
|
|
1328
|
+
ldsh: "\u21B2",
|
|
1329
|
+
rdsh: "\u21B3",
|
|
1330
|
+
hookleftarrow: "\u21A9",
|
|
1331
|
+
hookrightarrow: "\u21AA",
|
|
1332
|
+
mapstoleft: "\u21A4",
|
|
1333
|
+
mapstoup: "\u21A5",
|
|
1334
|
+
map: "\u21A6",
|
|
1335
|
+
mapsto: "\u21A6",
|
|
1336
|
+
mapstodown: "\u21A7",
|
|
1337
|
+
crarr: "\u21B5",
|
|
1338
|
+
nwarrow: "\u2196",
|
|
1339
|
+
nearrow: "\u2197",
|
|
1340
|
+
searrow: "\u2198",
|
|
1341
|
+
swarrow: "\u2199",
|
|
1342
|
+
nleftarrow: "\u219A",
|
|
1343
|
+
nleftrightarrow: "\u21AE",
|
|
1344
|
+
nrightarrow: "\u219B",
|
|
1345
|
+
nrarr: "\u219B",
|
|
1346
|
+
larrtl: "\u21A2",
|
|
1347
|
+
rarrtl: "\u21A3",
|
|
1348
|
+
leftarrowtail: "\u21A2",
|
|
1349
|
+
rightarrowtail: "\u21A3",
|
|
1350
|
+
twoheadleftarrow: "\u219E",
|
|
1351
|
+
twoheadrightarrow: "\u21A0",
|
|
1352
|
+
Larr: "\u219E",
|
|
1353
|
+
Rarr: "\u21A0",
|
|
1354
|
+
larrhk: "\u21A9",
|
|
1355
|
+
rarrhk: "\u21AA",
|
|
1356
|
+
larrlp: "\u21AB",
|
|
1357
|
+
looparrowleft: "\u21AB",
|
|
1358
|
+
rarrlp: "\u21AC",
|
|
1359
|
+
looparrowright: "\u21AC",
|
|
1360
|
+
harrw: "\u21AD",
|
|
1361
|
+
leftrightsquigarrow: "\u21AD",
|
|
1362
|
+
nrarrw: "\u219D\u0338",
|
|
1363
|
+
rarrw: "\u219D",
|
|
1364
|
+
rightsquigarrow: "\u219D",
|
|
1365
|
+
larrbfs: "\u291F",
|
|
1366
|
+
rarrbfs: "\u2920",
|
|
1367
|
+
nvHarr: "\u2904",
|
|
1368
|
+
nvlArr: "\u2902",
|
|
1369
|
+
nvrArr: "\u2903",
|
|
1370
|
+
larrfs: "\u291D",
|
|
1371
|
+
rarrfs: "\u291E",
|
|
1372
|
+
Map: "\u2905",
|
|
1373
|
+
larrsim: "\u2973",
|
|
1374
|
+
rarrsim: "\u2974",
|
|
1375
|
+
harrcir: "\u2948",
|
|
1376
|
+
Uarrocir: "\u2949",
|
|
1377
|
+
lurdshar: "\u294A",
|
|
1378
|
+
ldrdhar: "\u2967",
|
|
1379
|
+
ldrushar: "\u294B",
|
|
1380
|
+
rdldhar: "\u2969",
|
|
1381
|
+
lrhard: "\u296D",
|
|
1382
|
+
rlhar: "\u21CC",
|
|
1383
|
+
uharr: "\u21BE",
|
|
1384
|
+
uharl: "\u21BF",
|
|
1385
|
+
dharr: "\u21C2",
|
|
1386
|
+
dharl: "\u21C3",
|
|
1387
|
+
Uarr: "\u219F",
|
|
1388
|
+
Darr: "\u21A1",
|
|
1389
|
+
zigrarr: "\u21DD",
|
|
1390
|
+
nwArr: "\u21D6",
|
|
1391
|
+
neArr: "\u21D7",
|
|
1392
|
+
seArr: "\u21D8",
|
|
1393
|
+
swArr: "\u21D9",
|
|
1394
|
+
nharr: "\u21AE",
|
|
1395
|
+
nhArr: "\u21CE",
|
|
1396
|
+
nlarr: "\u219A",
|
|
1397
|
+
nlArr: "\u21CD",
|
|
1398
|
+
nrarr: "\u219B",
|
|
1399
|
+
nrArr: "\u21CF",
|
|
1400
|
+
larrb: "\u21E4",
|
|
1401
|
+
LeftArrowBar: "\u21E4",
|
|
1402
|
+
rarrb: "\u21E5",
|
|
1403
|
+
RightArrowBar: "\u21E5"
|
|
1404
|
+
};
|
|
1405
|
+
var SHAPES = {
|
|
1406
|
+
square: "\u25A1",
|
|
1407
|
+
Square: "\u25A1",
|
|
1408
|
+
squ: "\u25A1",
|
|
1409
|
+
squf: "\u25AA",
|
|
1410
|
+
squarf: "\u25AA",
|
|
1411
|
+
blacksquar: "\u25AA",
|
|
1412
|
+
blacksquare: "\u25AA",
|
|
1413
|
+
FilledVerySmallSquare: "\u25AA",
|
|
1414
|
+
blk34: "\u2593",
|
|
1415
|
+
blk12: "\u2592",
|
|
1416
|
+
blk14: "\u2591",
|
|
1417
|
+
block: "\u2588",
|
|
1418
|
+
srect: "\u25AD",
|
|
1419
|
+
rect: "\u25AD",
|
|
1420
|
+
sdot: "\u22C5",
|
|
1421
|
+
sdotb: "\u22A1",
|
|
1422
|
+
dotsquare: "\u22A1",
|
|
1423
|
+
triangle: "\u25B5",
|
|
1424
|
+
tri: "\u25B5",
|
|
1425
|
+
trine: "\u25B5",
|
|
1426
|
+
utri: "\u25B5",
|
|
1427
|
+
triangledown: "\u25BF",
|
|
1428
|
+
dtri: "\u25BF",
|
|
1429
|
+
tridown: "\u25BF",
|
|
1430
|
+
triangleleft: "\u25C3",
|
|
1431
|
+
ltri: "\u25C3",
|
|
1432
|
+
triangleright: "\u25B9",
|
|
1433
|
+
rtri: "\u25B9",
|
|
1434
|
+
blacktriangle: "\u25B4",
|
|
1435
|
+
utrif: "\u25B4",
|
|
1436
|
+
blacktriangledown: "\u25BE",
|
|
1437
|
+
dtrif: "\u25BE",
|
|
1438
|
+
blacktriangleleft: "\u25C2",
|
|
1439
|
+
ltrif: "\u25C2",
|
|
1440
|
+
blacktriangleright: "\u25B8",
|
|
1441
|
+
rtrif: "\u25B8",
|
|
1442
|
+
loz: "\u25CA",
|
|
1443
|
+
lozenge: "\u25CA",
|
|
1444
|
+
blacklozenge: "\u29EB",
|
|
1445
|
+
lozf: "\u29EB",
|
|
1446
|
+
bigcirc: "\u25EF",
|
|
1447
|
+
xcirc: "\u25EF",
|
|
1448
|
+
circ: "\u02C6",
|
|
1449
|
+
Circle: "\u25CB",
|
|
1450
|
+
cir: "\u25CB",
|
|
1451
|
+
o: "\u25CB",
|
|
1452
|
+
bullet: "\u2022",
|
|
1453
|
+
bull: "\u2022",
|
|
1454
|
+
hellip: "\u2026",
|
|
1455
|
+
mldr: "\u2026",
|
|
1456
|
+
nldr: "\u2025",
|
|
1457
|
+
boxh: "\u2500",
|
|
1458
|
+
HorizontalLine: "\u2500",
|
|
1459
|
+
boxv: "\u2502",
|
|
1460
|
+
boxdr: "\u250C",
|
|
1461
|
+
boxdl: "\u2510",
|
|
1462
|
+
boxur: "\u2514",
|
|
1463
|
+
boxul: "\u2518",
|
|
1464
|
+
boxvr: "\u251C",
|
|
1465
|
+
boxvl: "\u2524",
|
|
1466
|
+
boxhd: "\u252C",
|
|
1467
|
+
boxhu: "\u2534",
|
|
1468
|
+
boxvh: "\u253C",
|
|
1469
|
+
boxH: "\u2550",
|
|
1470
|
+
boxV: "\u2551",
|
|
1471
|
+
boxdR: "\u2552",
|
|
1472
|
+
boxDr: "\u2553",
|
|
1473
|
+
boxDR: "\u2554",
|
|
1474
|
+
boxDl: "\u2555",
|
|
1475
|
+
boxdL: "\u2556",
|
|
1476
|
+
boxDL: "\u2557",
|
|
1477
|
+
boxuR: "\u2558",
|
|
1478
|
+
boxUr: "\u2559",
|
|
1479
|
+
boxUR: "\u255A",
|
|
1480
|
+
boxUl: "\u255C",
|
|
1481
|
+
boxuL: "\u255B",
|
|
1482
|
+
boxUL: "\u255D",
|
|
1483
|
+
boxvR: "\u255E",
|
|
1484
|
+
boxVr: "\u255F",
|
|
1485
|
+
boxVR: "\u2560",
|
|
1486
|
+
boxVl: "\u2562",
|
|
1487
|
+
boxvL: "\u2561",
|
|
1488
|
+
boxVL: "\u2563",
|
|
1489
|
+
boxHd: "\u2564",
|
|
1490
|
+
boxhD: "\u2565",
|
|
1491
|
+
boxHD: "\u2566",
|
|
1492
|
+
boxHu: "\u2567",
|
|
1493
|
+
boxhU: "\u2568",
|
|
1494
|
+
boxHU: "\u2569",
|
|
1495
|
+
boxvH: "\u256A",
|
|
1496
|
+
boxVh: "\u256B",
|
|
1497
|
+
boxVH: "\u256C"
|
|
1498
|
+
};
|
|
1499
|
+
var PUNCTUATION = {
|
|
1500
|
+
excl: "!",
|
|
1501
|
+
iexcl: "\xA1",
|
|
1502
|
+
brvbar: "\xA6",
|
|
1503
|
+
sect: "\xA7",
|
|
1504
|
+
uml: "\xA8",
|
|
1505
|
+
copy: "\xA9",
|
|
1506
|
+
ordf: "\xAA",
|
|
1507
|
+
laquo: "\xAB",
|
|
1508
|
+
not: "\xAC",
|
|
1509
|
+
shy: "\xAD",
|
|
1510
|
+
reg: "\xAE",
|
|
1511
|
+
macr: "\xAF",
|
|
1512
|
+
deg: "\xB0",
|
|
1513
|
+
plusmn: "\xB1",
|
|
1514
|
+
sup2: "\xB2",
|
|
1515
|
+
sup3: "\xB3",
|
|
1516
|
+
acute: "\xB4",
|
|
1517
|
+
micro: "\xB5",
|
|
1518
|
+
para: "\xB6",
|
|
1519
|
+
middot: "\xB7",
|
|
1520
|
+
cedil: "\xB8",
|
|
1521
|
+
sup1: "\xB9",
|
|
1522
|
+
ordm: "\xBA",
|
|
1523
|
+
raquo: "\xBB",
|
|
1524
|
+
frac14: "\xBC",
|
|
1525
|
+
frac12: "\xBD",
|
|
1526
|
+
frac34: "\xBE",
|
|
1527
|
+
iquest: "\xBF",
|
|
1528
|
+
nbsp: "\xA0",
|
|
1529
|
+
comma: ",",
|
|
1530
|
+
period: ".",
|
|
1531
|
+
colon: ":",
|
|
1532
|
+
semi: ";",
|
|
1533
|
+
vert: "|",
|
|
1534
|
+
Verbar: "\u2016",
|
|
1535
|
+
verbar: "|",
|
|
1536
|
+
dblac: "\u02DD",
|
|
1537
|
+
circ: "\u02C6",
|
|
1538
|
+
caron: "\u02C7",
|
|
1539
|
+
breve: "\u02D8",
|
|
1540
|
+
dot: "\u02D9",
|
|
1541
|
+
ring: "\u02DA",
|
|
1542
|
+
ogon: "\u02DB",
|
|
1543
|
+
tilde: "\u02DC",
|
|
1544
|
+
DiacriticalGrave: "`",
|
|
1545
|
+
DiacriticalAcute: "\xB4",
|
|
1546
|
+
DiacriticalTilde: "\u02DC",
|
|
1547
|
+
DiacriticalDot: "\u02D9",
|
|
1548
|
+
DiacriticalDoubleAcute: "\u02DD",
|
|
1549
|
+
grave: "`",
|
|
1550
|
+
acute: "\xB4"
|
|
1551
|
+
};
|
|
1552
|
+
var CURRENCY = {
|
|
1553
|
+
cent: "\xA2",
|
|
1554
|
+
pound: "\xA3",
|
|
1555
|
+
curren: "\xA4",
|
|
1556
|
+
yen: "\xA5",
|
|
1557
|
+
euro: "\u20AC",
|
|
1558
|
+
dollar: "$",
|
|
1559
|
+
euro: "\u20AC",
|
|
1560
|
+
fnof: "\u0192",
|
|
1561
|
+
inr: "\u20B9",
|
|
1562
|
+
af: "\u060B",
|
|
1563
|
+
birr: "\u1265\u122D",
|
|
1564
|
+
peso: "\u20B1",
|
|
1565
|
+
rub: "\u20BD",
|
|
1566
|
+
won: "\u20A9",
|
|
1567
|
+
yuan: "\xA5",
|
|
1568
|
+
cedil: "\xB8"
|
|
1569
|
+
};
|
|
1570
|
+
var FRACTIONS = {
|
|
1571
|
+
frac12: "\xBD",
|
|
1572
|
+
half: "\xBD",
|
|
1573
|
+
frac13: "\u2153",
|
|
1574
|
+
frac14: "\xBC",
|
|
1575
|
+
frac15: "\u2155",
|
|
1576
|
+
frac16: "\u2159",
|
|
1577
|
+
frac18: "\u215B",
|
|
1578
|
+
frac23: "\u2154",
|
|
1579
|
+
frac25: "\u2156",
|
|
1580
|
+
frac34: "\xBE",
|
|
1581
|
+
frac35: "\u2157",
|
|
1582
|
+
frac38: "\u215C",
|
|
1583
|
+
frac45: "\u2158",
|
|
1584
|
+
frac56: "\u215A",
|
|
1585
|
+
frac58: "\u215D",
|
|
1586
|
+
frac78: "\u215E",
|
|
1587
|
+
frasl: "\u2044"
|
|
1588
|
+
};
|
|
1589
|
+
var MISC_SYMBOLS = {
|
|
1590
|
+
trade: "\u2122",
|
|
1591
|
+
TRADE: "\u2122",
|
|
1592
|
+
telrec: "\u2315",
|
|
1593
|
+
target: "\u2316",
|
|
1594
|
+
ulcorn: "\u231C",
|
|
1595
|
+
ulcorner: "\u231C",
|
|
1596
|
+
urcorn: "\u231D",
|
|
1597
|
+
urcorner: "\u231D",
|
|
1598
|
+
dlcorn: "\u231E",
|
|
1599
|
+
llcorner: "\u231E",
|
|
1600
|
+
drcorn: "\u231F",
|
|
1601
|
+
lrcorner: "\u231F",
|
|
1602
|
+
intercal: "\u22BA",
|
|
1603
|
+
intcal: "\u22BA",
|
|
1604
|
+
oplus: "\u2295",
|
|
1605
|
+
CirclePlus: "\u2295",
|
|
1606
|
+
ominus: "\u2296",
|
|
1607
|
+
CircleMinus: "\u2296",
|
|
1608
|
+
otimes: "\u2297",
|
|
1609
|
+
CircleTimes: "\u2297",
|
|
1610
|
+
osol: "\u2298",
|
|
1611
|
+
odot: "\u2299",
|
|
1612
|
+
CircleDot: "\u2299",
|
|
1613
|
+
oast: "\u229B",
|
|
1614
|
+
circledast: "\u229B",
|
|
1615
|
+
odash: "\u229D",
|
|
1616
|
+
circleddash: "\u229D",
|
|
1617
|
+
ocirc: "\u229A",
|
|
1618
|
+
circledcirc: "\u229A",
|
|
1619
|
+
boxplus: "\u229E",
|
|
1620
|
+
plusb: "\u229E",
|
|
1621
|
+
boxminus: "\u229F",
|
|
1622
|
+
minusb: "\u229F",
|
|
1623
|
+
boxtimes: "\u22A0",
|
|
1624
|
+
timesb: "\u22A0",
|
|
1625
|
+
boxdot: "\u22A1",
|
|
1626
|
+
sdotb: "\u22A1",
|
|
1627
|
+
veebar: "\u22BB",
|
|
1628
|
+
vee: "\u2228",
|
|
1629
|
+
barvee: "\u22BD",
|
|
1630
|
+
and: "\u2227",
|
|
1631
|
+
wedge: "\u2227",
|
|
1632
|
+
Cap: "\u22D2",
|
|
1633
|
+
Cup: "\u22D3",
|
|
1634
|
+
Fork: "\u22D4",
|
|
1635
|
+
pitchfork: "\u22D4",
|
|
1636
|
+
epar: "\u22D5",
|
|
1637
|
+
ltlarr: "\u2976",
|
|
1638
|
+
nvap: "\u224D\u20D2",
|
|
1639
|
+
nvsim: "\u223C\u20D2",
|
|
1640
|
+
nvge: "\u2265\u20D2",
|
|
1641
|
+
nvle: "\u2264\u20D2",
|
|
1642
|
+
nvlt: "<\u20D2",
|
|
1643
|
+
nvgt: ">\u20D2",
|
|
1644
|
+
nvltrie: "\u22B4\u20D2",
|
|
1645
|
+
nvrtrie: "\u22B5\u20D2",
|
|
1646
|
+
Vdash: "\u22A9",
|
|
1647
|
+
dashv: "\u22A3",
|
|
1648
|
+
vDash: "\u22A8",
|
|
1649
|
+
Vdash: "\u22A9",
|
|
1650
|
+
Vvdash: "\u22AA",
|
|
1651
|
+
nvdash: "\u22AC",
|
|
1652
|
+
nvDash: "\u22AD",
|
|
1653
|
+
nVdash: "\u22AE",
|
|
1654
|
+
nVDash: "\u22AF"
|
|
1655
|
+
};
|
|
1656
|
+
var ALL_ENTITIES = {
|
|
1657
|
+
...BASIC_LATIN,
|
|
1658
|
+
...LATIN_ACCENTS,
|
|
1659
|
+
...LATIN_EXTENDED,
|
|
1660
|
+
...GREEK,
|
|
1661
|
+
...CYRILLIC,
|
|
1662
|
+
...MATH,
|
|
1663
|
+
...MATH_ADVANCED,
|
|
1664
|
+
...ARROWS,
|
|
1665
|
+
...SHAPES,
|
|
1666
|
+
...PUNCTUATION,
|
|
1667
|
+
...CURRENCY,
|
|
1668
|
+
...FRACTIONS,
|
|
1669
|
+
...MISC_SYMBOLS
|
|
1670
|
+
};
|
|
1671
|
+
var XML = {
|
|
1672
|
+
amp: "&",
|
|
1673
|
+
apos: "'",
|
|
1674
|
+
gt: ">",
|
|
1675
|
+
lt: "<",
|
|
1676
|
+
quot: '"'
|
|
1677
|
+
};
|
|
1678
|
+
var COMMON_HTML = {
|
|
1679
|
+
nbsp: "\xA0",
|
|
1680
|
+
copy: "\xA9",
|
|
1681
|
+
reg: "\xAE",
|
|
1682
|
+
trade: "\u2122",
|
|
1683
|
+
mdash: "\u2014",
|
|
1684
|
+
ndash: "\u2013",
|
|
1685
|
+
hellip: "\u2026",
|
|
1686
|
+
laquo: "\xAB",
|
|
1687
|
+
raquo: "\xBB",
|
|
1688
|
+
lsquo: "\u2018",
|
|
1689
|
+
rsquo: "\u2019",
|
|
1690
|
+
ldquo: "\u201C",
|
|
1691
|
+
rdquo: "\u201D",
|
|
1692
|
+
bull: "\u2022",
|
|
1693
|
+
para: "\xB6",
|
|
1694
|
+
sect: "\xA7",
|
|
1695
|
+
deg: "\xB0",
|
|
1696
|
+
frac12: "\xBD",
|
|
1697
|
+
frac14: "\xBC",
|
|
1698
|
+
frac34: "\xBE"
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
// ../node_modules/.bun/@nodable+entities@2.1.0/node_modules/@nodable/entities/src/EntityDecoder.js
|
|
1702
|
+
var SPECIAL_CHARS = new Set("!?\\\\/[]$%{}^&*()<>|+");
|
|
1703
|
+
function validateEntityName(name) {
|
|
1704
|
+
if (name[0] === "#") {
|
|
1705
|
+
throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`);
|
|
1706
|
+
}
|
|
1707
|
+
for (const ch of name) {
|
|
1708
|
+
if (SPECIAL_CHARS.has(ch)) {
|
|
1709
|
+
throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
return name;
|
|
1713
|
+
}
|
|
1714
|
+
function mergeEntityMaps(...maps) {
|
|
1715
|
+
const out = /* @__PURE__ */ Object.create(null);
|
|
1716
|
+
for (const map of maps) {
|
|
1717
|
+
if (!map) continue;
|
|
1718
|
+
for (const key of Object.keys(map)) {
|
|
1719
|
+
const raw = map[key];
|
|
1720
|
+
if (typeof raw === "string") {
|
|
1721
|
+
out[key] = raw;
|
|
1722
|
+
} else if (raw && typeof raw === "object" && raw.val !== void 0) {
|
|
1723
|
+
const val = raw.val;
|
|
1724
|
+
if (typeof val === "string") {
|
|
1725
|
+
out[key] = val;
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
return out;
|
|
1731
|
+
}
|
|
1732
|
+
var LIMIT_TIER_EXTERNAL = "external";
|
|
1733
|
+
var LIMIT_TIER_BASE = "base";
|
|
1734
|
+
var LIMIT_TIER_ALL = "all";
|
|
1735
|
+
function parseLimitTiers(raw) {
|
|
1736
|
+
if (!raw || raw === LIMIT_TIER_EXTERNAL) return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL]);
|
|
1737
|
+
if (raw === LIMIT_TIER_ALL) return /* @__PURE__ */ new Set([LIMIT_TIER_ALL]);
|
|
1738
|
+
if (raw === LIMIT_TIER_BASE) return /* @__PURE__ */ new Set([LIMIT_TIER_BASE]);
|
|
1739
|
+
if (Array.isArray(raw)) return new Set(raw);
|
|
1740
|
+
return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL]);
|
|
1741
|
+
}
|
|
1742
|
+
var NCR_LEVEL = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 });
|
|
1743
|
+
var XML10_ALLOWED_C0 = /* @__PURE__ */ new Set([9, 10, 13]);
|
|
1744
|
+
function parseNCRConfig(ncr) {
|
|
1745
|
+
if (!ncr) {
|
|
1746
|
+
return { xmlVersion: 1, onLevel: NCR_LEVEL.allow, nullLevel: NCR_LEVEL.remove };
|
|
1747
|
+
}
|
|
1748
|
+
const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1;
|
|
1749
|
+
const onLevel = NCR_LEVEL[ncr.onNCR] ?? NCR_LEVEL.allow;
|
|
1750
|
+
const nullLevel = NCR_LEVEL[ncr.nullNCR] ?? NCR_LEVEL.remove;
|
|
1751
|
+
const clampedNull = Math.max(nullLevel, NCR_LEVEL.remove);
|
|
1752
|
+
return { xmlVersion, onLevel, nullLevel: clampedNull };
|
|
1753
|
+
}
|
|
1754
|
+
var EntityDecoder = class {
|
|
1755
|
+
/**
|
|
1756
|
+
* @param {object} [options]
|
|
1757
|
+
* @param {object|null} [options.namedEntities] — extra named entities merged into base map
|
|
1758
|
+
* @param {object} [options.limit] — security limits
|
|
1759
|
+
* @param {number} [options.limit.maxTotalExpansions=0] — 0 = unlimited
|
|
1760
|
+
* @param {number} [options.limit.maxExpandedLength=0] — 0 = unlimited
|
|
1761
|
+
* @param {'external'|'base'|'all'|string[]} [options.limit.applyLimitsTo='external']
|
|
1762
|
+
* Which entity tiers count against the security limits:
|
|
1763
|
+
* - 'external' (default) — only input/runtime + persistent external entities
|
|
1764
|
+
* - 'base' — only DEFAULT_XML_ENTITIES + namedEntities
|
|
1765
|
+
* - 'all' — every entity regardless of tier
|
|
1766
|
+
* - string[] — explicit combination, e.g. ['external', 'base']
|
|
1767
|
+
* @param {((resolved: string, original: string) => string)|null} [options.postCheck=null]
|
|
1768
|
+
* @param {string[]} [options.remove=[]] — entity names (e.g. ['nbsp', '#13']) to delete (replace with empty string)
|
|
1769
|
+
* @param {string[]} [options.leave=[]] — entity names to keep as literal (unchanged in output)
|
|
1770
|
+
* @param {object} [options.ncr] — Numeric Character Reference controls
|
|
1771
|
+
* @param {1.0|1.1} [options.ncr.xmlVersion=1.0]
|
|
1772
|
+
* XML version governing which codepoint ranges are restricted:
|
|
1773
|
+
* - 1.0 — C0 controls U+0001–U+001F (except U+0009/000A/000D) are prohibited
|
|
1774
|
+
* - 1.1 — C0 controls are allowed when written as NCRs; C1 (U+007F–U+009F) decoded as-is
|
|
1775
|
+
* @param {'allow'|'leave'|'remove'|'throw'} [options.ncr.onNCR='allow']
|
|
1776
|
+
* Base action for numeric references. Severity order: allow < leave < remove < throw.
|
|
1777
|
+
* For codepoint ranges that carry a minimum level (surrogates → remove, XML 1.0 C0 → remove),
|
|
1778
|
+
* the effective action is max(onNCR, rangeMinimum).
|
|
1779
|
+
* @param {'remove'|'throw'} [options.ncr.nullNCR='remove']
|
|
1780
|
+
* Action for U+0000 (null). 'allow' and 'leave' are clamped to 'remove' since null is never safe.
|
|
1781
|
+
*/
|
|
1782
|
+
constructor(options = {}) {
|
|
1783
|
+
this._limit = options.limit || {};
|
|
1784
|
+
this._maxTotalExpansions = this._limit.maxTotalExpansions || 0;
|
|
1785
|
+
this._maxExpandedLength = this._limit.maxExpandedLength || 0;
|
|
1786
|
+
this._postCheck = typeof options.postCheck === "function" ? options.postCheck : (r2) => r2;
|
|
1787
|
+
this._limitTiers = parseLimitTiers(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL);
|
|
1788
|
+
this._numericAllowed = options.numericAllowed ?? true;
|
|
1789
|
+
this._baseMap = mergeEntityMaps(XML, options.namedEntities || null);
|
|
1790
|
+
this._externalMap = /* @__PURE__ */ Object.create(null);
|
|
1791
|
+
this._inputMap = /* @__PURE__ */ Object.create(null);
|
|
1792
|
+
this._totalExpansions = 0;
|
|
1793
|
+
this._expandedLength = 0;
|
|
1794
|
+
this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []);
|
|
1795
|
+
this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []);
|
|
1796
|
+
const ncrCfg = parseNCRConfig(options.ncr);
|
|
1797
|
+
this._ncrXmlVersion = ncrCfg.xmlVersion;
|
|
1798
|
+
this._ncrOnLevel = ncrCfg.onLevel;
|
|
1799
|
+
this._ncrNullLevel = ncrCfg.nullLevel;
|
|
1800
|
+
}
|
|
1801
|
+
// -------------------------------------------------------------------------
|
|
1802
|
+
// Persistent external entity registration
|
|
1803
|
+
// -------------------------------------------------------------------------
|
|
1804
|
+
/**
|
|
1805
|
+
* Replace the full set of persistent external entities.
|
|
1806
|
+
* All keys are validated — throws on invalid characters.
|
|
1807
|
+
* @param {Record<string, string | { regex?: RegExp, val: string }>} map
|
|
1808
|
+
*/
|
|
1809
|
+
setExternalEntities(map) {
|
|
1810
|
+
if (map) {
|
|
1811
|
+
for (const key of Object.keys(map)) {
|
|
1812
|
+
validateEntityName(key);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
this._externalMap = mergeEntityMaps(map);
|
|
1816
|
+
}
|
|
1817
|
+
/**
|
|
1818
|
+
* Add a single persistent external entity.
|
|
1819
|
+
* @param {string} key
|
|
1820
|
+
* @param {string} value
|
|
1821
|
+
*/
|
|
1822
|
+
addExternalEntity(key, value) {
|
|
1823
|
+
validateEntityName(key);
|
|
1824
|
+
if (typeof value === "string" && value.indexOf("&") === -1) {
|
|
1825
|
+
this._externalMap[key] = value;
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
// -------------------------------------------------------------------------
|
|
1829
|
+
// Input / runtime entity registration (per document)
|
|
1830
|
+
// -------------------------------------------------------------------------
|
|
1831
|
+
/**
|
|
1832
|
+
* Inject DOCTYPE entities for the current document.
|
|
1833
|
+
* Also resets per-document expansion counters.
|
|
1834
|
+
* @param {Record<string, string | { regx?: RegExp, regex?: RegExp, val: string }>} map
|
|
1835
|
+
*/
|
|
1836
|
+
addInputEntities(map) {
|
|
1837
|
+
this._totalExpansions = 0;
|
|
1838
|
+
this._expandedLength = 0;
|
|
1839
|
+
this._inputMap = mergeEntityMaps(map);
|
|
1840
|
+
}
|
|
1841
|
+
// -------------------------------------------------------------------------
|
|
1842
|
+
// Per-document reset
|
|
1843
|
+
// -------------------------------------------------------------------------
|
|
1844
|
+
/**
|
|
1845
|
+
* Wipe input/runtime entities and reset counters.
|
|
1846
|
+
* Call this before processing each new document.
|
|
1847
|
+
* @returns {this}
|
|
1848
|
+
*/
|
|
1849
|
+
reset() {
|
|
1850
|
+
this._inputMap = /* @__PURE__ */ Object.create(null);
|
|
1851
|
+
this._totalExpansions = 0;
|
|
1852
|
+
this._expandedLength = 0;
|
|
1853
|
+
return this;
|
|
1854
|
+
}
|
|
1855
|
+
// -------------------------------------------------------------------------
|
|
1856
|
+
// XML version (can be set after construction, e.g. once parser reads <?xml?>)
|
|
1857
|
+
// -------------------------------------------------------------------------
|
|
1858
|
+
/**
|
|
1859
|
+
* Update the XML version used for NCR classification.
|
|
1860
|
+
* Call this as soon as the document's `<?xml version="...">` declaration is parsed.
|
|
1861
|
+
* @param {1.0|1.1|number} version
|
|
1862
|
+
*/
|
|
1863
|
+
setXmlVersion(version) {
|
|
1864
|
+
this._ncrXmlVersion = version === 1.1 ? 1.1 : 1;
|
|
1865
|
+
}
|
|
1866
|
+
// -------------------------------------------------------------------------
|
|
1867
|
+
// Primary API
|
|
1868
|
+
// -------------------------------------------------------------------------
|
|
1869
|
+
/**
|
|
1870
|
+
* Replace all entity references in `str` in a single pass.
|
|
1871
|
+
*
|
|
1872
|
+
* @param {string} str
|
|
1873
|
+
* @returns {string}
|
|
1874
|
+
*/
|
|
1875
|
+
decode(str) {
|
|
1876
|
+
if (typeof str !== "string" || str.length === 0) return str;
|
|
1877
|
+
const original = str;
|
|
1878
|
+
const chunks = [];
|
|
1879
|
+
const len = str.length;
|
|
1880
|
+
let last = 0;
|
|
1881
|
+
let i2 = 0;
|
|
1882
|
+
const limitExpansions = this._maxTotalExpansions > 0;
|
|
1883
|
+
const limitLength = this._maxExpandedLength > 0;
|
|
1884
|
+
const checkLimits = limitExpansions || limitLength;
|
|
1885
|
+
while (i2 < len) {
|
|
1886
|
+
if (str.charCodeAt(i2) !== 38) {
|
|
1887
|
+
i2++;
|
|
1888
|
+
continue;
|
|
1889
|
+
}
|
|
1890
|
+
let j2 = i2 + 1;
|
|
1891
|
+
while (j2 < len && str.charCodeAt(j2) !== 59 && j2 - i2 <= 32) j2++;
|
|
1892
|
+
if (j2 >= len || str.charCodeAt(j2) !== 59) {
|
|
1893
|
+
i2++;
|
|
1894
|
+
continue;
|
|
1895
|
+
}
|
|
1896
|
+
const token = str.slice(i2 + 1, j2);
|
|
1897
|
+
if (token.length === 0) {
|
|
1898
|
+
i2++;
|
|
1899
|
+
continue;
|
|
1900
|
+
}
|
|
1901
|
+
let replacement;
|
|
1902
|
+
let tier;
|
|
1903
|
+
if (this._removeSet.has(token)) {
|
|
1904
|
+
replacement = "";
|
|
1905
|
+
if (tier === void 0) {
|
|
1906
|
+
tier = LIMIT_TIER_EXTERNAL;
|
|
1907
|
+
}
|
|
1908
|
+
} else if (this._leaveSet.has(token)) {
|
|
1909
|
+
i2++;
|
|
1910
|
+
continue;
|
|
1911
|
+
} else if (token.charCodeAt(0) === 35) {
|
|
1912
|
+
const ncrResult = this._resolveNCR(token);
|
|
1913
|
+
if (ncrResult === void 0) {
|
|
1914
|
+
i2++;
|
|
1915
|
+
continue;
|
|
1916
|
+
}
|
|
1917
|
+
replacement = ncrResult;
|
|
1918
|
+
tier = LIMIT_TIER_BASE;
|
|
1919
|
+
} else {
|
|
1920
|
+
const resolved = this._resolveName(token);
|
|
1921
|
+
replacement = resolved?.value;
|
|
1922
|
+
tier = resolved?.tier;
|
|
1923
|
+
}
|
|
1924
|
+
if (replacement === void 0) {
|
|
1925
|
+
i2++;
|
|
1926
|
+
continue;
|
|
1927
|
+
}
|
|
1928
|
+
if (i2 > last) chunks.push(str.slice(last, i2));
|
|
1929
|
+
chunks.push(replacement);
|
|
1930
|
+
last = j2 + 1;
|
|
1931
|
+
i2 = last;
|
|
1932
|
+
if (checkLimits && this._tierCounts(tier)) {
|
|
1933
|
+
if (limitExpansions) {
|
|
1934
|
+
this._totalExpansions++;
|
|
1935
|
+
if (this._totalExpansions > this._maxTotalExpansions) {
|
|
1936
|
+
throw new Error(
|
|
1937
|
+
`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
if (limitLength) {
|
|
1942
|
+
const delta = replacement.length - (token.length + 2);
|
|
1943
|
+
if (delta > 0) {
|
|
1944
|
+
this._expandedLength += delta;
|
|
1945
|
+
if (this._expandedLength > this._maxExpandedLength) {
|
|
1946
|
+
throw new Error(
|
|
1947
|
+
`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`
|
|
1948
|
+
);
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
if (last < len) chunks.push(str.slice(last));
|
|
1955
|
+
const result = chunks.length === 0 ? str : chunks.join("");
|
|
1956
|
+
return this._postCheck(result, original);
|
|
1957
|
+
}
|
|
1958
|
+
// -------------------------------------------------------------------------
|
|
1959
|
+
// Private: limit tier check
|
|
1960
|
+
// -------------------------------------------------------------------------
|
|
1961
|
+
/**
|
|
1962
|
+
* Returns true if a resolved entity of the given tier should count
|
|
1963
|
+
* against the expansion/length limits.
|
|
1964
|
+
* @param {string} tier — LIMIT_TIER_EXTERNAL | LIMIT_TIER_BASE
|
|
1965
|
+
* @returns {boolean}
|
|
1966
|
+
*/
|
|
1967
|
+
_tierCounts(tier) {
|
|
1968
|
+
if (this._limitTiers.has(LIMIT_TIER_ALL)) return true;
|
|
1969
|
+
return this._limitTiers.has(tier);
|
|
1970
|
+
}
|
|
1971
|
+
// -------------------------------------------------------------------------
|
|
1972
|
+
// Private: entity resolution
|
|
1973
|
+
// -------------------------------------------------------------------------
|
|
1974
|
+
/**
|
|
1975
|
+
* Resolve a named entity token (without & and ;).
|
|
1976
|
+
* Priority: inputMap > externalMap > baseMap
|
|
1977
|
+
* Returns the resolved value tagged with its limit tier.
|
|
1978
|
+
*
|
|
1979
|
+
* @param {string} name
|
|
1980
|
+
* @returns {{ value: string, tier: string }|undefined}
|
|
1981
|
+
*/
|
|
1982
|
+
_resolveName(name) {
|
|
1983
|
+
if (name in this._inputMap) return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL };
|
|
1984
|
+
if (name in this._externalMap) return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL };
|
|
1985
|
+
if (name in this._baseMap) return { value: this._baseMap[name], tier: LIMIT_TIER_BASE };
|
|
1986
|
+
return void 0;
|
|
1987
|
+
}
|
|
1988
|
+
/**
|
|
1989
|
+
* Classify a codepoint and return the minimum action level that must be applied.
|
|
1990
|
+
* Returns -1 when no minimum is imposed (normal allow path).
|
|
1991
|
+
*
|
|
1992
|
+
* Ranges checked (in priority order):
|
|
1993
|
+
* 1. U+0000 — null, governed by nullNCR (always ≥ remove)
|
|
1994
|
+
* 2. U+D800–U+DFFF — surrogates, always prohibited (min: remove)
|
|
1995
|
+
* 3. U+0001–U+001F \ {0x09,0x0A,0x0D} — XML 1.0 restricted C0 (min: remove)
|
|
1996
|
+
* (skipped in XML 1.1 — C0 controls are allowed when written as NCRs)
|
|
1997
|
+
*
|
|
1998
|
+
* @param {number} cp — codepoint
|
|
1999
|
+
* @returns {number} — minimum NCR_LEVEL value, or -1 for no restriction
|
|
2000
|
+
*/
|
|
2001
|
+
_classifyNCR(cp) {
|
|
2002
|
+
if (cp === 0) return this._ncrNullLevel;
|
|
2003
|
+
if (cp >= 55296 && cp <= 57343) return NCR_LEVEL.remove;
|
|
2004
|
+
if (this._ncrXmlVersion === 1) {
|
|
2005
|
+
if (cp >= 1 && cp <= 31 && !XML10_ALLOWED_C0.has(cp)) return NCR_LEVEL.remove;
|
|
2006
|
+
}
|
|
2007
|
+
return -1;
|
|
2008
|
+
}
|
|
2009
|
+
/**
|
|
2010
|
+
* Execute a resolved NCR action.
|
|
2011
|
+
*
|
|
2012
|
+
* @param {number} action — NCR_LEVEL value
|
|
2013
|
+
* @param {string} token — raw token (e.g. '#38') for error messages
|
|
2014
|
+
* @param {number} cp — codepoint, used only for error messages
|
|
2015
|
+
* @returns {string|undefined}
|
|
2016
|
+
* - decoded character string → 'allow'
|
|
2017
|
+
* - '' → 'remove'
|
|
2018
|
+
* - undefined → 'leave' (caller must skip past '&' only)
|
|
2019
|
+
* - throws Error → 'throw'
|
|
2020
|
+
*/
|
|
2021
|
+
_applyNCRAction(action, token, cp) {
|
|
2022
|
+
switch (action) {
|
|
2023
|
+
case NCR_LEVEL.allow:
|
|
2024
|
+
return String.fromCodePoint(cp);
|
|
2025
|
+
case NCR_LEVEL.remove:
|
|
2026
|
+
return "";
|
|
2027
|
+
case NCR_LEVEL.leave:
|
|
2028
|
+
return void 0;
|
|
2029
|
+
// signal: keep literal
|
|
2030
|
+
case NCR_LEVEL.throw:
|
|
2031
|
+
throw new Error(
|
|
2032
|
+
`[EntityDecoder] Prohibited numeric character reference &${token}; (U+${cp.toString(16).toUpperCase().padStart(4, "0")})`
|
|
2033
|
+
);
|
|
2034
|
+
default:
|
|
2035
|
+
return String.fromCodePoint(cp);
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
/**
|
|
2039
|
+
* Full NCR resolution pipeline for a numeric token.
|
|
2040
|
+
*
|
|
2041
|
+
* Steps:
|
|
2042
|
+
* 1. Parse the codepoint (decimal or hex).
|
|
2043
|
+
* 2. Validate the raw codepoint range (NaN, <0, >0x10FFFF).
|
|
2044
|
+
* 3. If numericAllowed is false and no minimum restriction applies → leave as-is.
|
|
2045
|
+
* 4. Classify the codepoint to find the minimum required action level.
|
|
2046
|
+
* 5. Resolve effective action = max(onNCR, minimum).
|
|
2047
|
+
* 6. Apply and return.
|
|
2048
|
+
*
|
|
2049
|
+
* @param {string} token — e.g. '#38', '#x26', '#X26'
|
|
2050
|
+
* @returns {string|undefined}
|
|
2051
|
+
* - string (incl. '') — replacement ('' = remove)
|
|
2052
|
+
* - undefined — leave original &token; as-is
|
|
2053
|
+
*/
|
|
2054
|
+
_resolveNCR(token) {
|
|
2055
|
+
const second = token.charCodeAt(1);
|
|
2056
|
+
let cp;
|
|
2057
|
+
if (second === 120 || second === 88) {
|
|
2058
|
+
cp = parseInt(token.slice(2), 16);
|
|
2059
|
+
} else {
|
|
2060
|
+
cp = parseInt(token.slice(1), 10);
|
|
2061
|
+
}
|
|
2062
|
+
if (Number.isNaN(cp) || cp < 0 || cp > 1114111) return void 0;
|
|
2063
|
+
const minimum = this._classifyNCR(cp);
|
|
2064
|
+
if (!this._numericAllowed && minimum < NCR_LEVEL.remove) return void 0;
|
|
2065
|
+
const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum);
|
|
2066
|
+
return this._applyNCRAction(effective, token, cp);
|
|
2067
|
+
}
|
|
2068
|
+
};
|
|
2069
|
+
|
|
2070
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
|
|
618
2071
|
var defaultOnDangerousProperty = (name) => {
|
|
619
2072
|
if (DANGEROUS_PROPERTY_NAMES.includes(name)) {
|
|
620
2073
|
return "__" + name;
|
|
@@ -656,6 +2109,7 @@ var defaultOptions2 = {
|
|
|
656
2109
|
unpairedTags: [],
|
|
657
2110
|
processEntities: true,
|
|
658
2111
|
htmlEntities: false,
|
|
2112
|
+
entityDecoder: null,
|
|
659
2113
|
ignoreDeclaration: false,
|
|
660
2114
|
ignorePiTags: false,
|
|
661
2115
|
transformTagName: false,
|
|
@@ -687,30 +2141,32 @@ function validatePropertyName(propertyName, optionName) {
|
|
|
687
2141
|
);
|
|
688
2142
|
}
|
|
689
2143
|
}
|
|
690
|
-
function normalizeProcessEntities(value) {
|
|
2144
|
+
function normalizeProcessEntities(value, htmlEntities) {
|
|
691
2145
|
if (typeof value === "boolean") {
|
|
692
2146
|
return {
|
|
693
2147
|
enabled: value,
|
|
694
2148
|
// true or false
|
|
695
2149
|
maxEntitySize: 1e4,
|
|
696
|
-
maxExpansionDepth:
|
|
697
|
-
maxTotalExpansions:
|
|
2150
|
+
maxExpansionDepth: 1e4,
|
|
2151
|
+
maxTotalExpansions: Infinity,
|
|
698
2152
|
maxExpandedLength: 1e5,
|
|
699
|
-
maxEntityCount:
|
|
2153
|
+
maxEntityCount: 1e3,
|
|
700
2154
|
allowedTags: null,
|
|
701
|
-
tagFilter: null
|
|
2155
|
+
tagFilter: null,
|
|
2156
|
+
appliesTo: "all"
|
|
702
2157
|
};
|
|
703
2158
|
}
|
|
704
2159
|
if (typeof value === "object" && value !== null) {
|
|
705
2160
|
return {
|
|
706
2161
|
enabled: value.enabled !== false,
|
|
707
2162
|
maxEntitySize: Math.max(1, value.maxEntitySize ?? 1e4),
|
|
708
|
-
maxExpansionDepth: Math.max(1, value.maxExpansionDepth ??
|
|
709
|
-
maxTotalExpansions: Math.max(1, value.maxTotalExpansions ??
|
|
2163
|
+
maxExpansionDepth: Math.max(1, value.maxExpansionDepth ?? 1e4),
|
|
2164
|
+
maxTotalExpansions: Math.max(1, value.maxTotalExpansions ?? Infinity),
|
|
710
2165
|
maxExpandedLength: Math.max(1, value.maxExpandedLength ?? 1e5),
|
|
711
|
-
maxEntityCount: Math.max(1, value.maxEntityCount ??
|
|
2166
|
+
maxEntityCount: Math.max(1, value.maxEntityCount ?? 1e3),
|
|
712
2167
|
allowedTags: value.allowedTags ?? null,
|
|
713
|
-
tagFilter: value.tagFilter ?? null
|
|
2168
|
+
tagFilter: value.tagFilter ?? null,
|
|
2169
|
+
appliesTo: value.appliesTo ?? "all"
|
|
714
2170
|
};
|
|
715
2171
|
}
|
|
716
2172
|
return normalizeProcessEntities(true);
|
|
@@ -732,7 +2188,8 @@ var buildOptions = function(options) {
|
|
|
732
2188
|
if (built.onDangerousProperty === null) {
|
|
733
2189
|
built.onDangerousProperty = defaultOnDangerousProperty;
|
|
734
2190
|
}
|
|
735
|
-
built.processEntities = normalizeProcessEntities(built.processEntities);
|
|
2191
|
+
built.processEntities = normalizeProcessEntities(built.processEntities, built.htmlEntities);
|
|
2192
|
+
built.unpairedTagsSet = new Set(built.unpairedTags);
|
|
736
2193
|
if (built.stopNodes && Array.isArray(built.stopNodes)) {
|
|
737
2194
|
built.stopNodes = built.stopNodes.map((node) => {
|
|
738
2195
|
if (typeof node === "string" && node.startsWith("*.")) {
|
|
@@ -744,7 +2201,7 @@ var buildOptions = function(options) {
|
|
|
744
2201
|
return built;
|
|
745
2202
|
};
|
|
746
2203
|
|
|
747
|
-
// ../node_modules/.bun/fast-xml-parser@5.
|
|
2204
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
|
|
748
2205
|
var METADATA_SYMBOL;
|
|
749
2206
|
if (typeof Symbol !== "function") {
|
|
750
2207
|
METADATA_SYMBOL = "@@xmlMetadata";
|
|
@@ -778,7 +2235,7 @@ var XmlNode = class {
|
|
|
778
2235
|
}
|
|
779
2236
|
};
|
|
780
2237
|
|
|
781
|
-
// ../node_modules/.bun/fast-xml-parser@5.
|
|
2238
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
|
|
782
2239
|
var DocTypeReader = class {
|
|
783
2240
|
constructor(options) {
|
|
784
2241
|
this.suppressValidationErr = !options;
|
|
@@ -804,11 +2261,7 @@ var DocTypeReader = class {
|
|
|
804
2261
|
`Entity count (${entityCount + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`
|
|
805
2262
|
);
|
|
806
2263
|
}
|
|
807
|
-
|
|
808
|
-
entities[entityName] = {
|
|
809
|
-
regx: RegExp(`&${escaped};`, "g"),
|
|
810
|
-
val
|
|
811
|
-
};
|
|
2264
|
+
entities[entityName] = val;
|
|
812
2265
|
entityCount++;
|
|
813
2266
|
}
|
|
814
2267
|
} else if (hasBody && hasSeq(xmlData, "!ELEMENT", i2)) {
|
|
@@ -858,7 +2311,7 @@ var DocTypeReader = class {
|
|
|
858
2311
|
i2++;
|
|
859
2312
|
}
|
|
860
2313
|
let entityName = xmlData.substring(startIndex, i2);
|
|
861
|
-
|
|
2314
|
+
validateEntityName2(entityName);
|
|
862
2315
|
i2 = skipWhitespace(xmlData, i2);
|
|
863
2316
|
if (!this.suppressValidationErr) {
|
|
864
2317
|
if (xmlData.substring(i2, i2 + 6).toUpperCase() === "SYSTEM") {
|
|
@@ -884,7 +2337,7 @@ var DocTypeReader = class {
|
|
|
884
2337
|
i2++;
|
|
885
2338
|
}
|
|
886
2339
|
let notationName = xmlData.substring(startIndex, i2);
|
|
887
|
-
!this.suppressValidationErr &&
|
|
2340
|
+
!this.suppressValidationErr && validateEntityName2(notationName);
|
|
888
2341
|
i2 = skipWhitespace(xmlData, i2);
|
|
889
2342
|
const identifierType = xmlData.substring(i2, i2 + 6).toUpperCase();
|
|
890
2343
|
if (!this.suppressValidationErr && identifierType !== "SYSTEM" && identifierType !== "PUBLIC") {
|
|
@@ -966,14 +2419,14 @@ var DocTypeReader = class {
|
|
|
966
2419
|
i2++;
|
|
967
2420
|
}
|
|
968
2421
|
let elementName = xmlData.substring(startIndex, i2);
|
|
969
|
-
|
|
2422
|
+
validateEntityName2(elementName);
|
|
970
2423
|
i2 = skipWhitespace(xmlData, i2);
|
|
971
2424
|
startIndex = i2;
|
|
972
2425
|
while (i2 < xmlData.length && !/\s/.test(xmlData[i2])) {
|
|
973
2426
|
i2++;
|
|
974
2427
|
}
|
|
975
2428
|
let attributeName = xmlData.substring(startIndex, i2);
|
|
976
|
-
if (!
|
|
2429
|
+
if (!validateEntityName2(attributeName)) {
|
|
977
2430
|
throw new Error(`Invalid attribute name: "${attributeName}"`);
|
|
978
2431
|
}
|
|
979
2432
|
i2 = skipWhitespace(xmlData, i2);
|
|
@@ -994,7 +2447,7 @@ var DocTypeReader = class {
|
|
|
994
2447
|
}
|
|
995
2448
|
let notation = xmlData.substring(startIndex2, i2);
|
|
996
2449
|
notation = notation.trim();
|
|
997
|
-
if (!
|
|
2450
|
+
if (!validateEntityName2(notation)) {
|
|
998
2451
|
throw new Error(`Invalid notation name: "${notation}"`);
|
|
999
2452
|
}
|
|
1000
2453
|
allowedNotations.push(notation);
|
|
@@ -1051,19 +2504,22 @@ function hasSeq(data, seq, i2) {
|
|
|
1051
2504
|
}
|
|
1052
2505
|
return true;
|
|
1053
2506
|
}
|
|
1054
|
-
function
|
|
2507
|
+
function validateEntityName2(name) {
|
|
1055
2508
|
if (isName(name))
|
|
1056
2509
|
return name;
|
|
1057
2510
|
else
|
|
1058
2511
|
throw new Error(`Invalid entity name ${name}`);
|
|
1059
2512
|
}
|
|
1060
2513
|
|
|
1061
|
-
// ../node_modules/.bun/strnum@2.
|
|
2514
|
+
// ../node_modules/.bun/strnum@2.3.0/node_modules/strnum/strnum.js
|
|
1062
2515
|
var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
|
|
2516
|
+
var binRegex = /^0b[01]+$/;
|
|
2517
|
+
var octRegex = /^0o[0-7]+$/;
|
|
1063
2518
|
var numRegex = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
|
|
1064
2519
|
var consider = {
|
|
1065
2520
|
hex: true,
|
|
1066
|
-
|
|
2521
|
+
binary: false,
|
|
2522
|
+
octal: false,
|
|
1067
2523
|
leadingZeros: true,
|
|
1068
2524
|
decimalPoint: ".",
|
|
1069
2525
|
eNotation: true,
|
|
@@ -1080,6 +2536,10 @@ function toNumber(str, options = {}) {
|
|
|
1080
2536
|
else if (trimmedStr === "0") return 0;
|
|
1081
2537
|
else if (options.hex && hexRegex.test(trimmedStr)) {
|
|
1082
2538
|
return parse_int(trimmedStr, 16);
|
|
2539
|
+
} else if (options.binary && binRegex.test(trimmedStr)) {
|
|
2540
|
+
return parse_int(trimmedStr, 2);
|
|
2541
|
+
} else if (options.octal && octRegex.test(trimmedStr)) {
|
|
2542
|
+
return parse_int(trimmedStr, 8);
|
|
1083
2543
|
} else if (!isFinite(trimmedStr)) {
|
|
1084
2544
|
return handleInfinity(str, Number(trimmedStr), options);
|
|
1085
2545
|
} else if (trimmedStr.includes("e") || trimmedStr.includes("E")) {
|
|
@@ -1159,6 +2619,8 @@ function trimZeros(numStr) {
|
|
|
1159
2619
|
return numStr;
|
|
1160
2620
|
}
|
|
1161
2621
|
function parse_int(numStr, base) {
|
|
2622
|
+
const str = numStr.trim();
|
|
2623
|
+
if (base === 2 || base === 8) numStr = str.substring(2);
|
|
1162
2624
|
if (parseInt) return parseInt(numStr, base);
|
|
1163
2625
|
else if (Number.parseInt) return Number.parseInt(numStr, base);
|
|
1164
2626
|
else if (window && window.parseInt) return window.parseInt(numStr, base);
|
|
@@ -1180,7 +2642,7 @@ function handleInfinity(str, num, options) {
|
|
|
1180
2642
|
}
|
|
1181
2643
|
}
|
|
1182
2644
|
|
|
1183
|
-
// ../node_modules/.bun/fast-xml-parser@5.
|
|
2645
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/ignoreAttributes.js
|
|
1184
2646
|
function getIgnoreAttributesFn(ignoreAttributes) {
|
|
1185
2647
|
if (typeof ignoreAttributes === "function") {
|
|
1186
2648
|
return ignoreAttributes;
|
|
@@ -1200,7 +2662,7 @@ function getIgnoreAttributesFn(ignoreAttributes) {
|
|
|
1200
2662
|
return () => false;
|
|
1201
2663
|
}
|
|
1202
2664
|
|
|
1203
|
-
// ../node_modules/.bun/path-expression-matcher@1.
|
|
2665
|
+
// ../node_modules/.bun/path-expression-matcher@1.5.0/node_modules/path-expression-matcher/src/Expression.js
|
|
1204
2666
|
var Expression = class {
|
|
1205
2667
|
/**
|
|
1206
2668
|
* Create a new Expression
|
|
@@ -1208,10 +2670,11 @@ var Expression = class {
|
|
|
1208
2670
|
* @param {Object} options - Configuration options
|
|
1209
2671
|
* @param {string} options.separator - Path separator (default: '.')
|
|
1210
2672
|
*/
|
|
1211
|
-
constructor(pattern, options = {}) {
|
|
2673
|
+
constructor(pattern, options = {}, data) {
|
|
1212
2674
|
this.pattern = pattern;
|
|
1213
2675
|
this.separator = options.separator || ".";
|
|
1214
2676
|
this.segments = this._parse(pattern);
|
|
2677
|
+
this.data = data;
|
|
1215
2678
|
this._hasDeepWildcard = this.segments.some((seg) => seg.type === "deep-wildcard");
|
|
1216
2679
|
this._hasAttributeCondition = this.segments.some((seg) => seg.attrName !== void 0);
|
|
1217
2680
|
this._hasPositionSelector = this.segments.some((seg) => seg.position !== void 0);
|
|
@@ -1362,120 +2825,389 @@ var Expression = class {
|
|
|
1362
2825
|
}
|
|
1363
2826
|
};
|
|
1364
2827
|
|
|
1365
|
-
// ../node_modules/.bun/path-expression-matcher@1.
|
|
1366
|
-
var
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
constructor(options = {}) {
|
|
1374
|
-
this.separator = options.separator || ".";
|
|
1375
|
-
this.path = [];
|
|
1376
|
-
this.siblingStacks = [];
|
|
2828
|
+
// ../node_modules/.bun/path-expression-matcher@1.5.0/node_modules/path-expression-matcher/src/ExpressionSet.js
|
|
2829
|
+
var ExpressionSet = class {
|
|
2830
|
+
constructor() {
|
|
2831
|
+
this._byDepthAndTag = /* @__PURE__ */ new Map();
|
|
2832
|
+
this._wildcardByDepth = /* @__PURE__ */ new Map();
|
|
2833
|
+
this._deepWildcards = [];
|
|
2834
|
+
this._patterns = /* @__PURE__ */ new Set();
|
|
2835
|
+
this._sealed = false;
|
|
1377
2836
|
}
|
|
1378
2837
|
/**
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1382
|
-
* @param {
|
|
2838
|
+
* Add an Expression to the set.
|
|
2839
|
+
* Duplicate patterns (same pattern string) are silently ignored.
|
|
2840
|
+
*
|
|
2841
|
+
* @param {import('./Expression.js').default} expression - A pre-constructed Expression instance
|
|
2842
|
+
* @returns {this} for chaining
|
|
2843
|
+
* @throws {TypeError} if called after seal()
|
|
2844
|
+
*
|
|
2845
|
+
* @example
|
|
2846
|
+
* set.add(new Expression('root.users.user'));
|
|
2847
|
+
* set.add(new Expression('..script'));
|
|
1383
2848
|
*/
|
|
1384
|
-
|
|
1385
|
-
this.
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
}
|
|
1390
|
-
const currentLevel = this.path.length;
|
|
1391
|
-
if (!this.siblingStacks[currentLevel]) {
|
|
1392
|
-
this.siblingStacks[currentLevel] = /* @__PURE__ */ new Map();
|
|
1393
|
-
}
|
|
1394
|
-
const siblings = this.siblingStacks[currentLevel];
|
|
1395
|
-
const siblingKey = namespace ? `${namespace}:${tagName}` : tagName;
|
|
1396
|
-
const counter = siblings.get(siblingKey) || 0;
|
|
1397
|
-
let position = 0;
|
|
1398
|
-
for (const count of siblings.values()) {
|
|
1399
|
-
position += count;
|
|
1400
|
-
}
|
|
1401
|
-
siblings.set(siblingKey, counter + 1);
|
|
1402
|
-
const node = {
|
|
1403
|
-
tag: tagName,
|
|
1404
|
-
position,
|
|
1405
|
-
counter
|
|
1406
|
-
};
|
|
1407
|
-
if (namespace !== null && namespace !== void 0) {
|
|
1408
|
-
node.namespace = namespace;
|
|
2849
|
+
add(expression) {
|
|
2850
|
+
if (this._sealed) {
|
|
2851
|
+
throw new TypeError(
|
|
2852
|
+
"ExpressionSet is sealed. Create a new ExpressionSet to add more expressions."
|
|
2853
|
+
);
|
|
1409
2854
|
}
|
|
1410
|
-
if (
|
|
1411
|
-
|
|
2855
|
+
if (this._patterns.has(expression.pattern)) return this;
|
|
2856
|
+
this._patterns.add(expression.pattern);
|
|
2857
|
+
if (expression.hasDeepWildcard()) {
|
|
2858
|
+
this._deepWildcards.push(expression);
|
|
2859
|
+
return this;
|
|
2860
|
+
}
|
|
2861
|
+
const depth = expression.length;
|
|
2862
|
+
const lastSeg = expression.segments[expression.segments.length - 1];
|
|
2863
|
+
const tag = lastSeg?.tag;
|
|
2864
|
+
if (!tag || tag === "*") {
|
|
2865
|
+
if (!this._wildcardByDepth.has(depth)) this._wildcardByDepth.set(depth, []);
|
|
2866
|
+
this._wildcardByDepth.get(depth).push(expression);
|
|
2867
|
+
} else {
|
|
2868
|
+
const key = `${depth}:${tag}`;
|
|
2869
|
+
if (!this._byDepthAndTag.has(key)) this._byDepthAndTag.set(key, []);
|
|
2870
|
+
this._byDepthAndTag.get(key).push(expression);
|
|
1412
2871
|
}
|
|
1413
|
-
this
|
|
2872
|
+
return this;
|
|
1414
2873
|
}
|
|
1415
2874
|
/**
|
|
1416
|
-
*
|
|
1417
|
-
*
|
|
2875
|
+
* Add multiple expressions at once.
|
|
2876
|
+
*
|
|
2877
|
+
* @param {import('./Expression.js').default[]} expressions - Array of Expression instances
|
|
2878
|
+
* @returns {this} for chaining
|
|
2879
|
+
*
|
|
2880
|
+
* @example
|
|
2881
|
+
* set.addAll([
|
|
2882
|
+
* new Expression('root.users.user'),
|
|
2883
|
+
* new Expression('root.config.setting'),
|
|
2884
|
+
* ]);
|
|
1418
2885
|
*/
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
}
|
|
1423
|
-
this._pathStringCache = null;
|
|
1424
|
-
const node = this.path.pop();
|
|
1425
|
-
if (this.siblingStacks.length > this.path.length + 1) {
|
|
1426
|
-
this.siblingStacks.length = this.path.length + 1;
|
|
1427
|
-
}
|
|
1428
|
-
return node;
|
|
2886
|
+
addAll(expressions) {
|
|
2887
|
+
for (const expr of expressions) this.add(expr);
|
|
2888
|
+
return this;
|
|
1429
2889
|
}
|
|
1430
2890
|
/**
|
|
1431
|
-
*
|
|
1432
|
-
*
|
|
1433
|
-
* @param {
|
|
2891
|
+
* Check whether a pattern string is already present in the set.
|
|
2892
|
+
*
|
|
2893
|
+
* @param {import('./Expression.js').default} expression
|
|
2894
|
+
* @returns {boolean}
|
|
1434
2895
|
*/
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
const current = this.path[this.path.length - 1];
|
|
1438
|
-
if (attrValues !== null && attrValues !== void 0) {
|
|
1439
|
-
current.values = attrValues;
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
2896
|
+
has(expression) {
|
|
2897
|
+
return this._patterns.has(expression.pattern);
|
|
1442
2898
|
}
|
|
1443
2899
|
/**
|
|
1444
|
-
*
|
|
1445
|
-
* @
|
|
2900
|
+
* Number of expressions in the set.
|
|
2901
|
+
* @type {number}
|
|
1446
2902
|
*/
|
|
1447
|
-
|
|
1448
|
-
return this.
|
|
2903
|
+
get size() {
|
|
2904
|
+
return this._patterns.size;
|
|
1449
2905
|
}
|
|
1450
2906
|
/**
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
2907
|
+
* Seal the set against further modifications.
|
|
2908
|
+
* Useful to prevent accidental mutations after config is built.
|
|
2909
|
+
* Calling add() or addAll() on a sealed set throws a TypeError.
|
|
2910
|
+
*
|
|
2911
|
+
* @returns {this}
|
|
1453
2912
|
*/
|
|
1454
|
-
|
|
1455
|
-
|
|
2913
|
+
seal() {
|
|
2914
|
+
this._sealed = true;
|
|
2915
|
+
return this;
|
|
1456
2916
|
}
|
|
1457
2917
|
/**
|
|
1458
|
-
*
|
|
1459
|
-
* @
|
|
1460
|
-
* @returns {*} Attribute value or undefined
|
|
2918
|
+
* Whether the set has been sealed.
|
|
2919
|
+
* @type {boolean}
|
|
1461
2920
|
*/
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
const current = this.path[this.path.length - 1];
|
|
1465
|
-
return current.values?.[attrName];
|
|
2921
|
+
get isSealed() {
|
|
2922
|
+
return this._sealed;
|
|
1466
2923
|
}
|
|
1467
2924
|
/**
|
|
1468
|
-
*
|
|
1469
|
-
*
|
|
1470
|
-
*
|
|
1471
|
-
|
|
2925
|
+
* Test whether the matcher's current path matches any expression in the set.
|
|
2926
|
+
*
|
|
2927
|
+
* Evaluation order (cheapest → most expensive):
|
|
2928
|
+
* 1. Exact depth + tag bucket — O(1) lookup, typically 0–2 expressions
|
|
2929
|
+
* 2. Depth-only wildcard bucket — O(1) lookup, rare
|
|
2930
|
+
* 3. Deep-wildcard list — always checked, but usually small
|
|
2931
|
+
*
|
|
2932
|
+
* @param {import('./Matcher.js').default} matcher - Matcher instance (or readOnly view)
|
|
2933
|
+
* @returns {boolean} true if any expression matches the current path
|
|
2934
|
+
*
|
|
2935
|
+
* @example
|
|
2936
|
+
* if (stopNodes.matchesAny(matcher)) {
|
|
2937
|
+
* // handle stop node
|
|
2938
|
+
* }
|
|
2939
|
+
*/
|
|
2940
|
+
matchesAny(matcher) {
|
|
2941
|
+
return this.findMatch(matcher) !== null;
|
|
2942
|
+
}
|
|
2943
|
+
/**
|
|
2944
|
+
* Find and return the first Expression that matches the matcher's current path.
|
|
2945
|
+
*
|
|
2946
|
+
* Uses the same evaluation order as matchesAny (cheapest → most expensive):
|
|
2947
|
+
* 1. Exact depth + tag bucket
|
|
2948
|
+
* 2. Depth-only wildcard bucket
|
|
2949
|
+
* 3. Deep-wildcard list
|
|
2950
|
+
*
|
|
2951
|
+
* @param {import('./Matcher.js').default} matcher - Matcher instance (or readOnly view)
|
|
2952
|
+
* @returns {import('./Expression.js').default | null} the first matching Expression, or null
|
|
2953
|
+
*
|
|
2954
|
+
* @example
|
|
2955
|
+
* const expr = stopNodes.findMatch(matcher);
|
|
2956
|
+
* if (expr) {
|
|
2957
|
+
* // access expr.config, expr.pattern, etc.
|
|
2958
|
+
* }
|
|
2959
|
+
*/
|
|
2960
|
+
findMatch(matcher) {
|
|
2961
|
+
const depth = matcher.getDepth();
|
|
2962
|
+
const tag = matcher.getCurrentTag();
|
|
2963
|
+
const exactKey = `${depth}:${tag}`;
|
|
2964
|
+
const exactBucket = this._byDepthAndTag.get(exactKey);
|
|
2965
|
+
if (exactBucket) {
|
|
2966
|
+
for (let i2 = 0; i2 < exactBucket.length; i2++) {
|
|
2967
|
+
if (matcher.matches(exactBucket[i2])) return exactBucket[i2];
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
const wildcardBucket = this._wildcardByDepth.get(depth);
|
|
2971
|
+
if (wildcardBucket) {
|
|
2972
|
+
for (let i2 = 0; i2 < wildcardBucket.length; i2++) {
|
|
2973
|
+
if (matcher.matches(wildcardBucket[i2])) return wildcardBucket[i2];
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
for (let i2 = 0; i2 < this._deepWildcards.length; i2++) {
|
|
2977
|
+
if (matcher.matches(this._deepWildcards[i2])) return this._deepWildcards[i2];
|
|
2978
|
+
}
|
|
2979
|
+
return null;
|
|
2980
|
+
}
|
|
2981
|
+
};
|
|
2982
|
+
|
|
2983
|
+
// ../node_modules/.bun/path-expression-matcher@1.5.0/node_modules/path-expression-matcher/src/Matcher.js
|
|
2984
|
+
var MatcherView = class {
|
|
2985
|
+
/**
|
|
2986
|
+
* @param {Matcher} matcher - The parent Matcher instance to read from.
|
|
2987
|
+
*/
|
|
2988
|
+
constructor(matcher) {
|
|
2989
|
+
this._matcher = matcher;
|
|
2990
|
+
}
|
|
2991
|
+
/**
|
|
2992
|
+
* Get the path separator used by the parent matcher.
|
|
2993
|
+
* @returns {string}
|
|
2994
|
+
*/
|
|
2995
|
+
get separator() {
|
|
2996
|
+
return this._matcher.separator;
|
|
2997
|
+
}
|
|
2998
|
+
/**
|
|
2999
|
+
* Get current tag name.
|
|
3000
|
+
* @returns {string|undefined}
|
|
3001
|
+
*/
|
|
3002
|
+
getCurrentTag() {
|
|
3003
|
+
const path = this._matcher.path;
|
|
3004
|
+
return path.length > 0 ? path[path.length - 1].tag : void 0;
|
|
3005
|
+
}
|
|
3006
|
+
/**
|
|
3007
|
+
* Get current namespace.
|
|
3008
|
+
* @returns {string|undefined}
|
|
3009
|
+
*/
|
|
3010
|
+
getCurrentNamespace() {
|
|
3011
|
+
const path = this._matcher.path;
|
|
3012
|
+
return path.length > 0 ? path[path.length - 1].namespace : void 0;
|
|
3013
|
+
}
|
|
3014
|
+
/**
|
|
3015
|
+
* Get current node's attribute value.
|
|
3016
|
+
* @param {string} attrName
|
|
3017
|
+
* @returns {*}
|
|
3018
|
+
*/
|
|
3019
|
+
getAttrValue(attrName) {
|
|
3020
|
+
const path = this._matcher.path;
|
|
3021
|
+
if (path.length === 0) return void 0;
|
|
3022
|
+
return path[path.length - 1].values?.[attrName];
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* Check if current node has an attribute.
|
|
3026
|
+
* @param {string} attrName
|
|
3027
|
+
* @returns {boolean}
|
|
3028
|
+
*/
|
|
3029
|
+
hasAttr(attrName) {
|
|
3030
|
+
const path = this._matcher.path;
|
|
3031
|
+
if (path.length === 0) return false;
|
|
3032
|
+
const current = path[path.length - 1];
|
|
3033
|
+
return current.values !== void 0 && attrName in current.values;
|
|
3034
|
+
}
|
|
3035
|
+
/**
|
|
3036
|
+
* Get current node's sibling position (child index in parent).
|
|
3037
|
+
* @returns {number}
|
|
3038
|
+
*/
|
|
3039
|
+
getPosition() {
|
|
3040
|
+
const path = this._matcher.path;
|
|
3041
|
+
if (path.length === 0) return -1;
|
|
3042
|
+
return path[path.length - 1].position ?? 0;
|
|
3043
|
+
}
|
|
3044
|
+
/**
|
|
3045
|
+
* Get current node's repeat counter (occurrence count of this tag name).
|
|
3046
|
+
* @returns {number}
|
|
3047
|
+
*/
|
|
3048
|
+
getCounter() {
|
|
3049
|
+
const path = this._matcher.path;
|
|
3050
|
+
if (path.length === 0) return -1;
|
|
3051
|
+
return path[path.length - 1].counter ?? 0;
|
|
3052
|
+
}
|
|
3053
|
+
/**
|
|
3054
|
+
* Get current node's sibling index (alias for getPosition).
|
|
3055
|
+
* @returns {number}
|
|
3056
|
+
* @deprecated Use getPosition() or getCounter() instead
|
|
3057
|
+
*/
|
|
3058
|
+
getIndex() {
|
|
3059
|
+
return this.getPosition();
|
|
3060
|
+
}
|
|
3061
|
+
/**
|
|
3062
|
+
* Get current path depth.
|
|
3063
|
+
* @returns {number}
|
|
3064
|
+
*/
|
|
3065
|
+
getDepth() {
|
|
3066
|
+
return this._matcher.path.length;
|
|
3067
|
+
}
|
|
3068
|
+
/**
|
|
3069
|
+
* Get path as string.
|
|
3070
|
+
* @param {string} [separator] - Optional separator (uses default if not provided)
|
|
3071
|
+
* @param {boolean} [includeNamespace=true]
|
|
3072
|
+
* @returns {string}
|
|
3073
|
+
*/
|
|
3074
|
+
toString(separator, includeNamespace = true) {
|
|
3075
|
+
return this._matcher.toString(separator, includeNamespace);
|
|
3076
|
+
}
|
|
3077
|
+
/**
|
|
3078
|
+
* Get path as array of tag names.
|
|
3079
|
+
* @returns {string[]}
|
|
3080
|
+
*/
|
|
3081
|
+
toArray() {
|
|
3082
|
+
return this._matcher.path.map((n2) => n2.tag);
|
|
3083
|
+
}
|
|
3084
|
+
/**
|
|
3085
|
+
* Match current path against an Expression.
|
|
3086
|
+
* @param {Expression} expression
|
|
3087
|
+
* @returns {boolean}
|
|
3088
|
+
*/
|
|
3089
|
+
matches(expression) {
|
|
3090
|
+
return this._matcher.matches(expression);
|
|
3091
|
+
}
|
|
3092
|
+
/**
|
|
3093
|
+
* Match any expression in the given set against the current path.
|
|
3094
|
+
* @param {ExpressionSet} exprSet
|
|
3095
|
+
* @returns {boolean}
|
|
3096
|
+
*/
|
|
3097
|
+
matchesAny(exprSet) {
|
|
3098
|
+
return exprSet.matchesAny(this._matcher);
|
|
3099
|
+
}
|
|
3100
|
+
};
|
|
3101
|
+
var Matcher = class {
|
|
3102
|
+
/**
|
|
3103
|
+
* Create a new Matcher.
|
|
3104
|
+
* @param {Object} [options={}]
|
|
3105
|
+
* @param {string} [options.separator='.'] - Default path separator
|
|
3106
|
+
*/
|
|
3107
|
+
constructor(options = {}) {
|
|
3108
|
+
this.separator = options.separator || ".";
|
|
3109
|
+
this.path = [];
|
|
3110
|
+
this.siblingStacks = [];
|
|
3111
|
+
this._pathStringCache = null;
|
|
3112
|
+
this._view = new MatcherView(this);
|
|
3113
|
+
}
|
|
3114
|
+
/**
|
|
3115
|
+
* Push a new tag onto the path.
|
|
3116
|
+
* @param {string} tagName
|
|
3117
|
+
* @param {Object|null} [attrValues=null]
|
|
3118
|
+
* @param {string|null} [namespace=null]
|
|
3119
|
+
*/
|
|
3120
|
+
push(tagName, attrValues = null, namespace = null) {
|
|
3121
|
+
this._pathStringCache = null;
|
|
3122
|
+
if (this.path.length > 0) {
|
|
3123
|
+
this.path[this.path.length - 1].values = void 0;
|
|
3124
|
+
}
|
|
3125
|
+
const currentLevel = this.path.length;
|
|
3126
|
+
if (!this.siblingStacks[currentLevel]) {
|
|
3127
|
+
this.siblingStacks[currentLevel] = /* @__PURE__ */ new Map();
|
|
3128
|
+
}
|
|
3129
|
+
const siblings = this.siblingStacks[currentLevel];
|
|
3130
|
+
const siblingKey = namespace ? `${namespace}:${tagName}` : tagName;
|
|
3131
|
+
const counter = siblings.get(siblingKey) || 0;
|
|
3132
|
+
let position = 0;
|
|
3133
|
+
for (const count of siblings.values()) {
|
|
3134
|
+
position += count;
|
|
3135
|
+
}
|
|
3136
|
+
siblings.set(siblingKey, counter + 1);
|
|
3137
|
+
const node = {
|
|
3138
|
+
tag: tagName,
|
|
3139
|
+
position,
|
|
3140
|
+
counter
|
|
3141
|
+
};
|
|
3142
|
+
if (namespace !== null && namespace !== void 0) {
|
|
3143
|
+
node.namespace = namespace;
|
|
3144
|
+
}
|
|
3145
|
+
if (attrValues !== null && attrValues !== void 0) {
|
|
3146
|
+
node.values = attrValues;
|
|
3147
|
+
}
|
|
3148
|
+
this.path.push(node);
|
|
3149
|
+
}
|
|
3150
|
+
/**
|
|
3151
|
+
* Pop the last tag from the path.
|
|
3152
|
+
* @returns {Object|undefined} The popped node
|
|
3153
|
+
*/
|
|
3154
|
+
pop() {
|
|
3155
|
+
if (this.path.length === 0) return void 0;
|
|
3156
|
+
this._pathStringCache = null;
|
|
3157
|
+
const node = this.path.pop();
|
|
3158
|
+
if (this.siblingStacks.length > this.path.length + 1) {
|
|
3159
|
+
this.siblingStacks.length = this.path.length + 1;
|
|
3160
|
+
}
|
|
3161
|
+
return node;
|
|
3162
|
+
}
|
|
3163
|
+
/**
|
|
3164
|
+
* Update current node's attribute values.
|
|
3165
|
+
* Useful when attributes are parsed after push.
|
|
3166
|
+
* @param {Object} attrValues
|
|
3167
|
+
*/
|
|
3168
|
+
updateCurrent(attrValues) {
|
|
3169
|
+
if (this.path.length > 0) {
|
|
3170
|
+
const current = this.path[this.path.length - 1];
|
|
3171
|
+
if (attrValues !== null && attrValues !== void 0) {
|
|
3172
|
+
current.values = attrValues;
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
/**
|
|
3177
|
+
* Get current tag name.
|
|
3178
|
+
* @returns {string|undefined}
|
|
3179
|
+
*/
|
|
3180
|
+
getCurrentTag() {
|
|
3181
|
+
return this.path.length > 0 ? this.path[this.path.length - 1].tag : void 0;
|
|
3182
|
+
}
|
|
3183
|
+
/**
|
|
3184
|
+
* Get current namespace.
|
|
3185
|
+
* @returns {string|undefined}
|
|
3186
|
+
*/
|
|
3187
|
+
getCurrentNamespace() {
|
|
3188
|
+
return this.path.length > 0 ? this.path[this.path.length - 1].namespace : void 0;
|
|
3189
|
+
}
|
|
3190
|
+
/**
|
|
3191
|
+
* Get current node's attribute value.
|
|
3192
|
+
* @param {string} attrName
|
|
3193
|
+
* @returns {*}
|
|
3194
|
+
*/
|
|
3195
|
+
getAttrValue(attrName) {
|
|
3196
|
+
if (this.path.length === 0) return void 0;
|
|
3197
|
+
return this.path[this.path.length - 1].values?.[attrName];
|
|
3198
|
+
}
|
|
3199
|
+
/**
|
|
3200
|
+
* Check if current node has an attribute.
|
|
3201
|
+
* @param {string} attrName
|
|
3202
|
+
* @returns {boolean}
|
|
3203
|
+
*/
|
|
1472
3204
|
hasAttr(attrName) {
|
|
1473
3205
|
if (this.path.length === 0) return false;
|
|
1474
3206
|
const current = this.path[this.path.length - 1];
|
|
1475
3207
|
return current.values !== void 0 && attrName in current.values;
|
|
1476
3208
|
}
|
|
1477
3209
|
/**
|
|
1478
|
-
* Get current node's sibling position (child index in parent)
|
|
3210
|
+
* Get current node's sibling position (child index in parent).
|
|
1479
3211
|
* @returns {number}
|
|
1480
3212
|
*/
|
|
1481
3213
|
getPosition() {
|
|
@@ -1483,7 +3215,7 @@ var Matcher = class {
|
|
|
1483
3215
|
return this.path[this.path.length - 1].position ?? 0;
|
|
1484
3216
|
}
|
|
1485
3217
|
/**
|
|
1486
|
-
* Get current node's repeat counter (occurrence count of this tag name)
|
|
3218
|
+
* Get current node's repeat counter (occurrence count of this tag name).
|
|
1487
3219
|
* @returns {number}
|
|
1488
3220
|
*/
|
|
1489
3221
|
getCounter() {
|
|
@@ -1491,7 +3223,7 @@ var Matcher = class {
|
|
|
1491
3223
|
return this.path[this.path.length - 1].counter ?? 0;
|
|
1492
3224
|
}
|
|
1493
3225
|
/**
|
|
1494
|
-
* Get current node's sibling index (alias for getPosition
|
|
3226
|
+
* Get current node's sibling index (alias for getPosition).
|
|
1495
3227
|
* @returns {number}
|
|
1496
3228
|
* @deprecated Use getPosition() or getCounter() instead
|
|
1497
3229
|
*/
|
|
@@ -1499,27 +3231,27 @@ var Matcher = class {
|
|
|
1499
3231
|
return this.getPosition();
|
|
1500
3232
|
}
|
|
1501
3233
|
/**
|
|
1502
|
-
* Get current path depth
|
|
3234
|
+
* Get current path depth.
|
|
1503
3235
|
* @returns {number}
|
|
1504
3236
|
*/
|
|
1505
3237
|
getDepth() {
|
|
1506
3238
|
return this.path.length;
|
|
1507
3239
|
}
|
|
1508
3240
|
/**
|
|
1509
|
-
* Get path as string
|
|
1510
|
-
* @param {string} separator - Optional separator (uses default if not provided)
|
|
1511
|
-
* @param {boolean} includeNamespace
|
|
3241
|
+
* Get path as string.
|
|
3242
|
+
* @param {string} [separator] - Optional separator (uses default if not provided)
|
|
3243
|
+
* @param {boolean} [includeNamespace=true]
|
|
1512
3244
|
* @returns {string}
|
|
1513
3245
|
*/
|
|
1514
3246
|
toString(separator, includeNamespace = true) {
|
|
1515
3247
|
const sep = separator || this.separator;
|
|
1516
3248
|
const isDefault = sep === this.separator && includeNamespace === true;
|
|
1517
3249
|
if (isDefault) {
|
|
1518
|
-
if (this._pathStringCache !== null
|
|
3250
|
+
if (this._pathStringCache !== null) {
|
|
1519
3251
|
return this._pathStringCache;
|
|
1520
3252
|
}
|
|
1521
3253
|
const result = this.path.map(
|
|
1522
|
-
(n2) =>
|
|
3254
|
+
(n2) => n2.namespace ? `${n2.namespace}:${n2.tag}` : n2.tag
|
|
1523
3255
|
).join(sep);
|
|
1524
3256
|
this._pathStringCache = result;
|
|
1525
3257
|
return result;
|
|
@@ -1529,14 +3261,14 @@ var Matcher = class {
|
|
|
1529
3261
|
).join(sep);
|
|
1530
3262
|
}
|
|
1531
3263
|
/**
|
|
1532
|
-
* Get path as array of tag names
|
|
3264
|
+
* Get path as array of tag names.
|
|
1533
3265
|
* @returns {string[]}
|
|
1534
3266
|
*/
|
|
1535
3267
|
toArray() {
|
|
1536
3268
|
return this.path.map((n2) => n2.tag);
|
|
1537
3269
|
}
|
|
1538
3270
|
/**
|
|
1539
|
-
* Reset the path to empty
|
|
3271
|
+
* Reset the path to empty.
|
|
1540
3272
|
*/
|
|
1541
3273
|
reset() {
|
|
1542
3274
|
this._pathStringCache = null;
|
|
@@ -1544,9 +3276,9 @@ var Matcher = class {
|
|
|
1544
3276
|
this.siblingStacks = [];
|
|
1545
3277
|
}
|
|
1546
3278
|
/**
|
|
1547
|
-
* Match current path against an Expression
|
|
1548
|
-
* @param {Expression} expression
|
|
1549
|
-
* @returns {boolean}
|
|
3279
|
+
* Match current path against an Expression.
|
|
3280
|
+
* @param {Expression} expression
|
|
3281
|
+
* @returns {boolean}
|
|
1550
3282
|
*/
|
|
1551
3283
|
matches(expression) {
|
|
1552
3284
|
const segments = expression.segments;
|
|
@@ -1559,7 +3291,6 @@ var Matcher = class {
|
|
|
1559
3291
|
return this._matchSimple(segments);
|
|
1560
3292
|
}
|
|
1561
3293
|
/**
|
|
1562
|
-
* Match simple path (no deep wildcards)
|
|
1563
3294
|
* @private
|
|
1564
3295
|
*/
|
|
1565
3296
|
_matchSimple(segments) {
|
|
@@ -1567,17 +3298,13 @@ var Matcher = class {
|
|
|
1567
3298
|
return false;
|
|
1568
3299
|
}
|
|
1569
3300
|
for (let i2 = 0; i2 < segments.length; i2++) {
|
|
1570
|
-
|
|
1571
|
-
const node = this.path[i2];
|
|
1572
|
-
const isCurrentNode = i2 === this.path.length - 1;
|
|
1573
|
-
if (!this._matchSegment(segment, node, isCurrentNode)) {
|
|
3301
|
+
if (!this._matchSegment(segments[i2], this.path[i2], i2 === this.path.length - 1)) {
|
|
1574
3302
|
return false;
|
|
1575
3303
|
}
|
|
1576
3304
|
}
|
|
1577
3305
|
return true;
|
|
1578
3306
|
}
|
|
1579
3307
|
/**
|
|
1580
|
-
* Match path with deep wildcards
|
|
1581
3308
|
* @private
|
|
1582
3309
|
*/
|
|
1583
3310
|
_matchWithDeepWildcard(segments) {
|
|
@@ -1593,8 +3320,7 @@ var Matcher = class {
|
|
|
1593
3320
|
const nextSeg = segments[segIdx];
|
|
1594
3321
|
let found = false;
|
|
1595
3322
|
for (let i2 = pathIdx; i2 >= 0; i2--) {
|
|
1596
|
-
|
|
1597
|
-
if (this._matchSegment(nextSeg, this.path[i2], isCurrentNode)) {
|
|
3323
|
+
if (this._matchSegment(nextSeg, this.path[i2], i2 === this.path.length - 1)) {
|
|
1598
3324
|
pathIdx = i2 - 1;
|
|
1599
3325
|
segIdx--;
|
|
1600
3326
|
found = true;
|
|
@@ -1605,8 +3331,7 @@ var Matcher = class {
|
|
|
1605
3331
|
return false;
|
|
1606
3332
|
}
|
|
1607
3333
|
} else {
|
|
1608
|
-
|
|
1609
|
-
if (!this._matchSegment(segment, this.path[pathIdx], isCurrentNode)) {
|
|
3334
|
+
if (!this._matchSegment(segment, this.path[pathIdx], pathIdx === this.path.length - 1)) {
|
|
1610
3335
|
return false;
|
|
1611
3336
|
}
|
|
1612
3337
|
pathIdx--;
|
|
@@ -1616,12 +3341,7 @@ var Matcher = class {
|
|
|
1616
3341
|
return segIdx < 0;
|
|
1617
3342
|
}
|
|
1618
3343
|
/**
|
|
1619
|
-
* Match a single segment against a node
|
|
1620
3344
|
* @private
|
|
1621
|
-
* @param {Object} segment - Segment from Expression
|
|
1622
|
-
* @param {Object} node - Node from path
|
|
1623
|
-
* @param {boolean} isCurrentNode - Whether this is the current (last) node
|
|
1624
|
-
* @returns {boolean}
|
|
1625
3345
|
*/
|
|
1626
3346
|
_matchSegment(segment, node, isCurrentNode) {
|
|
1627
3347
|
if (segment.tag !== "*" && segment.tag !== node.tag) {
|
|
@@ -1640,8 +3360,7 @@ var Matcher = class {
|
|
|
1640
3360
|
return false;
|
|
1641
3361
|
}
|
|
1642
3362
|
if (segment.attrValue !== void 0) {
|
|
1643
|
-
|
|
1644
|
-
if (String(actualValue) !== String(segment.attrValue)) {
|
|
3363
|
+
if (String(node.values[segment.attrName]) !== String(segment.attrValue)) {
|
|
1645
3364
|
return false;
|
|
1646
3365
|
}
|
|
1647
3366
|
}
|
|
@@ -1657,17 +3376,23 @@ var Matcher = class {
|
|
|
1657
3376
|
return false;
|
|
1658
3377
|
} else if (segment.position === "even" && counter % 2 !== 0) {
|
|
1659
3378
|
return false;
|
|
1660
|
-
} else if (segment.position === "nth") {
|
|
1661
|
-
|
|
1662
|
-
return false;
|
|
1663
|
-
}
|
|
3379
|
+
} else if (segment.position === "nth" && counter !== segment.positionValue) {
|
|
3380
|
+
return false;
|
|
1664
3381
|
}
|
|
1665
3382
|
}
|
|
1666
3383
|
return true;
|
|
1667
3384
|
}
|
|
1668
3385
|
/**
|
|
1669
|
-
*
|
|
1670
|
-
* @
|
|
3386
|
+
* Match any expression in the given set against the current path.
|
|
3387
|
+
* @param {ExpressionSet} exprSet
|
|
3388
|
+
* @returns {boolean}
|
|
3389
|
+
*/
|
|
3390
|
+
matchesAny(exprSet) {
|
|
3391
|
+
return exprSet.matchesAny(this);
|
|
3392
|
+
}
|
|
3393
|
+
/**
|
|
3394
|
+
* Create a snapshot of current state.
|
|
3395
|
+
* @returns {Object}
|
|
1671
3396
|
*/
|
|
1672
3397
|
snapshot() {
|
|
1673
3398
|
return {
|
|
@@ -1676,8 +3401,8 @@ var Matcher = class {
|
|
|
1676
3401
|
};
|
|
1677
3402
|
}
|
|
1678
3403
|
/**
|
|
1679
|
-
* Restore state from snapshot
|
|
1680
|
-
* @param {Object} snapshot
|
|
3404
|
+
* Restore state from snapshot.
|
|
3405
|
+
* @param {Object} snapshot
|
|
1681
3406
|
*/
|
|
1682
3407
|
restore(snapshot) {
|
|
1683
3408
|
this._pathStringCache = null;
|
|
@@ -1685,68 +3410,27 @@ var Matcher = class {
|
|
|
1685
3410
|
this.siblingStacks = snapshot.siblingStacks.map((map) => new Map(map));
|
|
1686
3411
|
}
|
|
1687
3412
|
/**
|
|
1688
|
-
* Return
|
|
3413
|
+
* Return the read-only {@link MatcherView} for this matcher.
|
|
1689
3414
|
*
|
|
1690
|
-
* The returned
|
|
1691
|
-
*
|
|
1692
|
-
*
|
|
1693
|
-
* are allowed but the returned arrays/objects are frozen so callers cannot
|
|
1694
|
-
* mutate internal state through them either.
|
|
3415
|
+
* The same instance is returned on every call — no allocation occurs.
|
|
3416
|
+
* It always reflects the current parser state and is safe to pass to
|
|
3417
|
+
* user callbacks without risk of accidental mutation.
|
|
1695
3418
|
*
|
|
1696
|
-
* @returns {
|
|
3419
|
+
* @returns {MatcherView}
|
|
1697
3420
|
*
|
|
1698
3421
|
* @example
|
|
1699
|
-
* const
|
|
1700
|
-
*
|
|
1701
|
-
*
|
|
1702
|
-
*
|
|
1703
|
-
*
|
|
1704
|
-
* ro.getCurrentTag(); // ✓ works
|
|
1705
|
-
* ro.push("child", {}); // ✗ throws TypeError
|
|
1706
|
-
* ro.reset(); // ✗ throws TypeError
|
|
3422
|
+
* const view = matcher.readOnly();
|
|
3423
|
+
* // pass view to callbacks — it stays in sync automatically
|
|
3424
|
+
* view.matches(expr); // ✓
|
|
3425
|
+
* view.getCurrentTag(); // ✓
|
|
3426
|
+
* // view.push(...) // ✗ method does not exist — caught by TypeScript
|
|
1707
3427
|
*/
|
|
1708
3428
|
readOnly() {
|
|
1709
|
-
|
|
1710
|
-
return new Proxy(self, {
|
|
1711
|
-
get(target, prop, receiver) {
|
|
1712
|
-
if (MUTATING_METHODS.has(prop)) {
|
|
1713
|
-
return () => {
|
|
1714
|
-
throw new TypeError(
|
|
1715
|
-
`Cannot call '${prop}' on a read-only Matcher. Obtain a writable instance to mutate state.`
|
|
1716
|
-
);
|
|
1717
|
-
};
|
|
1718
|
-
}
|
|
1719
|
-
const value = Reflect.get(target, prop, receiver);
|
|
1720
|
-
if (prop === "path" || prop === "siblingStacks") {
|
|
1721
|
-
return Object.freeze(
|
|
1722
|
-
Array.isArray(value) ? value.map(
|
|
1723
|
-
(item) => item instanceof Map ? Object.freeze(new Map(item)) : Object.freeze({ ...item })
|
|
1724
|
-
// freeze a copy of each node
|
|
1725
|
-
) : value
|
|
1726
|
-
);
|
|
1727
|
-
}
|
|
1728
|
-
if (typeof value === "function") {
|
|
1729
|
-
return value.bind(target);
|
|
1730
|
-
}
|
|
1731
|
-
return value;
|
|
1732
|
-
},
|
|
1733
|
-
// Prevent any property assignment on the read-only view
|
|
1734
|
-
set(_target, prop) {
|
|
1735
|
-
throw new TypeError(
|
|
1736
|
-
`Cannot set property '${String(prop)}' on a read-only Matcher.`
|
|
1737
|
-
);
|
|
1738
|
-
},
|
|
1739
|
-
// Prevent property deletion
|
|
1740
|
-
deleteProperty(_target, prop) {
|
|
1741
|
-
throw new TypeError(
|
|
1742
|
-
`Cannot delete property '${String(prop)}' from a read-only Matcher.`
|
|
1743
|
-
);
|
|
1744
|
-
}
|
|
1745
|
-
});
|
|
3429
|
+
return this._view;
|
|
1746
3430
|
}
|
|
1747
3431
|
};
|
|
1748
3432
|
|
|
1749
|
-
// ../node_modules/.bun/fast-xml-parser@5.
|
|
3433
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
|
|
1750
3434
|
function extractRawAttributes(prefixedAttrs, options) {
|
|
1751
3435
|
if (!prefixedAttrs) return {};
|
|
1752
3436
|
const attrs = options.attributesGroupName ? prefixedAttrs[options.attributesGroupName] : prefixedAttrs;
|
|
@@ -1774,36 +3458,10 @@ function extractNamespace(rawTagName) {
|
|
|
1774
3458
|
return void 0;
|
|
1775
3459
|
}
|
|
1776
3460
|
var OrderedObjParser = class {
|
|
1777
|
-
constructor(options) {
|
|
3461
|
+
constructor(options, externalEntities) {
|
|
1778
3462
|
this.options = options;
|
|
1779
3463
|
this.currentNode = null;
|
|
1780
3464
|
this.tagsNodeStack = [];
|
|
1781
|
-
this.docTypeEntities = {};
|
|
1782
|
-
this.lastEntities = {
|
|
1783
|
-
"apos": { regex: /&(apos|#39|#x27);/g, val: "'" },
|
|
1784
|
-
"gt": { regex: /&(gt|#62|#x3E);/g, val: ">" },
|
|
1785
|
-
"lt": { regex: /&(lt|#60|#x3C);/g, val: "<" },
|
|
1786
|
-
"quot": { regex: /&(quot|#34|#x22);/g, val: '"' }
|
|
1787
|
-
};
|
|
1788
|
-
this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" };
|
|
1789
|
-
this.htmlEntities = {
|
|
1790
|
-
"space": { regex: /&(nbsp|#160);/g, val: " " },
|
|
1791
|
-
// "lt" : { regex: /&(lt|#60);/g, val: "<" },
|
|
1792
|
-
// "gt" : { regex: /&(gt|#62);/g, val: ">" },
|
|
1793
|
-
// "amp" : { regex: /&(amp|#38);/g, val: "&" },
|
|
1794
|
-
// "quot" : { regex: /&(quot|#34);/g, val: "\"" },
|
|
1795
|
-
// "apos" : { regex: /&(apos|#39);/g, val: "'" },
|
|
1796
|
-
"cent": { regex: /&(cent|#162);/g, val: "\xA2" },
|
|
1797
|
-
"pound": { regex: /&(pound|#163);/g, val: "\xA3" },
|
|
1798
|
-
"yen": { regex: /&(yen|#165);/g, val: "\xA5" },
|
|
1799
|
-
"euro": { regex: /&(euro|#8364);/g, val: "\u20AC" },
|
|
1800
|
-
"copyright": { regex: /&(copy|#169);/g, val: "\xA9" },
|
|
1801
|
-
"reg": { regex: /&(reg|#174);/g, val: "\xAE" },
|
|
1802
|
-
"inr": { regex: /&(inr|#8377);/g, val: "\u20B9" },
|
|
1803
|
-
"num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str) => fromCodePoint(str, 10, "&#") },
|
|
1804
|
-
"num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => fromCodePoint(str, 16, "&#x") }
|
|
1805
|
-
};
|
|
1806
|
-
this.addExternalEntities = addExternalEntities;
|
|
1807
3465
|
this.parseXml = parseXml;
|
|
1808
3466
|
this.parseTextData = parseTextData;
|
|
1809
3467
|
this.resolveNameSpace = resolveNameSpace;
|
|
@@ -1816,52 +3474,61 @@ var OrderedObjParser = class {
|
|
|
1816
3474
|
this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes);
|
|
1817
3475
|
this.entityExpansionCount = 0;
|
|
1818
3476
|
this.currentExpandedLength = 0;
|
|
3477
|
+
let namedEntities = { ...XML };
|
|
3478
|
+
if (this.options.entityDecoder) {
|
|
3479
|
+
this.entityDecoder = this.options.entityDecoder;
|
|
3480
|
+
} else {
|
|
3481
|
+
if (typeof this.options.htmlEntities === "object") namedEntities = this.options.htmlEntities;
|
|
3482
|
+
else if (this.options.htmlEntities === true) namedEntities = { ...COMMON_HTML, ...CURRENCY };
|
|
3483
|
+
this.entityDecoder = new EntityDecoder({
|
|
3484
|
+
namedEntities: { ...namedEntities, ...externalEntities },
|
|
3485
|
+
numericAllowed: this.options.htmlEntities,
|
|
3486
|
+
limit: {
|
|
3487
|
+
maxTotalExpansions: this.options.processEntities.maxTotalExpansions,
|
|
3488
|
+
maxExpandedLength: this.options.processEntities.maxExpandedLength,
|
|
3489
|
+
applyLimitsTo: this.options.processEntities.appliesTo
|
|
3490
|
+
}
|
|
3491
|
+
//postCheck: resolved => resolved
|
|
3492
|
+
});
|
|
3493
|
+
}
|
|
1819
3494
|
this.matcher = new Matcher();
|
|
1820
3495
|
this.readonlyMatcher = this.matcher.readOnly();
|
|
1821
3496
|
this.isCurrentNodeStopNode = false;
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
3497
|
+
this.stopNodeExpressionsSet = new ExpressionSet();
|
|
3498
|
+
const stopNodesOpts = this.options.stopNodes;
|
|
3499
|
+
if (stopNodesOpts && stopNodesOpts.length > 0) {
|
|
3500
|
+
for (let i2 = 0; i2 < stopNodesOpts.length; i2++) {
|
|
3501
|
+
const stopNodeExp = stopNodesOpts[i2];
|
|
1826
3502
|
if (typeof stopNodeExp === "string") {
|
|
1827
|
-
this.
|
|
3503
|
+
this.stopNodeExpressionsSet.add(new Expression(stopNodeExp));
|
|
1828
3504
|
} else if (stopNodeExp instanceof Expression) {
|
|
1829
|
-
this.
|
|
3505
|
+
this.stopNodeExpressionsSet.add(stopNodeExp);
|
|
1830
3506
|
}
|
|
1831
3507
|
}
|
|
3508
|
+
this.stopNodeExpressionsSet.seal();
|
|
1832
3509
|
}
|
|
1833
3510
|
}
|
|
1834
3511
|
};
|
|
1835
|
-
function addExternalEntities(externalEntities) {
|
|
1836
|
-
const entKeys = Object.keys(externalEntities);
|
|
1837
|
-
for (let i2 = 0; i2 < entKeys.length; i2++) {
|
|
1838
|
-
const ent = entKeys[i2];
|
|
1839
|
-
const escaped = ent.replace(/[.\-+*:]/g, "\\.");
|
|
1840
|
-
this.lastEntities[ent] = {
|
|
1841
|
-
regex: new RegExp("&" + escaped + ";", "g"),
|
|
1842
|
-
val: externalEntities[ent]
|
|
1843
|
-
};
|
|
1844
|
-
}
|
|
1845
|
-
}
|
|
1846
3512
|
function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
|
|
3513
|
+
const options = this.options;
|
|
1847
3514
|
if (val !== void 0) {
|
|
1848
|
-
if (
|
|
3515
|
+
if (options.trimValues && !dontTrim) {
|
|
1849
3516
|
val = val.trim();
|
|
1850
3517
|
}
|
|
1851
3518
|
if (val.length > 0) {
|
|
1852
3519
|
if (!escapeEntities) val = this.replaceEntitiesValue(val, tagName, jPath);
|
|
1853
|
-
const jPathOrMatcher =
|
|
1854
|
-
const newval =
|
|
3520
|
+
const jPathOrMatcher = options.jPath ? jPath.toString() : jPath;
|
|
3521
|
+
const newval = options.tagValueProcessor(tagName, val, jPathOrMatcher, hasAttributes, isLeafNode);
|
|
1855
3522
|
if (newval === null || newval === void 0) {
|
|
1856
3523
|
return val;
|
|
1857
3524
|
} else if (typeof newval !== typeof val || newval !== val) {
|
|
1858
3525
|
return newval;
|
|
1859
|
-
} else if (
|
|
1860
|
-
return parseValue(val,
|
|
3526
|
+
} else if (options.trimValues) {
|
|
3527
|
+
return parseValue(val, options.parseTagValue, options.numberParseOptions);
|
|
1861
3528
|
} else {
|
|
1862
3529
|
const trimmedVal = val.trim();
|
|
1863
3530
|
if (trimmedVal === val) {
|
|
1864
|
-
return parseValue(val,
|
|
3531
|
+
return parseValue(val, options.parseTagValue, options.numberParseOptions);
|
|
1865
3532
|
} else {
|
|
1866
3533
|
return val;
|
|
1867
3534
|
}
|
|
@@ -1883,69 +3550,62 @@ function resolveNameSpace(tagname) {
|
|
|
1883
3550
|
return tagname;
|
|
1884
3551
|
}
|
|
1885
3552
|
var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
|
|
1886
|
-
function buildAttributesMap(attrStr, jPath, tagName) {
|
|
1887
|
-
|
|
3553
|
+
function buildAttributesMap(attrStr, jPath, tagName, force = false) {
|
|
3554
|
+
const options = this.options;
|
|
3555
|
+
if (force === true || options.ignoreAttributes !== true && typeof attrStr === "string") {
|
|
1888
3556
|
const matches = getAllMatches(attrStr, attrsRegx);
|
|
1889
3557
|
const len = matches.length;
|
|
1890
3558
|
const attrs = {};
|
|
3559
|
+
const processedVals = new Array(len);
|
|
3560
|
+
let hasRawAttrs = false;
|
|
1891
3561
|
const rawAttrsForMatcher = {};
|
|
1892
3562
|
for (let i2 = 0; i2 < len; i2++) {
|
|
1893
3563
|
const attrName = this.resolveNameSpace(matches[i2][1]);
|
|
1894
3564
|
const oldVal = matches[i2][4];
|
|
1895
3565
|
if (attrName.length && oldVal !== void 0) {
|
|
1896
|
-
let
|
|
1897
|
-
if (
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
3566
|
+
let val = oldVal;
|
|
3567
|
+
if (options.trimValues) val = val.trim();
|
|
3568
|
+
val = this.replaceEntitiesValue(val, tagName, this.readonlyMatcher);
|
|
3569
|
+
processedVals[i2] = val;
|
|
3570
|
+
rawAttrsForMatcher[attrName] = val;
|
|
3571
|
+
hasRawAttrs = true;
|
|
1902
3572
|
}
|
|
1903
3573
|
}
|
|
1904
|
-
if (
|
|
3574
|
+
if (hasRawAttrs && typeof jPath === "object" && jPath.updateCurrent) {
|
|
1905
3575
|
jPath.updateCurrent(rawAttrsForMatcher);
|
|
1906
3576
|
}
|
|
3577
|
+
const jPathStr = options.jPath ? jPath.toString() : this.readonlyMatcher;
|
|
3578
|
+
let hasAttrs = false;
|
|
1907
3579
|
for (let i2 = 0; i2 < len; i2++) {
|
|
1908
3580
|
const attrName = this.resolveNameSpace(matches[i2][1]);
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
continue;
|
|
1912
|
-
}
|
|
1913
|
-
let oldVal = matches[i2][4];
|
|
1914
|
-
let aName = this.options.attributeNamePrefix + attrName;
|
|
3581
|
+
if (this.ignoreAttributesFn(attrName, jPathStr)) continue;
|
|
3582
|
+
let aName = options.attributeNamePrefix + attrName;
|
|
1915
3583
|
if (attrName.length) {
|
|
1916
|
-
if (
|
|
1917
|
-
aName =
|
|
3584
|
+
if (options.transformAttributeName) {
|
|
3585
|
+
aName = options.transformAttributeName(aName);
|
|
1918
3586
|
}
|
|
1919
|
-
aName = sanitizeName(aName,
|
|
1920
|
-
if (
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
}
|
|
1924
|
-
oldVal = this.replaceEntitiesValue(oldVal, tagName, this.readonlyMatcher);
|
|
1925
|
-
const jPathOrMatcher = this.options.jPath ? jPath.toString() : this.readonlyMatcher;
|
|
1926
|
-
const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPathOrMatcher);
|
|
3587
|
+
aName = sanitizeName(aName, options);
|
|
3588
|
+
if (matches[i2][4] !== void 0) {
|
|
3589
|
+
const oldVal = processedVals[i2];
|
|
3590
|
+
const newVal = options.attributeValueProcessor(attrName, oldVal, jPathStr);
|
|
1927
3591
|
if (newVal === null || newVal === void 0) {
|
|
1928
3592
|
attrs[aName] = oldVal;
|
|
1929
3593
|
} else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {
|
|
1930
3594
|
attrs[aName] = newVal;
|
|
1931
3595
|
} else {
|
|
1932
|
-
attrs[aName] = parseValue(
|
|
1933
|
-
oldVal,
|
|
1934
|
-
this.options.parseAttributeValue,
|
|
1935
|
-
this.options.numberParseOptions
|
|
1936
|
-
);
|
|
3596
|
+
attrs[aName] = parseValue(oldVal, options.parseAttributeValue, options.numberParseOptions);
|
|
1937
3597
|
}
|
|
1938
|
-
|
|
3598
|
+
hasAttrs = true;
|
|
3599
|
+
} else if (options.allowBooleanAttributes) {
|
|
1939
3600
|
attrs[aName] = true;
|
|
3601
|
+
hasAttrs = true;
|
|
1940
3602
|
}
|
|
1941
3603
|
}
|
|
1942
3604
|
}
|
|
1943
|
-
if (!
|
|
1944
|
-
|
|
1945
|
-
}
|
|
1946
|
-
if (this.options.attributesGroupName) {
|
|
3605
|
+
if (!hasAttrs) return;
|
|
3606
|
+
if (options.attributesGroupName && !options.preserveOrder) {
|
|
1947
3607
|
const attrCollection = {};
|
|
1948
|
-
attrCollection[
|
|
3608
|
+
attrCollection[options.attributesGroupName] = attrs;
|
|
1949
3609
|
return attrCollection;
|
|
1950
3610
|
}
|
|
1951
3611
|
return attrs;
|
|
@@ -1957,30 +3617,34 @@ var parseXml = function(xmlData) {
|
|
|
1957
3617
|
let currentNode = xmlObj;
|
|
1958
3618
|
let textData = "";
|
|
1959
3619
|
this.matcher.reset();
|
|
3620
|
+
this.entityDecoder.reset();
|
|
1960
3621
|
this.entityExpansionCount = 0;
|
|
1961
3622
|
this.currentExpandedLength = 0;
|
|
1962
|
-
const
|
|
1963
|
-
|
|
3623
|
+
const options = this.options;
|
|
3624
|
+
const docTypeReader = new DocTypeReader(options.processEntities);
|
|
3625
|
+
const xmlLen = xmlData.length;
|
|
3626
|
+
for (let i2 = 0; i2 < xmlLen; i2++) {
|
|
1964
3627
|
const ch = xmlData[i2];
|
|
1965
3628
|
if (ch === "<") {
|
|
1966
|
-
|
|
3629
|
+
const c1 = xmlData.charCodeAt(i2 + 1);
|
|
3630
|
+
if (c1 === 47) {
|
|
1967
3631
|
const closeIndex = findClosingIndex(xmlData, ">", i2, "Closing Tag is not closed.");
|
|
1968
3632
|
let tagName = xmlData.substring(i2 + 2, closeIndex).trim();
|
|
1969
|
-
if (
|
|
3633
|
+
if (options.removeNSPrefix) {
|
|
1970
3634
|
const colonIndex = tagName.indexOf(":");
|
|
1971
3635
|
if (colonIndex !== -1) {
|
|
1972
3636
|
tagName = tagName.substr(colonIndex + 1);
|
|
1973
3637
|
}
|
|
1974
3638
|
}
|
|
1975
|
-
tagName = transformTagName(
|
|
3639
|
+
tagName = transformTagName(options.transformTagName, tagName, "", options).tagName;
|
|
1976
3640
|
if (currentNode) {
|
|
1977
3641
|
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
1978
3642
|
}
|
|
1979
3643
|
const lastTagName = this.matcher.getCurrentTag();
|
|
1980
|
-
if (tagName &&
|
|
3644
|
+
if (tagName && options.unpairedTagsSet.has(tagName)) {
|
|
1981
3645
|
throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
|
|
1982
3646
|
}
|
|
1983
|
-
if (lastTagName &&
|
|
3647
|
+
if (lastTagName && options.unpairedTagsSet.has(lastTagName)) {
|
|
1984
3648
|
this.matcher.pop();
|
|
1985
3649
|
this.tagsNodeStack.pop();
|
|
1986
3650
|
}
|
|
@@ -1989,48 +3653,53 @@ var parseXml = function(xmlData) {
|
|
|
1989
3653
|
currentNode = this.tagsNodeStack.pop();
|
|
1990
3654
|
textData = "";
|
|
1991
3655
|
i2 = closeIndex;
|
|
1992
|
-
} else if (
|
|
3656
|
+
} else if (c1 === 63) {
|
|
1993
3657
|
let tagData = readTagExp(xmlData, i2, false, "?>");
|
|
1994
3658
|
if (!tagData) throw new Error("Pi Tag is not closed.");
|
|
1995
3659
|
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
1996
|
-
|
|
3660
|
+
const attsMap = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName, true);
|
|
3661
|
+
if (attsMap) {
|
|
3662
|
+
const ver = attsMap[this.options.attributeNamePrefix + "version"];
|
|
3663
|
+
this.entityDecoder.setXmlVersion(Number(ver) || 1);
|
|
3664
|
+
}
|
|
3665
|
+
if (options.ignoreDeclaration && tagData.tagName === "?xml" || options.ignorePiTags) {
|
|
1997
3666
|
} else {
|
|
1998
3667
|
const childNode = new XmlNode(tagData.tagName);
|
|
1999
|
-
childNode.add(
|
|
2000
|
-
if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) {
|
|
2001
|
-
childNode[":@"] =
|
|
3668
|
+
childNode.add(options.textNodeName, "");
|
|
3669
|
+
if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent && options.ignoreAttributes !== true) {
|
|
3670
|
+
childNode[":@"] = attsMap;
|
|
2002
3671
|
}
|
|
2003
3672
|
this.addChild(currentNode, childNode, this.readonlyMatcher, i2);
|
|
2004
3673
|
}
|
|
2005
3674
|
i2 = tagData.closeIndex + 1;
|
|
2006
|
-
} else if (xmlData.
|
|
3675
|
+
} else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 45 && xmlData.charCodeAt(i2 + 3) === 45) {
|
|
2007
3676
|
const endIndex = findClosingIndex(xmlData, "-->", i2 + 4, "Comment is not closed.");
|
|
2008
|
-
if (
|
|
3677
|
+
if (options.commentPropName) {
|
|
2009
3678
|
const comment = xmlData.substring(i2 + 4, endIndex - 2);
|
|
2010
3679
|
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
2011
|
-
currentNode.add(
|
|
3680
|
+
currentNode.add(options.commentPropName, [{ [options.textNodeName]: comment }]);
|
|
2012
3681
|
}
|
|
2013
3682
|
i2 = endIndex;
|
|
2014
|
-
} else if (xmlData.
|
|
3683
|
+
} else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 68) {
|
|
2015
3684
|
const result = docTypeReader.readDocType(xmlData, i2);
|
|
2016
|
-
this.
|
|
3685
|
+
this.entityDecoder.addInputEntities(result.entities);
|
|
2017
3686
|
i2 = result.i;
|
|
2018
|
-
} else if (xmlData.
|
|
3687
|
+
} else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 91) {
|
|
2019
3688
|
const closeIndex = findClosingIndex(xmlData, "]]>", i2, "CDATA is not closed.") - 2;
|
|
2020
3689
|
const tagExp = xmlData.substring(i2 + 9, closeIndex);
|
|
2021
3690
|
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
2022
3691
|
let val = this.parseTextData(tagExp, currentNode.tagname, this.readonlyMatcher, true, false, true, true);
|
|
2023
3692
|
if (val == void 0) val = "";
|
|
2024
|
-
if (
|
|
2025
|
-
currentNode.add(
|
|
3693
|
+
if (options.cdataPropName) {
|
|
3694
|
+
currentNode.add(options.cdataPropName, [{ [options.textNodeName]: tagExp }]);
|
|
2026
3695
|
} else {
|
|
2027
|
-
currentNode.add(
|
|
3696
|
+
currentNode.add(options.textNodeName, val);
|
|
2028
3697
|
}
|
|
2029
3698
|
i2 = closeIndex + 2;
|
|
2030
3699
|
} else {
|
|
2031
|
-
let result = readTagExp(xmlData, i2,
|
|
3700
|
+
let result = readTagExp(xmlData, i2, options.removeNSPrefix);
|
|
2032
3701
|
if (!result) {
|
|
2033
|
-
const context = xmlData.substring(Math.max(0, i2 - 50), Math.min(
|
|
3702
|
+
const context = xmlData.substring(Math.max(0, i2 - 50), Math.min(xmlLen, i2 + 50));
|
|
2034
3703
|
throw new Error(`readTagExp returned undefined at position ${i2}. Context: "${context}"`);
|
|
2035
3704
|
}
|
|
2036
3705
|
let tagName = result.tagName;
|
|
@@ -2038,8 +3707,8 @@ var parseXml = function(xmlData) {
|
|
|
2038
3707
|
let tagExp = result.tagExp;
|
|
2039
3708
|
let attrExpPresent = result.attrExpPresent;
|
|
2040
3709
|
let closeIndex = result.closeIndex;
|
|
2041
|
-
({ tagName, tagExp } = transformTagName(
|
|
2042
|
-
if (
|
|
3710
|
+
({ tagName, tagExp } = transformTagName(options.transformTagName, tagName, tagExp, options));
|
|
3711
|
+
if (options.strictReservedNames && (tagName === options.commentPropName || tagName === options.cdataPropName || tagName === options.textNodeName || tagName === options.attributesGroupName)) {
|
|
2043
3712
|
throw new Error(`Invalid tag name: ${tagName}`);
|
|
2044
3713
|
}
|
|
2045
3714
|
if (currentNode && textData) {
|
|
@@ -2048,7 +3717,7 @@ var parseXml = function(xmlData) {
|
|
|
2048
3717
|
}
|
|
2049
3718
|
}
|
|
2050
3719
|
const lastTag = currentNode;
|
|
2051
|
-
if (lastTag &&
|
|
3720
|
+
if (lastTag && options.unpairedTagsSet.has(lastTag.tagname)) {
|
|
2052
3721
|
currentNode = this.tagsNodeStack.pop();
|
|
2053
3722
|
this.matcher.pop();
|
|
2054
3723
|
}
|
|
@@ -2073,18 +3742,18 @@ var parseXml = function(xmlData) {
|
|
|
2073
3742
|
if (tagName !== tagExp && attrExpPresent) {
|
|
2074
3743
|
prefixedAttrs = this.buildAttributesMap(tagExp, this.matcher, tagName);
|
|
2075
3744
|
if (prefixedAttrs) {
|
|
2076
|
-
rawAttrs = extractRawAttributes(prefixedAttrs,
|
|
3745
|
+
rawAttrs = extractRawAttributes(prefixedAttrs, options);
|
|
2077
3746
|
}
|
|
2078
3747
|
}
|
|
2079
3748
|
if (tagName !== xmlObj.tagname) {
|
|
2080
|
-
this.isCurrentNodeStopNode = this.isItStopNode(
|
|
3749
|
+
this.isCurrentNodeStopNode = this.isItStopNode();
|
|
2081
3750
|
}
|
|
2082
3751
|
const startIndex = i2;
|
|
2083
3752
|
if (this.isCurrentNodeStopNode) {
|
|
2084
3753
|
let tagContent = "";
|
|
2085
3754
|
if (isSelfClosing) {
|
|
2086
3755
|
i2 = result.closeIndex;
|
|
2087
|
-
} else if (
|
|
3756
|
+
} else if (options.unpairedTagsSet.has(tagName)) {
|
|
2088
3757
|
i2 = result.closeIndex;
|
|
2089
3758
|
} else {
|
|
2090
3759
|
const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
|
|
@@ -2096,13 +3765,13 @@ var parseXml = function(xmlData) {
|
|
|
2096
3765
|
if (prefixedAttrs) {
|
|
2097
3766
|
childNode[":@"] = prefixedAttrs;
|
|
2098
3767
|
}
|
|
2099
|
-
childNode.add(
|
|
3768
|
+
childNode.add(options.textNodeName, tagContent);
|
|
2100
3769
|
this.matcher.pop();
|
|
2101
3770
|
this.isCurrentNodeStopNode = false;
|
|
2102
3771
|
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
|
2103
3772
|
} else {
|
|
2104
3773
|
if (isSelfClosing) {
|
|
2105
|
-
({ tagName, tagExp } = transformTagName(
|
|
3774
|
+
({ tagName, tagExp } = transformTagName(options.transformTagName, tagName, tagExp, options));
|
|
2106
3775
|
const childNode = new XmlNode(tagName);
|
|
2107
3776
|
if (prefixedAttrs) {
|
|
2108
3777
|
childNode[":@"] = prefixedAttrs;
|
|
@@ -2110,7 +3779,7 @@ var parseXml = function(xmlData) {
|
|
|
2110
3779
|
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
|
2111
3780
|
this.matcher.pop();
|
|
2112
3781
|
this.isCurrentNodeStopNode = false;
|
|
2113
|
-
} else if (
|
|
3782
|
+
} else if (options.unpairedTagsSet.has(tagName)) {
|
|
2114
3783
|
const childNode = new XmlNode(tagName);
|
|
2115
3784
|
if (prefixedAttrs) {
|
|
2116
3785
|
childNode[":@"] = prefixedAttrs;
|
|
@@ -2122,7 +3791,7 @@ var parseXml = function(xmlData) {
|
|
|
2122
3791
|
continue;
|
|
2123
3792
|
} else {
|
|
2124
3793
|
const childNode = new XmlNode(tagName);
|
|
2125
|
-
if (this.tagsNodeStack.length >
|
|
3794
|
+
if (this.tagsNodeStack.length > options.maxNestedTags) {
|
|
2126
3795
|
throw new Error("Maximum nested tags exceeded");
|
|
2127
3796
|
}
|
|
2128
3797
|
this.tagsNodeStack.push(currentNode);
|
|
@@ -2172,59 +3841,7 @@ function replaceEntitiesValue(val, tagName, jPath) {
|
|
|
2172
3841
|
return val;
|
|
2173
3842
|
}
|
|
2174
3843
|
}
|
|
2175
|
-
|
|
2176
|
-
const entity = this.docTypeEntities[entityName];
|
|
2177
|
-
const matches = val.match(entity.regx);
|
|
2178
|
-
if (matches) {
|
|
2179
|
-
this.entityExpansionCount += matches.length;
|
|
2180
|
-
if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) {
|
|
2181
|
-
throw new Error(
|
|
2182
|
-
`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
|
|
2183
|
-
);
|
|
2184
|
-
}
|
|
2185
|
-
const lengthBefore = val.length;
|
|
2186
|
-
val = val.replace(entity.regx, entity.val);
|
|
2187
|
-
if (entityConfig.maxExpandedLength) {
|
|
2188
|
-
this.currentExpandedLength += val.length - lengthBefore;
|
|
2189
|
-
if (this.currentExpandedLength > entityConfig.maxExpandedLength) {
|
|
2190
|
-
throw new Error(
|
|
2191
|
-
`Total expanded content size exceeded: ${this.currentExpandedLength} > ${entityConfig.maxExpandedLength}`
|
|
2192
|
-
);
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
for (const entityName of Object.keys(this.lastEntities)) {
|
|
2198
|
-
const entity = this.lastEntities[entityName];
|
|
2199
|
-
const matches = val.match(entity.regex);
|
|
2200
|
-
if (matches) {
|
|
2201
|
-
this.entityExpansionCount += matches.length;
|
|
2202
|
-
if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) {
|
|
2203
|
-
throw new Error(
|
|
2204
|
-
`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
|
|
2205
|
-
);
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
val = val.replace(entity.regex, entity.val);
|
|
2209
|
-
}
|
|
2210
|
-
if (val.indexOf("&") === -1) return val;
|
|
2211
|
-
if (this.options.htmlEntities) {
|
|
2212
|
-
for (const entityName of Object.keys(this.htmlEntities)) {
|
|
2213
|
-
const entity = this.htmlEntities[entityName];
|
|
2214
|
-
const matches = val.match(entity.regex);
|
|
2215
|
-
if (matches) {
|
|
2216
|
-
this.entityExpansionCount += matches.length;
|
|
2217
|
-
if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) {
|
|
2218
|
-
throw new Error(
|
|
2219
|
-
`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
|
|
2220
|
-
);
|
|
2221
|
-
}
|
|
2222
|
-
}
|
|
2223
|
-
val = val.replace(entity.regex, entity.val);
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
val = val.replace(this.ampEntity.regex, this.ampEntity.val);
|
|
2227
|
-
return val;
|
|
3844
|
+
return this.entityDecoder.decode(val);
|
|
2228
3845
|
}
|
|
2229
3846
|
function saveTextToParentTag(textData, parentNode, matcher, isLeafNode) {
|
|
2230
3847
|
if (textData) {
|
|
@@ -2243,42 +3860,37 @@ function saveTextToParentTag(textData, parentNode, matcher, isLeafNode) {
|
|
|
2243
3860
|
}
|
|
2244
3861
|
return textData;
|
|
2245
3862
|
}
|
|
2246
|
-
function isItStopNode(
|
|
2247
|
-
if (
|
|
2248
|
-
|
|
2249
|
-
if (matcher.matches(stopNodeExpressions[i2])) {
|
|
2250
|
-
return true;
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
|
-
return false;
|
|
3863
|
+
function isItStopNode() {
|
|
3864
|
+
if (this.stopNodeExpressionsSet.size === 0) return false;
|
|
3865
|
+
return this.matcher.matchesAny(this.stopNodeExpressionsSet);
|
|
2254
3866
|
}
|
|
2255
3867
|
function tagExpWithClosingIndex(xmlData, i2, closingChar = ">") {
|
|
2256
|
-
let attrBoundary;
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
3868
|
+
let attrBoundary = 0;
|
|
3869
|
+
const len = xmlData.length;
|
|
3870
|
+
const closeCode0 = closingChar.charCodeAt(0);
|
|
3871
|
+
const closeCode1 = closingChar.length > 1 ? closingChar.charCodeAt(1) : -1;
|
|
3872
|
+
let result = "";
|
|
3873
|
+
let segmentStart = i2;
|
|
3874
|
+
for (let index = i2; index < len; index++) {
|
|
3875
|
+
const code = xmlData.charCodeAt(index);
|
|
2260
3876
|
if (attrBoundary) {
|
|
2261
|
-
if (
|
|
2262
|
-
} else if (
|
|
2263
|
-
attrBoundary =
|
|
2264
|
-
} else if (
|
|
2265
|
-
if (
|
|
2266
|
-
if (xmlData
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
index
|
|
2270
|
-
};
|
|
3877
|
+
if (code === attrBoundary) attrBoundary = 0;
|
|
3878
|
+
} else if (code === 34 || code === 39) {
|
|
3879
|
+
attrBoundary = code;
|
|
3880
|
+
} else if (code === closeCode0) {
|
|
3881
|
+
if (closeCode1 !== -1) {
|
|
3882
|
+
if (xmlData.charCodeAt(index + 1) === closeCode1) {
|
|
3883
|
+
result += xmlData.substring(segmentStart, index);
|
|
3884
|
+
return { data: result, index };
|
|
2271
3885
|
}
|
|
2272
3886
|
} else {
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
index
|
|
2276
|
-
};
|
|
3887
|
+
result += xmlData.substring(segmentStart, index);
|
|
3888
|
+
return { data: result, index };
|
|
2277
3889
|
}
|
|
2278
|
-
} else if (
|
|
2279
|
-
|
|
3890
|
+
} else if (code === 9 && !attrBoundary) {
|
|
3891
|
+
result += xmlData.substring(segmentStart, index) + " ";
|
|
3892
|
+
segmentStart = index + 1;
|
|
2280
3893
|
}
|
|
2281
|
-
tagExp += ch;
|
|
2282
3894
|
}
|
|
2283
3895
|
}
|
|
2284
3896
|
function findClosingIndex(xmlData, str, i2, errMsg) {
|
|
@@ -2289,6 +3901,11 @@ function findClosingIndex(xmlData, str, i2, errMsg) {
|
|
|
2289
3901
|
return closingIndex + str.length - 1;
|
|
2290
3902
|
}
|
|
2291
3903
|
}
|
|
3904
|
+
function findClosingChar(xmlData, char, i2, errMsg) {
|
|
3905
|
+
const closingIndex = xmlData.indexOf(char, i2);
|
|
3906
|
+
if (closingIndex === -1) throw new Error(errMsg);
|
|
3907
|
+
return closingIndex;
|
|
3908
|
+
}
|
|
2292
3909
|
function readTagExp(xmlData, i2, removeNSPrefix, closingChar = ">") {
|
|
2293
3910
|
const result = tagExpWithClosingIndex(xmlData, i2 + 1, closingChar);
|
|
2294
3911
|
if (!result) return;
|
|
@@ -2320,10 +3937,12 @@ function readTagExp(xmlData, i2, removeNSPrefix, closingChar = ">") {
|
|
|
2320
3937
|
function readStopNodeData(xmlData, tagName, i2) {
|
|
2321
3938
|
const startIndex = i2;
|
|
2322
3939
|
let openTagCount = 1;
|
|
2323
|
-
|
|
3940
|
+
const xmllen = xmlData.length;
|
|
3941
|
+
for (; i2 < xmllen; i2++) {
|
|
2324
3942
|
if (xmlData[i2] === "<") {
|
|
2325
|
-
|
|
2326
|
-
|
|
3943
|
+
const c1 = xmlData.charCodeAt(i2 + 1);
|
|
3944
|
+
if (c1 === 47) {
|
|
3945
|
+
const closeIndex = findClosingChar(xmlData, ">", i2, `${tagName} is not closed`);
|
|
2327
3946
|
let closeTagName = xmlData.substring(i2 + 2, closeIndex).trim();
|
|
2328
3947
|
if (closeTagName === tagName) {
|
|
2329
3948
|
openTagCount--;
|
|
@@ -2335,13 +3954,13 @@ function readStopNodeData(xmlData, tagName, i2) {
|
|
|
2335
3954
|
}
|
|
2336
3955
|
}
|
|
2337
3956
|
i2 = closeIndex;
|
|
2338
|
-
} else if (
|
|
3957
|
+
} else if (c1 === 63) {
|
|
2339
3958
|
const closeIndex = findClosingIndex(xmlData, "?>", i2 + 1, "StopNode is not closed.");
|
|
2340
3959
|
i2 = closeIndex;
|
|
2341
|
-
} else if (xmlData.
|
|
3960
|
+
} else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 45 && xmlData.charCodeAt(i2 + 3) === 45) {
|
|
2342
3961
|
const closeIndex = findClosingIndex(xmlData, "-->", i2 + 3, "StopNode is not closed.");
|
|
2343
3962
|
i2 = closeIndex;
|
|
2344
|
-
} else if (xmlData.
|
|
3963
|
+
} else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 91) {
|
|
2345
3964
|
const closeIndex = findClosingIndex(xmlData, "]]>", i2, "StopNode is not closed.") - 2;
|
|
2346
3965
|
i2 = closeIndex;
|
|
2347
3966
|
} else {
|
|
@@ -2371,14 +3990,6 @@ function parseValue(val, shouldParse, options) {
|
|
|
2371
3990
|
}
|
|
2372
3991
|
}
|
|
2373
3992
|
}
|
|
2374
|
-
function fromCodePoint(str, base, prefix) {
|
|
2375
|
-
const codePoint = Number.parseInt(str, base);
|
|
2376
|
-
if (codePoint >= 0 && codePoint <= 1114111) {
|
|
2377
|
-
return String.fromCodePoint(codePoint);
|
|
2378
|
-
} else {
|
|
2379
|
-
return prefix + str + ";";
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
3993
|
function transformTagName(fn, tagName, tagExp, options) {
|
|
2383
3994
|
if (fn) {
|
|
2384
3995
|
const newTagName = fn(tagName);
|
|
@@ -2399,7 +4010,7 @@ function sanitizeName(name, options) {
|
|
|
2399
4010
|
return name;
|
|
2400
4011
|
}
|
|
2401
4012
|
|
|
2402
|
-
// ../node_modules/.bun/fast-xml-parser@5.
|
|
4013
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/node2json.js
|
|
2403
4014
|
var METADATA_SYMBOL2 = XmlNode.getMetaDataSymbol();
|
|
2404
4015
|
function stripAttributePrefix(attrs, prefix) {
|
|
2405
4016
|
if (!attrs || typeof attrs !== "object") return {};
|
|
@@ -2508,7 +4119,7 @@ function isLeafTag(obj, options) {
|
|
|
2508
4119
|
return false;
|
|
2509
4120
|
}
|
|
2510
4121
|
|
|
2511
|
-
// ../node_modules/.bun/fast-xml-parser@5.
|
|
4122
|
+
// ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
|
|
2512
4123
|
var XMLParser = class {
|
|
2513
4124
|
constructor(options) {
|
|
2514
4125
|
this.externalEntities = {};
|
|
@@ -2532,8 +4143,7 @@ var XMLParser = class {
|
|
|
2532
4143
|
throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);
|
|
2533
4144
|
}
|
|
2534
4145
|
}
|
|
2535
|
-
const orderedObjParser = new OrderedObjParser(this.options);
|
|
2536
|
-
orderedObjParser.addExternalEntities(this.externalEntities);
|
|
4146
|
+
const orderedObjParser = new OrderedObjParser(this.options, this.externalEntities);
|
|
2537
4147
|
const orderedResult = orderedObjParser.parseXml(xmlData);
|
|
2538
4148
|
if (this.options.preserveOrder || orderedResult === void 0) return orderedResult;
|
|
2539
4149
|
else return prettify(orderedResult, this.options, orderedObjParser.matcher, orderedObjParser.readonlyMatcher);
|
|
@@ -2569,7 +4179,343 @@ var XMLParser = class {
|
|
|
2569
4179
|
}
|
|
2570
4180
|
};
|
|
2571
4181
|
|
|
2572
|
-
// ../node_modules/.bun/@aws-sdk+xml-builder@3.972.
|
|
4182
|
+
// ../node_modules/.bun/@aws-sdk+xml-builder@3.972.22/node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js
|
|
4183
|
+
var XML2 = {
|
|
4184
|
+
amp: "&",
|
|
4185
|
+
apos: "'",
|
|
4186
|
+
gt: ">",
|
|
4187
|
+
lt: "<",
|
|
4188
|
+
quot: '"'
|
|
4189
|
+
};
|
|
4190
|
+
var COMMON_HTML2 = {
|
|
4191
|
+
nbsp: "\xA0",
|
|
4192
|
+
copy: "\xA9",
|
|
4193
|
+
reg: "\xAE",
|
|
4194
|
+
trade: "\u2122",
|
|
4195
|
+
mdash: "\u2014",
|
|
4196
|
+
ndash: "\u2013",
|
|
4197
|
+
hellip: "\u2026",
|
|
4198
|
+
laquo: "\xAB",
|
|
4199
|
+
raquo: "\xBB",
|
|
4200
|
+
lsquo: "\u2018",
|
|
4201
|
+
rsquo: "\u2019",
|
|
4202
|
+
ldquo: "\u201C",
|
|
4203
|
+
rdquo: "\u201D",
|
|
4204
|
+
bull: "\u2022",
|
|
4205
|
+
para: "\xB6",
|
|
4206
|
+
sect: "\xA7",
|
|
4207
|
+
deg: "\xB0",
|
|
4208
|
+
frac12: "\xBD",
|
|
4209
|
+
frac14: "\xBC",
|
|
4210
|
+
frac34: "\xBE"
|
|
4211
|
+
};
|
|
4212
|
+
var CURRENCY2 = {
|
|
4213
|
+
cent: "\xA2",
|
|
4214
|
+
pound: "\xA3",
|
|
4215
|
+
curren: "\xA4",
|
|
4216
|
+
yen: "\xA5",
|
|
4217
|
+
euro: "\u20AC",
|
|
4218
|
+
dollar: "$",
|
|
4219
|
+
fnof: "\u0192",
|
|
4220
|
+
inr: "\u20B9",
|
|
4221
|
+
af: "\u060B",
|
|
4222
|
+
birr: "\u1265\u122D",
|
|
4223
|
+
peso: "\u20B1",
|
|
4224
|
+
rub: "\u20BD",
|
|
4225
|
+
won: "\u20A9",
|
|
4226
|
+
yuan: "\xA5",
|
|
4227
|
+
cedil: "\xB8"
|
|
4228
|
+
};
|
|
4229
|
+
var SPECIAL_CHARS2 = new Set("!?\\/[]$%{}^&*()<>|+");
|
|
4230
|
+
function validateEntityName3(name) {
|
|
4231
|
+
if (name[0] === "#") {
|
|
4232
|
+
throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`);
|
|
4233
|
+
}
|
|
4234
|
+
for (const ch of name) {
|
|
4235
|
+
if (SPECIAL_CHARS2.has(ch)) {
|
|
4236
|
+
throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`);
|
|
4237
|
+
}
|
|
4238
|
+
}
|
|
4239
|
+
return name;
|
|
4240
|
+
}
|
|
4241
|
+
function mergeEntityMaps2(...maps) {
|
|
4242
|
+
const out = /* @__PURE__ */ Object.create(null);
|
|
4243
|
+
for (const map of maps) {
|
|
4244
|
+
if (!map) {
|
|
4245
|
+
continue;
|
|
4246
|
+
}
|
|
4247
|
+
for (const key of Object.keys(map)) {
|
|
4248
|
+
const raw = map[key];
|
|
4249
|
+
if (typeof raw === "string") {
|
|
4250
|
+
out[key] = raw;
|
|
4251
|
+
} else if (raw && typeof raw === "object" && raw.val !== void 0) {
|
|
4252
|
+
const val = raw.val;
|
|
4253
|
+
if (typeof val === "string") {
|
|
4254
|
+
out[key] = val;
|
|
4255
|
+
}
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
return out;
|
|
4260
|
+
}
|
|
4261
|
+
var LIMIT_TIER_EXTERNAL2 = "external";
|
|
4262
|
+
var LIMIT_TIER_BASE2 = "base";
|
|
4263
|
+
var LIMIT_TIER_ALL2 = "all";
|
|
4264
|
+
function parseLimitTiers2(raw) {
|
|
4265
|
+
if (!raw || raw === LIMIT_TIER_EXTERNAL2) {
|
|
4266
|
+
return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL2]);
|
|
4267
|
+
}
|
|
4268
|
+
if (raw === LIMIT_TIER_ALL2) {
|
|
4269
|
+
return /* @__PURE__ */ new Set([LIMIT_TIER_ALL2]);
|
|
4270
|
+
}
|
|
4271
|
+
if (raw === LIMIT_TIER_BASE2) {
|
|
4272
|
+
return /* @__PURE__ */ new Set([LIMIT_TIER_BASE2]);
|
|
4273
|
+
}
|
|
4274
|
+
if (Array.isArray(raw)) {
|
|
4275
|
+
return new Set(raw);
|
|
4276
|
+
}
|
|
4277
|
+
return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL2]);
|
|
4278
|
+
}
|
|
4279
|
+
var NCR_LEVEL2 = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 });
|
|
4280
|
+
var XML10_ALLOWED_C02 = /* @__PURE__ */ new Set([9, 10, 13]);
|
|
4281
|
+
function parseNCRConfig2(ncr) {
|
|
4282
|
+
if (!ncr) {
|
|
4283
|
+
return { xmlVersion: 1, onLevel: NCR_LEVEL2.allow, nullLevel: NCR_LEVEL2.remove };
|
|
4284
|
+
}
|
|
4285
|
+
const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1;
|
|
4286
|
+
const onLevel = NCR_LEVEL2[ncr.onNCR ?? "allow"] ?? NCR_LEVEL2.allow;
|
|
4287
|
+
const nullLevel = NCR_LEVEL2[ncr.nullNCR ?? "remove"] ?? NCR_LEVEL2.remove;
|
|
4288
|
+
const clampedNull = Math.max(nullLevel, NCR_LEVEL2.remove);
|
|
4289
|
+
return { xmlVersion, onLevel, nullLevel: clampedNull };
|
|
4290
|
+
}
|
|
4291
|
+
var EntityDecoderImpl = class EntityDecoderImpl2 {
|
|
4292
|
+
_limit;
|
|
4293
|
+
_maxTotalExpansions;
|
|
4294
|
+
_maxExpandedLength;
|
|
4295
|
+
_postCheck;
|
|
4296
|
+
_limitTiers;
|
|
4297
|
+
_numericAllowed;
|
|
4298
|
+
_baseMap;
|
|
4299
|
+
_externalMap;
|
|
4300
|
+
_inputMap;
|
|
4301
|
+
_totalExpansions;
|
|
4302
|
+
_expandedLength;
|
|
4303
|
+
_removeSet;
|
|
4304
|
+
_leaveSet;
|
|
4305
|
+
_ncrXmlVersion;
|
|
4306
|
+
_ncrOnLevel;
|
|
4307
|
+
_ncrNullLevel;
|
|
4308
|
+
constructor(options = {}) {
|
|
4309
|
+
this._limit = options.limit || {};
|
|
4310
|
+
this._maxTotalExpansions = this._limit.maxTotalExpansions || 0;
|
|
4311
|
+
this._maxExpandedLength = this._limit.maxExpandedLength || 0;
|
|
4312
|
+
this._postCheck = typeof options.postCheck === "function" ? options.postCheck : (r2) => r2;
|
|
4313
|
+
this._limitTiers = parseLimitTiers2(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL2);
|
|
4314
|
+
this._numericAllowed = options.numericAllowed ?? true;
|
|
4315
|
+
this._baseMap = mergeEntityMaps2(XML2, options.namedEntities || null);
|
|
4316
|
+
this._externalMap = /* @__PURE__ */ Object.create(null);
|
|
4317
|
+
this._inputMap = /* @__PURE__ */ Object.create(null);
|
|
4318
|
+
this._totalExpansions = 0;
|
|
4319
|
+
this._expandedLength = 0;
|
|
4320
|
+
this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []);
|
|
4321
|
+
this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []);
|
|
4322
|
+
const ncrCfg = parseNCRConfig2(options.ncr);
|
|
4323
|
+
this._ncrXmlVersion = ncrCfg.xmlVersion;
|
|
4324
|
+
this._ncrOnLevel = ncrCfg.onLevel;
|
|
4325
|
+
this._ncrNullLevel = ncrCfg.nullLevel;
|
|
4326
|
+
}
|
|
4327
|
+
setExternalEntities(map) {
|
|
4328
|
+
if (map) {
|
|
4329
|
+
for (const key of Object.keys(map)) {
|
|
4330
|
+
validateEntityName3(key);
|
|
4331
|
+
}
|
|
4332
|
+
}
|
|
4333
|
+
this._externalMap = mergeEntityMaps2(map);
|
|
4334
|
+
}
|
|
4335
|
+
addExternalEntity(key, value) {
|
|
4336
|
+
validateEntityName3(key);
|
|
4337
|
+
if (typeof value === "string" && value.indexOf("&") === -1) {
|
|
4338
|
+
this._externalMap[key] = value;
|
|
4339
|
+
}
|
|
4340
|
+
}
|
|
4341
|
+
addInputEntities(map) {
|
|
4342
|
+
this._totalExpansions = 0;
|
|
4343
|
+
this._expandedLength = 0;
|
|
4344
|
+
this._inputMap = mergeEntityMaps2(map);
|
|
4345
|
+
}
|
|
4346
|
+
reset() {
|
|
4347
|
+
this._inputMap = /* @__PURE__ */ Object.create(null);
|
|
4348
|
+
this._totalExpansions = 0;
|
|
4349
|
+
this._expandedLength = 0;
|
|
4350
|
+
return this;
|
|
4351
|
+
}
|
|
4352
|
+
setXmlVersion(version) {
|
|
4353
|
+
this._ncrXmlVersion = version === "1.1" || version === 1.1 ? 1.1 : 1;
|
|
4354
|
+
}
|
|
4355
|
+
decode(str) {
|
|
4356
|
+
if (typeof str !== "string" || str.length === 0) {
|
|
4357
|
+
return str;
|
|
4358
|
+
}
|
|
4359
|
+
const original = str;
|
|
4360
|
+
const chunks = [];
|
|
4361
|
+
const len = str.length;
|
|
4362
|
+
let last = 0;
|
|
4363
|
+
let i2 = 0;
|
|
4364
|
+
const limitExpansions = this._maxTotalExpansions > 0;
|
|
4365
|
+
const limitLength = this._maxExpandedLength > 0;
|
|
4366
|
+
const checkLimits = limitExpansions || limitLength;
|
|
4367
|
+
while (i2 < len) {
|
|
4368
|
+
if (str.charCodeAt(i2) !== 38) {
|
|
4369
|
+
i2++;
|
|
4370
|
+
continue;
|
|
4371
|
+
}
|
|
4372
|
+
let j2 = i2 + 1;
|
|
4373
|
+
while (j2 < len && str.charCodeAt(j2) !== 59 && j2 - i2 <= 32) {
|
|
4374
|
+
j2++;
|
|
4375
|
+
}
|
|
4376
|
+
if (j2 >= len || str.charCodeAt(j2) !== 59) {
|
|
4377
|
+
i2++;
|
|
4378
|
+
continue;
|
|
4379
|
+
}
|
|
4380
|
+
const token = str.slice(i2 + 1, j2);
|
|
4381
|
+
if (token.length === 0) {
|
|
4382
|
+
i2++;
|
|
4383
|
+
continue;
|
|
4384
|
+
}
|
|
4385
|
+
let replacement;
|
|
4386
|
+
let tier;
|
|
4387
|
+
if (this._removeSet.has(token)) {
|
|
4388
|
+
replacement = "";
|
|
4389
|
+
if (tier === void 0) {
|
|
4390
|
+
tier = LIMIT_TIER_EXTERNAL2;
|
|
4391
|
+
}
|
|
4392
|
+
} else if (this._leaveSet.has(token)) {
|
|
4393
|
+
i2++;
|
|
4394
|
+
continue;
|
|
4395
|
+
} else if (token.charCodeAt(0) === 35) {
|
|
4396
|
+
const ncrResult = this._resolveNCR(token);
|
|
4397
|
+
if (ncrResult === void 0) {
|
|
4398
|
+
i2++;
|
|
4399
|
+
continue;
|
|
4400
|
+
}
|
|
4401
|
+
replacement = ncrResult;
|
|
4402
|
+
tier = LIMIT_TIER_BASE2;
|
|
4403
|
+
} else {
|
|
4404
|
+
const resolved = this._resolveName(token);
|
|
4405
|
+
replacement = resolved?.value;
|
|
4406
|
+
tier = resolved?.tier;
|
|
4407
|
+
}
|
|
4408
|
+
if (replacement === void 0) {
|
|
4409
|
+
i2++;
|
|
4410
|
+
continue;
|
|
4411
|
+
}
|
|
4412
|
+
if (i2 > last) {
|
|
4413
|
+
chunks.push(str.slice(last, i2));
|
|
4414
|
+
}
|
|
4415
|
+
chunks.push(replacement);
|
|
4416
|
+
last = j2 + 1;
|
|
4417
|
+
i2 = last;
|
|
4418
|
+
if (checkLimits && this._tierCounts(tier)) {
|
|
4419
|
+
if (limitExpansions) {
|
|
4420
|
+
this._totalExpansions++;
|
|
4421
|
+
if (this._totalExpansions > this._maxTotalExpansions) {
|
|
4422
|
+
throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);
|
|
4423
|
+
}
|
|
4424
|
+
}
|
|
4425
|
+
if (limitLength) {
|
|
4426
|
+
const delta = replacement.length - (token.length + 2);
|
|
4427
|
+
if (delta > 0) {
|
|
4428
|
+
this._expandedLength += delta;
|
|
4429
|
+
if (this._expandedLength > this._maxExpandedLength) {
|
|
4430
|
+
throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`);
|
|
4431
|
+
}
|
|
4432
|
+
}
|
|
4433
|
+
}
|
|
4434
|
+
}
|
|
4435
|
+
}
|
|
4436
|
+
if (last < len) {
|
|
4437
|
+
chunks.push(str.slice(last));
|
|
4438
|
+
}
|
|
4439
|
+
const result = chunks.length === 0 ? str : chunks.join("");
|
|
4440
|
+
return this._postCheck(result, original);
|
|
4441
|
+
}
|
|
4442
|
+
_tierCounts(tier) {
|
|
4443
|
+
if (this._limitTiers.has(LIMIT_TIER_ALL2)) {
|
|
4444
|
+
return true;
|
|
4445
|
+
}
|
|
4446
|
+
return this._limitTiers.has(tier);
|
|
4447
|
+
}
|
|
4448
|
+
_resolveName(name) {
|
|
4449
|
+
if (name in this._inputMap) {
|
|
4450
|
+
return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL2 };
|
|
4451
|
+
}
|
|
4452
|
+
if (name in this._externalMap) {
|
|
4453
|
+
return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL2 };
|
|
4454
|
+
}
|
|
4455
|
+
if (name in this._baseMap) {
|
|
4456
|
+
return { value: this._baseMap[name], tier: LIMIT_TIER_BASE2 };
|
|
4457
|
+
}
|
|
4458
|
+
return void 0;
|
|
4459
|
+
}
|
|
4460
|
+
_classifyNCR(cp) {
|
|
4461
|
+
if (cp === 0) {
|
|
4462
|
+
return this._ncrNullLevel;
|
|
4463
|
+
}
|
|
4464
|
+
if (cp >= 55296 && cp <= 57343) {
|
|
4465
|
+
return NCR_LEVEL2.remove;
|
|
4466
|
+
}
|
|
4467
|
+
if (this._ncrXmlVersion === 1) {
|
|
4468
|
+
if (cp >= 1 && cp <= 31 && !XML10_ALLOWED_C02.has(cp)) {
|
|
4469
|
+
return NCR_LEVEL2.remove;
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
return -1;
|
|
4473
|
+
}
|
|
4474
|
+
_applyNCRAction(action, token, cp) {
|
|
4475
|
+
switch (action) {
|
|
4476
|
+
case NCR_LEVEL2.allow:
|
|
4477
|
+
return String.fromCodePoint(cp);
|
|
4478
|
+
case NCR_LEVEL2.remove:
|
|
4479
|
+
return "";
|
|
4480
|
+
case NCR_LEVEL2.leave:
|
|
4481
|
+
return void 0;
|
|
4482
|
+
case NCR_LEVEL2.throw:
|
|
4483
|
+
throw new Error(`[EntityDecoder] Prohibited numeric character reference &${token}; (U+${cp.toString(16).toUpperCase().padStart(4, "0")})`);
|
|
4484
|
+
default:
|
|
4485
|
+
return String.fromCodePoint(cp);
|
|
4486
|
+
}
|
|
4487
|
+
}
|
|
4488
|
+
_resolveNCR(token) {
|
|
4489
|
+
const second = token.charCodeAt(1);
|
|
4490
|
+
let cp;
|
|
4491
|
+
if (second === 120 || second === 88) {
|
|
4492
|
+
cp = parseInt(token.slice(2), 16);
|
|
4493
|
+
} else {
|
|
4494
|
+
cp = parseInt(token.slice(1), 10);
|
|
4495
|
+
}
|
|
4496
|
+
if (Number.isNaN(cp) || cp < 0 || cp > 1114111) {
|
|
4497
|
+
return void 0;
|
|
4498
|
+
}
|
|
4499
|
+
const minimum = this._classifyNCR(cp);
|
|
4500
|
+
if (!this._numericAllowed && minimum < NCR_LEVEL2.remove) {
|
|
4501
|
+
return void 0;
|
|
4502
|
+
}
|
|
4503
|
+
const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum);
|
|
4504
|
+
return this._applyNCRAction(effective, token, cp);
|
|
4505
|
+
}
|
|
4506
|
+
};
|
|
4507
|
+
|
|
4508
|
+
// ../node_modules/.bun/@aws-sdk+xml-builder@3.972.22/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js
|
|
4509
|
+
var entityDecoder = new EntityDecoderImpl({
|
|
4510
|
+
namedEntities: { ...XML2, ...COMMON_HTML2, ...CURRENCY2 },
|
|
4511
|
+
numericAllowed: true,
|
|
4512
|
+
limit: {
|
|
4513
|
+
maxTotalExpansions: Infinity
|
|
4514
|
+
},
|
|
4515
|
+
ncr: {
|
|
4516
|
+
xmlVersion: 1.1
|
|
4517
|
+
}
|
|
4518
|
+
});
|
|
2573
4519
|
var parser = new XMLParser({
|
|
2574
4520
|
attributeNamePrefix: "",
|
|
2575
4521
|
processEntities: {
|
|
@@ -2577,6 +4523,21 @@ var parser = new XMLParser({
|
|
|
2577
4523
|
maxTotalExpansions: Infinity
|
|
2578
4524
|
},
|
|
2579
4525
|
htmlEntities: true,
|
|
4526
|
+
entityDecoder: {
|
|
4527
|
+
setExternalEntities: (entities) => {
|
|
4528
|
+
entityDecoder.setExternalEntities(entities);
|
|
4529
|
+
},
|
|
4530
|
+
addInputEntities: (entities) => {
|
|
4531
|
+
entityDecoder.addInputEntities(entities);
|
|
4532
|
+
},
|
|
4533
|
+
reset: () => {
|
|
4534
|
+
entityDecoder.reset();
|
|
4535
|
+
},
|
|
4536
|
+
decode: (text) => {
|
|
4537
|
+
return entityDecoder.decode(text);
|
|
4538
|
+
},
|
|
4539
|
+
setXmlVersion: (version) => void {}
|
|
4540
|
+
},
|
|
2580
4541
|
ignoreAttributes: false,
|
|
2581
4542
|
ignoreDeclaration: true,
|
|
2582
4543
|
parseTagValue: false,
|
|
@@ -2584,13 +4545,11 @@ var parser = new XMLParser({
|
|
|
2584
4545
|
tagValueProcessor: (_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0,
|
|
2585
4546
|
maxNestedTags: Infinity
|
|
2586
4547
|
});
|
|
2587
|
-
parser.addEntity("#xD", "\r");
|
|
2588
|
-
parser.addEntity("#10", "\n");
|
|
2589
4548
|
function parseXML(xmlString) {
|
|
2590
4549
|
return parser.parse(xmlString, true);
|
|
2591
4550
|
}
|
|
2592
4551
|
|
|
2593
|
-
// ../node_modules/.bun/@aws-sdk+core@3.
|
|
4552
|
+
// ../node_modules/.bun/@aws-sdk+core@3.974.8/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js
|
|
2594
4553
|
var XmlShapeDeserializer = class extends SerdeContextConfig {
|
|
2595
4554
|
settings;
|
|
2596
4555
|
stringDeserializer;
|
|
@@ -2647,8 +4606,8 @@ var XmlShapeDeserializer = class extends SerdeContextConfig {
|
|
|
2647
4606
|
return buffer2;
|
|
2648
4607
|
}
|
|
2649
4608
|
const sourceArray = Array.isArray(source) ? source : [source];
|
|
2650
|
-
for (const
|
|
2651
|
-
buffer2.push(this.readSchema(listValue,
|
|
4609
|
+
for (const v of sourceArray) {
|
|
4610
|
+
buffer2.push(this.readSchema(listValue, v));
|
|
2652
4611
|
}
|
|
2653
4612
|
return buffer2;
|
|
2654
4613
|
}
|
|
@@ -2731,7 +4690,7 @@ var XmlShapeDeserializer = class extends SerdeContextConfig {
|
|
|
2731
4690
|
}
|
|
2732
4691
|
};
|
|
2733
4692
|
|
|
2734
|
-
// ../node_modules/.bun/@aws-sdk+core@3.
|
|
4693
|
+
// ../node_modules/.bun/@aws-sdk+core@3.974.8/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js
|
|
2735
4694
|
var QueryShapeSerializer = class extends SerdeContextConfig {
|
|
2736
4695
|
settings;
|
|
2737
4696
|
buffer;
|
|
@@ -2828,8 +4787,9 @@ var QueryShapeSerializer = class extends SerdeContextConfig {
|
|
|
2828
4787
|
const memberSchema = ns.getValueSchema();
|
|
2829
4788
|
const flat = ns.getMergedTraits().xmlFlattened;
|
|
2830
4789
|
let i2 = 1;
|
|
2831
|
-
for (const
|
|
2832
|
-
|
|
4790
|
+
for (const k2 in value) {
|
|
4791
|
+
const v = value[k2];
|
|
4792
|
+
if (v == null) {
|
|
2833
4793
|
continue;
|
|
2834
4794
|
}
|
|
2835
4795
|
const keyTraits = keySchema.getMergedTraits();
|
|
@@ -2839,7 +4799,7 @@ var QueryShapeSerializer = class extends SerdeContextConfig {
|
|
|
2839
4799
|
const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName);
|
|
2840
4800
|
const valueKey = flat ? `${prefix}${i2}.${valueSuffix}` : `${prefix}entry.${i2}.${valueSuffix}`;
|
|
2841
4801
|
this.write(keySchema, k2, key);
|
|
2842
|
-
this.write(memberSchema,
|
|
4802
|
+
this.write(memberSchema, v, valueKey);
|
|
2843
4803
|
++i2;
|
|
2844
4804
|
}
|
|
2845
4805
|
}
|
|
@@ -2859,9 +4819,9 @@ var QueryShapeSerializer = class extends SerdeContextConfig {
|
|
|
2859
4819
|
if (!didWriteMember && ns.isUnionSchema()) {
|
|
2860
4820
|
const { $unknown } = value;
|
|
2861
4821
|
if (Array.isArray($unknown)) {
|
|
2862
|
-
const [k2,
|
|
4822
|
+
const [k2, v] = $unknown;
|
|
2863
4823
|
const key = `${prefix}${k2}`;
|
|
2864
|
-
this.write(15,
|
|
4824
|
+
this.write(15, v, key);
|
|
2865
4825
|
}
|
|
2866
4826
|
}
|
|
2867
4827
|
}
|
|
@@ -2900,7 +4860,7 @@ var QueryShapeSerializer = class extends SerdeContextConfig {
|
|
|
2900
4860
|
}
|
|
2901
4861
|
};
|
|
2902
4862
|
|
|
2903
|
-
// ../node_modules/.bun/@aws-sdk+core@3.
|
|
4863
|
+
// ../node_modules/.bun/@aws-sdk+core@3.974.8/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js
|
|
2904
4864
|
var AwsQueryProtocol = class extends RpcProtocol {
|
|
2905
4865
|
options;
|
|
2906
4866
|
serializer;
|
|
@@ -2940,9 +4900,7 @@ var AwsQueryProtocol = class extends RpcProtocol {
|
|
|
2940
4900
|
if (!request.path.endsWith("/")) {
|
|
2941
4901
|
request.path += "/";
|
|
2942
4902
|
}
|
|
2943
|
-
|
|
2944
|
-
"content-type": `application/x-www-form-urlencoded`
|
|
2945
|
-
});
|
|
4903
|
+
request.headers["content-type"] = "application/x-www-form-urlencoded";
|
|
2946
4904
|
if (deref(operationSchema.input) === "unit" || !request.body) {
|
|
2947
4905
|
request.body = "";
|
|
2948
4906
|
}
|
|
@@ -2975,11 +4933,8 @@ var AwsQueryProtocol = class extends RpcProtocol {
|
|
|
2975
4933
|
if (bytes.byteLength > 0) {
|
|
2976
4934
|
Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));
|
|
2977
4935
|
}
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
...dataObject
|
|
2981
|
-
};
|
|
2982
|
-
return output;
|
|
4936
|
+
dataObject.$metadata = this.deserializeMetadata(response);
|
|
4937
|
+
return dataObject;
|
|
2983
4938
|
}
|
|
2984
4939
|
useNestedResult() {
|
|
2985
4940
|
return true;
|
|
@@ -3035,198 +4990,422 @@ var AwsQueryProtocol = class extends RpcProtocol {
|
|
|
3035
4990
|
}
|
|
3036
4991
|
};
|
|
3037
4992
|
|
|
3038
|
-
// ../node_modules/.bun/@aws-sdk+
|
|
3039
|
-
var
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
var
|
|
4993
|
+
// ../node_modules/.bun/@aws-sdk+signature-v4-multi-region@3.996.25/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js
|
|
4994
|
+
var signatureV4CrtContainer = {
|
|
4995
|
+
CrtSignerV4: null
|
|
4996
|
+
};
|
|
4997
|
+
|
|
4998
|
+
// ../node_modules/.bun/@aws-sdk+signature-v4-multi-region@3.996.25/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js
|
|
4999
|
+
var SignatureV4MultiRegion = class {
|
|
5000
|
+
sigv4aSigner;
|
|
5001
|
+
sigv4Signer;
|
|
5002
|
+
signerOptions;
|
|
5003
|
+
static sigv4aDependency() {
|
|
5004
|
+
if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") {
|
|
5005
|
+
return "crt";
|
|
5006
|
+
} else if (typeof signatureV4aContainer.SignatureV4a === "function") {
|
|
5007
|
+
return "js";
|
|
5008
|
+
}
|
|
5009
|
+
return "none";
|
|
5010
|
+
}
|
|
5011
|
+
constructor(options) {
|
|
5012
|
+
this.sigv4Signer = new SignatureV4S3Express(options);
|
|
5013
|
+
this.signerOptions = options;
|
|
5014
|
+
}
|
|
5015
|
+
async sign(requestToSign, options = {}) {
|
|
5016
|
+
if (options.signingRegion === "*") {
|
|
5017
|
+
return this.getSigv4aSigner().sign(requestToSign, options);
|
|
5018
|
+
}
|
|
5019
|
+
return this.sigv4Signer.sign(requestToSign, options);
|
|
5020
|
+
}
|
|
5021
|
+
async signWithCredentials(requestToSign, credentials, options = {}) {
|
|
5022
|
+
if (options.signingRegion === "*") {
|
|
5023
|
+
const signer = this.getSigv4aSigner();
|
|
5024
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
5025
|
+
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
5026
|
+
return signer.signWithCredentials(requestToSign, credentials, options);
|
|
5027
|
+
} else {
|
|
5028
|
+
throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
|
|
5029
|
+
}
|
|
5030
|
+
}
|
|
5031
|
+
return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
|
|
5032
|
+
}
|
|
5033
|
+
async presign(originalRequest, options = {}) {
|
|
5034
|
+
if (options.signingRegion === "*") {
|
|
5035
|
+
const signer = this.getSigv4aSigner();
|
|
5036
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
5037
|
+
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
5038
|
+
return signer.presign(originalRequest, options);
|
|
5039
|
+
} else {
|
|
5040
|
+
throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
|
|
5041
|
+
}
|
|
5042
|
+
}
|
|
5043
|
+
return this.sigv4Signer.presign(originalRequest, options);
|
|
5044
|
+
}
|
|
5045
|
+
async presignWithCredentials(originalRequest, credentials, options = {}) {
|
|
5046
|
+
if (options.signingRegion === "*") {
|
|
5047
|
+
throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
|
|
5048
|
+
}
|
|
5049
|
+
return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
|
|
5050
|
+
}
|
|
5051
|
+
getSigv4aSigner() {
|
|
5052
|
+
if (!this.sigv4aSigner) {
|
|
5053
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
5054
|
+
const JsSigV4aSigner = signatureV4aContainer.SignatureV4a;
|
|
5055
|
+
if (this.signerOptions.runtime === "node") {
|
|
5056
|
+
if (!CrtSignerV4 && !JsSigV4aSigner) {
|
|
5057
|
+
throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
|
|
5058
|
+
}
|
|
5059
|
+
if (CrtSignerV4 && typeof CrtSignerV4 === "function") {
|
|
5060
|
+
this.sigv4aSigner = new CrtSignerV4({
|
|
5061
|
+
...this.signerOptions,
|
|
5062
|
+
signingAlgorithm: 1
|
|
5063
|
+
});
|
|
5064
|
+
} else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") {
|
|
5065
|
+
this.sigv4aSigner = new JsSigV4aSigner({
|
|
5066
|
+
...this.signerOptions
|
|
5067
|
+
});
|
|
5068
|
+
} else {
|
|
5069
|
+
throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
|
|
5070
|
+
}
|
|
5071
|
+
} else {
|
|
5072
|
+
if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") {
|
|
5073
|
+
throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");
|
|
5074
|
+
}
|
|
5075
|
+
this.sigv4aSigner = new JsSigV4aSigner({
|
|
5076
|
+
...this.signerOptions
|
|
5077
|
+
});
|
|
5078
|
+
}
|
|
5079
|
+
}
|
|
5080
|
+
return this.sigv4aSigner;
|
|
5081
|
+
}
|
|
5082
|
+
};
|
|
5083
|
+
|
|
5084
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js
|
|
5085
|
+
var q = "ref";
|
|
5086
|
+
var a = -1;
|
|
3045
5087
|
var b = true;
|
|
3046
|
-
var c = "
|
|
3047
|
-
var d = "
|
|
3048
|
-
var e = "
|
|
3049
|
-
var f = "
|
|
3050
|
-
var g = "
|
|
3051
|
-
var h = "
|
|
3052
|
-
var i = "
|
|
3053
|
-
var j = "
|
|
3054
|
-
var k = "
|
|
3055
|
-
var l = "
|
|
3056
|
-
var m = { [
|
|
3057
|
-
var n = { [
|
|
3058
|
-
var o = {
|
|
3059
|
-
var p =
|
|
3060
|
-
var q = { [J]: "Region" };
|
|
3061
|
-
var r = { [H]: "aws.partition", [I]: [q], assign: "PartitionResult" };
|
|
3062
|
-
var s = { [J]: "UseFIPS" };
|
|
3063
|
-
var t = { [J]: "UseDualStack" };
|
|
3064
|
-
var u = {
|
|
3065
|
-
url: "https://sts.amazonaws.com",
|
|
3066
|
-
properties: { authSchemes: [{ name: e, signingName: f, signingRegion: g }] },
|
|
3067
|
-
headers: {}
|
|
3068
|
-
};
|
|
3069
|
-
var v = {};
|
|
3070
|
-
var w = { conditions: [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h };
|
|
3071
|
-
var x = { [H]: c, [I]: [s, true] };
|
|
3072
|
-
var y = { [H]: c, [I]: [t, true] };
|
|
3073
|
-
var z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] };
|
|
3074
|
-
var A = { [J]: "PartitionResult" };
|
|
3075
|
-
var B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] };
|
|
3076
|
-
var C = [{ [H]: "isSet", [I]: [o] }];
|
|
3077
|
-
var D = [x];
|
|
3078
|
-
var E = [y];
|
|
5088
|
+
var c = "isSet";
|
|
5089
|
+
var d = "PartitionResult";
|
|
5090
|
+
var e = "booleanEquals";
|
|
5091
|
+
var f = "stringEquals";
|
|
5092
|
+
var g = "getAttr";
|
|
5093
|
+
var h = "us-east-1";
|
|
5094
|
+
var i = "sigv4";
|
|
5095
|
+
var j = "sts";
|
|
5096
|
+
var k = "https://sts.{Region}.{PartitionResult#dnsSuffix}";
|
|
5097
|
+
var l = { [q]: "Endpoint" };
|
|
5098
|
+
var m = { [q]: "Region" };
|
|
5099
|
+
var n = { [q]: d };
|
|
5100
|
+
var o = {};
|
|
5101
|
+
var p = [m];
|
|
3079
5102
|
var _data = {
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
},
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k },
|
|
3124
|
-
{ conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k },
|
|
3125
|
-
{ endpoint: { url: o, properties: v, headers: v }, [G]: h }
|
|
3126
|
-
],
|
|
3127
|
-
[G]: j
|
|
3128
|
-
},
|
|
3129
|
-
{
|
|
3130
|
-
conditions: [p],
|
|
3131
|
-
rules: [
|
|
3132
|
-
{
|
|
3133
|
-
conditions: [r],
|
|
3134
|
-
rules: [
|
|
3135
|
-
{
|
|
3136
|
-
conditions: [x, y],
|
|
3137
|
-
rules: [
|
|
3138
|
-
{
|
|
3139
|
-
conditions: [{ [H]: c, [I]: [b, z] }, B],
|
|
3140
|
-
rules: [
|
|
3141
|
-
{
|
|
3142
|
-
endpoint: {
|
|
3143
|
-
url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
3144
|
-
properties: v,
|
|
3145
|
-
headers: v
|
|
3146
|
-
},
|
|
3147
|
-
[G]: h
|
|
3148
|
-
}
|
|
3149
|
-
],
|
|
3150
|
-
[G]: j
|
|
3151
|
-
},
|
|
3152
|
-
{ error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }
|
|
3153
|
-
],
|
|
3154
|
-
[G]: j
|
|
3155
|
-
},
|
|
3156
|
-
{
|
|
3157
|
-
conditions: D,
|
|
3158
|
-
rules: [
|
|
3159
|
-
{
|
|
3160
|
-
conditions: [{ [H]: c, [I]: [z, b] }],
|
|
3161
|
-
rules: [
|
|
3162
|
-
{
|
|
3163
|
-
conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }],
|
|
3164
|
-
endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v },
|
|
3165
|
-
[G]: h
|
|
3166
|
-
},
|
|
3167
|
-
{
|
|
3168
|
-
endpoint: {
|
|
3169
|
-
url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",
|
|
3170
|
-
properties: v,
|
|
3171
|
-
headers: v
|
|
3172
|
-
},
|
|
3173
|
-
[G]: h
|
|
3174
|
-
}
|
|
3175
|
-
],
|
|
3176
|
-
[G]: j
|
|
3177
|
-
},
|
|
3178
|
-
{ error: "FIPS is enabled but this partition does not support FIPS", [G]: k }
|
|
3179
|
-
],
|
|
3180
|
-
[G]: j
|
|
3181
|
-
},
|
|
3182
|
-
{
|
|
3183
|
-
conditions: E,
|
|
3184
|
-
rules: [
|
|
3185
|
-
{
|
|
3186
|
-
conditions: [B],
|
|
3187
|
-
rules: [
|
|
3188
|
-
{
|
|
3189
|
-
endpoint: {
|
|
3190
|
-
url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
3191
|
-
properties: v,
|
|
3192
|
-
headers: v
|
|
3193
|
-
},
|
|
3194
|
-
[G]: h
|
|
3195
|
-
}
|
|
3196
|
-
],
|
|
3197
|
-
[G]: j
|
|
3198
|
-
},
|
|
3199
|
-
{ error: "DualStack is enabled but this partition does not support DualStack", [G]: k }
|
|
3200
|
-
],
|
|
3201
|
-
[G]: j
|
|
3202
|
-
},
|
|
3203
|
-
w,
|
|
3204
|
-
{ endpoint: { url: i, properties: v, headers: v }, [G]: h }
|
|
3205
|
-
],
|
|
3206
|
-
[G]: j
|
|
3207
|
-
}
|
|
3208
|
-
],
|
|
3209
|
-
[G]: j
|
|
3210
|
-
},
|
|
3211
|
-
{ error: "Invalid Configuration: Missing Region", [G]: k }
|
|
5103
|
+
conditions: [
|
|
5104
|
+
[c, [l]],
|
|
5105
|
+
[c, p],
|
|
5106
|
+
["aws.partition", p, d],
|
|
5107
|
+
[e, [{ [q]: "UseFIPS" }, b]],
|
|
5108
|
+
[e, [{ [q]: "UseDualStack" }, b]],
|
|
5109
|
+
[f, [m, "aws-global"]],
|
|
5110
|
+
[e, [{ [q]: "UseGlobalEndpoint" }, b]],
|
|
5111
|
+
[f, [m, "eu-central-1"]],
|
|
5112
|
+
[e, [{ fn: g, argv: [n, "supportsDualStack"] }, b]],
|
|
5113
|
+
[e, [{ fn: g, argv: [n, "supportsFIPS"] }, b]],
|
|
5114
|
+
[f, [m, "ap-south-1"]],
|
|
5115
|
+
[f, [m, "eu-north-1"]],
|
|
5116
|
+
[f, [m, "eu-west-1"]],
|
|
5117
|
+
[f, [m, "eu-west-2"]],
|
|
5118
|
+
[f, [m, "eu-west-3"]],
|
|
5119
|
+
[f, [m, "sa-east-1"]],
|
|
5120
|
+
[f, [m, h]],
|
|
5121
|
+
[f, [m, "us-east-2"]],
|
|
5122
|
+
[f, [m, "us-west-2"]],
|
|
5123
|
+
[f, [m, "us-west-1"]],
|
|
5124
|
+
[f, [m, "ca-central-1"]],
|
|
5125
|
+
[f, [m, "ap-southeast-1"]],
|
|
5126
|
+
[f, [m, "ap-northeast-1"]],
|
|
5127
|
+
[f, [m, "ap-southeast-2"]],
|
|
5128
|
+
[f, [{ fn: g, argv: [n, "name"] }, "aws-us-gov"]]
|
|
5129
|
+
],
|
|
5130
|
+
results: [
|
|
5131
|
+
[a],
|
|
5132
|
+
["https://sts.amazonaws.com", { authSchemes: [{ name: i, signingName: j, signingRegion: h }] }],
|
|
5133
|
+
[k, { authSchemes: [{ name: i, signingName: j, signingRegion: "{Region}" }] }],
|
|
5134
|
+
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
5135
|
+
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
|
5136
|
+
[l, o],
|
|
5137
|
+
["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
|
|
5138
|
+
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
|
5139
|
+
["https://sts.{Region}.amazonaws.com", o],
|
|
5140
|
+
["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o],
|
|
5141
|
+
[a, "FIPS is enabled but this partition does not support FIPS"],
|
|
5142
|
+
["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
|
|
5143
|
+
[a, "DualStack is enabled but this partition does not support DualStack"],
|
|
5144
|
+
[k, o],
|
|
5145
|
+
[a, "Invalid Configuration: Missing Region"]
|
|
3212
5146
|
]
|
|
3213
5147
|
};
|
|
3214
|
-
var
|
|
5148
|
+
var root = 2;
|
|
5149
|
+
var r = 1e8;
|
|
5150
|
+
var nodes = new Int32Array([
|
|
5151
|
+
-1,
|
|
5152
|
+
1,
|
|
5153
|
+
-1,
|
|
5154
|
+
0,
|
|
5155
|
+
30,
|
|
5156
|
+
3,
|
|
5157
|
+
1,
|
|
5158
|
+
4,
|
|
5159
|
+
r + 14,
|
|
5160
|
+
2,
|
|
5161
|
+
5,
|
|
5162
|
+
r + 14,
|
|
5163
|
+
3,
|
|
5164
|
+
25,
|
|
5165
|
+
6,
|
|
5166
|
+
4,
|
|
5167
|
+
24,
|
|
5168
|
+
7,
|
|
5169
|
+
5,
|
|
5170
|
+
r + 1,
|
|
5171
|
+
8,
|
|
5172
|
+
6,
|
|
5173
|
+
9,
|
|
5174
|
+
r + 13,
|
|
5175
|
+
7,
|
|
5176
|
+
r + 1,
|
|
5177
|
+
10,
|
|
5178
|
+
10,
|
|
5179
|
+
r + 1,
|
|
5180
|
+
11,
|
|
5181
|
+
11,
|
|
5182
|
+
r + 1,
|
|
5183
|
+
12,
|
|
5184
|
+
12,
|
|
5185
|
+
r + 1,
|
|
5186
|
+
13,
|
|
5187
|
+
13,
|
|
5188
|
+
r + 1,
|
|
5189
|
+
14,
|
|
5190
|
+
14,
|
|
5191
|
+
r + 1,
|
|
5192
|
+
15,
|
|
5193
|
+
15,
|
|
5194
|
+
r + 1,
|
|
5195
|
+
16,
|
|
5196
|
+
16,
|
|
5197
|
+
r + 1,
|
|
5198
|
+
17,
|
|
5199
|
+
17,
|
|
5200
|
+
r + 1,
|
|
5201
|
+
18,
|
|
5202
|
+
18,
|
|
5203
|
+
r + 1,
|
|
5204
|
+
19,
|
|
5205
|
+
19,
|
|
5206
|
+
r + 1,
|
|
5207
|
+
20,
|
|
5208
|
+
20,
|
|
5209
|
+
r + 1,
|
|
5210
|
+
21,
|
|
5211
|
+
21,
|
|
5212
|
+
r + 1,
|
|
5213
|
+
22,
|
|
5214
|
+
22,
|
|
5215
|
+
r + 1,
|
|
5216
|
+
23,
|
|
5217
|
+
23,
|
|
5218
|
+
r + 1,
|
|
5219
|
+
r + 2,
|
|
5220
|
+
8,
|
|
5221
|
+
r + 11,
|
|
5222
|
+
r + 12,
|
|
5223
|
+
4,
|
|
5224
|
+
28,
|
|
5225
|
+
26,
|
|
5226
|
+
9,
|
|
5227
|
+
27,
|
|
5228
|
+
r + 10,
|
|
5229
|
+
24,
|
|
5230
|
+
r + 8,
|
|
5231
|
+
r + 9,
|
|
5232
|
+
8,
|
|
5233
|
+
29,
|
|
5234
|
+
r + 7,
|
|
5235
|
+
9,
|
|
5236
|
+
r + 6,
|
|
5237
|
+
r + 7,
|
|
5238
|
+
3,
|
|
5239
|
+
r + 3,
|
|
5240
|
+
31,
|
|
5241
|
+
4,
|
|
5242
|
+
r + 4,
|
|
5243
|
+
r + 5
|
|
5244
|
+
]);
|
|
5245
|
+
var bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
3215
5246
|
|
|
3216
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5247
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js
|
|
3217
5248
|
var cache = new EndpointCache({
|
|
3218
5249
|
size: 50,
|
|
3219
5250
|
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"]
|
|
3220
5251
|
});
|
|
3221
5252
|
var defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
3222
|
-
return cache.get(endpointParams, () =>
|
|
5253
|
+
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
3223
5254
|
endpointParams,
|
|
3224
5255
|
logger: context.logger
|
|
3225
5256
|
}));
|
|
3226
5257
|
};
|
|
3227
5258
|
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
3228
5259
|
|
|
3229
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5260
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js
|
|
5261
|
+
var createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
|
|
5262
|
+
if (!input) {
|
|
5263
|
+
throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
|
|
5264
|
+
}
|
|
5265
|
+
const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
|
|
5266
|
+
const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor?.getEndpointParameterInstructions;
|
|
5267
|
+
if (!instructionsFn) {
|
|
5268
|
+
throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
|
|
5269
|
+
}
|
|
5270
|
+
const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
|
|
5271
|
+
return Object.assign(defaultParameters, endpointParameters);
|
|
5272
|
+
};
|
|
5273
|
+
var _defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
5274
|
+
return {
|
|
5275
|
+
operation: getSmithyContext(context).operation,
|
|
5276
|
+
region: await normalizeProvider(config.region)() || (() => {
|
|
5277
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
5278
|
+
})()
|
|
5279
|
+
};
|
|
5280
|
+
};
|
|
5281
|
+
var defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider);
|
|
5282
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
5283
|
+
return {
|
|
5284
|
+
schemeId: "aws.auth#sigv4",
|
|
5285
|
+
signingProperties: {
|
|
5286
|
+
name: "sts",
|
|
5287
|
+
region: authParameters.region
|
|
5288
|
+
},
|
|
5289
|
+
propertiesExtractor: (config, context) => ({
|
|
5290
|
+
signingProperties: {
|
|
5291
|
+
config,
|
|
5292
|
+
context
|
|
5293
|
+
}
|
|
5294
|
+
})
|
|
5295
|
+
};
|
|
5296
|
+
}
|
|
5297
|
+
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
|
|
5298
|
+
return {
|
|
5299
|
+
schemeId: "aws.auth#sigv4a",
|
|
5300
|
+
signingProperties: {
|
|
5301
|
+
name: "sts",
|
|
5302
|
+
region: authParameters.region
|
|
5303
|
+
},
|
|
5304
|
+
propertiesExtractor: (config, context) => ({
|
|
5305
|
+
signingProperties: {
|
|
5306
|
+
config,
|
|
5307
|
+
context
|
|
5308
|
+
}
|
|
5309
|
+
})
|
|
5310
|
+
};
|
|
5311
|
+
}
|
|
5312
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
5313
|
+
return {
|
|
5314
|
+
schemeId: "smithy.api#noAuth"
|
|
5315
|
+
};
|
|
5316
|
+
}
|
|
5317
|
+
var createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver2, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
|
|
5318
|
+
const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
|
|
5319
|
+
const endpoint = defaultEndpointResolver2(authParameters);
|
|
5320
|
+
const authSchemes = endpoint.properties?.authSchemes;
|
|
5321
|
+
if (!authSchemes) {
|
|
5322
|
+
return defaultHttpAuthSchemeResolver(authParameters);
|
|
5323
|
+
}
|
|
5324
|
+
const options = [];
|
|
5325
|
+
for (const scheme of authSchemes) {
|
|
5326
|
+
const { name: resolvedName, properties = {}, ...rest } = scheme;
|
|
5327
|
+
const name = resolvedName.toLowerCase();
|
|
5328
|
+
if (resolvedName !== name) {
|
|
5329
|
+
console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
|
|
5330
|
+
}
|
|
5331
|
+
let schemeId;
|
|
5332
|
+
if (name === "sigv4a") {
|
|
5333
|
+
schemeId = "aws.auth#sigv4a";
|
|
5334
|
+
const sigv4Present = authSchemes.find((s) => {
|
|
5335
|
+
const name2 = s.name.toLowerCase();
|
|
5336
|
+
return name2 !== "sigv4a" && name2.startsWith("sigv4");
|
|
5337
|
+
});
|
|
5338
|
+
if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
|
|
5339
|
+
continue;
|
|
5340
|
+
}
|
|
5341
|
+
} else if (name.startsWith("sigv4")) {
|
|
5342
|
+
schemeId = "aws.auth#sigv4";
|
|
5343
|
+
} else {
|
|
5344
|
+
throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
|
|
5345
|
+
}
|
|
5346
|
+
const createOption = createHttpAuthOptionFunctions[schemeId];
|
|
5347
|
+
if (!createOption) {
|
|
5348
|
+
throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
|
|
5349
|
+
}
|
|
5350
|
+
const option = createOption(authParameters);
|
|
5351
|
+
option.schemeId = schemeId;
|
|
5352
|
+
option.signingProperties = { ...option.signingProperties || {}, ...rest, ...properties };
|
|
5353
|
+
options.push(option);
|
|
5354
|
+
}
|
|
5355
|
+
return options;
|
|
5356
|
+
};
|
|
5357
|
+
return endpointRuleSetHttpAuthSchemeProvider;
|
|
5358
|
+
};
|
|
5359
|
+
var _defaultSTSHttpAuthSchemeProvider = (authParameters) => {
|
|
5360
|
+
const options = [];
|
|
5361
|
+
switch (authParameters.operation) {
|
|
5362
|
+
case "AssumeRoleWithWebIdentity": {
|
|
5363
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
5364
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
5365
|
+
break;
|
|
5366
|
+
}
|
|
5367
|
+
default: {
|
|
5368
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
5369
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
5370
|
+
}
|
|
5371
|
+
}
|
|
5372
|
+
return options;
|
|
5373
|
+
};
|
|
5374
|
+
var defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider, {
|
|
5375
|
+
"aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
|
|
5376
|
+
"aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
|
|
5377
|
+
"smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption
|
|
5378
|
+
});
|
|
5379
|
+
var resolveStsAuthConfig = (input) => Object.assign(input, {
|
|
5380
|
+
stsClientCtor: STSClient
|
|
5381
|
+
});
|
|
5382
|
+
var resolveHttpAuthSchemeConfig = (config) => {
|
|
5383
|
+
const config_0 = resolveStsAuthConfig(config);
|
|
5384
|
+
const config_1 = resolveAwsSdkSigV4Config(config_0);
|
|
5385
|
+
const config_2 = resolveAwsSdkSigV4AConfig(config_1);
|
|
5386
|
+
return Object.assign(config_2, {
|
|
5387
|
+
authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
|
|
5388
|
+
});
|
|
5389
|
+
};
|
|
5390
|
+
|
|
5391
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js
|
|
5392
|
+
var resolveClientEndpointParameters = (options) => {
|
|
5393
|
+
return Object.assign(options, {
|
|
5394
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
5395
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
5396
|
+
useGlobalEndpoint: options.useGlobalEndpoint ?? false,
|
|
5397
|
+
defaultSigningName: "sts"
|
|
5398
|
+
});
|
|
5399
|
+
};
|
|
5400
|
+
var commonParams = {
|
|
5401
|
+
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
|
|
5402
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
5403
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
5404
|
+
Region: { type: "builtInParams", name: "region" },
|
|
5405
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
|
|
5406
|
+
};
|
|
5407
|
+
|
|
5408
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js
|
|
3230
5409
|
var STSServiceException = class _STSServiceException extends ServiceException {
|
|
3231
5410
|
constructor(options) {
|
|
3232
5411
|
super(options);
|
|
@@ -3234,7 +5413,7 @@ var STSServiceException = class _STSServiceException extends ServiceException {
|
|
|
3234
5413
|
}
|
|
3235
5414
|
};
|
|
3236
5415
|
|
|
3237
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5416
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js
|
|
3238
5417
|
var ExpiredTokenException = class _ExpiredTokenException extends STSServiceException {
|
|
3239
5418
|
name = "ExpiredTokenException";
|
|
3240
5419
|
$fault = "client";
|
|
@@ -3310,6 +5489,7 @@ var InvalidIdentityTokenException = class _InvalidIdentityTokenException extends
|
|
|
3310
5489
|
var IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException {
|
|
3311
5490
|
name = "IDPCommunicationErrorException";
|
|
3312
5491
|
$fault = "client";
|
|
5492
|
+
$retryable = {};
|
|
3313
5493
|
constructor(opts) {
|
|
3314
5494
|
super({
|
|
3315
5495
|
name: "IDPCommunicationErrorException",
|
|
@@ -3320,7 +5500,7 @@ var IDPCommunicationErrorException = class _IDPCommunicationErrorException exten
|
|
|
3320
5500
|
}
|
|
3321
5501
|
};
|
|
3322
5502
|
|
|
3323
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5503
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js
|
|
3324
5504
|
var _A = "Arn";
|
|
3325
5505
|
var _AKI = "AccessKeyId";
|
|
3326
5506
|
var _AR = "AssumeRole";
|
|
@@ -3511,7 +5691,7 @@ var AssumeRoleWithWebIdentity$ = [
|
|
|
3511
5691
|
() => AssumeRoleWithWebIdentityResponse$
|
|
3512
5692
|
];
|
|
3513
5693
|
|
|
3514
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5694
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js
|
|
3515
5695
|
var getRuntimeConfig = (config) => {
|
|
3516
5696
|
return {
|
|
3517
5697
|
apiVersion: "2011-06-15",
|
|
@@ -3527,6 +5707,11 @@ var getRuntimeConfig = (config) => {
|
|
|
3527
5707
|
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
3528
5708
|
signer: new AwsSdkSigV4Signer()
|
|
3529
5709
|
},
|
|
5710
|
+
{
|
|
5711
|
+
schemeId: "aws.auth#sigv4a",
|
|
5712
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
5713
|
+
signer: new AwsSdkSigV4ASigner()
|
|
5714
|
+
},
|
|
3530
5715
|
{
|
|
3531
5716
|
schemeId: "smithy.api#noAuth",
|
|
3532
5717
|
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
@@ -3543,13 +5728,14 @@ var getRuntimeConfig = (config) => {
|
|
|
3543
5728
|
serviceTarget: "AWSSecurityTokenServiceV20110615"
|
|
3544
5729
|
},
|
|
3545
5730
|
serviceId: config?.serviceId ?? "STS",
|
|
5731
|
+
signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
|
|
3546
5732
|
urlParser: config?.urlParser ?? parseUrl,
|
|
3547
5733
|
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
3548
5734
|
utf8Encoder: config?.utf8Encoder ?? toUtf8
|
|
3549
5735
|
};
|
|
3550
5736
|
};
|
|
3551
5737
|
|
|
3552
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5738
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js
|
|
3553
5739
|
var getRuntimeConfig2 = (config) => {
|
|
3554
5740
|
emitWarningIfUnsupportedVersion2(process.version);
|
|
3555
5741
|
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
@@ -3574,6 +5760,11 @@ var getRuntimeConfig2 = (config) => {
|
|
|
3574
5760
|
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()),
|
|
3575
5761
|
signer: new AwsSdkSigV4Signer()
|
|
3576
5762
|
},
|
|
5763
|
+
{
|
|
5764
|
+
schemeId: "aws.auth#sigv4a",
|
|
5765
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
5766
|
+
signer: new AwsSdkSigV4ASigner()
|
|
5767
|
+
},
|
|
3577
5768
|
{
|
|
3578
5769
|
schemeId: "smithy.api#noAuth",
|
|
3579
5770
|
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
@@ -3588,6 +5779,7 @@ var getRuntimeConfig2 = (config) => {
|
|
|
3588
5779
|
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE
|
|
3589
5780
|
}, config),
|
|
3590
5781
|
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
5782
|
+
sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
|
|
3591
5783
|
streamCollector: config?.streamCollector ?? streamCollector,
|
|
3592
5784
|
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
3593
5785
|
useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
@@ -3595,7 +5787,7 @@ var getRuntimeConfig2 = (config) => {
|
|
|
3595
5787
|
};
|
|
3596
5788
|
};
|
|
3597
5789
|
|
|
3598
|
-
// ../node_modules/.bun/@aws-sdk+region-config-resolver@3.972.
|
|
5790
|
+
// ../node_modules/.bun/@aws-sdk+region-config-resolver@3.972.13/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.js
|
|
3599
5791
|
function stsRegionDefaultResolver(loaderConfig = {}) {
|
|
3600
5792
|
return loadConfig({
|
|
3601
5793
|
...NODE_REGION_CONFIG_OPTIONS,
|
|
@@ -3611,7 +5803,7 @@ var warning = {
|
|
|
3611
5803
|
silence: false
|
|
3612
5804
|
};
|
|
3613
5805
|
|
|
3614
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5806
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js
|
|
3615
5807
|
var getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
3616
5808
|
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
3617
5809
|
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
@@ -3650,14 +5842,14 @@ var resolveHttpAuthRuntimeConfig = (config) => {
|
|
|
3650
5842
|
};
|
|
3651
5843
|
};
|
|
3652
5844
|
|
|
3653
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5845
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js
|
|
3654
5846
|
var resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
3655
5847
|
const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
3656
5848
|
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
3657
5849
|
return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
3658
5850
|
};
|
|
3659
5851
|
|
|
3660
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5852
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js
|
|
3661
5853
|
var STSClient = class extends Client {
|
|
3662
5854
|
config;
|
|
3663
5855
|
constructor(...[configuration]) {
|
|
@@ -3683,7 +5875,8 @@ var STSClient = class extends Client {
|
|
|
3683
5875
|
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
3684
5876
|
httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider,
|
|
3685
5877
|
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
3686
|
-
"aws.auth#sigv4": config.credentials
|
|
5878
|
+
"aws.auth#sigv4": config.credentials,
|
|
5879
|
+
"aws.auth#sigv4a": config.credentials
|
|
3687
5880
|
})
|
|
3688
5881
|
}));
|
|
3689
5882
|
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
@@ -3693,19 +5886,19 @@ var STSClient = class extends Client {
|
|
|
3693
5886
|
}
|
|
3694
5887
|
};
|
|
3695
5888
|
|
|
3696
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5889
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js
|
|
3697
5890
|
var AssumeRoleCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
|
|
3698
5891
|
return [getEndpointPlugin(config, Command2.getEndpointParameterInstructions())];
|
|
3699
5892
|
}).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole$).build() {
|
|
3700
5893
|
};
|
|
3701
5894
|
|
|
3702
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5895
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js
|
|
3703
5896
|
var AssumeRoleWithWebIdentityCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
|
|
3704
5897
|
return [getEndpointPlugin(config, Command2.getEndpointParameterInstructions())];
|
|
3705
5898
|
}).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity$).build() {
|
|
3706
5899
|
};
|
|
3707
5900
|
|
|
3708
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5901
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js
|
|
3709
5902
|
var commands = {
|
|
3710
5903
|
AssumeRoleCommand,
|
|
3711
5904
|
AssumeRoleWithWebIdentityCommand
|
|
@@ -3714,7 +5907,7 @@ var STS = class extends STSClient {
|
|
|
3714
5907
|
};
|
|
3715
5908
|
createAggregatedClient(commands, STS);
|
|
3716
5909
|
|
|
3717
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
5910
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js
|
|
3718
5911
|
var getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {
|
|
3719
5912
|
if (typeof assumedRoleUser?.Arn === "string") {
|
|
3720
5913
|
const arnComponents = assumedRoleUser.Arn.split(":");
|
|
@@ -3814,7 +6007,7 @@ var isH2 = (requestHandler) => {
|
|
|
3814
6007
|
return requestHandler?.metadata?.handlerProtocol === "h2";
|
|
3815
6008
|
};
|
|
3816
6009
|
|
|
3817
|
-
// ../node_modules/.bun/@aws-sdk+nested-clients@3.
|
|
6010
|
+
// ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js
|
|
3818
6011
|
var getCustomizableStsClientCtor = (baseCtor, customizations) => {
|
|
3819
6012
|
if (!customizations)
|
|
3820
6013
|
return baseCtor;
|