[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> url.js (source)

   1  /******/ (() => { // webpackBootstrap
   2  /******/     var __webpack_modules__ = ({
   3  
   4  /***/ 9681:
   5  /***/ ((module) => {
   6  
   7  var characterMap = {
   8      "À": "A",
   9      "Á": "A",
  10      "Â": "A",
  11      "Ã": "A",
  12      "Ä": "A",
  13      "Å": "A",
  14      "Ấ": "A",
  15      "Ắ": "A",
  16      "Ẳ": "A",
  17      "Ẵ": "A",
  18      "Ặ": "A",
  19      "Æ": "AE",
  20      "Ầ": "A",
  21      "Ằ": "A",
  22      "Ȃ": "A",
  23      "Ả": "A",
  24      "Ạ": "A",
  25      "Ẩ": "A",
  26      "Ẫ": "A",
  27      "Ậ": "A",
  28      "Ç": "C",
  29      "Ḉ": "C",
  30      "È": "E",
  31      "É": "E",
  32      "Ê": "E",
  33      "Ë": "E",
  34      "Ế": "E",
  35      "Ḗ": "E",
  36      "Ề": "E",
  37      "Ḕ": "E",
  38      "Ḝ": "E",
  39      "Ȇ": "E",
  40      "Ẻ": "E",
  41      "Ẽ": "E",
  42      "Ẹ": "E",
  43      "Ể": "E",
  44      "Ễ": "E",
  45      "Ệ": "E",
  46      "Ì": "I",
  47      "Í": "I",
  48      "Î": "I",
  49      "Ï": "I",
  50      "Ḯ": "I",
  51      "Ȋ": "I",
  52      "Ỉ": "I",
  53      "Ị": "I",
  54      "Ð": "D",
  55      "Ñ": "N",
  56      "Ò": "O",
  57      "Ó": "O",
  58      "Ô": "O",
  59      "Õ": "O",
  60      "Ö": "O",
  61      "Ø": "O",
  62      "Ố": "O",
  63      "Ṍ": "O",
  64      "Ṓ": "O",
  65      "Ȏ": "O",
  66      "Ỏ": "O",
  67      "Ọ": "O",
  68      "Ổ": "O",
  69      "Ỗ": "O",
  70      "Ộ": "O",
  71      "Ờ": "O",
  72      "Ở": "O",
  73      "Ỡ": "O",
  74      "Ớ": "O",
  75      "Ợ": "O",
  76      "Ù": "U",
  77      "Ú": "U",
  78      "Û": "U",
  79      "Ü": "U",
  80      "Ủ": "U",
  81      "Ụ": "U",
  82      "Ử": "U",
  83      "Ữ": "U",
  84      "Ự": "U",
  85      "Ý": "Y",
  86      "à": "a",
  87      "á": "a",
  88      "â": "a",
  89      "ã": "a",
  90      "ä": "a",
  91      "å": "a",
  92      "ấ": "a",
  93      "ắ": "a",
  94      "ẳ": "a",
  95      "ẵ": "a",
  96      "ặ": "a",
  97      "æ": "ae",
  98      "ầ": "a",
  99      "ằ": "a",
 100      "ȃ": "a",
 101      "ả": "a",
 102      "ạ": "a",
 103      "ẩ": "a",
 104      "ẫ": "a",
 105      "ậ": "a",
 106      "ç": "c",
 107      "ḉ": "c",
 108      "è": "e",
 109      "é": "e",
 110      "ê": "e",
 111      "ë": "e",
 112      "ế": "e",
 113      "ḗ": "e",
 114      "ề": "e",
 115      "ḕ": "e",
 116      "ḝ": "e",
 117      "ȇ": "e",
 118      "ẻ": "e",
 119      "ẽ": "e",
 120      "ẹ": "e",
 121      "ể": "e",
 122      "ễ": "e",
 123      "ệ": "e",
 124      "ì": "i",
 125      "í": "i",
 126      "î": "i",
 127      "ï": "i",
 128      "ḯ": "i",
 129      "ȋ": "i",
 130      "ỉ": "i",
 131      "ị": "i",
 132      "ð": "d",
 133      "ñ": "n",
 134      "ò": "o",
 135      "ó": "o",
 136      "ô": "o",
 137      "õ": "o",
 138      "ö": "o",
 139      "ø": "o",
 140      "ố": "o",
 141      "ṍ": "o",
 142      "ṓ": "o",
 143      "ȏ": "o",
 144      "ỏ": "o",
 145      "ọ": "o",
 146      "ổ": "o",
 147      "ỗ": "o",
 148      "ộ": "o",
 149      "ờ": "o",
 150      "ở": "o",
 151      "ỡ": "o",
 152      "ớ": "o",
 153      "ợ": "o",
 154      "ù": "u",
 155      "ú": "u",
 156      "û": "u",
 157      "ü": "u",
 158      "ủ": "u",
 159      "ụ": "u",
 160      "ử": "u",
 161      "ữ": "u",
 162      "ự": "u",
 163      "ý": "y",
 164      "ÿ": "y",
 165      "Ā": "A",
 166      "ā": "a",
 167      "Ă": "A",
 168      "ă": "a",
 169      "Ą": "A",
 170      "ą": "a",
 171      "Ć": "C",
 172      "ć": "c",
 173      "Ĉ": "C",
 174      "ĉ": "c",
 175      "Ċ": "C",
 176      "ċ": "c",
 177      "Č": "C",
 178      "č": "c",
 179      "C̆": "C",
 180      "c̆": "c",
 181      "Ď": "D",
 182      "ď": "d",
 183      "Đ": "D",
 184      "đ": "d",
 185      "Ē": "E",
 186      "ē": "e",
 187      "Ĕ": "E",
 188      "ĕ": "e",
 189      "Ė": "E",
 190      "ė": "e",
 191      "Ę": "E",
 192      "ę": "e",
 193      "Ě": "E",
 194      "ě": "e",
 195      "Ĝ": "G",
 196      "Ǵ": "G",
 197      "ĝ": "g",
 198      "ǵ": "g",
 199      "Ğ": "G",
 200      "ğ": "g",
 201      "Ġ": "G",
 202      "ġ": "g",
 203      "Ģ": "G",
 204      "ģ": "g",
 205      "Ĥ": "H",
 206      "ĥ": "h",
 207      "Ħ": "H",
 208      "ħ": "h",
 209      "Ḫ": "H",
 210      "ḫ": "h",
 211      "Ĩ": "I",
 212      "ĩ": "i",
 213      "Ī": "I",
 214      "ī": "i",
 215      "Ĭ": "I",
 216      "ĭ": "i",
 217      "Į": "I",
 218      "į": "i",
 219      "İ": "I",
 220      "ı": "i",
 221      "IJ": "IJ",
 222      "ij": "ij",
 223      "Ĵ": "J",
 224      "ĵ": "j",
 225      "Ķ": "K",
 226      "ķ": "k",
 227      "Ḱ": "K",
 228      "ḱ": "k",
 229      "K̆": "K",
 230      "k̆": "k",
 231      "Ĺ": "L",
 232      "ĺ": "l",
 233      "Ļ": "L",
 234      "ļ": "l",
 235      "Ľ": "L",
 236      "ľ": "l",
 237      "Ŀ": "L",
 238      "ŀ": "l",
 239      "Ł": "l",
 240      "ł": "l",
 241      "Ḿ": "M",
 242      "ḿ": "m",
 243      "M̆": "M",
 244      "m̆": "m",
 245      "Ń": "N",
 246      "ń": "n",
 247      "Ņ": "N",
 248      "ņ": "n",
 249      "Ň": "N",
 250      "ň": "n",
 251      "ʼn": "n",
 252      "N̆": "N",
 253      "n̆": "n",
 254      "Ō": "O",
 255      "ō": "o",
 256      "Ŏ": "O",
 257      "ŏ": "o",
 258      "Ő": "O",
 259      "ő": "o",
 260      "Œ": "OE",
 261      "œ": "oe",
 262      "P̆": "P",
 263      "p̆": "p",
 264      "Ŕ": "R",
 265      "ŕ": "r",
 266      "Ŗ": "R",
 267      "ŗ": "r",
 268      "Ř": "R",
 269      "ř": "r",
 270      "R̆": "R",
 271      "r̆": "r",
 272      "Ȓ": "R",
 273      "ȓ": "r",
 274      "Ś": "S",
 275      "ś": "s",
 276      "Ŝ": "S",
 277      "ŝ": "s",
 278      "Ş": "S",
 279      "Ș": "S",
 280      "ș": "s",
 281      "ş": "s",
 282      "Š": "S",
 283      "š": "s",
 284      "Ţ": "T",
 285      "ţ": "t",
 286      "ț": "t",
 287      "Ț": "T",
 288      "Ť": "T",
 289      "ť": "t",
 290      "Ŧ": "T",
 291      "ŧ": "t",
 292      "T̆": "T",
 293      "t̆": "t",
 294      "Ũ": "U",
 295      "ũ": "u",
 296      "Ū": "U",
 297      "ū": "u",
 298      "Ŭ": "U",
 299      "ŭ": "u",
 300      "Ů": "U",
 301      "ů": "u",
 302      "Ű": "U",
 303      "ű": "u",
 304      "Ų": "U",
 305      "ų": "u",
 306      "Ȗ": "U",
 307      "ȗ": "u",
 308      "V̆": "V",
 309      "v̆": "v",
 310      "Ŵ": "W",
 311      "ŵ": "w",
 312      "Ẃ": "W",
 313      "ẃ": "w",
 314      "X̆": "X",
 315      "x̆": "x",
 316      "Ŷ": "Y",
 317      "ŷ": "y",
 318      "Ÿ": "Y",
 319      "Y̆": "Y",
 320      "y̆": "y",
 321      "Ź": "Z",
 322      "ź": "z",
 323      "Ż": "Z",
 324      "ż": "z",
 325      "Ž": "Z",
 326      "ž": "z",
 327      "ſ": "s",
 328      "ƒ": "f",
 329      "Ơ": "O",
 330      "ơ": "o",
 331      "Ư": "U",
 332      "ư": "u",
 333      "Ǎ": "A",
 334      "ǎ": "a",
 335      "Ǐ": "I",
 336      "ǐ": "i",
 337      "Ǒ": "O",
 338      "ǒ": "o",
 339      "Ǔ": "U",
 340      "ǔ": "u",
 341      "Ǖ": "U",
 342      "ǖ": "u",
 343      "Ǘ": "U",
 344      "ǘ": "u",
 345      "Ǚ": "U",
 346      "ǚ": "u",
 347      "Ǜ": "U",
 348      "ǜ": "u",
 349      "Ứ": "U",
 350      "ứ": "u",
 351      "Ṹ": "U",
 352      "ṹ": "u",
 353      "Ǻ": "A",
 354      "ǻ": "a",
 355      "Ǽ": "AE",
 356      "ǽ": "ae",
 357      "Ǿ": "O",
 358      "ǿ": "o",
 359      "Þ": "TH",
 360      "þ": "th",
 361      "Ṕ": "P",
 362      "ṕ": "p",
 363      "Ṥ": "S",
 364      "ṥ": "s",
 365      "X́": "X",
 366      "x́": "x",
 367      "Ѓ": "Г",
 368      "ѓ": "г",
 369      "Ќ": "К",
 370      "ќ": "к",
 371      "A̋": "A",
 372      "a̋": "a",
 373      "E̋": "E",
 374      "e̋": "e",
 375      "I̋": "I",
 376      "i̋": "i",
 377      "Ǹ": "N",
 378      "ǹ": "n",
 379      "Ồ": "O",
 380      "ồ": "o",
 381      "Ṑ": "O",
 382      "ṑ": "o",
 383      "Ừ": "U",
 384      "ừ": "u",
 385      "Ẁ": "W",
 386      "ẁ": "w",
 387      "Ỳ": "Y",
 388      "ỳ": "y",
 389      "Ȁ": "A",
 390      "ȁ": "a",
 391      "Ȅ": "E",
 392      "ȅ": "e",
 393      "Ȉ": "I",
 394      "ȉ": "i",
 395      "Ȍ": "O",
 396      "ȍ": "o",
 397      "Ȑ": "R",
 398      "ȑ": "r",
 399      "Ȕ": "U",
 400      "ȕ": "u",
 401      "B̌": "B",
 402      "b̌": "b",
 403      "Č̣": "C",
 404      "č̣": "c",
 405      "Ê̌": "E",
 406      "ê̌": "e",
 407      "F̌": "F",
 408      "f̌": "f",
 409      "Ǧ": "G",
 410      "ǧ": "g",
 411      "Ȟ": "H",
 412      "ȟ": "h",
 413      "J̌": "J",
 414      "ǰ": "j",
 415      "Ǩ": "K",
 416      "ǩ": "k",
 417      "M̌": "M",
 418      "m̌": "m",
 419      "P̌": "P",
 420      "p̌": "p",
 421      "Q̌": "Q",
 422      "q̌": "q",
 423      "Ř̩": "R",
 424      "ř̩": "r",
 425      "Ṧ": "S",
 426      "ṧ": "s",
 427      "V̌": "V",
 428      "v̌": "v",
 429      "W̌": "W",
 430      "w̌": "w",
 431      "X̌": "X",
 432      "x̌": "x",
 433      "Y̌": "Y",
 434      "y̌": "y",
 435      "A̧": "A",
 436      "a̧": "a",
 437      "B̧": "B",
 438      "b̧": "b",
 439      "Ḑ": "D",
 440      "ḑ": "d",
 441      "Ȩ": "E",
 442      "ȩ": "e",
 443      "Ɛ̧": "E",
 444      "ɛ̧": "e",
 445      "Ḩ": "H",
 446      "ḩ": "h",
 447      "I̧": "I",
 448      "i̧": "i",
 449      "Ɨ̧": "I",
 450      "ɨ̧": "i",
 451      "M̧": "M",
 452      "m̧": "m",
 453      "O̧": "O",
 454      "o̧": "o",
 455      "Q̧": "Q",
 456      "q̧": "q",
 457      "U̧": "U",
 458      "u̧": "u",
 459      "X̧": "X",
 460      "x̧": "x",
 461      "Z̧": "Z",
 462      "z̧": "z",
 463      "й":"и",
 464      "Й":"И",
 465      "ё":"е",
 466      "Ё":"Е",
 467  };
 468  
 469  var chars = Object.keys(characterMap).join('|');
 470  var allAccents = new RegExp(chars, 'g');
 471  var firstAccent = new RegExp(chars, '');
 472  
 473  function matcher(match) {
 474      return characterMap[match];
 475  }
 476  
 477  var removeAccents = function(string) {
 478      return string.replace(allAccents, matcher);
 479  };
 480  
 481  var hasAccents = function(string) {
 482      return !!string.match(firstAccent);
 483  };
 484  
 485  module.exports = removeAccents;
 486  module.exports.has = hasAccents;
 487  module.exports.remove = removeAccents;
 488  
 489  
 490  /***/ })
 491  
 492  /******/     });
 493  /************************************************************************/
 494  /******/     // The module cache
 495  /******/     var __webpack_module_cache__ = {};
 496  /******/     
 497  /******/     // The require function
 498  /******/ 	function __webpack_require__(moduleId) {
 499  /******/         // Check if module is in cache
 500  /******/         var cachedModule = __webpack_module_cache__[moduleId];
 501  /******/         if (cachedModule !== undefined) {
 502  /******/             return cachedModule.exports;
 503  /******/         }
 504  /******/         // Create a new module (and put it into the cache)
 505  /******/         var module = __webpack_module_cache__[moduleId] = {
 506  /******/             // no module.id needed
 507  /******/             // no module.loaded needed
 508  /******/             exports: {}
 509  /******/         };
 510  /******/     
 511  /******/         // Execute the module function
 512  /******/         __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
 513  /******/     
 514  /******/         // Return the exports of the module
 515  /******/         return module.exports;
 516  /******/     }
 517  /******/     
 518  /************************************************************************/
 519  /******/     /* webpack/runtime/compat get default export */
 520  /******/     (() => {
 521  /******/         // getDefaultExport function for compatibility with non-harmony modules
 522  /******/         __webpack_require__.n = (module) => {
 523  /******/             var getter = module && module.__esModule ?
 524  /******/                 () => (module['default']) :
 525  /******/                 () => (module);
 526  /******/             __webpack_require__.d(getter, { a: getter });
 527  /******/             return getter;
 528  /******/         };
 529  /******/     })();
 530  /******/     
 531  /******/     /* webpack/runtime/define property getters */
 532  /******/     (() => {
 533  /******/         // define getter functions for harmony exports
 534  /******/         __webpack_require__.d = (exports, definition) => {
 535  /******/             for(var key in definition) {
 536  /******/                 if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
 537  /******/                     Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
 538  /******/                 }
 539  /******/             }
 540  /******/         };
 541  /******/     })();
 542  /******/     
 543  /******/     /* webpack/runtime/hasOwnProperty shorthand */
 544  /******/     (() => {
 545  /******/         __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
 546  /******/     })();
 547  /******/     
 548  /******/     /* webpack/runtime/make namespace object */
 549  /******/     (() => {
 550  /******/         // define __esModule on exports
 551  /******/         __webpack_require__.r = (exports) => {
 552  /******/             if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
 553  /******/                 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
 554  /******/             }
 555  /******/             Object.defineProperty(exports, '__esModule', { value: true });
 556  /******/         };
 557  /******/     })();
 558  /******/     
 559  /************************************************************************/
 560  var __webpack_exports__ = {};
 561  // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
 562  (() => {
 563  "use strict";
 564  // ESM COMPAT FLAG
 565  __webpack_require__.r(__webpack_exports__);
 566  
 567  // EXPORTS
 568  __webpack_require__.d(__webpack_exports__, {
 569    addQueryArgs: () => (/* reexport */ addQueryArgs),
 570    buildQueryString: () => (/* reexport */ buildQueryString),
 571    cleanForSlug: () => (/* reexport */ cleanForSlug),
 572    filterURLForDisplay: () => (/* reexport */ filterURLForDisplay),
 573    getAuthority: () => (/* reexport */ getAuthority),
 574    getFilename: () => (/* reexport */ getFilename),
 575    getFragment: () => (/* reexport */ getFragment),
 576    getPath: () => (/* reexport */ getPath),
 577    getPathAndQueryString: () => (/* reexport */ getPathAndQueryString),
 578    getProtocol: () => (/* reexport */ getProtocol),
 579    getQueryArg: () => (/* reexport */ getQueryArg),
 580    getQueryArgs: () => (/* reexport */ getQueryArgs),
 581    getQueryString: () => (/* reexport */ getQueryString),
 582    hasQueryArg: () => (/* reexport */ hasQueryArg),
 583    isEmail: () => (/* reexport */ isEmail),
 584    isPhoneNumber: () => (/* reexport */ isPhoneNumber),
 585    isURL: () => (/* reexport */ isURL),
 586    isValidAuthority: () => (/* reexport */ isValidAuthority),
 587    isValidFragment: () => (/* reexport */ isValidFragment),
 588    isValidPath: () => (/* reexport */ isValidPath),
 589    isValidProtocol: () => (/* reexport */ isValidProtocol),
 590    isValidQueryString: () => (/* reexport */ isValidQueryString),
 591    normalizePath: () => (/* reexport */ normalizePath),
 592    prependHTTP: () => (/* reexport */ prependHTTP),
 593    prependHTTPS: () => (/* reexport */ prependHTTPS),
 594    removeQueryArgs: () => (/* reexport */ removeQueryArgs),
 595    safeDecodeURI: () => (/* reexport */ safeDecodeURI),
 596    safeDecodeURIComponent: () => (/* reexport */ safeDecodeURIComponent)
 597  });
 598  
 599  ;// ./node_modules/@wordpress/url/build-module/is-url.js
 600  /* wp:polyfill */
 601  /**
 602   * Determines whether the given string looks like a URL.
 603   *
 604   * @param {string} url The string to scrutinise.
 605   *
 606   * @example
 607   * ```js
 608   * const isURL = isURL( 'https://wordpress.org' ); // true
 609   * ```
 610   *
 611   * @see https://url.spec.whatwg.org/
 612   * @see https://url.spec.whatwg.org/#valid-url-string
 613   *
 614   * @return {boolean} Whether or not it looks like a URL.
 615   */
 616  function isURL(url) {
 617    // A URL can be considered value if the `URL` constructor is able to parse
 618    // it. The constructor throws an error for an invalid URL.
 619    try {
 620      new URL(url);
 621      return true;
 622    } catch {
 623      return false;
 624    }
 625  }
 626  
 627  ;// ./node_modules/@wordpress/url/build-module/is-email.js
 628  const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
 629  
 630  /**
 631   * Determines whether the given string looks like an email.
 632   *
 633   * @param {string} email The string to scrutinise.
 634   *
 635   * @example
 636   * ```js
 637   * const isEmail = isEmail( 'hello@wordpress.org' ); // true
 638   * ```
 639   *
 640   * @return {boolean} Whether or not it looks like an email.
 641   */
 642  function isEmail(email) {
 643    return EMAIL_REGEXP.test(email);
 644  }
 645  
 646  ;// ./node_modules/@wordpress/url/build-module/is-phone-number.js
 647  const PHONE_REGEXP = /^(tel:)?(\+)?\d{6,15}$/;
 648  
 649  /**
 650   * Determines whether the given string looks like a phone number.
 651   *
 652   * @param {string} phoneNumber The string to scrutinize.
 653   *
 654   * @example
 655   * ```js
 656   * const isPhoneNumber = isPhoneNumber('+1 (555) 123-4567'); // true
 657   * ```
 658   *
 659   * @return {boolean} Whether or not it looks like a phone number.
 660   */
 661  function isPhoneNumber(phoneNumber) {
 662    // Remove any seperator from phone number.
 663    phoneNumber = phoneNumber.replace(/[-.() ]/g, '');
 664    return PHONE_REGEXP.test(phoneNumber);
 665  }
 666  
 667  ;// ./node_modules/@wordpress/url/build-module/get-protocol.js
 668  /**
 669   * Returns the protocol part of the URL.
 670   *
 671   * @param {string} url The full URL.
 672   *
 673   * @example
 674   * ```js
 675   * const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'
 676   * const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'
 677   * ```
 678   *
 679   * @return {string|void} The protocol part of the URL.
 680   */
 681  function getProtocol(url) {
 682    const matches = /^([^\s:]+:)/.exec(url);
 683    if (matches) {
 684      return matches[1];
 685    }
 686  }
 687  
 688  ;// ./node_modules/@wordpress/url/build-module/is-valid-protocol.js
 689  /**
 690   * Tests if a url protocol is valid.
 691   *
 692   * @param {string} protocol The url protocol.
 693   *
 694   * @example
 695   * ```js
 696   * const isValid = isValidProtocol( 'https:' ); // true
 697   * const isNotValid = isValidProtocol( 'https :' ); // false
 698   * ```
 699   *
 700   * @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).
 701   */
 702  function isValidProtocol(protocol) {
 703    if (!protocol) {
 704      return false;
 705    }
 706    return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol);
 707  }
 708  
 709  ;// ./node_modules/@wordpress/url/build-module/get-authority.js
 710  /**
 711   * Returns the authority part of the URL.
 712   *
 713   * @param {string} url The full URL.
 714   *
 715   * @example
 716   * ```js
 717   * const authority1 = getAuthority( 'https://wordpress.org/help/' ); // 'wordpress.org'
 718   * const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080'
 719   * ```
 720   *
 721   * @return {string|void} The authority part of the URL.
 722   */
 723  function getAuthority(url) {
 724    const matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(url);
 725    if (matches) {
 726      return matches[1];
 727    }
 728  }
 729  
 730  ;// ./node_modules/@wordpress/url/build-module/is-valid-authority.js
 731  /**
 732   * Checks for invalid characters within the provided authority.
 733   *
 734   * @param {string} authority A string containing the URL authority.
 735   *
 736   * @example
 737   * ```js
 738   * const isValid = isValidAuthority( 'wordpress.org' ); // true
 739   * const isNotValid = isValidAuthority( 'wordpress#org' ); // false
 740   * ```
 741   *
 742   * @return {boolean} True if the argument contains a valid authority.
 743   */
 744  function isValidAuthority(authority) {
 745    if (!authority) {
 746      return false;
 747    }
 748    return /^[^\s#?]+$/.test(authority);
 749  }
 750  
 751  ;// ./node_modules/@wordpress/url/build-module/get-path.js
 752  /**
 753   * Returns the path part of the URL.
 754   *
 755   * @param {string} url The full URL.
 756   *
 757   * @example
 758   * ```js
 759   * const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test'
 760   * const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'
 761   * ```
 762   *
 763   * @return {string|void} The path part of the URL.
 764   */
 765  function getPath(url) {
 766    const matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url);
 767    if (matches) {
 768      return matches[1];
 769    }
 770  }
 771  
 772  ;// ./node_modules/@wordpress/url/build-module/is-valid-path.js
 773  /**
 774   * Checks for invalid characters within the provided path.
 775   *
 776   * @param {string} path The URL path.
 777   *
 778   * @example
 779   * ```js
 780   * const isValid = isValidPath( 'test/path/' ); // true
 781   * const isNotValid = isValidPath( '/invalid?test/path/' ); // false
 782   * ```
 783   *
 784   * @return {boolean} True if the argument contains a valid path
 785   */
 786  function isValidPath(path) {
 787    if (!path) {
 788      return false;
 789    }
 790    return /^[^\s#?]+$/.test(path);
 791  }
 792  
 793  ;// ./node_modules/@wordpress/url/build-module/get-query-string.js
 794  /* wp:polyfill */
 795  /**
 796   * Returns the query string part of the URL.
 797   *
 798   * @param {string} url The full URL.
 799   *
 800   * @example
 801   * ```js
 802   * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'
 803   * ```
 804   *
 805   * @return {string|void} The query string part of the URL.
 806   */
 807  function getQueryString(url) {
 808    let query;
 809    try {
 810      query = new URL(url, 'http://example.com').search.substring(1);
 811    } catch (error) {}
 812    if (query) {
 813      return query;
 814    }
 815  }
 816  
 817  ;// ./node_modules/@wordpress/url/build-module/build-query-string.js
 818  /**
 819   * Generates URL-encoded query string using input query data.
 820   *
 821   * It is intended to behave equivalent as PHP's `http_build_query`, configured
 822   * with encoding type PHP_QUERY_RFC3986 (spaces as `%20`).
 823   *
 824   * @example
 825   * ```js
 826   * const queryString = buildQueryString( {
 827   *    simple: 'is ok',
 828   *    arrays: [ 'are', 'fine', 'too' ],
 829   *    objects: {
 830   *       evenNested: {
 831   *          ok: 'yes',
 832   *       },
 833   *    },
 834   * } );
 835   * // "simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes"
 836   * ```
 837   *
 838   * @param {Record<string,*>} data Data to encode.
 839   *
 840   * @return {string} Query string.
 841   */
 842  function buildQueryString(data) {
 843    let string = '';
 844    const stack = Object.entries(data);
 845    let pair;
 846    while (pair = stack.shift()) {
 847      let [key, value] = pair;
 848  
 849      // Support building deeply nested data, from array or object values.
 850      const hasNestedData = Array.isArray(value) || value && value.constructor === Object;
 851      if (hasNestedData) {
 852        // Push array or object values onto the stack as composed of their
 853        // original key and nested index or key, retaining order by a
 854        // combination of Array#reverse and Array#unshift onto the stack.
 855        const valuePairs = Object.entries(value).reverse();
 856        for (const [member, memberValue] of valuePairs) {
 857          stack.unshift([`$key}[$member}]`, memberValue]);
 858        }
 859      } else if (value !== undefined) {
 860        // Null is treated as special case, equivalent to empty string.
 861        if (value === null) {
 862          value = '';
 863        }
 864        string += '&' + [key, value].map(encodeURIComponent).join('=');
 865      }
 866    }
 867  
 868    // Loop will concatenate with leading `&`, but it's only expected for all
 869    // but the first query parameter. This strips the leading `&`, while still
 870    // accounting for the case that the string may in-fact be empty.
 871    return string.substr(1);
 872  }
 873  
 874  ;// ./node_modules/@wordpress/url/build-module/is-valid-query-string.js
 875  /**
 876   * Checks for invalid characters within the provided query string.
 877   *
 878   * @param {string} queryString The query string.
 879   *
 880   * @example
 881   * ```js
 882   * const isValid = isValidQueryString( 'query=true&another=false' ); // true
 883   * const isNotValid = isValidQueryString( 'query=true?another=false' ); // false
 884   * ```
 885   *
 886   * @return {boolean} True if the argument contains a valid query string.
 887   */
 888  function isValidQueryString(queryString) {
 889    if (!queryString) {
 890      return false;
 891    }
 892    return /^[^\s#?\/]+$/.test(queryString);
 893  }
 894  
 895  ;// ./node_modules/@wordpress/url/build-module/get-path-and-query-string.js
 896  /**
 897   * Internal dependencies
 898   */
 899  
 900  
 901  /**
 902   * Returns the path part and query string part of the URL.
 903   *
 904   * @param {string} url The full URL.
 905   *
 906   * @example
 907   * ```js
 908   * const pathAndQueryString1 = getPathAndQueryString( 'http://localhost:8080/this/is/a/test?query=true' ); // '/this/is/a/test?query=true'
 909   * const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'
 910   * ```
 911   *
 912   * @return {string} The path part and query string part of the URL.
 913   */
 914  function getPathAndQueryString(url) {
 915    const path = getPath(url);
 916    const queryString = getQueryString(url);
 917    let value = '/';
 918    if (path) {
 919      value += path;
 920    }
 921    if (queryString) {
 922      value += `?$queryString}`;
 923    }
 924    return value;
 925  }
 926  
 927  ;// ./node_modules/@wordpress/url/build-module/get-fragment.js
 928  /**
 929   * Returns the fragment part of the URL.
 930   *
 931   * @param {string} url The full URL
 932   *
 933   * @example
 934   * ```js
 935   * const fragment1 = getFragment( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // '#fragment'
 936   * const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment'
 937   * ```
 938   *
 939   * @return {string|void} The fragment part of the URL.
 940   */
 941  function getFragment(url) {
 942    const matches = /^\S+?(#[^\s\?]*)/.exec(url);
 943    if (matches) {
 944      return matches[1];
 945    }
 946  }
 947  
 948  ;// ./node_modules/@wordpress/url/build-module/is-valid-fragment.js
 949  /**
 950   * Checks for invalid characters within the provided fragment.
 951   *
 952   * @param {string} fragment The url fragment.
 953   *
 954   * @example
 955   * ```js
 956   * const isValid = isValidFragment( '#valid-fragment' ); // true
 957   * const isNotValid = isValidFragment( '#invalid-#fragment' ); // false
 958   * ```
 959   *
 960   * @return {boolean} True if the argument contains a valid fragment.
 961   */
 962  function isValidFragment(fragment) {
 963    if (!fragment) {
 964      return false;
 965    }
 966    return /^#[^\s#?\/]*$/.test(fragment);
 967  }
 968  
 969  ;// ./node_modules/@wordpress/url/build-module/safe-decode-uri-component.js
 970  /**
 971   * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if
 972   * `decodeURIComponent` throws an error.
 973   *
 974   * @param {string} uriComponent URI component to decode.
 975   *
 976   * @return {string} Decoded URI component if possible.
 977   */
 978  function safeDecodeURIComponent(uriComponent) {
 979    try {
 980      return decodeURIComponent(uriComponent);
 981    } catch (uriComponentError) {
 982      return uriComponent;
 983    }
 984  }
 985  
 986  ;// ./node_modules/@wordpress/url/build-module/get-query-args.js
 987  /**
 988   * Internal dependencies
 989   */
 990  
 991  
 992  
 993  /** @typedef {import('./get-query-arg').QueryArgParsed} QueryArgParsed */
 994  
 995  /**
 996   * @typedef {Record<string,QueryArgParsed>} QueryArgs
 997   */
 998  
 999  /**
1000   * Sets a value in object deeply by a given array of path segments. Mutates the
1001   * object reference.
1002   *
1003   * @param {Record<string,*>} object Object in which to assign.
1004   * @param {string[]}         path   Path segment at which to set value.
1005   * @param {*}                value  Value to set.
1006   */
1007  function setPath(object, path, value) {
1008    const length = path.length;
1009    const lastIndex = length - 1;
1010    for (let i = 0; i < length; i++) {
1011      let key = path[i];
1012      if (!key && Array.isArray(object)) {
1013        // If key is empty string and next value is array, derive key from
1014        // the current length of the array.
1015        key = object.length.toString();
1016      }
1017      key = ['__proto__', 'constructor', 'prototype'].includes(key) ? key.toUpperCase() : key;
1018  
1019      // If the next key in the path is numeric (or empty string), it will be
1020      // created as an array. Otherwise, it will be created as an object.
1021      const isNextKeyArrayIndex = !isNaN(Number(path[i + 1]));
1022      object[key] = i === lastIndex ?
1023      // If at end of path, assign the intended value.
1024      value :
1025      // Otherwise, advance to the next object in the path, creating
1026      // it if it does not yet exist.
1027      object[key] || (isNextKeyArrayIndex ? [] : {});
1028      if (Array.isArray(object[key]) && !isNextKeyArrayIndex) {
1029        // If we current key is non-numeric, but the next value is an
1030        // array, coerce the value to an object.
1031        object[key] = {
1032          ...object[key]
1033        };
1034      }
1035  
1036      // Update working reference object to the next in the path.
1037      object = object[key];
1038    }
1039  }
1040  
1041  /**
1042   * Returns an object of query arguments of the given URL. If the given URL is
1043   * invalid or has no querystring, an empty object is returned.
1044   *
1045   * @param {string} url URL.
1046   *
1047   * @example
1048   * ```js
1049   * const foo = getQueryArgs( 'https://wordpress.org?foo=bar&bar=baz' );
1050   * // { "foo": "bar", "bar": "baz" }
1051   * ```
1052   *
1053   * @return {QueryArgs} Query args object.
1054   */
1055  function getQueryArgs(url) {
1056    return (getQueryString(url) || ''
1057    // Normalize space encoding, accounting for PHP URL encoding
1058    // corresponding to `application/x-www-form-urlencoded`.
1059    //
1060    // See: https://tools.ietf.org/html/rfc1866#section-8.2.1
1061    ).replace(/\+/g, '%20').split('&').reduce((accumulator, keyValue) => {
1062      const [key, value = ''] = keyValue.split('=')
1063      // Filtering avoids decoding as `undefined` for value, where
1064      // default is restored in destructuring assignment.
1065      .filter(Boolean).map(safeDecodeURIComponent);
1066      if (key) {
1067        const segments = key.replace(/\]/g, '').split('[');
1068        setPath(accumulator, segments, value);
1069      }
1070      return accumulator;
1071    }, Object.create(null));
1072  }
1073  
1074  ;// ./node_modules/@wordpress/url/build-module/add-query-args.js
1075  /**
1076   * Internal dependencies
1077   */
1078  
1079  
1080  
1081  /**
1082   * Appends arguments as querystring to the provided URL. If the URL already
1083   * includes query arguments, the arguments are merged with (and take precedent
1084   * over) the existing set.
1085   *
1086   * @param {string} [url=''] URL to which arguments should be appended. If omitted,
1087   *                          only the resulting querystring is returned.
1088   * @param {Object} [args]   Query arguments to apply to URL.
1089   *
1090   * @example
1091   * ```js
1092   * const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test
1093   * ```
1094   *
1095   * @return {string} URL with arguments applied.
1096   */
1097  function addQueryArgs(url = '', args) {
1098    // If no arguments are to be appended, return original URL.
1099    if (!args || !Object.keys(args).length) {
1100      return url;
1101    }
1102    let baseUrl = url;
1103  
1104    // Determine whether URL already had query arguments.
1105    const queryStringIndex = url.indexOf('?');
1106    if (queryStringIndex !== -1) {
1107      // Merge into existing query arguments.
1108      args = Object.assign(getQueryArgs(url), args);
1109  
1110      // Change working base URL to omit previous query arguments.
1111      baseUrl = baseUrl.substr(0, queryStringIndex);
1112    }
1113    return baseUrl + '?' + buildQueryString(args);
1114  }
1115  
1116  ;// ./node_modules/@wordpress/url/build-module/get-query-arg.js
1117  /**
1118   * Internal dependencies
1119   */
1120  
1121  
1122  /**
1123   * @typedef {{[key: string]: QueryArgParsed}} QueryArgObject
1124   */
1125  
1126  /**
1127   * @typedef {string|string[]|QueryArgObject} QueryArgParsed
1128   */
1129  
1130  /**
1131   * Returns a single query argument of the url
1132   *
1133   * @param {string} url URL.
1134   * @param {string} arg Query arg name.
1135   *
1136   * @example
1137   * ```js
1138   * const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar
1139   * ```
1140   *
1141   * @return {QueryArgParsed|void} Query arg value.
1142   */
1143  function getQueryArg(url, arg) {
1144    return getQueryArgs(url)[arg];
1145  }
1146  
1147  ;// ./node_modules/@wordpress/url/build-module/has-query-arg.js
1148  /**
1149   * Internal dependencies
1150   */
1151  
1152  
1153  /**
1154   * Determines whether the URL contains a given query arg.
1155   *
1156   * @param {string} url URL.
1157   * @param {string} arg Query arg name.
1158   *
1159   * @example
1160   * ```js
1161   * const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true
1162   * ```
1163   *
1164   * @return {boolean} Whether or not the URL contains the query arg.
1165   */
1166  function hasQueryArg(url, arg) {
1167    return getQueryArg(url, arg) !== undefined;
1168  }
1169  
1170  ;// ./node_modules/@wordpress/url/build-module/remove-query-args.js
1171  /**
1172   * Internal dependencies
1173   */
1174  
1175  
1176  
1177  /**
1178   * Removes arguments from the query string of the url
1179   *
1180   * @param {string}    url  URL.
1181   * @param {...string} args Query Args.
1182   *
1183   * @example
1184   * ```js
1185   * const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar
1186   * ```
1187   *
1188   * @return {string} Updated URL.
1189   */
1190  function removeQueryArgs(url, ...args) {
1191    const queryStringIndex = url.indexOf('?');
1192    if (queryStringIndex === -1) {
1193      return url;
1194    }
1195    const query = getQueryArgs(url);
1196    const baseURL = url.substr(0, queryStringIndex);
1197    args.forEach(arg => delete query[arg]);
1198    const queryString = buildQueryString(query);
1199    return queryString ? baseURL + '?' + queryString : baseURL;
1200  }
1201  
1202  ;// ./node_modules/@wordpress/url/build-module/prepend-http.js
1203  /**
1204   * Internal dependencies
1205   */
1206  
1207  const USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
1208  
1209  /**
1210   * Prepends "http://" to a url, if it looks like something that is meant to be a TLD.
1211   *
1212   * @param {string} url The URL to test.
1213   *
1214   * @example
1215   * ```js
1216   * const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org
1217   * ```
1218   *
1219   * @return {string} The updated URL.
1220   */
1221  function prependHTTP(url) {
1222    if (!url) {
1223      return url;
1224    }
1225    url = url.trim();
1226    if (!USABLE_HREF_REGEXP.test(url) && !isEmail(url)) {
1227      return 'http://' + url;
1228    }
1229    return url;
1230  }
1231  
1232  ;// ./node_modules/@wordpress/url/build-module/safe-decode-uri.js
1233  /**
1234   * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
1235   * `decodeURI` throws an error.
1236   *
1237   * @param {string} uri URI to decode.
1238   *
1239   * @example
1240   * ```js
1241   * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'
1242   * ```
1243   *
1244   * @return {string} Decoded URI if possible.
1245   */
1246  function safeDecodeURI(uri) {
1247    try {
1248      return decodeURI(uri);
1249    } catch (uriError) {
1250      return uri;
1251    }
1252  }
1253  
1254  ;// ./node_modules/@wordpress/url/build-module/filter-url-for-display.js
1255  /**
1256   * Returns a URL for display.
1257   *
1258   * @param {string}      url       Original URL.
1259   * @param {number|null} maxLength URL length.
1260   *
1261   * @example
1262   * ```js
1263   * const displayUrl = filterURLForDisplay( 'https://www.wordpress.org/gutenberg/' ); // wordpress.org/gutenberg
1264   * const imageUrl = filterURLForDisplay( 'https://www.wordpress.org/wp-content/uploads/img.png', 20 ); // …ent/uploads/img.png
1265   * ```
1266   *
1267   * @return {string} Displayed URL.
1268   */
1269  function filterURLForDisplay(url, maxLength = null) {
1270    if (!url) {
1271      return '';
1272    }
1273  
1274    // Remove protocol and www prefixes.
1275    let filteredURL = url.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, '').replace(/^www\./i, '');
1276  
1277    // Ends with / and only has that single slash, strip it.
1278    if (filteredURL.match(/^[^\/]+\/$/)) {
1279      filteredURL = filteredURL.replace('/', '');
1280    }
1281  
1282    // capture file name from URL
1283    const fileRegexp = /\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;
1284    if (!maxLength || filteredURL.length <= maxLength || !filteredURL.match(fileRegexp)) {
1285      return filteredURL;
1286    }
1287  
1288    // If the file is not greater than max length, return last portion of URL.
1289    filteredURL = filteredURL.split('?')[0];
1290    const urlPieces = filteredURL.split('/');
1291    const file = urlPieces[urlPieces.length - 1];
1292    if (file.length <= maxLength) {
1293      return '…' + filteredURL.slice(-maxLength);
1294    }
1295  
1296    // If the file is greater than max length, truncate the file.
1297    const index = file.lastIndexOf('.');
1298    const [fileName, extension] = [file.slice(0, index), file.slice(index + 1)];
1299    const truncatedFile = fileName.slice(-3) + '.' + extension;
1300    return file.slice(0, maxLength - truncatedFile.length - 1) + '…' + truncatedFile;
1301  }
1302  
1303  // EXTERNAL MODULE: ./node_modules/remove-accents/index.js
1304  var remove_accents = __webpack_require__(9681);
1305  var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
1306  ;// ./node_modules/@wordpress/url/build-module/clean-for-slug.js
1307  /**
1308   * External dependencies
1309   */
1310  
1311  
1312  /**
1313   * Performs some basic cleanup of a string for use as a post slug.
1314   *
1315   * This replicates some of what `sanitize_title()` does in WordPress core, but
1316   * is only designed to approximate what the slug will be.
1317   *
1318   * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin
1319   * letters. Removes combining diacritical marks. Converts whitespace, periods,
1320   * and forward slashes to hyphens. Removes any remaining non-word characters
1321   * except hyphens. Converts remaining string to lowercase. It does not account
1322   * for octets, HTML entities, or other encoded characters.
1323   *
1324   * @param {string} string Title or slug to be processed.
1325   *
1326   * @return {string} Processed string.
1327   */
1328  function cleanForSlug(string) {
1329    if (!string) {
1330      return '';
1331    }
1332    return remove_accents_default()(string)
1333    // Convert each group of whitespace, periods, and forward slashes to a hyphen.
1334    .replace(/[\s\./]+/g, '-')
1335    // Remove anything that's not a letter, number, underscore or hyphen.
1336    .replace(/[^\p{L}\p{N}_-]+/gu, '')
1337    // Convert to lowercase
1338    .toLowerCase()
1339    // Replace multiple hyphens with a single one.
1340    .replace(/-+/g, '-')
1341    // Remove any remaining leading or trailing hyphens.
1342    .replace(/(^-+)|(-+$)/g, '');
1343  }
1344  
1345  ;// ./node_modules/@wordpress/url/build-module/get-filename.js
1346  /* wp:polyfill */
1347  /**
1348   * Returns the filename part of the URL.
1349   *
1350   * @param {string} url The full URL.
1351   *
1352   * @example
1353   * ```js
1354   * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'
1355   * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'
1356   * ```
1357   *
1358   * @return {string|void} The filename part of the URL.
1359   */
1360  function getFilename(url) {
1361    let filename;
1362    if (!url) {
1363      return;
1364    }
1365    try {
1366      filename = new URL(url, 'http://example.com').pathname.split('/').pop();
1367    } catch (error) {}
1368    if (filename) {
1369      return filename;
1370    }
1371  }
1372  
1373  ;// ./node_modules/@wordpress/url/build-module/normalize-path.js
1374  /**
1375   * Given a path, returns a normalized path where equal query parameter values
1376   * will be treated as identical, regardless of order they appear in the original
1377   * text.
1378   *
1379   * @param {string} path Original path.
1380   *
1381   * @return {string} Normalized path.
1382   */
1383  function normalizePath(path) {
1384    const splitted = path.split('?');
1385    const query = splitted[1];
1386    const base = splitted[0];
1387    if (!query) {
1388      return base;
1389    }
1390  
1391    // 'b=1%2C2&c=2&a=5'
1392    return base + '?' + query
1393    // [ 'b=1%2C2', 'c=2', 'a=5' ]
1394    .split('&')
1395    // [ [ 'b, '1%2C2' ], [ 'c', '2' ], [ 'a', '5' ] ]
1396    .map(entry => entry.split('='))
1397    // [ [ 'b', '1,2' ], [ 'c', '2' ], [ 'a', '5' ] ]
1398    .map(pair => pair.map(decodeURIComponent))
1399    // [ [ 'a', '5' ], [ 'b, '1,2' ], [ 'c', '2' ] ]
1400    .sort((a, b) => a[0].localeCompare(b[0]))
1401    // [ [ 'a', '5' ], [ 'b, '1%2C2' ], [ 'c', '2' ] ]
1402    .map(pair => pair.map(encodeURIComponent))
1403    // [ 'a=5', 'b=1%2C2', 'c=2' ]
1404    .map(pair => pair.join('='))
1405    // 'a=5&b=1%2C2&c=2'
1406    .join('&');
1407  }
1408  
1409  ;// ./node_modules/@wordpress/url/build-module/prepend-https.js
1410  /**
1411   * Internal dependencies
1412   */
1413  
1414  
1415  /**
1416   * Prepends "https://" to a url, if it looks like something that is meant to be a TLD.
1417   *
1418   * Note: this will not replace "http://" with "https://".
1419   *
1420   * @param {string} url The URL to test.
1421   *
1422   * @example
1423   * ```js
1424   * const actualURL = prependHTTPS( 'wordpress.org' ); // https://wordpress.org
1425   * ```
1426   *
1427   * @return {string} The updated URL.
1428   */
1429  function prependHTTPS(url) {
1430    if (!url) {
1431      return url;
1432    }
1433  
1434    // If url starts with http://, return it as is.
1435    if (url.startsWith('http://')) {
1436      return url;
1437    }
1438    url = prependHTTP(url);
1439    return url.replace(/^http:/, 'https:');
1440  }
1441  
1442  ;// ./node_modules/@wordpress/url/build-module/index.js
1443  
1444  
1445  
1446  
1447  
1448  
1449  
1450  
1451  
1452  
1453  
1454  
1455  
1456  
1457  
1458  
1459  
1460  
1461  
1462  
1463  
1464  
1465  
1466  
1467  
1468  
1469  
1470  
1471  
1472  })();
1473  
1474  (window.wp = window.wp || {}).url = __webpack_exports__;
1475  /******/ })()
1476  ;


Generated : Sat Dec 21 08:20:01 2024 Cross-referenced by PHPXref