"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[69175],{24659:(e,t,i)=>{i.d(t,{A:()=>u});i(65043);var s=i(67784),r=i(4701),l=i(17392),a=i(10155),n=i(70579);const d=(0,r.A)({}),m=e=>{let{onClick:t}=e;return(0,n.jsx)(l.A,{onClick:t,children:(0,n.jsx)(a.A,{})})},u=e=>{const t=d();return(0,n.jsx)(s.A,{InputProps:{...t,endAdornment:(0,n.jsxs)(n.Fragment,{children:[" ",e.iscross&&(0,n.jsx)(m,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},69175:(e,t,i)=>{i.r(t),i.d(t,{default:()=>p});var s=i(65043),r=i(11906),l=i(68903),a=i(38624),n=i(96446),d=i(24659),m=i(63516),u=i(14556),o=i(73033),v=i(73216),c=i(66675),h=i(11852),x=i(70579);const j={itemName:"",itemOrder:"",status:""},A=o.Ik().shape({itemName:o.Yj("Enter Item Name").required("Item Name is required"),itemOrder:o.ai("Enter Item Order").required("Item Order is required").positive("Order Must be Positive Number"),status:o.Ik().nullable().required("status is required")});const p=function(e){const t=(0,u.wA)(),i=(0,v.Zp)(),o=(0,v.zy)(),p=null===o||void 0===o?void 0:o.state,b=null===p||void 0===p?void 0:p._original,N=s.useRef(null),[O,f]=(0,s.useState)(j);return(0,s.useEffect)((()=>{b&&f({...O,itemName:null===b||void 0===b?void 0:b.item_name,itemOrder:null===b||void 0===b?void 0:b.item_order,status:{id:null===b||void 0===b?void 0:b.status,name:null===b||void 0===b?void 0:b.status}})}),[b]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"common-header-label-bold",children:[(0,x.jsx)(r.A,{onClick:()=>{i(-1)},children:(0,x.jsx)(c.A,{})}),"Update Registration Fees"]}),(0,x.jsx)("div",{className:"component-list",children:(0,x.jsx)(m.l1,{enableReinitialize:!0,innerRef:N,validationSchema:A,initialValues:O,onSubmit:async(e,s)=>{var r,l;const a={itemId:null===b||void 0===b?void 0:b.id,itemName:null!==e&&void 0!==e&&e.itemName?null===e||void 0===e?void 0:e.itemName:"",itemOrder:null!==e&&void 0!==e&&e.itemOrder?null===e||void 0===e?void 0:e.itemOrder:"",status:null!==e&&void 0!==e&&null!==(r=e.status)&&void 0!==r&&r.id?null===e||void 0===e||null===(l=e.status)||void 0===l?void 0:l.id:""};s.setSubmitting(!0),await t((0,h.fDW)(a)),i("/bd-masters/RegistrationFees")},children:e=>{let{errors:t,handleSubmit:i,handleChange:s,handleBlur:u,setFieldValue:o,isSubmitting:v,isValid:c,touched:h,values:j}=e;return(0,x.jsx)(m.lV,{onSubmit:i,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(l.Ay,{container:!0,className:"component-form",children:(0,x.jsxs)(l.Ay,{container:!0,children:[(0,x.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(d.A,{fullWidth:!0,label:"Item name*",name:"itemName",onBlur:u,value:j.itemName,onChange:(e,t)=>{o("itemName",t),f({...O,itemName:e.target.value})},variant:"outlined",size:"small",helperText:h.itemName&&t.itemName,error:h.itemName&&Boolean(t.itemName)})}),(0,x.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(d.A,{fullWidth:!0,label:"Item Order*",name:"itemOrder",onBlur:u,value:j.itemOrder,onChange:(e,t)=>{o("itemOrder",t),f({...O,itemOrder:e.target.value})},variant:"outlined",size:"small",type:"number",helperText:h.itemOrder&&t.itemOrder,error:h.itemOrder&&Boolean(t.itemOrder)})}),(0,x.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(a.A,{name:"status",value:j.status,fullWidth:!0,options:[{id:1,name:"Active"},{id:2,name:"InActive"}],onBlur:u,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,t)=>{o("status",t),f({...O,status:t})},renderInput:e=>(0,x.jsx)(d.A,{...e,fullWidth:!0,label:"Status *",name:"status",variant:"outlined",helperText:t.status&&t.status,error:t.status&&Boolean(t.status)})})})]})}),(0,x.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,x.jsx)(n.A,{children:(0,x.jsx)(r.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:v,children:"SAVE"})})})]})})}})})]})}},10155:(e,t,i)=>{var s=i(24994);t.A=void 0;var r=s(i(40039)),l=i(70579);t.A=(0,r.default)((0,l.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,i)=>{var s=i(24994);t.A=void 0;var r=s(i(40039)),l=i(70579);t.A=(0,r.default)((0,l.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=69175.460a2b8f.chunk.js.map