"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[20],{30:function(a,e,t){var i=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.ProductCard=function({product:a,sharedStateStore:e,collectionHandle:t}){var i,p,f,g,v;const{getHexForOptionColor:x,findProductVariantWithOption:P,EXCLUDE_TAGS:_,product_image_height:V,product_image_width:j,disable_color_swatches:C}=e((a=>({getHexForOptionColor:a.getHexForOptionColor,findProductVariantWithOption:a.findProductVariantWithOption,EXCLUDE_TAGS:a.config.exclude_tags,product_image_width:a.config.product_image_width,product_image_height:a.config.product_image_height,disable_color_swatches:a.config.disable_color_swatches}))),b=a.options.find((a=>"Color"===a.name)),I=a.priceRange.minVariantPrice.amount,w=I!==(null===(i=a.priceRange.maxVariantPrice)||void 0===i?void 0:i.amount)?`From $${(0,s.formatPrice)(I)}`:`$${(0,s.formatPrice)(I)}`,O=(null===(p=a.compareAtPriceRange.maxVariantPrice)||void 0===p?void 0:p.amount)&&parseFloat(null===(f=a.compareAtPriceRange.maxVariantPrice)||void 0===f?void 0:f.amount)>parseFloat(I),A=a.compareAtPriceRange.maxVariantPrice&&Ie.variantId===a.defaultVariantId)),[R,S]=(0,l.useState)(null!=F?F:a.variants[0]),$=(0,c.getImagesForVariant)(a.imageMap,R,h.getAssignment)[0],H=(0,m.useProductUrl)(a,R.variantId===(null==F?void 0:F.variantId)?void 0:R);if(!$)return null;const W=_&&(null==_?void 0:_.length)>0?a.tags.find((a=>!(null==_?void 0:_.includes(a)))):null,{title:k,subtitle:y}=(0,u.splitTitle)(a.title);return(0,r.jsxs)("div",{class:n.default.box,children:[W&&(0,r.jsx)("div",{class:n.default.bestSeller,children:W}),(0,r.jsxs)("a",{href:H,class:n.default.link,"data-orly-type":t,"data-orly-handle":a.handle,children:[(0,r.jsx)("div",{className:n.default.heroImageContainer,children:(0,r.jsx)(o.LazyImage,{src:$.src,initialWidth:300,cssClass:n.default.heroImage,alt:`${a.title}: ${$.model}`,height:V,width:j})}),(0,r.jsxs)("div",{class:n.default.textWrapper,children:[(0,r.jsx)("div",{class:n.default.title,children:k}),y&&(0,r.jsx)("div",{class:n.default.subtitle,children:y}),(0,r.jsxs)("div",{class:n.default.price,children:[O&&(null===(g=a.compareAtPriceRange.maxVariantPrice)||void 0===g?void 0:g.amount)&&(0,r.jsxs)("span",{class:n.default.originalPrice,children:["$",(0,s.formatPrice)(null===(v=a.compareAtPriceRange.maxVariantPrice)||void 0===v?void 0:v.amount)]}),(0,r.jsx)("span",{class:A?n.default.salePrice:"",children:w})]})]})]}),(0,r.jsx)("div",{class:n.default.colorSwatchContainer,children:!C&&b&&(0,r.jsx)(d.ProductOption,{productHandle:a.handle,small:!0,maxItems:12,hideLabel:!0,option:b,getHexForOptionColor:x,selectedVariant:R,findProductVariantWithOption:e=>P(e,a,F),setSelectedVariantId:e=>{const t=a.variants.find((a=>a.variantId===e));t&&S(t)}})})]})};const r=t(0),n=(t(1),i(t(27))),l=t(3),o=t(4),d=t(18),c=t(42),s=t(19),u=t(9),h=t(2),m=t(33)}}]);