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