"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[20],{41:function(e,t,r){var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a(0,d.isPreOrderVariant)(e))),x=t.every((e=>!e.oos));x||b||(b={backgroundColor:"#666",color:"#999"});const y=(0,u.useMemo)((()=>{const e=(0,d.getPreOrderMessage)(...t);return null==t?void 0:t.map((t=>{var{addToCartProperties:r={}}=t,a=n(t,["addToCartProperties"]);const s=a.compareAtPrice?100*parseFloat(a.compareAtPrice):void 0;return{id:null==a?void 0:a.variantId,quantity:"number"==typeof r._item_quantity?r._item_quantity:1,properties:Object.assign(Object.assign({_compareRetail:s},r),{Shipping:null==e?void 0:e.propertyValue,_olpre:e&&"preorder"})}}))}),[t]),S=(0,c.useIsHydrated)();return(0,s.jsx)(l.Fragment,{children:(0,s.jsx)("form",{class:[i.default.container,"small"===f?i.default.small:""].join(" "),action:`/cart/add?return_to=${encodeURIComponent(`${r}?variant=${null==O?void 0:O.variantId}&viewcart=true`)}`,method:"POST",children:(0,s.jsx)("button",{type:"submit",disabled:!S||p.status===o.Status.updating||!x,class:[i.default.addButton,"small"===f?i.default.small:"",g?i.default.outlined:""].join(" "),style:b,onClick:e=>{e.preventDefault(),x?a({items:y}):console.error("Not available for sale")},children:(0,s.jsx)(h,{selectedVariant:O,showPriceOnButton:m,isUpdating:(y.length>1&&`${null==O?void 0:O.variantId}_bundle`===p.variantId||(null==O?void 0:O.variantId)===p.variantId)&&p.status===o.Status.updating,isPreorder:P,isSoldOut:!x,buttonSubText:v,buttonMessage:j})})})})};const s=r(0),i=a(r(52)),o=r(7),l=r(0),d=r(12),u=r(3),c=r(25),p=r(33);function h({isUpdating:e,isPreorder:t,isSoldOut:r,selectedVariant:n,showPriceOnButton:a,buttonSubText:o,buttonMessage:d,buttonMessageMobile:u}){if(r)return(0,s.jsx)("span",{children:"Sold Out"});if(e)return(0,s.jsx)("span",{children:"Adding..."});const c=null!=u?u:t?"Add Pre-Order":"Add to Cart",h=null!=d?d:t?"Pre-Order Now":"Add to Cart";if(a&&(null==n?void 0:n.price)){const e=n.compareAtPrice?(0,p.roundToCents)(parseFloat(n.compareAtPrice)):null,t=(0,p.roundToCents)(parseFloat(n.price));return(0,s.jsxs)(l.Fragment,{children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{class:i.default.messageMobile,children:c}),(0,s.jsx)("span",{class:i.default.message,children:h})," - ",(0,s.jsxs)("span",{style:{whiteSpace:"nowrap"},children:[null!==e&&e>t&&(0,s.jsxs)("span",{class:i.default.linethrough,children:["$",(0,p.formatPriceSimple)(e)," "]}),"$",(0,p.formatPriceSimple)(t)]})]}),o&&(0,s.jsx)("div",{class:i.default.estimatedShipDate,children:o})]})}return(0,s.jsxs)(l.Fragment,{children:[(0,s.jsx)("span",{children:h}),o&&(0,s.jsx)("div",{class:i.default.estimatedShipDate,children:o})]})}}}]);