"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let _ of __getOwnPropNames(t))__hasOwnProp.call(e,_)||_===o||__defProp(e,_,{get:()=>t[_],enumerable:!(r=__getOwnPropDesc(t,_))||r.enumerable});return e},__toESM=(e,t,o)=>(o=null!=e?__create(__getProtoOf(e)):{},__copyProps(!t&&e&&e.__esModule?o:__defProp(o,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),edit_exports={};__export(edit_exports,{Edit:()=>Edit}),module.exports=__toCommonJS(edit_exports);var import_data=require("@wordpress/data"),import_deprecated=__toESM(require("@wordpress/deprecated")),import_element=require("@wordpress/element"),import_block_editor=require("@wordpress/block-editor"),import_block_templates=require("@woocommerce/block-templates"),import_components=require("@woocommerce/components"),import_core_data=require("@wordpress/core-data");function Edit({attributes:e,context:t}){(0,import_deprecated.default)("`woocommerce/conditional` block",{alternative:"`hideConditions` attribute on any block"});const{postType:o}=t,r=(0,import_block_templates.useWooBlockProps)(e),{mustMatch:_}=e,p=(0,import_core_data.useEntityId)("postType",o),c=(0,import_data.useSelect)(e=>{const t=e("core").getEditedEntityRecord("postType",o,p);for(const[e,o]of Object.entries(_))if(!o.includes(t[e]))return!1;return!0},[o,p,_]);return(0,import_element.createElement)(import_components.DisplayState,{...r,state:c?"visible":"visually-hidden"},(0,import_element.createElement)(import_block_editor.InnerBlocks,{templateLock:"all"}))}