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