"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[6989],{24659:(e,t,s)=>{s.d(t,{A:()=>d});s(65043);var a=s(67784),n=s(4701),l=s(17392),i=s(10155),r=s(70579);const u=(0,n.A)({}),o=e=>{let{onClick:t}=e;return(0,r.jsx)(l.A,{onClick:t,children:(0,r.jsx)(i.A,{})})},d=e=>{const t=u();return(0,r.jsx)(a.A,{InputProps:{...t,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(o,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},6989:(e,t,s)=>{s.r(t),s.d(t,{default:()=>N});var a=s(65043),n=s(11906),l=s(68903),i=s(38624),r=s(96446),u=s(24659),o=s(63516),d=s(14556),c=s(73033),m=s(73216),p=s(66675),v=s(10159),h=s(96801),g=s(70579);const x=(0,h.Gq)("enuseloc"),A=(x&&Object.keys(x).length>0&&x.user_id,{groupName:"",status:""}),j=c.Ik().shape({groupName:c.Yj().nullable().required("Enter Group Name"),status:c.Ik().nullable().required("Select Status")});const N=function(e){const t=(0,m.zy)(),s=(null===t||void 0===t?void 0:t.state)._original,[c,h]=(0,a.useState)(!1),x=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],N=a.useRef(null),[b,f]=(0,a.useState)(A),k=(0,d.wA)(),S=(0,m.Zp)(),y=()=>{S(-1)};(0,a.useEffect)((()=>{s&&f({...b,groupName:null===s||void 0===s?void 0:s.group_name,status:{id:null===s||void 0===s?void 0:s.status,name:null===s||void 0===s?void 0:s.status}})}),[s]),console.log("civilitemCategoryData",s);const C=()=>{const{groupName:e,status:t,...s}=A;f({...b,...s})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"common-header-label-bold",children:[(0,g.jsx)(n.A,{onClick:y,children:(0,g.jsx)(p.A,{})}),"Update Asset Group"]}),(0,g.jsx)("div",{className:"component-list",children:(0,g.jsx)(o.l1,{enableReinitialize:!0,innerRef:N,validationSchema:j,initialValues:b,onSubmit:async(e,t)=>{var a,n;const l={groupID:null===s||void 0===s?void 0:s.id,groupName:e.groupName,status:null!==(a=e.status)&&void 0!==a&&a.id?null===(n=e.status)||void 0===n?void 0:n.id:""};console.log("finalPayload",l),t.setSubmitting(!0),await k((0,v.Yk3)(l)),C(),y()},children:e=>{let{errors:t,handleSubmit:s,handleChange:a,handleBlur:d,setFieldValue:c,isSubmitting:m,isValid:p,touched:v,values:h}=e;return(0,g.jsx)(o.lV,{onSubmit:s,children:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(l.Ay,{container:!0,className:"component-form",children:(0,g.jsxs)(l.Ay,{container:!0,children:[(0,g.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,g.jsx)(u.A,{fullWidth:!0,label:"Group Name*",name:"groupName",onBlur:d,value:h.groupName,onChange:(e,t)=>{c("groupName",t),f({...b,groupName:e.target.value})},variant:"outlined",size:"small",helperText:v.groupName&&t.groupName,error:v.groupName&&Boolean(t.groupName)})}),(0,g.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,g.jsx)(i.A,{name:"status",value:h.status,fullWidth:!0,options:x||[],onBlur:d,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,t)=>{c("status",t),f({...b,status:t})},renderInput:e=>(0,g.jsx)(u.A,{...e,fullWidth:!0,label:"Status*",name:"status",variant:"outlined",helperText:t.status&&t.status,error:t.status&&Boolean(t.status)})})})]})}),(0,g.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,g.jsx)(r.A,{children:(0,g.jsx)(n.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})})]})})}})})]})}},10155:(e,t,s)=>{var a=s(24994);t.A=void 0;var n=a(s(40039)),l=s(70579);t.A=(0,n.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,t,s)=>{var a=s(24994);t.A=void 0;var n=a(s(40039)),l=s(70579);t.A=(0,n.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")}}]);
//# sourceMappingURL=6989.30f5b255.chunk.js.map