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