1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3115],{7468:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/import",function(){return a(1823)}])},8874:(e,t,a)=>{"use strict";a.d(t,{$W:()=>l,Bq:()=>p,DT:()=>h,F4:()=>u,QV:()=>S,Sk:()=>y,WJ:()=>x,bg:()=>m,ej:()=>C,ki:()=>f,n4:()=>g,nW:()=>c,rX:()=>d,w4:()=>v,wx:()=>j});var r=a(6540),n=a(4335),s=a(8465),i=a.n(s),o=a(8122);let l={adminMail:"[email protected]",server:"https://donation.divyavrat.com/"},c=e=>{(0,r.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,a]=(0,r.useState)("");return(0,r.useEffect)(()=>{a(localStorage[e]||"")},[]),t},u=e=>{e&&(e.preventDefault(),e.stopPropagation())},m=()=>{"admin"!=localStorage.type&&(window.location.href="/")},p=e=>e.replace(/(^[,\s]+)|([,\s]+$)/g,""),h=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()),g=e=>{let t=e.slice(0,12).replace(/\D/g,""),a=t.match(/^(\d{1,3})(\d{0,3})(\d{0,4})$/);return a&&(t="".concat(a[1]).concat(a[2]?" ":"").concat(a[2]).concat(a[3]?"-":"").concat(a[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)},f=e=>{n.A.post("/api/mail",e)},j=e=>e;function y(e){return new Promise((t,a)=>{let r=new FileReader;r.onloadend=()=>t(r.result),r.readAsDataURL(e)})}async function v(e){try{return await (0,o.A)(e,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0})}catch(e){console.log(e)}}let C=e=>e&&e.toString?e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):e,S=(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,a)=>{"use strict";a.d(t,{A:()=>x});var r=a(4848),n=a(6540),s=a(5556),i=a.n(s),o=a(6715),l=a(6752),c=a(4968),d=a(9998),u=a(3422),m=a(4335),p=a(8874);function h(){let e=(0,o.useRouter)(),[t,a]=(0,n.useState)(0),[s,i]=(0,n.useState)(null),[h,g]=(0,n.useState)(null),x=(0,p.rX)("userImage"),f=(0,p.rX)("type")||"user",j=(0,p.rX)("lastPage");return(0,n.useEffect)(()=>{localStorage.org&&i(localStorage.org?JSON.parse(localStorage.org).image:null),"admin"==localStorage.type&&((0,p.bg)(),(async()=>{m.A.post("/api/mail",{type:"list"}).then(e=>{if(e&&e.data){var t;a(null===(t=e.data)||void 0===t?void 0:t.length)}})})())},[]),(0,r.jsxs)("header",{children:[(0,r.jsxs)("div",{className:"nav thin",children:[(0,r.jsx)("input",{type:"checkbox",id:"nav-check"}),(0,r.jsx)("div",{className:"nav-header",children:(0,r.jsx)("div",{className:"nav-title",children:(0,r.jsx)("a",{href:"/user/home",children:(0,r.jsx)("img",{className:"logo",alt:"",src:(0,p.wx)(s)||"/logo.png",onError:e=>{"/logo.png"!=e.target.src&&(e.target.src="/logo.png")}})})})}),(0,r.jsx)("div",{className:"nav-btn",children:(0,r.jsxs)("label",{htmlFor:"nav-check",children:[(0,r.jsx)("span",{}),(0,r.jsx)("span",{}),(0,r.jsx)("span",{})]})}),(0,r.jsxs)("div",{className:"nav-links",children:[(0,r.jsx)("a",{href:"/user/home",children:"Home"}),(0,r.jsx)("a",{href:"/user/report",children:"Reports"}),("org"==f||"admin"==f)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"/user/campaign",children:"Campaigns"}),(0,r.jsx)("a",{href:"/user/import",children:"Import"}),(0,r.jsx)("a",{href:"/user/integration",children:"Integration"})]}),"org"==f&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("a",{href:"/user/create",children:"Start New Campaign"})}),"admin"==f&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"/admin/clients",children:"Clients"}),(0,r.jsx)("a",{href:"/admin/notification",children:(0,r.jsx)(l.A,{badgeContent:t,color:"primary",children:(0,r.jsx)(u.A,{})})})]}),"user"==f&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("a",{href:"/page/donate?id="+j,children:"GIVE"})}),(0,r.jsx)("a",{style:{padding:0,marginRight:40},id:"menu-button","aria-controls":"headerMenu","aria-haspopup":"true",onClick:e=>g(e.currentTarget),children:(0,r.jsx)("img",{alt:"User",src:(0,p.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,r.jsxs)(c.A,{id:"headerMenu",anchorEl:h,open:!!h,onClose:()=>g(null),MenuListProps:{"aria-labelledby":"menu-button"},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:[(0,r.jsx)(d.A,{onClick:()=>e.push("/user/profile"),children:"Profile"}),(0,r.jsx)(d.A,{href:"/",onClick:()=>{localStorage.clear(),e.push("/")},children:"Logout"})]})]})}function g(){let e=(0,p.rX)("type");return(0,r.jsxs)("footer",{className:"thin",children:[(0,r.jsxs)("a",{href:"/",className:"flex flex-row flex-center",children:[(0,r.jsx)("span",{className:"hidden-xs mr-20",children:"Powered by "}),(0,r.jsx)("img",{src:"/logo.png",className:"logo",alt:""})]}),(0,r.jsxs)("div",{id:"FooterRightLinks",className:"ml-auto",children:["admin"!=e&&(0,r.jsx)("a",{href:"/page/helpmessage",className:"mr-20",children:"Message to Admin"}),(0,r.jsx)("a",{href:"/page/contact",className:"mr-20",children:"Contact Us"})]})]})}
1function x(e){let{header:t,footer:a,children:s,className:i,background:l,Component:c,pageProps:d}=e,u=(0,o.useRouter)();return(0,n.useEffect)(()=>{let e=document.querySelector("#jss-server-side");e&&e.parentElement.removeChild(e)},[]),(0,n.useEffect)(()=>{u&&u.pathname&&(-1!=u.pathname.indexOf("user")||-1!=u.pathname.indexOf("admin"))&&!localStorage.userid&&u.push("/")},[u]),(0,r.jsxs)("main",{className:"loggedinLayout "+i,children:[t&&(0,r.jsx)(h,{}),(0,r.jsx)(c,{...d}),s&&(0,r.jsx)("section",{children:s}),a&&(0,r.jsx)(g,{}),(0,r.jsx)("style",{children:l?"\n main{\n background:#3D652A url('".concat(l,"') no-repeat center center;\n background-size:cover;\n }\n "):t?"main{background:#F9F9FB;}":""})]})}x.propTypes={Component:i().func.isRequired}},1823:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>p});var r=a(4848),n=a(6540),s=a(3261),i=a(5026),o=a(4511),l=a(9998),c=a(4505),d=a(8874);let u=a(6425);function m(){let e=(0,d.rX)("type"),t=(0,d.rX)("userid"),[a,s]=(0,n.useState)([]),[m,p]=(0,n.useState)(""),[h,g]=(0,n.useState)([]),[x,f]=(0,n.useState)("");(0,n.useEffect)(()=>{u.post("/api/Campaign/General",{action:"list",type:e,userId:t}).then(e=>{e.data&&Array.isArray(e.data)&&g(e.data)})},[e,t]);let j=async()=>{if(!x){c.Ay.error("Select a Campaign");return}p("Processing...");let e=0;for(let t of a)if(t.email)try{let a=t.name?t.name.split(" "):["Guest"],r=a[0],n=a.slice(1).join(" ")||"";await u.post("/api/User",{action:"signup",name:t.name,email:t.email,password:"importedUser123"}),t.amount&&parseFloat(t.amount)>0&&(await u.post("/api/Donation",{action:"create",campaignId:x,amount:parseFloat(t.amount),email:t.email,firstname:r,lastname:n,donorType:"Friend",userId:"imported",ownerId:localStorage.userid}),e++)}catch(e){console.error(e)}p("Import Completed! Processed ".concat(e," donations.")),c.Ay.success("Import Completed")};return(0,r.jsxs)("div",{className:"p-50",children:[(0,r.jsx)("h2",{children:"Import Donors & Donations"}),(0,r.jsx)("p",{children:"Upload a CSV with columns: Name, Email, Amount"}),(0,r.jsxs)("div",{style:{marginBottom:20},children:[(0,r.jsx)("p",{children:"Select Target Campaign:"}),(0,r.jsxs)(o.A,{value:x,onChange:e=>f(e.target.value),displayEmpty:!0,fullWidth:!0,children:[(0,r.jsx)(l.A,{value:"",disabled:!0,children:"Select Campaign"}),h.map(e=>(0,r.jsx)(l.A,{value:e._id,children:e.title},e._id))]})]}),(0,r.jsx)("input",{type:"file",accept:".csv",onChange:e=>{let t=e.target.files[0],a=new FileReader;a.onload=e=>{s(e.target.result.split("\n").map(e=>{let t=e.split(",");return{name:t[0],email:t[1],amount:t[2]}}))},a.readAsText(t)}}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)(i.A,{variant:"contained",color:"primary",onClick:j,disabled:0===a.length,children:"Start Import"}),m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:m}),(0,r.jsx)("pre",{children:JSON.stringify(a.slice(0,5),null,2)})]})]})}function p(){return(0,r.jsx)(s.A,{Component:m,header:!0,footer:!0})}}},e=>{var t=t=>e(e.s=t);e.O(0,[3478,9906,8037,9736,6425,636,6593,8792],()=>t(7468)),_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.