1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2334],{42334:function(e,s,t){t.r(s);var a=t(85893),i=t(61121),l=t(30080),n=t(39715),c=t(5152),r=t.n(c),o=t(67294);let p=r()(()=>t.e(7290).then(t.bind(t,97290)),{loadableGenerated:{webpack:()=>[97290]},ssr:!1});s.default=()=>{let[e,s]=(0,o.useState)(),t=JSON.parse(window.localStorage.getItem("user")||"{}");return(0,o.useEffect)(()=>{(async function(){let e="Token "+t.accessToken;try{let t=await fetch("https://api-staging.cometlabs.in/api/getUserRepos",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8",Authorization:e}});if(t.ok){let e=(await t.json()).repos;s(e)}}catch(e){}})()}),(0,a.jsxs)("div",{style:{marginTop:"-40px",width:"424px"},children:[(0,a.jsx)("p",{className:"mb2",children:"Connect with a Git provider to import an existing project from a Git Repository."}),t?(0,a.jsxs)("div",{className:"flex mb3 justify-between pointer",onClick:()=>{window.open("https://github.com/login/oauth/authorize?client_id=e07b9a9e6d2763621b8e&scope=repo,user:email&state=".concat(t.accessToken))},children:[(0,a.jsxs)("div",{className:"flex spacing2",children:[(0,a.jsx)(n.pZu,{className:"cgp"}),(0,a.jsx)("p",{children:"Connect Github"})]}),(0,a.jsxs)("div",{className:"flex spacing2",children:[(0,a.jsx)("p",{children:t.username}),(0,a.jsx)(l.xg7,{className:"cgp"})]})]}):(0,a.jsx)("p",{children:"Connect to Github"}),e&&e.length>0&&(0,a.jsx)(u,{repositories:e,user:t})]})};let u=e=>{let{repositories:s,user:t}=e,l=(s&&[...new Map(s.map(e=>[e.owner.login,e])).values()]).map(e=>{let{owner:s}=e;return s}).map(e=>{let{login:s}=e;return s}),[n,c]=(0,o.useState)(l[0]),[r,u]=(0,o.useState)(s),h=e=>{u(s.filter(s=>s.full_name.toLowerCase().includes(e.toLowerCase())))};return(0,a.jsxs)("div",{className:"column spacing1",children:[(0,a.jsx)("p",{className:"wt-bold",children:"Import Git Repositories"}),(0,a.jsx)("div",{className:"flex justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"",className:"base16 black-shade-6",children:"Github Account"}),(0,a.jsx)("select",{className:"input input-big base16 r12 bg-black-shade-3 w-full mt1",style:{maxWidth:"200px"},defaultValue:n,onChange:e=>{c(e.target.value),h(e.target.value)},ref:null,children:l.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsx)(i.Goc,{})]})}),(0,a.jsx)(p,{repositories:r,user:t})]})}}}]); 2//# sourceMappingURL=2334.555534ebc162b44c.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.