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