import{h as d,$ as j,g as _,k as v,i as w,j as t,_ as i,q as C}from"./main.2.9.0.js";import{u as I,b as n}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as y,I as F,s as D}from"./Integrations.DL8wqGct.js";import{h as E,c as l}from"./DemioCommonFunc.BEeLbAh1.js";import{D as N}from"./DemioIntegLayout.De6x5yzk.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function K({allIntegURL:c}){const f=I(),[a,k]=d(j),[e,o]=d(_),[p,r]=n.useState(!1),[g,x]=n.useState({}),[u,s]=n.useState({show:!1}),m=v(w),h=()=>{if(!l(e)){s({show:!0,msg:i("Please map mandatory fields","bit-integrations")});return}if(!e.selectedEvent){C.error(i("Please select a Event","bit-integrations"));return}D({flow:a,allIntegURL:c,conf:e,navigate:f,edit:1,setIsLoading:r,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(S,{snack:u,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:i("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:b=>E(b,e,o),name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(y,{entity:a.triggered_entity,setSnackbar:s}),t.jsx(N,{formID:a.triggered_entity_id,formFields:m,demioConf:e,setDemioConf:o,loading:g,setLoading:x,setIsLoading:r,setSnackbar:s}),t.jsx(F,{edit:!0,saveConfig:h,disabled:!l(e),isLoading:p,dataConf:e,setDataConf:o,formFields:m}),t.jsx("br",{})]})}export{K as default};
