var _=Object.defineProperty;var x=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var j=(i,a,n)=>a in i?_(i,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[a]=n,p=(i,a)=>{for(var n in a||(a={}))k.call(a,n)&&j(i,n,a[n]);if(x)for(var n of x(a))I.call(a,n)&&j(i,n,a[n]);return i};import{k as $,f as R,_ as e,j as t}from"./main.2.8.10.js";import{b as C}from"./react-router.DMwpH23k.js";import{B as T}from"./BackIcn.BFDZx8No.js";import{a2 as f,y as E,a9 as F}from"./Note.DalStCGz.js";import{b as L}from"./ConstantContactCommonFunc.Dr0pZhTL.js";import{T as B}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function J({constantContactConf:i,setConstantContactConf:a,step:n,setstep:y,isLoading:m,setIsLoading:N,setSnackbar:o,redirectLocation:v,isInfo:s}){const b=$(R),[r,S]=C.useState(!1),[l,h]=C.useState({dataCenter:"",clientId:"",clientSecret:""}),z="account_read account_update contact_data offline_access campaign_data",A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),y(2)},c=d=>{const g=p({},i),u=p({},l);u[d.target.name]="",g[d.target.name]=d.target.value,h(u),a(g)},w=`
  <h4>${e("Step of get API Key(Client Id) And Client Secret:","bit-integrations")}</h4>
  <ul>
    <li>${e("Goto","bit-integrations")} <a href="https://app.constantcontact.com/pages/dma/portal/?_ga=2.91540634.1868552181.1667660766-5cc88792-fd06-40a8-9b8c-e27659667215">${e("Constant Contact Application","bit-integrations")}</a></li>
    <li>${e("Then create a new application.","bit-integrations")}</li>
    <li>${e("Select  <b>(Authorization Code Flow and Implicit Flow)</b> and <b>(Rotating Refresh Tokens or Long Lived Refresh Tokens).</b>","bit-integrations")}</li>
    <li>${e("Copy the <b>Authorized Redirect URIs</b> from here and paste it into the Constant Contact application form.","bit-integrations")}</li> 
    <li>${e("Then generate <b>Client Secret</b> from the Constant Contact application","bit-integrations")}</li>
    <li>${e("Copy the <b>Client Id</b> and <b>Client Secret</b> from Constant Contact application and paste into this authorization form.","bit-integrations")}</li>
    <li>${e("Finally, click <b>Authorize</b> button.","bit-integrations")}</li>
</ul>
`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:n===1&&900,height:n===1&&"auto"},children:[t.jsx(B,{linkKey:"constantContact"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:i.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Homepage URL:","bit-integrations")})}),t.jsx(f,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:s,setSnackbar:o}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Authorized Redirect URIs:","bit-integrations")})}),t.jsx(f,{value:v||`${b.api}/redirect`,setSnackbar:o,className:"field-key-cpy w-6 ml-0",readOnly:s}),t.jsxs("small",{className:"d-blk mt-5",children:[e("To get Client ID and SECRET , Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.constantcontact.com/pages/dma/portal/?_ga=2.91540634.1868552181.1667660766-5cc88792-fd06-40a8-9b8c-e27659667215",target:"_blank",rel:"noreferrer",children:e("Constant Contact Application","bit-integrations")})]}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Client id:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientId",value:i.clientId,type:"text",placeholder:e("client ID...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.clientId}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Client secret:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientSecret",value:i.clientSecret,type:"text",placeholder:e("client Secret...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.clientSecret}),!s&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>L("constantContact","cContact",z,i,a,h,S,N,o,b),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||m.auth,children:[r?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),m.auth&&t.jsx(E,{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:!r,children:[e("Next","bit-integrations"),t.jsx(T,{className:"ml-1 rev-icn"})]})]}),t.jsx(F,{note:w})]})}export{J as default};
