2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ (() => { // webpackBootstrap
|
2022-09-20 11:43:29 -04:00
|
|
|
|
/******/ var __webpack_modules__ = ({
|
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
|
/***/ 9681:
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/***/ ((module) => {
|
2022-09-20 11:43:29 -04:00
|
|
|
|
|
2023-02-07 02:04:52 -05:00
|
|
|
|
var characterMap = {
|
|
|
|
|
"À": "A",
|
|
|
|
|
"Á": "A",
|
|
|
|
|
"Â": "A",
|
|
|
|
|
"Ã": "A",
|
|
|
|
|
"Ä": "A",
|
|
|
|
|
"Å": "A",
|
|
|
|
|
"Ấ": "A",
|
|
|
|
|
"Ắ": "A",
|
|
|
|
|
"Ẳ": "A",
|
|
|
|
|
"Ẵ": "A",
|
|
|
|
|
"Ặ": "A",
|
|
|
|
|
"Æ": "AE",
|
|
|
|
|
"Ầ": "A",
|
|
|
|
|
"Ằ": "A",
|
|
|
|
|
"Ȃ": "A",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"Ả": "A",
|
|
|
|
|
"Ạ": "A",
|
|
|
|
|
"Ẩ": "A",
|
|
|
|
|
"Ẫ": "A",
|
|
|
|
|
"Ậ": "A",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"Ç": "C",
|
|
|
|
|
"Ḉ": "C",
|
|
|
|
|
"È": "E",
|
|
|
|
|
"É": "E",
|
|
|
|
|
"Ê": "E",
|
|
|
|
|
"Ë": "E",
|
|
|
|
|
"Ế": "E",
|
|
|
|
|
"Ḗ": "E",
|
|
|
|
|
"Ề": "E",
|
|
|
|
|
"Ḕ": "E",
|
|
|
|
|
"Ḝ": "E",
|
|
|
|
|
"Ȇ": "E",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"Ẻ": "E",
|
|
|
|
|
"Ẽ": "E",
|
|
|
|
|
"Ẹ": "E",
|
|
|
|
|
"Ể": "E",
|
|
|
|
|
"Ễ": "E",
|
|
|
|
|
"Ệ": "E",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"Ì": "I",
|
|
|
|
|
"Í": "I",
|
|
|
|
|
"Î": "I",
|
|
|
|
|
"Ï": "I",
|
|
|
|
|
"Ḯ": "I",
|
|
|
|
|
"Ȋ": "I",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"Ỉ": "I",
|
|
|
|
|
"Ị": "I",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"Ð": "D",
|
|
|
|
|
"Ñ": "N",
|
|
|
|
|
"Ò": "O",
|
|
|
|
|
"Ó": "O",
|
|
|
|
|
"Ô": "O",
|
|
|
|
|
"Õ": "O",
|
|
|
|
|
"Ö": "O",
|
|
|
|
|
"Ø": "O",
|
|
|
|
|
"Ố": "O",
|
|
|
|
|
"Ṍ": "O",
|
|
|
|
|
"Ṓ": "O",
|
|
|
|
|
"Ȏ": "O",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"Ỏ": "O",
|
|
|
|
|
"Ọ": "O",
|
|
|
|
|
"Ổ": "O",
|
|
|
|
|
"Ỗ": "O",
|
|
|
|
|
"Ộ": "O",
|
|
|
|
|
"Ờ": "O",
|
|
|
|
|
"Ở": "O",
|
|
|
|
|
"Ỡ": "O",
|
|
|
|
|
"Ớ": "O",
|
|
|
|
|
"Ợ": "O",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"Ù": "U",
|
|
|
|
|
"Ú": "U",
|
|
|
|
|
"Û": "U",
|
|
|
|
|
"Ü": "U",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"Ủ": "U",
|
|
|
|
|
"Ụ": "U",
|
|
|
|
|
"Ử": "U",
|
|
|
|
|
"Ữ": "U",
|
|
|
|
|
"Ự": "U",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"Ý": "Y",
|
|
|
|
|
"à": "a",
|
|
|
|
|
"á": "a",
|
|
|
|
|
"â": "a",
|
|
|
|
|
"ã": "a",
|
|
|
|
|
"ä": "a",
|
|
|
|
|
"å": "a",
|
|
|
|
|
"ấ": "a",
|
|
|
|
|
"ắ": "a",
|
|
|
|
|
"ẳ": "a",
|
|
|
|
|
"ẵ": "a",
|
|
|
|
|
"ặ": "a",
|
|
|
|
|
"æ": "ae",
|
|
|
|
|
"ầ": "a",
|
|
|
|
|
"ằ": "a",
|
|
|
|
|
"ȃ": "a",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"ả": "a",
|
|
|
|
|
"ạ": "a",
|
|
|
|
|
"ẩ": "a",
|
|
|
|
|
"ẫ": "a",
|
|
|
|
|
"ậ": "a",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"ç": "c",
|
|
|
|
|
"ḉ": "c",
|
|
|
|
|
"è": "e",
|
|
|
|
|
"é": "e",
|
|
|
|
|
"ê": "e",
|
|
|
|
|
"ë": "e",
|
|
|
|
|
"ế": "e",
|
|
|
|
|
"ḗ": "e",
|
|
|
|
|
"ề": "e",
|
|
|
|
|
"ḕ": "e",
|
|
|
|
|
"ḝ": "e",
|
|
|
|
|
"ȇ": "e",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"ẻ": "e",
|
|
|
|
|
"ẽ": "e",
|
|
|
|
|
"ẹ": "e",
|
|
|
|
|
"ể": "e",
|
|
|
|
|
"ễ": "e",
|
|
|
|
|
"ệ": "e",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"ì": "i",
|
|
|
|
|
"í": "i",
|
|
|
|
|
"î": "i",
|
|
|
|
|
"ï": "i",
|
|
|
|
|
"ḯ": "i",
|
|
|
|
|
"ȋ": "i",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"ỉ": "i",
|
|
|
|
|
"ị": "i",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"ð": "d",
|
|
|
|
|
"ñ": "n",
|
|
|
|
|
"ò": "o",
|
|
|
|
|
"ó": "o",
|
|
|
|
|
"ô": "o",
|
|
|
|
|
"õ": "o",
|
|
|
|
|
"ö": "o",
|
|
|
|
|
"ø": "o",
|
|
|
|
|
"ố": "o",
|
|
|
|
|
"ṍ": "o",
|
|
|
|
|
"ṓ": "o",
|
|
|
|
|
"ȏ": "o",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"ỏ": "o",
|
|
|
|
|
"ọ": "o",
|
|
|
|
|
"ổ": "o",
|
|
|
|
|
"ỗ": "o",
|
|
|
|
|
"ộ": "o",
|
|
|
|
|
"ờ": "o",
|
|
|
|
|
"ở": "o",
|
|
|
|
|
"ỡ": "o",
|
|
|
|
|
"ớ": "o",
|
|
|
|
|
"ợ": "o",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"ù": "u",
|
|
|
|
|
"ú": "u",
|
|
|
|
|
"û": "u",
|
|
|
|
|
"ü": "u",
|
2023-09-26 10:23:26 -04:00
|
|
|
|
"ủ": "u",
|
|
|
|
|
"ụ": "u",
|
|
|
|
|
"ử": "u",
|
|
|
|
|
"ữ": "u",
|
|
|
|
|
"ự": "u",
|
2023-02-07 02:04:52 -05:00
|
|
|
|
"ý": "y",
|
|
|
|
|
"ÿ": "y",
|
|
|
|
|
"Ā": "A",
|
|
|
|
|
"ā": "a",
|
|
|
|
|
"Ă": "A",
|
|
|
|
|
"ă": "a",
|
|
|
|
|
"Ą": "A",
|
|
|
|
|
"ą": "a",
|
|
|
|
|
"Ć": "C",
|
|
|
|
|
"ć": "c",
|
|
|
|
|
"Ĉ": "C",
|
|
|
|
|
"ĉ": "c",
|
|
|
|
|
"Ċ": "C",
|
|
|
|
|
"ċ": "c",
|
|
|
|
|
"Č": "C",
|
|
|
|
|
"č": "c",
|
|
|
|
|
"C̆": "C",
|
|
|
|
|
"c̆": "c",
|
|
|
|
|
"Ď": "D",
|
|
|
|
|
"ď": "d",
|
|
|
|
|
"Đ": "D",
|
|
|
|
|
"đ": "d",
|
|
|
|
|
"Ē": "E",
|
|
|
|
|
"ē": "e",
|
|
|
|
|
"Ĕ": "E",
|
|
|
|
|
"ĕ": "e",
|
|
|
|
|
"Ė": "E",
|
|
|
|
|
"ė": "e",
|
|
|
|
|
"Ę": "E",
|
|
|
|
|
"ę": "e",
|
|
|
|
|
"Ě": "E",
|
|
|
|
|
"ě": "e",
|
|
|
|
|
"Ĝ": "G",
|
|
|
|
|
"Ǵ": "G",
|
|
|
|
|
"ĝ": "g",
|
|
|
|
|
"ǵ": "g",
|
|
|
|
|
"Ğ": "G",
|
|
|
|
|
"ğ": "g",
|
|
|
|
|
"Ġ": "G",
|
|
|
|
|
"ġ": "g",
|
|
|
|
|
"Ģ": "G",
|
|
|
|
|
"ģ": "g",
|
|
|
|
|
"Ĥ": "H",
|
|
|
|
|
"ĥ": "h",
|
|
|
|
|
"Ħ": "H",
|
|
|
|
|
"ħ": "h",
|
|
|
|
|
"Ḫ": "H",
|
|
|
|
|
"ḫ": "h",
|
|
|
|
|
"Ĩ": "I",
|
|
|
|
|
"ĩ": "i",
|
|
|
|
|
"Ī": "I",
|
|
|
|
|
"ī": "i",
|
|
|
|
|
"Ĭ": "I",
|
|
|
|
|
"ĭ": "i",
|
|
|
|
|
"Į": "I",
|
|
|
|
|
"į": "i",
|
|
|
|
|
"İ": "I",
|
|
|
|
|
"ı": "i",
|
|
|
|
|
"IJ": "IJ",
|
|
|
|
|
"ij": "ij",
|
|
|
|
|
"Ĵ": "J",
|
|
|
|
|
"ĵ": "j",
|
|
|
|
|
"Ķ": "K",
|
|
|
|
|
"ķ": "k",
|
|
|
|
|
"Ḱ": "K",
|
|
|
|
|
"ḱ": "k",
|
|
|
|
|
"K̆": "K",
|
|
|
|
|
"k̆": "k",
|
|
|
|
|
"Ĺ": "L",
|
|
|
|
|
"ĺ": "l",
|
|
|
|
|
"Ļ": "L",
|
|
|
|
|
"ļ": "l",
|
|
|
|
|
"Ľ": "L",
|
|
|
|
|
"ľ": "l",
|
|
|
|
|
"Ŀ": "L",
|
|
|
|
|
"ŀ": "l",
|
|
|
|
|
"Ł": "l",
|
|
|
|
|
"ł": "l",
|
|
|
|
|
"Ḿ": "M",
|
|
|
|
|
"ḿ": "m",
|
|
|
|
|
"M̆": "M",
|
|
|
|
|
"m̆": "m",
|
|
|
|
|
"Ń": "N",
|
|
|
|
|
"ń": "n",
|
|
|
|
|
"Ņ": "N",
|
|
|
|
|
"ņ": "n",
|
|
|
|
|
"Ň": "N",
|
|
|
|
|
"ň": "n",
|
|
|
|
|
"ʼn": "n",
|
|
|
|
|
"N̆": "N",
|
|
|
|
|
"n̆": "n",
|
|
|
|
|
"Ō": "O",
|
|
|
|
|
"ō": "o",
|
|
|
|
|
"Ŏ": "O",
|
|
|
|
|
"ŏ": "o",
|
|
|
|
|
"Ő": "O",
|
|
|
|
|
"ő": "o",
|
|
|
|
|
"Œ": "OE",
|
|
|
|
|
"œ": "oe",
|
|
|
|
|
"P̆": "P",
|
|
|
|
|
"p̆": "p",
|
|
|
|
|
"Ŕ": "R",
|
|
|
|
|
"ŕ": "r",
|
|
|
|
|
"Ŗ": "R",
|
|
|
|
|
"ŗ": "r",
|
|
|
|
|
"Ř": "R",
|
|
|
|
|
"ř": "r",
|
|
|
|
|
"R̆": "R",
|
|
|
|
|
"r̆": "r",
|
|
|
|
|
"Ȓ": "R",
|
|
|
|
|
"ȓ": "r",
|
|
|
|
|
"Ś": "S",
|
|
|
|
|
"ś": "s",
|
|
|
|
|
"Ŝ": "S",
|
|
|
|
|
"ŝ": "s",
|
|
|
|
|
"Ş": "S",
|
|
|
|
|
"Ș": "S",
|
|
|
|
|
"ș": "s",
|
|
|
|
|
"ş": "s",
|
|
|
|
|
"Š": "S",
|
|
|
|
|
"š": "s",
|
|
|
|
|
"Ţ": "T",
|
|
|
|
|
"ţ": "t",
|
|
|
|
|
"ț": "t",
|
|
|
|
|
"Ț": "T",
|
|
|
|
|
"Ť": "T",
|
|
|
|
|
"ť": "t",
|
|
|
|
|
"Ŧ": "T",
|
|
|
|
|
"ŧ": "t",
|
|
|
|
|
"T̆": "T",
|
|
|
|
|
"t̆": "t",
|
|
|
|
|
"Ũ": "U",
|
|
|
|
|
"ũ": "u",
|
|
|
|
|
"Ū": "U",
|
|
|
|
|
"ū": "u",
|
|
|
|
|
"Ŭ": "U",
|
|
|
|
|
"ŭ": "u",
|
|
|
|
|
"Ů": "U",
|
|
|
|
|
"ů": "u",
|
|
|
|
|
"Ű": "U",
|
|
|
|
|
"ű": "u",
|
|
|
|
|
"Ų": "U",
|
|
|
|
|
"ų": "u",
|
|
|
|
|
"Ȗ": "U",
|
|
|
|
|
"ȗ": "u",
|
|
|
|
|
"V̆": "V",
|
|
|
|
|
"v̆": "v",
|
|
|
|
|
"Ŵ": "W",
|
|
|
|
|
"ŵ": "w",
|
|
|
|
|
"Ẃ": "W",
|
|
|
|
|
"ẃ": "w",
|
|
|
|
|
"X̆": "X",
|
|
|
|
|
"x̆": "x",
|
|
|
|
|
"Ŷ": "Y",
|
|
|
|
|
"ŷ": "y",
|
|
|
|
|
"Ÿ": "Y",
|
|
|
|
|
"Y̆": "Y",
|
|
|
|
|
"y̆": "y",
|
|
|
|
|
"Ź": "Z",
|
|
|
|
|
"ź": "z",
|
|
|
|
|
"Ż": "Z",
|
|
|
|
|
"ż": "z",
|
|
|
|
|
"Ž": "Z",
|
|
|
|
|
"ž": "z",
|
|
|
|
|
"ſ": "s",
|
|
|
|
|
"ƒ": "f",
|
|
|
|
|
"Ơ": "O",
|
|
|
|
|
"ơ": "o",
|
|
|
|
|
"Ư": "U",
|
|
|
|
|
"ư": "u",
|
|
|
|
|
"Ǎ": "A",
|
|
|
|
|
"ǎ": "a",
|
|
|
|
|
"Ǐ": "I",
|
|
|
|
|
"ǐ": "i",
|
|
|
|
|
"Ǒ": "O",
|
|
|
|
|
"ǒ": "o",
|
|
|
|
|
"Ǔ": "U",
|
|
|
|
|
"ǔ": "u",
|
|
|
|
|
"Ǖ": "U",
|
|
|
|
|
"ǖ": "u",
|
|
|
|
|
"Ǘ": "U",
|
|
|
|
|
"ǘ": "u",
|
|
|
|
|
"Ǚ": "U",
|
|
|
|
|
"ǚ": "u",
|
|
|
|
|
"Ǜ": "U",
|
|
|
|
|
"ǜ": "u",
|
|
|
|
|
"Ứ": "U",
|
|
|
|
|
"ứ": "u",
|
|
|
|
|
"Ṹ": "U",
|
|
|
|
|
"ṹ": "u",
|
|
|
|
|
"Ǻ": "A",
|
|
|
|
|
"ǻ": "a",
|
|
|
|
|
"Ǽ": "AE",
|
|
|
|
|
"ǽ": "ae",
|
|
|
|
|
"Ǿ": "O",
|
|
|
|
|
"ǿ": "o",
|
|
|
|
|
"Þ": "TH",
|
|
|
|
|
"þ": "th",
|
|
|
|
|
"Ṕ": "P",
|
|
|
|
|
"ṕ": "p",
|
|
|
|
|
"Ṥ": "S",
|
|
|
|
|
"ṥ": "s",
|
|
|
|
|
"X́": "X",
|
|
|
|
|
"x́": "x",
|
|
|
|
|
"Ѓ": "Г",
|
|
|
|
|
"ѓ": "г",
|
|
|
|
|
"Ќ": "К",
|
|
|
|
|
"ќ": "к",
|
|
|
|
|
"A̋": "A",
|
|
|
|
|
"a̋": "a",
|
|
|
|
|
"E̋": "E",
|
|
|
|
|
"e̋": "e",
|
|
|
|
|
"I̋": "I",
|
|
|
|
|
"i̋": "i",
|
|
|
|
|
"Ǹ": "N",
|
|
|
|
|
"ǹ": "n",
|
|
|
|
|
"Ồ": "O",
|
|
|
|
|
"ồ": "o",
|
|
|
|
|
"Ṑ": "O",
|
|
|
|
|
"ṑ": "o",
|
|
|
|
|
"Ừ": "U",
|
|
|
|
|
"ừ": "u",
|
|
|
|
|
"Ẁ": "W",
|
|
|
|
|
"ẁ": "w",
|
|
|
|
|
"Ỳ": "Y",
|
|
|
|
|
"ỳ": "y",
|
|
|
|
|
"Ȁ": "A",
|
|
|
|
|
"ȁ": "a",
|
|
|
|
|
"Ȅ": "E",
|
|
|
|
|
"ȅ": "e",
|
|
|
|
|
"Ȉ": "I",
|
|
|
|
|
"ȉ": "i",
|
|
|
|
|
"Ȍ": "O",
|
|
|
|
|
"ȍ": "o",
|
|
|
|
|
"Ȑ": "R",
|
|
|
|
|
"ȑ": "r",
|
|
|
|
|
"Ȕ": "U",
|
|
|
|
|
"ȕ": "u",
|
|
|
|
|
"B̌": "B",
|
|
|
|
|
"b̌": "b",
|
|
|
|
|
"Č̣": "C",
|
|
|
|
|
"č̣": "c",
|
|
|
|
|
"Ê̌": "E",
|
|
|
|
|
"ê̌": "e",
|
|
|
|
|
"F̌": "F",
|
|
|
|
|
"f̌": "f",
|
|
|
|
|
"Ǧ": "G",
|
|
|
|
|
"ǧ": "g",
|
|
|
|
|
"Ȟ": "H",
|
|
|
|
|
"ȟ": "h",
|
|
|
|
|
"J̌": "J",
|
|
|
|
|
"ǰ": "j",
|
|
|
|
|
"Ǩ": "K",
|
|
|
|
|
"ǩ": "k",
|
|
|
|
|
"M̌": "M",
|
|
|
|
|
"m̌": "m",
|
|
|
|
|
"P̌": "P",
|
|
|
|
|
"p̌": "p",
|
|
|
|
|
"Q̌": "Q",
|
|
|
|
|
"q̌": "q",
|
|
|
|
|
"Ř̩": "R",
|
|
|
|
|
"ř̩": "r",
|
|
|
|
|
"Ṧ": "S",
|
|
|
|
|
"ṧ": "s",
|
|
|
|
|
"V̌": "V",
|
|
|
|
|
"v̌": "v",
|
|
|
|
|
"W̌": "W",
|
|
|
|
|
"w̌": "w",
|
|
|
|
|
"X̌": "X",
|
|
|
|
|
"x̌": "x",
|
|
|
|
|
"Y̌": "Y",
|
|
|
|
|
"y̌": "y",
|
|
|
|
|
"A̧": "A",
|
|
|
|
|
"a̧": "a",
|
|
|
|
|
"B̧": "B",
|
|
|
|
|
"b̧": "b",
|
|
|
|
|
"Ḑ": "D",
|
|
|
|
|
"ḑ": "d",
|
|
|
|
|
"Ȩ": "E",
|
|
|
|
|
"ȩ": "e",
|
|
|
|
|
"Ɛ̧": "E",
|
|
|
|
|
"ɛ̧": "e",
|
|
|
|
|
"Ḩ": "H",
|
|
|
|
|
"ḩ": "h",
|
|
|
|
|
"I̧": "I",
|
|
|
|
|
"i̧": "i",
|
|
|
|
|
"Ɨ̧": "I",
|
|
|
|
|
"ɨ̧": "i",
|
|
|
|
|
"M̧": "M",
|
|
|
|
|
"m̧": "m",
|
|
|
|
|
"O̧": "O",
|
|
|
|
|
"o̧": "o",
|
|
|
|
|
"Q̧": "Q",
|
|
|
|
|
"q̧": "q",
|
|
|
|
|
"U̧": "U",
|
|
|
|
|
"u̧": "u",
|
|
|
|
|
"X̧": "X",
|
|
|
|
|
"x̧": "x",
|
|
|
|
|
"Z̧": "Z",
|
|
|
|
|
"z̧": "z",
|
|
|
|
|
"й":"и",
|
|
|
|
|
"Й":"И",
|
|
|
|
|
"ё":"е",
|
|
|
|
|
"Ё":"Е",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var chars = Object.keys(characterMap).join('|');
|
|
|
|
|
var allAccents = new RegExp(chars, 'g');
|
|
|
|
|
var firstAccent = new RegExp(chars, '');
|
|
|
|
|
|
|
|
|
|
function matcher(match) {
|
|
|
|
|
return characterMap[match];
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
var removeAccents = function(string) {
|
2023-02-07 02:04:52 -05:00
|
|
|
|
return string.replace(allAccents, matcher);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var hasAccents = function(string) {
|
|
|
|
|
return !!string.match(firstAccent);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module.exports = removeAccents;
|
|
|
|
|
module.exports.has = hasAccents;
|
|
|
|
|
module.exports.remove = removeAccents;
|
2022-09-20 11:43:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
|
|
/******/ });
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
/******/ // The module cache
|
|
|
|
|
/******/ var __webpack_module_cache__ = {};
|
|
|
|
|
/******/
|
|
|
|
|
/******/ // The require function
|
|
|
|
|
/******/ function __webpack_require__(moduleId) {
|
|
|
|
|
/******/ // Check if module is in cache
|
|
|
|
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
|
|
|
/******/ if (cachedModule !== undefined) {
|
|
|
|
|
/******/ return cachedModule.exports;
|
|
|
|
|
/******/ }
|
|
|
|
|
/******/ // Create a new module (and put it into the cache)
|
|
|
|
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
|
|
|
/******/ // no module.id needed
|
|
|
|
|
/******/ // no module.loaded needed
|
|
|
|
|
/******/ exports: {}
|
|
|
|
|
/******/ };
|
|
|
|
|
/******/
|
|
|
|
|
/******/ // Execute the module function
|
|
|
|
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
|
|
|
/******/
|
|
|
|
|
/******/ // Return the exports of the module
|
|
|
|
|
/******/ return module.exports;
|
|
|
|
|
/******/ }
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/
|
|
|
|
|
/************************************************************************/
|
2022-09-20 11:43:29 -04:00
|
|
|
|
/******/ /* webpack/runtime/compat get default export */
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ (() => {
|
2022-09-20 11:43:29 -04:00
|
|
|
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ __webpack_require__.n = (module) => {
|
2022-09-20 11:43:29 -04:00
|
|
|
|
/******/ var getter = module && module.__esModule ?
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ () => (module['default']) :
|
|
|
|
|
/******/ () => (module);
|
2022-09-20 11:43:29 -04:00
|
|
|
|
/******/ __webpack_require__.d(getter, { a: getter });
|
|
|
|
|
/******/ return getter;
|
|
|
|
|
/******/ };
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ })();
|
2022-09-20 11:43:29 -04:00
|
|
|
|
/******/
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/ /* webpack/runtime/define property getters */
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ (() => {
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/ // define getter functions for harmony exports
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ __webpack_require__.d = (exports, definition) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/ for(var key in definition) {
|
|
|
|
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
|
|
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
|
|
|
/******/ }
|
|
|
|
|
/******/ }
|
|
|
|
|
/******/ };
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/
|
|
|
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ (() => {
|
|
|
|
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/
|
|
|
|
|
/******/ /* webpack/runtime/make namespace object */
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ (() => {
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/ // define __esModule on exports
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ __webpack_require__.r = (exports) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
|
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
|
/******/ }
|
|
|
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
2018-12-13 23:41:57 -05:00
|
|
|
|
/******/ };
|
2024-01-31 07:59:56 -05:00
|
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
|
/******/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
/************************************************************************/
|
2022-04-11 08:04:30 -04:00
|
|
|
|
var __webpack_exports__ = {};
|
2022-09-20 11:43:29 -04:00
|
|
|
|
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
2024-01-31 07:59:56 -05:00
|
|
|
|
(() => {
|
2022-09-20 11:43:29 -04:00
|
|
|
|
"use strict";
|
2020-06-29 07:50:29 -04:00
|
|
|
|
// ESM COMPAT FLAG
|
2020-01-08 06:57:23 -05:00
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
2020-06-29 07:50:29 -04:00
|
|
|
|
// EXPORTS
|
2022-04-11 08:04:30 -04:00
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
2024-01-31 07:59:56 -05:00
|
|
|
|
addQueryArgs: () => (/* reexport */ addQueryArgs),
|
|
|
|
|
buildQueryString: () => (/* reexport */ buildQueryString),
|
|
|
|
|
cleanForSlug: () => (/* reexport */ cleanForSlug),
|
|
|
|
|
filterURLForDisplay: () => (/* reexport */ filterURLForDisplay),
|
|
|
|
|
getAuthority: () => (/* reexport */ getAuthority),
|
|
|
|
|
getFilename: () => (/* reexport */ getFilename),
|
|
|
|
|
getFragment: () => (/* reexport */ getFragment),
|
|
|
|
|
getPath: () => (/* reexport */ getPath),
|
|
|
|
|
getPathAndQueryString: () => (/* reexport */ getPathAndQueryString),
|
|
|
|
|
getProtocol: () => (/* reexport */ getProtocol),
|
|
|
|
|
getQueryArg: () => (/* reexport */ getQueryArg),
|
|
|
|
|
getQueryArgs: () => (/* reexport */ getQueryArgs),
|
|
|
|
|
getQueryString: () => (/* reexport */ getQueryString),
|
|
|
|
|
hasQueryArg: () => (/* reexport */ hasQueryArg),
|
|
|
|
|
isEmail: () => (/* reexport */ isEmail),
|
2024-09-19 21:55:35 -04:00
|
|
|
|
isPhoneNumber: () => (/* reexport */ isPhoneNumber),
|
2024-01-31 07:59:56 -05:00
|
|
|
|
isURL: () => (/* reexport */ isURL),
|
|
|
|
|
isValidAuthority: () => (/* reexport */ isValidAuthority),
|
|
|
|
|
isValidFragment: () => (/* reexport */ isValidFragment),
|
|
|
|
|
isValidPath: () => (/* reexport */ isValidPath),
|
|
|
|
|
isValidProtocol: () => (/* reexport */ isValidProtocol),
|
|
|
|
|
isValidQueryString: () => (/* reexport */ isValidQueryString),
|
|
|
|
|
normalizePath: () => (/* reexport */ normalizePath),
|
|
|
|
|
prependHTTP: () => (/* reexport */ prependHTTP),
|
|
|
|
|
prependHTTPS: () => (/* reexport */ prependHTTPS),
|
|
|
|
|
removeQueryArgs: () => (/* reexport */ removeQueryArgs),
|
|
|
|
|
safeDecodeURI: () => (/* reexport */ safeDecodeURI),
|
|
|
|
|
safeDecodeURIComponent: () => (/* reexport */ safeDecodeURIComponent)
|
2022-04-11 08:04:30 -04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-url.js
|
2024-09-19 21:55:35 -04:00
|
|
|
|
/* wp:polyfill */
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Determines whether the given string looks like a URL.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The string to scrutinise.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const isURL = isURL( 'https://wordpress.org' ); // true
|
|
|
|
|
* ```
|
|
|
|
|
*
|
2020-02-10 17:33:27 -05:00
|
|
|
|
* @see https://url.spec.whatwg.org/
|
|
|
|
|
* @see https://url.spec.whatwg.org/#valid-url-string
|
|
|
|
|
*
|
2020-01-08 06:57:23 -05:00
|
|
|
|
* @return {boolean} Whether or not it looks like a URL.
|
|
|
|
|
*/
|
|
|
|
|
function isURL(url) {
|
2020-02-10 17:33:27 -05:00
|
|
|
|
// A URL can be considered value if the `URL` constructor is able to parse
|
|
|
|
|
// it. The constructor throws an error for an invalid URL.
|
|
|
|
|
try {
|
|
|
|
|
new URL(url);
|
|
|
|
|
return true;
|
2021-05-19 11:09:27 -04:00
|
|
|
|
} catch {
|
2020-02-10 17:33:27 -05:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2020-01-08 06:57:23 -05:00
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-email.js
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Determines whether the given string looks like an email.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} email The string to scrutinise.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const isEmail = isEmail( 'hello@wordpress.org' ); // true
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {boolean} Whether or not it looks like an email.
|
|
|
|
|
*/
|
|
|
|
|
function isEmail(email) {
|
|
|
|
|
return EMAIL_REGEXP.test(email);
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-19 21:55:35 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-phone-number.js
|
|
|
|
|
const PHONE_REGEXP = /^(tel:)?(\+)?\d{6,15}$/;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Determines whether the given string looks like a phone number.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} phoneNumber The string to scrutinize.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const isPhoneNumber = isPhoneNumber('+1 (555) 123-4567'); // true
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {boolean} Whether or not it looks like a phone number.
|
|
|
|
|
*/
|
|
|
|
|
function isPhoneNumber(phoneNumber) {
|
|
|
|
|
// Remove any seperator from phone number.
|
|
|
|
|
phoneNumber = phoneNumber.replace(/[-.() ]/g, '');
|
|
|
|
|
return PHONE_REGEXP.test(phoneNumber);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-protocol.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns the protocol part of the URL.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The full URL.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'
|
|
|
|
|
* const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string|void} The protocol part of the URL.
|
|
|
|
|
*/
|
|
|
|
|
function getProtocol(url) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const matches = /^([^\s:]+:)/.exec(url);
|
2020-01-08 06:57:23 -05:00
|
|
|
|
if (matches) {
|
|
|
|
|
return matches[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-protocol.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Tests if a url protocol is valid.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} protocol The url protocol.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const isValid = isValidProtocol( 'https:' ); // true
|
|
|
|
|
* const isNotValid = isValidProtocol( 'https :' ); // false
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).
|
|
|
|
|
*/
|
|
|
|
|
function isValidProtocol(protocol) {
|
|
|
|
|
if (!protocol) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-authority.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns the authority part of the URL.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The full URL.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const authority1 = getAuthority( 'https://wordpress.org/help/' ); // 'wordpress.org'
|
|
|
|
|
* const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080'
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string|void} The authority part of the URL.
|
|
|
|
|
*/
|
|
|
|
|
function getAuthority(url) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(url);
|
2020-01-08 06:57:23 -05:00
|
|
|
|
if (matches) {
|
|
|
|
|
return matches[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-authority.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Checks for invalid characters within the provided authority.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} authority A string containing the URL authority.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const isValid = isValidAuthority( 'wordpress.org' ); // true
|
|
|
|
|
* const isNotValid = isValidAuthority( 'wordpress#org' ); // false
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {boolean} True if the argument contains a valid authority.
|
|
|
|
|
*/
|
|
|
|
|
function isValidAuthority(authority) {
|
|
|
|
|
if (!authority) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return /^[^\s#?]+$/.test(authority);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns the path part of the URL.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The full URL.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test'
|
|
|
|
|
* const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string|void} The path part of the URL.
|
|
|
|
|
*/
|
|
|
|
|
function getPath(url) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url);
|
2020-01-08 06:57:23 -05:00
|
|
|
|
if (matches) {
|
|
|
|
|
return matches[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-path.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Checks for invalid characters within the provided path.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} path The URL path.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const isValid = isValidPath( 'test/path/' ); // true
|
|
|
|
|
* const isNotValid = isValidPath( '/invalid?test/path/' ); // false
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {boolean} True if the argument contains a valid path
|
|
|
|
|
*/
|
|
|
|
|
function isValidPath(path) {
|
|
|
|
|
if (!path) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return /^[^\s#?]+$/.test(path);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-string.js
|
2024-09-19 21:55:35 -04:00
|
|
|
|
/* wp:polyfill */
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns the query string part of the URL.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The full URL.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
2020-06-26 09:33:47 -04:00
|
|
|
|
* const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'
|
2020-01-08 06:57:23 -05:00
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string|void} The query string part of the URL.
|
|
|
|
|
*/
|
|
|
|
|
function getQueryString(url) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
let query;
|
2020-06-26 09:33:47 -04:00
|
|
|
|
try {
|
2021-01-27 21:04:13 -05:00
|
|
|
|
query = new URL(url, 'http://example.com').search.substring(1);
|
2020-06-26 09:33:47 -04:00
|
|
|
|
} catch (error) {}
|
|
|
|
|
if (query) {
|
|
|
|
|
return query;
|
2020-01-08 06:57:23 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/build-query-string.js
|
2021-01-27 21:04:13 -05:00
|
|
|
|
/**
|
|
|
|
|
* Generates URL-encoded query string using input query data.
|
|
|
|
|
*
|
|
|
|
|
* It is intended to behave equivalent as PHP's `http_build_query`, configured
|
|
|
|
|
* with encoding type PHP_QUERY_RFC3986 (spaces as `%20`).
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const queryString = buildQueryString( {
|
|
|
|
|
* simple: 'is ok',
|
|
|
|
|
* arrays: [ 'are', 'fine', 'too' ],
|
|
|
|
|
* objects: {
|
|
|
|
|
* evenNested: {
|
|
|
|
|
* ok: 'yes',
|
|
|
|
|
* },
|
|
|
|
|
* },
|
|
|
|
|
* } );
|
|
|
|
|
* // "simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes"
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @param {Record<string,*>} data Data to encode.
|
|
|
|
|
*
|
|
|
|
|
* @return {string} Query string.
|
|
|
|
|
*/
|
|
|
|
|
function buildQueryString(data) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
let string = '';
|
|
|
|
|
const stack = Object.entries(data);
|
|
|
|
|
let pair;
|
2021-01-27 21:04:13 -05:00
|
|
|
|
while (pair = stack.shift()) {
|
2023-09-26 10:23:26 -04:00
|
|
|
|
let [key, value] = pair;
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// Support building deeply nested data, from array or object values.
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const hasNestedData = Array.isArray(value) || value && value.constructor === Object;
|
2021-01-27 21:04:13 -05:00
|
|
|
|
if (hasNestedData) {
|
|
|
|
|
// Push array or object values onto the stack as composed of their
|
|
|
|
|
// original key and nested index or key, retaining order by a
|
|
|
|
|
// combination of Array#reverse and Array#unshift onto the stack.
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const valuePairs = Object.entries(value).reverse();
|
|
|
|
|
for (const [member, memberValue] of valuePairs) {
|
|
|
|
|
stack.unshift([`${key}[${member}]`, memberValue]);
|
2021-01-27 21:04:13 -05:00
|
|
|
|
}
|
|
|
|
|
} else if (value !== undefined) {
|
|
|
|
|
// Null is treated as special case, equivalent to empty string.
|
|
|
|
|
if (value === null) {
|
|
|
|
|
value = '';
|
|
|
|
|
}
|
|
|
|
|
string += '&' + [key, value].map(encodeURIComponent).join('=');
|
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Loop will concatenate with leading `&`, but it's only expected for all
|
2021-01-27 21:04:13 -05:00
|
|
|
|
// but the first query parameter. This strips the leading `&`, while still
|
|
|
|
|
// accounting for the case that the string may in-fact be empty.
|
|
|
|
|
return string.substr(1);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-query-string.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Checks for invalid characters within the provided query string.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} queryString The query string.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const isValid = isValidQueryString( 'query=true&another=false' ); // true
|
|
|
|
|
* const isNotValid = isValidQueryString( 'query=true?another=false' ); // false
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {boolean} True if the argument contains a valid query string.
|
|
|
|
|
*/
|
|
|
|
|
function isValidQueryString(queryString) {
|
|
|
|
|
if (!queryString) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return /^[^\s#?\/]+$/.test(queryString);
|
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path-and-query-string.js
|
2020-06-26 09:33:47 -04:00
|
|
|
|
/**
|
|
|
|
|
* Internal dependencies
|
|
|
|
|
*/
|
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2020-06-26 09:33:47 -04:00
|
|
|
|
/**
|
|
|
|
|
* Returns the path part and query string part of the URL.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The full URL.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const pathAndQueryString1 = getPathAndQueryString( 'http://localhost:8080/this/is/a/test?query=true' ); // '/this/is/a/test?query=true'
|
|
|
|
|
* const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string} The path part and query string part of the URL.
|
|
|
|
|
*/
|
|
|
|
|
function getPathAndQueryString(url) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const path = getPath(url);
|
|
|
|
|
const queryString = getQueryString(url);
|
|
|
|
|
let value = '/';
|
2024-05-23 15:39:28 -04:00
|
|
|
|
if (path) {
|
|
|
|
|
value += path;
|
|
|
|
|
}
|
|
|
|
|
if (queryString) {
|
|
|
|
|
value += `?${queryString}`;
|
|
|
|
|
}
|
2020-06-26 09:33:47 -04:00
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-fragment.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns the fragment part of the URL.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The full URL
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const fragment1 = getFragment( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // '#fragment'
|
|
|
|
|
* const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment'
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string|void} The fragment part of the URL.
|
|
|
|
|
*/
|
|
|
|
|
function getFragment(url) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const matches = /^\S+?(#[^\s\?]*)/.exec(url);
|
2020-01-08 06:57:23 -05:00
|
|
|
|
if (matches) {
|
|
|
|
|
return matches[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-fragment.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Checks for invalid characters within the provided fragment.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} fragment The url fragment.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const isValid = isValidFragment( '#valid-fragment' ); // true
|
|
|
|
|
* const isNotValid = isValidFragment( '#invalid-#fragment' ); // false
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {boolean} True if the argument contains a valid fragment.
|
|
|
|
|
*/
|
|
|
|
|
function isValidFragment(fragment) {
|
|
|
|
|
if (!fragment) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return /^#[^\s#?\/]*$/.test(fragment);
|
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2023-02-07 02:04:52 -05:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/safe-decode-uri-component.js
|
|
|
|
|
/**
|
|
|
|
|
* Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if
|
|
|
|
|
* `decodeURIComponent` throws an error.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} uriComponent URI component to decode.
|
|
|
|
|
*
|
|
|
|
|
* @return {string} Decoded URI component if possible.
|
|
|
|
|
*/
|
|
|
|
|
function safeDecodeURIComponent(uriComponent) {
|
|
|
|
|
try {
|
|
|
|
|
return decodeURIComponent(uriComponent);
|
|
|
|
|
} catch (uriComponentError) {
|
|
|
|
|
return uriComponent;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-args.js
|
2021-01-27 21:04:13 -05:00
|
|
|
|
/**
|
|
|
|
|
* Internal dependencies
|
|
|
|
|
*/
|
|
|
|
|
|
2023-02-07 02:04:52 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2021-01-27 21:04:13 -05:00
|
|
|
|
/** @typedef {import('./get-query-arg').QueryArgParsed} QueryArgParsed */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @typedef {Record<string,QueryArgParsed>} QueryArgs
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets a value in object deeply by a given array of path segments. Mutates the
|
|
|
|
|
* object reference.
|
|
|
|
|
*
|
|
|
|
|
* @param {Record<string,*>} object Object in which to assign.
|
|
|
|
|
* @param {string[]} path Path segment at which to set value.
|
|
|
|
|
* @param {*} value Value to set.
|
|
|
|
|
*/
|
|
|
|
|
function setPath(object, path, value) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const length = path.length;
|
|
|
|
|
const lastIndex = length - 1;
|
|
|
|
|
for (let i = 0; i < length; i++) {
|
|
|
|
|
let key = path[i];
|
2021-01-27 21:04:13 -05:00
|
|
|
|
if (!key && Array.isArray(object)) {
|
|
|
|
|
// If key is empty string and next value is array, derive key from
|
|
|
|
|
// the current length of the array.
|
|
|
|
|
key = object.length.toString();
|
2022-04-12 11:12:47 -04:00
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
key = ['__proto__', 'constructor', 'prototype'].includes(key) ? key.toUpperCase() : key;
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// If the next key in the path is numeric (or empty string), it will be
|
2022-04-12 11:12:47 -04:00
|
|
|
|
// created as an array. Otherwise, it will be created as an object.
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const isNextKeyArrayIndex = !isNaN(Number(path[i + 1]));
|
2023-09-26 10:23:26 -04:00
|
|
|
|
object[key] = i === lastIndex ?
|
|
|
|
|
// If at end of path, assign the intended value.
|
|
|
|
|
value :
|
|
|
|
|
// Otherwise, advance to the next object in the path, creating
|
2021-01-27 21:04:13 -05:00
|
|
|
|
// it if it does not yet exist.
|
|
|
|
|
object[key] || (isNextKeyArrayIndex ? [] : {});
|
|
|
|
|
if (Array.isArray(object[key]) && !isNextKeyArrayIndex) {
|
|
|
|
|
// If we current key is non-numeric, but the next value is an
|
|
|
|
|
// array, coerce the value to an object.
|
2023-09-26 10:23:26 -04:00
|
|
|
|
object[key] = {
|
|
|
|
|
...object[key]
|
2021-05-19 11:09:27 -04:00
|
|
|
|
};
|
2023-09-26 10:23:26 -04:00
|
|
|
|
}
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// Update working reference object to the next in the path.
|
2021-01-27 21:04:13 -05:00
|
|
|
|
object = object[key];
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2021-01-27 21:04:13 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns an object of query arguments of the given URL. If the given URL is
|
|
|
|
|
* invalid or has no querystring, an empty object is returned.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url URL.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const foo = getQueryArgs( 'https://wordpress.org?foo=bar&bar=baz' );
|
|
|
|
|
* // { "foo": "bar", "bar": "baz" }
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {QueryArgs} Query args object.
|
|
|
|
|
*/
|
|
|
|
|
function getQueryArgs(url) {
|
2023-09-26 10:23:26 -04:00
|
|
|
|
return (getQueryString(url) || ''
|
|
|
|
|
// Normalize space encoding, accounting for PHP URL encoding
|
2021-01-27 21:04:13 -05:00
|
|
|
|
// corresponding to `application/x-www-form-urlencoded`.
|
|
|
|
|
//
|
|
|
|
|
// See: https://tools.ietf.org/html/rfc1866#section-8.2.1
|
2021-11-15 07:50:17 -05:00
|
|
|
|
).replace(/\+/g, '%20').split('&').reduce((accumulator, keyValue) => {
|
2023-09-26 10:23:26 -04:00
|
|
|
|
const [key, value = ''] = keyValue.split('=')
|
|
|
|
|
// Filtering avoids decoding as `undefined` for value, where
|
2021-01-27 21:04:13 -05:00
|
|
|
|
// default is restored in destructuring assignment.
|
2023-02-07 02:04:52 -05:00
|
|
|
|
.filter(Boolean).map(safeDecodeURIComponent);
|
2021-01-27 21:04:13 -05:00
|
|
|
|
if (key) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const segments = key.replace(/\]/g, '').split('[');
|
2021-01-27 21:04:13 -05:00
|
|
|
|
setPath(accumulator, segments, value);
|
|
|
|
|
}
|
|
|
|
|
return accumulator;
|
2022-04-12 11:12:47 -04:00
|
|
|
|
}, Object.create(null));
|
2021-01-27 21:04:13 -05:00
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/add-query-args.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
2021-01-27 21:04:13 -05:00
|
|
|
|
* Internal dependencies
|
2020-01-08 06:57:23 -05:00
|
|
|
|
*/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Appends arguments as querystring to the provided URL. If the URL already
|
|
|
|
|
* includes query arguments, the arguments are merged with (and take precedent
|
|
|
|
|
* over) the existing set.
|
|
|
|
|
*
|
2021-11-08 09:29:21 -05:00
|
|
|
|
* @param {string} [url=''] URL to which arguments should be appended. If omitted,
|
|
|
|
|
* only the resulting querystring is returned.
|
|
|
|
|
* @param {Object} [args] Query arguments to apply to URL.
|
2020-01-08 06:57:23 -05:00
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string} URL with arguments applied.
|
|
|
|
|
*/
|
2023-06-27 10:24:19 -04:00
|
|
|
|
function addQueryArgs(url = '', args) {
|
2020-01-08 06:57:23 -05:00
|
|
|
|
// If no arguments are to be appended, return original URL.
|
|
|
|
|
if (!args || !Object.keys(args).length) {
|
|
|
|
|
return url;
|
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
let baseUrl = url;
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// Determine whether URL already had query arguments.
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const queryStringIndex = url.indexOf('?');
|
2020-01-08 06:57:23 -05:00
|
|
|
|
if (queryStringIndex !== -1) {
|
|
|
|
|
// Merge into existing query arguments.
|
2023-09-26 10:23:26 -04:00
|
|
|
|
args = Object.assign(getQueryArgs(url), args);
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// Change working base URL to omit previous query arguments.
|
2020-01-08 06:57:23 -05:00
|
|
|
|
baseUrl = baseUrl.substr(0, queryStringIndex);
|
|
|
|
|
}
|
2021-01-27 21:04:13 -05:00
|
|
|
|
return baseUrl + '?' + buildQueryString(args);
|
2020-01-08 06:57:23 -05:00
|
|
|
|
}
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-arg.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
2021-01-27 21:04:13 -05:00
|
|
|
|
* Internal dependencies
|
2020-01-08 06:57:23 -05:00
|
|
|
|
*/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* @typedef {{[key: string]: QueryArgParsed}} QueryArgObject
|
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* @typedef {string|string[]|QueryArgObject} QueryArgParsed
|
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns a single query argument of the url
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url URL.
|
|
|
|
|
* @param {string} arg Query arg name.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar
|
|
|
|
|
* ```
|
|
|
|
|
*
|
2021-01-27 21:04:13 -05:00
|
|
|
|
* @return {QueryArgParsed|void} Query arg value.
|
2020-01-08 06:57:23 -05:00
|
|
|
|
*/
|
|
|
|
|
function getQueryArg(url, arg) {
|
2021-01-27 21:04:13 -05:00
|
|
|
|
return getQueryArgs(url)[arg];
|
2020-01-08 06:57:23 -05:00
|
|
|
|
}
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/has-query-arg.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Internal dependencies
|
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Determines whether the URL contains a given query arg.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url URL.
|
|
|
|
|
* @param {string} arg Query arg name.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {boolean} Whether or not the URL contains the query arg.
|
|
|
|
|
*/
|
|
|
|
|
function hasQueryArg(url, arg) {
|
|
|
|
|
return getQueryArg(url, arg) !== undefined;
|
|
|
|
|
}
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/remove-query-args.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
2021-01-27 21:04:13 -05:00
|
|
|
|
* Internal dependencies
|
2020-01-08 06:57:23 -05:00
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Removes arguments from the query string of the url
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url URL.
|
|
|
|
|
* @param {...string} args Query Args.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string} Updated URL.
|
|
|
|
|
*/
|
2023-06-27 10:24:19 -04:00
|
|
|
|
function removeQueryArgs(url, ...args) {
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const queryStringIndex = url.indexOf('?');
|
2021-01-27 21:04:13 -05:00
|
|
|
|
if (queryStringIndex === -1) {
|
|
|
|
|
return url;
|
|
|
|
|
}
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const query = getQueryArgs(url);
|
|
|
|
|
const baseURL = url.substr(0, queryStringIndex);
|
|
|
|
|
args.forEach(arg => delete query[arg]);
|
|
|
|
|
const queryString = buildQueryString(query);
|
2021-01-27 21:04:13 -05:00
|
|
|
|
return queryString ? baseURL + '?' + queryString : baseURL;
|
2020-01-08 06:57:23 -05:00
|
|
|
|
}
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/prepend-http.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Internal dependencies
|
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Prepends "http://" to a url, if it looks like something that is meant to be a TLD.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The URL to test.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string} The updated URL.
|
|
|
|
|
*/
|
|
|
|
|
function prependHTTP(url) {
|
|
|
|
|
if (!url) {
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
url = url.trim();
|
|
|
|
|
if (!USABLE_HREF_REGEXP.test(url) && !isEmail(url)) {
|
|
|
|
|
return 'http://' + url;
|
|
|
|
|
}
|
|
|
|
|
return url;
|
|
|
|
|
}
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/safe-decode-uri.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Safely decodes a URI with `decodeURI`. Returns the URI unmodified if
|
|
|
|
|
* `decodeURI` throws an error.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} uri URI to decode.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string} Decoded URI if possible.
|
|
|
|
|
*/
|
|
|
|
|
function safeDecodeURI(uri) {
|
|
|
|
|
try {
|
|
|
|
|
return decodeURI(uri);
|
|
|
|
|
} catch (uriError) {
|
|
|
|
|
return uri;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/filter-url-for-display.js
|
2020-01-08 06:57:23 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns a URL for display.
|
|
|
|
|
*
|
2021-11-08 09:29:21 -05:00
|
|
|
|
* @param {string} url Original URL.
|
2021-01-27 21:04:13 -05:00
|
|
|
|
* @param {number|null} maxLength URL length.
|
2020-01-08 06:57:23 -05:00
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const displayUrl = filterURLForDisplay( 'https://www.wordpress.org/gutenberg/' ); // wordpress.org/gutenberg
|
2021-01-27 21:04:13 -05:00
|
|
|
|
* const imageUrl = filterURLForDisplay( 'https://www.wordpress.org/wp-content/uploads/img.png', 20 ); // …ent/uploads/img.png
|
2020-01-08 06:57:23 -05:00
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string} Displayed URL.
|
|
|
|
|
*/
|
2023-06-27 10:24:19 -04:00
|
|
|
|
function filterURLForDisplay(url, maxLength = null) {
|
2024-09-19 21:55:35 -04:00
|
|
|
|
if (!url) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
|
// Remove protocol and www prefixes.
|
2024-09-19 21:55:35 -04:00
|
|
|
|
let filteredURL = url.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, '').replace(/^www\./i, '');
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// Ends with / and only has that single slash, strip it.
|
2020-01-08 06:57:23 -05:00
|
|
|
|
if (filteredURL.match(/^[^\/]+\/$/)) {
|
2021-01-27 21:04:13 -05:00
|
|
|
|
filteredURL = filteredURL.replace('/', '');
|
2020-01-08 06:57:23 -05:00
|
|
|
|
}
|
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
|
|
|
|
|
|
|
|
|
// capture file name from URL
|
|
|
|
|
const fileRegexp = /\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;
|
|
|
|
|
if (!maxLength || filteredURL.length <= maxLength || !filteredURL.match(fileRegexp)) {
|
2021-01-27 21:04:13 -05:00
|
|
|
|
return filteredURL;
|
2023-09-26 10:23:26 -04:00
|
|
|
|
}
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// If the file is not greater than max length, return last portion of URL.
|
2021-01-27 21:04:13 -05:00
|
|
|
|
filteredURL = filteredURL.split('?')[0];
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const urlPieces = filteredURL.split('/');
|
|
|
|
|
const file = urlPieces[urlPieces.length - 1];
|
2021-01-27 21:04:13 -05:00
|
|
|
|
if (file.length <= maxLength) {
|
|
|
|
|
return '…' + filteredURL.slice(-maxLength);
|
2023-09-26 10:23:26 -04:00
|
|
|
|
}
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// If the file is greater than max length, truncate the file.
|
2021-05-19 11:09:27 -04:00
|
|
|
|
const index = file.lastIndexOf('.');
|
|
|
|
|
const [fileName, extension] = [file.slice(0, index), file.slice(index + 1)];
|
|
|
|
|
const truncatedFile = fileName.slice(-3) + '.' + extension;
|
2021-01-27 21:04:13 -05:00
|
|
|
|
return file.slice(0, maxLength - truncatedFile.length - 1) + '…' + truncatedFile;
|
2020-01-08 06:57:23 -05:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-20 11:43:29 -04:00
|
|
|
|
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
|
2024-02-15 11:53:15 -05:00
|
|
|
|
var remove_accents = __webpack_require__(9681);
|
2022-09-20 11:43:29 -04:00
|
|
|
|
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/clean-for-slug.js
|
2020-02-06 16:03:31 -05:00
|
|
|
|
/**
|
|
|
|
|
* External dependencies
|
|
|
|
|
*/
|
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2020-02-06 16:03:31 -05:00
|
|
|
|
/**
|
|
|
|
|
* Performs some basic cleanup of a string for use as a post slug.
|
|
|
|
|
*
|
|
|
|
|
* This replicates some of what `sanitize_title()` does in WordPress core, but
|
|
|
|
|
* is only designed to approximate what the slug will be.
|
|
|
|
|
*
|
|
|
|
|
* Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin
|
2020-06-26 09:33:47 -04:00
|
|
|
|
* letters. Removes combining diacritical marks. Converts whitespace, periods,
|
|
|
|
|
* and forward slashes to hyphens. Removes any remaining non-word characters
|
|
|
|
|
* except hyphens. Converts remaining string to lowercase. It does not account
|
|
|
|
|
* for octets, HTML entities, or other encoded characters.
|
2020-02-06 16:03:31 -05:00
|
|
|
|
*
|
|
|
|
|
* @param {string} string Title or slug to be processed.
|
|
|
|
|
*
|
|
|
|
|
* @return {string} Processed string.
|
|
|
|
|
*/
|
|
|
|
|
function cleanForSlug(string) {
|
|
|
|
|
if (!string) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
return remove_accents_default()(string)
|
|
|
|
|
// Convert each group of whitespace, periods, and forward slashes to a hyphen.
|
|
|
|
|
.replace(/[\s\./]+/g, '-')
|
|
|
|
|
// Remove anything that's not a letter, number, underscore or hyphen.
|
|
|
|
|
.replace(/[^\p{L}\p{N}_-]+/gu, '')
|
|
|
|
|
// Convert to lowercase
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
// Replace multiple hyphens with a single one.
|
|
|
|
|
.replace(/-+/g, '-')
|
|
|
|
|
// Remove any remaining leading or trailing hyphens.
|
2022-09-20 11:43:29 -04:00
|
|
|
|
.replace(/(^-+)|(-+$)/g, '');
|
2020-02-06 16:03:31 -05:00
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-filename.js
|
2024-09-19 21:55:35 -04:00
|
|
|
|
/* wp:polyfill */
|
2021-11-08 09:29:21 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns the filename part of the URL.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The full URL.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'
|
|
|
|
|
* const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string|void} The filename part of the URL.
|
|
|
|
|
*/
|
|
|
|
|
function getFilename(url) {
|
|
|
|
|
let filename;
|
2024-05-23 15:39:28 -04:00
|
|
|
|
if (!url) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2021-11-08 09:29:21 -05:00
|
|
|
|
try {
|
|
|
|
|
filename = new URL(url, 'http://example.com').pathname.split('/').pop();
|
|
|
|
|
} catch (error) {}
|
|
|
|
|
if (filename) {
|
|
|
|
|
return filename;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/normalize-path.js
|
2021-11-08 09:29:21 -05:00
|
|
|
|
/**
|
|
|
|
|
* Given a path, returns a normalized path where equal query parameter values
|
|
|
|
|
* will be treated as identical, regardless of order they appear in the original
|
|
|
|
|
* text.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} path Original path.
|
|
|
|
|
*
|
|
|
|
|
* @return {string} Normalized path.
|
|
|
|
|
*/
|
|
|
|
|
function normalizePath(path) {
|
|
|
|
|
const splitted = path.split('?');
|
|
|
|
|
const query = splitted[1];
|
|
|
|
|
const base = splitted[0];
|
|
|
|
|
if (!query) {
|
|
|
|
|
return base;
|
2023-09-26 10:23:26 -04:00
|
|
|
|
}
|
2021-11-08 09:29:21 -05:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// 'b=1%2C2&c=2&a=5'
|
|
|
|
|
return base + '?' + query
|
|
|
|
|
// [ 'b=1%2C2', 'c=2', 'a=5' ]
|
|
|
|
|
.split('&')
|
|
|
|
|
// [ [ 'b, '1%2C2' ], [ 'c', '2' ], [ 'a', '5' ] ]
|
|
|
|
|
.map(entry => entry.split('='))
|
|
|
|
|
// [ [ 'b', '1,2' ], [ 'c', '2' ], [ 'a', '5' ] ]
|
|
|
|
|
.map(pair => pair.map(decodeURIComponent))
|
|
|
|
|
// [ [ 'a', '5' ], [ 'b, '1,2' ], [ 'c', '2' ] ]
|
|
|
|
|
.sort((a, b) => a[0].localeCompare(b[0]))
|
|
|
|
|
// [ [ 'a', '5' ], [ 'b, '1%2C2' ], [ 'c', '2' ] ]
|
|
|
|
|
.map(pair => pair.map(encodeURIComponent))
|
|
|
|
|
// [ 'a=5', 'b=1%2C2', 'c=2' ]
|
|
|
|
|
.map(pair => pair.join('='))
|
|
|
|
|
// 'a=5&b=1%2C2&c=2'
|
2021-11-08 09:29:21 -05:00
|
|
|
|
.join('&');
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-27 10:24:19 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/prepend-https.js
|
|
|
|
|
/**
|
|
|
|
|
* Internal dependencies
|
|
|
|
|
*/
|
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
|
2023-06-27 10:24:19 -04:00
|
|
|
|
/**
|
|
|
|
|
* Prepends "https://" to a url, if it looks like something that is meant to be a TLD.
|
|
|
|
|
*
|
|
|
|
|
* Note: this will not replace "http://" with "https://".
|
|
|
|
|
*
|
|
|
|
|
* @param {string} url The URL to test.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```js
|
|
|
|
|
* const actualURL = prependHTTPS( 'wordpress.org' ); // https://wordpress.org
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @return {string} The updated URL.
|
|
|
|
|
*/
|
|
|
|
|
function prependHTTPS(url) {
|
|
|
|
|
if (!url) {
|
|
|
|
|
return url;
|
2023-09-26 10:23:26 -04:00
|
|
|
|
}
|
2023-06-27 10:24:19 -04:00
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
// If url starts with http://, return it as is.
|
2023-06-27 10:24:19 -04:00
|
|
|
|
if (url.startsWith('http://')) {
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
url = prependHTTP(url);
|
|
|
|
|
return url.replace(/^http:/, 'https:');
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/index.js
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-27 07:28:19 -04:00
|
|
|
|
|
|
|
|
|
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-08 09:29:21 -05:00
|
|
|
|
|
|
|
|
|
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
|
|
|
|
|
2023-06-27 10:24:19 -04:00
|
|
|
|
|
2024-09-19 21:55:35 -04:00
|
|
|
|
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
|
|
2024-01-31 07:59:56 -05:00
|
|
|
|
})();
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
|
(window.wp = window.wp || {}).url = __webpack_exports__;
|
|
|
|
|
/******/ })()
|
|
|
|
|
;
|