import{h as l,$ as b,g as I,k as _,i as w,j as t,_ as n}from"./main.2.8.10.js";import{u as C,e as F,b as r}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as E,I as v,s as y}from"./Integrations.BFhED4ck.js";import{h as d,c}from"./EmailOctopusCommonFunc.Hi4e18bk.js";import{E as N}from"./EmailOctopusIntegLayout.BVXLzG56.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function K({allIntegURL:p}){const f=C(),{id:k}=F(),[i,O]=l(b),[s,a]=l(I),[u,L]=r.useState(!1),[g,x]=r.useState({auth:!1,tags:!1,customFields:!1,lists:!1,emailOctopusFields:!0}),[h,e]=r.useState({show:!1}),m=_(w),j=()=>{if(!c(s)){e({show:!0,msg:n("Please map mandatory fields","bit-integrations")});return}y({flow:i,allIntegURL:p,conf:s,navigate:f,edit:1,setSnackbar:e})};return t.jsxs("div",{style:{width:900},children:[t.jsx(S,{snack:h,setSnackbar:e}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:n("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>d(o,s,a),name:"name",value:s.name,type:"text",placeholder:n("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(E,{entity:i.triggered_entity,setSnackbar:e}),t.jsx(N,{formID:i.triggered_entity_id,formFields:m,handleInput:o=>d(o,s,a),emailOctopusConf:s,setEmailOctopusConf:a,loading:g,setLoading:x,setSnackbar:e}),t.jsx(v,{edit:!0,saveConfig:j,disabled:!c(s),isLoading:u,dataConf:s,setDataConf:a,formFields:m}),t.jsx("br",{})]})}export{K as default};
