+
    5mjc                   F   ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
Ht ^ RIHt ^ RIHtHtHt ^ RIHt ^ RIHt ^ RIHtHtHtHtHt ^ R	IHt ^ R
IHt ^ RI H!t!H"t"H#t#H$t$ ^ RI%H&t&H't' ^ RI(H)t) ^ RI*H+t+ ^ RI,H-t- ^ RI.H/t/H0t0H1t1 ^ RI2H3t3 ^ RI4H5t5H6t6H7t7 ^ RI8H9t9 ^ RI:H;t; ^ RI<H=t= ^ RI>t>^ RI?H@t@ ^ RIAHBtBHCtCHDtDHEtE ^ RIFHGtG ^ RIHHItIHJtJHKtK ^ RILHMtMHNtNHOtOHPtP ^ RIQHRtRHStSHTtTHUtUHVtVHWtW ]P                  P                  RR4      tZ]P                  P                  RR4      t[]P                  P                  R R!4      t\]P                  P                  R"R#4      t]R$t^^t_R% R& lt`R' R( lta]! R)4      tbR* R+ ltcR, R- ltdR. R/ lteR0 R1 ltf ! R2 R34      tgR# )4    )annotationsN)replace)Path)AnyCallableTypeVar)escape)AccountLockError)AccountAccountRegistryAccountRegistryKindRESERVED_SLUGSROUTING_RULES_FILENAMES)ClaudeAuthOperation)ClaudeHealthClient)DeviceAuthFlowDeviceAuthPromptDeviceAuthSessionterminate_process)ClaudeCodeEntryDialogDeviceAuthDialog)DeviceAuthOperation)GrokAuthOperation)GrokHealthClient)GatewayAccountStateLocalGatewayAccountManagergateway_account_state)MigrationError)AccountHealthClientAccountSnapshotHealthStatus)HealthSnapshotStore)QuotaNotificationStore)
load_rules)PopupWindow)CodexHealthAdapterCodexLifecycleAdapterProviderServiceMapProviderServices)runtime_dir)RefreshSchedulerdefault_idle_addstart_background_thread)TrayMenuItemTrayMenuItemKindformat_account_labelformat_title_part)AccountInputAlertKeyDashboardCallbacksDashboardVMProviderInputbuild_dashboard_vmCODEX_TRAY_APPINDICATOR_IDz
systray-aiCODEX_TRAY_ICON_NAMEzcodex-account-switcherCODEX_TRAY_ICON_WARNING_NAMEzcodex-account-switcher-warning!CODEX_TRAY_ICON_WARNING_LIVE_NAMEz#codex-account-switcher-warning-livez
Systray AIc                   V ^8  d   QhRR/#    returnztuple[Any, Any] )formats   "S/home/user/overdeck-private-tests/workstation-ai-broad/modules/systray/indicator.py__annotate__rC   C   s     % %? %    c                 h    ^ RI p V P                  RR4       V P                  RR4       ^ RIHpHp W!3# )r   NGtkz3.0AyatanaAppIndicator3z0.1)rG   rF   )girequire_versiongi.repositoryrG   rF   )rH   rG   rF   s      rB   _load_gtk_modulesrK   C   s2    ue$-u57$$rD   c                   V ^8  d   QhRR/# r>   r?   
Any | Noner@   )rA   s   "rB   rC   rC   M   s      : rD   c                      ^ RI p \        P                  ! RR\        R7       V P	                  RR4       ^ RIHp V#   \         d     R# i ; i)r   NignorezMGLib.unix_signal_add_full is deprecated; use GLibUnix.signal_add_full instead)messagecategoryGLibz2.0)rS   )rH   warningsfilterwarningsDeprecationWarningrI   rJ   rS   	Exception)rH   rS   s     rB   _load_glib_modulerX   M   sM    c'	

 	65)& s   := AA_Tc               $    V ^8  d   QhRRRRRR/# )r>   reset_atfloat | Nonenowfloatr?   boolr@   )rA   s   "rB   rC   rC   a   s!     4 4| 4% 4D 4rD   c                "    V RJ;'       d    W8*  # )zGA reading describes its window only until that window's reset boundary.Nr@   )r[   r]   s   &&rB   _expiredra   a   s    433HO3rD   c               (    V ^8  d   QhRRRRRRRR/# )r>   valuez	_T | Noner[   r\   r]   r^   r?   r@   )rA   s   "rB   rC   rC   f   s(     6 6i 6< 6e 6	 6rD   c                ,    \        W4      '       d   R # T # Nra   )rc   r[   r]   s   &&&rB   
_unexpiredrg   f   s    H**455rD   c               (    V ^8  d   QhRRRRRRRR/# )r>   used_pct
int | Noner[   r\   r]   r^   r?   r@   )rA   s   "rB   rC   rC   j   s,     6 66$067<66rD   c                8    V f   R# \        W4      '       d   ^ # T # )zMPast its boundary a window's counter has zeroed, so the whole window is free.Nrf   )ri   r[   r]   s   &&&rB   _percent_after_resetrl   j   s"     ''15X5rD   c                   V ^8  d   QhRR/# )r>   r?   r   r@   )rA   s   "rB   rC   rC   s   s      4 rD   c                     \        4       p  V P                  R R R7       V #   \         d>    \        \        P
                  ! 4       4      R,          pTP                  R R R7       Tu # i ; i)T)parentsexist_okzoverdeck-systray)r*   mkdirOSErrorr   tempfile
gettempdir)	directoryfallbacks     rB   _runtime_tray_dirrw   s   sa    It4 ++-.1CCtd3s   ! AA)(A)c                     ] tR t^~tRR R lltR R ltR R ltR R	 lt]R
 R l4       t	R R lt
R R ltR R ltR R ltR R ltR R ltR R lt]RRRR/R R ll4       t]R R  l4       t]R! R" l4       tR# R$ ltR% R& ltR' R( lt]R) R* l4       tR+ R, ltR- R. ltRR/ R0 lltR1 R2 ltRR3 R4 lltR5 R6 lt]R7R8/R9 R: ll4       tRR; R< llt]RR=R8R>RR7R/R? R@ lll4       t ]RA RB l4       t!RC RD lt"]RE RF l4       t#]RG RH l4       t$RI RJ lt%RK RL lt&RM RN lt'RO RP lt(RQ RR lt)RS RT lt*RU RV lt+RRW RX llt,^_t-RY RZ lt.R[ R\ lt/R] R^ lt0R_ R` lt1Ra Rb lt2Rc Rd lt3Re Rf lt4Rg Rh lt5Ri Rj lt6Rk Rl lt7Rm Rn lt8Ro Rp lt9Rq Rr lt:Rs Rt lt;Ru Rv lt<Rw Rx lt=Ry Rz lt>R{ R| lt?R} R~ lt@R R ltAR R ltBR R ltCR R ltDR R ltER R ltFR R ltGR R ltH]R R l4       tI]R R l4       tJR R ltKR R ltLR R ltMR R ltNR R ltOR R ltPR R ltQR R ltRR R ltSR R ltTRR R lltUR R ltVR R ltWRRRR/R R lltXRRRRRR/R R lltYRRRR/R R lltZR R lt[R R lt\R R lt]R R lt^R R lt_R R lt`R R ltaR R ltbR R ltcRR R lltdR R lteR R ltfR R ltgR R lthR R lti]R R l4       tjR R ltkR R ltlR R ltmR R ltnR R ltoR R ltpR R ltqR R ltrRR R lltsR R lttR R ltuR R ltvR R ltwR R ltxR R ltyR R ltzR R lt{Rt|R# )	IndicatorNc          0     x    V ^8  d   QhRRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR R!R"R#R$RR%R&/# )'r>   registryr   health_clientr   claude_registryAccountRegistry | Nonegrok_registryprovider_serviceszProviderServiceMap | None
gtk_modulerN   appindicator_moduledevice_auth_flowzDeviceAuthFlow | Nonedevice_auth_operationzDeviceAuthOperation | Nonedialog_factoryCallable[..., Any] | Noneidle_addthread_runnerz*Callable[[Callable[[], None]], Any] | Nonepopup_window_factorydashboard_factorysettings_dialog_factorylimits_dialog_factorysettings_storehealth_snapshot_storeHealthSnapshotStore | Noneclaude_health_snapshot_storequota_notification_storezQuotaNotificationStore | Nonefactory_status_loaderzCallable[[], Any] | Nonefactory_url_openerzCallable[[str], None] | None#factory_decision_notification_storer?   Noner@   )rA   s   "rB   rC   Indicator.__annotate__   s    S> S>!S> +S> 0	S>
 .S> 5S> S> (S> 0S>  :S> 2S> ,S> BS> 8S> 5S>  ";!S>"  9#S>$ #%S>&  :'S>( 'A)S>* #@+S>,  8-S>. 9/S>0 .81S>2 
3S>rD   c                	"  a  VS n         VS n        VS n        T;'       g    \        4       S n        T	;'       g    \        VS P                  4      S n        T;'       g     S P                  VVVVS P                  4      S n        S P                  P                  \        P                  4      P                  S n        S P                  \        P                  4      S n        S P                  \        P                   4      S n        T
;'       g    \$        S n        T;'       g    \(        S n        T;'       g    \,        S n        T;'       g    \0        S n        VS n        VS n        VS n        T;'       g    S P;                  4       S n        S P<                  P?                  4       S n         T;'       g    S PC                  4       S n"        T;'       g    S PG                  4       S n$        S PK                  4       S n&        T;'       g    \O        \Q        4       R ,          4      S n)        RS n*        \V        PV                  S n,        \[        S P*                  S P.                  V 3R lR7      S n.        RS n/        RS n0        RS n1        RS n2        RS n3        / S n4        \k        4       S n6        RS n7        RS n8        \Q        4       S n9        \t        S n;        S Pr                  S Pv                   R2,          S n<        / S n=        / S n>        / S n?        / S n@        R# )zquota_notifications.jsonNc                 $   < S P                  4       # re   )_timeselfs   rB   <lambda>$Indicator.__init__.<locals>.<lambda>   s    DJJLrD   )r   r   time_fnFz.svg)Ar|   _gtk_appindicatorr   _device_auth_flowr   _device_auth_operation_build_provider_services_provider_servicesfor_toolr   CODEXr{   _provider_registryCLAUDEr}   GROKr   r   _dialog_factoryr,   	_idle_addr-   _thread_runnerr%   _popup_window_factory_dashboard_factory_settings_dialog_factory_limits_dialog_factory_default_settings_store_settings_storeread	_settings_default_health_store_health_store_default_claude_health_store_claude_health_store_default_grok_health_store_grok_health_storer#   rw   _quota_notification_store_glibtimer   r+   
_scheduler	indicatormenupopup
_dashboard_health_timer_id	snapshotsset_dismissed_alert_keys_icon_warning_active_warning_icon_remaining_warning_icon_theme_pathAPPINDICATOR_ICON_WARNING_LIVE_warning_icon_name_warning_icon_pathlast_fetched_menu_items_busy_actions_provider_busy_actions)r   r{   r|   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   f&&&&&&&&&&&&&&&&&&&&&&&rB   __init__Indicator.__init__   s   4 +	0!1!E!E^5E&; '
 '
?R""@
# #4 #
 #
t7T7T''8
 //889L9R9RS\\#667J7Q7QR!445H5M5MN-AA1A!55%5+FF/F%9%H%H[""3(?%&;#-OO1M1M1O--2242RRd6P6P6R(OOD,M,M,O 	! #'"A"A"C)A *
 *
E["<<F
& "&
*.))
*^^--(

 &* $	!%
&*,05747E"*/!37$.?.A%'E(,(E(E4KbKbJccgHh(h.0+-24;=#rD   c                   V ^8  d   QhRR/# r>   r?   r   r@   )rA   s   "rB   rC   r      s      t rD   c                	  a  S P                  4       w  rVP                  P                  \        \        VP
                  P                  4      S n        S P                  P                  VP                  P                  4       \        S P                  R 4      '       d"    S P                  P                  RV 3R l4       S P                  4        S P                  4        S P!                  4        S P#                  RR7       S P%                  4       pVeL   \        VR4      '       d8   VP'                  S P(                  P*                  S P,                  4      S n        R# R# R#   \         d     Li ; i)connectactivatec                 $   < SP                  4       # re   )_toggle_popup_argsr   s   *rB   r   !Indicator.build.<locals>.<lambda>   s    $BTBTBVrD   TforceNtimeout_add_seconds)_modulesry   newAPPINDICATOR_IDAPPINDICATOR_ICONIndicatorCategoryAPPLICATION_STATUSr   
set_statusIndicatorStatusACTIVEhasattrr   rW   _load_health_cache_rebuild_menu_update_title_refresh_all_glib_moduler   r   refresh_interval_seconds_refresh_all_timerr   )r   gtkappindicatorglibs   f   rB   buildIndicator.build   s&    MMO%//33**==

 	!!,">">"E"EF4>>9--&&z3VW 	!%  ".C D D$($<$<779P9P%D! !E  s    E! !E/.E/c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r      s      T rD   c                	J    V P                  4       w  rVP                  4        R # re   )r   main)r   r   r   s   &  rB   runIndicator.run   s    !]]_
rD   c                   V ^8  d   QhRR/# r=   r@   )rA   s   "rB   rC   r      s     - -/ -rD   c                	    V P                   e   V P                  f   \        4       w  V n         V n        V P                   V P                  3# re   )r   r   rK   r   s   &rB   r   Indicator._modules   s>    99 2 2 :,=,?)DIt)yy$,,,,rD   c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r>   r{   r   r|   r   r}   r~   r   r   r   r?   r(   r@   )rA   s   "rB   rC   r      sD     !- !-!!-*!- 0!- .	!-
  3!- 
!-rD   c           	     	|   \        \        P                  V \        V4      \	        V4      R 7      .pVe>   VP                  \        \        P                  V\        V4      \        4       R 7      4       Ve>   VP                  \        \        P                  V\        V4      \        4       R 7      4       \        V4      # ))toolr{   	lifecyclehealth)r)   r   r   r'   r&   appendr   r   r   r   r   r   r(   )r{   r|   r}   r   r   	providerss   &&&&& rB   r   "Indicator._build_provider_services   s     (..!/0EF)-8	
	 & ,33,1/B-/	 $ ,11*/>+-	 "),,rD   c                    V ^8  d   QhRRRR/# )r>   r   r   r?   r~   r@   )rA   s   "rB   rC   r     s      ': ?U rD   c                	r     V P                   P                  V4      P                  #   \         d     R # i ; ire   )r   r   r{   LookupError)r   r   s   &&rB   r   Indicator._provider_registry  s6    	**33D9BBB 		s   $' 66c                   V ^8  d   QhRR/# )r>   r?   ztuple[ProviderServices, ...]r@   )rA   s   "rB   rC   r     s        8  rD   c                	   . p\         P                  \         P                  \         P                  3 F.  p VP	                  V P
                  P                  V4      4       K0  	  \        V4      #   \         d     KK  i ; ire   )	r   r   r   r   r  r   r   r  tuple)r   r  r   s   &  rB   
_providersIndicator._providers  ss    ,.	%%&&$$
D
  !8!8!A!A$!GH
 Y  s   *A//A>=A>c                   V ^8  d   QhRR/# )r>   r?   *dict[str, tuple[Account, AccountRegistry]]r@   )rA   s   "rB   rC   r   +  s     	 	!K 	rD   c           	     	    / pV P                  4        FW  pTP                  VP                  P                  4        Uu/ uF   pV P	                  V4      W2P                  3bK"  	  up4       KY  	  V# u upi re   )r  updater{   list_account_key)r   lookupprovideraccounts   &   rB   _account_lookupIndicator._account_lookup+  su    =?)HMM $,#4#4#9#9#;#; %%g.:K:K0LL#; * s   &A0
c                   V ^8  d   QhRR/# )r>   r?   tuple[TrayMenuItem, ...]r@   )rA   s   "rB   rC   r   6  s      #; rD   c           	     	:   V P                  4       p\        V4      ^8X  d   V^ ,          pV P                  V4      pV'       d    VP                  V P	                  4       4       VP                  V P                  RRR7      4       VP                  V P                  RV P                  V4      4      4       VP                  V P                  RRR7      4       \        V4      # V Uu. uF=  pV P                  V P                  VP                  4      V P                  V4      4      NK?  	  ppVP                  V P	                  4       4       VP                  V P                  RRR7      4       VP                  V P                  RRR7      4       \        V4      # u upi )   zOpen dashboardopen_dashboard)actionManage accountsQuitquit)r  len_provider_account_itemsr  
_separator_action_item_submenu_item_manage_itemsr  _provider_labelr   _provider_menu)r   r  r  itemss   &   rB   _build_menu_itemsIndicator._build_menu_items6  s[   OO%	y>Q |H00:ET__./LL**+;DT*UVLL++,=t?Q?QRZ?[\]LL**6&*AB< &%
% t33HMMBDDWDWX`Dab% 	 %
 	T__&'T&&'7@P&QRT&&vf&=>U|%
s   %AFc                    V ^8  d   QhRRRR/# r>   r  r)   r?   r  r@   )rA   s   "rB   rC   r   K  s      '7 <T rD   c                	    V P                  V4      pV'       d    VP                  V P                  4       4       VP                  V P                  R V P	                  V4      4      4       \        V4      # )r   )r$  r  r%  r'  r(  r  )r   r  r+  s   && rB   r*  Indicator._provider_menuK  sW    ,,X6LL*+T''(94;M;Mh;WXYU|rD   c                    V ^8  d   QhRRRR/# )r>   r  r)   r?   zlist[TrayMenuItem]r@   )rA   s   "rB   rC   r   R  s      0@ EW rD   c                	J   . pVP                   P                  4       pVP                   P                  4        F  pV P                  VP                   VP                  4      pV P                  V4      '       d+   V P                  P                  V P                  V4      4      MR pV P                  VVV P                  V4      V P                  4       VR7      pVP                  \        \        P                  VVP                  V8H  V'       * VP                  R7      4       K  	  V# )Nshow_healthr]   locked)kindlabelactive	sensitiveaccount_key)r{   default_slugr  _account_is_lockedslug_show_health_in_menur   getr  _account_labelr   r  r.   r/   RADIOtray_key)r   r  r+  r<  r  r6  snapshotr8  s   &&      rB   r$  !Indicator._provider_account_itemsR  s   $&((557((--/G,,X->->MF ,,W55 ""4#4#4W#=> 
 '' 55g>JJL ( E LL)//"<<<7"(j ' 0 0 0. rD   c                    V ^8  d   QhRRRR/# r/  r@   )rA   s   "rB   rC   r   n  s      e e&6 e;S erD   c                	   V P                  R RVP                  P                   2V P                  VP                  P                  R4      '       * R7      .pVP                  P                  4       pV'       d    VP                  V P                  4       4       VP                  P                  4       pV EF.  pV P                  V4      pV P                  VP                  VP                  4      p\        V4      p. p	V\        P                  J dY   T	P                  T P                  RVP                   R2RTV'       * ;'       d    V P!                  VR4      '       * R7      4       EMV\        P"                  J d   T	P%                  T P                  R	VP                   2R
TV'       * ;'       d    V P!                  VR4      '       * R7      V P                  RVP                   2RVV P!                  VR4      '       * R7      .4       MzT	P                  T P                  V\        P&                  J d   RVP                   R2MRVP                   R2RTV'       * ;'       d    V P!                  VR4      '       * R7      4       TP%                  T P                  V'       d   RMR RVP                   2RVV P!                  VR4      '       * R7      T P                  RVP                   2RTVP                  V8g  ;'       d    V'       * R7      T P                  RVP                   2RTV'       * ;'       d    V P!                  VR4      '       * R7      T P                  RVP                   R2RTV'       * ;'       d    V P!                  VR4      '       * R7      V P                  RVP                   R2R VR!7      V P                  R"VP                   R2R#VR!7      .V	O4       EK1  	  \)        V4      # )$u   Add account…add_account:add_account)r  r:  zMove u    to Gateway…gateway_migrategateway)r  r;  r:  zActivate Gateway for gateway_activatezCancel Gateway migration for gateway_cancelzContinue return of u    to native…zReturn gateway_rollbackreauthenticateUnlockLock toggle_account_lockaccount_lockzSet default set_defaultzReload reload_accountreloadzRe-authenticate u   …repair_accountzRename rename_account)r  r;  zRemove remove_account)r&  r   rc   _provider_action_busyr{   r  r  r%  r<  r  r=  r>  r   r   NATIVEalias_account_action_busyTESTINGextendPAUSEDr  )
r   r  r+  accountsr<  r  keyr6  stategateway_itemss
   &&        rB   r(  Indicator._manage_itemsn  s    %hmm&9&9%:;"889L9Lm\\  %
 $$))+LL*+((557G##G,C,,X->->MF)'2E02M+222$$%%n=0$'&,*"b"bT5N5NwXa5b1b	 &  -555$$))3GMM?C#5(+*0j&f&f9R9RSZ\e9f5f	 *  ));GMM?K#3(+*.*C*CGY*W&W	 * " $$%%  %(;(B(BB 2'--N#*7==/!G1$'&,*"i"iT5N5NwXh5i1i & 	 LL%%'-86:!GMM?K4$'&*&?&?&X"X	 &  %%&w}}o6,$'"),,,">"M"Mv:	 &  %%!'--1/$' &J Q Q$($=$=gx$P P &  %%*7==/=/$' &J Y Y$($=$=gGW$X X &  %%!'--4/$' & 
 %%!'--4/$' & I*R #S*,Y  r U|rD   r;  r:  Tc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r>   r8  strr  r;  
str | Noner:  r_   r?   r.   r@   )rA   s   "rB   rC   r     s<     
 

 
  	

 
 

rD   c               	>    \        \        P                  V VVVR 7      # ))r7  r8  r  r;  r:  )r.   r/   ACTION)r8  r  r;  r:  s   &$$$rB   r&  Indicator._action_item  s&     !((#
 	
rD   c               $    V ^8  d   QhRRRRRR/# )r>   r8  rh  childrenr  r?   r.   r@   )rA   s   "rB   rC   r     s"     
 
S 
,D 
 
rD   c                	:    \        \        P                  V VR 7      # ))r7  r8  rn  )r.   r/   SUBMENU)r8  rn  s   &&rB   r'  Indicator._submenu_item  s    !))
 	
rD   c                   V ^8  d   QhRR/# )r>   r?   r.   r@   )rA   s   "rB   rC   r     s     = = =rD   c                 	6    \        \        P                  R 7      # ))r7  )r.   r/   	SEPARATORr@   rD   rB   r%  Indicator._separator  s    !1!;!;<<rD   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r>   r   r   r   r+  r  account_lookupr  r?   r   r@   )rA   s   "rB   rC   r     s=     ! !! ! (	!
 C! 
!rD   c                	    R pV FO  pV P                  WWE4      pVP                  V4       VP                  \        P                  8X  g   KG  Ve   KM  TpKQ  	  R # re   )_render_menu_itemr  r7  r/   rB  )r   r   r   r+  rw  groupitemrendereds   &&&&&   rB   _append_rendered_menu_items%Indicator._append_rendered_menu_items  sM     D--cOHKK!yy,222u} 	 rD   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# )
r>   r   r   r{  r.   rw  r  rz  rN   r?   r@   )rA   s   "rB   rC   r     s=     + ++ + C	+
 + 
+rD   c                	   VP                   \        P                  8X  d   VP                  4       # VP                   \        P                  8X  d   VP                  VP                  R 7      pVP                  4       pV P                  WVP                  V4       VP                  V4       \        VR4      '       d   VP                  VP                  4       V# VP                   \        P                  8X  Ed   VP                  VP                  R 7      pVe   VP!                  V4       VP"                  e   VP%                  VP"                  4      pVek   Vw  rVP'                  RV P)                  W4      4      p
VP*                  '       d4   VP-                  V
4       VP/                  R4       VP1                  V
4       WPP2                  VP"                  &   \        VR4      '       d   VP                  VP                  4       V# V P5                  W#4      pVP                  VP                  R 7      pVe   VP'                  RV4       \        VR4      '       d   VP                  VP                  4       V# )r8  set_sensitiver   T)r7  r/   rt  SeparatorMenuItemrp  MenuItemr8  Menur}  rn  set_submenur   r  r:  rB  RadioMenuItem
join_groupr;  r@  r   _make_activate_handlerr9  handler_block
set_activehandler_unblockr   _menu_action_callback)r   r   r{  rw  rz  	menu_itemsubmenuaccount_stater  r{   handlecallbacks   &&&&&       rB   ry  Indicator._render_menu_item  s    99(222((**99(0004::6IhhjG,,S4==.Y!!'*y/22''799(...))

);I $$U++ . 2 243C3C D ,(5%G&..z4;V;VW^;ijF{{{!//7!,,T2!11&95>  !1!12y/22''7--dCLLtzzL2	j(39o..##DNN3rD   c               $    V ^8  d   QhRRRRRR/# )r>   r{  r.   rw  r  r?   r   r@   )rA   s   "rB   rC   r   ,  s)     & && C& 
#	&rD   c                	  a  VP                   R 8X  d   V 3R l# VP                   R8X  d   V 3R l# VP                   eN   VP                   P                  R4      '       d-   VP                   P                  R^4      ^,          pV3V 3R ll# VP                  f   R# VP	                  VP                  4      pVf   R# Vw  rVVP                   R8X  d
   V3V 3R	 ll# VP                   R
8X  d
   V3V 3R ll# VP                   R8X  d
   V3V 3R ll# VP                   R8X  d
   V3V 3R ll# VP                   R8X  d
   V3V 3R ll# VP                   R8X  d
   V3V 3R ll# VP                   R8X  d
   V3V 3R ll# VP                   R8X  d
   V3V 3R ll# VP                   R8X  d
   V3V 3R ll# VP                   R8X  d
   V3V 3R ll# R# )r"  c                N   < SP                  4       ^ ,          P                  4       # )r   )r   	main_quit_itemr   s   &rB   r   1Indicator._menu_action_callback.<locals>.<lambda>2  s    !3!=!=!?rD   r  c                $   < SP                  4       # re   )_open_popupr  s   &rB   r   r  4  s    !1!1!3rD   NrH  :c                &   < SP                  V4      # re    _prompt_and_add_account_for_tool)r  r   r   s   &&rB   r   r  7  s    D,Q,QRV,WrD   rS  c                &   < SP                  V4      # re   )_toggle_account_lockr  r  r   s   &&rB   r   r  ?      $2K2KG2TrD   rU  c                &   < SP                  V4      # re   )_set_default_accountr  s   &&rB   r   r  A  r  rD   rV  c                &   < SP                  V4      # re   )_refresh_accountr  s   &&rB   r   r  C  s    $2G2G2PrD   rX  c                &   < SP                  V4      # re   _repair_accountr  s   &&rB   r   r  E      $2F2Fw2OrD   rY  c                &   < SP                  V4      # re   )_rename_accountr  s   &&rB   r   r  G  r  rD   rZ  c                &   < SP                  V4      # re   )_remove_accountr  s   &&rB   r   r  I  r  rD   rJ  c                &   < SP                  V4      # re   )_migrate_account_to_gatewayr  s   &&rB   r   r  K  s    $2R2RSZ2[rD   rL  c                &   < SP                  V4      # re   )_activate_gateway_accountr  s   &&rB   r   r  M      $2P2PQX2YrD   rM  c                &   < SP                  V4      # re   )_cancel_gateway_migrationr  s   &&rB   r   r  O  r  rD   rN  c                &   < SP                  V4      # re   )_return_account_to_nativer  s   &&rB   r   r  Q  r  rD   )r  
startswithsplitr;  r@  )r   r{  rw  r   r  r  	_registrys   f&&    rB   r  Indicator._menu_action_callback,  s   
 ;;& ??;;**33;;"t{{'='=n'M'M;;$$S!,Q/D&*WW#&**4+;+;< *;;//)0TT;;-')0TT;;**)0PP;;**)0OO;;**)0OO;;**)0OO;;++)0[[;;,,)0YY;;**)0YY;;,,)0YYrD   c                    V ^8  d   QhRRRR/# )r>   r{   r~   r?   rh  r@   )rA   s   "rB   rC   r   U  s      !7 C rD   c                	z    \        V R R4      p\        VRR4      p\        V\        4      '       d   V'       d   V# R# )r7  Nrc   codex)getattr
isinstancerh  )r{   r7  r   s   &  rB   _registry_toolIndicator._registry_toolT  s5    x.tWd+dC  TKrD   c                    V ^8  d   QhRRRR/# )r>   r  r   r?   rh  r@   )rA   s   "rB   rC   r   \  s        G    rD   c                	    VP                   # re   )rC  r   r  s   &&rB   r  Indicator._account_key\  s    rD   c               (    V ^8  d   QhRRRRRRRR/# )r>   r   rh  r>  new_slugr?   r   r@   )rA   s   "rB   rC   r   _  s(     4 4S 4 4s 4t 4rD   c                	    V R V 2pV R V 2pV P                   V P                  3 F  pWF9   g   K  VP                  V4      We&   K   	  R# )r  N)r   r   pop)r   r   r>  r  old_keynew_keystores   &&&&   rB   _rekey_snapshotsIndicator._rekey_snapshots_  sQ    F!D6"F!H:&nnd&7&78E!&7!3 9rD   c               $    V ^8  d   QhRRRRRR/# )r>   r   dict[str, AccountSnapshot]r{   r~   r?   r@   )rA   s   "rB   rC   r   f  s(     	 	-	 )	 
$		rD   c                	    / pV P                  V4      pVP                  4        F  w  rVYcR V9   d   TMV R V 2&   K  	  V# )r  )r  r+  )r   r   r{   
normalizedr   rc  rD  s   &&&    rB   _normalize_snapshot_keys"Indicator._normalize_snapshot_keysf  sL    
 24
""8,&__.MCAIcSjsauo> /rD   c                    V ^8  d   QhRRRR/# )r>   r{   r~   r?   r  r@   )rA   s   "rB   rC   r   q  s     	
 	
-C 	
Hb 	
rD   c                	^   Vf   / # V P                  V4       R2pVP                  4        Uu0 uF  q0P                  V4      kK  	  ppV P                  P	                  4        UUu/ uF5  w  rVVP                  V4      '       g   K  WT9   g   K&  V\        V4      R  VbK7  	  upp# u upi u uppi )Nr  )r  r  r  r   r+  r  r#  )r   r{   prefixr  active_keysrc  rD  s   &&     rB   _bare_slug_snapshotsIndicator._bare_slug_snapshotsq  s    I''12!4AIQg((1Q "&!5!5!7
!7~~f% (*-*< (CFx'!7
 	
 R
s   B$%B)B)B)c                    V ^8  d   QhRRRR/# )r>   r  r   r{   r~   r@   )rA   s   "rB   rC   r   |  s      g AW rD   c                	"   a aa R  VVV 3R llpV# )c                    V ^8  d   QhRRRR/# )r>   r{  r   r?   r   r@   )rA   s   "rB   rC   6Indicator._make_activate_handler.<locals>.__annotate__}  s     	/ 	/c 	/d 	/rD   c                  < V P                  4       '       g   R # S;'       g    SP                  pSP                  VSP                  4      '       d2   SP	                  RSP
                   R24       SP                  4        R # SP                  P                  SP                  S4      4      pVSP                  J d7   Ve3   VP                  \        P                  8X  d   SP                  S4       R # SP                  S4       R # )NAccount 
 is locked)
get_activer{   r=  r>  _notifyr]  r   r   r@  r  statusr!   BROKENr  r  )r{  target_registryrD  r  r{   r   s   &  rB   on_activate5Indicator._make_activate_handler.<locals>.on_activate}  s    ??$$&77$--O&&EExjAB""$~~))$*;*;G*DEH4==0(OO|':'::$$W-%%g.rD   r@   )r   r  r{   r  s   fff rB   r   Indicator._make_activate_handler|  s    	/ 	/$ rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r     s     E Et ErD   c                	8   V P                   f   R # V P                  V P                  4      pT P                  RTVR J;'       d'    V P	                  V P                  VP
                  4      R7      pV P                  f   V P                   P                  V4       R # V P                  V P                  4      pT P                  RTVR J;'       d'    V P	                  V P                  VP
                  4      R7      pV P                   P                  V RV 24       R # )NCodexr6  Claudeu    · )r   _default_accountr{   _title_partr=  r>  r}   	set_title)r   codex_defaultcodex_titleclaude_defaultclaude_titles   &    rB   r   Indicator._update_title  s   >>!--dmm<&&T) O O++DMM=;M;MN ' 
 'NN$$[1..t/C/CD''d* W W++D,@,@.BUBUV ( 
 	  K=\N!CDrD   r6  Fc               (    V ^8  d   QhRRRRRRRR/# )r>   r8  rh  r  Account | Noner6  r_   r?   r@   )rA   s   "rB   rC   r     s6     @ @@@ 	@
 
@rD   c               	    \        WVR 7      # )r  )r1   )r8  r  r6  s   &&$rB   r  Indicator._title_part  s     !??rD   c                    V ^8  d   QhRRRR/# )r>   r{   r~   r?   r  r@   )rA   s   "rB   rC   r     s      )? > rD   c                	    T;'       g    V P                   pVP                  4       pVf   R # VP                  4        F  pVP                  V8X  g   K  Vu # 	  R # re   )r{   r<  r  r>  )r   r{   r  r<  r  s   &&   rB   r  Indicator._default_account  sS    "33dmm&335&++-G|||+ . rD   r5  r]   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r>   r  r   rD  AccountSnapshot | Noner5  r_   r]   r\   r6  zbool | Noner?   rh  r@   )rA   s   "rB   rC   r     sD     
 

(
 	

 
 
 

rD   c               	"    \        V VVVVR 7      # )r4  )r0   )r  rD  r5  r]   r6  s   &&$$$rB   rA  Indicator._account_label  s      $#
 	
rD   c               $    V ^8  d   QhRRRRRR/# )r>   r{   r   r>  rh  r?   r_   r@   )rA   s   "rB   rC   r     s!      _ C D rD   c                	    \        V R R4      p\        V4      '       g   R#  \        V! V4      4      #   \        \        3 d*   p\        RT 2\        P                  R7        Rp?R# Rp?ii ; i)	is_lockedNFz,systray-ai: account lock state unavailable: fileT)r  callabler_   r
   rr   printsysstderr)r{   r>  checkerexcs   &&  rB   r=  Indicator._account_is_locked  s`    (K6  	&& '* 	@FSZZX	s   3 A-A((A-c                    V ^8  d   QhRRRR/# )r>   r  r   r?   r_   r@   )rA   s   "rB   rC   r     s      G  rD   c                	    R # )Tr@   r  s   &&rB   r?  Indicator._show_health_in_menu  s    rD   c                    V ^8  d   QhRRRR/# )r>   r   zAccountRegistryKind | strr?   rh  r@   )rA   s   "rB   rC   r     s      7 C rD   c                	r    \        V \        4      '       d   V P                  MT pVR 8X  d   R# VR8X  d   R# R# )claudezClaude CodegrokGrokr  )r  r   rc   )r   r  s   & rB   r)  Indicator._provider_label  s3    #-d4G#H#HTZZd
! rD   c                    V ^8  d   QhRRRR/# )r>   rQ   rh  r?   r   r@   )rA   s   "rB   rC   r     s        rD   c                	j     \         P                  ! R \        V .RR7       R#   \         d     R# i ; i)znotify-sendFcheckN)
subprocessr   APP_DISPLAY_NAMEFileNotFoundError)rQ   s   &rB   r  Indicator._notify  s5    	NN 0': ! 		s   # 22c               $    V ^8  d   QhRRRRRR/# )r>   r  r   r  rh  r?   r_   r@   )rA   s   "rB   rC   r     s&     S SG SS ST SrD   c                	l    W P                   P                  V P                  V4      \        4       4      9   # re   )r   r@  r  r   )r   r  r  s   &&&rB   r^  Indicator._account_action_busy  s+    ++//0A0A'0JCERRRrD   c               $    V ^8  d   QhRRRRRR/# )r>   r   rh  r  r?   r_   r@   )rA   s   "rB   rC   r     s&     F F# Fs Ft FrD   c                	N    W P                   P                  V\        4       4      9   # re   )r   r@  r   )r   r   r  s   &&&rB   r[  Indicator._provider_action_busy  s     4488suEEErD   c               (    V ^8  d   QhRRRRRRRR/# )	r>   r  r   r  rh  busyr_   r?   r   r@   )rA   s   "rB   rC   r     s)     	0 	0 	0 	0D 	0UY 	0rD   c                	0   V P                  V4      pV P                  P                  V\        4       4      pV'       d   VP	                  V4       M5VP                  V4       V'       g   V P                  P                  VR 4       V P                  V4       R # re   )r  r   
setdefaultr   adddiscardr  _update_dashboard_account)r   r  r  r)  rc  actionss   &&&&  rB   _set_account_action_busy"Indicator._set_account_action_busy  sn    ($$//SU;KKOOF#""&&sD1&&w/rD   c               (    V ^8  d   QhRRRRRRRR/# )r>   r   rh  r  r)  r_   r?   r   r@   )rA   s   "rB   rC   r     s(     & &c &3 &d &t &rD   c                	   V P                   P                  V\        4       4      pV'       d   VP                  V4       M5VP	                  V4       V'       g   V P                   P                  VR 4       V P                  4        R # re   )r   r+  r   r,  r-  r  _rebuild_popup_if_open)r   r   r  r)  r/  s   &&&& rB   _set_provider_action_busy#Indicator._set_provider_action_busy  s\    --88suEKKOOF#++//d;##%rD   c                    V ^8  d   QhRRRR/# r>   r  r   r?   r   r@   )rA   s   "rB   rC   r     s     (C (CG (C (CrD   c           	     	8   V P                   P                  V4      P                  pV P                  W!P                  4      pV'       d   V P                  4       w  rEVP                  R ^ VP                  P                  VP                  P                  RVP                   R2R7      p\        VR4      '       d   VP                  R4       VP                  4       pVP                  4        WtP                   P"                  8w  d   R #  VP%                  VP                  V'       * 4       T P3                  4        T P5                  4        T P7                  4        T P9                  4        T'       g   RMRp	T'       g   R	MR
p
T P/                  RTP                   RT	 RT
 24       R #   \&        \(        \*        3 d^   pT P-                  T4       T P/                  T P1                  RT4      4       T P3                  4        T P5                  4         R p?R # R p?ii ; i)NzUnlock account ?transient_forflagsmessage_typebuttonstextformat_secondary_textz=Agents and commands may select this account for new sessions.zCould not change account lockr6  unlockedzNew sessions are blocked.zNew sessions may use it again.r  rR  z. )r   for_accountr{   r=  r>  r   MessageDialogMessageTypeQUESTIONButtonsTypeYES_NOr]  r   rA  r   destroyResponseTypeYES
set_lockedKeyErrorrr   RuntimeError_log_exceptionr  _failure_messager   r4  r   _update_warning_icon)r   r  r{   r6  r   r   dialogresponser  rd  details   &&         rB   r  Indicator._toggle_account_lock  s   **66w?HH((<<@!%C&&" __55..&w}}oQ7 ' F v677,,S zz|HNN++///	&j9 	##%!!# &J  (1 	
 	xawbAB# '<0 	$LL../NPSTU '')	s   !F& &H<AHHc                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r   5  s     @ @G @ @rD   c                	   V P                   P                  V4      P                  pV P                  W!P                  4      '       dB   V P                  R VP                   R24       V P                  4        V P                  4        R#  VP                  V4       T P                  4        T P                  4        T P                  4        T P                  4        T P                  RTP                   24       R#   \         dF   pT P                  \        T4      4       T P                  4        T P                  4         Rp?R# Rp?ii ; i)r  r  NzDefault account set to )r   rC  r{   r=  r>  r  r]  r   r4  rU  r
   rh  r   rQ  )r   r  r{   r  s   &&  rB   r  Indicator._set_default_account5  s   **66w?HH""8\\::LL8GMM?*=> '')	  ) 	##%!!#.w}}o>?   	LLS" '')		s   	C: :E
:EE
c                    V ^8  d   QhRRRR/# )r>   rD  r    r?   r@   )rA   s   "rB   rC   r   I  s      O  rD   c           	     	j   V P                  4       p\        V\        VP                  VP                  V4      \        VP
                  VP                  V4      R 7      pVP                  \        P                  8X  d8   VP                  f   VP
                  e   \        V\        P                  R7      # V# ))primary_used_pctsecondary_used_pct)r  )r   r   rl   r[  primary_reset_atr\  secondary_reset_atr  r!   UNKNOWNOK)r   rD  r]   s   && rB   _breach_evaluation_snapshot%Indicator._breach_evaluation_snapshotI  s    jjl1))8+D+Dc  4++X-H-H# 
 OO|333))5..: 8LOO<<rD   c               (    V ^8  d   QhRRRRRRRR/# )	r>   r  r   merged_snapshotr    previous_snapshotr  r?   r   r@   )rA   s   "rB   rC   r   ^  s2     *$ *$*$ )*$ 2	*$
 
*$rD   c                	   V P                   P                  V4      P                  pVP                  4       VP                  8w  d   R # V P                  V4      pV P                  V4      pVP                  \        P                  8w  d   R # \        P                  VP                  V'       d   VP                  MR V P                  P                  3\        P                  VP                   V'       d   VP                   MR \        P"                  33 EF  w  rxrVf   K  ^d\%        \'        V^ 4      ^d4      ,
          p\        P(                  ! W4      '       de   V P*                  P-                  WW4      '       dB   V P/                  VP0                  P3                  4        RVP4                   RV RV R24       K  K  W8  g   K  V P*                  P7                  WW4      '       g   K  V P/                  VP0                  P3                  4        RVP4                   RV
 RV RV R2
4       EK  	  V P9                  W4       V P;                  4        R # )	N
 account 'z' u    limit reset — z% availablez' is under z% remaining on its z limit (z% left))r   rC  r{   r<  r>  r  ra  r  r!   r`  limit_warning	WINDOW_5Hr[  r   warning_threshold_pct	WINDOW_7Dr\  SEVEN_DAY_WARNING_THRESHOLD_PCTminmaxwindow_resetr   record_warning_resetr  r   
capitalizer]  record_warning_check_quota_lifecyclerQ  )r   r  rd  re  r{   rc  	evaluatedwindowri   previous_used_pct	threshold	remainings   &&&&        rB   _check_limit_warningIndicator._check_limit_warning^  s    **66w?HH  "gll2(44_E	|. ''**6G!22T44	 '',,8I!44t==	?
:F/ c#h"2C88I))*;FF11FFsSSLL"<<2245ZbQWPX Y%%.K{< T
 &4+I+I+X+XY\+e+e||..01GMM?+ k!4VHHYKwX1?
8 	##G7!!#rD   c               $    V ^8  d   QhRRRRRR/# )r>   r  r   rD  r    r?   r   r@   )rA   s   "rB   rC   r     s"      g  UY rD   c           	     	   R VP                   VP                  3RVP                  VP                  33 F  w  r4pVe   Vf   K  \	        V4      pV^d8  dr   V P
                  P                  V P                  V4      W64      '       d?   V P                  VP                  P                  4        RVP                   RV R24       K  K  W@P                  8:  g   K  V P
                  P                  V P                  V4      W64       K  	  R# )5h7dNrg  z' has 0% left on its z limit)r[  r]  r\  r^  rh  r   record_exhaustionr  r  r   rq  r]  QUOTA_REARM_USED_PCTrecord_reset)r   r  rD  ru  ri   r[   reset_cycles   &&&    rB   rs   Indicator._check_quota_lifecycle  s    8,,h.G.GH8..0K0KL+
&Fh 8#3h-K311CC%%g.  LL"<<2245ZNcdjckkqr 666..;;%%g.+
rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r     s     9 9d 9rD   c                	    V P                   f   R # V P                  4       pVR JpW P                  8w  d   V'       dt   \        V P                   R4      '       dW   V P	                  V4      pV P                  VP                  4       V P                   P                  V P                  RV R24       M@\        V P                   R4      '       d%   V P                   P                  \        \        4       W n        Wn        R # V'       d   WP                  8w  ds   \        V P                   R4      '       dW   V P	                  V4      pV P                  VP                  4       V P                   P                  V P                  RV R24       Wn        R # )Nset_icon_fullzUsage limit warning (!) z% left)r   _warning_icon_remaining_pctr   r   _render_warning_icon_set_indicator_icon_themeparentr  r   r   r  r   )r   warning_remainingwarning_active	icon_paths   &   rB   rQ  Indicator._update_warning_icon  sN   >>! <<>*$66664>>?;; $ 9 9:K LI2293C3CDNN00//23D2EVL
 4>>?;;NN001BDTU(6%+<(/3O3OOT[NNOU
 U
 112CDI**9+;+;<NN((''*+<*=VD (9$rD   c                   V ^8  d   QhRR/# )r>   r?   rj   r@   )rA   s   "rB   rC   r     s     % %Z %rD   c           
     	   . pV P                   V P                  V P                  3 Uu. uF  pVf   K	  VNK  	  ppV EF(  pV P                  V4      pVf   K  V P                  P                  V P                  V4      4      pVf   KK  V P                  V4      p\        P                  ! V4      p\        P                  V9   dE   VP                  e7   VP                  ^d\        \        VP                  ^ 4      ^d4      ,
          4       \        P                  V9   g   K  VP                   f   K  VP                  ^d\        \        VP                   ^ 4      ^d4      ,
          4       EK+  	  V'       g   R # \        V4      # u upi re   )r{   r}   r   r  r   r@  r  ra  rh  breached_windowsri  r[  r  rm  rn  rk  r\  )r   remaining_valuesr{   
registriesr  rD  rt  breacheds   &       rB   r  %Indicator._warning_icon_remaining_pct  sO   &( "]]D,@,@$BTBTU
U HU 	 

 #H++H5G~~))$*;*;G*DEH88BI$55i@H&&(2y7Q7Q7] ''c#i6P6PRS2TVY.Z(Z[&&(2y7S7S7_ ''c#i6R6RTU2VX[.\(\] #  #$$)
s
   E?E?c                    V ^8  d   QhRRRR/# )r>   remaining_pctintr?   r   r@   )rA   s   "rB   rC   r     s     ' '# '$ 'rD   c                	    \        V R 24      pV^
8  d   RMRpV^
8  d   RMRpRV RV RV R2pV P                  P                  VR	R
7       V P                  # )%g      /@g      1@z4.6z6.2a  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
  <path fill="#8ab4f8" d="M12 2 L13.8 9.2 L21 11 L13.8 12.8 L12 20 L10.2 12.8 L3 11 L10.2 9.2 Z"/>
  <path fill="#8ab4f8" d="M19 2 L19.7 4.3 L22 5 L19.7 5.7 L19 8 L18.3 5.7 L16 5 L18.3 4.3 Z"/>
  <path fill="#8ab4f8" d="M5 15 L5.6 17 L7.5 17.6 L5.6 18.2 L5 20.2 L4.4 18.2 L2.5 17.6 L4.4 17 Z"/>
  <circle cx="17.6" cy="6.4" r="4.2" fill="#dc2626"/>
  <rect x="16.9" y="3.6" width="1.4" height="4.6" rx="0.7" fill="#ffffff"/>
  <circle cx="17.6" cy="9.5" r="0.9" fill="#ffffff"/>
  <rect x="8.8" y="14.2" width="13" height="6.4" rx="3.2" fill="#111827"/>
  <text x="zK" y="18.7" text-anchor="middle" font-family="DejaVu Sans, Sans" font-size="z#" font-weight="700" fill="#f8fafc">z</text>
</svg>
zutf-8)encoding)r	   r   
write_text)r   r  r@  x	font_sizesvgs   &&    rB   r  Indicator._render_warning_icon  s    q)*!R'DT*b0Ee	 3YZcYd  eH  IM  HN N
 	**3*A&&&rD   c                    V ^8  d   QhRRRR/# )r>   
theme_pathr   r?   r   r@   )rA   s   "rB   rC   r     s     < <D <T <rD   c                	    V P                   e   \        V P                   R4      '       g   R # V P                   P                  \        V4      4       R # )Nset_icon_theme_path)r   r   r  rh  )r   r  s   &&rB   r  #Indicator._set_indicator_icon_theme  s6    >>!AV)W)W**3z?;rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r     s      t rD   c                	    V P                   e9   V P                   P                  '       g   V P                   P                  4        R # V P                  4        R # re   )r   	is_closedcloser  r   s   &rB   r   Indicator._toggle_popup  s:    ::!$***>*>*>JJrD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r     s     
& 
&T 
&rD   c                	   V P                  4        V P                  f   R # V P                  e4   V P                  P                  V P	                  4       P
                  4       \        V P                  R4      '       d   V P                  P                  4        \        V P                  R4      '       d   V P                  P                  4        V P                  RR7       R # )Nshowshow_allTr   )
_ensure_popupr   r   show_tab_build_dashboard_vm
active_tabr   r  r  r   r   s   &rB   r  Indicator._open_popup  s    ::??&OO$$T%=%=%?%J%JK4::v&&JJOO4::z**JJ!%rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r     s      t rD   c                	8   V P                   f8   V P                  RV P                  P                  V P                  R7      V n         V P
                  f   V P                  pVf	   ^ RIHp TpV! V P                  4       4      V n        V P                   P                  4       p\        V P
                  RV P
                  4      p\        VR4      '       d   VP                  V4       MVP                  VRR^ 4       V P                  4        V P!                  4        R # )NAccounts)title
auto_closer<  )	Dashboardwidgetr,  T)r   r   r   r  r   r   r   ui.dashboardr  _dashboard_callbacksget_content_arear  r   r,  
pack_start_apply_dashboard_theme_rebuild_popup)r   factoryr  contentr  s   &    rB   r  Indicator._ensure_popup  s    ::33 >>44"ii 4 DJ
 ??"--G2#%d&?&?&ABDOjj113GT__hHFw&&F#""64q9##%rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r     s     	- 	- 	-rD   c                	    V P                   f   R # \        V P                   RR 4      p\        V4      '       g   R # ^ RIHp \        V P
                  RR4      pV! V! V4      4       R # )N	set_theme)resolve_themethemesystem)r   r  r
  ui.themer  r   )r   r  r  
preferences   &   rB   r   Indicator._apply_dashboard_theme  sQ    ??"DOO[$?		""*T^^Wh?
-
+,rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r   $  s       rD   c                	F    V P                   f   R # V P                  4        R # re   )r   r  r   s   &rB   r4   Indicator._rebuild_popup_if_open$  s    ::rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r   )  s     ; ; ;rD   c                	    V P                   e   V P                  f   R # V P                  4        V P                  P                  V P	                  4       4       R # re   )r   r   r  r  r  r   s   &rB   r  Indicator._rebuild_popup)  s?    ::!8##%t779:rD   c                   V ^8  d   QhRR/# )r>   r?   r5   r@   )rA   s   "rB   rC   r   /  s     -
 -
[ -
rD   c                	  a aaa S P                  4        Uu/ uF=  pVP                  P                  S P                  VP                  P                  4      bK?  	  pp. pS P                  4        F  oSP                  P                  4       oVP                  SP                  P                  / 4      o\        ;QJ d2    . VVV V3R  lSP                  P                  4        4       F  NK  	  5M+! VVV V3R  lSP                  P                  4        4       4      pVP                  \        SP                  P                  S P                  SP                  4      VR7      4       K  	  \        TS P                  4       S P                  P                  ;'       g    RS P                  P                   \#        R S P$                  P'                  4        4       4      \#        S P(                  4      R7      # u upi )c              3    <"   T EF6  p\        SP                  P                  VP                  VP                  VP
                  VP                  S8H  SP                  P                  SP                  V4      4      SP                  P                  SP                  V4      4      \        SP                  P                  SP                  V4      \        4       4      4      SP                  VP                  / 4      SP                  SP                  VP                  4      \        V4      P                  R 7      x  EK9  	  R# 5i))r   r>  r]  plan
is_defaultrD  
checked_atbusy_actionsaccount_capsr6  gateway_stateN)r2   r   rc   r>  r]  r  r   r@  r  r   	frozensetr   r   r=  r{   r   ).0r  r<  r  r   	tool_capss   & rB   	<genexpr>0Indicator._build_dashboard_vm.<locals>.<genexpr>8  s         8G !,, !-- &|||;!^^//0A0A'0JK#0044T5F5Fw5OP!***..t/@/@/I35Q" "+w||R!@2283D3DgllS"7"@"F"F   8s   D?E)r   r8  rb  Nc              3  <   "   T F  w  rR V9   g   K  Vx  K  	  R# 5i)rI  Nr@   )r  r   r/  s   &  rB   r  r  V  s#      %%HMD G+ %Hs   
)r]   last_used_tabrj  busy_add_toolsdismissed_alert_keys)r  r   rc   _account_caps_for_toolr{   r<  r@  r  r  r  r6   r)  r7   r   r   last_tabrj  r  r   r+  r   )r   r  account_caps_by_toolr  rb  r<  r  s   f`   @@rB   r  Indicator._build_dashboard_vm/  s    !OO- 
- MM!<!<X]]=P=P!QQ- 	  
 *,	)H#,,99;L,001D1DbIIu    (00557!uu    (00557! H$ !,,..x}}=%+ *8 "

..1199T"&.."F"F$ %%)%@%@%F%F%H% 
 "+4+E+E!F
 	
C 
s   AG3c                   V ^8  d   QhRR/# )r>   r?   r4   r@   )rA   s   "rB   rC   r   ^  s     
 
&8 
rD   c                	   a  \        V 3R  lS P                  V 3R lV 3R lV 3R lV 3R lS P                  V 3R lV 3R lS P                  S P                  S P
                  R7      # )c                <   < SP                  WSP                  4      # re   )_with_accountr  r   r>  r   s   &&rB   r   0Indicator._dashboard_callbacks.<locals>.<lambda>`      d.@.@D55/rD   c                <   < SP                  WSP                  4      # re   )r  r  r  s   &&rB   r   r  d      ););DH\H\)]rD   c                <   < SP                  WSP                  4      # re   )r  r  r  s   &&rB   r   r  e  r  rD   c                <   < SP                  WSP                  4      # re   )r  r  r  s   &&rB   r   r  f  r  rD   c                &   < SP                  V 4      # re   r  )r   r   s   &rB   r   r  g  s     E Ed KrD   c                <   < SP                  WSP                  4      # re   )r  _open_limits_dialogr  s   &&rB   r   r  i  s    T-?-?D44.rD   c                <   < SP                  WSP                  4      # re   )r  r  r  s   &&rB   r   r  l  r  rD   )on_set_default	on_reload	on_repair	on_rename	on_removeon_addon_open_settingson_set_limitson_toggle_lock
on_gatewayon_tab_changedon_dismiss_alert)r4   _dashboard_reload_open_settings_dialog_dashboard_gateway_action_persist_last_tab_dismiss_alertr   s   frB   r  Indicator._dashboard_callbacks^  s\    ! ,,]]]K!77 5511!00%
 	
rD   c               (    V ^8  d   QhRRRRRRRR/# )r>   r7  rh  r   r>  r?   r   r@   )rA   s   "rB   rC   r   t  s(     $ $3 $c $ $ $rD   c                	   V P                   P                  WV34       V P                  4        V P                  eR   V P                  P                  '       d4   \        V P                  RR 4      p\        V4      '       d
   V! 4        R # R # R # R # )Nresize_to_content)r   r,  r4  r   
is_visibler  r
  )r   r7  r   r>  r  s   &&&& rB   r  Indicator._dismiss_alertt  ss    ""&&D'9:##%::!djj&;&;&; '

4G N)**!# + '<!rD   c               (    V ^8  d   QhRRRRRRRR/# )r>   r   rh  r>  r  zCallable[[Account], None]r?   r   r@   )rA   s   "rB   rC   r   |  s2     	 		 	 *		
 
	rD   c                	D    V P                  W4      pVf   R # V! V4       R # re   )_resolve_accountr   r   r>  r  r  s   &&&& rB   r  Indicator._with_account|  s#     ''3?wrD   c               $    V ^8  d   QhRRRRRR/# )r>   r   rh  r>  r?   r  r@   )rA   s   "rB   rC   r     s!      S   rD   c                	     V P                   P                  V4      P                  pTP	                  4        F  pTP
                  T8X  g   K  Tu # 	  R #   \         d     R # i ; ire   )r   r   r{   r  r  r>  r   r   r>  r{   r  s   &&&  rB   r  Indicator._resolve_account  s_    	..77=FFH  }}G||t# '   		s   %A A$#A$c               (    V ^8  d   QhRRRRRRRR/# )r>   r   rh  r>  r  r?   r   r@   )rA   s   "rB   rC   r     s(     4 4c 4 4c 4d 4rD   c                	   V P                  W4      pVf   R # VR8X  d   V P                  V4       R # VR8X  d   V P                  V4       R # VR8X  d   V P                  V4       R # VR8X  d   V P	                  V4       R # R # )Nmigrater   cancelrollback)r  r  r  r  r  r  s   &&&& rB   r  #Indicator._dashboard_gateway_action  sw    ''3?Y,,W5z!**73x**73z!**73 "rD   c               $    V ^8  d   QhRRRRRR/# )r>   r   ri  r>  r?   r   r@   )rA   s   "rB   rC   r     s!     > >j >
 >t >rD   c                	:   Vf   V P                  RR7       R # VfQ    V P                  P                  V4      P                  pTP                  4        F  pT P                  T4       K  	  R # V P                  WV P                  4       R #   \         d     R # i ; i)NTr   )r   r   r   r{   r  r  r  r  r  s   &&&  rB   r  Indicator._dashboard_reload  s    <D)<22;;DAJJ $==?%%g. +4t'<'<=  s   %B BBc                    V ^8  d   QhRRRR/# )r>   tab_idrh  r?   r   r@   )rA   s   "rB   rC   r     s     3 3 3 3rD   c                	  a \         ;QJ d-    V3R  lV P                  4        4       F  '       d   K   RM"	  RM! V3R  lV P                  4        4       4      '       d   R# V P                  P                  S8X  d   R# \	        V P                  SR7      V n        V P
                  P                  V P                  4       R# )c              3  T   <"   T F  qP                   P                  S8g  x  K  	  R # 5ire   )r   rc   )r  r  r"  s   & rB   r  .Indicator._persist_last_tab.<locals>.<genexpr>  s      O=N}}""f,=Ns   %(FTN)r  )allr  r   r  r   r   write)r   r"  s   &frB   r  Indicator._persist_last_tab  st    3OT__=NO333OT__=NOOO>>""f, &A""4>>2rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r     s      t rD   c           	     	    V P                   pVf	   ^ RIHp TpV! V P                  V P                  \        V P                  RR 4      R7      pVP                  4        R # )N)SettingsDialogru  )on_saver<  )r   ui.settings_dialogr+  r   _apply_settingsr  r   open)r   r  r+  rR  s   &   rB   r  Indicator._open_settings_dialog  sO    //?9$GNN((!$**h=

 	rD   c                    V ^8  d   QhRRRR/# )r>   r   rh  r?   zPath | Noner@   )rA   s   "rB   rC   r     s     A A A ArD   c                	     \        V4      pT\        9  d   R # T P                  P	                  T4      P
                  pTP                  \        T,          ,          #   \         d     R # i ; ire   )r   
ValueErrorr   r   r   r{   base_dir)r   r   r7  r{   s   &&  rB   _routing_rules_path_for_tool&Indicator._routing_rules_path_for_tool  sf    	&t,D ..**33D9BB  #:4#@@@  		s   A A,+A,c                    V ^8  d   QhRRRR/# )r>   r   rh  r?   zdict[str, dict[str, int]]r@   )rA   s   "rB   rC   r     s     
 
3 
3L 
rD   c                	&   V P                  V4      pVe   VP                  4       '       g   / # V P                  P                  V4      P                  pVP                  4        Uu0 uF  qDP                  kK  	  pp \        V4      pTP                  P                  4        UU	u/ uF  w  rY9   g   K  T\        T	4      bK  	  up	p# u upi   \        \        3 d.   p\        RT RT 2\        P                  R7       / u R p?# R p?ii ; iu up	pi )Nz	systray: z spend caps unreadable: r  )r5  is_filer   r   r{   r  r>  r$   rr   r3  r  r  r  r  r+  dict)
r   r   pathr{   r  known_slugsrulesr  r>  windowss
   &&        rB   r   Indicator._account_caps_for_tool  s    006<t||~~I**33D9BB3;==?C?||?C	t$E "'!3!3!9!9!;
!;"  D$w-!;
 	
 D $ 	IdV#;C5A

SI	
s0   %C<C $
D3DD
"D?D
D
c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r     s     $ $7 $t $rD   c                	p  a aaa SP                   pS P                  V4      oSf   R # S P                  P                  S P	                  S4      4      pVf   R # S P                  V4      P                  SP                  / 4      pS P                  pVf	   ^ RIH	p TpS P                  P                  V4      P                  pVP                  4        Uu0 uF  qP                  kK  	  upoR VVVV 3R llp	V! SP                  VVV	\        S P                  RR 4      R7      p
V
P!                  4        R # u upi )N)LimitsDialogc               $    V ^8  d   QhRRRRRR/# )r>   ru  rh  cap_pctrj   r?   r   r@   )rA   s   "rB   rC   3Indicator._open_limits_dialog.<locals>.__annotate__  s!     
	* 
	*C 
	** 
	* 
	*rD   c                b   < ^ RI Hp V! SSP                  V VSR7       SP                  4        R# )r   )update_account_cap)r<  N)routing_resolverrG  r>  r4  )ru  rD  rG  r  r<  r;  r   s   && rB   r,  .Indicator._open_limits_dialog.<locals>.on_save  s/    ;' '')rD   ru  )r<  )r   r5  r   r@  r  r  r>  r   ui.limits_dialogrB  r   r   r{   r  r  r   r/  )r   r  r   rD  capsr  rB  r{   entryr,  rR  r<  r;  s   ff         @@rB   r  Indicator._open_limits_dialog  s   ||006<>>%%d&7&7&@A**4044W\\2F--?5"G**33D9BB/7}}?ezz?
	* 
	* LL!$**h=
 	+ @s   D3c                    V ^8  d   QhRRRR/# )r>   settingsr   r?   r   r@   )rA   s   "rB   rC   r     s     & & & &rD   c                	<   Wn         V P                  P                  V4       V P                  eB   \	        V P                  R4      '       d&   V P                  P                  VP                  4       V P                  VP                  4       V P                  4        R # )Nset_auto_close)
r   r   r'  r   r   rQ  r  _reschedule_health_timerr   r4  )r   rO  s   &&rB   r.  Indicator._apply_settings  sn    !""8,::!gdjj:J&K&KJJ%%h&9&9:%%h&G&GH##%rD   c                    V ^8  d   QhRRRR/# )r>   interval_secondsr  r?   r   r@   )rA   s   "rB   rC   r   
  s     
 
 
 
rD   c                	   V P                  4       pVe   \        VR4      '       g   R # V P                  e.   \        VR4      '       d   VP                  V P                  4       VP	                  WP
                  4      V n        R # )Nr   source_remove)r   r   r   rW  r   r   )r   rU  r   s   && rB   rR  "Indicator._reschedule_health_timer
  sm      "<wt-BCC  ,1O1Ot445 $ 8 855!
rD   c                   V ^8  d   QhRR/# )r>   r?   r   r@   )rA   s   "rB   rC   r     s     : : :rD   c                	    ^ RI Hp \        V P                  RR4      pVe   \	        V4      M	\        4       pV! VR,          4      # )r   )SettingsStorer4  Nzsettings.json)ui.settings_storer[  r  r{   r   r*   )r   r[  r4  ru   s   &   rB   r   !Indicator._default_settings_store  s9    34==*d;&.&:DN	Y899rD   c                    V ^8  d   QhRRRR/# )r>   _accountr   r?   r   r@   )rA   s   "rB   rC   r     s     & &' &d &rD   c                	&    V P                  4        R # re   )r4  )r   r_  s   &&rB   r.  #Indicator._update_dashboard_account  s    ##%rD   c               $    V ^8  d   QhRRRRRR/# )r>   r  rh  r  rW   r?   r@   )rA   s   "rB   rC   r     s!     % % %9 % %rD   c                	:    \        V4      pV'       g   V # V  R V 2# )z: )rh  )r  r  rT  s   && rB   rP  Indicator._failure_message  s$    SMF8$$rD   c                    V ^8  d   QhRRRR/# )r>   r  rW   r?   r   r@   )rA   s   "rB   rC   r   &  s     E EI E$ ErD   c                	Z    \         P                  ! \        V 4      W P                  4       R # re   )	tracebackprint_exceptiontype__traceback__)r  s   &rB   rO  Indicator._log_exception%  s    !!$s)S2C2CDrD   c                    V ^8  d   QhRRRR/# )r>   r  r   r?   r   r@   )rA   s   "rB   rC   r   )  s     4 4 44N 4rD   c                	b    V P                   P                  V4      P                  p\        V4      # re   )r   rC  r{   r   r   r  r{   s   && rB   _gateway_managerIndicator._gateway_manager)  s)    **66w?HH)(33rD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r   -  s     Q Q7 Qt QrD   c                	`  a a S P                   P                  S4      P                  pS P                  VSP                  4      '       d"   S P                  R SP                   R24       R# S P                  SR4      '       d   R# S P                  SRR4       S P                  VV 3R l4       R# )r  r  NrK  Tc                 &   < SP                  S 4      # re   )_run_gateway_migrate_terminalr  r   s   rB   r   7Indicator._migrate_account_to_gateway.<locals>.<lambda>5  s    D$F$Fw$OrD   
r   rC  r{   r=  r>  r  r]  r^  r0  r   rn  s   ff rB   r  %Indicator._migrate_account_to_gateway-  s    **66w?HH""8W\\::LL8GMM?*=>$$Wi88%%gy$?OPrD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r   7  s     8
 8
W 8
 8
rD   c                	   \        R 4      p\         P                  ! 4       R,          pVP                  4       '       d,   \        P                  ! V\        P
                  4      '       g!   V P                  V P                  VRR4       R# VP                  4       '       g!   V P                  V P                  VRR4       R#  \        P                  ! \        V4      R\        V4      RRVP                  R	VP                  R
.	RR7      pTP"                  ^ 8w  d.   T P                  T P                  TRRTP$                   24       R# T P                  T P                  TRTP$                   R24       R#   \         dK   pT P                  T4       T P                  T P                  TRT P!                  RT4      4        Rp?R# Rp?ii ; i)z/usr/bin/x-terminal-emulatorz.local/bin/systray-gatewayFz+Could not open a terminal for Gateway loginNz(Gateway account command is not installedz-er  z--toolz	--accountz--waitr  zGateway migration failedzGateway migration failed for T is now managed by Gateway)r   homer9  osaccessX_OKr   _finish_gateway_actionexistsr  r   rh  r   r>  rr   rO  rP  
returncoder]  )r   r  terminalcli	completedr  s   &&    rB   rt  'Indicator._run_gateway_migrate_terminal7  s   67iik88!!8RWW)E)ENN++=	 zz||NN++:	 	"MHLLLL
 I. 1$NN++/?	 ''}}o78		
#  	$NN++%%&@#F	 	s    AE2 2G=?GGc                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r   q  s     Z Z ZT ZrD   c                	   a a S P                  SR 4      '       d   R# S P                  SR R4       S P                  VV 3R l4       R# )rK  NTc                 (   < SP                  S R 4      # )r   _run_gateway_simple_actionru  s   rB   r   5Indicator._activate_gateway_account.<locals>.<lambda>u  s    D$C$CGZ$XrD   r^  r0  r   r  s   ffrB   r  #Indicator._activate_gateway_accountq  s:    $$Wi88%%gy$?XYrD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r   w  s     X X XT XrD   c                	   a a S P                  SR 4      '       d   R# S P                  SR R4       S P                  VV 3R l4       R# )rK  NTc                 (   < SP                  S R 4      # )r  r  ru  s   rB   r   5Indicator._cancel_gateway_migration.<locals>.<lambda>{  s    D$C$CGX$VrD   r  r  s   ffrB   r  #Indicator._cancel_gateway_migrationw  s:    $$Wi88%%gy$?VWrD   c               $    V ^8  d   QhRRRRRR/# )r>   r  r   r  rh  r?   r   r@   )rA   s   "rB   rC   r   }  s&     L L' L3 L4 LrD   c           
     	P    V P                  V4      pVR 8X  d;   VP                  VP                  VP                  4      4       VP                   R2pMLVR8X  d;   VP                  VP                  VP                  4      4       RVP                   2pM\        R4      hV P                  V P                  VRV4       R#   \        \        \        \        3 dK   pT P                  T4       T P                  T P                  TRT P                  RT4      4        Rp?R# Rp?ii ; i)	r   r{  r  z Gateway migration cancelled for z"unsupported Gateway account actionFzGateway account action failedNT)ro  r   currentr>  r]  r  rN  r   rr   rM  rO  r   r  rP  )r   r  r  managerrQ   r  s   &&&   rB   r  $Indicator._run_gateway_simple_action}  s    	++G4G#  !>?$]]O+EF8#ww||<=<W]]OL"#GHH 	t22GT7K x@ 	$NN++%%&EsK	 	s%   AC  A C  C   D%?D  D%c               (    V ^8  d   QhRRRRRRRR/# )	r>   r  r   successr_   rQ   rh  r?   r   r@   )rA   s   "rB   rC   r     s,      )-8;	rD   c                	    V P                  VR R4       V P                  4        V P                  4        V P                  4        V P	                  4        V P                  V4       R# )rK  FN)r0  r   r4  r   rQ  r  )r   r  r  rQ   s   &&&&rB   r   Indicator._finish_gateway_action  sR     	%%gy%@##%!!#WrD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r     s     I I IT IrD   c                	`  a a S P                   P                  S4      P                  pS P                  VSP                  4      '       d"   S P                  R SP                   R24       R# S P                  SR4      '       d   R# S P                  SRR4       S P                  VV 3R l4       R# )r  r  NrO  Tc                 &   < SP                  S 4      # re   )_run_gateway_rollbackru  s   rB   r   5Indicator._return_account_to_native.<locals>.<lambda>  s    D$>$>w$GrD   rw  rn  s   ff rB   r  #Indicator._return_account_to_native  s    **66w?HH""8W\\::LL8GMM?*=>$$W.>??%%g/?FGHrD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r     s     
 
W 
 
rD   c                	j  aaa  V P                  S4      oSP                  S4      pV P                  P                  SP                  4      oR TTT3R llpT P!                  TSTSP"                   R2R7       R#   \
        \        \        \        3 d   pT P                  T4       T P                  T P                  SR R4       T P                  T P                  T P                  RT4      4       T P                  T P                  4       T P                  T P                  4        Rp?R# Rp?ii ; i)rO  Fz Could not begin return to nativeNc                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   5Indicator._run_gateway_rollback.<locals>.__annotate__  s     	N 	Nt 	NrD   c                 B   < SP                  S SP                  R 7       R# ))native_healthN)complete_rollbackr  )r  r  r  s   rB   finish_native_cutover>Indicator._run_gateway_rollback.<locals>.finish_native_cutover  s    %%gX__%MrD   z returned to native credentials)provider_override
on_successsuccess_notice)ro  begin_rollbackr   r   r   r   rr   rN  rM  rO  r   r0  r  rP  r   r4  _run_repair_flowr]  )r   r  nativer  r  r  r  s   &f   @@rB   r  Indicator._run_gateway_rollback  s   	++G4G++G4F..77EH	N 	N 	&,%mm_,KL	 	 	
! x@ 	$NN--w8H% NN%%&H#N NN4--.NN4667	s   AA; ;D2BD--D2c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r     s     D Dw D4 DrD   c                	,  a a S P                   P                  S4      P                  pS P                  VSP                  4      '       d"   S P                  R SP                   R24       R# S P                  SRR4       S P                  VV 3R l4       R# )r  r  NrO  Tc                 &   < SP                  S 4      # re   )r  ru  s   rB   r   +Indicator._repair_account.<locals>.<lambda>  s    D$9$9'$BrD   )	r   rC  r{   r=  r>  r  r]  r0  r   rn  s   ff rB   r  Indicator._repair_account  st    **66w?HH""8W\\::LL8GMM?*=>%%g/?FBCrD   c               $    V ^8  d   QhRRRRRR/# )r>   r]  rh  r>  ri  r?   r   r@   )rA   s   "rB   rC   r     s&     Y Y# YZ Y4 YrD   c                	^    V P                  V P                  V P                  4      WR 7       R# )r>  N)_add_account_for_toolr  r{   )r   r]  r>  s   &&&rB   _add_accountIndicator._add_account  s$    ""4#6#6t}}#Eu"XrD   c                    V ^8  d   QhRRRR/# )r>   r   rh  r?   r   r@   )rA   s   "rB   rC   r     s     : :S :T :rD   c                	Z    V P                  V4      pVf   R # V P                  WVR7       R # )Nr  )_prompt_account_slugr  )r   r   r>  s   && rB   r  *Indicator._prompt_and_add_account_for_tool  s-    ((.<""4D"9rD   c                    V ^8  d   QhRRRR/# )r>   r   rh  r?   ri  r@   )rA   s   "rB   rC   r     s     % % % %rD   c                	   V P                  4       w  r# V P                  P                  V4      pTP                  pTP                  RR7      pTP                  RTP                  P                  4       TP                  RTP                  P                  4       TP                  4       pTP                  TP                  RR7      4       TP                  4       pTP                  T4       TP                  4        TP                  4       p	TP!                  4       P#                  4       p
TP%                  4        YP                  P                  8w  g	   T
'       g   R #  TP'                  T
4      pT\.        9   d   T P+                  RT 24       R # TP1                  4        Uu0 uF  qP2                  kK  	  ppY9   g(   TP4                  T,          P7                  4       '       d   T P+                  RT 24       R # T#   \         d     R # i ; i  \(         d&   pT P+                  \-        T4      4        R p?R # R p?ii ; iu upi )	NzAdd accountr  CancelAddz)Account slug (letters, numbers, hyphens):r  zReserved account slug: zAccount slug already exists: )r   r   r   r  r{   Dialog
add_buttonrJ  CANCELr`  r  r,  LabelEntryr  r   get_textstriprI  normalize_slugr3  r  rh  r   r  r>  accounts_dirr  )r   r   r   r   r  r{   rR  r  rL  rS  raw_slugr>  r  r  r<  s   &&             rB   r  Indicator._prompt_account_slug  s   !]]_	..77=H $$-0(C$4$4$;$;<%!1!1!4!45))+CII$OIPQ		E::<>>#))+''***(	**84D >!LL24&9:3;==?C?||?C8#8#84#?"G"G"I"ILL8?@C  		.  	LLS"	 Ds/   G= H "I=HHH?H::H?r>  
login_hintc          
     ,    V ^8  d   QhRRRRRRRRRR/# 	r>   r   rh  r]  r>  ri  r  r?   r   r@   )rA   s   "rB   rC   r     s<     
 

 

 
 
 

rD   c               	   a aaaa S P                  SR 4      '       d   R# S P                  SR R4       S P                  VVV VV3R l4       R# )rI  NTc                 .   < SP                  SS SSR 7      # )r>  r  )_run_add_account_flow)r]  r  r   r>  r   s   rB   r   1Indicator._add_account_for_tool.<locals>.<lambda>  s    D..tUR\.]rD   )r[  r5  r   )r   r   r]  r>  r  s   fffddrB   r  Indicator._add_account_for_tool  sA     %%dM::&&t]DA]]	
rD   r  r  r  c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r>   r  r   r  zProviderServices | Noner  Callable[[], None] | Noner  ri  r?   r   r@   )rA   s   "rB   rC   r   
  sC     o oo 3	o
 .o #o 
orD   c          
     	B  aa	 R pT;'       g    V P                   P                  V4      o	V P                  S	P                  VP                  4      '       dK   V P                  V P                  VRR4       V P                  V P                  RVP                   R24       R # S	P                  P                  V4       EF  oSP                  R9   d   K  SP                  R8X  d   SP                  ff   SP                  ;'       g4    SP                  e   SP                  P                  MRVP                   2pV P                  V P                  V4       K   V P!                  SP                  VSP                  4      pK  SP                  R8X  d6    V P7                  SP                  P8                  VV	3R	 lV3R
 lR7      pEK  SP                  R8X  dI   SP:                  e   V P=                  SP:                  4       V P                  V P>                  WQ4        R # SP                  R8X  dL   Ve	    V! 4        V P                  V PH                  WQ4       Ve   V P                  V P                  V4        R # SP                  R8X  g   EK  Vf   T P                  V P                  SP                  ;'       g=    T P1                  RVP                   2SPJ                  ;'       g    \E        R4      4      4       V P                  V P                  VRR4       V P                  V P2                  4       V P                  V P4                  4        R # V P                  V P>                  WQ4        R # 	  R #   \"         d   pT P%                  T4       SP                  e    \'        SP                  P(                  4       T P*                  P-                  TP.                  4       T P                  T P                  T P1                  RTP                   2T4      4       T P                  T P                  TRR4       T P                  T P2                  4       T P                  T P4                  4        R p? R # R p?ii ; i  \"         d   pT P%                  T4       SP                  e    \'        SP                  P(                  4       T P                  T P                  T P1                  RTP                   2T4      4       T P                  T P                  TRR4       T P                  T P2                  4       T P                  T P4                  4        R p? R # R p?ii ; i  \@        \B        \D        \F        3 d   pT P%                  T4       T P                  T P                  TRR4       T P                  T P2                  4       T P                  T P4                  4       T P                  T P                  T P1                  RT4      4        R p? R # R p?ii ; i)NrO  Fr  r  prompt_readyzComplete re-auth for Re-authentication failed for code_requiredc                P   < SP                   P                  SP                  V 4      # re   r  submit_codesessioncodeeventr  s   &rB   r   ,Indicator._run_repair_flow.<locals>.<lambda>;  s    x/A/A/M/Memm]a/brD   c                 B   < \        S P                  P                  4      # re   r   r  processr  s   rB   r   r  <      *;EMM<Q<Q*RrD   	on_submit	on_cancel	collisionr  zNative cutover failedfailurezrepair failed>   commitstartedr  process_startedbrowser-waiting)&r   rC  r=  r{   r>  r   r0  r  r]  r  rO  r7  r  rQ   promptraw_text_show_repair_dialogrW   rO  r   r  r   r  account_homerP  r   r4   _create_claude_code_entry_dialogurlr  _mark_account_broken_finish_repair_failurer   rr   rN  rM  _finish_repair_successerror)
r   r  r  r  r  rR  rQ   r  r  r  s
   &&$$$   @@rB   r  Indicator._run_repair_flow
  s    $TT(?(?(K(KG(T""8#4#4gllCCNN488'CSUZ[NN4<<8GMM?*)MN''66w?Ezzddzz^+==(#mm   <<3 --4W]]OD 
 NN4<<9!55ellGU]][F" zz_,!BB(("b"R C F( zz[(??.--eoo>t::FLzzY&)"  t::FL!-NN4<<@zzY&>NN  00;GMM?K!KKHH<+H NN4#@#@'K[]bcNN4#5#56NN4#>#>?t::FLC @ ! '',}}0)%--*?*?@**33G4H4HINN--;GMM?K NN4#@#@'K[]bcNN4#5#56NN4#>#>?0 ! '',}}0)%--*?*?@NN--;GMM?K NN4#@#@'K[]bcNN4#5#56NN4#>#>?2 +G\8L ++C0 99#,!	 t'9'9:t'B'BC LL 112I3O sK   'M71R5U&7Q>C0Q99Q>U#CUU#&XBXXc          
     ,    V ^8  d   QhRRRRRRRRRR/# r  r@   )rA   s   "rB   rC   r   {  sC     h hh h
 h h 
hrD   c          
     	
  aa	 R pV P                   P                  V4      o	S	P                  P                  W#VR7       EF  oSP                  R9   d   K  SP                  R8X  d   SP
                  f\   SP                  ;'       g*    SP                  e   SP                  P                  MRV 2pV P                  V P                  V4       K   T P                  SP                  SP                  ;'       g    . SP
                  4      pK  SP                  R8X  d6    V P3                  SP                  P4                  VV	3R	 lV3R
 lR7      pEK  SP                  R8X  d   EK)  SP                  R8X  dV   SP6                  eE   V P9                  SP6                  4       V P                  V P:                  VVVSP6                  4        R # SP                  R8X  d!   V P                  V P<                  WRV4        R # SP                  R8X  g   EK  Vf   T P                  V P                  SP                  ;'       g4    T P+                  RV R2SP>                  ;'       g    \A        R4      4      4       V P                  V P,                  VRR4       V P                  V P.                  4       V P                  V P0                  4        R # V P                  V PB                  WRV4        R # 	  R #   \         Ed:   pT P                  T4       SP
                  e    \        SP
                  P                   4       SP"                  e^   SP"                  P$                  T8w  dC    S	P&                  P)                  SP"                  P$                  4       M  \         d     Mi ; iT P                  T P                  T P+                  RT R2T4      4       T P                  T P,                  TRR4       T P                  T P.                  4       T P                  T P0                  4        R p? R # R p?ii ; i  \         Ed   pT P                  T4       SP
                  e    \        SP
                  P                   4       S	P&                  P)                  SP"                  e   SP"                  P$                  MT4       T P                  T P                  T P+                  RT R2T4      4       T P                  T P,                  TRR4       T P                  T P.                  4       T P                  T P0                  4        R p? R # R p?ii ; i)Nr  r  zComplete sign-in for Adding account  failedrI  Fr  c                P   < SP                   P                  SP                  V 4      # re   r  r  s   &rB   r   1Indicator._run_add_account_flow.<locals>.<lambda>  s     x/A/A/M/M!MM 0rD   c                 B   < \        S P                  P                  4      # re   r  r  s   rB   r   r    r  rD   r  r  r  r  r  z
add failed>   r  r  r  )"r   r   r  r,  r7  r  rQ   r  r  r   r  _show_add_dialogexisting_accountsrW   rO  r   r  r  r>  r{   removerP  r5  r   r4  r  r  r  r  _finish_add_collision_finish_add_successr   rN  _finish_add_failure)
r   r   r]  r>  r  rR  rQ   r  r  r  s
   &&&$$   @@rB   r  Indicator._run_add_account_flow{  sL    **33D9''++E+TEzzNNzz^+==(#mm   <<3 --4UG< 
 NN4<<9!22//552F, zz_,!BB((# #S C F. zzZ'zz[(??.--eoo>NN22 zzY&t77MzzY&>NN  00-eWG<!KKEE<+E NN4#A#A4X]^NN4#5#56NN4#>#>?t77M} U& ! '',}}0)%--*?*?@}}0U]]5G5G55P!$--44U]]5G5GH( ! !NN--wg.NPST NN4#A#A4X]^NN4#5#56NN4#>#>?!8 ! '',}}0)%--*?*?@%%,,.3mm.G**U NN--wg.NPST NN4#A#A4X]^NN4#5#56NN4#>#>?s]   (K18K11P91P6=A'P1%/NP1N# P1"N##BP11P69UDUUc               (    V ^8  d   QhRRRRRRRR/# )	r>   r  r   r  r   r  r   r?   r   r@   )rA   s   "rB   rC   r     s2     
 
 
 
 #	

 

rD   c                	D   a aa S P                  VVV 3R  lV3R lRR7      # )c                 &   < SP                  S 4      # re   r  ru  s   rB   r   /Indicator._show_repair_dialog.<locals>.<lambda>  s    T11':rD   c                 .   < \        S P                  4      # re   r   r  r  s   rB   r   r        /@rD   Non_retryr  r
  _create_device_auth_dialog)r   r  r  r  s   f&ffrB   r  Indicator._show_repair_dialog  s)     ..:@"	 / 
 	
rD   c               (    V ^8  d   QhRRRRRRRR/# )	r>   r  r   r
  list[tuple[str, str]]r  r   r?   r   r@   )rA   s   "rB   rC   r     s2     
 
 
 1
 #	

 

rD   c                	6   a V P                  VR V3R lVR7      # )Nc                 .   < \        S P                  4      # re   r  r  s   rB   r   ,Indicator._show_add_dialog.<locals>.<lambda>  r  rD   r  r  )r   r  r
  r  s   &&&frB   r	  Indicator._show_add_dialog  s)     ..@/	 / 
 	
rD   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r>   r  r   r  r  r  r
  zlist[tuple[str, str]] | Noner?   r   r@   )rA   s   "rB   rC   r     s<           ,  -	 
 8  
 rD   c                	   a aaaaaa \         P                  ! 4       o/ oR  VVVVVVV 3R llpS P                  V4       SP                  4        SP	                  R4      pVe   VhSR,          # )c                   V ^8  d   QhRR/# r>   r?   r_   r@   )rA   s   "rB   rC   :Indicator._create_device_auth_dialog.<locals>.__annotate__	  s     	 	d 	rD   c                    <  SP                  SSSSR 7      SR&   SP                  4        R#   \         d   p T SR&    Rp ? L'Rp ? ii ; i  SP                  4        i ; i)r  rR  r   NF)r   rW   r   )r  doner
  r  r  r  resultr   s    rB   build_dialog:Indicator._create_device_auth_dialog.<locals>.build_dialog	  sc    
#'#7#7%'&7	 $8 $x  
	  &"%w& 
s%   - AAA
 AA
 
Ar   rR  	threadingEventr   waitr@  )	r   r  r  r  r
  r+  r   r)  r*  s	   fffff  @@rB   r  $Indicator._create_device_auth_dialog  s[      !#	 	 	|$		

7#KhrD   c               (    V ^8  d   QhRRRRRRRR/# )	r>   r  rh  r  zCallable[[str], None]r  zCallable[[], None]r?   r   r@   )rA   s   "rB   rC   r     s2          )	 
 &  
 rD   c               	   aaaaa \         P                  ! 4       o/ oR  VVVVV3R llpV P                  V4       SP                  4        SP	                  R4      pVe   VhSR,          # )c                   V ^8  d   QhRR/# r&  r@   )rA   s   "rB   rC   @Indicator._create_claude_code_entry_dialog.<locals>.__annotate__(  s     	 	d 	rD   c                    <  \        SSSR 7      SR&   SP                  4        R#   \         d   p T SR&    Rp ? L'Rp ? ii ; i  SP                  4        i ; i)r  rR  r   NF)r   rW   r   )r  r)  r  r  r*  r  s    rB   r+  @Indicator._create_claude_code_entry_dialog.<locals>.build_dialog(  sU    	#8''$x  
	  &"%w& 
s#   & A ;A A  A Ar   rR  r-  )r   r  r  r  r+  r   r)  r*  s   &fdd  @@rB   r  *Indicator._create_claude_code_entry_dialog  s[      !#	 	 	|$		

7#KhrD   c               $    V ^8  d   QhRRRRRR/# r>   rR  r   r  r   r?   r   r@   )rA   s   "rB   rC   r   <  s!     : :S :7 :t :rD   c           
     	V   \        VR 4      '       d   VP                  4        V P                  V4      pV P                  VRR4       V P	                  V\        \        P                  RRV P                  4       R7      4      pVeF   W@P                  V&   VP                  e   VP                  MV P                  4       V P                  V&   V P                  4        V P                  4        V P                  4        V P                  4        V P!                  RVP"                   24       R# )close_successrO  FNr  zRe-authenticated )r   r<  r  r0  _merge_snapshotr    r!   r`  r   r   r  r   r   r4  _write_health_cacher   r  r]  )r   rR  r  rc  mergeds   &&&  rB   r   Indicator._finish_repair_success<  s    6?++  "(%%g/?G%%LOOT4DJJLQ
 "(NN3:@:K:K:WV%6%6]a]g]g]iDc"##%  "(89rD   c               $    V ^8  d   QhRRRRRR/# r:  r@   )rA   s   "rB   rC   r   N  s&     F FS F7 Ft FrD   c                	    V P                  VR R4       \        VR4      '       d   VP                  RR7       V P                  4        V P	                  4        V P                  RVP                   24       R# )rO  Fshow_failureTretry_availabler  N)r0  r   rD  r   r4  r  r]  )r   rR  r  s   &&&rB   r   Indicator._finish_repair_failureN  sc    %%g/?G6>**5##%4W]]ODErD   c               (    V ^8  d   QhRRRRRRRR/# r>   rR  r   r]  rh  r   r?   r   r@   )rA   s   "rB   rC   r   V  s(     / /# /c / / /rD   c                	    V P                  VR R4       \        VR4      '       d   VP                  4        V P                  4        V P	                  4        V P                  4        V P                  RV 24       R# )rI  Fr<  zAdded account N)r5  r   r<  r   r4  r   r  r   rR  r]  r   s   &&&&rB   r  Indicator._finish_add_successV  sd    &&t]EB6?++  "##%~eW-.rD   c               (    V ^8  d   QhRRRRRRRR/# rI  r@   )rA   s   "rB   rC   r   _  s(     7 7# 7c 7 7 7rD   c                	    V P                  VR R4       \        VR4      '       d   VP                  RR7       V P                  4        V P	                  4        V P                  RV R24       R# )rI  FrD  rE  r  r  N)r5  r   rD  r   r4  r  rK  s   &&&&rB   r  Indicator._finish_add_failure_  s_    &&t]EB6>**6##%ugW56rD   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r>   rR  r   r]  rh  r   r  r   r?   r   r@   )rA   s   "rB   rC   r   g  s1     
 
C 
 
3 
SZ 
_c 
rD   c                	    V P                  VR R4       \        VR4      '       d   VP                  RR7       V P                  4        V P	                  4        V P                  RV RVP                   24       R# )rI  FrD  rE  r  z  collided with existing account N)r5  r   rD  r   r4  r  r]  )r   rR  r]  r   r  s   &&&&&rB   r  Indicator._finish_add_collisiong  sl    &&t]EB6>**6##%eW$DY__DUV	
rD   c                    V ^8  d   QhRRRR/# )r>   r   ri  r?   r  r@   )rA   s   "rB   rC   r   q  s     
 
z 
EZ 
rD   c                	(   V P                   P                  T;'       g    V P                  V P                  4      4      pVP                  P	                  4        Uu. uF+  pVP
                  f   K  VP                  VP
                  3NK-  	  up# u upi re   )r   r   r  r{   r  emailr]  )r   r   r  r  s   &&  rB   _existing_accounts_for_add$Indicator._existing_accounts_for_addq  s~    **33D4^4^D<O<OPTP]P]<^_ $,,113
3}} +W]]GMM*3
 	
 
s   B0Bc                    V ^8  d   QhRRRR/# )r>   r  rh  r?   r  r@   )rA   s   "rB   rC   r   y  s        rD   c                	L   R pV P                   P                  4        F  pVP                  V8X  g   K  Tp M	  Ve   VP                  '       g   R # V P                   P                  4        F5  pVP                  V8w  g   K  VP                  VP                  8X  g   K3  Vu # 	  R # re   )r{   r  r>  
account_id)r   r  new_accountr  s   &&  rB   _find_account_collision!Indicator._find_account_collisiony  s    }}))+G||x'% , k&<&<&<}}))+G||x'G,>,>+BXBX,X , rD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r     s     
0 
0G 
0 
0rD   c           
     	r   V P                  V4      pV P                  V\        \        P                  R R V P                  4       R7      4      pVeF   W0P                  V&   VP                  e   VP                  MV P                  4       V P                  V&   V P                  4        V P                  V4       R # )Nr=  )r  r>  r    r!   r  r   r   r  r   r?  r.  )r   r  rc  r@  s   &&  rB   r  Indicator._mark_account_broken  s    (%%L//t

U
 "(NN3:@:K:K:WV%6%6]a]g]g]iDc"  "&&w/rD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r     s      w 4 rD   c                	   V P                  4       w  r#VP                  R R7      pVP                  RVP                  P                  4       VP                  RVP                  P
                  4       VP                  4       pVP                  VP                  RVP                   2R7      4       VP                  4       pVP                  VP                  4       VP                  V4       VP                  4        VP                  4       pVP                  4       P                  4       pVP!                  4        WrP                  P
                  8w  g	   V'       g   R# V P"                  P%                  V4      P&                  p	VP(                  VP*                  rV	P-                  W4      pV'       d   W8w  d   V P/                  WV4       V P1                  4        V P3                  4        V P5                  4        R# )zRename accountr  r  r`  zRename account: r  N)r   r  r  rJ  r  r`  r  r,  r  r]  r  set_textr  r   r  r  rI  r   rC  r{   r   r>  renamer  r   r4  r   )r   r  r   r   rR  r  rL  rS  	new_aliasr{   r   r>  r  s   &&           rB   r  Indicator._rename_account  sq   !]]_"23(C$4$4$;$;<$ 0 0 3 34))+CII&6w}}o$FIGH		w}}%E::<NN$**,	''***)**66w?HH\\7<<d??43(!!$h7##%rD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r     s      w 4 rD   c           	     	   V P                  4       w  r#VP                  R ^ VP                  P                  VP                  P
                  RVP                   R2R7      pVP                  4       pVP                  4        WRP                  P                  8w  d   R # V P                  P                  V4      P                  P                  VP                  4       V P!                  4        V P#                  4        V P%                  4        R # )NzRemove account r:  r;  )r   rD  rE  rF  rG  rH  r]  r   rI  rJ  rK  r   rC  r{   r  r>  r   r4  r   )r   r  r   r   rR  rS  s   &&    rB   r  Indicator._remove_account  s    !]]_""11OO**"7==/3 # 
 ::<''+++++G4==DDW\\R##%rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r     s     & &t &rD   c                	  a  S P                  4       w  rVP                  4       S n        / S n        \	        S P                  R 4      '       d!   S P                  P                  RV 3R l4       S P                  4       pS P                  VS P                  S P                  4       V4       S P                  P                  4        S P                  e&   S P                  P                  S P                  4       S P                  4        R# )r   r  c                 (   < SP                  R R7      # )Tr   )r   r   s   *rB   r   )Indicator._rebuild_menu.<locals>.<lambda>  s    T5F5FT5F5RrD   N)r   r  r   r   r   r   r  r}  r,  r  r   set_menur4  )r   r   r   rw  s   f   rB   r   Indicator._rebuild_menu  s    !]]_HHJ	499i((IIf&RS--/((dii9O9O9QSab		>>%NN##DII.##%rD   c               (    V ^8  d   QhRRRRRRRR/# )r>   r   r   rz  r8  rh  r?   r@   )rA   s   "rB   rC   r     s(     1 1# 1c 1# 1# 1rD   c                	    V P                   p\        VR R4      p\        V4      '       d	   V! W4      #  V! VR7      #   \         d    T! Y4      u # i ; i)new_with_label_from_widgetNr  )r  r  r
  	TypeError)r   rz  r8  radio_menu_itemr  s   &&&  rB   _new_radio_menu_itemIndicator._new_radio_menu_item  s\    ++/+GNG5((	1"// 	1"500	1s   = AAc                   V ^8  d   QhRR/# rM   r@   )rA   s   "rB   rC   r     s      j rD   c                	T    V P                   f   \        4       V n         V P                   # re   )r   rX   r   s   &rB   r   Indicator._glib_module  s     ::*,DJzzrD   c                   V ^8  d   QhRR/# r&  r@   )rA   s   "rB   rC   r     s      D rD   c                	     V P                  R R7       V P                  4        R#   \         d   pT P                  T4        Rp?R# Rp?ii ; i)Fr   NT)r   rQ  rW   rO  )r   r  s   & rB   r   Indicator._refresh_all_timer  sO    	%E*%%'   	%$$	%s   "& AAAc                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r     s     [ [ [D [rD   c                	H   V P                   P                  V4      P                  pV P                  W!P                  4      '       d"   V P                  R VP                   R24       R# V P                  VRR4       V P                  P                  VRV P                  4       R# )r  r  NrW  T)r   rC  r{   r=  r>  r  r]  r0  r   schedule_refresh_account_run_refresh_accountrn  s   && rB   r  Indicator._refresh_account  s}    **66w?HH""8\\::LL8GMM?*=>%%gx>00$@Y@YZrD   c               $    V ^8  d   QhRRRRRR/# r>   r  r   
generationrj   r?   r   r@   )rA   s   "rB   rC   r     s'     a a aj aUY arD   c                	2   V P                   P                  V4      P                  pV P                  W1P                  4      '       d   Ve   V P                  V4       R # V P                  VRR4       V P                  P                  WV P                  4       R # )NrW  T)
r   rC  r{   r=  r>  _finish_refreshr0  r   r  r  r   r  r  r{   s   &&& rB   _schedule_refresh_account#Indicator._schedule_refresh_account  sv    **66w?HH""8\\::%$$Z0%%gx>00dF_F_`rD   c               $    V ^8  d   QhRRRRRR/# r  r@   )rA   s   "rB   rC   r     s"     
 
G 
 
PT 
rD   c                	  a  S P                   P                  V4      P                  pS P                  W1P                  4      '       dA   S P                  S P                  VR R4       Ve   S P                  S P                  V4       R# S P                  P                  VVV 3R lS P                  S P                  4       R# )rW  FNc                l   < SP                   P                  V 4      P                  P                  V 4      # re   )r   rC  r  fetch)target_accountr   s   &rB   r   0Indicator._run_refresh_account.<locals>.<lambda>  s*    4#:#:#F#F~#V#]#]#c#c$rD   )r   rC  r{   r=  r>  r   r0  r  r   run_refresh_account_apply_snapshot_handle_refresh_errorr  s   f&& rB   r  Indicator._run_refresh_account  s    **66w?HH""8\\::NN488'8US%t33Z@++   &&	
rD   c               (    V ^8  d   QhRRRRRRRR/# )	r>   r  r   r  rj   r  rW   r?   r   r@   )rA   s   "rB   rC   r     s2     	- 	-	- 	- 		-
 
	-rD   c                	|    V P                  V4       V P                  VR R4       Ve   V P                  V4       R# R# )rW  FN)rO  r0  r  )r   r  r  r  s   &&&&rB   r  Indicator._handle_refresh_error  s=     	C %%gx?!  , "rD   c               (    V ^8  d   QhRRRRRRRR/# )	r>   r  r   rD  r    r  rj   r?   r   r@   )rA   s   "rB   rC   r     s2     # ## "# 	#
 
#rD   c                	   V P                  V4      pVP                  e   VP                  MV P                  4       pWPP                  V&   V P                  P                  V4      pV P                  V\        W%R7      4      pVe!   WpP                  V&   V P                  WV4       V P                  VRR4       V P                  V4       V P                  V4       Ve   V P                  V4       R # V P                  4        R # )Nr=  rW  F)r  r  r   r   r   r@  r>  r   ry  r0  _update_account_menu_itemr.  r  r?  )r   r  rD  r  rc  r  re  rd  s   &&&&    rB   r  Indicator._apply_snapshot  s     (,4,?,?,KX((QUQ[Q[Q]
!+# NN..s3..sGH4\]&"1NN3%%g@QR%%gx?&&w/&&w/!  ,  "rD   c                    V ^8  d   QhRRRR/# r8  r@   )rA   s   "rB   rC   r   .  s       T rD   c                	   V P                  V4      pV P                  P                  V4      pVf   R # T P                  TV P	                  V4      '       d   V P
                  P                  V4      MR V P	                  V4      V P                  4       V P                  V P                  P                  V4      P                  VP                  4      R7      p\        VR4      '       d   VP                  V4       MWCn        \        VR4      '       dV   VP                  V P                  V P                  P                  V4      P                  VP                  4      '       * 4       R # R # )Nr4  	set_labelr  )r  r   r@  rA  r?  r   r   r=  r   rC  r{   r>  r   r  r8  r  )r   r  rc  r{  
model_items   &&   rB   r  #Indicator._update_account_menu_item.  s&   (##C(<(('+'@'@'I'IDNNs#t11':

**''33G<EE ) 	

 4%%NN:&#J4))++++77@IILL  *rD   c                    V ^8  d   QhRRRR/# )r>   r   r_   r?   r   r@   )rA   s   "rB   rC   r   I  s     
 
$ 
4 
rD   c                	  a a . pS P                  4        F7  oVP                  VV 3R  lSP                  P                  4        4       4       K9  	  S P                  P                  VV 3R l\        VS P                  S P                  4       R# )c              3     <"   T F5  pSP                  SP                  VP                  4      '       d   K1  Vx  K7  	  R # 5ire   )r=  r{   r>  )r  r  r  r   s   & rB   r  )Indicator._refresh_all.<locals>.<genexpr>L  s4      7G..x/@/@',,O 7s
   .A 
A c                X   < SP                   P                  SP                  V 4      4      # re   )r   r@  r  ru  s   &rB   r   (Indicator._refresh_all.<locals>.<lambda>S  s!    D--11$2C2CG2LMrD   N)	r  r`  r{   r  r   refresh_allHEALTH_STALE_SECONDSr  r?  )r   r   rb  r  s   f& @rB   r   Indicator._refresh_allI  ss    "$)HOO '00557  * 	##M **$$	
rD   c                    V ^8  d   QhRRRR/# )r>   r  r  r?   r   r@   )rA   s   "rB   rC   r   [  s     M M# M$ MrD   c                	P    V P                   P                  WP                  4       R # re   )r   finish_refreshr?  )r   r  s   &&rB   r  Indicator._finish_refresh[  s    &&z3K3KLrD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r   ^  s     	L 	LT 	LrD   c                	   V P                   pVe+   VP                  V P                  V P                  4      4       V P                  pVe+   VP                  V P                  V P
                  4      4       \        V RR 4      pVe=   V P                  e-   VP                  V P                  V P                  4      4       R # R # R # Nr   )r   r'  r  r{   r   r}   r  r   )r   r  claude_store
grok_stores   &   rB   r?  Indicator._write_health_cache^  s    ""KK11$--@A00#t889M9MNOT#7>
!d&8&8&DT66t7I7IJK 'E!rD   c                   V ^8  d   QhRR/# r   r@   )rA   s   "rB   rC   r   i  s      D rD   c                	(   V P                  V P                  V P                  4       V P                  e'   V P                  V P                  V P                  4       V P
                  e*   V P                  \        V RR 4      V P
                  4       R # R # r  )_load_registry_health_cacher   r{   r}   r   r   r  r   s   &rB   r   Indicator._load_health_cachei  sy    ((););T]]K+,,T-F-FH\H\]),,2D9"" *rD   c               $    V ^8  d   QhRRRRRR/# )r>   r  r   r{   r~   r?   r   r@   )rA   s   "rB   rC   r   s  s-     l l)l )l 
	lrD   c                	   Vf   R # VP                  4       pV'       g   R # V P                  W24      pV P                  P                  V4       \	        VRR 4      pVe&    \        V4      P                  4       P                  pMV P                  4       pVP                  4        F.  w  rxVP                  e   VP                  MTV P                  V&   K0  	  R #   \         d    T P                  4       p Lai ; i)Nr;  )r   r  r   r  r  r   statst_mtimerr   r   r+  r  r   )	r   r  r{   r   r  
cache_path
fetched_atrc  rD  s	   &&&      rB   r  %Indicator._load_registry_health_caches  s    
 =JJL	229G
j)UFD1
!*!*-224==
 J'--/MC<D<O<O<[X%8%8akDc" 0	  *!ZZ\
*s   #C C54C5c                   V ^8  d   QhRR/# r>   r?   r   r@   )rA   s   "rB   rC   r     s     @ @'A @rD   c                	h    \        V P                  R R4      pVf   R# \        \        V4      ^ R7      # )health_cache_pathNstale_after_s)r  r{   r"   r   r   r;  s   & rB   r   Indicator._default_health_store  s.    t}}&94@<"4:Q??rD   c                   V ^8  d   QhRR/# r  r@   )rA   s   "rB   rC   r     s     @ @.H @rD   c                	    V P                   f   R # \        V P                   RR 4      pVf   R # \        \        V4      ^ R7      # Nr  r  )r}   r  r"   r   r  s   & rB   r   &Indicator._default_claude_health_store  s?    't++-@$G<"4:Q??rD   c                   V ^8  d   QhRR/# r  r@   )rA   s   "rB   rC   r     s     @ @,F @rD   c                	    V P                   f   R # \        V P                   RR 4      pVf   R # \        \        V4      ^ R7      # r  )r   r  r"   r   r  s   & rB   r   $Indicator._default_grok_health_store  s?    %t))+>E<"4:Q??rD   c               $    V ^8  d   QhRRRRRR/# )r>   rc  rh  rD  r    r?   r  r@   )rA   s   "rB   rC   r     s"     0 03 0/ 0F\ 0rD   c                	n   V P                   P                  V4      pVe0   VP                  \        P                  \        P
                  09   d   V# V P                  4       p\        VP                  VP                  V4      p\        VP                  VP                  V4      p\        TVP                  e   VP                  MTVP                  e   VP                  MTVP                  e   VP                  M)\        VP                  V4      '       d   R MVP                  VP                  e   VP                  M)\        VP                  V4      '       d   R MVP                  VP                  e/   VP                  e!   \        VP                  VP                  4      M%VP                  e   VP                  MVP                  VP                   ;'       g    VP                   VP"                  e   VP"                  MVP"                  VP$                  e   VP$                  MVP$                  R7	      pV# )N)r[  r\  r]  r^  r  named_limitsextra_usagespend)r   r@  r  r!   r`  r  r   rg   r[  r]  r\  r^  r   ra   r  rm  r  r  r  )r   rc  rD  previousr]   carried_primarycarried_secondarys   &&&    rB   r>  Indicator._merge_snapshot  s   >>%%c*x<??LDWDW2XXOjjl$%%x'@'@#
 ''')D)Dc
  ,,8 ))$ ..: ++& ,,8 )) H55s;; .. ..: ++ H77== 00 &&2x7J7J7V H'')<)<= &&2 ((((!..GG(2G2G080D0D0P,,V^VjVj$,NN$>(..HNNG$
J rD   ))r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r}   r   r|   r   r   r   r   r{   r   )NNNNNNNNNNNNNNNNNNNNNre   )F)}__name__
__module____qualname____firstlineno__r   r   r   r   staticmethodr   r   r  r  r,  r*  r$  r(  r&  r'  r%  r}  ry  r  r  r  r  r  r  r  r   r  r  rA  r=  r?  r)  r  r^  r[  r0  r5  r  r  ra  ry  r  rs  rQ  r  r  r  r   r  r  r  r4  r  r  r  r  r  r  r  r  r  r  r5  r  r  r.  rR  r   r.  rP  rO  ro  r  rt  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r  r  r  r  r  rV  r\  r  r  r  r   ru  r   r   r  r  r  r  r  r  r   r  r?  r   r  r   r   r   r>  __static_attributes__r@   rD   rB   ry   ry   ~   s   S>j.-
 !- !-F 	*8eN 
 #'	

 
 
 
 
 = =!+Z&P   4		
*E4 @ 	@ @ 
 "	

 !
 #
 
       SF	0&(CT@(**$\ (9>%0'$<

&.	-
;-
^
,$	4>3A
"$L&
:& % % E E4Q8
tZXL,I
8DY:%N

  
 "&
o 6:	o
 15o &*obh
  h "&hT

 > <:$F/7


0:&& 1 1
[a
"	-#,6
$M	Ll.@@@0 0rD   ry   )h
__future__r   r}  r  r  rs   r.  r   rg  rT   dataclassesr   pathlibr   typingr   r   r   xml.sax.saxutilsr	   rT  r
   account_registryr   r   r   r   r   claude_auth_operationr   claude_health_clientr   device_authr   r   r   r   device_auth_dialogr   r   r   r   grok_auth_operationr   grok_health_clientr   gateway_account_managerr   r   r   authority_migrationr   r|   r   r    r!   health_storer"   r   r#   rH  r$   rh  popup_windowr%   r   r&   r'   r(   r)   runtime_pathsr*   	schedulerr+   r,   r-   
tray_modelr.   r/   r0   r1   ui.view_modelr2   r3   r4   r5   r6   r7   environr@  r   r   APPINDICATOR_ICON_WARNINGr   r  r  rK   rX   rY   ra   rg   rl   rw   ry   r@   rD   rB   <module>r     s;   " 	  
        ) ) # ) s s 5 3 ^ ^ F 5 1 / j j . L L , ; '  $ m m % Q Q ^ ^  **..  JJNN  JJNN"$  "$')"     %" T]4
66R! R!rD   