: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/******/ (() => { // webpackBootstrap
/******/ // The require scope
/******/ var __webpack_require__ = {};
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ /* webpack/runtime/make namespace object */
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/************************************************************************/
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
store: () => (/* reexport */ store)
// NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
__experimentalGetAllAnnotationsForBlock: () => (__experimentalGetAllAnnotationsForBlock),
__experimentalGetAnnotations: () => (__experimentalGetAnnotations),
__experimentalGetAnnotationsForBlock: () => (__experimentalGetAnnotationsForBlock),
__experimentalGetAnnotationsForRichText: () => (__experimentalGetAnnotationsForRichText)
// NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
__experimentalAddAnnotation: () => (__experimentalAddAnnotation),
__experimentalRemoveAnnotation: () => (__experimentalRemoveAnnotation),
__experimentalRemoveAnnotationsBySource: () => (__experimentalRemoveAnnotationsBySource),
__experimentalUpdateAnnotationRange: () => (__experimentalUpdateAnnotationRange)
;// CONCATENATED MODULE: external ["wp","richText"]
const external_wp_richText_namespaceObject = window["wp"]["richText"];
;// CONCATENATED MODULE: external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/constants.js
* The identifier for the data store.
const STORE_NAME = 'core/annotations';
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/annotation.js
const FORMAT_NAME = 'core/annotation';
const ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';
* Applies given annotations to the given record.
* @param {Object} record The record to apply annotations to.
* @param {Array} annotations The annotation to apply.
* @return {Object} A record with the annotations applied.
function applyAnnotations(record, annotations = []) {
annotations.forEach(annotation => {
if (start > record.text.length) {
start = record.text.length;
if (end > record.text.length) {
end = record.text.length;
const className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;
const id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;
record = (0,external_wp_richText_namespaceObject.applyFormat)(record, {
* Removes annotations from the given record.
* @param {Object} record Record to remove annotations from.
* @return {Object} The cleaned record.
function removeAnnotations(record) {
return removeFormat(record, 'core/annotation', 0, record.text.length);
* Retrieves the positions of annotations inside an array of formats.
* @param {Array} formats Formats with annotations in there.
* @return {Object} ID keyed positions of annotations.
function retrieveAnnotationPositions(formats) {
formats.forEach((characterFormats, i) => {
characterFormats = characterFormats || [];
characterFormats = characterFormats.filter(format => format.type === FORMAT_NAME);
characterFormats.forEach(format => {
id = id.replace(ANNOTATION_ATTRIBUTE_PREFIX, '');
if (!positions.hasOwnProperty(id)) {
// Annotations refer to positions between characters.
// Formats refer to the character themselves.
// So we need to adjust for that here.
positions[id].end = i + 1;
* Updates annotations in the state based on positions retrieved from RichText.
* @param {Array} annotations The annotations that are currently applied.
* @param {Array} positions The current positions of the given annotations.
* @param {Object} actions
* @param {Function} actions.removeAnnotation Function to remove an annotation from the state.
* @param {Function} actions.updateAnnotationRange Function to update an annotation range in the state.
function updateAnnotationsWithPositions(annotations, positions, {
annotations.forEach(currentAnnotation => {
const position = positions[currentAnnotation.id];
// If we cannot find an annotation, delete it.
// Apparently the annotation has been removed, so remove it from the state:
removeAnnotation(currentAnnotation.id);
if (start !== position.start || end !== position.end) {
updateAnnotationRange(currentAnnotation.id, position.start, position.end);
title: (0,external_wp_i18n_namespaceObject.__)('Annotation'),
className: 'annotation-text',
__experimentalGetPropsForEditableTreePreparation(select, {
annotations: select(STORE_NAME).__experimentalGetAnnotationsForRichText(blockClientId, richTextIdentifier)
__experimentalCreatePrepareEditableTree({
return (formats, text) => {
if (annotations.length === 0) {
record = applyAnnotations(record, annotations);
__experimentalGetPropsForEditableTreeChangeHandler(dispatch) {
removeAnnotation: dispatch(STORE_NAME).__experimentalRemoveAnnotation,
updateAnnotationRange: dispatch(STORE_NAME).__experimentalUpdateAnnotationRange
__experimentalCreateOnChangeEditableValue(props) {
const positions = retrieveAnnotationPositions(formats);
updateAnnotationsWithPositions(annotations, positions, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/index.js
(0,external_wp_richText_namespaceObject.registerFormatType)(format_name, settings);
;// CONCATENATED MODULE: external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// CONCATENATED MODULE: external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/block/index.js
* Adds annotation className to the block-list-block component.
* @param {Object} OriginalComponent The original BlockListBlock component.
* @return {Object} The enhanced component.
const addAnnotationClassName = OriginalComponent => {
return (0,external_wp_data_namespaceObject.withSelect)((select, {
const annotations = select(STORE_NAME).__experimentalGetAnnotationsForBlock(clientId);
className: annotations.map(annotation => {
return 'is-annotated-by-' + annotation.source;
}).concat(className).filter(Boolean).join(' ')
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/annotations', addAnnotationClassName);
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/reducer.js
* Filters an array based on the predicate, but keeps the reference the same if
* the array hasn't changed.
* @param {Array} collection The collection to filter.
* @param {Function} predicate Function that determines if the item should stay
* @return {Array} Filtered array.
function filterWithReference(collection, predicate) {
const filteredCollection = collection.filter(predicate);
return collection.length === filteredCollection.length ? collection : filteredCollection;
* Creates a new object with the same keys, but with `callback()` called as
* a transformer function on each of the values.
* @param {Object} obj The object to transform.
* @param {Function} callback The function to transform each object value.
* @return {Array} Transformed object.
const mapValues = (obj, callback) => Object.entries(obj).reduce((acc, [key, value]) => ({
* Verifies whether the given annotations is a valid annotation.
* @param {Object} annotation The annotation to verify.
* @return {boolean} Whether the given annotation is valid.
function isValidAnnotationRange(annotation) {
return typeof annotation.start === 'number' && typeof annotation.end === 'number' && annotation.start <= annotation.end;
* Reducer managing annotations.
* @param {Object} state The annotations currently shown in the editor.
* @param {Object} action Dispatched action.
* @return {Array} Updated state.
function annotations(state = {}, action) {
var _state$blockClientId;
const blockClientId = action.blockClientId;
richTextIdentifier: action.richTextIdentifier,
selector: action.selector,
if (newAnnotation.selector === 'range' && !isValidAnnotationRange(newAnnotation.range)) {
const previousAnnotationsForBlock = (_state$blockClientId = state?.[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : [];
[blockClientId]: [...previousAnnotationsForBlock, newAnnotation]
case 'ANNOTATION_REMOVE':
return mapValues(state, annotationsForBlock => {
return filterWithReference(annotationsForBlock, annotation => {
return annotation.id !== action.annotationId;
case 'ANNOTATION_UPDATE_RANGE':
return mapValues(state, annotationsForBlock => {
let hasChangedRange = false;
const newAnnotations = annotationsForBlock.map(annotation => {
if (annotation.id === action.annotationId) {
return hasChangedRange ? newAnnotations : annotationsForBlock;
case 'ANNOTATION_REMOVE_SOURCE':
return mapValues(state, annotationsForBlock => {
return filterWithReference(annotationsForBlock, annotation => {
return annotation.source !== action.source;
/* harmony default export */ const reducer = (annotations);
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
* Shared reference to an empty array for cases where it is important to avoid
* returning a new array reference on every invocation, as in a connected or
* other pure component which performs `shouldComponentUpdate` check on props.
* This should be used as a last resort, since the normalized data should be
* maintained by the reducer result in state.
* Returns the annotations for a specific client ID.
* @param {Object} state Editor state.
* @param {string} clientId The ID of the block to get the annotations for.
* @return {Array} The annotations applicable to this block.
const __experimentalGetAnnotationsForBlock = (0,external_wp_data_namespaceObject.createSelector)((state, blockClientId) => {
var _state$blockClientId;
return ((_state$blockClientId = state?.[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : []).filter(annotation => {
return annotation.selector === 'block';
}, (state, blockClientId) => {
var _state$blockClientId2;
return [(_state$blockClientId2 = state?.[blockClientId]) !== null && _state$blockClientId2 !== void 0 ? _state$blockClientId2 : EMPTY_ARRAY];
function __experimentalGetAllAnnotationsForBlock(state, blockClientId) {
var _state$blockClientId3;
return (_state$blockClientId3 = state?.[blockClientId]) !== null && _state$blockClientId3 !== void 0 ? _state$blockClientId3 : EMPTY_ARRAY;
* Returns the annotations that apply to the given RichText instance.
* Both a blockClientId and a richTextIdentifier are required. This is because
* a block might have multiple `RichText` components. This does mean that every
* block needs to implement annotations itself.
* @param {Object} state Editor state.
* @param {string} blockClientId The client ID for the block.
* @param {string} richTextIdentifier Unique identifier that identifies the given RichText.
* @return {Array} All the annotations relevant for the `RichText`.
const __experimentalGetAnnotationsForRichText = (0,external_wp_data_namespaceObject.createSelector)((state, blockClientId, richTextIdentifier) => {
var _state$blockClientId4;
return ((_state$blockClientId4 = state?.[blockClientId]) !== null && _state$blockClientId4 !== void 0 ? _state$blockClientId4 : []).filter(annotation => {
return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier;
}, (state, blockClientId) => {
var _state$blockClientId5;
return [(_state$blockClientId5 = state?.[blockClientId]) !== null && _state$blockClientId5 !== void 0 ? _state$blockClientId5 : EMPTY_ARRAY];
* Returns all annotations in the editor state.
* @param {Object} state Editor state.
* @return {Array} All annotations currently applied.
function __experimentalGetAnnotations(state) {
return Object.values(state).flat();
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/native.js
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
/* harmony default export */ const esm_browser_native = ({
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
const rnds8 = new Uint8Array(16);
// lazy load so that environments that need to polyfill have a chance to do so
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);