1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1747],{54927:function(e,t,n){"use strict";var r=n(91941);t.Z=void 0;var i=r(n(64938)),a=n(85893),o=(0,i.default)((0,a.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}),"CreditCard");t.Z=o},43900:function(e,t,n){"use strict";var r=n(91941);t.Z=void 0;var i=r(n(64938)),a=n(85893),o=(0,i.default)((0,a.jsx)("path",{d:"M21.9 21.9 2.1 2.1.69 3.51l1.55 1.55c-.15.28-.23.6-.23.94L2 18c0 1.11.89 2 2 2h13.17l3.31 3.31 1.42-1.41zM4 12V8h1.17l4 4H4zm2.83-8H20c1.11 0 2 .89 2 2v12c0 .34-.08.66-.23.94L14.83 12H20V8h-9.17l-4-4z"}),"CreditCardOff");t.Z=o},12469:function(e,t,n){"use strict";var r=n(91941);t.Z=void 0;var i=r(n(64938)),a=n(85893),o=(0,i.default)((0,a.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h5v-2H4v-6h18V6c0-1.11-.89-2-2-2zm0 4H4V6h16v2zm-5.07 11.17-2.83-2.83-1.41 1.41L14.93 22 22 14.93l-1.41-1.41-5.66 5.65z"}),"CreditScore");t.Z=o},4530:function(e,t,n){"use strict";n.d(t,{DW:function(){return x},HB:function(){return k},O2:function(){return C},tL:function(){return S},vv:function(){return Z}});var r,i,a,o,c,l=n(50029),d=n(71383),s=n(87794),u=n.n(s),h=n(50456),p=n(66252),f=n(56070),g=n(67294),v=n(55293),y=(0,h.gql)(r||(r=(0,d.Z)(["\n\tquery GetStripeConnectUrl {\n\t\tgetStripeConnectUrl\n\t}\n"])));function x(){var e=(0,p.x)();return(0,l.Z)(u().mark((function t(){var n,r,i,a;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.query({query:y});case 3:if(n=t.sent,r=n.data,!((i=n.errors)&&i.length>0)){t.next=10;break}throw i;case 10:return t.abrupt("return",null!==(a=null===r||void 0===r?void 0:r.getStripeConnectUrl)&&void 0!==a?a:null);case 11:t.next=17;break;case 13:throw t.prev=13,t.t0=t.catch(0),f.Z.error("Error fetching Stripe Connect Url",500,t.t0),t.t0;case 17:case"end":return t.stop()}}),t,null,[[0,13]])})))}var m=(0,h.gql)(i||(i=(0,d.Z)(["\n\tquery GetClientSecretByUserId($userId: String) {\n\t\tgetClientSecretByUserId(userId: $userId)\n\t}\n"])));function Z(e,t){var n,r=(0,v.d)(m,{variables:{userId:e},fetchPolicy:"no-cache",skip:!t}),i=r.data,a=r.loading,o=r.error;return{clientSecretLoading:a,clientSecret:null!==(n=null===i||void 0===i?void 0:i.getClientSecretByUserId)&&void 0!==n?n:null,clientSecretFetchError:o?"There was an unexpected error when calling Stripe.":null}}var P=(0,h.gql)(a||(a=(0,d.Z)(["\n\tquery GetClientSecretByToken($addPaymentMethodToken: String!) {\n\t\tgetClientSecretByToken(addPaymentMethodToken: $addPaymentMethodToken)\n\t}\n"])));function C(e){var t,n=(0,v.d)(P,{variables:{addPaymentMethodToken:null!==e&&void 0!==e?e:""},fetchPolicy:"no-cache",skip:!e}),r=n.data,i=n.loading,a=n.error;return{clientSecretLoading:i,clientSecret:null!==(t=null===r||void 0===r?void 0:r.getClientSecretByToken)&&void 0!==t?t:null,clientSecretFetchError:null!==a&&void 0!==a?a:null}}var j=(0,h.gql)(o||(o=(0,d.Z)(["\n\tquery GetPaymentMethodsByUserId($userId: String!) {\n\t\tgetPaymentMethodsByUserId(userId: $userId) {\n\t\t\tid\n\t\t\tbrand\n\t\t\tcountry\n\t\t\tlastFourDigits\n\t\t\tcardType\n\t\t\texpMonth\n\t\t\texpYear\n\t\t\tdefault\n\t\t}\n\t}\n"])));function S(e){var t,n=(0,v.d)(j,{variables:{userId:null!==e&&void 0!==e?e:""},fetchPolicy:"no-cache",skip:void 0===e}),r=n.data,i=n.loading,a=n.error,o=n.refetch,c=(0,g.useCallback)((function(){o().catch((function(e){f.Z.error("Error refetching payment methods",500,e)}))}),[o]);return{cardPaymentMethodsLoading:i,cardPaymentMethods:null!==(t=null===r||void 0===r?void 0:r.getPaymentMethodsByUserId)&&void 0!==t?t:[],cardPaymentMethodsError:a?"There was an unexpected error when calling Stripe.":null,cardPaymentMethodsRefetch:c}}var b=(0,h.gql)(c||(c=(0,d.Z)(["\n\tquery GetDefaultPaymentMethod {\n\t\tgetUserDefaultPaymentMethod {\n\t\t\tid\n\t\t\tbrand\n\t\t\tcountry\n\t\t\tlastFourDigits\n\t\t\tcardType\n\t\t\texpMonth\n\t\t\texpYear\n\t\t\tdefault\n\t\t}\n\t}\n"])));function k(){var e,t=(0,v.d)(b,{fetchPolicy:"no-cache"}),n=t.data,r=t.loading,i=t.error;return{defaultPaymentMethodLoading:r,defaultPaymentMethod:null!==(e=null===n||void 0===n?void 0:n.getUserDefaultPaymentMethod)&&void 0!==e?e:null,defaultPaymentMethodError:i?"There was an unexpected error when calling Stripe.":null}}},65769:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(86664),i=n(54465),a=n(42609),o=n(36822),c=n(50029),l=n(87794),d=n.n(l),s=n(31812),u=n(97540),h=n(56070),p=n(67294),f=n(85893);function g(e){var t=e.onClose,n=(0,r.useStripe)(),i=(0,r.useElements)(),a=(0,p.useState)(null),l=a[0],g=a[1],v=(0,p.useState)(!1),y=v[0],x=v[1],m=function(){var e=(0,c.Z)(d().mark((function e(r){var a,o,c;return d().wrap((function(e){for(;;
1)switch(e.prev=e.next){case 0:if(r.preventDefault(),n&&i){e.next=3;break}return e.abrupt("return");case 3:return x(!0),e.next=6,n.confirmSetup({elements:i,redirect:"if_required"});case 6:a=e.sent,o=a.setupIntent,c=a.error,o?(x(!1),t()):(!c||"card_error"!==c.type&&"validation_error"!==c.type?(h.Z.error("An unexpected error occurred with Stripe PaymentIntent.",500,c),g("An unexpected error occurred. Please try again")):g(c.message?c.message:"Your payment could not be processed. Please try again or use a different payment method."),x(!1));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,f.jsxs)("form",{id:"payment-form",onSubmit:m,style:{width:"100%"},children:[l&&!y&&(0,f.jsx)(o.Z,{mb:3,children:(0,f.jsx)(u.Z,{message:l,type:"error",fullWidth:!0,marginTop:2})}),(0,f.jsx)(r.PaymentElement,{id:"payment-element",onReady:function(){return x(!1)}}),(0,f.jsx)(o.Z,{mt:5,display:"flex",justifyContent:"center",children:(0,f.jsx)(s.Z,{variant:"contained",disabled:y||!n||!i,onClick:m,loading:y,fullWidth:!0,children:"Save"})})]})}var v=(0,i.J)(a.d.Public.getStripePublishableKey());function y(e){var t=e.clientSecret,n=e.onClose,i={clientSecret:t,appearance:{theme:"stripe"}};return(0,f.jsx)(r.Elements,{stripe:v,options:i,children:(0,f.jsx)(g,{onClose:n})})}},44386:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return P}});var r=n(59499),i=n(23795),a=n(15861),o=n(69661),c=n(86886),l=n(65769),d=n(92395),s=n(4530),u=n(86421),h=n(11163),p=n(20197),f=n(54927),g=n(43900),v=n(12469),y=n(67294),x=n(19796),m=n(97720),Z=n(85893);function P(){var e=(0,h.useRouter)(),t=(0,p.O_)("token",e.query),n=(0,s.O2)(t),r=n.clientSecret,i=n.clientSecretLoading,a=n.clientSecretFetchError,o=(0,y.useState)(!1),l=o[0],u=o[1];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d.Z,{}),(0,Z.jsx)(c.ZP,{container:!0,justifyContent:"center",sx:b.mainContainer,children:(0,Z.jsx)(c.ZP,{item:!0,xs:12,sm:4,sx:b.contentContainer,children:(0,Z.jsx)(m.Z,{isLoading:i,isError:!!a,ErrorComponent:(0,Z.jsx)(S,{}),children:r?(0,Z.jsxs)(Z.Fragment,{children:[!l&&(0,Z.jsx)(C,{stripeClientSecret:r,onPaymentMethodSubmit:function(){return u(!0)}}),l&&(0,Z.jsx)(j,{})]}):(0,Z.jsx)(S,{})})})})]})}function C(e){var t=e.stripeClientSecret,n=e.onPaymentMethodSubmit;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(o.Z,{sx:b.iconPicture(u.Z.extendedPalette.dyingBlue),children:(0,Z.jsx)(f.Z,{sx:{fontSize:u.Z.spacing(6)}})}),(0,Z.jsx)(a.Z,{variant:"h2",textAlign:"center",children:"Add your credit card"}),(0,Z.jsx)(a.Z,{variant:"button",color:u.Z.palette.grey[500],textAlign:"center",children:"To receive services and be invoiced under Alto's Care Collaborator program, we require a credit card to keep on file. This credit card will only be charged under the circumstances discussed with your Care Collaborator. Have questions? Reach out to them."}),(0,Z.jsx)(l.Z,{clientSecret:t,onClose:n}),(0,Z.jsxs)(a.Z,{variant:"button",fontWeight:400,children:["By clicking save, I agree to Alto's\xa0",(0,Z.jsx)(i.Z,{href:x.nB.Policies.TermsConditions,target:"_blank",children:"Terms and Conditions"}),",\xa0",(0,Z.jsx)(i.Z,{href:x.nB.Policies.PrivacyNotice,target:"_blank",children:"Privacy Policy"}),", and\xa0",(0,Z.jsx)(i.Z,{href:x.nB.Policies.CookiePolicy,target:"_blank",children:"Cookies Policy"}),"\xa0and consent to receiving email communications."]})]})}function j(){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(o.Z,{sx:b.iconPicture(u.Z.extendedPalette.green),children:(0,Z.jsx)(v.Z,{sx:{fontSize:u.Z.spacing(6)}})}),(0,Z.jsx)(a.Z,{variant:"h2",textAlign:"center",children:"Credit card added"}),(0,Z.jsx)(a.Z,{variant:"button",color:u.Z.palette.grey[500],textAlign:"center",children:"Thank you for providing your credit card. If you would like to provide a different credit card, please contact your Care Collaborator."}),(0,Z.jsx)(a.Z,{variant:"button",color:u.Z.palette.grey[500],textAlign:"center",children:"You may close this page now."})]})}function S(){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(o.Z,{sx:b.iconPicture(u.Z.extendedPalette.red),children:(0,Z.jsx)(g.Z,{sx:{fontSize:u.Z.spacing(6)}})}),(0,Z.jsx)(a.Z,{variant:"h2",textAlign:"center",children:"This link is no longer valid"}),(0,Z.jsx)(a.Z,{variant:"button",color:u.Z.palette.grey[500],textAlign:"center",children:"This link has expired because it has been more than 12 hours since it was sent. Please contact your Care Collaborator."}),(0,Z.jsx)(a.Z,{variant:"button",color:u.Z.palette.grey[500],textAlign:"center",children:"You may close this page now."})]})}var b={mainContainer:(0,r.Z)({padding:u.Z.spacing(4,0)},u.Z.breakpoints.down("md"),{flex:1,padding:u.Z.spacing(2)}),iconPicture:function(e){return{backgroundColor:e,width:u.Z.spacing(12),height:u.Z.spacing(12)}},contentContainer:(0,r.Z)({gap:u.Z.spacing(2),alignItems:"center",display:"flex",flexDirection:"column"},u.Z.breakpoints.up("md"),{maxWidth:"".concat(u.Z.spacing(50)," !important")})}},86606:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/payment/add",function(){return n(44386)}])}},function(e){e.O(0,[9101,9774,2888,179],(function(){return t=86606,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.