1"use strict";(self.webpackChunkshopwp=self.webpackChunkshopwp||[]).push([["CartCheckout-public"],{"./npm-packages/@shopwp/components/src/cart/checkout/index.jsx"(e,t,a){a.r(t),a.d(t,{default:()=>k});var o=a("./npm-packages/@shopwp/components/src/error-fallback/index.jsx"),c=a("./node_modules/react-error-boundary/dist/react-error-boundary.js"),s=a("./npm-packages/@shopwp/components/src/cart/_state/hooks.js"),n=a("./npm-packages/@shopwp/common/src/utils/index.jsx"),r=a("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),p=a("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),u=a("./npm-packages/@shopwp/common/src/checkout/index.js"),l=a("./npm-packages/@shopwp/components/src/shop/_state/hooks.js");const h=function(){var e=wp.element,t=e.useState,a=e.useEffect,o=(0,s.J)(),c=(0,s.K)(),n=(0,l.T)(),h=(0,p.AH)(";label:checkoutButtonCSS;"),k=(0,p.AH)(";label:buttonCSS;"),m=t(""),i=(0,r.A)(m,2),d=i[0],w=i[1],g=shopwp.general.enableCartTerms&&!o.termsAccepted||shopwp.general.noteRequired&&!o.note||!n.cartData||!n.cartData.lines.edges.length;g=wp.hooks.applyFilters("cart.checkoutButtonDisabled",g,n.cartData,o);var b=wp.hooks.applyFilters("cart.checkoutButtonText",shopwp.general.cartCheckoutButtonText,n.cartData,o);return a((function(){if(n&&n.cartData){var e=(0,u.U)({checkoutUrl:n.cartData.checkoutUrl,trackingParams:n.trackingParams});w(e)}}),[n.cartData,n.trackingParams]),(0,p.Y)("a",{href:g||"popout"===shopwp.general.checkoutButtonTarget?void 0:d,className:"swp-btn swp-btn-checkout wps-btn-checkout",onClick:function(){g||(c({type:"SET_NOTICE",payload:!1}),wp.hooks.doAction("on.checkout",n),"popout"===shopwp.general.checkoutButtonTarget&&window.open(d,"popup","location=0,width=750,height=650,left=500,top=55"))},css:[k,h,";label:CartCheckoutButton;"],target:shopwp.misc.isMobile?"_self":shopwp.general.checkoutButtonTarget,"data-is-disabled":g,tabIndex:"0"},b)},k=function(){var e=(0,s.J)();return React.createElement(React.Fragment,null,React.createElement(n.W,{name:"before.cartCheckoutButton",args:[e]}),React.createElement(c.tH,{FallbackComponent:o.A},React.createElement(h,null)),React.createElement(n.W,{name:"after.cartCheckoutButton",args:[e]}))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.