var v=Object.defineProperty;var h=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var g=(e,s,a)=>s in e?v(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,c=(e,s)=>{for(var a in s||(s={}))I.call(s,a)&&g(e,a,s[a]);if(h)for(var a of h(s))_.call(s,a)&&g(e,a,s[a]);return e};import{_ as i,j as t}from"./main.2.8.10.js";import{b as x}from"./react-router.DMwpH23k.js";import{y as E,a9 as T}from"./Note.DalStCGz.js";import{w as z}from"./WoodpeckerCommonFunc.Cux5XQUE.js";import{T as P}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function W({woodpeckerConf:e,setWoodpeckerConf:s,step:a,setStep:j,loading:n,setLoading:y,isInfo:r}){const[o,k]=x.useState(!1),[b,p]=x.useState({api_token:""}),N=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},m=l=>{const d=c({},e),u=c({},b);u[l.target.name]="",d[l.target.name]=l.target.value,p(u),s(d)},A=`
            <h4>${i("Get API Key","bit-integrations")}</h4>
            <ul>
                <li>${i("Log into your Woodpecker account on","bit-integrations")} <a className="btcd-link" href="https://app.woodpecker.co/panel" target="_blank">${i("app.woodpecker.co.","bit-integrations")}</a></li>
                <li>${i("Go to the <b>Marketplace</b> → <b>INTEGRATIONS</b> → <b>API keys</b>.","bit-integrations")}</li>
                <li>${i("Use the purple button to <b>CREATE A KEY</b>.","bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(P,{linkKey:"woodpecker"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"api_key",value:e.api_key,type:"text",placeholder:i("API Key...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:b.api_key}),t.jsxs("small",{className:"d-blk mt-3",children:[i("To get API key, please visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.woodpecker.co/panel?u=411340#marketplace/integrations/api-keys",target:"_blank",children:i("Woodpecker API Key","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>z(e,p,k,n,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||n.auth,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),n.auth&&t.jsx(E,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:N,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(T,{note:A})]})}export{W as default};
