{
  "version": 3,
  "sources": ["../../src/store/selectors.js"],
  "sourcesContent": ["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { createSelector } from '@wordpress/data';\nimport { RichTextData } from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { getValueFromObjectPath, matchesAttributes } from './utils';\nimport { hasContentRoleAttribute as privateHasContentRoleAttribute } from './private-selectors';\n\n/** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */\n/** @typedef {import('../api/registration').WPBlockVariationScope} WPBlockVariationScope */\n/** @typedef {import('./reducer').WPBlockCategory} WPBlockCategory */\n\n/**\n * Given a block name or block type object, returns the corresponding\n * normalized block type object.\n *\n * @param {Object}          state      Blocks state.\n * @param {(string|Object)} nameOrType Block name or type object\n *\n * @return {Object} Block type object.\n */\nconst getNormalizedBlockType = ( state, nameOrType ) =>\n\t'string' === typeof nameOrType\n\t\t? getBlockType( state, nameOrType )\n\t\t: nameOrType;\n\n/**\n * Returns all the available block types.\n *\n * @param {Object} state Data state.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const blockTypes = useSelect(\n *         ( select ) => select( blocksStore ).getBlockTypes(),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { blockTypes.map( ( block ) => (\n *                 <li key={ block.name }>{ block.title }</li>\n *             ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return {Array} Block Types.\n */\nexport const getBlockTypes = createSelector(\n\t( state ) => Object.values( state.blockTypes ),\n\t( state ) => [ state.blockTypes ]\n);\n\n/**\n * Returns a block type by name.\n *\n * @param {Object} state Data state.\n * @param {string} name  Block type name.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const paragraphBlock = useSelect( ( select ) =>\n *         ( select ) => select( blocksStore ).getBlockType( 'core/paragraph' ),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { paragraphBlock &&\n *                 Object.entries( paragraphBlock.supports ).map(\n *                     ( blockSupportsEntry ) => {\n *                         const [ propertyName, value ] = blockSupportsEntry;\n *                         return (\n *                             <li\n *                                 key={ propertyName }\n *                             >{ `${ propertyName } : ${ value }` }</li>\n *                         );\n *                     }\n *                 ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return {?Object} Block Type.\n */\nexport function getBlockType( state, name ) {\n\treturn state.blockTypes[ name ];\n}\n\n/**\n * Returns block styles by block name.\n *\n * @param {Object} state Data state.\n * @param {string} name  Block type name.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const buttonBlockStyles = useSelect( ( select ) =>\n *         select( blocksStore ).getBlockStyles( 'core/button' ),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { buttonBlockStyles &&\n *                 buttonBlockStyles.map( ( style ) => (\n *                     <li key={ style.name }>{ style.label }</li>\n *                 ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return {Array?} Block Styles.\n */\nexport function getBlockStyles( state, name ) {\n\treturn state.blockStyles[ name ];\n}\n\n/**\n * Returns block variations by block name.\n *\n * @param {Object}                state     Data state.\n * @param {string}                blockName Block type name.\n * @param {WPBlockVariationScope} [scope]   Block variation scope name.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const socialLinkVariations = useSelect( ( select ) =>\n *         select( blocksStore ).getBlockVariations( 'core/social-link' ),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { socialLinkVariations &&\n *                 socialLinkVariations.map( ( variation ) => (\n *                     <li key={ variation.name }>{ variation.title }</li>\n *             ) ) }\n *     </ul>\n *     );\n * };\n * ```\n *\n * @return {(WPBlockVariation[]|void)} Block variations.\n */\nexport const getBlockVariations = createSelector(\n\t( state, blockName, scope ) => {\n\t\tconst variations = state.blockVariations[ blockName ];\n\t\tif ( ! variations || ! scope ) {\n\t\t\treturn variations;\n\t\t}\n\t\treturn variations.filter( ( variation ) => {\n\t\t\t// For backward compatibility reasons, variation's scope defaults to\n\t\t\t// `block` and `inserter` when not set.\n\t\t\treturn ( variation.scope || [ 'block', 'inserter' ] ).includes(\n\t\t\t\tscope\n\t\t\t);\n\t\t} );\n\t},\n\t( state, blockName ) => [ state.blockVariations[ blockName ] ]\n);\n\n/**\n * Returns the active block variation for a given block based on its attributes.\n * Variations are determined by their `isActive` property.\n * Which is either an array of block attribute keys or a function.\n *\n * In case of an array of block attribute keys, the `attributes` are compared\n * to the variation's attributes using strict equality check.\n *\n * In case of function type, the function should accept a block's attributes\n * and the variation's attributes and determines if a variation is active.\n * A function that accepts a block's attributes and the variation's attributes and determines if a variation is active.\n *\n * @param {Object}                state      Data state.\n * @param {string}                blockName  Name of block (example: \u201Ccore/columns\u201D).\n * @param {Object}                attributes Block attributes used to determine active variation.\n * @param {WPBlockVariationScope} [scope]    Block variation scope name.\n *\n * @example\n * ```js\n * import { __ } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { store as blockEditorStore } from '@wordpress/block-editor';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     // This example assumes that a core/embed block is the first block in the Block Editor.\n *     const activeBlockVariation = useSelect( ( select ) => {\n *         // Retrieve the list of blocks.\n *         const [ firstBlock ] = select( blockEditorStore ).getBlocks()\n *\n *         // Return the active block variation for the first block.\n *         return select( blocksStore ).getActiveBlockVariation(\n *             firstBlock.name,\n *             firstBlock.attributes\n *         );\n *     }, [] );\n *\n *     return activeBlockVariation && activeBlockVariation.name === 'spotify' ? (\n *         <p>{ __( 'Spotify variation' ) }</p>\n *         ) : (\n *         <p>{ __( 'Other variation' ) }</p>\n *     );\n * };\n * ```\n *\n * @return {(WPBlockVariation|undefined)} Active block variation.\n */\nexport function getActiveBlockVariation( state, blockName, attributes, scope ) {\n\tconst variations = getBlockVariations( state, blockName, scope );\n\n\tif ( ! variations ) {\n\t\treturn variations;\n\t}\n\n\tconst blockType = getBlockType( state, blockName );\n\tconst attributeKeys = Object.keys( blockType?.attributes || {} );\n\tlet match;\n\tlet maxMatchedAttributes = 0;\n\n\tfor ( const variation of variations ) {\n\t\tif ( Array.isArray( variation.isActive ) ) {\n\t\t\tconst definedAttributes = variation.isActive.filter(\n\t\t\t\t( attribute ) => {\n\t\t\t\t\t// We support nested attribute paths, e.g. `layout.type`.\n\t\t\t\t\t// In this case, we need to check if the part before the\n\t\t\t\t\t// first dot is a known attribute.\n\t\t\t\t\tconst topLevelAttribute = attribute.split( '.' )[ 0 ];\n\t\t\t\t\treturn attributeKeys.includes( topLevelAttribute );\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst definedAttributesLength = definedAttributes.length;\n\t\t\tif ( definedAttributesLength === 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst isMatch = definedAttributes.every( ( attribute ) => {\n\t\t\t\tconst variationAttributeValue = getValueFromObjectPath(\n\t\t\t\t\tvariation.attributes,\n\t\t\t\t\tattribute\n\t\t\t\t);\n\t\t\t\tif ( variationAttributeValue === undefined ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tlet blockAttributeValue = getValueFromObjectPath(\n\t\t\t\t\tattributes,\n\t\t\t\t\tattribute\n\t\t\t\t);\n\t\t\t\tif ( blockAttributeValue instanceof RichTextData ) {\n\t\t\t\t\tblockAttributeValue = blockAttributeValue.toHTMLString();\n\t\t\t\t}\n\t\t\t\treturn matchesAttributes(\n\t\t\t\t\tblockAttributeValue,\n\t\t\t\t\tvariationAttributeValue\n\t\t\t\t);\n\t\t\t} );\n\t\t\tif ( isMatch && definedAttributesLength > maxMatchedAttributes ) {\n\t\t\t\tmatch = variation;\n\t\t\t\tmaxMatchedAttributes = definedAttributesLength;\n\t\t\t}\n\t\t} else if ( variation.isActive?.( attributes, variation.attributes ) ) {\n\t\t\t// If isActive is a function, we cannot know how many attributes it matches.\n\t\t\t// This means that we cannot compare the specificity of our matches,\n\t\t\t// and simply return the best match we have found.\n\t\t\treturn match || variation;\n\t\t}\n\t}\n\n\t// If no variation matches the isActive condition, we return the default variation,\n\t// but only if it doesn't have an isActive condition that wasn't matched.\n\t// This fallback is only applied for the 'block' and 'transform' scopes but not to\n\t// the 'inserter', to avoid affecting block name display there.\n\tif ( ! match && [ 'block', 'transform' ].includes( scope ) ) {\n\t\tmatch = variations.find(\n\t\t\t( variation ) =>\n\t\t\t\tvariation?.isDefault && ! Object.hasOwn( variation, 'isActive' )\n\t\t);\n\t}\n\treturn match;\n}\n\n/**\n * Returns the default block variation for the given block type.\n * When there are multiple variations annotated as the default one,\n * the last added item is picked. This simplifies registering overrides.\n * When there is no default variation set, it returns the first item.\n *\n * @param {Object}                state     Data state.\n * @param {string}                blockName Block type name.\n * @param {WPBlockVariationScope} [scope]   Block variation scope name.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const defaultEmbedBlockVariation = useSelect( ( select ) =>\n *         select( blocksStore ).getDefaultBlockVariation( 'core/embed' ),\n *         []\n *     );\n *\n *     return (\n *         defaultEmbedBlockVariation && (\n *             <p>\n *                 { sprintf(\n *                     __( 'core/embed default variation: %s' ),\n *                     defaultEmbedBlockVariation.title\n *                 ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return {?WPBlockVariation} The default block variation.\n */\nexport function getDefaultBlockVariation( state, blockName, scope ) {\n\tconst variations = getBlockVariations( state, blockName, scope );\n\n\tconst defaultVariation = [ ...variations ]\n\t\t.reverse()\n\t\t.find( ( { isDefault } ) => !! isDefault );\n\n\treturn defaultVariation || variations[ 0 ];\n}\n\n/**\n * Returns all the available block categories.\n *\n * @param {Object} state Data state.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect, } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const blockCategories = useSelect( ( select ) =>\n *         select( blocksStore ).getCategories(),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { blockCategories.map( ( category ) => (\n *                 <li key={ category.slug }>{ category.title }</li>\n *             ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return {WPBlockCategory[]} Categories list.\n */\nexport function getCategories( state ) {\n\treturn state.categories;\n}\n\n/**\n * Returns all the available collections.\n *\n * @param {Object} state Data state.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const blockCollections = useSelect( ( select ) =>\n *         select( blocksStore ).getCollections(),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { Object.values( blockCollections ).length > 0 &&\n *                 Object.values( blockCollections ).map( ( collection ) => (\n *                     <li key={ collection.title }>{ collection.title }</li>\n *             ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return {Object} Collections list.\n */\nexport function getCollections( state ) {\n\treturn state.collections;\n}\n\n/**\n * Returns the name of the default block name.\n *\n * @param {Object} state Data state.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const defaultBlockName = useSelect( ( select ) =>\n *         select( blocksStore ).getDefaultBlockName(),\n *         []\n *     );\n *\n *     return (\n *         defaultBlockName && (\n *             <p>\n *                 { sprintf( __( 'Default block name: %s' ), defaultBlockName ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return {?string} Default block name.\n */\nexport function getDefaultBlockName( state ) {\n\treturn state.defaultBlockName;\n}\n\n/**\n * Returns the name of the block for handling non-block content.\n *\n * @param {Object} state Data state.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const freeformFallbackBlockName = useSelect( ( select ) =>\n *         select( blocksStore ).getFreeformFallbackBlockName(),\n *         []\n *     );\n *\n *     return (\n *         freeformFallbackBlockName && (\n *             <p>\n *                 { sprintf( __(\n *                     'Freeform fallback block name: %s' ),\n *                     freeformFallbackBlockName\n *                 ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return {?string} Name of the block for handling non-block content.\n */\nexport function getFreeformFallbackBlockName( state ) {\n\treturn state.freeformFallbackBlockName;\n}\n\n/**\n * Returns the name of the block for handling unregistered blocks.\n *\n * @param {Object} state Data state.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const unregisteredFallbackBlockName = useSelect( ( select ) =>\n *         select( blocksStore ).getUnregisteredFallbackBlockName(),\n *         []\n *     );\n *\n *     return (\n *         unregisteredFallbackBlockName && (\n *             <p>\n *                 { sprintf( __(\n *                     'Unregistered fallback block name: %s' ),\n *                     unregisteredFallbackBlockName\n *                 ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return {?string} Name of the block for handling unregistered blocks.\n */\nexport function getUnregisteredFallbackBlockName( state ) {\n\treturn state.unregisteredFallbackBlockName;\n}\n\n/**\n * Returns the name of the block for handling the grouping of blocks.\n *\n * @param {Object} state Data state.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const groupingBlockName = useSelect( ( select ) =>\n *         select( blocksStore ).getGroupingBlockName(),\n *         []\n *     );\n *\n *     return (\n *         groupingBlockName && (\n *             <p>\n *                 { sprintf(\n *                     __( 'Default grouping block name: %s' ),\n *                     groupingBlockName\n *                 ) }\n *             </p>\n *         )\n *     );\n * };\n * ```\n *\n * @return {?string} Name of the block for handling the grouping of blocks.\n */\nexport function getGroupingBlockName( state ) {\n\treturn state.groupingBlockName;\n}\n\n/**\n * Returns an array with the child blocks of a given block.\n *\n * @param {Object} state     Data state.\n * @param {string} blockName Block type name.\n *\n * @example\n * ```js\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const childBlockNames = useSelect( ( select ) =>\n *         select( blocksStore ).getChildBlockNames( 'core/navigation' ),\n *         []\n *     );\n *\n *     return (\n *         <ul>\n *             { childBlockNames &&\n *                 childBlockNames.map( ( child ) => (\n *                     <li key={ child }>{ child }</li>\n *             ) ) }\n *         </ul>\n *     );\n * };\n * ```\n *\n * @return {Array} Array of child block names.\n */\nexport const getChildBlockNames = createSelector(\n\t( state, blockName ) => {\n\t\treturn getBlockTypes( state )\n\t\t\t.filter( ( blockType ) => {\n\t\t\t\treturn blockType.parent?.includes( blockName );\n\t\t\t} )\n\t\t\t.map( ( { name } ) => name );\n\t},\n\t( state ) => [ state.blockTypes ]\n);\n\n/**\n * Returns the block support value for a feature, if defined.\n *\n * @param {Object}          state           Data state.\n * @param {(string|Object)} nameOrType      Block name or type object\n * @param {Array|string}    feature         Feature to retrieve\n * @param {*}               defaultSupports Default value to return if not\n *                                          explicitly defined\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const paragraphBlockSupportValue = useSelect( ( select ) =>\n *         select( blocksStore ).getBlockSupport( 'core/paragraph', 'anchor' ),\n *         []\n *     );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __( 'core/paragraph supports.anchor value: %s' ),\n *                 paragraphBlockSupportValue\n *             ) }\n *         </p>\n *     );\n * };\n * ```\n *\n * @return {?*} Block support value\n */\nexport const getBlockSupport = (\n\tstate,\n\tnameOrType,\n\tfeature,\n\tdefaultSupports\n) => {\n\tconst blockType = getNormalizedBlockType( state, nameOrType );\n\tif ( ! blockType?.supports ) {\n\t\treturn defaultSupports;\n\t}\n\n\treturn getValueFromObjectPath(\n\t\tblockType.supports,\n\t\tfeature,\n\t\tdefaultSupports\n\t);\n};\n\n/**\n * Returns true if the block defines support for a feature, or false otherwise.\n *\n * @param {Object}          state           Data state.\n * @param {(string|Object)} nameOrType      Block name or type object.\n * @param {string}          feature         Feature to test.\n * @param {boolean}         defaultSupports Whether feature is supported by\n *                                          default if not explicitly defined.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const paragraphBlockSupportClassName = useSelect( ( select ) =>\n *         select( blocksStore ).hasBlockSupport( 'core/paragraph', 'className' ),\n *         []\n *     );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __( 'core/paragraph supports custom class name?: %s' ),\n *                 paragraphBlockSupportClassName\n *             ) }\n *         /p>\n *     );\n * };\n * ```\n *\n * @return {boolean} Whether block supports feature.\n */\nexport function hasBlockSupport( state, nameOrType, feature, defaultSupports ) {\n\treturn !! getBlockSupport( state, nameOrType, feature, defaultSupports );\n}\n\n/**\n * Normalizes a search term string: removes accents, converts to lowercase, removes extra whitespace.\n *\n * @param {string|null|undefined} term Search term to normalize.\n * @return {string} Normalized search term.\n */\nfunction getNormalizedSearchTerm( term ) {\n\treturn removeAccents( term ?? '' )\n\t\t.toLowerCase()\n\t\t.trim();\n}\n\n/**\n * Returns true if the block type by the given name or object value matches a\n * search term, or false otherwise.\n *\n * @param {Object}          state      Blocks state.\n * @param {(string|Object)} nameOrType Block name or type object.\n * @param {string}          searchTerm Search term by which to filter.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const termFound = useSelect(\n *         ( select ) =>\n *             select( blocksStore ).isMatchingSearchTerm(\n *                 'core/navigation',\n *                 'theme'\n *             ),\n *             []\n *         );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __(\n *                     'Search term was found in the title, keywords, category or description in block.json: %s'\n *                 ),\n *                 termFound\n *             ) }\n *         </p>\n *     );\n * };\n * ```\n *\n * @return {Object[]} Whether block type matches search term.\n */\nexport function isMatchingSearchTerm( state, nameOrType, searchTerm = '' ) {\n\tconst blockType = getNormalizedBlockType( state, nameOrType );\n\tconst normalizedSearchTerm = getNormalizedSearchTerm( searchTerm );\n\n\tconst isSearchMatch = ( candidate ) =>\n\t\tgetNormalizedSearchTerm( candidate ).includes( normalizedSearchTerm );\n\n\treturn (\n\t\tisSearchMatch( blockType.title ) ||\n\t\tblockType.keywords?.some( isSearchMatch ) ||\n\t\tisSearchMatch( blockType.category ) ||\n\t\t( typeof blockType.description === 'string' &&\n\t\t\tisSearchMatch( blockType.description ) )\n\t);\n}\n\n/**\n * Returns a boolean indicating if a block has child blocks or not.\n *\n * @param {Object} state     Data state.\n * @param {string} blockName Block type name.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const navigationBlockHasChildBlocks = useSelect( ( select ) =>\n *         select( blocksStore ).hasChildBlocks( 'core/navigation' ),\n *         []\n *     );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __( 'core/navigation has child blocks: %s' ),\n *                 navigationBlockHasChildBlocks\n *             ) }\n *         </p>\n *     );\n * };\n * ```\n *\n * @return {boolean} True if a block contains child blocks and false otherwise.\n */\nexport const hasChildBlocks = ( state, blockName ) => {\n\treturn getChildBlockNames( state, blockName ).length > 0;\n};\n\n/**\n * Returns a boolean indicating if a block has at least one child block with inserter support.\n *\n * @param {Object} state     Data state.\n * @param {string} blockName Block type name.\n *\n * @example\n * ```js\n * import { __, sprintf } from '@wordpress/i18n';\n * import { store as blocksStore } from '@wordpress/blocks';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n *     const navigationBlockHasChildBlocksWithInserterSupport = useSelect( ( select ) =>\n *         select( blocksStore ).hasChildBlocksWithInserterSupport(\n *             'core/navigation'\n *         ),\n *         []\n *     );\n *\n *     return (\n *         <p>\n *             { sprintf(\n *                 __( 'core/navigation has child blocks with inserter support: %s' ),\n *                 navigationBlockHasChildBlocksWithInserterSupport\n *             ) }\n *         </p>\n *     );\n * };\n * ```\n *\n * @return {boolean} True if a block contains at least one child blocks with inserter support\n *                   and false otherwise.\n */\nexport const hasChildBlocksWithInserterSupport = ( state, blockName ) => {\n\treturn getChildBlockNames( state, blockName ).some( ( childBlockName ) => {\n\t\treturn hasBlockSupport( state, childBlockName, 'inserter', true );\n\t} );\n};\n\nexport const __experimentalHasContentRoleAttribute = ( ...args ) => {\n\tdeprecated( '__experimentalHasContentRoleAttribute', {\n\t\tsince: '6.7',\n\t\tversion: '6.8',\n\t\thint: 'This is a private selector.',\n\t} );\n\treturn privateHasContentRoleAttribute( ...args );\n};\n"],
  "mappings": ";AAGA,OAAO,mBAAmB;AAK1B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,OAAO,gBAAgB;AAKvB,SAAS,wBAAwB,yBAAyB;AAC1D,SAAS,2BAA2B,sCAAsC;AAe1E,IAAM,yBAAyB,CAAE,OAAO,eACvC,aAAa,OAAO,aACjB,aAAc,OAAO,UAAW,IAChC;AA8BG,IAAM,gBAAgB;AAAA,EAC5B,CAAE,UAAW,OAAO,OAAQ,MAAM,UAAW;AAAA,EAC7C,CAAE,UAAW,CAAE,MAAM,UAAW;AACjC;AAuCO,SAAS,aAAc,OAAO,MAAO;AAC3C,SAAO,MAAM,WAAY,IAAK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