1 line
33 KiB
Plaintext
1 line
33 KiB
Plaintext
{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/index.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/fetch-all-middleware.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/http-v1.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/namespace-endpoint.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/nonce.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/preloading.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/root-url.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/user-locale.js","webpack://wp.[name]/external {\"this\":[\"wp\",\"hooks\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"i18n\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"url\"]}"],"names":["DEFAULT_HEADERS","Accept","DEFAULT_OPTIONS","credentials","middlewares","registerMiddleware","middleware","push","apiFetch","options","raw","nextOptions","url","path","data","parse","remainingOptions","body","headers","JSON","stringify","responsePromise","window","fetch","checkStatus","response","status","parseResponse","json","Promise","reject","then","catch","invalidJsonError","code","message","__","error","unknownError","steps","fetchAllMiddleware","httpV1Middleware","namespaceEndpointMiddleware","userLocaleMiddleware","reverse","runMiddleware","index","nextMiddleware","next","use","createNonceMiddleware","createPreloadingMiddleware","createRootURLMiddleware","modifyQuery","queryArgs","addQueryArgs","parseLinkHeader","linkHeader","match","getNextPageUrl","get","requestContainsUnboundedQuery","pathIsUnbounded","indexOf","urlIsUnbounded","per_page","results","Array","isArray","nextPage","mergedResults","concat","undefined","nextResponse","nextResults","OVERRIDE_METHODS","Set","DEFAULT_METHOD","method","has","toUpperCase","namespaceAndEndpointMiddleware","namespaceTrimmed","endpointTrimmed","namespace","endpoint","replace","nonce","usedNonce","addAction","addNonceHeader","headerName","hasOwnProperty","toLowerCase","preloadedData","getStablePath","splitted","split","query","base","map","entry","sort","a","b","localeCompare","pair","join","resolve","rootURL","optionsWithPath","apiRoot","hasQueryArg","_locale"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA,C;;;;;;;;;;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;;AAED,SAAOjE,IAAI,CAAEvC,OAAF,EAAWuC,IAAX,CAAX;AACA;;AAEcL,mFAAf;;;;;;;;;;;;ACjBA,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,oCAAoC,EAAE,I","file":"api-fetch.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/api-fetch/build-module/index.js\");\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport createNonceMiddleware from './middlewares/nonce';\nimport createRootURLMiddleware from './middlewares/root-url';\nimport createPreloadingMiddleware from './middlewares/preloading';\nimport fetchAllMiddleware from './middlewares/fetch-all-middleware';\nimport namespaceEndpointMiddleware from './middlewares/namespace-endpoint';\nimport httpV1Middleware from './middlewares/http-v1';\nimport userLocaleMiddleware from './middlewares/user-locale';\n\n/**\n * Default set of header values which should be sent with every request unless\n * explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_HEADERS = {\n\t// The backend uses the Accept header as a condition for considering an\n\t// incoming request as a REST request.\n\t//\n\t// See: https://core.trac.wordpress.org/ticket/44534\n\tAccept: 'application/json, */*;q=0.1',\n};\n\n/**\n * Default set of fetch option values which should be sent with every request\n * unless explicitly provided through apiFetch options.\n *\n * @type {Object}\n */\nconst DEFAULT_OPTIONS = {\n\tcredentials: 'include',\n};\n\nconst middlewares = [];\n\nfunction registerMiddleware( middleware ) {\n\tmiddlewares.push( middleware );\n}\n\nfunction apiFetch( options ) {\n\tconst raw = ( nextOptions ) => {\n\t\tconst { url, path, data, parse = true, ...remainingOptions } = nextOptions;\n\t\tlet { body, headers } = nextOptions;\n\n\t\t// Merge explicitly-provided headers with default values.\n\t\theaders = { ...DEFAULT_HEADERS, ...headers };\n\n\t\t// The `data` property is a shorthand for sending a JSON body.\n\t\tif ( data ) {\n\t\t\tbody = JSON.stringify( data );\n\t\t\theaders[ 'Content-Type' ] = 'application/json';\n\t\t}\n\n\t\tconst responsePromise = window.fetch(\n\t\t\turl || path,\n\t\t\t{\n\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\t...remainingOptions,\n\t\t\t\tbody,\n\t\t\t\theaders,\n\t\t\t}\n\t\t);\n\t\tconst checkStatus = ( response ) => {\n\t\t\tif ( response.status >= 200 && response.status < 300 ) {\n\t\t\t\treturn response;\n\t\t\t}\n\n\t\t\tthrow response;\n\t\t};\n\n\t\tconst parseResponse = ( response ) => {\n\t\t\tif ( parse ) {\n\t\t\t\tif ( response.status === 204 ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn response.json ? response.json() : Promise.reject( response );\n\t\t\t}\n\n\t\t\treturn response;\n\t\t};\n\n\t\treturn responsePromise\n\t\t\t.then( checkStatus )\n\t\t\t.then( parseResponse )\n\t\t\t.catch( ( response ) => {\n\t\t\t\tif ( ! parse ) {\n\t\t\t\t\tthrow response;\n\t\t\t\t}\n\n\t\t\t\tconst invalidJsonError = {\n\t\t\t\t\tcode: 'invalid_json',\n\t\t\t\t\tmessage: __( 'The response is not a valid JSON response.' ),\n\t\t\t\t};\n\n\t\t\t\tif ( ! response || ! response.json ) {\n\t\t\t\t\tthrow invalidJsonError;\n\t\t\t\t}\n\n\t\t\t\treturn response.json()\n\t\t\t\t\t.catch( () => {\n\t\t\t\t\t\tthrow invalidJsonError;\n\t\t\t\t\t} )\n\t\t\t\t\t.then( ( error ) => {\n\t\t\t\t\t\tconst unknownError = {\n\t\t\t\t\t\t\tcode: 'unknown_error',\n\t\t\t\t\t\t\tmessage: __( 'An unknown error occurred.' ),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tthrow error || unknownError;\n\t\t\t\t\t} );\n\t\t\t} );\n\t};\n\n\tconst steps = [\n\t\traw,\n\t\tfetchAllMiddleware,\n\t\thttpV1Middleware,\n\t\tnamespaceEndpointMiddleware,\n\t\tuserLocaleMiddleware,\n\t\t...middlewares,\n\t].reverse();\n\n\tconst runMiddleware = ( index ) => ( nextOptions ) => {\n\t\tconst nextMiddleware = steps[ index ];\n\t\tconst next = runMiddleware( index + 1 );\n\t\treturn nextMiddleware( nextOptions, next );\n\t};\n\n\treturn runMiddleware( 0 )( options );\n}\n\napiFetch.use = registerMiddleware;\n\napiFetch.createNonceMiddleware = createNonceMiddleware;\napiFetch.createPreloadingMiddleware = createPreloadingMiddleware;\napiFetch.createRootURLMiddleware = createRootURLMiddleware;\napiFetch.fetchAllMiddleware = fetchAllMiddleware;\n\nexport default apiFetch;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\n// Apply query arguments to both URL and Path, whichever is present.\nconst modifyQuery = ( { path, url, ...options }, queryArgs ) => ( {\n\t...options,\n\turl: url && addQueryArgs( url, queryArgs ),\n\tpath: path && addQueryArgs( path, queryArgs ),\n} );\n\n// Duplicates parsing functionality from apiFetch.\nconst parseResponse = ( response ) => response.json ?\n\tresponse.json() :\n\tPromise.reject( response );\n\nconst parseLinkHeader = ( linkHeader ) => {\n\tif ( ! linkHeader ) {\n\t\treturn {};\n\t}\n\tconst match = linkHeader.match( /<([^>]+)>; rel=\"next\"/ );\n\treturn match ? {\n\t\tnext: match[ 1 ],\n\t} : {};\n};\n\nconst getNextPageUrl = ( response ) => {\n\tconst { next } = parseLinkHeader( response.headers.get( 'link' ) );\n\treturn next;\n};\n\nconst requestContainsUnboundedQuery = ( options ) => {\n\tconst pathIsUnbounded = options.path && options.path.indexOf( 'per_page=-1' ) !== -1;\n\tconst urlIsUnbounded = options.url && options.url.indexOf( 'per_page=-1' ) !== -1;\n\treturn pathIsUnbounded || urlIsUnbounded;\n};\n\n// The REST API enforces an upper limit on the per_page option. To handle large\n// collections, apiFetch consumers can pass `per_page=-1`; this middleware will\n// then recursively assemble a full response array from all available pages.\nconst fetchAllMiddleware = async ( options, next ) => {\n\tif ( options.parse === false ) {\n\t\t// If a consumer has opted out of parsing, do not apply middleware.\n\t\treturn next( options );\n\t}\n\tif ( ! requestContainsUnboundedQuery( options ) ) {\n\t\t// If neither url nor path is requesting all items, do not apply middleware.\n\t\treturn next( options );\n\t}\n\n\t// Retrieve requested page of results.\n\tconst response = await next( {\n\t\t...modifyQuery( options, {\n\t\t\tper_page: 100,\n\t\t} ),\n\t\t// Ensure headers are returned for page 1.\n\t\tparse: false,\n\t} );\n\n\tconst results = await parseResponse( response );\n\n\tif ( ! Array.isArray( results ) ) {\n\t\t// We have no reliable way of merging non-array results.\n\t\treturn results;\n\t}\n\n\tlet nextPage = getNextPageUrl( response );\n\n\tif ( ! nextPage ) {\n\t\t// There are no further pages to request.\n\t\treturn results;\n\t}\n\n\t// Iteratively fetch all remaining pages until no \"next\" header is found.\n\tlet mergedResults = [].concat( results );\n\twhile ( nextPage ) {\n\t\tconst nextResponse = await next( {\n\t\t\t...options,\n\t\t\t// Ensure the URL for the next page is used instead of any provided path.\n\t\t\tpath: undefined,\n\t\t\turl: nextPage,\n\t\t\t// Ensure we still get headers so we can identify the next page.\n\t\t\tparse: false,\n\t\t} );\n\t\tconst nextResults = await parseResponse( nextResponse );\n\t\tmergedResults = mergedResults.concat( nextResults );\n\t\tnextPage = getNextPageUrl( nextResponse );\n\t}\n\treturn mergedResults;\n};\n\nexport default fetchAllMiddleware;\n","/**\n * Set of HTTP methods which are eligible to be overridden.\n *\n * @type {Set}\n */\nconst OVERRIDE_METHODS = new Set( [\n\t'PATCH',\n\t'PUT',\n\t'DELETE',\n] );\n\n/**\n * Default request method.\n *\n * \"A request has an associated method (a method). Unless stated otherwise it\n * is `GET`.\"\n *\n * @see https://fetch.spec.whatwg.org/#requests\n *\n * @type {string}\n */\nconst DEFAULT_METHOD = 'GET';\n\n/**\n * API Fetch middleware which overrides the request method for HTTP v1\n * compatibility leveraging the REST API X-HTTP-Method-Override header.\n *\n * @param {Object} options Fetch options.\n * @param {Function} next [description]\n *\n * @return {*} The evaluated result of the remaining middleware chain.\n */\nfunction httpV1Middleware( options, next ) {\n\tconst { method = DEFAULT_METHOD } = options;\n\tif ( OVERRIDE_METHODS.has( method.toUpperCase() ) ) {\n\t\toptions = {\n\t\t\t...options,\n\t\t\theaders: {\n\t\t\t\t...options.headers,\n\t\t\t\t'X-HTTP-Method-Override': method,\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t};\n\t}\n\n\treturn next( options, next );\n}\n\nexport default httpV1Middleware;\n","const namespaceAndEndpointMiddleware = ( options, next ) => {\n\tlet path = options.path;\n\tlet namespaceTrimmed, endpointTrimmed;\n\n\tif (\n\t\ttypeof options.namespace === 'string' &&\n\t\t\ttypeof options.endpoint === 'string'\n\t) {\n\t\tnamespaceTrimmed = options.namespace.replace( /^\\/|\\/$/g, '' );\n\t\tendpointTrimmed = options.endpoint.replace( /^\\//, '' );\n\t\tif ( endpointTrimmed ) {\n\t\t\tpath = namespaceTrimmed + '/' + endpointTrimmed;\n\t\t} else {\n\t\t\tpath = namespaceTrimmed;\n\t\t}\n\t}\n\n\tdelete options.namespace;\n\tdelete options.endpoint;\n\n\treturn next( {\n\t\t...options,\n\t\tpath,\n\t} );\n};\n\nexport default namespaceAndEndpointMiddleware;\n","/**\n * External dependencies\n */\nimport { addAction } from '@wordpress/hooks';\n\nconst createNonceMiddleware = ( nonce ) => {\n\tlet usedNonce = nonce;\n\n\t/**\n\t * This is not ideal but it's fine for now.\n\t *\n\t * Configure heartbeat to refresh the wp-api nonce, keeping the editor\n\t * authorization intact.\n\t */\n\taddAction( 'heartbeat.tick', 'core/api-fetch/create-nonce-middleware', ( response ) => {\n\t\tif ( response[ 'rest-nonce' ] ) {\n\t\t\tusedNonce = response[ 'rest-nonce' ];\n\t\t}\n\t} );\n\n\treturn function( options, next ) {\n\t\tlet headers = options.headers || {};\n\t\t// If an 'X-WP-Nonce' header (or any case-insensitive variation\n\t\t// thereof) was specified, no need to add a nonce header.\n\t\tlet addNonceHeader = true;\n\t\tfor ( const headerName in headers ) {\n\t\t\tif ( headers.hasOwnProperty( headerName ) ) {\n\t\t\t\tif ( headerName.toLowerCase() === 'x-wp-nonce' ) {\n\t\t\t\t\taddNonceHeader = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( addNonceHeader ) {\n\t\t\t// Do not mutate the original headers object, if any.\n\t\t\theaders = {\n\t\t\t\t...headers,\n\t\t\t\t'X-WP-Nonce': usedNonce,\n\t\t\t};\n\t\t}\n\n\t\treturn next( {\n\t\t\t...options,\n\t\t\theaders,\n\t\t} );\n\t};\n};\n\nexport default createNonceMiddleware;\n","const createPreloadingMiddleware = ( preloadedData ) => ( options, next ) => {\n\tfunction getStablePath( path ) {\n\t\tconst splitted = path.split( '?' );\n\t\tconst query = splitted[ 1 ];\n\t\tconst base = splitted[ 0 ];\n\t\tif ( ! query ) {\n\t\t\treturn base;\n\t\t}\n\n\t\t// 'b=1&c=2&a=5'\n\t\treturn base + '?' + query\n\t\t\t// [ 'b=1', 'c=2', 'a=5' ]\n\t\t\t.split( '&' )\n\t\t\t// [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]\n\t\t\t.map( function( entry ) {\n\t\t\t\treturn entry.split( '=' );\n\t\t\t} )\n\t\t\t// [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]\n\t\t\t.sort( function( a, b ) {\n\t\t\t\treturn a[ 0 ].localeCompare( b[ 0 ] );\n\t\t\t} )\n\t\t\t// [ 'a=5', 'b=1', 'c=2' ]\n\t\t\t.map( function( pair ) {\n\t\t\t\treturn pair.join( '=' );\n\t\t\t} )\n\t\t\t// 'a=5&b=1&c=2'\n\t\t\t.join( '&' );\n\t}\n\n\tconst { parse = true } = options;\n\tif ( typeof options.path === 'string' ) {\n\t\tconst method = options.method || 'GET';\n\t\tconst path = getStablePath( options.path );\n\n\t\tif ( parse && 'GET' === method && preloadedData[ path ] ) {\n\t\t\treturn Promise.resolve( preloadedData[ path ].body );\n\t\t} else if ( 'OPTIONS' === method && preloadedData[ method ][ path ] ) {\n\t\t\treturn Promise.resolve( preloadedData[ method ][ path ] );\n\t\t}\n\t}\n\n\treturn next( options );\n};\n\nexport default createPreloadingMiddleware;\n","/**\n * Internal dependencies\n */\nimport namespaceAndEndpointMiddleware from './namespace-endpoint';\n\nconst createRootURLMiddleware = ( rootURL ) => ( options, next ) => {\n\treturn namespaceAndEndpointMiddleware( options, ( optionsWithPath ) => {\n\t\tlet url = optionsWithPath.url;\n\t\tlet path = optionsWithPath.path;\n\t\tlet apiRoot;\n\n\t\tif ( typeof path === 'string' ) {\n\t\t\tapiRoot = rootURL;\n\n\t\t\tif ( -1 !== rootURL.indexOf( '?' ) ) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\tpath = path.replace( /^\\//, '' );\n\n\t\t\t// API root may already include query parameter prefix if site is\n\t\t\t// configured to use plain permalinks.\n\t\t\tif ( 'string' === typeof apiRoot && -1 !== apiRoot.indexOf( '?' ) ) {\n\t\t\t\tpath = path.replace( '?', '&' );\n\t\t\t}\n\n\t\t\turl = apiRoot + path;\n\t\t}\n\n\t\treturn next( {\n\t\t\t...optionsWithPath,\n\t\t\turl,\n\t\t} );\n\t} );\n};\n\nexport default createRootURLMiddleware;\n","/**\n * WordPress dependencies\n */\nimport { addQueryArgs, hasQueryArg } from '@wordpress/url';\n\nfunction userLocaleMiddleware( options, next ) {\n\tif ( typeof options.url === 'string' && ! hasQueryArg( options.url, '_locale' ) ) {\n\t\toptions.url = addQueryArgs( options.url, { _locale: 'user' } );\n\t}\n\n\tif ( typeof options.path === 'string' && ! hasQueryArg( options.path, '_locale' ) ) {\n\t\toptions.path = addQueryArgs( options.path, { _locale: 'user' } );\n\t}\n\n\treturn next( options, next );\n}\n\nexport default userLocaleMiddleware;\n","(function() { module.exports = this[\"wp\"][\"hooks\"]; }());","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"url\"]; }());"],"sourceRoot":""} |