"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SectionBlockEdit=void 0;const classnames_1=__importDefault(require("classnames")),element_1=require("@wordpress/element"),i18n_1=require("@wordpress/i18n"),block_templates_1=require("@woocommerce/block-templates"),components_1=require("@woocommerce/components"),block_editor_1=require("@wordpress/block-editor"),block_slot_fill_1=require("../../../components/block-slot-fill"),sanitize_html_1=require("../../../utils/sanitize-html");function SectionBlockEdit({attributes:e}){const{description:t,title:o,blockGap:c}=e,l=(0,block_templates_1.useWooBlockProps)(e),n=(0,block_editor_1.useInnerBlocksProps)({className:(0,classnames_1.default)("wp-block-woocommerce-product-section__content",`wp-block-woocommerce-product-section__content--block-gap-${c}`)},{templateLock:"all"}),i=o?"fieldset":"div",r="fieldset"===i?"legend":"div";return(0,element_1.createElement)(i,{...l},o&&(0,element_1.createElement)(r,{className:"wp-block-woocommerce-product-section__heading"},(0,element_1.createElement)("div",{className:"wp-block-woocommerce-product-section__heading-title-wrapper"},(0,element_1.createElement)("h2",{className:"wp-block-woocommerce-product-section__heading-title"},o,t&&(0,element_1.createElement)(components_1.__experimentalTooltip,{className:"wp-block-woocommerce-product-section__heading-tooltip",text:(0,element_1.createElement)("p",{className:"wp-block-woocommerce-product-section__heading-description",dangerouslySetInnerHTML:(0,sanitize_html_1.sanitizeHTML)(t)}),position:"bottom center",helperText:(0,i18n_1.__)("View helper text","woocommerce")})),(0,element_1.createElement)("div",{className:"wp-block-woocommerce-product-section__actions"},(0,element_1.createElement)(block_slot_fill_1.BlockSlot,{name:"section-actions"}))),(0,element_1.createElement)(block_slot_fill_1.BlockSlot,{name:"section-description"})),(0,element_1.createElement)("div",{...n}))}exports.SectionBlockEdit=SectionBlockEdit;