var S=Object.defineProperty;var N=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var y=(n,t,r)=>t in n?S(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,h=(n,t)=>{for(var r in t||(t={}))L.call(t,r)&&y(n,r,t[r]);if(N)for(var r of N(t))Z.call(t,r)&&y(n,r,t[r]);return n};import{k as I,g as _,j as e,_ as i}from"./main.2.8.1.js";import{d as z}from"./react-router-dom.9mCuUg3q.js";import{a2 as k,z as D}from"./Note.BeM7sN-p.js";import{r as P}from"./ZohoCampaignsCommonFunc.D_VFP2u1.js";import{B as $}from"./BackIcn._kGL_vVw.js";import{k as B}from"./Integrations.D2bgBas2.js";import{t as U}from"./tutorialLinks.kMkIDzcD.js";import{T as w}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,campaignsConf:t,setCampaignsConf:r,step:p,setstep:A,isLoading:x,setIsLoading:u,setSnackbar:l,redirectLocation:E,isInfo:s}){const[d,T]=z.useState(!1),[o,b]=z.useState({dataCenter:"",clientId:"",clientSecret:""}),j=I(_),C="ZohoCampaigns.contact.READ,ZohoCampaigns.contact.CREATE,ZohoCampaigns.contact.UPDATE",{zohoCampaigns:a}=U,R=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),A(2),P(n,t,r,u,l)},c=m=>{const g=h({},t),v=h({},o);v[m.target.name]="",g[m.target.name]=m.target.value,b(v),r(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:p===1&&900,height:p===1&&"auto"},children:[e.jsx(w,{title:"Zoho Campaigns",youTubeLink:a==null?void 0:a.youTubeLink}),e.jsx(w,{title:"Zoho Campaigns",docLink:a==null?void 0:a.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:s}),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: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:o.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(k,{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(k,{value:E||`${j.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:c,name:"clientId",value:t.clientId,type:"text",placeholder:i("client ID...","bit-integrations"),disabled:s}),e.jsx("div",{style:{color:"red"},children:o.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:s}),e.jsx("div",{style:{color:"red"},children:o.clientSecret}),!s&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>B("zohoCampaigns","zcampaigns",C,t,r,b,T,u,l,j),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:d||x,children:[d?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),x&&e.jsx(D,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:R,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!d,children:[i("Next","bit-integrations"),e.jsx($,{className:"ml-1 rev-icn"})]})]})]})}export{Y as default};
