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{D as w,g as y,r as p,j as n,S as k,_ as d}from"./main-634.js";import{a7 as _}from"./bf-746-82.js";import{I as E}from"./bf-942-184.js";import{h,c as L}from"./bf-508-92.js";import{Z}from"./bf-948-188.js";import"./bf-275-83.js";import"./bf-822-108.js";import"./bf-123-109.js";import"./bf-25-81.js";import"./bf-438-114.js";function H({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{H as default};
