import{h as l,$ as h,g as j,k as S,i as b,j as t,_ as o}from"./main.2.9.0.js";import{u as y,e as _,b as p}from"./react-router.DMwpH23k.js";import{S as I}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as w,I as C,s as v}from"./Integrations.DL8wqGct.js";import{h as c,S as F,c as N}from"./SendyIntegLayout.BnIesieI.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./CustomFieldKey.iFz21-av.js";function J({allIntegURL:f}){const g=y(),{id:k}=_(),[n,E]=l(h),[e,a]=l(j),[r,d]=p.useState(!1),[x,s]=p.useState({show:!1}),m=S(b),u=()=>{if(!N(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}v({flow:n,allIntegURL:f,conf:e,navigate:g,edit:1,setIsLoading:d,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(I,{snack:x,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:i=>c(i,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(w,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(F,{formID:n.triggered_entity_id,formFields:m,handleInput:i=>c(i,e,a),sendyConf:e,setSendyConf:a,isLoading:r,setIsLoading:d,setSnackbar:s}),t.jsx(C,{edit:!0,saveConfig:u,disabled:e.field_map.length<1,isLoading:r,dataConf:e,setDataConf:a,formFields:m}),t.jsx("br",{})]})}export{J as default};
