"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[14],{13:function(e,s,r){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.AddToCartButton=void 0;const a=r(0),n=r(1),i=r(2),c=t(r(26)),l=r(40),o=r(631),{wrapper:u,wrapperLargeSize:p,wrapperSmallSize:d,wrapperMediumSize:h,wrapperHero:b,wrapperSmall:f,wrapperCrossed:w,wrapperDisabled:j,wrapperJarCart:g,wrapperButtonAuto:m,wrapperBundle:x,wrapperUpsell:S,wrapperStickyHeader:k,wrapperRelatedProducts:O,wrapperJetpackBundleClass:_,wrapperInCartUpsell:C,wrapperMobileFloat:M,wrapperMessageSpace:P,wrapperDiscountMessage:v,wrapperPriceCrossed:y}=c.default;s.AddToCartButton=function({cartMessage:e="Add to cart",outOfStockMessage:s="Out of stock",price:r="",disabled:t=!1,onClick:c,autoWidth:I=!1,small:N=!1,height:D="large",bundle:B=!1,upsell:$=!1,mobileFloat:A=!1,hero:F=!1,stickyHeader:V=!1,relatedProducts:z=!1,forJar:E=!1,jetpackBundleClass:H=!1,isOneElement:J=!1,inCartUpsell:R=!1,beforeDiscountPrice:T,isDesktop:U=!1,busy:L=!1,spinner:W=!1,paused:q=!1,isPriceCrossedOut:G=!1,crossedOutPriceMessage:K="",disableStickyPurchase:Q=!0}){const X=(0,o.useStickyPurchase)(Q),Y=e=>{c({},e)};return(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)("button",Object.assign({ref:X,disabled:L,className:(0,i.cx)(u,E&&g,I&&m,t&&j,N&&f,"large"===D?p:"medium"===D?h:d,B&&x,$&&S,A&&M,F&&b,V&&k,z&&O,H&&_,R&&C),onMouseDown:!q&&R&&U?Y:()=>{},onTouchStart:!q&&R&&U?Y:()=>{},onClick:q||R&&U?()=>{}:Y},{children:W?(0,a.jsx)(l.Spinner,{}):t?(0,a.jsx)("span",Object.assign({className:(0,i.cx)(P,"no-translate")},{children:s})):J?(0,a.jsx)("span",Object.assign({className:"no-translate"},{children:`${e} – ${r}`})):(0,a.jsxs)(n.Fragment,{children:[(0,a.jsxs)("span",Object.assign({className:(0,i.cx)(P,"no-translate")},{children:[`${e}`,r.length>0?(0,a.jsx)("span",Object.assign({className:"no-translate"},{children:"–"})):null]})),T&&T!=r&&(0,a.jsx)("span",Object.assign({className:(0,i.cx)(w,"no-translate")},{children:`${T} `})),r.length>0?(0,a.jsx)("span",Object.assign({className:(0,i.cx)("no-translate",G&&y)},{children:`${r}`})):null]})})),G&&(0,a.jsxs)("p",Object.assign({className:v},{children:[" ",K]}))]})}},40:function(e,s,r){var t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s,"__esModule",{value:!0}),s.Spinner=void 0;const a=r(0),n=t(r(20)),{spinner:i}=n.default;s.Spinner=()=>(0,a.jsx)("div",{className:i})},86:(e,s,r)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.useIsInViewport=void 0;const t=r(3);s.useIsInViewport=()=>{const[e,s]=(0,t.useState)(!1),[r,a]=(0,t.useState)(!1),n=(0,t.useRef)(null);return(0,t.useEffect)((()=>{const e=n.current;if(!e)return;const r=new IntersectionObserver((([e])=>{s(e.isIntersecting),a(e.boundingClientRect.y<100)}),{rootMargin:"-100px 0px 0px 0px",threshold:0});return r.observe(e),()=>{r.unobserve(e)}}),[]),[e,r,n]}},631:(e,s,r)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.useStickyPurchase=void 0;const t=r(86),a=r(35),n=r(3);s.useStickyPurchase=(e=!1)=>{const[s,r,i]=(0,t.useIsInViewport)(),c=(0,a.useSharedState)()((({setStickyPurchaseVisibility:e})=>e));return(0,n.useEffect)((()=>{i.current&&!e&&c(!s&&r)}),[s,r]),i}}}]);