import{h as p,g as w,$ as I,k as S,i as v,j as t,_ as o}from"./main.2.8.10.js";import{u as _,e as N,b as m}from"./react-router.DMwpH23k.js";import{S as k}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as y,I as F,s as E}from"./Integrations.BFhED4ck.js";import{M as $}from"./MailMintIntegLayout.Zy7FcURX.js";import{h as l,c as L}from"./MailMintCommonFunc.CzGK4b_2.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function O({allIntegURL:u}){const g=_(),{formID:x}=N(),[e,a]=p(w),[c,P]=p(I),d=S(v),[r,n]=m.useState(!1),[f,s]=m.useState({show:!1}),[h,b]=m.useState((e==null?void 0:e.name)||""),j=()=>{if(!L(e)){s({show:!0,msg:o("Please map all required fields to continue.","bit-integrations")});return}if(!(e!=null&&e.name)){s({show:!0,msg:o("Please integrations name is required.","bit-integrations")});return}E({flow:c,allIntegURL:u,conf:e,navigate:g,edit:1,setIsLoading:n,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(k,{snack:f,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:i=>{b(i.target.value),l(i,e,a,n)},name:"name",value:h,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),t.jsx(y,{entity:c.triggered_entity,setSnackbar:s}),t.jsx($,{formID:x,formFields:d,handleInput:i=>l(i,e,a,n),mailMintConf:e,setMailMintConf:a,isLoading:r,setIsLoading:n,setSnackbar:s}),t.jsx(F,{edit:!0,saveConfig:j,disabled:!(e!=null&&e.mainAction)||!(e!=null&&e.name)||r,isLoading:r,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{O as default};
