var f=Object.defineProperty,I=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var x=(i,t,a)=>t in i?f(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,m=(i,t)=>{for(var a in t||(t={}))P.call(t,a)&&x(i,a,t[a]);if(g)for(var a of g(t))z.call(t,a)&&x(i,a,t[a]);return i},p=(i,t)=>I(i,K(t));import{j as e,_ as s,s as E}from"./main.2.9.0.js";import{b as y}from"./react-router.DMwpH23k.js";import{y as S,a9 as T}from"./Note.NSUdvR3c.js";import{a as _,f as w}from"./FabmanCommonFunc.B7Fqgi78.js";import{T as $}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";const L={width:900,height:"auto"};function D({fabmanConf:i,setFabmanConf:t,step:a,setStep:j,loading:n,setLoading:d,isInfo:r}){const[l,N]=y.useState(!1),[k,b]=y.useState({name:"",apiKey:""}),v=()=>{w(i,t,n,d,"fetch"),setTimeout(()=>{const o=document.getElementById("btcd-settings-wrp");o&&(o.scrollTop=0)},300),j(2)},u=o=>{const{name:h,value:A}=o.target;t(c=>p(m({},c),{[h]:A})),b(c=>p(m({},c),{[h]:""}))};return e.jsxs("div",{className:"btcd-stp-page",style:a===1?L:void 0,children:[e.jsx($,{linkKey:"fabman"}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:u,name:"name",value:i.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("API Key:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:u,name:"apiKey",value:i.apiKey,type:"text",placeholder:s("Your API Key","bit-integrations"),disabled:r}),e.jsx("div",{className:"mt-3",style:{color:"red",fontSize:"15px"},children:k.apiKey}),!r&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>_(i,t,b,N,n,d),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||n.auth,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),n.auth&&e.jsx(S,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsxs("button",{onClick:v,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[s("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),e.jsx(T,{note:W})]})}const W=`<h2>${s("To get your Fabman API key:","bit-integrations")}</h2>
     <ul>
         <li>${E(s("Log in to your %s.","bit-integrations"),'<a href="https://fabman.io/" target="_blank">Fabman account</a>')}</li>
         <li>${s('Go to "Configure" → "Integrations (API & Webhooks)".',"bit-integrations")}</li>
         <li>${s('Click "Create API key", add a title, and choose a member.',"bit-integrations")}</li>
         <li>${s('Save, then click "Reveal" to copy your API key.',"bit-integrations")}</li>
     </ul>`;export{D as default};
