import{h as m,$ as j,g as b,k as I,i as _,j as t,_ as o}from"./main.2.9.0.js";import{u as w,b as r}from"./react-router.DMwpH23k.js";import{S as C}from"./SnackMsg.DYSD96P4.js";import{S,I as y,s as F}from"./Integrations.DL8wqGct.js";import{h as d,c as v}from"./MailsterCommonFunc.D7GbuWNW.js";import{M}from"./MailsterIntegLayout.tsrlTuUk.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function H({allIntegURL:f}){const c=w(),[i,N]=m(j),[e,a]=m(b),[p,k]=r.useState(!1),[g,u]=r.useState({auth:!1,fields:!1,lists:!1,tags:!1}),[x,s]=r.useState({show:!1}),l=I(_),h=()=>{if(!v(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}F({flow:i,allIntegURL:f,conf:e,navigate:c,edit:1,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{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:n=>d(n,e,a),name:"name",defaultValue:e.name||"",type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(S,{entity:i.triggered_entity,setSnackbar:s}),t.jsx(M,{formID:i.triggered_entity_id,formFields:l,handleInput:n=>d(n,e,a),mailsterConf:e,setMailsterConf:a,loading:g,setLoading:u,setSnackbar:s}),t.jsx(y,{edit:!0,saveConfig:h,isLoading:p,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{H as default};
