1import{bF as L,bE as k,r as y,c4 as b,ab as e,ag as a,c5 as C,aW as d,ak as I,ai as q,aD as E,ac as R,b0 as S}from"./index-DlR9XQMx.js";import{q as v}from"./base-4H36LQbU.js";import{S as F}from"./startCase-CIx6llsV.js";import{L as M}from"./LoginPortal-CjOU4gUU.js";import{V as P,W as T,X as W,L as _,G as z}from"./Alert-DWARVRZR.js";import{P as G,a as K}from"./constants-DRnCUy1h.js";import"./toString-BYJ8hO-r.js";import"./isObjectLike-DsN_jqiI.js";import"./upperFirst-CBLTjA4e.js";import"./_baseSlice-DkFNCYmM.js";import"./cookiebot-kRpXFxAK.js";function f({icon:t,darkIcon:r}){const s=R().mode!=="light"?r??t:t;return s?e.jsx(S,{icon:e.jsx("img",{src:s,width:"48px",height:"48px"}),width:"64px",height:"64px",type:"floating"}):null}const O=t=>{const r=t.consent_challenge;return Array.isArray(r)?E.isEmpty(r)?"":r[0]??"":r??""};function D(){var x,u,h,j;const t=L(),r=k(),{data:o,loading:s}=P(),g=O(v.parse(t.search)),{data:i}=T({variables:{challenge:g}}),n=(x=i==null?void 0:i.oidcConsent)==null?void 0:x.repository,l=(u=i==null?void 0:i.oidcConsent)==null?void 0:u.consent,[A,{loading:w,error:m}]=W({variables:{challenge:g,scopes:(l==null?void 0:l.requestedScope)||["profile","openid"]},onCompleted:({oauthConsent:c})=>{c!=null&&c.redirectTo&&(window.location.href=c.redirectTo)}}),p=y.useCallback(()=>{b(),r("/login")},[r]);return!i||s?e.jsx(_,{}):((h=o==null?void 0:o.me)!=null&&h.email||p(),e.jsx(M,{children:e.jsxs(a,{direction:"column",align:"center",gap:"xlarge",children:[e.jsxs(a,{direction:"row",gap:"large",children:[e.jsx(f,{icon:K,darkIcon:G}),n&&e.jsxs(e.Fragment,{children:[e.jsx(C,{size:18}),e.jsx(f,{icon:n.icon,darkIcon:n.darkIcon})]})]}),e.jsxs(a,{direction:"column",align:"center",gap:"xsmall",paddingTop:"medium",children:[e.jsx(d,{title1:!0,size:"medium",textAlign:"center",children:n!=null&&n.name?`${F(n.name)} requires access`:"Access required"}),e.jsx(d,{body1:!0,color:"text-light",textAlign:"center",children:'Click "Allow" below to allow access to your profile.'})]}),e.jsxs(a,{gap:"small",width:"100%",direction:"column",align:"center",children:[m&&e.jsx(z,{error:m,header:"Consent request failed"}),e.jsx(I,{width:"100%",loading:w,onClick:()=>A(),children:"Allow"}),e.jsxs(d,{caption:!0,color:"text-xlight",textAlign:"center",children:["You are currently signed in as ",(j=o==null?void 0:o.me)==null?void 0:j.email,". ",e.jsx(q,{inline:!0,onClick:p,children:"Wrong account?"})]})]})]})}))}export{D as OAuthConsent};
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.