[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> core-data.js (source)

   1  /******/ (() => { // webpackBootstrap
   2  /******/     "use strict";
   3  /******/     var __webpack_modules__ = ({
   4  
   5  /***/ 6689:
   6  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
   7  
   8  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
   9  /* harmony export */   createUndoManager: () => (/* binding */ createUndoManager)
  10  /* harmony export */ });
  11  /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(923);
  12  /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__);
  13  /**
  14   * WordPress dependencies
  15   */
  16  
  17  
  18  /** @typedef {import('./types').HistoryRecord}  HistoryRecord */
  19  /** @typedef {import('./types').HistoryChange}  HistoryChange */
  20  /** @typedef {import('./types').HistoryChanges} HistoryChanges */
  21  /** @typedef {import('./types').UndoManager} UndoManager */
  22  
  23  /**
  24   * Merge changes for a single item into a record of changes.
  25   *
  26   * @param {Record< string, HistoryChange >} changes1 Previous changes
  27   * @param {Record< string, HistoryChange >} changes2 NextChanges
  28   *
  29   * @return {Record< string, HistoryChange >} Merged changes
  30   */
  31  function mergeHistoryChanges(changes1, changes2) {
  32    /**
  33     * @type {Record< string, HistoryChange >}
  34     */
  35    const newChanges = {
  36      ...changes1
  37    };
  38    Object.entries(changes2).forEach(([key, value]) => {
  39      if (newChanges[key]) {
  40        newChanges[key] = {
  41          ...newChanges[key],
  42          to: value.to
  43        };
  44      } else {
  45        newChanges[key] = value;
  46      }
  47    });
  48    return newChanges;
  49  }
  50  
  51  /**
  52   * Adds history changes for a single item into a record of changes.
  53   *
  54   * @param {HistoryRecord}  record  The record to merge into.
  55   * @param {HistoryChanges} changes The changes to merge.
  56   */
  57  const addHistoryChangesIntoRecord = (record, changes) => {
  58    const existingChangesIndex = record?.findIndex(({
  59      id: recordIdentifier
  60    }) => {
  61      return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(recordIdentifier, changes.id);
  62    });
  63    const nextRecord = [...record];
  64    if (existingChangesIndex !== -1) {
  65      // If the edit is already in the stack leave the initial "from" value.
  66      nextRecord[existingChangesIndex] = {
  67        id: changes.id,
  68        changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes)
  69      };
  70    } else {
  71      nextRecord.push(changes);
  72    }
  73    return nextRecord;
  74  };
  75  
  76  /**
  77   * Creates an undo manager.
  78   *
  79   * @return {UndoManager} Undo manager.
  80   */
  81  function createUndoManager() {
  82    /**
  83     * @type {HistoryRecord[]}
  84     */
  85    let history = [];
  86    /**
  87     * @type {HistoryRecord}
  88     */
  89    let stagedRecord = [];
  90    /**
  91     * @type {number}
  92     */
  93    let offset = 0;
  94    const dropPendingRedos = () => {
  95      history = history.slice(0, offset || undefined);
  96      offset = 0;
  97    };
  98    const appendStagedRecordToLatestHistoryRecord = () => {
  99      var _history$index;
 100      const index = history.length === 0 ? 0 : history.length - 1;
 101      let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : [];
 102      stagedRecord.forEach(changes => {
 103        latestRecord = addHistoryChangesIntoRecord(latestRecord, changes);
 104      });
 105      stagedRecord = [];
 106      history[index] = latestRecord;
 107    };
 108  
 109    /**
 110     * Checks whether a record is empty.
 111     * A record is considered empty if it the changes keep the same values.
 112     * Also updates to function values are ignored.
 113     *
 114     * @param {HistoryRecord} record
 115     * @return {boolean} Whether the record is empty.
 116     */
 117    const isRecordEmpty = record => {
 118      const filteredRecord = record.filter(({
 119        changes
 120      }) => {
 121        return Object.values(changes).some(({
 122          from,
 123          to
 124        }) => typeof from !== 'function' && typeof to !== 'function' && !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(from, to));
 125      });
 126      return !filteredRecord.length;
 127    };
 128    return {
 129      /**
 130       * Record changes into the history.
 131       *
 132       * @param {HistoryRecord=} record   A record of changes to record.
 133       * @param {boolean}        isStaged Whether to immediately create an undo point or not.
 134       */
 135      addRecord(record, isStaged = false) {
 136        const isEmpty = !record || isRecordEmpty(record);
 137        if (isStaged) {
 138          if (isEmpty) {
 139            return;
 140          }
 141          record.forEach(changes => {
 142            stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes);
 143          });
 144        } else {
 145          dropPendingRedos();
 146          if (stagedRecord.length) {
 147            appendStagedRecordToLatestHistoryRecord();
 148          }
 149          if (isEmpty) {
 150            return;
 151          }
 152          history.push(record);
 153        }
 154      },
 155      undo() {
 156        if (stagedRecord.length) {
 157          dropPendingRedos();
 158          appendStagedRecordToLatestHistoryRecord();
 159        }
 160        const undoRecord = history[history.length - 1 + offset];
 161        if (!undoRecord) {
 162          return;
 163        }
 164        offset -= 1;
 165        return undoRecord;
 166      },
 167      redo() {
 168        const redoRecord = history[history.length + offset];
 169        if (!redoRecord) {
 170          return;
 171        }
 172        offset += 1;
 173        return redoRecord;
 174      },
 175      hasUndo() {
 176        return !!history[history.length - 1 + offset];
 177      },
 178      hasRedo() {
 179        return !!history[history.length + offset];
 180      }
 181    };
 182  }
 183  
 184  
 185  /***/ }),
 186  
 187  /***/ 3249:
 188  /***/ ((module) => {
 189  
 190  
 191  
 192  function _typeof(obj) {
 193    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
 194      _typeof = function (obj) {
 195        return typeof obj;
 196      };
 197    } else {
 198      _typeof = function (obj) {
 199        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
 200      };
 201    }
 202  
 203    return _typeof(obj);
 204  }
 205  
 206  function _classCallCheck(instance, Constructor) {
 207    if (!(instance instanceof Constructor)) {
 208      throw new TypeError("Cannot call a class as a function");
 209    }
 210  }
 211  
 212  function _defineProperties(target, props) {
 213    for (var i = 0; i < props.length; i++) {
 214      var descriptor = props[i];
 215      descriptor.enumerable = descriptor.enumerable || false;
 216      descriptor.configurable = true;
 217      if ("value" in descriptor) descriptor.writable = true;
 218      Object.defineProperty(target, descriptor.key, descriptor);
 219    }
 220  }
 221  
 222  function _createClass(Constructor, protoProps, staticProps) {
 223    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 224    if (staticProps) _defineProperties(Constructor, staticProps);
 225    return Constructor;
 226  }
 227  
 228  /**
 229   * Given an instance of EquivalentKeyMap, returns its internal value pair tuple
 230   * for a key, if one exists. The tuple members consist of the last reference
 231   * value for the key (used in efficient subsequent lookups) and the value
 232   * assigned for the key at the leaf node.
 233   *
 234   * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
 235   * @param {*} key                     The key for which to return value pair.
 236   *
 237   * @return {?Array} Value pair, if exists.
 238   */
 239  function getValuePair(instance, key) {
 240    var _map = instance._map,
 241        _arrayTreeMap = instance._arrayTreeMap,
 242        _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
 243    // value, which can be used to shortcut immediately to the value.
 244  
 245    if (_map.has(key)) {
 246      return _map.get(key);
 247    } // Sort keys to ensure stable retrieval from tree.
 248  
 249  
 250    var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
 251  
 252    var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
 253  
 254    for (var i = 0; i < properties.length; i++) {
 255      var property = properties[i];
 256      map = map.get(property);
 257  
 258      if (map === undefined) {
 259        return;
 260      }
 261  
 262      var propertyValue = key[property];
 263      map = map.get(propertyValue);
 264  
 265      if (map === undefined) {
 266        return;
 267      }
 268    }
 269  
 270    var valuePair = map.get('_ekm_value');
 271  
 272    if (!valuePair) {
 273      return;
 274    } // If reached, it implies that an object-like key was set with another
 275    // reference, so delete the reference and replace with the current.
 276  
 277  
 278    _map.delete(valuePair[0]);
 279  
 280    valuePair[0] = key;
 281    map.set('_ekm_value', valuePair);
 282  
 283    _map.set(key, valuePair);
 284  
 285    return valuePair;
 286  }
 287  /**
 288   * Variant of a Map object which enables lookup by equivalent (deeply equal)
 289   * object and array keys.
 290   */
 291  
 292  
 293  var EquivalentKeyMap =
 294  /*#__PURE__*/
 295  function () {
 296    /**
 297     * Constructs a new instance of EquivalentKeyMap.
 298     *
 299     * @param {Iterable.<*>} iterable Initial pair of key, value for map.
 300     */
 301    function EquivalentKeyMap(iterable) {
 302      _classCallCheck(this, EquivalentKeyMap);
 303  
 304      this.clear();
 305  
 306      if (iterable instanceof EquivalentKeyMap) {
 307        // Map#forEach is only means of iterating with support for IE11.
 308        var iterablePairs = [];
 309        iterable.forEach(function (value, key) {
 310          iterablePairs.push([key, value]);
 311        });
 312        iterable = iterablePairs;
 313      }
 314  
 315      if (iterable != null) {
 316        for (var i = 0; i < iterable.length; i++) {
 317          this.set(iterable[i][0], iterable[i][1]);
 318        }
 319      }
 320    }
 321    /**
 322     * Accessor property returning the number of elements.
 323     *
 324     * @return {number} Number of elements.
 325     */
 326  
 327  
 328    _createClass(EquivalentKeyMap, [{
 329      key: "set",
 330  
 331      /**
 332       * Add or update an element with a specified key and value.
 333       *
 334       * @param {*} key   The key of the element to add.
 335       * @param {*} value The value of the element to add.
 336       *
 337       * @return {EquivalentKeyMap} Map instance.
 338       */
 339      value: function set(key, value) {
 340        // Shortcut non-object-like to set on internal Map.
 341        if (key === null || _typeof(key) !== 'object') {
 342          this._map.set(key, value);
 343  
 344          return this;
 345        } // Sort keys to ensure stable assignment into tree.
 346  
 347  
 348        var properties = Object.keys(key).sort();
 349        var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
 350  
 351        var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
 352  
 353        for (var i = 0; i < properties.length; i++) {
 354          var property = properties[i];
 355  
 356          if (!map.has(property)) {
 357            map.set(property, new EquivalentKeyMap());
 358          }
 359  
 360          map = map.get(property);
 361          var propertyValue = key[property];
 362  
 363          if (!map.has(propertyValue)) {
 364            map.set(propertyValue, new EquivalentKeyMap());
 365          }
 366  
 367          map = map.get(propertyValue);
 368        } // If an _ekm_value exists, there was already an equivalent key. Before
 369        // overriding, ensure that the old key reference is removed from map to
 370        // avoid memory leak of accumulating equivalent keys. This is, in a
 371        // sense, a poor man's WeakMap, while still enabling iterability.
 372  
 373  
 374        var previousValuePair = map.get('_ekm_value');
 375  
 376        if (previousValuePair) {
 377          this._map.delete(previousValuePair[0]);
 378        }
 379  
 380        map.set('_ekm_value', valuePair);
 381  
 382        this._map.set(key, valuePair);
 383  
 384        return this;
 385      }
 386      /**
 387       * Returns a specified element.
 388       *
 389       * @param {*} key The key of the element to return.
 390       *
 391       * @return {?*} The element associated with the specified key or undefined
 392       *              if the key can't be found.
 393       */
 394  
 395    }, {
 396      key: "get",
 397      value: function get(key) {
 398        // Shortcut non-object-like to get from internal Map.
 399        if (key === null || _typeof(key) !== 'object') {
 400          return this._map.get(key);
 401        }
 402  
 403        var valuePair = getValuePair(this, key);
 404  
 405        if (valuePair) {
 406          return valuePair[1];
 407        }
 408      }
 409      /**
 410       * Returns a boolean indicating whether an element with the specified key
 411       * exists or not.
 412       *
 413       * @param {*} key The key of the element to test for presence.
 414       *
 415       * @return {boolean} Whether an element with the specified key exists.
 416       */
 417  
 418    }, {
 419      key: "has",
 420      value: function has(key) {
 421        if (key === null || _typeof(key) !== 'object') {
 422          return this._map.has(key);
 423        } // Test on the _presence_ of the pair, not its value, as even undefined
 424        // can be a valid member value for a key.
 425  
 426  
 427        return getValuePair(this, key) !== undefined;
 428      }
 429      /**
 430       * Removes the specified element.
 431       *
 432       * @param {*} key The key of the element to remove.
 433       *
 434       * @return {boolean} Returns true if an element existed and has been
 435       *                   removed, or false if the element does not exist.
 436       */
 437  
 438    }, {
 439      key: "delete",
 440      value: function _delete(key) {
 441        if (!this.has(key)) {
 442          return false;
 443        } // This naive implementation will leave orphaned child trees. A better
 444        // implementation should traverse and remove orphans.
 445  
 446  
 447        this.set(key, undefined);
 448        return true;
 449      }
 450      /**
 451       * Executes a provided function once per each key/value pair, in insertion
 452       * order.
 453       *
 454       * @param {Function} callback Function to execute for each element.
 455       * @param {*}        thisArg  Value to use as `this` when executing
 456       *                            `callback`.
 457       */
 458  
 459    }, {
 460      key: "forEach",
 461      value: function forEach(callback) {
 462        var _this = this;
 463  
 464        var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
 465  
 466        this._map.forEach(function (value, key) {
 467          // Unwrap value from object-like value pair.
 468          if (key !== null && _typeof(key) === 'object') {
 469            value = value[1];
 470          }
 471  
 472          callback.call(thisArg, value, key, _this);
 473        });
 474      }
 475      /**
 476       * Removes all elements.
 477       */
 478  
 479    }, {
 480      key: "clear",
 481      value: function clear() {
 482        this._map = new Map();
 483        this._arrayTreeMap = new Map();
 484        this._objectTreeMap = new Map();
 485      }
 486    }, {
 487      key: "size",
 488      get: function get() {
 489        return this._map.size;
 490      }
 491    }]);
 492  
 493    return EquivalentKeyMap;
 494  }();
 495  
 496  module.exports = EquivalentKeyMap;
 497  
 498  
 499  /***/ }),
 500  
 501  /***/ 7734:
 502  /***/ ((module) => {
 503  
 504  
 505  
 506  // do not edit .js files directly - edit src/index.jst
 507  
 508  
 509    var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
 510  
 511  
 512  module.exports = function equal(a, b) {
 513    if (a === b) return true;
 514  
 515    if (a && b && typeof a == 'object' && typeof b == 'object') {
 516      if (a.constructor !== b.constructor) return false;
 517  
 518      var length, i, keys;
 519      if (Array.isArray(a)) {
 520        length = a.length;
 521        if (length != b.length) return false;
 522        for (i = length; i-- !== 0;)
 523          if (!equal(a[i], b[i])) return false;
 524        return true;
 525      }
 526  
 527  
 528      if ((a instanceof Map) && (b instanceof Map)) {
 529        if (a.size !== b.size) return false;
 530        for (i of a.entries())
 531          if (!b.has(i[0])) return false;
 532        for (i of a.entries())
 533          if (!equal(i[1], b.get(i[0]))) return false;
 534        return true;
 535      }
 536  
 537      if ((a instanceof Set) && (b instanceof Set)) {
 538        if (a.size !== b.size) return false;
 539        for (i of a.entries())
 540          if (!b.has(i[0])) return false;
 541        return true;
 542      }
 543  
 544      if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
 545        length = a.length;
 546        if (length != b.length) return false;
 547        for (i = length; i-- !== 0;)
 548          if (a[i] !== b[i]) return false;
 549        return true;
 550      }
 551  
 552  
 553      if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
 554      if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
 555      if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
 556  
 557      keys = Object.keys(a);
 558      length = keys.length;
 559      if (length !== Object.keys(b).length) return false;
 560  
 561      for (i = length; i-- !== 0;)
 562        if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
 563  
 564      for (i = length; i-- !== 0;) {
 565        var key = keys[i];
 566  
 567        if (!equal(a[key], b[key])) return false;
 568      }
 569  
 570      return true;
 571    }
 572  
 573    // true if both NaN, false otherwise
 574    return a!==a && b!==b;
 575  };
 576  
 577  
 578  /***/ }),
 579  
 580  /***/ 923:
 581  /***/ ((module) => {
 582  
 583  module.exports = window["wp"]["isShallowEqual"];
 584  
 585  /***/ })
 586  
 587  /******/     });
 588  /************************************************************************/
 589  /******/     // The module cache
 590  /******/     var __webpack_module_cache__ = {};
 591  /******/     
 592  /******/     // The require function
 593  /******/ 	function __webpack_require__(moduleId) {
 594  /******/         // Check if module is in cache
 595  /******/         var cachedModule = __webpack_module_cache__[moduleId];
 596  /******/         if (cachedModule !== undefined) {
 597  /******/             return cachedModule.exports;
 598  /******/         }
 599  /******/         // Create a new module (and put it into the cache)
 600  /******/         var module = __webpack_module_cache__[moduleId] = {
 601  /******/             // no module.id needed
 602  /******/             // no module.loaded needed
 603  /******/             exports: {}
 604  /******/         };
 605  /******/     
 606  /******/         // Execute the module function
 607  /******/         __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
 608  /******/     
 609  /******/         // Return the exports of the module
 610  /******/         return module.exports;
 611  /******/     }
 612  /******/     
 613  /************************************************************************/
 614  /******/     /* webpack/runtime/compat get default export */
 615  /******/     (() => {
 616  /******/         // getDefaultExport function for compatibility with non-harmony modules
 617  /******/         __webpack_require__.n = (module) => {
 618  /******/             var getter = module && module.__esModule ?
 619  /******/                 () => (module['default']) :
 620  /******/                 () => (module);
 621  /******/             __webpack_require__.d(getter, { a: getter });
 622  /******/             return getter;
 623  /******/         };
 624  /******/     })();
 625  /******/     
 626  /******/     /* webpack/runtime/define property getters */
 627  /******/     (() => {
 628  /******/         // define getter functions for harmony exports
 629  /******/         __webpack_require__.d = (exports, definition) => {
 630  /******/             for(var key in definition) {
 631  /******/                 if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
 632  /******/                     Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
 633  /******/                 }
 634  /******/             }
 635  /******/         };
 636  /******/     })();
 637  /******/     
 638  /******/     /* webpack/runtime/hasOwnProperty shorthand */
 639  /******/     (() => {
 640  /******/         __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
 641  /******/     })();
 642  /******/     
 643  /******/     /* webpack/runtime/make namespace object */
 644  /******/     (() => {
 645  /******/         // define __esModule on exports
 646  /******/         __webpack_require__.r = (exports) => {
 647  /******/             if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
 648  /******/                 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
 649  /******/             }
 650  /******/             Object.defineProperty(exports, '__esModule', { value: true });
 651  /******/         };
 652  /******/     })();
 653  /******/     
 654  /************************************************************************/
 655  var __webpack_exports__ = {};
 656  // ESM COMPAT FLAG
 657  __webpack_require__.r(__webpack_exports__);
 658  
 659  // EXPORTS
 660  __webpack_require__.d(__webpack_exports__, {
 661    EntityProvider: () => (/* reexport */ EntityProvider),
 662    __experimentalFetchLinkSuggestions: () => (/* reexport */ fetchLinkSuggestions),
 663    __experimentalFetchUrlData: () => (/* reexport */ _experimental_fetch_url_data),
 664    __experimentalUseEntityRecord: () => (/* reexport */ __experimentalUseEntityRecord),
 665    __experimentalUseEntityRecords: () => (/* reexport */ __experimentalUseEntityRecords),
 666    __experimentalUseResourcePermissions: () => (/* reexport */ __experimentalUseResourcePermissions),
 667    fetchBlockPatterns: () => (/* reexport */ fetchBlockPatterns),
 668    privateApis: () => (/* reexport */ privateApis),
 669    store: () => (/* binding */ store),
 670    useEntityBlockEditor: () => (/* reexport */ useEntityBlockEditor),
 671    useEntityId: () => (/* reexport */ useEntityId),
 672    useEntityProp: () => (/* reexport */ useEntityProp),
 673    useEntityRecord: () => (/* reexport */ useEntityRecord),
 674    useEntityRecords: () => (/* reexport */ useEntityRecords),
 675    useResourcePermissions: () => (/* reexport */ use_resource_permissions)
 676  });
 677  
 678  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/actions.js
 679  var build_module_actions_namespaceObject = {};
 680  __webpack_require__.r(build_module_actions_namespaceObject);
 681  __webpack_require__.d(build_module_actions_namespaceObject, {
 682    __experimentalBatch: () => (__experimentalBatch),
 683    __experimentalReceiveCurrentGlobalStylesId: () => (__experimentalReceiveCurrentGlobalStylesId),
 684    __experimentalReceiveThemeBaseGlobalStyles: () => (__experimentalReceiveThemeBaseGlobalStyles),
 685    __experimentalReceiveThemeGlobalStyleVariations: () => (__experimentalReceiveThemeGlobalStyleVariations),
 686    __experimentalSaveSpecifiedEntityEdits: () => (__experimentalSaveSpecifiedEntityEdits),
 687    __unstableCreateUndoLevel: () => (__unstableCreateUndoLevel),
 688    addEntities: () => (addEntities),
 689    deleteEntityRecord: () => (deleteEntityRecord),
 690    editEntityRecord: () => (editEntityRecord),
 691    receiveAutosaves: () => (receiveAutosaves),
 692    receiveCurrentTheme: () => (receiveCurrentTheme),
 693    receiveCurrentUser: () => (receiveCurrentUser),
 694    receiveDefaultTemplateId: () => (receiveDefaultTemplateId),
 695    receiveEmbedPreview: () => (receiveEmbedPreview),
 696    receiveEntityRecords: () => (receiveEntityRecords),
 697    receiveNavigationFallbackId: () => (receiveNavigationFallbackId),
 698    receiveRevisions: () => (receiveRevisions),
 699    receiveThemeGlobalStyleRevisions: () => (receiveThemeGlobalStyleRevisions),
 700    receiveThemeSupports: () => (receiveThemeSupports),
 701    receiveUploadPermissions: () => (receiveUploadPermissions),
 702    receiveUserPermission: () => (receiveUserPermission),
 703    receiveUserPermissions: () => (receiveUserPermissions),
 704    receiveUserQuery: () => (receiveUserQuery),
 705    redo: () => (redo),
 706    saveEditedEntityRecord: () => (saveEditedEntityRecord),
 707    saveEntityRecord: () => (saveEntityRecord),
 708    undo: () => (undo)
 709  });
 710  
 711  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/selectors.js
 712  var build_module_selectors_namespaceObject = {};
 713  __webpack_require__.r(build_module_selectors_namespaceObject);
 714  __webpack_require__.d(build_module_selectors_namespaceObject, {
 715    __experimentalGetCurrentGlobalStylesId: () => (__experimentalGetCurrentGlobalStylesId),
 716    __experimentalGetCurrentThemeBaseGlobalStyles: () => (__experimentalGetCurrentThemeBaseGlobalStyles),
 717    __experimentalGetCurrentThemeGlobalStylesVariations: () => (__experimentalGetCurrentThemeGlobalStylesVariations),
 718    __experimentalGetDirtyEntityRecords: () => (__experimentalGetDirtyEntityRecords),
 719    __experimentalGetEntitiesBeingSaved: () => (__experimentalGetEntitiesBeingSaved),
 720    __experimentalGetEntityRecordNoResolver: () => (__experimentalGetEntityRecordNoResolver),
 721    __experimentalGetTemplateForLink: () => (__experimentalGetTemplateForLink),
 722    canUser: () => (canUser),
 723    canUserEditEntityRecord: () => (canUserEditEntityRecord),
 724    getAuthors: () => (getAuthors),
 725    getAutosave: () => (getAutosave),
 726    getAutosaves: () => (getAutosaves),
 727    getBlockPatternCategories: () => (getBlockPatternCategories),
 728    getBlockPatterns: () => (getBlockPatterns),
 729    getCurrentTheme: () => (getCurrentTheme),
 730    getCurrentThemeGlobalStylesRevisions: () => (getCurrentThemeGlobalStylesRevisions),
 731    getCurrentUser: () => (getCurrentUser),
 732    getDefaultTemplateId: () => (getDefaultTemplateId),
 733    getEditedEntityRecord: () => (getEditedEntityRecord),
 734    getEmbedPreview: () => (getEmbedPreview),
 735    getEntitiesByKind: () => (getEntitiesByKind),
 736    getEntitiesConfig: () => (getEntitiesConfig),
 737    getEntity: () => (getEntity),
 738    getEntityConfig: () => (getEntityConfig),
 739    getEntityRecord: () => (getEntityRecord),
 740    getEntityRecordEdits: () => (getEntityRecordEdits),
 741    getEntityRecordNonTransientEdits: () => (getEntityRecordNonTransientEdits),
 742    getEntityRecords: () => (getEntityRecords),
 743    getEntityRecordsTotalItems: () => (getEntityRecordsTotalItems),
 744    getEntityRecordsTotalPages: () => (getEntityRecordsTotalPages),
 745    getLastEntityDeleteError: () => (getLastEntityDeleteError),
 746    getLastEntitySaveError: () => (getLastEntitySaveError),
 747    getRawEntityRecord: () => (getRawEntityRecord),
 748    getRedoEdit: () => (getRedoEdit),
 749    getReferenceByDistinctEdits: () => (getReferenceByDistinctEdits),
 750    getRevision: () => (getRevision),
 751    getRevisions: () => (getRevisions),
 752    getThemeSupports: () => (getThemeSupports),
 753    getUndoEdit: () => (getUndoEdit),
 754    getUserPatternCategories: () => (getUserPatternCategories),
 755    getUserQueryResults: () => (getUserQueryResults),
 756    hasEditsForEntityRecord: () => (hasEditsForEntityRecord),
 757    hasEntityRecords: () => (hasEntityRecords),
 758    hasFetchedAutosaves: () => (hasFetchedAutosaves),
 759    hasRedo: () => (hasRedo),
 760    hasUndo: () => (hasUndo),
 761    isAutosavingEntityRecord: () => (isAutosavingEntityRecord),
 762    isDeletingEntityRecord: () => (isDeletingEntityRecord),
 763    isPreviewEmbedFallback: () => (isPreviewEmbedFallback),
 764    isRequestingEmbedPreview: () => (isRequestingEmbedPreview),
 765    isSavingEntityRecord: () => (isSavingEntityRecord)
 766  });
 767  
 768  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/private-selectors.js
 769  var private_selectors_namespaceObject = {};
 770  __webpack_require__.r(private_selectors_namespaceObject);
 771  __webpack_require__.d(private_selectors_namespaceObject, {
 772    getBlockPatternsForPostType: () => (getBlockPatternsForPostType),
 773    getEntityRecordPermissions: () => (getEntityRecordPermissions),
 774    getEntityRecordsPermissions: () => (getEntityRecordsPermissions),
 775    getNavigationFallbackId: () => (getNavigationFallbackId),
 776    getRegisteredPostMeta: () => (getRegisteredPostMeta),
 777    getUndoManager: () => (getUndoManager)
 778  });
 779  
 780  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/private-actions.js
 781  var private_actions_namespaceObject = {};
 782  __webpack_require__.r(private_actions_namespaceObject);
 783  __webpack_require__.d(private_actions_namespaceObject, {
 784    receiveRegisteredPostMeta: () => (receiveRegisteredPostMeta)
 785  });
 786  
 787  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/resolvers.js
 788  var resolvers_namespaceObject = {};
 789  __webpack_require__.r(resolvers_namespaceObject);
 790  __webpack_require__.d(resolvers_namespaceObject, {
 791    __experimentalGetCurrentGlobalStylesId: () => (resolvers_experimentalGetCurrentGlobalStylesId),
 792    __experimentalGetCurrentThemeBaseGlobalStyles: () => (resolvers_experimentalGetCurrentThemeBaseGlobalStyles),
 793    __experimentalGetCurrentThemeGlobalStylesVariations: () => (resolvers_experimentalGetCurrentThemeGlobalStylesVariations),
 794    __experimentalGetTemplateForLink: () => (resolvers_experimentalGetTemplateForLink),
 795    canUser: () => (resolvers_canUser),
 796    canUserEditEntityRecord: () => (resolvers_canUserEditEntityRecord),
 797    getAuthors: () => (resolvers_getAuthors),
 798    getAutosave: () => (resolvers_getAutosave),
 799    getAutosaves: () => (resolvers_getAutosaves),
 800    getBlockPatternCategories: () => (resolvers_getBlockPatternCategories),
 801    getBlockPatterns: () => (resolvers_getBlockPatterns),
 802    getCurrentTheme: () => (resolvers_getCurrentTheme),
 803    getCurrentThemeGlobalStylesRevisions: () => (resolvers_getCurrentThemeGlobalStylesRevisions),
 804    getCurrentUser: () => (resolvers_getCurrentUser),
 805    getDefaultTemplateId: () => (resolvers_getDefaultTemplateId),
 806    getEditedEntityRecord: () => (resolvers_getEditedEntityRecord),
 807    getEmbedPreview: () => (resolvers_getEmbedPreview),
 808    getEntityRecord: () => (resolvers_getEntityRecord),
 809    getEntityRecords: () => (resolvers_getEntityRecords),
 810    getNavigationFallbackId: () => (resolvers_getNavigationFallbackId),
 811    getRawEntityRecord: () => (resolvers_getRawEntityRecord),
 812    getRegisteredPostMeta: () => (resolvers_getRegisteredPostMeta),
 813    getRevision: () => (resolvers_getRevision),
 814    getRevisions: () => (resolvers_getRevisions),
 815    getThemeSupports: () => (resolvers_getThemeSupports),
 816    getUserPatternCategories: () => (resolvers_getUserPatternCategories)
 817  });
 818  
 819  ;// external ["wp","data"]
 820  const external_wp_data_namespaceObject = window["wp"]["data"];
 821  // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
 822  var es6 = __webpack_require__(7734);
 823  var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
 824  ;// external ["wp","compose"]
 825  const external_wp_compose_namespaceObject = window["wp"]["compose"];
 826  // EXTERNAL MODULE: ./node_modules/@wordpress/undo-manager/build-module/index.js
 827  var build_module = __webpack_require__(6689);
 828  ;// ./node_modules/@wordpress/core-data/build-module/utils/if-matching-action.js
 829  /** @typedef {import('../types').AnyFunction} AnyFunction */
 830  
 831  /**
 832   * A higher-order reducer creator which invokes the original reducer only if
 833   * the dispatching action matches the given predicate, **OR** if state is
 834   * initializing (undefined).
 835   *
 836   * @param {AnyFunction} isMatch Function predicate for allowing reducer call.
 837   *
 838   * @return {AnyFunction} Higher-order reducer.
 839   */
 840  const ifMatchingAction = isMatch => reducer => (state, action) => {
 841    if (state === undefined || isMatch(action)) {
 842      return reducer(state, action);
 843    }
 844    return state;
 845  };
 846  /* harmony default export */ const if_matching_action = (ifMatchingAction);
 847  
 848  ;// ./node_modules/@wordpress/core-data/build-module/utils/replace-action.js
 849  /** @typedef {import('../types').AnyFunction} AnyFunction */
 850  
 851  /**
 852   * Higher-order reducer creator which substitutes the action object before
 853   * passing to the original reducer.
 854   *
 855   * @param {AnyFunction} replacer Function mapping original action to replacement.
 856   *
 857   * @return {AnyFunction} Higher-order reducer.
 858   */
 859  const replaceAction = replacer => reducer => (state, action) => {
 860    return reducer(state, replacer(action));
 861  };
 862  /* harmony default export */ const replace_action = (replaceAction);
 863  
 864  ;// ./node_modules/@wordpress/core-data/build-module/utils/conservative-map-item.js
 865  /**
 866   * External dependencies
 867   */
 868  
 869  
 870  /**
 871   * Given the current and next item entity record, returns the minimally "modified"
 872   * result of the next item, preferring value references from the original item
 873   * if equal. If all values match, the original item is returned.
 874   *
 875   * @param {Object} item     Original item.
 876   * @param {Object} nextItem Next item.
 877   *
 878   * @return {Object} Minimally modified merged item.
 879   */
 880  function conservativeMapItem(item, nextItem) {
 881    // Return next item in its entirety if there is no original item.
 882    if (!item) {
 883      return nextItem;
 884    }
 885    let hasChanges = false;
 886    const result = {};
 887    for (const key in nextItem) {
 888      if (es6_default()(item[key], nextItem[key])) {
 889        result[key] = item[key];
 890      } else {
 891        hasChanges = true;
 892        result[key] = nextItem[key];
 893      }
 894    }
 895    if (!hasChanges) {
 896      return item;
 897    }
 898  
 899    // Only at this point, backfill properties from the original item which
 900    // weren't explicitly set into the result above. This is an optimization
 901    // to allow `hasChanges` to return early.
 902    for (const key in item) {
 903      if (!result.hasOwnProperty(key)) {
 904        result[key] = item[key];
 905      }
 906    }
 907    return result;
 908  }
 909  
 910  ;// ./node_modules/@wordpress/core-data/build-module/utils/on-sub-key.js
 911  /** @typedef {import('../types').AnyFunction} AnyFunction */
 912  
 913  /**
 914   * Higher-order reducer creator which creates a combined reducer object, keyed
 915   * by a property on the action object.
 916   *
 917   * @param {string} actionProperty Action property by which to key object.
 918   *
 919   * @return {AnyFunction} Higher-order reducer.
 920   */
 921  const onSubKey = actionProperty => reducer => (state = {}, action) => {
 922    // Retrieve subkey from action. Do not track if undefined; useful for cases
 923    // where reducer is scoped by action shape.
 924    const key = action[actionProperty];
 925    if (key === undefined) {
 926      return state;
 927    }
 928  
 929    // Avoid updating state if unchanged. Note that this also accounts for a
 930    // reducer which returns undefined on a key which is not yet tracked.
 931    const nextKeyState = reducer(state[key], action);
 932    if (nextKeyState === state[key]) {
 933      return state;
 934    }
 935    return {
 936      ...state,
 937      [key]: nextKeyState
 938    };
 939  };
 940  /* harmony default export */ const on_sub_key = (onSubKey);
 941  
 942  ;// ./node_modules/tslib/tslib.es6.mjs
 943  /******************************************************************************
 944  Copyright (c) Microsoft Corporation.
 945  
 946  Permission to use, copy, modify, and/or distribute this software for any
 947  purpose with or without fee is hereby granted.
 948  
 949  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 950  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 951  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
 952  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 953  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
 954  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 955  PERFORMANCE OF THIS SOFTWARE.
 956  ***************************************************************************** */
 957  /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
 958  
 959  var extendStatics = function(d, b) {
 960    extendStatics = Object.setPrototypeOf ||
 961        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
 962        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
 963    return extendStatics(d, b);
 964  };
 965  
 966  function __extends(d, b) {
 967    if (typeof b !== "function" && b !== null)
 968        throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
 969    extendStatics(d, b);
 970    function __() { this.constructor = d; }
 971    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
 972  }
 973  
 974  var __assign = function() {
 975    __assign = Object.assign || function __assign(t) {
 976        for (var s, i = 1, n = arguments.length; i < n; i++) {
 977            s = arguments[i];
 978            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
 979        }
 980        return t;
 981    }
 982    return __assign.apply(this, arguments);
 983  }
 984  
 985  function __rest(s, e) {
 986    var t = {};
 987    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
 988        t[p] = s[p];
 989    if (s != null && typeof Object.getOwnPropertySymbols === "function")
 990        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
 991            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
 992                t[p[i]] = s[p[i]];
 993        }
 994    return t;
 995  }
 996  
 997  function __decorate(decorators, target, key, desc) {
 998    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
 999    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1000    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1001    return c > 3 && r && Object.defineProperty(target, key, r), r;
1002  }
1003  
1004  function __param(paramIndex, decorator) {
1005    return function (target, key) { decorator(target, key, paramIndex); }
1006  }
1007  
1008  function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
1009    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
1010    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
1011    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
1012    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
1013    var _, done = false;
1014    for (var i = decorators.length - 1; i >= 0; i--) {
1015        var context = {};
1016        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
1017        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
1018        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
1019        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
1020        if (kind === "accessor") {
1021            if (result === void 0) continue;
1022            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
1023            if (_ = accept(result.get)) descriptor.get = _;
1024            if (_ = accept(result.set)) descriptor.set = _;
1025            if (_ = accept(result.init)) initializers.unshift(_);
1026        }
1027        else if (_ = accept(result)) {
1028            if (kind === "field") initializers.unshift(_);
1029            else descriptor[key] = _;
1030        }
1031    }
1032    if (target) Object.defineProperty(target, contextIn.name, descriptor);
1033    done = true;
1034  };
1035  
1036  function __runInitializers(thisArg, initializers, value) {
1037    var useValue = arguments.length > 2;
1038    for (var i = 0; i < initializers.length; i++) {
1039        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
1040    }
1041    return useValue ? value : void 0;
1042  };
1043  
1044  function __propKey(x) {
1045    return typeof x === "symbol" ? x : "".concat(x);
1046  };
1047  
1048  function __setFunctionName(f, name, prefix) {
1049    if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
1050    return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
1051  };
1052  
1053  function __metadata(metadataKey, metadataValue) {
1054    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
1055  }
1056  
1057  function __awaiter(thisArg, _arguments, P, generator) {
1058    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1059    return new (P || (P = Promise))(function (resolve, reject) {
1060        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1061        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1062        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1063        step((generator = generator.apply(thisArg, _arguments || [])).next());
1064    });
1065  }
1066  
1067  function __generator(thisArg, body) {
1068    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
1069    return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1070    function verb(n) { return function (v) { return step([n, v]); }; }
1071    function step(op) {
1072        if (f) throw new TypeError("Generator is already executing.");
1073        while (g && (g = 0, op[0] && (_ = 0)), _) try {
1074            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1075            if (y = 0, t) op = [op[0] & 2, t.value];
1076            switch (op[0]) {
1077                case 0: case 1: t = op; break;
1078                case 4: _.label++; return { value: op[1], done: false };
1079                case 5: _.label++; y = op[1]; op = [0]; continue;
1080                case 7: op = _.ops.pop(); _.trys.pop(); continue;
1081                default:
1082                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1083                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1084                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1085                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1086                    if (t[2]) _.ops.pop();
1087                    _.trys.pop(); continue;
1088            }
1089            op = body.call(thisArg, _);
1090        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1091        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1092    }
1093  }
1094  
1095  var __createBinding = Object.create ? (function(o, m, k, k2) {
1096    if (k2 === undefined) k2 = k;
1097    var desc = Object.getOwnPropertyDescriptor(m, k);
1098    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1099        desc = { enumerable: true, get: function() { return m[k]; } };
1100    }
1101    Object.defineProperty(o, k2, desc);
1102  }) : (function(o, m, k, k2) {
1103    if (k2 === undefined) k2 = k;
1104    o[k2] = m[k];
1105  });
1106  
1107  function __exportStar(m, o) {
1108    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
1109  }
1110  
1111  function __values(o) {
1112    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1113    if (m) return m.call(o);
1114    if (o && typeof o.length === "number") return {
1115        next: function () {
1116            if (o && i >= o.length) o = void 0;
1117            return { value: o && o[i++], done: !o };
1118        }
1119    };
1120    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1121  }
1122  
1123  function __read(o, n) {
1124    var m = typeof Symbol === "function" && o[Symbol.iterator];
1125    if (!m) return o;
1126    var i = m.call(o), r, ar = [], e;
1127    try {
1128        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
1129    }
1130    catch (error) { e = { error: error }; }
1131    finally {
1132        try {
1133            if (r && !r.done && (m = i["return"])) m.call(i);
1134        }
1135        finally { if (e) throw e.error; }
1136    }
1137    return ar;
1138  }
1139  
1140  /** @deprecated */
1141  function __spread() {
1142    for (var ar = [], i = 0; i < arguments.length; i++)
1143        ar = ar.concat(__read(arguments[i]));
1144    return ar;
1145  }
1146  
1147  /** @deprecated */
1148  function __spreadArrays() {
1149    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
1150    for (var r = Array(s), k = 0, i = 0; i < il; i++)
1151        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1152            r[k] = a[j];
1153    return r;
1154  }
1155  
1156  function __spreadArray(to, from, pack) {
1157    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
1158        if (ar || !(i in from)) {
1159            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
1160            ar[i] = from[i];
1161        }
1162    }
1163    return to.concat(ar || Array.prototype.slice.call(from));
1164  }
1165  
1166  function __await(v) {
1167    return this instanceof __await ? (this.v = v, this) : new __await(v);
1168  }
1169  
1170  function __asyncGenerator(thisArg, _arguments, generator) {
1171    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1172    var g = generator.apply(thisArg, _arguments || []), i, q = [];
1173    return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
1174    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
1175    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
1176    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
1177    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1178    function fulfill(value) { resume("next", value); }
1179    function reject(value) { resume("throw", value); }
1180    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
1181  }
1182  
1183  function __asyncDelegator(o) {
1184    var i, p;
1185    return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1186    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
1187  }
1188  
1189  function __asyncValues(o) {
1190    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1191    var m = o[Symbol.asyncIterator], i;
1192    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1193    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1194    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
1195  }
1196  
1197  function __makeTemplateObject(cooked, raw) {
1198    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
1199    return cooked;
1200  };
1201  
1202  var __setModuleDefault = Object.create ? (function(o, v) {
1203    Object.defineProperty(o, "default", { enumerable: true, value: v });
1204  }) : function(o, v) {
1205    o["default"] = v;
1206  };
1207  
1208  function __importStar(mod) {
1209    if (mod && mod.__esModule) return mod;
1210    var result = {};
1211    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1212    __setModuleDefault(result, mod);
1213    return result;
1214  }
1215  
1216  function __importDefault(mod) {
1217    return (mod && mod.__esModule) ? mod : { default: mod };
1218  }
1219  
1220  function __classPrivateFieldGet(receiver, state, kind, f) {
1221    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
1222    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1223    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1224  }
1225  
1226  function __classPrivateFieldSet(receiver, state, value, kind, f) {
1227    if (kind === "m") throw new TypeError("Private method is not writable");
1228    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
1229    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1230    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1231  }
1232  
1233  function __classPrivateFieldIn(state, receiver) {
1234    if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
1235    return typeof state === "function" ? receiver === state : state.has(receiver);
1236  }
1237  
1238  function __addDisposableResource(env, value, async) {
1239    if (value !== null && value !== void 0) {
1240      if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
1241      var dispose, inner;
1242      if (async) {
1243        if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
1244        dispose = value[Symbol.asyncDispose];
1245      }
1246      if (dispose === void 0) {
1247        if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
1248        dispose = value[Symbol.dispose];
1249        if (async) inner = dispose;
1250      }
1251      if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
1252      if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
1253      env.stack.push({ value: value, dispose: dispose, async: async });
1254    }
1255    else if (async) {
1256      env.stack.push({ async: true });
1257    }
1258    return value;
1259  }
1260  
1261  var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
1262    var e = new Error(message);
1263    return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1264  };
1265  
1266  function __disposeResources(env) {
1267    function fail(e) {
1268      env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
1269      env.hasError = true;
1270    }
1271    var r, s = 0;
1272    function next() {
1273      while (r = env.stack.pop()) {
1274        try {
1275          if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
1276          if (r.dispose) {
1277            var result = r.dispose.call(r.value);
1278            if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
1279          }
1280          else s |= 1;
1281        }
1282        catch (e) {
1283          fail(e);
1284        }
1285      }
1286      if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
1287      if (env.hasError) throw env.error;
1288    }
1289    return next();
1290  }
1291  
1292  /* harmony default export */ const tslib_es6 = ({
1293    __extends,
1294    __assign,
1295    __rest,
1296    __decorate,
1297    __param,
1298    __metadata,
1299    __awaiter,
1300    __generator,
1301    __createBinding,
1302    __exportStar,
1303    __values,
1304    __read,
1305    __spread,
1306    __spreadArrays,
1307    __spreadArray,
1308    __await,
1309    __asyncGenerator,
1310    __asyncDelegator,
1311    __asyncValues,
1312    __makeTemplateObject,
1313    __importStar,
1314    __importDefault,
1315    __classPrivateFieldGet,
1316    __classPrivateFieldSet,
1317    __classPrivateFieldIn,
1318    __addDisposableResource,
1319    __disposeResources,
1320  });
1321  
1322  ;// ./node_modules/lower-case/dist.es2015/index.js
1323  /**
1324   * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
1325   */
1326  var SUPPORTED_LOCALE = {
1327      tr: {
1328          regexp: /\u0130|\u0049|\u0049\u0307/g,
1329          map: {
1330              İ: "\u0069",
1331              I: "\u0131",
1332              İ: "\u0069",
1333          },
1334      },
1335      az: {
1336          regexp: /\u0130/g,
1337          map: {
1338              İ: "\u0069",
1339              I: "\u0131",
1340              İ: "\u0069",
1341          },
1342      },
1343      lt: {
1344          regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
1345          map: {
1346              I: "\u0069\u0307",
1347              J: "\u006A\u0307",
1348              Į: "\u012F\u0307",
1349              Ì: "\u0069\u0307\u0300",
1350              Í: "\u0069\u0307\u0301",
1351              Ĩ: "\u0069\u0307\u0303",
1352          },
1353      },
1354  };
1355  /**
1356   * Localized lower case.
1357   */
1358  function localeLowerCase(str, locale) {
1359      var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
1360      if (lang)
1361          return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
1362      return lowerCase(str);
1363  }
1364  /**
1365   * Lower case as a function.
1366   */
1367  function lowerCase(str) {
1368      return str.toLowerCase();
1369  }
1370  
1371  ;// ./node_modules/no-case/dist.es2015/index.js
1372  
1373  // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
1374  var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
1375  // Remove all non-word characters.
1376  var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
1377  /**
1378   * Normalize the string into something other libraries can manipulate easier.
1379   */
1380  function noCase(input, options) {
1381      if (options === void 0) { options = {}; }
1382      var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
1383      var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
1384      var start = 0;
1385      var end = result.length;
1386      // Trim the delimiter from around the output string.
1387      while (result.charAt(start) === "\0")
1388          start++;
1389      while (result.charAt(end - 1) === "\0")
1390          end--;
1391      // Transform each token independently.
1392      return result.slice(start, end).split("\0").map(transform).join(delimiter);
1393  }
1394  /**
1395   * Replace `re` in the input string with the replacement value.
1396   */
1397  function replace(input, re, value) {
1398      if (re instanceof RegExp)
1399          return input.replace(re, value);
1400      return re.reduce(function (input, re) { return input.replace(re, value); }, input);
1401  }
1402  
1403  ;// ./node_modules/upper-case-first/dist.es2015/index.js
1404  /**
1405   * Upper case the first character of an input string.
1406   */
1407  function upperCaseFirst(input) {
1408      return input.charAt(0).toUpperCase() + input.substr(1);
1409  }
1410  
1411  ;// ./node_modules/capital-case/dist.es2015/index.js
1412  
1413  
1414  
1415  function capitalCaseTransform(input) {
1416      return upperCaseFirst(input.toLowerCase());
1417  }
1418  function capitalCase(input, options) {
1419      if (options === void 0) { options = {}; }
1420      return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options));
1421  }
1422  
1423  ;// ./node_modules/pascal-case/dist.es2015/index.js
1424  
1425  
1426  function pascalCaseTransform(input, index) {
1427      var firstChar = input.charAt(0);
1428      var lowerChars = input.substr(1).toLowerCase();
1429      if (index > 0 && firstChar >= "0" && firstChar <= "9") {
1430          return "_" + firstChar + lowerChars;
1431      }
1432      return "" + firstChar.toUpperCase() + lowerChars;
1433  }
1434  function dist_es2015_pascalCaseTransformMerge(input) {
1435      return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
1436  }
1437  function pascalCase(input, options) {
1438      if (options === void 0) { options = {}; }
1439      return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
1440  }
1441  
1442  ;// external ["wp","apiFetch"]
1443  const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
1444  var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
1445  ;// external ["wp","i18n"]
1446  const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
1447  ;// external ["wp","richText"]
1448  const external_wp_richText_namespaceObject = window["wp"]["richText"];
1449  ;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/native.js
1450  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1451  /* harmony default export */ const esm_browser_native = ({
1452    randomUUID
1453  });
1454  ;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/rng.js
1455  // Unique ID creation requires a high quality random # generator. In the browser we therefore
1456  // require the crypto API and do not support built-in fallback to lower quality random number
1457  // generators (like Math.random()).
1458  let getRandomValues;
1459  const rnds8 = new Uint8Array(16);
1460  function rng() {
1461    // lazy load so that environments that need to polyfill have a chance to do so
1462    if (!getRandomValues) {
1463      // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
1464      getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
1465  
1466      if (!getRandomValues) {
1467        throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1468      }
1469    }
1470  
1471    return getRandomValues(rnds8);
1472  }
1473  ;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/stringify.js
1474  
1475  /**
1476   * Convert array of 16 byte values to UUID string format of the form:
1477   * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1478   */
1479  
1480  const byteToHex = [];
1481  
1482  for (let i = 0; i < 256; ++i) {
1483    byteToHex.push((i + 0x100).toString(16).slice(1));
1484  }
1485  
1486  function unsafeStringify(arr, offset = 0) {
1487    // Note: Be careful editing this code!  It's been tuned for performance
1488    // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1489    return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
1490  }
1491  
1492  function stringify(arr, offset = 0) {
1493    const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID.  If this throws, it's likely due to one
1494    // of the following:
1495    // - One or more input array values don't map to a hex octet (leading to
1496    // "undefined" in the uuid)
1497    // - Invalid input values for the RFC `version` or `variant` fields
1498  
1499    if (!validate(uuid)) {
1500      throw TypeError('Stringified UUID is invalid');
1501    }
1502  
1503    return uuid;
1504  }
1505  
1506  /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
1507  ;// ./node_modules/@wordpress/core-data/node_modules/uuid/dist/esm-browser/v4.js
1508  
1509  
1510  
1511  
1512  function v4(options, buf, offset) {
1513    if (esm_browser_native.randomUUID && !buf && !options) {
1514      return esm_browser_native.randomUUID();
1515    }
1516  
1517    options = options || {};
1518    const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1519  
1520    rnds[6] = rnds[6] & 0x0f | 0x40;
1521    rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1522  
1523    if (buf) {
1524      offset = offset || 0;
1525  
1526      for (let i = 0; i < 16; ++i) {
1527        buf[offset + i] = rnds[i];
1528      }
1529  
1530      return buf;
1531    }
1532  
1533    return unsafeStringify(rnds);
1534  }
1535  
1536  /* harmony default export */ const esm_browser_v4 = (v4);
1537  ;// external ["wp","url"]
1538  const external_wp_url_namespaceObject = window["wp"]["url"];
1539  ;// external ["wp","deprecated"]
1540  const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
1541  var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
1542  ;// ./node_modules/@wordpress/core-data/build-module/utils/set-nested-value.js
1543  /**
1544   * Sets the value at path of object.
1545   * If a portion of path doesn’t exist, it’s created.
1546   * Arrays are created for missing index properties while objects are created
1547   * for all other missing properties.
1548   *
1549   * Path is specified as either:
1550   * - a string of properties, separated by dots, for example: "x.y".
1551   * - an array of properties, for example `[ 'x', 'y' ]`.
1552   *
1553   * This function intentionally mutates the input object.
1554   *
1555   * Inspired by _.set().
1556   *
1557   * @see https://lodash.com/docs/4.17.15#set
1558   *
1559   * @todo Needs to be deduplicated with its copy in `@wordpress/edit-site`.
1560   *
1561   * @param {Object}       object Object to modify
1562   * @param {Array|string} path   Path of the property to set.
1563   * @param {*}            value  Value to set.
1564   */
1565  function setNestedValue(object, path, value) {
1566    if (!object || typeof object !== 'object') {
1567      return object;
1568    }
1569    const normalizedPath = Array.isArray(path) ? path : path.split('.');
1570    normalizedPath.reduce((acc, key, idx) => {
1571      if (acc[key] === undefined) {
1572        if (Number.isInteger(normalizedPath[idx + 1])) {
1573          acc[key] = [];
1574        } else {
1575          acc[key] = {};
1576        }
1577      }
1578      if (idx === normalizedPath.length - 1) {
1579        acc[key] = value;
1580      }
1581      return acc[key];
1582    }, object);
1583    return object;
1584  }
1585  
1586  ;// ./node_modules/@wordpress/core-data/build-module/utils/get-nested-value.js
1587  /**
1588   * Helper util to return a value from a certain path of the object.
1589   * Path is specified as either:
1590   * - a string of properties, separated by dots, for example: "x.y".
1591   * - an array of properties, for example `[ 'x', 'y' ]`.
1592   * You can also specify a default value in case the result is nullish.
1593   *
1594   * @param {Object}       object       Input object.
1595   * @param {string|Array} path         Path to the object property.
1596   * @param {*}            defaultValue Default value if the value at the specified path is undefined.
1597   * @return {*} Value of the object property at the specified path.
1598   */
1599  function getNestedValue(object, path, defaultValue) {
1600    if (!object || typeof object !== 'object' || typeof path !== 'string' && !Array.isArray(path)) {
1601      return object;
1602    }
1603    const normalizedPath = Array.isArray(path) ? path : path.split('.');
1604    let value = object;
1605    normalizedPath.forEach(fieldName => {
1606      value = value?.[fieldName];
1607    });
1608    return value !== undefined ? value : defaultValue;
1609  }
1610  
1611  ;// ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js
1612  /**
1613   * Returns an action object used in signalling that items have been received.
1614   *
1615   * @param {Array}   items Items received.
1616   * @param {?Object} edits Optional edits to reset.
1617   * @param {?Object} meta  Meta information about pagination.
1618   *
1619   * @return {Object} Action object.
1620   */
1621  function receiveItems(items, edits, meta) {
1622    return {
1623      type: 'RECEIVE_ITEMS',
1624      items: Array.isArray(items) ? items : [items],
1625      persistedEdits: edits,
1626      meta
1627    };
1628  }
1629  
1630  /**
1631   * Returns an action object used in signalling that entity records have been
1632   * deleted and they need to be removed from entities state.
1633   *
1634   * @param {string}              kind            Kind of the removed entities.
1635   * @param {string}              name            Name of the removed entities.
1636   * @param {Array|number|string} records         Record IDs of the removed entities.
1637   * @param {boolean}             invalidateCache Controls whether we want to invalidate the cache.
1638   * @return {Object} Action object.
1639   */
1640  function removeItems(kind, name, records, invalidateCache = false) {
1641    return {
1642      type: 'REMOVE_ITEMS',
1643      itemIds: Array.isArray(records) ? records : [records],
1644      kind,
1645      name,
1646      invalidateCache
1647    };
1648  }
1649  
1650  /**
1651   * Returns an action object used in signalling that queried data has been
1652   * received.
1653   *
1654   * @param {Array}   items Queried items received.
1655   * @param {?Object} query Optional query object.
1656   * @param {?Object} edits Optional edits to reset.
1657   * @param {?Object} meta  Meta information about pagination.
1658   *
1659   * @return {Object} Action object.
1660   */
1661  function receiveQueriedItems(items, query = {}, edits, meta) {
1662    return {
1663      ...receiveItems(items, edits, meta),
1664      query
1665    };
1666  }
1667  
1668  ;// ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js
1669  /**
1670   * WordPress dependencies
1671   */
1672  
1673  
1674  /**
1675   * Maximum number of requests to place in a single batch request. Obtained by
1676   * sending a preflight OPTIONS request to /batch/v1/.
1677   *
1678   * @type {number?}
1679   */
1680  let maxItems = null;
1681  function chunk(arr, chunkSize) {
1682    const tmp = [...arr];
1683    const cache = [];
1684    while (tmp.length) {
1685      cache.push(tmp.splice(0, chunkSize));
1686    }
1687    return cache;
1688  }
1689  
1690  /**
1691   * Default batch processor. Sends its input requests to /batch/v1.
1692   *
1693   * @param {Array} requests List of API requests to perform at once.
1694   *
1695   * @return {Promise} Promise that resolves to a list of objects containing
1696   *                   either `output` (if that request was successful) or `error`
1697   *                   (if not ).
1698   */
1699  async function defaultProcessor(requests) {
1700    if (maxItems === null) {
1701      const preflightResponse = await external_wp_apiFetch_default()({
1702        path: '/batch/v1',
1703        method: 'OPTIONS'
1704      });
1705      maxItems = preflightResponse.endpoints[0].args.requests.maxItems;
1706    }
1707    const results = [];
1708  
1709    // @ts-ignore We would have crashed or never gotten to this point if we hadn't received the maxItems count.
1710    for (const batchRequests of chunk(requests, maxItems)) {
1711      const batchResponse = await external_wp_apiFetch_default()({
1712        path: '/batch/v1',
1713        method: 'POST',
1714        data: {
1715          validation: 'require-all-validate',
1716          requests: batchRequests.map(request => ({
1717            path: request.path,
1718            body: request.data,
1719            // Rename 'data' to 'body'.
1720            method: request.method,
1721            headers: request.headers
1722          }))
1723        }
1724      });
1725      let batchResults;
1726      if (batchResponse.failed) {
1727        batchResults = batchResponse.responses.map(response => ({
1728          error: response?.body
1729        }));
1730      } else {
1731        batchResults = batchResponse.responses.map(response => {
1732          const result = {};
1733          if (response.status >= 200 && response.status < 300) {
1734            result.output = response.body;
1735          } else {
1736            result.error = response.body;
1737          }
1738          return result;
1739        });
1740      }
1741      results.push(...batchResults);
1742    }
1743    return results;
1744  }
1745  
1746  ;// ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js
1747  /**
1748   * Internal dependencies
1749   */
1750  
1751  
1752  /**
1753   * Creates a batch, which can be used to combine multiple API requests into one
1754   * API request using the WordPress batch processing API (/v1/batch).
1755   *
1756   * ```
1757   * const batch = createBatch();
1758   * const dunePromise = batch.add( {
1759   *   path: '/v1/books',
1760   *   method: 'POST',
1761   *   data: { title: 'Dune' }
1762   * } );
1763   * const lotrPromise = batch.add( {
1764   *   path: '/v1/books',
1765   *   method: 'POST',
1766   *   data: { title: 'Lord of the Rings' }
1767   * } );
1768   * const isSuccess = await batch.run(); // Sends one POST to /v1/batch.
1769   * if ( isSuccess ) {
1770   *   console.log(
1771   *     'Saved two books:',
1772   *     await dunePromise,
1773   *     await lotrPromise
1774   *   );
1775   * }
1776   * ```
1777   *
1778   * @param {Function} [processor] Processor function. Can be used to replace the
1779   *                               default functionality which is to send an API
1780   *                               request to /v1/batch. Is given an array of
1781   *                               inputs and must return a promise that
1782   *                               resolves to an array of objects containing
1783   *                               either `output` or `error`.
1784   */
1785  function createBatch(processor = defaultProcessor) {
1786    let lastId = 0;
1787    /** @type {Array<{ input: any; resolve: ( value: any ) => void; reject: ( error: any ) => void }>} */
1788    let queue = [];
1789    const pending = new ObservableSet();
1790    return {
1791      /**
1792       * Adds an input to the batch and returns a promise that is resolved or
1793       * rejected when the input is processed by `batch.run()`.
1794       *
1795       * You may also pass a thunk which allows inputs to be added
1796       * asychronously.
1797       *
1798       * ```
1799       * // Both are allowed:
1800       * batch.add( { path: '/v1/books', ... } );
1801       * batch.add( ( add ) => add( { path: '/v1/books', ... } ) );
1802       * ```
1803       *
1804       * If a thunk is passed, `batch.run()` will pause until either:
1805       *
1806       * - The thunk calls its `add` argument, or;
1807       * - The thunk returns a promise and that promise resolves, or;
1808       * - The thunk returns a non-promise.
1809       *
1810       * @param {any|Function} inputOrThunk Input to add or thunk to execute.
1811       *
1812       * @return {Promise|any} If given an input, returns a promise that
1813       *                       is resolved or rejected when the batch is
1814       *                       processed. If given a thunk, returns the return
1815       *                       value of that thunk.
1816       */
1817      add(inputOrThunk) {
1818        const id = ++lastId;
1819        pending.add(id);
1820        const add = input => new Promise((resolve, reject) => {
1821          queue.push({
1822            input,
1823            resolve,
1824            reject
1825          });
1826          pending.delete(id);
1827        });
1828        if (typeof inputOrThunk === 'function') {
1829          return Promise.resolve(inputOrThunk(add)).finally(() => {
1830            pending.delete(id);
1831          });
1832        }
1833        return add(inputOrThunk);
1834      },
1835      /**
1836       * Runs the batch. This calls `batchProcessor` and resolves or rejects
1837       * all promises returned by `add()`.
1838       *
1839       * @return {Promise<boolean>} A promise that resolves to a boolean that is true
1840       *                   if the processor returned no errors.
1841       */
1842      async run() {
1843        if (pending.size) {
1844          await new Promise(resolve => {
1845            const unsubscribe = pending.subscribe(() => {
1846              if (!pending.size) {
1847                unsubscribe();
1848                resolve(undefined);
1849              }
1850            });
1851          });
1852        }
1853        let results;
1854        try {
1855          results = await processor(queue.map(({
1856            input
1857          }) => input));
1858          if (results.length !== queue.length) {
1859            throw new Error('run: Array returned by processor must be same size as input array.');
1860          }
1861        } catch (error) {
1862          for (const {
1863            reject
1864          } of queue) {
1865            reject(error);
1866          }
1867          throw error;
1868        }
1869        let isSuccess = true;
1870        results.forEach((result, key) => {
1871          const queueItem = queue[key];
1872          if (result?.error) {
1873            queueItem?.reject(result.error);
1874            isSuccess = false;
1875          } else {
1876            var _result$output;
1877            queueItem?.resolve((_result$output = result?.output) !== null && _result$output !== void 0 ? _result$output : result);
1878          }
1879        });
1880        queue = [];
1881        return isSuccess;
1882      }
1883    };
1884  }
1885  class ObservableSet {
1886    constructor(...args) {
1887      this.set = new Set(...args);
1888      this.subscribers = new Set();
1889    }
1890    get size() {
1891      return this.set.size;
1892    }
1893    add(value) {
1894      this.set.add(value);
1895      this.subscribers.forEach(subscriber => subscriber());
1896      return this;
1897    }
1898    delete(value) {
1899      const isSuccess = this.set.delete(value);
1900      this.subscribers.forEach(subscriber => subscriber());
1901      return isSuccess;
1902    }
1903    subscribe(subscriber) {
1904      this.subscribers.add(subscriber);
1905      return () => {
1906        this.subscribers.delete(subscriber);
1907      };
1908    }
1909  }
1910  
1911  ;// ./node_modules/@wordpress/core-data/build-module/name.js
1912  /**
1913   * The reducer key used by core data in store registration.
1914   * This is defined in a separate file to avoid cycle-dependency
1915   *
1916   * @type {string}
1917   */
1918  const STORE_NAME = 'core';
1919  
1920  ;// ./node_modules/@wordpress/core-data/build-module/actions.js
1921  /**
1922   * External dependencies
1923   */
1924  
1925  
1926  
1927  /**
1928   * WordPress dependencies
1929   */
1930  
1931  
1932  
1933  
1934  /**
1935   * Internal dependencies
1936   */
1937  
1938  
1939  
1940  
1941  
1942  
1943  
1944  /**
1945   * Returns an action object used in signalling that authors have been received.
1946   * Ignored from documentation as it's internal to the data store.
1947   *
1948   * @ignore
1949   *
1950   * @param {string}       queryID Query ID.
1951   * @param {Array|Object} users   Users received.
1952   *
1953   * @return {Object} Action object.
1954   */
1955  function receiveUserQuery(queryID, users) {
1956    return {
1957      type: 'RECEIVE_USER_QUERY',
1958      users: Array.isArray(users) ? users : [users],
1959      queryID
1960    };
1961  }
1962  
1963  /**
1964   * Returns an action used in signalling that the current user has been received.
1965   * Ignored from documentation as it's internal to the data store.
1966   *
1967   * @ignore
1968   *
1969   * @param {Object} currentUser Current user object.
1970   *
1971   * @return {Object} Action object.
1972   */
1973  function receiveCurrentUser(currentUser) {
1974    return {
1975      type: 'RECEIVE_CURRENT_USER',
1976      currentUser
1977    };
1978  }
1979  
1980  /**
1981   * Returns an action object used in adding new entities.
1982   *
1983   * @param {Array} entities Entities received.
1984   *
1985   * @return {Object} Action object.
1986   */
1987  function addEntities(entities) {
1988    return {
1989      type: 'ADD_ENTITIES',
1990      entities
1991    };
1992  }
1993  
1994  /**
1995   * Returns an action object used in signalling that entity records have been received.
1996   *
1997   * @param {string}       kind            Kind of the received entity record.
1998   * @param {string}       name            Name of the received entity record.
1999   * @param {Array|Object} records         Records received.
2000   * @param {?Object}      query           Query Object.
2001   * @param {?boolean}     invalidateCache Should invalidate query caches.
2002   * @param {?Object}      edits           Edits to reset.
2003   * @param {?Object}      meta            Meta information about pagination.
2004   * @return {Object} Action object.
2005   */
2006  function receiveEntityRecords(kind, name, records, query, invalidateCache = false, edits, meta) {
2007    // Auto drafts should not have titles, but some plugins rely on them so we can't filter this
2008    // on the server.
2009    if (kind === 'postType') {
2010      records = (Array.isArray(records) ? records : [records]).map(record => record.status === 'auto-draft' ? {
2011        ...record,
2012        title: ''
2013      } : record);
2014    }
2015    let action;
2016    if (query) {
2017      action = receiveQueriedItems(records, query, edits, meta);
2018    } else {
2019      action = receiveItems(records, edits, meta);
2020    }
2021    return {
2022      ...action,
2023      kind,
2024      name,
2025      invalidateCache
2026    };
2027  }
2028  
2029  /**
2030   * Returns an action object used in signalling that the current theme has been received.
2031   * Ignored from documentation as it's internal to the data store.
2032   *
2033   * @ignore
2034   *
2035   * @param {Object} currentTheme The current theme.
2036   *
2037   * @return {Object} Action object.
2038   */
2039  function receiveCurrentTheme(currentTheme) {
2040    return {
2041      type: 'RECEIVE_CURRENT_THEME',
2042      currentTheme
2043    };
2044  }
2045  
2046  /**
2047   * Returns an action object used in signalling that the current global styles id has been received.
2048   * Ignored from documentation as it's internal to the data store.
2049   *
2050   * @ignore
2051   *
2052   * @param {string} currentGlobalStylesId The current global styles id.
2053   *
2054   * @return {Object} Action object.
2055   */
2056  function __experimentalReceiveCurrentGlobalStylesId(currentGlobalStylesId) {
2057    return {
2058      type: 'RECEIVE_CURRENT_GLOBAL_STYLES_ID',
2059      id: currentGlobalStylesId
2060    };
2061  }
2062  
2063  /**
2064   * Returns an action object used in signalling that the theme base global styles have been received
2065   * Ignored from documentation as it's internal to the data store.
2066   *
2067   * @ignore
2068   *
2069   * @param {string} stylesheet   The theme's identifier
2070   * @param {Object} globalStyles The global styles object.
2071   *
2072   * @return {Object} Action object.
2073   */
2074  function __experimentalReceiveThemeBaseGlobalStyles(stylesheet, globalStyles) {
2075    return {
2076      type: 'RECEIVE_THEME_GLOBAL_STYLES',
2077      stylesheet,
2078      globalStyles
2079    };
2080  }
2081  
2082  /**
2083   * Returns an action object used in signalling that the theme global styles variations have been received.
2084   * Ignored from documentation as it's internal to the data store.
2085   *
2086   * @ignore
2087   *
2088   * @param {string} stylesheet The theme's identifier
2089   * @param {Array}  variations The global styles variations.
2090   *
2091   * @return {Object} Action object.
2092   */
2093  function __experimentalReceiveThemeGlobalStyleVariations(stylesheet, variations) {
2094    return {
2095      type: 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS',
2096      stylesheet,
2097      variations
2098    };
2099  }
2100  
2101  /**
2102   * Returns an action object used in signalling that the index has been received.
2103   *
2104   * @deprecated since WP 5.9, this is not useful anymore, use the selector directly.
2105   *
2106   * @return {Object} Action object.
2107   */
2108  function receiveThemeSupports() {
2109    external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveThemeSupports", {
2110      since: '5.9'
2111    });
2112    return {
2113      type: 'DO_NOTHING'
2114    };
2115  }
2116  
2117  /**
2118   * Returns an action object used in signalling that the theme global styles CPT post revisions have been received.
2119   * Ignored from documentation as it's internal to the data store.
2120   *
2121   * @deprecated since WordPress 6.5.0. Callers should use `dispatch( 'core' ).receiveRevision` instead.
2122   *
2123   * @ignore
2124   *
2125   * @param {number} currentId The post id.
2126   * @param {Array}  revisions The global styles revisions.
2127   *
2128   * @return {Object} Action object.
2129   */
2130  function receiveThemeGlobalStyleRevisions(currentId, revisions) {
2131    external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()", {
2132      since: '6.5.0',
2133      alternative: "wp.data.dispatch( 'core' ).receiveRevisions"
2134    });
2135    return {
2136      type: 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS',
2137      currentId,
2138      revisions
2139    };
2140  }
2141  
2142  /**
2143   * Returns an action object used in signalling that the preview data for
2144   * a given URl has been received.
2145   * Ignored from documentation as it's internal to the data store.
2146   *
2147   * @ignore
2148   *
2149   * @param {string} url     URL to preview the embed for.
2150   * @param {*}      preview Preview data.
2151   *
2152   * @return {Object} Action object.
2153   */
2154  function receiveEmbedPreview(url, preview) {
2155    return {
2156      type: 'RECEIVE_EMBED_PREVIEW',
2157      url,
2158      preview
2159    };
2160  }
2161  
2162  /**
2163   * Action triggered to delete an entity record.
2164   *
2165   * @param {string}        kind                         Kind of the deleted entity.
2166   * @param {string}        name                         Name of the deleted entity.
2167   * @param {number|string} recordId                     Record ID of the deleted entity.
2168   * @param {?Object}       query                        Special query parameters for the
2169   *                                                     DELETE API call.
2170   * @param {Object}        [options]                    Delete options.
2171   * @param {Function}      [options.__unstableFetch]    Internal use only. Function to
2172   *                                                     call instead of `apiFetch()`.
2173   *                                                     Must return a promise.
2174   * @param {boolean}       [options.throwOnError=false] If false, this action suppresses all
2175   *                                                     the exceptions. Defaults to false.
2176   */
2177  const deleteEntityRecord = (kind, name, recordId, query, {
2178    __unstableFetch = (external_wp_apiFetch_default()),
2179    throwOnError = false
2180  } = {}) => async ({
2181    dispatch
2182  }) => {
2183    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
2184    const entityConfig = configs.find(config => config.kind === kind && config.name === name);
2185    let error;
2186    let deletedRecord = false;
2187    if (!entityConfig) {
2188      return;
2189    }
2190    const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, recordId], {
2191      exclusive: true
2192    });
2193    try {
2194      dispatch({
2195        type: 'DELETE_ENTITY_RECORD_START',
2196        kind,
2197        name,
2198        recordId
2199      });
2200      let hasError = false;
2201      try {
2202        let path = `$entityConfig.baseURL}/$recordId}`;
2203        if (query) {
2204          path = (0,external_wp_url_namespaceObject.addQueryArgs)(path, query);
2205        }
2206        deletedRecord = await __unstableFetch({
2207          path,
2208          method: 'DELETE'
2209        });
2210        await dispatch(removeItems(kind, name, recordId, true));
2211      } catch (_error) {
2212        hasError = true;
2213        error = _error;
2214      }
2215      dispatch({
2216        type: 'DELETE_ENTITY_RECORD_FINISH',
2217        kind,
2218        name,
2219        recordId,
2220        error
2221      });
2222      if (hasError && throwOnError) {
2223        throw error;
2224      }
2225      return deletedRecord;
2226    } finally {
2227      dispatch.__unstableReleaseStoreLock(lock);
2228    }
2229  };
2230  
2231  /**
2232   * Returns an action object that triggers an
2233   * edit to an entity record.
2234   *
2235   * @param {string}        kind                 Kind of the edited entity record.
2236   * @param {string}        name                 Name of the edited entity record.
2237   * @param {number|string} recordId             Record ID of the edited entity record.
2238   * @param {Object}        edits                The edits.
2239   * @param {Object}        options              Options for the edit.
2240   * @param {boolean}       [options.undoIgnore] Whether to ignore the edit in undo history or not.
2241   *
2242   * @return {Object} Action object.
2243   */
2244  const editEntityRecord = (kind, name, recordId, edits, options = {}) => ({
2245    select,
2246    dispatch
2247  }) => {
2248    const entityConfig = select.getEntityConfig(kind, name);
2249    if (!entityConfig) {
2250      throw new Error(`The entity being edited ($kind}, $name}) does not have a loaded config.`);
2251    }
2252    const {
2253      mergedEdits = {}
2254    } = entityConfig;
2255    const record = select.getRawEntityRecord(kind, name, recordId);
2256    const editedRecord = select.getEditedEntityRecord(kind, name, recordId);
2257    const edit = {
2258      kind,
2259      name,
2260      recordId,
2261      // Clear edits when they are equal to their persisted counterparts
2262      // so that the property is not considered dirty.
2263      edits: Object.keys(edits).reduce((acc, key) => {
2264        const recordValue = record[key];
2265        const editedRecordValue = editedRecord[key];
2266        const value = mergedEdits[key] ? {
2267          ...editedRecordValue,
2268          ...edits[key]
2269        } : edits[key];
2270        acc[key] = es6_default()(recordValue, value) ? undefined : value;
2271        return acc;
2272      }, {})
2273    };
2274    if (window.__experimentalEnableSync && entityConfig.syncConfig) {
2275      if (false) {}
2276    } else {
2277      if (!options.undoIgnore) {
2278        select.getUndoManager().addRecord([{
2279          id: {
2280            kind,
2281            name,
2282            recordId
2283          },
2284          changes: Object.keys(edits).reduce((acc, key) => {
2285            acc[key] = {
2286              from: editedRecord[key],
2287              to: edits[key]
2288            };
2289            return acc;
2290          }, {})
2291        }], options.isCached);
2292      }
2293      dispatch({
2294        type: 'EDIT_ENTITY_RECORD',
2295        ...edit
2296      });
2297    }
2298  };
2299  
2300  /**
2301   * Action triggered to undo the last edit to
2302   * an entity record, if any.
2303   */
2304  const undo = () => ({
2305    select,
2306    dispatch
2307  }) => {
2308    const undoRecord = select.getUndoManager().undo();
2309    if (!undoRecord) {
2310      return;
2311    }
2312    dispatch({
2313      type: 'UNDO',
2314      record: undoRecord
2315    });
2316  };
2317  
2318  /**
2319   * Action triggered to redo the last undoed
2320   * edit to an entity record, if any.
2321   */
2322  const redo = () => ({
2323    select,
2324    dispatch
2325  }) => {
2326    const redoRecord = select.getUndoManager().redo();
2327    if (!redoRecord) {
2328      return;
2329    }
2330    dispatch({
2331      type: 'REDO',
2332      record: redoRecord
2333    });
2334  };
2335  
2336  /**
2337   * Forces the creation of a new undo level.
2338   *
2339   * @return {Object} Action object.
2340   */
2341  const __unstableCreateUndoLevel = () => ({
2342    select
2343  }) => {
2344    select.getUndoManager().addRecord();
2345  };
2346  
2347  /**
2348   * Action triggered to save an entity record.
2349   *
2350   * @param {string}   kind                         Kind of the received entity.
2351   * @param {string}   name                         Name of the received entity.
2352   * @param {Object}   record                       Record to be saved.
2353   * @param {Object}   options                      Saving options.
2354   * @param {boolean}  [options.isAutosave=false]   Whether this is an autosave.
2355   * @param {Function} [options.__unstableFetch]    Internal use only. Function to
2356   *                                                call instead of `apiFetch()`.
2357   *                                                Must return a promise.
2358   * @param {boolean}  [options.throwOnError=false] If false, this action suppresses all
2359   *                                                the exceptions. Defaults to false.
2360   */
2361  const saveEntityRecord = (kind, name, record, {
2362    isAutosave = false,
2363    __unstableFetch = (external_wp_apiFetch_default()),
2364    throwOnError = false
2365  } = {}) => async ({
2366    select,
2367    resolveSelect,
2368    dispatch
2369  }) => {
2370    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
2371    const entityConfig = configs.find(config => config.kind === kind && config.name === name);
2372    if (!entityConfig) {
2373      return;
2374    }
2375    const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY;
2376    const recordId = record[entityIdKey];
2377    const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, recordId || esm_browser_v4()], {
2378      exclusive: true
2379    });
2380    try {
2381      // Evaluate optimized edits.
2382      // (Function edits that should be evaluated on save to avoid expensive computations on every edit.)
2383      for (const [key, value] of Object.entries(record)) {
2384        if (typeof value === 'function') {
2385          const evaluatedValue = value(select.getEditedEntityRecord(kind, name, recordId));
2386          dispatch.editEntityRecord(kind, name, recordId, {
2387            [key]: evaluatedValue
2388          }, {
2389            undoIgnore: true
2390          });
2391          record[key] = evaluatedValue;
2392        }
2393      }
2394      dispatch({
2395        type: 'SAVE_ENTITY_RECORD_START',
2396        kind,
2397        name,
2398        recordId,
2399        isAutosave
2400      });
2401      let updatedRecord;
2402      let error;
2403      let hasError = false;
2404      try {
2405        const path = `$entityConfig.baseURL}$recordId ? '/' + recordId : ''}`;
2406        const persistedRecord = select.getRawEntityRecord(kind, name, recordId);
2407        if (isAutosave) {
2408          // Most of this autosave logic is very specific to posts.
2409          // This is fine for now as it is the only supported autosave,
2410          // but ideally this should all be handled in the back end,
2411          // so the client just sends and receives objects.
2412          const currentUser = select.getCurrentUser();
2413          const currentUserId = currentUser ? currentUser.id : undefined;
2414          const autosavePost = await resolveSelect.getAutosave(persistedRecord.type, persistedRecord.id, currentUserId);
2415          // Autosaves need all expected fields to be present.
2416          // So we fallback to the previous autosave and then
2417          // to the actual persisted entity if the edits don't
2418          // have a value.
2419          let data = {
2420            ...persistedRecord,
2421            ...autosavePost,
2422            ...record
2423          };
2424          data = Object.keys(data).reduce((acc, key) => {
2425            if (['title', 'excerpt', 'content', 'meta'].includes(key)) {
2426              acc[key] = data[key];
2427            }
2428            return acc;
2429          }, {
2430            // Do not update the `status` if we have edited it when auto saving.
2431            // It's very important to let the user explicitly save this change,
2432            // because it can lead to unexpected results. An example would be to
2433            // have a draft post and change the status to publish.
2434            status: data.status === 'auto-draft' ? 'draft' : undefined
2435          });
2436          updatedRecord = await __unstableFetch({
2437            path: `$path}/autosaves`,
2438            method: 'POST',
2439            data
2440          });
2441  
2442          // An autosave may be processed by the server as a regular save
2443          // when its update is requested by the author and the post had
2444          // draft or auto-draft status.
2445          if (persistedRecord.id === updatedRecord.id) {
2446            let newRecord = {
2447              ...persistedRecord,
2448              ...data,
2449              ...updatedRecord
2450            };
2451            newRecord = Object.keys(newRecord).reduce((acc, key) => {
2452              // These properties are persisted in autosaves.
2453              if (['title', 'excerpt', 'content'].includes(key)) {
2454                acc[key] = newRecord[key];
2455              } else if (key === 'status') {
2456                // Status is only persisted in autosaves when going from
2457                // "auto-draft" to "draft".
2458                acc[key] = persistedRecord.status === 'auto-draft' && newRecord.status === 'draft' ? newRecord.status : persistedRecord.status;
2459              } else {
2460                // These properties are not persisted in autosaves.
2461                acc[key] = persistedRecord[key];
2462              }
2463              return acc;
2464            }, {});
2465            dispatch.receiveEntityRecords(kind, name, newRecord, undefined, true);
2466          } else {
2467            dispatch.receiveAutosaves(persistedRecord.id, updatedRecord);
2468          }
2469        } else {
2470          let edits = record;
2471          if (entityConfig.__unstablePrePersist) {
2472            edits = {
2473              ...edits,
2474              ...entityConfig.__unstablePrePersist(persistedRecord, edits)
2475            };
2476          }
2477          updatedRecord = await __unstableFetch({
2478            path,
2479            method: recordId ? 'PUT' : 'POST',
2480            data: edits
2481          });
2482          dispatch.receiveEntityRecords(kind, name, updatedRecord, undefined, true, edits);
2483        }
2484      } catch (_error) {
2485        hasError = true;
2486        error = _error;
2487      }
2488      dispatch({
2489        type: 'SAVE_ENTITY_RECORD_FINISH',
2490        kind,
2491        name,
2492        recordId,
2493        error,
2494        isAutosave
2495      });
2496      if (hasError && throwOnError) {
2497        throw error;
2498      }
2499      return updatedRecord;
2500    } finally {
2501      dispatch.__unstableReleaseStoreLock(lock);
2502    }
2503  };
2504  
2505  /**
2506   * Runs multiple core-data actions at the same time using one API request.
2507   *
2508   * Example:
2509   *
2510   * ```
2511   * const [ savedRecord, updatedRecord, deletedRecord ] =
2512   *   await dispatch( 'core' ).__experimentalBatch( [
2513   *     ( { saveEntityRecord } ) => saveEntityRecord( 'root', 'widget', widget ),
2514   *     ( { saveEditedEntityRecord } ) => saveEntityRecord( 'root', 'widget', 123 ),
2515   *     ( { deleteEntityRecord } ) => deleteEntityRecord( 'root', 'widget', 123, null ),
2516   *   ] );
2517   * ```
2518   *
2519   * @param {Array} requests Array of functions which are invoked simultaneously.
2520   *                         Each function is passed an object containing
2521   *                         `saveEntityRecord`, `saveEditedEntityRecord`, and
2522   *                         `deleteEntityRecord`.
2523   *
2524   * @return {(thunkArgs: Object) => Promise} A promise that resolves to an array containing the return
2525   *                                          values of each function given in `requests`.
2526   */
2527  const __experimentalBatch = requests => async ({
2528    dispatch
2529  }) => {
2530    const batch = createBatch();
2531    const api = {
2532      saveEntityRecord(kind, name, record, options) {
2533        return batch.add(add => dispatch.saveEntityRecord(kind, name, record, {
2534          ...options,
2535          __unstableFetch: add
2536        }));
2537      },
2538      saveEditedEntityRecord(kind, name, recordId, options) {
2539        return batch.add(add => dispatch.saveEditedEntityRecord(kind, name, recordId, {
2540          ...options,
2541          __unstableFetch: add
2542        }));
2543      },
2544      deleteEntityRecord(kind, name, recordId, query, options) {
2545        return batch.add(add => dispatch.deleteEntityRecord(kind, name, recordId, query, {
2546          ...options,
2547          __unstableFetch: add
2548        }));
2549      }
2550    };
2551    const resultPromises = requests.map(request => request(api));
2552    const [, ...results] = await Promise.all([batch.run(), ...resultPromises]);
2553    return results;
2554  };
2555  
2556  /**
2557   * Action triggered to save an entity record's edits.
2558   *
2559   * @param {string}  kind     Kind of the entity.
2560   * @param {string}  name     Name of the entity.
2561   * @param {Object}  recordId ID of the record.
2562   * @param {Object=} options  Saving options.
2563   */
2564  const saveEditedEntityRecord = (kind, name, recordId, options) => async ({
2565    select,
2566    dispatch
2567  }) => {
2568    if (!select.hasEditsForEntityRecord(kind, name, recordId)) {
2569      return;
2570    }
2571    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
2572    const entityConfig = configs.find(config => config.kind === kind && config.name === name);
2573    if (!entityConfig) {
2574      return;
2575    }
2576    const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY;
2577    const edits = select.getEntityRecordNonTransientEdits(kind, name, recordId);
2578    const record = {
2579      [entityIdKey]: recordId,
2580      ...edits
2581    };
2582    return await dispatch.saveEntityRecord(kind, name, record, options);
2583  };
2584  
2585  /**
2586   * Action triggered to save only specified properties for the entity.
2587   *
2588   * @param {string}        kind        Kind of the entity.
2589   * @param {string}        name        Name of the entity.
2590   * @param {number|string} recordId    ID of the record.
2591   * @param {Array}         itemsToSave List of entity properties or property paths to save.
2592   * @param {Object}        options     Saving options.
2593   */
2594  const __experimentalSaveSpecifiedEntityEdits = (kind, name, recordId, itemsToSave, options) => async ({
2595    select,
2596    dispatch
2597  }) => {
2598    if (!select.hasEditsForEntityRecord(kind, name, recordId)) {
2599      return;
2600    }
2601    const edits = select.getEntityRecordNonTransientEdits(kind, name, recordId);
2602    const editsToSave = {};
2603    for (const item of itemsToSave) {
2604      setNestedValue(editsToSave, item, getNestedValue(edits, item));
2605    }
2606    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
2607    const entityConfig = configs.find(config => config.kind === kind && config.name === name);
2608    const entityIdKey = entityConfig?.key || DEFAULT_ENTITY_KEY;
2609  
2610    // If a record key is provided then update the existing record.
2611    // This necessitates providing `recordKey` to saveEntityRecord as part of the
2612    // `record` argument (here called `editsToSave`) to stop that action creating
2613    // a new record and instead cause it to update the existing record.
2614    if (recordId) {
2615      editsToSave[entityIdKey] = recordId;
2616    }
2617    return await dispatch.saveEntityRecord(kind, name, editsToSave, options);
2618  };
2619  
2620  /**
2621   * Returns an action object used in signalling that Upload permissions have been received.
2622   *
2623   * @deprecated since WP 5.9, use receiveUserPermission instead.
2624   *
2625   * @param {boolean} hasUploadPermissions Does the user have permission to upload files?
2626   *
2627   * @return {Object} Action object.
2628   */
2629  function receiveUploadPermissions(hasUploadPermissions) {
2630    external_wp_deprecated_default()("wp.data.dispatch( 'core' ).receiveUploadPermissions", {
2631      since: '5.9',
2632      alternative: 'receiveUserPermission'
2633    });
2634    return receiveUserPermission('create/media', hasUploadPermissions);
2635  }
2636  
2637  /**
2638   * Returns an action object used in signalling that the current user has
2639   * permission to perform an action on a REST resource.
2640   * Ignored from documentation as it's internal to the data store.
2641   *
2642   * @ignore
2643   *
2644   * @param {string}  key       A key that represents the action and REST resource.
2645   * @param {boolean} isAllowed Whether or not the user can perform the action.
2646   *
2647   * @return {Object} Action object.
2648   */
2649  function receiveUserPermission(key, isAllowed) {
2650    return {
2651      type: 'RECEIVE_USER_PERMISSION',
2652      key,
2653      isAllowed
2654    };
2655  }
2656  
2657  /**
2658   * Returns an action object used in signalling that the current user has
2659   * permission to perform an action on a REST resource. Ignored from
2660   * documentation as it's internal to the data store.
2661   *
2662   * @ignore
2663   *
2664   * @param {Object<string, boolean>} permissions An object where keys represent
2665   *                                              actions and REST resources, and
2666   *                                              values indicate whether the user
2667   *                                              is allowed to perform the
2668   *                                              action.
2669   *
2670   * @return {Object} Action object.
2671   */
2672  function receiveUserPermissions(permissions) {
2673    return {
2674      type: 'RECEIVE_USER_PERMISSIONS',
2675      permissions
2676    };
2677  }
2678  
2679  /**
2680   * Returns an action object used in signalling that the autosaves for a
2681   * post have been received.
2682   * Ignored from documentation as it's internal to the data store.
2683   *
2684   * @ignore
2685   *
2686   * @param {number}       postId    The id of the post that is parent to the autosave.
2687   * @param {Array|Object} autosaves An array of autosaves or singular autosave object.
2688   *
2689   * @return {Object} Action object.
2690   */
2691  function receiveAutosaves(postId, autosaves) {
2692    return {
2693      type: 'RECEIVE_AUTOSAVES',
2694      postId,
2695      autosaves: Array.isArray(autosaves) ? autosaves : [autosaves]
2696    };
2697  }
2698  
2699  /**
2700   * Returns an action object signalling that the fallback Navigation
2701   * Menu id has been received.
2702   *
2703   * @param {integer} fallbackId the id of the fallback Navigation Menu
2704   * @return {Object} Action object.
2705   */
2706  function receiveNavigationFallbackId(fallbackId) {
2707    return {
2708      type: 'RECEIVE_NAVIGATION_FALLBACK_ID',
2709      fallbackId
2710    };
2711  }
2712  
2713  /**
2714   * Returns an action object used to set the template for a given query.
2715   *
2716   * @param {Object} query      The lookup query.
2717   * @param {string} templateId The resolved template id.
2718   *
2719   * @return {Object} Action object.
2720   */
2721  function receiveDefaultTemplateId(query, templateId) {
2722    return {
2723      type: 'RECEIVE_DEFAULT_TEMPLATE',
2724      query,
2725      templateId
2726    };
2727  }
2728  
2729  /**
2730   * Action triggered to receive revision items.
2731   *
2732   * @param {string}        kind            Kind of the received entity record revisions.
2733   * @param {string}        name            Name of the received entity record revisions.
2734   * @param {number|string} recordKey       The key of the entity record whose revisions you want to fetch.
2735   * @param {Array|Object}  records         Revisions received.
2736   * @param {?Object}       query           Query Object.
2737   * @param {?boolean}      invalidateCache Should invalidate query caches.
2738   * @param {?Object}       meta            Meta information about pagination.
2739   */
2740  const receiveRevisions = (kind, name, recordKey, records, query, invalidateCache = false, meta) => async ({
2741    dispatch
2742  }) => {
2743    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
2744    const entityConfig = configs.find(config => config.kind === kind && config.name === name);
2745    const key = entityConfig && entityConfig?.revisionKey ? entityConfig.revisionKey : DEFAULT_ENTITY_KEY;
2746    dispatch({
2747      type: 'RECEIVE_ITEM_REVISIONS',
2748      key,
2749      items: Array.isArray(records) ? records : [records],
2750      recordKey,
2751      meta,
2752      query,
2753      kind,
2754      name,
2755      invalidateCache
2756    });
2757  };
2758  
2759  ;// ./node_modules/@wordpress/core-data/build-module/entities.js
2760  /**
2761   * External dependencies
2762   */
2763  
2764  
2765  /**
2766   * WordPress dependencies
2767   */
2768  
2769  
2770  
2771  
2772  /**
2773   * Internal dependencies
2774   */
2775  
2776  
2777  const DEFAULT_ENTITY_KEY = 'id';
2778  const POST_RAW_ATTRIBUTES = ['title', 'excerpt', 'content'];
2779  const rootEntitiesConfig = [{
2780    label: (0,external_wp_i18n_namespaceObject.__)('Base'),
2781    kind: 'root',
2782    name: '__unstableBase',
2783    baseURL: '/',
2784    baseURLParams: {
2785      _fields: ['description', 'gmt_offset', 'home', 'name', 'site_icon', 'site_icon_url', 'site_logo', 'timezone_string', 'url'].join(',')
2786    },
2787    // The entity doesn't support selecting multiple records.
2788    // The property is maintained for backward compatibility.
2789    plural: '__unstableBases',
2790    syncConfig: {
2791      fetch: async () => {
2792        return external_wp_apiFetch_default()({
2793          path: '/'
2794        });
2795      },
2796      applyChangesToDoc: (doc, changes) => {
2797        const document = doc.getMap('document');
2798        Object.entries(changes).forEach(([key, value]) => {
2799          if (document.get(key) !== value) {
2800            document.set(key, value);
2801          }
2802        });
2803      },
2804      fromCRDTDoc: doc => {
2805        return doc.getMap('document').toJSON();
2806      }
2807    },
2808    syncObjectType: 'root/base',
2809    getSyncObjectId: () => 'index'
2810  }, {
2811    label: (0,external_wp_i18n_namespaceObject.__)('Post Type'),
2812    name: 'postType',
2813    kind: 'root',
2814    key: 'slug',
2815    baseURL: '/wp/v2/types',
2816    baseURLParams: {
2817      context: 'edit'
2818    },
2819    plural: 'postTypes',
2820    syncConfig: {
2821      fetch: async id => {
2822        return external_wp_apiFetch_default()({
2823          path: `/wp/v2/types/$id}?context=edit`
2824        });
2825      },
2826      applyChangesToDoc: (doc, changes) => {
2827        const document = doc.getMap('document');
2828        Object.entries(changes).forEach(([key, value]) => {
2829          if (document.get(key) !== value) {
2830            document.set(key, value);
2831          }
2832        });
2833      },
2834      fromCRDTDoc: doc => {
2835        return doc.getMap('document').toJSON();
2836      }
2837    },
2838    syncObjectType: 'root/postType',
2839    getSyncObjectId: id => id
2840  }, {
2841    name: 'media',
2842    kind: 'root',
2843    baseURL: '/wp/v2/media',
2844    baseURLParams: {
2845      context: 'edit'
2846    },
2847    plural: 'mediaItems',
2848    label: (0,external_wp_i18n_namespaceObject.__)('Media'),
2849    rawAttributes: ['caption', 'title', 'description'],
2850    supportsPagination: true
2851  }, {
2852    name: 'taxonomy',
2853    kind: 'root',
2854    key: 'slug',
2855    baseURL: '/wp/v2/taxonomies',
2856    baseURLParams: {
2857      context: 'edit'
2858    },
2859    plural: 'taxonomies',
2860    label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy')
2861  }, {
2862    name: 'sidebar',
2863    kind: 'root',
2864    baseURL: '/wp/v2/sidebars',
2865    baseURLParams: {
2866      context: 'edit'
2867    },
2868    plural: 'sidebars',
2869    transientEdits: {
2870      blocks: true
2871    },
2872    label: (0,external_wp_i18n_namespaceObject.__)('Widget areas')
2873  }, {
2874    name: 'widget',
2875    kind: 'root',
2876    baseURL: '/wp/v2/widgets',
2877    baseURLParams: {
2878      context: 'edit'
2879    },
2880    plural: 'widgets',
2881    transientEdits: {
2882      blocks: true
2883    },
2884    label: (0,external_wp_i18n_namespaceObject.__)('Widgets')
2885  }, {
2886    name: 'widgetType',
2887    kind: 'root',
2888    baseURL: '/wp/v2/widget-types',
2889    baseURLParams: {
2890      context: 'edit'
2891    },
2892    plural: 'widgetTypes',
2893    label: (0,external_wp_i18n_namespaceObject.__)('Widget types')
2894  }, {
2895    label: (0,external_wp_i18n_namespaceObject.__)('User'),
2896    name: 'user',
2897    kind: 'root',
2898    baseURL: '/wp/v2/users',
2899    baseURLParams: {
2900      context: 'edit'
2901    },
2902    plural: 'users'
2903  }, {
2904    name: 'comment',
2905    kind: 'root',
2906    baseURL: '/wp/v2/comments',
2907    baseURLParams: {
2908      context: 'edit'
2909    },
2910    plural: 'comments',
2911    label: (0,external_wp_i18n_namespaceObject.__)('Comment')
2912  }, {
2913    name: 'menu',
2914    kind: 'root',
2915    baseURL: '/wp/v2/menus',
2916    baseURLParams: {
2917      context: 'edit'
2918    },
2919    plural: 'menus',
2920    label: (0,external_wp_i18n_namespaceObject.__)('Menu')
2921  }, {
2922    name: 'menuItem',
2923    kind: 'root',
2924    baseURL: '/wp/v2/menu-items',
2925    baseURLParams: {
2926      context: 'edit'
2927    },
2928    plural: 'menuItems',
2929    label: (0,external_wp_i18n_namespaceObject.__)('Menu Item'),
2930    rawAttributes: ['title']
2931  }, {
2932    name: 'menuLocation',
2933    kind: 'root',
2934    baseURL: '/wp/v2/menu-locations',
2935    baseURLParams: {
2936      context: 'edit'
2937    },
2938    plural: 'menuLocations',
2939    label: (0,external_wp_i18n_namespaceObject.__)('Menu Location'),
2940    key: 'name'
2941  }, {
2942    label: (0,external_wp_i18n_namespaceObject.__)('Global Styles'),
2943    name: 'globalStyles',
2944    kind: 'root',
2945    baseURL: '/wp/v2/global-styles',
2946    baseURLParams: {
2947      context: 'edit'
2948    },
2949    plural: 'globalStylesVariations',
2950    // Should be different from name.
2951    getTitle: record => record?.title?.rendered || record?.title,
2952    getRevisionsUrl: (parentId, revisionId) => `/wp/v2/global-styles/$parentId}/revisions$revisionId ? '/' + revisionId : ''}`,
2953    supportsPagination: true
2954  }, {
2955    label: (0,external_wp_i18n_namespaceObject.__)('Themes'),
2956    name: 'theme',
2957    kind: 'root',
2958    baseURL: '/wp/v2/themes',
2959    baseURLParams: {
2960      context: 'edit'
2961    },
2962    plural: 'themes',
2963    key: 'stylesheet'
2964  }, {
2965    label: (0,external_wp_i18n_namespaceObject.__)('Plugins'),
2966    name: 'plugin',
2967    kind: 'root',
2968    baseURL: '/wp/v2/plugins',
2969    baseURLParams: {
2970      context: 'edit'
2971    },
2972    plural: 'plugins',
2973    key: 'plugin'
2974  }, {
2975    label: (0,external_wp_i18n_namespaceObject.__)('Status'),
2976    name: 'status',
2977    kind: 'root',
2978    baseURL: '/wp/v2/statuses',
2979    baseURLParams: {
2980      context: 'edit'
2981    },
2982    plural: 'statuses',
2983    key: 'slug'
2984  }];
2985  const additionalEntityConfigLoaders = [{
2986    kind: 'postType',
2987    loadEntities: loadPostTypeEntities
2988  }, {
2989    kind: 'taxonomy',
2990    loadEntities: loadTaxonomyEntities
2991  }, {
2992    kind: 'root',
2993    name: 'site',
2994    plural: 'sites',
2995    loadEntities: loadSiteEntity
2996  }];
2997  
2998  /**
2999   * Returns a function to be used to retrieve extra edits to apply before persisting a post type.
3000   *
3001   * @param {Object} persistedRecord Already persisted Post
3002   * @param {Object} edits           Edits.
3003   * @return {Object} Updated edits.
3004   */
3005  const prePersistPostType = (persistedRecord, edits) => {
3006    const newEdits = {};
3007    if (persistedRecord?.status === 'auto-draft') {
3008      // Saving an auto-draft should create a draft by default.
3009      if (!edits.status && !newEdits.status) {
3010        newEdits.status = 'draft';
3011      }
3012  
3013      // Fix the auto-draft default title.
3014      if ((!edits.title || edits.title === 'Auto Draft') && !newEdits.title && (!persistedRecord?.title || persistedRecord?.title === 'Auto Draft')) {
3015        newEdits.title = '';
3016      }
3017    }
3018    return newEdits;
3019  };
3020  const serialisableBlocksCache = new WeakMap();
3021  function makeBlockAttributesSerializable(attributes) {
3022    const newAttributes = {
3023      ...attributes
3024    };
3025    for (const [key, value] of Object.entries(attributes)) {
3026      if (value instanceof external_wp_richText_namespaceObject.RichTextData) {
3027        newAttributes[key] = value.valueOf();
3028      }
3029    }
3030    return newAttributes;
3031  }
3032  function makeBlocksSerializable(blocks) {
3033    return blocks.map(block => {
3034      const {
3035        innerBlocks,
3036        attributes,
3037        ...rest
3038      } = block;
3039      return {
3040        ...rest,
3041        attributes: makeBlockAttributesSerializable(attributes),
3042        innerBlocks: makeBlocksSerializable(innerBlocks)
3043      };
3044    });
3045  }
3046  
3047  /**
3048   * Returns the list of post type entities.
3049   *
3050   * @return {Promise} Entities promise
3051   */
3052  async function loadPostTypeEntities() {
3053    const postTypes = await external_wp_apiFetch_default()({
3054      path: '/wp/v2/types?context=view'
3055    });
3056    return Object.entries(postTypes !== null && postTypes !== void 0 ? postTypes : {}).map(([name, postType]) => {
3057      var _postType$rest_namesp;
3058      const isTemplate = ['wp_template', 'wp_template_part'].includes(name);
3059      const namespace = (_postType$rest_namesp = postType?.rest_namespace) !== null && _postType$rest_namesp !== void 0 ? _postType$rest_namesp : 'wp/v2';
3060      return {
3061        kind: 'postType',
3062        baseURL: `/$namespace}/$postType.rest_base}`,
3063        baseURLParams: {
3064          context: 'edit'
3065        },
3066        name,
3067        label: postType.name,
3068        transientEdits: {
3069          blocks: true,
3070          selection: true
3071        },
3072        mergedEdits: {
3073          meta: true
3074        },
3075        rawAttributes: POST_RAW_ATTRIBUTES,
3076        getTitle: record => {
3077          var _record$slug;
3078          return record?.title?.rendered || record?.title || (isTemplate ? capitalCase((_record$slug = record.slug) !== null && _record$slug !== void 0 ? _record$slug : '') : String(record.id));
3079        },
3080        __unstablePrePersist: isTemplate ? undefined : prePersistPostType,
3081        __unstable_rest_base: postType.rest_base,
3082        syncConfig: {
3083          fetch: async id => {
3084            return external_wp_apiFetch_default()({
3085              path: `/$namespace}/$postType.rest_base}/$id}?context=edit`
3086            });
3087          },
3088          applyChangesToDoc: (doc, changes) => {
3089            const document = doc.getMap('document');
3090            Object.entries(changes).forEach(([key, value]) => {
3091              if (typeof value !== 'function') {
3092                if (key === 'blocks') {
3093                  if (!serialisableBlocksCache.has(value)) {
3094                    serialisableBlocksCache.set(value, makeBlocksSerializable(value));
3095                  }
3096                  value = serialisableBlocksCache.get(value);
3097                }
3098                if (document.get(key) !== value) {
3099                  document.set(key, value);
3100                }
3101              }
3102            });
3103          },
3104          fromCRDTDoc: doc => {
3105            return doc.getMap('document').toJSON();
3106          }
3107        },
3108        syncObjectType: 'postType/' + postType.name,
3109        getSyncObjectId: id => id,
3110        supportsPagination: true,
3111        getRevisionsUrl: (parentId, revisionId) => `/$namespace}/$postType.rest_base}/$parentId}/revisions$revisionId ? '/' + revisionId : ''}`,
3112        revisionKey: isTemplate ? 'wp_id' : DEFAULT_ENTITY_KEY
3113      };
3114    });
3115  }
3116  
3117  /**
3118   * Returns the list of the taxonomies entities.
3119   *
3120   * @return {Promise} Entities promise
3121   */
3122  async function loadTaxonomyEntities() {
3123    const taxonomies = await external_wp_apiFetch_default()({
3124      path: '/wp/v2/taxonomies?context=view'
3125    });
3126    return Object.entries(taxonomies !== null && taxonomies !== void 0 ? taxonomies : {}).map(([name, taxonomy]) => {
3127      var _taxonomy$rest_namesp;
3128      const namespace = (_taxonomy$rest_namesp = taxonomy?.rest_namespace) !== null && _taxonomy$rest_namesp !== void 0 ? _taxonomy$rest_namesp : 'wp/v2';
3129      return {
3130        kind: 'taxonomy',
3131        baseURL: `/$namespace}/$taxonomy.rest_base}`,
3132        baseURLParams: {
3133          context: 'edit'
3134        },
3135        name,
3136        label: taxonomy.name
3137      };
3138    });
3139  }
3140  
3141  /**
3142   * Returns the Site entity.
3143   *
3144   * @return {Promise} Entity promise
3145   */
3146  async function loadSiteEntity() {
3147    var _site$schema$properti;
3148    const entity = {
3149      label: (0,external_wp_i18n_namespaceObject.__)('Site'),
3150      name: 'site',
3151      kind: 'root',
3152      baseURL: '/wp/v2/settings',
3153      syncConfig: {
3154        fetch: async () => {
3155          return external_wp_apiFetch_default()({
3156            path: '/wp/v2/settings'
3157          });
3158        },
3159        applyChangesToDoc: (doc, changes) => {
3160          const document = doc.getMap('document');
3161          Object.entries(changes).forEach(([key, value]) => {
3162            if (document.get(key) !== value) {
3163              document.set(key, value);
3164            }
3165          });
3166        },
3167        fromCRDTDoc: doc => {
3168          return doc.getMap('document').toJSON();
3169        }
3170      },
3171      syncObjectType: 'root/site',
3172      getSyncObjectId: () => 'index',
3173      meta: {}
3174    };
3175    const site = await external_wp_apiFetch_default()({
3176      path: entity.baseURL,
3177      method: 'OPTIONS'
3178    });
3179    const labels = {};
3180    Object.entries((_site$schema$properti = site?.schema?.properties) !== null && _site$schema$properti !== void 0 ? _site$schema$properti : {}).forEach(([key, value]) => {
3181      // Ignore properties `title` and `type` keys.
3182      if (typeof value === 'object' && value.title) {
3183        labels[key] = value.title;
3184      }
3185    });
3186    return [{
3187      ...entity,
3188      meta: {
3189        labels
3190      }
3191    }];
3192  }
3193  
3194  /**
3195   * Returns the entity's getter method name given its kind and name or plural name.
3196   *
3197   * @example
3198   * ```js
3199   * const nameSingular = getMethodName( 'root', 'theme', 'get' );
3200   * // nameSingular is getRootTheme
3201   *
3202   * const namePlural = getMethodName( 'root', 'themes', 'set' );
3203   * // namePlural is setRootThemes
3204   * ```
3205   *
3206   * @param {string} kind   Entity kind.
3207   * @param {string} name   Entity name or plural name.
3208   * @param {string} prefix Function prefix.
3209   *
3210   * @return {string} Method name
3211   */
3212  const getMethodName = (kind, name, prefix = 'get') => {
3213    const kindPrefix = kind === 'root' ? '' : pascalCase(kind);
3214    const suffix = pascalCase(name);
3215    return `$prefix}$kindPrefix}$suffix}`;
3216  };
3217  function registerSyncConfigs(configs) {
3218    configs.forEach(({
3219      syncObjectType,
3220      syncConfig
3221    }) => {
3222      getSyncProvider().register(syncObjectType, syncConfig);
3223      const editSyncConfig = {
3224        ...syncConfig
3225      };
3226      delete editSyncConfig.fetch;
3227      getSyncProvider().register(syncObjectType + '--edit', editSyncConfig);
3228    });
3229  }
3230  
3231  /**
3232   * Loads the entities into the store.
3233   *
3234   * Note: The `name` argument is used for `root` entities requiring additional server data.
3235   *
3236   * @param {string} kind Kind
3237   * @param {string} name Name
3238   * @return {(thunkArgs: object) => Promise<Array>} Entities
3239   */
3240  const getOrLoadEntitiesConfig = (kind, name) => async ({
3241    select,
3242    dispatch
3243  }) => {
3244    let configs = select.getEntitiesConfig(kind);
3245    const hasConfig = !!select.getEntityConfig(kind, name);
3246    if (configs?.length > 0 && hasConfig) {
3247      if (window.__experimentalEnableSync) {
3248        if (false) {}
3249      }
3250      return configs;
3251    }
3252    const loader = additionalEntityConfigLoaders.find(l => {
3253      if (!name || !l.name) {
3254        return l.kind === kind;
3255      }
3256      return l.kind === kind && l.name === name;
3257    });
3258    if (!loader) {
3259      return [];
3260    }
3261    configs = await loader.loadEntities();
3262    if (window.__experimentalEnableSync) {
3263      if (false) {}
3264    }
3265    dispatch(addEntities(configs));
3266    return configs;
3267  };
3268  
3269  ;// ./node_modules/@wordpress/core-data/build-module/utils/get-normalized-comma-separable.js
3270  /**
3271   * Given a value which can be specified as one or the other of a comma-separated
3272   * string or an array, returns a value normalized to an array of strings, or
3273   * null if the value cannot be interpreted as either.
3274   *
3275   * @param {string|string[]|*} value
3276   *
3277   * @return {?(string[])} Normalized field value.
3278   */
3279  function getNormalizedCommaSeparable(value) {
3280    if (typeof value === 'string') {
3281      return value.split(',');
3282    } else if (Array.isArray(value)) {
3283      return value;
3284    }
3285    return null;
3286  }
3287  /* harmony default export */ const get_normalized_comma_separable = (getNormalizedCommaSeparable);
3288  
3289  ;// ./node_modules/@wordpress/core-data/build-module/utils/with-weak-map-cache.js
3290  /**
3291   * Given a function, returns an enhanced function which caches the result and
3292   * tracks in WeakMap. The result is only cached if the original function is
3293   * passed a valid object-like argument (requirement for WeakMap key).
3294   *
3295   * @param {Function} fn Original function.
3296   *
3297   * @return {Function} Enhanced caching function.
3298   */
3299  function withWeakMapCache(fn) {
3300    const cache = new WeakMap();
3301    return key => {
3302      let value;
3303      if (cache.has(key)) {
3304        value = cache.get(key);
3305      } else {
3306        value = fn(key);
3307  
3308        // Can reach here if key is not valid for WeakMap, since `has`
3309        // will return false for invalid key. Since `set` will throw,
3310        // ensure that key is valid before setting into cache.
3311        if (key !== null && typeof key === 'object') {
3312          cache.set(key, value);
3313        }
3314      }
3315      return value;
3316    };
3317  }
3318  /* harmony default export */ const with_weak_map_cache = (withWeakMapCache);
3319  
3320  ;// ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js
3321  /**
3322   * WordPress dependencies
3323   */
3324  
3325  
3326  /**
3327   * Internal dependencies
3328   */
3329  
3330  
3331  /**
3332   * An object of properties describing a specific query.
3333   *
3334   * @typedef {Object} WPQueriedDataQueryParts
3335   *
3336   * @property {number}      page      The query page (1-based index, default 1).
3337   * @property {number}      perPage   Items per page for query (default 10).
3338   * @property {string}      stableKey An encoded stable string of all non-
3339   *                                   pagination, non-fields query parameters.
3340   * @property {?(string[])} fields    Target subset of fields to derive from
3341   *                                   item objects.
3342   * @property {?(number[])} include   Specific item IDs to include.
3343   * @property {string}      context   Scope under which the request is made;
3344   *                                   determines returned fields in response.
3345   */
3346  
3347  /**
3348   * Given a query object, returns an object of parts, including pagination
3349   * details (`page` and `perPage`, or default values). All other properties are
3350   * encoded into a stable (idempotent) `stableKey` value.
3351   *
3352   * @param {Object} query Optional query object.
3353   *
3354   * @return {WPQueriedDataQueryParts} Query parts.
3355   */
3356  function getQueryParts(query) {
3357    /**
3358     * @type {WPQueriedDataQueryParts}
3359     */
3360    const parts = {
3361      stableKey: '',
3362      page: 1,
3363      perPage: 10,
3364      fields: null,
3365      include: null,
3366      context: 'default'
3367    };
3368  
3369    // Ensure stable key by sorting keys. Also more efficient for iterating.
3370    const keys = Object.keys(query).sort();
3371    for (let i = 0; i < keys.length; i++) {
3372      const key = keys[i];
3373      let value = query[key];
3374      switch (key) {
3375        case 'page':
3376          parts[key] = Number(value);
3377          break;
3378        case 'per_page':
3379          parts.perPage = Number(value);
3380          break;
3381        case 'context':
3382          parts.context = value;
3383          break;
3384        default:
3385          // While in theory, we could exclude "_fields" from the stableKey
3386          // because two request with different fields have the same results
3387          // We're not able to ensure that because the server can decide to omit
3388          // fields from the response even if we explicitly asked for it.
3389          // Example: Asking for titles in posts without title support.
3390          if (key === '_fields') {
3391            var _getNormalizedCommaSe;
3392            parts.fields = (_getNormalizedCommaSe = get_normalized_comma_separable(value)) !== null && _getNormalizedCommaSe !== void 0 ? _getNormalizedCommaSe : [];
3393            // Make sure to normalize value for `stableKey`
3394            value = parts.fields.join();
3395          }
3396  
3397          // Two requests with different include values cannot have same results.
3398          if (key === 'include') {
3399            var _getNormalizedCommaSe2;
3400            if (typeof value === 'number') {
3401              value = value.toString();
3402            }
3403            parts.include = ((_getNormalizedCommaSe2 = get_normalized_comma_separable(value)) !== null && _getNormalizedCommaSe2 !== void 0 ? _getNormalizedCommaSe2 : []).map(Number);
3404            // Normalize value for `stableKey`.
3405            value = parts.include.join();
3406          }
3407  
3408          // While it could be any deterministic string, for simplicity's
3409          // sake mimic querystring encoding for stable key.
3410          //
3411          // TODO: For consistency with PHP implementation, addQueryArgs
3412          // should accept a key value pair, which may optimize its
3413          // implementation for our use here, vs. iterating an object
3414          // with only a single key.
3415          parts.stableKey += (parts.stableKey ? '&' : '') + (0,external_wp_url_namespaceObject.addQueryArgs)('', {
3416            [key]: value
3417          }).slice(1);
3418      }
3419    }
3420    return parts;
3421  }
3422  /* harmony default export */ const get_query_parts = (with_weak_map_cache(getQueryParts));
3423  
3424  ;// ./node_modules/@wordpress/core-data/build-module/queried-data/reducer.js
3425  /**
3426   * WordPress dependencies
3427   */
3428  
3429  
3430  
3431  /**
3432   * Internal dependencies
3433   */
3434  
3435  
3436  
3437  function getContextFromAction(action) {
3438    const {
3439      query
3440    } = action;
3441    if (!query) {
3442      return 'default';
3443    }
3444    const queryParts = get_query_parts(query);
3445    return queryParts.context;
3446  }
3447  
3448  /**
3449   * Returns a merged array of item IDs, given details of the received paginated
3450   * items. The array is sparse-like with `undefined` entries where holes exist.
3451   *
3452   * @param {?Array<number>} itemIds     Original item IDs (default empty array).
3453   * @param {number[]}       nextItemIds Item IDs to merge.
3454   * @param {number}         page        Page of items merged.
3455   * @param {number}         perPage     Number of items per page.
3456   *
3457   * @return {number[]} Merged array of item IDs.
3458   */
3459  function getMergedItemIds(itemIds, nextItemIds, page, perPage) {
3460    var _itemIds$length;
3461    const receivedAllIds = page === 1 && perPage === -1;
3462    if (receivedAllIds) {
3463      return nextItemIds;
3464    }
3465    const nextItemIdsStartIndex = (page - 1) * perPage;
3466  
3467    // If later page has already been received, default to the larger known
3468    // size of the existing array, else calculate as extending the existing.
3469    const size = Math.max((_itemIds$length = itemIds?.length) !== null && _itemIds$length !== void 0 ? _itemIds$length : 0, nextItemIdsStartIndex + nextItemIds.length);
3470  
3471    // Preallocate array since size is known.
3472    const mergedItemIds = new Array(size);
3473    for (let i = 0; i < size; i++) {
3474      // Preserve existing item ID except for subset of range of next items.
3475      // We need to check against the possible maximum upper boundary because
3476      // a page could receive fewer than what was previously stored.
3477      const isInNextItemsRange = i >= nextItemIdsStartIndex && i < nextItemIdsStartIndex + perPage;
3478      mergedItemIds[i] = isInNextItemsRange ? nextItemIds[i - nextItemIdsStartIndex] : itemIds?.[i];
3479    }
3480    return mergedItemIds;
3481  }
3482  
3483  /**
3484   * Helper function to filter out entities with certain IDs.
3485   * Entities are keyed by their ID.
3486   *
3487   * @param {Object} entities Entity objects, keyed by entity ID.
3488   * @param {Array}  ids      Entity IDs to filter out.
3489   *
3490   * @return {Object} Filtered entities.
3491   */
3492  function removeEntitiesById(entities, ids) {
3493    return Object.fromEntries(Object.entries(entities).filter(([id]) => !ids.some(itemId => {
3494      if (Number.isInteger(itemId)) {
3495        return itemId === +id;
3496      }
3497      return itemId === id;
3498    })));
3499  }
3500  
3501  /**
3502   * Reducer tracking items state, keyed by ID. Items are assumed to be normal,
3503   * where identifiers are common across all queries.
3504   *
3505   * @param {Object} state  Current state.
3506   * @param {Object} action Dispatched action.
3507   *
3508   * @return {Object} Next state.
3509   */
3510  function items(state = {}, action) {
3511    switch (action.type) {
3512      case 'RECEIVE_ITEMS':
3513        {
3514          const context = getContextFromAction(action);
3515          const key = action.key || DEFAULT_ENTITY_KEY;
3516          return {
3517            ...state,
3518            [context]: {
3519              ...state[context],
3520              ...action.items.reduce((accumulator, value) => {
3521                const itemId = value?.[key];
3522                accumulator[itemId] = conservativeMapItem(state?.[context]?.[itemId], value);
3523                return accumulator;
3524              }, {})
3525            }
3526          };
3527        }
3528      case 'REMOVE_ITEMS':
3529        return Object.fromEntries(Object.entries(state).map(([itemId, contextState]) => [itemId, removeEntitiesById(contextState, action.itemIds)]));
3530    }
3531    return state;
3532  }
3533  
3534  /**
3535   * Reducer tracking item completeness, keyed by ID. A complete item is one for
3536   * which all fields are known. This is used in supporting `_fields` queries,
3537   * where not all properties associated with an entity are necessarily returned.
3538   * In such cases, completeness is used as an indication of whether it would be
3539   * safe to use queried data for a non-`_fields`-limited request.
3540   *
3541   * @param {Object<string,Object<string,boolean>>} state  Current state.
3542   * @param {Object}                                action Dispatched action.
3543   *
3544   * @return {Object<string,Object<string,boolean>>} Next state.
3545   */
3546  function itemIsComplete(state = {}, action) {
3547    switch (action.type) {
3548      case 'RECEIVE_ITEMS':
3549        {
3550          const context = getContextFromAction(action);
3551          const {
3552            query,
3553            key = DEFAULT_ENTITY_KEY
3554          } = action;
3555  
3556          // An item is considered complete if it is received without an associated
3557          // fields query. Ideally, this would be implemented in such a way where the
3558          // complete aggregate of all fields would satisfy completeness. Since the
3559          // fields are not consistent across all entities, this would require
3560          // introspection on the REST schema for each entity to know which fields
3561          // compose a complete item for that entity.
3562          const queryParts = query ? get_query_parts(query) : {};
3563          const isCompleteQuery = !query || !Array.isArray(queryParts.fields);
3564          return {
3565            ...state,
3566            [context]: {
3567              ...state[context],
3568              ...action.items.reduce((result, item) => {
3569                const itemId = item?.[key];
3570  
3571                // Defer to completeness if already assigned. Technically the
3572                // data may be outdated if receiving items for a field subset.
3573                result[itemId] = state?.[context]?.[itemId] || isCompleteQuery;
3574                return result;
3575              }, {})
3576            }
3577          };
3578        }
3579      case 'REMOVE_ITEMS':
3580        return Object.fromEntries(Object.entries(state).map(([itemId, contextState]) => [itemId, removeEntitiesById(contextState, action.itemIds)]));
3581    }
3582    return state;
3583  }
3584  
3585  /**
3586   * Reducer tracking queries state, keyed by stable query key. Each reducer
3587   * query object includes `itemIds` and `requestingPageByPerPage`.
3588   *
3589   * @param {Object} state  Current state.
3590   * @param {Object} action Dispatched action.
3591   *
3592   * @return {Object} Next state.
3593   */
3594  const receiveQueries = (0,external_wp_compose_namespaceObject.compose)([
3595  // Limit to matching action type so we don't attempt to replace action on
3596  // an unhandled action.
3597  if_matching_action(action => 'query' in action),
3598  // Inject query parts into action for use both in `onSubKey` and reducer.
3599  replace_action(action => {
3600    // `ifMatchingAction` still passes on initialization, where state is
3601    // undefined and a query is not assigned. Avoid attempting to parse
3602    // parts. `onSubKey` will omit by lack of `stableKey`.
3603    if (action.query) {
3604      return {
3605        ...action,
3606        ...get_query_parts(action.query)
3607      };
3608    }
3609    return action;
3610  }), on_sub_key('context'),
3611  // Queries shape is shared, but keyed by query `stableKey` part. Original
3612  // reducer tracks only a single query object.
3613  on_sub_key('stableKey')])((state = {}, action) => {
3614    const {
3615      type,
3616      page,
3617      perPage,
3618      key = DEFAULT_ENTITY_KEY
3619    } = action;
3620    if (type !== 'RECEIVE_ITEMS') {
3621      return state;
3622    }
3623    return {
3624      itemIds: getMergedItemIds(state?.itemIds || [], action.items.map(item => item?.[key]).filter(Boolean), page, perPage),
3625      meta: action.meta
3626    };
3627  });
3628  
3629  /**
3630   * Reducer tracking queries state.
3631   *
3632   * @param {Object} state  Current state.
3633   * @param {Object} action Dispatched action.
3634   *
3635   * @return {Object} Next state.
3636   */
3637  const queries = (state = {}, action) => {
3638    switch (action.type) {
3639      case 'RECEIVE_ITEMS':
3640        return receiveQueries(state, action);
3641      case 'REMOVE_ITEMS':
3642        const removedItems = action.itemIds.reduce((result, itemId) => {
3643          result[itemId] = true;
3644          return result;
3645        }, {});
3646        return Object.fromEntries(Object.entries(state).map(([queryGroup, contextQueries]) => [queryGroup, Object.fromEntries(Object.entries(contextQueries).map(([query, queryItems]) => [query, {
3647          ...queryItems,
3648          itemIds: queryItems.itemIds.filter(queryId => !removedItems[queryId])
3649        }]))]));
3650      default:
3651        return state;
3652    }
3653  };
3654  /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
3655    items,
3656    itemIsComplete,
3657    queries
3658  }));
3659  
3660  ;// ./node_modules/@wordpress/core-data/build-module/reducer.js
3661  /**
3662   * External dependencies
3663   */
3664  
3665  
3666  /**
3667   * WordPress dependencies
3668   */
3669  
3670  
3671  
3672  
3673  /**
3674   * Internal dependencies
3675   */
3676  
3677  
3678  
3679  
3680  /** @typedef {import('./types').AnyFunction} AnyFunction */
3681  
3682  /**
3683   * Reducer managing terms state. Keyed by taxonomy slug, the value is either
3684   * undefined (if no request has been made for given taxonomy), null (if a
3685   * request is in-flight for given taxonomy), or the array of terms for the
3686   * taxonomy.
3687   *
3688   * @param {Object} state  Current state.
3689   * @param {Object} action Dispatched action.
3690   *
3691   * @return {Object} Updated state.
3692   */
3693  function terms(state = {}, action) {
3694    switch (action.type) {
3695      case 'RECEIVE_TERMS':
3696        return {
3697          ...state,
3698          [action.taxonomy]: action.terms
3699        };
3700    }
3701    return state;
3702  }
3703  
3704  /**
3705   * Reducer managing authors state. Keyed by id.
3706   *
3707   * @param {Object} state  Current state.
3708   * @param {Object} action Dispatched action.
3709   *
3710   * @return {Object} Updated state.
3711   */
3712  function users(state = {
3713    byId: {},
3714    queries: {}
3715  }, action) {
3716    switch (action.type) {
3717      case 'RECEIVE_USER_QUERY':
3718        return {
3719          byId: {
3720            ...state.byId,
3721            // Key users by their ID.
3722            ...action.users.reduce((newUsers, user) => ({
3723              ...newUsers,
3724              [user.id]: user
3725            }), {})
3726          },
3727          queries: {
3728            ...state.queries,
3729            [action.queryID]: action.users.map(user => user.id)
3730          }
3731        };
3732    }
3733    return state;
3734  }
3735  
3736  /**
3737   * Reducer managing current user state.
3738   *
3739   * @param {Object} state  Current state.
3740   * @param {Object} action Dispatched action.
3741   *
3742   * @return {Object} Updated state.
3743   */
3744  function currentUser(state = {}, action) {
3745    switch (action.type) {
3746      case 'RECEIVE_CURRENT_USER':
3747        return action.currentUser;
3748    }
3749    return state;
3750  }
3751  
3752  /**
3753   * Reducer managing taxonomies.
3754   *
3755   * @param {Object} state  Current state.
3756   * @param {Object} action Dispatched action.
3757   *
3758   * @return {Object} Updated state.
3759   */
3760  function taxonomies(state = [], action) {
3761    switch (action.type) {
3762      case 'RECEIVE_TAXONOMIES':
3763        return action.taxonomies;
3764    }
3765    return state;
3766  }
3767  
3768  /**
3769   * Reducer managing the current theme.
3770   *
3771   * @param {string|undefined} state  Current state.
3772   * @param {Object}           action Dispatched action.
3773   *
3774   * @return {string|undefined} Updated state.
3775   */
3776  function currentTheme(state = undefined, action) {
3777    switch (action.type) {
3778      case 'RECEIVE_CURRENT_THEME':
3779        return action.currentTheme.stylesheet;
3780    }
3781    return state;
3782  }
3783  
3784  /**
3785   * Reducer managing the current global styles id.
3786   *
3787   * @param {string|undefined} state  Current state.
3788   * @param {Object}           action Dispatched action.
3789   *
3790   * @return {string|undefined} Updated state.
3791   */
3792  function currentGlobalStylesId(state = undefined, action) {
3793    switch (action.type) {
3794      case 'RECEIVE_CURRENT_GLOBAL_STYLES_ID':
3795        return action.id;
3796    }
3797    return state;
3798  }
3799  
3800  /**
3801   * Reducer managing the theme base global styles.
3802   *
3803   * @param {Record<string, object>} state  Current state.
3804   * @param {Object}                 action Dispatched action.
3805   *
3806   * @return {Record<string, object>} Updated state.
3807   */
3808  function themeBaseGlobalStyles(state = {}, action) {
3809    switch (action.type) {
3810      case 'RECEIVE_THEME_GLOBAL_STYLES':
3811        return {
3812          ...state,
3813          [action.stylesheet]: action.globalStyles
3814        };
3815    }
3816    return state;
3817  }
3818  
3819  /**
3820   * Reducer managing the theme global styles variations.
3821   *
3822   * @param {Record<string, object>} state  Current state.
3823   * @param {Object}                 action Dispatched action.
3824   *
3825   * @return {Record<string, object>} Updated state.
3826   */
3827  function themeGlobalStyleVariations(state = {}, action) {
3828    switch (action.type) {
3829      case 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS':
3830        return {
3831          ...state,
3832          [action.stylesheet]: action.variations
3833        };
3834    }
3835    return state;
3836  }
3837  const withMultiEntityRecordEdits = reducer => (state, action) => {
3838    if (action.type === 'UNDO' || action.type === 'REDO') {
3839      const {
3840        record
3841      } = action;
3842      let newState = state;
3843      record.forEach(({
3844        id: {
3845          kind,
3846          name,
3847          recordId
3848        },
3849        changes
3850      }) => {
3851        newState = reducer(newState, {
3852          type: 'EDIT_ENTITY_RECORD',
3853          kind,
3854          name,
3855          recordId,
3856          edits: Object.entries(changes).reduce((acc, [key, value]) => {
3857            acc[key] = action.type === 'UNDO' ? value.from : value.to;
3858            return acc;
3859          }, {})
3860        });
3861      });
3862      return newState;
3863    }
3864    return reducer(state, action);
3865  };
3866  
3867  /**
3868   * Higher Order Reducer for a given entity config. It supports:
3869   *
3870   *  - Fetching
3871   *  - Editing
3872   *  - Saving
3873   *
3874   * @param {Object} entityConfig Entity config.
3875   *
3876   * @return {AnyFunction} Reducer.
3877   */
3878  function entity(entityConfig) {
3879    return (0,external_wp_compose_namespaceObject.compose)([withMultiEntityRecordEdits,
3880    // Limit to matching action type so we don't attempt to replace action on
3881    // an unhandled action.
3882    if_matching_action(action => action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind),
3883    // Inject the entity config into the action.
3884    replace_action(action => {
3885      return {
3886        key: entityConfig.key || DEFAULT_ENTITY_KEY,
3887        ...action
3888      };
3889    })])((0,external_wp_data_namespaceObject.combineReducers)({
3890      queriedData: reducer,
3891      edits: (state = {}, action) => {
3892        var _action$query$context;
3893        switch (action.type) {
3894          case 'RECEIVE_ITEMS':
3895            const context = (_action$query$context = action?.query?.context) !== null && _action$query$context !== void 0 ? _action$query$context : 'default';
3896            if (context !== 'default') {
3897              return state;
3898            }
3899            const nextState = {
3900              ...state
3901            };
3902            for (const record of action.items) {
3903              const recordId = record?.[action.key];
3904              const edits = nextState[recordId];
3905              if (!edits) {
3906                continue;
3907              }
3908              const nextEdits = Object.keys(edits).reduce((acc, key) => {
3909                var _record$key$raw;
3910                // If the edited value is still different to the persisted value,
3911                // keep the edited value in edits.
3912                if (
3913                // Edits are the "raw" attribute values, but records may have
3914                // objects with more properties, so we use `get` here for the
3915                // comparison.
3916                !es6_default()(edits[key], (_record$key$raw = record[key]?.raw) !== null && _record$key$raw !== void 0 ? _record$key$raw : record[key]) && (
3917                // Sometimes the server alters the sent value which means
3918                // we need to also remove the edits before the api request.
3919                !action.persistedEdits || !es6_default()(edits[key], action.persistedEdits[key]))) {
3920                  acc[key] = edits[key];
3921                }
3922                return acc;
3923              }, {});
3924              if (Object.keys(nextEdits).length) {
3925                nextState[recordId] = nextEdits;
3926              } else {
3927                delete nextState[recordId];
3928              }
3929            }
3930            return nextState;
3931          case 'EDIT_ENTITY_RECORD':
3932            const nextEdits = {
3933              ...state[action.recordId],
3934              ...action.edits
3935            };
3936            Object.keys(nextEdits).forEach(key => {
3937              // Delete cleared edits so that the properties
3938              // are not considered dirty.
3939              if (nextEdits[key] === undefined) {
3940                delete nextEdits[key];
3941              }
3942            });
3943            return {
3944              ...state,
3945              [action.recordId]: nextEdits
3946            };
3947        }
3948        return state;
3949      },
3950      saving: (state = {}, action) => {
3951        switch (action.type) {
3952          case 'SAVE_ENTITY_RECORD_START':
3953          case 'SAVE_ENTITY_RECORD_FINISH':
3954            return {
3955              ...state,
3956              [action.recordId]: {
3957                pending: action.type === 'SAVE_ENTITY_RECORD_START',
3958                error: action.error,
3959                isAutosave: action.isAutosave
3960              }
3961            };
3962        }
3963        return state;
3964      },
3965      deleting: (state = {}, action) => {
3966        switch (action.type) {
3967          case 'DELETE_ENTITY_RECORD_START':
3968          case 'DELETE_ENTITY_RECORD_FINISH':
3969            return {
3970              ...state,
3971              [action.recordId]: {
3972                pending: action.type === 'DELETE_ENTITY_RECORD_START',
3973                error: action.error
3974              }
3975            };
3976        }
3977        return state;
3978      },
3979      revisions: (state = {}, action) => {
3980        // Use the same queriedDataReducer shape for revisions.
3981        if (action.type === 'RECEIVE_ITEM_REVISIONS') {
3982          const recordKey = action.recordKey;
3983          delete action.recordKey;
3984          const newState = reducer(state[recordKey], {
3985            ...action,
3986            type: 'RECEIVE_ITEMS'
3987          });
3988          return {
3989            ...state,
3990            [recordKey]: newState
3991          };
3992        }
3993        if (action.type === 'REMOVE_ITEMS') {
3994          return Object.fromEntries(Object.entries(state).filter(([id]) => !action.itemIds.some(itemId => {
3995            if (Number.isInteger(itemId)) {
3996              return itemId === +id;
3997            }
3998            return itemId === id;
3999          })));
4000        }
4001        return state;
4002      }
4003    }));
4004  }
4005  
4006  /**
4007   * Reducer keeping track of the registered entities.
4008   *
4009   * @param {Object} state  Current state.
4010   * @param {Object} action Dispatched action.
4011   *
4012   * @return {Object} Updated state.
4013   */
4014  function entitiesConfig(state = rootEntitiesConfig, action) {
4015    switch (action.type) {
4016      case 'ADD_ENTITIES':
4017        return [...state, ...action.entities];
4018    }
4019    return state;
4020  }
4021  
4022  /**
4023   * Reducer keeping track of the registered entities config and data.
4024   *
4025   * @param {Object} state  Current state.
4026   * @param {Object} action Dispatched action.
4027   *
4028   * @return {Object} Updated state.
4029   */
4030  const entities = (state = {}, action) => {
4031    const newConfig = entitiesConfig(state.config, action);
4032  
4033    // Generates a dynamic reducer for the entities.
4034    let entitiesDataReducer = state.reducer;
4035    if (!entitiesDataReducer || newConfig !== state.config) {
4036      const entitiesByKind = newConfig.reduce((acc, record) => {
4037        const {
4038          kind
4039        } = record;
4040        if (!acc[kind]) {
4041          acc[kind] = [];
4042        }
4043        acc[kind].push(record);
4044        return acc;
4045      }, {});
4046      entitiesDataReducer = (0,external_wp_data_namespaceObject.combineReducers)(Object.entries(entitiesByKind).reduce((memo, [kind, subEntities]) => {
4047        const kindReducer = (0,external_wp_data_namespaceObject.combineReducers)(subEntities.reduce((kindMemo, entityConfig) => ({
4048          ...kindMemo,
4049          [entityConfig.name]: entity(entityConfig)
4050        }), {}));
4051        memo[kind] = kindReducer;
4052        return memo;
4053      }, {}));
4054    }
4055    const newData = entitiesDataReducer(state.records, action);
4056    if (newData === state.records && newConfig === state.config && entitiesDataReducer === state.reducer) {
4057      return state;
4058    }
4059    return {
4060      reducer: entitiesDataReducer,
4061      records: newData,
4062      config: newConfig
4063    };
4064  };
4065  
4066  /**
4067   * @type {UndoManager}
4068   */
4069  function undoManager(state = (0,build_module.createUndoManager)()) {
4070    return state;
4071  }
4072  function editsReference(state = {}, action) {
4073    switch (action.type) {
4074      case 'EDIT_ENTITY_RECORD':
4075      case 'UNDO':
4076      case 'REDO':
4077        return {};
4078    }
4079    return state;
4080  }
4081  
4082  /**
4083   * Reducer managing embed preview data.
4084   *
4085   * @param {Object} state  Current state.
4086   * @param {Object} action Dispatched action.
4087   *
4088   * @return {Object} Updated state.
4089   */
4090  function embedPreviews(state = {}, action) {
4091    switch (action.type) {
4092      case 'RECEIVE_EMBED_PREVIEW':
4093        const {
4094          url,
4095          preview
4096        } = action;
4097        return {
4098          ...state,
4099          [url]: preview
4100        };
4101    }
4102    return state;
4103  }
4104  
4105  /**
4106   * State which tracks whether the user can perform an action on a REST
4107   * resource.
4108   *
4109   * @param {Object} state  Current state.
4110   * @param {Object} action Dispatched action.
4111   *
4112   * @return {Object} Updated state.
4113   */
4114  function userPermissions(state = {}, action) {
4115    switch (action.type) {
4116      case 'RECEIVE_USER_PERMISSION':
4117        return {
4118          ...state,
4119          [action.key]: action.isAllowed
4120        };
4121      case 'RECEIVE_USER_PERMISSIONS':
4122        return {
4123          ...state,
4124          ...action.permissions
4125        };
4126    }
4127    return state;
4128  }
4129  
4130  /**
4131   * Reducer returning autosaves keyed by their parent's post id.
4132   *
4133   * @param {Object} state  Current state.
4134   * @param {Object} action Dispatched action.
4135   *
4136   * @return {Object} Updated state.
4137   */
4138  function autosaves(state = {}, action) {
4139    switch (action.type) {
4140      case 'RECEIVE_AUTOSAVES':
4141        const {
4142          postId,
4143          autosaves: autosavesData
4144        } = action;
4145        return {
4146          ...state,
4147          [postId]: autosavesData
4148        };
4149    }
4150    return state;
4151  }
4152  function blockPatterns(state = [], action) {
4153    switch (action.type) {
4154      case 'RECEIVE_BLOCK_PATTERNS':
4155        return action.patterns;
4156    }
4157    return state;
4158  }
4159  function blockPatternCategories(state = [], action) {
4160    switch (action.type) {
4161      case 'RECEIVE_BLOCK_PATTERN_CATEGORIES':
4162        return action.categories;
4163    }
4164    return state;
4165  }
4166  function userPatternCategories(state = [], action) {
4167    switch (action.type) {
4168      case 'RECEIVE_USER_PATTERN_CATEGORIES':
4169        return action.patternCategories;
4170    }
4171    return state;
4172  }
4173  function navigationFallbackId(state = null, action) {
4174    switch (action.type) {
4175      case 'RECEIVE_NAVIGATION_FALLBACK_ID':
4176        return action.fallbackId;
4177    }
4178    return state;
4179  }
4180  
4181  /**
4182   * Reducer managing the theme global styles revisions.
4183   *
4184   * @param {Record<string, object>} state  Current state.
4185   * @param {Object}                 action Dispatched action.
4186   *
4187   * @return {Record<string, object>} Updated state.
4188   */
4189  function themeGlobalStyleRevisions(state = {}, action) {
4190    switch (action.type) {
4191      case 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS':
4192        return {
4193          ...state,
4194          [action.currentId]: action.revisions
4195        };
4196    }
4197    return state;
4198  }
4199  
4200  /**
4201   * Reducer managing the template lookup per query.
4202   *
4203   * @param {Record<string, string>} state  Current state.
4204   * @param {Object}                 action Dispatched action.
4205   *
4206   * @return {Record<string, string>} Updated state.
4207   */
4208  function defaultTemplates(state = {}, action) {
4209    switch (action.type) {
4210      case 'RECEIVE_DEFAULT_TEMPLATE':
4211        return {
4212          ...state,
4213          [JSON.stringify(action.query)]: action.templateId
4214        };
4215    }
4216    return state;
4217  }
4218  
4219  /**
4220   * Reducer returning an object of registered post meta.
4221   *
4222   * @param {Object} state  Current state.
4223   * @param {Object} action Dispatched action.
4224   *
4225   * @return {Object} Updated state.
4226   */
4227  function registeredPostMeta(state = {}, action) {
4228    switch (action.type) {
4229      case 'RECEIVE_REGISTERED_POST_META':
4230        return {
4231          ...state,
4232          [action.postType]: action.registeredPostMeta
4233        };
4234    }
4235    return state;
4236  }
4237  /* harmony default export */ const build_module_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
4238    terms,
4239    users,
4240    currentTheme,
4241    currentGlobalStylesId,
4242    currentUser,
4243    themeGlobalStyleVariations,
4244    themeBaseGlobalStyles,
4245    themeGlobalStyleRevisions,
4246    taxonomies,
4247    entities,
4248    editsReference,
4249    undoManager,
4250    embedPreviews,
4251    userPermissions,
4252    autosaves,
4253    blockPatterns,
4254    blockPatternCategories,
4255    userPatternCategories,
4256    navigationFallbackId,
4257    defaultTemplates,
4258    registeredPostMeta
4259  }));
4260  
4261  // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
4262  var equivalent_key_map = __webpack_require__(3249);
4263  var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
4264  ;// ./node_modules/@wordpress/core-data/build-module/queried-data/selectors.js
4265  /**
4266   * External dependencies
4267   */
4268  
4269  
4270  /**
4271   * WordPress dependencies
4272   */
4273  
4274  
4275  /**
4276   * Internal dependencies
4277   */
4278  
4279  
4280  
4281  /**
4282   * Cache of state keys to EquivalentKeyMap where the inner map tracks queries
4283   * to their resulting items set. WeakMap allows garbage collection on expired
4284   * state references.
4285   *
4286   * @type {WeakMap<Object,EquivalentKeyMap>}
4287   */
4288  const queriedItemsCacheByState = new WeakMap();
4289  
4290  /**
4291   * Returns items for a given query, or null if the items are not known.
4292   *
4293   * @param {Object}  state State object.
4294   * @param {?Object} query Optional query.
4295   *
4296   * @return {?Array} Query items.
4297   */
4298  function getQueriedItemsUncached(state, query) {
4299    const {
4300      stableKey,
4301      page,
4302      perPage,
4303      include,
4304      fields,
4305      context
4306    } = get_query_parts(query);
4307    let itemIds;
4308    if (state.queries?.[context]?.[stableKey]) {
4309      itemIds = state.queries[context][stableKey].itemIds;
4310    }
4311    if (!itemIds) {
4312      return null;
4313    }
4314    const startOffset = perPage === -1 ? 0 : (page - 1) * perPage;
4315    const endOffset = perPage === -1 ? itemIds.length : Math.min(startOffset + perPage, itemIds.length);
4316    const items = [];
4317    for (let i = startOffset; i < endOffset; i++) {
4318      const itemId = itemIds[i];
4319      if (Array.isArray(include) && !include.includes(itemId)) {
4320        continue;
4321      }
4322      if (itemId === undefined) {
4323        continue;
4324      }
4325      // Having a target item ID doesn't guarantee that this object has been queried.
4326      if (!state.items[context]?.hasOwnProperty(itemId)) {
4327        return null;
4328      }
4329      const item = state.items[context][itemId];
4330      let filteredItem;
4331      if (Array.isArray(fields)) {
4332        filteredItem = {};
4333        for (let f = 0; f < fields.length; f++) {
4334          const field = fields[f].split('.');
4335          let value = item;
4336          field.forEach(fieldName => {
4337            value = value?.[fieldName];
4338          });
4339          setNestedValue(filteredItem, field, value);
4340        }
4341      } else {
4342        // If expecting a complete item, validate that completeness, or
4343        // otherwise abort.
4344        if (!state.itemIsComplete[context]?.[itemId]) {
4345          return null;
4346        }
4347        filteredItem = item;
4348      }
4349      items.push(filteredItem);
4350    }
4351    return items;
4352  }
4353  
4354  /**
4355   * Returns items for a given query, or null if the items are not known. Caches
4356   * result both per state (by reference) and per query (by deep equality).
4357   * The caching approach is intended to be durable to query objects which are
4358   * deeply but not referentially equal, since otherwise:
4359   *
4360   * `getQueriedItems( state, {} ) !== getQueriedItems( state, {} )`
4361   *
4362   * @param {Object}  state State object.
4363   * @param {?Object} query Optional query.
4364   *
4365   * @return {?Array} Query items.
4366   */
4367  const getQueriedItems = (0,external_wp_data_namespaceObject.createSelector)((state, query = {}) => {
4368    let queriedItemsCache = queriedItemsCacheByState.get(state);
4369    if (queriedItemsCache) {
4370      const queriedItems = queriedItemsCache.get(query);
4371      if (queriedItems !== undefined) {
4372        return queriedItems;
4373      }
4374    } else {
4375      queriedItemsCache = new (equivalent_key_map_default())();
4376      queriedItemsCacheByState.set(state, queriedItemsCache);
4377    }
4378    const items = getQueriedItemsUncached(state, query);
4379    queriedItemsCache.set(query, items);
4380    return items;
4381  });
4382  function getQueriedTotalItems(state, query = {}) {
4383    var _state$queries$contex;
4384    const {
4385      stableKey,
4386      context
4387    } = get_query_parts(query);
4388    return (_state$queries$contex = state.queries?.[context]?.[stableKey]?.meta?.totalItems) !== null && _state$queries$contex !== void 0 ? _state$queries$contex : null;
4389  }
4390  function getQueriedTotalPages(state, query = {}) {
4391    var _state$queries$contex2;
4392    const {
4393      stableKey,
4394      context
4395    } = get_query_parts(query);
4396    return (_state$queries$contex2 = state.queries?.[context]?.[stableKey]?.meta?.totalPages) !== null && _state$queries$contex2 !== void 0 ? _state$queries$contex2 : null;
4397  }
4398  
4399  ;// ./node_modules/@wordpress/core-data/build-module/utils/is-numeric-id.js
4400  /**
4401   * Checks argument to determine if it's a numeric ID.
4402   * For example, '123' is a numeric ID, but '123abc' is not.
4403   *
4404   * @param {any} id the argument to determine if it's a numeric ID.
4405   * @return {boolean} true if the string is a numeric ID, false otherwise.
4406   */
4407  function isNumericID(id) {
4408    return /^\s*\d+\s*$/.test(id);
4409  }
4410  
4411  ;// ./node_modules/@wordpress/core-data/build-module/utils/is-raw-attribute.js
4412  /**
4413   * Checks whether the attribute is a "raw" attribute or not.
4414   *
4415   * @param {Object} entity    Entity record.
4416   * @param {string} attribute Attribute name.
4417   *
4418   * @return {boolean} Is the attribute raw
4419   */
4420  function isRawAttribute(entity, attribute) {
4421    return (entity.rawAttributes || []).includes(attribute);
4422  }
4423  
4424  ;// ./node_modules/@wordpress/core-data/build-module/utils/user-permissions.js
4425  const ALLOWED_RESOURCE_ACTIONS = ['create', 'read', 'update', 'delete'];
4426  function getUserPermissionsFromAllowHeader(allowedMethods) {
4427    const permissions = {};
4428    if (!allowedMethods) {
4429      return permissions;
4430    }
4431    const methods = {
4432      create: 'POST',
4433      read: 'GET',
4434      update: 'PUT',
4435      delete: 'DELETE'
4436    };
4437    for (const [actionName, methodName] of Object.entries(methods)) {
4438      permissions[actionName] = allowedMethods.includes(methodName);
4439    }
4440    return permissions;
4441  }
4442  function getUserPermissionCacheKey(action, resource, id) {
4443    const key = (typeof resource === 'object' ? [action, resource.kind, resource.name, resource.id] : [action, resource, id]).filter(Boolean).join('/');
4444    return key;
4445  }
4446  
4447  ;// ./node_modules/@wordpress/core-data/build-module/selectors.js
4448  /**
4449   * WordPress dependencies
4450   */
4451  
4452  
4453  
4454  
4455  /**
4456   * Internal dependencies
4457   */
4458  
4459  
4460  
4461  
4462  
4463  // This is an incomplete, high-level approximation of the State type.
4464  // It makes the selectors slightly more safe, but is intended to evolve
4465  // into a more detailed representation over time.
4466  // See https://github.com/WordPress/gutenberg/pull/40025#discussion_r865410589 for more context.
4467  
4468  /**
4469   * HTTP Query parameters sent with the API request to fetch the entity records.
4470   */
4471  
4472  /**
4473   * Arguments for EntityRecord selectors.
4474   */
4475  
4476  /**
4477   * Shared reference to an empty object for cases where it is important to avoid
4478   * returning a new object reference on every invocation, as in a connected or
4479   * other pure component which performs `shouldComponentUpdate` check on props.
4480   * This should be used as a last resort, since the normalized data should be
4481   * maintained by the reducer result in state.
4482   */
4483  const EMPTY_OBJECT = {};
4484  
4485  /**
4486   * Returns true if a request is in progress for embed preview data, or false
4487   * otherwise.
4488   *
4489   * @param state Data state.
4490   * @param url   URL the preview would be for.
4491   *
4492   * @return Whether a request is in progress for an embed preview.
4493   */
4494  const isRequestingEmbedPreview = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, url) => {
4495    return select(STORE_NAME).isResolving('getEmbedPreview', [url]);
4496  });
4497  
4498  /**
4499   * Returns all available authors.
4500   *
4501   * @deprecated since 11.3. Callers should use `select( 'core' ).getUsers({ who: 'authors' })` instead.
4502   *
4503   * @param      state Data state.
4504   * @param      query Optional object of query parameters to
4505   *                   include with request. For valid query parameters see the [Users page](https://developer.wordpress.org/rest-api/reference/users/) in the REST API Handbook and see the arguments for [List Users](https://developer.wordpress.org/rest-api/reference/users/#list-users) and [Retrieve a User](https://developer.wordpress.org/rest-api/reference/users/#retrieve-a-user).
4506   * @return Authors list.
4507   */
4508  function getAuthors(state, query) {
4509    external_wp_deprecated_default()("select( 'core' ).getAuthors()", {
4510      since: '5.9',
4511      alternative: "select( 'core' ).getUsers({ who: 'authors' })"
4512    });
4513    const path = (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/users/?who=authors&per_page=100', query);
4514    return getUserQueryResults(state, path);
4515  }
4516  
4517  /**
4518   * Returns the current user.
4519   *
4520   * @param state Data state.
4521   *
4522   * @return Current user object.
4523   */
4524  function getCurrentUser(state) {
4525    return state.currentUser;
4526  }
4527  
4528  /**
4529   * Returns all the users returned by a query ID.
4530   *
4531   * @param state   Data state.
4532   * @param queryID Query ID.
4533   *
4534   * @return Users list.
4535   */
4536  const getUserQueryResults = (0,external_wp_data_namespaceObject.createSelector)((state, queryID) => {
4537    var _state$users$queries$;
4538    const queryResults = (_state$users$queries$ = state.users.queries[queryID]) !== null && _state$users$queries$ !== void 0 ? _state$users$queries$ : [];
4539    return queryResults.map(id => state.users.byId[id]);
4540  }, (state, queryID) => [state.users.queries[queryID], state.users.byId]);
4541  
4542  /**
4543   * Returns the loaded entities for the given kind.
4544   *
4545   * @deprecated since WordPress 6.0. Use getEntitiesConfig instead
4546   * @param      state Data state.
4547   * @param      kind  Entity kind.
4548   *
4549   * @return Array of entities with config matching kind.
4550   */
4551  function getEntitiesByKind(state, kind) {
4552    external_wp_deprecated_default()("wp.data.select( 'core' ).getEntitiesByKind()", {
4553      since: '6.0',
4554      alternative: "wp.data.select( 'core' ).getEntitiesConfig()"
4555    });
4556    return getEntitiesConfig(state, kind);
4557  }
4558  
4559  /**
4560   * Returns the loaded entities for the given kind.
4561   *
4562   * @param state Data state.
4563   * @param kind  Entity kind.
4564   *
4565   * @return Array of entities with config matching kind.
4566   */
4567  const getEntitiesConfig = (0,external_wp_data_namespaceObject.createSelector)((state, kind) => state.entities.config.filter(entity => entity.kind === kind), /* eslint-disable @typescript-eslint/no-unused-vars */
4568  (state, kind) => state.entities.config
4569  /* eslint-enable @typescript-eslint/no-unused-vars */);
4570  /**
4571   * Returns the entity config given its kind and name.
4572   *
4573   * @deprecated since WordPress 6.0. Use getEntityConfig instead
4574   * @param      state Data state.
4575   * @param      kind  Entity kind.
4576   * @param      name  Entity name.
4577   *
4578   * @return Entity config
4579   */
4580  function getEntity(state, kind, name) {
4581    external_wp_deprecated_default()("wp.data.select( 'core' ).getEntity()", {
4582      since: '6.0',
4583      alternative: "wp.data.select( 'core' ).getEntityConfig()"
4584    });
4585    return getEntityConfig(state, kind, name);
4586  }
4587  
4588  /**
4589   * Returns the entity config given its kind and name.
4590   *
4591   * @param state Data state.
4592   * @param kind  Entity kind.
4593   * @param name  Entity name.
4594   *
4595   * @return Entity config
4596   */
4597  function getEntityConfig(state, kind, name) {
4598    return state.entities.config?.find(config => config.kind === kind && config.name === name);
4599  }
4600  
4601  /**
4602   * GetEntityRecord is declared as a *callable interface* with
4603   * two signatures to work around the fact that TypeScript doesn't
4604   * allow currying generic functions:
4605   *
4606   * ```ts
4607   *         type CurriedState = F extends ( state: any, ...args: infer P ) => infer R
4608   *             ? ( ...args: P ) => R
4609   *             : F;
4610   *         type Selector = <K extends string | number>(
4611   *         state: any,
4612   *         kind: K,
4613   *         key: K extends string ? 'string value' : false
4614   *    ) => K;
4615   *         type BadlyInferredSignature = CurriedState< Selector >
4616   *    // BadlyInferredSignature evaluates to:
4617   *    // (kind: string number, key: false | "string value") => string number
4618   * ```
4619   *
4620   * The signature without the state parameter shipped as CurriedSignature
4621   * is used in the return value of `select( coreStore )`.
4622   *
4623   * See https://github.com/WordPress/gutenberg/pull/41578 for more details.
4624   */
4625  
4626  /**
4627   * Returns the Entity's record object by key. Returns `null` if the value is not
4628   * yet received, undefined if the value entity is known to not exist, or the
4629   * entity object if it exists and is received.
4630   *
4631   * @param state State tree
4632   * @param kind  Entity kind.
4633   * @param name  Entity name.
4634   * @param key   Record's key
4635   * @param query Optional query. If requesting specific
4636   *              fields, fields must always include the ID. For valid query parameters see the [Reference](https://developer.wordpress.org/rest-api/reference/) in the REST API Handbook and select the entity kind. Then see the arguments available "Retrieve a [Entity kind]".
4637   *
4638   * @return Record.
4639   */
4640  const getEntityRecord = (0,external_wp_data_namespaceObject.createSelector)((state, kind, name, key, query) => {
4641    var _query$context;
4642    const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
4643    if (!queriedState) {
4644      return undefined;
4645    }
4646    const context = (_query$context = query?.context) !== null && _query$context !== void 0 ? _query$context : 'default';
4647    if (query === undefined) {
4648      // If expecting a complete item, validate that completeness.
4649      if (!queriedState.itemIsComplete[context]?.[key]) {
4650        return undefined;
4651      }
4652      return queriedState.items[context][key];
4653    }
4654    const item = queriedState.items[context]?.[key];
4655    if (item && query._fields) {
4656      var _getNormalizedCommaSe;
4657      const filteredItem = {};
4658      const fields = (_getNormalizedCommaSe = get_normalized_comma_separable(query._fields)) !== null && _getNormalizedCommaSe !== void 0 ? _getNormalizedCommaSe : [];
4659      for (let f = 0; f < fields.length; f++) {
4660        const field = fields[f].split('.');
4661        let value = item;
4662        field.forEach(fieldName => {
4663          value = value?.[fieldName];
4664        });
4665        setNestedValue(filteredItem, field, value);
4666      }
4667      return filteredItem;
4668    }
4669    return item;
4670  }, (state, kind, name, recordId, query) => {
4671    var _query$context2;
4672    const context = (_query$context2 = query?.context) !== null && _query$context2 !== void 0 ? _query$context2 : 'default';
4673    return [state.entities.records?.[kind]?.[name]?.queriedData?.items[context]?.[recordId], state.entities.records?.[kind]?.[name]?.queriedData?.itemIsComplete[context]?.[recordId]];
4674  });
4675  
4676  /**
4677   * Normalizes `recordKey`s that look like numeric IDs to numbers.
4678   *
4679   * @param args EntityRecordArgs the selector arguments.
4680   * @return EntityRecordArgs the normalized arguments.
4681   */
4682  getEntityRecord.__unstableNormalizeArgs = args => {
4683    const newArgs = [...args];
4684    const recordKey = newArgs?.[2];
4685  
4686    // If recordKey looks to be a numeric ID then coerce to number.
4687    newArgs[2] = isNumericID(recordKey) ? Number(recordKey) : recordKey;
4688    return newArgs;
4689  };
4690  
4691  /**
4692   * Returns the Entity's record object by key. Doesn't trigger a resolver nor requests the entity records from the API if the entity record isn't available in the local state.
4693   *
4694   * @param state State tree
4695   * @param kind  Entity kind.
4696   * @param name  Entity name.
4697   * @param key   Record's key
4698   *
4699   * @return Record.
4700   */
4701  function __experimentalGetEntityRecordNoResolver(state, kind, name, key) {
4702    return getEntityRecord(state, kind, name, key);
4703  }
4704  
4705  /**
4706   * Returns the entity's record object by key,
4707   * with its attributes mapped to their raw values.
4708   *
4709   * @param state State tree.
4710   * @param kind  Entity kind.
4711   * @param name  Entity name.
4712   * @param key   Record's key.
4713   *
4714   * @return Object with the entity's raw attributes.
4715   */
4716  const getRawEntityRecord = (0,external_wp_data_namespaceObject.createSelector)((state, kind, name, key) => {
4717    const record = getEntityRecord(state, kind, name, key);
4718    return record && Object.keys(record).reduce((accumulator, _key) => {
4719      if (isRawAttribute(getEntityConfig(state, kind, name), _key)) {
4720        var _record$_key$raw;
4721        // Because edits are the "raw" attribute values,
4722        // we return those from record selectors to make rendering,
4723        // comparisons, and joins with edits easier.
4724        accumulator[_key] = (_record$_key$raw = record[_key]?.raw) !== null && _record$_key$raw !== void 0 ? _record$_key$raw : record[_key];
4725      } else {
4726        accumulator[_key] = record[_key];
4727      }
4728      return accumulator;
4729    }, {});
4730  }, (state, kind, name, recordId, query) => {
4731    var _query$context3;
4732    const context = (_query$context3 = query?.context) !== null && _query$context3 !== void 0 ? _query$context3 : 'default';
4733    return [state.entities.config, state.entities.records?.[kind]?.[name]?.queriedData?.items[context]?.[recordId], state.entities.records?.[kind]?.[name]?.queriedData?.itemIsComplete[context]?.[recordId]];
4734  });
4735  
4736  /**
4737   * Returns true if records have been received for the given set of parameters,
4738   * or false otherwise.
4739   *
4740   * @param state State tree
4741   * @param kind  Entity kind.
4742   * @param name  Entity name.
4743   * @param query Optional terms query. For valid query parameters see the [Reference](https://developer.wordpress.org/rest-api/reference/) in the REST API Handbook and select the entity kind. Then see the arguments available for "List [Entity kind]s".
4744   *
4745   * @return  Whether entity records have been received.
4746   */
4747  function hasEntityRecords(state, kind, name, query) {
4748    return Array.isArray(getEntityRecords(state, kind, name, query));
4749  }
4750  
4751  /**
4752   * GetEntityRecord is declared as a *callable interface* with
4753   * two signatures to work around the fact that TypeScript doesn't
4754   * allow currying generic functions.
4755   *
4756   * @see GetEntityRecord
4757   * @see https://github.com/WordPress/gutenberg/pull/41578
4758   */
4759  
4760  /**
4761   * Returns the Entity's records.
4762   *
4763   * @param state State tree
4764   * @param kind  Entity kind.
4765   * @param name  Entity name.
4766   * @param query Optional terms query. If requesting specific
4767   *              fields, fields must always include the ID. For valid query parameters see the [Reference](https://developer.wordpress.org/rest-api/reference/) in the REST API Handbook and select the entity kind. Then see the arguments available for "List [Entity kind]s".
4768   *
4769   * @return Records.
4770   */
4771  const getEntityRecords = (state, kind, name, query) => {
4772    // Queried data state is prepopulated for all known entities. If this is not
4773    // assigned for the given parameters, then it is known to not exist.
4774    const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
4775    if (!queriedState) {
4776      return null;
4777    }
4778    return getQueriedItems(queriedState, query);
4779  };
4780  
4781  /**
4782   * Returns the Entity's total available records for a given query (ignoring pagination).
4783   *
4784   * @param state State tree
4785   * @param kind  Entity kind.
4786   * @param name  Entity name.
4787   * @param query Optional terms query. If requesting specific
4788   *              fields, fields must always include the ID. For valid query parameters see the [Reference](https://developer.wordpress.org/rest-api/reference/) in the REST API Handbook and select the entity kind. Then see the arguments available for "List [Entity kind]s".
4789   *
4790   * @return number | null.
4791   */
4792  const getEntityRecordsTotalItems = (state, kind, name, query) => {
4793    // Queried data state is prepopulated for all known entities. If this is not
4794    // assigned for the given parameters, then it is known to not exist.
4795    const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
4796    if (!queriedState) {
4797      return null;
4798    }
4799    return getQueriedTotalItems(queriedState, query);
4800  };
4801  
4802  /**
4803   * Returns the number of available pages for the given query.
4804   *
4805   * @param state State tree
4806   * @param kind  Entity kind.
4807   * @param name  Entity name.
4808   * @param query Optional terms query. If requesting specific
4809   *              fields, fields must always include the ID. For valid query parameters see the [Reference](https://developer.wordpress.org/rest-api/reference/) in the REST API Handbook and select the entity kind. Then see the arguments available for "List [Entity kind]s".
4810   *
4811   * @return number | null.
4812   */
4813  const getEntityRecordsTotalPages = (state, kind, name, query) => {
4814    // Queried data state is prepopulated for all known entities. If this is not
4815    // assigned for the given parameters, then it is known to not exist.
4816    const queriedState = state.entities.records?.[kind]?.[name]?.queriedData;
4817    if (!queriedState) {
4818      return null;
4819    }
4820    if (query.per_page === -1) {
4821      return 1;
4822    }
4823    const totalItems = getQueriedTotalItems(queriedState, query);
4824    if (!totalItems) {
4825      return totalItems;
4826    }
4827    // If `per_page` is not set and the query relies on the defaults of the
4828    // REST endpoint, get the info from query's meta.
4829    if (!query.per_page) {
4830      return getQueriedTotalPages(queriedState, query);
4831    }
4832    return Math.ceil(totalItems / query.per_page);
4833  };
4834  /**
4835   * Returns the list of dirty entity records.
4836   *
4837   * @param state State tree.
4838   *
4839   * @return The list of updated records
4840   */
4841  const __experimentalGetDirtyEntityRecords = (0,external_wp_data_namespaceObject.createSelector)(state => {
4842    const {
4843      entities: {
4844        records
4845      }
4846    } = state;
4847    const dirtyRecords = [];
4848    Object.keys(records).forEach(kind => {
4849      Object.keys(records[kind]).forEach(name => {
4850        const primaryKeys = Object.keys(records[kind][name].edits).filter(primaryKey =>
4851        // The entity record must exist (not be deleted),
4852        // and it must have edits.
4853        getEntityRecord(state, kind, name, primaryKey) && hasEditsForEntityRecord(state, kind, name, primaryKey));
4854        if (primaryKeys.length) {
4855          const entityConfig = getEntityConfig(state, kind, name);
4856          primaryKeys.forEach(primaryKey => {
4857            const entityRecord = getEditedEntityRecord(state, kind, name, primaryKey);
4858            dirtyRecords.push({
4859              // We avoid using primaryKey because it's transformed into a string
4860              // when it's used as an object key.
4861              key: entityRecord ? entityRecord[entityConfig.key || DEFAULT_ENTITY_KEY] : undefined,
4862              title: entityConfig?.getTitle?.(entityRecord) || '',
4863              name,
4864              kind
4865            });
4866          });
4867        }
4868      });
4869    });
4870    return dirtyRecords;
4871  }, state => [state.entities.records]);
4872  
4873  /**
4874   * Returns the list of entities currently being saved.
4875   *
4876   * @param state State tree.
4877   *
4878   * @return The list of records being saved.
4879   */
4880  const __experimentalGetEntitiesBeingSaved = (0,external_wp_data_namespaceObject.createSelector)(state => {
4881    const {
4882      entities: {
4883        records
4884      }
4885    } = state;
4886    const recordsBeingSaved = [];
4887    Object.keys(records).forEach(kind => {
4888      Object.keys(records[kind]).forEach(name => {
4889        const primaryKeys = Object.keys(records[kind][name].saving).filter(primaryKey => isSavingEntityRecord(state, kind, name, primaryKey));
4890        if (primaryKeys.length) {
4891          const entityConfig = getEntityConfig(state, kind, name);
4892          primaryKeys.forEach(primaryKey => {
4893            const entityRecord = getEditedEntityRecord(state, kind, name, primaryKey);
4894            recordsBeingSaved.push({
4895              // We avoid using primaryKey because it's transformed into a string
4896              // when it's used as an object key.
4897              key: entityRecord ? entityRecord[entityConfig.key || DEFAULT_ENTITY_KEY] : undefined,
4898              title: entityConfig?.getTitle?.(entityRecord) || '',
4899              name,
4900              kind
4901            });
4902          });
4903        }
4904      });
4905    });
4906    return recordsBeingSaved;
4907  }, state => [state.entities.records]);
4908  
4909  /**
4910   * Returns the specified entity record's edits.
4911   *
4912   * @param state    State tree.
4913   * @param kind     Entity kind.
4914   * @param name     Entity name.
4915   * @param recordId Record ID.
4916   *
4917   * @return The entity record's edits.
4918   */
4919  function getEntityRecordEdits(state, kind, name, recordId) {
4920    return state.entities.records?.[kind]?.[name]?.edits?.[recordId];
4921  }
4922  
4923  /**
4924   * Returns the specified entity record's non transient edits.
4925   *
4926   * Transient edits don't create an undo level, and
4927   * are not considered for change detection.
4928   * They are defined in the entity's config.
4929   *
4930   * @param state    State tree.
4931   * @param kind     Entity kind.
4932   * @param name     Entity name.
4933   * @param recordId Record ID.
4934   *
4935   * @return The entity record's non transient edits.
4936   */
4937  const getEntityRecordNonTransientEdits = (0,external_wp_data_namespaceObject.createSelector)((state, kind, name, recordId) => {
4938    const {
4939      transientEdits
4940    } = getEntityConfig(state, kind, name) || {};
4941    const edits = getEntityRecordEdits(state, kind, name, recordId) || {};
4942    if (!transientEdits) {
4943      return edits;
4944    }
4945    return Object.keys(edits).reduce((acc, key) => {
4946      if (!transientEdits[key]) {
4947        acc[key] = edits[key];
4948      }
4949      return acc;
4950    }, {});
4951  }, (state, kind, name, recordId) => [state.entities.config, state.entities.records?.[kind]?.[name]?.edits?.[recordId]]);
4952  
4953  /**
4954   * Returns true if the specified entity record has edits,
4955   * and false otherwise.
4956   *
4957   * @param state    State tree.
4958   * @param kind     Entity kind.
4959   * @param name     Entity name.
4960   * @param recordId Record ID.
4961   *
4962   * @return Whether the entity record has edits or not.
4963   */
4964  function hasEditsForEntityRecord(state, kind, name, recordId) {
4965    return isSavingEntityRecord(state, kind, name, recordId) || Object.keys(getEntityRecordNonTransientEdits(state, kind, name, recordId)).length > 0;
4966  }
4967  
4968  /**
4969   * Returns the specified entity record, merged with its edits.
4970   *
4971   * @param state    State tree.
4972   * @param kind     Entity kind.
4973   * @param name     Entity name.
4974   * @param recordId Record ID.
4975   *
4976   * @return The entity record, merged with its edits.
4977   */
4978  const getEditedEntityRecord = (0,external_wp_data_namespaceObject.createSelector)((state, kind, name, recordId) => {
4979    const raw = getRawEntityRecord(state, kind, name, recordId);
4980    const edited = getEntityRecordEdits(state, kind, name, recordId);
4981    // Never return a non-falsy empty object. Unfortunately we can't return
4982    // undefined or null because we were previously returning an empty
4983    // object, so trying to read properties from the result would throw.
4984    // Using false here is a workaround to avoid breaking changes.
4985    if (!raw && !edited) {
4986      return false;
4987    }
4988    return {
4989      ...raw,
4990      ...edited
4991    };
4992  }, (state, kind, name, recordId, query) => {
4993    var _query$context4;
4994    const context = (_query$context4 = query?.context) !== null && _query$context4 !== void 0 ? _query$context4 : 'default';
4995    return [state.entities.config, state.entities.records?.[kind]?.[name]?.queriedData.items[context]?.[recordId], state.entities.records?.[kind]?.[name]?.queriedData.itemIsComplete[context]?.[recordId], state.entities.records?.[kind]?.[name]?.edits?.[recordId]];
4996  });
4997  
4998  /**
4999   * Returns true if the specified entity record is autosaving, and false otherwise.
5000   *
5001   * @param state    State tree.
5002   * @param kind     Entity kind.
5003   * @param name     Entity name.
5004   * @param recordId Record ID.
5005   *
5006   * @return Whether the entity record is autosaving or not.
5007   */
5008  function isAutosavingEntityRecord(state, kind, name, recordId) {
5009    var _state$entities$recor;
5010    const {
5011      pending,
5012      isAutosave
5013    } = (_state$entities$recor = state.entities.records?.[kind]?.[name]?.saving?.[recordId]) !== null && _state$entities$recor !== void 0 ? _state$entities$recor : {};
5014    return Boolean(pending && isAutosave);
5015  }
5016  
5017  /**
5018   * Returns true if the specified entity record is saving, and false otherwise.
5019   *
5020   * @param state    State tree.
5021   * @param kind     Entity kind.
5022   * @param name     Entity name.
5023   * @param recordId Record ID.
5024   *
5025   * @return Whether the entity record is saving or not.
5026   */
5027  function isSavingEntityRecord(state, kind, name, recordId) {
5028    var _state$entities$recor2;
5029    return (_state$entities$recor2 = state.entities.records?.[kind]?.[name]?.saving?.[recordId]?.pending) !== null && _state$entities$recor2 !== void 0 ? _state$entities$recor2 : false;
5030  }
5031  
5032  /**
5033   * Returns true if the specified entity record is deleting, and false otherwise.
5034   *
5035   * @param state    State tree.
5036   * @param kind     Entity kind.
5037   * @param name     Entity name.
5038   * @param recordId Record ID.
5039   *
5040   * @return Whether the entity record is deleting or not.
5041   */
5042  function isDeletingEntityRecord(state, kind, name, recordId) {
5043    var _state$entities$recor3;
5044    return (_state$entities$recor3 = state.entities.records?.[kind]?.[name]?.deleting?.[recordId]?.pending) !== null && _state$entities$recor3 !== void 0 ? _state$entities$recor3 : false;
5045  }
5046  
5047  /**
5048   * Returns the specified entity record's last save error.
5049   *
5050   * @param state    State tree.
5051   * @param kind     Entity kind.
5052   * @param name     Entity name.
5053   * @param recordId Record ID.
5054   *
5055   * @return The entity record's save error.
5056   */
5057  function getLastEntitySaveError(state, kind, name, recordId) {
5058    return state.entities.records?.[kind]?.[name]?.saving?.[recordId]?.error;
5059  }
5060  
5061  /**
5062   * Returns the specified entity record's last delete error.
5063   *
5064   * @param state    State tree.
5065   * @param kind     Entity kind.
5066   * @param name     Entity name.
5067   * @param recordId Record ID.
5068   *
5069   * @return The entity record's save error.
5070   */
5071  function getLastEntityDeleteError(state, kind, name, recordId) {
5072    return state.entities.records?.[kind]?.[name]?.deleting?.[recordId]?.error;
5073  }
5074  
5075  /* eslint-disable @typescript-eslint/no-unused-vars */
5076  /**
5077   * Returns the previous edit from the current undo offset
5078   * for the entity records edits history, if any.
5079   *
5080   * @deprecated since 6.3
5081   *
5082   * @param      state State tree.
5083   *
5084   * @return The edit.
5085   */
5086  function getUndoEdit(state) {
5087    external_wp_deprecated_default()("select( 'core' ).getUndoEdit()", {
5088      since: '6.3'
5089    });
5090    return undefined;
5091  }
5092  /* eslint-enable @typescript-eslint/no-unused-vars */
5093  
5094  /* eslint-disable @typescript-eslint/no-unused-vars */
5095  /**
5096   * Returns the next edit from the current undo offset
5097   * for the entity records edits history, if any.
5098   *
5099   * @deprecated since 6.3
5100   *
5101   * @param      state State tree.
5102   *
5103   * @return The edit.
5104   */
5105  function getRedoEdit(state) {
5106    external_wp_deprecated_default()("select( 'core' ).getRedoEdit()", {
5107      since: '6.3'
5108    });
5109    return undefined;
5110  }
5111  /* eslint-enable @typescript-eslint/no-unused-vars */
5112  
5113  /**
5114   * Returns true if there is a previous edit from the current undo offset
5115   * for the entity records edits history, and false otherwise.
5116   *
5117   * @param state State tree.
5118   *
5119   * @return Whether there is a previous edit or not.
5120   */
5121  function hasUndo(state) {
5122    return state.undoManager.hasUndo();
5123  }
5124  
5125  /**
5126   * Returns true if there is a next edit from the current undo offset
5127   * for the entity records edits history, and false otherwise.
5128   *
5129   * @param state State tree.
5130   *
5131   * @return Whether there is a next edit or not.
5132   */
5133  function hasRedo(state) {
5134    return state.undoManager.hasRedo();
5135  }
5136  
5137  /**
5138   * Return the current theme.
5139   *
5140   * @param state Data state.
5141   *
5142   * @return The current theme.
5143   */
5144  function getCurrentTheme(state) {
5145    if (!state.currentTheme) {
5146      return null;
5147    }
5148    return getEntityRecord(state, 'root', 'theme', state.currentTheme);
5149  }
5150  
5151  /**
5152   * Return the ID of the current global styles object.
5153   *
5154   * @param state Data state.
5155   *
5156   * @return The current global styles ID.
5157   */
5158  function __experimentalGetCurrentGlobalStylesId(state) {
5159    return state.currentGlobalStylesId;
5160  }
5161  
5162  /**
5163   * Return theme supports data in the index.
5164   *
5165   * @param state Data state.
5166   *
5167   * @return Index data.
5168   */
5169  function getThemeSupports(state) {
5170    var _getCurrentTheme$them;
5171    return (_getCurrentTheme$them = getCurrentTheme(state)?.theme_supports) !== null && _getCurrentTheme$them !== void 0 ? _getCurrentTheme$them : EMPTY_OBJECT;
5172  }
5173  
5174  /**
5175   * Returns the embed preview for the given URL.
5176   *
5177   * @param state Data state.
5178   * @param url   Embedded URL.
5179   *
5180   * @return Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.
5181   */
5182  function getEmbedPreview(state, url) {
5183    return state.embedPreviews[url];
5184  }
5185  
5186  /**
5187   * Determines if the returned preview is an oEmbed link fallback.
5188   *
5189   * WordPress can be configured to return a simple link to a URL if it is not embeddable.
5190   * We need to be able to determine if a URL is embeddable or not, based on what we
5191   * get back from the oEmbed preview API.
5192   *
5193   * @param state Data state.
5194   * @param url   Embedded URL.
5195   *
5196   * @return Is the preview for the URL an oEmbed link fallback.
5197   */
5198  function isPreviewEmbedFallback(state, url) {
5199    const preview = state.embedPreviews[url];
5200    const oEmbedLinkCheck = '<a href="' + url + '">' + url + '</a>';
5201    if (!preview) {
5202      return false;
5203    }
5204    return preview.html === oEmbedLinkCheck;
5205  }
5206  
5207  /**
5208   * Returns whether the current user can perform the given action on the given
5209   * REST resource.
5210   *
5211   * Calling this may trigger an OPTIONS request to the REST API via the
5212   * `canUser()` resolver.
5213   *
5214   * https://developer.wordpress.org/rest-api/reference/
5215   *
5216   * @param state    Data state.
5217   * @param action   Action to check. One of: 'create', 'read', 'update', 'delete'.
5218   * @param resource Entity resource to check. Accepts entity object `{ kind: 'root', name: 'media', id: 1 }`
5219   *                 or REST base as a string - `media`.
5220   * @param id       Optional ID of the rest resource to check.
5221   *
5222   * @return Whether or not the user can perform the action,
5223   *                             or `undefined` if the OPTIONS request is still being made.
5224   */
5225  function canUser(state, action, resource, id) {
5226    const isEntity = typeof resource === 'object';
5227    if (isEntity && (!resource.kind || !resource.name)) {
5228      return false;
5229    }
5230    const key = getUserPermissionCacheKey(action, resource, id);
5231    return state.userPermissions[key];
5232  }
5233  
5234  /**
5235   * Returns whether the current user can edit the given entity.
5236   *
5237   * Calling this may trigger an OPTIONS request to the REST API via the
5238   * `canUser()` resolver.
5239   *
5240   * https://developer.wordpress.org/rest-api/reference/
5241   *
5242   * @param state    Data state.
5243   * @param kind     Entity kind.
5244   * @param name     Entity name.
5245   * @param recordId Record's id.
5246   * @return Whether or not the user can edit,
5247   * or `undefined` if the OPTIONS request is still being made.
5248   */
5249  function canUserEditEntityRecord(state, kind, name, recordId) {
5250    external_wp_deprecated_default()(`wp.data.select( 'core' ).canUserEditEntityRecord()`, {
5251      since: '6.7',
5252      alternative: `wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )`
5253    });
5254    return canUser(state, 'update', {
5255      kind,
5256      name,
5257      id: recordId
5258    });
5259  }
5260  
5261  /**
5262   * Returns the latest autosaves for the post.
5263   *
5264   * May return multiple autosaves since the backend stores one autosave per
5265   * author for each post.
5266   *
5267   * @param state    State tree.
5268   * @param postType The type of the parent post.
5269   * @param postId   The id of the parent post.
5270   *
5271   * @return An array of autosaves for the post, or undefined if there is none.
5272   */
5273  function getAutosaves(state, postType, postId) {
5274    return state.autosaves[postId];
5275  }
5276  
5277  /**
5278   * Returns the autosave for the post and author.
5279   *
5280   * @param state    State tree.
5281   * @param postType The type of the parent post.
5282   * @param postId   The id of the parent post.
5283   * @param authorId The id of the author.
5284   *
5285   * @return The autosave for the post and author.
5286   */
5287  function getAutosave(state, postType, postId, authorId) {
5288    if (authorId === undefined) {
5289      return;
5290    }
5291    const autosaves = state.autosaves[postId];
5292    return autosaves?.find(autosave => autosave.author === authorId);
5293  }
5294  
5295  /**
5296   * Returns true if the REST request for autosaves has completed.
5297   *
5298   * @param state    State tree.
5299   * @param postType The type of the parent post.
5300   * @param postId   The id of the parent post.
5301   *
5302   * @return True if the REST request was completed. False otherwise.
5303   */
5304  const hasFetchedAutosaves = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, postId) => {
5305    return select(STORE_NAME).hasFinishedResolution('getAutosaves', [postType, postId]);
5306  });
5307  
5308  /**
5309   * Returns a new reference when edited values have changed. This is useful in
5310   * inferring where an edit has been made between states by comparison of the
5311   * return values using strict equality.
5312   *
5313   * @example
5314   *
5315   * ```
5316   * const hasEditOccurred = (
5317   *    getReferenceByDistinctEdits( beforeState ) !==
5318   *    getReferenceByDistinctEdits( afterState )
5319   * );
5320   * ```
5321   *
5322   * @param state Editor state.
5323   *
5324   * @return A value whose reference will change only when an edit occurs.
5325   */
5326  function getReferenceByDistinctEdits(state) {
5327    return state.editsReference;
5328  }
5329  
5330  /**
5331   * Retrieve the frontend template used for a given link.
5332   *
5333   * @param state Editor state.
5334   * @param link  Link.
5335   *
5336   * @return The template record.
5337   */
5338  function __experimentalGetTemplateForLink(state, link) {
5339    const records = getEntityRecords(state, 'postType', 'wp_template', {
5340      'find-template': link
5341    });
5342    if (records?.length) {
5343      return getEditedEntityRecord(state, 'postType', 'wp_template', records[0].id);
5344    }
5345    return null;
5346  }
5347  
5348  /**
5349   * Retrieve the current theme's base global styles
5350   *
5351   * @param state Editor state.
5352   *
5353   * @return The Global Styles object.
5354   */
5355  function __experimentalGetCurrentThemeBaseGlobalStyles(state) {
5356    const currentTheme = getCurrentTheme(state);
5357    if (!currentTheme) {
5358      return null;
5359    }
5360    return state.themeBaseGlobalStyles[currentTheme.stylesheet];
5361  }
5362  
5363  /**
5364   * Return the ID of the current global styles object.
5365   *
5366   * @param state Data state.
5367   *
5368   * @return The current global styles ID.
5369   */
5370  function __experimentalGetCurrentThemeGlobalStylesVariations(state) {
5371    const currentTheme = getCurrentTheme(state);
5372    if (!currentTheme) {
5373      return null;
5374    }
5375    return state.themeGlobalStyleVariations[currentTheme.stylesheet];
5376  }
5377  
5378  /**
5379   * Retrieve the list of registered block patterns.
5380   *
5381   * @param state Data state.
5382   *
5383   * @return Block pattern list.
5384   */
5385  function getBlockPatterns(state) {
5386    return state.blockPatterns;
5387  }
5388  
5389  /**
5390   * Retrieve the list of registered block pattern categories.
5391   *
5392   * @param state Data state.
5393   *
5394   * @return Block pattern category list.
5395   */
5396  function getBlockPatternCategories(state) {
5397    return state.blockPatternCategories;
5398  }
5399  
5400  /**
5401   * Retrieve the registered user pattern categories.
5402   *
5403   * @param state Data state.
5404   *
5405   * @return User patterns category array.
5406   */
5407  
5408  function getUserPatternCategories(state) {
5409    return state.userPatternCategories;
5410  }
5411  
5412  /**
5413   * Returns the revisions of the current global styles theme.
5414   *
5415   * @deprecated since WordPress 6.5.0. Callers should use `select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )` instead, where `recordKey` is the id of the global styles parent post.
5416   *
5417   * @param      state Data state.
5418   *
5419   * @return The current global styles.
5420   */
5421  function getCurrentThemeGlobalStylesRevisions(state) {
5422    external_wp_deprecated_default()("select( 'core' ).getCurrentThemeGlobalStylesRevisions()", {
5423      since: '6.5.0',
5424      alternative: "select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"
5425    });
5426    const currentGlobalStylesId = __experimentalGetCurrentGlobalStylesId(state);
5427    if (!currentGlobalStylesId) {
5428      return null;
5429    }
5430    return state.themeGlobalStyleRevisions[currentGlobalStylesId];
5431  }
5432  
5433  /**
5434   * Returns the default template use to render a given query.
5435   *
5436   * @param state Data state.
5437   * @param query Query.
5438   *
5439   * @return The default template id for the given query.
5440   */
5441  function getDefaultTemplateId(state, query) {
5442    return state.defaultTemplates[JSON.stringify(query)];
5443  }
5444  
5445  /**
5446   * Returns an entity's revisions.
5447   *
5448   * @param state     State tree
5449   * @param kind      Entity kind.
5450   * @param name      Entity name.
5451   * @param recordKey The key of the entity record whose revisions you want to fetch.
5452   * @param query     Optional query. If requesting specific
5453   *                  fields, fields must always include the ID. For valid query parameters see revisions schema in [the REST API Handbook](https://developer.wordpress.org/rest-api/reference/). Then see the arguments available "Retrieve a [Entity kind]".
5454   *
5455   * @return Record.
5456   */
5457  const getRevisions = (state, kind, name, recordKey, query) => {
5458    const queriedStateRevisions = state.entities.records?.[kind]?.[name]?.revisions?.[recordKey];
5459    if (!queriedStateRevisions) {
5460      return null;
5461    }
5462    return getQueriedItems(queriedStateRevisions, query);
5463  };
5464  
5465  /**
5466   * Returns a single, specific revision of a parent entity.
5467   *
5468   * @param state       State tree
5469   * @param kind        Entity kind.
5470   * @param name        Entity name.
5471   * @param recordKey   The key of the entity record whose revisions you want to fetch.
5472   * @param revisionKey The revision's key.
5473   * @param query       Optional query. If requesting specific
5474   *                    fields, fields must always include the ID. For valid query parameters see revisions schema in [the REST API Handbook](https://developer.wordpress.org/rest-api/reference/). Then see the arguments available "Retrieve a [entity kind]".
5475   *
5476   * @return Record.
5477   */
5478  const getRevision = (0,external_wp_data_namespaceObject.createSelector)((state, kind, name, recordKey, revisionKey, query) => {
5479    var _query$context5;
5480    const queriedState = state.entities.records?.[kind]?.[name]?.revisions?.[recordKey];
5481    if (!queriedState) {
5482      return undefined;
5483    }
5484    const context = (_query$context5 = query?.context) !== null && _query$context5 !== void 0 ? _query$context5 : 'default';
5485    if (query === undefined) {
5486      // If expecting a complete item, validate that completeness.
5487      if (!queriedState.itemIsComplete[context]?.[revisionKey]) {
5488        return undefined;
5489      }
5490      return queriedState.items[context][revisionKey];
5491    }
5492    const item = queriedState.items[context]?.[revisionKey];
5493    if (item && query._fields) {
5494      var _getNormalizedCommaSe2;
5495      const filteredItem = {};
5496      const fields = (_getNormalizedCommaSe2 = get_normalized_comma_separable(query._fields)) !== null && _getNormalizedCommaSe2 !== void 0 ? _getNormalizedCommaSe2 : [];
5497      for (let f = 0; f < fields.length; f++) {
5498        const field = fields[f].split('.');
5499        let value = item;
5500        field.forEach(fieldName => {
5501          value = value?.[fieldName];
5502        });
5503        setNestedValue(filteredItem, field, value);
5504      }
5505      return filteredItem;
5506    }
5507    return item;
5508  }, (state, kind, name, recordKey, revisionKey, query) => {
5509    var _query$context6;
5510    const context = (_query$context6 = query?.context) !== null && _query$context6 !== void 0 ? _query$context6 : 'default';
5511    return [state.entities.records?.[kind]?.[name]?.revisions?.[recordKey]?.items?.[context]?.[revisionKey], state.entities.records?.[kind]?.[name]?.revisions?.[recordKey]?.itemIsComplete?.[context]?.[revisionKey]];
5512  });
5513  
5514  ;// ./node_modules/@wordpress/core-data/build-module/private-selectors.js
5515  /**
5516   * WordPress dependencies
5517   */
5518  
5519  
5520  /**
5521   * Internal dependencies
5522   */
5523  
5524  
5525  /**
5526   * Returns the previous edit from the current undo offset
5527   * for the entity records edits history, if any.
5528   *
5529   * @param state State tree.
5530   *
5531   * @return The undo manager.
5532   */
5533  function getUndoManager(state) {
5534    return state.undoManager;
5535  }
5536  
5537  /**
5538   * Retrieve the fallback Navigation.
5539   *
5540   * @param state Data state.
5541   * @return The ID for the fallback Navigation post.
5542   */
5543  function getNavigationFallbackId(state) {
5544    return state.navigationFallbackId;
5545  }
5546  const getBlockPatternsForPostType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, postType) => select(STORE_NAME).getBlockPatterns().filter(({
5547    postTypes
5548  }) => !postTypes || Array.isArray(postTypes) && postTypes.includes(postType)), () => [select(STORE_NAME).getBlockPatterns()]));
5549  
5550  /**
5551   * Returns the entity records permissions for the given entity record ids.
5552   */
5553  const getEntityRecordsPermissions = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, kind, name, ids) => {
5554    const normalizedIds = Array.isArray(ids) ? ids : [ids];
5555    return normalizedIds.map(id => ({
5556      delete: select(STORE_NAME).canUser('delete', {
5557        kind,
5558        name,
5559        id
5560      }),
5561      update: select(STORE_NAME).canUser('update', {
5562        kind,
5563        name,
5564        id
5565      })
5566    }));
5567  }, state => [state.userPermissions]));
5568  
5569  /**
5570   * Returns the entity record permissions for the given entity record id.
5571   *
5572   * @param state Data state.
5573   * @param kind  Entity kind.
5574   * @param name  Entity name.
5575   * @param id    Entity record id.
5576   *
5577   * @return The entity record permissions.
5578   */
5579  function getEntityRecordPermissions(state, kind, name, id) {
5580    return getEntityRecordsPermissions(state, kind, name, id)[0];
5581  }
5582  
5583  /**
5584   * Returns the registered post meta fields for a given post type.
5585   *
5586   * @param state    Data state.
5587   * @param postType Post type.
5588   *
5589   * @return Registered post meta fields.
5590   */
5591  function getRegisteredPostMeta(state, postType) {
5592    var _state$registeredPost;
5593    return (_state$registeredPost = state.registeredPostMeta?.[postType]) !== null && _state$registeredPost !== void 0 ? _state$registeredPost : {};
5594  }
5595  
5596  ;// ./node_modules/@wordpress/core-data/build-module/private-actions.js
5597  /**
5598   * Returns an action object used in signalling that the registered post meta
5599   * fields for a post type have been received.
5600   *
5601   * @param {string} postType           Post type slug.
5602   * @param {Object} registeredPostMeta Registered post meta.
5603   *
5604   * @return {Object} Action object.
5605   */
5606  function receiveRegisteredPostMeta(postType, registeredPostMeta) {
5607    return {
5608      type: 'RECEIVE_REGISTERED_POST_META',
5609      postType,
5610      registeredPostMeta
5611    };
5612  }
5613  
5614  ;// ./node_modules/camel-case/dist.es2015/index.js
5615  
5616  
5617  function camelCaseTransform(input, index) {
5618      if (index === 0)
5619          return input.toLowerCase();
5620      return pascalCaseTransform(input, index);
5621  }
5622  function camelCaseTransformMerge(input, index) {
5623      if (index === 0)
5624          return input.toLowerCase();
5625      return pascalCaseTransformMerge(input);
5626  }
5627  function camelCase(input, options) {
5628      if (options === void 0) { options = {}; }
5629      return pascalCase(input, __assign({ transform: camelCaseTransform }, options));
5630  }
5631  
5632  ;// external ["wp","htmlEntities"]
5633  const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
5634  ;// ./node_modules/@wordpress/core-data/build-module/utils/forward-resolver.js
5635  /**
5636   * Higher-order function which forward the resolution to another resolver with the same arguments.
5637   *
5638   * @param {string} resolverName forwarded resolver.
5639   *
5640   * @return {Function} Enhanced resolver.
5641   */
5642  const forwardResolver = resolverName => (...args) => async ({
5643    resolveSelect
5644  }) => {
5645    await resolveSelect[resolverName](...args);
5646  };
5647  /* harmony default export */ const forward_resolver = (forwardResolver);
5648  
5649  ;// ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-link-suggestions.js
5650  /**
5651   * WordPress dependencies
5652   */
5653  
5654  
5655  
5656  
5657  /**
5658   * Fetches link suggestions from the WordPress API.
5659   *
5660   * WordPress does not support searching multiple tables at once, e.g. posts and terms, so we
5661   * perform multiple queries at the same time and then merge the results together.
5662   *
5663   * @param search
5664   * @param searchOptions
5665   * @param editorSettings
5666   *
5667   * @example
5668   * ```js
5669   * import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
5670   *
5671   * //...
5672   *
5673   * export function initialize( id, settings ) {
5674   *
5675   * settings.__experimentalFetchLinkSuggestions = (
5676   *     search,
5677   *     searchOptions
5678   * ) => fetchLinkSuggestions( search, searchOptions, settings );
5679   * ```
5680   */
5681  async function fetchLinkSuggestions(search, searchOptions = {}, editorSettings = {}) {
5682    const searchOptionsToUse = searchOptions.isInitialSuggestions && searchOptions.initialSuggestionsSearchOptions ? {
5683      ...searchOptions,
5684      ...searchOptions.initialSuggestionsSearchOptions
5685    } : searchOptions;
5686    const {
5687      type,
5688      subtype,
5689      page,
5690      perPage = searchOptions.isInitialSuggestions ? 3 : 20
5691    } = searchOptionsToUse;
5692    const {
5693      disablePostFormats = false
5694    } = editorSettings;
5695    const queries = [];
5696    if (!type || type === 'post') {
5697      queries.push(external_wp_apiFetch_default()({
5698        path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/search', {
5699          search,
5700          page,
5701          per_page: perPage,
5702          type: 'post',
5703          subtype
5704        })
5705      }).then(results => {
5706        return results.map(result => {
5707          return {
5708            id: result.id,
5709            url: result.url,
5710            title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(result.title || '') || (0,external_wp_i18n_namespaceObject.__)('(no title)'),
5711            type: result.subtype || result.type,
5712            kind: 'post-type'
5713          };
5714        });
5715      }).catch(() => []) // Fail by returning no results.
5716      );
5717    }
5718    if (!type || type === 'term') {
5719      queries.push(external_wp_apiFetch_default()({
5720        path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/search', {
5721          search,
5722          page,
5723          per_page: perPage,
5724          type: 'term',
5725          subtype
5726        })
5727      }).then(results => {
5728        return results.map(result => {
5729          return {
5730            id: result.id,
5731            url: result.url,
5732            title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(result.title || '') || (0,external_wp_i18n_namespaceObject.__)('(no title)'),
5733            type: result.subtype || result.type,
5734            kind: 'taxonomy'
5735          };
5736        });
5737      }).catch(() => []) // Fail by returning no results.
5738      );
5739    }
5740    if (!disablePostFormats && (!type || type === 'post-format')) {
5741      queries.push(external_wp_apiFetch_default()({
5742        path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/search', {
5743          search,
5744          page,
5745          per_page: perPage,
5746          type: 'post-format',
5747          subtype
5748        })
5749      }).then(results => {
5750        return results.map(result => {
5751          return {
5752            id: result.id,
5753            url: result.url,
5754            title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(result.title || '') || (0,external_wp_i18n_namespaceObject.__)('(no title)'),
5755            type: result.subtype || result.type,
5756            kind: 'taxonomy'
5757          };
5758        });
5759      }).catch(() => []) // Fail by returning no results.
5760      );
5761    }
5762    if (!type || type === 'attachment') {
5763      queries.push(external_wp_apiFetch_default()({
5764        path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/media', {
5765          search,
5766          page,
5767          per_page: perPage
5768        })
5769      }).then(results => {
5770        return results.map(result => {
5771          return {
5772            id: result.id,
5773            url: result.source_url,
5774            title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(result.title.rendered || '') || (0,external_wp_i18n_namespaceObject.__)('(no title)'),
5775            type: result.type,
5776            kind: 'media'
5777          };
5778        });
5779      }).catch(() => []) // Fail by returning no results.
5780      );
5781    }
5782    const responses = await Promise.all(queries);
5783    let results = responses.flat();
5784    results = results.filter(result => !!result.id);
5785    results = sortResults(results, search);
5786    results = results.slice(0, perPage);
5787    return results;
5788  }
5789  
5790  /**
5791   * Sort search results by relevance to the given query.
5792   *
5793   * Sorting is necessary as we're querying multiple endpoints and merging the results. For example
5794   * a taxonomy title might be more relevant than a post title, but by default taxonomy results will
5795   * be ordered after all the (potentially irrelevant) post results.
5796   *
5797   * We sort by scoring each result, where the score is the number of tokens in the title that are
5798   * also in the search query, divided by the total number of tokens in the title. This gives us a
5799   * score between 0 and 1, where 1 is a perfect match.
5800   *
5801   * @param results
5802   * @param search
5803   */
5804  function sortResults(results, search) {
5805    const searchTokens = tokenize(search);
5806    const scores = {};
5807    for (const result of results) {
5808      if (result.title) {
5809        const titleTokens = tokenize(result.title);
5810        const matchingTokens = titleTokens.filter(titleToken => searchTokens.some(searchToken => titleToken.includes(searchToken)));
5811        scores[result.id] = matchingTokens.length / titleTokens.length;
5812      } else {
5813        scores[result.id] = 0;
5814      }
5815    }
5816    return results.sort((a, b) => scores[b.id] - scores[a.id]);
5817  }
5818  
5819  /**
5820   * Turns text into an array of tokens, with whitespace and punctuation removed.
5821   *
5822   * For example, `"I'm having a ball."` becomes `[ "im", "having", "a", "ball" ]`.
5823   *
5824   * @param text
5825   */
5826  function tokenize(text) {
5827    // \p{L} matches any kind of letter from any language.
5828    // \p{N} matches any kind of numeric character.
5829    return text.toLowerCase().match(/[\p{L}\p{N}]+/gu) || [];
5830  }
5831  
5832  ;// ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-url-data.js
5833  /**
5834   * WordPress dependencies
5835   */
5836  
5837  
5838  
5839  /**
5840   * A simple in-memory cache for requests.
5841   * This avoids repeat HTTP requests which may be beneficial
5842   * for those wishing to preserve low-bandwidth.
5843   */
5844  const CACHE = new Map();
5845  
5846  /**
5847   * @typedef WPRemoteUrlData
5848   *
5849   * @property {string} title contents of the remote URL's `<title>` tag.
5850   */
5851  
5852  /**
5853   * Fetches data about a remote URL.
5854   * eg: <title> tag, favicon...etc.
5855   *
5856   * @async
5857   * @param {string}  url     the URL to request details from.
5858   * @param {Object?} options any options to pass to the underlying fetch.
5859   * @example
5860   * ```js
5861   * import { __experimentalFetchUrlData as fetchUrlData } from '@wordpress/core-data';
5862   *
5863   * //...
5864   *
5865   * export function initialize( id, settings ) {
5866   *
5867   * settings.__experimentalFetchUrlData = (
5868   * url
5869   * ) => fetchUrlData( url );
5870   * ```
5871   * @return {Promise< WPRemoteUrlData[] >} Remote URL data.
5872   */
5873  const fetchUrlData = async (url, options = {}) => {
5874    const endpoint = '/wp-block-editor/v1/url-details';
5875    const args = {
5876      url: (0,external_wp_url_namespaceObject.prependHTTP)(url)
5877    };
5878    if (!(0,external_wp_url_namespaceObject.isURL)(url)) {
5879      return Promise.reject(`$url} is not a valid URL.`);
5880    }
5881  
5882    // Test for "http" based URL as it is possible for valid
5883    // yet unusable URLs such as `tel:123456` to be passed.
5884    const protocol = (0,external_wp_url_namespaceObject.getProtocol)(url);
5885    if (!protocol || !(0,external_wp_url_namespaceObject.isValidProtocol)(protocol) || !protocol.startsWith('http') || !/^https?:\/\/[^\/\s]/i.test(url)) {
5886      return Promise.reject(`$url} does not have a valid protocol. URLs must be "http" based`);
5887    }
5888    if (CACHE.has(url)) {
5889      return CACHE.get(url);
5890    }
5891    return external_wp_apiFetch_default()({
5892      path: (0,external_wp_url_namespaceObject.addQueryArgs)(endpoint, args),
5893      ...options
5894    }).then(res => {
5895      CACHE.set(url, res);
5896      return res;
5897    });
5898  };
5899  /* harmony default export */ const _experimental_fetch_url_data = (fetchUrlData);
5900  
5901  ;// ./node_modules/@wordpress/core-data/build-module/fetch/index.js
5902  /**
5903   * External dependencies
5904   */
5905  
5906  
5907  /**
5908   * WordPress dependencies
5909   */
5910  
5911  
5912  
5913  async function fetchBlockPatterns() {
5914    const restPatterns = await external_wp_apiFetch_default()({
5915      path: '/wp/v2/block-patterns/patterns'
5916    });
5917    if (!restPatterns) {
5918      return [];
5919    }
5920    return restPatterns.map(pattern => Object.fromEntries(Object.entries(pattern).map(([key, value]) => [camelCase(key), value])));
5921  }
5922  
5923  ;// ./node_modules/@wordpress/core-data/build-module/resolvers.js
5924  /**
5925   * External dependencies
5926   */
5927  
5928  
5929  /**
5930   * WordPress dependencies
5931   */
5932  
5933  
5934  
5935  
5936  /**
5937   * Internal dependencies
5938   */
5939  
5940  
5941  
5942  
5943  
5944  
5945  /**
5946   * Requests authors from the REST API.
5947   *
5948   * @param {Object|undefined} query Optional object of query parameters to
5949   *                                 include with request.
5950   */
5951  const resolvers_getAuthors = query => async ({
5952    dispatch
5953  }) => {
5954    const path = (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/users/?who=authors&per_page=100', query);
5955    const users = await external_wp_apiFetch_default()({
5956      path
5957    });
5958    dispatch.receiveUserQuery(path, users);
5959  };
5960  
5961  /**
5962   * Requests the current user from the REST API.
5963   */
5964  const resolvers_getCurrentUser = () => async ({
5965    dispatch
5966  }) => {
5967    const currentUser = await external_wp_apiFetch_default()({
5968      path: '/wp/v2/users/me'
5969    });
5970    dispatch.receiveCurrentUser(currentUser);
5971  };
5972  
5973  /**
5974   * Requests an entity's record from the REST API.
5975   *
5976   * @param {string}           kind  Entity kind.
5977   * @param {string}           name  Entity name.
5978   * @param {number|string}    key   Record's key
5979   * @param {Object|undefined} query Optional object of query parameters to
5980   *                                 include with request. If requesting specific
5981   *                                 fields, fields must always include the ID.
5982   */
5983  const resolvers_getEntityRecord = (kind, name, key = '', query) => async ({
5984    select,
5985    dispatch,
5986    registry
5987  }) => {
5988    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
5989    const entityConfig = configs.find(config => config.name === name && config.kind === kind);
5990    if (!entityConfig) {
5991      return;
5992    }
5993    const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name, key], {
5994      exclusive: false
5995    });
5996    try {
5997      // Entity supports configs,
5998      // use the sync algorithm instead of the old fetch behavior.
5999      if (window.__experimentalEnableSync && entityConfig.syncConfig && !query) {
6000        if (false) {}
6001      } else {
6002        if (query !== undefined && query._fields) {
6003          // If requesting specific fields, items and query association to said
6004          // records are stored by ID reference. Thus, fields must always include
6005          // the ID.
6006          query = {
6007            ...query,
6008            _fields: [...new Set([...(get_normalized_comma_separable(query._fields) || []), entityConfig.key || DEFAULT_ENTITY_KEY])].join()
6009          };
6010        }
6011  
6012        // Disable reason: While true that an early return could leave `path`
6013        // unused, it's important that path is derived using the query prior to
6014        // additional query modifications in the condition below, since those
6015        // modifications are relevant to how the data is tracked in state, and not
6016        // for how the request is made to the REST API.
6017  
6018        // eslint-disable-next-line @wordpress/no-unused-vars-before-return
6019        const path = (0,external_wp_url_namespaceObject.addQueryArgs)(entityConfig.baseURL + (key ? '/' + key : ''), {
6020          ...entityConfig.baseURLParams,
6021          ...query
6022        });
6023        if (query !== undefined && query._fields) {
6024          query = {
6025            ...query,
6026            include: [key]
6027          };
6028  
6029          // The resolution cache won't consider query as reusable based on the
6030          // fields, so it's tested here, prior to initiating the REST request,
6031          // and without causing `getEntityRecords` resolution to occur.
6032          const hasRecords = select.hasEntityRecords(kind, name, query);
6033          if (hasRecords) {
6034            return;
6035          }
6036        }
6037        const response = await external_wp_apiFetch_default()({
6038          path,
6039          parse: false
6040        });
6041        const record = await response.json();
6042        const permissions = getUserPermissionsFromAllowHeader(response.headers?.get('allow'));
6043        const canUserResolutionsArgs = [];
6044        const receiveUserPermissionArgs = {};
6045        for (const action of ALLOWED_RESOURCE_ACTIONS) {
6046          receiveUserPermissionArgs[getUserPermissionCacheKey(action, {
6047            kind,
6048            name,
6049            id: key
6050          })] = permissions[action];
6051          canUserResolutionsArgs.push([action, {
6052            kind,
6053            name,
6054            id: key
6055          }]);
6056        }
6057        registry.batch(() => {
6058          dispatch.receiveEntityRecords(kind, name, record, query);
6059          dispatch.receiveUserPermissions(receiveUserPermissionArgs);
6060          dispatch.finishResolutions('canUser', canUserResolutionsArgs);
6061        });
6062      }
6063    } finally {
6064      dispatch.__unstableReleaseStoreLock(lock);
6065    }
6066  };
6067  
6068  /**
6069   * Requests an entity's record from the REST API.
6070   */
6071  const resolvers_getRawEntityRecord = forward_resolver('getEntityRecord');
6072  
6073  /**
6074   * Requests an entity's record from the REST API.
6075   */
6076  const resolvers_getEditedEntityRecord = forward_resolver('getEntityRecord');
6077  
6078  /**
6079   * Requests the entity's records from the REST API.
6080   *
6081   * @param {string}  kind  Entity kind.
6082   * @param {string}  name  Entity name.
6083   * @param {Object?} query Query Object. If requesting specific fields, fields
6084   *                        must always include the ID.
6085   */
6086  const resolvers_getEntityRecords = (kind, name, query = {}) => async ({
6087    dispatch,
6088    registry
6089  }) => {
6090    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
6091    const entityConfig = configs.find(config => config.name === name && config.kind === kind);
6092    if (!entityConfig) {
6093      return;
6094    }
6095    const lock = await dispatch.__unstableAcquireStoreLock(STORE_NAME, ['entities', 'records', kind, name], {
6096      exclusive: false
6097    });
6098    try {
6099      if (query._fields) {
6100        // If requesting specific fields, items and query association to said
6101        // records are stored by ID reference. Thus, fields must always include
6102        // the ID.
6103        query = {
6104          ...query,
6105          _fields: [...new Set([...(get_normalized_comma_separable(query._fields) || []), entityConfig.key || DEFAULT_ENTITY_KEY])].join()
6106        };
6107      }
6108      const path = (0,external_wp_url_namespaceObject.addQueryArgs)(entityConfig.baseURL, {
6109        ...entityConfig.baseURLParams,
6110        ...query
6111      });
6112      let records, meta;
6113      if (entityConfig.supportsPagination && query.per_page !== -1) {
6114        const response = await external_wp_apiFetch_default()({
6115          path,
6116          parse: false
6117        });
6118        records = Object.values(await response.json());
6119        meta = {
6120          totalItems: parseInt(response.headers.get('X-WP-Total')),
6121          totalPages: parseInt(response.headers.get('X-WP-TotalPages'))
6122        };
6123      } else {
6124        records = Object.values(await external_wp_apiFetch_default()({
6125          path
6126        }));
6127        meta = {
6128          totalItems: records.length,
6129          totalPages: 1
6130        };
6131      }
6132  
6133      // If we request fields but the result doesn't contain the fields,
6134      // explicitly set these fields as "undefined"
6135      // that way we consider the query "fulfilled".
6136      if (query._fields) {
6137        records = records.map(record => {
6138          query._fields.split(',').forEach(field => {
6139            if (!record.hasOwnProperty(field)) {
6140              record[field] = undefined;
6141            }
6142          });
6143          return record;
6144        });
6145      }
6146      registry.batch(() => {
6147        dispatch.receiveEntityRecords(kind, name, records, query, false, undefined, meta);
6148  
6149        // When requesting all fields, the list of results can be used to resolve
6150        // the `getEntityRecord` and `canUser` selectors in addition to `getEntityRecords`.
6151        // See https://github.com/WordPress/gutenberg/pull/26575
6152        // See https://github.com/WordPress/gutenberg/pull/64504
6153        if (!query?._fields && !query.context) {
6154          const key = entityConfig.key || DEFAULT_ENTITY_KEY;
6155          const resolutionsArgs = records.filter(record => record?.[key]).map(record => [kind, name, record[key]]);
6156          const targetHints = records.filter(record => record?.[key]).map(record => ({
6157            id: record[key],
6158            permissions: getUserPermissionsFromAllowHeader(record?._links?.self?.[0].targetHints.allow)
6159          }));
6160          const canUserResolutionsArgs = [];
6161          const receiveUserPermissionArgs = {};
6162          for (const targetHint of targetHints) {
6163            for (const action of ALLOWED_RESOURCE_ACTIONS) {
6164              canUserResolutionsArgs.push([action, {
6165                kind,
6166                name,
6167                id: targetHint.id
6168              }]);
6169              receiveUserPermissionArgs[getUserPermissionCacheKey(action, {
6170                kind,
6171                name,
6172                id: targetHint.id
6173              })] = targetHint.permissions[action];
6174            }
6175          }
6176          dispatch.receiveUserPermissions(receiveUserPermissionArgs);
6177          dispatch.finishResolutions('getEntityRecord', resolutionsArgs);
6178          dispatch.finishResolutions('canUser', canUserResolutionsArgs);
6179        }
6180        dispatch.__unstableReleaseStoreLock(lock);
6181      });
6182    } catch (e) {
6183      dispatch.__unstableReleaseStoreLock(lock);
6184    }
6185  };
6186  resolvers_getEntityRecords.shouldInvalidate = (action, kind, name) => {
6187    return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && kind === action.kind && name === action.name;
6188  };
6189  
6190  /**
6191   * Requests the current theme.
6192   */
6193  const resolvers_getCurrentTheme = () => async ({
6194    dispatch,
6195    resolveSelect
6196  }) => {
6197    const activeThemes = await resolveSelect.getEntityRecords('root', 'theme', {
6198      status: 'active'
6199    });
6200    dispatch.receiveCurrentTheme(activeThemes[0]);
6201  };
6202  
6203  /**
6204   * Requests theme supports data from the index.
6205   */
6206  const resolvers_getThemeSupports = forward_resolver('getCurrentTheme');
6207  
6208  /**
6209   * Requests a preview from the Embed API.
6210   *
6211   * @param {string} url URL to get the preview for.
6212   */
6213  const resolvers_getEmbedPreview = url => async ({
6214    dispatch
6215  }) => {
6216    try {
6217      const embedProxyResponse = await external_wp_apiFetch_default()({
6218        path: (0,external_wp_url_namespaceObject.addQueryArgs)('/oembed/1.0/proxy', {
6219          url
6220        })
6221      });
6222      dispatch.receiveEmbedPreview(url, embedProxyResponse);
6223    } catch (error) {
6224      // Embed API 404s if the URL cannot be embedded, so we have to catch the error from the apiRequest here.
6225      dispatch.receiveEmbedPreview(url, false);
6226    }
6227  };
6228  
6229  /**
6230   * Checks whether the current user can perform the given action on the given
6231   * REST resource.
6232   *
6233   * @param {string}        requestedAction Action to check. One of: 'create', 'read', 'update',
6234   *                                        'delete'.
6235   * @param {string|Object} resource        Entity resource to check. Accepts entity object `{ kind: 'root', name: 'media', id: 1 }`
6236   *                                        or REST base as a string - `media`.
6237   * @param {?string}       id              ID of the rest resource to check.
6238   */
6239  const resolvers_canUser = (requestedAction, resource, id) => async ({
6240    dispatch,
6241    registry
6242  }) => {
6243    if (!ALLOWED_RESOURCE_ACTIONS.includes(requestedAction)) {
6244      throw new Error(`'$requestedAction}' is not a valid action.`);
6245    }
6246    let resourcePath = null;
6247    if (typeof resource === 'object') {
6248      if (!resource.kind || !resource.name) {
6249        throw new Error('The entity resource object is not valid.');
6250      }
6251      const configs = await dispatch(getOrLoadEntitiesConfig(resource.kind, resource.name));
6252      const entityConfig = configs.find(config => config.name === resource.name && config.kind === resource.kind);
6253      if (!entityConfig) {
6254        return;
6255      }
6256      resourcePath = entityConfig.baseURL + (resource.id ? '/' + resource.id : '');
6257    } else {
6258      resourcePath = `/wp/v2/$resource}` + (id ? '/' + id : '');
6259    }
6260    const {
6261      hasStartedResolution
6262    } = registry.select(STORE_NAME);
6263  
6264    // Prevent resolving the same resource twice.
6265    for (const relatedAction of ALLOWED_RESOURCE_ACTIONS) {
6266      if (relatedAction === requestedAction) {
6267        continue;
6268      }
6269      const isAlreadyResolving = hasStartedResolution('canUser', [relatedAction, resource, id]);
6270      if (isAlreadyResolving) {
6271        return;
6272      }
6273    }
6274    let response;
6275    try {
6276      response = await external_wp_apiFetch_default()({
6277        path: resourcePath,
6278        method: 'OPTIONS',
6279        parse: false
6280      });
6281    } catch (error) {
6282      // Do nothing if our OPTIONS request comes back with an API error (4xx or
6283      // 5xx). The previously determined isAllowed value will remain in the store.
6284      return;
6285    }
6286  
6287    // Optional chaining operator is used here because the API requests don't
6288    // return the expected result in the React native version. Instead, API requests
6289    // only return the result, without including response properties like the headers.
6290    const permissions = getUserPermissionsFromAllowHeader(response.headers?.get('allow'));
6291    registry.batch(() => {
6292      for (const action of ALLOWED_RESOURCE_ACTIONS) {
6293        const key = getUserPermissionCacheKey(action, resource, id);
6294        dispatch.receiveUserPermission(key, permissions[action]);
6295  
6296        // Mark related action resolutions as finished.
6297        if (action !== requestedAction) {
6298          dispatch.finishResolution('canUser', [action, resource, id]);
6299        }
6300      }
6301    });
6302  };
6303  
6304  /**
6305   * Checks whether the current user can perform the given action on the given
6306   * REST resource.
6307   *
6308   * @param {string}        kind     Entity kind.
6309   * @param {string}        name     Entity name.
6310   * @param {number|string} recordId Record's id.
6311   */
6312  const resolvers_canUserEditEntityRecord = (kind, name, recordId) => async ({
6313    dispatch
6314  }) => {
6315    await dispatch(resolvers_canUser('update', {
6316      kind,
6317      name,
6318      id: recordId
6319    }));
6320  };
6321  
6322  /**
6323   * Request autosave data from the REST API.
6324   *
6325   * @param {string} postType The type of the parent post.
6326   * @param {number} postId   The id of the parent post.
6327   */
6328  const resolvers_getAutosaves = (postType, postId) => async ({
6329    dispatch,
6330    resolveSelect
6331  }) => {
6332    const {
6333      rest_base: restBase,
6334      rest_namespace: restNamespace = 'wp/v2'
6335    } = await resolveSelect.getPostType(postType);
6336    const autosaves = await external_wp_apiFetch_default()({
6337      path: `/$restNamespace}/$restBase}/$postId}/autosaves?context=edit`
6338    });
6339    if (autosaves && autosaves.length) {
6340      dispatch.receiveAutosaves(postId, autosaves);
6341    }
6342  };
6343  
6344  /**
6345   * Request autosave data from the REST API.
6346   *
6347   * This resolver exists to ensure the underlying autosaves are fetched via
6348   * `getAutosaves` when a call to the `getAutosave` selector is made.
6349   *
6350   * @param {string} postType The type of the parent post.
6351   * @param {number} postId   The id of the parent post.
6352   */
6353  const resolvers_getAutosave = (postType, postId) => async ({
6354    resolveSelect
6355  }) => {
6356    await resolveSelect.getAutosaves(postType, postId);
6357  };
6358  
6359  /**
6360   * Retrieve the frontend template used for a given link.
6361   *
6362   * @param {string} link Link.
6363   */
6364  const resolvers_experimentalGetTemplateForLink = link => async ({
6365    dispatch,
6366    resolveSelect
6367  }) => {
6368    let template;
6369    try {
6370      // This is NOT calling a REST endpoint but rather ends up with a response from
6371      // an Ajax function which has a different shape from a WP_REST_Response.
6372      template = await external_wp_apiFetch_default()({
6373        url: (0,external_wp_url_namespaceObject.addQueryArgs)(link, {
6374          '_wp-find-template': true
6375        })
6376      }).then(({
6377        data
6378      }) => data);
6379    } catch (e) {
6380      // For non-FSE themes, it is possible that this request returns an error.
6381    }
6382    if (!template) {
6383      return;
6384    }
6385    const record = await resolveSelect.getEntityRecord('postType', 'wp_template', template.id);
6386    if (record) {
6387      dispatch.receiveEntityRecords('postType', 'wp_template', [record], {
6388        'find-template': link
6389      });
6390    }
6391  };
6392  resolvers_experimentalGetTemplateForLink.shouldInvalidate = action => {
6393    return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && action.kind === 'postType' && action.name === 'wp_template';
6394  };
6395  const resolvers_experimentalGetCurrentGlobalStylesId = () => async ({
6396    dispatch,
6397    resolveSelect
6398  }) => {
6399    const activeThemes = await resolveSelect.getEntityRecords('root', 'theme', {
6400      status: 'active'
6401    });
6402    const globalStylesURL = activeThemes?.[0]?._links?.['wp:user-global-styles']?.[0]?.href;
6403    if (!globalStylesURL) {
6404      return;
6405    }
6406  
6407    // Regex matches the ID at the end of a URL or immediately before
6408    // the query string.
6409    const matches = globalStylesURL.match(/\/(\d+)(?:\?|$)/);
6410    const id = matches ? Number(matches[1]) : null;
6411    if (id) {
6412      dispatch.__experimentalReceiveCurrentGlobalStylesId(id);
6413    }
6414  };
6415  const resolvers_experimentalGetCurrentThemeBaseGlobalStyles = () => async ({
6416    resolveSelect,
6417    dispatch
6418  }) => {
6419    const currentTheme = await resolveSelect.getCurrentTheme();
6420    // Please adjust the preloaded requests if this changes!
6421    const themeGlobalStyles = await external_wp_apiFetch_default()({
6422      path: `/wp/v2/global-styles/themes/$currentTheme.stylesheet}?context=view`
6423    });
6424    dispatch.__experimentalReceiveThemeBaseGlobalStyles(currentTheme.stylesheet, themeGlobalStyles);
6425  };
6426  const resolvers_experimentalGetCurrentThemeGlobalStylesVariations = () => async ({
6427    resolveSelect,
6428    dispatch
6429  }) => {
6430    const currentTheme = await resolveSelect.getCurrentTheme();
6431    // Please adjust the preloaded requests if this changes!
6432    const variations = await external_wp_apiFetch_default()({
6433      path: `/wp/v2/global-styles/themes/$currentTheme.stylesheet}/variations?context=view`
6434    });
6435    dispatch.__experimentalReceiveThemeGlobalStyleVariations(currentTheme.stylesheet, variations);
6436  };
6437  
6438  /**
6439   * Fetches and returns the revisions of the current global styles theme.
6440   */
6441  const resolvers_getCurrentThemeGlobalStylesRevisions = () => async ({
6442    resolveSelect,
6443    dispatch
6444  }) => {
6445    const globalStylesId = await resolveSelect.__experimentalGetCurrentGlobalStylesId();
6446    const record = globalStylesId ? await resolveSelect.getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
6447    const revisionsURL = record?._links?.['version-history']?.[0]?.href;
6448    if (revisionsURL) {
6449      const resetRevisions = await external_wp_apiFetch_default()({
6450        url: revisionsURL
6451      });
6452      const revisions = resetRevisions?.map(revision => Object.fromEntries(Object.entries(revision).map(([key, value]) => [camelCase(key), value])));
6453      dispatch.receiveThemeGlobalStyleRevisions(globalStylesId, revisions);
6454    }
6455  };
6456  resolvers_getCurrentThemeGlobalStylesRevisions.shouldInvalidate = action => {
6457    return action.type === 'SAVE_ENTITY_RECORD_FINISH' && action.kind === 'root' && !action.error && action.name === 'globalStyles';
6458  };
6459  const resolvers_getBlockPatterns = () => async ({
6460    dispatch
6461  }) => {
6462    const patterns = await fetchBlockPatterns();
6463    dispatch({
6464      type: 'RECEIVE_BLOCK_PATTERNS',
6465      patterns
6466    });
6467  };
6468  const resolvers_getBlockPatternCategories = () => async ({
6469    dispatch
6470  }) => {
6471    const categories = await external_wp_apiFetch_default()({
6472      path: '/wp/v2/block-patterns/categories'
6473    });
6474    dispatch({
6475      type: 'RECEIVE_BLOCK_PATTERN_CATEGORIES',
6476      categories
6477    });
6478  };
6479  const resolvers_getUserPatternCategories = () => async ({
6480    dispatch,
6481    resolveSelect
6482  }) => {
6483    const patternCategories = await resolveSelect.getEntityRecords('taxonomy', 'wp_pattern_category', {
6484      per_page: -1,
6485      _fields: 'id,name,description,slug',
6486      context: 'view'
6487    });
6488    const mappedPatternCategories = patternCategories?.map(userCategory => ({
6489      ...userCategory,
6490      label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(userCategory.name),
6491      name: userCategory.slug
6492    })) || [];
6493    dispatch({
6494      type: 'RECEIVE_USER_PATTERN_CATEGORIES',
6495      patternCategories: mappedPatternCategories
6496    });
6497  };
6498  const resolvers_getNavigationFallbackId = () => async ({
6499    dispatch,
6500    select,
6501    registry
6502  }) => {
6503    const fallback = await external_wp_apiFetch_default()({
6504      path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp-block-editor/v1/navigation-fallback', {
6505        _embed: true
6506      })
6507    });
6508    const record = fallback?._embedded?.self;
6509    registry.batch(() => {
6510      dispatch.receiveNavigationFallbackId(fallback?.id);
6511      if (!record) {
6512        return;
6513      }
6514  
6515      // If the fallback is already in the store, don't invalidate navigation queries.
6516      // Otherwise, invalidate the cache for the scenario where there were no Navigation
6517      // posts in the state and the fallback created one.
6518      const existingFallbackEntityRecord = select.getEntityRecord('postType', 'wp_navigation', fallback.id);
6519      const invalidateNavigationQueries = !existingFallbackEntityRecord;
6520      dispatch.receiveEntityRecords('postType', 'wp_navigation', record, undefined, invalidateNavigationQueries);
6521  
6522      // Resolve to avoid further network requests.
6523      dispatch.finishResolution('getEntityRecord', ['postType', 'wp_navigation', fallback.id]);
6524    });
6525  };
6526  const resolvers_getDefaultTemplateId = query => async ({
6527    dispatch
6528  }) => {
6529    const template = await external_wp_apiFetch_default()({
6530      path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/templates/lookup', query)
6531    });
6532    // Endpoint may return an empty object if no template is found.
6533    if (template?.id) {
6534      dispatch.receiveDefaultTemplateId(query, template.id);
6535    }
6536  };
6537  
6538  /**
6539   * Requests an entity's revisions from the REST API.
6540   *
6541   * @param {string}           kind      Entity kind.
6542   * @param {string}           name      Entity name.
6543   * @param {number|string}    recordKey The key of the entity record whose revisions you want to fetch.
6544   * @param {Object|undefined} query     Optional object of query parameters to
6545   *                                     include with request. If requesting specific
6546   *                                     fields, fields must always include the ID.
6547   */
6548  const resolvers_getRevisions = (kind, name, recordKey, query = {}) => async ({
6549    dispatch,
6550    registry
6551  }) => {
6552    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
6553    const entityConfig = configs.find(config => config.name === name && config.kind === kind);
6554    if (!entityConfig) {
6555      return;
6556    }
6557    if (query._fields) {
6558      // If requesting specific fields, items and query association to said
6559      // records are stored by ID reference. Thus, fields must always include
6560      // the ID.
6561      query = {
6562        ...query,
6563        _fields: [...new Set([...(get_normalized_comma_separable(query._fields) || []), entityConfig.revisionKey || DEFAULT_ENTITY_KEY])].join()
6564      };
6565    }
6566    const path = (0,external_wp_url_namespaceObject.addQueryArgs)(entityConfig.getRevisionsUrl(recordKey), query);
6567    let records, response;
6568    const meta = {};
6569    const isPaginated = entityConfig.supportsPagination && query.per_page !== -1;
6570    try {
6571      response = await external_wp_apiFetch_default()({
6572        path,
6573        parse: !isPaginated
6574      });
6575    } catch (error) {
6576      // Do nothing if our request comes back with an API error.
6577      return;
6578    }
6579    if (response) {
6580      if (isPaginated) {
6581        records = Object.values(await response.json());
6582        meta.totalItems = parseInt(response.headers.get('X-WP-Total'));
6583      } else {
6584        records = Object.values(response);
6585      }
6586  
6587      // If we request fields but the result doesn't contain the fields,
6588      // explicitly set these fields as "undefined"
6589      // that way we consider the query "fulfilled".
6590      if (query._fields) {
6591        records = records.map(record => {
6592          query._fields.split(',').forEach(field => {
6593            if (!record.hasOwnProperty(field)) {
6594              record[field] = undefined;
6595            }
6596          });
6597          return record;
6598        });
6599      }
6600      registry.batch(() => {
6601        dispatch.receiveRevisions(kind, name, recordKey, records, query, false, meta);
6602  
6603        // When requesting all fields, the list of results can be used to
6604        // resolve the `getRevision` selector in addition to `getRevisions`.
6605        if (!query?._fields && !query.context) {
6606          const key = entityConfig.key || DEFAULT_ENTITY_KEY;
6607          const resolutionsArgs = records.filter(record => record[key]).map(record => [kind, name, recordKey, record[key]]);
6608          dispatch.finishResolutions('getRevision', resolutionsArgs);
6609        }
6610      });
6611    }
6612  };
6613  
6614  // Invalidate cache when a new revision is created.
6615  resolvers_getRevisions.shouldInvalidate = (action, kind, name, recordKey) => action.type === 'SAVE_ENTITY_RECORD_FINISH' && name === action.name && kind === action.kind && !action.error && recordKey === action.recordId;
6616  
6617  /**
6618   * Requests a specific Entity revision from the REST API.
6619   *
6620   * @param {string}           kind        Entity kind.
6621   * @param {string}           name        Entity name.
6622   * @param {number|string}    recordKey   The key of the entity record whose revisions you want to fetch.
6623   * @param {number|string}    revisionKey The revision's key.
6624   * @param {Object|undefined} query       Optional object of query parameters to
6625   *                                       include with request. If requesting specific
6626   *                                       fields, fields must always include the ID.
6627   */
6628  const resolvers_getRevision = (kind, name, recordKey, revisionKey, query) => async ({
6629    dispatch
6630  }) => {
6631    const configs = await dispatch(getOrLoadEntitiesConfig(kind, name));
6632    const entityConfig = configs.find(config => config.name === name && config.kind === kind);
6633    if (!entityConfig) {
6634      return;
6635    }
6636    if (query !== undefined && query._fields) {
6637      // If requesting specific fields, items and query association to said
6638      // records are stored by ID reference. Thus, fields must always include
6639      // the ID.
6640      query = {
6641        ...query,
6642        _fields: [...new Set([...(get_normalized_comma_separable(query._fields) || []), entityConfig.revisionKey || DEFAULT_ENTITY_KEY])].join()
6643      };
6644    }
6645    const path = (0,external_wp_url_namespaceObject.addQueryArgs)(entityConfig.getRevisionsUrl(recordKey, revisionKey), query);
6646    let record;
6647    try {
6648      record = await external_wp_apiFetch_default()({
6649        path
6650      });
6651    } catch (error) {
6652      // Do nothing if our request comes back with an API error.
6653      return;
6654    }
6655    if (record) {
6656      dispatch.receiveRevisions(kind, name, recordKey, record, query);
6657    }
6658  };
6659  
6660  /**
6661   * Requests a specific post type options from the REST API.
6662   *
6663   * @param {string} postType Post type slug.
6664   */
6665  const resolvers_getRegisteredPostMeta = postType => async ({
6666    dispatch,
6667    resolveSelect
6668  }) => {
6669    let options;
6670    try {
6671      const {
6672        rest_namespace: restNamespace = 'wp/v2',
6673        rest_base: restBase
6674      } = (await resolveSelect.getPostType(postType)) || {};
6675      options = await external_wp_apiFetch_default()({
6676        path: `$restNamespace}/$restBase}/?context=edit`,
6677        method: 'OPTIONS'
6678      });
6679    } catch (error) {
6680      // Do nothing if the request comes back with an API error.
6681      return;
6682    }
6683    if (options) {
6684      dispatch.receiveRegisteredPostMeta(postType, options?.schema?.properties?.meta?.properties);
6685    }
6686  };
6687  
6688  ;// ./node_modules/@wordpress/core-data/build-module/locks/utils.js
6689  function deepCopyLocksTreePath(tree, path) {
6690    const newTree = {
6691      ...tree
6692    };
6693    let currentNode = newTree;
6694    for (const branchName of path) {
6695      currentNode.children = {
6696        ...currentNode.children,
6697        [branchName]: {
6698          locks: [],
6699          children: {},
6700          ...currentNode.children[branchName]
6701        }
6702      };
6703      currentNode = currentNode.children[branchName];
6704    }
6705    return newTree;
6706  }
6707  function getNode(tree, path) {
6708    let currentNode = tree;
6709    for (const branchName of path) {
6710      const nextNode = currentNode.children[branchName];
6711      if (!nextNode) {
6712        return null;
6713      }
6714      currentNode = nextNode;
6715    }
6716    return currentNode;
6717  }
6718  function* iteratePath(tree, path) {
6719    let currentNode = tree;
6720    yield currentNode;
6721    for (const branchName of path) {
6722      const nextNode = currentNode.children[branchName];
6723      if (!nextNode) {
6724        break;
6725      }
6726      yield nextNode;
6727      currentNode = nextNode;
6728    }
6729  }
6730  function* iterateDescendants(node) {
6731    const stack = Object.values(node.children);
6732    while (stack.length) {
6733      const childNode = stack.pop();
6734      yield childNode;
6735      stack.push(...Object.values(childNode.children));
6736    }
6737  }
6738  function hasConflictingLock({
6739    exclusive
6740  }, locks) {
6741    if (exclusive && locks.length) {
6742      return true;
6743    }
6744    if (!exclusive && locks.filter(lock => lock.exclusive).length) {
6745      return true;
6746    }
6747    return false;
6748  }
6749  
6750  ;// ./node_modules/@wordpress/core-data/build-module/locks/reducer.js
6751  /**
6752   * Internal dependencies
6753   */
6754  
6755  const DEFAULT_STATE = {
6756    requests: [],
6757    tree: {
6758      locks: [],
6759      children: {}
6760    }
6761  };
6762  
6763  /**
6764   * Reducer returning locks.
6765   *
6766   * @param {Object} state  Current state.
6767   * @param {Object} action Dispatched action.
6768   *
6769   * @return {Object} Updated state.
6770   */
6771  function locks(state = DEFAULT_STATE, action) {
6772    switch (action.type) {
6773      case 'ENQUEUE_LOCK_REQUEST':
6774        {
6775          const {
6776            request
6777          } = action;
6778          return {
6779            ...state,
6780            requests: [request, ...state.requests]
6781          };
6782        }
6783      case 'GRANT_LOCK_REQUEST':
6784        {
6785          const {
6786            lock,
6787            request
6788          } = action;
6789          const {
6790            store,
6791            path
6792          } = request;
6793          const storePath = [store, ...path];
6794          const newTree = deepCopyLocksTreePath(state.tree, storePath);
6795          const node = getNode(newTree, storePath);
6796          node.locks = [...node.locks, lock];
6797          return {
6798            ...state,
6799            requests: state.requests.filter(r => r !== request),
6800            tree: newTree
6801          };
6802        }
6803      case 'RELEASE_LOCK':
6804        {
6805          const {
6806            lock
6807          } = action;
6808          const storePath = [lock.store, ...lock.path];
6809          const newTree = deepCopyLocksTreePath(state.tree, storePath);
6810          const node = getNode(newTree, storePath);
6811          node.locks = node.locks.filter(l => l !== lock);
6812          return {
6813            ...state,
6814            tree: newTree
6815          };
6816        }
6817    }
6818    return state;
6819  }
6820  
6821  ;// ./node_modules/@wordpress/core-data/build-module/locks/selectors.js
6822  /**
6823   * Internal dependencies
6824   */
6825  
6826  function getPendingLockRequests(state) {
6827    return state.requests;
6828  }
6829  function isLockAvailable(state, store, path, {
6830    exclusive
6831  }) {
6832    const storePath = [store, ...path];
6833    const locks = state.tree;
6834  
6835    // Validate all parents and the node itself
6836    for (const node of iteratePath(locks, storePath)) {
6837      if (hasConflictingLock({
6838        exclusive
6839      }, node.locks)) {
6840        return false;
6841      }
6842    }
6843  
6844    // iteratePath terminates early if path is unreachable, let's
6845    // re-fetch the node and check it exists in the tree.
6846    const node = getNode(locks, storePath);
6847    if (!node) {
6848      return true;
6849    }
6850  
6851    // Validate all nested nodes
6852    for (const descendant of iterateDescendants(node)) {
6853      if (hasConflictingLock({
6854        exclusive
6855      }, descendant.locks)) {
6856        return false;
6857      }
6858    }
6859    return true;
6860  }
6861  
6862  ;// ./node_modules/@wordpress/core-data/build-module/locks/engine.js
6863  /**
6864   * Internal dependencies
6865   */
6866  
6867  
6868  function createLocks() {
6869    let state = locks(undefined, {
6870      type: '@@INIT'
6871    });
6872    function processPendingLockRequests() {
6873      for (const request of getPendingLockRequests(state)) {
6874        const {
6875          store,
6876          path,
6877          exclusive,
6878          notifyAcquired
6879        } = request;
6880        if (isLockAvailable(state, store, path, {
6881          exclusive
6882        })) {
6883          const lock = {
6884            store,
6885            path,
6886            exclusive
6887          };
6888          state = locks(state, {
6889            type: 'GRANT_LOCK_REQUEST',
6890            lock,
6891            request
6892          });
6893          notifyAcquired(lock);
6894        }
6895      }
6896    }
6897    function acquire(store, path, exclusive) {
6898      return new Promise(resolve => {
6899        state = locks(state, {
6900          type: 'ENQUEUE_LOCK_REQUEST',
6901          request: {
6902            store,
6903            path,
6904            exclusive,
6905            notifyAcquired: resolve
6906          }
6907        });
6908        processPendingLockRequests();
6909      });
6910    }
6911    function release(lock) {
6912      state = locks(state, {
6913        type: 'RELEASE_LOCK',
6914        lock
6915      });
6916      processPendingLockRequests();
6917    }
6918    return {
6919      acquire,
6920      release
6921    };
6922  }
6923  
6924  ;// ./node_modules/@wordpress/core-data/build-module/locks/actions.js
6925  /**
6926   * Internal dependencies
6927   */
6928  
6929  function createLocksActions() {
6930    const locks = createLocks();
6931    function __unstableAcquireStoreLock(store, path, {
6932      exclusive
6933    }) {
6934      return () => locks.acquire(store, path, exclusive);
6935    }
6936    function __unstableReleaseStoreLock(lock) {
6937      return () => locks.release(lock);
6938    }
6939    return {
6940      __unstableAcquireStoreLock,
6941      __unstableReleaseStoreLock
6942    };
6943  }
6944  
6945  ;// external ["wp","privateApis"]
6946  const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
6947  ;// ./node_modules/@wordpress/core-data/build-module/lock-unlock.js
6948  /**
6949   * WordPress dependencies
6950   */
6951  
6952  const {
6953    lock,
6954    unlock
6955  } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/core-data');
6956  
6957  ;// external ["wp","element"]
6958  const external_wp_element_namespaceObject = window["wp"]["element"];
6959  ;// ./node_modules/@wordpress/core-data/build-module/entity-context.js
6960  /**
6961   * WordPress dependencies
6962   */
6963  
6964  const EntityContext = (0,external_wp_element_namespaceObject.createContext)({});
6965  
6966  ;// external "ReactJSXRuntime"
6967  const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
6968  ;// ./node_modules/@wordpress/core-data/build-module/entity-provider.js
6969  /**
6970   * WordPress dependencies
6971   */
6972  
6973  
6974  /**
6975   * Internal dependencies
6976   */
6977  
6978  
6979  /**
6980   * Context provider component for providing
6981   * an entity for a specific entity.
6982   *
6983   * @param {Object} props          The component's props.
6984   * @param {string} props.kind     The entity kind.
6985   * @param {string} props.type     The entity name.
6986   * @param {number} props.id       The entity ID.
6987   * @param {*}      props.children The children to wrap.
6988   *
6989   * @return {Object} The provided children, wrapped with
6990   *                   the entity's context provider.
6991   */
6992  
6993  function EntityProvider({
6994    kind,
6995    type: name,
6996    id,
6997    children
6998  }) {
6999    const parent = (0,external_wp_element_namespaceObject.useContext)(EntityContext);
7000    const childContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({
7001      ...parent,
7002      [kind]: {
7003        ...parent?.[kind],
7004        [name]: id
7005      }
7006    }), [parent, kind, name, id]);
7007    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntityContext.Provider, {
7008      value: childContext,
7009      children: children
7010    });
7011  }
7012  
7013  ;// ./node_modules/memize/dist/index.js
7014  /**
7015   * Memize options object.
7016   *
7017   * @typedef MemizeOptions
7018   *
7019   * @property {number} [maxSize] Maximum size of the cache.
7020   */
7021  
7022  /**
7023   * Internal cache entry.
7024   *
7025   * @typedef MemizeCacheNode
7026   *
7027   * @property {?MemizeCacheNode|undefined} [prev] Previous node.
7028   * @property {?MemizeCacheNode|undefined} [next] Next node.
7029   * @property {Array<*>}                   args   Function arguments for cache
7030   *                                               entry.
7031   * @property {*}                          val    Function result.
7032   */
7033  
7034  /**
7035   * Properties of the enhanced function for controlling cache.
7036   *
7037   * @typedef MemizeMemoizedFunction
7038   *
7039   * @property {()=>void} clear Clear the cache.
7040   */
7041  
7042  /**
7043   * Accepts a function to be memoized, and returns a new memoized function, with
7044   * optional options.
7045   *
7046   * @template {(...args: any[]) => any} F
7047   *
7048   * @param {F}             fn        Function to memoize.
7049   * @param {MemizeOptions} [options] Options object.
7050   *
7051   * @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
7052   */
7053  function memize(fn, options) {
7054      var size = 0;
7055  
7056      /** @type {?MemizeCacheNode|undefined} */
7057      var head;
7058  
7059      /** @type {?MemizeCacheNode|undefined} */
7060      var tail;
7061  
7062      options = options || {};
7063  
7064  	function memoized(/* ...args */) {
7065          var node = head,
7066              len = arguments.length,
7067              args,
7068              i;
7069  
7070          searchCache: while (node) {
7071              // Perform a shallow equality test to confirm that whether the node
7072              // under test is a candidate for the arguments passed. Two arrays
7073              // are shallowly equal if their length matches and each entry is
7074              // strictly equal between the two sets. Avoid abstracting to a
7075              // function which could incur an arguments leaking deoptimization.
7076  
7077              // Check whether node arguments match arguments length
7078              if (node.args.length !== arguments.length) {
7079                  node = node.next;
7080                  continue;
7081              }
7082  
7083              // Check whether node arguments match arguments values
7084              for (i = 0; i < len; i++) {
7085                  if (node.args[i] !== arguments[i]) {
7086                      node = node.next;
7087                      continue searchCache;
7088                  }
7089              }
7090  
7091              // At this point we can assume we've found a match
7092  
7093              // Surface matched node to head if not already
7094              if (node !== head) {
7095                  // As tail, shift to previous. Must only shift if not also
7096                  // head, since if both head and tail, there is no previous.
7097                  if (node === tail) {
7098                      tail = node.prev;
7099                  }
7100  
7101                  // Adjust siblings to point to each other. If node was tail,
7102                  // this also handles new tail's empty `next` assignment.
7103                  /** @type {MemizeCacheNode} */ (node.prev).next = node.next;
7104                  if (node.next) {
7105                      node.next.prev = node.prev;
7106                  }
7107  
7108                  node.next = head;
7109                  node.prev = null;
7110                  /** @type {MemizeCacheNode} */ (head).prev = node;
7111                  head = node;
7112              }
7113  
7114              // Return immediately
7115              return node.val;
7116          }
7117  
7118          // No cached value found. Continue to insertion phase:
7119  
7120          // Create a copy of arguments (avoid leaking deoptimization)
7121          args = new Array(len);
7122          for (i = 0; i < len; i++) {
7123              args[i] = arguments[i];
7124          }
7125  
7126          node = {
7127              args: args,
7128  
7129              // Generate the result from original function
7130              val: fn.apply(null, args),
7131          };
7132  
7133          // Don't need to check whether node is already head, since it would
7134          // have been returned above already if it was
7135  
7136          // Shift existing head down list
7137          if (head) {
7138              head.prev = node;
7139              node.next = head;
7140          } else {
7141              // If no head, follows that there's no tail (at initial or reset)
7142              tail = node;
7143          }
7144  
7145          // Trim tail if we're reached max size and are pending cache insertion
7146          if (size === /** @type {MemizeOptions} */ (options).maxSize) {
7147              tail = /** @type {MemizeCacheNode} */ (tail).prev;
7148              /** @type {MemizeCacheNode} */ (tail).next = null;
7149          } else {
7150              size++;
7151          }
7152  
7153          head = node;
7154  
7155          return node.val;
7156      }
7157  
7158      memoized.clear = function () {
7159          head = null;
7160          tail = null;
7161          size = 0;
7162      };
7163  
7164      // Ignore reason: There's not a clear solution to create an intersection of
7165      // the function with additional properties, where the goal is to retain the
7166      // function signature of the incoming argument and add control properties
7167      // on the return value.
7168  
7169      // @ts-ignore
7170      return memoized;
7171  }
7172  
7173  
7174  
7175  ;// ./node_modules/@wordpress/core-data/build-module/hooks/memoize.js
7176  /**
7177   * External dependencies
7178   */
7179  
7180  
7181  // re-export due to restrictive esModuleInterop setting
7182  /* harmony default export */ const memoize = (memize);
7183  
7184  ;// ./node_modules/@wordpress/core-data/build-module/hooks/constants.js
7185  let Status = /*#__PURE__*/function (Status) {
7186    Status["Idle"] = "IDLE";
7187    Status["Resolving"] = "RESOLVING";
7188    Status["Error"] = "ERROR";
7189    Status["Success"] = "SUCCESS";
7190    return Status;
7191  }({});
7192  
7193  ;// ./node_modules/@wordpress/core-data/build-module/hooks/use-query-select.js
7194  /**
7195   * WordPress dependencies
7196   */
7197  
7198  
7199  /**
7200   * Internal dependencies
7201   */
7202  
7203  
7204  const META_SELECTORS = ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'];
7205  /**
7206   * Like useSelect, but the selectors return objects containing
7207   * both the original data AND the resolution info.
7208   *
7209   * @since 6.1.0 Introduced in WordPress core.
7210   * @private
7211   *
7212   * @param {Function} mapQuerySelect see useSelect
7213   * @param {Array}    deps           see useSelect
7214   *
7215   * @example
7216   * ```js
7217   * import { useQuerySelect } from '@wordpress/data';
7218   * import { store as coreDataStore } from '@wordpress/core-data';
7219   *
7220   * function PageTitleDisplay( { id } ) {
7221   *   const { data: page, isResolving } = useQuerySelect( ( query ) => {
7222   *     return query( coreDataStore ).getEntityRecord( 'postType', 'page', id )
7223   *   }, [ id ] );
7224   *
7225   *   if ( isResolving ) {
7226   *     return 'Loading...';
7227   *   }
7228   *
7229   *   return page.title;
7230   * }
7231   *
7232   * // Rendered in the application:
7233   * // <PageTitleDisplay id={ 10 } />
7234   * ```
7235   *
7236   * In the above example, when `PageTitleDisplay` is rendered into an
7237   * application, the page and the resolution details will be retrieved from
7238   * the store state using the `mapSelect` callback on `useQuerySelect`.
7239   *
7240   * If the id prop changes then any page in the state for that id is
7241   * retrieved. If the id prop doesn't change and other props are passed in
7242   * that do change, the title will not change because the dependency is just
7243   * the id.
7244   * @see useSelect
7245   *
7246   * @return {QuerySelectResponse} Queried data.
7247   */
7248  function useQuerySelect(mapQuerySelect, deps) {
7249    return (0,external_wp_data_namespaceObject.useSelect)((select, registry) => {
7250      const resolve = store => enrichSelectors(select(store));
7251      return mapQuerySelect(resolve, registry);
7252    }, deps);
7253  }
7254  /**
7255   * Transform simple selectors into ones that return an object with the
7256   * original return value AND the resolution info.
7257   *
7258   * @param {Object} selectors Selectors to enrich
7259   * @return {EnrichedSelectors} Enriched selectors
7260   */
7261  const enrichSelectors = memoize(selectors => {
7262    const resolvers = {};
7263    for (const selectorName in selectors) {
7264      if (META_SELECTORS.includes(selectorName)) {
7265        continue;
7266      }
7267      Object.defineProperty(resolvers, selectorName, {
7268        get: () => (...args) => {
7269          const data = selectors[selectorName](...args);
7270          const resolutionStatus = selectors.getResolutionState(selectorName, args)?.status;
7271          let status;
7272          switch (resolutionStatus) {
7273            case 'resolving':
7274              status = Status.Resolving;
7275              break;
7276            case 'finished':
7277              status = Status.Success;
7278              break;
7279            case 'error':
7280              status = Status.Error;
7281              break;
7282            case undefined:
7283              status = Status.Idle;
7284              break;
7285          }
7286          return {
7287            data,
7288            status,
7289            isResolving: status === Status.Resolving,
7290            hasStarted: status !== Status.Idle,
7291            hasResolved: status === Status.Success || status === Status.Error
7292          };
7293        }
7294      });
7295    }
7296    return resolvers;
7297  });
7298  
7299  ;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-record.js
7300  /**
7301   * WordPress dependencies
7302   */
7303  
7304  
7305  
7306  
7307  /**
7308   * Internal dependencies
7309   */
7310  
7311  
7312  const use_entity_record_EMPTY_OBJECT = {};
7313  
7314  /**
7315   * Resolves the specified entity record.
7316   *
7317   * @since 6.1.0 Introduced in WordPress core.
7318   *
7319   * @param    kind     Kind of the entity, e.g. `root` or a `postType`. See rootEntitiesConfig in ../entities.ts for a list of available kinds.
7320   * @param    name     Name of the entity, e.g. `plugin` or a `post`. See rootEntitiesConfig in ../entities.ts for a list of available names.
7321   * @param    recordId ID of the requested entity record.
7322   * @param    options  Optional hook options.
7323   * @example
7324   * ```js
7325   * import { useEntityRecord } from '@wordpress/core-data';
7326   *
7327   * function PageTitleDisplay( { id } ) {
7328   *   const { record, isResolving } = useEntityRecord( 'postType', 'page', id );
7329   *
7330   *   if ( isResolving ) {
7331   *     return 'Loading...';
7332   *   }
7333   *
7334   *   return record.title;
7335   * }
7336   *
7337   * // Rendered in the application:
7338   * // <PageTitleDisplay id={ 1 } />
7339   * ```
7340   *
7341   * In the above example, when `PageTitleDisplay` is rendered into an
7342   * application, the page and the resolution details will be retrieved from
7343   * the store state using `getEntityRecord()`, or resolved if missing.
7344   *
7345   * @example
7346   * ```js
7347   * import { useCallback } from 'react';
7348   * import { useDispatch } from '@wordpress/data';
7349   * import { __ } from '@wordpress/i18n';
7350   * import { TextControl } from '@wordpress/components';
7351   * import { store as noticeStore } from '@wordpress/notices';
7352   * import { useEntityRecord } from '@wordpress/core-data';
7353   *
7354   * function PageRenameForm( { id } ) {
7355   *     const page = useEntityRecord( 'postType', 'page', id );
7356   *     const { createSuccessNotice, createErrorNotice } =
7357   *         useDispatch( noticeStore );
7358   *
7359   *     const setTitle = useCallback( ( title ) => {
7360   *         page.edit( { title } );
7361   *     }, [ page.edit ] );
7362   *
7363   *     if ( page.isResolving ) {
7364   *         return 'Loading...';
7365   *     }
7366   *
7367   *     async function onRename( event ) {
7368   *         event.preventDefault();
7369   *         try {
7370   *             await page.save();
7371   *             createSuccessNotice( __( 'Page renamed.' ), {
7372   *                 type: 'snackbar',
7373   *             } );
7374   *         } catch ( error ) {
7375   *             createErrorNotice( error.message, { type: 'snackbar' } );
7376   *         }
7377   *     }
7378   *
7379   *     return (
7380   *         <form onSubmit={ onRename }>
7381   *             <TextControl
7382   *                 label={ __( 'Name' ) }
7383   *                 value={ page.editedRecord.title }
7384   *                 onChange={ setTitle }
7385   *             />
7386   *             <button type="submit">{ __( 'Save' ) }</button>
7387   *         </form>
7388   *     );
7389   * }
7390   *
7391   * // Rendered in the application:
7392   * // <PageRenameForm id={ 1 } />
7393   * ```
7394   *
7395   * In the above example, updating and saving the page title is handled
7396   * via the `edit()` and `save()` mutation helpers provided by
7397   * `useEntityRecord()`;
7398   *
7399   * @return Entity record data.
7400   * @template RecordType
7401   */
7402  function useEntityRecord(kind, name, recordId, options = {
7403    enabled: true
7404  }) {
7405    const {
7406      editEntityRecord,
7407      saveEditedEntityRecord
7408    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
7409    const mutations = (0,external_wp_element_namespaceObject.useMemo)(() => ({
7410      edit: (record, editOptions = {}) => editEntityRecord(kind, name, recordId, record, editOptions),
7411      save: (saveOptions = {}) => saveEditedEntityRecord(kind, name, recordId, {
7412        throwOnError: true,
7413        ...saveOptions
7414      })
7415    }), [editEntityRecord, kind, name, recordId, saveEditedEntityRecord]);
7416    const {
7417      editedRecord,
7418      hasEdits,
7419      edits
7420    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
7421      if (!options.enabled) {
7422        return {
7423          editedRecord: use_entity_record_EMPTY_OBJECT,
7424          hasEdits: false,
7425          edits: use_entity_record_EMPTY_OBJECT
7426        };
7427      }
7428      return {
7429        editedRecord: select(store).getEditedEntityRecord(kind, name, recordId),
7430        hasEdits: select(store).hasEditsForEntityRecord(kind, name, recordId),
7431        edits: select(store).getEntityRecordNonTransientEdits(kind, name, recordId)
7432      };
7433    }, [kind, name, recordId, options.enabled]);
7434    const {
7435      data: record,
7436      ...querySelectRest
7437    } = useQuerySelect(query => {
7438      if (!options.enabled) {
7439        return {
7440          data: null
7441        };
7442      }
7443      return query(store).getEntityRecord(kind, name, recordId);
7444    }, [kind, name, recordId, options.enabled]);
7445    return {
7446      record,
7447      editedRecord,
7448      hasEdits,
7449      edits,
7450      ...querySelectRest,
7451      ...mutations
7452    };
7453  }
7454  function __experimentalUseEntityRecord(kind, name, recordId, options) {
7455    external_wp_deprecated_default()(`wp.data.__experimentalUseEntityRecord`, {
7456      alternative: 'wp.data.useEntityRecord',
7457      since: '6.1'
7458    });
7459    return useEntityRecord(kind, name, recordId, options);
7460  }
7461  
7462  ;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-records.js
7463  /**
7464   * WordPress dependencies
7465   */
7466  
7467  
7468  
7469  
7470  
7471  /**
7472   * Internal dependencies
7473   */
7474  
7475  
7476  
7477  const EMPTY_ARRAY = [];
7478  
7479  /**
7480   * Resolves the specified entity records.
7481   *
7482   * @since 6.1.0 Introduced in WordPress core.
7483   *
7484   * @param    kind      Kind of the entity, e.g. `root` or a `postType`. See rootEntitiesConfig in ../entities.ts for a list of available kinds.
7485   * @param    name      Name of the entity, e.g. `plugin` or a `post`. See rootEntitiesConfig in ../entities.ts for a list of available names.
7486   * @param    queryArgs Optional HTTP query description for how to fetch the data, passed to the requested API endpoint.
7487   * @param    options   Optional hook options.
7488   * @example
7489   * ```js
7490   * import { useEntityRecords } from '@wordpress/core-data';
7491   *
7492   * function PageTitlesList() {
7493   *   const { records, isResolving } = useEntityRecords( 'postType', 'page' );
7494   *
7495   *   if ( isResolving ) {
7496   *     return 'Loading...';
7497   *   }
7498   *
7499   *   return (
7500   *     <ul>
7501   *       {records.map(( page ) => (
7502   *         <li>{ page.title }</li>
7503   *       ))}
7504   *     </ul>
7505   *   );
7506   * }
7507   *
7508   * // Rendered in the application:
7509   * // <PageTitlesList />
7510   * ```
7511   *
7512   * In the above example, when `PageTitlesList` is rendered into an
7513   * application, the list of records and the resolution details will be retrieved from
7514   * the store state using `getEntityRecords()`, or resolved if missing.
7515   *
7516   * @return Entity records data.
7517   * @template RecordType
7518   */
7519  function useEntityRecords(kind, name, queryArgs = {}, options = {
7520    enabled: true
7521  }) {
7522    // Serialize queryArgs to a string that can be safely used as a React dep.
7523    // We can't just pass queryArgs as one of the deps, because if it is passed
7524    // as an object literal, then it will be a different object on each call even
7525    // if the values remain the same.
7526    const queryAsString = (0,external_wp_url_namespaceObject.addQueryArgs)('', queryArgs);
7527    const {
7528      data: records,
7529      ...rest
7530    } = useQuerySelect(query => {
7531      if (!options.enabled) {
7532        return {
7533          // Avoiding returning a new reference on every execution.
7534          data: EMPTY_ARRAY
7535        };
7536      }
7537      return query(store).getEntityRecords(kind, name, queryArgs);
7538    }, [kind, name, queryAsString, options.enabled]);
7539    const {
7540      totalItems,
7541      totalPages
7542    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
7543      if (!options.enabled) {
7544        return {
7545          totalItems: null,
7546          totalPages: null
7547        };
7548      }
7549      return {
7550        totalItems: select(store).getEntityRecordsTotalItems(kind, name, queryArgs),
7551        totalPages: select(store).getEntityRecordsTotalPages(kind, name, queryArgs)
7552      };
7553    }, [kind, name, queryAsString, options.enabled]);
7554    return {
7555      records,
7556      totalItems,
7557      totalPages,
7558      ...rest
7559    };
7560  }
7561  function __experimentalUseEntityRecords(kind, name, queryArgs, options) {
7562    external_wp_deprecated_default()(`wp.data.__experimentalUseEntityRecords`, {
7563      alternative: 'wp.data.useEntityRecords',
7564      since: '6.1'
7565    });
7566    return useEntityRecords(kind, name, queryArgs, options);
7567  }
7568  function useEntityRecordsWithPermissions(kind, name, queryArgs = {}, options = {
7569    enabled: true
7570  }) {
7571    const entityConfig = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getEntityConfig(kind, name), [kind, name]);
7572    const {
7573      records: data,
7574      ...ret
7575    } = useEntityRecords(kind, name, queryArgs, options);
7576    const ids = (0,external_wp_element_namespaceObject.useMemo)(() => {
7577      var _data$map;
7578      return (_data$map = data?.map(
7579      // @ts-ignore
7580      record => {
7581        var _entityConfig$key;
7582        return record[(_entityConfig$key = entityConfig?.key) !== null && _entityConfig$key !== void 0 ? _entityConfig$key : 'id'];
7583      })) !== null && _data$map !== void 0 ? _data$map : [];
7584    }, [data, entityConfig?.key]);
7585    const permissions = (0,external_wp_data_namespaceObject.useSelect)(select => {
7586      const {
7587        getEntityRecordsPermissions
7588      } = unlock(select(store));
7589      return getEntityRecordsPermissions(kind, name, ids);
7590    }, [ids, kind, name]);
7591    const dataWithPermissions = (0,external_wp_element_namespaceObject.useMemo)(() => {
7592      var _data$map2;
7593      return (_data$map2 = data?.map((record, index) => ({
7594        // @ts-ignore
7595        ...record,
7596        permissions: permissions[index]
7597      }))) !== null && _data$map2 !== void 0 ? _data$map2 : [];
7598    }, [data, permissions]);
7599    return {
7600      records: dataWithPermissions,
7601      ...ret
7602    };
7603  }
7604  
7605  ;// external ["wp","warning"]
7606  const external_wp_warning_namespaceObject = window["wp"]["warning"];
7607  var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject);
7608  ;// ./node_modules/@wordpress/core-data/build-module/hooks/use-resource-permissions.js
7609  /**
7610   * WordPress dependencies
7611   */
7612  
7613  
7614  
7615  /**
7616   * Internal dependencies
7617   */
7618  
7619  
7620  
7621  
7622  /**
7623   * Is the data resolved by now?
7624   */
7625  
7626  /**
7627   * Resolves resource permissions.
7628   *
7629   * @since 6.1.0 Introduced in WordPress core.
7630   *
7631   * @param    resource Entity resource to check. Accepts entity object `{ kind: 'root', name: 'media', id: 1 }`
7632   *                    or REST base as a string - `media`.
7633   * @param    id       Optional ID of the resource to check, e.g. 10. Note: This argument is discouraged
7634   *                    when using an entity object as a resource to check permissions and will be ignored.
7635   *
7636   * @example
7637   * ```js
7638   * import { useResourcePermissions } from '@wordpress/core-data';
7639   *
7640   * function PagesList() {
7641   *   const { canCreate, isResolving } = useResourcePermissions( { kind: 'postType', name: 'page' } );
7642   *
7643   *   if ( isResolving ) {
7644   *     return 'Loading ...';
7645   *   }
7646   *
7647   *   return (
7648   *     <div>
7649   *       {canCreate ? (<button>+ Create a new page</button>) : false}
7650   *       // ...
7651   *     </div>
7652   *   );
7653   * }
7654   *
7655   * // Rendered in the application:
7656   * // <PagesList />
7657   * ```
7658   *
7659   * @example
7660   * ```js
7661   * import { useResourcePermissions } from '@wordpress/core-data';
7662   *
7663   * function Page({ pageId }) {
7664   *   const {
7665   *     canCreate,
7666   *     canUpdate,
7667   *     canDelete,
7668   *     isResolving
7669   *   } = useResourcePermissions( { kind: 'postType', name: 'page', id: pageId } );
7670   *
7671   *   if ( isResolving ) {
7672   *     return 'Loading ...';
7673   *   }
7674   *
7675   *   return (
7676   *     <div>
7677   *       {canCreate ? (<button>+ Create a new page</button>) : false}
7678   *       {canUpdate ? (<button>Edit page</button>) : false}
7679   *       {canDelete ? (<button>Delete page</button>) : false}
7680   *       // ...
7681   *     </div>
7682   *   );
7683   * }
7684   *
7685   * // Rendered in the application:
7686   * // <Page pageId={ 15 } />
7687   * ```
7688   *
7689   * In the above example, when `PagesList` is rendered into an
7690   * application, the appropriate permissions and the resolution details will be retrieved from
7691   * the store state using `canUser()`, or resolved if missing.
7692   *
7693   * @return Entity records data.
7694   * @template IdType
7695   */
7696  function useResourcePermissions(resource, id) {
7697    // Serialize `resource` to a string that can be safely used as a React dep.
7698    // We can't just pass `resource` as one of the deps, because if it is passed
7699    // as an object literal, then it will be a different object on each call even
7700    // if the values remain the same.
7701    const isEntity = typeof resource === 'object';
7702    const resourceAsString = isEntity ? JSON.stringify(resource) : resource;
7703    if (isEntity && typeof id !== 'undefined') {
7704       true ? external_wp_warning_default()(`When 'resource' is an entity object, passing 'id' as a separate argument isn't supported.`) : 0;
7705    }
7706    return useQuerySelect(resolve => {
7707      const hasId = isEntity ? !!resource.id : !!id;
7708      const {
7709        canUser
7710      } = resolve(store);
7711      const create = canUser('create', isEntity ? {
7712        kind: resource.kind,
7713        name: resource.name
7714      } : resource);
7715      if (!hasId) {
7716        const read = canUser('read', resource);
7717        const isResolving = create.isResolving || read.isResolving;
7718        const hasResolved = create.hasResolved && read.hasResolved;
7719        let status = Status.Idle;
7720        if (isResolving) {
7721          status = Status.Resolving;
7722        } else if (hasResolved) {
7723          status = Status.Success;
7724        }
7725        return {
7726          status,
7727          isResolving,
7728          hasResolved,
7729          canCreate: create.hasResolved && create.data,
7730          canRead: read.hasResolved && read.data
7731        };
7732      }
7733      const read = canUser('read', resource, id);
7734      const update = canUser('update', resource, id);
7735      const _delete = canUser('delete', resource, id);
7736      const isResolving = read.isResolving || create.isResolving || update.isResolving || _delete.isResolving;
7737      const hasResolved = read.hasResolved && create.hasResolved && update.hasResolved && _delete.hasResolved;
7738      let status = Status.Idle;
7739      if (isResolving) {
7740        status = Status.Resolving;
7741      } else if (hasResolved) {
7742        status = Status.Success;
7743      }
7744      return {
7745        status,
7746        isResolving,
7747        hasResolved,
7748        canRead: hasResolved && read.data,
7749        canCreate: hasResolved && create.data,
7750        canUpdate: hasResolved && update.data,
7751        canDelete: hasResolved && _delete.data
7752      };
7753    }, [resourceAsString, id]);
7754  }
7755  /* harmony default export */ const use_resource_permissions = (useResourcePermissions);
7756  function __experimentalUseResourcePermissions(resource, id) {
7757    external_wp_deprecated_default()(`wp.data.__experimentalUseResourcePermissions`, {
7758      alternative: 'wp.data.useResourcePermissions',
7759      since: '6.1'
7760    });
7761    return useResourcePermissions(resource, id);
7762  }
7763  
7764  ;// external ["wp","blocks"]
7765  const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
7766  ;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-id.js
7767  /**
7768   * WordPress dependencies
7769   */
7770  
7771  
7772  /**
7773   * Internal dependencies
7774   */
7775  
7776  
7777  /**
7778   * Hook that returns the ID for the nearest
7779   * provided entity of the specified type.
7780   *
7781   * @param {string} kind The entity kind.
7782   * @param {string} name The entity name.
7783   */
7784  function useEntityId(kind, name) {
7785    const context = (0,external_wp_element_namespaceObject.useContext)(EntityContext);
7786    return context?.[kind]?.[name];
7787  }
7788  
7789  ;// external ["wp","blockEditor"]
7790  const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
7791  ;// ./node_modules/@wordpress/core-data/build-module/footnotes/get-rich-text-values-cached.js
7792  /**
7793   * WordPress dependencies
7794   */
7795  
7796  
7797  /**
7798   * Internal dependencies
7799   */
7800  
7801  
7802  // TODO: The following line should have been:
7803  //
7804  //   const unlockedApis = unlock( blockEditorPrivateApis );
7805  //
7806  // But there are hidden circular dependencies in RNMobile code, specifically in
7807  // certain native components in the `components` package that depend on
7808  // `block-editor`. What follows is a workaround that defers the `unlock` call
7809  // to prevent native code from failing.
7810  //
7811  // Fix once https://github.com/WordPress/gutenberg/issues/52692 is closed.
7812  let unlockedApis;
7813  const cache = new WeakMap();
7814  function getRichTextValuesCached(block) {
7815    if (!unlockedApis) {
7816      unlockedApis = unlock(external_wp_blockEditor_namespaceObject.privateApis);
7817    }
7818    if (!cache.has(block)) {
7819      const values = unlockedApis.getRichTextValues([block]);
7820      cache.set(block, values);
7821    }
7822    return cache.get(block);
7823  }
7824  
7825  ;// ./node_modules/@wordpress/core-data/build-module/footnotes/get-footnotes-order.js
7826  /**
7827   * Internal dependencies
7828   */
7829  
7830  const get_footnotes_order_cache = new WeakMap();
7831  function getBlockFootnotesOrder(block) {
7832    if (!get_footnotes_order_cache.has(block)) {
7833      const order = [];
7834      for (const value of getRichTextValuesCached(block)) {
7835        if (!value) {
7836          continue;
7837        }
7838  
7839        // replacements is a sparse array, use forEach to skip empty slots.
7840        value.replacements.forEach(({
7841          type,
7842          attributes
7843        }) => {
7844          if (type === 'core/footnote') {
7845            order.push(attributes['data-fn']);
7846          }
7847        });
7848      }
7849      get_footnotes_order_cache.set(block, order);
7850    }
7851    return get_footnotes_order_cache.get(block);
7852  }
7853  function getFootnotesOrder(blocks) {
7854    // We can only separate getting order from blocks at the root level. For
7855    // deeper inner blocks, this will not work since it's possible to have both
7856    // inner blocks and block attributes, so order needs to be computed from the
7857    // Edit functions as a whole.
7858    return blocks.flatMap(getBlockFootnotesOrder);
7859  }
7860  
7861  ;// ./node_modules/@wordpress/core-data/build-module/footnotes/index.js
7862  /**
7863   * WordPress dependencies
7864   */
7865  
7866  
7867  /**
7868   * Internal dependencies
7869   */
7870  
7871  let oldFootnotes = {};
7872  function updateFootnotesFromMeta(blocks, meta) {
7873    const output = {
7874      blocks
7875    };
7876    if (!meta) {
7877      return output;
7878    }
7879  
7880    // If meta.footnotes is empty, it means the meta is not registered.
7881    if (meta.footnotes === undefined) {
7882      return output;
7883    }
7884    const newOrder = getFootnotesOrder(blocks);
7885    const footnotes = meta.footnotes ? JSON.parse(meta.footnotes) : [];
7886    const currentOrder = footnotes.map(fn => fn.id);
7887    if (currentOrder.join('') === newOrder.join('')) {
7888      return output;
7889    }
7890    const newFootnotes = newOrder.map(fnId => footnotes.find(fn => fn.id === fnId) || oldFootnotes[fnId] || {
7891      id: fnId,
7892      content: ''
7893    });
7894    function updateAttributes(attributes) {
7895      // Only attempt to update attributes, if attributes is an object.
7896      if (!attributes || Array.isArray(attributes) || typeof attributes !== 'object') {
7897        return attributes;
7898      }
7899      attributes = {
7900        ...attributes
7901      };
7902      for (const key in attributes) {
7903        const value = attributes[key];
7904        if (Array.isArray(value)) {
7905          attributes[key] = value.map(updateAttributes);
7906          continue;
7907        }
7908  
7909        // To do, remove support for string values?
7910        if (typeof value !== 'string' && !(value instanceof external_wp_richText_namespaceObject.RichTextData)) {
7911          continue;
7912        }
7913        const richTextValue = typeof value === 'string' ? external_wp_richText_namespaceObject.RichTextData.fromHTMLString(value) : new external_wp_richText_namespaceObject.RichTextData(value);
7914        let hasFootnotes = false;
7915        richTextValue.replacements.forEach(replacement => {
7916          if (replacement.type === 'core/footnote') {
7917            const id = replacement.attributes['data-fn'];
7918            const index = newOrder.indexOf(id);
7919            // The innerHTML contains the count wrapped in a link.
7920            const countValue = (0,external_wp_richText_namespaceObject.create)({
7921              html: replacement.innerHTML
7922            });
7923            countValue.text = String(index + 1);
7924            countValue.formats = Array.from({
7925              length: countValue.text.length
7926            }, () => countValue.formats[0]);
7927            countValue.replacements = Array.from({
7928              length: countValue.text.length
7929            }, () => countValue.replacements[0]);
7930            replacement.innerHTML = (0,external_wp_richText_namespaceObject.toHTMLString)({
7931              value: countValue
7932            });
7933            hasFootnotes = true;
7934          }
7935        });
7936        if (hasFootnotes) {
7937          attributes[key] = typeof value === 'string' ? richTextValue.toHTMLString() : richTextValue;
7938        }
7939      }
7940      return attributes;
7941    }
7942    function updateBlocksAttributes(__blocks) {
7943      return __blocks.map(block => {
7944        return {
7945          ...block,
7946          attributes: updateAttributes(block.attributes),
7947          innerBlocks: updateBlocksAttributes(block.innerBlocks)
7948        };
7949      });
7950    }
7951  
7952    // We need to go through all block attributes deeply and update the
7953    // footnote anchor numbering (textContent) to match the new order.
7954    const newBlocks = updateBlocksAttributes(blocks);
7955    oldFootnotes = {
7956      ...oldFootnotes,
7957      ...footnotes.reduce((acc, fn) => {
7958        if (!newOrder.includes(fn.id)) {
7959          acc[fn.id] = fn;
7960        }
7961        return acc;
7962      }, {})
7963    };
7964    return {
7965      meta: {
7966        ...meta,
7967        footnotes: JSON.stringify(newFootnotes)
7968      },
7969      blocks: newBlocks
7970    };
7971  }
7972  
7973  ;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-block-editor.js
7974  /**
7975   * WordPress dependencies
7976   */
7977  
7978  
7979  
7980  
7981  /**
7982   * Internal dependencies
7983   */
7984  
7985  
7986  
7987  const use_entity_block_editor_EMPTY_ARRAY = [];
7988  const parsedBlocksCache = new WeakMap();
7989  
7990  /**
7991   * Hook that returns block content getters and setters for
7992   * the nearest provided entity of the specified type.
7993   *
7994   * The return value has the shape `[ blocks, onInput, onChange ]`.
7995   * `onInput` is for block changes that don't create undo levels
7996   * or dirty the post, non-persistent changes, and `onChange` is for
7997   * persistent changes. They map directly to the props of a
7998   * `BlockEditorProvider` and are intended to be used with it,
7999   * or similar components or hooks.
8000   *
8001   * @param {string} kind         The entity kind.
8002   * @param {string} name         The entity name.
8003   * @param {Object} options
8004   * @param {string} [options.id] An entity ID to use instead of the context-provided one.
8005   *
8006   * @return {[unknown[], Function, Function]} The block array and setters.
8007   */
8008  function useEntityBlockEditor(kind, name, {
8009    id: _id
8010  } = {}) {
8011    const providerId = useEntityId(kind, name);
8012    const id = _id !== null && _id !== void 0 ? _id : providerId;
8013    const {
8014      getEntityRecord,
8015      getEntityRecordEdits
8016    } = (0,external_wp_data_namespaceObject.useSelect)(STORE_NAME);
8017    const {
8018      content,
8019      editedBlocks,
8020      meta
8021    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
8022      if (!id) {
8023        return {};
8024      }
8025      const {
8026        getEditedEntityRecord
8027      } = select(STORE_NAME);
8028      const editedRecord = getEditedEntityRecord(kind, name, id);
8029      return {
8030        editedBlocks: editedRecord.blocks,
8031        content: editedRecord.content,
8032        meta: editedRecord.meta
8033      };
8034    }, [kind, name, id]);
8035    const {
8036      __unstableCreateUndoLevel,
8037      editEntityRecord
8038    } = (0,external_wp_data_namespaceObject.useDispatch)(STORE_NAME);
8039    const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
8040      if (!id) {
8041        return undefined;
8042      }
8043      if (editedBlocks) {
8044        return editedBlocks;
8045      }
8046      if (!content || typeof content !== 'string') {
8047        return use_entity_block_editor_EMPTY_ARRAY;
8048      }
8049  
8050      // If there's an edit, cache the parsed blocks by the edit.
8051      // If not, cache by the original enity record.
8052      const edits = getEntityRecordEdits(kind, name, id);
8053      const isUnedited = !edits || !Object.keys(edits).length;
8054      const cackeKey = isUnedited ? getEntityRecord(kind, name, id) : edits;
8055      let _blocks = parsedBlocksCache.get(cackeKey);
8056      if (!_blocks) {
8057        _blocks = (0,external_wp_blocks_namespaceObject.parse)(content);
8058        parsedBlocksCache.set(cackeKey, _blocks);
8059      }
8060      return _blocks;
8061    }, [kind, name, id, editedBlocks, content, getEntityRecord, getEntityRecordEdits]);
8062    const updateFootnotes = (0,external_wp_element_namespaceObject.useCallback)(_blocks => updateFootnotesFromMeta(_blocks, meta), [meta]);
8063    const onChange = (0,external_wp_element_namespaceObject.useCallback)((newBlocks, options) => {
8064      const noChange = blocks === newBlocks;
8065      if (noChange) {
8066        return __unstableCreateUndoLevel(kind, name, id);
8067      }
8068      const {
8069        selection,
8070        ...rest
8071      } = options;
8072  
8073      // We create a new function here on every persistent edit
8074      // to make sure the edit makes the post dirty and creates
8075      // a new undo level.
8076      const edits = {
8077        selection,
8078        content: ({
8079          blocks: blocksForSerialization = []
8080        }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization),
8081        ...updateFootnotes(newBlocks)
8082      };
8083      editEntityRecord(kind, name, id, edits, {
8084        isCached: false,
8085        ...rest
8086      });
8087    }, [kind, name, id, blocks, updateFootnotes, __unstableCreateUndoLevel, editEntityRecord]);
8088    const onInput = (0,external_wp_element_namespaceObject.useCallback)((newBlocks, options) => {
8089      const {
8090        selection,
8091        ...rest
8092      } = options;
8093      const footnotesChanges = updateFootnotes(newBlocks);
8094      const edits = {
8095        selection,
8096        ...footnotesChanges
8097      };
8098      editEntityRecord(kind, name, id, edits, {
8099        isCached: true,
8100        ...rest
8101      });
8102    }, [kind, name, id, updateFootnotes, editEntityRecord]);
8103    return [blocks, onInput, onChange];
8104  }
8105  
8106  ;// ./node_modules/@wordpress/core-data/build-module/hooks/use-entity-prop.js
8107  /**
8108   * WordPress dependencies
8109   */
8110  
8111  
8112  
8113  /**
8114   * Internal dependencies
8115   */
8116  
8117  
8118  
8119  /**
8120   * Hook that returns the value and a setter for the
8121   * specified property of the nearest provided
8122   * entity of the specified type.
8123   *
8124   * @param {string}        kind  The entity kind.
8125   * @param {string}        name  The entity name.
8126   * @param {string}        prop  The property name.
8127   * @param {number|string} [_id] An entity ID to use instead of the context-provided one.
8128   *
8129   * @return {[*, Function, *]} An array where the first item is the
8130   *                            property value, the second is the
8131   *                            setter and the third is the full value
8132   *                               object from REST API containing more
8133   *                               information like `raw`, `rendered` and
8134   *                               `protected` props.
8135   */
8136  function useEntityProp(kind, name, prop, _id) {
8137    const providerId = useEntityId(kind, name);
8138    const id = _id !== null && _id !== void 0 ? _id : providerId;
8139    const {
8140      value,
8141      fullValue
8142    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
8143      const {
8144        getEntityRecord,
8145        getEditedEntityRecord
8146      } = select(STORE_NAME);
8147      const record = getEntityRecord(kind, name, id); // Trigger resolver.
8148      const editedRecord = getEditedEntityRecord(kind, name, id);
8149      return record && editedRecord ? {
8150        value: editedRecord[prop],
8151        fullValue: record[prop]
8152      } : {};
8153    }, [kind, name, id, prop]);
8154    const {
8155      editEntityRecord
8156    } = (0,external_wp_data_namespaceObject.useDispatch)(STORE_NAME);
8157    const setValue = (0,external_wp_element_namespaceObject.useCallback)(newValue => {
8158      editEntityRecord(kind, name, id, {
8159        [prop]: newValue
8160      });
8161    }, [editEntityRecord, kind, name, id, prop]);
8162    return [value, setValue, fullValue];
8163  }
8164  
8165  ;// ./node_modules/@wordpress/core-data/build-module/hooks/index.js
8166  
8167  
8168  
8169  
8170  
8171  
8172  
8173  ;// ./node_modules/@wordpress/core-data/build-module/private-apis.js
8174  /**
8175   * Internal dependencies
8176   */
8177  
8178  
8179  const privateApis = {};
8180  lock(privateApis, {
8181    useEntityRecordsWithPermissions: useEntityRecordsWithPermissions
8182  });
8183  
8184  ;// ./node_modules/@wordpress/core-data/build-module/index.js
8185  /**
8186   * WordPress dependencies
8187   */
8188  
8189  
8190  /**
8191   * Internal dependencies
8192   */
8193  
8194  
8195  
8196  
8197  
8198  
8199  
8200  
8201  
8202  
8203  
8204  // The entity selectors/resolvers and actions are shortcuts to their generic equivalents
8205  // (getEntityRecord, getEntityRecords, updateEntityRecord, updateEntityRecords)
8206  // Instead of getEntityRecord, the consumer could use more user-friendly named selector: getPostType, getTaxonomy...
8207  // The "kind" and the "name" of the entity are combined to generate these shortcuts.
8208  const build_module_entitiesConfig = [...rootEntitiesConfig, ...additionalEntityConfigLoaders.filter(config => !!config.name)];
8209  const entitySelectors = build_module_entitiesConfig.reduce((result, entity) => {
8210    const {
8211      kind,
8212      name,
8213      plural
8214    } = entity;
8215    result[getMethodName(kind, name)] = (state, key, query) => getEntityRecord(state, kind, name, key, query);
8216    if (plural) {
8217      result[getMethodName(kind, plural, 'get')] = (state, query) => getEntityRecords(state, kind, name, query);
8218    }
8219    return result;
8220  }, {});
8221  const entityResolvers = build_module_entitiesConfig.reduce((result, entity) => {
8222    const {
8223      kind,
8224      name,
8225      plural
8226    } = entity;
8227    result[getMethodName(kind, name)] = (key, query) => resolvers_getEntityRecord(kind, name, key, query);
8228    if (plural) {
8229      const pluralMethodName = getMethodName(kind, plural, 'get');
8230      result[pluralMethodName] = (...args) => resolvers_getEntityRecords(kind, name, ...args);
8231      result[pluralMethodName].shouldInvalidate = action => resolvers_getEntityRecords.shouldInvalidate(action, kind, name);
8232    }
8233    return result;
8234  }, {});
8235  const entityActions = build_module_entitiesConfig.reduce((result, entity) => {
8236    const {
8237      kind,
8238      name
8239    } = entity;
8240    result[getMethodName(kind, name, 'save')] = (record, options) => saveEntityRecord(kind, name, record, options);
8241    result[getMethodName(kind, name, 'delete')] = (key, query, options) => deleteEntityRecord(kind, name, key, query, options);
8242    return result;
8243  }, {});
8244  const storeConfig = () => ({
8245    reducer: build_module_reducer,
8246    actions: {
8247      ...build_module_actions_namespaceObject,
8248      ...entityActions,
8249      ...createLocksActions()
8250    },
8251    selectors: {
8252      ...build_module_selectors_namespaceObject,
8253      ...entitySelectors
8254    },
8255    resolvers: {
8256      ...resolvers_namespaceObject,
8257      ...entityResolvers
8258    }
8259  });
8260  
8261  /**
8262   * Store definition for the code data namespace.
8263   *
8264   * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
8265   */
8266  const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, storeConfig());
8267  unlock(store).registerPrivateSelectors(private_selectors_namespaceObject);
8268  unlock(store).registerPrivateActions(private_actions_namespaceObject);
8269  (0,external_wp_data_namespaceObject.register)(store); // Register store after unlocking private selectors to allow resolvers to use them.
8270  
8271  
8272  
8273  
8274  
8275  
8276  
8277  
8278  (window.wp = window.wp || {}).coreData = __webpack_exports__;
8279  /******/ })()
8280  ;


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