import{u as j,d as c,r as o,h as S,j as e}from"./main-406.js";import{$ as _,g as I,h as C,d as w,_ as m,i as y,I as F,c as i,s as k}from"./bi.394.85.js";import{h as f,c as v}from"./bi.787.936.js";import{S as M}from"./bi.231.937.js";import"./bi.704.707.js";import"./bi.701.708.js";function A({allIntegURL:u}){const p=j(),[n,N]=c(_),[t,s]=c(I),[g,E]=o.useState(!1),[x,d]=o.useState({auth:!1,groups:!1}),[h,a]=o.useState({show:!1}),l=S(C),b=()=>{if(!t.selectedTask){i.error("Please select a task!");return}if(!v(t)){i.error("Please map mandatory fields!");return}if(!t.selectedGroup){i.error("Please select a group!");return}k({flow:n,allIntegURL:u,conf:t,navigate:p,edit:1,setLoading:d,setSnackbar:a})};return e.jsxs("div",{style:{width:900},children:[e.jsx(w,{snack:h,setSnackbar:a}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:m("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:r=>f(r,t,s),name:"name",defaultValue:t.name||"",type:"text",placeholder:m("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(y,{entity:n.triggered_entity,setSnackbar:a}),e.jsx(M,{formID:n.triggered_entity_id,formFields:l,handleInput:r=>f(r,t,s),sureMembersConf:t,setSureMembersConf:s,loading:x,setLoading:d,setSnackbar:a}),e.jsx(F,{edit:!0,saveConfig:b,isLoading:g,dataConf:t,setDataConf:s,formFields:l}),e.jsx("br",{})]})}export{A as default};
