import{h as l,$ as b,g as I,k as _,i as w,j as t,_ as n}from"./main.2.9.0.js";import{u as C,e as F,b as r}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as E,I as v,s as y}from"./Integrations.DL8wqGct.js";import{h as d,c}from"./EmailOctopusCommonFunc.6LiASHxA.js";import{E as N}from"./EmailOctopusIntegLayout.BlMClJ6k.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.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};
