var y=Object.defineProperty;var f=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var h=(s,e,t)=>e in s?y(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,g=(s,e)=>{for(var t in e||(e={}))N.call(e,t)&&h(s,t,e[t]);if(f)for(var t of f(e))w.call(e,t)&&h(s,t,e[t]);return s};import{D as k,g as M,r,j as o,S as _,_ as d}from"./main-634.js";import{a7 as E}from"./bf-746-82.js";import{I as L}from"./bf-942-184.js";import{h as x,c as R}from"./bf-52-94.js";import{Z}from"./bf-723-190.js";import"./bf-275-83.js";import"./bf-822-108.js";import"./bf-25-81.js";import"./bf-297-103.js";import"./bf-824-186.js";import"./bf-438-114.js";function O({formFields:s,setIntegration:e,integrations:t,allIntegURL:j}){const I=k(),{id:c,formID:l}=M(),[a,i]=r.useState(g({},t[c])),[b,u]=r.useState(!1),[C,n]=r.useState({show:!1}),[m,S]=r.useState(0),v=()=>{if(!R(a)){n({show:!0,msg:d("Please map mandatory fields")});return}E(t,e,j,a,I,c,1)};return o.jsxs("div",{style:{width:900},children:[o.jsx(_,{snack:C,setSnackbar:n}),o.jsxs("div",{className:"flx mt-3",children:[o.jsx("b",{className:"wdt-100 d-in-b",children:d("Integration Name:")}),o.jsx("input",{className:"btcd-paper-inp w-7",onChange:p=>x(p,m,a,i),name:"name",value:a.name,type:"text",placeholder:d("Integration Name...")})]}),o.jsx(Z,{tab:m,settab:S,formID:l,formFields:s,handleInput:p=>x(p,m,a,i,l,u,n),crmConf:a,setCrmConf:i,isLoading:b,setisLoading:u,setSnackbar:n}),o.jsx(L,{edit:!0,saveConfig:v,disabled:a.module===""||a.layout===""||a.field_map.length<1}),o.jsx("br",{})]})}export{O as default};
