: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
for (let i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
return unsafeStringify(rnds);
/* harmony default export */ const esm_browser_v4 = (v4);
;// CONCATENATED MODULE: external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// CONCATENATED MODULE: external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/set-nested-value.js
* Sets the value at path of object.
* If a portion of path doesn’t exist, it’s created.
* Arrays are created for missing index properties while objects are created
* for all other missing properties.
* Path is specified as either:
* - a string of properties, separated by dots, for example: "x.y".
* - an array of properties, for example `[ 'x', 'y' ]`.
* This function intentionally mutates the input object.
* @see https://lodash.com/docs/4.17.15#set
* @todo Needs to be deduplicated with its copy in `@wordpress/edit-site`.
* @param {Object} object Object to modify
* @param {Array|string} path Path of the property to set.
* @param {*} value Value to set.
function setNestedValue(object, path, value) {
if (!object || typeof object !== 'object') {
const normalizedPath = Array.isArray(path) ? path : path.split('.');
normalizedPath.reduce((acc, key, idx) => {
if (acc[key] === undefined) {
if (Number.isInteger(normalizedPath[idx + 1])) {
if (idx === normalizedPath.length - 1) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/get-nested-value.js
* Helper util to return a value from a certain path of the object.
* Path is specified as either:
* - a string of properties, separated by dots, for example: "x.y".
* - an array of properties, for example `[ 'x', 'y' ]`.
* You can also specify a default value in case the result is nullish.
* @param {Object} object Input object.
* @param {string|Array} path Path to the object property.
* @param {*} defaultValue Default value if the value at the specified path is undefined.
* @return {*} Value of the object property at the specified path.
function getNestedValue(object, path, defaultValue) {
if (!object || typeof object !== 'object' || typeof path !== 'string' && !Array.isArray(path)) {
const normalizedPath = Array.isArray(path) ? path : path.split('.');
normalizedPath.forEach(fieldName => {
value = value?.[fieldName];
return value !== undefined ? value : defaultValue;
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js
* Returns an action object used in signalling that items have been received.
* @param {Array} items Items received.
* @param {?Object} edits Optional edits to reset.
* @param {?Object} meta Meta information about pagination.
* @return {Object} Action object.
function receiveItems(items, edits, meta) {
items: Array.isArray(items) ? items : [items],
* Returns an action object used in signalling that entity records have been
* deleted and they need to be removed from entities state.
* @param {string} kind Kind of the removed entities.
* @param {string} name Name of the removed entities.
* @param {Array|number|string} records Record IDs of the removed entities.
* @param {boolean} invalidateCache Controls whether we want to invalidate the cache.
* @return {Object} Action object.
function removeItems(kind, name, records, invalidateCache = false) {
itemIds: Array.isArray(records) ? records : [records],
* Returns an action object used in signalling that queried data has been
* @param {Array} items Queried items received.
* @param {?Object} query Optional query object.
* @param {?Object} edits Optional edits to reset.
* @param {?Object} meta Meta information about pagination.
* @return {Object} Action object.
function receiveQueriedItems(items, query = {}, edits, meta) {
...receiveItems(items, edits, meta),
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js
* Maximum number of requests to place in a single batch request. Obtained by
* sending a preflight OPTIONS request to /batch/v1/.
function chunk(arr, chunkSize) {
cache.push(tmp.splice(0, chunkSize));
* Default batch processor. Sends its input requests to /batch/v1.
* @param {Array} requests List of API requests to perform at once.
* @return {Promise} Promise that resolves to a list of objects containing
* either `output` (if that request was successful) or `error`
async function defaultProcessor(requests) {
const preflightResponse = await external_wp_apiFetch_default()({
maxItems = preflightResponse.endpoints[0].args.requests.maxItems;
// @ts-ignore We would have crashed or never gotten to this point if we hadn't received the maxItems count.
for (const batchRequests of chunk(requests, maxItems)) {
const batchResponse = await external_wp_apiFetch_default()({
validation: 'require-all-validate',
requests: batchRequests.map(request => ({
// Rename 'data' to 'body'.
if (batchResponse.failed) {
batchResults = batchResponse.responses.map(response => ({
batchResults = batchResponse.responses.map(response => {
if (response.status >= 200 && response.status < 300) {
result.output = response.body;
result.error = response.body;
results.push(...batchResults);
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js
* Creates a batch, which can be used to combine multiple API requests into one
* API request using the WordPress batch processing API (/v1/batch).
* const batch = createBatch();
* const dunePromise = batch.add( {
* data: { title: 'Dune' }
* const lotrPromise = batch.add( {
* data: { title: 'Lord of the Rings' }
* const isSuccess = await batch.run(); // Sends one POST to /v1/batch.
* @param {Function} [processor] Processor function. Can be used to replace the
* default functionality which is to send an API
* request to /v1/batch. Is given an array of
* inputs and must return a promise that
* resolves to an array of objects containing
* either `output` or `error`.
function createBatch(processor = defaultProcessor) {
/** @type {Array<{ input: any; resolve: ( value: any ) => void; reject: ( error: any ) => void }>} */
const pending = new ObservableSet();
* Adds an input to the batch and returns a promise that is resolved or
* rejected when the input is processed by `batch.run()`.
* You may also pass a thunk which allows inputs to be added
* batch.add( { path: '/v1/books', ... } );
* batch.add( ( add ) => add( { path: '/v1/books', ... } ) );
* If a thunk is passed, `batch.run()` will pause until either:
* - The thunk calls its `add` argument, or;
* - The thunk returns a promise and that promise resolves, or;
* - The thunk returns a non-promise.
* @param {any|Function} inputOrThunk Input to add or thunk to execute.
* @return {Promise|any} If given an input, returns a promise that
* is resolved or rejected when the batch is
* processed. If given a thunk, returns the return
const add = input => new Promise((resolve, reject) => {
if (typeof inputOrThunk === 'function') {
return Promise.resolve(inputOrThunk(add)).finally(() => {
return add(inputOrThunk);
* Runs the batch. This calls `batchProcessor` and resolves or rejects
* all promises returned by `add()`.
* @return {Promise<boolean>} A promise that resolves to a boolean that is true
* if the processor returned no errors.
await new Promise(resolve => {
const unsubscribe = pending.subscribe(() => {
results = await processor(queue.map(({
if (results.length !== queue.length) {
throw new Error('run: Array returned by processor must be same size as input array.');
results.forEach((result, key) => {
const queueItem = queue[key];
queueItem?.reject(result.error);
queueItem?.resolve((_result$output = result?.output) !== null && _result$output !== void 0 ? _result$output : result);
this.set = new Set(...args);
this.subscribers = new Set();
this.subscribers.forEach(subscriber => subscriber());
const isSuccess = this.set.delete(value);
this.subscribers.forEach(subscriber => subscriber());
this.subscribers.add(subscriber);
this.subscribers.delete(subscriber);
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
* The reducer key used by core data in store registration.
* This is defined in a separate file to avoid cycle-dependency
const STORE_NAME = 'core';
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/actions.js
* Returns an action object used in signalling that authors have been received.
* Ignored from documentation as it's internal to the data store.
* @param {string} queryID Query ID.
* @param {Array|Object} users Users received.
* @return {Object} Action object.
function receiveUserQuery(queryID, users) {
type: 'RECEIVE_USER_QUERY',
users: Array.isArray(users) ? users : [users],
* Returns an action used in signalling that the current user has been received.
* Ignored from documentation as it's internal to the data store.
* @param {Object} currentUser Current user object.
* @return {Object} Action object.
function receiveCurrentUser(currentUser) {
type: 'RECEIVE_CURRENT_USER',
* Returns an action object used in adding new entities.
* @param {Array} entities Entities received.
* @return {Object} Action object.
function addEntities(entities) {
* Returns an action object used in signalling that entity records have been received.
* @param {string} kind Kind of the received entity record.
* @param {string} name Name of the received entity record.
* @param {Array|Object} records Records received.
* @param {?Object} query Query Object.
* @param {?boolean} invalidateCache Should invalidate query caches.
* @param {?Object} edits Edits to reset.
* @param {?Object} meta Meta information about pagination.
* @return {Object} Action object.
function receiveEntityRecords(kind, name, records, query, invalidateCache = false, edits, meta) {
// Auto drafts should not have titles, but some plugins rely on them so we can't filter this
if (kind === 'postType') {
records = (Array.isArray(records) ? records : [records]).map(record => record.status === 'auto-draft' ? {
action = receiveQueriedItems(records, query, edits, meta);
action = receiveItems(records, edits, meta);