PageSourceSearch

https://app.findalto.com/_next/static/chunks/pages/admin/users/[userId]/credentials-1cdf3e75b52dca00.js

js findalto.com collected 2026-10-06 05:39:46 UTC 17,028 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5876],{65790:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return be}});var t=n(11163),i=n(19796),o=n(5792),a=n(20197),c=n(28147),l=n(89854),s=n(47157),d=n(7165),u=n(36822),f=n(15861),g=n(59499),p=n(90440),v=n(86421),h=n(34685),m=n(86131),j=n(13104),b=n(59698);function y(e){return e.filter((function(e){return b.Yn.includes(e.caregiverCredentialType)}))}function P(e){return e.filter((function(e){return b.OK.includes(e.caregiverCredentialType)}))}function x(e){return e.filter((function(e){return b.i4.includes(e.caregiverCredentialType)}))}function O(e){return e.filter((function(e){return e.caregiverCredentialType===j.nk.BondedInsured}))}var C=n(56815),D=n(29703),Z=n(29565),w=n(84376),I=n(95496),T=n(70637),E=n(10694),S=n(67294),U=n(87536),F=n(77489),_=n(85893);function R(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function N(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?R(Object(n),!0).forEach((function(r){(0,g.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function V(e){var r=e.caregiverProfileId,n=e.caregiverCredentialProofs,t=e.drawerOpen,i=e.onDrawerClose,o=(0,Z.cV)(),a=(0,S.useState)(!1),c=a[0],l=a[1],s=(0,U.cI)({defaultValues:{credentialProofs:b.Yn.map((function(e){return{credentialProofUrl:"",caregiverCredentialType:e}}))},resolver:(0,I.X)(F.pX)}),d=(0,T.ZB)(),g=(0,U.Dq)({control:s.control,name:"credentialProofs"}).fields;return(0,_.jsx)(D.Z,{title:"Vetting Process Documents",open:t,onClose:function(){s.reset(),i({refetchData:!1})},onCancel:function(){s.reset(),i({refetchData:!1})},onSubmit:s.handleSubmit((function(e){var t={caregiverProfileId:r,credentialProofsDetails:(0,F.GN)(n,e)};l(!0),d(t).then((function(){o.success("Caregiver document(s) updated successfully."),l(!1),i({refetchData:!0})})).catch((function(){o.error(E.XO.UNEXPECTED_ERROR_TRY_AGAIN),l(!1)}))})),submitDisabled:!s.formState.isDirty,isSubmitting:c,children:(0,_.jsxs)(U.RV,N(N({},s),{},{children:[(0,_.jsx)(f.Z,{mb:4,variant:"button",component:"p",children:"Vetting Process Documents"}),(0,_.jsx)(u.Z,{display:"flex",flexDirection:"column",gap:3,children:g.map((function(e,r){return(0,_.jsx)(k,{credentialType:e.caregiverCredentialType,index:r},e.caregiverCredentialType)}))})]}))})}function k(e){var r=e.index,n=e.credentialType,t=(0,U.Gc)().control;return(0,_.jsxs)(u.Z,{sx:B.credentialContainer,children:[(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[700],fontWeight:500,children:(0,m.Li)(n)}),(0,_.jsx)(U.Qr,{name:"credentialProofs.".concat(r,".credentialProofUrl"),control:t,render:function(e){var r=e.field.onChange,n=e.fieldState.error;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(w.Z,{clearable:!0,size:"small",onChange:function(e){e&&r(e)}}),n&&(0,_.jsx)(C.Z,{error:!0,children:n.message})]})}})]})}var B={credentialContainer:{display:"flex",flexDirection:"column",gap:1}},A=n(93681);function X(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function G(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?X(Object(n),!0).forEach((function(r){(0,g.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function L(e){var r=e.caregiverProfileId,n=e.caregiverCredentialProofs,t=e.drawerOpen,i=e.onDrawerClose,o=(0,Z.cV)(),a=(0,S.useState)(!1),c=a[0],l=a[1],s=(0,U.cI)({defaultValues:{credentialProofs:b.OK.map((function(e){return{credentialProofUrl:"",caregiverCredentialType:e}}
1))},resolver:(0,I.X)(F.pX)}),d=(0,U.Dq)({control:s.control,name:"credentialProofs"}).fields,g=(0,T.ZB)();return(0,_.jsx)(D.Z,{title:"Additional Training",open:t,onClose:function(){s.reset(),i({refetchData:!1})},onCancel:function(){s.reset(),i({refetchData:!1})},onSubmit:s.handleSubmit((function(e){var t={caregiverProfileId:r,credentialProofsDetails:(0,F.GN)(n,e)};l(!0),g(t).then((function(){o.success("Caregiver document(s) updated successfully."),l(!1),i({refetchData:!0})})).catch((function(){o.error(E.XO.UNEXPECTED_ERROR_TRY_AGAIN),l(!1)}))})),submitDisabled:!s.formState.isDirty,isSubmitting:c,children:(0,_.jsxs)(U.RV,G(G({},s),{},{children:[(0,_.jsx)(f.Z,{mb:4,variant:"button",component:"p",children:"Additional Certifications"}),(0,_.jsx)(u.Z,{display:"flex",flexDirection:"column",gap:3,children:d.map((function(e,r){return(0,_.jsx)(W,{credentialType:e.caregiverCredentialType,index:r},e.caregiverCredentialType)}))})]}))})}function W(e){var r=e.index,n=e.credentialType,t=(0,U.Gc)().control;return(0,_.jsxs)(u.Z,{sx:Y.credentialContainer,children:[(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[700],fontWeight:500,children:(0,m.Li)(n)}),(0,_.jsx)(U.Qr,{name:"credentialProofs.".concat(r,".credentialProofUrl"),control:t,render:function(e){var r=e.field.onChange,n=e.fieldState.error;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(w.Z,{clearable:!0,size:"small",onChange:function(e){e&&r(e)}}),n&&(0,_.jsx)(C.Z,{error:!0,children:n.message})]})}})]})}var Y={credentialContainer:{display:"flex",flexDirection:"column",gap:1}},q=n(50135),z=n(86895),K=n(5165),Q=n(74231);function $(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function H(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?$(Object(n),!0).forEach((function(r){(0,g.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var J=Q.Ry().shape({nurseCredential:Q.nK().oneOf(b.i4,"must select one"),documentId:Q.Z_().required("required")});function M(e){var r,n,t=e.caregiverProfileId,i=e.caregiverCredentialProofs,o=e.drawerOpen,a=e.onDrawerClose,c=(0,Z.cV)(),l=(0,S.useState)(!1),s=l[0],d=l[1],g=(0,U.cI)({defaultValues:{nurseCredential:void 0,credentialProofUrl:"",documentId:""},resolver:(0,I.X)(J)}),p=(0,T.ZB)();return(0,_.jsx)(D.Z,{title:"Nurse Credentials",open:o,onClose:function(){g.reset(),a({refetchData:!1})},onCancel:function(){g.reset(),a({refetchData:!1})},onSubmit:g.handleSubmit((function(e){var r={caregiverProfileId:t,credentialProofsDetails:i.map((function(e){return{credentialProofUrl:e.credentialProofUrl,caregiverCredentialType:e.caregiverCredentialType,documentId:e.documentId}})).filter((function(e){return!b.i4.includes(e.caregiverCredentialType)}))},n=r.credentialProofsDetails.find((function(r){return r.caregiverCredentialType===e.nurseCredential}));n?(n.credentialProofUrl=e.credentialProofUrl,n.documentId=e.documentId):r.credentialProofsDetails.push({caregiverCredentialType:e.nurseCredential,credentialProofUrl:e.credentialProofUrl,documentId:e.documentId}),d(!0),p(r).then((function(){c.success("Caregiver document(s) updated successfully."),d(!1),a({refetchData:!0})})).catch((function(){c.error(E.XO.UNEXPECTED_ERROR_TRY_AGAIN),d(!1)}))})),submitDisabled:!g.formState.isDirty,isSubmitting:s,children:(0,_.jsxs)(U.RV,H(H({},g),{},{children:[(0,_.jsx)(f.Z,{variant:"button",component:"p",children:"Nurse degree"}),(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[500],mb:4,children:"Select a set of skills."}),(0,_.jsxs)(u.Z,{display:"flex",flexDirection:"column",gap:3,children:[(0,_.jsx)(z.Z,{name:"nurseCredential",defaultValue:"",options:K.Ur,disabled:s}),(0,_.jsx)(ee,{}),(0,_.jsx)(q.Z,H(H({},g.register("documentId")),{},{label:"Registration number",fullWidth:!0,placeholder:"Number/ Identifier",error:!(null===(r=g.formState.errors)||void 0===r||!r.documentId),helperText:null===(n=g.formState.errors.documentId)||void 0===n?void 0:n.message,disabled:s}))]})]}))})}function ee(){var e=(0,U.Gc)().setValue;return(0,_.jsxs)(u.Z,{sx:re.credentialContainer,children:[(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[700],fontWeight:500,children:"Upload copy of degree"}),(0,_.jsx)(w.Z,{clearable:!0,size:"small",onChange:function(r){return e("credentialProofUrl",null!==r&&void 0!==r?r:"",{shouldValidate:!0,shouldTouch:!0})}})]})}var re={credentialContainer:{display:"flex",flexDirection:"column",gap:1}};function ne(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function te(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};
1r%2?ne(Object(n),!0).forEach((function(r){(0,g.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var ie=Q.Ry().shape({credentialProofUrl:Q.Z_().optional()});function oe(e){var r=e.caregiverProfileId,n=e.caregiverCredentialProofs,t=e.drawerOpen,i=e.onDrawerClose,o=(0,Z.cV)(),a=(0,S.useState)(!1),c=a[0],l=a[1],s=(0,U.cI)({defaultValues:{credentialProofUrl:""},resolver:(0,I.X)(ie)}),d=(0,T.ZB)();return(0,_.jsx)(D.Z,{title:"Bonding and Insurance",open:t,onClose:function(){s.reset(),i({refetchData:!1})},onCancel:function(){s.reset(),i({refetchData:!1})},onSubmit:s.handleSubmit((function(e){var t={caregiverProfileId:r,credentialProofsDetails:n.map((function(e){return{credentialProofUrl:e.credentialProofUrl,caregiverCredentialType:e.caregiverCredentialType,documentId:e.documentId}}))},a=t.credentialProofsDetails.find((function(e){return e.caregiverCredentialType===j.nk.BondedInsured}));a?a.credentialProofUrl=e.credentialProofUrl:t.credentialProofsDetails.push({caregiverCredentialType:j.nk.BondedInsured,credentialProofUrl:e.credentialProofUrl}),l(!0),d(t).then((function(){o.success("Caregiver document(s) updated successfully."),l(!1),i({refetchData:!0})})).catch((function(){o.error(E.XO.UNEXPECTED_ERROR_TRY_AGAIN),l(!1)}))})),submitDisabled:!s.formState.isDirty,isSubmitting:c,children:(0,_.jsxs)(U.RV,te(te({},s),{},{children:[(0,_.jsx)(f.Z,{mb:4,variant:"button",component:"p",children:"Bonding or Insurance"}),(0,_.jsx)(u.Z,{display:"flex",flexDirection:"column",gap:3,children:(0,_.jsx)(ae,{})})]}))})}function ae(){var e=(0,U.Gc)().setValue;return(0,_.jsxs)(u.Z,{sx:ce.credentialContainer,children:[(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[700],fontWeight:500,children:"Bonding or Insurance Docoument"}),(0,_.jsx)(w.Z,{clearable:!0,size:"small",onChange:function(r){return e("credentialProofUrl",null!==r&&void 0!==r?r:"",{shouldValidate:!0,shouldTouch:!0})}})]})}var ce={credentialContainer:{display:"flex",flexDirection:"column",gap:1}},le=n(97720);function se(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function de(e){var r=e.caregiverProfileId,n=(0,S.useState)({vettingDocumentsForm:!1,additionalTrainingsForm:!1,nurseCredentialsForm:!1,bondingInsuranceForm:!1}),t=n[0],i=n[1],o=(0,p.Uj)(r),a=o.caregiverCredentialProofs,c=o.caregiverCredentialProofsLoading,l=o.caregiverCredentialProofsFetchError,s=o.caregiverCredentialProofsRefetch,d=function(e){i((function(r){var n=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?se(Object(n),!0).forEach((function(r){(0,g.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}({},r);return n[e]=!(0,A.$s)(r,e),n}))};return(0,_.jsxs)(le.Z,{isLoading:c,isError:!!l,children:[(0,_.jsxs)(u.Z,{sx:ue.sectionsContainer,children:[(0,_.jsx)(f.Z,{variant:"h6",children:"Vetting Process Credentials"}),(0,_.jsxs)(h.Z,{title:"Vetting Process Documents",onEdit:function(){return d("vettingDocumentsForm")},hideDivider:!0,children:[!y(a).length&&(0,_.jsx)(ge,{isVetting:!0}),y(a).map((function(e,r){return(0,_.jsx)(fe,{credentialProof:e},r)}))]}),(0,_.jsx)(f.Z,{variant:"h6",children:"Other credentials"}),(0,_.jsxs)(h.Z,{title:"Additional Training",onEdit:function(){return d("additionalTrainingsForm")},children:[!P(a).length&&(0,_.jsx)(ge,{}),P(a).map((function(e,r){return(0,_.jsx)(fe,{credentialProof:e},r)}))]}),(0,_.jsxs)(h.Z,{title:"Nurse Credentials",onEdit:function(){return d("nurseCredentialsForm")},children:[!x(a).length&&(0,_.jsx)(ge,{}),x(a).map((function(e,r){return(0,_.jsxs)(u.Z,{mb:2,children:[(0,_.jsx)(fe,{credentialProof:e}),(0,_.jsxs)(u.Z,{children:[(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[700],fontWeight:500,children:"Document number"}),(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[500],children:e.documentId?e.documentId:"None"})]})]},r)}))]}),(0,_.jsxs)(h.Z,{title:"Bonding and Insurance",onEdit:function(){return d("bondingInsuranceForm")},hideDivider:!0,children:[!O(a).length&&(0,_.jsx)(ge,{}),O(a).map((function(e,r){return(0,_.jsxs)(u.Z,{mb:2,children:[(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[700],fontWeight:500,children:(0,m.Li)(e.caregiverCredentialType)}),(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[500],children:(0,_.jsx)("a",{href:e.credentialProofUrl,target:"_blank",style:{color:v.Z.palette.grey[500]},children:"Click to view the document"})})]},r)}))]})]}),t.vettingDocumentsForm&&(0,_.jsx)(V,{caregiverProfileId:r,caregiverCredentialProofs:a,drawerOpen:t.vettingDocumentsForm,onDrawerClose:function(e){var r=e.refetchData;d("vettingDocumentsForm"),r&&s()}}),t.additionalTrainingsForm&&(0,_.jsx)(L,{caregiverProfileId:r,caregiverCredentialProofs:a,drawerOpen:t.additionalTrainingsForm,onDrawerClose:function(e){var r=e.refetchData;d("additionalTrainingsForm"),r&&s()}}),t.nurseCredentialsForm&&(0,_.jsx)(M,{caregiverProfileId:r,caregiverCredentialProofs:a,drawerOpen:t.nurseCredentialsForm,onDrawerClose:function(e){var r=e.refetchData;d("nurseCredentialsForm"),r&&s()}}),t.bondingInsuranceForm&&(0,_.jsx)(oe,{caregiverProfileId:r,caregiverCredentialProofs:a,drawerOpen:t.bondingInsuranceForm,onDrawerClose:function(e){var r=e.refetchData;d("bondingInsuranceForm"),r&&s()}})]})}var ue={sectionsContainer:{display:"flex",flexDirection:"column",gap:3}};function fe(e){var r=e.credentialProof;return(0,_.jsxs)(u.Z,{mb:2,children:[(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[700],fontWeight:500,children:(0,m.Li)(r.caregiverCredentialType)}),r.credentialProofUrl&&(0,_.jsx)(f.Z,{variant:"body2",color:v.Z.palette.grey[500],children:(0,_.jsx)("a",{href:r.credentialProofUrl,target:"_blank",style:{color:v.Z.palette.grey[500]},children:"Click to view the document"})})]})}function ge(e){var r=e.isVetting;return(0,_.jsxs)(f.Z,{variant:"body2",color:v.Z.palette.grey[500],children:["This caregiver has not uploaded any\xa0",r?"vetting process documents":"credentials","\xa0yet."]})}var pe=n(59889),ve=n(60377),he=n(52049),me=n(60674);function je(e){var r=e.user,n=(0,t.useRouter)(),u=(0,a.O_)("userId",n.query
1),f=(0,c.m5)(u),g=f.user,p=f.userLoading,v=f.userFetchError,h=f.userRefetch;return(0,_.jsx)(le.Z,{isLoading:p,isError:!!v,children:g&&(0,o.wQ)(g.roles)?(0,_.jsx)(l.Z,{goBackPath:i.nB.Admin.Users.Root,goBackText:"All Users",authUser:r,selectedUser:g,tabRoutes:(0,s.H$)(g.id),PageActionBar:(0,_.jsx)(d.Z,{selectedUser:g}),ButtonActions:(0,_.jsx)(_.Fragment,{children:!!g.caregiverProfile&&(0,_.jsx)(me.Z,{loggedInAdminFullName:(0,he.BD)(r.firstname,r.lastname),caregiverFullName:(0,he.BD)(g.firstname,g.lastname),caregiverProfileId:g.caregiverProfile.id,caregiverProfileStatus:g.caregiverProfile.status,refetchSelectedUser:h})}),children:(0,_.jsxs)(_.Fragment,{children:[g.caregiverProfile&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ve.Z,{title:"Credentials",description:"Caregiver\u2019s vetting process and other supporting documents."}),(0,_.jsx)(de,{caregiverProfileId:g.caregiverProfile.id})]}),!g.caregiverProfile&&(0,_.jsx)(ve.Z,{title:"No caregiver profile found.",description:"This caregiver has not created a caregiver profile."})]})}):(0,_.jsx)(pe.Z,{})})}function be(e){var r=e.user;return(0,_.jsx)(je,{user:r})}},16225:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/users/[userId]/credentials",function(){return n(65790)}])}},function(e){e.O(0,[5846,4740,7165,3726,9774,2888,179],(function(){return r=16225,e(e.s=r);var r}));var r=e.O();_N_E=r}]);

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.