"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[62109],{24659:(e,n,i)=>{i.d(n,{A:()=>u});i(65043);var t=i(67784),s=i(4701),l=i(17392),a=i(10155),r=i(70579);const o=(0,s.A)({}),d=e=>{let{onClick:n}=e;return(0,r.jsx)(l.A,{onClick:n,children:(0,r.jsx)(a.A,{})})},u=e=>{const n=o();return(0,r.jsx)(t.A,{InputProps:{...n,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},62109:(e,n,i)=>{i.r(n),i.d(n,{default:()=>b});var t=i(65043),s=i(11906),l=i(68903),a=i(96446),r=i(24659),o=i(63516),d=i(73033),u=i(14556),c=i(73216),m=i(66675),p=i(11852),v=i(10159),h=(i(51749),i(96801)),x=i(70579);const g={groupName:""},j=d.Ik().shape({groupName:d.Yj().nullable().required("Enter Group Name")}),f=(0,h.Gq)("enuseloc"),A=f&&Object.keys(f).length>0?f.user_id:null,N=[];const b=function(e){const[n,i]=(0,t.useState)(g),[d,h]=(0,t.useState)([]),f=t.useRef(null),b=((0,u.d4)((e=>e.bd.liaisonProcessPlanFile.data)),(0,u.wA)()),k=(0,c.Zp)(),[y,S]=((0,u.d4)((e=>e.bd.user)),(0,t.useState)([])),[C,P]=((0,u.d4)((e=>e.bd.projectTaskDocumentType)),(0,t.useState)([])),F=(0,u.d4)((e=>{var n;return null===(n=e.bd.getFunctionalityPermissionDetail)||void 0===n?void 0:n.data})),T=(0,t.useRef)("NO"),z=(0,t.useRef)("NO");(0,t.useEffect)((()=>{const e={userID:A,functionalityID:243,functionalityItemIDs:N};return b((0,p.P8M)(e)),()=>{b((0,p.qo7)())}}),[]),(0,t.useEffect)((()=>(F&&243===(null===F||void 0===F?void 0:F.functionalityID)&&(P(F),T.current=null===F||void 0===F?void 0:F.permission_report,z.current=null===F||void 0===F?void 0:F.permission_admin),()=>{P([]),T.current="NO",z.current="NO"})),[F]),(0,u.d4)((e=>e.civil.getCivilProjects)),(0,u.d4)((e=>e.civil.getCivilProjectPlanningStage)),(0,u.d4)((e=>e.bd.apfTaskPanelFilterList)),(0,u.d4)((e=>e.bd.apfTaskPlanQueryList)),(0,u.d4)((e=>e.bd.apfTaskPlanTaskFilterList)),(0,u.d4)((e=>e.bd.apfTaskPlanList));const E=()=>{k(-1)};return(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("div",{className:"component-list",style:{marginTop:"20px"},children:[(0,x.jsxs)(s.A,{onClick:E,children:[(0,x.jsx)(m.A,{}),"Add Item Group"]}),C&&Object.keys(C).length>0&&243===(null===C||void 0===C?void 0:C.functionalityID)&&("YES"===(null===C||void 0===C?void 0:C.permission_admin)||"YES"===(null===C||void 0===C?void 0:C.AddAPFQuery))?(0,x.jsx)(o.l1,{enableReinitialize:!0,innerRef:f,initialValues:n,validationSchema:j,onSubmit:async(e,n)=>{const i={groupName:null===e||void 0===e?void 0:e.groupName};console.log("finalpayload",i),n.setSubmitting(!0),await b((0,v.MZ5)(i)),n.resetForm({}),E()},children:e=>{let{errors:t,handleSubmit:d,handleChange:u,handleBlur:c,setFieldValue:m,isSubmitting:p,isValid:v,touched:h,values:j}=e;return(0,x.jsx)(o.lV,{onSubmit:d,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"reports-list",children:(0,x.jsx)("div",{className:"component-form",children:(0,x.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(r.A,{name:"groupName",fullWidth:!0,id:"groupName",type:"text",onBlur:c,value:n.groupName,onChange:(e,t)=>{m("groupName",t),i({...n,groupName:e.target.value})},error:h.groupName&&Boolean(t.groupName),helperText:h.groupName&&t.groupName,size:"small",label:"Group Name *",variant:"outlined"})})})}),(0,x.jsxs)(l.Ay,{className:"d-flex justify-content-center",p:2,children:[(0,x.jsxs)(a.A,{mx:2,children:[" ",(0,x.jsx)(s.A,{text:"CANCEL",variant:"contained",color:"secondary",size:"medium",type:"reset",onClick:()=>{i({...g})},children:"RESET"})]}),(0,x.jsx)(a.A,{children:(0,x.jsx)(s.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:p,children:"Add"})})]})]})})}}):(0,x.jsx)("div",{className:"common-header-label-bold",children:"You don't have permission to access this page!"})]})})}},10155:(e,n,i)=>{var t=i(24994);n.A=void 0;var s=t(i(40039)),l=i(70579);n.A=(0,s.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")},66675:(e,n,i)=>{var t=i(24994);n.A=void 0;var s=t(i(40039)),l=i(70579);n.A=(0,s.default)((0,l.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")},51749:()=>{}}]);
//# sourceMappingURL=62109.169e9296.chunk.js.map