PageSourceSearch

https://assets.taskrabbit.com/_next/static/chunks/4283-85f3d23e6a7f0f80.js

js taskrabbit.com collected 2026-09-24 09:13:40 UTC 9,668 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4283],{8464:(e,t,a)=>{a.d(t,{Rj:()=>H,li:()=>h,CO:()=>i,pP:()=>b,iW:()=>g.i});var n=a(6029),o=a(83962),r=a(34776);let i=e=>e.paymentMethodId?e.paymentMethodExpired?{code:"validation_payment_method_expired"}:e.paymentMethodFailed?{code:"validation_payment_method_failed"}:null:{code:"validation_payment_method_id_missing"},d=e=>{let{error:t}=e,a=t&&(t.message||(e=>"validation_payment_method_failed"===e?"book.confirm.payment.cardFailed":"validation_payment_method_expired"===e?"book.confirm.payment.cardExpired":e.startsWith("pre_auth")?"book.confirm.payment.preAuthFailed":null)(t.code));return a?(0,n.jsx)(o.default,{component:"div","data-testid":"payment-field-error",sx:{color:"error.main",mt:1},variant:"label3",children:(0,n.jsx)(r.A,{id:a})}):null};var l=a(14485),s=a(85960),m=a(31626),c=a(55729),p=a(74423);let u=(0,c.createContext)(void 0);var y=a(12399);let h=e=>{let{children:t,usePMC:a=!1}=e,o=(0,m.useTheme)(),{locale:r}=(0,p.A)(),{currency:i,token:d,paymentMethodConfiguration:h}=(0,y.W)(r),_=(e=>{let{typography:t,meadow:{purpose:{primary:a,error:n,outline:o,text:r,background:i}},spacing:d}=e,l="".concat(d(1.25)," ").concat(d(1.5)),s="-1px",m="2px solid ".concat(a.main);return{rules:{".Input":{border:"1px solid ".concat(o.main),padding:l},".Input:focus":{boxShadow:"none",outline:m,outlineOffset:s},".Input--invalid":{borderColor:n.main,boxShadow:"none",outline:"none"},".Input--invalid:focus":{borderColor:n.main,outline:"none"},".Tab":{border:"1px solid ".concat(o.disabled),padding:l},".Tab--selected, .Tab--selected:focus, .Tab--selected:hover":{backgroundColor:i.main,border:"1px solid ".concat(a.main),outline:m,outlineOffset:s}},theme:"stripe",variables:{borderRadius:d(1),colorBackground:i.main,colorDanger:n.main,colorPrimary:a.main,colorText:r.main,colorTextPlaceholder:r.extraSubtle,colorTextSecondary:r.subtle,fontFamily:t.fontFamily,fontLineHeight:"1.5",tabSpacing:d(1)}}})(o),f=(0,c.useMemo)(()=>(0,s.c)(d,{locale:r}),[r,d]),x=a?h:void 0;return(0,n.jsx)(u.Provider,{value:x,children:(0,n.jsx)(l.S8,{options:{appearance:_,currency:i,loader:"auto",mode:"setup",paymentMethodConfiguration:x,paymentMethodCreation:"manual"},stripe:f,children:t})})};var _=a(17866),f=a(94270);let x=()=>{let e=(0,l.t2)(),t=(0,l.HH)();return(0,c.useMemo)(()=>e&&t?{elements:t,stripe:e}:null,[e,t])},b=()=>{let e=x(),t=(()=>{let e=x(),t=(0,c.useContext)(u),{mutateAsync:a}=f.Ay.component.PaymentField.createPaymentIntent.useMutation();return(0,c.useCallback)(async()=>{if(!e)return{error:{code:"pre_auth_stripe_not_ready"}};let{elements:n,stripe:o}=e;if((await n.submit()).error)return{error:{code:"pre_auth_stripe_submit_payment_element_failed"}};let r=await o.createConfirmationToken({elements:n});if(r.error)return{error:{code:"pre_auth_stripe_create_confirmation_token_failed"}};let i=r.confirmationToken.payment_method_preview.type;await (0,_.tP)();let d=await a({confirmationToken:r.confirmationToken.id,paymentMethodConfiguration:t,returnUrl:"".concat(window.location.origin).concat(window.location.pathname,"?").concat(new URLSearchParams({payment_method_type:i}))});if(d.error)return{error:{code:"pre_auth_create_payment_intent_failed"}};let l=d.bff.paymentMethod;if("requires_action"===d.bff.status){let{error:e,setupIntent:t}=await o.handleNextAction({clientSecret:d.bff.clientSecret});if(e||!t)return{error:{code:"pre_auth_stripe_handle_next_action_failed"}};l="string"==typeof t.payment_method?t.payment_method:t.payment_method&&t.payment_method.id}return l?{customerId:d.bff.customer,paymentMethodId:l,paymentMethodType:i}:{error:{code:"pre_auth_payment_method_id_missing"}}},[a,t,e])})(),{mutateAsync:a}=f.Ay.component.PaymentField.addPaymentMethod.useMutation();return(0,c.useCallback)(async()=>{if(!(e&&e.elements.getElement("payment")))return{error:null,status:"skipped"};let n=await t();return"error"in n?{error:n.error,status:"error"}:(await (0,_.tP)(),(await a(n)).error)?{error:{code:"finalize_add_payment_method_failed"},status:"error"}:{error:null,status:"success"}},[e,a,t])};var g=a(19315),k=a(28222),v=a.n(k),j=a(54072),w=a(1368),P=a(90248),M=a(80888);let C=e=>{let{open:t,onClose:a,onConfirm:o}=e;return(0,n.jsx)(M.L,{direction:"column",onClose:a,onConfirm:o,open:t,textConfirm:(0,n.jsx)(P.A,{id:"payments.components.PaymentWarningModal.button"}),textDeny:(0,n.jsx)(P.A,{id:"payments.components.PaymentWarningModal.cancel"}),textHeader:(0,n.jsx)(P.A,{id:"payments.components.PaymentWarningModal.title"}),children:(0,n.jsx)(P.A,{id:"payments.components.PaymentWarningModal.caption"})})};var T=a(86839),A=a.n(T),W=a(24170),S=a.n(W);let I={src:"https://assets.taskrabbit.com/_next/static/media/apple_pay_mark.00746fd7.svg",height:106,width:166,blurWidth:0,blurHeight:0},E={src:"https://assets.taskrabbit.com/_next/static/media/google_pay_mark.c93fce66.svg",height:400,width:752,blurWidth:0,blurHeight:0},F=e=>{let{account:t,editDisabled:a=!1,editingExistingPayment:r,setPaymentValidity:i}=e,{email:d,fullName:s,mobilePhone:m,paymentMethodCardType:c,paymentMethodLast4:u,paymentMethodEmail:y,paymentMethodType:h,paymentMethodWallet:_}=t,f=(0,p.A)(),x=!r&&null!==h;if(x&&c&&("apple_pay"===_||"google_pay"===_)){let e="apple_pay"===_,t=(e=>e.charAt(0).toUpperCase()+e.slice(1))(c);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(A(),{alignItems:"center",direction:"row",children:[(0,n.jsx)(v(),{sx:{mr:1},children:(0,n.jsx)(S(),{alt:f.formatMessage({id:e?"book.confirm.payment.applePayAlt":"book.confirm.payment.googlePayAlt"}),height:32,src:e?I:E,width:60})}),(0,n.jsx)(o.default,{variant:"body3",children:(0,n.jsx)(w.s,{id:e?"book.confirm.payment.applePay":"book.confirm.payment.googlePay"})})]}),(0,n.jsxs)(o.default,{variant:"body3",children:[t," (****",u,")"]})]})}return x?(0,n.jsx)(w.q,{cardType:c,email:y,last4:u,paymentMethodType:h}):(0,n.jsx)(v(),{sx:{pointerEvents:a?"none":"auto"},children:(0,n.jsx)(l.He,{onChange:e=>{i({complete:!e.empty,valid:e.complete})},options:{defaultValues:{billingDetails:{email:d,name:s,phone:m}},layout:"tabs"}})})},H=e=>{let{account:t,error:a=null,editDisabled:o=!1,onCancel:r=()=>{},onValidation:i=()=>{}}=e,l=null!==t.paymentMethodId&&null!==t.paymentMethodType,[s,m]=(0,c.useState)(!1),[p,u]=(0,c.useState)(!l),y=!p,h=l&&p;return(0,n.jsxs)(v(),{"data-testid":"payment-field",children:[(0,n.jsx)(v(),{mt:3,children:(0,n.jsx)(F,{account:t,editDisabled:o,editingExistingPayment:p,setPaymentValidity:e=>i(e.valid?null:{code:"validation_stripe_invalid_payment_details"})})}),y&&(0,n.jsx)(j.default,{onClick:()=>
1m(!0),size:"medium",sx:{display:"block",mt:2},children:(0,n.jsx)(w.s,{id:"payments.components.PaymentWarningModal.button"})}),h&&(0,n.jsx)(j.default,{disabled:o,onClick:()=>{u(!1),r()},size:"medium",sx:{display:"block",minWidth:"auto",mt:2},children:(0,n.jsx)(w.s,{id:"payments.components.PaymentWarningModal.cancel"})}),(0,n.jsx)(d,{error:a}),(0,n.jsx)(C,{onClose:()=>m(!1),onConfirm:()=>{u(!0),m(!1)},open:s})]})}},19315:(e,t,a)=>{a.d(t,{i:()=>s});var n=a(14485),o=a(81278),r=a(55729),i=a(17866),d=a(89539),l=a(94270);let s=e=>{let{onSuccess:t,onError:a}=e,s=(0,n.t2)(),{redirect_status:m,setup_intent_client_secret:c,payment_method_type:p}=(0,o.useRouter)().query,u=(0,d.JN)(m),y=(0,d.JN)(c),h=(0,d.JN)(p),{mutateAsync:_}=l.Ay.component.PaymentField.addPaymentMethod.useMutation(),[f,x]=(0,r.useState)(!1),[b,g]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=async()=>{if(y&&h&&"succeeded"===u){g(h),x(!0);let{setupIntent:e,error:n}=await s.retrieveSetupIntent(y);if(n){x(!1),a({code:"pre_auth_create_payment_intent_failed"});return}let o=(e=>"string"==typeof e.payment_method?e.payment_method:e.payment_method&&e.payment_method.id)(e);if(!o)return void a({code:"pre_auth_payment_method_id_missing"});if(await (0,i.tP)(),(await _({paymentMethodId:o,paymentMethodType:h})).error)return void a({code:"finalize_add_payment_method_failed"});t()}};if(s&&!f){if("failed"===u)return void a({code:"pre_auth_create_payment_intent_failed"});e()}},[_,f,a,t,h,u,y,s]),{handlingPaymentRedirect:f,paymentMethodType:b}}},50370:(e,t,a)=>{a.d(t,{k:()=>d,y:()=>l});var n=a(6029),o=a(28222),r=a.n(o),i=a(31626);let d=e=>{let{borderWidth:t,height:a,size:o,sx:d,thickness:l=.3,width:s}=e,m=(0,i.useTheme)(),c=parseInt(m.spacing(1)),p=a||s;!o&&p&&(o=o||p/c),o=o||7.5;let u=t?"".concat(t,"px"):m.spacing(o*l/2);return(0,n.jsx)(r(),{"data-testid":"loading-spinner",sx:e=>{let{meadow:{purpose:{component:t,outline:a}}}=e;return{"&, &:after":{borderRadius:"50%",height:m.spacing(o),width:m.spacing(o),...d},"&:only-child":{display:"block"},"@-webkit-keyframes load8":{"0%":{transform:"rotate(0deg)",WebkitTransform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)",WebkitTransform:"rotate(360deg)"}},"@keyframes load8":{"0%":{transform:"rotate(0deg)",WebkitTransform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)",WebkitTransform:"rotate(360deg)"}},animation:"load8 1.1s infinite linear",borderBottom:"".concat(u," solid ").concat(t.extraEmphasis),borderLeft:"".concat(u," solid ").concat(a.main),borderRight:"".concat(u," solid ").concat(t.extraEmphasis),borderTop:"".concat(u," solid ").concat(t.extraEmphasis),margin:"0 auto",WebkitAnimation:"load8 1.1s infinite linear"}}})},l=e=>{let{children:t,loading:a}=e;return(0,n.jsxs)(n.Fragment,{children:[a&&(0,n.jsx)(r(),{"aria-hidden":"true",sx:{position:"absolute"},children:(0,n.jsx)(d,{size:3})}),(0,n.jsx)(r(),{sx:{opacity:+!a},children:t})]})}},80888:(e,t,a)=>{a.d(t,{L:()=>o});var n=a(37529);let o=(0,a(52025).default)(n.Ay)(()=>({alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"}))}}]);
2//# sourceMappingURL=4283-85f3d23e6a7f0f80.js.map

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.