"use strict";(self.webpackChunkwebpackWcBlocksStylingJsonp=self.webpackChunkwebpackWcBlocksStylingJsonp||[]).push([[4654],{32721:(e,t,s)=>{s.d(t,{w:()=>r});var n=s(47594),a=s(47143),c=s(82680),o=s(95171);const r=()=>{const{isCalculating:e,isBeforeProcessing:t,isProcessing:s,isAfterProcessing:r,isComplete:i,hasError:l}=(0,a.useSelect)((e=>{const t=e(n.checkoutStore);return{isCalculating:t.isCalculating(),isBeforeProcessing:t.isBeforeProcessing(),isProcessing:t.isProcessing(),isAfterProcessing:t.isAfterProcessing(),isComplete:t.isComplete(),hasError:t.hasError()}})),{activePaymentMethod:d,isExpressPaymentMethodActive:m}=(0,a.useSelect)((e=>{const t=e(n.paymentStore);return{activePaymentMethod:t.getActivePaymentMethod(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive()}})),{onSubmit:u}=(0,c.E)(),{paymentMethods:h={}}=(0,o.m)(),g=s||r||t,p=i&&!l;return{paymentMethodButtonLabel:(h[d]||{}).placeOrderButtonLabel,onSubmit:u,isCalculating:e,isDisabled:s||m,waitingForProcessing:g,waitingForRedirect:p}}},65558:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var n=s(51609),a=s(27723),c=s(70851),o=s(86087),r=s(14656),i=s(32721),l=s(29491),d=s(47143),m=s(47594),u=s(13123),h=s(18568);const g=(0,l.withInstanceId)((({text:e,checkbox:t,instanceId:s,className:l,showSeparator:g})=>{const[p,b]=(0,o.useState)(!1),{isDisabled:k}=(0,i.w)(),E="terms-and-conditions-"+s,{setValidationErrors:w,clearValidationError:P}=(0,d.useDispatch)(m.validationStore),_=(0,d.useSelect)((e=>e(m.validationStore).getValidationError(E))),S=!(null==_||!_.message||null!=_&&_.hidden);return(0,o.useEffect)((()=>{if(t)return p?P(E):w({[E]:{message:(0,a.__)("Please read and accept the terms and conditions.","woocommerce"),hidden:!0}}),()=>{P(E)}}),[t,p,E,P,w]),(0,n.createElement)(n.Fragment,null,(0,n.createElement)(h.VM,null),(0,n.createElement)("div",{className:(0,c.A)("wc-block-checkout__terms",{"wc-block-checkout__terms--disabled":k,"wc-block-checkout__terms--with-separator":"false"!==g&&!1!==g},l)},t?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.CheckboxControl,{id:"terms-and-conditions",checked:p,onChange:()=>b((e=>!e)),hasError:S,disabled:k},(0,n.createElement)("span",{className:"wc-block-components-checkbox__label",dangerouslySetInnerHTML:{__html:e||u.R}}))):(0,n.createElement)("span",{className:"wc-block-components-checkbox__label",dangerouslySetInnerHTML:{__html:e||u.G}})))}))}}]);