import{b as c,$ as h,h as j,k as b,i as _,j as t,_ as r}from"./main.2.8.1.js";import{u as I,h as w,d as l}from"./react-router-dom.9mCuUg3q.js";import{S as C}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S,I as v,s as y}from"./Integrations.D2bgBas2.js";import{h as p,c as F}from"./MauticCommonFunc.9NjHUbhi.js";import{M}from"./MauticIntegLayout.DuI_oxIF.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function H({allIntegURL:f}){const g=I(),{id:N}=w(),[i,k]=c(h),[e,a]=c(j),[m,n]=l.useState(!1),[u,s]=l.useState({show:!1}),d=b(_),x=()=>{if(!F(e)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}y({flow:i,allIntegURL:f,conf:e,navigate:g,edit:1,setIsLoading:n,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{snack:u,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:r("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>p(o,e,a),name:"name",value:e.name,type:"text",placeholder:r("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:d,handleInput:o=>p(o,e,a,n,s),mauticConf:e,setMauticConf:a,isLoading:m,setIsLoading:n,setSnackbar:s}),t.jsx(v,{edit:!0,saveConfig:x,disabled:e.field_map.length<1,isLoading:m,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{H as default};
