var I=Object.defineProperty;var N=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var v=(n,t,i)=>t in n?I(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,p=(n,t)=>{for(var i in t||(t={}))k.call(t,i)&&v(n,i,t[i]);if(N)for(var i of N(t))C.call(t,i)&&v(n,i,t[i]);return n};import{k as L,g as R,j as e,_ as s}from"./main.2.8.1.js";import{d as f}from"./react-router-dom.9mCuUg3q.js";import{B as _}from"./BackIcn._kGL_vVw.js";import{a2 as z,z as B}from"./Note.BeM7sN-p.js";import{b as D,r as $}from"./KeapCommonFunc.C16_4m6J.js";import{t as F}from"./tutorialLinks.kMkIDzcD.js";import{T as w}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function M({formID:n,keapConf:t,setKeapConf:i,step:b,setstep:S,isLoading:x,setIsLoading:h,setSnackbar:l,redirectLocation:T,isInfo:r}){const[c,A]=f.useState(!1),[o,u]=f.useState({clientId:"",clientSecret:""}),g=L(R),{keap:a}=F,d=m=>{const j=p({},t),y=p({},o);y[m.target.name]="",j[m.target.name]=m.target.value,u(y),i(j)},E=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),$(t,i,h,l),S(2)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[e.jsx(w,{title:"Keap",youTubeLink:a==null?void 0:a.youTubeLink}),e.jsx(w,{title:"Keap",docLink:a==null?void 0:a.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:","bit-integrations")})}),e.jsx(z,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:l}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(z,{value:T||`${g.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:l}),e.jsxs("small",{className:"d-blk mt-5",children:[s("To get Client ID and SECRET , Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://keys.developer.keap.com/my-apps",target:"_blank",rel:"noreferrer",children:s("Get Keap client id and secret","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:t.clientId,type:"text",placeholder:s("client ID...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Client secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:s("client Secret...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.clientSecret}),!r&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>D(t,i,u,A,h,l,g),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&&e.jsx(B,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:()=>E(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[s("Next","bit-integrations"),e.jsx(_,{className:"ml-1 rev-icn"})]})]})]})}export{M as default};
