OwlCyberSecurity - MANAGER
Edit File: product-image.js
(globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[]).push([[4232,4442],{3104:(e,t,o)=>{"use strict";o.d(t,{A:()=>w});var s=o(6087),a=o(7723),r=o(4921),c=o(5703),i=o(415),n=o(371),l=o(1616),d=o(7052),u=o(8537),m=o(3993),p=o(3848),g=(o(1189),o(4264)),h=o(6724),y=o(790);const f=e=>(0,y.jsx)("img",{...e,src:c.PLACEHOLDER_IMG_SRC,alt:"",width:void 0,height:void 0}),b=({image:e,loaded:t,showFullSize:o,fallbackAlt:s,width:a,scale:r,height:c,aspectRatio:i})=>{const{thumbnail:n,src:l,srcset:d,sizes:u,alt:m}=e||{},p={alt:m||s,hidden:!t,src:n,...o&&{src:l,srcSet:d,sizes:u}},g={height:c,width:a,objectFit:r,aspectRatio:i};return(0,y.jsxs)(y.Fragment,{children:[p.src&&(0,y.jsx)("img",{style:g,"data-testid":"product-image",...p}),!e&&(0,y.jsx)(f,{style:g})]})},k=e=>{const{product:t}=e;return!(0,m.isEmpty)(t)&&(0,h.S)(e.showSaleBadge)},w=(0,l.withProductDataContext)((e=>{const{aspectRatio:t,children:o,className:c,height:l,imageId:h,imageSizing:w=g.e.SINGLE,scale:x,showProductLink:S=!0,style:_,width:v,...C}=e,N=(0,n.p)(e),{parentClassName:j}=(0,i.useInnerBlockLayoutContext)(),{product:A,isLoading:z}=(0,i.useProductDataContext)(),{dispatchStoreEvent:R}=(0,d.y)();if(!A?.id)return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:(0,r.A)(c,"wc-block-components-product-image",{[`${j}__product-image`]:j},N.className),style:N.style,children:(0,y.jsx)(f,{})}),o]});const B=((e,t)=>e.images.length?t&&e.images.find((e=>e.id===t))||e.images[0]:null)(A,h);B&&(B.alt=B.alt||(0,u.decodeEntities)(A.name));const L=S?"a":s.Fragment,P=A?.name? // translators: %s is the product name. // translators: %s is the product name. (0,a.sprintf)((0,a.__)("Link to %s","woocommerce"),A.name):"",D={href:S?A?.permalink:void 0,...S&&{"aria-label":P,onClick:()=>{R("product-view-link",{product:A})}}};return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:(0,r.A)(c,"wc-block-components-product-image",{[`${j}__product-image`]:j},N.className),style:N.style,children:[k(e)&&(0,y.jsx)(p.default,{align:e.saleBadgeAlign||"right",...C}),(0,y.jsx)(L,{...S&&D,children:(0,y.jsx)(b,{fallbackAlt:(0,u.decodeEntities)(A.name),image:B,loaded:!z,showFullSize:w!==g.e.THUMBNAIL,width:v,height:l,scale:x,aspectRatio:(0,m.objectHasProp)(_,"dimensions")&&(0,m.objectHasProp)(_.dimensions,"aspectRatio")&&(0,m.isString)(_.dimensions.aspectRatio)?_.dimensions.aspectRatio:t})})]}),o]})}))},933:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>c});var s=o(1616),a=o(3104),r=o(7746);const c=(0,s.withFilteredAttributes)(r.attributes)(a.A)},6724:(e,t,o)=>{"use strict";o.d(t,{S:()=>s});const s=e=>void 0===e||e},3848:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>d,default:()=>u});var s=o(7723),a=o(4921),r=o(4656),c=o(415),i=o(371),n=o(1616),l=(o(4313),o(790));const d=e=>{const{className:t,align:o,isDescendentOfSingleProductTemplate:n}=e,d=(0,i.p)(e),{parentClassName:u}=(0,c.useInnerBlockLayoutContext)(),{product:m}=(0,c.useProductDataContext)();if(!(m.id&&m.on_sale||n))return null;const p="string"==typeof o?`wc-block-components-product-sale-badge--align-${o}`:"";return(0,l.jsx)("div",{className:(0,a.A)("wc-block-components-product-sale-badge",t,p,{[`${u}__product-onsale`]:u},d.className),style:d.style,children:(0,l.jsx)(r.Label,{label:(0,s.__)("Sale","woocommerce"),screenReaderLabel:(0,s.__)("Product on sale","woocommerce")})})},u=(0,n.withProductDataContext)(d)},7052:(e,t,o)=>{"use strict";o.d(t,{y:()=>c});var s=o(2619),a=o(7143),r=o(6087);const c=()=>({dispatchStoreEvent:(0,r.useCallback)(((e,t={})=>{try{(0,s.doAction)(`experimental__woocommerce_blocks-${e}`,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:(0,r.useCallback)(((e,t={})=>{try{(0,s.doAction)(`experimental__woocommerce_blocks-checkout-${e}`,{...t,storeCart:(0,a.select)("wc/store/cart").getCartData()})}catch(e){console.error(e)}}),[])})},371:(e,t,o)=>{"use strict";o.d(t,{p:()=>i});var s=o(4921),a=o(3993),r=o(219),c=o(17);const i=e=>{const t=(e=>{const t=(0,a.isObject)(e)?e:{style:{}};let o=t.style;return(0,a.isString)(o)&&(o=JSON.parse(o)||{}),(0,a.isObject)(o)||(o={}),{...t,style:o}})(e),o=(0,c.BK)(t),i=(0,c.aR)(t),n=(0,c.fo)(t),l=(0,r.x)(t);return{className:(0,s.A)(l.className,o.className,i.className,n.className),style:{...l.style,...o.style,...i.style,...n.style}}}},219:(e,t,o)=>{"use strict";o.d(t,{x:()=>a});var s=o(3993);const a=e=>{const t=(0,s.isObject)(e.style.typography)?e.style.typography:{},o=(0,s.isString)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:o,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}}}},17:(e,t,o)=>{"use strict";o.d(t,{BK:()=>l,aR:()=>d,fo:()=>u});var s=o(4921),a=o(7356),r=o(9786),c=o(3993);function i(e={}){const t={};return(0,r.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function n(e,t){return e&&t?`has-${(0,a.c)(t)}-${e}`:""}function l(e){const{backgroundColor:t,textColor:o,gradient:a,style:r}=e,l=n("background-color",t),d=n("color",o),u=function(e){if(e)return`has-${e}-gradient-background`}(a),m=u||r?.color?.gradient;return{className:(0,s.A)(d,u,{[l]:!m&&!!l,"has-text-color":o||r?.color?.text,"has-background":t||r?.color?.background||a||r?.color?.gradient,"has-link-color":(0,c.isObject)(r?.elements?.link)?r?.elements?.link?.color:void 0}),style:i({color:r?.color||{}})}}function d(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:o}=e,a=t?n("border-color",t):"";return(0,s.A)({"has-border-color":!!t||!!o?.border?.color,[a]:!!a})}(e),style:i({border:t})}}function u(e){return{className:void 0,style:i({spacing:e.style?.spacing||{}})}}},1189:()=>{},4313:()=>{},7746:e=>{"use strict";e.exports=JSON.parse('{"name":"woocommerce/product-image","title":"Product Image","description":"Display the main product image.","category":"woocommerce-product-elements","attributes":{"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"}},"supports":{"interactivity":{"clientNavigation":true},"html":false,"__experimentalBorder":{"radius":true,"__experimentalSkipSerialization":true},"typography":{"fontSize":true,"__experimentalSkipSerialization":true},"spacing":{"margin":true,"padding":true},"dimensions":{"aspectRatio":true,"__experimentalSkipSerialization":true},"__experimentalSelector":".wc-block-components-product-image"},"ancestor":["woocommerce/all-products","woocommerce/single-product","woocommerce/product-template","core/post-template"],"usesContext":["imageId","postId","query","queryId"],"keywords":["WooCommerce"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}')}}]);