fix: prevent asset conflicts between React and Grid.js versions

Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
dwindown
2026-04-18 17:02:14 +07:00
parent bd9cdac02e
commit e8fbfb14c1
74973 changed files with 6658406 additions and 71 deletions

47
node_modules/@wordpress/url/build/add-query-args.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addQueryArgs = addQueryArgs;
var _getQueryArgs = require("./get-query-args");
var _buildQueryString = require("./build-query-string");
/**
* Internal dependencies
*/
/**
* 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.
*
* @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.
*
* @example
* ```js
* const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test
* ```
*
* @return {string} URL with arguments applied.
*/
function addQueryArgs(url = '', args) {
// If no arguments are to be appended, return original URL.
if (!args || !Object.keys(args).length) {
return url;
}
let baseUrl = url;
// Determine whether URL already had query arguments.
const queryStringIndex = url.indexOf('?');
if (queryStringIndex !== -1) {
// Merge into existing query arguments.
args = Object.assign((0, _getQueryArgs.getQueryArgs)(url), args);
// Change working base URL to omit previous query arguments.
baseUrl = baseUrl.substr(0, queryStringIndex);
}
return baseUrl + '?' + (0, _buildQueryString.buildQueryString)(args);
}
//# sourceMappingURL=add-query-args.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_getQueryArgs","require","_buildQueryString","addQueryArgs","url","args","Object","keys","length","baseUrl","queryStringIndex","indexOf","assign","getQueryArgs","substr","buildQueryString"],"sources":["@wordpress/url/src/add-query-args.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\nimport { buildQueryString } from './build-query-string';\n\n/**\n * Appends arguments as querystring to the provided URL. If the URL already\n * includes query arguments, the arguments are merged with (and take precedent\n * over) the existing set.\n *\n * @param {string} [url=''] URL to which arguments should be appended. If omitted,\n * only the resulting querystring is returned.\n * @param {Object} [args] Query arguments to apply to URL.\n *\n * @example\n * ```js\n * const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test\n * ```\n *\n * @return {string} URL with arguments applied.\n */\nexport function addQueryArgs( url = '', args ) {\n\t// If no arguments are to be appended, return original URL.\n\tif ( ! args || ! Object.keys( args ).length ) {\n\t\treturn url;\n\t}\n\n\tlet baseUrl = url;\n\n\t// Determine whether URL already had query arguments.\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex !== -1 ) {\n\t\t// Merge into existing query arguments.\n\t\targs = Object.assign( getQueryArgs( url ), args );\n\n\t\t// Change working base URL to omit previous query arguments.\n\t\tbaseUrl = baseUrl.substr( 0, queryStringIndex );\n\t}\n\n\treturn baseUrl + '?' + buildQueryString( args );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,YAAYA,CAAEC,GAAG,GAAG,EAAE,EAAEC,IAAI,EAAG;EAC9C;EACA,IAAK,CAAEA,IAAI,IAAI,CAAEC,MAAM,CAACC,IAAI,CAAEF,IAAK,CAAC,CAACG,MAAM,EAAG;IAC7C,OAAOJ,GAAG;EACX;EAEA,IAAIK,OAAO,GAAGL,GAAG;;EAEjB;EACA,MAAMM,gBAAgB,GAAGN,GAAG,CAACO,OAAO,CAAE,GAAI,CAAC;EAC3C,IAAKD,gBAAgB,KAAK,CAAC,CAAC,EAAG;IAC9B;IACAL,IAAI,GAAGC,MAAM,CAACM,MAAM,CAAE,IAAAC,0BAAY,EAAET,GAAI,CAAC,EAAEC,IAAK,CAAC;;IAEjD;IACAI,OAAO,GAAGA,OAAO,CAACK,MAAM,CAAE,CAAC,EAAEJ,gBAAiB,CAAC;EAChD;EAEA,OAAOD,OAAO,GAAG,GAAG,GAAG,IAAAM,kCAAgB,EAAEV,IAAK,CAAC;AAChD","ignoreList":[]}

View File

@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildQueryString = buildQueryString;
/**
* 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) {
let string = '';
const stack = Object.entries(data);
let pair;
while (pair = stack.shift()) {
let [key, value] = pair;
// Support building deeply nested data, from array or object values.
const hasNestedData = Array.isArray(value) || value && value.constructor === Object;
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.
const valuePairs = Object.entries(value).reverse();
for (const [member, memberValue] of valuePairs) {
stack.unshift([`${key}[${member}]`, memberValue]);
}
} else if (value !== undefined) {
// Null is treated as special case, equivalent to empty string.
if (value === null) {
value = '';
}
string += '&' + [key, value].map(encodeURIComponent).join('=');
}
}
// Loop will concatenate with leading `&`, but it's only expected for all
// 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);
}
//# sourceMappingURL=build-query-string.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["buildQueryString","data","string","stack","Object","entries","pair","shift","key","value","hasNestedData","Array","isArray","constructor","valuePairs","reverse","member","memberValue","unshift","undefined","map","encodeURIComponent","join","substr"],"sources":["@wordpress/url/src/build-query-string.js"],"sourcesContent":["/**\n * Generates URL-encoded query string using input query data.\n *\n * It is intended to behave equivalent as PHP's `http_build_query`, configured\n * with encoding type PHP_QUERY_RFC3986 (spaces as `%20`).\n *\n * @example\n * ```js\n * const queryString = buildQueryString( {\n * simple: 'is ok',\n * arrays: [ 'are', 'fine', 'too' ],\n * objects: {\n * evenNested: {\n * ok: 'yes',\n * },\n * },\n * } );\n * // \"simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes\"\n * ```\n *\n * @param {Record<string,*>} data Data to encode.\n *\n * @return {string} Query string.\n */\nexport function buildQueryString( data ) {\n\tlet string = '';\n\n\tconst stack = Object.entries( data );\n\n\tlet pair;\n\twhile ( ( pair = stack.shift() ) ) {\n\t\tlet [ key, value ] = pair;\n\n\t\t// Support building deeply nested data, from array or object values.\n\t\tconst hasNestedData =\n\t\t\tArray.isArray( value ) || ( value && value.constructor === Object );\n\n\t\tif ( hasNestedData ) {\n\t\t\t// Push array or object values onto the stack as composed of their\n\t\t\t// original key and nested index or key, retaining order by a\n\t\t\t// combination of Array#reverse and Array#unshift onto the stack.\n\t\t\tconst valuePairs = Object.entries( value ).reverse();\n\t\t\tfor ( const [ member, memberValue ] of valuePairs ) {\n\t\t\t\tstack.unshift( [ `${ key }[${ member }]`, memberValue ] );\n\t\t\t}\n\t\t} else if ( value !== undefined ) {\n\t\t\t// Null is treated as special case, equivalent to empty string.\n\t\t\tif ( value === null ) {\n\t\t\t\tvalue = '';\n\t\t\t}\n\n\t\t\tstring +=\n\t\t\t\t'&' + [ key, value ].map( encodeURIComponent ).join( '=' );\n\t\t}\n\t}\n\n\t// Loop will concatenate with leading `&`, but it's only expected for all\n\t// but the first query parameter. This strips the leading `&`, while still\n\t// accounting for the case that the string may in-fact be empty.\n\treturn string.substr( 1 );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAgBA,CAAEC,IAAI,EAAG;EACxC,IAAIC,MAAM,GAAG,EAAE;EAEf,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAAEJ,IAAK,CAAC;EAEpC,IAAIK,IAAI;EACR,OAAUA,IAAI,GAAGH,KAAK,CAACI,KAAK,CAAC,CAAC,EAAK;IAClC,IAAI,CAAEC,GAAG,EAAEC,KAAK,CAAE,GAAGH,IAAI;;IAEzB;IACA,MAAMI,aAAa,GAClBC,KAAK,CAACC,OAAO,CAAEH,KAAM,CAAC,IAAMA,KAAK,IAAIA,KAAK,CAACI,WAAW,KAAKT,MAAQ;IAEpE,IAAKM,aAAa,EAAG;MACpB;MACA;MACA;MACA,MAAMI,UAAU,GAAGV,MAAM,CAACC,OAAO,CAAEI,KAAM,CAAC,CAACM,OAAO,CAAC,CAAC;MACpD,KAAM,MAAM,CAAEC,MAAM,EAAEC,WAAW,CAAE,IAAIH,UAAU,EAAG;QACnDX,KAAK,CAACe,OAAO,CAAE,CAAG,GAAGV,GAAK,IAAIQ,MAAQ,GAAE,EAAEC,WAAW,CAAG,CAAC;MAC1D;IACD,CAAC,MAAM,IAAKR,KAAK,KAAKU,SAAS,EAAG;MACjC;MACA,IAAKV,KAAK,KAAK,IAAI,EAAG;QACrBA,KAAK,GAAG,EAAE;MACX;MAEAP,MAAM,IACL,GAAG,GAAG,CAAEM,GAAG,EAAEC,KAAK,CAAE,CAACW,GAAG,CAAEC,kBAAmB,CAAC,CAACC,IAAI,CAAE,GAAI,CAAC;IAC5D;EACD;;EAEA;EACA;EACA;EACA,OAAOpB,MAAM,CAACqB,MAAM,CAAE,CAAE,CAAC;AAC1B","ignoreList":[]}

45
node_modules/@wordpress/url/build/clean-for-slug.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cleanForSlug = cleanForSlug;
var _removeAccents = _interopRequireDefault(require("remove-accents"));
/**
* External dependencies
*/
/**
* 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
* 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.
*
* @param {string} string Title or slug to be processed.
*
* @return {string} Processed string.
*/
function cleanForSlug(string) {
if (!string) {
return '';
}
return (0, _removeAccents.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.
.replace(/(^-+)|(-+$)/g, '');
}
//# sourceMappingURL=clean-for-slug.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_removeAccents","_interopRequireDefault","require","cleanForSlug","string","removeAccents","replace","toLowerCase"],"sources":["@wordpress/url/src/clean-for-slug.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * Performs some basic cleanup of a string for use as a post slug.\n *\n * This replicates some of what `sanitize_title()` does in WordPress core, but\n * is only designed to approximate what the slug will be.\n *\n * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin\n * letters. Removes combining diacritical marks. Converts whitespace, periods,\n * and forward slashes to hyphens. Removes any remaining non-word characters\n * except hyphens. Converts remaining string to lowercase. It does not account\n * for octets, HTML entities, or other encoded characters.\n *\n * @param {string} string Title or slug to be processed.\n *\n * @return {string} Processed string.\n */\nexport function cleanForSlug( string ) {\n\tif ( ! string ) {\n\t\treturn '';\n\t}\n\treturn (\n\t\tremoveAccents( string )\n\t\t\t// Convert each group of whitespace, periods, and forward slashes to a hyphen.\n\t\t\t.replace( /[\\s\\./]+/g, '-' )\n\t\t\t// Remove anything that's not a letter, number, underscore or hyphen.\n\t\t\t.replace( /[^\\p{L}\\p{N}_-]+/gu, '' )\n\t\t\t// Convert to lowercase\n\t\t\t.toLowerCase()\n\t\t\t// Replace multiple hyphens with a single one.\n\t\t\t.replace( /-+/g, '-' )\n\t\t\t// Remove any remaining leading or trailing hyphens.\n\t\t\t.replace( /(^-+)|(-+$)/g, '' )\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAEC,MAAM,EAAG;EACtC,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EACA,OACC,IAAAC,sBAAa,EAAED,MAAO;EACrB;EAAA,CACCE,OAAO,CAAE,WAAW,EAAE,GAAI;EAC3B;EAAA,CACCA,OAAO,CAAE,oBAAoB,EAAE,EAAG;EACnC;EAAA,CACCC,WAAW,CAAC;EACb;EAAA,CACCD,OAAO,CAAE,KAAK,EAAE,GAAI;EACrB;EAAA,CACCA,OAAO,CAAE,cAAc,EAAE,EAAG,CAAC;AAEjC","ignoreList":[]}

View File

@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.filterURLForDisplay = filterURLForDisplay;
/**
* Returns a URL for display.
*
* @param {string} url Original URL.
* @param {number|null} maxLength URL length.
*
* @example
* ```js
* const displayUrl = filterURLForDisplay( 'https://www.wordpress.org/gutenberg/' ); // wordpress.org/gutenberg
* const imageUrl = filterURLForDisplay( 'https://www.wordpress.org/wp-content/uploads/img.png', 20 ); // …ent/uploads/img.png
* ```
*
* @return {string} Displayed URL.
*/
function filterURLForDisplay(url, maxLength = null) {
// Remove protocol and www prefixes.
let filteredURL = url.replace(/^(?:https?:)\/\/(?:www\.)?/, '');
// Ends with / and only has that single slash, strip it.
if (filteredURL.match(/^[^\/]+\/$/)) {
filteredURL = filteredURL.replace('/', '');
}
// capture file name from URL
const fileRegexp = /\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;
if (!maxLength || filteredURL.length <= maxLength || !filteredURL.match(fileRegexp)) {
return filteredURL;
}
// If the file is not greater than max length, return last portion of URL.
filteredURL = filteredURL.split('?')[0];
const urlPieces = filteredURL.split('/');
const file = urlPieces[urlPieces.length - 1];
if (file.length <= maxLength) {
return '…' + filteredURL.slice(-maxLength);
}
// If the file is greater than max length, truncate the file.
const index = file.lastIndexOf('.');
const [fileName, extension] = [file.slice(0, index), file.slice(index + 1)];
const truncatedFile = fileName.slice(-3) + '.' + extension;
return file.slice(0, maxLength - truncatedFile.length - 1) + '…' + truncatedFile;
}
//# sourceMappingURL=filter-url-for-display.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["filterURLForDisplay","url","maxLength","filteredURL","replace","match","fileRegexp","length","split","urlPieces","file","slice","index","lastIndexOf","fileName","extension","truncatedFile"],"sources":["@wordpress/url/src/filter-url-for-display.js"],"sourcesContent":["/**\n * Returns a URL for display.\n *\n * @param {string} url Original URL.\n * @param {number|null} maxLength URL length.\n *\n * @example\n * ```js\n * const displayUrl = filterURLForDisplay( 'https://www.wordpress.org/gutenberg/' ); // wordpress.org/gutenberg\n * const imageUrl = filterURLForDisplay( 'https://www.wordpress.org/wp-content/uploads/img.png', 20 ); // …ent/uploads/img.png\n * ```\n *\n * @return {string} Displayed URL.\n */\nexport function filterURLForDisplay( url, maxLength = null ) {\n\t// Remove protocol and www prefixes.\n\tlet filteredURL = url.replace( /^(?:https?:)\\/\\/(?:www\\.)?/, '' );\n\n\t// Ends with / and only has that single slash, strip it.\n\tif ( filteredURL.match( /^[^\\/]+\\/$/ ) ) {\n\t\tfilteredURL = filteredURL.replace( '/', '' );\n\t}\n\n\t// capture file name from URL\n\tconst fileRegexp = /\\/([^\\/?]+)\\.(?:[\\w]+)(?=\\?|$)/;\n\n\tif (\n\t\t! maxLength ||\n\t\tfilteredURL.length <= maxLength ||\n\t\t! filteredURL.match( fileRegexp )\n\t) {\n\t\treturn filteredURL;\n\t}\n\n\t// If the file is not greater than max length, return last portion of URL.\n\tfilteredURL = filteredURL.split( '?' )[ 0 ];\n\tconst urlPieces = filteredURL.split( '/' );\n\tconst file = urlPieces[ urlPieces.length - 1 ];\n\tif ( file.length <= maxLength ) {\n\t\treturn '…' + filteredURL.slice( -maxLength );\n\t}\n\n\t// If the file is greater than max length, truncate the file.\n\tconst index = file.lastIndexOf( '.' );\n\tconst [ fileName, extension ] = [\n\t\tfile.slice( 0, index ),\n\t\tfile.slice( index + 1 ),\n\t];\n\tconst truncatedFile = fileName.slice( -3 ) + '.' + extension;\n\treturn (\n\t\tfile.slice( 0, maxLength - truncatedFile.length - 1 ) +\n\t\t'…' +\n\t\ttruncatedFile\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAmBA,CAAEC,GAAG,EAAEC,SAAS,GAAG,IAAI,EAAG;EAC5D;EACA,IAAIC,WAAW,GAAGF,GAAG,CAACG,OAAO,CAAE,4BAA4B,EAAE,EAAG,CAAC;;EAEjE;EACA,IAAKD,WAAW,CAACE,KAAK,CAAE,YAAa,CAAC,EAAG;IACxCF,WAAW,GAAGA,WAAW,CAACC,OAAO,CAAE,GAAG,EAAE,EAAG,CAAC;EAC7C;;EAEA;EACA,MAAME,UAAU,GAAG,gCAAgC;EAEnD,IACC,CAAEJ,SAAS,IACXC,WAAW,CAACI,MAAM,IAAIL,SAAS,IAC/B,CAAEC,WAAW,CAACE,KAAK,CAAEC,UAAW,CAAC,EAChC;IACD,OAAOH,WAAW;EACnB;;EAEA;EACAA,WAAW,GAAGA,WAAW,CAACK,KAAK,CAAE,GAAI,CAAC,CAAE,CAAC,CAAE;EAC3C,MAAMC,SAAS,GAAGN,WAAW,CAACK,KAAK,CAAE,GAAI,CAAC;EAC1C,MAAME,IAAI,GAAGD,SAAS,CAAEA,SAAS,CAACF,MAAM,GAAG,CAAC,CAAE;EAC9C,IAAKG,IAAI,CAACH,MAAM,IAAIL,SAAS,EAAG;IAC/B,OAAO,GAAG,GAAGC,WAAW,CAACQ,KAAK,CAAE,CAACT,SAAU,CAAC;EAC7C;;EAEA;EACA,MAAMU,KAAK,GAAGF,IAAI,CAACG,WAAW,CAAE,GAAI,CAAC;EACrC,MAAM,CAAEC,QAAQ,EAAEC,SAAS,CAAE,GAAG,CAC/BL,IAAI,CAACC,KAAK,CAAE,CAAC,EAAEC,KAAM,CAAC,EACtBF,IAAI,CAACC,KAAK,CAAEC,KAAK,GAAG,CAAE,CAAC,CACvB;EACD,MAAMI,aAAa,GAAGF,QAAQ,CAACH,KAAK,CAAE,CAAC,CAAE,CAAC,GAAG,GAAG,GAAGI,SAAS;EAC5D,OACCL,IAAI,CAACC,KAAK,CAAE,CAAC,EAAET,SAAS,GAAGc,aAAa,CAACT,MAAM,GAAG,CAAE,CAAC,GACrD,GAAG,GACHS,aAAa;AAEf","ignoreList":[]}

26
node_modules/@wordpress/url/build/get-authority.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAuthority = getAuthority;
/**
* 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) {
const matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(url);
if (matches) {
return matches[1];
}
}
//# sourceMappingURL=get-authority.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getAuthority","url","matches","exec"],"sources":["@wordpress/url/src/get-authority.js"],"sourcesContent":["/**\n * Returns the authority part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const authority1 = getAuthority( 'https://wordpress.org/help/' ); // 'wordpress.org'\n * const authority2 = getAuthority( 'https://localhost:8080/test/' ); // 'localhost:8080'\n * ```\n *\n * @return {string|void} The authority part of the URL.\n */\nexport function getAuthority( url ) {\n\tconst matches = /^[^\\/\\s:]+:(?:\\/\\/)?\\/?([^\\/\\s#?]+)[\\/#?]{0,1}\\S*$/.exec(\n\t\turl\n\t);\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,YAAYA,CAAEC,GAAG,EAAG;EACnC,MAAMC,OAAO,GAAG,oDAAoD,CAACC,IAAI,CACxEF,GACD,CAAC;EACD,IAAKC,OAAO,EAAG;IACd,OAAOA,OAAO,CAAE,CAAC,CAAE;EACpB;AACD","ignoreList":[]}

32
node_modules/@wordpress/url/build/get-filename.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getFilename = getFilename;
/**
* 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;
if (!url) {
return;
}
try {
filename = new URL(url, 'http://example.com').pathname.split('/').pop();
} catch (error) {}
if (filename) {
return filename;
}
}
//# sourceMappingURL=get-filename.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getFilename","url","filename","URL","pathname","split","pop","error"],"sources":["@wordpress/url/src/get-filename.js"],"sourcesContent":["/**\n * Returns the filename part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'\n * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'\n * ```\n *\n * @return {string|void} The filename part of the URL.\n */\nexport function getFilename( url ) {\n\tlet filename;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfilename = new URL( url, 'http://example.com' ).pathname\n\t\t\t.split( '/' )\n\t\t\t.pop();\n\t} catch ( error ) {}\n\n\tif ( filename ) {\n\t\treturn filename;\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAWA,CAAEC,GAAG,EAAG;EAClC,IAAIC,QAAQ;EAEZ,IAAK,CAAED,GAAG,EAAG;IACZ;EACD;EAEA,IAAI;IACHC,QAAQ,GAAG,IAAIC,GAAG,CAAEF,GAAG,EAAE,oBAAqB,CAAC,CAACG,QAAQ,CACtDC,KAAK,CAAE,GAAI,CAAC,CACZC,GAAG,CAAC,CAAC;EACR,CAAC,CAAC,OAAQC,KAAK,EAAG,CAAC;EAEnB,IAAKL,QAAQ,EAAG;IACf,OAAOA,QAAQ;EAChB;AACD","ignoreList":[]}

26
node_modules/@wordpress/url/build/get-fragment.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getFragment = getFragment;
/**
* 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) {
const matches = /^\S+?(#[^\s\?]*)/.exec(url);
if (matches) {
return matches[1];
}
}
//# sourceMappingURL=get-fragment.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getFragment","url","matches","exec"],"sources":["@wordpress/url/src/get-fragment.js"],"sourcesContent":["/**\n * Returns the fragment part of the URL.\n *\n * @param {string} url The full URL\n *\n * @example\n * ```js\n * const fragment1 = getFragment( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // '#fragment'\n * const fragment2 = getFragment( 'https://wordpress.org#another-fragment?query=true' ); // '#another-fragment'\n * ```\n *\n * @return {string|void} The fragment part of the URL.\n */\nexport function getFragment( url ) {\n\tconst matches = /^\\S+?(#[^\\s\\?]*)/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAWA,CAAEC,GAAG,EAAG;EAClC,MAAMC,OAAO,GAAG,kBAAkB,CAACC,IAAI,CAAEF,GAAI,CAAC;EAC9C,IAAKC,OAAO,EAAG;IACd,OAAOA,OAAO,CAAE,CAAC,CAAE;EACpB;AACD","ignoreList":[]}

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPathAndQueryString = getPathAndQueryString;
var _ = require(".");
/**
* Internal dependencies
*/
/**
* 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) {
const path = (0, _.getPath)(url);
const queryString = (0, _.getQueryString)(url);
let value = '/';
if (path) {
value += path;
}
if (queryString) {
value += `?${queryString}`;
}
return value;
}
//# sourceMappingURL=get-path-and-query-string.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_","require","getPathAndQueryString","url","path","getPath","queryString","getQueryString","value"],"sources":["@wordpress/url/src/get-path-and-query-string.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getPath, getQueryString } from '.';\n\n/**\n * Returns the path part and query string part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const pathAndQueryString1 = getPathAndQueryString( 'http://localhost:8080/this/is/a/test?query=true' ); // '/this/is/a/test?query=true'\n * const pathAndQueryString2 = getPathAndQueryString( 'https://wordpress.org/help/faq/' ); // '/help/faq'\n * ```\n *\n * @return {string} The path part and query string part of the URL.\n */\nexport function getPathAndQueryString( url ) {\n\tconst path = getPath( url );\n\tconst queryString = getQueryString( url );\n\tlet value = '/';\n\tif ( path ) {\n\t\tvalue += path;\n\t}\n\tif ( queryString ) {\n\t\tvalue += `?${ queryString }`;\n\t}\n\treturn value;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,CAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAEC,GAAG,EAAG;EAC5C,MAAMC,IAAI,GAAG,IAAAC,SAAO,EAAEF,GAAI,CAAC;EAC3B,MAAMG,WAAW,GAAG,IAAAC,gBAAc,EAAEJ,GAAI,CAAC;EACzC,IAAIK,KAAK,GAAG,GAAG;EACf,IAAKJ,IAAI,EAAG;IACXI,KAAK,IAAIJ,IAAI;EACd;EACA,IAAKE,WAAW,EAAG;IAClBE,KAAK,IAAK,IAAIF,WAAa,EAAC;EAC7B;EACA,OAAOE,KAAK;AACb","ignoreList":[]}

26
node_modules/@wordpress/url/build/get-path.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPath = getPath;
/**
* 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) {
const matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url);
if (matches) {
return matches[1];
}
}
//# sourceMappingURL=get-path.js.map

1
node_modules/@wordpress/url/build/get-path.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"names":["getPath","url","matches","exec"],"sources":["@wordpress/url/src/get-path.js"],"sourcesContent":["/**\n * Returns the path part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const path1 = getPath( 'http://localhost:8080/this/is/a/test?query=true' ); // 'this/is/a/test'\n * const path2 = getPath( 'https://wordpress.org/help/faq/' ); // 'help/faq'\n * ```\n *\n * @return {string|void} The path part of the URL.\n */\nexport function getPath( url ) {\n\tconst matches =\n\t\t/^[^\\/\\s:]+:(?:\\/\\/)?[^\\/\\s#?]+[\\/]([^\\s#?]+)[#?]{0,1}\\S*$/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAOA,CAAEC,GAAG,EAAG;EAC9B,MAAMC,OAAO,GACZ,2DAA2D,CAACC,IAAI,CAAEF,GAAI,CAAC;EACxE,IAAKC,OAAO,EAAG;IACd,OAAOA,OAAO,CAAE,CAAC,CAAE;EACpB;AACD","ignoreList":[]}

26
node_modules/@wordpress/url/build/get-protocol.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getProtocol = getProtocol;
/**
* 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) {
const matches = /^([^\s:]+:)/.exec(url);
if (matches) {
return matches[1];
}
}
//# sourceMappingURL=get-protocol.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getProtocol","url","matches","exec"],"sources":["@wordpress/url/src/get-protocol.js"],"sourcesContent":["/**\n * Returns the protocol part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const protocol1 = getProtocol( 'tel:012345678' ); // 'tel:'\n * const protocol2 = getProtocol( 'https://wordpress.org' ); // 'https:'\n * ```\n *\n * @return {string|void} The protocol part of the URL.\n */\nexport function getProtocol( url ) {\n\tconst matches = /^([^\\s:]+:)/.exec( url );\n\tif ( matches ) {\n\t\treturn matches[ 1 ];\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAWA,CAAEC,GAAG,EAAG;EAClC,MAAMC,OAAO,GAAG,aAAa,CAACC,IAAI,CAAEF,GAAI,CAAC;EACzC,IAAKC,OAAO,EAAG;IACd,OAAOA,OAAO,CAAE,CAAC,CAAE;EACpB;AACD","ignoreList":[]}

36
node_modules/@wordpress/url/build/get-query-arg.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getQueryArg = getQueryArg;
var _getQueryArgs = require("./get-query-args");
/**
* Internal dependencies
*/
/**
* @typedef {{[key: string]: QueryArgParsed}} QueryArgObject
*/
/**
* @typedef {string|string[]|QueryArgObject} QueryArgParsed
*/
/**
* 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
* ```
*
* @return {QueryArgParsed|void} Query arg value.
*/
function getQueryArg(url, arg) {
return (0, _getQueryArgs.getQueryArgs)(url)[arg];
}
//# sourceMappingURL=get-query-arg.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_getQueryArgs","require","getQueryArg","url","arg","getQueryArgs"],"sources":["@wordpress/url/src/get-query-arg.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\n\n/**\n * @typedef {{[key: string]: QueryArgParsed}} QueryArgObject\n */\n\n/**\n * @typedef {string|string[]|QueryArgObject} QueryArgParsed\n */\n\n/**\n * Returns a single query argument of the url\n *\n * @param {string} url URL.\n * @param {string} arg Query arg name.\n *\n * @example\n * ```js\n * const foo = getQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'foo' ); // bar\n * ```\n *\n * @return {QueryArgParsed|void} Query arg value.\n */\nexport function getQueryArg( url, arg ) {\n\treturn getQueryArgs( url )[ arg ];\n}\n"],"mappings":";;;;;;AAGA,IAAAA,aAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,WAAWA,CAAEC,GAAG,EAAEC,GAAG,EAAG;EACvC,OAAO,IAAAC,0BAAY,EAAEF,GAAI,CAAC,CAAEC,GAAG,CAAE;AAClC","ignoreList":[]}

93
node_modules/@wordpress/url/build/get-query-args.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getQueryArgs = getQueryArgs;
var _safeDecodeUriComponent = require("./safe-decode-uri-component");
var _getQueryString = require("./get-query-string");
/**
* Internal dependencies
*/
/** @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) {
const length = path.length;
const lastIndex = length - 1;
for (let i = 0; i < length; i++) {
let key = path[i];
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();
}
key = ['__proto__', 'constructor', 'prototype'].includes(key) ? key.toUpperCase() : key;
// If the next key in the path is numeric (or empty string), it will be
// created as an array. Otherwise, it will be created as an object.
const isNextKeyArrayIndex = !isNaN(Number(path[i + 1]));
object[key] = i === lastIndex ?
// If at end of path, assign the intended value.
value :
// Otherwise, advance to the next object in the path, creating
// 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.
object[key] = {
...object[key]
};
}
// Update working reference object to the next in the path.
object = object[key];
}
}
/**
* 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) {
return ((0, _getQueryString.getQueryString)(url) || ''
// Normalize space encoding, accounting for PHP URL encoding
// corresponding to `application/x-www-form-urlencoded`.
//
// See: https://tools.ietf.org/html/rfc1866#section-8.2.1
).replace(/\+/g, '%20').split('&').reduce((accumulator, keyValue) => {
const [key, value = ''] = keyValue.split('=')
// Filtering avoids decoding as `undefined` for value, where
// default is restored in destructuring assignment.
.filter(Boolean).map(_safeDecodeUriComponent.safeDecodeURIComponent);
if (key) {
const segments = key.replace(/\]/g, '').split('[');
setPath(accumulator, segments, value);
}
return accumulator;
}, Object.create(null));
}
//# sourceMappingURL=get-query-args.js.map

File diff suppressed because one or more lines are too long

28
node_modules/@wordpress/url/build/get-query-string.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getQueryString = getQueryString;
/**
* Returns the query string part of the URL.
*
* @param {string} url The full URL.
*
* @example
* ```js
* const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'
* ```
*
* @return {string|void} The query string part of the URL.
*/
function getQueryString(url) {
let query;
try {
query = new URL(url, 'http://example.com').search.substring(1);
} catch (error) {}
if (query) {
return query;
}
}
//# sourceMappingURL=get-query-string.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getQueryString","url","query","URL","search","substring","error"],"sources":["@wordpress/url/src/get-query-string.js"],"sourcesContent":["/**\n * Returns the query string part of the URL.\n *\n * @param {string} url The full URL.\n *\n * @example\n * ```js\n * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'\n * ```\n *\n * @return {string|void} The query string part of the URL.\n */\nexport function getQueryString( url ) {\n\tlet query;\n\ttry {\n\t\tquery = new URL( url, 'http://example.com' ).search.substring( 1 );\n\t} catch ( error ) {}\n\n\tif ( query ) {\n\t\treturn query;\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAcA,CAAEC,GAAG,EAAG;EACrC,IAAIC,KAAK;EACT,IAAI;IACHA,KAAK,GAAG,IAAIC,GAAG,CAAEF,GAAG,EAAE,oBAAqB,CAAC,CAACG,MAAM,CAACC,SAAS,CAAE,CAAE,CAAC;EACnE,CAAC,CAAC,OAAQC,KAAK,EAAG,CAAC;EAEnB,IAAKJ,KAAK,EAAG;IACZ,OAAOA,KAAK;EACb;AACD","ignoreList":[]}

28
node_modules/@wordpress/url/build/has-query-arg.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasQueryArg = hasQueryArg;
var _getQueryArg = require("./get-query-arg");
/**
* Internal dependencies
*/
/**
* 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 (0, _getQueryArg.getQueryArg)(url, arg) !== undefined;
}
//# sourceMappingURL=has-query-arg.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_getQueryArg","require","hasQueryArg","url","arg","getQueryArg","undefined"],"sources":["@wordpress/url/src/has-query-arg.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getQueryArg } from './get-query-arg';\n\n/**\n * Determines whether the URL contains a given query arg.\n *\n * @param {string} url URL.\n * @param {string} arg Query arg name.\n *\n * @example\n * ```js\n * const hasBar = hasQueryArg( 'https://wordpress.org?foo=bar&bar=baz', 'bar' ); // true\n * ```\n *\n * @return {boolean} Whether or not the URL contains the query arg.\n */\nexport function hasQueryArg( url, arg ) {\n\treturn getQueryArg( url, arg ) !== undefined;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,WAAWA,CAAEC,GAAG,EAAEC,GAAG,EAAG;EACvC,OAAO,IAAAC,wBAAW,EAAEF,GAAG,EAAEC,GAAI,CAAC,KAAKE,SAAS;AAC7C","ignoreList":[]}

195
node_modules/@wordpress/url/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,195 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "addQueryArgs", {
enumerable: true,
get: function () {
return _addQueryArgs.addQueryArgs;
}
});
Object.defineProperty(exports, "buildQueryString", {
enumerable: true,
get: function () {
return _buildQueryString.buildQueryString;
}
});
Object.defineProperty(exports, "cleanForSlug", {
enumerable: true,
get: function () {
return _cleanForSlug.cleanForSlug;
}
});
Object.defineProperty(exports, "filterURLForDisplay", {
enumerable: true,
get: function () {
return _filterUrlForDisplay.filterURLForDisplay;
}
});
Object.defineProperty(exports, "getAuthority", {
enumerable: true,
get: function () {
return _getAuthority.getAuthority;
}
});
Object.defineProperty(exports, "getFilename", {
enumerable: true,
get: function () {
return _getFilename.getFilename;
}
});
Object.defineProperty(exports, "getFragment", {
enumerable: true,
get: function () {
return _getFragment.getFragment;
}
});
Object.defineProperty(exports, "getPath", {
enumerable: true,
get: function () {
return _getPath.getPath;
}
});
Object.defineProperty(exports, "getPathAndQueryString", {
enumerable: true,
get: function () {
return _getPathAndQueryString.getPathAndQueryString;
}
});
Object.defineProperty(exports, "getProtocol", {
enumerable: true,
get: function () {
return _getProtocol.getProtocol;
}
});
Object.defineProperty(exports, "getQueryArg", {
enumerable: true,
get: function () {
return _getQueryArg.getQueryArg;
}
});
Object.defineProperty(exports, "getQueryArgs", {
enumerable: true,
get: function () {
return _getQueryArgs.getQueryArgs;
}
});
Object.defineProperty(exports, "getQueryString", {
enumerable: true,
get: function () {
return _getQueryString.getQueryString;
}
});
Object.defineProperty(exports, "hasQueryArg", {
enumerable: true,
get: function () {
return _hasQueryArg.hasQueryArg;
}
});
Object.defineProperty(exports, "isEmail", {
enumerable: true,
get: function () {
return _isEmail.isEmail;
}
});
Object.defineProperty(exports, "isURL", {
enumerable: true,
get: function () {
return _isUrl.isURL;
}
});
Object.defineProperty(exports, "isValidAuthority", {
enumerable: true,
get: function () {
return _isValidAuthority.isValidAuthority;
}
});
Object.defineProperty(exports, "isValidFragment", {
enumerable: true,
get: function () {
return _isValidFragment.isValidFragment;
}
});
Object.defineProperty(exports, "isValidPath", {
enumerable: true,
get: function () {
return _isValidPath.isValidPath;
}
});
Object.defineProperty(exports, "isValidProtocol", {
enumerable: true,
get: function () {
return _isValidProtocol.isValidProtocol;
}
});
Object.defineProperty(exports, "isValidQueryString", {
enumerable: true,
get: function () {
return _isValidQueryString.isValidQueryString;
}
});
Object.defineProperty(exports, "normalizePath", {
enumerable: true,
get: function () {
return _normalizePath.normalizePath;
}
});
Object.defineProperty(exports, "prependHTTP", {
enumerable: true,
get: function () {
return _prependHttp.prependHTTP;
}
});
Object.defineProperty(exports, "prependHTTPS", {
enumerable: true,
get: function () {
return _prependHttps.prependHTTPS;
}
});
Object.defineProperty(exports, "removeQueryArgs", {
enumerable: true,
get: function () {
return _removeQueryArgs.removeQueryArgs;
}
});
Object.defineProperty(exports, "safeDecodeURI", {
enumerable: true,
get: function () {
return _safeDecodeUri.safeDecodeURI;
}
});
Object.defineProperty(exports, "safeDecodeURIComponent", {
enumerable: true,
get: function () {
return _safeDecodeUriComponent.safeDecodeURIComponent;
}
});
var _isUrl = require("./is-url");
var _isEmail = require("./is-email");
var _getProtocol = require("./get-protocol");
var _isValidProtocol = require("./is-valid-protocol");
var _getAuthority = require("./get-authority");
var _isValidAuthority = require("./is-valid-authority");
var _getPath = require("./get-path");
var _isValidPath = require("./is-valid-path");
var _getQueryString = require("./get-query-string");
var _buildQueryString = require("./build-query-string");
var _isValidQueryString = require("./is-valid-query-string");
var _getPathAndQueryString = require("./get-path-and-query-string");
var _getFragment = require("./get-fragment");
var _isValidFragment = require("./is-valid-fragment");
var _addQueryArgs = require("./add-query-args");
var _getQueryArg = require("./get-query-arg");
var _getQueryArgs = require("./get-query-args");
var _hasQueryArg = require("./has-query-arg");
var _removeQueryArgs = require("./remove-query-args");
var _prependHttp = require("./prepend-http");
var _safeDecodeUri = require("./safe-decode-uri");
var _safeDecodeUriComponent = require("./safe-decode-uri-component");
var _filterUrlForDisplay = require("./filter-url-for-display");
var _cleanForSlug = require("./clean-for-slug");
var _getFilename = require("./get-filename");
var _normalizePath = require("./normalize-path");
var _prependHttps = require("./prepend-https");
//# sourceMappingURL=index.js.map

1
node_modules/@wordpress/url/build/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"names":["_isUrl","require","_isEmail","_getProtocol","_isValidProtocol","_getAuthority","_isValidAuthority","_getPath","_isValidPath","_getQueryString","_buildQueryString","_isValidQueryString","_getPathAndQueryString","_getFragment","_isValidFragment","_addQueryArgs","_getQueryArg","_getQueryArgs","_hasQueryArg","_removeQueryArgs","_prependHttp","_safeDecodeUri","_safeDecodeUriComponent","_filterUrlForDisplay","_cleanForSlug","_getFilename","_normalizePath","_prependHttps"],"sources":["@wordpress/url/src/index.js"],"sourcesContent":["export { isURL } from './is-url';\nexport { isEmail } from './is-email';\nexport { getProtocol } from './get-protocol';\nexport { isValidProtocol } from './is-valid-protocol';\nexport { getAuthority } from './get-authority';\nexport { isValidAuthority } from './is-valid-authority';\nexport { getPath } from './get-path';\nexport { isValidPath } from './is-valid-path';\nexport { getQueryString } from './get-query-string';\nexport { buildQueryString } from './build-query-string';\nexport { isValidQueryString } from './is-valid-query-string';\nexport { getPathAndQueryString } from './get-path-and-query-string';\nexport { getFragment } from './get-fragment';\nexport { isValidFragment } from './is-valid-fragment';\nexport { addQueryArgs } from './add-query-args';\nexport { getQueryArg } from './get-query-arg';\nexport { getQueryArgs } from './get-query-args';\nexport { hasQueryArg } from './has-query-arg';\nexport { removeQueryArgs } from './remove-query-args';\nexport { prependHTTP } from './prepend-http';\nexport { safeDecodeURI } from './safe-decode-uri';\nexport { safeDecodeURIComponent } from './safe-decode-uri-component';\nexport { filterURLForDisplay } from './filter-url-for-display';\nexport { cleanForSlug } from './clean-for-slug';\nexport { getFilename } from './get-filename';\nexport { normalizePath } from './normalize-path';\nexport { prependHTTPS } from './prepend-https';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AACA,IAAAW,sBAAA,GAAAX,OAAA;AACA,IAAAY,YAAA,GAAAZ,OAAA;AACA,IAAAa,gBAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,YAAA,GAAAf,OAAA;AACA,IAAAgB,aAAA,GAAAhB,OAAA;AACA,IAAAiB,YAAA,GAAAjB,OAAA;AACA,IAAAkB,gBAAA,GAAAlB,OAAA;AACA,IAAAmB,YAAA,GAAAnB,OAAA;AACA,IAAAoB,cAAA,GAAApB,OAAA;AACA,IAAAqB,uBAAA,GAAArB,OAAA;AACA,IAAAsB,oBAAA,GAAAtB,OAAA;AACA,IAAAuB,aAAA,GAAAvB,OAAA;AACA,IAAAwB,YAAA,GAAAxB,OAAA;AACA,IAAAyB,cAAA,GAAAzB,OAAA;AACA,IAAA0B,aAAA,GAAA1B,OAAA","ignoreList":[]}

24
node_modules/@wordpress/url/build/is-email.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isEmail = isEmail;
const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
/**
* 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);
}
//# sourceMappingURL=is-email.js.map

1
node_modules/@wordpress/url/build/is-email.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"names":["EMAIL_REGEXP","isEmail","email","test"],"sources":["@wordpress/url/src/is-email.js"],"sourcesContent":["const EMAIL_REGEXP =\n\t/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\\.[a-z]{2,63}$/i;\n\n/**\n * Determines whether the given string looks like an email.\n *\n * @param {string} email The string to scrutinise.\n *\n * @example\n * ```js\n * const isEmail = isEmail( 'hello@wordpress.org' ); // true\n * ```\n *\n * @return {boolean} Whether or not it looks like an email.\n */\nexport function isEmail( email ) {\n\treturn EMAIL_REGEXP.test( email );\n}\n"],"mappings":";;;;;;AAAA,MAAMA,YAAY,GACjB,8DAA8D;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAAEC,KAAK,EAAG;EAChC,OAAOF,YAAY,CAACG,IAAI,CAAED,KAAM,CAAC;AAClC","ignoreList":[]}

32
node_modules/@wordpress/url/build/is-url.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isURL = isURL;
/**
* 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
* ```
*
* @see https://url.spec.whatwg.org/
* @see https://url.spec.whatwg.org/#valid-url-string
*
* @return {boolean} Whether or not it looks like a URL.
*/
function isURL(url) {
// 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;
} catch {
return false;
}
}
//# sourceMappingURL=is-url.js.map

1
node_modules/@wordpress/url/build/is-url.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"names":["isURL","url","URL"],"sources":["@wordpress/url/src/is-url.js"],"sourcesContent":["/**\n * Determines whether the given string looks like a URL.\n *\n * @param {string} url The string to scrutinise.\n *\n * @example\n * ```js\n * const isURL = isURL( 'https://wordpress.org' ); // true\n * ```\n *\n * @see https://url.spec.whatwg.org/\n * @see https://url.spec.whatwg.org/#valid-url-string\n *\n * @return {boolean} Whether or not it looks like a URL.\n */\nexport function isURL( url ) {\n\t// A URL can be considered value if the `URL` constructor is able to parse\n\t// it. The constructor throws an error for an invalid URL.\n\ttry {\n\t\tnew URL( url );\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,KAAKA,CAAEC,GAAG,EAAG;EAC5B;EACA;EACA,IAAI;IACH,IAAIC,GAAG,CAAED,GAAI,CAAC;IACd,OAAO,IAAI;EACZ,CAAC,CAAC,MAAM;IACP,OAAO,KAAK;EACb;AACD","ignoreList":[]}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isValidAuthority = isValidAuthority;
/**
* 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);
}
//# sourceMappingURL=is-valid-authority.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["isValidAuthority","authority","test"],"sources":["@wordpress/url/src/is-valid-authority.js"],"sourcesContent":["/**\n * Checks for invalid characters within the provided authority.\n *\n * @param {string} authority A string containing the URL authority.\n *\n * @example\n * ```js\n * const isValid = isValidAuthority( 'wordpress.org' ); // true\n * const isNotValid = isValidAuthority( 'wordpress#org' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid authority.\n */\nexport function isValidAuthority( authority ) {\n\tif ( ! authority ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?]+$/.test( authority );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAgBA,CAAEC,SAAS,EAAG;EAC7C,IAAK,CAAEA,SAAS,EAAG;IAClB,OAAO,KAAK;EACb;EACA,OAAO,YAAY,CAACC,IAAI,CAAED,SAAU,CAAC;AACtC","ignoreList":[]}

26
node_modules/@wordpress/url/build/is-valid-fragment.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isValidFragment = isValidFragment;
/**
* 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);
}
//# sourceMappingURL=is-valid-fragment.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["isValidFragment","fragment","test"],"sources":["@wordpress/url/src/is-valid-fragment.js"],"sourcesContent":["/**\n * Checks for invalid characters within the provided fragment.\n *\n * @param {string} fragment The url fragment.\n *\n * @example\n * ```js\n * const isValid = isValidFragment( '#valid-fragment' ); // true\n * const isNotValid = isValidFragment( '#invalid-#fragment' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid fragment.\n */\nexport function isValidFragment( fragment ) {\n\tif ( ! fragment ) {\n\t\treturn false;\n\t}\n\treturn /^#[^\\s#?\\/]*$/.test( fragment );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAAEC,QAAQ,EAAG;EAC3C,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA,OAAO,eAAe,CAACC,IAAI,CAAED,QAAS,CAAC;AACxC","ignoreList":[]}

26
node_modules/@wordpress/url/build/is-valid-path.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isValidPath = isValidPath;
/**
* 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);
}
//# sourceMappingURL=is-valid-path.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["isValidPath","path","test"],"sources":["@wordpress/url/src/is-valid-path.js"],"sourcesContent":["/**\n * Checks for invalid characters within the provided path.\n *\n * @param {string} path The URL path.\n *\n * @example\n * ```js\n * const isValid = isValidPath( 'test/path/' ); // true\n * const isNotValid = isValidPath( '/invalid?test/path/' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid path\n */\nexport function isValidPath( path ) {\n\tif ( ! path ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?]+$/.test( path );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAWA,CAAEC,IAAI,EAAG;EACnC,IAAK,CAAEA,IAAI,EAAG;IACb,OAAO,KAAK;EACb;EACA,OAAO,YAAY,CAACC,IAAI,CAAED,IAAK,CAAC;AACjC","ignoreList":[]}

26
node_modules/@wordpress/url/build/is-valid-protocol.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isValidProtocol = isValidProtocol;
/**
* 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);
}
//# sourceMappingURL=is-valid-protocol.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["isValidProtocol","protocol","test"],"sources":["@wordpress/url/src/is-valid-protocol.js"],"sourcesContent":["/**\n * Tests if a url protocol is valid.\n *\n * @param {string} protocol The url protocol.\n *\n * @example\n * ```js\n * const isValid = isValidProtocol( 'https:' ); // true\n * const isNotValid = isValidProtocol( 'https :' ); // false\n * ```\n *\n * @return {boolean} True if the argument is a valid protocol (e.g. http:, tel:).\n */\nexport function isValidProtocol( protocol ) {\n\tif ( ! protocol ) {\n\t\treturn false;\n\t}\n\treturn /^[a-z\\-.\\+]+[0-9]*:$/i.test( protocol );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAAEC,QAAQ,EAAG;EAC3C,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA,OAAO,uBAAuB,CAACC,IAAI,CAAED,QAAS,CAAC;AAChD","ignoreList":[]}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isValidQueryString = isValidQueryString;
/**
* 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);
}
//# sourceMappingURL=is-valid-query-string.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["isValidQueryString","queryString","test"],"sources":["@wordpress/url/src/is-valid-query-string.js"],"sourcesContent":["/**\n * Checks for invalid characters within the provided query string.\n *\n * @param {string} queryString The query string.\n *\n * @example\n * ```js\n * const isValid = isValidQueryString( 'query=true&another=false' ); // true\n * const isNotValid = isValidQueryString( 'query=true?another=false' ); // false\n * ```\n *\n * @return {boolean} True if the argument contains a valid query string.\n */\nexport function isValidQueryString( queryString ) {\n\tif ( ! queryString ) {\n\t\treturn false;\n\t}\n\treturn /^[^\\s#?\\/]+$/.test( queryString );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,kBAAkBA,CAAEC,WAAW,EAAG;EACjD,IAAK,CAAEA,WAAW,EAAG;IACpB,OAAO,KAAK;EACb;EACA,OAAO,cAAc,CAACC,IAAI,CAAED,WAAY,CAAC;AAC1C","ignoreList":[]}

41
node_modules/@wordpress/url/build/normalize-path.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.normalizePath = normalizePath;
/**
* 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;
}
// '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'
.join('&');
}
//# sourceMappingURL=normalize-path.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["normalizePath","path","splitted","split","query","base","map","entry","pair","decodeURIComponent","sort","a","b","localeCompare","encodeURIComponent","join"],"sources":["@wordpress/url/src/normalize-path.js"],"sourcesContent":["/**\n * Given a path, returns a normalized path where equal query parameter values\n * will be treated as identical, regardless of order they appear in the original\n * text.\n *\n * @param {string} path Original path.\n *\n * @return {string} Normalized path.\n */\nexport function normalizePath( path ) {\n\tconst splitted = path.split( '?' );\n\tconst query = splitted[ 1 ];\n\tconst base = splitted[ 0 ];\n\tif ( ! query ) {\n\t\treturn base;\n\t}\n\n\t// 'b=1%2C2&c=2&a=5'\n\treturn (\n\t\tbase +\n\t\t'?' +\n\t\tquery\n\t\t\t// [ 'b=1%2C2', 'c=2', 'a=5' ]\n\t\t\t.split( '&' )\n\t\t\t// [ [ 'b, '1%2C2' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( ( entry ) => entry.split( '=' ) )\n\t\t\t// [ [ 'b', '1,2' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( ( pair ) => pair.map( decodeURIComponent ) )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1,2' ], [ 'c', '2' ] ]\n\t\t\t.sort( ( a, b ) => a[ 0 ].localeCompare( b[ 0 ] ) )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1%2C2' ], [ 'c', '2' ] ]\n\t\t\t.map( ( pair ) => pair.map( encodeURIComponent ) )\n\t\t\t// [ 'a=5', 'b=1%2C2', 'c=2' ]\n\t\t\t.map( ( pair ) => pair.join( '=' ) )\n\t\t\t// 'a=5&b=1%2C2&c=2'\n\t\t\t.join( '&' )\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAAEC,IAAI,EAAG;EACrC,MAAMC,QAAQ,GAAGD,IAAI,CAACE,KAAK,CAAE,GAAI,CAAC;EAClC,MAAMC,KAAK,GAAGF,QAAQ,CAAE,CAAC,CAAE;EAC3B,MAAMG,IAAI,GAAGH,QAAQ,CAAE,CAAC,CAAE;EAC1B,IAAK,CAAEE,KAAK,EAAG;IACd,OAAOC,IAAI;EACZ;;EAEA;EACA,OACCA,IAAI,GACJ,GAAG,GACHD;EACC;EAAA,CACCD,KAAK,CAAE,GAAI;EACZ;EAAA,CACCG,GAAG,CAAIC,KAAK,IAAMA,KAAK,CAACJ,KAAK,CAAE,GAAI,CAAE;EACtC;EAAA,CACCG,GAAG,CAAIE,IAAI,IAAMA,IAAI,CAACF,GAAG,CAAEG,kBAAmB,CAAE;EACjD;EAAA,CACCC,IAAI,CAAE,CAAEC,CAAC,EAAEC,CAAC,KAAMD,CAAC,CAAE,CAAC,CAAE,CAACE,aAAa,CAAED,CAAC,CAAE,CAAC,CAAG,CAAE;EAClD;EAAA,CACCN,GAAG,CAAIE,IAAI,IAAMA,IAAI,CAACF,GAAG,CAAEQ,kBAAmB,CAAE;EACjD;EAAA,CACCR,GAAG,CAAIE,IAAI,IAAMA,IAAI,CAACO,IAAI,CAAE,GAAI,CAAE;EACnC;EAAA,CACCA,IAAI,CAAE,GAAI,CAAC;AAEf","ignoreList":[]}

36
node_modules/@wordpress/url/build/prepend-http.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.prependHTTP = prependHTTP;
var _isEmail = require("./is-email");
/**
* Internal dependencies
*/
const USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
/**
* 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) && !(0, _isEmail.isEmail)(url)) {
return 'http://' + url;
}
return url;
}
//# sourceMappingURL=prepend-http.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_isEmail","require","USABLE_HREF_REGEXP","prependHTTP","url","trim","test","isEmail"],"sources":["@wordpress/url/src/prepend-http.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { isEmail } from './is-email';\n\nconst USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\\?|\\.|\\/)/i;\n\n/**\n * Prepends \"http://\" to a url, if it looks like something that is meant to be a TLD.\n *\n * @param {string} url The URL to test.\n *\n * @example\n * ```js\n * const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org\n * ```\n *\n * @return {string} The updated URL.\n */\nexport function prependHTTP( url ) {\n\tif ( ! url ) {\n\t\treturn url;\n\t}\n\n\turl = url.trim();\n\tif ( ! USABLE_HREF_REGEXP.test( url ) && ! isEmail( url ) ) {\n\t\treturn 'http://' + url;\n\t}\n\n\treturn url;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,kBAAkB,GAAG,0BAA0B;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,WAAWA,CAAEC,GAAG,EAAG;EAClC,IAAK,CAAEA,GAAG,EAAG;IACZ,OAAOA,GAAG;EACX;EAEAA,GAAG,GAAGA,GAAG,CAACC,IAAI,CAAC,CAAC;EAChB,IAAK,CAAEH,kBAAkB,CAACI,IAAI,CAAEF,GAAI,CAAC,IAAI,CAAE,IAAAG,gBAAO,EAAEH,GAAI,CAAC,EAAG;IAC3D,OAAO,SAAS,GAAGA,GAAG;EACvB;EAEA,OAAOA,GAAG;AACX","ignoreList":[]}

38
node_modules/@wordpress/url/build/prepend-https.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.prependHTTPS = prependHTTPS;
var _prependHttp = require("./prepend-http");
/**
* Internal dependencies
*/
/**
* 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;
}
// If url starts with http://, return it as is.
if (url.startsWith('http://')) {
return url;
}
url = (0, _prependHttp.prependHTTP)(url);
return url.replace(/^http:/, 'https:');
}
//# sourceMappingURL=prepend-https.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_prependHttp","require","prependHTTPS","url","startsWith","prependHTTP","replace"],"sources":["@wordpress/url/src/prepend-https.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { prependHTTP } from './prepend-http';\n\n/**\n * Prepends \"https://\" to a url, if it looks like something that is meant to be a TLD.\n *\n * Note: this will not replace \"http://\" with \"https://\".\n *\n * @param {string} url The URL to test.\n *\n * @example\n * ```js\n * const actualURL = prependHTTPS( 'wordpress.org' ); // https://wordpress.org\n * ```\n *\n * @return {string} The updated URL.\n */\nexport function prependHTTPS( url ) {\n\tif ( ! url ) {\n\t\treturn url;\n\t}\n\n\t// If url starts with http://, return it as is.\n\tif ( url.startsWith( 'http://' ) ) {\n\t\treturn url;\n\t}\n\n\turl = prependHTTP( url );\n\n\treturn url.replace( /^http:/, 'https:' );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAEC,GAAG,EAAG;EACnC,IAAK,CAAEA,GAAG,EAAG;IACZ,OAAOA,GAAG;EACX;;EAEA;EACA,IAAKA,GAAG,CAACC,UAAU,CAAE,SAAU,CAAC,EAAG;IAClC,OAAOD,GAAG;EACX;EAEAA,GAAG,GAAG,IAAAE,wBAAW,EAAEF,GAAI,CAAC;EAExB,OAAOA,GAAG,CAACG,OAAO,CAAE,QAAQ,EAAE,QAAS,CAAC;AACzC","ignoreList":[]}

37
node_modules/@wordpress/url/build/remove-query-args.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.removeQueryArgs = removeQueryArgs;
var _getQueryArgs = require("./get-query-args");
var _buildQueryString = require("./build-query-string");
/**
* Internal dependencies
*/
/**
* 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.
*/
function removeQueryArgs(url, ...args) {
const queryStringIndex = url.indexOf('?');
if (queryStringIndex === -1) {
return url;
}
const query = (0, _getQueryArgs.getQueryArgs)(url);
const baseURL = url.substr(0, queryStringIndex);
args.forEach(arg => delete query[arg]);
const queryString = (0, _buildQueryString.buildQueryString)(query);
return queryString ? baseURL + '?' + queryString : baseURL;
}
//# sourceMappingURL=remove-query-args.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_getQueryArgs","require","_buildQueryString","removeQueryArgs","url","args","queryStringIndex","indexOf","query","getQueryArgs","baseURL","substr","forEach","arg","queryString","buildQueryString"],"sources":["@wordpress/url/src/remove-query-args.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getQueryArgs } from './get-query-args';\nimport { buildQueryString } from './build-query-string';\n\n/**\n * Removes arguments from the query string of the url\n *\n * @param {string} url URL.\n * @param {...string} args Query Args.\n *\n * @example\n * ```js\n * const newUrl = removeQueryArgs( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar', 'foo', 'bar' ); // https://wordpress.org?baz=foobar\n * ```\n *\n * @return {string} Updated URL.\n */\nexport function removeQueryArgs( url, ...args ) {\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex === -1 ) {\n\t\treturn url;\n\t}\n\n\tconst query = getQueryArgs( url );\n\tconst baseURL = url.substr( 0, queryStringIndex );\n\targs.forEach( ( arg ) => delete query[ arg ] );\n\tconst queryString = buildQueryString( query );\n\treturn queryString ? baseURL + '?' + queryString : baseURL;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAAEC,GAAG,EAAE,GAAGC,IAAI,EAAG;EAC/C,MAAMC,gBAAgB,GAAGF,GAAG,CAACG,OAAO,CAAE,GAAI,CAAC;EAC3C,IAAKD,gBAAgB,KAAK,CAAC,CAAC,EAAG;IAC9B,OAAOF,GAAG;EACX;EAEA,MAAMI,KAAK,GAAG,IAAAC,0BAAY,EAAEL,GAAI,CAAC;EACjC,MAAMM,OAAO,GAAGN,GAAG,CAACO,MAAM,CAAE,CAAC,EAAEL,gBAAiB,CAAC;EACjDD,IAAI,CAACO,OAAO,CAAIC,GAAG,IAAM,OAAOL,KAAK,CAAEK,GAAG,CAAG,CAAC;EAC9C,MAAMC,WAAW,GAAG,IAAAC,kCAAgB,EAAEP,KAAM,CAAC;EAC7C,OAAOM,WAAW,GAAGJ,OAAO,GAAG,GAAG,GAAGI,WAAW,GAAGJ,OAAO;AAC3D","ignoreList":[]}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.safeDecodeURIComponent = safeDecodeURIComponent;
/**
* 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;
}
}
//# sourceMappingURL=safe-decode-uri-component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["safeDecodeURIComponent","uriComponent","decodeURIComponent","uriComponentError"],"sources":["@wordpress/url/src/safe-decode-uri-component.js"],"sourcesContent":["/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param {string} uriComponent URI component to decode.\n *\n * @return {string} Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent ) {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch ( uriComponentError ) {\n\t\treturn uriComponent;\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,sBAAsBA,CAAEC,YAAY,EAAG;EACtD,IAAI;IACH,OAAOC,kBAAkB,CAAED,YAAa,CAAC;EAC1C,CAAC,CAAC,OAAQE,iBAAiB,EAAG;IAC7B,OAAOF,YAAY;EACpB;AACD","ignoreList":[]}

27
node_modules/@wordpress/url/build/safe-decode-uri.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.safeDecodeURI = safeDecodeURI;
/**
* 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;
}
}
//# sourceMappingURL=safe-decode-uri.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["safeDecodeURI","uri","decodeURI","uriError"],"sources":["@wordpress/url/src/safe-decode-uri.js"],"sourcesContent":["/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param {string} uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return {string} Decoded URI if possible.\n */\nexport function safeDecodeURI( uri ) {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch ( uriError ) {\n\t\treturn uri;\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAAEC,GAAG,EAAG;EACpC,IAAI;IACH,OAAOC,SAAS,CAAED,GAAI,CAAC;EACxB,CAAC,CAAC,OAAQE,QAAQ,EAAG;IACpB,OAAOF,GAAG;EACX;AACD","ignoreList":[]}