@wzyjs/utils 0.2.67 → 0.2.69

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.
@@ -5458,8 +5458,8 @@ __p += '`;
5458
5458
 
5459
5459
  // ../../node_modules/json5/dist/index.js
5460
5460
  var require_dist = __commonJS((exports2, module2) => {
5461
- (function(global2, factory) {
5462
- typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.JSON5 = factory();
5461
+ (function(global2, factory2) {
5462
+ typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory2() : typeof define === "function" && define.amd ? define(factory2) : global2.JSON5 = factory2();
5463
5463
  })(exports2, function() {
5464
5464
  function createCommonjsModule(fn, module3) {
5465
5465
  return module3 = { exports: {} }, fn(module3, module3.exports), module3.exports;
@@ -5589,14 +5589,14 @@ var require_dist = __commonJS((exports2, module2) => {
5589
5589
  return _functionToString.call(it);
5590
5590
  };
5591
5591
  (module3.exports = function(O, key2, val, safe) {
5592
- var isFunction2 = typeof val == "function";
5593
- if (isFunction2) {
5592
+ var isFunction3 = typeof val == "function";
5593
+ if (isFunction3) {
5594
5594
  _has(val, "name") || _hide(val, "name", key2);
5595
5595
  }
5596
5596
  if (O[key2] === val) {
5597
5597
  return;
5598
5598
  }
5599
- if (isFunction2) {
5599
+ if (isFunction3) {
5600
5600
  _has(val, SRC) || _hide(val, SRC, O[key2] ? "" + O[key2] : TPL.join(String(key2)));
5601
5601
  }
5602
5602
  if (O === _global2) {
@@ -7647,17 +7647,17 @@ var require_utc = __commonJS((exports2, module2) => {
7647
7647
  }, u.local = function() {
7648
7648
  return n(this.toDate(), { locale: this.$L, utc: false });
7649
7649
  };
7650
- var o = u.parse;
7650
+ var r = u.parse;
7651
7651
  u.parse = function(t2) {
7652
- t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), o.call(this, t2);
7652
+ t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), r.call(this, t2);
7653
7653
  };
7654
- var r = u.init;
7654
+ var o = u.init;
7655
7655
  u.init = function() {
7656
7656
  if (this.$u) {
7657
7657
  var t2 = this.$d;
7658
7658
  this.$y = t2.getUTCFullYear(), this.$M = t2.getUTCMonth(), this.$D = t2.getUTCDate(), this.$W = t2.getUTCDay(), this.$H = t2.getUTCHours(), this.$m = t2.getUTCMinutes(), this.$s = t2.getUTCSeconds(), this.$ms = t2.getUTCMilliseconds();
7659
7659
  } else
7660
- r.call(this);
7660
+ o.call(this);
7661
7661
  };
7662
7662
  var a = u.utcOffset;
7663
7663
  u.utcOffset = function(s2, f2) {
@@ -7673,15 +7673,14 @@ var require_utc = __commonJS((exports2, module2) => {
7673
7673
  return u3 === 0 ? 0 : n3 === "+" ? u3 : -u3;
7674
7674
  }(s2), s2 === null))
7675
7675
  return this;
7676
- var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2, o2 = this;
7676
+ var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
7677
+ if (u2 === 0)
7678
+ return this.utc(f2);
7679
+ var r2 = this.clone();
7677
7680
  if (f2)
7678
- return o2.$offset = u2, o2.$u = s2 === 0, o2;
7679
- if (s2 !== 0) {
7680
- var r2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
7681
- (o2 = this.local().add(u2 + r2, t)).$offset = u2, o2.$x.$localOffset = r2;
7682
- } else
7683
- o2 = this.utc();
7684
- return o2;
7681
+ return r2.$offset = u2, r2.$u = false, r2;
7682
+ var o2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
7683
+ return (r2 = this.local().add(u2 + o2, t)).$offset = u2, r2.$x.$localOffset = o2, r2;
7685
7684
  };
7686
7685
  var h = u.format;
7687
7686
  u.format = function(t2) {
@@ -8926,7 +8925,7 @@ var require_localforage = __commonJS((exports2, module2) => {
8926
8925
  executeCallback(promise, callback);
8927
8926
  return promise;
8928
8927
  }
8929
- function iterate(iterator, callback) {
8928
+ function iterate(iterator2, callback) {
8930
8929
  var self2 = this;
8931
8930
  var promise = new Promise$1(function(resolve, reject) {
8932
8931
  self2.ready().then(function() {
@@ -8945,7 +8944,7 @@ var require_localforage = __commonJS((exports2, module2) => {
8945
8944
  if (_isEncodedBlob(value)) {
8946
8945
  value = _decodeBlob(value);
8947
8946
  }
8948
- var result = iterator(value, cursor.key, iterationNumber++);
8947
+ var result = iterator2(value, cursor.key, iterationNumber++);
8949
8948
  if (result !== undefined) {
8950
8949
  resolve(result);
8951
8950
  } else {
@@ -9533,7 +9532,7 @@ var require_localforage = __commonJS((exports2, module2) => {
9533
9532
  executeCallback(promise, callback);
9534
9533
  return promise;
9535
9534
  }
9536
- function iterate$1(iterator, callback) {
9535
+ function iterate$1(iterator2, callback) {
9537
9536
  var self2 = this;
9538
9537
  var promise = new Promise$1(function(resolve, reject) {
9539
9538
  self2.ready().then(function() {
@@ -9548,7 +9547,7 @@ var require_localforage = __commonJS((exports2, module2) => {
9548
9547
  if (result) {
9549
9548
  result = dbInfo.serializer.deserialize(result);
9550
9549
  }
9551
- result = iterator(result, item.key, i + 1);
9550
+ result = iterator2(result, item.key, i + 1);
9552
9551
  if (result !== undefined) {
9553
9552
  resolve(result);
9554
9553
  return;
@@ -9858,7 +9857,7 @@ var require_localforage = __commonJS((exports2, module2) => {
9858
9857
  executeCallback(promise, callback);
9859
9858
  return promise;
9860
9859
  }
9861
- function iterate$2(iterator, callback) {
9860
+ function iterate$2(iterator2, callback) {
9862
9861
  var self2 = this;
9863
9862
  var promise = self2.ready().then(function() {
9864
9863
  var dbInfo = self2._dbInfo;
@@ -9875,7 +9874,7 @@ var require_localforage = __commonJS((exports2, module2) => {
9875
9874
  if (value) {
9876
9875
  value = dbInfo.serializer.deserialize(value);
9877
9876
  }
9878
- value = iterator(value, key2.substring(keyPrefixLength), iterationNumber++);
9877
+ value = iterator2(value, key2.substring(keyPrefixLength), iterationNumber++);
9879
9878
  if (value !== undefined) {
9880
9879
  return value;
9881
9880
  }
@@ -10292,7 +10291,7 @@ var require_localforage = __commonJS((exports2, module2) => {
10292
10291
  // src/browser.ts
10293
10292
  var exports_browser = {};
10294
10293
  __export(exports_browser, {
10295
- z: () => z,
10294
+ z: () => exports_external,
10296
10295
  watch: () => watch,
10297
10296
  void: () => voidType,
10298
10297
  util: () => util,
@@ -10389,7 +10388,7 @@ __export(exports_browser, {
10389
10388
  effect: () => effectsType,
10390
10389
  discriminatedUnion: () => discriminatedUnionType,
10391
10390
  delay: () => delay,
10392
- defaultErrorMap: () => errorMap,
10391
+ defaultErrorMap: () => en_default,
10393
10392
  dayjs: () => dayjs_default,
10394
10393
  datetimeRegex: () => datetimeRegex,
10395
10394
  date: () => dateType,
@@ -10480,6 +10479,7 @@ function bind(fn, thisArg) {
10480
10479
  // ../../node_modules/axios/lib/utils.js
10481
10480
  var { toString } = Object.prototype;
10482
10481
  var { getPrototypeOf } = Object;
10482
+ var { iterator, toStringTag } = Symbol;
10483
10483
  var kindOf = ((cache) => (thing) => {
10484
10484
  const str = toString.call(thing);
10485
10485
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -10514,7 +10514,17 @@ var isPlainObject = (val) => {
10514
10514
  return false;
10515
10515
  }
10516
10516
  const prototype = getPrototypeOf(val);
10517
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
10517
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
10518
+ };
10519
+ var isEmptyObject = (val) => {
10520
+ if (!isObject(val) || isBuffer(val)) {
10521
+ return false;
10522
+ }
10523
+ try {
10524
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
10525
+ } catch (e) {
10526
+ return false;
10527
+ }
10518
10528
  };
10519
10529
  var isDate = kindOfTest("Date");
10520
10530
  var isFile = kindOfTest("File");
@@ -10542,6 +10552,9 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
10542
10552
  fn.call(null, obj[i], i, obj);
10543
10553
  }
10544
10554
  } else {
10555
+ if (isBuffer(obj)) {
10556
+ return;
10557
+ }
10545
10558
  const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
10546
10559
  const len = keys.length;
10547
10560
  let key;
@@ -10552,6 +10565,9 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
10552
10565
  }
10553
10566
  }
10554
10567
  function findKey(obj, key) {
10568
+ if (isBuffer(obj)) {
10569
+ return null;
10570
+ }
10555
10571
  key = key.toLowerCase();
10556
10572
  const keys = Object.keys(obj);
10557
10573
  let i = keys.length;
@@ -10571,7 +10587,7 @@ var _global = (() => {
10571
10587
  })();
10572
10588
  var isContextDefined = (context) => !isUndefined(context) && context !== _global;
10573
10589
  function merge() {
10574
- const { caseless } = isContextDefined(this) && this || {};
10590
+ const { caseless, skipUndefined } = isContextDefined(this) && this || {};
10575
10591
  const result = {};
10576
10592
  const assignValue = (val, key) => {
10577
10593
  const targetKey = caseless && findKey(result, key) || key;
@@ -10581,7 +10597,7 @@ function merge() {
10581
10597
  result[targetKey] = merge({}, val);
10582
10598
  } else if (isArray(val)) {
10583
10599
  result[targetKey] = val.slice();
10584
- } else {
10600
+ } else if (!skipUndefined || !isUndefined(val)) {
10585
10601
  result[targetKey] = val;
10586
10602
  }
10587
10603
  };
@@ -10665,10 +10681,10 @@ var isTypedArray = ((TypedArray) => {
10665
10681
  };
10666
10682
  })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
10667
10683
  var forEachEntry = (obj, fn) => {
10668
- const generator = obj && obj[Symbol.iterator];
10669
- const iterator = generator.call(obj);
10684
+ const generator = obj && obj[iterator];
10685
+ const _iterator = generator.call(obj);
10670
10686
  let result;
10671
- while ((result = iterator.next()) && !result.done) {
10687
+ while ((result = _iterator.next()) && !result.done) {
10672
10688
  const pair = result.value;
10673
10689
  fn.call(obj, pair[0], pair[1]);
10674
10690
  }
@@ -10735,7 +10751,7 @@ var toFiniteNumber = (value, defaultValue) => {
10735
10751
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
10736
10752
  };
10737
10753
  function isSpecCompliantForm(thing) {
10738
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
10754
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
10739
10755
  }
10740
10756
  var toJSONObject = (obj) => {
10741
10757
  const stack = new Array(10);
@@ -10744,6 +10760,9 @@ var toJSONObject = (obj) => {
10744
10760
  if (stack.indexOf(source) >= 0) {
10745
10761
  return;
10746
10762
  }
10763
+ if (isBuffer(source)) {
10764
+ return source;
10765
+ }
10747
10766
  if (!("toJSON" in source)) {
10748
10767
  stack[i] = source;
10749
10768
  const target = isArray(source) ? [] : {};
@@ -10778,6 +10797,7 @@ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
10778
10797
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
10779
10798
  })(typeof setImmediate === "function", isFunction(_global.postMessage));
10780
10799
  var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
10800
+ var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
10781
10801
  var utils_default = {
10782
10802
  isArray,
10783
10803
  isArrayBuffer,
@@ -10789,6 +10809,7 @@ var utils_default = {
10789
10809
  isBoolean,
10790
10810
  isObject,
10791
10811
  isPlainObject,
10812
+ isEmptyObject,
10792
10813
  isReadableStream,
10793
10814
  isRequest,
10794
10815
  isResponse,
@@ -10833,7 +10854,8 @@ var utils_default = {
10833
10854
  isAsyncFn,
10834
10855
  isThenable,
10835
10856
  setImmediate: _setImmediate,
10836
- asap
10857
+ asap,
10858
+ isIterable
10837
10859
  };
10838
10860
 
10839
10861
  // ../../node_modules/axios/lib/core/AxiosError.js
@@ -10898,9 +10920,13 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
10898
10920
  }, (prop) => {
10899
10921
  return prop !== "isAxiosError";
10900
10922
  });
10901
- AxiosError.call(axiosError, error.message, code, config, request, response);
10902
- axiosError.cause = error;
10903
- axiosError.name = error.name;
10923
+ const msg = error && error.message ? error.message : "Error";
10924
+ const errCode = code == null && error ? error.code : code;
10925
+ AxiosError.call(axiosError, msg, errCode, config, request, response);
10926
+ if (error && axiosError.cause == null) {
10927
+ Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
10928
+ }
10929
+ axiosError.name = error && error.name || "Error";
10904
10930
  customProps && Object.assign(axiosError, customProps);
10905
10931
  return axiosError;
10906
10932
  };
@@ -10957,6 +10983,9 @@ function toFormData(obj, formData, options) {
10957
10983
  if (utils_default.isDate(value)) {
10958
10984
  return value.toISOString();
10959
10985
  }
10986
+ if (utils_default.isBoolean(value)) {
10987
+ return value.toString();
10988
+ }
10960
10989
  if (!useBlob && utils_default.isBlob(value)) {
10961
10990
  throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
10962
10991
  }
@@ -11049,7 +11078,7 @@ var AxiosURLSearchParams_default = AxiosURLSearchParams;
11049
11078
 
11050
11079
  // ../../node_modules/axios/lib/helpers/buildURL.js
11051
11080
  function encode2(val) {
11052
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
11081
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
11053
11082
  }
11054
11083
  function buildURL(url, params, options) {
11055
11084
  if (!params) {
@@ -11164,15 +11193,16 @@ var platform_default = {
11164
11193
 
11165
11194
  // ../../node_modules/axios/lib/helpers/toURLEncodedForm.js
11166
11195
  function toURLEncodedForm(data, options) {
11167
- return toFormData_default(data, new platform_default.classes.URLSearchParams, Object.assign({
11196
+ return toFormData_default(data, new platform_default.classes.URLSearchParams, {
11168
11197
  visitor: function(value, key, path, helpers) {
11169
11198
  if (platform_default.isNode && utils_default.isBuffer(value)) {
11170
11199
  this.append(key, value.toString("base64"));
11171
11200
  return false;
11172
11201
  }
11173
11202
  return helpers.defaultVisitor.apply(this, arguments);
11174
- }
11175
- }, options));
11203
+ },
11204
+ ...options
11205
+ });
11176
11206
  }
11177
11207
 
11178
11208
  // ../../node_modules/axios/lib/helpers/formDataToJSON.js
@@ -11294,7 +11324,7 @@ var defaults = {
11294
11324
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
11295
11325
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
11296
11326
  try {
11297
- return JSON.parse(data);
11327
+ return JSON.parse(data, this.parseReviver);
11298
11328
  } catch (e) {
11299
11329
  if (strictJSONParsing) {
11300
11330
  if (e.name === "SyntaxError") {
@@ -11451,10 +11481,15 @@ class AxiosHeaders {
11451
11481
  setHeaders(header, valueOrRewrite);
11452
11482
  } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
11453
11483
  setHeaders(parseHeaders_default(header), valueOrRewrite);
11454
- } else if (utils_default.isHeaders(header)) {
11455
- for (const [key, value] of header.entries()) {
11456
- setHeader(value, key, rewrite);
11484
+ } else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
11485
+ let obj = {}, dest, key;
11486
+ for (const entry of header) {
11487
+ if (!utils_default.isArray(entry)) {
11488
+ throw TypeError("Object iterator must return a key-value pair");
11489
+ }
11490
+ obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
11457
11491
  }
11492
+ setHeaders(obj, valueOrRewrite);
11458
11493
  } else {
11459
11494
  header != null && setHeader(valueOrRewrite, header, rewrite);
11460
11495
  }
@@ -11559,6 +11594,9 @@ class AxiosHeaders {
11559
11594
  return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join(`
11560
11595
  `);
11561
11596
  }
11597
+ getSetCookie() {
11598
+ return this.get("set-cookie") || [];
11599
+ }
11562
11600
  get [Symbol.toStringTag]() {
11563
11601
  return "AxiosHeaders";
11564
11602
  }
@@ -11693,7 +11731,7 @@ function throttle(fn, freq) {
11693
11731
  clearTimeout(timer);
11694
11732
  timer = null;
11695
11733
  }
11696
- fn.apply(null, args);
11734
+ fn(...args);
11697
11735
  };
11698
11736
  const throttled = (...args) => {
11699
11737
  const now = Date.now();
@@ -11794,7 +11832,7 @@ function combineURLs(baseURL, relativeURL) {
11794
11832
  // ../../node_modules/axios/lib/core/buildFullPath.js
11795
11833
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
11796
11834
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
11797
- if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
11835
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
11798
11836
  return combineURLs(baseURL, requestedURL);
11799
11837
  }
11800
11838
  return requestedURL;
@@ -11872,7 +11910,7 @@ function mergeConfig(config1, config2) {
11872
11910
  validateStatus: mergeDirectKeys,
11873
11911
  headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
11874
11912
  };
11875
- utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
11913
+ utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
11876
11914
  const merge2 = mergeMap[prop] || mergeDeepProperties;
11877
11915
  const configValue = merge2(config1[prop], config2[prop], prop);
11878
11916
  utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
@@ -11889,13 +11927,17 @@ var resolveConfig_default = (config) => {
11889
11927
  if (auth) {
11890
11928
  headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
11891
11929
  }
11892
- let contentType;
11893
11930
  if (utils_default.isFormData(data)) {
11894
11931
  if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
11895
11932
  headers.setContentType(undefined);
11896
- } else if ((contentType = headers.getContentType()) !== false) {
11897
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
11898
- headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
11933
+ } else if (utils_default.isFunction(data.getHeaders)) {
11934
+ const formHeaders = data.getHeaders();
11935
+ const allowedHeaders = ["content-type", "content-length"];
11936
+ Object.entries(formHeaders).forEach(([key, val]) => {
11937
+ if (allowedHeaders.includes(key.toLowerCase())) {
11938
+ headers.set(key, val);
11939
+ }
11940
+ });
11899
11941
  }
11900
11942
  }
11901
11943
  if (platform_default.hasStandardBrowserEnv) {
@@ -11973,8 +12015,11 @@ var xhr_default = isXHRAdapterSupported && function(config) {
11973
12015
  reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
11974
12016
  request = null;
11975
12017
  };
11976
- request.onerror = function handleError() {
11977
- reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request));
12018
+ request.onerror = function handleError(event) {
12019
+ const msg = event && event.message ? event.message : "Network Error";
12020
+ const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
12021
+ err.event = event || null;
12022
+ reject(err);
11978
12023
  request = null;
11979
12024
  };
11980
12025
  request.ontimeout = function handleTimeout() {
@@ -12105,7 +12150,7 @@ var readStream = async function* (stream) {
12105
12150
  }
12106
12151
  };
12107
12152
  var trackStream = (stream, chunkSize, onProgress, onFinish) => {
12108
- const iterator = readBytes(stream, chunkSize);
12153
+ const iterator2 = readBytes(stream, chunkSize);
12109
12154
  let bytes = 0;
12110
12155
  let done;
12111
12156
  let _onFinish = (e) => {
@@ -12117,7 +12162,7 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
12117
12162
  return new ReadableStream({
12118
12163
  async pull(controller) {
12119
12164
  try {
12120
- const { done: done2, value } = await iterator.next();
12165
+ const { done: done2, value } = await iterator2.next();
12121
12166
  if (done2) {
12122
12167
  _onFinish();
12123
12168
  controller.close();
@@ -12136,7 +12181,7 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
12136
12181
  },
12137
12182
  cancel(reason) {
12138
12183
  _onFinish(reason);
12139
- return iterator.return();
12184
+ return iterator2.return();
12140
12185
  }
12141
12186
  }, {
12142
12187
  highWaterMark: 2
@@ -12144,9 +12189,16 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
12144
12189
  };
12145
12190
 
12146
12191
  // ../../node_modules/axios/lib/adapters/fetch.js
12147
- var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
12148
- var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
12149
- var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
12192
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
12193
+ var { isFunction: isFunction2 } = utils_default;
12194
+ var globalFetchAPI = (({ Request, Response }) => ({
12195
+ Request,
12196
+ Response
12197
+ }))(utils_default.global);
12198
+ var {
12199
+ ReadableStream: ReadableStream2,
12200
+ TextEncoder
12201
+ } = utils_default.global;
12150
12202
  var test = (fn, ...args) => {
12151
12203
  try {
12152
12204
  return !!fn(...args);
@@ -12154,152 +12206,192 @@ var test = (fn, ...args) => {
12154
12206
  return false;
12155
12207
  }
12156
12208
  };
12157
- var supportsRequestStream = isReadableStreamSupported && test(() => {
12158
- let duplexAccessed = false;
12159
- const hasContentType = new Request(platform_default.origin, {
12160
- body: new ReadableStream,
12161
- method: "POST",
12162
- get duplex() {
12163
- duplexAccessed = true;
12164
- return "half";
12165
- }
12166
- }).headers.has("Content-Type");
12167
- return duplexAccessed && !hasContentType;
12168
- });
12169
- var DEFAULT_CHUNK_SIZE = 64 * 1024;
12170
- var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
12171
- var resolvers = {
12172
- stream: supportsResponseStream && ((res) => res.body)
12173
- };
12174
- isFetchSupported && ((res) => {
12175
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
12176
- !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
12177
- throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
12178
- });
12179
- });
12180
- })(new Response);
12181
- var getBodyLength = async (body) => {
12182
- if (body == null) {
12183
- return 0;
12184
- }
12185
- if (utils_default.isBlob(body)) {
12186
- return body.size;
12209
+ var factory = (env) => {
12210
+ env = utils_default.merge.call({
12211
+ skipUndefined: true
12212
+ }, globalFetchAPI, env);
12213
+ const { fetch: envFetch, Request, Response } = env;
12214
+ const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
12215
+ const isRequestSupported = isFunction2(Request);
12216
+ const isResponseSupported = isFunction2(Response);
12217
+ if (!isFetchSupported) {
12218
+ return false;
12187
12219
  }
12188
- if (utils_default.isSpecCompliantForm(body)) {
12189
- const _request = new Request(platform_default.origin, {
12220
+ const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
12221
+ const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
12222
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
12223
+ let duplexAccessed = false;
12224
+ const hasContentType = new Request(platform_default.origin, {
12225
+ body: new ReadableStream2,
12190
12226
  method: "POST",
12191
- body
12192
- });
12193
- return (await _request.arrayBuffer()).byteLength;
12194
- }
12195
- if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
12196
- return body.byteLength;
12197
- }
12198
- if (utils_default.isURLSearchParams(body)) {
12199
- body = body + "";
12200
- }
12201
- if (utils_default.isString(body)) {
12202
- return (await encodeText(body)).byteLength;
12203
- }
12204
- };
12205
- var resolveBodyLength = async (headers, body) => {
12206
- const length = utils_default.toFiniteNumber(headers.getContentLength());
12207
- return length == null ? getBodyLength(body) : length;
12208
- };
12209
- var fetch_default = isFetchSupported && (async (config) => {
12210
- let {
12211
- url,
12212
- method,
12213
- data,
12214
- signal,
12215
- cancelToken,
12216
- timeout,
12217
- onDownloadProgress,
12218
- onUploadProgress,
12219
- responseType,
12220
- headers,
12221
- withCredentials = "same-origin",
12222
- fetchOptions
12223
- } = resolveConfig_default(config);
12224
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
12225
- let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
12226
- let request;
12227
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
12228
- composedSignal.unsubscribe();
12227
+ get duplex() {
12228
+ duplexAccessed = true;
12229
+ return "half";
12230
+ }
12231
+ }).headers.has("Content-Type");
12232
+ return duplexAccessed && !hasContentType;
12229
12233
  });
12230
- let requestContentLength;
12231
- try {
12232
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
12233
- let _request = new Request(url, {
12234
- method: "POST",
12235
- body: data,
12236
- duplex: "half"
12234
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
12235
+ const resolvers = {
12236
+ stream: supportsResponseStream && ((res) => res.body)
12237
+ };
12238
+ isFetchSupported && (() => {
12239
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
12240
+ !resolvers[type] && (resolvers[type] = (res, config) => {
12241
+ let method = res && res[type];
12242
+ if (method) {
12243
+ return method.call(res);
12244
+ }
12245
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
12237
12246
  });
12238
- let contentTypeHeader;
12239
- if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
12240
- headers.setContentType(contentTypeHeader);
12241
- }
12242
- if (_request.body) {
12243
- const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
12244
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
12245
- }
12246
- }
12247
- if (!utils_default.isString(withCredentials)) {
12248
- withCredentials = withCredentials ? "include" : "omit";
12249
- }
12250
- const isCredentialsSupported = "credentials" in Request.prototype;
12251
- request = new Request(url, {
12252
- ...fetchOptions,
12253
- signal: composedSignal,
12254
- method: method.toUpperCase(),
12255
- headers: headers.normalize().toJSON(),
12256
- body: data,
12257
- duplex: "half",
12258
- credentials: isCredentialsSupported ? withCredentials : undefined
12259
12247
  });
12260
- let response = await fetch(request);
12261
- const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
12262
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
12263
- const options = {};
12264
- ["status", "statusText", "headers"].forEach((prop) => {
12265
- options[prop] = response[prop];
12266
- });
12267
- const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
12268
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
12269
- response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
12270
- flush && flush();
12271
- unsubscribe && unsubscribe();
12272
- }), options);
12273
- }
12274
- responseType = responseType || "text";
12275
- let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
12276
- !isStreamResponse && unsubscribe && unsubscribe();
12277
- return await new Promise((resolve, reject) => {
12278
- settle(resolve, reject, {
12279
- data: responseData,
12280
- headers: AxiosHeaders_default.from(response.headers),
12281
- status: response.status,
12282
- statusText: response.statusText,
12283
- config,
12284
- request
12248
+ })();
12249
+ const getBodyLength = async (body) => {
12250
+ if (body == null) {
12251
+ return 0;
12252
+ }
12253
+ if (utils_default.isBlob(body)) {
12254
+ return body.size;
12255
+ }
12256
+ if (utils_default.isSpecCompliantForm(body)) {
12257
+ const _request = new Request(platform_default.origin, {
12258
+ method: "POST",
12259
+ body
12285
12260
  });
12261
+ return (await _request.arrayBuffer()).byteLength;
12262
+ }
12263
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
12264
+ return body.byteLength;
12265
+ }
12266
+ if (utils_default.isURLSearchParams(body)) {
12267
+ body = body + "";
12268
+ }
12269
+ if (utils_default.isString(body)) {
12270
+ return (await encodeText(body)).byteLength;
12271
+ }
12272
+ };
12273
+ const resolveBodyLength = async (headers, body) => {
12274
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
12275
+ return length == null ? getBodyLength(body) : length;
12276
+ };
12277
+ return async (config) => {
12278
+ let {
12279
+ url,
12280
+ method,
12281
+ data,
12282
+ signal,
12283
+ cancelToken,
12284
+ timeout,
12285
+ onDownloadProgress,
12286
+ onUploadProgress,
12287
+ responseType,
12288
+ headers,
12289
+ withCredentials = "same-origin",
12290
+ fetchOptions
12291
+ } = resolveConfig_default(config);
12292
+ let _fetch = envFetch || fetch;
12293
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
12294
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
12295
+ let request = null;
12296
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
12297
+ composedSignal.unsubscribe();
12286
12298
  });
12287
- } catch (err) {
12288
- unsubscribe && unsubscribe();
12289
- if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
12290
- throw Object.assign(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request), {
12291
- cause: err.cause || err
12299
+ let requestContentLength;
12300
+ try {
12301
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
12302
+ let _request = new Request(url, {
12303
+ method: "POST",
12304
+ body: data,
12305
+ duplex: "half"
12306
+ });
12307
+ let contentTypeHeader;
12308
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
12309
+ headers.setContentType(contentTypeHeader);
12310
+ }
12311
+ if (_request.body) {
12312
+ const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
12313
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
12314
+ }
12315
+ }
12316
+ if (!utils_default.isString(withCredentials)) {
12317
+ withCredentials = withCredentials ? "include" : "omit";
12318
+ }
12319
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
12320
+ const resolvedOptions = {
12321
+ ...fetchOptions,
12322
+ signal: composedSignal,
12323
+ method: method.toUpperCase(),
12324
+ headers: headers.normalize().toJSON(),
12325
+ body: data,
12326
+ duplex: "half",
12327
+ credentials: isCredentialsSupported ? withCredentials : undefined
12328
+ };
12329
+ request = isRequestSupported && new Request(url, resolvedOptions);
12330
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
12331
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
12332
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
12333
+ const options = {};
12334
+ ["status", "statusText", "headers"].forEach((prop) => {
12335
+ options[prop] = response[prop];
12336
+ });
12337
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
12338
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
12339
+ response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
12340
+ flush && flush();
12341
+ unsubscribe && unsubscribe();
12342
+ }), options);
12343
+ }
12344
+ responseType = responseType || "text";
12345
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
12346
+ !isStreamResponse && unsubscribe && unsubscribe();
12347
+ return await new Promise((resolve, reject) => {
12348
+ settle(resolve, reject, {
12349
+ data: responseData,
12350
+ headers: AxiosHeaders_default.from(response.headers),
12351
+ status: response.status,
12352
+ statusText: response.statusText,
12353
+ config,
12354
+ request
12355
+ });
12292
12356
  });
12357
+ } catch (err) {
12358
+ unsubscribe && unsubscribe();
12359
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
12360
+ throw Object.assign(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request), {
12361
+ cause: err.cause || err
12362
+ });
12363
+ }
12364
+ throw AxiosError_default.from(err, err && err.code, config, request);
12293
12365
  }
12294
- throw AxiosError_default.from(err, err && err.code, config, request);
12295
- }
12296
- });
12366
+ };
12367
+ };
12368
+ var seedCache = new Map;
12369
+ var getFetch = (config) => {
12370
+ let env = config ? config.env : {};
12371
+ const { fetch: fetch2, Request, Response } = env;
12372
+ const seeds = [
12373
+ Request,
12374
+ Response,
12375
+ fetch2
12376
+ ];
12377
+ let len = seeds.length, i = len, seed, target, map = seedCache;
12378
+ while (i--) {
12379
+ seed = seeds[i];
12380
+ target = map.get(seed);
12381
+ target === undefined && map.set(seed, target = i ? new Map : factory(env));
12382
+ map = target;
12383
+ }
12384
+ return target;
12385
+ };
12386
+ var adapter = getFetch();
12297
12387
 
12298
12388
  // ../../node_modules/axios/lib/adapters/adapters.js
12299
12389
  var knownAdapters = {
12300
12390
  http: null_default,
12301
12391
  xhr: xhr_default,
12302
- fetch: fetch_default
12392
+ fetch: {
12393
+ get: getFetch
12394
+ }
12303
12395
  };
12304
12396
  utils_default.forEach(knownAdapters, (fn, value) => {
12305
12397
  if (fn) {
@@ -12310,37 +12402,37 @@ utils_default.forEach(knownAdapters, (fn, value) => {
12310
12402
  }
12311
12403
  });
12312
12404
  var renderReason = (reason) => `- ${reason}`;
12313
- var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false;
12405
+ var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
12314
12406
  var adapters_default = {
12315
- getAdapter: (adapters) => {
12407
+ getAdapter: (adapters, config) => {
12316
12408
  adapters = utils_default.isArray(adapters) ? adapters : [adapters];
12317
12409
  const { length } = adapters;
12318
12410
  let nameOrAdapter;
12319
- let adapter;
12411
+ let adapter2;
12320
12412
  const rejectedReasons = {};
12321
12413
  for (let i = 0;i < length; i++) {
12322
12414
  nameOrAdapter = adapters[i];
12323
12415
  let id;
12324
- adapter = nameOrAdapter;
12416
+ adapter2 = nameOrAdapter;
12325
12417
  if (!isResolvedHandle(nameOrAdapter)) {
12326
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
12327
- if (adapter === undefined) {
12418
+ adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
12419
+ if (adapter2 === undefined) {
12328
12420
  throw new AxiosError_default(`Unknown adapter '${id}'`);
12329
12421
  }
12330
12422
  }
12331
- if (adapter) {
12423
+ if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
12332
12424
  break;
12333
12425
  }
12334
- rejectedReasons[id || "#" + i] = adapter;
12426
+ rejectedReasons[id || "#" + i] = adapter2;
12335
12427
  }
12336
- if (!adapter) {
12428
+ if (!adapter2) {
12337
12429
  const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
12338
12430
  let s = length ? reasons.length > 1 ? `since :
12339
12431
  ` + reasons.map(renderReason).join(`
12340
12432
  `) : " " + renderReason(reasons[0]) : "as no adapter specified";
12341
12433
  throw new AxiosError_default(`There is no suitable adapter to dispatch the request ` + s, "ERR_NOT_SUPPORT");
12342
12434
  }
12343
- return adapter;
12435
+ return adapter2;
12344
12436
  },
12345
12437
  adapters: knownAdapters
12346
12438
  };
@@ -12361,8 +12453,8 @@ function dispatchRequest(config) {
12361
12453
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
12362
12454
  config.headers.setContentType("application/x-www-form-urlencoded", false);
12363
12455
  }
12364
- const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter);
12365
- return adapter(config).then(function onAdapterResolution(response) {
12456
+ const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
12457
+ return adapter2(config).then(function onAdapterResolution(response) {
12366
12458
  throwIfCancellationRequested(config);
12367
12459
  response.data = transformData.call(config, config.transformResponse, response);
12368
12460
  response.headers = AxiosHeaders_default.from(response.headers);
@@ -12380,7 +12472,7 @@ function dispatchRequest(config) {
12380
12472
  }
12381
12473
 
12382
12474
  // ../../node_modules/axios/lib/env/data.js
12383
- var VERSION = "1.8.3";
12475
+ var VERSION = "1.12.2";
12384
12476
 
12385
12477
  // ../../node_modules/axios/lib/helpers/validator.js
12386
12478
  var validators = {};
@@ -12443,7 +12535,7 @@ var validators2 = validator_default.validators;
12443
12535
 
12444
12536
  class Axios {
12445
12537
  constructor(instanceConfig) {
12446
- this.defaults = instanceConfig;
12538
+ this.defaults = instanceConfig || {};
12447
12539
  this.interceptors = {
12448
12540
  request: new InterceptorManager_default,
12449
12541
  response: new InterceptorManager_default
@@ -12530,8 +12622,8 @@ class Axios {
12530
12622
  let len;
12531
12623
  if (!synchronousRequestInterceptors) {
12532
12624
  const chain = [dispatchRequest.bind(this), undefined];
12533
- chain.unshift.apply(chain, requestInterceptorChain);
12534
- chain.push.apply(chain, responseInterceptorChain);
12625
+ chain.unshift(...requestInterceptorChain);
12626
+ chain.push(...responseInterceptorChain);
12535
12627
  len = chain.length;
12536
12628
  promise = Promise.resolve(config);
12537
12629
  while (i < len) {
@@ -12541,7 +12633,6 @@ class Axios {
12541
12633
  }
12542
12634
  len = requestInterceptorChain.length;
12543
12635
  let newConfig = config;
12544
- i = 0;
12545
12636
  while (i < len) {
12546
12637
  const onFulfilled = requestInterceptorChain[i++];
12547
12638
  const onRejected = requestInterceptorChain[i++];
@@ -12803,10 +12894,122 @@ var axios_default = axios;
12803
12894
  var import_json5 = __toESM(require_dist());
12804
12895
  var import_consola = __toESM(require_consola_browser());
12805
12896
 
12806
- // ../../node_modules/zod/lib/index.mjs
12897
+ // ../../node_modules/zod/v3/external.js
12898
+ var exports_external = {};
12899
+ __export(exports_external, {
12900
+ void: () => voidType,
12901
+ util: () => util,
12902
+ unknown: () => unknownType,
12903
+ union: () => unionType,
12904
+ undefined: () => undefinedType,
12905
+ tuple: () => tupleType,
12906
+ transformer: () => effectsType,
12907
+ symbol: () => symbolType,
12908
+ string: () => stringType,
12909
+ strictObject: () => strictObjectType,
12910
+ setErrorMap: () => setErrorMap,
12911
+ set: () => setType,
12912
+ record: () => recordType,
12913
+ quotelessJson: () => quotelessJson,
12914
+ promise: () => promiseType,
12915
+ preprocess: () => preprocessType,
12916
+ pipeline: () => pipelineType,
12917
+ ostring: () => ostring,
12918
+ optional: () => optionalType,
12919
+ onumber: () => onumber,
12920
+ oboolean: () => oboolean,
12921
+ objectUtil: () => objectUtil,
12922
+ object: () => objectType,
12923
+ number: () => numberType,
12924
+ nullable: () => nullableType,
12925
+ null: () => nullType,
12926
+ never: () => neverType,
12927
+ nativeEnum: () => nativeEnumType,
12928
+ nan: () => nanType,
12929
+ map: () => mapType,
12930
+ makeIssue: () => makeIssue,
12931
+ literal: () => literalType,
12932
+ lazy: () => lazyType,
12933
+ late: () => late,
12934
+ isValid: () => isValid,
12935
+ isDirty: () => isDirty,
12936
+ isAsync: () => isAsync,
12937
+ isAborted: () => isAborted,
12938
+ intersection: () => intersectionType,
12939
+ instanceof: () => instanceOfType,
12940
+ getParsedType: () => getParsedType,
12941
+ getErrorMap: () => getErrorMap,
12942
+ function: () => functionType,
12943
+ enum: () => enumType,
12944
+ effect: () => effectsType,
12945
+ discriminatedUnion: () => discriminatedUnionType,
12946
+ defaultErrorMap: () => en_default,
12947
+ datetimeRegex: () => datetimeRegex,
12948
+ date: () => dateType,
12949
+ custom: () => custom,
12950
+ coerce: () => coerce,
12951
+ boolean: () => booleanType,
12952
+ bigint: () => bigIntType,
12953
+ array: () => arrayType,
12954
+ any: () => anyType,
12955
+ addIssueToContext: () => addIssueToContext,
12956
+ ZodVoid: () => ZodVoid,
12957
+ ZodUnknown: () => ZodUnknown,
12958
+ ZodUnion: () => ZodUnion,
12959
+ ZodUndefined: () => ZodUndefined,
12960
+ ZodType: () => ZodType,
12961
+ ZodTuple: () => ZodTuple,
12962
+ ZodTransformer: () => ZodEffects,
12963
+ ZodSymbol: () => ZodSymbol,
12964
+ ZodString: () => ZodString,
12965
+ ZodSet: () => ZodSet,
12966
+ ZodSchema: () => ZodType,
12967
+ ZodRecord: () => ZodRecord,
12968
+ ZodReadonly: () => ZodReadonly,
12969
+ ZodPromise: () => ZodPromise,
12970
+ ZodPipeline: () => ZodPipeline,
12971
+ ZodParsedType: () => ZodParsedType,
12972
+ ZodOptional: () => ZodOptional,
12973
+ ZodObject: () => ZodObject,
12974
+ ZodNumber: () => ZodNumber,
12975
+ ZodNullable: () => ZodNullable,
12976
+ ZodNull: () => ZodNull,
12977
+ ZodNever: () => ZodNever,
12978
+ ZodNativeEnum: () => ZodNativeEnum,
12979
+ ZodNaN: () => ZodNaN,
12980
+ ZodMap: () => ZodMap,
12981
+ ZodLiteral: () => ZodLiteral,
12982
+ ZodLazy: () => ZodLazy,
12983
+ ZodIssueCode: () => ZodIssueCode,
12984
+ ZodIntersection: () => ZodIntersection,
12985
+ ZodFunction: () => ZodFunction,
12986
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
12987
+ ZodError: () => ZodError,
12988
+ ZodEnum: () => ZodEnum,
12989
+ ZodEffects: () => ZodEffects,
12990
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
12991
+ ZodDefault: () => ZodDefault,
12992
+ ZodDate: () => ZodDate,
12993
+ ZodCatch: () => ZodCatch,
12994
+ ZodBranded: () => ZodBranded,
12995
+ ZodBoolean: () => ZodBoolean,
12996
+ ZodBigInt: () => ZodBigInt,
12997
+ ZodArray: () => ZodArray,
12998
+ ZodAny: () => ZodAny,
12999
+ Schema: () => ZodType,
13000
+ ParseStatus: () => ParseStatus,
13001
+ OK: () => OK,
13002
+ NEVER: () => NEVER,
13003
+ INVALID: () => INVALID,
13004
+ EMPTY_PATH: () => EMPTY_PATH,
13005
+ DIRTY: () => DIRTY,
13006
+ BRAND: () => BRAND
13007
+ });
13008
+
13009
+ // ../../node_modules/zod/v3/helpers/util.js
12807
13010
  var util;
12808
13011
  (function(util2) {
12809
- util2.assertEqual = (val) => val;
13012
+ util2.assertEqual = (_) => {};
12810
13013
  function assertIs(_arg) {}
12811
13014
  util2.assertIs = assertIs;
12812
13015
  function assertNever(_x) {
@@ -12849,7 +13052,7 @@ var util;
12849
13052
  }
12850
13053
  return;
12851
13054
  };
12852
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
13055
+ util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
12853
13056
  function joinValues(array, separator = " | ") {
12854
13057
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
12855
13058
  }
@@ -12900,7 +13103,7 @@ var getParsedType = (data) => {
12900
13103
  case "string":
12901
13104
  return ZodParsedType.string;
12902
13105
  case "number":
12903
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
13106
+ return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
12904
13107
  case "boolean":
12905
13108
  return ZodParsedType.boolean;
12906
13109
  case "function":
@@ -12933,6 +13136,8 @@ var getParsedType = (data) => {
12933
13136
  return ZodParsedType.unknown;
12934
13137
  }
12935
13138
  };
13139
+
13140
+ // ../../node_modules/zod/v3/ZodError.js
12936
13141
  var ZodIssueCode = util.arrayToEnum([
12937
13142
  "invalid_type",
12938
13143
  "invalid_literal",
@@ -13033,8 +13238,9 @@ class ZodError extends Error {
13033
13238
  const formErrors = [];
13034
13239
  for (const sub of this.issues) {
13035
13240
  if (sub.path.length > 0) {
13036
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
13037
- fieldErrors[sub.path[0]].push(mapper(sub));
13241
+ const firstEl = sub.path[0];
13242
+ fieldErrors[firstEl] = fieldErrors[firstEl] || [];
13243
+ fieldErrors[firstEl].push(mapper(sub));
13038
13244
  } else {
13039
13245
  formErrors.push(mapper(sub));
13040
13246
  }
@@ -13049,6 +13255,8 @@ ZodError.create = (issues) => {
13049
13255
  const error = new ZodError(issues);
13050
13256
  return error;
13051
13257
  };
13258
+
13259
+ // ../../node_modules/zod/v3/locales/en.js
13052
13260
  var errorMap = (issue, _ctx) => {
13053
13261
  let message;
13054
13262
  switch (issue.code) {
@@ -13110,6 +13318,8 @@ var errorMap = (issue, _ctx) => {
13110
13318
  message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
13111
13319
  else if (issue.type === "number")
13112
13320
  message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
13321
+ else if (issue.type === "bigint")
13322
+ message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
13113
13323
  else if (issue.type === "date")
13114
13324
  message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
13115
13325
  else
@@ -13147,13 +13357,17 @@ var errorMap = (issue, _ctx) => {
13147
13357
  }
13148
13358
  return { message };
13149
13359
  };
13150
- var overrideErrorMap = errorMap;
13360
+ var en_default = errorMap;
13361
+
13362
+ // ../../node_modules/zod/v3/errors.js
13363
+ var overrideErrorMap = en_default;
13151
13364
  function setErrorMap(map) {
13152
13365
  overrideErrorMap = map;
13153
13366
  }
13154
13367
  function getErrorMap() {
13155
13368
  return overrideErrorMap;
13156
13369
  }
13370
+ // ../../node_modules/zod/v3/helpers/parseUtil.js
13157
13371
  var makeIssue = (params) => {
13158
13372
  const { data, path, errorMaps, issueData } = params;
13159
13373
  const fullPath = [...path, ...issueData.path || []];
@@ -13190,7 +13404,7 @@ function addIssueToContext(ctx, issueData) {
13190
13404
  ctx.common.contextualErrorMap,
13191
13405
  ctx.schemaErrorMap,
13192
13406
  overrideMap,
13193
- overrideMap === errorMap ? undefined : errorMap
13407
+ overrideMap === en_default ? undefined : en_default
13194
13408
  ].filter((x) => !!x)
13195
13409
  });
13196
13410
  ctx.common.issues.push(issue);
@@ -13259,30 +13473,14 @@ var isAborted = (x) => x.status === "aborted";
13259
13473
  var isDirty = (x) => x.status === "dirty";
13260
13474
  var isValid = (x) => x.status === "valid";
13261
13475
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
13262
- function __classPrivateFieldGet(receiver, state, kind, f) {
13263
- if (kind === "a" && !f)
13264
- throw new TypeError("Private accessor was defined without a getter");
13265
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
13266
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
13267
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13268
- }
13269
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
13270
- if (kind === "m")
13271
- throw new TypeError("Private method is not writable");
13272
- if (kind === "a" && !f)
13273
- throw new TypeError("Private accessor was defined without a setter");
13274
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
13275
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
13276
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
13277
- }
13476
+ // ../../node_modules/zod/v3/helpers/errorUtil.js
13278
13477
  var errorUtil;
13279
13478
  (function(errorUtil2) {
13280
13479
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
13281
- errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === undefined ? undefined : message.message;
13480
+ errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
13282
13481
  })(errorUtil || (errorUtil = {}));
13283
- var _ZodEnum_cache;
13284
- var _ZodNativeEnum_cache;
13285
13482
 
13483
+ // ../../node_modules/zod/v3/types.js
13286
13484
  class ParseInputLazyPath {
13287
13485
  constructor(parent, value, path, key) {
13288
13486
  this._cachedPath = [];
@@ -13293,7 +13491,7 @@ class ParseInputLazyPath {
13293
13491
  }
13294
13492
  get path() {
13295
13493
  if (!this._cachedPath.length) {
13296
- if (this._key instanceof Array) {
13494
+ if (Array.isArray(this._key)) {
13297
13495
  this._cachedPath.push(...this._path, ...this._key);
13298
13496
  } else {
13299
13497
  this._cachedPath.push(...this._path, this._key);
@@ -13331,17 +13529,16 @@ function processCreateParams(params) {
13331
13529
  if (errorMap2)
13332
13530
  return { errorMap: errorMap2, description };
13333
13531
  const customMap = (iss, ctx) => {
13334
- var _a, _b;
13335
13532
  const { message } = params;
13336
13533
  if (iss.code === "invalid_enum_value") {
13337
- return { message: message !== null && message !== undefined ? message : ctx.defaultError };
13534
+ return { message: message ?? ctx.defaultError };
13338
13535
  }
13339
13536
  if (typeof ctx.data === "undefined") {
13340
- return { message: (_a = message !== null && message !== undefined ? message : required_error) !== null && _a !== undefined ? _a : ctx.defaultError };
13537
+ return { message: message ?? required_error ?? ctx.defaultError };
13341
13538
  }
13342
13539
  if (iss.code !== "invalid_type")
13343
13540
  return { message: ctx.defaultError };
13344
- return { message: (_b = message !== null && message !== undefined ? message : invalid_type_error) !== null && _b !== undefined ? _b : ctx.defaultError };
13541
+ return { message: message ?? invalid_type_error ?? ctx.defaultError };
13345
13542
  };
13346
13543
  return { errorMap: customMap, description };
13347
13544
  }
@@ -13394,14 +13591,13 @@ class ZodType {
13394
13591
  throw result.error;
13395
13592
  }
13396
13593
  safeParse(data, params) {
13397
- var _a;
13398
13594
  const ctx = {
13399
13595
  common: {
13400
13596
  issues: [],
13401
- async: (_a = params === null || params === undefined ? undefined : params.async) !== null && _a !== undefined ? _a : false,
13402
- contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap
13597
+ async: params?.async ?? false,
13598
+ contextualErrorMap: params?.errorMap
13403
13599
  },
13404
- path: (params === null || params === undefined ? undefined : params.path) || [],
13600
+ path: params?.path || [],
13405
13601
  schemaErrorMap: this._def.errorMap,
13406
13602
  parent: null,
13407
13603
  data,
@@ -13411,7 +13607,6 @@ class ZodType {
13411
13607
  return handleResult(ctx, result);
13412
13608
  }
13413
13609
  "~validate"(data) {
13414
- var _a, _b;
13415
13610
  const ctx = {
13416
13611
  common: {
13417
13612
  issues: [],
@@ -13432,7 +13627,7 @@ class ZodType {
13432
13627
  issues: ctx.common.issues
13433
13628
  };
13434
13629
  } catch (err) {
13435
- if ((_b = (_a = err === null || err === undefined ? undefined : err.message) === null || _a === undefined ? undefined : _a.toLowerCase()) === null || _b === undefined ? undefined : _b.includes("encountered")) {
13630
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
13436
13631
  this["~standard"].async = true;
13437
13632
  }
13438
13633
  ctx.common = {
@@ -13457,10 +13652,10 @@ class ZodType {
13457
13652
  const ctx = {
13458
13653
  common: {
13459
13654
  issues: [],
13460
- contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap,
13655
+ contextualErrorMap: params?.errorMap,
13461
13656
  async: true
13462
13657
  },
13463
- path: (params === null || params === undefined ? undefined : params.path) || [],
13658
+ path: params?.path || [],
13464
13659
  schemaErrorMap: this._def.errorMap,
13465
13660
  parent: null,
13466
13661
  data,
@@ -13650,13 +13845,14 @@ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_
13650
13845
  var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
13651
13846
  var dateRegex = new RegExp(`^${dateRegexSource}$`);
13652
13847
  function timeRegexSource(args) {
13653
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
13848
+ let secondsRegexSource = `[0-5]\\d`;
13654
13849
  if (args.precision) {
13655
- regex = `${regex}\\.\\d{${args.precision}}`;
13850
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
13656
13851
  } else if (args.precision == null) {
13657
- regex = `${regex}(\\.\\d+)?`;
13852
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
13658
13853
  }
13659
- return regex;
13854
+ const secondsQuantifier = args.precision ? "+" : "?";
13855
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
13660
13856
  }
13661
13857
  function timeRegex(args) {
13662
13858
  return new RegExp(`^${timeRegexSource(args)}$`);
@@ -13684,16 +13880,20 @@ function isValidJWT(jwt, alg) {
13684
13880
  return false;
13685
13881
  try {
13686
13882
  const [header] = jwt.split(".");
13883
+ if (!header)
13884
+ return false;
13687
13885
  const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
13688
13886
  const decoded = JSON.parse(atob(base64));
13689
13887
  if (typeof decoded !== "object" || decoded === null)
13690
13888
  return false;
13691
- if (!decoded.typ || !decoded.alg)
13889
+ if ("typ" in decoded && decoded?.typ !== "JWT")
13890
+ return false;
13891
+ if (!decoded.alg)
13692
13892
  return false;
13693
13893
  if (alg && decoded.alg !== alg)
13694
13894
  return false;
13695
13895
  return true;
13696
- } catch (_a) {
13896
+ } catch {
13697
13897
  return false;
13698
13898
  }
13699
13899
  }
@@ -13853,7 +14053,7 @@ class ZodString extends ZodType {
13853
14053
  } else if (check.kind === "url") {
13854
14054
  try {
13855
14055
  new URL(input.data);
13856
- } catch (_a) {
14056
+ } catch {
13857
14057
  ctx = this._getOrReturnCtx(input, ctx);
13858
14058
  addIssueToContext(ctx, {
13859
14059
  validation: "url",
@@ -14065,7 +14265,6 @@ class ZodString extends ZodType {
14065
14265
  return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
14066
14266
  }
14067
14267
  datetime(options) {
14068
- var _a, _b;
14069
14268
  if (typeof options === "string") {
14070
14269
  return this._addCheck({
14071
14270
  kind: "datetime",
@@ -14077,10 +14276,10 @@ class ZodString extends ZodType {
14077
14276
  }
14078
14277
  return this._addCheck({
14079
14278
  kind: "datetime",
14080
- precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
14081
- offset: (_a = options === null || options === undefined ? undefined : options.offset) !== null && _a !== undefined ? _a : false,
14082
- local: (_b = options === null || options === undefined ? undefined : options.local) !== null && _b !== undefined ? _b : false,
14083
- ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
14279
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
14280
+ offset: options?.offset ?? false,
14281
+ local: options?.local ?? false,
14282
+ ...errorUtil.errToObj(options?.message)
14084
14283
  });
14085
14284
  }
14086
14285
  date(message) {
@@ -14096,8 +14295,8 @@ class ZodString extends ZodType {
14096
14295
  }
14097
14296
  return this._addCheck({
14098
14297
  kind: "time",
14099
- precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
14100
- ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
14298
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
14299
+ ...errorUtil.errToObj(options?.message)
14101
14300
  });
14102
14301
  }
14103
14302
  duration(message) {
@@ -14114,8 +14313,8 @@ class ZodString extends ZodType {
14114
14313
  return this._addCheck({
14115
14314
  kind: "includes",
14116
14315
  value,
14117
- position: options === null || options === undefined ? undefined : options.position,
14118
- ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
14316
+ position: options?.position,
14317
+ ...errorUtil.errToObj(options?.message)
14119
14318
  });
14120
14319
  }
14121
14320
  startsWith(value, message) {
@@ -14244,11 +14443,10 @@ class ZodString extends ZodType {
14244
14443
  }
14245
14444
  }
14246
14445
  ZodString.create = (params) => {
14247
- var _a;
14248
14446
  return new ZodString({
14249
14447
  checks: [],
14250
14448
  typeName: ZodFirstPartyTypeKind.ZodString,
14251
- coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
14449
+ coerce: params?.coerce ?? false,
14252
14450
  ...processCreateParams(params)
14253
14451
  });
14254
14452
  };
@@ -14256,9 +14454,9 @@ function floatSafeRemainder(val, step) {
14256
14454
  const valDecCount = (val.toString().split(".")[1] || "").length;
14257
14455
  const stepDecCount = (step.toString().split(".")[1] || "").length;
14258
14456
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
14259
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
14260
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
14261
- return valInt % stepInt / Math.pow(10, decCount);
14457
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
14458
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
14459
+ return valInt % stepInt / 10 ** decCount;
14262
14460
  }
14263
14461
 
14264
14462
  class ZodNumber extends ZodType {
@@ -14469,7 +14667,8 @@ class ZodNumber extends ZodType {
14469
14667
  return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
14470
14668
  }
14471
14669
  get isFinite() {
14472
- let max = null, min = null;
14670
+ let max = null;
14671
+ let min = null;
14473
14672
  for (const ch of this._def.checks) {
14474
14673
  if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
14475
14674
  return true;
@@ -14488,7 +14687,7 @@ ZodNumber.create = (params) => {
14488
14687
  return new ZodNumber({
14489
14688
  checks: [],
14490
14689
  typeName: ZodFirstPartyTypeKind.ZodNumber,
14491
- coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
14690
+ coerce: params?.coerce || false,
14492
14691
  ...processCreateParams(params)
14493
14692
  });
14494
14693
  };
@@ -14503,7 +14702,7 @@ class ZodBigInt extends ZodType {
14503
14702
  if (this._def.coerce) {
14504
14703
  try {
14505
14704
  input.data = BigInt(input.data);
14506
- } catch (_a) {
14705
+ } catch {
14507
14706
  return this._getInvalidInput(input);
14508
14707
  }
14509
14708
  }
@@ -14658,11 +14857,10 @@ class ZodBigInt extends ZodType {
14658
14857
  }
14659
14858
  }
14660
14859
  ZodBigInt.create = (params) => {
14661
- var _a;
14662
14860
  return new ZodBigInt({
14663
14861
  checks: [],
14664
14862
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
14665
- coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
14863
+ coerce: params?.coerce ?? false,
14666
14864
  ...processCreateParams(params)
14667
14865
  });
14668
14866
  };
@@ -14688,7 +14886,7 @@ class ZodBoolean extends ZodType {
14688
14886
  ZodBoolean.create = (params) => {
14689
14887
  return new ZodBoolean({
14690
14888
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
14691
- coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
14889
+ coerce: params?.coerce || false,
14692
14890
  ...processCreateParams(params)
14693
14891
  });
14694
14892
  };
@@ -14708,7 +14906,7 @@ class ZodDate extends ZodType {
14708
14906
  });
14709
14907
  return INVALID;
14710
14908
  }
14711
- if (isNaN(input.data.getTime())) {
14909
+ if (Number.isNaN(input.data.getTime())) {
14712
14910
  const ctx2 = this._getOrReturnCtx(input);
14713
14911
  addIssueToContext(ctx2, {
14714
14912
  code: ZodIssueCode.invalid_date
@@ -14797,7 +14995,7 @@ class ZodDate extends ZodType {
14797
14995
  ZodDate.create = (params) => {
14798
14996
  return new ZodDate({
14799
14997
  checks: [],
14800
- coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
14998
+ coerce: params?.coerce || false,
14801
14999
  typeName: ZodFirstPartyTypeKind.ZodDate,
14802
15000
  ...processCreateParams(params)
14803
15001
  });
@@ -15081,7 +15279,8 @@ class ZodObject extends ZodType {
15081
15279
  return this._cached;
15082
15280
  const shape = this._def.shape();
15083
15281
  const keys = util.objectKeys(shape);
15084
- return this._cached = { shape, keys };
15282
+ this._cached = { shape, keys };
15283
+ return this._cached;
15085
15284
  }
15086
15285
  _parse(input) {
15087
15286
  const parsedType = this._getType(input);
@@ -15131,9 +15330,7 @@ class ZodObject extends ZodType {
15131
15330
  });
15132
15331
  status.dirty();
15133
15332
  }
15134
- } else if (unknownKeys === "strip")
15135
- ;
15136
- else {
15333
+ } else if (unknownKeys === "strip") {} else {
15137
15334
  throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
15138
15335
  }
15139
15336
  } else {
@@ -15177,11 +15374,10 @@ class ZodObject extends ZodType {
15177
15374
  unknownKeys: "strict",
15178
15375
  ...message !== undefined ? {
15179
15376
  errorMap: (issue, ctx) => {
15180
- var _a, _b, _c, _d;
15181
- const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === undefined ? undefined : _b.call(_a, issue, ctx).message) !== null && _c !== undefined ? _c : ctx.defaultError;
15377
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
15182
15378
  if (issue.code === "unrecognized_keys")
15183
15379
  return {
15184
- message: (_d = errorUtil.errToObj(message).message) !== null && _d !== undefined ? _d : defaultError
15380
+ message: errorUtil.errToObj(message).message ?? defaultError
15185
15381
  };
15186
15382
  return {
15187
15383
  message: defaultError
@@ -15234,11 +15430,11 @@ class ZodObject extends ZodType {
15234
15430
  }
15235
15431
  pick(mask) {
15236
15432
  const shape = {};
15237
- util.objectKeys(mask).forEach((key) => {
15433
+ for (const key of util.objectKeys(mask)) {
15238
15434
  if (mask[key] && this.shape[key]) {
15239
15435
  shape[key] = this.shape[key];
15240
15436
  }
15241
- });
15437
+ }
15242
15438
  return new ZodObject({
15243
15439
  ...this._def,
15244
15440
  shape: () => shape
@@ -15246,11 +15442,11 @@ class ZodObject extends ZodType {
15246
15442
  }
15247
15443
  omit(mask) {
15248
15444
  const shape = {};
15249
- util.objectKeys(this.shape).forEach((key) => {
15445
+ for (const key of util.objectKeys(this.shape)) {
15250
15446
  if (!mask[key]) {
15251
15447
  shape[key] = this.shape[key];
15252
15448
  }
15253
- });
15449
+ }
15254
15450
  return new ZodObject({
15255
15451
  ...this._def,
15256
15452
  shape: () => shape
@@ -15261,14 +15457,14 @@ class ZodObject extends ZodType {
15261
15457
  }
15262
15458
  partial(mask) {
15263
15459
  const newShape = {};
15264
- util.objectKeys(this.shape).forEach((key) => {
15460
+ for (const key of util.objectKeys(this.shape)) {
15265
15461
  const fieldSchema = this.shape[key];
15266
15462
  if (mask && !mask[key]) {
15267
15463
  newShape[key] = fieldSchema;
15268
15464
  } else {
15269
15465
  newShape[key] = fieldSchema.optional();
15270
15466
  }
15271
- });
15467
+ }
15272
15468
  return new ZodObject({
15273
15469
  ...this._def,
15274
15470
  shape: () => newShape
@@ -15276,7 +15472,7 @@ class ZodObject extends ZodType {
15276
15472
  }
15277
15473
  required(mask) {
15278
15474
  const newShape = {};
15279
- util.objectKeys(this.shape).forEach((key) => {
15475
+ for (const key of util.objectKeys(this.shape)) {
15280
15476
  if (mask && !mask[key]) {
15281
15477
  newShape[key] = this.shape[key];
15282
15478
  } else {
@@ -15287,7 +15483,7 @@ class ZodObject extends ZodType {
15287
15483
  }
15288
15484
  newShape[key] = newField;
15289
15485
  }
15290
- });
15486
+ }
15291
15487
  return new ZodObject({
15292
15488
  ...this._def,
15293
15489
  shape: () => newShape
@@ -15903,12 +16099,7 @@ class ZodFunction extends ZodType {
15903
16099
  return makeIssue({
15904
16100
  data: args,
15905
16101
  path: ctx.path,
15906
- errorMaps: [
15907
- ctx.common.contextualErrorMap,
15908
- ctx.schemaErrorMap,
15909
- getErrorMap(),
15910
- errorMap
15911
- ].filter((x) => !!x),
16102
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
15912
16103
  issueData: {
15913
16104
  code: ZodIssueCode.invalid_arguments,
15914
16105
  argumentsError: error
@@ -15919,12 +16110,7 @@ class ZodFunction extends ZodType {
15919
16110
  return makeIssue({
15920
16111
  data: returns,
15921
16112
  path: ctx.path,
15922
- errorMaps: [
15923
- ctx.common.contextualErrorMap,
15924
- ctx.schemaErrorMap,
15925
- getErrorMap(),
15926
- errorMap
15927
- ].filter((x) => !!x),
16113
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
15928
16114
  issueData: {
15929
16115
  code: ZodIssueCode.invalid_return_type,
15930
16116
  returnTypeError: error
@@ -16051,10 +16237,6 @@ function createZodEnum(values, params) {
16051
16237
  }
16052
16238
 
16053
16239
  class ZodEnum extends ZodType {
16054
- constructor() {
16055
- super(...arguments);
16056
- _ZodEnum_cache.set(this, undefined);
16057
- }
16058
16240
  _parse(input) {
16059
16241
  if (typeof input.data !== "string") {
16060
16242
  const ctx = this._getOrReturnCtx(input);
@@ -16066,10 +16248,10 @@ class ZodEnum extends ZodType {
16066
16248
  });
16067
16249
  return INVALID;
16068
16250
  }
16069
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
16070
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
16251
+ if (!this._cache) {
16252
+ this._cache = new Set(this._def.values);
16071
16253
  }
16072
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
16254
+ if (!this._cache.has(input.data)) {
16073
16255
  const ctx = this._getOrReturnCtx(input);
16074
16256
  const expectedValues = this._def.values;
16075
16257
  addIssueToContext(ctx, {
@@ -16118,14 +16300,9 @@ class ZodEnum extends ZodType {
16118
16300
  });
16119
16301
  }
16120
16302
  }
16121
- _ZodEnum_cache = new WeakMap;
16122
16303
  ZodEnum.create = createZodEnum;
16123
16304
 
16124
16305
  class ZodNativeEnum extends ZodType {
16125
- constructor() {
16126
- super(...arguments);
16127
- _ZodNativeEnum_cache.set(this, undefined);
16128
- }
16129
16306
  _parse(input) {
16130
16307
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
16131
16308
  const ctx = this._getOrReturnCtx(input);
@@ -16138,10 +16315,10 @@ class ZodNativeEnum extends ZodType {
16138
16315
  });
16139
16316
  return INVALID;
16140
16317
  }
16141
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
16142
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
16318
+ if (!this._cache) {
16319
+ this._cache = new Set(util.getValidEnumValues(this._def.values));
16143
16320
  }
16144
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
16321
+ if (!this._cache.has(input.data)) {
16145
16322
  const expectedValues = util.objectValues(nativeEnumValues);
16146
16323
  addIssueToContext(ctx, {
16147
16324
  received: ctx.data,
@@ -16156,7 +16333,6 @@ class ZodNativeEnum extends ZodType {
16156
16333
  return this._def.values;
16157
16334
  }
16158
16335
  }
16159
- _ZodNativeEnum_cache = new WeakMap;
16160
16336
  ZodNativeEnum.create = (values, params) => {
16161
16337
  return new ZodNativeEnum({
16162
16338
  values,
@@ -16299,7 +16475,7 @@ class ZodEffects extends ZodType {
16299
16475
  parent: ctx
16300
16476
  });
16301
16477
  if (!isValid(base))
16302
- return base;
16478
+ return INVALID;
16303
16479
  const result = effect.transform(base.value, checkCtx);
16304
16480
  if (result instanceof Promise) {
16305
16481
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
@@ -16308,8 +16484,11 @@ class ZodEffects extends ZodType {
16308
16484
  } else {
16309
16485
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
16310
16486
  if (!isValid(base))
16311
- return base;
16312
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
16487
+ return INVALID;
16488
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
16489
+ status: status.value,
16490
+ value: result
16491
+ }));
16313
16492
  });
16314
16493
  }
16315
16494
  }
@@ -16332,7 +16511,6 @@ ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
16332
16511
  ...processCreateParams(params)
16333
16512
  });
16334
16513
  };
16335
-
16336
16514
  class ZodOptional extends ZodType {
16337
16515
  _parse(input) {
16338
16516
  const parsedType = this._getType(input);
@@ -16577,21 +16755,19 @@ function cleanParams(params, data) {
16577
16755
  function custom(check, _params = {}, fatal) {
16578
16756
  if (check)
16579
16757
  return ZodAny.create().superRefine((data, ctx) => {
16580
- var _a, _b;
16581
16758
  const r = check(data);
16582
16759
  if (r instanceof Promise) {
16583
16760
  return r.then((r2) => {
16584
- var _a2, _b2;
16585
16761
  if (!r2) {
16586
16762
  const params = cleanParams(_params, data);
16587
- const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== undefined ? _a2 : fatal) !== null && _b2 !== undefined ? _b2 : true;
16763
+ const _fatal = params.fatal ?? fatal ?? true;
16588
16764
  ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
16589
16765
  }
16590
16766
  });
16591
16767
  }
16592
16768
  if (!r) {
16593
16769
  const params = cleanParams(_params, data);
16594
- const _fatal = (_b = (_a = params.fatal) !== null && _a !== undefined ? _a : fatal) !== null && _b !== undefined ? _b : true;
16770
+ const _fatal = params.fatal ?? fatal ?? true;
16595
16771
  ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
16596
16772
  }
16597
16773
  return;
@@ -16691,122 +16867,6 @@ var coerce = {
16691
16867
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
16692
16868
  };
16693
16869
  var NEVER = INVALID;
16694
- var z = /* @__PURE__ */ Object.freeze({
16695
- __proto__: null,
16696
- defaultErrorMap: errorMap,
16697
- setErrorMap,
16698
- getErrorMap,
16699
- makeIssue,
16700
- EMPTY_PATH,
16701
- addIssueToContext,
16702
- ParseStatus,
16703
- INVALID,
16704
- DIRTY,
16705
- OK,
16706
- isAborted,
16707
- isDirty,
16708
- isValid,
16709
- isAsync,
16710
- get util() {
16711
- return util;
16712
- },
16713
- get objectUtil() {
16714
- return objectUtil;
16715
- },
16716
- ZodParsedType,
16717
- getParsedType,
16718
- ZodType,
16719
- datetimeRegex,
16720
- ZodString,
16721
- ZodNumber,
16722
- ZodBigInt,
16723
- ZodBoolean,
16724
- ZodDate,
16725
- ZodSymbol,
16726
- ZodUndefined,
16727
- ZodNull,
16728
- ZodAny,
16729
- ZodUnknown,
16730
- ZodNever,
16731
- ZodVoid,
16732
- ZodArray,
16733
- ZodObject,
16734
- ZodUnion,
16735
- ZodDiscriminatedUnion,
16736
- ZodIntersection,
16737
- ZodTuple,
16738
- ZodRecord,
16739
- ZodMap,
16740
- ZodSet,
16741
- ZodFunction,
16742
- ZodLazy,
16743
- ZodLiteral,
16744
- ZodEnum,
16745
- ZodNativeEnum,
16746
- ZodPromise,
16747
- ZodEffects,
16748
- ZodTransformer: ZodEffects,
16749
- ZodOptional,
16750
- ZodNullable,
16751
- ZodDefault,
16752
- ZodCatch,
16753
- ZodNaN,
16754
- BRAND,
16755
- ZodBranded,
16756
- ZodPipeline,
16757
- ZodReadonly,
16758
- custom,
16759
- Schema: ZodType,
16760
- ZodSchema: ZodType,
16761
- late,
16762
- get ZodFirstPartyTypeKind() {
16763
- return ZodFirstPartyTypeKind;
16764
- },
16765
- coerce,
16766
- any: anyType,
16767
- array: arrayType,
16768
- bigint: bigIntType,
16769
- boolean: booleanType,
16770
- date: dateType,
16771
- discriminatedUnion: discriminatedUnionType,
16772
- effect: effectsType,
16773
- enum: enumType,
16774
- function: functionType,
16775
- instanceof: instanceOfType,
16776
- intersection: intersectionType,
16777
- lazy: lazyType,
16778
- literal: literalType,
16779
- map: mapType,
16780
- nan: nanType,
16781
- nativeEnum: nativeEnumType,
16782
- never: neverType,
16783
- null: nullType,
16784
- nullable: nullableType,
16785
- number: numberType,
16786
- object: objectType,
16787
- oboolean,
16788
- onumber,
16789
- optional: optionalType,
16790
- ostring,
16791
- pipeline: pipelineType,
16792
- preprocess: preprocessType,
16793
- promise: promiseType,
16794
- record: recordType,
16795
- set: setType,
16796
- strictObject: strictObjectType,
16797
- string: stringType,
16798
- symbol: symbolType,
16799
- transformer: effectsType,
16800
- tuple: tupleType,
16801
- undefined: undefinedType,
16802
- union: unionType,
16803
- unknown: unknownType,
16804
- void: voidType,
16805
- NEVER,
16806
- ZodIssueCode,
16807
- quotelessJson,
16808
- ZodError
16809
- });
16810
16870
  // src/common/string.ts
16811
16871
  var getChineseByStr = (str) => {
16812
16872
  if (!str) {
@@ -16985,7 +17045,7 @@ var watch = {
16985
17045
  };
16986
17046
  // ../../node_modules/decimal.js/decimal.mjs
16987
17047
  /*!
16988
- * decimal.js v10.5.0
17048
+ * decimal.js v10.6.0
16989
17049
  * An arbitrary-precision Decimal type for JavaScript.
16990
17050
  * https://github.com/MikeMcl/decimal.js
16991
17051
  * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
@@ -17008,7 +17068,7 @@ var DEFAULTS = {
17008
17068
  };
17009
17069
  var inexact;
17010
17070
  var quadrant;
17011
- var external = true;
17071
+ var external2 = true;
17012
17072
  var decimalError = "[DecimalError] ";
17013
17073
  var invalidArgument = decimalError + "Invalid argument: ";
17014
17074
  var precisionLimitExceeded = decimalError + "Precision limit exceeded";
@@ -17084,7 +17144,7 @@ P.cubeRoot = P.cbrt = function() {
17084
17144
  var e, m, n, r, rep, s, sd, t, t3, t3plusx, x = this, Ctor = x.constructor;
17085
17145
  if (!x.isFinite() || x.isZero())
17086
17146
  return new Ctor(x);
17087
- external = false;
17147
+ external2 = false;
17088
17148
  s = x.s * mathpow(x.s * x, 1 / 3);
17089
17149
  if (!s || Math.abs(s) == 1 / 0) {
17090
17150
  n = digitsToString(x.d);
@@ -17131,7 +17191,7 @@ P.cubeRoot = P.cbrt = function() {
17131
17191
  }
17132
17192
  }
17133
17193
  }
17134
- external = true;
17194
+ external2 = true;
17135
17195
  return finalise(r, e, Ctor.rounding, m);
17136
17196
  };
17137
17197
  P.decimalPlaces = P.dp = function() {
@@ -17256,9 +17316,9 @@ P.inverseHyperbolicCosine = P.acosh = function() {
17256
17316
  rm = Ctor.rounding;
17257
17317
  Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;
17258
17318
  Ctor.rounding = 1;
17259
- external = false;
17319
+ external2 = false;
17260
17320
  x = x.times(x).minus(1).sqrt().plus(x);
17261
- external = true;
17321
+ external2 = true;
17262
17322
  Ctor.precision = pr;
17263
17323
  Ctor.rounding = rm;
17264
17324
  return x.ln();
@@ -17271,9 +17331,9 @@ P.inverseHyperbolicSine = P.asinh = function() {
17271
17331
  rm = Ctor.rounding;
17272
17332
  Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;
17273
17333
  Ctor.rounding = 1;
17274
- external = false;
17334
+ external2 = false;
17275
17335
  x = x.times(x).plus(1).sqrt().plus(x);
17276
- external = true;
17336
+ external2 = true;
17277
17337
  Ctor.precision = pr;
17278
17338
  Ctor.rounding = rm;
17279
17339
  return x.ln();
@@ -17342,7 +17402,7 @@ P.inverseTangent = P.atan = function() {
17342
17402
  k = Math.min(28, wpr / LOG_BASE + 2 | 0);
17343
17403
  for (i = k;i; --i)
17344
17404
  x = x.div(x.times(x).plus(1).sqrt().plus(1));
17345
- external = false;
17405
+ external2 = false;
17346
17406
  j = Math.ceil(wpr / LOG_BASE);
17347
17407
  n = 1;
17348
17408
  x2 = x.times(x);
@@ -17359,7 +17419,7 @@ P.inverseTangent = P.atan = function() {
17359
17419
  }
17360
17420
  if (k)
17361
17421
  r = r.times(2 << k - 1);
17362
- external = true;
17422
+ external2 = true;
17363
17423
  return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);
17364
17424
  };
17365
17425
  P.isFinite = function() {
@@ -17411,7 +17471,7 @@ P.logarithm = P.log = function(base) {
17411
17471
  inf = k !== 1;
17412
17472
  }
17413
17473
  }
17414
- external = false;
17474
+ external2 = false;
17415
17475
  sd = pr + guard;
17416
17476
  num = naturalLogarithm(arg, sd);
17417
17477
  denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);
@@ -17430,7 +17490,7 @@ P.logarithm = P.log = function(base) {
17430
17490
  }
17431
17491
  } while (checkRoundingDigits(r.d, k += 10, rm));
17432
17492
  }
17433
- external = true;
17493
+ external2 = true;
17434
17494
  return finalise(r, pr, rm);
17435
17495
  };
17436
17496
  P.minus = P.sub = function(y) {
@@ -17460,7 +17520,7 @@ P.minus = P.sub = function(y) {
17460
17520
  y = new Ctor(x);
17461
17521
  else
17462
17522
  return new Ctor(rm === 3 ? -0 : 0);
17463
- return external ? finalise(y, pr, rm) : y;
17523
+ return external2 ? finalise(y, pr, rm) : y;
17464
17524
  }
17465
17525
  e = mathfloor(y.e / LOG_BASE);
17466
17526
  xe = mathfloor(x.e / LOG_BASE);
@@ -17526,7 +17586,7 @@ P.minus = P.sub = function(y) {
17526
17586
  return new Ctor(rm === 3 ? -0 : 0);
17527
17587
  y.d = xd;
17528
17588
  y.e = getBase10Exponent(xd, e);
17529
- return external ? finalise(y, pr, rm) : y;
17589
+ return external2 ? finalise(y, pr, rm) : y;
17530
17590
  };
17531
17591
  P.modulo = P.mod = function(y) {
17532
17592
  var q, x = this, Ctor = x.constructor;
@@ -17536,7 +17596,7 @@ P.modulo = P.mod = function(y) {
17536
17596
  if (!y.d || x.d && !x.d[0]) {
17537
17597
  return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);
17538
17598
  }
17539
- external = false;
17599
+ external2 = false;
17540
17600
  if (Ctor.modulo == 9) {
17541
17601
  q = divide(x, y.abs(), 0, 3, 1);
17542
17602
  q.s *= y.s;
@@ -17544,7 +17604,7 @@ P.modulo = P.mod = function(y) {
17544
17604
  q = divide(x, y, 0, Ctor.modulo, 1);
17545
17605
  }
17546
17606
  q = q.times(y);
17547
- external = true;
17607
+ external2 = true;
17548
17608
  return x.minus(q);
17549
17609
  };
17550
17610
  P.naturalExponential = P.exp = function() {
@@ -17579,7 +17639,7 @@ P.plus = P.add = function(y) {
17579
17639
  if (!xd[0] || !yd[0]) {
17580
17640
  if (!yd[0])
17581
17641
  y = new Ctor(x);
17582
- return external ? finalise(y, pr, rm) : y;
17642
+ return external2 ? finalise(y, pr, rm) : y;
17583
17643
  }
17584
17644
  k = mathfloor(x.e / LOG_BASE);
17585
17645
  e = mathfloor(y.e / LOG_BASE);
@@ -17626,15 +17686,15 @@ P.plus = P.add = function(y) {
17626
17686
  xd.pop();
17627
17687
  y.d = xd;
17628
17688
  y.e = getBase10Exponent(xd, e);
17629
- return external ? finalise(y, pr, rm) : y;
17689
+ return external2 ? finalise(y, pr, rm) : y;
17630
17690
  };
17631
- P.precision = P.sd = function(z2) {
17691
+ P.precision = P.sd = function(z) {
17632
17692
  var k, x = this;
17633
- if (z2 !== undefined && z2 !== !!z2 && z2 !== 1 && z2 !== 0)
17634
- throw Error(invalidArgument + z2);
17693
+ if (z !== undefined && z !== !!z && z !== 1 && z !== 0)
17694
+ throw Error(invalidArgument + z);
17635
17695
  if (x.d) {
17636
17696
  k = getPrecision(x.d);
17637
- if (z2 && x.e + 1 > k)
17697
+ if (z && x.e + 1 > k)
17638
17698
  k = x.e + 1;
17639
17699
  } else {
17640
17700
  k = NaN;
@@ -17665,7 +17725,7 @@ P.squareRoot = P.sqrt = function() {
17665
17725
  if (s !== 1 || !d || !d[0]) {
17666
17726
  return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);
17667
17727
  }
17668
- external = false;
17728
+ external2 = false;
17669
17729
  s = Math.sqrt(+x);
17670
17730
  if (s == 0 || s == 1 / 0) {
17671
17731
  n = digitsToString(d);
@@ -17708,7 +17768,7 @@ P.squareRoot = P.sqrt = function() {
17708
17768
  }
17709
17769
  }
17710
17770
  }
17711
- external = true;
17771
+ external2 = true;
17712
17772
  return finalise(r, e, Ctor.rounding, m);
17713
17773
  };
17714
17774
  P.tangent = P.tan = function() {
@@ -17766,7 +17826,7 @@ P.times = P.mul = function(y) {
17766
17826
  r.shift();
17767
17827
  y.d = r;
17768
17828
  y.e = getBase10Exponent(r, e);
17769
- return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;
17829
+ return external2 ? finalise(y, Ctor.precision, Ctor.rounding) : y;
17770
17830
  };
17771
17831
  P.toBinary = function(sd, rm) {
17772
17832
  return toStringBinary(this, 2, sd, rm);
@@ -17831,7 +17891,7 @@ P.toFraction = function(maxD) {
17831
17891
  throw Error(invalidArgument + n);
17832
17892
  maxD = n.gt(d) ? e > 0 ? d : n1 : n;
17833
17893
  }
17834
- external = false;
17894
+ external2 = false;
17835
17895
  n = new Ctor(digitsToString(xd));
17836
17896
  pr = Ctor.precision;
17837
17897
  Ctor.precision = e = xd.length * LOG_BASE * 2;
@@ -17855,7 +17915,7 @@ P.toFraction = function(maxD) {
17855
17915
  n0.s = n1.s = x.s;
17856
17916
  r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];
17857
17917
  Ctor.precision = pr;
17858
- external = true;
17918
+ external2 = true;
17859
17919
  return r;
17860
17920
  };
17861
17921
  P.toHexadecimal = P.toHex = function(sd, rm) {
@@ -17885,9 +17945,9 @@ P.toNearest = function(y, rm) {
17885
17945
  }
17886
17946
  }
17887
17947
  if (y.d[0]) {
17888
- external = false;
17948
+ external2 = false;
17889
17949
  x = divide(x, y, 0, rm, 1).times(y);
17890
- external = true;
17950
+ external2 = true;
17891
17951
  finalise(x);
17892
17952
  } else {
17893
17953
  y.s = x.s;
@@ -17932,7 +17992,7 @@ P.toPower = P.pow = function(y) {
17932
17992
  e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log("0." + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + "").e;
17933
17993
  if (e > Ctor.maxE + 1 || e < Ctor.minE - 1)
17934
17994
  return new Ctor(e > 0 ? s / 0 : 0);
17935
- external = false;
17995
+ external2 = false;
17936
17996
  Ctor.rounding = x.s = 1;
17937
17997
  k = Math.min(12, (e + "").length);
17938
17998
  r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);
@@ -17947,7 +18007,7 @@ P.toPower = P.pow = function(y) {
17947
18007
  }
17948
18008
  }
17949
18009
  r.s = s;
17950
- external = true;
18010
+ external2 = true;
17951
18011
  Ctor.rounding = rm;
17952
18012
  return finalise(r, pr, rm);
17953
18013
  };
@@ -18346,7 +18406,7 @@ function finalise(x, sd, rm, isTruncated) {
18346
18406
  for (i = xd.length;xd[--i] === 0; )
18347
18407
  xd.pop();
18348
18408
  }
18349
- if (external) {
18409
+ if (external2) {
18350
18410
  if (x.e > Ctor.maxE) {
18351
18411
  x.d = null;
18352
18412
  x.e = NaN;
@@ -18395,7 +18455,7 @@ function getBase10Exponent(digits, e) {
18395
18455
  }
18396
18456
  function getLn10(Ctor, sd, pr) {
18397
18457
  if (sd > LN10_PRECISION) {
18398
- external = true;
18458
+ external2 = true;
18399
18459
  if (pr)
18400
18460
  Ctor.precision = pr;
18401
18461
  throw Error(precisionLimitExceeded);
@@ -18426,7 +18486,7 @@ function getZeroString(k) {
18426
18486
  }
18427
18487
  function intPow(Ctor, x, n, pr) {
18428
18488
  var isTruncated, r = new Ctor(1), k = Math.ceil(pr / LOG_BASE + 4);
18429
- external = false;
18489
+ external2 = false;
18430
18490
  for (;; ) {
18431
18491
  if (n % 2) {
18432
18492
  r = r.times(x);
@@ -18443,7 +18503,7 @@ function intPow(Ctor, x, n, pr) {
18443
18503
  x = x.times(x);
18444
18504
  truncate(x.d, k);
18445
18505
  }
18446
- external = true;
18506
+ external2 = true;
18447
18507
  return r;
18448
18508
  }
18449
18509
  function isOdd(n) {
@@ -18470,7 +18530,7 @@ function naturalExponential(x, sd) {
18470
18530
  return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : 0 / 0);
18471
18531
  }
18472
18532
  if (sd == null) {
18473
- external = false;
18533
+ external2 = false;
18474
18534
  wpr = pr;
18475
18535
  } else {
18476
18536
  wpr = sd;
@@ -18499,7 +18559,7 @@ function naturalExponential(x, sd) {
18499
18559
  i = 0;
18500
18560
  rep++;
18501
18561
  } else {
18502
- return finalise(sum, Ctor.precision = pr, rm, external = true);
18562
+ return finalise(sum, Ctor.precision = pr, rm, external2 = true);
18503
18563
  }
18504
18564
  } else {
18505
18565
  Ctor.precision = pr;
@@ -18515,7 +18575,7 @@ function naturalLogarithm(y, sd) {
18515
18575
  return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);
18516
18576
  }
18517
18577
  if (sd == null) {
18518
- external = false;
18578
+ external2 = false;
18519
18579
  wpr = pr;
18520
18580
  } else {
18521
18581
  wpr = sd;
@@ -18541,7 +18601,7 @@ function naturalLogarithm(y, sd) {
18541
18601
  t = getLn10(Ctor, wpr + 2, pr).times(e + "");
18542
18602
  x = naturalLogarithm(new Ctor(c0 + "." + c.slice(1)), wpr - guard).plus(t);
18543
18603
  Ctor.precision = pr;
18544
- return sd == null ? finalise(x, pr, rm, external = true) : x;
18604
+ return sd == null ? finalise(x, pr, rm, external2 = true) : x;
18545
18605
  }
18546
18606
  x1 = x;
18547
18607
  sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);
@@ -18562,7 +18622,7 @@ function naturalLogarithm(y, sd) {
18562
18622
  x2 = finalise(x.times(x), wpr, 1);
18563
18623
  denominator = rep = 1;
18564
18624
  } else {
18565
- return finalise(sum, Ctor.precision = pr, rm, external = true);
18625
+ return finalise(sum, Ctor.precision = pr, rm, external2 = true);
18566
18626
  }
18567
18627
  } else {
18568
18628
  Ctor.precision = pr;
@@ -18613,7 +18673,7 @@ function parseDecimal(x, str) {
18613
18673
  for (;i--; )
18614
18674
  str += "0";
18615
18675
  x.d.push(+str);
18616
- if (external) {
18676
+ if (external2) {
18617
18677
  if (x.e > x.constructor.maxE) {
18618
18678
  x.d = null;
18619
18679
  x.e = NaN;
@@ -18675,12 +18735,12 @@ function parseOther(x, str) {
18675
18735
  return new Ctor(x.s * 0);
18676
18736
  x.e = getBase10Exponent(xd, xe);
18677
18737
  x.d = xd;
18678
- external = false;
18738
+ external2 = false;
18679
18739
  if (isFloat)
18680
18740
  x = divide(x, divisor, len * 4);
18681
18741
  if (p)
18682
18742
  x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));
18683
- external = true;
18743
+ external2 = true;
18684
18744
  return x;
18685
18745
  }
18686
18746
  function sine(Ctor, x) {
@@ -18701,7 +18761,7 @@ function sine(Ctor, x) {
18701
18761
  }
18702
18762
  function taylorSeries(Ctor, n, x, y, isHyperbolic) {
18703
18763
  var j, t, u, x2, i = 1, pr = Ctor.precision, k = Math.ceil(pr / LOG_BASE);
18704
- external = false;
18764
+ external2 = false;
18705
18765
  x2 = x.times(x);
18706
18766
  u = new Ctor(y);
18707
18767
  for (;; ) {
@@ -18721,7 +18781,7 @@ function taylorSeries(Ctor, n, x, y, isHyperbolic) {
18721
18781
  t = j;
18722
18782
  i++;
18723
18783
  }
18724
- external = true;
18784
+ external2 = true;
18725
18785
  t.d.length = k + 1;
18726
18786
  return t;
18727
18787
  }
@@ -18990,7 +19050,7 @@ function clone(obj) {
18990
19050
  x.constructor = Decimal;
18991
19051
  if (isDecimalInstance(v)) {
18992
19052
  x.s = v.s;
18993
- if (external) {
19053
+ if (external2) {
18994
19054
  if (!v.d || v.e > Decimal.maxE) {
18995
19055
  x.e = NaN;
18996
19056
  x.d = null;
@@ -19024,7 +19084,7 @@ function clone(obj) {
19024
19084
  if (v === ~~v && v < 1e7) {
19025
19085
  for (e = 0, i2 = v;i2 >= 10; i2 /= 10)
19026
19086
  e++;
19027
- if (external) {
19087
+ if (external2) {
19028
19088
  if (e > Decimal.maxE) {
19029
19089
  x.e = NaN;
19030
19090
  x.d = null;
@@ -19148,12 +19208,12 @@ function floor(x) {
19148
19208
  }
19149
19209
  function hypot() {
19150
19210
  var i, n, t = new this(0);
19151
- external = false;
19211
+ external2 = false;
19152
19212
  for (i = 0;i < arguments.length; ) {
19153
19213
  n = new this(arguments[i++]);
19154
19214
  if (!n.d) {
19155
19215
  if (n.s) {
19156
- external = true;
19216
+ external2 = true;
19157
19217
  return new this(1 / 0);
19158
19218
  }
19159
19219
  t = n;
@@ -19161,7 +19221,7 @@ function hypot() {
19161
19221
  t = t.plus(n.times(n));
19162
19222
  }
19163
19223
  }
19164
- external = true;
19224
+ external2 = true;
19165
19225
  return t.sqrt();
19166
19226
  }
19167
19227
  function isDecimalInstance(obj) {
@@ -19274,10 +19334,10 @@ function sub(x, y) {
19274
19334
  }
19275
19335
  function sum() {
19276
19336
  var i = 0, args = arguments, x = new this(args[i]);
19277
- external = false;
19337
+ external2 = false;
19278
19338
  for (;x.s && ++i < args.length; )
19279
19339
  x = x.plus(args[i]);
19280
- external = true;
19340
+ external2 = true;
19281
19341
  return finalise(x, this.precision, this.rounding);
19282
19342
  }
19283
19343
  function tan(x) {