var T=Object.defineProperty;var b=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var k=(i,a,n)=>a in i?T(i,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[a]=n,m=(i,a)=>{for(var n in a||(a={}))z.call(a,n)&&k(i,n,a[n]);if(b)for(var n of b(a))_.call(a,n)&&k(i,n,a[n]);return i};import{r as j,j as t}from"./main-406.js";import{B as S}from"./bi.46.744.js";import{_ as s,L as f,N as w}from"./bi.394.85.js";import{i as E}from"./bi.995.772.js";import{T as h,t as I}from"./bi.150.760.js";function q({hubspotConf:i,setHubspotConf:a,step:n,setstep:y,isInfo:r,loading:l,setLoading:N}){const[c,v]=j.useState(!1),[d,g]=j.useState({name:"",api_key:""}),{hubspot:e}=I,u=o=>{const x=m({},i),p=m({},d);p[o.target.name]="",x[o.target.name]=o.target.value,g(p),a(x)},A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),y(2)},L=`
    <h4> Step of generating Access Token:</h4>
    <ul>
      <li>Login to your HubSpot account, click the <b>Settings</b> icon settings in the main navigation bar..</li>
      <li>In the left sidebar menu, navigate to <b>Integrations > Private App</b>.</li>
      <li>Give name and description and select all necessary scope.</li>
      <li>Then create Access token.</li>
  </ul>
  `;return t.jsxs("div",{className:"btcd-stp-page",style:{width:n===1&&900,height:n===1&&"auto"},children:[(e==null?void 0:e.youTubeLink)&&t.jsx(h,{title:e==null?void 0:e.title,youTubeLink:e==null?void 0:e.youTubeLink}),(e==null?void 0:e.docLink)&&t.jsx(h,{title:e==null?void 0:e.title,docLink:e==null?void 0:e.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:u,name:"name",value:i==null?void 0:i.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Hubspot Access Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:u,name:"api_key",value:i.api_key,type:"text",placeholder:s("Access token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red"},children:d.api_key}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>E(i,g,v,l,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||l.auth,children:[c?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),l.auth&&t.jsx(f,{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(S,{className:"ml-1 rev-icn"})]})]}),t.jsx(w,{note:L})]})}export{q as default};
