@scenid/react-formulator 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -7,8 +7,6 @@ import { makeStyles as makeStyles$1, useTheme } from '@mui/styles';
7
7
  import { Autorenew, Delete, Save, Clear, Check, Close } from '@mui/icons-material';
8
8
  import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
9
9
  import path$3 from 'path';
10
- import proc from 'process';
11
- import { fileURLToPath } from 'url';
12
10
  import { alpha as alpha$1 } from '@mui/material/styles';
13
11
 
14
12
  function _classCallCheck(instance, Constructor) {
@@ -1516,9 +1514,9 @@ var engineUserAgent = getBuiltIn$K('navigator', 'userAgent') || '';
1516
1514
  var global$Y = global$_;
1517
1515
  var userAgent$7 = engineUserAgent;
1518
1516
 
1519
- var process$5 = global$Y.process;
1517
+ var process$6 = global$Y.process;
1520
1518
  var Deno$1 = global$Y.Deno;
1521
- var versions = process$5 && process$5.versions || Deno$1 && Deno$1.version;
1519
+ var versions = process$6 && process$6.versions || Deno$1 && Deno$1.version;
1522
1520
  var v8 = versions && versions.v8;
1523
1521
  var match$1, version$1;
1524
1522
 
@@ -1674,13 +1672,13 @@ var toObject$B = function (argument) {
1674
1672
  var uncurryThis$1p = functionUncurryThis;
1675
1673
  var toObject$A = toObject$B;
1676
1674
 
1677
- var hasOwnProperty$2 = uncurryThis$1p({}.hasOwnProperty);
1675
+ var hasOwnProperty$3 = uncurryThis$1p({}.hasOwnProperty);
1678
1676
 
1679
1677
  // `HasOwnProperty` abstract operation
1680
1678
  // https://tc39.es/ecma262/#sec-hasownproperty
1681
1679
  // eslint-disable-next-line es-x/no-object-hasown -- safe
1682
1680
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
1683
- return hasOwnProperty$2(toObject$A(it), key);
1681
+ return hasOwnProperty$3(toObject$A(it), key);
1684
1682
  };
1685
1683
 
1686
1684
  var uncurryThis$1o = functionUncurryThis;
@@ -8255,7 +8253,7 @@ var IS_NODE$5 = engineIsNode;
8255
8253
 
8256
8254
  var set$1 = global$A.setImmediate;
8257
8255
  var clear = global$A.clearImmediate;
8258
- var process$4 = global$A.process;
8256
+ var process$5 = global$A.process;
8259
8257
  var Dispatch = global$A.Dispatch;
8260
8258
  var Function$2 = global$A.Function;
8261
8259
  var MessageChannel = global$A.MessageChannel;
@@ -8311,7 +8309,7 @@ if (!set$1 || !clear) {
8311
8309
  // Node.js 0.8-
8312
8310
  if (IS_NODE$5) {
8313
8311
  defer = function (id) {
8314
- process$4.nextTick(runner(id));
8312
+ process$5.nextTick(runner(id));
8315
8313
  };
8316
8314
  // Sphere (JS game engine) Dispatch API
8317
8315
  } else if (Dispatch && Dispatch.now) {
@@ -8377,7 +8375,7 @@ var IS_NODE$4 = engineIsNode;
8377
8375
 
8378
8376
  var MutationObserver = global$y.MutationObserver || global$y.WebKitMutationObserver;
8379
8377
  var document$4 = global$y.document;
8380
- var process$3 = global$y.process;
8378
+ var process$4 = global$y.process;
8381
8379
  var Promise$4 = global$y.Promise;
8382
8380
  // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
8383
8381
  var queueMicrotaskDescriptor = getOwnPropertyDescriptor$5(global$y, 'queueMicrotask');
@@ -8389,7 +8387,7 @@ var flush, head, last, notify$1, toggle, node, promise, then;
8389
8387
  if (!queueMicrotask) {
8390
8388
  flush = function () {
8391
8389
  var parent, fn;
8392
- if (IS_NODE$4 && (parent = process$3.domain)) parent.exit();
8390
+ if (IS_NODE$4 && (parent = process$4.domain)) parent.exit();
8393
8391
  while (head) {
8394
8392
  fn = head.fn;
8395
8393
  head = head.next;
@@ -8426,7 +8424,7 @@ if (!queueMicrotask) {
8426
8424
  // Node.js without promises
8427
8425
  } else if (IS_NODE$4) {
8428
8426
  notify$1 = function () {
8429
- process$3.nextTick(flush);
8427
+ process$4.nextTick(flush);
8430
8428
  };
8431
8429
  // for other environments - macrotask based on:
8432
8430
  // - setImmediate
@@ -8598,7 +8596,7 @@ var PromiseConstructor = NativePromiseConstructor$3;
8598
8596
  var PromisePrototype = NativePromisePrototype$2;
8599
8597
  var TypeError$4 = global$u.TypeError;
8600
8598
  var document$3 = global$u.document;
8601
- var process$2 = global$u.process;
8599
+ var process$3 = global$u.process;
8602
8600
  var newPromiseCapability$1 = newPromiseCapabilityModule$6.f;
8603
8601
  var newGenericPromiseCapability = newPromiseCapability$1;
8604
8602
 
@@ -8690,7 +8688,7 @@ var onUnhandled = function (state) {
8690
8688
  if (IS_UNHANDLED) {
8691
8689
  result = perform$5(function () {
8692
8690
  if (IS_NODE$3) {
8693
- process$2.emit('unhandledRejection', value, promise);
8691
+ process$3.emit('unhandledRejection', value, promise);
8694
8692
  } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
8695
8693
  });
8696
8694
  // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
@@ -8708,7 +8706,7 @@ var onHandleUnhandled = function (state) {
8708
8706
  call$T(task, global$u, function () {
8709
8707
  var promise = state.facade;
8710
8708
  if (IS_NODE$3) {
8711
- process$2.emit('rejectionHandled', promise);
8709
+ process$3.emit('rejectionHandled', promise);
8712
8710
  } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
8713
8711
  });
8714
8712
  };
@@ -8796,7 +8794,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
8796
8794
  state.parent = true;
8797
8795
  reaction.ok = isCallable$f(onFulfilled) ? onFulfilled : true;
8798
8796
  reaction.fail = isCallable$f(onRejected) && onRejected;
8799
- reaction.domain = IS_NODE$3 ? process$2.domain : undefined;
8797
+ reaction.domain = IS_NODE$3 ? process$3.domain : undefined;
8800
8798
  if (state.state == PENDING) state.reactions.add(reaction);
8801
8799
  else microtask$1(function () {
8802
8800
  callReaction(reaction, state);
@@ -17068,7 +17066,7 @@ var aCallable = aCallable$Y;
17068
17066
  var validateArgumentsLength$4 = validateArgumentsLength$8;
17069
17067
  var IS_NODE$1 = engineIsNode;
17070
17068
 
17071
- var process$1 = global$7.process;
17069
+ var process$2 = global$7.process;
17072
17070
 
17073
17071
  // `queueMicrotask` method
17074
17072
  // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
@@ -17076,7 +17074,7 @@ $$6({ global: true, enumerable: true, dontCallGetSet: true }, {
17076
17074
  queueMicrotask: function queueMicrotask(fn) {
17077
17075
  validateArgumentsLength$4(arguments.length, 1);
17078
17076
  aCallable(fn);
17079
- var domain = IS_NODE$1 && process$1.domain;
17077
+ var domain = IS_NODE$1 && process$2.domain;
17080
17078
  microtask(domain ? domain.bind(fn) : fn);
17081
17079
  }
17082
17080
  });
@@ -17743,7 +17741,7 @@ var adapt = function (delta, numPoints, firstTime) {
17743
17741
  * Converts a string of Unicode symbols (e.g. a domain name label) to a
17744
17742
  * Punycode string of ASCII-only symbols.
17745
17743
  */
17746
- var encode$2 = function (input) {
17744
+ var encode$3 = function (input) {
17747
17745
  var output = [];
17748
17746
 
17749
17747
  // Convert the input in UCS-2 to an array of Unicode code points.
@@ -17832,7 +17830,7 @@ var stringPunycodeToAscii = function (input) {
17832
17830
  var i, label;
17833
17831
  for (i = 0; i < labels.length; i++) {
17834
17832
  label = labels[i];
17835
- push$3(encoded, exec$1(regexNonASCII, label) ? 'xn--' + encode$2(label) : label);
17833
+ push$3(encoded, exec$1(regexNonASCII, label) ? 'xn--' + encode$3(label) : label);
17836
17834
  }
17837
17835
  return join$2(encoded, '.');
17838
17836
  };
@@ -17889,7 +17887,7 @@ var RequestPrototype = NativeRequest && NativeRequest.prototype;
17889
17887
  var HeadersPrototype = Headers && Headers.prototype;
17890
17888
  var RegExp$1 = global$2.RegExp;
17891
17889
  var TypeError$2 = global$2.TypeError;
17892
- var decodeURIComponent = global$2.decodeURIComponent;
17890
+ var decodeURIComponent$1 = global$2.decodeURIComponent;
17893
17891
  var encodeURIComponent$1 = global$2.encodeURIComponent;
17894
17892
  var charAt$1 = uncurryThis$1(''.charAt);
17895
17893
  var join$1 = uncurryThis$1([].join);
@@ -17909,7 +17907,7 @@ var percentSequence = function (bytes) {
17909
17907
 
17910
17908
  var percentDecode = function (sequence) {
17911
17909
  try {
17912
- return decodeURIComponent(sequence);
17910
+ return decodeURIComponent$1(sequence);
17913
17911
  } catch (error) {
17914
17912
  return sequence;
17915
17913
  }
@@ -17919,7 +17917,7 @@ var deserialize = function (it) {
17919
17917
  var result = replace$2(it, plus, ' ');
17920
17918
  var bytes = 4;
17921
17919
  try {
17922
- return decodeURIComponent(result);
17920
+ return decodeURIComponent$1(result);
17923
17921
  } catch (error) {
17924
17922
  while (bytes) {
17925
17923
  result = replace$2(result, percentSequence(bytes--), percentDecode);
@@ -29827,6 +29825,7 @@ FormText.propTypes = {
29827
29825
  onChange: PropTypes.func
29828
29826
  };
29829
29827
 
29828
+ // eslint-disable-next-line import/prefer-default-export
29830
29829
  var castToNumber = function castToNumber(value, step) {
29831
29830
  if (value === undefined || Number.isNaN(value) || value === '') {
29832
29831
  return '';
@@ -29863,7 +29862,8 @@ var FormNumber = function FormNumber(_ref) {
29863
29862
  value: castToNumber(e.target.value, step)
29864
29863
  }
29865
29864
  });
29866
- }
29865
+ } // eslint-disable-next-line react/jsx-props-no-spreading
29866
+
29867
29867
  }, props));
29868
29868
  };
29869
29869
 
@@ -30186,7 +30186,7 @@ function pick(obj, keys) {
30186
30186
  }, {});
30187
30187
  }
30188
30188
 
30189
- function hasOwnProperty$1(obj, prop) {
30189
+ function hasOwnProperty$2(obj, prop) {
30190
30190
  return Object.prototype.hasOwnProperty.call(obj, prop);
30191
30191
  }
30192
30192
 
@@ -30354,7 +30354,7 @@ function asNumber(value) {
30354
30354
  function normalizeObject(obj, normalizer) {
30355
30355
  const normalized = {};
30356
30356
  for (const u in obj) {
30357
- if (hasOwnProperty$1(obj, u)) {
30357
+ if (hasOwnProperty$2(obj, u)) {
30358
30358
  const v = obj[u];
30359
30359
  if (v === undefined || v === null) continue;
30360
30360
  normalized[normalizer(u)] = asNumber(v);
@@ -32923,7 +32923,7 @@ class Duration {
32923
32923
  result = {};
32924
32924
 
32925
32925
  for (const k of orderedUnits$1) {
32926
- if (hasOwnProperty$1(dur.values, k) || hasOwnProperty$1(this.values, k)) {
32926
+ if (hasOwnProperty$2(dur.values, k) || hasOwnProperty$2(this.values, k)) {
32927
32927
  result[k] = dur.get(k) + this.get(k);
32928
32928
  }
32929
32929
  }
@@ -34408,7 +34408,7 @@ function match(input, regex, handlers) {
34408
34408
  const all = {};
34409
34409
  let matchIndex = 1;
34410
34410
  for (const i in handlers) {
34411
- if (hasOwnProperty$1(handlers, i)) {
34411
+ if (hasOwnProperty$2(handlers, i)) {
34412
34412
  const h = handlers[i],
34413
34413
  groups = h.groups ? h.groups + 1 : 1;
34414
34414
  if (!h.literal && h.token) {
@@ -34558,7 +34558,7 @@ function explainFromTokens(locale, input, format) {
34558
34558
  [result, zone, specificOffset] = matches
34559
34559
  ? dateTimeFromMatches(matches)
34560
34560
  : [null, null, undefined];
34561
- if (hasOwnProperty$1(matches, "a") && hasOwnProperty$1(matches, "H")) {
34561
+ if (hasOwnProperty$2(matches, "a") && hasOwnProperty$2(matches, "H")) {
34562
34562
  throw new ConflictingSpecificationError(
34563
34563
  "Can't include meridiem when specifying 24-hour format"
34564
34564
  );
@@ -37945,6 +37945,1369 @@ VFileMessage$1.prototype.source = null;
37945
37945
  VFileMessage$1.prototype.ruleId = null;
37946
37946
  VFileMessage$1.prototype.position = null;
37947
37947
 
37948
+ // for now just expose the builtin process global from node.js
37949
+ var process$1 = commonjsGlobal.process;
37950
+
37951
+ var url = {};
37952
+
37953
+ var punycode$1 = {exports: {}};
37954
+
37955
+ /*! https://mths.be/punycode v1.3.2 by @mathias */
37956
+
37957
+ (function (module, exports) {
37958
+ (function(root) {
37959
+
37960
+ /** Detect free variables */
37961
+ var freeExports = exports &&
37962
+ !exports.nodeType && exports;
37963
+ var freeModule = module &&
37964
+ !module.nodeType && module;
37965
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
37966
+ if (
37967
+ freeGlobal.global === freeGlobal ||
37968
+ freeGlobal.window === freeGlobal ||
37969
+ freeGlobal.self === freeGlobal
37970
+ ) {
37971
+ root = freeGlobal;
37972
+ }
37973
+
37974
+ /**
37975
+ * The `punycode` object.
37976
+ * @name punycode
37977
+ * @type Object
37978
+ */
37979
+ var punycode,
37980
+
37981
+ /** Highest positive signed 32-bit float value */
37982
+ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
37983
+
37984
+ /** Bootstring parameters */
37985
+ base = 36,
37986
+ tMin = 1,
37987
+ tMax = 26,
37988
+ skew = 38,
37989
+ damp = 700,
37990
+ initialBias = 72,
37991
+ initialN = 128, // 0x80
37992
+ delimiter = '-', // '\x2D'
37993
+
37994
+ /** Regular expressions */
37995
+ regexPunycode = /^xn--/,
37996
+ regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
37997
+ regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
37998
+
37999
+ /** Error messages */
38000
+ errors = {
38001
+ 'overflow': 'Overflow: input needs wider integers to process',
38002
+ 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
38003
+ 'invalid-input': 'Invalid input'
38004
+ },
38005
+
38006
+ /** Convenience shortcuts */
38007
+ baseMinusTMin = base - tMin,
38008
+ floor = Math.floor,
38009
+ stringFromCharCode = String.fromCharCode,
38010
+
38011
+ /** Temporary variable */
38012
+ key;
38013
+
38014
+ /*--------------------------------------------------------------------------*/
38015
+
38016
+ /**
38017
+ * A generic error utility function.
38018
+ * @private
38019
+ * @param {String} type The error type.
38020
+ * @returns {Error} Throws a `RangeError` with the applicable error message.
38021
+ */
38022
+ function error(type) {
38023
+ throw RangeError(errors[type]);
38024
+ }
38025
+
38026
+ /**
38027
+ * A generic `Array#map` utility function.
38028
+ * @private
38029
+ * @param {Array} array The array to iterate over.
38030
+ * @param {Function} callback The function that gets called for every array
38031
+ * item.
38032
+ * @returns {Array} A new array of values returned by the callback function.
38033
+ */
38034
+ function map(array, fn) {
38035
+ var length = array.length;
38036
+ var result = [];
38037
+ while (length--) {
38038
+ result[length] = fn(array[length]);
38039
+ }
38040
+ return result;
38041
+ }
38042
+
38043
+ /**
38044
+ * A simple `Array#map`-like wrapper to work with domain name strings or email
38045
+ * addresses.
38046
+ * @private
38047
+ * @param {String} domain The domain name or email address.
38048
+ * @param {Function} callback The function that gets called for every
38049
+ * character.
38050
+ * @returns {Array} A new string of characters returned by the callback
38051
+ * function.
38052
+ */
38053
+ function mapDomain(string, fn) {
38054
+ var parts = string.split('@');
38055
+ var result = '';
38056
+ if (parts.length > 1) {
38057
+ // In email addresses, only the domain name should be punycoded. Leave
38058
+ // the local part (i.e. everything up to `@`) intact.
38059
+ result = parts[0] + '@';
38060
+ string = parts[1];
38061
+ }
38062
+ // Avoid `split(regex)` for IE8 compatibility. See #17.
38063
+ string = string.replace(regexSeparators, '\x2E');
38064
+ var labels = string.split('.');
38065
+ var encoded = map(labels, fn).join('.');
38066
+ return result + encoded;
38067
+ }
38068
+
38069
+ /**
38070
+ * Creates an array containing the numeric code points of each Unicode
38071
+ * character in the string. While JavaScript uses UCS-2 internally,
38072
+ * this function will convert a pair of surrogate halves (each of which
38073
+ * UCS-2 exposes as separate characters) into a single code point,
38074
+ * matching UTF-16.
38075
+ * @see `punycode.ucs2.encode`
38076
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
38077
+ * @memberOf punycode.ucs2
38078
+ * @name decode
38079
+ * @param {String} string The Unicode input string (UCS-2).
38080
+ * @returns {Array} The new array of code points.
38081
+ */
38082
+ function ucs2decode(string) {
38083
+ var output = [],
38084
+ counter = 0,
38085
+ length = string.length,
38086
+ value,
38087
+ extra;
38088
+ while (counter < length) {
38089
+ value = string.charCodeAt(counter++);
38090
+ if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
38091
+ // high surrogate, and there is a next character
38092
+ extra = string.charCodeAt(counter++);
38093
+ if ((extra & 0xFC00) == 0xDC00) { // low surrogate
38094
+ output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
38095
+ } else {
38096
+ // unmatched surrogate; only append this code unit, in case the next
38097
+ // code unit is the high surrogate of a surrogate pair
38098
+ output.push(value);
38099
+ counter--;
38100
+ }
38101
+ } else {
38102
+ output.push(value);
38103
+ }
38104
+ }
38105
+ return output;
38106
+ }
38107
+
38108
+ /**
38109
+ * Creates a string based on an array of numeric code points.
38110
+ * @see `punycode.ucs2.decode`
38111
+ * @memberOf punycode.ucs2
38112
+ * @name encode
38113
+ * @param {Array} codePoints The array of numeric code points.
38114
+ * @returns {String} The new Unicode string (UCS-2).
38115
+ */
38116
+ function ucs2encode(array) {
38117
+ return map(array, function(value) {
38118
+ var output = '';
38119
+ if (value > 0xFFFF) {
38120
+ value -= 0x10000;
38121
+ output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
38122
+ value = 0xDC00 | value & 0x3FF;
38123
+ }
38124
+ output += stringFromCharCode(value);
38125
+ return output;
38126
+ }).join('');
38127
+ }
38128
+
38129
+ /**
38130
+ * Converts a basic code point into a digit/integer.
38131
+ * @see `digitToBasic()`
38132
+ * @private
38133
+ * @param {Number} codePoint The basic numeric code point value.
38134
+ * @returns {Number} The numeric value of a basic code point (for use in
38135
+ * representing integers) in the range `0` to `base - 1`, or `base` if
38136
+ * the code point does not represent a value.
38137
+ */
38138
+ function basicToDigit(codePoint) {
38139
+ if (codePoint - 48 < 10) {
38140
+ return codePoint - 22;
38141
+ }
38142
+ if (codePoint - 65 < 26) {
38143
+ return codePoint - 65;
38144
+ }
38145
+ if (codePoint - 97 < 26) {
38146
+ return codePoint - 97;
38147
+ }
38148
+ return base;
38149
+ }
38150
+
38151
+ /**
38152
+ * Converts a digit/integer into a basic code point.
38153
+ * @see `basicToDigit()`
38154
+ * @private
38155
+ * @param {Number} digit The numeric value of a basic code point.
38156
+ * @returns {Number} The basic code point whose value (when used for
38157
+ * representing integers) is `digit`, which needs to be in the range
38158
+ * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
38159
+ * used; else, the lowercase form is used. The behavior is undefined
38160
+ * if `flag` is non-zero and `digit` has no uppercase form.
38161
+ */
38162
+ function digitToBasic(digit, flag) {
38163
+ // 0..25 map to ASCII a..z or A..Z
38164
+ // 26..35 map to ASCII 0..9
38165
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
38166
+ }
38167
+
38168
+ /**
38169
+ * Bias adaptation function as per section 3.4 of RFC 3492.
38170
+ * http://tools.ietf.org/html/rfc3492#section-3.4
38171
+ * @private
38172
+ */
38173
+ function adapt(delta, numPoints, firstTime) {
38174
+ var k = 0;
38175
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
38176
+ delta += floor(delta / numPoints);
38177
+ for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
38178
+ delta = floor(delta / baseMinusTMin);
38179
+ }
38180
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
38181
+ }
38182
+
38183
+ /**
38184
+ * Converts a Punycode string of ASCII-only symbols to a string of Unicode
38185
+ * symbols.
38186
+ * @memberOf punycode
38187
+ * @param {String} input The Punycode string of ASCII-only symbols.
38188
+ * @returns {String} The resulting string of Unicode symbols.
38189
+ */
38190
+ function decode(input) {
38191
+ // Don't use UCS-2
38192
+ var output = [],
38193
+ inputLength = input.length,
38194
+ out,
38195
+ i = 0,
38196
+ n = initialN,
38197
+ bias = initialBias,
38198
+ basic,
38199
+ j,
38200
+ index,
38201
+ oldi,
38202
+ w,
38203
+ k,
38204
+ digit,
38205
+ t,
38206
+ /** Cached calculation results */
38207
+ baseMinusT;
38208
+
38209
+ // Handle the basic code points: let `basic` be the number of input code
38210
+ // points before the last delimiter, or `0` if there is none, then copy
38211
+ // the first basic code points to the output.
38212
+
38213
+ basic = input.lastIndexOf(delimiter);
38214
+ if (basic < 0) {
38215
+ basic = 0;
38216
+ }
38217
+
38218
+ for (j = 0; j < basic; ++j) {
38219
+ // if it's not a basic code point
38220
+ if (input.charCodeAt(j) >= 0x80) {
38221
+ error('not-basic');
38222
+ }
38223
+ output.push(input.charCodeAt(j));
38224
+ }
38225
+
38226
+ // Main decoding loop: start just after the last delimiter if any basic code
38227
+ // points were copied; start at the beginning otherwise.
38228
+
38229
+ for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
38230
+
38231
+ // `index` is the index of the next character to be consumed.
38232
+ // Decode a generalized variable-length integer into `delta`,
38233
+ // which gets added to `i`. The overflow checking is easier
38234
+ // if we increase `i` as we go, then subtract off its starting
38235
+ // value at the end to obtain `delta`.
38236
+ for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
38237
+
38238
+ if (index >= inputLength) {
38239
+ error('invalid-input');
38240
+ }
38241
+
38242
+ digit = basicToDigit(input.charCodeAt(index++));
38243
+
38244
+ if (digit >= base || digit > floor((maxInt - i) / w)) {
38245
+ error('overflow');
38246
+ }
38247
+
38248
+ i += digit * w;
38249
+ t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
38250
+
38251
+ if (digit < t) {
38252
+ break;
38253
+ }
38254
+
38255
+ baseMinusT = base - t;
38256
+ if (w > floor(maxInt / baseMinusT)) {
38257
+ error('overflow');
38258
+ }
38259
+
38260
+ w *= baseMinusT;
38261
+
38262
+ }
38263
+
38264
+ out = output.length + 1;
38265
+ bias = adapt(i - oldi, out, oldi == 0);
38266
+
38267
+ // `i` was supposed to wrap around from `out` to `0`,
38268
+ // incrementing `n` each time, so we'll fix that now:
38269
+ if (floor(i / out) > maxInt - n) {
38270
+ error('overflow');
38271
+ }
38272
+
38273
+ n += floor(i / out);
38274
+ i %= out;
38275
+
38276
+ // Insert `n` at position `i` of the output
38277
+ output.splice(i++, 0, n);
38278
+
38279
+ }
38280
+
38281
+ return ucs2encode(output);
38282
+ }
38283
+
38284
+ /**
38285
+ * Converts a string of Unicode symbols (e.g. a domain name label) to a
38286
+ * Punycode string of ASCII-only symbols.
38287
+ * @memberOf punycode
38288
+ * @param {String} input The string of Unicode symbols.
38289
+ * @returns {String} The resulting Punycode string of ASCII-only symbols.
38290
+ */
38291
+ function encode(input) {
38292
+ var n,
38293
+ delta,
38294
+ handledCPCount,
38295
+ basicLength,
38296
+ bias,
38297
+ j,
38298
+ m,
38299
+ q,
38300
+ k,
38301
+ t,
38302
+ currentValue,
38303
+ output = [],
38304
+ /** `inputLength` will hold the number of code points in `input`. */
38305
+ inputLength,
38306
+ /** Cached calculation results */
38307
+ handledCPCountPlusOne,
38308
+ baseMinusT,
38309
+ qMinusT;
38310
+
38311
+ // Convert the input in UCS-2 to Unicode
38312
+ input = ucs2decode(input);
38313
+
38314
+ // Cache the length
38315
+ inputLength = input.length;
38316
+
38317
+ // Initialize the state
38318
+ n = initialN;
38319
+ delta = 0;
38320
+ bias = initialBias;
38321
+
38322
+ // Handle the basic code points
38323
+ for (j = 0; j < inputLength; ++j) {
38324
+ currentValue = input[j];
38325
+ if (currentValue < 0x80) {
38326
+ output.push(stringFromCharCode(currentValue));
38327
+ }
38328
+ }
38329
+
38330
+ handledCPCount = basicLength = output.length;
38331
+
38332
+ // `handledCPCount` is the number of code points that have been handled;
38333
+ // `basicLength` is the number of basic code points.
38334
+
38335
+ // Finish the basic string - if it is not empty - with a delimiter
38336
+ if (basicLength) {
38337
+ output.push(delimiter);
38338
+ }
38339
+
38340
+ // Main encoding loop:
38341
+ while (handledCPCount < inputLength) {
38342
+
38343
+ // All non-basic code points < n have been handled already. Find the next
38344
+ // larger one:
38345
+ for (m = maxInt, j = 0; j < inputLength; ++j) {
38346
+ currentValue = input[j];
38347
+ if (currentValue >= n && currentValue < m) {
38348
+ m = currentValue;
38349
+ }
38350
+ }
38351
+
38352
+ // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
38353
+ // but guard against overflow
38354
+ handledCPCountPlusOne = handledCPCount + 1;
38355
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
38356
+ error('overflow');
38357
+ }
38358
+
38359
+ delta += (m - n) * handledCPCountPlusOne;
38360
+ n = m;
38361
+
38362
+ for (j = 0; j < inputLength; ++j) {
38363
+ currentValue = input[j];
38364
+
38365
+ if (currentValue < n && ++delta > maxInt) {
38366
+ error('overflow');
38367
+ }
38368
+
38369
+ if (currentValue == n) {
38370
+ // Represent delta as a generalized variable-length integer
38371
+ for (q = delta, k = base; /* no condition */; k += base) {
38372
+ t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
38373
+ if (q < t) {
38374
+ break;
38375
+ }
38376
+ qMinusT = q - t;
38377
+ baseMinusT = base - t;
38378
+ output.push(
38379
+ stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
38380
+ );
38381
+ q = floor(qMinusT / baseMinusT);
38382
+ }
38383
+
38384
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
38385
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
38386
+ delta = 0;
38387
+ ++handledCPCount;
38388
+ }
38389
+ }
38390
+
38391
+ ++delta;
38392
+ ++n;
38393
+
38394
+ }
38395
+ return output.join('');
38396
+ }
38397
+
38398
+ /**
38399
+ * Converts a Punycode string representing a domain name or an email address
38400
+ * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
38401
+ * it doesn't matter if you call it on a string that has already been
38402
+ * converted to Unicode.
38403
+ * @memberOf punycode
38404
+ * @param {String} input The Punycoded domain name or email address to
38405
+ * convert to Unicode.
38406
+ * @returns {String} The Unicode representation of the given Punycode
38407
+ * string.
38408
+ */
38409
+ function toUnicode(input) {
38410
+ return mapDomain(input, function(string) {
38411
+ return regexPunycode.test(string)
38412
+ ? decode(string.slice(4).toLowerCase())
38413
+ : string;
38414
+ });
38415
+ }
38416
+
38417
+ /**
38418
+ * Converts a Unicode string representing a domain name or an email address to
38419
+ * Punycode. Only the non-ASCII parts of the domain name will be converted,
38420
+ * i.e. it doesn't matter if you call it with a domain that's already in
38421
+ * ASCII.
38422
+ * @memberOf punycode
38423
+ * @param {String} input The domain name or email address to convert, as a
38424
+ * Unicode string.
38425
+ * @returns {String} The Punycode representation of the given domain name or
38426
+ * email address.
38427
+ */
38428
+ function toASCII(input) {
38429
+ return mapDomain(input, function(string) {
38430
+ return regexNonASCII.test(string)
38431
+ ? 'xn--' + encode(string)
38432
+ : string;
38433
+ });
38434
+ }
38435
+
38436
+ /*--------------------------------------------------------------------------*/
38437
+
38438
+ /** Define the public API */
38439
+ punycode = {
38440
+ /**
38441
+ * A string representing the current Punycode.js version number.
38442
+ * @memberOf punycode
38443
+ * @type String
38444
+ */
38445
+ 'version': '1.3.2',
38446
+ /**
38447
+ * An object of methods to convert from JavaScript's internal character
38448
+ * representation (UCS-2) to Unicode code points, and back.
38449
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
38450
+ * @memberOf punycode
38451
+ * @type Object
38452
+ */
38453
+ 'ucs2': {
38454
+ 'decode': ucs2decode,
38455
+ 'encode': ucs2encode
38456
+ },
38457
+ 'decode': decode,
38458
+ 'encode': encode,
38459
+ 'toASCII': toASCII,
38460
+ 'toUnicode': toUnicode
38461
+ };
38462
+
38463
+ /** Expose `punycode` */
38464
+ // Some AMD build optimizers, like r.js, check for specific condition patterns
38465
+ // like the following:
38466
+ if (freeExports && freeModule) {
38467
+ if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+
38468
+ freeModule.exports = punycode;
38469
+ } else { // in Narwhal or RingoJS v0.7.0-
38470
+ for (key in punycode) {
38471
+ punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
38472
+ }
38473
+ }
38474
+ } else { // in Rhino or a web browser
38475
+ root.punycode = punycode;
38476
+ }
38477
+
38478
+ }(commonjsGlobal));
38479
+ } (punycode$1, punycode$1.exports));
38480
+
38481
+ var util$1 = {
38482
+ isString: function(arg) {
38483
+ return typeof(arg) === 'string';
38484
+ },
38485
+ isObject: function(arg) {
38486
+ return typeof(arg) === 'object' && arg !== null;
38487
+ },
38488
+ isNull: function(arg) {
38489
+ return arg === null;
38490
+ },
38491
+ isNullOrUndefined: function(arg) {
38492
+ return arg == null;
38493
+ }
38494
+ };
38495
+
38496
+ var querystring$1 = {};
38497
+
38498
+ // If obj.hasOwnProperty has been overridden, then calling
38499
+ // obj.hasOwnProperty(prop) will break.
38500
+ // See: https://github.com/joyent/node/issues/1707
38501
+ function hasOwnProperty$1(obj, prop) {
38502
+ return Object.prototype.hasOwnProperty.call(obj, prop);
38503
+ }
38504
+
38505
+ var decode$1 = function(qs, sep, eq, options) {
38506
+ sep = sep || '&';
38507
+ eq = eq || '=';
38508
+ var obj = {};
38509
+
38510
+ if (typeof qs !== 'string' || qs.length === 0) {
38511
+ return obj;
38512
+ }
38513
+
38514
+ var regexp = /\+/g;
38515
+ qs = qs.split(sep);
38516
+
38517
+ var maxKeys = 1000;
38518
+ if (options && typeof options.maxKeys === 'number') {
38519
+ maxKeys = options.maxKeys;
38520
+ }
38521
+
38522
+ var len = qs.length;
38523
+ // maxKeys <= 0 means that we should not limit keys count
38524
+ if (maxKeys > 0 && len > maxKeys) {
38525
+ len = maxKeys;
38526
+ }
38527
+
38528
+ for (var i = 0; i < len; ++i) {
38529
+ var x = qs[i].replace(regexp, '%20'),
38530
+ idx = x.indexOf(eq),
38531
+ kstr, vstr, k, v;
38532
+
38533
+ if (idx >= 0) {
38534
+ kstr = x.substr(0, idx);
38535
+ vstr = x.substr(idx + 1);
38536
+ } else {
38537
+ kstr = x;
38538
+ vstr = '';
38539
+ }
38540
+
38541
+ k = decodeURIComponent(kstr);
38542
+ v = decodeURIComponent(vstr);
38543
+
38544
+ if (!hasOwnProperty$1(obj, k)) {
38545
+ obj[k] = v;
38546
+ } else if (Array.isArray(obj[k])) {
38547
+ obj[k].push(v);
38548
+ } else {
38549
+ obj[k] = [obj[k], v];
38550
+ }
38551
+ }
38552
+
38553
+ return obj;
38554
+ };
38555
+
38556
+ var stringifyPrimitive = function(v) {
38557
+ switch (typeof v) {
38558
+ case 'string':
38559
+ return v;
38560
+
38561
+ case 'boolean':
38562
+ return v ? 'true' : 'false';
38563
+
38564
+ case 'number':
38565
+ return isFinite(v) ? v : '';
38566
+
38567
+ default:
38568
+ return '';
38569
+ }
38570
+ };
38571
+
38572
+ var encode$2 = function(obj, sep, eq, name) {
38573
+ sep = sep || '&';
38574
+ eq = eq || '=';
38575
+ if (obj === null) {
38576
+ obj = undefined;
38577
+ }
38578
+
38579
+ if (typeof obj === 'object') {
38580
+ return Object.keys(obj).map(function(k) {
38581
+ var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
38582
+ if (Array.isArray(obj[k])) {
38583
+ return obj[k].map(function(v) {
38584
+ return ks + encodeURIComponent(stringifyPrimitive(v));
38585
+ }).join(sep);
38586
+ } else {
38587
+ return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
38588
+ }
38589
+ }).join(sep);
38590
+
38591
+ }
38592
+
38593
+ if (!name) return '';
38594
+ return encodeURIComponent(stringifyPrimitive(name)) + eq +
38595
+ encodeURIComponent(stringifyPrimitive(obj));
38596
+ };
38597
+
38598
+ querystring$1.decode = querystring$1.parse = decode$1;
38599
+ querystring$1.encode = querystring$1.stringify = encode$2;
38600
+
38601
+ var punycode = punycode$1.exports;
38602
+ var util = util$1;
38603
+
38604
+ url.parse = urlParse;
38605
+ url.resolve = urlResolve;
38606
+ url.resolveObject = urlResolveObject;
38607
+ url.format = urlFormat;
38608
+
38609
+ url.Url = Url;
38610
+
38611
+ function Url() {
38612
+ this.protocol = null;
38613
+ this.slashes = null;
38614
+ this.auth = null;
38615
+ this.host = null;
38616
+ this.port = null;
38617
+ this.hostname = null;
38618
+ this.hash = null;
38619
+ this.search = null;
38620
+ this.query = null;
38621
+ this.pathname = null;
38622
+ this.path = null;
38623
+ this.href = null;
38624
+ }
38625
+
38626
+ // Reference: RFC 3986, RFC 1808, RFC 2396
38627
+
38628
+ // define these here so at least they only have to be
38629
+ // compiled once on the first module load.
38630
+ var protocolPattern = /^([a-z0-9.+-]+:)/i,
38631
+ portPattern = /:[0-9]*$/,
38632
+
38633
+ // Special case for a simple path URL
38634
+ simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
38635
+
38636
+ // RFC 2396: characters reserved for delimiting URLs.
38637
+ // We actually just auto-escape these.
38638
+ delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
38639
+
38640
+ // RFC 2396: characters not allowed for various reasons.
38641
+ unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
38642
+
38643
+ // Allowed by RFCs, but cause of XSS attacks. Always escape these.
38644
+ autoEscape = ['\''].concat(unwise),
38645
+ // Characters that are never ever allowed in a hostname.
38646
+ // Note that any invalid chars are also handled, but these
38647
+ // are the ones that are *expected* to be seen, so we fast-path
38648
+ // them.
38649
+ nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
38650
+ hostEndingChars = ['/', '?', '#'],
38651
+ hostnameMaxLen = 255,
38652
+ hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
38653
+ hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
38654
+ // protocols that can allow "unsafe" and "unwise" chars.
38655
+ unsafeProtocol = {
38656
+ 'javascript': true,
38657
+ 'javascript:': true
38658
+ },
38659
+ // protocols that never have a hostname.
38660
+ hostlessProtocol = {
38661
+ 'javascript': true,
38662
+ 'javascript:': true
38663
+ },
38664
+ // protocols that always contain a // bit.
38665
+ slashedProtocol = {
38666
+ 'http': true,
38667
+ 'https': true,
38668
+ 'ftp': true,
38669
+ 'gopher': true,
38670
+ 'file': true,
38671
+ 'http:': true,
38672
+ 'https:': true,
38673
+ 'ftp:': true,
38674
+ 'gopher:': true,
38675
+ 'file:': true
38676
+ },
38677
+ querystring = querystring$1;
38678
+
38679
+ function urlParse(url, parseQueryString, slashesDenoteHost) {
38680
+ if (url && util.isObject(url) && url instanceof Url) return url;
38681
+
38682
+ var u = new Url;
38683
+ u.parse(url, parseQueryString, slashesDenoteHost);
38684
+ return u;
38685
+ }
38686
+
38687
+ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
38688
+ if (!util.isString(url)) {
38689
+ throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
38690
+ }
38691
+
38692
+ // Copy chrome, IE, opera backslash-handling behavior.
38693
+ // Back slashes before the query string get converted to forward slashes
38694
+ // See: https://code.google.com/p/chromium/issues/detail?id=25916
38695
+ var queryIndex = url.indexOf('?'),
38696
+ splitter =
38697
+ (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
38698
+ uSplit = url.split(splitter),
38699
+ slashRegex = /\\/g;
38700
+ uSplit[0] = uSplit[0].replace(slashRegex, '/');
38701
+ url = uSplit.join(splitter);
38702
+
38703
+ var rest = url;
38704
+
38705
+ // trim before proceeding.
38706
+ // This is to support parse stuff like " http://foo.com \n"
38707
+ rest = rest.trim();
38708
+
38709
+ if (!slashesDenoteHost && url.split('#').length === 1) {
38710
+ // Try fast path regexp
38711
+ var simplePath = simplePathPattern.exec(rest);
38712
+ if (simplePath) {
38713
+ this.path = rest;
38714
+ this.href = rest;
38715
+ this.pathname = simplePath[1];
38716
+ if (simplePath[2]) {
38717
+ this.search = simplePath[2];
38718
+ if (parseQueryString) {
38719
+ this.query = querystring.parse(this.search.substr(1));
38720
+ } else {
38721
+ this.query = this.search.substr(1);
38722
+ }
38723
+ } else if (parseQueryString) {
38724
+ this.search = '';
38725
+ this.query = {};
38726
+ }
38727
+ return this;
38728
+ }
38729
+ }
38730
+
38731
+ var proto = protocolPattern.exec(rest);
38732
+ if (proto) {
38733
+ proto = proto[0];
38734
+ var lowerProto = proto.toLowerCase();
38735
+ this.protocol = lowerProto;
38736
+ rest = rest.substr(proto.length);
38737
+ }
38738
+
38739
+ // figure out if it's got a host
38740
+ // user@server is *always* interpreted as a hostname, and url
38741
+ // resolution will treat //foo/bar as host=foo,path=bar because that's
38742
+ // how the browser resolves relative URLs.
38743
+ if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
38744
+ var slashes = rest.substr(0, 2) === '//';
38745
+ if (slashes && !(proto && hostlessProtocol[proto])) {
38746
+ rest = rest.substr(2);
38747
+ this.slashes = true;
38748
+ }
38749
+ }
38750
+
38751
+ if (!hostlessProtocol[proto] &&
38752
+ (slashes || (proto && !slashedProtocol[proto]))) {
38753
+
38754
+ // there's a hostname.
38755
+ // the first instance of /, ?, ;, or # ends the host.
38756
+ //
38757
+ // If there is an @ in the hostname, then non-host chars *are* allowed
38758
+ // to the left of the last @ sign, unless some host-ending character
38759
+ // comes *before* the @-sign.
38760
+ // URLs are obnoxious.
38761
+ //
38762
+ // ex:
38763
+ // http://a@b@c/ => user:a@b host:c
38764
+ // http://a@b?@c => user:a host:c path:/?@c
38765
+
38766
+ // v0.12 TODO(isaacs): This is not quite how Chrome does things.
38767
+ // Review our test case against browsers more comprehensively.
38768
+
38769
+ // find the first instance of any hostEndingChars
38770
+ var hostEnd = -1;
38771
+ for (var i = 0; i < hostEndingChars.length; i++) {
38772
+ var hec = rest.indexOf(hostEndingChars[i]);
38773
+ if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
38774
+ hostEnd = hec;
38775
+ }
38776
+
38777
+ // at this point, either we have an explicit point where the
38778
+ // auth portion cannot go past, or the last @ char is the decider.
38779
+ var auth, atSign;
38780
+ if (hostEnd === -1) {
38781
+ // atSign can be anywhere.
38782
+ atSign = rest.lastIndexOf('@');
38783
+ } else {
38784
+ // atSign must be in auth portion.
38785
+ // http://a@b/c@d => host:b auth:a path:/c@d
38786
+ atSign = rest.lastIndexOf('@', hostEnd);
38787
+ }
38788
+
38789
+ // Now we have a portion which is definitely the auth.
38790
+ // Pull that off.
38791
+ if (atSign !== -1) {
38792
+ auth = rest.slice(0, atSign);
38793
+ rest = rest.slice(atSign + 1);
38794
+ this.auth = decodeURIComponent(auth);
38795
+ }
38796
+
38797
+ // the host is the remaining to the left of the first non-host char
38798
+ hostEnd = -1;
38799
+ for (var i = 0; i < nonHostChars.length; i++) {
38800
+ var hec = rest.indexOf(nonHostChars[i]);
38801
+ if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
38802
+ hostEnd = hec;
38803
+ }
38804
+ // if we still have not hit it, then the entire thing is a host.
38805
+ if (hostEnd === -1)
38806
+ hostEnd = rest.length;
38807
+
38808
+ this.host = rest.slice(0, hostEnd);
38809
+ rest = rest.slice(hostEnd);
38810
+
38811
+ // pull out port.
38812
+ this.parseHost();
38813
+
38814
+ // we've indicated that there is a hostname,
38815
+ // so even if it's empty, it has to be present.
38816
+ this.hostname = this.hostname || '';
38817
+
38818
+ // if hostname begins with [ and ends with ]
38819
+ // assume that it's an IPv6 address.
38820
+ var ipv6Hostname = this.hostname[0] === '[' &&
38821
+ this.hostname[this.hostname.length - 1] === ']';
38822
+
38823
+ // validate a little.
38824
+ if (!ipv6Hostname) {
38825
+ var hostparts = this.hostname.split(/\./);
38826
+ for (var i = 0, l = hostparts.length; i < l; i++) {
38827
+ var part = hostparts[i];
38828
+ if (!part) continue;
38829
+ if (!part.match(hostnamePartPattern)) {
38830
+ var newpart = '';
38831
+ for (var j = 0, k = part.length; j < k; j++) {
38832
+ if (part.charCodeAt(j) > 127) {
38833
+ // we replace non-ASCII char with a temporary placeholder
38834
+ // we need this to make sure size of hostname is not
38835
+ // broken by replacing non-ASCII by nothing
38836
+ newpart += 'x';
38837
+ } else {
38838
+ newpart += part[j];
38839
+ }
38840
+ }
38841
+ // we test again with ASCII char only
38842
+ if (!newpart.match(hostnamePartPattern)) {
38843
+ var validParts = hostparts.slice(0, i);
38844
+ var notHost = hostparts.slice(i + 1);
38845
+ var bit = part.match(hostnamePartStart);
38846
+ if (bit) {
38847
+ validParts.push(bit[1]);
38848
+ notHost.unshift(bit[2]);
38849
+ }
38850
+ if (notHost.length) {
38851
+ rest = '/' + notHost.join('.') + rest;
38852
+ }
38853
+ this.hostname = validParts.join('.');
38854
+ break;
38855
+ }
38856
+ }
38857
+ }
38858
+ }
38859
+
38860
+ if (this.hostname.length > hostnameMaxLen) {
38861
+ this.hostname = '';
38862
+ } else {
38863
+ // hostnames are always lower case.
38864
+ this.hostname = this.hostname.toLowerCase();
38865
+ }
38866
+
38867
+ if (!ipv6Hostname) {
38868
+ // IDNA Support: Returns a punycoded representation of "domain".
38869
+ // It only converts parts of the domain name that
38870
+ // have non-ASCII characters, i.e. it doesn't matter if
38871
+ // you call it with a domain that already is ASCII-only.
38872
+ this.hostname = punycode.toASCII(this.hostname);
38873
+ }
38874
+
38875
+ var p = this.port ? ':' + this.port : '';
38876
+ var h = this.hostname || '';
38877
+ this.host = h + p;
38878
+ this.href += this.host;
38879
+
38880
+ // strip [ and ] from the hostname
38881
+ // the host field still retains them, though
38882
+ if (ipv6Hostname) {
38883
+ this.hostname = this.hostname.substr(1, this.hostname.length - 2);
38884
+ if (rest[0] !== '/') {
38885
+ rest = '/' + rest;
38886
+ }
38887
+ }
38888
+ }
38889
+
38890
+ // now rest is set to the post-host stuff.
38891
+ // chop off any delim chars.
38892
+ if (!unsafeProtocol[lowerProto]) {
38893
+
38894
+ // First, make 100% sure that any "autoEscape" chars get
38895
+ // escaped, even if encodeURIComponent doesn't think they
38896
+ // need to be.
38897
+ for (var i = 0, l = autoEscape.length; i < l; i++) {
38898
+ var ae = autoEscape[i];
38899
+ if (rest.indexOf(ae) === -1)
38900
+ continue;
38901
+ var esc = encodeURIComponent(ae);
38902
+ if (esc === ae) {
38903
+ esc = escape(ae);
38904
+ }
38905
+ rest = rest.split(ae).join(esc);
38906
+ }
38907
+ }
38908
+
38909
+
38910
+ // chop off from the tail first.
38911
+ var hash = rest.indexOf('#');
38912
+ if (hash !== -1) {
38913
+ // got a fragment string.
38914
+ this.hash = rest.substr(hash);
38915
+ rest = rest.slice(0, hash);
38916
+ }
38917
+ var qm = rest.indexOf('?');
38918
+ if (qm !== -1) {
38919
+ this.search = rest.substr(qm);
38920
+ this.query = rest.substr(qm + 1);
38921
+ if (parseQueryString) {
38922
+ this.query = querystring.parse(this.query);
38923
+ }
38924
+ rest = rest.slice(0, qm);
38925
+ } else if (parseQueryString) {
38926
+ // no query string, but parseQueryString still requested
38927
+ this.search = '';
38928
+ this.query = {};
38929
+ }
38930
+ if (rest) this.pathname = rest;
38931
+ if (slashedProtocol[lowerProto] &&
38932
+ this.hostname && !this.pathname) {
38933
+ this.pathname = '/';
38934
+ }
38935
+
38936
+ //to support http.request
38937
+ if (this.pathname || this.search) {
38938
+ var p = this.pathname || '';
38939
+ var s = this.search || '';
38940
+ this.path = p + s;
38941
+ }
38942
+
38943
+ // finally, reconstruct the href based on what has been validated.
38944
+ this.href = this.format();
38945
+ return this;
38946
+ };
38947
+
38948
+ // format a parsed object into a url string
38949
+ function urlFormat(obj) {
38950
+ // ensure it's an object, and not a string url.
38951
+ // If it's an obj, this is a no-op.
38952
+ // this way, you can call url_format() on strings
38953
+ // to clean up potentially wonky urls.
38954
+ if (util.isString(obj)) obj = urlParse(obj);
38955
+ if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
38956
+ return obj.format();
38957
+ }
38958
+
38959
+ Url.prototype.format = function() {
38960
+ var auth = this.auth || '';
38961
+ if (auth) {
38962
+ auth = encodeURIComponent(auth);
38963
+ auth = auth.replace(/%3A/i, ':');
38964
+ auth += '@';
38965
+ }
38966
+
38967
+ var protocol = this.protocol || '',
38968
+ pathname = this.pathname || '',
38969
+ hash = this.hash || '',
38970
+ host = false,
38971
+ query = '';
38972
+
38973
+ if (this.host) {
38974
+ host = auth + this.host;
38975
+ } else if (this.hostname) {
38976
+ host = auth + (this.hostname.indexOf(':') === -1 ?
38977
+ this.hostname :
38978
+ '[' + this.hostname + ']');
38979
+ if (this.port) {
38980
+ host += ':' + this.port;
38981
+ }
38982
+ }
38983
+
38984
+ if (this.query &&
38985
+ util.isObject(this.query) &&
38986
+ Object.keys(this.query).length) {
38987
+ query = querystring.stringify(this.query);
38988
+ }
38989
+
38990
+ var search = this.search || (query && ('?' + query)) || '';
38991
+
38992
+ if (protocol && protocol.substr(-1) !== ':') protocol += ':';
38993
+
38994
+ // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.
38995
+ // unless they had them to begin with.
38996
+ if (this.slashes ||
38997
+ (!protocol || slashedProtocol[protocol]) && host !== false) {
38998
+ host = '//' + (host || '');
38999
+ if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
39000
+ } else if (!host) {
39001
+ host = '';
39002
+ }
39003
+
39004
+ if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
39005
+ if (search && search.charAt(0) !== '?') search = '?' + search;
39006
+
39007
+ pathname = pathname.replace(/[?#]/g, function(match) {
39008
+ return encodeURIComponent(match);
39009
+ });
39010
+ search = search.replace('#', '%23');
39011
+
39012
+ return protocol + host + pathname + search + hash;
39013
+ };
39014
+
39015
+ function urlResolve(source, relative) {
39016
+ return urlParse(source, false, true).resolve(relative);
39017
+ }
39018
+
39019
+ Url.prototype.resolve = function(relative) {
39020
+ return this.resolveObject(urlParse(relative, false, true)).format();
39021
+ };
39022
+
39023
+ function urlResolveObject(source, relative) {
39024
+ if (!source) return relative;
39025
+ return urlParse(source, false, true).resolveObject(relative);
39026
+ }
39027
+
39028
+ Url.prototype.resolveObject = function(relative) {
39029
+ if (util.isString(relative)) {
39030
+ var rel = new Url();
39031
+ rel.parse(relative, false, true);
39032
+ relative = rel;
39033
+ }
39034
+
39035
+ var result = new Url();
39036
+ var tkeys = Object.keys(this);
39037
+ for (var tk = 0; tk < tkeys.length; tk++) {
39038
+ var tkey = tkeys[tk];
39039
+ result[tkey] = this[tkey];
39040
+ }
39041
+
39042
+ // hash is always overridden, no matter what.
39043
+ // even href="" will remove it.
39044
+ result.hash = relative.hash;
39045
+
39046
+ // if the relative url is empty, then there's nothing left to do here.
39047
+ if (relative.href === '') {
39048
+ result.href = result.format();
39049
+ return result;
39050
+ }
39051
+
39052
+ // hrefs like //foo/bar always cut to the protocol.
39053
+ if (relative.slashes && !relative.protocol) {
39054
+ // take everything except the protocol from relative
39055
+ var rkeys = Object.keys(relative);
39056
+ for (var rk = 0; rk < rkeys.length; rk++) {
39057
+ var rkey = rkeys[rk];
39058
+ if (rkey !== 'protocol')
39059
+ result[rkey] = relative[rkey];
39060
+ }
39061
+
39062
+ //urlParse appends trailing / to urls like http://www.example.com
39063
+ if (slashedProtocol[result.protocol] &&
39064
+ result.hostname && !result.pathname) {
39065
+ result.path = result.pathname = '/';
39066
+ }
39067
+
39068
+ result.href = result.format();
39069
+ return result;
39070
+ }
39071
+
39072
+ if (relative.protocol && relative.protocol !== result.protocol) {
39073
+ // if it's a known url protocol, then changing
39074
+ // the protocol does weird things
39075
+ // first, if it's not file:, then we MUST have a host,
39076
+ // and if there was a path
39077
+ // to begin with, then we MUST have a path.
39078
+ // if it is file:, then the host is dropped,
39079
+ // because that's known to be hostless.
39080
+ // anything else is assumed to be absolute.
39081
+ if (!slashedProtocol[relative.protocol]) {
39082
+ var keys = Object.keys(relative);
39083
+ for (var v = 0; v < keys.length; v++) {
39084
+ var k = keys[v];
39085
+ result[k] = relative[k];
39086
+ }
39087
+ result.href = result.format();
39088
+ return result;
39089
+ }
39090
+
39091
+ result.protocol = relative.protocol;
39092
+ if (!relative.host && !hostlessProtocol[relative.protocol]) {
39093
+ var relPath = (relative.pathname || '').split('/');
39094
+ while (relPath.length && !(relative.host = relPath.shift()));
39095
+ if (!relative.host) relative.host = '';
39096
+ if (!relative.hostname) relative.hostname = '';
39097
+ if (relPath[0] !== '') relPath.unshift('');
39098
+ if (relPath.length < 2) relPath.unshift('');
39099
+ result.pathname = relPath.join('/');
39100
+ } else {
39101
+ result.pathname = relative.pathname;
39102
+ }
39103
+ result.search = relative.search;
39104
+ result.query = relative.query;
39105
+ result.host = relative.host || '';
39106
+ result.auth = relative.auth;
39107
+ result.hostname = relative.hostname || relative.host;
39108
+ result.port = relative.port;
39109
+ // to support http.request
39110
+ if (result.pathname || result.search) {
39111
+ var p = result.pathname || '';
39112
+ var s = result.search || '';
39113
+ result.path = p + s;
39114
+ }
39115
+ result.slashes = result.slashes || relative.slashes;
39116
+ result.href = result.format();
39117
+ return result;
39118
+ }
39119
+
39120
+ var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),
39121
+ isRelAbs = (
39122
+ relative.host ||
39123
+ relative.pathname && relative.pathname.charAt(0) === '/'
39124
+ ),
39125
+ mustEndAbs = (isRelAbs || isSourceAbs ||
39126
+ (result.host && relative.pathname)),
39127
+ removeAllDots = mustEndAbs,
39128
+ srcPath = result.pathname && result.pathname.split('/') || [],
39129
+ relPath = relative.pathname && relative.pathname.split('/') || [],
39130
+ psychotic = result.protocol && !slashedProtocol[result.protocol];
39131
+
39132
+ // if the url is a non-slashed url, then relative
39133
+ // links like ../.. should be able
39134
+ // to crawl up to the hostname, as well. This is strange.
39135
+ // result.protocol has already been set by now.
39136
+ // Later on, put the first path part into the host field.
39137
+ if (psychotic) {
39138
+ result.hostname = '';
39139
+ result.port = null;
39140
+ if (result.host) {
39141
+ if (srcPath[0] === '') srcPath[0] = result.host;
39142
+ else srcPath.unshift(result.host);
39143
+ }
39144
+ result.host = '';
39145
+ if (relative.protocol) {
39146
+ relative.hostname = null;
39147
+ relative.port = null;
39148
+ if (relative.host) {
39149
+ if (relPath[0] === '') relPath[0] = relative.host;
39150
+ else relPath.unshift(relative.host);
39151
+ }
39152
+ relative.host = null;
39153
+ }
39154
+ mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
39155
+ }
39156
+
39157
+ if (isRelAbs) {
39158
+ // it's absolute.
39159
+ result.host = (relative.host || relative.host === '') ?
39160
+ relative.host : result.host;
39161
+ result.hostname = (relative.hostname || relative.hostname === '') ?
39162
+ relative.hostname : result.hostname;
39163
+ result.search = relative.search;
39164
+ result.query = relative.query;
39165
+ srcPath = relPath;
39166
+ // fall through to the dot-handling below.
39167
+ } else if (relPath.length) {
39168
+ // it's relative
39169
+ // throw away the existing file, and take the new path instead.
39170
+ if (!srcPath) srcPath = [];
39171
+ srcPath.pop();
39172
+ srcPath = srcPath.concat(relPath);
39173
+ result.search = relative.search;
39174
+ result.query = relative.query;
39175
+ } else if (!util.isNullOrUndefined(relative.search)) {
39176
+ // just pull out the search.
39177
+ // like href='?foo'.
39178
+ // Put this after the other two cases because it simplifies the booleans
39179
+ if (psychotic) {
39180
+ result.hostname = result.host = srcPath.shift();
39181
+ //occationaly the auth can get stuck only in host
39182
+ //this especially happens in cases like
39183
+ //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
39184
+ var authInHost = result.host && result.host.indexOf('@') > 0 ?
39185
+ result.host.split('@') : false;
39186
+ if (authInHost) {
39187
+ result.auth = authInHost.shift();
39188
+ result.host = result.hostname = authInHost.shift();
39189
+ }
39190
+ }
39191
+ result.search = relative.search;
39192
+ result.query = relative.query;
39193
+ //to support http.request
39194
+ if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
39195
+ result.path = (result.pathname ? result.pathname : '') +
39196
+ (result.search ? result.search : '');
39197
+ }
39198
+ result.href = result.format();
39199
+ return result;
39200
+ }
39201
+
39202
+ if (!srcPath.length) {
39203
+ // no path at all. easy.
39204
+ // we've already handled the other stuff above.
39205
+ result.pathname = null;
39206
+ //to support http.request
39207
+ if (result.search) {
39208
+ result.path = '/' + result.search;
39209
+ } else {
39210
+ result.path = null;
39211
+ }
39212
+ result.href = result.format();
39213
+ return result;
39214
+ }
39215
+
39216
+ // if a url ENDs in . or .., then it must get a trailing slash.
39217
+ // however, if it ends in anything else non-slashy,
39218
+ // then it must NOT get a trailing slash.
39219
+ var last = srcPath.slice(-1)[0];
39220
+ var hasTrailingSlash = (
39221
+ (result.host || relative.host || srcPath.length > 1) &&
39222
+ (last === '.' || last === '..') || last === '');
39223
+
39224
+ // strip single dots, resolve double dots to parent dir
39225
+ // if the path tries to go above the root, `up` ends up > 0
39226
+ var up = 0;
39227
+ for (var i = srcPath.length; i >= 0; i--) {
39228
+ last = srcPath[i];
39229
+ if (last === '.') {
39230
+ srcPath.splice(i, 1);
39231
+ } else if (last === '..') {
39232
+ srcPath.splice(i, 1);
39233
+ up++;
39234
+ } else if (up) {
39235
+ srcPath.splice(i, 1);
39236
+ up--;
39237
+ }
39238
+ }
39239
+
39240
+ // if the path is allowed to go above the root, restore leading ..s
39241
+ if (!mustEndAbs && !removeAllDots) {
39242
+ for (; up--; up) {
39243
+ srcPath.unshift('..');
39244
+ }
39245
+ }
39246
+
39247
+ if (mustEndAbs && srcPath[0] !== '' &&
39248
+ (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
39249
+ srcPath.unshift('');
39250
+ }
39251
+
39252
+ if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
39253
+ srcPath.push('');
39254
+ }
39255
+
39256
+ var isAbsolute = srcPath[0] === '' ||
39257
+ (srcPath[0] && srcPath[0].charAt(0) === '/');
39258
+
39259
+ // put the host back
39260
+ if (psychotic) {
39261
+ result.hostname = result.host = isAbsolute ? '' :
39262
+ srcPath.length ? srcPath.shift() : '';
39263
+ //occationaly the auth can get stuck only in host
39264
+ //this especially happens in cases like
39265
+ //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
39266
+ var authInHost = result.host && result.host.indexOf('@') > 0 ?
39267
+ result.host.split('@') : false;
39268
+ if (authInHost) {
39269
+ result.auth = authInHost.shift();
39270
+ result.host = result.hostname = authInHost.shift();
39271
+ }
39272
+ }
39273
+
39274
+ mustEndAbs = mustEndAbs || (result.host && srcPath.length);
39275
+
39276
+ if (mustEndAbs && !isAbsolute) {
39277
+ srcPath.unshift('');
39278
+ }
39279
+
39280
+ if (!srcPath.length) {
39281
+ result.pathname = null;
39282
+ result.path = null;
39283
+ } else {
39284
+ result.pathname = srcPath.join('/');
39285
+ }
39286
+
39287
+ //to support request.http
39288
+ if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
39289
+ result.path = (result.pathname ? result.pathname : '') +
39290
+ (result.search ? result.search : '');
39291
+ }
39292
+ result.auth = relative.auth || result.auth;
39293
+ result.slashes = result.slashes || relative.slashes;
39294
+ result.href = result.format();
39295
+ return result;
39296
+ };
39297
+
39298
+ Url.prototype.parseHost = function() {
39299
+ var host = this.host;
39300
+ var port = portPattern.exec(host);
39301
+ if (port) {
39302
+ port = port[0];
39303
+ if (port !== ':') {
39304
+ this.port = port.substr(1);
39305
+ }
39306
+ host = host.substr(0, host.length - port.length);
39307
+ }
39308
+ if (host) this.hostname = host;
39309
+ };
39310
+
37948
39311
  /**
37949
39312
  * @typedef URL
37950
39313
  * @property {string} hash
@@ -38090,7 +39453,7 @@ class VFile$1 {
38090
39453
  * Defaults to `process.cwd()` (`/` in browsers).
38091
39454
  * @type {string}
38092
39455
  */
38093
- this.cwd = proc.cwd();
39456
+ this.cwd = process$1.cwd();
38094
39457
 
38095
39458
  /* eslint-disable no-unused-expressions */
38096
39459
  /**
@@ -38168,7 +39531,7 @@ class VFile$1 {
38168
39531
  */
38169
39532
  set path(path) {
38170
39533
  if (isUrl$1(path)) {
38171
- path = fileURLToPath(path);
39534
+ path = url.fileURLToPath(path);
38172
39535
  }
38173
39536
 
38174
39537
  assertNonEmpty$1(path, 'path');
@@ -38968,7 +40331,7 @@ class VFile {
38968
40331
  * Defaults to `process.cwd()` (`/` in browsers).
38969
40332
  * @type {string}
38970
40333
  */
38971
- this.cwd = proc.cwd();
40334
+ this.cwd = process$1.cwd();
38972
40335
 
38973
40336
  /* eslint-disable no-unused-expressions */
38974
40337
  /**
@@ -39046,7 +40409,7 @@ class VFile {
39046
40409
  */
39047
40410
  set path(path) {
39048
40411
  if (isUrl(path)) {
39049
- path = fileURLToPath(path);
40412
+ path = url.fileURLToPath(path);
39050
40413
  }
39051
40414
 
39052
40415
  assertNonEmpty(path, 'path');
@@ -73309,7 +74672,7 @@ https://highlightjs.org/
73309
74672
  */
73310
74673
 
73311
74674
 
73312
- const escape = escapeHTML;
74675
+ const escape$1 = escapeHTML;
73313
74676
  const inherit = inherit$1;
73314
74677
  const NO_MATCH = Symbol("nomatch");
73315
74678
  const MAX_KEYWORD_HITS = 7;
@@ -73869,7 +75232,7 @@ const HLJS = function(hljs) {
73869
75232
  if (err.message && err.message.includes('Illegal')) {
73870
75233
  return {
73871
75234
  language: languageName,
73872
- value: escape(codeToHighlight),
75235
+ value: escape$1(codeToHighlight),
73873
75236
  illegal: true,
73874
75237
  relevance: 0,
73875
75238
  _illegalBy: {
@@ -73884,7 +75247,7 @@ const HLJS = function(hljs) {
73884
75247
  } else if (SAFE_MODE) {
73885
75248
  return {
73886
75249
  language: languageName,
73887
- value: escape(codeToHighlight),
75250
+ value: escape$1(codeToHighlight),
73888
75251
  illegal: false,
73889
75252
  relevance: 0,
73890
75253
  errorRaised: err,
@@ -73906,7 +75269,7 @@ const HLJS = function(hljs) {
73906
75269
  */
73907
75270
  function justTextHighlightResult(code) {
73908
75271
  const result = {
73909
- value: escape(code),
75272
+ value: escape$1(code),
73910
75273
  illegal: false,
73911
75274
  relevance: 0,
73912
75275
  _top: PLAINTEXT_LANGUAGE,
@@ -75870,10 +77233,9 @@ function language(node) {
75870
77233
  var FormReadOnlyMarkdown = function FormReadOnlyMarkdown(_ref) {
75871
77234
  var content = _ref.content;
75872
77235
  return /*#__PURE__*/React.createElement(ReactMarkdown, {
75873
- children: content,
75874
77236
  remarkPlugins: [remarkGfm],
75875
77237
  rehypePlugins: [rehypeHighlight]
75876
- });
77238
+ }, content);
75877
77239
  };
75878
77240
 
75879
77241
  FormReadOnlyMarkdown.propTypes = {