var k=Object.defineProperty;var b=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var g=(i,e,s)=>e in i?k(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,c=(i,e)=>{for(var s in e||(e={}))w.call(e,s)&&g(i,s,e[s]);if(b)for(var s of b(e))M.call(e,s)&&g(i,s,e[s]);return i};import{j as t,_ as a,b as _}from"./main.2.9.0.js";import{b as l}from"./react-router.DMwpH23k.js";import{y as p}from"./Note.NSUdvR3c.js";import{B as C}from"./BackIcn._8Wofmn2.js";import{T as E}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function q({formID:i,mailPoetConf:e,setMailPoetConf:s,step:m,nextPage:x,setSnackbar:f,isInfo:j}){const[r,N]=l.useState(!1),[z,y]=l.useState({integrationName:""}),[A,v]=l.useState(!1),[o,d]=l.useState(!1),S=()=>{d("auth"),_({},"mail_poet_authorize").then(n=>{n!=null&&n.success&&(N(!0),f({show:!0,msg:a("Authorized Successfully","bit-integrations")})),v(!0),d(!1)})},I=n=>{const h=c({},e),u=c({},z);u[n.target.name]="",h[n.target.name]=n.target.value,y(u),s(h)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"auto"},children:[t.jsx(E,{linkKey:"mailPoet"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:I,name:"name",value:e.name,type:"text",placeholder:a("Integration Name...","bit-integrations"),disabled:j}),o==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(p,{size:25,clr:"#022217",className:"mr-2"}),a("Checking if MailPoet is active!!!","bit-integrations")]}),A&&!r&&!o&&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:"×"}),a("Please! First Install Mailpoet Plugins","bit-integrations")]}),t.jsxs("button",{onClick:S,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||o,children:[r?a("Authorized ✔","bit-integrations"):a("Authorize","bit-integrations"),o&&t.jsx(p,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>x(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[a("Next","bit-integrations"),t.jsx(C,{className:"ml-1 rev-icn"})]})]})}export{q as default};
