wp/wp-includes/js/dist/annotations.js
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    80 /******/ 	// __webpack_public_path__
    80 /******/ 	// __webpack_public_path__
    81 /******/ 	__webpack_require__.p = "";
    81 /******/ 	__webpack_require__.p = "";
    82 /******/
    82 /******/
    83 /******/
    83 /******/
    84 /******/ 	// Load entry module and return exports
    84 /******/ 	// Load entry module and return exports
    85 /******/ 	return __webpack_require__(__webpack_require__.s = 448);
    85 /******/ 	return __webpack_require__(__webpack_require__.s = "23Y4");
    86 /******/ })
    86 /******/ })
    87 /************************************************************************/
    87 /************************************************************************/
    88 /******/ ({
    88 /******/ ({
    89 
    89 
    90 /***/ 1:
    90 /***/ "1ZqX":
    91 /***/ (function(module, exports) {
    91 /***/ (function(module, exports) {
    92 
    92 
    93 (function() { module.exports = this["wp"]["i18n"]; }());
    93 (function() { module.exports = window["wp"]["data"]; }());
    94 
    94 
    95 /***/ }),
    95 /***/ }),
    96 
    96 
    97 /***/ 15:
    97 /***/ "23Y4":
    98 /***/ (function(module, __webpack_exports__, __webpack_require__) {
    98 /***/ (function(module, __webpack_exports__, __webpack_require__) {
    99 
    99 
   100 "use strict";
   100 "use strict";
   101 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
   101 // ESM COMPAT FLAG
   102 /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
   102 __webpack_require__.r(__webpack_exports__);
   103 
   103 
   104 function _objectWithoutProperties(source, excluded) {
   104 // EXPORTS
   105   if (source == null) return {};
   105 __webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; });
   106   var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
   106 
   107   var key, i;
   107 // NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
   108 
   108 var selectors_namespaceObject = {};
   109   if (Object.getOwnPropertySymbols) {
   109 __webpack_require__.r(selectors_namespaceObject);
   110     var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
   110 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotationsForBlock", function() { return __experimentalGetAnnotationsForBlock; });
   111 
   111 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllAnnotationsForBlock", function() { return __experimentalGetAllAnnotationsForBlock; });
   112     for (i = 0; i < sourceSymbolKeys.length; i++) {
   112 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotationsForRichText", function() { return __experimentalGetAnnotationsForRichText; });
   113       key = sourceSymbolKeys[i];
   113 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotations", function() { return __experimentalGetAnnotations; });
   114       if (excluded.indexOf(key) >= 0) continue;
   114 
   115       if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
   115 // NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/actions.js
   116       target[key] = source[key];
   116 var actions_namespaceObject = {};
       
   117 __webpack_require__.r(actions_namespaceObject);
       
   118 __webpack_require__.d(actions_namespaceObject, "__experimentalAddAnnotation", function() { return __experimentalAddAnnotation; });
       
   119 __webpack_require__.d(actions_namespaceObject, "__experimentalRemoveAnnotation", function() { return __experimentalRemoveAnnotation; });
       
   120 __webpack_require__.d(actions_namespaceObject, "__experimentalUpdateAnnotationRange", function() { return __experimentalUpdateAnnotationRange; });
       
   121 __webpack_require__.d(actions_namespaceObject, "__experimentalRemoveAnnotationsBySource", function() { return __experimentalRemoveAnnotationsBySource; });
       
   122 
       
   123 // EXTERNAL MODULE: external ["wp","richText"]
       
   124 var external_wp_richText_ = __webpack_require__("qRz9");
       
   125 
       
   126 // EXTERNAL MODULE: external ["wp","i18n"]
       
   127 var external_wp_i18n_ = __webpack_require__("l3Sj");
       
   128 
       
   129 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/constants.js
       
   130 /**
       
   131  * The identifier for the data store.
       
   132  *
       
   133  * @type {string}
       
   134  */
       
   135 const STORE_NAME = 'core/annotations';
       
   136 
       
   137 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/annotation.js
       
   138 /**
       
   139  * WordPress dependencies
       
   140  */
       
   141 
       
   142 
       
   143 const FORMAT_NAME = 'core/annotation';
       
   144 const ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';
       
   145 /**
       
   146  * Internal dependencies
       
   147  */
       
   148 
       
   149 
       
   150 /**
       
   151  * Applies given annotations to the given record.
       
   152  *
       
   153  * @param {Object} record The record to apply annotations to.
       
   154  * @param {Array} annotations The annotation to apply.
       
   155  * @return {Object} A record with the annotations applied.
       
   156  */
       
   157 
       
   158 function applyAnnotations(record, annotations = []) {
       
   159   annotations.forEach(annotation => {
       
   160     let {
       
   161       start,
       
   162       end
       
   163     } = annotation;
       
   164 
       
   165     if (start > record.text.length) {
       
   166       start = record.text.length;
       
   167     }
       
   168 
       
   169     if (end > record.text.length) {
       
   170       end = record.text.length;
       
   171     }
       
   172 
       
   173     const className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;
       
   174     const id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;
       
   175     record = Object(external_wp_richText_["applyFormat"])(record, {
       
   176       type: FORMAT_NAME,
       
   177       attributes: {
       
   178         className,
       
   179         id
       
   180       }
       
   181     }, start, end);
       
   182   });
       
   183   return record;
       
   184 }
       
   185 /**
       
   186  * Removes annotations from the given record.
       
   187  *
       
   188  * @param {Object} record Record to remove annotations from.
       
   189  * @return {Object} The cleaned record.
       
   190  */
       
   191 
       
   192 function removeAnnotations(record) {
       
   193   return Object(external_wp_richText_["removeFormat"])(record, 'core/annotation', 0, record.text.length);
       
   194 }
       
   195 /**
       
   196  * Retrieves the positions of annotations inside an array of formats.
       
   197  *
       
   198  * @param {Array} formats Formats with annotations in there.
       
   199  * @return {Object} ID keyed positions of annotations.
       
   200  */
       
   201 
       
   202 function retrieveAnnotationPositions(formats) {
       
   203   const positions = {};
       
   204   formats.forEach((characterFormats, i) => {
       
   205     characterFormats = characterFormats || [];
       
   206     characterFormats = characterFormats.filter(format => format.type === FORMAT_NAME);
       
   207     characterFormats.forEach(format => {
       
   208       let {
       
   209         id
       
   210       } = format.attributes;
       
   211       id = id.replace(ANNOTATION_ATTRIBUTE_PREFIX, '');
       
   212 
       
   213       if (!positions.hasOwnProperty(id)) {
       
   214         positions[id] = {
       
   215           start: i
       
   216         };
       
   217       } // Annotations refer to positions between characters.
       
   218       // Formats refer to the character themselves.
       
   219       // So we need to adjust for that here.
       
   220 
       
   221 
       
   222       positions[id].end = i + 1;
       
   223     });
       
   224   });
       
   225   return positions;
       
   226 }
       
   227 /**
       
   228  * Updates annotations in the state based on positions retrieved from RichText.
       
   229  *
       
   230  * @param {Array}    annotations                   The annotations that are currently applied.
       
   231  * @param {Array}    positions                     The current positions of the given annotations.
       
   232  * @param {Object}   actions
       
   233  * @param {Function} actions.removeAnnotation      Function to remove an annotation from the state.
       
   234  * @param {Function} actions.updateAnnotationRange Function to update an annotation range in the state.
       
   235  */
       
   236 
       
   237 
       
   238 function updateAnnotationsWithPositions(annotations, positions, {
       
   239   removeAnnotation,
       
   240   updateAnnotationRange
       
   241 }) {
       
   242   annotations.forEach(currentAnnotation => {
       
   243     const position = positions[currentAnnotation.id]; // If we cannot find an annotation, delete it.
       
   244 
       
   245     if (!position) {
       
   246       // Apparently the annotation has been removed, so remove it from the state:
       
   247       // Remove...
       
   248       removeAnnotation(currentAnnotation.id);
       
   249       return;
       
   250     }
       
   251 
       
   252     const {
       
   253       start,
       
   254       end
       
   255     } = currentAnnotation;
       
   256 
       
   257     if (start !== position.start || end !== position.end) {
       
   258       updateAnnotationRange(currentAnnotation.id, position.start, position.end);
       
   259     }
       
   260   });
       
   261 }
       
   262 
       
   263 const annotation_annotation = {
       
   264   name: FORMAT_NAME,
       
   265   title: Object(external_wp_i18n_["__"])('Annotation'),
       
   266   tagName: 'mark',
       
   267   className: 'annotation-text',
       
   268   attributes: {
       
   269     className: 'class',
       
   270     id: 'id'
       
   271   },
       
   272 
       
   273   edit() {
       
   274     return null;
       
   275   },
       
   276 
       
   277   __experimentalGetPropsForEditableTreePreparation(select, {
       
   278     richTextIdentifier,
       
   279     blockClientId
       
   280   }) {
       
   281     return {
       
   282       annotations: select(STORE_NAME).__experimentalGetAnnotationsForRichText(blockClientId, richTextIdentifier)
       
   283     };
       
   284   },
       
   285 
       
   286   __experimentalCreatePrepareEditableTree({
       
   287     annotations
       
   288   }) {
       
   289     return (formats, text) => {
       
   290       if (annotations.length === 0) {
       
   291         return formats;
       
   292       }
       
   293 
       
   294       let record = {
       
   295         formats,
       
   296         text
       
   297       };
       
   298       record = applyAnnotations(record, annotations);
       
   299       return record.formats;
       
   300     };
       
   301   },
       
   302 
       
   303   __experimentalGetPropsForEditableTreeChangeHandler(dispatch) {
       
   304     return {
       
   305       removeAnnotation: dispatch(STORE_NAME).__experimentalRemoveAnnotation,
       
   306       updateAnnotationRange: dispatch(STORE_NAME).__experimentalUpdateAnnotationRange
       
   307     };
       
   308   },
       
   309 
       
   310   __experimentalCreateOnChangeEditableValue(props) {
       
   311     return formats => {
       
   312       const positions = retrieveAnnotationPositions(formats);
       
   313       const {
       
   314         removeAnnotation,
       
   315         updateAnnotationRange,
       
   316         annotations
       
   317       } = props;
       
   318       updateAnnotationsWithPositions(annotations, positions, {
       
   319         removeAnnotation,
       
   320         updateAnnotationRange
       
   321       });
       
   322     };
       
   323   }
       
   324 
       
   325 };
       
   326 
       
   327 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/index.js
       
   328 /**
       
   329  * WordPress dependencies
       
   330  */
       
   331 
       
   332 /**
       
   333  * Internal dependencies
       
   334  */
       
   335 
       
   336 
       
   337 const {
       
   338   name: format_name,
       
   339   ...settings
       
   340 } = annotation_annotation;
       
   341 Object(external_wp_richText_["registerFormatType"])(format_name, settings);
       
   342 
       
   343 // EXTERNAL MODULE: external ["wp","hooks"]
       
   344 var external_wp_hooks_ = __webpack_require__("g56x");
       
   345 
       
   346 // EXTERNAL MODULE: external ["wp","data"]
       
   347 var external_wp_data_ = __webpack_require__("1ZqX");
       
   348 
       
   349 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/block/index.js
       
   350 /**
       
   351  * WordPress dependencies
       
   352  */
       
   353 
       
   354 
       
   355 /**
       
   356  * Internal dependencies
       
   357  */
       
   358 
       
   359 
       
   360 /**
       
   361  * Adds annotation className to the block-list-block component.
       
   362  *
       
   363  * @param {Object} OriginalComponent The original BlockListBlock component.
       
   364  * @return {Object} The enhanced component.
       
   365  */
       
   366 
       
   367 const addAnnotationClassName = OriginalComponent => {
       
   368   return Object(external_wp_data_["withSelect"])((select, {
       
   369     clientId,
       
   370     className
       
   371   }) => {
       
   372     const annotations = select(STORE_NAME).__experimentalGetAnnotationsForBlock(clientId);
       
   373 
       
   374     return {
       
   375       className: annotations.map(annotation => {
       
   376         return 'is-annotated-by-' + annotation.source;
       
   377       }).concat(className).filter(Boolean).join(' ')
       
   378     };
       
   379   })(OriginalComponent);
       
   380 };
       
   381 
       
   382 Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/annotations', addAnnotationClassName);
       
   383 
       
   384 // EXTERNAL MODULE: external "lodash"
       
   385 var external_lodash_ = __webpack_require__("YLtl");
       
   386 
       
   387 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/reducer.js
       
   388 /**
       
   389  * External dependencies
       
   390  */
       
   391 
       
   392 /**
       
   393  * Filters an array based on the predicate, but keeps the reference the same if
       
   394  * the array hasn't changed.
       
   395  *
       
   396  * @param {Array}    collection The collection to filter.
       
   397  * @param {Function} predicate  Function that determines if the item should stay
       
   398  *                              in the array.
       
   399  * @return {Array} Filtered array.
       
   400  */
       
   401 
       
   402 function filterWithReference(collection, predicate) {
       
   403   const filteredCollection = collection.filter(predicate);
       
   404   return collection.length === filteredCollection.length ? collection : filteredCollection;
       
   405 }
       
   406 /**
       
   407  * Verifies whether the given annotations is a valid annotation.
       
   408  *
       
   409  * @param {Object} annotation The annotation to verify.
       
   410  * @return {boolean} Whether the given annotation is valid.
       
   411  */
       
   412 
       
   413 
       
   414 function isValidAnnotationRange(annotation) {
       
   415   return Object(external_lodash_["isNumber"])(annotation.start) && Object(external_lodash_["isNumber"])(annotation.end) && annotation.start <= annotation.end;
       
   416 }
       
   417 /**
       
   418  * Reducer managing annotations.
       
   419  *
       
   420  * @param {Object} state  The annotations currently shown in the editor.
       
   421  * @param {Object} action Dispatched action.
       
   422  *
       
   423  * @return {Array} Updated state.
       
   424  */
       
   425 
       
   426 
       
   427 function reducer_annotations(state = {}, action) {
       
   428   var _state$blockClientId;
       
   429 
       
   430   switch (action.type) {
       
   431     case 'ANNOTATION_ADD':
       
   432       const blockClientId = action.blockClientId;
       
   433       const newAnnotation = {
       
   434         id: action.id,
       
   435         blockClientId,
       
   436         richTextIdentifier: action.richTextIdentifier,
       
   437         source: action.source,
       
   438         selector: action.selector,
       
   439         range: action.range
       
   440       };
       
   441 
       
   442       if (newAnnotation.selector === 'range' && !isValidAnnotationRange(newAnnotation.range)) {
       
   443         return state;
       
   444       }
       
   445 
       
   446       const previousAnnotationsForBlock = (_state$blockClientId = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : [];
       
   447       return { ...state,
       
   448         [blockClientId]: [...previousAnnotationsForBlock, newAnnotation]
       
   449       };
       
   450 
       
   451     case 'ANNOTATION_REMOVE':
       
   452       return Object(external_lodash_["mapValues"])(state, annotationsForBlock => {
       
   453         return filterWithReference(annotationsForBlock, annotation => {
       
   454           return annotation.id !== action.annotationId;
       
   455         });
       
   456       });
       
   457 
       
   458     case 'ANNOTATION_UPDATE_RANGE':
       
   459       return Object(external_lodash_["mapValues"])(state, annotationsForBlock => {
       
   460         let hasChangedRange = false;
       
   461         const newAnnotations = annotationsForBlock.map(annotation => {
       
   462           if (annotation.id === action.annotationId) {
       
   463             hasChangedRange = true;
       
   464             return { ...annotation,
       
   465               range: {
       
   466                 start: action.start,
       
   467                 end: action.end
       
   468               }
       
   469             };
       
   470           }
       
   471 
       
   472           return annotation;
       
   473         });
       
   474         return hasChangedRange ? newAnnotations : annotationsForBlock;
       
   475       });
       
   476 
       
   477     case 'ANNOTATION_REMOVE_SOURCE':
       
   478       return Object(external_lodash_["mapValues"])(state, annotationsForBlock => {
       
   479         return filterWithReference(annotationsForBlock, annotation => {
       
   480           return annotation.source !== action.source;
       
   481         });
       
   482       });
       
   483   }
       
   484 
       
   485   return state;
       
   486 }
       
   487 /* harmony default export */ var reducer = (reducer_annotations);
       
   488 
       
   489 // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
       
   490 var rememo = __webpack_require__("pPDe");
       
   491 
       
   492 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
       
   493 /**
       
   494  * External dependencies
       
   495  */
       
   496 
       
   497 
       
   498 /**
       
   499  * Shared reference to an empty array for cases where it is important to avoid
       
   500  * returning a new array reference on every invocation, as in a connected or
       
   501  * other pure component which performs `shouldComponentUpdate` check on props.
       
   502  * This should be used as a last resort, since the normalized data should be
       
   503  * maintained by the reducer result in state.
       
   504  *
       
   505  * @type {Array}
       
   506  */
       
   507 
       
   508 const EMPTY_ARRAY = [];
       
   509 /**
       
   510  * Returns the annotations for a specific client ID.
       
   511  *
       
   512  * @param {Object} state Editor state.
       
   513  * @param {string} clientId The ID of the block to get the annotations for.
       
   514  *
       
   515  * @return {Array} The annotations applicable to this block.
       
   516  */
       
   517 
       
   518 const __experimentalGetAnnotationsForBlock = Object(rememo["a" /* default */])((state, blockClientId) => {
       
   519   var _state$blockClientId;
       
   520 
       
   521   return ((_state$blockClientId = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : []).filter(annotation => {
       
   522     return annotation.selector === 'block';
       
   523   });
       
   524 }, (state, blockClientId) => {
       
   525   var _state$blockClientId2;
       
   526 
       
   527   return [(_state$blockClientId2 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId2 !== void 0 ? _state$blockClientId2 : EMPTY_ARRAY];
       
   528 });
       
   529 function __experimentalGetAllAnnotationsForBlock(state, blockClientId) {
       
   530   var _state$blockClientId3;
       
   531 
       
   532   return (_state$blockClientId3 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId3 !== void 0 ? _state$blockClientId3 : EMPTY_ARRAY;
       
   533 }
       
   534 /**
       
   535  * Returns the annotations that apply to the given RichText instance.
       
   536  *
       
   537  * Both a blockClientId and a richTextIdentifier are required. This is because
       
   538  * a block might have multiple `RichText` components. This does mean that every
       
   539  * block needs to implement annotations itself.
       
   540  *
       
   541  * @param {Object} state              Editor state.
       
   542  * @param {string} blockClientId      The client ID for the block.
       
   543  * @param {string} richTextIdentifier Unique identifier that identifies the given RichText.
       
   544  * @return {Array} All the annotations relevant for the `RichText`.
       
   545  */
       
   546 
       
   547 const __experimentalGetAnnotationsForRichText = Object(rememo["a" /* default */])((state, blockClientId, richTextIdentifier) => {
       
   548   var _state$blockClientId4;
       
   549 
       
   550   return ((_state$blockClientId4 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId4 !== void 0 ? _state$blockClientId4 : []).filter(annotation => {
       
   551     return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier;
       
   552   }).map(annotation => {
       
   553     const {
       
   554       range,
       
   555       ...other
       
   556     } = annotation;
       
   557     return { ...range,
       
   558       ...other
       
   559     };
       
   560   });
       
   561 }, (state, blockClientId) => {
       
   562   var _state$blockClientId5;
       
   563 
       
   564   return [(_state$blockClientId5 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId5 !== void 0 ? _state$blockClientId5 : EMPTY_ARRAY];
       
   565 });
       
   566 /**
       
   567  * Returns all annotations in the editor state.
       
   568  *
       
   569  * @param {Object} state Editor state.
       
   570  * @return {Array} All annotations currently applied.
       
   571  */
       
   572 
       
   573 function __experimentalGetAnnotations(state) {
       
   574   return Object(external_lodash_["flatMap"])(state, annotations => {
       
   575     return annotations;
       
   576   });
       
   577 }
       
   578 
       
   579 // EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules
       
   580 var v4 = __webpack_require__("7Cbv");
       
   581 
       
   582 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/actions.js
       
   583 /**
       
   584  * External dependencies
       
   585  */
       
   586 
       
   587 /**
       
   588  * @typedef WPAnnotationRange
       
   589  *
       
   590  * @property {number} start The offset where the annotation should start.
       
   591  * @property {number} end   The offset where the annotation should end.
       
   592  */
       
   593 
       
   594 /**
       
   595  * Adds an annotation to a block.
       
   596  *
       
   597  * The `block` attribute refers to a block ID that needs to be annotated.
       
   598  * `isBlockAnnotation` controls whether or not the annotation is a block
       
   599  * annotation. The `source` is the source of the annotation, this will be used
       
   600  * to identity groups of annotations.
       
   601  *
       
   602  * The `range` property is only relevant if the selector is 'range'.
       
   603  *
       
   604  * @param {Object}            annotation                    The annotation to add.
       
   605  * @param {string}            annotation.blockClientId      The blockClientId to add the annotation to.
       
   606  * @param {string}            annotation.richTextIdentifier Identifier for the RichText instance the annotation applies to.
       
   607  * @param {WPAnnotationRange} annotation.range              The range at which to apply this annotation.
       
   608  * @param {string}            [annotation.selector="range"] The way to apply this annotation.
       
   609  * @param {string}            [annotation.source="default"] The source that added the annotation.
       
   610  * @param {string}            [annotation.id]               The ID the annotation should have. Generates a UUID by default.
       
   611  *
       
   612  * @return {Object} Action object.
       
   613  */
       
   614 
       
   615 function __experimentalAddAnnotation({
       
   616   blockClientId,
       
   617   richTextIdentifier = null,
       
   618   range = null,
       
   619   selector = 'range',
       
   620   source = 'default',
       
   621   id = Object(v4["a" /* default */])()
       
   622 }) {
       
   623   const action = {
       
   624     type: 'ANNOTATION_ADD',
       
   625     id,
       
   626     blockClientId,
       
   627     richTextIdentifier,
       
   628     source,
       
   629     selector
       
   630   };
       
   631 
       
   632   if (selector === 'range') {
       
   633     action.range = range;
       
   634   }
       
   635 
       
   636   return action;
       
   637 }
       
   638 /**
       
   639  * Removes an annotation with a specific ID.
       
   640  *
       
   641  * @param {string} annotationId The annotation to remove.
       
   642  *
       
   643  * @return {Object} Action object.
       
   644  */
       
   645 
       
   646 function __experimentalRemoveAnnotation(annotationId) {
       
   647   return {
       
   648     type: 'ANNOTATION_REMOVE',
       
   649     annotationId
       
   650   };
       
   651 }
       
   652 /**
       
   653  * Updates the range of an annotation.
       
   654  *
       
   655  * @param {string} annotationId ID of the annotation to update.
       
   656  * @param {number} start The start of the new range.
       
   657  * @param {number} end The end of the new range.
       
   658  *
       
   659  * @return {Object} Action object.
       
   660  */
       
   661 
       
   662 function __experimentalUpdateAnnotationRange(annotationId, start, end) {
       
   663   return {
       
   664     type: 'ANNOTATION_UPDATE_RANGE',
       
   665     annotationId,
       
   666     start,
       
   667     end
       
   668   };
       
   669 }
       
   670 /**
       
   671  * Removes all annotations of a specific source.
       
   672  *
       
   673  * @param {string} source The source to remove.
       
   674  *
       
   675  * @return {Object} Action object.
       
   676  */
       
   677 
       
   678 function __experimentalRemoveAnnotationsBySource(source) {
       
   679   return {
       
   680     type: 'ANNOTATION_REMOVE_SOURCE',
       
   681     source
       
   682   };
       
   683 }
       
   684 
       
   685 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/index.js
       
   686 /**
       
   687  * WordPress dependencies
       
   688  */
       
   689 
       
   690 /**
       
   691  * Internal dependencies
       
   692  */
       
   693 
       
   694 
       
   695 
       
   696 
       
   697 /**
       
   698  * Module Constants
       
   699  */
       
   700 
       
   701 
       
   702 /**
       
   703  * Store definition for the annotations namespace.
       
   704  *
       
   705  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
       
   706  *
       
   707  * @type {Object}
       
   708  */
       
   709 
       
   710 const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, {
       
   711   reducer: reducer,
       
   712   selectors: selectors_namespaceObject,
       
   713   actions: actions_namespaceObject
       
   714 });
       
   715 Object(external_wp_data_["register"])(store);
       
   716 
       
   717 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/index.js
       
   718 /**
       
   719  * Internal dependencies
       
   720  */
       
   721 
       
   722 
       
   723 
       
   724 
       
   725 
       
   726 /***/ }),
       
   727 
       
   728 /***/ "7Cbv":
       
   729 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   730 
       
   731 "use strict";
       
   732 
       
   733 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
       
   734 // Unique ID creation requires a high quality random # generator. In the browser we therefore
       
   735 // require the crypto API and do not support built-in fallback to lower quality random number
       
   736 // generators (like Math.random()).
       
   737 var getRandomValues;
       
   738 var rnds8 = new Uint8Array(16);
       
   739 function rng() {
       
   740   // lazy load so that environments that need to polyfill have a chance to do so
       
   741   if (!getRandomValues) {
       
   742     // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
       
   743     // find the complete implementation of crypto (msCrypto) on IE11.
       
   744     getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
       
   745 
       
   746     if (!getRandomValues) {
       
   747       throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
   117     }
   748     }
   118   }
   749   }
   119 
   750 
   120   return target;
   751   return getRandomValues(rnds8);
   121 }
   752 }
       
   753 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js
       
   754 /* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
       
   755 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js
       
   756 
       
   757 
       
   758 function validate(uuid) {
       
   759   return typeof uuid === 'string' && regex.test(uuid);
       
   760 }
       
   761 
       
   762 /* harmony default export */ var esm_browser_validate = (validate);
       
   763 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js
       
   764 
       
   765 /**
       
   766  * Convert array of 16 byte values to UUID string format of the form:
       
   767  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
       
   768  */
       
   769 
       
   770 var byteToHex = [];
       
   771 
       
   772 for (var stringify_i = 0; stringify_i < 256; ++stringify_i) {
       
   773   byteToHex.push((stringify_i + 0x100).toString(16).substr(1));
       
   774 }
       
   775 
       
   776 function stringify(arr) {
       
   777   var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
       
   778   // Note: Be careful editing this code!  It's been tuned for performance
       
   779   // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
       
   780   var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID.  If this throws, it's likely due to one
       
   781   // of the following:
       
   782   // - One or more input array values don't map to a hex octet (leading to
       
   783   // "undefined" in the uuid)
       
   784   // - Invalid input values for the RFC `version` or `variant` fields
       
   785 
       
   786   if (!esm_browser_validate(uuid)) {
       
   787     throw TypeError('Stringified UUID is invalid');
       
   788   }
       
   789 
       
   790   return uuid;
       
   791 }
       
   792 
       
   793 /* harmony default export */ var esm_browser_stringify = (stringify);
       
   794 // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js
       
   795 
       
   796 
       
   797 
       
   798 function v4(options, buf, offset) {
       
   799   options = options || {};
       
   800   var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
       
   801 
       
   802   rnds[6] = rnds[6] & 0x0f | 0x40;
       
   803   rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
       
   804 
       
   805   if (buf) {
       
   806     offset = offset || 0;
       
   807 
       
   808     for (var i = 0; i < 16; ++i) {
       
   809       buf[offset + i] = rnds[i];
       
   810     }
       
   811 
       
   812     return buf;
       
   813   }
       
   814 
       
   815   return esm_browser_stringify(rnds);
       
   816 }
       
   817 
       
   818 /* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4);
   122 
   819 
   123 /***/ }),
   820 /***/ }),
   124 
   821 
   125 /***/ 18:
   822 /***/ "YLtl":
   126 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   823 /***/ (function(module, exports) {
   127 
   824 
   128 "use strict";
   825 (function() { module.exports = window["lodash"]; }());
   129 
       
   130 // EXPORTS
       
   131 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
       
   132 
       
   133 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
       
   134 var arrayLikeToArray = __webpack_require__(26);
       
   135 
       
   136 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
       
   137 
       
   138 function _arrayWithoutHoles(arr) {
       
   139   if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
       
   140 }
       
   141 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
       
   142 var iterableToArray = __webpack_require__(35);
       
   143 
       
   144 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
       
   145 var unsupportedIterableToArray = __webpack_require__(29);
       
   146 
       
   147 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
       
   148 function _nonIterableSpread() {
       
   149   throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
       
   150 }
       
   151 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
       
   152 
       
   153 
       
   154 
       
   155 
       
   156 function _toConsumableArray(arr) {
       
   157   return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
       
   158 }
       
   159 
   826 
   160 /***/ }),
   827 /***/ }),
   161 
   828 
   162 /***/ 2:
   829 /***/ "g56x":
   163 /***/ (function(module, exports) {
   830 /***/ (function(module, exports) {
   164 
   831 
   165 (function() { module.exports = this["lodash"]; }());
   832 (function() { module.exports = window["wp"]["hooks"]; }());
   166 
   833 
   167 /***/ }),
   834 /***/ }),
   168 
   835 
   169 /***/ 25:
   836 /***/ "l3Sj":
   170 /***/ (function(module, exports) {
   837 /***/ (function(module, exports) {
   171 
   838 
   172 (function() { module.exports = this["wp"]["richText"]; }());
   839 (function() { module.exports = window["wp"]["i18n"]; }());
   173 
   840 
   174 /***/ }),
   841 /***/ }),
   175 
   842 
   176 /***/ 26:
   843 /***/ "pPDe":
   177 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   178 
       
   179 "use strict";
       
   180 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
       
   181 function _arrayLikeToArray(arr, len) {
       
   182   if (len == null || len > arr.length) len = arr.length;
       
   183 
       
   184   for (var i = 0, arr2 = new Array(len); i < len; i++) {
       
   185     arr2[i] = arr[i];
       
   186   }
       
   187 
       
   188   return arr2;
       
   189 }
       
   190 
       
   191 /***/ }),
       
   192 
       
   193 /***/ 29:
       
   194 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   195 
       
   196 "use strict";
       
   197 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
       
   198 /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
       
   199 
       
   200 function _unsupportedIterableToArray(o, minLen) {
       
   201   if (!o) return;
       
   202   if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
       
   203   var n = Object.prototype.toString.call(o).slice(8, -1);
       
   204   if (n === "Object" && o.constructor) n = o.constructor.name;
       
   205   if (n === "Map" || n === "Set") return Array.from(o);
       
   206   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
       
   207 }
       
   208 
       
   209 /***/ }),
       
   210 
       
   211 /***/ 32:
       
   212 /***/ (function(module, exports) {
       
   213 
       
   214 (function() { module.exports = this["wp"]["hooks"]; }());
       
   215 
       
   216 /***/ }),
       
   217 
       
   218 /***/ 35:
       
   219 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   220 
       
   221 "use strict";
       
   222 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
       
   223 function _iterableToArray(iter) {
       
   224   if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
       
   225 }
       
   226 
       
   227 /***/ }),
       
   228 
       
   229 /***/ 4:
       
   230 /***/ (function(module, exports) {
       
   231 
       
   232 (function() { module.exports = this["wp"]["data"]; }());
       
   233 
       
   234 /***/ }),
       
   235 
       
   236 /***/ 41:
       
   237 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   238 
       
   239 "use strict";
       
   240 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
       
   241 function _objectWithoutPropertiesLoose(source, excluded) {
       
   242   if (source == null) return {};
       
   243   var target = {};
       
   244   var sourceKeys = Object.keys(source);
       
   245   var key, i;
       
   246 
       
   247   for (i = 0; i < sourceKeys.length; i++) {
       
   248     key = sourceKeys[i];
       
   249     if (excluded.indexOf(key) >= 0) continue;
       
   250     target[key] = source[key];
       
   251   }
       
   252 
       
   253   return target;
       
   254 }
       
   255 
       
   256 /***/ }),
       
   257 
       
   258 /***/ 42:
       
   259 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   844 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   260 
   845 
   261 "use strict";
   846 "use strict";
   262 
   847 
   263 
   848 
   535 });
  1120 });
   536 
  1121 
   537 
  1122 
   538 /***/ }),
  1123 /***/ }),
   539 
  1124 
   540 /***/ 448:
  1125 /***/ "qRz9":
   541 /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1126 /***/ (function(module, exports) {
   542 
  1127 
   543 "use strict";
  1128 (function() { module.exports = window["wp"]["richText"]; }());
   544 // ESM COMPAT FLAG
       
   545 __webpack_require__.r(__webpack_exports__);
       
   546 
       
   547 // NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
       
   548 var selectors_namespaceObject = {};
       
   549 __webpack_require__.r(selectors_namespaceObject);
       
   550 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotationsForBlock", function() { return __experimentalGetAnnotationsForBlock; });
       
   551 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllAnnotationsForBlock", function() { return __experimentalGetAllAnnotationsForBlock; });
       
   552 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotationsForRichText", function() { return __experimentalGetAnnotationsForRichText; });
       
   553 __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAnnotations", function() { return __experimentalGetAnnotations; });
       
   554 
       
   555 // NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/actions.js
       
   556 var actions_namespaceObject = {};
       
   557 __webpack_require__.r(actions_namespaceObject);
       
   558 __webpack_require__.d(actions_namespaceObject, "__experimentalAddAnnotation", function() { return __experimentalAddAnnotation; });
       
   559 __webpack_require__.d(actions_namespaceObject, "__experimentalRemoveAnnotation", function() { return __experimentalRemoveAnnotation; });
       
   560 __webpack_require__.d(actions_namespaceObject, "__experimentalUpdateAnnotationRange", function() { return __experimentalUpdateAnnotationRange; });
       
   561 __webpack_require__.d(actions_namespaceObject, "__experimentalRemoveAnnotationsBySource", function() { return __experimentalRemoveAnnotationsBySource; });
       
   562 
       
   563 // EXTERNAL MODULE: external {"this":["wp","data"]}
       
   564 var external_this_wp_data_ = __webpack_require__(4);
       
   565 
       
   566 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
       
   567 var toConsumableArray = __webpack_require__(18);
       
   568 
       
   569 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
       
   570 var defineProperty = __webpack_require__(5);
       
   571 
       
   572 // EXTERNAL MODULE: external {"this":"lodash"}
       
   573 var external_this_lodash_ = __webpack_require__(2);
       
   574 
       
   575 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/reducer.js
       
   576 
       
   577 
       
   578 
       
   579 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; }
       
   580 
       
   581 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; }
       
   582 
       
   583 /**
       
   584  * External dependencies
       
   585  */
       
   586 
       
   587 /**
       
   588  * Filters an array based on the predicate, but keeps the reference the same if
       
   589  * the array hasn't changed.
       
   590  *
       
   591  * @param {Array}    collection The collection to filter.
       
   592  * @param {Function} predicate  Function that determines if the item should stay
       
   593  *                              in the array.
       
   594  * @return {Array} Filtered array.
       
   595  */
       
   596 
       
   597 function filterWithReference(collection, predicate) {
       
   598   var filteredCollection = collection.filter(predicate);
       
   599   return collection.length === filteredCollection.length ? collection : filteredCollection;
       
   600 }
       
   601 /**
       
   602  * Verifies whether the given annotations is a valid annotation.
       
   603  *
       
   604  * @param {Object} annotation The annotation to verify.
       
   605  * @return {boolean} Whether the given annotation is valid.
       
   606  */
       
   607 
       
   608 
       
   609 function isValidAnnotationRange(annotation) {
       
   610   return Object(external_this_lodash_["isNumber"])(annotation.start) && Object(external_this_lodash_["isNumber"])(annotation.end) && annotation.start <= annotation.end;
       
   611 }
       
   612 /**
       
   613  * Reducer managing annotations.
       
   614  *
       
   615  * @param {Object} state  The annotations currently shown in the editor.
       
   616  * @param {Object} action Dispatched action.
       
   617  *
       
   618  * @return {Array} Updated state.
       
   619  */
       
   620 
       
   621 
       
   622 function reducer_annotations() {
       
   623   var _state$blockClientId;
       
   624 
       
   625   var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
   626   var action = arguments.length > 1 ? arguments[1] : undefined;
       
   627 
       
   628   switch (action.type) {
       
   629     case 'ANNOTATION_ADD':
       
   630       var blockClientId = action.blockClientId;
       
   631       var newAnnotation = {
       
   632         id: action.id,
       
   633         blockClientId: blockClientId,
       
   634         richTextIdentifier: action.richTextIdentifier,
       
   635         source: action.source,
       
   636         selector: action.selector,
       
   637         range: action.range
       
   638       };
       
   639 
       
   640       if (newAnnotation.selector === 'range' && !isValidAnnotationRange(newAnnotation.range)) {
       
   641         return state;
       
   642       }
       
   643 
       
   644       var previousAnnotationsForBlock = (_state$blockClientId = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : [];
       
   645       return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, blockClientId, [].concat(Object(toConsumableArray["a" /* default */])(previousAnnotationsForBlock), [newAnnotation])));
       
   646 
       
   647     case 'ANNOTATION_REMOVE':
       
   648       return Object(external_this_lodash_["mapValues"])(state, function (annotationsForBlock) {
       
   649         return filterWithReference(annotationsForBlock, function (annotation) {
       
   650           return annotation.id !== action.annotationId;
       
   651         });
       
   652       });
       
   653 
       
   654     case 'ANNOTATION_UPDATE_RANGE':
       
   655       return Object(external_this_lodash_["mapValues"])(state, function (annotationsForBlock) {
       
   656         var hasChangedRange = false;
       
   657         var newAnnotations = annotationsForBlock.map(function (annotation) {
       
   658           if (annotation.id === action.annotationId) {
       
   659             hasChangedRange = true;
       
   660             return _objectSpread({}, annotation, {
       
   661               range: {
       
   662                 start: action.start,
       
   663                 end: action.end
       
   664               }
       
   665             });
       
   666           }
       
   667 
       
   668           return annotation;
       
   669         });
       
   670         return hasChangedRange ? newAnnotations : annotationsForBlock;
       
   671       });
       
   672 
       
   673     case 'ANNOTATION_REMOVE_SOURCE':
       
   674       return Object(external_this_lodash_["mapValues"])(state, function (annotationsForBlock) {
       
   675         return filterWithReference(annotationsForBlock, function (annotation) {
       
   676           return annotation.source !== action.source;
       
   677         });
       
   678       });
       
   679   }
       
   680 
       
   681   return state;
       
   682 }
       
   683 /* harmony default export */ var reducer = (reducer_annotations);
       
   684 
       
   685 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
       
   686 var objectWithoutProperties = __webpack_require__(15);
       
   687 
       
   688 // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
       
   689 var rememo = __webpack_require__(42);
       
   690 
       
   691 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
       
   692 
       
   693 
       
   694 
       
   695 function selectors_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; }
       
   696 
       
   697 function selectors_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { selectors_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 { selectors_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
       
   698 
       
   699 /**
       
   700  * External dependencies
       
   701  */
       
   702 
       
   703 
       
   704 /**
       
   705  * Shared reference to an empty array for cases where it is important to avoid
       
   706  * returning a new array reference on every invocation, as in a connected or
       
   707  * other pure component which performs `shouldComponentUpdate` check on props.
       
   708  * This should be used as a last resort, since the normalized data should be
       
   709  * maintained by the reducer result in state.
       
   710  *
       
   711  * @type {Array}
       
   712  */
       
   713 
       
   714 var EMPTY_ARRAY = [];
       
   715 /**
       
   716  * Returns the annotations for a specific client ID.
       
   717  *
       
   718  * @param {Object} state Editor state.
       
   719  * @param {string} clientId The ID of the block to get the annotations for.
       
   720  *
       
   721  * @return {Array} The annotations applicable to this block.
       
   722  */
       
   723 
       
   724 var __experimentalGetAnnotationsForBlock = Object(rememo["a" /* default */])(function (state, blockClientId) {
       
   725   var _state$blockClientId;
       
   726 
       
   727   return ((_state$blockClientId = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : []).filter(function (annotation) {
       
   728     return annotation.selector === 'block';
       
   729   });
       
   730 }, function (state, blockClientId) {
       
   731   var _state$blockClientId2;
       
   732 
       
   733   return [(_state$blockClientId2 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId2 !== void 0 ? _state$blockClientId2 : EMPTY_ARRAY];
       
   734 });
       
   735 function __experimentalGetAllAnnotationsForBlock(state, blockClientId) {
       
   736   var _state$blockClientId3;
       
   737 
       
   738   return (_state$blockClientId3 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId3 !== void 0 ? _state$blockClientId3 : EMPTY_ARRAY;
       
   739 }
       
   740 /**
       
   741  * Returns the annotations that apply to the given RichText instance.
       
   742  *
       
   743  * Both a blockClientId and a richTextIdentifier are required. This is because
       
   744  * a block might have multiple `RichText` components. This does mean that every
       
   745  * block needs to implement annotations itself.
       
   746  *
       
   747  * @param {Object} state              Editor state.
       
   748  * @param {string} blockClientId      The client ID for the block.
       
   749  * @param {string} richTextIdentifier Unique identifier that identifies the given RichText.
       
   750  * @return {Array} All the annotations relevant for the `RichText`.
       
   751  */
       
   752 
       
   753 var __experimentalGetAnnotationsForRichText = Object(rememo["a" /* default */])(function (state, blockClientId, richTextIdentifier) {
       
   754   var _state$blockClientId4;
       
   755 
       
   756   return ((_state$blockClientId4 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId4 !== void 0 ? _state$blockClientId4 : []).filter(function (annotation) {
       
   757     return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier;
       
   758   }).map(function (annotation) {
       
   759     var range = annotation.range,
       
   760         other = Object(objectWithoutProperties["a" /* default */])(annotation, ["range"]);
       
   761 
       
   762     return selectors_objectSpread({}, range, {}, other);
       
   763   });
       
   764 }, function (state, blockClientId) {
       
   765   var _state$blockClientId5;
       
   766 
       
   767   return [(_state$blockClientId5 = state === null || state === void 0 ? void 0 : state[blockClientId]) !== null && _state$blockClientId5 !== void 0 ? _state$blockClientId5 : EMPTY_ARRAY];
       
   768 });
       
   769 /**
       
   770  * Returns all annotations in the editor state.
       
   771  *
       
   772  * @param {Object} state Editor state.
       
   773  * @return {Array} All annotations currently applied.
       
   774  */
       
   775 
       
   776 function __experimentalGetAnnotations(state) {
       
   777   return Object(external_this_lodash_["flatMap"])(state, function (annotations) {
       
   778     return annotations;
       
   779   });
       
   780 }
       
   781 
       
   782 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/node_modules/uuid/dist/esm-browser/rng.js
       
   783 // Unique ID creation requires a high quality random # generator. In the browser we therefore
       
   784 // require the crypto API and do not support built-in fallback to lower quality random number
       
   785 // generators (like Math.random()).
       
   786 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
       
   787 // find the complete implementation of crypto (msCrypto) on IE11.
       
   788 var getRandomValues = typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != 'undefined' && typeof msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto);
       
   789 var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
       
   790 
       
   791 function rng() {
       
   792   if (!getRandomValues) {
       
   793     throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
       
   794   }
       
   795 
       
   796   return getRandomValues(rnds8);
       
   797 }
       
   798 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/node_modules/uuid/dist/esm-browser/bytesToUuid.js
       
   799 /**
       
   800  * Convert array of 16 byte values to UUID string format of the form:
       
   801  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
       
   802  */
       
   803 var byteToHex = [];
       
   804 
       
   805 for (var bytesToUuid_i = 0; bytesToUuid_i < 256; ++bytesToUuid_i) {
       
   806   byteToHex[bytesToUuid_i] = (bytesToUuid_i + 0x100).toString(16).substr(1);
       
   807 }
       
   808 
       
   809 function bytesToUuid(buf, offset) {
       
   810   var i = offset || 0;
       
   811   var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
       
   812 
       
   813   return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');
       
   814 }
       
   815 
       
   816 /* harmony default export */ var esm_browser_bytesToUuid = (bytesToUuid);
       
   817 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/node_modules/uuid/dist/esm-browser/v4.js
       
   818 
       
   819 
       
   820 
       
   821 function v4(options, buf, offset) {
       
   822   var i = buf && offset || 0;
       
   823 
       
   824   if (typeof options == 'string') {
       
   825     buf = options === 'binary' ? new Array(16) : null;
       
   826     options = null;
       
   827   }
       
   828 
       
   829   options = options || {};
       
   830   var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
       
   831 
       
   832   rnds[6] = rnds[6] & 0x0f | 0x40;
       
   833   rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
       
   834 
       
   835   if (buf) {
       
   836     for (var ii = 0; ii < 16; ++ii) {
       
   837       buf[i + ii] = rnds[ii];
       
   838     }
       
   839   }
       
   840 
       
   841   return buf || esm_browser_bytesToUuid(rnds);
       
   842 }
       
   843 
       
   844 /* harmony default export */ var esm_browser_v4 = (v4);
       
   845 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/actions.js
       
   846 /**
       
   847  * External dependencies
       
   848  */
       
   849 
       
   850 /**
       
   851  * @typedef WPAnnotationRange
       
   852  *
       
   853  * @property {number} start The offset where the annotation should start.
       
   854  * @property {number} end   The offset where the annotation should end.
       
   855  */
       
   856 
       
   857 /**
       
   858  * Adds an annotation to a block.
       
   859  *
       
   860  * The `block` attribute refers to a block ID that needs to be annotated.
       
   861  * `isBlockAnnotation` controls whether or not the annotation is a block
       
   862  * annotation. The `source` is the source of the annotation, this will be used
       
   863  * to identity groups of annotations.
       
   864  *
       
   865  * The `range` property is only relevant if the selector is 'range'.
       
   866  *
       
   867  * @param {Object}            annotation                    The annotation to add.
       
   868  * @param {string}            annotation.blockClientId      The blockClientId to add the annotation to.
       
   869  * @param {string}            annotation.richTextIdentifier Identifier for the RichText instance the annotation applies to.
       
   870  * @param {WPAnnotationRange} annotation.range              The range at which to apply this annotation.
       
   871  * @param {string}            [annotation.selector="range"] The way to apply this annotation.
       
   872  * @param {string}            [annotation.source="default"] The source that added the annotation.
       
   873  * @param {string}            [annotation.id]               The ID the annotation should have. Generates a UUID by default.
       
   874  *
       
   875  * @return {Object} Action object.
       
   876  */
       
   877 
       
   878 function __experimentalAddAnnotation(_ref) {
       
   879   var blockClientId = _ref.blockClientId,
       
   880       _ref$richTextIdentifi = _ref.richTextIdentifier,
       
   881       richTextIdentifier = _ref$richTextIdentifi === void 0 ? null : _ref$richTextIdentifi,
       
   882       _ref$range = _ref.range,
       
   883       range = _ref$range === void 0 ? null : _ref$range,
       
   884       _ref$selector = _ref.selector,
       
   885       selector = _ref$selector === void 0 ? 'range' : _ref$selector,
       
   886       _ref$source = _ref.source,
       
   887       source = _ref$source === void 0 ? 'default' : _ref$source,
       
   888       _ref$id = _ref.id,
       
   889       id = _ref$id === void 0 ? esm_browser_v4() : _ref$id;
       
   890   var action = {
       
   891     type: 'ANNOTATION_ADD',
       
   892     id: id,
       
   893     blockClientId: blockClientId,
       
   894     richTextIdentifier: richTextIdentifier,
       
   895     source: source,
       
   896     selector: selector
       
   897   };
       
   898 
       
   899   if (selector === 'range') {
       
   900     action.range = range;
       
   901   }
       
   902 
       
   903   return action;
       
   904 }
       
   905 /**
       
   906  * Removes an annotation with a specific ID.
       
   907  *
       
   908  * @param {string} annotationId The annotation to remove.
       
   909  *
       
   910  * @return {Object} Action object.
       
   911  */
       
   912 
       
   913 function __experimentalRemoveAnnotation(annotationId) {
       
   914   return {
       
   915     type: 'ANNOTATION_REMOVE',
       
   916     annotationId: annotationId
       
   917   };
       
   918 }
       
   919 /**
       
   920  * Updates the range of an annotation.
       
   921  *
       
   922  * @param {string} annotationId ID of the annotation to update.
       
   923  * @param {number} start The start of the new range.
       
   924  * @param {number} end The end of the new range.
       
   925  *
       
   926  * @return {Object} Action object.
       
   927  */
       
   928 
       
   929 function __experimentalUpdateAnnotationRange(annotationId, start, end) {
       
   930   return {
       
   931     type: 'ANNOTATION_UPDATE_RANGE',
       
   932     annotationId: annotationId,
       
   933     start: start,
       
   934     end: end
       
   935   };
       
   936 }
       
   937 /**
       
   938  * Removes all annotations of a specific source.
       
   939  *
       
   940  * @param {string} source The source to remove.
       
   941  *
       
   942  * @return {Object} Action object.
       
   943  */
       
   944 
       
   945 function __experimentalRemoveAnnotationsBySource(source) {
       
   946   return {
       
   947     type: 'ANNOTATION_REMOVE_SOURCE',
       
   948     source: source
       
   949   };
       
   950 }
       
   951 
       
   952 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/index.js
       
   953 /**
       
   954  * WordPress dependencies
       
   955  */
       
   956 
       
   957 /**
       
   958  * Internal dependencies
       
   959  */
       
   960 
       
   961 
       
   962 
       
   963 
       
   964 /**
       
   965  * Module Constants
       
   966  */
       
   967 
       
   968 var MODULE_KEY = 'core/annotations';
       
   969 var store = Object(external_this_wp_data_["registerStore"])(MODULE_KEY, {
       
   970   reducer: reducer,
       
   971   selectors: selectors_namespaceObject,
       
   972   actions: actions_namespaceObject
       
   973 });
       
   974 /* harmony default export */ var build_module_store = (store);
       
   975 
       
   976 // EXTERNAL MODULE: external {"this":["wp","richText"]}
       
   977 var external_this_wp_richText_ = __webpack_require__(25);
       
   978 
       
   979 // EXTERNAL MODULE: external {"this":["wp","i18n"]}
       
   980 var external_this_wp_i18n_ = __webpack_require__(1);
       
   981 
       
   982 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/annotation.js
       
   983 /**
       
   984  * WordPress dependencies
       
   985  */
       
   986 
       
   987 
       
   988 var FORMAT_NAME = 'core/annotation';
       
   989 var ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';
       
   990 var STORE_KEY = 'core/annotations';
       
   991 /**
       
   992  * Applies given annotations to the given record.
       
   993  *
       
   994  * @param {Object} record The record to apply annotations to.
       
   995  * @param {Array} annotations The annotation to apply.
       
   996  * @return {Object} A record with the annotations applied.
       
   997  */
       
   998 
       
   999 function applyAnnotations(record) {
       
  1000   var annotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
       
  1001   annotations.forEach(function (annotation) {
       
  1002     var start = annotation.start,
       
  1003         end = annotation.end;
       
  1004 
       
  1005     if (start > record.text.length) {
       
  1006       start = record.text.length;
       
  1007     }
       
  1008 
       
  1009     if (end > record.text.length) {
       
  1010       end = record.text.length;
       
  1011     }
       
  1012 
       
  1013     var className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;
       
  1014     var id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;
       
  1015     record = Object(external_this_wp_richText_["applyFormat"])(record, {
       
  1016       type: FORMAT_NAME,
       
  1017       attributes: {
       
  1018         className: className,
       
  1019         id: id
       
  1020       }
       
  1021     }, start, end);
       
  1022   });
       
  1023   return record;
       
  1024 }
       
  1025 /**
       
  1026  * Removes annotations from the given record.
       
  1027  *
       
  1028  * @param {Object} record Record to remove annotations from.
       
  1029  * @return {Object} The cleaned record.
       
  1030  */
       
  1031 
       
  1032 function removeAnnotations(record) {
       
  1033   return Object(external_this_wp_richText_["removeFormat"])(record, 'core/annotation', 0, record.text.length);
       
  1034 }
       
  1035 /**
       
  1036  * Retrieves the positions of annotations inside an array of formats.
       
  1037  *
       
  1038  * @param {Array} formats Formats with annotations in there.
       
  1039  * @return {Object} ID keyed positions of annotations.
       
  1040  */
       
  1041 
       
  1042 function retrieveAnnotationPositions(formats) {
       
  1043   var positions = {};
       
  1044   formats.forEach(function (characterFormats, i) {
       
  1045     characterFormats = characterFormats || [];
       
  1046     characterFormats = characterFormats.filter(function (format) {
       
  1047       return format.type === FORMAT_NAME;
       
  1048     });
       
  1049     characterFormats.forEach(function (format) {
       
  1050       var id = format.attributes.id;
       
  1051       id = id.replace(ANNOTATION_ATTRIBUTE_PREFIX, '');
       
  1052 
       
  1053       if (!positions.hasOwnProperty(id)) {
       
  1054         positions[id] = {
       
  1055           start: i
       
  1056         };
       
  1057       } // Annotations refer to positions between characters.
       
  1058       // Formats refer to the character themselves.
       
  1059       // So we need to adjust for that here.
       
  1060 
       
  1061 
       
  1062       positions[id].end = i + 1;
       
  1063     });
       
  1064   });
       
  1065   return positions;
       
  1066 }
       
  1067 /**
       
  1068  * Updates annotations in the state based on positions retrieved from RichText.
       
  1069  *
       
  1070  * @param {Array}    annotations                   The annotations that are currently applied.
       
  1071  * @param {Array}    positions                     The current positions of the given annotations.
       
  1072  * @param {Object}   actions
       
  1073  * @param {Function} actions.removeAnnotation      Function to remove an annotation from the state.
       
  1074  * @param {Function} actions.updateAnnotationRange Function to update an annotation range in the state.
       
  1075  */
       
  1076 
       
  1077 
       
  1078 function updateAnnotationsWithPositions(annotations, positions, _ref) {
       
  1079   var removeAnnotation = _ref.removeAnnotation,
       
  1080       updateAnnotationRange = _ref.updateAnnotationRange;
       
  1081   annotations.forEach(function (currentAnnotation) {
       
  1082     var position = positions[currentAnnotation.id]; // If we cannot find an annotation, delete it.
       
  1083 
       
  1084     if (!position) {
       
  1085       // Apparently the annotation has been removed, so remove it from the state:
       
  1086       // Remove...
       
  1087       removeAnnotation(currentAnnotation.id);
       
  1088       return;
       
  1089     }
       
  1090 
       
  1091     var start = currentAnnotation.start,
       
  1092         end = currentAnnotation.end;
       
  1093 
       
  1094     if (start !== position.start || end !== position.end) {
       
  1095       updateAnnotationRange(currentAnnotation.id, position.start, position.end);
       
  1096     }
       
  1097   });
       
  1098 }
       
  1099 
       
  1100 var annotation_annotation = {
       
  1101   name: FORMAT_NAME,
       
  1102   title: Object(external_this_wp_i18n_["__"])('Annotation'),
       
  1103   tagName: 'mark',
       
  1104   className: 'annotation-text',
       
  1105   attributes: {
       
  1106     className: 'class',
       
  1107     id: 'id'
       
  1108   },
       
  1109   edit: function edit() {
       
  1110     return null;
       
  1111   },
       
  1112   __experimentalGetPropsForEditableTreePreparation: function __experimentalGetPropsForEditableTreePreparation(select, _ref2) {
       
  1113     var richTextIdentifier = _ref2.richTextIdentifier,
       
  1114         blockClientId = _ref2.blockClientId;
       
  1115     return {
       
  1116       annotations: select(STORE_KEY).__experimentalGetAnnotationsForRichText(blockClientId, richTextIdentifier)
       
  1117     };
       
  1118   },
       
  1119   __experimentalCreatePrepareEditableTree: function __experimentalCreatePrepareEditableTree(_ref3) {
       
  1120     var annotations = _ref3.annotations;
       
  1121     return function (formats, text) {
       
  1122       if (annotations.length === 0) {
       
  1123         return formats;
       
  1124       }
       
  1125 
       
  1126       var record = {
       
  1127         formats: formats,
       
  1128         text: text
       
  1129       };
       
  1130       record = applyAnnotations(record, annotations);
       
  1131       return record.formats;
       
  1132     };
       
  1133   },
       
  1134   __experimentalGetPropsForEditableTreeChangeHandler: function __experimentalGetPropsForEditableTreeChangeHandler(dispatch) {
       
  1135     return {
       
  1136       removeAnnotation: dispatch(STORE_KEY).__experimentalRemoveAnnotation,
       
  1137       updateAnnotationRange: dispatch(STORE_KEY).__experimentalUpdateAnnotationRange
       
  1138     };
       
  1139   },
       
  1140   __experimentalCreateOnChangeEditableValue: function __experimentalCreateOnChangeEditableValue(props) {
       
  1141     return function (formats) {
       
  1142       var positions = retrieveAnnotationPositions(formats);
       
  1143       var removeAnnotation = props.removeAnnotation,
       
  1144           updateAnnotationRange = props.updateAnnotationRange,
       
  1145           annotations = props.annotations;
       
  1146       updateAnnotationsWithPositions(annotations, positions, {
       
  1147         removeAnnotation: removeAnnotation,
       
  1148         updateAnnotationRange: updateAnnotationRange
       
  1149       });
       
  1150     };
       
  1151   }
       
  1152 };
       
  1153 
       
  1154 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/index.js
       
  1155 
       
  1156 
       
  1157 /**
       
  1158  * WordPress dependencies
       
  1159  */
       
  1160 
       
  1161 /**
       
  1162  * Internal dependencies
       
  1163  */
       
  1164 
       
  1165 
       
  1166 
       
  1167 var format_name = annotation_annotation.name,
       
  1168     settings = Object(objectWithoutProperties["a" /* default */])(annotation_annotation, ["name"]);
       
  1169 
       
  1170 Object(external_this_wp_richText_["registerFormatType"])(format_name, settings);
       
  1171 
       
  1172 // EXTERNAL MODULE: external {"this":["wp","hooks"]}
       
  1173 var external_this_wp_hooks_ = __webpack_require__(32);
       
  1174 
       
  1175 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/block/index.js
       
  1176 /**
       
  1177  * WordPress dependencies
       
  1178  */
       
  1179 
       
  1180 
       
  1181 /**
       
  1182  * Adds annotation className to the block-list-block component.
       
  1183  *
       
  1184  * @param {Object} OriginalComponent The original BlockListBlock component.
       
  1185  * @return {Object} The enhanced component.
       
  1186  */
       
  1187 
       
  1188 var block_addAnnotationClassName = function addAnnotationClassName(OriginalComponent) {
       
  1189   return Object(external_this_wp_data_["withSelect"])(function (select, _ref) {
       
  1190     var clientId = _ref.clientId,
       
  1191         className = _ref.className;
       
  1192 
       
  1193     var annotations = select('core/annotations').__experimentalGetAnnotationsForBlock(clientId);
       
  1194 
       
  1195     return {
       
  1196       className: annotations.map(function (annotation) {
       
  1197         return 'is-annotated-by-' + annotation.source;
       
  1198       }).concat(className).filter(Boolean).join(' ')
       
  1199     };
       
  1200   })(OriginalComponent);
       
  1201 };
       
  1202 
       
  1203 Object(external_this_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/annotations', block_addAnnotationClassName);
       
  1204 
       
  1205 // CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/index.js
       
  1206 /**
       
  1207  * Internal dependencies
       
  1208  */
       
  1209 
       
  1210 
       
  1211 
       
  1212 
       
  1213 
       
  1214 /***/ }),
       
  1215 
       
  1216 /***/ 5:
       
  1217 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
  1218 
       
  1219 "use strict";
       
  1220 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
       
  1221 function _defineProperty(obj, key, value) {
       
  1222   if (key in obj) {
       
  1223     Object.defineProperty(obj, key, {
       
  1224       value: value,
       
  1225       enumerable: true,
       
  1226       configurable: true,
       
  1227       writable: true
       
  1228     });
       
  1229   } else {
       
  1230     obj[key] = value;
       
  1231   }
       
  1232 
       
  1233   return obj;
       
  1234 }
       
  1235 
  1129 
  1236 /***/ })
  1130 /***/ })
  1237 
  1131 
  1238 /******/ });
  1132 /******/ });