import{h as l,$ as h,g as j,k as b,i as _,j as t,_ as o}from"./main.2.9.0.js";import{u as I,e as w,b as p}from"./react-router.DMwpH23k.js";import{S as C}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S,I as v,s as y}from"./Integrations.DL8wqGct.js";import{h as c,c as F}from"./RapidmailCommonFunc.CeC0Czn-.js";import{R}from"./RapidmailIntegLayout.CoaQ_gNm.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.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};
