var C=Object.defineProperty;var x=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var p=(i,e,s)=>e in i?C(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,u=(i,e)=>{for(var s in e||(e={}))F.call(e,s)&&p(i,s,e[s]);if(x)for(var s of x(e))T.call(e,s)&&p(i,s,e[s]);return i};import{r as o,j as t}from"./main-333.js";import{_ as r,L as E,b as M}from"./bi.636.93.js";import{B as _}from"./bi.429.767.js";import{T as f,t as P}from"./bi.318.783.js";function G({formID:i,autonamiConf:e,setAutonamiConf:s,step:d,nextPage:j,setSnackbar:N,isInfo:m}){const[c,A]=o.useState(!1),[L,k]=o.useState({integrationName:""}),[y,S]=o.useState(!1),{autonami:n}=P,[l,h]=o.useState(!1),[v,z]=o.useState(!0);o.useEffect(()=>()=>{z(!1)},[]);const I=()=>{h("auth"),M({},"autonami_authorize").then(a=>{v&&(a!=null&&a.success&&(A(!0),N({show:!0,msg:r("Connect Successfully","bit-integrations")})),S(!0),h(!1))})},w=a=>{const b=u({},e),g=u({},L);g[a.target.name]="",b[a.target.name]=a.target.value,k(g),s(b)};return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"btcd-stp-page",style:{width:d===1&&900,height:d===1&&"auto"},children:[(n==null?void 0:n.youTubeLink)&&t.jsx(f,{title:"FunnelKit (Autonami)",youTubeLink:n==null?void 0:n.youTubeLink}),(n==null?void 0:n.docLink)&&t.jsx(f,{title:"FunnelKit (Autonami)",docLink:n==null?void 0:n.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:r("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:r("Integration Name...","bit-integrations"),disabled:m}),y&&!c&&!l&&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:"×"}),"Please! First Install or Active Autonami Pro Plugin"]}),!m&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:I,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||l,children:[c?r("Connected ✔","bit-integrations"):r("Connect to Autonami","bit-integrations"),l&&t.jsx(E,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>j(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[r("Next","bit-integrations"),t.jsx(_,{className:"ml-1 rev-icn"})]})]})]})})}export{G as default};
