(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[9936],{4845:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var o=n(1609),c=n(8165),r=n(6087),a=n(851),s=n(4040),l=n.n(s),i=(n(2080),n(8730));const u=(0,r.forwardRef)(((e,t)=>{"showSpinner"in e&&l()("showSpinner prop",{version:"8.9.0",alternative:"Render a spinner in the button children instead.",plugin:"WooCommerce"});const{className:n,showSpinner:r=!1,children:s,variant:u="contained",removeTextWrap:m=!1,...d}=e,b=(0,a.A)("wc-block-components-button","wp-element-button",n,u,{"wc-block-components-button--loading":r});if("href"in e)return(0,o.createElement)(c.$,{render:(0,o.createElement)("a",{ref:t,href:e.href},r&&(0,o.createElement)(i.A,null),(0,o.createElement)("span",{className:"wc-block-components-button__text"},s)),className:b,...d});const p=m?e.children:(0,o.createElement)("span",{className:"wc-block-components-button__text"},e.children);return(0,o.createElement)(c.$,{ref:t,className:b,...d},r&&(0,o.createElement)(i.A,null),p)}))},5462:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var o=n(1616),c=n(1609),r=n(851),a=n(6087),s=n(4845),l=n(812);const i={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1};var u=n(5703),m=n(7143),d=n(7594),b=n(1e3),p=n(2379),h=n(7902);const f=(0,n(7723).__)("Proceed to Checkout","woocommerce"),k={checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}},buttonLabel:{type:"string",default:f}},v=(0,o.withFilteredAttributes)(k)((({checkoutPageId:e,className:t,buttonLabel:o})=>{const k=(0,u.getSetting)("page-"+e,!1),v=(0,m.useSelect)((e=>e(d.CHECKOUT_STORE_KEY).isCalculating())),[w,E]=(()=>{const[e,t]=(0,a.useState)(""),n=(0,a.useRef)(null),o=(0,a.useRef)(new IntersectionObserver((e=>{e[0].isIntersecting?t("visible"):t(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return(0,a.useLayoutEffect)((()=>{const e=n.current,t=o.current;return e&&t.observe(e),()=>{t.unobserve(e)}}),[]),[(0,c.createElement)("div",{"aria-hidden":!0,ref:n,style:i}),e]})(),[g,C]=(0,a.useState)(!1);(0,a.useEffect)((()=>{if("function"!=typeof n.g.addEventListener||"function"!=typeof n.g.removeEventListener)return;const e=()=>{C(!1)};return n.g.addEventListener("pageshow",e),()=>{n.g.removeEventListener("pageshow",e)}}),[]);const _=(0,m.useSelect)((e=>e(d.CART_STORE_KEY).getCartData())),y=(0,b.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLabel",defaultValue:o||f,arg:{cart:_}}),N=(0,b.applyCheckoutFilter)({filterName:"proceedToCheckoutButtonLink",defaultValue:k||l.tn,arg:{cart:_}}),{dispatchOnProceedToCheckout:S}=(0,h.e)(),A=(0,c.createElement)(s.A,{className:"wc-block-cart__submit-button",href:N,disabled:v,onClick:e=>{S().then((t=>{t.some(p.CR)?e.preventDefault():C(!0)}))},showSpinner:g},y),L=(0,a.useMemo)((()=>getComputedStyle(document.body).backgroundColor),[]);return(0,c.createElement)("div",{className:(0,r.A)("wc-block-cart__submit",t)},w,(0,c.createElement)("div",{className:"wc-block-cart__submit-container"},A),"below"===E&&(0,c.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky",style:{backgroundColor:L}},A))}))},8730:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var o=n(1609);n(7791);const c=()=>(0,o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},2080:()=>{},7791:()=>{}}]);