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