var C=Object.defineProperty;var N=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var y=(n,t,a)=>t in n?C(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,h=(n,t)=>{for(var a in t||(t={}))S.call(t,a)&&y(n,a,t[a]);if(N)for(var a of N(t))I.call(t,a)&&y(n,a,t[a]);return n};import{k as L,g as _,j as e,_ as i}from"./main.2.8.1.js";import{d as E}from"./react-router-dom.9mCuUg3q.js";import{B as P}from"./BackIcn._kGL_vVw.js";import{a2 as A,z as U}from"./Note.BeM7sN-p.js";import{k as Z}from"./Integrations.D2bgBas2.js";import{b as $}from"./ZohoDeskCommonFunc.gpETZq5N.js";import{t as B}from"./tutorialLinks.kMkIDzcD.js";import{T as D}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";import"./SnackMsg.S8DrwLlT.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function Y({formID:n,deskConf:t,setDeskConf:a,step:p,setstep:z,isLoading:b,setIsLoading:x,setSnackbar:l,redirectLocation:T,isInfo:s}){const[d,w]=E.useState(!1),[c,u]=E.useState({dataCenter:"",clientId:"",clientSecret:""}),R="Desk.settings.READ,Desk.basic.READ,Desk.search.READ,Desk.contacts.READ,Desk.contacts.CREATE,Desk.contacts.UPDATE,Desk.tickets.CREATE,Desk.tickets.UPDATE",g=L(_),{zohoDesk:r}=B,k=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),z(2),$(n,t,a,x,l)},o=m=>{const j=h({},t),v=h({},c);v[m.target.name]="",j[m.target.name]=m.target.value,u(v),a(j)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:p===1&&900,height:p===1&&"auto"},children:[e.jsx(D,{title:"Zoho Desk",youTubeLink:r==null?void 0:r.youTubeLink}),e.jsx(D,{title:"Zoho Desk",docLink:r==null?void 0:r.docLink}),e.jsx("div",{className:"wdt-200 d-in-b mt-3",children:e.jsx("b",{children:i("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:i("Integration Name...","bit-integrations"),disabled:s}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Data Center:","bit-integrations")})}),e.jsxs("select",{onChange:o,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:s,children:[e.jsx("option",{value:"",children:i("--Select a data center--","bit-integrations")}),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"},children:c.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(A,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",setSnackbar:l,readOnly:s}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(A,{value:T||`${g.api}/redirect`,className:"field-key-cpy w-6 ml-0",setSnackbar:l,readOnly:s}),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:o,name:"clientId",value:t.clientId,type:"text",placeholder:i("client ID...","bit-integrations"),disabled:s}),e.jsx("div",{style:{color:"red"},children:c.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:o,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:i("client Secret...","bit-integrations"),disabled:s}),e.jsx("div",{style:{color:"red"},children:c.clientSecret}),!s&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>Z("zohoDesk","zbigin",R,t,a,u,w,x,l,g),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:d||b,children:[d?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),b&&e.jsx(U,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:k,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!d,children:[i("Next","bit-integrations"),e.jsx(P,{className:"ml-1 rev-icn"})]})]})]})}export{Y as default};
