import{h as c,$ as j,g as S,k as w,i as F,j as t,_ as s,q as o}from"./main.2.8.10.js";import{u as I,b as r}from"./react-router.DMwpH23k.js";import{S as L}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as y,I as v,s as C}from"./Integrations.BFhED4ck.js";import{h as N,c as d}from"./LMFWCCommonFunc.BeFjrR5A.js";import{L as k}from"./LMFWCIntegLayout.DC3tVk4K.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./ProUtilHelpers.CtRYkgop.js";function H({allIntegURL:p}){const f=I(),[i,E]=c(j),[e,n]=c(S),[u,m]=r.useState(!1),[g,x]=r.useState({}),[b,a]=r.useState({show:!1}),l=w(F),h=()=>{if(!d(e)){a({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}if(e.module!="update_license"&&!d(e)){o.error(s("Please map mandatory fields","bit-integrations"));return}if(e.module==="create_license"&&!(e!=null&&e.selectedStatus)){o.error(s("Please select Status","bit-integrations"));return}if(e.module==="update_license"&&!(e!=null&&e.selectedLicense)){o.error(s("Please select Status","bit-integrations"));return}C({flow:i,allIntegURL:p,conf:e,navigate:f,edit:1,setIsLoading:m,setSnackbar:a})};return t.jsxs("div",{style:{width:900},children:[t.jsx(L,{snack:b,setSnackbar:a}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:_=>N(_,e,n),name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(y,{entity:i.triggered_entity,setSnackbar:a}),t.jsx(k,{formID:i.triggered_entity_id,formFields:l,licenseManagerConf:e,setLicenseManagerConf:n,loading:g,setLoading:x,setIsLoading:m,setSnackbar:a}),t.jsx(v,{edit:!0,saveConfig:h,disabled:!d(e),isLoading:u,dataConf:e,setDataConf:n,formFields:l}),t.jsx("br",{})]})}export{H as default};
