var f=Object.defineProperty;var u=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var x=(a,i,n)=>i in a?f(a,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[i]=n,c=(a,i)=>{for(var n in i||(i={}))T.call(i,n)&&x(a,n,i[n]);if(u)for(var n of u(i))v.call(i,n)&&x(a,n,i[n]);return a};import{_ as e,j as t}from"./main.2.8.10.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as z,a9 as I}from"./Note.DalStCGz.js";import{a as P}from"./OmniSendCommonFunc.C9bUO03G.js";import{T as _}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function F({omniSendConf:a,setOmniSendConf:i,step:n,setstep:k,loading:s,setLoading:j,setSnackbar:w,isInfo:r}){const[o,y]=g.useState(!1),[m,b]=g.useState({name:"",api_key:""}),N=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),k(2)},d=l=>{const p=c({},a),h=c({},m);h[l.target.name]="",p[l.target.name]=l.target.value,b(h),i(p)},A=`
    <h4>${e("Step of generate API token:","bit-integrations")}</h4>
    <ul>
      <li>${e("Goto","bit-integrations")} <a href="https://app.omnisend.com/o/my-account/integrations/api-keys">${e("Generate API Token","bit-integrations")}</a></li>
      <li>${e("Copy the <b>Token</b> and paste into <b>API Token</b> field of your authorization form.","bit-integrations")}</li>
      <li>${e("Finally, click <b>Authorize</b> button.","bit-integrations")}</li>
  </ul>
  `;return t.jsxs("div",{className:"btcd-stp-page",style:{width:n===1&&900,height:n===1&&"auto"},children:[t.jsx(_,{linkKey:"omniSend"}),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:d,name:"name",value:a.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("API Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"api_key",value:a.api_key,type:"text",placeholder:e("API Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:m.api_key}),t.jsxs("small",{className:"d-blk mt-3",children:[e("To Get API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.omnisend.com/o/my-account/integrations/api-keys",target:"_blank",rel:"noreferrer",children:e("OmniSend API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>P(a,i,b,y,s,j),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||s.auth,children:[o?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),s.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:N,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[e("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(I,{note:A})]})}export{F as default};
