PageSourceSearch

https://donate.sirgiving.org/assets/dashboard-view-VpykdVrT.js

js sirgiving.org collected 2026-10-05 03:46:06 UTC 21,768 bytes, 2 lines download raw bytes

1import{u as A,z as M,j as e,B as p,a as h,T as g,Z,aY as ne,g as O,aZ as q,K as le,h as ce,i as de,b9 as me,ba as ue,bb as pe,bz as xe,bL as he,S as K,k as W,aX as fe,f as F,X as ge,aN as be,aO as ve}from"./vendor-ui-BRVBT_Yy.js";import{a as m,R as B}from"./vendor-oauth-DwXLBb1K.js";import{aw as D,c as Q,a1 as V,a2 as ye,at as je,I as $,T as L,u as Ce,g as Ne,p as X}from"./profile-public-Bd_0cFDi.js";import{c as we}from"./user-qBUTUHdW.js";import"./vendor-icons-rGO-mpwF.js";import{e as Se}from"./vendor-data-CeAbJWtM.js";import{c as ke,S as Te}from"./country-list-DzBG8tg5.js";import"./vendor-helmet-DBodMq5m.js";import"./vendor-snackbar-jQhpIw5Y.js";import"./vendor-dnd-C6eqIS_L.js";import"./vendor-date-C_yEr4bb.js";import"./vendor-motion-DspwM_z0.js";import"./vendor-markdown-CAWN_ukG.js";function ze(c){if(!c||typeof c!="string")return{firstName:"",lastName:""};const s=c.trim();if(!s)return{firstName:"",lastName:""};const l=s.split(/\s+/);if(l.length===1)return{firstName:l[0],lastName:""};if(l.length===2)return{firstName:l[0],lastName:l[1]};const o=l[0],r=l.slice(1).join(" ");return{firstName:o,lastName:r}}const Ee=(c=!0)=>{const s=m.useCallback((r=10)=>{!c||!("vibrate"in navigator)||window.matchMedia("(pointer: coarse)").matches&&navigator.vibrate(r)},[c]),l=m.useCallback(()=>s(10),[s]),o=m.useCallback(()=>s([10,50,10]),[s]);return{triggerHaptic:s,successHaptic:l,errorHaptic:o}},Ie=()=>{const c=A(),s=M(c.breakpoints.down("md")),l=M(c.breakpoints.down("sm"));return m.useEffect(()=>{const o=()=>{const r=window.innerHeight*.01;document.documentElement.style.setProperty("--vh",`${r}px`)};return o(),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),()=>{window.removeEventListener("resize",o),window.removeEventListener("orientationchange",o)}},[]),{isMobile:s,isSmallMobile:l}},Re=({onDismiss:c,threshold:s=100,enabled:l=!0})=>{const o=m.useRef(null),r=m.useRef(null),f=m.useCallback(a=>
1{if(!l)return;const{scrollTop:x}=a.currentTarget;x===0&&(o.current=a.targetTouches[0].clientY)},[l]),b=m.useCallback(a=>{!l||o.current===null||(r.current=a.targetTouches[0].clientY)},[l]),d=m.useCallback(()=>{if(!l||o.current===null||r.current===null)return;r.current-o.current>s&&c(),o.current=null,r.current=null},[l,c,s]);return{onTouchStart:f,onTouchMove:b,onTouchEnd:d}},We=({onSwipeLeft:c,onSwipeRight:s,minSwipeDistance:l=50,enabled:o=!0})=>{const r=m.useRef(null),f=m.useRef(null),b=m.useCallback(x=>{o&&(f.current=null,r.current=x.targetTouches[0].clientX)},[o]),d=m.useCallback(x=>{o&&(f.current=x.targetTouches[0].clientX)},[o]),a=m.useCallback(()=>{if(!o||!r.current||!f.current)return;const x=r.current-f.current,w=x>l,v=x<-l;w&&c&&c(),v&&s&&s(),r.current=null,f.current=null},[o,l,c,s]);return{onTouchStart:b,onTouchMove:d,onTouchEnd:a}};function Me({steps:c,activeStep:s}){const l=A();return e.jsxs(p,{sx:{textAlign:"center",pb:2},children:[e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",gap:1,mb:1},children:c.map((o,r)=>
1e.jsx(p,{sx:{width:s===r?24:8,height:8,borderRadius:4,bgcolor:s===r?"primary.main":h(l.palette.grey[500],.3),transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},r))}),e.jsxs(g,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.75rem"},children:["Step ",s+1," of ",c.length]})]})}function Oe({userTypes:c,watchedValues:s,setValue:l,user:o,theme:r,isMobile:f=!1}){const b=o?.email&&D&&o.email.split("@")[1]===D;return e.jsxs(p,{children:[e.jsx(g,{variant:"h6",gutterBottom:!0,children:"What type of user are you?"}),e.jsx(Z,{component:"fieldset",fullWidth:!0,children:e.jsx(ne,{value:s.type,onChange:d=>l("type",d.target.value),children:e.jsx(p,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)"},gap:{xs:1.5,sm:2}},children:c.map(d=>{const a=b&&d.id==="individual";return e.jsx(O,{sx:{p:{xs:1.5,md:2},aspectRatio:{xs:"1/1",md:"unset"},minHeight:{xs:"auto",md:120},height:{xs:"100%",md:"auto"},cursor:a?"not-allowed":"pointer",opacity:a?.5:1,border:s.type===d.id?`2px solid ${r.palette.primary.main}`:`1px solid ${h(r.palette.grey[500],.3)}`,bgcolor:s.type===d.id?h(r.palette.primary.main,.05):"background.paper",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","&:active":{transform:f?"scale(0.98)":"none"},"@media (hover: hover)":{"&:hover":{bgcolor:a?"background.paper":h(r.palette.primary.main,.02)}}},onClick:()=>{a||l("type",d.id)},children:f?e.jsxs(e.Fragment,{children:[e.jsx(p,{component:"label",sx:{position:"absolute",top:8,left:8,m:0,cursor:a?"not-allowed":"pointer",zIndex:1},onTouchEnd:x=>{x.preventDefault(),a||l("type",d.id)},onClick:x=>{x.stopPropagation(),a||l("type",d.id)},children:e.jsx(q,{checked:s.type===d.id,disabled:a,sx:{m:0}})}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",height:"100%",mt:1},children:[e.jsx(p,{sx:{fontSize:"2rem",mb:.5},children:d.icon}),e.jsx(g,{variant:"subtitle1",component:"div",sx:{fontSize:"0.875rem",fontWeight:600},children:d.title}),e.jsx(g,{variant:"body2",color:"text.secondary",component:"div",sx:{fontSize:"0.7rem",mt:.5,textAlign:"center",lineHeight:1.2},children:d.description}),a&&e.jsx(g,{variant:"caption",component:"div",color:"error",sx:{mt:.5,fontSize:"0.65rem",textAlign:"center"},children:"Not available for your email domain"})]})]}):e.jsx(le,{value:d.id,control:e.jsx(q,{disabled:a}),label:e.jsxs(p,{sx:{ml:1},component:"span",children:[e.jsx(p,{sx:{fontSize:"2rem",mb:1},children:d.icon}),e.jsx(g,{variant:"subtitle1",component:"span",children:d.title}),e.jsxs(g,{variant:"body2",color:"text.secondary",component:"div",children:[d.description,a&&e.jsx(g,{variant:"caption",component:"div",color:"error",children:"Not available for your email domain"})]})]}),sx:{width:"100%",margin:0,"& .MuiFormControlLabel-label":{width:"100%"}}})},d.id)})})})})]})}const J="onboarding-data",De=[{id:"individual",title:"Individual",icon:"👤",description:"Personal giving"},{id:"business",title:"Business",icon:"🏢",description:"Corporate giving & CSR"},{id:"impact",title:"Impact Org",icon:"🌟",description:"In the Impact space (tbd)"},{id:"nonprofit",title:"Nonprofit",icon:"🏛️",description:"Registered nonprofits"}],Ae=["Education","Health","Environment","Livelihood","Emergency","Women","Animals"],T=["User Type","Personal Details","Cause Preferences","Complete"];function He({open:c,onClose:s,onComplete:l}){const o=A(),[r,f]=m.useState(0),[b,d]=m.useState({}),{user:a,loading:x,setUser:w}=Q(),v=ke().getData(),C=a?.email?`${J}-${a.email}`:`${J}-guest`,{register:z,handleSubmit:E,watch:H,setValue:y,reset:N,formState:{errors:S}}=Se({defaultValues:{type:"individual",orgName:"",firstName:"",lastName:"",country:"US",causes:[]}}),i=H(),{isMobile:n}=Ie(),{successHaptic:I,errorHaptic:P}=Ee(n),[ee,R]=m.useState("left"),U=M("(prefers-reduced-motion: reduce)");m.useEffect(()=>{if(a&&!x&&!a.onboardingCompleted){const t=V(C);if(t)try{const u=JSON.parse(t);N(u)}catch(u){console.error("Failed to parse stored onboarding data:",u)}}},[a,x,C,N]),m.useEffect(()=>{const t=setTimeout(()=>{a&&!x&&!a.onboardingCompleted&&ye(C,JSON.stringify(i))},500);return()=>{clearTimeout(t)}},[i,a,x,C]),m.useEffect(()=>{if(c&&a&&!x&&!a.onboardingCompleted){const t=V(C);if(t)try{const u=JSON.parse(t);N(u)}catch(u){console.error("Failed to parse stored onboarding data on modal open:",u)}}},[c,a,x,C,N]),m.useEffect(()=>{if(c&&a&&!x&&!a.onboardingCompleted&&(!i.firstName||!i.lastName)){const t=ze(a.name||""),u=a.firstName?.trim()||t.firstName,j=a.lastName?.trim()||t.lastName;
1u&&!i.firstName&&y("firstName",u),j&&!i.lastName&&y("lastName",j)}},[c,a,x,i.firstName,i.lastName,y]),m.useEffect(()=>{if(!c||!a||x||a.onboardingCompleted||!a.email||!D)return;a.email.split("@")[1]===D&&(y("type","nonprofit"),a.orgName&&y("orgName",a.orgName))},[c,a,x,y]);const Y=()=>{if(r===1){if(i.type==="individual"){if(!i.firstName){d(u=>({...u,1:"Please fill in the required fields"})),P();return}}else if(!i.orgName){d(u=>({...u,1:"Please fill in the required fields"})),P();return}k(1),I(),R("left"),f(u=>Math.min(T.length-1,u+1))}else r===2?i.causes&&i.causes.length>0?(k(2),I(),R("left"),f(t=>Math.min(T.length-1,t+1))):(d(t=>({...t,2:"Please select at least one cause to continue"})),P()):(k(r),I(),R("left"),f(t=>Math.min(T.length-1,t+1)))},_=()=>{d({}),R("right"),f(t=>Math.max(0,t-1))},k=t=>{b[t]&&d(u=>{const j={...u};return delete j[t],j})},G=m.useCallback(async t=>{try{const u=await l(t);a&&w&&u&&w(u),a&&(localStorage.removeItem(C),Object.keys(localStorage).forEach(j=>{(j.startsWith("onboarding-")||j.includes("donation")||j.startsWith("donation-onboarding"))&&localStorage.removeItem(j)})),N(),f(0),s()}catch(u){console.error("Failed to complete onboarding:",u),N(),f(0),s()}},[l,a,w,C,N,s]),te=t=>{const u=i.causes||[],j=u.includes(t)?u.filter(se=>se!==t):[...u,t];y("causes",j),j.length>0&&k(2)},re=()=>{const t=i.causes?.length||0;return t===0?"Choose causes to personalize your feed.":`Your preferences match ${t*120} beneficiaries monthly (est.)`},ae=We({onSwipeLeft:()=>{r<T.length-1&&!b[r]&&Y()},onSwipeRight:()=>{r>0&&_()},enabled:n&&r<3}),ie=Re({onDismiss:()=>{I(),E(G)()},enabled:n&&r===3});m.useEffect(()=>{if(!c||!n)return;const{scrollY:t}=window;return document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",()=>{document.body.style.position="",document.body.style.top="",window.scrollTo(0,parseInt(document.body.style.top||"0")*-1)}},[c,n]);const oe=()=>{switch(r){case 0:return e.jsx(Oe,{userTypes:De,watchedValues:i,setValue:y,user:a,theme:o,isMobile:n});case 1:return e.jsxs(p,{children:[e.jsx(g,{variant:"h6",gutterBottom:!0,children:"Tell us about yourself"}),e.jsxs(p,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, 1fr)"},gap:3},children:[i.type==="individual"?e.jsxs(e.Fragment,{children:[e.jsx(F,{...z("firstName",{required:"First name is required"}),label:"First Name",fullWidth:!0,error:!!S.firstName||!!b[1],helperText:S.firstName?.message||(b[1]?"First name is required":""),onChange:t=>{y("firstName",t.target.value),k(1)},sx:{"& .MuiInputBase-root":{height:{xs:56,md:"auto"},fontSize:{xs:"1rem",md:"0.875rem"}}},inputProps:{autoComplete:"given-name",autoCapitalize:"words"}}),e.jsx(F,{...z("lastName"),label:"Last Name",fullWidth:!0,error:!!S.lastName,helperText:S.lastName?.message,onChange:t=>{y("lastName",t.target.value),k(1)},sx:{"& .MuiInputBase-root":{height:{xs:56,md:"auto"},fontSize:{xs:"1rem",md:"0.875rem"}}},inputProps:{autoComplete:"family-name",autoCapitalize:"words"}})]}):e.jsx(p,{sx:{gridColumn:"1 / -1"},children:e.jsx(F,{...z("orgName",{required:"Organization name is required"}),label:"Organization Name",fullWidth:!0,disabled:!!a?.orgName,error:!!S.orgName||!!b[1],helperText:a?.orgName?"Organization name is set from Every.org profile":S.orgName?.message||(b[1]?"Organization name is required":""),onChange:t=>{y("orgName",t.target.value),k(1)},sx:{"& .MuiInputBase-root":{height:{xs:56,md:"auto"},fontSize:{xs:"1rem",md:"0.875rem"}}},inputProps:{autoComplete:"organization"}})}),e.jsx(Z,{fullWidth:!0,children:e.jsx(Te,{options:v,value:v.find(t=>t.value===i.country)||v.find(t=>t.value==="US"),onChange:t=>{y("country",t?.value||"US"),k(1)},placeholder:"Select your country",isSearchable:!0,styles:{control:t=>({...t,minHeight:"56px",borderRadius:"10px",borderColor:h(o.palette.grey[500],.2),borderWidth:"1px",boxShadow:"none",pointer:"cursor",backgroundColor:o.palette.background.paper,"&:hover":{borderColor:h(o.palette.grey[500],.2)},"&:focus-within":{borderColor:o.palette.text.primary,borderWidth:"2px"}}),menu:t=>({...t,zIndex:9999,maxHeight:"125px",position:"absolute",backgroundColor:o.palette.background.paper,borderRadius:"8px"}),menuList:t=>({...t,maxHeight:"125px",paddingTop:0,paddingBottom:0,backgroundColor:o.palette.background.paper}),option:(t,u)=>({...t,fontSize:"0.875rem",padding:"8px 16px",backgroundColor:u.isSelected?h(o.palette.primary.main,.08):u.isFocused?h(o.palette.grey[500],.08):"transparent",color:o.palette.text.primary,"&:hover":{backgroundColor:h(o.palette.grey[500],.08)}}),placeholder:t=>({...t,color:o.palette.text.disabled,fontSize:"0.875rem"}),singleValue:t=>({...t,color:o.palette.text.primary,fontSize:"0.875rem"}),input:t=>({...t,fontSize:"0.875rem",color:o.palette.text.primary})}})})]}),b[1]&&e.jsx(g,{variant:"body2",color:"error",sx:{mt:2,textAlign:"center"},children:b[1]})]});case 2:return e.jsxs(p,{children:[e.jsx(g,{variant:"h6",gutterBottom:!0,children:"Choose causes you care about"}),e.jsx(p,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(4, 1fr)"},gap:{xs:1.5,md:2},mt:2},children:Ae.map(t=>e.jsxs(O,{sx:{p:{xs:2,md:2},minHeight:{xs:80,md:"auto"},textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:i.causes?.includes(t)?`2px s
1olid ${o.palette.primary.main}`:`1px solid ${h(o.palette.grey[500],.3)}`,bgcolor:i.causes?.includes(t)?h(o.palette.primary.main,.05):"background.paper",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","&:active":{transform:n?"scale(0.95)":"none"},"@media (hover: hover)":{"&:hover":{bgcolor:h(o.palette.primary.main,.02)}}},onClick:()=>te(t),children:[i.causes?.includes(t)&&e.jsx(p,{sx:{position:"absolute",top:8,left:8,width:20,height:20,borderRadius:"50%",bgcolor:"primary.main",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},children:e.jsx($,{icon:"eva:checkmark-fill",width:14,sx:{color:"common.white"}})}),e.jsx(g,{variant:"body1",fontWeight:600,sx:{fontSize:{xs:"0.875rem",md:"1rem"}},children:t})]},t))}),e.jsx(g,{variant:"body2",color:"text.secondary",sx:{mt:3,textAlign:"center"},children:re()}),b[2]&&e.jsx(g,{variant:"body2",color:"error",sx:{mt:1,textAlign:"center"},children:b[2]})]});case 3:return e.jsxs(p,{sx:{textAlign:"center",py:{xs:2,md:4}},children:[e.jsx(fe,{in:!0,timeout:500,children:e.jsx(p,{sx:{width:{xs:64,md:80},height:{xs:64,md:80},borderRadius:"50%",bgcolor:h(o.palette.success.main,.1),display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",mb:3,animation:"pulse 2s ease-in-out infinite","@keyframes pulse":{"0%, 100%":{transform:"scale(1)",opacity:1},"50%":{transform:"scale(1.05)",opacity:.8}}},children:e.jsx($,{icon:"eva:checkmark-circle-2-fill",width:{xs:40,md:48},sx:{color:"success.main"}})})}),e.jsx(g,{variant:"h5",fontWeight:700,gutterBottom:!0,sx:{fontSize:{xs:"1.25rem",md:"1.5rem"}},children:"You're all set!"}),e.jsxs(g,{variant:"body1",color:"text.secondary",sx:{mb:4,fontSize:{xs:"0.875rem",md:"1rem"}},children:["We created your profile. Your ",L," tokens are waiting in your wallet."]}),e.jsxs(K,{direction:{xs:"column",md:"row"},spacing:2,justifyContent:"center",children:[e.jsx(W,{variant:"outlined",size:"large",fullWidth:n,onClick:()=>f(0),sx:{flex:{md:1},maxWidth:{md:200},height:{xs:48,md:"auto"}},children:"Edit preferences"}),e.jsx(W,{variant:"contained",size:"large",fullWidth:n,onClick:E(G),sx:{flex:{md:2},maxWidth:{md:300},height:{xs:48,md:"auto"}},children:"Take me to dashboard"})]})]});default:return null}};return x?null:e.jsx(ce,{open:c,onClose:s,maxWidth:n?!1:"md",fullWidth:!n,fullScreen:n,PaperProps:{sx:{borderRadius:n?0:3,minHeight:n?"100%":500,maxHeight:n?"100%":"90vh",m:n?0:2}},children:e.jsxs(de,{sx:{p:{xs:2,sm:3,md:4},display:"flex",flexDirection:"column",height:n?"100%":"auto",position:"relative",...n&&{pb:1}},...n?r===3?ie:ae:{},children:[n&&e.jsx(p,{sx:{position:"absolute",top:0,left:0,right:0,height:3,bgcolor:h(o.palette.primary.main,.1),zIndex:1301},children:e.jsx(p,{sx:{height:"100%",width:`${r/(T.length-1)*100}%`,bgcolor:"primary.main",transition:"width 0.4s cubic-bezier(0.4, 0, 0.2, 1)"}})}),e.jsxs(p,{sx:{mb:{xs:2,md:4}},children:[e.jsx(g,{variant:"h4",fontWeight:700,gutterBottom:!0,sx:{fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:"Welcome let's set things up"}),e.jsxs(g,{variant:"body1",color:"text.secondary",sx:{fontSize:{xs:"0.875rem",sm:"1rem"}},children:["4 quick steps to personalize your '",je,"' experience"]})]}),n?e.jsx(Me,{steps:T,activeStep:r}):e.jsx(me,{activeStep:r,sx:{mb:4},children:T.map(t=>e.jsx(ue,{children:e.jsx(pe,{children:t})},t))}),e.jsx(xe,{in:!0,timeout:U?0:300,children:e.jsx(he,{direction:ee,in:!0,timeout:U?0:300,children:e.jsx(p,{sx:{minHeight:{xs:"auto",md:300},mb:{xs:2,md:4},maxHeight:{xs:"calc(100vh - 280px)",md:"calc(90vh - 300px)"},overflowY:"auto",flex:1,pr:1,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:h(o.palette.grey[500],.3),borderRadius:"3px"}},children:oe()})})},r),r<3&&e.jsxs(K,{direction:{xs:"column-reverse",md:"row"},spacing:{xs:1.5,md:2},justifyContent:"space-between",sx:{mt:"auto"},children:[e.jsx(W,{onClick:_,disabled:r===0,variant:"outlined",size:"large",fullWidth:n,sx:{height:{xs:48,md:"auto"},order:{xs:2,md:1}},children:"Back"}),e.jsx(W,{onClick:Y,variant:"contained",size:"large",fullWidth:n,disabled:!!b[r],sx:{height:{xs:48,md:"auto"},order:{xs:1,md:2}},children:"Next"})]})]})})}function Je({children:c}){const s=A(),l=Ce(),o=Ne(),{user:r,loading:f}=Q(),[b,d]=m.useState(!1),[a,x]=m.useState("individual"),w=M(s.breakpoints.up("lg")),v=m.useMemo(()=>{const n=o.pathname.split("/")[2];return n==="api-keys"?"apiKeys":n},[o.pathname]);m.useEffect(()=>{if(!f&&r){const i=!r.type||!r.onboardingCompleted;d(i),r.type&&x(r.type)}},[r,f]);const C=m.useCallback(async i=>{try{if(console.log("try onboarding"),r?.id){const n=await we(r.id,i);return x(i.type),n}}catch(n){throw console.error("Failed to complete onboarding:",n),n}finally{d(!1)}},[r?.id]),z=(i,n)=>{if(n==="dedication"){l(X.me.profile);return}l(X.dashboard[n])},E=m.useMemo(()=>{const i=[{value:"overview",label:"Dashboard"},{value:"donate",label:"Donate Now"},{value:"impact",label:"My Impact"},{value:"wallet",label:`${L} Wallet`},{value:"referral",label:"Referrals"},{value:"dedication",label:"Giving Profile"},{value:"apiKeys",label:"API Keys"},{value:"profile",label:"Profile"}];return r?.roles?.includes("ADMIN")&&i.push({value:"admin",label:"Admin Panel"}),r?.roles?.includes("TREASURER")&&i.push({value:"sirworldwide",label:"SIR World Wallet"}),i},[r?.roles]),H=()=>e.jsx(O,{sx:{borderRadius:3,overflow:"hidden",bgcolor:h(s.palette.background.paper,.8),backdropFilter:"blur(20px)",position:"sticky",top:s.spacing(4),alignSelf:"flex-start",height:"fit-content",py:2}
1,children:e.jsx(be,{value:v,onChange:z,orientation:"vertical",variant:"scrollable",sx:{"& .MuiTab-root":{minHeight:56,textTransform:"none",fontSize:"1rem",fontWeight:600,justifyContent:"flex-start",px:3},"& .MuiTabs-indicator":{left:0}},children:E.map(i=>e.jsx(ve,{label:i.label,value:i.value},i.value))})}),y=i=>({overview:"eva:grid-fill",donate:"eva:heart-fill",impact:"eva:bar-chart-fill",wallet:"eva:credit-card-fill",sirworldwide:"eva:briefcase-fill",referral:"eva:people-fill",admin:"eva:settings-2-fill",profile:"eva:person-fill",apiKeys:"eva:keypad-fill",dedication:"eva:link-2-fill"})[i]||"eva:menu-fill",N=()=>e.jsx(O,{sx:{mb:{xs:2,sm:3,md:4},borderRadius:{xs:2,sm:3},overflow:"hidden",bgcolor:h(s.palette.background.paper,.8),backdropFilter:"blur(20px)",border:`1px solid ${h(s.palette.divider,.08)}`,boxShadow:`0 2px 8px ${h(s.palette.common.black,.05)}`},children:e.jsx(p,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(3, 1fr)",sm:"repeat(4, 1fr)"},gap:{xs:.75,sm:1},p:{xs:1.5,sm:2}},children:E.map(i=>e.jsxs(p,{onClick:n=>z(n,i.value),sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",py:{xs:1.5,sm:2},px:{xs:.75,sm:1},cursor:"pointer",borderRadius:{xs:1.5,sm:2},transition:"all 0.2s ease",bgcolor:v===i.value?h(s.palette.primary.main,.12):h(s.palette.background.default,.4),border:`1.5px solid ${v===i.value?h(s.palette.primary.main,.3):h(s.palette.divider,.1)}`,"&:hover":{bgcolor:v===i.value?h(s.palette.primary.main,.16):h(s.palette.background.default,.6),transform:"translateY(-2px)",boxShadow:`0 4px 8px ${h(v===i.value?s.palette.primary.main:s.palette.common.black,.1)}`},"&:active":{transform:"scale(0.96)"}},children:[e.jsx($,{icon:y(i.value),width:{xs:24,sm:28},sx:{color:v===i.value?"primary.main":"text.secondary",mb:{xs:.75,sm:1},transition:"all 0.2s ease"}}),e.jsx(g,{variant:"caption",sx:{fontSize:{xs:"0.7rem",sm:"0.75rem"},fontWeight:v===i.value?700:600,color:v===i.value?"primary.main":"text.secondary",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%",lineHeight:1.2,transition:"all 0.2s ease"},children:i.label.replace(" Now","").replace(`${L} `,"")})]},i.value))})}),S=m.useMemo(()=>B.Children.map(c,i=>B.isValidElement(i)?B.cloneElement(i,{userType:a}):i),[c,a]);return f||!r?null:e.jsxs(p,{sx:{bgcolor:"background.default",minHeight:"100vh"},children:[e.jsxs(ge,{maxWidth:"xl",sx:{py:{xs:10,lg:10},px:{xs:1.5,sm:2,md:3}},children:[e.jsxs(p,{sx:{mb:{xs:3,sm:4,lg:5},px:{xs:.5,sm:0}},children:[e.jsxs(g,{variant:"h2",fontWeight:800,gutterBottom:!0,sx:{fontSize:{xs:"1.75rem",sm:"2.5rem",md:"3rem"},wordBreak:"break-word"},children:["Welcome back,",w?" ":e.jsx("br",{}),a!=="individual"&&r.orgName?r.orgName:r.name===r.email||r.name==="User"||!r.name?r.firstName&&r.lastName?`${r.firstName} ${r.lastName}`:r.firstName||r.lastName||"Donor":r.name,"!"]}),e.jsxs(g,{variant:"body1",color:"text.secondary",sx:{fontSize:{xs:"0.875rem",sm:"1rem"}},children:["Your impact dashboard • ",a," account"]})]}),e.jsxs(p,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"240px 1fr"},gap:{xs:0,md:2,lg:4}},children:[w?H():N(),e.jsx(p,{sx:{minHeight:{xs:400,sm:500,md:600}},children:S})]})]}),e.jsx(He,{open:b,onClose:()=>d(!1),onComplete:C})]})}export{Je as default};
2//# sourceMappingURL=dashboard-view-VpykdVrT.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.