(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[345],{2686:(o,t,e)=>{"use strict";e.r(t),e.d(t,{Block:()=>a,default:()=>u});var n=e(1609),c=e(7723),l=e(851),s=e(2796),r=e(3249),i=e(1616);e(9644);const a=o=>{const{className:t}=o,e=(0,r.p)(o),{parentClassName:i}=(0,s.useInnerBlockLayoutContext)(),{product:a}=(0,s.useProductDataContext)();if(!a.id)return null;const u=!!a.is_in_stock,d=a.low_stock_remaining,k=a.is_on_backorder;return(0,n.createElement)("div",{className:(0,l.A)(t,{[`${i}__stock-indicator`]:i,"wc-block-components-product-stock-indicator--in-stock":u,"wc-block-components-product-stock-indicator--out-of-stock":!u,"wc-block-components-product-stock-indicator--low-stock":!!d,"wc-block-components-product-stock-indicator--available-on-backorder":!!k,...o.isDescendantOfAllProducts&&{[e.className]:e.className,"wc-block-components-product-stock-indicator wp-block-woocommerce-product-stock-indicator":!0}}),...o.isDescendantOfAllProducts&&{style:e.style}},(({isInStock:o=!1,isLowStock:t=!1,lowStockAmount:e=null,isOnBackorder:n=!1})=>t&&null!==e?(0,c.sprintf)(/* translators: %d stock amount (number of items in stock for product) */ /* translators: %d stock amount (number of items in stock for product) */
(0,c.__)("%d left in stock","woocommerce"),e):n?(0,c.__)("Available on backorder","woocommerce"):o?(0,c.__)("In stock","woocommerce"):(0,c.__)("Out of stock","woocommerce"))({isInStock:u,isLowStock:!!d,lowStockAmount:d,isOnBackorder:k}))},u=(0,i.withProductDataContext)(a)},3249:(o,t,e)=>{"use strict";e.d(t,{p:()=>a});var n=e(851),c=e(3993),l=e(1194),s=e(9786);function r(o={}){const t={};return(0,s.getCSSRules)(o,{selector:""}).forEach((o=>{t[o.key]=o.value})),t}function i(o,t){return o&&t?`has-${(0,l.c)(t)}-${o}`:""}const a=o=>{const t=(o=>{const t=(0,c.isObject)(o)?o:{style:{}};let e=t.style;return(0,c.isString)(e)&&(e=JSON.parse(e)||{}),(0,c.isObject)(e)||(e={}),{...t,style:e}})(o),e=function(o){var t,e,l,s,a,u,d;const{backgroundColor:k,textColor:m,gradient:f,style:p}=o,y=i("background-color",k),v=i("color",m),b=function(o){if(o)return`has-${o}-gradient-background`}(f),g=b||(null==p||null===(t=p.color)||void 0===t?void 0:t.gradient);return{className:(0,n.A)(v,b,{[y]:!g&&!!y,"has-text-color":m||(null==p||null===(e=p.color)||void 0===e?void 0:e.text),"has-background":k||(null==p||null===(l=p.color)||void 0===l?void 0:l.background)||f||(null==p||null===(s=p.color)||void 0===s?void 0:s.gradient),"has-link-color":(0,c.isObject)(null==p||null===(a=p.elements)||void 0===a?void 0:a.link)?null==p||null===(u=p.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:r({color:(null==p?void 0:p.color)||{}})}}(t),l=function(o){var t;const e=(null===(t=o.style)||void 0===t?void 0:t.border)||{};return{className:function(o){var t;const{borderColor:e,style:c}=o,l=e?i("border-color",e):"";return(0,n.A)({"has-border-color":!!e||!(null==c||null===(t=c.border)||void 0===t||!t.color),[l]:!!l})}(o),style:r({border:e})}}(t),s=function(o){var t;return{className:void 0,style:r({spacing:(null===(t=o.style)||void 0===t?void 0:t.spacing)||{}})}}(t),a=(o=>{const t=(0,c.isObject)(o.style.typography)?o.style.typography:{},e=(0,c.isString)(t.fontFamily)?t.fontFamily:"";return{className:o.fontFamily?`has-${o.fontFamily}-font-family`:e,style:{fontSize:o.fontSize?`var(--wp--preset--font-size--${o.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:(0,n.A)(a.className,e.className,l.className,s.className),style:{...a.style,...e.style,...l.style,...s.style}}}},9644:()=>{}}]);