var T=Object.defineProperty;var N=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var y=(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={}))_.call(t,i)&&y(n,i,t[i]);if(N)for(var i of N(t))f.call(t,i)&&y(n,i,t[i]);return n};import{k as G,g as E,j as e,_ as s}from"./main.2.8.1.js";import{d as v}from"./react-router-dom.9mCuUg3q.js";import{a2 as k,z as R}from"./Note.BeM7sN-p.js";import{a as P,g as $}from"./GoogleCalendarCommonFunc.BXw6Q4e1.js";import{t as O}from"./tutorialLinks.kMkIDzcD.js";import{T as w}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function J({flowID:n,googleCalendarConf:t,setGoogleCalendarConf:i,step:b,setStep:S,isLoading:p,setIsLoading:z,setSnackbar:h,redirectLocation:A,isInfo:a}){const[l,I]=v.useState(!1),[c,x]=v.useState({clientId:"",clientSecret:""}),u=G(E),{googleCalendar:r}=O,L=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),$(n,t,i),S(2)},o=d=>{const j=m({},t),g=m({},c);g[d.target.name]="",j[d.target.name]=d.target.value,x(g),i(j)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[e.jsx(w,{title:"Google Calendar",youTubeLink:r==null?void 0:r.youTubeLink}),e.jsx(w,{title:"Google Calendar",docLink:r==null?void 0:r.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:a}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:","bit-integrations")})}),e.jsx(k,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:h}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(k,{value:A||`${u.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:h}),e.jsxs("small",{className:"d-blk mt-3",children:[s("To Get Client Id & Secret, Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://console.developers.google.com/apis/credentials",target:"_blank",rel:"noreferrer",children:s("Google API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("GoogleCalendar Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientId",value:t.clientId,type:"text",placeholder:s("client ID...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("GoogleCalendar Client Secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:s("client Secret...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red"},children:c.clientSecret}),!a&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>P(t,i,I,z,x,u),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&&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:[s("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{J as default};
