"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Edit=void 0;const classnames_1=__importDefault(require("classnames")),components_1=require("@wordpress/components"),core_data_1=require("@wordpress/core-data"),element_1=require("@wordpress/element"),i18n_1=require("@wordpress/i18n"),block_editor_1=require("@wordpress/block-editor"),sanitize_html_1=require("../../utils/sanitize-html"),empty_variations_image_1=require("./empty-variations-image");function hasAttributesUsedForVariations(e){return e.some((({variation:e})=>e))}function Edit({attributes:e}){const{description:t}=e,[r]=(0,core_data_1.useEntityProp)("postType","product","attributes"),o=hasAttributesUsedForVariations(r),i=(0,block_editor_1.useBlockProps)({className:(0,classnames_1.default)({"wp-block-woocommerce-product-variations-fields--has-attributes":o})}),a=(0,block_editor_1.useInnerBlocksProps)({className:"wp-block-woocommerce-product-variations-fields__content"},{templateLock:"all"});return(0,element_1.createElement)("div",{...i},(0,element_1.createElement)("div",{className:"wp-block-woocommerce-product-variations-fields__heading"},(0,element_1.createElement)("div",{className:"wp-block-woocommerce-product-variations-fields__heading-image-container"},(0,element_1.createElement)(empty_variations_image_1.EmptyVariationsImage,null)),(0,element_1.createElement)("p",{className:"wp-block-woocommerce-product-variations-fields__heading-description",dangerouslySetInnerHTML:(0,sanitize_html_1.sanitizeHTML)(t)}),(0,element_1.createElement)("div",{className:"wp-block-woocommerce-product-variations-fields__heading-actions"},(0,element_1.createElement)(components_1.Button,{variant:"primary","aria-disabled":"true"},(0,i18n_1.__)("Add variation options","woocommerce")))),(0,element_1.createElement)("div",{...a}))}exports.Edit=Edit;