var T=Object.defineProperty,f=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var y=(t,e,i)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,p=(t,e)=>{for(var i in e||(e={}))N.call(e,i)&&y(t,i,e[i]);if(I)for(var i of I(e))R.call(e,i)&&y(t,i,e[i]);return t},h=(t,e)=>f(t,L(e));var j=(t,e,i)=>new Promise((d,_)=>{var n=r=>{try{u(i.next(r))}catch(b){_(b)}},c=r=>{try{u(i.throw(r))}catch(b){_(b)}},u=r=>r.done?d(r.value):Promise.resolve(r.value).then(n,c);u((i=i.apply(t,e)).next())});import{h as z,r as S,j as a}from"./main-333.js";import{j as E,N as v}from"./bi.636.93.js";import{S as D,I as g,E as w,G,A as U}from"./bi.627.968.js";import{h as x,c as F,a as O}from"./bi.732.861.js";import{T as k,t as B}from"./bi.318.783.js";function Q({notionConf:t,setNotionConf:e,step:i,setStep:d,isInfo:_,loading:n,setLoading:c}){const u=z(E),[r,b]=S.useState(!1),[l,m]=S.useState({clientId:"",clientSecret:""}),{notion:s}=B,$=()=>j(this,null,function*(){setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),d(2),c(h(p({},n),{page:!0})),(yield O(t,e))&&c(h(p({},n),{page:!1}))}),A=`
  <h4>${__("Step of get Client Id & Client Secret","bit-integrations")}</h4>
  <ul>
    <li>${__("Goto","bit-integrations")}Goto <a href="https://www.notion.so/my-integrations" target='_blank'>My integrations.</a></li>
    <li>${__("Click new integration.","bit-integrations")}</li>
    <li>${__("Name to identify your integration to users.","bit-integrations")}</li>
    <li>${__("<b>User Capabilities</b> always select read user information including email addresses","bit-integrations")}</li>
    <li><b>${__("Submit","bit-integrations")}</b></li>
    <li>${__("Select <b>Integration type</b> Public","bit-integrations")}</li>
    <li>${__("Fill up <b>OAuth Domain & URIs</b> information","bit-integrations")}</li>
    <li>${__("Homepage & Redirect URIs copy from Integration Settings","bit-integrations")}</li>
    <li>${__("Finally, click <b>Authorize</b> button.","bit-integrations")}</li>
</ul>
`;return a.jsxs(D,{step:i,stepNo:1,style:{width:900,height:"auto"},children:[(s==null?void 0:s.youTubeLink)&&a.jsx(k,{title:"Notion",youTubeLink:s==null?void 0:s.youTubeLink}),(s==null?void 0:s.docLink)&&a.jsx(k,{title:"Notion",docLink:s==null?void 0:s.docLink}),a.jsxs("div",{className:"mt-2",children:[a.jsx(g,{label:__("Integration Name","bit-integrations"),name:"name",placeholder:__("Integration Name...","bit-integrations"),value:t.name,onchange:o=>x(o,t,e,l,m)}),a.jsx(g,{label:"Homepage",copytext:window.location.origin,setToast:!0}),a.jsx(g,{label:"Redirect URIs",copytext:`${u.api.base}/redirect`,setToast:!0}),a.jsx(g,{label:__("OAuth client ID","bit-integrations"),name:"clientId",placeholder:__("client ID...","bit-integrations"),value:t.clientId,onchange:o=>x(o,t,e,l,m)}),a.jsx(w,{error:l.clientId}),a.jsx(g,{label:__("OAuth client secret","bit-integrations"),name:"clientSecret",placeholder:__("client Secret...","bit-integrations"),value:t.clientSecret,onchange:o=>x(o,t,e,l,m)}),a.jsx(w,{error:l.clientSecret}),a.jsx(G,{url:"https://www.notion.so/my-integrations",info:__("Notion My integrations, please visit","bit-integrations")}),!_&&a.jsx(U,{onclick:()=>F(t,e,l,m,b,n,c),nextPage:$,auth:r,loading:n.auth})]}),a.jsx(v,{note:A})]})}export{Q as default};
