(()=>{"use strict";var e={d:(t,o)=>{for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{isExternalProduct:()=>u,isProductResponseItem:()=>l,useProduct:()=>p});const o=window.wc.wcSettings,i=()=>(0,o.getSetting)("experimentalWcRestApiV4",!1),r=window.wp.coreData,n=window.wp.data,s=window.wp.i18n,d={name:"product",kind:"root",baseURL:i()?"/wc/v4/products":"/wc/v3/products",label:(0,s.__)("Product","woocommerce"),plural:(0,s.__)("Products","woocommerce"),key:"id",supportsPagination:!0,getTitle:e=>e.name},c={name:"settings",kind:"root",baseURL:"/wc/v4/settings",label:(0,s.__)("Settings","woocommerce"),getTitle:e=>{const t=e;return t?.id.charAt(0).toUpperCase()+t?.id.slice(1)+" settings"},key:"id",supportsPagination:!1,plural:(0,s.__)("Settings","woocommerce")},a=[],p=e=>(0,n.useSelect)(t=>{if(!e)return{product:void 0,isResolving:!1};const o="string"==typeof e?parseInt(e,10):e;return{product:t(r.store).getEditedEntityRecord("root","product",o),isResolving:t(r.store).isResolving("getEditedEntityRecord",["root","product",o]),isResolutionFinished:t(r.store).hasFinishedResolution("getEditedEntityRecord",["root","product",o])}},[e]),u=e=>"type"in e&&"external"===e.type,l=e=>!!e&&"id"in e&&0!==e.id;(()=>{if(a.includes(d.name))return;const{addEntities:e}=(0,n.dispatch)(r.store);e([d]),a.push(d.name)})(),i()&&(()=>{if(a.includes(c.name))return;const{addEntities:e}=(0,n.dispatch)(r.store);e([c]),a.push(c.name)})(),(this.wc=this.wc||{}).wcEntities=t})();