import{b as m,$ as w,h as j,k as b,i as I,j as t,_ as i}from"./main.2.8.1.js";import{u as N,d as r}from"./react-router-dom.9mCuUg3q.js";import{S as _}from"./SnackMsg.S8DrwLlT.js";import{S as C,I as S,s as y}from"./Integrations.D2bgBas2.js";import{h as l,c as F}from"./NewsletterCommonFunc.DTsaB5B-.js";import{N as v}from"./NewsletterIntegLayout.CWiO9JUA.js";import"./Note.BeM7sN-p.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function G({allIntegURL:c}){const f=N(),[n,k]=m(w),[e,a]=m(j),[p,E]=r.useState(!1),[g,u]=r.useState({auth:!1}),[x,s]=r.useState({show:!1}),d=b(I),h=()=>{if(!F(e)){s({show:!0,msg:i("Please map mandatory fields","bit-integrations")});return}y({flow:n,allIntegURL:c,conf:e,navigate:f,edit:1,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(_,{snack:x,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:i("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>l(o,e,a),name:"name",defaultValue:e.name||"",type:"text",placeholder:i("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(C,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(v,{formID:n.triggered_entity_id,formFields:d,handleInput:o=>l(o,e,a),newsletterConf:e,setNewsletterConf:a,loading:g,setLoading:u,setSnackbar:s}),t.jsx(S,{edit:!0,saveConfig:h,isLoading:p,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{G as default};
