ryco-cli 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +2 -2
- package/dist/bin.mjs +2 -2
- package/dist/client/assets/{AccountSettings-Cey-16wq.js → AccountSettings-CkFq28pN.js} +1 -1
- package/dist/client/assets/AiFocusSettings-BI9AgQUi.js +1 -0
- package/dist/client/assets/BranchToolbar.logic-6LRTxcuo.js +1 -0
- package/dist/client/assets/ChatRightPanel-BSNsAFtv.js +27 -0
- package/dist/client/assets/{ChatThreadRouteView-tEo-zoCf.js → ChatThreadRouteView-Daox0F74.js} +1 -1
- package/dist/client/assets/CommandPaletteDialog-CIZnwgK9.js +1 -0
- package/dist/client/assets/{ConnectionsSettings-B0-Hkwof.js → ConnectionsSettings-DFBNmvfL.js} +2 -2
- package/dist/client/assets/DiagnosticsSettings-DhuLK993.js +2 -0
- package/dist/client/assets/{DraftChatThreadRouteView-BU2IGTR6.js → DraftChatThreadRouteView-BmVyawpM.js} +1 -1
- package/dist/client/assets/{HostedConnectionControls-Cux_sRCM.js → HostedConnectionControls-BvHq5iCa.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-CyySCdJV.js → HostedHubRoot-CB5TRXg5.js} +1 -1
- package/dist/client/assets/{HostedNativeAuthorizationRoute-490iDXmk.js → HostedNativeAuthorizationRoute-Cb5WJuEG.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-CcDOAwgS.js → HostedRelayTrustNotice-DFcgMZlL.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-BFTAvxtn.js → IntegrationsSettingsPanel-BIy-rKDv.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-VYgbhiZF.js → KeybindingsSettings-u3yB7Cob.js} +1 -1
- package/dist/client/assets/{McpServersSettings-DSDCjoTn.js → McpServersSettings-V32mLD4v.js} +2 -2
- package/dist/client/assets/{NewWorktreeDialog-C65Aifeb.js → NewWorktreeDialog-B64WGjQj.js} +2 -2
- package/dist/client/assets/{NoActiveThreadState-DehHNgAp.js → NoActiveThreadState-C0MwHtMx.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-DW9GJ-kU.js → NodeSecuritySettings-CWlThhfV.js} +1 -1
- package/dist/client/assets/OpinionatedPluginsSettings-CVzfv5nP.js +1 -0
- package/dist/client/assets/{PhoneGetAppInterstitial-CbyVrtDn.js → PhoneGetAppInterstitial-CylfsDBD.js} +1 -1
- package/dist/client/assets/{PhoneHome-c0j_TBEC.js → PhoneHome-DBwwEeaI.js} +1 -1
- package/dist/client/assets/{PhoneSettingsSurface-5LFRIx_5.js → PhoneSettingsSurface-sDCNEVkR.js} +1 -1
- package/dist/client/assets/{ProjectFavicon-CeVJCQCy.js → ProjectFavicon-BjXJxNbQ.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-MFRYAv_3.js → ProviderModelPicker-BTFj53Qv.js} +1 -1
- package/dist/client/assets/{ProvidersSettingsPanel-FYBEqSr_.js → ProvidersSettingsPanel-IhzMeM1F.js} +1 -1
- package/dist/client/assets/RootAppShell-CG06ruyc.js +6 -0
- package/dist/client/assets/{SettingsDialog-CpwoqGS8.js → SettingsDialog-ByR9PwEc.js} +1 -1
- package/dist/client/assets/{SettingsPanels-COWRB29-.js → SettingsPanels-CwsCgdds.js} +3 -3
- package/dist/client/assets/{SourceControlSettings-DvBNelcO.js → SourceControlSettings-5w4N9XII.js} +1 -1
- package/dist/client/assets/{StatisticsPage-DxAKqvVX.js → StatisticsPage-jRyjIh52.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-C0xGLlMA.js → StatisticsPanel-CV5eFeO_.js} +1 -1
- package/dist/client/assets/{ThreadStatusIndicators-CIOM98q2.js → ThreadStatusIndicators-C40TYVEC.js} +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-DRelLlEP.js → ThreadTerminalDrawer-flv5ZDel.js} +3 -3
- package/dist/client/assets/{ThreadWorkspacePanel-CktVSliZ.js → ThreadWorkspacePanel-B-cBAWFz.js} +6 -6
- package/dist/client/assets/{WorkItemsTab-CahU_t_S.js → WorkItemsTab-0DE4S4n0.js} +5 -5
- package/dist/client/assets/{branding-B7DcCXjn.js → branding-Ck4g7yv3.js} +1 -1
- package/dist/client/assets/{capabilities-B1FHGoov.js → capabilities-xa5Ll0KT.js} +1 -1
- package/dist/client/assets/{desktopUpdateAtoms-CPlZiFRm.js → desktopUpdateAtoms-hP0oc_If.js} +1 -1
- package/dist/client/assets/desktopWorkspace-hOxsGVFz.js +1 -0
- package/dist/client/assets/{device-CHdXzvhB.js → device-DIfzlguu.js} +1 -1
- package/dist/client/assets/{editorPreferences-B4GvqMiF.js → editorPreferences-B54y5_sx.js} +1 -1
- package/dist/client/assets/{index-Gre6bNC8.js → index-Dp3JRlOK.js} +1 -1
- package/dist/client/assets/main-B6n7O_N3.js +9 -0
- package/dist/client/assets/{projectPaths-D6fHIU1b.js → projectPaths-D8b4yLOe.js} +1 -1
- package/dist/client/assets/{providerIconUtils-DiDJeNtT.js → providerIconUtils-Cq0fezxt.js} +1 -1
- package/dist/client/assets/{runtime-CPM0EUhb.js → runtime-QZPKtH2P.js} +1 -1
- package/dist/client/assets/{session-logic-BalPN1Sc.js → session-logic-BuGYhZKZ.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-bhNsO9Z_.js → sidebarProjectFolders-Dlo6McCj.js} +2 -2
- package/dist/client/assets/storeSelectors-_h41wnN2.js +1 -0
- package/dist/client/assets/{threadPinning-BLqwZebi.js → threadPinning-D2e9MEDr.js} +1 -1
- package/dist/client/assets/{threadPriorityRefreshRuntime-BoNAlBXK.js → threadPriorityRefreshRuntime-DbEFchoL.js} +1 -1
- package/dist/client/assets/types-_h41wnN2.js +1 -0
- package/dist/client/assets/{useAtlassian-CoHKzu-e.js → useAtlassian-Zb2Kkt0_.js} +0 -0
- package/dist/client/assets/useHandleNewThread-ByVfL71G.js +1 -0
- package/dist/client/assets/{usePhoneThreadActions-BIDUSWSI.js → usePhoneThreadActions-BhTVcLtf.js} +1 -1
- package/dist/client/assets/{useStatistics-B91973jb.js → useStatistics-Dbp94K5j.js} +1 -1
- package/dist/client/assets/{useThreadActions-BCH01d6u.js → useThreadActions-CPL4dO-X.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AiFocusSettings-CaHQXDaQ.js +0 -1
- package/dist/client/assets/BranchToolbar.logic-DILAA3Cz.js +0 -1
- package/dist/client/assets/ChatRightPanel-D-AL07IU.js +0 -27
- package/dist/client/assets/CommandPaletteDialog-s7yf5Y2S.js +0 -1
- package/dist/client/assets/DiagnosticsSettings-DX5LH9Bt.js +0 -2
- package/dist/client/assets/OpinionatedPluginsSettings-DbxPOokL.js +0 -1
- package/dist/client/assets/RootAppShell-5HrP6N8H.js +0 -6
- package/dist/client/assets/desktopWorkspace-DEZ30LlY.js +0 -1
- package/dist/client/assets/main-Dz0zookE.js +0 -9
- package/dist/client/assets/storeSelectors-Cf2WDMfx.js +0 -1
- package/dist/client/assets/types-Cf2WDMfx.js +0 -1
- package/dist/client/assets/useHandleNewThread-Bw460iXT.js +0 -1
package/dist/bin.cjs
CHANGED
|
@@ -34110,7 +34110,7 @@ const scopedSafeTeardown = (label) => (effect$28) => effect.Effect.gen(function*
|
|
|
34110
34110
|
});
|
|
34111
34111
|
//#endregion
|
|
34112
34112
|
//#region package.json
|
|
34113
|
-
var version$1 = "0.1.
|
|
34113
|
+
var version$1 = "0.1.16";
|
|
34114
34114
|
//#endregion
|
|
34115
34115
|
//#region src/provider/Layers/CodexProvider.ts
|
|
34116
34116
|
const PROVIDER_PROBE_TIMEOUT_MS = 8e3;
|
|
@@ -86084,7 +86084,7 @@ function normalizeSpanStatus(record) {
|
|
|
86084
86084
|
function spanFailureMessage(record) {
|
|
86085
86085
|
if (record.type === "effect-span") {
|
|
86086
86086
|
const exit = record.exit;
|
|
86087
|
-
if (exit
|
|
86087
|
+
if (exit?._tag === "Failure") return truncateMessage(exit.cause);
|
|
86088
86088
|
return;
|
|
86089
86089
|
}
|
|
86090
86090
|
if (record.type === "otlp-span" && record.status?.message) return truncateMessage(record.status.message);
|
package/dist/bin.mjs
CHANGED
|
@@ -34085,7 +34085,7 @@ const scopedSafeTeardown = (label) => (effect) => Effect.gen(function* () {
|
|
|
34085
34085
|
});
|
|
34086
34086
|
//#endregion
|
|
34087
34087
|
//#region package.json
|
|
34088
|
-
var version$1 = "0.1.
|
|
34088
|
+
var version$1 = "0.1.16";
|
|
34089
34089
|
//#endregion
|
|
34090
34090
|
//#region src/provider/Layers/CodexProvider.ts
|
|
34091
34091
|
const PROVIDER_PROBE_TIMEOUT_MS = 8e3;
|
|
@@ -86059,7 +86059,7 @@ function normalizeSpanStatus(record) {
|
|
|
86059
86059
|
function spanFailureMessage(record) {
|
|
86060
86060
|
if (record.type === "effect-span") {
|
|
86061
86061
|
const exit = record.exit;
|
|
86062
|
-
if (exit
|
|
86062
|
+
if (exit?._tag === "Failure") return truncateMessage(exit.cause);
|
|
86063
86063
|
return;
|
|
86064
86064
|
}
|
|
86065
86065
|
if (record.type === "otlp-span" && record.status?.message) return truncateMessage(record.status.message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{F as r,M as i,N as a}from"./runtime-CPM0EUhb.js";import{It as o}from"./composerDraftStore-TYv9j3vY.js";import{_ as s,o as c}from"./authorization-D8lJzXTE.js";import{n as l}from"./loader-circle-CrtHFAvM.js";import{t as u}from"./copy-UQjKGt7t.js";import{t as d}from"./key-round-CacMputS.js";import{t as f}from"./refresh-cw-DopCMrtR.js";import{t as p}from"./shield-check-dQ-4cMKk.js";import{t as m}from"./trash-2-CM1zXPGb.js";import{t as h}from"./triangle-alert-RL_T3KLo.js";import{t as g}from"./user-round-Cpzx8pSw.js";import{n as _,t as v}from"./input-BZz4eLRl.js";import{u as y}from"./Icons-BEtED8P8.js";import{t as b}from"./button-DG8WqjNn.js";import{t as x}from"./useCopyToClipboard-BTpWxumf.js";import{i as S,n as C,r as w,t as T}from"./alert-DomE7dAt.js";import{a as E,c as D,i as ee,o as O,r as te,s as ne,t as k}from"./dialog-BNmFD6Nh.js";import{t as A}from"./spinner-ClQu8SdC.js";import{a as j,i as M,n as N,o as re,r as ie,s as ae,t as oe}from"./alert-dialog-9Jyh0e8u.js";import{t as P}from"./badge-w43sx8eF.js";import{t as se}from"./label-DZf4lbNF.js";import{C as F,S as I,_ as L,a as R,b as z,c as ce,d as le,f as B,g as V,h as H,i as U,l as W,m as G,n as K,o as q,p as ue,r as de,s as J,t as fe,u as pe,v as Y,x as X,y as me}from"./ExternalIdentityWeb.logic-Bn1HigS9.js";import{i as he,n as ge,r as _e}from"./settingsLayout-CHJT5wtl.js";import{t as ve}from"./qr-code-Ie92aZvE.js";var ye=n(),Z=e(t(),1),Q=o(),be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function xe(e){return e===null||!Number.isFinite(e)?null:be.format(new Date(e))}function Se(){let e=(0,ye.c)(15),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(0),[a,o]=(0,Z.useState)(``),[s,l]=(0,Z.useState)(!1),u=(0,Z.useRef)(0),d;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{n(null),i(0),o(``)},e[0]=d):d=e[0];let f=d,p;e[1]===t?.options?p=e[2]:(p=()=>{u.current+=1,c.cancelAccountAction(),t?.options?.onAbandoned?.(),l(!1),f()},e[1]=t?.options,e[2]=p);let m=p,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=async(e,t,r)=>{let a=u.current+=1;l(!1);let s=await t({});if(u.current===a){if(B(s)){o(``),i(0),n({action:e,run:t,options:r,inferred:s.inferredErrorCode===!0});return}s.status===`committed`&&r?.onCommitted?.()}},e[3]=h):h=e[3];let g=h,_;e[4]!==t||e[5]!==a||e[6]!==r?(_=async()=>{if(!t)return;let e=H(a);if(e.length===0)return;let n=u.current+=1,s=await t.run({totpCode:e});if(u.current===n){if(B(s)){let e=r+1;if(z(s,e)){i(e),o(``);return}l(!0),t.options?.onAbandoned?.(),f();return}s.status===`committed`&&t.options?.onCommitted?.(),f()}},e[4]=t,e[5]=a,e[6]=r,e[7]=_):_=e[7];let v=_,y;return e[8]!==m||e[9]!==t||e[10]!==a||e[11]!==r||e[12]!==s||e[13]!==v?(y={run:g,cancel:m,stepUp:t,stepUpAttempts:r,stepUpCode:a,stepUpUnresolved:s,setStepUpCode:o,submitStepUp:v},e[8]=m,e[9]=t,e[10]=a,e[11]=r,e[12]=s,e[13]=v,e[14]=y):y=e[14],y}function Ce(){let e=(0,ye.c)(1),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Z.useEffect)(we,t)}function we(){return c.leaseRecoveryCodeDisplay()}function $(e){let t=(0,ye.c)(3),{busy:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{className:`size-3.5`}),r]}):(0,Q.jsx)(Q.Fragment,{children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Te(){let e=(0,ye.c)(99),t=a(We),n=a(Ue),[o,c]=(0,Z.useState)(!1),l=i(He),u=i(Ve),d=i(Be),f=i(ze),m=i(Re),_=i(Le),v=i(Ie),y=i(Fe),x=a(Pe),E=a(Ne),[D,ee]=(0,Z.useState)(!1),[O,te]=(0,Z.useState)(null),ne=(0,Z.useRef)(!1),k=Se(),A=k.run;Ce();let j=_!==`idle`,M;e[0]===m?M=e[1]:(M=de(m),e[0]=m,e[1]=M);let N=M,re;e[2]===d?.externalIdentities?re=e[3]:(re=d?.externalIdentities.find(Me)??null,e[2]=d?.externalIdentities,e[3]=re);let ie=re,ae;e[4]===D?ae=e[5]:(ae=async()=>{if(!D){ee(!0),te(null);try{await fe({intent:`link`,returnTo:`/account/security`,start:je,navigate:Ae})}catch(e){let t=e;te(t instanceof s?t.message:`GitHub connection is temporarily unavailable.`),ee(!1)}}},e[4]=D,e[5]=ae);let oe=ae,P;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(P=[],e[6]=P):P=e[6],(0,Z.useEffect)(ke,P);let se,F;if(e[7]!==t||e[8]!==A?(se=()=>{if(t!==`authenticated`||ne.current)return;ne.current=!0;let e=new AbortController;return r.getPendingExternalIdentity(e.signal).then(e=>{if(e.status===`link`)return A(`connect-github`,Oe);e.status===`error`&&te(K(e.code))}).catch(De),()=>e.abort()},F=[t,A],e[7]=t,e[8]=A,e[9]=se,e[10]=F):(se=e[9],F=e[10]),(0,Z.useEffect)(se,F),t!==`authenticated`){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(ge,{children:(0,Q.jsxs)(T,{variant:`warning`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`Not signed in`}),(0,Q.jsx)(w,{children:`Sign in to the Hub to manage passkeys, two-factor authentication, and recovery codes.`})]})}),e[11]=t):t=e[11],t}let I;e[12]!==k.stepUp||e[13]!==k.stepUpUnresolved||e[14]!==y||e[15]!==v?(I=k.stepUpUnresolved?U:W(v,y,k.stepUp!==null),e[12]=k.stepUp,e[13]=k.stepUpUnresolved,e[14]=y,e[15]=v,e[16]=I):I=e[16];let L=I,z;e[17]!==k.stepUpUnresolved||e[18]!==y?(z=!k.stepUpUnresolved&&le(y),e[17]=k.stepUpUnresolved,e[18]=y,e[19]=z):z=e[19];let ce=z,B;e[20]!==l||e[21]!==u?(B=R(l,u),e[20]=l,e[21]=u,e[22]=B):B=e[22];let V=B,H;e[23]!==L||e[24]!==ce?(H=L?(0,Q.jsxs)(T,{variant:ce?`info`:`error`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:ce?`Passkey needed`:`That did not work`}),(0,Q.jsx)(w,{children:L})]}):null,e[23]=L,e[24]=ce,e[25]=H):H=e[25];let G;e[26]===O?G=e[27]:(G=O?(0,Q.jsxs)(T,{variant:`warning`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`GitHub connection did not complete`}),(0,Q.jsx)(w,{children:O})]}):null,e[26]=O,e[27]=G);let q;e[28]!==d||e[29]!==f?(q=d===null&&f!==`stale`?(0,Q.jsxs)(T,{variant:`info`,"aria-live":`polite`,children:[(0,Q.jsx)(p,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`Checking account security`}),(0,Q.jsx)(w,{children:`Reading which fallback sign-in methods are configured on this Hub.`})]}):null,e[28]=d,e[29]=f,e[30]=q):q=e[30];let ue;e[31]!==j||e[32]!==d||e[33]!==f?(ue=f===`stale`?(0,Q.jsxs)(T,{variant:`warning`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:d===null?`Account security unavailable`:`Account security may be outdated`}),(0,Q.jsx)(w,{children:d===null?`Ryco could not read the current password, authenticator, and email state.`:`These controls use the last state Ryco successfully read from the Hub.`}),(0,Q.jsx)(C,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:j,onClick:Ee,children:`Retry`})})]}):null,e[31]=j,e[32]=d,e[33]=f,e[34]=ue):ue=e[34];let J;e[35]!==j||e[36]!==V?(J=V?(0,Q.jsxs)(T,{variant:V.variant,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:V.title}),(0,Q.jsx)(w,{children:V.description}),(0,Q.jsx)(C,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:j,onClick:()=>c(!0),children:V.actionLabel})})]}):null,e[35]=j,e[36]=V,e[37]=J):J=e[37];let pe;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(g,{"aria-hidden":!0,className:`size-3.5`}),e[38]=pe):pe=e[38];let Y=n?.displayName??`Signed in`,X;e[39]===n?X=e[40]:(X=n?`${n.role} · joined ${xe(n.createdAt)??`unknown`}`:null,e[39]=n,e[40]=X);let me;e[41]!==Y||e[42]!==X?(me=(0,Q.jsx)(he,{title:`Account`,icon:pe,children:(0,Q.jsx)(_e,{title:Y,description:`The Hub account these credentials belong to.`,status:X})}),e[41]=Y,e[42]=X,e[43]=me):me=e[43];let ve;e[44]!==_||e[45]!==j||e[46]!==D||e[47]!==ie||e[48]!==N?.link||e[49]!==A||e[50]!==oe?(ve=ie||N?.link?(0,Q.jsx)(Ge,{identity:ie,actionsAvailable:N?.link===!0,busy:j||D,actionStatus:_,onConnect:()=>void oe(),run:A}):null,e[44]=_,e[45]=j,e[46]=D,e[47]=ie,e[48]=N?.link,e[49]=A,e[50]=oe,e[51]=ve):ve=e[51];let be=u===`loading`,we=u===`stale`,$;e[52]!==k.cancel||e[53]!==k.run||e[54]!==_||e[55]!==o||e[56]!==j||e[57]!==l||e[58]!==be||e[59]!==we?($=(0,Q.jsx)(qe,{passkeys:l,loading:be,stale:we,busy:j,actionStatus:_,addOpen:o,setAddOpen:c,run:k.run,cancel:k.cancel}),e[52]=k.cancel,e[53]=k.run,e[54]=_,e[55]=o,e[56]=j,e[57]=l,e[58]=be,e[59]=we,e[60]=$):$=e[60];let Te=d?.totpEnrolled??null,Ke;e[61]!==k.run||e[62]!==_||e[63]!==j||e[64]!==Te||e[65]!==E?(Ke=(0,Q.jsx)(Je,{busy:j,actionStatus:_,enrollment:E,enrolled:Te,run:k.run}),e[61]=k.run,e[62]=_,e[63]=j,e[64]=Te,e[65]=E,e[66]=Ke):Ke=e[66];let Ye;e[67]!==k.run||e[68]!==_||e[69]!==j||e[70]!==x?(Ye=(0,Q.jsx)(et,{busy:j,actionStatus:_,recoveryCodes:x,run:k.run}),e[67]=k.run,e[68]=_,e[69]=j,e[70]=x,e[71]=Ye):Ye=e[71];let Xe;e[72]!==k.cancel||e[73]!==k.run||e[74]!==_||e[75]!==j||e[76]!==d?(Xe=(0,Q.jsx)(Ze,{busy:j,actionStatus:_,security:d,run:k.run,cancel:k.cancel}),e[72]=k.cancel,e[73]=k.run,e[74]=_,e[75]=j,e[76]=d,e[77]=Xe):Xe=e[77];let Qe;e[78]!==k.cancel||e[79]!==k.setStepUpCode||e[80]!==k.stepUp||e[81]!==k.stepUpAttempts||e[82]!==k.stepUpCode||e[83]!==k.submitStepUp||e[84]!==j?(Qe=(0,Q.jsx)(at,{pending:k.stepUp,attempts:k.stepUpAttempts,code:k.stepUpCode,onCodeChange:k.setStepUpCode,onSubmit:k.submitStepUp,onCancel:k.cancel,busy:j}),e[78]=k.cancel,e[79]=k.setStepUpCode,e[80]=k.stepUp,e[81]=k.stepUpAttempts,e[82]=k.stepUpCode,e[83]=k.submitStepUp,e[84]=j,e[85]=Qe):Qe=e[85];let $e;return e[86]!==G||e[87]!==q||e[88]!==ue||e[89]!==J||e[90]!==me||e[91]!==ve||e[92]!==$||e[93]!==Ke||e[94]!==Ye||e[95]!==Xe||e[96]!==Qe||e[97]!==H?($e=(0,Q.jsxs)(ge,{children:[H,G,q,ue,J,me,ve,$,Ke,Ye,Xe,Qe]}),e[86]=G,e[87]=q,e[88]=ue,e[89]=J,e[90]=me,e[91]=ve,e[92]=$,e[93]=Ke,e[94]=Ye,e[95]=Xe,e[96]=Qe,e[97]=H,e[98]=$e):$e=e[98],$e}function Ee(){c.refreshAccountSecurity({force:!0})}function De(){}function Oe(e){return c.finishBrowserExternalIdentityConnection(`github`,e)}function ke(){c.refreshPasskeys(),c.refreshAccountSecurity(),c.refreshExternalIdentityConfiguration()}function Ae(e){return window.location.assign(e)}function je(e){return r.startExternalIdentityAuthorization(e)}function Me(e){return e.provider===`github`}function Ne(e){return e.totpEnrollment??null}function Pe(e){return e.recoveryCodes}function Fe(e){return e.errorCode??null}function Ie(e){return e.errorMessage}function Le(e){return e.actionStatus}function Re(e){return e.externalIdentityConfiguration}function ze(e){return e.securityStatus}function Be(e){return e.security}function Ve(e){return e.passkeysStatus}function He(e){return e.passkeys}function Ue(e){return e.account}function We(e){return e.accountStatus}function Ge(e){let t=(0,ye.c)(33),{identity:n,actionsAvailable:r,busy:i,actionStatus:a,onConnect:o,run:s}=e,[c,l]=(0,Z.useState)(!1),u=a===`connecting-external-identity`,d=a===`disconnecting-external-identity`,f;t[0]===s?f=t[1]:(f=async()=>{await s(`disconnect-github`,Ke,{onCommitted:()=>l(!1)})},t[0]=s,t[1]=f);let p=f,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(y,{"aria-hidden":!0,className:`size-3.5`}),t[2]=m):m=t[2];let h=n?`GitHub · @${n.login}`:`GitHub`,g=n?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,_;t[3]===n?_=t[4]:(_=n?`Connected ${xe(n.connectedAt)??`at an unknown time`}${n.lastUsedAt===null?``:` · last used ${xe(n.lastUsedAt)??`at an unknown time`}`}`:null,t[3]=n,t[4]=_);let v;t[5]!==r||t[6]!==i||t[7]!==u||t[8]!==d||t[9]!==n||t[10]!==o?(v=r?n?(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:i,onClick:()=>l(!0),children:(0,Q.jsx)($,{busy:d,children:`Disconnect`})}):(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:i,onClick:o,children:(0,Q.jsx)($,{busy:u,children:`Connect GitHub`})}):null,t[5]=r,t[6]=i,t[7]=u,t[8]=d,t[9]=n,t[10]=o,t[11]=v):v=t[11];let x;t[12]!==h||t[13]!==g||t[14]!==_||t[15]!==v?(x=(0,Q.jsx)(_e,{title:h,description:g,status:_,control:v}),t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=x):x=t[16];let S;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Disconnect GitHub?`}),(0,Q.jsx)(ie,{children:`You will no longer be able to sign in with GitHub. Ryco refuses this change if GitHub is your only remaining sign-in method.`})]}),t[17]=S):S=t[17];let C;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),t[18]=C):C=t[18];let w;t[19]===p?w=t[20]:(w=()=>void p(),t[19]=p,t[20]=w);let T;t[21]===d?T=t[22]:(T=(0,Q.jsx)($,{busy:d,children:`Disconnect GitHub`}),t[21]=d,t[22]=T);let E;t[23]!==i||t[24]!==w||t[25]!==T?(E=(0,Q.jsxs)(re,{children:[S,(0,Q.jsxs)(M,{children:[C,(0,Q.jsx)(b,{disabled:i,onClick:w,children:T})]})]}),t[23]=i,t[24]=w,t[25]=T,t[26]=E):E=t[26];let D;t[27]!==c||t[28]!==E?(D=(0,Q.jsx)(oe,{open:c,onOpenChange:l,children:E}),t[27]=c,t[28]=E,t[29]=D):D=t[29];let ee;return t[30]!==D||t[31]!==x?(ee=(0,Q.jsxs)(he,{title:`Connected accounts`,icon:m,children:[x,D]}),t[30]=D,t[31]=x,t[32]=ee):ee=t[32],ee}function Ke(e){return c.disconnectExternalIdentity(`github`,e)}function qe({passkeys:e,loading:t,stale:n,busy:r,actionStatus:i,addOpen:a,setAddOpen:o,run:s,cancel:l}){let[u,f]=(0,Z.useState)(``),[p,h]=(0,Z.useState)(null),[g,y]=(0,Z.useState)(null),x=i===`adding-passkey`,S=i===`revoking-passkey`,C=q(e),w=F(e),T=V(e),A=(0,Z.useCallback)(()=>{f(``),o(!1)},[o]),I=async e=>{e.preventDefault();let t=G(u);await s(`add-passkey`,e=>c.addPasskey({passkeyLabel:t,...e}),{onCommitted:A,onAbandoned:A})},R=async()=>{let e=p;if(e){h(null),y(e.id);try{await c.revokePasskey(e.id)}finally{y(null)}}};return(0,Q.jsxs)(he,{title:`Passkeys`,icon:(0,Q.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),headerAction:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(!0),children:`Add passkey`}),children:[(0,Q.jsx)(_e,{title:`Passkeys on this account`,description:`A passkey is the strongest way in. Add one for every device you sign in from, and keep at least two so losing a device does not lock you out.`,status:n?`This list could not be refreshed and may be out of date.`:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`${String(C.length)} usable ${C.length===1?`passkey`:`passkeys`}`}),w>0?(0,Q.jsx)(`span`,{children:` · ${String(w)} synced to a password manager`}):null]})}),t&&e.length===0?(0,Q.jsx)(_e,{title:`Loading passkeys…`,description:`Reading the credentials on file.`}):null,!t&&e.length===0?(0,Q.jsx)(_e,{title:`No passkeys yet`,description:`Add one now — without a passkey you can only get back in through a fallback credential.`}):null,T.map(e=>{let t=pe(e),n=L(e),i=xe(e.createdAt),a=xe(e.lastUsedAt);return(0,Q.jsx)(_e,{title:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[Y(e),t?(0,Q.jsx)(P,{variant:`error`,size:`sm`,children:`Revoked`}):null]}),description:t?`Revoked${e.revocationReasonCode?` — ${e.revocationReasonCode}`:``}. This credential can no longer sign in.`:n??`The Hub did not report whether this credential is backed up.`,status:[i?`Added ${i}`:null,a?`Last used ${a}`:`Never used`].filter(e=>e!==null).join(` · `),control:t?null:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Revoke ${Y(e)}`,disabled:r,onClick:()=>h(e),children:(0,Q.jsxs)($,{busy:S&&g===e.id,children:[(0,Q.jsx)(m,{"aria-hidden":!0}),`Revoke`]})})},e.id)}),(0,Q.jsx)(k,{open:a,onOpenChange:e=>{if(e){o(!0);return}r||A()},children:(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:e=>void I(e),children:[(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Add a passkey`}),(0,Q.jsx)(te,{children:`Your browser will ask you to create a passkey for this account. Adding one replaces the current Hub session with a fresh one.`})]}),(0,Q.jsxs)(O,{className:`space-y-3`,children:[(0,Q.jsx)(se,{htmlFor:`account-passkey-label`,children:`Name (optional)`}),(0,Q.jsx)(v,{id:`account-passkey-label`,value:u,autoComplete:`off`,placeholder:`Work laptop`,disabled:x,className:_,onChange:e=>f(e.target.value)})]}),(0,Q.jsxs)(ee,{children:[(0,Q.jsx)(b,{variant:`outline`,onClick:()=>{l(),A()},children:`Cancel`}),(0,Q.jsx)(b,{type:`submit`,disabled:r,children:(0,Q.jsx)($,{busy:x,children:`Create passkey`})})]})]})})}),(0,Q.jsx)(oe,{open:p!==null,onOpenChange:e=>{r||e||h(null)},children:(0,Q.jsxs)(re,{children:[(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Revoke this passkey?`}),(0,Q.jsxs)(ie,{children:[C.length===1?`This is the only usable passkey on this account. `:``,p?Y(p):``,` will stop working immediately, on every device it is stored on. This cannot be undone — you would have to enrol the device again.`]})]}),(0,Q.jsxs)(M,{children:[(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it`}),(0,Q.jsx)(b,{variant:`destructive`,disabled:r,onClick:()=>void R(),children:`Revoke passkey`})]})]})})]})}function Je(e){let t=(0,ye.c)(61),{busy:n,actionStatus:r,enrollment:i,enrolled:a,run:o}=e,[s,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1),f=r===`enrolling-totp`,m=r===`confirming-totp`,h=r===`revoking-totp`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{l(``),c.dismissTotpEnrollment()},t[0]=g):g=t[0];let y=g,x;t[1]===s?x=t[2]:(x=async e=>{e.preventDefault();let t=H(s);t.length!==0&&(await c.confirmTotpEnrollment({code:t}),l(``))},t[1]=s,t[2]=x);let S=x,C;t[3]===o?C=t[4]:(C=async()=>{d(!1),await o(`revoke-totp`,Xe)},t[3]=o,t[4]=C);let w=C,T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(p,{"aria-hidden":!0,className:`size-3.5`}),t[5]=T):T=t[5];let A=a===null?`Checking current state…`:a?`On`:`Off`,P;t[6]!==n||t[7]!==a||t[8]!==f||t[9]!==h?(P=a===null?null:a?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Turn off two-factor authentication`,disabled:n,onClick:()=>d(!0),children:(0,Q.jsx)($,{busy:h,children:`Turn off`})}):(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:Ye,children:(0,Q.jsx)($,{busy:f,children:`Set up`})}),t[6]=n,t[7]=a,t[8]=f,t[9]=h,t[10]=P):P=t[10];let F;t[11]!==A||t[12]!==P?(F=(0,Q.jsx)(_e,{title:`Authenticator app`,description:`A six-digit code from an authenticator app, required whenever you change credentials from a session that was not started with a passkey. Signing in with a passkey never asks for one.`,status:A,control:P}),t[11]=A,t[12]=P,t[13]=F):F=t[13];let I=i!==null,L;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{e||y()},t[14]=L):L=t[14];let R;t[15]===S?R=t[16]:(R=e=>void S(e),t[15]=S,t[16]=R);let z;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Set up two-factor authentication`}),(0,Q.jsx)(te,{children:`Scan this with your authenticator app, then enter the code it shows. This is the only time the key is displayed.`})]}),t[17]=z):z=t[17];let ce;t[18]===i?ce=t[19]:(ce=i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border bg-white p-4`,children:(0,Q.jsx)(ve,{value:i.provisioningUri,size:168,level:`M`,marginSize:1,title:`Two-factor setup code`})}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Can't scan? Enter this key manually:`}),(0,Q.jsx)(`p`,{"aria-label":`Two-factor setup key`,className:`rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm break-all`,children:i.secretBase32})]})]}):null,t[18]=i,t[19]=ce);let le;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Q.jsx)(se,{htmlFor:`account-totp-confirm`,children:`Code from your app`}),t[20]=le):le=t[20];let B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>l(H(e.target.value)),t[21]=B):B=t[21];let V;t[22]!==s||t[23]!==m?(V=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[le,(0,Q.jsx)(v,{id:`account-totp-confirm`,value:s,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:m,className:_,onChange:B})]}),t[22]=s,t[23]=m,t[24]=V):V=t[24];let U;t[25]!==ce||t[26]!==V?(U=(0,Q.jsxs)(O,{className:`space-y-4`,children:[ce,V]}),t[25]=ce,t[26]=V,t[27]=U):U=t[27];let W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(b,{variant:`outline`,onClick:y,children:`Cancel`}),t[28]=W):W=t[28];let G;t[29]!==n||t[30]!==s?(G=n||!ue(s),t[29]=n,t[30]=s,t[31]=G):G=t[31];let K;t[32]===m?K=t[33]:(K=(0,Q.jsx)($,{busy:m,children:`Turn on`}),t[32]=m,t[33]=K);let q;t[34]!==G||t[35]!==K?(q=(0,Q.jsxs)(ee,{children:[W,(0,Q.jsx)(b,{type:`submit`,disabled:G,children:K})]}),t[34]=G,t[35]=K,t[36]=q):q=t[36];let de;t[37]!==R||t[38]!==U||t[39]!==q?(de=(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:R,children:[z,U,q]})}),t[37]=R,t[38]=U,t[39]=q,t[40]=de):de=t[40];let J;t[41]!==de||t[42]!==I?(J=(0,Q.jsx)(k,{open:I,onOpenChange:L,children:de}),t[41]=de,t[42]=I,t[43]=J):J=t[43];let fe;t[44]===n?fe=t[45]:(fe=e=>{n||d(e)},t[44]=n,t[45]=fe);let pe;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Remove two-factor authentication?`}),(0,Q.jsx)(ie,{children:`Password, recovery-code, and emailed-link sign-ins will no longer need a code from your authenticator app. You can set it up again at any time.`})]}),t[46]=pe):pe=t[46];let Y;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it on`}),t[47]=Y):Y=t[47];let X;t[48]===w?X=t[49]:(X=()=>void w(),t[48]=w,t[49]=X);let me;t[50]!==n||t[51]!==X?(me=(0,Q.jsxs)(re,{children:[pe,(0,Q.jsxs)(M,{children:[Y,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:X,children:`Remove two-factor`})]})]}),t[50]=n,t[51]=X,t[52]=me):me=t[52];let ge;t[53]!==u||t[54]!==fe||t[55]!==me?(ge=(0,Q.jsx)(oe,{open:u,onOpenChange:fe,children:me}),t[53]=u,t[54]=fe,t[55]=me,t[56]=ge):ge=t[56];let be;return t[57]!==J||t[58]!==ge||t[59]!==F?(be=(0,Q.jsxs)(he,{title:`Two-factor authentication`,icon:T,children:[F,J,ge]}),t[57]=J,t[58]=ge,t[59]=F,t[60]=be):be=t[60],be}function Ye(){c.beginTotpEnrollment()}function Xe(e){return c.revokeTotp(e)}function Ze(e){let t=(0,ye.c)(86),{busy:n,actionStatus:r,security:i,run:a,cancel:o}=e,[s,l]=(0,Z.useState)(!1),[u,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(!1),[y,x]=(0,Z.useState)(!1),S=r===`setting-password`,C=r===`removing-password`,w;t[0]!==p||t[1]!==u?(w=me(u,p),t[0]=p,t[1]=u,t[2]=w):w=t[2];let T=w,A;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{f(``),m(``),g(!1)},t[3]=A):A=t[3];let P=A,F;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>{P(),l(!1)},t[4]=F):F=t[4];let I=F,L;t[5]===o?L=t[6]:(L=()=>{o(),I()},t[5]=o,t[6]=L);let R=L,z;t[7]!==T||t[8]!==u||t[9]!==a?(z=async e=>{e.preventDefault(),g(!0),!T&&await a(`set-password`,e=>c.setPassword({password:u,...e}),{onCommitted:I,onAbandoned:I})},t[7]=T,t[8]=u,t[9]=a,t[10]=z):z=t[10];let ce=z,le;t[11]===a?le=t[12]:(le=async()=>{x(!1),await a(`remove-password`,Qe)},t[11]=a,t[12]=le);let B=le,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Q.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),t[13]=V):V=t[13];let H=i===null?`Checking current state…`:i.passwordConfigured?`Set`:`Not set`,U;t[14]!==n||t[15]!==C||t[16]!==i||t[17]!==S?(U=i===null?null:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:()=>l(!0),children:(0,Q.jsx)($,{busy:S,children:i.passwordConfigured?`Change`:`Set password`})}),i.passwordConfigured?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Delete the fallback password`,disabled:n,onClick:()=>x(!0),children:(0,Q.jsx)($,{busy:C,children:`Remove`})}):null]}),t[14]=n,t[15]=C,t[16]=i,t[17]=S,t[18]=U):U=t[18];let W;t[19]!==H||t[20]!==U?(W=(0,Q.jsx)(_e,{title:`Fallback password`,description:`A password is a fallback, not an equal of a passkey: it can be phished and reused, and a session started with one has to prove itself again before changing credentials. Keep a passkey as your normal way in.`,status:H,control:U}),t[19]=H,t[20]=U,t[21]=W):W=t[21];let G=i===null?void 0:i.email,K=i?.emailDeliveryConfigured,q;t[22]!==r||t[23]!==n||t[24]!==a||t[25]!==G||t[26]!==K?(q=(0,Q.jsx)($e,{busy:n,actionStatus:r,email:G,deliveryConfigured:K,run:a}),t[22]=r,t[23]=n,t[24]=a,t[25]=G,t[26]=K,t[27]=q):q=t[27];let ue;t[28]===R?ue=t[29]:(ue=e=>{if(e){l(!0);return}R()},t[28]=R,t[29]=ue);let de;t[30]===ce?de=t[31]:(de=e=>void ce(e),t[30]=ce,t[31]=de);let J;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Set a fallback password`}),(0,Q.jsx)(te,{children:`This replaces any password already on the account. The Hub rejects passwords that have appeared in a known breach.`})]}),t[32]=J):J=t[32];let fe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Q.jsx)(se,{htmlFor:`account-password`,children:`New password`}),t[33]=fe):fe=t[33];let pe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>f(e.target.value),t[34]=pe):pe=t[34];let Y;t[35]!==u||t[36]!==S?(Y=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[fe,(0,Q.jsx)(v,{id:`account-password`,type:`password`,value:u,autoComplete:`new-password`,maxLength:256,disabled:S,className:_,onChange:pe})]}),t[35]=u,t[36]=S,t[37]=Y):Y=t[37];let X;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Q.jsx)(se,{htmlFor:`account-password-confirm`,children:`Confirm password`}),t[38]=X):X=t[38];let ge;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ge=e=>m(e.target.value),t[39]=ge):ge=t[39];let ve;t[40]!==p||t[41]!==S?(ve=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[X,(0,Q.jsx)(v,{id:`account-password-confirm`,type:`password`,value:p,autoComplete:`new-password`,maxLength:256,disabled:S,className:_,onChange:ge})]}),t[40]=p,t[41]=S,t[42]=ve):ve=t[42];let be;t[43]!==T||t[44]!==h?(be=h&&T?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:T}):null,t[43]=T,t[44]=h,t[45]=be):be=t[45];let xe;t[46]!==Y||t[47]!==ve||t[48]!==be?(xe=(0,Q.jsxs)(O,{className:`space-y-3`,children:[Y,ve,be]}),t[46]=Y,t[47]=ve,t[48]=be,t[49]=xe):xe=t[49];let Se;t[50]===R?Se=t[51]:(Se=(0,Q.jsx)(b,{variant:`outline`,onClick:R,children:`Cancel`}),t[50]=R,t[51]=Se);let Ce;t[52]===S?Ce=t[53]:(Ce=(0,Q.jsx)($,{busy:S,children:`Save password`}),t[52]=S,t[53]=Ce);let we;t[54]!==n||t[55]!==Ce?(we=(0,Q.jsx)(b,{type:`submit`,disabled:n,children:Ce}),t[54]=n,t[55]=Ce,t[56]=we):we=t[56];let Te;t[57]!==Se||t[58]!==we?(Te=(0,Q.jsxs)(ee,{children:[Se,we]}),t[57]=Se,t[58]=we,t[59]=Te):Te=t[59];let Ee;t[60]!==de||t[61]!==xe||t[62]!==Te?(Ee=(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:de,children:[J,xe,Te]})}),t[60]=de,t[61]=xe,t[62]=Te,t[63]=Ee):Ee=t[63];let De;t[64]!==s||t[65]!==ue||t[66]!==Ee?(De=(0,Q.jsx)(k,{open:s,onOpenChange:ue,children:Ee}),t[64]=s,t[65]=ue,t[66]=Ee,t[67]=De):De=t[67];let Oe;t[68]===n?Oe=t[69]:(Oe=e=>{n||x(e)},t[68]=n,t[69]=Oe);let ke;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Remove the password?`}),(0,Q.jsx)(ie,{children:`You will no longer be able to sign in with a password. Make sure you still have a passkey, or recovery codes you have saved.`})]}),t[70]=ke):ke=t[70];let Ae;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it`}),t[71]=Ae):Ae=t[71];let je;t[72]===B?je=t[73]:(je=()=>void B(),t[72]=B,t[73]=je);let Me;t[74]!==n||t[75]!==je?(Me=(0,Q.jsxs)(re,{children:[ke,(0,Q.jsxs)(M,{children:[Ae,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:je,children:`Remove password`})]})]}),t[74]=n,t[75]=je,t[76]=Me):Me=t[76];let Ne;t[77]!==y||t[78]!==Oe||t[79]!==Me?(Ne=(0,Q.jsx)(oe,{open:y,onOpenChange:Oe,children:Me}),t[77]=y,t[78]=Oe,t[79]=Me,t[80]=Ne):Ne=t[80];let Pe;return t[81]!==W||t[82]!==q||t[83]!==De||t[84]!==Ne?(Pe=(0,Q.jsxs)(he,{title:`Fallback sign-in`,icon:V,children:[W,q,De,Ne]}),t[81]=W,t[82]=q,t[83]=De,t[84]=Ne,t[85]=Pe):Pe=t[85],Pe}function Qe(e){return c.removePassword(e)}function $e(e){let t=(0,ye.c)(25),{busy:n,actionStatus:r,email:i,deliveryConfigured:a,run:o}=e,[s,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=r===`requesting-email-verification`,g;t[0]===s?g=t[1]:(g=J(s),t[0]=s,t[1]=g);let y=g,x;t[2]!==s||t[3]!==y||t[4]!==o?(x=async e=>{e.preventDefault(),d(!0),p(!1),!y&&await o(`request-email-verification`,e=>c.requestEmailVerification({email:s.trim(),...e}),{onCommitted:()=>{p(!0),l(``),d(!1)}})},t[2]=s,t[3]=y,t[4]=o,t[5]=x):x=t[5];let C=x,E;t[6]===a?E=t[7]:(E=a===!1?(0,Q.jsx)(`div`,{className:`border-t border-border/60 px-4 pt-3.5 sm:px-5`,children:(0,Q.jsxs)(T,{variant:`warning`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`No mail will arrive yet`}),(0,Q.jsx)(w,{children:`This Hub has no mail transport configured, so verification messages are generated and discarded. The request below will be accepted and nothing will be delivered until an operator wires one up. Do not rely on email as your way back into the account.`})]})}):null,t[6]=a,t[7]=E);let D=a?`Used for account recovery after verification. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`:`Used for account recovery once mail delivery is switched on. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`,ee=i===void 0?`Checking current state…`:i===null?`Not set`:`${i.verified?`Verified`:`Verification pending`} · ${i.address}`,O;t[8]!==f||t[9]!==n||t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==y||t[14]!==m||t[15]!==C||t[16]!==u?(O=i===void 0?null:(0,Q.jsxs)(`form`,{className:`pt-3 pb-3.5`,onSubmit:e=>void C(e),children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,Q.jsx)(v,{"aria-label":`Email address`,type:`email`,value:s,autoComplete:`email`,placeholder:`you@example.com`,maxLength:254,disabled:m,className:_,onChange:e=>{l(e.target.value),p(!1)}}),(0,Q.jsx)(b,{type:`submit`,size:`sm`,variant:`outline`,disabled:n,className:`shrink-0`,children:(0,Q.jsx)($,{busy:m,children:i===null?`Send verification`:i.verified?`Change email`:`Resend or change`})})]}),u&&y?(0,Q.jsx)(`p`,{role:`alert`,className:`pt-2 text-xs text-destructive-foreground`,children:y}):null,f?(0,Q.jsx)(`p`,{role:`status`,className:`pt-2 text-xs text-muted-foreground`,children:a?`Verification email requested. Check your inbox and spam folder; delivery may take a moment.`:`Request accepted by the Hub. No message will be delivered until a mail transport is configured.`}):null]}),t[8]=f,t[9]=n,t[10]=i,t[11]=a,t[12]=s,t[13]=y,t[14]=m,t[15]=C,t[16]=u,t[17]=O):O=t[17];let te;t[18]!==D||t[19]!==ee||t[20]!==O?(te=(0,Q.jsx)(_e,{title:`Recovery email`,description:D,status:ee,children:O}),t[18]=D,t[19]=ee,t[20]=O,t[21]=te):te=t[21];let ne;return t[22]!==E||t[23]!==te?(ne=(0,Q.jsxs)(Q.Fragment,{children:[E,te]}),t[22]=E,t[23]=te,t[24]=ne):ne=t[24],ne}function et(e){let t=(0,ye.c)(52),{busy:n,actionStatus:r,recoveryCodes:i,run:a}=e,[o,s]=(0,Z.useState)(!1),c=r===`regenerating-recovery-codes`,{copyToClipboard:d,isCopied:p}=x(),m;t[0]===a?m=t[1]:(m=async()=>{s(!1),await a(`regenerate-recovery-codes`,it)},t[0]=a,t[1]=m);let h=m,g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(f,{"aria-hidden":!0,className:`size-3.5`}),t[2]=g):g=t[2];let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>s(!0),t[3]=_):_=t[3];let v;t[4]===c?v=t[5]:(v=(0,Q.jsx)($,{busy:c,children:`Generate new codes`}),t[4]=c,t[5]=v);let y;t[6]!==n||t[7]!==v?(y=(0,Q.jsx)(_e,{title:`One-time recovery codes`,description:`Single-use codes that get you back in when you have lost every passkey. They are a last resort, not a substitute for one — anyone holding a code can sign in as you.`,status:`Ryco shows them once and never writes them to browser storage.`,control:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:n,onClick:_,children:v})}),t[6]=n,t[7]=v,t[8]=y):y=t[8];let S;t[9]===n?S=t[10]:(S=e=>{n||s(e)},t[9]=n,t[10]=S);let C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Replace your recovery codes?`}),(0,Q.jsx)(ie,{children:`Every code you have already saved stops working immediately. You will get a new set, shown once — if you lose them you will have to generate another set from a session you can still sign in to.`})]}),t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),t[12]=w):w=t[12];let T;t[13]===h?T=t[14]:(T=()=>void h(),t[13]=h,t[14]=T);let A;t[15]!==n||t[16]!==T?(A=(0,Q.jsxs)(re,{children:[C,(0,Q.jsxs)(M,{children:[w,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:T,children:`Replace codes`})]})]}),t[15]=n,t[16]=T,t[17]=A):A=t[17];let P;t[18]!==o||t[19]!==A||t[20]!==S?(P=(0,Q.jsx)(oe,{open:o,onOpenChange:S,children:A}),t[18]=o,t[19]=A,t[20]=S,t[21]=P):P=t[21];let se=i.length>0,F;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(D,{children:`Save your recovery codes`}),t[22]=F):F=t[22];let I=String(i.length),L;t[23]===I?L=t[24]:(L=(0,Q.jsxs)(E,{children:[F,(0,Q.jsxs)(te,{children:[`Save all `,I,` codes — they are shown once and cannot be retrieved later. Store them somewhere only you can reach — a password manager, or paper somewhere safe.`]})]}),t[23]=I,t[24]=L);let R;t[25]===i?R=t[26]:(R=i.map(nt),t[25]=i,t[26]=R);let z;t[27]===R?z=t[28]:(z=(0,Q.jsx)(O,{children:(0,Q.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:R})}),t[27]=R,t[28]=z);let le;t[29]!==d||t[30]!==i?(le=()=>d(ce(i),void 0),t[29]=d,t[30]=i,t[31]=le):le=t[31];let B;t[32]===p?B=t[33]:(B=p?(0,Q.jsx)(l,{"aria-hidden":!0}):(0,Q.jsx)(u,{"aria-hidden":!0}),t[32]=p,t[33]=B);let V=p?`Copied`:`Copy codes`,H;t[34]!==le||t[35]!==B||t[36]!==V?(H=(0,Q.jsxs)(b,{variant:`outline`,onClick:le,children:[B,V]}),t[34]=le,t[35]=B,t[36]=V,t[37]=H):H=t[37];let U;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(b,{onClick:tt,children:`I saved the codes`}),t[38]=U):U=t[38];let W;t[39]===H?W=t[40]:(W=(0,Q.jsxs)(ee,{children:[H,U]}),t[39]=H,t[40]=W);let G;t[41]!==L||t[42]!==z||t[43]!==W?(G=(0,Q.jsxs)(ne,{className:`max-w-md`,showCloseButton:!1,children:[L,z,W]}),t[41]=L,t[42]=z,t[43]=W,t[44]=G):G=t[44];let K;t[45]!==se||t[46]!==G?(K=(0,Q.jsx)(k,{open:se,disablePointerDismissal:!0,onOpenChange:rt,children:G}),t[45]=se,t[46]=G,t[47]=K):K=t[47];let q;return t[48]!==P||t[49]!==K||t[50]!==y?(q=(0,Q.jsxs)(he,{title:`Recovery codes`,icon:g,children:[y,P,K]}),t[48]=P,t[49]=K,t[50]=y,t[51]=q):q=t[51],q}function tt(){return c.dismissRecoveryCodes()}function nt(e){return(0,Q.jsx)(`li`,{children:e},e)}function rt(e,t){e||t.cancel()}function it(e){return c.regenerateRecoveryCodes(e)}function at(e){let t=(0,ye.c)(45),{pending:n,attempts:r,code:i,onCodeChange:a,onSubmit:o,onCancel:s,busy:c}=e,l=n!==null,u;t[0]===s?u=t[1]:(u=e=>{e||s()},t[0]=s,t[1]=u);let d;t[2]===o?d=t[3]:(d=e=>{e.preventDefault(),o()},t[2]=o,t[3]=d);let f;t[4]===n?f=t[5]:(f=n?I(n.action):``,t[4]=n,t[5]=f);let p;t[6]===f?p=t[7]:(p=(0,Q.jsx)(D,{children:f}),t[6]=f,t[7]=p);let m=n?.inferred??!1,h;t[8]!==r||t[9]!==m?(h=X(r,m),t[8]=r,t[9]=m,t[10]=h):h=t[10];let g;t[11]===h?g=t[12]:(g=(0,Q.jsx)(te,{children:h}),t[11]=h,t[12]=g);let y;t[13]!==p||t[14]!==g?(y=(0,Q.jsxs)(E,{children:[p,g]}),t[13]=p,t[14]=g,t[15]=y):y=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(se,{htmlFor:`account-step-up-code`,children:`Authenticator code`}),t[16]=x):x=t[16];let S;t[17]===a?S=t[18]:(S=e=>a(H(e.target.value)),t[17]=a,t[18]=S);let C;t[19]!==c||t[20]!==i||t[21]!==S?(C=(0,Q.jsxs)(O,{className:`space-y-2`,children:[x,(0,Q.jsx)(v,{id:`account-step-up-code`,value:i,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:c,className:_,onChange:S})]}),t[19]=c,t[20]=i,t[21]=S,t[22]=C):C=t[22];let w;t[23]===s?w=t[24]:(w=(0,Q.jsx)(b,{variant:`outline`,onClick:s,children:`Cancel`}),t[23]=s,t[24]=w);let T;t[25]!==c||t[26]!==i?(T=c||!ue(i),t[25]=c,t[26]=i,t[27]=T):T=t[27];let A;t[28]===c?A=t[29]:(A=(0,Q.jsx)($,{busy:c,children:`Confirm code`}),t[28]=c,t[29]=A);let j;t[30]!==T||t[31]!==A?(j=(0,Q.jsx)(b,{type:`submit`,disabled:T,children:A}),t[30]=T,t[31]=A,t[32]=j):j=t[32];let M;t[33]!==w||t[34]!==j?(M=(0,Q.jsxs)(ee,{children:[w,j]}),t[33]=w,t[34]=j,t[35]=M):M=t[35];let N;t[36]!==C||t[37]!==M||t[38]!==d||t[39]!==y?(N=(0,Q.jsx)(ne,{className:`max-w-sm`,children:(0,Q.jsxs)(`form`,{onSubmit:d,children:[y,C,M]})}),t[36]=C,t[37]=M,t[38]=d,t[39]=y,t[40]=N):N=t[40];let re;return t[41]!==l||t[42]!==N||t[43]!==u?(re=(0,Q.jsx)(k,{open:l,onOpenChange:u,children:N}),t[41]=l,t[42]=N,t[43]=u,t[44]=re):re=t[44],re}export{Te as AccountSettingsPanel};
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{I as r,N as i,P as a}from"./runtime-QZPKtH2P.js";import{It as o}from"./composerDraftStore-TYv9j3vY.js";import{_ as s,o as c}from"./authorization-D8lJzXTE.js";import{n as l}from"./loader-circle-CrtHFAvM.js";import{t as u}from"./copy-UQjKGt7t.js";import{t as d}from"./key-round-CacMputS.js";import{t as f}from"./refresh-cw-DopCMrtR.js";import{t as p}from"./shield-check-dQ-4cMKk.js";import{t as m}from"./trash-2-CM1zXPGb.js";import{t as h}from"./triangle-alert-RL_T3KLo.js";import{t as g}from"./user-round-Cpzx8pSw.js";import{n as _,t as v}from"./input-BZz4eLRl.js";import{u as y}from"./Icons-BEtED8P8.js";import{t as b}from"./button-DG8WqjNn.js";import{t as x}from"./useCopyToClipboard-BTpWxumf.js";import{i as S,n as C,r as w,t as T}from"./alert-DomE7dAt.js";import{a as E,c as D,i as ee,o as O,r as te,s as ne,t as k}from"./dialog-BNmFD6Nh.js";import{t as A}from"./spinner-ClQu8SdC.js";import{a as j,i as M,n as N,o as re,r as ie,s as ae,t as oe}from"./alert-dialog-9Jyh0e8u.js";import{t as P}from"./badge-w43sx8eF.js";import{t as se}from"./label-DZf4lbNF.js";import{C as F,S as I,_ as L,a as R,b as z,c as ce,d as le,f as B,g as V,h as H,i as U,l as W,m as G,n as K,o as q,p as ue,r as de,s as J,t as fe,u as pe,v as Y,x as X,y as me}from"./ExternalIdentityWeb.logic-Bn1HigS9.js";import{i as he,n as ge,r as _e}from"./settingsLayout-CHJT5wtl.js";import{t as ve}from"./qr-code-Ie92aZvE.js";var ye=n(),Z=e(t(),1),Q=o(),be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function xe(e){return e===null||!Number.isFinite(e)?null:be.format(new Date(e))}function Se(){let e=(0,ye.c)(15),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(0),[a,o]=(0,Z.useState)(``),[s,l]=(0,Z.useState)(!1),u=(0,Z.useRef)(0),d;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{n(null),i(0),o(``)},e[0]=d):d=e[0];let f=d,p;e[1]===t?.options?p=e[2]:(p=()=>{u.current+=1,c.cancelAccountAction(),t?.options?.onAbandoned?.(),l(!1),f()},e[1]=t?.options,e[2]=p);let m=p,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=async(e,t,r)=>{let a=u.current+=1;l(!1);let s=await t({});if(u.current===a){if(B(s)){o(``),i(0),n({action:e,run:t,options:r,inferred:s.inferredErrorCode===!0});return}s.status===`committed`&&r?.onCommitted?.()}},e[3]=h):h=e[3];let g=h,_;e[4]!==t||e[5]!==a||e[6]!==r?(_=async()=>{if(!t)return;let e=H(a);if(e.length===0)return;let n=u.current+=1,s=await t.run({totpCode:e});if(u.current===n){if(B(s)){let e=r+1;if(z(s,e)){i(e),o(``);return}l(!0),t.options?.onAbandoned?.(),f();return}s.status===`committed`&&t.options?.onCommitted?.(),f()}},e[4]=t,e[5]=a,e[6]=r,e[7]=_):_=e[7];let v=_,y;return e[8]!==m||e[9]!==t||e[10]!==a||e[11]!==r||e[12]!==s||e[13]!==v?(y={run:g,cancel:m,stepUp:t,stepUpAttempts:r,stepUpCode:a,stepUpUnresolved:s,setStepUpCode:o,submitStepUp:v},e[8]=m,e[9]=t,e[10]=a,e[11]=r,e[12]=s,e[13]=v,e[14]=y):y=e[14],y}function Ce(){let e=(0,ye.c)(1),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Z.useEffect)(we,t)}function we(){return c.leaseRecoveryCodeDisplay()}function $(e){let t=(0,ye.c)(3),{busy:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{className:`size-3.5`}),r]}):(0,Q.jsx)(Q.Fragment,{children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Te(){let e=(0,ye.c)(99),t=a(We),n=a(Ue),[o,c]=(0,Z.useState)(!1),l=i(He),u=i(Ve),d=i(Be),f=i(ze),m=i(Re),_=i(Le),v=i(Ie),y=i(Fe),x=a(Pe),E=a(Ne),[D,ee]=(0,Z.useState)(!1),[O,te]=(0,Z.useState)(null),ne=(0,Z.useRef)(!1),k=Se(),A=k.run;Ce();let j=_!==`idle`,M;e[0]===m?M=e[1]:(M=de(m),e[0]=m,e[1]=M);let N=M,re;e[2]===d?.externalIdentities?re=e[3]:(re=d?.externalIdentities.find(Me)??null,e[2]=d?.externalIdentities,e[3]=re);let ie=re,ae;e[4]===D?ae=e[5]:(ae=async()=>{if(!D){ee(!0),te(null);try{await fe({intent:`link`,returnTo:`/account/security`,start:je,navigate:Ae})}catch(e){let t=e;te(t instanceof s?t.message:`GitHub connection is temporarily unavailable.`),ee(!1)}}},e[4]=D,e[5]=ae);let oe=ae,P;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(P=[],e[6]=P):P=e[6],(0,Z.useEffect)(ke,P);let se,F;if(e[7]!==t||e[8]!==A?(se=()=>{if(t!==`authenticated`||ne.current)return;ne.current=!0;let e=new AbortController;return r.getPendingExternalIdentity(e.signal).then(e=>{if(e.status===`link`)return A(`connect-github`,Oe);e.status===`error`&&te(K(e.code))}).catch(De),()=>e.abort()},F=[t,A],e[7]=t,e[8]=A,e[9]=se,e[10]=F):(se=e[9],F=e[10]),(0,Z.useEffect)(se,F),t!==`authenticated`){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(ge,{children:(0,Q.jsxs)(T,{variant:`warning`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`Not signed in`}),(0,Q.jsx)(w,{children:`Sign in to the Hub to manage passkeys, two-factor authentication, and recovery codes.`})]})}),e[11]=t):t=e[11],t}let I;e[12]!==k.stepUp||e[13]!==k.stepUpUnresolved||e[14]!==y||e[15]!==v?(I=k.stepUpUnresolved?U:W(v,y,k.stepUp!==null),e[12]=k.stepUp,e[13]=k.stepUpUnresolved,e[14]=y,e[15]=v,e[16]=I):I=e[16];let L=I,z;e[17]!==k.stepUpUnresolved||e[18]!==y?(z=!k.stepUpUnresolved&&le(y),e[17]=k.stepUpUnresolved,e[18]=y,e[19]=z):z=e[19];let ce=z,B;e[20]!==l||e[21]!==u?(B=R(l,u),e[20]=l,e[21]=u,e[22]=B):B=e[22];let V=B,H;e[23]!==L||e[24]!==ce?(H=L?(0,Q.jsxs)(T,{variant:ce?`info`:`error`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:ce?`Passkey needed`:`That did not work`}),(0,Q.jsx)(w,{children:L})]}):null,e[23]=L,e[24]=ce,e[25]=H):H=e[25];let G;e[26]===O?G=e[27]:(G=O?(0,Q.jsxs)(T,{variant:`warning`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`GitHub connection did not complete`}),(0,Q.jsx)(w,{children:O})]}):null,e[26]=O,e[27]=G);let q;e[28]!==d||e[29]!==f?(q=d===null&&f!==`stale`?(0,Q.jsxs)(T,{variant:`info`,"aria-live":`polite`,children:[(0,Q.jsx)(p,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`Checking account security`}),(0,Q.jsx)(w,{children:`Reading which fallback sign-in methods are configured on this Hub.`})]}):null,e[28]=d,e[29]=f,e[30]=q):q=e[30];let ue;e[31]!==j||e[32]!==d||e[33]!==f?(ue=f===`stale`?(0,Q.jsxs)(T,{variant:`warning`,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:d===null?`Account security unavailable`:`Account security may be outdated`}),(0,Q.jsx)(w,{children:d===null?`Ryco could not read the current password, authenticator, and email state.`:`These controls use the last state Ryco successfully read from the Hub.`}),(0,Q.jsx)(C,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:j,onClick:Ee,children:`Retry`})})]}):null,e[31]=j,e[32]=d,e[33]=f,e[34]=ue):ue=e[34];let J;e[35]!==j||e[36]!==V?(J=V?(0,Q.jsxs)(T,{variant:V.variant,"aria-live":`polite`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:V.title}),(0,Q.jsx)(w,{children:V.description}),(0,Q.jsx)(C,{children:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:j,onClick:()=>c(!0),children:V.actionLabel})})]}):null,e[35]=j,e[36]=V,e[37]=J):J=e[37];let pe;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(g,{"aria-hidden":!0,className:`size-3.5`}),e[38]=pe):pe=e[38];let Y=n?.displayName??`Signed in`,X;e[39]===n?X=e[40]:(X=n?`${n.role} · joined ${xe(n.createdAt)??`unknown`}`:null,e[39]=n,e[40]=X);let me;e[41]!==Y||e[42]!==X?(me=(0,Q.jsx)(he,{title:`Account`,icon:pe,children:(0,Q.jsx)(_e,{title:Y,description:`The Hub account these credentials belong to.`,status:X})}),e[41]=Y,e[42]=X,e[43]=me):me=e[43];let ve;e[44]!==_||e[45]!==j||e[46]!==D||e[47]!==ie||e[48]!==N?.link||e[49]!==A||e[50]!==oe?(ve=ie||N?.link?(0,Q.jsx)(Ge,{identity:ie,actionsAvailable:N?.link===!0,busy:j||D,actionStatus:_,onConnect:()=>void oe(),run:A}):null,e[44]=_,e[45]=j,e[46]=D,e[47]=ie,e[48]=N?.link,e[49]=A,e[50]=oe,e[51]=ve):ve=e[51];let be=u===`loading`,we=u===`stale`,$;e[52]!==k.cancel||e[53]!==k.run||e[54]!==_||e[55]!==o||e[56]!==j||e[57]!==l||e[58]!==be||e[59]!==we?($=(0,Q.jsx)(qe,{passkeys:l,loading:be,stale:we,busy:j,actionStatus:_,addOpen:o,setAddOpen:c,run:k.run,cancel:k.cancel}),e[52]=k.cancel,e[53]=k.run,e[54]=_,e[55]=o,e[56]=j,e[57]=l,e[58]=be,e[59]=we,e[60]=$):$=e[60];let Te=d?.totpEnrolled??null,Ke;e[61]!==k.run||e[62]!==_||e[63]!==j||e[64]!==Te||e[65]!==E?(Ke=(0,Q.jsx)(Je,{busy:j,actionStatus:_,enrollment:E,enrolled:Te,run:k.run}),e[61]=k.run,e[62]=_,e[63]=j,e[64]=Te,e[65]=E,e[66]=Ke):Ke=e[66];let Ye;e[67]!==k.run||e[68]!==_||e[69]!==j||e[70]!==x?(Ye=(0,Q.jsx)(et,{busy:j,actionStatus:_,recoveryCodes:x,run:k.run}),e[67]=k.run,e[68]=_,e[69]=j,e[70]=x,e[71]=Ye):Ye=e[71];let Xe;e[72]!==k.cancel||e[73]!==k.run||e[74]!==_||e[75]!==j||e[76]!==d?(Xe=(0,Q.jsx)(Ze,{busy:j,actionStatus:_,security:d,run:k.run,cancel:k.cancel}),e[72]=k.cancel,e[73]=k.run,e[74]=_,e[75]=j,e[76]=d,e[77]=Xe):Xe=e[77];let Qe;e[78]!==k.cancel||e[79]!==k.setStepUpCode||e[80]!==k.stepUp||e[81]!==k.stepUpAttempts||e[82]!==k.stepUpCode||e[83]!==k.submitStepUp||e[84]!==j?(Qe=(0,Q.jsx)(at,{pending:k.stepUp,attempts:k.stepUpAttempts,code:k.stepUpCode,onCodeChange:k.setStepUpCode,onSubmit:k.submitStepUp,onCancel:k.cancel,busy:j}),e[78]=k.cancel,e[79]=k.setStepUpCode,e[80]=k.stepUp,e[81]=k.stepUpAttempts,e[82]=k.stepUpCode,e[83]=k.submitStepUp,e[84]=j,e[85]=Qe):Qe=e[85];let $e;return e[86]!==G||e[87]!==q||e[88]!==ue||e[89]!==J||e[90]!==me||e[91]!==ve||e[92]!==$||e[93]!==Ke||e[94]!==Ye||e[95]!==Xe||e[96]!==Qe||e[97]!==H?($e=(0,Q.jsxs)(ge,{children:[H,G,q,ue,J,me,ve,$,Ke,Ye,Xe,Qe]}),e[86]=G,e[87]=q,e[88]=ue,e[89]=J,e[90]=me,e[91]=ve,e[92]=$,e[93]=Ke,e[94]=Ye,e[95]=Xe,e[96]=Qe,e[97]=H,e[98]=$e):$e=e[98],$e}function Ee(){c.refreshAccountSecurity({force:!0})}function De(){}function Oe(e){return c.finishBrowserExternalIdentityConnection(`github`,e)}function ke(){c.refreshPasskeys(),c.refreshAccountSecurity(),c.refreshExternalIdentityConfiguration()}function Ae(e){return window.location.assign(e)}function je(e){return r.startExternalIdentityAuthorization(e)}function Me(e){return e.provider===`github`}function Ne(e){return e.totpEnrollment??null}function Pe(e){return e.recoveryCodes}function Fe(e){return e.errorCode??null}function Ie(e){return e.errorMessage}function Le(e){return e.actionStatus}function Re(e){return e.externalIdentityConfiguration}function ze(e){return e.securityStatus}function Be(e){return e.security}function Ve(e){return e.passkeysStatus}function He(e){return e.passkeys}function Ue(e){return e.account}function We(e){return e.accountStatus}function Ge(e){let t=(0,ye.c)(33),{identity:n,actionsAvailable:r,busy:i,actionStatus:a,onConnect:o,run:s}=e,[c,l]=(0,Z.useState)(!1),u=a===`connecting-external-identity`,d=a===`disconnecting-external-identity`,f;t[0]===s?f=t[1]:(f=async()=>{await s(`disconnect-github`,Ke,{onCommitted:()=>l(!1)})},t[0]=s,t[1]=f);let p=f,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(y,{"aria-hidden":!0,className:`size-3.5`}),t[2]=m):m=t[2];let h=n?`GitHub · @${n.login}`:`GitHub`,g=n?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,_;t[3]===n?_=t[4]:(_=n?`Connected ${xe(n.connectedAt)??`at an unknown time`}${n.lastUsedAt===null?``:` · last used ${xe(n.lastUsedAt)??`at an unknown time`}`}`:null,t[3]=n,t[4]=_);let v;t[5]!==r||t[6]!==i||t[7]!==u||t[8]!==d||t[9]!==n||t[10]!==o?(v=r?n?(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:i,onClick:()=>l(!0),children:(0,Q.jsx)($,{busy:d,children:`Disconnect`})}):(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:i,onClick:o,children:(0,Q.jsx)($,{busy:u,children:`Connect GitHub`})}):null,t[5]=r,t[6]=i,t[7]=u,t[8]=d,t[9]=n,t[10]=o,t[11]=v):v=t[11];let x;t[12]!==h||t[13]!==g||t[14]!==_||t[15]!==v?(x=(0,Q.jsx)(_e,{title:h,description:g,status:_,control:v}),t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=x):x=t[16];let S;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Disconnect GitHub?`}),(0,Q.jsx)(ie,{children:`You will no longer be able to sign in with GitHub. Ryco refuses this change if GitHub is your only remaining sign-in method.`})]}),t[17]=S):S=t[17];let C;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),t[18]=C):C=t[18];let w;t[19]===p?w=t[20]:(w=()=>void p(),t[19]=p,t[20]=w);let T;t[21]===d?T=t[22]:(T=(0,Q.jsx)($,{busy:d,children:`Disconnect GitHub`}),t[21]=d,t[22]=T);let E;t[23]!==i||t[24]!==w||t[25]!==T?(E=(0,Q.jsxs)(re,{children:[S,(0,Q.jsxs)(M,{children:[C,(0,Q.jsx)(b,{disabled:i,onClick:w,children:T})]})]}),t[23]=i,t[24]=w,t[25]=T,t[26]=E):E=t[26];let D;t[27]!==c||t[28]!==E?(D=(0,Q.jsx)(oe,{open:c,onOpenChange:l,children:E}),t[27]=c,t[28]=E,t[29]=D):D=t[29];let ee;return t[30]!==D||t[31]!==x?(ee=(0,Q.jsxs)(he,{title:`Connected accounts`,icon:m,children:[x,D]}),t[30]=D,t[31]=x,t[32]=ee):ee=t[32],ee}function Ke(e){return c.disconnectExternalIdentity(`github`,e)}function qe({passkeys:e,loading:t,stale:n,busy:r,actionStatus:i,addOpen:a,setAddOpen:o,run:s,cancel:l}){let[u,f]=(0,Z.useState)(``),[p,h]=(0,Z.useState)(null),[g,y]=(0,Z.useState)(null),x=i===`adding-passkey`,S=i===`revoking-passkey`,C=q(e),w=F(e),T=V(e),A=(0,Z.useCallback)(()=>{f(``),o(!1)},[o]),I=async e=>{e.preventDefault();let t=G(u);await s(`add-passkey`,e=>c.addPasskey({passkeyLabel:t,...e}),{onCommitted:A,onAbandoned:A})},R=async()=>{let e=p;if(e){h(null),y(e.id);try{await c.revokePasskey(e.id)}finally{y(null)}}};return(0,Q.jsxs)(he,{title:`Passkeys`,icon:(0,Q.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),headerAction:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>o(!0),children:`Add passkey`}),children:[(0,Q.jsx)(_e,{title:`Passkeys on this account`,description:`A passkey is the strongest way in. Add one for every device you sign in from, and keep at least two so losing a device does not lock you out.`,status:n?`This list could not be refreshed and may be out of date.`:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:`${String(C.length)} usable ${C.length===1?`passkey`:`passkeys`}`}),w>0?(0,Q.jsx)(`span`,{children:` · ${String(w)} synced to a password manager`}):null]})}),t&&e.length===0?(0,Q.jsx)(_e,{title:`Loading passkeys…`,description:`Reading the credentials on file.`}):null,!t&&e.length===0?(0,Q.jsx)(_e,{title:`No passkeys yet`,description:`Add one now — without a passkey you can only get back in through a fallback credential.`}):null,T.map(e=>{let t=pe(e),n=L(e),i=xe(e.createdAt),a=xe(e.lastUsedAt);return(0,Q.jsx)(_e,{title:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[Y(e),t?(0,Q.jsx)(P,{variant:`error`,size:`sm`,children:`Revoked`}):null]}),description:t?`Revoked${e.revocationReasonCode?` — ${e.revocationReasonCode}`:``}. This credential can no longer sign in.`:n??`The Hub did not report whether this credential is backed up.`,status:[i?`Added ${i}`:null,a?`Last used ${a}`:`Never used`].filter(e=>e!==null).join(` · `),control:t?null:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Revoke ${Y(e)}`,disabled:r,onClick:()=>h(e),children:(0,Q.jsxs)($,{busy:S&&g===e.id,children:[(0,Q.jsx)(m,{"aria-hidden":!0}),`Revoke`]})})},e.id)}),(0,Q.jsx)(k,{open:a,onOpenChange:e=>{if(e){o(!0);return}r||A()},children:(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:e=>void I(e),children:[(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Add a passkey`}),(0,Q.jsx)(te,{children:`Your browser will ask you to create a passkey for this account. Adding one replaces the current Hub session with a fresh one.`})]}),(0,Q.jsxs)(O,{className:`space-y-3`,children:[(0,Q.jsx)(se,{htmlFor:`account-passkey-label`,children:`Name (optional)`}),(0,Q.jsx)(v,{id:`account-passkey-label`,value:u,autoComplete:`off`,placeholder:`Work laptop`,disabled:x,className:_,onChange:e=>f(e.target.value)})]}),(0,Q.jsxs)(ee,{children:[(0,Q.jsx)(b,{variant:`outline`,onClick:()=>{l(),A()},children:`Cancel`}),(0,Q.jsx)(b,{type:`submit`,disabled:r,children:(0,Q.jsx)($,{busy:x,children:`Create passkey`})})]})]})})}),(0,Q.jsx)(oe,{open:p!==null,onOpenChange:e=>{r||e||h(null)},children:(0,Q.jsxs)(re,{children:[(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Revoke this passkey?`}),(0,Q.jsxs)(ie,{children:[C.length===1?`This is the only usable passkey on this account. `:``,p?Y(p):``,` will stop working immediately, on every device it is stored on. This cannot be undone — you would have to enrol the device again.`]})]}),(0,Q.jsxs)(M,{children:[(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it`}),(0,Q.jsx)(b,{variant:`destructive`,disabled:r,onClick:()=>void R(),children:`Revoke passkey`})]})]})})]})}function Je(e){let t=(0,ye.c)(61),{busy:n,actionStatus:r,enrollment:i,enrolled:a,run:o}=e,[s,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1),f=r===`enrolling-totp`,m=r===`confirming-totp`,h=r===`revoking-totp`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{l(``),c.dismissTotpEnrollment()},t[0]=g):g=t[0];let y=g,x;t[1]===s?x=t[2]:(x=async e=>{e.preventDefault();let t=H(s);t.length!==0&&(await c.confirmTotpEnrollment({code:t}),l(``))},t[1]=s,t[2]=x);let S=x,C;t[3]===o?C=t[4]:(C=async()=>{d(!1),await o(`revoke-totp`,Xe)},t[3]=o,t[4]=C);let w=C,T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(p,{"aria-hidden":!0,className:`size-3.5`}),t[5]=T):T=t[5];let A=a===null?`Checking current state…`:a?`On`:`Off`,P;t[6]!==n||t[7]!==a||t[8]!==f||t[9]!==h?(P=a===null?null:a?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Turn off two-factor authentication`,disabled:n,onClick:()=>d(!0),children:(0,Q.jsx)($,{busy:h,children:`Turn off`})}):(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:Ye,children:(0,Q.jsx)($,{busy:f,children:`Set up`})}),t[6]=n,t[7]=a,t[8]=f,t[9]=h,t[10]=P):P=t[10];let F;t[11]!==A||t[12]!==P?(F=(0,Q.jsx)(_e,{title:`Authenticator app`,description:`A six-digit code from an authenticator app, required whenever you change credentials from a session that was not started with a passkey. Signing in with a passkey never asks for one.`,status:A,control:P}),t[11]=A,t[12]=P,t[13]=F):F=t[13];let I=i!==null,L;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{e||y()},t[14]=L):L=t[14];let R;t[15]===S?R=t[16]:(R=e=>void S(e),t[15]=S,t[16]=R);let z;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Set up two-factor authentication`}),(0,Q.jsx)(te,{children:`Scan this with your authenticator app, then enter the code it shows. This is the only time the key is displayed.`})]}),t[17]=z):z=t[17];let ce;t[18]===i?ce=t[19]:(ce=i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border bg-white p-4`,children:(0,Q.jsx)(ve,{value:i.provisioningUri,size:168,level:`M`,marginSize:1,title:`Two-factor setup code`})}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Can't scan? Enter this key manually:`}),(0,Q.jsx)(`p`,{"aria-label":`Two-factor setup key`,className:`rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm break-all`,children:i.secretBase32})]})]}):null,t[18]=i,t[19]=ce);let le;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Q.jsx)(se,{htmlFor:`account-totp-confirm`,children:`Code from your app`}),t[20]=le):le=t[20];let B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>l(H(e.target.value)),t[21]=B):B=t[21];let V;t[22]!==s||t[23]!==m?(V=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[le,(0,Q.jsx)(v,{id:`account-totp-confirm`,value:s,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:m,className:_,onChange:B})]}),t[22]=s,t[23]=m,t[24]=V):V=t[24];let U;t[25]!==ce||t[26]!==V?(U=(0,Q.jsxs)(O,{className:`space-y-4`,children:[ce,V]}),t[25]=ce,t[26]=V,t[27]=U):U=t[27];let W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(b,{variant:`outline`,onClick:y,children:`Cancel`}),t[28]=W):W=t[28];let G;t[29]!==n||t[30]!==s?(G=n||!ue(s),t[29]=n,t[30]=s,t[31]=G):G=t[31];let K;t[32]===m?K=t[33]:(K=(0,Q.jsx)($,{busy:m,children:`Turn on`}),t[32]=m,t[33]=K);let q;t[34]!==G||t[35]!==K?(q=(0,Q.jsxs)(ee,{children:[W,(0,Q.jsx)(b,{type:`submit`,disabled:G,children:K})]}),t[34]=G,t[35]=K,t[36]=q):q=t[36];let de;t[37]!==R||t[38]!==U||t[39]!==q?(de=(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:R,children:[z,U,q]})}),t[37]=R,t[38]=U,t[39]=q,t[40]=de):de=t[40];let J;t[41]!==de||t[42]!==I?(J=(0,Q.jsx)(k,{open:I,onOpenChange:L,children:de}),t[41]=de,t[42]=I,t[43]=J):J=t[43];let fe;t[44]===n?fe=t[45]:(fe=e=>{n||d(e)},t[44]=n,t[45]=fe);let pe;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Remove two-factor authentication?`}),(0,Q.jsx)(ie,{children:`Password, recovery-code, and emailed-link sign-ins will no longer need a code from your authenticator app. You can set it up again at any time.`})]}),t[46]=pe):pe=t[46];let Y;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it on`}),t[47]=Y):Y=t[47];let X;t[48]===w?X=t[49]:(X=()=>void w(),t[48]=w,t[49]=X);let me;t[50]!==n||t[51]!==X?(me=(0,Q.jsxs)(re,{children:[pe,(0,Q.jsxs)(M,{children:[Y,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:X,children:`Remove two-factor`})]})]}),t[50]=n,t[51]=X,t[52]=me):me=t[52];let ge;t[53]!==u||t[54]!==fe||t[55]!==me?(ge=(0,Q.jsx)(oe,{open:u,onOpenChange:fe,children:me}),t[53]=u,t[54]=fe,t[55]=me,t[56]=ge):ge=t[56];let be;return t[57]!==J||t[58]!==ge||t[59]!==F?(be=(0,Q.jsxs)(he,{title:`Two-factor authentication`,icon:T,children:[F,J,ge]}),t[57]=J,t[58]=ge,t[59]=F,t[60]=be):be=t[60],be}function Ye(){c.beginTotpEnrollment()}function Xe(e){return c.revokeTotp(e)}function Ze(e){let t=(0,ye.c)(86),{busy:n,actionStatus:r,security:i,run:a,cancel:o}=e,[s,l]=(0,Z.useState)(!1),[u,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(!1),[y,x]=(0,Z.useState)(!1),S=r===`setting-password`,C=r===`removing-password`,w;t[0]!==p||t[1]!==u?(w=me(u,p),t[0]=p,t[1]=u,t[2]=w):w=t[2];let T=w,A;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{f(``),m(``),g(!1)},t[3]=A):A=t[3];let P=A,F;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>{P(),l(!1)},t[4]=F):F=t[4];let I=F,L;t[5]===o?L=t[6]:(L=()=>{o(),I()},t[5]=o,t[6]=L);let R=L,z;t[7]!==T||t[8]!==u||t[9]!==a?(z=async e=>{e.preventDefault(),g(!0),!T&&await a(`set-password`,e=>c.setPassword({password:u,...e}),{onCommitted:I,onAbandoned:I})},t[7]=T,t[8]=u,t[9]=a,t[10]=z):z=t[10];let ce=z,le;t[11]===a?le=t[12]:(le=async()=>{x(!1),await a(`remove-password`,Qe)},t[11]=a,t[12]=le);let B=le,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Q.jsx)(d,{"aria-hidden":!0,className:`size-3.5`}),t[13]=V):V=t[13];let H=i===null?`Checking current state…`:i.passwordConfigured?`Set`:`Not set`,U;t[14]!==n||t[15]!==C||t[16]!==i||t[17]!==S?(U=i===null?null:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:()=>l(!0),children:(0,Q.jsx)($,{busy:S,children:i.passwordConfigured?`Change`:`Set password`})}),i.passwordConfigured?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,"aria-label":`Delete the fallback password`,disabled:n,onClick:()=>x(!0),children:(0,Q.jsx)($,{busy:C,children:`Remove`})}):null]}),t[14]=n,t[15]=C,t[16]=i,t[17]=S,t[18]=U):U=t[18];let W;t[19]!==H||t[20]!==U?(W=(0,Q.jsx)(_e,{title:`Fallback password`,description:`A password is a fallback, not an equal of a passkey: it can be phished and reused, and a session started with one has to prove itself again before changing credentials. Keep a passkey as your normal way in.`,status:H,control:U}),t[19]=H,t[20]=U,t[21]=W):W=t[21];let G=i===null?void 0:i.email,K=i?.emailDeliveryConfigured,q;t[22]!==r||t[23]!==n||t[24]!==a||t[25]!==G||t[26]!==K?(q=(0,Q.jsx)($e,{busy:n,actionStatus:r,email:G,deliveryConfigured:K,run:a}),t[22]=r,t[23]=n,t[24]=a,t[25]=G,t[26]=K,t[27]=q):q=t[27];let ue;t[28]===R?ue=t[29]:(ue=e=>{if(e){l(!0);return}R()},t[28]=R,t[29]=ue);let de;t[30]===ce?de=t[31]:(de=e=>void ce(e),t[30]=ce,t[31]=de);let J;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Q.jsxs)(E,{children:[(0,Q.jsx)(D,{children:`Set a fallback password`}),(0,Q.jsx)(te,{children:`This replaces any password already on the account. The Hub rejects passwords that have appeared in a known breach.`})]}),t[32]=J):J=t[32];let fe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Q.jsx)(se,{htmlFor:`account-password`,children:`New password`}),t[33]=fe):fe=t[33];let pe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>f(e.target.value),t[34]=pe):pe=t[34];let Y;t[35]!==u||t[36]!==S?(Y=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[fe,(0,Q.jsx)(v,{id:`account-password`,type:`password`,value:u,autoComplete:`new-password`,maxLength:256,disabled:S,className:_,onChange:pe})]}),t[35]=u,t[36]=S,t[37]=Y):Y=t[37];let X;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Q.jsx)(se,{htmlFor:`account-password-confirm`,children:`Confirm password`}),t[38]=X):X=t[38];let ge;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ge=e=>m(e.target.value),t[39]=ge):ge=t[39];let ve;t[40]!==p||t[41]!==S?(ve=(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[X,(0,Q.jsx)(v,{id:`account-password-confirm`,type:`password`,value:p,autoComplete:`new-password`,maxLength:256,disabled:S,className:_,onChange:ge})]}),t[40]=p,t[41]=S,t[42]=ve):ve=t[42];let be;t[43]!==T||t[44]!==h?(be=h&&T?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:T}):null,t[43]=T,t[44]=h,t[45]=be):be=t[45];let xe;t[46]!==Y||t[47]!==ve||t[48]!==be?(xe=(0,Q.jsxs)(O,{className:`space-y-3`,children:[Y,ve,be]}),t[46]=Y,t[47]=ve,t[48]=be,t[49]=xe):xe=t[49];let Se;t[50]===R?Se=t[51]:(Se=(0,Q.jsx)(b,{variant:`outline`,onClick:R,children:`Cancel`}),t[50]=R,t[51]=Se);let Ce;t[52]===S?Ce=t[53]:(Ce=(0,Q.jsx)($,{busy:S,children:`Save password`}),t[52]=S,t[53]=Ce);let we;t[54]!==n||t[55]!==Ce?(we=(0,Q.jsx)(b,{type:`submit`,disabled:n,children:Ce}),t[54]=n,t[55]=Ce,t[56]=we):we=t[56];let Te;t[57]!==Se||t[58]!==we?(Te=(0,Q.jsxs)(ee,{children:[Se,we]}),t[57]=Se,t[58]=we,t[59]=Te):Te=t[59];let Ee;t[60]!==de||t[61]!==xe||t[62]!==Te?(Ee=(0,Q.jsx)(ne,{className:`max-w-md`,children:(0,Q.jsxs)(`form`,{onSubmit:de,children:[J,xe,Te]})}),t[60]=de,t[61]=xe,t[62]=Te,t[63]=Ee):Ee=t[63];let De;t[64]!==s||t[65]!==ue||t[66]!==Ee?(De=(0,Q.jsx)(k,{open:s,onOpenChange:ue,children:Ee}),t[64]=s,t[65]=ue,t[66]=Ee,t[67]=De):De=t[67];let Oe;t[68]===n?Oe=t[69]:(Oe=e=>{n||x(e)},t[68]=n,t[69]=Oe);let ke;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Remove the password?`}),(0,Q.jsx)(ie,{children:`You will no longer be able to sign in with a password. Make sure you still have a passkey, or recovery codes you have saved.`})]}),t[70]=ke):ke=t[70];let Ae;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Keep it`}),t[71]=Ae):Ae=t[71];let je;t[72]===B?je=t[73]:(je=()=>void B(),t[72]=B,t[73]=je);let Me;t[74]!==n||t[75]!==je?(Me=(0,Q.jsxs)(re,{children:[ke,(0,Q.jsxs)(M,{children:[Ae,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:je,children:`Remove password`})]})]}),t[74]=n,t[75]=je,t[76]=Me):Me=t[76];let Ne;t[77]!==y||t[78]!==Oe||t[79]!==Me?(Ne=(0,Q.jsx)(oe,{open:y,onOpenChange:Oe,children:Me}),t[77]=y,t[78]=Oe,t[79]=Me,t[80]=Ne):Ne=t[80];let Pe;return t[81]!==W||t[82]!==q||t[83]!==De||t[84]!==Ne?(Pe=(0,Q.jsxs)(he,{title:`Fallback sign-in`,icon:V,children:[W,q,De,Ne]}),t[81]=W,t[82]=q,t[83]=De,t[84]=Ne,t[85]=Pe):Pe=t[85],Pe}function Qe(e){return c.removePassword(e)}function $e(e){let t=(0,ye.c)(25),{busy:n,actionStatus:r,email:i,deliveryConfigured:a,run:o}=e,[s,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=r===`requesting-email-verification`,g;t[0]===s?g=t[1]:(g=J(s),t[0]=s,t[1]=g);let y=g,x;t[2]!==s||t[3]!==y||t[4]!==o?(x=async e=>{e.preventDefault(),d(!0),p(!1),!y&&await o(`request-email-verification`,e=>c.requestEmailVerification({email:s.trim(),...e}),{onCommitted:()=>{p(!0),l(``),d(!1)}})},t[2]=s,t[3]=y,t[4]=o,t[5]=x):x=t[5];let C=x,E;t[6]===a?E=t[7]:(E=a===!1?(0,Q.jsx)(`div`,{className:`border-t border-border/60 px-4 pt-3.5 sm:px-5`,children:(0,Q.jsxs)(T,{variant:`warning`,children:[(0,Q.jsx)(h,{"aria-hidden":!0}),(0,Q.jsx)(S,{children:`No mail will arrive yet`}),(0,Q.jsx)(w,{children:`This Hub has no mail transport configured, so verification messages are generated and discarded. The request below will be accepted and nothing will be delivered until an operator wires one up. Do not rely on email as your way back into the account.`})]})}):null,t[6]=a,t[7]=E);let D=a?`Used for account recovery after verification. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`:`Used for account recovery once mail delivery is switched on. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`,ee=i===void 0?`Checking current state…`:i===null?`Not set`:`${i.verified?`Verified`:`Verification pending`} · ${i.address}`,O;t[8]!==f||t[9]!==n||t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==y||t[14]!==m||t[15]!==C||t[16]!==u?(O=i===void 0?null:(0,Q.jsxs)(`form`,{className:`pt-3 pb-3.5`,onSubmit:e=>void C(e),children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,Q.jsx)(v,{"aria-label":`Email address`,type:`email`,value:s,autoComplete:`email`,placeholder:`you@example.com`,maxLength:254,disabled:m,className:_,onChange:e=>{l(e.target.value),p(!1)}}),(0,Q.jsx)(b,{type:`submit`,size:`sm`,variant:`outline`,disabled:n,className:`shrink-0`,children:(0,Q.jsx)($,{busy:m,children:i===null?`Send verification`:i.verified?`Change email`:`Resend or change`})})]}),u&&y?(0,Q.jsx)(`p`,{role:`alert`,className:`pt-2 text-xs text-destructive-foreground`,children:y}):null,f?(0,Q.jsx)(`p`,{role:`status`,className:`pt-2 text-xs text-muted-foreground`,children:a?`Verification email requested. Check your inbox and spam folder; delivery may take a moment.`:`Request accepted by the Hub. No message will be delivered until a mail transport is configured.`}):null]}),t[8]=f,t[9]=n,t[10]=i,t[11]=a,t[12]=s,t[13]=y,t[14]=m,t[15]=C,t[16]=u,t[17]=O):O=t[17];let te;t[18]!==D||t[19]!==ee||t[20]!==O?(te=(0,Q.jsx)(_e,{title:`Recovery email`,description:D,status:ee,children:O}),t[18]=D,t[19]=ee,t[20]=O,t[21]=te):te=t[21];let ne;return t[22]!==E||t[23]!==te?(ne=(0,Q.jsxs)(Q.Fragment,{children:[E,te]}),t[22]=E,t[23]=te,t[24]=ne):ne=t[24],ne}function et(e){let t=(0,ye.c)(52),{busy:n,actionStatus:r,recoveryCodes:i,run:a}=e,[o,s]=(0,Z.useState)(!1),c=r===`regenerating-recovery-codes`,{copyToClipboard:d,isCopied:p}=x(),m;t[0]===a?m=t[1]:(m=async()=>{s(!1),await a(`regenerate-recovery-codes`,it)},t[0]=a,t[1]=m);let h=m,g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(f,{"aria-hidden":!0,className:`size-3.5`}),t[2]=g):g=t[2];let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>s(!0),t[3]=_):_=t[3];let v;t[4]===c?v=t[5]:(v=(0,Q.jsx)($,{busy:c,children:`Generate new codes`}),t[4]=c,t[5]=v);let y;t[6]!==n||t[7]!==v?(y=(0,Q.jsx)(_e,{title:`One-time recovery codes`,description:`Single-use codes that get you back in when you have lost every passkey. They are a last resort, not a substitute for one — anyone holding a code can sign in as you.`,status:`Ryco shows them once and never writes them to browser storage.`,control:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:n,onClick:_,children:v})}),t[6]=n,t[7]=v,t[8]=y):y=t[8];let S;t[9]===n?S=t[10]:(S=e=>{n||s(e)},t[9]=n,t[10]=S);let C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsxs)(j,{children:[(0,Q.jsx)(ae,{children:`Replace your recovery codes?`}),(0,Q.jsx)(ie,{children:`Every code you have already saved stops working immediately. You will get a new set, shown once — if you lose them you will have to generate another set from a session you can still sign in to.`})]}),t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(N,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),t[12]=w):w=t[12];let T;t[13]===h?T=t[14]:(T=()=>void h(),t[13]=h,t[14]=T);let A;t[15]!==n||t[16]!==T?(A=(0,Q.jsxs)(re,{children:[C,(0,Q.jsxs)(M,{children:[w,(0,Q.jsx)(b,{variant:`destructive`,disabled:n,onClick:T,children:`Replace codes`})]})]}),t[15]=n,t[16]=T,t[17]=A):A=t[17];let P;t[18]!==o||t[19]!==A||t[20]!==S?(P=(0,Q.jsx)(oe,{open:o,onOpenChange:S,children:A}),t[18]=o,t[19]=A,t[20]=S,t[21]=P):P=t[21];let se=i.length>0,F;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(D,{children:`Save your recovery codes`}),t[22]=F):F=t[22];let I=String(i.length),L;t[23]===I?L=t[24]:(L=(0,Q.jsxs)(E,{children:[F,(0,Q.jsxs)(te,{children:[`Save all `,I,` codes — they are shown once and cannot be retrieved later. Store them somewhere only you can reach — a password manager, or paper somewhere safe.`]})]}),t[23]=I,t[24]=L);let R;t[25]===i?R=t[26]:(R=i.map(nt),t[25]=i,t[26]=R);let z;t[27]===R?z=t[28]:(z=(0,Q.jsx)(O,{children:(0,Q.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:R})}),t[27]=R,t[28]=z);let le;t[29]!==d||t[30]!==i?(le=()=>d(ce(i),void 0),t[29]=d,t[30]=i,t[31]=le):le=t[31];let B;t[32]===p?B=t[33]:(B=p?(0,Q.jsx)(l,{"aria-hidden":!0}):(0,Q.jsx)(u,{"aria-hidden":!0}),t[32]=p,t[33]=B);let V=p?`Copied`:`Copy codes`,H;t[34]!==le||t[35]!==B||t[36]!==V?(H=(0,Q.jsxs)(b,{variant:`outline`,onClick:le,children:[B,V]}),t[34]=le,t[35]=B,t[36]=V,t[37]=H):H=t[37];let U;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(b,{onClick:tt,children:`I saved the codes`}),t[38]=U):U=t[38];let W;t[39]===H?W=t[40]:(W=(0,Q.jsxs)(ee,{children:[H,U]}),t[39]=H,t[40]=W);let G;t[41]!==L||t[42]!==z||t[43]!==W?(G=(0,Q.jsxs)(ne,{className:`max-w-md`,showCloseButton:!1,children:[L,z,W]}),t[41]=L,t[42]=z,t[43]=W,t[44]=G):G=t[44];let K;t[45]!==se||t[46]!==G?(K=(0,Q.jsx)(k,{open:se,disablePointerDismissal:!0,onOpenChange:rt,children:G}),t[45]=se,t[46]=G,t[47]=K):K=t[47];let q;return t[48]!==P||t[49]!==K||t[50]!==y?(q=(0,Q.jsxs)(he,{title:`Recovery codes`,icon:g,children:[y,P,K]}),t[48]=P,t[49]=K,t[50]=y,t[51]=q):q=t[51],q}function tt(){return c.dismissRecoveryCodes()}function nt(e){return(0,Q.jsx)(`li`,{children:e},e)}function rt(e,t){e||t.cancel()}function it(e){return c.regenerateRecoveryCodes(e)}function at(e){let t=(0,ye.c)(45),{pending:n,attempts:r,code:i,onCodeChange:a,onSubmit:o,onCancel:s,busy:c}=e,l=n!==null,u;t[0]===s?u=t[1]:(u=e=>{e||s()},t[0]=s,t[1]=u);let d;t[2]===o?d=t[3]:(d=e=>{e.preventDefault(),o()},t[2]=o,t[3]=d);let f;t[4]===n?f=t[5]:(f=n?I(n.action):``,t[4]=n,t[5]=f);let p;t[6]===f?p=t[7]:(p=(0,Q.jsx)(D,{children:f}),t[6]=f,t[7]=p);let m=n?.inferred??!1,h;t[8]!==r||t[9]!==m?(h=X(r,m),t[8]=r,t[9]=m,t[10]=h):h=t[10];let g;t[11]===h?g=t[12]:(g=(0,Q.jsx)(te,{children:h}),t[11]=h,t[12]=g);let y;t[13]!==p||t[14]!==g?(y=(0,Q.jsxs)(E,{children:[p,g]}),t[13]=p,t[14]=g,t[15]=y):y=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(se,{htmlFor:`account-step-up-code`,children:`Authenticator code`}),t[16]=x):x=t[16];let S;t[17]===a?S=t[18]:(S=e=>a(H(e.target.value)),t[17]=a,t[18]=S);let C;t[19]!==c||t[20]!==i||t[21]!==S?(C=(0,Q.jsxs)(O,{className:`space-y-2`,children:[x,(0,Q.jsx)(v,{id:`account-step-up-code`,value:i,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:c,className:_,onChange:S})]}),t[19]=c,t[20]=i,t[21]=S,t[22]=C):C=t[22];let w;t[23]===s?w=t[24]:(w=(0,Q.jsx)(b,{variant:`outline`,onClick:s,children:`Cancel`}),t[23]=s,t[24]=w);let T;t[25]!==c||t[26]!==i?(T=c||!ue(i),t[25]=c,t[26]=i,t[27]=T):T=t[27];let A;t[28]===c?A=t[29]:(A=(0,Q.jsx)($,{busy:c,children:`Confirm code`}),t[28]=c,t[29]=A);let j;t[30]!==T||t[31]!==A?(j=(0,Q.jsx)(b,{type:`submit`,disabled:T,children:A}),t[30]=T,t[31]=A,t[32]=j):j=t[32];let M;t[33]!==w||t[34]!==j?(M=(0,Q.jsxs)(ee,{children:[w,j]}),t[33]=w,t[34]=j,t[35]=M):M=t[35];let N;t[36]!==C||t[37]!==M||t[38]!==d||t[39]!==y?(N=(0,Q.jsx)(ne,{className:`max-w-sm`,children:(0,Q.jsxs)(`form`,{onSubmit:d,children:[y,C,M]})}),t[36]=C,t[37]=M,t[38]=d,t[39]=y,t[40]=N):N=t[40];let re;return t[41]!==l||t[42]!==N||t[43]!==u?(re=(0,Q.jsx)(k,{open:l,onOpenChange:u,children:N}),t[41]=l,t[42]=N,t[43]=u,t[44]=re):re=t[44],re}export{Te as AccountSettingsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{C as r,Fr as i}from"./src-DmPIm3ie.js";import{Bn as a,Hn as o,b as s,p as c,u as l,xn as u,y as d,zn as f}from"./runtime-QZPKtH2P.js";import{kt as p,n as ee}from"./primary-CiDY2oUi.js";import{Ct as m,It as h,U as g,V as _,X as v,q as y}from"./composerDraftStore-TYv9j3vY.js";import{i as te}from"./threadPriorityRefreshRuntime-DbEFchoL.js";import{a as ne,i as b}from"./toast-C-0Ft2jD.js";import{t as re}from"./refresh-cw-DopCMrtR.js";import{t as ie}from"./sparkles-CAf3oJ5S.js";import{t as x}from"./ProviderModelPicker-BTFj53Qv.js";import{t as ae}from"./switch-BZjA7VT9.js";import{t as S}from"./button-DG8WqjNn.js";import{t as C}from"./toastHelpers-CSQRKo4F.js";import{a as oe,i as w,o as T,s as se,t as E}from"./select-CZukJlTn.js";import"./providerInstances-vd2eZtHx.js";import{i as D,n as ce,r as O}from"./settingsLayout-CHJT5wtl.js";var le=[`Thread titles`,`Project or repository names`,`Branch names`,`Bucketed creation and activity age`,`Running, approval, input, queue, failure, and delivery state`,`Pull request or linked issue title and state`,`Up to 600 characters from the latest user request`],k=[{value:0,label:`Manual only`},{value:3e5,label:`Every 5 minutes`},{value:6e5,label:`Every 10 minutes`},{value:18e5,label:`Every 30 minutes`},{value:36e5,label:`Every hour`},{value:216e5,label:`Every 6 hours`},{value:864e5,label:`Every 24 hours`}];function A(e){return{...e.enabled===void 0?{}:{aiFocusEnabled:e.enabled},...e.refreshIntervalMs===void 0?{}:{aiFocusRefreshIntervalMs:e.refreshIntervalMs}}}function j(e){return e.map(e=>{let t=e.serverConfig,n=t?.environment.capabilities.threadPriorityRanking===!0,r=t?.settings.inboxPriorityModelSelection??null,i=t?r??t.settings.textGenerationModelSelection:null,a=i===null?null:t?.providers.find(e=>e.instanceId===i.instanceId)??null;return{...e,supported:n,inherited:r===null,effectiveModelSelection:i,effectiveProvider:a}})}function M(e,t){let n=e.find(e=>e.instanceId===t);return!!(n&&n.enabled&&n.installed&&n.availability!==`unavailable`&&n.status!==`disabled`&&n.status!==`error`)}function N(e){if(e.selection!==null&&!M(e.serverConfig.providers,e.selection.instanceId))throw Error(`That provider instance is not available on this environment.`);return{inboxPriorityModelSelection:e.selection}}var P=n(),F=e(t(),1),I=h();function L(e){return e instanceof Error?e.message:`An unexpected error occurred.`}function ue(){let e=(0,P.c)(2),[t,n]=(0,F.useState)(R),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>d(()=>{n(l())}),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,F.useEffect)(r,i),t}function R(){return l()}function z({row:e}){let[t,n]=(0,F.useState)(!1),i=e.serverConfig;if(!i||!e.effectiveModelSelection)return null;let a={...i.settings,...r},o=e.effectiveModelSelection,c=v(y(i.providers)),l=_(a,i.providers,o.instanceId,o.model),u=async t=>{n(!0);try{let n=N({serverConfig:i,selection:t});await s(e.environmentId,n)}catch(t){b.add(C({type:`error`,title:`Could not update ${e.label}`,description:L(t)}))}finally{n(!1)}};return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,I.jsx)(x,{activeInstanceId:o.instanceId,model:o.model,lockedProvider:null,instanceEntries:c,modelOptionsByInstance:l,compact:!0,disabled:t||!e.connected,...e.connected?{}:{disabledReason:`Connect this environment to change its model.`},onInstanceModelChange:(e,t)=>{u(g({...a,textGenerationModelSelection:m(e,t)},i.providers))}}),e.inherited?null:(0,I.jsx)(S,{size:`xs`,variant:`ghost`,disabled:t||!e.connected,onClick:()=>void u(null),children:`Use text model`})]})}function B(e){let t=(0,P.c)(6),{row:n}=e,r=n.effectiveProvider?.displayName??n.effectiveProvider?.driver??null,i=n.connected?n.supported?n.inherited?`Inherits the text-generation model${r?` (${r})`:``}.`:`Uses a separate model for Inbox ranking.`:`This node version does not support AI Focus ranking. Other supported nodes still work.`:`Offline — ranking waits for an existing connection.`,a;t[0]===n?a=t[1]:(a=n.supported?(0,I.jsx)(z,{row:n}):void 0,t[0]=n,t[1]=a);let o;return t[2]!==n.label||t[3]!==i||t[4]!==a?(o=(0,I.jsx)(O,{title:n.label,description:i,control:a}),t[2]=n.label,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function V(){let e=(0,P.c)(48),t=f(),{updateSettings:n}=a(),r=o(),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=ee(),e[0]=s):s=e[0];let c=s,l=u(he),d=ue(),[p,m]=(0,F.useState)(!1);c?.environmentId,c?.label;let h;if(e[1]!==d||e[2]!==r||e[3]!==l){let t=new Map;c?.environmentId&&t.set(c.environmentId,{label:c.label,config:r});for(let e of d){if(t.has(e.environmentId))continue;let n=l[e.environmentId];t.set(e.environmentId,{label:n?.descriptor?.label??e.knownEnvironment.label,config:n?.serverConfig??null})}for(let[e,n]of Object.entries(l)){let r=i.make(e);t.has(r)||t.set(r,{label:n.descriptor?.label??`Saved environment`,config:n.serverConfig})}h=j([...t].map(me)),e[1]=d,e[2]=r,e[3]=l,e[4]=h}else h=e[4];let g=h,_;e[5]===g?_=e[6]:(_=async()=>{m(!0);let e=await te(),t=e.failures;t.length>0?b.add(C({type:`error`,title:`AI Focus refresh failed`,description:t.map(e=>{let{environmentId:t,error:n}=e;return`${g.find(e=>e.environmentId===t)?.label??`Environment`}: ${L(n)}`}).join(` · `)})):b.add(C({type:`success`,title:e.attempted.length>0?`AI Focus refreshed`:`No connected supported nodes`,description:e.attempted.length>0?`Updated ${e.succeeded.length} environment${e.succeeded.length===1?``:`s`}.`:`Connect a supported node to rank its Inbox.`})),m(!1)},e[5]=g,e[6]=_);let v=_,y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,I.jsx)(ie,{className:`size-3.5`}),e[7]=y):y=e[7];let x;e[8]===n?x=e[9]:(x=e=>n(A({enabled:e})),e[8]=n,e[9]=x);let w;e[10]!==t.aiFocusEnabled||e[11]!==x?(w=(0,I.jsx)(O,{title:`Prioritize the Inbox`,description:`Create a Focus section from pinned, actionable, and model-ranked threads. Focused threads are removed from Active, never duplicated.`,control:(0,I.jsx)(ae,{"aria-label":`Enable AI Focus`,checked:t.aiFocusEnabled,onCheckedChange:x})}),e[10]=t.aiFocusEnabled,e[11]=x,e[12]=w):w=e[12];let M=String(t.aiFocusRefreshIntervalMs),N;e[13]===n?N=e[14]:(N=e=>{let t=Number(e);n(A({refreshIntervalMs:t}))},e[13]=n,e[14]=N);let R;e[15]===t.aiFocusRefreshIntervalMs?R=e[16]:(R=k.find(e=>e.value===t.aiFocusRefreshIntervalMs)?.label??`Every 10 minutes`,e[15]=t.aiFocusRefreshIntervalMs,e[16]=R);let z;e[17]===R?z=e[18]:(z=(0,I.jsx)(T,{className:`w-48`,"aria-label":`AI Focus refresh interval`,children:(0,I.jsx)(se,{children:R})}),e[17]=R,e[18]=z);let B;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,I.jsx)(oe,{align:`end`,alignItemWithTrigger:!1,children:k.map(pe)}),e[19]=B):B=e[19];let V;e[20]!==M||e[21]!==N||e[22]!==z?(V=(0,I.jsxs)(E,{value:M,onValueChange:N,children:[z,B]}),e[20]=M,e[21]=N,e[22]=z,e[23]=V):V=e[23];let H;e[24]===v?H=e[25]:(H=()=>void v(),e[24]=v,e[25]=H);let U=p?`size-4 animate-spin`:`size-4`,W;e[26]===U?W=e[27]:(W=(0,I.jsx)(re,{className:U}),e[26]=U,e[27]=W);let G;e[28]!==p||e[29]!==H||e[30]!==W?(G=(0,I.jsx)(S,{size:`icon-sm`,variant:`outline`,"aria-label":`Refresh AI Focus now`,disabled:p,onClick:H,children:W}),e[28]=p,e[29]=H,e[30]=W,e[31]=G):G=e[31];let K;e[32]!==V||e[33]!==G?(K=(0,I.jsx)(O,{title:`Refresh rankings`,description:`Automatic checks use only nodes that are already connected. Manual-only never starts a connection.`,control:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,G]})}),e[32]=V,e[33]=G,e[34]=K):K=e[34];let q;e[35]!==K||e[36]!==w?(q=(0,I.jsxs)(D,{title:`AI Focus`,icon:y,children:[w,K]}),e[35]=K,e[36]=w,e[37]=q):q=e[37];let J;e[38]===g?J=e[39]:(J=g.length>0?g.map(fe):(0,I.jsx)(O,{title:`No environments available`,description:`Connect a node to configure its Inbox ranking model.`}),e[38]=g,e[39]=J);let Y;e[40]===J?Y=e[41]:(Y=(0,I.jsx)(D,{title:`Models`,children:J}),e[40]=J,e[41]=Y);let X;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,I.jsx)(ne,{className:`size-3.5`}),e[42]=X):X=e[42];let Z;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,I.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Ranking sends only this bounded metadata from each environment. It does not send full chat history, file contents, or message responses.`}),e[43]=Z):Z=e[43];let Q;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,I.jsx)(D,{title:`Data sent to the selected model`,icon:X,children:(0,I.jsxs)(`div`,{className:`px-5 py-4`,children:[Z,(0,I.jsx)(`ul`,{className:`grid gap-1.5 text-xs text-foreground/80 sm:grid-cols-2`,children:le.map(de)})]})}),e[44]=Q):Q=e[44];let $;return e[45]!==q||e[46]!==Y?($=(0,I.jsxs)(ce,{children:[q,Y,Q]}),e[45]=q,e[46]=Y,e[47]=$):$=e[47],$}function de(e){return(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`•`}),(0,I.jsx)(`span`,{children:e})]},e)}function fe(e){return(0,I.jsx)(B,{row:e},e.environmentId)}function pe(e){return(0,I.jsx)(w,{hideIndicator:!0,value:String(e.value),children:e.label},e.value)}function me(e){let[t,n]=e;return{environmentId:t,label:n.label,connected:c(t)!==null&&p(t).phase===`connected`,serverConfig:n.config}}function he(e){return e.byId}export{V as AiFocusSettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import"./env-Bcq9YR3B.js";import{li as r}from"./src-DmPIm3ie.js";import{Qn as i,_n as a,an as o,dn as s,fn as c,in as l,ln as u,mn as d,on as f,p,pn as m,sn as h,un as g,y as _}from"./runtime-QZPKtH2P.js";import{d as v,f as y}from"./ThreadStatusIndicators-C40TYVEC.js";var b=n(),x=e(t(),1);function S(e){let t=(0,b.c)(13),n=c(e),{environmentId:r,cwd:a,query:s,enabled:l,limit:d,staleTime:f}=e,p,_;t[0]!==a||t[1]!==r||t[2]!==d?(p=()=>{if(r===null||a===null)return;let e={environmentId:r,cwd:a,...d===void 0?{}:{limit:d}};return m(e),()=>u(e)},_=[r,a,d],t[0]=a,t[1]=r,t[2]=d,t[3]=p,t[4]=_):(p=t[3],_=t[4]),(0,x.useEffect)(p,_);let v,y;t[5]!==a||t[6]!==l||t[7]!==r||t[8]!==d||t[9]!==s||t[10]!==f?(v=()=>{g({environmentId:r,cwd:a,query:s,...l===void 0?{}:{enabled:l},...d===void 0?{}:{limit:d},...f===void 0?{}:{staleTime:f}})},y=[r,a,s,l,d,f],t[5]=a,t[6]=l,t[7]=r,t[8]=d,t[9]=s,t[10]=f,t[11]=v,t[12]=y):(v=t[11],y=t[12]),(0,x.useEffect)(v,y);let S=i(h(n));return n===null?o:S}function C(e){let t=s(e),n=(0,x.useSyncExternalStore)(_,()=>e.environmentId===null?null:p(e.environmentId),()=>null),r=(0,x.useRef)(e);r.current=e,(0,x.useEffect)(()=>{let e=r.current,t=e.environmentId===null?void 0:a(e.environmentId,n?.client??null);return d(e,t??null)},[t,n]);let o=i(f(t));return t===null?l:o}function w(e){let t=e.trim().replace(/\.git$/i,``).replace(/\/+$/,``);if(!t||/^[a-z]:[\\/]/i.test(t)||t.startsWith(`\\\\`))return null;if(!t.includes(`://`)){let e=/^(?:[^@/]+@)?([^:/]+):(.+)$/.exec(t);return e?.[1]&&e[2]?`https://${e[1]}/${e[2].replace(/^\/+/,``)}`:null}try{let e=new URL(t.replace(/^(ssh|git|http):\/\//i,`https://`).replace(/^ssh:/i,`https:`));return!e.hostname||e.pathname===`/`||e.pathname===``?null:`https://${e.hostname}${e.pathname}`}catch{return null}}function T(e){if(!e)return null;let t=[e.locator?.remoteUrl,...(e.remotes??[]).map(e=>e.url)];for(let e of t){if(!e)continue;let t=w(e);if(t)return t}return null}r([`local`,`worktree`]);function E(e){let t=y(e.runtimeLabel),n=y(e.savedLabel);return e.isPrimary?[t,n].find(e=>e?!v(e):!1)??`This device`:t??n??e.environmentId}function D(e){let{activeWorktreePath:t,hasServerThread:n,draftThreadEnvMode:r}=e;return n?t?`worktree`:`local`:t?`local`:r===`worktree`?`worktree`:`local`}function O(e){let{nextWorktreePath:t,currentWorktreePath:n,effectiveEnvMode:r}=e;return t||r===`worktree`&&!n?`worktree`:`local`}function k(e){let{envMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t===`worktree`&&!n?r??i:i??r}function A(e){let{activeProjectCwd:t,activeWorktreePath:n,refName:r}=e;if(r.worktreePath)return{checkoutCwd:r.worktreePath,nextWorktreePath:r.worktreePath===t?null:r.worktreePath,reuseExistingWorktree:!0};let i=n!==null&&r.isDefault?null:n;return{checkoutCwd:i??t,nextWorktreePath:i,reuseExistingWorktree:!1}}function j(e){let{itemValue:t,normalizedQuery:n,createBranchItemValue:r,checkoutPullRequestItemValue:i}=e;if(n.length===0||r&&t===r||i&&t===i)return!0;let a=e.searchTextByItemValue?.get(t);return a===void 0?t.toLowerCase().includes(n):a.toLowerCase().includes(n)}export{D as a,C as c,O as i,S as l,A as n,E as o,k as r,j as s,T as t};
|