[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> rich-text.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["richText"] =
   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 = 463);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 108:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = this["wp"]["escapeHtml"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 12:
 105  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 106  
 107  "use strict";
 108  
 109  // EXPORTS
 110  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
 111  
 112  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 113  var arrayWithHoles = __webpack_require__(38);
 114  
 115  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 116  function _iterableToArrayLimit(arr, i) {
 117    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
 118    var _arr = [];
 119    var _n = true;
 120    var _d = false;
 121    var _e = undefined;
 122  
 123    try {
 124      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 125        _arr.push(_s.value);
 126  
 127        if (i && _arr.length === i) break;
 128      }
 129    } catch (err) {
 130      _d = true;
 131      _e = err;
 132    } finally {
 133      try {
 134        if (!_n && _i["return"] != null) _i["return"]();
 135      } finally {
 136        if (_d) throw _e;
 137      }
 138    }
 139  
 140    return _arr;
 141  }
 142  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 143  var unsupportedIterableToArray = __webpack_require__(31);
 144  
 145  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 146  var nonIterableRest = __webpack_require__(39);
 147  
 148  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 149  
 150  
 151  
 152  
 153  function _slicedToArray(arr, i) {
 154    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
 155  }
 156  
 157  /***/ }),
 158  
 159  /***/ 17:
 160  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 161  
 162  "use strict";
 163  
 164  // EXPORTS
 165  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
 166  
 167  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
 168  var arrayLikeToArray = __webpack_require__(27);
 169  
 170  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 171  
 172  function _arrayWithoutHoles(arr) {
 173    if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
 174  }
 175  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 176  var iterableToArray = __webpack_require__(37);
 177  
 178  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 179  var unsupportedIterableToArray = __webpack_require__(31);
 180  
 181  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 182  function _nonIterableSpread() {
 183    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 184  }
 185  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 186  
 187  
 188  
 189  
 190  function _toConsumableArray(arr) {
 191    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 192  }
 193  
 194  /***/ }),
 195  
 196  /***/ 18:
 197  /***/ (function(module, exports) {
 198  
 199  (function() { module.exports = this["wp"]["keycodes"]; }());
 200  
 201  /***/ }),
 202  
 203  /***/ 2:
 204  /***/ (function(module, exports) {
 205  
 206  (function() { module.exports = this["lodash"]; }());
 207  
 208  /***/ }),
 209  
 210  /***/ 27:
 211  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 212  
 213  "use strict";
 214  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
 215  function _arrayLikeToArray(arr, len) {
 216    if (len == null || len > arr.length) len = arr.length;
 217  
 218    for (var i = 0, arr2 = new Array(len); i < len; i++) {
 219      arr2[i] = arr[i];
 220    }
 221  
 222    return arr2;
 223  }
 224  
 225  /***/ }),
 226  
 227  /***/ 31:
 228  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 229  
 230  "use strict";
 231  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
 232  /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
 233  
 234  function _unsupportedIterableToArray(o, minLen) {
 235    if (!o) return;
 236    if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 237    var n = Object.prototype.toString.call(o).slice(8, -1);
 238    if (n === "Object" && o.constructor) n = o.constructor.name;
 239    if (n === "Map" || n === "Set") return Array.from(o);
 240    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 241  }
 242  
 243  /***/ }),
 244  
 245  /***/ 36:
 246  /***/ (function(module, exports) {
 247  
 248  (function() { module.exports = this["wp"]["deprecated"]; }());
 249  
 250  /***/ }),
 251  
 252  /***/ 37:
 253  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 254  
 255  "use strict";
 256  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
 257  function _iterableToArray(iter) {
 258    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
 259  }
 260  
 261  /***/ }),
 262  
 263  /***/ 38:
 264  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 265  
 266  "use strict";
 267  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
 268  function _arrayWithHoles(arr) {
 269    if (Array.isArray(arr)) return arr;
 270  }
 271  
 272  /***/ }),
 273  
 274  /***/ 39:
 275  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 276  
 277  "use strict";
 278  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
 279  function _nonIterableRest() {
 280    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 281  }
 282  
 283  /***/ }),
 284  
 285  /***/ 4:
 286  /***/ (function(module, exports) {
 287  
 288  (function() { module.exports = this["wp"]["data"]; }());
 289  
 290  /***/ }),
 291  
 292  /***/ 40:
 293  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 294  
 295  "use strict";
 296  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
 297  function _typeof(obj) {
 298    "@babel/helpers - typeof";
 299  
 300    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
 301      _typeof = function _typeof(obj) {
 302        return typeof obj;
 303      };
 304    } else {
 305      _typeof = function _typeof(obj) {
 306        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
 307      };
 308    }
 309  
 310    return _typeof(obj);
 311  }
 312  
 313  /***/ }),
 314  
 315  /***/ 42:
 316  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 317  
 318  "use strict";
 319  
 320  
 321  var LEAF_KEY, hasWeakMap;
 322  
 323  /**
 324   * Arbitrary value used as key for referencing cache object in WeakMap tree.
 325   *
 326   * @type {Object}
 327   */
 328  LEAF_KEY = {};
 329  
 330  /**
 331   * Whether environment supports WeakMap.
 332   *
 333   * @type {boolean}
 334   */
 335  hasWeakMap = typeof WeakMap !== 'undefined';
 336  
 337  /**
 338   * Returns the first argument as the sole entry in an array.
 339   *
 340   * @param {*} value Value to return.
 341   *
 342   * @return {Array} Value returned as entry in array.
 343   */
 344  function arrayOf( value ) {
 345      return [ value ];
 346  }
 347  
 348  /**
 349   * Returns true if the value passed is object-like, or false otherwise. A value
 350   * is object-like if it can support property assignment, e.g. object or array.
 351   *
 352   * @param {*} value Value to test.
 353   *
 354   * @return {boolean} Whether value is object-like.
 355   */
 356  function isObjectLike( value ) {
 357      return !! value && 'object' === typeof value;
 358  }
 359  
 360  /**
 361   * Creates and returns a new cache object.
 362   *
 363   * @return {Object} Cache object.
 364   */
 365  function createCache() {
 366      var cache = {
 367          clear: function() {
 368              cache.head = null;
 369          },
 370      };
 371  
 372      return cache;
 373  }
 374  
 375  /**
 376   * Returns true if entries within the two arrays are strictly equal by
 377   * reference from a starting index.
 378   *
 379   * @param {Array}  a         First array.
 380   * @param {Array}  b         Second array.
 381   * @param {number} fromIndex Index from which to start comparison.
 382   *
 383   * @return {boolean} Whether arrays are shallowly equal.
 384   */
 385  function isShallowEqual( a, b, fromIndex ) {
 386      var i;
 387  
 388      if ( a.length !== b.length ) {
 389          return false;
 390      }
 391  
 392      for ( i = fromIndex; i < a.length; i++ ) {
 393          if ( a[ i ] !== b[ i ] ) {
 394              return false;
 395          }
 396      }
 397  
 398      return true;
 399  }
 400  
 401  /**
 402   * Returns a memoized selector function. The getDependants function argument is
 403   * called before the memoized selector and is expected to return an immutable
 404   * reference or array of references on which the selector depends for computing
 405   * its own return value. The memoize cache is preserved only as long as those
 406   * dependant references remain the same. If getDependants returns a different
 407   * reference(s), the cache is cleared and the selector value regenerated.
 408   *
 409   * @param {Function} selector      Selector function.
 410   * @param {Function} getDependants Dependant getter returning an immutable
 411   *                                 reference or array of reference used in
 412   *                                 cache bust consideration.
 413   *
 414   * @return {Function} Memoized selector.
 415   */
 416  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
 417      var rootCache, getCache;
 418  
 419      // Use object source as dependant if getter not provided
 420      if ( ! getDependants ) {
 421          getDependants = arrayOf;
 422      }
 423  
 424      /**
 425       * Returns the root cache. If WeakMap is supported, this is assigned to the
 426       * root WeakMap cache set, otherwise it is a shared instance of the default
 427       * cache object.
 428       *
 429       * @return {(WeakMap|Object)} Root cache object.
 430       */
 431  	function getRootCache() {
 432          return rootCache;
 433      }
 434  
 435      /**
 436       * Returns the cache for a given dependants array. When possible, a WeakMap
 437       * will be used to create a unique cache for each set of dependants. This
 438       * is feasible due to the nature of WeakMap in allowing garbage collection
 439       * to occur on entries where the key object is no longer referenced. Since
 440       * WeakMap requires the key to be an object, this is only possible when the
 441       * dependant is object-like. The root cache is created as a hierarchy where
 442       * each top-level key is the first entry in a dependants set, the value a
 443       * WeakMap where each key is the next dependant, and so on. This continues
 444       * so long as the dependants are object-like. If no dependants are object-
 445       * like, then the cache is shared across all invocations.
 446       *
 447       * @see isObjectLike
 448       *
 449       * @param {Array} dependants Selector dependants.
 450       *
 451       * @return {Object} Cache object.
 452       */
 453  	function getWeakMapCache( dependants ) {
 454          var caches = rootCache,
 455              isUniqueByDependants = true,
 456              i, dependant, map, cache;
 457  
 458          for ( i = 0; i < dependants.length; i++ ) {
 459              dependant = dependants[ i ];
 460  
 461              // Can only compose WeakMap from object-like key.
 462              if ( ! isObjectLike( dependant ) ) {
 463                  isUniqueByDependants = false;
 464                  break;
 465              }
 466  
 467              // Does current segment of cache already have a WeakMap?
 468              if ( caches.has( dependant ) ) {
 469                  // Traverse into nested WeakMap.
 470                  caches = caches.get( dependant );
 471              } else {
 472                  // Create, set, and traverse into a new one.
 473                  map = new WeakMap();
 474                  caches.set( dependant, map );
 475                  caches = map;
 476              }
 477          }
 478  
 479          // We use an arbitrary (but consistent) object as key for the last item
 480          // in the WeakMap to serve as our running cache.
 481          if ( ! caches.has( LEAF_KEY ) ) {
 482              cache = createCache();
 483              cache.isUniqueByDependants = isUniqueByDependants;
 484              caches.set( LEAF_KEY, cache );
 485          }
 486  
 487          return caches.get( LEAF_KEY );
 488      }
 489  
 490      // Assign cache handler by availability of WeakMap
 491      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
 492  
 493      /**
 494       * Resets root memoization cache.
 495       */
 496  	function clear() {
 497          rootCache = hasWeakMap ? new WeakMap() : createCache();
 498      }
 499  
 500      // eslint-disable-next-line jsdoc/check-param-names
 501      /**
 502       * The augmented selector call, considering first whether dependants have
 503       * changed before passing it to underlying memoize function.
 504       *
 505       * @param {Object} source    Source object for derivation.
 506       * @param {...*}   extraArgs Additional arguments to pass to selector.
 507       *
 508       * @return {*} Selector result.
 509       */
 510  	function callSelector( /* source, ...extraArgs */ ) {
 511          var len = arguments.length,
 512              cache, node, i, args, dependants;
 513  
 514          // Create copy of arguments (avoid leaking deoptimization).
 515          args = new Array( len );
 516          for ( i = 0; i < len; i++ ) {
 517              args[ i ] = arguments[ i ];
 518          }
 519  
 520          dependants = getDependants.apply( null, args );
 521          cache = getCache( dependants );
 522  
 523          // If not guaranteed uniqueness by dependants (primitive type or lack
 524          // of WeakMap support), shallow compare against last dependants and, if
 525          // references have changed, destroy cache to recalculate result.
 526          if ( ! cache.isUniqueByDependants ) {
 527              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
 528                  cache.clear();
 529              }
 530  
 531              cache.lastDependants = dependants;
 532          }
 533  
 534          node = cache.head;
 535          while ( node ) {
 536              // Check whether node arguments match arguments
 537              if ( ! isShallowEqual( node.args, args, 1 ) ) {
 538                  node = node.next;
 539                  continue;
 540              }
 541  
 542              // At this point we can assume we've found a match
 543  
 544              // Surface matched node to head if not already
 545              if ( node !== cache.head ) {
 546                  // Adjust siblings to point to each other.
 547                  node.prev.next = node.next;
 548                  if ( node.next ) {
 549                      node.next.prev = node.prev;
 550                  }
 551  
 552                  node.next = cache.head;
 553                  node.prev = null;
 554                  cache.head.prev = node;
 555                  cache.head = node;
 556              }
 557  
 558              // Return immediately
 559              return node.val;
 560          }
 561  
 562          // No cached value found. Continue to insertion phase:
 563  
 564          node = {
 565              // Generate the result from original function
 566              val: selector.apply( null, args ),
 567          };
 568  
 569          // Avoid including the source object in the cache.
 570          args[ 0 ] = null;
 571          node.args = args;
 572  
 573          // Don't need to check whether node is already head, since it would
 574          // have been returned above already if it was
 575  
 576          // Shift existing head down list
 577          if ( cache.head ) {
 578              cache.head.prev = node;
 579              node.next = cache.head;
 580          }
 581  
 582          cache.head = node;
 583  
 584          return node.val;
 585      }
 586  
 587      callSelector.getDependants = getDependants;
 588      callSelector.clear = clear;
 589      clear();
 590  
 591      return callSelector;
 592  });
 593  
 594  
 595  /***/ }),
 596  
 597  /***/ 463:
 598  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 599  
 600  "use strict";
 601  // ESM COMPAT FLAG
 602  __webpack_require__.r(__webpack_exports__);
 603  
 604  // EXPORTS
 605  __webpack_require__.d(__webpack_exports__, "applyFormat", function() { return /* reexport */ applyFormat; });
 606  __webpack_require__.d(__webpack_exports__, "concat", function() { return /* reexport */ concat; });
 607  __webpack_require__.d(__webpack_exports__, "create", function() { return /* reexport */ create; });
 608  __webpack_require__.d(__webpack_exports__, "getActiveFormat", function() { return /* reexport */ getActiveFormat; });
 609  __webpack_require__.d(__webpack_exports__, "getActiveObject", function() { return /* reexport */ getActiveObject; });
 610  __webpack_require__.d(__webpack_exports__, "getTextContent", function() { return /* reexport */ getTextContent; });
 611  __webpack_require__.d(__webpack_exports__, "__unstableIsListRootSelected", function() { return /* reexport */ isListRootSelected; });
 612  __webpack_require__.d(__webpack_exports__, "__unstableIsActiveListType", function() { return /* reexport */ isActiveListType; });
 613  __webpack_require__.d(__webpack_exports__, "isCollapsed", function() { return /* reexport */ isCollapsed; });
 614  __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return /* reexport */ isEmpty; });
 615  __webpack_require__.d(__webpack_exports__, "__unstableIsEmptyLine", function() { return /* reexport */ isEmptyLine; });
 616  __webpack_require__.d(__webpack_exports__, "join", function() { return /* reexport */ join; });
 617  __webpack_require__.d(__webpack_exports__, "registerFormatType", function() { return /* reexport */ registerFormatType; });
 618  __webpack_require__.d(__webpack_exports__, "removeFormat", function() { return /* reexport */ removeFormat; });
 619  __webpack_require__.d(__webpack_exports__, "remove", function() { return /* reexport */ remove_remove; });
 620  __webpack_require__.d(__webpack_exports__, "replace", function() { return /* reexport */ replace_replace; });
 621  __webpack_require__.d(__webpack_exports__, "insert", function() { return /* reexport */ insert; });
 622  __webpack_require__.d(__webpack_exports__, "__unstableInsertLineSeparator", function() { return /* reexport */ insertLineSeparator; });
 623  __webpack_require__.d(__webpack_exports__, "__unstableRemoveLineSeparator", function() { return /* reexport */ removeLineSeparator; });
 624  __webpack_require__.d(__webpack_exports__, "insertObject", function() { return /* reexport */ insertObject; });
 625  __webpack_require__.d(__webpack_exports__, "slice", function() { return /* reexport */ slice; });
 626  __webpack_require__.d(__webpack_exports__, "split", function() { return /* reexport */ split; });
 627  __webpack_require__.d(__webpack_exports__, "__unstableToDom", function() { return /* reexport */ toDom; });
 628  __webpack_require__.d(__webpack_exports__, "toHTMLString", function() { return /* reexport */ toHTMLString; });
 629  __webpack_require__.d(__webpack_exports__, "toggleFormat", function() { return /* reexport */ toggleFormat; });
 630  __webpack_require__.d(__webpack_exports__, "__UNSTABLE_LINE_SEPARATOR", function() { return /* reexport */ LINE_SEPARATOR; });
 631  __webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return /* reexport */ unregisterFormatType; });
 632  __webpack_require__.d(__webpack_exports__, "__unstableCanIndentListItems", function() { return /* reexport */ canIndentListItems; });
 633  __webpack_require__.d(__webpack_exports__, "__unstableCanOutdentListItems", function() { return /* reexport */ canOutdentListItems; });
 634  __webpack_require__.d(__webpack_exports__, "__unstableIndentListItems", function() { return /* reexport */ indentListItems; });
 635  __webpack_require__.d(__webpack_exports__, "__unstableOutdentListItems", function() { return /* reexport */ outdentListItems; });
 636  __webpack_require__.d(__webpack_exports__, "__unstableChangeListType", function() { return /* reexport */ changeListType; });
 637  __webpack_require__.d(__webpack_exports__, "__unstableCreateElement", function() { return /* reexport */ createElement; });
 638  __webpack_require__.d(__webpack_exports__, "__experimentalRichText", function() { return /* reexport */ component; });
 639  __webpack_require__.d(__webpack_exports__, "__unstableFormatEdit", function() { return /* reexport */ FormatEdit; });
 640  
 641  // NAMESPACE OBJECT: ./node_modules/@wordpress/rich-text/build-module/store/selectors.js
 642  var selectors_namespaceObject = {};
 643  __webpack_require__.r(selectors_namespaceObject);
 644  __webpack_require__.d(selectors_namespaceObject, "getFormatTypes", function() { return getFormatTypes; });
 645  __webpack_require__.d(selectors_namespaceObject, "getFormatType", function() { return getFormatType; });
 646  __webpack_require__.d(selectors_namespaceObject, "getFormatTypeForBareElement", function() { return getFormatTypeForBareElement; });
 647  __webpack_require__.d(selectors_namespaceObject, "getFormatTypeForClassName", function() { return getFormatTypeForClassName; });
 648  
 649  // NAMESPACE OBJECT: ./node_modules/@wordpress/rich-text/build-module/store/actions.js
 650  var actions_namespaceObject = {};
 651  __webpack_require__.r(actions_namespaceObject);
 652  __webpack_require__.d(actions_namespaceObject, "addFormatTypes", function() { return addFormatTypes; });
 653  __webpack_require__.d(actions_namespaceObject, "removeFormatTypes", function() { return removeFormatTypes; });
 654  
 655  // EXTERNAL MODULE: external {"this":["wp","data"]}
 656  var external_this_wp_data_ = __webpack_require__(4);
 657  
 658  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 659  var defineProperty = __webpack_require__(5);
 660  
 661  // EXTERNAL MODULE: external {"this":"lodash"}
 662  var external_this_lodash_ = __webpack_require__(2);
 663  
 664  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/reducer.js
 665  
 666  
 667  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
 668  
 669  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
 670  
 671  /**
 672   * External dependencies
 673   */
 674  
 675  /**
 676   * WordPress dependencies
 677   */
 678  
 679  
 680  /**
 681   * Reducer managing the format types
 682   *
 683   * @param {Object} state  Current state.
 684   * @param {Object} action Dispatched action.
 685   *
 686   * @return {Object} Updated state.
 687   */
 688  
 689  function reducer_formatTypes() {
 690    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 691    var action = arguments.length > 1 ? arguments[1] : undefined;
 692  
 693    switch (action.type) {
 694      case 'ADD_FORMAT_TYPES':
 695        return _objectSpread(_objectSpread({}, state), Object(external_this_lodash_["keyBy"])(action.formatTypes, 'name'));
 696  
 697      case 'REMOVE_FORMAT_TYPES':
 698        return Object(external_this_lodash_["omit"])(state, action.names);
 699    }
 700  
 701    return state;
 702  }
 703  /* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({
 704    formatTypes: reducer_formatTypes
 705  }));
 706  
 707  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
 708  var rememo = __webpack_require__(42);
 709  
 710  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/selectors.js
 711  /**
 712   * External dependencies
 713   */
 714  
 715  
 716  /**
 717   * Returns all the available format types.
 718   *
 719   * @param {Object} state Data state.
 720   *
 721   * @return {Array} Format types.
 722   */
 723  
 724  var getFormatTypes = Object(rememo["a" /* default */])(function (state) {
 725    return Object.values(state.formatTypes);
 726  }, function (state) {
 727    return [state.formatTypes];
 728  });
 729  /**
 730   * Returns a format type by name.
 731   *
 732   * @param {Object} state Data state.
 733   * @param {string} name Format type name.
 734   *
 735   * @return {Object?} Format type.
 736   */
 737  
 738  function getFormatType(state, name) {
 739    return state.formatTypes[name];
 740  }
 741  /**
 742   * Gets the format type, if any, that can handle a bare element (without a
 743   * data-format-type attribute), given the tag name of this element.
 744   *
 745   * @param {Object} state              Data state.
 746   * @param {string} bareElementTagName The tag name of the element to find a
 747   *                                    format type for.
 748   * @return {?Object} Format type.
 749   */
 750  
 751  function getFormatTypeForBareElement(state, bareElementTagName) {
 752    return Object(external_this_lodash_["find"])(getFormatTypes(state), function (_ref) {
 753      var className = _ref.className,
 754          tagName = _ref.tagName;
 755      return className === null && bareElementTagName === tagName;
 756    });
 757  }
 758  /**
 759   * Gets the format type, if any, that can handle an element, given its classes.
 760   *
 761   * @param {Object} state            Data state.
 762   * @param {string} elementClassName The classes of the element to find a format
 763   *                                  type for.
 764   * @return {?Object} Format type.
 765   */
 766  
 767  function getFormatTypeForClassName(state, elementClassName) {
 768    return Object(external_this_lodash_["find"])(getFormatTypes(state), function (_ref2) {
 769      var className = _ref2.className;
 770  
 771      if (className === null) {
 772        return false;
 773      }
 774  
 775      return " ".concat(elementClassName, " ").indexOf(" ".concat(className, " ")) >= 0;
 776    });
 777  }
 778  
 779  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/actions.js
 780  /**
 781   * External dependencies
 782   */
 783  
 784  /**
 785   * Returns an action object used in signalling that format types have been
 786   * added.
 787   *
 788   * @param {Array|Object} formatTypes Format types received.
 789   *
 790   * @return {Object} Action object.
 791   */
 792  
 793  function addFormatTypes(formatTypes) {
 794    return {
 795      type: 'ADD_FORMAT_TYPES',
 796      formatTypes: Object(external_this_lodash_["castArray"])(formatTypes)
 797    };
 798  }
 799  /**
 800   * Returns an action object used to remove a registered format type.
 801   *
 802   * @param {string|Array} names Format name.
 803   *
 804   * @return {Object} Action object.
 805   */
 806  
 807  function removeFormatTypes(names) {
 808    return {
 809      type: 'REMOVE_FORMAT_TYPES',
 810      names: Object(external_this_lodash_["castArray"])(names)
 811    };
 812  }
 813  
 814  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/store/index.js
 815  /**
 816   * WordPress dependencies
 817   */
 818  
 819  /**
 820   * Internal dependencies
 821   */
 822  
 823  
 824  
 825  
 826  Object(external_this_wp_data_["registerStore"])('core/rich-text', {
 827    reducer: reducer,
 828    selectors: selectors_namespaceObject,
 829    actions: actions_namespaceObject
 830  });
 831  
 832  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
 833  var toConsumableArray = __webpack_require__(17);
 834  
 835  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-format-equal.js
 836  /** @typedef {import('./create').RichTextFormat} RichTextFormat */
 837  
 838  /**
 839   * Optimised equality check for format objects.
 840   *
 841   * @param {?RichTextFormat} format1 Format to compare.
 842   * @param {?RichTextFormat} format2 Format to compare.
 843   *
 844   * @return {boolean} True if formats are equal, false if not.
 845   */
 846  function isFormatEqual(format1, format2) {
 847    // Both not defined.
 848    if (format1 === format2) {
 849      return true;
 850    } // Either not defined.
 851  
 852  
 853    if (!format1 || !format2) {
 854      return false;
 855    }
 856  
 857    if (format1.type !== format2.type) {
 858      return false;
 859    }
 860  
 861    var attributes1 = format1.attributes;
 862    var attributes2 = format2.attributes; // Both not defined.
 863  
 864    if (attributes1 === attributes2) {
 865      return true;
 866    } // Either not defined.
 867  
 868  
 869    if (!attributes1 || !attributes2) {
 870      return false;
 871    }
 872  
 873    var keys1 = Object.keys(attributes1);
 874    var keys2 = Object.keys(attributes2);
 875  
 876    if (keys1.length !== keys2.length) {
 877      return false;
 878    }
 879  
 880    var length = keys1.length; // Optimise for speed.
 881  
 882    for (var i = 0; i < length; i++) {
 883      var name = keys1[i];
 884  
 885      if (attributes1[name] !== attributes2[name]) {
 886        return false;
 887      }
 888    }
 889  
 890    return true;
 891  }
 892  
 893  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/normalise-formats.js
 894  
 895  
 896  function normalise_formats_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
 897  
 898  function normalise_formats_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { normalise_formats_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { normalise_formats_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
 899  
 900  /**
 901   * Internal dependencies
 902   */
 903  
 904  /** @typedef {import('./create').RichTextValue} RichTextValue */
 905  
 906  /**
 907   * Normalises formats: ensures subsequent adjacent equal formats have the same
 908   * reference.
 909   *
 910   * @param {RichTextValue} value Value to normalise formats of.
 911   *
 912   * @return {RichTextValue} New value with normalised formats.
 913   */
 914  
 915  function normaliseFormats(value) {
 916    var newFormats = value.formats.slice();
 917    newFormats.forEach(function (formatsAtIndex, index) {
 918      var formatsAtPreviousIndex = newFormats[index - 1];
 919  
 920      if (formatsAtPreviousIndex) {
 921        var newFormatsAtIndex = formatsAtIndex.slice();
 922        newFormatsAtIndex.forEach(function (format, formatIndex) {
 923          var previousFormat = formatsAtPreviousIndex[formatIndex];
 924  
 925          if (isFormatEqual(format, previousFormat)) {
 926            newFormatsAtIndex[formatIndex] = previousFormat;
 927          }
 928        });
 929        newFormats[index] = newFormatsAtIndex;
 930      }
 931    });
 932    return normalise_formats_objectSpread(normalise_formats_objectSpread({}, value), {}, {
 933      formats: newFormats
 934    });
 935  }
 936  
 937  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/apply-format.js
 938  
 939  
 940  
 941  function apply_format_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
 942  
 943  function apply_format_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { apply_format_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { apply_format_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
 944  
 945  /**
 946   * External dependencies
 947   */
 948  
 949  /**
 950   * Internal dependencies
 951   */
 952  
 953  
 954  /** @typedef {import('./create').RichTextValue} RichTextValue */
 955  
 956  /** @typedef {import('./create').RichTextFormat} RichTextFormat */
 957  
 958  function replace(array, index, value) {
 959    array = array.slice();
 960    array[index] = value;
 961    return array;
 962  }
 963  /**
 964   * Apply a format object to a Rich Text value from the given `startIndex` to the
 965   * given `endIndex`. Indices are retrieved from the selection if none are
 966   * provided.
 967   *
 968   * @param {RichTextValue}  value        Value to modify.
 969   * @param {RichTextFormat} format       Format to apply.
 970   * @param {number}         [startIndex] Start index.
 971   * @param {number}         [endIndex]   End index.
 972   *
 973   * @return {RichTextValue} A new value with the format applied.
 974   */
 975  
 976  
 977  function applyFormat(value, format) {
 978    var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
 979    var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
 980    var formats = value.formats,
 981        activeFormats = value.activeFormats;
 982    var newFormats = formats.slice(); // The selection is collapsed.
 983  
 984    if (startIndex === endIndex) {
 985      var startFormat = Object(external_this_lodash_["find"])(newFormats[startIndex], {
 986        type: format.type
 987      }); // If the caret is at a format of the same type, expand start and end to
 988      // the edges of the format. This is useful to apply new attributes.
 989  
 990      if (startFormat) {
 991        var index = newFormats[startIndex].indexOf(startFormat);
 992  
 993        while (newFormats[startIndex] && newFormats[startIndex][index] === startFormat) {
 994          newFormats[startIndex] = replace(newFormats[startIndex], index, format);
 995          startIndex--;
 996        }
 997  
 998        endIndex++;
 999  
1000        while (newFormats[endIndex] && newFormats[endIndex][index] === startFormat) {
1001          newFormats[endIndex] = replace(newFormats[endIndex], index, format);
1002          endIndex++;
1003        }
1004      }
1005    } else {
1006      // Determine the highest position the new format can be inserted at.
1007      var position = +Infinity;
1008  
1009      for (var _index = startIndex; _index < endIndex; _index++) {
1010        if (newFormats[_index]) {
1011          newFormats[_index] = newFormats[_index].filter(function (_ref) {
1012            var type = _ref.type;
1013            return type !== format.type;
1014          });
1015          var length = newFormats[_index].length;
1016  
1017          if (length < position) {
1018            position = length;
1019          }
1020        } else {
1021          newFormats[_index] = [];
1022          position = 0;
1023        }
1024      }
1025  
1026      for (var _index2 = startIndex; _index2 < endIndex; _index2++) {
1027        newFormats[_index2].splice(position, 0, format);
1028      }
1029    }
1030  
1031    return normaliseFormats(apply_format_objectSpread(apply_format_objectSpread({}, value), {}, {
1032      formats: newFormats,
1033      // Always revise active formats. This serves as a placeholder for new
1034      // inputs with the format so new input appears with the format applied,
1035      // and ensures a format of the same type uses the latest values.
1036      activeFormats: [].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["reject"])(activeFormats, {
1037        type: format.type
1038      })), [format])
1039    }));
1040  }
1041  
1042  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
1043  var esm_typeof = __webpack_require__(40);
1044  
1045  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/create-element.js
1046  /**
1047   * Parse the given HTML into a body element.
1048   *
1049   * Note: The current implementation will return a shared reference, reset on
1050   * each call to `createElement`. Therefore, you should not hold a reference to
1051   * the value to operate upon asynchronously, as it may have unexpected results.
1052   *
1053   * @param {HTMLDocument} document The HTML document to use to parse.
1054   * @param {string}       html     The HTML to parse.
1055   *
1056   * @return {HTMLBodyElement} Body element with parsed HTML.
1057   */
1058  function createElement(_ref, html) {
1059    var implementation = _ref.implementation;
1060  
1061    // Because `createHTMLDocument` is an expensive operation, and with this
1062    // function being internal to `rich-text` (full control in avoiding a risk
1063    // of asynchronous operations on the shared reference), a single document
1064    // is reused and reset for each call to the function.
1065    if (!createElement.body) {
1066      createElement.body = implementation.createHTMLDocument('').body;
1067    }
1068  
1069    createElement.body.innerHTML = html;
1070    return createElement.body;
1071  }
1072  
1073  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/special-characters.js
1074  /**
1075   * Line separator character, used for multiline text.
1076   */
1077  var LINE_SEPARATOR = "\u2028";
1078  /**
1079   * Object replacement character, used as a placeholder for objects.
1080   */
1081  
1082  var OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
1083  /**
1084   * Zero width non-breaking space, used as padding in the editable DOM tree when
1085   * it is empty otherwise.
1086   */
1087  
1088  var ZWNBSP = "\uFEFF";
1089  
1090  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/create.js
1091  
1092  
1093  
1094  
1095  function create_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
1096  
1097  function create_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { create_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { create_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1098  
1099  /**
1100   * WordPress dependencies
1101   */
1102  
1103  /**
1104   * Internal dependencies
1105   */
1106  
1107  
1108  
1109  
1110  
1111  /**
1112   * @typedef {Object} RichTextFormat
1113   *
1114   * @property {string} type Format type.
1115   */
1116  
1117  /**
1118   * @typedef {Array<RichTextFormat>} RichTextFormatList
1119   */
1120  
1121  /**
1122   * @typedef {Object} RichTextValue
1123   *
1124   * @property {string}                    text         Text.
1125   * @property {Array<RichTextFormatList>} formats      Formats.
1126   * @property {Array<RichTextFormat>}     replacements Replacements.
1127   * @property {number|undefined}          start        Selection start.
1128   * @property {number|undefined}          end          Selection end.
1129   */
1130  
1131  function createEmptyValue() {
1132    return {
1133      formats: [],
1134      replacements: [],
1135      text: ''
1136    };
1137  }
1138  
1139  function simpleFindKey(object, value) {
1140    for (var key in object) {
1141      if (object[key] === value) {
1142        return key;
1143      }
1144    }
1145  }
1146  
1147  function toFormat(_ref) {
1148    var type = _ref.type,
1149        attributes = _ref.attributes;
1150    var formatType;
1151  
1152    if (attributes && attributes.class) {
1153      formatType = Object(external_this_wp_data_["select"])('core/rich-text').getFormatTypeForClassName(attributes.class);
1154  
1155      if (formatType) {
1156        // Preserve any additional classes.
1157        attributes.class = " ".concat(attributes.class, " ").replace(" ".concat(formatType.className, " "), ' ').trim();
1158  
1159        if (!attributes.class) {
1160          delete attributes.class;
1161        }
1162      }
1163    }
1164  
1165    if (!formatType) {
1166      formatType = Object(external_this_wp_data_["select"])('core/rich-text').getFormatTypeForBareElement(type);
1167    }
1168  
1169    if (!formatType) {
1170      return attributes ? {
1171        type: type,
1172        attributes: attributes
1173      } : {
1174        type: type
1175      };
1176    }
1177  
1178    if (formatType.__experimentalCreatePrepareEditableTree && !formatType.__experimentalCreateOnChangeEditableValue) {
1179      return null;
1180    }
1181  
1182    if (!attributes) {
1183      return {
1184        type: formatType.name
1185      };
1186    }
1187  
1188    var registeredAttributes = {};
1189    var unregisteredAttributes = {};
1190  
1191    for (var name in attributes) {
1192      var key = simpleFindKey(formatType.attributes, name);
1193  
1194      if (key) {
1195        registeredAttributes[key] = attributes[name];
1196      } else {
1197        unregisteredAttributes[name] = attributes[name];
1198      }
1199    }
1200  
1201    return {
1202      type: formatType.name,
1203      attributes: registeredAttributes,
1204      unregisteredAttributes: unregisteredAttributes
1205    };
1206  }
1207  /**
1208   * Create a RichText value from an `Element` tree (DOM), an HTML string or a
1209   * plain text string, with optionally a `Range` object to set the selection. If
1210   * called without any input, an empty value will be created. If
1211   * `multilineTag` is provided, any content of direct children whose type matches
1212   * `multilineTag` will be separated by two newlines. The optional functions can
1213   * be used to filter out content.
1214   *
1215   * A value will have the following shape, which you are strongly encouraged not
1216   * to modify without the use of helper functions:
1217   *
1218   * ```js
1219   * {
1220   *   text: string,
1221   *   formats: Array,
1222   *   replacements: Array,
1223   *   ?start: number,
1224   *   ?end: number,
1225   * }
1226   * ```
1227   *
1228   * As you can see, text and formatting are separated. `text` holds the text,
1229   * including any replacement characters for objects and lines. `formats`,
1230   * `objects` and `lines` are all sparse arrays of the same length as `text`. It
1231   * holds information about the formatting at the relevant text indices. Finally
1232   * `start` and `end` state which text indices are selected. They are only
1233   * provided if a `Range` was given.
1234   *
1235   * @param {Object}  [$1]                      Optional named arguments.
1236   * @param {Element} [$1.element]              Element to create value from.
1237   * @param {string}  [$1.text]                 Text to create value from.
1238   * @param {string}  [$1.html]                 HTML to create value from.
1239   * @param {Range}   [$1.range]                Range to create value from.
1240   * @param {string}  [$1.multilineTag]         Multiline tag if the structure is
1241   *                                            multiline.
1242   * @param {Array}   [$1.multilineWrapperTags] Tags where lines can be found if
1243   *                                            nesting is possible.
1244   * @param {boolean} [$1.preserveWhiteSpace]   Whether or not to collapse white
1245   *                                            space characters.
1246   * @param {boolean} [$1.__unstableIsEditableTree]
1247   *
1248   * @return {RichTextValue} A rich text value.
1249   */
1250  
1251  
1252  function create() {
1253    var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1254        element = _ref2.element,
1255        text = _ref2.text,
1256        html = _ref2.html,
1257        range = _ref2.range,
1258        multilineTag = _ref2.multilineTag,
1259        multilineWrapperTags = _ref2.multilineWrapperTags,
1260        isEditableTree = _ref2.__unstableIsEditableTree,
1261        preserveWhiteSpace = _ref2.preserveWhiteSpace;
1262  
1263    if (typeof text === 'string' && text.length > 0) {
1264      return {
1265        formats: Array(text.length),
1266        replacements: Array(text.length),
1267        text: text
1268      };
1269    }
1270  
1271    if (typeof html === 'string' && html.length > 0) {
1272      // It does not matter which document this is, we're just using it to
1273      // parse.
1274      element = createElement(document, html);
1275    }
1276  
1277    if (Object(esm_typeof["a" /* default */])(element) !== 'object') {
1278      return createEmptyValue();
1279    }
1280  
1281    if (!multilineTag) {
1282      return createFromElement({
1283        element: element,
1284        range: range,
1285        isEditableTree: isEditableTree,
1286        preserveWhiteSpace: preserveWhiteSpace
1287      });
1288    }
1289  
1290    return createFromMultilineElement({
1291      element: element,
1292      range: range,
1293      multilineTag: multilineTag,
1294      multilineWrapperTags: multilineWrapperTags,
1295      isEditableTree: isEditableTree,
1296      preserveWhiteSpace: preserveWhiteSpace
1297    });
1298  }
1299  /**
1300   * Helper to accumulate the value's selection start and end from the current
1301   * node and range.
1302   *
1303   * @param {Object} accumulator Object to accumulate into.
1304   * @param {Node}   node        Node to create value with.
1305   * @param {Range}  range       Range to create value with.
1306   * @param {Object} value       Value that is being accumulated.
1307   */
1308  
1309  function accumulateSelection(accumulator, node, range, value) {
1310    if (!range) {
1311      return;
1312    }
1313  
1314    var parentNode = node.parentNode;
1315    var startContainer = range.startContainer,
1316        startOffset = range.startOffset,
1317        endContainer = range.endContainer,
1318        endOffset = range.endOffset;
1319    var currentLength = accumulator.text.length; // Selection can be extracted from value.
1320  
1321    if (value.start !== undefined) {
1322      accumulator.start = currentLength + value.start; // Range indicates that the current node has selection.
1323    } else if (node === startContainer && node.nodeType === node.TEXT_NODE) {
1324      accumulator.start = currentLength + startOffset; // Range indicates that the current node is selected.
1325    } else if (parentNode === startContainer && node === startContainer.childNodes[startOffset]) {
1326      accumulator.start = currentLength; // Range indicates that the selection is after the current node.
1327    } else if (parentNode === startContainer && node === startContainer.childNodes[startOffset - 1]) {
1328      accumulator.start = currentLength + value.text.length; // Fallback if no child inside handled the selection.
1329    } else if (node === startContainer) {
1330      accumulator.start = currentLength;
1331    } // Selection can be extracted from value.
1332  
1333  
1334    if (value.end !== undefined) {
1335      accumulator.end = currentLength + value.end; // Range indicates that the current node has selection.
1336    } else if (node === endContainer && node.nodeType === node.TEXT_NODE) {
1337      accumulator.end = currentLength + endOffset; // Range indicates that the current node is selected.
1338    } else if (parentNode === endContainer && node === endContainer.childNodes[endOffset - 1]) {
1339      accumulator.end = currentLength + value.text.length; // Range indicates that the selection is before the current node.
1340    } else if (parentNode === endContainer && node === endContainer.childNodes[endOffset]) {
1341      accumulator.end = currentLength; // Fallback if no child inside handled the selection.
1342    } else if (node === endContainer) {
1343      accumulator.end = currentLength + endOffset;
1344    }
1345  }
1346  /**
1347   * Adjusts the start and end offsets from a range based on a text filter.
1348   *
1349   * @param {Node}     node   Node of which the text should be filtered.
1350   * @param {Range}    range  The range to filter.
1351   * @param {Function} filter Function to use to filter the text.
1352   *
1353   * @return {Object|void} Object containing range properties.
1354   */
1355  
1356  
1357  function filterRange(node, range, filter) {
1358    if (!range) {
1359      return;
1360    }
1361  
1362    var startContainer = range.startContainer,
1363        endContainer = range.endContainer;
1364    var startOffset = range.startOffset,
1365        endOffset = range.endOffset;
1366  
1367    if (node === startContainer) {
1368      startOffset = filter(node.nodeValue.slice(0, startOffset)).length;
1369    }
1370  
1371    if (node === endContainer) {
1372      endOffset = filter(node.nodeValue.slice(0, endOffset)).length;
1373    }
1374  
1375    return {
1376      startContainer: startContainer,
1377      startOffset: startOffset,
1378      endContainer: endContainer,
1379      endOffset: endOffset
1380    };
1381  }
1382  /**
1383   * Collapse any whitespace used for HTML formatting to one space character,
1384   * because it will also be displayed as such by the browser.
1385   *
1386   * @param {string} string
1387   */
1388  
1389  
1390  function collapseWhiteSpace(string) {
1391    return string.replace(/[\n\r\t]+/g, ' ');
1392  }
1393  
1394  var ZWNBSPRegExp = new RegExp(ZWNBSP, 'g');
1395  /**
1396   * Removes padding (zero width non breaking spaces) added by `toTree`.
1397   *
1398   * @param {string} string
1399   */
1400  
1401  function removePadding(string) {
1402    return string.replace(ZWNBSPRegExp, '');
1403  }
1404  /**
1405   * Creates a Rich Text value from a DOM element and range.
1406   *
1407   * @param {Object}  $1                        Named argements.
1408   * @param {Element} [$1.element]              Element to create value from.
1409   * @param {Range}   [$1.range]                Range to create value from.
1410   * @param {string}  [$1.multilineTag]         Multiline tag if the structure is
1411   *                                            multiline.
1412   * @param {Array}   [$1.multilineWrapperTags] Tags where lines can be found if
1413   *                                            nesting is possible.
1414   * @param {boolean} [$1.preserveWhiteSpace]   Whether or not to collapse white
1415   *                                            space characters.
1416   * @param {Array}   [$1.currentWrapperTags]
1417   * @param {boolean} [$1.isEditableTree]
1418   *
1419   * @return {RichTextValue} A rich text value.
1420   */
1421  
1422  
1423  function createFromElement(_ref3) {
1424    var element = _ref3.element,
1425        range = _ref3.range,
1426        multilineTag = _ref3.multilineTag,
1427        multilineWrapperTags = _ref3.multilineWrapperTags,
1428        _ref3$currentWrapperT = _ref3.currentWrapperTags,
1429        currentWrapperTags = _ref3$currentWrapperT === void 0 ? [] : _ref3$currentWrapperT,
1430        isEditableTree = _ref3.isEditableTree,
1431        preserveWhiteSpace = _ref3.preserveWhiteSpace;
1432    var accumulator = createEmptyValue();
1433  
1434    if (!element) {
1435      return accumulator;
1436    }
1437  
1438    if (!element.hasChildNodes()) {
1439      accumulateSelection(accumulator, element, range, createEmptyValue());
1440      return accumulator;
1441    }
1442  
1443    var length = element.childNodes.length; // Optimise for speed.
1444  
1445    var _loop = function _loop(index) {
1446      var node = element.childNodes[index];
1447      var type = node.nodeName.toLowerCase();
1448  
1449      if (node.nodeType === node.TEXT_NODE) {
1450        var filter = removePadding;
1451  
1452        if (!preserveWhiteSpace) {
1453          filter = function filter(string) {
1454            return removePadding(collapseWhiteSpace(string));
1455          };
1456        }
1457  
1458        var text = filter(node.nodeValue);
1459        range = filterRange(node, range, filter);
1460        accumulateSelection(accumulator, node, range, {
1461          text: text
1462        }); // Create a sparse array of the same length as `text`, in which
1463        // formats can be added.
1464  
1465        accumulator.formats.length += text.length;
1466        accumulator.replacements.length += text.length;
1467        accumulator.text += text;
1468        return "continue";
1469      }
1470  
1471      if (node.nodeType !== node.ELEMENT_NODE) {
1472        return "continue";
1473      }
1474  
1475      if (isEditableTree && ( // Ignore any placeholders.
1476      node.getAttribute('data-rich-text-placeholder') || // Ignore any line breaks that are not inserted by us.
1477      type === 'br' && !node.getAttribute('data-rich-text-line-break'))) {
1478        accumulateSelection(accumulator, node, range, createEmptyValue());
1479        return "continue";
1480      }
1481  
1482      if (type === 'br') {
1483        accumulateSelection(accumulator, node, range, createEmptyValue());
1484        mergePair(accumulator, create({
1485          text: '\n'
1486        }));
1487        return "continue";
1488      }
1489  
1490      var lastFormats = accumulator.formats[accumulator.formats.length - 1];
1491      var lastFormat = lastFormats && lastFormats[lastFormats.length - 1];
1492      var newFormat = toFormat({
1493        type: type,
1494        attributes: getAttributes({
1495          element: node
1496        })
1497      });
1498      var format = isFormatEqual(newFormat, lastFormat) ? lastFormat : newFormat;
1499  
1500      if (multilineWrapperTags && multilineWrapperTags.indexOf(type) !== -1) {
1501        var _value = createFromMultilineElement({
1502          element: node,
1503          range: range,
1504          multilineTag: multilineTag,
1505          multilineWrapperTags: multilineWrapperTags,
1506          currentWrapperTags: [].concat(Object(toConsumableArray["a" /* default */])(currentWrapperTags), [format]),
1507          isEditableTree: isEditableTree,
1508          preserveWhiteSpace: preserveWhiteSpace
1509        });
1510  
1511        accumulateSelection(accumulator, node, range, _value);
1512        mergePair(accumulator, _value);
1513        return "continue";
1514      }
1515  
1516      var value = createFromElement({
1517        element: node,
1518        range: range,
1519        multilineTag: multilineTag,
1520        multilineWrapperTags: multilineWrapperTags,
1521        isEditableTree: isEditableTree,
1522        preserveWhiteSpace: preserveWhiteSpace
1523      });
1524      accumulateSelection(accumulator, node, range, value);
1525  
1526      if (!format) {
1527        mergePair(accumulator, value);
1528      } else if (value.text.length === 0) {
1529        if (format.attributes) {
1530          mergePair(accumulator, {
1531            formats: [,],
1532            replacements: [format],
1533            text: OBJECT_REPLACEMENT_CHARACTER
1534          });
1535        }
1536      } else {
1537        // Indices should share a reference to the same formats array.
1538        // Only create a new reference if `formats` changes.
1539        function mergeFormats(formats) {
1540          if (mergeFormats.formats === formats) {
1541            return mergeFormats.newFormats;
1542          }
1543  
1544          var newFormats = formats ? [format].concat(Object(toConsumableArray["a" /* default */])(formats)) : [format];
1545          mergeFormats.formats = formats;
1546          mergeFormats.newFormats = newFormats;
1547          return newFormats;
1548        } // Since the formats parameter can be `undefined`, preset
1549        // `mergeFormats` with a new reference.
1550  
1551  
1552        mergeFormats.newFormats = [format];
1553        mergePair(accumulator, create_objectSpread(create_objectSpread({}, value), {}, {
1554          formats: Array.from(value.formats, mergeFormats)
1555        }));
1556      }
1557    };
1558  
1559    for (var index = 0; index < length; index++) {
1560      var _ret = _loop(index);
1561  
1562      if (_ret === "continue") continue;
1563    }
1564  
1565    return accumulator;
1566  }
1567  /**
1568   * Creates a rich text value from a DOM element and range that should be
1569   * multiline.
1570   *
1571   * @param {Object}  $1                        Named argements.
1572   * @param {Element} [$1.element]              Element to create value from.
1573   * @param {Range}   [$1.range]                Range to create value from.
1574   * @param {string}  [$1.multilineTag]         Multiline tag if the structure is
1575   *                                            multiline.
1576   * @param {Array}   [$1.multilineWrapperTags] Tags where lines can be found if
1577   *                                            nesting is possible.
1578   * @param {boolean} [$1.currentWrapperTags]   Whether to prepend a line
1579   *                                            separator.
1580   * @param {boolean} [$1.preserveWhiteSpace]   Whether or not to collapse white
1581   *                                            space characters.
1582   * @param {boolean} [$1.isEditableTree]
1583   *
1584   * @return {RichTextValue} A rich text value.
1585   */
1586  
1587  
1588  function createFromMultilineElement(_ref4) {
1589    var element = _ref4.element,
1590        range = _ref4.range,
1591        multilineTag = _ref4.multilineTag,
1592        multilineWrapperTags = _ref4.multilineWrapperTags,
1593        _ref4$currentWrapperT = _ref4.currentWrapperTags,
1594        currentWrapperTags = _ref4$currentWrapperT === void 0 ? [] : _ref4$currentWrapperT,
1595        isEditableTree = _ref4.isEditableTree,
1596        preserveWhiteSpace = _ref4.preserveWhiteSpace;
1597    var accumulator = createEmptyValue();
1598  
1599    if (!element || !element.hasChildNodes()) {
1600      return accumulator;
1601    }
1602  
1603    var length = element.children.length; // Optimise for speed.
1604  
1605    for (var index = 0; index < length; index++) {
1606      var node = element.children[index];
1607  
1608      if (node.nodeName.toLowerCase() !== multilineTag) {
1609        continue;
1610      }
1611  
1612      var value = createFromElement({
1613        element: node,
1614        range: range,
1615        multilineTag: multilineTag,
1616        multilineWrapperTags: multilineWrapperTags,
1617        currentWrapperTags: currentWrapperTags,
1618        isEditableTree: isEditableTree,
1619        preserveWhiteSpace: preserveWhiteSpace
1620      }); // Multiline value text should be separated by a line separator.
1621  
1622      if (index !== 0 || currentWrapperTags.length > 0) {
1623        mergePair(accumulator, {
1624          formats: [,],
1625          replacements: currentWrapperTags.length > 0 ? [currentWrapperTags] : [,],
1626          text: LINE_SEPARATOR
1627        });
1628      }
1629  
1630      accumulateSelection(accumulator, node, range, value);
1631      mergePair(accumulator, value);
1632    }
1633  
1634    return accumulator;
1635  }
1636  /**
1637   * Gets the attributes of an element in object shape.
1638   *
1639   * @param {Object}  $1         Named argements.
1640   * @param {Element} $1.element Element to get attributes from.
1641   *
1642   * @return {Object|void} Attribute object or `undefined` if the element has no
1643   *                       attributes.
1644   */
1645  
1646  
1647  function getAttributes(_ref5) {
1648    var element = _ref5.element;
1649  
1650    if (!element.hasAttributes()) {
1651      return;
1652    }
1653  
1654    var length = element.attributes.length;
1655    var accumulator; // Optimise for speed.
1656  
1657    for (var i = 0; i < length; i++) {
1658      var _element$attributes$i = element.attributes[i],
1659          name = _element$attributes$i.name,
1660          value = _element$attributes$i.value;
1661  
1662      if (name.indexOf('data-rich-text-') === 0) {
1663        continue;
1664      }
1665  
1666      accumulator = accumulator || {};
1667      accumulator[name] = value;
1668    }
1669  
1670    return accumulator;
1671  }
1672  
1673  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/concat.js
1674  /**
1675   * Internal dependencies
1676   */
1677  
1678  
1679  /** @typedef {import('./create').RichTextValue} RichTextValue */
1680  
1681  /**
1682   * Concats a pair of rich text values. Not that this mutates `a` and does NOT
1683   * normalise formats!
1684   *
1685   * @param {Object} a Value to mutate.
1686   * @param {Object} b Value to add read from.
1687   *
1688   * @return {Object} `a`, mutated.
1689   */
1690  
1691  function mergePair(a, b) {
1692    a.formats = a.formats.concat(b.formats);
1693    a.replacements = a.replacements.concat(b.replacements);
1694    a.text += b.text;
1695    return a;
1696  }
1697  /**
1698   * Combine all Rich Text values into one. This is similar to
1699   * `String.prototype.concat`.
1700   *
1701   * @param {...RichTextValue} values Objects to combine.
1702   *
1703   * @return {RichTextValue} A new value combining all given records.
1704   */
1705  
1706  function concat() {
1707    for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
1708      values[_key] = arguments[_key];
1709    }
1710  
1711    return normaliseFormats(values.reduce(mergePair, create()));
1712  }
1713  
1714  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-active-formats.js
1715  /** @typedef {import('./create').RichTextValue} RichTextValue */
1716  
1717  /** @typedef {import('./create').RichTextFormatList} RichTextFormatList */
1718  
1719  /**
1720   * Gets the all format objects at the start of the selection.
1721   *
1722   * @param {RichTextValue} value                Value to inspect.
1723   * @param {Array}         EMPTY_ACTIVE_FORMATS Array to return if there are no
1724   *                                             active formats.
1725   *
1726   * @return {RichTextFormatList} Active format objects.
1727   */
1728  function getActiveFormats(_ref) {
1729    var formats = _ref.formats,
1730        start = _ref.start,
1731        end = _ref.end,
1732        activeFormats = _ref.activeFormats;
1733    var EMPTY_ACTIVE_FORMATS = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1734  
1735    if (start === undefined) {
1736      return EMPTY_ACTIVE_FORMATS;
1737    }
1738  
1739    if (start === end) {
1740      // For a collapsed caret, it is possible to override the active formats.
1741      if (activeFormats) {
1742        return activeFormats;
1743      }
1744  
1745      var formatsBefore = formats[start - 1] || EMPTY_ACTIVE_FORMATS;
1746      var formatsAfter = formats[start] || EMPTY_ACTIVE_FORMATS; // By default, select the lowest amount of formats possible (which means
1747      // the caret is positioned outside the format boundary). The user can
1748      // then use arrow keys to define `activeFormats`.
1749  
1750      if (formatsBefore.length < formatsAfter.length) {
1751        return formatsBefore;
1752      }
1753  
1754      return formatsAfter;
1755    }
1756  
1757    return formats[start] || EMPTY_ACTIVE_FORMATS;
1758  }
1759  
1760  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-active-format.js
1761  /**
1762   * External dependencies
1763   */
1764  
1765  /**
1766   * Internal dependencies
1767   */
1768  
1769  
1770  /** @typedef {import('./create').RichTextValue} RichTextValue */
1771  
1772  /** @typedef {import('./create').RichTextFormat} RichTextFormat */
1773  
1774  /**
1775   * Gets the format object by type at the start of the selection. This can be
1776   * used to get e.g. the URL of a link format at the current selection, but also
1777   * to check if a format is active at the selection. Returns undefined if there
1778   * is no format at the selection.
1779   *
1780   * @param {RichTextValue} value      Value to inspect.
1781   * @param {string}        formatType Format type to look for.
1782   *
1783   * @return {RichTextFormat|undefined} Active format object of the specified
1784   *                                    type, or undefined.
1785   */
1786  
1787  function getActiveFormat(value, formatType) {
1788    return Object(external_this_lodash_["find"])(getActiveFormats(value), {
1789      type: formatType
1790    });
1791  }
1792  
1793  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-active-object.js
1794  /**
1795   * Internal dependencies
1796   */
1797  
1798  /** @typedef {import('./create').RichTextValue} RichTextValue */
1799  
1800  /** @typedef {import('./create').RichTextFormat} RichTextFormat */
1801  
1802  /**
1803   * Gets the active object, if there is any.
1804   *
1805   * @param {RichTextValue} value Value to inspect.
1806   *
1807   * @return {RichTextFormat|void} Active object, or undefined.
1808   */
1809  
1810  function getActiveObject(_ref) {
1811    var start = _ref.start,
1812        end = _ref.end,
1813        replacements = _ref.replacements,
1814        text = _ref.text;
1815  
1816    if (start + 1 !== end || text[start] !== OBJECT_REPLACEMENT_CHARACTER) {
1817      return;
1818    }
1819  
1820    return replacements[start];
1821  }
1822  
1823  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-text-content.js
1824  /** @typedef {import('./create').RichTextValue} RichTextValue */
1825  
1826  /**
1827   * Get the textual content of a Rich Text value. This is similar to
1828   * `Element.textContent`.
1829   *
1830   * @param {RichTextValue} value Value to use.
1831   *
1832   * @return {string} The text content.
1833   */
1834  function getTextContent(_ref) {
1835    var text = _ref.text;
1836    return text;
1837  }
1838  
1839  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-line-index.js
1840  /**
1841   * Internal dependencies
1842   */
1843  
1844  /** @typedef {import('./create').RichTextValue} RichTextValue */
1845  
1846  /**
1847   * Gets the currently selected line index, or the first line index if the
1848   * selection spans over multiple items.
1849   *
1850   * @param {RichTextValue}  value      Value to get the line index from.
1851   * @param {boolean}        startIndex Optional index that should be contained by
1852   *                                    the line. Defaults to the selection start
1853   *                                    of the value.
1854   *
1855   * @return {number|void} The line index. Undefined if not found.
1856   */
1857  
1858  function getLineIndex(_ref) {
1859    var start = _ref.start,
1860        text = _ref.text;
1861    var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
1862    var index = startIndex;
1863  
1864    while (index--) {
1865      if (text[index] === LINE_SEPARATOR) {
1866        return index;
1867      }
1868    }
1869  }
1870  
1871  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-list-root-selected.js
1872  /**
1873   * Internal dependencies
1874   */
1875  
1876  /** @typedef {import('./create').RichTextValue} RichTextValue */
1877  
1878  /**
1879   * Whether or not the root list is selected.
1880   *
1881   * @param {RichTextValue} value The value to check.
1882   *
1883   * @return {boolean} True if the root list or nothing is selected, false if an
1884   *                   inner list is selected.
1885   */
1886  
1887  function isListRootSelected(value) {
1888    var replacements = value.replacements,
1889        start = value.start;
1890    var lineIndex = getLineIndex(value, start);
1891    var replacement = replacements[lineIndex];
1892    return !replacement || replacement.length < 1;
1893  }
1894  
1895  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-active-list-type.js
1896  /**
1897   * Internal dependencies
1898   */
1899  
1900  /** @typedef {import('./create').RichTextValue} RichTextValue */
1901  
1902  /**
1903   * Wether or not the selected list has the given tag name.
1904   *
1905   * @param {RichTextValue} value    The value to check.
1906   * @param {string}        type     The tag name the list should have.
1907   * @param {string}        rootType The current root tag name, to compare with in
1908   *                                 case nothing is selected.
1909   *
1910   * @return {boolean} True if the current list type matches `type`, false if not.
1911   */
1912  
1913  function isActiveListType(value, type, rootType) {
1914    var replacements = value.replacements,
1915        start = value.start;
1916    var lineIndex = getLineIndex(value, start);
1917    var replacement = replacements[lineIndex];
1918  
1919    if (!replacement || replacement.length === 0) {
1920      return type === rootType;
1921    }
1922  
1923    var lastFormat = replacement[replacement.length - 1];
1924    return lastFormat.type === type;
1925  }
1926  
1927  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-collapsed.js
1928  /** @typedef {import('./create').RichTextValue} RichTextValue */
1929  
1930  /**
1931   * Check if the selection of a Rich Text value is collapsed or not. Collapsed
1932   * means that no characters are selected, but there is a caret present. If there
1933   * is no selection, `undefined` will be returned. This is similar to
1934   * `window.getSelection().isCollapsed()`.
1935   *
1936   * @param {RichTextValue} value The rich text value to check.
1937   *
1938   * @return {boolean|undefined} True if the selection is collapsed, false if not,
1939   *                             undefined if there is no selection.
1940   */
1941  function isCollapsed(_ref) {
1942    var start = _ref.start,
1943        end = _ref.end;
1944  
1945    if (start === undefined || end === undefined) {
1946      return;
1947    }
1948  
1949    return start === end;
1950  }
1951  
1952  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/is-empty.js
1953  /**
1954   * Internal dependencies
1955   */
1956  
1957  /** @typedef {import('./create').RichTextValue} RichTextValue */
1958  
1959  /**
1960   * Check if a Rich Text value is Empty, meaning it contains no text or any
1961   * objects (such as images).
1962   *
1963   * @param {RichTextValue} value Value to use.
1964   *
1965   * @return {boolean} True if the value is empty, false if not.
1966   */
1967  
1968  function isEmpty(_ref) {
1969    var text = _ref.text;
1970    return text.length === 0;
1971  }
1972  /**
1973   * Check if the current collapsed selection is on an empty line in case of a
1974   * multiline value.
1975   *
1976   * @param  {RichTextValue} value Value te check.
1977   *
1978   * @return {boolean} True if the line is empty, false if not.
1979   */
1980  
1981  function isEmptyLine(_ref2) {
1982    var text = _ref2.text,
1983        start = _ref2.start,
1984        end = _ref2.end;
1985  
1986    if (start !== end) {
1987      return false;
1988    }
1989  
1990    if (text.length === 0) {
1991      return true;
1992    }
1993  
1994    if (start === 0 && text.slice(0, 1) === LINE_SEPARATOR) {
1995      return true;
1996    }
1997  
1998    if (start === text.length && text.slice(-1) === LINE_SEPARATOR) {
1999      return true;
2000    }
2001  
2002    return text.slice(start - 1, end + 1) === "".concat(LINE_SEPARATOR).concat(LINE_SEPARATOR);
2003  }
2004  
2005  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/join.js
2006  /**
2007   * Internal dependencies
2008   */
2009  
2010  
2011  /** @typedef {import('./create').RichTextValue} RichTextValue */
2012  
2013  /**
2014   * Combine an array of Rich Text values into one, optionally separated by
2015   * `separator`, which can be a Rich Text value, HTML string, or plain text
2016   * string. This is similar to `Array.prototype.join`.
2017   *
2018   * @param {Array<RichTextValue>} values      An array of values to join.
2019   * @param {string|RichTextValue} [separator] Separator string or value.
2020   *
2021   * @return {RichTextValue} A new combined value.
2022   */
2023  
2024  function join(values) {
2025    var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2026  
2027    if (typeof separator === 'string') {
2028      separator = create({
2029        text: separator
2030      });
2031    }
2032  
2033    return normaliseFormats(values.reduce(function (accumlator, _ref) {
2034      var formats = _ref.formats,
2035          replacements = _ref.replacements,
2036          text = _ref.text;
2037      return {
2038        formats: accumlator.formats.concat(separator.formats, formats),
2039        replacements: accumlator.replacements.concat(separator.replacements, replacements),
2040        text: accumlator.text + separator.text + text
2041      };
2042    }));
2043  }
2044  
2045  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/register-format-type.js
2046  
2047  
2048  function register_format_type_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2049  
2050  function register_format_type_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { register_format_type_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { register_format_type_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2051  
2052  /**
2053   * WordPress dependencies
2054   */
2055  
2056  /**
2057   * @typedef {Object} WPFormat
2058   *
2059   * @property {string}   name        A string identifying the format. Must be
2060   *                                  unique across all registered formats.
2061   * @property {string}   tagName     The HTML tag this format will wrap the
2062   *                                  selection with.
2063   * @property {string}   [className] A class to match the format.
2064   * @property {string}   title       Name of the format.
2065   * @property {Function} edit        Should return a component for the user to
2066   *                                  interact with the new registered format.
2067   */
2068  
2069  /**
2070   * Registers a new format provided a unique name and an object defining its
2071   * behavior.
2072   *
2073   * @param {string}   name                 Format name.
2074   * @param {WPFormat} settings             Format settings.
2075   *
2076   * @return {WPFormat|undefined} The format, if it has been successfully
2077   *                              registered; otherwise `undefined`.
2078   */
2079  
2080  function registerFormatType(name, settings) {
2081    settings = register_format_type_objectSpread({
2082      name: name
2083    }, settings);
2084  
2085    if (typeof settings.name !== 'string') {
2086      window.console.error('Format names must be strings.');
2087      return;
2088    }
2089  
2090    if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(settings.name)) {
2091      window.console.error('Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format');
2092      return;
2093    }
2094  
2095    if (Object(external_this_wp_data_["select"])('core/rich-text').getFormatType(settings.name)) {
2096      window.console.error('Format "' + settings.name + '" is already registered.');
2097      return;
2098    }
2099  
2100    if (typeof settings.tagName !== 'string' || settings.tagName === '') {
2101      window.console.error('Format tag names must be a string.');
2102      return;
2103    }
2104  
2105    if ((typeof settings.className !== 'string' || settings.className === '') && settings.className !== null) {
2106      window.console.error('Format class names must be a string, or null to handle bare elements.');
2107      return;
2108    }
2109  
2110    if (!/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(settings.className)) {
2111      window.console.error('A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.');
2112      return;
2113    }
2114  
2115    if (settings.className === null) {
2116      var formatTypeForBareElement = Object(external_this_wp_data_["select"])('core/rich-text').getFormatTypeForBareElement(settings.tagName);
2117  
2118      if (formatTypeForBareElement) {
2119        window.console.error("Format \"".concat(formatTypeForBareElement.name, "\" is already registered to handle bare tag name \"").concat(settings.tagName, "\"."));
2120        return;
2121      }
2122    } else {
2123      var formatTypeForClassName = Object(external_this_wp_data_["select"])('core/rich-text').getFormatTypeForClassName(settings.className);
2124  
2125      if (formatTypeForClassName) {
2126        window.console.error("Format \"".concat(formatTypeForClassName.name, "\" is already registered to handle class name \"").concat(settings.className, "\"."));
2127        return;
2128      }
2129    }
2130  
2131    if (!('title' in settings) || settings.title === '') {
2132      window.console.error('The format "' + settings.name + '" must have a title.');
2133      return;
2134    }
2135  
2136    if ('keywords' in settings && settings.keywords.length > 3) {
2137      window.console.error('The format "' + settings.name + '" can have a maximum of 3 keywords.');
2138      return;
2139    }
2140  
2141    if (typeof settings.title !== 'string') {
2142      window.console.error('Format titles must be strings.');
2143      return;
2144    }
2145  
2146    Object(external_this_wp_data_["dispatch"])('core/rich-text').addFormatTypes(settings);
2147    return settings;
2148  }
2149  
2150  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/remove-format.js
2151  
2152  
2153  function remove_format_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2154  
2155  function remove_format_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { remove_format_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { remove_format_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2156  
2157  /**
2158   * External dependencies
2159   */
2160  
2161  /**
2162   * Internal dependencies
2163   */
2164  
2165  
2166  /** @typedef {import('./create').RichTextValue} RichTextValue */
2167  
2168  /**
2169   * Remove any format object from a Rich Text value by type from the given
2170   * `startIndex` to the given `endIndex`. Indices are retrieved from the
2171   * selection if none are provided.
2172   *
2173   * @param {RichTextValue} value        Value to modify.
2174   * @param {string}        formatType   Format type to remove.
2175   * @param {number}        [startIndex] Start index.
2176   * @param {number}        [endIndex]   End index.
2177   *
2178   * @return {RichTextValue} A new value with the format applied.
2179   */
2180  
2181  function removeFormat(value, formatType) {
2182    var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
2183    var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
2184    var formats = value.formats,
2185        activeFormats = value.activeFormats;
2186    var newFormats = formats.slice(); // If the selection is collapsed, expand start and end to the edges of the
2187    // format.
2188  
2189    if (startIndex === endIndex) {
2190      var format = Object(external_this_lodash_["find"])(newFormats[startIndex], {
2191        type: formatType
2192      });
2193  
2194      if (format) {
2195        while (Object(external_this_lodash_["find"])(newFormats[startIndex], format)) {
2196          filterFormats(newFormats, startIndex, formatType);
2197          startIndex--;
2198        }
2199  
2200        endIndex++;
2201  
2202        while (Object(external_this_lodash_["find"])(newFormats[endIndex], format)) {
2203          filterFormats(newFormats, endIndex, formatType);
2204          endIndex++;
2205        }
2206      }
2207    } else {
2208      for (var i = startIndex; i < endIndex; i++) {
2209        if (newFormats[i]) {
2210          filterFormats(newFormats, i, formatType);
2211        }
2212      }
2213    }
2214  
2215    return normaliseFormats(remove_format_objectSpread(remove_format_objectSpread({}, value), {}, {
2216      formats: newFormats,
2217      activeFormats: Object(external_this_lodash_["reject"])(activeFormats, {
2218        type: formatType
2219      })
2220    }));
2221  }
2222  
2223  function filterFormats(formats, index, formatType) {
2224    var newFormats = formats[index].filter(function (_ref) {
2225      var type = _ref.type;
2226      return type !== formatType;
2227    });
2228  
2229    if (newFormats.length) {
2230      formats[index] = newFormats;
2231    } else {
2232      delete formats[index];
2233    }
2234  }
2235  
2236  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/insert.js
2237  /**
2238   * Internal dependencies
2239   */
2240  
2241  
2242  /** @typedef {import('./create').RichTextValue} RichTextValue */
2243  
2244  /**
2245   * Insert a Rich Text value, an HTML string, or a plain text string, into a
2246   * Rich Text value at the given `startIndex`. Any content between `startIndex`
2247   * and `endIndex` will be removed. Indices are retrieved from the selection if
2248   * none are provided.
2249   *
2250   * @param {RichTextValue}        value         Value to modify.
2251   * @param {RichTextValue|string} valueToInsert Value to insert.
2252   * @param {number}               [startIndex]  Start index.
2253   * @param {number}               [endIndex]    End index.
2254   *
2255   * @return {RichTextValue} A new value with the value inserted.
2256   */
2257  
2258  function insert(value, valueToInsert) {
2259    var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
2260    var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
2261    var formats = value.formats,
2262        replacements = value.replacements,
2263        text = value.text;
2264  
2265    if (typeof valueToInsert === 'string') {
2266      valueToInsert = create({
2267        text: valueToInsert
2268      });
2269    }
2270  
2271    var index = startIndex + valueToInsert.text.length;
2272    return normaliseFormats({
2273      formats: formats.slice(0, startIndex).concat(valueToInsert.formats, formats.slice(endIndex)),
2274      replacements: replacements.slice(0, startIndex).concat(valueToInsert.replacements, replacements.slice(endIndex)),
2275      text: text.slice(0, startIndex) + valueToInsert.text + text.slice(endIndex),
2276      start: index,
2277      end: index
2278    });
2279  }
2280  
2281  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/remove.js
2282  /**
2283   * Internal dependencies
2284   */
2285  
2286  
2287  /** @typedef {import('./create').RichTextValue} RichTextValue */
2288  
2289  /**
2290   * Remove content from a Rich Text value between the given `startIndex` and
2291   * `endIndex`. Indices are retrieved from the selection if none are provided.
2292   *
2293   * @param {RichTextValue} value        Value to modify.
2294   * @param {number}        [startIndex] Start index.
2295   * @param {number}        [endIndex]   End index.
2296   *
2297   * @return {RichTextValue} A new value with the content removed.
2298   */
2299  
2300  function remove_remove(value, startIndex, endIndex) {
2301    return insert(value, create(), startIndex, endIndex);
2302  }
2303  
2304  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/replace.js
2305  
2306  
2307  /**
2308   * Internal dependencies
2309   */
2310  
2311  /** @typedef {import('./create').RichTextValue} RichTextValue */
2312  
2313  /**
2314   * Search a Rich Text value and replace the match(es) with `replacement`. This
2315   * is similar to `String.prototype.replace`.
2316   *
2317   * @param {RichTextValue}  value        The value to modify.
2318   * @param {RegExp|string}  pattern      A RegExp object or literal. Can also be
2319   *                                      a string. It is treated as a verbatim
2320   *                                      string and is not interpreted as a
2321   *                                      regular expression. Only the first
2322   *                                      occurrence will be replaced.
2323   * @param {Function|string} replacement The match or matches are replaced with
2324   *                                      the specified or the value returned by
2325   *                                      the specified function.
2326   *
2327   * @return {RichTextValue} A new value with replacements applied.
2328   */
2329  
2330  function replace_replace(_ref, pattern, replacement) {
2331    var formats = _ref.formats,
2332        replacements = _ref.replacements,
2333        text = _ref.text,
2334        start = _ref.start,
2335        end = _ref.end;
2336    text = text.replace(pattern, function (match) {
2337      for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2338        rest[_key - 1] = arguments[_key];
2339      }
2340  
2341      var offset = rest[rest.length - 2];
2342      var newText = replacement;
2343      var newFormats;
2344      var newReplacements;
2345  
2346      if (typeof newText === 'function') {
2347        newText = replacement.apply(void 0, [match].concat(rest));
2348      }
2349  
2350      if (Object(esm_typeof["a" /* default */])(newText) === 'object') {
2351        newFormats = newText.formats;
2352        newReplacements = newText.replacements;
2353        newText = newText.text;
2354      } else {
2355        newFormats = Array(newText.length);
2356        newReplacements = Array(newText.length);
2357  
2358        if (formats[offset]) {
2359          newFormats = newFormats.fill(formats[offset]);
2360        }
2361      }
2362  
2363      formats = formats.slice(0, offset).concat(newFormats, formats.slice(offset + match.length));
2364      replacements = replacements.slice(0, offset).concat(newReplacements, replacements.slice(offset + match.length));
2365  
2366      if (start) {
2367        start = end = offset + newText.length;
2368      }
2369  
2370      return newText;
2371    });
2372    return normaliseFormats({
2373      formats: formats,
2374      replacements: replacements,
2375      text: text,
2376      start: start,
2377      end: end
2378    });
2379  }
2380  
2381  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/insert-line-separator.js
2382  /**
2383   * Internal dependencies
2384   */
2385  
2386  
2387  
2388  /** @typedef {import('./create').RichTextValue} RichTextValue */
2389  
2390  /**
2391   * Insert a line break character into a Rich Text value at the given
2392   * `startIndex`. Any content between `startIndex` and `endIndex` will be
2393   * removed. Indices are retrieved from the selection if none are provided.
2394   *
2395   * @param {RichTextValue} value        Value to modify.
2396   * @param {number}        [startIndex] Start index.
2397   * @param {number}        [endIndex]   End index.
2398   *
2399   * @return {RichTextValue} A new value with the value inserted.
2400   */
2401  
2402  function insertLineSeparator(value) {
2403    var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : value.start;
2404    var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.end;
2405    var beforeText = getTextContent(value).slice(0, startIndex);
2406    var previousLineSeparatorIndex = beforeText.lastIndexOf(LINE_SEPARATOR);
2407    var previousLineSeparatorFormats = value.replacements[previousLineSeparatorIndex];
2408    var replacements = [,];
2409  
2410    if (previousLineSeparatorFormats) {
2411      replacements = [previousLineSeparatorFormats];
2412    }
2413  
2414    var valueToInsert = {
2415      formats: [,],
2416      replacements: replacements,
2417      text: LINE_SEPARATOR
2418    };
2419    return insert(value, valueToInsert, startIndex, endIndex);
2420  }
2421  
2422  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/remove-line-separator.js
2423  
2424  
2425  function remove_line_separator_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2426  
2427  function remove_line_separator_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { remove_line_separator_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { remove_line_separator_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2428  
2429  /**
2430   * Internal dependencies
2431   */
2432  
2433  
2434  
2435  /** @typedef {import('./create').RichTextValue} RichTextValue */
2436  
2437  /**
2438   * Removes a line separator character, if existing, from a Rich Text value at
2439   * the current indices. If no line separator exists on the indices it will
2440   * return undefined.
2441   *
2442   * @param {RichTextValue} value    Value to modify.
2443   * @param {boolean}       backward Indicates if are removing from the start
2444   *                                 index or the end index.
2445   *
2446   * @return {RichTextValue|undefined} A new value with the line separator
2447   *                                   removed. Or undefined if no line separator
2448   *                                   is found on the position.
2449   */
2450  
2451  function removeLineSeparator(value) {
2452    var backward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2453    var replacements = value.replacements,
2454        text = value.text,
2455        start = value.start,
2456        end = value.end;
2457    var collapsed = isCollapsed(value);
2458    var index = start - 1;
2459    var removeStart = collapsed ? start - 1 : start;
2460    var removeEnd = end;
2461  
2462    if (!backward) {
2463      index = end;
2464      removeStart = start;
2465      removeEnd = collapsed ? end + 1 : end;
2466    }
2467  
2468    if (text[index] !== LINE_SEPARATOR) {
2469      return;
2470    }
2471  
2472    var newValue; // If the line separator that is about te be removed
2473    // contains wrappers, remove the wrappers first.
2474  
2475    if (collapsed && replacements[index] && replacements[index].length) {
2476      var newReplacements = replacements.slice();
2477      newReplacements[index] = replacements[index].slice(0, -1);
2478      newValue = remove_line_separator_objectSpread(remove_line_separator_objectSpread({}, value), {}, {
2479        replacements: newReplacements
2480      });
2481    } else {
2482      newValue = remove_remove(value, removeStart, removeEnd);
2483    }
2484  
2485    return newValue;
2486  }
2487  
2488  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/insert-object.js
2489  /**
2490   * Internal dependencies
2491   */
2492  
2493  
2494  /** @typedef {import('./create').RichTextValue} RichTextValue */
2495  
2496  /** @typedef {import('./create').RichTextFormat} RichTextFormat */
2497  
2498  /**
2499   * Insert a format as an object into a Rich Text value at the given
2500   * `startIndex`. Any content between `startIndex` and `endIndex` will be
2501   * removed. Indices are retrieved from the selection if none are provided.
2502   *
2503   * @param {RichTextValue}  value          Value to modify.
2504   * @param {RichTextFormat} formatToInsert Format to insert as object.
2505   * @param {number}         [startIndex]   Start index.
2506   * @param {number}         [endIndex]     End index.
2507   *
2508   * @return {RichTextValue} A new value with the object inserted.
2509   */
2510  
2511  function insertObject(value, formatToInsert, startIndex, endIndex) {
2512    var valueToInsert = {
2513      formats: [,],
2514      replacements: [formatToInsert],
2515      text: OBJECT_REPLACEMENT_CHARACTER
2516    };
2517    return insert(value, valueToInsert, startIndex, endIndex);
2518  }
2519  
2520  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/slice.js
2521  
2522  
2523  function slice_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2524  
2525  function slice_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { slice_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { slice_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2526  
2527  /** @typedef {import('./create').RichTextValue} RichTextValue */
2528  
2529  /**
2530   * Slice a Rich Text value from `startIndex` to `endIndex`. Indices are
2531   * retrieved from the selection if none are provided. This is similar to
2532   * `String.prototype.slice`.
2533   *
2534   * @param {RichTextValue} value        Value to modify.
2535   * @param {number}        [startIndex] Start index.
2536   * @param {number}        [endIndex]   End index.
2537   *
2538   * @return {RichTextValue} A new extracted value.
2539   */
2540  function slice(value) {
2541    var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : value.start;
2542    var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.end;
2543    var formats = value.formats,
2544        replacements = value.replacements,
2545        text = value.text;
2546  
2547    if (startIndex === undefined || endIndex === undefined) {
2548      return slice_objectSpread({}, value);
2549    }
2550  
2551    return {
2552      formats: formats.slice(startIndex, endIndex),
2553      replacements: replacements.slice(startIndex, endIndex),
2554      text: text.slice(startIndex, endIndex)
2555    };
2556  }
2557  
2558  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/split.js
2559  /**
2560   * Internal dependencies
2561   */
2562  
2563  /** @typedef {import('./create').RichTextValue} RichTextValue */
2564  
2565  /**
2566   * Split a Rich Text value in two at the given `startIndex` and `endIndex`, or
2567   * split at the given separator. This is similar to `String.prototype.split`.
2568   * Indices are retrieved from the selection if none are provided.
2569   *
2570   * @param {RichTextValue} value
2571   * @param {number|string} [string] Start index, or string at which to split.
2572   *
2573   * @return {Array<RichTextValue>} An array of new values.
2574   */
2575  
2576  function split(_ref, string) {
2577    var formats = _ref.formats,
2578        replacements = _ref.replacements,
2579        text = _ref.text,
2580        start = _ref.start,
2581        end = _ref.end;
2582  
2583    if (typeof string !== 'string') {
2584      return splitAtSelection.apply(void 0, arguments);
2585    }
2586  
2587    var nextStart = 0;
2588    return text.split(string).map(function (substring) {
2589      var startIndex = nextStart;
2590      var value = {
2591        formats: formats.slice(startIndex, startIndex + substring.length),
2592        replacements: replacements.slice(startIndex, startIndex + substring.length),
2593        text: substring
2594      };
2595      nextStart += string.length + substring.length;
2596  
2597      if (start !== undefined && end !== undefined) {
2598        if (start >= startIndex && start < nextStart) {
2599          value.start = start - startIndex;
2600        } else if (start < startIndex && end > startIndex) {
2601          value.start = 0;
2602        }
2603  
2604        if (end >= startIndex && end < nextStart) {
2605          value.end = end - startIndex;
2606        } else if (start < nextStart && end > nextStart) {
2607          value.end = substring.length;
2608        }
2609      }
2610  
2611      return value;
2612    });
2613  }
2614  
2615  function splitAtSelection(_ref2) {
2616    var formats = _ref2.formats,
2617        replacements = _ref2.replacements,
2618        text = _ref2.text,
2619        start = _ref2.start,
2620        end = _ref2.end;
2621    var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
2622    var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : end;
2623    var before = {
2624      formats: formats.slice(0, startIndex),
2625      replacements: replacements.slice(0, startIndex),
2626      text: text.slice(0, startIndex)
2627    };
2628    var after = {
2629      formats: formats.slice(endIndex),
2630      replacements: replacements.slice(endIndex),
2631      text: text.slice(endIndex),
2632      start: 0,
2633      end: 0
2634    };
2635    return [// Ensure newlines are trimmed.
2636    replace_replace(before, /\u2028+$/, ''), replace_replace(after, /^\u2028+/, '')];
2637  }
2638  
2639  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-format-type.js
2640  /**
2641   * WordPress dependencies
2642   */
2643  
2644  /** @typedef {import('./register-format-type').RichTextFormatType} RichTextFormatType */
2645  
2646  /**
2647   * Returns a registered format type.
2648   *
2649   * @param {string} name Format name.
2650   *
2651   * @return {RichTextFormatType|undefined} Format type.
2652   */
2653  
2654  function get_format_type_getFormatType(name) {
2655    return Object(external_this_wp_data_["select"])('core/rich-text').getFormatType(name);
2656  }
2657  
2658  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/to-tree.js
2659  
2660  
2661  
2662  function to_tree_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2663  
2664  function to_tree_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { to_tree_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { to_tree_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2665  
2666  /**
2667   * Internal dependencies
2668   */
2669  
2670  
2671  
2672  /**
2673   * Converts a format object to information that can be used to create an element
2674   * from (type, attributes and object).
2675   *
2676   * @param  {Object}  $1                        Named parameters.
2677   * @param  {string}  $1.type                   The format type.
2678   * @param  {Object}  $1.attributes             The format attributes.
2679   * @param  {Object}  $1.unregisteredAttributes The unregistered format
2680   *                                             attributes.
2681   * @param  {boolean} $1.object                 Wether or not it is an object
2682   *                                             format.
2683   * @param  {boolean} $1.boundaryClass          Wether or not to apply a boundary
2684   *                                             class.
2685   * @return {Object}                            Information to be used for
2686   *                                             element creation.
2687   */
2688  
2689  function fromFormat(_ref) {
2690    var type = _ref.type,
2691        attributes = _ref.attributes,
2692        unregisteredAttributes = _ref.unregisteredAttributes,
2693        object = _ref.object,
2694        boundaryClass = _ref.boundaryClass;
2695    var formatType = get_format_type_getFormatType(type);
2696    var elementAttributes = {};
2697  
2698    if (boundaryClass) {
2699      elementAttributes['data-rich-text-format-boundary'] = 'true';
2700    }
2701  
2702    if (!formatType) {
2703      if (attributes) {
2704        elementAttributes = to_tree_objectSpread(to_tree_objectSpread({}, attributes), elementAttributes);
2705      }
2706  
2707      return {
2708        type: type,
2709        attributes: elementAttributes,
2710        object: object
2711      };
2712    }
2713  
2714    elementAttributes = to_tree_objectSpread(to_tree_objectSpread({}, unregisteredAttributes), elementAttributes);
2715  
2716    for (var name in attributes) {
2717      var key = formatType.attributes ? formatType.attributes[name] : false;
2718  
2719      if (key) {
2720        elementAttributes[key] = attributes[name];
2721      } else {
2722        elementAttributes[name] = attributes[name];
2723      }
2724    }
2725  
2726    if (formatType.className) {
2727      if (elementAttributes.class) {
2728        elementAttributes.class = "".concat(formatType.className, " ").concat(elementAttributes.class);
2729      } else {
2730        elementAttributes.class = formatType.className;
2731      }
2732    }
2733  
2734    return {
2735      type: formatType.tagName,
2736      object: formatType.object,
2737      attributes: elementAttributes
2738    };
2739  }
2740  /**
2741   * Checks if both arrays of formats up until a certain index are equal.
2742   *
2743   * @param {Array}  a     Array of formats to compare.
2744   * @param {Array}  b     Array of formats to compare.
2745   * @param {number} index Index to check until.
2746   */
2747  
2748  
2749  function isEqualUntil(a, b, index) {
2750    do {
2751      if (a[index] !== b[index]) {
2752        return false;
2753      }
2754    } while (index--);
2755  
2756    return true;
2757  }
2758  
2759  function toTree(_ref2) {
2760    var value = _ref2.value,
2761        multilineTag = _ref2.multilineTag,
2762        preserveWhiteSpace = _ref2.preserveWhiteSpace,
2763        createEmpty = _ref2.createEmpty,
2764        append = _ref2.append,
2765        getLastChild = _ref2.getLastChild,
2766        getParent = _ref2.getParent,
2767        isText = _ref2.isText,
2768        getText = _ref2.getText,
2769        remove = _ref2.remove,
2770        appendText = _ref2.appendText,
2771        onStartIndex = _ref2.onStartIndex,
2772        onEndIndex = _ref2.onEndIndex,
2773        isEditableTree = _ref2.isEditableTree,
2774        placeholder = _ref2.placeholder;
2775    var formats = value.formats,
2776        replacements = value.replacements,
2777        text = value.text,
2778        start = value.start,
2779        end = value.end;
2780    var formatsLength = formats.length + 1;
2781    var tree = createEmpty();
2782    var multilineFormat = {
2783      type: multilineTag
2784    };
2785    var activeFormats = getActiveFormats(value);
2786    var deepestActiveFormat = activeFormats[activeFormats.length - 1];
2787    var lastSeparatorFormats;
2788    var lastCharacterFormats;
2789    var lastCharacter; // If we're building a multiline tree, start off with a multiline element.
2790  
2791    if (multilineTag) {
2792      append(append(tree, {
2793        type: multilineTag
2794      }), '');
2795      lastCharacterFormats = lastSeparatorFormats = [multilineFormat];
2796    } else {
2797      append(tree, '');
2798    }
2799  
2800    var _loop = function _loop(i) {
2801      var character = text.charAt(i);
2802      var shouldInsertPadding = isEditableTree && ( // Pad the line if the line is empty.
2803      !lastCharacter || lastCharacter === LINE_SEPARATOR || // Pad the line if the previous character is a line break, otherwise
2804      // the line break won't be visible.
2805      lastCharacter === '\n');
2806      var characterFormats = formats[i]; // Set multiline tags in queue for building the tree.
2807  
2808      if (multilineTag) {
2809        if (character === LINE_SEPARATOR) {
2810          characterFormats = lastSeparatorFormats = (replacements[i] || []).reduce(function (accumulator, format) {
2811            accumulator.push(format, multilineFormat);
2812            return accumulator;
2813          }, [multilineFormat]);
2814        } else {
2815          characterFormats = [].concat(Object(toConsumableArray["a" /* default */])(lastSeparatorFormats), Object(toConsumableArray["a" /* default */])(characterFormats || []));
2816        }
2817      }
2818  
2819      var pointer = getLastChild(tree);
2820  
2821      if (shouldInsertPadding && character === LINE_SEPARATOR) {
2822        var node = pointer;
2823  
2824        while (!isText(node)) {
2825          node = getLastChild(node);
2826        }
2827  
2828        append(getParent(node), ZWNBSP);
2829      } // Set selection for the start of line.
2830  
2831  
2832      if (lastCharacter === LINE_SEPARATOR) {
2833        var _node = pointer;
2834  
2835        while (!isText(_node)) {
2836          _node = getLastChild(_node);
2837        }
2838  
2839        if (onStartIndex && start === i) {
2840          onStartIndex(tree, _node);
2841        }
2842  
2843        if (onEndIndex && end === i) {
2844          onEndIndex(tree, _node);
2845        }
2846      }
2847  
2848      if (characterFormats) {
2849        characterFormats.forEach(function (format, formatIndex) {
2850          if (pointer && lastCharacterFormats && // Reuse the last element if all formats remain the same.
2851          isEqualUntil(characterFormats, lastCharacterFormats, formatIndex) && ( // Do not reuse the last element if the character is a
2852          // line separator.
2853          character !== LINE_SEPARATOR || characterFormats.length - 1 !== formatIndex)) {
2854            pointer = getLastChild(pointer);
2855            return;
2856          }
2857  
2858          var type = format.type,
2859              attributes = format.attributes,
2860              unregisteredAttributes = format.unregisteredAttributes;
2861          var boundaryClass = isEditableTree && character !== LINE_SEPARATOR && format === deepestActiveFormat;
2862          var parent = getParent(pointer);
2863          var newNode = append(parent, fromFormat({
2864            type: type,
2865            attributes: attributes,
2866            unregisteredAttributes: unregisteredAttributes,
2867            boundaryClass: boundaryClass
2868          }));
2869  
2870          if (isText(pointer) && getText(pointer).length === 0) {
2871            remove(pointer);
2872          }
2873  
2874          pointer = append(newNode, '');
2875        });
2876      } // No need for further processing if the character is a line separator.
2877  
2878  
2879      if (character === LINE_SEPARATOR) {
2880        lastCharacterFormats = characterFormats;
2881        lastCharacter = character;
2882        return "continue";
2883      } // If there is selection at 0, handle it before characters are inserted.
2884  
2885  
2886      if (i === 0) {
2887        if (onStartIndex && start === 0) {
2888          onStartIndex(tree, pointer);
2889        }
2890  
2891        if (onEndIndex && end === 0) {
2892          onEndIndex(tree, pointer);
2893        }
2894      }
2895  
2896      if (character === OBJECT_REPLACEMENT_CHARACTER) {
2897        pointer = append(getParent(pointer), fromFormat(to_tree_objectSpread(to_tree_objectSpread({}, replacements[i]), {}, {
2898          object: true
2899        }))); // Ensure pointer is text node.
2900  
2901        pointer = append(getParent(pointer), '');
2902      } else if (!preserveWhiteSpace && character === '\n') {
2903        pointer = append(getParent(pointer), {
2904          type: 'br',
2905          attributes: isEditableTree ? {
2906            'data-rich-text-line-break': 'true'
2907          } : undefined,
2908          object: true
2909        }); // Ensure pointer is text node.
2910  
2911        pointer = append(getParent(pointer), '');
2912      } else if (!isText(pointer)) {
2913        pointer = append(getParent(pointer), character);
2914      } else {
2915        appendText(pointer, character);
2916      }
2917  
2918      if (onStartIndex && start === i + 1) {
2919        onStartIndex(tree, pointer);
2920      }
2921  
2922      if (onEndIndex && end === i + 1) {
2923        onEndIndex(tree, pointer);
2924      }
2925  
2926      if (shouldInsertPadding && i === text.length) {
2927        append(getParent(pointer), ZWNBSP);
2928  
2929        if (placeholder && text.length === 0) {
2930          append(getParent(pointer), {
2931            type: 'span',
2932            attributes: {
2933              'data-rich-text-placeholder': placeholder,
2934              // Necessary to prevent the placeholder from catching
2935              // selection. The placeholder is also not editable after
2936              // all.
2937              contenteditable: 'false'
2938            }
2939          });
2940        }
2941      }
2942  
2943      lastCharacterFormats = characterFormats;
2944      lastCharacter = character;
2945    };
2946  
2947    for (var i = 0; i < formatsLength; i++) {
2948      var _ret = _loop(i);
2949  
2950      if (_ret === "continue") continue;
2951    }
2952  
2953    return tree;
2954  }
2955  
2956  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/to-dom.js
2957  
2958  
2959  
2960  function to_dom_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2961  
2962  function to_dom_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { to_dom_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { to_dom_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2963  
2964  /**
2965   * Internal dependencies
2966   */
2967  
2968  
2969  /** @typedef {import('./create').RichTextValue} RichTextValue */
2970  
2971  /**
2972   * Creates a path as an array of indices from the given root node to the given
2973   * node.
2974   *
2975   * @param {Node}        node     Node to find the path of.
2976   * @param {HTMLElement} rootNode Root node to find the path from.
2977   * @param {Array}       path     Initial path to build on.
2978   *
2979   * @return {Array} The path from the root node to the node.
2980   */
2981  
2982  function createPathToNode(node, rootNode, path) {
2983    var parentNode = node.parentNode;
2984    var i = 0;
2985  
2986    while (node = node.previousSibling) {
2987      i++;
2988    }
2989  
2990    path = [i].concat(Object(toConsumableArray["a" /* default */])(path));
2991  
2992    if (parentNode !== rootNode) {
2993      path = createPathToNode(parentNode, rootNode, path);
2994    }
2995  
2996    return path;
2997  }
2998  /**
2999   * Gets a node given a path (array of indices) from the given node.
3000   *
3001   * @param {HTMLElement} node Root node to find the wanted node in.
3002   * @param {Array}       path Path (indices) to the wanted node.
3003   *
3004   * @return {Object} Object with the found node and the remaining offset (if any).
3005   */
3006  
3007  
3008  function getNodeByPath(node, path) {
3009    path = Object(toConsumableArray["a" /* default */])(path);
3010  
3011    while (node && path.length > 1) {
3012      node = node.childNodes[path.shift()];
3013    }
3014  
3015    return {
3016      node: node,
3017      offset: path[0]
3018    };
3019  }
3020  
3021  function to_dom_append(element, child) {
3022    if (typeof child === 'string') {
3023      child = element.ownerDocument.createTextNode(child);
3024    }
3025  
3026    var _child = child,
3027        type = _child.type,
3028        attributes = _child.attributes;
3029  
3030    if (type) {
3031      child = element.ownerDocument.createElement(type);
3032  
3033      for (var key in attributes) {
3034        child.setAttribute(key, attributes[key]);
3035      }
3036    }
3037  
3038    return element.appendChild(child);
3039  }
3040  
3041  function to_dom_appendText(node, text) {
3042    node.appendData(text);
3043  }
3044  
3045  function to_dom_getLastChild(_ref) {
3046    var lastChild = _ref.lastChild;
3047    return lastChild;
3048  }
3049  
3050  function to_dom_getParent(_ref2) {
3051    var parentNode = _ref2.parentNode;
3052    return parentNode;
3053  }
3054  
3055  function to_dom_isText(node) {
3056    return node.nodeType === node.TEXT_NODE;
3057  }
3058  
3059  function to_dom_getText(_ref3) {
3060    var nodeValue = _ref3.nodeValue;
3061    return nodeValue;
3062  }
3063  
3064  function to_dom_remove(node) {
3065    return node.parentNode.removeChild(node);
3066  }
3067  
3068  function toDom(_ref4) {
3069    var value = _ref4.value,
3070        multilineTag = _ref4.multilineTag,
3071        prepareEditableTree = _ref4.prepareEditableTree,
3072        _ref4$isEditableTree = _ref4.isEditableTree,
3073        isEditableTree = _ref4$isEditableTree === void 0 ? true : _ref4$isEditableTree,
3074        placeholder = _ref4.placeholder,
3075        _ref4$doc = _ref4.doc,
3076        doc = _ref4$doc === void 0 ? document : _ref4$doc;
3077    var startPath = [];
3078    var endPath = [];
3079  
3080    if (prepareEditableTree) {
3081      value = to_dom_objectSpread(to_dom_objectSpread({}, value), {}, {
3082        formats: prepareEditableTree(value)
3083      });
3084    }
3085    /**
3086     * Returns a new instance of a DOM tree upon which RichText operations can be
3087     * applied.
3088     *
3089     * Note: The current implementation will return a shared reference, reset on
3090     * each call to `createEmpty`. Therefore, you should not hold a reference to
3091     * the value to operate upon asynchronously, as it may have unexpected results.
3092     *
3093     * @return {Object} RichText tree.
3094     */
3095  
3096  
3097    var createEmpty = function createEmpty() {
3098      return createElement(doc, '');
3099    };
3100  
3101    var tree = toTree({
3102      value: value,
3103      multilineTag: multilineTag,
3104      createEmpty: createEmpty,
3105      append: to_dom_append,
3106      getLastChild: to_dom_getLastChild,
3107      getParent: to_dom_getParent,
3108      isText: to_dom_isText,
3109      getText: to_dom_getText,
3110      remove: to_dom_remove,
3111      appendText: to_dom_appendText,
3112      onStartIndex: function onStartIndex(body, pointer) {
3113        startPath = createPathToNode(pointer, body, [pointer.nodeValue.length]);
3114      },
3115      onEndIndex: function onEndIndex(body, pointer) {
3116        endPath = createPathToNode(pointer, body, [pointer.nodeValue.length]);
3117      },
3118      isEditableTree: isEditableTree,
3119      placeholder: placeholder
3120    });
3121    return {
3122      body: tree,
3123      selection: {
3124        startPath: startPath,
3125        endPath: endPath
3126      }
3127    };
3128  }
3129  /**
3130   * Create an `Element` tree from a Rich Text value and applies the difference to
3131   * the `Element` tree contained by `current`. If a `multilineTag` is provided,
3132   * text separated by two new lines will be wrapped in an `Element` of that type.
3133   *
3134   * @param {Object}        $1                       Named arguments.
3135   * @param {RichTextValue} $1.value                 Value to apply.
3136   * @param {HTMLElement}   $1.current               The live root node to apply the element tree to.
3137   * @param {string}        [$1.multilineTag]        Multiline tag.
3138   * @param {Function}      [$1.prepareEditableTree] Function to filter editorable formats.
3139   * @param {boolean}       [$1.__unstableDomOnly]   Only apply elements, no selection.
3140   * @param {string}        [$1.placeholder]         Placeholder text.
3141   */
3142  
3143  function apply(_ref5) {
3144    var value = _ref5.value,
3145        current = _ref5.current,
3146        multilineTag = _ref5.multilineTag,
3147        prepareEditableTree = _ref5.prepareEditableTree,
3148        __unstableDomOnly = _ref5.__unstableDomOnly,
3149        placeholder = _ref5.placeholder;
3150  
3151    // Construct a new element tree in memory.
3152    var _toDom = toDom({
3153      value: value,
3154      multilineTag: multilineTag,
3155      prepareEditableTree: prepareEditableTree,
3156      placeholder: placeholder,
3157      doc: current.ownerDocument
3158    }),
3159        body = _toDom.body,
3160        selection = _toDom.selection;
3161  
3162    applyValue(body, current);
3163  
3164    if (value.start !== undefined && !__unstableDomOnly) {
3165      applySelection(selection, current);
3166    }
3167  }
3168  function applyValue(future, current) {
3169    var i = 0;
3170    var futureChild;
3171  
3172    while (futureChild = future.firstChild) {
3173      var currentChild = current.childNodes[i];
3174  
3175      if (!currentChild) {
3176        current.appendChild(futureChild);
3177      } else if (!currentChild.isEqualNode(futureChild)) {
3178        if (currentChild.nodeName !== futureChild.nodeName || currentChild.nodeType === currentChild.TEXT_NODE && currentChild.data !== futureChild.data) {
3179          current.replaceChild(futureChild, currentChild);
3180        } else {
3181          var currentAttributes = currentChild.attributes;
3182          var futureAttributes = futureChild.attributes;
3183  
3184          if (currentAttributes) {
3185            var ii = currentAttributes.length; // Reverse loop because `removeAttribute` on `currentChild`
3186            // changes `currentAttributes`.
3187  
3188            while (ii--) {
3189              var name = currentAttributes[ii].name;
3190  
3191              if (!futureChild.getAttribute(name)) {
3192                currentChild.removeAttribute(name);
3193              }
3194            }
3195          }
3196  
3197          if (futureAttributes) {
3198            for (var _ii = 0; _ii < futureAttributes.length; _ii++) {
3199              var _futureAttributes$_ii = futureAttributes[_ii],
3200                  _name = _futureAttributes$_ii.name,
3201                  value = _futureAttributes$_ii.value;
3202  
3203              if (currentChild.getAttribute(_name) !== value) {
3204                currentChild.setAttribute(_name, value);
3205              }
3206            }
3207          }
3208  
3209          applyValue(futureChild, currentChild);
3210          future.removeChild(futureChild);
3211        }
3212      } else {
3213        future.removeChild(futureChild);
3214      }
3215  
3216      i++;
3217    }
3218  
3219    while (current.childNodes[i]) {
3220      current.removeChild(current.childNodes[i]);
3221    }
3222  }
3223  /**
3224   * Returns true if two ranges are equal, or false otherwise. Ranges are
3225   * considered equal if their start and end occur in the same container and
3226   * offset.
3227   *
3228   * @param {Range} a First range object to test.
3229   * @param {Range} b First range object to test.
3230   *
3231   * @return {boolean} Whether the two ranges are equal.
3232   */
3233  
3234  function isRangeEqual(a, b) {
3235    return a.startContainer === b.startContainer && a.startOffset === b.startOffset && a.endContainer === b.endContainer && a.endOffset === b.endOffset;
3236  }
3237  
3238  function applySelection(_ref6, current) {
3239    var startPath = _ref6.startPath,
3240        endPath = _ref6.endPath;
3241  
3242    var _getNodeByPath = getNodeByPath(current, startPath),
3243        startContainer = _getNodeByPath.node,
3244        startOffset = _getNodeByPath.offset;
3245  
3246    var _getNodeByPath2 = getNodeByPath(current, endPath),
3247        endContainer = _getNodeByPath2.node,
3248        endOffset = _getNodeByPath2.offset;
3249  
3250    var ownerDocument = current.ownerDocument;
3251    var defaultView = ownerDocument.defaultView;
3252    var selection = defaultView.getSelection();
3253    var range = ownerDocument.createRange();
3254    range.setStart(startContainer, startOffset);
3255    range.setEnd(endContainer, endOffset);
3256    var activeElement = ownerDocument.activeElement;
3257  
3258    if (selection.rangeCount > 0) {
3259      // If the to be added range and the live range are the same, there's no
3260      // need to remove the live range and add the equivalent range.
3261      if (isRangeEqual(range, selection.getRangeAt(0))) {
3262        return;
3263      }
3264  
3265      selection.removeAllRanges();
3266    }
3267  
3268    selection.addRange(range); // This function is not intended to cause a shift in focus. Since the above
3269    // selection manipulations may shift focus, ensure that focus is restored to
3270    // its previous state.
3271  
3272    if (activeElement !== ownerDocument.activeElement) {
3273      // The `instanceof` checks protect against edge cases where the focused
3274      // element is not of the interface HTMLElement (does not have a `focus`
3275      // or `blur` property).
3276      //
3277      // See: https://github.com/Microsoft/TypeScript/issues/5901#issuecomment-431649653
3278      if (activeElement instanceof defaultView.HTMLElement) {
3279        activeElement.focus();
3280      }
3281    }
3282  }
3283  
3284  // EXTERNAL MODULE: external {"this":["wp","escapeHtml"]}
3285  var external_this_wp_escapeHtml_ = __webpack_require__(108);
3286  
3287  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/to-html-string.js
3288  /**
3289   * WordPress dependencies
3290   */
3291  
3292  /**
3293   * Internal dependencies
3294   */
3295  
3296  
3297  /** @typedef {import('./create').RichTextValue} RichTextValue */
3298  
3299  /**
3300   * Create an HTML string from a Rich Text value. If a `multilineTag` is
3301   * provided, text separated by a line separator will be wrapped in it.
3302   *
3303   * @param {Object}        $1                      Named argements.
3304   * @param {RichTextValue} $1.value                Rich text value.
3305   * @param {string}        [$1.multilineTag]       Multiline tag.
3306   * @param {boolean}       [$1.preserveWhiteSpace] Whether or not to use newline
3307   *                                                characters for line breaks.
3308   *
3309   * @return {string} HTML string.
3310   */
3311  
3312  function toHTMLString(_ref) {
3313    var value = _ref.value,
3314        multilineTag = _ref.multilineTag,
3315        preserveWhiteSpace = _ref.preserveWhiteSpace;
3316    var tree = toTree({
3317      value: value,
3318      multilineTag: multilineTag,
3319      preserveWhiteSpace: preserveWhiteSpace,
3320      createEmpty: to_html_string_createEmpty,
3321      append: to_html_string_append,
3322      getLastChild: to_html_string_getLastChild,
3323      getParent: to_html_string_getParent,
3324      isText: to_html_string_isText,
3325      getText: to_html_string_getText,
3326      remove: to_html_string_remove,
3327      appendText: to_html_string_appendText
3328    });
3329    return createChildrenHTML(tree.children);
3330  }
3331  
3332  function to_html_string_createEmpty() {
3333    return {};
3334  }
3335  
3336  function to_html_string_getLastChild(_ref2) {
3337    var children = _ref2.children;
3338    return children && children[children.length - 1];
3339  }
3340  
3341  function to_html_string_append(parent, object) {
3342    if (typeof object === 'string') {
3343      object = {
3344        text: object
3345      };
3346    }
3347  
3348    object.parent = parent;
3349    parent.children = parent.children || [];
3350    parent.children.push(object);
3351    return object;
3352  }
3353  
3354  function to_html_string_appendText(object, text) {
3355    object.text += text;
3356  }
3357  
3358  function to_html_string_getParent(_ref3) {
3359    var parent = _ref3.parent;
3360    return parent;
3361  }
3362  
3363  function to_html_string_isText(_ref4) {
3364    var text = _ref4.text;
3365    return typeof text === 'string';
3366  }
3367  
3368  function to_html_string_getText(_ref5) {
3369    var text = _ref5.text;
3370    return text;
3371  }
3372  
3373  function to_html_string_remove(object) {
3374    var index = object.parent.children.indexOf(object);
3375  
3376    if (index !== -1) {
3377      object.parent.children.splice(index, 1);
3378    }
3379  
3380    return object;
3381  }
3382  
3383  function createElementHTML(_ref6) {
3384    var type = _ref6.type,
3385        attributes = _ref6.attributes,
3386        object = _ref6.object,
3387        children = _ref6.children;
3388    var attributeString = '';
3389  
3390    for (var key in attributes) {
3391      if (!Object(external_this_wp_escapeHtml_["isValidAttributeName"])(key)) {
3392        continue;
3393      }
3394  
3395      attributeString += " ".concat(key, "=\"").concat(Object(external_this_wp_escapeHtml_["escapeAttribute"])(attributes[key]), "\"");
3396    }
3397  
3398    if (object) {
3399      return "<".concat(type).concat(attributeString, ">");
3400    }
3401  
3402    return "<".concat(type).concat(attributeString, ">").concat(createChildrenHTML(children), "</").concat(type, ">");
3403  }
3404  
3405  function createChildrenHTML() {
3406    var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
3407    return children.map(function (child) {
3408      return child.text === undefined ? createElementHTML(child) : Object(external_this_wp_escapeHtml_["escapeEditableHTML"])(child.text);
3409    }).join('');
3410  }
3411  
3412  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/toggle-format.js
3413  /**
3414   * Internal dependencies
3415   */
3416  
3417  
3418  
3419  /** @typedef {import('./create').RichTextValue} RichTextValue */
3420  
3421  /** @typedef {import('./create').RichTextFormat} RichTextFormat */
3422  
3423  /**
3424   * Toggles a format object to a Rich Text value at the current selection.
3425   *
3426   * @param {RichTextValue}  value  Value to modify.
3427   * @param {RichTextFormat} format Format to apply or remove.
3428   *
3429   * @return {RichTextValue} A new value with the format applied or removed.
3430   */
3431  
3432  function toggleFormat(value, format) {
3433    if (getActiveFormat(value, format.type)) {
3434      return removeFormat(value, format.type);
3435    }
3436  
3437    return applyFormat(value, format);
3438  }
3439  
3440  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/unregister-format-type.js
3441  /**
3442   * WordPress dependencies
3443   */
3444  
3445  /** @typedef {import('./register-format-type').RichTextFormatType} RichTextFormatType */
3446  
3447  /**
3448   * Unregisters a format.
3449   *
3450   * @param {string} name Format name.
3451   *
3452   * @return {RichTextFormatType|undefined} The previous format value, if it has
3453   *                                        been successfully unregistered;
3454   *                                        otherwise `undefined`.
3455   */
3456  
3457  function unregisterFormatType(name) {
3458    var oldFormat = Object(external_this_wp_data_["select"])('core/rich-text').getFormatType(name);
3459  
3460    if (!oldFormat) {
3461      window.console.error("Format ".concat(name, " is not registered."));
3462      return;
3463    }
3464  
3465    Object(external_this_wp_data_["dispatch"])('core/rich-text').removeFormatTypes(name);
3466    return oldFormat;
3467  }
3468  
3469  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/can-indent-list-items.js
3470  /**
3471   * Internal dependencies
3472   */
3473  
3474  /** @typedef {import('./create').RichTextValue} RichTextValue */
3475  
3476  /**
3477   * Checks if the selected list item can be indented.
3478   *
3479   * @param {RichTextValue} value Value to check.
3480   *
3481   * @return {boolean} Whether or not the selected list item can be indented.
3482   */
3483  
3484  function canIndentListItems(value) {
3485    var lineIndex = getLineIndex(value); // There is only one line, so the line cannot be indented.
3486  
3487    if (lineIndex === undefined) {
3488      return false;
3489    }
3490  
3491    var replacements = value.replacements;
3492    var previousLineIndex = getLineIndex(value, lineIndex);
3493    var formatsAtLineIndex = replacements[lineIndex] || [];
3494    var formatsAtPreviousLineIndex = replacements[previousLineIndex] || []; // If the indentation of the current line is greater than previous line,
3495    // then the line cannot be furter indented.
3496  
3497    return formatsAtLineIndex.length <= formatsAtPreviousLineIndex.length;
3498  }
3499  
3500  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/can-outdent-list-items.js
3501  /**
3502   * Internal dependencies
3503   */
3504  
3505  /** @typedef {import('./create').RichTextValue} RichTextValue */
3506  
3507  /**
3508   * Checks if the selected list item can be outdented.
3509   *
3510   * @param {RichTextValue} value Value to check.
3511   *
3512   * @return {boolean} Whether or not the selected list item can be outdented.
3513   */
3514  
3515  function canOutdentListItems(value) {
3516    var replacements = value.replacements,
3517        start = value.start;
3518    var startingLineIndex = getLineIndex(value, start);
3519    return replacements[startingLineIndex] !== undefined;
3520  }
3521  
3522  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/indent-list-items.js
3523  
3524  
3525  function indent_list_items_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
3526  
3527  function indent_list_items_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { indent_list_items_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { indent_list_items_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
3528  
3529  /**
3530   * Internal dependencies
3531   */
3532  
3533  
3534  
3535  /** @typedef {import('./create').RichTextValue} RichTextValue */
3536  
3537  /** @typedef {import('./create').RichTextFormat} RichTextFormat */
3538  
3539  /**
3540   * Gets the line index of the first previous list item with higher indentation.
3541   *
3542   * @param {RichTextValue} value      Value to search.
3543   * @param {number}        lineIndex  Line index of the list item to compare
3544   *                                   with.
3545   *
3546   * @return {number|void} The line index.
3547   */
3548  
3549  function getTargetLevelLineIndex(_ref, lineIndex) {
3550    var text = _ref.text,
3551        replacements = _ref.replacements;
3552    var startFormats = replacements[lineIndex] || [];
3553    var index = lineIndex;
3554  
3555    while (index-- >= 0) {
3556      if (text[index] !== LINE_SEPARATOR) {
3557        continue;
3558      }
3559  
3560      var formatsAtIndex = replacements[index] || []; // Return the first line index that is one level higher. If the level is
3561      // lower or equal, there is no result.
3562  
3563      if (formatsAtIndex.length === startFormats.length + 1) {
3564        return index;
3565      } else if (formatsAtIndex.length <= startFormats.length) {
3566        return;
3567      }
3568    }
3569  }
3570  /**
3571   * Indents any selected list items if possible.
3572   *
3573   * @param {RichTextValue}  value      Value to change.
3574   * @param {RichTextFormat} rootFormat Root format.
3575   *
3576   * @return {RichTextValue} The changed value.
3577   */
3578  
3579  
3580  function indentListItems(value, rootFormat) {
3581    if (!canIndentListItems(value)) {
3582      return value;
3583    }
3584  
3585    var lineIndex = getLineIndex(value);
3586    var previousLineIndex = getLineIndex(value, lineIndex);
3587    var text = value.text,
3588        replacements = value.replacements,
3589        end = value.end;
3590    var newFormats = replacements.slice();
3591    var targetLevelLineIndex = getTargetLevelLineIndex(value, lineIndex);
3592  
3593    for (var index = lineIndex; index < end; index++) {
3594      if (text[index] !== LINE_SEPARATOR) {
3595        continue;
3596      } // Get the previous list, and if there's a child list, take over the
3597      // formats. If not, duplicate the last level and create a new level.
3598  
3599  
3600      if (targetLevelLineIndex) {
3601        var targetFormats = replacements[targetLevelLineIndex] || [];
3602        newFormats[index] = targetFormats.concat((newFormats[index] || []).slice(targetFormats.length - 1));
3603      } else {
3604        var _targetFormats = replacements[previousLineIndex] || [];
3605  
3606        var lastformat = _targetFormats[_targetFormats.length - 1] || rootFormat;
3607        newFormats[index] = _targetFormats.concat([lastformat], (newFormats[index] || []).slice(_targetFormats.length));
3608      }
3609    }
3610  
3611    return indent_list_items_objectSpread(indent_list_items_objectSpread({}, value), {}, {
3612      replacements: newFormats
3613    });
3614  }
3615  
3616  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-parent-line-index.js
3617  /**
3618   * Internal dependencies
3619   */
3620  
3621  /** @typedef {import('./create').RichTextValue} RichTextValue */
3622  
3623  /**
3624   * Gets the index of the first parent list. To get the parent list formats, we
3625   * go through every list item until we find one with exactly one format type
3626   * less.
3627   *
3628   * @param {RichTextValue} value     Value to search.
3629   * @param {number}        lineIndex Line index of a child list item.
3630   *
3631   * @return {number|void} The parent list line index.
3632   */
3633  
3634  function getParentLineIndex(_ref, lineIndex) {
3635    var text = _ref.text,
3636        replacements = _ref.replacements;
3637    var startFormats = replacements[lineIndex] || [];
3638    var index = lineIndex;
3639  
3640    while (index-- >= 0) {
3641      if (text[index] !== LINE_SEPARATOR) {
3642        continue;
3643      }
3644  
3645      var formatsAtIndex = replacements[index] || [];
3646  
3647      if (formatsAtIndex.length === startFormats.length - 1) {
3648        return index;
3649      }
3650    }
3651  }
3652  
3653  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-last-child-index.js
3654  /**
3655   * Internal dependencies
3656   */
3657  
3658  /** @typedef {import('./create').RichTextValue} RichTextValue */
3659  
3660  /**
3661   * Gets the line index of the last child in the list.
3662   *
3663   * @param {RichTextValue} value     Value to search.
3664   * @param {number}        lineIndex Line index of a list item in the list.
3665   *
3666   * @return {number} The index of the last child.
3667   */
3668  
3669  function getLastChildIndex(_ref, lineIndex) {
3670    var text = _ref.text,
3671        replacements = _ref.replacements;
3672    var lineFormats = replacements[lineIndex] || []; // Use the given line index in case there are no next children.
3673  
3674    var childIndex = lineIndex; // `lineIndex` could be `undefined` if it's the first line.
3675  
3676    for (var index = lineIndex || 0; index < text.length; index++) {
3677      // We're only interested in line indices.
3678      if (text[index] !== LINE_SEPARATOR) {
3679        continue;
3680      }
3681  
3682      var formatsAtIndex = replacements[index] || []; // If the amout of formats is equal or more, store it, then return the
3683      // last one if the amount of formats is less.
3684  
3685      if (formatsAtIndex.length >= lineFormats.length) {
3686        childIndex = index;
3687      } else {
3688        return childIndex;
3689      }
3690    } // If the end of the text is reached, return the last child index.
3691  
3692  
3693    return childIndex;
3694  }
3695  
3696  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/outdent-list-items.js
3697  
3698  
3699  function outdent_list_items_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
3700  
3701  function outdent_list_items_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { outdent_list_items_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { outdent_list_items_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
3702  
3703  /**
3704   * Internal dependencies
3705   */
3706  
3707  
3708  
3709  
3710  
3711  /** @typedef {import('./create').RichTextValue} RichTextValue */
3712  
3713  /**
3714   * Outdents any selected list items if possible.
3715   *
3716   * @param {RichTextValue} value Value to change.
3717   *
3718   * @return {RichTextValue} The changed value.
3719   */
3720  
3721  function outdentListItems(value) {
3722    if (!canOutdentListItems(value)) {
3723      return value;
3724    }
3725  
3726    var text = value.text,
3727        replacements = value.replacements,
3728        start = value.start,
3729        end = value.end;
3730    var startingLineIndex = getLineIndex(value, start);
3731    var newFormats = replacements.slice(0);
3732    var parentFormats = replacements[getParentLineIndex(value, startingLineIndex)] || [];
3733    var endingLineIndex = getLineIndex(value, end);
3734    var lastChildIndex = getLastChildIndex(value, endingLineIndex); // Outdent all list items from the starting line index until the last child
3735    // index of the ending list. All children of the ending list need to be
3736    // outdented, otherwise they'll be orphaned.
3737  
3738    for (var index = startingLineIndex; index <= lastChildIndex; index++) {
3739      // Skip indices that are not line separators.
3740      if (text[index] !== LINE_SEPARATOR) {
3741        continue;
3742      } // In the case of level 0, the formats at the index are undefined.
3743  
3744  
3745      var currentFormats = newFormats[index] || []; // Omit the indentation level where the selection starts.
3746  
3747      newFormats[index] = parentFormats.concat(currentFormats.slice(parentFormats.length + 1));
3748  
3749      if (newFormats[index].length === 0) {
3750        delete newFormats[index];
3751      }
3752    }
3753  
3754    return outdent_list_items_objectSpread(outdent_list_items_objectSpread({}, value), {}, {
3755      replacements: newFormats
3756    });
3757  }
3758  
3759  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/change-list-type.js
3760  
3761  
3762  function change_list_type_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
3763  
3764  function change_list_type_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { change_list_type_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { change_list_type_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
3765  
3766  /**
3767   * Internal dependencies
3768   */
3769  
3770  
3771  
3772  /** @typedef {import('./create').RichTextValue} RichTextValue */
3773  
3774  /** @typedef {import('./create').RichTextFormat} RichTextFormat */
3775  
3776  /**
3777   * Changes the list type of the selected indented list, if any. Looks at the
3778   * currently selected list item and takes the parent list, then changes the list
3779   * type of this list. When multiple lines are selected, the parent lists are
3780   * takes and changed.
3781   *
3782   * @param {RichTextValue}  value     Value to change.
3783   * @param {RichTextFormat} newFormat The new list format object. Choose between
3784   *                                   `{ type: 'ol' }` and `{ type: 'ul' }`.
3785   *
3786   * @return {RichTextValue} The changed value.
3787   */
3788  
3789  function changeListType(value, newFormat) {
3790    var text = value.text,
3791        replacements = value.replacements,
3792        start = value.start,
3793        end = value.end;
3794    var startingLineIndex = getLineIndex(value, start);
3795    var startLineFormats = replacements[startingLineIndex] || [];
3796    var endLineFormats = replacements[getLineIndex(value, end)] || [];
3797    var startIndex = getParentLineIndex(value, startingLineIndex);
3798    var newReplacements = replacements.slice();
3799    var startCount = startLineFormats.length - 1;
3800    var endCount = endLineFormats.length - 1;
3801    var changed;
3802  
3803    for (var index = startIndex + 1 || 0; index < text.length; index++) {
3804      if (text[index] !== LINE_SEPARATOR) {
3805        continue;
3806      }
3807  
3808      if ((newReplacements[index] || []).length <= startCount) {
3809        break;
3810      }
3811  
3812      if (!newReplacements[index]) {
3813        continue;
3814      }
3815  
3816      changed = true;
3817      newReplacements[index] = newReplacements[index].map(function (format, i) {
3818        return i < startCount || i > endCount ? format : newFormat;
3819      });
3820    }
3821  
3822    if (!changed) {
3823      return value;
3824    }
3825  
3826    return change_list_type_objectSpread(change_list_type_objectSpread({}, value), {}, {
3827      replacements: newReplacements
3828    });
3829  }
3830  
3831  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
3832  var slicedToArray = __webpack_require__(12);
3833  
3834  // EXTERNAL MODULE: external {"this":["wp","element"]}
3835  var external_this_wp_element_ = __webpack_require__(0);
3836  
3837  // EXTERNAL MODULE: external {"this":["wp","keycodes"]}
3838  var external_this_wp_keycodes_ = __webpack_require__(18);
3839  
3840  // EXTERNAL MODULE: external {"this":["wp","deprecated"]}
3841  var external_this_wp_deprecated_ = __webpack_require__(36);
3842  var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
3843  
3844  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/format-edit.js
3845  
3846  
3847  /**
3848   * Internal dependencies
3849   */
3850  
3851  
3852  /**
3853   * Set of all interactive content tags.
3854   *
3855   * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content
3856   */
3857  
3858  var interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']);
3859  function FormatEdit(_ref) {
3860    var formatTypes = _ref.formatTypes,
3861        onChange = _ref.onChange,
3862        onFocus = _ref.onFocus,
3863        value = _ref.value,
3864        allowedFormats = _ref.allowedFormats,
3865        withoutInteractiveFormatting = _ref.withoutInteractiveFormatting;
3866    return formatTypes.map(function (_ref2) {
3867      var name = _ref2.name,
3868          Edit = _ref2.edit,
3869          tagName = _ref2.tagName;
3870  
3871      if (!Edit) {
3872        return null;
3873      }
3874  
3875      if (allowedFormats && allowedFormats.indexOf(name) === -1) {
3876        return null;
3877      }
3878  
3879      if (withoutInteractiveFormatting && interactiveContentTags.has(tagName)) {
3880        return null;
3881      }
3882  
3883      var activeFormat = getActiveFormat(value, name);
3884      var isActive = activeFormat !== undefined;
3885      var activeObject = getActiveObject(value);
3886      var isObjectActive = activeObject !== undefined && activeObject.type === name;
3887      return Object(external_this_wp_element_["createElement"])(Edit, {
3888        key: name,
3889        isActive: isActive,
3890        activeAttributes: isActive ? activeFormat.attributes || {} : {},
3891        isObjectActive: isObjectActive,
3892        activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
3893        value: value,
3894        onChange: onChange,
3895        onFocus: onFocus
3896      });
3897    });
3898  }
3899  
3900  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/update-formats.js
3901  /**
3902   * Internal dependencies
3903   */
3904  
3905  /** @typedef {import('./create').RichTextValue} RichTextValue */
3906  
3907  /**
3908   * Efficiently updates all the formats from `start` (including) until `end`
3909   * (excluding) with the active formats. Mutates `value`.
3910   *
3911   * @param  {Object}        $1         Named paramentes.
3912   * @param  {RichTextValue} $1.value   Value te update.
3913   * @param  {number}        $1.start   Index to update from.
3914   * @param  {number}        $1.end     Index to update until.
3915   * @param  {Array}         $1.formats Replacement formats.
3916   *
3917   * @return {RichTextValue} Mutated value.
3918   */
3919  
3920  function updateFormats(_ref) {
3921    var value = _ref.value,
3922        start = _ref.start,
3923        end = _ref.end,
3924        formats = _ref.formats;
3925    var formatsBefore = value.formats[start - 1] || [];
3926    var formatsAfter = value.formats[end] || []; // First, fix the references. If any format right before or after are
3927    // equal, the replacement format should use the same reference.
3928  
3929    value.activeFormats = formats.map(function (format, index) {
3930      if (formatsBefore[index]) {
3931        if (isFormatEqual(format, formatsBefore[index])) {
3932          return formatsBefore[index];
3933        }
3934      } else if (formatsAfter[index]) {
3935        if (isFormatEqual(format, formatsAfter[index])) {
3936          return formatsAfter[index];
3937        }
3938      }
3939  
3940      return format;
3941    });
3942  
3943    while (--end >= start) {
3944      if (value.activeFormats.length > 0) {
3945        value.formats[end] = value.activeFormats;
3946      } else {
3947        delete value.formats[end];
3948      }
3949    }
3950  
3951    return value;
3952  }
3953  
3954  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/use-format-types.js
3955  
3956  
3957  function use_format_types_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
3958  
3959  function use_format_types_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { use_format_types_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { use_format_types_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
3960  
3961  /**
3962   * WordPress dependencies
3963   */
3964  
3965  
3966  function formatTypesSelector(select) {
3967    return select('core/rich-text').getFormatTypes();
3968  }
3969  /**
3970   * This hook provides RichText with the `formatTypes` and its derived props from
3971   * experimental format type settings.
3972   *
3973   * @param {Object} $0            Options
3974   * @param {string} $0.clientId   Block client ID.
3975   * @param {string} $0.identifier Block attribute.
3976   */
3977  
3978  
3979  function useFormatTypes(_ref) {
3980    var clientId = _ref.clientId,
3981        identifier = _ref.identifier;
3982    var formatTypes = Object(external_this_wp_data_["useSelect"])(formatTypesSelector, []);
3983    var keyedSelected = Object(external_this_wp_data_["useSelect"])(function (select) {
3984      return formatTypes.reduce(function (accumulator, type) {
3985        if (type.__experimentalGetPropsForEditableTreePreparation) {
3986          accumulator[type.name] = type.__experimentalGetPropsForEditableTreePreparation(select, {
3987            richTextIdentifier: identifier,
3988            blockClientId: clientId
3989          });
3990        }
3991  
3992        return accumulator;
3993      }, {});
3994    }, [formatTypes, clientId, identifier]);
3995    var dispatch = Object(external_this_wp_data_["useDispatch"])();
3996    var prepareHandlers = [];
3997    var valueHandlers = [];
3998    var changeHandlers = [];
3999    var dependencies = [];
4000    formatTypes.forEach(function (type) {
4001      if (type.__experimentalCreatePrepareEditableTree) {
4002        var selected = keyedSelected[type.name];
4003  
4004        var handler = type.__experimentalCreatePrepareEditableTree(selected, {
4005          richTextIdentifier: identifier,
4006          blockClientId: clientId
4007        });
4008  
4009        if (type.__experimentalCreateOnChangeEditableValue) {
4010          valueHandlers.push(handler);
4011        } else {
4012          prepareHandlers.push(handler);
4013        }
4014  
4015        for (var key in selected) {
4016          dependencies.push(selected[key]);
4017        }
4018      }
4019  
4020      if (type.__experimentalCreateOnChangeEditableValue) {
4021        var dispatchers = {};
4022  
4023        if (type.__experimentalGetPropsForEditableTreeChangeHandler) {
4024          dispatchers = type.__experimentalGetPropsForEditableTreeChangeHandler(dispatch, {
4025            richTextIdentifier: identifier,
4026            blockClientId: clientId
4027          });
4028        }
4029  
4030        changeHandlers.push(type.__experimentalCreateOnChangeEditableValue(use_format_types_objectSpread(use_format_types_objectSpread({}, keyedSelected[type.name] || {}), dispatchers), {
4031          richTextIdentifier: identifier,
4032          blockClientId: clientId
4033        }));
4034      }
4035    });
4036    return {
4037      formatTypes: formatTypes,
4038      prepareHandlers: prepareHandlers,
4039      valueHandlers: valueHandlers,
4040      changeHandlers: changeHandlers,
4041      dependencies: dependencies
4042    };
4043  }
4044  
4045  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/use-boundary-style.js
4046  /**
4047   * WordPress dependencies
4048   */
4049  
4050  /*
4051   * Calculates and renders the format boundary style when the active formats
4052   * change.
4053   */
4054  
4055  function useBoundaryStyle(_ref) {
4056    var activeFormats = _ref.activeFormats,
4057        ref = _ref.ref;
4058    Object(external_this_wp_element_["useEffect"])(function () {
4059      // There's no need to recalculate the boundary styles if no formats are
4060      // active, because no boundary styles will be visible.
4061      if (!activeFormats || !activeFormats.length) {
4062        return;
4063      }
4064  
4065      var boundarySelector = '*[data-rich-text-format-boundary]';
4066      var element = ref.current.querySelector(boundarySelector);
4067  
4068      if (!element) {
4069        return;
4070      }
4071  
4072      var ownerDocument = element.ownerDocument;
4073      var defaultView = ownerDocument.defaultView;
4074      var computedStyle = defaultView.getComputedStyle(element);
4075      var newColor = computedStyle.color.replace(')', ', 0.2)').replace('rgb', 'rgba');
4076      var selector = ".rich-text:focus ".concat(boundarySelector);
4077      var rule = "background-color: ".concat(newColor);
4078      var style = "".concat(selector, " {").concat(rule, "}");
4079      var globalStyleId = 'rich-text-boundary-style';
4080      var globalStyle = ownerDocument.getElementById(globalStyleId);
4081  
4082      if (!globalStyle) {
4083        globalStyle = ownerDocument.createElement('style');
4084        globalStyle.id = globalStyleId;
4085        ownerDocument.head.appendChild(globalStyle);
4086      }
4087  
4088      if (globalStyle.innerHTML !== style) {
4089        globalStyle.innerHTML = style;
4090      }
4091    }, [activeFormats]);
4092  }
4093  
4094  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/use-inline-warning.js
4095  /**
4096   * WordPress dependencies
4097   */
4098  
4099  function useInlineWarning(_ref) {
4100    var ref = _ref.ref;
4101    Object(external_this_wp_element_["useEffect"])(function () {
4102      if (false) { var computedStyle, defaultView, target; }
4103    }, []);
4104  }
4105  
4106  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/component/index.js
4107  
4108  
4109  
4110  
4111  function component_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
4112  
4113  function component_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { component_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { component_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4114  
4115  /**
4116   * External dependencies
4117   */
4118  
4119  /**
4120   * WordPress dependencies
4121   */
4122  
4123  
4124  
4125  
4126  /**
4127   * Internal dependencies
4128   */
4129  
4130  
4131  
4132  
4133  
4134  
4135  
4136  
4137  
4138  
4139  
4140  
4141  
4142  
4143  
4144  
4145  
4146  
4147  /** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
4148  
4149  /**
4150   * All inserting input types that would insert HTML into the DOM.
4151   *
4152   * @see https://www.w3.org/TR/input-events-2/#interface-InputEvent-Attributes
4153   *
4154   * @type {Set}
4155   */
4156  
4157  var INSERTION_INPUT_TYPES_TO_IGNORE = new Set(['insertParagraph', 'insertOrderedList', 'insertUnorderedList', 'insertHorizontalRule', 'insertLink']);
4158  /**
4159   * In HTML, leading and trailing spaces are not visible, and multiple spaces
4160   * elsewhere are visually reduced to one space. This rule prevents spaces from
4161   * collapsing so all space is visible in the editor and can be removed. It also
4162   * prevents some browsers from inserting non-breaking spaces at the end of a
4163   * line to prevent the space from visually disappearing. Sometimes these non
4164   * breaking spaces can linger in the editor causing unwanted non breaking spaces
4165   * in between words. If also prevent Firefox from inserting a trailing `br` node
4166   * to visualise any trailing space, causing the element to be saved.
4167   *
4168   * > Authors are encouraged to set the 'white-space' property on editing hosts
4169   * > and on markup that was originally created through these editing mechanisms
4170   * > to the value 'pre-wrap'. Default HTML whitespace handling is not well
4171   * > suited to WYSIWYG editing, and line wrapping will not work correctly in
4172   * > some corner cases if 'white-space' is left at its default value.
4173   *
4174   * https://html.spec.whatwg.org/multipage/interaction.html#best-practices-for-in-page-editors
4175   *
4176   * @type {string}
4177   */
4178  
4179  var whiteSpace = 'pre-wrap';
4180  /**
4181   * Default style object for the editable element.
4182   *
4183   * @type {Object<string,string>}
4184   */
4185  
4186  var defaultStyle = {
4187    whiteSpace: whiteSpace
4188  };
4189  var EMPTY_ACTIVE_FORMATS = [];
4190  
4191  function createPrepareEditableTree(fns) {
4192    return function (value) {
4193      return fns.reduce(function (accumulator, fn) {
4194        return fn(accumulator, value.text);
4195      }, value.formats);
4196    };
4197  }
4198  /**
4199   * If the selection is set on the placeholder element, collapse the selection to
4200   * the start (before the placeholder).
4201   *
4202   * @param {Window} defaultView
4203   */
4204  
4205  
4206  function fixPlaceholderSelection(defaultView) {
4207    var selection = defaultView.getSelection();
4208    var anchorNode = selection.anchorNode,
4209        anchorOffset = selection.anchorOffset;
4210  
4211    if (anchorNode.nodeType !== anchorNode.ELEMENT_NODE) {
4212      return;
4213    }
4214  
4215    var targetNode = anchorNode.childNodes[anchorOffset];
4216  
4217    if (!targetNode || targetNode.nodeType !== targetNode.ELEMENT_NODE || !targetNode.getAttribute('data-rich-text-placeholder')) {
4218      return;
4219    }
4220  
4221    selection.collapseToStart();
4222  }
4223  
4224  function RichText(_ref, ref) {
4225    var _ref$tagName = _ref.tagName,
4226        TagName = _ref$tagName === void 0 ? 'div' : _ref$tagName,
4227        _ref$value = _ref.value,
4228        value = _ref$value === void 0 ? '' : _ref$value,
4229        selectionStart = _ref.selectionStart,
4230        selectionEnd = _ref.selectionEnd,
4231        children = _ref.children,
4232        allowedFormats = _ref.allowedFormats,
4233        withoutInteractiveFormatting = _ref.withoutInteractiveFormatting,
4234        placeholder = _ref.placeholder,
4235        disabled = _ref.disabled,
4236        preserveWhiteSpace = _ref.preserveWhiteSpace,
4237        onPaste = _ref.onPaste,
4238        _ref$format = _ref.format,
4239        format = _ref$format === void 0 ? 'string' : _ref$format,
4240        onDelete = _ref.onDelete,
4241        onEnter = _ref.onEnter,
4242        onSelectionChange = _ref.onSelectionChange,
4243        onChange = _ref.onChange,
4244        onFocus = _ref.unstableOnFocus,
4245        setFocusedElement = _ref.setFocusedElement,
4246        instanceId = _ref.instanceId,
4247        clientId = _ref.clientId,
4248        identifier = _ref.identifier,
4249        multilineTag = _ref.__unstableMultilineTag,
4250        multilineRootTag = _ref.__unstableMultilineRootTag,
4251        disableFormats = _ref.__unstableDisableFormats,
4252        didAutomaticChange = _ref.__unstableDidAutomaticChange,
4253        inputRule = _ref.__unstableInputRule,
4254        markAutomaticChange = _ref.__unstableMarkAutomaticChange,
4255        allowPrefixTransformations = _ref.__unstableAllowPrefixTransformations,
4256        undo = _ref.__unstableUndo,
4257        isCaretWithinFormattedText = _ref.__unstableIsCaretWithinFormattedText,
4258        onEnterFormattedText = _ref.__unstableOnEnterFormattedText,
4259        onExitFormattedText = _ref.__unstableOnExitFormattedText,
4260        onCreateUndoLevel = _ref.__unstableOnCreateUndoLevel,
4261        isSelected = _ref.__unstableIsSelected;
4262  
4263    var _useState = Object(external_this_wp_element_["useState"])(),
4264        _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
4265        _useState2$ = _useState2[0],
4266        activeFormats = _useState2$ === void 0 ? [] : _useState2$,
4267        setActiveFormats = _useState2[1];
4268  
4269    var _useFormatTypes = useFormatTypes({
4270      clientId: clientId,
4271      identifier: identifier
4272    }),
4273        formatTypes = _useFormatTypes.formatTypes,
4274        prepareHandlers = _useFormatTypes.prepareHandlers,
4275        valueHandlers = _useFormatTypes.valueHandlers,
4276        changeHandlers = _useFormatTypes.changeHandlers,
4277        dependencies = _useFormatTypes.dependencies; // For backward compatibility, fall back to tagName if it's a string.
4278    // tagName can now be a component for light blocks.
4279  
4280  
4281    if (!multilineRootTag && typeof TagName === 'string') {
4282      multilineRootTag = TagName;
4283    }
4284  
4285    function getDoc() {
4286      return ref.current.ownerDocument;
4287    }
4288  
4289    function getWin() {
4290      return getDoc().defaultView;
4291    }
4292    /**
4293     * Converts the outside data structure to our internal representation.
4294     *
4295     * @param {*} string The outside value, data type depends on props.
4296     *
4297     * @return {Object} An internal rich-text value.
4298     */
4299  
4300  
4301    function formatToValue(string) {
4302      if (disableFormats) {
4303        return {
4304          text: string,
4305          formats: Array(string.length),
4306          replacements: Array(string.length)
4307        };
4308      }
4309  
4310      if (format !== 'string') {
4311        return string;
4312      }
4313  
4314      var prepare = createPrepareEditableTree(valueHandlers);
4315      var result = create({
4316        html: string,
4317        multilineTag: multilineTag,
4318        multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
4319        preserveWhiteSpace: preserveWhiteSpace
4320      });
4321      result.formats = prepare(result);
4322      return result;
4323    }
4324    /**
4325     * Removes editor only formats from the value.
4326     *
4327     * Editor only formats are applied using `prepareEditableTree`, so we need to
4328     * remove them before converting the internal state
4329     *
4330     * @param {Object} val The internal rich-text value.
4331     *
4332     * @return {Object} A new rich-text value.
4333     */
4334  
4335  
4336    function removeEditorOnlyFormats(val) {
4337      formatTypes.forEach(function (formatType) {
4338        // Remove formats created by prepareEditableTree, because they are editor only.
4339        if (formatType.__experimentalCreatePrepareEditableTree) {
4340          val = removeFormat(val, formatType.name, 0, val.text.length);
4341        }
4342      });
4343      return val;
4344    }
4345    /**
4346     * Converts the internal value to the external data format.
4347     *
4348     * @param {Object} val The internal rich-text value.
4349     *
4350     * @return {*} The external data format, data type depends on props.
4351     */
4352  
4353  
4354    function valueToFormat(val) {
4355      if (disableFormats) {
4356        return val.text;
4357      }
4358  
4359      val = removeEditorOnlyFormats(val);
4360  
4361      if (format !== 'string') {
4362        return;
4363      }
4364  
4365      return toHTMLString({
4366        value: val,
4367        multilineTag: multilineTag,
4368        preserveWhiteSpace: preserveWhiteSpace
4369      });
4370    } // Internal values are updated synchronously, unlike props and state.
4371  
4372  
4373    var _value = Object(external_this_wp_element_["useRef"])(value);
4374  
4375    var record = Object(external_this_wp_element_["useRef"])(Object(external_this_wp_element_["useMemo"])(function () {
4376      var initialRecord = formatToValue(value);
4377      initialRecord.start = selectionStart;
4378      initialRecord.end = selectionEnd;
4379      return initialRecord;
4380    }, []));
4381  
4382    function createRecord() {
4383      var selection = getWin().getSelection();
4384      var range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;
4385      return create({
4386        element: ref.current,
4387        range: range,
4388        multilineTag: multilineTag,
4389        multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
4390        __unstableIsEditableTree: true,
4391        preserveWhiteSpace: preserveWhiteSpace
4392      });
4393    }
4394  
4395    function applyRecord(newRecord) {
4396      var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
4397          domOnly = _ref2.domOnly;
4398  
4399      apply({
4400        value: newRecord,
4401        current: ref.current,
4402        multilineTag: multilineTag,
4403        multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
4404        prepareEditableTree: createPrepareEditableTree(prepareHandlers),
4405        __unstableDomOnly: domOnly,
4406        placeholder: placeholder
4407      });
4408    }
4409    /**
4410     * Handles a paste event.
4411     *
4412     * Saves the pasted data as plain text in `pastedPlainText`.
4413     *
4414     * @param {ClipboardEvent} event The paste event.
4415     */
4416  
4417  
4418    function handlePaste(event) {
4419      if (!isSelected) {
4420        event.preventDefault();
4421        return;
4422      }
4423  
4424      var clipboardData = event.clipboardData;
4425      var items = clipboardData.items,
4426          files = clipboardData.files; // In Edge these properties can be null instead of undefined, so a more
4427      // rigorous test is required over using default values.
4428  
4429      items = Object(external_this_lodash_["isNil"])(items) ? [] : items;
4430      files = Object(external_this_lodash_["isNil"])(files) ? [] : files;
4431      var plainText = '';
4432      var html = ''; // IE11 only supports `Text` as an argument for `getData` and will
4433      // otherwise throw an invalid argument error, so we try the standard
4434      // arguments first, then fallback to `Text` if they fail.
4435  
4436      try {
4437        plainText = clipboardData.getData('text/plain');
4438        html = clipboardData.getData('text/html');
4439      } catch (error1) {
4440        try {
4441          html = clipboardData.getData('Text');
4442        } catch (error2) {
4443          // Some browsers like UC Browser paste plain text by default and
4444          // don't support clipboardData at all, so allow default
4445          // behaviour.
4446          return;
4447        }
4448      }
4449  
4450      event.preventDefault(); // Allows us to ask for this information when we get a report.
4451  
4452      window.console.log('Received HTML:\n\n', html);
4453      window.console.log('Received plain text:\n\n', plainText);
4454  
4455      if (disableFormats) {
4456        handleChange(insert(record.current, plainText));
4457        return;
4458      }
4459  
4460      var transformed = formatTypes.reduce(function (accumlator, _ref3) {
4461        var __unstablePasteRule = _ref3.__unstablePasteRule;
4462  
4463        // Only allow one transform.
4464        if (__unstablePasteRule && accumlator === record.current) {
4465          accumlator = __unstablePasteRule(record.current, {
4466            html: html,
4467            plainText: plainText
4468          });
4469        }
4470  
4471        return accumlator;
4472      }, record.current);
4473  
4474      if (transformed !== record.current) {
4475        handleChange(transformed);
4476        return;
4477      }
4478  
4479      if (onPaste) {
4480        files = Array.from(files);
4481        Array.from(items).forEach(function (item) {
4482          if (!item.getAsFile) {
4483            return;
4484          }
4485  
4486          var file = item.getAsFile();
4487  
4488          if (!file) {
4489            return;
4490          }
4491  
4492          var name = file.name,
4493              type = file.type,
4494              size = file.size;
4495  
4496          if (!Object(external_this_lodash_["find"])(files, {
4497            name: name,
4498            type: type,
4499            size: size
4500          })) {
4501            files.push(file);
4502          }
4503        });
4504        onPaste({
4505          value: removeEditorOnlyFormats(record.current),
4506          onChange: handleChange,
4507          html: html,
4508          plainText: plainText,
4509          files: files,
4510          activeFormats: activeFormats
4511        });
4512      }
4513    }
4514    /**
4515     * Handles delete on keydown:
4516     * - outdent list items,
4517     * - delete content if everything is selected,
4518     * - trigger the onDelete prop when selection is uncollapsed and at an edge.
4519     *
4520     * @param {WPSyntheticEvent} event A synthetic keyboard event.
4521     */
4522  
4523  
4524    function handleDelete(event) {
4525      var keyCode = event.keyCode;
4526  
4527      if (keyCode !== external_this_wp_keycodes_["DELETE"] && keyCode !== external_this_wp_keycodes_["BACKSPACE"] && keyCode !== external_this_wp_keycodes_["ESCAPE"]) {
4528        return;
4529      }
4530  
4531      if (didAutomaticChange) {
4532        event.preventDefault();
4533        undo();
4534        return;
4535      }
4536  
4537      if (keyCode === external_this_wp_keycodes_["ESCAPE"]) {
4538        return;
4539      }
4540  
4541      var currentValue = createRecord();
4542      var start = currentValue.start,
4543          end = currentValue.end,
4544          text = currentValue.text;
4545      var isReverse = keyCode === external_this_wp_keycodes_["BACKSPACE"]; // Always handle full content deletion ourselves.
4546  
4547      if (start === 0 && end !== 0 && end === text.length) {
4548        handleChange(remove_remove(currentValue));
4549        event.preventDefault();
4550        return;
4551      }
4552  
4553      if (multilineTag) {
4554        var newValue; // Check to see if we should remove the first item if empty.
4555  
4556        if (isReverse && currentValue.start === 0 && currentValue.end === 0 && isEmptyLine(currentValue)) {
4557          newValue = removeLineSeparator(currentValue, !isReverse);
4558        } else {
4559          newValue = removeLineSeparator(currentValue, isReverse);
4560        }
4561  
4562        if (newValue) {
4563          handleChange(newValue);
4564          event.preventDefault();
4565          return;
4566        }
4567      } // Only process delete if the key press occurs at an uncollapsed edge.
4568  
4569  
4570      if (!onDelete || !isCollapsed(currentValue) || activeFormats.length || isReverse && start !== 0 || !isReverse && end !== text.length) {
4571        return;
4572      }
4573  
4574      onDelete({
4575        isReverse: isReverse,
4576        value: currentValue
4577      });
4578      event.preventDefault();
4579    }
4580    /**
4581     * Triggers the `onEnter` prop on keydown.
4582     *
4583     * @param {WPSyntheticEvent} event A synthetic keyboard event.
4584     */
4585  
4586  
4587    function handleEnter(event) {
4588      if (event.keyCode !== external_this_wp_keycodes_["ENTER"]) {
4589        return;
4590      }
4591  
4592      event.preventDefault();
4593  
4594      if (!onEnter) {
4595        return;
4596      }
4597  
4598      onEnter({
4599        value: removeEditorOnlyFormats(createRecord()),
4600        onChange: handleChange,
4601        shiftKey: event.shiftKey
4602      });
4603    }
4604    /**
4605     * Indents list items on space keydown.
4606     *
4607     * @param {WPSyntheticEvent} event A synthetic keyboard event.
4608     */
4609  
4610  
4611    function handleSpace(event) {
4612      var keyCode = event.keyCode,
4613          shiftKey = event.shiftKey,
4614          altKey = event.altKey,
4615          metaKey = event.metaKey,
4616          ctrlKey = event.ctrlKey;
4617  
4618      if ( // Only override when no modifiers are pressed.
4619      shiftKey || altKey || metaKey || ctrlKey || keyCode !== external_this_wp_keycodes_["SPACE"] || multilineTag !== 'li') {
4620        return;
4621      }
4622  
4623      var currentValue = createRecord();
4624  
4625      if (!isCollapsed(currentValue)) {
4626        return;
4627      }
4628  
4629      var text = currentValue.text,
4630          start = currentValue.start;
4631      var characterBefore = text[start - 1]; // The caret must be at the start of a line.
4632  
4633      if (characterBefore && characterBefore !== LINE_SEPARATOR) {
4634        return;
4635      }
4636  
4637      handleChange(indentListItems(currentValue, {
4638        type: multilineRootTag
4639      }));
4640      event.preventDefault();
4641    }
4642    /**
4643     * Handles horizontal keyboard navigation when no modifiers are pressed. The
4644     * navigation is handled separately to move correctly around format
4645     * boundaries.
4646     *
4647     * @param {WPSyntheticEvent} event A synthetic keyboard event.
4648     */
4649  
4650  
4651    function handleHorizontalNavigation(event) {
4652      var keyCode = event.keyCode,
4653          shiftKey = event.shiftKey,
4654          altKey = event.altKey,
4655          metaKey = event.metaKey,
4656          ctrlKey = event.ctrlKey;
4657  
4658      if ( // Only override left and right keys without modifiers pressed.
4659      shiftKey || altKey || metaKey || ctrlKey || keyCode !== external_this_wp_keycodes_["LEFT"] && keyCode !== external_this_wp_keycodes_["RIGHT"]) {
4660        return;
4661      }
4662  
4663      var _record$current = record.current,
4664          text = _record$current.text,
4665          formats = _record$current.formats,
4666          start = _record$current.start,
4667          end = _record$current.end,
4668          _record$current$activ = _record$current.activeFormats,
4669          currentActiveFormats = _record$current$activ === void 0 ? [] : _record$current$activ;
4670      var collapsed = isCollapsed(record.current); // To do: ideally, we should look at visual position instead.
4671  
4672      var _getWin$getComputedSt = getWin().getComputedStyle(ref.current),
4673          direction = _getWin$getComputedSt.direction;
4674  
4675      var reverseKey = direction === 'rtl' ? external_this_wp_keycodes_["RIGHT"] : external_this_wp_keycodes_["LEFT"];
4676      var isReverse = event.keyCode === reverseKey; // If the selection is collapsed and at the very start, do nothing if
4677      // navigating backward.
4678      // If the selection is collapsed and at the very end, do nothing if
4679      // navigating forward.
4680  
4681      if (collapsed && currentActiveFormats.length === 0) {
4682        if (start === 0 && isReverse) {
4683          return;
4684        }
4685  
4686        if (end === text.length && !isReverse) {
4687          return;
4688        }
4689      } // If the selection is not collapsed, let the browser handle collapsing
4690      // the selection for now. Later we could expand this logic to set
4691      // boundary positions if needed.
4692  
4693  
4694      if (!collapsed) {
4695        return;
4696      } // In all other cases, prevent default behaviour.
4697  
4698  
4699      event.preventDefault();
4700      var formatsBefore = formats[start - 1] || EMPTY_ACTIVE_FORMATS;
4701      var formatsAfter = formats[start] || EMPTY_ACTIVE_FORMATS;
4702      var newActiveFormatsLength = currentActiveFormats.length;
4703      var source = formatsAfter;
4704  
4705      if (formatsBefore.length > formatsAfter.length) {
4706        source = formatsBefore;
4707      } // If the amount of formats before the caret and after the caret is
4708      // different, the caret is at a format boundary.
4709  
4710  
4711      if (formatsBefore.length < formatsAfter.length) {
4712        if (!isReverse && currentActiveFormats.length < formatsAfter.length) {
4713          newActiveFormatsLength++;
4714        }
4715  
4716        if (isReverse && currentActiveFormats.length > formatsBefore.length) {
4717          newActiveFormatsLength--;
4718        }
4719      } else if (formatsBefore.length > formatsAfter.length) {
4720        if (!isReverse && currentActiveFormats.length > formatsAfter.length) {
4721          newActiveFormatsLength--;
4722        }
4723  
4724        if (isReverse && currentActiveFormats.length < formatsBefore.length) {
4725          newActiveFormatsLength++;
4726        }
4727      }
4728  
4729      if (newActiveFormatsLength !== currentActiveFormats.length) {
4730        var _newActiveFormats = source.slice(0, newActiveFormatsLength);
4731  
4732        var _newValue = component_objectSpread(component_objectSpread({}, record.current), {}, {
4733          activeFormats: _newActiveFormats
4734        });
4735  
4736        record.current = _newValue;
4737        applyRecord(_newValue);
4738        setActiveFormats(_newActiveFormats);
4739        return;
4740      }
4741  
4742      var newPos = start + (isReverse ? -1 : 1);
4743      var newActiveFormats = isReverse ? formatsBefore : formatsAfter;
4744  
4745      var newValue = component_objectSpread(component_objectSpread({}, record.current), {}, {
4746        start: newPos,
4747        end: newPos,
4748        activeFormats: newActiveFormats
4749      });
4750  
4751      record.current = newValue;
4752      applyRecord(newValue);
4753      onSelectionChange(newPos, newPos);
4754      setActiveFormats(newActiveFormats);
4755    }
4756  
4757    function handleKeyDown(event) {
4758      if (event.defaultPrevented) {
4759        return;
4760      }
4761  
4762      handleDelete(event);
4763      handleEnter(event);
4764      handleSpace(event);
4765      handleHorizontalNavigation(event);
4766    }
4767  
4768    var lastHistoryValue = Object(external_this_wp_element_["useRef"])(value);
4769  
4770    function createUndoLevel() {
4771      // If the content is the same, no level needs to be created.
4772      if (lastHistoryValue.current === _value.current) {
4773        return;
4774      }
4775  
4776      onCreateUndoLevel();
4777      lastHistoryValue.current = _value.current;
4778    }
4779  
4780    var isComposing = Object(external_this_wp_element_["useRef"])(false);
4781    var timeout = Object(external_this_wp_element_["useRef"])();
4782    /**
4783     * Handle input on the next selection change event.
4784     *
4785     * @param {WPSyntheticEvent} event Synthetic input event.
4786     */
4787  
4788    function handleInput(event) {
4789      // Do not trigger a change if characters are being composed. Browsers
4790      // will usually emit a final `input` event when the characters are
4791      // composed.
4792      // As of December 2019, Safari doesn't support nativeEvent.isComposing.
4793      if (isComposing.current) {
4794        return;
4795      }
4796  
4797      var inputType;
4798  
4799      if (event) {
4800        inputType = event.inputType;
4801      }
4802  
4803      if (!inputType && event && event.nativeEvent) {
4804        inputType = event.nativeEvent.inputType;
4805      } // The browser formatted something or tried to insert HTML.
4806      // Overwrite it. It will be handled later by the format library if
4807      // needed.
4808  
4809  
4810      if (inputType && (inputType.indexOf('format') === 0 || INSERTION_INPUT_TYPES_TO_IGNORE.has(inputType))) {
4811        applyRecord(record.current);
4812        return;
4813      }
4814  
4815      var currentValue = createRecord();
4816      var _record$current2 = record.current,
4817          start = _record$current2.start,
4818          _record$current2$acti = _record$current2.activeFormats,
4819          oldActiveFormats = _record$current2$acti === void 0 ? [] : _record$current2$acti; // Update the formats between the last and new caret position.
4820  
4821      var change = updateFormats({
4822        value: currentValue,
4823        start: start,
4824        end: currentValue.start,
4825        formats: oldActiveFormats
4826      });
4827      handleChange(change, {
4828        withoutHistory: true
4829      }); // Create an undo level when input stops for over a second.
4830  
4831      getWin().clearTimeout(timeout.current);
4832      timeout.current = getWin().setTimeout(createUndoLevel, 1000); // Only run input rules when inserting text.
4833  
4834      if (inputType !== 'insertText') {
4835        return;
4836      }
4837  
4838      if (allowPrefixTransformations && inputRule) {
4839        inputRule(change, valueToFormat);
4840      }
4841  
4842      var transformed = formatTypes.reduce(function (accumlator, _ref4) {
4843        var __unstableInputRule = _ref4.__unstableInputRule;
4844  
4845        if (__unstableInputRule) {
4846          accumlator = __unstableInputRule(accumlator);
4847        }
4848  
4849        return accumlator;
4850      }, change);
4851  
4852      if (transformed !== change) {
4853        createUndoLevel();
4854        handleChange(component_objectSpread(component_objectSpread({}, transformed), {}, {
4855          activeFormats: oldActiveFormats
4856        }));
4857        markAutomaticChange();
4858      }
4859    }
4860  
4861    function handleCompositionStart() {
4862      isComposing.current = true; // Do not update the selection when characters are being composed as
4863      // this rerenders the component and might distroy internal browser
4864      // editing state.
4865  
4866      getDoc().removeEventListener('selectionchange', handleSelectionChange);
4867    }
4868  
4869    function handleCompositionEnd() {
4870      isComposing.current = false; // Ensure the value is up-to-date for browsers that don't emit a final
4871      // input event after composition.
4872  
4873      handleInput({
4874        inputType: 'insertText'
4875      }); // Tracking selection changes can be resumed.
4876  
4877      getDoc().addEventListener('selectionchange', handleSelectionChange);
4878    }
4879  
4880    var didMount = Object(external_this_wp_element_["useRef"])(false);
4881    /**
4882     * Syncs the selection to local state. A callback for the `selectionchange`
4883     * native events, `keyup`, `mouseup` and `touchend` synthetic events, and
4884     * animation frames after the `focus` event.
4885     *
4886     * @param {Event|WPSyntheticEvent|DOMHighResTimeStamp} event
4887     */
4888  
4889    function handleSelectionChange(event) {
4890      if (!ref.current) {
4891        return;
4892      }
4893  
4894      if (ref.current.ownerDocument.activeElement !== ref.current) {
4895        return;
4896      }
4897  
4898      if (event.type !== 'selectionchange' && !isSelected) {
4899        return;
4900      }
4901  
4902      if (disabled) {
4903        return;
4904      } // In case of a keyboard event, ignore selection changes during
4905      // composition.
4906  
4907  
4908      if (isComposing.current) {
4909        return;
4910      }
4911  
4912      var _createRecord = createRecord(),
4913          start = _createRecord.start,
4914          end = _createRecord.end,
4915          text = _createRecord.text;
4916  
4917      var oldRecord = record.current; // Fallback mechanism for IE11, which doesn't support the input event.
4918      // Any input results in a selection change.
4919  
4920      if (text !== oldRecord.text) {
4921        handleInput();
4922        return;
4923      }
4924  
4925      if (start === oldRecord.start && end === oldRecord.end) {
4926        // Sometimes the browser may set the selection on the placeholder
4927        // element, in which case the caret is not visible. We need to set
4928        // the caret before the placeholder if that's the case.
4929        if (oldRecord.text.length === 0 && start === 0) {
4930          fixPlaceholderSelection(getWin());
4931        }
4932  
4933        return;
4934      }
4935  
4936      var newValue = component_objectSpread(component_objectSpread({}, oldRecord), {}, {
4937        start: start,
4938        end: end,
4939        // Allow `getActiveFormats` to get new `activeFormats`.
4940        activeFormats: undefined
4941      });
4942  
4943      var newActiveFormats = getActiveFormats(newValue, EMPTY_ACTIVE_FORMATS); // Update the value with the new active formats.
4944  
4945      newValue.activeFormats = newActiveFormats;
4946  
4947      if (!isCaretWithinFormattedText && newActiveFormats.length) {
4948        onEnterFormattedText();
4949      } else if (isCaretWithinFormattedText && !newActiveFormats.length) {
4950        onExitFormattedText();
4951      } // It is important that the internal value is updated first,
4952      // otherwise the value will be wrong on render!
4953  
4954  
4955      record.current = newValue;
4956      applyRecord(newValue, {
4957        domOnly: true
4958      });
4959      onSelectionChange(start, end);
4960      setActiveFormats(newActiveFormats);
4961    }
4962    /**
4963     * Sync the value to global state. The node tree and selection will also be
4964     * updated if differences are found.
4965     *
4966     * @param {Object}  newRecord         The record to sync and apply.
4967     * @param {Object}  $2                Named options.
4968     * @param {boolean} $2.withoutHistory If true, no undo level will be
4969     *                                    created.
4970     */
4971  
4972  
4973    function handleChange(newRecord) {
4974      var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
4975          withoutHistory = _ref5.withoutHistory;
4976  
4977      if (disableFormats) {
4978        newRecord.formats = Array(newRecord.text.length);
4979        newRecord.replacements = Array(newRecord.text.length);
4980      }
4981  
4982      applyRecord(newRecord);
4983      var start = newRecord.start,
4984          end = newRecord.end,
4985          _newRecord$activeForm = newRecord.activeFormats,
4986          newActiveFormats = _newRecord$activeForm === void 0 ? [] : _newRecord$activeForm;
4987      Object.values(changeHandlers).forEach(function (changeHandler) {
4988        changeHandler(newRecord.formats, newRecord.text);
4989      });
4990      _value.current = valueToFormat(newRecord);
4991      record.current = newRecord; // Selection must be updated first, so it is recorded in history when
4992      // the content change happens.
4993  
4994      onSelectionChange(start, end);
4995      onChange(_value.current);
4996      setActiveFormats(newActiveFormats);
4997  
4998      if (!withoutHistory) {
4999        createUndoLevel();
5000      }
5001    }
5002    /**
5003     * Select object when they are clicked. The browser will not set any
5004     * selection when clicking e.g. an image.
5005     *
5006     * @param {WPSyntheticEvent} event Synthetic mousedown or touchstart event.
5007     */
5008  
5009  
5010    function handlePointerDown(event) {
5011      var target = event.target; // If the child element has no text content, it must be an object.
5012  
5013      if (target === ref.current || target.textContent) {
5014        return;
5015      }
5016  
5017      var parentNode = target.parentNode;
5018      var index = Array.from(parentNode.childNodes).indexOf(target);
5019      var range = getDoc().createRange();
5020      var selection = getWin().getSelection();
5021      range.setStart(target.parentNode, index);
5022      range.setEnd(target.parentNode, index + 1);
5023      selection.removeAllRanges();
5024      selection.addRange(range);
5025    }
5026  
5027    var rafId = Object(external_this_wp_element_["useRef"])();
5028    /**
5029     * Handles a focus event on the contenteditable field, calling the
5030     * `unstableOnFocus` prop callback if one is defined. The callback does not
5031     * receive any arguments.
5032     *
5033     * This is marked as a private API and the `unstableOnFocus` prop is not
5034     * documented, as the current requirements where it is used are subject to
5035     * future refactoring following `isSelected` handling.
5036     *
5037     * In contrast with `setFocusedElement`, this is only triggered in response
5038     * to focus within the contenteditable field, whereas `setFocusedElement`
5039     * is triggered on focus within any `RichText` descendent element.
5040     *
5041     * @see setFocusedElement
5042     *
5043     * @private
5044     */
5045  
5046    function handleFocus() {
5047      if (onFocus) {
5048        onFocus();
5049      }
5050  
5051      if (!isSelected) {
5052        // We know for certain that on focus, the old selection is invalid.
5053        // It will be recalculated on the next mouseup, keyup, or touchend
5054        // event.
5055        var index = undefined;
5056        record.current = component_objectSpread(component_objectSpread({}, record.current), {}, {
5057          start: index,
5058          end: index,
5059          activeFormats: EMPTY_ACTIVE_FORMATS
5060        });
5061        onSelectionChange(index, index);
5062        setActiveFormats(EMPTY_ACTIVE_FORMATS);
5063      } else {
5064        onSelectionChange(record.current.start, record.current.end);
5065        setActiveFormats(getActiveFormats(component_objectSpread(component_objectSpread({}, record.current), {}, {
5066          activeFormats: undefined
5067        }), EMPTY_ACTIVE_FORMATS));
5068      } // Update selection as soon as possible, which is at the next animation
5069      // frame. The event listener for selection changes may be added too late
5070      // at this point, but this focus event is still too early to calculate
5071      // the selection.
5072  
5073  
5074      rafId.current = getWin().requestAnimationFrame(handleSelectionChange);
5075      getDoc().addEventListener('selectionchange', handleSelectionChange);
5076  
5077      if (setFocusedElement) {
5078        external_this_wp_deprecated_default()('wp.blockEditor.RichText setFocusedElement prop', {
5079          alternative: 'selection state from the block editor store.'
5080        });
5081        setFocusedElement(instanceId);
5082      }
5083    }
5084  
5085    function handleBlur() {
5086      getDoc().removeEventListener('selectionchange', handleSelectionChange);
5087    }
5088  
5089    function applyFromProps() {
5090      _value.current = value;
5091      record.current = formatToValue(value);
5092      record.current.start = selectionStart;
5093      record.current.end = selectionEnd;
5094      applyRecord(record.current);
5095    }
5096  
5097    Object(external_this_wp_element_["useEffect"])(function () {
5098      if (didMount.current) {
5099        applyFromProps();
5100      }
5101    }, [TagName, placeholder]);
5102    Object(external_this_wp_element_["useEffect"])(function () {
5103      if (didMount.current && value !== _value.current) {
5104        applyFromProps();
5105      }
5106    }, [value]);
5107    Object(external_this_wp_element_["useEffect"])(function () {
5108      if (!didMount.current) {
5109        return;
5110      }
5111  
5112      if (isSelected && (selectionStart !== record.current.start || selectionEnd !== record.current.end)) {
5113        applyFromProps();
5114      } else {
5115        record.current = component_objectSpread(component_objectSpread({}, record.current), {}, {
5116          start: selectionStart,
5117          end: selectionEnd
5118        });
5119      }
5120    }, [selectionStart, selectionEnd, isSelected]);
5121    Object(external_this_wp_element_["useEffect"])(function () {
5122      if (didMount.current) {
5123        applyFromProps();
5124      }
5125    }, dependencies);
5126    Object(external_this_wp_element_["useLayoutEffect"])(function () {
5127      applyRecord(record.current, {
5128        domOnly: true
5129      });
5130      didMount.current = true;
5131      return function () {
5132        getDoc().removeEventListener('selectionchange', handleSelectionChange);
5133        getWin().cancelAnimationFrame(rafId.current);
5134        getWin().clearTimeout(timeout.current);
5135      };
5136    }, []);
5137  
5138    function focus() {
5139      ref.current.focus();
5140      applyRecord(record.current);
5141    }
5142  
5143    var editableProps = {
5144      // Overridable props.
5145      role: 'textbox',
5146      'aria-multiline': true,
5147      'aria-label': placeholder,
5148      ref: ref,
5149      style: defaultStyle,
5150      className: 'rich-text',
5151      onPaste: handlePaste,
5152      onInput: handleInput,
5153      onCompositionStart: handleCompositionStart,
5154      onCompositionEnd: handleCompositionEnd,
5155      onKeyDown: handleKeyDown,
5156      onFocus: handleFocus,
5157      onBlur: handleBlur,
5158      onMouseDown: handlePointerDown,
5159      onTouchStart: handlePointerDown,
5160      // Selection updates must be done at these events as they
5161      // happen before the `selectionchange` event. In some cases,
5162      // the `selectionchange` event may not even fire, for
5163      // example when the window receives focus again on click.
5164      onKeyUp: handleSelectionChange,
5165      onMouseUp: handleSelectionChange,
5166      onTouchEnd: handleSelectionChange,
5167      // Do not set the attribute if disabled.
5168      contentEditable: disabled ? undefined : true,
5169      suppressContentEditableWarning: !disabled
5170    };
5171    useBoundaryStyle({
5172      ref: ref,
5173      activeFormats: activeFormats
5174    });
5175    useInlineWarning({
5176      ref: ref
5177    });
5178    return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, isSelected && Object(external_this_wp_element_["createElement"])(FormatEdit, {
5179      allowedFormats: allowedFormats,
5180      withoutInteractiveFormatting: withoutInteractiveFormatting,
5181      value: record.current,
5182      onChange: handleChange,
5183      onFocus: focus,
5184      formatTypes: formatTypes
5185    }), children && children({
5186      isSelected: isSelected,
5187      value: record.current,
5188      onChange: handleChange,
5189      onFocus: focus,
5190      editableProps: editableProps,
5191      editableTagName: TagName
5192    }), !children && Object(external_this_wp_element_["createElement"])(TagName, editableProps));
5193  }
5194  /**
5195   * Renders a rich content input, providing users with the option to format the
5196   * content.
5197   */
5198  
5199  
5200  /* harmony default export */ var component = (Object(external_this_wp_element_["forwardRef"])(RichText));
5201  
5202  // CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/index.js
5203  /**
5204   * Internal dependencies
5205   */
5206  
5207  
5208  
5209  
5210  
5211  
5212  
5213  
5214  
5215  
5216  
5217  
5218  
5219  
5220  
5221  
5222  
5223  
5224  
5225  
5226  
5227  
5228  
5229  
5230  
5231  
5232  
5233  
5234  
5235  
5236  
5237  
5238  
5239  
5240  
5241  
5242  
5243  /***/ }),
5244  
5245  /***/ 5:
5246  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5247  
5248  "use strict";
5249  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
5250  function _defineProperty(obj, key, value) {
5251    if (key in obj) {
5252      Object.defineProperty(obj, key, {
5253        value: value,
5254        enumerable: true,
5255        configurable: true,
5256        writable: true
5257      });
5258    } else {
5259      obj[key] = value;
5260    }
5261  
5262    return obj;
5263  }
5264  
5265  /***/ })
5266  
5267  /******/ });


Generated: Fri Jan 22 01:00:03 2021 Cross-referenced by PHPXref 0.7.1