[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  this["wp"] = this["wp"] || {}; this["wp"]["coreData"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  37  /******/     // define getter function for harmony exports
  38  /******/     __webpack_require__.d = function(exports, name, getter) {
  39  /******/         if(!__webpack_require__.o(exports, name)) {
  40  /******/             Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41  /******/         }
  42  /******/     };
  43  /******/
  44  /******/     // define __esModule on exports
  45  /******/     __webpack_require__.r = function(exports) {
  46  /******/         if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47  /******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48  /******/         }
  49  /******/         Object.defineProperty(exports, '__esModule', { value: true });
  50  /******/     };
  51  /******/
  52  /******/     // create a fake namespace object
  53  /******/     // mode & 1: value is a module id, require it
  54  /******/     // mode & 2: merge all properties of value into the ns
  55  /******/     // mode & 4: return value when already ns object
  56  /******/     // mode & 8|1: behave like require
  57  /******/     __webpack_require__.t = function(value, mode) {
  58  /******/         if(mode & 1) value = __webpack_require__(value);
  59  /******/         if(mode & 8) return value;
  60  /******/         if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61  /******/         var ns = Object.create(null);
  62  /******/         __webpack_require__.r(ns);
  63  /******/         Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64  /******/         if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65  /******/         return ns;
  66  /******/     };
  67  /******/
  68  /******/     // getDefaultExport function for compatibility with non-harmony modules
  69  /******/     __webpack_require__.n = function(module) {
  70  /******/         var getter = module && module.__esModule ?
  71  /******/ 			function getDefault() { return module['default']; } :
  72  /******/ 			function getModuleExports() { return module; };
  73  /******/         __webpack_require__.d(getter, 'a', getter);
  74  /******/         return getter;
  75  /******/     };
  76  /******/
  77  /******/     // Object.prototype.hasOwnProperty.call
  78  /******/     __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79  /******/
  80  /******/     // __webpack_public_path__
  81  /******/     __webpack_require__.p = "";
  82  /******/
  83  /******/
  84  /******/     // Load entry module and return exports
  85  /******/     return __webpack_require__(__webpack_require__.s = "dsJ0");
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ "1ZqX":
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = window["wp"]["data"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ "51Zz":
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = window["wp"]["dataControls"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ "7Cbv":
 105  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 106  
 107  "use strict";
 108  
 109  // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
 110  // Unique ID creation requires a high quality random # generator. In the browser we therefore
 111  // require the crypto API and do not support built-in fallback to lower quality random number
 112  // generators (like Math.random()).
 113  var getRandomValues;
 114  var rnds8 = new Uint8Array(16);
 115  function rng() {
 116    // lazy load so that environments that need to polyfill have a chance to do so
 117    if (!getRandomValues) {
 118      // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
 119      // find the complete implementation of crypto (msCrypto) on IE11.
 120      getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
 121  
 122      if (!getRandomValues) {
 123        throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
 124      }
 125    }
 126  
 127    return getRandomValues(rnds8);
 128  }
 129  // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js
 130  /* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
 131  // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js
 132  
 133  
 134  function validate(uuid) {
 135    return typeof uuid === 'string' && regex.test(uuid);
 136  }
 137  
 138  /* harmony default export */ var esm_browser_validate = (validate);
 139  // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js
 140  
 141  /**
 142   * Convert array of 16 byte values to UUID string format of the form:
 143   * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 144   */
 145  
 146  var byteToHex = [];
 147  
 148  for (var stringify_i = 0; stringify_i < 256; ++stringify_i) {
 149    byteToHex.push((stringify_i + 0x100).toString(16).substr(1));
 150  }
 151  
 152  function stringify(arr) {
 153    var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
 154    // Note: Be careful editing this code!  It's been tuned for performance
 155    // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
 156    var uuid = (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]]).toLowerCase(); // Consistency check for valid UUID.  If this throws, it's likely due to one
 157    // of the following:
 158    // - One or more input array values don't map to a hex octet (leading to
 159    // "undefined" in the uuid)
 160    // - Invalid input values for the RFC `version` or `variant` fields
 161  
 162    if (!esm_browser_validate(uuid)) {
 163      throw TypeError('Stringified UUID is invalid');
 164    }
 165  
 166    return uuid;
 167  }
 168  
 169  /* harmony default export */ var esm_browser_stringify = (stringify);
 170  // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js
 171  
 172  
 173  
 174  function v4(options, buf, offset) {
 175    options = options || {};
 176    var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
 177  
 178    rnds[6] = rnds[6] & 0x0f | 0x40;
 179    rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
 180  
 181    if (buf) {
 182      offset = offset || 0;
 183  
 184      for (var i = 0; i < 16; ++i) {
 185        buf[offset + i] = rnds[i];
 186      }
 187  
 188      return buf;
 189    }
 190  
 191    return esm_browser_stringify(rnds);
 192  }
 193  
 194  /* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4);
 195  
 196  /***/ }),
 197  
 198  /***/ "FtRg":
 199  /***/ (function(module, exports, __webpack_require__) {
 200  
 201  "use strict";
 202  
 203  
 204  function _typeof(obj) {
 205    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
 206      _typeof = function (obj) {
 207        return typeof obj;
 208      };
 209    } else {
 210      _typeof = function (obj) {
 211        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
 212      };
 213    }
 214  
 215    return _typeof(obj);
 216  }
 217  
 218  function _classCallCheck(instance, Constructor) {
 219    if (!(instance instanceof Constructor)) {
 220      throw new TypeError("Cannot call a class as a function");
 221    }
 222  }
 223  
 224  function _defineProperties(target, props) {
 225    for (var i = 0; i < props.length; i++) {
 226      var descriptor = props[i];
 227      descriptor.enumerable = descriptor.enumerable || false;
 228      descriptor.configurable = true;
 229      if ("value" in descriptor) descriptor.writable = true;
 230      Object.defineProperty(target, descriptor.key, descriptor);
 231    }
 232  }
 233  
 234  function _createClass(Constructor, protoProps, staticProps) {
 235    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 236    if (staticProps) _defineProperties(Constructor, staticProps);
 237    return Constructor;
 238  }
 239  
 240  /**
 241   * Given an instance of EquivalentKeyMap, returns its internal value pair tuple
 242   * for a key, if one exists. The tuple members consist of the last reference
 243   * value for the key (used in efficient subsequent lookups) and the value
 244   * assigned for the key at the leaf node.
 245   *
 246   * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
 247   * @param {*} key                     The key for which to return value pair.
 248   *
 249   * @return {?Array} Value pair, if exists.
 250   */
 251  function getValuePair(instance, key) {
 252    var _map = instance._map,
 253        _arrayTreeMap = instance._arrayTreeMap,
 254        _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
 255    // value, which can be used to shortcut immediately to the value.
 256  
 257    if (_map.has(key)) {
 258      return _map.get(key);
 259    } // Sort keys to ensure stable retrieval from tree.
 260  
 261  
 262    var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
 263  
 264    var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
 265  
 266    for (var i = 0; i < properties.length; i++) {
 267      var property = properties[i];
 268      map = map.get(property);
 269  
 270      if (map === undefined) {
 271        return;
 272      }
 273  
 274      var propertyValue = key[property];
 275      map = map.get(propertyValue);
 276  
 277      if (map === undefined) {
 278        return;
 279      }
 280    }
 281  
 282    var valuePair = map.get('_ekm_value');
 283  
 284    if (!valuePair) {
 285      return;
 286    } // If reached, it implies that an object-like key was set with another
 287    // reference, so delete the reference and replace with the current.
 288  
 289  
 290    _map.delete(valuePair[0]);
 291  
 292    valuePair[0] = key;
 293    map.set('_ekm_value', valuePair);
 294  
 295    _map.set(key, valuePair);
 296  
 297    return valuePair;
 298  }
 299  /**
 300   * Variant of a Map object which enables lookup by equivalent (deeply equal)
 301   * object and array keys.
 302   */
 303  
 304  
 305  var EquivalentKeyMap =
 306  /*#__PURE__*/
 307  function () {
 308    /**
 309     * Constructs a new instance of EquivalentKeyMap.
 310     *
 311     * @param {Iterable.<*>} iterable Initial pair of key, value for map.
 312     */
 313    function EquivalentKeyMap(iterable) {
 314      _classCallCheck(this, EquivalentKeyMap);
 315  
 316      this.clear();
 317  
 318      if (iterable instanceof EquivalentKeyMap) {
 319        // Map#forEach is only means of iterating with support for IE11.
 320        var iterablePairs = [];
 321        iterable.forEach(function (value, key) {
 322          iterablePairs.push([key, value]);
 323        });
 324        iterable = iterablePairs;
 325      }
 326  
 327      if (iterable != null) {
 328        for (var i = 0; i < iterable.length; i++) {
 329          this.set(iterable[i][0], iterable[i][1]);
 330        }
 331      }
 332    }
 333    /**
 334     * Accessor property returning the number of elements.
 335     *
 336     * @return {number} Number of elements.
 337     */
 338  
 339  
 340    _createClass(EquivalentKeyMap, [{
 341      key: "set",
 342  
 343      /**
 344       * Add or update an element with a specified key and value.
 345       *
 346       * @param {*} key   The key of the element to add.
 347       * @param {*} value The value of the element to add.
 348       *
 349       * @return {EquivalentKeyMap} Map instance.
 350       */
 351      value: function set(key, value) {
 352        // Shortcut non-object-like to set on internal Map.
 353        if (key === null || _typeof(key) !== 'object') {
 354          this._map.set(key, value);
 355  
 356          return this;
 357        } // Sort keys to ensure stable assignment into tree.
 358  
 359  
 360        var properties = Object.keys(key).sort();
 361        var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
 362  
 363        var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
 364  
 365        for (var i = 0; i < properties.length; i++) {
 366          var property = properties[i];
 367  
 368          if (!map.has(property)) {
 369            map.set(property, new EquivalentKeyMap());
 370          }
 371  
 372          map = map.get(property);
 373          var propertyValue = key[property];
 374  
 375          if (!map.has(propertyValue)) {
 376            map.set(propertyValue, new EquivalentKeyMap());
 377          }
 378  
 379          map = map.get(propertyValue);
 380        } // If an _ekm_value exists, there was already an equivalent key. Before
 381        // overriding, ensure that the old key reference is removed from map to
 382        // avoid memory leak of accumulating equivalent keys. This is, in a
 383        // sense, a poor man's WeakMap, while still enabling iterability.
 384  
 385  
 386        var previousValuePair = map.get('_ekm_value');
 387  
 388        if (previousValuePair) {
 389          this._map.delete(previousValuePair[0]);
 390        }
 391  
 392        map.set('_ekm_value', valuePair);
 393  
 394        this._map.set(key, valuePair);
 395  
 396        return this;
 397      }
 398      /**
 399       * Returns a specified element.
 400       *
 401       * @param {*} key The key of the element to return.
 402       *
 403       * @return {?*} The element associated with the specified key or undefined
 404       *              if the key can't be found.
 405       */
 406  
 407    }, {
 408      key: "get",
 409      value: function get(key) {
 410        // Shortcut non-object-like to get from internal Map.
 411        if (key === null || _typeof(key) !== 'object') {
 412          return this._map.get(key);
 413        }
 414  
 415        var valuePair = getValuePair(this, key);
 416  
 417        if (valuePair) {
 418          return valuePair[1];
 419        }
 420      }
 421      /**
 422       * Returns a boolean indicating whether an element with the specified key
 423       * exists or not.
 424       *
 425       * @param {*} key The key of the element to test for presence.
 426       *
 427       * @return {boolean} Whether an element with the specified key exists.
 428       */
 429  
 430    }, {
 431      key: "has",
 432      value: function has(key) {
 433        if (key === null || _typeof(key) !== 'object') {
 434          return this._map.has(key);
 435        } // Test on the _presence_ of the pair, not its value, as even undefined
 436        // can be a valid member value for a key.
 437  
 438  
 439        return getValuePair(this, key) !== undefined;
 440      }
 441      /**
 442       * Removes the specified element.
 443       *
 444       * @param {*} key The key of the element to remove.
 445       *
 446       * @return {boolean} Returns true if an element existed and has been
 447       *                   removed, or false if the element does not exist.
 448       */
 449  
 450    }, {
 451      key: "delete",
 452      value: function _delete(key) {
 453        if (!this.has(key)) {
 454          return false;
 455        } // This naive implementation will leave orphaned child trees. A better
 456        // implementation should traverse and remove orphans.
 457  
 458  
 459        this.set(key, undefined);
 460        return true;
 461      }
 462      /**
 463       * Executes a provided function once per each key/value pair, in insertion
 464       * order.
 465       *
 466       * @param {Function} callback Function to execute for each element.
 467       * @param {*}        thisArg  Value to use as `this` when executing
 468       *                            `callback`.
 469       */
 470  
 471    }, {
 472      key: "forEach",
 473      value: function forEach(callback) {
 474        var _this = this;
 475  
 476        var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
 477  
 478        this._map.forEach(function (value, key) {
 479          // Unwrap value from object-like value pair.
 480          if (key !== null && _typeof(key) === 'object') {
 481            value = value[1];
 482          }
 483  
 484          callback.call(thisArg, value, key, _this);
 485        });
 486      }
 487      /**
 488       * Removes all elements.
 489       */
 490  
 491    }, {
 492      key: "clear",
 493      value: function clear() {
 494        this._map = new Map();
 495        this._arrayTreeMap = new Map();
 496        this._objectTreeMap = new Map();
 497      }
 498    }, {
 499      key: "size",
 500      get: function get() {
 501        return this._map.size;
 502      }
 503    }]);
 504  
 505    return EquivalentKeyMap;
 506  }();
 507  
 508  module.exports = EquivalentKeyMap;
 509  
 510  
 511  /***/ }),
 512  
 513  /***/ "GRId":
 514  /***/ (function(module, exports) {
 515  
 516  (function() { module.exports = window["wp"]["element"]; }());
 517  
 518  /***/ }),
 519  
 520  /***/ "HSyU":
 521  /***/ (function(module, exports) {
 522  
 523  (function() { module.exports = window["wp"]["blocks"]; }());
 524  
 525  /***/ }),
 526  
 527  /***/ "Mmq9":
 528  /***/ (function(module, exports) {
 529  
 530  (function() { module.exports = window["wp"]["url"]; }());
 531  
 532  /***/ }),
 533  
 534  /***/ "YLtl":
 535  /***/ (function(module, exports) {
 536  
 537  (function() { module.exports = window["lodash"]; }());
 538  
 539  /***/ }),
 540  
 541  /***/ "dsJ0":
 542  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 543  
 544  "use strict";
 545  // ESM COMPAT FLAG
 546  __webpack_require__.r(__webpack_exports__);
 547  
 548  // EXPORTS
 549  __webpack_require__.d(__webpack_exports__, "store", function() { return /* binding */ build_module_store; });
 550  __webpack_require__.d(__webpack_exports__, "EntityProvider", function() { return /* reexport */ EntityProvider; });
 551  __webpack_require__.d(__webpack_exports__, "useEntityId", function() { return /* reexport */ useEntityId; });
 552  __webpack_require__.d(__webpack_exports__, "useEntityProp", function() { return /* reexport */ useEntityProp; });
 553  __webpack_require__.d(__webpack_exports__, "useEntityBlockEditor", function() { return /* reexport */ useEntityBlockEditor; });
 554  __webpack_require__.d(__webpack_exports__, "__experimentalFetchLinkSuggestions", function() { return /* reexport */ _experimental_fetch_link_suggestions; });
 555  __webpack_require__.d(__webpack_exports__, "__experimentalFetchRemoteUrlData", function() { return /* reexport */ _experimental_fetch_remote_url_data; });
 556  
 557  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/locks/actions.js
 558  var locks_actions_namespaceObject = {};
 559  __webpack_require__.r(locks_actions_namespaceObject);
 560  __webpack_require__.d(locks_actions_namespaceObject, "__unstableAcquireStoreLock", function() { return __unstableAcquireStoreLock; });
 561  __webpack_require__.d(locks_actions_namespaceObject, "__unstableEnqueueLockRequest", function() { return __unstableEnqueueLockRequest; });
 562  __webpack_require__.d(locks_actions_namespaceObject, "__unstableReleaseStoreLock", function() { return __unstableReleaseStoreLock; });
 563  __webpack_require__.d(locks_actions_namespaceObject, "__unstableProcessPendingLockRequests", function() { return __unstableProcessPendingLockRequests; });
 564  
 565  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/actions.js
 566  var build_module_actions_namespaceObject = {};
 567  __webpack_require__.r(build_module_actions_namespaceObject);
 568  __webpack_require__.d(build_module_actions_namespaceObject, "receiveUserQuery", function() { return receiveUserQuery; });
 569  __webpack_require__.d(build_module_actions_namespaceObject, "receiveCurrentUser", function() { return receiveCurrentUser; });
 570  __webpack_require__.d(build_module_actions_namespaceObject, "addEntities", function() { return addEntities; });
 571  __webpack_require__.d(build_module_actions_namespaceObject, "receiveEntityRecords", function() { return receiveEntityRecords; });
 572  __webpack_require__.d(build_module_actions_namespaceObject, "receiveCurrentTheme", function() { return receiveCurrentTheme; });
 573  __webpack_require__.d(build_module_actions_namespaceObject, "receiveThemeSupports", function() { return receiveThemeSupports; });
 574  __webpack_require__.d(build_module_actions_namespaceObject, "receiveEmbedPreview", function() { return receiveEmbedPreview; });
 575  __webpack_require__.d(build_module_actions_namespaceObject, "deleteEntityRecord", function() { return deleteEntityRecord; });
 576  __webpack_require__.d(build_module_actions_namespaceObject, "editEntityRecord", function() { return actions_editEntityRecord; });
 577  __webpack_require__.d(build_module_actions_namespaceObject, "undo", function() { return undo; });
 578  __webpack_require__.d(build_module_actions_namespaceObject, "redo", function() { return redo; });
 579  __webpack_require__.d(build_module_actions_namespaceObject, "__unstableCreateUndoLevel", function() { return actions_unstableCreateUndoLevel; });
 580  __webpack_require__.d(build_module_actions_namespaceObject, "saveEntityRecord", function() { return saveEntityRecord; });
 581  __webpack_require__.d(build_module_actions_namespaceObject, "__experimentalBatch", function() { return __experimentalBatch; });
 582  __webpack_require__.d(build_module_actions_namespaceObject, "saveEditedEntityRecord", function() { return saveEditedEntityRecord; });
 583  __webpack_require__.d(build_module_actions_namespaceObject, "__experimentalSaveSpecifiedEntityEdits", function() { return __experimentalSaveSpecifiedEntityEdits; });
 584  __webpack_require__.d(build_module_actions_namespaceObject, "receiveUploadPermissions", function() { return receiveUploadPermissions; });
 585  __webpack_require__.d(build_module_actions_namespaceObject, "receiveUserPermission", function() { return receiveUserPermission; });
 586  __webpack_require__.d(build_module_actions_namespaceObject, "receiveAutosaves", function() { return receiveAutosaves; });
 587  
 588  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/selectors.js
 589  var build_module_selectors_namespaceObject = {};
 590  __webpack_require__.r(build_module_selectors_namespaceObject);
 591  __webpack_require__.d(build_module_selectors_namespaceObject, "isRequestingEmbedPreview", function() { return isRequestingEmbedPreview; });
 592  __webpack_require__.d(build_module_selectors_namespaceObject, "getAuthors", function() { return getAuthors; });
 593  __webpack_require__.d(build_module_selectors_namespaceObject, "__unstableGetAuthor", function() { return __unstableGetAuthor; });
 594  __webpack_require__.d(build_module_selectors_namespaceObject, "getCurrentUser", function() { return getCurrentUser; });
 595  __webpack_require__.d(build_module_selectors_namespaceObject, "getUserQueryResults", function() { return getUserQueryResults; });
 596  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntitiesByKind", function() { return getEntitiesByKind; });
 597  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntity", function() { return getEntity; });
 598  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecord", function() { return getEntityRecord; });
 599  __webpack_require__.d(build_module_selectors_namespaceObject, "__experimentalGetEntityRecordNoResolver", function() { return __experimentalGetEntityRecordNoResolver; });
 600  __webpack_require__.d(build_module_selectors_namespaceObject, "getRawEntityRecord", function() { return getRawEntityRecord; });
 601  __webpack_require__.d(build_module_selectors_namespaceObject, "hasEntityRecords", function() { return hasEntityRecords; });
 602  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecords", function() { return getEntityRecords; });
 603  __webpack_require__.d(build_module_selectors_namespaceObject, "__experimentalGetDirtyEntityRecords", function() { return __experimentalGetDirtyEntityRecords; });
 604  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecordEdits", function() { return getEntityRecordEdits; });
 605  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecordNonTransientEdits", function() { return getEntityRecordNonTransientEdits; });
 606  __webpack_require__.d(build_module_selectors_namespaceObject, "hasEditsForEntityRecord", function() { return hasEditsForEntityRecord; });
 607  __webpack_require__.d(build_module_selectors_namespaceObject, "getEditedEntityRecord", function() { return getEditedEntityRecord; });
 608  __webpack_require__.d(build_module_selectors_namespaceObject, "isAutosavingEntityRecord", function() { return isAutosavingEntityRecord; });
 609  __webpack_require__.d(build_module_selectors_namespaceObject, "isSavingEntityRecord", function() { return isSavingEntityRecord; });
 610  __webpack_require__.d(build_module_selectors_namespaceObject, "isDeletingEntityRecord", function() { return isDeletingEntityRecord; });
 611  __webpack_require__.d(build_module_selectors_namespaceObject, "getLastEntitySaveError", function() { return getLastEntitySaveError; });
 612  __webpack_require__.d(build_module_selectors_namespaceObject, "getLastEntityDeleteError", function() { return getLastEntityDeleteError; });
 613  __webpack_require__.d(build_module_selectors_namespaceObject, "getUndoEdit", function() { return getUndoEdit; });
 614  __webpack_require__.d(build_module_selectors_namespaceObject, "getRedoEdit", function() { return getRedoEdit; });
 615  __webpack_require__.d(build_module_selectors_namespaceObject, "hasUndo", function() { return hasUndo; });
 616  __webpack_require__.d(build_module_selectors_namespaceObject, "hasRedo", function() { return hasRedo; });
 617  __webpack_require__.d(build_module_selectors_namespaceObject, "getCurrentTheme", function() { return getCurrentTheme; });
 618  __webpack_require__.d(build_module_selectors_namespaceObject, "getThemeSupports", function() { return getThemeSupports; });
 619  __webpack_require__.d(build_module_selectors_namespaceObject, "getEmbedPreview", function() { return getEmbedPreview; });
 620  __webpack_require__.d(build_module_selectors_namespaceObject, "isPreviewEmbedFallback", function() { return isPreviewEmbedFallback; });
 621  __webpack_require__.d(build_module_selectors_namespaceObject, "canUser", function() { return canUser; });
 622  __webpack_require__.d(build_module_selectors_namespaceObject, "canUserEditEntityRecord", function() { return canUserEditEntityRecord; });
 623  __webpack_require__.d(build_module_selectors_namespaceObject, "getAutosaves", function() { return getAutosaves; });
 624  __webpack_require__.d(build_module_selectors_namespaceObject, "getAutosave", function() { return getAutosave; });
 625  __webpack_require__.d(build_module_selectors_namespaceObject, "hasFetchedAutosaves", function() { return hasFetchedAutosaves; });
 626  __webpack_require__.d(build_module_selectors_namespaceObject, "getReferenceByDistinctEdits", function() { return getReferenceByDistinctEdits; });
 627  __webpack_require__.d(build_module_selectors_namespaceObject, "__experimentalGetTemplateForLink", function() { return __experimentalGetTemplateForLink; });
 628  
 629  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/resolvers.js
 630  var resolvers_namespaceObject = {};
 631  __webpack_require__.r(resolvers_namespaceObject);
 632  __webpack_require__.d(resolvers_namespaceObject, "getAuthors", function() { return resolvers_getAuthors; });
 633  __webpack_require__.d(resolvers_namespaceObject, "__unstableGetAuthor", function() { return resolvers_unstableGetAuthor; });
 634  __webpack_require__.d(resolvers_namespaceObject, "getCurrentUser", function() { return resolvers_getCurrentUser; });
 635  __webpack_require__.d(resolvers_namespaceObject, "getEntityRecord", function() { return resolvers_getEntityRecord; });
 636  __webpack_require__.d(resolvers_namespaceObject, "getRawEntityRecord", function() { return resolvers_getRawEntityRecord; });
 637  __webpack_require__.d(resolvers_namespaceObject, "getEditedEntityRecord", function() { return resolvers_getEditedEntityRecord; });
 638  __webpack_require__.d(resolvers_namespaceObject, "getEntityRecords", function() { return resolvers_getEntityRecords; });
 639  __webpack_require__.d(resolvers_namespaceObject, "getCurrentTheme", function() { return resolvers_getCurrentTheme; });
 640  __webpack_require__.d(resolvers_namespaceObject, "getThemeSupports", function() { return resolvers_getThemeSupports; });
 641  __webpack_require__.d(resolvers_namespaceObject, "getEmbedPreview", function() { return resolvers_getEmbedPreview; });
 642  __webpack_require__.d(resolvers_namespaceObject, "canUser", function() { return resolvers_canUser; });
 643  __webpack_require__.d(resolvers_namespaceObject, "canUserEditEntityRecord", function() { return resolvers_canUserEditEntityRecord; });
 644  __webpack_require__.d(resolvers_namespaceObject, "getAutosaves", function() { return resolvers_getAutosaves; });
 645  __webpack_require__.d(resolvers_namespaceObject, "getAutosave", function() { return resolvers_getAutosave; });
 646  __webpack_require__.d(resolvers_namespaceObject, "__experimentalGetTemplateForLink", function() { return resolvers_experimentalGetTemplateForLink; });
 647  
 648  // NAMESPACE OBJECT: ./node_modules/@wordpress/core-data/build-module/locks/selectors.js
 649  var locks_selectors_namespaceObject = {};
 650  __webpack_require__.r(locks_selectors_namespaceObject);
 651  __webpack_require__.d(locks_selectors_namespaceObject, "__unstableGetPendingLockRequests", function() { return __unstableGetPendingLockRequests; });
 652  __webpack_require__.d(locks_selectors_namespaceObject, "__unstableIsLockAvailable", function() { return __unstableIsLockAvailable; });
 653  
 654  // EXTERNAL MODULE: external ["wp","data"]
 655  var external_wp_data_ = __webpack_require__("1ZqX");
 656  
 657  // EXTERNAL MODULE: external ["wp","dataControls"]
 658  var external_wp_dataControls_ = __webpack_require__("51Zz");
 659  
 660  // EXTERNAL MODULE: external "lodash"
 661  var external_lodash_ = __webpack_require__("YLtl");
 662  
 663  // EXTERNAL MODULE: external ["wp","isShallowEqual"]
 664  var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
 665  var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
 666  
 667  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/if-matching-action.js
 668  /**
 669   * A higher-order reducer creator which invokes the original reducer only if
 670   * the dispatching action matches the given predicate, **OR** if state is
 671   * initializing (undefined).
 672   *
 673   * @param {Function} isMatch Function predicate for allowing reducer call.
 674   *
 675   * @return {Function} Higher-order reducer.
 676   */
 677  const ifMatchingAction = isMatch => reducer => (state, action) => {
 678    if (state === undefined || isMatch(action)) {
 679      return reducer(state, action);
 680    }
 681  
 682    return state;
 683  };
 684  
 685  /* harmony default export */ var if_matching_action = (ifMatchingAction);
 686  
 687  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/replace-action.js
 688  /**
 689   * Higher-order reducer creator which substitutes the action object before
 690   * passing to the original reducer.
 691   *
 692   * @param {Function} replacer Function mapping original action to replacement.
 693   *
 694   * @return {Function} Higher-order reducer.
 695   */
 696  const replaceAction = replacer => reducer => (state, action) => {
 697    return reducer(state, replacer(action));
 698  };
 699  
 700  /* harmony default export */ var replace_action = (replaceAction);
 701  
 702  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/conservative-map-item.js
 703  /**
 704   * External dependencies
 705   */
 706  
 707  /**
 708   * Given the current and next item entity, returns the minimally "modified"
 709   * result of the next item, preferring value references from the original item
 710   * if equal. If all values match, the original item is returned.
 711   *
 712   * @param {Object} item     Original item.
 713   * @param {Object} nextItem Next item.
 714   *
 715   * @return {Object} Minimally modified merged item.
 716   */
 717  
 718  function conservativeMapItem(item, nextItem) {
 719    // Return next item in its entirety if there is no original item.
 720    if (!item) {
 721      return nextItem;
 722    }
 723  
 724    let hasChanges = false;
 725    const result = {};
 726  
 727    for (const key in nextItem) {
 728      if (Object(external_lodash_["isEqual"])(item[key], nextItem[key])) {
 729        result[key] = item[key];
 730      } else {
 731        hasChanges = true;
 732        result[key] = nextItem[key];
 733      }
 734    }
 735  
 736    if (!hasChanges) {
 737      return item;
 738    } // Only at this point, backfill properties from the original item which
 739    // weren't explicitly set into the result above. This is an optimization
 740    // to allow `hasChanges` to return early.
 741  
 742  
 743    for (const key in item) {
 744      if (!result.hasOwnProperty(key)) {
 745        result[key] = item[key];
 746      }
 747    }
 748  
 749    return result;
 750  }
 751  
 752  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/on-sub-key.js
 753  /**
 754   * Higher-order reducer creator which creates a combined reducer object, keyed
 755   * by a property on the action object.
 756   *
 757   * @param {string} actionProperty Action property by which to key object.
 758   *
 759   * @return {Function} Higher-order reducer.
 760   */
 761  const onSubKey = actionProperty => reducer => (state = {}, action) => {
 762    // Retrieve subkey from action. Do not track if undefined; useful for cases
 763    // where reducer is scoped by action shape.
 764    const key = action[actionProperty];
 765  
 766    if (key === undefined) {
 767      return state;
 768    } // Avoid updating state if unchanged. Note that this also accounts for a
 769    // reducer which returns undefined on a key which is not yet tracked.
 770  
 771  
 772    const nextKeyState = reducer(state[key], action);
 773  
 774    if (nextKeyState === state[key]) {
 775      return state;
 776    }
 777  
 778    return { ...state,
 779      [key]: nextKeyState
 780    };
 781  };
 782  /* harmony default export */ var on_sub_key = (onSubKey);
 783  
 784  // EXTERNAL MODULE: external ["wp","i18n"]
 785  var external_wp_i18n_ = __webpack_require__("l3Sj");
 786  
 787  // EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules
 788  var v4 = __webpack_require__("7Cbv");
 789  
 790  // EXTERNAL MODULE: external ["wp","url"]
 791  var external_wp_url_ = __webpack_require__("Mmq9");
 792  
 793  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js
 794  /**
 795   * External dependencies
 796   */
 797  
 798  /**
 799   * Returns an action object used in signalling that items have been received.
 800   *
 801   * @param {Array}   items Items received.
 802   * @param {?Object} edits Optional edits to reset.
 803   *
 804   * @return {Object} Action object.
 805   */
 806  
 807  function receiveItems(items, edits) {
 808    return {
 809      type: 'RECEIVE_ITEMS',
 810      items: Object(external_lodash_["castArray"])(items),
 811      persistedEdits: edits
 812    };
 813  }
 814  /**
 815   * Returns an action object used in signalling that entity records have been
 816   * deleted and they need to be removed from entities state.
 817   *
 818   * @param {string}       kind             Kind of the removed entities.
 819   * @param {string}       name             Name of the removed entities.
 820   * @param {Array|number} records          Record IDs of the removed entities.
 821   * @param {boolean}      invalidateCache  Controls whether we want to invalidate the cache.
 822   * @return {Object} Action object.
 823   */
 824  
 825  function removeItems(kind, name, records, invalidateCache = false) {
 826    return {
 827      type: 'REMOVE_ITEMS',
 828      itemIds: Object(external_lodash_["castArray"])(records),
 829      kind,
 830      name,
 831      invalidateCache
 832    };
 833  }
 834  /**
 835   * Returns an action object used in signalling that queried data has been
 836   * received.
 837   *
 838   * @param {Array}   items Queried items received.
 839   * @param {?Object} query Optional query object.
 840   * @param {?Object} edits Optional edits to reset.
 841   *
 842   * @return {Object} Action object.
 843   */
 844  
 845  function receiveQueriedItems(items, query = {}, edits) {
 846    return { ...receiveItems(items, edits),
 847      query
 848    };
 849  }
 850  
 851  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/actions.js
 852  /**
 853   * WordPress dependencies
 854   */
 855  
 856  
 857  function* __unstableAcquireStoreLock(store, path, {
 858    exclusive
 859  }) {
 860    const promise = yield* __unstableEnqueueLockRequest(store, path, {
 861      exclusive
 862    });
 863    yield* __unstableProcessPendingLockRequests();
 864    return yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(promise);
 865  }
 866  function* __unstableEnqueueLockRequest(store, path, {
 867    exclusive
 868  }) {
 869    let notifyAcquired;
 870    const promise = new Promise(resolve => {
 871      notifyAcquired = resolve;
 872    });
 873    yield {
 874      type: 'ENQUEUE_LOCK_REQUEST',
 875      request: {
 876        store,
 877        path,
 878        exclusive,
 879        notifyAcquired
 880      }
 881    };
 882    return promise;
 883  }
 884  function* __unstableReleaseStoreLock(lock) {
 885    yield {
 886      type: 'RELEASE_LOCK',
 887      lock
 888    };
 889    yield* __unstableProcessPendingLockRequests();
 890  }
 891  function* __unstableProcessPendingLockRequests() {
 892    yield {
 893      type: 'PROCESS_PENDING_LOCK_REQUESTS'
 894    };
 895    const lockRequests = yield external_wp_data_["controls"].select('core', '__unstableGetPendingLockRequests');
 896  
 897    for (const request of lockRequests) {
 898      const {
 899        store,
 900        path,
 901        exclusive,
 902        notifyAcquired
 903      } = request;
 904      const isAvailable = yield external_wp_data_["controls"].select('core', '__unstableIsLockAvailable', store, path, {
 905        exclusive
 906      });
 907  
 908      if (isAvailable) {
 909        const lock = {
 910          store,
 911          path,
 912          exclusive
 913        };
 914        yield {
 915          type: 'GRANT_LOCK_REQUEST',
 916          lock,
 917          request
 918        };
 919        notifyAcquired(lock);
 920      }
 921    }
 922  }
 923  
 924  // EXTERNAL MODULE: external ["wp","apiFetch"]
 925  var external_wp_apiFetch_ = __webpack_require__("ywyh");
 926  var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
 927  
 928  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js
 929  /**
 930   * WordPress dependencies
 931   */
 932  
 933  /**
 934   * Default batch processor. Sends its input requests to /v1/batch.
 935   *
 936   * @param {Array} requests List of API requests to perform at once.
 937   *
 938   * @return {Promise} Promise that resolves to a list of objects containing
 939   *                   either `output` (if that request was succesful) or `error`
 940   *                   (if not ).
 941   */
 942  
 943  async function defaultProcessor(requests) {
 944    const batchResponse = await external_wp_apiFetch_default()({
 945      path: '/batch/v1',
 946      method: 'POST',
 947      data: {
 948        validation: 'require-all-validate',
 949        requests: requests.map(request => ({
 950          path: request.path,
 951          body: request.data,
 952          // Rename 'data' to 'body'.
 953          method: request.method,
 954          headers: request.headers
 955        }))
 956      }
 957    });
 958  
 959    if (batchResponse.failed) {
 960      return batchResponse.responses.map(response => ({
 961        error: response === null || response === void 0 ? void 0 : response.body
 962      }));
 963    }
 964  
 965    return batchResponse.responses.map(response => {
 966      const result = {};
 967  
 968      if (response.status >= 200 && response.status < 300) {
 969        result.output = response.body;
 970      } else {
 971        result.error = response.body;
 972      }
 973  
 974      return result;
 975    });
 976  }
 977  
 978  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js
 979  /**
 980   * External dependencies
 981   */
 982  
 983  /**
 984   * Internal dependencies
 985   */
 986  
 987  
 988  /**
 989   * Creates a batch, which can be used to combine multiple API requests into one
 990   * API request using the WordPress batch processing API (/v1/batch).
 991   *
 992   * ```
 993   * const batch = createBatch();
 994   * const dunePromise = batch.add( {
 995   *   path: '/v1/books',
 996   *   method: 'POST',
 997   *   data: { title: 'Dune' }
 998   * } );
 999   * const lotrPromise = batch.add( {
1000   *   path: '/v1/books',
1001   *   method: 'POST',
1002   *   data: { title: 'Lord of the Rings' }
1003   * } );
1004   * const isSuccess = await batch.run(); // Sends one POST to /v1/batch.
1005   * if ( isSuccess ) {
1006   *   console.log(
1007   *     'Saved two books:',
1008   *     await dunePromise,
1009   *     await lotrPromise
1010   *   );
1011   * }
1012   * ```
1013   *
1014   * @param {Function} [processor] Processor function. Can be used to replace the
1015   *                               default functionality which is to send an API
1016   *                               request to /v1/batch. Is given an array of
1017   *                               inputs and must return a promise that
1018   *                               resolves to an array of objects containing
1019   *                               either `output` or `error`.
1020   */
1021  
1022  function createBatch(processor = defaultProcessor) {
1023    let lastId = 0;
1024    let queue = [];
1025    const pending = new ObservableSet();
1026    return {
1027      /**
1028       * Adds an input to the batch and returns a promise that is resolved or
1029       * rejected when the input is processed by `batch.run()`.
1030       *
1031       * You may also pass a thunk which allows inputs to be added
1032       * asychronously.
1033       *
1034       * ```
1035       * // Both are allowed:
1036       * batch.add( { path: '/v1/books', ... } );
1037       * batch.add( ( add ) => add( { path: '/v1/books', ... } ) );
1038       * ```
1039       *
1040       * If a thunk is passed, `batch.run()` will pause until either:
1041       *
1042       * - The thunk calls its `add` argument, or;
1043       * - The thunk returns a promise and that promise resolves, or;
1044       * - The thunk returns a non-promise.
1045       *
1046       * @param {any|Function} inputOrThunk Input to add or thunk to execute.
1047       
1048       * @return {Promise|any} If given an input, returns a promise that
1049       *                       is resolved or rejected when the batch is
1050       *                       processed. If given a thunk, returns the return
1051       *                       value of that thunk.
1052       */
1053      add(inputOrThunk) {
1054        const id = ++lastId;
1055        pending.add(id);
1056  
1057        const add = input => new Promise((resolve, reject) => {
1058          queue.push({
1059            input,
1060            resolve,
1061            reject
1062          });
1063          pending.delete(id);
1064        });
1065  
1066        if (Object(external_lodash_["isFunction"])(inputOrThunk)) {
1067          return Promise.resolve(inputOrThunk(add)).finally(() => {
1068            pending.delete(id);
1069          });
1070        }
1071  
1072        return add(inputOrThunk);
1073      },
1074  
1075      /**
1076       * Runs the batch. This calls `batchProcessor` and resolves or rejects
1077       * all promises returned by `add()`.
1078       *
1079       * @return {Promise} A promise that resolves to a boolean that is true
1080       *                   if the processor returned no errors.
1081       */
1082      async run() {
1083        if (pending.size) {
1084          await new Promise(resolve => {
1085            const unsubscribe = pending.subscribe(() => {
1086              if (!pending.size) {
1087                unsubscribe();
1088                resolve();
1089              }
1090            });
1091          });
1092        }
1093  
1094        let results;
1095  
1096        try {
1097          results = await processor(queue.map(({
1098            input
1099          }) => input));
1100  
1101          if (results.length !== queue.length) {
1102            throw new Error('run: Array returned by processor must be same size as input array.');
1103          }
1104        } catch (error) {
1105          for (const {
1106            reject
1107          } of queue) {
1108            reject(error);
1109          }
1110  
1111          throw error;
1112        }
1113  
1114        let isSuccess = true;
1115  
1116        for (const [result, {
1117          resolve,
1118          reject
1119        }] of Object(external_lodash_["zip"])(results, queue)) {
1120          if (result !== null && result !== void 0 && result.error) {
1121            reject(result.error);
1122            isSuccess = false;
1123          } else {
1124            var _result$output;
1125  
1126            resolve((_result$output = result === null || result === void 0 ? void 0 : result.output) !== null && _result$output !== void 0 ? _result$output : result);
1127          }
1128        }
1129  
1130        queue = [];
1131        return isSuccess;
1132      }
1133  
1134    };
1135  }
1136  
1137  class ObservableSet {
1138    constructor(...args) {
1139      this.set = new Set(...args);
1140      this.subscribers = new Set();
1141    }
1142  
1143    get size() {
1144      return this.set.size;
1145    }
1146  
1147    add(...args) {
1148      this.set.add(...args);
1149      this.subscribers.forEach(subscriber => subscriber());
1150      return this;
1151    }
1152  
1153    delete(...args) {
1154      const isSuccess = this.set.delete(...args);
1155      this.subscribers.forEach(subscriber => subscriber());
1156      return isSuccess;
1157    }
1158  
1159    subscribe(subscriber) {
1160      this.subscribers.add(subscriber);
1161      return () => {
1162        this.subscribers.delete(subscriber);
1163      };
1164    }
1165  
1166  }
1167  
1168  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/controls.js
1169  /**
1170   * WordPress dependencies
1171   */
1172  
1173  function regularFetch(url) {
1174    return {
1175      type: 'REGULAR_FETCH',
1176      url
1177    };
1178  }
1179  function getDispatch() {
1180    return {
1181      type: 'GET_DISPATCH'
1182    };
1183  }
1184  const controls = {
1185    async REGULAR_FETCH({
1186      url
1187    }) {
1188      const {
1189        data
1190      } = await window.fetch(url).then(res => res.json());
1191      return data;
1192    },
1193  
1194    GET_DISPATCH: Object(external_wp_data_["createRegistryControl"])(({
1195      dispatch
1196    }) => () => dispatch)
1197  };
1198  /* harmony default export */ var build_module_controls = (controls);
1199  
1200  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/actions.js
1201  /**
1202   * External dependencies
1203   */
1204  
1205  
1206  /**
1207   * WordPress dependencies
1208   */
1209  
1210  
1211  
1212  
1213  /**
1214   * Internal dependencies
1215   */
1216  
1217  
1218  
1219  
1220  
1221  
1222  /**
1223   * Returns an action object used in signalling that authors have been received.
1224   *
1225   * @param {string}       queryID Query ID.
1226   * @param {Array|Object} users   Users received.
1227   *
1228   * @return {Object} Action object.
1229   */
1230  
1231  function receiveUserQuery(queryID, users) {
1232    return {
1233      type: 'RECEIVE_USER_QUERY',
1234      users: Object(external_lodash_["castArray"])(users),
1235      queryID
1236    };
1237  }
1238  /**
1239   * Returns an action used in signalling that the current user has been received.
1240   *
1241   * @param {Object} currentUser Current user object.
1242   *
1243   * @return {Object} Action object.
1244   */
1245  
1246  function receiveCurrentUser(currentUser) {
1247    return {
1248      type: 'RECEIVE_CURRENT_USER',
1249      currentUser
1250    };
1251  }
1252  /**
1253   * Returns an action object used in adding new entities.
1254   *
1255   * @param {Array} entities  Entities received.
1256   *
1257   * @return {Object} Action object.
1258   */
1259  
1260  function addEntities(entities) {
1261    return {
1262      type: 'ADD_ENTITIES',
1263      entities
1264    };
1265  }
1266  /**
1267   * Returns an action object used in signalling that entity records have been received.
1268   *
1269   * @param {string}       kind            Kind of the received entity.
1270   * @param {string}       name            Name of the received entity.
1271   * @param {Array|Object} records         Records received.
1272   * @param {?Object}      query           Query Object.
1273   * @param {?boolean}     invalidateCache Should invalidate query caches.
1274   * @param {?Object}      edits           Edits to reset.
1275   * @return {Object} Action object.
1276   */
1277  
1278  function receiveEntityRecords(kind, name, records, query, invalidateCache = false, edits) {
1279    // Auto drafts should not have titles, but some plugins rely on them so we can't filter this
1280    // on the server.
1281    if (kind === 'postType') {
1282      records = Object(external_lodash_["castArray"])(records).map(record => record.status === 'auto-draft' ? { ...record,
1283        title: ''
1284      } : record);
1285    }
1286  
1287    let action;
1288  
1289    if (query) {
1290      action = receiveQueriedItems(records, query, edits);
1291    } else {
1292      action = receiveItems(records, edits);
1293    }
1294  
1295    return { ...action,
1296      kind,
1297      name,
1298      invalidateCache
1299    };
1300  }
1301  /**
1302   * Returns an action object used in signalling that the current theme has been received.
1303   *
1304   * @param {Object} currentTheme The current theme.
1305   *
1306   * @return {Object} Action object.
1307   */
1308  
1309  function receiveCurrentTheme(currentTheme) {
1310    return {
1311      type: 'RECEIVE_CURRENT_THEME',
1312      currentTheme
1313    };
1314  }
1315  /**
1316   * Returns an action object used in signalling that the index has been received.
1317   *
1318   * @param {Object} themeSupports Theme support for the current theme.
1319   *
1320   * @return {Object} Action object.
1321   */
1322  
1323  function receiveThemeSupports(themeSupports) {
1324    return {
1325      type: 'RECEIVE_THEME_SUPPORTS',
1326      themeSupports
1327    };
1328  }
1329  /**
1330   * Returns an action object used in signalling that the preview data for
1331   * a given URl has been received.
1332   *
1333   * @param {string}  url     URL to preview the embed for.
1334   * @param {*}       preview Preview data.
1335   *
1336   * @return {Object} Action object.
1337   */
1338  
1339  function receiveEmbedPreview(url, preview) {
1340    return {
1341      type: 'RECEIVE_EMBED_PREVIEW',
1342      url,
1343      preview
1344    };
1345  }
1346  /**
1347   * Action triggered to delete an entity record.
1348   *
1349   * @param {string}   kind                      Kind of the deleted entity.
1350   * @param {string}   name                      Name of the deleted entity.
1351   * @param {string}   recordId                  Record ID of the deleted entity.
1352   * @param {?Object}  query                     Special query parameters for the
1353   *                                             DELETE API call.
1354   * @param {Object}   [options]                 Delete options.
1355   * @param {Function} [options.__unstableFetch] Internal use only. Function to
1356   *                                             call instead of `apiFetch()`.
1357   *                                             Must return a control descriptor.
1358   */
1359  
1360  function* deleteEntityRecord(kind, name, recordId, query, {
1361    __unstableFetch = null
1362  } = {}) {
1363    const entities = yield getKindEntities(kind);
1364    const entity = Object(external_lodash_["find"])(entities, {
1365      kind,
1366      name
1367    });
1368    let error;
1369    let deletedRecord = false;
1370  
1371    if (!entity) {
1372      return;
1373    }
1374  
1375    const lock = yield* __unstableAcquireStoreLock('core', ['entities', 'data', kind, name, recordId], {
1376      exclusive: true
1377    });
1378  
1379    try {
1380      yield {
1381        type: 'DELETE_ENTITY_RECORD_START',
1382        kind,
1383        name,
1384        recordId
1385      };
1386  
1387      try {
1388        let path = `$entity.baseURL}/$recordId}`;
1389  
1390        if (query) {
1391          path = Object(external_wp_url_["addQueryArgs"])(path, query);
1392        }
1393  
1394        const options = {
1395          path,
1396          method: 'DELETE'
1397        };
1398  
1399        if (__unstableFetch) {
1400          deletedRecord = yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(__unstableFetch(options));
1401        } else {
1402          deletedRecord = yield Object(external_wp_dataControls_["apiFetch"])(options);
1403        }
1404  
1405        yield removeItems(kind, name, recordId, true);
1406      } catch (_error) {
1407        error = _error;
1408      }
1409  
1410      yield {
1411        type: 'DELETE_ENTITY_RECORD_FINISH',
1412        kind,
1413        name,
1414        recordId,
1415        error
1416      };
1417      return deletedRecord;
1418    } finally {
1419      yield* __unstableReleaseStoreLock(lock);
1420    }
1421  }
1422  /**
1423   * Returns an action object that triggers an
1424   * edit to an entity record.
1425   *
1426   * @param {string} kind     Kind of the edited entity record.
1427   * @param {string} name     Name of the edited entity record.
1428   * @param {number} recordId Record ID of the edited entity record.
1429   * @param {Object} edits    The edits.
1430   * @param {Object} options  Options for the edit.
1431   * @param {boolean} options.undoIgnore Whether to ignore the edit in undo history or not.
1432   *
1433   * @return {Object} Action object.
1434   */
1435  
1436  function* actions_editEntityRecord(kind, name, recordId, edits, options = {}) {
1437    const entity = yield external_wp_data_["controls"].select('core', 'getEntity', kind, name);
1438  
1439    if (!entity) {
1440      throw new Error(`The entity being edited ($kind}, $name}) does not have a loaded config.`);
1441    }
1442  
1443    const {
1444      transientEdits = {},
1445      mergedEdits = {}
1446    } = entity;
1447    const record = yield external_wp_data_["controls"].select('core', 'getRawEntityRecord', kind, name, recordId);
1448    const editedRecord = yield external_wp_data_["controls"].select('core', 'getEditedEntityRecord', kind, name, recordId);
1449    const edit = {
1450      kind,
1451      name,
1452      recordId,
1453      // Clear edits when they are equal to their persisted counterparts
1454      // so that the property is not considered dirty.
1455      edits: Object.keys(edits).reduce((acc, key) => {
1456        const recordValue = record[key];
1457        const editedRecordValue = editedRecord[key];
1458        const value = mergedEdits[key] ? { ...editedRecordValue,
1459          ...edits[key]
1460        } : edits[key];
1461        acc[key] = Object(external_lodash_["isEqual"])(recordValue, value) ? undefined : value;
1462        return acc;
1463      }, {}),
1464      transientEdits
1465    };
1466    return {
1467      type: 'EDIT_ENTITY_RECORD',
1468      ...edit,
1469      meta: {
1470        undo: !options.undoIgnore && { ...edit,
1471          // Send the current values for things like the first undo stack entry.
1472          edits: Object.keys(edits).reduce((acc, key) => {
1473            acc[key] = editedRecord[key];
1474            return acc;
1475          }, {})
1476        }
1477      }
1478    };
1479  }
1480  /**
1481   * Action triggered to undo the last edit to
1482   * an entity record, if any.
1483   */
1484  
1485  function* undo() {
1486    const undoEdit = yield external_wp_data_["controls"].select('core', 'getUndoEdit');
1487  
1488    if (!undoEdit) {
1489      return;
1490    }
1491  
1492    yield {
1493      type: 'EDIT_ENTITY_RECORD',
1494      ...undoEdit,
1495      meta: {
1496        isUndo: true
1497      }
1498    };
1499  }
1500  /**
1501   * Action triggered to redo the last undoed
1502   * edit to an entity record, if any.
1503   */
1504  
1505  function* redo() {
1506    const redoEdit = yield external_wp_data_["controls"].select('core', 'getRedoEdit');
1507  
1508    if (!redoEdit) {
1509      return;
1510    }
1511  
1512    yield {
1513      type: 'EDIT_ENTITY_RECORD',
1514      ...redoEdit,
1515      meta: {
1516        isRedo: true
1517      }
1518    };
1519  }
1520  /**
1521   * Forces the creation of a new undo level.
1522   *
1523   * @return {Object} Action object.
1524   */
1525  
1526  function actions_unstableCreateUndoLevel() {
1527    return {
1528      type: 'CREATE_UNDO_LEVEL'
1529    };
1530  }
1531  /**
1532   * Action triggered to save an entity record.
1533   *
1534   * @param {string}   kind                       Kind of the received entity.
1535   * @param {string}   name                       Name of the received entity.
1536   * @param {Object}   record                     Record to be saved.
1537   * @param {Object}   options                    Saving options.
1538   * @param {boolean}  [options.isAutosave=false] Whether this is an autosave.
1539   * @param {Function} [options.__unstableFetch]  Internal use only. Function to
1540   *                                              call instead of `apiFetch()`.
1541   *                                              Must return a control
1542   *                                              descriptor.
1543   */
1544  
1545  function* saveEntityRecord(kind, name, record, {
1546    isAutosave = false,
1547    __unstableFetch = null
1548  } = {}) {
1549    const entities = yield getKindEntities(kind);
1550    const entity = Object(external_lodash_["find"])(entities, {
1551      kind,
1552      name
1553    });
1554  
1555    if (!entity) {
1556      return;
1557    }
1558  
1559    const entityIdKey = entity.key || DEFAULT_ENTITY_KEY;
1560    const recordId = record[entityIdKey];
1561    const lock = yield* __unstableAcquireStoreLock('core', ['entities', 'data', kind, name, recordId || Object(v4["a" /* default */])()], {
1562      exclusive: true
1563    });
1564  
1565    try {
1566      // Evaluate optimized edits.
1567      // (Function edits that should be evaluated on save to avoid expensive computations on every edit.)
1568      for (const [key, value] of Object.entries(record)) {
1569        if (typeof value === 'function') {
1570          const evaluatedValue = value(yield external_wp_data_["controls"].select('core', 'getEditedEntityRecord', kind, name, recordId));
1571          yield actions_editEntityRecord(kind, name, recordId, {
1572            [key]: evaluatedValue
1573          }, {
1574            undoIgnore: true
1575          });
1576          record[key] = evaluatedValue;
1577        }
1578      }
1579  
1580      yield {
1581        type: 'SAVE_ENTITY_RECORD_START',
1582        kind,
1583        name,
1584        recordId,
1585        isAutosave
1586      };
1587      let updatedRecord;
1588      let error;
1589  
1590      try {
1591        const path = `$entity.baseURL}$recordId ? '/' + recordId : ''}`;
1592        const persistedRecord = yield external_wp_data_["controls"].select('core', 'getRawEntityRecord', kind, name, recordId);
1593  
1594        if (isAutosave) {
1595          // Most of this autosave logic is very specific to posts.
1596          // This is fine for now as it is the only supported autosave,
1597          // but ideally this should all be handled in the back end,
1598          // so the client just sends and receives objects.
1599          const currentUser = yield external_wp_data_["controls"].select('core', 'getCurrentUser');
1600          const currentUserId = currentUser ? currentUser.id : undefined;
1601          const autosavePost = yield external_wp_data_["controls"].select('core', 'getAutosave', persistedRecord.type, persistedRecord.id, currentUserId); // Autosaves need all expected fields to be present.
1602          // So we fallback to the previous autosave and then
1603          // to the actual persisted entity if the edits don't
1604          // have a value.
1605  
1606          let data = { ...persistedRecord,
1607            ...autosavePost,
1608            ...record
1609          };
1610          data = Object.keys(data).reduce((acc, key) => {
1611            if (['title', 'excerpt', 'content'].includes(key)) {
1612              // Edits should be the "raw" attribute values.
1613              acc[key] = Object(external_lodash_["get"])(data[key], 'raw', data[key]);
1614            }
1615  
1616            return acc;
1617          }, {
1618            status: data.status === 'auto-draft' ? 'draft' : data.status
1619          });
1620          const options = {
1621            path: `$path}/autosaves`,
1622            method: 'POST',
1623            data
1624          };
1625  
1626          if (__unstableFetch) {
1627            updatedRecord = yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(__unstableFetch(options));
1628          } else {
1629            updatedRecord = yield Object(external_wp_dataControls_["apiFetch"])(options);
1630          } // An autosave may be processed by the server as a regular save
1631          // when its update is requested by the author and the post had
1632          // draft or auto-draft status.
1633  
1634  
1635          if (persistedRecord.id === updatedRecord.id) {
1636            let newRecord = { ...persistedRecord,
1637              ...data,
1638              ...updatedRecord
1639            };
1640            newRecord = Object.keys(newRecord).reduce((acc, key) => {
1641              // These properties are persisted in autosaves.
1642              if (['title', 'excerpt', 'content'].includes(key)) {
1643                // Edits should be the "raw" attribute values.
1644                acc[key] = Object(external_lodash_["get"])(newRecord[key], 'raw', newRecord[key]);
1645              } else if (key === 'status') {
1646                // Status is only persisted in autosaves when going from
1647                // "auto-draft" to "draft".
1648                acc[key] = persistedRecord.status === 'auto-draft' && newRecord.status === 'draft' ? newRecord.status : persistedRecord.status;
1649              } else {
1650                // These properties are not persisted in autosaves.
1651                acc[key] = Object(external_lodash_["get"])(persistedRecord[key], 'raw', persistedRecord[key]);
1652              }
1653  
1654              return acc;
1655            }, {});
1656            yield receiveEntityRecords(kind, name, newRecord, undefined, true);
1657          } else {
1658            yield receiveAutosaves(persistedRecord.id, updatedRecord);
1659          }
1660        } else {
1661          let edits = record;
1662  
1663          if (entity.__unstablePrePersist) {
1664            edits = { ...edits,
1665              ...entity.__unstablePrePersist(persistedRecord, edits)
1666            };
1667          }
1668  
1669          const options = {
1670            path,
1671            method: recordId ? 'PUT' : 'POST',
1672            data: edits
1673          };
1674  
1675          if (__unstableFetch) {
1676            updatedRecord = yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(__unstableFetch(options));
1677          } else {
1678            updatedRecord = yield Object(external_wp_dataControls_["apiFetch"])(options);
1679          }
1680  
1681          yield receiveEntityRecords(kind, name, updatedRecord, undefined, true, edits);
1682        }
1683      } catch (_error) {
1684        error = _error;
1685      }
1686  
1687      yield {
1688        type: 'SAVE_ENTITY_RECORD_FINISH',
1689        kind,
1690        name,
1691        recordId,
1692        error,
1693        isAutosave
1694      };
1695      return updatedRecord;
1696    } finally {
1697      yield* __unstableReleaseStoreLock(lock);
1698    }
1699  }
1700  /**
1701   * Runs multiple core-data actions at the same time using one API request.
1702   *
1703   * Example:
1704   *
1705   * ```
1706   * const [ savedRecord, updatedRecord, deletedRecord ] =
1707   *   await dispatch( 'core' ).__experimentalBatch( [
1708   *     ( { saveEntityRecord } ) => saveEntityRecord( 'root', 'widget', widget ),
1709   *     ( { saveEditedEntityRecord } ) => saveEntityRecord( 'root', 'widget', 123 ),
1710   *     ( { deleteEntityRecord } ) => deleteEntityRecord( 'root', 'widget', 123, null ),
1711   *   ] );
1712   * ```
1713   *
1714   * @param {Array} requests Array of functions which are invoked simultaneously.
1715   *                         Each function is passed an object containing
1716   *                         `saveEntityRecord`, `saveEditedEntityRecord`, and
1717   *                         `deleteEntityRecord`.
1718   *
1719   * @return {Promise} A promise that resolves to an array containing the return
1720   *                   values of each function given in `requests`.
1721   */
1722  
1723  function* __experimentalBatch(requests) {
1724    const batch = createBatch();
1725    const dispatch = yield getDispatch();
1726    const api = {
1727      saveEntityRecord(kind, name, record, options) {
1728        return batch.add(add => dispatch('core').saveEntityRecord(kind, name, record, { ...options,
1729          __unstableFetch: add
1730        }));
1731      },
1732  
1733      saveEditedEntityRecord(kind, name, recordId, options) {
1734        return batch.add(add => dispatch('core').saveEditedEntityRecord(kind, name, recordId, { ...options,
1735          __unstableFetch: add
1736        }));
1737      },
1738  
1739      deleteEntityRecord(kind, name, recordId, query, options) {
1740        return batch.add(add => dispatch('core').deleteEntityRecord(kind, name, recordId, query, { ...options,
1741          __unstableFetch: add
1742        }));
1743      }
1744  
1745    };
1746    const resultPromises = requests.map(request => request(api));
1747    const [, ...results] = yield Object(external_wp_dataControls_["__unstableAwaitPromise"])(Promise.all([batch.run(), ...resultPromises]));
1748    return results;
1749  }
1750  /**
1751   * Action triggered to save an entity record's edits.
1752   *
1753   * @param {string} kind     Kind of the entity.
1754   * @param {string} name     Name of the entity.
1755   * @param {Object} recordId ID of the record.
1756   * @param {Object} options  Saving options.
1757   */
1758  
1759  function* saveEditedEntityRecord(kind, name, recordId, options) {
1760    if (!(yield external_wp_data_["controls"].select('core', 'hasEditsForEntityRecord', kind, name, recordId))) {
1761      return;
1762    }
1763  
1764    const edits = yield external_wp_data_["controls"].select('core', 'getEntityRecordNonTransientEdits', kind, name, recordId);
1765    const record = {
1766      id: recordId,
1767      ...edits
1768    };
1769    return yield* saveEntityRecord(kind, name, record, options);
1770  }
1771  /**
1772   * Action triggered to save only specified properties for the entity.
1773   *
1774   * @param {string} kind     Kind of the entity.
1775   * @param {string} name     Name of the entity.
1776   * @param {Object} recordId ID of the record.
1777   * @param {Array} itemsToSave List of entity properties to save.
1778   * @param {Object} options  Saving options.
1779   */
1780  
1781  function* __experimentalSaveSpecifiedEntityEdits(kind, name, recordId, itemsToSave, options) {
1782    if (!(yield external_wp_data_["controls"].select('core', 'hasEditsForEntityRecord', kind, name, recordId))) {
1783      return;
1784    }
1785  
1786    const edits = yield external_wp_data_["controls"].select('core', 'getEntityRecordNonTransientEdits', kind, name, recordId);
1787    const editsToSave = {};
1788  
1789    for (const edit in edits) {
1790      if (itemsToSave.some(item => item === edit)) {
1791        editsToSave[edit] = edits[edit];
1792      }
1793    }
1794  
1795    return yield* saveEntityRecord(kind, name, editsToSave, options);
1796  }
1797  /**
1798   * Returns an action object used in signalling that Upload permissions have been received.
1799   *
1800   * @param {boolean} hasUploadPermissions Does the user have permission to upload files?
1801   *
1802   * @return {Object} Action object.
1803   */
1804  
1805  function receiveUploadPermissions(hasUploadPermissions) {
1806    return {
1807      type: 'RECEIVE_USER_PERMISSION',
1808      key: 'create/media',
1809      isAllowed: hasUploadPermissions
1810    };
1811  }
1812  /**
1813   * Returns an action object used in signalling that the current user has
1814   * permission to perform an action on a REST resource.
1815   *
1816   * @param {string}  key       A key that represents the action and REST resource.
1817   * @param {boolean} isAllowed Whether or not the user can perform the action.
1818   *
1819   * @return {Object} Action object.
1820   */
1821  
1822  function receiveUserPermission(key, isAllowed) {
1823    return {
1824      type: 'RECEIVE_USER_PERMISSION',
1825      key,
1826      isAllowed
1827    };
1828  }
1829  /**
1830   * Returns an action object used in signalling that the autosaves for a
1831   * post have been received.
1832   *
1833   * @param {number}       postId    The id of the post that is parent to the autosave.
1834   * @param {Array|Object} autosaves An array of autosaves or singular autosave object.
1835   *
1836   * @return {Object} Action object.
1837   */
1838  
1839  function receiveAutosaves(postId, autosaves) {
1840    return {
1841      type: 'RECEIVE_AUTOSAVES',
1842      postId,
1843      autosaves: Object(external_lodash_["castArray"])(autosaves)
1844    };
1845  }
1846  
1847  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/entities.js
1848  /**
1849   * External dependencies
1850   */
1851  
1852  /**
1853   * WordPress dependencies
1854   */
1855  
1856  
1857  
1858  
1859  /**
1860   * Internal dependencies
1861   */
1862  
1863  
1864  const DEFAULT_ENTITY_KEY = 'id';
1865  const defaultEntities = [{
1866    label: Object(external_wp_i18n_["__"])('Base'),
1867    name: '__unstableBase',
1868    kind: 'root',
1869    baseURL: ''
1870  }, {
1871    label: Object(external_wp_i18n_["__"])('Site'),
1872    name: 'site',
1873    kind: 'root',
1874    baseURL: '/wp/v2/settings',
1875    getTitle: record => {
1876      return Object(external_lodash_["get"])(record, ['title'], Object(external_wp_i18n_["__"])('Site Title'));
1877    }
1878  }, {
1879    label: Object(external_wp_i18n_["__"])('Post Type'),
1880    name: 'postType',
1881    kind: 'root',
1882    key: 'slug',
1883    baseURL: '/wp/v2/types',
1884    baseURLParams: {
1885      context: 'edit'
1886    }
1887  }, {
1888    name: 'media',
1889    kind: 'root',
1890    baseURL: '/wp/v2/media',
1891    baseURLParams: {
1892      context: 'edit'
1893    },
1894    plural: 'mediaItems',
1895    label: Object(external_wp_i18n_["__"])('Media')
1896  }, {
1897    name: 'taxonomy',
1898    kind: 'root',
1899    key: 'slug',
1900    baseURL: '/wp/v2/taxonomies',
1901    baseURLParams: {
1902      context: 'edit'
1903    },
1904    plural: 'taxonomies',
1905    label: Object(external_wp_i18n_["__"])('Taxonomy')
1906  }, {
1907    name: 'sidebar',
1908    kind: 'root',
1909    baseURL: '/wp/v2/sidebars',
1910    plural: 'sidebars',
1911    transientEdits: {
1912      blocks: true
1913    },
1914    label: Object(external_wp_i18n_["__"])('Widget areas')
1915  }, {
1916    name: 'widget',
1917    kind: 'root',
1918    baseURL: '/wp/v2/widgets',
1919    baseURLParams: {
1920      context: 'edit'
1921    },
1922    plural: 'widgets',
1923    transientEdits: {
1924      blocks: true
1925    },
1926    label: Object(external_wp_i18n_["__"])('Widgets')
1927  }, {
1928    name: 'widgetType',
1929    kind: 'root',
1930    baseURL: '/wp/v2/widget-types',
1931    baseURLParams: {
1932      context: 'edit'
1933    },
1934    plural: 'widgetTypes',
1935    label: Object(external_wp_i18n_["__"])('Widget types')
1936  }, {
1937    label: Object(external_wp_i18n_["__"])('User'),
1938    name: 'user',
1939    kind: 'root',
1940    baseURL: '/wp/v2/users',
1941    baseURLParams: {
1942      context: 'edit'
1943    },
1944    plural: 'users'
1945  }, {
1946    name: 'comment',
1947    kind: 'root',
1948    baseURL: '/wp/v2/comments',
1949    baseURLParams: {
1950      context: 'edit'
1951    },
1952    plural: 'comments',
1953    label: Object(external_wp_i18n_["__"])('Comment')
1954  }, {
1955    name: 'menu',
1956    kind: 'root',
1957    baseURL: '/__experimental/menus',
1958    baseURLParams: {
1959      context: 'edit'
1960    },
1961    plural: 'menus',
1962    label: Object(external_wp_i18n_["__"])('Menu')
1963  }, {
1964    name: 'menuItem',
1965    kind: 'root',
1966    baseURL: '/__experimental/menu-items',
1967    baseURLParams: {
1968      context: 'edit'
1969    },
1970    plural: 'menuItems',
1971    label: Object(external_wp_i18n_["__"])('Menu Item')
1972  }, {
1973    name: 'menuLocation',
1974    kind: 'root',
1975    baseURL: '/__experimental/menu-locations',
1976    baseURLParams: {
1977      context: 'edit'
1978    },
1979    plural: 'menuLocations',
1980    label: Object(external_wp_i18n_["__"])('Menu Location'),
1981    key: 'name'
1982  }];
1983  const kinds = [{
1984    name: 'postType',
1985    loadEntities: loadPostTypeEntities
1986  }, {
1987    name: 'taxonomy',
1988    loadEntities: loadTaxonomyEntities
1989  }];
1990  /**
1991   * Returns a function to be used to retrieve extra edits to apply before persisting a post type.
1992   *
1993   * @param {Object} persistedRecord Already persisted Post
1994   * @param {Object} edits Edits.
1995   * @return {Object} Updated edits.
1996   */
1997  
1998  const prePersistPostType = (persistedRecord, edits) => {
1999    const newEdits = {};
2000  
2001    if ((persistedRecord === null || persistedRecord === void 0 ? void 0 : persistedRecord.status) === 'auto-draft') {
2002      // Saving an auto-draft should create a draft by default.
2003      if (!edits.status && !newEdits.status) {
2004        newEdits.status = 'draft';
2005      } // Fix the auto-draft default title.
2006  
2007  
2008      if ((!edits.title || edits.title === 'Auto Draft') && !newEdits.title && (!(persistedRecord !== null && persistedRecord !== void 0 && persistedRecord.title) || (persistedRecord === null || persistedRecord === void 0 ? void 0 : persistedRecord.title) === 'Auto Draft')) {
2009        newEdits.title = '';
2010      }
2011    }
2012  
2013    return newEdits;
2014  };
2015  /**
2016   * Returns the list of post type entities.
2017   *
2018   * @return {Promise} Entities promise
2019   */
2020  
2021  function* loadPostTypeEntities() {
2022    const postTypes = yield Object(external_wp_dataControls_["apiFetch"])({
2023      path: '/wp/v2/types?context=edit'
2024    });
2025    return Object(external_lodash_["map"])(postTypes, (postType, name) => {
2026      const isTemplate = ['wp_template', 'wp_template_part'].includes(name);
2027      return {
2028        kind: 'postType',
2029        baseURL: '/wp/v2/' + postType.rest_base,
2030        baseURLParams: {
2031          context: 'edit'
2032        },
2033        name,
2034        label: postType.labels.singular_name,
2035        transientEdits: {
2036          blocks: true,
2037          selection: true
2038        },
2039        mergedEdits: {
2040          meta: true
2041        },
2042        getTitle: record => {
2043          var _record$title;
2044  
2045          return (record === null || record === void 0 ? void 0 : (_record$title = record.title) === null || _record$title === void 0 ? void 0 : _record$title.rendered) || (record === null || record === void 0 ? void 0 : record.title) || (isTemplate ? Object(external_lodash_["startCase"])(record.slug) : String(record.id));
2046        },
2047        __unstablePrePersist: isTemplate ? undefined : prePersistPostType,
2048        __unstable_rest_base: postType.rest_base
2049      };
2050    });
2051  }
2052  /**
2053   * Returns the list of the taxonomies entities.
2054   *
2055   * @return {Promise} Entities promise
2056   */
2057  
2058  
2059  function* loadTaxonomyEntities() {
2060    const taxonomies = yield Object(external_wp_dataControls_["apiFetch"])({
2061      path: '/wp/v2/taxonomies?context=edit'
2062    });
2063    return Object(external_lodash_["map"])(taxonomies, (taxonomy, name) => {
2064      return {
2065        kind: 'taxonomy',
2066        baseURL: '/wp/v2/' + taxonomy.rest_base,
2067        baseURLParams: {
2068          context: 'edit'
2069        },
2070        name,
2071        label: taxonomy.labels.singular_name
2072      };
2073    });
2074  }
2075  /**
2076   * Returns the entity's getter method name given its kind and name.
2077   *
2078   * @param {string}  kind      Entity kind.
2079   * @param {string}  name      Entity name.
2080   * @param {string}  prefix    Function prefix.
2081   * @param {boolean} usePlural Whether to use the plural form or not.
2082   *
2083   * @return {string} Method name
2084   */
2085  
2086  
2087  const getMethodName = (kind, name, prefix = 'get', usePlural = false) => {
2088    const entity = Object(external_lodash_["find"])(defaultEntities, {
2089      kind,
2090      name
2091    });
2092    const kindPrefix = kind === 'root' ? '' : Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(kind));
2093    const nameSuffix = Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(name)) + (usePlural ? 's' : '');
2094    const suffix = usePlural && entity.plural ? Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(entity.plural)) : nameSuffix;
2095    return `$prefix}$kindPrefix}$suffix}`;
2096  };
2097  /**
2098   * Loads the kind entities into the store.
2099   *
2100   * @param {string} kind  Kind
2101   *
2102   * @return {Array} Entities
2103   */
2104  
2105  function* getKindEntities(kind) {
2106    let entities = yield external_wp_data_["controls"].select('core', 'getEntitiesByKind', kind);
2107  
2108    if (entities && entities.length !== 0) {
2109      return entities;
2110    }
2111  
2112    const kindConfig = Object(external_lodash_["find"])(kinds, {
2113      name: kind
2114    });
2115  
2116    if (!kindConfig) {
2117      return [];
2118    }
2119  
2120    entities = yield kindConfig.loadEntities();
2121    yield addEntities(entities);
2122    return entities;
2123  }
2124  
2125  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/get-normalized-comma-separable.js
2126  /**
2127   * Given a value which can be specified as one or the other of a comma-separated
2128   * string or an array, returns a value normalized to an array of strings, or
2129   * null if the value cannot be interpreted as either.
2130   *
2131   * @param {string|string[]|*} value
2132   *
2133   * @return {?(string[])} Normalized field value.
2134   */
2135  function getNormalizedCommaSeparable(value) {
2136    if (typeof value === 'string') {
2137      return value.split(',');
2138    } else if (Array.isArray(value)) {
2139      return value;
2140    }
2141  
2142    return null;
2143  }
2144  
2145  /* harmony default export */ var get_normalized_comma_separable = (getNormalizedCommaSeparable);
2146  
2147  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/with-weak-map-cache.js
2148  /**
2149   * External dependencies
2150   */
2151  
2152  /**
2153   * Given a function, returns an enhanced function which caches the result and
2154   * tracks in WeakMap. The result is only cached if the original function is
2155   * passed a valid object-like argument (requirement for WeakMap key).
2156   *
2157   * @param {Function} fn Original function.
2158   *
2159   * @return {Function} Enhanced caching function.
2160   */
2161  
2162  function withWeakMapCache(fn) {
2163    const cache = new WeakMap();
2164    return key => {
2165      let value;
2166  
2167      if (cache.has(key)) {
2168        value = cache.get(key);
2169      } else {
2170        value = fn(key); // Can reach here if key is not valid for WeakMap, since `has`
2171        // will return false for invalid key. Since `set` will throw,
2172        // ensure that key is valid before setting into cache.
2173  
2174        if (Object(external_lodash_["isObjectLike"])(key)) {
2175          cache.set(key, value);
2176        }
2177      }
2178  
2179      return value;
2180    };
2181  }
2182  
2183  /* harmony default export */ var with_weak_map_cache = (withWeakMapCache);
2184  
2185  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js
2186  /**
2187   * WordPress dependencies
2188   */
2189  
2190  /**
2191   * Internal dependencies
2192   */
2193  
2194  
2195  /**
2196   * An object of properties describing a specific query.
2197   *
2198   * @typedef {Object} WPQueriedDataQueryParts
2199   *
2200   * @property {number}      page      The query page (1-based index, default 1).
2201   * @property {number}      perPage   Items per page for query (default 10).
2202   * @property {string}      stableKey An encoded stable string of all non-
2203   *                                   pagination, non-fields query parameters.
2204   * @property {?(string[])} fields    Target subset of fields to derive from
2205   *                                   item objects.
2206   * @property {?(number[])} include   Specific item IDs to include.
2207   */
2208  
2209  /**
2210   * Given a query object, returns an object of parts, including pagination
2211   * details (`page` and `perPage`, or default values). All other properties are
2212   * encoded into a stable (idempotent) `stableKey` value.
2213   *
2214   * @param {Object} query Optional query object.
2215   *
2216   * @return {WPQueriedDataQueryParts} Query parts.
2217   */
2218  
2219  function getQueryParts(query) {
2220    /**
2221     * @type {WPQueriedDataQueryParts}
2222     */
2223    const parts = {
2224      stableKey: '',
2225      page: 1,
2226      perPage: 10,
2227      fields: null,
2228      include: null,
2229      context: 'default'
2230    }; // Ensure stable key by sorting keys. Also more efficient for iterating.
2231  
2232    const keys = Object.keys(query).sort();
2233  
2234    for (let i = 0; i < keys.length; i++) {
2235      const key = keys[i];
2236      let value = query[key];
2237  
2238      switch (key) {
2239        case 'page':
2240          parts[key] = Number(value);
2241          break;
2242  
2243        case 'per_page':
2244          parts.perPage = Number(value);
2245          break;
2246  
2247        case 'include':
2248          parts.include = get_normalized_comma_separable(value).map(Number);
2249          break;
2250  
2251        case 'context':
2252          parts.context = value;
2253          break;
2254  
2255        default:
2256          // While in theory, we could exclude "_fields" from the stableKey
2257          // because two request with different fields have the same results
2258          // We're not able to ensure that because the server can decide to omit
2259          // fields from the response even if we explicitely asked for it.
2260          // Example: Asking for titles in posts without title support.
2261          if (key === '_fields') {
2262            parts.fields = get_normalized_comma_separable(value); // Make sure to normalize value for `stableKey`
2263  
2264            value = parts.fields.join();
2265          } // While it could be any deterministic string, for simplicity's
2266          // sake mimic querystring encoding for stable key.
2267          //
2268          // TODO: For consistency with PHP implementation, addQueryArgs
2269          // should accept a key value pair, which may optimize its
2270          // implementation for our use here, vs. iterating an object
2271          // with only a single key.
2272  
2273  
2274          parts.stableKey += (parts.stableKey ? '&' : '') + Object(external_wp_url_["addQueryArgs"])('', {
2275            [key]: value
2276          }).slice(1);
2277      }
2278    }
2279  
2280    return parts;
2281  }
2282  /* harmony default export */ var get_query_parts = (with_weak_map_cache(getQueryParts));
2283  
2284  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/reducer.js
2285  /**
2286   * External dependencies
2287   */
2288  
2289  /**
2290   * WordPress dependencies
2291   */
2292  
2293  
2294  /**
2295   * Internal dependencies
2296   */
2297  
2298  
2299  
2300  
2301  
2302  function getContextFromAction(action) {
2303    const {
2304      query
2305    } = action;
2306  
2307    if (!query) {
2308      return 'default';
2309    }
2310  
2311    const queryParts = get_query_parts(query);
2312    return queryParts.context;
2313  }
2314  /**
2315   * Returns a merged array of item IDs, given details of the received paginated
2316   * items. The array is sparse-like with `undefined` entries where holes exist.
2317   *
2318   * @param {?Array<number>} itemIds     Original item IDs (default empty array).
2319   * @param {number[]}       nextItemIds Item IDs to merge.
2320   * @param {number}         page        Page of items merged.
2321   * @param {number}         perPage     Number of items per page.
2322   *
2323   * @return {number[]} Merged array of item IDs.
2324   */
2325  
2326  
2327  function getMergedItemIds(itemIds, nextItemIds, page, perPage) {
2328    const receivedAllIds = page === 1 && perPage === -1;
2329  
2330    if (receivedAllIds) {
2331      return nextItemIds;
2332    }
2333  
2334    const nextItemIdsStartIndex = (page - 1) * perPage; // If later page has already been received, default to the larger known
2335    // size of the existing array, else calculate as extending the existing.
2336  
2337    const size = Math.max(itemIds.length, nextItemIdsStartIndex + nextItemIds.length); // Preallocate array since size is known.
2338  
2339    const mergedItemIds = new Array(size);
2340  
2341    for (let i = 0; i < size; i++) {
2342      // Preserve existing item ID except for subset of range of next items.
2343      const isInNextItemsRange = i >= nextItemIdsStartIndex && i < nextItemIdsStartIndex + nextItemIds.length;
2344      mergedItemIds[i] = isInNextItemsRange ? nextItemIds[i - nextItemIdsStartIndex] : itemIds[i];
2345    }
2346  
2347    return mergedItemIds;
2348  }
2349  /**
2350   * Reducer tracking items state, keyed by ID. Items are assumed to be normal,
2351   * where identifiers are common across all queries.
2352   *
2353   * @param {Object} state  Current state.
2354   * @param {Object} action Dispatched action.
2355   *
2356   * @return {Object} Next state.
2357   */
2358  
2359  function reducer_items(state = {}, action) {
2360    switch (action.type) {
2361      case 'RECEIVE_ITEMS':
2362        {
2363          const context = getContextFromAction(action);
2364          const key = action.key || DEFAULT_ENTITY_KEY;
2365          return { ...state,
2366            [context]: { ...state[context],
2367              ...action.items.reduce((accumulator, value) => {
2368                var _state$context;
2369  
2370                const itemId = value[key];
2371                accumulator[itemId] = conservativeMapItem(state === null || state === void 0 ? void 0 : (_state$context = state[context]) === null || _state$context === void 0 ? void 0 : _state$context[itemId], value);
2372                return accumulator;
2373              }, {})
2374            }
2375          };
2376        }
2377  
2378      case 'REMOVE_ITEMS':
2379        return Object(external_lodash_["mapValues"])(state, contextState => Object(external_lodash_["omit"])(contextState, action.itemIds));
2380    }
2381  
2382    return state;
2383  }
2384  /**
2385   * Reducer tracking item completeness, keyed by ID. A complete item is one for
2386   * which all fields are known. This is used in supporting `_fields` queries,
2387   * where not all properties associated with an entity are necessarily returned.
2388   * In such cases, completeness is used as an indication of whether it would be
2389   * safe to use queried data for a non-`_fields`-limited request.
2390   *
2391   * @param {Object<string,boolean>} state  Current state.
2392   * @param {Object} action Dispatched action.
2393   *
2394   * @return {Object<string,boolean>} Next state.
2395   */
2396  
2397  function itemIsComplete(state = {}, action) {
2398    switch (action.type) {
2399      case 'RECEIVE_ITEMS':
2400        {
2401          const context = getContextFromAction(action);
2402          const {
2403            query,
2404            key = DEFAULT_ENTITY_KEY
2405          } = action; // An item is considered complete if it is received without an associated
2406          // fields query. Ideally, this would be implemented in such a way where the
2407          // complete aggregate of all fields would satisfy completeness. Since the
2408          // fields are not consistent across all entity types, this would require
2409          // introspection on the REST schema for each entity to know which fields
2410          // compose a complete item for that entity.
2411  
2412          const queryParts = query ? get_query_parts(query) : {};
2413          const isCompleteQuery = !query || !Array.isArray(queryParts.fields);
2414          return { ...state,
2415            [context]: { ...state[context],
2416              ...action.items.reduce((result, item) => {
2417                var _state$context2;
2418  
2419                const itemId = item[key]; // Defer to completeness if already assigned. Technically the
2420                // data may be outdated if receiving items for a field subset.
2421  
2422                result[itemId] = (state === null || state === void 0 ? void 0 : (_state$context2 = state[context]) === null || _state$context2 === void 0 ? void 0 : _state$context2[itemId]) || isCompleteQuery;
2423                return result;
2424              }, {})
2425            }
2426          };
2427        }
2428  
2429      case 'REMOVE_ITEMS':
2430        return Object(external_lodash_["mapValues"])(state, contextState => Object(external_lodash_["omit"])(contextState, action.itemIds));
2431    }
2432  
2433    return state;
2434  }
2435  /**
2436   * Reducer tracking queries state, keyed by stable query key. Each reducer
2437   * query object includes `itemIds` and `requestingPageByPerPage`.
2438   *
2439   * @param {Object} state  Current state.
2440   * @param {Object} action Dispatched action.
2441   *
2442   * @return {Object} Next state.
2443   */
2444  
2445  const receiveQueries = Object(external_lodash_["flowRight"])([// Limit to matching action type so we don't attempt to replace action on
2446  // an unhandled action.
2447  if_matching_action(action => 'query' in action), // Inject query parts into action for use both in `onSubKey` and reducer.
2448  replace_action(action => {
2449    // `ifMatchingAction` still passes on initialization, where state is
2450    // undefined and a query is not assigned. Avoid attempting to parse
2451    // parts. `onSubKey` will omit by lack of `stableKey`.
2452    if (action.query) {
2453      return { ...action,
2454        ...get_query_parts(action.query)
2455      };
2456    }
2457  
2458    return action;
2459  }), on_sub_key('context'), // Queries shape is shared, but keyed by query `stableKey` part. Original
2460  // reducer tracks only a single query object.
2461  on_sub_key('stableKey')])((state = null, action) => {
2462    const {
2463      type,
2464      page,
2465      perPage,
2466      key = DEFAULT_ENTITY_KEY
2467    } = action;
2468  
2469    if (type !== 'RECEIVE_ITEMS') {
2470      return state;
2471    }
2472  
2473    return getMergedItemIds(state || [], Object(external_lodash_["map"])(action.items, key), page, perPage);
2474  });
2475  /**
2476   * Reducer tracking queries state.
2477   *
2478   * @param {Object} state  Current state.
2479   * @param {Object} action Dispatched action.
2480   *
2481   * @return {Object} Next state.
2482   */
2483  
2484  const reducer_queries = (state = {}, action) => {
2485    switch (action.type) {
2486      case 'RECEIVE_ITEMS':
2487        return receiveQueries(state, action);
2488  
2489      case 'REMOVE_ITEMS':
2490        const removedItems = action.itemIds.reduce((result, itemId) => {
2491          result[itemId] = true;
2492          return result;
2493        }, {});
2494        return Object(external_lodash_["mapValues"])(state, contextQueries => {
2495          return Object(external_lodash_["mapValues"])(contextQueries, queryItems => {
2496            return Object(external_lodash_["filter"])(queryItems, queryId => {
2497              return !removedItems[queryId];
2498            });
2499          });
2500        });
2501  
2502      default:
2503        return state;
2504    }
2505  };
2506  
2507  /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
2508    items: reducer_items,
2509    itemIsComplete,
2510    queries: reducer_queries
2511  }));
2512  
2513  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/utils.js
2514  function deepCopyLocksTreePath(tree, path) {
2515    const newTree = { ...tree
2516    };
2517    let currentNode = newTree;
2518  
2519    for (const branchName of path) {
2520      currentNode.children = { ...currentNode.children,
2521        [branchName]: {
2522          locks: [],
2523          children: {},
2524          ...currentNode.children[branchName]
2525        }
2526      };
2527      currentNode = currentNode.children[branchName];
2528    }
2529  
2530    return newTree;
2531  }
2532  function getNode(tree, path) {
2533    let currentNode = tree;
2534  
2535    for (const branchName of path) {
2536      const nextNode = currentNode.children[branchName];
2537  
2538      if (!nextNode) {
2539        return null;
2540      }
2541  
2542      currentNode = nextNode;
2543    }
2544  
2545    return currentNode;
2546  }
2547  function* iteratePath(tree, path) {
2548    let currentNode = tree;
2549    yield currentNode;
2550  
2551    for (const branchName of path) {
2552      const nextNode = currentNode.children[branchName];
2553  
2554      if (!nextNode) {
2555        break;
2556      }
2557  
2558      yield nextNode;
2559      currentNode = nextNode;
2560    }
2561  }
2562  function* iterateDescendants(node) {
2563    const stack = Object.values(node.children);
2564  
2565    while (stack.length) {
2566      const childNode = stack.pop();
2567      yield childNode;
2568      stack.push(...Object.values(childNode.children));
2569    }
2570  }
2571  function hasConflictingLock({
2572    exclusive
2573  }, locks) {
2574    if (exclusive && locks.length) {
2575      return true;
2576    }
2577  
2578    if (!exclusive && locks.filter(lock => lock.exclusive).length) {
2579      return true;
2580    }
2581  
2582    return false;
2583  }
2584  
2585  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/reducer.js
2586  /**
2587   * Internal dependencies
2588   */
2589  
2590  const DEFAULT_STATE = {
2591    requests: [],
2592    tree: {
2593      locks: [],
2594      children: {}
2595    }
2596  };
2597  /**
2598   * Reducer returning locks.
2599   *
2600   * @param  {Object} state  Current state.
2601   * @param  {Object} action Dispatched action.
2602   *
2603   * @return {Object} Updated state.
2604   */
2605  
2606  function reducer_locks(state = DEFAULT_STATE, action) {
2607    switch (action.type) {
2608      case 'ENQUEUE_LOCK_REQUEST':
2609        {
2610          const {
2611            request
2612          } = action;
2613          return { ...state,
2614            requests: [request, ...state.requests]
2615          };
2616        }
2617  
2618      case 'GRANT_LOCK_REQUEST':
2619        {
2620          const {
2621            lock,
2622            request
2623          } = action;
2624          const {
2625            store,
2626            path
2627          } = request;
2628          const storePath = [store, ...path];
2629          const newTree = deepCopyLocksTreePath(state.tree, storePath);
2630          const node = getNode(newTree, storePath);
2631          node.locks = [...node.locks, lock];
2632          return { ...state,
2633            requests: state.requests.filter(r => r !== request),
2634            tree: newTree
2635          };
2636        }
2637  
2638      case 'RELEASE_LOCK':
2639        {
2640          const {
2641            lock
2642          } = action;
2643          const storePath = [lock.store, ...lock.path];
2644          const newTree = deepCopyLocksTreePath(state.tree, storePath);
2645          const node = getNode(newTree, storePath);
2646          node.locks = node.locks.filter(l => l !== lock);
2647          return { ...state,
2648            tree: newTree
2649          };
2650        }
2651    }
2652  
2653    return state;
2654  }
2655  /* harmony default export */ var locks_reducer = (reducer_locks);
2656  
2657  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/reducer.js
2658  /**
2659   * External dependencies
2660   */
2661  
2662  /**
2663   * WordPress dependencies
2664   */
2665  
2666  
2667  
2668  /**
2669   * Internal dependencies
2670   */
2671  
2672  
2673  
2674  
2675  
2676  /**
2677   * Reducer managing terms state. Keyed by taxonomy slug, the value is either
2678   * undefined (if no request has been made for given taxonomy), null (if a
2679   * request is in-flight for given taxonomy), or the array of terms for the
2680   * taxonomy.
2681   *
2682   * @param {Object} state  Current state.
2683   * @param {Object} action Dispatched action.
2684   *
2685   * @return {Object} Updated state.
2686   */
2687  
2688  function terms(state = {}, action) {
2689    switch (action.type) {
2690      case 'RECEIVE_TERMS':
2691        return { ...state,
2692          [action.taxonomy]: action.terms
2693        };
2694    }
2695  
2696    return state;
2697  }
2698  /**
2699   * Reducer managing authors state. Keyed by id.
2700   *
2701   * @param {Object} state  Current state.
2702   * @param {Object} action Dispatched action.
2703   *
2704   * @return {Object} Updated state.
2705   */
2706  
2707  function reducer_users(state = {
2708    byId: {},
2709    queries: {}
2710  }, action) {
2711    switch (action.type) {
2712      case 'RECEIVE_USER_QUERY':
2713        return {
2714          byId: { ...state.byId,
2715            ...Object(external_lodash_["keyBy"])(action.users, 'id')
2716          },
2717          queries: { ...state.queries,
2718            [action.queryID]: Object(external_lodash_["map"])(action.users, user => user.id)
2719          }
2720        };
2721    }
2722  
2723    return state;
2724  }
2725  /**
2726   * Reducer managing current user state.
2727   *
2728   * @param {Object} state  Current state.
2729   * @param {Object} action Dispatched action.
2730   *
2731   * @return {Object} Updated state.
2732   */
2733  
2734  function reducer_currentUser(state = {}, action) {
2735    switch (action.type) {
2736      case 'RECEIVE_CURRENT_USER':
2737        return action.currentUser;
2738    }
2739  
2740    return state;
2741  }
2742  /**
2743   * Reducer managing taxonomies.
2744   *
2745   * @param {Object} state  Current state.
2746   * @param {Object} action Dispatched action.
2747   *
2748   * @return {Object} Updated state.
2749   */
2750  
2751  function reducer_taxonomies(state = [], action) {
2752    switch (action.type) {
2753      case 'RECEIVE_TAXONOMIES':
2754        return action.taxonomies;
2755    }
2756  
2757    return state;
2758  }
2759  /**
2760   * Reducer managing the current theme.
2761   *
2762   * @param {string} state  Current state.
2763   * @param {Object} action Dispatched action.
2764   *
2765   * @return {string} Updated state.
2766   */
2767  
2768  function currentTheme(state = undefined, action) {
2769    switch (action.type) {
2770      case 'RECEIVE_CURRENT_THEME':
2771        return action.currentTheme.stylesheet;
2772    }
2773  
2774    return state;
2775  }
2776  /**
2777   * Reducer managing installed themes.
2778   *
2779   * @param {Object} state  Current state.
2780   * @param {Object} action Dispatched action.
2781   *
2782   * @return {Object} Updated state.
2783   */
2784  
2785  function themes(state = {}, action) {
2786    switch (action.type) {
2787      case 'RECEIVE_CURRENT_THEME':
2788        return { ...state,
2789          [action.currentTheme.stylesheet]: action.currentTheme
2790        };
2791    }
2792  
2793    return state;
2794  }
2795  /**
2796   * Reducer managing theme supports data.
2797   *
2798   * @param {Object} state  Current state.
2799   * @param {Object} action Dispatched action.
2800   *
2801   * @return {Object} Updated state.
2802   */
2803  
2804  function themeSupports(state = {}, action) {
2805    switch (action.type) {
2806      case 'RECEIVE_THEME_SUPPORTS':
2807        return { ...state,
2808          ...action.themeSupports
2809        };
2810    }
2811  
2812    return state;
2813  }
2814  /**
2815   * Higher Order Reducer for a given entity config. It supports:
2816   *
2817   *  - Fetching
2818   *  - Editing
2819   *  - Saving
2820   *
2821   * @param {Object} entityConfig  Entity config.
2822   *
2823   * @return {Function} Reducer.
2824   */
2825  
2826  function reducer_entity(entityConfig) {
2827    return Object(external_lodash_["flowRight"])([// Limit to matching action type so we don't attempt to replace action on
2828    // an unhandled action.
2829    if_matching_action(action => action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind), // Inject the entity config into the action.
2830    replace_action(action => {
2831      return { ...action,
2832        key: entityConfig.key || DEFAULT_ENTITY_KEY
2833      };
2834    })])(Object(external_wp_data_["combineReducers"])({
2835      queriedData: reducer,
2836      edits: (state = {}, action) => {
2837        var _action$query$context, _action$query;
2838  
2839        switch (action.type) {
2840          case 'RECEIVE_ITEMS':
2841            const context = (_action$query$context = action === null || action === void 0 ? void 0 : (_action$query = action.query) === null || _action$query === void 0 ? void 0 : _action$query.context) !== null && _action$query$context !== void 0 ? _action$query$context : 'default';
2842  
2843            if (context !== 'default') {
2844              return state;
2845            }
2846  
2847            const nextState = { ...state
2848            };
2849  
2850            for (const record of action.items) {
2851              const recordId = record[action.key];
2852              const edits = nextState[recordId];
2853  
2854              if (!edits) {
2855                continue;
2856              }
2857  
2858              const nextEdits = Object.keys(edits).reduce((acc, key) => {
2859                // If the edited value is still different to the persisted value,
2860                // keep the edited value in edits.
2861                if ( // Edits are the "raw" attribute values, but records may have
2862                // objects with more properties, so we use `get` here for the
2863                // comparison.
2864                !Object(external_lodash_["isEqual"])(edits[key], Object(external_lodash_["get"])(record[key], 'raw', record[key])) && ( // Sometimes the server alters the sent value which means
2865                // we need to also remove the edits before the api request.
2866                !action.persistedEdits || !Object(external_lodash_["isEqual"])(edits[key], action.persistedEdits[key]))) {
2867                  acc[key] = edits[key];
2868                }
2869  
2870                return acc;
2871              }, {});
2872  
2873              if (Object.keys(nextEdits).length) {
2874                nextState[recordId] = nextEdits;
2875              } else {
2876                delete nextState[recordId];
2877              }
2878            }
2879  
2880            return nextState;
2881  
2882          case 'EDIT_ENTITY_RECORD':
2883            const nextEdits = { ...state[action.recordId],
2884              ...action.edits
2885            };
2886            Object.keys(nextEdits).forEach(key => {
2887              // Delete cleared edits so that the properties
2888              // are not considered dirty.
2889              if (nextEdits[key] === undefined) {
2890                delete nextEdits[key];
2891              }
2892            });
2893            return { ...state,
2894              [action.recordId]: nextEdits
2895            };
2896        }
2897  
2898        return state;
2899      },
2900      saving: (state = {}, action) => {
2901        switch (action.type) {
2902          case 'SAVE_ENTITY_RECORD_START':
2903          case 'SAVE_ENTITY_RECORD_FINISH':
2904            return { ...state,
2905              [action.recordId]: {
2906                pending: action.type === 'SAVE_ENTITY_RECORD_START',
2907                error: action.error,
2908                isAutosave: action.isAutosave
2909              }
2910            };
2911        }
2912  
2913        return state;
2914      },
2915      deleting: (state = {}, action) => {
2916        switch (action.type) {
2917          case 'DELETE_ENTITY_RECORD_START':
2918          case 'DELETE_ENTITY_RECORD_FINISH':
2919            return { ...state,
2920              [action.recordId]: {
2921                pending: action.type === 'DELETE_ENTITY_RECORD_START',
2922                error: action.error
2923              }
2924            };
2925        }
2926  
2927        return state;
2928      }
2929    }));
2930  }
2931  /**
2932   * Reducer keeping track of the registered entities.
2933   *
2934   * @param {Object} state  Current state.
2935   * @param {Object} action Dispatched action.
2936   *
2937   * @return {Object} Updated state.
2938   */
2939  
2940  
2941  function entitiesConfig(state = defaultEntities, action) {
2942    switch (action.type) {
2943      case 'ADD_ENTITIES':
2944        return [...state, ...action.entities];
2945    }
2946  
2947    return state;
2948  }
2949  /**
2950   * Reducer keeping track of the registered entities config and data.
2951   *
2952   * @param {Object} state  Current state.
2953   * @param {Object} action Dispatched action.
2954   *
2955   * @return {Object} Updated state.
2956   */
2957  
2958  const reducer_entities = (state = {}, action) => {
2959    const newConfig = entitiesConfig(state.config, action); // Generates a dynamic reducer for the entities
2960  
2961    let entitiesDataReducer = state.reducer;
2962  
2963    if (!entitiesDataReducer || newConfig !== state.config) {
2964      const entitiesByKind = Object(external_lodash_["groupBy"])(newConfig, 'kind');
2965      entitiesDataReducer = Object(external_wp_data_["combineReducers"])(Object.entries(entitiesByKind).reduce((memo, [kind, subEntities]) => {
2966        const kindReducer = Object(external_wp_data_["combineReducers"])(subEntities.reduce((kindMemo, entityConfig) => ({ ...kindMemo,
2967          [entityConfig.name]: reducer_entity(entityConfig)
2968        }), {}));
2969        memo[kind] = kindReducer;
2970        return memo;
2971      }, {}));
2972    }
2973  
2974    const newData = entitiesDataReducer(state.data, action);
2975  
2976    if (newData === state.data && newConfig === state.config && entitiesDataReducer === state.reducer) {
2977      return state;
2978    }
2979  
2980    return {
2981      reducer: entitiesDataReducer,
2982      data: newData,
2983      config: newConfig
2984    };
2985  };
2986  /**
2987   * Reducer keeping track of entity edit undo history.
2988   *
2989   * @param {Object} state  Current state.
2990   * @param {Object} action Dispatched action.
2991   *
2992   * @return {Object} Updated state.
2993   */
2994  
2995  const UNDO_INITIAL_STATE = [];
2996  UNDO_INITIAL_STATE.offset = 0;
2997  let lastEditAction;
2998  function reducer_undo(state = UNDO_INITIAL_STATE, action) {
2999    switch (action.type) {
3000      case 'EDIT_ENTITY_RECORD':
3001      case 'CREATE_UNDO_LEVEL':
3002        let isCreateUndoLevel = action.type === 'CREATE_UNDO_LEVEL';
3003        const isUndoOrRedo = !isCreateUndoLevel && (action.meta.isUndo || action.meta.isRedo);
3004  
3005        if (isCreateUndoLevel) {
3006          action = lastEditAction;
3007        } else if (!isUndoOrRedo) {
3008          // Don't lose the last edit cache if the new one only has transient edits.
3009          // Transient edits don't create new levels so updating the cache would make
3010          // us skip an edit later when creating levels explicitly.
3011          if (Object.keys(action.edits).some(key => !action.transientEdits[key])) {
3012            lastEditAction = action;
3013          } else {
3014            lastEditAction = { ...action,
3015              edits: { ...(lastEditAction && lastEditAction.edits),
3016                ...action.edits
3017              }
3018            };
3019          }
3020        }
3021  
3022        let nextState;
3023  
3024        if (isUndoOrRedo) {
3025          nextState = [...state];
3026          nextState.offset = state.offset + (action.meta.isUndo ? -1 : 1);
3027  
3028          if (state.flattenedUndo) {
3029            // The first undo in a sequence of undos might happen while we have
3030            // flattened undos in state. If this is the case, we want execution
3031            // to continue as if we were creating an explicit undo level. This
3032            // will result in an extra undo level being appended with the flattened
3033            // undo values.
3034            isCreateUndoLevel = true;
3035            action = lastEditAction;
3036          } else {
3037            return nextState;
3038          }
3039        }
3040  
3041        if (!action.meta.undo) {
3042          return state;
3043        } // Transient edits don't create an undo level, but are
3044        // reachable in the next meaningful edit to which they
3045        // are merged. They are defined in the entity's config.
3046  
3047  
3048        if (!isCreateUndoLevel && !Object.keys(action.edits).some(key => !action.transientEdits[key])) {
3049          nextState = [...state];
3050          nextState.flattenedUndo = { ...state.flattenedUndo,
3051            ...action.edits
3052          };
3053          nextState.offset = state.offset;
3054          return nextState;
3055        } // Clear potential redos, because this only supports linear history.
3056  
3057  
3058        nextState = nextState || state.slice(0, state.offset || undefined);
3059        nextState.offset = nextState.offset || 0;
3060        nextState.pop();
3061  
3062        if (!isCreateUndoLevel) {
3063          nextState.push({
3064            kind: action.meta.undo.kind,
3065            name: action.meta.undo.name,
3066            recordId: action.meta.undo.recordId,
3067            edits: { ...state.flattenedUndo,
3068              ...action.meta.undo.edits
3069            }
3070          });
3071        } // When an edit is a function it's an optimization to avoid running some expensive operation.
3072        // We can't rely on the function references being the same so we opt out of comparing them here.
3073  
3074  
3075        const comparisonUndoEdits = Object.values(action.meta.undo.edits).filter(edit => typeof edit !== 'function');
3076        const comparisonEdits = Object.values(action.edits).filter(edit => typeof edit !== 'function');
3077  
3078        if (!external_wp_isShallowEqual_default()(comparisonUndoEdits, comparisonEdits)) {
3079          nextState.push({
3080            kind: action.kind,
3081            name: action.name,
3082            recordId: action.recordId,
3083            edits: isCreateUndoLevel ? { ...state.flattenedUndo,
3084              ...action.edits
3085            } : action.edits
3086          });
3087        }
3088  
3089        return nextState;
3090    }
3091  
3092    return state;
3093  }
3094  /**
3095   * Reducer managing embed preview data.
3096   *
3097   * @param {Object} state  Current state.
3098   * @param {Object} action Dispatched action.
3099   *
3100   * @return {Object} Updated state.
3101   */
3102  
3103  function embedPreviews(state = {}, action) {
3104    switch (action.type) {
3105      case 'RECEIVE_EMBED_PREVIEW':
3106        const {
3107          url,
3108          preview
3109        } = action;
3110        return { ...state,
3111          [url]: preview
3112        };
3113    }
3114  
3115    return state;
3116  }
3117  /**
3118   * State which tracks whether the user can perform an action on a REST
3119   * resource.
3120   *
3121   * @param  {Object} state  Current state.
3122   * @param  {Object} action Dispatched action.
3123   *
3124   * @return {Object} Updated state.
3125   */
3126  
3127  function userPermissions(state = {}, action) {
3128    switch (action.type) {
3129      case 'RECEIVE_USER_PERMISSION':
3130        return { ...state,
3131          [action.key]: action.isAllowed
3132        };
3133    }
3134  
3135    return state;
3136  }
3137  /**
3138   * Reducer returning autosaves keyed by their parent's post id.
3139   *
3140   * @param  {Object} state  Current state.
3141   * @param  {Object} action Dispatched action.
3142   *
3143   * @return {Object} Updated state.
3144   */
3145  
3146  function reducer_autosaves(state = {}, action) {
3147    switch (action.type) {
3148      case 'RECEIVE_AUTOSAVES':
3149        const {
3150          postId,
3151          autosaves: autosavesData
3152        } = action;
3153        return { ...state,
3154          [postId]: autosavesData
3155        };
3156    }
3157  
3158    return state;
3159  }
3160  /* harmony default export */ var build_module_reducer = (Object(external_wp_data_["combineReducers"])({
3161    terms,
3162    users: reducer_users,
3163    currentTheme,
3164    currentUser: reducer_currentUser,
3165    taxonomies: reducer_taxonomies,
3166    themes,
3167    themeSupports,
3168    entities: reducer_entities,
3169    undo: reducer_undo,
3170    embedPreviews,
3171    userPermissions,
3172    autosaves: reducer_autosaves,
3173    locks: locks_reducer
3174  }));
3175  
3176  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
3177  var rememo = __webpack_require__("pPDe");
3178  
3179  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
3180  /**
3181   * The reducer key used by core data in store registration.
3182   * This is defined in a separate file to avoid cycle-dependency
3183   *
3184   * @type {string}
3185   */
3186  const STORE_NAME = 'core';
3187  
3188  // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
3189  var equivalent_key_map = __webpack_require__("FtRg");
3190  var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
3191  
3192  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/selectors.js
3193  /**
3194   * External dependencies
3195   */
3196  
3197  
3198  
3199  /**
3200   * Internal dependencies
3201   */
3202  
3203  
3204  /**
3205   * Cache of state keys to EquivalentKeyMap where the inner map tracks queries
3206   * to their resulting items set. WeakMap allows garbage collection on expired
3207   * state references.
3208   *
3209   * @type {WeakMap<Object,EquivalentKeyMap>}
3210   */
3211  
3212  const queriedItemsCacheByState = new WeakMap();
3213  /**
3214   * Returns items for a given query, or null if the items are not known.
3215   *
3216   * @param {Object}  state State object.
3217   * @param {?Object} query Optional query.
3218   *
3219   * @return {?Array} Query items.
3220   */
3221  
3222  function getQueriedItemsUncached(state, query) {
3223    var _state$queries, _state$queries$contex;
3224  
3225    const {
3226      stableKey,
3227      page,
3228      perPage,
3229      include,
3230      fields,
3231      context
3232    } = get_query_parts(query);
3233    let itemIds;
3234  
3235    if (Array.isArray(include) && !stableKey) {
3236      // If the parsed query yields a set of IDs, but otherwise no filtering,
3237      // it's safe to consider targeted item IDs as the include set. This
3238      // doesn't guarantee that those objects have been queried, which is
3239      // accounted for below in the loop `null` return.
3240      itemIds = include; // TODO: Avoid storing the empty stable string in reducer, since it
3241      // can be computed dynamically here always.
3242    } else if ((_state$queries = state.queries) !== null && _state$queries !== void 0 && (_state$queries$contex = _state$queries[context]) !== null && _state$queries$contex !== void 0 && _state$queries$contex[stableKey]) {
3243      itemIds = state.queries[context][stableKey];
3244    }
3245  
3246    if (!itemIds) {
3247      return null;
3248    }
3249  
3250    const startOffset = perPage === -1 ? 0 : (page - 1) * perPage;
3251    const endOffset = perPage === -1 ? itemIds.length : Math.min(startOffset + perPage, itemIds.length);
3252    const items = [];
3253  
3254    for (let i = startOffset; i < endOffset; i++) {
3255      var _state$items$context;
3256  
3257      const itemId = itemIds[i];
3258  
3259      if (Array.isArray(include) && !include.includes(itemId)) {
3260        continue;
3261      }
3262  
3263      if (!((_state$items$context = state.items[context]) !== null && _state$items$context !== void 0 && _state$items$context.hasOwnProperty(itemId))) {
3264        return null;
3265      }
3266  
3267      const item = state.items[context][itemId];
3268      let filteredItem;
3269  
3270      if (Array.isArray(fields)) {
3271        filteredItem = {};
3272  
3273        for (let f = 0; f < fields.length; f++) {
3274          const field = fields[f].split('.');
3275          const value = Object(external_lodash_["get"])(item, field);
3276          Object(external_lodash_["set"])(filteredItem, field, value);
3277        }
3278      } else {
3279        var _state$itemIsComplete;
3280  
3281        // If expecting a complete item, validate that completeness, or
3282        // otherwise abort.
3283        if (!((_state$itemIsComplete = state.itemIsComplete[context]) !== null && _state$itemIsComplete !== void 0 && _state$itemIsComplete[itemId])) {
3284          return null;
3285        }
3286  
3287        filteredItem = item;
3288      }
3289  
3290      items.push(filteredItem);
3291    }
3292  
3293    return items;
3294  }
3295  /**
3296   * Returns items for a given query, or null if the items are not known. Caches
3297   * result both per state (by reference) and per query (by deep equality).
3298   * The caching approach is intended to be durable to query objects which are
3299   * deeply but not referentially equal, since otherwise:
3300   *
3301   * `getQueriedItems( state, {} ) !== getQueriedItems( state, {} )`
3302   *
3303   * @param {Object}  state State object.
3304   * @param {?Object} query Optional query.
3305   *
3306   * @return {?Array} Query items.
3307   */
3308  
3309  
3310  const getQueriedItems = Object(rememo["a" /* default */])((state, query = {}) => {
3311    let queriedItemsCache = queriedItemsCacheByState.get(state);
3312  
3313    if (queriedItemsCache) {
3314      const queriedItems = queriedItemsCache.get(query);
3315  
3316      if (queriedItems !== undefined) {
3317        return queriedItems;
3318      }
3319    } else {
3320      queriedItemsCache = new equivalent_key_map_default.a();
3321      queriedItemsCacheByState.set(state, queriedItemsCache);
3322    }
3323  
3324    const items = getQueriedItemsUncached(state, query);
3325    queriedItemsCache.set(query, items);
3326    return items;
3327  });
3328  
3329  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/selectors.js
3330  /**
3331   * External dependencies
3332   */
3333  
3334  
3335  /**
3336   * WordPress dependencies
3337   */
3338  
3339  
3340  
3341  /**
3342   * Internal dependencies
3343   */
3344  
3345  
3346  
3347  
3348  
3349  /**
3350   * Shared reference to an empty array for cases where it is important to avoid
3351   * returning a new array reference on every invocation, as in a connected or
3352   * other pure component which performs `shouldComponentUpdate` check on props.
3353   * This should be used as a last resort, since the normalized data should be
3354   * maintained by the reducer result in state.
3355   *
3356   * @type {Array}
3357   */
3358  
3359  const EMPTY_ARRAY = [];
3360  /**
3361   * Returns true if a request is in progress for embed preview data, or false
3362   * otherwise.
3363   *
3364   * @param {Object} state Data state.
3365   * @param {string} url   URL the preview would be for.
3366   *
3367   * @return {boolean} Whether a request is in progress for an embed preview.
3368   */
3369  
3370  const isRequestingEmbedPreview = Object(external_wp_data_["createRegistrySelector"])(select => (state, url) => {
3371    return select('core/data').isResolving(STORE_NAME, 'getEmbedPreview', [url]);
3372  });
3373  /**
3374   * Returns all available authors.
3375   *
3376   * @param {Object}           state Data state.
3377   * @param {Object|undefined} query Optional object of query parameters to
3378   *                                 include with request.
3379   * @return {Array} Authors list.
3380   */
3381  
3382  function getAuthors(state, query) {
3383    const path = Object(external_wp_url_["addQueryArgs"])('/wp/v2/users/?who=authors&per_page=100', query);
3384    return getUserQueryResults(state, path);
3385  }
3386  /**
3387   * Returns all available authors.
3388   *
3389   * @param {Object} state Data state.
3390   * @param {number} id The author id.
3391   *
3392   * @return {Array} Authors list.
3393   */
3394  
3395  function __unstableGetAuthor(state, id) {
3396    return Object(external_lodash_["get"])(state, ['users', 'byId', id], null);
3397  }
3398  /**
3399   * Returns the current user.
3400   *
3401   * @param {Object} state Data state.
3402   *
3403   * @return {Object} Current user object.
3404   */
3405  
3406  function getCurrentUser(state) {
3407    return state.currentUser;
3408  }
3409  /**
3410   * Returns all the users returned by a query ID.
3411   *
3412   * @param {Object} state   Data state.
3413   * @param {string} queryID Query ID.
3414   *
3415   * @return {Array} Users list.
3416   */
3417  
3418  const getUserQueryResults = Object(rememo["a" /* default */])((state, queryID) => {
3419    const queryResults = state.users.queries[queryID];
3420    return Object(external_lodash_["map"])(queryResults, id => state.users.byId[id]);
3421  }, (state, queryID) => [state.users.queries[queryID], state.users.byId]);
3422  /**
3423   * Returns whether the entities for the give kind are loaded.
3424   *
3425   * @param {Object} state   Data state.
3426   * @param {string} kind  Entity kind.
3427   *
3428   * @return {Array<Object>} Array of entities with config matching kind.
3429   */
3430  
3431  function getEntitiesByKind(state, kind) {
3432    return Object(external_lodash_["filter"])(state.entities.config, {
3433      kind
3434    });
3435  }
3436  /**
3437   * Returns the entity object given its kind and name.
3438   *
3439   * @param {Object} state   Data state.
3440   * @param {string} kind  Entity kind.
3441   * @param {string} name  Entity name.
3442   *
3443   * @return {Object} Entity
3444   */
3445  
3446  function getEntity(state, kind, name) {
3447    return Object(external_lodash_["find"])(state.entities.config, {
3448      kind,
3449      name
3450    });
3451  }
3452  /**
3453   * Returns the Entity's record object by key. Returns `null` if the value is not
3454   * yet received, undefined if the value entity is known to not exist, or the
3455   * entity object if it exists and is received.
3456   *
3457   * @param {Object}  state State tree
3458   * @param {string}  kind  Entity kind.
3459   * @param {string}  name  Entity name.
3460   * @param {number}  key   Record's key
3461   * @param {?Object} query Optional query.
3462   *
3463   * @return {Object?} Record.
3464   */
3465  
3466  function getEntityRecord(state, kind, name, key, query) {
3467    var _query$context, _queriedState$items$c;
3468  
3469    const queriedState = Object(external_lodash_["get"])(state.entities.data, [kind, name, 'queriedData']);
3470  
3471    if (!queriedState) {
3472      return undefined;
3473    }
3474  
3475    const context = (_query$context = query === null || query === void 0 ? void 0 : query.context) !== null && _query$context !== void 0 ? _query$context : 'default';
3476  
3477    if (query === undefined) {
3478      var _queriedState$itemIsC;
3479  
3480      // If expecting a complete item, validate that completeness.
3481      if (!((_queriedState$itemIsC = queriedState.itemIsComplete[context]) !== null && _queriedState$itemIsC !== void 0 && _queriedState$itemIsC[key])) {
3482        return undefined;
3483      }
3484  
3485      return queriedState.items[context][key];
3486    }
3487  
3488    const item = (_queriedState$items$c = queriedState.items[context]) === null || _queriedState$items$c === void 0 ? void 0 : _queriedState$items$c[key];
3489  
3490    if (item && query._fields) {
3491      const filteredItem = {};
3492      const fields = get_normalized_comma_separable(query._fields);
3493  
3494      for (let f = 0; f < fields.length; f++) {
3495        const field = fields[f].split('.');
3496        const value = Object(external_lodash_["get"])(item, field);
3497        Object(external_lodash_["set"])(filteredItem, field, value);
3498      }
3499  
3500      return filteredItem;
3501    }
3502  
3503    return item;
3504  }
3505  /**
3506   * Returns the Entity's record object by key. Doesn't trigger a resolver nor requests the entity from the API if the entity record isn't available in the local state.
3507   *
3508   * @param {Object} state  State tree
3509   * @param {string} kind   Entity kind.
3510   * @param {string} name   Entity name.
3511   * @param {number} key    Record's key
3512   *
3513   * @return {Object|null} Record.
3514   */
3515  
3516  function __experimentalGetEntityRecordNoResolver(state, kind, name, key) {
3517    return getEntityRecord(state, kind, name, key);
3518  }
3519  /**
3520   * Returns the entity's record object by key,
3521   * with its attributes mapped to their raw values.
3522   *
3523   * @param {Object} state  State tree.
3524   * @param {string} kind   Entity kind.
3525   * @param {string} name   Entity name.
3526   * @param {number} key    Record's key.
3527   *
3528   * @return {Object?} Object with the entity's raw attributes.
3529   */
3530  
3531  const getRawEntityRecord = Object(rememo["a" /* default */])((state, kind, name, key) => {
3532    const record = getEntityRecord(state, kind, name, key);
3533    return record && Object.keys(record).reduce((accumulator, _key) => {
3534      // Because edits are the "raw" attribute values,
3535      // we return those from record selectors to make rendering,
3536      // comparisons, and joins with edits easier.
3537      accumulator[_key] = Object(external_lodash_["get"])(record[_key], 'raw', record[_key]);
3538      return accumulator;
3539    }, {});
3540  }, state => [state.entities.data]);
3541  /**
3542   * Returns true if records have been received for the given set of parameters,
3543   * or false otherwise.
3544   *
3545   * @param {Object}  state State tree
3546   * @param {string}  kind  Entity kind.
3547   * @param {string}  name  Entity name.
3548   * @param {?Object} query Optional terms query.
3549   *
3550   * @return {boolean} Whether entity records have been received.
3551   */
3552  
3553  function hasEntityRecords(state, kind, name, query) {
3554    return Array.isArray(getEntityRecords(state, kind, name, query));
3555  }
3556  /**
3557   * Returns the Entity's records.
3558   *
3559   * @param {Object}  state State tree
3560   * @param {string}  kind  Entity kind.
3561   * @param {string}  name  Entity name.
3562   * @param {?Object} query Optional terms query.
3563   *
3564   * @return {?Array} Records.
3565   */
3566  
3567  function getEntityRecords(state, kind, name, query) {
3568    // Queried data state is prepopulated for all known entities. If this is not
3569    // assigned for the given parameters, then it is known to not exist. Thus, a
3570    // return value of an empty array is used instead of `null` (where `null` is
3571    // otherwise used to represent an unknown state).
3572    const queriedState = Object(external_lodash_["get"])(state.entities.data, [kind, name, 'queriedData']);
3573  
3574    if (!queriedState) {
3575      return EMPTY_ARRAY;
3576    }
3577  
3578    return getQueriedItems(queriedState, query);
3579  }
3580  /**
3581   * Returns the  list of dirty entity records.
3582   *
3583   * @param {Object} state State tree.
3584   *
3585   * @return {[{ title: string, key: string, name: string, kind: string }]} The list of updated records
3586   */
3587  
3588  const __experimentalGetDirtyEntityRecords = Object(rememo["a" /* default */])(state => {
3589    const {
3590      entities: {
3591        data
3592      }
3593    } = state;
3594    const dirtyRecords = [];
3595    Object.keys(data).forEach(kind => {
3596      Object.keys(data[kind]).forEach(name => {
3597        const primaryKeys = Object.keys(data[kind][name].edits).filter(primaryKey => hasEditsForEntityRecord(state, kind, name, primaryKey));
3598  
3599        if (primaryKeys.length) {
3600          const entity = getEntity(state, kind, name);
3601          primaryKeys.forEach(primaryKey => {
3602            var _entity$getTitle;
3603  
3604            const entityRecord = getEditedEntityRecord(state, kind, name, primaryKey);
3605            dirtyRecords.push({
3606              // We avoid using primaryKey because it's transformed into a string
3607              // when it's used as an object key.
3608              key: entityRecord[entity.key || DEFAULT_ENTITY_KEY],
3609              title: (entity === null || entity === void 0 ? void 0 : (_entity$getTitle = entity.getTitle) === null || _entity$getTitle === void 0 ? void 0 : _entity$getTitle.call(entity, entityRecord)) || '',
3610              name,
3611              kind
3612            });
3613          });
3614        }
3615      });
3616    });
3617    return dirtyRecords;
3618  }, state => [state.entities.data]);
3619  /**
3620   * Returns the specified entity record's edits.
3621   *
3622   * @param {Object} state    State tree.
3623   * @param {string} kind     Entity kind.
3624   * @param {string} name     Entity name.
3625   * @param {number} recordId Record ID.
3626   *
3627   * @return {Object?} The entity record's edits.
3628   */
3629  
3630  function getEntityRecordEdits(state, kind, name, recordId) {
3631    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'edits', recordId]);
3632  }
3633  /**
3634   * Returns the specified entity record's non transient edits.
3635   *
3636   * Transient edits don't create an undo level, and
3637   * are not considered for change detection.
3638   * They are defined in the entity's config.
3639   *
3640   * @param {Object} state    State tree.
3641   * @param {string} kind     Entity kind.
3642   * @param {string} name     Entity name.
3643   * @param {number} recordId Record ID.
3644   *
3645   * @return {Object?} The entity record's non transient edits.
3646   */
3647  
3648  const getEntityRecordNonTransientEdits = Object(rememo["a" /* default */])((state, kind, name, recordId) => {
3649    const {
3650      transientEdits
3651    } = getEntity(state, kind, name) || {};
3652    const edits = getEntityRecordEdits(state, kind, name, recordId) || {};
3653  
3654    if (!transientEdits) {
3655      return edits;
3656    }
3657  
3658    return Object.keys(edits).reduce((acc, key) => {
3659      if (!transientEdits[key]) {
3660        acc[key] = edits[key];
3661      }
3662  
3663      return acc;
3664    }, {});
3665  }, state => [state.entities.config, state.entities.data]);
3666  /**
3667   * Returns true if the specified entity record has edits,
3668   * and false otherwise.
3669   *
3670   * @param {Object} state    State tree.
3671   * @param {string} kind     Entity kind.
3672   * @param {string} name     Entity name.
3673   * @param {number} recordId Record ID.
3674   *
3675   * @return {boolean} Whether the entity record has edits or not.
3676   */
3677  
3678  function hasEditsForEntityRecord(state, kind, name, recordId) {
3679    return isSavingEntityRecord(state, kind, name, recordId) || Object.keys(getEntityRecordNonTransientEdits(state, kind, name, recordId)).length > 0;
3680  }
3681  /**
3682   * Returns the specified entity record, merged with its edits.
3683   *
3684   * @param {Object} state    State tree.
3685   * @param {string} kind     Entity kind.
3686   * @param {string} name     Entity name.
3687   * @param {number} recordId Record ID.
3688   *
3689   * @return {Object?} The entity record, merged with its edits.
3690   */
3691  
3692  const getEditedEntityRecord = Object(rememo["a" /* default */])((state, kind, name, recordId) => ({ ...getRawEntityRecord(state, kind, name, recordId),
3693    ...getEntityRecordEdits(state, kind, name, recordId)
3694  }), state => [state.entities.data]);
3695  /**
3696   * Returns true if the specified entity record is autosaving, and false otherwise.
3697   *
3698   * @param {Object} state    State tree.
3699   * @param {string} kind     Entity kind.
3700   * @param {string} name     Entity name.
3701   * @param {number} recordId Record ID.
3702   *
3703   * @return {boolean} Whether the entity record is autosaving or not.
3704   */
3705  
3706  function isAutosavingEntityRecord(state, kind, name, recordId) {
3707    const {
3708      pending,
3709      isAutosave
3710    } = Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId], {});
3711    return Boolean(pending && isAutosave);
3712  }
3713  /**
3714   * Returns true if the specified entity record is saving, and false otherwise.
3715   *
3716   * @param {Object} state    State tree.
3717   * @param {string} kind     Entity kind.
3718   * @param {string} name     Entity name.
3719   * @param {number} recordId Record ID.
3720   *
3721   * @return {boolean} Whether the entity record is saving or not.
3722   */
3723  
3724  function isSavingEntityRecord(state, kind, name, recordId) {
3725    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId, 'pending'], false);
3726  }
3727  /**
3728   * Returns true if the specified entity record is deleting, and false otherwise.
3729   *
3730   * @param {Object} state    State tree.
3731   * @param {string} kind     Entity kind.
3732   * @param {string} name     Entity name.
3733   * @param {number} recordId Record ID.
3734   *
3735   * @return {boolean} Whether the entity record is deleting or not.
3736   */
3737  
3738  function isDeletingEntityRecord(state, kind, name, recordId) {
3739    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'deleting', recordId, 'pending'], false);
3740  }
3741  /**
3742   * Returns the specified entity record's last save error.
3743   *
3744   * @param {Object} state    State tree.
3745   * @param {string} kind     Entity kind.
3746   * @param {string} name     Entity name.
3747   * @param {number} recordId Record ID.
3748   *
3749   * @return {Object?} The entity record's save error.
3750   */
3751  
3752  function getLastEntitySaveError(state, kind, name, recordId) {
3753    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId, 'error']);
3754  }
3755  /**
3756   * Returns the specified entity record's last delete error.
3757   *
3758   * @param {Object} state    State tree.
3759   * @param {string} kind     Entity kind.
3760   * @param {string} name     Entity name.
3761   * @param {number} recordId Record ID.
3762   *
3763   * @return {Object?} The entity record's save error.
3764   */
3765  
3766  function getLastEntityDeleteError(state, kind, name, recordId) {
3767    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'deleting', recordId, 'error']);
3768  }
3769  /**
3770   * Returns the current undo offset for the
3771   * entity records edits history. The offset
3772   * represents how many items from the end
3773   * of the history stack we are at. 0 is the
3774   * last edit, -1 is the second last, and so on.
3775   *
3776   * @param {Object} state State tree.
3777   *
3778   * @return {number} The current undo offset.
3779   */
3780  
3781  function getCurrentUndoOffset(state) {
3782    return state.undo.offset;
3783  }
3784  /**
3785   * Returns the previous edit from the current undo offset
3786   * for the entity records edits history, if any.
3787   *
3788   * @param {Object} state State tree.
3789   *
3790   * @return {Object?} The edit.
3791   */
3792  
3793  
3794  function getUndoEdit(state) {
3795    return state.undo[state.undo.length - 2 + getCurrentUndoOffset(state)];
3796  }
3797  /**
3798   * Returns the next edit from the current undo offset
3799   * for the entity records edits history, if any.
3800   *
3801   * @param {Object} state State tree.
3802   *
3803   * @return {Object?} The edit.
3804   */
3805  
3806  function getRedoEdit(state) {
3807    return state.undo[state.undo.length + getCurrentUndoOffset(state)];
3808  }
3809  /**
3810   * Returns true if there is a previous edit from the current undo offset
3811   * for the entity records edits history, and false otherwise.
3812   *
3813   * @param {Object} state State tree.
3814   *
3815   * @return {boolean} Whether there is a previous edit or not.
3816   */
3817  
3818  function hasUndo(state) {
3819    return Boolean(getUndoEdit(state));
3820  }
3821  /**
3822   * Returns true if there is a next edit from the current undo offset
3823   * for the entity records edits history, and false otherwise.
3824   *
3825   * @param {Object} state State tree.
3826   *
3827   * @return {boolean} Whether there is a next edit or not.
3828   */
3829  
3830  function hasRedo(state) {
3831    return Boolean(getRedoEdit(state));
3832  }
3833  /**
3834   * Return the current theme.
3835   *
3836   * @param {Object} state Data state.
3837   *
3838   * @return {Object}      The current theme.
3839   */
3840  
3841  function getCurrentTheme(state) {
3842    return state.themes[state.currentTheme];
3843  }
3844  /**
3845   * Return theme supports data in the index.
3846   *
3847   * @param {Object} state Data state.
3848   *
3849   * @return {*}           Index data.
3850   */
3851  
3852  function getThemeSupports(state) {
3853    return state.themeSupports;
3854  }
3855  /**
3856   * Returns the embed preview for the given URL.
3857   *
3858   * @param {Object} state    Data state.
3859   * @param {string} url      Embedded URL.
3860   *
3861   * @return {*} Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.
3862   */
3863  
3864  function getEmbedPreview(state, url) {
3865    return state.embedPreviews[url];
3866  }
3867  /**
3868   * Determines if the returned preview is an oEmbed link fallback.
3869   *
3870   * WordPress can be configured to return a simple link to a URL if it is not embeddable.
3871   * We need to be able to determine if a URL is embeddable or not, based on what we
3872   * get back from the oEmbed preview API.
3873   *
3874   * @param {Object} state    Data state.
3875   * @param {string} url      Embedded URL.
3876   *
3877   * @return {boolean} Is the preview for the URL an oEmbed link fallback.
3878   */
3879  
3880  function isPreviewEmbedFallback(state, url) {
3881    const preview = state.embedPreviews[url];
3882    const oEmbedLinkCheck = '<a href="' + url + '">' + url + '</a>';
3883  
3884    if (!preview) {
3885      return false;
3886    }
3887  
3888    return preview.html === oEmbedLinkCheck;
3889  }
3890  /**
3891   * Returns whether the current user can perform the given action on the given
3892   * REST resource.
3893   *
3894   * Calling this may trigger an OPTIONS request to the REST API via the
3895   * `canUser()` resolver.
3896   *
3897   * https://developer.wordpress.org/rest-api/reference/
3898   *
3899   * @param {Object}   state            Data state.
3900   * @param {string}   action           Action to check. One of: 'create', 'read', 'update', 'delete'.
3901   * @param {string}   resource         REST resource to check, e.g. 'media' or 'posts'.
3902   * @param {string=}  id               Optional ID of the rest resource to check.
3903   *
3904   * @return {boolean|undefined} Whether or not the user can perform the action,
3905   *                             or `undefined` if the OPTIONS request is still being made.
3906   */
3907  
3908  function canUser(state, action, resource, id) {
3909    const key = Object(external_lodash_["compact"])([action, resource, id]).join('/');
3910    return Object(external_lodash_["get"])(state, ['userPermissions', key]);
3911  }
3912  /**
3913   * Returns whether the current user can edit the given entity.
3914   *
3915   * Calling this may trigger an OPTIONS request to the REST API via the
3916   * `canUser()` resolver.
3917   *
3918   * https://developer.wordpress.org/rest-api/reference/
3919   *
3920   * @param {Object} state    Data state.
3921   * @param {string} kind     Entity kind.
3922   * @param {string} name     Entity name.
3923   * @param {string} recordId Record's id.
3924   * @return {boolean|undefined} Whether or not the user can edit,
3925   * or `undefined` if the OPTIONS request is still being made.
3926   */
3927  
3928  function canUserEditEntityRecord(state, kind, name, recordId) {
3929    const entity = getEntity(state, kind, name);
3930  
3931    if (!entity) {
3932      return false;
3933    }
3934  
3935    const resource = entity.__unstable_rest_base;
3936    return canUser(state, 'update', resource, recordId);
3937  }
3938  /**
3939   * Returns the latest autosaves for the post.
3940   *
3941   * May return multiple autosaves since the backend stores one autosave per
3942   * author for each post.
3943   *
3944   * @param {Object} state    State tree.
3945   * @param {string} postType The type of the parent post.
3946   * @param {number} postId   The id of the parent post.
3947   *
3948   * @return {?Array} An array of autosaves for the post, or undefined if there is none.
3949   */
3950  
3951  function getAutosaves(state, postType, postId) {
3952    return state.autosaves[postId];
3953  }
3954  /**
3955   * Returns the autosave for the post and author.
3956   *
3957   * @param {Object} state    State tree.
3958   * @param {string} postType The type of the parent post.
3959   * @param {number} postId   The id of the parent post.
3960   * @param {number} authorId The id of the author.
3961   *
3962   * @return {?Object} The autosave for the post and author.
3963   */
3964  
3965  function getAutosave(state, postType, postId, authorId) {
3966    if (authorId === undefined) {
3967      return;
3968    }
3969  
3970    const autosaves = state.autosaves[postId];
3971    return Object(external_lodash_["find"])(autosaves, {
3972      author: authorId
3973    });
3974  }
3975  /**
3976   * Returns true if the REST request for autosaves has completed.
3977   *
3978   * @param {Object} state State tree.
3979   * @param {string} postType The type of the parent post.
3980   * @param {number} postId   The id of the parent post.
3981   *
3982   * @return {boolean} True if the REST request was completed. False otherwise.
3983   */
3984  
3985  const hasFetchedAutosaves = Object(external_wp_data_["createRegistrySelector"])(select => (state, postType, postId) => {
3986    return select(STORE_NAME).hasFinishedResolution('getAutosaves', [postType, postId]);
3987  });
3988  /**
3989   * Returns a new reference when edited values have changed. This is useful in
3990   * inferring where an edit has been made between states by comparison of the
3991   * return values using strict equality.
3992   *
3993   * @example
3994   *
3995   * ```
3996   * const hasEditOccurred = (
3997   *    getReferenceByDistinctEdits( beforeState ) !==
3998   *    getReferenceByDistinctEdits( afterState )
3999   * );
4000   * ```
4001   *
4002   * @param {Object} state Editor state.
4003   *
4004   * @return {*} A value whose reference will change only when an edit occurs.
4005   */
4006  
4007  const getReferenceByDistinctEdits = Object(rememo["a" /* default */])(() => [], state => [state.undo.length, state.undo.offset, state.undo.flattenedUndo]);
4008  /**
4009   * Retrieve the frontend template used for a given link.
4010   *
4011   * @param {Object} state Editor state.
4012   * @param {string} link  Link.
4013   *
4014   * @return {Object?} The template record.
4015   */
4016  
4017  function __experimentalGetTemplateForLink(state, link) {
4018    const records = getEntityRecords(state, 'postType', 'wp_template', {
4019      'find-template': link
4020    });
4021    const template = records !== null && records !== void 0 && records.length ? records[0] : null;
4022  
4023    if (template) {
4024      return getEditedEntityRecord(state, 'postType', 'wp_template', template.id);
4025    }
4026  
4027    return template;
4028  }
4029  
4030  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/if-not-resolved.js
4031  /**
4032   * WordPress dependencies
4033   */
4034  
4035  /**
4036   * Higher-order function which invokes the given resolver only if it has not
4037   * already been resolved with the arguments passed to the enhanced function.
4038   *
4039   * This only considers resolution state, and notably does not support resolver
4040   * custom `isFulfilled` behavior.
4041   *
4042   * @param {Function} resolver     Original resolver.
4043   * @param {string}   selectorName Selector name associated with resolver.
4044   *
4045   * @return {Function} Enhanced resolver.
4046   */
4047  
4048  const ifNotResolved = (resolver, selectorName) =>
4049  /**
4050   * @param {...any} args Original resolver arguments.
4051   */
4052  function* resolveIfNotResolved(...args) {
4053    const hasStartedResolution = yield external_wp_data_["controls"].select('core', 'hasStartedResolution', selectorName, args);
4054  
4055    if (!hasStartedResolution) {
4056      yield* resolver(...args);
4057    }
4058  };
4059  
4060  /* harmony default export */ var if_not_resolved = (ifNotResolved);
4061  
4062  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/resolvers.js
4063  /**
4064   * External dependencies
4065   */
4066  
4067  /**
4068   * WordPress dependencies
4069   */
4070  
4071  
4072  
4073  
4074  /**
4075   * Internal dependencies
4076   */
4077  
4078  
4079  /**
4080   * Internal dependencies
4081   */
4082  
4083  
4084  
4085  
4086  
4087  /**
4088   * Requests authors from the REST API.
4089   *
4090   * @param {Object|undefined} query Optional object of query parameters to
4091   *                                 include with request.
4092   */
4093  
4094  function* resolvers_getAuthors(query) {
4095    const path = Object(external_wp_url_["addQueryArgs"])('/wp/v2/users/?who=authors&per_page=100', query);
4096    const users = yield Object(external_wp_dataControls_["apiFetch"])({
4097      path
4098    });
4099    yield receiveUserQuery(path, users);
4100  }
4101  /**
4102   * Temporary approach to resolving editor access to author queries.
4103   *
4104   * @param {number} id The author id.
4105   */
4106  
4107  function* resolvers_unstableGetAuthor(id) {
4108    const path = `/wp/v2/users?who=authors&include=$id}`;
4109    const users = yield Object(external_wp_dataControls_["apiFetch"])({
4110      path
4111    });
4112    yield receiveUserQuery('author', users);
4113  }
4114  /**
4115   * Requests the current user from the REST API.
4116   */
4117  
4118  function* resolvers_getCurrentUser() {
4119    const currentUser = yield Object(external_wp_dataControls_["apiFetch"])({
4120      path: '/wp/v2/users/me'
4121    });
4122    yield receiveCurrentUser(currentUser);
4123  }
4124  /**
4125   * Requests an entity's record from the REST API.
4126   *
4127   * @param {string}           kind  Entity kind.
4128   * @param {string}           name  Entity name.
4129   * @param {number|string}    key   Record's key
4130   * @param {Object|undefined} query Optional object of query parameters to
4131   *                                 include with request.
4132   */
4133  
4134  function* resolvers_getEntityRecord(kind, name, key = '', query) {
4135    const entities = yield getKindEntities(kind);
4136    const entity = Object(external_lodash_["find"])(entities, {
4137      kind,
4138      name
4139    });
4140  
4141    if (!entity) {
4142      return;
4143    }
4144  
4145    const lock = yield* __unstableAcquireStoreLock('core', ['entities', 'data', kind, name, key], {
4146      exclusive: false
4147    });
4148  
4149    try {
4150      if (query !== undefined && query._fields) {
4151        // If requesting specific fields, items and query assocation to said
4152        // records are stored by ID reference. Thus, fields must always include
4153        // the ID.
4154        query = { ...query,
4155          _fields: Object(external_lodash_["uniq"])([...(get_normalized_comma_separable(query._fields) || []), entity.key || DEFAULT_ENTITY_KEY]).join()
4156        };
4157      } // Disable reason: While true that an early return could leave `path`
4158      // unused, it's important that path is derived using the query prior to
4159      // additional query modifications in the condition below, since those
4160      // modifications are relevant to how the data is tracked in state, and not
4161      // for how the request is made to the REST API.
4162      // eslint-disable-next-line @wordpress/no-unused-vars-before-return
4163  
4164  
4165      const path = Object(external_wp_url_["addQueryArgs"])(entity.baseURL + '/' + key, { ...entity.baseURLParams,
4166        ...query
4167      });
4168  
4169      if (query !== undefined) {
4170        query = { ...query,
4171          include: [key]
4172        }; // The resolution cache won't consider query as reusable based on the
4173        // fields, so it's tested here, prior to initiating the REST request,
4174        // and without causing `getEntityRecords` resolution to occur.
4175  
4176        const hasRecords = yield external_wp_data_["controls"].select('core', 'hasEntityRecords', kind, name, query);
4177  
4178        if (hasRecords) {
4179          return;
4180        }
4181      }
4182  
4183      const record = yield Object(external_wp_dataControls_["apiFetch"])({
4184        path
4185      });
4186      yield receiveEntityRecords(kind, name, record, query);
4187    } catch (error) {// We need a way to handle and access REST API errors in state
4188      // Until then, catching the error ensures the resolver is marked as resolved.
4189    } finally {
4190      yield* __unstableReleaseStoreLock(lock);
4191    }
4192  }
4193  /**
4194   * Requests an entity's record from the REST API.
4195   */
4196  
4197  const resolvers_getRawEntityRecord = if_not_resolved(resolvers_getEntityRecord, 'getEntityRecord');
4198  /**
4199   * Requests an entity's record from the REST API.
4200   */
4201  
4202  const resolvers_getEditedEntityRecord = if_not_resolved(resolvers_getRawEntityRecord, 'getRawEntityRecord');
4203  /**
4204   * Requests the entity's records from the REST API.
4205   *
4206   * @param {string}  kind   Entity kind.
4207   * @param {string}  name   Entity name.
4208   * @param {Object?} query  Query Object.
4209   */
4210  
4211  function* resolvers_getEntityRecords(kind, name, query = {}) {
4212    const entities = yield getKindEntities(kind);
4213    const entity = Object(external_lodash_["find"])(entities, {
4214      kind,
4215      name
4216    });
4217  
4218    if (!entity) {
4219      return;
4220    }
4221  
4222    const lock = yield* __unstableAcquireStoreLock('core', ['entities', 'data', kind, name], {
4223      exclusive: false
4224    });
4225  
4226    try {
4227      var _query;
4228  
4229      if (query._fields) {
4230        // If requesting specific fields, items and query assocation to said
4231        // records are stored by ID reference. Thus, fields must always include
4232        // the ID.
4233        query = { ...query,
4234          _fields: Object(external_lodash_["uniq"])([...(get_normalized_comma_separable(query._fields) || []), entity.key || DEFAULT_ENTITY_KEY]).join()
4235        };
4236      }
4237  
4238      const path = Object(external_wp_url_["addQueryArgs"])(entity.baseURL, { ...entity.baseURLParams,
4239        ...query
4240      });
4241      let records = Object.values(yield Object(external_wp_dataControls_["apiFetch"])({
4242        path
4243      })); // If we request fields but the result doesn't contain the fields,
4244      // explicitely set these fields as "undefined"
4245      // that way we consider the query "fullfilled".
4246  
4247      if (query._fields) {
4248        records = records.map(record => {
4249          query._fields.split(',').forEach(field => {
4250            if (!record.hasOwnProperty(field)) {
4251              record[field] = undefined;
4252            }
4253          });
4254  
4255          return record;
4256        });
4257      }
4258  
4259      yield receiveEntityRecords(kind, name, records, query); // When requesting all fields, the list of results can be used to
4260      // resolve the `getEntityRecord` selector in addition to `getEntityRecords`.
4261      // See https://github.com/WordPress/gutenberg/pull/26575
4262  
4263      if (!((_query = query) !== null && _query !== void 0 && _query._fields) && !query.context) {
4264        const key = entity.key || DEFAULT_ENTITY_KEY;
4265        const resolutionsArgs = records.filter(record => record[key]).map(record => [kind, name, record[key]]);
4266        yield {
4267          type: 'START_RESOLUTIONS',
4268          selectorName: 'getEntityRecord',
4269          args: resolutionsArgs
4270        };
4271        yield {
4272          type: 'FINISH_RESOLUTIONS',
4273          selectorName: 'getEntityRecord',
4274          args: resolutionsArgs
4275        };
4276      }
4277    } finally {
4278      yield* __unstableReleaseStoreLock(lock);
4279    }
4280  }
4281  
4282  resolvers_getEntityRecords.shouldInvalidate = (action, kind, name) => {
4283    return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && kind === action.kind && name === action.name;
4284  };
4285  /**
4286   * Requests the current theme.
4287   */
4288  
4289  
4290  function* resolvers_getCurrentTheme() {
4291    const activeThemes = yield Object(external_wp_dataControls_["apiFetch"])({
4292      path: '/wp/v2/themes?status=active'
4293    });
4294    yield receiveCurrentTheme(activeThemes[0]);
4295  }
4296  /**
4297   * Requests theme supports data from the index.
4298   */
4299  
4300  function* resolvers_getThemeSupports() {
4301    const activeThemes = yield Object(external_wp_dataControls_["apiFetch"])({
4302      path: '/wp/v2/themes?status=active'
4303    });
4304    yield receiveThemeSupports(activeThemes[0].theme_supports);
4305  }
4306  /**
4307   * Requests a preview from the from the Embed API.
4308   *
4309   * @param {string} url   URL to get the preview for.
4310   */
4311  
4312  function* resolvers_getEmbedPreview(url) {
4313    try {
4314      const embedProxyResponse = yield Object(external_wp_dataControls_["apiFetch"])({
4315        path: Object(external_wp_url_["addQueryArgs"])('/oembed/1.0/proxy', {
4316          url
4317        })
4318      });
4319      yield receiveEmbedPreview(url, embedProxyResponse);
4320    } catch (error) {
4321      // Embed API 404s if the URL cannot be embedded, so we have to catch the error from the apiRequest here.
4322      yield receiveEmbedPreview(url, false);
4323    }
4324  }
4325  /**
4326   * Checks whether the current user can perform the given action on the given
4327   * REST resource.
4328   *
4329   * @param {string}  action   Action to check. One of: 'create', 'read', 'update',
4330   *                           'delete'.
4331   * @param {string}  resource REST resource to check, e.g. 'media' or 'posts'.
4332   * @param {?string} id       ID of the rest resource to check.
4333   */
4334  
4335  function* resolvers_canUser(action, resource, id) {
4336    const methods = {
4337      create: 'POST',
4338      read: 'GET',
4339      update: 'PUT',
4340      delete: 'DELETE'
4341    };
4342    const method = methods[action];
4343  
4344    if (!method) {
4345      throw new Error(`'$action}' is not a valid action.`);
4346    }
4347  
4348    const path = id ? `/wp/v2/$resource}/$id}` : `/wp/v2/$resource}`;
4349    let response;
4350  
4351    try {
4352      response = yield Object(external_wp_dataControls_["apiFetch"])({
4353        path,
4354        // Ideally this would always be an OPTIONS request, but unfortunately there's
4355        // a bug in the REST API which causes the Allow header to not be sent on
4356        // OPTIONS requests to /posts/:id routes.
4357        // https://core.trac.wordpress.org/ticket/45753
4358        method: id ? 'GET' : 'OPTIONS',
4359        parse: false
4360      });
4361    } catch (error) {
4362      // Do nothing if our OPTIONS request comes back with an API error (4xx or
4363      // 5xx). The previously determined isAllowed value will remain in the store.
4364      return;
4365    }
4366  
4367    let allowHeader;
4368  
4369    if (Object(external_lodash_["hasIn"])(response, ['headers', 'get'])) {
4370      // If the request is fetched using the fetch api, the header can be
4371      // retrieved using the 'get' method.
4372      allowHeader = response.headers.get('allow');
4373    } else {
4374      // If the request was preloaded server-side and is returned by the
4375      // preloading middleware, the header will be a simple property.
4376      allowHeader = Object(external_lodash_["get"])(response, ['headers', 'Allow'], '');
4377    }
4378  
4379    const key = Object(external_lodash_["compact"])([action, resource, id]).join('/');
4380    const isAllowed = Object(external_lodash_["includes"])(allowHeader, method);
4381    yield receiveUserPermission(key, isAllowed);
4382  }
4383  /**
4384   * Checks whether the current user can perform the given action on the given
4385   * REST resource.
4386   *
4387   * @param {string} kind     Entity kind.
4388   * @param {string} name     Entity name.
4389   * @param {string} recordId Record's id.
4390   */
4391  
4392  function* resolvers_canUserEditEntityRecord(kind, name, recordId) {
4393    const entities = yield getKindEntities(kind);
4394    const entity = Object(external_lodash_["find"])(entities, {
4395      kind,
4396      name
4397    });
4398  
4399    if (!entity) {
4400      return;
4401    }
4402  
4403    const resource = entity.__unstable_rest_base;
4404    yield resolvers_canUser('update', resource, recordId);
4405  }
4406  /**
4407   * Request autosave data from the REST API.
4408   *
4409   * @param {string} postType The type of the parent post.
4410   * @param {number} postId   The id of the parent post.
4411   */
4412  
4413  function* resolvers_getAutosaves(postType, postId) {
4414    const {
4415      rest_base: restBase
4416    } = yield external_wp_data_["controls"].resolveSelect('core', 'getPostType', postType);
4417    const autosaves = yield Object(external_wp_dataControls_["apiFetch"])({
4418      path: `/wp/v2/$restBase}/$postId}/autosaves?context=edit`
4419    });
4420  
4421    if (autosaves && autosaves.length) {
4422      yield receiveAutosaves(postId, autosaves);
4423    }
4424  }
4425  /**
4426   * Request autosave data from the REST API.
4427   *
4428   * This resolver exists to ensure the underlying autosaves are fetched via
4429   * `getAutosaves` when a call to the `getAutosave` selector is made.
4430   *
4431   * @param {string} postType The type of the parent post.
4432   * @param {number} postId   The id of the parent post.
4433   */
4434  
4435  function* resolvers_getAutosave(postType, postId) {
4436    yield external_wp_data_["controls"].resolveSelect('core', 'getAutosaves', postType, postId);
4437  }
4438  /**
4439   * Retrieve the frontend template used for a given link.
4440   *
4441   * @param {string} link  Link.
4442   */
4443  
4444  function* resolvers_experimentalGetTemplateForLink(link) {
4445    // Ideally this should be using an apiFetch call
4446    // We could potentially do so by adding a "filter" to the `wp_template` end point.
4447    // Also it seems the returned object is not a regular REST API post type.
4448    let template;
4449  
4450    try {
4451      template = yield regularFetch(Object(external_wp_url_["addQueryArgs"])(link, {
4452        '_wp-find-template': true
4453      }));
4454    } catch (e) {// For non-FSE themes, it is possible that this request returns an error.
4455    }
4456  
4457    if (!template) {
4458      return;
4459    }
4460  
4461    yield resolvers_getEntityRecord('postType', 'wp_template', template.id);
4462    const record = yield external_wp_data_["controls"].select('core', 'getEntityRecord', 'postType', 'wp_template', template.id);
4463  
4464    if (record) {
4465      yield receiveEntityRecords('postType', 'wp_template', [record], {
4466        'find-template': link
4467      });
4468    }
4469  }
4470  
4471  resolvers_experimentalGetTemplateForLink.shouldInvalidate = action => {
4472    return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && action.kind === 'postType' && action.name === 'wp_template';
4473  };
4474  
4475  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/selectors.js
4476  /**
4477   * Internal dependencies
4478   */
4479  
4480  function __unstableGetPendingLockRequests(state) {
4481    return state.locks.requests;
4482  }
4483  function __unstableIsLockAvailable(state, store, path, {
4484    exclusive
4485  }) {
4486    const storePath = [store, ...path];
4487    const locks = state.locks.tree; // Validate all parents and the node itself
4488  
4489    for (const node of iteratePath(locks, storePath)) {
4490      if (hasConflictingLock({
4491        exclusive
4492      }, node.locks)) {
4493        return false;
4494      }
4495    } // iteratePath terminates early if path is unreachable, let's
4496    // re-fetch the node and check it exists in the tree.
4497  
4498  
4499    const node = getNode(locks, storePath);
4500  
4501    if (!node) {
4502      return true;
4503    } // Validate all nested nodes
4504  
4505  
4506    for (const descendant of iterateDescendants(node)) {
4507      if (hasConflictingLock({
4508        exclusive
4509      }, descendant.locks)) {
4510        return false;
4511      }
4512    }
4513  
4514    return true;
4515  }
4516  
4517  // EXTERNAL MODULE: external ["wp","element"]
4518  var external_wp_element_ = __webpack_require__("GRId");
4519  
4520  // EXTERNAL MODULE: external ["wp","blocks"]
4521  var external_wp_blocks_ = __webpack_require__("HSyU");
4522  
4523  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/entity-provider.js
4524  
4525  
4526  /**
4527   * WordPress dependencies
4528   */
4529  
4530  
4531  
4532  const entity_provider_EMPTY_ARRAY = [];
4533  /**
4534   * Internal dependencies
4535   */
4536  
4537  
4538  const entity_provider_entities = { ...defaultEntities.reduce((acc, entity) => {
4539      if (!acc[entity.kind]) {
4540        acc[entity.kind] = {};
4541      }
4542  
4543      acc[entity.kind][entity.name] = {
4544        context: Object(external_wp_element_["createContext"])()
4545      };
4546      return acc;
4547    }, {}),
4548    ...kinds.reduce((acc, kind) => {
4549      acc[kind.name] = {};
4550      return acc;
4551    }, {})
4552  };
4553  
4554  const entity_provider_getEntity = (kind, type) => {
4555    if (!entity_provider_entities[kind]) {
4556      throw new Error(`Missing entity config for kind: $kind}.`);
4557    }
4558  
4559    if (!entity_provider_entities[kind][type]) {
4560      entity_provider_entities[kind][type] = {
4561        context: Object(external_wp_element_["createContext"])()
4562      };
4563    }
4564  
4565    return entity_provider_entities[kind][type];
4566  };
4567  /**
4568   * Context provider component for providing
4569   * an entity for a specific entity type.
4570   *
4571   * @param {Object} props          The component's props.
4572   * @param {string} props.kind     The entity kind.
4573   * @param {string} props.type     The entity type.
4574   * @param {number} props.id       The entity ID.
4575   * @param {*}      props.children The children to wrap.
4576   *
4577   * @return {Object} The provided children, wrapped with
4578   *                   the entity's context provider.
4579   */
4580  
4581  
4582  function EntityProvider({
4583    kind,
4584    type,
4585    id,
4586    children
4587  }) {
4588    const Provider = entity_provider_getEntity(kind, type).context.Provider;
4589    return Object(external_wp_element_["createElement"])(Provider, {
4590      value: id
4591    }, children);
4592  }
4593  /**
4594   * Hook that returns the ID for the nearest
4595   * provided entity of the specified type.
4596   *
4597   * @param {string} kind The entity kind.
4598   * @param {string} type The entity type.
4599   */
4600  
4601  function useEntityId(kind, type) {
4602    return Object(external_wp_element_["useContext"])(entity_provider_getEntity(kind, type).context);
4603  }
4604  /**
4605   * Hook that returns the value and a setter for the
4606   * specified property of the nearest provided
4607   * entity of the specified type.
4608   *
4609   * @param {string} kind  The entity kind.
4610   * @param {string} type  The entity type.
4611   * @param {string} prop  The property name.
4612   * @param {string} [_id] An entity ID to use instead of the context-provided one.
4613   *
4614   * @return {[*, Function, *]} An array where the first item is the
4615   *                            property value, the second is the
4616   *                            setter and the third is the full value
4617   *                               object from REST API containing more
4618   *                               information like `raw`, `rendered` and
4619   *                               `protected` props.
4620   */
4621  
4622  function useEntityProp(kind, type, prop, _id) {
4623    const providerId = useEntityId(kind, type);
4624    const id = _id !== null && _id !== void 0 ? _id : providerId;
4625    const {
4626      value,
4627      fullValue
4628    } = Object(external_wp_data_["useSelect"])(select => {
4629      const {
4630        getEntityRecord,
4631        getEditedEntityRecord
4632      } = select('core');
4633      const entity = getEntityRecord(kind, type, id); // Trigger resolver.
4634  
4635      const editedEntity = getEditedEntityRecord(kind, type, id);
4636      return entity && editedEntity ? {
4637        value: editedEntity[prop],
4638        fullValue: entity[prop]
4639      } : {};
4640    }, [kind, type, id, prop]);
4641    const {
4642      editEntityRecord
4643    } = Object(external_wp_data_["useDispatch"])('core');
4644    const setValue = Object(external_wp_element_["useCallback"])(newValue => {
4645      editEntityRecord(kind, type, id, {
4646        [prop]: newValue
4647      });
4648    }, [kind, type, id, prop]);
4649    return [value, setValue, fullValue];
4650  }
4651  /**
4652   * Hook that returns block content getters and setters for
4653   * the nearest provided entity of the specified type.
4654   *
4655   * The return value has the shape `[ blocks, onInput, onChange ]`.
4656   * `onInput` is for block changes that don't create undo levels
4657   * or dirty the post, non-persistent changes, and `onChange` is for
4658   * peristent changes. They map directly to the props of a
4659   * `BlockEditorProvider` and are intended to be used with it,
4660   * or similar components or hooks.
4661   *
4662   * @param {string} kind                            The entity kind.
4663   * @param {string} type                            The entity type.
4664   * @param {Object} options
4665   * @param {string} [options.id]                    An entity ID to use instead of the context-provided one.
4666   *
4667   * @return {[WPBlock[], Function, Function]} The block array and setters.
4668   */
4669  
4670  function useEntityBlockEditor(kind, type, {
4671    id: _id
4672  } = {}) {
4673    const providerId = useEntityId(kind, type);
4674    const id = _id !== null && _id !== void 0 ? _id : providerId;
4675    const {
4676      content,
4677      blocks
4678    } = Object(external_wp_data_["useSelect"])(select => {
4679      const {
4680        getEditedEntityRecord
4681      } = select('core');
4682      const editedEntity = getEditedEntityRecord(kind, type, id);
4683      return {
4684        blocks: editedEntity.blocks,
4685        content: editedEntity.content
4686      };
4687    }, [kind, type, id]);
4688    const {
4689      __unstableCreateUndoLevel,
4690      editEntityRecord
4691    } = Object(external_wp_data_["useDispatch"])('core');
4692    Object(external_wp_element_["useEffect"])(() => {
4693      // Load the blocks from the content if not already in state
4694      // Guard against other instances that might have
4695      // set content to a function already or the blocks are already in state.
4696      if (content && typeof content !== 'function' && !blocks) {
4697        const parsedContent = Object(external_wp_blocks_["parse"])(content);
4698        editEntityRecord(kind, type, id, {
4699          blocks: parsedContent
4700        }, {
4701          undoIgnore: true
4702        });
4703      }
4704    }, [content]);
4705    const onChange = Object(external_wp_element_["useCallback"])((newBlocks, options) => {
4706      const {
4707        selection
4708      } = options;
4709      const edits = {
4710        blocks: newBlocks,
4711        selection
4712      };
4713      const noChange = blocks === edits.blocks;
4714  
4715      if (noChange) {
4716        return __unstableCreateUndoLevel(kind, type, id);
4717      } // We create a new function here on every persistent edit
4718      // to make sure the edit makes the post dirty and creates
4719      // a new undo level.
4720  
4721  
4722      edits.content = ({
4723        blocks: blocksForSerialization = []
4724      }) => Object(external_wp_blocks_["__unstableSerializeAndClean"])(blocksForSerialization);
4725  
4726      editEntityRecord(kind, type, id, edits);
4727    }, [kind, type, id, blocks]);
4728    const onInput = Object(external_wp_element_["useCallback"])((newBlocks, options) => {
4729      const {
4730        selection
4731      } = options;
4732      const edits = {
4733        blocks: newBlocks,
4734        selection
4735      };
4736      editEntityRecord(kind, type, id, edits);
4737    }, [kind, type, id]);
4738    return [blocks !== null && blocks !== void 0 ? blocks : entity_provider_EMPTY_ARRAY, onInput, onChange];
4739  }
4740  
4741  // EXTERNAL MODULE: external ["wp","htmlEntities"]
4742  var external_wp_htmlEntities_ = __webpack_require__("rmEH");
4743  
4744  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-link-suggestions.js
4745  /**
4746   * WordPress dependencies
4747   */
4748  
4749  
4750  
4751  
4752  /**
4753   * Filters the search by type
4754   *
4755   * @typedef { 'post' | 'term' | 'post-format' } WPLinkSearchType
4756   */
4757  
4758  /**
4759   * A link with an id may be of kind post-type or taxonomy
4760   *
4761   * @typedef { 'post-type' | 'taxonomy' } WPKind
4762   */
4763  
4764  /**
4765   * @typedef WPLinkSearchOptions
4766   *
4767   * @property {boolean}             [isInitialSuggestions] Displays initial search suggestions, when true.
4768   * @property {WPLinkSearchType}    [type]                 Filters by search type.
4769   * @property {string}              [subtype]              Slug of the post-type or taxonomy.
4770   * @property {number}              [page]                 Which page of results to return.
4771   * @property {number}              [perPage]              Search results per page.
4772   */
4773  
4774  /**
4775   * @typedef WPLinkSearchResult
4776   *
4777   * @property {number} id     Post or term id.
4778   * @property {string} url    Link url.
4779   * @property {string} title  Title of the link.
4780   * @property {string} type   The taxonomy or post type slug or type URL.
4781   * @property {WPKind} [kind] Link kind of post-type or taxonomy
4782   */
4783  
4784  /**
4785   * @typedef WPEditorSettings
4786   *
4787   * @property {boolean} [ disablePostFormats ] Disables post formats, when true.
4788   */
4789  
4790  /**
4791   * Fetches link suggestions from the API.
4792   *
4793   * @async
4794   * @param {string}              search
4795   * @param {WPLinkSearchOptions} [searchOptions]
4796   * @param {WPEditorSettings}    [settings]
4797   *
4798   * @example
4799   * ```js
4800   * import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
4801   *
4802   * //...
4803   *
4804   * export function initialize( id, settings ) {
4805   *
4806   * settings.__experimentalFetchLinkSuggestions = (
4807   *     search,
4808   *     searchOptions
4809   * ) => fetchLinkSuggestions( search, searchOptions, settings );
4810   * ```
4811   * @return {Promise< WPLinkSearchResult[] >} List of search suggestions
4812   */
4813  
4814  const fetchLinkSuggestions = async (search, searchOptions = {}, settings = {}) => {
4815    const {
4816      isInitialSuggestions = false,
4817      type = undefined,
4818      subtype = undefined,
4819      page = undefined,
4820      perPage = isInitialSuggestions ? 3 : 20
4821    } = searchOptions;
4822    const {
4823      disablePostFormats = false
4824    } = settings;
4825    const queries = [];
4826  
4827    if (!type || type === 'post') {
4828      queries.push(external_wp_apiFetch_default()({
4829        path: Object(external_wp_url_["addQueryArgs"])('/wp/v2/search', {
4830          search,
4831          page,
4832          per_page: perPage,
4833          type: 'post',
4834          subtype
4835        })
4836      }).then(results => {
4837        return results.map(result => {
4838          return { ...result,
4839            meta: {
4840              kind: 'post-type',
4841              subtype
4842            }
4843          };
4844        });
4845      }).catch(() => []) // fail by returning no results
4846      );
4847    }
4848  
4849    if (!type || type === 'term') {
4850      queries.push(external_wp_apiFetch_default()({
4851        path: Object(external_wp_url_["addQueryArgs"])('/wp/v2/search', {
4852          search,
4853          page,
4854          per_page: perPage,
4855          type: 'term',
4856          subtype
4857        })
4858      }).then(results => {
4859        return results.map(result => {
4860          return { ...result,
4861            meta: {
4862              kind: 'taxonomy',
4863              subtype
4864            }
4865          };
4866        });
4867      }).catch(() => []));
4868    }
4869  
4870    if (!disablePostFormats && (!type || type === 'post-format')) {
4871      queries.push(external_wp_apiFetch_default()({
4872        path: Object(external_wp_url_["addQueryArgs"])('/wp/v2/search', {
4873          search,
4874          page,
4875          per_page: perPage,
4876          type: 'post-format',
4877          subtype
4878        })
4879      }).then(results => {
4880        return results.map(result => {
4881          return { ...result,
4882            meta: {
4883              kind: 'taxonomy',
4884              subtype
4885            }
4886          };
4887        });
4888      }).catch(() => []));
4889    }
4890  
4891    return Promise.all(queries).then(results => {
4892      return results.reduce((accumulator, current) => accumulator.concat(current), //flatten list
4893      []).filter(
4894      /**
4895       * @param {{ id: number }} result
4896       */
4897      result => {
4898        return !!result.id;
4899      }).slice(0, perPage).map(
4900      /**
4901       * @param {{ id: number, url:string, title?:string, subtype?: string, type?: string }} result
4902       */
4903      result => {
4904        var _result$meta;
4905  
4906        return {
4907          id: result.id,
4908          url: result.url,
4909          title: Object(external_wp_htmlEntities_["decodeEntities"])(result.title || '') || Object(external_wp_i18n_["__"])('(no title)'),
4910          type: result.subtype || result.type,
4911          kind: result === null || result === void 0 ? void 0 : (_result$meta = result.meta) === null || _result$meta === void 0 ? void 0 : _result$meta.kind
4912        };
4913      });
4914    });
4915  };
4916  
4917  /* harmony default export */ var _experimental_fetch_link_suggestions = (fetchLinkSuggestions);
4918  
4919  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/__experimental-fetch-remote-url-data.js
4920  /**
4921   * WordPress dependencies
4922   */
4923  
4924  
4925  /**
4926   * @typedef WPRemoteUrlData
4927   *
4928   * @property {string} title     contents of the remote URL's `<title>` tag.
4929   */
4930  
4931  /**
4932   * Fetches data about a remote URL.
4933   * eg: <title> tag, favicon...etc.
4934   *
4935   * @async
4936   * @param {string}              url
4937   *
4938   * @example
4939   * ```js
4940   * import { __experimentalFetchRemoteUrlData as fetchRemoteUrlData } from '@wordpress/core-data';
4941   *
4942   * //...
4943   *
4944   * export function initialize( id, settings ) {
4945   *
4946   * settings.__experimentalFetchRemoteUrlData = (
4947   *     url
4948   * ) => fetchRemoteUrlData( url );
4949   * ```
4950   * @return {Promise< WPRemoteUrlData[] >} Remote URL data.
4951   */
4952  
4953  const fetchRemoteUrlData = async url => {
4954    const endpoint = '/__experimental/url-details';
4955    const args = {
4956      url: Object(external_wp_url_["prependHTTP"])(url)
4957    };
4958    return external_wp_apiFetch_default()({
4959      path: Object(external_wp_url_["addQueryArgs"])(endpoint, args)
4960    });
4961  };
4962  
4963  /* harmony default export */ var _experimental_fetch_remote_url_data = (fetchRemoteUrlData);
4964  
4965  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/fetch/index.js
4966  
4967  
4968  
4969  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/index.js
4970  /**
4971   * WordPress dependencies
4972   */
4973  
4974  
4975  /**
4976   * Internal dependencies
4977   */
4978  
4979  
4980  
4981  
4982  
4983  
4984  
4985  
4986  
4987   // The entity selectors/resolvers and actions are shortcuts to their generic equivalents
4988  // (getEntityRecord, getEntityRecords, updateEntityRecord, updateEntityRecordss)
4989  // Instead of getEntityRecord, the consumer could use more user-frieldly named selector: getPostType, getTaxonomy...
4990  // The "kind" and the "name" of the entity are combined to generate these shortcuts.
4991  
4992  const entitySelectors = defaultEntities.reduce((result, entity) => {
4993    const {
4994      kind,
4995      name
4996    } = entity;
4997  
4998    result[getMethodName(kind, name)] = (state, key) => getEntityRecord(state, kind, name, key);
4999  
5000    result[getMethodName(kind, name, 'get', true)] = (state, ...args) => getEntityRecords(state, kind, name, ...args);
5001  
5002    return result;
5003  }, {});
5004  const entityResolvers = defaultEntities.reduce((result, entity) => {
5005    const {
5006      kind,
5007      name
5008    } = entity;
5009  
5010    result[getMethodName(kind, name)] = key => resolvers_getEntityRecord(kind, name, key);
5011  
5012    const pluralMethodName = getMethodName(kind, name, 'get', true);
5013  
5014    result[pluralMethodName] = (...args) => resolvers_getEntityRecords(kind, name, ...args);
5015  
5016    result[pluralMethodName].shouldInvalidate = (action, ...args) => resolvers_getEntityRecords.shouldInvalidate(action, kind, name, ...args);
5017  
5018    return result;
5019  }, {});
5020  const entityActions = defaultEntities.reduce((result, entity) => {
5021    const {
5022      kind,
5023      name
5024    } = entity;
5025  
5026    result[getMethodName(kind, name, 'save')] = key => saveEntityRecord(kind, name, key);
5027  
5028    result[getMethodName(kind, name, 'delete')] = (key, query) => deleteEntityRecord(kind, name, key, query);
5029  
5030    return result;
5031  }, {});
5032  const storeConfig = {
5033    reducer: build_module_reducer,
5034    controls: { ...build_module_controls,
5035      ...external_wp_dataControls_["controls"]
5036    },
5037    actions: { ...build_module_actions_namespaceObject,
5038      ...entityActions,
5039      ...locks_actions_namespaceObject
5040    },
5041    selectors: { ...build_module_selectors_namespaceObject,
5042      ...entitySelectors,
5043      ...locks_selectors_namespaceObject
5044    },
5045    resolvers: { ...resolvers_namespaceObject,
5046      ...entityResolvers
5047    }
5048  };
5049  /**
5050   * Store definition for the code data namespace.
5051   *
5052   * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
5053   *
5054   * @type {Object}
5055   */
5056  
5057  const build_module_store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, storeConfig);
5058  Object(external_wp_data_["register"])(build_module_store);
5059  
5060  
5061  
5062  
5063  
5064  /***/ }),
5065  
5066  /***/ "l3Sj":
5067  /***/ (function(module, exports) {
5068  
5069  (function() { module.exports = window["wp"]["i18n"]; }());
5070  
5071  /***/ }),
5072  
5073  /***/ "pPDe":
5074  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5075  
5076  "use strict";
5077  
5078  
5079  var LEAF_KEY, hasWeakMap;
5080  
5081  /**
5082   * Arbitrary value used as key for referencing cache object in WeakMap tree.
5083   *
5084   * @type {Object}
5085   */
5086  LEAF_KEY = {};
5087  
5088  /**
5089   * Whether environment supports WeakMap.
5090   *
5091   * @type {boolean}
5092   */
5093  hasWeakMap = typeof WeakMap !== 'undefined';
5094  
5095  /**
5096   * Returns the first argument as the sole entry in an array.
5097   *
5098   * @param {*} value Value to return.
5099   *
5100   * @return {Array} Value returned as entry in array.
5101   */
5102  function arrayOf( value ) {
5103      return [ value ];
5104  }
5105  
5106  /**
5107   * Returns true if the value passed is object-like, or false otherwise. A value
5108   * is object-like if it can support property assignment, e.g. object or array.
5109   *
5110   * @param {*} value Value to test.
5111   *
5112   * @return {boolean} Whether value is object-like.
5113   */
5114  function isObjectLike( value ) {
5115      return !! value && 'object' === typeof value;
5116  }
5117  
5118  /**
5119   * Creates and returns a new cache object.
5120   *
5121   * @return {Object} Cache object.
5122   */
5123  function createCache() {
5124      var cache = {
5125          clear: function() {
5126              cache.head = null;
5127          },
5128      };
5129  
5130      return cache;
5131  }
5132  
5133  /**
5134   * Returns true if entries within the two arrays are strictly equal by
5135   * reference from a starting index.
5136   *
5137   * @param {Array}  a         First array.
5138   * @param {Array}  b         Second array.
5139   * @param {number} fromIndex Index from which to start comparison.
5140   *
5141   * @return {boolean} Whether arrays are shallowly equal.
5142   */
5143  function isShallowEqual( a, b, fromIndex ) {
5144      var i;
5145  
5146      if ( a.length !== b.length ) {
5147          return false;
5148      }
5149  
5150      for ( i = fromIndex; i < a.length; i++ ) {
5151          if ( a[ i ] !== b[ i ] ) {
5152              return false;
5153          }
5154      }
5155  
5156      return true;
5157  }
5158  
5159  /**
5160   * Returns a memoized selector function. The getDependants function argument is
5161   * called before the memoized selector and is expected to return an immutable
5162   * reference or array of references on which the selector depends for computing
5163   * its own return value. The memoize cache is preserved only as long as those
5164   * dependant references remain the same. If getDependants returns a different
5165   * reference(s), the cache is cleared and the selector value regenerated.
5166   *
5167   * @param {Function} selector      Selector function.
5168   * @param {Function} getDependants Dependant getter returning an immutable
5169   *                                 reference or array of reference used in
5170   *                                 cache bust consideration.
5171   *
5172   * @return {Function} Memoized selector.
5173   */
5174  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
5175      var rootCache, getCache;
5176  
5177      // Use object source as dependant if getter not provided
5178      if ( ! getDependants ) {
5179          getDependants = arrayOf;
5180      }
5181  
5182      /**
5183       * Returns the root cache. If WeakMap is supported, this is assigned to the
5184       * root WeakMap cache set, otherwise it is a shared instance of the default
5185       * cache object.
5186       *
5187       * @return {(WeakMap|Object)} Root cache object.
5188       */
5189  	function getRootCache() {
5190          return rootCache;
5191      }
5192  
5193      /**
5194       * Returns the cache for a given dependants array. When possible, a WeakMap
5195       * will be used to create a unique cache for each set of dependants. This
5196       * is feasible due to the nature of WeakMap in allowing garbage collection
5197       * to occur on entries where the key object is no longer referenced. Since
5198       * WeakMap requires the key to be an object, this is only possible when the
5199       * dependant is object-like. The root cache is created as a hierarchy where
5200       * each top-level key is the first entry in a dependants set, the value a
5201       * WeakMap where each key is the next dependant, and so on. This continues
5202       * so long as the dependants are object-like. If no dependants are object-
5203       * like, then the cache is shared across all invocations.
5204       *
5205       * @see isObjectLike
5206       *
5207       * @param {Array} dependants Selector dependants.
5208       *
5209       * @return {Object} Cache object.
5210       */
5211  	function getWeakMapCache( dependants ) {
5212          var caches = rootCache,
5213              isUniqueByDependants = true,
5214              i, dependant, map, cache;
5215  
5216          for ( i = 0; i < dependants.length; i++ ) {
5217              dependant = dependants[ i ];
5218  
5219              // Can only compose WeakMap from object-like key.
5220              if ( ! isObjectLike( dependant ) ) {
5221                  isUniqueByDependants = false;
5222                  break;
5223              }
5224  
5225              // Does current segment of cache already have a WeakMap?
5226              if ( caches.has( dependant ) ) {
5227                  // Traverse into nested WeakMap.
5228                  caches = caches.get( dependant );
5229              } else {
5230                  // Create, set, and traverse into a new one.
5231                  map = new WeakMap();
5232                  caches.set( dependant, map );
5233                  caches = map;
5234              }
5235          }
5236  
5237          // We use an arbitrary (but consistent) object as key for the last item
5238          // in the WeakMap to serve as our running cache.
5239          if ( ! caches.has( LEAF_KEY ) ) {
5240              cache = createCache();
5241              cache.isUniqueByDependants = isUniqueByDependants;
5242              caches.set( LEAF_KEY, cache );
5243          }
5244  
5245          return caches.get( LEAF_KEY );
5246      }
5247  
5248      // Assign cache handler by availability of WeakMap
5249      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
5250  
5251      /**
5252       * Resets root memoization cache.
5253       */
5254  	function clear() {
5255          rootCache = hasWeakMap ? new WeakMap() : createCache();
5256      }
5257  
5258      // eslint-disable-next-line jsdoc/check-param-names
5259      /**
5260       * The augmented selector call, considering first whether dependants have
5261       * changed before passing it to underlying memoize function.
5262       *
5263       * @param {Object} source    Source object for derivation.
5264       * @param {...*}   extraArgs Additional arguments to pass to selector.
5265       *
5266       * @return {*} Selector result.
5267       */
5268  	function callSelector( /* source, ...extraArgs */ ) {
5269          var len = arguments.length,
5270              cache, node, i, args, dependants;
5271  
5272          // Create copy of arguments (avoid leaking deoptimization).
5273          args = new Array( len );
5274          for ( i = 0; i < len; i++ ) {
5275              args[ i ] = arguments[ i ];
5276          }
5277  
5278          dependants = getDependants.apply( null, args );
5279          cache = getCache( dependants );
5280  
5281          // If not guaranteed uniqueness by dependants (primitive type or lack
5282          // of WeakMap support), shallow compare against last dependants and, if
5283          // references have changed, destroy cache to recalculate result.
5284          if ( ! cache.isUniqueByDependants ) {
5285              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
5286                  cache.clear();
5287              }
5288  
5289              cache.lastDependants = dependants;
5290          }
5291  
5292          node = cache.head;
5293          while ( node ) {
5294              // Check whether node arguments match arguments
5295              if ( ! isShallowEqual( node.args, args, 1 ) ) {
5296                  node = node.next;
5297                  continue;
5298              }
5299  
5300              // At this point we can assume we've found a match
5301  
5302              // Surface matched node to head if not already
5303              if ( node !== cache.head ) {
5304                  // Adjust siblings to point to each other.
5305                  node.prev.next = node.next;
5306                  if ( node.next ) {
5307                      node.next.prev = node.prev;
5308                  }
5309  
5310                  node.next = cache.head;
5311                  node.prev = null;
5312                  cache.head.prev = node;
5313                  cache.head = node;
5314              }
5315  
5316              // Return immediately
5317              return node.val;
5318          }
5319  
5320          // No cached value found. Continue to insertion phase:
5321  
5322          node = {
5323              // Generate the result from original function
5324              val: selector.apply( null, args ),
5325          };
5326  
5327          // Avoid including the source object in the cache.
5328          args[ 0 ] = null;
5329          node.args = args;
5330  
5331          // Don't need to check whether node is already head, since it would
5332          // have been returned above already if it was
5333  
5334          // Shift existing head down list
5335          if ( cache.head ) {
5336              cache.head.prev = node;
5337              node.next = cache.head;
5338          }
5339  
5340          cache.head = node;
5341  
5342          return node.val;
5343      }
5344  
5345      callSelector.getDependants = getDependants;
5346      callSelector.clear = clear;
5347      clear();
5348  
5349      return callSelector;
5350  });
5351  
5352  
5353  /***/ }),
5354  
5355  /***/ "rl8x":
5356  /***/ (function(module, exports) {
5357  
5358  (function() { module.exports = window["wp"]["isShallowEqual"]; }());
5359  
5360  /***/ }),
5361  
5362  /***/ "rmEH":
5363  /***/ (function(module, exports) {
5364  
5365  (function() { module.exports = window["wp"]["htmlEntities"]; }());
5366  
5367  /***/ }),
5368  
5369  /***/ "ywyh":
5370  /***/ (function(module, exports) {
5371  
5372  (function() { module.exports = window["wp"]["apiFetch"]; }());
5373  
5374  /***/ })
5375  
5376  /******/ });


Generated: Wed Aug 4 01:00:05 2021 Cross-referenced by PHPXref 0.7.1