@typespec/html-program-viewer 0.59.0-dev.0 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emitter/index.js +1 -1
- package/dist/manifest-BApuudHS.js +6 -0
- package/dist/react/index.js +770 -1384
- package/package.json +17 -17
- package/dist/manifest-Bx5EZvxu.js +0 -6
package/dist/react/index.js
CHANGED
|
@@ -18196,6 +18196,12 @@ const diagnostics = {
|
|
|
18196
18196
|
default: paramMessage `Path "${"path"}" cannot be relative. Use {cwd} or {project-root} to specify what the path should be relative to.`,
|
|
18197
18197
|
},
|
|
18198
18198
|
},
|
|
18199
|
+
"path-unix-style": {
|
|
18200
|
+
severity: "warning",
|
|
18201
|
+
messages: {
|
|
18202
|
+
default: paramMessage `Path should use unix style separators. Use "/" instead of "\\".`,
|
|
18203
|
+
},
|
|
18204
|
+
},
|
|
18199
18205
|
"config-path-not-found": {
|
|
18200
18206
|
severity: "error",
|
|
18201
18207
|
messages: {
|
|
@@ -18435,6 +18441,7 @@ const diagnostics = {
|
|
|
18435
18441
|
wrongType: paramMessage `Encoding '${"encoding"}' cannot be used on type '${"type"}'. Expected: ${"expected"}.`,
|
|
18436
18442
|
wrongEncodingType: paramMessage `Encoding '${"encoding"}' on type '${"type"}' is expected to be serialized as '${"expected"}' but got '${"actual"}'.`,
|
|
18437
18443
|
wrongNumericEncodingType: paramMessage `Encoding '${"encoding"}' on type '${"type"}' is expected to be serialized as '${"expected"}' but got '${"actual"}'. Set '@encode' 2nd parameter to be of type ${"expected"}. e.g. '@encode("${"encoding"}", int32)'`,
|
|
18444
|
+
firstArg: `First argument of "@encode" must be the encoding name or the string type when encoding numeric types.`,
|
|
18438
18445
|
},
|
|
18439
18446
|
},
|
|
18440
18447
|
"invalid-mime-type": {
|
|
@@ -18698,6 +18705,7 @@ var code$1 = {};
|
|
|
18698
18705
|
(function (exports) {
|
|
18699
18706
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18700
18707
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
18708
|
+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
18701
18709
|
class _CodeOrName {
|
|
18702
18710
|
}
|
|
18703
18711
|
exports._CodeOrName = _CodeOrName;
|
|
@@ -20706,7 +20714,7 @@ function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, composi
|
|
|
20706
20714
|
}
|
|
20707
20715
|
subschema.extendSubschemaMode = extendSubschemaMode;
|
|
20708
20716
|
|
|
20709
|
-
var resolve$
|
|
20717
|
+
var resolve$2 = {};
|
|
20710
20718
|
|
|
20711
20719
|
// do not edit .js files directly - edit src/index.jst
|
|
20712
20720
|
|
|
@@ -20849,10 +20857,10 @@ function escapeJsonPtr(str) {
|
|
|
20849
20857
|
|
|
20850
20858
|
var jsonSchemaTraverseExports = jsonSchemaTraverse.exports;
|
|
20851
20859
|
|
|
20852
|
-
Object.defineProperty(resolve$
|
|
20853
|
-
resolve$
|
|
20860
|
+
Object.defineProperty(resolve$2, "__esModule", { value: true });
|
|
20861
|
+
resolve$2.getSchemaRefs = resolve$2.resolveUrl = resolve$2.normalizeId = resolve$2._getFullPath = resolve$2.getFullPath = resolve$2.inlineRef = void 0;
|
|
20854
20862
|
const util_1$m = util;
|
|
20855
|
-
const equal$
|
|
20863
|
+
const equal$3 = fastDeepEqual;
|
|
20856
20864
|
const traverse = jsonSchemaTraverseExports;
|
|
20857
20865
|
// TODO refactor to use keyword definitions
|
|
20858
20866
|
const SIMPLE_INLINED = new Set([
|
|
@@ -20882,7 +20890,7 @@ function inlineRef(schema, limit = true) {
|
|
|
20882
20890
|
return false;
|
|
20883
20891
|
return countKeys(schema) <= limit;
|
|
20884
20892
|
}
|
|
20885
|
-
resolve$
|
|
20893
|
+
resolve$2.inlineRef = inlineRef;
|
|
20886
20894
|
const REF_KEYWORDS = new Set([
|
|
20887
20895
|
"$ref",
|
|
20888
20896
|
"$recursiveRef",
|
|
@@ -20924,22 +20932,22 @@ function getFullPath(resolver, id = "", normalize) {
|
|
|
20924
20932
|
const p = resolver.parse(id);
|
|
20925
20933
|
return _getFullPath(resolver, p);
|
|
20926
20934
|
}
|
|
20927
|
-
resolve$
|
|
20935
|
+
resolve$2.getFullPath = getFullPath;
|
|
20928
20936
|
function _getFullPath(resolver, p) {
|
|
20929
20937
|
const serialized = resolver.serialize(p);
|
|
20930
20938
|
return serialized.split("#")[0] + "#";
|
|
20931
20939
|
}
|
|
20932
|
-
resolve$
|
|
20940
|
+
resolve$2._getFullPath = _getFullPath;
|
|
20933
20941
|
const TRAILING_SLASH_HASH = /#\/?$/;
|
|
20934
20942
|
function normalizeId(id) {
|
|
20935
20943
|
return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
|
|
20936
20944
|
}
|
|
20937
|
-
resolve$
|
|
20945
|
+
resolve$2.normalizeId = normalizeId;
|
|
20938
20946
|
function resolveUrl(resolver, baseId, id) {
|
|
20939
20947
|
id = normalizeId(id);
|
|
20940
20948
|
return resolver.resolve(baseId, id);
|
|
20941
20949
|
}
|
|
20942
|
-
resolve$
|
|
20950
|
+
resolve$2.resolveUrl = resolveUrl;
|
|
20943
20951
|
const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
20944
20952
|
function getSchemaRefs(schema, baseId) {
|
|
20945
20953
|
if (typeof schema == "boolean")
|
|
@@ -20994,14 +21002,14 @@ function getSchemaRefs(schema, baseId) {
|
|
|
20994
21002
|
});
|
|
20995
21003
|
return localRefs;
|
|
20996
21004
|
function checkAmbiguosRef(sch1, sch2, ref) {
|
|
20997
|
-
if (sch2 !== undefined && !equal$
|
|
21005
|
+
if (sch2 !== undefined && !equal$3(sch1, sch2))
|
|
20998
21006
|
throw ambiguos(ref);
|
|
20999
21007
|
}
|
|
21000
21008
|
function ambiguos(ref) {
|
|
21001
21009
|
return new Error(`reference "${ref}" resolves to more than one schema`);
|
|
21002
21010
|
}
|
|
21003
21011
|
}
|
|
21004
|
-
resolve$
|
|
21012
|
+
resolve$2.getSchemaRefs = getSchemaRefs;
|
|
21005
21013
|
|
|
21006
21014
|
Object.defineProperty(validate, "__esModule", { value: true });
|
|
21007
21015
|
validate.getData = validate.KeywordCxt = validate.validateFunctionCode = void 0;
|
|
@@ -21014,7 +21022,7 @@ const keyword_1 = keyword;
|
|
|
21014
21022
|
const subschema_1 = subschema;
|
|
21015
21023
|
const codegen_1$n = codegen;
|
|
21016
21024
|
const names_1$3 = names$1;
|
|
21017
|
-
const resolve_1$2 = resolve$
|
|
21025
|
+
const resolve_1$2 = resolve$2;
|
|
21018
21026
|
const util_1$l = util;
|
|
21019
21027
|
const errors_1 = errors;
|
|
21020
21028
|
// schema compilation - generates validation function, subschemaCode (below) is used for subschemas
|
|
@@ -21536,7 +21544,7 @@ validation_error.default = ValidationError;
|
|
|
21536
21544
|
var ref_error = {};
|
|
21537
21545
|
|
|
21538
21546
|
Object.defineProperty(ref_error, "__esModule", { value: true });
|
|
21539
|
-
const resolve_1$1 = resolve$
|
|
21547
|
+
const resolve_1$1 = resolve$2;
|
|
21540
21548
|
class MissingRefError extends Error {
|
|
21541
21549
|
constructor(resolver, baseId, ref, msg) {
|
|
21542
21550
|
super(msg || `can't resolve reference ${ref} from id ${baseId}`);
|
|
@@ -21553,7 +21561,7 @@ compile.resolveSchema = compile.getCompilingSchema = compile.resolveRef = compil
|
|
|
21553
21561
|
const codegen_1$m = codegen;
|
|
21554
21562
|
const validation_error_1 = validation_error;
|
|
21555
21563
|
const names_1$2 = names$1;
|
|
21556
|
-
const resolve_1 = resolve$
|
|
21564
|
+
const resolve_1 = resolve$2;
|
|
21557
21565
|
const util_1$k = util;
|
|
21558
21566
|
const validate_1$1 = validate;
|
|
21559
21567
|
class SchemaEnv {
|
|
@@ -21679,7 +21687,7 @@ function resolveRef(root, baseId, ref) {
|
|
|
21679
21687
|
const schOrFunc = root.refs[ref];
|
|
21680
21688
|
if (schOrFunc)
|
|
21681
21689
|
return schOrFunc;
|
|
21682
|
-
let _sch = resolve.call(this, root, ref);
|
|
21690
|
+
let _sch = resolve$1.call(this, root, ref);
|
|
21683
21691
|
if (_sch === undefined) {
|
|
21684
21692
|
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv
|
|
21685
21693
|
const { schemaId } = this.opts;
|
|
@@ -21709,7 +21717,7 @@ function sameSchemaEnv(s1, s2) {
|
|
|
21709
21717
|
}
|
|
21710
21718
|
// resolve and compile the references ($ref)
|
|
21711
21719
|
// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
|
|
21712
|
-
function resolve(root, // information about the root schema for the current schema
|
|
21720
|
+
function resolve$1(root, // information about the root schema for the current schema
|
|
21713
21721
|
ref // reference to resolve
|
|
21714
21722
|
) {
|
|
21715
21723
|
let sch;
|
|
@@ -21820,1418 +21828,776 @@ const require$$9 = {
|
|
|
21820
21828
|
|
|
21821
21829
|
var uri$1 = {};
|
|
21822
21830
|
|
|
21823
|
-
var
|
|
21824
|
-
|
|
21825
|
-
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
|
|
21834
|
-
|
|
21835
|
-
|
|
21836
|
-
|
|
21837
|
-
|
|
21838
|
-
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
return "(?:" + str + ")";
|
|
21850
|
-
}
|
|
21851
|
-
function typeOf(o) {
|
|
21852
|
-
return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
|
|
21853
|
-
}
|
|
21854
|
-
function toUpperCase(str) {
|
|
21855
|
-
return str.toUpperCase();
|
|
21856
|
-
}
|
|
21857
|
-
function toArray(obj) {
|
|
21858
|
-
return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
|
|
21859
|
-
}
|
|
21860
|
-
function assign(target, source) {
|
|
21861
|
-
var obj = target;
|
|
21862
|
-
if (source) {
|
|
21863
|
-
for (var key in source) {
|
|
21864
|
-
obj[key] = source[key];
|
|
21865
|
-
}
|
|
21866
|
-
}
|
|
21867
|
-
return obj;
|
|
21868
|
-
}
|
|
21869
|
-
|
|
21870
|
-
function buildExps(isIRI) {
|
|
21871
|
-
var ALPHA$$ = "[A-Za-z]",
|
|
21872
|
-
DIGIT$$ = "[0-9]",
|
|
21873
|
-
HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
|
|
21874
|
-
PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
|
|
21875
|
-
//expanded
|
|
21876
|
-
GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
|
|
21877
|
-
SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
|
|
21878
|
-
RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
|
|
21879
|
-
UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
|
|
21880
|
-
//subset, excludes bidi control characters
|
|
21881
|
-
IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
|
|
21882
|
-
//subset
|
|
21883
|
-
UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$);
|
|
21884
|
-
subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*");
|
|
21885
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*");
|
|
21886
|
-
var DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$),
|
|
21887
|
-
//relaxed parsing rules
|
|
21888
|
-
IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
|
|
21889
|
-
H16$ = subexp(HEXDIG$$ + "{1,4}"),
|
|
21890
|
-
LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
|
|
21891
|
-
IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
|
|
21892
|
-
// 6( h16 ":" ) ls32
|
|
21893
|
-
IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
|
|
21894
|
-
// "::" 5( h16 ":" ) ls32
|
|
21895
|
-
IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
|
|
21896
|
-
//[ h16 ] "::" 4( h16 ":" ) ls32
|
|
21897
|
-
IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
|
|
21898
|
-
//[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
|
21899
|
-
IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
|
|
21900
|
-
//[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
|
21901
|
-
IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
|
|
21902
|
-
//[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
|
21903
|
-
IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
|
|
21904
|
-
//[ *4( h16 ":" ) h16 ] "::" ls32
|
|
21905
|
-
IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
|
|
21906
|
-
//[ *5( h16 ":" ) h16 ] "::" h16
|
|
21907
|
-
IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
|
|
21908
|
-
//[ *6( h16 ":" ) h16 ] "::"
|
|
21909
|
-
IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
|
|
21910
|
-
ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+");
|
|
21911
|
-
//RFC 6874, with relaxed parsing rules
|
|
21912
|
-
subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+");
|
|
21913
|
-
//RFC 6874
|
|
21914
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*");
|
|
21915
|
-
var PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]"));
|
|
21916
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+");
|
|
21917
|
-
subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
|
|
21918
|
-
return {
|
|
21919
|
-
NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
|
|
21920
|
-
NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
21921
|
-
NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
21922
|
-
NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
21923
|
-
NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
21924
|
-
NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
|
|
21925
|
-
NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
|
|
21926
|
-
ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
21927
|
-
UNRESERVED: new RegExp(UNRESERVED$$, "g"),
|
|
21928
|
-
OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
|
|
21929
|
-
PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
|
|
21930
|
-
IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
|
|
21931
|
-
IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
|
|
21932
|
-
};
|
|
21933
|
-
}
|
|
21934
|
-
var URI_PROTOCOL = buildExps(false);
|
|
21935
|
-
|
|
21936
|
-
var IRI_PROTOCOL = buildExps(true);
|
|
21937
|
-
|
|
21938
|
-
var slicedToArray = function () {
|
|
21939
|
-
function sliceIterator(arr, i) {
|
|
21940
|
-
var _arr = [];
|
|
21941
|
-
var _n = true;
|
|
21942
|
-
var _d = false;
|
|
21943
|
-
var _e = undefined;
|
|
21944
|
-
|
|
21945
|
-
try {
|
|
21946
|
-
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
21947
|
-
_arr.push(_s.value);
|
|
21948
|
-
|
|
21949
|
-
if (i && _arr.length === i) break;
|
|
21950
|
-
}
|
|
21951
|
-
} catch (err) {
|
|
21952
|
-
_d = true;
|
|
21953
|
-
_e = err;
|
|
21954
|
-
} finally {
|
|
21955
|
-
try {
|
|
21956
|
-
if (!_n && _i["return"]) _i["return"]();
|
|
21957
|
-
} finally {
|
|
21958
|
-
if (_d) throw _e;
|
|
21959
|
-
}
|
|
21960
|
-
}
|
|
21961
|
-
|
|
21962
|
-
return _arr;
|
|
21963
|
-
}
|
|
21964
|
-
|
|
21965
|
-
return function (arr, i) {
|
|
21966
|
-
if (Array.isArray(arr)) {
|
|
21967
|
-
return arr;
|
|
21968
|
-
} else if (Symbol.iterator in Object(arr)) {
|
|
21969
|
-
return sliceIterator(arr, i);
|
|
21970
|
-
} else {
|
|
21971
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
21972
|
-
}
|
|
21973
|
-
};
|
|
21974
|
-
}();
|
|
21975
|
-
|
|
21831
|
+
var fastUri$1 = {exports: {}};
|
|
21832
|
+
|
|
21833
|
+
const HEX$1 = {
|
|
21834
|
+
0: 0,
|
|
21835
|
+
1: 1,
|
|
21836
|
+
2: 2,
|
|
21837
|
+
3: 3,
|
|
21838
|
+
4: 4,
|
|
21839
|
+
5: 5,
|
|
21840
|
+
6: 6,
|
|
21841
|
+
7: 7,
|
|
21842
|
+
8: 8,
|
|
21843
|
+
9: 9,
|
|
21844
|
+
a: 10,
|
|
21845
|
+
A: 10,
|
|
21846
|
+
b: 11,
|
|
21847
|
+
B: 11,
|
|
21848
|
+
c: 12,
|
|
21849
|
+
C: 12,
|
|
21850
|
+
d: 13,
|
|
21851
|
+
D: 13,
|
|
21852
|
+
e: 14,
|
|
21853
|
+
E: 14,
|
|
21854
|
+
f: 15,
|
|
21855
|
+
F: 15
|
|
21856
|
+
};
|
|
21976
21857
|
|
|
21858
|
+
var scopedChars = {
|
|
21859
|
+
HEX: HEX$1
|
|
21860
|
+
};
|
|
21977
21861
|
|
|
21862
|
+
const { HEX } = scopedChars;
|
|
21978
21863
|
|
|
21864
|
+
function normalizeIPv4$1 (host) {
|
|
21865
|
+
if (findToken(host, '.') < 3) { return { host, isIPV4: false } }
|
|
21866
|
+
const matches = host.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u) || [];
|
|
21867
|
+
const [address] = matches;
|
|
21868
|
+
if (address) {
|
|
21869
|
+
return { host: stripLeadingZeros(address, '.'), isIPV4: true }
|
|
21870
|
+
} else {
|
|
21871
|
+
return { host, isIPV4: false }
|
|
21872
|
+
}
|
|
21873
|
+
}
|
|
21979
21874
|
|
|
21875
|
+
/**
|
|
21876
|
+
* @param {string[]} input
|
|
21877
|
+
* @param {boolean} [keepZero=false]
|
|
21878
|
+
* @returns {string|undefined}
|
|
21879
|
+
*/
|
|
21880
|
+
function stringArrayToHexStripped (input, keepZero = false) {
|
|
21881
|
+
let acc = '';
|
|
21882
|
+
let strip = true;
|
|
21883
|
+
for (const c of input) {
|
|
21884
|
+
if (HEX[c] === undefined) return undefined
|
|
21885
|
+
if (c !== '0' && strip === true) strip = false;
|
|
21886
|
+
if (!strip) acc += c;
|
|
21887
|
+
}
|
|
21888
|
+
if (keepZero && acc.length === 0) acc = '0';
|
|
21889
|
+
return acc
|
|
21890
|
+
}
|
|
21891
|
+
|
|
21892
|
+
function getIPV6 (input) {
|
|
21893
|
+
let tokenCount = 0;
|
|
21894
|
+
const output = { error: false, address: '', zone: '' };
|
|
21895
|
+
const address = [];
|
|
21896
|
+
const buffer = [];
|
|
21897
|
+
let isZone = false;
|
|
21898
|
+
let endipv6Encountered = false;
|
|
21899
|
+
let endIpv6 = false;
|
|
21900
|
+
|
|
21901
|
+
function consume () {
|
|
21902
|
+
if (buffer.length) {
|
|
21903
|
+
if (isZone === false) {
|
|
21904
|
+
const hex = stringArrayToHexStripped(buffer);
|
|
21905
|
+
if (hex !== undefined) {
|
|
21906
|
+
address.push(hex);
|
|
21907
|
+
} else {
|
|
21908
|
+
output.error = true;
|
|
21909
|
+
return false
|
|
21910
|
+
}
|
|
21911
|
+
}
|
|
21912
|
+
buffer.length = 0;
|
|
21913
|
+
}
|
|
21914
|
+
return true
|
|
21915
|
+
}
|
|
21980
21916
|
|
|
21917
|
+
for (let i = 0; i < input.length; i++) {
|
|
21918
|
+
const cursor = input[i];
|
|
21919
|
+
if (cursor === '[' || cursor === ']') { continue }
|
|
21920
|
+
if (cursor === ':') {
|
|
21921
|
+
if (endipv6Encountered === true) {
|
|
21922
|
+
endIpv6 = true;
|
|
21923
|
+
}
|
|
21924
|
+
if (!consume()) { break }
|
|
21925
|
+
tokenCount++;
|
|
21926
|
+
address.push(':');
|
|
21927
|
+
if (tokenCount > 7) {
|
|
21928
|
+
// not valid
|
|
21929
|
+
output.error = true;
|
|
21930
|
+
break
|
|
21931
|
+
}
|
|
21932
|
+
if (i - 1 >= 0 && input[i - 1] === ':') {
|
|
21933
|
+
endipv6Encountered = true;
|
|
21934
|
+
}
|
|
21935
|
+
continue
|
|
21936
|
+
} else if (cursor === '%') {
|
|
21937
|
+
if (!consume()) { break }
|
|
21938
|
+
// switch to zone detection
|
|
21939
|
+
isZone = true;
|
|
21940
|
+
} else {
|
|
21941
|
+
buffer.push(cursor);
|
|
21942
|
+
continue
|
|
21943
|
+
}
|
|
21944
|
+
}
|
|
21945
|
+
if (buffer.length) {
|
|
21946
|
+
if (isZone) {
|
|
21947
|
+
output.zone = buffer.join('');
|
|
21948
|
+
} else if (endIpv6) {
|
|
21949
|
+
address.push(buffer.join(''));
|
|
21950
|
+
} else {
|
|
21951
|
+
address.push(stringArrayToHexStripped(buffer));
|
|
21952
|
+
}
|
|
21953
|
+
}
|
|
21954
|
+
output.address = address.join('');
|
|
21955
|
+
return output
|
|
21956
|
+
}
|
|
21981
21957
|
|
|
21958
|
+
function normalizeIPv6$1 (host, opts = {}) {
|
|
21959
|
+
if (findToken(host, ':') < 2) { return { host, isIPV6: false } }
|
|
21960
|
+
const ipv6 = getIPV6(host);
|
|
21982
21961
|
|
|
21962
|
+
if (!ipv6.error) {
|
|
21963
|
+
let newHost = ipv6.address;
|
|
21964
|
+
let escapedHost = ipv6.address;
|
|
21965
|
+
if (ipv6.zone) {
|
|
21966
|
+
newHost += '%' + ipv6.zone;
|
|
21967
|
+
escapedHost += '%25' + ipv6.zone;
|
|
21968
|
+
}
|
|
21969
|
+
return { host: newHost, escapedHost, isIPV6: true }
|
|
21970
|
+
} else {
|
|
21971
|
+
return { host, isIPV6: false }
|
|
21972
|
+
}
|
|
21973
|
+
}
|
|
21983
21974
|
|
|
21975
|
+
function stripLeadingZeros (str, token) {
|
|
21976
|
+
let out = '';
|
|
21977
|
+
let skip = true;
|
|
21978
|
+
const l = str.length;
|
|
21979
|
+
for (let i = 0; i < l; i++) {
|
|
21980
|
+
const c = str[i];
|
|
21981
|
+
if (c === '0' && skip) {
|
|
21982
|
+
if ((i + 1 <= l && str[i + 1] === token) || i + 1 === l) {
|
|
21983
|
+
out += c;
|
|
21984
|
+
skip = false;
|
|
21985
|
+
}
|
|
21986
|
+
} else {
|
|
21987
|
+
if (c === token) {
|
|
21988
|
+
skip = true;
|
|
21989
|
+
} else {
|
|
21990
|
+
skip = false;
|
|
21991
|
+
}
|
|
21992
|
+
out += c;
|
|
21993
|
+
}
|
|
21994
|
+
}
|
|
21995
|
+
return out
|
|
21996
|
+
}
|
|
21984
21997
|
|
|
21998
|
+
function findToken (str, token) {
|
|
21999
|
+
let ind = 0;
|
|
22000
|
+
for (let i = 0; i < str.length; i++) {
|
|
22001
|
+
if (str[i] === token) ind++;
|
|
22002
|
+
}
|
|
22003
|
+
return ind
|
|
22004
|
+
}
|
|
22005
|
+
|
|
22006
|
+
const RDS1 = /^\.\.?\//u;
|
|
22007
|
+
const RDS2 = /^\/\.(?:\/|$)/u;
|
|
22008
|
+
const RDS3 = /^\/\.\.(?:\/|$)/u;
|
|
22009
|
+
const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u;
|
|
22010
|
+
|
|
22011
|
+
function removeDotSegments$1 (input) {
|
|
22012
|
+
const output = [];
|
|
22013
|
+
|
|
22014
|
+
while (input.length) {
|
|
22015
|
+
if (input.match(RDS1)) {
|
|
22016
|
+
input = input.replace(RDS1, '');
|
|
22017
|
+
} else if (input.match(RDS2)) {
|
|
22018
|
+
input = input.replace(RDS2, '/');
|
|
22019
|
+
} else if (input.match(RDS3)) {
|
|
22020
|
+
input = input.replace(RDS3, '/');
|
|
22021
|
+
output.pop();
|
|
22022
|
+
} else if (input === '.' || input === '..') {
|
|
22023
|
+
input = '';
|
|
22024
|
+
} else {
|
|
22025
|
+
const im = input.match(RDS5);
|
|
22026
|
+
if (im) {
|
|
22027
|
+
const s = im[0];
|
|
22028
|
+
input = input.slice(s.length);
|
|
22029
|
+
output.push(s);
|
|
22030
|
+
} else {
|
|
22031
|
+
throw new Error('Unexpected dot segment condition')
|
|
22032
|
+
}
|
|
22033
|
+
}
|
|
22034
|
+
}
|
|
22035
|
+
return output.join('')
|
|
22036
|
+
}
|
|
21985
22037
|
|
|
22038
|
+
function normalizeComponentEncoding$1 (components, esc) {
|
|
22039
|
+
const func = esc !== true ? escape : unescape;
|
|
22040
|
+
if (components.scheme !== undefined) {
|
|
22041
|
+
components.scheme = func(components.scheme);
|
|
22042
|
+
}
|
|
22043
|
+
if (components.userinfo !== undefined) {
|
|
22044
|
+
components.userinfo = func(components.userinfo);
|
|
22045
|
+
}
|
|
22046
|
+
if (components.host !== undefined) {
|
|
22047
|
+
components.host = func(components.host);
|
|
22048
|
+
}
|
|
22049
|
+
if (components.path !== undefined) {
|
|
22050
|
+
components.path = func(components.path);
|
|
22051
|
+
}
|
|
22052
|
+
if (components.query !== undefined) {
|
|
22053
|
+
components.query = func(components.query);
|
|
22054
|
+
}
|
|
22055
|
+
if (components.fragment !== undefined) {
|
|
22056
|
+
components.fragment = func(components.fragment);
|
|
22057
|
+
}
|
|
22058
|
+
return components
|
|
22059
|
+
}
|
|
21986
22060
|
|
|
22061
|
+
function recomposeAuthority$1 (components, options) {
|
|
22062
|
+
const uriTokens = [];
|
|
21987
22063
|
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
22064
|
+
if (components.userinfo !== undefined) {
|
|
22065
|
+
uriTokens.push(components.userinfo);
|
|
22066
|
+
uriTokens.push('@');
|
|
22067
|
+
}
|
|
21991
22068
|
|
|
21992
|
-
|
|
21993
|
-
|
|
21994
|
-
|
|
21995
|
-
}
|
|
21996
|
-
};
|
|
22069
|
+
if (components.host !== undefined) {
|
|
22070
|
+
let host = unescape(components.host);
|
|
22071
|
+
const ipV4res = normalizeIPv4$1(host);
|
|
21997
22072
|
|
|
21998
|
-
|
|
21999
|
-
|
|
22000
|
-
|
|
22001
|
-
|
|
22002
|
-
|
|
22003
|
-
|
|
22004
|
-
|
|
22005
|
-
|
|
22006
|
-
|
|
22007
|
-
|
|
22008
|
-
|
|
22009
|
-
|
|
22010
|
-
var delimiter = '-'; // '\x2D'
|
|
22011
|
-
|
|
22012
|
-
/** Regular expressions */
|
|
22013
|
-
var regexPunycode = /^xn--/;
|
|
22014
|
-
var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
|
|
22015
|
-
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
|
|
22016
|
-
|
|
22017
|
-
/** Error messages */
|
|
22018
|
-
var errors = {
|
|
22019
|
-
'overflow': 'Overflow: input needs wider integers to process',
|
|
22020
|
-
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
|
22021
|
-
'invalid-input': 'Invalid input'
|
|
22022
|
-
};
|
|
22073
|
+
if (ipV4res.isIPV4) {
|
|
22074
|
+
host = ipV4res.host;
|
|
22075
|
+
} else {
|
|
22076
|
+
const ipV6res = normalizeIPv6$1(ipV4res.host, { isIPV4: false });
|
|
22077
|
+
if (ipV6res.isIPV6 === true) {
|
|
22078
|
+
host = `[${ipV6res.escapedHost}]`;
|
|
22079
|
+
} else {
|
|
22080
|
+
host = components.host;
|
|
22081
|
+
}
|
|
22082
|
+
}
|
|
22083
|
+
uriTokens.push(host);
|
|
22084
|
+
}
|
|
22023
22085
|
|
|
22024
|
-
|
|
22025
|
-
|
|
22026
|
-
|
|
22027
|
-
|
|
22086
|
+
if (typeof components.port === 'number' || typeof components.port === 'string') {
|
|
22087
|
+
uriTokens.push(':');
|
|
22088
|
+
uriTokens.push(String(components.port));
|
|
22089
|
+
}
|
|
22028
22090
|
|
|
22029
|
-
|
|
22091
|
+
return uriTokens.length ? uriTokens.join('') : undefined
|
|
22092
|
+
}
|
|
22093
|
+
var utils$1 = {
|
|
22094
|
+
recomposeAuthority: recomposeAuthority$1,
|
|
22095
|
+
normalizeComponentEncoding: normalizeComponentEncoding$1,
|
|
22096
|
+
removeDotSegments: removeDotSegments$1,
|
|
22097
|
+
normalizeIPv4: normalizeIPv4$1,
|
|
22098
|
+
normalizeIPv6: normalizeIPv6$1,
|
|
22099
|
+
stringArrayToHexStripped
|
|
22100
|
+
};
|
|
22030
22101
|
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
* @private
|
|
22034
|
-
* @param {String} type The error type.
|
|
22035
|
-
* @returns {Error} Throws a `RangeError` with the applicable error message.
|
|
22036
|
-
*/
|
|
22037
|
-
function error$1(type) {
|
|
22038
|
-
throw new RangeError(errors[type]);
|
|
22039
|
-
}
|
|
22102
|
+
const UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu;
|
|
22103
|
+
const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
22040
22104
|
|
|
22041
|
-
|
|
22042
|
-
|
|
22043
|
-
|
|
22044
|
-
* @param {Array} array The array to iterate over.
|
|
22045
|
-
* @param {Function} callback The function that gets called for every array
|
|
22046
|
-
* item.
|
|
22047
|
-
* @returns {Array} A new array of values returned by the callback function.
|
|
22048
|
-
*/
|
|
22049
|
-
function map(array, fn) {
|
|
22050
|
-
var result = [];
|
|
22051
|
-
var length = array.length;
|
|
22052
|
-
while (length--) {
|
|
22053
|
-
result[length] = fn(array[length]);
|
|
22054
|
-
}
|
|
22055
|
-
return result;
|
|
22056
|
-
}
|
|
22105
|
+
function isSecure (wsComponents) {
|
|
22106
|
+
return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === 'wss'
|
|
22107
|
+
}
|
|
22057
22108
|
|
|
22058
|
-
|
|
22059
|
-
|
|
22060
|
-
|
|
22061
|
-
|
|
22062
|
-
* @param {String} domain The domain name or email address.
|
|
22063
|
-
* @param {Function} callback The function that gets called for every
|
|
22064
|
-
* character.
|
|
22065
|
-
* @returns {Array} A new string of characters returned by the callback
|
|
22066
|
-
* function.
|
|
22067
|
-
*/
|
|
22068
|
-
function mapDomain(string, fn) {
|
|
22069
|
-
var parts = string.split('@');
|
|
22070
|
-
var result = '';
|
|
22071
|
-
if (parts.length > 1) {
|
|
22072
|
-
// In email addresses, only the domain name should be punycoded. Leave
|
|
22073
|
-
// the local part (i.e. everything up to `@`) intact.
|
|
22074
|
-
result = parts[0] + '@';
|
|
22075
|
-
string = parts[1];
|
|
22076
|
-
}
|
|
22077
|
-
// Avoid `split(regex)` for IE8 compatibility. See #17.
|
|
22078
|
-
string = string.replace(regexSeparators, '\x2E');
|
|
22079
|
-
var labels = string.split('.');
|
|
22080
|
-
var encoded = map(labels, fn).join('.');
|
|
22081
|
-
return result + encoded;
|
|
22082
|
-
}
|
|
22109
|
+
function httpParse (components) {
|
|
22110
|
+
if (!components.host) {
|
|
22111
|
+
components.error = components.error || 'HTTP URIs must have a host.';
|
|
22112
|
+
}
|
|
22083
22113
|
|
|
22084
|
-
|
|
22085
|
-
|
|
22086
|
-
* character in the string. While JavaScript uses UCS-2 internally,
|
|
22087
|
-
* this function will convert a pair of surrogate halves (each of which
|
|
22088
|
-
* UCS-2 exposes as separate characters) into a single code point,
|
|
22089
|
-
* matching UTF-16.
|
|
22090
|
-
* @see `punycode.ucs2.encode`
|
|
22091
|
-
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
22092
|
-
* @memberOf punycode.ucs2
|
|
22093
|
-
* @name decode
|
|
22094
|
-
* @param {String} string The Unicode input string (UCS-2).
|
|
22095
|
-
* @returns {Array} The new array of code points.
|
|
22096
|
-
*/
|
|
22097
|
-
function ucs2decode(string) {
|
|
22098
|
-
var output = [];
|
|
22099
|
-
var counter = 0;
|
|
22100
|
-
var length = string.length;
|
|
22101
|
-
while (counter < length) {
|
|
22102
|
-
var value = string.charCodeAt(counter++);
|
|
22103
|
-
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
|
22104
|
-
// It's a high surrogate, and there is a next character.
|
|
22105
|
-
var extra = string.charCodeAt(counter++);
|
|
22106
|
-
if ((extra & 0xFC00) == 0xDC00) {
|
|
22107
|
-
// Low surrogate.
|
|
22108
|
-
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
|
22109
|
-
} else {
|
|
22110
|
-
// It's an unmatched surrogate; only append this code unit, in case the
|
|
22111
|
-
// next code unit is the high surrogate of a surrogate pair.
|
|
22112
|
-
output.push(value);
|
|
22113
|
-
counter--;
|
|
22114
|
-
}
|
|
22115
|
-
} else {
|
|
22116
|
-
output.push(value);
|
|
22117
|
-
}
|
|
22118
|
-
}
|
|
22119
|
-
return output;
|
|
22120
|
-
}
|
|
22114
|
+
return components
|
|
22115
|
+
}
|
|
22121
22116
|
|
|
22122
|
-
|
|
22123
|
-
|
|
22124
|
-
* @see `punycode.ucs2.decode`
|
|
22125
|
-
* @memberOf punycode.ucs2
|
|
22126
|
-
* @name encode
|
|
22127
|
-
* @param {Array} codePoints The array of numeric code points.
|
|
22128
|
-
* @returns {String} The new Unicode string (UCS-2).
|
|
22129
|
-
*/
|
|
22130
|
-
var ucs2encode = function ucs2encode(array) {
|
|
22131
|
-
return String.fromCodePoint.apply(String, toConsumableArray(array));
|
|
22132
|
-
};
|
|
22117
|
+
function httpSerialize (components) {
|
|
22118
|
+
const secure = String(components.scheme).toLowerCase() === 'https';
|
|
22133
22119
|
|
|
22134
|
-
|
|
22135
|
-
|
|
22136
|
-
|
|
22137
|
-
|
|
22138
|
-
* @param {Number} codePoint The basic numeric code point value.
|
|
22139
|
-
* @returns {Number} The numeric value of a basic code point (for use in
|
|
22140
|
-
* representing integers) in the range `0` to `base - 1`, or `base` if
|
|
22141
|
-
* the code point does not represent a value.
|
|
22142
|
-
*/
|
|
22143
|
-
var basicToDigit = function basicToDigit(codePoint) {
|
|
22144
|
-
if (codePoint - 0x30 < 0x0A) {
|
|
22145
|
-
return codePoint - 0x16;
|
|
22146
|
-
}
|
|
22147
|
-
if (codePoint - 0x41 < 0x1A) {
|
|
22148
|
-
return codePoint - 0x41;
|
|
22149
|
-
}
|
|
22150
|
-
if (codePoint - 0x61 < 0x1A) {
|
|
22151
|
-
return codePoint - 0x61;
|
|
22152
|
-
}
|
|
22153
|
-
return base;
|
|
22154
|
-
};
|
|
22120
|
+
// normalize the default port
|
|
22121
|
+
if (components.port === (secure ? 443 : 80) || components.port === '') {
|
|
22122
|
+
components.port = undefined;
|
|
22123
|
+
}
|
|
22155
22124
|
|
|
22156
|
-
|
|
22157
|
-
|
|
22158
|
-
|
|
22159
|
-
|
|
22160
|
-
* @param {Number} digit The numeric value of a basic code point.
|
|
22161
|
-
* @returns {Number} The basic code point whose value (when used for
|
|
22162
|
-
* representing integers) is `digit`, which needs to be in the range
|
|
22163
|
-
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
|
|
22164
|
-
* used; else, the lowercase form is used. The behavior is undefined
|
|
22165
|
-
* if `flag` is non-zero and `digit` has no uppercase form.
|
|
22166
|
-
*/
|
|
22167
|
-
var digitToBasic = function digitToBasic(digit, flag) {
|
|
22168
|
-
// 0..25 map to ASCII a..z or A..Z
|
|
22169
|
-
// 26..35 map to ASCII 0..9
|
|
22170
|
-
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
|
22171
|
-
};
|
|
22125
|
+
// normalize the empty path
|
|
22126
|
+
if (!components.path) {
|
|
22127
|
+
components.path = '/';
|
|
22128
|
+
}
|
|
22172
22129
|
|
|
22173
|
-
|
|
22174
|
-
|
|
22175
|
-
|
|
22176
|
-
* @private
|
|
22177
|
-
*/
|
|
22178
|
-
var adapt = function adapt(delta, numPoints, firstTime) {
|
|
22179
|
-
var k = 0;
|
|
22180
|
-
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
22181
|
-
delta += floor(delta / numPoints);
|
|
22182
|
-
for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
|
|
22183
|
-
delta = floor(delta / baseMinusTMin);
|
|
22184
|
-
}
|
|
22185
|
-
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
|
22186
|
-
};
|
|
22130
|
+
// NOTE: We do not parse query strings for HTTP URIs
|
|
22131
|
+
// as WWW Form Url Encoded query strings are part of the HTML4+ spec,
|
|
22132
|
+
// and not the HTTP spec.
|
|
22187
22133
|
|
|
22188
|
-
|
|
22189
|
-
|
|
22190
|
-
* symbols.
|
|
22191
|
-
* @memberOf punycode
|
|
22192
|
-
* @param {String} input The Punycode string of ASCII-only symbols.
|
|
22193
|
-
* @returns {String} The resulting string of Unicode symbols.
|
|
22194
|
-
*/
|
|
22195
|
-
var decode = function decode(input) {
|
|
22196
|
-
// Don't use UCS-2.
|
|
22197
|
-
var output = [];
|
|
22198
|
-
var inputLength = input.length;
|
|
22199
|
-
var i = 0;
|
|
22200
|
-
var n = initialN;
|
|
22201
|
-
var bias = initialBias;
|
|
22202
|
-
|
|
22203
|
-
// Handle the basic code points: let `basic` be the number of input code
|
|
22204
|
-
// points before the last delimiter, or `0` if there is none, then copy
|
|
22205
|
-
// the first basic code points to the output.
|
|
22206
|
-
|
|
22207
|
-
var basic = input.lastIndexOf(delimiter);
|
|
22208
|
-
if (basic < 0) {
|
|
22209
|
-
basic = 0;
|
|
22210
|
-
}
|
|
22134
|
+
return components
|
|
22135
|
+
}
|
|
22211
22136
|
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
error$1('not-basic');
|
|
22216
|
-
}
|
|
22217
|
-
output.push(input.charCodeAt(j));
|
|
22218
|
-
}
|
|
22137
|
+
function wsParse (wsComponents) {
|
|
22138
|
+
// indicate if the secure flag is set
|
|
22139
|
+
wsComponents.secure = isSecure(wsComponents);
|
|
22219
22140
|
|
|
22220
|
-
|
|
22221
|
-
|
|
22141
|
+
// construct resouce name
|
|
22142
|
+
wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
|
|
22143
|
+
wsComponents.path = undefined;
|
|
22144
|
+
wsComponents.query = undefined;
|
|
22222
22145
|
|
|
22223
|
-
|
|
22146
|
+
return wsComponents
|
|
22147
|
+
}
|
|
22224
22148
|
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
var oldi = i;
|
|
22231
|
-
for (var w = 1, k = base;; /* no condition */k += base) {
|
|
22149
|
+
function wsSerialize (wsComponents) {
|
|
22150
|
+
// normalize the default port
|
|
22151
|
+
if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === '') {
|
|
22152
|
+
wsComponents.port = undefined;
|
|
22153
|
+
}
|
|
22232
22154
|
|
|
22233
|
-
|
|
22234
|
-
|
|
22235
|
-
|
|
22155
|
+
// ensure scheme matches secure flag
|
|
22156
|
+
if (typeof wsComponents.secure === 'boolean') {
|
|
22157
|
+
wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');
|
|
22158
|
+
wsComponents.secure = undefined;
|
|
22159
|
+
}
|
|
22236
22160
|
|
|
22237
|
-
|
|
22161
|
+
// reconstruct path from resource name
|
|
22162
|
+
if (wsComponents.resourceName) {
|
|
22163
|
+
const [path, query] = wsComponents.resourceName.split('?');
|
|
22164
|
+
wsComponents.path = (path && path !== '/' ? path : undefined);
|
|
22165
|
+
wsComponents.query = query;
|
|
22166
|
+
wsComponents.resourceName = undefined;
|
|
22167
|
+
}
|
|
22238
22168
|
|
|
22239
|
-
|
|
22240
|
-
|
|
22241
|
-
}
|
|
22169
|
+
// forbid fragment component
|
|
22170
|
+
wsComponents.fragment = undefined;
|
|
22242
22171
|
|
|
22243
|
-
|
|
22244
|
-
|
|
22172
|
+
return wsComponents
|
|
22173
|
+
}
|
|
22245
22174
|
|
|
22246
|
-
|
|
22247
|
-
|
|
22248
|
-
|
|
22175
|
+
function urnParse (urnComponents, options) {
|
|
22176
|
+
if (!urnComponents.path) {
|
|
22177
|
+
urnComponents.error = 'URN can not be parsed';
|
|
22178
|
+
return urnComponents
|
|
22179
|
+
}
|
|
22180
|
+
const matches = urnComponents.path.match(URN_REG);
|
|
22181
|
+
if (matches) {
|
|
22182
|
+
const scheme = options.scheme || urnComponents.scheme || 'urn';
|
|
22183
|
+
urnComponents.nid = matches[1].toLowerCase();
|
|
22184
|
+
urnComponents.nss = matches[2];
|
|
22185
|
+
const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`;
|
|
22186
|
+
const schemeHandler = SCHEMES$1[urnScheme];
|
|
22187
|
+
urnComponents.path = undefined;
|
|
22188
|
+
|
|
22189
|
+
if (schemeHandler) {
|
|
22190
|
+
urnComponents = schemeHandler.parse(urnComponents, options);
|
|
22191
|
+
}
|
|
22192
|
+
} else {
|
|
22193
|
+
urnComponents.error = urnComponents.error || 'URN can not be parsed.';
|
|
22194
|
+
}
|
|
22249
22195
|
|
|
22250
|
-
|
|
22251
|
-
|
|
22252
|
-
error$1('overflow');
|
|
22253
|
-
}
|
|
22196
|
+
return urnComponents
|
|
22197
|
+
}
|
|
22254
22198
|
|
|
22255
|
-
|
|
22256
|
-
|
|
22199
|
+
function urnSerialize (urnComponents, options) {
|
|
22200
|
+
const scheme = options.scheme || urnComponents.scheme || 'urn';
|
|
22201
|
+
const nid = urnComponents.nid.toLowerCase();
|
|
22202
|
+
const urnScheme = `${scheme}:${options.nid || nid}`;
|
|
22203
|
+
const schemeHandler = SCHEMES$1[urnScheme];
|
|
22257
22204
|
|
|
22258
|
-
|
|
22259
|
-
|
|
22205
|
+
if (schemeHandler) {
|
|
22206
|
+
urnComponents = schemeHandler.serialize(urnComponents, options);
|
|
22207
|
+
}
|
|
22260
22208
|
|
|
22261
|
-
|
|
22262
|
-
|
|
22263
|
-
|
|
22264
|
-
error$1('overflow');
|
|
22265
|
-
}
|
|
22209
|
+
const uriComponents = urnComponents;
|
|
22210
|
+
const nss = urnComponents.nss;
|
|
22211
|
+
uriComponents.path = `${nid || options.nid}:${nss}`;
|
|
22266
22212
|
|
|
22267
|
-
|
|
22268
|
-
|
|
22213
|
+
options.skipEscape = true;
|
|
22214
|
+
return uriComponents
|
|
22215
|
+
}
|
|
22269
22216
|
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
|
|
22217
|
+
function urnuuidParse (urnComponents, options) {
|
|
22218
|
+
const uuidComponents = urnComponents;
|
|
22219
|
+
uuidComponents.uuid = uuidComponents.nss;
|
|
22220
|
+
uuidComponents.nss = undefined;
|
|
22273
22221
|
|
|
22274
|
-
|
|
22275
|
-
|
|
22222
|
+
if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
|
|
22223
|
+
uuidComponents.error = uuidComponents.error || 'UUID is not valid.';
|
|
22224
|
+
}
|
|
22276
22225
|
|
|
22277
|
-
|
|
22278
|
-
|
|
22279
|
-
* Punycode string of ASCII-only symbols.
|
|
22280
|
-
* @memberOf punycode
|
|
22281
|
-
* @param {String} input The string of Unicode symbols.
|
|
22282
|
-
* @returns {String} The resulting Punycode string of ASCII-only symbols.
|
|
22283
|
-
*/
|
|
22284
|
-
var encode = function encode(input) {
|
|
22285
|
-
var output = [];
|
|
22226
|
+
return uuidComponents
|
|
22227
|
+
}
|
|
22286
22228
|
|
|
22287
|
-
|
|
22288
|
-
|
|
22229
|
+
function urnuuidSerialize (uuidComponents) {
|
|
22230
|
+
const urnComponents = uuidComponents;
|
|
22231
|
+
// normalize UUID
|
|
22232
|
+
urnComponents.nss = (uuidComponents.uuid || '').toLowerCase();
|
|
22233
|
+
return urnComponents
|
|
22234
|
+
}
|
|
22289
22235
|
|
|
22290
|
-
|
|
22291
|
-
|
|
22236
|
+
const http = {
|
|
22237
|
+
scheme: 'http',
|
|
22238
|
+
domainHost: true,
|
|
22239
|
+
parse: httpParse,
|
|
22240
|
+
serialize: httpSerialize
|
|
22241
|
+
};
|
|
22292
22242
|
|
|
22293
|
-
|
|
22294
|
-
|
|
22295
|
-
|
|
22296
|
-
|
|
22243
|
+
const https = {
|
|
22244
|
+
scheme: 'https',
|
|
22245
|
+
domainHost: http.domainHost,
|
|
22246
|
+
parse: httpParse,
|
|
22247
|
+
serialize: httpSerialize
|
|
22248
|
+
};
|
|
22297
22249
|
|
|
22298
|
-
|
|
22299
|
-
|
|
22300
|
-
|
|
22301
|
-
|
|
22250
|
+
const ws = {
|
|
22251
|
+
scheme: 'ws',
|
|
22252
|
+
domainHost: true,
|
|
22253
|
+
parse: wsParse,
|
|
22254
|
+
serialize: wsSerialize
|
|
22255
|
+
};
|
|
22302
22256
|
|
|
22303
|
-
|
|
22304
|
-
|
|
22305
|
-
|
|
22257
|
+
const wss = {
|
|
22258
|
+
scheme: 'wss',
|
|
22259
|
+
domainHost: ws.domainHost,
|
|
22260
|
+
parse: ws.parse,
|
|
22261
|
+
serialize: ws.serialize
|
|
22262
|
+
};
|
|
22306
22263
|
|
|
22307
|
-
|
|
22308
|
-
|
|
22309
|
-
|
|
22310
|
-
|
|
22311
|
-
|
|
22312
|
-
|
|
22313
|
-
_iteratorError = err;
|
|
22314
|
-
} finally {
|
|
22315
|
-
try {
|
|
22316
|
-
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
22317
|
-
_iterator.return();
|
|
22318
|
-
}
|
|
22319
|
-
} finally {
|
|
22320
|
-
if (_didIteratorError) {
|
|
22321
|
-
throw _iteratorError;
|
|
22322
|
-
}
|
|
22323
|
-
}
|
|
22324
|
-
}
|
|
22264
|
+
const urn = {
|
|
22265
|
+
scheme: 'urn',
|
|
22266
|
+
parse: urnParse,
|
|
22267
|
+
serialize: urnSerialize,
|
|
22268
|
+
skipNormalize: true
|
|
22269
|
+
};
|
|
22325
22270
|
|
|
22326
|
-
|
|
22327
|
-
|
|
22271
|
+
const urnuuid = {
|
|
22272
|
+
scheme: 'urn:uuid',
|
|
22273
|
+
parse: urnuuidParse,
|
|
22274
|
+
serialize: urnuuidSerialize,
|
|
22275
|
+
skipNormalize: true
|
|
22276
|
+
};
|
|
22328
22277
|
|
|
22329
|
-
|
|
22330
|
-
|
|
22278
|
+
const SCHEMES$1 = {
|
|
22279
|
+
http,
|
|
22280
|
+
https,
|
|
22281
|
+
ws,
|
|
22282
|
+
wss,
|
|
22283
|
+
urn,
|
|
22284
|
+
'urn:uuid': urnuuid
|
|
22285
|
+
};
|
|
22331
22286
|
|
|
22332
|
-
|
|
22333
|
-
if (basicLength) {
|
|
22334
|
-
output.push(delimiter);
|
|
22335
|
-
}
|
|
22287
|
+
var schemes = SCHEMES$1;
|
|
22336
22288
|
|
|
22337
|
-
|
|
22338
|
-
|
|
22289
|
+
const { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = utils$1;
|
|
22290
|
+
const SCHEMES = schemes;
|
|
22339
22291
|
|
|
22340
|
-
|
|
22341
|
-
|
|
22342
|
-
|
|
22343
|
-
|
|
22344
|
-
|
|
22345
|
-
|
|
22292
|
+
function normalize (uri, options) {
|
|
22293
|
+
if (typeof uri === 'string') {
|
|
22294
|
+
uri = serialize(parse$2(uri, options), options);
|
|
22295
|
+
} else if (typeof uri === 'object') {
|
|
22296
|
+
uri = parse$2(serialize(uri, options), options);
|
|
22297
|
+
}
|
|
22298
|
+
return uri
|
|
22299
|
+
}
|
|
22346
22300
|
|
|
22347
|
-
|
|
22348
|
-
|
|
22349
|
-
|
|
22301
|
+
function resolve (baseURI, relativeURI, options) {
|
|
22302
|
+
const schemelessOptions = Object.assign({ scheme: 'null' }, options);
|
|
22303
|
+
const resolved = resolveComponents(parse$2(baseURI, schemelessOptions), parse$2(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
22304
|
+
return serialize(resolved, { ...schemelessOptions, skipEscape: true })
|
|
22305
|
+
}
|
|
22350
22306
|
|
|
22351
|
-
|
|
22352
|
-
|
|
22353
|
-
|
|
22354
|
-
|
|
22307
|
+
function resolveComponents (base, relative, options, skipNormalization) {
|
|
22308
|
+
const target = {};
|
|
22309
|
+
if (!skipNormalization) {
|
|
22310
|
+
base = parse$2(serialize(base, options), options); // normalize base components
|
|
22311
|
+
relative = parse$2(serialize(relative, options), options); // normalize relative components
|
|
22312
|
+
}
|
|
22313
|
+
options = options || {};
|
|
22314
|
+
|
|
22315
|
+
if (!options.tolerant && relative.scheme) {
|
|
22316
|
+
target.scheme = relative.scheme;
|
|
22317
|
+
// target.authority = relative.authority;
|
|
22318
|
+
target.userinfo = relative.userinfo;
|
|
22319
|
+
target.host = relative.host;
|
|
22320
|
+
target.port = relative.port;
|
|
22321
|
+
target.path = removeDotSegments(relative.path || '');
|
|
22322
|
+
target.query = relative.query;
|
|
22323
|
+
} else {
|
|
22324
|
+
if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
|
|
22325
|
+
// target.authority = relative.authority;
|
|
22326
|
+
target.userinfo = relative.userinfo;
|
|
22327
|
+
target.host = relative.host;
|
|
22328
|
+
target.port = relative.port;
|
|
22329
|
+
target.path = removeDotSegments(relative.path || '');
|
|
22330
|
+
target.query = relative.query;
|
|
22331
|
+
} else {
|
|
22332
|
+
if (!relative.path) {
|
|
22333
|
+
target.path = base.path;
|
|
22334
|
+
if (relative.query !== undefined) {
|
|
22335
|
+
target.query = relative.query;
|
|
22336
|
+
} else {
|
|
22337
|
+
target.query = base.query;
|
|
22338
|
+
}
|
|
22339
|
+
} else {
|
|
22340
|
+
if (relative.path.charAt(0) === '/') {
|
|
22341
|
+
target.path = removeDotSegments(relative.path);
|
|
22342
|
+
} else {
|
|
22343
|
+
if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
|
|
22344
|
+
target.path = '/' + relative.path;
|
|
22345
|
+
} else if (!base.path) {
|
|
22346
|
+
target.path = relative.path;
|
|
22347
|
+
} else {
|
|
22348
|
+
target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path;
|
|
22349
|
+
}
|
|
22350
|
+
target.path = removeDotSegments(target.path);
|
|
22351
|
+
}
|
|
22352
|
+
target.query = relative.query;
|
|
22353
|
+
}
|
|
22354
|
+
// target.authority = base.authority;
|
|
22355
|
+
target.userinfo = base.userinfo;
|
|
22356
|
+
target.host = base.host;
|
|
22357
|
+
target.port = base.port;
|
|
22358
|
+
}
|
|
22359
|
+
target.scheme = base.scheme;
|
|
22360
|
+
}
|
|
22355
22361
|
|
|
22356
|
-
|
|
22357
|
-
// but guard against overflow.
|
|
22358
|
-
} catch (err) {
|
|
22359
|
-
_didIteratorError2 = true;
|
|
22360
|
-
_iteratorError2 = err;
|
|
22361
|
-
} finally {
|
|
22362
|
-
try {
|
|
22363
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
22364
|
-
_iterator2.return();
|
|
22365
|
-
}
|
|
22366
|
-
} finally {
|
|
22367
|
-
if (_didIteratorError2) {
|
|
22368
|
-
throw _iteratorError2;
|
|
22369
|
-
}
|
|
22370
|
-
}
|
|
22371
|
-
}
|
|
22362
|
+
target.fragment = relative.fragment;
|
|
22372
22363
|
|
|
22373
|
-
|
|
22374
|
-
|
|
22375
|
-
error$1('overflow');
|
|
22376
|
-
}
|
|
22364
|
+
return target
|
|
22365
|
+
}
|
|
22377
22366
|
|
|
22378
|
-
|
|
22379
|
-
|
|
22380
|
-
|
|
22381
|
-
|
|
22382
|
-
|
|
22383
|
-
|
|
22384
|
-
|
|
22385
|
-
try {
|
|
22386
|
-
for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
22387
|
-
var _currentValue = _step3.value;
|
|
22388
|
-
|
|
22389
|
-
if (_currentValue < n && ++delta > maxInt) {
|
|
22390
|
-
error$1('overflow');
|
|
22391
|
-
}
|
|
22392
|
-
if (_currentValue == n) {
|
|
22393
|
-
// Represent delta as a generalized variable-length integer.
|
|
22394
|
-
var q = delta;
|
|
22395
|
-
for (var k = base;; /* no condition */k += base) {
|
|
22396
|
-
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
22397
|
-
if (q < t) {
|
|
22398
|
-
break;
|
|
22399
|
-
}
|
|
22400
|
-
var qMinusT = q - t;
|
|
22401
|
-
var baseMinusT = base - t;
|
|
22402
|
-
output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
|
|
22403
|
-
q = floor(qMinusT / baseMinusT);
|
|
22404
|
-
}
|
|
22405
|
-
|
|
22406
|
-
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
|
22407
|
-
bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
|
22408
|
-
delta = 0;
|
|
22409
|
-
++handledCPCount;
|
|
22410
|
-
}
|
|
22411
|
-
}
|
|
22412
|
-
} catch (err) {
|
|
22413
|
-
_didIteratorError3 = true;
|
|
22414
|
-
_iteratorError3 = err;
|
|
22415
|
-
} finally {
|
|
22416
|
-
try {
|
|
22417
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return) {
|
|
22418
|
-
_iterator3.return();
|
|
22419
|
-
}
|
|
22420
|
-
} finally {
|
|
22421
|
-
if (_didIteratorError3) {
|
|
22422
|
-
throw _iteratorError3;
|
|
22423
|
-
}
|
|
22424
|
-
}
|
|
22425
|
-
}
|
|
22367
|
+
function equal$2 (uriA, uriB, options) {
|
|
22368
|
+
if (typeof uriA === 'string') {
|
|
22369
|
+
uriA = unescape(uriA);
|
|
22370
|
+
uriA = serialize(normalizeComponentEncoding(parse$2(uriA, options), true), { ...options, skipEscape: true });
|
|
22371
|
+
} else if (typeof uriA === 'object') {
|
|
22372
|
+
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
22373
|
+
}
|
|
22426
22374
|
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22430
|
-
|
|
22431
|
-
|
|
22375
|
+
if (typeof uriB === 'string') {
|
|
22376
|
+
uriB = unescape(uriB);
|
|
22377
|
+
uriB = serialize(normalizeComponentEncoding(parse$2(uriB, options), true), { ...options, skipEscape: true });
|
|
22378
|
+
} else if (typeof uriB === 'object') {
|
|
22379
|
+
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
22380
|
+
}
|
|
22432
22381
|
|
|
22433
|
-
|
|
22434
|
-
|
|
22435
|
-
|
|
22436
|
-
|
|
22437
|
-
|
|
22438
|
-
|
|
22439
|
-
|
|
22440
|
-
|
|
22441
|
-
|
|
22442
|
-
|
|
22443
|
-
|
|
22444
|
-
|
|
22445
|
-
|
|
22446
|
-
|
|
22447
|
-
|
|
22448
|
-
|
|
22382
|
+
return uriA.toLowerCase() === uriB.toLowerCase()
|
|
22383
|
+
}
|
|
22384
|
+
|
|
22385
|
+
function serialize (cmpts, opts) {
|
|
22386
|
+
const components = {
|
|
22387
|
+
host: cmpts.host,
|
|
22388
|
+
scheme: cmpts.scheme,
|
|
22389
|
+
userinfo: cmpts.userinfo,
|
|
22390
|
+
port: cmpts.port,
|
|
22391
|
+
path: cmpts.path,
|
|
22392
|
+
query: cmpts.query,
|
|
22393
|
+
nid: cmpts.nid,
|
|
22394
|
+
nss: cmpts.nss,
|
|
22395
|
+
uuid: cmpts.uuid,
|
|
22396
|
+
fragment: cmpts.fragment,
|
|
22397
|
+
reference: cmpts.reference,
|
|
22398
|
+
resourceName: cmpts.resourceName,
|
|
22399
|
+
secure: cmpts.secure,
|
|
22400
|
+
error: ''
|
|
22401
|
+
};
|
|
22402
|
+
const options = Object.assign({}, opts);
|
|
22403
|
+
const uriTokens = [];
|
|
22449
22404
|
|
|
22450
|
-
|
|
22451
|
-
|
|
22452
|
-
* Punycode. Only the non-ASCII parts of the domain name will be converted,
|
|
22453
|
-
* i.e. it doesn't matter if you call it with a domain that's already in
|
|
22454
|
-
* ASCII.
|
|
22455
|
-
* @memberOf punycode
|
|
22456
|
-
* @param {String} input The domain name or email address to convert, as a
|
|
22457
|
-
* Unicode string.
|
|
22458
|
-
* @returns {String} The Punycode representation of the given domain name or
|
|
22459
|
-
* email address.
|
|
22460
|
-
*/
|
|
22461
|
-
var toASCII = function toASCII(input) {
|
|
22462
|
-
return mapDomain(input, function (string) {
|
|
22463
|
-
return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
|
|
22464
|
-
});
|
|
22465
|
-
};
|
|
22405
|
+
// find scheme handler
|
|
22406
|
+
const schemeHandler = SCHEMES[(options.scheme || components.scheme || '').toLowerCase()];
|
|
22466
22407
|
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
/** Define the public API */
|
|
22470
|
-
var punycode = {
|
|
22471
|
-
/**
|
|
22472
|
-
* A string representing the current Punycode.js version number.
|
|
22473
|
-
* @memberOf punycode
|
|
22474
|
-
* @type String
|
|
22475
|
-
*/
|
|
22476
|
-
'version': '2.1.0',
|
|
22477
|
-
/**
|
|
22478
|
-
* An object of methods to convert from JavaScript's internal character
|
|
22479
|
-
* representation (UCS-2) to Unicode code points, and back.
|
|
22480
|
-
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
22481
|
-
* @memberOf punycode
|
|
22482
|
-
* @type Object
|
|
22483
|
-
*/
|
|
22484
|
-
'ucs2': {
|
|
22485
|
-
'decode': ucs2decode,
|
|
22486
|
-
'encode': ucs2encode
|
|
22487
|
-
},
|
|
22488
|
-
'decode': decode,
|
|
22489
|
-
'encode': encode,
|
|
22490
|
-
'toASCII': toASCII,
|
|
22491
|
-
'toUnicode': toUnicode
|
|
22492
|
-
};
|
|
22408
|
+
// perform scheme specific serialization
|
|
22409
|
+
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
|
|
22493
22410
|
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
* @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
|
|
22498
|
-
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
|
22499
|
-
* @see http://github.com/garycourt/uri-js
|
|
22500
|
-
*/
|
|
22501
|
-
/**
|
|
22502
|
-
* Copyright 2011 Gary Court. All rights reserved.
|
|
22503
|
-
*
|
|
22504
|
-
* Redistribution and use in source and binary forms, with or without modification, are
|
|
22505
|
-
* permitted provided that the following conditions are met:
|
|
22506
|
-
*
|
|
22507
|
-
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
22508
|
-
* conditions and the following disclaimer.
|
|
22509
|
-
*
|
|
22510
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
22511
|
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
22512
|
-
* provided with the distribution.
|
|
22513
|
-
*
|
|
22514
|
-
* THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
22515
|
-
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
22516
|
-
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
|
|
22517
|
-
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
22518
|
-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
22519
|
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
22520
|
-
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
22521
|
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
22522
|
-
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
22523
|
-
*
|
|
22524
|
-
* The views and conclusions contained in the software and documentation are those of the
|
|
22525
|
-
* authors and should not be interpreted as representing official policies, either expressed
|
|
22526
|
-
* or implied, of Gary Court.
|
|
22527
|
-
*/
|
|
22528
|
-
var SCHEMES = {};
|
|
22529
|
-
function pctEncChar(chr) {
|
|
22530
|
-
var c = chr.charCodeAt(0);
|
|
22531
|
-
var e = void 0;
|
|
22532
|
-
if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
|
|
22533
|
-
return e;
|
|
22534
|
-
}
|
|
22535
|
-
function pctDecChars(str) {
|
|
22536
|
-
var newStr = "";
|
|
22537
|
-
var i = 0;
|
|
22538
|
-
var il = str.length;
|
|
22539
|
-
while (i < il) {
|
|
22540
|
-
var c = parseInt(str.substr(i + 1, 2), 16);
|
|
22541
|
-
if (c < 128) {
|
|
22542
|
-
newStr += String.fromCharCode(c);
|
|
22543
|
-
i += 3;
|
|
22544
|
-
} else if (c >= 194 && c < 224) {
|
|
22545
|
-
if (il - i >= 6) {
|
|
22546
|
-
var c2 = parseInt(str.substr(i + 4, 2), 16);
|
|
22547
|
-
newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
|
|
22548
|
-
} else {
|
|
22549
|
-
newStr += str.substr(i, 6);
|
|
22550
|
-
}
|
|
22551
|
-
i += 6;
|
|
22552
|
-
} else if (c >= 224) {
|
|
22553
|
-
if (il - i >= 9) {
|
|
22554
|
-
var _c = parseInt(str.substr(i + 4, 2), 16);
|
|
22555
|
-
var c3 = parseInt(str.substr(i + 7, 2), 16);
|
|
22556
|
-
newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
|
|
22557
|
-
} else {
|
|
22558
|
-
newStr += str.substr(i, 9);
|
|
22559
|
-
}
|
|
22560
|
-
i += 9;
|
|
22561
|
-
} else {
|
|
22562
|
-
newStr += str.substr(i, 3);
|
|
22563
|
-
i += 3;
|
|
22564
|
-
}
|
|
22565
|
-
}
|
|
22566
|
-
return newStr;
|
|
22567
|
-
}
|
|
22568
|
-
function _normalizeComponentEncoding(components, protocol) {
|
|
22569
|
-
function decodeUnreserved(str) {
|
|
22570
|
-
var decStr = pctDecChars(str);
|
|
22571
|
-
return !decStr.match(protocol.UNRESERVED) ? str : decStr;
|
|
22572
|
-
}
|
|
22573
|
-
if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
|
|
22574
|
-
if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
22575
|
-
if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
22576
|
-
if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
22577
|
-
if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
22578
|
-
if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
22579
|
-
return components;
|
|
22580
|
-
}
|
|
22411
|
+
if (components.path !== undefined) {
|
|
22412
|
+
if (!options.skipEscape) {
|
|
22413
|
+
components.path = escape(components.path);
|
|
22581
22414
|
|
|
22582
|
-
|
|
22583
|
-
|
|
22584
|
-
|
|
22585
|
-
|
|
22586
|
-
|
|
22415
|
+
if (components.scheme !== undefined) {
|
|
22416
|
+
components.path = components.path.split('%3A').join(':');
|
|
22417
|
+
}
|
|
22418
|
+
} else {
|
|
22419
|
+
components.path = unescape(components.path);
|
|
22420
|
+
}
|
|
22421
|
+
}
|
|
22587
22422
|
|
|
22588
|
-
|
|
22589
|
-
|
|
22423
|
+
if (options.reference !== 'suffix' && components.scheme) {
|
|
22424
|
+
uriTokens.push(components.scheme);
|
|
22425
|
+
uriTokens.push(':');
|
|
22426
|
+
}
|
|
22590
22427
|
|
|
22591
|
-
|
|
22592
|
-
|
|
22593
|
-
|
|
22594
|
-
|
|
22595
|
-
|
|
22596
|
-
}
|
|
22597
|
-
function _normalizeIPv6(host, protocol) {
|
|
22598
|
-
var matches = host.match(protocol.IPV6ADDRESS) || [];
|
|
22599
|
-
|
|
22600
|
-
var _matches2 = slicedToArray(matches, 3),
|
|
22601
|
-
address = _matches2[1],
|
|
22602
|
-
zone = _matches2[2];
|
|
22603
|
-
|
|
22604
|
-
if (address) {
|
|
22605
|
-
var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
|
|
22606
|
-
_address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
|
|
22607
|
-
last = _address$toLowerCase$2[0],
|
|
22608
|
-
first = _address$toLowerCase$2[1];
|
|
22609
|
-
|
|
22610
|
-
var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
|
|
22611
|
-
var lastFields = last.split(":").map(_stripLeadingZeros);
|
|
22612
|
-
var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
|
|
22613
|
-
var fieldCount = isLastFieldIPv4Address ? 7 : 8;
|
|
22614
|
-
var lastFieldsStart = lastFields.length - fieldCount;
|
|
22615
|
-
var fields = Array(fieldCount);
|
|
22616
|
-
for (var x = 0; x < fieldCount; ++x) {
|
|
22617
|
-
fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
|
|
22618
|
-
}
|
|
22619
|
-
if (isLastFieldIPv4Address) {
|
|
22620
|
-
fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
|
|
22621
|
-
}
|
|
22622
|
-
var allZeroFields = fields.reduce(function (acc, field, index) {
|
|
22623
|
-
if (!field || field === "0") {
|
|
22624
|
-
var lastLongest = acc[acc.length - 1];
|
|
22625
|
-
if (lastLongest && lastLongest.index + lastLongest.length === index) {
|
|
22626
|
-
lastLongest.length++;
|
|
22627
|
-
} else {
|
|
22628
|
-
acc.push({ index: index, length: 1 });
|
|
22629
|
-
}
|
|
22630
|
-
}
|
|
22631
|
-
return acc;
|
|
22632
|
-
}, []);
|
|
22633
|
-
var longestZeroFields = allZeroFields.sort(function (a, b) {
|
|
22634
|
-
return b.length - a.length;
|
|
22635
|
-
})[0];
|
|
22636
|
-
var newHost = void 0;
|
|
22637
|
-
if (longestZeroFields && longestZeroFields.length > 1) {
|
|
22638
|
-
var newFirst = fields.slice(0, longestZeroFields.index);
|
|
22639
|
-
var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
|
|
22640
|
-
newHost = newFirst.join(":") + "::" + newLast.join(":");
|
|
22641
|
-
} else {
|
|
22642
|
-
newHost = fields.join(":");
|
|
22643
|
-
}
|
|
22644
|
-
if (zone) {
|
|
22645
|
-
newHost += "%" + zone;
|
|
22646
|
-
}
|
|
22647
|
-
return newHost;
|
|
22648
|
-
} else {
|
|
22649
|
-
return host;
|
|
22650
|
-
}
|
|
22651
|
-
}
|
|
22652
|
-
var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
|
|
22653
|
-
var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
|
|
22654
|
-
function parse(uriString) {
|
|
22655
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
22656
|
-
|
|
22657
|
-
var components = {};
|
|
22658
|
-
var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
22659
|
-
if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
|
|
22660
|
-
var matches = uriString.match(URI_PARSE);
|
|
22661
|
-
if (matches) {
|
|
22662
|
-
if (NO_MATCH_IS_UNDEFINED) {
|
|
22663
|
-
//store each component
|
|
22664
|
-
components.scheme = matches[1];
|
|
22665
|
-
components.userinfo = matches[3];
|
|
22666
|
-
components.host = matches[4];
|
|
22667
|
-
components.port = parseInt(matches[5], 10);
|
|
22668
|
-
components.path = matches[6] || "";
|
|
22669
|
-
components.query = matches[7];
|
|
22670
|
-
components.fragment = matches[8];
|
|
22671
|
-
//fix port number
|
|
22672
|
-
if (isNaN(components.port)) {
|
|
22673
|
-
components.port = matches[5];
|
|
22674
|
-
}
|
|
22675
|
-
} else {
|
|
22676
|
-
//IE FIX for improper RegExp matching
|
|
22677
|
-
//store each component
|
|
22678
|
-
components.scheme = matches[1] || undefined;
|
|
22679
|
-
components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
|
|
22680
|
-
components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
|
|
22681
|
-
components.port = parseInt(matches[5], 10);
|
|
22682
|
-
components.path = matches[6] || "";
|
|
22683
|
-
components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
|
|
22684
|
-
components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
|
|
22685
|
-
//fix port number
|
|
22686
|
-
if (isNaN(components.port)) {
|
|
22687
|
-
components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
|
|
22688
|
-
}
|
|
22689
|
-
}
|
|
22690
|
-
if (components.host) {
|
|
22691
|
-
//normalize IP hosts
|
|
22692
|
-
components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
|
|
22693
|
-
}
|
|
22694
|
-
//determine reference type
|
|
22695
|
-
if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
|
|
22696
|
-
components.reference = "same-document";
|
|
22697
|
-
} else if (components.scheme === undefined) {
|
|
22698
|
-
components.reference = "relative";
|
|
22699
|
-
} else if (components.fragment === undefined) {
|
|
22700
|
-
components.reference = "absolute";
|
|
22701
|
-
} else {
|
|
22702
|
-
components.reference = "uri";
|
|
22703
|
-
}
|
|
22704
|
-
//check for reference errors
|
|
22705
|
-
if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
|
|
22706
|
-
components.error = components.error || "URI is not a " + options.reference + " reference.";
|
|
22707
|
-
}
|
|
22708
|
-
//find scheme handler
|
|
22709
|
-
var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
|
|
22710
|
-
//check if scheme can't handle IRIs
|
|
22711
|
-
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
22712
|
-
//if host component is a domain name
|
|
22713
|
-
if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
|
|
22714
|
-
//convert Unicode IDN -> ASCII IDN
|
|
22715
|
-
try {
|
|
22716
|
-
components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
|
|
22717
|
-
} catch (e) {
|
|
22718
|
-
components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
|
|
22719
|
-
}
|
|
22720
|
-
}
|
|
22721
|
-
//convert IRI -> URI
|
|
22722
|
-
_normalizeComponentEncoding(components, URI_PROTOCOL);
|
|
22723
|
-
} else {
|
|
22724
|
-
//normalize encodings
|
|
22725
|
-
_normalizeComponentEncoding(components, protocol);
|
|
22726
|
-
}
|
|
22727
|
-
//perform scheme specific parsing
|
|
22728
|
-
if (schemeHandler && schemeHandler.parse) {
|
|
22729
|
-
schemeHandler.parse(components, options);
|
|
22730
|
-
}
|
|
22731
|
-
} else {
|
|
22732
|
-
components.error = components.error || "URI can not be parsed.";
|
|
22733
|
-
}
|
|
22734
|
-
return components;
|
|
22735
|
-
}
|
|
22736
|
-
|
|
22737
|
-
function _recomposeAuthority(components, options) {
|
|
22738
|
-
var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
22739
|
-
var uriTokens = [];
|
|
22740
|
-
if (components.userinfo !== undefined) {
|
|
22741
|
-
uriTokens.push(components.userinfo);
|
|
22742
|
-
uriTokens.push("@");
|
|
22743
|
-
}
|
|
22744
|
-
if (components.host !== undefined) {
|
|
22745
|
-
//normalize IP hosts, add brackets and escape zone separator for IPv6
|
|
22746
|
-
uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
|
|
22747
|
-
return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
|
|
22748
|
-
}));
|
|
22749
|
-
}
|
|
22750
|
-
if (typeof components.port === "number" || typeof components.port === "string") {
|
|
22751
|
-
uriTokens.push(":");
|
|
22752
|
-
uriTokens.push(String(components.port));
|
|
22753
|
-
}
|
|
22754
|
-
return uriTokens.length ? uriTokens.join("") : undefined;
|
|
22755
|
-
}
|
|
22756
|
-
|
|
22757
|
-
var RDS1 = /^\.\.?\//;
|
|
22758
|
-
var RDS2 = /^\/\.(\/|$)/;
|
|
22759
|
-
var RDS3 = /^\/\.\.(\/|$)/;
|
|
22760
|
-
var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
|
|
22761
|
-
function removeDotSegments(input) {
|
|
22762
|
-
var output = [];
|
|
22763
|
-
while (input.length) {
|
|
22764
|
-
if (input.match(RDS1)) {
|
|
22765
|
-
input = input.replace(RDS1, "");
|
|
22766
|
-
} else if (input.match(RDS2)) {
|
|
22767
|
-
input = input.replace(RDS2, "/");
|
|
22768
|
-
} else if (input.match(RDS3)) {
|
|
22769
|
-
input = input.replace(RDS3, "/");
|
|
22770
|
-
output.pop();
|
|
22771
|
-
} else if (input === "." || input === "..") {
|
|
22772
|
-
input = "";
|
|
22773
|
-
} else {
|
|
22774
|
-
var im = input.match(RDS5);
|
|
22775
|
-
if (im) {
|
|
22776
|
-
var s = im[0];
|
|
22777
|
-
input = input.slice(s.length);
|
|
22778
|
-
output.push(s);
|
|
22779
|
-
} else {
|
|
22780
|
-
throw new Error("Unexpected dot segment condition");
|
|
22781
|
-
}
|
|
22782
|
-
}
|
|
22783
|
-
}
|
|
22784
|
-
return output.join("");
|
|
22785
|
-
}
|
|
22428
|
+
const authority = recomposeAuthority(components, options);
|
|
22429
|
+
if (authority !== undefined) {
|
|
22430
|
+
if (options.reference !== 'suffix') {
|
|
22431
|
+
uriTokens.push('//');
|
|
22432
|
+
}
|
|
22786
22433
|
|
|
22787
|
-
|
|
22788
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
22434
|
+
uriTokens.push(authority);
|
|
22789
22435
|
|
|
22790
|
-
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
22794
|
-
|
|
22795
|
-
|
|
22796
|
-
if (components.host) {
|
|
22797
|
-
//if host component is an IPv6 address
|
|
22798
|
-
if (protocol.IPV6ADDRESS.test(components.host)) ;
|
|
22799
|
-
//TODO: normalize IPv6 address as per RFC 5952
|
|
22436
|
+
if (components.path && components.path.charAt(0) !== '/') {
|
|
22437
|
+
uriTokens.push('/');
|
|
22438
|
+
}
|
|
22439
|
+
}
|
|
22440
|
+
if (components.path !== undefined) {
|
|
22441
|
+
let s = components.path;
|
|
22800
22442
|
|
|
22801
|
-
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
try {
|
|
22805
|
-
components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
|
|
22806
|
-
} catch (e) {
|
|
22807
|
-
components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
|
|
22808
|
-
}
|
|
22809
|
-
}
|
|
22810
|
-
}
|
|
22811
|
-
//normalize encoding
|
|
22812
|
-
_normalizeComponentEncoding(components, protocol);
|
|
22813
|
-
if (options.reference !== "suffix" && components.scheme) {
|
|
22814
|
-
uriTokens.push(components.scheme);
|
|
22815
|
-
uriTokens.push(":");
|
|
22816
|
-
}
|
|
22817
|
-
var authority = _recomposeAuthority(components, options);
|
|
22818
|
-
if (authority !== undefined) {
|
|
22819
|
-
if (options.reference !== "suffix") {
|
|
22820
|
-
uriTokens.push("//");
|
|
22821
|
-
}
|
|
22822
|
-
uriTokens.push(authority);
|
|
22823
|
-
if (components.path && components.path.charAt(0) !== "/") {
|
|
22824
|
-
uriTokens.push("/");
|
|
22825
|
-
}
|
|
22826
|
-
}
|
|
22827
|
-
if (components.path !== undefined) {
|
|
22828
|
-
var s = components.path;
|
|
22829
|
-
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
22830
|
-
s = removeDotSegments(s);
|
|
22831
|
-
}
|
|
22832
|
-
if (authority === undefined) {
|
|
22833
|
-
s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
|
|
22834
|
-
}
|
|
22835
|
-
uriTokens.push(s);
|
|
22836
|
-
}
|
|
22837
|
-
if (components.query !== undefined) {
|
|
22838
|
-
uriTokens.push("?");
|
|
22839
|
-
uriTokens.push(components.query);
|
|
22840
|
-
}
|
|
22841
|
-
if (components.fragment !== undefined) {
|
|
22842
|
-
uriTokens.push("#");
|
|
22843
|
-
uriTokens.push(components.fragment);
|
|
22844
|
-
}
|
|
22845
|
-
return uriTokens.join(""); //merge tokens into a string
|
|
22846
|
-
}
|
|
22443
|
+
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
22444
|
+
s = removeDotSegments(s);
|
|
22445
|
+
}
|
|
22847
22446
|
|
|
22848
|
-
|
|
22849
|
-
|
|
22850
|
-
|
|
22447
|
+
if (authority === undefined) {
|
|
22448
|
+
s = s.replace(/^\/\//u, '/%2F'); // don't allow the path to start with "//"
|
|
22449
|
+
}
|
|
22851
22450
|
|
|
22852
|
-
|
|
22853
|
-
|
|
22854
|
-
base = parse(serialize(base, options), options); //normalize base components
|
|
22855
|
-
relative = parse(serialize(relative, options), options); //normalize relative components
|
|
22856
|
-
}
|
|
22857
|
-
options = options || {};
|
|
22858
|
-
if (!options.tolerant && relative.scheme) {
|
|
22859
|
-
target.scheme = relative.scheme;
|
|
22860
|
-
//target.authority = relative.authority;
|
|
22861
|
-
target.userinfo = relative.userinfo;
|
|
22862
|
-
target.host = relative.host;
|
|
22863
|
-
target.port = relative.port;
|
|
22864
|
-
target.path = removeDotSegments(relative.path || "");
|
|
22865
|
-
target.query = relative.query;
|
|
22866
|
-
} else {
|
|
22867
|
-
if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
|
|
22868
|
-
//target.authority = relative.authority;
|
|
22869
|
-
target.userinfo = relative.userinfo;
|
|
22870
|
-
target.host = relative.host;
|
|
22871
|
-
target.port = relative.port;
|
|
22872
|
-
target.path = removeDotSegments(relative.path || "");
|
|
22873
|
-
target.query = relative.query;
|
|
22874
|
-
} else {
|
|
22875
|
-
if (!relative.path) {
|
|
22876
|
-
target.path = base.path;
|
|
22877
|
-
if (relative.query !== undefined) {
|
|
22878
|
-
target.query = relative.query;
|
|
22879
|
-
} else {
|
|
22880
|
-
target.query = base.query;
|
|
22881
|
-
}
|
|
22882
|
-
} else {
|
|
22883
|
-
if (relative.path.charAt(0) === "/") {
|
|
22884
|
-
target.path = removeDotSegments(relative.path);
|
|
22885
|
-
} else {
|
|
22886
|
-
if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
|
|
22887
|
-
target.path = "/" + relative.path;
|
|
22888
|
-
} else if (!base.path) {
|
|
22889
|
-
target.path = relative.path;
|
|
22890
|
-
} else {
|
|
22891
|
-
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
|
|
22892
|
-
}
|
|
22893
|
-
target.path = removeDotSegments(target.path);
|
|
22894
|
-
}
|
|
22895
|
-
target.query = relative.query;
|
|
22896
|
-
}
|
|
22897
|
-
//target.authority = base.authority;
|
|
22898
|
-
target.userinfo = base.userinfo;
|
|
22899
|
-
target.host = base.host;
|
|
22900
|
-
target.port = base.port;
|
|
22901
|
-
}
|
|
22902
|
-
target.scheme = base.scheme;
|
|
22903
|
-
}
|
|
22904
|
-
target.fragment = relative.fragment;
|
|
22905
|
-
return target;
|
|
22906
|
-
}
|
|
22451
|
+
uriTokens.push(s);
|
|
22452
|
+
}
|
|
22907
22453
|
|
|
22908
|
-
|
|
22909
|
-
|
|
22910
|
-
|
|
22911
|
-
|
|
22454
|
+
if (components.query !== undefined) {
|
|
22455
|
+
uriTokens.push('?');
|
|
22456
|
+
uriTokens.push(components.query);
|
|
22457
|
+
}
|
|
22912
22458
|
|
|
22913
|
-
|
|
22914
|
-
|
|
22915
|
-
|
|
22916
|
-
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
return uri;
|
|
22920
|
-
}
|
|
22459
|
+
if (components.fragment !== undefined) {
|
|
22460
|
+
uriTokens.push('#');
|
|
22461
|
+
uriTokens.push(components.fragment);
|
|
22462
|
+
}
|
|
22463
|
+
return uriTokens.join('')
|
|
22464
|
+
}
|
|
22921
22465
|
|
|
22922
|
-
|
|
22923
|
-
if (typeof uriA === "string") {
|
|
22924
|
-
uriA = serialize(parse(uriA, options), options);
|
|
22925
|
-
} else if (typeOf(uriA) === "object") {
|
|
22926
|
-
uriA = serialize(uriA, options);
|
|
22927
|
-
}
|
|
22928
|
-
if (typeof uriB === "string") {
|
|
22929
|
-
uriB = serialize(parse(uriB, options), options);
|
|
22930
|
-
} else if (typeOf(uriB) === "object") {
|
|
22931
|
-
uriB = serialize(uriB, options);
|
|
22932
|
-
}
|
|
22933
|
-
return uriA === uriB;
|
|
22934
|
-
}
|
|
22466
|
+
const hexLookUp = Array.from({ length: 127 }, (v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)));
|
|
22935
22467
|
|
|
22936
|
-
|
|
22937
|
-
|
|
22938
|
-
|
|
22468
|
+
function nonSimpleDomain (value) {
|
|
22469
|
+
let code = 0;
|
|
22470
|
+
for (let i = 0, len = value.length; i < len; ++i) {
|
|
22471
|
+
code = value.charCodeAt(i);
|
|
22472
|
+
if (code > 126 || hexLookUp[code]) {
|
|
22473
|
+
return true
|
|
22474
|
+
}
|
|
22475
|
+
}
|
|
22476
|
+
return false
|
|
22477
|
+
}
|
|
22939
22478
|
|
|
22940
|
-
|
|
22941
|
-
return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
|
|
22942
|
-
}
|
|
22479
|
+
const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
22943
22480
|
|
|
22944
|
-
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
|
|
22962
|
-
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
|
|
22966
|
-
|
|
22967
|
-
|
|
22968
|
-
|
|
22969
|
-
|
|
22481
|
+
function parse$2 (uri, opts) {
|
|
22482
|
+
const options = Object.assign({}, opts);
|
|
22483
|
+
const parsed = {
|
|
22484
|
+
scheme: undefined,
|
|
22485
|
+
userinfo: undefined,
|
|
22486
|
+
host: '',
|
|
22487
|
+
port: undefined,
|
|
22488
|
+
path: '',
|
|
22489
|
+
query: undefined,
|
|
22490
|
+
fragment: undefined
|
|
22491
|
+
};
|
|
22492
|
+
const gotEncoding = uri.indexOf('%') !== -1;
|
|
22493
|
+
let isIP = false;
|
|
22494
|
+
if (options.reference === 'suffix') uri = (options.scheme ? options.scheme + ':' : '') + '//' + uri;
|
|
22495
|
+
|
|
22496
|
+
const matches = uri.match(URI_PARSE);
|
|
22497
|
+
|
|
22498
|
+
if (matches) {
|
|
22499
|
+
// store each component
|
|
22500
|
+
parsed.scheme = matches[1];
|
|
22501
|
+
parsed.userinfo = matches[3];
|
|
22502
|
+
parsed.host = matches[4];
|
|
22503
|
+
parsed.port = parseInt(matches[5], 10);
|
|
22504
|
+
parsed.path = matches[6] || '';
|
|
22505
|
+
parsed.query = matches[7];
|
|
22506
|
+
parsed.fragment = matches[8];
|
|
22507
|
+
|
|
22508
|
+
// fix port number
|
|
22509
|
+
if (isNaN(parsed.port)) {
|
|
22510
|
+
parsed.port = matches[5];
|
|
22511
|
+
}
|
|
22512
|
+
if (parsed.host) {
|
|
22513
|
+
const ipv4result = normalizeIPv4(parsed.host);
|
|
22514
|
+
if (ipv4result.isIPV4 === false) {
|
|
22515
|
+
const ipv6result = normalizeIPv6(ipv4result.host, { isIPV4: false });
|
|
22516
|
+
parsed.host = ipv6result.host.toLowerCase();
|
|
22517
|
+
isIP = ipv6result.isIPV6;
|
|
22518
|
+
} else {
|
|
22519
|
+
parsed.host = ipv4result.host;
|
|
22520
|
+
isIP = true;
|
|
22521
|
+
}
|
|
22522
|
+
}
|
|
22523
|
+
if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && !parsed.path && parsed.query === undefined) {
|
|
22524
|
+
parsed.reference = 'same-document';
|
|
22525
|
+
} else if (parsed.scheme === undefined) {
|
|
22526
|
+
parsed.reference = 'relative';
|
|
22527
|
+
} else if (parsed.fragment === undefined) {
|
|
22528
|
+
parsed.reference = 'absolute';
|
|
22529
|
+
} else {
|
|
22530
|
+
parsed.reference = 'uri';
|
|
22531
|
+
}
|
|
22970
22532
|
|
|
22971
|
-
|
|
22972
|
-
|
|
22973
|
-
|
|
22974
|
-
|
|
22975
|
-
serialize: handler.serialize
|
|
22976
|
-
};
|
|
22533
|
+
// check for reference errors
|
|
22534
|
+
if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {
|
|
22535
|
+
parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.';
|
|
22536
|
+
}
|
|
22977
22537
|
|
|
22978
|
-
|
|
22979
|
-
|
|
22980
|
-
}
|
|
22981
|
-
//RFC 6455
|
|
22982
|
-
var handler$2 = {
|
|
22983
|
-
scheme: "ws",
|
|
22984
|
-
domainHost: true,
|
|
22985
|
-
parse: function parse(components, options) {
|
|
22986
|
-
var wsComponents = components;
|
|
22987
|
-
//indicate if the secure flag is set
|
|
22988
|
-
wsComponents.secure = isSecure(wsComponents);
|
|
22989
|
-
//construct resouce name
|
|
22990
|
-
wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
|
|
22991
|
-
wsComponents.path = undefined;
|
|
22992
|
-
wsComponents.query = undefined;
|
|
22993
|
-
return wsComponents;
|
|
22994
|
-
},
|
|
22995
|
-
serialize: function serialize(wsComponents, options) {
|
|
22996
|
-
//normalize the default port
|
|
22997
|
-
if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
|
|
22998
|
-
wsComponents.port = undefined;
|
|
22999
|
-
}
|
|
23000
|
-
//ensure scheme matches secure flag
|
|
23001
|
-
if (typeof wsComponents.secure === 'boolean') {
|
|
23002
|
-
wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
|
|
23003
|
-
wsComponents.secure = undefined;
|
|
23004
|
-
}
|
|
23005
|
-
//reconstruct path from resource name
|
|
23006
|
-
if (wsComponents.resourceName) {
|
|
23007
|
-
var _wsComponents$resourc = wsComponents.resourceName.split('?'),
|
|
23008
|
-
_wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
|
|
23009
|
-
path = _wsComponents$resourc2[0],
|
|
23010
|
-
query = _wsComponents$resourc2[1];
|
|
23011
|
-
|
|
23012
|
-
wsComponents.path = path && path !== '/' ? path : undefined;
|
|
23013
|
-
wsComponents.query = query;
|
|
23014
|
-
wsComponents.resourceName = undefined;
|
|
23015
|
-
}
|
|
23016
|
-
//forbid fragment component
|
|
23017
|
-
wsComponents.fragment = undefined;
|
|
23018
|
-
return wsComponents;
|
|
23019
|
-
}
|
|
23020
|
-
};
|
|
22538
|
+
// find scheme handler
|
|
22539
|
+
const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || '').toLowerCase()];
|
|
23021
22540
|
|
|
23022
|
-
|
|
23023
|
-
|
|
23024
|
-
|
|
23025
|
-
|
|
23026
|
-
|
|
23027
|
-
|
|
22541
|
+
// check if scheme can't handle IRIs
|
|
22542
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
22543
|
+
// if host component is a domain name
|
|
22544
|
+
if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
22545
|
+
// convert Unicode IDN -> ASCII IDN
|
|
22546
|
+
try {
|
|
22547
|
+
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
22548
|
+
} catch (e) {
|
|
22549
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
22550
|
+
}
|
|
22551
|
+
}
|
|
22552
|
+
// convert IRI -> URI
|
|
22553
|
+
}
|
|
23028
22554
|
|
|
23029
|
-
|
|
23030
|
-
|
|
23031
|
-
|
|
23032
|
-
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23036
|
-
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
|
|
23047
|
-
var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
|
|
23048
|
-
var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
|
|
23049
|
-
var UNRESERVED = new RegExp(UNRESERVED$$, "g");
|
|
23050
|
-
var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
|
|
23051
|
-
var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
|
|
23052
|
-
var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
|
|
23053
|
-
var NOT_HFVALUE = NOT_HFNAME;
|
|
23054
|
-
function decodeUnreserved(str) {
|
|
23055
|
-
var decStr = pctDecChars(str);
|
|
23056
|
-
return !decStr.match(UNRESERVED) ? str : decStr;
|
|
23057
|
-
}
|
|
23058
|
-
var handler$4 = {
|
|
23059
|
-
scheme: "mailto",
|
|
23060
|
-
parse: function parse$$1(components, options) {
|
|
23061
|
-
var mailtoComponents = components;
|
|
23062
|
-
var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
|
|
23063
|
-
mailtoComponents.path = undefined;
|
|
23064
|
-
if (mailtoComponents.query) {
|
|
23065
|
-
var unknownHeaders = false;
|
|
23066
|
-
var headers = {};
|
|
23067
|
-
var hfields = mailtoComponents.query.split("&");
|
|
23068
|
-
for (var x = 0, xl = hfields.length; x < xl; ++x) {
|
|
23069
|
-
var hfield = hfields[x].split("=");
|
|
23070
|
-
switch (hfield[0]) {
|
|
23071
|
-
case "to":
|
|
23072
|
-
var toAddrs = hfield[1].split(",");
|
|
23073
|
-
for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
|
|
23074
|
-
to.push(toAddrs[_x]);
|
|
23075
|
-
}
|
|
23076
|
-
break;
|
|
23077
|
-
case "subject":
|
|
23078
|
-
mailtoComponents.subject = unescapeComponent(hfield[1], options);
|
|
23079
|
-
break;
|
|
23080
|
-
case "body":
|
|
23081
|
-
mailtoComponents.body = unescapeComponent(hfield[1], options);
|
|
23082
|
-
break;
|
|
23083
|
-
default:
|
|
23084
|
-
unknownHeaders = true;
|
|
23085
|
-
headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
|
|
23086
|
-
break;
|
|
23087
|
-
}
|
|
23088
|
-
}
|
|
23089
|
-
if (unknownHeaders) mailtoComponents.headers = headers;
|
|
23090
|
-
}
|
|
23091
|
-
mailtoComponents.query = undefined;
|
|
23092
|
-
for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
|
|
23093
|
-
var addr = to[_x2].split("@");
|
|
23094
|
-
addr[0] = unescapeComponent(addr[0]);
|
|
23095
|
-
if (!options.unicodeSupport) {
|
|
23096
|
-
//convert Unicode IDN -> ASCII IDN
|
|
23097
|
-
try {
|
|
23098
|
-
addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
|
|
23099
|
-
} catch (e) {
|
|
23100
|
-
mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
|
|
23101
|
-
}
|
|
23102
|
-
} else {
|
|
23103
|
-
addr[1] = unescapeComponent(addr[1], options).toLowerCase();
|
|
23104
|
-
}
|
|
23105
|
-
to[_x2] = addr.join("@");
|
|
23106
|
-
}
|
|
23107
|
-
return mailtoComponents;
|
|
23108
|
-
},
|
|
23109
|
-
serialize: function serialize$$1(mailtoComponents, options) {
|
|
23110
|
-
var components = mailtoComponents;
|
|
23111
|
-
var to = toArray(mailtoComponents.to);
|
|
23112
|
-
if (to) {
|
|
23113
|
-
for (var x = 0, xl = to.length; x < xl; ++x) {
|
|
23114
|
-
var toAddr = String(to[x]);
|
|
23115
|
-
var atIdx = toAddr.lastIndexOf("@");
|
|
23116
|
-
var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
|
|
23117
|
-
var domain = toAddr.slice(atIdx + 1);
|
|
23118
|
-
//convert IDN via punycode
|
|
23119
|
-
try {
|
|
23120
|
-
domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
|
|
23121
|
-
} catch (e) {
|
|
23122
|
-
components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
|
|
23123
|
-
}
|
|
23124
|
-
to[x] = localPart + "@" + domain;
|
|
23125
|
-
}
|
|
23126
|
-
components.path = to.join(",");
|
|
23127
|
-
}
|
|
23128
|
-
var headers = mailtoComponents.headers = mailtoComponents.headers || {};
|
|
23129
|
-
if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
|
|
23130
|
-
if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
|
|
23131
|
-
var fields = [];
|
|
23132
|
-
for (var name in headers) {
|
|
23133
|
-
if (headers[name] !== O[name]) {
|
|
23134
|
-
fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
|
|
23135
|
-
}
|
|
23136
|
-
}
|
|
23137
|
-
if (fields.length) {
|
|
23138
|
-
components.query = fields.join("&");
|
|
23139
|
-
}
|
|
23140
|
-
return components;
|
|
23141
|
-
}
|
|
23142
|
-
};
|
|
22555
|
+
if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {
|
|
22556
|
+
if (gotEncoding && parsed.scheme !== undefined) {
|
|
22557
|
+
parsed.scheme = unescape(parsed.scheme);
|
|
22558
|
+
}
|
|
22559
|
+
if (gotEncoding && parsed.userinfo !== undefined) {
|
|
22560
|
+
parsed.userinfo = unescape(parsed.userinfo);
|
|
22561
|
+
}
|
|
22562
|
+
if (gotEncoding && parsed.host !== undefined) {
|
|
22563
|
+
parsed.host = unescape(parsed.host);
|
|
22564
|
+
}
|
|
22565
|
+
if (parsed.path !== undefined && parsed.path.length) {
|
|
22566
|
+
parsed.path = escape(unescape(parsed.path));
|
|
22567
|
+
}
|
|
22568
|
+
if (parsed.fragment !== undefined && parsed.fragment.length) {
|
|
22569
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
22570
|
+
}
|
|
22571
|
+
}
|
|
23143
22572
|
|
|
23144
|
-
|
|
23145
|
-
|
|
23146
|
-
|
|
23147
|
-
|
|
23148
|
-
|
|
23149
|
-
|
|
23150
|
-
|
|
23151
|
-
|
|
23152
|
-
|
|
23153
|
-
var nid = matches[1].toLowerCase();
|
|
23154
|
-
var nss = matches[2];
|
|
23155
|
-
var urnScheme = scheme + ":" + (options.nid || nid);
|
|
23156
|
-
var schemeHandler = SCHEMES[urnScheme];
|
|
23157
|
-
urnComponents.nid = nid;
|
|
23158
|
-
urnComponents.nss = nss;
|
|
23159
|
-
urnComponents.path = undefined;
|
|
23160
|
-
if (schemeHandler) {
|
|
23161
|
-
urnComponents = schemeHandler.parse(urnComponents, options);
|
|
23162
|
-
}
|
|
23163
|
-
} else {
|
|
23164
|
-
urnComponents.error = urnComponents.error || "URN can not be parsed.";
|
|
23165
|
-
}
|
|
23166
|
-
return urnComponents;
|
|
23167
|
-
},
|
|
23168
|
-
serialize: function serialize$$1(urnComponents, options) {
|
|
23169
|
-
var scheme = options.scheme || urnComponents.scheme || "urn";
|
|
23170
|
-
var nid = urnComponents.nid;
|
|
23171
|
-
var urnScheme = scheme + ":" + (options.nid || nid);
|
|
23172
|
-
var schemeHandler = SCHEMES[urnScheme];
|
|
23173
|
-
if (schemeHandler) {
|
|
23174
|
-
urnComponents = schemeHandler.serialize(urnComponents, options);
|
|
23175
|
-
}
|
|
23176
|
-
var uriComponents = urnComponents;
|
|
23177
|
-
var nss = urnComponents.nss;
|
|
23178
|
-
uriComponents.path = (nid || options.nid) + ":" + nss;
|
|
23179
|
-
return uriComponents;
|
|
23180
|
-
}
|
|
23181
|
-
};
|
|
22573
|
+
// perform scheme specific parsing
|
|
22574
|
+
if (schemeHandler && schemeHandler.parse) {
|
|
22575
|
+
schemeHandler.parse(parsed, options);
|
|
22576
|
+
}
|
|
22577
|
+
} else {
|
|
22578
|
+
parsed.error = parsed.error || 'URI can not be parsed.';
|
|
22579
|
+
}
|
|
22580
|
+
return parsed
|
|
22581
|
+
}
|
|
23182
22582
|
|
|
23183
|
-
|
|
23184
|
-
|
|
23185
|
-
|
|
23186
|
-
|
|
23187
|
-
|
|
23188
|
-
|
|
23189
|
-
|
|
23190
|
-
|
|
23191
|
-
|
|
23192
|
-
uuidComponents.error = uuidComponents.error || "UUID is not valid.";
|
|
23193
|
-
}
|
|
23194
|
-
return uuidComponents;
|
|
23195
|
-
},
|
|
23196
|
-
serialize: function serialize(uuidComponents, options) {
|
|
23197
|
-
var urnComponents = uuidComponents;
|
|
23198
|
-
//normalize UUID
|
|
23199
|
-
urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
|
|
23200
|
-
return urnComponents;
|
|
23201
|
-
}
|
|
23202
|
-
};
|
|
22583
|
+
const fastUri = {
|
|
22584
|
+
SCHEMES,
|
|
22585
|
+
normalize,
|
|
22586
|
+
resolve,
|
|
22587
|
+
resolveComponents,
|
|
22588
|
+
equal: equal$2,
|
|
22589
|
+
serialize,
|
|
22590
|
+
parse: parse$2
|
|
22591
|
+
};
|
|
23203
22592
|
|
|
23204
|
-
|
|
23205
|
-
|
|
23206
|
-
|
|
23207
|
-
SCHEMES[handler$3.scheme] = handler$3;
|
|
23208
|
-
SCHEMES[handler$4.scheme] = handler$4;
|
|
23209
|
-
SCHEMES[handler$5.scheme] = handler$5;
|
|
23210
|
-
SCHEMES[handler$6.scheme] = handler$6;
|
|
23211
|
-
|
|
23212
|
-
exports.SCHEMES = SCHEMES;
|
|
23213
|
-
exports.pctEncChar = pctEncChar;
|
|
23214
|
-
exports.pctDecChars = pctDecChars;
|
|
23215
|
-
exports.parse = parse;
|
|
23216
|
-
exports.removeDotSegments = removeDotSegments;
|
|
23217
|
-
exports.serialize = serialize;
|
|
23218
|
-
exports.resolveComponents = resolveComponents;
|
|
23219
|
-
exports.resolve = resolve;
|
|
23220
|
-
exports.normalize = normalize;
|
|
23221
|
-
exports.equal = equal;
|
|
23222
|
-
exports.escapeComponent = escapeComponent;
|
|
23223
|
-
exports.unescapeComponent = unescapeComponent;
|
|
23224
|
-
|
|
23225
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
23226
|
-
|
|
23227
|
-
})));
|
|
23228
|
-
|
|
23229
|
-
} (uri_all, uri_all.exports));
|
|
22593
|
+
fastUri$1.exports = fastUri;
|
|
22594
|
+
fastUri$1.exports.default = fastUri;
|
|
22595
|
+
fastUri$1.exports.fastUri = fastUri;
|
|
23230
22596
|
|
|
23231
|
-
var
|
|
22597
|
+
var fastUriExports = fastUri$1.exports;
|
|
23232
22598
|
|
|
23233
22599
|
Object.defineProperty(uri$1, "__esModule", { value: true });
|
|
23234
|
-
const uri =
|
|
22600
|
+
const uri = fastUriExports;
|
|
23235
22601
|
uri.code = 'require("ajv/dist/runtime/uri").default';
|
|
23236
22602
|
uri$1.default = uri;
|
|
23237
22603
|
|
|
@@ -23252,7 +22618,7 @@ uri$1.default = uri;
|
|
|
23252
22618
|
const rules_1 = rules;
|
|
23253
22619
|
const compile_1 = compile;
|
|
23254
22620
|
const codegen_2 = codegen;
|
|
23255
|
-
const resolve_1 = resolve$
|
|
22621
|
+
const resolve_1 = resolve$2;
|
|
23256
22622
|
const dataType_1 = dataType;
|
|
23257
22623
|
const util_1 = util;
|
|
23258
22624
|
const $dataRefSchema = require$$9;
|
|
@@ -28120,6 +27486,15 @@ function compilerAssert(condition, message, target) {
|
|
|
28120
27486
|
throw new Error(message);
|
|
28121
27487
|
}
|
|
28122
27488
|
|
|
27489
|
+
function absolutePathStatus(path) {
|
|
27490
|
+
if (path.startsWith(".") || !isPathAbsolute(path)) {
|
|
27491
|
+
return "not-absolute";
|
|
27492
|
+
}
|
|
27493
|
+
if (path.includes("\\")) {
|
|
27494
|
+
return "windows-style";
|
|
27495
|
+
}
|
|
27496
|
+
return "valid";
|
|
27497
|
+
}
|
|
28123
27498
|
function createJSONSchemaValidator(schema, options = { strict: true }) {
|
|
28124
27499
|
const ajv = new ajvExports.Ajv({
|
|
28125
27500
|
strict: options.strict,
|
|
@@ -28128,9 +27503,7 @@ function createJSONSchemaValidator(schema, options = { strict: true }) {
|
|
|
28128
27503
|
});
|
|
28129
27504
|
ajv.addFormat("absolute-path", {
|
|
28130
27505
|
type: "string",
|
|
28131
|
-
validate: (path) =>
|
|
28132
|
-
return !path.startsWith(".") && isPathAbsolute(path);
|
|
28133
|
-
},
|
|
27506
|
+
validate: (path) => absolutePathStatus(path) === "valid",
|
|
28134
27507
|
});
|
|
28135
27508
|
return { validate };
|
|
28136
27509
|
function validate(config, target) {
|
|
@@ -28149,11 +27522,22 @@ const IGNORED_AJV_PARAMS = new Set(["type", "errors"]);
|
|
|
28149
27522
|
function ajvErrorToDiagnostic(obj, error, target) {
|
|
28150
27523
|
const tspTarget = resolveTarget(error, target);
|
|
28151
27524
|
if (error.params.format === "absolute-path") {
|
|
28152
|
-
|
|
28153
|
-
|
|
28154
|
-
|
|
28155
|
-
|
|
28156
|
-
|
|
27525
|
+
const value = getErrorValue(obj, error);
|
|
27526
|
+
const status = absolutePathStatus(value);
|
|
27527
|
+
if (status === "windows-style") {
|
|
27528
|
+
return createDiagnostic({
|
|
27529
|
+
code: "path-unix-style",
|
|
27530
|
+
format: { path: value },
|
|
27531
|
+
target: tspTarget,
|
|
27532
|
+
});
|
|
27533
|
+
}
|
|
27534
|
+
else {
|
|
27535
|
+
return createDiagnostic({
|
|
27536
|
+
code: "config-path-absolute",
|
|
27537
|
+
format: { path: value },
|
|
27538
|
+
target: tspTarget,
|
|
27539
|
+
});
|
|
27540
|
+
}
|
|
28157
27541
|
}
|
|
28158
27542
|
const messageLines = [`Schema violation: ${error.message} (${error.instancePath || "/"})`];
|
|
28159
27543
|
for (const [name, value] of Object.entries(error.params).filter(([name]) => !IGNORED_AJV_PARAMS.has(name))) {
|
|
@@ -28209,7 +27593,7 @@ function parseJsonPointer(pointer) {
|
|
|
28209
27593
|
if (pointer.charAt(0) !== "/") {
|
|
28210
27594
|
compilerAssert(false, `Invalid JSON pointer: "${pointer}"`);
|
|
28211
27595
|
}
|
|
28212
|
-
return pointer.substring(1).split(/\//).map(unescape);
|
|
27596
|
+
return pointer.substring(1).split(/\//).map(unescape$1);
|
|
28213
27597
|
}
|
|
28214
27598
|
/**
|
|
28215
27599
|
* Unescape a reference token
|
|
@@ -28217,7 +27601,7 @@ function parseJsonPointer(pointer) {
|
|
|
28217
27601
|
* @param str
|
|
28218
27602
|
* @returns {string}
|
|
28219
27603
|
*/
|
|
28220
|
-
function unescape(str) {
|
|
27604
|
+
function unescape$1(str) {
|
|
28221
27605
|
return str.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
28222
27606
|
}
|
|
28223
27607
|
|
|
@@ -28225,7 +27609,7 @@ let manifest;
|
|
|
28225
27609
|
try {
|
|
28226
27610
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
28227
27611
|
// @ts-ignore
|
|
28228
|
-
manifest = (await import('../manifest-
|
|
27612
|
+
manifest = (await import('../manifest-BApuudHS.js')).default;
|
|
28229
27613
|
}
|
|
28230
27614
|
catch {
|
|
28231
27615
|
const name = "../dist/manifest.js";
|
|
@@ -29927,8 +29311,9 @@ function parse$1(original) {
|
|
|
29927
29311
|
function stringify(value) {
|
|
29928
29312
|
const n = value.n.toString();
|
|
29929
29313
|
const sign = value.s === -1 ? "-" : "";
|
|
29930
|
-
const
|
|
29931
|
-
|
|
29314
|
+
const int = value.e === 0 ? "0" : n.slice(0, value.e);
|
|
29315
|
+
const decimal = value.e < n.length ? "." + n.slice(value.e).padStart(value.d, "0") : "";
|
|
29316
|
+
return sign + int + decimal;
|
|
29932
29317
|
}
|
|
29933
29318
|
const equals = (a, b) => a.n === b.n && a.e === b.e;
|
|
29934
29319
|
const compare = (a, b) => {
|
|
@@ -30033,40 +29418,41 @@ var Related;
|
|
|
30033
29418
|
Related[Related["maybe"] = 2] = "maybe";
|
|
30034
29419
|
})(Related || (Related = {}));
|
|
30035
29420
|
|
|
30036
|
-
var
|
|
30037
|
-
`,i(u.gutter,
|
|
30038
|
-
`);return r.message&&!
|
|
30039
|
-
${
|
|
30040
|
-
|
|
29421
|
+
var yu=Object.create;var He=Object.defineProperty;var Au=Object.getOwnPropertyDescriptor;var Bu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,xu=Object.prototype.hasOwnProperty;var sr=e=>{throw TypeError(e)};var _u=(e,t)=>()=>(e&&(t=e(e=0)),t);var At=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),We=(e,t)=>{for(var r in t)He(e,r,{get:t[r],enumerable:!0});},ar=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bu(t))!xu.call(e,o)&&o!==r&&He(e,o,{get:()=>t[o],enumerable:!(n=Au(t,o))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?yu(wu(e)):{},ar(He(r,"default",{value:e,enumerable:!0}),e)),vu=e=>ar(He({},"__esModule",{value:!0}),e);var bu=(e,t,r)=>t.has(e)||sr("Cannot "+r);var Dr=(e,t,r)=>t.has(e)?sr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var pe=(e,t,r)=>(bu(e,t,"access private method"),r);var it=At((ia,sn)=>{var on=new Proxy(String,{get:()=>on});sn.exports=on;});var Tn={};We(Tn,{default:()=>_o,shouldHighlight:()=>xo});var xo,_o,kn=_u(()=>{xo=()=>!1,_o=String;});var Pn=At((bD,Xt)=>{var g=String,Ln=function(){return {isColorSupported:!1,reset:g,bold:g,dim:g,italic:g,underline:g,inverse:g,hidden:g,strikethrough:g,black:g,red:g,green:g,yellow:g,blue:g,magenta:g,cyan:g,white:g,gray:g,bgBlack:g,bgRed:g,bgGreen:g,bgYellow:g,bgBlue:g,bgMagenta:g,bgCyan:g,bgWhite:g}};Xt.exports=Ln();Xt.exports.createColors=Ln;});var $n=At(Ct=>{Object.defineProperty(Ct,"__esModule",{value:!0});Ct.codeFrameColumns=Mn;Ct.default=To;var In=(kn(),vu(Tn)),Hn=vo(Pn(),!0);function Wn(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return (Wn=function(n){return n?r:t})(e)}function vo(e,t){if(e===null||typeof e!="object"&&typeof e!="function")return {default:e};var r=Wn(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(u!=="default"&&{}.hasOwnProperty.call(e,u)){var i=o?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,r&&r.set(e,n),n}var bo=Hn.default,Rn=(e,t)=>r=>e(t(r)),Zt;function Oo(e){if(e){return (Zt)!=null||(Zt=(0, Hn.createColors)(!0)),Zt}return bo}var Yn=!1;function So(e){return {gutter:e.gray,marker:Rn(e.red,e.bold),message:Rn(e.red,e.bold)}}var jn=/\r\n|[\n\r\u2028\u2029]/;function No(e,t,r){let n=Object.assign({column:0,line:-1},e.start),o=Object.assign({},n,e.end),{linesAbove:u=2,linesBelow:i=3}=r||{},s=n.line,a=n.column,D=o.line,l=o.column,d=Math.max(s-(u+1),0),f=Math.min(t.length,D+i);s===-1&&(d=0),D===-1&&(f=t.length);let p=D-s,c={};if(p)for(let F=0;F<=p;F++){let m=F+s;if(!a)c[m]=!0;else if(F===0){let E=t[m-1].length;c[m]=[a,E-a+1];}else if(F===p)c[m]=[0,l];else {let E=t[m-F].length;c[m]=[0,E];}}else a===l?a?c[s]=[a,0]:c[s]=!0:c[s]=[a,l-a];return {start:d,end:f,markerLines:c}}function Mn(e,t,r={}){let n=(r.highlightCode||r.forceColor)&&(0, In.shouldHighlight)(r),o=Oo(r.forceColor),u=So(o),i=(F,m)=>n?F(m):m,s=e.split(jn),{start:a,end:D,markerLines:l}=No(t,s,r),d=t.start&&typeof t.start.column=="number",f=String(D).length,c=(n?(0, In.default)(e,r):e).split(jn,D).slice(a,D).map((F,m)=>{let E=a+1+m,w=` ${` ${E}`.slice(-f)} |`,h=l[E],C=!l[E+1];if(h){let k="";if(Array.isArray(h)){let v=F.slice(0,Math.max(h[0]-1,0)).replace(/[^\t]/g," "),$=h[1]||1;k=[`
|
|
29422
|
+
`,i(u.gutter,w.replace(/\d/g," "))," ",v,i(u.marker,"^").repeat($)].join(""),C&&r.message&&(k+=" "+i(u.message,r.message));}return [i(u.marker,">"),i(u.gutter,w),F.length>0?` ${F}`:"",k].join("")}else return ` ${i(u.gutter,w)}${F.length>0?` ${F}`:""}`}).join(`
|
|
29423
|
+
`);return r.message&&!d&&(c=`${" ".repeat(f+1)}${r.message}
|
|
29424
|
+
${c}`),n?o.reset(c):c}function To(e,t,r,n={}){if(!Yn){Yn=!0;let u="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";{let i=new Error(u);i.name="DeprecationWarning",console.warn(new Error(u));}}return r=Math.max(r,0),Mn(e,{start:{column:r,line:t}},n)}});var ir={};We(ir,{__debug:()=>di,check:()=>fi,doc:()=>nr,format:()=>gu,formatWithCursor:()=>Cu,getSupportInfo:()=>pi,util:()=>or,version:()=>fu});var Ou=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},ne=Ou;function Z(){}Z.prototype={diff:function(t,r){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=o.callback;typeof o=="function"&&(u=o,o={}),this.options=o;var i=this;function s(h){return u?(setTimeout(function(){u(void 0,h);},0),!0):h}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var a=r.length,D=t.length,l=1,d=a+D;o.maxEditLength&&(d=Math.min(d,o.maxEditLength));var f=(n=o.timeout)!==null&&n!==void 0?n:1/0,p=Date.now()+f,c=[{oldPos:-1,lastComponent:void 0}],F=this.extractCommon(c[0],r,t,0);if(c[0].oldPos+1>=D&&F+1>=a)return s([{value:this.join(r),count:r.length}]);var m=-1/0,E=1/0;function A(){for(var h=Math.max(m,-l);h<=Math.min(E,l);h+=2){var C=void 0,k=c[h-1],v=c[h+1];k&&(c[h-1]=void 0);var $=!1;if(v){var ye=v.oldPos-h;$=v&&0<=ye&&ye<a;}var yt=k&&k.oldPos+1<D;if(!$&&!yt){c[h]=void 0;continue}if(!yt||$&&k.oldPos+1<v.oldPos?C=i.addToPath(v,!0,void 0,0):C=i.addToPath(k,void 0,!0,1),F=i.extractCommon(C,r,t,h),C.oldPos+1>=D&&F+1>=a)return s(Su(i,C.lastComponent,r,t,i.useLongestToken));c[h]=C,C.oldPos+1>=D&&(E=Math.min(E,h-1)),F+1>=a&&(m=Math.max(m,h+1));}l++;}if(u)(function h(){setTimeout(function(){if(l>d||Date.now()>p)return u();A()||h();},0);})();else for(;l<=d&&Date.now()<=p;){var w=A();if(w)return w}},addToPath:function(t,r,n,o){var u=t.lastComponent;return u&&u.added===r&&u.removed===n?{oldPos:t.oldPos+o,lastComponent:{count:u.count+1,added:r,removed:n,previousComponent:u.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:r,removed:n,previousComponent:u}}},extractCommon:function(t,r,n,o){for(var u=r.length,i=n.length,s=t.oldPos,a=s-o,D=0;a+1<u&&s+1<i&&this.equals(r[a+1],n[s+1]);)a++,s++,D++;return D&&(t.lastComponent={count:D,previousComponent:t.lastComponent}),t.oldPos=s,a},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function Su(e,t,r,n,o){for(var u=[],i;t;)u.push(t),i=t.previousComponent,delete t.previousComponent,t=i;u.reverse();for(var s=0,a=u.length,D=0,l=0;s<a;s++){var d=u[s];if(d.removed){if(d.value=e.join(n.slice(l,l+d.count)),l+=d.count,s&&u[s-1].added){var p=u[s-1];u[s-1]=u[s],u[s]=p;}}else {if(!d.added&&o){var f=r.slice(D,D+d.count);f=f.map(function(F,m){var E=n[l+m];return E.length>F.length?E:F}),d.value=e.join(f);}else d.value=e.join(r.slice(D,D+d.count));D+=d.count,d.added||(l+=d.count);}}var c=u[a-1];return a>1&&typeof c.value=="string"&&(c.added||c.removed)&&e.equals("",c.value)&&(u[a-2].value+=c.value,u.pop()),u}var lr=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,cr=/\S/,fr=new Z;fr.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!cr.test(e)&&!cr.test(t)};fr.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<t.length-1;r++)!t[r+1]&&t[r+2]&&lr.test(t[r])&&lr.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};var pr=new Z;pr.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
29425
|
+
`));var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;n<r.length;n++){var o=r[n];n%2&&!this.options.newlineIsToken?t[t.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),t.push(o));}return t};var Nu=new Z;Nu.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Tu=new Z;Tu.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function $e(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$e=function(t){return typeof t}:$e=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$e(e)}var ku=Object.prototype.toString,Ae=new Z;Ae.useLongestToken=!0;Ae.tokenize=pr.tokenize;Ae.castInput=function(e){var t=this.options,r=t.undefinedReplacement,n=t.stringifyReplacer,o=n===void 0?function(u,i){return typeof i>"u"?r:i}:n;return typeof e=="string"?e:JSON.stringify(Bt(e,null,null,o),o," ")};Ae.equals=function(e,t){return Z.prototype.equals.call(Ae,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Bt(e,t,r,n,o){t=t||[],r=r||[],n&&(e=n(o,e));var u;for(u=0;u<t.length;u+=1)if(t[u]===e)return r[u];var i;if(ku.call(e)==="[object Array]"){for(t.push(e),i=new Array(e.length),r.push(i),u=0;u<e.length;u+=1)i[u]=Bt(e[u],t,r,n,o);return t.pop(),r.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),$e(e)==="object"&&e!==null){t.push(e),i={},r.push(i);var s=[],a;for(a in e)e.hasOwnProperty(a)&&s.push(a);for(s.sort(),u=0;u<s.length;u+=1)a=s[u],i[a]=Bt(e[a],t,r,n,a);t.pop(),r.pop();}else i=e;return i}var Ve=new Z;Ve.tokenize=function(e){return e.slice()};Ve.join=Ve.removeEmpty=function(e){return e};function dr(e,t,r){return Ve.diff(e,t,r)}function Fr(e){let t=e.indexOf("\r");return t>=0?e.charAt(t+1)===`
|
|
29426
|
+
`?"crlf":"cr":"lf"}function Be(e){switch(e){case"cr":return "\r";case"crlf":return `\r
|
|
30041
29427
|
`;default:return `
|
|
30042
|
-
`}}function
|
|
30043
|
-
`:r=/\n/
|
|
30044
|
-
`:r=/\r\n/
|
|
30045
|
-
`)}var
|
|
30046
|
-
Expected it to be 'string' or 'object'.`;if(
|
|
30047
|
-
Expected it to be ${n}.`}var Bt=class extends Error{name="InvalidDocError";constructor(t){super(Su(t)),this.doc=t;}},Z=Bt;var Fr={};function vu(e,t,r,n){let o=[e];for(;o.length>0;){let u=o.pop();if(u===Fr){r(o.pop());continue}r&&o.push(u,Fr);let i=K(u);if(!i)throw new Z(u);if((t==null?void 0:t(u))!==!1)switch(i){case V:case N:{let s=i===V?u:u.parts;for(let D=s.length,a=D-1;a>=0;--a)o.push(s[a]);break}case x:o.push(u.flatContents,u.breakContents);break;case b:if(n&&u.expandedStates)for(let s=u.expandedStates.length,D=s-1;D>=0;--D)o.push(u.expandedStates[D]);else o.push(u.contents);break;case L:case P:case R:case T:case Y:o.push(u.contents);break;case G:case z:case I:case j:case B:case w:break;default:throw new Z(u)}}}var xe=vu;var pr=()=>{},Ge=pr;function De(e){return {type:P,contents:e}}function se(e,t){return {type:L,contents:t,n:e}}function _t(e,t={}){return Ge(t.expandedStates),{type:b,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function dr(e){return se(Number.NEGATIVE_INFINITY,e)}function mr(e){return se({type:"root"},e)}function Er(e){return se(-1,e)}function Cr(e,t){return _t(e[0],{...t,expandedStates:e})}function ze(e){return {type:N,parts:e}}function hr(e,t="",r={}){return {type:x,breakContents:e,flatContents:t,groupId:r.groupId}}function gr(e,t){return {type:R,contents:e,groupId:t.groupId,negate:t.negate}}function ke(e){return {type:Y,contents:e}}var yr={type:j},Fe={type:w},Ar={type:I},we={type:B,hard:!0},bt={type:B,hard:!0,literal:!0},Ke={type:B},Br={type:B,soft:!0},q=[we,Fe],He=[bt,Fe],Oe={type:z};function Ne(e,t){let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function qe(e,t,r){let n=e;if(t>0){for(let o=0;o<Math.floor(t/r);++o)n=De(n);n=se(t%r,n),n=se(Number.NEGATIVE_INFINITY,n);}return n}function _r(e,t){return e?{type:T,label:e,contents:t}:t}function Q(e){var t;if(!e)return "";if(Array.isArray(e)){let r=[];for(let n of e)if(Array.isArray(n))r.push(...Q(n));else {let o=Q(n);o!==""&&r.push(o);}return r}return e.type===x?{...e,breakContents:Q(e.breakContents),flatContents:Q(e.flatContents)}:e.type===b?{...e,contents:Q(e.contents),expandedStates:(t=e.expandedStates)==null?void 0:t.map(Q)}:e.type===N?{type:"fill",parts:e.parts.map(Q)}:e.contents?{...e,contents:Q(e.contents)}:e}function br(e){let t=Object.create(null),r=new Set;return n(Q(e));function n(u,i,s){var D,a;if(typeof u=="string")return JSON.stringify(u);if(Array.isArray(u)){let c=u.map(n).filter(Boolean);return c.length===1?c[0]:`[${c.join(", ")}]`}if(u.type===B){let c=((D=s==null?void 0:s[i+1])==null?void 0:D.type)===w;return u.literal?c?"literalline":"literallineWithoutBreakParent":u.hard?c?"hardline":"hardlineWithoutBreakParent":u.soft?"softline":"line"}if(u.type===w)return ((a=s==null?void 0:s[i-1])==null?void 0:a.type)===B&&s[i-1].hard?void 0:"breakParent";if(u.type===I)return "trim";if(u.type===P)return "indent("+n(u.contents)+")";if(u.type===L)return u.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(u.contents)+")":u.n<0?"dedent("+n(u.contents)+")":u.n.type==="root"?"markAsRoot("+n(u.contents)+")":"align("+JSON.stringify(u.n)+", "+n(u.contents)+")";if(u.type===x)return "ifBreak("+n(u.breakContents)+(u.flatContents?", "+n(u.flatContents):"")+(u.groupId?(u.flatContents?"":', ""')+`, { groupId: ${o(u.groupId)} }`:"")+")";if(u.type===R){let c=[];u.negate&&c.push("negate: true"),u.groupId&&c.push(`groupId: ${o(u.groupId)}`);let p=c.length>0?`, { ${c.join(", ")} }`:"";return `indentIfBreak(${n(u.contents)}${p})`}if(u.type===b){let c=[];u.break&&u.break!=="propagated"&&c.push("shouldBreak: true"),u.id&&c.push(`id: ${o(u.id)}`);let p=c.length>0?`, { ${c.join(", ")} }`:"";return u.expandedStates?`conditionalGroup([${u.expandedStates.map(f=>n(f)).join(",")}]${p})`:`group(${n(u.contents)}${p})`}if(u.type===N)return `fill([${u.parts.map(c=>n(c)).join(", ")}])`;if(u.type===Y)return "lineSuffix("+n(u.contents)+")";if(u.type===j)return "lineSuffixBoundary";if(u.type===T)return `label(${JSON.stringify(u.label)}, ${n(u.contents)})`;throw new Error("Unknown doc type "+u.type)}function o(u){if(typeof u!="symbol")return JSON.stringify(String(u));if(u in t)return t[u];let i=u.description||"symbol";for(let s=0;;s++){let D=i+(s>0?` #${s}`:"");if(!r.has(D))return r.add(D),t[u]=`Symbol.for(${JSON.stringify(D)})`}}}var Pu=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},y=Pu;var xr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function kr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function wr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Or=e=>!(kr(e)||wr(e));var Lu=/[^\x20-\x7F]/;function Iu(e){if(!e)return 0;if(!Lu.test(e))return e.length;e=e.replace(xr()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=Or(n)?1:2);}return t}var Te=Iu;function ve(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=o(u);return r.set(u,i),i}function o(u){switch(K(u)){case V:return t(u.map(n));case N:return t({...u,parts:u.parts.map(n)});case x:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case b:{let{expandedStates:i,contents:s}=u;return i?(i=i.map(n),s=i[0]):s=n(s),t({...u,contents:s,expandedStates:i})}case L:case P:case R:case T:case Y:return t({...u,contents:n(u.contents)});case G:case z:case I:case j:case B:case w:return t(u);default:throw new Z(u)}}}function Je(e,t,r){let n=r,o=!1;function u(i){if(o)return !1;let s=t(i);s!==void 0&&(o=!0,n=s);}return xe(e,u),n}function Ru(e){if(e.type===b&&e.break||e.type===B&&e.hard||e.type===w)return !0}function Sr(e){return Je(e,Ru,!1)}function Nr(e){if(e.length>0){let t=y(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated");}return null}function vr(e){let t=new Set,r=[];function n(u){if(u.type===w&&Nr(r),u.type===b){if(r.push(u),t.has(u))return !1;t.add(u);}}function o(u){u.type===b&&r.pop().break&&Nr(r);}xe(e,n,o,!0);}function Yu(e){return e.type===B&&!e.hard?e.soft?"":" ":e.type===x?e.flatContents:e}function Pr(e){return ve(e,Yu)}function Tr(e){for(e=[...e];e.length>=2&&y(!1,e,-2).type===B&&y(!1,e,-1).type===w;)e.length-=2;if(e.length>0){let t=Se(y(!1,e,-1));e[e.length-1]=t;}return e}function Se(e){switch(K(e)){case P:case R:case b:case Y:case T:{let t=Se(e.contents);return {...e,contents:t}}case x:return {...e,breakContents:Se(e.breakContents),flatContents:Se(e.flatContents)};case N:return {...e,parts:Tr(e.parts)};case V:return Tr(e);case G:return e.replace(/[\n\r]*$/,"");case L:case z:case I:case j:case B:case w:break;default:throw new Z(e)}return e}function Xe(e){return Se(Mu(e))}function ju(e){switch(K(e)){case N:if(e.parts.every(t=>t===""))return "";break;case b:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return "";if(e.contents.type===b&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case L:case P:case R:case Y:if(!e.contents)return "";break;case x:if(!e.flatContents&&!e.breakContents)return "";break;case V:{let t=[];for(let r of e){if(!r)continue;let[n,...o]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof y(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...o);}return t.length===0?"":t.length===1?t[0]:t}case G:case z:case I:case j:case B:case T:case w:break;default:throw new Z(e)}return e}function Mu(e){return ve(e,t=>ju(t))}function Lr(e,t=He){return ve(e,r=>typeof r=="string"?Ne(t,r.split(`
|
|
30048
|
-
`)):r)}function
|
|
30049
|
-
`?
|
|
30050
|
-
`,o):
|
|
29428
|
+
`}}function wt(e,t){let r;switch(t){case`
|
|
29429
|
+
`:r=/\n/gu;break;case"\r":r=/\r/gu;break;case`\r
|
|
29430
|
+
`:r=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let n=e.match(r);return n?n.length:0}function mr(e){return ne(!1,e,/\r\n?/gu,`
|
|
29431
|
+
`)}var U="string",W="array",z="cursor",L="indent",P="align",I="trim",x="group",S="fill",_="if-break",R="indent-if-break",Y="line-suffix",j="line-suffix-boundary",B="line",N="label",b="break-parent",Ue=new Set([z,L,P,I,x,S,_,R,Y,j,B,N,b]);function Lu(e){if(typeof e=="string")return U;if(Array.isArray(e))return W;if(!e)return;let{type:t}=e;if(Ue.has(t))return t}var G=Lu;var Pu=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Iu(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return `Unexpected doc '${t}',
|
|
29432
|
+
Expected it to be 'string' or 'object'.`;if(G(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return `Unexpected doc '${r}'.`;let n=Pu([...Ue].map(o=>`'${o}'`));return `Unexpected doc.type '${e.type}'.
|
|
29433
|
+
Expected it to be ${n}.`}var xt=class extends Error{name="InvalidDocError";constructor(t){super(Iu(t)),this.doc=t;}},Q=xt;var Er={};function Ru(e,t,r,n){let o=[e];for(;o.length>0;){let u=o.pop();if(u===Er){r(o.pop());continue}r&&o.push(u,Er);let i=G(u);if(!i)throw new Q(u);if((t==null?void 0:t(u))!==!1)switch(i){case W:case S:{let s=i===W?u:u.parts;for(let a=s.length,D=a-1;D>=0;--D)o.push(s[D]);break}case _:o.push(u.flatContents,u.breakContents);break;case x:if(n&&u.expandedStates)for(let s=u.expandedStates.length,a=s-1;a>=0;--a)o.push(u.expandedStates[a]);else o.push(u.contents);break;case P:case L:case R:case N:case Y:o.push(u.contents);break;case U:case z:case I:case j:case B:case b:break;default:throw new Q(u)}}}var we=Ru;var hr=()=>{},ze=hr;function De(e){return {type:L,contents:e}}function ae(e,t){return {type:P,contents:t,n:e}}function _t(e,t={}){return ze(t.expandedStates),{type:x,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Cr(e){return ae(Number.NEGATIVE_INFINITY,e)}function gr(e){return ae({type:"root"},e)}function yr(e){return ae(-1,e)}function Ar(e,t){return _t(e[0],{...t,expandedStates:e})}function Ge(e){return {type:S,parts:e}}function Br(e,t="",r={}){return {type:_,breakContents:e,flatContents:t,groupId:r.groupId}}function wr(e,t){return {type:R,contents:e,groupId:t.groupId,negate:t.negate}}function xe(e){return {type:Y,contents:e}}var xr={type:j},de={type:b},_r={type:I},_e={type:B,hard:!0},vt={type:B,hard:!0,literal:!0},Ke={type:B},vr={type:B,soft:!0},q=[_e,de],qe=[vt,de],ve={type:z};function be(e,t){let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function Je(e,t,r){let n=e;if(t>0){for(let o=0;o<Math.floor(t/r);++o)n=De(n);n=ae(t%r,n),n=ae(Number.NEGATIVE_INFINITY,n);}return n}function br(e,t){return e?{type:N,label:e,contents:t}:t}function ee(e){var t;if(!e)return "";if(Array.isArray(e)){let r=[];for(let n of e)if(Array.isArray(n))r.push(...ee(n));else {let o=ee(n);o!==""&&r.push(o);}return r}return e.type===_?{...e,breakContents:ee(e.breakContents),flatContents:ee(e.flatContents)}:e.type===x?{...e,contents:ee(e.contents),expandedStates:(t=e.expandedStates)==null?void 0:t.map(ee)}:e.type===S?{type:"fill",parts:e.parts.map(ee)}:e.contents?{...e,contents:ee(e.contents)}:e}function Or(e){let t=Object.create(null),r=new Set;return n(ee(e));function n(u,i,s){var a,D;if(typeof u=="string")return JSON.stringify(u);if(Array.isArray(u)){let l=u.map(n).filter(Boolean);return l.length===1?l[0]:`[${l.join(", ")}]`}if(u.type===B){let l=((a=s==null?void 0:s[i+1])==null?void 0:a.type)===b;return u.literal?l?"literalline":"literallineWithoutBreakParent":u.hard?l?"hardline":"hardlineWithoutBreakParent":u.soft?"softline":"line"}if(u.type===b)return ((D=s==null?void 0:s[i-1])==null?void 0:D.type)===B&&s[i-1].hard?void 0:"breakParent";if(u.type===I)return "trim";if(u.type===L)return "indent("+n(u.contents)+")";if(u.type===P)return u.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(u.contents)+")":u.n<0?"dedent("+n(u.contents)+")":u.n.type==="root"?"markAsRoot("+n(u.contents)+")":"align("+JSON.stringify(u.n)+", "+n(u.contents)+")";if(u.type===_)return "ifBreak("+n(u.breakContents)+(u.flatContents?", "+n(u.flatContents):"")+(u.groupId?(u.flatContents?"":', ""')+`, { groupId: ${o(u.groupId)} }`:"")+")";if(u.type===R){let l=[];u.negate&&l.push("negate: true"),u.groupId&&l.push(`groupId: ${o(u.groupId)}`);let d=l.length>0?`, { ${l.join(", ")} }`:"";return `indentIfBreak(${n(u.contents)}${d})`}if(u.type===x){let l=[];u.break&&u.break!=="propagated"&&l.push("shouldBreak: true"),u.id&&l.push(`id: ${o(u.id)}`);let d=l.length>0?`, { ${l.join(", ")} }`:"";return u.expandedStates?`conditionalGroup([${u.expandedStates.map(f=>n(f)).join(",")}]${d})`:`group(${n(u.contents)}${d})`}if(u.type===S)return `fill([${u.parts.map(l=>n(l)).join(", ")}])`;if(u.type===Y)return "lineSuffix("+n(u.contents)+")";if(u.type===j)return "lineSuffixBoundary";if(u.type===N)return `label(${JSON.stringify(u.label)}, ${n(u.contents)})`;throw new Error("Unknown doc type "+u.type)}function o(u){if(typeof u!="symbol")return JSON.stringify(String(u));if(u in t)return t[u];let i=u.description||"symbol";for(let s=0;;s++){let a=i+(s>0?` #${s}`:"");if(!r.has(a))return r.add(a),t[u]=`Symbol.for(${JSON.stringify(a)})`}}}var Yu=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},y=Yu;var Sr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Nr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Tr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var kr=e=>!(Nr(e)||Tr(e));var ju=/[^\x20-\x7F]/u;function Hu(e){if(!e)return 0;if(!ju.test(e))return e.length;e=e.replace(Sr()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=kr(n)?1:2);}return t}var Oe=Hu;function Ne(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=o(u);return r.set(u,i),i}function o(u){switch(G(u)){case W:return t(u.map(n));case S:return t({...u,parts:u.parts.map(n)});case _:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case x:{let{expandedStates:i,contents:s}=u;return i?(i=i.map(n),s=i[0]):s=n(s),t({...u,contents:s,expandedStates:i})}case P:case L:case R:case N:case Y:return t({...u,contents:n(u.contents)});case U:case z:case I:case j:case B:case b:return t(u);default:throw new Q(u)}}}function Xe(e,t,r){let n=r,o=!1;function u(i){if(o)return !1;let s=t(i);s!==void 0&&(o=!0,n=s);}return we(e,u),n}function Wu(e){if(e.type===x&&e.break||e.type===B&&e.hard||e.type===b)return !0}function Ir(e){return Xe(e,Wu,!1)}function Lr(e){if(e.length>0){let t=y(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated");}return null}function Rr(e){let t=new Set,r=[];function n(u){if(u.type===b&&Lr(r),u.type===x){if(r.push(u),t.has(u))return !1;t.add(u);}}function o(u){u.type===x&&r.pop().break&&Lr(r);}we(e,n,o,!0);}function Mu(e){return e.type===B&&!e.hard?e.soft?"":" ":e.type===_?e.flatContents:e}function Yr(e){return Ne(e,Mu)}function Pr(e){for(e=[...e];e.length>=2&&y(!1,e,-2).type===B&&y(!1,e,-1).type===b;)e.length-=2;if(e.length>0){let t=Se(y(!1,e,-1));e[e.length-1]=t;}return e}function Se(e){switch(G(e)){case L:case R:case x:case Y:case N:{let t=Se(e.contents);return {...e,contents:t}}case _:return {...e,breakContents:Se(e.breakContents),flatContents:Se(e.flatContents)};case S:return {...e,parts:Pr(e.parts)};case W:return Pr(e);case U:return e.replace(/[\n\r]*$/u,"");case P:case z:case I:case j:case B:case b:break;default:throw new Q(e)}return e}function Ze(e){return Se(Vu(e))}function $u(e){switch(G(e)){case S:if(e.parts.every(t=>t===""))return "";break;case x:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return "";if(e.contents.type===x&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case P:case L:case R:case Y:if(!e.contents)return "";break;case _:if(!e.flatContents&&!e.breakContents)return "";break;case W:{let t=[];for(let r of e){if(!r)continue;let[n,...o]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof y(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...o);}return t.length===0?"":t.length===1?t[0]:t}case U:case z:case I:case j:case B:case N:case b:break;default:throw new Q(e)}return e}function Vu(e){return Ne(e,t=>$u(t))}function jr(e,t=qe){return Ne(e,r=>typeof r=="string"?be(t,r.split(`
|
|
29434
|
+
`)):r)}function Uu(e){if(e.type===B)return !0}function Hr(e){return Xe(e,Uu,!1)}function Qe(e,t){return e.type===N?{...e,contents:t(e.contents)}:t(e)}var H=Symbol("MODE_BREAK"),J=Symbol("MODE_FLAT"),Te=Symbol("cursor");function Wr(){return {value:"",length:0,queue:[]}}function zu(e,t){return bt(e,{type:"indent"},t)}function Gu(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Wr():t<0?bt(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:bt(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function bt(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],o="",u=0,i=0,s=0;for(let c of n)switch(c.type){case"indent":l(),r.useTabs?a(1):D(r.tabWidth);break;case"stringAlign":l(),o+=c.n,u+=c.n.length;break;case"numberAlign":i+=1,s+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return f(),{...e,value:o,length:u,queue:n};function a(c){o+=" ".repeat(c),u+=r.tabWidth*c;}function D(c){o+=" ".repeat(c),u+=c;}function l(){r.useTabs?d():f();}function d(){i>0&&a(i),p();}function f(){s>0&&D(s),p();}function p(){i=0,s=0;}}function Ot(e){let t=0,r=0,n=e.length;e:for(;n--;){let o=e[n];if(o===Te){r++;continue}for(let u=o.length-1;u>=0;u--){let i=o[u];if(i===" "||i===" ")t++;else {e[n]=o.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Te);return t}function et(e,t,r,n,o,u){if(r===Number.POSITIVE_INFINITY)return !0;let i=t.length,s=[e],a=[];for(;r>=0;){if(s.length===0){if(i===0)return !0;s.push(t[--i]);continue}let{mode:D,doc:l}=s.pop(),d=G(l);switch(d){case U:a.push(l),r-=Oe(l);break;case W:case S:{let f=d===W?l:l.parts;for(let p=f.length-1;p>=0;p--)s.push({mode:D,doc:f[p]});break}case L:case P:case R:case N:s.push({mode:D,doc:l.contents});break;case I:r+=Ot(a);break;case x:{if(u&&l.break)return !1;let f=l.break?H:D,p=l.expandedStates&&f===H?y(!1,l.expandedStates,-1):l.contents;s.push({mode:f,doc:p});break}case _:{let p=(l.groupId?o[l.groupId]||J:D)===H?l.breakContents:l.flatContents;p&&s.push({mode:D,doc:p});break}case B:if(D===H||l.hard)return !0;l.soft||(a.push(" "),r--);break;case Y:n=!0;break;case j:if(n)return !1;break}}return !1}function Fe(e,t){let r={},n=t.printWidth,o=Be(t.endOfLine),u=0,i=[{ind:Wr(),mode:H,doc:e}],s=[],a=!1,D=[],l=0;for(Rr(e);i.length>0;){let{ind:f,mode:p,doc:c}=i.pop();switch(G(c)){case U:{let F=o!==`
|
|
29435
|
+
`?ne(!1,c,`
|
|
29436
|
+
`,o):c;s.push(F),i.length>0&&(u+=Oe(F));break}case W:for(let F=c.length-1;F>=0;F--)i.push({ind:f,mode:p,doc:c[F]});break;case z:if(l>=2)throw new Error("There are too many 'cursor' in doc.");s.push(Te),l++;break;case L:i.push({ind:zu(f,t),mode:p,doc:c.contents});break;case P:i.push({ind:Gu(f,c.n,t),mode:p,doc:c.contents});break;case I:u-=Ot(s);break;case x:switch(p){case J:if(!a){i.push({ind:f,mode:c.break?H:J,doc:c.contents});break}case H:{a=!1;let F={ind:f,mode:J,doc:c.contents},m=n-u,E=D.length>0;if(!c.break&&et(F,i,m,E,r))i.push(F);else if(c.expandedStates){let A=y(!1,c.expandedStates,-1);if(c.break){i.push({ind:f,mode:H,doc:A});break}else for(let w=1;w<c.expandedStates.length+1;w++)if(w>=c.expandedStates.length){i.push({ind:f,mode:H,doc:A});break}else {let h=c.expandedStates[w],C={ind:f,mode:J,doc:h};if(et(C,i,m,E,r)){i.push(C);break}}}else i.push({ind:f,mode:H,doc:c.contents});break}}c.id&&(r[c.id]=y(!1,i,-1).mode);break;case S:{let F=n-u,{parts:m}=c;if(m.length===0)break;let[E,A]=m,w={ind:f,mode:J,doc:E},h={ind:f,mode:H,doc:E},C=et(w,[],F,D.length>0,r,!0);if(m.length===1){C?i.push(w):i.push(h);break}let k={ind:f,mode:J,doc:A},v={ind:f,mode:H,doc:A};if(m.length===2){C?i.push(k,w):i.push(v,h);break}m.splice(0,2);let $={ind:f,mode:p,doc:Ge(m)},ye=m[0];et({ind:f,mode:J,doc:[E,A,ye]},[],F,D.length>0,r,!0)?i.push($,k,w):C?i.push($,v,w):i.push($,v,h);break}case _:case R:{let F=c.groupId?r[c.groupId]:p;if(F===H){let m=c.type===_?c.breakContents:c.negate?c.contents:De(c.contents);m&&i.push({ind:f,mode:p,doc:m});}if(F===J){let m=c.type===_?c.flatContents:c.negate?De(c.contents):c.contents;m&&i.push({ind:f,mode:p,doc:m});}break}case Y:D.push({ind:f,mode:p,doc:c.contents});break;case j:D.length>0&&i.push({ind:f,mode:p,doc:_e});break;case B:switch(p){case J:if(c.hard)a=!0;else {c.soft||(s.push(" "),u+=1);break}case H:if(D.length>0){i.push({ind:f,mode:p,doc:c},...D.reverse()),D.length=0;break}c.literal?f.root?(s.push(o,f.root.value),u=f.root.length):(s.push(o),u=0):(u-=Ot(s),s.push(o+f.value),u=f.length);break}break;case N:i.push({ind:f,mode:p,doc:c.contents});break;case b:break;default:throw new Q(c)}i.length===0&&D.length>0&&(i.push(...D.reverse()),D.length=0);}let d=s.indexOf(Te);if(d!==-1){let f=s.indexOf(Te,d+1),p=s.slice(0,d).join(""),c=s.slice(d+1,f).join(""),F=s.slice(f+1).join("");return {formatted:p+c+F,cursorNodeStart:p.length,cursorNodeText:c}}return {formatted:s.join("")}}function Ku(e,t,r=0){let n=0;for(let o=r;o<e.length;++o)e[o]===" "?n=n+t-n%t:n++;return n}var me=Ku;var te,Nt,tt,St=class{constructor(t){Dr(this,te);this.stack=[t];}get key(){let{stack:t,siblings:r}=this;return y(!1,t,r===null?-2:-4)??null}get index(){return this.siblings===null?null:y(!1,this.stack,-2)}get node(){return y(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:t}=this,r=y(!1,t,-3);return Array.isArray(r)?r:null}get next(){let{siblings:t}=this;return t===null?null:t[this.index+1]}get previous(){let{siblings:t}=this;return t===null?null:t[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:t,index:r}=this;return t!==null&&r===t.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return [...pe(this,te,tt).call(this)]}getName(){let{stack:t}=this,{length:r}=t;return r>1?y(!1,t,-2):null}getValue(){return y(!1,this.stack,-1)}getNode(t=0){let r=pe(this,te,Nt).call(this,t);return r===-1?null:this.stack[r]}getParentNode(t=0){return this.getNode(t+1)}call(t,...r){let{stack:n}=this,{length:o}=n,u=y(!1,n,-1);for(let i of r)u=u[i],n.push(i,u);try{return t(this)}finally{n.length=o;}}callParent(t,r=0){let n=pe(this,te,Nt).call(this,r+1),o=this.stack.splice(n+1);try{return t(this)}finally{this.stack.push(...o);}}each(t,...r){let{stack:n}=this,{length:o}=n,u=y(!1,n,-1);for(let i of r)u=u[i],n.push(i,u);try{for(let i=0;i<u.length;++i)n.push(i,u[i]),t(this,i,u),n.length-=2;}finally{n.length=o;}}map(t,...r){let n=[];return this.each((o,u,i)=>{n[u]=t(o,u,i);},...r),n}match(...t){let r=this.stack.length-1,n=null,o=this.stack[r--];for(let u of t){if(o===void 0)return !1;let i=null;if(typeof n=="number"&&(i=n,n=this.stack[r--],o=this.stack[r--]),u&&!u(o,n,i))return !1;n=this.stack[r--],o=this.stack[r--];}return !0}findAncestor(t){for(let r of pe(this,te,tt).call(this))if(t(r))return r}hasAncestor(t){for(let r of pe(this,te,tt).call(this))if(t(r))return !0;return !1}};te=new WeakSet,Nt=function(t){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--t<0)return n;return -1},tt=function*(){let{stack:t}=this;for(let r=t.length-3;r>=0;r-=2){let n=t[r];Array.isArray(n)||(yield n);}};var Mr=St;var $r=new Proxy(()=>{},{get:()=>$r}),ke=$r;function qu(e){return e!==null&&typeof e=="object"}var Vr=qu;function*Tt(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,o=u=>Vr(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let s of i)o(s)&&(yield s);else o(i)&&(yield i);}}function*Ur(e,t){let r=[e];for(let n=0;n<r.length;n++){let o=r[n];for(let u of Tt(o,t))yield u,r.push(u);}}function Ee(e){return (t,r,n)=>{let o=!!(n!=null&&n.backwards);if(r===!1)return !1;let{length:u}=t,i=r;for(;i>=0&&i<u;){let s=t.charAt(i);if(e instanceof RegExp){if(!e.test(s))return i}else if(!e.includes(s))return i;o?i--:i++;}return i===-1||i===u?i:!1}}var zr=Ee(/\s/u),T=Ee(" "),rt=Ee(",; "),nt=Ee(/[^\n\r]/u);function Ju(e,t,r){let n=!!(r!=null&&r.backwards);if(t===!1)return !1;let o=e.charAt(t);if(n){if(e.charAt(t-1)==="\r"&&o===`
|
|
30051
29437
|
`)return t-2;if(o===`
|
|
30052
29438
|
`||o==="\r"||o==="\u2028"||o==="\u2029")return t-1}else {if(o==="\r"&&e.charAt(t+1)===`
|
|
30053
29439
|
`)return t+2;if(o===`
|
|
30054
|
-
`||o==="\r"||o==="\u2028"||o==="\u2029")return t+1}return t}var
|
|
29440
|
+
`||o==="\r"||o==="\u2028"||o==="\u2029")return t+1}return t}var M=Ju;function Xu(e,t,r={}){let n=T(e,r.backwards?t-1:t,r),o=M(e,n,r);return n!==o}var V=Xu;function Zu(e){return Array.isArray(e)&&e.length>0}var kt=Zu;var Gr=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),Qu=e=>Object.keys(e).filter(t=>!Gr.has(t));function eo(e){return e?t=>e(t,Gr):Qu}var X=eo;function to(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Lt(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=to(e);}function ue(e,t){t.leading=!0,t.trailing=!1,Lt(e,t);}function re(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Lt(e,t);}function oe(e,t){t.leading=!1,t.trailing=!0,Lt(e,t);}var Pt=new WeakMap;function ut(e,t){if(Pt.has(e))return Pt.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:o},locStart:u,locEnd:i}=t;if(!n)return [];let s=((r==null?void 0:r(e,t))??[...Tt(e,{getVisitorKeys:X(o)})]).flatMap(a=>n(a)?[a]:ut(a,t));return s.sort((a,D)=>u(a)-u(D)||i(a)-i(D)),Pt.set(e,s),s}function qr(e,t,r,n){let{locStart:o,locEnd:u}=r,i=o(t),s=u(t),a=ut(e,r),D,l,d=0,f=a.length;for(;d<f;){let p=d+f>>1,c=a[p],F=o(c),m=u(c);if(F<=i&&s<=m)return qr(c,t,r,c);if(m<=i){D=c,d=p+1;continue}if(s<=F){l=c,f=p;continue}throw new Error("Comment location overlaps with node location")}if((n==null?void 0:n.type)==="TemplateLiteral"){let{quasis:p}=n,c=Rt(p,t,r);D&&Rt(p,D,r)!==c&&(D=null),l&&Rt(p,l,r)!==c&&(l=null);}return {enclosingNode:n,precedingNode:D,followingNode:l}}var It=()=>!1;function Jr(e,t){let{comments:r}=e;if(delete e.comments,!kt(r)||!t.printer.canAttachComment)return;let n=[],{locStart:o,locEnd:u,printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:a}=t,{ownLine:D=It,endOfLine:l=It,remaining:d=It}=s,f=r.map((p,c)=>({...qr(e,p,t),comment:p,text:a,options:t,ast:e,isLastComment:r.length-1===c}));for(let[p,c]of f.entries()){let{comment:F,precedingNode:m,enclosingNode:E,followingNode:A,text:w,options:h,ast:C,isLastComment:k}=c;if(h.parser==="json"||h.parser==="json5"||h.parser==="jsonc"||h.parser==="__js_expression"||h.parser==="__ts_expression"||h.parser==="__vue_expression"||h.parser==="__vue_ts_expression"){if(o(F)-o(C)<=0){ue(C,F);continue}if(u(F)-u(C)>=0){oe(C,F);continue}}let v;if(i?v=[c]:(F.enclosingNode=E,F.precedingNode=m,F.followingNode=A,v=[F,w,h,C,k]),ro(w,h,f,p))F.placement="ownLine",D(...v)||(A?ue(A,F):m?oe(m,F):E?re(E,F):re(C,F));else if(no(w,h,f,p))F.placement="endOfLine",l(...v)||(m?oe(m,F):A?ue(A,F):E?re(E,F):re(C,F));else if(F.placement="remaining",!d(...v))if(m&&A){let $=n.length;$>0&&n[$-1].followingNode!==A&&Kr(n,h),n.push(c);}else m?oe(m,F):A?ue(A,F):E?re(E,F):re(C,F);}if(Kr(n,t),!i)for(let p of r)delete p.precedingNode,delete p.enclosingNode,delete p.followingNode;}var Xr=e=>!/[\S\n\u2028\u2029]/u.test(e);function ro(e,t,r,n){let{comment:o,precedingNode:u}=r[n],{locStart:i,locEnd:s}=t,a=i(o);if(u)for(let D=n-1;D>=0;D--){let{comment:l,precedingNode:d}=r[D];if(d!==u||!Xr(e.slice(s(l),a)))break;a=i(l);}return V(e,a,{backwards:!0})}function no(e,t,r,n){let{comment:o,followingNode:u}=r[n],{locStart:i,locEnd:s}=t,a=s(o);if(u)for(let D=n+1;D<r.length;D++){let{comment:l,followingNode:d}=r[D];if(d!==u||!Xr(e.slice(a,i(l))))break;a=s(l);}return V(e,a)}function Kr(e,t){var s,a;let r=e.length;if(r===0)return;let{precedingNode:n,followingNode:o}=e[0],u=t.locStart(o),i;for(i=r;i>0;--i){let{comment:D,precedingNode:l,followingNode:d}=e[i-1];ke.strictEqual(l,n),ke.strictEqual(d,o);let f=t.originalText.slice(t.locEnd(D),u);if(((a=(s=t.printer).isGap)==null?void 0:a.call(s,f,t))??/^[\s(]*$/u.test(f))u=t.locStart(D);else break}for(let[D,{comment:l}]of e.entries())D<i?oe(n,l):ue(o,l);for(let D of [n,o])D.comments&&D.comments.length>1&&D.comments.sort((l,d)=>t.locStart(l)-t.locStart(d));e.length=0;}function Rt(e,t,r){let n=r.locStart(t)-1;for(let o=1;o<e.length;++o)if(n<r.locStart(e[o]))return o-1;return 0}function uo(e,t){let r=t-1;r=T(e,r,{backwards:!0}),r=M(e,r,{backwards:!0}),r=T(e,r,{backwards:!0});let n=M(e,r,{backwards:!0});return r!==n}var Le=uo;function Zr(e,t){let r=e.node;return r.printed=!0,t.printer.printComment(e,t)}function oo(e,t){var l;let r=e.node,n=[Zr(e,t)],{printer:o,originalText:u,locStart:i,locEnd:s}=t;if((l=o.isBlockComment)==null?void 0:l.call(o,r)){let d=V(u,s(r))?V(u,i(r),{backwards:!0})?q:Ke:" ";n.push(d);}else n.push(q);let D=M(u,T(u,s(r)));return D!==!1&&V(u,D)&&n.push(q),n}function io(e,t,r){var D;let n=e.node,o=Zr(e,t),{printer:u,originalText:i,locStart:s}=t,a=(D=u.isBlockComment)==null?void 0:D.call(u,n);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||V(i,s(n),{backwards:!0})){let l=Le(i,s(n));return {doc:xe([q,l?q:"",o]),isBlock:a,hasLineSuffix:!0}}return !a||r!=null&&r.hasLineSuffix?{doc:[xe([" ",o]),de],isBlock:a,hasLineSuffix:!0}:{doc:[" ",o],isBlock:a,hasLineSuffix:!1}}function so(e,t){let r=e.node;if(!r)return {};let n=t[Symbol.for("printedComments")];if((r.comments||[]).filter(a=>!n.has(a)).length===0)return {leading:"",trailing:""};let u=[],i=[],s;return e.each(()=>{let a=e.node;if(n!=null&&n.has(a))return;let{leading:D,trailing:l}=a;D?u.push(oo(e,t)):l&&(s=io(e,t,s),i.push(s.doc));},"comments"),{leading:u,trailing:i}}function Qr(e,t,r){let{leading:n,trailing:o}=so(e,r);return !n&&!o?t:Qe(t,u=>[n,u,o])}function en(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:r}=e;for(let n of t){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed;}}var Pe=class extends Error{name="ConfigError"},Ie=class extends Error{name="UndefinedParserError"};var rn={cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing
|
|
30055
29441
|
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
|
|
30056
29442
|
The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
|
|
30057
29443
|
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment
|
|
30058
|
-
in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function
|
|
30059
|
-
`)),
|
|
30060
|
-
`)),
|
|
30061
|
-
`,1)[0].length);return o>t&&o>u?n:r}var jt=Ae(ot());var Rt=[],cn=[];function Yt(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let u=0;for(;u<n&&e.charCodeAt(u)===t.charCodeAt(u);)u++;if(n-=u,o-=u,n===0)return o;let i,s,D,a,c=0,p=0;for(;c<n;)cn[c]=e.charCodeAt(u+c),Rt[c]=++c;for(;p<o;)for(i=t.charCodeAt(u+p),D=p++,s=p,c=0;c<n;c++)a=i===cn[c]?D:D+1,D=Rt[c],s=Rt[c]=D>s?a>s?s+1:a:a>D?D+1:a;return s}var st=(e,t,{descriptor:r,logger:n,schemas:o})=>{let u=[`Ignored unknown option ${jt.default.yellow(r.pair({key:e,value:t}))}.`],i=Object.keys(o).sort().find(s=>Yt(e,s)<3);i&&u.push(`Did you mean ${jt.default.blue(r.key(i))}?`),n.warn(u.join(" "));};var co=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function lo(e,t){let r=new e(t),n=Object.create(r);for(let o of co)o in t&&(n[o]=fo(t[o],r,O.prototype[o].length));return n}var O=class{static create(t){return lo(this,t)}constructor(t){this.name=t.name;}default(t){}expected(t){return "nothing"}validate(t,r){return !1}deprecated(t,r){return !1}forward(t,r){}redirect(t,r){}overlap(t,r,n){return t}preprocess(t,r){return t}postprocess(t,r){return Ee}};function fo(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var Dt=class extends O{constructor(t){super(t),this._sourceName=t.sourceName;}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,r){return r.schemas[this._sourceName].validate(t,r)}redirect(t,r){return this._sourceName}};var at$1=class at extends O{expected(){return "anything"}validate(){return !0}};var ct=class extends O{constructor({valueSchema:t,name:r=t.name,...n}){super({...n,name:r}),this._valueSchema=t;}expected(t){let{text:r,list:n}=t.normalizeExpectedResult(this._valueSchema.expected(t));return {text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t,r){if(!Array.isArray(t))return !1;let n=[];for(let o of t){let u=r.normalizeValidateResult(this._valueSchema.validate(o,r),o);u!==!0&&n.push(u.value);}return n.length===0?!0:{value:n}}deprecated(t,r){let n=[];for(let o of t){let u=r.normalizeDeprecatedResult(this._valueSchema.deprecated(o,r),o);u!==!1&&n.push(...u.map(({value:i})=>({value:[i]})));}return n}forward(t,r){let n=[];for(let o of t){let u=r.normalizeForwardResult(this._valueSchema.forward(o,r),o);n.push(...u.map(ln));}return n}redirect(t,r){let n=[],o=[];for(let u of t){let i=r.normalizeRedirectResult(this._valueSchema.redirect(u,r),u);"remain"in i&&n.push(i.remain),o.push(...i.redirect.map(ln));}return n.length===0?{redirect:o}:{redirect:o,remain:n}}overlap(t,r){return t.concat(r)}};function ln({from:e,to:t}){return {from:[e],to:t}}var lt=class extends O{expected(){return "true or false"}validate(t){return typeof t=="boolean"}};function Fn(e,t){let r=Object.create(null);for(let n of e){let o=n[t];if(r[o])throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);r[o]=n;}return r}function pn(e,t){let r=new Map;for(let n of e){let o=n[t];if(r.has(o))throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);r.set(o,n);}return r}function dn(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?!0:(e[r]=!0,!1)}}function mn(e,t){let r=[],n=[];for(let o of e)t(o)?r.push(o):n.push(o);return [r,n]}function En(e){return e===Math.floor(e)}function Cn(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,o=["undefined","object","boolean","number","string"];return r!==n?o.indexOf(r)-o.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function hn(e){return (...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function Mt(e){return e===void 0?{}:e}function Vt(e){if(typeof e=="string")return {text:e};let{text:t,list:r}=e;return Fo((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map(Vt)}}:{text:t}}function $t(e,t){return e===!0?!0:e===!1?{value:t}:e}function Wt(e,t,r=!1){return e===!1?!1:e===!0?r?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function fn(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ft(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>fn(r,t)):[fn(e,t)]}function Ut(e,t){let r=ft(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function Fo(e,t){if(!e)throw new Error(t)}var Ft=class extends O{constructor(t){super(t),this._choices=pn(t.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value");}expected({descriptor:t}){let r=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(Cn).map(t.value),n=r.slice(0,-2),o=r.slice(-2);return {text:n.concat(o.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(t){return this._choices.has(t)}deprecated(t){let r=this._choices.get(t);return r&&r.deprecated?{value:t}:!1}forward(t){let r=this._choices.get(t);return r?r.forward:void 0}redirect(t){let r=this._choices.get(t);return r?r.redirect:void 0}};var pt=class extends O{expected(){return "a number"}validate(t,r){return typeof t=="number"}};var dt=class extends pt{expected(){return "an integer"}validate(t,r){return r.normalizeValidateResult(super.validate(t,r),t)===!0&&En(t)}};var je=class extends O{expected(){return "a string"}validate(t){return typeof t=="string"}};var gn=oe,yn=st,An=sn,Bn=nn;var mt=class{constructor(t,r){let{logger:n=console,loggerPrintWidth:o=80,descriptor:u=gn,unknown:i=yn,invalid:s=An,deprecated:D=Bn,missing:a=()=>!1,required:c=()=>!1,preprocess:p=F=>F,postprocess:f=()=>Ee}=r||{};this._utils={descriptor:u,logger:n||{warn:()=>{}},loggerPrintWidth:o,schemas:Fn(t,"name"),normalizeDefaultResult:Mt,normalizeExpectedResult:Vt,normalizeDeprecatedResult:Wt,normalizeForwardResult:ft,normalizeRedirectResult:Ut,normalizeValidateResult:$t},this._unknownHandler=i,this._invalidHandler=hn(s),this._deprecatedHandler=D,this._identifyMissing=(F,l)=>!(F in l)||a(F,l),this._identifyRequired=c,this._preprocess=p,this._postprocess=f,this.cleanHistory();}cleanHistory(){this._hasDeprecationWarned=dn();}normalize(t){let r={},o=[this._preprocess(t,this._utils)],u=()=>{for(;o.length!==0;){let i=o.shift(),s=this._applyNormalization(i,r);o.push(...s);}};u();for(let i of Object.keys(this._utils.schemas)){let s=this._utils.schemas[i];if(!(i in r)){let D=Mt(s.default(this._utils));"value"in D&&o.push({[i]:D.value});}}u();for(let i of Object.keys(this._utils.schemas)){if(!(i in r))continue;let s=this._utils.schemas[i],D=r[i],a=s.postprocess(D,this._utils);a!==Ee&&(this._applyValidation(a,i,s),r[i]=a);}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(t,r){let n=[],{knownKeys:o,unknownKeys:u}=this._partitionOptionKeys(t);for(let i of o){let s=this._utils.schemas[i],D=s.preprocess(t[i],this._utils);this._applyValidation(D,i,s);let a=({from:F,to:l})=>{n.push(typeof l=="string"?{[l]:F}:{[l.key]:l.value});},c=({value:F,redirectTo:l})=>{let d=Wt(s.deprecated(F,this._utils),D,!0);if(d!==!1)if(d===!0)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,l,this._utils));else for(let{value:m}of d){let E={key:i,value:m};if(!this._hasDeprecationWarned(E)){let A=typeof l=="string"?{key:l,value:m}:l;this._utils.logger.warn(this._deprecatedHandler(E,A,this._utils));}}};ft(s.forward(D,this._utils),D).forEach(a);let f=Ut(s.redirect(D,this._utils),D);if(f.redirect.forEach(a),"remain"in f){let F=f.remain;r[i]=i in r?s.overlap(r[i],F,this._utils):F,c({value:F});}for(let{from:F,to:l}of f.redirect)c({value:F,redirectTo:l});}for(let i of u){let s=t[i];this._applyUnknownHandler(i,s,r,(D,a)=>{n.push({[D]:a});});}return n}_applyRequiredCheck(t){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,t)&&this._identifyRequired(r))throw this._invalidHandler(r,it,this._utils)}_partitionOptionKeys(t){let[r,n]=mn(Object.keys(t).filter(o=>!this._identifyMissing(o,t)),o=>o in this._utils.schemas);return {knownKeys:r,unknownKeys:n}}_applyValidation(t,r,n){let o=$t(n.validate(t,this._utils),t);if(o!==!0)throw this._invalidHandler(r,o.value,this._utils)}_applyUnknownHandler(t,r,n,o){let u=this._unknownHandler(t,r,this._utils);if(u)for(let i of Object.keys(u)){if(this._identifyMissing(i,u))continue;let s=u[i];i in this._utils.schemas?o(i,s):n[i]=s;}}_applyPostprocess(t){let r=this._postprocess(t,this._utils);if(r!==Ee){if(r.delete)for(let n of r.delete)delete t[n];if(r.override){let{knownKeys:n,unknownKeys:o}=this._partitionOptionKeys(r.override);for(let u of n){let i=r.override[u];this._applyValidation(i,u,this._utils.schemas[u]),t[u]=i;}for(let u of o){let i=r.override[u];this._applyUnknownHandler(u,i,t,(s,D)=>{let a=this._utils.schemas[s];this._applyValidation(D,s,a),t[s]=D;});}}}}};var Gt;function mo(e,t,{logger:r=!1,isCLI:n=!1,passThrough:o=!1,FlagSchema:u,descriptor:i}={}){if(n){if(!u)throw new Error("'FlagSchema' option is required.");if(!i)throw new Error("'descriptor' option is required.")}else i=oe;let s=o?Array.isArray(o)?(f,F)=>o.includes(f)?{[f]:F}:void 0:(f,F)=>({[f]:F}):(f,F,l)=>{let{_:d,...m}=l.schemas;return st(f,F,{...l,schemas:m})},D=Eo(t,{isCLI:n,FlagSchema:u}),a=new mt(D,{logger:r,unknown:s,descriptor:i}),c=r!==!1;c&&Gt&&(a._hasDeprecationWarned=Gt);let p=a.normalize(e);return c&&(Gt=a._hasDeprecationWarned),p}function Eo(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(at$1.create({name:"_"}));for(let o of e)n.push(Co(o,{isCLI:t,optionInfos:e,FlagSchema:r})),o.alias&&t&&n.push(Dt.create({name:o.alias,sourceName:o.name}));return n}function Co(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:o}=e,u={name:o},i,s={};switch(e.type){case"int":i=dt,t&&(u.preprocess=Number);break;case"string":i=je;break;case"choice":i=Ft,u.choices=e.choices.map(D=>D!=null&&D.redirect?{...D,redirect:{to:{key:e.name,value:D.redirect}}}:D);break;case"boolean":i=lt;break;case"flag":i=n,u.flags=r.flatMap(D=>[D.alias,D.description&&D.name,D.oppositeDescription&&`no-${D.name}`].filter(Boolean));break;case"path":i=je;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?u.validate=(D,a,c)=>e.exception(D)||a.validate(D,c):u.validate=(D,a,c)=>D===void 0||a.validate(D,c),e.redirect&&(s.redirect=D=>D?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let D=u.preprocess||(a=>a);u.preprocess=(a,c,p)=>c.preprocess(D(Array.isArray(a)?y(!1,a,-1):a),p);}return e.array?ct.create({...t?{preprocess:D=>Array.isArray(D)?D:[D]}:{},...s,valueSchema:i.create(u)}):i.create({...u,...s})}var _n=mo;var ho=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let o=t[n];if(r(o,n,t))return o}}},zt=ho;function Kt(e,t){if(!t)throw new Error("parserName is required.");let r=zt(!1,e,o=>o.parsers&&Object.prototype.hasOwnProperty.call(o.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Re(n)}function bn(e,t){if(!t)throw new Error("astFormat is required.");let r=zt(!1,e,o=>o.printers&&Object.prototype.hasOwnProperty.call(o.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Re(n)}function Et({plugins:e,parser:t}){let r=Kt(e,t);return Ht(r,t)}function Ht(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function xn(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var kn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function go(e,t={}){var p;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=en(r,{physicalFile:r.filepath}),!r.parser)throw new Ye(`No parser could be inferred for file "${r.filepath}".`)}else throw new Ye("No parser and no file path given, couldn't infer a parser.");let n=ut({plugins:e.plugins,showDeprecated:!0}).options,o={...kn,...Object.fromEntries(n.filter(f=>f.default!==void 0).map(f=>[f.name,f.default]))},u=Kt(r.plugins,r.parser),i=await Ht(u,r.parser);r.astFormat=i.astFormat,r.locEnd=i.locEnd,r.locStart=i.locStart;let s=(p=u.printers)!=null&&p[i.astFormat]?u:bn(r.plugins,i.astFormat),D=await xn(s,i.astFormat);r.printer=D;let a=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,f])=>f!==void 0)):{},c={...o,...a};for(let[f,F]of Object.entries(c))(r[f]===null||r[f]===void 0)&&(r[f]=F);return r.parser==="json"&&(r.trailingComma="none"),_n(r,n,{passThrough:Object.keys(kn),...t})}var ie=go;var Mn=Ae(jn());async function Oo(e,t){let r=await Et(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let o;try{o=await r.parse(n,t,t);}catch(u){No(u,e);}return {text:n,ast:o}}function No(e,t){let{loc:r}=e;if(r){let n=(0, Mn.codeFrameColumns)(t,r,{highlightCode:!0});throw e.message+=`
|
|
30062
|
-
`+n,e.codeFrame=n,e}throw e}var ce=
|
|
30063
|
-
`,o)+1),
|
|
30064
|
-
`&&(f+=
|
|
30065
|
-
`)),
|
|
30066
|
-
`,
|
|
30067
|
-
`);r-=s(r),n-=s(n),o-=s(o),e=
|
|
30068
|
-
`);return r===-1?0:
|
|
30069
|
-
`)return !0;return !1}var
|
|
29444
|
+
in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function ot({plugins:e=[],showDeprecated:t=!1}={}){let r=e.flatMap(o=>o.languages??[]),n=[];for(let o of lo(Object.assign({},...e.map(({options:u})=>u),rn)))!t&&o.deprecated||(Array.isArray(o.choices)&&(t||(o.choices=o.choices.filter(u=>!u.deprecated)),o.name==="parser"&&(o.choices=[...o.choices,...Do(o.choices,r,e)])),o.pluginDefaults=Object.fromEntries(e.filter(u=>{var i;return ((i=u.defaultOptions)==null?void 0:i[o.name])!==void 0}).map(u=>[u.name,u.defaultOptions[o.name]])),n.push(o));return {languages:r,options:n}}function*Do(e,t,r){let n=new Set(e.map(o=>o.value));for(let o of t)if(o.parsers){for(let u of o.parsers)if(!n.has(u)){n.add(u);let i=r.find(a=>a.parsers&&Object.prototype.hasOwnProperty.call(a.parsers,u)),s=o.name;i!=null&&i.name&&(s+=` (plugin: ${i.name})`),yield {value:u,description:s};}}}function lo(e){let t=[];for(let[r,n]of Object.entries(e)){let o={name:r,...n};Array.isArray(o.default)&&(o.default=y(!1,o.default,-1).value),t.push(o);}return t}var co=e=>String(e).split(/[/\\]/u).pop();function nn(e,t){if(!t)return;let r=co(t).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(o=>o.toLowerCase()===r))??e.find(({extensions:n})=>n==null?void 0:n.some(o=>r.endsWith(o)))}function fo(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r==null?void 0:r.includes(t))??e.find(({extensions:r})=>r==null?void 0:r.includes(`.${t}`))}function po(e,t){let r=e.plugins.flatMap(o=>o.languages??[]),n=fo(r,t.language)??nn(r,t.physicalFile)??nn(r,t.file)??(t.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var un=po;var ie={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return `[${e.map(r=>ie.value(r)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(r=>`${ie.key(r)}: ${ie.value(e[r])}`).join(", ")} }`},pair:({key:e,value:t})=>ie.value({[e]:t})};var Yt=Me(it()),an=(e,t,{descriptor:r})=>{let n=[`${Yt.default.yellow(typeof e=="string"?r.key(e):r.pair(e))} is deprecated`];return t&&n.push(`we now treat it as ${Yt.default.blue(typeof t=="string"?r.key(t):r.pair(t))}`),n.join("; ")+"."};var le=Me(it());var st=Symbol.for("vnopts.VALUE_NOT_EXIST"),he=Symbol.for("vnopts.VALUE_UNCHANGED");var Dn=" ".repeat(2),cn=(e,t,r)=>{let{text:n,list:o}=r.normalizeExpectedResult(r.schemas[e].expected(r)),u=[];return n&&u.push(ln(e,t,n,r.descriptor)),o&&u.push([ln(e,t,o.title,r.descriptor)].concat(o.values.map(i=>fn(i,r.loggerPrintWidth))).join(`
|
|
29445
|
+
`)),pn(u,r.loggerPrintWidth)};function ln(e,t,r,n){return [`Invalid ${le.default.red(n.key(e))} value.`,`Expected ${le.default.blue(r)},`,`but received ${t===st?le.default.gray("nothing"):le.default.red(n.value(t))}.`].join(" ")}function fn({text:e,list:t},r){let n=[];return e&&n.push(`- ${le.default.blue(e)}`),t&&n.push([`- ${le.default.blue(t.title)}:`].concat(t.values.map(o=>fn(o,r-Dn.length).replace(/^|\n/g,`$&${Dn}`))).join(`
|
|
29446
|
+
`)),pn(n,r)}function pn(e,t){if(e.length===1)return e[0];let[r,n]=e,[o,u]=e.map(i=>i.split(`
|
|
29447
|
+
`,1)[0].length);return o>t&&o>u?n:r}var Wt=Me(it());var jt=[],dn=[];function Ht(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let u=0;for(;u<n&&e.charCodeAt(u)===t.charCodeAt(u);)u++;if(n-=u,o-=u,n===0)return o;let i,s,a,D,l=0,d=0;for(;l<n;)dn[l]=e.charCodeAt(u+l),jt[l]=++l;for(;d<o;)for(i=t.charCodeAt(u+d),a=d++,s=d,l=0;l<n;l++)D=i===dn[l]?a:a+1,a=jt[l],s=jt[l]=a>s?D>s?s+1:D:D>a?a+1:D;return s}var at$1=(e,t,{descriptor:r,logger:n,schemas:o})=>{let u=[`Ignored unknown option ${Wt.default.yellow(r.pair({key:e,value:t}))}.`],i=Object.keys(o).sort().find(s=>Ht(e,s)<3);i&&u.push(`Did you mean ${Wt.default.blue(r.key(i))}?`),n.warn(u.join(" "));};var Fo=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function mo(e,t){let r=new e(t),n=Object.create(r);for(let o of Fo)o in t&&(n[o]=Eo(t[o],r,O.prototype[o].length));return n}var O=class{static create(t){return mo(this,t)}constructor(t){this.name=t.name;}default(t){}expected(t){return "nothing"}validate(t,r){return !1}deprecated(t,r){return !1}forward(t,r){}redirect(t,r){}overlap(t,r,n){return t}preprocess(t,r){return t}postprocess(t,r){return he}};function Eo(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var Dt=class extends O{constructor(t){super(t),this._sourceName=t.sourceName;}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,r){return r.schemas[this._sourceName].validate(t,r)}redirect(t,r){return this._sourceName}};var lt=class extends O{expected(){return "anything"}validate(){return !0}};var ct=class extends O{constructor({valueSchema:t,name:r=t.name,...n}){super({...n,name:r}),this._valueSchema=t;}expected(t){let{text:r,list:n}=t.normalizeExpectedResult(this._valueSchema.expected(t));return {text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t,r){if(!Array.isArray(t))return !1;let n=[];for(let o of t){let u=r.normalizeValidateResult(this._valueSchema.validate(o,r),o);u!==!0&&n.push(u.value);}return n.length===0?!0:{value:n}}deprecated(t,r){let n=[];for(let o of t){let u=r.normalizeDeprecatedResult(this._valueSchema.deprecated(o,r),o);u!==!1&&n.push(...u.map(({value:i})=>({value:[i]})));}return n}forward(t,r){let n=[];for(let o of t){let u=r.normalizeForwardResult(this._valueSchema.forward(o,r),o);n.push(...u.map(Fn));}return n}redirect(t,r){let n=[],o=[];for(let u of t){let i=r.normalizeRedirectResult(this._valueSchema.redirect(u,r),u);"remain"in i&&n.push(i.remain),o.push(...i.redirect.map(Fn));}return n.length===0?{redirect:o}:{redirect:o,remain:n}}overlap(t,r){return t.concat(r)}};function Fn({from:e,to:t}){return {from:[e],to:t}}var ft=class extends O{expected(){return "true or false"}validate(t){return typeof t=="boolean"}};function En(e,t){let r=Object.create(null);for(let n of e){let o=n[t];if(r[o])throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);r[o]=n;}return r}function hn(e,t){let r=new Map;for(let n of e){let o=n[t];if(r.has(o))throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);r.set(o,n);}return r}function Cn(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?!0:(e[r]=!0,!1)}}function gn(e,t){let r=[],n=[];for(let o of e)t(o)?r.push(o):n.push(o);return [r,n]}function yn(e){return e===Math.floor(e)}function An(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,o=["undefined","object","boolean","number","string"];return r!==n?o.indexOf(r)-o.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function Bn(e){return (...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function Mt(e){return e===void 0?{}:e}function $t(e){if(typeof e=="string")return {text:e};let{text:t,list:r}=e;return ho((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map($t)}}:{text:t}}function Vt(e,t){return e===!0?!0:e===!1?{value:t}:e}function Ut(e,t,r=!1){return e===!1?!1:e===!0?r?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function mn(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function pt(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>mn(r,t)):[mn(e,t)]}function zt(e,t){let r=pt(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function ho(e,t){if(!e)throw new Error(t)}var dt=class extends O{constructor(t){super(t),this._choices=hn(t.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value");}expected({descriptor:t}){let r=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(An).map(t.value),n=r.slice(0,-2),o=r.slice(-2);return {text:n.concat(o.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(t){return this._choices.has(t)}deprecated(t){let r=this._choices.get(t);return r&&r.deprecated?{value:t}:!1}forward(t){let r=this._choices.get(t);return r?r.forward:void 0}redirect(t){let r=this._choices.get(t);return r?r.redirect:void 0}};var Ft=class extends O{expected(){return "a number"}validate(t,r){return typeof t=="number"}};var mt=class extends Ft{expected(){return "an integer"}validate(t,r){return r.normalizeValidateResult(super.validate(t,r),t)===!0&&yn(t)}};var Re=class extends O{expected(){return "a string"}validate(t){return typeof t=="string"}};var wn=ie,xn=at$1,_n=cn,vn=an;var Et=class{constructor(t,r){let{logger:n=console,loggerPrintWidth:o=80,descriptor:u=wn,unknown:i=xn,invalid:s=_n,deprecated:a=vn,missing:D=()=>!1,required:l=()=>!1,preprocess:d=p=>p,postprocess:f=()=>he}=r||{};this._utils={descriptor:u,logger:n||{warn:()=>{}},loggerPrintWidth:o,schemas:En(t,"name"),normalizeDefaultResult:Mt,normalizeExpectedResult:$t,normalizeDeprecatedResult:Ut,normalizeForwardResult:pt,normalizeRedirectResult:zt,normalizeValidateResult:Vt},this._unknownHandler=i,this._invalidHandler=Bn(s),this._deprecatedHandler=a,this._identifyMissing=(p,c)=>!(p in c)||D(p,c),this._identifyRequired=l,this._preprocess=d,this._postprocess=f,this.cleanHistory();}cleanHistory(){this._hasDeprecationWarned=Cn();}normalize(t){let r={},o=[this._preprocess(t,this._utils)],u=()=>{for(;o.length!==0;){let i=o.shift(),s=this._applyNormalization(i,r);o.push(...s);}};u();for(let i of Object.keys(this._utils.schemas)){let s=this._utils.schemas[i];if(!(i in r)){let a=Mt(s.default(this._utils));"value"in a&&o.push({[i]:a.value});}}u();for(let i of Object.keys(this._utils.schemas)){if(!(i in r))continue;let s=this._utils.schemas[i],a=r[i],D=s.postprocess(a,this._utils);D!==he&&(this._applyValidation(D,i,s),r[i]=D);}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(t,r){let n=[],{knownKeys:o,unknownKeys:u}=this._partitionOptionKeys(t);for(let i of o){let s=this._utils.schemas[i],a=s.preprocess(t[i],this._utils);this._applyValidation(a,i,s);let D=({from:p,to:c})=>{n.push(typeof c=="string"?{[c]:p}:{[c.key]:c.value});},l=({value:p,redirectTo:c})=>{let F=Ut(s.deprecated(p,this._utils),a,!0);if(F!==!1)if(F===!0)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,c,this._utils));else for(let{value:m}of F){let E={key:i,value:m};if(!this._hasDeprecationWarned(E)){let A=typeof c=="string"?{key:c,value:m}:c;this._utils.logger.warn(this._deprecatedHandler(E,A,this._utils));}}};pt(s.forward(a,this._utils),a).forEach(D);let f=zt(s.redirect(a,this._utils),a);if(f.redirect.forEach(D),"remain"in f){let p=f.remain;r[i]=i in r?s.overlap(r[i],p,this._utils):p,l({value:p});}for(let{from:p,to:c}of f.redirect)l({value:p,redirectTo:c});}for(let i of u){let s=t[i];this._applyUnknownHandler(i,s,r,(a,D)=>{n.push({[a]:D});});}return n}_applyRequiredCheck(t){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,t)&&this._identifyRequired(r))throw this._invalidHandler(r,st,this._utils)}_partitionOptionKeys(t){let[r,n]=gn(Object.keys(t).filter(o=>!this._identifyMissing(o,t)),o=>o in this._utils.schemas);return {knownKeys:r,unknownKeys:n}}_applyValidation(t,r,n){let o=Vt(n.validate(t,this._utils),t);if(o!==!0)throw this._invalidHandler(r,o.value,this._utils)}_applyUnknownHandler(t,r,n,o){let u=this._unknownHandler(t,r,this._utils);if(u)for(let i of Object.keys(u)){if(this._identifyMissing(i,u))continue;let s=u[i];i in this._utils.schemas?o(i,s):n[i]=s;}}_applyPostprocess(t){let r=this._postprocess(t,this._utils);if(r!==he){if(r.delete)for(let n of r.delete)delete t[n];if(r.override){let{knownKeys:n,unknownKeys:o}=this._partitionOptionKeys(r.override);for(let u of n){let i=r.override[u];this._applyValidation(i,u,this._utils.schemas[u]),t[u]=i;}for(let u of o){let i=r.override[u];this._applyUnknownHandler(u,i,t,(s,a)=>{let D=this._utils.schemas[s];this._applyValidation(a,s,D),t[s]=a;});}}}}};var Gt;function go(e,t,{logger:r=!1,isCLI:n=!1,passThrough:o=!1,FlagSchema:u,descriptor:i}={}){if(n){if(!u)throw new Error("'FlagSchema' option is required.");if(!i)throw new Error("'descriptor' option is required.")}else i=ie;let s=o?Array.isArray(o)?(f,p)=>o.includes(f)?{[f]:p}:void 0:(f,p)=>({[f]:p}):(f,p,c)=>{let{_:F,...m}=c.schemas;return at$1(f,p,{...c,schemas:m})},a=yo(t,{isCLI:n,FlagSchema:u}),D=new Et(a,{logger:r,unknown:s,descriptor:i}),l=r!==!1;l&&Gt&&(D._hasDeprecationWarned=Gt);let d=D.normalize(e);return l&&(Gt=D._hasDeprecationWarned),d}function yo(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(lt.create({name:"_"}));for(let o of e)n.push(Ao(o,{isCLI:t,optionInfos:e,FlagSchema:r})),o.alias&&t&&n.push(Dt.create({name:o.alias,sourceName:o.name}));return n}function Ao(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:o}=e,u={name:o},i,s={};switch(e.type){case"int":i=mt,t&&(u.preprocess=Number);break;case"string":i=Re;break;case"choice":i=dt,u.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case"boolean":i=ft;break;case"flag":i=n,u.flags=r.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case"path":i=Re;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?u.validate=(a,D,l)=>e.exception(a)||D.validate(a,l):u.validate=(a,D,l)=>a===void 0||D.validate(a,l),e.redirect&&(s.redirect=a=>a?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let a=u.preprocess||(D=>D);u.preprocess=(D,l,d)=>l.preprocess(a(Array.isArray(D)?y(!1,D,-1):D),d);}return e.array?ct.create({...t?{preprocess:a=>Array.isArray(a)?a:[a]}:{},...s,valueSchema:i.create(u)}):i.create({...u,...s})}var bn=go;var Bo=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let o=t[n];if(r(o,n,t))return o}}},Kt=Bo;function qt(e,t){if(!t)throw new Error("parserName is required.");let r=Kt(!1,e,o=>o.parsers&&Object.prototype.hasOwnProperty.call(o.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Pe(n)}function On(e,t){if(!t)throw new Error("astFormat is required.");let r=Kt(!1,e,o=>o.printers&&Object.prototype.hasOwnProperty.call(o.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Pe(n)}function ht({plugins:e,parser:t}){let r=qt(e,t);return Jt(r,t)}function Jt(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function Sn(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var Nn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function wo(e,t={}){var d;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=un(r,{physicalFile:r.filepath}),!r.parser)throw new Ie(`No parser could be inferred for file "${r.filepath}".`)}else throw new Ie("No parser and no file path given, couldn't infer a parser.");let n=ot({plugins:e.plugins,showDeprecated:!0}).options,o={...Nn,...Object.fromEntries(n.filter(f=>f.default!==void 0).map(f=>[f.name,f.default]))},u=qt(r.plugins,r.parser),i=await Jt(u,r.parser);r.astFormat=i.astFormat,r.locEnd=i.locEnd,r.locStart=i.locStart;let s=(d=u.printers)!=null&&d[i.astFormat]?u:On(r.plugins,i.astFormat),a=await Sn(s,i.astFormat);r.printer=a;let D=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,f])=>f!==void 0)):{},l={...o,...D};for(let[f,p]of Object.entries(l))(r[f]===null||r[f]===void 0)&&(r[f]=p);return r.parser==="json"&&(r.trailingComma="none"),bn(r,n,{passThrough:Object.keys(Nn),...t})}var se=wo;var Vn=Me($n());async function ko(e,t){let r=await ht(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let o;try{o=await r.parse(n,t,t);}catch(u){Lo(u,e);}return {text:n,ast:o}}function Lo(e,t){let{loc:r}=e;if(r){let n=(0, Vn.codeFrameColumns)(t,r,{highlightCode:!0});throw e.message+=`
|
|
29448
|
+
`+n,e.codeFrame=n,e}throw e}var ce=ko;async function Un(e,t,r,n,o){let{embeddedLanguageFormatting:u,printer:{embed:i,hasPrettierIgnore:s=()=>!1,getVisitorKeys:a}}=r;if(!i||u!=="auto")return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed");let D=X(i.getVisitorKeys??a),l=[];p();let d=e.stack;for(let{print:c,node:F,pathStack:m}of l)try{e.stack=m;let E=await c(f,t,e,r);E&&o.set(F,E);}catch(E){if(globalThis.PRETTIER_DEBUG)throw E}e.stack=d;function f(c,F){return Po(c,F,r,n)}function p(){let{node:c}=e;if(c===null||typeof c!="object"||s(e))return;for(let m of D(c))Array.isArray(c[m])?e.each(p,m):e.call(p,m);let F=i(e,r);if(F){if(typeof F=="function"){l.push({print:F,node:c,pathStack:[...e.stack]});return}o.set(c,F);}}}async function Po(e,t,r,n){let o=await se({...r,...t,parentParser:r.parser,originalText:e},{passThrough:!0}),{ast:u}=await ce(e,o),i=await n(u,o);return Ze(i)}function Io(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:o,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:s}=e,a=o(s),D=u(s);for(let l of n)o(l)>=a&&u(l)<=D&&i.add(l);return r.slice(a,D)}var zn=Io;async function Ye(e,t){({ast:e}=await Qt(e,t));let r=new Map,n=new Mr(e),u=new Map;await Un(n,s,t,Ye,u);let i=await Gn(n,t,s,void 0,u);return en(t),i;function s(D,l){return D===void 0||D===n?a(l):Array.isArray(D)?n.call(()=>a(l),...D):n.call(()=>a(l),D)}function a(D){let l=n.node;if(l==null)return "";let d=l&&typeof l=="object"&&D===void 0;if(d&&r.has(l))return r.get(l);let f=Gn(n,t,s,D,u);return d&&r.set(l,f),f}}function Gn(e,t,r,n,o){var a;let{node:u}=e,{printer:i}=t,s;return (a=i.hasPrettierIgnore)!=null&&a.call(i,e)?s=zn(e,t):o.has(u)?s=o.get(u):s=i.print(e,t,r,n),u===t.cursorNode&&(s=Qe(s,D=>[ve,D,ve])),i.printComment&&(!i.willPrintOwnComments||!i.willPrintOwnComments(e,t))&&(s=Qr(e,s,t)),s}async function Qt(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("tokens")]=e.tokens??[],t[Symbol.for("printedComments")]=new Set,Jr(e,t);let{printer:{preprocess:n}}=t;return e=n?await n(e,t):e,{ast:e,comments:r}}function Ro(e,t){let{cursorOffset:r,locStart:n,locEnd:o}=t,u=X(t.printer.getVisitorKeys),i=a=>n(a)<=r&&o(a)>=r,s=e;for(let a of Ur(e,{getVisitorKeys:u,filter:i}))s=a;return s}var Kn=Ro;function Yo(e,t){let{printer:{massageAstNode:r,getVisitorKeys:n}}=t;if(!r)return e;let o=X(n),u=r.ignoredProperties??new Set;return i(e);function i(s,a){if(!(s!==null&&typeof s=="object"))return s;if(Array.isArray(s))return s.map(f=>i(f,a)).filter(Boolean);let D={},l=new Set(o(s));for(let f in s)!Object.prototype.hasOwnProperty.call(s,f)||u.has(f)||(l.has(f)?D[f]=i(s[f],s):D[f]=s[f]);let d=r(s,D,a);if(d!==null)return d??D}}var qn=Yo;var jo=(e,t,r)=>{if(!(e&&t==null)){if(t.findLastIndex)return t.findLastIndex(r);for(let n=t.length-1;n>=0;n--){let o=t[n];if(r(o,n,t))return n}return -1}},Jn=jo;var Ho=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function Wo(e,t){let r=[e.node,...e.parentNodes],n=new Set([t.node,...t.parentNodes]);return r.find(o=>Qn.has(o.type)&&n.has(o))}function Xn(e){let t=Jn(!1,e,r=>r.type!=="Program"&&r.type!=="File");return t===-1?e:e.slice(0,t+1)}function Mo(e,t,{locStart:r,locEnd:n}){let o=e.node,u=t.node;if(o===u)return {startNode:o,endNode:u};let i=r(e.node);for(let a of Xn(t.parentNodes))if(r(a)>=i)u=a;else break;let s=n(t.node);for(let a of Xn(e.parentNodes)){if(n(a)<=s)o=a;else break;if(o===u)break}return {startNode:o,endNode:u}}function er(e,t,r,n,o=[],u){let{locStart:i,locEnd:s}=r,a=i(e),D=s(e);if(!(t>D||t<a||u==="rangeEnd"&&t===a||u==="rangeStart"&&t===D)){for(let l of ut(e,r)){let d=er(l,t,r,n,[e,...o],u);if(d)return d}if(!n||n(e,o[0]))return {node:e,parentNodes:o}}}function $o(e,t){return t!=="DeclareExportDeclaration"&&e!=="TypeParameterDeclaration"&&(e==="Directive"||e==="TypeAlias"||e==="TSExportAssignment"||e.startsWith("Declare")||e.startsWith("TSDeclare")||e.endsWith("Statement")||e.endsWith("Declaration"))}var Qn=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),Vo=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function Zn(e,t,r){if(!t)return !1;switch(e.parser){case"flow":case"babel":case"babel-flow":case"babel-ts":case"typescript":case"acorn":case"espree":case"meriyah":case"__babel_estree":return $o(t.type,r==null?void 0:r.type);case"json":case"json5":case"jsonc":case"json-stringify":return Qn.has(t.type);case"graphql":return Vo.has(t.kind);case"vue":return t.tag!=="root"}return !1}function eu(e,t,r){let{rangeStart:n,rangeEnd:o,locStart:u,locEnd:i}=t;ke.ok(o>n);let s=e.slice(n,o).search(/\S/u),a=s===-1;if(!a)for(n+=s;o>n&&!/\S/u.test(e[o-1]);--o);let D=er(r,n,t,(p,c)=>Zn(t,p,c),[],"rangeStart"),l=a?D:er(r,o,t,p=>Zn(t,p),[],"rangeEnd");if(!D||!l)return {rangeStart:0,rangeEnd:0};let d,f;if(Ho(t)){let p=Wo(D,l);d=p,f=p;}else ({startNode:d,endNode:f}=Mo(D,l,t));return {rangeStart:Math.min(u(d),u(f)),rangeEnd:Math.max(i(d),i(f))}}var uu="\uFEFF",tu=Symbol("cursor");async function ou(e,t,r=0){if(!e||e.trim().length===0)return {formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:o}=await ce(e,t);t.cursorOffset>=0&&(t.cursorNode=Kn(n,t));let u=await Ye(n,t);r>0&&(u=Je([q,u],r,t.tabWidth));let i=Fe(u,t);if(r>0){let a=i.formatted.trim();i.cursorNodeStart!==void 0&&(i.cursorNodeStart-=i.formatted.indexOf(a)),i.formatted=a+Be(t.endOfLine);}let s=t[Symbol.for("comments")];if(t.cursorOffset>=0){let a,D,l,d,f;if(t.cursorNode&&i.cursorNodeText?(a=t.locStart(t.cursorNode),D=o.slice(a,t.locEnd(t.cursorNode)),l=t.cursorOffset-a,d=i.cursorNodeStart,f=i.cursorNodeText):(a=0,D=o,l=t.cursorOffset,d=0,f=i.formatted),D===f)return {formatted:i.formatted,cursorOffset:d+l,comments:s};let p=D.split("");p.splice(l,0,tu);let c=f.split(""),F=dr(p,c),m=d;for(let E of F)if(E.removed){if(E.value.includes(tu))break}else m+=E.count;return {formatted:i.formatted,cursorOffset:m,comments:s}}return {formatted:i.formatted,cursorOffset:-1,comments:s}}async function Uo(e,t){let{ast:r,text:n}=await ce(e,t),{rangeStart:o,rangeEnd:u}=eu(n,t,r),i=n.slice(o,u),s=Math.min(o,n.lastIndexOf(`
|
|
29449
|
+
`,o)+1),a=n.slice(s,o).match(/^\s*/u)[0],D=me(a,t.tabWidth),l=await ou(i,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>o&&t.cursorOffset<=u?t.cursorOffset-o:-1,endOfLine:"lf"},D),d=l.formatted.trimEnd(),{cursorOffset:f}=t;f>u?f+=d.length-i.length:l.cursorOffset>=0&&(f=l.cursorOffset+o);let p=n.slice(0,o)+d+n.slice(u);if(t.endOfLine!=="lf"){let c=Be(t.endOfLine);f>=0&&c===`\r
|
|
29450
|
+
`&&(f+=wt(p.slice(0,f),`
|
|
29451
|
+
`)),p=ne(!1,p,`
|
|
29452
|
+
`,c);}return {formatted:p,cursorOffset:f,comments:l.comments}}function tr(e,t,r){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?r:t}function ru(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:o}=t;return r=tr(e,r,-1),n=tr(e,n,0),o=tr(e,o,e.length),{...t,cursorOffset:r,rangeStart:n,rangeEnd:o}}function iu(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:o,endOfLine:u}=ru(e,t),i=e.charAt(0)===uu;if(i&&(e=e.slice(1),r--,n--,o--),u==="auto"&&(u=Fr(e)),e.includes("\r")){let s=a=>wt(e.slice(0,Math.max(a,0)),`\r
|
|
29453
|
+
`);r-=s(r),n-=s(n),o-=s(o),e=mr(e);}return {hasBOM:i,text:e,options:ru(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:o,endOfLine:u})}}async function nu(e,t){let r=await ht(t);return !r.hasPragma||r.hasPragma(e)}async function rr(e,t){let{hasBOM:r,text:n,options:o}=iu(e,await se(t));if(o.rangeStart>=o.rangeEnd&&n!==""||o.requirePragma&&!await nu(n,o))return {formatted:e,cursorOffset:t.cursorOffset,comments:[]};let u;return o.rangeStart>0||o.rangeEnd<n.length?u=await Uo(n,o):(!o.requirePragma&&o.insertPragma&&o.printer.insertPragma&&!await nu(n,o)&&(n=o.printer.insertPragma(n)),u=await ou(n,o)),r&&(u.formatted=uu+u.formatted,u.cursorOffset>=0&&u.cursorOffset++),u}async function su(e,t,r){let{text:n,options:o}=iu(e,await se(t)),u=await ce(n,o);return r&&(r.preprocessForPrint&&(u.ast=await Qt(u.ast,o)),r.massage&&(u.ast=qn(u.ast,o))),u}async function au(e,t){t=await se(t);let r=await Ye(e,t);return Fe(r,t)}async function Du(e,t){let r=Or(e),{formatted:n}=await rr(r,{...t,parser:"__js_expression"});return n}async function lu(e,t){t=await se(t);let{ast:r}=await ce(e,t);return Ye(r,t)}async function cu(e,t){return Fe(e,await se(t))}var nr={};We(nr,{builders:()=>Go,printer:()=>Ko,utils:()=>qo});var Go={join:be,line:Ke,softline:vr,hardline:q,literalline:qe,group:_t,conditionalGroup:Ar,fill:Ge,lineSuffix:xe,lineSuffixBoundary:xr,cursor:ve,breakParent:de,ifBreak:Br,trim:_r,indent:De,indentIfBreak:wr,align:ae,addAlignmentToDoc:Je,markAsRoot:gr,dedentToRoot:Cr,dedent:yr,hardlineWithoutBreakParent:_e,literallineWithoutBreakParent:vt,label:br,concat:e=>e},Ko={printDocToString:Fe},qo={willBreak:Ir,traverseDoc:we,findInDoc:Xe,mapDoc:Ne,removeLines:Yr,stripTrailingHardline:Ze,replaceEndOfLine:jr,canBreak:Hr};var fu="3.3.3";var or={};We(or,{addDanglingComment:()=>re,addLeadingComment:()=>ue,addTrailingComment:()=>oe,getAlignmentSize:()=>me,getIndentSize:()=>pu,getMaxContinuousCount:()=>du,getNextNonSpaceNonCommentCharacter:()=>Fu,getNextNonSpaceNonCommentCharacterIndex:()=>si,getStringWidth:()=>Oe,hasNewline:()=>V,hasNewlineInRange:()=>mu,hasSpaces:()=>Eu,isNextLineEmpty:()=>ci,isNextLineEmptyAfterIndex:()=>gt,isPreviousLineEmpty:()=>Di,makeString:()=>hu,skip:()=>Ee,skipEverythingButNewLine:()=>nt,skipInlineComment:()=>Ce,skipNewline:()=>M,skipSpaces:()=>T,skipToLineEnd:()=>rt,skipTrailingComment:()=>ge,skipWhitespace:()=>zr});function Jo(e,t){if(t===!1)return !1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Ce=Jo;function Xo(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?nt(e,t):t}var ge=Xo;function Zo(e,t){let r=null,n=t;for(;n!==r;)r=n,n=T(e,n),n=Ce(e,n),n=ge(e,n),n=M(e,n);return n}var je=Zo;function Qo(e,t){let r=null,n=t;for(;n!==r;)r=n,n=rt(e,n),n=Ce(e,n),n=T(e,n);return n=ge(e,n),n=M(e,n),n!==!1&&V(e,n)}var gt=Qo;function ei(e,t){let r=e.lastIndexOf(`
|
|
29454
|
+
`);return r===-1?0:me(e.slice(r+1).match(/^[\t ]*/u)[0],t)}var pu=ei;function ur(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ti(e,t){let r=e.match(new RegExp(`(${ur(t)})+`,"gu"));return r===null?0:r.reduce((n,o)=>Math.max(n,o.length/t.length),0)}var du=ti;function ri(e,t){let r=je(e,t);return r===!1?"":e.charAt(r)}var Fu=ri;function ni(e,t,r){for(let n=t;n<r;++n)if(e.charAt(n)===`
|
|
29455
|
+
`)return !0;return !1}var mu=ni;function ui(e,t,r={}){return T(e,r.backwards?t-1:t,r)!==t}var Eu=ui;function oi(e,t,r){let n=t==='"'?"'":'"',u=ne(!1,e,/\\(.)|(["'])/gsu,(i,s,a)=>s===n?s:a===t?"\\"+a:a||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)?s:"\\"+s));return t+u+t}var hu=oi;function ii(e,t,r){return je(e,r(t))}function si(e,t){return arguments.length===2||typeof t=="number"?je(e,t):ii(...arguments)}function ai(e,t,r){return Le(e,r(t))}function Di(e,t){return arguments.length===2||typeof t=="number"?Le(e,t):ai(...arguments)}function li(e,t,r){return gt(e,r(t))}function ci(e,t){return arguments.length===2||typeof t=="number"?gt(e,t):li(...arguments)}function fe(e,t=1){return async(...r)=>{let n=r[t]??{},o=n.plugins??[];return r[t]={...n,plugins:Array.isArray(o)?o:Object.values(o)},e(...r)}}var Cu=fe(rr);async function gu(e,t){let{formatted:r}=await Cu(e,{...t,cursorOffset:-1});return r}async function fi(e,t){return await gu(e,t)===e}var pi=fe(ot,0),di={parse:fe(su),formatAST:fe(au),formatDoc:fe(Du),printToDoc:fe(lu),printDocToString:fe(cu)};
|
|
30070
29456
|
|
|
30071
29457
|
var __defProp = Object.defineProperty;
|
|
30072
29458
|
var __export = (target, all) => {
|
|
@@ -30376,7 +29762,7 @@ function isWide(x) {
|
|
|
30376
29762
|
var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint));
|
|
30377
29763
|
|
|
30378
29764
|
// src/utils/get-string-width.js
|
|
30379
|
-
var notAsciiRegex = /[^\x20-\x7F]
|
|
29765
|
+
var notAsciiRegex = /[^\x20-\x7F]/u;
|
|
30380
29766
|
function getStringWidth(text) {
|
|
30381
29767
|
if (!text) {
|
|
30382
29768
|
return 0;
|
|
@@ -30608,7 +29994,7 @@ function stripTrailingHardlineFromDoc(doc) {
|
|
|
30608
29994
|
case DOC_TYPE_ARRAY:
|
|
30609
29995
|
return stripTrailingHardlineFromParts(doc);
|
|
30610
29996
|
case DOC_TYPE_STRING:
|
|
30611
|
-
return doc.replace(/[\n\r]
|
|
29997
|
+
return doc.replace(/[\n\r]*$/u, "");
|
|
30612
29998
|
case DOC_TYPE_ALIGN:
|
|
30613
29999
|
case DOC_TYPE_CURSOR:
|
|
30614
30000
|
case DOC_TYPE_TRIM:
|