"use strict";(self.webpackChunkwebpackWcBlocksCartCheckoutFrontendJsonp=self.webpackChunkwebpackWcBlocksCartCheckoutFrontendJsonp||[]).push([[9936],{892:(e,t,o)=>{o.r(t),o.d(t,{default:()=>g});var c=o(1616),a=o(1609),r=o(851),n=o(6087),u=o(3013),s=o(2516),l=o(6239),i=o(5703),d=o(7143),k=o(7594),b=o(1e3),p=o(3993),m=o(7827);const h=(0,o(7723).__)("Proceed to Checkout","woocommerce"),f={checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}},buttonLabel:{type:"string",default:h}},g=(0,c.withFilteredAttributes)(f)((({checkoutPageId:e,className:t,buttonLabel:c})=>{const f=(0,i.getSetting)("page-"+e,!1),g=(0,d.useSelect)((e=>e(k.checkoutStore).isCalculating())),[C,w]=(0,l.E)(),[v,y]=(0,n.useState)(!1);(0,n.useEffect)((()=>{if("function"!=typeof o.g.addEventListener||"function"!=typeof o.g.removeEventListener)return;const e=()=>{y(!1)};return o.g.addEventListener("pageshow",e),()=>{o.g.removeEventListener("pageshow",e)}}),[]);const E=(0,d.useSelect)((e=>e(k.cartStore).getCartData())),_=(0,b.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLabel",defaultValue:c||h,arg:{cart:E}}),L=(0,b.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLink",defaultValue:f||s.tn,arg:{cart:E}}),{dispatchOnProceedToCheckout:S}=(0,m.e)(),N=(0,a.createElement)(u.A,{className:"wc-block-cart__submit-button",href:L,disabled:g,onClick:e=>{S().then((t=>{t.some(p.isErrorResponse)?e.preventDefault():y(!0)}))},showSpinner:v},_),F=(0,n.useMemo)((()=>getComputedStyle(document.body).backgroundColor),[]),A="below"===w,B=(0,r.A)("wc-block-cart__submit-container",{"wc-block-cart__submit-container--sticky":A});return(0,a.createElement)("div",{className:(0,r.A)("wc-block-cart__submit",t)},C,(0,a.createElement)("div",{className:B,style:A?{backgroundColor:F}:{}},N))}))}}]);