var I=Object.defineProperty;var h=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var v=(t,a,s)=>a in t?I(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s,p=(t,a)=>{for(var s in a||(a={}))_.call(a,s)&&v(t,s,a[s]);if(h)for(var s of h(a))R.call(a,s)&&v(t,s,a[s]);return t};import{k as C,g as $,j as e,_ as i}from"./main.2.8.1.js";import{d as N}from"./react-router-dom.9mCuUg3q.js";import{a2 as y,z as D}from"./Note.BeM7sN-p.js";import{d as P}from"./ZohoSheetCommonFunc.Mi59-eT_.js";import{t as Z}from"./tutorialLinks.kMkIDzcD.js";import{T as k}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function G({zohoSheetConf:t,setZohoSheetConf:a,step:s,setStep:w,loading:d,setLoading:T,isInfo:n,setSnackbar:x,redirectLocation:A}){const[o,L]=N.useState(!1),[l,b]=N.useState({dataCenter:"",clientId:"",clientSecret:""}),u=C($),{zohoSheet:r}=Z,E=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),t!=null&&t.default,w(2)},c=m=>{const j=p({},t),g=p({},l);g[m.target.name]="",j[m.target.name]=m.target.value,b(g),a(j)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[e.jsx(k,{title:"Zoho Sheet",youTubeLink:r==null?void 0:r.youTubeLink}),e.jsx(k,{title:"Zoho Sheet",docLink:r==null?void 0:r.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:t.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Data Center:","bit-integrations")})}),e.jsxs("select",{onChange:c,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:n,children:[e.jsx("option",{value:"",children:i("Select a data center")}),e.jsx("option",{value:"com",children:"zoho.com"}),e.jsx("option",{value:"eu",children:"zoho.eu"}),e.jsx("option",{value:"com.cn",children:"zoho.com.cn"}),e.jsx("option",{value:"in",children:"zoho.in"}),e.jsx("option",{value:"com.au",children:"zoho.com.au"})]}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(y,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:x}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(y,{value:A||`${u.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:x}),e.jsxs("small",{className:"d-blk mt-5",children:[i("To get Client ID and SECRET , Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:`https://api-console.zoho.${(t==null?void 0:t.dataCenter)||"com"}/`,target:"_blank",rel:"noreferrer",children:i("Zoho API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientId",value:t.clientId,type:"text",placeholder:i("client ID...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Client secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:i("client Secret...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.clientSecret}),e.jsx("br",{}),e.jsx("br",{}),!n&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>P(t,a,b,L,d,T,u),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||d.auth,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),d.auth&&e.jsx(D,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:E,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{G as default};
