var C=Object.defineProperty;var g=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var p=(n,e,s)=>e in n?C(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,l=(n,e)=>{for(var s in e||(e={}))k.call(e,s)&&p(n,s,e[s]);if(g)for(var s of g(e))E.call(e,s)&&p(n,s,e[s]);return n};import{j as t,_ as i,s as F,b as L}from"./main.2.8.10.js";import{b as o}from"./react-router.DMwpH23k.js";import{y as M}from"./Note.DalStCGz.js";import{B as _}from"./BackIcn.BFDZx8No.js";import{T as P}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function J({formID:n,autonamiConf:e,setAutonamiConf:s,step:m,nextPage:f,setSnackbar:x,isInfo:u}){const[r,j]=o.useState(!1),[N,A]=o.useState({integrationName:""}),[y,S]=o.useState(!1),[c,d]=o.useState(!1),[v,z]=o.useState(!0);o.useEffect(()=>()=>{z(!1)},[]);const I=()=>{d("auth"),L({},"autonami_authorize").then(a=>{v&&(a!=null&&a.success&&(j(!0),x({show:!0,msg:i("Connect Successfully","bit-integrations")})),S(!0),d(!1))})},w=a=>{const h=l({},e),b=l({},N);b[a.target.name]="",h[a.target.name]=a.target.value,A(b),s(h)};return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"auto"},children:[t.jsx(P,{linkKey:"autonami"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-5 mt-1",onChange:w,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:u}),y&&!r&&!c&&t.jsxs("div",{className:"flx mt-4",style:{color:"red"},children:[t.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),F(i("Please! First Install or Active %s Plugin","bit-integrations"),"Autonami Pro")]}),!u&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:I,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||c,children:[r?i("Connected ✔","bit-integrations"):i("Connect to Autonami","bit-integrations"),c&&t.jsx(M,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>f(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[i("Next","bit-integrations"),t.jsx(_,{className:"ml-1 rev-icn"})]})]})]})})}export{J as default};
