/******/ (() => { // 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__, {
privateApis: () => (/* reexport */ privateApis),
store: () => (/* reexport */ store)
// NAMESPACE OBJECT: ./node_modules/@wordpress/patterns/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
convertSyncedPatternToStatic: () => (convertSyncedPatternToStatic),
createPattern: () => (createPattern),
createPatternFromFile: () => (createPatternFromFile),
setEditingPattern: () => (setEditingPattern)
// NAMESPACE OBJECT: ./node_modules/@wordpress/patterns/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
isEditingPattern: () => (selectors_isEditingPattern)
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// ./node_modules/@wordpress/patterns/build-module/store/reducer.js
function isEditingPattern(state = {}, action) {
if (action?.type === 'SET_EDITING_PATTERN') {
[action.clientId]: action.isEditing
/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
;// external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// external ["wp","coreData"]
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// ./node_modules/@wordpress/patterns/build-module/constants.js
const PATTERN_DEFAULT_CATEGORY = 'all-patterns';
const PATTERN_USER_CATEGORY = 'my-patterns';
const EXCLUDED_PATTERN_SOURCES = ['core', 'pattern-directory/core', 'pattern-directory/featured'];
const PATTERN_SYNC_TYPES = {
// TODO: This should not be hardcoded. Maybe there should be a config and/or an UI.
const PARTIAL_SYNCING_SUPPORTED_BLOCKS = {
'core/paragraph': ['content'],
'core/heading': ['content'],
'core/button': ['text', 'url', 'linkTarget', 'rel'],
'core/image': ['id', 'url', 'title', 'alt']
const PATTERN_OVERRIDES_BINDING_SOURCE = 'core/pattern-overrides';
;// ./node_modules/@wordpress/patterns/build-module/store/actions.js
* Returns a generator converting one or more static blocks into a pattern, or creating a new empty pattern.
* @param {string} title Pattern title.
* @param {'full'|'unsynced'} syncType They way block is synced, 'full' or 'unsynced'.
* @param {string|undefined} [content] Optional serialized content of blocks to convert to pattern.
* @param {number[]|undefined} [categories] Ids of any selected categories.
const createPattern = (title, syncType, content, categories) => async ({
const meta = syncType === PATTERN_SYNC_TYPES.unsynced ? {
wp_pattern_sync_status: syncType
wp_pattern_category: categories
const updatedRecord = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', 'wp_block', reusableBlock);
* Create a pattern from a JSON file.
* @param {File} file The JSON file instance of the pattern.
* @param {number[]|undefined} [categories] Ids of any selected categories.
const createPatternFromFile = (file, categories) => async ({
const fileContent = await file.text();
/** @type {import('./types').PatternJSON} */
parsedContent = JSON.parse(fileContent);
throw new Error('Invalid JSON file');
if (parsedContent.__file !== 'wp_block' || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== 'string' || typeof parsedContent.content !== 'string' || parsedContent.syncStatus && typeof parsedContent.syncStatus !== 'string') {
throw new Error('Invalid pattern JSON file');
const pattern = await dispatch.createPattern(parsedContent.title, parsedContent.syncStatus, parsedContent.content, categories);
* Returns a generator converting a synced pattern block into a static block.
* @param {string} clientId The client ID of the block to attach.
const convertSyncedPatternToStatic = clientId => ({
const patternBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
const existingOverrides = patternBlock.attributes?.content;
function cloneBlocksAndRemoveBindings(blocks) {
return blocks.map(block => {
let metadata = block.attributes.metadata;
delete metadata.bindings;
// Use overridden values of the pattern block if they exist.
if (existingOverrides?.[metadata.name]) {
// Iterate over each overridden attribute.
for (const [attributeName, value] of Object.entries(existingOverrides[metadata.name])) {
// Skip if the attribute does not exist in the block type.
if (!(0,external_wp_blocks_namespaceObject.getBlockType)(block.name)?.attributes[attributeName]) {
// Update the block attribute with the override value.
block.attributes[attributeName] = value;
return (0,external_wp_blocks_namespaceObject.cloneBlock)(block, {
metadata: metadata && Object.keys(metadata).length > 0 ? metadata : undefined
}, cloneBlocksAndRemoveBindings(block.innerBlocks));
const patternInnerBlocks = registry.select(external_wp_blockEditor_namespaceObject.store).getBlocks(patternBlock.clientId);
registry.dispatch(external_wp_blockEditor_namespaceObject.store).replaceBlocks(patternBlock.clientId, cloneBlocksAndRemoveBindings(patternInnerBlocks));
* Returns an action descriptor for SET_EDITING_PATTERN action.
* @param {string} clientId The clientID of the pattern to target.
* @param {boolean} isEditing Whether the block should be in editing state.
* @return {Object} Action descriptor.
function setEditingPattern(clientId, isEditing) {
type: 'SET_EDITING_PATTERN',
;// ./node_modules/@wordpress/patterns/build-module/store/constants.js
const STORE_NAME = 'core/patterns';
;// ./node_modules/@wordpress/patterns/build-module/store/selectors.js
* Returns true if pattern is in the editing state.
* @param {Object} state Global application state.
* @param {number} clientId the clientID of the block.
* @return {boolean} Whether the pattern is in the editing state.
function selectors_isEditingPattern(state, clientId) {
return state.isEditingPattern[clientId];
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/patterns/build-module/lock-unlock.js
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/patterns');
;// ./node_modules/@wordpress/patterns/build-module/store/index.js
* Post editor data store configuration.
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
* Store definition for the editor namespace.
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
(0,external_wp_data_namespaceObject.register)(store);
unlock(store).registerPrivateActions(actions_namespaceObject);
unlock(store).registerPrivateSelectors(selectors_namespaceObject);
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// ./node_modules/@wordpress/patterns/build-module/api/index.js
* Determines whether a block is overridable.
* @param {WPBlock} block The block to test.
* @return {boolean} `true` if a block is overridable, `false` otherwise.
function isOverridableBlock(block) {
return Object.keys(PARTIAL_SYNCING_SUPPORTED_BLOCKS).includes(block.name) && !!block.attributes.metadata?.name && !!block.attributes.metadata?.bindings && Object.values(block.attributes.metadata.bindings).some(binding => binding.source === 'core/pattern-overrides');
* Determines whether the blocks list has overridable blocks.
* @param {WPBlock[]} blocks The blocks list.
* @return {boolean} `true` if the list has overridable blocks, `false` otherwise.
function hasOverridableBlocks(blocks) {
return blocks.some(block => {
if (isOverridableBlock(block)) {
return hasOverridableBlocks(block.innerBlocks);
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// ./node_modules/@wordpress/patterns/build-module/components/overrides-panel.js
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function OverridesPanel() {
const allClientIds = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getClientIdsWithDescendants(), []);
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const clientIdsWithOverrides = (0,external_wp_element_namespaceObject.useMemo)(() => allClientIds.filter(clientId => {
const block = getBlock(clientId);
return isOverridableBlock(block);
}), [allClientIds, getBlock]);
if (!clientIdsWithOverrides?.length) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
title: (0,external_wp_i18n_namespaceObject.__)('Overrides'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockQuickNavigation, {
clientIds: clientIdsWithOverrides
;// external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","htmlEntities"]
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
;// ./node_modules/@wordpress/patterns/build-module/components/category-selector.js
const unescapeString = arg => {
return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(arg);
const CATEGORY_SLUG = 'wp_pattern_category';
function CategorySelector({
const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)('');
const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 500);
const suggestions = (0,external_wp_element_namespaceObject.useMemo)(() => {
return Array.from(categoryMap.values()).map(category => unescapeString(category.label)).filter(category => {
return category.toLowerCase().includes(search.toLowerCase());
}).sort((a, b) => a.localeCompare(b));
}, [search, categoryMap]);
function handleChange(termNames) {
const uniqueTerms = termNames.reduce((terms, newTerm) => {
if (!terms.some(term => term.toLowerCase() === newTerm.toLowerCase())) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, {
className: "patterns-menu-items__convert-modal-categories",
suggestions: suggestions,
onInputChange: debouncedSearch,
label: (0,external_wp_i18n_namespaceObject.__)('Categories'),
__experimentalExpandOnFocus: true,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true
;// ./node_modules/@wordpress/patterns/build-module/private-hooks.js
* Helper hook that creates a Map with the core and user patterns categories
* and removes any duplicates. It's used when we need to create new user
* categories when creating or importing patterns.
* This hook also provides a function to find or create a pattern category.
* @return {Object} The merged categories map and the callback function to find or create a category.
function useAddPatternCategory() {
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getUserPatternCategories,
getBlockPatternCategories
} = select(external_wp_coreData_namespaceObject.store);
corePatternCategories: getBlockPatternCategories(),
userPatternCategories: getUserPatternCategories()
const categoryMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
// Merge the user and core pattern categories and remove any duplicates.
const uniqueCategories = new Map();
userPatternCategories.forEach(category => {
uniqueCategories.set(category.label.toLowerCase(), {
corePatternCategories.forEach(category => {
if (!uniqueCategories.has(category.label.toLowerCase()) &&
// There are two core categories with `Post` label so explicitly remove the one with
// the `query` slug to avoid any confusion.
category.name !== 'query') {
uniqueCategories.set(category.label.toLowerCase(), {
}, [userPatternCategories, corePatternCategories]);
async function findOrCreateTerm(term) {