var I=Object.defineProperty;var N=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var y=(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={}))S.call(t,i)&&y(n,i,t[i]);if(N)for(var i of N(t))E.call(t,i)&&y(n,i,t[i]);return n};import{j as e,_ as s}from"./main.2.8.1.js";import{d as v}from"./react-router-dom.9mCuUg3q.js";import{B as C}from"./BackIcn._kGL_vVw.js";import{a2 as f,z as L}from"./Note.BeM7sN-p.js";import{e as R,r as M}from"./MailChimpCommonFunc.IPjUKaax.js";import{t as _}from"./tutorialLinks.kMkIDzcD.js";import{T as w}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function q({formID:n,mailChimpConf:t,setMailChimpConf:i,step:h,setstep:k,isLoading:u,setIsLoading:x,setSnackbar:l,redirectLocation:z,isInfo:r}){const[c,T]=v.useState(!1),[o,b]=v.useState({dataCenter:"",clientId:"",clientSecret:""}),{mailchimp:a}=_,A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),k(2),M(i,x,l)},d=m=>{const g=p({},t),j=p({},o);j[m.target.name]="",g[m.target.name]=m.target.value,b(j),i(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:h===1&&900,height:h===1&&"auto"},children:[e.jsx(w,{title:"Mail chimp",youTubeLink:a==null?void 0:a.youTubeLink}),e.jsx(w,{title:"Mail chimp",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(f,{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(f,{value:z||`${window.location.href}`,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://us7.admin.mailchimp.com/account/oauth2/",target:"_blank",rel:"noreferrer",children:s("Mail Chimp API Console","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:()=>R("mailChimp","mChimp",t,i,b,T,x,l),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||u,children:[c?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),u&&e.jsx(L,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:A,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[s("Next","bit-integrations"),e.jsx(C,{className:"ml-1 rev-icn"})]})]})]})}export{q as default};
