import{u as b,d as l,r as i,h as _,j as e}from"./main-406.js";import{$ as w,g as C,h as I,d as S,_ as o,i as L,I as y,W as c,s as F}from"./bi.394.85.js";import{h as E,c as m}from"./bi.931.911.js";import{L as N}from"./bi.828.912.js";function M({allIntegURL:f}){const g=b(),[a,k]=l(w),[t,n]=l(C),[p,r]=i.useState(!1),[u,x]=i.useState({}),[h,s]=i.useState({show:!1}),d=_(I),v=()=>{if(!m(t)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(!t.selectedEvent){c.error("Please select an Event");return}if(!t.selectedSession){c.error("Please select a Session");return}F({flow:a,allIntegURL:f,conf:t,navigate:g,edit:1,setIsLoading:r,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(S,{snack:h,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:j=>E(j,t,n),name:"name",value:t.name,type:"text",placeholder:o("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:d,livestormConf:t,setLivestormConf:n,loading:u,setLoading:x,setIsLoading:r,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:v,disabled:!m(t),isLoading:p,dataConf:t,setDataConf:n,formFields:d}),e.jsx("br",{})]})}export{M as default};
