"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[7387],{83010:(t,e,r)=>{r.r(e),r.d(e,{default:()=>a});var c=r(69307),n=r(51393),o=r(9818),u=r(55609),p=r(85597);const d=t=>{let{product:e}=t;return null!=e&&e.id?(0,c.createElement)(n.__experimentalEditor,{product:e,settings:productBlockEditorSettings||{}}):(0,c.createElement)(u.Spinner,null)},s=t=>{let{productId:e}=t;const{product:r}=(0,o.useSelect)((t=>{const{getEntityRecord:r}=t("core");return{product:r("postType","product",e)}}),[e]);return(0,c.createElement)(d,{product:r})},l=()=>{const{saveEntityRecord:t}=(0,o.useDispatch)("core"),[e,r]=(0,c.useState)(void 0);return(0,c.useEffect)((()=>{t("postType","product",{title:n.AUTO_DRAFT_NAME,status:"auto-draft"}).then((t=>{r(t)}))}),[]),(0,c.createElement)(d,{product:e})};function a(){const{productId:t}=(0,p.UO)();return t?(0,c.createElement)(s,{productId:Number.parseInt(t,10)}):(0,c.createElement)(l,null)}}}]);