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