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