1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5845],{98602:function(e,l,i){i.d(l,{kz:function(){return v},xc:function(){return j}});var t=i(85893),s=i(82175),a=i(56309),n=i(16310),d=i(19198),o=i(24430),r=i(67294),c=i(11163),u=i(5152),m=i.n(u);let x=e=>{let l=[{key:"0",label:"News Title (English)",name:"englishTitle",type:"text",validationSchema:n.Z_().required("English News Title Is Required").trim(),required:!0,initialValue:"",className:"col-span-12"},{key:"1",label:"News Title (Hindi)",name:"hindiTitle",required:!0,type:"text",validationSchema:n.Z_().required("Hindi News Title Is Required").trim(),initialValue:"",className:"col-span-12"},{key:"2",label:"Url Title",name:"pageUrl",required:!0,type:"text",validationSchema:n.Z_().required("valid URL Title Is Required").trim(),initialValue:"",className:"col-span-12"},{key:"3",label:"Page Description (English)",name:"englishDescription",required:!0,type:"text",validationSchema:n.Z_().required(" English Page Description Is Required").trim(),initialValue:"",className:"col-span-12"},{key:"4",label:"Page Description (Hindi)",name:"hindiDescription",required:!0,type:"text",validationSchema:n.Z_().required(" Hindi Page Description Is Required").trim(),initialValue:"",className:"col-span-12"},{key:"5",label:"Page Type",name:"pageType",required:!0,type:"text",validationSchema:n.Z_().required("The Page Type Is Required").trim(),initialValue:"",className:"col-span-12"},{key:"6",label:"Status",name:"status",required:!0,type:"select",validationSchema:n.Z_().required("Status Is Required ").trim(),initialValue:"",className:"col-span-12",options:[{label:"Active",value:"active"},{label:"Inactive",value:"inactive"}]}],i=null==l?void 0:l.reduce((e,l)=>(e[null==l?void 0:l.name]=null==l?void 0:l.initialValue,e),{}),t=null==l?void 0:l.reduce((e,l)=>(e[null==l?void 0:l.name]=null==l?void 0:l.validationSchema,e),{});return{frontPageNewsSchema:l,frontPageInitialValues:i,frontPageValidationSchema:t}},h=m()(()=>Promise.all([i.e(2937),i.e(156)]).then(i.t.bind(i,71167,23)),{loadableGenerated:{webpack:()=>[71167]},ssr:!1});var v=()=>{var e;let[l,i]=(0,r.useState)(0),{query:u}=(0,c.useRouter)(),m="";(null==u?void 0:u["whats-new"])&&(m+="whats-new/".concat(null==u?void 0:u["whats-new"]));let{data:v}=(0,o.YE)(m),{frontPageInitialValues:p,frontPageNewsSchema:f,frontPageValidationSchema:g}=x(null==v?void 0:null===(e=v.data)||void 0===e?void 0:e.data),{isLoading:j,mutation:w}=(0,o.Db)(),b=async(e,l)=>{try{var t;let s;let a={englishTitle:e.englishTitle,englishDescription:e.englishDescription,hindiTitle:e.hindiTitle,hindiDescription:e.hindiDescription,pageType:e.pageType,pageUrl:e.pageUrl,status:e.status};(null==(s=(null==u?void 0:u["whats-new"])?await w("whats-new/".concat(null==u?void 0:u["whats-new"]),{method:"PUT",isAlert:!0,body:{...a}}):await w("whats-new",{method:"POST",isAlert:!0,body:{...a}}))?void 0:null===(t=s.results)||void 0===t?void 0:t.success)&&(i(e=>e+1),null==l||l.resetForm())}catch(e){(0,d.J)(e)}},y={toolbar:[[{header:"1"},{header:"2"},{font:[]}],[{size:[]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}],["link","image","video"],["clean"]],clipboard:{matchVisual:!1}},N=["header","font","size","bold","italic","underline","strike","blockquote","list","bullet","indent","link","image","video"];return(0,t.jsx)(s.J9,{initialValues:p,validationSchema:n.Ry(g),onSubmit:b,enableReinitialize:!0,children:e=>(0,t.jsxs)(s.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[f.map(l=>(0,t.jsx)(s.gN,{name:l.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(l.className),children:[(0,t.jsxs)("div",{className:"font-semibold text-themeDarkGray",children:[l.label," ",(null==l?void 0:l.required)?"*":""]}),(0,t.jsx)("div",{className:"w-full",children:(null==l?void 0:l.name)==="englishDescription"||(null==l?void 0:l.name)==="hindiDescription"?(0,t.jsx)(h,{modules:y,formats:N,theme:"snow",value:null==e?void 0:e.values[null==l?void 0:l.name],onChange:i=>e.setFieldValue(l.name,i),className:"h-96 overflow-hidden",style:{borderRadius:"10px",border:"1px solid #04B7F1",background:"#fff"}}):(0,t.jsx)(a.UP,{id:null==l?void 0:l.key,name:null==l?void 0:l.name,type:null==l?void 0:l.type,placeholder:(null==l?void 0:l.type)==="select"?"Select a type":"",value:null==e?void 0:e.values[null==l?void 0:l.name],options:null==l?void 0:l.options,onChange:e.handleChange,onBlur:e.handleBlur,error:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e},null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)("button",{type:"submit",className:"submit text-white bg-primary w-full md:w-48 rounded-md px-4 py-2.5",children:"Submit"})})]})})},p=i(8193),f=i(47516),g=()=>(0,t.jsxs)("section",{className:"global-gap w-full h-full",children:[(0,t.jsx)("div",{className:"dashboard-title flex items-center justify-between p-3 md:p-5 bg-dark rounded-b-lg text-white",children:(0,t.jsx)("h2",{children:"Front Page Details"})}),(0,t.jsxs)("div",{className:"flex flex-col p-3 md:p-5 gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"English Title:"}),(0,t.jsx)("p",{children:"Exciting Film Festival: A Journey Through Cinematic Excellence"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"English Description:"}),(0,t.jsx)("p",{children:"Exciting Film Festival: A Journey Through Cinematic Excellence Exciting Film Festival: A Journey Through Cinematic Excellence"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Hindi Title:"}),(0,t.jsx)("p",{children:"दिलà¤à¤¸à¥à¤ª फिलà¥à¤® महà¥à¤¤à¥à¤¸à¤µ: सिनà¥à¤®à¤¾à¤à¤¿à¤ à¤à¤¤à¥à
1¤à¥à¤·à¥à¤à¤¤à¤¾ à¤à¥ माधà¥à¤¯à¤® सॠà¤à¤ यातà¥à¤°à¤¾"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Hindi Description:"}),(0,t.jsx)("p",{children:"दिलà¤à¤¸à¥à¤ª फिलà¥à¤® महà¥à¤¤à¥à¤¸à¤µ: सिनà¥à¤®à¤¾à¤à¤¿à¤ à¤à¤¤à¥à¤à¥à¤·à¥à¤à¤¤à¤¾ à¤à¥ माधà¥à¤¯à¤® सॠà¤à¤ यातà¥à¤°à¤¾"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Start Date:"}),(0,t.jsx)("p",{children:"Home"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"End Date:"}),(0,t.jsx)("p",{children:"overview"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Status:"}),(0,t.jsx)("p",{children:"Block"})]})]})]}),j=e=>{let{curPage:l}=e,[i,s]=(0,r.useState)(!1),{push:n}=(0,c.useRouter)();return(0,t.jsxs)("div",{className:"w-full flex flex-col justify-between common-card p-3 md:p-5 relative text-sm",children:[(0,t.jsx)("div",{className:"flex flex-col justify-between absolute py-5 right-0 top-0 bottom-0 gap-3",children:[...Array(6)].map((e,l)=>(0,t.jsx)("div",{className:"rounded-l-3xl bg-light h-4 w-6"},l))}),(0,t.jsx)(a.dy,{open:i,onClose:()=>s(!1),anchor:"right",drawerStyle:"h-screen bg-white w-[80vw] md:w-[50vw] lg:w-[30vw]",children:(0,t.jsx)(g,{})}),(0,t.jsxs)("div",{className:" flex flex-col gap-1",children:[(0,t.jsxs)("h1",{className:"text-base",children:[(0,t.jsx)("span",{className:"font-semibold",children:"English Title : "}),l.englishTitle]}),(0,t.jsxs)("p",{className:"text-quinary opacity-60",children:[(0,t.jsx)("span",{className:"",children:"Page Url : "}),l.pageUrl]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"",children:"Page Type : "}),l.pageType]}),(0,t.jsxs)("div",{className:"text-sm pt-1",children:["Status :"," ",(0,t.jsx)("span",{className:"cursor-pointer ".concat("Active"===l.status?"bg-quinary text-white":"bg-red-600 text-white"," px-3 h-fit w-fit py-1 rounded-xl text-xs"),children:l.status})]})]}),(0,t.jsxs)("div",{className:"pt-3 w-full justify-end flex items-center gap-2 md:gap-3",children:[(0,t.jsx)("div",{onClick:()=>n("/admin/front-page/add?front-page=1"),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quinary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Edit",children:(0,t.jsx)(p.QML,{})}),(0,t.jsx)("div",{className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-red-600 text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Remove",children:(0,t.jsx)(p.YK6,{})}),(0,t.jsx)("div",{onClick:()=>s(!0),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quaternary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Details",children:(0,t.jsx)(f.kK8,{})})]})]})}},75845:function(e,l,i){i.d(l,{HN:function(){return J.HN},b5:function(){return k},_W:function(){return I},J2:function(){return J.J2},Df:function(){return H},A4:function(){return J.A4},P6:function(){return J.P6},yt:function(){return W},B1:function(){return z},CW:function(){return J.CW},rS:function(){return J.rS},lV:function(){return J.lV},DH:function(){return J.DH},y2:function(){return J.y2},nk:function(){return K},Yd:function(){return $},Gl:function(){return d},B0:function(){return en},m1:function(){return O},Iy:function(){return o},lO:function(){return c},gb:function(){return m},t6:function(){return J.t6},TT:function(){return J.TT},sZ:function(){return G},RP:function(){return L},m3:function(){return J.m3},FH:function(){return J.FH},eu:function(){return P},qA:function(){return J.qA},O2:function(){return V},xc:function(){return R.xc},yX:function(){return J.yX},qn:function(){return J.qn},bn:function(){return J.kz},iP:function(){return J.iP},O5:function(){return J.O5},Xi:function(){return h},Q8:function(){return J.Q8},s2:function(){return J.s2},e0:function(){return Q},oq:function(){return el},xi:function(){return ed},Dz:function(){return B.Dz}});var t=i(85893),s=i(5152),a=i.n(s);let n=a()(()=>Promise.all([i.e(5279),i.e(4394)]).then(i.bind(i,47229)),{loadableGenerated:{webpack:()=>[47229]},ssr:!1});function d(e){let{type:l,text:i=""}=e;return(0,t.jsx)(n,{height:"260",options:{chart:{height:350,type:"area",toolbar:{show:!1}},dataLabels:{enabled:!1},stroke:{curve:"smooth"},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun"]},responsive:[{breakpoint:600,options:{chart:{height:250}}}],colors:["#322e8f","#7e22ce"]},series:[{name:"series1",data:[31,40,28,51,42,109]}],type:l})}var o=e=>{let{item:l}=e;return(0,t.jsxs)("div",{className:"w-full flex flex-col md:flex-row items-center gap-3 md:gap-5 p-3 md:p-6 md:h-24 common-card common-transition \n ",children:[(0,t.jsx)("div",{className:"h-12 w-12 !text-xl ".concat(l.style," rounded-lg flex items-center justify-center"),children:l.icon}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 md:gap-0 text-center md:text-start",children:[(0,t.jsx)("div",{className:"text-2xl font-bold poppins",children:l.value}),(0,t.jsx)("div",{className:"text-xs font-light",children:l.heading})]})]})};let r=a()(()=>Promise.all([i.e(5279),i.e(4394)]).then(i.bind(i,47229)),{loadableGenerated:{webpack:()=>[47229]},ssr:!1});function c(e){let{type:l,text:i=""}=e;return(0,t.jsx)(r,{height:"400",options:{chart:{height:350,type:"line",stacked:!1},dataLabels:{enabled:!1},stroke:{width:[1,1,4]},title:{text:"",align:"left",offsetX:110},plotOptions:{bar:{horizontal:!1,columnWidth:"70%",borderRadius:8,borderRadiusApplication:"end",borderRadiusWhenStacked:"last"}},xaxis:{categories:[new Date().getFullYear()-8,new Date().getFullYear()-7,new Date().getFullYear()-6,new Date().getFullYear()-5,new Date().getFullYear()-4,new Date().getFullYear()-3,new Date().getFullYear()-2,new Date().getFullYear()-1,new Date().getFullYear()]},colors:["#D0DF44","#7e22ce"],tooltip:{fixed:{enabled:!0,position:"topLeft",offsetY:30,offsetX:60}},legend:{horizontalAlign:"left",offsetX:40},responsive:[{breakpoint:600,options:{plotOptions:{bar:{columnWidth:"50%"}},chart:{height:250}}}]},series:[{name:"Users",type:"column",data:[44,55,57,56,6,30,63,40,20]},{name:"Transaction",type:"column",data:[20,85,30,98,87,105,91,80,30]}],type:l})}let u=a()(()=>Promise.all([i.e(5279),i.e(4394)]).then(i.bind(i,47229)),{loadableGenerated:{webpack:()=>[47229]},ssr:!1});function m(e){let{type:l,text:i=""}=e;return(0,t.jsx)(u,{height:"400",type:l,options:{plotOptions:{bar:{horizontal:!1,columnWidth:"50%",borderRadius:8,borderRadiusApplication:"end",borderRadiusWhenStacked:"last",distributed:!0}
1},dataLabels:{enabled:!1},stroke:{show:!0,width:2,colors:["transparent"]},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun"],labels:{show:!1}},fill:{opacity:1},responsive:[{breakpoint:600,options:{plotOptions:{bar:{horizontal:!1,columnWidth:"60%"}},chart:{height:250}}}],colors:["#04B7F1","#D0DF44","#7e22ce"]},series:[{name:"series1",data:[40,31,50,28,51,42]}]})}a()(()=>Promise.all([i.e(5279),i.e(4394)]).then(i.bind(i,47229)),{loadableGenerated:{webpack:()=>[47229]},ssr:!1});let x=a()(()=>Promise.all([i.e(5279),i.e(4394)]).then(i.bind(i,47229)),{loadableGenerated:{webpack:()=>[47229]},ssr:!1});function h(e){let{type:l,text:i=""}=e;return(0,t.jsx)(x,{height:"300",options:{chart:{height:300,type:"radialBar",stacked:!1},plotOptions:{radialBar:{hollow:{size:"60%"}}},labels:["Yearly"],responsive:[{breakpoint:600,options:{plotOptions:{radialBar:{hollow:{size:"60%"}}},chart:{height:250}}}],colors:["#D0DF44"]},series:[70],type:l})}var v=i(82175),p=i(56309),f=i(16310),g=i(19198),j=i(24430),w=i(47516),b=i(67294),y=i(30934),N=i(11163),k=()=>{var e,l;let[i,s]=(0,b.useState)(0),{query:a}=(0,N.useRouter)(),{isLoading:n,mutation:d}=(0,j.Db)(),o="";(null==a?void 0:a.news)&&(o+="news/".concat(null==a?void 0:a.news));let{data:r,isValidating:c,mutate:u}=(0,j.YE)(o),{newsSchema:m,newsInitialValues:x,newsValidation:h}=(0,y.hi)(null==r?void 0:null===(e=r.data)||void 0===e?void 0:e.data),k=async(e,l)=>{try{var i,t;let n;let o={englishTitle:e.englishTitle,englishDescription:e.englishDescription,hindiTitle:e.hindiTitle,hindiDescription:e.hindiDescription,startDate:new Date(e.startDate).toISOString(),endDate:new Date(e.endDate).toISOString(),status:e.status};(null==a?void 0:a.news)?n=await d("news/".concat(null==a?void 0:a.news),{method:"PUT",isAlert:!0,body:{...o}}):(n=await d("news",{method:"POST",isAlert:!0,body:{...o}}),(null===(t=n)||void 0===t?void 0:null===(i=t.results)||void 0===i?void 0:i.success)&&(s(e=>e+1),null==l||l.resetForm()))}catch(e){(0,g.J)(e)}};return(0,t.jsx)(v.J9,{initialValues:x,validationSchema:f.Ry(h),onSubmit:k,enableReinitialize:null!=r&&null!==(l=r.data)&&void 0!==l&&!!l.data,children:e=>{var l;return(0,t.jsxs)(v.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[m.map(l=>(0,t.jsx)(v.gN,{name:l.name,children:s=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(l.className),children:[(0,t.jsx)("div",{className:"font-semibold text-themeDarkGray",children:l.label}),(0,t.jsx)("div",{className:"col-span-6 w-full",children:(0,t.jsx)(p.UP,{id:i,name:null==l?void 0:l.name,type:null==l?void 0:l.type,value:null==e?void 0:e.values[null==l?void 0:l.name],options:null==l?void 0:l.options,placeholder:(null==l?void 0:l.name)==="status"?"Select":"",onChange:e.handleChange,onBlur:e.handleBlur,error:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e},"select"===l.type?i:null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)(p.fl,{type:"submit",sx:"w-full bg-primary text-white h-10 flex items-center justify-center gap-2",disabled:e.isSubmitting||e.isValidating,loading:n,circularProgressClass:"loading-sm text-secondary",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Tn9,{className:"text-xl mt-0.5"}),(null==r?void 0:null===(l=r.data)||void 0===l?void 0:l.data)?"Update":"Add"," News"]})})})]})}})},D=i(27484),S=i.n(D),C=e=>{var l,i,s,a,n,d,o,r,c,u,m,x,h,v;let{id:p}=e,{data:f,isValidating:g}=(0,j.YE)("news/".concat(p));return(0,t.jsxs)("section",{className:"global-gap w-full h-full",children:[(0,t.jsx)("div",{className:"dashboard-title flex items-center justify-between p-3 md:p-5 bg-dark rounded-b-lg text-white",children:(0,t.jsx)("h2",{children:"News Details"})}),g?(0,t.jsx)(T,{}):(0,t.jsxs)("div",{className:"flex flex-col p-3 md:p-5 gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"English Title:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(i=f.data)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.englishTitle})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"English Description:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(a=f.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.englishDescription})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Hindi Title:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(d=f.data)||void 0===d?void 0:null===(n=d.data)||void 0===n?void 0:n.hindiTitle})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Hindi Description:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(r=f.data)||void 0===r?void 0:null===(o=r.data)||void 0===o?void 0:o.hindiDescription})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Start Date:"}),(0,t.jsx)("p",{children:S()(null==f?void 0:null===(u=f.data)||void 0===u?void 0:null===(c=u.data)||void 0===c?void 0:c.startDate).format("DD MMM YYYY")})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"End Date:"}),(0,t.jsx)("p",{children:S()(null==f?void 0:null===(x=f.data)||void 0===x?void 0:null===(m=x.data)||void 0===m?void 0:m.endDate).format("DD MMM YYYY")})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Status:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(v=f.data)||void 0===v?void 0:null===(h=v.data)||void 0===h?void 0:h.status})]})]})]})};let T=()=>(0,t.jsxs)("div",{className:"flex flex-col p-3 md:p-5 gap-4",children:[(0,t.jsx)("div",{className:"flex flex-col gap-2",children:(0,t.jsx)("div",{className:"w-20 skeleton h-4 rounded-md"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-20 h-5 skeleton rounded-md"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-1/2 skeleton h-3 rounded-md"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-2/3 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/2 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-1/2 h-5 skeleton rounded-md"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-1/2 skeleton h-3 rounded-md"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-12 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/3 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-20 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/3 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-10 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-20 skeleton h-4 rounded-md"})]})]});var A=i(8193),q=i(86455),F=i.n(q),Y=i(95581),P=e=>{var l;let{curNews:i,mutate:s}=e,[a,n]=(0,b.useState)(!1),[d,o]=(0,b.useState)(null==i?void 0:i.status),[r,c]=(0,b.useState)(!1),[u,m]=(0,b.useState)(!1),[x,h]=(0,b.useState)(!1),{mutation:v}=(0,j.Db)(),{push:f}=(0,N.useRouter)(),y=async()=>{try{F().fire({title:"Warning?",text:"Are you sure you want to ".concat("active"===d?"Inactive":"Active"," this news?"),icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, ".concat("active"===d?"Inactive":"Active"," News"),showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(async e=>{var l;if(null==e?void 0:e.isConfirmed){m(!0);let e=await v("news/".concat(null==i?void 0:i.id),{method:"PUT",isAlert:!0,body:{status:"active"===d?"inactive":"active"}}
1);m(!1),(null==e?void 0:null===(l=e.results)||void 0===l?void 0:l.success)&&o("active"===d?"inactive":"active")}})}catch(e){(0,g.J)(e)}},k=async e=>{try{F().fire({title:"Warning?",text:"Are you sure you want to remove this news?",icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, remove News",showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(async l=>{var i;if(null==l?void 0:l.isConfirmed){c(!0);let l=await v("news/".concat(e),{method:"DELETE",isAlert:!0});c(!1),(null==l?void 0:null===(i=l.results)||void 0===i?void 0:i.success)&&s()}})}catch(e){(0,g.J)(e)}},D=async(e,l)=>{try{F().fire({title:"Warning?",text:"Are you sure you want to ".concat(l?"remove this news from Archive list":"add this News to Archive list","?"),icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, ".concat(l?"remove":"add"," News"),showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(async i=>{var t;if(null==i?void 0:i.isConfirmed){h(!0);let i=await v("news/".concat(e),{method:"PUT",isAlert:!0,body:{isArchived:!l}});h(!1),(null==i?void 0:null===(t=i.results)||void 0===t?void 0:t.success)&&s()}})}catch(e){(0,g.J)(e)}};return(0,t.jsxs)("div",{className:"w-full relative common-card p-3 md:p-5 min-h-[10rem] overflow-hidden font-medium",children:[(0,t.jsx)(p.dy,{open:a,onClose:()=>n(!1),anchor:"right",drawerStyle:"h-screen bg-white w-[80vw] md:w-[50vw] lg:w-[30vw]",children:(0,t.jsx)(C,{id:null==i?void 0:i.id})}),r?(0,t.jsx)("div",{className:"absolute backdrop-blur-sm flex items-center justify-center z-20 inset-0 w-full h-full",children:(0,t.jsx)("div",{className:"loading loading-infinity loading-lg text-warning"})}):null,(0,t.jsxs)("div",{className:"flex flex-col justify-between w-full h-full gap-1",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("h2",{className:"text-sm",children:[(0,t.jsx)("span",{className:"font-semibold",children:"English Title"})," :"," ",null===(l=i.englishTitle)||void 0===l?void 0:l.slice(0,40)]}),(0,t.jsxs)("h2",{className:"text-sm opacity-70",children:["Time Period :"," ",(0,t.jsxs)("span",{className:"poppins",children:[S()(i.startDate).format("DD MMM YYYY"),"-",S()(i.endDate).format("DD MMM YYYY")]})]}),(0,t.jsxs)("div",{className:"text-sm pt-1",children:["Status :"," ",(0,t.jsx)(p.fl,{onClick:y,loading:u,circularProgressClass:"loading !loading-spinner !loading-xs",sx:"cursor-pointer ".concat("active"===d?"bg-quinary text-white":"bg-red-600 text-white"," px-3 !h-fit min-w-[4rem] !w-fit !py-1 !rounded-xl !text-xs"),children:"active"===d?"Active":"Inactive"})]})]}),(0,t.jsxs)("div",{className:"pt-3 w-full justify-end flex items-center gap-2 md:gap-3",children:[(0,t.jsx)("div",{onClick:()=>D(null==i?void 0:i.id,null==i?void 0:i.isArchived),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-secondary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":(null==i?void 0:i.isArchived)?"Remove From Archive":"Add to Archive",children:x?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(null==i?void 0:i.isArchived)?(0,t.jsx)(w.bnX,{}):(0,t.jsx)(w.aJk,{})}),(0,t.jsx)("div",{onClick:()=>f("/admin/news?news=".concat(null==i?void 0:i.id)),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quinary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Edit",children:(0,t.jsx)(A.QML,{})}),(0,t.jsx)("div",{onClick:()=>k(null==i?void 0:i.id),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-red-600 text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Remove",children:(0,t.jsx)(A.YK6,{})}),(0,t.jsx)("div",{onClick:()=>n(!0),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quaternary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Details",children:(0,t.jsx)(w.kK8,{})})]})]})]})},B=i(21768),R=i(98602),_=i(80087);let E=a()(()=>Promise.all([i.e(2937),i.e(156)]).then(i.t.bind(i,71167,23)),{loadableGenerated:{webpack:()=>[71167]},ssr:!1});var I=e=>{let{initialData:l,mutate:i,setNoticeAndCircularDetails:s}=e,[a,n]=(0,b.useState)(null),[d,o]=(0,b.useState)(0),[r,c]=(0,b.useState)(!1),{isLoading:u,mutation:m}=(0,j.Db)(),{query:x}=(0,N.useRouter)(),{data:h}=(0,j.YE)("notice-and-circular");console.log(h);let{noticeAndCircularInitialValues:k,noticeAndCircularSchema:D,noticeAndCircularValidation:S}=(0,y.I)(void 0),C=async(e,t)=>{try{var d,r;let u,x;c(!0);let h=Date.now();a&&(x=await _.BC.upload("notice-and-circular/".concat(h),a));let v={file:x,filePath:"notice-and-circular/".concat(h),englishTitle:e.englishTitle,englishDescription:e.englishDescription,hindiTitle:e.hindiTitle,hindiDescription:e.hindiDescription,startDate:new Date(e.startDate).toISOString(),endDate:new Date(e.endDate).toISOString(),status:e.status};(null==l?void 0:l.id)?u=await m("notice-and-circular/".concat(null==l?void 0:l.id),{method:"PUT",isAlert:!0,body:{...v}}):(u=await m("notice-and-circular",{method:"POST",isAlert:!0,body:v}),c(!1),(null===(r=u)||void 0===r?void 0:null===(d=r.results)||void 0===d?void 0:d.success)&&(o(e=>e+1),null==t||t.resetForm(),n(null),i(),s&&s(!1)))}catch(e){(0,g.J)(e),c(!1)}},T={toolbar:[[{header:"1"},{header:"2"},{font:[]}],[{size:[]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}],["link","image","video"],["clean"]],clipboard:{matchVisual:!1}},A=["header","font","size","bold","italic","underline","strike","blockquote","list","bullet","indent","link","image","video"];return(0,t.jsx)(v.J9,{initialValues:k,validationSchema:f.Ry(S),onSubmit:C,enableReinitialize:null!=l&&!!l.id,children:e=>(0,t.jsxs)(v.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[D.map(l=>(0,t.jsx)(v.gN,{name:l.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(l.className),children:[(0,t.jsxs)("div",{className:"font-semibold text-themeDarkGray",children:[l.label," ",(0,t.jsx)("span",{className:"poppins",children:(null==l?void 0:l.required)?"*":""})]}),(0,t.jsx)("div",{className:"w-full",children:(null==l?void 0:l.name)==="englishDescription"||(null==l?void 0:l.name)==="hindiDescription"?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E,{modules:T,formats:A,theme:"snow",value:null==e?void 0:e.values[null==l?void 0:l.name],onChange:i=>e.setFieldValue(l.name,i),className:"h-96 overflow-hidden",style:{borderRadius:"10px",border:"1px solid #04B7F1",background:"#fff"}}),(0,t.jsx)("span",{className:"text-xs px-2 text-red-400 tracking-wider",children:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]))&&(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])})]}):(0,t.jsx)(p.UP,{id:d,setId:o,name:null==l?void 0:l.name,type:null==l?void 0:l.type,placeholder:(null==l?void 0:l.type)==="select"?"Select":"",value:null==e?void 0:e.values[null==l?void 0:l.name],options:null==l?void 0:l.options,onChange:e.handleChange,onBlur:e.handleBlur,error:((null==l?void 0:l.name)!=="file"||!a)&&!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e,setIsImage:n,image:a,onFileChange:l=>{var i,t;(null==l?void 0:null===(i=l.target)||void 0===i?void 0:i.files)&&n(l.target.files[0]),e.setFieldValue("file",null==l?void 0:null===(t=l.target)||void 0===t?void 0:t.files)},fileAccept:".pdf"},"select"===l.type?d:null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)(p.fl,{type:"submit",sx:"w-full bg-primary text-white h-10 flex items-center justify-center gap-2",disabled:e.isSubmitting||e.isValidating,loading:r,circularProgressClass:"loading-sm text-secondary",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Tn9,{className:"text-xl mt-0.5"}),(null==l?void 0:l.id)?"Update":"Add"," Notice And Circular"]})})})]})})},V=e=>{let{curPage:l,mutate:i}=e,[s,a]=(0,b.useState)(null==l?void 0:l.status),[n,d]=(0,b.useState)(!1),[o,r]=(0,b.useState)(!1),[c,u]=(0,b.useState)(!1),{push:m}=(0,N.useRouter)(),{mutation:x}=(0,j.Db)(),[h,v]=(0,b.useState)(),f=e=>{v(e),u(!0)},y=async()=>{try{F().fire({title:"Warning?",text:"Are you sure you want to ".concat("active"===s?"Inactive":"Active"," this Notice And Circular?"),icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, ".concat("active"===s?"Inactive":"Active"," Notice and Circular"),showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(async e=>{var i;if(null==e?void 0:e.isConfirmed){d(!0);let e=await x("notice-and-circular/".concat(null==l?void 0:l.id),{method:"PUT",isAlert:!0,body:{status:"active"===s?"inactive":"active"}}
1);d(!1),(null==e?void 0:null===(i=e.results)||void 0===i?void 0:i.success)&&a("active"===s?"inactive":"active")}})}catch(e){(0,g.J)(e)}},k=async()=>{try{F().fire({title:"Warning?",text:"Are you sure you want to remove this Notice card?",icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, remove Notice card",showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(async e=>{var t;if(null==e?void 0:e.isConfirmed){r(!0);let e=await x("notice-and-circular/".concat(null==l?void 0:l.id),{method:"DELETE",isAlert:!0});r(!1),(null==e?void 0:null===(t=e.results)||void 0===t?void 0:t.success)&&(i(),await _.BC.delete(null==l?void 0:l.filePath))}})}catch(e){(0,g.J)(e)}};return(0,t.jsxs)("div",{className:"w-full flex flex-col justify-between common-card p-3 md:p-5 relative text-sm",children:[(0,t.jsx)("div",{className:"flex flex-col justify-between absolute py-5 right-0 top-0 bottom-0 gap-3",children:[...Array(6)].map((e,l)=>(0,t.jsx)("div",{className:"rounded-l-3xl bg-light h-4 w-6"},l))}),(0,t.jsx)(p.dy,{open:c,onClose:()=>u(!1),anchor:"right",drawerStyle:"h-screen bg-white w-[80vw] md:w-[50vw] lg:w-[30vw]",children:(0,t.jsx)(U,{id:null==l?void 0:l.id})}),o?(0,t.jsx)("div",{className:"absolute backdrop-blur-sm flex items-center justify-center z-20 inset-0 w-full h-full",children:(0,t.jsx)("div",{className:"loading loading-infinity loading-lg text-warning"})}):null,(0,t.jsxs)("div",{className:" flex flex-col gap-1",children:[(0,t.jsxs)("h1",{className:"text-base",children:[(0,t.jsx)("span",{className:"font-semibold",children:"English Title : "}),l.englishTitle]}),(0,t.jsxs)("div",{className:"text-sm pt-1",children:["Status :"," ",(0,t.jsx)(p.fl,{onClick:y,loading:n,circularProgressClass:"loading !loading-spinner !loading-xs",sx:"cursor-pointer ".concat("active"===s?"bg-quinary text-white":"bg-red-600 text-white"," px-3 !h-fit min-w-[4rem] !w-fit !py-1 !rounded-xl !text-xs"),children:"active"===s?"Active":"Inactive"})]})]}),(0,t.jsxs)("div",{className:"pt-3 w-full justify-end flex items-center gap-2 md:gap-3",children:[(0,t.jsx)("div",{onClick:()=>f(l),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quinary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Edit",children:(0,t.jsx)(A.QML,{})}),(0,t.jsx)("div",{onClick:()=>k(),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-red-600 text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Remove",children:(0,t.jsx)(A.YK6,{})}),(0,t.jsx)("div",{onClick:()=>u(!0),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quaternary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Details",children:(0,t.jsx)(w.kK8,{})})]})]})},U=e=>{var l,i,s,a,n,d,o,r,c,u,m,x,h,v;let{id:p}=e,{data:f,isValidating:g}=(0,j.YE)("notice-and-circular/".concat(p));return(0,t.jsxs)("section",{className:"global-gap w-full h-full",children:[(0,t.jsx)("div",{className:"dashboard-title flex items-center justify-between p-3 md:p-5 bg-dark rounded-b-lg text-white",children:(0,t.jsx)("h2",{children:"Notice And Circular Details"})}),g?(0,t.jsx)(M,{}):(0,t.jsxs)("div",{className:"flex flex-col p-3 md:p-5 gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"English Title:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(i=f.data)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.englishTitle})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"English Description:"}),(0,t.jsx)("div",{dangerouslySetInnerHTML:{__html:"".concat(null==f?void 0:null===(a=f.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.englishDescription)}})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Hindi Title:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(d=f.data)||void 0===d?void 0:null===(n=d.data)||void 0===n?void 0:n.hindiTitle})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Hindi Description:"}),(0,t.jsx)("div",{dangerouslySetInnerHTML:{__html:"".concat(null==f?void 0:null===(r=f.data)||void 0===r?void 0:null===(o=r.data)||void 0===o?void 0:o.hindiDescription)}})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Start Date:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(u=f.data)||void 0===u?void 0:null===(c=u.data)||void 0===c?void 0:c.startDate})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"End Date:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(x=f.data)||void 0===x?void 0:null===(m=x.data)||void 0===m?void 0:m.endDate})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Status:"}),(0,t.jsx)("p",{children:null==f?void 0:null===(v=f.data)||void 0===v?void 0:null===(h=v.data)||void 0===h?void 0:h.status})]})]})]})};let M=()=>(0,t.jsxs)("div",{className:"flex flex-col p-3 md:p-5 gap-4",children:[(0,t.jsx)("div",{className:"flex flex-col gap-2",children:(0,t.jsx)("div",{className:"w-20 skeleton h-4 rounded-md"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-20 h-5 skeleton rounded-md"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-1/2 skeleton h-3 rounded-md"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-2/3 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/2 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-1/2 h-5 skeleton rounded-md"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-1/2 skeleton h-3 rounded-md"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-12 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/3 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-20 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/3 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-10 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-20 skeleton h-4 rounded-md"})]})]});i(93956);var J=i(45826);function z(e){let{initialData:l,mutate:i,setOpenAddGalleryOverviewDrawer:s}=e,[a,n]=(0,b.useState)(0),[d,o]=(0,b.useState)(!1),{mutation:r}=(0,j.Db)(),{galleryOverviewSchema:c,initialValues:u,validationSchema:m}=(0,y.l)(l),x=async(e,t)=>{try{var a;let d;o(!0);let c={type:e.title};d=(null==l?void 0:l.id)?await r("file/type/".concat(null==l?void 0:l.id),{method:"PUT",isAlert:!0,body:{...c}}):await r("file/type",{method:"POST",isAlert:!0,body:{...c}}),o(!1),(null==d?void 0:null===(a=d.results)||void 0===a?void 0:a.success)&&(n(e=>e+1),null==t||t.resetForm(),i(),s&&s(!1))}catch(e){(0,g.J)(e),o(!1)}};return(0,t.jsxs)("div",{className:"w-full flex flex-col text-primary",children:[(0,t.jsxs)("h1",{className:"p-3 md:p-5 bg-tertiary dashboard-title",children:[(null==l?void 0:l.id)?"Update":"Add"," Gallery Section"]}),(0,t.jsx)("div",{className:"p-3 md:p-5",children:(0,t.jsx)(v.J9,{initialValues:u,validationSchema:f.Ry(m),onSubmit:x,enableReinitialize:!0,children:e=>(0,t.jsxs)(v.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[c.map(l=>(0,t.jsx)(v.gN,{name:l.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(l.className),children:[(0,t.jsxs)("div",{className:"font-semibold text-themeDarkGray",children:[l.label," ",(null==l?void 0:l.required)?"*":""]}),(0,t.jsx)("div",{className:"col-span-6 w-full",children:(0,t.jsx)(p.UP,{id:null==l?void 0:l.key,name:null==l?void 0:l.name,type:null==l?void 0:l.type,value:null==e?void 0:e.values[null==l?void 0:l.name],onChange:e.handleChange,onBlur:e.handleBlur,error:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e},null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)(p.fl,{type:"submit",sx:"w-full bg-primary text-white h-10 flex items-center justify-center gap-2",disabled:e.isSubmitting||e.isValidating,loading:d,circularProgressClass:"loading-sm text-secondary",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Tn9,{className:"text-xl mt-0.5"}),(null==l?void 0:l.id)?"Update":"Add"," Gallery details"]}
1)})})]})})})]})}function L(e){let{curGalleryData:l,mutate:i}=e,[s,a]=(0,b.useState)(!1),[n,d]=(0,b.useState)(),{push:o}=(0,N.useRouter)(),r=e=>{d(e),a(!0)},[c,u]=(0,b.useState)(!1),{mutation:m}=(0,j.Db)(),x=async()=>{try{F().fire({title:"Warning?",text:"Are you sure you want to remove this Gallery card?",icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, remove Gallery card",showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(async e=>{var t;if(null==e?void 0:e.isConfirmed){u(!0);let e=await m("file/type/".concat(null==l?void 0:l.id),{method:"DELETE",isAlert:!0});u(!1),(null==e?void 0:null===(t=e.results)||void 0===t?void 0:t.success)&&i()}})}catch(e){(0,g.J)(e)}};return(0,t.jsxs)("div",{className:"w-full common-card p-3 md:p-5 relative overflow-hidden",children:[(0,t.jsx)(p.dy,{open:s,onClose:()=>a(!1),anchor:"right",drawerStyle:"h-screen bg-white w-[80vw] md:w-[50vw] lg:w-[30vw]",children:(0,t.jsx)(z,{mutate:i,initialData:n})}),c?(0,t.jsx)("div",{className:"absolute backdrop-blur-sm flex items-center justify-center z-20 inset-0 w-full h-full",children:(0,t.jsx)("div",{className:"loading loading-infinity loading-lg text-warning"})}):null,(0,t.jsx)("div",{className:"absolute -right-20 -bottom-20 w-40 h-40 border-[2rem] rounded-full border-secondary/20"}),(0,t.jsx)("p",{className:"font-semibold",children:l.type}),(0,t.jsxs)("div",{className:"flex items-center gap-2 md:gap-3 pt-5",children:[(0,t.jsx)("div",{onClick:()=>r(l),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quinary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Edit",children:(0,t.jsx)(A.QML,{})}),(0,t.jsx)("div",{onClick:()=>x(),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-red-600 text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Remove",children:(0,t.jsx)(A.YK6,{})}),(0,t.jsx)("div",{onClick:()=>o("/admin/content-management/gallery/".concat(null==l?void 0:l.id)),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quaternary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Details",children:(0,t.jsx)(w.kK8,{})})]})]})}function W(e){let{fileData:l,mutate:i,setOpenAddUpdateFileUploadDrawer:s}=e,[a,n]=(0,b.useState)(null),{query:d}=(0,N.useRouter)(),[o,r]=(0,b.useState)(0),{mutation:c}=(0,j.Db)(),[u,m]=(0,b.useState)(!1),{FileCardSchema:x,FileCardInitialValues:h,FileCardValidationSchema:k}=(0,y.bh)(l),D=async(e,t)=>{try{var o;let u,x;m(!0);let h=Date.now(),v="file/".concat(h);a&&(x=await _.BC.upload(v,a));let p={file:x,filePath:v,title:e.title,fileTypeId:null==d?void 0:d["gallery-details"]};u=(null==l?void 0:l.id)?await c("file/".concat(null==l?void 0:l.id),{method:"PUT",isAlert:!0,body:{...p}}):await c("file",{method:"POST",isAlert:!0,body:{...p}}),m(!1),(null==u?void 0:null===(o=u.results)||void 0===o?void 0:o.success)?(t.resetForm(),r(e=>e+1),n(null),i(),s&&s(!1)):await _.BC.delete(v)}catch(e){(0,g.J)(e),m(!1)}};return(0,t.jsxs)("div",{className:"w-full flex flex-col text-primary",children:[(0,t.jsxs)("h1",{className:"p-3 md:p-5 bg-tertiary dashboard-title",children:[(null==l?void 0:l.id)?"Update":"Add"," File"]}),(0,t.jsx)("div",{className:"p-3 md:p-5",children:(0,t.jsx)(v.J9,{initialValues:h,validationSchema:f.Ry(k),onSubmit:D,enableReinitialize:!0,children:e=>(0,t.jsxs)(v.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[x.map(l=>(0,t.jsx)(v.gN,{name:l.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(l.className),children:[(0,t.jsxs)("div",{className:"font-semibold text-themeDarkGray",children:[l.label," ",(null==l?void 0:l.required)?"*":""]}),(0,t.jsx)("div",{className:"col-span-6 w-full",children:(0,t.jsx)(p.UP,{id:o,name:null==l?void 0:l.name,type:null==l?void 0:l.type,value:null==e?void 0:e.values[null==l?void 0:l.name],onChange:e.handleChange,onBlur:e.handleBlur,error:((null==l?void 0:l.name)!=="file"||!a)&&!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e,setIsImage:n,image:a,onFileChange:l=>{var i;l.target.files&&n(l.target.files[0]),e.setFieldValue("file",null==l?void 0:null===(i=l.target)||void 0===i?void 0:i.files)},setId:r},null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)(p.fl,{type:"submit",sx:"w-full bg-primary text-white h-10 flex items-center justify-center gap-2",disabled:e.isSubmitting||e.isValidating,loading:u,circularProgressClass:"loading-sm text-secondary",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Tn9,{className:"text-xl mt-0.5"}),(null==l?void 0:l.id)?"Update":"Add"," File"]})})})]})})})]})}var Z=i(89583);function G(e){let{curFileCard:l,mutate:i}=e,[s,a]=(0,b.useState)(!1),[n,d]=(0,b.useState)(),o=e=>{a(!0),d(e)},[r,c]=(0,b.useState)(!1),{mutation:u}=(0,j.Db)(),m=async()=>{try{F().fire({title:"Warning?",text:"Are you sure you want to remove this file card?",icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, remove File card",showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(async e=>{var t;if(null==e?void 0:e.isConfirmed){c(!0);let e=await u("file/".concat(null==l?void 0:l.id),{method:"DELETE",isAlert:!0});c(!1),(null==e?void 0:null===(t=e.results)||void 0===t?void 0:t.success)&&(i(),await _.BC.delete(null==l?void 0:l.filePath))}})}catch(e){(0,g.J)(e)}};return(0,t.jsxs)("div",{className:"w-full relative common-card p-3 md:p-5",children:[(0,t.jsx)(p.dy,{open:s,onClose:()=>a(!1),anchor:"right",drawerStyle:"h-screen bg-white w-[80vw] md:w-[50vw] lg:w-[30vw]",children:(0,t.jsx)(W,{fileData:n,mutate:i})}),r?(0,t.jsx)("div",{className:"absolute backdrop-blur-sm flex items-center justify-center z-20 inset-0 w-full h-full",children:(0,t.jsx)("div",{className:"loading loading-infinity loading-lg text-warning"})}):null,(0,t.jsxs)("p",{className:"",children:[(0,t.jsx)("span",{className:" font-semibold",children:"Title : "}
1),l.title]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 md:gap-3 pt-3",children:[(0,t.jsx)("a",{href:l.file,target:"_blank",children:(0,t.jsx)("div",{className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-secondary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"View",children:(0,t.jsx)(Z.ofI,{})})}),(0,t.jsx)("div",{onClick:()=>o(l),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quinary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Edit",children:(0,t.jsx)(A.QML,{})}),(0,t.jsx)("div",{onClick:()=>m(),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-red-600 text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Remove",children:(0,t.jsx)(A.YK6,{})})]})]})}function O(e){let{curContact:l}=e,[i,s]=(0,b.useState)(!1),[a,n]=(0,b.useState)(),d=e=>{n(e),s(!0)};return(0,t.jsxs)("div",{className:"w-full common-card p-3 md:p-5 relative overflow-hidden",children:[(0,t.jsx)(p.dy,{open:i,onClose:()=>s(!1),anchor:"right",drawerStyle:"h-screen bg-white w-[80vw] md:w-[50vw] lg:w-[30vw]",children:(0,t.jsx)(H,{initialData:a})}),(0,t.jsx)("div",{className:"absolute -top-16 left-0 w-5 h-40 rounded-lg bg-secondary/20"}),(0,t.jsx)("div",{className:"absolute -bottom-16 -right-6 rotate-45 h-28 w-28 bg-secondary opacity-20"}),(0,t.jsx)("div",{className:"absolute bottom-16 right-14 h-10 w-10 rounded-full bg-secondary opacity-30"}),(0,t.jsxs)("p",{className:"",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Title : "}),l.title]}),(0,t.jsxs)("p",{className:"",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Address : "}),l.address]}),(0,t.jsxs)("p",{className:"",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Phone Number : "}),l.phoneNumber]}),(0,t.jsxs)("p",{className:"",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Fax Number : "}),l.faxNumber]}),(0,t.jsxs)("div",{className:" sticky flex items-center gap-2 md:gap-3 pt-5",children:[(0,t.jsx)("div",{onClick:()=>d(l),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quinary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Edit",children:(0,t.jsx)(A.QML,{})}),(0,t.jsx)("div",{className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-red-600 text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Remove",children:(0,t.jsx)(A.YK6,{})}),(0,t.jsx)("div",{className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quaternary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Details",children:(0,t.jsx)(w.kK8,{})})]})]})}function H(e){let{initialData:l}=e,i=[{key:"0",label:"Title",name:"title",type:"text",validationSchema:f.Z_().required("Title is required"),required:!0,initialValue:null==l?void 0:l.title,className:"col-span-12"},{key:"1",label:"Address",name:"address",required:!0,type:"text",validationSchema:f.Z_().required("Address is required"),initialValue:null==l?void 0:l.address,className:"col-span-12"},{key:"2",label:"Phone Number",name:"phoneNumber",required:!0,type:"text",validationSchema:f.Z_().required("Phone Number Is Required"),initialValue:null==l?void 0:l.phoneNumber,className:"col-span-12"},{key:"3",label:"Fax Number",name:"faxNumber",required:!0,type:"text",validationSchema:f.Z_().required("Fax Number Is Required"),initialValues:null==l?void 0:l.faxNumber,className:"col-span-12"}],s=null==i?void 0:i.reduce((e,l)=>(e[null==l?void 0:l.name]=null==l?void 0:l.initialValue,e),{}),a=null==i?void 0:i.reduce((e,l)=>(e[null==l?void 0:l.name]=null==l?void 0:l.validationSchema,e),{});return(0,t.jsxs)("div",{className:"w-full flex flex-col text-primary",children:[(0,t.jsxs)("h1",{className:"p-3 md:p-5 bg-tertiary dashboard-title",children:[(null==l?void 0:l.title)?"Update":"Add"," Contact Details"]}),(0,t.jsx)("div",{className:"p-3 md:p-5",children:(0,t.jsx)(v.J9,{initialValues:s,validationSchema:f.Ry(a),onSubmit:e=>{console.log(e,"news add")},enableReinitialize:!0,children:e=>(0,t.jsxs)(v.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[i.map(l
1=>(0,t.jsx)(v.gN,{name:l.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(l.className),children:[(0,t.jsxs)("div",{className:"font-semibold text-themeDarkGray",children:[l.label," ",(null==l?void 0:l.required)?"*":""]}),(0,t.jsx)("div",{className:"col-span-6 w-full",children:(0,t.jsx)(p.UP,{id:null==l?void 0:l.key,name:null==l?void 0:l.name,type:null==l?void 0:l.type,value:null==e?void 0:e.values[null==l?void 0:l.name],onChange:e.handleChange,onBlur:e.handleBlur,error:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e},null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)("button",{type:"submit",className:"submit text-white bg-primary w-full rounded-md px-4 py-2.5",children:"Submit"})})]})})})]})}function K(e){let{initialData:l}=e,i=[{key:"0",label:"Title",name:"title",type:"text",validationSchema:f.Z_().required("Title is required"),required:!0,initialValue:null==l?void 0:l.title,className:"col-span-12"},{key:"1",label:"Address",name:"address",required:!0,type:"text",validationSchema:f.Z_().required("Address/PhoneNumber is required"),initialValue:null==l?void 0:l.address,className:"col-span-12"}],s=null==i?void 0:i.reduce((e,l)=>(e[null==l?void 0:l.name]=null==l?void 0:l.initialValue,e),{}),a=i.reduce((e,l)=>(e[null==l?void 0:l.name]=null==l?void 0:l.validationSchema,e),{});return(0,t.jsxs)("div",{className:"w-full flex flex-col text-primary",children:[(0,t.jsxs)("h1",{className:"p-3 md:p-5 bg-tertiary dashboard-title",children:[(null==l?void 0:l.title)?"Update":"Add"," Training Center Details"]}),(0,t.jsx)("div",{className:"p-3 md:p-5",children:(0,t.jsx)(v.J9,{initialValues:s,validationSchema:f.Ry(a),onSubmit:e=>{console.log(e,"news add")},enableReinitialize:!0,children:e=>(0,t.jsxs)(v.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[i.map(l=>(0,t.jsx)(v.gN,{name:l.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(l.className),children:[(0,t.jsxs)("div",{className:"font-semibold text-themeDarkGray",children:[l.label," ",(null==l?void 0:l.required)?"*":""]}),(0,t.jsx)("div",{className:"col-span-6 w-full",children:(0,t.jsx)(p.UP,{id:null==l?void 0:l.key,name:null==l?void 0:l.name,type:null==l?void 0:l.type,value:null==e?void 0:e.values[null==l?void 0:l.name],onChange:e.handleChange,onBlur:e.handleBlur,error:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e},null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)("button",{type:"submit",className:"submit text-white bg-primary w-full rounded-md px-4 py-2.5",children:"Submit"})})]})})})]})}function Q(e){let{curTrainingCenter:l}=e,[i,s]=(0,b.useState)(!1),[a,n]=(0,b.useState)(),d=e=>{n(e),s(!0)};return(0,t.jsxs)("div",{className:"w-full common-card p-3 md:p-5 relative overflow-hidden ",children:[(0,t.jsx)(p.dy,{open:i,onClose:()=>s(!1),anchor:"right",drawerStyle:"h-screen bg-white w-[80vw] md:w-[50vw] lg:w-[30vw]",children:(0,t.jsx)(K,{initialData:a})}),(0,t.jsx)("div",{className:"absolute right-3 bottom-6 w-5 h-24 rotate-45 rounded-full bg-secondary/20"}),(0,t.jsx)("div",{className:"absolute -right-2 bottom-3 w-5 h-16 rotate-45 rounded-full bg-secondary/20"}),(0,t.jsx)("div",{className:"absolute -top-20 right-60 w-24 h-24 rotate-45 rounded-full bg-secondary/20"}),(0,t.jsxs)("p",{className:"",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Title : "}),l.title]}),(0,t.jsxs)("p",{className:"",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Address/Phone Number : "}),l.address]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 md:gap-3 pt-5",children:[(0,t.jsx)("div",{onClick:()=>d(l),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quinary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Edit",children:(0,t.jsx)(A.QML,{})}),(0,t.jsx)("div",{className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-red-600 text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Remove",children:(0,t.jsx)(A.YK6,{})}),(0,t.jsx)("div",{className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quaternary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Details",children:(0,t.jsx)(w.kK8,{})})]})]})}let X=[{key:"1",label:"User Name",name:"userName",type:"text",validationSchema:f.Z_().required("Required"),initialValue:""}
1,{key:"2",label:"Email",name:"email",type:"email",validationSchema:f.Z_().required("Required"),initialValue:""},{key:"3",label:"Phone",name:"phone",type:"number",validationSchema:f.Rx().required("Required"),initialValue:""},{key:"4",label:"Password",name:"password",type:"password",validationSchema:f.Z_().min(8,"Password must be 8 characters long").required(),initialValue:""}];var $=()=>{let[e,l]=(0,b.useState)(!1),i=async(e,l)=>{console.log(e)},s=X.reduce((e,l)=>(e[null==l?void 0:l.name]=l.initialValue,e),{}),a=X.reduce((e,l)=>(e[l.name]=l.validationSchema,e),{});return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(v.J9,{initialValues:s,validationSchema:f.Ry(a),onSubmit:i,children:i=>(0,t.jsx)(v.l0,{className:"flex justify-center items-center h-[calc(100vh-64px)] bg-tertiary/30",children:(0,t.jsxs)("section",{className:"flex flex-col justify-center items-center lg:w-[45%] w-full bg-white rounded-lg p-8 shadow-primary border ",children:[(0,t.jsx)("div",{className:"flex flex-col justify-center items-center p-2 w-full",children:(0,t.jsx)("p",{className:"text-xl font-semibold text-quinary tracking-wider",children:"Add User Details"})}),(0,t.jsxs)("aside",{className:"flex flex-col w-full pt-4 gap-3",children:[X.map(s=>(0,t.jsx)("div",{className:"form-control ",children:(0,t.jsx)(v.gN,{name:s.name,children:a=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"input-group capitalize w-full border rounded-md",children:[(0,t.jsx)("span",{className:"capitalize font-medium bg-quaternary text-white w-1/4 text-sm",children:null==s?void 0:s.label}),(0,t.jsx)("input",{type:!e&&(null==s?void 0:s.name),placeholder:null==s?void 0:s.label,className:" p-3 w-full",name:s.name,id:"outlined-basic",value:i.values.name,onChange:i.handleChange,onBlur:i.handleBlur}),(null==s?void 0:s.name)==="password"?(0,t.jsx)("span",{onClick:()=>l(!e),className:"flex justify-center items-center bg-white",children:e?(0,t.jsx)("img",{src:"/login/visibility.png",className:"w-8 cursor-pointer",alt:""}):(0,t.jsx)("img",{src:"/login/sleep.png",className:"w-8 cursor-pointer",alt:""})}):""]}),(0,t.jsx)("div",{className:"text-sm text-red-500 pl-3",children:(0,t.jsx)(v.Bc,{name:s.name})})]})},s.key)},null==s?void 0:s.key)),(0,t.jsx)("div",{className:"flex place-content-center pt-4",children:(0,t.jsx)("button",{type:"submit",disabled:i.isSubmitting||!i.isValid,className:"bg-primary text-white py-2 px-4 rounded-md cursor-pointer",children:"Add User"})})]})]})})})})},ee=i(93913);function el(){let{user:e,logout:l}=(0,ee.Z)(),{push:i}=(0,N.useRouter)(),s={name:(null==e?void 0:e.name)||"Not Provided",email:(null==e?void 0:e.email)||"Not Provided",avatar:(null==e?void 0:e.avatar)||"",lastLogin:S()(null==e?void 0:e.lastLogin).format("DD MMM YYYY hh:mm A")},a=()=>{F().fire({title:"Warning?",text:"Are you sure you want to Logout from this device?",icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, Logout",showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(e=>{(null==e?void 0:e.isConfirmed)&&(l(),i("/login"))})};return(0,t.jsxs)("section",{className:"w-full flex flex-col gap-3 overflow-hidden h-56 md:h-64 c
1ommon-card",children:[(0,t.jsx)("div",{className:"flex items-center p-4 lg:p-8 relative h-32 md:h-40 justify-center w-full rounded-lg",style:{backgroundImage:'url("/contact/contact-bg.jpg")'},children:(0,t.jsxs)("div",{className:"w-full flex flex-col justify-between h-full items-end",children:[(0,t.jsx)("button",{onClick:()=>a(),className:"px-6 py-2 order-2 md:order-1 font-semibold bg-tertiary rounded-md shadow-[rgba(13,_38,_76,_0.19)_0px_9px_20px] text-primary",children:"Log Out"}),(0,t.jsxs)("p",{className:"text-white text-sm block md:hidden order-1 md:order-2",children:["Last Login :"," ",(0,t.jsx)("span",{className:"text-white",children:null==s?void 0:s.lastLogin})]})]})}),(0,t.jsxs)("div",{className:"w-full px-4 lg:px-8 h-16 md:h-24 flex gap-4 items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex gap-2 md:gap-4 items-start",children:[(0,t.jsx)("div",{className:"flex items-center -translate-y-14",children:(0,t.jsx)(p.qE,{src:s.avatar||"/admin/profile.png",className:"w-28 md:w-32 rounded-full h-28 md:h-32 border border-secondary"})}),(0,t.jsxs)("div",{className:"",children:[(0,t.jsx)("h1",{className:"text-lg md:text-xl font-semibold",children:null==s?void 0:s.name}),(0,t.jsx)("p",{className:"text-quinary text-sm md:text-base",children:null==s?void 0:s.email})]})]}),(0,t.jsxs)("p",{className:"text-sm font-semibold hidden md:block",children:["Last Login :"," ",(0,t.jsx)("span",{className:"poppins text-quaternary",children:null==s?void 0:s.lastLogin})]})]})]})}var ei=i(79464),et=i(71762),es=i(81873);let ea={loop:!0,autoplay:!0,animationData:et.w,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}};function en(){let{mutation:e,isLoading:l}=(0,j.Db)(),{logout:i}=(0,ee.Z)(),{push:s}=(0,N.useRouter)(),a=async(l,t)=>{try{F().fire({title:"Warning?",text:"Are you sure you want to Change Your Password?",icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, Change Password",showCancelButton:!0,customClass:Y.pv,backdrop:Y.IY}).then(async a=>{if(a.isConfirmed){var n;let a=await e("user/change-password",{method:"PUT",isAlert:!0,body:{oldPassword:l.oldPassword,newPassword:l.confirmPassword}});(null==a?void 0:null===(n=a.results)||void 0===n?void 0:n.success)&&(t.resetForm(),s("/login"),i())}})}catch(e){(0,g.J)(e)}};return(0,t.jsxs)("section",{children:[(0,t.jsxs)("div",{className:"flex flex-col text-center gap-1 w-full",children:[(0,t.jsx)("h1",{className:"text-primary font-semibold text-xl",children:"Create new password"}),(0,t.jsxs)("p",{className:"text-quinary opacity-70",children:["Your new password must be different from previous"," ",(0,t.jsx)("br",{className:"hidden md:block"})," used password."]}),(0,t.jsxs)("div",{className:"w-full ",children:[(0,t.jsx)("div",{className:" hidden md:flex w-full h-full items-center justify-center",children:(0,t.jsx)(ei.Z,{options:ea,height:150,width:150})}),(0,t.jsx)("div",{className:" flex md:hidden w-full h-full items-center justify-center",children:(0,t.jsx)(ei.Z,{options:ea,height:100,width:100})})]})]}),(0,t.jsx)(v.J9,{initialValues:y.Je,validationSchema:f.Ry(y.fI),onSubmit:a,enableReinitialize:!0,children:e=>(0,t.jsxs)(v.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[y.Jg.map(l=>(0,t.jsx)(v.gN,{name:l.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 col-span-12",children:[(0,t.jsx)("div",{className:"font-semibold text-themeDarkGray",children:l.label}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(p.UP,{id:null==l?void 0:l.key,name:null==l?void 0:l.name,type:null==l?void 0:l.type,value:null==e?void 0:e.values[null==l?void 0:l.name],onChange:e.handleChange,onBlur:e.handleBlur,error:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e},null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)(p.fl,{type:"submit",sx:"w-full bg-primary text-white shadow-[rgba(50,_50,_105,_0.15)_0px_2px_5px_0px,_rgba(0,_0,_0,_0.05)_0px_1px_1px_0px] h-10 flex items-center justify-center font-medium",disabled:e.isSubmitting||e.isValidating,loading:l,circularProgressClass:"loading-sm text-secondary",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(es.YJH,{}),"Change Password"]})})})]})})]})}function ed(){let{user:e,getUser:l}=(0,ee.Z)(),{profileInitialValues:i,profileSchema:s,profileValidation:a}=(0,y.ck)(e),{mutation:n,isLoading:d}=(0,j.Db)(),o=async(i,t)=>{try{var s;let t=await n("user/".concat(null==e?void 0:e.id),{method:"PUT",isAlert:!0,body:{name:i.name}});(null==t?void 0:null===(s=t.results)||void 0===s?void 0:s.success)&&l()}catch(e){(0,g.J)(e)}};return(0,t.jsxs)("section",{children:[(0,t.jsxs)("div",{className:"flex flex-col text-center gap-1 w-full",children:[(0,t.jsx)("h1",{className:"text-primary font-semibold text-xl",children:"Update Profile"}),(0,t.jsx)("div",{className:"w-full "})]}),(0,t.jsx)(v.J9,{initialValues:i,validationSchema:f.Ry(a),onSubmit:o,enableReinitialize:!0,children:e=>(0,t.jsxs)(v.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[s.map(l
1=>(0,t.jsx)(v.gN,{name:l.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 col-span-12",children:[(0,t.jsx)("div",{className:"font-semibold text-themeDarkGray",children:l.label}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(p.UP,{id:null==l?void 0:l.key,name:null==l?void 0:l.name,type:null==l?void 0:l.type,value:null==e?void 0:e.values[null==l?void 0:l.name],onChange:e.handleChange,onBlur:e.handleBlur,error:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e},null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)(p.fl,{type:"submit",sx:"w-full bg-primary text-white shadow-[rgba(50,_50,_105,_0.15)_0px_2px_5px_0px,_rgba(0,_0,_0,_0.05)_0px_1px_1px_0px] h-10 flex items-center justify-center font-medium",disabled:e.isSubmitting||e.isValidating,loading:d,circularProgressClass:"loading-sm text-secondary",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.qyE,{}),"Update Profile"]})})})]})})]})}},93956:function(e,l,i){i.d(l,{G:function(){return d},O:function(){return r}});var t=i(85893),s=i(56309),a=i(82175),n=i(16310),d=()=>{let e=[{key:"1",label:"User Email",name:"email",type:"email",validationSchema:n.Z_().required(" User Email Is Required"),initialValue:"",className:"col-span-12"},{key:"2",label:"Subject",name:"subject",type:"text",validationSchema:n.Z_().required("Subject is Required"),initialValue:"",className:"col-span-12"},{key:"3",label:"Message",name:"message",type:"text",validationSchema:n.Z_().required("Message Is Required"),initialValue:"",className:"col-span-12"},{key:"4",label:"Date",name:"date",type:"date",validationSchema:n.Z_().required("Date Is Required"),initialValue:"",className:"col-span-12"},{key:"5",label:"Time",name:"time",type:"time",validationSchema:n.Z_().required("Time Is Required"),initialValue:"",className:"col-span-12"}],l=e.reduce((e,l)=>(e[null==l?void 0:l.name]=l.initialValue,e),{}),i=e.reduce((e,l)=>(e[l.name]=l.validationSchema,e),{});return(0,t.jsxs)("div",{className:"w-full h-full global-gap flex flex-col",children:[(0,t.jsx)("div",{className:"dashboard-title flex items-center justify-between p-3 md:p-5 bg-dark rounded-b-lg text-white",children:(0,t.jsx)("h2",{children:"Schedule Notification"})}),(0,t.jsx)(a.J9,{initialValues:l,validationSchema:n.Ry(i),onSubmit:e=>{console.log(e,"news add")},enableReinitialize:!0,children:l=>(0,t.jsxs)(a.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4 px-3 md:px-5",children:[e.map(e=>(0,t.jsx)(a.gN,{name:e.name,children:i=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(e.className),children:[(0,t.jsx)("div",{className:"font-semibold text-themeDarkGray",children:e.label}),(0,t.jsx)("div",{className:"col-span-6 w-full",children:(0,t.jsx)(s.UP,{id:null==e?void 0:e.key,name:null==e?void 0:e.name,type:null==e?void 0:e.type,value:null==l?void 0:l.values[null==e?void 0:e.name],onChange:l.handleChange,onBlur:l.handleBlur,error:!!((null==l?void 0:l.touched[null==e?void 0:e.name])&&(null==l?void 0:l.errors[null==e?void 0:e.name])),helperText:(null==l?void 0:l.touched[null==e?void 0:e.name])&&(null==l?void 0:l.errors[null==e?void 0:e.name]),formik:l},null==e?void 0:e.key)})]})},e.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)("button",{type:"submit",className:"submit text-white bg-primary w-full rounded-md px-4 py-2.5",children:"Submit"})})]})})]})},o=i(67294),r=e=>{let{curElm:l}=e,[i,a]=(0,o.useState)(!1);return(0,t.jsxs)("aside",{className:"grid lg:grid-cols-8 md:grid-cols-3 grid-cols-3 text-sm p-3 md:p-5 border border-b",children:[(0,t.jsxs)("div",{className:"lg:col-span-2 md:col-span-1 col-span-2 flex gap-3 items-center",children:[(0,t.jsx)("img",{src:"/admin/user.png",alt:"user_image",className:"w-10 block"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("p",{children:null==l?void 0:l.userName}),(0,t.jsx)("p",{children:null==l?void 0:l.email})]})]}),(0,t.jsx)("div",{className:"col-span-1 hidden md:block",children:null==l?void 0:l.subject}),(0,t.jsx)("div",{className:"col-span-3 hidden lg:block",children:null==l?void 0:l.message}),(0,t.jsx)("div",{className:"col-span-1 hidden lg:block",children:null==l?void 0:l.createdAt}),(0,t.jsx)("div",{className:"col-span-1 flex justify-center items-center",children:(0,t.jsx)("div",{onClick:()=>a(!0),className:"text-sm cursor-pointer bg-primary px-2 py-1 rounded-md text-white",children:"Details"})}),(0,t.jsx)(s.dy,{open:i,onClose:()=>a(!1),anchor:"right",drawerStyle:"w-[80vw] md:w-[50vw] lg:w-[30vw] h-screen",children:(0,t.jsxs)("div",{className:"bg-white flex flex-col global-gap",children:[(0,t.jsx)("div",{className:"dashboard-title flex items-center justify-between p-3 md:p-5 bg-dark rounded-b-lg text-white",children:(0,t.jsx)("h2",{children:" Notification Details"})}),(0,t.jsxs)("div",{className:"px-3 md:px-5 flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:" flex gap-2 items-center",children:[(0,t.jsx)("img",{src:"/admin/user.png",alt:"user_image",className:"w-12"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("p",{className:"font-semibold text-lg leading-5",children:null==l?void 0:l.userName}),(0,t.jsx)("small",{children:null==l?void 0:l.email})]})]}),(0,t.jsxs)("div",{children:["Subject : ",null==l?void 0:l.subject]}),(0,t.jsxs)("div",{children:["Message : ",null==l?void 0:l.message]}),(0,t.jsxs)("div",{children:["Time :"," ",(0,t.jsx)("span",{className:"text-quinary opacity-60",children:null==l?void 0:l.createdAt})]})]})]})})]})}},21768:function(e,l,i){i.d(l,{T2:function(){return x},Dz:function(){return y},$7:function(){return p}});var t=i(85893),s=i(82175),a=i(56309),n=i(16310),d=i(30934),o=i(24430),r=i(67294),c=i(11163),u=i(19198),m=i(47516),x=()=>{var e,l;let[i,x]=(0,r.useState)(0),{query:h}=(0,c.useRouter)(),v="";(null==h?void 0:h["whats-new"])&&(v+="whats-new/".concat(null==h?void 0:h["whats-new"]));let{data:p}=(0,o.YE)(v);console.log(p);let{whatsNewInitialValues:f,whatsNewSchema:g,whatsNewValidation:j}=(0,d.dI)(null==p?void 0:null===(e=p.data)||void 0===e?void 0:e.data),{isLoading:w,mutation:b}=(0,o.Db)(),y=async(e,l)=>{try{var i,t;let s;let a={englishTitle:e.englishTitle,englishDescription:e.englishDescription,hindiTitle:e.hindiTitle,hindiDescription:e.hindiDescription,startDate:new Date(e.startDate).toISOString(),endDate:new Date(e.endDate).toISOString(),status:e.status};(null==h?void 0:h["whats-new"])?s=await b("whats-new/".concat(null==h?void 0:h["whats-new"]),{method:"PUT",isAlert:!0,body:{...a}}):(s=await b("whats-new",{method:"POST",isAlert:!0,body:{...a}}),(null===(t=s)||void 0===t?void 0:null===(i=t.results)||void 0===i?void 0:i.success)&&(x(e=>e+1),null==l||l.resetForm()))}catch(e){(0,u.J)(e)}};return(0,t.jsx)(s.J9,{initialValues:f,validationSchema:n.Ry(j),onSubmit:y,enableReinitialize:null!=p&&null!==(l=p.data)&&void 0!==l&&!!l.data,children:e=>(0,t.jsxs)(s.l0,{className:"w-full grid grid-cols-12 gap-2 md:gap-4",children:[g.map(l=>(0,t.jsx)(s.gN,{name:l.name,children:s=>(0,t.jsxs)("div",{className:"flex flex-col justify-center gap-2 ".concat(l.className),children:[(0,t.jsx)("div",{className:"font-semibold text-themeDarkGray",children:l.label}),(0,t.jsx)("div",{className:"col-span-6 w-full",children:(0,t.jsx)(a.UP,{id:i,name:null==l?void 0:l.name,type:null==l?void 0:l.type,value:null==e?void 0:e.values[null==l?void 0:l.name],options:null==l?void 0:l.options,placeholder:(null==l?void 0:l.name)==="status"?"Select":"",onChange:e.handleChange,onBlur:e.handleBlur,error:!!((null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name])),helperText:(null==e?void 0:e.touched[null==l?void 0:l.name])&&(null==e?void 0:e.errors[null==l?void 0:l.name]),formik:e},"select"===l.type?i:null==l?void 0:l.key)})]})},l.key)),(0,t.jsx)("div",{className:"flex items-center col-span-12 justify-center flex-col gap-2 pt-2",children:(0,t.jsx)(a.fl,{type:"submit",sx:"w-full bg-primary text-white h-10 flex items-center justify-center gap-2",disabled:e.isSubmitting||e.isValidating,loading:w,circularProgressClass:"loading-sm text-secondary",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 poppins",children:[(0,t.jsx)(m.Tn9,{className:"text-xl mt-0.5"}),(null==h?void 0:h["whats-new"])?"Update":"Add"," Whats New"]})})})]})})},h=i(27484),v=i.n(h),p=e=>{var l,i,s,a,n,d,r,c,u,m,x,h,p,g,j,w;let{id:b}=e,{data:y,isValidating:N}=(0,o.YE)("whats-new/".concat(b));return(0,t.jsxs)("section",{className:"global-gap w-full h-full",children:[(0,t.jsx)("div",{className:"dashboard-title flex items-center justify-between p-3 md:p-5 bg-dark rounded-b-lg text-white",children:(0,t.jsx)("h2",{children:"Whats New Details"})}),N?(0,t.jsx)(f,{}):(0,t.jsxs)("div",{className:"flex flex-col p-3 md:p-5 gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"English Title:"}),(0,t.jsx)("p",{children:null==y?void 0:null===(i=y.data)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.englishTitle})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"English Description:"}),(0,t.jsx)("p",{children:null==y?void 0:null===(a=y.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.englishDescription})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Hindi Title:"}),(0,t.jsx)("p",{children:null==y?void 0:null===(d=y.data)||void 0===d?void 0:null===(n=d.data)||void 0===n?void 0:n.hindiTitle})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Hindi Description:"}),(0,t.jsx)("p",{children:null==y?void 0:null===(c=y.data)||void 0===c?void 0:null===(r=c.data)||void 0===r?void 0:r.hindiDescription})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Start Date:"}),(0,t.jsx)("p",{children:v()(null==y?void 0:null===(m=y.data)||void 0===m?void 0:null===(u=m.data)||void 0===u?void 0:u.startDate).format("DD MMM YYYY")})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"End Date:"}),(0,t.jsx)("p",{children:v()(null==y?void 0:null===(h=y.data)||void 0===h?void 0:null===(x=h.data)||void 0===x?void 0:x.endDate).format("DD MMM YYYY")})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Status:"}),(0,t.jsx)("p",{children:null==y?void 0:null===(g=y.data)||void 0===g?void 0:null===(p=g.data)||void 0===p?void 0:p.status})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-primary",children:"Archived:"}),(0,t.jsx)("p",{children:(null==y?void 0:null===(w=y.data)||void 0===w?void 0:null===(j=w.data)||void 0===j?void 0:j.isArchived)?"Yes":"No"})]})]})]})};let f=()=>(0,t.jsxs)("div",{className:"flex flex-col p-3 md:p-5 gap-4",children:[(0,t.jsx)("div",{className:"flex flex-col gap-2",children:(0,t.jsx)("div",{className:"w-20 skeleton h-4 rounded-md"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-20 h-5 skeleton rounded-md"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-1/2 skeleton h-3 rounded-md"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-2/3 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/2 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-1/2 h-5 skeleton rounded-md"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-full skeleton h-3 rounded-md"}),(0,t.jsx)("p",{className:"w-1/2 skeleton h-3 rounded-md"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-12 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/3 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-20 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-1/3 skeleton h-4 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:"w-10 h-5 skeleton rounded-md"}),(0,t.jsx)("div",{className:"w-20 skeleton h-4 rounded-md"})]})]});var g=i(8193),j=i(86455),w=i.n(j),b=i(95581),y=e=>{var l;let{curWhatsNew:i,mutate:s}=e,[n,d]=(0,r.useState)(!1),[x,h]=(0,r.useState)(null==i?void 0:i.status),[f,j]=(0,r.useState)(!1),[y,N]=(0,r.useState)(!1),[k,D]=(0,r.useState)(!1),{mutation:S,isLoading:C}=(0,o.Db)(),{push:T}=(0,c.useRouter)(),A=async()=>{try{w().fire({title:"Warning?",text:"Are you sure you want to ".concat("active"===x?"Inactive":"Active"," this whats New?"),icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, ".concat("active"===x?"Inactive":"Active"," Whats New"),showCancelButton:!0,customClass:b.pv,backdrop:b.IY}).then(async e=>{var l;if(null==e?void 0:e.isConfirmed){N(!0);let e=await S("whats-new/".concat(null==i?void 0:i.id),{method:"PUT",isAlert:!0,body:{status:"active"===x?"inactive":"active"}}
1);N(!1),(null==e?void 0:null===(l=e.results)||void 0===l?void 0:l.success)&&h("active"===x?"inactive":"active")}})}catch(e){(0,u.J)(e)}},q=async e=>{try{w().fire({title:"Warning?",text:"Are you sure you want to remove this whats New?",icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, remove Whats New",showCancelButton:!0,customClass:b.pv,backdrop:b.IY}).then(async l=>{var i;if(null==l?void 0:l.isConfirmed){j(!0);let l=await S("whats-new/".concat(e),{method:"DELETE",isAlert:!0});j(!1),(null==l?void 0:null===(i=l.results)||void 0===i?void 0:i.success)&&s()}})}catch(e){(0,u.J)(e)}},F=async(e,l)=>{try{w().fire({title:"Warning?",text:"Are you sure you want to ".concat(l?"remove this WhatsNew from Archive list":"add this WhatsNew to Archive list","?"),icon:"warning",iconColor:"#FF4D49",confirmButtonColor:"#FF4D49",confirmButtonText:"Yes, ".concat(l?"remove":"add"," Whats New"),showCancelButton:!0,customClass:b.pv,backdrop:b.IY}).then(async i=>{var t;if(null==i?void 0:i.isConfirmed){D(!0);let i=await S("whats-new/".concat(e),{method:"PUT",isAlert:!0,body:{isArchived:!l}});D(!1),(null==i?void 0:null===(t=i.results)||void 0===t?void 0:t.success)&&s()}})}catch(e){(0,u.J)(e)}};return(0,t.jsxs)("div",{className:"w-full relative common-card p-3 md:p-5 min-h-[10rem] overflow-hidden font-medium",children:[(0,t.jsx)(a.dy,{open:n,onClose:()=>d(!1),anchor:"right",drawerStyle:"h-screen bg-white w-[80vw] md:w-[50vw] lg:w-[30vw]",children:(0,t.jsx)(p,{id:null==i?void 0:i.id})}),f?(0,t.jsx)("div",{className:"absolute backdrop-blur-sm flex items-center justify-center z-20 inset-0 w-full h-full",children:(0,t.jsx)("div",{className:"loading loading-infinity loading-lg text-warning"})}):null,(0,t.jsxs)("div",{className:"flex flex-col justify-between w-full h-full gap-1",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("h2",{className:"text-sm",children:[(0,t.jsx)("span",{className:"font-semibold",children:"English Title"})," :"," ",null===(l=i.englishTitle)||void 0===l?void 0:l.slice(0,40)]}),(0,t.jsxs)("h2",{className:"text-sm opacity-70",children:["Time Period :"," ",(0,t.jsxs)("span",{className:"poppins",children:[v()(i.startDate).format("DD MMM YYYY"),"-",v()(i.endDate).format("DD MMM YYYY")]})]}),(0,t.jsxs)("div",{className:"text-sm pt-1",children:["Status :"," ",(0,t.jsx)(a.fl,{onClick:A,loading:y,circularProgressClass:"loading !loading-spinner !loading-xs",sx:"cursor-pointer ".concat("active"===x?"bg-quinary text-white":"bg-red-600 text-white"," px-3 !h-fit min-w-[4rem] !w-fit !py-1 !rounded-xl !text-xs"),children:"active"===x?"Active":"Inactive"})]})]}),(0,t.jsxs)("div",{className:"pt-3 w-full justify-end flex items-center gap-2 md:gap-3",children:[(0,t.jsx)("div",{onClick:()=>F(null==i?void 0:i.id,null==i?void 0:i.isArchived),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-secondary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":(null==i?void 0:i.isArchived)?"Remove From Archive":"Add to Archive",children:k?(0,t.jsx)("span",{className:"loading loading-spinner loading-xs"}):(null==i?void 0:i.isArchived)?(0,t.jsx)(m.bnX,{}):(0,t.jsx)(m.aJk,{})}),(0,t.jsx)("div",{onClick:()=>T("/admin/whats-new/add?whats-new=".concat(null==i?void 0:i.id)),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quinary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Edit",children:(0,t.jsx)(g.QML,{})}),(0,t.jsx)("div",{onClick:()=>q(null==i?void 0:i.id),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-red-600 text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Remove",children:(0,t.jsx)(g.YK6,{})}),(0,t.jsx)("div",{onClick:()=>d(!0),className:"w-7 md:w-8 h-7 md:h-8 flex items-center justify-center rounded-lg bg-quaternary text-white text-base md:text-lg cursor-pointer tooltip tooltip-top","data-tip":"Details",children:(0,t.jsx)(m.kK8,{})})]})]})]})}}}]);
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.