PageSourceSearch

https://www.vrijwilligerspunt.com/assets/index-DxleXqPt.js

js vrijwilligerspunt.com collected 2026-09-25 14:47:48 UTC 28,756 bytes, 3 lines download raw bytes

1import{u as re,a as j,j as e,F as ce,L as A,cS as ie,B as f,d6 as ve,y as V,z as M,aZ as y,d7 as we,_ as x,Y as I,e as X,aD as R,d8 as ee,K as q,c$ as le,d9 as be,P as Se,A as J,da as Fe,g as z,ck as ye,t as C,N as xe,Q as Ce,db as je,cY as de,dc as Te,dd as ae,ai as Ne,bh as Ae,w as h,d1 as $,T as Z,ah as Pe,c as De,a3 as _e,h as O,i as B,de as ue,a4 as Ee,b as Ie,df as Le,p as Oe,cd as Be,dg as Ue}from"./index-DEpx10yq.js";import{S as U}from"./Section-sxHNObk1.js";import{R as Ve}from"./RoutedTabs-68_GNi1G.js";import{P as Y}from"./index-CuBUkoZP.js";import{r as u,F as se,O as Me,bO as Re,c1 as qe}from"./vendor-BuXdE1tY.js";import{t as G,E as ze}from"./email-DwndFiL_.js";import{W as me}from"./operations.graphql-CDxOkHau.js";import{u as Ge,b7 as H,b8 as S,b9 as oe}from"./app-4WdNMoJ4.js";import{p as Ke,P as Qe,g as We}from"./helpers-B9PHCvKt.js";import{H as $e}from"./index-ChE26-6A.js";import{Q as Ye}from"./index-CAW6CT9T.js";import{u as He}from"./useCopyToClipboard-BNhpxVxu.js";import{u as Je}from"./useStableSearchParams-BuRP1zXw.js";import"./dayjs-timezone-iana-plugin-BLhLpZHa.js";import"./interpolateMarkup-DX3E-omN.js";import"./AddressFieldsInput-P-cJyvLH.js";try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new n.Error().stack;i&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[i]="6d11f1f0-a667-4755-9cc1-82b2689d2dbb",n._sentryDebugIdIdentifier="sentry-dbid-6d11f1f0-a667-4755-9cc1-82b2689d2dbb")}catch{}const Ze={en:"Must be at least %{min} characters",nl:"Moet ten minste %{min} tekens lang zijn"},Xe={en:"New password",nl:"Nieuw wachtwoord"},en={en:"Confirm new password",nl:"Bevestig nieuw wachtwoord"},nn={en:"Old password",nl:"Oude wachtwoord"},tn={minLen:Ze,newPassword:Xe,newPasswordConfirm:en,oldPassword:nn};function an(n){const i=re(n),a=j(tn),o=i.binding("oldPassword"),r=i.binding("newPassword"),p=i.binding("newPasswordConfirm");return e.jsx("div",{children:e.jsxs(ce,{form:i,children:[e.jsx(A,{label:a("oldPassword"),required:!0,children:e.jsx(Y,{name:"oldPassword","aria-label":a("oldPassword"),onChange:t=>o.onChange(t.currentTarget.value),value:o.value,required:!0,autoComplete:"current-password"})}),e.jsx(A,{label:a("newPassword"),required:!0,children:e.jsx(Y,{"aria-label":a("newPassword"),name:"newPassword",onChange:t=>r.onChange(t.currentTarget.value),value:r.value,minLength:ie,required:!0,autoComplete:"new-password"})}),e.jsx(A,{label:a("newPasswordConfirm"),required:!0,children:e.jsx(Y,{"aria-label":a("newPasswordConfirm"),name:"newPasswordConfirm",onCh
1ange:t=>p.onChange(t.currentTarget.value),value:p.value,minLength:ie,required:!0,autoComplete:"new-password"})}),e.jsx(f,{type:"submit",loading:i.submitting,children:a.g("save")})]})})}const sn=()=>{const[n,i]=u.useState(Math.random()),a=u.useCallback(()=>{i(Math.random())},[]);return[n,a]},on=({update:n})=>{const i=j(G),[a,o]=sn(),r=V(),p=M(),t=d=>{const l={...d};return l.newPassword&&l.newPasswordConfirm!==l.newPassword?y.error({message:i.g("doesntMatch")}):l.newPassword&&l.oldPassword===l.newPassword?y.error({message:i("samePassword")}):(delete l.email,delete l.newPasswordConfirm,n(l).then((...c)=>{o(),r({message:i("successMessagePassword")})(...c)},p()))};return e.jsx(an,{onSubmit:t},a)},rn=ve(null,{update:we})(on),cn={en:"Working hours",nl:"Werktijden"},ln={en:"When can we reach you by phone?",nl:"Wanneer kunnen we je telefonisch bereiken?"},dn={en:"On Mondays and Tuesdays between 9am and 5pm",nl:"Op maandag en dinsdag tussen 9:00 en 17:00"},un={when_to_contact:cn,when_to_contact_h:ln,when_to_contact_ph:dn},mn=n=>{const i=j(un),a=re(n);return e.jsx(ce,{form:a,children:e.jsxs(x,{gap:"md",align:"flex-start",children:[e.jsx(A,{label:i("when_to_contact"),help:i("when_to_contact_h"),children:e.jsx(I,{placeholder:i("when_to_contact_ph"),...a.binding("whenToContact")})}),e.jsx(f,{type:"submit",loading:a.submitting,children:i.g("save")})]})})},pe={definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"EditProfileDetails"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"about"}},{kind:"Field",name:{kind:"Name",value:"activities"}},{kind:"Field",name:{kind:"Name",value:"activityPublicEnabled"}},{kind:"Field",name:{kind:"Name",value:"address"}},{kind:"Field",name:{kind:"Name",value:"canEditActivityPublicEnabled"}},{kind:"Field",name:{kind:"Name",value:"causes"}},{kind:"Field",name:{kind:"Name",value:"city"}},{kind:"Field",name:{kind:"Name",value:"coordinates"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lat"}},{kind:"Field",name:{kind:"Name",value:"lng"}}]}},{kind:"Field",name:{kind:"Name",value:"countryCode"}},{kind:"Field",name:{kind:"Name",value:"crisisBankOptedIn"}},{kind:"Field",name:{kind:"Name",value:"firstNames"}},{kind:"Field",name:{kind:"Name",value:"fullName"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"image"}},{kind:"Field",name:{kind:"Name",value:"isExternal"}},{kind:"Field",name:{kind:"Name",value:"language"}},{kind:"Field",name:{kind:"Name",value:"lastName"}},{kind:"Field",name:{kind:"Name",value:"notInterestedInFromHome"}},{kind:"Field",name:{kind:"Name",value:"phoneNumber"}},{kind:"Field",name:{kind:"Name",value:"postcode"}},{kind:"Field",name:{kind:"Name",value:"preferContactByPhone"}},{kind:"Field",name:{kind:"Name",value:"searchRadius"}},{kind:"Field",name:{kind:"Name",value:"translateToMyLanguage"}},{kind:"Field",name:{kind:"Name",value:"volunteerBankOptedIn"}},{kind:"Field",name:{kind:"Name",value:"customSignupFieldValues"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"WhitelabelCustomFieldValueFragment"}}]}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]},pn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateOwnAdministratorInfo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"whenToContact"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"whenToContact"},value:{kind:"Variable",name:{kind:"Name",value:"whenToContact"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"whenToContact"}}]}}]}}]}}]},hn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetOwnAdministratorInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"whenToContact"}}]}}]}}]}}]},kn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteOwnProfile"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"userId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"userId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]}}]},fn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserSettingsInvite"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"referralsCount"}}]}}]}}]}}]},gn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetOwnProfile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"viewer"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"EditProfileDetails"}}]}}]}}]}},...pe.definitions,...me.definitions]},vn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateOwnProfile"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateUserInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"EditProfileDetails"}}]}}]}}]}},...pe.definitions,...me.definitions]},wn=()=>{const n=X(),i=V(),a=M(),{data:o,loading:r}=R(hn),[p]=ee(pn);if(r)return e.jsx(q,{});if(!o?.viewer.user)return null;const t=async d=>p({variables:{whenToContact:d.whenToContact}}).then(({data:l})=>{if(l)return n(le({when_to_contact:l.updateUser.user.whenToContact}))}).then(i(),a());return e.jsx(mn,{onSubmit:t,initialValues:{whenToContact:o.viewer.user.whenToContact}})},bn="delete-my-profile-button",Sn="delete-my-profile-confirm-button",Fn=()=>{const n=j(G),i=V(),a=M(),o=R(be),[r]=ee(kn,{onCompleted(t){i()(t),sessionStorage.clear(),window.location.assign("/")},onError(t){Fe(t,{onCouldNotDeleteLastAdminOfAnOrganizationError(d){a({message:n("couldNotDeleteLastAdmin"),dismissAfter:1e4})(t)},onUnknownError(){a({message:n("contactUs"),dismissAfter:1e4})(t)}})}}),p=o.data?.viewer?.user?.id;return o.loading||!p?null:e.jsx("div",{className:Ge.marginTop3,children:e.jsx(Se,{okButtonProps:{...J(Sn),color:"danger"},onConfirm:()=>r({variables:{userId:p}}),okText:n("deleteConfirm"),cancelText:n("deleteCancel"),title:n("delete"),children:e.jsx(f,{...J(bn),color:"danger",children:n("delete")})})})},yn=()=>{const n=z(),i=j(G),{data:a,loading:o}=R(fn,{fetchPolicy:"cache-and-network"});if(o||!a?.viewer.user)return e.jsx(q,{});const r=new URL("/",n.httpsUrl);return r.searchParams.set("referrer",a.viewer.user.id),e.jsxs("div",{className:H.wrapper,children:[e.jsx("h2",{children:i("inviteFriends")}),e.jsx("div",{className:H.labelWrapper,children:e.jsx(A,{label:i("referralLink"),children:e.jsx(ye,{readOnly:!0,defaultValue:r.toString(),className:H.input})})}),e.jsx("div",{children:i("referred",{count:a.viewer.user.referralsCount??0})})]})},xn=n=>({...ae(n,"firstNames","lastName","image","notInterestedInFromHome","about","preferContactByPhone","language","crisisBankOptedIn","volunteerBankOptedIn","phoneNumber","activityPublicEnabled","translateToMyLanguage","searchR
1adius"),coordinates:n.coordinates?ae(n.coordinates,"lat","lng"):null,custom:n.customSignupFieldValues?Object.fromEntries(n.customSignupFieldValues.map(i=>[i.customFieldId,We(i)])):null,address:n.address??null,city:n.city??null,postcode:n.postcode??null,countryCode:n.countryCode??null,activities:n.activities.map(i=>i.slice()),causes:n.causes.slice()}),Cn=({userData:n,customSignupFields:i})=>{const a=X(),o=z(),r=je(),p=V(),t=M(),d=C.useUtils(),l=n.canEditActivityPublicEnabled,[c]=ee(vn),b=u.useCallback(async s=>{const T=await c({variables:{input:{...Ke(s,{canWriteActivityPublicEnabled:l}),customSignupFieldValues:s.custom}}}).catch(t());if(!T?.data?.updateUser.user)throw new Error("Unreachable empty user data in `ProfileSettingsContent`'s `handleSubmit`");await a(le({first_names:s.firstNames,last_name:s.lastName,image:s.image??void 0,not_interested_in_from_home:s.notInterestedInFromHome,about:s.about,prefer_contact_by_phone:s.preferContactByPhone,language:s.language,crisis_bank_opted_in:s.crisisBankOptedIn,volunteer_bank_opted_in:s.volunteerBankOptedIn,phone_number:s.phoneNumber,activity_public_enabled:s.activityPublicEnabled,translate_to_my_language:s.translateToMyLanguage,coordinates:s.coordinates?{lat:s.coordinates.lat,lng:s.coordinates.lng}:null,search_radius:s.searchRadius,address:s.address,city:s.city,postcode:s.postcode,country_code:s.countryCode,activities:s.activities?.map(([N,g])=>[N,g])??void 0,causes:s.causes})),p()(T),await Promise.all([d.me.whitelabelMembershipInitialData.invalidate(),a(de({whitelabel:o.whitelabel}))]),s.language&&s.language!==r&&Te(s.language,o.whitelabel)},[l,a,r,t,p,o.whitelabel,d,c]),m=u.useMemo(()=>xn(n),[n]);return e.jsx(Qe,{isSlim:!0,canEditActivityPublicEnabled:l,onSubmit:b,initialValues:m,customSignupFields:i},n.updatedAt)},jn=()=>{const{data:n,loading:i}=R(gn),{data:a,isLoading:o}=C.me.customSignupFields.useQuery();if(i||o)return e.jsx(q,{});const r=n?.viewer?.user;if(!r)throw new xe(Ce.User);
1if(!a)throw new Error("Could not get custom signup fields for `ProfileSettings`");return e.jsx(Cn,{userData:r,customSignupFields:a})};function Tn(n,i){const a=u.useRef(n);u.useEffect(()=>{a.current=n},[n]),u.useEffect(()=>{if(i===null)return;const o=window.setInterval(()=>a.current(),i);return()=>{window.clearInterval(o)}},[i])}const Nn={en:"Backup Code",nl:"Back-upcode"},An={en:"Enter 8-character backup code",nl:"Voer een back-upcode van 8 tekens in"},Pn={en:"Save these backup codes in a safe place. You can use them to access your account if you lose your authenticator device.",nl:"Bewaar deze back-upcodes op een veilige plek. Je kunt ze gebruiken om toegang te krijgen tot je account als je jouw authenticatieapparaat kwijtraakt."},Dn={en:"Backup Codes",nl:"Back-upcodes"},_n={en:"Cancel",nl:"Annuleren"},En={en:"Close",nl:"Sluiten"},In={en:"Copy Secret Key",nl:"Geheime sleutel kopiëren"},Ln={en:"Disable two-factor authentication (2FA)",nl:"Tweestapsverificatie (2FA) uitschakelen"},On={en:"Disable two-factor authentication (2FA)",nl:"Tweestapsverificatie (2FA) uitschakelen"},Bn={en:"Enter your verification code to disable two-factor authentication (2FA).",nl:"Voer je verificatiecode in om Tweestapsverificatie (2FA)  uit te schakelen."},Un={en:"Disable two-factor authentication (2FA)",nl:"Tweestapsverificatie (2FA) uitschakelen"},Vn={en:"Download Backup Codes",nl:"Back-upcodes downloaden"},Mn={en:"Two-factor authentication (2FA) is already enabled.",nl:"Tweestapsverificatie (2FA) is al ingeschakeld."},Rn={en:"An error occurred. Please try again.",nl:"Er is een fout opgetreden. Probeer het opnieuw."},qn={en:"Invalid backup code. Please try again.",nl:"Ongeldige back-upcode. Probeer het opnieuw."},zn={en:"Invalid Two-factor authentication (2FA) verification code. Please try again.",nl:"Ongeldige Tweestapsverificatiecode (2FA). Probeer het opnieuw."},Gn={en:"Two-factor authentication (2FA) is not available for this account.",nl:"Tweestapsverificatie (2FA) is niet beschikbaar voor dit account."},Kn={en:"Two-factor authentication (2FA) is not enabled.",nl:"Tweestapsverificatie (2FA) is niet ingeschakeld."},Qn={en:"The Two-Factor Authentication (2FA) setup session has expired. Please start over.",nl:"De Tweestapsverificatie (2FA) installatiesessie is verlopen. Begin opnieuw."},Wn={en:"Loading...",nl:"Laden..."},$n={en:"Enter the 6-digit code from your authenticator app:",nl:"Voer de 6-cijferige code van je authenticator-app in:"},Yn={en:"Two-Factor Authentication (2FA)",nl:"Tweestapsverificatie (2FA)"},Hn={en:"Two-factor authentication (2FA) is currently enabled for your account.",nl:"Tweestapsverificatie (2FA) is ingeschakeld."},Jn={en:"Manage Two-Factor Authentication",nl:"Tweestapsverificatie (2FA) beheren"},Zn={en:"If you can't scan the QR code, enter this secret key manually.",nl:"Als je de QR-code niet kunt scannen, voer de geheime sleutel dan handmatig in."},Xn={en:"Manual Entry",nl:"Handmatige invoer"},et={en:"Secret Key",nl:"Geheime sleutel"},nt={en:"Set up two-factor authentication (2FA)",nl:"Tweestapsverificatie (2FA) instellen"},tt={en:"Two-factor authentication (2FA) has been successfully enabled for your account.",nl:"Tweestapsverificatie (2FA) is ingeschakeld."},it={en:"Two-factor authentication (2FA) setup complete",nl:"Installatie van Tweestapsverificatie (2FA) voltooid"},at={en:"Two-factor authentication (2FA) adds an extra layer of security to your account. You'll need an authenticator app like Google Authenticator or Authy.",nl:"Tweestapsverificatie (2FA) voegt een extra beveiligingslaag toe aan je account. Je hebt hiervoor een authenticatie-app nodig zoals Google Authenticator of Authy."},st={en:"Set up two-factor authentication (2FA)",nl:"Tweestapsverificatie (2FA) instellen"},ot={en:"Two-factor authentication (2FA) has been disabled.",nl:"Tweestapsverificatie (2FA) is uitgeschakeld."},rt={en:"Login successful.",nl:"Inloggen gelukt."},ct={en:"Two-factor authentication (2FA) has been successfully set up.",nl:"Tweestapsverificatie (2FA) is succesvol ingesteld."},lt={en:"Use Backup Code",nl:"Gebruik back-upcode"},dt={en:"Use verification code instead",nl:"Gebruik in plaats daarvan de verificatiecode"},ut={en:"Verification Code",nl:"Verificatiecode"},mt={en:"Enter 6-digit code",nl:"Voer de 6-cijferige code in"},pt={en:"Verify and Enable two-factor authentication (2FA)",nl:"Tweestapsverificatie (2FA) verifiëren en inschakelen"},ht={en:"Verify",nl:"Verifiëren"},kt={en:"Enter the 6-digit code from your authenticator app to complete the setup.",nl:"Voer de 6-cijferige code van je authenticator-app in om de installatie te voltooien."},ft={en:"Verify Setup",nl:"Installatie verifiëren"},gt={en:"View Backup Codes",nl:"Bekijk back-upcodes"},vt={backupCodeLabel:Nn,backupCodePlaceholder:An,backupCodesDescription:Pn,backupCodesTitle:Dn,cancel:_n,close:En,copySecretKey:In,disable:Ln,disableConfirm:On,disableDescription:Bn,disableTitle:Un,downloadBackupCodes:Vn,errorAlreadyEnabled:Mn,errorGeneric:Rn,errorInvalidB
1ackupCode:qn,errorInvalidCode:zn,errorNotAvailable:Gn,errorNotEnabled:Kn,errorSetupExpired:Qn,loading:Wn,loginDescription:$n,loginTitle:Yn,manageDescription:Hn,manageTitle:Jn,manualEntryDescription:Zn,manualEntryTitle:Xn,secretKeyLabel:et,setup:nt,setupCompleteDescription:tt,setupCompleteTitle:it,setupDescription:at,setupTitle:st,successDisabled:ot,successLogin:rt,successSetup:ct,useBackupCode:lt,useVerificationCode:dt,verificationCodeLabel:ut,verificationCodePlaceholder:mt,verifyAndEnable:pt,verifyLogin:ht,verifySetupDescription:kt,verifySetupTitle:ft,viewBackupCodes:gt};function wt({mode:n,open:i=!0,onClose:a=()=>{},onModeChange:o,onSuccess:r,inline:p=!1}){const t=j(vt),[d,l]=u.useState(null),[c,b]=u.useState(""),[m,s]=u.useState(!1),[T,_]=He(),N=C.useUtils(),g=C.twoFactorAuth.setup.useMutation(),P=C.twoFactorAuth.verifySetup.useMutation({onSuccess:()=>N.twoFactorAuth.backupCodes.invalidate()}),v=C.twoFactorAuth.disable.useMutation({onSuccess:()=>N.twoFactorAuth.backupCodes.invalidate()}),D=C.twoFactorAuth.backupCodes.useQuery(void 0,{enabled:n==="backup-codes"}),L=u.useCallback(async()=>{try{const k=await g.mutateAsync();l(k),o?.("setup")}catch{y.error({message:t("errorGeneric")})}},[g,o,t]);u.useEffect(()=>{n==="setup"&&!d&&!g.isPending&&L()},[n,d,g.isPending,L]);const K=u.useCallback(async k=>{if(k.preventDefault(),!c||c.length!==6){y.error({message:t("errorInvalidCode")});return}try{await P.mutateAsync({token:c}),y.success({message:t("successSetup")}),r?.(!0),a()}catch{y.error({message:t("errorInvalidCode")})}},[c,P,r,a,t]),Q=u.useCallback(async()=>{const k=m?8:6,F=t(m?"errorInvalidBackupCode":"errorInvalidCode");if(!c||c.length!==k){y.error({message:F});return}try{await v.mutateAsync({token:Ne(c)}),y.success({message:t("successDisabled")}),r?.(!1),a()}catch{y.error({message:F})}},[c,m,v,r,a,t]),w=u.useCallback(()=>{if(!d?.backupCodes)return;const k=d.backupCodes.join(`
2`),F=new Blob([k],{type:"text/plain"}),W=URL.createObjectURL(F),E=document.createElement("a");E.href=W,E.download="2fa-backup-codes.txt",document.body.appendChild(E),E.click(),document.body.removeChild(E),URL.revokeObjectURL(W)},[d?.backupCodes]),ne=()=>g.isPending?e.jsx(q,{}):e.jsxs(e.Fragment,{children:[e.jsx(h,{children:t("verifySetupDescription")}),d&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:S.qrSection,children:e.jsx("div",{className:S.qrCode,children:e.jsx(Ye,{value:d.qrCodeUrl,size:200,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})})}),e.jsx($,{}),e.jsxs("div",{className:S.manualSection,children:[e.jsx(Z,{order:3,size:"md",fw:"semibold",children:t("manualEntryTitle")}),e.jsx(h,{size:"sm",c:"textSecondary",children:t("manualEntryDescription")}),e.jsx(A,{label:t("secretKeyLabel"),children:e.jsxs("div",{className:S.secretKeyContainer,children:[e.jsx(I,{value:d.secret,onChange:()=>{},readOnly:!0,className:S.secretKeyInput}),e.jsx(f,{variant:"outline",leftSection:e.jsx(se,{icon:T?Me:Re}),onClick:()=>_(d.secret),children:T?"Copied!":t("copySecretKey")})]})})]}),e.jsx($,{}),e.jsxs("div",{className:S.backupCodesSection,children:[e.jsx(Z,{order:3,size:"md",fw:"semibold",children:t("backupCodesTitle")}),e.jsx(h,{size:"sm",c:"textSecondary",children:t("backupCodesDescription")}),e.jsx("div",{className:S.backupCodesList,children:d.backupCodes.map((k,F)=>e.jsx(h,{size:"sm",className:S.backupCode,children:k},F))}),e.jsx(f,{variant:"outline",leftSection:e.jsx(se,{icon:qe}),onClick:w,children:t("downloadBackupCodes")})]}),e.jsx($,{})]}),e.jsx("form",{onSubmit:K,children:e.jsxs(x,{gap:"md",children:[e.jsx(A,{label:t("verificationCodeLabel"),children:e.jsx(I,{value:c,onChange:b,placeholder:t("verificationCodePlaceholder"),maxLength:6,pattern:"[0-9]{6}"})}),e.jsx(f,{type:"submit",disabled:P.isPending||!c,children:P.isPending?t("loading"):t("verifyAndEnable")})]})})]}),he=()=>e.jsxs(x,{gap:"md",children:[e.jsx(h,{children:t("manageDescription")}),e.jsxs(x,{gap:"sm",children:[e.jsx(f,{variant:"outline",onClick:()=>o?.("backup-codes"),children:t("viewBackupCodes")}),e.jsx(f,{color:"danger",onClick:()=>o?.("disable"),children:t("disable")})]})]}),ke=()=>e.jsxs(e.Fragment,{children:[e.jsx(h,{children:t("disableDescription")}),e.jsxs(x,{gap:"md",children:[e.jsx(Pe,{label:t(m?"backupCodeLabel":"verificationCodeLabel"),children:({inputId:k})=>m?e.jsx(I,{id:k,value:c,onChange:b,placeholder:t("backupCodePlaceholder"),maxLength:8,pattern:"[A-Fa-f0-9]{8}"}):e.jsx(I,{id:k,value:c,onChange:b,placeholder:t("verificationCodePlaceholder"),maxLength:6,pattern:"[0-9]{6}"})}),e.jsx(f,{variant:"subtle",onClick:()=>{s(!m),b("")},children:t(m?"useVerificationCode":"useBackupCode")}),e.jsx(f,{color:"danger",onClick:Q,disabled:v.isPending||!c,children:v.isPending?t("loading"):t("disableConfirm")})]})]}),fe=()=>D.isLoading?e.jsx(h,{children:t("loading")}):D.error||!D.data?e.jsx(h,{c:"text",children:t("errorGeneric")}):e.jsxs(e.Fragment,{children:[e.jsx(h,{children:t("backupCodesDescription")}),e.jsx("div",{className:S.backupCodesList,children:D.data.map((k,F)=>e.jsx(h,{size:"sm",className:S.backupCode,children:k},F))})]}),ge=()=>{switch(n){case"setup":return t("verifySetupTitle");case"manage":return t("manageTitle");case"disable":return t("disableTitle");case"backup-codes":return t("backupCodesTitle");default:return t("verifySetupTitle")}},te=()=>{switch(n){case"setup":return ne();case"manage":return he();case"disable":return ke();case"backup-codes":return fe();default:return ne()}};return p?e.jsx(x,{gap:"md",children:te()}):e.jsx(Ae,{open:i,onClose:a,title:ge(),size:"l",children:e.jsx(x,{gap:"md",children:te()})})}const bt={en:"Continue Now",nl:"Nu doorgaan"},St={en:"Add an extra layer of security to your account with two-factor authentication (2FA).",nl:"Voeg een extra beveiligingslaag toe aan je account met Tweestapsverificatie (2FA)."},Ft={en:"Disable Two-Factor Authentication (2FA)",nl:"Tweestapsverificatie (2FA) uitschakelen"},yt={en:"Disabled",nl:"Uitgeschakeld"},xt={en:"Enabled",nl:"Ingeschakeld"},Ct={en:"Manage Two-Factor Authentication (2FA)",nl:"Tweestapsverificatie (2FA) beheren"},jt={en:"Two-factor authentication (2fA) is not available for this account.",nl:"Tweestapsverificatie (2FA) is niet beschikbaar voor dit account."},Tt={en:"Redirecting in %{count}
2 seconds...",nl:"Doorsturen in %{count} seconden..."},Nt={en:"Set up Two-Factor Authentication (2FA)",nl:"Tweestapsverificatie (2FA) instellen"},At={en:"Two-factor authentication has been successfully enabled for your account. You will now be redirected to continue where you left off.",nl:"Tweestapsverificatie (2FA) succesvol ingeschakeld! Je wordt nu doorgestuurd om verder te gaan waar je gebleven was."},Pt={en:"Two-factor authentication (2FA) successfully enabled!",nl:"Tweestapsverificatie (2FA) succesvol ingeschakeld!"},Dt={en:"Status",nl:"Status"},_t={en:"Two-Factor Authentication (2FA)",nl:"Tweestapsverificatie (2FA)"},Et={continueNow:bt,description:St,disable:Ft,disabled:yt,enabled:xt,manage:Ct,notAvailable:jt,redirectingIn:Tt,setup:Nt,setupSuccessDescription:At,setupSuccessTitle:Pt,status:Dt,title:_t},It=()=>{const n=j(Et),i=z(),a=De(),[o]=_e(),{getStableSearchParams:r,setStableSearchParams:p}=Je(),t=O(w=>B(w)),d=X(),[l,c]=u.useState(!1),[b,m]=u.useState("setup"),[s,T]=u.useState(!1),[_,N]=u.useState(3),g=!!t?.two_factor_enabled_at,P=ue(i.whitelabel.settings)||g,v=o.get(Ee.next),D=()=>{m("setup"),c(!0)};u.useEffect(()=>{const w=r();w.get("openTwoFactorSetup")==="true"&&(w.delete("openTwoFactorSetup"),p(w,{replace:!0}),m("setup"),c(!0))},[r,p]);const L=()=>{m("manage"),c(!0)},K=async w=>{c(!1),await d(de({whitelabel:i.whitelabel,withPrefferedLanguage:!1})),v&&w&&(T(!0),N(5))},Q=u.useCallback(()=>{N(w=>w<=1?(a(v,{replace:!0}),0):w-1)},[a,v]);return Tn(Q,s&&v&&_>0?1e3:null),P?s&&v?e.jsx(U,{className:oe.wrapper,children:e.jsxs(x,{gap:"md",children:[e.jsx($e,{as:"h2",children:n("setupSuccessTitle")}),e.jsx(h,{children:n("setupSuccessDescription")}),e.jsx(h,{children:n("redirectingIn",{count:_})}),e.jsx(f,{component:Ie,variant:"outline",to:v,onClick:()=>a(v,{replace:!0}),children:n("continueNow")})]})}):e.jsxs(U,{className:oe.wrapper,children:[e.jsxs(x,{gap:"md",children:[e.jsxs("div",{children:[e.jsx(Z,{order:2,size:"lg",style:{marginTop:"1rem"},children:n("title")}),e.jsx(h,{size:"md",children:n("description")})]}),e.jsx("div",{children:e.jsxs(h,{size:"md",children:[n("status"),":"," ",e.jsx(h,{component:"span",fw:"bold",c:g?"success":"textSecondary",children:n(g?"enabled":"disabled")})]})}),g?e.jsx(f,{variant:"outline",onClick:L,children:n("manage")}):e.jsx(f,{onClick:D,...J(Le.setupButton),children:n("setup")})]}),l&&e.jsx(wt,{mode:b,open:!0,onClose:()=>c(!1),onModeChange:m,onSuccess:K})]}):e.jsx(U,{children:e.jsx(h,{size:"md",c:"textSecondary",children:n("notAvailable")})})},Jt=()=>{const n=j(G),i=z();Oe(n("title"));const{memberships:a,error:o}=Be(),r=O(m=>B(m)?.email??null),p=O(m=>B(m)?.has_non_mail_login??!0),t=C.me.emailSettingsUrl.useQuery().data?.url??null,d=O(m=>B(m)?.two_factor_enabled_at),l=a.length>0,c=!!r&&!i.whitelabel.settings.email_login_disabled,b=ue(i.whitelabel.settings)||!!d;return e.jsxs("div",{className:"container",children:[e.jsx("h1",{className:"section-heading",children:n("title")}),e.jsxs(U,{bordered:!0,children:[o&&e.jsx(Ue,{}),e.jsxs(Ve,{tabs:[{to:"/settings/email",text:n("email")},c&&{to:"/settings/account",text:n("account")},b&&{to:"/settings/security",text:n("security")},{to:"/settings/profile",text:n("profile")},l&&{to:"/settings/administrator",text:n("administrator")},!i.whitelabel.settings.login_wall&&{to:"/settings/invite",text:n("invite")},{to:"/settings/delete",text:n("delete")},t&&{to:t,text:n("emailSettings")}].filter(Boolean),children:[e.jsx("div",{children:e.jsx(ze,{email:r,readOnly:p&&!r})}),c&&e.jsx("div",{children:e.jsx(rn,{})}),b&&e.jsx("div",{children:e.jsx(It,{})}),e.jsx("div",{children:e.jsx(jn,{})}),l&&e.jsx("div",{children:e.jsx(wn,{})}),!i.whitelabel.settings.login_wall&&e.jsx("div",{children:e.jsx(yn,{})}),e.jsx("div",{children:e.jsx(Fn,{})}),t&&e.jsx("div",{})]})]})]})};export{Jt as default};
3//# sourceMappingURL=index-DxleXqPt.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.