this["wp"] = this["wp"] || {}; this["wp"]["reusableBlocks"] =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "iqm2");
/************************************************************************/
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["data"]; }());
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["element"]; }());
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["blocks"]; }());
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
var info = gen[key](arg);
Promise.resolve(value).then(_next, _throw);
function _asyncToGenerator(fn) {
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["url"]; }());
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["primitives"]; }());
/***/ (function(module, exports) {
(function() { module.exports = window["lodash"]; }());
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["blockEditor"]; }());
/***/ (function(module, exports) {
(function() { module.exports = window["regeneratorRuntime"]; }());
/***/ (function(module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; });
__webpack_require__.d(__webpack_exports__, "ReusableBlocksMenuItems", function() { return /* reexport */ reusable_blocks_menu_items; });
// NAMESPACE OBJECT: ./node_modules/@wordpress/reusable-blocks/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, "__experimentalConvertBlockToStatic", function() { return __experimentalConvertBlockToStatic; });
__webpack_require__.d(actions_namespaceObject, "__experimentalConvertBlocksToReusable", function() { return __experimentalConvertBlocksToReusable; });
__webpack_require__.d(actions_namespaceObject, "__experimentalDeleteReusableBlock", function() { return __experimentalDeleteReusableBlock; });
__webpack_require__.d(actions_namespaceObject, "__experimentalSetEditingReusableBlock", function() { return __experimentalSetEditingReusableBlock; });
// NAMESPACE OBJECT: ./node_modules/@wordpress/reusable-blocks/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, "__experimentalIsEditingReusableBlock", function() { return __experimentalIsEditingReusableBlock; });
// EXTERNAL MODULE: external ["wp","blockEditor"]
var external_wp_blockEditor_ = __webpack_require__("axFQ");
// EXTERNAL MODULE: external ["wp","coreData"]
var external_wp_coreData_ = __webpack_require__("jZUy");
// EXTERNAL MODULE: external ["wp","data"]
var external_wp_data_ = __webpack_require__("1ZqX");
// EXTERNAL MODULE: external "regeneratorRuntime"
var external_regeneratorRuntime_ = __webpack_require__("dvlR");
var external_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_regeneratorRuntime_);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("HaE+");
// EXTERNAL MODULE: external "lodash"
var external_lodash_ = __webpack_require__("YLtl");
// EXTERNAL MODULE: external ["wp","blocks"]
var external_wp_blocks_ = __webpack_require__("HSyU");
// EXTERNAL MODULE: external ["wp","i18n"]
var external_wp_i18n_ = __webpack_require__("l3Sj");
// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/store/controls.js
* Convert a reusable block to a static block effect handler
* @param {string} clientId Block ID.
* @return {Object} control descriptor.
function convertBlockToStatic(clientId) {
type: 'CONVERT_BLOCK_TO_STATIC',
* Convert a static block to a reusable block effect handler
* @param {Array} clientIds Block IDs.
* @return {Object} control descriptor.
function controls_convertBlocksToReusable(clientIds) {
type: 'CONVERT_BLOCKS_TO_REUSABLE',
* Deletes a reusable block.
* @param {string} id Reusable block ID.
* @return {Object} control descriptor.
function deleteReusableBlock(id) {
type: 'DELETE_REUSABLE_BLOCK',
CONVERT_BLOCK_TO_STATIC: Object(external_wp_data_["createRegistryControl"])(function (registry) {
var clientId = _ref.clientId;
var oldBlock = registry.select('core/block-editor').getBlock(clientId);
var reusableBlock = registry.select('core').getEditedEntityRecord('postType', 'wp_block', oldBlock.attributes.ref);
var newBlocks = Object(external_wp_blocks_["parse"])(Object(external_lodash_["isFunction"])(reusableBlock.content) ? reusableBlock.content(reusableBlock) : reusableBlock.content);
registry.dispatch('core/block-editor').replaceBlocks(oldBlock.clientId, newBlocks);
CONVERT_BLOCKS_TO_REUSABLE: Object(external_wp_data_["createRegistryControl"])(function (registry) {
return /*#__PURE__*/function () {
var _ref3 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_regeneratorRuntime_default.a.mark(function _callee(_ref2) {
var clientIds, reusableBlock, updatedRecord, newBlock;
return external_regeneratorRuntime_default.a.wrap(function _callee$(_context) {
switch (_context.prev = _context.next) {
clientIds = _ref2.clientIds;
title: Object(external_wp_i18n_["__"])('Untitled Reusable Block'),
content: Object(external_wp_blocks_["serialize"])(registry.select('core/block-editor').getBlocksByClientId(clientIds)),
return registry.dispatch('core').saveEntityRecord('postType', 'wp_block', reusableBlock);
updatedRecord = _context.sent;
newBlock = Object(external_wp_blocks_["createBlock"])('core/block', {
registry.dispatch('core/block-editor').replaceBlocks(clientIds, newBlock);
registry.dispatch(store).__experimentalSetEditingReusableBlock(newBlock.clientId, true);
return _ref3.apply(this, arguments);
DELETE_REUSABLE_BLOCK: Object(external_wp_data_["createRegistryControl"])(function (registry) {
return /*#__PURE__*/function () {
var _ref5 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_regeneratorRuntime_default.a.mark(function _callee2(_ref4) {
var id, reusableBlock, allBlocks, associatedBlocks, associatedBlockClientIds;
return external_regeneratorRuntime_default.a.wrap(function _callee2$(_context2) {
switch (_context2.prev = _context2.next) {
reusableBlock = registry.select('core').getEditedEntityRecord('postType', 'wp_block', id); // Don't allow a reusable block with a temporary ID to be deleted
return _context2.abrupt("return");
// Remove any other blocks that reference this reusable block
allBlocks = registry.select('core/block-editor').getBlocks();
associatedBlocks = allBlocks.filter(function (block) {
return Object(external_wp_blocks_["isReusableBlock"])(block) && block.attributes.ref === id;
associatedBlockClientIds = associatedBlocks.map(function (block) {
}); // Remove the parsed block.
if (associatedBlockClientIds.length) {
registry.dispatch('core/block-editor').removeBlocks(associatedBlockClientIds);
return registry.dispatch('core').deleteEntityRecord('postType', 'wp_block', id);
return _ref5.apply(this, arguments);
/* harmony default export */ var store_controls = (controls);
// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/store/actions.js
var _marked = /*#__PURE__*/external_regeneratorRuntime_default.a.mark(__experimentalConvertBlockToStatic),
_marked2 = /*#__PURE__*/external_regeneratorRuntime_default.a.mark(__experimentalConvertBlocksToReusable),
_marked3 = /*#__PURE__*/external_regeneratorRuntime_default.a.mark(__experimentalDeleteReusableBlock);
* Returns a generator converting a reusable block into a static block.
* @param {string} clientId The client ID of the block to attach.
function __experimentalConvertBlockToStatic(clientId) {
return external_regeneratorRuntime_default.a.wrap(function __experimentalConvertBlockToStatic$(_context) {
switch (_context.prev = _context.next) {
return convertBlockToStatic(clientId);
* Returns a generator converting one or more static blocks into a reusable block.
* @param {string[]} clientIds The client IDs of the block to detach.
function __experimentalConvertBlocksToReusable(clientIds) {
return external_regeneratorRuntime_default.a.wrap(function __experimentalConvertBlocksToReusable$(_context2) {
switch (_context2.prev = _context2.next) {
return controls_convertBlocksToReusable(clientIds);
* Returns a generator deleting a reusable block.
* @param {string} id The ID of the reusable block to delete.
function __experimentalDeleteReusableBlock(id) {
return external_regeneratorRuntime_default.a.wrap(function __experimentalDeleteReusableBlock$(_context3) {
switch (_context3.prev = _context3.next) {
return deleteReusableBlock(id);
* Returns an action descriptor for SET_EDITING_REUSABLE_BLOCK action.
* @param {string} clientId The clientID of the reusable block to target.
* @param {boolean} isEditing Whether the block should be in editing state.
* @return {Object} Action descriptor.
function __experimentalSetEditingReusableBlock(clientId, isEditing) {
type: 'SET_EDITING_REUSABLE_BLOCK',
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__("rePB");
// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/store/reducer.js
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; }
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; }