this["wp"] = this["wp"] || {}; this["wp"]["blockDirectory"] = /******/ (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] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // 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)); /******/ return ns; /******/ }; /******/ /******/ // 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); /******/ return 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 = "7f3f"); /******/ }) /************************************************************************/ /******/ ({ /***/ "1ZqX": /***/ (function(module, exports) { (function() { module.exports = this["wp"]["data"]; }()); /***/ }), /***/ "25BE": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } /***/ }), /***/ "51Zz": /***/ (function(module, exports) { (function() { module.exports = this["wp"]["dataControls"]; }()); /***/ }), /***/ "7f3f": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, "isRequestingDownloadableBlocks", function() { return isRequestingDownloadableBlocks; }); __webpack_require__.d(selectors_namespaceObject, "getDownloadableBlocks", function() { return selectors_getDownloadableBlocks; }); __webpack_require__.d(selectors_namespaceObject, "getInstalledBlockTypes", function() { return getInstalledBlockTypes; }); __webpack_require__.d(selectors_namespaceObject, "getNewBlockTypes", function() { return getNewBlockTypes; }); __webpack_require__.d(selectors_namespaceObject, "getUnusedBlockTypes", function() { return getUnusedBlockTypes; }); __webpack_require__.d(selectors_namespaceObject, "isInstalling", function() { return isInstalling; }); __webpack_require__.d(selectors_namespaceObject, "getErrorNotices", function() { return getErrorNotices; }); __webpack_require__.d(selectors_namespaceObject, "getErrorNoticeForBlock", function() { return getErrorNoticeForBlock; }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, "fetchDownloadableBlocks", function() { return fetchDownloadableBlocks; }); __webpack_require__.d(actions_namespaceObject, "receiveDownloadableBlocks", function() { return receiveDownloadableBlocks; }); __webpack_require__.d(actions_namespaceObject, "installBlockType", function() { return actions_installBlockType; }); __webpack_require__.d(actions_namespaceObject, "uninstallBlockType", function() { return actions_uninstallBlockType; }); __webpack_require__.d(actions_namespaceObject, "addInstalledBlockType", function() { return addInstalledBlockType; }); __webpack_require__.d(actions_namespaceObject, "removeInstalledBlockType", function() { return removeInstalledBlockType; }); __webpack_require__.d(actions_namespaceObject, "setIsInstalling", function() { return setIsInstalling; }); __webpack_require__.d(actions_namespaceObject, "setErrorNotice", function() { return setErrorNotice; }); __webpack_require__.d(actions_namespaceObject, "clearErrorNotice", function() { return clearErrorNotice; }); // EXTERNAL MODULE: external {"this":["wp","notices"]} var external_this_wp_notices_ = __webpack_require__("onLe"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__("rePB"); // EXTERNAL MODULE: external {"this":["wp","data"]} var external_this_wp_data_ = __webpack_require__("1ZqX"); // EXTERNAL MODULE: external {"this":["wp","dataControls"]} var external_this_wp_dataControls_ = __webpack_require__("51Zz"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules var toConsumableArray = __webpack_require__("KQm4"); // EXTERNAL MODULE: external {"this":"lodash"} var external_this_lodash_ = __webpack_require__("YLtl"); // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/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; } /** * External dependencies */ /** * WordPress dependencies */ /** * Reducer returning an array of downloadable blocks. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ var reducer_downloadableBlocks = function downloadableBlocks() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var action = arguments.length > 1 ? arguments[1] : undefined; switch (action.type) { case 'FETCH_DOWNLOADABLE_BLOCKS': return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.filterValue, { isRequesting: true })); case 'RECEIVE_DOWNLOADABLE_BLOCKS': return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.filterValue, { results: action.downloadableBlocks, isRequesting: false })); } return state; }; /** * Reducer managing the installation and deletion of blocks. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ var reducer_blockManagement = function blockManagement() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { installedBlockTypes: [], isInstalling: {} }; var action = arguments.length > 1 ? arguments[1] : undefined; switch (action.type) { case 'ADD_INSTALLED_BLOCK_TYPE': return _objectSpread({}, state, { installedBlockTypes: [].concat(Object(toConsumableArray["a" /* default */])(state.installedBlockTypes), [action.item]) }); case 'REMOVE_INSTALLED_BLOCK_TYPE': return _objectSpread({}, state, { installedBlockTypes: state.installedBlockTypes.filter(function (blockType) { return blockType.name !== action.item.name; }) }); case 'SET_INSTALLING_BLOCK': return _objectSpread({}, state, { isInstalling: _objectSpread({}, state.isInstalling, Object(defineProperty["a" /* default */])({}, action.blockId, action.isInstalling)) }); } return state; }; /** * Reducer returning an object of error notices. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ var reducer_errorNotices = function errorNotices() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var action = arguments.length > 1 ? arguments[1] : undefined; switch (action.type) { case 'SET_ERROR_NOTICE': return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockId, { message: action.message, isFatal: action.isFatal })); case 'CLEAR_ERROR_NOTICE': return Object(external_this_lodash_["omit"])(state, action.blockId); } return state; }; /* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({ downloadableBlocks: reducer_downloadableBlocks, blockManagement: reducer_blockManagement, errorNotices: reducer_errorNotices })); // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js /** * Check if a block list contains a specific block type. Recursively searches * through `innerBlocks` if they exist. * * @param {Object} blockType A block object to search for. * @param {Object[]} blocks The list of blocks to look through. * * @return {boolean} Whether the blockType is found. */ function hasBlockType(blockType) { var blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; if (!blocks.length) { return false; } if (blocks.some(function (_ref) { var name = _ref.name; return name === blockType.name; })) { return true; } for (var i = 0; i < blocks.length; i++) { if (hasBlockType(blockType, blocks[i].innerBlocks)) { return true; } } return false; } // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns true if application is requesting for downloadable blocks. * * @param {Object} state Global application state. * @param {string} filterValue Search string. * * * @return {Array} Downloadable blocks */ function isRequestingDownloadableBlocks(state, filterValue) { if (!state.downloadableBlocks[filterValue] || !state.downloadableBlocks[filterValue].isRequesting) { return false; } return state.downloadableBlocks[filterValue].isRequesting; } /** * Returns the available uninstalled blocks * * @param {Object} state Global application state. * @param {string} filterValue Search string. * * @return {Array} Downloadable blocks */ function selectors_getDownloadableBlocks(state, filterValue) { if (!state.downloadableBlocks[filterValue] || !state.downloadableBlocks[filterValue].results) { return []; } return state.downloadableBlocks[filterValue].results; } /** * Returns the block types that have been installed on the server. * * @param {Object} state Global application state. * * @return {Array} Block type items. */ function getInstalledBlockTypes(state) { return state.blockManagement.installedBlockTypes; } /** * Returns block types that have been installed on the server and used in the * current post. * * @param {Object} state Global application state. * * @return {Array} Block type items. */ var getNewBlockTypes = Object(external_this_wp_data_["createRegistrySelector"])(function (select) { return function (state) { var usedBlockTree = select('core/block-editor').getBlocks(); var installedBlockTypes = getInstalledBlockTypes(state); var newBlockTypes = []; installedBlockTypes.forEach(function (blockType) { if (hasBlockType(blockType, usedBlockTree)) { newBlockTypes.push(blockType); } }); return newBlockTypes; }; }); /** * Returns the block types that have been installed on the server but are not * used in the current post. * * @param {Object} state Global application state. * * @return {Array} Block type items. */ var getUnusedBlockTypes = Object(external_this_wp_data_["createRegistrySelector"])(function (select) { return function (state) { var usedBlockTree = select('core/block-editor').getBlocks(); var installedBlockTypes = getInstalledBlockTypes(state); var newBlockTypes = []; installedBlockTypes.forEach(function (blockType) { if (!hasBlockType(blockType, usedBlockTree)) { newBlockTypes.push(blockType); } }); return newBlockTypes; }; }); /** * Returns true if application is calling install endpoint. * * @param {Object} state Global application state. * @param {string} blockId Id of the block. * * @return {boolean} Whether its currently installing */ function isInstalling(state, blockId) { return state.blockManagement.isInstalling[blockId] || false; } /** * Returns the error notices * * @param {Object} state Global application state. * * @return {Object} Object with error notices. */ function getErrorNotices(state) { return state.errorNotices; } /** * Returns the error notice for a given block. * * @param {Object} state Global application state. * @param {string} blockId The ID of the block plugin. eg: my-block * * @return {string|boolean} The error text, or false if no error. */ function getErrorNoticeForBlock(state, blockId) { return state.errorNotices[blockId]; } // EXTERNAL MODULE: external {"this":"regeneratorRuntime"} var external_this_regeneratorRuntime_ = __webpack_require__("dvlR"); var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_); // EXTERNAL MODULE: external {"this":["wp","i18n"]} var external_this_wp_i18n_ = __webpack_require__("l3Sj"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js var asyncToGenerator = __webpack_require__("HaE+"); // EXTERNAL MODULE: external {"this":["wp","apiFetch"]} var external_this_wp_apiFetch_ = __webpack_require__("ywyh"); var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_); // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/controls.js /** * WordPress dependencies */ /** * Load an asset for a block. * * This function returns a Promise that will resolve once the asset is loaded, * or in the case of Stylesheets and Inline Javascript, will resolve immediately. * * @param {HTMLElement} el A HTML Element asset to inject. * * @return {Promise} Promise which will resolve when the asset is loaded. */ var loadAsset = function loadAsset(el) { return new Promise(function (resolve, reject) { /* * Reconstruct the passed element, this is required as inserting the Node directly * won't always fire the required onload events, even if the asset wasn't already loaded. */ var newNode = document.createElement(el.nodeName); ['id', 'rel', 'src', 'href', 'type'].forEach(function (attr) { if (el[attr]) { newNode[attr] = el[attr]; } }); // Append inline