local-operator-ui 0.30.5 → 0.30.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/out/main/index.js +663 -42
  2. package/out/preload/index.js +40 -2
  3. package/out/renderer/assets/{_basePickBy-C4KSwmCT.js → _basePickBy-D5b3yDx8.js} +1 -1
  4. package/out/renderer/assets/{_baseUniq-Tv4U4nWm.js → _baseUniq-D1tkhcv6.js} +1 -1
  5. package/out/renderer/assets/agent-details-page-DZh__Ocy.js +6 -0
  6. package/out/renderer/assets/{agent-hub-page-wHxSp_GW.js → agent-hub-page-C_kDnp60.js} +2 -2
  7. package/out/renderer/assets/agents-page-CnB9CXuW.js +2 -0
  8. package/out/renderer/assets/{arc-DzD8wAPt.js → arc-CUyHzDaA.js} +1 -1
  9. package/out/renderer/assets/architectureDiagram-IEHRJDOE-Cvo28P8g.js +36 -0
  10. package/out/renderer/assets/{blockDiagram-JOT3LUYC-B6WAB17o.js → blockDiagram-JOT3LUYC-CCMUOsjA.js} +2 -2
  11. package/out/renderer/assets/browser-page-DcAY6eY-.js +1 -0
  12. package/out/renderer/assets/browser-webauthn-prompt-Bz42nxS6.js +1 -0
  13. package/out/renderer/assets/{c4Diagram-VJAJSXHY-BikcRrmj.js → c4Diagram-VJAJSXHY-DqacZ02T.js} +2 -2
  14. package/out/renderer/assets/channel-CNjcqKwB.js +1 -0
  15. package/out/renderer/assets/{chunk-4BMEZGHF-BK2w2E6b.js → chunk-4BMEZGHF-Vs_Om413.js} +1 -1
  16. package/out/renderer/assets/{chunk-A2AXSNBT-L5GYaZTn.js → chunk-A2AXSNBT-nlUPemkk.js} +1 -1
  17. package/out/renderer/assets/{chunk-AEK57VVT-Cf51xDme.js → chunk-AEK57VVT-BvAdLttG.js} +1 -1
  18. package/out/renderer/assets/{chunk-D6G4REZN-BNvdRpy_.js → chunk-D6G4REZN-B47lDjp3.js} +1 -1
  19. package/out/renderer/assets/{chunk-RZ5BOZE2-Cgmol7e5.js → chunk-RZ5BOZE2-BtJp8S0M.js} +1 -1
  20. package/out/renderer/assets/{chunk-XZIHB7SX-C0dlWEyM.js → chunk-XZIHB7SX-9C073wve.js} +1 -1
  21. package/out/renderer/assets/classDiagram-GIVACNV2-CQVISGwS.js +1 -0
  22. package/out/renderer/assets/classDiagram-v2-COTLJTTW-CQVISGwS.js +1 -0
  23. package/out/renderer/assets/clone-C38ets0J.js +1 -0
  24. package/out/renderer/assets/compact-pagination-DqAqETGQ.js +1 -0
  25. package/out/renderer/assets/console-mirror-BVW-_zui.js +44 -0
  26. package/out/renderer/assets/console-mirror-DOrYoP_4.css +32 -0
  27. package/out/renderer/assets/consoleCapture-BIeBPj-4.js +1 -0
  28. package/out/renderer/assets/dagre-OKDRZEBW-aOl_nKn1.js +4 -0
  29. package/out/renderer/assets/diagram-SSKATNLV-BuelnlQq.js +43 -0
  30. package/out/renderer/assets/diagram-VNBRO52H-CnvD7FYh.js +24 -0
  31. package/out/renderer/assets/erDiagram-Q7BY3M3F-DiuVMmfr.js +60 -0
  32. package/out/renderer/assets/{flowDiagram-4HSFHLVR-CayOnjMu.js → flowDiagram-4HSFHLVR-BKzqYFvF.js} +2 -2
  33. package/out/renderer/assets/{ganttDiagram-APWFNJXF-D1H-WlQG.js → ganttDiagram-APWFNJXF-BR8sfw6V.js} +2 -2
  34. package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-DBUM9S0w.js +65 -0
  35. package/out/renderer/assets/{graph-DING6zyF.js → graph-By8JgBue.js} +1 -1
  36. package/out/renderer/assets/icon-BQh0NRL5.js +146 -0
  37. package/out/renderer/assets/{index-B8L0Kiwp.js → index-Bv85BxaP.js} +418 -403
  38. package/out/renderer/assets/index-Q1Oi0B95.js +55 -0
  39. package/out/renderer/assets/index-kvxi4VOW.js +7 -0
  40. package/out/renderer/assets/index-n0ogWXxx.css +1 -0
  41. package/out/renderer/assets/index-up32o88v.js +1 -0
  42. package/out/renderer/assets/infoDiagram-PH2N3AL5-BhD7ac-z.js +2 -0
  43. package/out/renderer/assets/{installer-xkP9rTvG.js → installer-CbTFoEpL.js} +3 -3
  44. package/out/renderer/assets/{journeyDiagram-U35MCT3I-BZUoUByB.js → journeyDiagram-U35MCT3I-Dv2mu_Re.js} +2 -2
  45. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-pdihKIeu.js → kanban-definition-NDS4AKOZ-BqBdPTZf.js} +2 -2
  46. package/out/renderer/assets/{layout-BzsmzZSv.js → layout-DzuHNJry.js} +1 -1
  47. package/out/renderer/assets/{legacy-agents-page-BQdlRR2j.js → legacy-agents-page-B1YsuHQM.js} +3 -3
  48. package/out/renderer/assets/{mermaid.core-BuXyhIZv.js → mermaid.core-DymZo21v.js} +19 -19
  49. package/out/renderer/assets/mindmap-definition-ALO5MXBD-BMN7owbo.js +95 -0
  50. package/out/renderer/assets/page-header-Cc0XdSll.js +1 -0
  51. package/out/renderer/assets/{parseISO-FjLu4rnm.js → parseISO-0hNehfLH.js} +1 -1
  52. package/out/renderer/assets/{pieDiagram-IB7DONF6-DSJv21tC.js → pieDiagram-IB7DONF6-D0dvCyyn.js} +2 -2
  53. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-xXstR1Vf.js → quadrantDiagram-7GDLP6J5-Bkb3lcZe.js} +2 -2
  54. package/out/renderer/assets/{radar-MK3ICKWK-iY9ggxmQ.js → radar-MK3ICKWK-2JuG8irb.js} +1 -1
  55. package/out/renderer/assets/radient-auth-buttons-C2cd-JNV.js +6 -0
  56. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-C3wkWBba.js → requirementDiagram-KVF5MWMF-DE_-TcrO.js} +2 -2
  57. package/out/renderer/assets/sankeyDiagram-QLVOVGJD-BoMvFI-6.js +10 -0
  58. package/out/renderer/assets/{schedules-page-Du06WRO3.js → schedules-page-CQpjyrDH.js} +9 -9
  59. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-BAJqm7xV.js → sequenceDiagram-X6HHIX6F-BMcSZEau.js} +2 -2
  60. package/out/renderer/assets/{settings-page-DTvd2Uj2.js → settings-page-CEH0ix19.js} +66 -71
  61. package/out/renderer/assets/stateDiagram-DGXRK772-B6DVk8hu.js +1 -0
  62. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-DTKEGiyu.js +1 -0
  63. package/out/renderer/assets/{timeline-definition-BDJGKUSR-BpywGcxh.js → timeline-definition-BDJGKUSR-CkMFtRgw.js} +2 -2
  64. package/out/renderer/assets/use-agent-like-mutation-C7OkrJmI.js +1 -0
  65. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-BLfYh75R.js → xychartDiagram-VJFVF3MP-uj7ccV7g.js} +2 -2
  66. package/out/renderer/console-capture.html +20 -0
  67. package/out/renderer/index.html +6 -3
  68. package/out/renderer/installer.html +4 -3
  69. package/package.json +6 -3
  70. package/out/renderer/assets/agent-details-page-Cr8W7y-H.js +0 -6
  71. package/out/renderer/assets/agents-page-CvzMQcXA.js +0 -2
  72. package/out/renderer/assets/architectureDiagram-IEHRJDOE-Bdg3auIF.js +0 -36
  73. package/out/renderer/assets/browser-page-Cwj3W0B7.js +0 -1
  74. package/out/renderer/assets/browser-webauthn-prompt-HQaxvM7Z.js +0 -1
  75. package/out/renderer/assets/channel-DkQdMXxf.js +0 -1
  76. package/out/renderer/assets/classDiagram-GIVACNV2-CduP7VCg.js +0 -1
  77. package/out/renderer/assets/classDiagram-v2-COTLJTTW-CduP7VCg.js +0 -1
  78. package/out/renderer/assets/clone-ByK_vrzo.js +0 -1
  79. package/out/renderer/assets/compact-pagination-DJ3iOLPw.js +0 -1
  80. package/out/renderer/assets/dagre-OKDRZEBW-CO96SQ8V.js +0 -4
  81. package/out/renderer/assets/diagram-SSKATNLV-CZy8Uth3.js +0 -43
  82. package/out/renderer/assets/diagram-VNBRO52H-xj2birJB.js +0 -24
  83. package/out/renderer/assets/erDiagram-Q7BY3M3F-Da-RbfXv.js +0 -60
  84. package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-U4UfZBoD.js +0 -65
  85. package/out/renderer/assets/icon-BfZhrs0k.js +0 -200
  86. package/out/renderer/assets/icon-Bv_GhQh2.css +0 -1
  87. package/out/renderer/assets/index-B8ll31iK.js +0 -7
  88. package/out/renderer/assets/index-UJlKYaYv.js +0 -1
  89. package/out/renderer/assets/infoDiagram-PH2N3AL5-cfKlqrgd.js +0 -2
  90. package/out/renderer/assets/mindmap-definition-ALO5MXBD-DPrERxrY.js +0 -95
  91. package/out/renderer/assets/page-header-Dwwd9Ozp.js +0 -1
  92. package/out/renderer/assets/radient-auth-buttons-Bt3YWj-N.js +0 -6
  93. package/out/renderer/assets/sankeyDiagram-QLVOVGJD-Bl717LGh.js +0 -10
  94. package/out/renderer/assets/stateDiagram-DGXRK772-CakcCsbw.js +0 -1
  95. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-C9clUakK.js +0 -1
  96. package/out/renderer/assets/use-agent-like-mutation-BwgCtL8B.js +0 -1
@@ -1,317 +1,312 @@
1
- import{a as v,r as o,j as e,B as _,S as J,Q as ht,o as Me,G as Fe,U as qt,I as ne,T as $e,b as pt,d as ft,e as xt,f as gt,g as De,c as W,A as G,X as Ht,J as Ae,L as de,V as Bt,Y as yt,i as Vt,k as Gt,Z as Kt,_ as Yt,O as Zt,q as Qt,h as vt}from"./icon-BfZhrs0k.js";import{bX as Wt,bY as Ke,bZ as Ye,b_ as Jt,bp as Xt,g as ve,bq as kt,br as Pe,ar as bt,f as jt,a6 as ea,at as ta,b$ as aa,c0 as sa,c1 as na,c2 as ra,c3 as wt,b8 as oa,c4 as Ue,c5 as Nt,aH as ia,c6 as Ze,c7 as ca,b as qe,d as Ee,ac as la,c8 as da,ap as ua,j as ge,c9 as _t,ca as ma,bw as St,cb as Ct,cc as ha,cd as Re,az as pa,aA as Mt,ce as At,cf as be,aq as fa,cg as Et,ch as xa,P as ga,i as _e,ci as ya,cj as va,ck as Te,cl as Rt,cm as ka,cn as ba,co as Tt,cp as ja,cq as wa,cr as Na,cs as _a,a4 as Sa,ct as Lt,aJ as It,cu as Ca,cv as zt,cw as Ma,cx as Aa,ax as Ea,cy as Ft,bQ as Oe,cz as Ra,bC as Ta,cA as La,bz as Ia,cB as za,cC as Fa,bt as $a,cD as Da,cE as Oa,cF as Pa,bl as Qe,cG as Ua,by as We,cH as qa,bA as Ha,bB as Ba,bx as Le,cI as Va,cJ as Ga,cK as Ka,cL as Ya,cM as Za,cN as Qa}from"./index-B8L0Kiwp.js";import{P as Wa}from"./page-header-Dwwd9Ozp.js";import{S as V,I as He,a as Z,R as Ja,N as Xa}from"./radient-auth-buttons-Bt3YWj-N.js";import{i as es,a as he,b as ts,H as as,p as Ie,f as ss}from"./parseISO-FjLu4rnm.js";/**
1
+ import{r as o,j as e,c as W,t as qt}from"./index-Q1Oi0B95.js";import{bU as Ht,bV as Ke,bW as Ye,bX as Bt,bp as Vt,g as ve,bq as ht,br as Pe,ar as pt,f as ft,a6 as Gt,at as Kt,bY as Yt,bZ as Zt,b_ as Qt,b$ as Wt,c0 as xt,b8 as Jt,c1 as Ue,c2 as gt,aH as Xt,c3 as Ze,c4 as ea,b as qe,d as Me,ac as ta,c5 as aa,ap as sa,j as ge,c6 as yt,c7 as na,bw as vt,c8 as kt,c9 as ra,ca as oa,cb as Ae,az as ia,aA as bt,cc as jt,cd as be,aq as ca,ce as wt,cf as la,P as da,i as _e,cg as ua,ch as ma,ci as Te,cj as Nt,ck as ha,cl as pa,cm as _t,cn as fa,co as xa,cp as ga,cq as ya,a4 as va,cr as St,aJ as Ct,cs as ka,ct as Mt,cu as ba,cv as ja,ax as wa,cw as At,cx as Na,bC as _a,cy as Sa,bz as Ca,cz as Ma,cA as Aa,bt as Ea,cB as Ra,cC as Ta,cD as La,bl as Qe,cE as Ia,by as We,cF as za,bA as Fa,bB as $a,bx as Le,cG as Da,cH as Oa,cI as Pa,cJ as Ua,cK as qa,cL as Ha}from"./index-Bv85BxaP.js";import{P as Ba}from"./page-header-Cc0XdSll.js";import{c as v,B as _,S as J,F as Et,m as Ee,u as Fe,G as Va,I as ne,T as $e,a as Rt,b as Tt,d as Lt,e as It,f as De,A as G,X as Ga,v as Re,L as de,J as Ka,K as zt,h as Ya,i as Za,R as Qa,z as Wa,n as Ja,g as Ft}from"./icon-BQh0NRL5.js";import{u as Oe}from"./console-mirror-BVW-_zui.js";import{S as V,I as He,a as Z,R as Xa,N as es}from"./radient-auth-buttons-C2cd-JNV.js";import{i as ts,a as he,b as as,H as ss,p as Ie,f as ns}from"./parseISO-0hNehfLH.js";/**
2
2
  * @license lucide-react v0.507.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const ns=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m14.31 8 5.74 9.94",key:"1y6ab4"}],["path",{d:"M9.69 8h11.48",key:"1wxppr"}],["path",{d:"m7.38 12 5.74-9.94",key:"1grp0k"}],["path",{d:"M9.69 16 3.95 6.06",key:"libnyf"}],["path",{d:"M14.31 16H2.83",key:"x5fava"}],["path",{d:"m16.62 12-5.74 9.94",key:"1vwawt"}]],rs=v("aperture",ns);/**
6
+ */const rs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m14.31 8 5.74 9.94",key:"1y6ab4"}],["path",{d:"M9.69 8h11.48",key:"1wxppr"}],["path",{d:"m7.38 12 5.74-9.94",key:"1grp0k"}],["path",{d:"M9.69 16 3.95 6.06",key:"libnyf"}],["path",{d:"M14.31 16H2.83",key:"x5fava"}],["path",{d:"m16.62 12-5.74 9.94",key:"1vwawt"}]],os=v("aperture",rs);/**
7
7
  * @license lucide-react v0.507.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const os=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]],is=v("atom",os);/**
11
+ */const is=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]],cs=v("atom",is);/**
12
12
  * @license lucide-react v0.507.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const cs=[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]],ls=v("audio-waveform",cs);/**
16
+ */const ls=[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]],ds=v("audio-waveform",ls);/**
17
17
  * @license lucide-react v0.507.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const ds=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],us=v("binary",ds);/**
21
+ */const us=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],ms=v("binary",us);/**
22
22
  * @license lucide-react v0.507.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const ms=[["path",{d:"M10 7v10.9",key:"1gynux"}],["path",{d:"M14 6.1V17",key:"116kdf"}],["path",{d:"M16 7V3a1 1 0 0 1 1.707-.707 2.5 2.5 0 0 0 2.152.717 1 1 0 0 1 1.131 1.131 2.5 2.5 0 0 0 .717 2.152A1 1 0 0 1 21 8h-4",key:"gpb6xx"}],["path",{d:"M16.536 7.465a5 5 0 0 0-7.072 0l-2 2a5 5 0 0 0 0 7.07 5 5 0 0 0 7.072 0l2-2a5 5 0 0 0 0-7.07",key:"1tsln4"}],["path",{d:"M8 17v4a1 1 0 0 1-1.707.707 2.5 2.5 0 0 0-2.152-.717 1 1 0 0 1-1.131-1.131 2.5 2.5 0 0 0-.717-2.152A1 1 0 0 1 3 16h4",key:"qexcha"}]],hs=v("candy",ms);/**
26
+ */const hs=[["path",{d:"M10 7v10.9",key:"1gynux"}],["path",{d:"M14 6.1V17",key:"116kdf"}],["path",{d:"M16 7V3a1 1 0 0 1 1.707-.707 2.5 2.5 0 0 0 2.152.717 1 1 0 0 1 1.131 1.131 2.5 2.5 0 0 0 .717 2.152A1 1 0 0 1 21 8h-4",key:"gpb6xx"}],["path",{d:"M16.536 7.465a5 5 0 0 0-7.072 0l-2 2a5 5 0 0 0 0 7.07 5 5 0 0 0 7.072 0l2-2a5 5 0 0 0 0-7.07",key:"1tsln4"}],["path",{d:"M8 17v4a1 1 0 0 1-1.707.707 2.5 2.5 0 0 0-2.152-.717 1 1 0 0 1-1.131-1.131 2.5 2.5 0 0 0-.717-2.152A1 1 0 0 1 3 16h4",key:"qexcha"}]],ps=v("candy",hs);/**
27
27
  * @license lucide-react v0.507.0 - ISC
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
- */const ps=[["path",{d:"m21 8-2 2-1.5-3.7A2 2 0 0 0 15.646 5H8.4a2 2 0 0 0-1.903 1.257L5 10 3 8",key:"1imjwt"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 14h.01",key:"7oqj8z"}],["rect",{width:"18",height:"8",x:"3",y:"10",rx:"2",key:"a7itu8"}],["path",{d:"M5 18v2",key:"ppbyun"}],["path",{d:"M19 18v2",key:"gy7782"}]],fs=v("car-front",ps);/**
31
+ */const fs=[["path",{d:"m21 8-2 2-1.5-3.7A2 2 0 0 0 15.646 5H8.4a2 2 0 0 0-1.903 1.257L5 10 3 8",key:"1imjwt"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 14h.01",key:"7oqj8z"}],["rect",{width:"18",height:"8",x:"3",y:"10",rx:"2",key:"a7itu8"}],["path",{d:"M5 18v2",key:"ppbyun"}],["path",{d:"M19 18v2",key:"gy7782"}]],xs=v("car-front",fs);/**
32
32
  * @license lucide-react v0.507.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */const xs=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["circle",{cx:"8",cy:"10",r:"2",key:"1xl4ub"}],["path",{d:"M8 12h8",key:"1wcyev"}],["circle",{cx:"16",cy:"10",r:"2",key:"r14t7q"}],["path",{d:"m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3",key:"l01ucn"}]],gs=v("cassette-tape",xs);/**
36
+ */const gs=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["circle",{cx:"8",cy:"10",r:"2",key:"1xl4ub"}],["path",{d:"M8 12h8",key:"1wcyev"}],["circle",{cx:"16",cy:"10",r:"2",key:"r14t7q"}],["path",{d:"m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3",key:"l01ucn"}]],ys=v("cassette-tape",gs);/**
37
37
  * @license lucide-react v0.507.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
- */const ys=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],vs=v("chart-line",ys);/**
41
+ */const vs=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],ks=v("chart-line",vs);/**
42
42
  * @license lucide-react v0.507.0 - ISC
43
43
  *
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
- */const ks=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],bs=v("circle-play",ks);/**
46
+ */const bs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],js=v("circle-play",bs);/**
47
47
  * @license lucide-react v0.507.0 - ISC
48
48
  *
49
49
  * This source code is licensed under the ISC license.
50
50
  * See the LICENSE file in the root directory of this source tree.
51
- */const js=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],ws=v("circle-plus",js);/**
51
+ */const ws=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Ns=v("circle-plus",ws);/**
52
52
  * @license lucide-react v0.507.0 - ISC
53
53
  *
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const Ns=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M11 9h4a2 2 0 0 0 2-2V3",key:"1ve2rv"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"M7 21v-4a2 2 0 0 1 2-2h4",key:"1fwkro"}],["circle",{cx:"15",cy:"15",r:"2",key:"3i40o0"}]],_s=v("circuit-board",Ns);/**
56
+ */const _s=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M11 9h4a2 2 0 0 0 2-2V3",key:"1ve2rv"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"M7 21v-4a2 2 0 0 1 2-2h4",key:"1fwkro"}],["circle",{cx:"15",cy:"15",r:"2",key:"3i40o0"}]],Ss=v("circuit-board",_s);/**
57
57
  * @license lucide-react v0.507.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
- */const Ss=[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]],Cs=v("cloud-lightning",Ss);/**
61
+ */const Cs=[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]],Ms=v("cloud-lightning",Cs);/**
62
62
  * @license lucide-react v0.507.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
- */const Ms=[["path",{d:"M10.188 8.5A6 6 0 0 1 16 4a1 1 0 0 0 6 6 6 6 0 0 1-3 5.197",key:"erj67n"}],["path",{d:"M13 16a3 3 0 1 1 0 6H7a5 5 0 1 1 4.9-6Z",key:"p44pc9"}]],As=v("cloud-moon",Ms);/**
66
+ */const As=[["path",{d:"M10.188 8.5A6 6 0 0 1 16 4a1 1 0 0 0 6 6 6 6 0 0 1-3 5.197",key:"erj67n"}],["path",{d:"M13 16a3 3 0 1 1 0 6H7a5 5 0 1 1 4.9-6Z",key:"p44pc9"}]],Es=v("cloud-moon",As);/**
67
67
  * @license lucide-react v0.507.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
71
- */const Es=[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M8 19h.01",key:"puxtts"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M12 21h.01",key:"h35vbk"}],["path",{d:"M16 15h.01",key:"rnfrdf"}],["path",{d:"M16 19h.01",key:"1vcnzz"}]],Rs=v("cloud-snow",Es);/**
71
+ */const Rs=[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M8 19h.01",key:"puxtts"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M12 21h.01",key:"h35vbk"}],["path",{d:"M16 15h.01",key:"rnfrdf"}],["path",{d:"M16 19h.01",key:"1vcnzz"}]],Ts=v("cloud-snow",Rs);/**
72
72
  * @license lucide-react v0.507.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
- */const Ts=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}],["path",{d:"M15.947 12.65a4 4 0 0 0-5.925-4.128",key:"dpwdj0"}],["path",{d:"M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z",key:"s09mg5"}]],Ls=v("cloud-sun",Ts);/**
76
+ */const Ls=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}],["path",{d:"M15.947 12.65a4 4 0 0 0-5.925-4.128",key:"dpwdj0"}],["path",{d:"M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z",key:"s09mg5"}]],Is=v("cloud-sun",Ls);/**
77
77
  * @license lucide-react v0.507.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
- */const Is=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],zs=v("coffee",Is);/**
81
+ */const zs=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],Fs=v("coffee",zs);/**
82
82
  * @license lucide-react v0.507.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
- */const Fs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],$t=v("contrast",Fs);/**
86
+ */const $s=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],$t=v("contrast",$s);/**
87
87
  * @license lucide-react v0.507.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const $s=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ds=v("credit-card",$s);/**
91
+ */const Ds=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Os=v("credit-card",Ds);/**
92
92
  * @license lucide-react v0.507.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const Os=[["path",{d:"m6 8 1.75 12.28a2 2 0 0 0 2 1.72h4.54a2 2 0 0 0 2-1.72L18 8",key:"8166m8"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M7 15a6.47 6.47 0 0 1 5 0 6.47 6.47 0 0 0 5 0",key:"yjz344"}],["path",{d:"m12 8 1-6h2",key:"3ybfa4"}]],Ps=v("cup-soda",Os);/**
96
+ */const Ps=[["path",{d:"m6 8 1.75 12.28a2 2 0 0 0 2 1.72h4.54a2 2 0 0 0 2-1.72L18 8",key:"8166m8"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M7 15a6.47 6.47 0 0 1 5 0 6.47 6.47 0 0 0 5 0",key:"yjz344"}],["path",{d:"m12 8 1-6h2",key:"3ybfa4"}]],Us=v("cup-soda",Ps);/**
97
97
  * @license lucide-react v0.507.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const Us=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],qs=v("disc-3",Us);/**
101
+ */const qs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],Hs=v("disc-3",qs);/**
102
102
  * @license lucide-react v0.507.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
- */const Hs=[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]],Bs=v("droplet",Hs);/**
106
+ */const Bs=[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]],Vs=v("droplet",Bs);/**
107
107
  * @license lucide-react v0.507.0 - ISC
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const Vs=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],Gs=v("droplets",Vs);/**
111
+ */const Gs=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],Ks=v("droplets",Gs);/**
112
112
  * @license lucide-react v0.507.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
- */const Ks=[["path",{d:"M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z",key:"15baut"}],["path",{d:"M18 12v.5",key:"18hhni"}],["path",{d:"M16 17.93a9.77 9.77 0 0 1 0-11.86",key:"16dt7o"}],["path",{d:"M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33",key:"l9di03"}],["path",{d:"M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4",key:"1kjonw"}],["path",{d:"m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98",key:"1zlm23"}]],Ys=v("fish",Ks);/**
116
+ */const Ys=[["path",{d:"M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z",key:"15baut"}],["path",{d:"M18 12v.5",key:"18hhni"}],["path",{d:"M16 17.93a9.77 9.77 0 0 1 0-11.86",key:"16dt7o"}],["path",{d:"M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33",key:"l9di03"}],["path",{d:"M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4",key:"1kjonw"}],["path",{d:"m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98",key:"1zlm23"}]],Zs=v("fish",Ys);/**
117
117
  * @license lucide-react v0.507.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
120
120
  * See the LICENSE file in the root directory of this source tree.
121
- */const Zs=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],Qs=v("flame",Zs);/**
121
+ */const Qs=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],Ws=v("flame",Qs);/**
122
122
  * @license lucide-react v0.507.0 - ISC
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
- */const Ws=[["path",{d:"M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1",key:"3pnvol"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M12 10v12",key:"6ubwww"}],["path",{d:"M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z",key:"9hd38g"}],["path",{d:"M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z",key:"ufn41s"}]],Js=v("flower-2",Ws);/**
126
+ */const Js=[["path",{d:"M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1",key:"3pnvol"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M12 10v12",key:"6ubwww"}],["path",{d:"M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z",key:"9hd38g"}],["path",{d:"M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z",key:"ufn41s"}]],Xs=v("flower-2",Js);/**
127
127
  * @license lucide-react v0.507.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
- */const Xs=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",key:"14wa3c"}],["path",{d:"M12 7.5V9",key:"1oy5b0"}],["path",{d:"M7.5 12H9",key:"eltsq1"}],["path",{d:"M16.5 12H15",key:"vk5kw4"}],["path",{d:"M12 16.5V15",key:"k7eayi"}],["path",{d:"m8 8 1.88 1.88",key:"nxy4qf"}],["path",{d:"M14.12 9.88 16 8",key:"1lst6k"}],["path",{d:"m8 16 1.88-1.88",key:"h2eex1"}],["path",{d:"M14.12 14.12 16 16",key:"uqkrx3"}]],en=v("flower",Xs);/**
131
+ */const en=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",key:"14wa3c"}],["path",{d:"M12 7.5V9",key:"1oy5b0"}],["path",{d:"M7.5 12H9",key:"eltsq1"}],["path",{d:"M16.5 12H15",key:"vk5kw4"}],["path",{d:"M12 16.5V15",key:"k7eayi"}],["path",{d:"m8 8 1.88 1.88",key:"nxy4qf"}],["path",{d:"M14.12 9.88 16 8",key:"1lst6k"}],["path",{d:"m8 16 1.88-1.88",key:"h2eex1"}],["path",{d:"M14.12 14.12 16 16",key:"uqkrx3"}]],tn=v("flower",en);/**
132
132
  * @license lucide-react v0.507.0 - ISC
133
133
  *
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
- */const tn=[["path",{d:"M9 10h.01",key:"qbtxuw"}],["path",{d:"M15 10h.01",key:"1qmjsl"}],["path",{d:"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",key:"uwwb07"}]],an=v("ghost",tn);/**
136
+ */const an=[["path",{d:"M9 10h.01",key:"qbtxuw"}],["path",{d:"M15 10h.01",key:"1qmjsl"}],["path",{d:"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",key:"uwwb07"}]],sn=v("ghost",an);/**
137
137
  * @license lucide-react v0.507.0 - ISC
138
138
  *
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
- */const sn=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],nn=v("github",sn);/**
141
+ */const nn=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],rn=v("github",nn);/**
142
142
  * @license lucide-react v0.507.0 - ISC
143
143
  *
144
144
  * This source code is licensed under the ISC license.
145
145
  * See the LICENSE file in the root directory of this source tree.
146
- */const rn=[["path",{d:"m11.9 12.1 4.514-4.514",key:"109xqo"}],["path",{d:"M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z",key:"txyc8t"}],["path",{d:"m6 16 2 2",key:"16qmzd"}],["path",{d:"M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z",key:"1de1vg"}]],on=v("guitar",rn);/**
146
+ */const on=[["path",{d:"m11.9 12.1 4.514-4.514",key:"109xqo"}],["path",{d:"M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z",key:"txyc8t"}],["path",{d:"m6 16 2 2",key:"16qmzd"}],["path",{d:"M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z",key:"1de1vg"}]],cn=v("guitar",on);/**
147
147
  * @license lucide-react v0.507.0 - ISC
148
148
  *
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
- */const cn=[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]],ln=v("hexagon",cn);/**
151
+ */const ln=[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]],dn=v("hexagon",ln);/**
152
152
  * @license lucide-react v0.507.0 - ISC
153
153
  *
154
154
  * This source code is licensed under the ISC license.
155
155
  * See the LICENSE file in the root directory of this source tree.
156
- */const dn=[["path",{d:"M12 17c5 0 8-2.69 8-6H4c0 3.31 3 6 8 6m-4 4h8m-4-3v3M5.14 11a3.5 3.5 0 1 1 6.71 0",key:"1uxfcu"}],["path",{d:"M12.14 11a3.5 3.5 0 1 1 6.71 0",key:"4k3m1s"}],["path",{d:"M15.5 6.5a3.5 3.5 0 1 0-7 0",key:"zmuahr"}]],un=v("ice-cream-bowl",dn);/**
156
+ */const un=[["path",{d:"M12 17c5 0 8-2.69 8-6H4c0 3.31 3 6 8 6m-4 4h8m-4-3v3M5.14 11a3.5 3.5 0 1 1 6.71 0",key:"1uxfcu"}],["path",{d:"M12.14 11a3.5 3.5 0 1 1 6.71 0",key:"4k3m1s"}],["path",{d:"M15.5 6.5a3.5 3.5 0 1 0-7 0",key:"zmuahr"}]],mn=v("ice-cream-bowl",un);/**
157
157
  * @license lucide-react v0.507.0 - ISC
158
158
  *
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
- */const mn=[["path",{d:"M21 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2Z",key:"jg2n2t"}],["path",{d:"M6 15v-2",key:"gd6mvg"}],["path",{d:"M12 15V9",key:"8c7uyn"}],["circle",{cx:"12",cy:"6",r:"3",key:"1gm2ql"}]],hn=v("joystick",mn);/**
161
+ */const hn=[["path",{d:"M21 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2Z",key:"jg2n2t"}],["path",{d:"M6 15v-2",key:"gd6mvg"}],["path",{d:"M12 15V9",key:"8c7uyn"}],["circle",{cx:"12",cy:"6",r:"3",key:"1gm2ql"}]],pn=v("joystick",hn);/**
162
162
  * @license lucide-react v0.507.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
- */const pn=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],fn=v("leaf",pn);/**
166
+ */const fn=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],xn=v("leaf",fn);/**
167
167
  * @license lucide-react v0.507.0 - ISC
168
168
  *
169
169
  * This source code is licensed under the ISC license.
170
170
  * See the LICENSE file in the root directory of this source tree.
171
- */const xn=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],gn=v("lightbulb",xn);/**
171
+ */const gn=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],yn=v("lightbulb",gn);/**
172
172
  * @license lucide-react v0.507.0 - ISC
173
173
  *
174
174
  * This source code is licensed under the ISC license.
175
175
  * See the LICENSE file in the root directory of this source tree.
176
- */const yn=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],vn=v("lock",yn);/**
176
+ */const vn=[["path",{d:"M8 2h8",key:"1ssgc1"}],["path",{d:"M9 2v2.789a4 4 0 0 1-.672 2.219l-.656.984A4 4 0 0 0 7 10.212V20a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-9.789a4 4 0 0 0-.672-2.219l-.656-.984A4 4 0 0 1 15 4.788V2",key:"qtp12x"}],["path",{d:"M7 15a6.472 6.472 0 0 1 5 0 6.47 6.47 0 0 0 5 0",key:"ygeh44"}]],kn=v("milk",vn);/**
177
177
  * @license lucide-react v0.507.0 - ISC
178
178
  *
179
179
  * This source code is licensed under the ISC license.
180
180
  * See the LICENSE file in the root directory of this source tree.
181
- */const kn=[["path",{d:"M8 2h8",key:"1ssgc1"}],["path",{d:"M9 2v2.789a4 4 0 0 1-.672 2.219l-.656.984A4 4 0 0 0 7 10.212V20a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-9.789a4 4 0 0 0-.672-2.219l-.656-.984A4 4 0 0 1 15 4.788V2",key:"qtp12x"}],["path",{d:"M7 15a6.472 6.472 0 0 1 5 0 6.47 6.47 0 0 0 5 0",key:"ygeh44"}]],bn=v("milk",kn);/**
181
+ */const bn=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]],jn=v("moon-star",bn);/**
182
182
  * @license lucide-react v0.507.0 - ISC
183
183
  *
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
- */const jn=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]],wn=v("moon-star",jn);/**
186
+ */const wn=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Nn=v("moon",wn);/**
187
187
  * @license lucide-react v0.507.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
- */const Nn=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],_n=v("moon",Nn);/**
191
+ */const _n=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}],["path",{d:"M4.14 15.08c2.62-1.57 5.24-1.43 7.86.42 2.74 1.94 5.49 2 8.23.19",key:"1pvmmp"}]],Sn=v("mountain-snow",_n);/**
192
192
  * @license lucide-react v0.507.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const Sn=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}],["path",{d:"M4.14 15.08c2.62-1.57 5.24-1.43 7.86.42 2.74 1.94 5.49 2 8.23.19",key:"1pvmmp"}]],Cn=v("mountain-snow",Sn);/**
196
+ */const Cn=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],Mn=v("mountain",Cn);/**
197
197
  * @license lucide-react v0.507.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
- */const Mn=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],An=v("mountain",Mn);/**
201
+ */const An=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],En=v("plug-zap",An);/**
202
202
  * @license lucide-react v0.507.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
- */const En=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],Rn=v("plug-zap",En);/**
206
+ */const Rn=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],Tn=v("radio",Rn);/**
207
207
  * @license lucide-react v0.507.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
210
210
  * See the LICENSE file in the root directory of this source tree.
211
- */const Tn=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],Ln=v("radio",Tn);/**
211
+ */const Ln=[["path",{d:"M22 18H2a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4Z",key:"1404fh"}],["path",{d:"M21 14 10 2 3 14h18Z",key:"1nzg7v"}],["path",{d:"M10 2v16",key:"1labyt"}]],In=v("sailboat",Ln);/**
212
212
  * @license lucide-react v0.507.0 - ISC
213
213
  *
214
214
  * This source code is licensed under the ISC license.
215
215
  * See the LICENSE file in the root directory of this source tree.
216
- */const In=[["path",{d:"M22 18H2a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4Z",key:"1404fh"}],["path",{d:"M21 14 10 2 3 14h18Z",key:"1nzg7v"}],["path",{d:"M10 2v16",key:"1labyt"}]],zn=v("sailboat",In);/**
216
+ */const zn=[["path",{d:"M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",key:"1wgbhj"}]],Fn=v("shirt",zn);/**
217
217
  * @license lucide-react v0.507.0 - ISC
218
218
  *
219
219
  * This source code is licensed under the ISC license.
220
220
  * See the LICENSE file in the root directory of this source tree.
221
- */const Fn=[["path",{d:"M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",key:"1wgbhj"}]],$n=v("shirt",Fn);/**
221
+ */const $n=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],Dn=v("skull",$n);/**
222
222
  * @license lucide-react v0.507.0 - ISC
223
223
  *
224
224
  * This source code is licensed under the ISC license.
225
225
  * See the LICENSE file in the root directory of this source tree.
226
- */const Dn=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],On=v("skull",Dn);/**
226
+ */const On=[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]],Pn=v("snowflake",On);/**
227
227
  * @license lucide-react v0.507.0 - ISC
228
228
  *
229
229
  * This source code is licensed under the ISC license.
230
230
  * See the LICENSE file in the root directory of this source tree.
231
- */const Pn=[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]],Un=v("snowflake",Pn);/**
231
+ */const Un=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]],qn=v("sparkle",Un);/**
232
232
  * @license lucide-react v0.507.0 - ISC
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
- */const qn=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]],Hn=v("sparkle",qn);/**
236
+ */const Hn=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 4h.01",key:"1ujb9j"}],["path",{d:"M20 12h.01",key:"1ykeid"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M4 12h.01",key:"158zrr"}],["path",{d:"M17.657 6.343h.01",key:"31pqzk"}],["path",{d:"M17.657 17.657h.01",key:"jehnf4"}],["path",{d:"M6.343 17.657h.01",key:"gdk6ow"}],["path",{d:"M6.343 6.343h.01",key:"1uurf0"}]],Bn=v("sun-dim",Hn);/**
237
237
  * @license lucide-react v0.507.0 - ISC
238
238
  *
239
239
  * This source code is licensed under the ISC license.
240
240
  * See the LICENSE file in the root directory of this source tree.
241
- */const Bn=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 4h.01",key:"1ujb9j"}],["path",{d:"M20 12h.01",key:"1ykeid"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M4 12h.01",key:"158zrr"}],["path",{d:"M17.657 6.343h.01",key:"31pqzk"}],["path",{d:"M17.657 17.657h.01",key:"jehnf4"}],["path",{d:"M6.343 17.657h.01",key:"gdk6ow"}],["path",{d:"M6.343 6.343h.01",key:"1uurf0"}]],Vn=v("sun-dim",Bn);/**
241
+ */const Vn=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Gn=v("sun",Vn);/**
242
242
  * @license lucide-react v0.507.0 - ISC
243
243
  *
244
244
  * This source code is licensed under the ISC license.
245
245
  * See the LICENSE file in the root directory of this source tree.
246
- */const Gn=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Kn=v("sun",Gn);/**
246
+ */const Kn=[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]],Yn=v("sunrise",Kn);/**
247
247
  * @license lucide-react v0.507.0 - ISC
248
248
  *
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
- */const Yn=[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]],Zn=v("sunrise",Yn);/**
251
+ */const Zn=[["path",{d:"M12 10V2",key:"16sf7g"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]],Qn=v("sunset",Zn);/**
252
252
  * @license lucide-react v0.507.0 - ISC
253
253
  *
254
254
  * This source code is licensed under the ISC license.
255
255
  * See the LICENSE file in the root directory of this source tree.
256
- */const Qn=[["path",{d:"M12 10V2",key:"16sf7g"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]],Wn=v("sunset",Qn);/**
256
+ */const Wn=[["path",{d:"M3.5 21 14 3",key:"1szst5"}],["path",{d:"M20.5 21 10 3",key:"1310c3"}],["path",{d:"M15.5 21 12 15l-3.5 6",key:"1ddtfw"}],["path",{d:"M2 21h20",key:"1nyx9w"}]],Jn=v("tent",Wn);/**
257
257
  * @license lucide-react v0.507.0 - ISC
258
258
  *
259
259
  * This source code is licensed under the ISC license.
260
260
  * See the LICENSE file in the root directory of this source tree.
261
- */const Jn=[["path",{d:"M3.5 21 14 3",key:"1szst5"}],["path",{d:"M20.5 21 10 3",key:"1310c3"}],["path",{d:"M15.5 21 12 15l-3.5 6",key:"1ddtfw"}],["path",{d:"M2 21h20",key:"1nyx9w"}]],Xn=v("tent",Jn);/**
261
+ */const Xn=[["path",{d:"M8 19a4 4 0 0 1-2.24-7.32A3.5 3.5 0 0 1 9 6.03V6a3 3 0 1 1 6 0v.04a3.5 3.5 0 0 1 3.24 5.65A4 4 0 0 1 16 19Z",key:"oadzkq"}],["path",{d:"M12 19v3",key:"npa21l"}]],er=v("tree-deciduous",Xn);/**
262
262
  * @license lucide-react v0.507.0 - ISC
263
263
  *
264
264
  * This source code is licensed under the ISC license.
265
265
  * See the LICENSE file in the root directory of this source tree.
266
- */const er=[["path",{d:"M8 19a4 4 0 0 1-2.24-7.32A3.5 3.5 0 0 1 9 6.03V6a3 3 0 1 1 6 0v.04a3.5 3.5 0 0 1 3.24 5.65A4 4 0 0 1 16 19Z",key:"oadzkq"}],["path",{d:"M12 19v3",key:"npa21l"}]],tr=v("tree-deciduous",er);/**
266
+ */const tr=[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]],ar=v("tree-palm",tr);/**
267
267
  * @license lucide-react v0.507.0 - ISC
268
268
  *
269
269
  * This source code is licensed under the ISC license.
270
270
  * See the LICENSE file in the root directory of this source tree.
271
- */const ar=[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]],sr=v("tree-palm",ar);/**
271
+ */const sr=[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]],nr=v("tree-pine",sr);/**
272
272
  * @license lucide-react v0.507.0 - ISC
273
273
  *
274
274
  * This source code is licensed under the ISC license.
275
275
  * See the LICENSE file in the root directory of this source tree.
276
- */const nr=[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]],rr=v("tree-pine",nr);/**
276
+ */const rr=[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"1l6gj6"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]],or=v("trees",rr);/**
277
277
  * @license lucide-react v0.507.0 - ISC
278
278
  *
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
- */const or=[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"1l6gj6"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]],ir=v("trees",or);/**
281
+ */const ir=[["path",{d:"M22 12a10.06 10.06 1 0 0-20 0Z",key:"1teyop"}],["path",{d:"M12 12v8a2 2 0 0 0 4 0",key:"ulpmoc"}],["path",{d:"M12 2v1",key:"11qlp1"}]],cr=v("umbrella",ir);/**
282
282
  * @license lucide-react v0.507.0 - ISC
283
283
  *
284
284
  * This source code is licensed under the ISC license.
285
285
  * See the LICENSE file in the root directory of this source tree.
286
- */const cr=[["path",{d:"M22 12a10.06 10.06 1 0 0-20 0Z",key:"1teyop"}],["path",{d:"M12 12v8a2 2 0 0 0 4 0",key:"ulpmoc"}],["path",{d:"M12 2v1",key:"11qlp1"}]],lr=v("umbrella",cr);/**
286
+ */const lr=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],dr=v("undo-2",lr);/**
287
287
  * @license lucide-react v0.507.0 - ISC
288
288
  *
289
289
  * This source code is licensed under the ISC license.
290
290
  * See the LICENSE file in the root directory of this source tree.
291
- */const dr=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],ur=v("undo-2",dr);/**
291
+ */const ur=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],mr=v("waves",ur);/**
292
292
  * @license lucide-react v0.507.0 - ISC
293
293
  *
294
294
  * This source code is licensed under the ISC license.
295
295
  * See the LICENSE file in the root directory of this source tree.
296
- */const mr=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],hr=v("waves",mr);/**
296
+ */const hr=[["path",{d:"M2 22 16 8",key:"60hf96"}],["path",{d:"M3.47 12.53 5 11l1.53 1.53a3.5 3.5 0 0 1 0 4.94L5 19l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1rdhi6"}],["path",{d:"M7.47 8.53 9 7l1.53 1.53a3.5 3.5 0 0 1 0 4.94L9 15l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1sdzmb"}],["path",{d:"M11.47 4.53 13 3l1.53 1.53a3.5 3.5 0 0 1 0 4.94L13 11l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"eoatbi"}],["path",{d:"M20 2h2v2a4 4 0 0 1-4 4h-2V6a4 4 0 0 1 4-4Z",key:"19rau1"}],["path",{d:"M11.47 17.47 13 19l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L5 19l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"tc8ph9"}],["path",{d:"M15.47 13.47 17 15l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L9 15l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"2m8kc5"}],["path",{d:"M19.47 9.47 21 11l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L13 11l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"vex3ng"}]],pr=v("wheat",hr);/**
297
297
  * @license lucide-react v0.507.0 - ISC
298
298
  *
299
299
  * This source code is licensed under the ISC license.
300
300
  * See the LICENSE file in the root directory of this source tree.
301
- */const pr=[["path",{d:"M2 22 16 8",key:"60hf96"}],["path",{d:"M3.47 12.53 5 11l1.53 1.53a3.5 3.5 0 0 1 0 4.94L5 19l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1rdhi6"}],["path",{d:"M7.47 8.53 9 7l1.53 1.53a3.5 3.5 0 0 1 0 4.94L9 15l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1sdzmb"}],["path",{d:"M11.47 4.53 13 3l1.53 1.53a3.5 3.5 0 0 1 0 4.94L13 11l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"eoatbi"}],["path",{d:"M20 2h2v2a4 4 0 0 1-4 4h-2V6a4 4 0 0 1 4-4Z",key:"19rau1"}],["path",{d:"M11.47 17.47 13 19l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L5 19l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"tc8ph9"}],["path",{d:"M15.47 13.47 17 15l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L9 15l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"2m8kc5"}],["path",{d:"M19.47 9.47 21 11l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L13 11l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"vex3ng"}]],fr=v("wheat",pr);/**
301
+ */const fr=[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]],xr=v("wind",fr);/**
302
302
  * @license lucide-react v0.507.0 - ISC
303
303
  *
304
304
  * This source code is licensed under the ISC license.
305
305
  * See the LICENSE file in the root directory of this source tree.
306
- */const xr=[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]],gr=v("wind",xr);/**
307
- * @license lucide-react v0.507.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const yr=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],vr=v("zap",yr),kr=({appVersion:t=null})=>{const s="https://local-operator.com/download",[a,n]=o.useState(!1),[r,i]=o.useState(!1),[d,l]=o.useState(null),[m,u]=o.useState("info"),[h,x]=o.useState(null),[g,f]=o.useState(null),w=t?.trim()?t.trim():null,S=o.useRef(!1),M=o.useRef(!1),T=o.useRef(0),z=o.useRef(!1),N=o.useCallback((y,D)=>{M.current=!1,l(y),u(D),i(!0)},[]),F=o.useCallback(y=>{M.current=!0,l(y),u("success"),i(!0)},[]),$=o.useCallback(()=>{M.current&&(M.current=!1,i(!1),l(null))},[]),{clearDeferredUpdate:U}=Wt();o.useEffect(()=>{const y=window.api.updater.onUpdateError(B=>{S.current&&B.includes("manually")&&(x({message:"The server is installed outside the app, so use the tool you installed it with - uv, pipx or pip.",command:""}),M.current=!1,l(null),u("warning"),i(!0))}),D=window.api.updater.onBackendUpdateDevMode(B=>{S.current&&N(B,"info")}),R=()=>{z.current=!0,$()},A=window.api.updater.onUpdateAvailable(R),K=window.api.updater.onUpdateNpxAvailable(R),X=window.api.updater.onBackendUpdateAvailable(R);return()=>{y(),D(),A(),K(),X()}},[$,N]),o.useEffect(()=>{let y=!1;const D=()=>{window.api.updater.getLastInstallAttempt().then(A=>{y||f(A)}).catch(()=>{})};D();const R=window.api.updater.onUpdateInstallFailed(()=>D());return()=>{y=!0,R()}},[]);const q=async()=>{const y=++T.current;$(),z.current=!1;try{n(!0),S.current=!0,U(Ye.UI),U(Ye.BACKEND);const D=await window.api.updater.checkForAllUpdates({manual:!0});if(y!==T.current)return;D?.affirmation&&!z.current?F(D.affirmation):$()}catch(D){if(y!==T.current)return;console.warn(`Update check failed; the app-level alert owns the report: ${Jt(D)}`)}finally{y===T.current&&n(!1),setTimeout(()=>{S.current=!1},2e3)}},E=()=>{M.current=!1,i(!1),l(null)};return e.jsxs(e.Fragment,{children:[g&&e.jsxs("div",{className:"mb-3 rounded-sm bg-sunken p-3",children:[e.jsxs("p",{className:"text-body-sm text-ink",children:["The last update to version ",g.targetVersion," didn't finish",g.attempts>1?` (${g.attempts} attempts)`:"",".",w?` Version ${w} is running.`:null]}),e.jsxs("p",{className:"mt-1 text-meta text-ink-dim",children:["Detected"," ",g.detectedAt?new Date(g.detectedAt).toLocaleString():"at an unknown time",". ",g.detail]}),e.jsx(_,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>void window.api.openExternal(s),children:"Download a fresh copy"})]}),e.jsxs(_,{variant:"outline",onClick:()=>void q(),disabled:a,children:[a?e.jsx(J,{size:"sm"}):null,a?"Checking...":"Check for updates"]}),h&&e.jsxs(Ke,{open:r,autoHideDuration:1e4,onClose:E,variant:"warning",children:[e.jsx("p",{className:"text-body-sm",children:h.message}),h.command&&e.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:h.command})]}),d&&m!=="danger"&&e.jsx(Ke,{open:r,autoHideDuration:6e3,onClose:E,variant:m,children:d})]})},Se=["system-prompt"],br=()=>{const{shouldEnableQuery:t}=Xt();return ve({enabled:t({bypassInternetCheck:!0}),queryKey:Se,queryFn:async()=>{try{const a=await kt(Pe.baseUrl).config.getSystemPrompt();if(a===null)return null;if(a.status>=400)throw new Error(a.message||"Failed to fetch system prompt");return a.result}catch(s){const a=s instanceof Error?s.message:"An unknown error occurred while fetching system prompt";throw bt(a),s}},refetchOnWindowFocus:!1,staleTime:5e3})},jr=()=>{const t=jt(),s=kt(Pe.baseUrl);return ea({mutationFn:async a=>{try{const n=await s.config.updateSystemPrompt(a);if(n.status>=400)throw new Error(n.message||"Failed to update system prompt");return n.result}catch(n){const r=n instanceof Error?n.message:"An unknown error occurred while updating system prompt";throw bt(r),n}},onSuccess:async a=>{await t.invalidateQueries({queryKey:Se,refetchType:"none"}),t.setQueryData(Se,n=>n&&{...n,...a}),await t.refetchQueries({queryKey:Se,type:"all"}),ta("System prompt updated")},onError:a=>{console.error("Error updating system prompt:",a)}})},wr=({value:t,label:s,description:a,onChange:n,icon:r,isSaving:i=!1})=>{const[d,l]=o.useState(t),m=o.useId(),u=`${m}-label`,h=`${m}-description`,x=async g=>{if(!i){l(g);try{await n(g)}catch(f){l(!g),console.error("Error toggling setting:",f)}}};return e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("span",{id:u,className:"flex min-h-6 items-center gap-2 text-body text-ink",children:[r&&e.jsx(r,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-dim"}),s]}),a&&e.jsx("p",{id:h,className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:a})]}),e.jsx("div",{className:"flex h-6 shrink-0 items-center",children:i?e.jsx(J,{size:"md",label:`Saving ${s}`}):e.jsx(ht,{checked:d,onCheckedChange:x,"aria-labelledby":u,"aria-describedby":a?h:void 0})})]})};var Nr=aa({chartName:"LineChart",GraphicalChild:wt,axisComponents:[{axisType:"xAxis",AxisComp:sa},{axisType:"yAxis",AxisComp:na}],formatAxisMap:ra});function Je(t,s){const a=oa(t,s?.in);if(!es(a))throw new RangeError("Invalid time value");const n=he(a.getDate(),2),r=he(a.getMonth()+1,2),i=a.getFullYear(),d=he(a.getHours(),2),l=he(a.getMinutes(),2),m=he(a.getSeconds(),2);let u="",h="";const x=a.getTimezoneOffset();if(x!==0){const g=Math.abs(x),f=he(Math.trunc(g/60),2),w=he(g%60,2);h=`${x<0?"+":"-"}${f}:${w}`}else h="Z";return`${i}-${r}-${n}T${d}:${l}:${m}${u}${h}`}function _r(t,s,a){return ts(t,-30,a)}const Sr=["radient","creditBalance"],Cr=t=>{const{user:s,isAuthenticated:a}=Ue(),n=s?.account?.tenant_id,r=a&&!!n&&t?.enabled;return ve({queryKey:[Sr,n],queryFn:async()=>{if(!n)throw new Error("Tenant ID not available");const i=await Nt({operation:"credits",tenantId:n});if(!i||typeof i.balance!="number")throw new Error("Invalid credit balance response format");return i},enabled:r,staleTime:5*60*1e3,refetchOnWindowFocus:!0})};function Mr(t,s){const[a,n]=o.useState(!1);return o.useEffect(()=>{if(!t){n(!1);return}const r=setTimeout(()=>n(!0),s);return()=>clearTimeout(r)},[t,s]),a}function Dt(){const[t,s]=o.useState(null);return o.useEffect(()=>{const a=window.api?.backend;if(!a?.getStatus)return;let n=!0;const r=async()=>{try{const d=await a.getStatus();if(!n)return;const l=d?.pairing;s(l&&!l.available?l.cause??"unpaired":null)}catch{}};r();const i=a.onStatusChange?.(()=>void r());return()=>{n=!1,i?.()}},[]),t}const Ar=["radient","usageRollup"],Er=(t,s)=>{const{user:a,isAuthenticated:n}=Ue(),r=a?.account?.tenant_id,i=n&&!!r&&s?.enabled;return ve({queryKey:[...Ar,r,t],queryFn:async()=>{if(!r)throw new Error("Tenant ID not available");const d={};for(const[m,u]of Object.entries(t))u!=null&&(d[m]=String(u));const l=await Nt({operation:"usage",tenantId:r,query:d});if(!l)throw new Error("Invalid usage rollup response format");return l},enabled:i,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},Rr=({appVersion:t})=>e.jsx(kr,{appVersion:t}),Tr=t=>{if(!t)return null;try{return new URL(t).host}catch{return null}},Lr=()=>{const[t,s]=o.useState(null),[a,n]=o.useState({value:"Loading...",detail:null,degraded:!1}),[r,i]=o.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});o.useEffect(()=>{let l=!0;const m=f=>{if(!l)return;const w=Tr(f.url);if(f.state==="connecting"){n({value:"Loading...",detail:null,degraded:!1});return}if(f.state==="detached"){n({value:"Not connected",detail:f.detail||null,degraded:!1});return}if(f.state==="wedged"){n({value:"Not attached",detail:f.detail||null,degraded:!1});return}const S=f.version||"Version unknown";n({value:w?`${S} · ${w}`:S,detail:f.detail||null,degraded:f.state==="degraded"})};let u=!1;const h=window.api?.backend?.onStatusChange(f=>{u=!0,m(f)}),x=async()=>{try{const[f,w]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);l&&(s(f),i(w))}catch(f){console.error("Error fetching app information:",f)}},g=async()=>{try{const f=window.api?.backend;if(f){const M=await f.getStatus();u||m(M);return}const w=await Ze.healthCheck(Pe.baseUrl),S=Ze.getServerVersion(w);l&&n({value:S,detail:null,degraded:!1})}catch(f){console.error("Error fetching server version:",f),l&&n({value:"Unavailable",detail:null,degraded:!1})}};return x(),g(),()=>{l=!1,h?.()}},[]);const d=(l,m,u,h={})=>e.jsx(Z,{label:e.jsx(Me,{content:u,children:e.jsxs("span",{className:"inline-flex cursor-help items-center gap-1.5",children:[e.jsx(Fe,{size:12,className:"shrink-0"}),l]})}),valueClassName:h.valueClassName,value:e.jsxs(e.Fragment,{children:[h.valueTooltip?e.jsx(Me,{content:h.valueTooltip,children:e.jsx("span",{"data-backend-version":h.valueHoverTarget?"":void 0,className:"cursor-help",children:m})}):m,h.statusNote?e.jsx("span",{className:"mt-0.5 block text-meta text-ink-dim",children:h.statusNote}):null]})});return e.jsx(V,{title:"Application updates and info",icon:ia,description:"Check for updates and view information about your Local Operator installation.",dataTourTag:"settings-app-updates-section",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs(He,{children:[d("Application version",t??"Loading...","The version of the Local Operator user interface application."),d("Server version",a.value,"The version of the Local Operator API server backend, and the address of the daemon it was read from.",{valueTooltip:a.detail,valueHoverTarget:!0,statusNote:a.degraded?"Not answering":void 0,valueClassName:a.degraded?"text-ink-muted":void 0}),d("Platform",`${r.platform} (${r.arch})`,"The operating system and architecture your application is running on."),d("Node.js version",r.nodeVersion,"The JavaScript runtime environment version."),d("Electron version",r.electronVersion,"The framework version enabling this desktop application.")]}),e.jsx(Rr,{appVersion:t})]})})},Ir={hosting:"core",model_name:"core",model_effort:"core","providers.openai.use_max_context_window":"advanced","providers.openai.api":"advanced","providers.anthropic.cache_ttl_1h_min_context_tokens":"advanced","providers.openrouter.provider_affinity":"advanced","providers.openrouter.sort":"advanced","providers.openrouter.order":"advanced","providers.openrouter.only":"advanced","providers.openrouter.ignore":"advanced","providers.openrouter.allow_fallbacks":"advanced","providers.openrouter.require_parameters":"advanced","providers.openrouter.data_collection":"advanced","providers.openrouter.zdr":"advanced","providers.openrouter.enforce_distillable_text":"advanced","providers.openrouter.quantizations":"advanced","providers.openrouter.max_price":"advanced","providers.openrouter.preferred_min_throughput":"advanced","providers.openrouter.preferred_max_latency":"advanced","retry.enabled":"core","retry.maxRetries":"advanced","retry.baseDelayMs":"advanced","retry.connectivityMaxRetries":"advanced","retry.connectivityBackoffCapMs":"advanced","retry.modelFallback":"advanced","retry.usageAwareFallback":"advanced","retry.usageAwareAccountPick":"advanced","retry.usageReservePercent":"advanced","retry.fallbackChains":"advanced","tui.theme":"advanced","display.shimmer":"advanced","display.comfortable_rows":"advanced","display.nerd_icons":"advanced","display.heading_markers":"advanced","display.terminal_title":"advanced","display.images":"advanced","display.notifications":"core","display.notification_session_name":"advanced","display.time_format":"advanced","display.dock":"advanced","tui.sidebar_visible":"advanced","tui.sidebar_position":"advanced","keymap.new_session":"advanced","keymap.resume":"advanced",tool_approval_mode:"core",auto_save_conversation:"core","session.cleanup.enabled":"core","session.cleanup.max_sessions":"advanced","session.cleanup.max_inactive_days":"advanced","session.cleanup.max_total_bytes":"advanced","session.cleanup.remove_empty":"advanced","runtime.background_on_resume":"advanced","runtime.unattended_gate_timeout":"advanced","subagents.max_running":"advanced","subagents.model_choice":"advanced","subagents.models.lo":"advanced","subagents.models.med":"advanced","subagents.models.hi":"advanced","fork.mode":"core","fork.cmux_placement":"advanced","compaction.enabled":"core","compaction.strategy":"advanced","compaction.threshold_percent":"advanced","compaction.threshold_tokens":"advanced","compaction.keep_recent_tokens":"advanced","compaction.auto_continue":"advanced","compaction.mid_turn_enabled":"advanced","compaction.wire_bytes_budget":"advanced","compaction.wire_bytes_trigger":"advanced","web_search.enabled":"core","web_fetch.enabled":"core","web_search.strategy":"advanced","web_search.providers":"advanced","web_search.timeout_seconds":"advanced","web_search.searxng_endpoint":"advanced","web_search.deepseek_evidence":"advanced","web_search.read_enabled":"advanced","web_fetch.timeout_seconds":"advanced","web_fetch.max_bytes":"advanced","web_fetch.max_redirects":"advanced","web_fetch.cache_ttl_seconds":"advanced","web_fetch.allow_private":"advanced","web_fetch.render_backend":"advanced","web_fetch.enrich":"advanced","web_fetch.max_attempts":"advanced","web_fetch.blocked_retry":"advanced","bash.shell":"advanced","providers.lmstudio.base_url":"advanced","providers.lmstudio.models":"advanced","providers.ollama.base_url":"advanced","providers.ollama.models":"advanced","providers.vllm.base_url":"advanced","providers.vllm.models":"advanced","providers.llamacpp.base_url":"advanced","providers.llamacpp.models":"advanced","providers.openai-compatible.base_url":"advanced","providers.openai-compatible.models":"advanced",conversation_length:"advanced",detail_length:"advanced",max_learnings_history:"advanced","desktop.launch_command":"advanced"},zr={model:"core",approvals:"core",web_tools:"core",desktop:"advanced"};function pe(t){return t.tier==="core"||t.tier==="advanced"?t.tier:Ir[t.key]??zr[t.section]??"advanced"}function Fr(t){return t.length===0?!1:t.filter(a=>pe(a)==="core").length*2>=t.length}function $r(t,s,a){return s?{layout:null,filter:t?[]:[...a]}:{layout:{opened:t?[...a]:[],closed:t?[]:[...a]},filter:[]}}const Ot="__cascade__";function ye(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function le(t){return{value:t.kind==="list"?(t.value??[]).join(`
306
+ */const gr=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],yr=v("zap",gr),vr=({appVersion:t=null})=>{const s="https://local-operator.com/download",[a,n]=o.useState(!1),[r,i]=o.useState(!1),[d,l]=o.useState(null),[m,u]=o.useState("info"),[h,x]=o.useState(null),[g,f]=o.useState(null),w=t?.trim()?t.trim():null,S=o.useRef(!1),M=o.useRef(!1),T=o.useRef(0),z=o.useRef(!1),N=o.useCallback((y,D)=>{M.current=!1,l(y),u(D),i(!0)},[]),F=o.useCallback(y=>{M.current=!0,l(y),u("success"),i(!0)},[]),$=o.useCallback(()=>{M.current&&(M.current=!1,i(!1),l(null))},[]),{clearDeferredUpdate:U}=Ht();o.useEffect(()=>{const y=window.api.updater.onUpdateError(B=>{S.current&&B.includes("manually")&&(x({message:"The server is installed outside the app, so use the tool you installed it with - uv, pipx or pip.",command:""}),M.current=!1,l(null),u("warning"),i(!0))}),D=window.api.updater.onBackendUpdateDevMode(B=>{S.current&&N(B,"info")}),R=()=>{z.current=!0,$()},A=window.api.updater.onUpdateAvailable(R),K=window.api.updater.onUpdateNpxAvailable(R),X=window.api.updater.onBackendUpdateAvailable(R);return()=>{y(),D(),A(),K(),X()}},[$,N]),o.useEffect(()=>{let y=!1;const D=()=>{window.api.updater.getLastInstallAttempt().then(A=>{y||f(A)}).catch(()=>{})};D();const R=window.api.updater.onUpdateInstallFailed(()=>D());return()=>{y=!0,R()}},[]);const q=async()=>{const y=++T.current;$(),z.current=!1;try{n(!0),S.current=!0,U(Ye.UI),U(Ye.BACKEND);const D=await window.api.updater.checkForAllUpdates({manual:!0});if(y!==T.current)return;D?.affirmation&&!z.current?F(D.affirmation):$()}catch(D){if(y!==T.current)return;console.warn(`Update check failed; the app-level alert owns the report: ${Bt(D)}`)}finally{y===T.current&&n(!1),setTimeout(()=>{S.current=!1},2e3)}},E=()=>{M.current=!1,i(!1),l(null)};return e.jsxs(e.Fragment,{children:[g&&e.jsxs("div",{className:"mb-3 rounded-sm bg-sunken p-3",children:[e.jsxs("p",{className:"text-body-sm text-ink",children:["The last update to version ",g.targetVersion," didn't finish",g.attempts>1?` (${g.attempts} attempts)`:"",".",w?` Version ${w} is running.`:null]}),e.jsxs("p",{className:"mt-1 text-meta text-ink-dim",children:["Detected"," ",g.detectedAt?new Date(g.detectedAt).toLocaleString():"at an unknown time",". ",g.detail]}),e.jsx(_,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>void window.api.openExternal(s),children:"Download a fresh copy"})]}),e.jsxs(_,{variant:"outline",onClick:()=>void q(),disabled:a,children:[a?e.jsx(J,{size:"sm"}):null,a?"Checking...":"Check for updates"]}),h&&e.jsxs(Ke,{open:r,autoHideDuration:1e4,onClose:E,variant:"warning",children:[e.jsx("p",{className:"text-body-sm",children:h.message}),h.command&&e.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:h.command})]}),d&&m!=="danger"&&e.jsx(Ke,{open:r,autoHideDuration:6e3,onClose:E,variant:m,children:d})]})},Se=["system-prompt"],kr=()=>{const{shouldEnableQuery:t}=Vt();return ve({enabled:t({bypassInternetCheck:!0}),queryKey:Se,queryFn:async()=>{try{const a=await ht(Pe.baseUrl).config.getSystemPrompt();if(a===null)return null;if(a.status>=400)throw new Error(a.message||"Failed to fetch system prompt");return a.result}catch(s){const a=s instanceof Error?s.message:"An unknown error occurred while fetching system prompt";throw pt(a),s}},refetchOnWindowFocus:!1,staleTime:5e3})},br=()=>{const t=ft(),s=ht(Pe.baseUrl);return Gt({mutationFn:async a=>{try{const n=await s.config.updateSystemPrompt(a);if(n.status>=400)throw new Error(n.message||"Failed to update system prompt");return n.result}catch(n){const r=n instanceof Error?n.message:"An unknown error occurred while updating system prompt";throw pt(r),n}},onSuccess:async a=>{await t.invalidateQueries({queryKey:Se,refetchType:"none"}),t.setQueryData(Se,n=>n&&{...n,...a}),await t.refetchQueries({queryKey:Se,type:"all"}),Kt("System prompt updated")},onError:a=>{console.error("Error updating system prompt:",a)}})},jr=({value:t,label:s,description:a,onChange:n,icon:r,isSaving:i=!1})=>{const[d,l]=o.useState(t),m=o.useId(),u=`${m}-label`,h=`${m}-description`,x=async g=>{if(!i){l(g);try{await n(g)}catch(f){l(!g),console.error("Error toggling setting:",f)}}};return e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("span",{id:u,className:"flex min-h-6 items-center gap-2 text-body text-ink",children:[r&&e.jsx(r,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-dim"}),s]}),a&&e.jsx("p",{id:h,className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:a})]}),e.jsx("div",{className:"flex h-6 shrink-0 items-center",children:i?e.jsx(J,{size:"md",label:`Saving ${s}`}):e.jsx(Et,{checked:d,onCheckedChange:x,"aria-labelledby":u,"aria-describedby":a?h:void 0})})]})};var wr=Yt({chartName:"LineChart",GraphicalChild:xt,axisComponents:[{axisType:"xAxis",AxisComp:Zt},{axisType:"yAxis",AxisComp:Qt}],formatAxisMap:Wt});function Je(t,s){const a=Jt(t,s?.in);if(!ts(a))throw new RangeError("Invalid time value");const n=he(a.getDate(),2),r=he(a.getMonth()+1,2),i=a.getFullYear(),d=he(a.getHours(),2),l=he(a.getMinutes(),2),m=he(a.getSeconds(),2);let u="",h="";const x=a.getTimezoneOffset();if(x!==0){const g=Math.abs(x),f=he(Math.trunc(g/60),2),w=he(g%60,2);h=`${x<0?"+":"-"}${f}:${w}`}else h="Z";return`${i}-${r}-${n}T${d}:${l}:${m}${u}${h}`}function Nr(t,s,a){return as(t,-30,a)}const _r=["radient","creditBalance"],Sr=t=>{const{user:s,isAuthenticated:a}=Ue(),n=s?.account?.tenant_id,r=a&&!!n&&t?.enabled;return ve({queryKey:[_r,n],queryFn:async()=>{if(!n)throw new Error("Tenant ID not available");const i=await gt({operation:"credits",tenantId:n});if(!i||typeof i.balance!="number")throw new Error("Invalid credit balance response format");return i},enabled:r,staleTime:5*60*1e3,refetchOnWindowFocus:!0})};function Cr(t,s){const[a,n]=o.useState(!1);return o.useEffect(()=>{if(!t){n(!1);return}const r=setTimeout(()=>n(!0),s);return()=>clearTimeout(r)},[t,s]),a}function Dt(){const[t,s]=o.useState(null);return o.useEffect(()=>{const a=window.api?.backend;if(!a?.getStatus)return;let n=!0;const r=async()=>{try{const d=await a.getStatus();if(!n)return;const l=d?.pairing;s(l&&!l.available?l.cause??"unpaired":null)}catch{}};r();const i=a.onStatusChange?.(()=>void r());return()=>{n=!1,i?.()}},[]),t}const Mr=["radient","usageRollup"],Ar=(t,s)=>{const{user:a,isAuthenticated:n}=Ue(),r=a?.account?.tenant_id,i=n&&!!r&&s?.enabled;return ve({queryKey:[...Mr,r,t],queryFn:async()=>{if(!r)throw new Error("Tenant ID not available");const d={};for(const[m,u]of Object.entries(t))u!=null&&(d[m]=String(u));const l=await gt({operation:"usage",tenantId:r,query:d});if(!l)throw new Error("Invalid usage rollup response format");return l},enabled:i,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},Er=({appVersion:t})=>e.jsx(vr,{appVersion:t}),Rr=t=>{if(!t)return null;try{return new URL(t).host}catch{return null}},Tr=()=>{const[t,s]=o.useState(null),[a,n]=o.useState({value:"Loading...",detail:null,degraded:!1}),[r,i]=o.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});o.useEffect(()=>{let l=!0;const m=f=>{if(!l)return;const w=Rr(f.url);if(f.state==="connecting"){n({value:"Loading...",detail:null,degraded:!1});return}if(f.state==="detached"){n({value:"Not connected",detail:f.detail||null,degraded:!1});return}if(f.state==="wedged"){n({value:"Not attached",detail:f.detail||null,degraded:!1});return}const S=f.version||"Version unknown";n({value:w?`${S} · ${w}`:S,detail:f.detail||null,degraded:f.state==="degraded"})};let u=!1;const h=window.api?.backend?.onStatusChange(f=>{u=!0,m(f)}),x=async()=>{try{const[f,w]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);l&&(s(f),i(w))}catch(f){console.error("Error fetching app information:",f)}},g=async()=>{try{const f=window.api?.backend;if(f){const M=await f.getStatus();u||m(M);return}const w=await Ze.healthCheck(Pe.baseUrl),S=Ze.getServerVersion(w);l&&n({value:S,detail:null,degraded:!1})}catch(f){console.error("Error fetching server version:",f),l&&n({value:"Unavailable",detail:null,degraded:!1})}};return x(),g(),()=>{l=!1,h?.()}},[]);const d=(l,m,u,h={})=>e.jsx(Z,{label:e.jsx(Ee,{content:u,children:e.jsxs("span",{className:"inline-flex cursor-help items-center gap-1.5",children:[e.jsx(Fe,{size:12,className:"shrink-0"}),l]})}),valueClassName:h.valueClassName,value:e.jsxs(e.Fragment,{children:[h.valueTooltip?e.jsx(Ee,{content:h.valueTooltip,children:e.jsx("span",{"data-backend-version":h.valueHoverTarget?"":void 0,className:"cursor-help",children:m})}):m,h.statusNote?e.jsx("span",{className:"mt-0.5 block text-meta text-ink-dim",children:h.statusNote}):null]})});return e.jsx(V,{title:"Application updates and info",icon:Xt,description:"Check for updates and view information about your Local Operator installation.",dataTourTag:"settings-app-updates-section",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs(He,{children:[d("Application version",t??"Loading...","The version of the Local Operator user interface application."),d("Server version",a.value,"The version of the Local Operator API server backend, and the address of the daemon it was read from.",{valueTooltip:a.detail,valueHoverTarget:!0,statusNote:a.degraded?"Not answering":void 0,valueClassName:a.degraded?"text-ink-muted":void 0}),d("Platform",`${r.platform} (${r.arch})`,"The operating system and architecture your application is running on."),d("Node.js version",r.nodeVersion,"The JavaScript runtime environment version."),d("Electron version",r.electronVersion,"The framework version enabling this desktop application.")]}),e.jsx(Er,{appVersion:t})]})})},Lr={hosting:"core",model_name:"core",model_effort:"core","providers.openai.use_max_context_window":"advanced","providers.openai.api":"advanced","providers.anthropic.cache_ttl_1h_min_context_tokens":"advanced","providers.openrouter.provider_affinity":"advanced","providers.openrouter.sort":"advanced","providers.openrouter.order":"advanced","providers.openrouter.only":"advanced","providers.openrouter.ignore":"advanced","providers.openrouter.allow_fallbacks":"advanced","providers.openrouter.require_parameters":"advanced","providers.openrouter.data_collection":"advanced","providers.openrouter.zdr":"advanced","providers.openrouter.enforce_distillable_text":"advanced","providers.openrouter.quantizations":"advanced","providers.openrouter.max_price":"advanced","providers.openrouter.preferred_min_throughput":"advanced","providers.openrouter.preferred_max_latency":"advanced","retry.enabled":"core","retry.maxRetries":"advanced","retry.baseDelayMs":"advanced","retry.connectivityMaxRetries":"advanced","retry.connectivityBackoffCapMs":"advanced","retry.modelFallback":"advanced","retry.usageAwareFallback":"advanced","retry.usageAwareAccountPick":"advanced","retry.usageReservePercent":"advanced","retry.fallbackChains":"advanced","tui.theme":"advanced","display.shimmer":"advanced","display.comfortable_rows":"advanced","display.nerd_icons":"advanced","display.heading_markers":"advanced","display.terminal_title":"advanced","display.images":"advanced","display.notifications":"core","display.notification_session_name":"advanced","display.time_format":"advanced","display.dock":"advanced","tui.sidebar_visible":"advanced","tui.sidebar_position":"advanced","keymap.new_session":"advanced","keymap.resume":"advanced",tool_approval_mode:"core",auto_save_conversation:"core","session.cleanup.enabled":"core","session.cleanup.max_sessions":"advanced","session.cleanup.max_inactive_days":"advanced","session.cleanup.max_total_bytes":"advanced","session.cleanup.remove_empty":"advanced","runtime.background_on_resume":"advanced","runtime.unattended_gate_timeout":"advanced","subagents.max_running":"advanced","subagents.model_choice":"advanced","subagents.models.lo":"advanced","subagents.models.med":"advanced","subagents.models.hi":"advanced","fork.mode":"core","fork.cmux_placement":"advanced","compaction.enabled":"core","compaction.strategy":"advanced","compaction.threshold_percent":"advanced","compaction.threshold_tokens":"advanced","compaction.keep_recent_tokens":"advanced","compaction.auto_continue":"advanced","compaction.mid_turn_enabled":"advanced","compaction.wire_bytes_budget":"advanced","compaction.wire_bytes_trigger":"advanced","web_search.enabled":"core","web_fetch.enabled":"core","web_search.strategy":"advanced","web_search.providers":"advanced","web_search.timeout_seconds":"advanced","web_search.searxng_endpoint":"advanced","web_search.deepseek_evidence":"advanced","web_search.read_enabled":"advanced","web_fetch.timeout_seconds":"advanced","web_fetch.max_bytes":"advanced","web_fetch.max_redirects":"advanced","web_fetch.cache_ttl_seconds":"advanced","web_fetch.allow_private":"advanced","web_fetch.render_backend":"advanced","web_fetch.enrich":"advanced","web_fetch.max_attempts":"advanced","web_fetch.blocked_retry":"advanced","bash.shell":"advanced","providers.lmstudio.base_url":"advanced","providers.lmstudio.models":"advanced","providers.ollama.base_url":"advanced","providers.ollama.models":"advanced","providers.vllm.base_url":"advanced","providers.vllm.models":"advanced","providers.llamacpp.base_url":"advanced","providers.llamacpp.models":"advanced","providers.openai-compatible.base_url":"advanced","providers.openai-compatible.models":"advanced",conversation_length:"advanced",detail_length:"advanced",max_learnings_history:"advanced","desktop.launch_command":"advanced"},Ir={model:"core",approvals:"core",web_tools:"core",desktop:"advanced"};function pe(t){return t.tier==="core"||t.tier==="advanced"?t.tier:Lr[t.key]??Ir[t.section]??"advanced"}function zr(t){return t.length===0?!1:t.filter(a=>pe(a)==="core").length*2>=t.length}function Fr(t,s,a){return s?{layout:null,filter:t?[]:[...a]}:{layout:{opened:t?[...a]:[],closed:t?[]:[...a]},filter:[]}}const Ot="__cascade__";function ye(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function le(t){return{value:t.kind==="list"?(t.value??[]).join(`
312
307
  `):t.kind==="cascade"?Ot:ye(t.value),cascadeBase:null}}function Ce(t,s){return s.cascadeBase!==null?!0:t.kind==="cascade"?s.value!==Ot:t.kind==="list"?s.value!==t.value?.join(`
313
- `):s.value!==ye(t.value)}function Dr(t,s){let a=null,n;switch(t.kind){case"bool":a=s.value==="true";break;case"int":{const r=Number.parseInt(s.value,10);if(Number.isNaN(r))return{ok:!1,error:"Enter a whole number."};a=r;break}case"float":{const r=Number.parseFloat(s.value);if(!Number.isFinite(r))return{ok:!1,error:"Enter a finite number."};a=r;break}case"enum":{const r=t.choices.find(i=>ye(i.value)===s.value);a=r?r.value:s.value;break}case"list":a=s.value.split(`
314
- `).map(r=>r.trim()).filter(Boolean);break;case"cascade":{if(!s.cascadeBase)return{ok:!1,error:"Nothing has been edited yet."};const r={};for(const[i,d]of Object.entries(s.cascadeBase))r[i]=d;a=r,n=t.value??void 0;break}default:t.empty_unsets&&s.value.trim()===""?a="":a=s.value}return{ok:!0,request:{op:"settings.edit",key:t.key,value:a,...n?{base:n}:{}}}}const Or={hosting:"provider",model_name:"model","subagents.models.lo":"provider-model","subagents.models.med":"provider-model","subagents.models.hi":"provider-model"};function Pr(t){return Or[t]??null}const Ur={provider:"Search providers",model:"Search models","provider-model":"Search models"},qr="Sign-in state unknown",Hr="Current value",Br="Signed in",Vr="Needs sign-in",Be=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),Xe=["Ready to use","Needs a running server","Needs sign-in"];function Gr(t){const s=new Map(Xe.map(a=>[a,[]]));for(const a of t){const n=ca(a),r=s.get(n.group);r&&r.push({id:a.id,name:a.name,description:n.label,group:n.group})}return Xe.flatMap(a=>s.get(a)??[])}function et(t,s,a){if(t.connected!==s.connected)return t.connected?-1:1;const n=a!==""&&t.provider===a,r=a!==""&&s.provider===a;return n!==r?n?-1:1:0}function Kr(t,s){const a=new Map;for(const n of t){const r=s(n),i=a.get(r);i?i.push(n):a.set(r,[n])}return a}function Yr(t,s){const a=[...t?.models??[]];if(s.kind!=="model")return a;const n=s.hosting.trim();if(!n)return a;const r=a.filter(i=>i.provider===n);return r.length>0?r:a}function Zr(t,s){const a=t?.credentials_known!==!1,n=Yr(t,s),r=m=>a?m.connected?Br:Vr:qr,i=m=>s.kind==="provider-model"?m.provider:r(m),d=s.kind==="provider-model"?n:[...n].sort((m,u)=>et(m,u,s.hosting)),l=[];for(const[,m]of Kr(d,i)){const u=s.kind==="provider-model"?[...m].sort((h,x)=>et(h,x,s.hosting)):m;for(const h of u)l.push({id:s.kind==="model"?h.model_id:h.selector,name:h.selector,description:s.kind==="provider-model"?a?h.connected?"Signed in":"Needs sign-in":void 0:`${s.providerNames?.[h.provider]??Be(h.provider)}${h.aggregated?", aggregated":""}${a&&!h.connected?", no credential":""}`,group:i(h)})}return l.push(...Wr(n,t,s)),l}function Qr(t,s){if(t.kind!=="model")return null;const a=t.hosting.trim();if(!a)return null;const n=s?.models??[];if(n.length===0)return null;const r=t.hostingLabel??Be(a);return n.some(d=>d.provider===a)?`Models for ${r}`:`No models listed for ${r}. Showing all models.`}function Wr(t,s,a){const n=a.current.trim();if(!n)return[];const r=d=>a.kind==="model"?d.model_id:d.selector;if(t.some(d=>r(d)===n))return[];const i=(s?.models??[]).find(d=>r(d)===n);return[{id:n,name:i?.selector??n,description:i?`${a.providerNames?.[i.provider]??Be(i.provider)}${s?.credentials_known===!1?"":i.connected?", signed in":", no credential"}`:a.kind==="model"?"Custom model":"Custom value",group:Hr}]}function Jr(t,s,a){const n=s.trim();if(!n)return null;const r=t.filter(i=>i.id===n);if(a){const i=r.find(d=>d.name===a);if(i)return i}return r[0]??{id:n,name:n}}const tt=t=>`setting-help-${t}`,Xr=({setting:t,kind:s,value:a,disabled:n=!1,onValueChange:r,effectiveHosting:i,helpId:d})=>{const l=qe(),m=Ee(l.data,"auth"),u=la(m),h=s!=="provider"&&Ee(l.data,"catalogues"),[x,g]=o.useState(!1),[f,w]=o.useState(void 0),S=ve({queryKey:["desktop","models",!1],queryFn:()=>ge({op:"models.catalogue",live:!1}),enabled:h&&x,staleTime:6e4}),M=o.useMemo(()=>Object.fromEntries((u.data??[]).map(E=>[E.id,E.name])),[u.data]),T=o.useMemo(()=>s==="provider"?u.data?Gr(u.data):[]:Zr(S.data,{kind:s,hosting:s==="model"?i:"",current:a,providerNames:M}),[s,u.data,S.data,i,a,M]),z=da(S.data,S,E=>ua("Could not list models.",E)),N=z.loadError?e.jsx("span",{className:"text-danger",children:z.loadError}):z.notice,F=z.noticeDetail?{title:z.noticeDetail}:{},$=Jr(T,a,f),U=o.useMemo(()=>s==="provider"?null:Qr({kind:s,hosting:s==="model"?i:"",hostingLabel:u.data?.find(E=>E.id===i)?.name},S.data),[s,i,u.data,S.data]),q=o.useMemo(()=>s==="provider"?u.isError?"Could not list providers":m?"No providers":"Provider list unavailable":z.loadError?"Could not list models":h?"Nothing matches that model":"Model list unavailable",[s,u.isError,m,z.loadError,h]);return e.jsx(qt,{showLabel:!1,ariaLabel:t.label,ariaDescribedBy:d,label:t.label,placeholder:Ur[s],options:T,selected:$,disabled:n,busy:s==="provider"?u.isFetching:S.isFetching,busyLabel:s==="provider"?"Loading providers":"Loading models",onOpenChange:E=>{E&&g(!0)},onSelect:E=>{w(E.name),r(E.id)},onCustomSubmit:E=>r(E),customRowLabel:E=>`Use "${E}"`,listNotice:U,onClear:()=>r(""),emptyText:q,helperText:N?e.jsx("span",{...F,children:N}):void 0})},at={bool:"w-9",int:"w-28",float:"w-28",enum:"w-64",text:"w-96",hotkey:"w-56",list:"w-full min-w-0",cascade:"w-full min-w-0",readonly:"w-40"};function eo(t){return at[t]??at.text}const to={" ":"space",Spacebar:"space",Escape:"escape",Esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown"},ao=new Set(["Control","Shift","Alt","Meta","AltGraph"]),so=new Set(["Escape","Esc","Enter"]);function no(t){if(ao.has(t.key)||t.nativeEvent.isComposing)return"";const s=[];t.ctrlKey&&s.push("ctrl"),t.altKey&&s.push("alt"),t.shiftKey&&s.push("shift"),t.metaKey&&s.push("meta");const a=to[t.key]??t.key.toLowerCase();return a?[...s,a].join("+"):""}const ro=({value:t,label:s,disabled:a,onChange:n})=>e.jsxs("span",{className:"flex w-full flex-col gap-0.5",children:[e.jsx(ne,{readOnly:!0,value:t,disabled:a,"aria-label":`${s}: press the key you want`,className:"font-mono text-body-sm",onKeyDown:r=>{if(so.has(r.key)){r.currentTarget.blur();return}const i=no(r);i&&(r.preventDefault(),n(i))}}),e.jsx("span",{className:"text-meta text-ink-dim",children:"Press the keys you want; Esc cancels."})]}),oo=({setting:t,value:s,chains:a,disabled:n=!1,onValueChange:r,onChainsChange:i,effectiveHosting:d="",helpId:l})=>{const m=Pr(t.key);if(m)return e.jsx(Xr,{setting:t,kind:m,value:s,disabled:n,onValueChange:r,effectiveHosting:d,helpId:l});switch(t.kind){case"bool":return e.jsx(ht,{checked:s==="true",disabled:n,onCheckedChange:u=>r(u?"true":"false"),"aria-label":t.label});case"enum":return e.jsxs(pt,{value:s,disabled:n,onValueChange:r,children:[e.jsx(ft,{"aria-label":t.label,className:"w-full",children:e.jsx(xt,{})}),e.jsx(gt,{children:t.choices.map(u=>e.jsx(De,{value:ye(u.value),title:u.description||void 0,children:u.label},ye(u.value)))})]});case"int":case"float":return e.jsx(ne,{type:"number",value:s,disabled:n,min:t.minimum??void 0,max:t.maximum??void 0,step:t.kind==="int"?1:"any",onChange:u=>r(u.target.value),"aria-label":t.label});case"hotkey":return e.jsx(ro,{value:s,label:t.label,disabled:n,onChange:r});case"list":return e.jsx($e,{value:s,disabled:n,rows:Math.min(6,t.members.length+2),onChange:u=>r(u.target.value),"aria-label":t.label,placeholder:t.placeholder,className:"font-mono text-body-sm"});case"cascade":{const u=a??t.value??{};return e.jsxs("div",{className:"flex flex-col gap-3",children:[Object.entries(u).map(([h,x])=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"font-mono text-meta text-ink-dim",children:h}),e.jsx($e,{value:x.join(`
308
+ `):s.value!==ye(t.value)}function $r(t,s){let a=null,n;switch(t.kind){case"bool":a=s.value==="true";break;case"int":{const r=Number.parseInt(s.value,10);if(Number.isNaN(r))return{ok:!1,error:"Enter a whole number."};a=r;break}case"float":{const r=Number.parseFloat(s.value);if(!Number.isFinite(r))return{ok:!1,error:"Enter a finite number."};a=r;break}case"enum":{const r=t.choices.find(i=>ye(i.value)===s.value);a=r?r.value:s.value;break}case"list":a=s.value.split(`
309
+ `).map(r=>r.trim()).filter(Boolean);break;case"cascade":{if(!s.cascadeBase)return{ok:!1,error:"Nothing has been edited yet."};const r={};for(const[i,d]of Object.entries(s.cascadeBase))r[i]=d;a=r,n=t.value??void 0;break}default:t.empty_unsets&&s.value.trim()===""?a="":a=s.value}return{ok:!0,request:{op:"settings.edit",key:t.key,value:a,...n?{base:n}:{}}}}const Dr={hosting:"provider",model_name:"model","subagents.models.lo":"provider-model","subagents.models.med":"provider-model","subagents.models.hi":"provider-model"};function Or(t){return Dr[t]??null}const Pr={provider:"Search providers",model:"Search models","provider-model":"Search models"},Ur="Sign-in state unknown",qr="Current value",Hr="Signed in",Br="Needs sign-in",Be=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),Xe=["Ready to use","Needs a running server","Needs sign-in"];function Vr(t){const s=new Map(Xe.map(a=>[a,[]]));for(const a of t){const n=ea(a),r=s.get(n.group);r&&r.push({id:a.id,name:a.name,description:n.label,group:n.group})}return Xe.flatMap(a=>s.get(a)??[])}function et(t,s,a){if(t.connected!==s.connected)return t.connected?-1:1;const n=a!==""&&t.provider===a,r=a!==""&&s.provider===a;return n!==r?n?-1:1:0}function Gr(t,s){const a=new Map;for(const n of t){const r=s(n),i=a.get(r);i?i.push(n):a.set(r,[n])}return a}function Kr(t,s){const a=[...t?.models??[]];if(s.kind!=="model")return a;const n=s.hosting.trim();if(!n)return a;const r=a.filter(i=>i.provider===n);return r.length>0?r:a}function Yr(t,s){const a=t?.credentials_known!==!1,n=Kr(t,s),r=m=>a?m.connected?Hr:Br:Ur,i=m=>s.kind==="provider-model"?m.provider:r(m),d=s.kind==="provider-model"?n:[...n].sort((m,u)=>et(m,u,s.hosting)),l=[];for(const[,m]of Gr(d,i)){const u=s.kind==="provider-model"?[...m].sort((h,x)=>et(h,x,s.hosting)):m;for(const h of u)l.push({id:s.kind==="model"?h.model_id:h.selector,name:h.selector,description:s.kind==="provider-model"?a?h.connected?"Signed in":"Needs sign-in":void 0:`${s.providerNames?.[h.provider]??Be(h.provider)}${h.aggregated?", aggregated":""}${a&&!h.connected?", no credential":""}`,group:i(h)})}return l.push(...Qr(n,t,s)),l}function Zr(t,s){if(t.kind!=="model")return null;const a=t.hosting.trim();if(!a)return null;const n=s?.models??[];if(n.length===0)return null;const r=t.hostingLabel??Be(a);return n.some(d=>d.provider===a)?`Models for ${r}`:`No models listed for ${r}. Showing all models.`}function Qr(t,s,a){const n=a.current.trim();if(!n)return[];const r=d=>a.kind==="model"?d.model_id:d.selector;if(t.some(d=>r(d)===n))return[];const i=(s?.models??[]).find(d=>r(d)===n);return[{id:n,name:i?.selector??n,description:i?`${a.providerNames?.[i.provider]??Be(i.provider)}${s?.credentials_known===!1?"":i.connected?", signed in":", no credential"}`:a.kind==="model"?"Custom model":"Custom value",group:qr}]}function Wr(t,s,a){const n=s.trim();if(!n)return null;const r=t.filter(i=>i.id===n);if(a){const i=r.find(d=>d.name===a);if(i)return i}return r[0]??{id:n,name:n}}const tt=t=>`setting-help-${t}`,Jr=({setting:t,kind:s,value:a,disabled:n=!1,onValueChange:r,effectiveHosting:i,helpId:d})=>{const l=qe(),m=Me(l.data,"auth"),u=ta(m),h=s!=="provider"&&Me(l.data,"catalogues"),[x,g]=o.useState(!1),[f,w]=o.useState(void 0),S=ve({queryKey:["desktop","models",!1],queryFn:()=>ge({op:"models.catalogue",live:!1}),enabled:h&&x,staleTime:6e4}),M=o.useMemo(()=>Object.fromEntries((u.data??[]).map(E=>[E.id,E.name])),[u.data]),T=o.useMemo(()=>s==="provider"?u.data?Vr(u.data):[]:Yr(S.data,{kind:s,hosting:s==="model"?i:"",current:a,providerNames:M}),[s,u.data,S.data,i,a,M]),z=aa(S.data,S,E=>sa("Could not list models.",E)),N=z.loadError?e.jsx("span",{className:"text-danger",children:z.loadError}):z.notice,F=z.noticeDetail?{title:z.noticeDetail}:{},$=Wr(T,a,f),U=o.useMemo(()=>s==="provider"?null:Zr({kind:s,hosting:s==="model"?i:"",hostingLabel:u.data?.find(E=>E.id===i)?.name},S.data),[s,i,u.data,S.data]),q=o.useMemo(()=>s==="provider"?u.isError?"Could not list providers":m?"No providers":"Provider list unavailable":z.loadError?"Could not list models":h?"Nothing matches that model":"Model list unavailable",[s,u.isError,m,z.loadError,h]);return e.jsx(Va,{showLabel:!1,ariaLabel:t.label,ariaDescribedBy:d,label:t.label,placeholder:Pr[s],options:T,selected:$,disabled:n,busy:s==="provider"?u.isFetching:S.isFetching,busyLabel:s==="provider"?"Loading providers":"Loading models",onOpenChange:E=>{E&&g(!0)},onSelect:E=>{w(E.name),r(E.id)},onCustomSubmit:E=>r(E),customRowLabel:E=>`Use "${E}"`,listNotice:U,onClear:()=>r(""),emptyText:q,helperText:N?e.jsx("span",{...F,children:N}):void 0})},at={bool:"w-9",int:"w-28",float:"w-28",enum:"w-64",text:"w-96",hotkey:"w-56",list:"w-full min-w-0",cascade:"w-full min-w-0",readonly:"w-40"};function Xr(t){return at[t]??at.text}const eo={" ":"space",Spacebar:"space",Escape:"escape",Esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown"},to=new Set(["Control","Shift","Alt","Meta","AltGraph"]),ao=new Set(["Escape","Esc","Enter"]);function so(t){if(to.has(t.key)||t.nativeEvent.isComposing)return"";const s=[];t.ctrlKey&&s.push("ctrl"),t.altKey&&s.push("alt"),t.shiftKey&&s.push("shift"),t.metaKey&&s.push("meta");const a=eo[t.key]??t.key.toLowerCase();return a?[...s,a].join("+"):""}const no=({value:t,label:s,disabled:a,onChange:n})=>e.jsxs("span",{className:"flex w-full flex-col gap-0.5",children:[e.jsx(ne,{readOnly:!0,value:t,disabled:a,"aria-label":`${s}: press the key you want`,className:"font-mono text-body-sm",onKeyDown:r=>{if(ao.has(r.key)){r.currentTarget.blur();return}const i=so(r);i&&(r.preventDefault(),n(i))}}),e.jsx("span",{className:"text-meta text-ink-dim",children:"Press the keys you want; Esc cancels."})]}),ro=({setting:t,value:s,chains:a,disabled:n=!1,onValueChange:r,onChainsChange:i,effectiveHosting:d="",helpId:l})=>{const m=Or(t.key);if(m)return e.jsx(Jr,{setting:t,kind:m,value:s,disabled:n,onValueChange:r,effectiveHosting:d,helpId:l});switch(t.kind){case"bool":return e.jsx(Et,{checked:s==="true",disabled:n,onCheckedChange:u=>r(u?"true":"false"),"aria-label":t.label});case"enum":return e.jsxs(Rt,{value:s,disabled:n,onValueChange:r,children:[e.jsx(Tt,{"aria-label":t.label,className:"w-full",children:e.jsx(Lt,{})}),e.jsx(It,{children:t.choices.map(u=>e.jsx(De,{value:ye(u.value),title:u.description||void 0,children:u.label},ye(u.value)))})]});case"int":case"float":return e.jsx(ne,{type:"number",value:s,disabled:n,min:t.minimum??void 0,max:t.maximum??void 0,step:t.kind==="int"?1:"any",onChange:u=>r(u.target.value),"aria-label":t.label});case"hotkey":return e.jsx(no,{value:s,label:t.label,disabled:n,onChange:r});case"list":return e.jsx($e,{value:s,disabled:n,rows:Math.min(6,t.members.length+2),onChange:u=>r(u.target.value),"aria-label":t.label,placeholder:t.placeholder,className:"font-mono text-body-sm"});case"cascade":{const u=a??t.value??{};return e.jsxs("div",{className:"flex flex-col gap-3",children:[Object.entries(u).map(([h,x])=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"font-mono text-meta text-ink-dim",children:h}),e.jsx($e,{value:x.join(`
315
310
  `),disabled:n,rows:Math.max(2,x.length+1),onChange:g=>i?.({...u,[h]:g.target.value.split(`
316
- `).map(f=>f.trim()).filter(Boolean)}),"aria-label":`${t.label}: ${h}`,className:"font-mono text-body-sm"})]},h)),e.jsx("p",{className:"text-meta text-ink-dim",children:"One hop per line, as provider/model (effort). An empty chain moves to the next provider."})]})}default:return e.jsx(ne,{value:s,disabled:n,onChange:u=>r(u.target.value),"aria-label":t.label,placeholder:t.placeholder})}},Pt=({className:t})=>e.jsx("span",{role:"img","aria-label":"Changed from the default",title:"Changed from the default",className:W("size-1.5 shrink-0 rounded-full bg-accent",t)}),io=({title:t,rowCount:s,advancedCount:a,scope:n,modified:r,onOpenChange:i,defaultOpen:d=!1})=>e.jsx("div",{"data-section-header":t,className:"flex w-full flex-col",children:e.jsx(_t,{defaultOpen:d,onOpenChange:i,triggerClassName:"text-ink hover:bg-row-hover hover:text-ink",chevronClassName:"text-ink-dim",rowClassName:"min-h-10 py-0",className:"w-full",summary:e.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate text-heading text-ink",children:t}),s>0&&e.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:s===1?"1 setting":`${s} settings`}),n&&e.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:n}),a>0&&e.jsxs("span",{className:"shrink-0 text-meta text-ink-dim",children:[a," advanced"]})]}),r&&e.jsx(Pt,{className:"ml-auto"})]})})}),co="size-3.5 shrink-0",lo=({setting:t,draft:s,tier:a,gate:n,saving:r,error:i,onDraftChange:d,onSave:l,onReset:m,effectiveHosting:u=""})=>{const h=!!(n&&!n.on),x=Ce(t,s),g=r||h,f=t.kind==="list"||t.kind==="cascade",w=e.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("span",{className:"truncate text-body-sm text-ink",children:t.label}),t.kind==="readonly"&&e.jsx("span",{className:"text-meta text-ink-dim",children:"Read-only"}),t.warning&&e.jsx("span",{className:"text-meta text-danger",children:t.warning})]}),S=h&&n&&e.jsxs("p",{className:"text-meta text-ink-dim",children:["Needs ",n.label," on. Nothing here is saved while it is off."]});return e.jsx("div",{"data-setting-key":t.key,"data-tier":a,className:"border-b border-hairline",children:e.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-1 px-1 py-2.5",children:[e.jsxs("div",{className:W("flex min-w-44 flex-col gap-0.5",f?"shrink-0 basis-2/5":"flex-1"),children:[a==="advanced"&&t.help?e.jsx(_t,{summary:w,triggerClassName:"min-h-5 py-0 px-0 text-body-sm text-ink hover:text-ink",chevronClassName:"text-ink-dim",summaryAlign:"firstLine",rowClassName:"min-h-5 py-0",className:"w-full",children:e.jsx("span",{className:"text-meta text-ink-dim",children:t.help})}):e.jsxs("span",{className:"flex min-h-5 items-center gap-1.5",children:[e.jsx("span",{"aria-hidden":!0,className:co}),w]}),a==="core"&&t.help&&e.jsx("p",{id:tt(t.key),className:"ml-5 text-meta text-ink-dim",children:t.help}),S]}),e.jsxs("div",{className:W("flex shrink-0 items-center gap-2 self-center",f&&"min-w-0 flex-1 items-start"),children:[(!t.is_default||x)&&e.jsx(Pt,{}),!t.is_default&&t.kind!=="readonly"&&e.jsxs(_,{variant:"ghost",size:"sm",disabled:g,onClick:m,"aria-label":`Use default for ${t.label}`,children:[e.jsx(ur,{"aria-hidden":"true"}),"Use default"]}),x&&e.jsx(_,{variant:"primary",size:"sm",disabled:g,onClick:l,children:r?"Saving":"Save"}),e.jsx("div",{className:eo(t.kind),"data-setting-control":"",children:t.redacted?e.jsx("span",{className:"text-meta text-ink-dim",children:"Set in the credential manager: this value carries inline credentials or query parameters."}):t.kind==="readonly"?e.jsx("span",{className:"text-body-sm text-ink-muted",children:ye(t.value)||"Not set"}):e.jsx(oo,{setting:t,value:s.value,chains:s.cascadeBase??void 0,disabled:g,effectiveHosting:u,helpId:a==="core"&&t.help?tt(t.key):void 0,onValueChange:M=>d({...s,value:M}),onChainsChange:M=>d({...s,cascadeBase:M})})})]}),i&&e.jsx(G,{variant:"danger",role:"alert",className:"w-full",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:i}),e.jsxs(_,{variant:"secondary",size:"sm",disabled:r,onClick:l,children:[e.jsx(ma,{"aria-hidden":"true"}),"Retry"]})]})})]})})},uo="w-full max-w-[400px]",mo=({query:t,onQueryChange:s,matchCount:a,matchSections:n,coreCount:r,advancedCount:i,modifiedCount:d,modifiedOnly:l,onModifiedOnlyChange:m,showAdvanced:u,onShowAdvancedChange:h,onExpandAll:x,onCollapseAll:g,unsavedCount:f,savingAll:w,onSaveAll:S,onDiscardAll:M})=>e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:W("relative",uo),children:[e.jsx(St,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-ink-dim","aria-hidden":"true"}),e.jsx(ne,{value:t,onChange:T=>s(T.target.value),onKeyDown:T=>{T.key==="Escape"&&t&&s("")},placeholder:"Search settings by name, description or key","aria-label":"Search settings",className:"pl-9"}),t&&e.jsx(_,{variant:"ghost",size:"icon-sm",className:"absolute top-1/2 right-1 -translate-y-1/2",onClick:()=>s(""),"aria-label":"Clear search",children:e.jsx(Ht,{"aria-hidden":"true"})})]}),e.jsxs("fieldset",{className:"m-0 border-0 p-0",children:[e.jsx("legend",{className:"sr-only",children:"Settings filters"}),e.jsxs("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:[e.jsxs(_,{variant:"ghost",size:"sm","aria-pressed":l,onClick:()=>m(!l),className:W(l&&"bg-surface text-ink hover:bg-surface"),children:["Modified",e.jsx(Ae,{variant:"neutral",children:d})]}),e.jsx(_,{variant:"ghost",size:"sm","aria-pressed":u,onClick:()=>h(!u),className:W(u&&"bg-surface text-ink hover:bg-surface"),children:"Show advanced"})]})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[f>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-meta text-ink-dim",children:f===1?"1 unsaved change":`${f} unsaved changes`}),e.jsx(_,{variant:"primary",size:"sm",disabled:w,onClick:S,children:w?"Saving":"Save all"}),e.jsx(_,{variant:"ghost",size:"sm",disabled:w,onClick:M,children:"Discard all"})]}),e.jsx(_,{variant:"ghost",size:"sm",onClick:x,children:"Expand all"}),e.jsx(_,{variant:"ghost",size:"sm",onClick:g,children:"Collapse all"})]})]}),e.jsx("p",{className:"text-meta text-ink-dim","aria-live":"polite",children:a!==null?`${a} ${a===1?"result":"results"} in ${n} ${n===1?"section":"sections"}`:l?`${d} modified ${d===1?"setting":"settings"}`:u?`${i} advanced settings shown — Expand all to see them`:`${r} core settings, ${i} advanced`})]}),ho={all:["desktop","settings"]},po={live:"Takes effect immediately","new launch":"Takes effect the next time the app starts","new sessions":"Takes effect for new conversations"},fo=40,xe=t=>t.toLowerCase().replace(/[-_.]/g," "),xo=({focusKey:t,initialFilter:s=""})=>{const a=qe(),n=Dt(),r=Ee(a.data,"settings"),[i,d]=o.useState(s),[l,m]=o.useState(!1),[u,h]=o.useState(!1),[x,g]=o.useState({}),[f,w]=o.useState({}),[S,M]=o.useState({}),[T,z]=o.useState(!1),[N,F]=o.useState(new Set),[$,U]=o.useState(new Set),[q,E]=o.useState(new Set),y=o.useRef(null),D=o.useRef(null),R=ve({queryKey:ho.all,queryFn:()=>ge({op:"settings.list"}),enabled:r,staleTime:1e4}),A=R.data;o.useEffect(()=>{A&&g(c=>{let p=!1;const b={...c};for(const j of A.settings){const L=c[j.key];if(!L){b[j.key]=le(j),p=!0;continue}if(Ce(j,L))continue;const I=le(j);(I.value!==L.value||I.cascadeBase!==L.cascadeBase)&&(b[j.key]=I,p=!0)}return p?b:c})},[A]);const K=o.useCallback(c=>!c.is_default||Ce(c,x[c.key]??le(c)),[x]),X=o.useMemo(()=>{const c=(A?.settings??[]).find(p=>p.key==="hosting");return c?(x.hosting??le(c)).value:""},[A,x]),B=o.useMemo(()=>{if(!A)return[];const c=xe(i.trim()),p=c.length>0||u;return A.settings.filter(b=>!p&&pe(b)==="advanced"&&!l||u&&!K(b)?!1:c?xe([b.label,b.help,b.key,b.section,b.warning??""].join(" ")).includes(c):!0)},[A,i,l,u,K]),k=i.trim().length>0||u,O=o.useMemo(()=>A?.sections??[],[A]),re=o.useCallback(c=>(A?.settings??[]).filter(p=>p.section===c),[A]),Q=c=>B.filter(p=>p.section===c),ue=c=>N.has(c)?!0:$.has(c)?!1:Fr(re(c)),fe=(c,p)=>{F(b=>{const j=new Set(b);return p?j.add(c):j.delete(c),j}),U(b=>{const j=new Set(b);return p?j.delete(c):j.add(c),j})},oe=(c,p)=>{E(b=>{const j=new Set(b);return p?j.delete(c):j.add(c),j})},ae=c=>{const p=O.filter(j=>c||Q(j.name).length>0).map(j=>j.name),b=$r(c,k,p);b.layout&&(F(new Set(b.layout.opened)),U(new Set(b.layout.closed))),E(new Set(b.filter))};o.useEffect(()=>{i.trim()||E(new Set)},[i]);const je=o.useCallback(c=>{const p=c.gated_by;if(!p||!A)return null;const b=A.settings.find(j=>j.key===p);return{key:p,label:b?.label??p,on:b?.value===!0||b?.value==="true"}},[A]),se=o.useCallback((c,p)=>w(b=>({...b,[c]:p})),[]),ie=o.useCallback((c,p)=>M(b=>({...b,[c]:p})),[]),ke=o.useCallback(async c=>{const p=x[c.key];if(!p)return!1;const b=Dr(c,p);if(!b.ok)return ie(c.key,b.error),!1;se(c.key,!0),ie(c.key,null);try{await ge(b.request),se(c.key,!1);const L=(await R.refetch()).data?.settings.find(I=>I.key===c.key);return L&&g(I=>{const me=I[c.key];return me&&me.value===p.value&&me.cascadeBase===p.cascadeBase?{...I,[c.key]:le(L)}:I}),!0}catch(j){return se(c.key,!1),ie(c.key,j instanceof Error?j.message:"The setting could not be saved."),!1}},[x,R,se,ie]),we=o.useCallback(async c=>{se(c.key,!0),ie(c.key,null);try{await ge({op:"settings.reset",key:c.key}),g(p=>({...p,[c.key]:le({...c,value:c.default,is_default:!0})})),se(c.key,!1),await R.refetch()}catch(p){se(c.key,!1),ie(c.key,p instanceof Error?p.message:"The setting could not be reset.")}},[R,se,ie]),C=o.useMemo(()=>(A?.settings??[]).filter(c=>Ce(c,x[c.key]??le(c))),[A,x]),H=async()=>{z(!0);for(const c of C)await ke(c);z(!1)},P=()=>{A&&(g(c=>{const p={...c};for(const b of A.settings)p[b.key]=le(b);return p}),M({}))};o.useEffect(()=>{if(!t||!A||y.current===t)return;const c=A.settings.find(j=>j.key===t);if(!c)return;y.current=t,pe(c)==="advanced"&&m(!0);const p=xe(i.trim());!p||xe([c.label,c.help,c.key,c.section].join(" ")).includes(p)||d(""),h(!1),F(j=>new Set(j).add(c.section)),U(j=>{const L=new Set(j);return L.delete(c.section),L})},[t,A,i]);const ce=o.useMemo(()=>{if(!t||!A)return!1;const c=A.settings.find(b=>b.key===t);if(!c||pe(c)==="advanced"&&!l)return!1;const p=xe(i.trim());return p?xe([c.label,c.help,c.key,c.section].join(" ")).includes(p):!0},[t,A,i,l]);if(o.useEffect(()=>{if(!ce||!t||D.current===t)return;let c=0,p=0;const b=()=>{const j=document.querySelector(`[data-setting-key="${CSS.escape(t)}"]`),L=j?.querySelector('[data-setting-control] :is(input, textarea, select, button[role="switch"], button)')??j;if(L){L===j&&(L.tabIndex=-1),L.focus(),L.scrollIntoView({block:"center"}),D.current=t;return}p+=1,p<fo&&(c=requestAnimationFrame(b))};return c=requestAnimationFrame(b),()=>cancelAnimationFrame(c)},[ce,t]),a.data&&!r)return e.jsx(G,{variant:"warning",children:"Searchable settings need a newer Local Operator server. Update the server and restart the app to manage these settings here."});if(R.isLoading||a.isLoading)return e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading settings"})});const Y=(a.data?null:a.error)??R.error;if(Y||!A){const c=a.isFetching||R.isFetching,{sentence:p,remedy:b}=Ct(n,"Your settings could not be loaded.",Y);return e.jsx(G,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:p}),b&&e.jsx(_,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{a.isError?a.refetch():R.refetch()},disabled:c,children:c?"Retrying":"Retry"})]})})}const ee=A.settings.reduce((c,p)=>(c[pe(p)]+=1,c),{core:0,advanced:0}),te=new Set(B.map(c=>c.section)).size;return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(mo,{query:i,onQueryChange:d,matchCount:i.trim()?B.length:null,matchSections:te,coreCount:ee.core,advancedCount:ee.advanced,modifiedCount:A.settings.filter(K).length,modifiedOnly:u,onModifiedOnlyChange:h,showAdvanced:l,onShowAdvancedChange:m,onExpandAll:()=>ae(!0),onCollapseAll:()=>ae(!1),unsavedCount:C.length,savingAll:T,onSaveAll:()=>void H(),onDiscardAll:P}),k&&B.length===0&&e.jsx("div",{className:"flex flex-col items-center py-6 text-center",children:e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No settings match this search. Clear the search field to see every setting again."})}),e.jsx("div",{className:"flex flex-col gap-1",children:O.map(c=>{const p=Q(c.name),b=re(c.name),j=k?0:b.filter(I=>pe(I)==="advanced").length;if(k&&p.length===0)return null;const L=k?p.length>0&&!q.has(c.name):ue(c.name);return e.jsxs("section",{"data-settings-section":c.name,"data-open":L,className:"flex flex-col",children:[e.jsx(io,{title:c.title,rowCount:p.length,advancedCount:j,scope:po[c.scope],modified:b.some(K),defaultOpen:L,onOpenChange:I=>k?oe(c.name,I):fe(c.name,I)},`${c.name}:${L?"open":"closed"}`),e.jsxs("div",{hidden:!L,className:"flex flex-col pb-3",children:[c.description&&e.jsx("p",{className:"px-1 pb-1 text-meta text-ink-dim",children:c.description}),p.length===0?e.jsxs("div",{className:"flex items-center gap-2 px-1 py-2",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:j>0?"Advanced settings are hidden here.":"Nothing in this section matches."}),j>0&&e.jsxs(_,{variant:"secondary",size:"sm",onClick:()=>m(!0),children:["Show ",j," advanced"]})]}):p.map(I=>e.jsx(lo,{setting:I,draft:x[I.key]??le(I),tier:pe(I),gate:je(I),effectiveHosting:X,saving:!!f[I.key],error:S[I.key]??null,onDraftChange:me=>g(Ne=>({...Ne,[I.key]:me})),onSave:()=>void ke(I),onReset:()=>void we(I)},I.key))]})]},c.name)})})]})},st=({credentialKey:t,isConfigured:s=!1,onEdit:a,onClear:n,onAdd:r})=>{const i=ha(t),d=s?vn:Re;return e.jsxs("div",{className:"flex flex-col rounded-md p-3 transition-colors duration-fast ease-out-quart hover:bg-elevated",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-body font-medium text-ink",children:[e.jsx(d,{className:"size-3.5 shrink-0 text-ink-dim"}),i.name]}),e.jsx("p",{className:"mt-1 break-all text-mono-sm text-ink-dim",children:t}),e.jsx("p",{className:"mt-2 text-body-sm text-ink-muted",children:i.description})]}),e.jsx("div",{className:"mt-auto flex flex-wrap items-center justify-end gap-2 pt-4",children:s?e.jsxs(e.Fragment,{children:[e.jsxs(_,{variant:"ghost",size:"sm",onClick:()=>a?.(t),children:[e.jsx(pa,{}),"Update"]}),e.jsxs(_,{variant:"ghost",size:"sm",className:"text-danger hover:bg-danger-wash hover:text-danger",onClick:()=>n?.(t),children:[e.jsx(Mt,{}),"Clear"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(_,{variant:"outline",size:"sm",onClick:()=>r?.(t),children:[e.jsx(Re,{}),"Configure"]}),i.url&&e.jsx(Me,{content:`Get your ${i.name} key`,children:e.jsx(_,{variant:"ghost",size:"icon-sm",asChild:!0,children:e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer","aria-label":`Get your ${i.name} key`,children:e.jsx(At,{})})})})]})})]})},ze="_custom_",nt="credential-custom-key",rt="credential-custom-key-error",ot="credential-type",it="credential-type-help",ct="credential-value",lt="credential-value-help",dt=({open:t,onClose:s,onSave:a,initialKey:n="",existingKeys:r,isSaving:i,isEditMode:d})=>{const[l,m]=o.useState(n),[u,h]=o.useState(""),[x,g]=o.useState(""),[f,w]=o.useState(!1);o.useEffect(()=>{if(t){const y=be.some(R=>R.key===n),D=!d&&n&&!y;m(y?n:""),h(""),g(D?n:""),w(D||d&&!y)}},[t,n,d]);const S=()=>{let y="";if(d?y=n:y=f?x.trim():l,!y){console.error("No key provided for credential");return}if(!u.trim()){console.error("No value provided for credential");return}a({key:y,value:u})},M=y=>r.includes(y)&&y!==n,T=M(x),z=d?!0:f?x.trim()!==""&&!T:l!==""&&!M(l),N=u.trim()!=="",F=z&&N&&!i,$=be.find(y=>y.key===l),U=!!$&&!f,q=d?"Update credential":"Add new credential",E=e.jsxs(e.Fragment,{children:[e.jsx(_,{variant:"secondary",onClick:s,children:"Cancel"}),e.jsxs(_,{variant:"primary",onClick:S,disabled:!F,children:[i&&e.jsx(J,{size:"sm",className:"border-t-on-accent"}),i?"Saving...":"Save"]})]});return e.jsx(fa,{open:t,onClose:s,title:q,actions:E,maxWidth:"sm",fullWidth:!0,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[d?e.jsx(Z,{label:"Credential key",value:e.jsx("span",{className:"text-mono-sm",children:n})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(de,{htmlFor:ot,children:"Credential type"}),e.jsxs(pt,{value:f?ze:l,onValueChange:y=>{y===ze?(w(!0),m("")):(w(!1),m(y),g(""))},children:[e.jsx(ft,{id:ot,"aria-describedby":U?it:void 0,children:e.jsx(xt,{placeholder:"Select a credential type"})}),e.jsxs(gt,{children:[be.filter(y=>!y.internal).map(y=>e.jsxs(De,{value:y.key,disabled:M(y.key),children:[y.name,M(y.key)&&" (configured)"]},y.key)),e.jsx(De,{value:ze,children:"Custom credential"})]})]}),U&&$&&e.jsxs("div",{id:it,className:"flex flex-col items-start gap-1",children:[e.jsx("p",{className:"text-meta text-ink-dim",children:$.description}),$.url&&e.jsxs("a",{href:$.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent text-meta underline-offset-4 hover:text-accent-hover hover:underline",children:["Get your ",$.name," key"]})]})]}),f&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(de,{htmlFor:nt,children:"Custom credential key"}),e.jsx(ne,{id:nt,value:x,onChange:y=>g(y.target.value),"aria-invalid":T||void 0,"aria-describedby":T?rt:void 0,required:!0,autoFocus:!0}),T&&e.jsx("p",{id:rt,className:"text-danger text-meta",children:"This credential already exists"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(de,{htmlFor:ct,children:"Credential value"}),e.jsx(ne,{id:ct,type:"password",value:u,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&F&&S()},"aria-describedby":d?lt:void 0,required:!0,autoFocus:d,placeholder:"Enter the credential value or API key"}),d&&e.jsxs("p",{id:lt,className:"text-ink-dim text-meta",children:["Enter the new value for ",n]})]})]})})},ut=({title:t,description:s,children:a,isEmpty:n=!1,emptyStateType:r="noCredentials"})=>e.jsxs("section",{children:[e.jsx("h3",{className:"text-body font-medium text-ink",children:t}),e.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:s}),e.jsx(Bt,{variant:"surface",padding:"sm",className:"mt-3",children:n?e.jsx(go,{type:r}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(260px,1fr))] gap-2",children:a})})]}),go=({type:t,className:s})=>{const a=t==="noCredentials",n=a?Re:yt;return e.jsxs("div",{className:W("flex flex-col items-center px-4 py-8 text-center",s),children:[e.jsx(n,{size:20,className:"text-ink-dim","aria-hidden":!0}),e.jsx("p",{className:"mt-3 text-body font-medium text-ink",children:a?"No credentials configured":"All available credentials configured"}),e.jsx("p",{className:"mt-1 max-w-sm text-body-sm text-ink-muted",children:a?"You haven't set up any API credentials yet. Add credentials from the available options or add a custom one.":"You've configured all the common API credentials. You can still add custom credentials if needed."})]})},yo=()=>{const{data:t,isLoading:s,error:a,refetch:n}=Et(),r=xa(),[i,d]=o.useState(!1),[l,m]=o.useState(!1),[u,h]=o.useState(null),x=N=>{h(N),d(!0)},g=(N=null)=>{h(N),m(!0)},f=()=>{d(!1),m(!1),h(null)},w=async N=>{try{await r.mutateAsync(N),f(),await n()}catch(F){console.error("Error saving credential:",F)}},S=async N=>{try{await r.mutateAsync({key:N,value:""}),await n()}catch(F){console.error("Error clearing credential:",F)}},M=o.useMemo(()=>t?.keys?.filter(N=>!be.find(F=>F.key===N)?.internal)??[],[t]),T=o.useMemo(()=>be.filter(N=>!M.includes(N.key)&&!N.internal),[M]),z=()=>s?e.jsx("div",{className:"flex min-h-40 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading credentials"})}):a||!t?e.jsxs(G,{variant:"danger",role:"alert",children:[e.jsx(Vt,{children:"Could not load credentials"}),e.jsx(Gt,{children:a instanceof Error?a.message:"The server did not say why. Check that Local Operator is running, then reopen this page."})]}):e.jsxs(e.Fragment,{children:[e.jsx(ut,{title:"Configured credentials",description:"These API credentials are currently configured and available for use.",isEmpty:M.length===0,emptyStateType:"noCredentials",children:M.map(N=>e.jsx(st,{credentialKey:N,isConfigured:!0,onEdit:x,onClear:S},N))}),e.jsx(ut,{title:"Available credentials",description:"These are common API credentials you can configure to enhance functionality.",isEmpty:T.length===0,emptyStateType:"allConfigured",children:T.map(N=>e.jsx(st,{credentialKey:N.key,isConfigured:!1,onAdd:()=>g(N.key)},N.key))}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(_,{variant:"secondary",size:"sm",onClick:()=>g(null),children:[e.jsx(ga,{}),"Add custom credential"]})}),i&&e.jsx(dt,{open:i,onClose:f,onSave:w,initialKey:u||"",existingKeys:M,isSaving:r.isPending,isEditMode:!0}),l&&e.jsx(dt,{open:l,onClose:f,onSave:w,initialKey:u||"",existingKeys:M,isSaving:r.isPending,isEditMode:!1})]});return e.jsx("div",{className:"flex flex-col gap-6",children:z()})},vo=[[[".claude.json"],"Claude Code"],[[".claude",".mcp.json"],"Claude Code"],[[".cursor","mcp.json"],"Cursor"],[[".vscode","mcp.json"],"VS Code"],[[".codex","config.toml"],"Codex CLI"]];function ko(t){if(!t)return null;const s=t.split("\\").join("/").split("/").filter(Boolean);for(const[a,n]of vo)if(!(s.length<a.length)&&s.slice(-a.length).join("/")===a.join("/"))return n;return null}const bo={list:"status",add:"add",remove:"remove",reload:"reload",connect:"reconnect",probe:"probe",disconnect:"disconnect",login:"grant",logout:"disconnect",reauth:"grant",status:"status",cancel:"cancel"},jo=(t,s)=>{const a=t?.trim();if(!a)return null;const n=Na(a,s);return n.kind==="auth"?{kind:"matched",name:n.name,unresolved:null}:{kind:"miss",asked:a}},wo=t=>t.reduce((s,a)=>s?(a.updated_at??0)>(s.updated_at??0)?a:s:a,null),No=({sessionId:t,onAdded:s})=>{const[a,n]=o.useState(""),[r,i]=o.useState("command"),[d,l]=o.useState(""),[m,u]=o.useState(""),[h,x]=o.useState(""),[g,f]=o.useState("global"),[w,S]=o.useState(null),[M,T]=o.useState(!1),z=async()=>{T(!0),S(null);try{await ge({op:"mcp.control",sessionId:t,control:{action:"add",name:a,scope:g,...r==="command"?{command:d,args:m.split(`
317
- `).map(N=>N.trim()).filter(Boolean)}:{url:h}}}),n(""),l(""),u(""),x(""),s()}catch(N){S(Rt("add",N,!1))}finally{T(!1)}};return e.jsxs("form",{className:"flex flex-col gap-3 rounded-md border border-control bg-surface p-4",onSubmit:N=>{N.preventDefault(),z()},children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(de,{htmlFor:"mcp-add-name",children:"Name"}),e.jsx(ne,{id:"mcp-add-name",value:a,onChange:N=>n(N.target.value),required:!0})]}),e.jsxs("fieldset",{className:"flex gap-2",children:[e.jsx("legend",{className:"sr-only",children:"Server transport"}),e.jsx(_,{type:"button",variant:r==="command"?"secondary":"ghost",size:"sm",onClick:()=>i("command"),children:"Local command"}),e.jsx(_,{type:"button",variant:r==="url"?"secondary":"ghost",size:"sm",onClick:()=>i("url"),children:"Remote URL"})]}),r==="command"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(de,{htmlFor:"mcp-add-command",children:"Command"}),e.jsx(ne,{id:"mcp-add-command",value:d,onChange:N=>l(N.target.value),className:"font-mono",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(de,{htmlFor:"mcp-add-args",children:"Arguments, one per line"}),e.jsx("textarea",{id:"mcp-add-args",value:m,onChange:N=>u(N.target.value),rows:2,className:"rounded-sm border border-control bg-surface p-2 font-mono text-body-sm text-ink"})]})]}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(de,{htmlFor:"mcp-add-url",children:"URL"}),e.jsx(ne,{id:"mcp-add-url",type:"url",value:h,onChange:N=>x(N.target.value),className:"font-mono",required:!0}),e.jsx("p",{className:"text-meta text-ink-dim",children:"No inline credentials or query parameters; secrets are referenced from the credential manager."})]}),e.jsxs("fieldset",{className:"flex gap-2",children:[e.jsx("legend",{className:"sr-only",children:"Configuration scope"}),e.jsx(_,{type:"button",variant:g==="global"?"secondary":"ghost",size:"sm",onClick:()=>f("global"),children:"Global"}),e.jsx(_,{type:"button",variant:g==="project"?"secondary":"ghost",size:"sm",onClick:()=>f("project"),children:"This project"})]}),w&&e.jsxs(G,{variant:"danger",children:[e.jsx("p",{children:w.message}),w.detail?e.jsx("p",{className:"font-mono text-ink-dim text-mono-sm",title:w.detail,children:w.detail}):null]}),e.jsx("div",{children:e.jsxs(_,{type:"submit",variant:"primary",size:"sm",disabled:M||!a||!(r==="command"?d:h),children:[M?e.jsx(J,{size:"sm"}):null,"Add server"]})})]})},_o=({sessionId:t,sectionRef:s,highlightServer:a})=>{const n=qe(),r=Ee(n.data,"mcp"),i=jt(),d=_e(k=>k.sessions),l=_e(k=>k.fetchSessions),m=_e(k=>k.loading),u=o.useMemo(()=>t?null:wo(d),[t,d]),h=t??u?.session_id,[x,g]=o.useState(null),[f,w]=o.useState(null),[S,M]=o.useState(!1),[T,z]=o.useState(null),N=ya({sessionId:h}),[F,$]=o.useState("");o.useEffect(()=>{t||!r||d.length>0||l()},[t,r,d.length,l]);const U=ve({queryKey:Te.list(h??""),queryFn:()=>{if(!h)throw new Error("No conversation selected.");return _a(h)},enabled:r&&!!h,staleTime:1e4}),q=va(U.data),E=o.useMemo(()=>jo(a,q.map(k=>k.name)),[a,q]),y=E?.kind==="matched"?E.name:null,D=o.useRef(null),R=o.useRef(null),A=F.trim().toLowerCase(),K=o.useMemo(()=>A?q.filter(k=>k.name.toLowerCase().includes(A)):q,[q,A]);o.useEffect(()=>{!y||R.current===y||!F||$("")},[y,F]),o.useEffect(()=>{y&&R.current!==y&&K.some(k=>k.name===y)&&(R.current=y,D.current?.scrollIntoView({block:"center",behavior:"smooth"}))},[y,K]);const X=o.useCallback(()=>{h&&i.invalidateQueries({queryKey:Te.list(h)})},[i,h]),B=o.useCallback(async(k,O,re={})=>{if(h){w(null);try{await ge({op:"mcp.control",sessionId:h,control:{action:k,name:O,...re}}),X()}catch(Q){const ue=i.getQueryData(Te.list(h));w(Rt(bo[k],Q,ka(ue?.operations)))}}},[i,h,X]);return r?h?e.jsx(V,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts. A connected server is a working transport; the account behind it may still need its own sign-in.",sectionRef:s,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[f&&e.jsxs(G,{variant:"danger",children:[e.jsx("p",{children:f.message}),f.detail?e.jsx("p",{className:"font-mono text-ink-dim text-mono-sm",title:f.detail,children:f.detail}):null]}),u&&e.jsxs("p",{className:"text-body-sm text-ink-muted",children:["Showing MCP servers for"," ",u.title?.trim()||u.session_id.slice(0,6),", your most recent conversation. Open a conversation to see its own list."]}),U.isLoading&&e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading MCP servers"})}),U.isError&&e.jsx(G,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:"MCP servers could not be loaded."}),e.jsx(_,{variant:"secondary",size:"sm",onClick:()=>void U.refetch(),children:"Retry"})]})}),q.length>0&&e.jsxs("div",{className:"relative",children:[e.jsx(St,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-ink-dim"}),e.jsx(ne,{value:F,onChange:k=>$(k.target.value),placeholder:"Search MCP servers","aria-label":"Search MCP servers",className:"pl-9"})]}),E?.kind==="miss"&&q.length>0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:`No MCP server matches "${E.asked}".`}),E?.kind==="matched"&&E.unresolved&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:`Showing "${E.name}" — "${E.unresolved}" is not one of your servers.`}),U.isSuccess&&q.length===0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No MCP servers configured yet. Add one below."}),q.length>0&&K.length===0&&e.jsxs("div",{className:"flex flex-col items-start gap-2",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No MCP servers match this search."}),e.jsx(_,{variant:"secondary",size:"sm",onClick:()=>$(""),children:"Clear search"})]}),K.length>0&&e.jsx("ul",{className:"flex flex-col gap-2",children:K.map(k=>{const O=k.status==="connected",re=k.name===y,Q=k.owned_scope,ue=k.transport==="http"&&k.transport_oauth_supported!==!1,fe=ko(k.source);return e.jsxs("li",{ref:re?D:void 0,className:W("flex flex-col gap-2 rounded-md border border-control bg-surface p-3",re&&"border-accent bg-elevated"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-body text-ink",children:k.name}),Q&&e.jsx(Ae,{variant:"outline",children:Q==="project"?"This project":"Global"}),k.transport&&e.jsx("span",{className:"text-meta text-ink-dim",children:k.transport})]}),e.jsx(Ae,{variant:O?"success":k.status==="connecting"?"info":k.status==="auth-required"?"warning":"neutral",children:k.status??"unknown"})]}),typeof k.tool_count=="number"&&e.jsxs("p",{className:"text-meta text-ink-dim",children:[k.tool_count," tools available"]}),k.status==="auth-required"&&!ue&&e.jsx("p",{className:"text-meta text-ink-dim",children:k.setup?.text?"This server needs credentials local-operator cannot collect. Copy the setup prompt to have an agent walk you through it.":"This server needs credentials local-operator cannot collect."}),!Q&&e.jsxs("p",{className:"text-meta text-ink-dim",children:[fe?`Imported from ${fe}.`:"Imported from a configuration local-operator does not write."," ",k.source?e.jsxs(e.Fragment,{children:["Remove it in"," ",e.jsx("span",{className:"font-mono text-mono-sm text-ink-dim",children:ba(k.source)}),"."]}):e.jsx(e.Fragment,{children:"Remove it wherever it is defined."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[O?e.jsxs(_,{variant:"secondary",size:"sm",onClick:()=>{g(null),B("disconnect",k.name,{confirmed:!0})},children:[e.jsx(Tt,{"aria-hidden":"true"}),"Disconnect"]}):e.jsxs(_,{variant:"secondary",size:"sm",onClick:()=>void B("connect",k.name),children:[e.jsx(Rn,{"aria-hidden":"true"}),"Connect"]}),e.jsxs(_,{variant:"ghost",size:"sm",onClick:()=>void B("reload",k.name),children:[e.jsx(Kt,{"aria-hidden":"true"}),"Reload"]}),e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>{const oe=ja(U.data?.servers??[]).find(ae=>ae.name===k.name);oe&&z({row:oe,sessionId:h})},children:"Sign in"}),k.setup?.text?e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>{navigator.clipboard.writeText(k.setup?.text??"").catch(()=>{})},children:"Copy setup prompt"}):null,Q?x===k.name?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-body-sm text-ink",children:["Remove ",k.name,"?"]}),e.jsx(_,{variant:"danger",size:"sm",onClick:()=>{g(null),B("remove",k.name,{confirmed:!0,scope:Q})},children:"Confirm removal"}),e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>g(null),children:"Keep"})]}):e.jsxs(_,{variant:"ghost",size:"sm",className:"text-danger",onClick:()=>g(k.name),children:[e.jsx(Mt,{"aria-hidden":"true"}),"Remove"]}):null]})]},k.name)})}),T?.sessionId===h?e.jsx(wa,{row:T.row,remedy:N,onClose:()=>z(null)},h):null,S?e.jsx(No,{sessionId:h,onAdded:()=>{M(!1),X()}}):e.jsx("div",{children:e.jsx(_,{variant:"secondary",size:"sm",onClick:()=>M(!0),"data-tour-tag":"mcp-add-server",children:"Add server"})})]})}):e.jsx(V,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts.",sectionRef:s,children:m?e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading MCP servers"})}):e.jsx("p",{className:"text-body-sm text-ink-muted",children:"Open a conversation to manage its MCP servers."})}):e.jsx(V,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts.",sectionRef:s,children:e.jsx(G,{variant:"warning",children:"Integration management needs a newer Local Operator backend. Update the backend and restart the app to manage MCP servers here."})})},So=({onAfterCredentialUpdate:t})=>{const{isAuthenticated:s,user:a,isLoading:n,accountRead:r,signOut:i}=Sa(),d=Lt(x=>x.isSigningOut),l=o.useCallback(async()=>{try{await i()}catch(x){console.error("Error signing out:",x)}},[i]),m=o.useMemo(()=>{if(!s||!a?.radientUser)return null;const{account:x,identity:g}=a.radientUser;return e.jsxs(e.Fragment,{children:[e.jsxs(He,{children:[e.jsx(Z,{label:"Status",value:e.jsxs("span",{className:"inline-flex items-center gap-2",children:["Connected",e.jsx(Ae,{variant:"success",className:"capitalize",children:x.status})]})}),e.jsx(Z,{label:"Name",value:x.name||"Not provided"}),e.jsx(Z,{label:"Email",value:x.email}),e.jsx(Z,{label:"Account ID",value:e.jsx("span",{className:"text-mono-sm",children:x.id})}),e.jsx(Z,{label:"Tenant ID",value:e.jsx("span",{className:"text-mono-sm",children:x.tenant_id})}),e.jsx(Z,{label:"Provider",value:e.jsx("span",{className:"capitalize",children:g.provider})}),e.jsx(Z,{label:"Created",value:It(x.created_at)})]}),e.jsxs("div",{className:"mt-8",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"Need to sign out or switch accounts?"}),e.jsxs(_,{variant:"danger",className:"mt-3",onClick:l,children:[e.jsx(Ca,{}),"Sign out from Radient"]})]})]})},[s,a?.radientUser,l]),u=o.useMemo(()=>r==="refused"?"Radient refused the sign-in this app is holding, so your account details could not be read. Signing in again below replaces it.":zt(r)?"Your Radient account could not be read, so this app cannot show your account details.":"You are not currently signed in to Radient.",[r]),h=o.useMemo(()=>s&&a?null:e.jsxs("div",{children:[e.jsxs("p",{className:"text-body-sm text-ink-muted",children:[u," Sign in to access your account details or sign up to get free credits and unified access to models, tools, and more with Radient Pass. Radient's automatic model router will automatically select the best model for your agents to balance cost and performance. It is often cheaper to use Radient Pass than to use single AI providers due to automatic cost optimization."]}),e.jsx("div",{className:"mt-6",children:e.jsx(Ja,{titleText:"",onAfterCredentialUpdate:t,descriptionText:"",onSignInSuccess:()=>{}})})]}),[s,a,u,t]);return n||d?e.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center gap-3",children:[e.jsx(J,{size:"lg",label:"Loading account"}),!d&&e.jsx("p",{className:"text-meta text-ink-dim",children:"Loading your Radient account details…"})]}):s&&a?.radientUser?m:e.jsx("div",{className:"flex flex-col gap-4",children:h})};function Co({metric:t,data:s}){return e.jsx(Ma,{title:"",heightClassName:"h-62",yAxisWidth:48,unit:t==="credits"?"credits":"tokens",srSummary:`${t==="credits"?"Credits consumed":"Tokens used"} over the last 30 days, plotted per day across ${s.length} days.`,xTickFormatter:a=>a,yTickFormatter:a=>t==="credits"?`$${a.toFixed(2)}`:Aa(a),children:e.jsx(Nr,{data:s,children:e.jsx(wt,{type:"monotone",dataKey:"value",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:0},name:t==="credits"?"Credits consumed":"Tokens used"})})})}const Mo=()=>{const{data:t,isLoading:s,error:a,refetch:n}=br(),r=jr(),[i,d]=o.useState(""),[l,m]=o.useState(!1);o.useEffect(()=>{d(t?.content??""),m(!1)},[t]);const u=w=>{const S=w.target.value;d(S),m(S!==(t?.content??""))},h=async()=>{if(!(!l||r.isPending))try{const w={content:i};await r.mutateAsync(w),await n(),m(!1)}catch(w){console.error("Error updating system prompt:",w)}},x=()=>{d(t?.content??""),m(!1)},g=r.isPending,f=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(de,{htmlFor:"app-system-prompt",children:"Instructions"}),e.jsx($e,{id:"app-system-prompt",name:"systemPrompt",value:i,onChange:u,placeholder:"Enter instructions for how all agents should behave and respond to your requests...",className:"min-h-50"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(_,{variant:"primary",onClick:h,disabled:!l||g,children:[g?e.jsx(J,{size:"sm"}):e.jsx(Ea,{}),g?"Saving...":"Save changes"]}),e.jsx(_,{onClick:x,disabled:!l||g,children:"Cancel"})]}),t?.last_modified&&e.jsxs("p",{className:"text-ink-dim text-meta",children:["Last modified:"," ",e.jsx("span",{className:"font-mono text-mono-sm",children:Ft(t.last_modified)})]})]});return e.jsx(V,{title:"System prompt",icon:Xa,description:"Every Local Operator agent receives this prompt in addition to its own instructions, so it is the place for baseline expectations and for details you want every agent to know about you, such as your name, location, or preferences. It is sent to your selected hosting provider.",children:s?e.jsx("div",{className:"flex min-h-50 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading system prompt"})}):a?e.jsxs(G,{variant:"danger",children:["Failed to load system prompt:"," ",a instanceof Error?a.message:"Unknown error"]}):f()})},Ao=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Eo=t=>Ao.includes(t),Ro=t=>{const s=[];let a=0;for(const n of t){const r=Math.max(0,Math.floor(n.count)),i=Math.max(1,Math.floor(n.columns));for(let d=0;d<r;d+=i)s.push({start:a+d,count:Math.min(i,r-d)});a+=r}return s},To=({index:t,key:s,groups:a})=>{const n=Ro(a),r=n.reduce((i,d)=>i+d.count,0);if(!Number.isInteger(t)||t<0||t>=r)return t;switch(s){case"Home":return 0;case"End":return r-1;case"ArrowLeft":return Math.max(0,t-1);case"ArrowRight":return Math.min(r-1,t+1);case"ArrowUp":case"ArrowDown":{const i=n.findIndex(m=>t>=m.start&&t<m.start+m.count),d=n[i+(s==="ArrowDown"?1:-1)];if(!d)return t;const l=t-n[i].start;return d.start+Math.min(l,d.count-1)}default:return t}},Lo={localOperatorDark:_n,localOperatorLight:Kn,dracula:On,dune:Qs,sage:fn,monokai:Qt,tokyoNight:An,iceberg:Un,radient:ln,neon:vr,obsidian:$t,synth:ls,catppuccinMocha:zs,catppuccinLatte:bn,tokyoNightStorm:Cs,gruvbox:gs,nord:gr,oneDark:is,solarizedDark:Vn,rosePine:en,rosePineMoon:wn,rosePineDawn:Ls,alucard:an,gruvboxLight:qs,tokyoNightDay:Cn,oneLight:gn,catppuccinFrappe:Ps,catppuccinMacchiato:un,palenight:La,everforest:ir,everforestLight:rr,kanagawaWave:hr,kanagawaLotus:Js,ayuDark:Bs,ayuMirage:Gs,ayuLight:zn,nightfox:As,duskfox:Wn,synthwave:Ln,matrix:us,tron:_s,cyberpunk:Ta,vaporwave:sr,outrun:fs,neonNoir:lr,arcade:hn,forest:tr,ocean:Ys,desert:Xn,autumn:fr,lavender:Hn,arctic:Rs,rosewood:on,solarizedLight:Zn,githubLight:nn,paper:Ra,linen:$n,highContrastLight:rs,mintLight:hs},mt="bg-[color-mix(in_srgb,var(--color-accent)_8%,var(--color-accent-wash))]",Io=({id:t})=>e.jsxs("div",{"data-theme":t,"aria-hidden":"true",className:"flex h-full bg-canvas",children:[e.jsxs("div",{className:"flex w-1/4 flex-col gap-1 bg-sunken p-1",children:[e.jsx("span",{className:"flex h-2.5 items-center rounded-xs bg-accent-wash px-1",children:e.jsx("span",{className:"h-1 w-full rounded-xs bg-accent"})}),e.jsx("span",{className:"mx-1 h-1 w-2/3 rounded-xs bg-ink-dim"}),e.jsx("span",{className:"mx-1 h-1 w-1/2 rounded-xs bg-ink-dim"})]}),e.jsxs("div",{className:"flex flex-1 flex-col justify-between p-1",children:[e.jsxs("div",{className:"flex flex-col gap-1 rounded-xs bg-surface p-1",children:[e.jsx("span",{className:"h-1 w-3/5 rounded-xs bg-ink"}),e.jsx("span",{className:"h-1 w-full rounded-xs bg-ink-dim"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"h-2.5 w-6 rounded-xs bg-elevated"}),e.jsx("span",{className:"h-2.5 w-5 rounded-xs bg-accent"}),e.jsx("span",{className:"h-2.5 w-4 rounded-xs bg-accent-alt"}),e.jsx("span",{className:"h-2.5 w-4 rounded-xs border border-control"})]})]})]}),zo=({id:t,name:s,description:a,isSelected:n,isTabStop:r,onSelect:i,onFocusTile:d})=>{const l=Lo[t];return e.jsx(Me,{side:"bottom",align:"start",content:a,children:e.jsxs("button",{type:"button","data-theme-tile":t,"aria-pressed":n,tabIndex:r?0:-1,onFocus:d,onClick:i,className:W("relative flex flex-col gap-1.5 rounded-md p-1 text-left transition-colors duration-fast ease-out-quart",n?mt:"hover:bg-surface"),children:[e.jsxs("span",{className:W("relative block h-10 overflow-hidden rounded-sm border transition-colors duration-fast ease-out-quart",n?"border-accent":"border-hairline"),children:[e.jsx(Io,{id:t}),n&&e.jsx("span",{className:W("pointer-events-none absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full",mt),children:e.jsx(yt,{size:12,className:"text-accent","aria-hidden":"true"})})]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(l,{size:12,className:"shrink-0 text-ink-dim","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-meta text-ink",children:s})]})]})})},Fo=t=>[...t.querySelectorAll("[data-theme-grid]")].map(s=>{const a=[...s.querySelectorAll("[data-theme-tile]")],n=a[0]?.getBoundingClientRect().top??0;return{count:a.length,columns:Math.max(1,a.filter(r=>Math.abs(r.getBoundingClientRect().top-n)<1).length)}}),$o=()=>{const{themeName:t,setTheme:s}=Oe(),a=o.useMemo(()=>{const l=Object.values(Yt);return[{label:"Dark",items:l.filter(m=>m.theme.palette.mode==="dark")},{label:"Light",items:l.filter(m=>m.theme.palette.mode==="light")}].filter(m=>m.items.length>0)},[]),[n,r]=o.useState(null),i=o.useMemo(()=>{const l=a.flatMap(m=>m.items.map(u=>u.id));return n&&l.includes(n)?n:l.includes(t)?t:l[0]},[a,n,t]),d=l=>{if(!Eo(l.key))return;const m=[...l.currentTarget.querySelectorAll("[data-theme-tile]")],u=m.indexOf(l.target);if(u<0)return;l.preventDefault();const h=To({index:u,key:l.key,groups:Fo(l.currentTarget)});h!==u&&m[h]?.focus()};return e.jsx(Zt,{children:e.jsx("div",{onKeyDown:d,className:"flex flex-col gap-6",children:a.map(l=>e.jsxs("div",{children:[e.jsx("h3",{className:"px-1 pb-2 text-meta text-ink-dim",children:l.label}),e.jsx("div",{"data-theme-grid":l.label,className:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-2",children:l.items.map(({id:m,name:u,description:h})=>e.jsx(zo,{id:m,name:u,description:h,isSelected:m===t,isTabStop:m===i,onSelect:()=>s(m),onFocusTile:()=>r(m)},m))})]},l.label))})})},Do=()=>{const{data:t,isLoading:s,error:a}=Cr({enabled:!0});return e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-3 flex items-center gap-2 text-heading text-ink",children:[e.jsx(Ds,{size:16,className:"shrink-0 text-ink-dim"}),"Radient Pass"]}),s&&e.jsx(vt,{className:"h-6 w-36"}),a&&e.jsxs(G,{variant:"warning",children:["Could not load your credit balance. ",a.message]}),t&&!s&&!a&&e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsxs("p",{className:"flex-1 text-body-sm text-ink-muted",children:["Available credits"," ",e.jsx("span",{className:"font-medium text-ink",children:t.balance.toFixed(2)})]}),e.jsx(_,{variant:"secondary",size:"sm",asChild:!0,children:e.jsxs("a",{href:"https://console.radienthq.com/dashboard/billing",target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ws,{}),"Add credits"]})})]})]})},Oo=[{id:"credits",label:"Credits"},{id:"tokens",label:"Tokens"}],Po=()=>{const[t,s]=o.useState("credits"),a=o.useMemo(()=>{const l=new Date,m=_r(l);return{start_date:Je(m),end_date:Je(l),rollup:"daily"}},[]),{data:n,isLoading:r,error:i}=Er(a,{enabled:!0}),d=o.useMemo(()=>n?.data_points?[...n.data_points].sort((m,u)=>Ie(m.timestamp).getTime()-Ie(u.timestamp).getTime()).map(m=>({bucket:Za(ss(Ie(m.timestamp),"yyyy-MM-dd")),value:t==="credits"?Number.parseFloat(m.total_cost.toFixed(2)):m.total_tokens})):[],[n,t]);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-heading text-ink",children:[e.jsx(vs,{size:16,className:"shrink-0 text-ink-dim"}),"Usage (last 30 days)"]}),e.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[e.jsx("legend",{className:"sr-only",children:"Usage metric"}),e.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:Oo.map(({id:l,label:m})=>e.jsx(_,{variant:"ghost",size:"sm","aria-pressed":t===l,onClick:()=>s(l),className:W(t===l&&"bg-surface text-ink hover:bg-surface"),children:m},l))})]})]}),r&&e.jsx(vt,{className:"h-62 w-full"}),i&&e.jsxs(G,{variant:"warning",children:["Could not load your usage data. ",i.message]}),!r&&!i&&n&&d.length>0&&e.jsx(Co,{metric:t,data:d}),!r&&!i&&(!n||d.length===0)&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No usage recorded in the last 30 days."})]})},Uo=()=>e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[e.jsx(Qa,{size:16,className:"shrink-0 text-ink-dim"}),"Radient account"]}),e.jsx(_,{variant:"secondary",size:"sm",className:"self-start sm:self-center",asChild:!0,children:e.jsxs("a",{href:"https://console.radienthq.com",target:"_blank",rel:"noopener noreferrer",children:["Go to Radient console",e.jsx(At,{})]})})]}),Yo=()=>{const t=Oe(C=>C.showAgentReasoning),s=Oe(C=>C.setShowAgentReasoning),{data:a,isLoading:n,isFetching:r,error:i,refetch:d}=Ia(),l=Dt(),{sentence:m,remedy:u}=Ct(l,"Your settings could not be loaded.",i),h=za(),[x,g]=o.useState(null),f=Lt(),{isAuthenticated:w,accountRead:S,isFetching:M,isRefreshing:T,refreshUser:z}=Ue(),N=_e(C=>C.activeSessionId),[F,$]=o.useState("general"),[U,q]=o.useState(!1),E=o.useRef(null),y=o.useRef(null),{startTour:D}=Fa(),R=$a(),{data:A,refetch:K}=Et(),{refreshModels:X}=Da(),B=o.useMemo(()=>A?.keys?[...A.keys].sort():[],[A?.keys]),k=o.useRef({keys:"",hosting:void 0});o.useEffect(()=>{const C=B.join(","),H=a?.values?.hosting;(k.current.keys!==C||k.current.hosting!==H)&&(k.current={keys:C,hosting:H},X().catch(P=>{console.error("Failed to refresh models after credentials or hosting change:",P)}))},[B,a?.values?.hosting,X]);const O=o.useRef({general:o.useRef(null),radient:o.useRef(null),integrations:o.useRef(null),appearance:o.useRef(null),credentials:o.useRef(null),providers:o.useRef(null),backend:o.useRef(null),updates:o.useRef(null)}).current,re=o.useMemo(()=>new URLSearchParams(R.search).get("setting"),[R.search]),Q=o.useMemo(()=>new URLSearchParams(R.search).get("filter")??"",[R.search]),ue=o.useMemo(()=>new URLSearchParams(R.search).get("mcp")??void 0,[R.search]),fe=o.useMemo(()=>new URLSearchParams(R.search).get("provider"),[R.search]),oe=o.useCallback(C=>{$(C),q(!0);const H=O[C],P=y.current;if(H?.current&&P){const Y=H.current.getBoundingClientRect().top-P.getBoundingClientRect().top;P.scrollHeight>P.clientHeight?P.scrollTo({top:Math.max(0,P.scrollTop+Y-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,H.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout(E.current??void 0),E.current=setTimeout(()=>{q(!1),E.current=null},800)}else q(!1)},[O]);o.useEffect(()=>{const C=setTimeout(()=>{const H=y.current;if(!H)return;const P=()=>{if(U)return;const ce=H.getBoundingClientRect(),Y=ce.height;let ee="",te=0;for(const[c,p]of Object.entries(O))if(p.current){const b=p.current.getBoundingClientRect(),j=ce.top,L=b.top-j,I=b.bottom-j,me=b.height,Ne=Math.max(0,L),Ut=Math.min(Y,I),Ve=Math.max(0,Ut-Ne)/me,Ge=Ve+(L<Y*.3?.1:0);Ge>te&&Ve>.1&&(te=Ge,ee=c)}ee&&ee!==F&&$(ee)};return P(),H.addEventListener("scroll",P,{passive:!0}),()=>{H.removeEventListener("scroll",P),clearTimeout(E.current??void 0)}},100);return()=>clearTimeout(C)},[O,F,U]),o.useEffect(()=>{const C=new URLSearchParams(R.search),H=C.get("section"),P=C.get("setting")?"backend":H,ce=P?O[P]:void 0;if(!P||!ce)return;let Y=!1,ee=Number.NaN,te=0;const c=window.setTimeout(()=>{Y||(Y=!0,b.disconnect(),oe(P))},2e3),p=()=>{if(Y)return;const j=ce.current;if(!j){te=requestAnimationFrame(p);return}const L=Math.round(j.getBoundingClientRect().top+window.scrollY);if(L===ee&&L>0){Y=!0,b.disconnect(),window.clearTimeout(c),oe(P);return}ee=L,te=requestAnimationFrame(p)},b=new ResizeObserver(()=>{Y||(cancelAnimationFrame(te),te=requestAnimationFrame(p))});return y.current&&b.observe(y.current),te=requestAnimationFrame(p),()=>{Y=!0,cancelAnimationFrame(te),b.disconnect(),window.clearTimeout(c)}},[R.search,O,oe]);const ae=async(C,H)=>{g(C);try{await h.mutateAsync({[C]:H}),await d()}catch(P){console.error(`Error updating ${C}:`,P)}finally{g(null)}},je=n,se=S==="checking",ie=zt(S),ke=S==="ready"||S==="checking"||M,we=Mr(je,4e3);return i?e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(G,{variant:"warning",className:"w-full max-w-xl",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:m}),u&&e.jsx(_,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void d(),disabled:r,children:r?"Retrying":"Retry"})]})})}):je?e.jsxs("div",{role:"status",className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-canvas",children:[e.jsx(J,{size:"lg",label:we?void 0:"Loading settings"}),we&&e.jsx("p",{className:"max-w-sm text-center text-body-sm text-ink-muted",children:"The Local Operator server is taking longer than usual to answer. If it does not respond, you will be able to retry from here."})]}):a?e.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-canvas",children:[e.jsx("div",{className:"w-12 shrink-0 overflow-y-auto border-r border-hairline min-[1040px]:w-55",children:e.jsx(Oa,{activeSection:F,onSelectSection:oe,sections:Pa})}),e.jsx("div",{ref:y,"data-settings-content":!0,"data-tour-tag":"settings-general-section",className:"flex-1 overflow-y-auto overflow-x-hidden p-4 sm:p-6 md:p-8",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-8 pb-8",children:[e.jsx(Wa,{title:"Settings",icon:Qe}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsxs("div",{ref:O.general,className:"flex flex-col gap-8",children:[e.jsxs(V,{title:"User profile",icon:Ua,description:`Your user profile information displayed in the application. This information is not provided to the agents. ${w?"These details are provided through your Radient account.":""}`,children:[se&&e.jsx("p",{className:"text-meta text-ink-dim",children:"Checking your Radient account…"}),ie&&e.jsx(G,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{children:["Your Radient account could not be read, so the name and email below are placeholders rather than your account details.",S==="refused"?" Retry, or sign in to Radient again.":" Retry."]}),e.jsx(_,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>z(),disabled:T,children:T?"Retrying":"Retry"})]})}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(We,{value:f.profile.name,label:"Display name",placeholder:"Enter your name...",isSaving:x==="user_name",onSave:async C=>{g("user_name");try{f.updateName(C)}finally{g(null)}},readOnly:ke}),e.jsx(We,{value:f.profile.email,label:"Email address",placeholder:"Enter your email...",isSaving:x==="user_email",onSave:async C=>{g("user_email");try{f.updateEmail(C)}finally{g(null)}},readOnly:ke})]})]}),e.jsx(V,{title:"Application tour",description:"Missed the application onboarding tour or want a refresher? Start it again here.",children:e.jsxs(_,{variant:"secondary",onClick:()=>{D({forceModalCompleted:!0})},children:[e.jsx(bs,{}),"Take the tour"]})}),e.jsx(V,{title:"Model settings",icon:qa,description:"Configure the default AI model and hosting providers used for generating responses. This will be used for all agents that don't have a specific model or hosting provider configured. You can override these settings for individual agents in the agent settings.",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Ha,{value:a.values.hosting,isSaving:x==="hosting",onSave:C=>ae("hosting",C),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:"No hosting providers available. Add one in API credentials, in the list on the left."}),e.jsx(Ba,{value:a.values.model_name,hostingId:a.values.hosting,isSaving:x==="model_name",onSave:C=>ae("model_name",C),allowCustom:!0,allowDefault:!1}),e.jsx(G,{variant:"neutral",icon:e.jsx(Fe,{className:"size-4","aria-hidden":"true"}),children:"You need a Radient account or your own API keys to reach cloud providers. If you don't see more hosting providers and models here, add credentials or sign in to Radient."})]})}),e.jsx(Mo,{}),e.jsx(V,{title:"History settings",icon:as,description:"Configure how much conversation history is retained and displayed. These are tools to help balance cost and performance by controlling the amount of data used by the agents.",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Le,{value:a.values.conversation_length,label:"Maximum conversation history",description:"Number of messages to keep in conversation history for context. More messages will make the agents have longer memory but more expensive to run. Recommended: 100",min:10,max:500,step:10,unit:"msgs",icon:Va,isSaving:x==="conversation_length",onChange:C=>ae("conversation_length",C)}),e.jsx(Le,{value:a.values.detail_length,label:"Detail view length",description:"Maximum number of messages to show in the detailed conversation view. Messages beyond this limit will be summarized. Shortening this will decrease costs but some important details could get lost from earlier messages. Recommended: 15",min:10,max:500,step:5,unit:"msgs",icon:Ga,isSaving:x==="detail_length",onChange:C=>ae("detail_length",C)}),e.jsx(Le,{value:a.values.max_learnings_history,label:"Maximum learnings history",description:"Agents note down specific insights and key learnings in memory which persist beyond the maximum conversation history and summarization. This setting controls the maximum number of learning items to retain. More items will make the agents acquire a longer history of knowledge from your conversations but more expensive to run. Recommended: 50",min:10,max:200,step:10,unit:"notes",icon:Ka,isSaving:x==="max_learnings_history",onChange:C=>ae("max_learnings_history",C)})]})}),e.jsx(V,{title:"Configuration information",icon:Fe,description:"System information about the current configuration.",children:e.jsxs(He,{children:[e.jsx(Z,{label:"Version",value:e.jsx("span",{className:"text-mono-sm",children:a.version})}),e.jsx(Z,{label:"Created",value:It(a.metadata.created_at)}),e.jsx(Z,{label:"Last modified",value:Ft(a.metadata.last_modified)}),e.jsx(Z,{label:"Description",value:a.metadata.description||"No description available"})]})})]}),e.jsx(V,{title:"Appearance",icon:$t,description:"Customize the look and feel of Local Operator",sectionRef:O.appearance,dataTourTag:"settings-appearance-section",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx($o,{}),e.jsx(wr,{value:t,label:"Show agent reasoning",description:"Adds the agent's Reasoning and Thinking rows to conversations. They stay closed until you open one.",onChange:async C=>s(C)})]})}),e.jsx(V,{title:"Radient account",titleComponent:e.jsx(Uo,{}),description:"Manage your Radient account, Radient Pass details, and credits.",sectionRef:O.radient,dataTourTag:"settings-radient-account-section",children:e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsx(So,{onAfterCredentialUpdate:()=>{X(),K()}}),w&&e.jsxs(e.Fragment,{children:[e.jsx(Do,{}),e.jsx(Po,{})]})]})}),e.jsx(V,{title:"Providers",icon:Tt,description:"Model providers, how you sign in to each, and which are connected.",sectionRef:O.providers,children:e.jsx(Ya,{initialProviderId:fe})}),e.jsx(V,{title:"Backend settings",icon:Qe,description:"Every setting the backend registry owns, searchable, with typed editors and scopes.",sectionRef:O.backend,children:e.jsx(xo,{focusKey:re,initialFilter:Q})}),e.jsx(_o,{sessionId:N??void 0,sectionRef:O.integrations,highlightServer:ue}),e.jsx(V,{title:"API credentials",icon:Re,description:"Manage your API keys for various services and integrations",sectionRef:O.credentials,dataTourTag:"settings-api-credentials-section",children:e.jsx(yo,{})}),e.jsx("div",{ref:O.updates,children:e.jsx(Lr,{})})]})]})})]}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(G,{variant:"warning",className:"w-full max-w-xl",children:"Your settings could not be loaded."})})};export{Yo as SettingsPage};
311
+ `).map(f=>f.trim()).filter(Boolean)}),"aria-label":`${t.label}: ${h}`,className:"font-mono text-body-sm"})]},h)),e.jsx("p",{className:"text-meta text-ink-dim",children:"One hop per line, as provider/model (effort). An empty chain moves to the next provider."})]})}default:return e.jsx(ne,{value:s,disabled:n,onChange:u=>r(u.target.value),"aria-label":t.label,placeholder:t.placeholder})}},Pt=({className:t})=>e.jsx("span",{role:"img","aria-label":"Changed from the default",title:"Changed from the default",className:W("size-1.5 shrink-0 rounded-full bg-accent",t)}),oo=({title:t,rowCount:s,advancedCount:a,scope:n,modified:r,onOpenChange:i,defaultOpen:d=!1})=>e.jsx("div",{"data-section-header":t,className:"flex w-full flex-col",children:e.jsx(yt,{defaultOpen:d,onOpenChange:i,triggerClassName:"text-ink hover:bg-row-hover hover:text-ink",chevronClassName:"text-ink-dim",rowClassName:"min-h-10 py-0",className:"w-full",summary:e.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate text-heading text-ink",children:t}),s>0&&e.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:s===1?"1 setting":`${s} settings`}),n&&e.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:n}),a>0&&e.jsxs("span",{className:"shrink-0 text-meta text-ink-dim",children:[a," advanced"]})]}),r&&e.jsx(Pt,{className:"ml-auto"})]})})}),io="size-3.5 shrink-0",co=({setting:t,draft:s,tier:a,gate:n,saving:r,error:i,onDraftChange:d,onSave:l,onReset:m,effectiveHosting:u=""})=>{const h=!!(n&&!n.on),x=Ce(t,s),g=r||h,f=t.kind==="list"||t.kind==="cascade",w=e.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("span",{className:"truncate text-body-sm text-ink",children:t.label}),t.kind==="readonly"&&e.jsx("span",{className:"text-meta text-ink-dim",children:"Read-only"}),t.warning&&e.jsx("span",{className:"text-meta text-danger",children:t.warning})]}),S=h&&n&&e.jsxs("p",{className:"text-meta text-ink-dim",children:["Needs ",n.label," on. Nothing here is saved while it is off."]});return e.jsx("div",{"data-setting-key":t.key,"data-tier":a,className:"border-b border-hairline",children:e.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-1 px-1 py-2.5",children:[e.jsxs("div",{className:W("flex min-w-44 flex-col gap-0.5",f?"shrink-0 basis-2/5":"flex-1"),children:[a==="advanced"&&t.help?e.jsx(yt,{summary:w,triggerClassName:"min-h-5 py-0 px-0 text-body-sm text-ink hover:text-ink",chevronClassName:"text-ink-dim",summaryAlign:"firstLine",rowClassName:"min-h-5 py-0",className:"w-full",children:e.jsx("span",{className:"text-meta text-ink-dim",children:t.help})}):e.jsxs("span",{className:"flex min-h-5 items-center gap-1.5",children:[e.jsx("span",{"aria-hidden":!0,className:io}),w]}),a==="core"&&t.help&&e.jsx("p",{id:tt(t.key),className:"ml-5 text-meta text-ink-dim",children:t.help}),S]}),e.jsxs("div",{className:W("flex shrink-0 items-center gap-2 self-center",f&&"min-w-0 flex-1 items-start"),children:[(!t.is_default||x)&&e.jsx(Pt,{}),!t.is_default&&t.kind!=="readonly"&&e.jsxs(_,{variant:"ghost",size:"sm",disabled:g,onClick:m,"aria-label":`Use default for ${t.label}`,children:[e.jsx(dr,{"aria-hidden":"true"}),"Use default"]}),x&&e.jsx(_,{variant:"primary",size:"sm",disabled:g,onClick:l,children:r?"Saving":"Save"}),e.jsx("div",{className:Xr(t.kind),"data-setting-control":"",children:t.redacted?e.jsx("span",{className:"text-meta text-ink-dim",children:"Set in the credential manager: this value carries inline credentials or query parameters."}):t.kind==="readonly"?e.jsx("span",{className:"text-body-sm text-ink-muted",children:ye(t.value)||"Not set"}):e.jsx(ro,{setting:t,value:s.value,chains:s.cascadeBase??void 0,disabled:g,effectiveHosting:u,helpId:a==="core"&&t.help?tt(t.key):void 0,onValueChange:M=>d({...s,value:M}),onChainsChange:M=>d({...s,cascadeBase:M})})})]}),i&&e.jsx(G,{variant:"danger",role:"alert",className:"w-full",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:i}),e.jsxs(_,{variant:"secondary",size:"sm",disabled:r,onClick:l,children:[e.jsx(na,{"aria-hidden":"true"}),"Retry"]})]})})]})})},lo="w-full max-w-[400px]",uo=({query:t,onQueryChange:s,matchCount:a,matchSections:n,coreCount:r,advancedCount:i,modifiedCount:d,modifiedOnly:l,onModifiedOnlyChange:m,showAdvanced:u,onShowAdvancedChange:h,onExpandAll:x,onCollapseAll:g,unsavedCount:f,savingAll:w,onSaveAll:S,onDiscardAll:M})=>e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:W("relative",lo),children:[e.jsx(vt,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-ink-dim","aria-hidden":"true"}),e.jsx(ne,{value:t,onChange:T=>s(T.target.value),onKeyDown:T=>{T.key==="Escape"&&t&&s("")},placeholder:"Search settings by name, description or key","aria-label":"Search settings",className:"pl-9"}),t&&e.jsx(_,{variant:"ghost",size:"icon-sm",className:"absolute top-1/2 right-1 -translate-y-1/2",onClick:()=>s(""),"aria-label":"Clear search",children:e.jsx(Ga,{"aria-hidden":"true"})})]}),e.jsxs("fieldset",{className:"m-0 border-0 p-0",children:[e.jsx("legend",{className:"sr-only",children:"Settings filters"}),e.jsxs("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:[e.jsxs(_,{variant:"ghost",size:"sm","aria-pressed":l,onClick:()=>m(!l),className:W(l&&"bg-surface text-ink hover:bg-surface"),children:["Modified",e.jsx(Re,{variant:"neutral",children:d})]}),e.jsx(_,{variant:"ghost",size:"sm","aria-pressed":u,onClick:()=>h(!u),className:W(u&&"bg-surface text-ink hover:bg-surface"),children:"Show advanced"})]})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[f>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-meta text-ink-dim",children:f===1?"1 unsaved change":`${f} unsaved changes`}),e.jsx(_,{variant:"primary",size:"sm",disabled:w,onClick:S,children:w?"Saving":"Save all"}),e.jsx(_,{variant:"ghost",size:"sm",disabled:w,onClick:M,children:"Discard all"})]}),e.jsx(_,{variant:"ghost",size:"sm",onClick:x,children:"Expand all"}),e.jsx(_,{variant:"ghost",size:"sm",onClick:g,children:"Collapse all"})]})]}),e.jsx("p",{className:"text-meta text-ink-dim","aria-live":"polite",children:a!==null?`${a} ${a===1?"result":"results"} in ${n} ${n===1?"section":"sections"}`:l?`${d} modified ${d===1?"setting":"settings"}`:u?`${i} advanced settings shown — Expand all to see them`:`${r} core settings, ${i} advanced`})]}),mo={all:["desktop","settings"]},ho={live:"Takes effect immediately","new launch":"Takes effect the next time the app starts","new sessions":"Takes effect for new conversations"},po=40,xe=t=>t.toLowerCase().replace(/[-_.]/g," "),fo=({focusKey:t,initialFilter:s=""})=>{const a=qe(),n=Dt(),r=Me(a.data,"settings"),[i,d]=o.useState(s),[l,m]=o.useState(!1),[u,h]=o.useState(!1),[x,g]=o.useState({}),[f,w]=o.useState({}),[S,M]=o.useState({}),[T,z]=o.useState(!1),[N,F]=o.useState(new Set),[$,U]=o.useState(new Set),[q,E]=o.useState(new Set),y=o.useRef(null),D=o.useRef(null),R=ve({queryKey:mo.all,queryFn:()=>ge({op:"settings.list"}),enabled:r,staleTime:1e4}),A=R.data;o.useEffect(()=>{A&&g(c=>{let p=!1;const b={...c};for(const j of A.settings){const L=c[j.key];if(!L){b[j.key]=le(j),p=!0;continue}if(Ce(j,L))continue;const I=le(j);(I.value!==L.value||I.cascadeBase!==L.cascadeBase)&&(b[j.key]=I,p=!0)}return p?b:c})},[A]);const K=o.useCallback(c=>!c.is_default||Ce(c,x[c.key]??le(c)),[x]),X=o.useMemo(()=>{const c=(A?.settings??[]).find(p=>p.key==="hosting");return c?(x.hosting??le(c)).value:""},[A,x]),B=o.useMemo(()=>{if(!A)return[];const c=xe(i.trim()),p=c.length>0||u;return A.settings.filter(b=>!p&&pe(b)==="advanced"&&!l||u&&!K(b)?!1:c?xe([b.label,b.help,b.key,b.section,b.warning??""].join(" ")).includes(c):!0)},[A,i,l,u,K]),k=i.trim().length>0||u,O=o.useMemo(()=>A?.sections??[],[A]),re=o.useCallback(c=>(A?.settings??[]).filter(p=>p.section===c),[A]),Q=c=>B.filter(p=>p.section===c),ue=c=>N.has(c)?!0:$.has(c)?!1:zr(re(c)),fe=(c,p)=>{F(b=>{const j=new Set(b);return p?j.add(c):j.delete(c),j}),U(b=>{const j=new Set(b);return p?j.delete(c):j.add(c),j})},oe=(c,p)=>{E(b=>{const j=new Set(b);return p?j.delete(c):j.add(c),j})},ae=c=>{const p=O.filter(j=>c||Q(j.name).length>0).map(j=>j.name),b=Fr(c,k,p);b.layout&&(F(new Set(b.layout.opened)),U(new Set(b.layout.closed))),E(new Set(b.filter))};o.useEffect(()=>{i.trim()||E(new Set)},[i]);const je=o.useCallback(c=>{const p=c.gated_by;if(!p||!A)return null;const b=A.settings.find(j=>j.key===p);return{key:p,label:b?.label??p,on:b?.value===!0||b?.value==="true"}},[A]),se=o.useCallback((c,p)=>w(b=>({...b,[c]:p})),[]),ie=o.useCallback((c,p)=>M(b=>({...b,[c]:p})),[]),ke=o.useCallback(async c=>{const p=x[c.key];if(!p)return!1;const b=$r(c,p);if(!b.ok)return ie(c.key,b.error),!1;se(c.key,!0),ie(c.key,null);try{await ge(b.request),se(c.key,!1);const L=(await R.refetch()).data?.settings.find(I=>I.key===c.key);return L&&g(I=>{const me=I[c.key];return me&&me.value===p.value&&me.cascadeBase===p.cascadeBase?{...I,[c.key]:le(L)}:I}),!0}catch(j){return se(c.key,!1),ie(c.key,j instanceof Error?j.message:"The setting could not be saved."),!1}},[x,R,se,ie]),we=o.useCallback(async c=>{se(c.key,!0),ie(c.key,null);try{await ge({op:"settings.reset",key:c.key}),g(p=>({...p,[c.key]:le({...c,value:c.default,is_default:!0})})),se(c.key,!1),await R.refetch()}catch(p){se(c.key,!1),ie(c.key,p instanceof Error?p.message:"The setting could not be reset.")}},[R,se,ie]),C=o.useMemo(()=>(A?.settings??[]).filter(c=>Ce(c,x[c.key]??le(c))),[A,x]),H=async()=>{z(!0);for(const c of C)await ke(c);z(!1)},P=()=>{A&&(g(c=>{const p={...c};for(const b of A.settings)p[b.key]=le(b);return p}),M({}))};o.useEffect(()=>{if(!t||!A||y.current===t)return;const c=A.settings.find(j=>j.key===t);if(!c)return;y.current=t,pe(c)==="advanced"&&m(!0);const p=xe(i.trim());!p||xe([c.label,c.help,c.key,c.section].join(" ")).includes(p)||d(""),h(!1),F(j=>new Set(j).add(c.section)),U(j=>{const L=new Set(j);return L.delete(c.section),L})},[t,A,i]);const ce=o.useMemo(()=>{if(!t||!A)return!1;const c=A.settings.find(b=>b.key===t);if(!c||pe(c)==="advanced"&&!l)return!1;const p=xe(i.trim());return p?xe([c.label,c.help,c.key,c.section].join(" ")).includes(p):!0},[t,A,i,l]);if(o.useEffect(()=>{if(!ce||!t||D.current===t)return;let c=0,p=0;const b=()=>{const j=document.querySelector(`[data-setting-key="${CSS.escape(t)}"]`),L=j?.querySelector('[data-setting-control] :is(input, textarea, select, button[role="switch"], button)')??j;if(L){L===j&&(L.tabIndex=-1),L.focus(),L.scrollIntoView({block:"center"}),D.current=t;return}p+=1,p<po&&(c=requestAnimationFrame(b))};return c=requestAnimationFrame(b),()=>cancelAnimationFrame(c)},[ce,t]),a.data&&!r)return e.jsx(G,{variant:"warning",children:"Searchable settings need a newer Local Operator server. Update the server and restart the app to manage these settings here."});if(R.isLoading||a.isLoading)return e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading settings"})});const Y=(a.data?null:a.error)??R.error;if(Y||!A){const c=a.isFetching||R.isFetching,{sentence:p,remedy:b}=kt(n,"Your settings could not be loaded.",Y);return e.jsx(G,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:p}),b&&e.jsx(_,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{a.isError?a.refetch():R.refetch()},disabled:c,children:c?"Retrying":"Retry"})]})})}const ee=A.settings.reduce((c,p)=>(c[pe(p)]+=1,c),{core:0,advanced:0}),te=new Set(B.map(c=>c.section)).size;return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(uo,{query:i,onQueryChange:d,matchCount:i.trim()?B.length:null,matchSections:te,coreCount:ee.core,advancedCount:ee.advanced,modifiedCount:A.settings.filter(K).length,modifiedOnly:u,onModifiedOnlyChange:h,showAdvanced:l,onShowAdvancedChange:m,onExpandAll:()=>ae(!0),onCollapseAll:()=>ae(!1),unsavedCount:C.length,savingAll:T,onSaveAll:()=>void H(),onDiscardAll:P}),k&&B.length===0&&e.jsx("div",{className:"flex flex-col items-center py-6 text-center",children:e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No settings match this search. Clear the search field to see every setting again."})}),e.jsx("div",{className:"flex flex-col gap-1",children:O.map(c=>{const p=Q(c.name),b=re(c.name),j=k?0:b.filter(I=>pe(I)==="advanced").length;if(k&&p.length===0)return null;const L=k?p.length>0&&!q.has(c.name):ue(c.name);return e.jsxs("section",{"data-settings-section":c.name,"data-open":L,className:"flex flex-col",children:[e.jsx(oo,{title:c.title,rowCount:p.length,advancedCount:j,scope:ho[c.scope],modified:b.some(K),defaultOpen:L,onOpenChange:I=>k?oe(c.name,I):fe(c.name,I)},`${c.name}:${L?"open":"closed"}`),e.jsxs("div",{hidden:!L,className:"flex flex-col pb-3",children:[c.description&&e.jsx("p",{className:"px-1 pb-1 text-meta text-ink-dim",children:c.description}),p.length===0?e.jsxs("div",{className:"flex items-center gap-2 px-1 py-2",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:j>0?"Advanced settings are hidden here.":"Nothing in this section matches."}),j>0&&e.jsxs(_,{variant:"secondary",size:"sm",onClick:()=>m(!0),children:["Show ",j," advanced"]})]}):p.map(I=>e.jsx(co,{setting:I,draft:x[I.key]??le(I),tier:pe(I),gate:je(I),effectiveHosting:X,saving:!!f[I.key],error:S[I.key]??null,onDraftChange:me=>g(Ne=>({...Ne,[I.key]:me})),onSave:()=>void ke(I),onReset:()=>void we(I)},I.key))]})]},c.name)})})]})},st=({credentialKey:t,isConfigured:s=!1,onEdit:a,onClear:n,onAdd:r})=>{const i=ra(t),d=s?oa:Ae;return e.jsxs("div",{className:"flex flex-col rounded-md p-3 transition-colors duration-fast ease-out-quart hover:bg-elevated",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-body font-medium text-ink",children:[e.jsx(d,{className:"size-3.5 shrink-0 text-ink-dim"}),i.name]}),e.jsx("p",{className:"mt-1 break-all text-mono-sm text-ink-dim",children:t}),e.jsx("p",{className:"mt-2 text-body-sm text-ink-muted",children:i.description})]}),e.jsx("div",{className:"mt-auto flex flex-wrap items-center justify-end gap-2 pt-4",children:s?e.jsxs(e.Fragment,{children:[e.jsxs(_,{variant:"ghost",size:"sm",onClick:()=>a?.(t),children:[e.jsx(ia,{}),"Update"]}),e.jsxs(_,{variant:"ghost",size:"sm",className:"text-danger hover:bg-danger-wash hover:text-danger",onClick:()=>n?.(t),children:[e.jsx(bt,{}),"Clear"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(_,{variant:"outline",size:"sm",onClick:()=>r?.(t),children:[e.jsx(Ae,{}),"Configure"]}),i.url&&e.jsx(Ee,{content:`Get your ${i.name} key`,children:e.jsx(_,{variant:"ghost",size:"icon-sm",asChild:!0,children:e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer","aria-label":`Get your ${i.name} key`,children:e.jsx(jt,{})})})})]})})]})},ze="_custom_",nt="credential-custom-key",rt="credential-custom-key-error",ot="credential-type",it="credential-type-help",ct="credential-value",lt="credential-value-help",dt=({open:t,onClose:s,onSave:a,initialKey:n="",existingKeys:r,isSaving:i,isEditMode:d})=>{const[l,m]=o.useState(n),[u,h]=o.useState(""),[x,g]=o.useState(""),[f,w]=o.useState(!1);o.useEffect(()=>{if(t){const y=be.some(R=>R.key===n),D=!d&&n&&!y;m(y?n:""),h(""),g(D?n:""),w(D||d&&!y)}},[t,n,d]);const S=()=>{let y="";if(d?y=n:y=f?x.trim():l,!y){console.error("No key provided for credential");return}if(!u.trim()){console.error("No value provided for credential");return}a({key:y,value:u})},M=y=>r.includes(y)&&y!==n,T=M(x),z=d?!0:f?x.trim()!==""&&!T:l!==""&&!M(l),N=u.trim()!=="",F=z&&N&&!i,$=be.find(y=>y.key===l),U=!!$&&!f,q=d?"Update credential":"Add new credential",E=e.jsxs(e.Fragment,{children:[e.jsx(_,{variant:"secondary",onClick:s,children:"Cancel"}),e.jsxs(_,{variant:"primary",onClick:S,disabled:!F,children:[i&&e.jsx(J,{size:"sm",className:"border-t-on-accent"}),i?"Saving...":"Save"]})]});return e.jsx(ca,{open:t,onClose:s,title:q,actions:E,maxWidth:"sm",fullWidth:!0,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[d?e.jsx(Z,{label:"Credential key",value:e.jsx("span",{className:"text-mono-sm",children:n})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(de,{htmlFor:ot,children:"Credential type"}),e.jsxs(Rt,{value:f?ze:l,onValueChange:y=>{y===ze?(w(!0),m("")):(w(!1),m(y),g(""))},children:[e.jsx(Tt,{id:ot,"aria-describedby":U?it:void 0,children:e.jsx(Lt,{placeholder:"Select a credential type"})}),e.jsxs(It,{children:[be.filter(y=>!y.internal).map(y=>e.jsxs(De,{value:y.key,disabled:M(y.key),children:[y.name,M(y.key)&&" (configured)"]},y.key)),e.jsx(De,{value:ze,children:"Custom credential"})]})]}),U&&$&&e.jsxs("div",{id:it,className:"flex flex-col items-start gap-1",children:[e.jsx("p",{className:"text-meta text-ink-dim",children:$.description}),$.url&&e.jsxs("a",{href:$.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent text-meta underline-offset-4 hover:text-accent-hover hover:underline",children:["Get your ",$.name," key"]})]})]}),f&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(de,{htmlFor:nt,children:"Custom credential key"}),e.jsx(ne,{id:nt,value:x,onChange:y=>g(y.target.value),"aria-invalid":T||void 0,"aria-describedby":T?rt:void 0,required:!0,autoFocus:!0}),T&&e.jsx("p",{id:rt,className:"text-danger text-meta",children:"This credential already exists"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(de,{htmlFor:ct,children:"Credential value"}),e.jsx(ne,{id:ct,type:"password",value:u,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&F&&S()},"aria-describedby":d?lt:void 0,required:!0,autoFocus:d,placeholder:"Enter the credential value or API key"}),d&&e.jsxs("p",{id:lt,className:"text-ink-dim text-meta",children:["Enter the new value for ",n]})]})]})})},ut=({title:t,description:s,children:a,isEmpty:n=!1,emptyStateType:r="noCredentials"})=>e.jsxs("section",{children:[e.jsx("h3",{className:"text-body font-medium text-ink",children:t}),e.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:s}),e.jsx(Ka,{variant:"surface",padding:"sm",className:"mt-3",children:n?e.jsx(xo,{type:r}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(260px,1fr))] gap-2",children:a})})]}),xo=({type:t,className:s})=>{const a=t==="noCredentials",n=a?Ae:zt;return e.jsxs("div",{className:W("flex flex-col items-center px-4 py-8 text-center",s),children:[e.jsx(n,{size:20,className:"text-ink-dim","aria-hidden":!0}),e.jsx("p",{className:"mt-3 text-body font-medium text-ink",children:a?"No credentials configured":"All available credentials configured"}),e.jsx("p",{className:"mt-1 max-w-sm text-body-sm text-ink-muted",children:a?"You haven't set up any API credentials yet. Add credentials from the available options or add a custom one.":"You've configured all the common API credentials. You can still add custom credentials if needed."})]})},go=()=>{const{data:t,isLoading:s,error:a,refetch:n}=wt(),r=la(),[i,d]=o.useState(!1),[l,m]=o.useState(!1),[u,h]=o.useState(null),x=N=>{h(N),d(!0)},g=(N=null)=>{h(N),m(!0)},f=()=>{d(!1),m(!1),h(null)},w=async N=>{try{await r.mutateAsync(N),f(),await n()}catch(F){console.error("Error saving credential:",F)}},S=async N=>{try{await r.mutateAsync({key:N,value:""}),await n()}catch(F){console.error("Error clearing credential:",F)}},M=o.useMemo(()=>t?.keys?.filter(N=>!be.find(F=>F.key===N)?.internal)??[],[t]),T=o.useMemo(()=>be.filter(N=>!M.includes(N.key)&&!N.internal),[M]),z=()=>s?e.jsx("div",{className:"flex min-h-40 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading credentials"})}):a||!t?e.jsxs(G,{variant:"danger",role:"alert",children:[e.jsx(Ya,{children:"Could not load credentials"}),e.jsx(Za,{children:a instanceof Error?a.message:"The server did not say why. Check that Local Operator is running, then reopen this page."})]}):e.jsxs(e.Fragment,{children:[e.jsx(ut,{title:"Configured credentials",description:"These API credentials are currently configured and available for use.",isEmpty:M.length===0,emptyStateType:"noCredentials",children:M.map(N=>e.jsx(st,{credentialKey:N,isConfigured:!0,onEdit:x,onClear:S},N))}),e.jsx(ut,{title:"Available credentials",description:"These are common API credentials you can configure to enhance functionality.",isEmpty:T.length===0,emptyStateType:"allConfigured",children:T.map(N=>e.jsx(st,{credentialKey:N.key,isConfigured:!1,onAdd:()=>g(N.key)},N.key))}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(_,{variant:"secondary",size:"sm",onClick:()=>g(null),children:[e.jsx(da,{}),"Add custom credential"]})}),i&&e.jsx(dt,{open:i,onClose:f,onSave:w,initialKey:u||"",existingKeys:M,isSaving:r.isPending,isEditMode:!0}),l&&e.jsx(dt,{open:l,onClose:f,onSave:w,initialKey:u||"",existingKeys:M,isSaving:r.isPending,isEditMode:!1})]});return e.jsx("div",{className:"flex flex-col gap-6",children:z()})},yo=[[[".claude.json"],"Claude Code"],[[".claude",".mcp.json"],"Claude Code"],[[".cursor","mcp.json"],"Cursor"],[[".vscode","mcp.json"],"VS Code"],[[".codex","config.toml"],"Codex CLI"]];function vo(t){if(!t)return null;const s=t.split("\\").join("/").split("/").filter(Boolean);for(const[a,n]of yo)if(!(s.length<a.length)&&s.slice(-a.length).join("/")===a.join("/"))return n;return null}const ko={list:"status",add:"add",remove:"remove",reload:"reload",connect:"reconnect",probe:"probe",disconnect:"disconnect",login:"grant",logout:"disconnect",reauth:"grant",status:"status",cancel:"cancel"},bo=(t,s)=>{const a=t?.trim();if(!a)return null;const n=ga(a,s);return n.kind==="auth"?{kind:"matched",name:n.name,unresolved:null}:{kind:"miss",asked:a}},jo=t=>t.reduce((s,a)=>s?(a.updated_at??0)>(s.updated_at??0)?a:s:a,null),wo=({sessionId:t,onAdded:s})=>{const[a,n]=o.useState(""),[r,i]=o.useState("command"),[d,l]=o.useState(""),[m,u]=o.useState(""),[h,x]=o.useState(""),[g,f]=o.useState("global"),[w,S]=o.useState(null),[M,T]=o.useState(!1),z=async()=>{T(!0),S(null);try{await ge({op:"mcp.control",sessionId:t,control:{action:"add",name:a,scope:g,...r==="command"?{command:d,args:m.split(`
312
+ `).map(N=>N.trim()).filter(Boolean)}:{url:h}}}),n(""),l(""),u(""),x(""),s()}catch(N){S(Nt("add",N,!1))}finally{T(!1)}};return e.jsxs("form",{className:"flex flex-col gap-3 rounded-md border border-control bg-surface p-4",onSubmit:N=>{N.preventDefault(),z()},children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(de,{htmlFor:"mcp-add-name",children:"Name"}),e.jsx(ne,{id:"mcp-add-name",value:a,onChange:N=>n(N.target.value),required:!0})]}),e.jsxs("fieldset",{className:"flex gap-2",children:[e.jsx("legend",{className:"sr-only",children:"Server transport"}),e.jsx(_,{type:"button",variant:r==="command"?"secondary":"ghost",size:"sm",onClick:()=>i("command"),children:"Local command"}),e.jsx(_,{type:"button",variant:r==="url"?"secondary":"ghost",size:"sm",onClick:()=>i("url"),children:"Remote URL"})]}),r==="command"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(de,{htmlFor:"mcp-add-command",children:"Command"}),e.jsx(ne,{id:"mcp-add-command",value:d,onChange:N=>l(N.target.value),className:"font-mono",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(de,{htmlFor:"mcp-add-args",children:"Arguments, one per line"}),e.jsx("textarea",{id:"mcp-add-args",value:m,onChange:N=>u(N.target.value),rows:2,className:"rounded-sm border border-control bg-surface p-2 font-mono text-body-sm text-ink"})]})]}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(de,{htmlFor:"mcp-add-url",children:"URL"}),e.jsx(ne,{id:"mcp-add-url",type:"url",value:h,onChange:N=>x(N.target.value),className:"font-mono",required:!0}),e.jsx("p",{className:"text-meta text-ink-dim",children:"No inline credentials or query parameters; secrets are referenced from the credential manager."})]}),e.jsxs("fieldset",{className:"flex gap-2",children:[e.jsx("legend",{className:"sr-only",children:"Configuration scope"}),e.jsx(_,{type:"button",variant:g==="global"?"secondary":"ghost",size:"sm",onClick:()=>f("global"),children:"Global"}),e.jsx(_,{type:"button",variant:g==="project"?"secondary":"ghost",size:"sm",onClick:()=>f("project"),children:"This project"})]}),w&&e.jsxs(G,{variant:"danger",children:[e.jsx("p",{children:w.message}),w.detail?e.jsx("p",{className:"font-mono text-ink-dim text-mono-sm",title:w.detail,children:w.detail}):null]}),e.jsx("div",{children:e.jsxs(_,{type:"submit",variant:"primary",size:"sm",disabled:M||!a||!(r==="command"?d:h),children:[M?e.jsx(J,{size:"sm"}):null,"Add server"]})})]})},No=({sessionId:t,sectionRef:s,highlightServer:a})=>{const n=qe(),r=Me(n.data,"mcp"),i=ft(),d=_e(k=>k.sessions),l=_e(k=>k.fetchSessions),m=_e(k=>k.loading),u=o.useMemo(()=>t?null:jo(d),[t,d]),h=t??u?.session_id,[x,g]=o.useState(null),[f,w]=o.useState(null),[S,M]=o.useState(!1),[T,z]=o.useState(null),N=ua({sessionId:h}),[F,$]=o.useState("");o.useEffect(()=>{t||!r||d.length>0||l()},[t,r,d.length,l]);const U=ve({queryKey:Te.list(h??""),queryFn:()=>{if(!h)throw new Error("No conversation selected.");return ya(h)},enabled:r&&!!h,staleTime:1e4}),q=ma(U.data),E=o.useMemo(()=>bo(a,q.map(k=>k.name)),[a,q]),y=E?.kind==="matched"?E.name:null,D=o.useRef(null),R=o.useRef(null),A=F.trim().toLowerCase(),K=o.useMemo(()=>A?q.filter(k=>k.name.toLowerCase().includes(A)):q,[q,A]);o.useEffect(()=>{!y||R.current===y||!F||$("")},[y,F]),o.useEffect(()=>{y&&R.current!==y&&K.some(k=>k.name===y)&&(R.current=y,D.current?.scrollIntoView({block:"center",behavior:"smooth"}))},[y,K]);const X=o.useCallback(()=>{h&&i.invalidateQueries({queryKey:Te.list(h)})},[i,h]),B=o.useCallback(async(k,O,re={})=>{if(h){w(null);try{await ge({op:"mcp.control",sessionId:h,control:{action:k,name:O,...re}}),X()}catch(Q){const ue=i.getQueryData(Te.list(h));w(Nt(ko[k],Q,ha(ue?.operations)))}}},[i,h,X]);return r?h?e.jsx(V,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts. A connected server is a working transport; the account behind it may still need its own sign-in.",sectionRef:s,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[f&&e.jsxs(G,{variant:"danger",children:[e.jsx("p",{children:f.message}),f.detail?e.jsx("p",{className:"font-mono text-ink-dim text-mono-sm",title:f.detail,children:f.detail}):null]}),u&&e.jsxs("p",{className:"text-body-sm text-ink-muted",children:["Showing MCP servers for"," ",u.title?.trim()||u.session_id.slice(0,6),", your most recent conversation. Open a conversation to see its own list."]}),U.isLoading&&e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading MCP servers"})}),U.isError&&e.jsx(G,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:"MCP servers could not be loaded."}),e.jsx(_,{variant:"secondary",size:"sm",onClick:()=>void U.refetch(),children:"Retry"})]})}),q.length>0&&e.jsxs("div",{className:"relative",children:[e.jsx(vt,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-ink-dim"}),e.jsx(ne,{value:F,onChange:k=>$(k.target.value),placeholder:"Search MCP servers","aria-label":"Search MCP servers",className:"pl-9"})]}),E?.kind==="miss"&&q.length>0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:`No MCP server matches "${E.asked}".`}),E?.kind==="matched"&&E.unresolved&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:`Showing "${E.name}" — "${E.unresolved}" is not one of your servers.`}),U.isSuccess&&q.length===0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No MCP servers configured yet. Add one below."}),q.length>0&&K.length===0&&e.jsxs("div",{className:"flex flex-col items-start gap-2",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No MCP servers match this search."}),e.jsx(_,{variant:"secondary",size:"sm",onClick:()=>$(""),children:"Clear search"})]}),K.length>0&&e.jsx("ul",{className:"flex flex-col gap-2",children:K.map(k=>{const O=k.status==="connected",re=k.name===y,Q=k.owned_scope,ue=k.transport==="http"&&k.transport_oauth_supported!==!1,fe=vo(k.source);return e.jsxs("li",{ref:re?D:void 0,className:W("flex flex-col gap-2 rounded-md border border-control bg-surface p-3",re&&"border-accent bg-elevated"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-body text-ink",children:k.name}),Q&&e.jsx(Re,{variant:"outline",children:Q==="project"?"This project":"Global"}),k.transport&&e.jsx("span",{className:"text-meta text-ink-dim",children:k.transport})]}),e.jsx(Re,{variant:O?"success":k.status==="connecting"?"info":k.status==="auth-required"?"warning":"neutral",children:k.status??"unknown"})]}),typeof k.tool_count=="number"&&e.jsxs("p",{className:"text-meta text-ink-dim",children:[k.tool_count," tools available"]}),k.status==="auth-required"&&!ue&&e.jsx("p",{className:"text-meta text-ink-dim",children:k.setup?.text?"This server needs credentials local-operator cannot collect. Copy the setup prompt to have an agent walk you through it.":"This server needs credentials local-operator cannot collect."}),!Q&&e.jsxs("p",{className:"text-meta text-ink-dim",children:[fe?`Imported from ${fe}.`:"Imported from a configuration local-operator does not write."," ",k.source?e.jsxs(e.Fragment,{children:["Remove it in"," ",e.jsx("span",{className:"font-mono text-mono-sm text-ink-dim",children:pa(k.source)}),"."]}):e.jsx(e.Fragment,{children:"Remove it wherever it is defined."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[O?e.jsxs(_,{variant:"secondary",size:"sm",onClick:()=>{g(null),B("disconnect",k.name,{confirmed:!0})},children:[e.jsx(_t,{"aria-hidden":"true"}),"Disconnect"]}):e.jsxs(_,{variant:"secondary",size:"sm",onClick:()=>void B("connect",k.name),children:[e.jsx(En,{"aria-hidden":"true"}),"Connect"]}),e.jsxs(_,{variant:"ghost",size:"sm",onClick:()=>void B("reload",k.name),children:[e.jsx(Qa,{"aria-hidden":"true"}),"Reload"]}),e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>{const oe=fa(U.data?.servers??[]).find(ae=>ae.name===k.name);oe&&z({row:oe,sessionId:h})},children:"Sign in"}),k.setup?.text?e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>{navigator.clipboard.writeText(k.setup?.text??"").catch(()=>{})},children:"Copy setup prompt"}):null,Q?x===k.name?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-body-sm text-ink",children:["Remove ",k.name,"?"]}),e.jsx(_,{variant:"danger",size:"sm",onClick:()=>{g(null),B("remove",k.name,{confirmed:!0,scope:Q})},children:"Confirm removal"}),e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>g(null),children:"Keep"})]}):e.jsxs(_,{variant:"ghost",size:"sm",className:"text-danger",onClick:()=>g(k.name),children:[e.jsx(bt,{"aria-hidden":"true"}),"Remove"]}):null]})]},k.name)})}),T?.sessionId===h?e.jsx(xa,{row:T.row,remedy:N,onClose:()=>z(null)},h):null,S?e.jsx(wo,{sessionId:h,onAdded:()=>{M(!1),X()}}):e.jsx("div",{children:e.jsx(_,{variant:"secondary",size:"sm",onClick:()=>M(!0),"data-tour-tag":"mcp-add-server",children:"Add server"})})]})}):e.jsx(V,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts.",sectionRef:s,children:m?e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading MCP servers"})}):e.jsx("p",{className:"text-body-sm text-ink-muted",children:"Open a conversation to manage its MCP servers."})}):e.jsx(V,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts.",sectionRef:s,children:e.jsx(G,{variant:"warning",children:"Integration management needs a newer Local Operator backend. Update the backend and restart the app to manage MCP servers here."})})},_o=({onAfterCredentialUpdate:t})=>{const{isAuthenticated:s,user:a,isLoading:n,accountRead:r,signOut:i}=va(),d=St(x=>x.isSigningOut),l=o.useCallback(async()=>{try{await i()}catch(x){console.error("Error signing out:",x)}},[i]),m=o.useMemo(()=>{if(!s||!a?.radientUser)return null;const{account:x,identity:g}=a.radientUser;return e.jsxs(e.Fragment,{children:[e.jsxs(He,{children:[e.jsx(Z,{label:"Status",value:e.jsxs("span",{className:"inline-flex items-center gap-2",children:["Connected",e.jsx(Re,{variant:"success",className:"capitalize",children:x.status})]})}),e.jsx(Z,{label:"Name",value:x.name||"Not provided"}),e.jsx(Z,{label:"Email",value:x.email}),e.jsx(Z,{label:"Account ID",value:e.jsx("span",{className:"text-mono-sm",children:x.id})}),e.jsx(Z,{label:"Tenant ID",value:e.jsx("span",{className:"text-mono-sm",children:x.tenant_id})}),e.jsx(Z,{label:"Provider",value:e.jsx("span",{className:"capitalize",children:g.provider})}),e.jsx(Z,{label:"Created",value:Ct(x.created_at)})]}),e.jsxs("div",{className:"mt-8",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"Need to sign out or switch accounts?"}),e.jsxs(_,{variant:"danger",className:"mt-3",onClick:l,children:[e.jsx(ka,{}),"Sign out from Radient"]})]})]})},[s,a?.radientUser,l]),u=o.useMemo(()=>r==="refused"?"Radient refused the sign-in this app is holding, so your account details could not be read. Signing in again below replaces it.":Mt(r)?"Your Radient account could not be read, so this app cannot show your account details.":"You are not currently signed in to Radient.",[r]),h=o.useMemo(()=>s&&a?null:e.jsxs("div",{children:[e.jsxs("p",{className:"text-body-sm text-ink-muted",children:[u," Sign in to access your account details or sign up to get free credits and unified access to models, tools, and more with Radient Pass. Radient's automatic model router will automatically select the best model for your agents to balance cost and performance. It is often cheaper to use Radient Pass than to use single AI providers due to automatic cost optimization."]}),e.jsx("div",{className:"mt-6",children:e.jsx(Xa,{titleText:"",onAfterCredentialUpdate:t,descriptionText:"",onSignInSuccess:()=>{}})})]}),[s,a,u,t]);return n||d?e.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center gap-3",children:[e.jsx(J,{size:"lg",label:"Loading account"}),!d&&e.jsx("p",{className:"text-meta text-ink-dim",children:"Loading your Radient account details…"})]}):s&&a?.radientUser?m:e.jsx("div",{className:"flex flex-col gap-4",children:h})};function So({metric:t,data:s}){return e.jsx(ba,{title:"",heightClassName:"h-62",yAxisWidth:48,unit:t==="credits"?"credits":"tokens",srSummary:`${t==="credits"?"Credits consumed":"Tokens used"} over the last 30 days, plotted per day across ${s.length} days.`,xTickFormatter:a=>a,yTickFormatter:a=>t==="credits"?`$${a.toFixed(2)}`:ja(a),children:e.jsx(wr,{data:s,children:e.jsx(xt,{type:"monotone",dataKey:"value",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:0},name:t==="credits"?"Credits consumed":"Tokens used"})})})}const Co=()=>{const{data:t,isLoading:s,error:a,refetch:n}=kr(),r=br(),[i,d]=o.useState(""),[l,m]=o.useState(!1);o.useEffect(()=>{d(t?.content??""),m(!1)},[t]);const u=w=>{const S=w.target.value;d(S),m(S!==(t?.content??""))},h=async()=>{if(!(!l||r.isPending))try{const w={content:i};await r.mutateAsync(w),await n(),m(!1)}catch(w){console.error("Error updating system prompt:",w)}},x=()=>{d(t?.content??""),m(!1)},g=r.isPending,f=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(de,{htmlFor:"app-system-prompt",children:"Instructions"}),e.jsx($e,{id:"app-system-prompt",name:"systemPrompt",value:i,onChange:u,placeholder:"Enter instructions for how all agents should behave and respond to your requests...",className:"min-h-50"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(_,{variant:"primary",onClick:h,disabled:!l||g,children:[g?e.jsx(J,{size:"sm"}):e.jsx(wa,{}),g?"Saving...":"Save changes"]}),e.jsx(_,{onClick:x,disabled:!l||g,children:"Cancel"})]}),t?.last_modified&&e.jsxs("p",{className:"text-ink-dim text-meta",children:["Last modified:"," ",e.jsx("span",{className:"font-mono text-mono-sm",children:At(t.last_modified)})]})]});return e.jsx(V,{title:"System prompt",icon:es,description:"Every Local Operator agent receives this prompt in addition to its own instructions, so it is the place for baseline expectations and for details you want every agent to know about you, such as your name, location, or preferences. It is sent to your selected hosting provider.",children:s?e.jsx("div",{className:"flex min-h-50 items-center justify-center",children:e.jsx(J,{size:"lg",label:"Loading system prompt"})}):a?e.jsxs(G,{variant:"danger",children:["Failed to load system prompt:"," ",a instanceof Error?a.message:"Unknown error"]}):f()})},Mo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Ao=t=>Mo.includes(t),Eo=t=>{const s=[];let a=0;for(const n of t){const r=Math.max(0,Math.floor(n.count)),i=Math.max(1,Math.floor(n.columns));for(let d=0;d<r;d+=i)s.push({start:a+d,count:Math.min(i,r-d)});a+=r}return s},Ro=({index:t,key:s,groups:a})=>{const n=Eo(a),r=n.reduce((i,d)=>i+d.count,0);if(!Number.isInteger(t)||t<0||t>=r)return t;switch(s){case"Home":return 0;case"End":return r-1;case"ArrowLeft":return Math.max(0,t-1);case"ArrowRight":return Math.min(r-1,t+1);case"ArrowUp":case"ArrowDown":{const i=n.findIndex(m=>t>=m.start&&t<m.start+m.count),d=n[i+(s==="ArrowDown"?1:-1)];if(!d)return t;const l=t-n[i].start;return d.start+Math.min(l,d.count-1)}default:return t}},To={localOperatorDark:Nn,localOperatorLight:Gn,dracula:Dn,dune:Ws,sage:xn,monokai:Ja,tokyoNight:Mn,iceberg:Pn,radient:dn,neon:yr,obsidian:$t,synth:ds,catppuccinMocha:Fs,catppuccinLatte:kn,tokyoNightStorm:Ms,gruvbox:ys,nord:xr,oneDark:cs,solarizedDark:Bn,rosePine:tn,rosePineMoon:jn,rosePineDawn:Is,alucard:sn,gruvboxLight:Hs,tokyoNightDay:Sn,oneLight:yn,catppuccinFrappe:Us,catppuccinMacchiato:mn,palenight:Sa,everforest:or,everforestLight:nr,kanagawaWave:mr,kanagawaLotus:Xs,ayuDark:Vs,ayuMirage:Ks,ayuLight:In,nightfox:Es,duskfox:Qn,synthwave:Tn,matrix:ms,tron:Ss,cyberpunk:_a,vaporwave:ar,outrun:xs,neonNoir:cr,arcade:pn,forest:er,ocean:Zs,desert:Jn,autumn:pr,lavender:qn,arctic:Ts,rosewood:cn,solarizedLight:Yn,githubLight:rn,paper:Na,linen:Fn,highContrastLight:os,mintLight:ps},mt="bg-[color-mix(in_srgb,var(--color-accent)_8%,var(--color-accent-wash))]",Lo=({id:t})=>e.jsxs("div",{"data-theme":t,"aria-hidden":"true",className:"flex h-full bg-canvas",children:[e.jsxs("div",{className:"flex w-1/4 flex-col gap-1 bg-sunken p-1",children:[e.jsx("span",{className:"flex h-2.5 items-center rounded-xs bg-accent-wash px-1",children:e.jsx("span",{className:"h-1 w-full rounded-xs bg-accent"})}),e.jsx("span",{className:"mx-1 h-1 w-2/3 rounded-xs bg-ink-dim"}),e.jsx("span",{className:"mx-1 h-1 w-1/2 rounded-xs bg-ink-dim"})]}),e.jsxs("div",{className:"flex flex-1 flex-col justify-between p-1",children:[e.jsxs("div",{className:"flex flex-col gap-1 rounded-xs bg-surface p-1",children:[e.jsx("span",{className:"h-1 w-3/5 rounded-xs bg-ink"}),e.jsx("span",{className:"h-1 w-full rounded-xs bg-ink-dim"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"h-2.5 w-6 rounded-xs bg-elevated"}),e.jsx("span",{className:"h-2.5 w-5 rounded-xs bg-accent"}),e.jsx("span",{className:"h-2.5 w-4 rounded-xs bg-accent-alt"}),e.jsx("span",{className:"h-2.5 w-4 rounded-xs border border-control"})]})]})]}),Io=({id:t,name:s,description:a,isSelected:n,isTabStop:r,onSelect:i,onFocusTile:d})=>{const l=To[t];return e.jsx(Ee,{side:"bottom",align:"start",content:a,children:e.jsxs("button",{type:"button","data-theme-tile":t,"aria-pressed":n,tabIndex:r?0:-1,onFocus:d,onClick:i,className:W("relative flex flex-col gap-1.5 rounded-md p-1 text-left transition-colors duration-fast ease-out-quart",n?mt:"hover:bg-surface"),children:[e.jsxs("span",{className:W("relative block h-10 overflow-hidden rounded-sm border transition-colors duration-fast ease-out-quart",n?"border-accent":"border-hairline"),children:[e.jsx(Lo,{id:t}),n&&e.jsx("span",{className:W("pointer-events-none absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full",mt),children:e.jsx(zt,{size:12,className:"text-accent","aria-hidden":"true"})})]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(l,{size:12,className:"shrink-0 text-ink-dim","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-meta text-ink",children:s})]})]})})},zo=t=>[...t.querySelectorAll("[data-theme-grid]")].map(s=>{const a=[...s.querySelectorAll("[data-theme-tile]")],n=a[0]?.getBoundingClientRect().top??0;return{count:a.length,columns:Math.max(1,a.filter(r=>Math.abs(r.getBoundingClientRect().top-n)<1).length)}}),Fo=()=>{const{themeName:t,setTheme:s}=Oe(),a=o.useMemo(()=>{const l=Object.values(qt);return[{label:"Dark",items:l.filter(m=>m.theme.palette.mode==="dark")},{label:"Light",items:l.filter(m=>m.theme.palette.mode==="light")}].filter(m=>m.items.length>0)},[]),[n,r]=o.useState(null),i=o.useMemo(()=>{const l=a.flatMap(m=>m.items.map(u=>u.id));return n&&l.includes(n)?n:l.includes(t)?t:l[0]},[a,n,t]),d=l=>{if(!Ao(l.key))return;const m=[...l.currentTarget.querySelectorAll("[data-theme-tile]")],u=m.indexOf(l.target);if(u<0)return;l.preventDefault();const h=Ro({index:u,key:l.key,groups:zo(l.currentTarget)});h!==u&&m[h]?.focus()};return e.jsx(Wa,{children:e.jsx("div",{onKeyDown:d,className:"flex flex-col gap-6",children:a.map(l=>e.jsxs("div",{children:[e.jsx("h3",{className:"px-1 pb-2 text-meta text-ink-dim",children:l.label}),e.jsx("div",{"data-theme-grid":l.label,className:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-2",children:l.items.map(({id:m,name:u,description:h})=>e.jsx(Io,{id:m,name:u,description:h,isSelected:m===t,isTabStop:m===i,onSelect:()=>s(m),onFocusTile:()=>r(m)},m))})]},l.label))})})},$o=()=>{const{data:t,isLoading:s,error:a}=Sr({enabled:!0});return e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-3 flex items-center gap-2 text-heading text-ink",children:[e.jsx(Os,{size:16,className:"shrink-0 text-ink-dim"}),"Radient Pass"]}),s&&e.jsx(Ft,{className:"h-6 w-36"}),a&&e.jsxs(G,{variant:"warning",children:["Could not load your credit balance. ",a.message]}),t&&!s&&!a&&e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsxs("p",{className:"flex-1 text-body-sm text-ink-muted",children:["Available credits"," ",e.jsx("span",{className:"font-medium text-ink",children:t.balance.toFixed(2)})]}),e.jsx(_,{variant:"secondary",size:"sm",asChild:!0,children:e.jsxs("a",{href:"https://console.radienthq.com/dashboard/billing",target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Ns,{}),"Add credits"]})})]})]})},Do=[{id:"credits",label:"Credits"},{id:"tokens",label:"Tokens"}],Oo=()=>{const[t,s]=o.useState("credits"),a=o.useMemo(()=>{const l=new Date,m=Nr(l);return{start_date:Je(m),end_date:Je(l),rollup:"daily"}},[]),{data:n,isLoading:r,error:i}=Ar(a,{enabled:!0}),d=o.useMemo(()=>n?.data_points?[...n.data_points].sort((m,u)=>Ie(m.timestamp).getTime()-Ie(u.timestamp).getTime()).map(m=>({bucket:qa(ns(Ie(m.timestamp),"yyyy-MM-dd")),value:t==="credits"?Number.parseFloat(m.total_cost.toFixed(2)):m.total_tokens})):[],[n,t]);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-heading text-ink",children:[e.jsx(ks,{size:16,className:"shrink-0 text-ink-dim"}),"Usage (last 30 days)"]}),e.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[e.jsx("legend",{className:"sr-only",children:"Usage metric"}),e.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:Do.map(({id:l,label:m})=>e.jsx(_,{variant:"ghost",size:"sm","aria-pressed":t===l,onClick:()=>s(l),className:W(t===l&&"bg-surface text-ink hover:bg-surface"),children:m},l))})]})]}),r&&e.jsx(Ft,{className:"h-62 w-full"}),i&&e.jsxs(G,{variant:"warning",children:["Could not load your usage data. ",i.message]}),!r&&!i&&n&&d.length>0&&e.jsx(So,{metric:t,data:d}),!r&&!i&&(!n||d.length===0)&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No usage recorded in the last 30 days."})]})},Po=()=>e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[e.jsx(Ha,{size:16,className:"shrink-0 text-ink-dim"}),"Radient account"]}),e.jsx(_,{variant:"secondary",size:"sm",className:"self-start sm:self-center",asChild:!0,children:e.jsxs("a",{href:"https://console.radienthq.com",target:"_blank",rel:"noopener noreferrer",children:["Go to Radient console",e.jsx(jt,{})]})})]}),Zo=()=>{const t=Oe(C=>C.showAgentReasoning),s=Oe(C=>C.setShowAgentReasoning),{data:a,isLoading:n,isFetching:r,error:i,refetch:d}=Ca(),l=Dt(),{sentence:m,remedy:u}=kt(l,"Your settings could not be loaded.",i),h=Ma(),[x,g]=o.useState(null),f=St(),{isAuthenticated:w,accountRead:S,isFetching:M,isRefreshing:T,refreshUser:z}=Ue(),N=_e(C=>C.activeSessionId),[F,$]=o.useState("general"),[U,q]=o.useState(!1),E=o.useRef(null),y=o.useRef(null),{startTour:D}=Aa(),R=Ea(),{data:A,refetch:K}=wt(),{refreshModels:X}=Ra(),B=o.useMemo(()=>A?.keys?[...A.keys].sort():[],[A?.keys]),k=o.useRef({keys:"",hosting:void 0});o.useEffect(()=>{const C=B.join(","),H=a?.values?.hosting;(k.current.keys!==C||k.current.hosting!==H)&&(k.current={keys:C,hosting:H},X().catch(P=>{console.error("Failed to refresh models after credentials or hosting change:",P)}))},[B,a?.values?.hosting,X]);const O=o.useRef({general:o.useRef(null),radient:o.useRef(null),integrations:o.useRef(null),appearance:o.useRef(null),credentials:o.useRef(null),providers:o.useRef(null),backend:o.useRef(null),updates:o.useRef(null)}).current,re=o.useMemo(()=>new URLSearchParams(R.search).get("setting"),[R.search]),Q=o.useMemo(()=>new URLSearchParams(R.search).get("filter")??"",[R.search]),ue=o.useMemo(()=>new URLSearchParams(R.search).get("mcp")??void 0,[R.search]),fe=o.useMemo(()=>new URLSearchParams(R.search).get("provider"),[R.search]),oe=o.useCallback(C=>{$(C),q(!0);const H=O[C],P=y.current;if(H?.current&&P){const Y=H.current.getBoundingClientRect().top-P.getBoundingClientRect().top;P.scrollHeight>P.clientHeight?P.scrollTo({top:Math.max(0,P.scrollTop+Y-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,H.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout(E.current??void 0),E.current=setTimeout(()=>{q(!1),E.current=null},800)}else q(!1)},[O]);o.useEffect(()=>{const C=setTimeout(()=>{const H=y.current;if(!H)return;const P=()=>{if(U)return;const ce=H.getBoundingClientRect(),Y=ce.height;let ee="",te=0;for(const[c,p]of Object.entries(O))if(p.current){const b=p.current.getBoundingClientRect(),j=ce.top,L=b.top-j,I=b.bottom-j,me=b.height,Ne=Math.max(0,L),Ut=Math.min(Y,I),Ve=Math.max(0,Ut-Ne)/me,Ge=Ve+(L<Y*.3?.1:0);Ge>te&&Ve>.1&&(te=Ge,ee=c)}ee&&ee!==F&&$(ee)};return P(),H.addEventListener("scroll",P,{passive:!0}),()=>{H.removeEventListener("scroll",P),clearTimeout(E.current??void 0)}},100);return()=>clearTimeout(C)},[O,F,U]),o.useEffect(()=>{const C=new URLSearchParams(R.search),H=C.get("section"),P=C.get("setting")?"backend":H,ce=P?O[P]:void 0;if(!P||!ce)return;let Y=!1,ee=Number.NaN,te=0;const c=window.setTimeout(()=>{Y||(Y=!0,b.disconnect(),oe(P))},2e3),p=()=>{if(Y)return;const j=ce.current;if(!j){te=requestAnimationFrame(p);return}const L=Math.round(j.getBoundingClientRect().top+window.scrollY);if(L===ee&&L>0){Y=!0,b.disconnect(),window.clearTimeout(c),oe(P);return}ee=L,te=requestAnimationFrame(p)},b=new ResizeObserver(()=>{Y||(cancelAnimationFrame(te),te=requestAnimationFrame(p))});return y.current&&b.observe(y.current),te=requestAnimationFrame(p),()=>{Y=!0,cancelAnimationFrame(te),b.disconnect(),window.clearTimeout(c)}},[R.search,O,oe]);const ae=async(C,H)=>{g(C);try{await h.mutateAsync({[C]:H}),await d()}catch(P){console.error(`Error updating ${C}:`,P)}finally{g(null)}},je=n,se=S==="checking",ie=Mt(S),ke=S==="ready"||S==="checking"||M,we=Cr(je,4e3);return i?e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(G,{variant:"warning",className:"w-full max-w-xl",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:m}),u&&e.jsx(_,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void d(),disabled:r,children:r?"Retrying":"Retry"})]})})}):je?e.jsxs("div",{role:"status",className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-canvas",children:[e.jsx(J,{size:"lg",label:we?void 0:"Loading settings"}),we&&e.jsx("p",{className:"max-w-sm text-center text-body-sm text-ink-muted",children:"The Local Operator server is taking longer than usual to answer. If it does not respond, you will be able to retry from here."})]}):a?e.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-canvas",children:[e.jsx("div",{className:"w-12 shrink-0 overflow-y-auto border-r border-hairline min-[1040px]:w-55",children:e.jsx(Ta,{activeSection:F,onSelectSection:oe,sections:La})}),e.jsx("div",{ref:y,"data-settings-content":!0,"data-tour-tag":"settings-general-section",className:"flex-1 overflow-y-auto overflow-x-hidden p-4 sm:p-6 md:p-8",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-8 pb-8",children:[e.jsx(Ba,{title:"Settings",icon:Qe}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsxs("div",{ref:O.general,className:"flex flex-col gap-8",children:[e.jsxs(V,{title:"User profile",icon:Ia,description:`Your user profile information displayed in the application. This information is not provided to the agents. ${w?"These details are provided through your Radient account.":""}`,children:[se&&e.jsx("p",{className:"text-meta text-ink-dim",children:"Checking your Radient account…"}),ie&&e.jsx(G,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{children:["Your Radient account could not be read, so the name and email below are placeholders rather than your account details.",S==="refused"?" Retry, or sign in to Radient again.":" Retry."]}),e.jsx(_,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>z(),disabled:T,children:T?"Retrying":"Retry"})]})}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(We,{value:f.profile.name,label:"Display name",placeholder:"Enter your name...",isSaving:x==="user_name",onSave:async C=>{g("user_name");try{f.updateName(C)}finally{g(null)}},readOnly:ke}),e.jsx(We,{value:f.profile.email,label:"Email address",placeholder:"Enter your email...",isSaving:x==="user_email",onSave:async C=>{g("user_email");try{f.updateEmail(C)}finally{g(null)}},readOnly:ke})]})]}),e.jsx(V,{title:"Application tour",description:"Missed the application onboarding tour or want a refresher? Start it again here.",children:e.jsxs(_,{variant:"secondary",onClick:()=>{D({forceModalCompleted:!0})},children:[e.jsx(js,{}),"Take the tour"]})}),e.jsx(V,{title:"Model settings",icon:za,description:"Configure the default AI model and hosting providers used for generating responses. This will be used for all agents that don't have a specific model or hosting provider configured. You can override these settings for individual agents in the agent settings.",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Fa,{value:a.values.hosting,isSaving:x==="hosting",onSave:C=>ae("hosting",C),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:"No hosting providers available. Add one in API credentials, in the list on the left."}),e.jsx($a,{value:a.values.model_name,hostingId:a.values.hosting,isSaving:x==="model_name",onSave:C=>ae("model_name",C),allowCustom:!0,allowDefault:!1}),e.jsx(G,{variant:"neutral",icon:e.jsx(Fe,{className:"size-4","aria-hidden":"true"}),children:"You need a Radient account or your own API keys to reach cloud providers. If you don't see more hosting providers and models here, add credentials or sign in to Radient."})]})}),e.jsx(Co,{}),e.jsx(V,{title:"History settings",icon:ss,description:"Configure how much conversation history is retained and displayed. These are tools to help balance cost and performance by controlling the amount of data used by the agents.",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Le,{value:a.values.conversation_length,label:"Maximum conversation history",description:"Number of messages to keep in conversation history for context. More messages will make the agents have longer memory but more expensive to run. Recommended: 100",min:10,max:500,step:10,unit:"msgs",icon:Da,isSaving:x==="conversation_length",onChange:C=>ae("conversation_length",C)}),e.jsx(Le,{value:a.values.detail_length,label:"Detail view length",description:"Maximum number of messages to show in the detailed conversation view. Messages beyond this limit will be summarized. Shortening this will decrease costs but some important details could get lost from earlier messages. Recommended: 15",min:10,max:500,step:5,unit:"msgs",icon:Oa,isSaving:x==="detail_length",onChange:C=>ae("detail_length",C)}),e.jsx(Le,{value:a.values.max_learnings_history,label:"Maximum learnings history",description:"Agents note down specific insights and key learnings in memory which persist beyond the maximum conversation history and summarization. This setting controls the maximum number of learning items to retain. More items will make the agents acquire a longer history of knowledge from your conversations but more expensive to run. Recommended: 50",min:10,max:200,step:10,unit:"notes",icon:Pa,isSaving:x==="max_learnings_history",onChange:C=>ae("max_learnings_history",C)})]})}),e.jsx(V,{title:"Configuration information",icon:Fe,description:"System information about the current configuration.",children:e.jsxs(He,{children:[e.jsx(Z,{label:"Version",value:e.jsx("span",{className:"text-mono-sm",children:a.version})}),e.jsx(Z,{label:"Created",value:Ct(a.metadata.created_at)}),e.jsx(Z,{label:"Last modified",value:At(a.metadata.last_modified)}),e.jsx(Z,{label:"Description",value:a.metadata.description||"No description available"})]})})]}),e.jsx(V,{title:"Appearance",icon:$t,description:"Customize the look and feel of Local Operator",sectionRef:O.appearance,dataTourTag:"settings-appearance-section",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Fo,{}),e.jsx(jr,{value:t,label:"Show agent reasoning",description:"Adds the agent's Reasoning and Thinking rows to conversations. They stay closed until you open one.",onChange:async C=>s(C)})]})}),e.jsx(V,{title:"Radient account",titleComponent:e.jsx(Po,{}),description:"Manage your Radient account, Radient Pass details, and credits.",sectionRef:O.radient,dataTourTag:"settings-radient-account-section",children:e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsx(_o,{onAfterCredentialUpdate:()=>{X(),K()}}),w&&e.jsxs(e.Fragment,{children:[e.jsx($o,{}),e.jsx(Oo,{})]})]})}),e.jsx(V,{title:"Providers",icon:_t,description:"Model providers, how you sign in to each, and which are connected.",sectionRef:O.providers,children:e.jsx(Ua,{initialProviderId:fe})}),e.jsx(V,{title:"Backend settings",icon:Qe,description:"Every setting the backend registry owns, searchable, with typed editors and scopes.",sectionRef:O.backend,children:e.jsx(fo,{focusKey:re,initialFilter:Q})}),e.jsx(No,{sessionId:N??void 0,sectionRef:O.integrations,highlightServer:ue}),e.jsx(V,{title:"API credentials",icon:Ae,description:"Manage your API keys for various services and integrations",sectionRef:O.credentials,dataTourTag:"settings-api-credentials-section",children:e.jsx(go,{})}),e.jsx("div",{ref:O.updates,children:e.jsx(Tr,{})})]})]})})]}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(G,{variant:"warning",className:"w-full max-w-xl",children:"Your settings could not be loaded."})})};export{Zo as SettingsPage};