"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[15],{63:(e,r,a)=>{a.d(r,{a:()=>_});var t=a(0),i=a(22),n=a(2),o=a(5),l=a(101),c=a(3),s=a(38),d=a(28),p=a(25),u=a(35),m=a(4),h=a(36),v=a(6);function x({disruptor:e}){var r;return(0,t.jsxs)("div",{class:h.a.card,style:{color:e.text_color},children:[(0,t.jsx)(g,{media:e.media}),(0,t.jsx)("div",{class:h.a.title,dangerouslySetInnerHTML:{__html:e.title}}),(0,t.jsx)("div",{class:h.a.body,dangerouslySetInnerHTML:{__html:null!==(r=e.body_text)&&void 0!==r?r:""}}),(0,t.jsx)(f,{disruptor:e})]})}function g({media:e}){var r;const a=null===(r=(0,v.a)(e))||void 0===r?void 0:r.url;if(a){const e={"background-image":`url(${a});`};return(0,t.jsx)("div",{class:h.a.media,style:e})}return"video"===e.type&&e.sources.length>0?(0,t.jsx)("div",{class:h.a.media,children:(0,t.jsx)("video",{loop:!0,autoplay:!0,playsinline:!0,muted:!0,children:e.sources.map((e=>(0,t.jsx)("source",{src:e.url,type:e.mimeType})))})}):(0,t.jsx)(m.Fragment,{})}function f({disruptor:e}){var r;return e.cta_url?(0,t.jsx)("a",{href:e.cta_url,children:null!==(r=e.cta_label)&&void 0!==r?r:"Shop Now"}):(0,t.jsx)(m.Fragment,{})}var b=a(105),P=a(106),S=a(49),j=a(24);function _({product:e,collectionHandle:r,replaceStateEnabled:a}){return(null==e?void 0:e.handle)?"type"in(i=e)&&"disruptor"===i.type?(0,t.jsx)(x,{disruptor:e}):(0,t.jsx)(A,{product:e,collectionHandle:r,replaceStateEnabled:a}):null;var i}function A({product:e,collectionHandle:r,replaceStateEnabled:a}){const{getHexForOptionColor:m,findProductVariantWithOption:h,EXCLUDE_TAGS:v,promo_prefix_tag:x,product_image_height:g,product_image_width:f,disable_color_swatches:_,showVendor:A}=(0,c.c)((e=>({getHexForOptionColor:e.getHexForOptionColor,findProductVariantWithOption:e.findProductVariantWithOption,EXCLUDE_TAGS:e.config.exclude_tags,promo_prefix_tag:e.config.promo_prefix_tag,product_image_width:e.config.product_image_width,product_image_height:e.config.product_image_height,disable_color_swatches:e.config.disable_color_swatches,showVendor:e.showVendor}))),w=e.options.find((e=>"Color"===e.name)),y=e.variants.find((r=>r.variantId===e.defaultVariantId)),[C,N]=(0,n.useState)(null!=y?y:e.variants[0]),{pricePrefix:I,priceText:T,showCompareAtPrice:O,onSaleDataAttribute:V,compareAtPriceRange:F,priceClassName:H,ssrStyle:R}=function(e){const r=(0,n.useMemo)((()=>e.combinedKey?[e.handle,...new Set(e.variants.map((e=>{var r;return null===(r=e.selectedOptions)||void 0===r?void 0:r.childProductHandle})).filter((e=>!!e)))]:[e.handle]),[e.handle,e.combinedKey,e.variants]),{data:a,classNamesByHandle:t,ssrStylesByHandle:i}=(0,c.d)(r);return(0,n.useMemo)((()=>{if(e.priceTextOverride)return{priceText:e.priceTextOverride,pricePrefix:"",showCompareAtPrice:!1,onSaleDataAttribute:{},compareAtPriceRange:void 0,priceClassName:t[e.handle]||"",ssrStyle:i[e.handle]};const n=function(){var t,i;const n=new Set(e.variants.filter((e=>/^\d+$/.test(e.variantId))).map((e=>e.variantId))),o=new Set,l=[];for(const e of r){const r=a[e],c=(null==r?void 0:r.variants)||[];for(const e of c)n.has(e.id)&&!o.has(e.id)&&(o.add(e.id),l.push({variantId:e.id,priceNum:e.price.asNumber,priceStr:e.price.asString,compareNum:null===(t=e.compareAtPrice)||void 0===t?void 0:t.asNumber,compareStr:null===(i=e.compareAtPrice)||void 0===i?void 0:i.asString}))}return l}();if(0===n.length){const{pricePrefix:r,priceText:a,showCompareAtPrice:n,onSaleDataAttribute:o,compareAtPriceRange:l}=function(){var r;const{minPrice:a,maxPrice:t}=e.priceRange,i=null===(r=e.compareAtRange)||void 0===r?void 0:r.maxPrice,n=null!=i&&null!=a&&i>a,o=n;return{pricePrefix:null!=a&&null!=t&&a!==t?"From ":"",priceText:null!=a?(0,j.a)(a):"",showCompareAtPrice:n,onSaleDataAttribute:(0,S.a)(!!o),compareAtPriceRange:null!=i?(0,j.a)(i):void 0}}();return{pricePrefix:r,priceText:a,showCompareAtPrice:n,onSaleDataAttribute:o,compareAtPriceRange:l,priceClassName:t[e.handle]||"",ssrStyle:i[e.handle]}}const{pricePrefix:o,priceText:l,showCompareAtPrice:c,onSaleDataAttribute:s,compareAtPriceRange:d}=function(e){var r;const a=e.map((e=>e.priceNum)).filter((e=>null!=e)),t=a.length>0?Math.min(...a):void 0,i=a.length>0?Math.max(...a):void 0,n=e.reduce(((e,r)=>null==r.priceNum?e:!e||null!=e.priceNum&&r.priceNume.compareNum)).filter((e=>null!=e)),l=o.length>0?Math.max(...o):void 0,c=e.reduce(((e,r)=>null==r.compareNum?e:!e||null!=e.compareNum&&r.compareNum>e.compareNum?r:e),void 0),s=null!=l&&null!=t&&l>t,d=s;return{pricePrefix:null!=t&&null!=i&&t!==i?"From ":"",priceText:null!==(r=null==n?void 0:n.priceStr)&&void 0!==r?r:"",showCompareAtPrice:s,onSaleDataAttribute:(0,S.a)(!!d),compareAtPriceRange:null==c?void 0:c.compareStr}}(n);return{pricePrefix:o,priceText:l,showCompareAtPrice:c,onSaleDataAttribute:s,compareAtPriceRange:d,priceClassName:t[e.handle]||"",ssrStyle:i[e.handle]}}),[e,a,r,t,i])}(e),D=(0,d.a)(e.imageMap,C)[0],M=(0,u.b)(e,C);if(!D)return null;const L=(0,n.useMemo)((()=>{var r,a,t;return v&&(null==v?void 0:v.length)>0?null!==(r=C.badge)&&void 0!==r?r:e.badge:C.oos&&!C.preorderVariant?x?"":"Sold Out":C.compareAtPrice&&parseFloat(C.price){a&&(e.preventDefault(),location.replace(M))},class:i.a.link,"data-orly-type":r,"data-orly-handle":e.handle,children:[(0,t.jsxs)("div",{className:i.a.heroImageContainer,children:[L&&(0,t.jsx)("div",{class:i.a.bestSeller,"data-badge":L,children:L}),(0,t.jsx)(o.a,{src:D.src,initialWidth:300,cssClass:i.a.heroImage,alt:`${e.title}: ${D.model}`,height:g,width:f,fullSizeWidth:E})]}),(0,t.jsxs)("div",{class:i.a.textWrapper,children:[A&&(0,t.jsx)("div",{class:i.a.vendor,children:e.vendor}),(0,t.jsx)("div",{class:i.a.title,children:W}),k&&(0,t.jsx)("div",{class:i.a.subtitle,children:k}),(0,t.jsx)("div",{class:i.a.price,children:(0,t.jsx)("span",{class:H,style:R,children:(0,t.jsxs)("span",{children:[I&&(0,t.jsx)("span",{children:I}),(0,t.jsx)("span",Object.assign({},V,{children:T})),O&&F&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("span",{class:i.a.originalPrice,children:F})]})]})})}),(0,t.jsx)(P.a,{reviewCount:e.reviewCount,reviewRating:e.reviewRating}),x&&e.plpPromoText&&(0,t.jsx)("div",{class:i.a.plpPromoText,children:e.plpPromoText})]})]}),(0,t.jsx)("div",{class:i.a.colorSwatchContainer,children:!_&&w&&(0,t.jsx)(s.a,{product:e,small:!0,maxItems:12,hideLabel:!0,option:w,getHexForOptionColor:m,selectedVariant:C,findProductVariantWithOption:r=>h(r,e,y),setSelectedVariantId:r=>{const a=e.variants.find((e=>e.variantId===r));a&&N(a)}})})]})}},105:(e,r,a)=>{a.d(r,{a:()=>n});var t=a(1),i=a(2);function n(){return(0,i.useMemo)((()=>{const e=(0,t.getAssignment)("maxFullSizeWidth");if(e)try{const r=parseInt(e);if(Number.isNaN(r))return;return r}catch(e){return}}),[])}}}]);