(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[232,442],{9553:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>b});var o=l(1616),a=l(1609),n=l(6087),s=l(7723),r=l(851),c=l(5703),i=l(2796),d=l(3249),u=l(7103),m=l(6809);l(5183);let g=function(e){return e.SINGLE="single",e.THUMBNAIL="thumbnail",e}({});const p=e=>(0,a.createElement)("img",{...e,src:c.PLACEHOLDER_IMG_SRC,alt:"",width:void 0,height:void 0}),y=({image:e,loaded:t,showFullSize:l,fallbackAlt:o,width:s,scale:r,height:c,aspectRatio:i})=>{const{thumbnail:d,src:u,srcset:m,sizes:g,alt:y}=e||{},f={alt:y||o,hidden:!t,src:d,...l&&{src:u,srcSet:m,sizes:g}},h={height:c,width:s,objectFit:r,aspectRatio:i};return(0,a.createElement)(n.Fragment,null,f.src&&(0,a.createElement)("img",{style:h,"data-testid":"product-image",...f}),!e&&(0,a.createElement)(p,{style:h}))},f=(0,o.withProductDataContext)((e=>{const{className:t,imageSizing:l=g.SINGLE,showProductLink:o=!0,showSaleBadge:c,saleBadgeAlign:f="right",height:h,width:b,scale:v,aspectRatio:k,...w}=e,S=(0,d.p)(e),{parentClassName:N}=(0,i.useInnerBlockLayoutContext)(),{product:E,isLoading:C}=(0,i.useProductDataContext)(),{dispatchStoreEvent:L}=(0,u.y)();if(!E.id)return(0,a.createElement)("div",{className:(0,r.A)(t,"wc-block-components-product-image",{[`${N}__product-image`]:N},S.className),style:S.style},(0,a.createElement)(p,null));const _=!!E.images.length,A=_?E.images[0]:null,x=o?"a":n.Fragment,B=(0,s.sprintf)(/* translators: %s is referring to the product name */ /* translators: %s is referring to the product name */
(0,s.__)("Link to %s","woocommerce"),E.name),F={href:E.permalink,...!_&&{"aria-label":B},onClick:()=>{L("product-view-link",{product:E})}};return delete w.style,(0,a.createElement)("div",{className:(0,r.A)(t,"wc-block-components-product-image",{[`${N}__product-image`]:N},S.className),style:S.style},(0,a.createElement)(x,{...o&&F},!!c&&(0,a.createElement)(m.default,{align:f,...w}),(0,a.createElement)(y,{fallbackAlt:E.name,image:A,loaded:!C,showFullSize:l!==g.THUMBNAIL,width:b,height:h,scale:v,aspectRatio:k})))})),h=JSON.parse('{"uK":{"showProductLink":{"type":"boolean","default":true},"showSaleBadge":{"type":"boolean","default":true},"saleBadgeAlign":{"type":"string","default":"right"},"imageSizing":{"type":"string","default":"single"},"productId":{"type":"number","default":0},"isDescendentOfQueryLoop":{"type":"boolean","default":false},"isDescendentOfSingleProductBlock":{"type":"boolean","default":false},"width":{"type":"string"},"height":{"type":"string"},"scale":{"type":"string","default":"cover"},"aspectRatio":{"type":"string"}}}'),b=(0,o.withFilteredAttributes)(h.uK)(f)},6809:(e,t,l)=>{"use strict";l.r(t),l.d(t,{Block:()=>d,default:()=>u});var o=l(1609),a=l(7723),n=l(851),s=l(4656),r=l(2796),c=l(3249),i=l(1616);l(6007);const d=e=>{const{className:t,align:l}=e,i=(0,c.p)(e),{parentClassName:d}=(0,r.useInnerBlockLayoutContext)(),{product:u}=(0,r.useProductDataContext)();if(!(u.id&&u.on_sale||e.isDescendentOfSingleProductTemplate))return null;const m="string"==typeof l?`wc-block-components-product-sale-badge--align-${l}`:"";return(0,o.createElement)("div",{className:(0,n.A)("wc-block-components-product-sale-badge",t,m,{[`${d}__product-onsale`]:d},i.className),style:i.style},(0,o.createElement)(s.Label,{label:(0,a.__)("Sale","woocommerce"),screenReaderLabel:(0,a.__)("Product on sale","woocommerce")}))},u=(0,i.withProductDataContext)(d)},3249:(e,t,l)=>{"use strict";l.d(t,{p:()=>i});var o=l(851),a=l(3993),n=l(1194),s=l(9786);function r(e={}){const t={};return(0,s.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function c(e,t){return e&&t?`has-${(0,n.c)(t)}-${e}`:""}const i=e=>{const t=(e=>{const t=(0,a.isObject)(e)?e:{style:{}};let l=t.style;return(0,a.isString)(l)&&(l=JSON.parse(l)||{}),(0,a.isObject)(l)||(l={}),{...t,style:l}})(e),l=function(e){var t,l,n,s,i,d,u;const{backgroundColor:m,textColor:g,gradient:p,style:y}=e,f=c("background-color",m),h=c("color",g),b=function(e){if(e)return`has-${e}-gradient-background`}(p),v=b||(null==y||null===(t=y.color)||void 0===t?void 0:t.gradient);return{className:(0,o.A)(h,b,{[f]:!v&&!!f,"has-text-color":g||(null==y||null===(l=y.color)||void 0===l?void 0:l.text),"has-background":m||(null==y||null===(n=y.color)||void 0===n?void 0:n.background)||p||(null==y||null===(s=y.color)||void 0===s?void 0:s.gradient),"has-link-color":(0,a.isObject)(null==y||null===(i=y.elements)||void 0===i?void 0:i.link)?null==y||null===(d=y.elements)||void 0===d||null===(u=d.link)||void 0===u?void 0:u.color:void 0}),style:r({color:(null==y?void 0:y.color)||{}})}}(t),n=function(e){var t;const l=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:function(e){var t;const{borderColor:l,style:a}=e,n=l?c("border-color",l):"";return(0,o.A)({"has-border-color":!!l||!(null==a||null===(t=a.border)||void 0===t||!t.color),[n]:!!n})}(e),style:r({border:l})}}(t),s=function(e){var t;return{className:void 0,style:r({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}(t),i=(e=>{const t=(0,a.isObject)(e.style.typography)?e.style.typography:{},l=(0,a.isString)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:l,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.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,o.A)(i.className,l.className,n.className,s.className),style:{...i.style,...l.style,...n.style,...s.style}}}},5183:()=>{},6007:()=>{}}]);