var f=Object.defineProperty;var y=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var k=(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={}))L.call(e,i)&&k(a,i,e[i]);if(y)for(var i of y(e))I.call(e,i)&&k(a,i,e[i]);return a};import{k as O,g as R,j as t,_ as s}from"./main.2.8.1.js";import{d as A}from"./react-router-dom.9mCuUg3q.js";import{a2 as v,z as E}from"./Note.BeM7sN-p.js";import{b as C,g as P}from"./OneDriveCommonFunc.Cm_dWfyv.js";import{t as $}from"./tutorialLinks.kMkIDzcD.js";import{T as w}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function J({flowID:a,oneDriveConf:e,setOneDriveConf:i,step:p,setStep:z,isLoading:b,setIsLoading:h,setSnackbar:x,redirectLocation:S,isInfo:r}){const[l,_]=A.useState(!1),[c,u]=A.useState({clientId:"",clientSecret:""}),g=O(R),{oneDrive:n}=$,T=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),P(a,e,i,h),z(2)},d=o=>{const j=m({},e),N=m({},c);N[o.target.name]="",j[o.target.name]=o.target.value,u(N),i(j)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:p===1&&900,height:p===1&&"auto"},children:[t.jsx(w,{title:"OneDrive",youTubeLink:n==null?void 0:n.youTubeLink}),t.jsx(w,{title:"OneDrive",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:d,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("Homepage URL:","bit-integrations")})}),t.jsx(v,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:x}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),t.jsx(v,{value:S||`${g.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:x}),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://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",target:"_blank",rel:"noreferrer",children:s("Azure Portal","bit-integrations")})]}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("OneDrive Client id:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,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("OneDrive Client Secret:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,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:()=>C(e,i,_,h,u,g),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||b,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),b&&t.jsx(E,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:T,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};
