[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

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 = 349);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 10:
  91  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92  
  93  "use strict";
  94  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
  95  function _defineProperty(obj, key, value) {
  96    if (key in obj) {
  97      Object.defineProperty(obj, key, {
  98        value: value,
  99        enumerable: true,
 100        configurable: true,
 101        writable: true
 102      });
 103    } else {
 104      obj[key] = value;
 105    }
 106  
 107    return obj;
 108  }
 109  
 110  /***/ }),
 111  
 112  /***/ 17:
 113  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 114  
 115  "use strict";
 116  
 117  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 118  function _arrayWithoutHoles(arr) {
 119    if (Array.isArray(arr)) {
 120      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
 121        arr2[i] = arr[i];
 122      }
 123  
 124      return arr2;
 125    }
 126  }
 127  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 128  var iterableToArray = __webpack_require__(30);
 129  
 130  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 131  function _nonIterableSpread() {
 132    throw new TypeError("Invalid attempt to spread non-iterable instance");
 133  }
 134  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 135  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
 136  
 137  
 138  
 139  function _toConsumableArray(arr) {
 140    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 141  }
 142  
 143  /***/ }),
 144  
 145  /***/ 2:
 146  /***/ (function(module, exports) {
 147  
 148  (function() { module.exports = this["lodash"]; }());
 149  
 150  /***/ }),
 151  
 152  /***/ 20:
 153  /***/ (function(module, exports, __webpack_require__) {
 154  
 155  module.exports = __webpack_require__(47);
 156  
 157  
 158  /***/ }),
 159  
 160  /***/ 23:
 161  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 162  
 163  "use strict";
 164  
 165  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 166  var arrayWithHoles = __webpack_require__(38);
 167  
 168  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 169  function _iterableToArrayLimit(arr, i) {
 170    var _arr = [];
 171    var _n = true;
 172    var _d = false;
 173    var _e = undefined;
 174  
 175    try {
 176      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 177        _arr.push(_s.value);
 178  
 179        if (i && _arr.length === i) break;
 180      }
 181    } catch (err) {
 182      _d = true;
 183      _e = err;
 184    } finally {
 185      try {
 186        if (!_n && _i["return"] != null) _i["return"]();
 187      } finally {
 188        if (_d) throw _e;
 189      }
 190    }
 191  
 192    return _arr;
 193  }
 194  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 195  var nonIterableRest = __webpack_require__(39);
 196  
 197  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 198  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
 199  
 200  
 201  
 202  function _slicedToArray(arr, i) {
 203    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(nonIterableRest["a" /* default */])();
 204  }
 205  
 206  /***/ }),
 207  
 208  /***/ 26:
 209  /***/ (function(module, exports) {
 210  
 211  (function() { module.exports = this["wp"]["url"]; }());
 212  
 213  /***/ }),
 214  
 215  /***/ 30:
 216  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 217  
 218  "use strict";
 219  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
 220  function _iterableToArray(iter) {
 221    if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
 222  }
 223  
 224  /***/ }),
 225  
 226  /***/ 34:
 227  /***/ (function(module, exports) {
 228  
 229  (function() { module.exports = this["wp"]["apiFetch"]; }());
 230  
 231  /***/ }),
 232  
 233  /***/ 349:
 234  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 235  
 236  "use strict";
 237  __webpack_require__.r(__webpack_exports__);
 238  var build_module_actions_namespaceObject = {};
 239  __webpack_require__.r(build_module_actions_namespaceObject);
 240  __webpack_require__.d(build_module_actions_namespaceObject, "receiveUserQuery", function() { return receiveUserQuery; });
 241  __webpack_require__.d(build_module_actions_namespaceObject, "receiveCurrentUser", function() { return receiveCurrentUser; });
 242  __webpack_require__.d(build_module_actions_namespaceObject, "addEntities", function() { return addEntities; });
 243  __webpack_require__.d(build_module_actions_namespaceObject, "receiveEntityRecords", function() { return receiveEntityRecords; });
 244  __webpack_require__.d(build_module_actions_namespaceObject, "receiveThemeSupports", function() { return receiveThemeSupports; });
 245  __webpack_require__.d(build_module_actions_namespaceObject, "receiveEmbedPreview", function() { return receiveEmbedPreview; });
 246  __webpack_require__.d(build_module_actions_namespaceObject, "editEntityRecord", function() { return editEntityRecord; });
 247  __webpack_require__.d(build_module_actions_namespaceObject, "undo", function() { return undo; });
 248  __webpack_require__.d(build_module_actions_namespaceObject, "redo", function() { return redo; });
 249  __webpack_require__.d(build_module_actions_namespaceObject, "__unstableCreateUndoLevel", function() { return __unstableCreateUndoLevel; });
 250  __webpack_require__.d(build_module_actions_namespaceObject, "saveEntityRecord", function() { return saveEntityRecord; });
 251  __webpack_require__.d(build_module_actions_namespaceObject, "saveEditedEntityRecord", function() { return saveEditedEntityRecord; });
 252  __webpack_require__.d(build_module_actions_namespaceObject, "receiveUploadPermissions", function() { return receiveUploadPermissions; });
 253  __webpack_require__.d(build_module_actions_namespaceObject, "receiveUserPermission", function() { return receiveUserPermission; });
 254  __webpack_require__.d(build_module_actions_namespaceObject, "receiveAutosaves", function() { return receiveAutosaves; });
 255  var build_module_selectors_namespaceObject = {};
 256  __webpack_require__.r(build_module_selectors_namespaceObject);
 257  __webpack_require__.d(build_module_selectors_namespaceObject, "isRequestingEmbedPreview", function() { return isRequestingEmbedPreview; });
 258  __webpack_require__.d(build_module_selectors_namespaceObject, "getAuthors", function() { return getAuthors; });
 259  __webpack_require__.d(build_module_selectors_namespaceObject, "getCurrentUser", function() { return getCurrentUser; });
 260  __webpack_require__.d(build_module_selectors_namespaceObject, "getUserQueryResults", function() { return getUserQueryResults; });
 261  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntitiesByKind", function() { return getEntitiesByKind; });
 262  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntity", function() { return getEntity; });
 263  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecord", function() { return getEntityRecord; });
 264  __webpack_require__.d(build_module_selectors_namespaceObject, "getRawEntityRecord", function() { return getRawEntityRecord; });
 265  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecords", function() { return getEntityRecords; });
 266  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecordEdits", function() { return getEntityRecordEdits; });
 267  __webpack_require__.d(build_module_selectors_namespaceObject, "getEntityRecordNonTransientEdits", function() { return getEntityRecordNonTransientEdits; });
 268  __webpack_require__.d(build_module_selectors_namespaceObject, "hasEditsForEntityRecord", function() { return hasEditsForEntityRecord; });
 269  __webpack_require__.d(build_module_selectors_namespaceObject, "getEditedEntityRecord", function() { return getEditedEntityRecord; });
 270  __webpack_require__.d(build_module_selectors_namespaceObject, "isAutosavingEntityRecord", function() { return isAutosavingEntityRecord; });
 271  __webpack_require__.d(build_module_selectors_namespaceObject, "isSavingEntityRecord", function() { return isSavingEntityRecord; });
 272  __webpack_require__.d(build_module_selectors_namespaceObject, "getLastEntitySaveError", function() { return getLastEntitySaveError; });
 273  __webpack_require__.d(build_module_selectors_namespaceObject, "getUndoEdit", function() { return getUndoEdit; });
 274  __webpack_require__.d(build_module_selectors_namespaceObject, "getRedoEdit", function() { return getRedoEdit; });
 275  __webpack_require__.d(build_module_selectors_namespaceObject, "hasUndo", function() { return hasUndo; });
 276  __webpack_require__.d(build_module_selectors_namespaceObject, "hasRedo", function() { return hasRedo; });
 277  __webpack_require__.d(build_module_selectors_namespaceObject, "getThemeSupports", function() { return getThemeSupports; });
 278  __webpack_require__.d(build_module_selectors_namespaceObject, "getEmbedPreview", function() { return getEmbedPreview; });
 279  __webpack_require__.d(build_module_selectors_namespaceObject, "isPreviewEmbedFallback", function() { return isPreviewEmbedFallback; });
 280  __webpack_require__.d(build_module_selectors_namespaceObject, "hasUploadPermissions", function() { return hasUploadPermissions; });
 281  __webpack_require__.d(build_module_selectors_namespaceObject, "canUser", function() { return canUser; });
 282  __webpack_require__.d(build_module_selectors_namespaceObject, "getAutosaves", function() { return getAutosaves; });
 283  __webpack_require__.d(build_module_selectors_namespaceObject, "getAutosave", function() { return getAutosave; });
 284  __webpack_require__.d(build_module_selectors_namespaceObject, "hasFetchedAutosaves", function() { return hasFetchedAutosaves; });
 285  __webpack_require__.d(build_module_selectors_namespaceObject, "getReferenceByDistinctEdits", function() { return getReferenceByDistinctEdits; });
 286  var resolvers_namespaceObject = {};
 287  __webpack_require__.r(resolvers_namespaceObject);
 288  __webpack_require__.d(resolvers_namespaceObject, "getAuthors", function() { return resolvers_getAuthors; });
 289  __webpack_require__.d(resolvers_namespaceObject, "getCurrentUser", function() { return resolvers_getCurrentUser; });
 290  __webpack_require__.d(resolvers_namespaceObject, "getEntityRecord", function() { return resolvers_getEntityRecord; });
 291  __webpack_require__.d(resolvers_namespaceObject, "getEntityRecords", function() { return resolvers_getEntityRecords; });
 292  __webpack_require__.d(resolvers_namespaceObject, "getThemeSupports", function() { return resolvers_getThemeSupports; });
 293  __webpack_require__.d(resolvers_namespaceObject, "getEmbedPreview", function() { return resolvers_getEmbedPreview; });
 294  __webpack_require__.d(resolvers_namespaceObject, "hasUploadPermissions", function() { return resolvers_hasUploadPermissions; });
 295  __webpack_require__.d(resolvers_namespaceObject, "canUser", function() { return resolvers_canUser; });
 296  __webpack_require__.d(resolvers_namespaceObject, "getAutosaves", function() { return resolvers_getAutosaves; });
 297  __webpack_require__.d(resolvers_namespaceObject, "getAutosave", function() { return resolvers_getAutosave; });
 298  
 299  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
 300  var objectSpread = __webpack_require__(7);
 301  
 302  // EXTERNAL MODULE: external {"this":["wp","data"]}
 303  var external_this_wp_data_ = __webpack_require__(4);
 304  
 305  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
 306  var slicedToArray = __webpack_require__(23);
 307  
 308  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
 309  var toConsumableArray = __webpack_require__(17);
 310  
 311  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 312  var defineProperty = __webpack_require__(10);
 313  
 314  // EXTERNAL MODULE: external "lodash"
 315  var external_lodash_ = __webpack_require__(2);
 316  
 317  // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]}
 318  var external_this_wp_isShallowEqual_ = __webpack_require__(41);
 319  var external_this_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_isShallowEqual_);
 320  
 321  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/conservative-map-item.js
 322  /**
 323   * External dependencies
 324   */
 325  
 326  /**
 327   * Given the current and next item entity, returns the minimally "modified"
 328   * result of the next item, preferring value references from the original item
 329   * if equal. If all values match, the original item is returned.
 330   *
 331   * @param {Object} item     Original item.
 332   * @param {Object} nextItem Next item.
 333   *
 334   * @return {Object} Minimally modified merged item.
 335   */
 336  
 337  function conservativeMapItem(item, nextItem) {
 338    // Return next item in its entirety if there is no original item.
 339    if (!item) {
 340      return nextItem;
 341    }
 342  
 343    var hasChanges = false;
 344    var result = {};
 345  
 346    for (var key in nextItem) {
 347      if (Object(external_lodash_["isEqual"])(item[key], nextItem[key])) {
 348        result[key] = item[key];
 349      } else {
 350        hasChanges = true;
 351        result[key] = nextItem[key];
 352      }
 353    }
 354  
 355    if (!hasChanges) {
 356      return item;
 357    }
 358  
 359    return result;
 360  }
 361  
 362  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/if-matching-action.js
 363  /**
 364   * A higher-order reducer creator which invokes the original reducer only if
 365   * the dispatching action matches the given predicate, **OR** if state is
 366   * initializing (undefined).
 367   *
 368   * @param {Function} isMatch Function predicate for allowing reducer call.
 369   *
 370   * @return {Function} Higher-order reducer.
 371   */
 372  var ifMatchingAction = function ifMatchingAction(isMatch) {
 373    return function (reducer) {
 374      return function (state, action) {
 375        if (state === undefined || isMatch(action)) {
 376          return reducer(state, action);
 377        }
 378  
 379        return state;
 380      };
 381    };
 382  };
 383  
 384  /* harmony default export */ var if_matching_action = (ifMatchingAction);
 385  
 386  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/on-sub-key.js
 387  
 388  
 389  
 390  /**
 391   * Higher-order reducer creator which creates a combined reducer object, keyed
 392   * by a property on the action object.
 393   *
 394   * @param {string} actionProperty Action property by which to key object.
 395   *
 396   * @return {Function} Higher-order reducer.
 397   */
 398  var on_sub_key_onSubKey = function onSubKey(actionProperty) {
 399    return function (reducer) {
 400      return function () {
 401        var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 402        var action = arguments.length > 1 ? arguments[1] : undefined;
 403        // Retrieve subkey from action. Do not track if undefined; useful for cases
 404        // where reducer is scoped by action shape.
 405        var key = action[actionProperty];
 406  
 407        if (key === undefined) {
 408          return state;
 409        } // Avoid updating state if unchanged. Note that this also accounts for a
 410        // reducer which returns undefined on a key which is not yet tracked.
 411  
 412  
 413        var nextKeyState = reducer(state[key], action);
 414  
 415        if (nextKeyState === state[key]) {
 416          return state;
 417        }
 418  
 419        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, key, nextKeyState));
 420      };
 421    };
 422  };
 423  /* harmony default export */ var on_sub_key = (on_sub_key_onSubKey);
 424  
 425  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/replace-action.js
 426  /**
 427   * Higher-order reducer creator which substitutes the action object before
 428   * passing to the original reducer.
 429   *
 430   * @param {Function} replacer Function mapping original action to replacement.
 431   *
 432   * @return {Function} Higher-order reducer.
 433   */
 434  var replaceAction = function replaceAction(replacer) {
 435    return function (reducer) {
 436      return function (state, action) {
 437        return reducer(state, replacer(action));
 438      };
 439    };
 440  };
 441  
 442  /* harmony default export */ var replace_action = (replaceAction);
 443  
 444  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/with-weak-map-cache.js
 445  /**
 446   * External dependencies
 447   */
 448  
 449  /**
 450   * Given a function, returns an enhanced function which caches the result and
 451   * tracks in WeakMap. The result is only cached if the original function is
 452   * passed a valid object-like argument (requirement for WeakMap key).
 453   *
 454   * @param {Function} fn Original function.
 455   *
 456   * @return {Function} Enhanced caching function.
 457   */
 458  
 459  function withWeakMapCache(fn) {
 460    var cache = new WeakMap();
 461    return function (key) {
 462      var value;
 463  
 464      if (cache.has(key)) {
 465        value = cache.get(key);
 466      } else {
 467        value = fn(key); // Can reach here if key is not valid for WeakMap, since `has`
 468        // will return false for invalid key. Since `set` will throw,
 469        // ensure that key is valid before setting into cache.
 470  
 471        if (Object(external_lodash_["isObjectLike"])(key)) {
 472          cache.set(key, value);
 473        }
 474      }
 475  
 476      return value;
 477    };
 478  }
 479  
 480  /* harmony default export */ var with_weak_map_cache = (withWeakMapCache);
 481  
 482  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/utils/index.js
 483  
 484  
 485  
 486  
 487  
 488  
 489  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/actions.js
 490  
 491  
 492  /**
 493   * External dependencies
 494   */
 495  
 496  /**
 497   * Returns an action object used in signalling that items have been received.
 498   *
 499   * @param {Array} items Items received.
 500   *
 501   * @return {Object} Action object.
 502   */
 503  
 504  function receiveItems(items) {
 505    return {
 506      type: 'RECEIVE_ITEMS',
 507      items: Object(external_lodash_["castArray"])(items)
 508    };
 509  }
 510  /**
 511   * Returns an action object used in signalling that queried data has been
 512   * received.
 513   *
 514   * @param {Array}   items Queried items received.
 515   * @param {?Object} query Optional query object.
 516   *
 517   * @return {Object} Action object.
 518   */
 519  
 520  function receiveQueriedItems(items) {
 521    var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
 522    return Object(objectSpread["a" /* default */])({}, receiveItems(items), {
 523      query: query
 524    });
 525  }
 526  
 527  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
 528  var rememo = __webpack_require__(36);
 529  
 530  // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
 531  var equivalent_key_map = __webpack_require__(74);
 532  var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
 533  
 534  // EXTERNAL MODULE: external {"this":["wp","url"]}
 535  var external_this_wp_url_ = __webpack_require__(26);
 536  
 537  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/get-query-parts.js
 538  
 539  
 540  /**
 541   * WordPress dependencies
 542   */
 543  
 544  /**
 545   * Internal dependencies
 546   */
 547  
 548  
 549  /**
 550   * An object of properties describing a specific query.
 551   *
 552   * @typedef {Object} WPQueriedDataQueryParts
 553   *
 554   * @property {number} page      The query page (1-based index, default 1).
 555   * @property {number} perPage   Items per page for query (default 10).
 556   * @property {string} stableKey An encoded stable string of all non-pagination
 557   *                              query parameters.
 558   */
 559  
 560  /**
 561   * Given a query object, returns an object of parts, including pagination
 562   * details (`page` and `perPage`, or default values). All other properties are
 563   * encoded into a stable (idempotent) `stableKey` value.
 564   *
 565   * @param {Object} query Optional query object.
 566   *
 567   * @return {WPQueriedDataQueryParts} Query parts.
 568   */
 569  
 570  function getQueryParts(query) {
 571    /**
 572     * @type {WPQueriedDataQueryParts}
 573     */
 574    var parts = {
 575      stableKey: '',
 576      page: 1,
 577      perPage: 10
 578    }; // Ensure stable key by sorting keys. Also more efficient for iterating.
 579  
 580    var keys = Object.keys(query).sort();
 581  
 582    for (var i = 0; i < keys.length; i++) {
 583      var key = keys[i];
 584      var value = query[key];
 585  
 586      switch (key) {
 587        case 'page':
 588          parts[key] = Number(value);
 589          break;
 590  
 591        case 'per_page':
 592          parts.perPage = Number(value);
 593          break;
 594  
 595        default:
 596          // While it could be any deterministic string, for simplicity's
 597          // sake mimic querystring encoding for stable key.
 598          //
 599          // TODO: For consistency with PHP implementation, addQueryArgs
 600          // should accept a key value pair, which may optimize its
 601          // implementation for our use here, vs. iterating an object
 602          // with only a single key.
 603          parts.stableKey += (parts.stableKey ? '&' : '') + Object(external_this_wp_url_["addQueryArgs"])('', Object(defineProperty["a" /* default */])({}, key, value)).slice(1);
 604      }
 605    }
 606  
 607    return parts;
 608  }
 609  /* harmony default export */ var get_query_parts = (with_weak_map_cache(getQueryParts));
 610  
 611  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/selectors.js
 612  /**
 613   * External dependencies
 614   */
 615  
 616  
 617  /**
 618   * Internal dependencies
 619   */
 620  
 621  
 622  /**
 623   * Cache of state keys to EquivalentKeyMap where the inner map tracks queries
 624   * to their resulting items set. WeakMap allows garbage collection on expired
 625   * state references.
 626   *
 627   * @type {WeakMap<Object,EquivalentKeyMap>}
 628   */
 629  
 630  var queriedItemsCacheByState = new WeakMap();
 631  /**
 632   * Returns items for a given query, or null if the items are not known.
 633   *
 634   * @param {Object}  state State object.
 635   * @param {?Object} query Optional query.
 636   *
 637   * @return {?Array} Query items.
 638   */
 639  
 640  function getQueriedItemsUncached(state, query) {
 641    var _getQueryParts = get_query_parts(query),
 642        stableKey = _getQueryParts.stableKey,
 643        page = _getQueryParts.page,
 644        perPage = _getQueryParts.perPage;
 645  
 646    if (!state.queries[stableKey]) {
 647      return null;
 648    }
 649  
 650    var itemIds = state.queries[stableKey];
 651  
 652    if (!itemIds) {
 653      return null;
 654    }
 655  
 656    var startOffset = perPage === -1 ? 0 : (page - 1) * perPage;
 657    var endOffset = perPage === -1 ? itemIds.length : Math.min(startOffset + perPage, itemIds.length);
 658    var items = [];
 659  
 660    for (var i = startOffset; i < endOffset; i++) {
 661      var itemId = itemIds[i];
 662      items.push(state.items[itemId]);
 663    }
 664  
 665    return items;
 666  }
 667  /**
 668   * Returns items for a given query, or null if the items are not known. Caches
 669   * result both per state (by reference) and per query (by deep equality).
 670   * The caching approach is intended to be durable to query objects which are
 671   * deeply but not referentially equal, since otherwise:
 672   *
 673   * `getQueriedItems( state, {} ) !== getQueriedItems( state, {} )`
 674   *
 675   * @param {Object}  state State object.
 676   * @param {?Object} query Optional query.
 677   *
 678   * @return {?Array} Query items.
 679   */
 680  
 681  
 682  var getQueriedItems = Object(rememo["a" /* default */])(function (state) {
 683    var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
 684    var queriedItemsCache = queriedItemsCacheByState.get(state);
 685  
 686    if (queriedItemsCache) {
 687      var queriedItems = queriedItemsCache.get(query);
 688  
 689      if (queriedItems !== undefined) {
 690        return queriedItems;
 691      }
 692    } else {
 693      queriedItemsCache = new equivalent_key_map_default.a();
 694      queriedItemsCacheByState.set(state, queriedItemsCache);
 695    }
 696  
 697    var items = getQueriedItemsUncached(state, query);
 698    queriedItemsCache.set(query, items);
 699    return items;
 700  });
 701  
 702  // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
 703  var regenerator = __webpack_require__(20);
 704  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
 705  
 706  // EXTERNAL MODULE: external {"this":["wp","apiFetch"]}
 707  var external_this_wp_apiFetch_ = __webpack_require__(34);
 708  var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_);
 709  
 710  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/controls.js
 711  
 712  
 713  /**
 714   * WordPress dependencies
 715   */
 716  
 717  
 718  /**
 719   * Trigger an API Fetch request.
 720   *
 721   * @param {Object} request API Fetch Request Object.
 722   * @return {Object} control descriptor.
 723   */
 724  
 725  function apiFetch(request) {
 726    return {
 727      type: 'API_FETCH',
 728      request: request
 729    };
 730  }
 731  /**
 732   * Calls a selector using the current state.
 733   *
 734   * @param {string} selectorName Selector name.
 735   * @param  {Array} args         Selector arguments.
 736   *
 737   * @return {Object} control descriptor.
 738   */
 739  
 740  function controls_select(selectorName) {
 741    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
 742      args[_key - 1] = arguments[_key];
 743    }
 744  
 745    return {
 746      type: 'SELECT',
 747      selectorName: selectorName,
 748      args: args
 749    };
 750  }
 751  /**
 752   * Dispatches a control action for triggering a registry select that has a
 753   * resolver.
 754   *
 755   * @param {string}  selectorName
 756   * @param {Array}   args  Arguments for the select.
 757   *
 758   * @return {Object} control descriptor.
 759   */
 760  
 761  function resolveSelect(selectorName) {
 762    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
 763      args[_key2 - 1] = arguments[_key2];
 764    }
 765  
 766    return {
 767      type: 'RESOLVE_SELECT',
 768      selectorName: selectorName,
 769      args: args
 770    };
 771  }
 772  var controls = {
 773    API_FETCH: function API_FETCH(_ref) {
 774      var request = _ref.request;
 775      return external_this_wp_apiFetch_default()(request);
 776    },
 777    SELECT: Object(external_this_wp_data_["createRegistryControl"])(function (registry) {
 778      return function (_ref2) {
 779        var _registry$select;
 780  
 781        var selectorName = _ref2.selectorName,
 782            args = _ref2.args;
 783        return (_registry$select = registry.select('core'))[selectorName].apply(_registry$select, Object(toConsumableArray["a" /* default */])(args));
 784      };
 785    }),
 786    RESOLVE_SELECT: Object(external_this_wp_data_["createRegistryControl"])(function (registry) {
 787      return function (_ref3) {
 788        var selectorName = _ref3.selectorName,
 789            args = _ref3.args;
 790        return new Promise(function (resolve) {
 791          var hasFinished = function hasFinished() {
 792            return registry.select('core/data').hasFinishedResolution('core', selectorName, args);
 793          };
 794  
 795          var getResult = function getResult() {
 796            return registry.select('core')[selectorName].apply(null, args);
 797          }; // trigger the selector (to trigger the resolver)
 798  
 799  
 800          var result = getResult();
 801  
 802          if (hasFinished()) {
 803            return resolve(result);
 804          }
 805  
 806          var unsubscribe = registry.subscribe(function () {
 807            if (hasFinished()) {
 808              unsubscribe();
 809              resolve(getResult());
 810            }
 811          });
 812        });
 813      };
 814    })
 815  };
 816  /* harmony default export */ var build_module_controls = (controls);
 817  
 818  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/actions.js
 819  
 820  
 821  
 822  var _marked =
 823  /*#__PURE__*/
 824  regenerator_default.a.mark(editEntityRecord),
 825      _marked2 =
 826  /*#__PURE__*/
 827  regenerator_default.a.mark(undo),
 828      _marked3 =
 829  /*#__PURE__*/
 830  regenerator_default.a.mark(redo),
 831      _marked4 =
 832  /*#__PURE__*/
 833  regenerator_default.a.mark(saveEntityRecord),
 834      _marked5 =
 835  /*#__PURE__*/
 836  regenerator_default.a.mark(saveEditedEntityRecord);
 837  
 838  /**
 839   * External dependencies
 840   */
 841  
 842  /**
 843   * Internal dependencies
 844   */
 845  
 846  
 847  
 848  
 849  /**
 850   * Returns an action object used in signalling that authors have been received.
 851   *
 852   * @param {string}       queryID Query ID.
 853   * @param {Array|Object} users   Users received.
 854   *
 855   * @return {Object} Action object.
 856   */
 857  
 858  function receiveUserQuery(queryID, users) {
 859    return {
 860      type: 'RECEIVE_USER_QUERY',
 861      users: Object(external_lodash_["castArray"])(users),
 862      queryID: queryID
 863    };
 864  }
 865  /**
 866   * Returns an action used in signalling that the current user has been received.
 867   *
 868   * @param {Object} currentUser Current user object.
 869   *
 870   * @return {Object} Action object.
 871   */
 872  
 873  function receiveCurrentUser(currentUser) {
 874    return {
 875      type: 'RECEIVE_CURRENT_USER',
 876      currentUser: currentUser
 877    };
 878  }
 879  /**
 880   * Returns an action object used in adding new entities.
 881   *
 882   * @param {Array} entities  Entities received.
 883   *
 884   * @return {Object} Action object.
 885   */
 886  
 887  function addEntities(entities) {
 888    return {
 889      type: 'ADD_ENTITIES',
 890      entities: entities
 891    };
 892  }
 893  /**
 894   * Returns an action object used in signalling that entity records have been received.
 895   *
 896   * @param {string}       kind            Kind of the received entity.
 897   * @param {string}       name            Name of the received entity.
 898   * @param {Array|Object} records         Records received.
 899   * @param {?Object}      query           Query Object.
 900   * @param {?boolean}     invalidateCache Should invalidate query caches
 901   *
 902   * @return {Object} Action object.
 903   */
 904  
 905  function receiveEntityRecords(kind, name, records, query) {
 906    var invalidateCache = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
 907  
 908    // Auto drafts should not have titles, but some plugins rely on them so we can't filter this
 909    // on the server.
 910    if (kind === 'postType') {
 911      records = Object(external_lodash_["castArray"])(records).map(function (record) {
 912        return record.status === 'auto-draft' ? Object(objectSpread["a" /* default */])({}, record, {
 913          title: ''
 914        }) : record;
 915      });
 916    }
 917  
 918    var action;
 919  
 920    if (query) {
 921      action = receiveQueriedItems(records, query);
 922    } else {
 923      action = receiveItems(records);
 924    }
 925  
 926    return Object(objectSpread["a" /* default */])({}, action, {
 927      kind: kind,
 928      name: name,
 929      invalidateCache: invalidateCache
 930    });
 931  }
 932  /**
 933   * Returns an action object used in signalling that the index has been received.
 934   *
 935   * @param {Object} themeSupports Theme support for the current theme.
 936   *
 937   * @return {Object} Action object.
 938   */
 939  
 940  function receiveThemeSupports(themeSupports) {
 941    return {
 942      type: 'RECEIVE_THEME_SUPPORTS',
 943      themeSupports: themeSupports
 944    };
 945  }
 946  /**
 947   * Returns an action object used in signalling that the preview data for
 948   * a given URl has been received.
 949   *
 950   * @param {string}  url      URL to preview the embed for.
 951   * @param {Mixed}   preview  Preview data.
 952   *
 953   * @return {Object} Action object.
 954   */
 955  
 956  function receiveEmbedPreview(url, preview) {
 957    return {
 958      type: 'RECEIVE_EMBED_PREVIEW',
 959      url: url,
 960      preview: preview
 961    };
 962  }
 963  /**
 964   * Returns an action object that triggers an
 965   * edit to an entity record.
 966   *
 967   * @param {string} kind     Kind of the edited entity record.
 968   * @param {string} name     Name of the edited entity record.
 969   * @param {number} recordId Record ID of the edited entity record.
 970   * @param {Object} edits    The edits.
 971   * @param {Object} options  Options for the edit.
 972   * @param {boolean} options.undoIgnore Whether to ignore the edit in undo history or not.
 973   *
 974   * @return {Object} Action object.
 975   */
 976  
 977  function editEntityRecord(kind, name, recordId, edits) {
 978    var options,
 979        _ref,
 980        _ref$transientEdits,
 981        transientEdits,
 982        _ref$mergedEdits,
 983        mergedEdits,
 984        record,
 985        editedRecord,
 986        edit,
 987        _args = arguments;
 988  
 989    return regenerator_default.a.wrap(function editEntityRecord$(_context) {
 990      while (1) {
 991        switch (_context.prev = _context.next) {
 992          case 0:
 993            options = _args.length > 4 && _args[4] !== undefined ? _args[4] : {};
 994            _context.next = 3;
 995            return controls_select('getEntity', kind, name);
 996  
 997          case 3:
 998            _ref = _context.sent;
 999            _ref$transientEdits = _ref.transientEdits;
1000            transientEdits = _ref$transientEdits === void 0 ? {} : _ref$transientEdits;
1001            _ref$mergedEdits = _ref.mergedEdits;
1002            mergedEdits = _ref$mergedEdits === void 0 ? {} : _ref$mergedEdits;
1003            _context.next = 10;
1004            return controls_select('getRawEntityRecord', kind, name, recordId);
1005  
1006          case 10:
1007            record = _context.sent;
1008            _context.next = 13;
1009            return controls_select('getEditedEntityRecord', kind, name, recordId);
1010  
1011          case 13:
1012            editedRecord = _context.sent;
1013            edit = {
1014              kind: kind,
1015              name: name,
1016              recordId: recordId,
1017              // Clear edits when they are equal to their persisted counterparts
1018              // so that the property is not considered dirty.
1019              edits: Object.keys(edits).reduce(function (acc, key) {
1020                var recordValue = record[key];
1021                var editedRecordValue = editedRecord[key];
1022                var value = mergedEdits[key] ? Object(objectSpread["a" /* default */])({}, editedRecordValue, edits[key]) : edits[key];
1023                acc[key] = Object(external_lodash_["isEqual"])(recordValue, value) ? undefined : value;
1024                return acc;
1025              }, {}),
1026              transientEdits: transientEdits
1027            };
1028            return _context.abrupt("return", Object(objectSpread["a" /* default */])({
1029              type: 'EDIT_ENTITY_RECORD'
1030            }, edit, {
1031              meta: {
1032                undo: !options.undoIgnore && Object(objectSpread["a" /* default */])({}, edit, {
1033                  // Send the current values for things like the first undo stack entry.
1034                  edits: Object.keys(edits).reduce(function (acc, key) {
1035                    acc[key] = editedRecord[key];
1036                    return acc;
1037                  }, {})
1038                })
1039              }
1040            }));
1041  
1042          case 16:
1043          case "end":
1044            return _context.stop();
1045        }
1046      }
1047    }, _marked);
1048  }
1049  /**
1050   * Action triggered to undo the last edit to
1051   * an entity record, if any.
1052   */
1053  
1054  function undo() {
1055    var undoEdit;
1056    return regenerator_default.a.wrap(function undo$(_context2) {
1057      while (1) {
1058        switch (_context2.prev = _context2.next) {
1059          case 0:
1060            _context2.next = 2;
1061            return controls_select('getUndoEdit');
1062  
1063          case 2:
1064            undoEdit = _context2.sent;
1065  
1066            if (undoEdit) {
1067              _context2.next = 5;
1068              break;
1069            }
1070  
1071            return _context2.abrupt("return");
1072  
1073          case 5:
1074            _context2.next = 7;
1075            return Object(objectSpread["a" /* default */])({
1076              type: 'EDIT_ENTITY_RECORD'
1077            }, undoEdit, {
1078              meta: {
1079                isUndo: true
1080              }
1081            });
1082  
1083          case 7:
1084          case "end":
1085            return _context2.stop();
1086        }
1087      }
1088    }, _marked2);
1089  }
1090  /**
1091   * Action triggered to redo the last undoed
1092   * edit to an entity record, if any.
1093   */
1094  
1095  function redo() {
1096    var redoEdit;
1097    return regenerator_default.a.wrap(function redo$(_context3) {
1098      while (1) {
1099        switch (_context3.prev = _context3.next) {
1100          case 0:
1101            _context3.next = 2;
1102            return controls_select('getRedoEdit');
1103  
1104          case 2:
1105            redoEdit = _context3.sent;
1106  
1107            if (redoEdit) {
1108              _context3.next = 5;
1109              break;
1110            }
1111  
1112            return _context3.abrupt("return");
1113  
1114          case 5:
1115            _context3.next = 7;
1116            return Object(objectSpread["a" /* default */])({
1117              type: 'EDIT_ENTITY_RECORD'
1118            }, redoEdit, {
1119              meta: {
1120                isRedo: true
1121              }
1122            });
1123  
1124          case 7:
1125          case "end":
1126            return _context3.stop();
1127        }
1128      }
1129    }, _marked3);
1130  }
1131  /**
1132   * Forces the creation of a new undo level.
1133   *
1134   * @return {Object} Action object.
1135   */
1136  
1137  function __unstableCreateUndoLevel() {
1138    return {
1139      type: 'CREATE_UNDO_LEVEL'
1140    };
1141  }
1142  /**
1143   * Action triggered to save an entity record.
1144   *
1145   * @param {string} kind    Kind of the received entity.
1146   * @param {string} name    Name of the received entity.
1147   * @param {Object} record  Record to be saved.
1148   * @param {Object} options Saving options.
1149   */
1150  
1151  function saveEntityRecord(kind, name, record) {
1152    var _ref2,
1153        _ref2$isAutosave,
1154        isAutosave,
1155        entities,
1156        entity,
1157        entityIdKey,
1158        recordId,
1159        updatedRecord,
1160        error,
1161        persistedEntity,
1162        currentEdits,
1163        path,
1164        persistedRecord,
1165        currentUser,
1166        currentUserId,
1167        autosavePost,
1168        data,
1169        newRecord,
1170        _data,
1171        _args4 = arguments;
1172  
1173    return regenerator_default.a.wrap(function saveEntityRecord$(_context4) {
1174      while (1) {
1175        switch (_context4.prev = _context4.next) {
1176          case 0:
1177            _ref2 = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : {
1178              isAutosave: false
1179            }, _ref2$isAutosave = _ref2.isAutosave, isAutosave = _ref2$isAutosave === void 0 ? false : _ref2$isAutosave;
1180            _context4.next = 3;
1181            return getKindEntities(kind);
1182  
1183          case 3:
1184            entities = _context4.sent;
1185            entity = Object(external_lodash_["find"])(entities, {
1186              kind: kind,
1187              name: name
1188            });
1189  
1190            if (entity) {
1191              _context4.next = 7;
1192              break;
1193            }
1194  
1195            return _context4.abrupt("return");
1196  
1197          case 7:
1198            entityIdKey = entity.key || DEFAULT_ENTITY_KEY;
1199            recordId = record[entityIdKey];
1200            _context4.next = 11;
1201            return {
1202              type: 'SAVE_ENTITY_RECORD_START',
1203              kind: kind,
1204              name: name,
1205              recordId: recordId,
1206              isAutosave: isAutosave
1207            };
1208  
1209          case 11:
1210            _context4.prev = 11;
1211            path = "".concat(entity.baseURL).concat(recordId ? '/' + recordId : '');
1212            _context4.next = 15;
1213            return controls_select('getRawEntityRecord', kind, name, recordId);
1214  
1215          case 15:
1216            persistedRecord = _context4.sent;
1217  
1218            if (!isAutosave) {
1219              _context4.next = 40;
1220              break;
1221            }
1222  
1223            _context4.next = 19;
1224            return controls_select('getCurrentUser');
1225  
1226          case 19:
1227            currentUser = _context4.sent;
1228            currentUserId = currentUser ? currentUser.id : undefined;
1229            _context4.next = 23;
1230            return controls_select('getAutosave', persistedRecord.type, persistedRecord.id, currentUserId);
1231  
1232          case 23:
1233            autosavePost = _context4.sent;
1234            // Autosaves need all expected fields to be present.
1235            // So we fallback to the previous autosave and then
1236            // to the actual persisted entity if the edits don't
1237            // have a value.
1238            data = Object(objectSpread["a" /* default */])({}, persistedRecord, autosavePost, record);
1239            data = Object.keys(data).reduce(function (acc, key) {
1240              if (['title', 'excerpt', 'content'].includes(key)) {
1241                // Edits should be the "raw" attribute values.
1242                acc[key] = Object(external_lodash_["get"])(data[key], 'raw', data[key]);
1243              }
1244  
1245              return acc;
1246            }, {
1247              status: data.status === 'auto-draft' ? 'draft' : data.status
1248            });
1249            _context4.next = 28;
1250            return apiFetch({
1251              path: "".concat(path, "/autosaves"),
1252              method: 'POST',
1253              data: data
1254            });
1255  
1256          case 28:
1257            updatedRecord = _context4.sent;
1258  
1259            if (!(persistedRecord.id === updatedRecord.id)) {
1260              _context4.next = 36;
1261              break;
1262            }
1263  
1264            newRecord = Object(objectSpread["a" /* default */])({}, persistedRecord, data, updatedRecord);
1265            newRecord = Object.keys(newRecord).reduce(function (acc, key) {
1266              // These properties are persisted in autosaves.
1267              if (['title', 'excerpt', 'content'].includes(key)) {
1268                // Edits should be the "raw" attribute values.
1269                acc[key] = Object(external_lodash_["get"])(newRecord[key], 'raw', newRecord[key]);
1270              } else if (key === 'status') {
1271                // Status is only persisted in autosaves when going from
1272                // "auto-draft" to "draft".
1273                acc[key] = persistedRecord.status === 'auto-draft' && newRecord.status === 'draft' ? newRecord.status : persistedRecord.status;
1274              } else {
1275                // These properties are not persisted in autosaves.
1276                acc[key] = Object(external_lodash_["get"])(persistedRecord[key], 'raw', persistedRecord[key]);
1277              }
1278  
1279              return acc;
1280            }, {});
1281            _context4.next = 34;
1282            return receiveEntityRecords(kind, name, newRecord, undefined, true);
1283  
1284          case 34:
1285            _context4.next = 38;
1286            break;
1287  
1288          case 36:
1289            _context4.next = 38;
1290            return receiveAutosaves(persistedRecord.id, updatedRecord);
1291  
1292          case 38:
1293            _context4.next = 55;
1294            break;
1295  
1296          case 40:
1297            // Auto drafts should be converted to drafts on explicit saves and we should not respect their default title,
1298            // but some plugins break with this behavior so we can't filter it on the server.
1299            _data = record;
1300  
1301            if (kind === 'postType' && persistedRecord && persistedRecord.status === 'auto-draft') {
1302              if (!_data.status) {
1303                _data = Object(objectSpread["a" /* default */])({}, _data, {
1304                  status: 'draft'
1305                });
1306              }
1307  
1308              if (!_data.title || _data.title === 'Auto Draft') {
1309                _data = Object(objectSpread["a" /* default */])({}, _data, {
1310                  title: ''
1311                });
1312              }
1313            } // We perform an optimistic update here to clear all the edits that
1314            // will be persisted so that if the server filters them, the new
1315            // filtered values are always accepted.
1316  
1317  
1318            _context4.next = 44;
1319            return controls_select('getEntityRecord', kind, name, recordId);
1320  
1321          case 44:
1322            persistedEntity = _context4.sent;
1323            _context4.next = 47;
1324            return controls_select('getEntityRecordEdits', kind, name, recordId);
1325  
1326          case 47:
1327            currentEdits = _context4.sent;
1328            _context4.next = 50;
1329            return receiveEntityRecords(kind, name, Object(objectSpread["a" /* default */])({}, persistedEntity, _data), undefined, true);
1330  
1331          case 50:
1332            _context4.next = 52;
1333            return apiFetch({
1334              path: path,
1335              method: recordId ? 'PUT' : 'POST',
1336              data: _data
1337            });
1338  
1339          case 52:
1340            updatedRecord = _context4.sent;
1341            _context4.next = 55;
1342            return receiveEntityRecords(kind, name, updatedRecord, undefined, true);
1343  
1344          case 55:
1345            _context4.next = 77;
1346            break;
1347  
1348          case 57:
1349            _context4.prev = 57;
1350            _context4.t0 = _context4["catch"](11);
1351            error = _context4.t0; // If we got to the point in the try block where we made an optimistic update,
1352            // we need to roll it back here.
1353  
1354            if (!(persistedEntity && currentEdits)) {
1355              _context4.next = 77;
1356              break;
1357            }
1358  
1359            _context4.next = 63;
1360            return receiveEntityRecords(kind, name, persistedEntity, undefined, true);
1361  
1362          case 63:
1363            _context4.t1 = editEntityRecord;
1364            _context4.t2 = kind;
1365            _context4.t3 = name;
1366            _context4.t4 = recordId;
1367            _context4.t5 = objectSpread["a" /* default */];
1368            _context4.t6 = {};
1369            _context4.t7 = currentEdits;
1370            _context4.next = 72;
1371            return controls_select('getEntityRecordEdits', kind, name, recordId);
1372  
1373          case 72:
1374            _context4.t8 = _context4.sent;
1375            _context4.t9 = (0, _context4.t5)(_context4.t6, _context4.t7, _context4.t8);
1376            _context4.t10 = {
1377              undoIgnore: true
1378            };
1379            _context4.next = 77;
1380            return (0, _context4.t1)(_context4.t2, _context4.t3, _context4.t4, _context4.t9, _context4.t10);
1381  
1382          case 77:
1383            _context4.next = 79;
1384            return {
1385              type: 'SAVE_ENTITY_RECORD_FINISH',
1386              kind: kind,
1387              name: name,
1388              recordId: recordId,
1389              error: error,
1390              isAutosave: isAutosave
1391            };
1392  
1393          case 79:
1394            return _context4.abrupt("return", updatedRecord);
1395  
1396          case 80:
1397          case "end":
1398            return _context4.stop();
1399        }
1400      }
1401    }, _marked4, null, [[11, 57]]);
1402  }
1403  /**
1404   * Action triggered to save an entity record's edits.
1405   *
1406   * @param {string} kind     Kind of the entity.
1407   * @param {string} name     Name of the entity.
1408   * @param {Object} recordId ID of the record.
1409   * @param {Object} options  Saving options.
1410   */
1411  
1412  function saveEditedEntityRecord(kind, name, recordId, options) {
1413    var edits, record;
1414    return regenerator_default.a.wrap(function saveEditedEntityRecord$(_context5) {
1415      while (1) {
1416        switch (_context5.prev = _context5.next) {
1417          case 0:
1418            _context5.next = 2;
1419            return controls_select('hasEditsForEntityRecord', kind, name, recordId);
1420  
1421          case 2:
1422            if (_context5.sent) {
1423              _context5.next = 4;
1424              break;
1425            }
1426  
1427            return _context5.abrupt("return");
1428  
1429          case 4:
1430            _context5.next = 6;
1431            return controls_select('getEntityRecordNonTransientEdits', kind, name, recordId);
1432  
1433          case 6:
1434            edits = _context5.sent;
1435            record = Object(objectSpread["a" /* default */])({
1436              id: recordId
1437            }, edits);
1438            return _context5.delegateYield(saveEntityRecord(kind, name, record, options), "t0", 9);
1439  
1440          case 9:
1441          case "end":
1442            return _context5.stop();
1443        }
1444      }
1445    }, _marked5);
1446  }
1447  /**
1448   * Returns an action object used in signalling that Upload permissions have been received.
1449   *
1450   * @param {boolean} hasUploadPermissions Does the user have permission to upload files?
1451   *
1452   * @return {Object} Action object.
1453   */
1454  
1455  function receiveUploadPermissions(hasUploadPermissions) {
1456    return {
1457      type: 'RECEIVE_USER_PERMISSION',
1458      key: 'create/media',
1459      isAllowed: hasUploadPermissions
1460    };
1461  }
1462  /**
1463   * Returns an action object used in signalling that the current user has
1464   * permission to perform an action on a REST resource.
1465   *
1466   * @param {string}  key       A key that represents the action and REST resource.
1467   * @param {boolean} isAllowed Whether or not the user can perform the action.
1468   *
1469   * @return {Object} Action object.
1470   */
1471  
1472  function receiveUserPermission(key, isAllowed) {
1473    return {
1474      type: 'RECEIVE_USER_PERMISSION',
1475      key: key,
1476      isAllowed: isAllowed
1477    };
1478  }
1479  /**
1480   * Returns an action object used in signalling that the autosaves for a
1481   * post have been received.
1482   *
1483   * @param {number}       postId    The id of the post that is parent to the autosave.
1484   * @param {Array|Object} autosaves An array of autosaves or singular autosave object.
1485   *
1486   * @return {Object} Action object.
1487   */
1488  
1489  function receiveAutosaves(postId, autosaves) {
1490    return {
1491      type: 'RECEIVE_AUTOSAVES',
1492      postId: postId,
1493      autosaves: Object(external_lodash_["castArray"])(autosaves)
1494    };
1495  }
1496  
1497  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/entities.js
1498  
1499  
1500  var entities_marked =
1501  /*#__PURE__*/
1502  regenerator_default.a.mark(loadPostTypeEntities),
1503      entities_marked2 =
1504  /*#__PURE__*/
1505  regenerator_default.a.mark(loadTaxonomyEntities),
1506      entities_marked3 =
1507  /*#__PURE__*/
1508  regenerator_default.a.mark(getKindEntities);
1509  
1510  /**
1511   * External dependencies
1512   */
1513  
1514  /**
1515   * Internal dependencies
1516   */
1517  
1518  
1519  
1520  var DEFAULT_ENTITY_KEY = 'id';
1521  var defaultEntities = [{
1522    name: 'postType',
1523    kind: 'root',
1524    key: 'slug',
1525    baseURL: '/wp/v2/types'
1526  }, {
1527    name: 'media',
1528    kind: 'root',
1529    baseURL: '/wp/v2/media',
1530    plural: 'mediaItems'
1531  }, {
1532    name: 'taxonomy',
1533    kind: 'root',
1534    key: 'slug',
1535    baseURL: '/wp/v2/taxonomies',
1536    plural: 'taxonomies'
1537  }, {
1538    name: 'widgetArea',
1539    kind: 'root',
1540    baseURL: '/__experimental/widget-areas',
1541    plural: 'widgetAreas'
1542  }];
1543  var kinds = [{
1544    name: 'postType',
1545    loadEntities: loadPostTypeEntities
1546  }, {
1547    name: 'taxonomy',
1548    loadEntities: loadTaxonomyEntities
1549  }];
1550  /**
1551   * Returns the list of post type entities.
1552   *
1553   * @return {Promise} Entities promise
1554   */
1555  
1556  function loadPostTypeEntities() {
1557    var postTypes;
1558    return regenerator_default.a.wrap(function loadPostTypeEntities$(_context) {
1559      while (1) {
1560        switch (_context.prev = _context.next) {
1561          case 0:
1562            _context.next = 2;
1563            return apiFetch({
1564              path: '/wp/v2/types?context=edit'
1565            });
1566  
1567          case 2:
1568            postTypes = _context.sent;
1569            return _context.abrupt("return", Object(external_lodash_["map"])(postTypes, function (postType, name) {
1570              return {
1571                kind: 'postType',
1572                baseURL: '/wp/v2/' + postType.rest_base,
1573                name: name,
1574                transientEdits: {
1575                  blocks: true
1576                },
1577                mergedEdits: {
1578                  meta: true
1579                }
1580              };
1581            }));
1582  
1583          case 4:
1584          case "end":
1585            return _context.stop();
1586        }
1587      }
1588    }, entities_marked);
1589  }
1590  /**
1591   * Returns the list of the taxonomies entities.
1592   *
1593   * @return {Promise} Entities promise
1594   */
1595  
1596  
1597  function loadTaxonomyEntities() {
1598    var taxonomies;
1599    return regenerator_default.a.wrap(function loadTaxonomyEntities$(_context2) {
1600      while (1) {
1601        switch (_context2.prev = _context2.next) {
1602          case 0:
1603            _context2.next = 2;
1604            return apiFetch({
1605              path: '/wp/v2/taxonomies?context=edit'
1606            });
1607  
1608          case 2:
1609            taxonomies = _context2.sent;
1610            return _context2.abrupt("return", Object(external_lodash_["map"])(taxonomies, function (taxonomy, name) {
1611              return {
1612                kind: 'taxonomy',
1613                baseURL: '/wp/v2/' + taxonomy.rest_base,
1614                name: name
1615              };
1616            }));
1617  
1618          case 4:
1619          case "end":
1620            return _context2.stop();
1621        }
1622      }
1623    }, entities_marked2);
1624  }
1625  /**
1626   * Returns the entity's getter method name given its kind and name.
1627   *
1628   * @param {string}  kind      Entity kind.
1629   * @param {string}  name      Entity name.
1630   * @param {string}  prefix    Function prefix.
1631   * @param {boolean} usePlural Whether to use the plural form or not.
1632   *
1633   * @return {string} Method name
1634   */
1635  
1636  
1637  var entities_getMethodName = function getMethodName(kind, name) {
1638    var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'get';
1639    var usePlural = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1640    var entity = Object(external_lodash_["find"])(defaultEntities, {
1641      kind: kind,
1642      name: name
1643    });
1644    var kindPrefix = kind === 'root' ? '' : Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(kind));
1645    var nameSuffix = Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(name)) + (usePlural ? 's' : '');
1646    var suffix = usePlural && entity.plural ? Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(entity.plural)) : nameSuffix;
1647    return "".concat(prefix).concat(kindPrefix).concat(suffix);
1648  };
1649  /**
1650   * Loads the kind entities into the store.
1651   *
1652   * @param {string} kind  Kind
1653   *
1654   * @return {Array} Entities
1655   */
1656  
1657  function getKindEntities(kind) {
1658    var entities, kindConfig;
1659    return regenerator_default.a.wrap(function getKindEntities$(_context3) {
1660      while (1) {
1661        switch (_context3.prev = _context3.next) {
1662          case 0:
1663            _context3.next = 2;
1664            return controls_select('getEntitiesByKind', kind);
1665  
1666          case 2:
1667            entities = _context3.sent;
1668  
1669            if (!(entities && entities.length !== 0)) {
1670              _context3.next = 5;
1671              break;
1672            }
1673  
1674            return _context3.abrupt("return", entities);
1675  
1676          case 5:
1677            kindConfig = Object(external_lodash_["find"])(kinds, {
1678              name: kind
1679            });
1680  
1681            if (kindConfig) {
1682              _context3.next = 8;
1683              break;
1684            }
1685  
1686            return _context3.abrupt("return", []);
1687  
1688          case 8:
1689            _context3.next = 10;
1690            return kindConfig.loadEntities();
1691  
1692          case 10:
1693            entities = _context3.sent;
1694            _context3.next = 13;
1695            return addEntities(entities);
1696  
1697          case 13:
1698            return _context3.abrupt("return", entities);
1699  
1700          case 14:
1701          case "end":
1702            return _context3.stop();
1703        }
1704      }
1705    }, entities_marked3);
1706  }
1707  
1708  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/reducer.js
1709  
1710  
1711  /**
1712   * External dependencies
1713   */
1714  
1715  /**
1716   * WordPress dependencies
1717   */
1718  
1719  
1720  /**
1721   * Internal dependencies
1722   */
1723  
1724  
1725  
1726  
1727  /**
1728   * Returns a merged array of item IDs, given details of the received paginated
1729   * items. The array is sparse-like with `undefined` entries where holes exist.
1730   *
1731   * @param {?Array<number>} itemIds     Original item IDs (default empty array).
1732   * @param {number[]}       nextItemIds Item IDs to merge.
1733   * @param {number}         page        Page of items merged.
1734   * @param {number}         perPage     Number of items per page.
1735   *
1736   * @return {number[]} Merged array of item IDs.
1737   */
1738  
1739  function getMergedItemIds(itemIds, nextItemIds, page, perPage) {
1740    var nextItemIdsStartIndex = (page - 1) * perPage; // If later page has already been received, default to the larger known
1741    // size of the existing array, else calculate as extending the existing.
1742  
1743    var size = Math.max(itemIds.length, nextItemIdsStartIndex + nextItemIds.length); // Preallocate array since size is known.
1744  
1745    var mergedItemIds = new Array(size);
1746  
1747    for (var i = 0; i < size; i++) {
1748      // Preserve existing item ID except for subset of range of next items.
1749      var isInNextItemsRange = i >= nextItemIdsStartIndex && i < nextItemIdsStartIndex + nextItemIds.length;
1750      mergedItemIds[i] = isInNextItemsRange ? nextItemIds[i - nextItemIdsStartIndex] : itemIds[i];
1751    }
1752  
1753    return mergedItemIds;
1754  }
1755  /**
1756   * Reducer tracking items state, keyed by ID. Items are assumed to be normal,
1757   * where identifiers are common across all queries.
1758   *
1759   * @param {Object} state  Current state.
1760   * @param {Object} action Dispatched action.
1761   *
1762   * @return {Object} Next state.
1763   */
1764  
1765  function reducer_items() {
1766    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1767    var action = arguments.length > 1 ? arguments[1] : undefined;
1768  
1769    switch (action.type) {
1770      case 'RECEIVE_ITEMS':
1771        var key = action.key || DEFAULT_ENTITY_KEY;
1772        return Object(objectSpread["a" /* default */])({}, state, action.items.reduce(function (acc, value) {
1773          var itemId = value[key];
1774          acc[itemId] = conservativeMapItem(state[itemId], value);
1775          return acc;
1776        }, {}));
1777    }
1778  
1779    return state;
1780  }
1781  /**
1782   * Reducer tracking queries state, keyed by stable query key. Each reducer
1783   * query object includes `itemIds` and `requestingPageByPerPage`.
1784   *
1785   * @param {Object} state  Current state.
1786   * @param {Object} action Dispatched action.
1787   *
1788   * @return {Object} Next state.
1789   */
1790  
1791  
1792  var queries = Object(external_lodash_["flowRight"])([// Limit to matching action type so we don't attempt to replace action on
1793  // an unhandled action.
1794  if_matching_action(function (action) {
1795    return 'query' in action;
1796  }), // Inject query parts into action for use both in `onSubKey` and reducer.
1797  replace_action(function (action) {
1798    // `ifMatchingAction` still passes on initialization, where state is
1799    // undefined and a query is not assigned. Avoid attempting to parse
1800    // parts. `onSubKey` will omit by lack of `stableKey`.
1801    if (action.query) {
1802      return Object(objectSpread["a" /* default */])({}, action, get_query_parts(action.query));
1803    }
1804  
1805    return action;
1806  }), // Queries shape is shared, but keyed by query `stableKey` part. Original
1807  // reducer tracks only a single query object.
1808  on_sub_key('stableKey')])(function () {
1809    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1810    var action = arguments.length > 1 ? arguments[1] : undefined;
1811    var type = action.type,
1812        page = action.page,
1813        perPage = action.perPage,
1814        _action$key = action.key,
1815        key = _action$key === void 0 ? DEFAULT_ENTITY_KEY : _action$key;
1816  
1817    if (type !== 'RECEIVE_ITEMS') {
1818      return state;
1819    }
1820  
1821    return getMergedItemIds(state || [], Object(external_lodash_["map"])(action.items, key), page, perPage);
1822  });
1823  /* harmony default export */ var queried_data_reducer = (Object(external_this_wp_data_["combineReducers"])({
1824    items: reducer_items,
1825    queries: queries
1826  }));
1827  
1828  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/queried-data/index.js
1829  
1830  
1831  
1832  
1833  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/reducer.js
1834  
1835  
1836  
1837  
1838  
1839  /**
1840   * External dependencies
1841   */
1842  
1843  /**
1844   * WordPress dependencies
1845   */
1846  
1847  
1848  
1849  /**
1850   * Internal dependencies
1851   */
1852  
1853  
1854  
1855  
1856  /**
1857   * Reducer managing terms state. Keyed by taxonomy slug, the value is either
1858   * undefined (if no request has been made for given taxonomy), null (if a
1859   * request is in-flight for given taxonomy), or the array of terms for the
1860   * taxonomy.
1861   *
1862   * @param {Object} state  Current state.
1863   * @param {Object} action Dispatched action.
1864   *
1865   * @return {Object} Updated state.
1866   */
1867  
1868  function terms() {
1869    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1870    var action = arguments.length > 1 ? arguments[1] : undefined;
1871  
1872    switch (action.type) {
1873      case 'RECEIVE_TERMS':
1874        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.taxonomy, action.terms));
1875    }
1876  
1877    return state;
1878  }
1879  /**
1880   * Reducer managing authors state. Keyed by id.
1881   *
1882   * @param {Object} state  Current state.
1883   * @param {Object} action Dispatched action.
1884   *
1885   * @return {Object} Updated state.
1886   */
1887  
1888  function reducer_users() {
1889    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
1890      byId: {},
1891      queries: {}
1892    };
1893    var action = arguments.length > 1 ? arguments[1] : undefined;
1894  
1895    switch (action.type) {
1896      case 'RECEIVE_USER_QUERY':
1897        return {
1898          byId: Object(objectSpread["a" /* default */])({}, state.byId, Object(external_lodash_["keyBy"])(action.users, 'id')),
1899          queries: Object(objectSpread["a" /* default */])({}, state.queries, Object(defineProperty["a" /* default */])({}, action.queryID, Object(external_lodash_["map"])(action.users, function (user) {
1900            return user.id;
1901          })))
1902        };
1903    }
1904  
1905    return state;
1906  }
1907  /**
1908   * Reducer managing current user state.
1909   *
1910   * @param {Object} state  Current state.
1911   * @param {Object} action Dispatched action.
1912   *
1913   * @return {Object} Updated state.
1914   */
1915  
1916  function reducer_currentUser() {
1917    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1918    var action = arguments.length > 1 ? arguments[1] : undefined;
1919  
1920    switch (action.type) {
1921      case 'RECEIVE_CURRENT_USER':
1922        return action.currentUser;
1923    }
1924  
1925    return state;
1926  }
1927  /**
1928   * Reducer managing taxonomies.
1929   *
1930   * @param {Object} state  Current state.
1931   * @param {Object} action Dispatched action.
1932   *
1933   * @return {Object} Updated state.
1934   */
1935  
1936  function reducer_taxonomies() {
1937    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1938    var action = arguments.length > 1 ? arguments[1] : undefined;
1939  
1940    switch (action.type) {
1941      case 'RECEIVE_TAXONOMIES':
1942        return action.taxonomies;
1943    }
1944  
1945    return state;
1946  }
1947  /**
1948   * Reducer managing theme supports data.
1949   *
1950   * @param {Object} state  Current state.
1951   * @param {Object} action Dispatched action.
1952   *
1953   * @return {Object} Updated state.
1954   */
1955  
1956  function themeSupports() {
1957    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1958    var action = arguments.length > 1 ? arguments[1] : undefined;
1959  
1960    switch (action.type) {
1961      case 'RECEIVE_THEME_SUPPORTS':
1962        return Object(objectSpread["a" /* default */])({}, state, action.themeSupports);
1963    }
1964  
1965    return state;
1966  }
1967  /**
1968   * Higher Order Reducer for a given entity config. It supports:
1969   *
1970   *  - Fetching
1971   *  - Editing
1972   *  - Saving
1973   *
1974   * @param {Object} entityConfig  Entity config.
1975   *
1976   * @return {Function} Reducer.
1977   */
1978  
1979  function reducer_entity(entityConfig) {
1980    return Object(external_lodash_["flowRight"])([// Limit to matching action type so we don't attempt to replace action on
1981    // an unhandled action.
1982    if_matching_action(function (action) {
1983      return action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind;
1984    }), // Inject the entity config into the action.
1985    replace_action(function (action) {
1986      return Object(objectSpread["a" /* default */])({}, action, {
1987        key: entityConfig.key || DEFAULT_ENTITY_KEY
1988      });
1989    })])(Object(external_this_wp_data_["combineReducers"])({
1990      queriedData: queried_data_reducer,
1991      edits: function edits() {
1992        var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1993        var action = arguments.length > 1 ? arguments[1] : undefined;
1994  
1995        switch (action.type) {
1996          case 'RECEIVE_ITEMS':
1997            var nextState = Object(objectSpread["a" /* default */])({}, state);
1998  
1999            var _iteratorNormalCompletion = true;
2000            var _didIteratorError = false;
2001            var _iteratorError = undefined;
2002  
2003            try {
2004              var _loop = function _loop() {
2005                var record = _step.value;
2006                var recordId = record[action.key];
2007                var edits = nextState[recordId];
2008  
2009                if (!edits) {
2010                  return "continue";
2011                }
2012  
2013                var nextEdits = Object.keys(edits).reduce(function (acc, key) {
2014                  // If the edited value is still different to the persisted value,
2015                  // keep the edited value in edits.
2016                  if ( // Edits are the "raw" attribute values, but records may have
2017                  // objects with more properties, so we use `get` here for the
2018                  // comparison.
2019                  !Object(external_lodash_["isEqual"])(edits[key], Object(external_lodash_["get"])(record[key], 'raw', record[key]))) {
2020                    acc[key] = edits[key];
2021                  }
2022  
2023                  return acc;
2024                }, {});
2025  
2026                if (Object.keys(nextEdits).length) {
2027                  nextState[recordId] = nextEdits;
2028                } else {
2029                  delete nextState[recordId];
2030                }
2031              };
2032  
2033              for (var _iterator = action.items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2034                var _ret = _loop();
2035  
2036                if (_ret === "continue") continue;
2037              }
2038            } catch (err) {
2039              _didIteratorError = true;
2040              _iteratorError = err;
2041            } finally {
2042              try {
2043                if (!_iteratorNormalCompletion && _iterator.return != null) {
2044                  _iterator.return();
2045                }
2046              } finally {
2047                if (_didIteratorError) {
2048                  throw _iteratorError;
2049                }
2050              }
2051            }
2052  
2053            return nextState;
2054  
2055          case 'EDIT_ENTITY_RECORD':
2056            var nextEdits = Object(objectSpread["a" /* default */])({}, state[action.recordId], action.edits);
2057  
2058            Object.keys(nextEdits).forEach(function (key) {
2059              // Delete cleared edits so that the properties
2060              // are not considered dirty.
2061              if (nextEdits[key] === undefined) {
2062                delete nextEdits[key];
2063              }
2064            });
2065            return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.recordId, nextEdits));
2066        }
2067  
2068        return state;
2069      },
2070      saving: function saving() {
2071        var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2072        var action = arguments.length > 1 ? arguments[1] : undefined;
2073  
2074        switch (action.type) {
2075          case 'SAVE_ENTITY_RECORD_START':
2076          case 'SAVE_ENTITY_RECORD_FINISH':
2077            return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.recordId, {
2078              pending: action.type === 'SAVE_ENTITY_RECORD_START',
2079              error: action.error,
2080              isAutosave: action.isAutosave
2081            }));
2082        }
2083  
2084        return state;
2085      }
2086    }));
2087  }
2088  /**
2089   * Reducer keeping track of the registered entities.
2090   *
2091   * @param {Object} state  Current state.
2092   * @param {Object} action Dispatched action.
2093   *
2094   * @return {Object} Updated state.
2095   */
2096  
2097  
2098  function entitiesConfig() {
2099    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultEntities;
2100    var action = arguments.length > 1 ? arguments[1] : undefined;
2101  
2102    switch (action.type) {
2103      case 'ADD_ENTITIES':
2104        return [].concat(Object(toConsumableArray["a" /* default */])(state), Object(toConsumableArray["a" /* default */])(action.entities));
2105    }
2106  
2107    return state;
2108  }
2109  /**
2110   * Reducer keeping track of the registered entities config and data.
2111   *
2112   * @param {Object} state  Current state.
2113   * @param {Object} action Dispatched action.
2114   *
2115   * @return {Object} Updated state.
2116   */
2117  
2118  var reducer_entities = function entities() {
2119    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2120    var action = arguments.length > 1 ? arguments[1] : undefined;
2121    var newConfig = entitiesConfig(state.config, action); // Generates a dynamic reducer for the entities
2122  
2123    var entitiesDataReducer = state.reducer;
2124  
2125    if (!entitiesDataReducer || newConfig !== state.config) {
2126      var entitiesByKind = Object(external_lodash_["groupBy"])(newConfig, 'kind');
2127      entitiesDataReducer = Object(external_this_wp_data_["combineReducers"])(Object.entries(entitiesByKind).reduce(function (memo, _ref) {
2128        var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2),
2129            kind = _ref2[0],
2130            subEntities = _ref2[1];
2131  
2132        var kindReducer = Object(external_this_wp_data_["combineReducers"])(subEntities.reduce(function (kindMemo, entityConfig) {
2133          return Object(objectSpread["a" /* default */])({}, kindMemo, Object(defineProperty["a" /* default */])({}, entityConfig.name, reducer_entity(entityConfig)));
2134        }, {}));
2135        memo[kind] = kindReducer;
2136        return memo;
2137      }, {}));
2138    }
2139  
2140    var newData = entitiesDataReducer(state.data, action);
2141  
2142    if (newData === state.data && newConfig === state.config && entitiesDataReducer === state.reducer) {
2143      return state;
2144    }
2145  
2146    return {
2147      reducer: entitiesDataReducer,
2148      data: newData,
2149      config: newConfig
2150    };
2151  };
2152  /**
2153   * Reducer keeping track of entity edit undo history.
2154   *
2155   * @param {Object} state  Current state.
2156   * @param {Object} action Dispatched action.
2157   *
2158   * @return {Object} Updated state.
2159   */
2160  
2161  var UNDO_INITIAL_STATE = [];
2162  UNDO_INITIAL_STATE.offset = 0;
2163  var lastEditAction;
2164  function reducer_undo() {
2165    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : UNDO_INITIAL_STATE;
2166    var action = arguments.length > 1 ? arguments[1] : undefined;
2167  
2168    switch (action.type) {
2169      case 'EDIT_ENTITY_RECORD':
2170      case 'CREATE_UNDO_LEVEL':
2171        var isCreateUndoLevel = action.type === 'CREATE_UNDO_LEVEL';
2172        var isUndoOrRedo = !isCreateUndoLevel && (action.meta.isUndo || action.meta.isRedo);
2173  
2174        if (isCreateUndoLevel) {
2175          action = lastEditAction;
2176        } else if (!isUndoOrRedo) {
2177          lastEditAction = action;
2178        }
2179  
2180        var nextState;
2181  
2182        if (isUndoOrRedo) {
2183          nextState = Object(toConsumableArray["a" /* default */])(state);
2184          nextState.offset = state.offset + (action.meta.isUndo ? -1 : 1);
2185  
2186          if (state.flattenedUndo) {
2187            // The first undo in a sequence of undos might happen while we have
2188            // flattened undos in state. If this is the case, we want execution
2189            // to continue as if we were creating an explicit undo level. This
2190            // will result in an extra undo level being appended with the flattened
2191            // undo values.
2192            isCreateUndoLevel = true;
2193            action = lastEditAction;
2194          } else {
2195            return nextState;
2196          }
2197        }
2198  
2199        if (!action.meta.undo) {
2200          return state;
2201        } // Transient edits don't create an undo level, but are
2202        // reachable in the next meaningful edit to which they
2203        // are merged. They are defined in the entity's config.
2204  
2205  
2206        if (!isCreateUndoLevel && !Object.keys(action.edits).some(function (key) {
2207          return !action.transientEdits[key];
2208        })) {
2209          nextState = Object(toConsumableArray["a" /* default */])(state);
2210          nextState.flattenedUndo = Object(objectSpread["a" /* default */])({}, state.flattenedUndo, action.edits);
2211          nextState.offset = state.offset;
2212          return nextState;
2213        } // Clear potential redos, because this only supports linear history.
2214  
2215  
2216        nextState = nextState || state.slice(0, state.offset || undefined);
2217        nextState.offset = nextState.offset || 0;
2218        nextState.pop();
2219  
2220        if (!isCreateUndoLevel) {
2221          nextState.push({
2222            kind: action.meta.undo.kind,
2223            name: action.meta.undo.name,
2224            recordId: action.meta.undo.recordId,
2225            edits: Object(objectSpread["a" /* default */])({}, state.flattenedUndo, action.meta.undo.edits)
2226          });
2227        } // When an edit is a function it's an optimization to avoid running some expensive operation.
2228        // We can't rely on the function references being the same so we opt out of comparing them here.
2229  
2230  
2231        var comparisonUndoEdits = Object.values(action.meta.undo.edits).filter(function (edit) {
2232          return typeof edit !== 'function';
2233        });
2234        var comparisonEdits = Object.values(action.edits).filter(function (edit) {
2235          return typeof edit !== 'function';
2236        });
2237  
2238        if (!external_this_wp_isShallowEqual_default()(comparisonUndoEdits, comparisonEdits)) {
2239          nextState.push({
2240            kind: action.kind,
2241            name: action.name,
2242            recordId: action.recordId,
2243            edits: isCreateUndoLevel ? Object(objectSpread["a" /* default */])({}, state.flattenedUndo, action.edits) : action.edits
2244          });
2245        }
2246  
2247        return nextState;
2248    }
2249  
2250    return state;
2251  }
2252  /**
2253   * Reducer managing embed preview data.
2254   *
2255   * @param {Object} state  Current state.
2256   * @param {Object} action Dispatched action.
2257   *
2258   * @return {Object} Updated state.
2259   */
2260  
2261  function embedPreviews() {
2262    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2263    var action = arguments.length > 1 ? arguments[1] : undefined;
2264  
2265    switch (action.type) {
2266      case 'RECEIVE_EMBED_PREVIEW':
2267        var url = action.url,
2268            preview = action.preview;
2269        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, url, preview));
2270    }
2271  
2272    return state;
2273  }
2274  /**
2275   * State which tracks whether the user can perform an action on a REST
2276   * resource.
2277   *
2278   * @param  {Object} state  Current state.
2279   * @param  {Object} action Dispatched action.
2280   *
2281   * @return {Object} Updated state.
2282   */
2283  
2284  function userPermissions() {
2285    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2286    var action = arguments.length > 1 ? arguments[1] : undefined;
2287  
2288    switch (action.type) {
2289      case 'RECEIVE_USER_PERMISSION':
2290        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.key, action.isAllowed));
2291    }
2292  
2293    return state;
2294  }
2295  /**
2296   * Reducer returning autosaves keyed by their parent's post id.
2297   *
2298   * @param  {Object} state  Current state.
2299   * @param  {Object} action Dispatched action.
2300   *
2301   * @return {Object} Updated state.
2302   */
2303  
2304  function reducer_autosaves() {
2305    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2306    var action = arguments.length > 1 ? arguments[1] : undefined;
2307  
2308    switch (action.type) {
2309      case 'RECEIVE_AUTOSAVES':
2310        var postId = action.postId,
2311            autosavesData = action.autosaves;
2312        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, postId, autosavesData));
2313    }
2314  
2315    return state;
2316  }
2317  /* harmony default export */ var build_module_reducer = (Object(external_this_wp_data_["combineReducers"])({
2318    terms: terms,
2319    users: reducer_users,
2320    currentUser: reducer_currentUser,
2321    taxonomies: reducer_taxonomies,
2322    themeSupports: themeSupports,
2323    entities: reducer_entities,
2324    undo: reducer_undo,
2325    embedPreviews: embedPreviews,
2326    userPermissions: userPermissions,
2327    autosaves: reducer_autosaves
2328  }));
2329  
2330  // EXTERNAL MODULE: external {"this":["wp","deprecated"]}
2331  var external_this_wp_deprecated_ = __webpack_require__(37);
2332  var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
2333  
2334  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/name.js
2335  /**
2336   * The reducer key used by core data in store registration.
2337   * This is defined in a separate file to avoid cycle-dependency
2338   *
2339   * @type {string}
2340   */
2341  var REDUCER_KEY = 'core';
2342  
2343  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/selectors.js
2344  
2345  
2346  /**
2347   * External dependencies
2348   */
2349  
2350  
2351  /**
2352   * WordPress dependencies
2353   */
2354  
2355  
2356  
2357  /**
2358   * Internal dependencies
2359   */
2360  
2361  
2362  
2363  /**
2364   * Returns true if a request is in progress for embed preview data, or false
2365   * otherwise.
2366   *
2367   * @param {Object} state Data state.
2368   * @param {string} url   URL the preview would be for.
2369   *
2370   * @return {boolean} Whether a request is in progress for an embed preview.
2371   */
2372  
2373  var isRequestingEmbedPreview = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
2374    return function (state, url) {
2375      return select('core/data').isResolving(REDUCER_KEY, 'getEmbedPreview', [url]);
2376    };
2377  });
2378  /**
2379   * Returns all available authors.
2380   *
2381   * @param {Object} state Data state.
2382   *
2383   * @return {Array} Authors list.
2384   */
2385  
2386  function getAuthors(state) {
2387    return getUserQueryResults(state, 'authors');
2388  }
2389  /**
2390   * Returns the current user.
2391   *
2392   * @param {Object} state Data state.
2393   *
2394   * @return {Object} Current user object.
2395   */
2396  
2397  function getCurrentUser(state) {
2398    return state.currentUser;
2399  }
2400  /**
2401   * Returns all the users returned by a query ID.
2402   *
2403   * @param {Object} state   Data state.
2404   * @param {string} queryID Query ID.
2405   *
2406   * @return {Array} Users list.
2407   */
2408  
2409  var getUserQueryResults = Object(rememo["a" /* default */])(function (state, queryID) {
2410    var queryResults = state.users.queries[queryID];
2411    return Object(external_lodash_["map"])(queryResults, function (id) {
2412      return state.users.byId[id];
2413    });
2414  }, function (state, queryID) {
2415    return [state.users.queries[queryID], state.users.byId];
2416  });
2417  /**
2418   * Returns whether the entities for the give kind are loaded.
2419   *
2420   * @param {Object} state   Data state.
2421   * @param {string} kind  Entity kind.
2422   *
2423   * @return {boolean} Whether the entities are loaded
2424   */
2425  
2426  function getEntitiesByKind(state, kind) {
2427    return Object(external_lodash_["filter"])(state.entities.config, {
2428      kind: kind
2429    });
2430  }
2431  /**
2432   * Returns the entity object given its kind and name.
2433   *
2434   * @param {Object} state   Data state.
2435   * @param {string} kind  Entity kind.
2436   * @param {string} name  Entity name.
2437   *
2438   * @return {Object} Entity
2439   */
2440  
2441  function getEntity(state, kind, name) {
2442    return Object(external_lodash_["find"])(state.entities.config, {
2443      kind: kind,
2444      name: name
2445    });
2446  }
2447  /**
2448   * Returns the Entity's record object by key.
2449   *
2450   * @param {Object} state  State tree
2451   * @param {string} kind   Entity kind.
2452   * @param {string} name   Entity name.
2453   * @param {number} key    Record's key
2454   *
2455   * @return {Object?} Record.
2456   */
2457  
2458  function getEntityRecord(state, kind, name, key) {
2459    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'queriedData', 'items', key]);
2460  }
2461  /**
2462   * Returns the entity's record object by key,
2463   * with its attributes mapped to their raw values.
2464   *
2465   * @param {Object} state  State tree.
2466   * @param {string} kind   Entity kind.
2467   * @param {string} name   Entity name.
2468   * @param {number} key    Record's key.
2469   *
2470   * @return {Object?} Object with the entity's raw attributes.
2471   */
2472  
2473  var getRawEntityRecord = Object(rememo["a" /* default */])(function (state, kind, name, key) {
2474    var record = getEntityRecord(state, kind, name, key);
2475    return record && Object.keys(record).reduce(function (acc, _key) {
2476      // Because edits are the "raw" attribute values,
2477      // we return those from record selectors to make rendering,
2478      // comparisons, and joins with edits easier.
2479      acc[_key] = Object(external_lodash_["get"])(record[_key], 'raw', record[_key]);
2480      return acc;
2481    }, {});
2482  }, function (state) {
2483    return [state.entities.data];
2484  });
2485  /**
2486   * Returns the Entity's records.
2487   *
2488   * @param {Object}  state  State tree
2489   * @param {string}  kind   Entity kind.
2490   * @param {string}  name   Entity name.
2491   * @param {?Object} query  Optional terms query.
2492   *
2493   * @return {Array} Records.
2494   */
2495  
2496  function getEntityRecords(state, kind, name, query) {
2497    var queriedState = Object(external_lodash_["get"])(state.entities.data, [kind, name, 'queriedData']);
2498  
2499    if (!queriedState) {
2500      return [];
2501    }
2502  
2503    return getQueriedItems(queriedState, query);
2504  }
2505  /**
2506   * Returns the specified entity record's edits.
2507   *
2508   * @param {Object} state    State tree.
2509   * @param {string} kind     Entity kind.
2510   * @param {string} name     Entity name.
2511   * @param {number} recordId Record ID.
2512   *
2513   * @return {Object?} The entity record's edits.
2514   */
2515  
2516  function getEntityRecordEdits(state, kind, name, recordId) {
2517    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'edits', recordId]);
2518  }
2519  /**
2520   * Returns the specified entity record's non transient edits.
2521   *
2522   * Transient edits don't create an undo level, and
2523   * are not considered for change detection.
2524   * They are defined in the entity's config.
2525   *
2526   * @param {Object} state    State tree.
2527   * @param {string} kind     Entity kind.
2528   * @param {string} name     Entity name.
2529   * @param {number} recordId Record ID.
2530   *
2531   * @return {Object?} The entity record's non transient edits.
2532   */
2533  
2534  var getEntityRecordNonTransientEdits = Object(rememo["a" /* default */])(function (state, kind, name, recordId) {
2535    var _getEntity = getEntity(state, kind, name),
2536        _getEntity$transientE = _getEntity.transientEdits,
2537        transientEdits = _getEntity$transientE === void 0 ? {} : _getEntity$transientE;
2538  
2539    var edits = getEntityRecordEdits(state, kind, name, recordId) || [];
2540    return Object.keys(edits).reduce(function (acc, key) {
2541      if (!transientEdits[key]) {
2542        acc[key] = edits[key];
2543      }
2544  
2545      return acc;
2546    }, {});
2547  }, function (state) {
2548    return [state.entities.config, state.entities.data];
2549  });
2550  /**
2551   * Returns true if the specified entity record has edits,
2552   * and false otherwise.
2553   *
2554   * @param {Object} state    State tree.
2555   * @param {string} kind     Entity kind.
2556   * @param {string} name     Entity name.
2557   * @param {number} recordId Record ID.
2558   *
2559   * @return {boolean} Whether the entity record has edits or not.
2560   */
2561  
2562  function hasEditsForEntityRecord(state, kind, name, recordId) {
2563    return isSavingEntityRecord(state, kind, name, recordId) || Object.keys(getEntityRecordNonTransientEdits(state, kind, name, recordId)).length > 0;
2564  }
2565  /**
2566   * Returns the specified entity record, merged with its edits.
2567   *
2568   * @param {Object} state    State tree.
2569   * @param {string} kind     Entity kind.
2570   * @param {string} name     Entity name.
2571   * @param {number} recordId Record ID.
2572   *
2573   * @return {Object?} The entity record, merged with its edits.
2574   */
2575  
2576  var getEditedEntityRecord = Object(rememo["a" /* default */])(function (state, kind, name, recordId) {
2577    return Object(objectSpread["a" /* default */])({}, getRawEntityRecord(state, kind, name, recordId), getEntityRecordEdits(state, kind, name, recordId));
2578  }, function (state) {
2579    return [state.entities.data];
2580  });
2581  /**
2582   * Returns true if the specified entity record is autosaving, and false otherwise.
2583   *
2584   * @param {Object} state    State tree.
2585   * @param {string} kind     Entity kind.
2586   * @param {string} name     Entity name.
2587   * @param {number} recordId Record ID.
2588   *
2589   * @return {boolean} Whether the entity record is autosaving or not.
2590   */
2591  
2592  function isAutosavingEntityRecord(state, kind, name, recordId) {
2593    var _get = Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId], {}),
2594        pending = _get.pending,
2595        isAutosave = _get.isAutosave;
2596  
2597    return Boolean(pending && isAutosave);
2598  }
2599  /**
2600   * Returns true if the specified entity record is saving, and false otherwise.
2601   *
2602   * @param {Object} state    State tree.
2603   * @param {string} kind     Entity kind.
2604   * @param {string} name     Entity name.
2605   * @param {number} recordId Record ID.
2606   *
2607   * @return {boolean} Whether the entity record is saving or not.
2608   */
2609  
2610  function isSavingEntityRecord(state, kind, name, recordId) {
2611    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId, 'pending'], false);
2612  }
2613  /**
2614   * Returns the specified entity record's last save error.
2615   *
2616   * @param {Object} state    State tree.
2617   * @param {string} kind     Entity kind.
2618   * @param {string} name     Entity name.
2619   * @param {number} recordId Record ID.
2620   *
2621   * @return {Object?} The entity record's save error.
2622   */
2623  
2624  function getLastEntitySaveError(state, kind, name, recordId) {
2625    return Object(external_lodash_["get"])(state.entities.data, [kind, name, 'saving', recordId, 'error']);
2626  }
2627  /**
2628   * Returns the current undo offset for the
2629   * entity records edits history. The offset
2630   * represents how many items from the end
2631   * of the history stack we are at. 0 is the
2632   * last edit, -1 is the second last, and so on.
2633   *
2634   * @param {Object} state State tree.
2635   *
2636   * @return {number} The current undo offset.
2637   */
2638  
2639  function getCurrentUndoOffset(state) {
2640    return state.undo.offset;
2641  }
2642  /**
2643   * Returns the previous edit from the current undo offset
2644   * for the entity records edits history, if any.
2645   *
2646   * @param {Object} state State tree.
2647   *
2648   * @return {Object?} The edit.
2649   */
2650  
2651  
2652  function getUndoEdit(state) {
2653    return state.undo[state.undo.length - 2 + getCurrentUndoOffset(state)];
2654  }
2655  /**
2656   * Returns the next edit from the current undo offset
2657   * for the entity records edits history, if any.
2658   *
2659   * @param {Object} state State tree.
2660   *
2661   * @return {Object?} The edit.
2662   */
2663  
2664  function getRedoEdit(state) {
2665    return state.undo[state.undo.length + getCurrentUndoOffset(state)];
2666  }
2667  /**
2668   * Returns true if there is a previous edit from the current undo offset
2669   * for the entity records edits history, and false otherwise.
2670   *
2671   * @param {Object} state State tree.
2672   *
2673   * @return {boolean} Whether there is a previous edit or not.
2674   */
2675  
2676  function hasUndo(state) {
2677    return Boolean(getUndoEdit(state));
2678  }
2679  /**
2680   * Returns true if there is a next edit from the current undo offset
2681   * for the entity records edits history, and false otherwise.
2682   *
2683   * @param {Object} state State tree.
2684   *
2685   * @return {boolean} Whether there is a next edit or not.
2686   */
2687  
2688  function hasRedo(state) {
2689    return Boolean(getRedoEdit(state));
2690  }
2691  /**
2692   * Return theme supports data in the index.
2693   *
2694   * @param {Object} state Data state.
2695   *
2696   * @return {*}           Index data.
2697   */
2698  
2699  function getThemeSupports(state) {
2700    return state.themeSupports;
2701  }
2702  /**
2703   * Returns the embed preview for the given URL.
2704   *
2705   * @param {Object} state    Data state.
2706   * @param {string} url      Embedded URL.
2707   *
2708   * @return {*} Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.
2709   */
2710  
2711  function getEmbedPreview(state, url) {
2712    return state.embedPreviews[url];
2713  }
2714  /**
2715   * Determines if the returned preview is an oEmbed link fallback.
2716   *
2717   * WordPress can be configured to return a simple link to a URL if it is not embeddable.
2718   * We need to be able to determine if a URL is embeddable or not, based on what we
2719   * get back from the oEmbed preview API.
2720   *
2721   * @param {Object} state    Data state.
2722   * @param {string} url      Embedded URL.
2723   *
2724   * @return {boolean} Is the preview for the URL an oEmbed link fallback.
2725   */
2726  
2727  function isPreviewEmbedFallback(state, url) {
2728    var preview = state.embedPreviews[url];
2729    var oEmbedLinkCheck = '<a href="' + url + '">' + url + '</a>';
2730  
2731    if (!preview) {
2732      return false;
2733    }
2734  
2735    return preview.html === oEmbedLinkCheck;
2736  }
2737  /**
2738   * Returns whether the current user can upload media.
2739   *
2740   * Calling this may trigger an OPTIONS request to the REST API via the
2741   * `canUser()` resolver.
2742   *
2743   * https://developer.wordpress.org/rest-api/reference/
2744   *
2745   * @deprecated since 5.0. Callers should use the more generic `canUser()` selector instead of
2746   *             `hasUploadPermissions()`, e.g. `canUser( 'create', 'media' )`.
2747   *
2748   * @param {Object} state Data state.
2749   *
2750   * @return {boolean} Whether or not the user can upload media. Defaults to `true` if the OPTIONS
2751   *                   request is being made.
2752   */
2753  
2754  function hasUploadPermissions(state) {
2755    external_this_wp_deprecated_default()("select( 'core' ).hasUploadPermissions()", {
2756      alternative: "select( 'core' ).canUser( 'create', 'media' )"
2757    });
2758    return Object(external_lodash_["defaultTo"])(canUser(state, 'create', 'media'), true);
2759  }
2760  /**
2761   * Returns whether the current user can perform the given action on the given
2762   * REST resource.
2763   *
2764   * Calling this may trigger an OPTIONS request to the REST API via the
2765   * `canUser()` resolver.
2766   *
2767   * https://developer.wordpress.org/rest-api/reference/
2768   *
2769   * @param {Object}   state            Data state.
2770   * @param {string}   action           Action to check. One of: 'create', 'read', 'update', 'delete'.
2771   * @param {string}   resource         REST resource to check, e.g. 'media' or 'posts'.
2772   * @param {string=}  id               Optional ID of the rest resource to check.
2773   *
2774   * @return {boolean|undefined} Whether or not the user can perform the action,
2775   *                             or `undefined` if the OPTIONS request is still being made.
2776   */
2777  
2778  function canUser(state, action, resource, id) {
2779    var key = Object(external_lodash_["compact"])([action, resource, id]).join('/');
2780    return Object(external_lodash_["get"])(state, ['userPermissions', key]);
2781  }
2782  /**
2783   * Returns the latest autosaves for the post.
2784   *
2785   * May return multiple autosaves since the backend stores one autosave per
2786   * author for each post.
2787   *
2788   * @param {Object} state    State tree.
2789   * @param {string} postType The type of the parent post.
2790   * @param {number} postId   The id of the parent post.
2791   *
2792   * @return {?Array} An array of autosaves for the post, or undefined if there is none.
2793   */
2794  
2795  function getAutosaves(state, postType, postId) {
2796    return state.autosaves[postId];
2797  }
2798  /**
2799   * Returns the autosave for the post and author.
2800   *
2801   * @param {Object} state    State tree.
2802   * @param {string} postType The type of the parent post.
2803   * @param {number} postId   The id of the parent post.
2804   * @param {number} authorId The id of the author.
2805   *
2806   * @return {?Object} The autosave for the post and author.
2807   */
2808  
2809  function getAutosave(state, postType, postId, authorId) {
2810    if (authorId === undefined) {
2811      return;
2812    }
2813  
2814    var autosaves = state.autosaves[postId];
2815    return Object(external_lodash_["find"])(autosaves, {
2816      author: authorId
2817    });
2818  }
2819  /**
2820   * Returns true if the REST request for autosaves has completed.
2821   *
2822   * @param {Object} state State tree.
2823   * @param {string} postType The type of the parent post.
2824   * @param {number} postId   The id of the parent post.
2825   *
2826   * @return {boolean} True if the REST request was completed. False otherwise.
2827   */
2828  
2829  var hasFetchedAutosaves = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
2830    return function (state, postType, postId) {
2831      return select(REDUCER_KEY).hasFinishedResolution('getAutosaves', [postType, postId]);
2832    };
2833  });
2834  /**
2835   * Returns a new reference when edited values have changed. This is useful in
2836   * inferring where an edit has been made between states by comparison of the
2837   * return values using strict equality.
2838   *
2839   * @example
2840   *
2841   * ```
2842   * const hasEditOccurred = (
2843   *    getReferenceByDistinctEdits( beforeState ) !==
2844   *    getReferenceByDistinctEdits( afterState )
2845   * );
2846   * ```
2847   *
2848   * @param {Object} state Editor state.
2849   *
2850   * @return {*} A value whose reference will change only when an edit occurs.
2851   */
2852  
2853  var getReferenceByDistinctEdits = Object(rememo["a" /* default */])(function () {
2854    return [];
2855  }, function (state) {
2856    return [state.undo.length, state.undo.offset];
2857  });
2858  
2859  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/resolvers.js
2860  
2861  
2862  
2863  var resolvers_marked =
2864  /*#__PURE__*/
2865  regenerator_default.a.mark(resolvers_getAuthors),
2866      resolvers_marked2 =
2867  /*#__PURE__*/
2868  regenerator_default.a.mark(resolvers_getCurrentUser),
2869      resolvers_marked3 =
2870  /*#__PURE__*/
2871  regenerator_default.a.mark(resolvers_getEntityRecord),
2872      resolvers_marked4 =
2873  /*#__PURE__*/
2874  regenerator_default.a.mark(resolvers_getEntityRecords),
2875      resolvers_marked5 =
2876  /*#__PURE__*/
2877  regenerator_default.a.mark(resolvers_getThemeSupports),
2878      _marked6 =
2879  /*#__PURE__*/
2880  regenerator_default.a.mark(resolvers_getEmbedPreview),
2881      _marked7 =
2882  /*#__PURE__*/
2883  regenerator_default.a.mark(resolvers_hasUploadPermissions),
2884      _marked8 =
2885  /*#__PURE__*/
2886  regenerator_default.a.mark(resolvers_canUser),
2887      _marked9 =
2888  /*#__PURE__*/
2889  regenerator_default.a.mark(resolvers_getAutosaves),
2890      _marked10 =
2891  /*#__PURE__*/
2892  regenerator_default.a.mark(resolvers_getAutosave);
2893  
2894  /**
2895   * External dependencies
2896   */
2897  
2898  /**
2899   * WordPress dependencies
2900   */
2901  
2902  
2903  
2904  /**
2905   * Internal dependencies
2906   */
2907  
2908  
2909  
2910  
2911  /**
2912   * Requests authors from the REST API.
2913   */
2914  
2915  function resolvers_getAuthors() {
2916    var users;
2917    return regenerator_default.a.wrap(function getAuthors$(_context) {
2918      while (1) {
2919        switch (_context.prev = _context.next) {
2920          case 0:
2921            _context.next = 2;
2922            return apiFetch({
2923              path: '/wp/v2/users/?who=authors&per_page=-1'
2924            });
2925  
2926          case 2:
2927            users = _context.sent;
2928            _context.next = 5;
2929            return receiveUserQuery('authors', users);
2930  
2931          case 5:
2932          case "end":
2933            return _context.stop();
2934        }
2935      }
2936    }, resolvers_marked);
2937  }
2938  /**
2939   * Requests the current user from the REST API.
2940   */
2941  
2942  function resolvers_getCurrentUser() {
2943    var currentUser;
2944    return regenerator_default.a.wrap(function getCurrentUser$(_context2) {
2945      while (1) {
2946        switch (_context2.prev = _context2.next) {
2947          case 0:
2948            _context2.next = 2;
2949            return apiFetch({
2950              path: '/wp/v2/users/me'
2951            });
2952  
2953          case 2:
2954            currentUser = _context2.sent;
2955            _context2.next = 5;
2956            return receiveCurrentUser(currentUser);
2957  
2958          case 5:
2959          case "end":
2960            return _context2.stop();
2961        }
2962      }
2963    }, resolvers_marked2);
2964  }
2965  /**
2966   * Requests an entity's record from the REST API.
2967   *
2968   * @param {string} kind   Entity kind.
2969   * @param {string} name   Entity name.
2970   * @param {number} key    Record's key
2971   */
2972  
2973  function resolvers_getEntityRecord(kind, name, key) {
2974    var entities, entity, record;
2975    return regenerator_default.a.wrap(function getEntityRecord$(_context3) {
2976      while (1) {
2977        switch (_context3.prev = _context3.next) {
2978          case 0:
2979            _context3.next = 2;
2980            return getKindEntities(kind);
2981  
2982          case 2:
2983            entities = _context3.sent;
2984            entity = Object(external_lodash_["find"])(entities, {
2985              kind: kind,
2986              name: name
2987            });
2988  
2989            if (entity) {
2990              _context3.next = 6;
2991              break;
2992            }
2993  
2994            return _context3.abrupt("return");
2995  
2996          case 6:
2997            _context3.next = 8;
2998            return apiFetch({
2999              path: "".concat(entity.baseURL, "/").concat(key, "?context=edit")
3000            });
3001  
3002          case 8:
3003            record = _context3.sent;
3004            _context3.next = 11;
3005            return receiveEntityRecords(kind, name, record);
3006  
3007          case 11:
3008          case "end":
3009            return _context3.stop();
3010        }
3011      }
3012    }, resolvers_marked3);
3013  }
3014  /**
3015   * Requests the entity's records from the REST API.
3016   *
3017   * @param {string}  kind   Entity kind.
3018   * @param {string}  name   Entity name.
3019   * @param {Object?} query  Query Object.
3020   */
3021  
3022  function resolvers_getEntityRecords(kind, name) {
3023    var query,
3024        entities,
3025        entity,
3026        path,
3027        records,
3028        _args4 = arguments;
3029    return regenerator_default.a.wrap(function getEntityRecords$(_context4) {
3030      while (1) {
3031        switch (_context4.prev = _context4.next) {
3032          case 0:
3033            query = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
3034            _context4.next = 3;
3035            return getKindEntities(kind);
3036  
3037          case 3:
3038            entities = _context4.sent;
3039            entity = Object(external_lodash_["find"])(entities, {
3040              kind: kind,
3041              name: name
3042            });
3043  
3044            if (entity) {
3045              _context4.next = 7;
3046              break;
3047            }
3048  
3049            return _context4.abrupt("return");
3050  
3051          case 7:
3052            path = Object(external_this_wp_url_["addQueryArgs"])(entity.baseURL, Object(objectSpread["a" /* default */])({}, query, {
3053              context: 'edit'
3054            }));
3055            _context4.next = 10;
3056            return apiFetch({
3057              path: path
3058            });
3059  
3060          case 10:
3061            records = _context4.sent;
3062            _context4.next = 13;
3063            return receiveEntityRecords(kind, name, Object.values(records), query);
3064  
3065          case 13:
3066          case "end":
3067            return _context4.stop();
3068        }
3069      }
3070    }, resolvers_marked4);
3071  }
3072  
3073  resolvers_getEntityRecords.shouldInvalidate = function (action, kind, name) {
3074    return action.type === 'RECEIVE_ITEMS' && action.invalidateCache && kind === action.kind && name === action.name;
3075  };
3076  /**
3077   * Requests theme supports data from the index.
3078   */
3079  
3080  
3081  function resolvers_getThemeSupports() {
3082    var activeThemes;
3083    return regenerator_default.a.wrap(function getThemeSupports$(_context5) {
3084      while (1) {
3085        switch (_context5.prev = _context5.next) {
3086          case 0:
3087            _context5.next = 2;
3088            return apiFetch({
3089              path: '/wp/v2/themes?status=active'
3090            });
3091  
3092          case 2:
3093            activeThemes = _context5.sent;
3094            _context5.next = 5;
3095            return receiveThemeSupports(activeThemes[0].theme_supports);
3096  
3097          case 5:
3098          case "end":
3099            return _context5.stop();
3100        }
3101      }
3102    }, resolvers_marked5);
3103  }
3104  /**
3105   * Requests a preview from the from the Embed API.
3106   *
3107   * @param {string} url   URL to get the preview for.
3108   */
3109  
3110  function resolvers_getEmbedPreview(url) {
3111    var embedProxyResponse;
3112    return regenerator_default.a.wrap(function getEmbedPreview$(_context6) {
3113      while (1) {
3114        switch (_context6.prev = _context6.next) {
3115          case 0:
3116            _context6.prev = 0;
3117            _context6.next = 3;
3118            return apiFetch({
3119              path: Object(external_this_wp_url_["addQueryArgs"])('/oembed/1.0/proxy', {
3120                url: url
3121              })
3122            });
3123  
3124          case 3:
3125            embedProxyResponse = _context6.sent;
3126            _context6.next = 6;
3127            return receiveEmbedPreview(url, embedProxyResponse);
3128  
3129          case 6:
3130            _context6.next = 12;
3131            break;
3132  
3133          case 8:
3134            _context6.prev = 8;
3135            _context6.t0 = _context6["catch"](0);
3136            _context6.next = 12;
3137            return receiveEmbedPreview(url, false);
3138  
3139          case 12:
3140          case "end":
3141            return _context6.stop();
3142        }
3143      }
3144    }, _marked6, null, [[0, 8]]);
3145  }
3146  /**
3147   * Requests Upload Permissions from the REST API.
3148   *
3149   * @deprecated since 5.0. Callers should use the more generic `canUser()` selector instead of
3150   *            `hasUploadPermissions()`, e.g. `canUser( 'create', 'media' )`.
3151   */
3152  
3153  function resolvers_hasUploadPermissions() {
3154    return regenerator_default.a.wrap(function hasUploadPermissions$(_context7) {
3155      while (1) {
3156        switch (_context7.prev = _context7.next) {
3157          case 0:
3158            external_this_wp_deprecated_default()("select( 'core' ).hasUploadPermissions()", {
3159              alternative: "select( 'core' ).canUser( 'create', 'media' )"
3160            });
3161            return _context7.delegateYield(resolvers_canUser('create', 'media'), "t0", 2);
3162  
3163          case 2:
3164          case "end":
3165            return _context7.stop();
3166        }
3167      }
3168    }, _marked7);
3169  }
3170  /**
3171   * Checks whether the current user can perform the given action on the given
3172   * REST resource.
3173   *
3174   * @param {string}  action   Action to check. One of: 'create', 'read', 'update',
3175   *                           'delete'.
3176   * @param {string}  resource REST resource to check, e.g. 'media' or 'posts'.
3177   * @param {?string} id       ID of the rest resource to check.
3178   */
3179  
3180  function resolvers_canUser(action, resource, id) {
3181    var methods, method, path, response, allowHeader, key, isAllowed;
3182    return regenerator_default.a.wrap(function canUser$(_context8) {
3183      while (1) {
3184        switch (_context8.prev = _context8.next) {
3185          case 0:
3186            methods = {
3187              create: 'POST',
3188              read: 'GET',
3189              update: 'PUT',
3190              delete: 'DELETE'
3191            };
3192            method = methods[action];
3193  
3194            if (method) {
3195              _context8.next = 4;
3196              break;
3197            }
3198  
3199            throw new Error("'".concat(action, "' is not a valid action."));
3200  
3201          case 4:
3202            path = id ? "/wp/v2/".concat(resource, "/").concat(id) : "/wp/v2/".concat(resource);
3203            _context8.prev = 5;
3204            _context8.next = 8;
3205            return apiFetch({
3206              path: path,
3207              // Ideally this would always be an OPTIONS request, but unfortunately there's
3208              // a bug in the REST API which causes the Allow header to not be sent on
3209              // OPTIONS requests to /posts/:id routes.
3210              // https://core.trac.wordpress.org/ticket/45753
3211              method: id ? 'GET' : 'OPTIONS',
3212              parse: false
3213            });
3214  
3215          case 8:
3216            response = _context8.sent;
3217            _context8.next = 14;
3218            break;
3219  
3220          case 11:
3221            _context8.prev = 11;
3222            _context8.t0 = _context8["catch"](5);
3223            return _context8.abrupt("return");
3224  
3225          case 14:
3226            if (Object(external_lodash_["hasIn"])(response, ['headers', 'get'])) {
3227              // If the request is fetched using the fetch api, the header can be
3228              // retrieved using the 'get' method.
3229              allowHeader = response.headers.get('allow');
3230            } else {
3231              // If the request was preloaded server-side and is returned by the
3232              // preloading middleware, the header will be a simple property.
3233              allowHeader = Object(external_lodash_["get"])(response, ['headers', 'Allow'], '');
3234            }
3235  
3236            key = Object(external_lodash_["compact"])([action, resource, id]).join('/');
3237            isAllowed = Object(external_lodash_["includes"])(allowHeader, method);
3238            _context8.next = 19;
3239            return receiveUserPermission(key, isAllowed);
3240  
3241          case 19:
3242          case "end":
3243            return _context8.stop();
3244        }
3245      }
3246    }, _marked8, null, [[5, 11]]);
3247  }
3248  /**
3249   * Request autosave data from the REST API.
3250   *
3251   * @param {string} postType The type of the parent post.
3252   * @param {number} postId   The id of the parent post.
3253   */
3254  
3255  function resolvers_getAutosaves(postType, postId) {
3256    var _ref, restBase, autosaves;
3257  
3258    return regenerator_default.a.wrap(function getAutosaves$(_context9) {
3259      while (1) {
3260        switch (_context9.prev = _context9.next) {
3261          case 0:
3262            _context9.next = 2;
3263            return resolveSelect('getPostType', postType);
3264  
3265          case 2:
3266            _ref = _context9.sent;
3267            restBase = _ref.rest_base;
3268            _context9.next = 6;
3269            return apiFetch({
3270              path: "/wp/v2/".concat(restBase, "/").concat(postId, "/autosaves?context=edit")
3271            });
3272  
3273          case 6:
3274            autosaves = _context9.sent;
3275  
3276            if (!(autosaves && autosaves.length)) {
3277              _context9.next = 10;
3278              break;
3279            }
3280  
3281            _context9.next = 10;
3282            return receiveAutosaves(postId, autosaves);
3283  
3284          case 10:
3285          case "end":
3286            return _context9.stop();
3287        }
3288      }
3289    }, _marked9);
3290  }
3291  /**
3292   * Request autosave data from the REST API.
3293   *
3294   * This resolver exists to ensure the underlying autosaves are fetched via
3295   * `getAutosaves` when a call to the `getAutosave` selector is made.
3296   *
3297   * @param {string} postType The type of the parent post.
3298   * @param {number} postId   The id of the parent post.
3299   */
3300  
3301  function resolvers_getAutosave(postType, postId) {
3302    return regenerator_default.a.wrap(function getAutosave$(_context10) {
3303      while (1) {
3304        switch (_context10.prev = _context10.next) {
3305          case 0:
3306            _context10.next = 2;
3307            return resolveSelect('getAutosaves', postType, postId);
3308  
3309          case 2:
3310          case "end":
3311            return _context10.stop();
3312        }
3313      }
3314    }, _marked10);
3315  }
3316  
3317  // CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/index.js
3318  
3319  
3320  /**
3321   * WordPress dependencies
3322   */
3323  
3324  /**
3325   * Internal dependencies
3326   */
3327  
3328  
3329  
3330  
3331  
3332  
3333  
3334   // The entity selectors/resolvers and actions are shortcuts to their generic equivalents
3335  // (getEntityRecord, getEntityRecords, updateEntityRecord, updateEntityRecordss)
3336  // Instead of getEntityRecord, the consumer could use more user-frieldly named selector: getPostType, getTaxonomy...
3337  // The "kind" and the "name" of the entity are combined to generate these shortcuts.
3338  
3339  var entitySelectors = defaultEntities.reduce(function (result, entity) {
3340    var kind = entity.kind,
3341        name = entity.name;
3342  
3343    result[entities_getMethodName(kind, name)] = function (state, key) {
3344      return getEntityRecord(state, kind, name, key);
3345    };
3346  
3347    result[entities_getMethodName(kind, name, 'get', true)] = function (state) {
3348      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3349        args[_key - 1] = arguments[_key];
3350      }
3351  
3352      return getEntityRecords.apply(build_module_selectors_namespaceObject, [state, kind, name].concat(args));
3353    };
3354  
3355    return result;
3356  }, {});
3357  var entityResolvers = defaultEntities.reduce(function (result, entity) {
3358    var kind = entity.kind,
3359        name = entity.name;
3360  
3361    result[entities_getMethodName(kind, name)] = function (key) {
3362      return resolvers_getEntityRecord(kind, name, key);
3363    };
3364  
3365    var pluralMethodName = entities_getMethodName(kind, name, 'get', true);
3366  
3367    result[pluralMethodName] = function () {
3368      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3369        args[_key2] = arguments[_key2];
3370      }
3371  
3372      return resolvers_getEntityRecords.apply(resolvers_namespaceObject, [kind, name].concat(args));
3373    };
3374  
3375    result[pluralMethodName].shouldInvalidate = function (action) {
3376      var _resolvers$getEntityR;
3377  
3378      for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
3379        args[_key3 - 1] = arguments[_key3];
3380      }
3381  
3382      return (_resolvers$getEntityR = resolvers_getEntityRecords).shouldInvalidate.apply(_resolvers$getEntityR, [action, kind, name].concat(args));
3383    };
3384  
3385    return result;
3386  }, {});
3387  var entityActions = defaultEntities.reduce(function (result, entity) {
3388    var kind = entity.kind,
3389        name = entity.name;
3390  
3391    result[entities_getMethodName(kind, name, 'save')] = function (key) {
3392      return saveEntityRecord(kind, name, key);
3393    };
3394  
3395    return result;
3396  }, {});
3397  Object(external_this_wp_data_["registerStore"])(REDUCER_KEY, {
3398    reducer: build_module_reducer,
3399    controls: build_module_controls,
3400    actions: Object(objectSpread["a" /* default */])({}, build_module_actions_namespaceObject, entityActions),
3401    selectors: Object(objectSpread["a" /* default */])({}, build_module_selectors_namespaceObject, entitySelectors),
3402    resolvers: Object(objectSpread["a" /* default */])({}, resolvers_namespaceObject, entityResolvers)
3403  });
3404  
3405  
3406  /***/ }),
3407  
3408  /***/ 36:
3409  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3410  
3411  "use strict";
3412  
3413  
3414  var LEAF_KEY, hasWeakMap;
3415  
3416  /**
3417   * Arbitrary value used as key for referencing cache object in WeakMap tree.
3418   *
3419   * @type {Object}
3420   */
3421  LEAF_KEY = {};
3422  
3423  /**
3424   * Whether environment supports WeakMap.
3425   *
3426   * @type {boolean}
3427   */
3428  hasWeakMap = typeof WeakMap !== 'undefined';
3429  
3430  /**
3431   * Returns the first argument as the sole entry in an array.
3432   *
3433   * @param {*} value Value to return.
3434   *
3435   * @return {Array} Value returned as entry in array.
3436   */
3437  function arrayOf( value ) {
3438      return [ value ];
3439  }
3440  
3441  /**
3442   * Returns true if the value passed is object-like, or false otherwise. A value
3443   * is object-like if it can support property assignment, e.g. object or array.
3444   *
3445   * @param {*} value Value to test.
3446   *
3447   * @return {boolean} Whether value is object-like.
3448   */
3449  function isObjectLike( value ) {
3450      return !! value && 'object' === typeof value;
3451  }
3452  
3453  /**
3454   * Creates and returns a new cache object.
3455   *
3456   * @return {Object} Cache object.
3457   */
3458  function createCache() {
3459      var cache = {
3460          clear: function() {
3461              cache.head = null;
3462          },
3463      };
3464  
3465      return cache;
3466  }
3467  
3468  /**
3469   * Returns true if entries within the two arrays are strictly equal by
3470   * reference from a starting index.
3471   *
3472   * @param {Array}  a         First array.
3473   * @param {Array}  b         Second array.
3474   * @param {number} fromIndex Index from which to start comparison.
3475   *
3476   * @return {boolean} Whether arrays are shallowly equal.
3477   */
3478  function isShallowEqual( a, b, fromIndex ) {
3479      var i;
3480  
3481      if ( a.length !== b.length ) {
3482          return false;
3483      }
3484  
3485      for ( i = fromIndex; i < a.length; i++ ) {
3486          if ( a[ i ] !== b[ i ] ) {
3487              return false;
3488          }
3489      }
3490  
3491      return true;
3492  }
3493  
3494  /**
3495   * Returns a memoized selector function. The getDependants function argument is
3496   * called before the memoized selector and is expected to return an immutable
3497   * reference or array of references on which the selector depends for computing
3498   * its own return value. The memoize cache is preserved only as long as those
3499   * dependant references remain the same. If getDependants returns a different
3500   * reference(s), the cache is cleared and the selector value regenerated.
3501   *
3502   * @param {Function} selector      Selector function.
3503   * @param {Function} getDependants Dependant getter returning an immutable
3504   *                                 reference or array of reference used in
3505   *                                 cache bust consideration.
3506   *
3507   * @return {Function} Memoized selector.
3508   */
3509  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
3510      var rootCache, getCache;
3511  
3512      // Use object source as dependant if getter not provided
3513      if ( ! getDependants ) {
3514          getDependants = arrayOf;
3515      }
3516  
3517      /**
3518       * Returns the root cache. If WeakMap is supported, this is assigned to the
3519       * root WeakMap cache set, otherwise it is a shared instance of the default
3520       * cache object.
3521       *
3522       * @return {(WeakMap|Object)} Root cache object.
3523       */
3524  	function getRootCache() {
3525          return rootCache;
3526      }
3527  
3528      /**
3529       * Returns the cache for a given dependants array. When possible, a WeakMap
3530       * will be used to create a unique cache for each set of dependants. This
3531       * is feasible due to the nature of WeakMap in allowing garbage collection
3532       * to occur on entries where the key object is no longer referenced. Since
3533       * WeakMap requires the key to be an object, this is only possible when the
3534       * dependant is object-like. The root cache is created as a hierarchy where
3535       * each top-level key is the first entry in a dependants set, the value a
3536       * WeakMap where each key is the next dependant, and so on. This continues
3537       * so long as the dependants are object-like. If no dependants are object-
3538       * like, then the cache is shared across all invocations.
3539       *
3540       * @see isObjectLike
3541       *
3542       * @param {Array} dependants Selector dependants.
3543       *
3544       * @return {Object} Cache object.
3545       */
3546  	function getWeakMapCache( dependants ) {
3547          var caches = rootCache,
3548              isUniqueByDependants = true,
3549              i, dependant, map, cache;
3550  
3551          for ( i = 0; i < dependants.length; i++ ) {
3552              dependant = dependants[ i ];
3553  
3554              // Can only compose WeakMap from object-like key.
3555              if ( ! isObjectLike( dependant ) ) {
3556                  isUniqueByDependants = false;
3557                  break;
3558              }
3559  
3560              // Does current segment of cache already have a WeakMap?
3561              if ( caches.has( dependant ) ) {
3562                  // Traverse into nested WeakMap.
3563                  caches = caches.get( dependant );
3564              } else {
3565                  // Create, set, and traverse into a new one.
3566                  map = new WeakMap();
3567                  caches.set( dependant, map );
3568                  caches = map;
3569              }
3570          }
3571  
3572          // We use an arbitrary (but consistent) object as key for the last item
3573          // in the WeakMap to serve as our running cache.
3574          if ( ! caches.has( LEAF_KEY ) ) {
3575              cache = createCache();
3576              cache.isUniqueByDependants = isUniqueByDependants;
3577              caches.set( LEAF_KEY, cache );
3578          }
3579  
3580          return caches.get( LEAF_KEY );
3581      }
3582  
3583      // Assign cache handler by availability of WeakMap
3584      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
3585  
3586      /**
3587       * Resets root memoization cache.
3588       */
3589  	function clear() {
3590          rootCache = hasWeakMap ? new WeakMap() : createCache();
3591      }
3592  
3593      // eslint-disable-next-line jsdoc/check-param-names
3594      /**
3595       * The augmented selector call, considering first whether dependants have
3596       * changed before passing it to underlying memoize function.
3597       *
3598       * @param {Object} source    Source object for derivation.
3599       * @param {...*}   extraArgs Additional arguments to pass to selector.
3600       *
3601       * @return {*} Selector result.
3602       */
3603  	function callSelector( /* source, ...extraArgs */ ) {
3604          var len = arguments.length,
3605              cache, node, i, args, dependants;
3606  
3607          // Create copy of arguments (avoid leaking deoptimization).
3608          args = new Array( len );
3609          for ( i = 0; i < len; i++ ) {
3610              args[ i ] = arguments[ i ];
3611          }
3612  
3613          dependants = getDependants.apply( null, args );
3614          cache = getCache( dependants );
3615  
3616          // If not guaranteed uniqueness by dependants (primitive type or lack
3617          // of WeakMap support), shallow compare against last dependants and, if
3618          // references have changed, destroy cache to recalculate result.
3619          if ( ! cache.isUniqueByDependants ) {
3620              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
3621                  cache.clear();
3622              }
3623  
3624              cache.lastDependants = dependants;
3625          }
3626  
3627          node = cache.head;
3628          while ( node ) {
3629              // Check whether node arguments match arguments
3630              if ( ! isShallowEqual( node.args, args, 1 ) ) {
3631                  node = node.next;
3632                  continue;
3633              }
3634  
3635              // At this point we can assume we've found a match
3636  
3637              // Surface matched node to head if not already
3638              if ( node !== cache.head ) {
3639                  // Adjust siblings to point to each other.
3640                  node.prev.next = node.next;
3641                  if ( node.next ) {
3642                      node.next.prev = node.prev;
3643                  }
3644  
3645                  node.next = cache.head;
3646                  node.prev = null;
3647                  cache.head.prev = node;
3648                  cache.head = node;
3649              }
3650  
3651              // Return immediately
3652              return node.val;
3653          }
3654  
3655          // No cached value found. Continue to insertion phase:
3656  
3657          node = {
3658              // Generate the result from original function
3659              val: selector.apply( null, args ),
3660          };
3661  
3662          // Avoid including the source object in the cache.
3663          args[ 0 ] = null;
3664          node.args = args;
3665  
3666          // Don't need to check whether node is already head, since it would
3667          // have been returned above already if it was
3668  
3669          // Shift existing head down list
3670          if ( cache.head ) {
3671              cache.head.prev = node;
3672              node.next = cache.head;
3673          }
3674  
3675          cache.head = node;
3676  
3677          return node.val;
3678      }
3679  
3680      callSelector.getDependants = getDependants;
3681      callSelector.clear = clear;
3682      clear();
3683  
3684      return callSelector;
3685  });
3686  
3687  
3688  /***/ }),
3689  
3690  /***/ 37:
3691  /***/ (function(module, exports) {
3692  
3693  (function() { module.exports = this["wp"]["deprecated"]; }());
3694  
3695  /***/ }),
3696  
3697  /***/ 38:
3698  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3699  
3700  "use strict";
3701  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
3702  function _arrayWithHoles(arr) {
3703    if (Array.isArray(arr)) return arr;
3704  }
3705  
3706  /***/ }),
3707  
3708  /***/ 39:
3709  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3710  
3711  "use strict";
3712  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
3713  function _nonIterableRest() {
3714    throw new TypeError("Invalid attempt to destructure non-iterable instance");
3715  }
3716  
3717  /***/ }),
3718  
3719  /***/ 4:
3720  /***/ (function(module, exports) {
3721  
3722  (function() { module.exports = this["wp"]["data"]; }());
3723  
3724  /***/ }),
3725  
3726  /***/ 41:
3727  /***/ (function(module, exports) {
3728  
3729  (function() { module.exports = this["wp"]["isShallowEqual"]; }());
3730  
3731  /***/ }),
3732  
3733  /***/ 47:
3734  /***/ (function(module, exports, __webpack_require__) {
3735  
3736  /**
3737   * Copyright (c) 2014-present, Facebook, Inc.
3738   *
3739   * This source code is licensed under the MIT license found in the
3740   * LICENSE file in the root directory of this source tree.
3741   */
3742  
3743  var runtime = (function (exports) {
3744    "use strict";
3745  
3746    var Op = Object.prototype;
3747    var hasOwn = Op.hasOwnProperty;
3748    var undefined; // More compressible than void 0.
3749    var $Symbol = typeof Symbol === "function" ? Symbol : {};
3750    var iteratorSymbol = $Symbol.iterator || "@@iterator";
3751    var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
3752    var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
3753  
3754    function wrap(innerFn, outerFn, self, tryLocsList) {
3755      // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
3756      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
3757      var generator = Object.create(protoGenerator.prototype);
3758      var context = new Context(tryLocsList || []);
3759  
3760      // The ._invoke method unifies the implementations of the .next,
3761      // .throw, and .return methods.
3762      generator._invoke = makeInvokeMethod(innerFn, self, context);
3763  
3764      return generator;
3765    }
3766    exports.wrap = wrap;
3767  
3768    // Try/catch helper to minimize deoptimizations. Returns a completion
3769    // record like context.tryEntries[i].completion. This interface could
3770    // have been (and was previously) designed to take a closure to be
3771    // invoked without arguments, but in all the cases we care about we
3772    // already have an existing method we want to call, so there's no need
3773    // to create a new function object. We can even get away with assuming
3774    // the method takes exactly one argument, since that happens to be true
3775    // in every case, so we don't have to touch the arguments object. The
3776    // only additional allocation required is the completion record, which
3777    // has a stable shape and so hopefully should be cheap to allocate.
3778    function tryCatch(fn, obj, arg) {
3779      try {
3780        return { type: "normal", arg: fn.call(obj, arg) };
3781      } catch (err) {
3782        return { type: "throw", arg: err };
3783      }
3784    }
3785  
3786    var GenStateSuspendedStart = "suspendedStart";
3787    var GenStateSuspendedYield = "suspendedYield";
3788    var GenStateExecuting = "executing";
3789    var GenStateCompleted = "completed";
3790  
3791    // Returning this object from the innerFn has the same effect as
3792    // breaking out of the dispatch switch statement.
3793    var ContinueSentinel = {};
3794  
3795    // Dummy constructor functions that we use as the .constructor and
3796    // .constructor.prototype properties for functions that return Generator
3797    // objects. For full spec compliance, you may wish to configure your
3798    // minifier not to mangle the names of these two functions.
3799    function Generator() {}
3800    function GeneratorFunction() {}
3801    function GeneratorFunctionPrototype() {}
3802  
3803    // This is a polyfill for %IteratorPrototype% for environments that
3804    // don't natively support it.
3805    var IteratorPrototype = {};
3806    IteratorPrototype[iteratorSymbol] = function () {
3807      return this;
3808    };
3809  
3810    var getProto = Object.getPrototypeOf;
3811    var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
3812    if (NativeIteratorPrototype &&
3813        NativeIteratorPrototype !== Op &&
3814        hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
3815      // This environment has a native %IteratorPrototype%; use it instead
3816      // of the polyfill.
3817      IteratorPrototype = NativeIteratorPrototype;
3818    }
3819  
3820    var Gp = GeneratorFunctionPrototype.prototype =
3821      Generator.prototype = Object.create(IteratorPrototype);
3822    GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
3823    GeneratorFunctionPrototype.constructor = GeneratorFunction;
3824    GeneratorFunctionPrototype[toStringTagSymbol] =
3825      GeneratorFunction.displayName = "GeneratorFunction";
3826  
3827    // Helper for defining the .next, .throw, and .return methods of the
3828    // Iterator interface in terms of a single ._invoke method.
3829    function defineIteratorMethods(prototype) {
3830      ["next", "throw", "return"].forEach(function(method) {
3831        prototype[method] = function(arg) {
3832          return this._invoke(method, arg);
3833        };
3834      });
3835    }
3836  
3837    exports.isGeneratorFunction = function(genFun) {
3838      var ctor = typeof genFun === "function" && genFun.constructor;
3839      return ctor
3840        ? ctor === GeneratorFunction ||
3841          // For the native GeneratorFunction constructor, the best we can
3842          // do is to check its .name property.
3843          (ctor.displayName || ctor.name) === "GeneratorFunction"
3844        : false;
3845    };
3846  
3847    exports.mark = function(genFun) {
3848      if (Object.setPrototypeOf) {
3849        Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
3850      } else {
3851        genFun.__proto__ = GeneratorFunctionPrototype;
3852        if (!(toStringTagSymbol in genFun)) {
3853          genFun[toStringTagSymbol] = "GeneratorFunction";
3854        }
3855      }
3856      genFun.prototype = Object.create(Gp);
3857      return genFun;
3858    };
3859  
3860    // Within the body of any async function, `await x` is transformed to
3861    // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
3862    // `hasOwn.call(value, "__await")` to determine if the yielded value is
3863    // meant to be awaited.
3864    exports.awrap = function(arg) {
3865      return { __await: arg };
3866    };
3867  
3868    function AsyncIterator(generator) {
3869      function invoke(method, arg, resolve, reject) {
3870        var record = tryCatch(generator[method], generator, arg);
3871        if (record.type === "throw") {
3872          reject(record.arg);
3873        } else {
3874          var result = record.arg;
3875          var value = result.value;
3876          if (value &&
3877              typeof value === "object" &&
3878              hasOwn.call(value, "__await")) {
3879            return Promise.resolve(value.__await).then(function(value) {
3880              invoke("next", value, resolve, reject);
3881            }, function(err) {
3882              invoke("throw", err, resolve, reject);
3883            });
3884          }
3885  
3886          return Promise.resolve(value).then(function(unwrapped) {
3887            // When a yielded Promise is resolved, its final value becomes
3888            // the .value of the Promise<{value,done}> result for the
3889            // current iteration.
3890            result.value = unwrapped;
3891            resolve(result);
3892          }, function(error) {
3893            // If a rejected Promise was yielded, throw the rejection back
3894            // into the async generator function so it can be handled there.
3895            return invoke("throw", error, resolve, reject);
3896          });
3897        }
3898      }
3899  
3900      var previousPromise;
3901  
3902      function enqueue(method, arg) {
3903        function callInvokeWithMethodAndArg() {
3904          return new Promise(function(resolve, reject) {
3905            invoke(method, arg, resolve, reject);
3906          });
3907        }
3908  
3909        return previousPromise =
3910          // If enqueue has been called before, then we want to wait until
3911          // all previous Promises have been resolved before calling invoke,
3912          // so that results are always delivered in the correct order. If
3913          // enqueue has not been called before, then it is important to
3914          // call invoke immediately, without waiting on a callback to fire,
3915          // so that the async generator function has the opportunity to do
3916          // any necessary setup in a predictable way. This predictability
3917          // is why the Promise constructor synchronously invokes its
3918          // executor callback, and why async functions synchronously
3919          // execute code before the first await. Since we implement simple
3920          // async functions in terms of async generators, it is especially
3921          // important to get this right, even though it requires care.
3922          previousPromise ? previousPromise.then(
3923            callInvokeWithMethodAndArg,
3924            // Avoid propagating failures to Promises returned by later
3925            // invocations of the iterator.
3926            callInvokeWithMethodAndArg
3927          ) : callInvokeWithMethodAndArg();
3928      }
3929  
3930      // Define the unified helper method that is used to implement .next,
3931      // .throw, and .return (see defineIteratorMethods).
3932      this._invoke = enqueue;
3933    }
3934  
3935    defineIteratorMethods(AsyncIterator.prototype);
3936    AsyncIterator.prototype[asyncIteratorSymbol] = function () {
3937      return this;
3938    };
3939    exports.AsyncIterator = AsyncIterator;
3940  
3941    // Note that simple async functions are implemented on top of
3942    // AsyncIterator objects; they just return a Promise for the value of
3943    // the final result produced by the iterator.
3944    exports.async = function(innerFn, outerFn, self, tryLocsList) {
3945      var iter = new AsyncIterator(
3946        wrap(innerFn, outerFn, self, tryLocsList)
3947      );
3948  
3949      return exports.isGeneratorFunction(outerFn)
3950        ? iter // If outerFn is a generator, return the full iterator.
3951        : iter.next().then(function(result) {
3952            return result.done ? result.value : iter.next();
3953          });
3954    };
3955  
3956    function makeInvokeMethod(innerFn, self, context) {
3957      var state = GenStateSuspendedStart;
3958  
3959      return function invoke(method, arg) {
3960        if (state === GenStateExecuting) {
3961          throw new Error("Generator is already running");
3962        }
3963  
3964        if (state === GenStateCompleted) {
3965          if (method === "throw") {
3966            throw arg;
3967          }
3968  
3969          // Be forgiving, per 25.3.3.3.3 of the spec:
3970          // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
3971          return doneResult();
3972        }
3973  
3974        context.method = method;
3975        context.arg = arg;
3976  
3977        while (true) {
3978          var delegate = context.delegate;
3979          if (delegate) {
3980            var delegateResult = maybeInvokeDelegate(delegate, context);
3981            if (delegateResult) {
3982              if (delegateResult === ContinueSentinel) continue;
3983              return delegateResult;
3984            }
3985          }
3986  
3987          if (context.method === "next") {
3988            // Setting context._sent for legacy support of Babel's
3989            // function.sent implementation.
3990            context.sent = context._sent = context.arg;
3991  
3992          } else if (context.method === "throw") {
3993            if (state === GenStateSuspendedStart) {
3994              state = GenStateCompleted;
3995              throw context.arg;
3996            }
3997  
3998            context.dispatchException(context.arg);
3999  
4000          } else if (context.method === "return") {
4001            context.abrupt("return", context.arg);
4002          }
4003  
4004          state = GenStateExecuting;
4005  
4006          var record = tryCatch(innerFn, self, context);
4007          if (record.type === "normal") {
4008            // If an exception is thrown from innerFn, we leave state ===
4009            // GenStateExecuting and loop back for another invocation.
4010            state = context.done
4011              ? GenStateCompleted
4012              : GenStateSuspendedYield;
4013  
4014            if (record.arg === ContinueSentinel) {
4015              continue;
4016            }
4017  
4018            return {
4019              value: record.arg,
4020              done: context.done
4021            };
4022  
4023          } else if (record.type === "throw") {
4024            state = GenStateCompleted;
4025            // Dispatch the exception by looping back around to the
4026            // context.dispatchException(context.arg) call above.
4027            context.method = "throw";
4028            context.arg = record.arg;
4029          }
4030        }
4031      };
4032    }
4033  
4034    // Call delegate.iterator[context.method](context.arg) and handle the
4035    // result, either by returning a { value, done } result from the
4036    // delegate iterator, or by modifying context.method and context.arg,
4037    // setting context.delegate to null, and returning the ContinueSentinel.
4038    function maybeInvokeDelegate(delegate, context) {
4039      var method = delegate.iterator[context.method];
4040      if (method === undefined) {
4041        // A .throw or .return when the delegate iterator has no .throw
4042        // method always terminates the yield* loop.
4043        context.delegate = null;
4044  
4045        if (context.method === "throw") {
4046          // Note: ["return"] must be used for ES3 parsing compatibility.
4047          if (delegate.iterator["return"]) {
4048            // If the delegate iterator has a return method, give it a
4049            // chance to clean up.
4050            context.method = "return";
4051            context.arg = undefined;
4052            maybeInvokeDelegate(delegate, context);
4053  
4054            if (context.method === "throw") {
4055              // If maybeInvokeDelegate(context) changed context.method from
4056              // "return" to "throw", let that override the TypeError below.
4057              return ContinueSentinel;
4058            }
4059          }
4060  
4061          context.method = "throw";
4062          context.arg = new TypeError(
4063            "The iterator does not provide a 'throw' method");
4064        }
4065  
4066        return ContinueSentinel;
4067      }
4068  
4069      var record = tryCatch(method, delegate.iterator, context.arg);
4070  
4071      if (record.type === "throw") {
4072        context.method = "throw";
4073        context.arg = record.arg;
4074        context.delegate = null;
4075        return ContinueSentinel;
4076      }
4077  
4078      var info = record.arg;
4079  
4080      if (! info) {
4081        context.method = "throw";
4082        context.arg = new TypeError("iterator result is not an object");
4083        context.delegate = null;
4084        return ContinueSentinel;
4085      }
4086  
4087      if (info.done) {
4088        // Assign the result of the finished delegate to the temporary
4089        // variable specified by delegate.resultName (see delegateYield).
4090        context[delegate.resultName] = info.value;
4091  
4092        // Resume execution at the desired location (see delegateYield).
4093        context.next = delegate.nextLoc;
4094  
4095        // If context.method was "throw" but the delegate handled the
4096        // exception, let the outer generator proceed normally. If
4097        // context.method was "next", forget context.arg since it has been
4098        // "consumed" by the delegate iterator. If context.method was
4099        // "return", allow the original .return call to continue in the
4100        // outer generator.
4101        if (context.method !== "return") {
4102          context.method = "next";
4103          context.arg = undefined;
4104        }
4105  
4106      } else {
4107        // Re-yield the result returned by the delegate method.
4108        return info;
4109      }
4110  
4111      // The delegate iterator is finished, so forget it and continue with
4112      // the outer generator.
4113      context.delegate = null;
4114      return ContinueSentinel;
4115    }
4116  
4117    // Define Generator.prototype.{next,throw,return} in terms of the
4118    // unified ._invoke helper method.
4119    defineIteratorMethods(Gp);
4120  
4121    Gp[toStringTagSymbol] = "Generator";
4122  
4123    // A Generator should always return itself as the iterator object when the
4124    // @@iterator function is called on it. Some browsers' implementations of the
4125    // iterator prototype chain incorrectly implement this, causing the Generator
4126    // object to not be returned from this call. This ensures that doesn't happen.
4127    // See https://github.com/facebook/regenerator/issues/274 for more details.
4128    Gp[iteratorSymbol] = function() {
4129      return this;
4130    };
4131  
4132    Gp.toString = function() {
4133      return "[object Generator]";
4134    };
4135  
4136    function pushTryEntry(locs) {
4137      var entry = { tryLoc: locs[0] };
4138  
4139      if (1 in locs) {
4140        entry.catchLoc = locs[1];
4141      }
4142  
4143      if (2 in locs) {
4144        entry.finallyLoc = locs[2];
4145        entry.afterLoc = locs[3];
4146      }
4147  
4148      this.tryEntries.push(entry);
4149    }
4150  
4151    function resetTryEntry(entry) {
4152      var record = entry.completion || {};
4153      record.type = "normal";
4154      delete record.arg;
4155      entry.completion = record;
4156    }
4157  
4158    function Context(tryLocsList) {
4159      // The root entry object (effectively a try statement without a catch
4160      // or a finally block) gives us a place to store values thrown from
4161      // locations where there is no enclosing try statement.
4162      this.tryEntries = [{ tryLoc: "root" }];
4163      tryLocsList.forEach(pushTryEntry, this);
4164      this.reset(true);
4165    }
4166  
4167    exports.keys = function(object) {
4168      var keys = [];
4169      for (var key in object) {
4170        keys.push(key);
4171      }
4172      keys.reverse();
4173  
4174      // Rather than returning an object with a next method, we keep
4175      // things simple and return the next function itself.
4176      return function next() {
4177        while (keys.length) {
4178          var key = keys.pop();
4179          if (key in object) {
4180            next.value = key;
4181            next.done = false;
4182            return next;
4183          }
4184        }
4185  
4186        // To avoid creating an additional object, we just hang the .value
4187        // and .done properties off the next function object itself. This
4188        // also ensures that the minifier will not anonymize the function.
4189        next.done = true;
4190        return next;
4191      };
4192    };
4193  
4194    function values(iterable) {
4195      if (iterable) {
4196        var iteratorMethod = iterable[iteratorSymbol];
4197        if (iteratorMethod) {
4198          return iteratorMethod.call(iterable);
4199        }
4200  
4201        if (typeof iterable.next === "function") {
4202          return iterable;
4203        }
4204  
4205        if (!isNaN(iterable.length)) {
4206          var i = -1, next = function next() {
4207            while (++i < iterable.length) {
4208              if (hasOwn.call(iterable, i)) {
4209                next.value = iterable[i];
4210                next.done = false;
4211                return next;
4212              }
4213            }
4214  
4215            next.value = undefined;
4216            next.done = true;
4217  
4218            return next;
4219          };
4220  
4221          return next.next = next;
4222        }
4223      }
4224  
4225      // Return an iterator with no values.
4226      return { next: doneResult };
4227    }
4228    exports.values = values;
4229  
4230    function doneResult() {
4231      return { value: undefined, done: true };
4232    }
4233  
4234    Context.prototype = {
4235      constructor: Context,
4236  
4237      reset: function(skipTempReset) {
4238        this.prev = 0;
4239        this.next = 0;
4240        // Resetting context._sent for legacy support of Babel's
4241        // function.sent implementation.
4242        this.sent = this._sent = undefined;
4243        this.done = false;
4244        this.delegate = null;
4245  
4246        this.method = "next";
4247        this.arg = undefined;
4248  
4249        this.tryEntries.forEach(resetTryEntry);
4250  
4251        if (!skipTempReset) {
4252          for (var name in this) {
4253            // Not sure about the optimal order of these conditions:
4254            if (name.charAt(0) === "t" &&
4255                hasOwn.call(this, name) &&
4256                !isNaN(+name.slice(1))) {
4257              this[name] = undefined;
4258            }
4259          }
4260        }
4261      },
4262  
4263      stop: function() {
4264        this.done = true;
4265  
4266        var rootEntry = this.tryEntries[0];
4267        var rootRecord = rootEntry.completion;
4268        if (rootRecord.type === "throw") {
4269          throw rootRecord.arg;
4270        }
4271  
4272        return this.rval;
4273      },
4274  
4275      dispatchException: function(exception) {
4276        if (this.done) {
4277          throw exception;
4278        }
4279  
4280        var context = this;
4281        function handle(loc, caught) {
4282          record.type = "throw";
4283          record.arg = exception;
4284          context.next = loc;
4285  
4286          if (caught) {
4287            // If the dispatched exception was caught by a catch block,
4288            // then let that catch block handle the exception normally.
4289            context.method = "next";
4290            context.arg = undefined;
4291          }
4292  
4293          return !! caught;
4294        }
4295  
4296        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4297          var entry = this.tryEntries[i];
4298          var record = entry.completion;
4299  
4300          if (entry.tryLoc === "root") {
4301            // Exception thrown outside of any try block that could handle
4302            // it, so set the completion value of the entire function to
4303            // throw the exception.
4304            return handle("end");
4305          }
4306  
4307          if (entry.tryLoc <= this.prev) {
4308            var hasCatch = hasOwn.call(entry, "catchLoc");
4309            var hasFinally = hasOwn.call(entry, "finallyLoc");
4310  
4311            if (hasCatch && hasFinally) {
4312              if (this.prev < entry.catchLoc) {
4313                return handle(entry.catchLoc, true);
4314              } else if (this.prev < entry.finallyLoc) {
4315                return handle(entry.finallyLoc);
4316              }
4317  
4318            } else if (hasCatch) {
4319              if (this.prev < entry.catchLoc) {
4320                return handle(entry.catchLoc, true);
4321              }
4322  
4323            } else if (hasFinally) {
4324              if (this.prev < entry.finallyLoc) {
4325                return handle(entry.finallyLoc);
4326              }
4327  
4328            } else {
4329              throw new Error("try statement without catch or finally");
4330            }
4331          }
4332        }
4333      },
4334  
4335      abrupt: function(type, arg) {
4336        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4337          var entry = this.tryEntries[i];
4338          if (entry.tryLoc <= this.prev &&
4339              hasOwn.call(entry, "finallyLoc") &&
4340              this.prev < entry.finallyLoc) {
4341            var finallyEntry = entry;
4342            break;
4343          }
4344        }
4345  
4346        if (finallyEntry &&
4347            (type === "break" ||
4348             type === "continue") &&
4349            finallyEntry.tryLoc <= arg &&
4350            arg <= finallyEntry.finallyLoc) {
4351          // Ignore the finally entry if control is not jumping to a
4352          // location outside the try/catch block.
4353          finallyEntry = null;
4354        }
4355  
4356        var record = finallyEntry ? finallyEntry.completion : {};
4357        record.type = type;
4358        record.arg = arg;
4359  
4360        if (finallyEntry) {
4361          this.method = "next";
4362          this.next = finallyEntry.finallyLoc;
4363          return ContinueSentinel;
4364        }
4365  
4366        return this.complete(record);
4367      },
4368  
4369      complete: function(record, afterLoc) {
4370        if (record.type === "throw") {
4371          throw record.arg;
4372        }
4373  
4374        if (record.type === "break" ||
4375            record.type === "continue") {
4376          this.next = record.arg;
4377        } else if (record.type === "return") {
4378          this.rval = this.arg = record.arg;
4379          this.method = "return";
4380          this.next = "end";
4381        } else if (record.type === "normal" && afterLoc) {
4382          this.next = afterLoc;
4383        }
4384  
4385        return ContinueSentinel;
4386      },
4387  
4388      finish: function(finallyLoc) {
4389        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4390          var entry = this.tryEntries[i];
4391          if (entry.finallyLoc === finallyLoc) {
4392            this.complete(entry.completion, entry.afterLoc);
4393            resetTryEntry(entry);
4394            return ContinueSentinel;
4395          }
4396        }
4397      },
4398  
4399      "catch": function(tryLoc) {
4400        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4401          var entry = this.tryEntries[i];
4402          if (entry.tryLoc === tryLoc) {
4403            var record = entry.completion;
4404            if (record.type === "throw") {
4405              var thrown = record.arg;
4406              resetTryEntry(entry);
4407            }
4408            return thrown;
4409          }
4410        }
4411  
4412        // The context.catch method must only be called with a location
4413        // argument that corresponds to a known catch block.
4414        throw new Error("illegal catch attempt");
4415      },
4416  
4417      delegateYield: function(iterable, resultName, nextLoc) {
4418        this.delegate = {
4419          iterator: values(iterable),
4420          resultName: resultName,
4421          nextLoc: nextLoc
4422        };
4423  
4424        if (this.method === "next") {
4425          // Deliberately forget the last sent value so that we don't
4426          // accidentally pass it on to the delegate.
4427          this.arg = undefined;
4428        }
4429  
4430        return ContinueSentinel;
4431      }
4432    };
4433  
4434    // Regardless of whether this script is executing as a CommonJS module
4435    // or not, return the runtime object so that we can declare the variable
4436    // regeneratorRuntime in the outer scope, which allows this module to be
4437    // injected easily by `bin/regenerator --include-runtime script.js`.
4438    return exports;
4439  
4440  }(
4441    // If this script is executing as a CommonJS module, use module.exports
4442    // as the regeneratorRuntime namespace. Otherwise create a new empty
4443    // object. Either way, the resulting object will be used to initialize
4444    // the regeneratorRuntime variable at the top of this file.
4445     true ? module.exports : undefined
4446  ));
4447  
4448  try {
4449    regeneratorRuntime = runtime;
4450  } catch (accidentalStrictMode) {
4451    // This module should not be running in strict mode, so the above
4452    // assignment should always work unless something is misconfigured. Just
4453    // in case runtime.js accidentally runs in strict mode, we can escape
4454    // strict mode using a global Function call. This could conceivably fail
4455    // if a Content Security Policy forbids using Function, but in that case
4456    // the proper solution is to fix the accidental strict mode problem. If
4457    // you've misconfigured your bundler to force strict mode and applied a
4458    // CSP to forbid Function, and you're not willing to fix either of those
4459    // problems, please detail your unique predicament in a GitHub issue.
4460    Function("r", "regeneratorRuntime = r")(runtime);
4461  }
4462  
4463  
4464  /***/ }),
4465  
4466  /***/ 7:
4467  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4468  
4469  "use strict";
4470  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
4471  /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
4472  
4473  function _objectSpread(target) {
4474    for (var i = 1; i < arguments.length; i++) {
4475      var source = arguments[i] != null ? arguments[i] : {};
4476      var ownKeys = Object.keys(source);
4477  
4478      if (typeof Object.getOwnPropertySymbols === 'function') {
4479        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
4480          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
4481        }));
4482      }
4483  
4484      ownKeys.forEach(function (key) {
4485        Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
4486      });
4487    }
4488  
4489    return target;
4490  }
4491  
4492  /***/ }),
4493  
4494  /***/ 74:
4495  /***/ (function(module, exports, __webpack_require__) {
4496  
4497  "use strict";
4498  
4499  
4500  function _typeof(obj) {
4501    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
4502      _typeof = function (obj) {
4503        return typeof obj;
4504      };
4505    } else {
4506      _typeof = function (obj) {
4507        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
4508      };
4509    }
4510  
4511    return _typeof(obj);
4512  }
4513  
4514  function _classCallCheck(instance, Constructor) {
4515    if (!(instance instanceof Constructor)) {
4516      throw new TypeError("Cannot call a class as a function");
4517    }
4518  }
4519  
4520  function _defineProperties(target, props) {
4521    for (var i = 0; i < props.length; i++) {
4522      var descriptor = props[i];
4523      descriptor.enumerable = descriptor.enumerable || false;
4524      descriptor.configurable = true;
4525      if ("value" in descriptor) descriptor.writable = true;
4526      Object.defineProperty(target, descriptor.key, descriptor);
4527    }
4528  }
4529  
4530  function _createClass(Constructor, protoProps, staticProps) {
4531    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
4532    if (staticProps) _defineProperties(Constructor, staticProps);
4533    return Constructor;
4534  }
4535  
4536  /**
4537   * Given an instance of EquivalentKeyMap, returns its internal value pair tuple
4538   * for a key, if one exists. The tuple members consist of the last reference
4539   * value for the key (used in efficient subsequent lookups) and the value
4540   * assigned for the key at the leaf node.
4541   *
4542   * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
4543   * @param {*} key                     The key for which to return value pair.
4544   *
4545   * @return {?Array} Value pair, if exists.
4546   */
4547  function getValuePair(instance, key) {
4548    var _map = instance._map,
4549        _arrayTreeMap = instance._arrayTreeMap,
4550        _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
4551    // value, which can be used to shortcut immediately to the value.
4552  
4553    if (_map.has(key)) {
4554      return _map.get(key);
4555    } // Sort keys to ensure stable retrieval from tree.
4556  
4557  
4558    var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
4559  
4560    var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
4561  
4562    for (var i = 0; i < properties.length; i++) {
4563      var property = properties[i];
4564      map = map.get(property);
4565  
4566      if (map === undefined) {
4567        return;
4568      }
4569  
4570      var propertyValue = key[property];
4571      map = map.get(propertyValue);
4572  
4573      if (map === undefined) {
4574        return;
4575      }
4576    }
4577  
4578    var valuePair = map.get('_ekm_value');
4579  
4580    if (!valuePair) {
4581      return;
4582    } // If reached, it implies that an object-like key was set with another
4583    // reference, so delete the reference and replace with the current.
4584  
4585  
4586    _map.delete(valuePair[0]);
4587  
4588    valuePair[0] = key;
4589    map.set('_ekm_value', valuePair);
4590  
4591    _map.set(key, valuePair);
4592  
4593    return valuePair;
4594  }
4595  /**
4596   * Variant of a Map object which enables lookup by equivalent (deeply equal)
4597   * object and array keys.
4598   */
4599  
4600  
4601  var EquivalentKeyMap =
4602  /*#__PURE__*/
4603  function () {
4604    /**
4605     * Constructs a new instance of EquivalentKeyMap.
4606     *
4607     * @param {Iterable.<*>} iterable Initial pair of key, value for map.
4608     */
4609    function EquivalentKeyMap(iterable) {
4610      _classCallCheck(this, EquivalentKeyMap);
4611  
4612      this.clear();
4613  
4614      if (iterable instanceof EquivalentKeyMap) {
4615        // Map#forEach is only means of iterating with support for IE11.
4616        var iterablePairs = [];
4617        iterable.forEach(function (value, key) {
4618          iterablePairs.push([key, value]);
4619        });
4620        iterable = iterablePairs;
4621      }
4622  
4623      if (iterable != null) {
4624        for (var i = 0; i < iterable.length; i++) {
4625          this.set(iterable[i][0], iterable[i][1]);
4626        }
4627      }
4628    }
4629    /**
4630     * Accessor property returning the number of elements.
4631     *
4632     * @return {number} Number of elements.
4633     */
4634  
4635  
4636    _createClass(EquivalentKeyMap, [{
4637      key: "set",
4638  
4639      /**
4640       * Add or update an element with a specified key and value.
4641       *
4642       * @param {*} key   The key of the element to add.
4643       * @param {*} value The value of the element to add.
4644       *
4645       * @return {EquivalentKeyMap} Map instance.
4646       */
4647      value: function set(key, value) {
4648        // Shortcut non-object-like to set on internal Map.
4649        if (key === null || _typeof(key) !== 'object') {
4650          this._map.set(key, value);
4651  
4652          return this;
4653        } // Sort keys to ensure stable assignment into tree.
4654  
4655  
4656        var properties = Object.keys(key).sort();
4657        var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
4658  
4659        var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
4660  
4661        for (var i = 0; i < properties.length; i++) {
4662          var property = properties[i];
4663  
4664          if (!map.has(property)) {
4665            map.set(property, new EquivalentKeyMap());
4666          }
4667  
4668          map = map.get(property);
4669          var propertyValue = key[property];
4670  
4671          if (!map.has(propertyValue)) {
4672            map.set(propertyValue, new EquivalentKeyMap());
4673          }
4674  
4675          map = map.get(propertyValue);
4676        } // If an _ekm_value exists, there was already an equivalent key. Before
4677        // overriding, ensure that the old key reference is removed from map to
4678        // avoid memory leak of accumulating equivalent keys. This is, in a
4679        // sense, a poor man's WeakMap, while still enabling iterability.
4680  
4681  
4682        var previousValuePair = map.get('_ekm_value');
4683  
4684        if (previousValuePair) {
4685          this._map.delete(previousValuePair[0]);
4686        }
4687  
4688        map.set('_ekm_value', valuePair);
4689  
4690        this._map.set(key, valuePair);
4691  
4692        return this;
4693      }
4694      /**
4695       * Returns a specified element.
4696       *
4697       * @param {*} key The key of the element to return.
4698       *
4699       * @return {?*} The element associated with the specified key or undefined
4700       *              if the key can't be found.
4701       */
4702  
4703    }, {
4704      key: "get",
4705      value: function get(key) {
4706        // Shortcut non-object-like to get from internal Map.
4707        if (key === null || _typeof(key) !== 'object') {
4708          return this._map.get(key);
4709        }
4710  
4711        var valuePair = getValuePair(this, key);
4712  
4713        if (valuePair) {
4714          return valuePair[1];
4715        }
4716      }
4717      /**
4718       * Returns a boolean indicating whether an element with the specified key
4719       * exists or not.
4720       *
4721       * @param {*} key The key of the element to test for presence.
4722       *
4723       * @return {boolean} Whether an element with the specified key exists.
4724       */
4725  
4726    }, {
4727      key: "has",
4728      value: function has(key) {
4729        if (key === null || _typeof(key) !== 'object') {
4730          return this._map.has(key);
4731        } // Test on the _presence_ of the pair, not its value, as even undefined
4732        // can be a valid member value for a key.
4733  
4734  
4735        return getValuePair(this, key) !== undefined;
4736      }
4737      /**
4738       * Removes the specified element.
4739       *
4740       * @param {*} key The key of the element to remove.
4741       *
4742       * @return {boolean} Returns true if an element existed and has been
4743       *                   removed, or false if the element does not exist.
4744       */
4745  
4746    }, {
4747      key: "delete",
4748      value: function _delete(key) {
4749        if (!this.has(key)) {
4750          return false;
4751        } // This naive implementation will leave orphaned child trees. A better
4752        // implementation should traverse and remove orphans.
4753  
4754  
4755        this.set(key, undefined);
4756        return true;
4757      }
4758      /**
4759       * Executes a provided function once per each key/value pair, in insertion
4760       * order.
4761       *
4762       * @param {Function} callback Function to execute for each element.
4763       * @param {*}        thisArg  Value to use as `this` when executing
4764       *                            `callback`.
4765       */
4766  
4767    }, {
4768      key: "forEach",
4769      value: function forEach(callback) {
4770        var _this = this;
4771  
4772        var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
4773  
4774        this._map.forEach(function (value, key) {
4775          // Unwrap value from object-like value pair.
4776          if (key !== null && _typeof(key) === 'object') {
4777            value = value[1];
4778          }
4779  
4780          callback.call(thisArg, value, key, _this);
4781        });
4782      }
4783      /**
4784       * Removes all elements.
4785       */
4786  
4787    }, {
4788      key: "clear",
4789      value: function clear() {
4790        this._map = new Map();
4791        this._arrayTreeMap = new Map();
4792        this._objectTreeMap = new Map();
4793      }
4794    }, {
4795      key: "size",
4796      get: function get() {
4797        return this._map.size;
4798      }
4799    }]);
4800  
4801    return EquivalentKeyMap;
4802  }();
4803  
4804  module.exports = EquivalentKeyMap;
4805  
4806  
4807  /***/ })
4808  
4809  /******/ });


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7