var k=Object.defineProperty;var u=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var b=(a,e,s)=>e in a?k(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s,x=(a,e)=>{for(var s in e||(e={}))y.call(e,s)&&b(a,s,e[s]);if(u)for(var s of u(e))z.call(e,s)&&b(a,s,e[s]);return a};import{j as t,_ as i,d as T}from"./main.2.8.1.js";import{d as p}from"./react-router-dom.9mCuUg3q.js";import{B as _}from"./BackIcn._kGL_vVw.js";import{t as A}from"./tutorialLinks.kMkIDzcD.js";import{z as f}from"./Note.BeM7sN-p.js";import{T as I}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function R({formID:a,teamsForWcConf:e,setTeamsForWcConf:s,step:m,nextPage:j,isLoading:c,setIsLoading:l,setSnackbar:N}){const[o,g]=p.useState(!1),[d,v]=p.useState(!1),{teamsForWooCommerceMemberships:n}=A,C=()=>{l("auth"),T({},"teams_for_wc_memberships_authorize").then(r=>{r!=null&&r.success&&(g(!0),N({show:!0,msg:i("Connected with Teams for WooCommerce Memberships Successfully","bit-integrations")})),l(!1),v(!0)})},w=r=>{const h=x({},e);h[r.target.name]=r.target.value,s(h)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"auto"},children:[n==null?void 0:n.youTubeLink,t.jsx(I,{title:"Teams for WooCommerce Memberships",docLink:n==null?void 0:n.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:w,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),c==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(f,{size:25,clr:"#022217",className:"mr-2"}),i("Checking if Teams for WooCommerce Memberships is authorized!!!","bit-integrations")]}),d&&!o&&!c&&t.jsx("div",{className:"flx mt-5",style:{width:900,justifyContent:"center"},children:t.jsxs("div",{className:"txt-center",children:[t.jsx("div",{className:"btcd-icn btcd-icn-err",children:t.jsx("span",{children:"✕"})}),t.jsx("div",{className:"mt-2",children:i("Teams for WooCommerce Memberships is not activated or not installed","bit-integrations")})]})}),d&&o&&!c&&t.jsxs("div",{className:"flx mt-5",style:{width:900},children:[t.jsx("div",{className:"btcd-icn btcd-icn-success",children:t.jsx("span",{children:"✓"})}),t.jsx("div",{className:"mt-2",children:i("Teams for WooCommerce Memberships is activated","bit-integrations")})]}),t.jsxs("button",{onClick:C,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||c==="auth",children:[o?i("Connected","bit-integrations"):i("Connect","bit-integrations"),c==="auth"&&t.jsx(f,{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:!o,children:[i("Next","bit-integrations"),t.jsx(_,{className:"ml-1 rev-icn"})]})]})}export{R as default};
