var I=Object.defineProperty;var g=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var h=(t,a,s)=>a in t?I(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s,m=(t,a)=>{for(var s in a||(a={}))T.call(a,s)&&h(t,s,a[s]);if(g)for(var s of g(a))_.call(a,s)&&h(t,s,a[s]);return t};import{k as R,f as C,j as e,_ as i}from"./main.2.9.0.js";import{b as v}from"./react-router.DMwpH23k.js";import{a2 as N,y as $}from"./Note.NSUdvR3c.js";import{d as z}from"./ZohoSheetCommonFunc.D6FDE5kv.js";import{T as D}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function Z({zohoSheetConf:t,setZohoSheetConf:a,step:s,setStep:y,loading:c,setLoading:w,isInfo:n,setSnackbar:p,redirectLocation:k}){const[d,A]=v.useState(!1),[r,x]=v.useState({dataCenter:"",clientId:"",clientSecret:""}),b=R(C),E=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),t!=null&&t.default,y(2)},l=o=>{const u=m({},t),j=m({},r);j[o.target.name]="",u[o.target.name]=o.target.value,x(j),a(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[e.jsx(D,{linkKey:"zohoSheet"}),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:l,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:l,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:r.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(N,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:p}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(N,{value:k||`${b.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:p}),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:l,name:"clientId",value:t.clientId,type:"text",placeholder:i("client ID...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:r.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:l,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:i("client Secret...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:r.clientSecret}),e.jsx("br",{}),e.jsx("br",{}),!n&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>z(t,a,x,A,c,w,b),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:d||c.auth,children:[d?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),c.auth&&e.jsx($,{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:!d,children:[i("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{Z as default};
