1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1337],{1568:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/home",function(){return t(2509)}])},8780:(e,a,t)=>{"use strict";t.r(a),t.d(a,{CampaignsTable:()=>z,default:()=>T});var i=t(4848),l=t(6540),s=t(7284),n=t(3912),d=t(2016),r=t(5026),c=t(2163),o=t(7944),m=t(7156),h=t(820),u=t(2104),x=t(9998),p=t(5233),j=t(5904),v=t(7917),g=t(8296),f=t(3051);t(1106);var b=t(5099),y=t(3261),A=t(8874),N=t(8465),w=t.n(N),C=t(4505),D=t(6715);let k=t(6425);function S(){let[e,a]=(0,l.useState)("");return(0,i.jsx)("div",{className:"p-50 mx-auto",children:(0,i.jsx)(z,{SearchText:e})})}let z=e=>{let{SearchText:a=""}=e,t=(0,D.useRouter)(),[n,d]=(0,l.useState)([]);return(0,l.useEffect)(()=>{(async()=>{k.post("/api/Campaign/General",{action:"list",userId:localStorage.userid,type:localStorage.type}).then(e=>{if(e&&e.data){let a=[],t=1;e.data.forEach(e=>{var i,l,s,n,d,r;a.push((i=e._id,l=t++,s={backgroundImage:"linear-gradient(to right,#ecffec, #ecffec "+e.percentCompleted+"% , white "+e.percentCompleted+"%)"},n=e._id,d=e.title,r=e.creationDate,{dataid:i,id:l,RowStyle:s,campaignId:n,Fund:d,DateStarted:r,DateEnding:"",PercentCompleted:""+e.percentCompleted+"%",TargetAmount:"$ "+(0,A.ej)(e.targetAmount),AmountReceived:"$ "+(0,A.ej)(e.totalRecieved),Donations:void 0}))}),d(a)}})})()},[a]),(0,i.jsx)(b.A,{title:"Campaigns",headCells:[{id:"id",numeric:!0,label:"id",className:"hidden-md"},{id:"Fund",label:"Fund"},{id:"DateStarted",label:"Date Started",className:"hidden-sm"},{id:"DateEnding",label:"Date Ending",className:"hidden-sm"},{id:"PercentCompleted",numeric:!0,label:"Percent Completed",className:"hidden-sm"},{id:"TargetAmount",numeric:!0,label:"Target Amount",className:"hidden-xs"},{id:"AmountReceived",numeric:!0,label:"Amount Received",className:"hidden-xs"},{id:"controlButtons",label:""}],rows:n,rowClick:e=>{t.push("/user/report?i="+e)},renderEnd:e=>(0,i.jsx)(s.A,{align:"right",children:(0,i.jsx)(P,{row:e})})})};function P(e){let{row:a}=e,t=(0,D.useRouter)(),[s,b]=l.useState(!1),y=l.useRef(),N=async e=>{(0,C.Ay)("Deleting ..."),await k.post("/api/Campaign/General",{action:"delete",campaignId:e}),w().fire("Campaign Deleted !","","success"),location.reload()};return(0,i.jsxs)(l.Fragment,{children:[(0,i.jsxs)(n.A,{style:{marginRight:10,color:"#fff !important"},ref:y,"aria-label":"split button",children:[(0,i.jsx)(d.Ay,{title:"Open",children:(0,i.jsxs)(r.A,{variant:"contained",color:"primary",size:"small",style:{color:"#fff !important"},onClick:e=>{(0,A.F4)(e),window.open("/page/donate?id="+a.campaignId)},children:[(0,i.jsx)(p.A,{})," \xa0 Open"]})}),(0,i.jsx)(r.A,{variant:"contained",color:"primary",size:"small","aria-controls":s?"split-button-menu":void 0,"aria-expanded":s?"true":void 0,"aria-label":"extra options","aria-haspopup":"menu",onClick:e=>{(0,A.F4)(e),b(e=>!e)},children:(0,i.jsx)(j.A,{})})]}),(0,i.jsx)(c.A,{sx:{zIndex:1},open:s,anchorEl:y.current,role:void 0,transition:!0,disablePortal:!0,style:{zIndex:100},children:e=>{let{TransitionProps:l,placement:s}=e;return(0,i.jsx)(o.A,{...l,style:{transformOrigin:"bottom"===s?"center top":"center bottom"},children:(0,i.jsx)(m.A,{children:(0,i.jsx)(h.A,{onClickAway:()=>{b(!1)},children:(0,i.jsxs)(u.A,{id:"split-button-menu",autoFocusItem:!0,children:[(0,i.jsx)(d.Ay,{title:"Copy link to clipboard",children:(0,i.jsxs)(x.A,{onClick:e=>{(0,A.F4)(e),navigator.clipboard.writeText(A.$W.server+"page/donate?id="+a.campaignId),w().fire("Copied to Clipboard !","","success")},children:[(0,i.jsx)("svg",{class:"MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root",focusable:"false","aria-hidden":"true",viewBox:"0 0 24 24","data-testid":"ContentCopyIcon",children:(0,i.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"})}),"\xa0 Copy"]})}),(0,i.jsx)(d.Ay,{title:"Manually Add Gifts to Campaign",children:(0,i.jsxs)(x.A,{onClick:e=>{(0,A.F4)(e),t.push("/user/manualForm?id="+a.campaignId)},children:[(0,i.jsx)(v.A,{})," \xa0 Add"]})}),(0,i.jsxs)(x.A,{className:"editBtn",onClick:e=>{(0,A.F4)(e),t.push("/user/create?edit="+a.campaignId)},children:[(0,i.jsx)(g.A,{})," \xa0 Edit"]}),(0,i.jsxs)(x.A,{className:"deleteBtn",onClick:e=>{(0,A.F4)(e),(0,A.QV)(()=>{N(a.campaignId)})},children:[(0,i.jsx)(f.A,{})," \xa0 Delete"]})]})})})})}})]})}let T=()=>(0,i.jsx)(y.A,{Component:S,header:!0,footer:!0})},2509:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>f});var i=t(4848),l=t(6540),s=t(3261),n=t(8874),d=t(8296),r=t(4856),c=t(6752),o=t(3172),m=t
1(2016),h=t(6715),u=t(5093),x=t.n(u),p=t(2308),j=t(8780);let v=t(6425);function g(){var e,a,t,s,u,g;let f=(0,n.rX)("firstname"),b=(0,n.rX)("name"),y=(0,n.rX)("email"),A=(0,n.rX)("type"),N=(0,n.rX)("userImage"),w=(0,n.rX)("lastPage"),[C,D]=(0,l.useState)(""),[k,S]=(0,l.useState)("all"),[z,P]=(0,l.useState)(x()().subtract(1,"years").format("YYYY-MM-DD")),[T,F]=(0,l.useState)(x()().format("YYYY-MM-DD")),[E,M]=(0,l.useState)(0),[_,I]=(0,l.useState)(0),[R,G]=(0,l.useState)(0),[O,V]=(0,l.useState)("N/A"),[B,H]=(0,l.useState)(0),[Y,X]=(0,l.useState)(0),$=(0,h.useRouter)();(0,l.useEffect)(()=>{localStorage.userid||$.push("/user"),Z(),q()},[]);let Z=async()=>{v.post("/api/User",{action:"userDetail",userid:localStorage.userid}).then(e=>{D(e.data.education)})},q=async()=>{v.post("/api/Donation",{action:"list",userId:localStorage.userid,type:localStorage.type}).then(e=>{if(e&&e.data){var a,t,i,l,s,n,d,r,c,o;M((null===(t=e.data)||void 0===t?void 0:null===(a=t[0])||void 0===a?void 0:a.totalDonationsVar)||0),I((null===(l=e.data)||void 0===l?void 0:null===(i=l[0])||void 0===i?void 0:i.totalPledgesVar)||0),G((null===(n=e.data)||void 0===n?void 0:null===(s=n[0])||void 0===s?void 0:s.totalDonationAmountVar)||0),X(null===(r=e.data)||void 0===r?void 0:null===(d=r[0])||void 0===d?void 0:d.largestDonation),H((null===(c=e.data[e.data.length-1])||void 0===c?void 0:c.amount)||0),V((null===(o=e.data[e.data.length-1])||void 0===o?void 0:o.creationDate)||"N/A")}})},L=e=>{S(e)},W=e=>k==e?"datefilteron":"datefilter";return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"",children:[(0,i.jsx)("div",{className:"heading boxing mt-50",children:(0,i.jsxs)("div",{class:"ml-20",children:["Hi ",f,", Welcome!"]})}),(0,i.jsxs)("div",{className:"boxing mt-50 flex flex-row space",children:[(0,i.jsxs)("div",{className:"hidden-sm text-center card2 card2-2x",children:[(0,i.jsx)(c.A,{overlap:"circle",color:"primary",anchorOrigin:{vertical:"bottom",horizontal:"right"},badgeContent:(0,i.jsx)(d.A,{style:{width:13}}),className:"clickable mx-auto",onClick:()=>{$.push("/user/profile")},children:(0,i.jsx)(o.A,{alt:f,src:N?(0,n.wx)(N):"/img/user.jpg",className:"img-fluid img-fit border-circle mx-auto",style:{width:220,height:220}})}),(0,i.jsxs)("div",{className:"mt-36",children:[(0,i.jsxs)("div",{className:"namefont",children:[b,(0,i.jsx)("a",{href:"/user/profile",children:(0,i.jsx)(d.A,{style:{width:36,paddingTop:11}})})]}),(0,i.jsx)("div",{className:"milli",children:y}),(0,i.jsxs)("div",{className:"mt-10 milli",children:["Total Donations: ",E]}),(0,i.jsxs)("div",{className:"milli",children:["Total Pledges: ",_]}),(0,i.jsxs)("div",{className:"milli",children:["Lifetime Amount Donated: $",(0,n.ej)(R)]}),(0,i.jsxs)("small",{children:["Largest Gift: $",(0,n.ej)(Y)]}),(0,i.jsx)("br",{}),(0,i.jsxs)("small",{children:["Last Gift Amount: $",(0,n.ej)(B)]}),(0,i.jsx)("br",{}),(0,i.jsxs)("small",{children:["Last Gift Date: ",O]}),(0,i.jsxs)("div",{className:"milli",children:[" ",(0,i.jsxs)("b",{children:[null==C?void 0:null===(e=C.undergrad)||void 0===e?void 0:e.title," ",null==C?void 0:null===(a=C.undergrad)||void 0===a?void 0:a.year," ",null==C?void 0:null===(t=C.postgrad)||void 0===t?void 0:t.title," ",null==C?void 0:null===(s=C.postgrad)||void 0===s?void 0:s.year," ",null==C?void 0:null===(u=C.doctorate)||void 0===u?void 0:u.title," ",null==C?void 0:null===(g=C.doctorate)||void 0===g?void 0:g.year]})]}),(0,i.jsx)("div",{children:(0,i.jsx)("a",{href:"/stewardship/index.html",target:"_blank",className:"reportbtn mt-36",children:"Steward Report"})})]})]}),(0,i.jsxs)("div",{className:"flex flex-row gap-50",children:[(0,i.jsx)("div",{className:"hidden visible-sm card2 clickable",onClick:()=>{$.push("/user/report")},children:(0,i.jsxs)("div",{className:"m-auto",children:[(0,i.jsx)(c.A,{overlap:"circle",color:"primary",anchorOrigin:{vertical:"bottom",horizontal:"right"},badgeContent:(0,i.jsx)(d.A,{style:{width:13}}),className:"clickable mx-auto",onClick:()=>{$.push("/user/profile")},children:(0,i.jsx)(o.A,{alt:f,src:N?(0,n.wx)(N):"/img/user.jpg",className:"img-fluid img-fit border-circle mx-auto",style:{width:50,height:50}})}),(0,i.jsxs)("div",{className:"mt-36",children:[(0,i.jsxs)("div",{className:"namefont",children:[b,(0,i.jsx)("a",{href:"/user/profile",children:(0,i.jsx)(d.A,{style:{width:36,paddingTop:11}})})]}),(0,i.jsx)("div",{className:"milli",children:y})]})]})}),(0,i.jsx)("div",{className:"card2 clickable",style:{padding:"30px 15px"},onClick:()=>{$.push("/user/report?type=One-Time")},children:(0,i.jsxs)("div",{className:"m-auto",children:[(0,i.jsxs)("div",{className:"flex flex-row",children:[(0,i.jsx)("svg",{id:"Report",className:"m-auto",width:60,height:60,fill:"#57B1FF","enable-background":"new 0 0 24 24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"m19.25 0h-14.5c-1.517 0-2.75 1.233-2.75 2.75v18.5c0 1.517 1.233 2.75 2.75 2.75h14.5c1.517 0 2.75-1.233 2.75-2.75v-18.5c0-1.517-1.233-2.75-2.75-2.75zm-8.5 13v-4.924c2.4.365 4.25 2.424 4.25 4.924 0 2.757-2.243 5-5 5-1.108 0-2.123-.374-2.953-.987l3.483-3.483c.141-.14.22-.331.22-.53zm-1.5-4.924v4.614l-3.263 3.263c-.613-.83-.987-1.845-.987-2.953 0-2.5 1.85-4.559 4.25-4.924zm9 13.174h-12.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h12.5c.414 0 .75.336.75.75s-.336.75-.75.75zm0-3.25h-1.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h1.5c.414 0 .75.336.75.75s-.336.75-.75.75zm0-2.75h-1.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h1.5c.414 0 .75.336.75.75s-.336.75-.75.75zm0-3h-1.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h1.5c.414 0 .75.336.75.75s-.336.75-.75.75zm0-2.75h-1.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h1.5c.414 0 .75.336.75.75s-.336.75-.75.75z"})}),(0,i.jsx)("br",{})]}),(0,i.jsx)("div",{className:"text-center medium",children:"No. of Gifts"}),(0,i.jsx)(r.Ay,{className:"block text-center big poppins",end:E,duration:.5})]})}),(0,i.jsx)("div",{className:"card2 clickable",style:{padding:"30px 15px"},onClick:()=>{$.push("/user/report?type=Pledge")},children:(0,i.jsxs)("div",{className:"m-auto",children:[(0,i.jsxs)("div",{className:"flex flex-row",children:[(0,i.jsx)("svg",{id:"Pledge",className:"m-auto",width:60,height:60,fill:"#72D61B","enable-background":"new 0 0 509.74 509.74",viewBox:"0 0 509.74 509.74",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsxs)("g",{children:[(0,i.jsx)("path",{d:"m390.005 87.234h119.735c0-33.064-26.803-59.867-59.867-59.867s-59.868 26.803-59.868 59.867z"}),(0,i.jsx)("path",{d:"m449.872 482.373c33.064 0 59.867-26.803 59.867-59.867h-119.734c0 33.064 26.804 59.867 59.867 59.867z"}),(0,i.jsx)("path",{d:"m205.172 317.536c-10.575 0-19.868 5.486-25.189 13.768-5.321-8.282-14.614-13.768-25.189-13.768-16.524 0-29.919 13.395-29.919 29.919 0 20.074 13.517 40.44 55.108 70.067 41.591-29.627 55.108-49.993 55.108-70.067 0-16.524-13.395-29.919-29.919-29.919z"}),(0,i.jsx)("path",{d:"m359.859 440.976v-372.213c0-30.183 24.468-54.65 54.65-54.65h-359.759c-30.237 0-54.75 24.468-54.75 54.65v372.213c0 30.183 24.513 54.65 54.75 54.65h359.76c-30.183 0-54.651-24.467-54.651-54.65zm-249.942-347.442h140.024v30h-140.024zm137.115 303.507c-10.764 14.185-26.539 28.457-49.643 44.915l-17.406 12.399-17.406-12.399c-23.105-16.458-38.879-30.73-49.643-44.915-12.152-16.014-18.059-32.233-18.059-49.586 0-33.039 26.879-59.919 59.919-59.919 8.869 0 17.431 1.93 25.189 5.517 7.758-3.587 16.32-5.517 25.189-5.517 33.039 0 59.919 26.88 59.919 59.919 0 17.353-5.907 33.573-18.059 49.586zm20.541-144.882h-175.288v-30h175.288zm12.308-65.298h-199.902v-30h199.902z"})]})}),(0,i.jsx)("br",{})]}),(0,i.jsx)("div",{className:"text-center medium",children:"Active Pledges"}),(0,i.jsx)(r.Ay,{className:"block text-center big poppins",end:_,duration:.5})]})}),(0,i.jsx)("div",{className:"card2 clickable",style:{padding:"30px 15px"},onClick:()=>{$.push("/user/report")},children:(0,i.jsxs)("div",{className:"m-auto",children:[(0,i.jsxs)("div",{className:"flex flex-row",children:[(0,i.jsxs)("svg",{id:"Total",className:"m-auto",width:60,height:60,fill:"#F5A43A",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 55.478 55.478",children:[(0,i.jsx)("path",{id:"Path_24","data-name":"Path 24",d:"M0,310v20.262a1.625,1.625,0,0,0,1.625,1.625H53.852a1.625,1.625,0,0,0,1.625-1.
1625V310Zm48.976,13.761a1.625,1.625,0,0,1-1.625,1.625H8.127A1.625,1.625,0,0,1,6.5,323.761v-8.885a1.625,1.625,0,0,1,1.625-1.625H47.351a1.625,1.625,0,0,1,1.625,1.625Z",transform:"translate(0 -276.41)",fill:"#f5a43a"}),(0,i.jsx)("path",{id:"Path_25","data-name":"Path 25",d:"M90,370h35.974v5.634H90Z",transform:"translate(-80.248 -329.909)",fill:"#f5a43a"}),(0,i.jsx)("path",{id:"Path_26","data-name":"Path 26",d:"M266.381,121.266a1.677,1.677,0,0,0-1.072-1.927v3.48A2.24,2.24,0,0,0,266.381,121.266Z",transform:"translate(-236.562 -106.408)",fill:"#f5a43a"}),(0,i.jsx)("path",{id:"Path_27","data-name":"Path 27",d:"M240.332,67.9a1.614,1.614,0,0,0-.576.97,1.122,1.122,0,0,0,.279,1.087c.09.071.19.14.3.209Z",transform:"translate(-213.752 -60.547)",fill:"#f5a43a"}),(0,i.jsx)("path",{id:"Path_28","data-name":"Path 28",d:"M157.919,23.838A11.919,11.919,0,1,0,146,11.919,11.919,11.919,0,0,0,157.919,23.838Zm-4.1-7.491a1.084,1.084,0,0,1,1.5-.314,3.283,3.283,0,0,0,1.442.618V12.075a7.99,7.99,0,0,1-1.634-.955,3.242,3.242,0,0,1-1.071-3.193,3.65,3.65,0,0,1,2.5-2.861c.068-.02.135-.039.2-.057V4.334a1.084,1.084,0,0,1,2.167,0V4.89A3.762,3.762,0,0,1,161.083,6a1.084,1.084,0,0,1-1.628,1.431,1.49,1.49,0,0,0-.528-.313v3.5c.192.071.385.141.573.207a3.878,3.878,0,0,1,2.636,4.387,4.407,4.407,0,0,1-3.209,3.511V19.5a1.084,1.084,0,0,1-2.167,0v-.672a5.246,5.246,0,0,1-2.628-.985,1.083,1.083,0,0,1-.314-1.5Z",transform:"translate(-130.18)",fill:"#f5a43a"}),(0,i.jsx)("path",{id:"Path_29","data-name":"Path 29",d:"M54.8,161.111A1.625,1.625,0,0,0,53.253,160H45.643a15.242,15.242,0,0,1-4.8,6.5H45.56a1.625,1.625,0,1,1,0,3.251H17.388a1.625,1.625,0,1,1,0-3.251H22.1a15.242,15.242,0,0,1-4.8-6.5H9.695a1.625,1.625,0,0,0-1.542,1.111L4.189,173h54.57Z",transform:"translate(-3.735 -142.663)",fill:"#f5a43a"})]}),(0,i.jsx)("br",{})]}),(0,i.jsx)("div",{className:"text-center medium",children:"Dollars"}),(0,i.jsx)(r.Ay,{className:"block text-center big poppins",prefix:"$",separator:",",end:R,duration:.5})]})}),(0,i.jsx)("div",{className:"card2 clickable hidden-sm",style:{padding:"30px 15px"},onClick:()=>{$.push("/page/donate?id="+w)},children:(0,i.jsxs)("div",{className:"m-auto",children:[(0,i.jsxs)("div",{className:"flex flex-row",children:[(0,i.jsx)("svg",{id:"Donation",className:"m-auto",width:60,height:60,fill:"#00298A","enable-background":"new 0 0 511.999 511.999",viewBox:"0 0 511.999 511.999",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsxs)("g",{children:[(0,i.jsx)("path",{d:"m326.679 221.34c21.901 18.576 24.683 21.158 34.321 29.458 7.062-6.057 13.121-11.567 38.804-33.105 47.138-39.581 81.196-68.16 81.196-110.376 0-40.02-29.399-71.367-66.929-71.367-25.21 0-41.938 14.224-52.441 28.711-9.946-14.531-26.118-28.711-51.401-28.711-37.529 0-66.914 31.348-66.914 71.367-.001 43.286 33.164 71.425 83.364 114.023z"}),(0,i.jsx)("path",{d:"m85.8 467.949c39.3-26.699 82.301-36.901 129.101-29.1l75 12.9c28.801 4.801 55.199 3.3 77.999-4.2 47.168-15.72 94.387-65.229 106.901-84 17.401-26.1 26.96-54.6 32.961-68.399 5.7-13.2 5.7-22.5-.3-27.9-6.901-6.301-18.6-3.001-27.301 1.8-13.799 7.8-28.46 30.3-43.46 51.899-19.499 28.2-52.899 45-87.1 45h-108.601v-30h45c79.799 0 115.499-15 115.499-30 0-12.599-24.899-18.3-33.3-20.099-32.699-7.5-106.5-11.1-156.899-33.6-9.089-3.977-19.393-6.209-30.298-6.301-17.098-.145-35.68 5.182-53.403 18.9-.298 0-.298 0-.599.3-11.7 9-27.7 22.2-49.3 41.1-18.301 16.199-36 36.899-66.901 63.3l-10.8 9.3 73.801 97.201z"})]})}),(0,i.jsx)("br",{})]}),(0,i.jsx)("div",{className:"text-center big",children:"Give"})]})})]})]}),(0,i.jsxs)("div",{className:"flex flex-row flex-wrap boxing mt-36 ",children:[(0,i.jsx)("div",{className:"poppins milli ml-10 mt-10 "+W("thiscalyear"),onClick:()=>{L("thiscalyear")},children:" This Calendar Year "}),(0,i.jsx)("div",{className:"poppins milli ml-10 mt-10 "+W("lastyear"),onClick:()=>{L("lastyear")},children:" Last Year "}),(0,i.jsx)("div",{className:"poppins milli ml-10 mt-10 "+W("all"),onClick:()=>{L("all")},children:" All Years "}),(0,i.jsx)("div",{className:"poppins milli ml-10 mt-10 "+W("custom"),onClick:()=>{L("custom")},children:" Custom "}),"custom"==k&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.Ay,{title:"Start Date",children:(0,i.jsx)("input",{className:"dateinput ml-10 poppins milli text-center mt-10",disabled:"custom"!=k,type:"date",id:"startdate",value:z,onChange:e=>{P(e.target.value)}})}),(0,i.jsx)(m.Ay,{title:"End Date",children:(0,i.jsx)("input",{className:"dateinput ml-10 poppins milli text-center mt-10",disabled:"custom"!=k,type:"date",id:"enddate",value:T,onChange:e=>{F(e.target.value)}})})]})]}),(0,i.jsxs)("div",{className:"tablediv",children:["admin"==A&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j.CampaignsTable,{}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{})]}),(0,i.jsx)(p.DonationsTable,{dateFilter:k,customStartDate:z,setcustomStartDate:P,customEndDate:T,setcustomEndDate:F})]}),(0,i.jsx)("br",{})," ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{})," ",(0,i.jsx)("br",{})]})})}function f(){return(0,i.jsx)(s.A,{Component:g,header:!0,footer:!0})}},2308:(e,a,t)=>{"use strict";t.r(a),t.d(a,{DonationsTable:()=>z,default:()=>T});var i=t(4848),l=t(6540),s=t(5099),n=t(8874),d=t(3261),r=t(4505),c=t(6715),o=t(5026),m=t(7284),h=t(3912),u=t(2016),x=t(2163),p=t(7944),j=t(7156),v=t(820),g=t(2104),f=t(9998),b=t(7974),y=t(5904),A=t(586),N=t(8296),w=t(3051),C=t(5093),D=t.n(C);let k=t(6425);function S(){let[e,a]=(0,l.useState)(""),[t,s]=(0,l.useState)(null),[d,r]=(0,l.useState)(""),m=(0,c.useRouter)(),h=(0,n.rX)("type");return(0,l.useEffect)(()=>{m.query&&m.query.i&&s(m.query.i),m.query&&m.query.type&&r(m.query.type)},[m]),(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"p-50 mx-auto",children:[(0,i.jsx)("h1",{children:"Reports"}),t&&(0,i.jsxs)("h3",{children:["Filtered for Campaign"," ",(0,i.jsx)(o.A,{variant:"contained",onClick:()=>s(null),children:"Clear"})]}),d&&(0,i.jsxs)("h3",{children:["Filtered for Donation Type - ",d,(0,i.jsx)(o.A,{variant:"contained",onClick:()=>r(null),children:"Clear"})]}),"user"!=h&&(0,i.jsx)(o.A,{variant:"contained",color:"primary",href:"/user/chart",children:"Charts"}),(0,i.jsx)("div",{className:"clearfix",children:"\xa0"}),(0,i.jsx)(z,{SearchText:e,filterCampaign:t,filterType:d})]})})}let z=e=>{let{SearchText:a="",filterCampaign:t=null,filterType:d="",dateFilter:o="",customStartDate:h="",customEndDate:u="",setcustomStartDate:x=null,
1setcustomEndDate:p=null}=e,j=(0,c.useRouter)(),v=(0,n.rX)("type"),[g,f]=(0,l.useState)([]);(0,l.useEffect)(()=>{if(h&&D()(h).isAfter(u)){x(u),p(h);return}(async()=>{k.post("/api/Donation",{action:"list",userId:localStorage.userid,type:localStorage.type,SearchText:a,filter:o,customStartDate:h,customEndDate:u}).then(e=>{if(e&&e.data&&Array.isArray(e.data)){let a=[],t=1;e.data.forEach(e=>{var i,l,s,d,r,c,o,m,h,u;e.ownerDetails[0]&&e.ownerDetails[0].name&&e.ownerDetails[0].name;let x="";e.campaignDetails[0]&&e.campaignDetails[0].title&&(x=e.campaignDetails[0].title),a.push((i=e._id,l=t++,s=e.creationDate,d=e.firstname+" "+e.lastname,r="$ "+(0,n.ej)(e.amount),c=e.email,o=e.phone,m=e.donorType,h=e.campaignId,u="$ "+(0,n.ej)(0),{dataid:i,id:l,date:s,name:d,amount:r,email:c,phone:o,fund:"N/A",marketing:"",attr:"",relation:m,campaignId:h,tax:u,gross:"$ "+(0,n.ej)(e.amount),campaign:x,PaymentMethod:"Online",gifttype:"onetime"==e.gifttype?"One-Time":"pledge"==e.gifttype?"Pledge":e.gifttype}))}),f(a)}})})()},[a,o,h,u]);let b=async function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a&&(0,n.F4)(a),(0,r.Ay)("Deleting ...");let t=[],i=[];g.map(a=>{-1!=e.indexOf(a.id)?t.push(a.dataid):i.push(a)}),await k.post("/api/Donation",{action:"delete",list:t}),r.Ay.dismiss(),r.Ay.success("Deleted"),f(i)},y=t?g.filter(e=>e.campaignId==t):g;d&&(y=y.filter(e=>e.gifttype==d));for(let e=1;e<=y.length;e++)y[e-1].id=e;return(0,i.jsx)(s.A,{title:(0,i.jsxs)(i.Fragment,{children:["Total Donations: ",y.length," ",-1==j.route.indexOf("report")?(0,i.jsx)("a",{className:"small ml-50",href:"/user/report",children:"View All"}):""," "]}),headCells:"user"==v?[{id:"id",numeric:!0,label:"#",className:"hidden-md"},{id:"date",label:"Date",className:"hidden-sm"},{id:"fund",label:"Fund",className:"hidden-md"},{id:"campaign",label:"Campaign",className:"hidden-xs"},{id:"amount",numeric:!0,label:"Gift Amount"},{id:"tax",numeric:!0,label:"Goods or Services Rec.",className:"hidden-md"},{id:"gross",numeric:!0,label:"Tax Deductible Amt",className:"hidden-md"},{id:"PaymentMethod",label:"PaymentMethod",className:"hidden-md"},{id:"gifttype",label:"Gift Type",className:"hidden-md"},{id:"message",label:""}]:[{id:"id",numeric:!0,label:"#",className:"hidden-md"},{id:"date",label:"Date",className:"hidden-sm"},{id:"name",label:"Name",className:"hidden-sm"},{id:"email",label:"Email",className:"hidden-sm"},{id:"phone",numeric:!0,label:"Phone",className:"hidden-sm"},{id:"fund",label:"Fund",className:"hidden-md"},{id:"campaign",label:"Campaign",className:"hidden-xs"},{id:"amount",numeric:!0,label:"Gift Amount"},{id:"tax",numeric:!0,label:"Goods or Services Rec.",className:"hidden-md"},{id:"gross",numeric:!0,label:"Tax Deductible Amt",className:"hidden-md"},{id:"marketing",label:"Marketing Appeal",className:"hidden-md"},{id:"attr",label:"Attribute",className:"hidden-md"},{id:"relation",label:"Relationship Type",className:"hidden-sm"},{id:"PaymentMethod",label:"PaymentMethod",className:"hidden-md"},{id:"gifttype",label:"Gift Type",className:"hidden-md"},{id:"message",label:""}],rows:y,renderEnd:e=>(0,i.jsx)(m.A,{style:{padding:8},children:"user"!=v&&(0,i.jsx)(P,{row:e,deleteData:b})}),onDelete:b,rowClick:e=>{j.push("/user/donation?i="+e)}})};function P(e){let{row:a,deleteData:t}=e,[s,d]=l.useState(!1),r=l.useRef();return(0,i.jsxs)(l.Fragment,{children:[(0,i.jsxs)(h.A,{style:{marginRight:10,color:"#fff !important"},ref:r,"aria-label":"split button",children:[(0,i.jsx)(u.Ay,{title:"Open",children:(0,i.jsxs)(o.A,{variant:"contained",color:"primary",size:"small",style:{color:"#fff !important",minWidth:100},onClick:e=>{(0,n.F4)(e),window.location.href="mailto:"+a.email+"?subject=Donation Received&body=Thank you for your donation."},href:"mailto:"+a.email,children:[(0,i.jsx)(b.A,{})," \xa0 Email"]})}),(0,i.jsx)(o.A,{variant:"contained",color:"primary",size:"small","aria-controls":s?"split-button-menu":void 0,"aria-expanded":s?"true":void 0,"aria-label":"extra options","aria-haspopup":"menu",onClick:e=>{(0,n.F4)(e),d(e=>!e)},children:(0,i.jsx)(y.A,{})})]}),(0,i.jsx)(x.A,{sx:{zIndex:1},open:s,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,style:{zIndex:100},children:e=>{let{TransitionProps:l,placement:s}=e;return(0,i.jsx)(p.A,{...l,style:{transformOrigin:"bottom"===s?"center top":"center bottom"},children:(0,i.jsx)(j.A,{children:(0,i.jsx)(v.A,{onClickAway:()=>{d(!1)},children:(0,i.jsxs)(g.A,{id:"split-button-menu",autoFocusItem:!0,children:[(0,i.jsxs)(f.A,{onClick:e=>t([a.id],e),children:[(0,i.jsx)(A.A,{})," \xa0 Refund"]}),(0,i.jsxs)(f.A,{className:"editBtn",children:[(0,i.jsx)(N.A,{})," \xa0 Edit"]}),(0,i.jsxs)(f.A,{className:"deleteBtn",onClick:e=>t([a.id],e),children:[(0,i.jsx)(w.A,{})," \xa0 Delete"]})]})})})})}})]})}let T=()=>(0,i.jsx)(d.A,{Component:S,header:!0,footer:!0})}},e=>{var a=a=>e(e.s=a);e.O(0,[3197,3478,9906,8037,9736,6425,1021,1679,9830,6938,1274,1533,571,636,6593,8792],()=>a(1568)),_N_E=e.O()}]);
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.