var T=Object.defineProperty;var g=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var j=(n,t,i)=>t in n?T(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,m=(n,t)=>{for(var i in t||(t={}))z.call(t,i)&&j(n,i,t[i]);if(g)for(var i of g(t))_.call(t,i)&&j(n,i,t[i]);return n};import{r as N,h as f,j as e}from"./main-333.js";import{j as E,_ as a,X as P,L as R}from"./bi.636.93.js";import{a as D,g as F}from"./bi.973.867.js";import{T as y,t as $}from"./bi.318.783.js";function X({flowID:n,pCloudConf:t,setPCloudConf:i,step:b,setStep:k,isLoading:h,setIsLoading:v,setSnackbar:I,redirectLocation:S,isInfo:r}){const[l,w]=N.useState(!1),[c,x]=N.useState({clientId:"",clientSecret:""}),A=f(E),{pCloud:s}=$,L=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),F(t,i,"fetch"),k(2)},d=o=>{const p=m({},t),u=m({},c);u[o.target.name]="",p[o.target.name]=o.target.value,x(u),i(p)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[(s==null?void 0:s.youTubeLink)&&e.jsx(y,{title:"pCloud",youTubeLink:s==null?void 0:s.youTubeLink}),(s==null?void 0:s.docLink)&&e.jsx(y,{title:"pCloud",docLink:s==null?void 0:s.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations"),disabled:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(P,{value:S||`${A.api.base}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:I}),e.jsxs("small",{className:"d-blk mt-3",children:[a("To Get Client Id & Secret, Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://docs.pcloud.com/my_apps/",target:"_blank",rel:"noreferrer",children:a("pCloud API apps","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("PCloud Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:t.clientId,type:"text",placeholder:a("client ID...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("PCloud Client Secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:a("client Secret...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red"},children:c.clientSecret}),!r&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>D(t,i,w,v,x),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||h,children:[l?a("Authorized ✔","bit-integrations"):a("Authorize","bit-integrations"),h&&e.jsx(R,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:L,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[a("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{X as default};
