PageSourceSearch

https://app.findalto.com/_next/static/chunks/pages/admin/users/[userId]/billing-74be1a7eaee8db59.js

js findalto.com collected 2026-10-06 05:39:39 UTC 27,208 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2773],{41899:function(e,t,n){"use strict";var r=n(91941);t.Z=void 0;var i=r(n(64938)),o=n(85893),a=(0,i.default)((0,o.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}),"ContentCopy");t.Z=a},4600:function(e,t,n){"use strict";var r=n(91941);t.Z=void 0;var i=r(n(64938)),o=n(85893),a=(0,i.default)((0,o.jsx)("path",{d:"M12.5 6.9c1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-.39.08-.75.21-1.1.36l1.51 1.51c.32-.08.69-.13 1.09-.13zM5.47 3.92 4.06 5.33 7.5 8.77c0 2.08 1.56 3.22 3.91 3.91l3.51 3.51c-.34.49-1.05.91-2.42.91-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c.96-.18 1.83-.55 2.46-1.12l2.22 2.22 1.41-1.41L5.47 3.92z"}),"MoneyOffOutlined");t.Z=a},10547:function(e,t,n){"use strict";var r=n(91941);t.Z=void 0;var i=r(n(64938)),o=n(85893),a=(0,i.default)((0,o.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"RefreshOutlined");t.Z=a},70824:function(e,t,n){"use strict";var r=n(91941);t.Z=void 0;var i=r(n(64938)),o=n(85893),a=(0,i.default)((0,o.jsx)("path",{d:"M15 4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6zM3 12c0-2.61 1.67-4.83 4-5.65V4.26C3.55 5.15 1 8.27 1 12s2.55 6.85 6 7.74v-2.09c-2.33-.82-4-3.04-4-5.65z"}),"TollOutlined");t.Z=a},23258:function(e,t){"use strict";t.Z=function(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout((()=>{e.apply(this,r)}),t)}return r.clear=()=>{clearTimeout(n)},r}},29645:function(e,t,n){"use strict";n.d(t,{HE:function(){return m},Z6:function(){return f},fJ:function(){return h},vt:function(){return b}});var r,i,o,a,s=n(71383),c=n(50456),l=n(55293),d=n(67294),u=n(56070),p=(0,c.gql)(r||(r=(0,s.Z)(["\n\tquery GetUserCreditBalances($userId: String, $showAllCreditTypes: Boolean) {\n\t\tgetUserCreditBalances(userId: $userId, showAllCreditTypes: $showAllCreditTypes) {\n\t\t\tcreditType\n\t\t\thold\n\t\t\ttotalBalance\n\t\t}\n\t}\n"])));function h(e,t){var n,r=(0,l.d)(p,{variables:{userId:e,showAllCreditTypes:t},fetchPolicy:"cache-and-network",skip:!e}),i=r.data,o=r.loading,a=r.error,s=r.refetch,c=(0,d.useCallback)((function(){s().catch((function(e){u.Z.error("Error refetching user credit balances",500,e)}))}),[s]);return{userCreditBalancesLoading:o,userCreditBalances:null!==(n=null===i||void 0===i?void 0:i.getUserCreditBalances)&&void 0!==n?n:[],userCreditBalancesError:a?"Could not retrieve credit balance.":null,userCreditBalancesRefetch:c}}var v=(0,c.gql)(i||(i=(0,s.Z)(["\n\tquery GetUserCreditEntries($userId: String!) {\n\t\tgetUserCreditEntries(userId: $userId) {\n\t\t\tid\n\t\t\tcreatedAt\n\t\t\tcreatedById\n\t\t\tuserId\n\t\t\ttransactionId\n\t\t\tdescription\n\t\t\tinternalNotes\n\t\t\tamount\n\t\t\tcreator {\n\t\t\t\tid\n\t\t\t\tfirstname\n\t\t\t\tlastname\n\t\t\t}\n\t\t\tcreditType\n\t\t}\n\t}\n"])));function m(e){var t,n=(0,l.d)(v,{variables:{userId:e.userId},skip:e.skip,fetchPolicy:"cache-and-network"}),r=n.data,i=n.loading,o=n.error;return{entriesLoading:i,entries:null!==(t=null===r||void 0===r?void 0:r.getUserCreditEntries)&&void 0!==t?t:[],entriesError:o?"There was an unexpected error get credit entires.":null}}var g=(0,c.gql)(o||(o=(0,s.Z)(["\n\tquery GetCreditEntriesByTransactionId($transactionId: String!) {\n\t\tgetCreditEntriesByTransactionId(transactionId: $transactionId) {\n\t\t\tamount\n\t\t\tcreditType\n\t\t}\n\t}\n"])));function f(e){var t,n=e.transactionId,r=e.skip,i=(0,l.d)(g,{variables:{transactionId:n},skip:r,fetchPolicy:"cache-and-network"}),o=i.data,a=i.loading,s=i.error;return{entriesLoading:a,entries:null!==(t=null===o||void 0===o?void 0:o.getCreditEntriesByTransactionId)&&void 0!==t?t:[],entriesError:s?"There was an unexpected error get credit entires.":null}}var y=(0,c.gql)(a||(a=(0,s.Z)(["\n\tquery GetUserSubscriptionPayments($input
1: GetUserSubscriptionPaymentsInput!) {\n\t\tgetUserSubscriptionPayments(input: $input) {\n\t\t\tid\n\t\t\tcreatedAt\n\t\t\tSubscription {\n\t\t\t\tid\n\t\t\t\tstartTime\n\t\t\t\tendTime\n\t\t\t\tsubscriptionPlan\n\t\t\t\ttaxedProvinceState\n\t\t\t\tsubTotal\n\t\t\t\tgstAmount\n\t\t\t\tpstAmount\n\t\t\t\thstAmount\n\t\t\t\ttotalAmount\n\t\t\t}\n\t\t\tpaymentStatus\n\t\t}\n\t}\n"])));function b(e,t){var n,r=(0,l.d)(y,{variables:{input:{userId:e,bookingBetween:t}},fetchPolicy:"cache-and-network"}),i=r.data,o=r.loading,a=r.error;return{loading:o,userSubscriptionPayments:null!==(n=null===i||void 0===i?void 0:i.getUserSubscriptionPayments)&&void 0!==n?n:[],error:a}}},60377:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(36822),i=n(15861),o=n(86421),a=n(85893);function s(e){var t=e.title,n=e.description;return(0,a.jsxs)(r.Z,{mb:4,children:[(0,a.jsx)(i.Z,{variant:"h3",children:t}),n&&(0,a.jsx)(i.Z,{variant:"body2",sx:{color:o.Z.palette.grey[500]},marginTop:.5,children:n})]})}},92052:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(15861),i=n(69661),o=n(36822),a=n(86421),s=(n(67294),n(9077)),c=n(4600),l=n(52049),d=n(86131),u=n(66656),p=n(85893);function h(e){var t=e.amount,n=e.description,h=e.entryDate,m=e.createdBy,g=e.creditType,f=e.internalNote,y=t>0?"+".concat((0,l.cS)(t)):(0,l.cS)(t);return(0,p.jsxs)(o.Z,{sx:v.entryContainer,children:[(0,p.jsx)(i.Z,{sx:v.avatar,children:null!==n&&void 0!==n&&n.includes("Booking")?(0,p.jsx)(u.Z,{}):t>0?(0,p.jsx)(s.Z,{}):(0,p.jsx)(c.Z,{})}),(0,p.jsxs)(o.Z,{flex:1,children:[(0,p.jsxs)(o.Z,{sx:v.innerContentBox,children:[(0,p.jsx)(r.Z,{variant:"button",color:a.Z.palette.grey[900],children:n}),(0,p.jsxs)(r.Z,{variant:"body2",color:a.Z.palette.grey[500],children:[(0,l.p6)(h,"PP"),"\xa0",m&&"by ".concat(m)]})]}),f&&(0,p.jsx)(o.Z,{sx:v.innerContentBox,children:(0,p.jsx)(r.Z,{variant:"body2",color:a.Z.palette.grey[500],children:f})})]}),(0,p.jsxs)(o.Z,{sx:v.moneyFrame,children:[g&&(0,p.jsx)(r.Z,{variant:"body2",fontWeight:500,children:(0,d.i$)(g)}),(0,p.jsx)(r.Z,{variant:"body2",color:a.Z.palette.grey[500],children:y})]})]})}var v={entryContainer:{width:"100%",display:"flex",alignItems:"top",padding:a.Z.spacing(1.25,0),gap:1,borderBottom:"1px solid ".concat(a.Z.palette.grey[200])},avatar:{marginTop:a.Z.spacing(1),backgroundColor:a.Z.palette.grey[200],border:"1px ".concat(a.Z.palette.info.main),color:a.Z.palette.common.black},innerContentBox:{padding:a.Z.spacing(1)},moneyFrame:{textAlign:"right",padding:a.Z.spacing(1,0,1,1)}}},27500:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Ue}});var r=n(59499),i=n(67294),o=n(29565),a=n(11163),s=n(20197),c=n(28147),l=n(83892),d=n(10694),u=n(13104),p=n(5792),h=n(59889),v=n(89854),m=n(19796),g=n(47157),f=n(7165),y=n(60377),b=n(67720),j=n(69417),x=n(36822),O=n(15861),Z=n(72498),P=n(64666),S=n(6514),C=n(37645),E=n(29645),D=n(42609),I=n(86421),T=n(66793),w=n(92052),B=n(85893);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){var t=e.open,n=e.onClose,r=e.selectedUserId,i=(0,T.K)().isMobileOrTablet,o=(0,E.HE)({userId:r,skip:!t}).entries;return(0,B.jsxs)(P.Z,{open:t,onClose:n,fullScreen:i,PaperProps:{sx:A.mainContainer},children:[(0,B.jsxs)(C.Z,{sx:A.titleContainer,children:[(0,B.jsx)(O.Z,{component:"span",variant:"h5",children:"Credits History"}),(0,B.jsx)(O.Z,{variant:"body2",color:I.Z.palette.grey[500],letterSpacing:0,children:"Past credits on this user."})]}),(0,B.jsxs)(S.Z,{sx:A.contentContainer,children:[!o.length&&(0,B.jsx)(O.Z,{variant:"body2",color:I.Z.palette.grey[500],letterSpacing:0,mx:"auto",my:16,children:"No credit history found."}),!!o.length&&(0,B.jsxs)(B.Fragment,{children:[o.map((function(e,t){var n,r;return(0,B.jsx)(w.Z,{userId:e.userId,entryDate:e.createdAt,amount:e.amount,description:null!==(n=e.description)&&void 0!==n?n:null,createdBy:e.createdById===D.d.Server.getAltoBotUserId()?"System.":"".concat(e.creator.firstname," ").concat(e.creator.lastname,"."),creditType:e.creditType,internalNote:null!==(r=e.internalNotes)&&void 0!==r?r:""},t)})),(0,B.jsx)(O.Z,{variant:"body2",color:I.Z.palette.grey[500],mx:"auto",mt:2,children:"That's all."})]})]})]})}var A={mainContainer:(0,r.Z)({borderRadius:I.Z.spacing(1),border:"1px solid ".concat(I.Z.palette.grey[200]),backgroundColor:I.Z.palette.grey[50],padding:3,gap:2,display:"flex",flexDirection:"column"},I.Z.breakpoints.up("md"),{width:I.Z.spacing(90),maxWidth:I.Z.spacing(90)}),titleContainer:{padding:0},contentContainer:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?k(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({display:"flex",flexDirection:"column",padding:0},I.Z.noScrollBar)},F=n(61531),U=n(72143),q=n(52049),R=n(86131),_=n(93681),V=n(97720);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var H=[u.LE.Invoiced],L=[u.LE.NegativeExperience,u.LE.Marketing,u.LE.Liability];function X(e){var t=e.selectedUserId,n=e.loggedInAdmin,o=e.invoicedAccountType,a=(0,i.useState)({viewHistory:!1,editCredit:!1}),s=a[0],c=a[1],l=(0,i.useState)(void 0),d=l[0],h=l[1],v=(0,E.fJ)(t,!0),m=v.userCreditBalances,g=v.userCreditBalancesLoading,f=v.userCreditBalancesError,y=v.userCreditBalancesRefetch,b=function(e){c((function(t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t);return n[e]=!(0,_.$s)(s,e),n}))},P=(0,i.useCallback)((function(e){var t=o===u.T7.NonInvoiced?H:L;return e.filter((function(e){return!t.includes(e.creditType)||e.totalBalance>50}))}),[o]);return(0,B.jsx)(F.Z,{label:"Credits",hint:"User credits available",children:(0,B.jsxs)(V.Z,{isLoading:g,isError:!!f,children:[(0,B.jsxs)(x.Z,{sx:z.creditsFrame,children:[(0,B.jsx)(x.Z,{children:!!m.length&&(0,B.jsxs)(B.Fragment,{children:[P(m).map((function(e,t){return(0,B.jsx)(G,{title:(0,R.i$)(e.creditType),total:e.totalBalance,hold:e.hold,onEditClick:function(){return t=e.creditType,h(t),void b("editCredit");var t},disableEdit:e.creditType===u.LE.Liability&&!(0,p.j5)(n.roles)},t)})),(0,B.jsx)(O.Z,{children:"Updated ".concat((0,q.p6)((0,U.oK)(),"PP"))})]})}),(0,B.jsx)(x.Z,{display:"flex",gap:2,children:(0,B.jsx)(j.Z,{variant:"outlined",onClick:function(){return b("viewHistory")},children:"View History"})})]}),!!m.length&&!!d&&(0,B.jsx)(Z.Z,{open:s.editCredit,onClose:function(){h(void 0),b("editCredit")},creditBalances:m,userId:t,loggedInAdminFullName:(0,q.BD)(n.firstname,n.lastname),creditTypeToModify:d,invoicedAccountType:o,userCreditBalancesRefetch:y}),(0,B.jsx)(N,{open:s.viewHistory,onClose:function(){return b("viewHistory")},selectedUserId:t})]})})}function G(e){var t=e.title,n=e.total,r=e.hold,i=e.onEditClick,o=e.disableEdit;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(x.Z,{children:[(0,B.jsx)(O.Z,{variant:"h6",children:t}),(0,B.jsxs)(O.Z,{children:["Available:",(0,B.jsx)(O.Z,{component:"span",fontWeight:600,children:" ".concat((0,q.cS)(n))})]}),r>0&&(0,B.jsx)(O.Z,{children:"".concat((0,q.cS)(r)," on hold")}),!o&&(0,B.jsx)(j.Z,{sx:{mt:1},variant:"outlined",onClick:i,children:"Edit"})]}),(0,B.jsx)(b.Z,{sx:{marginY:2}})]})}var z={creditsFrame:{display:"flex",flexDirection:"column",gap:I.Z.spacing(1)},historySection:{overflowY:"scroll"}},$=n(93946),J=n(77026),W=n(41899),Y=n(31812);function K(e){var t=e.selectedUserId,n=e.userInvoiceType,r=(0,o.cV)(),a=(0,i.useState)(),s=a[0],c=a[1],u=(0,i.useState)(!1),p=u[0],h=u[1],v=(0,l.wk)();return(0,B.jsx)(F.Z,{label:"Payment Methods",hint:"Accept Credit or Debit card",children:(0,B.jsxs)(x.Z,{children:[(0,B.jsx)(J.Z,{userId:t,enableDeleteCard:!0,userInvoiceType:n}),(0,B.jsx)(O.Z,{variant:"h6",marginTop:2,children:"Generate Credit Card Capture Link"}),!s&&(0,B.jsx)(Y.Z,{variant:"outlined",onClick:function(){h(!0),v(t).then((function(e){if(h(!1),e&&e.adminGenerateAddingPaymentMethodToken){var t="".concat(D.d.Public.getAppUrl()).concat(m.nB.Payment.Add,"?token=").concat(e.adminGenerateAddingPaymentMethodToken);navigator.clipboard.writeText(t).then((function(){return r.info("Payment capture link has been copied to clipboard.")})),c(t)}})).catch((function(){h(!1),r.error(d.XO.UNEXPECTED_ERROR_TRY_AGAIN)}))},loading:p,sx:{marginTop:I.Z.spacing(1)},children:"Generate"}),s&&(0,B.jsxs)(x.Z,{display:"flex",gap:1,alignItems:"center",children:[(0,B.jsx)(O.Z,{variant:"button",children:s}),(0,B.jsx)($.Z,{onClick:function(){s&&navigator.clipboard.writeText(s).then((function(){return r.info("Payment capture link has been copied to clipboard.")}))},children:(0,B.jsx)(W.Z,{})})]})]})})}var Q=n(53457),ee=n(50480),te=n(69368);function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ne(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ie(e){var t=e.taxExemptDetails,n=e.onUpdateTaxExempt,o=e.isSubmitting,a=(0,i.useState)(t),s=a[0],c=a[1],l=(0,i.useState)(!1),d=l[0],u=l[1],p=function(e){c((function(t){return re(re({},t),{},(0,r.Z)({},e,!t[e]))})),d||u(!0)};return(0,B.jsx)(F.Z,{label:"Tax Exemptions",children:(0,B.jsxs)(x.Z,{children:[(0,B.jsxs)(Q.Z,{sx:{gap:1,marginBottom:2},children:[(0,B.jsx)(ee.Z,{control:(0,B.jsx)(te.Z,{checked:s.gstExempt,onChange:function(){return p("gstExempt")}}),label:"GST Exempt"}),(0,B.jsx)(ee.Z,{control:(0,B.jsx)(te.Z,{checked:s.pstExempt,onChange:function(){return p("pstExempt")}}),label:"PST Exempt"}),(0,B.jsx)(ee.Z,{control:(0,B.jsx)(te.Z,{checked:s.hstExempt,onChange:function(){return p("hstExempt")}}),label:"HST Exempt"})]}),(0,B.jsx)(Y.Z,{variant:"contained",disabled:!d,loading:o,onClick:function(){return n(s)},children:"Save"})]})})}var oe=n(74231),ae=n(95496),se=n(87536),ce=n(9970);function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ue=oe.Ry().shape({childFamilyServicesSk:oe.O7(),cognitiveDisabilityStrategy:oe.O7(),individualizedFunding:oe.O7(),socialServices:oe.O7(),veteransAffairs:oe.O7(),jordansPrinciple:oe.O7(),assuredIncomeSeverelyHandicapped:oe.O7(),childFamilyServicesAb:oe.O7(),clientDirectedHomeCareInvoicingProgramBlueCross:oe.O7(),familySupportChildrenDisabilities:oe.O7(),personDevelopmentalDisabilities:oe.O7(),selfManagedCare:oe.O7()});function pe(e,t){return!!t&&t.includes(e)}function he(e){var t=e.userProfile,n=e.onUpdateGovernmentFunding,r=e.isSubmitting,i=(0,se.cI)({defaultValues:{childFamilyServicesSk:pe(u.Nq.ChildFamilyServicesSk,t.governmentFunding),cognitiveDisabilityStrategy:pe(u.Nq.CognitiveDisabilityStrategy,t.governmentFunding),individualizedFunding:pe(u.Nq.IndividualizedFunding,t.governmentFunding),socialServices:pe(u.Nq.SocialServices,t.governmentFunding),veteransAffairs:pe(u.Nq.VeteransAffairs,t.governmentFunding),jordansPrinciple:pe(u.Nq.JordansPrinciple,t.governmentFunding),assuredIncomeSeverelyHandicapped:pe(u.Nq.AssuredIncomeSeverelyHandicapped,t.governmentFunding),childFamilyServicesAb:pe(u.Nq.ChildFamilyServicesAb,t.governmentFunding),clientDirectedHomeCareInvoicingProgramBlueCross:pe(u.Nq.ClientDirectedHomeCareInvoicingProgramBlueCross,t.governmentFunding),familySupportChildrenDisabilities:pe(u.Nq.FamilySupportChildrenDisabilities,t.governmentFunding),personDevelopmentalDisabilities:pe(u.Nq.PersonDevelopmentalDisabilities,t.governmentFunding),selfManagedCare:pe(u.Nq.SelfManagedCare,t.governmentFunding)},resolver:(0,ae.X)(ue)});return(0,B.jsx)(se.RV,de(de({},i),{},{children:(0,B.jsx)("form",{onSubmit:i.handleSubmit((function(e){var t=function(e){var t=[];return e.assuredIncomeSeverelyHandicapped&&t.push(u.Nq.AssuredIncomeSeverelyHandicapped),e.childFamilyServicesAb&&t.push(u.Nq.ChildFamilyServicesAb),e.childFamilyServicesSk&&t.push(u.Nq.ChildFamilyServicesSk),e.clientDirectedHomeCareInvoicingProgramBlueCross&&t.push(u.Nq.ClientDirectedHomeCareInvoicingProgramBlueCross),e.cognitiveDisabilityStrategy&&t.push(u.Nq.CognitiveDisabilityStrategy),e.familySupportChildrenDisabilities&&t.push(u.Nq.FamilySupportChildrenDisabilities),e.individualizedFunding&&t.push(u.Nq.IndividualizedFunding),e.personDevelopmentalDisabilities&&t.push(u.Nq.PersonDevelopmentalDisabilities),e.selfManagedCare&&t.push(u.Nq.SelfManagedCare),e.socialServices&&t.pu
1sh(u.Nq.SocialServices),e.veteransAffairs&&t.push(u.Nq.VeteransAffairs),e.jordansPrinciple&&t.push(u.Nq.JordansPrinciple),t}(e);n(t)})),children:(0,B.jsxs)(F.Z,{label:"Government Funding",hint:"Select all that may apply.",children:[(0,B.jsxs)(Q.Z,{sx:{gap:1,marginBottom:2},children:[(0,B.jsx)(O.Z,{fontWeight:600,children:"Federal"}),(0,B.jsx)(ce.Z,{name:"veteransAffairs",label:(0,R.VB)(u.Nq.VeteransAffairs)}),(0,B.jsx)(ce.Z,{name:"jordansPrinciple",label:(0,R.VB)(u.Nq.JordansPrinciple)})]}),(0,B.jsxs)(Q.Z,{sx:{gap:1,marginBottom:2},children:[(0,B.jsx)(O.Z,{fontWeight:600,children:"Saskatchewan"}),(0,B.jsx)(ce.Z,{name:"childFamilyServicesSk",label:(0,R.VB)(u.Nq.ChildFamilyServicesSk)}),(0,B.jsx)(ce.Z,{name:"cognitiveDisabilityStrategy",label:(0,R.VB)(u.Nq.CognitiveDisabilityStrategy)}),(0,B.jsx)(ce.Z,{name:"individualizedFunding",label:(0,R.VB)(u.Nq.IndividualizedFunding)}),(0,B.jsx)(ce.Z,{name:"socialServices",label:(0,R.VB)(u.Nq.SocialServices)})]}),(0,B.jsxs)(Q.Z,{sx:{gap:1},children:[(0,B.jsx)(O.Z,{fontWeight:600,children:"Alberta"}),(0,B.jsx)(ce.Z,{name:"assuredIncomeSeverelyHandicapped",label:(0,R.VB)(u.Nq.AssuredIncomeSeverelyHandicapped)}),(0,B.jsx)(ce.Z,{name:"childFamilyServicesAb",label:(0,R.VB)(u.Nq.ChildFamilyServicesAb)}),(0,B.jsx)(ce.Z,{name:"clientDirectedHomeCareInvoicingProgramBlueCross",label:(0,R.VB)(u.Nq.ClientDirectedHomeCareInvoicingProgramBlueCross)}),(0,B.jsx)(ce.Z,{name:"familySupportChildrenDisabilities",label:(0,R.VB)(u.Nq.FamilySupportChildrenDisabilities)}),(0,B.jsx)(ce.Z,{name:"personDevelopmentalDisabilities",label:(0,R.VB)(u.Nq.PersonDevelopmentalDisabilities)}),(0,B.jsx)(ce.Z,{name:"selfManagedCare",label:(0,R.VB)(u.Nq.SelfManagedCare)})]}),(0,B.jsx)(Y.Z,{variant:"contained",type:"submit",sx:{width:I.Z.spacing(10)},disabled:!i.formState.isDirty,loading:r,children:"Save"})]})})}))}var ve=n(50135),me=n(30990),ge=n(15764),fe=n(54295),ye=n(83270);function be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?be(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xe(e){var t=e.selectedUserId,n=(0,o.cV)(),r=(0,i.useState)(!1),a=r[0],s=r[1],c=(0,ye.in)(t),l=c.userInvoicePaymentChoice,p=c.userInvoicePaymentChoiceLoading,h=c.userInvoicePaymentChoiceError,v=c.userInvoicePaymentChoiceRefetch,m=(0,fe.lD)();return(0,B.jsx)(F.Z,{label:"Invoice Payment Choices",hint:"Usual invoice payment method.",children:(0,B.jsx)(V.Z,{isLoading:p,isError:!!h,ErrorComponent:(0,B.jsx)(O.Z,{variant:"body2",color:I.Z.palette.grey[500],mb:1,children:"There was an issue loading this user's invoice payment choice."}),children:(0,B.jsx)(x.Z,{width:I.Z.spacing(30),children:(0,B.jsx)(Ze,{userInvoicePaymentChoice:l,isSubmitting:a,onFormSubmit:function(e){s(!0),m({userId:t,usualPaymentMethodType:e.invoicePaymentMethodType,note:e.invoicePaymentMethodType===u.J3.Other?e.note:void 0}).then((function(){n.success("The User's invoice payment method was updated."),s(!1),v()})).catch((function(e){e instanceof me.c?(0,d.rv)(e).forEach((function(e){n.error(e)})):n.error(d.XO.UNEXPECTED_ERROR_TRY_AGAIN);s(!1)}))}})})})})}var Oe=oe.Ry().shape({invoicePaymentMethodType:oe.Z_().required("required"),note:oe.Z_().optional().when("invoicePaymentMethodType",{is:"OTHER",then:oe.Z_().required("required")})});function Ze(e){var t,n,r,i=e.userInvoicePaymentChoice,o=e.isSubmitting,a=e.onFormSubmit,s=(0,se.cI)({resolver:(0,ae.X)(Oe),defaultValues:{invoicePaymentMethodType:null===i||void 0===i?void 0:i.usualPaymentMethodType,note:null!==(t=null===i||void 0===i?void 0:i.note)&&void 0!==t?t:void 0}});return(0,B.jsx)(se.RV,je(je({},s),{},{children:(0,B.jsxs)("form",{onSubmit:s.handleSubmit(a),children:[(0,B.jsxs)(x.Z,{sx:Pe.formContainer,children:[(0,B.jsx)(ge.Z,{label:i?void 0:"Please select the usual payment method",name:"invoicePaymentMethodType",options:Se,emptyOptionLabel:"Select one...",disabled:o}),s.watch("invoicePaymentMethodType")===u.J3.Other&&(0,B.jsx)(ve.Z,je(je({label:"Enter note for this payment method",placeholder:"",fullWidth:!0},s.register("note")),{},{error:!!s.formState.errors.note,helperText:s.formState.errors.note&&(null===(n=s.formState.errors)||void 0===n||null===(r=n.note)||void 0===r?void 0:r.message),disabled:o||s.watch("invoicePaymentMethodType")!==u.J3.Other}))]}),(0,B.jsx)(j.Z,{variant:"contained",type:"submit",disabled:o||!s.formState.isDirty,children:"Save"})]})}))}var Pe={formContainer:{display:"flex",flexDirection:"column",gap:2,marginBottom:2}},Se=Object.values(u.J3).map((function(e){return{label:(0,R.l7)(e),value:e}}
1)),Ce=n(86895),Ee=n(5165),De=n(39209);function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var we=oe.Ry().shape({invoiceBookingBlocked:oe.nK().required("required").oneOf(Ee.dU,"required")});function Be(e){var t=e.selectedUser,n=e.isSubmitting,r=e.onUpdateInvoiceBookingBlocked,i=(0,se.cI)({resolver:(0,ae.X)(we),defaultValues:{invoiceBookingBlocked:(0,De.pK)(t.invoiceBookingBlocked)}});return(0,B.jsx)(F.Z,{label:"Flag the user",hint:"When turned on, this user will be blocked from new bookings.",children:(0,B.jsx)(se.RV,Te(Te({},i),{},{children:(0,B.jsxs)("form",{onSubmit:i.handleSubmit((function(e){var t=(0,De.pQ)(e.invoiceBookingBlocked);r(t)})),children:[(0,B.jsx)(Ce.Z,{name:"invoiceBookingBlocked",options:Ee.h$}),(0,B.jsx)(j.Z,{variant:"contained",type:"submit",disabled:n||!i.formState.isDirty,children:"Save"})]})}))})}var ke=n(59166);function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fe(e){var t=e.user,n=(0,o.cV)(),r=(0,a.useRouter)(),b=(0,s.O_)("userId",r.query),j=(0,i.useState)(!1),x=j[0],O=j[1],Z=(0,c.m5)(b),P=Z.user,S=Z.userLoading,C=Z.userFetchError,E=Z.userRefetch,D=(0,l.dR)();return(0,B.jsx)(V.Z,{isLoading:S,isError:!!C,children:!P||(0,p.wQ)(P.roles)?(0,B.jsx)(h.Z,{}):(0,B.jsxs)(v.Z,{goBackPath:m.nB.Admin.Users.Root,goBackText:"All Users",authUser:t,selectedUser:P,tabRoutes:(0,g.Qk)(P.id),PageActionBar:(0,B.jsx)(f.Z,{selectedUser:P}),children:[(0,B.jsx)(y.Z,{title:"Billing",description:"User billing, funding, payment methods and credits."}),(0,B.jsx)(X,{selectedUserId:P.id,loggedInAdmin:t,invoicedAccountType:P.invoicedAccountType}),(0,B.jsx)(K,{selectedUserId:P.id,userInvoiceType:P.invoicedAccountType}),(0,B.jsx)(ie,{taxExemptDetails:{gstExempt:P.gstExempt,pstExempt:P.pstExempt,hstExempt:P.hstExempt},onUpdateTaxExempt:function(e){if(P){var t={userId:P.id,adminUserUpdateDetails:Ae({},e)};O(!0),D(t).then((function(){n.success("The user's tax exemption details was updated."),O(!1),E()})).catch((function(){n.error(d.XO.UNEXPECTED_ERROR_TRY_AGAIN),O(!1)}))}else n.error(d.XO.UNEXPECTED_ERROR_RELOAD)},isSubmitting:x}),(0,B.jsx)(he,{userProfile:P,onUpdateGovernmentFunding:function(e){if(P){var t={userId:P.id,adminUserUpdateDetails:{UserGovernmentFunding:e}};O(!0),D(t).then((function(){n.success("The user's government funding was updated."),O(!1),E()})).catch((function(){n.error(d.XO.UNEXPECTED_ERROR_TRY_AGAIN),O(!1)}))}else n.error(d.XO.UNEXPECTED_ERROR_RELOAD)},isSubmitting:x}),P.invoicedAccountType!==u.T7.NonInvoiced&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(xe,{selectedUserId:P.id}),(0,B.jsx)(Be,{selectedUser:P,isSubmitting:x,onUpdateInvoiceBookingBlocked:function(e){if(P){var t={userId:P.id,adminUserUpdateDetails:{invoiceBookingBlocked:e}};O(!0),D(t).then((function(){n.success("The user's flag was updated."),O(!1),E()})).catch((function(){n.error(d.XO.UNEXPECTED_ERROR_TRY_AGAIN),O(!1)}))}else n.error(d.XO.UNEXPECTED_ERROR_RELOAD)}})]}),(0,B.jsx)(ke.Z,{})]})})}function Ue(e){var t=e.user;return(0,B.jsx)(Fe,{user:t})}},56467:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/users/[userId]/billing",function(){return n(27500)}])}},function(e){e.O(0,[5846,9101,4740,7165,7026,9187,7765,9774,2888,179],(function(){return t=56467,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.