(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[442],{3905:(e,o,t)=>{"use strict";t.r(o),t.d(o,{Block:()=>u,default:()=>d});var l=t(1609),n=t(7723),r=t(851),s=t(4656),c=t(2796),a=t(4487),i=t(1616);t(6007);const u=e=>{const{className:o,align:t}=e,i=(0,a.p)(e),{parentClassName:u}=(0,c.useInnerBlockLayoutContext)(),{product:d}=(0,c.useProductDataContext)();if(!(d.id&&d.on_sale||e.isDescendentOfSingleProductTemplate))return null;const y="string"==typeof t?`wc-block-components-product-sale-badge--align-${t}`:"";return(0,l.createElement)("div",{className:(0,r.A)("wc-block-components-product-sale-badge",o,y,{[`${u}__product-onsale`]:u},i.className),style:i.style},(0,l.createElement)(s.Label,{label:(0,n.__)("Sale","woocommerce"),screenReaderLabel:(0,n.__)("Product on sale","woocommerce")}))},d=(0,i.withProductDataContext)(u)},4487:(e,o,t)=>{"use strict";t.d(o,{p:()=>i});var l=t(851),n=t(3993),r=t(1194),s=t(9786);function c(e={}){const o={};return(0,s.getCSSRules)(e,{selector:""}).forEach((e=>{o[e.key]=e.value})),o}function a(e,o){return e&&o?`has-${(0,r.c)(o)}-${e}`:""}const i=e=>{const o=(e=>{const o=(0,n.isObject)(e)?e:{style:{}};let t=o.style;return(0,n.isString)(t)&&(t=JSON.parse(t)||{}),(0,n.isObject)(t)||(t={}),{...o,style:t}})(e),t=function(e){var o,t,r,s,i,u,d;const{backgroundColor:y,textColor:f,gradient:m,style:v}=e,p=a("background-color",y),g=a("color",f),b=function(e){if(e)return`has-${e}-gradient-background`}(m),k=b||(null==v||null===(o=v.color)||void 0===o?void 0:o.gradient);return{className:(0,l.A)(g,b,{[p]:!k&&!!p,"has-text-color":f||(null==v||null===(t=v.color)||void 0===t?void 0:t.text),"has-background":y||(null==v||null===(r=v.color)||void 0===r?void 0:r.background)||m||(null==v||null===(s=v.color)||void 0===s?void 0:s.gradient),"has-link-color":(0,n.isObject)(null==v||null===(i=v.elements)||void 0===i?void 0:i.link)?null==v||null===(u=v.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:c({color:(null==v?void 0:v.color)||{}})}}(o),r=function(e){var o;const t=(null===(o=e.style)||void 0===o?void 0:o.border)||{};return{className:function(e){var o;const{borderColor:t,style:n}=e,r=t?a("border-color",t):"";return(0,l.A)({"has-border-color":!!t||!(null==n||null===(o=n.border)||void 0===o||!o.color),[r]:!!r})}(e),style:c({border:t})}}(o),s=function(e){var o;return{className:void 0,style:c({spacing:(null===(o=e.style)||void 0===o?void 0:o.spacing)||{}})}}(o),i=(e=>{const o=(0,n.isObject)(e.style.typography)?e.style.typography:{},t=(0,n.isString)(o.fontFamily)?o.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:t,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,textDecoration:o.textDecoration,textTransform:o.textTransform}}})(o);return{className:(0,l.A)(i.className,t.className,r.className,s.className),style:{...i.style,...t.style,...r.style,...s.style}}}},6007:()=>{}}]);