import{h as d,$ as h,g as j,k as E,i as b,j as t,_ as o}from"./main.2.8.10.js";import{u as _,e as I,b as c}from"./react-router.DMwpH23k.js";import{S as w}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as C,I as S,s as v}from"./Integrations.BFhED4ck.js";import{h as p,c as y}from"./ElasticEmailCommonFunc.CE20DUPG.js";import{E as F}from"./ElasticEmailIntegLayout.CO0UFtk1.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function J({allIntegURL:f}){const g=_(),{id:N}=I(),[i,k]=d(h),[e,a]=d(j),[r,m]=c.useState(!1),[x,s]=c.useState({show:!1}),l=E(b),u=()=>{if(!y(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}v({flow:i,allIntegURL:f,conf:e,navigate:g,edit:1,setIsLoading:m,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(w,{snack:x,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:n=>p(n,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(C,{entity:i.triggered_entity,setSnackbar:s}),t.jsx(F,{formID:i.triggered_entity_id,formFields:l,handleInput:n=>p(n,e,a),elasticEmailConf:e,setElasticEmailConf:a,isLoading:r,setIsLoading:m,setSnackbar:s}),t.jsx(S,{edit:!0,saveConfig:u,disabled:e.field_map.length<1,isLoading:r,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{J as default};
