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