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