wapi-client 0.9.1 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/api/ws-client.cjs +1 -1
  2. package/dist/api/ws-client.d.ts +0 -1
  3. package/dist/api/ws-client.js +1 -1
  4. package/dist/client.cjs +1 -1
  5. package/dist/client.d.ts +4 -4
  6. package/dist/client.js +1 -1
  7. package/dist/fns/aggregate-transfers/aggregate-transfers.d.ts +1 -1
  8. package/dist/fns/find-tokens/find-tokens.enums.d.ts +2 -3
  9. package/dist/fns/find-tokens/find-tokens.schema.input.json +1 -16
  10. package/dist/fns/find-transfer-groups/find-transfer-groups.enums.d.ts +2 -8
  11. package/dist/fns/find-transfer-groups/find-transfer-groups.schema.input.json +3 -34
  12. package/dist/fns/find-wallets/find-wallets.enums.d.ts +1 -1
  13. package/dist/fns/import-data/import-data.cjs +22 -0
  14. package/dist/fns/import-data/import-data.js +22 -0
  15. package/dist/fns/import-data/import-data.node.browser.cjs +22 -0
  16. package/dist/fns/import-data/import-data.node.browser.js +22 -0
  17. package/dist/fns/import-data/import-data.node.cjs +22 -0
  18. package/dist/fns/import-data/import-data.node.js +22 -0
  19. package/dist/fns/reverse-transfers/reverse-transfers.d.ts +1 -1
  20. package/dist/fns/update-transfer-groups/update-transfer-groups.d.ts +1 -1
  21. package/dist/fns/update-transfers/update-transfers.d.ts +1 -1
  22. package/dist/lib/errors.d.ts +1 -1
  23. package/dist/lib/isomorphic/node/fetch.cjs +20 -17
  24. package/dist/lib/isomorphic/node/fetch.js +20 -17
  25. package/dist/lib/isomorphic/node/streams.d.ts +0 -2
  26. package/dist/lib/query-builder.d.ts +6 -8
  27. package/dist/lib/validator.browser.cjs +611 -960
  28. package/dist/lib/validator.browser.js +611 -960
  29. package/dist/lib/validator.cjs +1 -1
  30. package/dist/lib/validator.js +1 -1
  31. package/dist/lib/ws-types.d.ts +0 -1
  32. package/dist/txs/create-distribution/create-distribution.enums.d.ts +1 -1
  33. package/dist/txs/find-balance-many/find-balance-many.enums.d.ts +1 -1
  34. package/dist/txs/find-token-many/find-token-many.enums.d.ts +4 -3
  35. package/dist/txs/find-token-many/find-token-many.schema.input.json +6 -0
  36. package/dist/txs/find-token-many/find-token-many.schema.output.json +8 -1
  37. package/dist/txs/find-transfer-group-many/find-transfer-group-many.enums.d.ts +10 -4
  38. package/dist/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json +4 -3
  39. package/dist/txs/find-transfer-group-many/find-transfer-group-many.schema.output.json +23 -1
  40. package/dist/txs/find-transfer-many/find-transfer-many.enums.d.ts +1 -1
  41. package/dist/txs/get-balance-history/get-balance-history.enums.d.ts +5 -1
  42. package/dist/txs/get-balance-history/get-balance-history.schema.output.json +7 -1
  43. package/dist/txs/get-token/get-token.enums.d.ts +43 -1
  44. package/dist/txs/get-token/get-token.schema.input.json +5 -1
  45. package/dist/txs/get-token/get-token.schema.output.json +63 -2
  46. package/dist/txs/get-token-many/get-token-many.enums.d.ts +6 -2
  47. package/dist/txs/get-token-many/get-token-many.schema.input.json +5 -0
  48. package/dist/txs/get-token-many/get-token-many.schema.output.json +3 -0
  49. package/dist/txs/update-transfer-group/update-transfer-group.enums.d.ts +1 -1
  50. package/dist/types/index.d.ts +92 -47
  51. package/dist/wapi-client-web.iife.js +6 -11
  52. package/dist/wapi-client.iife.js +6 -11
  53. package/package.json +5 -6
@@ -3136,1020 +3136,676 @@ var require_data = __commonJS({
3136
3136
  }
3137
3137
  });
3138
3138
 
3139
- // node_modules/uri-js/dist/es5/uri.all.js
3140
- var require_uri_all = __commonJS({
3141
- "node_modules/uri-js/dist/es5/uri.all.js"(exports, module2) {
3142
- (function(global, factory) {
3143
- typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global.URI = global.URI || {});
3144
- })(exports, function(exports2) {
3145
- "use strict";
3146
- function merge() {
3147
- for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
3148
- sets[_key] = arguments[_key];
3149
- }
3150
- if (sets.length > 1) {
3151
- sets[0] = sets[0].slice(0, -1);
3152
- var xl = sets.length - 1;
3153
- for (var x = 1; x < xl; ++x) {
3154
- sets[x] = sets[x].slice(1, -1);
3155
- }
3156
- sets[xl] = sets[xl].slice(1);
3157
- return sets.join("");
3158
- } else {
3159
- return sets[0];
3160
- }
3161
- }
3162
- function subexp(str) {
3163
- return "(?:" + str + ")";
3164
- }
3165
- function typeOf(o) {
3166
- return o === void 0 ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
3167
- }
3168
- function toUpperCase(str) {
3169
- return str.toUpperCase();
3170
- }
3171
- function toArray(obj) {
3172
- return obj !== void 0 && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
3173
- }
3174
- function assign(target, source) {
3175
- var obj = target;
3176
- if (source) {
3177
- for (var key in source) {
3178
- obj[key] = source[key];
3179
- }
3180
- }
3181
- return obj;
3182
- }
3183
- function buildExps(isIRI2) {
3184
- var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$2 = merge(DIGIT$$, "[A-Fa-f]"), LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$2 = subexp(subexp("%[EFef]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%" + HEXDIG$$2 + HEXDIG$$2)), GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI2 ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI2 ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$2 = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), 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$$), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$2 + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$2 + "|" + PCT_ENCODED$2) + "+"), IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + ZONEID$), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$2 + "+\\." + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
3185
- return {
3186
- NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
3187
- NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3188
- NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3189
- NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3190
- NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3191
- NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
3192
- NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
3193
- ESCAPE: new RegExp(merge("[^]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3194
- UNRESERVED: new RegExp(UNRESERVED$$2, "g"),
3195
- OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$2, RESERVED$$), "g"),
3196
- PCT_ENCODED: new RegExp(PCT_ENCODED$2, "g"),
3197
- IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
3198
- IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$")
3199
- //RFC 6874, with relaxed parsing rules
3200
- };
3201
- }
3202
- var URI_PROTOCOL = buildExps(false);
3203
- var IRI_PROTOCOL = buildExps(true);
3204
- var slicedToArray = /* @__PURE__ */ function() {
3205
- function sliceIterator(arr, i) {
3206
- var _arr = [];
3207
- var _n = true;
3208
- var _d = false;
3209
- var _e = void 0;
3210
- try {
3211
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
3212
- _arr.push(_s.value);
3213
- if (i && _arr.length === i) break;
3214
- }
3215
- } catch (err) {
3216
- _d = true;
3217
- _e = err;
3218
- } finally {
3219
- try {
3220
- if (!_n && _i["return"]) _i["return"]();
3221
- } finally {
3222
- if (_d) throw _e;
3223
- }
3224
- }
3225
- return _arr;
3226
- }
3227
- return function(arr, i) {
3228
- if (Array.isArray(arr)) {
3229
- return arr;
3230
- } else if (Symbol.iterator in Object(arr)) {
3231
- return sliceIterator(arr, i);
3232
- } else {
3233
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
3234
- }
3235
- };
3236
- }();
3237
- var toConsumableArray = function(arr) {
3238
- if (Array.isArray(arr)) {
3239
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
3240
- return arr2;
3241
- } else {
3242
- return Array.from(arr);
3243
- }
3244
- };
3245
- var maxInt = 2147483647;
3246
- var base = 36;
3247
- var tMin = 1;
3248
- var tMax = 26;
3249
- var skew = 38;
3250
- var damp = 700;
3251
- var initialBias = 72;
3252
- var initialN = 128;
3253
- var delimiter = "-";
3254
- var regexPunycode = /^xn--/;
3255
- var regexNonASCII = /[^\0-\x7E]/;
3256
- var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
3257
- var errors = {
3258
- "overflow": "Overflow: input needs wider integers to process",
3259
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
3260
- "invalid-input": "Invalid input"
3261
- };
3262
- var baseMinusTMin = base - tMin;
3263
- var floor = Math.floor;
3264
- var stringFromCharCode = String.fromCharCode;
3265
- function error$1(type) {
3266
- throw new RangeError(errors[type]);
3267
- }
3268
- function map(array, fn) {
3269
- var result = [];
3270
- var length = array.length;
3271
- while (length--) {
3272
- result[length] = fn(array[length]);
3273
- }
3274
- return result;
3275
- }
3276
- function mapDomain(string, fn) {
3277
- var parts = string.split("@");
3278
- var result = "";
3279
- if (parts.length > 1) {
3280
- result = parts[0] + "@";
3281
- string = parts[1];
3282
- }
3283
- string = string.replace(regexSeparators, ".");
3284
- var labels = string.split(".");
3285
- var encoded = map(labels, fn).join(".");
3286
- return result + encoded;
3287
- }
3288
- function ucs2decode(string) {
3289
- var output = [];
3290
- var counter = 0;
3291
- var length = string.length;
3292
- while (counter < length) {
3293
- var value = string.charCodeAt(counter++);
3294
- if (value >= 55296 && value <= 56319 && counter < length) {
3295
- var extra = string.charCodeAt(counter++);
3296
- if ((extra & 64512) == 56320) {
3297
- output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
3139
+ // node_modules/fast-uri/lib/scopedChars.js
3140
+ var require_scopedChars = __commonJS({
3141
+ "node_modules/fast-uri/lib/scopedChars.js"(exports, module2) {
3142
+ "use strict";
3143
+ var HEX = {
3144
+ 0: 0,
3145
+ 1: 1,
3146
+ 2: 2,
3147
+ 3: 3,
3148
+ 4: 4,
3149
+ 5: 5,
3150
+ 6: 6,
3151
+ 7: 7,
3152
+ 8: 8,
3153
+ 9: 9,
3154
+ a: 10,
3155
+ A: 10,
3156
+ b: 11,
3157
+ B: 11,
3158
+ c: 12,
3159
+ C: 12,
3160
+ d: 13,
3161
+ D: 13,
3162
+ e: 14,
3163
+ E: 14,
3164
+ f: 15,
3165
+ F: 15
3166
+ };
3167
+ module2.exports = {
3168
+ HEX
3169
+ };
3170
+ }
3171
+ });
3172
+
3173
+ // node_modules/fast-uri/lib/utils.js
3174
+ var require_utils = __commonJS({
3175
+ "node_modules/fast-uri/lib/utils.js"(exports, module2) {
3176
+ "use strict";
3177
+ var { HEX } = require_scopedChars();
3178
+ function normalizeIPv4(host) {
3179
+ if (findToken(host, ".") < 3) {
3180
+ return { host, isIPV4: false };
3181
+ }
3182
+ 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) || [];
3183
+ const [address] = matches;
3184
+ if (address) {
3185
+ return { host: stripLeadingZeros(address, "."), isIPV4: true };
3186
+ } else {
3187
+ return { host, isIPV4: false };
3188
+ }
3189
+ }
3190
+ function stringArrayToHexStripped(input, keepZero = false) {
3191
+ let acc = "";
3192
+ let strip = true;
3193
+ for (const c of input) {
3194
+ if (HEX[c] === void 0) return void 0;
3195
+ if (c !== "0" && strip === true) strip = false;
3196
+ if (!strip) acc += c;
3197
+ }
3198
+ if (keepZero && acc.length === 0) acc = "0";
3199
+ return acc;
3200
+ }
3201
+ function getIPV6(input) {
3202
+ let tokenCount = 0;
3203
+ const output = { error: false, address: "", zone: "" };
3204
+ const address = [];
3205
+ const buffer = [];
3206
+ let isZone = false;
3207
+ let endipv6Encountered = false;
3208
+ let endIpv6 = false;
3209
+ function consume() {
3210
+ if (buffer.length) {
3211
+ if (isZone === false) {
3212
+ const hex = stringArrayToHexStripped(buffer);
3213
+ if (hex !== void 0) {
3214
+ address.push(hex);
3298
3215
  } else {
3299
- output.push(value);
3300
- counter--;
3216
+ output.error = true;
3217
+ return false;
3301
3218
  }
3302
- } else {
3303
- output.push(value);
3304
3219
  }
3220
+ buffer.length = 0;
3305
3221
  }
3306
- return output;
3222
+ return true;
3307
3223
  }
3308
- var ucs2encode = function ucs2encode2(array) {
3309
- return String.fromCodePoint.apply(String, toConsumableArray(array));
3310
- };
3311
- var basicToDigit = function basicToDigit2(codePoint) {
3312
- if (codePoint - 48 < 10) {
3313
- return codePoint - 22;
3314
- }
3315
- if (codePoint - 65 < 26) {
3316
- return codePoint - 65;
3317
- }
3318
- if (codePoint - 97 < 26) {
3319
- return codePoint - 97;
3224
+ for (let i = 0; i < input.length; i++) {
3225
+ const cursor = input[i];
3226
+ if (cursor === "[" || cursor === "]") {
3227
+ continue;
3320
3228
  }
3321
- return base;
3322
- };
3323
- var digitToBasic = function digitToBasic2(digit, flag) {
3324
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
3325
- };
3326
- var adapt = function adapt2(delta, numPoints, firstTime) {
3327
- var k = 0;
3328
- delta = firstTime ? floor(delta / damp) : delta >> 1;
3329
- delta += floor(delta / numPoints);
3330
- for (
3331
- ;
3332
- /* no initialization */
3333
- delta > baseMinusTMin * tMax >> 1;
3334
- k += base
3335
- ) {
3336
- delta = floor(delta / baseMinusTMin);
3337
- }
3338
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
3339
- };
3340
- var decode = function decode2(input) {
3341
- var output = [];
3342
- var inputLength = input.length;
3343
- var i = 0;
3344
- var n = initialN;
3345
- var bias = initialBias;
3346
- var basic = input.lastIndexOf(delimiter);
3347
- if (basic < 0) {
3348
- basic = 0;
3349
- }
3350
- for (var j = 0; j < basic; ++j) {
3351
- if (input.charCodeAt(j) >= 128) {
3352
- error$1("not-basic");
3229
+ if (cursor === ":") {
3230
+ if (endipv6Encountered === true) {
3231
+ endIpv6 = true;
3353
3232
  }
3354
- output.push(input.charCodeAt(j));
3355
- }
3356
- for (var index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
3357
- var oldi = i;
3358
- for (
3359
- var w = 1, k = base;
3360
- ;
3361
- /* no condition */
3362
- k += base
3363
- ) {
3364
- if (index >= inputLength) {
3365
- error$1("invalid-input");
3366
- }
3367
- var digit = basicToDigit(input.charCodeAt(index++));
3368
- if (digit >= base || digit > floor((maxInt - i) / w)) {
3369
- error$1("overflow");
3370
- }
3371
- i += digit * w;
3372
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
3373
- if (digit < t) {
3374
- break;
3375
- }
3376
- var baseMinusT = base - t;
3377
- if (w > floor(maxInt / baseMinusT)) {
3378
- error$1("overflow");
3379
- }
3380
- w *= baseMinusT;
3233
+ if (!consume()) {
3234
+ break;
3381
3235
  }
3382
- var out = output.length + 1;
3383
- bias = adapt(i - oldi, out, oldi == 0);
3384
- if (floor(i / out) > maxInt - n) {
3385
- error$1("overflow");
3236
+ tokenCount++;
3237
+ address.push(":");
3238
+ if (tokenCount > 7) {
3239
+ output.error = true;
3240
+ break;
3386
3241
  }
3387
- n += floor(i / out);
3388
- i %= out;
3389
- output.splice(i++, 0, n);
3390
- }
3391
- return String.fromCodePoint.apply(String, output);
3392
- };
3393
- var encode = function encode2(input) {
3394
- var output = [];
3395
- input = ucs2decode(input);
3396
- var inputLength = input.length;
3397
- var n = initialN;
3398
- var delta = 0;
3399
- var bias = initialBias;
3400
- var _iteratorNormalCompletion = true;
3401
- var _didIteratorError = false;
3402
- var _iteratorError = void 0;
3403
- try {
3404
- for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3405
- var _currentValue2 = _step.value;
3406
- if (_currentValue2 < 128) {
3407
- output.push(stringFromCharCode(_currentValue2));
3408
- }
3242
+ if (i - 1 >= 0 && input[i - 1] === ":") {
3243
+ endipv6Encountered = true;
3409
3244
  }
3410
- } catch (err) {
3411
- _didIteratorError = true;
3412
- _iteratorError = err;
3413
- } finally {
3414
- try {
3415
- if (!_iteratorNormalCompletion && _iterator.return) {
3416
- _iterator.return();
3417
- }
3418
- } finally {
3419
- if (_didIteratorError) {
3420
- throw _iteratorError;
3421
- }
3245
+ continue;
3246
+ } else if (cursor === "%") {
3247
+ if (!consume()) {
3248
+ break;
3422
3249
  }
3250
+ isZone = true;
3251
+ } else {
3252
+ buffer.push(cursor);
3253
+ continue;
3423
3254
  }
3424
- var basicLength = output.length;
3425
- var handledCPCount = basicLength;
3426
- if (basicLength) {
3427
- output.push(delimiter);
3428
- }
3429
- while (handledCPCount < inputLength) {
3430
- var m = maxInt;
3431
- var _iteratorNormalCompletion2 = true;
3432
- var _didIteratorError2 = false;
3433
- var _iteratorError2 = void 0;
3434
- try {
3435
- for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
3436
- var currentValue = _step2.value;
3437
- if (currentValue >= n && currentValue < m) {
3438
- m = currentValue;
3439
- }
3440
- }
3441
- } catch (err) {
3442
- _didIteratorError2 = true;
3443
- _iteratorError2 = err;
3444
- } finally {
3445
- try {
3446
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
3447
- _iterator2.return();
3448
- }
3449
- } finally {
3450
- if (_didIteratorError2) {
3451
- throw _iteratorError2;
3452
- }
3453
- }
3454
- }
3455
- var handledCPCountPlusOne = handledCPCount + 1;
3456
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
3457
- error$1("overflow");
3458
- }
3459
- delta += (m - n) * handledCPCountPlusOne;
3460
- n = m;
3461
- var _iteratorNormalCompletion3 = true;
3462
- var _didIteratorError3 = false;
3463
- var _iteratorError3 = void 0;
3464
- try {
3465
- for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
3466
- var _currentValue = _step3.value;
3467
- if (_currentValue < n && ++delta > maxInt) {
3468
- error$1("overflow");
3469
- }
3470
- if (_currentValue == n) {
3471
- var q = delta;
3472
- for (
3473
- var k = base;
3474
- ;
3475
- /* no condition */
3476
- k += base
3477
- ) {
3478
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
3479
- if (q < t) {
3480
- break;
3481
- }
3482
- var qMinusT = q - t;
3483
- var baseMinusT = base - t;
3484
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
3485
- q = floor(qMinusT / baseMinusT);
3486
- }
3487
- output.push(stringFromCharCode(digitToBasic(q, 0)));
3488
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
3489
- delta = 0;
3490
- ++handledCPCount;
3491
- }
3492
- }
3493
- } catch (err) {
3494
- _didIteratorError3 = true;
3495
- _iteratorError3 = err;
3496
- } finally {
3497
- try {
3498
- if (!_iteratorNormalCompletion3 && _iterator3.return) {
3499
- _iterator3.return();
3500
- }
3501
- } finally {
3502
- if (_didIteratorError3) {
3503
- throw _iteratorError3;
3504
- }
3505
- }
3506
- }
3507
- ++delta;
3508
- ++n;
3255
+ }
3256
+ if (buffer.length) {
3257
+ if (isZone) {
3258
+ output.zone = buffer.join("");
3259
+ } else if (endIpv6) {
3260
+ address.push(buffer.join(""));
3261
+ } else {
3262
+ address.push(stringArrayToHexStripped(buffer));
3509
3263
  }
3510
- return output.join("");
3511
- };
3512
- var toUnicode = function toUnicode2(input) {
3513
- return mapDomain(input, function(string) {
3514
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
3515
- });
3516
- };
3517
- var toASCII = function toASCII2(input) {
3518
- return mapDomain(input, function(string) {
3519
- return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
3520
- });
3521
- };
3522
- var punycode = {
3523
- /**
3524
- * A string representing the current Punycode.js version number.
3525
- * @memberOf punycode
3526
- * @type String
3527
- */
3528
- "version": "2.1.0",
3529
- /**
3530
- * An object of methods to convert from JavaScript's internal character
3531
- * representation (UCS-2) to Unicode code points, and back.
3532
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
3533
- * @memberOf punycode
3534
- * @type Object
3535
- */
3536
- "ucs2": {
3537
- "decode": ucs2decode,
3538
- "encode": ucs2encode
3539
- },
3540
- "decode": decode,
3541
- "encode": encode,
3542
- "toASCII": toASCII,
3543
- "toUnicode": toUnicode
3544
- };
3545
- var SCHEMES = {};
3546
- function pctEncChar(chr) {
3547
- var c = chr.charCodeAt(0);
3548
- var e = void 0;
3549
- if (c < 16) e = "%0" + c.toString(16).toUpperCase();
3550
- else if (c < 128) e = "%" + c.toString(16).toUpperCase();
3551
- else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
3552
- else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
3553
- return e;
3554
- }
3555
- function pctDecChars(str) {
3556
- var newStr = "";
3557
- var i = 0;
3558
- var il = str.length;
3559
- while (i < il) {
3560
- var c = parseInt(str.substr(i + 1, 2), 16);
3561
- if (c < 128) {
3562
- newStr += String.fromCharCode(c);
3563
- i += 3;
3564
- } else if (c >= 194 && c < 224) {
3565
- if (il - i >= 6) {
3566
- var c2 = parseInt(str.substr(i + 4, 2), 16);
3567
- newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
3568
- } else {
3569
- newStr += str.substr(i, 6);
3570
- }
3571
- i += 6;
3572
- } else if (c >= 224) {
3573
- if (il - i >= 9) {
3574
- var _c = parseInt(str.substr(i + 4, 2), 16);
3575
- var c3 = parseInt(str.substr(i + 7, 2), 16);
3576
- newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
3577
- } else {
3578
- newStr += str.substr(i, 9);
3579
- }
3580
- i += 9;
3581
- } else {
3582
- newStr += str.substr(i, 3);
3583
- i += 3;
3584
- }
3264
+ }
3265
+ output.address = address.join("");
3266
+ return output;
3267
+ }
3268
+ function normalizeIPv6(host, opts = {}) {
3269
+ if (findToken(host, ":") < 2) {
3270
+ return { host, isIPV6: false };
3271
+ }
3272
+ const ipv6 = getIPV6(host);
3273
+ if (!ipv6.error) {
3274
+ let newHost = ipv6.address;
3275
+ let escapedHost = ipv6.address;
3276
+ if (ipv6.zone) {
3277
+ newHost += "%" + ipv6.zone;
3278
+ escapedHost += "%25" + ipv6.zone;
3585
3279
  }
3586
- return newStr;
3587
- }
3588
- function _normalizeComponentEncoding(components, protocol) {
3589
- function decodeUnreserved2(str) {
3590
- var decStr = pctDecChars(str);
3591
- return !decStr.match(protocol.UNRESERVED) ? str : decStr;
3592
- }
3593
- if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, "");
3594
- if (components.userinfo !== void 0) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3595
- if (components.host !== void 0) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3596
- if (components.path !== void 0) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3597
- if (components.query !== void 0) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3598
- if (components.fragment !== void 0) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3599
- return components;
3600
- }
3601
- function _stripLeadingZeros(str) {
3602
- return str.replace(/^0*(.*)/, "$1") || "0";
3603
- }
3604
- function _normalizeIPv4(host, protocol) {
3605
- var matches = host.match(protocol.IPV4ADDRESS) || [];
3606
- var _matches = slicedToArray(matches, 2), address = _matches[1];
3607
- if (address) {
3608
- return address.split(".").map(_stripLeadingZeros).join(".");
3609
- } else {
3610
- return host;
3611
- }
3612
- }
3613
- function _normalizeIPv6(host, protocol) {
3614
- var matches = host.match(protocol.IPV6ADDRESS) || [];
3615
- var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2];
3616
- if (address) {
3617
- var _address$toLowerCase$ = address.toLowerCase().split("::").reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1];
3618
- var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
3619
- var lastFields = last.split(":").map(_stripLeadingZeros);
3620
- var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
3621
- var fieldCount = isLastFieldIPv4Address ? 7 : 8;
3622
- var lastFieldsStart = lastFields.length - fieldCount;
3623
- var fields = Array(fieldCount);
3624
- for (var x = 0; x < fieldCount; ++x) {
3625
- fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || "";
3626
- }
3627
- if (isLastFieldIPv4Address) {
3628
- fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
3629
- }
3630
- var allZeroFields = fields.reduce(function(acc, field, index) {
3631
- if (!field || field === "0") {
3632
- var lastLongest = acc[acc.length - 1];
3633
- if (lastLongest && lastLongest.index + lastLongest.length === index) {
3634
- lastLongest.length++;
3635
- } else {
3636
- acc.push({ index, length: 1 });
3637
- }
3638
- }
3639
- return acc;
3640
- }, []);
3641
- var longestZeroFields = allZeroFields.sort(function(a, b) {
3642
- return b.length - a.length;
3643
- })[0];
3644
- var newHost = void 0;
3645
- if (longestZeroFields && longestZeroFields.length > 1) {
3646
- var newFirst = fields.slice(0, longestZeroFields.index);
3647
- var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
3648
- newHost = newFirst.join(":") + "::" + newLast.join(":");
3649
- } else {
3650
- newHost = fields.join(":");
3651
- }
3652
- if (zone) {
3653
- newHost += "%" + zone;
3280
+ return { host: newHost, escapedHost, isIPV6: true };
3281
+ } else {
3282
+ return { host, isIPV6: false };
3283
+ }
3284
+ }
3285
+ function stripLeadingZeros(str, token) {
3286
+ let out = "";
3287
+ let skip = true;
3288
+ const l = str.length;
3289
+ for (let i = 0; i < l; i++) {
3290
+ const c = str[i];
3291
+ if (c === "0" && skip) {
3292
+ if (i + 1 <= l && str[i + 1] === token || i + 1 === l) {
3293
+ out += c;
3294
+ skip = false;
3654
3295
  }
3655
- return newHost;
3656
3296
  } else {
3657
- return host;
3658
- }
3659
- }
3660
- var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
3661
- var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
3662
- function parse(uriString) {
3663
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3664
- var components = {};
3665
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
3666
- if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
3667
- var matches = uriString.match(URI_PARSE);
3668
- if (matches) {
3669
- if (NO_MATCH_IS_UNDEFINED) {
3670
- components.scheme = matches[1];
3671
- components.userinfo = matches[3];
3672
- components.host = matches[4];
3673
- components.port = parseInt(matches[5], 10);
3674
- components.path = matches[6] || "";
3675
- components.query = matches[7];
3676
- components.fragment = matches[8];
3677
- if (isNaN(components.port)) {
3678
- components.port = matches[5];
3679
- }
3680
- } else {
3681
- components.scheme = matches[1] || void 0;
3682
- components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : void 0;
3683
- components.host = uriString.indexOf("//") !== -1 ? matches[4] : void 0;
3684
- components.port = parseInt(matches[5], 10);
3685
- components.path = matches[6] || "";
3686
- components.query = uriString.indexOf("?") !== -1 ? matches[7] : void 0;
3687
- components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : void 0;
3688
- if (isNaN(components.port)) {
3689
- components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : void 0;
3690
- }
3691
- }
3692
- if (components.host) {
3693
- components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
3694
- }
3695
- if (components.scheme === void 0 && components.userinfo === void 0 && components.host === void 0 && components.port === void 0 && !components.path && components.query === void 0) {
3696
- components.reference = "same-document";
3697
- } else if (components.scheme === void 0) {
3698
- components.reference = "relative";
3699
- } else if (components.fragment === void 0) {
3700
- components.reference = "absolute";
3297
+ if (c === token) {
3298
+ skip = true;
3701
3299
  } else {
3702
- components.reference = "uri";
3703
- }
3704
- if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
3705
- components.error = components.error || "URI is not a " + options.reference + " reference.";
3706
- }
3707
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
3708
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
3709
- if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
3710
- try {
3711
- components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
3712
- } catch (e) {
3713
- components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
3714
- }
3715
- }
3716
- _normalizeComponentEncoding(components, URI_PROTOCOL);
3717
- } else {
3718
- _normalizeComponentEncoding(components, protocol);
3719
- }
3720
- if (schemeHandler && schemeHandler.parse) {
3721
- schemeHandler.parse(components, options);
3300
+ skip = false;
3722
3301
  }
3302
+ out += c;
3303
+ }
3304
+ }
3305
+ return out;
3306
+ }
3307
+ function findToken(str, token) {
3308
+ let ind = 0;
3309
+ for (let i = 0; i < str.length; i++) {
3310
+ if (str[i] === token) ind++;
3311
+ }
3312
+ return ind;
3313
+ }
3314
+ var RDS1 = /^\.\.?\//u;
3315
+ var RDS2 = /^\/\.(?:\/|$)/u;
3316
+ var RDS3 = /^\/\.\.(?:\/|$)/u;
3317
+ var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u;
3318
+ function removeDotSegments(input) {
3319
+ const output = [];
3320
+ while (input.length) {
3321
+ if (input.match(RDS1)) {
3322
+ input = input.replace(RDS1, "");
3323
+ } else if (input.match(RDS2)) {
3324
+ input = input.replace(RDS2, "/");
3325
+ } else if (input.match(RDS3)) {
3326
+ input = input.replace(RDS3, "/");
3327
+ output.pop();
3328
+ } else if (input === "." || input === "..") {
3329
+ input = "";
3723
3330
  } else {
3724
- components.error = components.error || "URI can not be parsed.";
3725
- }
3726
- return components;
3727
- }
3728
- function _recomposeAuthority(components, options) {
3729
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
3730
- var uriTokens = [];
3731
- if (components.userinfo !== void 0) {
3732
- uriTokens.push(components.userinfo);
3733
- uriTokens.push("@");
3734
- }
3735
- if (components.host !== void 0) {
3736
- uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(_, $1, $2) {
3737
- return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
3738
- }));
3739
- }
3740
- if (typeof components.port === "number" || typeof components.port === "string") {
3741
- uriTokens.push(":");
3742
- uriTokens.push(String(components.port));
3743
- }
3744
- return uriTokens.length ? uriTokens.join("") : void 0;
3745
- }
3746
- var RDS1 = /^\.\.?\//;
3747
- var RDS2 = /^\/\.(\/|$)/;
3748
- var RDS3 = /^\/\.\.(\/|$)/;
3749
- var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
3750
- function removeDotSegments(input) {
3751
- var output = [];
3752
- while (input.length) {
3753
- if (input.match(RDS1)) {
3754
- input = input.replace(RDS1, "");
3755
- } else if (input.match(RDS2)) {
3756
- input = input.replace(RDS2, "/");
3757
- } else if (input.match(RDS3)) {
3758
- input = input.replace(RDS3, "/");
3759
- output.pop();
3760
- } else if (input === "." || input === "..") {
3761
- input = "";
3331
+ const im = input.match(RDS5);
3332
+ if (im) {
3333
+ const s = im[0];
3334
+ input = input.slice(s.length);
3335
+ output.push(s);
3762
3336
  } else {
3763
- var im = input.match(RDS5);
3764
- if (im) {
3765
- var s = im[0];
3766
- input = input.slice(s.length);
3767
- output.push(s);
3768
- } else {
3769
- throw new Error("Unexpected dot segment condition");
3770
- }
3337
+ throw new Error("Unexpected dot segment condition");
3771
3338
  }
3772
3339
  }
3773
- return output.join("");
3774
- }
3775
- function serialize(components) {
3776
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3777
- var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
3778
- var uriTokens = [];
3779
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
3780
- if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
3781
- if (components.host) {
3782
- if (protocol.IPV6ADDRESS.test(components.host)) {
3783
- } else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
3784
- try {
3785
- components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
3786
- } catch (e) {
3787
- components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
3788
- }
3789
- }
3790
- }
3791
- _normalizeComponentEncoding(components, protocol);
3792
- if (options.reference !== "suffix" && components.scheme) {
3793
- uriTokens.push(components.scheme);
3794
- uriTokens.push(":");
3795
- }
3796
- var authority = _recomposeAuthority(components, options);
3797
- if (authority !== void 0) {
3798
- if (options.reference !== "suffix") {
3799
- uriTokens.push("//");
3800
- }
3801
- uriTokens.push(authority);
3802
- if (components.path && components.path.charAt(0) !== "/") {
3803
- uriTokens.push("/");
3804
- }
3805
- }
3806
- if (components.path !== void 0) {
3807
- var s = components.path;
3808
- if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
3809
- s = removeDotSegments(s);
3810
- }
3811
- if (authority === void 0) {
3812
- s = s.replace(/^\/\//, "/%2F");
3340
+ }
3341
+ return output.join("");
3342
+ }
3343
+ function normalizeComponentEncoding(components, esc) {
3344
+ const func = esc !== true ? escape : unescape;
3345
+ if (components.scheme !== void 0) {
3346
+ components.scheme = func(components.scheme);
3347
+ }
3348
+ if (components.userinfo !== void 0) {
3349
+ components.userinfo = func(components.userinfo);
3350
+ }
3351
+ if (components.host !== void 0) {
3352
+ components.host = func(components.host);
3353
+ }
3354
+ if (components.path !== void 0) {
3355
+ components.path = func(components.path);
3356
+ }
3357
+ if (components.query !== void 0) {
3358
+ components.query = func(components.query);
3359
+ }
3360
+ if (components.fragment !== void 0) {
3361
+ components.fragment = func(components.fragment);
3362
+ }
3363
+ return components;
3364
+ }
3365
+ function recomposeAuthority(components, options) {
3366
+ const uriTokens = [];
3367
+ if (components.userinfo !== void 0) {
3368
+ uriTokens.push(components.userinfo);
3369
+ uriTokens.push("@");
3370
+ }
3371
+ if (components.host !== void 0) {
3372
+ let host = unescape(components.host);
3373
+ const ipV4res = normalizeIPv4(host);
3374
+ if (ipV4res.isIPV4) {
3375
+ host = ipV4res.host;
3376
+ } else {
3377
+ const ipV6res = normalizeIPv6(ipV4res.host, { isIPV4: false });
3378
+ if (ipV6res.isIPV6 === true) {
3379
+ host = `[${ipV6res.escapedHost}]`;
3380
+ } else {
3381
+ host = components.host;
3813
3382
  }
3814
- uriTokens.push(s);
3815
- }
3816
- if (components.query !== void 0) {
3817
- uriTokens.push("?");
3818
- uriTokens.push(components.query);
3819
3383
  }
3820
- if (components.fragment !== void 0) {
3821
- uriTokens.push("#");
3822
- uriTokens.push(components.fragment);
3823
- }
3824
- return uriTokens.join("");
3384
+ uriTokens.push(host);
3385
+ }
3386
+ if (typeof components.port === "number" || typeof components.port === "string") {
3387
+ uriTokens.push(":");
3388
+ uriTokens.push(String(components.port));
3825
3389
  }
3826
- function resolveComponents(base2, relative) {
3827
- var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3828
- var skipNormalization = arguments[3];
3829
- var target = {};
3830
- if (!skipNormalization) {
3831
- base2 = parse(serialize(base2, options), options);
3832
- relative = parse(serialize(relative, options), options);
3390
+ return uriTokens.length ? uriTokens.join("") : void 0;
3391
+ }
3392
+ module2.exports = {
3393
+ recomposeAuthority,
3394
+ normalizeComponentEncoding,
3395
+ removeDotSegments,
3396
+ normalizeIPv4,
3397
+ normalizeIPv6,
3398
+ stringArrayToHexStripped
3399
+ };
3400
+ }
3401
+ });
3402
+
3403
+ // node_modules/fast-uri/lib/schemes.js
3404
+ var require_schemes = __commonJS({
3405
+ "node_modules/fast-uri/lib/schemes.js"(exports, module2) {
3406
+ "use strict";
3407
+ var UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu;
3408
+ var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
3409
+ function isSecure(wsComponents) {
3410
+ return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
3411
+ }
3412
+ function httpParse(components) {
3413
+ if (!components.host) {
3414
+ components.error = components.error || "HTTP URIs must have a host.";
3415
+ }
3416
+ return components;
3417
+ }
3418
+ function httpSerialize(components) {
3419
+ const secure = String(components.scheme).toLowerCase() === "https";
3420
+ if (components.port === (secure ? 443 : 80) || components.port === "") {
3421
+ components.port = void 0;
3422
+ }
3423
+ if (!components.path) {
3424
+ components.path = "/";
3425
+ }
3426
+ return components;
3427
+ }
3428
+ function wsParse(wsComponents) {
3429
+ wsComponents.secure = isSecure(wsComponents);
3430
+ wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
3431
+ wsComponents.path = void 0;
3432
+ wsComponents.query = void 0;
3433
+ return wsComponents;
3434
+ }
3435
+ function wsSerialize(wsComponents) {
3436
+ if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
3437
+ wsComponents.port = void 0;
3438
+ }
3439
+ if (typeof wsComponents.secure === "boolean") {
3440
+ wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
3441
+ wsComponents.secure = void 0;
3442
+ }
3443
+ if (wsComponents.resourceName) {
3444
+ const [path, query] = wsComponents.resourceName.split("?");
3445
+ wsComponents.path = path && path !== "/" ? path : void 0;
3446
+ wsComponents.query = query;
3447
+ wsComponents.resourceName = void 0;
3448
+ }
3449
+ wsComponents.fragment = void 0;
3450
+ return wsComponents;
3451
+ }
3452
+ function urnParse(urnComponents, options) {
3453
+ if (!urnComponents.path) {
3454
+ urnComponents.error = "URN can not be parsed";
3455
+ return urnComponents;
3456
+ }
3457
+ const matches = urnComponents.path.match(URN_REG);
3458
+ if (matches) {
3459
+ const scheme = options.scheme || urnComponents.scheme || "urn";
3460
+ urnComponents.nid = matches[1].toLowerCase();
3461
+ urnComponents.nss = matches[2];
3462
+ const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`;
3463
+ const schemeHandler = SCHEMES[urnScheme];
3464
+ urnComponents.path = void 0;
3465
+ if (schemeHandler) {
3466
+ urnComponents = schemeHandler.parse(urnComponents, options);
3833
3467
  }
3834
- options = options || {};
3835
- if (!options.tolerant && relative.scheme) {
3836
- target.scheme = relative.scheme;
3468
+ } else {
3469
+ urnComponents.error = urnComponents.error || "URN can not be parsed.";
3470
+ }
3471
+ return urnComponents;
3472
+ }
3473
+ function urnSerialize(urnComponents, options) {
3474
+ const scheme = options.scheme || urnComponents.scheme || "urn";
3475
+ const nid = urnComponents.nid.toLowerCase();
3476
+ const urnScheme = `${scheme}:${options.nid || nid}`;
3477
+ const schemeHandler = SCHEMES[urnScheme];
3478
+ if (schemeHandler) {
3479
+ urnComponents = schemeHandler.serialize(urnComponents, options);
3480
+ }
3481
+ const uriComponents = urnComponents;
3482
+ const nss = urnComponents.nss;
3483
+ uriComponents.path = `${nid || options.nid}:${nss}`;
3484
+ options.skipEscape = true;
3485
+ return uriComponents;
3486
+ }
3487
+ function urnuuidParse(urnComponents, options) {
3488
+ const uuidComponents = urnComponents;
3489
+ uuidComponents.uuid = uuidComponents.nss;
3490
+ uuidComponents.nss = void 0;
3491
+ if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
3492
+ uuidComponents.error = uuidComponents.error || "UUID is not valid.";
3493
+ }
3494
+ return uuidComponents;
3495
+ }
3496
+ function urnuuidSerialize(uuidComponents) {
3497
+ const urnComponents = uuidComponents;
3498
+ urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
3499
+ return urnComponents;
3500
+ }
3501
+ var http = {
3502
+ scheme: "http",
3503
+ domainHost: true,
3504
+ parse: httpParse,
3505
+ serialize: httpSerialize
3506
+ };
3507
+ var https = {
3508
+ scheme: "https",
3509
+ domainHost: http.domainHost,
3510
+ parse: httpParse,
3511
+ serialize: httpSerialize
3512
+ };
3513
+ var ws = {
3514
+ scheme: "ws",
3515
+ domainHost: true,
3516
+ parse: wsParse,
3517
+ serialize: wsSerialize
3518
+ };
3519
+ var wss = {
3520
+ scheme: "wss",
3521
+ domainHost: ws.domainHost,
3522
+ parse: ws.parse,
3523
+ serialize: ws.serialize
3524
+ };
3525
+ var urn = {
3526
+ scheme: "urn",
3527
+ parse: urnParse,
3528
+ serialize: urnSerialize,
3529
+ skipNormalize: true
3530
+ };
3531
+ var urnuuid = {
3532
+ scheme: "urn:uuid",
3533
+ parse: urnuuidParse,
3534
+ serialize: urnuuidSerialize,
3535
+ skipNormalize: true
3536
+ };
3537
+ var SCHEMES = {
3538
+ http,
3539
+ https,
3540
+ ws,
3541
+ wss,
3542
+ urn,
3543
+ "urn:uuid": urnuuid
3544
+ };
3545
+ module2.exports = SCHEMES;
3546
+ }
3547
+ });
3548
+
3549
+ // node_modules/fast-uri/index.js
3550
+ var require_fast_uri = __commonJS({
3551
+ "node_modules/fast-uri/index.js"(exports, module2) {
3552
+ "use strict";
3553
+ var { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require_utils();
3554
+ var SCHEMES = require_schemes();
3555
+ function normalize(uri, options) {
3556
+ if (typeof uri === "string") {
3557
+ uri = serialize(parse(uri, options), options);
3558
+ } else if (typeof uri === "object") {
3559
+ uri = parse(serialize(uri, options), options);
3560
+ }
3561
+ return uri;
3562
+ }
3563
+ function resolve(baseURI, relativeURI, options) {
3564
+ const schemelessOptions = Object.assign({ scheme: "null" }, options);
3565
+ const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
3566
+ return serialize(resolved, __spreadProps(__spreadValues({}, schemelessOptions), { skipEscape: true }));
3567
+ }
3568
+ function resolveComponents(base, relative, options, skipNormalization) {
3569
+ const target = {};
3570
+ if (!skipNormalization) {
3571
+ base = parse(serialize(base, options), options);
3572
+ relative = parse(serialize(relative, options), options);
3573
+ }
3574
+ options = options || {};
3575
+ if (!options.tolerant && relative.scheme) {
3576
+ target.scheme = relative.scheme;
3577
+ target.userinfo = relative.userinfo;
3578
+ target.host = relative.host;
3579
+ target.port = relative.port;
3580
+ target.path = removeDotSegments(relative.path || "");
3581
+ target.query = relative.query;
3582
+ } else {
3583
+ if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
3837
3584
  target.userinfo = relative.userinfo;
3838
3585
  target.host = relative.host;
3839
3586
  target.port = relative.port;
3840
3587
  target.path = removeDotSegments(relative.path || "");
3841
3588
  target.query = relative.query;
3842
3589
  } else {
3843
- if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
3844
- target.userinfo = relative.userinfo;
3845
- target.host = relative.host;
3846
- target.port = relative.port;
3847
- target.path = removeDotSegments(relative.path || "");
3848
- target.query = relative.query;
3590
+ if (!relative.path) {
3591
+ target.path = base.path;
3592
+ if (relative.query !== void 0) {
3593
+ target.query = relative.query;
3594
+ } else {
3595
+ target.query = base.query;
3596
+ }
3849
3597
  } else {
3850
- if (!relative.path) {
3851
- target.path = base2.path;
3852
- if (relative.query !== void 0) {
3853
- target.query = relative.query;
3854
- } else {
3855
- target.query = base2.query;
3856
- }
3598
+ if (relative.path.charAt(0) === "/") {
3599
+ target.path = removeDotSegments(relative.path);
3857
3600
  } else {
3858
- if (relative.path.charAt(0) === "/") {
3859
- target.path = removeDotSegments(relative.path);
3601
+ if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
3602
+ target.path = "/" + relative.path;
3603
+ } else if (!base.path) {
3604
+ target.path = relative.path;
3860
3605
  } else {
3861
- if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
3862
- target.path = "/" + relative.path;
3863
- } else if (!base2.path) {
3864
- target.path = relative.path;
3865
- } else {
3866
- target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative.path;
3867
- }
3868
- target.path = removeDotSegments(target.path);
3606
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
3869
3607
  }
3870
- target.query = relative.query;
3608
+ target.path = removeDotSegments(target.path);
3871
3609
  }
3872
- target.userinfo = base2.userinfo;
3873
- target.host = base2.host;
3874
- target.port = base2.port;
3610
+ target.query = relative.query;
3875
3611
  }
3876
- target.scheme = base2.scheme;
3612
+ target.userinfo = base.userinfo;
3613
+ target.host = base.host;
3614
+ target.port = base.port;
3615
+ }
3616
+ target.scheme = base.scheme;
3617
+ }
3618
+ target.fragment = relative.fragment;
3619
+ return target;
3620
+ }
3621
+ function equal(uriA, uriB, options) {
3622
+ if (typeof uriA === "string") {
3623
+ uriA = unescape(uriA);
3624
+ uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), __spreadProps(__spreadValues({}, options), { skipEscape: true }));
3625
+ } else if (typeof uriA === "object") {
3626
+ uriA = serialize(normalizeComponentEncoding(uriA, true), __spreadProps(__spreadValues({}, options), { skipEscape: true }));
3627
+ }
3628
+ if (typeof uriB === "string") {
3629
+ uriB = unescape(uriB);
3630
+ uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), __spreadProps(__spreadValues({}, options), { skipEscape: true }));
3631
+ } else if (typeof uriB === "object") {
3632
+ uriB = serialize(normalizeComponentEncoding(uriB, true), __spreadProps(__spreadValues({}, options), { skipEscape: true }));
3633
+ }
3634
+ return uriA.toLowerCase() === uriB.toLowerCase();
3635
+ }
3636
+ function serialize(cmpts, opts) {
3637
+ const components = {
3638
+ host: cmpts.host,
3639
+ scheme: cmpts.scheme,
3640
+ userinfo: cmpts.userinfo,
3641
+ port: cmpts.port,
3642
+ path: cmpts.path,
3643
+ query: cmpts.query,
3644
+ nid: cmpts.nid,
3645
+ nss: cmpts.nss,
3646
+ uuid: cmpts.uuid,
3647
+ fragment: cmpts.fragment,
3648
+ reference: cmpts.reference,
3649
+ resourceName: cmpts.resourceName,
3650
+ secure: cmpts.secure,
3651
+ error: ""
3652
+ };
3653
+ const options = Object.assign({}, opts);
3654
+ const uriTokens = [];
3655
+ const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
3656
+ if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
3657
+ if (components.path !== void 0) {
3658
+ if (!options.skipEscape) {
3659
+ components.path = escape(components.path);
3660
+ if (components.scheme !== void 0) {
3661
+ components.path = components.path.split("%3A").join(":");
3662
+ }
3663
+ } else {
3664
+ components.path = unescape(components.path);
3877
3665
  }
3878
- target.fragment = relative.fragment;
3879
- return target;
3880
3666
  }
3881
- function resolve(baseURI, relativeURI, options) {
3882
- var schemelessOptions = assign({ scheme: "null" }, options);
3883
- return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
3667
+ if (options.reference !== "suffix" && components.scheme) {
3668
+ uriTokens.push(components.scheme);
3669
+ uriTokens.push(":");
3884
3670
  }
3885
- function normalize(uri, options) {
3886
- if (typeof uri === "string") {
3887
- uri = serialize(parse(uri, options), options);
3888
- } else if (typeOf(uri) === "object") {
3889
- uri = parse(serialize(uri, options), options);
3671
+ const authority = recomposeAuthority(components, options);
3672
+ if (authority !== void 0) {
3673
+ if (options.reference !== "suffix") {
3674
+ uriTokens.push("//");
3675
+ }
3676
+ uriTokens.push(authority);
3677
+ if (components.path && components.path.charAt(0) !== "/") {
3678
+ uriTokens.push("/");
3890
3679
  }
3891
- return uri;
3892
3680
  }
3893
- function equal(uriA, uriB, options) {
3894
- if (typeof uriA === "string") {
3895
- uriA = serialize(parse(uriA, options), options);
3896
- } else if (typeOf(uriA) === "object") {
3897
- uriA = serialize(uriA, options);
3681
+ if (components.path !== void 0) {
3682
+ let s = components.path;
3683
+ if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
3684
+ s = removeDotSegments(s);
3898
3685
  }
3899
- if (typeof uriB === "string") {
3900
- uriB = serialize(parse(uriB, options), options);
3901
- } else if (typeOf(uriB) === "object") {
3902
- uriB = serialize(uriB, options);
3686
+ if (authority === void 0) {
3687
+ s = s.replace(/^\/\//u, "/%2F");
3903
3688
  }
3904
- return uriA === uriB;
3689
+ uriTokens.push(s);
3905
3690
  }
3906
- function escapeComponent(str, options) {
3907
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
3691
+ if (components.query !== void 0) {
3692
+ uriTokens.push("?");
3693
+ uriTokens.push(components.query);
3908
3694
  }
3909
- function unescapeComponent(str, options) {
3910
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
3695
+ if (components.fragment !== void 0) {
3696
+ uriTokens.push("#");
3697
+ uriTokens.push(components.fragment);
3911
3698
  }
3912
- var handler = {
3913
- scheme: "http",
3914
- domainHost: true,
3915
- parse: function parse2(components, options) {
3916
- if (!components.host) {
3917
- components.error = components.error || "HTTP URIs must have a host.";
3918
- }
3919
- return components;
3920
- },
3921
- serialize: function serialize2(components, options) {
3922
- var secure = String(components.scheme).toLowerCase() === "https";
3923
- if (components.port === (secure ? 443 : 80) || components.port === "") {
3924
- components.port = void 0;
3925
- }
3926
- if (!components.path) {
3927
- components.path = "/";
3928
- }
3929
- return components;
3699
+ return uriTokens.join("");
3700
+ }
3701
+ var hexLookUp = Array.from({ length: 127 }, (v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)));
3702
+ function nonSimpleDomain(value) {
3703
+ let code = 0;
3704
+ for (let i = 0, len = value.length; i < len; ++i) {
3705
+ code = value.charCodeAt(i);
3706
+ if (code > 126 || hexLookUp[code]) {
3707
+ return true;
3930
3708
  }
3709
+ }
3710
+ return false;
3711
+ }
3712
+ var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3713
+ function parse(uri, opts) {
3714
+ const options = Object.assign({}, opts);
3715
+ const parsed = {
3716
+ scheme: void 0,
3717
+ userinfo: void 0,
3718
+ host: "",
3719
+ port: void 0,
3720
+ path: "",
3721
+ query: void 0,
3722
+ fragment: void 0
3931
3723
  };
3932
- var handler$1 = {
3933
- scheme: "https",
3934
- domainHost: handler.domainHost,
3935
- parse: handler.parse,
3936
- serialize: handler.serialize
3937
- };
3938
- function isSecure(wsComponents) {
3939
- return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
3940
- }
3941
- var handler$2 = {
3942
- scheme: "ws",
3943
- domainHost: true,
3944
- parse: function parse2(components, options) {
3945
- var wsComponents = components;
3946
- wsComponents.secure = isSecure(wsComponents);
3947
- wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
3948
- wsComponents.path = void 0;
3949
- wsComponents.query = void 0;
3950
- return wsComponents;
3951
- },
3952
- serialize: function serialize2(wsComponents, options) {
3953
- if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
3954
- wsComponents.port = void 0;
3955
- }
3956
- if (typeof wsComponents.secure === "boolean") {
3957
- wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
3958
- wsComponents.secure = void 0;
3959
- }
3960
- if (wsComponents.resourceName) {
3961
- var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1];
3962
- wsComponents.path = path && path !== "/" ? path : void 0;
3963
- wsComponents.query = query;
3964
- wsComponents.resourceName = void 0;
3724
+ const gotEncoding = uri.indexOf("%") !== -1;
3725
+ let isIP = false;
3726
+ if (options.reference === "suffix") uri = (options.scheme ? options.scheme + ":" : "") + "//" + uri;
3727
+ const matches = uri.match(URI_PARSE);
3728
+ if (matches) {
3729
+ parsed.scheme = matches[1];
3730
+ parsed.userinfo = matches[3];
3731
+ parsed.host = matches[4];
3732
+ parsed.port = parseInt(matches[5], 10);
3733
+ parsed.path = matches[6] || "";
3734
+ parsed.query = matches[7];
3735
+ parsed.fragment = matches[8];
3736
+ if (isNaN(parsed.port)) {
3737
+ parsed.port = matches[5];
3738
+ }
3739
+ if (parsed.host) {
3740
+ const ipv4result = normalizeIPv4(parsed.host);
3741
+ if (ipv4result.isIPV4 === false) {
3742
+ const ipv6result = normalizeIPv6(ipv4result.host, { isIPV4: false });
3743
+ parsed.host = ipv6result.host.toLowerCase();
3744
+ isIP = ipv6result.isIPV6;
3745
+ } else {
3746
+ parsed.host = ipv4result.host;
3747
+ isIP = true;
3965
3748
  }
3966
- wsComponents.fragment = void 0;
3967
- return wsComponents;
3968
3749
  }
3969
- };
3970
- var handler$3 = {
3971
- scheme: "wss",
3972
- domainHost: handler$2.domainHost,
3973
- parse: handler$2.parse,
3974
- serialize: handler$2.serialize
3975
- };
3976
- var O = {};
3977
- var isIRI = true;
3978
- var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
3979
- var HEXDIG$$ = "[0-9A-Fa-f]";
3980
- var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$));
3981
- var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
3982
- var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
3983
- var VCHAR$$ = merge(QTEXT$$, '[\\"\\\\]');
3984
- var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
3985
- var UNRESERVED = new RegExp(UNRESERVED$$, "g");
3986
- var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
3987
- var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
3988
- var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
3989
- var NOT_HFVALUE = NOT_HFNAME;
3990
- function decodeUnreserved(str) {
3991
- var decStr = pctDecChars(str);
3992
- return !decStr.match(UNRESERVED) ? str : decStr;
3993
- }
3994
- var handler$4 = {
3995
- scheme: "mailto",
3996
- parse: function parse$$1(components, options) {
3997
- var mailtoComponents = components;
3998
- var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
3999
- mailtoComponents.path = void 0;
4000
- if (mailtoComponents.query) {
4001
- var unknownHeaders = false;
4002
- var headers = {};
4003
- var hfields = mailtoComponents.query.split("&");
4004
- for (var x = 0, xl = hfields.length; x < xl; ++x) {
4005
- var hfield = hfields[x].split("=");
4006
- switch (hfield[0]) {
4007
- case "to":
4008
- var toAddrs = hfield[1].split(",");
4009
- for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
4010
- to.push(toAddrs[_x]);
4011
- }
4012
- break;
4013
- case "subject":
4014
- mailtoComponents.subject = unescapeComponent(hfield[1], options);
4015
- break;
4016
- case "body":
4017
- mailtoComponents.body = unescapeComponent(hfield[1], options);
4018
- break;
4019
- default:
4020
- unknownHeaders = true;
4021
- headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
4022
- break;
4023
- }
3750
+ if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && !parsed.path && parsed.query === void 0) {
3751
+ parsed.reference = "same-document";
3752
+ } else if (parsed.scheme === void 0) {
3753
+ parsed.reference = "relative";
3754
+ } else if (parsed.fragment === void 0) {
3755
+ parsed.reference = "absolute";
3756
+ } else {
3757
+ parsed.reference = "uri";
3758
+ }
3759
+ if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
3760
+ parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
3761
+ }
3762
+ const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || "").toLowerCase()];
3763
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
3764
+ if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
3765
+ try {
3766
+ parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
3767
+ } catch (e) {
3768
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
4024
3769
  }
4025
- if (unknownHeaders) mailtoComponents.headers = headers;
4026
3770
  }
4027
- mailtoComponents.query = void 0;
4028
- for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
4029
- var addr = to[_x2].split("@");
4030
- addr[0] = unescapeComponent(addr[0]);
4031
- if (!options.unicodeSupport) {
4032
- try {
4033
- addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
4034
- } catch (e) {
4035
- mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
4036
- }
4037
- } else {
4038
- addr[1] = unescapeComponent(addr[1], options).toLowerCase();
4039
- }
4040
- to[_x2] = addr.join("@");
3771
+ }
3772
+ if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
3773
+ if (gotEncoding && parsed.scheme !== void 0) {
3774
+ parsed.scheme = unescape(parsed.scheme);
4041
3775
  }
4042
- return mailtoComponents;
4043
- },
4044
- serialize: function serialize$$1(mailtoComponents, options) {
4045
- var components = mailtoComponents;
4046
- var to = toArray(mailtoComponents.to);
4047
- if (to) {
4048
- for (var x = 0, xl = to.length; x < xl; ++x) {
4049
- var toAddr = String(to[x]);
4050
- var atIdx = toAddr.lastIndexOf("@");
4051
- var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
4052
- var domain = toAddr.slice(atIdx + 1);
4053
- try {
4054
- domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
4055
- } catch (e) {
4056
- components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
4057
- }
4058
- to[x] = localPart + "@" + domain;
4059
- }
4060
- components.path = to.join(",");
3776
+ if (gotEncoding && parsed.userinfo !== void 0) {
3777
+ parsed.userinfo = unescape(parsed.userinfo);
4061
3778
  }
4062
- var headers = mailtoComponents.headers = mailtoComponents.headers || {};
4063
- if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
4064
- if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
4065
- var fields = [];
4066
- for (var name in headers) {
4067
- if (headers[name] !== O[name]) {
4068
- 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));
4069
- }
3779
+ if (gotEncoding && parsed.host !== void 0) {
3780
+ parsed.host = unescape(parsed.host);
4070
3781
  }
4071
- if (fields.length) {
4072
- components.query = fields.join("&");
3782
+ if (parsed.path !== void 0 && parsed.path.length) {
3783
+ parsed.path = escape(unescape(parsed.path));
4073
3784
  }
4074
- return components;
4075
- }
4076
- };
4077
- var URN_PARSE = /^([^\:]+)\:(.*)/;
4078
- var handler$5 = {
4079
- scheme: "urn",
4080
- parse: function parse$$1(components, options) {
4081
- var matches = components.path && components.path.match(URN_PARSE);
4082
- var urnComponents = components;
4083
- if (matches) {
4084
- var scheme = options.scheme || urnComponents.scheme || "urn";
4085
- var nid = matches[1].toLowerCase();
4086
- var nss = matches[2];
4087
- var urnScheme = scheme + ":" + (options.nid || nid);
4088
- var schemeHandler = SCHEMES[urnScheme];
4089
- urnComponents.nid = nid;
4090
- urnComponents.nss = nss;
4091
- urnComponents.path = void 0;
4092
- if (schemeHandler) {
4093
- urnComponents = schemeHandler.parse(urnComponents, options);
4094
- }
4095
- } else {
4096
- urnComponents.error = urnComponents.error || "URN can not be parsed.";
3785
+ if (parsed.fragment !== void 0 && parsed.fragment.length) {
3786
+ parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
4097
3787
  }
4098
- return urnComponents;
4099
- },
4100
- serialize: function serialize$$1(urnComponents, options) {
4101
- var scheme = options.scheme || urnComponents.scheme || "urn";
4102
- var nid = urnComponents.nid;
4103
- var urnScheme = scheme + ":" + (options.nid || nid);
4104
- var schemeHandler = SCHEMES[urnScheme];
4105
- if (schemeHandler) {
4106
- urnComponents = schemeHandler.serialize(urnComponents, options);
4107
- }
4108
- var uriComponents = urnComponents;
4109
- var nss = urnComponents.nss;
4110
- uriComponents.path = (nid || options.nid) + ":" + nss;
4111
- return uriComponents;
4112
3788
  }
4113
- };
4114
- var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
4115
- var handler$6 = {
4116
- scheme: "urn:uuid",
4117
- parse: function parse2(urnComponents, options) {
4118
- var uuidComponents = urnComponents;
4119
- uuidComponents.uuid = uuidComponents.nss;
4120
- uuidComponents.nss = void 0;
4121
- if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
4122
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";
4123
- }
4124
- return uuidComponents;
4125
- },
4126
- serialize: function serialize2(uuidComponents, options) {
4127
- var urnComponents = uuidComponents;
4128
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
4129
- return urnComponents;
3789
+ if (schemeHandler && schemeHandler.parse) {
3790
+ schemeHandler.parse(parsed, options);
4130
3791
  }
4131
- };
4132
- SCHEMES[handler.scheme] = handler;
4133
- SCHEMES[handler$1.scheme] = handler$1;
4134
- SCHEMES[handler$2.scheme] = handler$2;
4135
- SCHEMES[handler$3.scheme] = handler$3;
4136
- SCHEMES[handler$4.scheme] = handler$4;
4137
- SCHEMES[handler$5.scheme] = handler$5;
4138
- SCHEMES[handler$6.scheme] = handler$6;
4139
- exports2.SCHEMES = SCHEMES;
4140
- exports2.pctEncChar = pctEncChar;
4141
- exports2.pctDecChars = pctDecChars;
4142
- exports2.parse = parse;
4143
- exports2.removeDotSegments = removeDotSegments;
4144
- exports2.serialize = serialize;
4145
- exports2.resolveComponents = resolveComponents;
4146
- exports2.resolve = resolve;
4147
- exports2.normalize = normalize;
4148
- exports2.equal = equal;
4149
- exports2.escapeComponent = escapeComponent;
4150
- exports2.unescapeComponent = unescapeComponent;
4151
- Object.defineProperty(exports2, "__esModule", { value: true });
4152
- });
3792
+ } else {
3793
+ parsed.error = parsed.error || "URI can not be parsed.";
3794
+ }
3795
+ return parsed;
3796
+ }
3797
+ var fastUri = {
3798
+ SCHEMES,
3799
+ normalize,
3800
+ resolve,
3801
+ resolveComponents,
3802
+ equal,
3803
+ serialize,
3804
+ parse
3805
+ };
3806
+ module2.exports = fastUri;
3807
+ module2.exports.default = fastUri;
3808
+ module2.exports.fastUri = fastUri;
4153
3809
  }
4154
3810
  });
4155
3811
 
@@ -4158,7 +3814,7 @@ var require_uri = __commonJS({
4158
3814
  "node_modules/ajv/dist/runtime/uri.js"(exports) {
4159
3815
  "use strict";
4160
3816
  Object.defineProperty(exports, "__esModule", { value: true });
4161
- var uri = require_uri_all();
3817
+ var uri = require_fast_uri();
4162
3818
  uri.code = 'require("ajv/dist/runtime/uri").default';
4163
3819
  exports.default = uri;
4164
3820
  }
@@ -7029,7 +6685,7 @@ var ajv = new import_ajv.default({
7029
6685
  coerceTypes: true,
7030
6686
  // Client side allows looser input, API will not
7031
6687
  formats: {
7032
- validkey: /^[A-Za-z_][A-Za-z0-9_-]+?$/
6688
+ validkey: /^(?!.*\.\.)[a-zA-Z_][a-zA-Z0-9_.-]*[a-zA-Z0-9_-]$/
7033
6689
  },
7034
6690
  strict: false
7035
6691
  });
@@ -8950,8 +8606,3 @@ var Validator = {
8950
8606
  };
8951
8607
  var createValidator = Validator.createValidator;
8952
8608
  var getValidator = Validator.getValidator;
8953
- /*! Bundled license information:
8954
-
8955
- uri-js/dist/es5/uri.all.js:
8956
- (** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
8957
- */