"use strict";(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[1084],{24225:(e,t,c)=>{c.r(t),c.d(t,{default:()=>v});var n=c(80721),o=c(99196),r=c(80612),a=c.n(r),s=c(69307),l=c(12904),u=c(68752);const i={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1};var b=c(74617),d=c(9818),p=c(94801),m=c(33554),k=c(28027),f=c(82346),g=c(75052);var h=c(31298);const v=(0,n.withFilteredAttributes)(h.Z)((({checkoutPageId:e,className:t,buttonLabel:n})=>{const r=(0,b.getSetting)("page-"+e,!1),h=(0,d.useSelect)((e=>e(p.CHECKOUT_STORE_KEY).isCalculating())),[v,E]=(()=>{const[e,t]=(0,s.useState)(""),c=(0,s.useRef)(null),n=(0,s.useRef)(new IntersectionObserver((e=>{e[0].isIntersecting?t("visible"):t(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return(0,s.useLayoutEffect)((()=>{const e=c.current,t=n.current;return e&&t.observe(e),()=>{t.unobserve(e)}}),[]),[(0,o.createElement)("div",{"aria-hidden":!0,ref:c,style:i}),e]})(),[C,w]=(0,s.useState)(!1);(0,s.useEffect)((()=>{if("function"!=typeof c.g.addEventListener||"function"!=typeof c.g.removeEventListener)return;const e=()=>{w(!1)};return c.g.addEventListener("pageshow",e),()=>{c.g.removeEventListener("pageshow",e)}}),[]);const _=(0,d.useSelect)((e=>e(p.CART_STORE_KEY).getCartData())),y=(0,m.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLabel",defaultValue:n||g.B,arg:{cart:_}}),S=(0,m.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLink",defaultValue:r||u.sE,arg:{cart:_}}),{dispatchOnProceedToCheckout:L}=(0,f.b)(),N=(0,o.createElement)(l.Z,{className:"wc-block-cart__submit-button",href:S,disabled:h,onClick:e=>{L().then((t=>{t.some(k.qm)?e.preventDefault():w(!0)}))},showSpinner:C},y),T=(0,s.useMemo)((()=>getComputedStyle(document.body).backgroundColor),[]);return(0,o.createElement)("div",{className:a()("wc-block-cart__submit",t)},v,(0,o.createElement)("div",{className:"wc-block-cart__submit-container"},N),"below"===E&&(0,o.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky",style:{backgroundColor:T}},N))}))}}]);