2020-01-03 08:17:24 -05:00
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
2021-05-25 01:22:08 -04:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = "7f3f" ) ;
2020-01-03 08:17:24 -05:00
/******/ } )
/************************************************************************/
/******/ ( {
2021-05-25 01:22:08 -04:00
/***/ "//Lo" :
2020-06-26 09:33:47 -04:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-03 08:17:24 -05:00
2020-07-21 08:14:37 -04:00
"use strict" ;
2021-05-25 01:22:08 -04:00
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
2020-07-21 08:14:37 -04:00
2021-05-25 01:22:08 -04:00
/ * *
* WordPress dependencies
* /
2020-07-21 08:14:37 -04:00
2021-05-25 01:22:08 -04:00
var blockDefault = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( blockDefault ) ;
2020-07-21 08:14:37 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-07-21 08:14:37 -04:00
2021-05-25 01:22:08 -04:00
/***/ "1ZqX" :
/***/ ( function ( module , exports ) {
2020-07-21 08:14:37 -04:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "data" ] ; } ( ) ) ;
2020-07-21 08:14:37 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-07-21 08:14:37 -04:00
2021-05-25 01:22:08 -04:00
/***/ "25BE" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-07-21 08:14:37 -04:00
2021-05-25 01:22:08 -04:00
"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 ) ;
2020-07-21 08:14:37 -04:00
}
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "51Zz" :
2021-01-27 21:04:13 -05:00
/***/ ( function ( module , exports ) {
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "dataControls" ] ; } ( ) ) ;
2021-01-27 21:04:13 -05:00
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "7f3f" :
2020-07-21 08:14:37 -04:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-06-26 09:33:47 -04:00
"use strict" ;
2021-05-25 01:22:08 -04:00
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "store" , function ( ) { return /* reexport */ store ; } ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// 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 selectors _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 selectors _isInstalling ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getErrorNotices" , function ( ) { return getErrorNotices ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getErrorNoticeForBlock" , function ( ) { return selectors _getErrorNoticeForBlock ; } ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// 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 ; } ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","element"]
var external _wp _element _ = _ _webpack _require _ _ ( "GRId" ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","plugins"]
var external _wp _plugins _ = _ _webpack _require _ _ ( "TvNi" ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","hooks"]
var external _wp _hooks _ = _ _webpack _require _ _ ( "g56x" ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","blocks"]
var external _wp _blocks _ = _ _webpack _require _ _ ( "HSyU" ) ;
// EXTERNAL MODULE: external ["wp","data"]
var external _wp _data _ = _ _webpack _require _ _ ( "1ZqX" ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = _ _webpack _require _ _ ( "rePB" ) ;
// EXTERNAL MODULE: external ["wp","dataControls"]
var external _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 "lodash"
var external _lodash _ = _ _webpack _require _ _ ( "YLtl" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js
2020-10-13 09:10:30 -04:00
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 ; }
2021-05-25 01:22:08 -04:00
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
* /
2020-10-13 09:10:30 -04:00
/ * *
* WordPress dependencies
* /
/ * *
2021-05-25 01:22:08 -04:00
* Reducer returning an array of downloadable blocks .
2020-10-13 09:10:30 -04:00
*
2021-05-25 01:22:08 -04:00
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
2020-10-13 09:10:30 -04:00
*
2021-05-25 01:22:08 -04:00
* @ return { Object } Updated state .
2020-10-13 09:10:30 -04:00
* /
2021-05-25 01:22:08 -04:00
var reducer _downloadableBlocks = function downloadableBlocks ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
switch ( action . type ) {
case 'FETCH_DOWNLOADABLE_BLOCKS' :
return _objectSpread ( _objectSpread ( { } , state ) , { } , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . filterValue , {
isRequesting : true
} ) ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 'RECEIVE_DOWNLOADABLE_BLOCKS' :
return _objectSpread ( _objectSpread ( { } , state ) , { } , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . filterValue , {
results : action . downloadableBlocks ,
isRequesting : false
} ) ) ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
return state ;
} ;
/ * *
* Reducer managing the installation and deletion of blocks .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
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 ;
2020-06-29 07:50:29 -04:00
2021-05-25 01:22:08 -04:00
switch ( action . type ) {
case 'ADD_INSTALLED_BLOCK_TYPE' :
return _objectSpread ( _objectSpread ( { } , state ) , { } , {
installedBlockTypes : [ ] . concat ( Object ( toConsumableArray [ "a" /* default */ ] ) ( state . installedBlockTypes ) , [ action . item ] )
} ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 'REMOVE_INSTALLED_BLOCK_TYPE' :
return _objectSpread ( _objectSpread ( { } , state ) , { } , {
installedBlockTypes : state . installedBlockTypes . filter ( function ( blockType ) {
return blockType . name !== action . item . name ;
} )
} ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 'SET_INSTALLING_BLOCK' :
return _objectSpread ( _objectSpread ( { } , state ) , { } , {
isInstalling : _objectSpread ( _objectSpread ( { } , state . isInstalling ) , { } , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . blockId , action . isInstalling ) )
} ) ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
return state ;
} ;
/ * *
* Reducer returning an object of error notices .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
var reducer _errorNotices = function errorNotices ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
switch ( action . type ) {
case 'SET_ERROR_NOTICE' :
return _objectSpread ( _objectSpread ( { } , state ) , { } , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . blockId , {
message : action . message ,
isFatal : action . isFatal
} ) ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 'CLEAR_ERROR_NOTICE' :
return Object ( external _lodash _ [ "omit" ] ) ( state , action . blockId ) ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
return state ;
} ;
/* harmony default export */ var reducer = ( Object ( external _wp _data _ [ "combineReducers" ] ) ( {
downloadableBlocks : reducer _downloadableBlocks ,
blockManagement : reducer _blockManagement ,
errorNotices : reducer _errorNotices
} ) ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// 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 ] : [ ] ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
if ( ! blocks . length ) {
return false ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
if ( blocks . some ( function ( _ref ) {
var name = _ref . name ;
return name === blockType . name ;
} ) ) {
return true ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
for ( var i = 0 ; i < blocks . length ; i ++ ) {
if ( hasBlockType ( blockType , blocks [ i ] . innerBlocks ) ) {
return true ;
}
}
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
return false ;
}
2020-10-20 09:36:16 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
/ * *
* WordPress dependencies
* /
2020-10-20 09:36:16 -04:00
2021-05-25 01:22:08 -04:00
/ * *
* Internal dependencies
* /
2020-10-20 09:36:16 -04:00
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/ * *
* Returns true if application is requesting for downloadable blocks .
*
* @ param { Object } state Global application state .
* @ param { string } filterValue Search string .
*
* @ return { boolean } Whether a request is in progress for the blocks list .
* /
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
function selectors _isRequestingDownloadableBlocks ( state , filterValue ) {
if ( ! state . downloadableBlocks [ filterValue ] || ! state . downloadableBlocks [ filterValue ] . isRequesting ) {
return false ;
}
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
return state . downloadableBlocks [ filterValue ] . isRequesting ;
}
2020-10-13 09:10:30 -04:00
/ * *
2021-05-25 01:22:08 -04:00
* Returns the available uninstalled blocks .
*
* @ param { Object } state Global application state .
* @ param { string } filterValue Search string .
*
* @ return { Array } Downloadable blocks .
2020-10-13 09:10:30 -04:00
* /
2021-05-25 01:22:08 -04:00
function selectors _getDownloadableBlocks ( state , filterValue ) {
if ( ! state . downloadableBlocks [ filterValue ] || ! state . downloadableBlocks [ filterValue ] . results ) {
return [ ] ;
}
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
return state . downloadableBlocks [ filterValue ] . results ;
}
/ * *
* Returns the block types that have been installed on the server in this
* session .
*
* @ param { Object } state Global application state .
*
* @ return { Array } Block type items
* /
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
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 .
* /
2020-03-23 19:40:19 -04:00
2021-05-25 01:22:08 -04:00
var getNewBlockTypes = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( function ( select ) {
return function ( state ) {
var usedBlockTree = select ( 'core/block-editor' ) . getBlocks ( ) ;
var installedBlockTypes = getInstalledBlockTypes ( state ) ;
return installedBlockTypes . filter ( function ( blockType ) {
return hasBlockType ( blockType , usedBlockTree ) ;
} ) ;
} ;
} ) ;
/ * *
* 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 .
* /
2020-03-23 19:40:19 -04:00
2021-05-25 01:22:08 -04:00
var getUnusedBlockTypes = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( function ( select ) {
return function ( state ) {
var usedBlockTree = select ( 'core/block-editor' ) . getBlocks ( ) ;
var installedBlockTypes = getInstalledBlockTypes ( state ) ;
return installedBlockTypes . filter ( function ( blockType ) {
return ! hasBlockType ( blockType , usedBlockTree ) ;
} ) ;
} ;
} ) ;
/ * *
* Returns true if a block plugin install is in progress .
*
* @ param { Object } state Global application state .
* @ param { string } blockId Id of the block .
*
* @ return { boolean } Whether this block is currently being installed .
* /
2020-03-23 19:40:19 -04:00
2021-05-25 01:22:08 -04:00
function selectors _isInstalling ( state , blockId ) {
return state . blockManagement . isInstalling [ blockId ] || false ;
2020-03-23 19:40:19 -04:00
}
2021-05-25 01:22:08 -04:00
/ * *
* Returns all block error notices .
*
* @ param { Object } state Global application state .
*
* @ return { Object } Object with error notices .
* /
2020-03-23 19:40:19 -04:00
2021-05-25 01:22:08 -04:00
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 .
* /
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
function selectors _getErrorNoticeForBlock ( state , blockId ) {
return state . errorNotices [ blockId ] ;
}
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external "regeneratorRuntime"
var external _regeneratorRuntime _ = _ _webpack _require _ _ ( "dvlR" ) ;
var external _regeneratorRuntime _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _regeneratorRuntime _ ) ;
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","i18n"]
var external _wp _i18n _ = _ _webpack _require _ _ ( "l3Sj" ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","notices"]
var external _wp _notices _ = _ _webpack _require _ _ ( "onLe" ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = _ _webpack _require _ _ ( "HaE+" ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","apiFetch"]
var external _wp _apiFetch _ = _ _webpack _require _ _ ( "ywyh" ) ;
var external _wp _apiFetch _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _apiFetch _ ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/controls.js
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function _createForOfIteratorHelper ( o , allowArrayLike ) { var it ; if ( typeof Symbol === "undefined" || o [ Symbol . iterator ] == null ) { if ( Array . isArray ( o ) || ( it = _unsupportedIterableToArray ( o ) ) || allowArrayLike && o && typeof o . length === "number" ) { if ( it ) o = it ; var i = 0 ; var F = function F ( ) { } ; return { s : F , n : function n ( ) { if ( i >= o . length ) return { done : true } ; return { done : false , value : o [ i ++ ] } ; } , e : function e ( _e ) { throw _e ; } , f : F } ; } throw new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ; } var normalCompletion = true , didErr = false , err ; return { s : function s ( ) { it = o [ Symbol . iterator ] ( ) ; } , n : function n ( ) { var step = it . next ( ) ; normalCompletion = step . done ; return step ; } , e : function e ( _e2 ) { didErr = true ; err = _e2 ; } , f : function f ( ) { try { if ( ! normalCompletion && it . return != null ) it . return ( ) ; } finally { if ( didErr ) throw err ; } } } ; }
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function _unsupportedIterableToArray ( o , minLen ) { if ( ! o ) return ; if ( typeof o === "string" ) return _arrayLikeToArray ( o , minLen ) ; var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ; if ( n === "Object" && o . constructor ) n = o . constructor . name ; if ( n === "Map" || n === "Set" ) return Array . from ( o ) ; if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return _arrayLikeToArray ( o , minLen ) ; }
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function _arrayLikeToArray ( arr , len ) { if ( len == null || len > arr . length ) len = arr . length ; for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; }
2020-06-26 09:33:47 -04:00
/ * *
* WordPress dependencies
* /
2021-05-25 01:22:08 -04:00
/ * *
* 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 .
* /
2021-02-24 10:57:54 -05:00
2021-05-25 01:22:08 -04:00
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 <script> contents.
2021-02-24 10:57:54 -05:00
2021-05-25 01:22:08 -04:00
if ( el . innerHTML ) {
newNode . appendChild ( document . createTextNode ( el . innerHTML ) ) ;
}
2021-02-24 10:57:54 -05:00
2021-05-25 01:22:08 -04:00
newNode . onload = function ( ) {
return resolve ( true ) ;
} ;
2020-12-01 07:19:43 -05:00
2021-05-25 01:22:08 -04:00
newNode . onerror = function ( ) {
return reject ( new Error ( 'Error loading asset.' ) ) ;
} ;
2020-12-01 07:19:43 -05:00
2021-05-25 01:22:08 -04:00
document . body . appendChild ( newNode ) ; // Resolve Stylesheets and Inline JavaScript immediately.
2020-12-01 07:19:43 -05:00
2021-05-25 01:22:08 -04:00
if ( 'link' === newNode . nodeName . toLowerCase ( ) || 'script' === newNode . nodeName . toLowerCase ( ) && ! newNode . src ) {
resolve ( ) ;
}
} ) ;
} ;
/ * *
* Load the asset files for a block
*
* @ param { Array } assets A collection of URLs for the assets .
*
* @ return { Object } Control descriptor .
* /
2020-12-01 07:19:43 -05:00
2021-05-25 01:22:08 -04:00
function loadAssets ( assets ) {
return {
type : 'LOAD_ASSETS' ,
assets : assets
} ;
}
var controls = {
LOAD _ASSETS : function LOAD _ASSETS ( ) {
return Object ( asyncToGenerator [ "a" /* default */ ] ) ( /*#__PURE__*/ external _regeneratorRuntime _default . a . mark ( function _callee ( ) {
var response , data , doc , newAssets , _iterator , _step , newAsset ;
2020-03-23 19:40:19 -04:00
2021-05-25 01:22:08 -04:00
return external _regeneratorRuntime _default . a . wrap ( function _callee$ ( _context ) {
while ( 1 ) {
switch ( _context . prev = _context . next ) {
case 0 :
_context . next = 2 ;
return external _wp _apiFetch _default ( ) ( {
url : document . location . href ,
parse : false
} ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
case 2 :
response = _context . sent ;
_context . next = 5 ;
return response . text ( ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
case 5 :
data = _context . sent ;
doc = new window . DOMParser ( ) . parseFromString ( data , 'text/html' ) ;
newAssets = Array . from ( doc . querySelectorAll ( 'link[rel="stylesheet"],script' ) ) . filter ( function ( asset ) {
return asset . id && ! document . getElementById ( asset . id ) ;
} ) ;
/ *
* Load each asset in order , as they may depend upon an earlier loaded script .
* Stylesheets and Inline Scripts will resolve immediately upon insertion .
* /
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
_iterator = _createForOfIteratorHelper ( newAssets ) ;
_context . prev = 9 ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
_iterator . s ( ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 11 :
if ( ( _step = _iterator . n ( ) ) . done ) {
_context . next = 17 ;
break ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
newAsset = _step . value ;
_context . next = 15 ;
return loadAsset ( newAsset ) ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
case 15 :
_context . next = 11 ;
break ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
case 17 :
_context . next = 22 ;
break ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
case 19 :
_context . prev = 19 ;
_context . t0 = _context [ "catch" ] ( 9 ) ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
_iterator . e ( _context . t0 ) ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
case 22 :
_context . prev = 22 ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
_iterator . f ( ) ;
2020-02-06 16:03:31 -05:00
2021-05-25 01:22:08 -04:00
return _context . finish ( 22 ) ;
2020-02-06 16:03:31 -05:00
2021-05-25 01:22:08 -04:00
case 25 :
case "end" :
return _context . stop ( ) ;
}
}
} , _callee , null , [ [ 9 , 19 , 22 , 25 ] ] ) ;
} ) ) ( ) ;
}
} ;
/* harmony default export */ var store _controls = ( controls ) ;
2020-02-06 16:03:31 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/get-plugin-url.js
/ * *
* Get the plugin ' s direct API link out of a block - directory response .
*
* @ param { Object } block The block object
*
* @ return { string } The plugin URL , if exists .
* /
function getPluginUrl ( block ) {
if ( ! block ) {
return false ;
}
2020-02-06 16:03:31 -05:00
2021-05-25 01:22:08 -04:00
var link = block . links [ 'wp:plugin' ] || block . links . self ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
if ( link && link . length ) {
return link [ 0 ] . href ;
2020-06-26 09:33:47 -04:00
}
2021-05-25 01:22:08 -04:00
return false ;
2020-06-26 09:33:47 -04:00
}
2020-02-06 16:03:31 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
var _marked = /*#__PURE__*/ external _regeneratorRuntime _default . a . mark ( actions _installBlockType ) ,
_marked2 = /*#__PURE__*/ external _regeneratorRuntime _default . a . mark ( actions _uninstallBlockType ) ;
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
function actions _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 ; }
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
function actions _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; if ( i % 2 ) { actions _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 { actions _ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } } return target ; }
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/ * *
* WordPress dependencies
* /
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/ * *
* Internal dependencies
* /
2020-01-03 08:17:24 -05:00
2020-02-06 16:03:31 -05:00
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
/ * *
2021-05-25 01:22:08 -04:00
* Returns an action object used in signalling that the downloadable blocks
* have been requested and are loading .
*
* @ param { string } filterValue Search string .
*
* @ return { Object } Action object .
2020-07-07 10:43:35 -04:00
* /
2021-05-25 01:22:08 -04:00
function fetchDownloadableBlocks ( filterValue ) {
return {
type : 'FETCH_DOWNLOADABLE_BLOCKS' ,
filterValue : filterValue
} ;
}
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Returns an action object used in signalling that the downloadable blocks
* have been updated .
*
* @ param { Array } downloadableBlocks Downloadable blocks .
* @ param { string } filterValue Search string .
*
* @ return { Object } Action object .
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function receiveDownloadableBlocks ( downloadableBlocks , filterValue ) {
return {
type : 'RECEIVE_DOWNLOADABLE_BLOCKS' ,
downloadableBlocks : downloadableBlocks ,
filterValue : filterValue
} ;
}
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Action triggered to install a block plugin .
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ param { Object } block The block item returned by search .
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ return { boolean } Whether the block was successfully installed & loaded .
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function actions _installBlockType ( block ) {
var id , assets , success , url , links , response , registeredBlocks , message , isFatal , fatalAPIErrors ;
return external _regeneratorRuntime _default . a . wrap ( function installBlockType$ ( _context ) {
while ( 1 ) {
switch ( _context . prev = _context . next ) {
case 0 :
id = block . id , assets = block . assets ;
success = false ;
_context . next = 4 ;
return clearErrorNotice ( id ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 4 :
_context . prev = 4 ;
_context . next = 7 ;
return setIsInstalling ( block . id , true ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 7 :
// If we have a wp:plugin link, the plugin is installed but inactive.
url = getPluginUrl ( block ) ;
links = { } ;
2020-02-06 16:03:31 -05:00
2021-05-25 01:22:08 -04:00
if ( ! url ) {
_context . next = 14 ;
break ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
_context . next = 12 ;
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
url : url ,
data : {
status : 'active'
} ,
method : 'PUT'
} ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 12 :
_context . next = 18 ;
break ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 14 :
_context . next = 16 ;
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
path : 'wp/v2/plugins' ,
data : {
slug : block . id ,
status : 'active'
} ,
method : 'POST'
} ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 16 :
response = _context . sent ;
// Add the `self` link for newly-installed blocks.
links = response . _links ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 18 :
_context . next = 20 ;
return addInstalledBlockType ( actions _objectSpread ( actions _objectSpread ( { } , block ) , { } , {
links : actions _objectSpread ( actions _objectSpread ( { } , block . links ) , links )
} ) ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 20 :
_context . next = 22 ;
return loadAssets ( assets ) ;
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
case 22 :
_context . next = 24 ;
return external _wp _data _ [ "controls" ] . select ( external _wp _blocks _ [ "store" ] . name , 'getBlockTypes' ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 24 :
registeredBlocks = _context . sent ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
if ( registeredBlocks . some ( function ( i ) {
return i . name === block . name ;
} ) ) {
_context . next = 27 ;
break ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
throw new Error ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Error registering block. Try reloading the page.' ) ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 27 :
success = true ;
_context . next = 38 ;
break ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 30 :
_context . prev = 30 ;
_context . t0 = _context [ "catch" ] ( 4 ) ;
message = _context . t0 . message || Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred.' ) ; // Errors we throw are fatal
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
isFatal = _context . t0 instanceof Error ; // Specific API errors that are fatal
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
fatalAPIErrors = {
folder _exists : Object ( external _wp _i18n _ [ "__" ] ) ( 'This block is already installed. Try reloading the page.' ) ,
unable _to _connect _to _filesystem : Object ( external _wp _i18n _ [ "__" ] ) ( 'Error installing block. You can reload the page and try again.' )
} ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
if ( fatalAPIErrors [ _context . t0 . code ] ) {
isFatal = true ;
message = fatalAPIErrors [ _context . t0 . code ] ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
_context . next = 38 ;
return setErrorNotice ( id , message , isFatal ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 38 :
_context . next = 40 ;
return setIsInstalling ( block . id , false ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 40 :
return _context . abrupt ( "return" , success ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
case 41 :
case "end" :
return _context . stop ( ) ;
}
}
} , _marked , null , [ [ 4 , 30 ] ] ) ;
2020-01-03 08:17:24 -05:00
}
/ * *
2021-05-25 01:22:08 -04:00
* Action triggered to uninstall a block plugin .
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ param { Object } block The blockType object .
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function actions _uninstallBlockType ( block ) {
return external _regeneratorRuntime _default . a . wrap ( function uninstallBlockType$ ( _context2 ) {
while ( 1 ) {
switch ( _context2 . prev = _context2 . next ) {
case 0 :
_context2 . prev = 0 ;
_context2 . next = 3 ;
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
url : getPluginUrl ( block ) ,
data : {
status : 'inactive'
} ,
method : 'PUT'
} ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 3 :
_context2 . next = 5 ;
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
url : getPluginUrl ( block ) ,
method : 'DELETE'
} ) ;
case 5 :
_context2 . next = 7 ;
return removeInstalledBlockType ( block ) ;
case 7 :
_context2 . next = 13 ;
break ;
case 9 :
_context2 . prev = 9 ;
_context2 . t0 = _context2 [ "catch" ] ( 0 ) ;
_context2 . next = 13 ;
return external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createErrorNotice' , _context2 . t0 . message || Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred.' ) ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 13 :
case "end" :
return _context2 . stop ( ) ;
}
}
} , _marked2 , null , [ [ 0 , 9 ] ] ) ;
2020-01-03 08:17:24 -05:00
}
/ * *
2021-05-25 01:22:08 -04:00
* Returns an action object used to add a block type to the "newly installed"
* tracking list .
2020-06-26 09:33:47 -04:00
*
2021-05-25 01:22:08 -04:00
* @ param { Object } item The block item with the block id and name .
2020-06-26 09:33:47 -04:00
*
2021-05-25 01:22:08 -04:00
* @ return { Object } Action object .
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function addInstalledBlockType ( item ) {
return {
type : 'ADD_INSTALLED_BLOCK_TYPE' ,
item : item
2020-06-26 09:33:47 -04:00
} ;
2021-05-25 01:22:08 -04:00
}
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Returns an action object used to remove a block type from the "newly installed"
* tracking list .
2020-06-26 09:33:47 -04:00
*
2021-05-25 01:22:08 -04:00
* @ param { string } item The block item with the block id and name .
2020-06-26 09:33:47 -04:00
*
2021-05-25 01:22:08 -04:00
* @ return { Object } Action object .
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function removeInstalledBlockType ( item ) {
return {
type : 'REMOVE_INSTALLED_BLOCK_TYPE' ,
item : item
2020-06-26 09:33:47 -04:00
} ;
2021-05-25 01:22:08 -04:00
}
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Returns an action object used to indicate install in progress .
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ param { string } blockId
* @ param { boolean } isInstalling
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ return { Object } Action object .
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function setIsInstalling ( blockId , isInstalling ) {
return {
type : 'SET_INSTALLING_BLOCK' ,
blockId : blockId ,
isInstalling : isInstalling
} ;
2020-01-03 08:17:24 -05:00
}
/ * *
2021-05-25 01:22:08 -04:00
* Sets an error notice to be displayed to the user for a given block .
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ param { string } blockId The ID of the block plugin . eg : my - block
* @ param { string } message The message shown in the notice .
* @ param { boolean } isFatal Whether the user can recover from the error .
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ return { Object } Action object .
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function setErrorNotice ( blockId , message ) {
var isFatal = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : false ;
return {
type : 'SET_ERROR_NOTICE' ,
blockId : blockId ,
message : message ,
isFatal : isFatal
} ;
2020-01-03 08:17:24 -05:00
}
/ * *
2021-05-25 01:22:08 -04:00
* Sets the error notice to empty for specific block .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ param { string } blockId The ID of the block plugin . eg : my - block
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ return { Object } Action object .
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function clearErrorNotice ( blockId ) {
return {
type : 'CLEAR_ERROR_NOTICE' ,
blockId : blockId
} ;
2020-01-03 08:17:24 -05:00
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js
2021-01-27 21:04:13 -05:00
2020-07-07 10:43:35 -04:00
/ * *
2021-05-25 01:22:08 -04:00
* External dependencies
2020-07-07 10:43:35 -04:00
* /
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* WordPress dependencies
2020-01-03 08:17:24 -05:00
* /
2020-07-07 10:43:35 -04:00
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Internal dependencies
2020-01-03 08:17:24 -05:00
* /
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
/* harmony default export */ var resolvers = ( {
getDownloadableBlocks : /*#__PURE__*/ external _regeneratorRuntime _default . a . mark ( function getDownloadableBlocks ( filterValue ) {
var results , blocks ;
return external _regeneratorRuntime _default . a . wrap ( function getDownloadableBlocks$ ( _context ) {
while ( 1 ) {
switch ( _context . prev = _context . next ) {
case 0 :
if ( filterValue ) {
2021-01-27 21:04:13 -05:00
_context . next = 2 ;
break ;
2021-05-25 01:22:08 -04:00
}
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
return _context . abrupt ( "return" ) ;
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
case 2 :
_context . prev = 2 ;
_context . next = 5 ;
return fetchDownloadableBlocks ( filterValue ) ;
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
case 5 :
_context . next = 7 ;
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
path : "wp/v2/block-directory/search?term=" . concat ( filterValue )
} ) ;
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
case 7 :
results = _context . sent ;
blocks = results . map ( function ( result ) {
return Object ( external _lodash _ [ "mapKeys" ] ) ( result , function ( value , key ) {
return Object ( external _lodash _ [ "camelCase" ] ) ( key ) ;
} ) ;
} ) ;
_context . next = 11 ;
return receiveDownloadableBlocks ( blocks , filterValue ) ;
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
case 11 :
_context . next = 15 ;
break ;
case 13 :
_context . prev = 13 ;
_context . t0 = _context [ "catch" ] ( 2 ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
case 15 :
case "end" :
return _context . stop ( ) ;
}
}
} , getDownloadableBlocks , null , [ [ 2 , 13 ] ] ) ;
} )
} ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/index.js
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function store _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 ; }
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function store _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; if ( i % 2 ) { store _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 { store _ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } } return target ; }
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
/ * *
* Internal dependencies
* /
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Module Constants
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
var STORE _NAME = 'core/block-directory' ;
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Block editor data store configuration .
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ type { Object }
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
var storeConfig = {
reducer : reducer ,
selectors : selectors _namespaceObject ,
actions : actions _namespaceObject ,
controls : store _objectSpread ( store _objectSpread ( { } , external _wp _dataControls _ [ "controls" ] ) , store _controls ) ,
resolvers : resolvers
} ;
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Store definition for the block directory namespace .
2020-06-26 09:33:47 -04:00
*
2021-05-25 01:22:08 -04:00
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
2020-01-03 08:17:24 -05:00
*
2021-05-25 01:22:08 -04:00
* @ type { Object }
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
var store = Object ( external _wp _data _ [ "createReduxStore" ] ) ( STORE _NAME , storeConfig ) ;
Object ( external _wp _data _ [ "register" ] ) ( store ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/auto-block-uninstaller/index.js
/ * *
* WordPress dependencies
* /
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
/ * *
* Internal dependencies
* /
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
function AutoBlockUninstaller ( ) {
var _useDispatch = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ,
uninstallBlockType = _useDispatch . uninstallBlockType ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var shouldRemoveBlockTypes = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
var _select = select ( 'core/editor' ) ,
isAutosavingPost = _select . isAutosavingPost ,
isSavingPost = _select . isSavingPost ;
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
return isSavingPost ( ) && ! isAutosavingPost ( ) ;
} , [ ] ) ;
var unusedBlockTypes = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( store ) . getUnusedBlockTypes ( ) ;
} , [ ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( function ( ) {
if ( shouldRemoveBlockTypes && unusedBlockTypes . length ) {
unusedBlockTypes . forEach ( function ( blockType ) {
uninstallBlockType ( blockType ) ;
Object ( external _wp _blocks _ [ "unregisterBlockType" ] ) ( blockType . name ) ;
} ) ;
}
} , [ shouldRemoveBlockTypes ] ) ;
return null ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
var slicedToArray = _ _webpack _require _ _ ( "ODXe" ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","blockEditor"]
var external _wp _blockEditor _ = _ _webpack _require _ _ ( "axFQ" ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","compose"]
var external _wp _compose _ = _ _webpack _require _ _ ( "K9lf" ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","components"]
var external _wp _components _ = _ _webpack _require _ _ ( "tI+e" ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: external ["wp","a11y"]
var external _wp _a11y _ = _ _webpack _require _ _ ( "gdqT" ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-author-info/index.js
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/ * *
* WordPress dependencies
* /
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
function DownloadableBlockAuthorInfo ( _ref ) {
var author = _ref . author ,
authorBlockCount = _ref . authorBlockCount ,
authorBlockRating = _ref . authorBlockRating ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
className : "block-directory-downloadable-block-author-info__content-author"
} , Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: author name. */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Authored by %s' ) , author ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
className : "block-directory-downloadable-block-author-info__content"
} , authorBlockRating > 0 ? Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: 1: number of blocks. 2: average rating. */
Object ( external _wp _i18n _ [ "_n" ] ) ( 'This author has %1$d block, with an average rating of %2$.1f.' , 'This author has %1$d blocks, with an average rating of %2$.1f.' , authorBlockCount ) , authorBlockCount , authorBlockRating ) : Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: 1: number of blocks. */
Object ( external _wp _i18n _ [ "_n" ] ) ( 'This author has %1$d block.' , 'This author has %1$d blocks.' , authorBlockCount ) , authorBlockCount ) ) ) ;
}
/* harmony default export */ var downloadable _block _author _info = ( DownloadableBlockAuthorInfo ) ;
// EXTERNAL MODULE: external ["wp","htmlEntities"]
var external _wp _htmlEntities _ = _ _webpack _require _ _ ( "rmEH" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
var build _module _icon = _ _webpack _require _ _ ( "iClF" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
var star _filled = _ _webpack _require _ _ ( "URob" ) ;
// EXTERNAL MODULE: external ["wp","primitives"]
var external _wp _primitives _ = _ _webpack _require _ _ ( "Tqx9" ) ;
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* WordPress dependencies
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
var starHalf = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"
} ) ) ;
/* harmony default export */ var star _half = ( starHalf ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
var star _empty = _ _webpack _require _ _ ( "Xxwi" ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/stars.js
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* External dependencies
2020-01-03 08:17:24 -05:00
* /
/ * *
2021-05-25 01:22:08 -04:00
* WordPress dependencies
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function Stars ( _ref ) {
var rating = _ref . rating ;
var stars = Math . round ( rating / 0.5 ) * 0.5 ;
var fullStarCount = Math . floor ( rating ) ;
var halfStarCount = Math . ceil ( rating - fullStarCount ) ;
var emptyStarCount = 5 - ( fullStarCount + halfStarCount ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
"aria-label" : Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: number of stars. */
Object ( external _wp _i18n _ [ "__" ] ) ( '%s out of 5 stars' ) , stars )
} , Object ( external _lodash _ [ "times" ] ) ( fullStarCount , function ( i ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
key : "full_stars_" . concat ( i ) ,
icon : star _filled [ "a" /* default */ ] ,
size : 16
} ) ;
} ) , Object ( external _lodash _ [ "times" ] ) ( halfStarCount , function ( i ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
key : "half_stars_" . concat ( i ) ,
icon : star _half ,
size : 16
} ) ;
} ) , Object ( external _lodash _ [ "times" ] ) ( emptyStarCount , function ( i ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
key : "empty_stars_" . concat ( i ) ,
icon : star _empty [ "a" /* default */ ] ,
size : 16
} ) ;
} ) ) ;
2020-01-03 08:17:24 -05:00
}
2021-05-25 01:22:08 -04:00
/* harmony default export */ var block _ratings _stars = ( Stars ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/index.js
2020-06-26 09:33:47 -04:00
/ * *
2021-05-25 01:22:08 -04:00
* WordPress dependencies
2020-06-26 09:33:47 -04:00
* /
/ * *
2021-05-25 01:22:08 -04:00
* Internal dependencies
2020-06-26 09:33:47 -04:00
* /
2021-05-25 01:22:08 -04:00
var block _ratings _BlockRatings = function BlockRatings ( _ref ) {
var rating = _ref . rating ,
ratingCount = _ref . ratingCount ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-block-ratings"
} , Object ( external _wp _element _ [ "createElement" ] ) ( block _ratings _stars , {
rating : rating
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
className : "block-directory-block-ratings__rating-count" ,
"aria-label" : Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: %d: number of ratings (number).
Object ( external _wp _i18n _ [ "_n" ] ) ( '%d total rating' , '%d total ratings' , ratingCount ) , ratingCount )
} , "(" , ratingCount , ")" ) ) ;
} ;
/* harmony default export */ var block _ratings = ( block _ratings _BlockRatings ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js
2020-06-26 09:33:47 -04:00
/ * *
2021-05-25 01:22:08 -04:00
* WordPress dependencies
2020-06-26 09:33:47 -04:00
* /
2021-05-25 01:22:08 -04:00
function DownloadableBlockIcon ( _ref ) {
var icon = _ref . icon ,
title = _ref . title ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-icon"
} , icon . match ( /\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/ ) !== null ? Object ( external _wp _element _ [ "createElement" ] ) ( "img" , {
src : icon ,
alt : Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: %s: Name of the plugin e.g: "Akismet".
Object ( external _wp _i18n _ [ "__" ] ) ( '%s block icon' ) , title )
} ) : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockIcon" ] , {
icon : icon ,
showColors : true
} ) ) ;
2020-06-26 09:33:47 -04:00
}
2021-05-25 01:22:08 -04:00
/* harmony default export */ var downloadable _block _icon = ( DownloadableBlockIcon ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-header/index.js
2020-01-03 08:17:24 -05:00
/ * *
2020-06-26 09:33:47 -04:00
* WordPress dependencies
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
2020-06-26 09:33:47 -04:00
/ * *
* Internal dependencies
* /
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
function DownloadableBlockHeader ( _ref ) {
var icon = _ref . icon ,
title = _ref . title ,
rating = _ref . rating ,
ratingCount = _ref . ratingCount ,
_ref$isLoading = _ref . isLoading ,
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading ,
_ref$isInstallable = _ref . isInstallable ,
isInstallable = _ref$isInstallable === void 0 ? true : _ref$isInstallable ,
_onClick = _ref . onClick ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-header__row"
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _icon , {
icon : icon ,
title : title
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-header__column"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "h2" , {
className : "block-directory-downloadable-block-header__title"
} , Object ( external _wp _htmlEntities _ [ "decodeEntities" ] ) ( title ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( block _ratings , {
rating : rating ,
ratingCount : ratingCount
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
isSecondary : true ,
isBusy : isLoading ,
disabled : isLoading || ! isInstallable ,
onClick : function onClick ( event ) {
event . preventDefault ( ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
if ( ! isLoading && isInstallable ) {
_onClick ( ) ;
}
}
} , isLoading ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Adding…' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Add block' ) ) ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/* harmony default export */ var downloadable _block _header = ( DownloadableBlockHeader ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chart-line.js
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/ * *
* WordPress dependencies
* /
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
var chartLine = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "-2 -2 24 24"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M18 3.5c0 .62-.38 1.16-.92 1.38v13.11H1.99l4.22-6.73c-.13-.23-.21-.48-.21-.76C6 9.67 6.67 9 7.5 9S9 9.67 9 10.5c0 .13-.02.25-.05.37l1.44.63c.27-.3.67-.5 1.11-.5.18 0 .35.04.51.09l3.58-6.41c-.36-.27-.59-.7-.59-1.18 0-.83.67-1.5 1.5-1.5.19 0 .36.04.53.1l.05-.09v.11c.54.22.92.76.92 1.38zm-1.92 13.49V5.85l-3.29 5.89c.13.23.21.48.21.76 0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5l.01-.07-1.63-.72c-.25.18-.55.29-.88.29-.18 0-.35-.04-.51-.1l-3.2 5.09h12.29z"
} ) ) ;
/* harmony default export */ var chart _line = ( chartLine ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/update.js
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2021-05-25 01:22:08 -04:00
var update = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "-2 -2 24 24"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"
} ) ) ;
/* harmony default export */ var library _update = ( update ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-info/index.js
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* WordPress dependencies
2020-01-03 08:17:24 -05:00
* /
2021-05-25 01:22:08 -04:00
function DownloadableBlockInfo ( _ref ) {
var activeInstalls = _ref . activeInstalls ,
description = _ref . description ,
humanizedUpdated = _ref . humanizedUpdated ;
var activeInstallsString ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
if ( activeInstalls > 1000000 ) {
activeInstallsString = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %d: number of active installations. */
Object ( external _wp _i18n _ [ "__" ] ) ( '%d+ Million active installations' ) , Math . floor ( activeInstalls / 1000000 ) ) ;
} else if ( 0 === activeInstalls ) {
activeInstallsString = Object ( external _wp _i18n _ [ "__" ] ) ( 'Less than 10 active installations' ) ;
} else {
activeInstallsString = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %d: number of active installations. */
Object ( external _wp _i18n _ [ "__" ] ) ( '%d+ active installations' ) , activeInstalls ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-block-info__content"
} , Object ( external _wp _htmlEntities _ [ "decodeEntities" ] ) ( description ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-info__meta"
} , Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
className : "block-directory-downloadable-block-info__icon" ,
icon : chart _line
} ) , activeInstallsString ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-info__meta"
} , Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
className : "block-directory-downloadable-block-info__icon" ,
icon : library _update
} ) , // translators: %s: Humanized date of last update e.g: "2 months ago".
Object ( external _wp _i18n _ [ "sprintf" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Updated %s' ) , humanizedUpdated ) ) ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/* harmony default export */ var downloadable _block _info = ( DownloadableBlockInfo ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js
2020-06-26 09:33:47 -04:00
/ * *
* WordPress dependencies
* /
2021-01-27 21:04:13 -05:00
/ * *
* Internal dependencies
* /
2021-05-25 01:22:08 -04:00
var downloadable _block _notice _DownloadableBlockNotice = function DownloadableBlockNotice ( _ref ) {
var block = _ref . block ,
_onClick = _ref . onClick ;
var errorNotice = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( store ) . getErrorNoticeForBlock ( block . id ) ;
} , [ block ] ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
if ( ! errorNotice ) {
return null ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Notice" ] , {
status : "error" ,
isDismissible : false ,
className : "block-directory-downloadable-block-notice"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-notice__content"
} , errorNotice . message ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
isSmall : true ,
isPrimary : true ,
onClick : function onClick ( ) {
if ( errorNotice . isFatal ) {
window . location . reload ( ) ;
return false ;
}
_onClick ( block ) ;
2020-06-26 09:33:47 -04:00
}
2021-05-25 01:22:08 -04:00
} , errorNotice . isFatal ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Reload' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Retry' ) ) ) ;
} ;
/* harmony default export */ var downloadable _block _notice = ( downloadable _block _notice _DownloadableBlockNotice ) ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/ * *
* WordPress dependencies
* /
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/ * *
* Internal dependencies
* /
2020-01-03 08:17:24 -05:00
2020-10-20 09:36:16 -04:00
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function DownloadableBlockListItem ( _ref ) {
var item = _ref . item ,
onClick = _ref . onClick ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
var _useSelect = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
var _select = select ( store ) ,
isInstalling = _select . isInstalling ,
getErrorNoticeForBlock = _select . getErrorNoticeForBlock ;
var notice = getErrorNoticeForBlock ( item . id ) ;
var hasFatal = notice && notice . isFatal ;
return {
isLoading : isInstalling ( item . id ) ,
isInstallable : ! hasFatal
} ;
} , [ item ] ) ,
isLoading = _useSelect . isLoading ,
isInstallable = _useSelect . isInstallable ;
var icon = item . icon ,
title = item . title ,
description = item . description ,
rating = item . rating ,
activeInstalls = item . activeInstalls ,
ratingCount = item . ratingCount ,
author = item . author ,
humanizedUpdated = item . humanizedUpdated ,
authorBlockCount = item . authorBlockCount ,
authorBlockRating = item . authorBlockRating ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "li" , {
className : "block-directory-downloadable-block-list-item"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "article" , {
className : "block-directory-downloadable-block-list-item__panel"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "header" , {
className : "block-directory-downloadable-block-list-item__header"
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _header , {
icon : icon ,
onClick : onClick ,
title : title ,
rating : rating ,
ratingCount : ratingCount ,
isLoading : isLoading ,
isInstallable : isInstallable
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "section" , {
className : "block-directory-downloadable-block-list-item__body"
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _notice , {
onClick : onClick ,
block : item
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _info , {
activeInstalls : activeInstalls ,
description : description ,
humanizedUpdated : humanizedUpdated
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "footer" , {
className : "block-directory-downloadable-block-list-item__footer"
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _author _info , {
author : author ,
authorBlockCount : authorBlockCount ,
authorBlockRating : authorBlockRating
} ) ) ) ) ;
2020-06-26 09:33:47 -04:00
}
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js
2020-10-13 09:10:30 -04:00
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
/ * *
* External dependencies
* /
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
/ * *
* WordPress dependencies
* /
2020-06-26 09:33:47 -04:00
/ * *
2021-05-25 01:22:08 -04:00
* Internal dependencies
2020-06-26 09:33:47 -04:00
* /
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
function DownloadableBlocksList ( _ref ) {
var items = _ref . items ,
_ref$onHover = _ref . onHover ,
onHover = _ref$onHover === void 0 ? external _lodash _ [ "noop" ] : _ref$onHover ,
onSelect = _ref . onSelect ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var _useDispatch = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ,
installBlockType = _useDispatch . installBlockType ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
if ( ! items . length ) {
return null ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
return (
/ *
* Disable reason : The ` list ` ARIA role is redundant but
* Safari + VoiceOver won ' t announce the list otherwise .
* /
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/* eslint-disable jsx-a11y/no-redundant-roles */
Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , {
role : "list" ,
className : "block-directory-downloadable-blocks-list"
} , items . map ( function ( item ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( DownloadableBlockListItem , {
key : item . id ,
onClick : function onClick ( ) {
// Check if the block is registered (`getBlockType`
// will return an object). If so, insert the block.
// This prevents installing existing plugins.
if ( Object ( external _wp _blocks _ [ "getBlockType" ] ) ( item . name ) ) {
onSelect ( item ) ;
} else {
installBlockType ( item ) . then ( function ( success ) {
if ( success ) {
onSelect ( item ) ;
}
} ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
onHover ( null ) ;
} ,
item : item
} ) ;
} ) )
/* eslint-enable jsx-a11y/no-redundant-roles */
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
) ;
2020-01-03 08:17:24 -05:00
}
2021-05-25 01:22:08 -04:00
/* harmony default export */ var downloadable _blocks _list = ( DownloadableBlocksList ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2021-05-25 01:22:08 -04:00
2020-06-26 09:33:47 -04:00
/ * *
2021-05-25 01:22:08 -04:00
* Internal dependencies
2020-06-26 09:33:47 -04:00
* /
2021-05-25 01:22:08 -04:00
function DownloadableBlocksPanel ( _ref ) {
var downloadableItems = _ref . downloadableItems ,
onSelect = _ref . onSelect ,
onHover = _ref . onHover ,
hasPermission = _ref . hasPermission ,
isLoading = _ref . isLoading ,
isWaiting = _ref . isWaiting ;
var debouncedSpeak = Object ( external _wp _compose _ [ "useDebounce" ] ) ( external _wp _a11y _ [ "speak" ] , 500 ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
if ( false === hasPermission ) {
debouncedSpeak ( Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library.' ) ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-blocks-panel__description has-no-results"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library.' ) ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
if ( typeof hasPermission === 'undefined' || isLoading || isWaiting ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-blocks-panel__description has-no-results"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Spinner" ] , null ) ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
if ( ! downloadableItems . length ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-blocks-panel__description has-no-results"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library.' ) ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var resultsFoundMessage = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: number of available blocks. */
Object ( external _wp _i18n _ [ "_n" ] ) ( 'No blocks found in your library. We did find %d block available for download.' , 'No blocks found in your library. We did find %d blocks available for download.' , downloadableItems . length ) , downloadableItems . length ) ;
debouncedSpeak ( resultsFoundMessage ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-blocks-panel__description"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library. These blocks can be downloaded and installed:' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _blocks _list , {
items : downloadableItems ,
onSelect : onSelect ,
onHover : onHover
} ) ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/* harmony default export */ var downloadable _blocks _panel = ( Object ( external _wp _compose _ [ "compose" ] ) ( [ Object ( external _wp _data _ [ "withSelect" ] ) ( function ( select , _ref2 ) {
var filterValue = _ref2 . filterValue ,
_ref2$rootClientId = _ref2 . rootClientId ,
rootClientId = _ref2$rootClientId === void 0 ? null : _ref2$rootClientId ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
var _select = select ( store ) ,
getDownloadableBlocks = _select . getDownloadableBlocks ,
isRequestingDownloadableBlocks = _select . isRequestingDownloadableBlocks ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var _select2 = select ( external _wp _blockEditor _ [ "store" ] ) ,
canInsertBlockType = _select2 . canInsertBlockType ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var hasPermission = select ( 'core' ) . canUser ( 'read' , 'block-directory/search' ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
function getInstallableBlocks ( term ) {
return getDownloadableBlocks ( term ) . filter ( function ( block ) {
return canInsertBlockType ( block , rootClientId , true ) ;
} ) ;
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var downloadableItems = hasPermission ? getInstallableBlocks ( filterValue ) : [ ] ;
var isLoading = isRequestingDownloadableBlocks ( filterValue ) ;
return {
downloadableItems : downloadableItems ,
hasPermission : hasPermission ,
isLoading : isLoading
} ;
} ) ] ) ( DownloadableBlocksPanel ) ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/ * *
* External dependencies
* /
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2020-02-10 17:33:27 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* Internal dependencies
2020-02-10 17:33:27 -05:00
* /
2021-05-25 01:22:08 -04:00
function InserterMenuDownloadableBlocksPanel ( ) {
var _useState = Object ( external _wp _element _ [ "useState" ] ) ( '' ) ,
_useState2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _useState , 2 ) ,
debouncedFilterValue = _useState2 [ 0 ] ,
setFilterValue = _useState2 [ 1 ] ;
var debouncedSetFilterValue = Object ( external _lodash _ [ "debounce" ] ) ( setFilterValue , 400 ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalInserterMenuExtension" ] , null , function ( _ref ) {
var onSelect = _ref . onSelect ,
onHover = _ref . onHover ,
filterValue = _ref . filterValue ,
hasItems = _ref . hasItems ,
rootClientId = _ref . rootClientId ;
if ( hasItems || ! filterValue ) {
return null ;
}
if ( debouncedFilterValue !== filterValue ) {
debouncedSetFilterValue ( filterValue ) ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _blocks _panel , {
onSelect : onSelect ,
onHover : onHover ,
rootClientId : rootClientId ,
filterValue : debouncedFilterValue ,
isWaiting : filterValue !== debouncedFilterValue
} ) ;
} ) ;
}
/* harmony default export */ var inserter _menu _downloadable _blocks _panel = ( InserterMenuDownloadableBlocksPanel ) ;
// EXTERNAL MODULE: external ["wp","editPost"]
var external _wp _editPost _ = _ _webpack _require _ _ ( "BLhE" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
var block _default = _ _webpack _require _ _ ( "//Lo" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/compact-list/index.js
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2021-05-25 01:22:08 -04:00
/ * *
* Internal dependencies
* /
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
function CompactList ( _ref ) {
var items = _ref . items ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
if ( ! items . length ) {
return null ;
2020-10-13 09:10:30 -04:00
}
2021-05-25 01:22:08 -04:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , {
className : "block-directory-compact-list"
} , items . map ( function ( _ref2 ) {
var icon = _ref2 . icon ,
id = _ref2 . id ,
title = _ref2 . title ,
author = _ref2 . author ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "li" , {
key : id ,
className : "block-directory-compact-list__item"
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _icon , {
icon : icon ,
title : title
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-compact-list__item-details"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-compact-list__item-title"
} , title ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-compact-list__item-author"
} , Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: Name of the block author. */
Object ( external _wp _i18n _ [ "__" ] ) ( 'By %s' ) , author ) ) ) ) ;
} ) ) ;
2020-01-03 08:17:24 -05:00
}
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js
2020-06-26 09:33:47 -04:00
/ * *
* WordPress dependencies
* /
2021-05-25 01:22:08 -04:00
2021-01-27 21:04:13 -05:00
/ * *
* Internal dependencies
* /
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function InstalledBlocksPrePublishPanel ( ) {
var newBlockTypes = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( store ) . getNewBlockTypes ( ) ;
} , [ ] ) ;
if ( ! newBlockTypes . length ) {
2020-06-26 09:33:47 -04:00
return null ;
}
2021-05-25 01:22:08 -04:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editPost _ [ "PluginPrePublishPanel" ] , {
icon : block _default [ "a" /* default */ ] ,
title : Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: %d: number of blocks (number).
Object ( external _wp _i18n _ [ "_n" ] ) ( 'Added: %d block' , 'Added: %d blocks' , newBlockTypes . length ) , newBlockTypes . length ) ,
initialOpen : true
} , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "installed-blocks-pre-publish-panel__copy"
} , Object ( external _wp _i18n _ [ "_n" ] ) ( 'The following block has been added to your site.' , 'The following blocks have been added to your site.' , newBlockTypes . length ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( CompactList , {
items : newBlockTypes
} ) ) ;
}
2020-07-07 10:43:35 -04:00
2021-09-08 17:06:23 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
2021-05-25 01:22:08 -04:00
var objectWithoutProperties = _ _webpack _require _ _ ( "Ff2n" ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm _extends = _ _webpack _require _ _ ( "wx14" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/install-button.js
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
/ * *
* WordPress dependencies
* /
2021-05-25 01:22:08 -04:00
2020-01-03 08:17:24 -05:00
/ * *
* Internal dependencies
* /
2021-05-25 01:22:08 -04:00
function InstallButton ( _ref ) {
var attributes = _ref . attributes ,
block = _ref . block ,
clientId = _ref . clientId ;
var isInstallingBlock = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( store ) . isInstalling ( block . id ) ;
} ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var _useDispatch = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ,
installBlockType = _useDispatch . installBlockType ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var _useDispatch2 = Object ( external _wp _data _ [ "useDispatch" ] ) ( 'core/block-editor' ) ,
replaceBlock = _useDispatch2 . replaceBlock ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
onClick : function onClick ( ) {
return installBlockType ( block ) . then ( function ( success ) {
if ( success ) {
var blockType = Object ( external _wp _blocks _ [ "getBlockType" ] ) ( block . name ) ;
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
var _parse = Object ( external _wp _blocks _ [ "parse" ] ) ( attributes . originalContent ) ,
_parse2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _parse , 1 ) ,
originalBlock = _parse2 [ 0 ] ;
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
if ( originalBlock ) {
replaceBlock ( clientId , Object ( external _wp _blocks _ [ "createBlock" ] ) ( blockType . name , originalBlock . attributes , originalBlock . innerBlocks ) ) ;
}
}
} ) ;
} ,
disabled : isInstallingBlock ,
isBusy : isInstallingBlock ,
isPrimary : true
} , Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: block name */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Install %s' ) , block . title ) ) ;
2020-01-03 08:17:24 -05:00
}
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/index.js
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
2020-01-03 08:17:24 -05:00
/ * *
* Internal dependencies
* /
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
var get _install _missing _getInstallMissing = function getInstallMissing ( OriginalComponent ) {
return function ( props ) {
var originalName = props . attributes . originalName ; // Disable reason: This is a valid component, but it's mistaken for a callback.
// eslint-disable-next-line react-hooks/rules-of-hooks
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
var _useSelect = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
var _select = select ( store ) ,
getDownloadableBlocks = _select . getDownloadableBlocks ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
var blocks = getDownloadableBlocks ( 'block:' + originalName ) . filter ( function ( _ref ) {
var name = _ref . name ;
return originalName === name ;
} ) ;
return {
hasPermission : select ( 'core' ) . canUser ( 'read' , 'block-directory/search' ) ,
block : blocks . length && blocks [ 0 ]
} ;
} , [ originalName ] ) ,
block = _useSelect . block ,
hasPermission = _useSelect . hasPermission ; // The user can't install blocks, or the block isn't available for download.
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
if ( ! hasPermission || ! block ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( OriginalComponent , props ) ;
}
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
return Object ( external _wp _element _ [ "createElement" ] ) ( get _install _missing _ModifiedWarning , Object ( esm _extends [ "a" /* default */ ] ) ( { } , props , {
originalBlock : block
} ) ) ;
} ;
} ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var get _install _missing _ModifiedWarning = function ModifiedWarning ( _ref2 ) {
var originalBlock = _ref2 . originalBlock ,
props = Object ( objectWithoutProperties [ "a" /* default */ ] ) ( _ref2 , [ "originalBlock" ] ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var _props$attributes = props . attributes ,
originalName = _props$attributes . originalName ,
originalUndelimitedContent = _props$attributes . originalUndelimitedContent ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
var _useDispatch = Object ( external _wp _data _ [ "useDispatch" ] ) ( 'core/block-editor' ) ,
replaceBlock = _useDispatch . replaceBlock ;
var convertToHTML = function convertToHTML ( ) {
replaceBlock ( props . clientId , Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/html' , {
content : originalUndelimitedContent
} ) ) ;
} ;
var hasContent = ! ! originalUndelimitedContent ;
var hasHTMLBlock = Object ( external _wp _blocks _ [ "getBlockType" ] ) ( 'core/html' ) ;
var messageHTML = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: block name */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Your site doesn’ t include support for the %s block. You can try installing the block or remove it entirely!' ) , originalBlock . title || originalName ) ;
var actions = [ Object ( external _wp _element _ [ "createElement" ] ) ( InstallButton , {
key : "install" ,
block : originalBlock ,
attributes : props . attributes ,
clientId : props . clientId
} ) ] ;
if ( hasContent && hasHTMLBlock ) {
messageHTML = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: block name */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Your site doesn’ t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.' ) , originalBlock . title || originalName ) ;
actions . push ( Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
key : "convert" ,
onClick : convertToHTML ,
isLink : true
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Keep as HTML' ) ) ) ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , Object ( external _wp _blockEditor _ [ "useBlockProps" ] ) ( ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "Warning" ] , {
actions : actions
} , messageHTML ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "RawHTML" ] , null , originalUndelimitedContent ) ) ;
} ;
/* harmony default export */ var get _install _missing = ( get _install _missing _getInstallMissing ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2021-05-25 01:22:08 -04:00
/ * *
* Internal dependencies
* /
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
Object ( external _wp _plugins _ [ "registerPlugin" ] ) ( 'block-directory' , {
render : function render ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( AutoBlockUninstaller , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( inserter _menu _downloadable _blocks _panel , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( InstalledBlocksPrePublishPanel , null ) ) ;
}
} ) ;
Object ( external _wp _hooks _ [ "addFilter" ] ) ( 'blocks.registerBlockType' , 'block-directory/fallback' , function ( settings , name ) {
if ( name !== 'core/missing' ) {
return settings ;
}
2020-10-20 09:36:16 -04:00
2021-05-25 01:22:08 -04:00
settings . edit = get _install _missing ( settings . edit ) ;
return settings ;
} ) ;
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/index.js
2020-01-03 08:17:24 -05:00
/ * *
* Internal dependencies
* /
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/***/ "BLhE" :
/***/ ( function ( module , exports ) {
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "editPost" ] ; } ( ) ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/***/ "BsWD" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _unsupportedIterableToArray ; } ) ;
/* harmony import */ var _babel _runtime _helpers _esm _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "a3WO" ) ;
function _unsupportedIterableToArray ( o , minLen ) {
if ( ! o ) return ;
if ( typeof o === "string" ) return Object ( _babel _runtime _helpers _esm _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( o , minLen ) ;
var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ;
if ( n === "Object" && o . constructor ) n = o . constructor . name ;
if ( n === "Map" || n === "Set" ) return Array . from ( o ) ;
if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return Object ( _babel _runtime _helpers _esm _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( o , minLen ) ;
2020-01-03 08:17:24 -05:00
}
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/***/ "DSFK" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _arrayWithHoles ; } ) ;
function _arrayWithHoles ( arr ) {
if ( Array . isArray ( arr ) ) return arr ;
}
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
/***/ "Ff2n" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
"use strict" ;
2021-09-08 17:06:23 -04:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* binding */ _objectWithoutProperties ; } ) ;
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose ( source , excluded ) {
if ( source == null ) return { } ;
var target = { } ;
var sourceKeys = Object . keys ( source ) ;
var key , i ;
for ( i = 0 ; i < sourceKeys . length ; i ++ ) {
key = sourceKeys [ i ] ;
if ( excluded . indexOf ( key ) >= 0 ) continue ;
target [ key ] = source [ key ] ;
}
return target ;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
2021-05-25 01:22:08 -04:00
function _objectWithoutProperties ( source , excluded ) {
if ( source == null ) return { } ;
2021-09-08 17:06:23 -04:00
var target = _objectWithoutPropertiesLoose ( source , excluded ) ;
2021-05-25 01:22:08 -04:00
var key , i ;
if ( Object . getOwnPropertySymbols ) {
var sourceSymbolKeys = Object . getOwnPropertySymbols ( source ) ;
for ( i = 0 ; i < sourceSymbolKeys . length ; i ++ ) {
key = sourceSymbolKeys [ i ] ;
if ( excluded . indexOf ( key ) >= 0 ) continue ;
if ( ! Object . prototype . propertyIsEnumerable . call ( source , key ) ) continue ;
target [ key ] = source [ key ] ;
}
}
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
return target ;
}
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ "GRId" :
/***/ ( function ( module , exports ) {
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "element" ] ; } ( ) ) ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ "HSyU" :
/***/ ( function ( module , exports ) {
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "blocks" ] ; } ( ) ) ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ "HaE+" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _asyncToGenerator ; } ) ;
function asyncGeneratorStep ( gen , resolve , reject , _next , _throw , key , arg ) {
try {
var info = gen [ key ] ( arg ) ;
var value = info . value ;
} catch ( error ) {
reject ( error ) ;
return ;
}
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
if ( info . done ) {
resolve ( value ) ;
} else {
Promise . resolve ( value ) . then ( _next , _throw ) ;
}
}
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
function _asyncToGenerator ( fn ) {
return function ( ) {
var self = this ,
args = arguments ;
return new Promise ( function ( resolve , reject ) {
var gen = fn . apply ( self , args ) ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
function _next ( value ) {
asyncGeneratorStep ( gen , resolve , reject , _next , _throw , "next" , value ) ;
}
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
function _throw ( err ) {
asyncGeneratorStep ( gen , resolve , reject , _next , _throw , "throw" , err ) ;
}
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
_next ( undefined ) ;
2020-01-08 06:57:23 -05:00
} ) ;
2021-05-25 01:22:08 -04:00
} ;
2020-01-08 06:57:23 -05:00
}
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ "K9lf" :
/***/ ( function ( module , exports ) {
2021-02-02 00:17:13 -05:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "compose" ] ; } ( ) ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
/***/ "KQm4" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
"use strict" ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* binding */ _toConsumableArray ; } ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
var arrayLikeToArray = _ _webpack _require _ _ ( "a3WO" ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function _arrayWithoutHoles ( arr ) {
if ( Array . isArray ( arr ) ) return Object ( arrayLikeToArray [ "a" /* default */ ] ) ( arr ) ;
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
var iterableToArray = _ _webpack _require _ _ ( "25BE" ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
var unsupportedIterableToArray = _ _webpack _require _ _ ( "BsWD" ) ;
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread ( ) {
throw new TypeError ( "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
2020-06-26 09:33:47 -04:00
}
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
function _toConsumableArray ( arr ) {
return _arrayWithoutHoles ( arr ) || Object ( iterableToArray [ "a" /* default */ ] ) ( arr ) || Object ( unsupportedIterableToArray [ "a" /* default */ ] ) ( arr ) || _nonIterableSpread ( ) ;
}
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
/***/ "ODXe" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
"use strict" ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* binding */ _slicedToArray ; } ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
var arrayWithHoles = _ _webpack _require _ _ ( "DSFK" ) ;
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit ( arr , i ) {
if ( typeof Symbol === "undefined" || ! ( Symbol . iterator in Object ( arr ) ) ) return ;
var _arr = [ ] ;
var _n = true ;
var _d = false ;
var _e = undefined ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
try {
for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) {
_arr . push ( _s . value ) ;
if ( i && _arr . length === i ) break ;
}
} catch ( err ) {
_d = true ;
_e = err ;
} finally {
try {
if ( ! _n && _i [ "return" ] != null ) _i [ "return" ] ( ) ;
} finally {
if ( _d ) throw _e ;
}
2020-06-26 09:33:47 -04:00
}
2021-05-25 01:22:08 -04:00
return _arr ;
2020-06-26 09:33:47 -04:00
}
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
var unsupportedIterableToArray = _ _webpack _require _ _ ( "BsWD" ) ;
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
var nonIterableRest = _ _webpack _require _ _ ( "PYwp" ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
function _slicedToArray ( arr , i ) {
return Object ( arrayWithHoles [ "a" /* default */ ] ) ( arr ) || _iterableToArrayLimit ( arr , i ) || Object ( unsupportedIterableToArray [ "a" /* default */ ] ) ( arr , i ) || Object ( nonIterableRest [ "a" /* default */ ] ) ( ) ;
}
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ "PYwp" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _nonIterableRest ; } ) ;
function _nonIterableRest ( ) {
throw new TypeError ( "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
}
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ "Tqx9" :
/***/ ( function ( module , exports ) {
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "primitives" ] ; } ( ) ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ "TvNi" :
/***/ ( function ( module , exports ) {
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "plugins" ] ; } ( ) ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ "URob" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
2021-01-27 21:04:13 -05:00
2020-01-08 06:57:23 -05:00
/ * *
* WordPress dependencies
* /
2021-05-25 01:22:08 -04:00
var starFilled = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( starFilled ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ "Xxwi" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
2020-10-13 09:10:30 -04:00
2020-01-08 06:57:23 -05:00
/ * *
2021-05-25 01:22:08 -04:00
* WordPress dependencies
2020-01-08 06:57:23 -05:00
* /
2021-05-25 01:22:08 -04:00
var starEmpty = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
fillRule : "evenodd" ,
d : "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z" ,
clipRule : "evenodd"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( starEmpty ) ;
2020-01-08 06:57:23 -05:00
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
/***/ "YLtl" :
/***/ ( function ( module , exports ) {
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "lodash" ] ; } ( ) ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ "a3WO" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _arrayLikeToArray ; } ) ;
function _arrayLikeToArray ( arr , len ) {
if ( len == null || len > arr . length ) len = arr . length ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) {
arr2 [ i ] = arr [ i ] ;
}
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
return arr2 ;
}
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ "axFQ" :
/***/ ( function ( module , exports ) {
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "blockEditor" ] ; } ( ) ) ;
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
/***/ "dvlR" :
/***/ ( function ( module , exports ) {
2021-01-27 21:04:13 -05:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "regeneratorRuntime" ] ; } ( ) ) ;
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
/***/ "g56x" :
/***/ ( function ( module , exports ) {
2020-06-26 09:33:47 -04:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "hooks" ] ; } ( ) ) ;
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-07-07 10:43:35 -04:00
2021-05-25 01:22:08 -04:00
/***/ "gdqT" :
/***/ ( function ( module , exports ) {
2020-10-13 09:10:30 -04:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "a11y" ] ; } ( ) ) ;
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/***/ } ) ,
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
/***/ "iClF" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
"use strict" ;
/* harmony import */ var _babel _runtime _helpers _esm _defineProperty _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "rePB" ) ;
/* harmony import */ var _babel _runtime _helpers _esm _objectWithoutProperties _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Ff2n" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
2020-07-27 16:10:36 -04:00
2021-05-25 01:22:08 -04:00
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 ( _babel _runtime _helpers _esm _defineProperty _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( 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 ; }
2020-07-27 16:10:36 -04:00
2020-10-13 09:10:30 -04:00
/ * *
2021-05-25 01:22:08 -04:00
* WordPress dependencies
2020-10-13 09:10:30 -04:00
* /
2020-07-27 16:10:36 -04:00
2021-05-25 01:22:08 -04:00
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
/ * *
* Return an SVG icon .
*
* @ param { IconProps } props icon is the SVG component to render
* size is a number specifiying the icon size in pixels
* Other props will be passed to wrapped SVG component
*
* @ return { JSX . Element } Icon component
* /
2020-01-03 08:17:24 -05:00
2021-05-25 01:22:08 -04:00
function Icon ( _ref ) {
var icon = _ref . icon ,
_ref$size = _ref . size ,
size = _ref$size === void 0 ? 24 : _ref$size ,
props = Object ( _babel _runtime _helpers _esm _objectWithoutProperties _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ /* default */ "a" ] ) ( _ref , [ "icon" , "size" ] ) ;
2020-02-06 16:03:31 -05:00
2021-05-25 01:22:08 -04:00
return Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "cloneElement" ] ) ( icon , _objectSpread ( {
width : size ,
height : size
} , props ) ) ;
2021-01-27 21:04:13 -05:00
}
2021-05-25 01:22:08 -04:00
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( Icon ) ;
2021-01-27 21:04:13 -05:00
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "l3Sj" :
2020-10-20 09:36:16 -04:00
/***/ ( function ( module , exports ) {
2020-07-27 16:10:36 -04:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "i18n" ] ; } ( ) ) ;
2021-01-27 21:04:13 -05:00
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "onLe" :
2021-01-27 21:04:13 -05:00
/***/ ( function ( module , exports ) {
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "notices" ] ; } ( ) ) ;
2020-07-27 16:10:36 -04:00
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "rePB" :
2020-10-13 09:10:30 -04:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _defineProperty ; } ) ;
function _defineProperty ( obj , key , value ) {
if ( key in obj ) {
Object . defineProperty ( obj , key , {
value : value ,
enumerable : true ,
configurable : true ,
writable : true
} ) ;
} else {
obj [ key ] = value ;
}
return obj ;
}
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "rmEH" :
2021-01-27 21:04:13 -05:00
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "htmlEntities" ] ; } ( ) ) ;
2020-01-22 17:06:21 -05:00
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "tI+e" :
2020-02-06 16:03:31 -05:00
/***/ ( function ( module , exports ) {
2020-01-08 06:57:23 -05:00
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "components" ] ; } ( ) ) ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "wx14" :
2021-01-27 21:04:13 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-07-07 10:43:35 -04:00
2021-01-27 21:04:13 -05:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _extends ; } ) ;
function _extends ( ) {
_extends = Object . assign || function ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] ;
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
}
}
return target ;
} ;
return _extends . apply ( this , arguments ) ;
}
2020-07-07 10:43:35 -04:00
2020-10-20 09:36:16 -04:00
/***/ } ) ,
2021-05-25 01:22:08 -04:00
/***/ "ywyh" :
2020-10-20 09:36:16 -04:00
/***/ ( function ( module , exports ) {
2021-05-25 01:22:08 -04:00
( function ( ) { module . exports = window [ "wp" ] [ "apiFetch" ] ; } ( ) ) ;
2020-01-03 08:17:24 -05:00
/***/ } )
/******/ } ) ;