var I=Object.defineProperty;var h=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var j=(e,a,s)=>a in e?I(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,p=(e,a)=>{for(var s in a||(a={}))T.call(a,s)&&j(e,s,a[s]);if(h)for(var s of h(a))z.call(a,s)&&j(e,s,a[s]);return e};import{j as t,_ as r}from"./main.2.8.1.js";import{d as k}from"./react-router-dom.9mCuUg3q.js";import{z as L}from"./Note.BeM7sN-p.js";import{k as w}from"./InsightlyCommonFunc.CrkcORCF.js";import{T as g}from"./TutorialLink.BAFX--T3.js";import{t as y}from"./tutorialLinks.kMkIDzcD.js";import"./CopyIcn.3gZpHton.js";function G({insightlyConf:e,setInsightlyConf:a,step:s,setStep:N,loading:l,setLoading:_,isInfo:n}){const[o,v]=k.useState(!1),[c,b]=k.useState({api_key:"",api_url:""}),{insightly:i}=y,A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,N(2)},d=m=>{const u=p({},e),x=p({},c);x[m.target.name]="",u[m.target.name]=m.target.value,b(x),a(u)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[t.jsx(g,{title:"Insightly",youTubeLink:i==null?void 0:i.youTubeLink}),t.jsx(g,{title:"Insightly",docLink:i==null?void 0:i.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:r("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:e.name,type:"text",placeholder:r("Integration Name...","bit-integrations"),disabled:n}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:r("Your API URL:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"api_url",value:e.api_url,type:"text",placeholder:r("Your Organisation...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.api_url}),t.jsx("small",{className:"d-blk mt-3",children:r("Example: {name}.insightly.com","bit-integrations")}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:r("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"api_key",value:e.api_key,type:"text",placeholder:r("API Token...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.api_key}),e.api_url&&t.jsxs("small",{className:"d-blk mt-3",children:[r("To Get API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:`https://crm.${e.api_url}/Users/UserSettings#`,target:"_blank",rel:"noreferrer",children:r("Insightly API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!n&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>w(e,a,b,v,l,_),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||l.auth,children:[o?r("Authorized ✔","bit-integrations"):r("Authorize","bit-integrations"),l.auth&&t.jsx(L,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:A,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[r("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{G as default};
