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