@rebilly/instruments 9.57.0 → 9.57.2

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/index.js CHANGED
@@ -779,6 +779,32 @@ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof win
779
779
  function getDefaultExportFromCjs(x2) {
780
780
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
781
781
  }
782
+ function getAugmentedNamespace(n2) {
783
+ if (n2.__esModule)
784
+ return n2;
785
+ var f = n2.default;
786
+ if (typeof f == "function") {
787
+ var a = function a2() {
788
+ if (this instanceof a2) {
789
+ return Reflect.construct(f, arguments, this.constructor);
790
+ }
791
+ return f.apply(this, arguments);
792
+ };
793
+ a.prototype = f.prototype;
794
+ } else
795
+ a = {};
796
+ Object.defineProperty(a, "__esModule", { value: true });
797
+ Object.keys(n2).forEach(function(k2) {
798
+ var d2 = Object.getOwnPropertyDescriptor(n2, k2);
799
+ Object.defineProperty(a, k2, d2.get ? d2 : {
800
+ enumerable: true,
801
+ get: function() {
802
+ return n2[k2];
803
+ }
804
+ });
805
+ });
806
+ return a;
807
+ }
782
808
  function listCacheClear$1() {
783
809
  this.__data__ = [];
784
810
  this.size = 0;
@@ -3709,7 +3735,7 @@ const toJSONObject = (obj) => {
3709
3735
  };
3710
3736
  const isAsyncFn = kindOfTest("AsyncFunction");
3711
3737
  const isThenable = (thing) => thing && (isObject$1(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
3712
- const utils$1 = {
3738
+ const utils$2 = {
3713
3739
  isArray,
3714
3740
  isArrayBuffer,
3715
3741
  isBuffer,
@@ -3781,7 +3807,7 @@ function AxiosError(message, code2, config, request, response) {
3781
3807
  request && (this.request = request);
3782
3808
  response && (this.response = response);
3783
3809
  }
3784
- utils$1.inherits(AxiosError, Error, {
3810
+ utils$2.inherits(AxiosError, Error, {
3785
3811
  toJSON: function toJSON() {
3786
3812
  return {
3787
3813
  // Standard
@@ -3796,7 +3822,7 @@ utils$1.inherits(AxiosError, Error, {
3796
3822
  columnNumber: this.columnNumber,
3797
3823
  stack: this.stack,
3798
3824
  // Axios
3799
- config: utils$1.toJSONObject(this.config),
3825
+ config: utils$2.toJSONObject(this.config),
3800
3826
  code: this.code,
3801
3827
  status: this.response && this.response.status ? this.response.status : null
3802
3828
  };
@@ -3825,7 +3851,7 @@ Object.defineProperties(AxiosError, descriptors);
3825
3851
  Object.defineProperty(prototype$1, "isAxiosError", { value: true });
3826
3852
  AxiosError.from = (error2, code2, config, request, response, customProps) => {
3827
3853
  const axiosError = Object.create(prototype$1);
3828
- utils$1.toFlatObject(error2, axiosError, function filter2(obj) {
3854
+ utils$2.toFlatObject(error2, axiosError, function filter2(obj) {
3829
3855
  return obj !== Error.prototype;
3830
3856
  }, (prop) => {
3831
3857
  return prop !== "isAxiosError";
@@ -3838,10 +3864,10 @@ AxiosError.from = (error2, code2, config, request, response, customProps) => {
3838
3864
  };
3839
3865
  const httpAdapter = null;
3840
3866
  function isVisitable(thing) {
3841
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
3867
+ return utils$2.isPlainObject(thing) || utils$2.isArray(thing);
3842
3868
  }
3843
3869
  function removeBrackets(key) {
3844
- return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
3870
+ return utils$2.endsWith(key, "[]") ? key.slice(0, -2) : key;
3845
3871
  }
3846
3872
  function renderKey(path, key, dots) {
3847
3873
  if (!path)
@@ -3852,42 +3878,42 @@ function renderKey(path, key, dots) {
3852
3878
  }).join(dots ? "." : "");
3853
3879
  }
3854
3880
  function isFlatArray(arr) {
3855
- return utils$1.isArray(arr) && !arr.some(isVisitable);
3881
+ return utils$2.isArray(arr) && !arr.some(isVisitable);
3856
3882
  }
3857
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
3883
+ const predicates = utils$2.toFlatObject(utils$2, {}, null, function filter(prop) {
3858
3884
  return /^is[A-Z]/.test(prop);
3859
3885
  });
3860
3886
  function toFormData(obj, formData, options) {
3861
- if (!utils$1.isObject(obj)) {
3887
+ if (!utils$2.isObject(obj)) {
3862
3888
  throw new TypeError("target must be an object");
3863
3889
  }
3864
3890
  formData = formData || new FormData();
3865
- options = utils$1.toFlatObject(options, {
3891
+ options = utils$2.toFlatObject(options, {
3866
3892
  metaTokens: true,
3867
3893
  dots: false,
3868
3894
  indexes: false
3869
3895
  }, false, function defined(option, source) {
3870
- return !utils$1.isUndefined(source[option]);
3896
+ return !utils$2.isUndefined(source[option]);
3871
3897
  });
3872
3898
  const metaTokens = options.metaTokens;
3873
3899
  const visitor = options.visitor || defaultVisitor;
3874
3900
  const dots = options.dots;
3875
3901
  const indexes = options.indexes;
3876
3902
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
3877
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
3878
- if (!utils$1.isFunction(visitor)) {
3903
+ const useBlob = _Blob && utils$2.isSpecCompliantForm(formData);
3904
+ if (!utils$2.isFunction(visitor)) {
3879
3905
  throw new TypeError("visitor must be a function");
3880
3906
  }
3881
3907
  function convertValue(value) {
3882
3908
  if (value === null)
3883
3909
  return "";
3884
- if (utils$1.isDate(value)) {
3910
+ if (utils$2.isDate(value)) {
3885
3911
  return value.toISOString();
3886
3912
  }
3887
- if (!useBlob && utils$1.isBlob(value)) {
3913
+ if (!useBlob && utils$2.isBlob(value)) {
3888
3914
  throw new AxiosError("Blob is not supported. Use a Buffer instead.");
3889
3915
  }
3890
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
3916
+ if (utils$2.isArrayBuffer(value) || utils$2.isTypedArray(value)) {
3891
3917
  return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
3892
3918
  }
3893
3919
  return value;
@@ -3895,13 +3921,13 @@ function toFormData(obj, formData, options) {
3895
3921
  function defaultVisitor(value, key, path) {
3896
3922
  let arr = value;
3897
3923
  if (value && !path && typeof value === "object") {
3898
- if (utils$1.endsWith(key, "{}")) {
3924
+ if (utils$2.endsWith(key, "{}")) {
3899
3925
  key = metaTokens ? key : key.slice(0, -2);
3900
3926
  value = JSON.stringify(value);
3901
- } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
3927
+ } else if (utils$2.isArray(value) && isFlatArray(value) || (utils$2.isFileList(value) || utils$2.endsWith(key, "[]")) && (arr = utils$2.toArray(value))) {
3902
3928
  key = removeBrackets(key);
3903
3929
  arr.forEach(function each(el, index2) {
3904
- !(utils$1.isUndefined(el) || el === null) && formData.append(
3930
+ !(utils$2.isUndefined(el) || el === null) && formData.append(
3905
3931
  // eslint-disable-next-line no-nested-ternary
3906
3932
  indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
3907
3933
  convertValue(el)
@@ -3923,17 +3949,17 @@ function toFormData(obj, formData, options) {
3923
3949
  isVisitable
3924
3950
  });
3925
3951
  function build(value, path) {
3926
- if (utils$1.isUndefined(value))
3952
+ if (utils$2.isUndefined(value))
3927
3953
  return;
3928
3954
  if (stack.indexOf(value) !== -1) {
3929
3955
  throw Error("Circular reference detected in " + path.join("."));
3930
3956
  }
3931
3957
  stack.push(value);
3932
- utils$1.forEach(value, function each(el, key) {
3933
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
3958
+ utils$2.forEach(value, function each(el, key) {
3959
+ const result = !(utils$2.isUndefined(el) || el === null) && visitor.call(
3934
3960
  formData,
3935
3961
  el,
3936
- utils$1.isString(key) ? key.trim() : key,
3962
+ utils$2.isString(key) ? key.trim() : key,
3937
3963
  path,
3938
3964
  exposedHelpers
3939
3965
  );
@@ -3943,7 +3969,7 @@ function toFormData(obj, formData, options) {
3943
3969
  });
3944
3970
  stack.pop();
3945
3971
  }
3946
- if (!utils$1.isObject(obj)) {
3972
+ if (!utils$2.isObject(obj)) {
3947
3973
  throw new TypeError("data must be an object");
3948
3974
  }
3949
3975
  build(obj);
@@ -3992,7 +4018,7 @@ function buildURL(url, params, options) {
3992
4018
  if (serializeFn) {
3993
4019
  serializedParams = serializeFn(params, options);
3994
4020
  } else {
3995
- serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
4021
+ serializedParams = utils$2.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
3996
4022
  }
3997
4023
  if (serializedParams) {
3998
4024
  const hashmarkIndex = url.indexOf("#");
@@ -4057,7 +4083,7 @@ class InterceptorManager {
4057
4083
  * @returns {void}
4058
4084
  */
4059
4085
  forEach(fn) {
4060
- utils$1.forEach(this.handlers, function forEachHandler(h) {
4086
+ utils$2.forEach(this.handlers, function forEachHandler(h) {
4061
4087
  if (h !== null) {
4062
4088
  fn(h);
4063
4089
  }
@@ -4090,7 +4116,7 @@ const hasStandardBrowserWebWorkerEnv = (() => {
4090
4116
  self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
4091
4117
  })();
4092
4118
  const origin = hasBrowserEnv && window.location.href || "http://localhost";
4093
- const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4119
+ const utils$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4094
4120
  __proto__: null,
4095
4121
  hasBrowserEnv,
4096
4122
  hasStandardBrowserEnv,
@@ -4098,13 +4124,13 @@ const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
4098
4124
  origin
4099
4125
  }, Symbol.toStringTag, { value: "Module" }));
4100
4126
  const platform = {
4101
- ...utils,
4127
+ ...utils$1,
4102
4128
  ...platform$1
4103
4129
  };
4104
4130
  function toURLEncodedForm(data, options) {
4105
4131
  return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
4106
4132
  visitor: function(value, key, path, helpers) {
4107
- if (platform.isNode && utils$1.isBuffer(value)) {
4133
+ if (platform.isNode && utils$2.isBuffer(value)) {
4108
4134
  this.append(key, value.toString("base64"));
4109
4135
  return false;
4110
4136
  }
@@ -4113,7 +4139,7 @@ function toURLEncodedForm(data, options) {
4113
4139
  }, options));
4114
4140
  }
4115
4141
  function parsePropPath(name) {
4116
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
4142
+ return utils$2.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
4117
4143
  return match[0] === "[]" ? "" : match[1] || match[0];
4118
4144
  });
4119
4145
  }
@@ -4136,27 +4162,27 @@ function formDataToJSON(formData) {
4136
4162
  return true;
4137
4163
  const isNumericKey = Number.isFinite(+name);
4138
4164
  const isLast = index2 >= path.length;
4139
- name = !name && utils$1.isArray(target) ? target.length : name;
4165
+ name = !name && utils$2.isArray(target) ? target.length : name;
4140
4166
  if (isLast) {
4141
- if (utils$1.hasOwnProp(target, name)) {
4167
+ if (utils$2.hasOwnProp(target, name)) {
4142
4168
  target[name] = [target[name], value];
4143
4169
  } else {
4144
4170
  target[name] = value;
4145
4171
  }
4146
4172
  return !isNumericKey;
4147
4173
  }
4148
- if (!target[name] || !utils$1.isObject(target[name])) {
4174
+ if (!target[name] || !utils$2.isObject(target[name])) {
4149
4175
  target[name] = [];
4150
4176
  }
4151
4177
  const result = buildPath(path, value, target[name], index2);
4152
- if (result && utils$1.isArray(target[name])) {
4178
+ if (result && utils$2.isArray(target[name])) {
4153
4179
  target[name] = arrayToObject(target[name]);
4154
4180
  }
4155
4181
  return !isNumericKey;
4156
4182
  }
4157
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
4183
+ if (utils$2.isFormData(formData) && utils$2.isFunction(formData.entries)) {
4158
4184
  const obj = {};
4159
- utils$1.forEachEntry(formData, (name, value) => {
4185
+ utils$2.forEachEntry(formData, (name, value) => {
4160
4186
  buildPath(parsePropPath(name), value, obj, 0);
4161
4187
  });
4162
4188
  return obj;
@@ -4164,10 +4190,10 @@ function formDataToJSON(formData) {
4164
4190
  return null;
4165
4191
  }
4166
4192
  function stringifySafely(rawValue, parser, encoder) {
4167
- if (utils$1.isString(rawValue)) {
4193
+ if (utils$2.isString(rawValue)) {
4168
4194
  try {
4169
4195
  (parser || JSON.parse)(rawValue);
4170
- return utils$1.trim(rawValue);
4196
+ return utils$2.trim(rawValue);
4171
4197
  } catch (e2) {
4172
4198
  if (e2.name !== "SyntaxError") {
4173
4199
  throw e2;
@@ -4182,21 +4208,21 @@ const defaults$1 = {
4182
4208
  transformRequest: [function transformRequest(data, headers) {
4183
4209
  const contentType = headers.getContentType() || "";
4184
4210
  const hasJSONContentType = contentType.indexOf("application/json") > -1;
4185
- const isObjectPayload = utils$1.isObject(data);
4186
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
4211
+ const isObjectPayload = utils$2.isObject(data);
4212
+ if (isObjectPayload && utils$2.isHTMLForm(data)) {
4187
4213
  data = new FormData(data);
4188
4214
  }
4189
- const isFormData2 = utils$1.isFormData(data);
4215
+ const isFormData2 = utils$2.isFormData(data);
4190
4216
  if (isFormData2) {
4191
4217
  return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
4192
4218
  }
4193
- if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
4219
+ if (utils$2.isArrayBuffer(data) || utils$2.isBuffer(data) || utils$2.isStream(data) || utils$2.isFile(data) || utils$2.isBlob(data) || utils$2.isReadableStream(data)) {
4194
4220
  return data;
4195
4221
  }
4196
- if (utils$1.isArrayBufferView(data)) {
4222
+ if (utils$2.isArrayBufferView(data)) {
4197
4223
  return data.buffer;
4198
4224
  }
4199
- if (utils$1.isURLSearchParams(data)) {
4225
+ if (utils$2.isURLSearchParams(data)) {
4200
4226
  headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
4201
4227
  return data.toString();
4202
4228
  }
@@ -4205,7 +4231,7 @@ const defaults$1 = {
4205
4231
  if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
4206
4232
  return toURLEncodedForm(data, this.formSerializer).toString();
4207
4233
  }
4208
- if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
4234
+ if ((isFileList2 = utils$2.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
4209
4235
  const _FormData = this.env && this.env.FormData;
4210
4236
  return toFormData(
4211
4237
  isFileList2 ? { "files[]": data } : data,
@@ -4224,10 +4250,10 @@ const defaults$1 = {
4224
4250
  const transitional2 = this.transitional || defaults$1.transitional;
4225
4251
  const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
4226
4252
  const JSONRequested = this.responseType === "json";
4227
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
4253
+ if (utils$2.isResponse(data) || utils$2.isReadableStream(data)) {
4228
4254
  return data;
4229
4255
  }
4230
- if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
4256
+ if (data && utils$2.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
4231
4257
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
4232
4258
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
4233
4259
  try {
@@ -4266,11 +4292,11 @@ const defaults$1 = {
4266
4292
  }
4267
4293
  }
4268
4294
  };
4269
- utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
4295
+ utils$2.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
4270
4296
  defaults$1.headers[method] = {};
4271
4297
  });
4272
4298
  const defaults$2 = defaults$1;
4273
- const ignoreDuplicateOf = utils$1.toObjectSet([
4299
+ const ignoreDuplicateOf = utils$2.toObjectSet([
4274
4300
  "age",
4275
4301
  "authorization",
4276
4302
  "content-length",
@@ -4321,7 +4347,7 @@ function normalizeValue(value) {
4321
4347
  if (value === false || value == null) {
4322
4348
  return value;
4323
4349
  }
4324
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
4350
+ return utils$2.isArray(value) ? value.map(normalizeValue) : String(value);
4325
4351
  }
4326
4352
  function parseTokens(str) {
4327
4353
  const tokens = /* @__PURE__ */ Object.create(null);
@@ -4334,18 +4360,18 @@ function parseTokens(str) {
4334
4360
  }
4335
4361
  const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
4336
4362
  function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
4337
- if (utils$1.isFunction(filter2)) {
4363
+ if (utils$2.isFunction(filter2)) {
4338
4364
  return filter2.call(this, value, header);
4339
4365
  }
4340
4366
  if (isHeaderNameFilter) {
4341
4367
  value = header;
4342
4368
  }
4343
- if (!utils$1.isString(value))
4369
+ if (!utils$2.isString(value))
4344
4370
  return;
4345
- if (utils$1.isString(filter2)) {
4371
+ if (utils$2.isString(filter2)) {
4346
4372
  return value.indexOf(filter2) !== -1;
4347
4373
  }
4348
- if (utils$1.isRegExp(filter2)) {
4374
+ if (utils$2.isRegExp(filter2)) {
4349
4375
  return filter2.test(value);
4350
4376
  }
4351
4377
  }
@@ -4355,7 +4381,7 @@ function formatHeader(header) {
4355
4381
  });
4356
4382
  }
4357
4383
  function buildAccessors(obj, header) {
4358
- const accessorName = utils$1.toCamelCase(" " + header);
4384
+ const accessorName = utils$2.toCamelCase(" " + header);
4359
4385
  ["get", "set", "has"].forEach((methodName) => {
4360
4386
  Object.defineProperty(obj, methodName + accessorName, {
4361
4387
  value: function(arg1, arg2, arg3) {
@@ -4376,17 +4402,17 @@ class AxiosHeaders {
4376
4402
  if (!lHeader) {
4377
4403
  throw new Error("header name must be a non-empty string");
4378
4404
  }
4379
- const key = utils$1.findKey(self2, lHeader);
4405
+ const key = utils$2.findKey(self2, lHeader);
4380
4406
  if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
4381
4407
  self2[key || _header] = normalizeValue(_value);
4382
4408
  }
4383
4409
  }
4384
- const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
4385
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
4410
+ const setHeaders = (headers, _rewrite) => utils$2.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
4411
+ if (utils$2.isPlainObject(header) || header instanceof this.constructor) {
4386
4412
  setHeaders(header, valueOrRewrite);
4387
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
4413
+ } else if (utils$2.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
4388
4414
  setHeaders(parseHeaders(header), valueOrRewrite);
4389
- } else if (utils$1.isHeaders(header)) {
4415
+ } else if (utils$2.isHeaders(header)) {
4390
4416
  for (const [key, value] of header.entries()) {
4391
4417
  setHeader(value, key, rewrite);
4392
4418
  }
@@ -4398,7 +4424,7 @@ class AxiosHeaders {
4398
4424
  get(header, parser) {
4399
4425
  header = normalizeHeader(header);
4400
4426
  if (header) {
4401
- const key = utils$1.findKey(this, header);
4427
+ const key = utils$2.findKey(this, header);
4402
4428
  if (key) {
4403
4429
  const value = this[key];
4404
4430
  if (!parser) {
@@ -4407,10 +4433,10 @@ class AxiosHeaders {
4407
4433
  if (parser === true) {
4408
4434
  return parseTokens(value);
4409
4435
  }
4410
- if (utils$1.isFunction(parser)) {
4436
+ if (utils$2.isFunction(parser)) {
4411
4437
  return parser.call(this, value, key);
4412
4438
  }
4413
- if (utils$1.isRegExp(parser)) {
4439
+ if (utils$2.isRegExp(parser)) {
4414
4440
  return parser.exec(value);
4415
4441
  }
4416
4442
  throw new TypeError("parser must be boolean|regexp|function");
@@ -4420,7 +4446,7 @@ class AxiosHeaders {
4420
4446
  has(header, matcher) {
4421
4447
  header = normalizeHeader(header);
4422
4448
  if (header) {
4423
- const key = utils$1.findKey(this, header);
4449
+ const key = utils$2.findKey(this, header);
4424
4450
  return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
4425
4451
  }
4426
4452
  return false;
@@ -4431,14 +4457,14 @@ class AxiosHeaders {
4431
4457
  function deleteHeader(_header) {
4432
4458
  _header = normalizeHeader(_header);
4433
4459
  if (_header) {
4434
- const key = utils$1.findKey(self2, _header);
4460
+ const key = utils$2.findKey(self2, _header);
4435
4461
  if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
4436
4462
  delete self2[key];
4437
4463
  deleted = true;
4438
4464
  }
4439
4465
  }
4440
4466
  }
4441
- if (utils$1.isArray(header)) {
4467
+ if (utils$2.isArray(header)) {
4442
4468
  header.forEach(deleteHeader);
4443
4469
  } else {
4444
4470
  deleteHeader(header);
@@ -4461,8 +4487,8 @@ class AxiosHeaders {
4461
4487
  normalize(format2) {
4462
4488
  const self2 = this;
4463
4489
  const headers = {};
4464
- utils$1.forEach(this, (value, header) => {
4465
- const key = utils$1.findKey(headers, header);
4490
+ utils$2.forEach(this, (value, header) => {
4491
+ const key = utils$2.findKey(headers, header);
4466
4492
  if (key) {
4467
4493
  self2[key] = normalizeValue(value);
4468
4494
  delete self2[header];
@@ -4482,8 +4508,8 @@ class AxiosHeaders {
4482
4508
  }
4483
4509
  toJSON(asStrings) {
4484
4510
  const obj = /* @__PURE__ */ Object.create(null);
4485
- utils$1.forEach(this, (value, header) => {
4486
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
4511
+ utils$2.forEach(this, (value, header) => {
4512
+ value != null && value !== false && (obj[header] = asStrings && utils$2.isArray(value) ? value.join(", ") : value);
4487
4513
  });
4488
4514
  return obj;
4489
4515
  }
@@ -4517,12 +4543,12 @@ class AxiosHeaders {
4517
4543
  accessors[lHeader] = true;
4518
4544
  }
4519
4545
  }
4520
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
4546
+ utils$2.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
4521
4547
  return this;
4522
4548
  }
4523
4549
  }
4524
4550
  AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
4525
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
4551
+ utils$2.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
4526
4552
  let mapped = key[0].toUpperCase() + key.slice(1);
4527
4553
  return {
4528
4554
  get: () => value,
@@ -4531,14 +4557,14 @@ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
4531
4557
  }
4532
4558
  };
4533
4559
  });
4534
- utils$1.freezeMethods(AxiosHeaders);
4560
+ utils$2.freezeMethods(AxiosHeaders);
4535
4561
  const AxiosHeaders$1 = AxiosHeaders;
4536
4562
  function transformData(fns, response) {
4537
4563
  const config = this || defaults$2;
4538
4564
  const context = response || config;
4539
4565
  const headers = AxiosHeaders$1.from(context.headers);
4540
4566
  let data = context.data;
4541
- utils$1.forEach(fns, function transform(fn) {
4567
+ utils$2.forEach(fns, function transform(fn) {
4542
4568
  data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
4543
4569
  });
4544
4570
  headers.normalize();
@@ -4551,7 +4577,7 @@ function CanceledError(message, config, request) {
4551
4577
  AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request);
4552
4578
  this.name = "CanceledError";
4553
4579
  }
4554
- utils$1.inherits(CanceledError, AxiosError, {
4580
+ utils$2.inherits(CanceledError, AxiosError, {
4555
4581
  __CANCEL__: true
4556
4582
  });
4557
4583
  function settle(resolve2, reject, response) {
@@ -4680,7 +4706,7 @@ const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
4680
4706
  }
4681
4707
  originURL = resolveURL(window.location.href);
4682
4708
  return function isURLSameOrigin2(requestURL) {
4683
- const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
4709
+ const parsed = utils$2.isString(requestURL) ? resolveURL(requestURL) : requestURL;
4684
4710
  return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
4685
4711
  };
4686
4712
  }()
@@ -4697,9 +4723,9 @@ const cookies = platform.hasStandardBrowserEnv ? (
4697
4723
  {
4698
4724
  write(name, value, expires, path, domain, secure) {
4699
4725
  const cookie = [name + "=" + encodeURIComponent(value)];
4700
- utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
4701
- utils$1.isString(path) && cookie.push("path=" + path);
4702
- utils$1.isString(domain) && cookie.push("domain=" + domain);
4726
+ utils$2.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
4727
+ utils$2.isString(path) && cookie.push("path=" + path);
4728
+ utils$2.isString(domain) && cookie.push("domain=" + domain);
4703
4729
  secure === true && cookie.push("secure");
4704
4730
  document.cookie = cookie.join("; ");
4705
4731
  },
@@ -4740,31 +4766,31 @@ function mergeConfig(config1, config2) {
4740
4766
  config2 = config2 || {};
4741
4767
  const config = {};
4742
4768
  function getMergedValue(target, source, caseless) {
4743
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
4744
- return utils$1.merge.call({ caseless }, target, source);
4745
- } else if (utils$1.isPlainObject(source)) {
4746
- return utils$1.merge({}, source);
4747
- } else if (utils$1.isArray(source)) {
4769
+ if (utils$2.isPlainObject(target) && utils$2.isPlainObject(source)) {
4770
+ return utils$2.merge.call({ caseless }, target, source);
4771
+ } else if (utils$2.isPlainObject(source)) {
4772
+ return utils$2.merge({}, source);
4773
+ } else if (utils$2.isArray(source)) {
4748
4774
  return source.slice();
4749
4775
  }
4750
4776
  return source;
4751
4777
  }
4752
4778
  function mergeDeepProperties(a, b2, caseless) {
4753
- if (!utils$1.isUndefined(b2)) {
4779
+ if (!utils$2.isUndefined(b2)) {
4754
4780
  return getMergedValue(a, b2, caseless);
4755
- } else if (!utils$1.isUndefined(a)) {
4781
+ } else if (!utils$2.isUndefined(a)) {
4756
4782
  return getMergedValue(void 0, a, caseless);
4757
4783
  }
4758
4784
  }
4759
4785
  function valueFromConfig2(a, b2) {
4760
- if (!utils$1.isUndefined(b2)) {
4786
+ if (!utils$2.isUndefined(b2)) {
4761
4787
  return getMergedValue(void 0, b2);
4762
4788
  }
4763
4789
  }
4764
4790
  function defaultToConfig2(a, b2) {
4765
- if (!utils$1.isUndefined(b2)) {
4791
+ if (!utils$2.isUndefined(b2)) {
4766
4792
  return getMergedValue(void 0, b2);
4767
- } else if (!utils$1.isUndefined(a)) {
4793
+ } else if (!utils$2.isUndefined(a)) {
4768
4794
  return getMergedValue(void 0, a);
4769
4795
  }
4770
4796
  }
@@ -4806,10 +4832,10 @@ function mergeConfig(config1, config2) {
4806
4832
  validateStatus: mergeDirectKeys,
4807
4833
  headers: (a, b2) => mergeDeepProperties(headersToObject(a), headersToObject(b2), true)
4808
4834
  };
4809
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
4835
+ utils$2.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
4810
4836
  const merge2 = mergeMap[prop] || mergeDeepProperties;
4811
4837
  const configValue = merge2(config1[prop], config2[prop], prop);
4812
- utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
4838
+ utils$2.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
4813
4839
  });
4814
4840
  return config;
4815
4841
  }
@@ -4825,7 +4851,7 @@ const resolveConfig = (config) => {
4825
4851
  );
4826
4852
  }
4827
4853
  let contentType;
4828
- if (utils$1.isFormData(data)) {
4854
+ if (utils$2.isFormData(data)) {
4829
4855
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
4830
4856
  headers.setContentType(void 0);
4831
4857
  } else if ((contentType = headers.getContentType()) !== false) {
@@ -4834,7 +4860,7 @@ const resolveConfig = (config) => {
4834
4860
  }
4835
4861
  }
4836
4862
  if (platform.hasStandardBrowserEnv) {
4837
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
4863
+ withXSRFToken && utils$2.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
4838
4864
  if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
4839
4865
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
4840
4866
  if (xsrfValue) {
@@ -4928,11 +4954,11 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
4928
4954
  };
4929
4955
  requestData === void 0 && requestHeaders.setContentType(null);
4930
4956
  if ("setRequestHeader" in request) {
4931
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
4957
+ utils$2.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
4932
4958
  request.setRequestHeader(key, val);
4933
4959
  });
4934
4960
  }
4935
- if (!utils$1.isUndefined(_config.withCredentials)) {
4961
+ if (!utils$2.isUndefined(_config.withCredentials)) {
4936
4962
  request.withCredentials = !!_config.withCredentials;
4937
4963
  }
4938
4964
  if (responseType && responseType !== "json") {
@@ -5067,7 +5093,7 @@ const supportsRequestStream = isReadableStreamSupported && (() => {
5067
5093
  const DEFAULT_CHUNK_SIZE = 64 * 1024;
5068
5094
  const supportsResponseStream = isReadableStreamSupported && !!(() => {
5069
5095
  try {
5070
- return utils$1.isReadableStream(new Response("").body);
5096
+ return utils$2.isReadableStream(new Response("").body);
5071
5097
  } catch (err) {
5072
5098
  }
5073
5099
  })();
@@ -5076,7 +5102,7 @@ const resolvers = {
5076
5102
  };
5077
5103
  isFetchSupported && ((res) => {
5078
5104
  ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type2) => {
5079
- !resolvers[type2] && (resolvers[type2] = utils$1.isFunction(res[type2]) ? (res2) => res2[type2]() : (_2, config) => {
5105
+ !resolvers[type2] && (resolvers[type2] = utils$2.isFunction(res[type2]) ? (res2) => res2[type2]() : (_2, config) => {
5080
5106
  throw new AxiosError(`Response type '${type2}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
5081
5107
  });
5082
5108
  });
@@ -5085,24 +5111,24 @@ const getBodyLength = async (body) => {
5085
5111
  if (body == null) {
5086
5112
  return 0;
5087
5113
  }
5088
- if (utils$1.isBlob(body)) {
5114
+ if (utils$2.isBlob(body)) {
5089
5115
  return body.size;
5090
5116
  }
5091
- if (utils$1.isSpecCompliantForm(body)) {
5117
+ if (utils$2.isSpecCompliantForm(body)) {
5092
5118
  return (await new Request(body).arrayBuffer()).byteLength;
5093
5119
  }
5094
- if (utils$1.isArrayBufferView(body)) {
5120
+ if (utils$2.isArrayBufferView(body)) {
5095
5121
  return body.byteLength;
5096
5122
  }
5097
- if (utils$1.isURLSearchParams(body)) {
5123
+ if (utils$2.isURLSearchParams(body)) {
5098
5124
  body = body + "";
5099
5125
  }
5100
- if (utils$1.isString(body)) {
5126
+ if (utils$2.isString(body)) {
5101
5127
  return (await encodeText(body)).byteLength;
5102
5128
  }
5103
5129
  };
5104
5130
  const resolveBodyLength = async (headers, body) => {
5105
- const length = utils$1.toFiniteNumber(headers.getContentLength());
5131
+ const length = utils$2.toFiniteNumber(headers.getContentLength());
5106
5132
  return length == null ? getBodyLength(body) : length;
5107
5133
  };
5108
5134
  const fetchAdapter = isFetchSupported && (async (config) => {
@@ -5138,7 +5164,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
5138
5164
  duplex: "half"
5139
5165
  });
5140
5166
  let contentTypeHeader;
5141
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
5167
+ if (utils$2.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
5142
5168
  headers.setContentType(contentTypeHeader);
5143
5169
  }
5144
5170
  if (_request.body) {
@@ -5148,7 +5174,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
5148
5174
  ), null, encodeText);
5149
5175
  }
5150
5176
  }
5151
- if (!utils$1.isString(withCredentials)) {
5177
+ if (!utils$2.isString(withCredentials)) {
5152
5178
  withCredentials = withCredentials ? "cors" : "omit";
5153
5179
  }
5154
5180
  request = new Request(url, {
@@ -5167,7 +5193,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
5167
5193
  ["status", "statusText", "headers"].forEach((prop) => {
5168
5194
  options[prop] = response[prop];
5169
5195
  });
5170
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
5196
+ const responseContentLength = utils$2.toFiniteNumber(response.headers.get("content-length"));
5171
5197
  response = new Response(
5172
5198
  trackStream(response.body, DEFAULT_CHUNK_SIZE, onDownloadProgress && fetchProgressDecorator(
5173
5199
  responseContentLength,
@@ -5177,7 +5203,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
5177
5203
  );
5178
5204
  }
5179
5205
  responseType = responseType || "text";
5180
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
5206
+ let responseData = await resolvers[utils$2.findKey(resolvers, responseType) || "text"](response, config);
5181
5207
  !isStreamResponse && onFinish();
5182
5208
  stopTimeout && stopTimeout();
5183
5209
  return await new Promise((resolve2, reject) => {
@@ -5208,7 +5234,7 @@ const knownAdapters = {
5208
5234
  xhr: xhrAdapter,
5209
5235
  fetch: fetchAdapter
5210
5236
  };
5211
- utils$1.forEach(knownAdapters, (fn, value) => {
5237
+ utils$2.forEach(knownAdapters, (fn, value) => {
5212
5238
  if (fn) {
5213
5239
  try {
5214
5240
  Object.defineProperty(fn, "name", { value });
@@ -5218,10 +5244,10 @@ utils$1.forEach(knownAdapters, (fn, value) => {
5218
5244
  }
5219
5245
  });
5220
5246
  const renderReason = (reason) => `- ${reason}`;
5221
- const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
5247
+ const isResolvedHandle = (adapter) => utils$2.isFunction(adapter) || adapter === null || adapter === false;
5222
5248
  const adapters = {
5223
5249
  getAdapter: (adapters2) => {
5224
- adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
5250
+ adapters2 = utils$2.isArray(adapters2) ? adapters2 : [adapters2];
5225
5251
  const { length } = adapters2;
5226
5252
  let nameOrAdapter;
5227
5253
  let adapter;
@@ -5409,7 +5435,7 @@ class Axios {
5409
5435
  }, false);
5410
5436
  }
5411
5437
  if (paramsSerializer != null) {
5412
- if (utils$1.isFunction(paramsSerializer)) {
5438
+ if (utils$2.isFunction(paramsSerializer)) {
5413
5439
  config.paramsSerializer = {
5414
5440
  serialize: paramsSerializer
5415
5441
  };
@@ -5421,11 +5447,11 @@ class Axios {
5421
5447
  }
5422
5448
  }
5423
5449
  config.method = (config.method || this.defaults.method || "get").toLowerCase();
5424
- let contextHeaders = headers && utils$1.merge(
5450
+ let contextHeaders = headers && utils$2.merge(
5425
5451
  headers.common,
5426
5452
  headers[config.method]
5427
5453
  );
5428
- headers && utils$1.forEach(
5454
+ headers && utils$2.forEach(
5429
5455
  ["delete", "get", "head", "post", "put", "patch", "common"],
5430
5456
  (method) => {
5431
5457
  delete headers[method];
@@ -5490,7 +5516,7 @@ class Axios {
5490
5516
  return buildURL(fullPath, config.params, config.paramsSerializer);
5491
5517
  }
5492
5518
  }
5493
- utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
5519
+ utils$2.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
5494
5520
  Axios.prototype[method] = function(url, config) {
5495
5521
  return this.request(mergeConfig(config || {}, {
5496
5522
  method,
@@ -5499,7 +5525,7 @@ utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoDa
5499
5525
  }));
5500
5526
  };
5501
5527
  });
5502
- utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
5528
+ utils$2.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
5503
5529
  function generateHTTPMethod(isForm) {
5504
5530
  return function httpMethod(url, data, config) {
5505
5531
  return this.request(mergeConfig(config || {}, {
@@ -5610,7 +5636,7 @@ function spread(callback) {
5610
5636
  };
5611
5637
  }
5612
5638
  function isAxiosError(payload) {
5613
- return utils$1.isObject(payload) && payload.isAxiosError === true;
5639
+ return utils$2.isObject(payload) && payload.isAxiosError === true;
5614
5640
  }
5615
5641
  const HttpStatusCode = {
5616
5642
  Continue: 100,
@@ -5684,8 +5710,8 @@ const HttpStatusCode$1 = HttpStatusCode;
5684
5710
  function createInstance(defaultConfig) {
5685
5711
  const context = new Axios$1(defaultConfig);
5686
5712
  const instance = bind(Axios$1.prototype.request, context);
5687
- utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
5688
- utils$1.extend(instance, context, null, { allOwnKeys: true });
5713
+ utils$2.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
5714
+ utils$2.extend(instance, context, null, { allOwnKeys: true });
5689
5715
  instance.create = function create(instanceConfig) {
5690
5716
  return createInstance(mergeConfig(defaultConfig, instanceConfig));
5691
5717
  };
@@ -5707,7 +5733,7 @@ axios.spread = spread;
5707
5733
  axios.isAxiosError = isAxiosError;
5708
5734
  axios.mergeConfig = mergeConfig;
5709
5735
  axios.AxiosHeaders = AxiosHeaders$1;
5710
- axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
5736
+ axios.formToJSON = (thing) => formDataToJSON(utils$2.isHTMLForm(thing) ? new FormData(thing) : thing);
5711
5737
  axios.getAdapter = adapters.getAdapter;
5712
5738
  axios.HttpStatusCode = HttpStatusCode$1;
5713
5739
  axios.default = axios;
@@ -6140,7 +6166,7 @@ q$1(T, "cancelById", (t2, s) => {
6140
6166
  q$1(T, "cancelAll", (t2) => w.getAll().forEach((s) => {
6141
6167
  s.cancel(t2), w.deleteById(s.id);
6142
6168
  }));
6143
- const ir = {
6169
+ const cr = {
6144
6170
  /**
6145
6171
  * @type Cancellation.cancelAll
6146
6172
  */
@@ -9595,7 +9621,7 @@ function bs({ apiHandler: e2 }) {
9595
9621
  }
9596
9622
  };
9597
9623
  }
9598
- function ws({ apiHandler: e2 }) {
9624
+ function ws$1({ apiHandler: e2 }) {
9599
9625
  return {
9600
9626
  /**
9601
9627
  * @param { rebilly.GetWebsiteCollectionRequest } request
@@ -9647,7 +9673,7 @@ class ks {
9647
9673
  apiHandler: t2
9648
9674
  }), this.subscriptionPauses = as({ apiHandler: t2 }), this.subscriptionReactivations = ms({
9649
9675
  apiHandler: t2
9650
- }), this.subscriptions = fs({ apiHandler: t2 }), this.tags = $s({ apiHandler: t2 }), this.tagsRules = ps({ apiHandler: t2 }), this.tracking = hs({ apiHandler: t2 }), this.transactions = ys({ apiHandler: t2 }), this.usages = As({ apiHandler: t2 }), this.users = Rs({ apiHandler: t2 }), this.webhooks = bs({ apiHandler: t2 }), this.websites = ws({ apiHandler: t2 }), this.addRequestInterceptor = t2.addRequestInterceptor, this.removeRequestInterceptor = t2.removeRequestInterceptor, this.addResponseInterceptor = t2.addResponseInterceptor, this.removeResponseInterceptor = t2.removeResponseInterceptor, this.setTimeout = t2.setTimeout, this.setProxyAgent = t2.setProxyAgent, this.setSessionToken = t2.setSessionToken, this.setPublishableKey = t2.setPublishableKey, this.setEndpoints = t2.setEndpoints, this.getCancellationToken = t2.getCancellationToken, this.generateSignature = t2.generateSignature;
9676
+ }), this.subscriptions = fs({ apiHandler: t2 }), this.tags = $s({ apiHandler: t2 }), this.tagsRules = ps({ apiHandler: t2 }), this.tracking = hs({ apiHandler: t2 }), this.transactions = ys({ apiHandler: t2 }), this.usages = As({ apiHandler: t2 }), this.users = Rs({ apiHandler: t2 }), this.webhooks = bs({ apiHandler: t2 }), this.websites = ws$1({ apiHandler: t2 }), this.addRequestInterceptor = t2.addRequestInterceptor, this.removeRequestInterceptor = t2.removeRequestInterceptor, this.addResponseInterceptor = t2.addResponseInterceptor, this.removeResponseInterceptor = t2.removeResponseInterceptor, this.setTimeout = t2.setTimeout, this.setProxyAgent = t2.setProxyAgent, this.setSessionToken = t2.setSessionToken, this.setPublishableKey = t2.setPublishableKey, this.setEndpoints = t2.setEndpoints, this.getCancellationToken = t2.getCancellationToken, this.generateSignature = t2.generateSignature;
9651
9677
  }
9652
9678
  }
9653
9679
  function vs({ apiHandler: e2 }) {
@@ -10275,16 +10301,6 @@ function Ks({ apiHandler: e2 }) {
10275
10301
  };
10276
10302
  }
10277
10303
  function Bs({ apiHandler: e2 }) {
10278
- return {
10279
- /**
10280
- * @returns { rebilly.StorefrontGetExperimentalBillingPortalResponsePromise } response
10281
- */
10282
- get({ slug: t2 }) {
10283
- return e2.get(`experimental/billing-portals/${t2}`);
10284
- }
10285
- };
10286
- }
10287
- function Ls({ apiHandler: e2 }) {
10288
10304
  return {
10289
10305
  /**
10290
10306
  * @param { rebilly.StorefrontGetInvoiceCollectionRequest } request
@@ -10316,7 +10332,7 @@ function Ls({ apiHandler: e2 }) {
10316
10332
  }
10317
10333
  };
10318
10334
  }
10319
- function Ns({ apiHandler: e2 }) {
10335
+ function Ls({ apiHandler: e2 }) {
10320
10336
  return {
10321
10337
  /**
10322
10338
  * @param { rebilly.StorefrontGetKycDocumentCollectionRequest } request
@@ -10340,7 +10356,7 @@ function Ns({ apiHandler: e2 }) {
10340
10356
  }
10341
10357
  };
10342
10358
  }
10343
- function zs({ apiHandler: e2 }) {
10359
+ function Ns({ apiHandler: e2 }) {
10344
10360
  return {
10345
10361
  create({ data: t2 }) {
10346
10362
  return e2.post("kyc-liveness-sessions", t2);
@@ -10356,7 +10372,7 @@ function zs({ apiHandler: e2 }) {
10356
10372
  }
10357
10373
  };
10358
10374
  }
10359
- function Us({ apiHandler: e2 }) {
10375
+ function zs({ apiHandler: e2 }) {
10360
10376
  return {
10361
10377
  /**
10362
10378
  * @returns { rebilly.StorefrontGetKycRequestResponsePromise } response
@@ -10367,7 +10383,7 @@ function Us({ apiHandler: e2 }) {
10367
10383
  }
10368
10384
  };
10369
10385
  }
10370
- function Vs({ apiHandler: e2 }) {
10386
+ function Us({ apiHandler: e2 }) {
10371
10387
  return {
10372
10388
  /**
10373
10389
  * @returns { rebilly.StorefrontGetOrderUpcomingInvoiceResponsePromise } response
@@ -10408,7 +10424,7 @@ function Vs({ apiHandler: e2 }) {
10408
10424
  }
10409
10425
  };
10410
10426
  }
10411
- function Js({ apiHandler: e2 }) {
10427
+ function Vs({ apiHandler: e2 }) {
10412
10428
  return {
10413
10429
  /**
10414
10430
  * @param { rebilly.StorefrontGetPaymentInstrumentCollectionRequest } request
@@ -10451,7 +10467,7 @@ function Js({ apiHandler: e2 }) {
10451
10467
  }
10452
10468
  };
10453
10469
  }
10454
- function Ws({ apiHandler: e2 }) {
10470
+ function Js({ apiHandler: e2 }) {
10455
10471
  return {
10456
10472
  /**
10457
10473
  * @param { rebilly.StorefrontGetPayoutRequestCollectionRequest } request
@@ -10478,7 +10494,7 @@ function Ws({ apiHandler: e2 }) {
10478
10494
  }
10479
10495
  };
10480
10496
  }
10481
- function Gs({ apiHandler: e2 }) {
10497
+ function Ws({ apiHandler: e2 }) {
10482
10498
  return {
10483
10499
  /**
10484
10500
  * @param { rebilly.StorefrontGetPlanCollectionRequest } request
@@ -10504,7 +10520,7 @@ function Gs({ apiHandler: e2 }) {
10504
10520
  }
10505
10521
  };
10506
10522
  }
10507
- function Ys({ apiHandler: e2 }) {
10523
+ function Gs({ apiHandler: e2 }) {
10508
10524
  return {
10509
10525
  /**
10510
10526
  * @param { rebilly.StorefrontGetProductCollectionRequest } request
@@ -10528,7 +10544,7 @@ function Ys({ apiHandler: e2 }) {
10528
10544
  }
10529
10545
  };
10530
10546
  }
10531
- function Qs({ apiHandler: e2 }) {
10547
+ function Ys({ apiHandler: e2 }) {
10532
10548
  return {
10533
10549
  payment({ data: t2 }) {
10534
10550
  return e2.post("payment", t2);
@@ -10544,7 +10560,7 @@ function Qs({ apiHandler: e2 }) {
10544
10560
  }
10545
10561
  };
10546
10562
  }
10547
- function Xs({ apiHandler: e2 }) {
10563
+ function Qs({ apiHandler: e2 }) {
10548
10564
  return {
10549
10565
  /**
10550
10566
  * @returns { rebilly.StorefrontGetQuoteResponsePromise } response
@@ -10568,21 +10584,21 @@ function Xs({ apiHandler: e2 }) {
10568
10584
  }
10569
10585
  };
10570
10586
  }
10571
- function Zs({ apiHandler: e2 }) {
10587
+ function Xs({ apiHandler: e2 }) {
10572
10588
  return {
10573
10589
  readyToPayout({ data: t2 }) {
10574
10590
  return e2.post("ready-to-payout", t2);
10575
10591
  }
10576
10592
  };
10577
10593
  }
10578
- function _s({ apiHandler: e2 }) {
10594
+ function Zs({ apiHandler: e2 }) {
10579
10595
  return {
10580
10596
  reactivation({ data: t2 }) {
10581
10597
  return e2.post("subscription-reactivations", t2);
10582
10598
  }
10583
10599
  };
10584
10600
  }
10585
- function Hs({ apiHandler: e2 }) {
10601
+ function _s({ apiHandler: e2 }) {
10586
10602
  return {
10587
10603
  changeItems({ id: t2, data: s }) {
10588
10604
  return e2.post(`subscriptions/${t2}/change-items`, s);
@@ -10592,7 +10608,7 @@ function Hs({ apiHandler: e2 }) {
10592
10608
  }
10593
10609
  };
10594
10610
  }
10595
- function tr({ apiHandler: e2 }) {
10611
+ function Hs({ apiHandler: e2 }) {
10596
10612
  return {
10597
10613
  /**
10598
10614
  * @param { rebilly.StorefrontGetTransactionCollectionRequest } request
@@ -10625,7 +10641,7 @@ function tr({ apiHandler: e2 }) {
10625
10641
  }
10626
10642
  };
10627
10643
  }
10628
- function er({ apiHandler: e2 }) {
10644
+ function tr({ apiHandler: e2 }) {
10629
10645
  return {
10630
10646
  /**
10631
10647
  * @returns { rebilly.StorefrontGetWebsiteResponsePromise } response
@@ -10635,27 +10651,27 @@ function er({ apiHandler: e2 }) {
10635
10651
  }
10636
10652
  };
10637
10653
  }
10638
- class sr {
10654
+ class er {
10639
10655
  constructor({ apiHandler: t2 }) {
10640
- this.account = Ps({ apiHandler: t2 }), this.authorization = Cs({ apiHandler: t2 }), this.billingPortals = js({ apiHandler: t2 }), this.checkoutForms = Ds({ apiHandler: t2 }), this.customFields = Ms({ apiHandler: t2 }), this.depositRequests = Os({ apiHandler: t2 }), this.deposit = Fs({ apiHandler: t2 }), this.depositStrategies = Ks({ apiHandler: t2 }), this.experimental = Bs({ apiHandler: t2 }), this.invoices = Ls({ apiHandler: t2 }), this.kycDocuments = Ns({ apiHandler: t2 }), this.kycLivenessSessions = zs({ apiHandler: t2 }), this.kycRequests = Us({ apiHandler: t2 }), this.orders = Vs({ apiHandler: t2 }), this.paymentInstruments = Js({ apiHandler: t2 }), this.payoutRequests = Ws({ apiHandler: t2 }), this.plans = Gs({ apiHandler: t2 }), this.products = Ys({ apiHandler: t2 }), this.purchase = Qs({ apiHandler: t2 }), this.quotes = Xs({ apiHandler: t2 }), this.readyToPayout = Zs({ apiHandler: t2 }), this.subscriptionReactivations = _s({
10656
+ this.account = Ps({ apiHandler: t2 }), this.authorization = Cs({ apiHandler: t2 }), this.billingPortals = js({ apiHandler: t2 }), this.checkoutForms = Ds({ apiHandler: t2 }), this.customFields = Ms({ apiHandler: t2 }), this.depositRequests = Os({ apiHandler: t2 }), this.deposit = Fs({ apiHandler: t2 }), this.depositStrategies = Ks({ apiHandler: t2 }), this.invoices = Bs({ apiHandler: t2 }), this.kycDocuments = Ls({ apiHandler: t2 }), this.kycLivenessSessions = Ns({ apiHandler: t2 }), this.kycRequests = zs({ apiHandler: t2 }), this.orders = Us({ apiHandler: t2 }), this.paymentInstruments = Vs({ apiHandler: t2 }), this.payoutRequests = Js({ apiHandler: t2 }), this.plans = Ws({ apiHandler: t2 }), this.products = Gs({ apiHandler: t2 }), this.purchase = Ys({ apiHandler: t2 }), this.quotes = Qs({ apiHandler: t2 }), this.readyToPayout = Xs({ apiHandler: t2 }), this.subscriptionReactivations = Zs({
10641
10657
  apiHandler: t2
10642
- }), this.subscriptions = Hs({ apiHandler: t2 }), this.transactions = tr({ apiHandler: t2 }), this.websites = er({ apiHandler: t2 }), this.checkoutForm = this.checkoutForms, this.billingPortal = this.billingPortals, this.addRequestInterceptor = t2.addRequestInterceptor, this.removeRequestInterceptor = t2.removeRequestInterceptor, this.addResponseInterceptor = t2.addResponseInterceptor, this.removeResponseInterceptor = t2.removeResponseInterceptor, this.setTimeout = t2.setTimeout, this.setProxyAgent = t2.setProxyAgent, this.setSessionToken = t2.setSessionToken, this.setPublishableKey = t2.setPublishableKey, this.setEndpoints = t2.setEndpoints, this.getCancellationToken = t2.getCancellationToken, this.generateSignature = t2.generateSignature;
10658
+ }), this.subscriptions = _s({ apiHandler: t2 }), this.transactions = Hs({ apiHandler: t2 }), this.websites = tr({ apiHandler: t2 }), this.checkoutForm = this.checkoutForms, this.billingPortal = this.billingPortals, this.addRequestInterceptor = t2.addRequestInterceptor, this.removeRequestInterceptor = t2.removeRequestInterceptor, this.addResponseInterceptor = t2.addResponseInterceptor, this.removeResponseInterceptor = t2.removeResponseInterceptor, this.setTimeout = t2.setTimeout, this.setProxyAgent = t2.setProxyAgent, this.setSessionToken = t2.setSessionToken, this.setPublishableKey = t2.setPublishableKey, this.setEndpoints = t2.setEndpoints, this.getCancellationToken = t2.getCancellationToken, this.generateSignature = t2.generateSignature;
10643
10659
  }
10644
10660
  }
10645
- function rr({ apiHandler: e2 }) {
10661
+ function sr({ apiHandler: e2 }) {
10646
10662
  return new ks({ apiHandler: e2 });
10647
10663
  }
10648
- function nr({ apiHandler: e2 }) {
10664
+ function rr({ apiHandler: e2 }) {
10649
10665
  return new xs({ apiHandler: e2 });
10650
10666
  }
10651
- function ur({ apiHandler: e2 }) {
10652
- return new sr({ apiHandler: e2 });
10667
+ function nr({ apiHandler: e2 }) {
10668
+ return new er({ apiHandler: e2 });
10653
10669
  }
10654
10670
  const j$1 = {
10655
10671
  live: "https://api.rebilly.com",
10656
10672
  sandbox: "https://api-sandbox.rebilly.com"
10657
10673
  }, D = 6e3;
10658
- function gr({
10674
+ function ir({
10659
10675
  apiKey: e2 = null,
10660
10676
  sandbox: t2 = false,
10661
10677
  timeout: s = D,
@@ -10679,9 +10695,9 @@ function gr({
10679
10695
  jwt: null,
10680
10696
  organizationId: r2
10681
10697
  } });
10682
- return rr({ apiHandler: o2 });
10698
+ return sr({ apiHandler: o2 });
10683
10699
  }
10684
- function ar({
10700
+ function gr({
10685
10701
  apiKey: e2 = null,
10686
10702
  sandbox: t2 = false,
10687
10703
  timeout: s = D,
@@ -10705,9 +10721,9 @@ function ar({
10705
10721
  jwt: null,
10706
10722
  organizationId: r2
10707
10723
  } });
10708
- return nr({ apiHandler: o2 });
10724
+ return rr({ apiHandler: o2 });
10709
10725
  }
10710
- function mr({
10726
+ function ar({
10711
10727
  publishableKey: e2 = null,
10712
10728
  jwt: t2 = null,
10713
10729
  sandbox: s = false,
@@ -10732,7 +10748,7 @@ function mr({
10732
10748
  requestTimeout: r2,
10733
10749
  organizationId: n2
10734
10750
  }, l = C$1({ options: o2 });
10735
- return l.setSessionToken(o2.jwt), ur({ apiHandler: l });
10751
+ return l.setSessionToken(o2.jwt), nr({ apiHandler: l });
10736
10752
  }
10737
10753
  const TIMEOUT = 6e4;
10738
10754
  function validateStateForStorefront() {
@@ -10769,15 +10785,15 @@ class StorefrontInstance {
10769
10785
  timeout: Number.isNaN(parsedTimeout) ? TIMEOUT : parsedTimeout,
10770
10786
  urls
10771
10787
  };
10772
- const api = mr(config);
10788
+ const api = ar(config);
10773
10789
  const rebilly = (
10774
10790
  // @ts-ignore refactor with above todo
10775
- typeof gr.default === "function" ? (
10791
+ typeof ir.default === "function" ? (
10776
10792
  // @ts-ignore refactor with above todo
10777
- gr.default(config)
10778
- ) : gr(config)
10793
+ ir.default(config)
10794
+ ) : ir(config)
10779
10795
  );
10780
- const experimental = ar(config);
10796
+ const experimental = gr(config);
10781
10797
  api.setSessionToken(publishableKey || jwt);
10782
10798
  rebilly.setSessionToken(publishableKey || jwt);
10783
10799
  experimental.setSessionToken(publishableKey || jwt);
@@ -19603,7 +19619,7 @@ function extendSubschemaMode(subschema2, { jtdDiscriminator, jtdMetadata, compos
19603
19619
  subschema2.jtdMetadata = jtdMetadata;
19604
19620
  }
19605
19621
  subschema.extendSubschemaMode = extendSubschemaMode;
19606
- var resolve$1 = {};
19622
+ var resolve$2 = {};
19607
19623
  var fastDeepEqual = function equal(a, b2) {
19608
19624
  if (a === b2)
19609
19625
  return true;
@@ -19725,10 +19741,10 @@ function escapeJsonPtr(str) {
19725
19741
  return str.replace(/~/g, "~0").replace(/\//g, "~1");
19726
19742
  }
19727
19743
  var jsonSchemaTraverseExports = jsonSchemaTraverse.exports;
19728
- Object.defineProperty(resolve$1, "__esModule", { value: true });
19729
- resolve$1.getSchemaRefs = resolve$1.resolveUrl = resolve$1.normalizeId = resolve$1._getFullPath = resolve$1.getFullPath = resolve$1.inlineRef = void 0;
19744
+ Object.defineProperty(resolve$2, "__esModule", { value: true });
19745
+ resolve$2.getSchemaRefs = resolve$2.resolveUrl = resolve$2.normalizeId = resolve$2._getFullPath = resolve$2.getFullPath = resolve$2.inlineRef = void 0;
19730
19746
  const util_1$q = util;
19731
- const equal$2 = fastDeepEqual;
19747
+ const equal$3 = fastDeepEqual;
19732
19748
  const traverse = jsonSchemaTraverseExports;
19733
19749
  const SIMPLE_INLINED = /* @__PURE__ */ new Set([
19734
19750
  "type",
@@ -19757,7 +19773,7 @@ function inlineRef(schema2, limit = true) {
19757
19773
  return false;
19758
19774
  return countKeys(schema2) <= limit;
19759
19775
  }
19760
- resolve$1.inlineRef = inlineRef;
19776
+ resolve$2.inlineRef = inlineRef;
19761
19777
  const REF_KEYWORDS = /* @__PURE__ */ new Set([
19762
19778
  "$ref",
19763
19779
  "$recursiveRef",
@@ -19793,28 +19809,28 @@ function countKeys(schema2) {
19793
19809
  }
19794
19810
  return count;
19795
19811
  }
19796
- function getFullPath(resolver, id2 = "", normalize) {
19797
- if (normalize !== false)
19812
+ function getFullPath(resolver, id2 = "", normalize2) {
19813
+ if (normalize2 !== false)
19798
19814
  id2 = normalizeId(id2);
19799
19815
  const p2 = resolver.parse(id2);
19800
19816
  return _getFullPath(resolver, p2);
19801
19817
  }
19802
- resolve$1.getFullPath = getFullPath;
19818
+ resolve$2.getFullPath = getFullPath;
19803
19819
  function _getFullPath(resolver, p2) {
19804
19820
  const serialized = resolver.serialize(p2);
19805
19821
  return serialized.split("#")[0] + "#";
19806
19822
  }
19807
- resolve$1._getFullPath = _getFullPath;
19823
+ resolve$2._getFullPath = _getFullPath;
19808
19824
  const TRAILING_SLASH_HASH = /#\/?$/;
19809
19825
  function normalizeId(id2) {
19810
19826
  return id2 ? id2.replace(TRAILING_SLASH_HASH, "") : "";
19811
19827
  }
19812
- resolve$1.normalizeId = normalizeId;
19828
+ resolve$2.normalizeId = normalizeId;
19813
19829
  function resolveUrl(resolver, baseId, id2) {
19814
19830
  id2 = normalizeId(id2);
19815
19831
  return resolver.resolve(baseId, id2);
19816
19832
  }
19817
- resolve$1.resolveUrl = resolveUrl;
19833
+ resolve$2.resolveUrl = resolveUrl;
19818
19834
  const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
19819
19835
  function getSchemaRefs(schema2, baseId) {
19820
19836
  if (typeof schema2 == "boolean")
@@ -19866,14 +19882,14 @@ function getSchemaRefs(schema2, baseId) {
19866
19882
  });
19867
19883
  return localRefs;
19868
19884
  function checkAmbiguosRef(sch1, sch2, ref2) {
19869
- if (sch2 !== void 0 && !equal$2(sch1, sch2))
19885
+ if (sch2 !== void 0 && !equal$3(sch1, sch2))
19870
19886
  throw ambiguos(ref2);
19871
19887
  }
19872
19888
  function ambiguos(ref2) {
19873
19889
  return new Error(`reference "${ref2}" resolves to more than one schema`);
19874
19890
  }
19875
19891
  }
19876
- resolve$1.getSchemaRefs = getSchemaRefs;
19892
+ resolve$2.getSchemaRefs = getSchemaRefs;
19877
19893
  Object.defineProperty(validate$1, "__esModule", { value: true });
19878
19894
  validate$1.getData = validate$1.KeywordCxt = validate$1.validateFunctionCode = void 0;
19879
19895
  const boolSchema_1 = boolSchema;
@@ -19885,7 +19901,7 @@ const keyword_1 = keyword;
19885
19901
  const subschema_1 = subschema;
19886
19902
  const codegen_1$r = codegen;
19887
19903
  const names_1$6 = names$1;
19888
- const resolve_1$2 = resolve$1;
19904
+ const resolve_1$2 = resolve$2;
19889
19905
  const util_1$p = util;
19890
19906
  const errors_1 = errors;
19891
19907
  function validateFunctionCode(it2) {
@@ -20386,7 +20402,7 @@ class ValidationError extends Error {
20386
20402
  validation_error.default = ValidationError;
20387
20403
  var ref_error = {};
20388
20404
  Object.defineProperty(ref_error, "__esModule", { value: true });
20389
- const resolve_1$1 = resolve$1;
20405
+ const resolve_1$1 = resolve$2;
20390
20406
  class MissingRefError extends Error {
20391
20407
  constructor(resolver, baseId, ref2, msg) {
20392
20408
  super(msg || `can't resolve reference ${ref2} from id ${baseId}`);
@@ -20401,7 +20417,7 @@ compile.resolveSchema = compile.getCompilingSchema = compile.resolveRef = compil
20401
20417
  const codegen_1$q = codegen;
20402
20418
  const validation_error_1 = validation_error;
20403
20419
  const names_1$5 = names$1;
20404
- const resolve_1 = resolve$1;
20420
+ const resolve_1 = resolve$2;
20405
20421
  const util_1$o = util;
20406
20422
  const validate_1$1 = validate$1;
20407
20423
  class SchemaEnv {
@@ -20516,7 +20532,7 @@ function resolveRef(root2, baseId, ref2) {
20516
20532
  const schOrFunc = root2.refs[ref2];
20517
20533
  if (schOrFunc)
20518
20534
  return schOrFunc;
20519
- let _sch = resolve.call(this, root2, ref2);
20535
+ let _sch = resolve$1.call(this, root2, ref2);
20520
20536
  if (_sch === void 0) {
20521
20537
  const schema2 = (_a = root2.localRefs) === null || _a === void 0 ? void 0 : _a[ref2];
20522
20538
  const { schemaId } = this.opts;
@@ -20543,7 +20559,7 @@ compile.getCompilingSchema = getCompilingSchema;
20543
20559
  function sameSchemaEnv(s1, s2) {
20544
20560
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
20545
20561
  }
20546
- function resolve(root2, ref2) {
20562
+ function resolve$1(root2, ref2) {
20547
20563
  let sch;
20548
20564
  while (typeof (sch = this.refs[ref2]) == "string")
20549
20565
  ref2 = sch;
@@ -20642,1050 +20658,662 @@ const require$$9 = {
20642
20658
  additionalProperties: additionalProperties$1
20643
20659
  };
20644
20660
  var uri$1 = {};
20645
- var uri_all = { exports: {} };
20646
- /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
20647
- (function(module, exports) {
20648
- (function(global2, factory) {
20649
- factory(exports);
20650
- })(commonjsGlobal, function(exports2) {
20651
- function merge2() {
20652
- for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
20653
- sets[_key] = arguments[_key];
20654
- }
20655
- if (sets.length > 1) {
20656
- sets[0] = sets[0].slice(0, -1);
20657
- var xl = sets.length - 1;
20658
- for (var x2 = 1; x2 < xl; ++x2) {
20659
- sets[x2] = sets[x2].slice(1, -1);
20660
- }
20661
- sets[xl] = sets[xl].slice(1);
20662
- return sets.join("");
20663
- } else {
20664
- return sets[0];
20665
- }
20666
- }
20667
- function subexp(str) {
20668
- return "(?:" + str + ")";
20669
- }
20670
- function typeOf(o2) {
20671
- return o2 === void 0 ? "undefined" : o2 === null ? "null" : Object.prototype.toString.call(o2).split(" ").pop().split("]").shift().toLowerCase();
20672
- }
20673
- function toUpperCase(str) {
20674
- return str.toUpperCase();
20675
- }
20676
- function toArray2(obj) {
20677
- 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) : [];
20678
- }
20679
- function assign(target, source) {
20680
- var obj = target;
20681
- if (source) {
20682
- for (var key in source) {
20683
- obj[key] = source[key];
20684
- }
20685
- }
20686
- return obj;
20687
- }
20688
- function buildExps(isIRI) {
20689
- var ALPHA$$ = "[A-Za-z]", DIGIT$$ = "[0-9]", HEXDIG$$2 = merge2(DIGIT$$, "[A-Fa-f]"), 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$$ = merge2(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$2 = merge2(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$);
20690
- subexp(ALPHA$$ + merge2(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*");
20691
- subexp(subexp(PCT_ENCODED$2 + "|" + merge2(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]")) + "*");
20692
- 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$$), 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) + "+");
20693
- subexp("[vV]" + HEXDIG$$2 + "+\\." + merge2(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]") + "+");
20694
- subexp(subexp(PCT_ENCODED$2 + "|" + merge2(UNRESERVED$$2, SUB_DELIMS$$)) + "*");
20695
- var PCHAR$ = subexp(PCT_ENCODED$2 + "|" + merge2(UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@]"));
20696
- subexp(subexp(PCT_ENCODED$2 + "|" + merge2(UNRESERVED$$2, SUB_DELIMS$$, "[\\@]")) + "+");
20697
- subexp(subexp(PCHAR$ + "|" + merge2("[\\/\\?]", IPRIVATE$$)) + "*");
20698
- return {
20699
- NOT_SCHEME: new RegExp(merge2("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
20700
- NOT_USERINFO: new RegExp(merge2("[^\\%\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
20701
- NOT_HOST: new RegExp(merge2("[^\\%\\[\\]\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
20702
- NOT_PATH: new RegExp(merge2("[^\\%\\/\\:\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
20703
- NOT_PATH_NOSCHEME: new RegExp(merge2("[^\\%\\/\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
20704
- NOT_QUERY: new RegExp(merge2("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
20705
- NOT_FRAGMENT: new RegExp(merge2("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
20706
- ESCAPE: new RegExp(merge2("[^]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
20707
- UNRESERVED: new RegExp(UNRESERVED$$2, "g"),
20708
- OTHER_CHARS: new RegExp(merge2("[^\\%]", UNRESERVED$$2, RESERVED$$), "g"),
20709
- PCT_ENCODED: new RegExp(PCT_ENCODED$2, "g"),
20710
- IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
20711
- IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$")
20712
- //RFC 6874, with relaxed parsing rules
20713
- };
20714
- }
20715
- var URI_PROTOCOL = buildExps(false);
20716
- var IRI_PROTOCOL = buildExps(true);
20717
- var slicedToArray = /* @__PURE__ */ function() {
20718
- function sliceIterator(arr, i) {
20719
- var _arr = [];
20720
- var _n = true;
20721
- var _d = false;
20722
- var _e2 = void 0;
20723
- try {
20724
- for (var _i = arr[Symbol.iterator](), _s2; !(_n = (_s2 = _i.next()).done); _n = true) {
20725
- _arr.push(_s2.value);
20726
- if (i && _arr.length === i)
20727
- break;
20728
- }
20729
- } catch (err) {
20730
- _d = true;
20731
- _e2 = err;
20732
- } finally {
20733
- try {
20734
- if (!_n && _i["return"])
20735
- _i["return"]();
20736
- } finally {
20737
- if (_d)
20738
- throw _e2;
20739
- }
20740
- }
20741
- return _arr;
20742
- }
20743
- return function(arr, i) {
20744
- if (Array.isArray(arr)) {
20745
- return arr;
20746
- } else if (Symbol.iterator in Object(arr)) {
20747
- return sliceIterator(arr, i);
20748
- } else {
20749
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
20750
- }
20751
- };
20752
- }();
20753
- var toConsumableArray = function(arr) {
20754
- if (Array.isArray(arr)) {
20755
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++)
20756
- arr2[i] = arr[i];
20757
- return arr2;
20758
- } else {
20759
- return Array.from(arr);
20760
- }
20761
- };
20762
- var maxInt = 2147483647;
20763
- var base = 36;
20764
- var tMin = 1;
20765
- var tMax = 26;
20766
- var skew = 38;
20767
- var damp = 700;
20768
- var initialBias = 72;
20769
- var initialN = 128;
20770
- var delimiter = "-";
20771
- var regexPunycode = /^xn--/;
20772
- var regexNonASCII = /[^\0-\x7E]/;
20773
- var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
20774
- var errors2 = {
20775
- "overflow": "Overflow: input needs wider integers to process",
20776
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
20777
- "invalid-input": "Invalid input"
20778
- };
20779
- var baseMinusTMin = base - tMin;
20780
- var floor = Math.floor;
20781
- var stringFromCharCode = String.fromCharCode;
20782
- function error$12(type2) {
20783
- throw new RangeError(errors2[type2]);
20784
- }
20785
- function map(array, fn) {
20786
- var result = [];
20787
- var length = array.length;
20788
- while (length--) {
20789
- result[length] = fn(array[length]);
20790
- }
20791
- return result;
20792
- }
20793
- function mapDomain(string, fn) {
20794
- var parts = string.split("@");
20795
- var result = "";
20796
- if (parts.length > 1) {
20797
- result = parts[0] + "@";
20798
- string = parts[1];
20799
- }
20800
- string = string.replace(regexSeparators, ".");
20801
- var labels = string.split(".");
20802
- var encoded = map(labels, fn).join(".");
20803
- return result + encoded;
20804
- }
20805
- function ucs2decode(string) {
20806
- var output = [];
20807
- var counter = 0;
20808
- var length = string.length;
20809
- while (counter < length) {
20810
- var value = string.charCodeAt(counter++);
20811
- if (value >= 55296 && value <= 56319 && counter < length) {
20812
- var extra = string.charCodeAt(counter++);
20813
- if ((extra & 64512) == 56320) {
20814
- output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
20815
- } else {
20816
- output.push(value);
20817
- counter--;
20818
- }
20661
+ var fastUri$1 = { exports: {} };
20662
+ const __viteBrowserExternal = {};
20663
+ const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
20664
+ __proto__: null,
20665
+ default: __viteBrowserExternal
20666
+ }, Symbol.toStringTag, { value: "Module" }));
20667
+ const require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
20668
+ const HEX$1 = {
20669
+ 0: 0,
20670
+ 1: 1,
20671
+ 2: 2,
20672
+ 3: 3,
20673
+ 4: 4,
20674
+ 5: 5,
20675
+ 6: 6,
20676
+ 7: 7,
20677
+ 8: 8,
20678
+ 9: 9,
20679
+ a: 10,
20680
+ A: 10,
20681
+ b: 11,
20682
+ B: 11,
20683
+ c: 12,
20684
+ C: 12,
20685
+ d: 13,
20686
+ D: 13,
20687
+ e: 14,
20688
+ E: 14,
20689
+ f: 15,
20690
+ F: 15
20691
+ };
20692
+ var scopedChars = {
20693
+ HEX: HEX$1
20694
+ };
20695
+ const { HEX } = scopedChars;
20696
+ function normalizeIPv4$1(host) {
20697
+ if (findToken(host, ".") < 3) {
20698
+ return { host, isIPV4: false };
20699
+ }
20700
+ const matches = host.match(/^(\b[01]?\d{1,2}|\b2[0-4]\d|\b25[0-5])(\.([01]?\d{1,2}|2[0-4]\d|25[0-5])){3}$/u) || [];
20701
+ const [address] = matches;
20702
+ if (address) {
20703
+ return { host: stripLeadingZeros(address, "."), isIPV4: true };
20704
+ } else {
20705
+ return { host, isIPV4: false };
20706
+ }
20707
+ }
20708
+ function stringToHexStripped(input) {
20709
+ let acc = "";
20710
+ let strip = true;
20711
+ for (const c of input) {
20712
+ if (c !== "0" && strip === true)
20713
+ strip = false;
20714
+ if (HEX[c] === void 0)
20715
+ return void 0;
20716
+ if (!strip)
20717
+ acc += c;
20718
+ }
20719
+ return acc;
20720
+ }
20721
+ function getIPV6(input) {
20722
+ let tokenCount = 0;
20723
+ const output = { error: false, address: "", zone: "" };
20724
+ const address = [];
20725
+ const buffer = [];
20726
+ let isZone = false;
20727
+ let endipv6Encountered = false;
20728
+ let endIpv6 = false;
20729
+ function consume() {
20730
+ if (buffer.length) {
20731
+ if (isZone === false) {
20732
+ const hex = stringToHexStripped(buffer.join(""));
20733
+ if (hex !== void 0) {
20734
+ address.push(hex);
20819
20735
  } else {
20820
- output.push(value);
20736
+ output.error = true;
20737
+ return false;
20821
20738
  }
20822
20739
  }
20823
- return output;
20740
+ buffer.length = 0;
20824
20741
  }
20825
- var ucs2encode = function ucs2encode2(array) {
20826
- return String.fromCodePoint.apply(String, toConsumableArray(array));
20827
- };
20828
- var basicToDigit = function basicToDigit2(codePoint) {
20829
- if (codePoint - 48 < 10) {
20830
- return codePoint - 22;
20831
- }
20832
- if (codePoint - 65 < 26) {
20833
- return codePoint - 65;
20834
- }
20835
- if (codePoint - 97 < 26) {
20836
- return codePoint - 97;
20742
+ return true;
20743
+ }
20744
+ for (let i = 0; i < input.length; i++) {
20745
+ const cursor = input[i];
20746
+ if (cursor === "[" || cursor === "]") {
20747
+ continue;
20748
+ }
20749
+ if (cursor === ":") {
20750
+ if (endipv6Encountered === true) {
20751
+ endIpv6 = true;
20837
20752
  }
20838
- return base;
20839
- };
20840
- var digitToBasic = function digitToBasic2(digit, flag) {
20841
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
20842
- };
20843
- var adapt = function adapt2(delta, numPoints, firstTime) {
20844
- var k2 = 0;
20845
- delta = firstTime ? floor(delta / damp) : delta >> 1;
20846
- delta += floor(delta / numPoints);
20847
- for (
20848
- ;
20849
- /* no initialization */
20850
- delta > baseMinusTMin * tMax >> 1;
20851
- k2 += base
20852
- ) {
20853
- delta = floor(delta / baseMinusTMin);
20854
- }
20855
- return floor(k2 + (baseMinusTMin + 1) * delta / (delta + skew));
20856
- };
20857
- var decode = function decode2(input) {
20858
- var output = [];
20859
- var inputLength = input.length;
20860
- var i = 0;
20861
- var n2 = initialN;
20862
- var bias = initialBias;
20863
- var basic = input.lastIndexOf(delimiter);
20864
- if (basic < 0) {
20865
- basic = 0;
20866
- }
20867
- for (var j2 = 0; j2 < basic; ++j2) {
20868
- if (input.charCodeAt(j2) >= 128) {
20869
- error$12("not-basic");
20870
- }
20871
- output.push(input.charCodeAt(j2));
20872
- }
20873
- for (var index2 = basic > 0 ? basic + 1 : 0; index2 < inputLength; ) {
20874
- var oldi = i;
20875
- for (
20876
- var w2 = 1, k2 = base;
20877
- ;
20878
- /* no condition */
20879
- k2 += base
20880
- ) {
20881
- if (index2 >= inputLength) {
20882
- error$12("invalid-input");
20883
- }
20884
- var digit = basicToDigit(input.charCodeAt(index2++));
20885
- if (digit >= base || digit > floor((maxInt - i) / w2)) {
20886
- error$12("overflow");
20887
- }
20888
- i += digit * w2;
20889
- var t2 = k2 <= bias ? tMin : k2 >= bias + tMax ? tMax : k2 - bias;
20890
- if (digit < t2) {
20891
- break;
20892
- }
20893
- var baseMinusT = base - t2;
20894
- if (w2 > floor(maxInt / baseMinusT)) {
20895
- error$12("overflow");
20896
- }
20897
- w2 *= baseMinusT;
20898
- }
20899
- var out = output.length + 1;
20900
- bias = adapt(i - oldi, out, oldi == 0);
20901
- if (floor(i / out) > maxInt - n2) {
20902
- error$12("overflow");
20903
- }
20904
- n2 += floor(i / out);
20905
- i %= out;
20906
- output.splice(i++, 0, n2);
20753
+ if (!consume()) {
20754
+ break;
20907
20755
  }
20908
- return String.fromCodePoint.apply(String, output);
20909
- };
20910
- var encode2 = function encode3(input) {
20911
- var output = [];
20912
- input = ucs2decode(input);
20913
- var inputLength = input.length;
20914
- var n2 = initialN;
20915
- var delta = 0;
20916
- var bias = initialBias;
20917
- var _iteratorNormalCompletion = true;
20918
- var _didIteratorError = false;
20919
- var _iteratorError = void 0;
20920
- try {
20921
- for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
20922
- var _currentValue2 = _step.value;
20923
- if (_currentValue2 < 128) {
20924
- output.push(stringFromCharCode(_currentValue2));
20925
- }
20926
- }
20927
- } catch (err) {
20928
- _didIteratorError = true;
20929
- _iteratorError = err;
20930
- } finally {
20931
- try {
20932
- if (!_iteratorNormalCompletion && _iterator.return) {
20933
- _iterator.return();
20934
- }
20935
- } finally {
20936
- if (_didIteratorError) {
20937
- throw _iteratorError;
20938
- }
20939
- }
20756
+ tokenCount++;
20757
+ address.push(":");
20758
+ if (tokenCount > 7) {
20759
+ output.error = true;
20760
+ break;
20940
20761
  }
20941
- var basicLength = output.length;
20942
- var handledCPCount = basicLength;
20943
- if (basicLength) {
20944
- output.push(delimiter);
20762
+ if (i - 1 >= 0 && input[i - 1] === ":") {
20763
+ endipv6Encountered = true;
20945
20764
  }
20946
- while (handledCPCount < inputLength) {
20947
- var m2 = maxInt;
20948
- var _iteratorNormalCompletion2 = true;
20949
- var _didIteratorError2 = false;
20950
- var _iteratorError2 = void 0;
20951
- try {
20952
- for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
20953
- var currentValue = _step2.value;
20954
- if (currentValue >= n2 && currentValue < m2) {
20955
- m2 = currentValue;
20956
- }
20957
- }
20958
- } catch (err) {
20959
- _didIteratorError2 = true;
20960
- _iteratorError2 = err;
20961
- } finally {
20962
- try {
20963
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
20964
- _iterator2.return();
20965
- }
20966
- } finally {
20967
- if (_didIteratorError2) {
20968
- throw _iteratorError2;
20969
- }
20970
- }
20971
- }
20972
- var handledCPCountPlusOne = handledCPCount + 1;
20973
- if (m2 - n2 > floor((maxInt - delta) / handledCPCountPlusOne)) {
20974
- error$12("overflow");
20975
- }
20976
- delta += (m2 - n2) * handledCPCountPlusOne;
20977
- n2 = m2;
20978
- var _iteratorNormalCompletion3 = true;
20979
- var _didIteratorError3 = false;
20980
- var _iteratorError3 = void 0;
20981
- try {
20982
- for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
20983
- var _currentValue = _step3.value;
20984
- if (_currentValue < n2 && ++delta > maxInt) {
20985
- error$12("overflow");
20986
- }
20987
- if (_currentValue == n2) {
20988
- var q2 = delta;
20989
- for (
20990
- var k2 = base;
20991
- ;
20992
- /* no condition */
20993
- k2 += base
20994
- ) {
20995
- var t2 = k2 <= bias ? tMin : k2 >= bias + tMax ? tMax : k2 - bias;
20996
- if (q2 < t2) {
20997
- break;
20998
- }
20999
- var qMinusT = q2 - t2;
21000
- var baseMinusT = base - t2;
21001
- output.push(stringFromCharCode(digitToBasic(t2 + qMinusT % baseMinusT, 0)));
21002
- q2 = floor(qMinusT / baseMinusT);
21003
- }
21004
- output.push(stringFromCharCode(digitToBasic(q2, 0)));
21005
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
21006
- delta = 0;
21007
- ++handledCPCount;
21008
- }
21009
- }
21010
- } catch (err) {
21011
- _didIteratorError3 = true;
21012
- _iteratorError3 = err;
21013
- } finally {
21014
- try {
21015
- if (!_iteratorNormalCompletion3 && _iterator3.return) {
21016
- _iterator3.return();
21017
- }
21018
- } finally {
21019
- if (_didIteratorError3) {
21020
- throw _iteratorError3;
21021
- }
21022
- }
21023
- }
21024
- ++delta;
21025
- ++n2;
20765
+ continue;
20766
+ } else if (cursor === "%") {
20767
+ if (!consume()) {
20768
+ break;
21026
20769
  }
21027
- return output.join("");
21028
- };
21029
- var toUnicode = function toUnicode2(input) {
21030
- return mapDomain(input, function(string) {
21031
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
21032
- });
21033
- };
21034
- var toASCII = function toASCII2(input) {
21035
- return mapDomain(input, function(string) {
21036
- return regexNonASCII.test(string) ? "xn--" + encode2(string) : string;
21037
- });
21038
- };
21039
- var punycode = {
21040
- /**
21041
- * A string representing the current Punycode.js version number.
21042
- * @memberOf punycode
21043
- * @type String
21044
- */
21045
- "version": "2.1.0",
21046
- /**
21047
- * An object of methods to convert from JavaScript's internal character
21048
- * representation (UCS-2) to Unicode code points, and back.
21049
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
21050
- * @memberOf punycode
21051
- * @type Object
21052
- */
21053
- "ucs2": {
21054
- "decode": ucs2decode,
21055
- "encode": ucs2encode
21056
- },
21057
- "decode": decode,
21058
- "encode": encode2,
21059
- "toASCII": toASCII,
21060
- "toUnicode": toUnicode
21061
- };
21062
- var SCHEMES = {};
21063
- function pctEncChar(chr) {
21064
- var c = chr.charCodeAt(0);
21065
- var e2 = void 0;
21066
- if (c < 16)
21067
- e2 = "%0" + c.toString(16).toUpperCase();
21068
- else if (c < 128)
21069
- e2 = "%" + c.toString(16).toUpperCase();
21070
- else if (c < 2048)
21071
- e2 = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
21072
- else
21073
- e2 = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
21074
- return e2;
20770
+ isZone = true;
20771
+ } else {
20772
+ buffer.push(cursor);
20773
+ continue;
21075
20774
  }
21076
- function pctDecChars(str) {
21077
- var newStr = "";
21078
- var i = 0;
21079
- var il = str.length;
21080
- while (i < il) {
21081
- var c = parseInt(str.substr(i + 1, 2), 16);
21082
- if (c < 128) {
21083
- newStr += String.fromCharCode(c);
21084
- i += 3;
21085
- } else if (c >= 194 && c < 224) {
21086
- if (il - i >= 6) {
21087
- var c2 = parseInt(str.substr(i + 4, 2), 16);
21088
- newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
21089
- } else {
21090
- newStr += str.substr(i, 6);
21091
- }
21092
- i += 6;
21093
- } else if (c >= 224) {
21094
- if (il - i >= 9) {
21095
- var _c = parseInt(str.substr(i + 4, 2), 16);
21096
- var c3 = parseInt(str.substr(i + 7, 2), 16);
21097
- newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
21098
- } else {
21099
- newStr += str.substr(i, 9);
21100
- }
21101
- i += 9;
21102
- } else {
21103
- newStr += str.substr(i, 3);
21104
- i += 3;
21105
- }
20775
+ }
20776
+ if (buffer.length) {
20777
+ if (isZone) {
20778
+ output.zone = buffer.join("");
20779
+ } else if (endIpv6) {
20780
+ address.push(buffer.join(""));
20781
+ } else {
20782
+ address.push(stringToHexStripped(buffer.join("")));
20783
+ }
20784
+ }
20785
+ output.address = address.join("");
20786
+ return output;
20787
+ }
20788
+ function normalizeIPv6$1(host, opts = {}) {
20789
+ if (findToken(host, ":") < 2) {
20790
+ return { host, isIPV6: false };
20791
+ }
20792
+ const ipv6 = getIPV6(host);
20793
+ if (!ipv6.error) {
20794
+ let newHost = ipv6.address;
20795
+ let escapedHost = ipv6.address;
20796
+ if (ipv6.zone) {
20797
+ newHost += "%" + ipv6.zone;
20798
+ escapedHost += "%25" + ipv6.zone;
20799
+ }
20800
+ return { host: newHost, escapedHost, isIPV6: true };
20801
+ } else {
20802
+ return { host, isIPV6: false };
20803
+ }
20804
+ }
20805
+ function stripLeadingZeros(str, token) {
20806
+ let out = "";
20807
+ let skip = true;
20808
+ const l = str.length;
20809
+ for (let i = 0; i < l; i++) {
20810
+ const c = str[i];
20811
+ if (c === "0" && skip) {
20812
+ if (i + 1 <= l && str[i + 1] === token || i + 1 === l) {
20813
+ out += c;
20814
+ skip = false;
21106
20815
  }
21107
- return newStr;
21108
- }
21109
- function _normalizeComponentEncoding(components, protocol) {
21110
- function decodeUnreserved2(str) {
21111
- var decStr = pctDecChars(str);
21112
- return !decStr.match(protocol.UNRESERVED) ? str : decStr;
21113
- }
21114
- if (components.scheme)
21115
- components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, "");
21116
- if (components.userinfo !== void 0)
21117
- components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
21118
- if (components.host !== void 0)
21119
- components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
21120
- if (components.path !== void 0)
21121
- 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);
21122
- if (components.query !== void 0)
21123
- components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
21124
- if (components.fragment !== void 0)
21125
- components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
21126
- return components;
21127
- }
21128
- function _stripLeadingZeros(str) {
21129
- return str.replace(/^0*(.*)/, "$1") || "0";
21130
- }
21131
- function _normalizeIPv4(host, protocol) {
21132
- var matches = host.match(protocol.IPV4ADDRESS) || [];
21133
- var _matches = slicedToArray(matches, 2), address = _matches[1];
21134
- if (address) {
21135
- return address.split(".").map(_stripLeadingZeros).join(".");
21136
- } else {
21137
- return host;
21138
- }
21139
- }
21140
- function _normalizeIPv6(host, protocol) {
21141
- var matches = host.match(protocol.IPV6ADDRESS) || [];
21142
- var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2];
21143
- if (address) {
21144
- var _address$toLowerCase$ = address.toLowerCase().split("::").reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1];
21145
- var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
21146
- var lastFields = last.split(":").map(_stripLeadingZeros);
21147
- var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
21148
- var fieldCount = isLastFieldIPv4Address ? 7 : 8;
21149
- var lastFieldsStart = lastFields.length - fieldCount;
21150
- var fields = Array(fieldCount);
21151
- for (var x2 = 0; x2 < fieldCount; ++x2) {
21152
- fields[x2] = firstFields[x2] || lastFields[lastFieldsStart + x2] || "";
21153
- }
21154
- if (isLastFieldIPv4Address) {
21155
- fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
21156
- }
21157
- var allZeroFields = fields.reduce(function(acc, field, index2) {
21158
- if (!field || field === "0") {
21159
- var lastLongest = acc[acc.length - 1];
21160
- if (lastLongest && lastLongest.index + lastLongest.length === index2) {
21161
- lastLongest.length++;
21162
- } else {
21163
- acc.push({ index: index2, length: 1 });
21164
- }
21165
- }
21166
- return acc;
21167
- }, []);
21168
- var longestZeroFields = allZeroFields.sort(function(a, b2) {
21169
- return b2.length - a.length;
21170
- })[0];
21171
- var newHost = void 0;
21172
- if (longestZeroFields && longestZeroFields.length > 1) {
21173
- var newFirst = fields.slice(0, longestZeroFields.index);
21174
- var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
21175
- newHost = newFirst.join(":") + "::" + newLast.join(":");
21176
- } else {
21177
- newHost = fields.join(":");
21178
- }
21179
- if (zone) {
21180
- newHost += "%" + zone;
21181
- }
21182
- return newHost;
20816
+ } else {
20817
+ if (c === token) {
20818
+ skip = true;
21183
20819
  } else {
21184
- return host;
21185
- }
21186
- }
21187
- var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
21188
- var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
21189
- function parse(uriString) {
21190
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
21191
- var components = {};
21192
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
21193
- if (options.reference === "suffix")
21194
- uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
21195
- var matches = uriString.match(URI_PARSE);
21196
- if (matches) {
21197
- if (NO_MATCH_IS_UNDEFINED) {
21198
- components.scheme = matches[1];
21199
- components.userinfo = matches[3];
21200
- components.host = matches[4];
21201
- components.port = parseInt(matches[5], 10);
21202
- components.path = matches[6] || "";
21203
- components.query = matches[7];
21204
- components.fragment = matches[8];
21205
- if (isNaN(components.port)) {
21206
- components.port = matches[5];
21207
- }
21208
- } else {
21209
- components.scheme = matches[1] || void 0;
21210
- components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : void 0;
21211
- components.host = uriString.indexOf("//") !== -1 ? matches[4] : void 0;
21212
- components.port = parseInt(matches[5], 10);
21213
- components.path = matches[6] || "";
21214
- components.query = uriString.indexOf("?") !== -1 ? matches[7] : void 0;
21215
- components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : void 0;
21216
- if (isNaN(components.port)) {
21217
- components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : void 0;
21218
- }
21219
- }
21220
- if (components.host) {
21221
- components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
21222
- }
21223
- if (components.scheme === void 0 && components.userinfo === void 0 && components.host === void 0 && components.port === void 0 && !components.path && components.query === void 0) {
21224
- components.reference = "same-document";
21225
- } else if (components.scheme === void 0) {
21226
- components.reference = "relative";
21227
- } else if (components.fragment === void 0) {
21228
- components.reference = "absolute";
21229
- } else {
21230
- components.reference = "uri";
21231
- }
21232
- if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
21233
- components.error = components.error || "URI is not a " + options.reference + " reference.";
21234
- }
21235
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
21236
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
21237
- if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
21238
- try {
21239
- components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
21240
- } catch (e2) {
21241
- components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e2;
21242
- }
21243
- }
21244
- _normalizeComponentEncoding(components, URI_PROTOCOL);
21245
- } else {
21246
- _normalizeComponentEncoding(components, protocol);
21247
- }
21248
- if (schemeHandler && schemeHandler.parse) {
21249
- schemeHandler.parse(components, options);
21250
- }
20820
+ skip = false;
20821
+ }
20822
+ out += c;
20823
+ }
20824
+ }
20825
+ return out;
20826
+ }
20827
+ function findToken(str, token) {
20828
+ let ind = 0;
20829
+ for (let i = 0; i < str.length; i++) {
20830
+ if (str[i] === token)
20831
+ ind++;
20832
+ }
20833
+ return ind;
20834
+ }
20835
+ const RDS1 = /^\.\.?\//u;
20836
+ const RDS2 = /^\/\.(?:\/|$)/u;
20837
+ const RDS3 = /^\/\.\.(?:\/|$)/u;
20838
+ const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u;
20839
+ function removeDotSegments$1(input) {
20840
+ const output = [];
20841
+ while (input.length) {
20842
+ if (input.match(RDS1)) {
20843
+ input = input.replace(RDS1, "");
20844
+ } else if (input.match(RDS2)) {
20845
+ input = input.replace(RDS2, "/");
20846
+ } else if (input.match(RDS3)) {
20847
+ input = input.replace(RDS3, "/");
20848
+ output.pop();
20849
+ } else if (input === "." || input === "..") {
20850
+ input = "";
20851
+ } else {
20852
+ const im = input.match(RDS5);
20853
+ if (im) {
20854
+ const s = im[0];
20855
+ input = input.slice(s.length);
20856
+ output.push(s);
21251
20857
  } else {
21252
- components.error = components.error || "URI can not be parsed.";
21253
- }
21254
- return components;
21255
- }
21256
- function _recomposeAuthority(components, options) {
21257
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
21258
- var uriTokens = [];
21259
- if (components.userinfo !== void 0) {
21260
- uriTokens.push(components.userinfo);
21261
- uriTokens.push("@");
21262
- }
21263
- if (components.host !== void 0) {
21264
- uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(_2, $1, $2) {
21265
- return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
21266
- }));
21267
- }
21268
- if (typeof components.port === "number" || typeof components.port === "string") {
21269
- uriTokens.push(":");
21270
- uriTokens.push(String(components.port));
21271
- }
21272
- return uriTokens.length ? uriTokens.join("") : void 0;
21273
- }
21274
- var RDS1 = /^\.\.?\//;
21275
- var RDS2 = /^\/\.(\/|$)/;
21276
- var RDS3 = /^\/\.\.(\/|$)/;
21277
- var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
21278
- function removeDotSegments(input) {
21279
- var output = [];
21280
- while (input.length) {
21281
- if (input.match(RDS1)) {
21282
- input = input.replace(RDS1, "");
21283
- } else if (input.match(RDS2)) {
21284
- input = input.replace(RDS2, "/");
21285
- } else if (input.match(RDS3)) {
21286
- input = input.replace(RDS3, "/");
21287
- output.pop();
21288
- } else if (input === "." || input === "..") {
21289
- input = "";
21290
- } else {
21291
- var im = input.match(RDS5);
21292
- if (im) {
21293
- var s = im[0];
21294
- input = input.slice(s.length);
21295
- output.push(s);
21296
- } else {
21297
- throw new Error("Unexpected dot segment condition");
21298
- }
21299
- }
21300
- }
21301
- return output.join("");
21302
- }
21303
- function serialize(components) {
21304
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
21305
- var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
21306
- var uriTokens = [];
21307
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
21308
- if (schemeHandler && schemeHandler.serialize)
21309
- schemeHandler.serialize(components, options);
21310
- if (components.host) {
21311
- if (protocol.IPV6ADDRESS.test(components.host))
21312
- ;
21313
- else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
21314
- try {
21315
- components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
21316
- } catch (e2) {
21317
- components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e2;
21318
- }
21319
- }
21320
- }
21321
- _normalizeComponentEncoding(components, protocol);
21322
- if (options.reference !== "suffix" && components.scheme) {
21323
- uriTokens.push(components.scheme);
21324
- uriTokens.push(":");
20858
+ throw new Error("Unexpected dot segment condition");
21325
20859
  }
21326
- var authority = _recomposeAuthority(components, options);
21327
- if (authority !== void 0) {
21328
- if (options.reference !== "suffix") {
21329
- uriTokens.push("//");
21330
- }
21331
- uriTokens.push(authority);
21332
- if (components.path && components.path.charAt(0) !== "/") {
21333
- uriTokens.push("/");
21334
- }
20860
+ }
20861
+ }
20862
+ return output.join("");
20863
+ }
20864
+ function normalizeComponentEncoding$1(components, esc) {
20865
+ const func = esc !== true ? escape : unescape;
20866
+ if (components.scheme !== void 0) {
20867
+ components.scheme = func(components.scheme);
20868
+ }
20869
+ if (components.userinfo !== void 0) {
20870
+ components.userinfo = func(components.userinfo);
20871
+ }
20872
+ if (components.host !== void 0) {
20873
+ components.host = func(components.host);
20874
+ }
20875
+ if (components.path !== void 0) {
20876
+ components.path = func(components.path);
20877
+ }
20878
+ if (components.query !== void 0) {
20879
+ components.query = func(components.query);
20880
+ }
20881
+ if (components.fragment !== void 0) {
20882
+ components.fragment = func(components.fragment);
20883
+ }
20884
+ return components;
20885
+ }
20886
+ function recomposeAuthority$1(components, options) {
20887
+ const uriTokens = [];
20888
+ if (components.userinfo !== void 0) {
20889
+ uriTokens.push(components.userinfo);
20890
+ uriTokens.push("@");
20891
+ }
20892
+ if (components.host !== void 0) {
20893
+ let host = unescape(components.host);
20894
+ const ipV4res = normalizeIPv4$1(host);
20895
+ if (ipV4res.isIPV4) {
20896
+ host = ipV4res.host;
20897
+ } else {
20898
+ const ipV6res = normalizeIPv6$1(ipV4res.host, { isIPV4: false });
20899
+ if (ipV6res.isIPV6 === true) {
20900
+ host = `[${ipV6res.escapedHost}]`;
20901
+ } else {
20902
+ host = components.host;
21335
20903
  }
21336
- if (components.path !== void 0) {
21337
- var s = components.path;
21338
- if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
21339
- s = removeDotSegments(s);
21340
- }
21341
- if (authority === void 0) {
21342
- s = s.replace(/^\/\//, "/%2F");
20904
+ }
20905
+ uriTokens.push(host);
20906
+ }
20907
+ if (typeof components.port === "number" || typeof components.port === "string") {
20908
+ uriTokens.push(":");
20909
+ uriTokens.push(String(components.port));
20910
+ }
20911
+ return uriTokens.length ? uriTokens.join("") : void 0;
20912
+ }
20913
+ var utils = {
20914
+ recomposeAuthority: recomposeAuthority$1,
20915
+ normalizeComponentEncoding: normalizeComponentEncoding$1,
20916
+ removeDotSegments: removeDotSegments$1,
20917
+ normalizeIPv4: normalizeIPv4$1,
20918
+ normalizeIPv6: normalizeIPv6$1,
20919
+ stringToHexStripped
20920
+ };
20921
+ const UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu;
20922
+ const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
20923
+ function isSecure(wsComponents) {
20924
+ return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
20925
+ }
20926
+ function httpParse(components) {
20927
+ if (!components.host) {
20928
+ components.error = components.error || "HTTP URIs must have a host.";
20929
+ }
20930
+ return components;
20931
+ }
20932
+ function httpSerialize(components) {
20933
+ const secure = String(components.scheme).toLowerCase() === "https";
20934
+ if (components.port === (secure ? 443 : 80) || components.port === "") {
20935
+ components.port = void 0;
20936
+ }
20937
+ if (!components.path) {
20938
+ components.path = "/";
20939
+ }
20940
+ return components;
20941
+ }
20942
+ function wsParse(wsComponents) {
20943
+ wsComponents.secure = isSecure(wsComponents);
20944
+ wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
20945
+ wsComponents.path = void 0;
20946
+ wsComponents.query = void 0;
20947
+ return wsComponents;
20948
+ }
20949
+ function wsSerialize(wsComponents) {
20950
+ if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
20951
+ wsComponents.port = void 0;
20952
+ }
20953
+ if (typeof wsComponents.secure === "boolean") {
20954
+ wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
20955
+ wsComponents.secure = void 0;
20956
+ }
20957
+ if (wsComponents.resourceName) {
20958
+ const [path, query] = wsComponents.resourceName.split("?");
20959
+ wsComponents.path = path && path !== "/" ? path : void 0;
20960
+ wsComponents.query = query;
20961
+ wsComponents.resourceName = void 0;
20962
+ }
20963
+ wsComponents.fragment = void 0;
20964
+ return wsComponents;
20965
+ }
20966
+ function urnParse(urnComponents, options) {
20967
+ if (!urnComponents.path) {
20968
+ urnComponents.error = "URN can not be parsed";
20969
+ return urnComponents;
20970
+ }
20971
+ const matches = urnComponents.path.match(URN_REG);
20972
+ if (matches) {
20973
+ const scheme = options.scheme || urnComponents.scheme || "urn";
20974
+ urnComponents.nid = matches[1].toLowerCase();
20975
+ urnComponents.nss = matches[2];
20976
+ const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`;
20977
+ const schemeHandler = SCHEMES$1[urnScheme];
20978
+ urnComponents.path = void 0;
20979
+ if (schemeHandler) {
20980
+ urnComponents = schemeHandler.parse(urnComponents, options);
20981
+ }
20982
+ } else {
20983
+ urnComponents.error = urnComponents.error || "URN can not be parsed.";
20984
+ }
20985
+ return urnComponents;
20986
+ }
20987
+ function urnSerialize(urnComponents, options) {
20988
+ const scheme = options.scheme || urnComponents.scheme || "urn";
20989
+ const nid = urnComponents.nid.toLowerCase();
20990
+ const urnScheme = `${scheme}:${options.nid || nid}`;
20991
+ const schemeHandler = SCHEMES$1[urnScheme];
20992
+ if (schemeHandler) {
20993
+ urnComponents = schemeHandler.serialize(urnComponents, options);
20994
+ }
20995
+ const uriComponents = urnComponents;
20996
+ const nss = urnComponents.nss;
20997
+ uriComponents.path = `${nid || options.nid}:${nss}`;
20998
+ options.skipEscape = true;
20999
+ return uriComponents;
21000
+ }
21001
+ function urnuuidParse(urnComponents, options) {
21002
+ const uuidComponents = urnComponents;
21003
+ uuidComponents.uuid = uuidComponents.nss;
21004
+ uuidComponents.nss = void 0;
21005
+ if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
21006
+ uuidComponents.error = uuidComponents.error || "UUID is not valid.";
21007
+ }
21008
+ return uuidComponents;
21009
+ }
21010
+ function urnuuidSerialize(uuidComponents) {
21011
+ const urnComponents = uuidComponents;
21012
+ urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
21013
+ return urnComponents;
21014
+ }
21015
+ const http = {
21016
+ scheme: "http",
21017
+ domainHost: true,
21018
+ parse: httpParse,
21019
+ serialize: httpSerialize
21020
+ };
21021
+ const https = {
21022
+ scheme: "https",
21023
+ domainHost: http.domainHost,
21024
+ parse: httpParse,
21025
+ serialize: httpSerialize
21026
+ };
21027
+ const ws = {
21028
+ scheme: "ws",
21029
+ domainHost: true,
21030
+ parse: wsParse,
21031
+ serialize: wsSerialize
21032
+ };
21033
+ const wss = {
21034
+ scheme: "wss",
21035
+ domainHost: ws.domainHost,
21036
+ parse: ws.parse,
21037
+ serialize: ws.serialize
21038
+ };
21039
+ const urn = {
21040
+ scheme: "urn",
21041
+ parse: urnParse,
21042
+ serialize: urnSerialize,
21043
+ skipNormalize: true
21044
+ };
21045
+ const urnuuid = {
21046
+ scheme: "urn:uuid",
21047
+ parse: urnuuidParse,
21048
+ serialize: urnuuidSerialize,
21049
+ skipNormalize: true
21050
+ };
21051
+ const SCHEMES$1 = {
21052
+ http,
21053
+ https,
21054
+ ws,
21055
+ wss,
21056
+ urn,
21057
+ "urn:uuid": urnuuid
21058
+ };
21059
+ var schemes = SCHEMES$1;
21060
+ const URL$1 = require$$0$1;
21061
+ const { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = utils;
21062
+ const SCHEMES = schemes;
21063
+ function normalize(uri2, options) {
21064
+ if (typeof uri2 === "string") {
21065
+ uri2 = serialize(parse(uri2, options), options);
21066
+ } else if (typeof uri2 === "object") {
21067
+ uri2 = parse(serialize(uri2, options), options);
21068
+ }
21069
+ return uri2;
21070
+ }
21071
+ function resolve(baseURI, relativeURI, options) {
21072
+ const schemelessOptions = Object.assign({ scheme: "null" }, options);
21073
+ const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
21074
+ return serialize(resolved, { ...schemelessOptions, skipEscape: true });
21075
+ }
21076
+ function resolveComponents(base, relative, options, skipNormalization) {
21077
+ const target = {};
21078
+ if (!skipNormalization) {
21079
+ base = parse(serialize(base, options), options);
21080
+ relative = parse(serialize(relative, options), options);
21081
+ }
21082
+ options = options || {};
21083
+ if (!options.tolerant && relative.scheme) {
21084
+ target.scheme = relative.scheme;
21085
+ target.userinfo = relative.userinfo;
21086
+ target.host = relative.host;
21087
+ target.port = relative.port;
21088
+ target.path = removeDotSegments(relative.path || "");
21089
+ target.query = relative.query;
21090
+ } else {
21091
+ if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
21092
+ target.userinfo = relative.userinfo;
21093
+ target.host = relative.host;
21094
+ target.port = relative.port;
21095
+ target.path = removeDotSegments(relative.path || "");
21096
+ target.query = relative.query;
21097
+ } else {
21098
+ if (!relative.path) {
21099
+ target.path = base.path;
21100
+ if (relative.query !== void 0) {
21101
+ target.query = relative.query;
21102
+ } else {
21103
+ target.query = base.query;
21343
21104
  }
21344
- uriTokens.push(s);
21345
- }
21346
- if (components.query !== void 0) {
21347
- uriTokens.push("?");
21348
- uriTokens.push(components.query);
21349
- }
21350
- if (components.fragment !== void 0) {
21351
- uriTokens.push("#");
21352
- uriTokens.push(components.fragment);
21353
- }
21354
- return uriTokens.join("");
21355
- }
21356
- function resolveComponents(base2, relative) {
21357
- var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
21358
- var skipNormalization = arguments[3];
21359
- var target = {};
21360
- if (!skipNormalization) {
21361
- base2 = parse(serialize(base2, options), options);
21362
- relative = parse(serialize(relative, options), options);
21363
- }
21364
- options = options || {};
21365
- if (!options.tolerant && relative.scheme) {
21366
- target.scheme = relative.scheme;
21367
- target.userinfo = relative.userinfo;
21368
- target.host = relative.host;
21369
- target.port = relative.port;
21370
- target.path = removeDotSegments(relative.path || "");
21371
- target.query = relative.query;
21372
21105
  } else {
21373
- if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
21374
- target.userinfo = relative.userinfo;
21375
- target.host = relative.host;
21376
- target.port = relative.port;
21377
- target.path = removeDotSegments(relative.path || "");
21378
- target.query = relative.query;
21106
+ if (relative.path.charAt(0) === "/") {
21107
+ target.path = removeDotSegments(relative.path);
21379
21108
  } else {
21380
- if (!relative.path) {
21381
- target.path = base2.path;
21382
- if (relative.query !== void 0) {
21383
- target.query = relative.query;
21384
- } else {
21385
- target.query = base2.query;
21386
- }
21109
+ if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
21110
+ target.path = "/" + relative.path;
21111
+ } else if (!base.path) {
21112
+ target.path = relative.path;
21387
21113
  } else {
21388
- if (relative.path.charAt(0) === "/") {
21389
- target.path = removeDotSegments(relative.path);
21390
- } else {
21391
- if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
21392
- target.path = "/" + relative.path;
21393
- } else if (!base2.path) {
21394
- target.path = relative.path;
21395
- } else {
21396
- target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative.path;
21397
- }
21398
- target.path = removeDotSegments(target.path);
21399
- }
21400
- target.query = relative.query;
21114
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
21401
21115
  }
21402
- target.userinfo = base2.userinfo;
21403
- target.host = base2.host;
21404
- target.port = base2.port;
21116
+ target.path = removeDotSegments(target.path);
21405
21117
  }
21406
- target.scheme = base2.scheme;
21118
+ target.query = relative.query;
21407
21119
  }
21408
- target.fragment = relative.fragment;
21409
- return target;
21120
+ target.userinfo = base.userinfo;
21121
+ target.host = base.host;
21122
+ target.port = base.port;
21123
+ }
21124
+ target.scheme = base.scheme;
21125
+ }
21126
+ target.fragment = relative.fragment;
21127
+ return target;
21128
+ }
21129
+ function equal$2(uriA, uriB, options) {
21130
+ if (typeof uriA === "string") {
21131
+ uriA = unescape(uriA);
21132
+ uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true });
21133
+ } else if (typeof uriA === "object") {
21134
+ uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
21135
+ }
21136
+ if (typeof uriB === "string") {
21137
+ uriB = unescape(uriB);
21138
+ uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true });
21139
+ } else if (typeof uriB === "object") {
21140
+ uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
21141
+ }
21142
+ return uriA.toLowerCase() === uriB.toLowerCase();
21143
+ }
21144
+ function serialize(cmpts, opts) {
21145
+ const components = {
21146
+ host: cmpts.host,
21147
+ scheme: cmpts.scheme,
21148
+ userinfo: cmpts.userinfo,
21149
+ port: cmpts.port,
21150
+ path: cmpts.path,
21151
+ query: cmpts.query,
21152
+ nid: cmpts.nid,
21153
+ nss: cmpts.nss,
21154
+ uuid: cmpts.uuid,
21155
+ fragment: cmpts.fragment,
21156
+ reference: cmpts.reference,
21157
+ resourceName: cmpts.resourceName,
21158
+ secure: cmpts.secure,
21159
+ error: ""
21160
+ };
21161
+ const options = Object.assign({}, opts);
21162
+ const uriTokens = [];
21163
+ const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
21164
+ if (schemeHandler && schemeHandler.serialize)
21165
+ schemeHandler.serialize(components, options);
21166
+ if (components.path !== void 0) {
21167
+ if (!options.skipEscape) {
21168
+ components.path = escape(components.path);
21169
+ if (components.scheme !== void 0) {
21170
+ components.path = components.path.split("%3A").join(":");
21171
+ }
21172
+ } else {
21173
+ components.path = unescape(components.path);
21410
21174
  }
21411
- function resolve2(baseURI, relativeURI, options) {
21412
- var schemelessOptions = assign({ scheme: "null" }, options);
21413
- return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
21175
+ }
21176
+ if (options.reference !== "suffix" && components.scheme) {
21177
+ uriTokens.push(components.scheme);
21178
+ uriTokens.push(":");
21179
+ }
21180
+ const authority = recomposeAuthority(components, options);
21181
+ if (authority !== void 0) {
21182
+ if (options.reference !== "suffix") {
21183
+ uriTokens.push("//");
21414
21184
  }
21415
- function normalize(uri2, options) {
21416
- if (typeof uri2 === "string") {
21417
- uri2 = serialize(parse(uri2, options), options);
21418
- } else if (typeOf(uri2) === "object") {
21419
- uri2 = parse(serialize(uri2, options), options);
21420
- }
21421
- return uri2;
21185
+ uriTokens.push(authority);
21186
+ if (components.path && components.path.charAt(0) !== "/") {
21187
+ uriTokens.push("/");
21422
21188
  }
21423
- function equal3(uriA, uriB, options) {
21424
- if (typeof uriA === "string") {
21425
- uriA = serialize(parse(uriA, options), options);
21426
- } else if (typeOf(uriA) === "object") {
21427
- uriA = serialize(uriA, options);
21428
- }
21429
- if (typeof uriB === "string") {
21430
- uriB = serialize(parse(uriB, options), options);
21431
- } else if (typeOf(uriB) === "object") {
21432
- uriB = serialize(uriB, options);
21189
+ }
21190
+ if (components.path !== void 0) {
21191
+ let s = components.path;
21192
+ if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
21193
+ s = removeDotSegments(s);
21194
+ }
21195
+ if (authority === void 0) {
21196
+ s = s.replace(/^\/\//u, "/%2F");
21197
+ }
21198
+ uriTokens.push(s);
21199
+ }
21200
+ if (components.query !== void 0) {
21201
+ uriTokens.push("?");
21202
+ uriTokens.push(components.query);
21203
+ }
21204
+ if (components.fragment !== void 0) {
21205
+ uriTokens.push("#");
21206
+ uriTokens.push(components.fragment);
21207
+ }
21208
+ return uriTokens.join("");
21209
+ }
21210
+ const hexLookUp = Array.from({ length: 127 }, (v2, k2) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k2)));
21211
+ function nonSimpleDomain(value) {
21212
+ let code2 = 0;
21213
+ for (let i = 0, len = value.length; i < len; ++i) {
21214
+ code2 = value.charCodeAt(i);
21215
+ if (code2 > 126 || hexLookUp[code2]) {
21216
+ return true;
21217
+ }
21218
+ }
21219
+ return false;
21220
+ }
21221
+ const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
21222
+ function parse(uri2, opts) {
21223
+ const options = Object.assign({}, opts);
21224
+ const parsed = {
21225
+ scheme: void 0,
21226
+ userinfo: void 0,
21227
+ host: "",
21228
+ port: void 0,
21229
+ path: "",
21230
+ query: void 0,
21231
+ fragment: void 0
21232
+ };
21233
+ const gotEncoding = uri2.indexOf("%") !== -1;
21234
+ if (options.reference === "suffix")
21235
+ uri2 = (options.scheme ? options.scheme + ":" : "") + "//" + uri2;
21236
+ const matches = uri2.match(URI_PARSE);
21237
+ if (matches) {
21238
+ parsed.scheme = matches[1];
21239
+ parsed.userinfo = matches[3];
21240
+ parsed.host = matches[4];
21241
+ parsed.port = parseInt(matches[5], 10);
21242
+ parsed.path = matches[6] || "";
21243
+ parsed.query = matches[7];
21244
+ parsed.fragment = matches[8];
21245
+ if (isNaN(parsed.port)) {
21246
+ parsed.port = matches[5];
21247
+ }
21248
+ if (parsed.host) {
21249
+ const ipv4result = normalizeIPv4(parsed.host);
21250
+ if (ipv4result.isIPV4 === false) {
21251
+ parsed.host = normalizeIPv6(ipv4result.host, { isIPV4: false }).host.toLowerCase();
21252
+ } else {
21253
+ parsed.host = ipv4result.host;
21433
21254
  }
21434
- return uriA === uriB;
21435
21255
  }
21436
- function escapeComponent(str, options) {
21437
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
21256
+ if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && !parsed.path && parsed.query === void 0) {
21257
+ parsed.reference = "same-document";
21258
+ } else if (parsed.scheme === void 0) {
21259
+ parsed.reference = "relative";
21260
+ } else if (parsed.fragment === void 0) {
21261
+ parsed.reference = "absolute";
21262
+ } else {
21263
+ parsed.reference = "uri";
21438
21264
  }
21439
- function unescapeComponent(str, options) {
21440
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
21265
+ if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
21266
+ parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
21441
21267
  }
21442
- var handler = {
21443
- scheme: "http",
21444
- domainHost: true,
21445
- parse: function parse2(components, options) {
21446
- if (!components.host) {
21447
- components.error = components.error || "HTTP URIs must have a host.";
21448
- }
21449
- return components;
21450
- },
21451
- serialize: function serialize2(components, options) {
21452
- var secure = String(components.scheme).toLowerCase() === "https";
21453
- if (components.port === (secure ? 443 : 80) || components.port === "") {
21454
- components.port = void 0;
21455
- }
21456
- if (!components.path) {
21457
- components.path = "/";
21268
+ const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || "").toLowerCase()];
21269
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
21270
+ if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && nonSimpleDomain(parsed.host)) {
21271
+ try {
21272
+ parsed.host = URL$1.domainToASCII(parsed.host.toLowerCase());
21273
+ } catch (e2) {
21274
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e2;
21458
21275
  }
21459
- return components;
21460
21276
  }
21461
- };
21462
- var handler$1 = {
21463
- scheme: "https",
21464
- domainHost: handler.domainHost,
21465
- parse: handler.parse,
21466
- serialize: handler.serialize
21467
- };
21468
- function isSecure(wsComponents) {
21469
- return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
21470
- }
21471
- var handler$2 = {
21472
- scheme: "ws",
21473
- domainHost: true,
21474
- parse: function parse2(components, options) {
21475
- var wsComponents = components;
21476
- wsComponents.secure = isSecure(wsComponents);
21477
- wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
21478
- wsComponents.path = void 0;
21479
- wsComponents.query = void 0;
21480
- return wsComponents;
21481
- },
21482
- serialize: function serialize2(wsComponents, options) {
21483
- if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
21484
- wsComponents.port = void 0;
21485
- }
21486
- if (typeof wsComponents.secure === "boolean") {
21487
- wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
21488
- wsComponents.secure = void 0;
21489
- }
21490
- if (wsComponents.resourceName) {
21491
- var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1];
21492
- wsComponents.path = path && path !== "/" ? path : void 0;
21493
- wsComponents.query = query;
21494
- wsComponents.resourceName = void 0;
21495
- }
21496
- wsComponents.fragment = void 0;
21497
- return wsComponents;
21277
+ }
21278
+ if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
21279
+ if (gotEncoding && parsed.scheme !== void 0) {
21280
+ parsed.scheme = unescape(parsed.scheme);
21498
21281
  }
21499
- };
21500
- var handler$3 = {
21501
- scheme: "wss",
21502
- domainHost: handler$2.domainHost,
21503
- parse: handler$2.parse,
21504
- serialize: handler$2.serialize
21505
- };
21506
- var O2 = {};
21507
- var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]";
21508
- var HEXDIG$$ = "[0-9A-Fa-f]";
21509
- var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$));
21510
- var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
21511
- var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
21512
- var VCHAR$$ = merge2(QTEXT$$, '[\\"\\\\]');
21513
- var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
21514
- var UNRESERVED = new RegExp(UNRESERVED$$, "g");
21515
- var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
21516
- var NOT_LOCAL_PART = new RegExp(merge2("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
21517
- var NOT_HFNAME = new RegExp(merge2("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
21518
- var NOT_HFVALUE = NOT_HFNAME;
21519
- function decodeUnreserved(str) {
21520
- var decStr = pctDecChars(str);
21521
- return !decStr.match(UNRESERVED) ? str : decStr;
21522
- }
21523
- var handler$4 = {
21524
- scheme: "mailto",
21525
- parse: function parse$$1(components, options) {
21526
- var mailtoComponents = components;
21527
- var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
21528
- mailtoComponents.path = void 0;
21529
- if (mailtoComponents.query) {
21530
- var unknownHeaders = false;
21531
- var headers = {};
21532
- var hfields = mailtoComponents.query.split("&");
21533
- for (var x2 = 0, xl = hfields.length; x2 < xl; ++x2) {
21534
- var hfield = hfields[x2].split("=");
21535
- switch (hfield[0]) {
21536
- case "to":
21537
- var toAddrs = hfield[1].split(",");
21538
- for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
21539
- to.push(toAddrs[_x]);
21540
- }
21541
- break;
21542
- case "subject":
21543
- mailtoComponents.subject = unescapeComponent(hfield[1], options);
21544
- break;
21545
- case "body":
21546
- mailtoComponents.body = unescapeComponent(hfield[1], options);
21547
- break;
21548
- default:
21549
- unknownHeaders = true;
21550
- headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
21551
- break;
21552
- }
21553
- }
21554
- if (unknownHeaders)
21555
- mailtoComponents.headers = headers;
21556
- }
21557
- mailtoComponents.query = void 0;
21558
- for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
21559
- var addr = to[_x2].split("@");
21560
- addr[0] = unescapeComponent(addr[0]);
21561
- if (!options.unicodeSupport) {
21562
- try {
21563
- addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
21564
- } catch (e2) {
21565
- mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e2;
21566
- }
21567
- } else {
21568
- addr[1] = unescapeComponent(addr[1], options).toLowerCase();
21569
- }
21570
- to[_x2] = addr.join("@");
21571
- }
21572
- return mailtoComponents;
21573
- },
21574
- serialize: function serialize$$1(mailtoComponents, options) {
21575
- var components = mailtoComponents;
21576
- var to = toArray2(mailtoComponents.to);
21577
- if (to) {
21578
- for (var x2 = 0, xl = to.length; x2 < xl; ++x2) {
21579
- var toAddr = String(to[x2]);
21580
- var atIdx = toAddr.lastIndexOf("@");
21581
- var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
21582
- var domain = toAddr.slice(atIdx + 1);
21583
- try {
21584
- domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
21585
- } catch (e2) {
21586
- components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e2;
21587
- }
21588
- to[x2] = localPart + "@" + domain;
21589
- }
21590
- components.path = to.join(",");
21591
- }
21592
- var headers = mailtoComponents.headers = mailtoComponents.headers || {};
21593
- if (mailtoComponents.subject)
21594
- headers["subject"] = mailtoComponents.subject;
21595
- if (mailtoComponents.body)
21596
- headers["body"] = mailtoComponents.body;
21597
- var fields = [];
21598
- for (var name in headers) {
21599
- if (headers[name] !== O2[name]) {
21600
- 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));
21601
- }
21602
- }
21603
- if (fields.length) {
21604
- components.query = fields.join("&");
21605
- }
21606
- return components;
21282
+ if (gotEncoding && parsed.userinfo !== void 0) {
21283
+ parsed.userinfo = unescape(parsed.userinfo);
21607
21284
  }
21608
- };
21609
- var URN_PARSE = /^([^\:]+)\:(.*)/;
21610
- var handler$5 = {
21611
- scheme: "urn",
21612
- parse: function parse$$1(components, options) {
21613
- var matches = components.path && components.path.match(URN_PARSE);
21614
- var urnComponents = components;
21615
- if (matches) {
21616
- var scheme = options.scheme || urnComponents.scheme || "urn";
21617
- var nid = matches[1].toLowerCase();
21618
- var nss = matches[2];
21619
- var urnScheme = scheme + ":" + (options.nid || nid);
21620
- var schemeHandler = SCHEMES[urnScheme];
21621
- urnComponents.nid = nid;
21622
- urnComponents.nss = nss;
21623
- urnComponents.path = void 0;
21624
- if (schemeHandler) {
21625
- urnComponents = schemeHandler.parse(urnComponents, options);
21626
- }
21627
- } else {
21628
- urnComponents.error = urnComponents.error || "URN can not be parsed.";
21629
- }
21630
- return urnComponents;
21631
- },
21632
- serialize: function serialize$$1(urnComponents, options) {
21633
- var scheme = options.scheme || urnComponents.scheme || "urn";
21634
- var nid = urnComponents.nid;
21635
- var urnScheme = scheme + ":" + (options.nid || nid);
21636
- var schemeHandler = SCHEMES[urnScheme];
21637
- if (schemeHandler) {
21638
- urnComponents = schemeHandler.serialize(urnComponents, options);
21639
- }
21640
- var uriComponents = urnComponents;
21641
- var nss = urnComponents.nss;
21642
- uriComponents.path = (nid || options.nid) + ":" + nss;
21643
- return uriComponents;
21285
+ if (gotEncoding && parsed.host !== void 0) {
21286
+ parsed.host = unescape(parsed.host);
21644
21287
  }
21645
- };
21646
- var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
21647
- var handler$6 = {
21648
- scheme: "urn:uuid",
21649
- parse: function parse2(urnComponents, options) {
21650
- var uuidComponents = urnComponents;
21651
- uuidComponents.uuid = uuidComponents.nss;
21652
- uuidComponents.nss = void 0;
21653
- if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
21654
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";
21655
- }
21656
- return uuidComponents;
21657
- },
21658
- serialize: function serialize2(uuidComponents, options) {
21659
- var urnComponents = uuidComponents;
21660
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
21661
- return urnComponents;
21288
+ if (parsed.path !== void 0 && parsed.path.length) {
21289
+ parsed.path = encodeURI(parsed.path);
21662
21290
  }
21663
- };
21664
- SCHEMES[handler.scheme] = handler;
21665
- SCHEMES[handler$1.scheme] = handler$1;
21666
- SCHEMES[handler$2.scheme] = handler$2;
21667
- SCHEMES[handler$3.scheme] = handler$3;
21668
- SCHEMES[handler$4.scheme] = handler$4;
21669
- SCHEMES[handler$5.scheme] = handler$5;
21670
- SCHEMES[handler$6.scheme] = handler$6;
21671
- exports2.SCHEMES = SCHEMES;
21672
- exports2.pctEncChar = pctEncChar;
21673
- exports2.pctDecChars = pctDecChars;
21674
- exports2.parse = parse;
21675
- exports2.removeDotSegments = removeDotSegments;
21676
- exports2.serialize = serialize;
21677
- exports2.resolveComponents = resolveComponents;
21678
- exports2.resolve = resolve2;
21679
- exports2.normalize = normalize;
21680
- exports2.equal = equal3;
21681
- exports2.escapeComponent = escapeComponent;
21682
- exports2.unescapeComponent = unescapeComponent;
21683
- Object.defineProperty(exports2, "__esModule", { value: true });
21684
- });
21685
- })(uri_all, uri_all.exports);
21686
- var uri_allExports = uri_all.exports;
21291
+ if (parsed.fragment !== void 0 && parsed.fragment.length) {
21292
+ parsed.fragment = encodeURI(decodeURI(parsed.fragment));
21293
+ }
21294
+ }
21295
+ if (schemeHandler && schemeHandler.parse) {
21296
+ schemeHandler.parse(parsed, options);
21297
+ }
21298
+ } else {
21299
+ parsed.error = parsed.error || "URI can not be parsed.";
21300
+ }
21301
+ return parsed;
21302
+ }
21303
+ const fastUri = {
21304
+ normalize,
21305
+ resolve,
21306
+ resolveComponents,
21307
+ equal: equal$2,
21308
+ serialize,
21309
+ parse
21310
+ };
21311
+ fastUri$1.exports = fastUri;
21312
+ fastUri$1.exports.default = fastUri;
21313
+ fastUri$1.exports.fastUri = fastUri;
21314
+ var fastUriExports = fastUri$1.exports;
21687
21315
  Object.defineProperty(uri$1, "__esModule", { value: true });
21688
- const uri = uri_allExports;
21316
+ const uri = fastUriExports;
21689
21317
  uri.code = 'require("ajv/dist/runtime/uri").default';
21690
21318
  uri$1.default = uri;
21691
21319
  (function(exports) {
@@ -21719,7 +21347,7 @@ uri$1.default = uri;
21719
21347
  const rules_12 = rules;
21720
21348
  const compile_12 = compile;
21721
21349
  const codegen_2 = codegen;
21722
- const resolve_12 = resolve$1;
21350
+ const resolve_12 = resolve$2;
21723
21351
  const dataType_12 = dataType;
21724
21352
  const util_12 = util;
21725
21353
  const $dataRefSchema = require$$9;
@@ -22308,7 +21936,7 @@ id.default = def$B;
22308
21936
  var ref = {};
22309
21937
  Object.defineProperty(ref, "__esModule", { value: true });
22310
21938
  ref.callRef = ref.getValidate = void 0;
22311
- const ref_error_1 = ref_error;
21939
+ const ref_error_1$1 = ref_error;
22312
21940
  const code_1$8 = code;
22313
21941
  const codegen_1$p = codegen;
22314
21942
  const names_1$4 = names$1;
@@ -22325,7 +21953,7 @@ const def$A = {
22325
21953
  return callRootRef();
22326
21954
  const schOrEnv = compile_1$2.resolveRef.call(self2, root2, baseId, $ref);
22327
21955
  if (schOrEnv === void 0)
22328
- throw new ref_error_1.default(it2.opts.uriResolver, baseId, $ref);
21956
+ throw new ref_error_1$1.default(it2.opts.uriResolver, baseId, $ref);
22329
21957
  if (schOrEnv instanceof compile_1$2.SchemaEnv)
22330
21958
  return callValidate(schOrEnv);
22331
21959
  return inlineRefSchema(schOrEnv);
@@ -24017,6 +23645,7 @@ Object.defineProperty(discriminator, "__esModule", { value: true });
24017
23645
  const codegen_1 = codegen;
24018
23646
  const types_1 = types;
24019
23647
  const compile_1 = compile;
23648
+ const ref_error_1 = ref_error;
24020
23649
  const util_1 = util;
24021
23650
  const error = {
24022
23651
  message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
@@ -24069,9 +23698,12 @@ const def = {
24069
23698
  for (let i = 0; i < oneOf2.length; i++) {
24070
23699
  let sch = oneOf2[i];
24071
23700
  if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it2.self.RULES)) {
24072
- sch = compile_1.resolveRef.call(it2.self, it2.schemaEnv.root, it2.baseId, sch === null || sch === void 0 ? void 0 : sch.$ref);
23701
+ const ref2 = sch.$ref;
23702
+ sch = compile_1.resolveRef.call(it2.self, it2.schemaEnv.root, it2.baseId, ref2);
24073
23703
  if (sch instanceof compile_1.SchemaEnv)
24074
23704
  sch = sch.schema;
23705
+ if (sch === void 0)
23706
+ throw new ref_error_1.default(it2.opts.uriResolver, it2.baseId, ref2);
24075
23707
  }
24076
23708
  const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
24077
23709
  if (typeof propSch != "object") {
@@ -29194,7 +28826,7 @@ async function destroy() {
29194
28826
  state.summary.textContent = "";
29195
28827
  }
29196
28828
  state.form.textContent = "";
29197
- ir.cancelAll();
28829
+ cr.cancelAll();
29198
28830
  state.loader.clearAll();
29199
28831
  }
29200
28832
  async function update({ newOptions = {} } = {}) {