1"use strict";(self.webpackChunkiqra_admin=self.webpackChunkiqra_admin||[]).push([[180],{97905:function(n,e,t){t(47313);t.p},54285:function(n,e,t){var r=t(29439),i=t(47313),s=t(56573);e.Z=function(){var n=(0,i.useState)({}),e=(0,r.Z)(n,2),t=e[0],o=e[1],a=(0,i.useState)(""),u=(0,r.Z)(a,2),c=u[0],l=u[1],d=(0,i.useState)(),p=(0,r.Z)(d,2),f=p[0],m=p[1];return{response:t,auth:function(n,e){l(""),s.Z.post(n,e).then((function(n){console.log(n),o(n.data),m(n.status)})).catch((function(n){console.log(n),m(n.response.status),l(n.response.data.message)}))},error:c,status:f}}},72816:function(n,e,t){t.d(e,{$9:function(){return y},CW:function(){return w},EJ:function(){return I},Gu:function(){return x},Hk:function(){return g},J1:function(){return o},MV:function(){return U},Ot:function(){return i},Q4:function(){return m},QO:function(){return f},S$:function(){return j},S7:function(){return E},Sd:function(){return q},UH:function(){return A},Vd:function(){return B},WG:function(){return P},X4:function(){return M},ZX:function(){return S},bc:function(){return z},dx:function(){return l},er:function(){return W},fY:function(){return D},iL:function(){return c},jy:function(){return v},k6:function(){return u},l$:function(){return k},m_:function(){return C},ob:function(){return O},pE:function(){return d},pG:function(){return Z},r6:function(){return s},uU:function(){return a},v2:function(){return r},wH:function(){return p},yD:function(){return b},zn:function(){return h}});var r="https://iqrakitab.net/",i=r+"api/getAllAdmins",s=r+"api/removeRole",o=r+"api/assignRole",a=r+"api/removeRoleAdmin",u=r+"api/assignRoleAdmin",c=r+"api/assignment",l=r+"api/audiobooks",d=r+"api/audiobooks/search",p=r+"api/authors",f=r+"api/categories",m=r+"api/books/all",h=r+"api/books",x=r+"api/books/search",Z=r+"api/user",g=r+"api/books",b=r+"api/quizzes",j=r+"api/countries",v=r+"api/videos",y=r+"api/feedback",w=r+"api/assignCity",k=r+"api/getStats",C=r+"api/getAdminStats",S=r+"api/getAllUsers",P=r+"api/getAllUsers/search",A=r+"api/getCityUsers",E=r+"api/getCityUsers/search",O=r+"api/getTopUsers",U=r+"api/reports/stats",I=r+"api/reports/assignments",M=r+"api/login",D=r+"api/signup",W=r+"api/sharing/leaderboard",q=r+"api/quiz/leaderboard",z=r+"api/send-reset-link",B=r+"api/password-reset"},19646:function(n,e,t){t.r(e),t.d(e,{default:function(){return R}});var r=t(47313),i=t(2135),s=t(19860),o=t(9019),a=t(73428),u=t(93405),c=t(61113),l=t(74165),d=t(15861),p=t(1413),f=t(29439),m=t(36459),h=t(58467),x=t(57829),Z=t(69099),g=t(15480),b=t(24631),j=t(1550),v=t(15103),y=t(49914),w=t(41727),k=t(47131),C=t(74268),S=t(55685),P=t(83929),A=t(5178),E=(t(28089),t(79429)),O=t(23061),U=t(10237),I=t(22611),M=(t(97905),t(85554)),D=t(54285),W=t(22867),q=t(72816),z=t(46417),B=function(n){var e=Object.assign({},((0,m.Z)(n),n)),t=(0,h.s0)(),a=(0,s.Z)(),u=(0,M.I0)(),B=(0,r.useState)(!1),R=(0,f.Z)(B,2),H=R[0],L=R[1],N=(0,r.useState)({email:"",password:"",phonenumber:""}),G=(0,f.Z)(N,2),_=G[0],F=G[1],J=(0,r.useState)(),V=(0,f.Z)(J,2),X=V[0],$=V[1],K=(0,r.useState)("EMAIL"),Q=(0,f.Z)(K,2),T=Q[0],Y=Q[1],nn=(0,D.Z)(),en=nn.response,tn=nn.auth,rn=nn.error,sn=nn.status;(0,r.useEffect)((function(){if(200===sn){var n=1===en.user.roles.filter((function(n){return"ADMIN"===n})).length,e=1===en.user.roles.filter((function(n){return"SUPER_ADMIN"===n})).length;e?(u({type:O.ym,user:(0,p.Z)((0,p.Z)({},en.user),{},{isAdmin:n,isSuperAdmin:e}),token:en.token}),t("/dashboard")):n?en.user.assignedCity?(u({type:O.ym,user:(0,p.Z)((0,p.Z)({},en.user),{},{isAdmin:n,isSuperAdmin:e}),token:en.token}),t("/dashboard")):$("You have not been assigned a city yet!"):$("Only Current Super Admin or Admin can access this portal!")}else $(rn)}),[en,rn]);var on=function(){L(!H)},an=function(n){n.preventDefault()},un=function(){var n=(0,d.Z)((0,l.Z)().mark((function n(){return(0,l.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:tn(q.X4,{email:_.email,password:_.password,phonenumber:_.phonenumber});case 1:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),cn=function(n){n.preventDefault(),$(""),_.email||_.phonenumber?_.password?un():$("Password is required!"):$("Email or phone number is required!")};return(0,z.jsx)(z.Fragment,{children:(0,z.jsx)(E.J9,{children:function(n){var t=n.handleBlur,r=n.isSubmitting;return(0,z.jsxs)("form",(0,p.Z)((0,p.Z)({noValidate:!0,onSubmit:cn},e),{},{children:[(0,z.jsxs)(j.Z,{children:[(0,z.jsx)(A.Z,{id:"signup-type",children:"Sign In With"}),(0,z.jsxs)(S.Z,{"aria-labelledby":"signup-type",name:"signup-type",row:!0,value:T,onChange:function(n){Y(n.target.value)},children:[(0,z.jsx)(P.Z,{value:"EMAIL",control:(0,z.jsx)(C.Z,{}),label:"Email"}),(0,z.jsx)(P.Z,{value:"PHONENUMBER",control:(0,z.jsx)(C.Z,{}),label:"Phone Number"})]})]}),"EMAIL"===T?(0,z.jsx)(b.Z,{fullWidth:!0,label:"Email Address",margin:"normal",name:"email",onBlur:t,onChange:function(n){F((0,p.Z)((0,p.Z)({},_),{},{email:n.target.value}))},type:"email",value:_.email,variant:"outlined"}):(0,z.jsx)(W.Kr,{value:_.phonenumber,fullWidth:!0,defaultCountry:"PK",onChange:function(n){F((0,p.Z)((0,p.Z)({},_),{},{phonenumber:n}))}}),(0,z.jsxs)(j.Z,{fullWidth:!0,sx:{mt:a.spacing(3),mb:a.spacing(1)},children:[(0,z.jsx)(v.Z,{htmlFor:"outlined-adornment-password",children:"Password"}),(0,z.jsx)(y.Z,{id:"outlined-adornment-password",type:H?"text":"password",value:_.password,name:"password",onBlur:t,onChange:function(n){F((0,p.Z)((0,p.Z)({},_),{},{password:n.target.value}))},label:"Password",endAdornment:(0,z.jsx)(w.Z,{position:"end",children:(0,z.jsx)(k.Z,{"aria-label":"toggle password visibility",onClick:on,onMouseDown:an,edge:"end",size:"large",children:H?(0,z.jsx)(U.Z,{}):(0,z.jsx)(I.Z,{})})})})]}),(0,z.jsx)(o.ZP,{container:!0,justifyContent:"flex-end",children:(0,z.jsx)(o.ZP,{item:!0,children:(0,z.jsx)(c.Z,{variant:"subtitle2",color:"secondary",to:"/forget-password",component:i.rU,sx:{textDecoration:"none",pl:4},children:"Forget Password?"})})}),X&&(0,z.jsx)(x.Z,{mt:1,children:(0,z.jsx)(g.Z,{error:!0,children:X})}),(0,z.jsx)(x.Z,{mt:2,children:(0,z.jsx)(Z.Z,{color:"primary",disabled:r,fullWidth:!0,size:"large",type:"submit",variant:"contained",children:"Log In"})})]}))}})})},R=(t(47742),function(){var n=(0,s.Z)();return(0,z.jsx)(o.ZP,{container:!0,justifyContent:"center",alignItems:"center",sx:{backgroundColor:n.palette.common.black,height:"100%",minHeight:"100vh"},children:(0,z.jsx)(o.ZP,{item:!0,xs:11,sm:7,md:6,lg:4,children:(0,z.jsx)(a.Z,{sx:{overflow:"visible",display:"flex",position:"relative","& .MuiCardContent-root":{flexGrow:1,flexBasis:"50%",width:"50%"},maxWidth:"475px",margin:"24px auto"},children:(0,z.jsx)(u.Z,{sx:{p:n.spacing(5,4,3,4)},children:(0,z.jsxs)(o.ZP,{container:!0,direction:"column",spacing:4,justifyContent:"center",children:[(0,z.jsx)(o.ZP,{item:!0,xs:12,children:(0,z.jsx)(o.ZP,{container:!0,justifyContent:"space-between",children:(0,z.jsxs)(o.ZP,{item:!0,children:[(0,z.jsx)(c.Z,{color:"textPrimary",gutterBottom:!0,variant:"h2",children:"Sign in"}),(0,z.jsx)(c.Z,{variant:"body2",color:"textSecondary",children:"To keep connected with us."})]})})}),(0,z.jsx)(o.ZP,{item:!0,xs:12,children:(0,z.jsx)(B,{})}),(0,z.jsx)(o.ZP,{container:!0,justifyContent:"flex-start",sx:{mt:n.spacing(2),mb:n.spacing(1)},children:(0,z.jsx)(o.ZP,{item:!0,children:(0,z.jsx)(c.Z,{variant:"subtitle2",color:"secondary",component:i.rU,to:"/application/register",sx:{textDecoration:"none",pl:4},children:"Create new account"})})})]})})})})})})},45987:function(n,e,t){t.d(e,{Z:function(){return i}});var r=t(63366);function i(n,e){if(null==n)return{};var t,i,s=(0,r.Z)(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}}}]);
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.