"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Edit=void 0;const components_1=require("@woocommerce/components"),navigation_1=require("@woocommerce/navigation"),tracks_1=require("@woocommerce/tracks"),block_editor_1=require("@wordpress/block-editor"),compose_1=require("@wordpress/compose"),core_data_1=require("@wordpress/core-data"),element_1=require("@wordpress/element"),i18n_1=require("@wordpress/i18n"),components_2=require("@wordpress/components"),use_currency_input_props_1=require("../../hooks/use-currency-input-props");function Edit({attributes:e}){const r=(0,block_editor_1.useBlockProps)(),{name:o,label:t,help:n}=e,[c,i]=(0,core_data_1.useEntityProp)("postType","product",o),s=(0,use_currency_input_props_1.useCurrencyInputProps)({value:c,onChange:i}),p=n?(0,element_1.createInterpolateElement)(n,{PricingTab:(0,element_1.createElement)(components_1.Link,{href:(0,navigation_1.getNewPath)({tab:"pricing"}),onClick:()=>{(0,tracks_1.recordEvent)("product_pricing_help_click")}})}):null,_=(0,compose_1.useInstanceId)(components_2.BaseControl,"wp-block-woocommerce-product-pricing-field");return(0,element_1.createElement)("div",{...r},(0,element_1.createElement)(components_2.BaseControl,{id:_,help:p},(0,element_1.createElement)(components_2.__experimentalInputControl,{...s,id:_,name:o,label:t||(0,i18n_1.__)("Price","woocommerce")})))}exports.Edit=Edit;