var I=Object.defineProperty;var N=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var y=(n,e,i)=>e in n?I(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,p=(n,e)=>{for(var i in e||(e={}))S.call(e,i)&&y(n,i,e[i]);if(N)for(var i of N(e))T.call(e,i)&&y(n,i,e[i]);return n};import{j as t,_ as s}from"./main.2.8.1.js";import{d as v}from"./react-router-dom.9mCuUg3q.js";import{B as L}from"./BackIcn._kGL_vVw.js";import{a2 as E,z as B}from"./Note.BeM7sN-p.js";import{d as C,f as R}from"./MailupCommonFunc.BFSnhSMw.js";import{t as U}from"./tutorialLinks.kMkIDzcD.js";import{T as z}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function H({formID:n,mailupConf:e,setMailupConf:i,step:h,setStep:f,isLoading:x,setIsLoading:b,setSnackbar:l,redirectLocation:w,isInfo:a}){const[c,k]=v.useState(!1),[o,u]=v.useState({dataCenter:"",clientId:""}),{mailup:r}=U,A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),f(2),R(e,i,b,l)},d=m=>{const g=p({},e),j=p({},o);j[m.target.name]="",g[m.target.name]=m.target.value,u(j),i(g)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:h===1&&900,height:h===1&&"auto"},children:[t.jsx(z,{title:"MailUp",youTubeLink:r==null?void 0:r.youTubeLink}),t.jsx(z,{title:"MailUp",docLink:r==null?void 0:r.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:a}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),t.jsx(E,{value:w||`${window.location.href}`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:l}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Client id:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:e.clientId,type:"text",placeholder:s("client ID...","bit-integrations"),disabled:a}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.clientId}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Client secret:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:e.clientSecret,type:"text",placeholder:s("client Secret...","bit-integrations"),disabled:a}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.clientSecret}),!a&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>C("mailup",e,i,u,k,b,l),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||x,children:[c?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),x&&t.jsx(B,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:A,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[s("Next","bit-integrations"),t.jsx(L,{className:"ml-1 rev-icn"})]})]})]})}export{H as default};
