"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[5853],{24659:(e,t,s)=>{s.d(t,{A:()=>o});s(65043);var a=s(67784),l=s(4701),n=s(17392),i=s(10155),u=s(70579);const d=(0,l.A)({}),r=e=>{let{onClick:t}=e;return(0,u.jsx)(n.A,{onClick:t,children:(0,u.jsx)(i.A,{})})},o=e=>{const t=d();return(0,u.jsx)(a.A,{InputProps:{...t,endAdornment:(0,u.jsxs)(u.Fragment,{children:[" ",e.iscross&&(0,u.jsx)(r,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},5853:(e,t,s)=>{s.r(t),s.d(t,{default:()=>b});var a=s(65043),l=s(68903),n=s(11906),i=s(38624),u=s(96446),d=s(63516),r=s(24659),o=s(73216),c=s(66675),m=s(14556),v=s(53193),h=s(96801),x=s(73033),A=s(6994),j=s(70579);const p={statusName:"",statusID:""},I=x.Ik().shape({statusName:x.Yj().required("Status Name is required"),statusID:x.Ik().nullable().required("Select Status")}),N=(0,h.Gq)("enuseloc");N&&Object.keys(N).length>0&&N.user_id;const b=function(e){const t=(0,m.wA)(),s=(0,o.Zp)(),h=a.useRef(null),[x,N]=(0,a.useState)(p),b=(0,o.zy)(),f=null===b||void 0===b?void 0:b.state,y=null===f||void 0===f?void 0:f._original,S=[{id:"1",name:"Active"},{id:"0",name:"In Active"}];return(0,a.useEffect)((()=>{y&&N({...x,statusName:null===y||void 0===y?void 0:y.status_name,statusID:{id:y.is_active,name:1==(null===y||void 0===y?void 0:y.is_active)?"Active":"InActive"}})}),[y]),(0,j.jsxs)("div",{className:"component-list",children:[(0,j.jsx)(l.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,j.jsxs)(l.Ay,{item:!0,className:"common-header-label",children:[(0,j.jsx)(n.A,{onClick:()=>{s(-1)},children:(0,j.jsx)(c.A,{})}),"Update Enquiry Call Status"]})}),(0,j.jsx)(d.l1,{enableReinitialize:!0,innerRef:h,initialValues:x,validationSchema:I,onSubmit:async(e,a)=>{var l;const n={statusID:null!==y&&void 0!==y&&y.id?null===y||void 0===y?void 0:y.id:"",statusName:null!==e&&void 0!==e&&e.statusName?null===e||void 0===e?void 0:e.statusName:"",status:null!==e&&void 0!==e&&e.statusID.id?null===e||void 0===e||null===(l=e.statusID)||void 0===l?void 0:l.id:""};a.setSubmitting(!0),await t((0,A.w2e)(n)),a.resetForm({}),s("/crm/crm-enquiry-call-status")},children:e=>{let{errors:t,handleSubmit:s,handleChange:o,setFieldValue:c,handleBlur:m,isSubmitting:h,isValid:x,touched:A,values:p}=e;return(0,j.jsx)(d.lV,{onSubmit:s,children:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.Ay,{container:!0,className:"component-form",children:(0,j.jsxs)(l.Ay,{container:!0,children:[(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,j.jsx)(r.A,{fullWidth:!0,name:"statusName",onBlur:m,onChange:o,value:p.statusName,error:t.statusName&&Boolean(t.statusName),helperText:t.statusName&&t.statusName,id:"statusName",size:"small",label:"Status Name *",variant:"outlined"})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,j.jsx)(v.A,{fullWidth:!0,variant:"standard",children:(0,j.jsx)(i.A,{disablePortal:!0,id:"statusID",options:S||[],name:"statusID",value:p.statusID,size:"small",getOptionLabel:e=>(null===e||void 0===e?void 0:e.name)||"",renderOption:(e,t)=>(0,a.createElement)("li",{...e,style:{textAlign:"left"},key:null===t||void 0===t?void 0:t.id},null===t||void 0===t?void 0:t.name),onChange:(e,t)=>{c("statusID",t)},renderInput:e=>(0,j.jsx)(r.A,{...e,label:"Status",size:"small",helperText:t.statusID&&t.StatusValuesID,error:t.statusID&&Boolean(t.statusID)})})})})]})}),(0,j.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,j.jsx)(u.A,{children:(0,j.jsx)(n.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:h,children:"SAVE"})})})]})})}})]})}},10155:(e,t,s)=>{var a=s(24994);t.A=void 0;var l=a(s(40039)),n=s(70579);t.A=(0,l.default)((0,n.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 l=a(s(40039)),n=s(70579);t.A=(0,l.default)((0,n.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=5853.79f4e190.chunk.js.map