var v=Object.defineProperty;var l=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var c=(e,s,a)=>s in e?v(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,f=(e,s)=>{for(var a in s||(s={}))N.call(s,a)&&c(e,a,s[a]);if(l)for(var a of l(s))w.call(s,a)&&c(e,a,s[a]);return e};import{G as y,g as C,r as m,j as t,S as R,_ as d}from"./main-343.js";import{a7 as k}from"./bf-659-81.js";import{I as _}from"./bf-58-184.js";import{a as u,c as E}from"./bf-746-172.js";import{R as L}from"./bf-336-204.js";import"./bf-974-82.js";import"./bf-649-79.js";import"./bf-594-113.js";function B({formFields:e,setIntegration:s,integrations:a,allIntegURL:x}){const g=y(),{id:p,formID:h}=C(),[i,n]=m.useState(f({},a[p])),[j,I]=m.useState(!1),[b,r]=m.useState({show:!1}),S=()=>{if(!E(i)){r({show:!0,msg:d("Please map mandatory fields")});return}k(a,s,x,i,g,p,1)};return t.jsxs("div",{style:{width:900},children:[t.jsx(R,{snack:b,setSnackbar:r}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:d("Integration Name:")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>u(o,i,n),name:"name",value:i.name,type:"text",placeholder:d("Integration Name...")})]}),t.jsx("br",{}),t.jsx(L,{formID:h,formFields:e,handleInput:o=>u(o,i,n),rapidmailConf:i,setRapidmailConf:n,isLoading:j,setIsLoading:I,setSnackbar:r}),t.jsx(_,{edit:!0,saveConfig:S,disabled:i.field_map.length<1}),t.jsx("br",{})]})}export{B as default};
