var w=Object.defineProperty;var x=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var b=(i,e,s)=>e in i?w(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,p=(i,e)=>{for(var s in e||(e={}))z.call(e,s)&&b(i,s,e[s]);if(x)for(var s of x(e))A.call(e,s)&&b(i,s,e[s]);return i};import{j as t,_ as a,b as _}from"./main.2.9.0.js";import{b as f}from"./react-router.DMwpH23k.js";import{B as k}from"./BackIcn._8Wofmn2.js";import{y as j}from"./Note.NSUdvR3c.js";import{T as U}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function K({ultimateAffiliateProConf:i,setUltimateAffiliateProConf:e,step:s,nextPage:m,isLoading:c,setIsLoading:o,setSnackbar:d,isInfo:l}){const[r,N]=f.useState(!1),[h,g]=f.useState(!1),v=()=>{l||typeof o!="function"||typeof d!="function"||(o("auth"),_({},"ultimate_affiliate_pro_authorize").then(n=>{n!=null&&n.success&&(N(!0),d({show:!0,msg:a("Connected with Ultimate Affiliate Pro Successfully","bit-integrations")})),o(!1),g(!0)}))},y=n=>{if(l||typeof e!="function")return;const u=p({},i);u[n.target.name]=n.target.value,e(u)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[t.jsx(U,{linkKey:"ultimateAffiliatePro"}),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:y,name:"name",value:(i==null?void 0:i.name)||"",type:"text",disabled:l,placeholder:a("Integration Name...","bit-integrations")}),c==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(j,{size:25,clr:"#022217",className:"mr-2"}),a("Checking if Ultimate Affiliate Pro is authorized...","bit-integrations")]}),h&&!r&&!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:a("Ultimate Affiliate Pro is not activated or not installed","bit-integrations")})]})}),h&&r&&!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:a("Ultimate Affiliate Pro is activated","bit-integrations")})]}),!l&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:v,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||c==="auth",children:[r?a("Connected","bit-integrations"):a("Connect to Ultimate Affiliate Pro","bit-integrations"),c==="auth"&&t.jsx(j,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>m(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r||typeof m!="function",children:[a("Next","bit-integrations"),t.jsx(k,{className:"ml-1 rev-icn"})]})]})]})}export{K as default};
