import{j as t,_ as e,s as f,b as j}from"./main.2.9.0.js";import{b as m}from"./react-router.DMwpH23k.js";import{B as N}from"./BackIcn._8Wofmn2.js";import{y,x as v}from"./Note.NSUdvR3c.js";import{a as w,b as z}from"./MailMintCommonFunc.DiDjTfAt.js";import{T as A}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function D({formID:k,mailMintConf:a,setMailMintConf:r,step:o,setStep:h,isLoading:l,setIsLoading:i,setSnackbar:p}){const[n,u]=m.useState(!1),[b,d]=m.useState(!1),g=()=>{i("auth"),j({},"mailmint_authorize").then(s=>{s!=null&&s.success&&(u(!0),p({show:!0,msg:e("Connected with Mail Mint Successfully","bit-integrations")})),i(!1),d(!0),w(a,r,i),z(a,r,i)})},x=s=>{const c=v(a);c[s.target.name]=s.target.value,r(c)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:o===1&&900,height:o===1&&"auto"},children:[t.jsx(A,{linkKey:"mailMint"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:x,name:"name",value:a.name,type:"text",placeholder:e("Integration Name...","bit-integrations")}),l==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(y,{size:25,clr:"#022217",className:"mr-2"}),e("Checking if Mail Mint is active!!!","bit-integrations")]}),b&&!n&&!l&&t.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[t.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),f(e("%s plugin must be activated to integrate with Bit Integrations","bit-integrations"),"Mail Mint")]}),!n&&t.jsx("button",{onClick:g,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:e("Connect","bit-integrations")}),n&&t.jsxs("button",{onClick:()=>h(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!n,children:[e("Next","bit-integrations"),t.jsx(N,{className:"ml-1 rev-icn"})]})]})}export{D as default};
