"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[67497],{24659:(e,t,s)=>{s.d(t,{A:()=>o});s(65043);var a=s(67784),l=s(4701),i=s(17392),n=s(10155),r=s(70579);const u=(0,l.A)({}),d=e=>{let{onClick:t}=e;return(0,r.jsx)(i.A,{onClick:t,children:(0,r.jsx)(n.A,{})})},o=e=>{const t=u();return(0,r.jsx)(a.A,{InputProps:{...t,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},67497:(e,t,s)=>{s.r(t),s.d(t,{default:()=>I});var a=s(65043),l=s(68903),i=s(11906),n=s(38624),r=s(96446),u=s(63516),d=s(24659),o=s(73216),m=s(66675),c=s(14556),v=s(53193),h=s(96801),x=s(73033),A=s(6994),j=s(70579);const p={statusName:"",statusID:"",statusOrder:""},b=x.Ik().shape({statusName:x.Yj().required("Group Name is required"),statusOrder:x.ai().required("Status Order is required"),statusID:x.Ik().nullable().required("Select Status")}),y=(0,h.Gq)("enuseloc");y&&Object.keys(y).length>0&&y.user_id;const I=function(e){const t=(0,c.wA)(),s=(0,o.Zp)(),h=a.useRef(null),[x,y]=(0,a.useState)(p),I=(0,o.zy)(),N=null===I||void 0===I?void 0:I.state,f=null===N||void 0===N?void 0:N._original,O=[{id:"1",name:"Active"},{id:"0",name:"In Active"}];return(0,a.useEffect)((()=>{f&&y({...x,statusName:null===f||void 0===f?void 0:f.status_name,statusOrder:null===f||void 0===f?void 0:f.status_order,statusID:{id:f.is_active,name:1==(null===f||void 0===f?void 0:f.is_active)?"Active":"InActive"}})}),[f]),(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)(i.A,{onClick:()=>{s(-1)},children:(0,j.jsx)(m.A,{})}),"Update Enquiry Status"]})}),(0,j.jsx)(u.l1,{enableReinitialize:!0,innerRef:h,initialValues:x,validationSchema:b,onSubmit:async(e,a)=>{var l;const i={statusID:null!==f&&void 0!==f&&f.id?null===f||void 0===f?void 0:f.id:"",statusName:null!==e&&void 0!==e&&e.statusName?null===e||void 0===e?void 0:e.statusName:"",statusOrder:null!==e&&void 0!==e&&e.statusOrder?null===e||void 0===e?void 0:e.statusOrder:"",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.gSk)(i)),a.resetForm({}),s("/crm/crm-enquiry-status")},children:e=>{let{errors:t,handleSubmit:s,handleChange:o,setFieldValue:m,handleBlur:c,isSubmitting:h,isValid:x,touched:A,values:p}=e;return(0,j.jsx)(u.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)(d.A,{fullWidth:!0,name:"statusName",onBlur:c,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)(d.A,{fullWidth:!0,name:"statusOrder",onBlur:c,onChange:o,value:p.statusOrder,error:A.statusOrder&&Boolean(t.statusOrder),helperText:A.statusOrder&&t.statusOrder,id:"statusOrder",type:"number",size:"small",label:"Status Order *",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)(n.A,{disablePortal:!0,id:"statusID",options:O||[],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)=>{m("statusID",t)},renderInput:e=>(0,j.jsx)(d.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)(r.A,{children:(0,j.jsx)(i.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)),i=s(70579);t.A=(0,l.default)((0,i.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)),i=s(70579);t.A=(0,l.default)((0,i.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=67497.7412ba41.chunk.js.map