import{h as l,$ as h,g as j,k as b,i as _,j as t,_ as o}from"./main.2.8.10.js";import{u as I,e as w,b as p}from"./react-router.DMwpH23k.js";import{S as C}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S,I as v,s as y}from"./Integrations.BFhED4ck.js";import{h as c,c as F}from"./RapidmailCommonFunc.Btxh9TPt.js";import{R}from"./RapidmailIntegLayout.3S9HPUI_.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=I(),{id:N}=w(),[i,k]=l(h),[e,s]=l(j),[r,m]=p.useState(!1),[x,a]=p.useState({show:!1}),d=b(_),u=()=>{if(!F(e)){a({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}y({flow:i,allIntegURL:f,conf:e,navigate:g,edit:1,setIsLoading:m,setSnackbar:a})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{snack:x,setSnackbar:a}),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=>c(n,e,s),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(S,{entity:i.triggered_entity,setSnackbar:a}),t.jsx(R,{formID:i.triggered_entity_id,formFields:d,handleInput:n=>c(n,e,s),rapidmailConf:e,setRapidmailConf:s,isLoading:r,setIsLoading:m,setSnackbar:a}),t.jsx(v,{edit:!0,saveConfig:u,disabled:e.field_map.length<1,isLoading:r,dataConf:e,setDataConf:s,formFields:d}),t.jsx("br",{})]})}export{J as default};
