var k=Object.defineProperty;var p=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var c=(s,t,e)=>t in s?k(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,u=(s,t)=>{for(var e in t||(t={}))w.call(t,e)&&c(s,e,t[e]);if(p)for(var e of p(t))y.call(t,e)&&c(s,e,t[e]);return s};import{D as C,g as _,r as i,j as a,S as E,_ as d}from"./main-634.js";import{a7 as z}from"./bf-746-82.js";import{I as A}from"./bf-942-184.js";import{h as f,c as D}from"./bf-630-181.js";import{M as P}from"./bf-128-225.js";import"./bf-275-83.js";import"./bf-822-108.js";import"./bf-25-81.js";import"./bf-438-114.js";function Q({formFields:s,setIntegration:t,integrations:e,allIntegURL:h}){const x=C(),{id:l,formID:g}=_(),[r,n]=i.useState(u({},e[l])),[j,I]=i.useState(!1),[S,o]=i.useState({show:!1}),[b,L]=i.useState(!1),[v,M]=i.useState({name:"",auth_token:""}),N=()=>{if(!D(r)){o({show:!0,msg:d("Please map mandatory fields")});return}z(e,t,h,r,x,l,1)};return a.jsxs("div",{style:{width:900},children:[a.jsx(E,{snack:S,setSnackbar:o}),a.jsxs("div",{className:"flx mt-3",children:[a.jsx("b",{className:"wdt-200 d-in-b",children:d("Integration Name:")}),a.jsx("input",{className:"btcd-paper-inp w-5",onChange:m=>f(m,r,n),name:"name",value:r.name,type:"text",placeholder:d("Integration Name...")})]}),a.jsx("br",{}),a.jsx(P,{formID:g,formFields:s,handleInput:m=>f(m,r,n),mailerLiteConf:r,setMailerLiteConf:n,isLoading:j,setIsLoading:I,setSnackbar:o,isAuthorized:b,setisAuthorized:L,error:v,setError:M}),a.jsx(A,{edit:!0,saveConfig:N,disabled:r.field_map.length<1}),a.jsx("br",{})]})}export{Q as default};
