var _=Object.defineProperty;var N=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var y=(n,t,i)=>t in n?_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,h=(n,t)=>{for(var i in t||(t={}))z.call(t,i)&&y(n,i,t[i]);if(N)for(var i of N(t))I.call(t,i)&&y(n,i,t[i]);return n};import{r as k,h as Z,j as e}from"./main-406.js";import{k as $,_ as a,X as w,Y as B,L as P}from"./bi.394.85.js";import{B as D}from"./bi.46.744.js";import{d as O}from"./bi.718.727.js";import{T as L,t as U}from"./bi.150.760.js";function q({formID:n,recruitConf:t,setRecruitConf:i,step:p,setstep:T,isLoading:b,setIsLoading:x,setSnackbar:r,redirectLocation:A,isInfo:l}){const[c,C]=k.useState(!1),[d,j]=k.useState({dataCenter:"",clientId:"",clientSecret:""}),g=Z($),E="ZohoRecruit.users.ALL,ZohoRecruit.modules.all",{zohoRecruit:s}=U,S=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),T(2),O(n,t,i,x,r)},o=m=>{const u=h({},t),v=h({},d);v[m.target.name]="",u[m.target.name]=m.target.value,j(v),i(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:p===1&&900,height:p===1&&"auto"},children:[(s==null?void 0:s.youTubeLink)&&e.jsx(L,{title:s==null?void 0:s.title,youTubeLink:s==null?void 0:s.youTubeLink}),(s==null?void 0:s.docLink)&&e.jsx(L,{title:s==null?void 0:s.title,docLink:s==null?void 0:s.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("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:a("Integration Name...","bit-integrations"),disabled:l}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Data Center:","bit-integrations")})}),e.jsxs("select",{onChange:o,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:l,children:[e.jsx("option",{value:"",children:a("--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:d.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Homepage URL:","bit-integrations")})}),e.jsx(w,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",setSnackbar:r,readOnly:l}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(w,{value:A||`${g.api.base}/redirect`,className:"field-key-cpy w-6 ml-0",setSnackbar:r,readOnly:l}),e.jsxs("small",{className:"d-blk mt-5",children:[a("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:a("Zoho API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("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:a("Client id...","bit-integrations"),disabled:l}),e.jsx("div",{style:{color:"red"},children:d.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("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:a("Client secret...","bit-integrations"),disabled:l}),e.jsx("div",{style:{color:"red"},children:d.clientSecret}),!l&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>B("zohoRecruit","zrecruit",E,t,i,j,C,x,r,g),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||b,children:[c?a("Authorized ✔","bit-integrations"):a("Authorize","bit-integrations"),b&&e.jsx(P,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:S,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[a("Next","bit-integrations"),e.jsx(D,{className:"ml-1 rev-icn"})]})]})]})}export{q as default};
