File "contact-information-frontend.js"

Full Path: /home/peaktdwu/aaronacebhutan.com/wp-content/plugins/woocommerce/assets/client/blocks/checkout-blocks/contact-information-frontend.js
File size: 4.08 KB
MIME-type: text/plain
Charset: utf-8

"use strict";(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[9357],{2723:(e,t,i)=>{i.d(t,{B:()=>a});var s=i(4617),l=i(9307),n=i(9818),o=i(4801),c=i(8540),r=i(3251);const a=()=>{const{needsShipping:e}=(0,r.V)(),{useShippingAsBilling:t,prefersCollection:i}=(0,n.useSelect)((e=>({useShippingAsBilling:e(o.CHECKOUT_STORE_KEY).getUseShippingAsBilling(),prefersCollection:e(o.CHECKOUT_STORE_KEY).prefersCollection()}))),{__internalSetUseShippingAsBilling:a}=(0,n.useDispatch)(o.CHECKOUT_STORE_KEY),{billingAddress:d,setBillingAddress:u,shippingAddress:p,setShippingAddress:m}=(0,c.L)(),g=(0,l.useCallback)((e=>{u({email:e})}),[u]),h=(0,s.getSetting)("forcedBillingAddress",!1);return{shippingAddress:p,billingAddress:d,setShippingAddress:m,setBillingAddress:u,setEmail:g,defaultFields:s.defaultFields,useShippingAsBilling:t,setUseShippingAsBilling:a,needsShipping:e,showShippingFields:!h&&e&&!i,showShippingMethods:e&&!i,showBillingFields:!e||!t||!!i,forcedBillingAddress:h,useBillingAsShipping:h||!!i}}},8540:(e,t,i)=>{i.d(t,{L:()=>n});var s=i(9818),l=i(4801);const n=()=>{const{customerData:e,isInitialized:t}=(0,s.useSelect)((e=>{const t=e(l.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}})),{setShippingAddress:i,setBillingAddress:n}=(0,s.useDispatch)(l.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:n,setShippingAddress:i}}},1070:(e,t,i)=>{i.d(t,{Z:()=>l});var s=i(5736);const l=({defaultTitle:e=(0,s.__)("Step","woocommerce"),defaultDescription:t=(0,s.__)("Step description text.","woocommerce"),defaultShowStepNumber:i=!0})=>({title:{type:"string",default:e},description:{type:"string",default:t},showStepNumber:{type:"boolean",default:i}})},5145:(e,t,i)=>{i.r(t),i.d(t,{default:()=>A});var s=i(9196),l=i(3849),n=i.n(l),o=i(721),c=i(711),r=i(9818),a=i(4801),d=i(5736),u=i(2723),p=i(8360),m=i(8027),g=i(4617),h=i(6483);const S=()=>{const{customerId:e,shouldCreateAccount:t}=(0,r.useSelect)((e=>{const t=e(a.CHECKOUT_STORE_KEY);return{customerId:t.getCustomerId(),shouldCreateAccount:t.getShouldCreateAccount()}})),{__internalSetShouldCreateAccount:i}=(0,r.useDispatch)(a.CHECKOUT_STORE_KEY),{billingAddress:l,setEmail:n}=(0,u.B)(),{dispatchCheckoutEvent:o}=(0,p.n)(),S=!e&&(0,g.getSetting)("checkoutAllowsGuest",!1)&&(0,g.getSetting)("checkoutAllowsSignup",!1)&&(0,s.createElement)(c.CheckboxControl,{className:"wc-block-checkout__create-account",label:(0,d.__)("Create an account?","woocommerce"),checked:t,onChange:e=>i(e)});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(c.StoreNoticesContainer,{context:m.n7.CONTACT_INFORMATION}),(0,s.createElement)(c.ValidatedTextInput,{id:"email",type:"email",autoComplete:"email",errorId:"billing_email",label:(0,d.__)("Email address","woocommerce"),value:l.email,required:!0,onChange:e=>{n(e),o("set-email-address")},customValidation:e=>!!(0,h.isEmail)(e.value)||(e.setCustomValidity((0,d.__)("Please enter a valid email address","woocommerce")),!1)}),S)},_={...(0,i(1070).Z)({defaultTitle:(0,d.__)("Contact information","woocommerce"),defaultDescription:(0,d.__)("We'll use this email to send you details and updates about your order.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{remove:!0,move:!0}}},C=`${i(8752).ZE}?redirect_to=${encodeURIComponent(window.location.href)}`,E=()=>{const e=(0,r.useSelect)((e=>e(a.CHECKOUT_STORE_KEY).getCustomerId()));return!(0,g.getSetting)("checkoutShowLoginReminder",!0)||e?null:(0,s.createElement)(s.Fragment,null,(0,d.__)("Already have an account? ","woocommerce"),(0,s.createElement)("a",{href:C},(0,d.__)("Log in.","woocommerce")))},A=(0,o.withFilteredAttributes)(_)((({title:e,description:t,showStepNumber:i,children:l,className:o})=>{const d=(0,r.useSelect)((e=>e(a.CHECKOUT_STORE_KEY).isProcessing()));return(0,s.createElement)(c.FormStep,{id:"contact-fields",disabled:d,className:n()("wc-block-checkout__contact-fields",o),title:e,description:t,showStepNumber:i,stepHeadingContent:()=>(0,s.createElement)(E,null)},(0,s.createElement)(S,null),l)}))}}]);