var v=Object.defineProperty;var x=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var h=(e,a,s)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,d=(e,a)=>{for(var s in a||(a={}))A.call(a,s)&&h(e,s,a[s]);if(x)for(var s of x(a))y.call(a,s)&&h(e,s,a[s]);return e};import{j as t,_ as r}from"./main.2.9.0.js";import{b as j}from"./react-router.DMwpH23k.js";import{y as z}from"./Note.NSUdvR3c.js";import{k as I}from"./InsightlyCommonFunc.BeOl4a9-.js";import{T}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function Y({insightlyConf:e,setInsightlyConf:a,step:s,setStep:g,loading:n,setLoading:k,isInfo:i}){const[l,N]=j.useState(!1),[o,p]=j.useState({api_key:"",api_url:""}),_=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,g(2)},c=m=>{const b=d({},e),u=d({},o);u[m.target.name]="",b[m.target.name]=m.target.value,p(u),a(b)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[t.jsx(T,{linkKey:"insightly"}),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:c,name:"name",value:e.name,type:"text",placeholder:r("Integration Name...","bit-integrations"),disabled:i}),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:c,name:"api_url",value:e.api_url,type:"text",placeholder:r("Your Organisation...","bit-integrations"),disabled:i}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.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:c,name:"api_key",value:e.api_key,type:"text",placeholder:r("API Token...","bit-integrations"),disabled:i}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.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",{}),!i&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>I(e,a,p,N,n,k),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||n.auth,children:[l?r("Authorized ✔","bit-integrations"):r("Authorize","bit-integrations"),n.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:_,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[r("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{Y as default};
