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