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