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