index.js 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455
  1. module.exports = (function() {
  2. var __MODS__ = {};
  3. var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
  4. var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
  5. var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
  6. var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
  7. __DEFINE__(1609944441878, function(require, module, exports) {
  8. /** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
  9. (function (global, factory) {
  10. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  11. typeof define === 'function' && define.amd ? define(['exports'], factory) :
  12. (factory((global.URI = global.URI || {})));
  13. }(this, (function (exports) {
  14. function merge() {
  15. for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
  16. sets[_key] = arguments[_key];
  17. }
  18. if (sets.length > 1) {
  19. sets[0] = sets[0].slice(0, -1);
  20. var xl = sets.length - 1;
  21. for (var x = 1; x < xl; ++x) {
  22. sets[x] = sets[x].slice(1, -1);
  23. }
  24. sets[xl] = sets[xl].slice(1);
  25. return sets.join('');
  26. } else {
  27. return sets[0];
  28. }
  29. }
  30. function subexp(str) {
  31. return "(?:" + str + ")";
  32. }
  33. function typeOf(o) {
  34. return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
  35. }
  36. function toUpperCase(str) {
  37. return str.toUpperCase();
  38. }
  39. function toArray(obj) {
  40. return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
  41. }
  42. function assign(target, source) {
  43. var obj = target;
  44. if (source) {
  45. for (var key in source) {
  46. obj[key] = source[key];
  47. }
  48. }
  49. return obj;
  50. }
  51. function buildExps(isIRI) {
  52. var ALPHA$$ = "[A-Za-z]",
  53. CR$ = "[\\x0D]",
  54. DIGIT$$ = "[0-9]",
  55. DQUOTE$$ = "[\\x22]",
  56. HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
  57. //case-insensitive
  58. LF$$ = "[\\x0A]",
  59. SP$$ = "[\\x20]",
  60. PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
  61. //expanded
  62. GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
  63. SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
  64. RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
  65. UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
  66. //subset, excludes bidi control characters
  67. IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
  68. //subset
  69. UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$),
  70. SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"),
  71. USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"),
  72. DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$),
  73. DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$),
  74. //relaxed parsing rules
  75. IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
  76. H16$ = subexp(HEXDIG$$ + "{1,4}"),
  77. LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
  78. IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
  79. // 6( h16 ":" ) ls32
  80. IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
  81. // "::" 5( h16 ":" ) ls32
  82. IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
  83. //[ h16 ] "::" 4( h16 ":" ) ls32
  84. IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
  85. //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
  86. IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
  87. //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
  88. IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
  89. //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
  90. IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
  91. //[ *4( h16 ":" ) h16 ] "::" ls32
  92. IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
  93. //[ *5( h16 ":" ) h16 ] "::" h16
  94. IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
  95. //[ *6( h16 ":" ) h16 ] "::"
  96. IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
  97. ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"),
  98. //RFC 6874
  99. IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$),
  100. //RFC 6874
  101. IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$),
  102. //RFC 6874, with relaxed parsing rules
  103. IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"),
  104. IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"),
  105. //RFC 6874
  106. REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"),
  107. HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$),
  108. PORT$ = subexp(DIGIT$$ + "*"),
  109. AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"),
  110. PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")),
  111. SEGMENT$ = subexp(PCHAR$ + "*"),
  112. SEGMENT_NZ$ = subexp(PCHAR$ + "+"),
  113. SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"),
  114. PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"),
  115. PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"),
  116. //simplified
  117. PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),
  118. //simplified
  119. PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),
  120. //simplified
  121. PATH_EMPTY$ = "(?!" + PCHAR$ + ")",
  122. PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$),
  123. QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"),
  124. FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"),
  125. HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$),
  126. URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"),
  127. RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$),
  128. RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"),
  129. URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$),
  130. ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"),
  131. GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
  132. RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
  133. ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$",
  134. SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
  135. AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
  136. return {
  137. NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
  138. NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
  139. NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
  140. NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
  141. NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
  142. NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
  143. NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
  144. ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
  145. UNRESERVED: new RegExp(UNRESERVED$$, "g"),
  146. OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
  147. PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
  148. IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
  149. IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
  150. };
  151. }
  152. var URI_PROTOCOL = buildExps(false);
  153. var IRI_PROTOCOL = buildExps(true);
  154. var slicedToArray = function () {
  155. function sliceIterator(arr, i) {
  156. var _arr = [];
  157. var _n = true;
  158. var _d = false;
  159. var _e = undefined;
  160. try {
  161. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  162. _arr.push(_s.value);
  163. if (i && _arr.length === i) break;
  164. }
  165. } catch (err) {
  166. _d = true;
  167. _e = err;
  168. } finally {
  169. try {
  170. if (!_n && _i["return"]) _i["return"]();
  171. } finally {
  172. if (_d) throw _e;
  173. }
  174. }
  175. return _arr;
  176. }
  177. return function (arr, i) {
  178. if (Array.isArray(arr)) {
  179. return arr;
  180. } else if (Symbol.iterator in Object(arr)) {
  181. return sliceIterator(arr, i);
  182. } else {
  183. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  184. }
  185. };
  186. }();
  187. var toConsumableArray = function (arr) {
  188. if (Array.isArray(arr)) {
  189. for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
  190. return arr2;
  191. } else {
  192. return Array.from(arr);
  193. }
  194. };
  195. /** Highest positive signed 32-bit float value */
  196. var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
  197. /** Bootstring parameters */
  198. var base = 36;
  199. var tMin = 1;
  200. var tMax = 26;
  201. var skew = 38;
  202. var damp = 700;
  203. var initialBias = 72;
  204. var initialN = 128; // 0x80
  205. var delimiter = '-'; // '\x2D'
  206. /** Regular expressions */
  207. var regexPunycode = /^xn--/;
  208. var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
  209. var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
  210. /** Error messages */
  211. var errors = {
  212. 'overflow': 'Overflow: input needs wider integers to process',
  213. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  214. 'invalid-input': 'Invalid input'
  215. };
  216. /** Convenience shortcuts */
  217. var baseMinusTMin = base - tMin;
  218. var floor = Math.floor;
  219. var stringFromCharCode = String.fromCharCode;
  220. /*--------------------------------------------------------------------------*/
  221. /**
  222. * A generic error utility function.
  223. * @private
  224. * @param {String} type The error type.
  225. * @returns {Error} Throws a `RangeError` with the applicable error message.
  226. */
  227. function error$1(type) {
  228. throw new RangeError(errors[type]);
  229. }
  230. /**
  231. * A generic `Array#map` utility function.
  232. * @private
  233. * @param {Array} array The array to iterate over.
  234. * @param {Function} callback The function that gets called for every array
  235. * item.
  236. * @returns {Array} A new array of values returned by the callback function.
  237. */
  238. function map(array, fn) {
  239. var result = [];
  240. var length = array.length;
  241. while (length--) {
  242. result[length] = fn(array[length]);
  243. }
  244. return result;
  245. }
  246. /**
  247. * A simple `Array#map`-like wrapper to work with domain name strings or email
  248. * addresses.
  249. * @private
  250. * @param {String} domain The domain name or email address.
  251. * @param {Function} callback The function that gets called for every
  252. * character.
  253. * @returns {Array} A new string of characters returned by the callback
  254. * function.
  255. */
  256. function mapDomain(string, fn) {
  257. var parts = string.split('@');
  258. var result = '';
  259. if (parts.length > 1) {
  260. // In email addresses, only the domain name should be punycoded. Leave
  261. // the local part (i.e. everything up to `@`) intact.
  262. result = parts[0] + '@';
  263. string = parts[1];
  264. }
  265. // Avoid `split(regex)` for IE8 compatibility. See #17.
  266. string = string.replace(regexSeparators, '\x2E');
  267. var labels = string.split('.');
  268. var encoded = map(labels, fn).join('.');
  269. return result + encoded;
  270. }
  271. /**
  272. * Creates an array containing the numeric code points of each Unicode
  273. * character in the string. While JavaScript uses UCS-2 internally,
  274. * this function will convert a pair of surrogate halves (each of which
  275. * UCS-2 exposes as separate characters) into a single code point,
  276. * matching UTF-16.
  277. * @see `punycode.ucs2.encode`
  278. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  279. * @memberOf punycode.ucs2
  280. * @name decode
  281. * @param {String} string The Unicode input string (UCS-2).
  282. * @returns {Array} The new array of code points.
  283. */
  284. function ucs2decode(string) {
  285. var output = [];
  286. var counter = 0;
  287. var length = string.length;
  288. while (counter < length) {
  289. var value = string.charCodeAt(counter++);
  290. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  291. // It's a high surrogate, and there is a next character.
  292. var extra = string.charCodeAt(counter++);
  293. if ((extra & 0xFC00) == 0xDC00) {
  294. // Low surrogate.
  295. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  296. } else {
  297. // It's an unmatched surrogate; only append this code unit, in case the
  298. // next code unit is the high surrogate of a surrogate pair.
  299. output.push(value);
  300. counter--;
  301. }
  302. } else {
  303. output.push(value);
  304. }
  305. }
  306. return output;
  307. }
  308. /**
  309. * Creates a string based on an array of numeric code points.
  310. * @see `punycode.ucs2.decode`
  311. * @memberOf punycode.ucs2
  312. * @name encode
  313. * @param {Array} codePoints The array of numeric code points.
  314. * @returns {String} The new Unicode string (UCS-2).
  315. */
  316. var ucs2encode = function ucs2encode(array) {
  317. return String.fromCodePoint.apply(String, toConsumableArray(array));
  318. };
  319. /**
  320. * Converts a basic code point into a digit/integer.
  321. * @see `digitToBasic()`
  322. * @private
  323. * @param {Number} codePoint The basic numeric code point value.
  324. * @returns {Number} The numeric value of a basic code point (for use in
  325. * representing integers) in the range `0` to `base - 1`, or `base` if
  326. * the code point does not represent a value.
  327. */
  328. var basicToDigit = function basicToDigit(codePoint) {
  329. if (codePoint - 0x30 < 0x0A) {
  330. return codePoint - 0x16;
  331. }
  332. if (codePoint - 0x41 < 0x1A) {
  333. return codePoint - 0x41;
  334. }
  335. if (codePoint - 0x61 < 0x1A) {
  336. return codePoint - 0x61;
  337. }
  338. return base;
  339. };
  340. /**
  341. * Converts a digit/integer into a basic code point.
  342. * @see `basicToDigit()`
  343. * @private
  344. * @param {Number} digit The numeric value of a basic code point.
  345. * @returns {Number} The basic code point whose value (when used for
  346. * representing integers) is `digit`, which needs to be in the range
  347. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  348. * used; else, the lowercase form is used. The behavior is undefined
  349. * if `flag` is non-zero and `digit` has no uppercase form.
  350. */
  351. var digitToBasic = function digitToBasic(digit, flag) {
  352. // 0..25 map to ASCII a..z or A..Z
  353. // 26..35 map to ASCII 0..9
  354. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  355. };
  356. /**
  357. * Bias adaptation function as per section 3.4 of RFC 3492.
  358. * https://tools.ietf.org/html/rfc3492#section-3.4
  359. * @private
  360. */
  361. var adapt = function adapt(delta, numPoints, firstTime) {
  362. var k = 0;
  363. delta = firstTime ? floor(delta / damp) : delta >> 1;
  364. delta += floor(delta / numPoints);
  365. for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
  366. delta = floor(delta / baseMinusTMin);
  367. }
  368. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  369. };
  370. /**
  371. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  372. * symbols.
  373. * @memberOf punycode
  374. * @param {String} input The Punycode string of ASCII-only symbols.
  375. * @returns {String} The resulting string of Unicode symbols.
  376. */
  377. var decode = function decode(input) {
  378. // Don't use UCS-2.
  379. var output = [];
  380. var inputLength = input.length;
  381. var i = 0;
  382. var n = initialN;
  383. var bias = initialBias;
  384. // Handle the basic code points: let `basic` be the number of input code
  385. // points before the last delimiter, or `0` if there is none, then copy
  386. // the first basic code points to the output.
  387. var basic = input.lastIndexOf(delimiter);
  388. if (basic < 0) {
  389. basic = 0;
  390. }
  391. for (var j = 0; j < basic; ++j) {
  392. // if it's not a basic code point
  393. if (input.charCodeAt(j) >= 0x80) {
  394. error$1('not-basic');
  395. }
  396. output.push(input.charCodeAt(j));
  397. }
  398. // Main decoding loop: start just after the last delimiter if any basic code
  399. // points were copied; start at the beginning otherwise.
  400. for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{
  401. // `index` is the index of the next character to be consumed.
  402. // Decode a generalized variable-length integer into `delta`,
  403. // which gets added to `i`. The overflow checking is easier
  404. // if we increase `i` as we go, then subtract off its starting
  405. // value at the end to obtain `delta`.
  406. var oldi = i;
  407. for (var w = 1, k = base;; /* no condition */k += base) {
  408. if (index >= inputLength) {
  409. error$1('invalid-input');
  410. }
  411. var digit = basicToDigit(input.charCodeAt(index++));
  412. if (digit >= base || digit > floor((maxInt - i) / w)) {
  413. error$1('overflow');
  414. }
  415. i += digit * w;
  416. var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
  417. if (digit < t) {
  418. break;
  419. }
  420. var baseMinusT = base - t;
  421. if (w > floor(maxInt / baseMinusT)) {
  422. error$1('overflow');
  423. }
  424. w *= baseMinusT;
  425. }
  426. var out = output.length + 1;
  427. bias = adapt(i - oldi, out, oldi == 0);
  428. // `i` was supposed to wrap around from `out` to `0`,
  429. // incrementing `n` each time, so we'll fix that now:
  430. if (floor(i / out) > maxInt - n) {
  431. error$1('overflow');
  432. }
  433. n += floor(i / out);
  434. i %= out;
  435. // Insert `n` at position `i` of the output.
  436. output.splice(i++, 0, n);
  437. }
  438. return String.fromCodePoint.apply(String, output);
  439. };
  440. /**
  441. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  442. * Punycode string of ASCII-only symbols.
  443. * @memberOf punycode
  444. * @param {String} input The string of Unicode symbols.
  445. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  446. */
  447. var encode = function encode(input) {
  448. var output = [];
  449. // Convert the input in UCS-2 to an array of Unicode code points.
  450. input = ucs2decode(input);
  451. // Cache the length.
  452. var inputLength = input.length;
  453. // Initialize the state.
  454. var n = initialN;
  455. var delta = 0;
  456. var bias = initialBias;
  457. // Handle the basic code points.
  458. var _iteratorNormalCompletion = true;
  459. var _didIteratorError = false;
  460. var _iteratorError = undefined;
  461. try {
  462. for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  463. var _currentValue2 = _step.value;
  464. if (_currentValue2 < 0x80) {
  465. output.push(stringFromCharCode(_currentValue2));
  466. }
  467. }
  468. } catch (err) {
  469. _didIteratorError = true;
  470. _iteratorError = err;
  471. } finally {
  472. try {
  473. if (!_iteratorNormalCompletion && _iterator.return) {
  474. _iterator.return();
  475. }
  476. } finally {
  477. if (_didIteratorError) {
  478. throw _iteratorError;
  479. }
  480. }
  481. }
  482. var basicLength = output.length;
  483. var handledCPCount = basicLength;
  484. // `handledCPCount` is the number of code points that have been handled;
  485. // `basicLength` is the number of basic code points.
  486. // Finish the basic string with a delimiter unless it's empty.
  487. if (basicLength) {
  488. output.push(delimiter);
  489. }
  490. // Main encoding loop:
  491. while (handledCPCount < inputLength) {
  492. // All non-basic code points < n have been handled already. Find the next
  493. // larger one:
  494. var m = maxInt;
  495. var _iteratorNormalCompletion2 = true;
  496. var _didIteratorError2 = false;
  497. var _iteratorError2 = undefined;
  498. try {
  499. for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  500. var currentValue = _step2.value;
  501. if (currentValue >= n && currentValue < m) {
  502. m = currentValue;
  503. }
  504. }
  505. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  506. // but guard against overflow.
  507. } catch (err) {
  508. _didIteratorError2 = true;
  509. _iteratorError2 = err;
  510. } finally {
  511. try {
  512. if (!_iteratorNormalCompletion2 && _iterator2.return) {
  513. _iterator2.return();
  514. }
  515. } finally {
  516. if (_didIteratorError2) {
  517. throw _iteratorError2;
  518. }
  519. }
  520. }
  521. var handledCPCountPlusOne = handledCPCount + 1;
  522. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  523. error$1('overflow');
  524. }
  525. delta += (m - n) * handledCPCountPlusOne;
  526. n = m;
  527. var _iteratorNormalCompletion3 = true;
  528. var _didIteratorError3 = false;
  529. var _iteratorError3 = undefined;
  530. try {
  531. for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
  532. var _currentValue = _step3.value;
  533. if (_currentValue < n && ++delta > maxInt) {
  534. error$1('overflow');
  535. }
  536. if (_currentValue == n) {
  537. // Represent delta as a generalized variable-length integer.
  538. var q = delta;
  539. for (var k = base;; /* no condition */k += base) {
  540. var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
  541. if (q < t) {
  542. break;
  543. }
  544. var qMinusT = q - t;
  545. var baseMinusT = base - t;
  546. output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
  547. q = floor(qMinusT / baseMinusT);
  548. }
  549. output.push(stringFromCharCode(digitToBasic(q, 0)));
  550. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  551. delta = 0;
  552. ++handledCPCount;
  553. }
  554. }
  555. } catch (err) {
  556. _didIteratorError3 = true;
  557. _iteratorError3 = err;
  558. } finally {
  559. try {
  560. if (!_iteratorNormalCompletion3 && _iterator3.return) {
  561. _iterator3.return();
  562. }
  563. } finally {
  564. if (_didIteratorError3) {
  565. throw _iteratorError3;
  566. }
  567. }
  568. }
  569. ++delta;
  570. ++n;
  571. }
  572. return output.join('');
  573. };
  574. /**
  575. * Converts a Punycode string representing a domain name or an email address
  576. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  577. * it doesn't matter if you call it on a string that has already been
  578. * converted to Unicode.
  579. * @memberOf punycode
  580. * @param {String} input The Punycoded domain name or email address to
  581. * convert to Unicode.
  582. * @returns {String} The Unicode representation of the given Punycode
  583. * string.
  584. */
  585. var toUnicode = function toUnicode(input) {
  586. return mapDomain(input, function (string) {
  587. return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
  588. });
  589. };
  590. /**
  591. * Converts a Unicode string representing a domain name or an email address to
  592. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  593. * i.e. it doesn't matter if you call it with a domain that's already in
  594. * ASCII.
  595. * @memberOf punycode
  596. * @param {String} input The domain name or email address to convert, as a
  597. * Unicode string.
  598. * @returns {String} The Punycode representation of the given domain name or
  599. * email address.
  600. */
  601. var toASCII = function toASCII(input) {
  602. return mapDomain(input, function (string) {
  603. return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
  604. });
  605. };
  606. /*--------------------------------------------------------------------------*/
  607. /** Define the public API */
  608. var punycode = {
  609. /**
  610. * A string representing the current Punycode.js version number.
  611. * @memberOf punycode
  612. * @type String
  613. */
  614. 'version': '2.1.0',
  615. /**
  616. * An object of methods to convert from JavaScript's internal character
  617. * representation (UCS-2) to Unicode code points, and back.
  618. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  619. * @memberOf punycode
  620. * @type Object
  621. */
  622. 'ucs2': {
  623. 'decode': ucs2decode,
  624. 'encode': ucs2encode
  625. },
  626. 'decode': decode,
  627. 'encode': encode,
  628. 'toASCII': toASCII,
  629. 'toUnicode': toUnicode
  630. };
  631. /**
  632. * URI.js
  633. *
  634. * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
  635. * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
  636. * @see http://github.com/garycourt/uri-js
  637. */
  638. /**
  639. * Copyright 2011 Gary Court. All rights reserved.
  640. *
  641. * Redistribution and use in source and binary forms, with or without modification, are
  642. * permitted provided that the following conditions are met:
  643. *
  644. * 1. Redistributions of source code must retain the above copyright notice, this list of
  645. * conditions and the following disclaimer.
  646. *
  647. * 2. Redistributions in binary form must reproduce the above copyright notice, this list
  648. * of conditions and the following disclaimer in the documentation and/or other materials
  649. * provided with the distribution.
  650. *
  651. * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
  652. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  653. * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
  654. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  655. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  656. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  657. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  658. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  659. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  660. *
  661. * The views and conclusions contained in the software and documentation are those of the
  662. * authors and should not be interpreted as representing official policies, either expressed
  663. * or implied, of Gary Court.
  664. */
  665. var SCHEMES = {};
  666. function pctEncChar(chr) {
  667. var c = chr.charCodeAt(0);
  668. var e = void 0;
  669. if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
  670. return e;
  671. }
  672. function pctDecChars(str) {
  673. var newStr = "";
  674. var i = 0;
  675. var il = str.length;
  676. while (i < il) {
  677. var c = parseInt(str.substr(i + 1, 2), 16);
  678. if (c < 128) {
  679. newStr += String.fromCharCode(c);
  680. i += 3;
  681. } else if (c >= 194 && c < 224) {
  682. if (il - i >= 6) {
  683. var c2 = parseInt(str.substr(i + 4, 2), 16);
  684. newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
  685. } else {
  686. newStr += str.substr(i, 6);
  687. }
  688. i += 6;
  689. } else if (c >= 224) {
  690. if (il - i >= 9) {
  691. var _c = parseInt(str.substr(i + 4, 2), 16);
  692. var c3 = parseInt(str.substr(i + 7, 2), 16);
  693. newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
  694. } else {
  695. newStr += str.substr(i, 9);
  696. }
  697. i += 9;
  698. } else {
  699. newStr += str.substr(i, 3);
  700. i += 3;
  701. }
  702. }
  703. return newStr;
  704. }
  705. function _normalizeComponentEncoding(components, protocol) {
  706. function decodeUnreserved(str) {
  707. var decStr = pctDecChars(str);
  708. return !decStr.match(protocol.UNRESERVED) ? str : decStr;
  709. }
  710. if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
  711. if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
  712. if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
  713. if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
  714. if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
  715. if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
  716. return components;
  717. }
  718. function _stripLeadingZeros(str) {
  719. return str.replace(/^0*(.*)/, "$1") || "0";
  720. }
  721. function _normalizeIPv4(host, protocol) {
  722. var matches = host.match(protocol.IPV4ADDRESS) || [];
  723. var _matches = slicedToArray(matches, 2),
  724. address = _matches[1];
  725. if (address) {
  726. return address.split(".").map(_stripLeadingZeros).join(".");
  727. } else {
  728. return host;
  729. }
  730. }
  731. function _normalizeIPv6(host, protocol) {
  732. var matches = host.match(protocol.IPV6ADDRESS) || [];
  733. var _matches2 = slicedToArray(matches, 3),
  734. address = _matches2[1],
  735. zone = _matches2[2];
  736. if (address) {
  737. var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
  738. _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
  739. last = _address$toLowerCase$2[0],
  740. first = _address$toLowerCase$2[1];
  741. var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
  742. var lastFields = last.split(":").map(_stripLeadingZeros);
  743. var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
  744. var fieldCount = isLastFieldIPv4Address ? 7 : 8;
  745. var lastFieldsStart = lastFields.length - fieldCount;
  746. var fields = Array(fieldCount);
  747. for (var x = 0; x < fieldCount; ++x) {
  748. fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
  749. }
  750. if (isLastFieldIPv4Address) {
  751. fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
  752. }
  753. var allZeroFields = fields.reduce(function (acc, field, index) {
  754. if (!field || field === "0") {
  755. var lastLongest = acc[acc.length - 1];
  756. if (lastLongest && lastLongest.index + lastLongest.length === index) {
  757. lastLongest.length++;
  758. } else {
  759. acc.push({ index: index, length: 1 });
  760. }
  761. }
  762. return acc;
  763. }, []);
  764. var longestZeroFields = allZeroFields.sort(function (a, b) {
  765. return b.length - a.length;
  766. })[0];
  767. var newHost = void 0;
  768. if (longestZeroFields && longestZeroFields.length > 1) {
  769. var newFirst = fields.slice(0, longestZeroFields.index);
  770. var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
  771. newHost = newFirst.join(":") + "::" + newLast.join(":");
  772. } else {
  773. newHost = fields.join(":");
  774. }
  775. if (zone) {
  776. newHost += "%" + zone;
  777. }
  778. return newHost;
  779. } else {
  780. return host;
  781. }
  782. }
  783. var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
  784. var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
  785. function parse(uriString) {
  786. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  787. var components = {};
  788. var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
  789. if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
  790. var matches = uriString.match(URI_PARSE);
  791. if (matches) {
  792. if (NO_MATCH_IS_UNDEFINED) {
  793. //store each component
  794. components.scheme = matches[1];
  795. components.userinfo = matches[3];
  796. components.host = matches[4];
  797. components.port = parseInt(matches[5], 10);
  798. components.path = matches[6] || "";
  799. components.query = matches[7];
  800. components.fragment = matches[8];
  801. //fix port number
  802. if (isNaN(components.port)) {
  803. components.port = matches[5];
  804. }
  805. } else {
  806. //IE FIX for improper RegExp matching
  807. //store each component
  808. components.scheme = matches[1] || undefined;
  809. components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
  810. components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
  811. components.port = parseInt(matches[5], 10);
  812. components.path = matches[6] || "";
  813. components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
  814. components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
  815. //fix port number
  816. if (isNaN(components.port)) {
  817. components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
  818. }
  819. }
  820. if (components.host) {
  821. //normalize IP hosts
  822. components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
  823. }
  824. //determine reference type
  825. if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
  826. components.reference = "same-document";
  827. } else if (components.scheme === undefined) {
  828. components.reference = "relative";
  829. } else if (components.fragment === undefined) {
  830. components.reference = "absolute";
  831. } else {
  832. components.reference = "uri";
  833. }
  834. //check for reference errors
  835. if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
  836. components.error = components.error || "URI is not a " + options.reference + " reference.";
  837. }
  838. //find scheme handler
  839. var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
  840. //check if scheme can't handle IRIs
  841. if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
  842. //if host component is a domain name
  843. if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
  844. //convert Unicode IDN -> ASCII IDN
  845. try {
  846. components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
  847. } catch (e) {
  848. components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
  849. }
  850. }
  851. //convert IRI -> URI
  852. _normalizeComponentEncoding(components, URI_PROTOCOL);
  853. } else {
  854. //normalize encodings
  855. _normalizeComponentEncoding(components, protocol);
  856. }
  857. //perform scheme specific parsing
  858. if (schemeHandler && schemeHandler.parse) {
  859. schemeHandler.parse(components, options);
  860. }
  861. } else {
  862. components.error = components.error || "URI can not be parsed.";
  863. }
  864. return components;
  865. }
  866. function _recomposeAuthority(components, options) {
  867. var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
  868. var uriTokens = [];
  869. if (components.userinfo !== undefined) {
  870. uriTokens.push(components.userinfo);
  871. uriTokens.push("@");
  872. }
  873. if (components.host !== undefined) {
  874. //normalize IP hosts, add brackets and escape zone separator for IPv6
  875. uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
  876. return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
  877. }));
  878. }
  879. if (typeof components.port === "number" || typeof components.port === "string") {
  880. uriTokens.push(":");
  881. uriTokens.push(String(components.port));
  882. }
  883. return uriTokens.length ? uriTokens.join("") : undefined;
  884. }
  885. var RDS1 = /^\.\.?\//;
  886. var RDS2 = /^\/\.(\/|$)/;
  887. var RDS3 = /^\/\.\.(\/|$)/;
  888. var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
  889. function removeDotSegments(input) {
  890. var output = [];
  891. while (input.length) {
  892. if (input.match(RDS1)) {
  893. input = input.replace(RDS1, "");
  894. } else if (input.match(RDS2)) {
  895. input = input.replace(RDS2, "/");
  896. } else if (input.match(RDS3)) {
  897. input = input.replace(RDS3, "/");
  898. output.pop();
  899. } else if (input === "." || input === "..") {
  900. input = "";
  901. } else {
  902. var im = input.match(RDS5);
  903. if (im) {
  904. var s = im[0];
  905. input = input.slice(s.length);
  906. output.push(s);
  907. } else {
  908. throw new Error("Unexpected dot segment condition");
  909. }
  910. }
  911. }
  912. return output.join("");
  913. }
  914. function serialize(components) {
  915. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  916. var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
  917. var uriTokens = [];
  918. //find scheme handler
  919. var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
  920. //perform scheme specific serialization
  921. if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
  922. if (components.host) {
  923. //if host component is an IPv6 address
  924. if (protocol.IPV6ADDRESS.test(components.host)) {}
  925. //TODO: normalize IPv6 address as per RFC 5952
  926. //if host component is a domain name
  927. else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
  928. //convert IDN via punycode
  929. try {
  930. components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
  931. } catch (e) {
  932. components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
  933. }
  934. }
  935. }
  936. //normalize encoding
  937. _normalizeComponentEncoding(components, protocol);
  938. if (options.reference !== "suffix" && components.scheme) {
  939. uriTokens.push(components.scheme);
  940. uriTokens.push(":");
  941. }
  942. var authority = _recomposeAuthority(components, options);
  943. if (authority !== undefined) {
  944. if (options.reference !== "suffix") {
  945. uriTokens.push("//");
  946. }
  947. uriTokens.push(authority);
  948. if (components.path && components.path.charAt(0) !== "/") {
  949. uriTokens.push("/");
  950. }
  951. }
  952. if (components.path !== undefined) {
  953. var s = components.path;
  954. if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
  955. s = removeDotSegments(s);
  956. }
  957. if (authority === undefined) {
  958. s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
  959. }
  960. uriTokens.push(s);
  961. }
  962. if (components.query !== undefined) {
  963. uriTokens.push("?");
  964. uriTokens.push(components.query);
  965. }
  966. if (components.fragment !== undefined) {
  967. uriTokens.push("#");
  968. uriTokens.push(components.fragment);
  969. }
  970. return uriTokens.join(""); //merge tokens into a string
  971. }
  972. function resolveComponents(base, relative) {
  973. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  974. var skipNormalization = arguments[3];
  975. var target = {};
  976. if (!skipNormalization) {
  977. base = parse(serialize(base, options), options); //normalize base components
  978. relative = parse(serialize(relative, options), options); //normalize relative components
  979. }
  980. options = options || {};
  981. if (!options.tolerant && relative.scheme) {
  982. target.scheme = relative.scheme;
  983. //target.authority = relative.authority;
  984. target.userinfo = relative.userinfo;
  985. target.host = relative.host;
  986. target.port = relative.port;
  987. target.path = removeDotSegments(relative.path || "");
  988. target.query = relative.query;
  989. } else {
  990. if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
  991. //target.authority = relative.authority;
  992. target.userinfo = relative.userinfo;
  993. target.host = relative.host;
  994. target.port = relative.port;
  995. target.path = removeDotSegments(relative.path || "");
  996. target.query = relative.query;
  997. } else {
  998. if (!relative.path) {
  999. target.path = base.path;
  1000. if (relative.query !== undefined) {
  1001. target.query = relative.query;
  1002. } else {
  1003. target.query = base.query;
  1004. }
  1005. } else {
  1006. if (relative.path.charAt(0) === "/") {
  1007. target.path = removeDotSegments(relative.path);
  1008. } else {
  1009. if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
  1010. target.path = "/" + relative.path;
  1011. } else if (!base.path) {
  1012. target.path = relative.path;
  1013. } else {
  1014. target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
  1015. }
  1016. target.path = removeDotSegments(target.path);
  1017. }
  1018. target.query = relative.query;
  1019. }
  1020. //target.authority = base.authority;
  1021. target.userinfo = base.userinfo;
  1022. target.host = base.host;
  1023. target.port = base.port;
  1024. }
  1025. target.scheme = base.scheme;
  1026. }
  1027. target.fragment = relative.fragment;
  1028. return target;
  1029. }
  1030. function resolve(baseURI, relativeURI, options) {
  1031. var schemelessOptions = assign({ scheme: 'null' }, options);
  1032. return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
  1033. }
  1034. function normalize(uri, options) {
  1035. if (typeof uri === "string") {
  1036. uri = serialize(parse(uri, options), options);
  1037. } else if (typeOf(uri) === "object") {
  1038. uri = parse(serialize(uri, options), options);
  1039. }
  1040. return uri;
  1041. }
  1042. function equal(uriA, uriB, options) {
  1043. if (typeof uriA === "string") {
  1044. uriA = serialize(parse(uriA, options), options);
  1045. } else if (typeOf(uriA) === "object") {
  1046. uriA = serialize(uriA, options);
  1047. }
  1048. if (typeof uriB === "string") {
  1049. uriB = serialize(parse(uriB, options), options);
  1050. } else if (typeOf(uriB) === "object") {
  1051. uriB = serialize(uriB, options);
  1052. }
  1053. return uriA === uriB;
  1054. }
  1055. function escapeComponent(str, options) {
  1056. return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
  1057. }
  1058. function unescapeComponent(str, options) {
  1059. return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
  1060. }
  1061. var handler = {
  1062. scheme: "http",
  1063. domainHost: true,
  1064. parse: function parse(components, options) {
  1065. //report missing host
  1066. if (!components.host) {
  1067. components.error = components.error || "HTTP URIs must have a host.";
  1068. }
  1069. return components;
  1070. },
  1071. serialize: function serialize(components, options) {
  1072. var secure = String(components.scheme).toLowerCase() === "https";
  1073. //normalize the default port
  1074. if (components.port === (secure ? 443 : 80) || components.port === "") {
  1075. components.port = undefined;
  1076. }
  1077. //normalize the empty path
  1078. if (!components.path) {
  1079. components.path = "/";
  1080. }
  1081. //NOTE: We do not parse query strings for HTTP URIs
  1082. //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
  1083. //and not the HTTP spec.
  1084. return components;
  1085. }
  1086. };
  1087. var handler$1 = {
  1088. scheme: "https",
  1089. domainHost: handler.domainHost,
  1090. parse: handler.parse,
  1091. serialize: handler.serialize
  1092. };
  1093. function isSecure(wsComponents) {
  1094. return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
  1095. }
  1096. //RFC 6455
  1097. var handler$2 = {
  1098. scheme: "ws",
  1099. domainHost: true,
  1100. parse: function parse(components, options) {
  1101. var wsComponents = components;
  1102. //indicate if the secure flag is set
  1103. wsComponents.secure = isSecure(wsComponents);
  1104. //construct resouce name
  1105. wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
  1106. wsComponents.path = undefined;
  1107. wsComponents.query = undefined;
  1108. return wsComponents;
  1109. },
  1110. serialize: function serialize(wsComponents, options) {
  1111. //normalize the default port
  1112. if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
  1113. wsComponents.port = undefined;
  1114. }
  1115. //ensure scheme matches secure flag
  1116. if (typeof wsComponents.secure === 'boolean') {
  1117. wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
  1118. wsComponents.secure = undefined;
  1119. }
  1120. //reconstruct path from resource name
  1121. if (wsComponents.resourceName) {
  1122. var _wsComponents$resourc = wsComponents.resourceName.split('?'),
  1123. _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
  1124. path = _wsComponents$resourc2[0],
  1125. query = _wsComponents$resourc2[1];
  1126. wsComponents.path = path && path !== '/' ? path : undefined;
  1127. wsComponents.query = query;
  1128. wsComponents.resourceName = undefined;
  1129. }
  1130. //forbid fragment component
  1131. wsComponents.fragment = undefined;
  1132. return wsComponents;
  1133. }
  1134. };
  1135. var handler$3 = {
  1136. scheme: "wss",
  1137. domainHost: handler$2.domainHost,
  1138. parse: handler$2.parse,
  1139. serialize: handler$2.serialize
  1140. };
  1141. var O = {};
  1142. var isIRI = true;
  1143. //RFC 3986
  1144. var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
  1145. var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
  1146. var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
  1147. //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
  1148. //const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
  1149. //const WSP$$ = "[\\x20\\x09]";
  1150. //const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127)
  1151. //const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext
  1152. //const VCHAR$$ = "[\\x21-\\x7E]";
  1153. //const WSP$$ = "[\\x20\\x09]";
  1154. //const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext
  1155. //const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
  1156. //const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
  1157. //const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
  1158. var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
  1159. var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
  1160. var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
  1161. var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
  1162. var UNRESERVED = new RegExp(UNRESERVED$$, "g");
  1163. var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
  1164. var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
  1165. var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
  1166. var NOT_HFVALUE = NOT_HFNAME;
  1167. function decodeUnreserved(str) {
  1168. var decStr = pctDecChars(str);
  1169. return !decStr.match(UNRESERVED) ? str : decStr;
  1170. }
  1171. var handler$4 = {
  1172. scheme: "mailto",
  1173. parse: function parse$$1(components, options) {
  1174. var mailtoComponents = components;
  1175. var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
  1176. mailtoComponents.path = undefined;
  1177. if (mailtoComponents.query) {
  1178. var unknownHeaders = false;
  1179. var headers = {};
  1180. var hfields = mailtoComponents.query.split("&");
  1181. for (var x = 0, xl = hfields.length; x < xl; ++x) {
  1182. var hfield = hfields[x].split("=");
  1183. switch (hfield[0]) {
  1184. case "to":
  1185. var toAddrs = hfield[1].split(",");
  1186. for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
  1187. to.push(toAddrs[_x]);
  1188. }
  1189. break;
  1190. case "subject":
  1191. mailtoComponents.subject = unescapeComponent(hfield[1], options);
  1192. break;
  1193. case "body":
  1194. mailtoComponents.body = unescapeComponent(hfield[1], options);
  1195. break;
  1196. default:
  1197. unknownHeaders = true;
  1198. headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
  1199. break;
  1200. }
  1201. }
  1202. if (unknownHeaders) mailtoComponents.headers = headers;
  1203. }
  1204. mailtoComponents.query = undefined;
  1205. for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
  1206. var addr = to[_x2].split("@");
  1207. addr[0] = unescapeComponent(addr[0]);
  1208. if (!options.unicodeSupport) {
  1209. //convert Unicode IDN -> ASCII IDN
  1210. try {
  1211. addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
  1212. } catch (e) {
  1213. mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
  1214. }
  1215. } else {
  1216. addr[1] = unescapeComponent(addr[1], options).toLowerCase();
  1217. }
  1218. to[_x2] = addr.join("@");
  1219. }
  1220. return mailtoComponents;
  1221. },
  1222. serialize: function serialize$$1(mailtoComponents, options) {
  1223. var components = mailtoComponents;
  1224. var to = toArray(mailtoComponents.to);
  1225. if (to) {
  1226. for (var x = 0, xl = to.length; x < xl; ++x) {
  1227. var toAddr = String(to[x]);
  1228. var atIdx = toAddr.lastIndexOf("@");
  1229. var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
  1230. var domain = toAddr.slice(atIdx + 1);
  1231. //convert IDN via punycode
  1232. try {
  1233. domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
  1234. } catch (e) {
  1235. components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
  1236. }
  1237. to[x] = localPart + "@" + domain;
  1238. }
  1239. components.path = to.join(",");
  1240. }
  1241. var headers = mailtoComponents.headers = mailtoComponents.headers || {};
  1242. if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
  1243. if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
  1244. var fields = [];
  1245. for (var name in headers) {
  1246. if (headers[name] !== O[name]) {
  1247. fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
  1248. }
  1249. }
  1250. if (fields.length) {
  1251. components.query = fields.join("&");
  1252. }
  1253. return components;
  1254. }
  1255. };
  1256. var URN_PARSE = /^([^\:]+)\:(.*)/;
  1257. //RFC 2141
  1258. var handler$5 = {
  1259. scheme: "urn",
  1260. parse: function parse$$1(components, options) {
  1261. var matches = components.path && components.path.match(URN_PARSE);
  1262. var urnComponents = components;
  1263. if (matches) {
  1264. var scheme = options.scheme || urnComponents.scheme || "urn";
  1265. var nid = matches[1].toLowerCase();
  1266. var nss = matches[2];
  1267. var urnScheme = scheme + ":" + (options.nid || nid);
  1268. var schemeHandler = SCHEMES[urnScheme];
  1269. urnComponents.nid = nid;
  1270. urnComponents.nss = nss;
  1271. urnComponents.path = undefined;
  1272. if (schemeHandler) {
  1273. urnComponents = schemeHandler.parse(urnComponents, options);
  1274. }
  1275. } else {
  1276. urnComponents.error = urnComponents.error || "URN can not be parsed.";
  1277. }
  1278. return urnComponents;
  1279. },
  1280. serialize: function serialize$$1(urnComponents, options) {
  1281. var scheme = options.scheme || urnComponents.scheme || "urn";
  1282. var nid = urnComponents.nid;
  1283. var urnScheme = scheme + ":" + (options.nid || nid);
  1284. var schemeHandler = SCHEMES[urnScheme];
  1285. if (schemeHandler) {
  1286. urnComponents = schemeHandler.serialize(urnComponents, options);
  1287. }
  1288. var uriComponents = urnComponents;
  1289. var nss = urnComponents.nss;
  1290. uriComponents.path = (nid || options.nid) + ":" + nss;
  1291. return uriComponents;
  1292. }
  1293. };
  1294. var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
  1295. //RFC 4122
  1296. var handler$6 = {
  1297. scheme: "urn:uuid",
  1298. parse: function parse(urnComponents, options) {
  1299. var uuidComponents = urnComponents;
  1300. uuidComponents.uuid = uuidComponents.nss;
  1301. uuidComponents.nss = undefined;
  1302. if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
  1303. uuidComponents.error = uuidComponents.error || "UUID is not valid.";
  1304. }
  1305. return uuidComponents;
  1306. },
  1307. serialize: function serialize(uuidComponents, options) {
  1308. var urnComponents = uuidComponents;
  1309. //normalize UUID
  1310. urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
  1311. return urnComponents;
  1312. }
  1313. };
  1314. SCHEMES[handler.scheme] = handler;
  1315. SCHEMES[handler$1.scheme] = handler$1;
  1316. SCHEMES[handler$2.scheme] = handler$2;
  1317. SCHEMES[handler$3.scheme] = handler$3;
  1318. SCHEMES[handler$4.scheme] = handler$4;
  1319. SCHEMES[handler$5.scheme] = handler$5;
  1320. SCHEMES[handler$6.scheme] = handler$6;
  1321. exports.SCHEMES = SCHEMES;
  1322. exports.pctEncChar = pctEncChar;
  1323. exports.pctDecChars = pctDecChars;
  1324. exports.parse = parse;
  1325. exports.removeDotSegments = removeDotSegments;
  1326. exports.serialize = serialize;
  1327. exports.resolveComponents = resolveComponents;
  1328. exports.resolve = resolve;
  1329. exports.normalize = normalize;
  1330. exports.equal = equal;
  1331. exports.escapeComponent = escapeComponent;
  1332. exports.unescapeComponent = unescapeComponent;
  1333. Object.defineProperty(exports, '__esModule', { value: true });
  1334. })));
  1335. //# sourceMappingURL=uri.all.js.map
  1336. }, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
  1337. return __REQUIRE__(1609944441878);
  1338. })()
  1339. //# sourceMappingURL=index.js.map