"use strict";(self.webpackChunkmy_app=self.webpackChunkmy_app||[]).push([[134],{134:(e,a,t)=>{t.r(a),t.d(a,{default:()=>x});var s=t(5043),r=(t(3910),t(6775),t(8258)),l=t(3495),i=t(1137),n=(t(1747),t(3908)),d=t(9837),c=(t(7400),t(3519)),o=t(4282),u=t(9397),m=(t(4693),t(3023),t(8207)),h=t(579);const x=e=>{let{props:a}=e;const{t:x,i18n:p}=(0,i.Bd)(),[S,g]=(0,s.useState)(),[j,f]=(0,s.useState)(!1),[N,b]=(0,s.useState)(),[A,w]=(0,s.useState)(!1),[y,k]=(0,s.useState)(!1),[v,D]=(0,s.useState)([]),[F,C]=(0,s.useState)(!1),[I,O]=(0,s.useState)(),[_,Y]=(0,s.useState)(JSON.parse(sessionStorage.getItem("userData")).organisationUnits),[B,J]=(0,s.useState)(),[M,T]=(0,s.useState)("Yearly"),[V,E]=(0,s.useState)(!1),H=new Date,[P,z]=(H.getFullYear(),H.getMonth(),H.getMonth(),(0,s.useState)({})),[L,U]=(0,s.useState)(H.getFullYear().toString()),q=()=>{E(!0!==V)},G=()=>{E(!1)},[K,Q]=(0,s.useState)(x("Select File")),[R,W]=(0,s.useState)(null);return(0,s.useEffect)((()=>{k(!0);F||(b(JSON.parse(sessionStorage.getItem("userData")).orguid),O(_))}),[N,L]),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.A,{isLoading:j}),(0,h.jsx)(n.A,{sidebar:(0,h.jsx)(d.A,{closeSidebar:G,defaultOrg:_,latestPeriod:L,applyFilter:(e,a,t,s)=>{C(!0),O(e),b(),J(t),T(s),b(e[e.length-1].id),U(a),G()},resetFilter:()=>{U(H.getFullYear().toString()),J(""),b(_[0].id),O(_),C(!1),G()}}),open:V,onSetOpen:()=>q(),styles:{sidebar:{background:"white",zIndex:99999}},sidebarClassName:"custom-sidebar-class",touch:!0,shadow:!0,transitions:!0,children:(0,h.jsx)("b",{children:"Main content"})}),(0,h.jsxs)("div",{className:"mainContainer",children:[(0,h.jsx)("div",{className:"headerfixedcontainer",children:(0,h.jsx)(c.A,{fluid:!0,children:(0,h.jsxs)("div",{className:"headerbarcontainer",children:[(0,h.jsx)("div",{className:"mr-2",children:(0,h.jsxs)(o.A,{variant:"primary",className:"selectfilterbtn",onClick:()=>q(),children:[x("Select Filter")," ",(0,h.jsx)("i",{className:"fa fa-caret-down"})]})}),(0,h.jsx)("div",{className:"mr-2",children:(0,h.jsxs)(u.A,{children:[(0,h.jsx)(u.A.Item,{href:"#",children:x("Variable Download")}),I?I.map((e=>(0,h.jsx)(u.A.Item,{href:"#",children:e.displayName},e.id))):""]})})]})})}),(0,h.jsx)("div",{class:"container-fluid pl-1 pr-1 mt-110px",children:(0,h.jsxs)(r.A,{className:"fixHeight data-uploadSection",id:"dataSection",children:[(0,h.jsx)(r.A.Header,{className:"pt-3",children:x("Variable Download")}),(0,h.jsx)(r.A.Body,{children:(0,h.jsx)(r.A.Text,{children:(0,h.jsx)(o.A,{onClick:()=>(()=>{f(!0);let e={programuid:JSON.parse(sessionStorage.getItem("userData")).programuid};l.Ay.post("rtmpro/template/generateVariableSheet",e).then((e=>{f(!1),console.log(e.data.url);var a=document.createElement("a");a.target="_blank",a.download="Download_Template_"+new Date+".xlsx",a.href=e.data.url,a.click()}))})(),className:"nextbtn ml-2",children:x("Download Template")})})})]})}),(0,h.jsxs)("footer",{className:"footer",children:[(0,h.jsx)("p",{children:"Powered By"}),(0,h.jsx)("img",{src:t(585),alt:"gallary",className:"ml-2"})]})]})]})}}}]);
//# sourceMappingURL=134.e2966b76.chunk.js.map