"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[80419],{24659:(e,i,t)=>{t.d(i,{A:()=>m});t(65043);var n=t(67784),r=t(4701),s=t(17392),l=t(10155),a=t(70579);const d=(0,r.A)({}),o=e=>{let{onClick:i}=e;return(0,a.jsx)(s.A,{onClick:i,children:(0,a.jsx)(l.A,{})})},m=e=>{const i=d();return(0,a.jsx)(n.A,{InputProps:{...i,endAdornment:(0,a.jsxs)(a.Fragment,{children:[" ",e.iscross&&(0,a.jsx)(o,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},80419:(e,i,t)=>{t.r(i),t.d(i,{default:()=>b});var n=t(65043),r=t(68903),s=t(11906),l=t(96446),a=t(63516),d=t(24659),o=t(73216),m=t(66675),u=t(11852),c=t(14556),h=t(73033),v=t(96801),x=t(70579);const j={itemName:"",itemOrder:""},p=h.Ik().shape({itemName:h.Yj("Enter Item Name").required("Item Name is required"),itemOrder:h.ai("Enter Item Order").required("Item Order is required").positive("Order Must be Positive Number")}),A=(0,v.Gq)("enuseloc"),N=A&&Object.keys(A).length>0?A.user_id:null,f=[];const b=function(e){const i=n.useRef(null),[t,h]=(0,n.useState)(j),v=(0,o.Zp)(),A=(0,c.wA)(),[b,y]=(0,n.useState)([]),O=(0,c.d4)((e=>{var i;return null===(i=e.bd.getFunctionalityPermissionDetail)||void 0===i?void 0:i.data})),g=(0,n.useRef)("NO"),k=(0,n.useRef)("NO");return(0,n.useEffect)((()=>{const e={userID:N,functionalityID:113,functionalityItemIDs:f};return A((0,u.P8M)(e)),()=>{A((0,u.qo7)())}}),[]),(0,n.useEffect)((()=>(O&&113===(null===O||void 0===O?void 0:O.functionalityID)&&(y(O),g.current=null===O||void 0===O?void 0:O.permission_report,k.current=null===O||void 0===O?void 0:O.permission_admin),()=>{y([]),g.current="NO",k.current="NO"})),[O]),(0,x.jsxs)("div",{className:"component-list",children:[(0,x.jsx)(r.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,x.jsxs)(r.Ay,{item:!0,className:"common-header-label",children:[(0,x.jsx)(s.A,{onClick:()=>{v(-1)},children:(0,x.jsx)(m.A,{})}),"Add Registration Fees"]})}),b&&Object.keys(b).length>0&&113===(null===b||void 0===b?void 0:b.functionalityID)&&"YES"===(null===b||void 0===b?void 0:b.permission_admin)?(0,x.jsx)(a.l1,{enableReinitialize:!0,innerRef:i,initialValues:t,validationSchema:p,onSubmit:async(e,i)=>{const t={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:""};console.log("finalpayload:: ",t),i.setSubmitting(!0),await A((0,u.Iwk)(t)),i.resetForm({}),v("/bd-masters/RegistrationFees")},children:e=>{let{errors:i,handleSubmit:t,handleChange:n,setFieldvalue:o,handleBlur:m,isSubmitting:u,isValid:c,touched:v,values:p}=e;return(0,x.jsx)(a.lV,{onSubmit:t,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(r.Ay,{container:!0,className:"component-form",children:(0,x.jsxs)(r.Ay,{container:!0,children:[(0,x.jsx)(r.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(d.A,{fullWidth:!0,name:"itemName",onBlur:m,onChange:n,value:p.itemName,error:i.itemName&&Boolean(i.itemName),helperText:i.itemName&&i.itemName,id:"itemName",size:"small",label:"Item Name*",variant:"outlined"})}),(0,x.jsx)(r.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(d.A,{name:"itemOrder",fullWidth:!0,onBlur:m,onChange:n,value:p.itemOrder,error:i.itemOrder&&Boolean(i.itemOrder),helperText:i.itemOrder&&i.itemOrder,type:"number",id:"itemOrder",size:"small",label:"Item Order*",variant:"outlined"})})]})}),(0,x.jsxs)(r.Ay,{className:"d-flex justify-content-end",p:2,children:[(0,x.jsx)(l.A,{mx:2,children:(0,x.jsx)(s.A,{text:"CANCEL",variant:"contained",color:"secondary",size:"medium",type:"reset",onClick:()=>{h(j)},children:"RESET"})}),(0,x.jsx)(l.A,{children:(0,x.jsx)(s.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:u,children:"SAVE"})})]})]})})}}):(0,x.jsx)("div",{className:"common-header-label-bold",children:"You don't have permission to access this page!"})]})}},10155:(e,i,t)=>{var n=t(24994);i.A=void 0;var r=n(t(40039)),s=t(70579);i.A=(0,r.default)((0,s.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,i,t)=>{var n=t(24994);i.A=void 0;var r=n(t(40039)),s=t(70579);i.A=(0,r.default)((0,s.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=80419.6b6f7fba.chunk.js.map