var P=Object.defineProperty;var y=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var j=(a,t,s)=>t in a?P(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,m=(a,t)=>{for(var s in t||(t={}))v.call(t,s)&&j(a,s,t[s]);if(y)for(var s of y(t))$.call(t,s)&&j(a,s,t[s]);return a};import{k as S,f as G,j as e,_ as i}from"./main.2.9.0.js";import{b as N}from"./react-router.DMwpH23k.js";import{B as _}from"./BackIcn._8Wofmn2.js";import{y as H,a9 as z}from"./Note.NSUdvR3c.js";import{l as T}from"./HighLevelCommonFunc.d88tryba.js";import{T as D}from"./TutorialLink.CFG7bS5c.js";import{g as B}from"./ProUtilHelpers.CHf_DzPf.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function U({formID:a,highLevelConf:t,setHighLevelConf:s,step:b,setstep:I,isInfo:r,loading:l,setLoading:k}){const A=S(G),{isPro:p}=A,[c,w]=N.useState(!1),[o,u]=N.useState({name:"",api_key:""}),n=d=>{const g=m({},t),x=m({},o);x[d.target.name]="",g[d.target.name]=d.target.value,u(x),s(g)},h=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),I(2)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[e.jsx(D,{linkKey:"highLevel"}),e.jsx("div",{className:"mt-3 wdt-200",children:e.jsx("b",{children:i("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"name",value:t.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.name}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Select Version:")})}),e.jsxs("div",{className:"flex items-center w-6 mt-3",children:[e.jsx("input",{id:"MailerLiteClassic",type:"radio",name:"version",value:"v1",className:"hidden",checked:!(t!=null&&t.version)||(t==null?void 0:t.version)==="v1",onChange:n}),e.jsxs("label",{for:"MailerLiteClassic",children:[e.jsx("span",{className:"w-4 h-4 inline-block mr-1 border border-grey"}),"HighLevel API V1"]})]}),e.jsxs("div",{className:"flex items-center mr-4 mt-2 mb-4",children:[e.jsx("input",{id:"MailerLiteNew",type:"radio",name:"version",value:"v2",className:"hidden",checked:(t==null?void 0:t.version)==="v2",onChange:n,disabled:!p}),e.jsxs("label",{for:"MailerLiteNew",children:[e.jsx("span",{className:"w-4 h-4 inline-block mr-1 border border-grey"}),p?"HighLevel API V2":B("HighLevel API V2")]})]}),(t==null?void 0:t.version)==="v2"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-3 wdt-250",children:e.jsx("b",{children:i("Location ID:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"location_id",value:t.location_id,type:"text",placeholder:i("Location ID...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.location_id}),e.jsx("small",{className:"d-blk mt-1",children:i("To get location id, go to Settings > Business Profile and copy the location id from General Information.","bit-integrations")})]}),e.jsx("div",{className:"mt-3 wdt-250",children:e.jsx("b",{children:i("GoHighLevel Api Key:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"api_key",value:t.api_key,type:"text",placeholder:i("GoHighLevel Api Key...","bit-integrations"),disabled:r}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.api_key}),e.jsx("small",{className:"d-blk mt-3",children:!(t!=null&&t.version)||(t==null?void 0:t.version)==="v1"?i("To get API key, go to Settings > Business Profile and copy the API Key from there.","bit-integrations"):i("To get API key, go to Settings > Private Integration and create new integration and copy the API token.","bit-integrations")}),e.jsx("br",{}),!r&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>T(t,s,u,w,l,k),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||l.auth,children:[c?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),l.auth&&e.jsx(H,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:()=>h(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[i("Next","bit-integrations"),e.jsx(_,{className:"ml-1 rev-icn"})]})]}),e.jsx(z,{note:E(t==null?void 0:t.version)})]})}const E=a=>a!=="v2"?`
            <h4>${i("Get GoHighLevel Api Key","bit-integrations")}</h4>
            <ul>
                <li>${i("First go to your GoHighLevel sub account settings then business profile tab","bit-integrations")}.</li>
                <li>${i("Copy the the API key.","bit-integrations")}</li>
                <li>${i("You can also get the API key from Agency view. Navigate to settings then API keys tab.","bit-integrations")}</li>
            </ul>`:`
            <h4>${i("Get GoHighLevel Location ID","bit-integrations")}</h4>
            <ul>
                <li>${i("From the Sub-Account Dashboard, go to Settings in lower right-hand corner","bit-integrations")}.</li>
                <li>${i("Select Business Profile on the left-side navigation bar.","bit-integrations")}</li>
                <li>${i("The Location ID will be visible as shown in General Information.","bit-integrations")}</li>
                <li>${i("Copy the location ID.","bit-integrations")}</li>
            </ul>
            <h4>${i("Get GoHighLevel Api Key","bit-integrations")}</h4>
            <ul>
                <li>${i("First go to your GoHighLevel sub account settings then Private Integration tab","bit-integrations")}.</li>
                <li>${i('Click on "Create new Integration"',"bit-integrations")}</li>
                <li>${i("Give your Private Integration a name and description to help you and your team identify what it's for.","bit-integrations")}</li>
                <li>${i("Select the scopes/permissions that you want the private integration to have access to on your agency  account. Ensure that you are selecting only the required scopes for better data security.","bit-integrations")}</li>
                <li>${i("Copy the token generated.","bit-integrations")}</li>
            </ul>`;export{U as default};
