OwlCyberSecurity - MANAGER
Edit File: single-product.js
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["single-product"]=function(e){function t(t){for(var r,a,s=t[0],i=t[1],l=t[2],d=0,p=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);p.length;)p.shift()();return n.push.apply(n,l||[]),o()}function o(){for(var e,t=0;t<n.length;t++){for(var o=n[t],r=!0,s=1;s<o.length;s++){var i=o[s];0!==c[i]&&(r=!1)}r&&(n.splice(t--,1),e=a(a.s=o[0]))}return e}var r={},c={39:0},n=[];function a(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,a),o.l=!0,o.exports}a.e=function(e){var t=[],o=c[e];if(0!==o)if(o)t.push(o[2]);else{var r=new Promise((function(t,r){o=c[e]=[t,r]}));t.push(o[2]=r);var n,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/button",3:"atomic-block-components/sale-badge",7:"atomic-block-components/add-to-cart",8:"atomic-block-components/button",9:"atomic-block-components/category-list",10:"atomic-block-components/image",11:"atomic-block-components/price",12:"atomic-block-components/rating",13:"atomic-block-components/sku",14:"atomic-block-components/stock-indicator",15:"atomic-block-components/summary",16:"atomic-block-components/tag-list",17:"atomic-block-components/title"}[e]||e)+".js?ver="+{1:"8e7f72ad74a970d045be",2:"7bf99e49a420eaae19bc",3:"1e8ef83cc8f9cf11930a",7:"bffb666ec86caa409288",8:"b3fc2cbb4f71da95ed55",9:"bb4a9315b8255156aa92",10:"cab119d54f90f1456438",11:"5c266369d5583591582a",12:"b6bcd0d478cdad5f8219",13:"4565df0d3a57b1c6e384",14:"a2a08a643c4e73034676",15:"0a827bfc775c099a9dbf",16:"5a78f0df5ea7029b3eef",17:"0ddca9eb4050a03fc3b3"}[e]}(e);var i=new Error;n=function(t){s.onerror=s.onload=null,clearTimeout(l);var o=c[e];if(0!==o){if(o){var r=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+n+")",i.name="ChunkLoadError",i.type=r,i.request=n,o[1](i)}c[e]=void 0}};var l=setTimeout((function(){n({type:"timeout",target:s})}),12e4);s.onerror=s.onload=n,document.head.appendChild(s)}return Promise.all(t)},a.m=e,a.c=r,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(o,r,function(t){return e[t]}.bind(null,r));return o},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var u=i;return n.push([842,0]),o()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.data},100:function(e,t,o){"use strict";var r=o(0),c=o(1),n=o(55),a=o(136),s=o(5),i=o.n(s),l=o(4),u=o(41);o(137),t.a=e=>{let{className:t,error:o,isLoading:s=!1,onRetry:d}=e;return Object(r.createElement)(l.Placeholder,{icon:Object(r.createElement)(n.a,{srcElement:a.a}),label:Object(c.__)("Sorry, an error occurred",'woocommerce'),className:i()("wc-block-api-error",t)},Object(r.createElement)(u.a,{error:o}),d&&Object(r.createElement)(r.Fragment,null,s?Object(r.createElement)(l.Spinner,null):Object(r.createElement)(l.Button,{isSecondary:!0,onClick:d},Object(c.__)("Retry",'woocommerce'))))}},103:function(e,t){e.exports=window.wp.autop},11:function(e,t){e.exports=window.wp.apiFetch},110:function(e,t,o){"use strict";o.d(t,"c",(function(){return n})),o.d(t,"d",(function(){return a})),o.d(t,"a",(function(){return s})),o.d(t,"b",(function(){return i}));var r=o(14),c=o(32);const n=(e,t)=>{if(c.n>2)return Object(r.registerBlockType)(e,t)},a=(e,t)=>{if(c.n>1)return Object(r.registerBlockType)(e,t)},s=()=>c.n>2,i=()=>c.n>1},115:function(e,t){},116:function(e,t){e.exports=window.wp.coreData},12:function(e,t){e.exports=window.wp.compose},120:function(e,t,o){"use strict";var r=o(7),c=o.n(r),n=o(0),a=o(40),s=o(4),i=o(5),l=o.n(i);t.a=e=>{let{className:t,item:o,isSelected:r,isLoading:i,onSelect:u,disabled:d,...p}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.c,c()({},p,{key:o.id,className:t,isSelected:r,item:o,onSelect:u,isSingle:!0,disabled:d})),r&&i&&Object(n.createElement)("div",{key:"loading",className:l()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(n.createElement)(s.Spinner,null)))}},125:function(e,t,o){"use strict";var r=o(0),c=o(1),n=o(55),a=o(161),s=o(3),i=o(9),l=o(36);t.a=e=>{const t=(Object(l.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(r.createElement)(i.InspectorControls,null,Object(r.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(r.createElement)("a",{href:`${s.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details",'woocommerce'),Object(r.createElement)(n.a,{srcElement:a.a,size:16}))),Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.",'woocommerce')))):null}},13:function(e,t){e.exports=window.wp.url},134:function(e,t){e.exports=window.wp.wordcount},135:function(e,t,o){"use strict";var r=o(7),c=o.n(r),n=o(0),a=o(1),s=o(6),i=(o(2),o(40)),l=o(12),u=Object(l.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,o=null==t;return Object(n.createElement)(e,c()({},this.props,{selected:o?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),d=o(273),p=o(16),m=o.n(p),b=o(31),g=o.n(b),w=o(34),h=o(35),O=Object(l.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),m()(this,"state",{error:null,loading:!1,variations:{}}),m()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:o}=this.state;if(t)return;const r=this.getExpandedProduct();if(!r||o[r])return;const c=e.find(e=>e.id===r);c.variations&&0!==c.variations.length?(this.setState({loading:!0}),Object(w.g)(r).then(e=>{const t=e.map(e=>({...e,parent:r}));this.setState({variations:{...this.state.variations,[r]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(h.a)(e);this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:o,showVariations:r}=this.props;r&&(!g()(e.selected,o)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){const{products:t}=this.props;return t.filter(t=>t.variations&&t.variations.find(t=>{let{id:o}=t;return o===e}))[0].id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:o}=this.props;if(!o)return null;let r=t&&t.length?t[0]:null;return r?this.prevSelectedItem=r:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(r=this.prevSelectedItem)),!e&&r?this.isProductId(r)?r:this.findParentProduct(r):null}render(){const{error:t,isLoading:o}=this.props,{error:r,loading:a,variations:s}=this.state;return Object(n.createElement)(e,c()({},this.props,{error:r||t,expandedProduct:this.getExpandedProduct(),isLoading:o,variations:s,variationsLoading:a}))}}return m()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),f=o(41),j=o(5),k=o.n(j),v=o(120);o(191);const E={list:Object(a.__)("Products",'woocommerce'),noItems:Object(a.__)("Your store doesn't have any products.",'woocommerce'),search:Object(a.__)("Search for a product to display",'woocommerce'),updated:Object(a.__)("Product search results updated.",'woocommerce')},_=e=>{let{expandedProduct:t,error:o,instanceId:r,isCompact:l,isLoading:u,onChange:d,onSearch:p,products:m,renderItem:b,selected:g,showVariations:w,variations:h,variationsLoading:O}=e;if(o)return Object(n.createElement)(f.a,{error:o});const j=[...m,...h&&h[t]?h[t]:[]];return Object(n.createElement)(i.b,{className:"woocommerce-products",list:j,isCompact:l,isLoading:u,isSingle:!0,selected:j.filter(e=>{let{id:t}=e;return g.includes(t)}),onChange:d,renderItem:b||(w?e=>{const{item:t,search:o,depth:l=0,isSelected:d,onSelect:p}=e,m=t.variations&&Array.isArray(t.variations)?t.variations.length:0,b=k()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+l,"has-count",{"is-searching":o.length>0,"is-skip-level":0===l&&0!==t.parent,"is-variable":m>0});if(!t.breadcrumbs.length)return Object(n.createElement)(v.a,c()({},e,{className:k()(b,{"is-selected":d}),isSelected:d,item:t,onSelect:()=>()=>{p(t)()},isLoading:u||O,countLabel:t.variations.length>0?Object(a.sprintf)( /* translators: %1$d is the number of variations of a product product. */ Object(a.__)("%1$d variations",'woocommerce'),t.variations.length):null,name:"products-"+r,"aria-label":Object(a.sprintf)( /* translators: %1$s is the product name, %2$d is the number of variations of that product. */ Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,'woocommerce'),t.name,t.variations.length)}));const g=Object(s.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(i.c,c()({},g,{className:b,name:"variations-"+r}))}:null),onSearch:p,messages:E,isHierarchical:!0})};_.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=u(Object(d.a)(O(Object(l.withInstanceId)(_))))},136:function(e,t,o){"use strict";var r=o(0),c=o(18);const n=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=n},137:function(e,t){},14:function(e,t){e.exports=window.wp.blocks},150:function(e,t,o){"use strict";var r=o(16),c=o.n(r),n=o(0),a=o(8),s=o(1),i=o(32),l=e=>{let{imageUrl:t=i.m+"/block-error.svg",header:o=Object(s.__)("Oops!",'woocommerce'),text:r=Object(s.__)("There was an error loading the content.",'woocommerce'),errorMessage:c,errorMessagePrefix:a=Object(s.__)("Error:",'woocommerce'),button:l}=e;return Object(n.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(n.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(n.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&Object(n.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},o),r&&Object(n.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),c&&Object(n.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},a?a+" ":"",c),l&&Object(n.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};o(244);class u extends a.Component{constructor(){super(...arguments),c()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(n.createElement)(n.Fragment,null,Object(n.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:o=!0,text:r,errorMessagePrefix:c,renderError:a,button:s}=this.props,{errorMessage:i,hasError:u}=this.state;return u?"function"==typeof a?a({errorMessage:i}):Object(n.createElement)(l,{errorMessage:o?i:null,header:e,imageUrl:t,text:r,errorMessagePrefix:c,button:s}):this.props.children}}t.a=u},161:function(e,t,o){"use strict";var r=o(0),c=o(18);const n=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(r.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(r.createElement)("g",{mask:"url(#external-mask)"},Object(r.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=n},18:function(e,t){e.exports=window.wp.primitives},19:function(e,t){e.exports=window.wc.wcBlocksData},191:function(e,t){},197:function(e,t){e.exports=window.wp.warning},20:function(e,t){e.exports=window.wp.htmlEntities},21:function(e,t){e.exports=window.moment},244:function(e,t){},273:function(e,t,o){"use strict";var r=o(7),c=o.n(r),n=o(0),a=o(32),s=o(34),i=o(165),l=o(35);t.a=e=>t=>{let{selected:o,...r}=t;const[u,d]=Object(n.useState)(!0),[p,m]=Object(n.useState)(null),[b,g]=Object(n.useState)([]),w=a.o.productCount>100,h=async e=>{const t=await Object(l.a)(e);m(t),d(!1)},O=Object(n.useRef)(o);Object(n.useEffect)(()=>{Object(s.h)({selected:O.current}).then(e=>{g(e),d(!1)}).catch(h)},[O]);const f=Object(i.a)(e=>{Object(s.h)({selected:o,search:e}).then(e=>{g(e),d(!1)}).catch(h)},400),j=Object(n.useCallback)(e=>{d(!0),f(e)},[d,f]);return Object(n.createElement)(e,c()({},r,{selected:o,error:p,products:b,isLoading:u,onSearch:w?j:null}))}},3:function(e,t){e.exports=window.wc.wcSettings},30:function(e,t){e.exports=window.wp.dataControls},31:function(e,t){e.exports=window.wp.isShallowEqual},32:function(e,t,o){"use strict";o.d(t,"o",(function(){return n})),o.d(t,"m",(function(){return a})),o.d(t,"l",(function(){return s})),o.d(t,"n",(function(){return i})),o.d(t,"j",(function(){return l})),o.d(t,"e",(function(){return u})),o.d(t,"f",(function(){return d})),o.d(t,"g",(function(){return p})),o.d(t,"k",(function(){return m})),o.d(t,"c",(function(){return b})),o.d(t,"d",(function(){return g})),o.d(t,"h",(function(){return w})),o.d(t,"a",(function(){return h})),o.d(t,"i",(function(){return O})),o.d(t,"b",(function(){return f}));var r,c=o(3);const n=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",i=n.buildPhase,l=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=c.STORE_PAGES.checkout.id,d=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,m=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),b=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),g=c.STORE_PAGES.cart.permalink,w=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),h=Object(c.getSetting)("allowedCountries",{}),O=Object(c.getSetting)("shippingStates",{}),f=Object(c.getSetting)("allowedStates",{})},34:function(e,t,o){"use strict";o.d(t,"h",(function(){return l})),o.d(t,"e",(function(){return u})),o.d(t,"b",(function(){return d})),o.d(t,"i",(function(){return p})),o.d(t,"f",(function(){return m})),o.d(t,"c",(function(){return b})),o.d(t,"d",(function(){return g})),o.d(t,"g",(function(){return w})),o.d(t,"a",(function(){return h}));var r=o(13),c=o(11),n=o.n(c),a=o(6),s=o(3),i=o(32);const l=e=>{let{selected:t=[],search:o="",queryArgs:c={}}=e;const s=(e=>{let{selected:t=[],search:o="",queryArgs:c={}}=e;const n=i.o.productCount>100,a={per_page:n?100:0,catalog_visibility:"any",search:o,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/products",{...a,...c})];return n&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:o,queryArgs:c});return Promise.all(s.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/products/"+e}),d=()=>n()({path:"wc/store/products/attributes"}),p=e=>n()({path:`wc/store/products/attributes/${e}/terms`}),m=e=>{let{selected:t=[],search:o}=e;const c=(e=>{let{selected:t=[],search:o}=e;const c=Object(s.getSetting)("limitTags",!1),n=[Object(r.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:o})];return c&&t.length&&n.push(Object(r.addQueryArgs)("wc/store/products/tags",{include:t})),n})({selected:t,search:o});return Promise.all(c.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},b=e=>n()({path:Object(r.addQueryArgs)("wc/store/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/products/categories/"+e}),w=e=>n()({path:Object(r.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})}),h=(e,t)=>{if(!e.title.raw)return e.slug;const o=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(o?"":" - "+e.slug)}},35:function(e,t,o){"use strict";o.d(t,"a",(function(){return c})),o.d(t,"b",(function(){return n}));var r=o(1);const c=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},n=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(r.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},36:function(e,t){e.exports=window.wc.wcBlocksSharedContext},38:function(e,t){e.exports=window.wp.keycodes},39:function(e,t){e.exports=window.wp.escapeHtml},4:function(e,t){e.exports=window.wp.components},41:function(e,t,o){"use strict";var r=o(0),c=o(1),n=o(39);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:o}=e;return t?"general"===o?Object(r.createElement)("span",null,Object(c.__)("The following error was returned",'woocommerce'),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===o?Object(r.createElement)("span",null,Object(c.__)("The following error was returned from the API",'woocommerce'),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(c.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')})(t))}},44:function(e,t){e.exports=window.wc.priceFormat},45:function(e,t){e.exports=window.wp.hooks},47:function(e,t){e.exports=window.wc.wcBlocksRegistry},476:function(e,t,o){"use strict";var r=o(7),c=o.n(r),n=o(16),a=o.n(n),s=o(0),i=o(12),l=o(34),u=o(35);const d=Object(i.createHigherOrderComponent)(e=>class extends s.Component{constructor(){super(...arguments),a()(this,"state",{error:null,loading:!1,product:"preview"===this.props.attributes.productId?this.props.attributes.previewProduct:null}),a()(this,"loadProduct",()=>{const{productId:e}=this.props.attributes;"preview"!==e&&(e?(this.setState({loading:!0}),Object(l.e)(e).then(e=>{this.setState({product:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(u.a)(e);this.setState({product:null,loading:!1,error:t})})):this.setState({product:null,loading:!1,error:null}))})}componentDidMount(){this.loadProduct()}componentDidUpdate(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}render(){const{error:t,loading:o,product:r}=this.state;return Object(s.createElement)(e,c()({},this.props,{error:t,getProduct:this.loadProduct,isLoading:o,product:r}))}},"withProduct");t.a=d},51:function(e,t){e.exports=window.wp.deprecated},55:function(e,t,o){"use strict";var r=o(0);t.a=function(e){let{srcElement:t,size:o=24,...c}=e;return Object(r.isValidElement)(t)?Object(r.cloneElement)(t,{width:o,height:o,...c}):null}},6:function(e,t){e.exports=window.lodash},61:function(e,t){e.exports=window.wp.dom},62:function(e,t){e.exports=window.wp.a11y},64:function(e,t){e.exports=window.regeneratorRuntime},78:function(e,t){e.exports=window.wc.wcBlocksSharedHocs},79:function(e,t){e.exports=window.ReactDOM},8:function(e,t){e.exports=window.React},82:function(e,t){e.exports=window.wp.viewport},842:function(e,t,o){e.exports=o(849)},843:function(e,t){},849:function(e,t,o){"use strict";o.r(t);var r=o(1),c=o(110),n=o(0),a=o(4),s=o(476),i=o(150),l=o(125);const u=Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 230 100"},Object(n.createElement)("path",{fill:"#E1E3E6",d:"M76 0h11v6H76zm0 11h88v11H76zm0 16h28v6H76zm0 17h154v28H76zm0 39h22v17H76zm28 0h44v17h-44zM0 0h66v66H0z",style:{width:"100%"}}));var d=o(9),p=(o(843),o(100)),m=e=>{let{error:t,isLoading:o,getProduct:r}=e;return Object(n.createElement)(p.a,{className:"wc-block-single-product-error",error:t,isLoading:o,onRetry:r})},b=o(135),g=e=>{let{attributes:t,setAttributes:o}=e;return Object(n.createElement)(b.a,{selected:t.productId||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e[0]?e[0].id:0;o({productId:t})}})},w=e=>{let{isEditing:t,setIsEditing:o}=e;return Object(n.createElement)(d.BlockControls,null,Object(n.createElement)(a.ToolbarGroup,{controls:[{icon:"edit",title:Object(r.__)("Edit selected product",'woocommerce'),onClick:()=>o(!t),isActive:t}]}))},h=o(10),O=o(36),f=o(14);const j=e=>e.map(e=>{let[t,o={},r=[]]=e;const c=r?j(r):[];return Object(f.createBlock)(t,o,c)});var k=o(55),v=o(18),E=Object(n.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M14 12c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm-2-9c-5 0-9 4-9 9H0l4 4 4-4H5a7 7 0 113 5.7l-1.5 1.4A9 9 0 1012 3z"})),_=Object(n.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21 4H3a2 2 0 00-2 2v13c0 1.1.9 2 2 2h18a2 2 0 002-2V6a2 2 0 00-2-2zM3 19V6h8v13H3zm18 0h-8V6h8v13zm-7-9.5h6V11h-6zm0 2.5h6v1.5h-6zm0 2.5h6V16h-6z"})),y=o(875);const S="woocommerce/single-product",x=Object(r.__)("Single Product",'woocommerce'),P=Object(n.createElement)(k.a,{srcElement:_}),C=Object(r.__)("Display a single product.",'woocommerce'),B=[["core/columns",{},[["core/column",{},[["woocommerce/product-image",{showSaleBadge:!1}]]],["core/column",{},[["woocommerce/product-sale-badge"],["woocommerce/product-title",{headingLevel:2}],["woocommerce/product-rating"],["woocommerce/product-price"],["woocommerce/product-summary"],["woocommerce/product-stock-indicator"],["woocommerce/product-add-to-cart",{showFormElements:!0}],["woocommerce/product-sku"],["woocommerce/product-category-list"],["woocommerce/product-tag-list"]]]]]],N=["core/columns","core/column",...Object.keys(Object(y.a)(S))];var I=e=>{let{isLoading:t,product:o,clientId:c}=e;const{replaceInnerBlocks:s}=Object(h.useDispatch)("core/block-editor"),i=Object(n.useCallback)(()=>{s(c,j(B),!1)},[c,s]);return Object(n.createElement)(O.InnerBlockLayoutContextProvider,{parentName:S,parentClassName:"wc-block-single-product wc-block-layout"},Object(n.createElement)(O.ProductDataContextProvider,{product:o,isLoading:t},Object(n.createElement)(d.InspectorControls,null,Object(n.createElement)(a.PanelBody,{title:Object(r.__)("Layout",'woocommerce'),initialOpen:!0},Object(n.createElement)(a.Button,{label:Object(r.__)("Reset layout to default",'woocommerce'),onClick:i,isTertiary:!0,className:"wc-block-single-product__reset-layout"},Object(n.createElement)(k.a,{srcElement:E})," ",Object(r.__)("Reset layout",'woocommerce')))),Object(n.createElement)("div",{className:"wc-block-single-product wc-block-layout"},Object(n.createElement)(d.InnerBlocks,{template:B,allowedBlocks:N,templateLock:!1,renderAppender:!1}))))},z=Object(s.a)(e=>{let{className:t,attributes:o,setAttributes:c,error:s,getProduct:p,product:b,isLoading:h,clientId:O}=e;const{productId:f,isPreview:j}=o,[k,v]=Object(n.useState)(!f);return j?u:s?Object(n.createElement)(m,{error:s,isLoading:h,getProduct:p}):Object(n.createElement)("div",{className:t},Object(n.createElement)(i.a,{header:Object(r.__)("Single Product Block Error",'woocommerce')},Object(n.createElement)(w,{setIsEditing:v,isEditing:k}),k?Object(n.createElement)(a.Placeholder,{icon:P,label:x,className:"wc-block-single-product"},C,Object(n.createElement)("div",{className:"wc-block-single-product__selection"},Object(n.createElement)(g,{attributes:o,setAttributes:c}),Object(n.createElement)(a.Button,{isSecondary:!0,onClick:()=>{v(!1)}},Object(r.__)("Done",'woocommerce')))):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(d.InspectorControls,null,Object(n.createElement)(a.PanelBody,{title:Object(r.__)("Product",'woocommerce'),initialOpen:!1},Object(n.createElement)(g,{attributes:o,setAttributes:c}))),Object(n.createElement)(l.a,{productId:f}),Object(n.createElement)(I,{clientId:O,product:b,isLoading:h}))))}),A=o(5),L=o.n(A);const M={title:x,icon:{src:P,foreground:"#7f54b3"},category:"woocommerce",keywords:[Object(r.__)("WooCommerce",'woocommerce')],description:C,supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{isPreview:{type:"boolean",default:!1,save:!1},productId:{type:"number"}},edit:z,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",{className:L()("is-loading",t.className)},Object(n.createElement)(d.InnerBlocks.Content,null))}};Object(c.c)(S,M)},875:function(e,t,o){"use strict";o.d(t,"a",(function(){return a}));var r=o(47),c=o(0),n=o(32);o.p=n.l,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)(()=>Promise.all([o.e(0),o.e(11)]).then(o.bind(null,477)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)(()=>Promise.all([o.e(1),o.e(3),o.e(10)]).then(o.bind(null,901)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)(()=>Promise.all([o.e(1),o.e(17)]).then(o.bind(null,902)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)(()=>o.e(12).then(o.bind(null,478)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)(()=>Promise.all([o.e(0),o.e(1),o.e(2),o.e(8)]).then(o.bind(null,479)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)(()=>o.e(15).then(o.bind(null,481)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)(()=>o.e(3).then(o.bind(null,274)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)(()=>o.e(13).then(o.bind(null,482)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)(()=>o.e(9).then(o.bind(null,483)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)(()=>o.e(16).then(o.bind(null,484)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)(()=>o.e(14).then(o.bind(null,485)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)(()=>Promise.all([o.e(0),o.e(1),o.e(2),o.e(7)]).then(o.bind(null,903)))});const a=e=>Object(r.getRegisteredBlockComponents)(e)},89:function(e,t){e.exports=window.wp.date},9:function(e,t){e.exports=window.wp.blockEditor}});