1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[571],{5099:(e,t,l)=>{l.d(t,{A:()=>$});var a=l(4848),r=l(6540),n=l(5556),i=l.n(n),s=l(53),o=l(7768),c=l(9957),d=l(6904),h=l(2480),u=l(2016),g=l(9700),m=l(3928),p=l(5026),x=l(5626),j=l(5312),f=l(8302),b=l(3772),A=l(7893),y=l(7284),v=l(6658),C=l(5985),w=l(2368),k=l(3020),S=l(3112),N=l(1339),R=l(1896),P=l(9976),F=l(2678),E=l(1752),L=l(5374),O=l(7156),B=l(8289),T=l(3051),q=l(3006),D=l(9969),W=l(1052),z=l(4053),V=l(5150),X=l(8874);let H=(0,o.A)(e=>({root:{display:"flex",marginTop:e.spacing(1),overflowX:"hide"},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:(0,c.a)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},toolbartitle:{flex:"1 1 100%"},toolbarselected:{flex:"1 1 100%"}})),I=e=>{let{numSelected:t,title:l,onDelete:n,selected:i,setSelected:o,renderFilter:c,searchText:b,setsearchText:A,onFullscreen:y}=e,[v,C]=(0,r.useState)(!1),w=H();return l?(0,a.jsx)(d.A,{className:(0,s.A)(w.root,{[w.highlight]:n&&t>0}),children:n&&t>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.A,{color:"inherit",variant:"subtitle1",component:"p",children:(0,a.jsxs)("span",{className:w.toolbarselected,children:[t," selected"]})}),n&&(0,a.jsx)(u.Ay,{title:"Delete",children:(0,a.jsx)(g.A,{"aria-label":"delete",onClick:()=>{(0,X.QV)(()=>{n(i),o([])})},children:(0,a.jsx)(T.A,{})})}),c&&(0,a.jsx)(u.Ay,{title:"Filter list",children:(0,a.jsx)(g.A,{"aria-label":"filter list",children:(0,a.jsx)(q.A,{onClick:()=>{C(!v)}})})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.A,{color:"inherit",component:"p",children:(0,a.jsx)("span",{className:w.toolbartitle,children:l})}),(0,a.jsx)(m.A,{style:{marginLeft:"auto"},sx:{m:1,width:"25ch"},variant:"standard",children:(0,a.jsx)(u.Ay,{title:"Export to CSV",children:(0,a.jsx)(p.A,{"aria-label":"export-csv",onClick:null==c?void 0:c.exportCSV,style:{marginLeft:8},children:"Export"})})}),(0,a.jsx)(u.Ay,{title:"View Fullscreen",children:(0,a.jsx)(g.A,{"aria-label":"fullscreen",onClick:y,style:{marginLeft:8},children:(0,a.jsx)(D.A,{})})}),(0,a.jsxs)(m.A,{style:{marginLeft:20},sx:{m:1,width:"25ch"},variant:"standard",children:[(0,a.jsx)(x.A,{htmlFor:"filled-adornment-search",children:"Search"}),(0,a.jsx)(j.A,{id:"filled-adornment-search",type:"text",value:b,onChange:e=>{var t;return A(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.value)},endAdornment:(0,a.jsx)(f.A,{position:"end",children:(0,a.jsx)(g.A,{"aria-label":"search",edge:"end",children:(0,a.jsx)(W.A,{})})})})]})]})}):null};function M(e,t,l){return t[l]<e[l]?-1:t[l]>e[l]?1:0}function U(e){let{classes:t,onSelectAllClick:l,onDelete:r,order:n,orderBy:i,numSelected:s,rowCount:o,onRequestSort:c,headCells:d}=e,h=e=>t=>{c(t,e)};return(0,a.jsx)(b.A,{children:(0,a.jsxs)(A.A,{children:[r&&(0,a.jsx)(y.A,{padding:"checkbox",className:t.tableCell,children:o>0&&(0,a.jsx)(v.A,{indeterminate:s>0&&s<o,checked:o>0&&s===o,onChange:l,inputProps:{"aria-label":"select all"}})}),d.map(e=>(0,a.jsx)(y.A,{padding:e.disablePadding?"none":"normal",sortDirection:i===e.id&&n,className:t.tableHeaderCell+" "+t.tableCell+" "+e.className,style:e.style,children:(0,a.jsx)(C.A,{active:i===e.id,direction:i===e.id?n:"asc",onClick:h(e.id),children:e.label})},e.id)),(0,a.jsx)(y.A,{className:t.tableHeaderCell+" "+t.tableCell,children:"Details"})]})})}I.propTypes={numSelected:i().number.isRequired},U.propTypes={classes:i().object.isRequired,numSelected:i().number.isRequired,onRequestSort:i().func.isRequired,onSelectAllClick:i().func.isRequired,order:i().oneOf(["asc","desc"]).isRequired,orderBy:i().string.isRequired,rowCount:i().number.isRequired};let _=(0,o.A)(e=>({root:{display:"flex",marginTop:e.spacing(1),overflowX:"hide"},paper:{width:"100%",marginBottom:e.spacing(1)},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1},table:{minWidth:340},tableRow:{borderBottom:1},tableCell:{paddingRight:4,paddingLeft:8,paddingTop:8,paddingBottom:8,border:"1px solid rgba(224, 224, 224, 1)"},tableHeaderCell:{background:"rgba(150,150,150,0.1)"}}));function $(e){let{rows:t,headCells:l,rowBtn:n,renderEnd:i,title:s,onDelete:o,rowClick:c,pagination:d={}}=e,h=_(),[u,m]=r.useState("asc"),[p,x]=r.useState("id"),[j,f]=r.useState([]),[b,C]=r.useState(0),[T,q]=r.useState(!1),[D,W]=r.useState(5),[H,$]=r.useState(t||[]),[G,J]=r.useState(""),[Q,Y]=r.useState(""),[Z,K]=r.useState(!1);(0,r.useEffect)(()=>{$(function(e){if(!G)return e;let t=G;isNaN(t)||(t=(0,X.ej)(t));let l=[];for(let a=0;a<e.length;a++){let r=e[a],n=!1;for(let e of Object.keys(r))"_id"!=e&&"id"!=e&&"dataid"!=e&&r[e]&&r[e].toString()&&-1!=r[e].toString().toLowerCase().indexOf(t.toLowerCase())&&(n=!0);n&&l.push(r)}return l}(t))},[t,G]);let ee=(e,t)=>
1{m(p===t&&"asc"===u?"desc":"asc"),x(t)},et=e=>{if(e.target.checked){f(H.map(e=>e.id));return}f([])},el=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(0,X.F4)(t);let l=j.indexOf(e),a=[];-1===l?a=a.concat(j,e):0===l?a=a.concat(j.slice(1)):l===j.length-1?a=a.concat(j.slice(0,-1)):l>0&&(a=a.concat(j.slice(0,l),j.slice(l+1))),f(a)},ea=(e,t)=>{(0,X.F4)(e),Q!=t?Y(t):Y("")},er=(e,t)=>{C(t)},en=e=>-1!==j.indexOf(e),ei=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"enhanced-table-checkbox-";return(0,a.jsx)(w.A,{children:(0,a.jsxs)(k.A,{className:h.table,"aria-labelledby":"tableTitle",size:T?"small":"medium","aria-label":"enhanced table",children:[(0,a.jsx)(U,{classes:h,numSelected:j.length,order:u,orderBy:p,onSelectAllClick:et,onDelete:o,onRequestSort:ee,rowCount:H.length,headCells:l}),(0,a.jsx)(S.A,{children:(function(e,t){let l=e.map((e,t)=>[e,t]);return l.sort((e,l)=>{let a=t(e[0],l[0]);return 0!==a?a:e[1]-l[1]}),l.map(e=>e[0])})(H,"desc"===u?(e,t)=>M(e,t,p):(e,t)=>-M(e,t,p)).slice(b*D,b*D+D).map((t,r)=>{let s=en(t.id),d="".concat(e).concat(r);return(0,a.jsxs)(A.A,{hover:!0,onClick:e=>{(0,X.F4)(e),c?c(t.dataid):el(t.id)},role:"checkbox","aria-checked":s,tabIndex:-1,selected:s,className:h.tableRow+(c?" clickable":""),style:t.RowStyle,children:[o&&(0,a.jsx)(y.A,{padding:"checkbox",children:(0,a.jsx)(v.A,{checked:s,inputProps:{"aria-labelledby":d},onClick:e=>{el(t.id,e)}})}),(0,a.jsx)(y.A,{component:"th",id:d,scope:"row",className:h.tableCell+" "+l[0].className,children:t.id}),l.map((e,r)=>{if(0!=r&&r!=l.length-1)return(0,a.jsx)(y.A,{className:h.tableCell+" "+e.className,children:t[e.id]},e.id)}),i&&i(t),n&&(0,a.jsx)(y.A,{align:"right",children:n}),(0,a.jsxs)(y.A,{children:[(0,a.jsx)(z.A,{onClick:e=>ea(e,t.id)}),(0,a.jsxs)(N.A,{onClose:e=>ea(e,t.id),open:Q==t.id,maxWidth:"lg",fullWidth:!0,children:[(0,a.jsx)(R.A,{children:"Details"}),(0,a.jsx)(P.A,{style:{padding:20},children:(0,a.jsx)(F.A,{sx:{pt:0},children:l.map(e=>e.label&&"id"!=e.id?(0,a.jsx)(E.A,{disableGutters:!0,children:(0,a.jsx)(L.A,{primary:e.label,secondary:t[e.id]})},e.id):"")})})]})]})]},t.id)})})]})})};return(0,a.jsxs)("div",{className:h.root,children:[(0,a.jsxs)(O.A,{className:h.paper,children:[(0,a.jsx)(I,{numSelected:j.length,title:s,onDelete:o,selected:j,setSelected:f,searchText:G,setsearchText:J,renderFilter:{exportCSV:function(){if(!H.length)return;let e=[],t=l.filter(e=>"id"!==e.id).map(e=>e.label||e.id);e.push(t.join(",")),H.forEach(t=>{let a=l.filter(e=>"id"!==e.id).map(e=>{let l=t[e.id];return"string"==typeof l&&(l='"'+l.replace(/"/g,'""')+'"'),l});e.push(a.join(","))});let a=new Blob([e.join("\n")],{type:"text/csv"}),r=window.URL.createObjectURL(a),n=document.createElement("a");n.setAttribute("hidden",""),n.setAttribute("href",r),n.setAttribute("download",("string"==typeof s?s:"table")+".csv"),document.body.appendChild(n),n.click(),document.body.removeChild(n)}},onFullscreen:()=>K(!0)}),ei(),!0!=d.disabled&&(0,a.jsx)(B.A,{rowsPerPageOptions:[],className:"tablePagination",labelRowsPerPage:"",component:"div",count:H.length,rowsPerPage:D,page:b,onPageChange:er})]}),Z&&(0,a.jsx)("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(255,255,255,0.98)",zIndex:9999,overflow:"auto",padding:24},children:(0,a.jsxs)("div",{style:{position:"relative",maxWidth:"95vw",margin:"0 auto"},children:[(0,a.jsxs)("h2",{style:{marginTop:0},children:[s||"Table",(0,a.jsx)(g.A,{"aria-label":"close",onClick:()=>K(!1),style:{position:"absolute",right:0,top:0},children:(0,a.jsx)(V.A,{})})]}),ei("enhanced-table-checkbox-fullscreen-"),!0!=d.disabled&&(0,a.jsx)(B.A,{rowsPerPageOptions:[],className:"tablePagination",labelRowsPerPage:"",component:"div",count:H.length,rowsPerPage:D,page:b,onPageChange:er})]})})]})}},8874:(e,t,l)=>{l.d(t,{$W:()=>o,Bq:()=>g,DT:()=>m,F4:()=>h,QV:()=>v,Sk:()=>b,WJ:()=>x,bg:()=>u,ej:()=>y,ki:()=>j,n4:()=>p,nW:()=>c,rX:()=>d,w4:()=>A,wx:()=>f});var a=l(6540),r=l(4335),n=l(8465),i=l.n(n),s=l(8122);let o={adminMail:"[email protected]",server:"https://donation.divyavrat.com/"},c=e=>{(0,a.useEffect)(()=>{let t=document.createElement("script");return t.src=e,t.async=!0,document.body.appendChild(t),()=>{document.body.removeChild(t)}},[e])},d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",[t,l]=(0,a.useState)("");return(0,a.useEffect)(()=>
1{l(localStorage[e]||"")},[]),t},h=e=>{e&&(e.preventDefault(),e.stopPropagation())},u=()=>{"admin"!=localStorage.type&&(window.location.href="/")},g=e=>e.replace(/(^[,\s]+)|([,\s]+$)/g,""),m=e=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase()),p=e=>{let t=e.slice(0,12).replace(/\D/g,""),l=t.match(/^(\d{1,3})(\d{0,3})(\d{0,4})$/);return l&&(t="".concat(l[1]).concat(l[2]?" ":"").concat(l[2]).concat(l[3]?"-":"").concat(l[3])),t},x=e=>{var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(t)},j=e=>{r.A.post("/api/mail",e)},f=e=>e;function b(e){return new Promise((t,l)=>{let a=new FileReader;a.onloadend=()=>t(a.result),a.readAsDataURL(e)})}async function A(e){try{return await (0,s.A)(e,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0})}catch(e){console.log(e)}}let y=e=>e&&e.toString?e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):e,v=(e,t)=>{i().fire({title:"Are you sure?",text:"You won't be able to revert this!",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, delete it!"}).then(t=>{t.isConfirmed&&(e(),i().fire("Deleted!","Successfully deleted.","success"))})}},3261:(e,t,l)=>{l.d(t,{A:()=>x});var a=l(4848),r=l(6540),n=l(5556),i=l.n(n),s=l(6715),o=l(6752),c=l(4968),d=l(9998),h=l(3422),u=l(4335),g=l(8874);function m(){let e=(0,s.useRouter)(),[t,l]=(0,r.useState)(0),[n,i]=(0,r.useState)(null),[m,p]=(0,r.useState)(null),x=(0,g.rX)("userImage"),j=(0,g.rX)("type")||"user",f=(0,g.rX)("lastPage");return(0,r.useEffect)(()=>{localStorage.org&&i(localStorage.org?JSON.parse(localStorage.org).image:null),"admin"==localStorage.type&&((0,g.bg)(),(async()=>{u.A.post("/api/mail",{type:"list"}).then(e=>{if(e&&e.data){var t;l(null===(t=e.data)||void 0===t?void 0:t.length)}})})())},[]),(0,a.jsxs)("header",{children:[(0,a.jsxs)("div",{className:"nav thin",children:[(0,a.jsx)("input",{type:"checkbox",id:"nav-check"}),(0,a.jsx)("div",{className:"nav-header",children:(0,a.jsx)("div",{className:"nav-title",children:(0,a.jsx)("a",{href:"/user/home",children:(0,a.jsx)("img",{className:"logo",alt:"",src:(0,g.wx)(n)||"/logo.png",onError:e=>{"/logo.png"!=e.target.src&&(e.target.src="/logo.png")}})})})}),(0,a.jsx)("div",{className:"nav-btn",children:(0,a.jsxs)("label",{htmlFor:"nav-check",children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]})}),(0,a.jsxs)("div",{className:"nav-links",children:[(0,a.jsx)("a",{href:"/user/home",children:"Home"}),(0,a.jsx)("a",{href:"/user/report",children:"Reports"}),("org"==j||"admin"==j)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("a",{href:"/user/campaign",children:"Campaigns"}),(0,a.jsx)("a",{href:"/user/import",children:"Import"}),(0,a.jsx)("a",{href:"/user/integration",children:"Integration"})]}),"org"==j&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("a",{href:"/user/create",children:"Start New Campaign"})}),"admin"==j&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("a",{href:"/admin/clients",children:"Clients"}),(0,a.jsx)("a",{href:"/admin/notification",children:(0,a.jsx)(o.A,{badgeContent:t,color:"primary",children:(0,a.jsx)(h.A,{})})})]}),"user"==j&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("a",{href:"/page/donate?id="+f,children:"GIVE"})}),(0,a.jsx)("a",{style:{padding:0,marginRight:40},id:"menu-button","aria-controls":"headerMenu","aria-haspopup":"true",onClick:e=>p(e.currentTarget),children:(0,a.jsx)("img",{alt:"User",src:(0,g.wx)(x)||"/img/user.jpg",onError:e=>{"/img/user.jpg"!=e.target.src&&(e.target.src="/img/user.jpg")},className:"img-fluid img-fit border-circle nav-avatar"})})]})]}),(0,a.jsxs)(c.A,{id:"headerMenu",anchorEl:m,open:!!m,onClose:()=>p(null),MenuListProps:{"aria-labelledby":"menu-button"},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:[(0,a.jsx)(d.A,{onClick:()=>e.push("/user/profile"),children:"Profile"}),(0,a.jsx)(d.A,{href:"/",onClick:()=>{localStorage.clear(),e.push("/")},children:"Logout"})]})]})}function p(){let e=(0,g.rX)("type");return(0,a.jsxs)("footer",{className:"thin",children:[(0,a.jsxs)("a",{href:"/",className:"flex flex-row flex-center",children:[(0,a.jsx)("span",{className:"hidden-xs mr-20",children:"Powered by "}),(0,a.jsx)("img",{src:"/logo.png",className:"logo",alt:""})]}),(0,a.jsxs)("div",{id:"FooterRightLinks",className:"ml-auto",children:["admin"!=e&&(0,a.jsx)("a",{href:"/page/helpmessage",className:"mr-20",children:"Message to Admin"}),(0,a.jsx)("a",{href:"/page/contact",className:"mr-20",children:"Contact Us"})]})]})}
1function x(e){let{header:t,footer:l,children:n,className:i,background:o,Component:c,pageProps:d}=e,h=(0,s.useRouter)();return(0,r.useEffect)(()=>{let e=document.querySelector("#jss-server-side");e&&e.parentElement.removeChild(e)},[]),(0,r.useEffect)(()=>{h&&h.pathname&&(-1!=h.pathname.indexOf("user")||-1!=h.pathname.indexOf("admin"))&&!localStorage.userid&&h.push("/")},[h]),(0,a.jsxs)("main",{className:"loggedinLayout "+i,children:[t&&(0,a.jsx)(m,{}),(0,a.jsx)(c,{...d}),n&&(0,a.jsx)("section",{children:n}),l&&(0,a.jsx)(p,{}),(0,a.jsx)("style",{children:o?"\n main{\n background:#3D652A url('".concat(o,"') no-repeat center center;\n background-size:cover;\n }\n "):t?"main{background:#F9F9FB;}":""})]})}x.propTypes={Component:i().func.isRequired}}}]);
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.