local-operator-ui 0.29.1 → 0.29.3

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 (70) hide show
  1. package/out/main/index.js +319 -116
  2. package/out/renderer/assets/{_basePickBy-BydJ9gPn.js → _basePickBy-BuxOTHVQ.js} +1 -1
  3. package/out/renderer/assets/{_baseUniq-BDr5gwdw.js → _baseUniq-CpAeJ_T5.js} +1 -1
  4. package/out/renderer/assets/{agent-details-page-DzuXjh7y.js → agent-details-page-MP0PffyF.js} +2 -2
  5. package/out/renderer/assets/{agent-hub-page-C4DQzZUK.js → agent-hub-page-D_VZWryD.js} +2 -2
  6. package/out/renderer/assets/{agents-page-BNG7sv4M.js → agents-page-DD8YflqT.js} +2 -2
  7. package/out/renderer/assets/{arc-Ts5EMYgx.js → arc-DYfSd8Jq.js} +1 -1
  8. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-BAzlZ3P9.js → architectureDiagram-IEHRJDOE-CB4RrqKK.js} +1 -1
  9. package/out/renderer/assets/{blockDiagram-JOT3LUYC-DwF0jv-B.js → blockDiagram-JOT3LUYC-ByZ-EtvL.js} +1 -1
  10. package/out/renderer/assets/browser-page-Bgm7Jusv.js +1 -0
  11. package/out/renderer/assets/{c4Diagram-VJAJSXHY-QrHSDv8I.js → c4Diagram-VJAJSXHY-C-px-58h.js} +1 -1
  12. package/out/renderer/assets/channel-CNh50WRj.js +1 -0
  13. package/out/renderer/assets/{chunk-4BMEZGHF-BjNHi0kM.js → chunk-4BMEZGHF-JfxshMc2.js} +1 -1
  14. package/out/renderer/assets/{chunk-A2AXSNBT-DxLxkNtl.js → chunk-A2AXSNBT-BhURhbRt.js} +1 -1
  15. package/out/renderer/assets/{chunk-AEK57VVT-C9g2i51Q.js → chunk-AEK57VVT-CU2c2HZ3.js} +1 -1
  16. package/out/renderer/assets/{chunk-D6G4REZN-DoSuJfra.js → chunk-D6G4REZN-2emtjcJO.js} +1 -1
  17. package/out/renderer/assets/{chunk-RZ5BOZE2-Bi2qxsMe.js → chunk-RZ5BOZE2-8oEYebhy.js} +1 -1
  18. package/out/renderer/assets/{chunk-XZIHB7SX-sURP5cay.js → chunk-XZIHB7SX-8mhmnfki.js} +1 -1
  19. package/out/renderer/assets/classDiagram-GIVACNV2-7rlY7XBk.js +1 -0
  20. package/out/renderer/assets/classDiagram-v2-COTLJTTW-7rlY7XBk.js +1 -0
  21. package/out/renderer/assets/clone-C0QmamW2.js +1 -0
  22. package/out/renderer/assets/{compact-pagination-ohz3hihb.js → compact-pagination-B5GLn5G8.js} +1 -1
  23. package/out/renderer/assets/{dagre-OKDRZEBW-ByoyCyPA.js → dagre-OKDRZEBW-DgVH2QFH.js} +1 -1
  24. package/out/renderer/assets/{diagram-SSKATNLV-mZiujngq.js → diagram-SSKATNLV-DgJWH7Pg.js} +1 -1
  25. package/out/renderer/assets/{diagram-VNBRO52H-D0zTyi6M.js → diagram-VNBRO52H-CK2mOdII.js} +1 -1
  26. package/out/renderer/assets/{erDiagram-Q7BY3M3F-B5TcZz4R.js → erDiagram-Q7BY3M3F-DsXSbjhz.js} +1 -1
  27. package/out/renderer/assets/{flowDiagram-4HSFHLVR-DBTPif6c.js → flowDiagram-4HSFHLVR-t_VxP8Y2.js} +1 -1
  28. package/out/renderer/assets/{ganttDiagram-APWFNJXF-DYbmXVph.js → ganttDiagram-APWFNJXF-CRA0nD3Z.js} +1 -1
  29. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-DPj0BkeE.js → gitGraphDiagram-7IBYFJ6S-EckWqrcy.js} +1 -1
  30. package/out/renderer/assets/{graph-DT3vvKWN.js → graph-B_e-5OmG.js} +1 -1
  31. package/out/renderer/assets/{icon-02RQhVJ6.js → icon-BLBWBLpQ.js} +1 -1
  32. package/out/renderer/assets/icon-DaEdqqLD.css +1 -0
  33. package/out/renderer/assets/{index-BkOD7HrG.js → index-BzJ5D16w.js} +1 -1
  34. package/out/renderer/assets/{index-CcZE1DSW.js → index-CzMCmFaC.js} +1 -1
  35. package/out/renderer/assets/{index-CVKAjzjY.js → index-W2LjSwcL.js} +396 -416
  36. package/out/renderer/assets/{infoDiagram-PH2N3AL5-CsR8b0O1.js → infoDiagram-PH2N3AL5-BHXcodOL.js} +1 -1
  37. package/out/renderer/assets/{installer-DbeF2a73.js → installer-CJaywoSL.js} +1 -1
  38. package/out/renderer/assets/{journeyDiagram-U35MCT3I-CDUogXFs.js → journeyDiagram-U35MCT3I-BbuZvzF4.js} +1 -1
  39. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-CXBuFpQO.js → kanban-definition-NDS4AKOZ-m6V84DzN.js} +1 -1
  40. package/out/renderer/assets/{layout-DFc6uQ1h.js → layout-CFV4pKtO.js} +1 -1
  41. package/out/renderer/assets/{legacy-agents-page-DJqe2gmd.js → legacy-agents-page-BYRquvwf.js} +5 -5
  42. package/out/renderer/assets/{mermaid.core-788Hb5C_.js → mermaid.core-CcCGG8rv.js} +5 -5
  43. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-DV20YLHP.js → mindmap-definition-ALO5MXBD-CnN1UhFO.js} +1 -1
  44. package/out/renderer/assets/{page-header-hdhRg_jg.js → page-header-B81uizKq.js} +1 -1
  45. package/out/renderer/assets/parseISO-SuyRamt_.js +6 -0
  46. package/out/renderer/assets/{pieDiagram-IB7DONF6--ODHtlRV.js → pieDiagram-IB7DONF6-DWvbkeJO.js} +1 -1
  47. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-BeBjHOIC.js → quadrantDiagram-7GDLP6J5-BqYtejyj.js} +1 -1
  48. package/out/renderer/assets/{radar-MK3ICKWK-DhIaA0my.js → radar-MK3ICKWK-CflNxnbe.js} +1 -1
  49. package/out/renderer/assets/{radient-auth-buttons-QryFNXsQ.js → radient-auth-buttons-bfpBoHvB.js} +2 -2
  50. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-DSjsP086.js → requirementDiagram-KVF5MWMF-CwboheY-.js} +1 -1
  51. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-BWYpjOje.js → sankeyDiagram-QLVOVGJD-DhwbV2-N.js} +1 -1
  52. package/out/renderer/assets/{schedules-page-BTcUAg3f.js → schedules-page-CqPwo7_C.js} +6 -6
  53. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-BkW8SZ0l.js → sequenceDiagram-X6HHIX6F-aZwx5ceT.js} +1 -1
  54. package/out/renderer/assets/{settings-page-o3rhI1O_.js → settings-page-BPMDTHwZ.js} +71 -66
  55. package/out/renderer/assets/{stateDiagram-DGXRK772-CQX1zc72.js → stateDiagram-DGXRK772-Cp2LT0zg.js} +1 -1
  56. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CUBxQeqf.js +1 -0
  57. package/out/renderer/assets/{timeline-definition-BDJGKUSR-DEJuFYsn.js → timeline-definition-BDJGKUSR-62sjziy0.js} +1 -1
  58. package/out/renderer/assets/{use-agent-like-mutation-Cge3KSLs.js → use-agent-like-mutation-Bpg52Kv_.js} +1 -1
  59. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-QzzQROdv.js → xychartDiagram-VJFVF3MP-Cu2lsyD3.js} +1 -1
  60. package/out/renderer/index.html +11 -4
  61. package/out/renderer/installer.html +3 -3
  62. package/package.json +3 -2
  63. package/out/renderer/assets/browser-page-C2cytRLR.js +0 -1
  64. package/out/renderer/assets/channel-BAGpTB5A.js +0 -1
  65. package/out/renderer/assets/classDiagram-GIVACNV2-COd_us28.js +0 -1
  66. package/out/renderer/assets/classDiagram-v2-COTLJTTW-COd_us28.js +0 -1
  67. package/out/renderer/assets/clone-awNOoFm7.js +0 -1
  68. package/out/renderer/assets/icon-Y8w93nKk.css +0 -1
  69. package/out/renderer/assets/parseISO-A4KRXmC2.js +0 -6
  70. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-sC3k5tGT.js +0 -1
@@ -1,312 +1,317 @@
1
- import{a as f,r as o,j as e,B as M,S as ee,Q as ut,o as _e,G as Ie,U as $t,I as oe,T as ze,b as mt,d as ht,e as pt,f as ft,g as $e,c as X,A as V,X as Dt,J as Se,L as le,V as Ft,Y as xt,i as Ot,k as Pt,Z as Ut,_ as qt,O as Ht,q as Bt,h as gt}from"./icon-02RQhVJ6.js";import{bQ as Vt,bR as Ve,bS as Ge,bT as Gt,bj as Kt,g as ge,bk as yt,bl as Fe,av as vt,f as kt,a6 as Yt,aw as Zt,bU as Qt,bV as Wt,bW as Jt,bX as Xt,bY as bt,ac as ea,bZ as ta,b_ as ue,b$ as Oe,c0 as jt,aK as aa,c1 as Ke,c2 as sa,b as Pe,d as Ce,ag as na,c3 as ra,at as Ue,j as fe,c4 as wt,c5 as oa,bp as Nt,c6 as ia,c7 as Me,aC as ca,aD as _t,c8 as St,c9 as ve,aN as la,ca as Ct,cb as da,P as ua,i as je,cc as ma,cd as ha,ce as Ee,cf as Mt,cg as pa,ch as fa,ci as At,cj as xa,ck as ga,cl as ya,cm as va,a4 as ka,cn as Et,aM as Tt,co as ba,cp as ja,cq as wa,aA as Na,cr as Rt,bJ as De,cs as _a,bv as Sa,ct as Ca,bs as Ma,cu as Aa,cv as Ea,bn as Ta,cw as Ra,cx as La,cy as Ia,bf as Ye,cz as za,br as Ze,cA as $a,cB as Da,bt as Fa,bu as Oa,bq as Te,cC as Pa,cD as Ua,cE as qa,cF as Ha,cG as Ba,cH as Va,cI as Ga}from"./index-CVKAjzjY.js";import{P as Ka}from"./page-header-hdhRg_jg.js";import{S as B,I as qe,a as Z,R as Ya,N as Za}from"./radient-auth-buttons-QryFNXsQ.js";import{a as Qa,H as Wa,p as Re}from"./parseISO-A4KRXmC2.js";/**
1
+ import{a as f,r as o,j as e,B as M,S as ee,Q as ut,o as _e,G as Ie,U as $t,I as oe,T as ze,b as mt,d as ht,e as pt,f as ft,g as $e,c as X,A as V,X as Dt,J as Se,L as le,V as Ft,Y as xt,i as Ot,k as Pt,Z as Ut,_ as qt,O as Bt,q as Ht,h as gt}from"./icon-BLBWBLpQ.js";import{bW as Vt,bX as Ve,bY as Ge,bZ as Gt,bp as Kt,g as ge,bq as yt,br as Fe,ar as vt,f as kt,a6 as Yt,as as Zt,b_ as Qt,b$ as Wt,c0 as Jt,c1 as Xt,c2 as bt,b8 as ea,c3 as Oe,c4 as jt,aG as ta,c5 as Ke,c6 as aa,b as Pe,d as Ce,ac as sa,c7 as na,ap as Ue,j as fe,c8 as wt,c9 as ra,bv as Nt,ca as oa,cb as Me,ay as ia,az as _t,cc as St,cd as ve,aJ as ca,ce as Ct,cf as la,P as da,i as je,cg as ua,ch as ma,ci as Ee,cj as Mt,ck as ha,cl as pa,cm as At,cn as fa,co as xa,cp as ga,cq as ya,a4 as va,cr as Et,aI as Tt,cs as ka,ct as ba,cu as ja,aw as wa,cv as Rt,bP as De,cw as Na,bB as _a,cx as Sa,by as Ca,cy as Ma,cz as Aa,bt as Ea,cA as Ta,cB as Ra,cC as La,bl as Ye,cD as Ia,bx as Ze,cE as za,bz as $a,bA as Da,bw as Te,cF as Fa,cG as Oa,cH as Pa,cI as Ua,cJ as qa,cK as Ba}from"./index-W2LjSwcL.js";import{P as Ha}from"./page-header-B81uizKq.js";import{S as H,I as qe,a as Z,R as Va,N as Ga}from"./radient-auth-buttons-bfpBoHvB.js";import{i as Ka,a as ue,b as Ya,H as Za,p as Re,f as Qa}from"./parseISO-SuyRamt_.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 Ja=[["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"}]],Xa=f("aperture",Ja);/**
6
+ */const Wa=[["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"}]],Ja=f("aperture",Wa);/**
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 es=[["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"}]],ts=f("atom",es);/**
11
+ */const Xa=[["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"}]],es=f("atom",Xa);/**
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 as=[["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"}]],ss=f("audio-waveform",as);/**
16
+ */const ts=[["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"}]],as=f("audio-waveform",ts);/**
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 ns=[["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"}]],rs=f("binary",ns);/**
21
+ */const ss=[["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"}]],ns=f("binary",ss);/**
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 os=[["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"}]],is=f("candy",os);/**
26
+ */const rs=[["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"}]],os=f("candy",rs);/**
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 cs=[["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"}]],ls=f("car-front",cs);/**
31
+ */const is=[["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"}]],cs=f("car-front",is);/**
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 ds=[["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"}]],us=f("cassette-tape",ds);/**
36
+ */const ls=[["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"}]],ds=f("cassette-tape",ls);/**
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 ms=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],hs=f("chart-line",ms);/**
41
+ */const us=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],ms=f("chart-line",us);/**
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 ps=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],fs=f("circle-plus",ps);/**
46
+ */const hs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],ps=f("circle-play",hs);/**
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 xs=[["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"}]],gs=f("circuit-board",xs);/**
51
+ */const fs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],xs=f("circle-plus",fs);/**
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 ys=[["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"}]],vs=f("cloud-lightning",ys);/**
56
+ */const gs=[["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"}]],ys=f("circuit-board",gs);/**
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 ks=[["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"}]],bs=f("cloud-moon",ks);/**
61
+ */const vs=[["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"}]],ks=f("cloud-lightning",vs);/**
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 js=[["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"}]],ws=f("cloud-snow",js);/**
66
+ */const bs=[["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"}]],js=f("cloud-moon",bs);/**
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 Ns=[["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"}]],_s=f("cloud-sun",Ns);/**
71
+ */const ws=[["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"}]],Ns=f("cloud-snow",ws);/**
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 Ss=[["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"}]],Cs=f("coffee",Ss);/**
76
+ */const _s=[["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"}]],Ss=f("cloud-sun",_s);/**
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 Ms=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],Lt=f("contrast",Ms);/**
81
+ */const Cs=[["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"}]],Ms=f("coffee",Cs);/**
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 As=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Es=f("credit-card",As);/**
86
+ */const As=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],Lt=f("contrast",As);/**
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 Ts=[["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"}]],Rs=f("cup-soda",Ts);/**
91
+ */const Es=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ts=f("credit-card",Es);/**
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 Ls=[["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"}]],Is=f("disc-3",Ls);/**
96
+ */const Rs=[["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"}]],Ls=f("cup-soda",Rs);/**
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 zs=[["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"}]],$s=f("droplet",zs);/**
101
+ */const Is=[["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"}]],zs=f("disc-3",Is);/**
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 Ds=[["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"}]],Fs=f("droplets",Ds);/**
106
+ */const $s=[["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"}]],Ds=f("droplet",$s);/**
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 Os=[["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"}]],Ps=f("fish",Os);/**
111
+ */const Fs=[["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"}]],Os=f("droplets",Fs);/**
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 Us=[["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=f("flame",Us);/**
116
+ */const Ps=[["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"}]],Us=f("fish",Ps);/**
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 Hs=[["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"}]],Bs=f("flower-2",Hs);/**
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"}]],Bs=f("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 Vs=[["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"}]],Gs=f("flower",Vs);/**
126
+ */const Hs=[["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"}]],Vs=f("flower-2",Hs);/**
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 Ks=[["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"}]],Ys=f("ghost",Ks);/**
131
+ */const Gs=[["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"}]],Ks=f("flower",Gs);/**
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 Zs=[["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"}]],Qs=f("github",Zs);/**
136
+ */const Ys=[["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"}]],Zs=f("ghost",Ys);/**
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 Ws=[["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"}]],Js=f("guitar",Ws);/**
141
+ */const Qs=[["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"}]],Ws=f("github",Qs);/**
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 Xs=[["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"}]],en=f("hexagon",Xs);/**
146
+ */const Js=[["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"}]],Xs=f("guitar",Js);/**
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 tn=[["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"}]],an=f("ice-cream-bowl",tn);/**
151
+ */const en=[["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"}]],tn=f("hexagon",en);/**
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 sn=[["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"}]],nn=f("joystick",sn);/**
156
+ */const an=[["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"}]],sn=f("ice-cream-bowl",an);/**
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 rn=[["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"}]],on=f("leaf",rn);/**
161
+ */const nn=[["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"}]],rn=f("joystick",nn);/**
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 cn=[["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"}]],ln=f("lightbulb",cn);/**
166
+ */const on=[["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"}]],cn=f("leaf",on);/**
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 dn=[["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"}]],un=f("lock",dn);/**
171
+ */const ln=[["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"}]],dn=f("lightbulb",ln);/**
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 mn=[["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"}]],hn=f("milk",mn);/**
176
+ */const un=[["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"}]],mn=f("lock",un);/**
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 pn=[["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"}]],fn=f("moon-star",pn);/**
181
+ */const hn=[["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"}]],pn=f("milk",hn);/**
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 xn=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],gn=f("moon",xn);/**
186
+ */const fn=[["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"}]],xn=f("moon-star",fn);/**
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 yn=[["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"}]],vn=f("mountain-snow",yn);/**
191
+ */const gn=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],yn=f("moon",gn);/**
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 kn=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],bn=f("mountain",kn);/**
196
+ */const vn=[["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"}]],kn=f("mountain-snow",vn);/**
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 jn=[["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"}]],wn=f("plug-zap",jn);/**
201
+ */const bn=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],jn=f("mountain",bn);/**
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 Nn=[["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"}]],_n=f("radio",Nn);/**
206
+ */const wn=[["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"}]],Nn=f("plug-zap",wn);/**
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 Sn=[["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"}]],Cn=f("sailboat",Sn);/**
211
+ */const _n=[["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"}]],Sn=f("radio",_n);/**
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 Mn=[["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"}]],An=f("shirt",Mn);/**
216
+ */const Cn=[["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"}]],Mn=f("sailboat",Cn);/**
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 En=[["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"}]],Tn=f("skull",En);/**
221
+ */const An=[["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"}]],En=f("shirt",An);/**
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 Rn=[["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"}]],Ln=f("snowflake",Rn);/**
226
+ */const Tn=[["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"}]],Rn=f("skull",Tn);/**
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 In=[["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"}]],zn=f("sparkle",In);/**
231
+ */const Ln=[["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"}]],In=f("snowflake",Ln);/**
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 $n=[["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"}]],Dn=f("sun-dim",$n);/**
236
+ */const zn=[["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"}]],$n=f("sparkle",zn);/**
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 Fn=[["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"}]],On=f("sun",Fn);/**
241
+ */const Dn=[["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"}]],Fn=f("sun-dim",Dn);/**
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 Pn=[["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"}]],Un=f("sunrise",Pn);/**
246
+ */const On=[["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"}]],Pn=f("sun",On);/**
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 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"}]],Hn=f("sunset",qn);/**
251
+ */const Un=[["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"}]],qn=f("sunrise",Un);/**
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 Bn=[["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"}]],Vn=f("tent",Bn);/**
256
+ */const Bn=[["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"}]],Hn=f("sunset",Bn);/**
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 Gn=[["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"}]],Kn=f("tree-deciduous",Gn);/**
261
+ */const Vn=[["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"}]],Gn=f("tent",Vn);/**
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 Yn=[["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"}]],Zn=f("tree-palm",Yn);/**
266
+ */const Kn=[["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"}]],Yn=f("tree-deciduous",Kn);/**
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 Qn=[["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"}]],Wn=f("tree-pine",Qn);/**
271
+ */const Zn=[["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"}]],Qn=f("tree-palm",Zn);/**
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 Jn=[["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"}]],Xn=f("trees",Jn);/**
276
+ */const Wn=[["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"}]],Jn=f("tree-pine",Wn);/**
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 er=[["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"}]],tr=f("umbrella",er);/**
281
+ */const Xn=[["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"}]],er=f("trees",Xn);/**
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 ar=[["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"}]],sr=f("undo-2",ar);/**
286
+ */const tr=[["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"}]],ar=f("umbrella",tr);/**
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 nr=[["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"}]],rr=f("waves",nr);/**
291
+ */const sr=[["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"}]],nr=f("undo-2",sr);/**
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 or=[["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"}]],ir=f("wheat",or);/**
296
+ */const rr=[["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"}]],or=f("waves",rr);/**
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 cr=[["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"}]],lr=f("wind",cr);/**
301
+ */const ir=[["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"}]],cr=f("wheat",ir);/**
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 dr=[["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"}]],ur=f("zap",dr),mr=()=>{const t="https://local-operator.com/download",[s,a]=o.useState(!1),[n,r]=o.useState(!1),[c,l]=o.useState(null),[h,u]=o.useState("info"),[m,d]=o.useState(null),[g,S]=o.useState(null),p=o.useRef(!1),k=o.useRef(!1),A=o.useRef(0),E=o.useRef(!1),R=o.useCallback((T,C)=>{k.current=!1,l(T),u(C),r(!0)},[]),$=o.useCallback(T=>{k.current=!0,l(T),u("success"),r(!0)},[]),y=o.useCallback(()=>{k.current&&(k.current=!1,r(!1),l(null))},[]),{clearDeferredUpdate:F}=Vt();o.useEffect(()=>{const T=window.api.updater.onUpdateError(G=>{p.current&&G.includes("manually")&&(d({message:"The server is installed outside the app, so use the tool you installed it with - uv, pipx or pip.",command:""}),k.current=!1,l(null),u("warning"),r(!0))}),C=window.api.updater.onBackendUpdateDevMode(G=>{p.current&&R(G,"info")}),b=()=>{E.current=!0,y()},D=window.api.updater.onUpdateAvailable(b),j=window.api.updater.onUpdateNpxAvailable(b),Q=window.api.updater.onBackendUpdateAvailable(b);return()=>{T(),C(),D(),j(),Q()}},[y,R]),o.useEffect(()=>{let T=!1;const C=()=>{window.api.updater.getLastInstallAttempt().then(D=>{T||S(D)}).catch(()=>{})};C();const b=window.api.updater.onUpdateInstallFailed(()=>C());return()=>{T=!0,b()}},[]);const L=async()=>{const T=++A.current;y(),E.current=!1;try{a(!0),p.current=!0,F(Ge.UI),F(Ge.BACKEND);const C=await window.api.updater.checkForAllUpdates({manual:!0});if(T!==A.current)return;C?.affirmation&&!E.current?$(C.affirmation):y()}catch(C){if(T!==A.current)return;console.warn(`Update check failed; the app-level alert owns the report: ${Gt(C)}`)}finally{T===A.current&&a(!1),setTimeout(()=>{p.current=!1},2e3)}},P=()=>{k.current=!1,r(!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)`:"",". Version ",g.runningVersion," is running."]}),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(M,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>void window.api.openExternal(t),children:"Download a fresh copy"})]}),e.jsxs(M,{variant:"outline",onClick:()=>void L(),disabled:s,children:[s?e.jsx(ee,{size:"sm"}):null,s?"Checking...":"Check for updates"]}),m&&e.jsxs(Ve,{open:n,autoHideDuration:1e4,onClose:P,variant:"warning",children:[e.jsx("p",{className:"text-body-sm",children:m.message}),m.command&&e.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:m.command})]}),c&&h!=="danger"&&e.jsx(Ve,{open:n,autoHideDuration:6e3,onClose:P,variant:h,children:c})]})},we=["system-prompt"],hr=()=>{const{shouldEnableQuery:t}=Kt();return ge({enabled:t({bypassInternetCheck:!0}),queryKey:we,queryFn:async()=>{try{const a=await yt(Fe.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 vt(a),s}},refetchOnWindowFocus:!1,staleTime:5e3})},pr=()=>{const t=kt(),s=yt(Fe.baseUrl);return Yt({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 vt(r),n}},onSuccess:async a=>{await t.invalidateQueries({queryKey:we,refetchType:"none"}),t.setQueryData(we,n=>n&&{...n,...a}),await t.refetchQueries({queryKey:we,type:"all"}),Zt("System prompt updated")},onError:a=>{console.error("Error updating system prompt:",a)}})},fr=({value:t,label:s,description:a,onChange:n,icon:r,isSaving:c=!1})=>{const[l,h]=o.useState(t),u=o.useId(),m=`${u}-label`,d=`${u}-description`,g=async S=>{if(!c){h(S);try{await n(S)}catch(p){h(!S),console.error("Error toggling setting:",p)}}};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:m,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:d,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:c?e.jsx(ee,{size:"md",label:`Saving ${s}`}):e.jsx(ut,{checked:l,onCheckedChange:g,"aria-labelledby":m,"aria-describedby":a?d:void 0})})]})};var xr=Qt({chartName:"LineChart",GraphicalChild:bt,axisComponents:[{axisType:"xAxis",AxisComp:Wt},{axisType:"yAxis",AxisComp:Jt}],formatAxisMap:Xt});function Qe(t,s){const a=ea(t,s?.in);if(!ta(a))throw new RangeError("Invalid time value");const n=ue(a.getDate(),2),r=ue(a.getMonth()+1,2),c=a.getFullYear(),l=ue(a.getHours(),2),h=ue(a.getMinutes(),2),u=ue(a.getSeconds(),2);let m="",d="";const g=a.getTimezoneOffset();if(g!==0){const S=Math.abs(g),p=ue(Math.trunc(S/60),2),k=ue(S%60,2);d=`${g<0?"+":"-"}${p}:${k}`}else d="Z";return`${c}-${r}-${n}T${l}:${h}:${u}${m}${d}`}function gr(t,s,a){return Qa(t,-30,a)}const yr=["radient","creditBalance"],vr=t=>{const{user:s,isAuthenticated:a}=Oe(),n=s?.account?.tenant_id,r=a&&!!n&&t?.enabled;return ge({queryKey:[yr,n],queryFn:async()=>{if(!n)throw new Error("Tenant ID not available");const c=await jt({operation:"credits",tenantId:n});if(!c||typeof c.balance!="number")throw new Error("Invalid credit balance response format");return c},enabled:r,staleTime:5*60*1e3,refetchOnWindowFocus:!0})};function kr(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}const br=["radient","usageRollup"],jr=(t,s)=>{const{user:a,isAuthenticated:n}=Oe(),r=a?.account?.tenant_id,c=n&&!!r&&s?.enabled;return ge({queryKey:[...br,r,t],queryFn:async()=>{if(!r)throw new Error("Tenant ID not available");const l={};for(const[u,m]of Object.entries(t))m!=null&&(l[u]=String(m));const h=await jt({operation:"usage",tenantId:r,query:l});if(!h)throw new Error("Invalid usage rollup response format");return h},enabled:c,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},wr=()=>e.jsx(mr,{}),Nr=t=>{if(!t)return null;try{return new URL(t).host}catch{return null}},_r=()=>{const[t,s]=o.useState("Loading..."),[a,n]=o.useState({value:"Loading...",detail:null,degraded:!1}),[r,c]=o.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});o.useEffect(()=>{let h=!0;const u=p=>{if(!h)return;const k=Nr(p.url);if(p.state==="connecting"){n({value:"Loading...",detail:null,degraded:!1});return}if(p.state==="detached"){n({value:"Not connected",detail:p.detail||null,degraded:!1});return}if(p.state==="wedged"){n({value:"Not attached",detail:p.detail||null,degraded:!1});return}const A=p.version||"Version unknown";n({value:k?`${A} · ${k}`:A,detail:p.detail||null,degraded:p.state==="degraded"})};let m=!1;const d=window.api?.backend?.onStatusChange(p=>{m=!0,u(p)}),g=async()=>{try{const[p,k]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);h&&(s(p),c(k))}catch(p){console.error("Error fetching app information:",p)}},S=async()=>{try{const p=window.api?.backend;if(p){const E=await p.getStatus();m||u(E);return}const k=await Ke.healthCheck(Fe.baseUrl),A=Ke.getServerVersion(k);h&&n({value:A,detail:null,degraded:!1})}catch(p){console.error("Error fetching server version:",p),h&&n({value:"Unavailable",detail:null,degraded:!1})}};return g(),S(),()=>{h=!1,d?.()}},[]);const l=(h,u,m,d={})=>e.jsx(Z,{label:e.jsx(_e,{content:m,children:e.jsxs("span",{className:"inline-flex cursor-help items-center gap-1.5",children:[e.jsx(Ie,{size:12,className:"shrink-0"}),h]})}),valueClassName:d.valueClassName,value:e.jsxs(e.Fragment,{children:[d.valueTooltip?e.jsx(_e,{content:d.valueTooltip,children:e.jsx("span",{"data-backend-version":d.valueHoverTarget?"":void 0,className:"cursor-help",children:u})}):u,d.statusNote?e.jsx("span",{className:"mt-0.5 block text-meta text-ink-dim",children:d.statusNote}):null]})});return e.jsx(B,{title:"Application updates and info",icon:aa,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(qe,{children:[l("Application version",t,"The version of the Local Operator user interface application."),l("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}),l("Platform",`${r.platform} (${r.arch})`,"The operating system and architecture your application is running on."),l("Node.js version",r.nodeVersion,"The JavaScript runtime environment version."),l("Electron version",r.electronVersion,"The framework version enabling this desktop application.")]}),e.jsx(wr,{})]})})},Sr={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"},Cr={model:"core",approvals:"core",web_tools:"core",desktop:"advanced"};function me(t){return t.tier==="core"||t.tier==="advanced"?t.tier:Sr[t.key]??Cr[t.section]??"advanced"}function Mr(t){return t.length===0?!1:t.filter(a=>me(a)==="core").length*2>=t.length}function Ar(t,s,a){return s?{layout:null,filter:t?[]:[...a]}:{layout:{opened:t?[...a]:[],closed:t?[]:[...a]},filter:[]}}const It="__cascade__";function xe(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function ce(t){return{value:t.kind==="list"?(t.value??[]).join(`
306
+ */const lr=[["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"}]],dr=f("wind",lr);/**
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 ur=[["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"}]],mr=f("zap",ur),hr=()=>{const t="https://local-operator.com/download",[s,a]=o.useState(!1),[n,r]=o.useState(!1),[c,l]=o.useState(null),[h,u]=o.useState("info"),[m,d]=o.useState(null),[g,S]=o.useState(null),p=o.useRef(!1),k=o.useRef(!1),A=o.useRef(0),E=o.useRef(!1),R=o.useCallback((T,C)=>{k.current=!1,l(T),u(C),r(!0)},[]),$=o.useCallback(T=>{k.current=!0,l(T),u("success"),r(!0)},[]),y=o.useCallback(()=>{k.current&&(k.current=!1,r(!1),l(null))},[]),{clearDeferredUpdate:F}=Vt();o.useEffect(()=>{const T=window.api.updater.onUpdateError(G=>{p.current&&G.includes("manually")&&(d({message:"The server is installed outside the app, so use the tool you installed it with - uv, pipx or pip.",command:""}),k.current=!1,l(null),u("warning"),r(!0))}),C=window.api.updater.onBackendUpdateDevMode(G=>{p.current&&R(G,"info")}),b=()=>{E.current=!0,y()},D=window.api.updater.onUpdateAvailable(b),j=window.api.updater.onUpdateNpxAvailable(b),Q=window.api.updater.onBackendUpdateAvailable(b);return()=>{T(),C(),D(),j(),Q()}},[y,R]),o.useEffect(()=>{let T=!1;const C=()=>{window.api.updater.getLastInstallAttempt().then(D=>{T||S(D)}).catch(()=>{})};C();const b=window.api.updater.onUpdateInstallFailed(()=>C());return()=>{T=!0,b()}},[]);const L=async()=>{const T=++A.current;y(),E.current=!1;try{a(!0),p.current=!0,F(Ge.UI),F(Ge.BACKEND);const C=await window.api.updater.checkForAllUpdates({manual:!0});if(T!==A.current)return;C?.affirmation&&!E.current?$(C.affirmation):y()}catch(C){if(T!==A.current)return;console.warn(`Update check failed; the app-level alert owns the report: ${Gt(C)}`)}finally{T===A.current&&a(!1),setTimeout(()=>{p.current=!1},2e3)}},P=()=>{k.current=!1,r(!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)`:"",". Version ",g.runningVersion," is running."]}),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(M,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>void window.api.openExternal(t),children:"Download a fresh copy"})]}),e.jsxs(M,{variant:"outline",onClick:()=>void L(),disabled:s,children:[s?e.jsx(ee,{size:"sm"}):null,s?"Checking...":"Check for updates"]}),m&&e.jsxs(Ve,{open:n,autoHideDuration:1e4,onClose:P,variant:"warning",children:[e.jsx("p",{className:"text-body-sm",children:m.message}),m.command&&e.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:m.command})]}),c&&h!=="danger"&&e.jsx(Ve,{open:n,autoHideDuration:6e3,onClose:P,variant:h,children:c})]})},we=["system-prompt"],pr=()=>{const{shouldEnableQuery:t}=Kt();return ge({enabled:t({bypassInternetCheck:!0}),queryKey:we,queryFn:async()=>{try{const a=await yt(Fe.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 vt(a),s}},refetchOnWindowFocus:!1,staleTime:5e3})},fr=()=>{const t=kt(),s=yt(Fe.baseUrl);return Yt({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 vt(r),n}},onSuccess:async a=>{await t.invalidateQueries({queryKey:we,refetchType:"none"}),t.setQueryData(we,n=>n&&{...n,...a}),await t.refetchQueries({queryKey:we,type:"all"}),Zt("System prompt updated")},onError:a=>{console.error("Error updating system prompt:",a)}})},xr=({value:t,label:s,description:a,onChange:n,icon:r,isSaving:c=!1})=>{const[l,h]=o.useState(t),u=o.useId(),m=`${u}-label`,d=`${u}-description`,g=async S=>{if(!c){h(S);try{await n(S)}catch(p){h(!S),console.error("Error toggling setting:",p)}}};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:m,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:d,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:c?e.jsx(ee,{size:"md",label:`Saving ${s}`}):e.jsx(ut,{checked:l,onCheckedChange:g,"aria-labelledby":m,"aria-describedby":a?d:void 0})})]})};var gr=Qt({chartName:"LineChart",GraphicalChild:bt,axisComponents:[{axisType:"xAxis",AxisComp:Wt},{axisType:"yAxis",AxisComp:Jt}],formatAxisMap:Xt});function Qe(t,s){const a=ea(t,s?.in);if(!Ka(a))throw new RangeError("Invalid time value");const n=ue(a.getDate(),2),r=ue(a.getMonth()+1,2),c=a.getFullYear(),l=ue(a.getHours(),2),h=ue(a.getMinutes(),2),u=ue(a.getSeconds(),2);let m="",d="";const g=a.getTimezoneOffset();if(g!==0){const S=Math.abs(g),p=ue(Math.trunc(S/60),2),k=ue(S%60,2);d=`${g<0?"+":"-"}${p}:${k}`}else d="Z";return`${c}-${r}-${n}T${l}:${h}:${u}${m}${d}`}function yr(t,s,a){return Ya(t,-30,a)}const vr=["radient","creditBalance"],kr=t=>{const{user:s,isAuthenticated:a}=Oe(),n=s?.account?.tenant_id,r=a&&!!n&&t?.enabled;return ge({queryKey:[vr,n],queryFn:async()=>{if(!n)throw new Error("Tenant ID not available");const c=await jt({operation:"credits",tenantId:n});if(!c||typeof c.balance!="number")throw new Error("Invalid credit balance response format");return c},enabled:r,staleTime:5*60*1e3,refetchOnWindowFocus:!0})};function br(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}const jr=["radient","usageRollup"],wr=(t,s)=>{const{user:a,isAuthenticated:n}=Oe(),r=a?.account?.tenant_id,c=n&&!!r&&s?.enabled;return ge({queryKey:[...jr,r,t],queryFn:async()=>{if(!r)throw new Error("Tenant ID not available");const l={};for(const[u,m]of Object.entries(t))m!=null&&(l[u]=String(m));const h=await jt({operation:"usage",tenantId:r,query:l});if(!h)throw new Error("Invalid usage rollup response format");return h},enabled:c,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},Nr=()=>e.jsx(hr,{}),_r=t=>{if(!t)return null;try{return new URL(t).host}catch{return null}},Sr=()=>{const[t,s]=o.useState("Loading..."),[a,n]=o.useState({value:"Loading...",detail:null,degraded:!1}),[r,c]=o.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});o.useEffect(()=>{let h=!0;const u=p=>{if(!h)return;const k=_r(p.url);if(p.state==="connecting"){n({value:"Loading...",detail:null,degraded:!1});return}if(p.state==="detached"){n({value:"Not connected",detail:p.detail||null,degraded:!1});return}if(p.state==="wedged"){n({value:"Not attached",detail:p.detail||null,degraded:!1});return}const A=p.version||"Version unknown";n({value:k?`${A} · ${k}`:A,detail:p.detail||null,degraded:p.state==="degraded"})};let m=!1;const d=window.api?.backend?.onStatusChange(p=>{m=!0,u(p)}),g=async()=>{try{const[p,k]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);h&&(s(p),c(k))}catch(p){console.error("Error fetching app information:",p)}},S=async()=>{try{const p=window.api?.backend;if(p){const E=await p.getStatus();m||u(E);return}const k=await Ke.healthCheck(Fe.baseUrl),A=Ke.getServerVersion(k);h&&n({value:A,detail:null,degraded:!1})}catch(p){console.error("Error fetching server version:",p),h&&n({value:"Unavailable",detail:null,degraded:!1})}};return g(),S(),()=>{h=!1,d?.()}},[]);const l=(h,u,m,d={})=>e.jsx(Z,{label:e.jsx(_e,{content:m,children:e.jsxs("span",{className:"inline-flex cursor-help items-center gap-1.5",children:[e.jsx(Ie,{size:12,className:"shrink-0"}),h]})}),valueClassName:d.valueClassName,value:e.jsxs(e.Fragment,{children:[d.valueTooltip?e.jsx(_e,{content:d.valueTooltip,children:e.jsx("span",{"data-backend-version":d.valueHoverTarget?"":void 0,className:"cursor-help",children:u})}):u,d.statusNote?e.jsx("span",{className:"mt-0.5 block text-meta text-ink-dim",children:d.statusNote}):null]})});return e.jsx(H,{title:"Application updates and info",icon:ta,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(qe,{children:[l("Application version",t,"The version of the Local Operator user interface application."),l("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}),l("Platform",`${r.platform} (${r.arch})`,"The operating system and architecture your application is running on."),l("Node.js version",r.nodeVersion,"The JavaScript runtime environment version."),l("Electron version",r.electronVersion,"The framework version enabling this desktop application.")]}),e.jsx(Nr,{})]})})},Cr={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"},Mr={model:"core",approvals:"core",web_tools:"core",desktop:"advanced"};function me(t){return t.tier==="core"||t.tier==="advanced"?t.tier:Cr[t.key]??Mr[t.section]??"advanced"}function Ar(t){return t.length===0?!1:t.filter(a=>me(a)==="core").length*2>=t.length}function Er(t,s,a){return s?{layout:null,filter:t?[]:[...a]}:{layout:{opened:t?[...a]:[],closed:t?[]:[...a]},filter:[]}}const It="__cascade__";function xe(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function ce(t){return{value:t.kind==="list"?(t.value??[]).join(`
307
312
  `):t.kind==="cascade"?It:xe(t.value),cascadeBase:null}}function Ne(t,s){return s.cascadeBase!==null?!0:t.kind==="cascade"?s.value!==It:t.kind==="list"?s.value!==t.value?.join(`
308
- `):s.value!==xe(t.value)}function Er(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(c=>xe(c.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[c,l]of Object.entries(s.cascadeBase))r[c]=l;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 Tr={hosting:"provider",model_name:"model","subagents.models.lo":"provider-model","subagents.models.med":"provider-model","subagents.models.hi":"provider-model"};function Rr(t){return Tr[t]??null}const Lr={provider:"Search providers",model:"Search models","provider-model":"Search models"},Ir="Sign-in state unknown",zr="Current value",$r="Signed in",Dr="Needs sign-in",He=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),We=["Ready to use","Needs a running server","Needs sign-in"];function Fr(t){const s=new Map(We.map(a=>[a,[]]));for(const a of t){const n=sa(a),r=s.get(n.group);r&&r.push({id:a.id,name:a.name,description:n.label,group:n.group})}return We.flatMap(a=>s.get(a)??[])}function Je(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 Or(t,s){const a=new Map;for(const n of t){const r=s(n),c=a.get(r);c?c.push(n):a.set(r,[n])}return a}function Pr(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(c=>c.provider===n);return r.length>0?r:a}function Ur(t,s){const a=t?.credentials_known!==!1,n=Pr(t,s),r=u=>a?u.connected?$r:Dr:Ir,c=u=>s.kind==="provider-model"?u.provider:r(u),l=s.kind==="provider-model"?n:[...n].sort((u,m)=>Je(u,m,s.hosting)),h=[];for(const[,u]of Or(l,c)){const m=s.kind==="provider-model"?[...u].sort((d,g)=>Je(d,g,s.hosting)):u;for(const d of m)h.push({id:s.kind==="model"?d.model_id:d.selector,name:d.selector,description:s.kind==="provider-model"?a?d.connected?"Signed in":"Needs sign-in":void 0:`${s.providerNames?.[d.provider]??He(d.provider)}${d.aggregated?", aggregated":""}${a&&!d.connected?", no credential":""}`,group:c(d)})}return h.push(...Hr(n,t,s)),h}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??He(a);return n.some(l=>l.provider===a)?`Models for ${r}`:`No models listed for ${r}. Showing all models.`}function Hr(t,s,a){const n=a.current.trim();if(!n)return[];const r=l=>a.kind==="model"?l.model_id:l.selector;if(t.some(l=>r(l)===n))return[];const c=(s?.models??[]).find(l=>r(l)===n);return[{id:n,name:c?.selector??n,description:c?`${a.providerNames?.[c.provider]??He(c.provider)}${s?.credentials_known===!1?"":c.connected?", signed in":", no credential"}`:a.kind==="model"?"Custom model":"Custom value",group:zr}]}function Br(t,s,a){const n=s.trim();if(!n)return null;const r=t.filter(c=>c.id===n);if(a){const c=r.find(l=>l.name===a);if(c)return c}return r[0]??{id:n,name:n}}const Xe=t=>`setting-help-${t}`,Vr=({setting:t,kind:s,value:a,disabled:n=!1,onValueChange:r,effectiveHosting:c,helpId:l})=>{const h=Pe(),u=Ce(h.data,"auth"),m=na(u),d=s!=="provider"&&Ce(h.data,"catalogues"),[g,S]=o.useState(!1),[p,k]=o.useState(void 0),A=ge({queryKey:["desktop","models",!1],queryFn:()=>fe({op:"models.catalogue",live:!1}),enabled:d&&g,staleTime:6e4}),E=o.useMemo(()=>Object.fromEntries((m.data??[]).map(C=>[C.id,C.name])),[m.data]),R=o.useMemo(()=>s==="provider"?m.data?Fr(m.data):[]:Ur(A.data,{kind:s,hosting:s==="model"?c:"",current:a,providerNames:E}),[s,m.data,A.data,c,a,E]),$=ra(A.data,A,C=>Ue("Could not list models.",C)),y=$.loadError?e.jsx("span",{className:"text-danger",children:$.loadError}):$.notice,F=$.noticeDetail?{title:$.noticeDetail}:{},L=Br(R,a,p),P=o.useMemo(()=>s==="provider"?null:qr({kind:s,hosting:s==="model"?c:"",hostingLabel:m.data?.find(C=>C.id===c)?.name},A.data),[s,c,m.data,A.data]),T=o.useMemo(()=>s==="provider"?m.isError?"Could not list providers":u?"No providers":"Provider list unavailable":$.loadError?"Could not list models":d?"Nothing matches that model":"Model list unavailable",[s,m.isError,u,$.loadError,d]);return e.jsx($t,{showLabel:!1,ariaLabel:t.label,ariaDescribedBy:l,label:t.label,placeholder:Lr[s],options:R,selected:L,disabled:n,busy:s==="provider"?m.isFetching:A.isFetching,busyLabel:s==="provider"?"Loading providers":"Loading models",onOpenChange:C=>{C&&S(!0)},onSelect:C=>{k(C.name),r(C.id)},onCustomSubmit:C=>r(C),customRowLabel:C=>`Use "${C}"`,listNotice:P,onClear:()=>r(""),emptyText:T,helperText:y?e.jsx("span",{...F,children:y}):void 0})},et={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 Gr(t){return et[t]??et.text}const Kr={" ":"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"},Yr=new Set(["Control","Shift","Alt","Meta","AltGraph"]),Zr=new Set(["Escape","Esc","Enter"]);function Qr(t){if(Yr.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=Kr[t.key]??t.key.toLowerCase();return a?[...s,a].join("+"):""}const Wr=({value:t,label:s,disabled:a,onChange:n})=>e.jsxs("span",{className:"flex w-full flex-col gap-0.5",children:[e.jsx(oe,{readOnly:!0,value:t,disabled:a,"aria-label":`${s}: press the key you want`,className:"font-mono text-body-sm",onKeyDown:r=>{if(Zr.has(r.key)){r.currentTarget.blur();return}const c=Qr(r);c&&(r.preventDefault(),n(c))}}),e.jsx("span",{className:"text-meta text-ink-dim",children:"Press the keys you want; Esc cancels."})]}),Jr=({setting:t,value:s,chains:a,disabled:n=!1,onValueChange:r,onChainsChange:c,effectiveHosting:l="",helpId:h})=>{const u=Rr(t.key);if(u)return e.jsx(Vr,{setting:t,kind:u,value:s,disabled:n,onValueChange:r,effectiveHosting:l,helpId:h});switch(t.kind){case"bool":return e.jsx(ut,{checked:s==="true",disabled:n,onCheckedChange:m=>r(m?"true":"false"),"aria-label":t.label});case"enum":return e.jsxs(mt,{value:s,disabled:n,onValueChange:r,children:[e.jsx(ht,{"aria-label":t.label,className:"w-full",children:e.jsx(pt,{})}),e.jsx(ft,{children:t.choices.map(m=>e.jsx($e,{value:xe(m.value),title:m.description||void 0,children:m.label},xe(m.value)))})]});case"int":case"float":return e.jsx(oe,{type:"number",value:s,disabled:n,min:t.minimum??void 0,max:t.maximum??void 0,step:t.kind==="int"?1:"any",onChange:m=>r(m.target.value),"aria-label":t.label});case"hotkey":return e.jsx(Wr,{value:s,label:t.label,disabled:n,onChange:r});case"list":return e.jsx(ze,{value:s,disabled:n,rows:Math.min(6,t.members.length+2),onChange:m=>r(m.target.value),"aria-label":t.label,placeholder:t.placeholder,className:"font-mono text-body-sm"});case"cascade":{const m=a??t.value??{};return e.jsxs("div",{className:"flex flex-col gap-3",children:[Object.entries(m).map(([d,g])=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"font-mono text-meta text-ink-dim",children:d}),e.jsx(ze,{value:g.join(`
313
+ `):s.value!==xe(t.value)}function Tr(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(c=>xe(c.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[c,l]of Object.entries(s.cascadeBase))r[c]=l;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 Rr={hosting:"provider",model_name:"model","subagents.models.lo":"provider-model","subagents.models.med":"provider-model","subagents.models.hi":"provider-model"};function Lr(t){return Rr[t]??null}const Ir={provider:"Search providers",model:"Search models","provider-model":"Search models"},zr="Sign-in state unknown",$r="Current value",Dr="Signed in",Fr="Needs sign-in",Be=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),We=["Ready to use","Needs a running server","Needs sign-in"];function Or(t){const s=new Map(We.map(a=>[a,[]]));for(const a of t){const n=aa(a),r=s.get(n.group);r&&r.push({id:a.id,name:a.name,description:n.label,group:n.group})}return We.flatMap(a=>s.get(a)??[])}function Je(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 Pr(t,s){const a=new Map;for(const n of t){const r=s(n),c=a.get(r);c?c.push(n):a.set(r,[n])}return a}function Ur(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(c=>c.provider===n);return r.length>0?r:a}function qr(t,s){const a=t?.credentials_known!==!1,n=Ur(t,s),r=u=>a?u.connected?Dr:Fr:zr,c=u=>s.kind==="provider-model"?u.provider:r(u),l=s.kind==="provider-model"?n:[...n].sort((u,m)=>Je(u,m,s.hosting)),h=[];for(const[,u]of Pr(l,c)){const m=s.kind==="provider-model"?[...u].sort((d,g)=>Je(d,g,s.hosting)):u;for(const d of m)h.push({id:s.kind==="model"?d.model_id:d.selector,name:d.selector,description:s.kind==="provider-model"?a?d.connected?"Signed in":"Needs sign-in":void 0:`${s.providerNames?.[d.provider]??Be(d.provider)}${d.aggregated?", aggregated":""}${a&&!d.connected?", no credential":""}`,group:c(d)})}return h.push(...Hr(n,t,s)),h}function Br(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(l=>l.provider===a)?`Models for ${r}`:`No models listed for ${r}. Showing all models.`}function Hr(t,s,a){const n=a.current.trim();if(!n)return[];const r=l=>a.kind==="model"?l.model_id:l.selector;if(t.some(l=>r(l)===n))return[];const c=(s?.models??[]).find(l=>r(l)===n);return[{id:n,name:c?.selector??n,description:c?`${a.providerNames?.[c.provider]??Be(c.provider)}${s?.credentials_known===!1?"":c.connected?", signed in":", no credential"}`:a.kind==="model"?"Custom model":"Custom value",group:$r}]}function Vr(t,s,a){const n=s.trim();if(!n)return null;const r=t.filter(c=>c.id===n);if(a){const c=r.find(l=>l.name===a);if(c)return c}return r[0]??{id:n,name:n}}const Xe=t=>`setting-help-${t}`,Gr=({setting:t,kind:s,value:a,disabled:n=!1,onValueChange:r,effectiveHosting:c,helpId:l})=>{const h=Pe(),u=Ce(h.data,"auth"),m=sa(u),d=s!=="provider"&&Ce(h.data,"catalogues"),[g,S]=o.useState(!1),[p,k]=o.useState(void 0),A=ge({queryKey:["desktop","models",!1],queryFn:()=>fe({op:"models.catalogue",live:!1}),enabled:d&&g,staleTime:6e4}),E=o.useMemo(()=>Object.fromEntries((m.data??[]).map(C=>[C.id,C.name])),[m.data]),R=o.useMemo(()=>s==="provider"?m.data?Or(m.data):[]:qr(A.data,{kind:s,hosting:s==="model"?c:"",current:a,providerNames:E}),[s,m.data,A.data,c,a,E]),$=na(A.data,A,C=>Ue("Could not list models.",C)),y=$.loadError?e.jsx("span",{className:"text-danger",children:$.loadError}):$.notice,F=$.noticeDetail?{title:$.noticeDetail}:{},L=Vr(R,a,p),P=o.useMemo(()=>s==="provider"?null:Br({kind:s,hosting:s==="model"?c:"",hostingLabel:m.data?.find(C=>C.id===c)?.name},A.data),[s,c,m.data,A.data]),T=o.useMemo(()=>s==="provider"?m.isError?"Could not list providers":u?"No providers":"Provider list unavailable":$.loadError?"Could not list models":d?"Nothing matches that model":"Model list unavailable",[s,m.isError,u,$.loadError,d]);return e.jsx($t,{showLabel:!1,ariaLabel:t.label,ariaDescribedBy:l,label:t.label,placeholder:Ir[s],options:R,selected:L,disabled:n,busy:s==="provider"?m.isFetching:A.isFetching,busyLabel:s==="provider"?"Loading providers":"Loading models",onOpenChange:C=>{C&&S(!0)},onSelect:C=>{k(C.name),r(C.id)},onCustomSubmit:C=>r(C),customRowLabel:C=>`Use "${C}"`,listNotice:P,onClear:()=>r(""),emptyText:T,helperText:y?e.jsx("span",{...F,children:y}):void 0})},et={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 Kr(t){return et[t]??et.text}const Yr={" ":"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"},Zr=new Set(["Control","Shift","Alt","Meta","AltGraph"]),Qr=new Set(["Escape","Esc","Enter"]);function Wr(t){if(Zr.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=Yr[t.key]??t.key.toLowerCase();return a?[...s,a].join("+"):""}const Jr=({value:t,label:s,disabled:a,onChange:n})=>e.jsxs("span",{className:"flex w-full flex-col gap-0.5",children:[e.jsx(oe,{readOnly:!0,value:t,disabled:a,"aria-label":`${s}: press the key you want`,className:"font-mono text-body-sm",onKeyDown:r=>{if(Qr.has(r.key)){r.currentTarget.blur();return}const c=Wr(r);c&&(r.preventDefault(),n(c))}}),e.jsx("span",{className:"text-meta text-ink-dim",children:"Press the keys you want; Esc cancels."})]}),Xr=({setting:t,value:s,chains:a,disabled:n=!1,onValueChange:r,onChainsChange:c,effectiveHosting:l="",helpId:h})=>{const u=Lr(t.key);if(u)return e.jsx(Gr,{setting:t,kind:u,value:s,disabled:n,onValueChange:r,effectiveHosting:l,helpId:h});switch(t.kind){case"bool":return e.jsx(ut,{checked:s==="true",disabled:n,onCheckedChange:m=>r(m?"true":"false"),"aria-label":t.label});case"enum":return e.jsxs(mt,{value:s,disabled:n,onValueChange:r,children:[e.jsx(ht,{"aria-label":t.label,className:"w-full",children:e.jsx(pt,{})}),e.jsx(ft,{children:t.choices.map(m=>e.jsx($e,{value:xe(m.value),title:m.description||void 0,children:m.label},xe(m.value)))})]});case"int":case"float":return e.jsx(oe,{type:"number",value:s,disabled:n,min:t.minimum??void 0,max:t.maximum??void 0,step:t.kind==="int"?1:"any",onChange:m=>r(m.target.value),"aria-label":t.label});case"hotkey":return e.jsx(Jr,{value:s,label:t.label,disabled:n,onChange:r});case"list":return e.jsx(ze,{value:s,disabled:n,rows:Math.min(6,t.members.length+2),onChange:m=>r(m.target.value),"aria-label":t.label,placeholder:t.placeholder,className:"font-mono text-body-sm"});case"cascade":{const m=a??t.value??{};return e.jsxs("div",{className:"flex flex-col gap-3",children:[Object.entries(m).map(([d,g])=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"font-mono text-meta text-ink-dim",children:d}),e.jsx(ze,{value:g.join(`
310
315
  `),disabled:n,rows:Math.max(2,g.length+1),onChange:S=>c?.({...m,[d]:S.target.value.split(`
311
- `).map(p=>p.trim()).filter(Boolean)}),"aria-label":`${t.label}: ${d}`,className:"font-mono text-body-sm"})]},d)),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(oe,{value:s,disabled:n,onChange:m=>r(m.target.value),"aria-label":t.label,placeholder:t.placeholder})}},zt=({className:t})=>e.jsx("span",{role:"img","aria-label":"Changed from the default",title:"Changed from the default",className:X("size-1.5 shrink-0 rounded-full bg-accent",t)}),Xr=({title:t,rowCount:s,advancedCount:a,scope:n,modified:r,onOpenChange:c,defaultOpen:l=!1})=>e.jsx("div",{"data-section-header":t,className:"flex w-full flex-col",children:e.jsx(wt,{defaultOpen:l,onOpenChange:c,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(zt,{className:"ml-auto"})]})})}),eo="size-3.5 shrink-0",to=({setting:t,draft:s,tier:a,gate:n,saving:r,error:c,onDraftChange:l,onSave:h,onReset:u,effectiveHosting:m=""})=>{const d=!!(n&&!n.on),g=Ne(t,s),S=r||d,p=t.kind==="list"||t.kind==="cascade",k=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})]}),A=d&&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:X("flex min-w-44 flex-col gap-0.5",p?"shrink-0 basis-2/5":"flex-1"),children:[a==="advanced"&&t.help?e.jsx(wt,{summary:k,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:eo}),k]}),a==="core"&&t.help&&e.jsx("p",{id:Xe(t.key),className:"ml-5 text-meta text-ink-dim",children:t.help}),A]}),e.jsxs("div",{className:X("flex shrink-0 items-center gap-2 self-center",p&&"min-w-0 flex-1 items-start"),children:[(!t.is_default||g)&&e.jsx(zt,{}),!t.is_default&&t.kind!=="readonly"&&e.jsxs(M,{variant:"ghost",size:"sm",disabled:S,onClick:u,"aria-label":`Use default for ${t.label}`,children:[e.jsx(sr,{"aria-hidden":"true"}),"Use default"]}),g&&e.jsx(M,{variant:"primary",size:"sm",disabled:S,onClick:h,children:r?"Saving":"Save"}),e.jsx("div",{className:Gr(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:xe(t.value)||"Not set"}):e.jsx(Jr,{setting:t,value:s.value,chains:s.cascadeBase??void 0,disabled:S,effectiveHosting:m,helpId:a==="core"&&t.help?Xe(t.key):void 0,onValueChange:E=>l({...s,value:E}),onChainsChange:E=>l({...s,cascadeBase:E})})})]}),c&&e.jsx(V,{variant:"danger",role:"alert",className:"w-full",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:c}),e.jsxs(M,{variant:"secondary",size:"sm",disabled:r,onClick:h,children:[e.jsx(oa,{"aria-hidden":"true"}),"Retry"]})]})})]})})},ao="w-full max-w-[400px]",so=({query:t,onQueryChange:s,matchCount:a,matchSections:n,coreCount:r,advancedCount:c,modifiedCount:l,modifiedOnly:h,onModifiedOnlyChange:u,showAdvanced:m,onShowAdvancedChange:d,onExpandAll:g,onCollapseAll:S,unsavedCount:p,savingAll:k,onSaveAll:A,onDiscardAll:E})=>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:X("relative",ao),children:[e.jsx(Nt,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-ink-dim","aria-hidden":"true"}),e.jsx(oe,{value:t,onChange:R=>s(R.target.value),onKeyDown:R=>{R.key==="Escape"&&t&&s("")},placeholder:"Search settings by name, description or key","aria-label":"Search settings",className:"pl-9"}),t&&e.jsx(M,{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(Dt,{"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(M,{variant:"ghost",size:"sm","aria-pressed":h,onClick:()=>u(!h),className:X(h&&"bg-surface text-ink hover:bg-surface"),children:["Modified",e.jsx(Se,{variant:"neutral",children:l})]}),e.jsx(M,{variant:"ghost",size:"sm","aria-pressed":m,onClick:()=>d(!m),className:X(m&&"bg-surface text-ink hover:bg-surface"),children:"Show advanced"})]})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[p>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-meta text-ink-dim",children:p===1?"1 unsaved change":`${p} unsaved changes`}),e.jsx(M,{variant:"primary",size:"sm",disabled:k,onClick:A,children:k?"Saving":"Save all"}),e.jsx(M,{variant:"ghost",size:"sm",disabled:k,onClick:E,children:"Discard all"})]}),e.jsx(M,{variant:"ghost",size:"sm",onClick:g,children:"Expand all"}),e.jsx(M,{variant:"ghost",size:"sm",onClick:S,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"}`:h?`${l} modified ${l===1?"setting":"settings"}`:m?`${c} advanced settings shown — Expand all to see them`:`${r} core settings, ${c} advanced`})]}),no={all:["desktop","settings"]},ro={live:"Takes effect immediately","new launch":"Takes effect the next time the app starts","new sessions":"Takes effect for new conversations"},oo=40,pe=t=>t.toLowerCase().replace(/[-_.]/g," "),io=({focusKey:t,initialFilter:s=""})=>{const a=Pe(),n=Ce(a.data,"settings"),[r,c]=o.useState(s),[l,h]=o.useState(!1),[u,m]=o.useState(!1),[d,g]=o.useState({}),[S,p]=o.useState({}),[k,A]=o.useState({}),[E,R]=o.useState(!1),[$,y]=o.useState(new Set),[F,L]=o.useState(new Set),[P,T]=o.useState(new Set),C=o.useRef(null),b=o.useRef(null),D=ge({queryKey:no.all,queryFn:()=>fe({op:"settings.list"}),enabled:n,staleTime:1e4}),j=D.data;o.useEffect(()=>{j&&g(i=>{let x=!1;const w={...i};for(const _ of j.settings){const O=i[_.key];if(!O){w[_.key]=ce(_),x=!0;continue}if(Ne(_,O))continue;const z=ce(_);(z.value!==O.value||z.cascadeBase!==O.cascadeBase)&&(w[_.key]=z,x=!0)}return x?w:i})},[j]);const Q=o.useCallback(i=>!i.is_default||Ne(i,d[i.key]??ce(i)),[d]),G=o.useMemo(()=>{const i=(j?.settings??[]).find(x=>x.key==="hosting");return i?(d.hosting??ce(i)).value:""},[j,d]),te=o.useMemo(()=>{if(!j)return[];const i=pe(r.trim()),x=i.length>0||u;return j.settings.filter(w=>!x&&me(w)==="advanced"&&!l||u&&!Q(w)?!1:i?pe([w.label,w.help,w.key,w.section,w.warning??""].join(" ")).includes(i):!0)},[j,r,l,u,Q]),K=r.trim().length>0||u,v=o.useMemo(()=>j?.sections??[],[j]),Y=o.useCallback(i=>(j?.settings??[]).filter(x=>x.section===i),[j]),ae=i=>te.filter(x=>x.section===i),W=i=>$.has(i)?!0:F.has(i)?!1:Mr(Y(i)),N=(i,x)=>{y(w=>{const _=new Set(w);return x?_.add(i):_.delete(i),_}),L(w=>{const _=new Set(w);return x?_.delete(i):_.add(i),_})},U=(i,x)=>{T(w=>{const _=new Set(w);return x?_.delete(i):_.add(i),_})},I=i=>{const x=v.filter(_=>i||ae(_.name).length>0).map(_=>_.name),w=Ar(i,K,x);w.layout&&(y(new Set(w.layout.opened)),L(new Set(w.layout.closed))),T(new Set(w.filter))};o.useEffect(()=>{r.trim()||T(new Set)},[r]);const se=o.useCallback(i=>{const x=i.gated_by;if(!x||!j)return null;const w=j.settings.find(_=>_.key===x);return{key:x,label:w?.label??x,on:w?.value===!0||w?.value==="true"}},[j]),q=o.useCallback((i,x)=>p(w=>({...w,[i]:x})),[]),H=o.useCallback((i,x)=>A(w=>({...w,[i]:x})),[]),J=o.useCallback(async i=>{const x=d[i.key];if(!x)return!1;const w=Er(i,x);if(!w.ok)return H(i.key,w.error),!1;q(i.key,!0),H(i.key,null);try{await fe(w.request),q(i.key,!1);const O=(await D.refetch()).data?.settings.find(z=>z.key===i.key);return O&&g(z=>{const ye=z[i.key];return ye&&ye.value===x.value&&ye.cascadeBase===x.cascadeBase?{...z,[i.key]:ce(O)}:z}),!0}catch(_){return q(i.key,!1),H(i.key,_ instanceof Error?_.message:"The setting could not be saved."),!1}},[d,D,q,H]),he=o.useCallback(async i=>{q(i.key,!0),H(i.key,null);try{await fe({op:"settings.reset",key:i.key}),g(x=>({...x,[i.key]:ce({...i,value:i.default,is_default:!0})})),q(i.key,!1),await D.refetch()}catch(x){q(i.key,!1),H(i.key,x instanceof Error?x.message:"The setting could not be reset.")}},[D,q,H]),ne=o.useMemo(()=>(j?.settings??[]).filter(i=>Ne(i,d[i.key]??ce(i))),[j,d]),re=async()=>{R(!0);for(const i of ne)await J(i);R(!1)},de=()=>{j&&(g(i=>{const x={...i};for(const w of j.settings)x[w.key]=ce(w);return x}),A({}))};o.useEffect(()=>{if(!t||!j||C.current===t)return;const i=j.settings.find(_=>_.key===t);if(!i)return;C.current=t,me(i)==="advanced"&&h(!0);const x=pe(r.trim());!x||pe([i.label,i.help,i.key,i.section].join(" ")).includes(x)||c(""),m(!1),y(_=>new Set(_).add(i.section)),L(_=>{const O=new Set(_);return O.delete(i.section),O})},[t,j,r]);const ie=o.useMemo(()=>{if(!t||!j)return!1;const i=j.settings.find(w=>w.key===t);if(!i||me(i)==="advanced"&&!l)return!1;const x=pe(r.trim());return x?pe([i.label,i.help,i.key,i.section].join(" ")).includes(x):!0},[t,j,r,l]);if(o.useEffect(()=>{if(!ie||!t||b.current===t)return;let i=0,x=0;const w=()=>{const _=document.querySelector(`[data-setting-key="${CSS.escape(t)}"]`),O=_?.querySelector('[data-setting-control] :is(input, textarea, select, button[role="switch"], button)')??_;if(O){O===_&&(O.tabIndex=-1),O.focus(),O.scrollIntoView({block:"center"}),b.current=t;return}x+=1,x<oo&&(i=requestAnimationFrame(w))};return i=requestAnimationFrame(w),()=>cancelAnimationFrame(i)},[ie,t]),a.data&&!n)return e.jsx(V,{variant:"warning",children:"Searchable settings need a newer Local Operator server. Update the server and restart the app to manage these settings here."});if(D.isLoading||a.isLoading)return e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(ee,{size:"lg",label:"Loading settings"})});const ke=(a.data?null:a.error)??D.error;if(ke||!j){const i=a.isFetching||D.isFetching;return e.jsx(V,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:Ue("Your settings could not be loaded.",ke)}),e.jsx(M,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{a.isError?a.refetch():D.refetch()},disabled:i,children:i?"Retrying":"Retry"})]})})}const be=j.settings.reduce((i,x)=>(i[me(x)]+=1,i),{core:0,advanced:0}),Ae=new Set(te.map(i=>i.section)).size;return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(so,{query:r,onQueryChange:c,matchCount:r.trim()?te.length:null,matchSections:Ae,coreCount:be.core,advancedCount:be.advanced,modifiedCount:j.settings.filter(Q).length,modifiedOnly:u,onModifiedOnlyChange:m,showAdvanced:l,onShowAdvancedChange:h,onExpandAll:()=>I(!0),onCollapseAll:()=>I(!1),unsavedCount:ne.length,savingAll:E,onSaveAll:()=>void re(),onDiscardAll:de}),K&&te.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:v.map(i=>{const x=ae(i.name),w=Y(i.name),_=K?0:w.filter(z=>me(z)==="advanced").length;if(K&&x.length===0)return null;const O=K?x.length>0&&!P.has(i.name):W(i.name);return e.jsxs("section",{"data-settings-section":i.name,"data-open":O,className:"flex flex-col",children:[e.jsx(Xr,{title:i.title,rowCount:x.length,advancedCount:_,scope:ro[i.scope],modified:w.some(Q),defaultOpen:O,onOpenChange:z=>K?U(i.name,z):N(i.name,z)},`${i.name}:${O?"open":"closed"}`),e.jsxs("div",{hidden:!O,className:"flex flex-col pb-3",children:[i.description&&e.jsx("p",{className:"px-1 pb-1 text-meta text-ink-dim",children:i.description}),x.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:_>0?"Advanced settings are hidden here.":"Nothing in this section matches."}),_>0&&e.jsxs(M,{variant:"secondary",size:"sm",onClick:()=>h(!0),children:["Show ",_," advanced"]})]}):x.map(z=>e.jsx(to,{setting:z,draft:d[z.key]??ce(z),tier:me(z),gate:se(z),effectiveHosting:G,saving:!!S[z.key],error:k[z.key]??null,onDraftChange:ye=>g(Be=>({...Be,[z.key]:ye})),onSave:()=>void J(z),onReset:()=>void he(z)},z.key))]})]},i.name)})})]})},tt=({credentialKey:t,isConfigured:s=!1,onEdit:a,onClear:n,onAdd:r})=>{const c=ia(t),l=s?un:Me;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(l,{className:"size-3.5 shrink-0 text-ink-dim"}),c.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:c.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(M,{variant:"ghost",size:"sm",onClick:()=>a?.(t),children:[e.jsx(ca,{}),"Update"]}),e.jsxs(M,{variant:"ghost",size:"sm",className:"text-danger hover:bg-danger-wash hover:text-danger",onClick:()=>n?.(t),children:[e.jsx(_t,{}),"Clear"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>r?.(t),children:[e.jsx(Me,{}),"Configure"]}),c.url&&e.jsx(_e,{content:`Get your ${c.name} key`,children:e.jsx(M,{variant:"ghost",size:"icon-sm",asChild:!0,children:e.jsx("a",{href:c.url,target:"_blank",rel:"noopener noreferrer","aria-label":`Get your ${c.name} key`,children:e.jsx(St,{})})})})]})})]})},Le="_custom_",at="credential-custom-key",st="credential-custom-key-error",nt="credential-type",rt="credential-type-help",ot="credential-value",it="credential-value-help",ct=({open:t,onClose:s,onSave:a,initialKey:n="",existingKeys:r,isSaving:c,isEditMode:l})=>{const[h,u]=o.useState(n),[m,d]=o.useState(""),[g,S]=o.useState(""),[p,k]=o.useState(!1);o.useEffect(()=>{if(t){const b=ve.some(j=>j.key===n),D=!l&&n&&!b;u(b?n:""),d(""),S(D?n:""),k(D||l&&!b)}},[t,n,l]);const A=()=>{let b="";if(l?b=n:b=p?g.trim():h,!b){console.error("No key provided for credential");return}if(!m.trim()){console.error("No value provided for credential");return}a({key:b,value:m})},E=b=>r.includes(b)&&b!==n,R=E(g),$=l?!0:p?g.trim()!==""&&!R:h!==""&&!E(h),y=m.trim()!=="",F=$&&y&&!c,L=ve.find(b=>b.key===h),P=!!L&&!p,T=l?"Update credential":"Add new credential",C=e.jsxs(e.Fragment,{children:[e.jsx(M,{variant:"secondary",onClick:s,children:"Cancel"}),e.jsxs(M,{variant:"primary",onClick:A,disabled:!F,children:[c&&e.jsx(ee,{size:"sm",className:"border-t-on-accent"}),c?"Saving...":"Save"]})]});return e.jsx(la,{open:t,onClose:s,title:T,actions:C,maxWidth:"sm",fullWidth:!0,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[l?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(le,{htmlFor:nt,children:"Credential type"}),e.jsxs(mt,{value:p?Le:h,onValueChange:b=>{b===Le?(k(!0),u("")):(k(!1),u(b),S(""))},children:[e.jsx(ht,{id:nt,"aria-describedby":P?rt:void 0,children:e.jsx(pt,{placeholder:"Select a credential type"})}),e.jsxs(ft,{children:[ve.filter(b=>!b.internal).map(b=>e.jsxs($e,{value:b.key,disabled:E(b.key),children:[b.name,E(b.key)&&" (configured)"]},b.key)),e.jsx($e,{value:Le,children:"Custom credential"})]})]}),P&&L&&e.jsxs("div",{id:rt,className:"flex flex-col items-start gap-1",children:[e.jsx("p",{className:"text-meta text-ink-dim",children:L.description}),L.url&&e.jsxs("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent text-meta underline-offset-4 hover:text-accent-hover hover:underline",children:["Get your ",L.name," key"]})]})]}),p&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(le,{htmlFor:at,children:"Custom credential key"}),e.jsx(oe,{id:at,value:g,onChange:b=>S(b.target.value),"aria-invalid":R||void 0,"aria-describedby":R?st:void 0,required:!0,autoFocus:!0}),R&&e.jsx("p",{id:st,className:"text-danger text-meta",children:"This credential already exists"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(le,{htmlFor:ot,children:"Credential value"}),e.jsx(oe,{id:ot,type:"password",value:m,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&F&&A()},"aria-describedby":l?it:void 0,required:!0,autoFocus:l,placeholder:"Enter the credential value or API key"}),l&&e.jsxs("p",{id:it,className:"text-ink-dim text-meta",children:["Enter the new value for ",n]})]})]})})},lt=({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(Ft,{variant:"surface",padding:"sm",className:"mt-3",children:n?e.jsx(co,{type:r}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(260px,1fr))] gap-2",children:a})})]}),co=({type:t,className:s})=>{const a=t==="noCredentials",n=a?Me:xt;return e.jsxs("div",{className:X("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."})]})},lo=()=>{const{data:t,isLoading:s,error:a,refetch:n}=Ct(),r=da(),[c,l]=o.useState(!1),[h,u]=o.useState(!1),[m,d]=o.useState(null),g=y=>{d(y),l(!0)},S=(y=null)=>{d(y),u(!0)},p=()=>{l(!1),u(!1),d(null)},k=async y=>{try{await r.mutateAsync(y),p(),await n()}catch(F){console.error("Error saving credential:",F)}},A=async y=>{try{await r.mutateAsync({key:y,value:""}),await n()}catch(F){console.error("Error clearing credential:",F)}},E=o.useMemo(()=>t?.keys?.filter(y=>!ve.find(F=>F.key===y)?.internal)??[],[t]),R=o.useMemo(()=>ve.filter(y=>!E.includes(y.key)&&!y.internal),[E]),$=()=>s?e.jsx("div",{className:"flex min-h-40 items-center justify-center",children:e.jsx(ee,{size:"lg",label:"Loading credentials"})}):a||!t?e.jsxs(V,{variant:"danger",role:"alert",children:[e.jsx(Ot,{children:"Could not load credentials"}),e.jsx(Pt,{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(lt,{title:"Configured credentials",description:"These API credentials are currently configured and available for use.",isEmpty:E.length===0,emptyStateType:"noCredentials",children:E.map(y=>e.jsx(tt,{credentialKey:y,isConfigured:!0,onEdit:g,onClear:A},y))}),e.jsx(lt,{title:"Available credentials",description:"These are common API credentials you can configure to enhance functionality.",isEmpty:R.length===0,emptyStateType:"allConfigured",children:R.map(y=>e.jsx(tt,{credentialKey:y.key,isConfigured:!1,onAdd:()=>S(y.key)},y.key))}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(M,{variant:"secondary",size:"sm",onClick:()=>S(null),children:[e.jsx(ua,{}),"Add custom credential"]})}),c&&e.jsx(ct,{open:c,onClose:p,onSave:k,initialKey:m||"",existingKeys:E,isSaving:r.isPending,isEditMode:!0}),h&&e.jsx(ct,{open:h,onClose:p,onSave:k,initialKey:m||"",existingKeys:E,isSaving:r.isPending,isEditMode:!1})]});return e.jsx("div",{className:"flex flex-col gap-6",children:$()})},uo=[[[".claude.json"],"Claude Code"],[[".claude",".mcp.json"],"Claude Code"],[[".cursor","mcp.json"],"Cursor"],[[".vscode","mcp.json"],"VS Code"],[[".codex","config.toml"],"Codex CLI"]];function mo(t){if(!t)return null;const s=t.split("\\").join("/").split("/").filter(Boolean);for(const[a,n]of uo)if(!(s.length<a.length)&&s.slice(-a.length).join("/")===a.join("/"))return n;return null}const ho={list:"status",add:"add",remove:"remove",reload:"reload",connect:"reconnect",probe:"probe",disconnect:"disconnect",login:"grant",logout:"disconnect",reauth:"grant",status:"status",cancel:"cancel"},po=(t,s)=>{const a=t?.trim();if(!a)return null;const n=ya(a,s);return n.kind==="auth"?{kind:"matched",name:n.name,unresolved:null}:{kind:"miss",asked:a}},fo=t=>t.reduce((s,a)=>s?(a.updated_at??0)>(s.updated_at??0)?a:s:a,null),xo=({sessionId:t,onAdded:s})=>{const[a,n]=o.useState(""),[r,c]=o.useState("command"),[l,h]=o.useState(""),[u,m]=o.useState(""),[d,g]=o.useState(""),[S,p]=o.useState("global"),[k,A]=o.useState(null),[E,R]=o.useState(!1),$=async()=>{R(!0),A(null);try{await fe({op:"mcp.control",sessionId:t,control:{action:"add",name:a,scope:S,...r==="command"?{command:l,args:u.split(`
312
- `).map(y=>y.trim()).filter(Boolean)}:{url:d}}}),n(""),h(""),m(""),g(""),s()}catch(y){A(Mt("add",y,!1))}finally{R(!1)}};return e.jsxs("form",{className:"flex flex-col gap-3 rounded-md border border-control bg-surface p-4",onSubmit:y=>{y.preventDefault(),$()},children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(le,{htmlFor:"mcp-add-name",children:"Name"}),e.jsx(oe,{id:"mcp-add-name",value:a,onChange:y=>n(y.target.value),required:!0})]}),e.jsxs("fieldset",{className:"flex gap-2",children:[e.jsx("legend",{className:"sr-only",children:"Server transport"}),e.jsx(M,{type:"button",variant:r==="command"?"secondary":"ghost",size:"sm",onClick:()=>c("command"),children:"Local command"}),e.jsx(M,{type:"button",variant:r==="url"?"secondary":"ghost",size:"sm",onClick:()=>c("url"),children:"Remote URL"})]}),r==="command"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(le,{htmlFor:"mcp-add-command",children:"Command"}),e.jsx(oe,{id:"mcp-add-command",value:l,onChange:y=>h(y.target.value),className:"font-mono",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(le,{htmlFor:"mcp-add-args",children:"Arguments, one per line"}),e.jsx("textarea",{id:"mcp-add-args",value:u,onChange:y=>m(y.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(le,{htmlFor:"mcp-add-url",children:"URL"}),e.jsx(oe,{id:"mcp-add-url",type:"url",value:d,onChange:y=>g(y.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(M,{type:"button",variant:S==="global"?"secondary":"ghost",size:"sm",onClick:()=>p("global"),children:"Global"}),e.jsx(M,{type:"button",variant:S==="project"?"secondary":"ghost",size:"sm",onClick:()=>p("project"),children:"This project"})]}),k&&e.jsxs(V,{variant:"danger",children:[e.jsx("p",{children:k.message}),k.detail?e.jsx("p",{className:"font-mono text-ink-dim text-mono-sm",title:k.detail,children:k.detail}):null]}),e.jsx("div",{children:e.jsxs(M,{type:"submit",variant:"primary",size:"sm",disabled:E||!a||!(r==="command"?l:d),children:[E?e.jsx(ee,{size:"sm"}):null,"Add server"]})})]})},go=({sessionId:t,sectionRef:s,highlightServer:a})=>{const n=Pe(),r=Ce(n.data,"mcp"),c=kt(),l=je(v=>v.sessions),h=je(v=>v.fetchSessions),u=je(v=>v.loading),m=o.useMemo(()=>t?null:fo(l),[t,l]),d=t??m?.session_id,[g,S]=o.useState(null),[p,k]=o.useState(null),[A,E]=o.useState(!1),[R,$]=o.useState(null),y=ma({sessionId:d}),[F,L]=o.useState("");o.useEffect(()=>{t||!r||l.length>0||h()},[t,r,l.length,h]);const P=ge({queryKey:Ee.list(d??""),queryFn:()=>{if(!d)throw new Error("No conversation selected.");return va(d)},enabled:r&&!!d,staleTime:1e4}),T=ha(P.data),C=o.useMemo(()=>po(a,T.map(v=>v.name)),[a,T]),b=C?.kind==="matched"?C.name:null,D=o.useRef(null),j=o.useRef(null),Q=F.trim().toLowerCase(),G=o.useMemo(()=>Q?T.filter(v=>v.name.toLowerCase().includes(Q)):T,[T,Q]);o.useEffect(()=>{!b||j.current===b||!F||L("")},[b,F]),o.useEffect(()=>{b&&j.current!==b&&G.some(v=>v.name===b)&&(j.current=b,D.current?.scrollIntoView({block:"center",behavior:"smooth"}))},[b,G]);const te=o.useCallback(()=>{d&&c.invalidateQueries({queryKey:Ee.list(d)})},[c,d]),K=o.useCallback(async(v,Y,ae={})=>{if(d){k(null);try{await fe({op:"mcp.control",sessionId:d,control:{action:v,name:Y,...ae}}),te()}catch(W){const N=c.getQueryData(Ee.list(d));k(Mt(ho[v],W,pa(N?.operations)))}}},[c,d,te]);return r?d?e.jsx(B,{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:[p&&e.jsxs(V,{variant:"danger",children:[e.jsx("p",{children:p.message}),p.detail?e.jsx("p",{className:"font-mono text-ink-dim text-mono-sm",title:p.detail,children:p.detail}):null]}),m&&e.jsxs("p",{className:"text-body-sm text-ink-muted",children:["Showing MCP servers for"," ",m.title?.trim()||m.session_id.slice(0,6),", your most recent conversation. Open a conversation to see its own list."]}),P.isLoading&&e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(ee,{size:"lg",label:"Loading MCP servers"})}),P.isError&&e.jsx(V,{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(M,{variant:"secondary",size:"sm",onClick:()=>void P.refetch(),children:"Retry"})]})}),T.length>0&&e.jsxs("div",{className:"relative",children:[e.jsx(Nt,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-ink-dim"}),e.jsx(oe,{value:F,onChange:v=>L(v.target.value),placeholder:"Search MCP servers","aria-label":"Search MCP servers",className:"pl-9"})]}),C?.kind==="miss"&&T.length>0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:`No MCP server matches "${C.asked}".`}),C?.kind==="matched"&&C.unresolved&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:`Showing "${C.name}" — "${C.unresolved}" is not one of your servers.`}),P.isSuccess&&T.length===0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No MCP servers configured yet. Add one below."}),T.length>0&&G.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(M,{variant:"secondary",size:"sm",onClick:()=>L(""),children:"Clear search"})]}),G.length>0&&e.jsx("ul",{className:"flex flex-col gap-2",children:G.map(v=>{const Y=v.status==="connected",ae=v.name===b,W=v.owned_scope,N=v.transport==="http"&&v.transport_oauth_supported!==!1,U=mo(v.source);return e.jsxs("li",{ref:ae?D:void 0,className:X("flex flex-col gap-2 rounded-md border border-control bg-surface p-3",ae&&"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:v.name}),W&&e.jsx(Se,{variant:"outline",children:W==="project"?"This project":"Global"}),v.transport&&e.jsx("span",{className:"text-meta text-ink-dim",children:v.transport})]}),e.jsx(Se,{variant:Y?"success":v.status==="connecting"?"info":v.status==="auth-required"?"warning":"neutral",children:v.status??"unknown"})]}),typeof v.tool_count=="number"&&e.jsxs("p",{className:"text-meta text-ink-dim",children:[v.tool_count," tools available"]}),v.status==="auth-required"&&!N&&e.jsx("p",{className:"text-meta text-ink-dim",children:v.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."}),!W&&e.jsxs("p",{className:"text-meta text-ink-dim",children:[U?`Imported from ${U}.`:"Imported from a configuration local-operator does not write."," ",v.source?e.jsxs(e.Fragment,{children:["Remove it in"," ",e.jsx("span",{className:"font-mono text-mono-sm text-ink-dim",children:fa(v.source)}),"."]}):e.jsx(e.Fragment,{children:"Remove it wherever it is defined."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Y?e.jsxs(M,{variant:"secondary",size:"sm",onClick:()=>{S(null),K("disconnect",v.name,{confirmed:!0})},children:[e.jsx(At,{"aria-hidden":"true"}),"Disconnect"]}):e.jsxs(M,{variant:"secondary",size:"sm",onClick:()=>void K("connect",v.name),children:[e.jsx(wn,{"aria-hidden":"true"}),"Connect"]}),e.jsxs(M,{variant:"ghost",size:"sm",onClick:()=>void K("reload",v.name),children:[e.jsx(Ut,{"aria-hidden":"true"}),"Reload"]}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>{const I=xa(P.data?.servers??[]).find(se=>se.name===v.name);I&&$({row:I,sessionId:d})},children:"Sign in"}),v.setup?.text?e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>{navigator.clipboard.writeText(v.setup?.text??"").catch(()=>{})},children:"Copy setup prompt"}):null,W?g===v.name?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-body-sm text-ink",children:["Remove ",v.name,"?"]}),e.jsx(M,{variant:"danger",size:"sm",onClick:()=>{S(null),K("remove",v.name,{confirmed:!0,scope:W})},children:"Confirm removal"}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>S(null),children:"Keep"})]}):e.jsxs(M,{variant:"ghost",size:"sm",className:"text-danger",onClick:()=>S(v.name),children:[e.jsx(_t,{"aria-hidden":"true"}),"Remove"]}):null]})]},v.name)})}),R?.sessionId===d?e.jsx(ga,{row:R.row,remedy:y,onClose:()=>$(null)},d):null,A?e.jsx(xo,{sessionId:d,onAdded:()=>{E(!1),te()}}):e.jsx("div",{children:e.jsx(M,{variant:"secondary",size:"sm",onClick:()=>E(!0),"data-tour-tag":"mcp-add-server",children:"Add server"})})]})}):e.jsx(B,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts.",sectionRef:s,children:u?e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(ee,{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(B,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts.",sectionRef:s,children:e.jsx(V,{variant:"warning",children:"Integration management needs a newer Local Operator backend. Update the backend and restart the app to manage MCP servers here."})})},yo=({onAfterCredentialUpdate:t})=>{const{isAuthenticated:s,user:a,isLoading:n,error:r,signOut:c}=ka(),l=Et(d=>d.isSigningOut),h=o.useCallback(async()=>{try{await c()}catch(d){console.error("Error signing out:",d)}},[c]),u=o.useMemo(()=>{if(!s||!a?.radientUser)return null;const{account:d,identity:g}=a.radientUser;return e.jsxs(e.Fragment,{children:[e.jsxs(qe,{children:[e.jsx(Z,{label:"Status",value:e.jsxs("span",{className:"inline-flex items-center gap-2",children:["Connected",e.jsx(Se,{variant:"success",className:"capitalize",children:d.status})]})}),e.jsx(Z,{label:"Name",value:d.name||"Not provided"}),e.jsx(Z,{label:"Email",value:d.email}),e.jsx(Z,{label:"Account ID",value:e.jsx("span",{className:"text-mono-sm",children:d.id})}),e.jsx(Z,{label:"Tenant ID",value:e.jsx("span",{className:"text-mono-sm",children:d.tenant_id})}),e.jsx(Z,{label:"Provider",value:e.jsx("span",{className:"capitalize",children:g.provider})}),e.jsx(Z,{label:"Created",value:Tt(d.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(M,{variant:"danger",className:"mt-3",onClick:h,children:[e.jsx(ba,{}),"Sign out from Radient"]})]})]})},[s,a?.radientUser,h]),m=o.useMemo(()=>s&&a?null:e.jsxs("div",{children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"You are not currently signed in to Radient. 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(Ya,{titleText:"",onAfterCredentialUpdate:t,descriptionText:"",onSignInSuccess:()=>{}})})]}),[s,a,t]);return n||l?e.jsx("div",{className:"flex min-h-36 items-center justify-center",children:e.jsx(ee,{size:"lg",label:"Loading account"})}):s&&a?.radientUser?u:e.jsxs("div",{className:"flex flex-col gap-4",children:[r&&e.jsxs(V,{variant:"danger",children:["Error checking account status:"," ",r instanceof Error?r.message:String(r)]}),m]})};function vo({metric:t,data:s}){return e.jsx(ja,{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)}`:wa(a),children:e.jsx(xr,{data:s,children:e.jsx(bt,{type:"monotone",dataKey:"value",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:0},name:t==="credits"?"Credits consumed":"Tokens used"})})})}const ko=()=>{const{data:t,isLoading:s,error:a,refetch:n}=hr(),r=pr(),[c,l]=o.useState(""),[h,u]=o.useState(!1);o.useEffect(()=>{l(t?.content??""),u(!1)},[t]);const m=k=>{const A=k.target.value;l(A),u(A!==(t?.content??""))},d=async()=>{if(!(!h||r.isPending))try{const k={content:c};await r.mutateAsync(k),await n(),u(!1)}catch(k){console.error("Error updating system prompt:",k)}},g=()=>{l(t?.content??""),u(!1)},S=r.isPending,p=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(le,{htmlFor:"app-system-prompt",children:"Instructions"}),e.jsx(ze,{id:"app-system-prompt",name:"systemPrompt",value:c,onChange:m,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(M,{variant:"primary",onClick:d,disabled:!h||S,children:[S?e.jsx(ee,{size:"sm"}):e.jsx(Na,{}),S?"Saving...":"Save changes"]}),e.jsx(M,{onClick:g,disabled:!h||S,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:Rt(t.last_modified)})]})]});return e.jsx(B,{title:"System prompt",icon:Za,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(ee,{size:"lg",label:"Loading system prompt"})}):a?e.jsxs(V,{variant:"danger",children:["Failed to load system prompt:"," ",a instanceof Error?a.message:"Unknown error"]}):p()})},bo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],jo=t=>bo.includes(t),wo=t=>{const s=[];let a=0;for(const n of t){const r=Math.max(0,Math.floor(n.count)),c=Math.max(1,Math.floor(n.columns));for(let l=0;l<r;l+=c)s.push({start:a+l,count:Math.min(c,r-l)});a+=r}return s},No=({index:t,key:s,groups:a})=>{const n=wo(a),r=n.reduce((c,l)=>c+l.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 c=n.findIndex(u=>t>=u.start&&t<u.start+u.count),l=n[c+(s==="ArrowDown"?1:-1)];if(!l)return t;const h=t-n[c].start;return l.start+Math.min(h,l.count-1)}default:return t}},_o={localOperatorDark:gn,localOperatorLight:On,dracula:Tn,dune:qs,sage:on,monokai:Bt,tokyoNight:bn,iceberg:Ln,radient:en,neon:ur,obsidian:Lt,synth:ss,catppuccinMocha:Cs,catppuccinLatte:hn,tokyoNightStorm:vs,gruvbox:us,nord:lr,oneDark:ts,solarizedDark:Dn,rosePine:Gs,rosePineMoon:fn,rosePineDawn:_s,alucard:Ys,gruvboxLight:Is,tokyoNightDay:vn,oneLight:ln,catppuccinFrappe:Rs,catppuccinMacchiato:an,palenight:Ca,everforest:Xn,everforestLight:Wn,kanagawaWave:rr,kanagawaLotus:Bs,ayuDark:$s,ayuMirage:Fs,ayuLight:Cn,nightfox:bs,duskfox:Hn,synthwave:_n,matrix:rs,tron:gs,cyberpunk:Sa,vaporwave:Zn,outrun:ls,neonNoir:tr,arcade:nn,forest:Kn,ocean:Ps,desert:Vn,autumn:ir,lavender:zn,arctic:ws,rosewood:Js,solarizedLight:Un,githubLight:Qs,paper:_a,linen:An,highContrastLight:Xa,mintLight:is},dt="bg-[color-mix(in_srgb,var(--color-accent)_8%,var(--color-accent-wash))]",So=({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"})]})]})]}),Co=({id:t,name:s,description:a,isSelected:n,isTabStop:r,onSelect:c,onFocusTile:l})=>{const h=_o[t];return e.jsx(_e,{side:"bottom",align:"start",content:a,children:e.jsxs("button",{type:"button","data-theme-tile":t,"aria-pressed":n,tabIndex:r?0:-1,onFocus:l,onClick:c,className:X("relative flex flex-col gap-1.5 rounded-md p-1 text-left transition-colors duration-fast ease-out-quart",n?dt:"hover:bg-surface"),children:[e.jsxs("span",{className:X("relative block h-10 overflow-hidden rounded-sm border transition-colors duration-fast ease-out-quart",n?"border-accent":"border-hairline"),children:[e.jsx(So,{id:t}),n&&e.jsx("span",{className:X("pointer-events-none absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full",dt),children:e.jsx(xt,{size:12,className:"text-accent","aria-hidden":"true"})})]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(h,{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})]})]})})},Mo=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)}}),Ao=()=>{const{themeName:t,setTheme:s}=De(),a=o.useMemo(()=>{const h=Object.values(qt);return[{label:"Dark",items:h.filter(u=>u.theme.palette.mode==="dark")},{label:"Light",items:h.filter(u=>u.theme.palette.mode==="light")}].filter(u=>u.items.length>0)},[]),[n,r]=o.useState(null),c=o.useMemo(()=>{const h=a.flatMap(u=>u.items.map(m=>m.id));return n&&h.includes(n)?n:h.includes(t)?t:h[0]},[a,n,t]),l=h=>{if(!jo(h.key))return;const u=[...h.currentTarget.querySelectorAll("[data-theme-tile]")],m=u.indexOf(h.target);if(m<0)return;h.preventDefault();const d=No({index:m,key:h.key,groups:Mo(h.currentTarget)});d!==m&&u[d]?.focus()};return e.jsx(Ht,{children:e.jsx("div",{onKeyDown:l,className:"flex flex-col gap-6",children:a.map(h=>e.jsxs("div",{children:[e.jsx("h3",{className:"px-1 pb-2 text-meta text-ink-dim",children:h.label}),e.jsx("div",{"data-theme-grid":h.label,className:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-2",children:h.items.map(({id:u,name:m,description:d})=>e.jsx(Co,{id:u,name:m,description:d,isSelected:u===t,isTabStop:u===c,onSelect:()=>s(u),onFocusTile:()=>r(u)},u))})]},h.label))})})},Eo=()=>{const{data:t,isLoading:s,error:a}=vr({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(Es,{size:16,className:"shrink-0 text-ink-dim"}),"Radient Pass"]}),s&&e.jsx(gt,{className:"h-6 w-36"}),a&&e.jsxs(V,{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(M,{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(fs,{}),"Add credits"]})})]})]})},To=[{id:"credits",label:"Credits"},{id:"tokens",label:"Tokens"}],Ro=()=>{const[t,s]=o.useState("credits"),a=o.useMemo(()=>{const h=new Date,u=gr(h);return{start_date:Qe(u),end_date:Qe(h),rollup:"daily"}},[]),{data:n,isLoading:r,error:c}=jr(a,{enabled:!0}),l=o.useMemo(()=>n?.data_points?[...n.data_points].sort((u,m)=>Re(u.timestamp).getTime()-Re(m.timestamp).getTime()).map(u=>({bucket:Ba(Va(Re(u.timestamp),"yyyy-MM-dd")),value:t==="credits"?Number.parseFloat(u.total_cost.toFixed(2)):u.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(hs,{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:To.map(({id:h,label:u})=>e.jsx(M,{variant:"ghost",size:"sm","aria-pressed":t===h,onClick:()=>s(h),className:X(t===h&&"bg-surface text-ink hover:bg-surface"),children:u},h))})]})]}),r&&e.jsx(gt,{className:"h-62 w-full"}),c&&e.jsxs(V,{variant:"warning",children:["Could not load your usage data. ",c.message]}),!r&&!c&&n&&l.length>0&&e.jsx(vo,{metric:t,data:l}),!r&&!c&&(!n||l.length===0)&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No usage recorded in the last 30 days."})]})},Lo=()=>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(Ga,{size:16,className:"shrink-0 text-ink-dim"}),"Radient account"]}),e.jsx(M,{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(St,{})]})})]}),Oo=()=>{const t=De(N=>N.showAgentReasoning),s=De(N=>N.setShowAgentReasoning),{data:a,isLoading:n,isFetching:r,error:c,refetch:l}=Ma(),h=Aa(),[u,m]=o.useState(null),d=Et(),{isAuthenticated:g,isLoading:S}=Oe(),p=je(N=>N.activeSessionId),[k,A]=o.useState("general"),[E,R]=o.useState(!1),$=o.useRef(null),y=o.useRef(null),{startTour:F}=Ea(),L=Ta(),{data:P,refetch:T}=Ct(),{refreshModels:C}=Ra(),b=o.useMemo(()=>P?.keys?[...P.keys].sort():[],[P?.keys]),D=o.useRef({keys:"",hosting:void 0});o.useEffect(()=>{const N=b.join(","),U=a?.values?.hosting;(D.current.keys!==N||D.current.hosting!==U)&&(D.current={keys:N,hosting:U},C().catch(I=>{console.error("Failed to refresh models after credentials or hosting change:",I)}))},[b,a?.values?.hosting,C]);const j=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,Q=o.useMemo(()=>new URLSearchParams(L.search).get("setting"),[L.search]),G=o.useMemo(()=>new URLSearchParams(L.search).get("filter")??"",[L.search]),te=o.useMemo(()=>new URLSearchParams(L.search).get("mcp")??void 0,[L.search]),K=o.useMemo(()=>new URLSearchParams(L.search).get("provider"),[L.search]),v=o.useCallback(N=>{A(N),R(!0);const U=j[N],I=y.current;if(U?.current&&I){const q=U.current.getBoundingClientRect().top-I.getBoundingClientRect().top;I.scrollHeight>I.clientHeight?I.scrollTo({top:Math.max(0,I.scrollTop+q-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,U.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout($.current??void 0),$.current=setTimeout(()=>{R(!1),$.current=null},800)}else R(!1)},[j]);o.useEffect(()=>{const N=setTimeout(()=>{const U=y.current;if(!U)return;const I=()=>{if(E)return;const se=U.getBoundingClientRect(),q=se.height;let H="",J=0;for(const[he,ne]of Object.entries(j))if(ne.current){const re=ne.current.getBoundingClientRect(),de=se.top,ie=re.top-de,ke=re.bottom-de,be=re.height,Ae=Math.max(0,ie),i=Math.min(q,ke),w=Math.max(0,i-Ae)/be,_=w+(ie<q*.3?.1:0);_>J&&w>.1&&(J=_,H=he)}H&&H!==k&&A(H)};return I(),U.addEventListener("scroll",I,{passive:!0}),()=>{U.removeEventListener("scroll",I),clearTimeout($.current??void 0)}},100);return()=>clearTimeout(N)},[j,k,E]),o.useEffect(()=>{const N=new URLSearchParams(L.search),U=N.get("section"),I=N.get("setting")?"backend":U,se=I?j[I]:void 0;if(!I||!se)return;let q=!1,H=Number.NaN,J=0;const he=window.setTimeout(()=>{q||(q=!0,re.disconnect(),v(I))},2e3),ne=()=>{if(q)return;const de=se.current;if(!de){J=requestAnimationFrame(ne);return}const ie=Math.round(de.getBoundingClientRect().top+window.scrollY);if(ie===H&&ie>0){q=!0,re.disconnect(),window.clearTimeout(he),v(I);return}H=ie,J=requestAnimationFrame(ne)},re=new ResizeObserver(()=>{q||(cancelAnimationFrame(J),J=requestAnimationFrame(ne))});return y.current&&re.observe(y.current),J=requestAnimationFrame(ne),()=>{q=!0,cancelAnimationFrame(J),re.disconnect(),window.clearTimeout(he)}},[L.search,j,v]);const Y=async(N,U)=>{m(N);try{await h.mutateAsync({[N]:U}),await l()}catch(I){console.error(`Error updating ${N}:`,I)}finally{m(null)}},ae=n||S,W=kr(ae,4e3);return c?e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(V,{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:Ue("Your settings could not be loaded.",c)}),e.jsx(M,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void l(),disabled:r,children:r?"Retrying":"Retry"})]})})}):ae?e.jsxs("div",{role:"status",className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-canvas",children:[e.jsx(ee,{size:"lg",label:W?void 0:"Loading settings"}),W&&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(La,{activeSection:k,onSelectSection:v,sections:Ia})}),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(Ka,{title:"Settings",icon:Ye}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsxs("div",{ref:j.general,className:"flex flex-col gap-8",children:[e.jsx(B,{title:"User profile",icon:za,description:`Your user profile information displayed in the application. This information is not provided to the agents. ${g?"These details are provided through your Radient account.":""}`,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Ze,{value:d.profile.name,label:"Display name",placeholder:"Enter your name...",isSaving:u==="user_name",onSave:async N=>{m("user_name");try{d.updateName(N)}finally{m(null)}},readOnly:g}),e.jsx(Ze,{value:d.profile.email,label:"Email address",placeholder:"Enter your email...",isSaving:u==="user_email",onSave:async N=>{m("user_email");try{d.updateEmail(N)}finally{m(null)}},readOnly:g})]})}),e.jsx(B,{title:"Application tour",description:"Missed the application onboarding tour or want a refresher? Start it again here.",children:e.jsxs(M,{variant:"secondary",onClick:()=>{F({forceModalCompleted:!0})},children:[e.jsx($a,{}),"Take the tour"]})}),e.jsx(B,{title:"Model settings",icon:Da,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:u==="hosting",onSave:N=>Y("hosting",N),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:"No hosting providers available. Add one in API credentials, in the list on the left."}),e.jsx(Oa,{value:a.values.model_name,hostingId:a.values.hosting,isSaving:u==="model_name",onSave:N=>Y("model_name",N),allowCustom:!0,allowDefault:!1}),e.jsx(V,{variant:"neutral",icon:e.jsx(Ie,{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(ko,{}),e.jsx(B,{title:"History settings",icon:Wa,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(Te,{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:Pa,isSaving:u==="conversation_length",onChange:N=>Y("conversation_length",N)}),e.jsx(Te,{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:Ua,isSaving:u==="detail_length",onChange:N=>Y("detail_length",N)}),e.jsx(Te,{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:qa,isSaving:u==="max_learnings_history",onChange:N=>Y("max_learnings_history",N)})]})}),e.jsx(B,{title:"Configuration information",icon:Ie,description:"System information about the current configuration.",children:e.jsxs(qe,{children:[e.jsx(Z,{label:"Version",value:e.jsx("span",{className:"text-mono-sm",children:a.version})}),e.jsx(Z,{label:"Created",value:Tt(a.metadata.created_at)}),e.jsx(Z,{label:"Last modified",value:Rt(a.metadata.last_modified)}),e.jsx(Z,{label:"Description",value:a.metadata.description||"No description available"})]})})]}),e.jsx(B,{title:"Appearance",icon:Lt,description:"Customize the look and feel of Local Operator",sectionRef:j.appearance,dataTourTag:"settings-appearance-section",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Ao,{}),e.jsx(fr,{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 N=>s(N)})]})}),e.jsx(B,{title:"Radient account",titleComponent:e.jsx(Lo,{}),description:"Manage your Radient account, Radient Pass details, and credits.",sectionRef:j.radient,dataTourTag:"settings-radient-account-section",children:e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsx(yo,{onAfterCredentialUpdate:()=>{C(),T()}}),g&&e.jsxs(e.Fragment,{children:[e.jsx(Eo,{}),e.jsx(Ro,{})]})]})}),e.jsx(B,{title:"Providers",icon:At,description:"Model providers, how you sign in to each, and which are connected.",sectionRef:j.providers,children:e.jsx(Ha,{initialProviderId:K})}),e.jsx(B,{title:"Backend settings",icon:Ye,description:"Every setting the backend registry owns, searchable, with typed editors and scopes.",sectionRef:j.backend,children:e.jsx(io,{focusKey:Q,initialFilter:G})}),e.jsx(go,{sessionId:p??void 0,sectionRef:j.integrations,highlightServer:te}),e.jsx(B,{title:"API credentials",icon:Me,description:"Manage your API keys for various services and integrations",sectionRef:j.credentials,dataTourTag:"settings-api-credentials-section",children:e.jsx(lo,{})}),e.jsx("div",{ref:j.updates,children:e.jsx(_r,{})})]})]})})]}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(V,{variant:"warning",className:"w-full max-w-xl",children:"Your settings could not be loaded."})})};export{Oo as SettingsPage};
316
+ `).map(p=>p.trim()).filter(Boolean)}),"aria-label":`${t.label}: ${d}`,className:"font-mono text-body-sm"})]},d)),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(oe,{value:s,disabled:n,onChange:m=>r(m.target.value),"aria-label":t.label,placeholder:t.placeholder})}},zt=({className:t})=>e.jsx("span",{role:"img","aria-label":"Changed from the default",title:"Changed from the default",className:X("size-1.5 shrink-0 rounded-full bg-accent",t)}),eo=({title:t,rowCount:s,advancedCount:a,scope:n,modified:r,onOpenChange:c,defaultOpen:l=!1})=>e.jsx("div",{"data-section-header":t,className:"flex w-full flex-col",children:e.jsx(wt,{defaultOpen:l,onOpenChange:c,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(zt,{className:"ml-auto"})]})})}),to="size-3.5 shrink-0",ao=({setting:t,draft:s,tier:a,gate:n,saving:r,error:c,onDraftChange:l,onSave:h,onReset:u,effectiveHosting:m=""})=>{const d=!!(n&&!n.on),g=Ne(t,s),S=r||d,p=t.kind==="list"||t.kind==="cascade",k=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})]}),A=d&&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:X("flex min-w-44 flex-col gap-0.5",p?"shrink-0 basis-2/5":"flex-1"),children:[a==="advanced"&&t.help?e.jsx(wt,{summary:k,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:to}),k]}),a==="core"&&t.help&&e.jsx("p",{id:Xe(t.key),className:"ml-5 text-meta text-ink-dim",children:t.help}),A]}),e.jsxs("div",{className:X("flex shrink-0 items-center gap-2 self-center",p&&"min-w-0 flex-1 items-start"),children:[(!t.is_default||g)&&e.jsx(zt,{}),!t.is_default&&t.kind!=="readonly"&&e.jsxs(M,{variant:"ghost",size:"sm",disabled:S,onClick:u,"aria-label":`Use default for ${t.label}`,children:[e.jsx(nr,{"aria-hidden":"true"}),"Use default"]}),g&&e.jsx(M,{variant:"primary",size:"sm",disabled:S,onClick:h,children:r?"Saving":"Save"}),e.jsx("div",{className:Kr(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:xe(t.value)||"Not set"}):e.jsx(Xr,{setting:t,value:s.value,chains:s.cascadeBase??void 0,disabled:S,effectiveHosting:m,helpId:a==="core"&&t.help?Xe(t.key):void 0,onValueChange:E=>l({...s,value:E}),onChainsChange:E=>l({...s,cascadeBase:E})})})]}),c&&e.jsx(V,{variant:"danger",role:"alert",className:"w-full",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:c}),e.jsxs(M,{variant:"secondary",size:"sm",disabled:r,onClick:h,children:[e.jsx(ra,{"aria-hidden":"true"}),"Retry"]})]})})]})})},so="w-full max-w-[400px]",no=({query:t,onQueryChange:s,matchCount:a,matchSections:n,coreCount:r,advancedCount:c,modifiedCount:l,modifiedOnly:h,onModifiedOnlyChange:u,showAdvanced:m,onShowAdvancedChange:d,onExpandAll:g,onCollapseAll:S,unsavedCount:p,savingAll:k,onSaveAll:A,onDiscardAll:E})=>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:X("relative",so),children:[e.jsx(Nt,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-ink-dim","aria-hidden":"true"}),e.jsx(oe,{value:t,onChange:R=>s(R.target.value),onKeyDown:R=>{R.key==="Escape"&&t&&s("")},placeholder:"Search settings by name, description or key","aria-label":"Search settings",className:"pl-9"}),t&&e.jsx(M,{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(Dt,{"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(M,{variant:"ghost",size:"sm","aria-pressed":h,onClick:()=>u(!h),className:X(h&&"bg-surface text-ink hover:bg-surface"),children:["Modified",e.jsx(Se,{variant:"neutral",children:l})]}),e.jsx(M,{variant:"ghost",size:"sm","aria-pressed":m,onClick:()=>d(!m),className:X(m&&"bg-surface text-ink hover:bg-surface"),children:"Show advanced"})]})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[p>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-meta text-ink-dim",children:p===1?"1 unsaved change":`${p} unsaved changes`}),e.jsx(M,{variant:"primary",size:"sm",disabled:k,onClick:A,children:k?"Saving":"Save all"}),e.jsx(M,{variant:"ghost",size:"sm",disabled:k,onClick:E,children:"Discard all"})]}),e.jsx(M,{variant:"ghost",size:"sm",onClick:g,children:"Expand all"}),e.jsx(M,{variant:"ghost",size:"sm",onClick:S,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"}`:h?`${l} modified ${l===1?"setting":"settings"}`:m?`${c} advanced settings shown — Expand all to see them`:`${r} core settings, ${c} advanced`})]}),ro={all:["desktop","settings"]},oo={live:"Takes effect immediately","new launch":"Takes effect the next time the app starts","new sessions":"Takes effect for new conversations"},io=40,pe=t=>t.toLowerCase().replace(/[-_.]/g," "),co=({focusKey:t,initialFilter:s=""})=>{const a=Pe(),n=Ce(a.data,"settings"),[r,c]=o.useState(s),[l,h]=o.useState(!1),[u,m]=o.useState(!1),[d,g]=o.useState({}),[S,p]=o.useState({}),[k,A]=o.useState({}),[E,R]=o.useState(!1),[$,y]=o.useState(new Set),[F,L]=o.useState(new Set),[P,T]=o.useState(new Set),C=o.useRef(null),b=o.useRef(null),D=ge({queryKey:ro.all,queryFn:()=>fe({op:"settings.list"}),enabled:n,staleTime:1e4}),j=D.data;o.useEffect(()=>{j&&g(i=>{let x=!1;const w={...i};for(const _ of j.settings){const O=i[_.key];if(!O){w[_.key]=ce(_),x=!0;continue}if(Ne(_,O))continue;const z=ce(_);(z.value!==O.value||z.cascadeBase!==O.cascadeBase)&&(w[_.key]=z,x=!0)}return x?w:i})},[j]);const Q=o.useCallback(i=>!i.is_default||Ne(i,d[i.key]??ce(i)),[d]),G=o.useMemo(()=>{const i=(j?.settings??[]).find(x=>x.key==="hosting");return i?(d.hosting??ce(i)).value:""},[j,d]),te=o.useMemo(()=>{if(!j)return[];const i=pe(r.trim()),x=i.length>0||u;return j.settings.filter(w=>!x&&me(w)==="advanced"&&!l||u&&!Q(w)?!1:i?pe([w.label,w.help,w.key,w.section,w.warning??""].join(" ")).includes(i):!0)},[j,r,l,u,Q]),K=r.trim().length>0||u,v=o.useMemo(()=>j?.sections??[],[j]),Y=o.useCallback(i=>(j?.settings??[]).filter(x=>x.section===i),[j]),ae=i=>te.filter(x=>x.section===i),W=i=>$.has(i)?!0:F.has(i)?!1:Ar(Y(i)),N=(i,x)=>{y(w=>{const _=new Set(w);return x?_.add(i):_.delete(i),_}),L(w=>{const _=new Set(w);return x?_.delete(i):_.add(i),_})},U=(i,x)=>{T(w=>{const _=new Set(w);return x?_.delete(i):_.add(i),_})},I=i=>{const x=v.filter(_=>i||ae(_.name).length>0).map(_=>_.name),w=Er(i,K,x);w.layout&&(y(new Set(w.layout.opened)),L(new Set(w.layout.closed))),T(new Set(w.filter))};o.useEffect(()=>{r.trim()||T(new Set)},[r]);const se=o.useCallback(i=>{const x=i.gated_by;if(!x||!j)return null;const w=j.settings.find(_=>_.key===x);return{key:x,label:w?.label??x,on:w?.value===!0||w?.value==="true"}},[j]),q=o.useCallback((i,x)=>p(w=>({...w,[i]:x})),[]),B=o.useCallback((i,x)=>A(w=>({...w,[i]:x})),[]),J=o.useCallback(async i=>{const x=d[i.key];if(!x)return!1;const w=Tr(i,x);if(!w.ok)return B(i.key,w.error),!1;q(i.key,!0),B(i.key,null);try{await fe(w.request),q(i.key,!1);const O=(await D.refetch()).data?.settings.find(z=>z.key===i.key);return O&&g(z=>{const ye=z[i.key];return ye&&ye.value===x.value&&ye.cascadeBase===x.cascadeBase?{...z,[i.key]:ce(O)}:z}),!0}catch(_){return q(i.key,!1),B(i.key,_ instanceof Error?_.message:"The setting could not be saved."),!1}},[d,D,q,B]),he=o.useCallback(async i=>{q(i.key,!0),B(i.key,null);try{await fe({op:"settings.reset",key:i.key}),g(x=>({...x,[i.key]:ce({...i,value:i.default,is_default:!0})})),q(i.key,!1),await D.refetch()}catch(x){q(i.key,!1),B(i.key,x instanceof Error?x.message:"The setting could not be reset.")}},[D,q,B]),ne=o.useMemo(()=>(j?.settings??[]).filter(i=>Ne(i,d[i.key]??ce(i))),[j,d]),re=async()=>{R(!0);for(const i of ne)await J(i);R(!1)},de=()=>{j&&(g(i=>{const x={...i};for(const w of j.settings)x[w.key]=ce(w);return x}),A({}))};o.useEffect(()=>{if(!t||!j||C.current===t)return;const i=j.settings.find(_=>_.key===t);if(!i)return;C.current=t,me(i)==="advanced"&&h(!0);const x=pe(r.trim());!x||pe([i.label,i.help,i.key,i.section].join(" ")).includes(x)||c(""),m(!1),y(_=>new Set(_).add(i.section)),L(_=>{const O=new Set(_);return O.delete(i.section),O})},[t,j,r]);const ie=o.useMemo(()=>{if(!t||!j)return!1;const i=j.settings.find(w=>w.key===t);if(!i||me(i)==="advanced"&&!l)return!1;const x=pe(r.trim());return x?pe([i.label,i.help,i.key,i.section].join(" ")).includes(x):!0},[t,j,r,l]);if(o.useEffect(()=>{if(!ie||!t||b.current===t)return;let i=0,x=0;const w=()=>{const _=document.querySelector(`[data-setting-key="${CSS.escape(t)}"]`),O=_?.querySelector('[data-setting-control] :is(input, textarea, select, button[role="switch"], button)')??_;if(O){O===_&&(O.tabIndex=-1),O.focus(),O.scrollIntoView({block:"center"}),b.current=t;return}x+=1,x<io&&(i=requestAnimationFrame(w))};return i=requestAnimationFrame(w),()=>cancelAnimationFrame(i)},[ie,t]),a.data&&!n)return e.jsx(V,{variant:"warning",children:"Searchable settings need a newer Local Operator server. Update the server and restart the app to manage these settings here."});if(D.isLoading||a.isLoading)return e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(ee,{size:"lg",label:"Loading settings"})});const ke=(a.data?null:a.error)??D.error;if(ke||!j){const i=a.isFetching||D.isFetching;return e.jsx(V,{variant:"warning",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:Ue("Your settings could not be loaded.",ke)}),e.jsx(M,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{a.isError?a.refetch():D.refetch()},disabled:i,children:i?"Retrying":"Retry"})]})})}const be=j.settings.reduce((i,x)=>(i[me(x)]+=1,i),{core:0,advanced:0}),Ae=new Set(te.map(i=>i.section)).size;return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(no,{query:r,onQueryChange:c,matchCount:r.trim()?te.length:null,matchSections:Ae,coreCount:be.core,advancedCount:be.advanced,modifiedCount:j.settings.filter(Q).length,modifiedOnly:u,onModifiedOnlyChange:m,showAdvanced:l,onShowAdvancedChange:h,onExpandAll:()=>I(!0),onCollapseAll:()=>I(!1),unsavedCount:ne.length,savingAll:E,onSaveAll:()=>void re(),onDiscardAll:de}),K&&te.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:v.map(i=>{const x=ae(i.name),w=Y(i.name),_=K?0:w.filter(z=>me(z)==="advanced").length;if(K&&x.length===0)return null;const O=K?x.length>0&&!P.has(i.name):W(i.name);return e.jsxs("section",{"data-settings-section":i.name,"data-open":O,className:"flex flex-col",children:[e.jsx(eo,{title:i.title,rowCount:x.length,advancedCount:_,scope:oo[i.scope],modified:w.some(Q),defaultOpen:O,onOpenChange:z=>K?U(i.name,z):N(i.name,z)},`${i.name}:${O?"open":"closed"}`),e.jsxs("div",{hidden:!O,className:"flex flex-col pb-3",children:[i.description&&e.jsx("p",{className:"px-1 pb-1 text-meta text-ink-dim",children:i.description}),x.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:_>0?"Advanced settings are hidden here.":"Nothing in this section matches."}),_>0&&e.jsxs(M,{variant:"secondary",size:"sm",onClick:()=>h(!0),children:["Show ",_," advanced"]})]}):x.map(z=>e.jsx(ao,{setting:z,draft:d[z.key]??ce(z),tier:me(z),gate:se(z),effectiveHosting:G,saving:!!S[z.key],error:k[z.key]??null,onDraftChange:ye=>g(He=>({...He,[z.key]:ye})),onSave:()=>void J(z),onReset:()=>void he(z)},z.key))]})]},i.name)})})]})},tt=({credentialKey:t,isConfigured:s=!1,onEdit:a,onClear:n,onAdd:r})=>{const c=oa(t),l=s?mn:Me;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(l,{className:"size-3.5 shrink-0 text-ink-dim"}),c.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:c.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(M,{variant:"ghost",size:"sm",onClick:()=>a?.(t),children:[e.jsx(ia,{}),"Update"]}),e.jsxs(M,{variant:"ghost",size:"sm",className:"text-danger hover:bg-danger-wash hover:text-danger",onClick:()=>n?.(t),children:[e.jsx(_t,{}),"Clear"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(M,{variant:"outline",size:"sm",onClick:()=>r?.(t),children:[e.jsx(Me,{}),"Configure"]}),c.url&&e.jsx(_e,{content:`Get your ${c.name} key`,children:e.jsx(M,{variant:"ghost",size:"icon-sm",asChild:!0,children:e.jsx("a",{href:c.url,target:"_blank",rel:"noopener noreferrer","aria-label":`Get your ${c.name} key`,children:e.jsx(St,{})})})})]})})]})},Le="_custom_",at="credential-custom-key",st="credential-custom-key-error",nt="credential-type",rt="credential-type-help",ot="credential-value",it="credential-value-help",ct=({open:t,onClose:s,onSave:a,initialKey:n="",existingKeys:r,isSaving:c,isEditMode:l})=>{const[h,u]=o.useState(n),[m,d]=o.useState(""),[g,S]=o.useState(""),[p,k]=o.useState(!1);o.useEffect(()=>{if(t){const b=ve.some(j=>j.key===n),D=!l&&n&&!b;u(b?n:""),d(""),S(D?n:""),k(D||l&&!b)}},[t,n,l]);const A=()=>{let b="";if(l?b=n:b=p?g.trim():h,!b){console.error("No key provided for credential");return}if(!m.trim()){console.error("No value provided for credential");return}a({key:b,value:m})},E=b=>r.includes(b)&&b!==n,R=E(g),$=l?!0:p?g.trim()!==""&&!R:h!==""&&!E(h),y=m.trim()!=="",F=$&&y&&!c,L=ve.find(b=>b.key===h),P=!!L&&!p,T=l?"Update credential":"Add new credential",C=e.jsxs(e.Fragment,{children:[e.jsx(M,{variant:"secondary",onClick:s,children:"Cancel"}),e.jsxs(M,{variant:"primary",onClick:A,disabled:!F,children:[c&&e.jsx(ee,{size:"sm",className:"border-t-on-accent"}),c?"Saving...":"Save"]})]});return e.jsx(ca,{open:t,onClose:s,title:T,actions:C,maxWidth:"sm",fullWidth:!0,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[l?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(le,{htmlFor:nt,children:"Credential type"}),e.jsxs(mt,{value:p?Le:h,onValueChange:b=>{b===Le?(k(!0),u("")):(k(!1),u(b),S(""))},children:[e.jsx(ht,{id:nt,"aria-describedby":P?rt:void 0,children:e.jsx(pt,{placeholder:"Select a credential type"})}),e.jsxs(ft,{children:[ve.filter(b=>!b.internal).map(b=>e.jsxs($e,{value:b.key,disabled:E(b.key),children:[b.name,E(b.key)&&" (configured)"]},b.key)),e.jsx($e,{value:Le,children:"Custom credential"})]})]}),P&&L&&e.jsxs("div",{id:rt,className:"flex flex-col items-start gap-1",children:[e.jsx("p",{className:"text-meta text-ink-dim",children:L.description}),L.url&&e.jsxs("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent text-meta underline-offset-4 hover:text-accent-hover hover:underline",children:["Get your ",L.name," key"]})]})]}),p&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(le,{htmlFor:at,children:"Custom credential key"}),e.jsx(oe,{id:at,value:g,onChange:b=>S(b.target.value),"aria-invalid":R||void 0,"aria-describedby":R?st:void 0,required:!0,autoFocus:!0}),R&&e.jsx("p",{id:st,className:"text-danger text-meta",children:"This credential already exists"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(le,{htmlFor:ot,children:"Credential value"}),e.jsx(oe,{id:ot,type:"password",value:m,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&F&&A()},"aria-describedby":l?it:void 0,required:!0,autoFocus:l,placeholder:"Enter the credential value or API key"}),l&&e.jsxs("p",{id:it,className:"text-ink-dim text-meta",children:["Enter the new value for ",n]})]})]})})},lt=({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(Ft,{variant:"surface",padding:"sm",className:"mt-3",children:n?e.jsx(lo,{type:r}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(260px,1fr))] gap-2",children:a})})]}),lo=({type:t,className:s})=>{const a=t==="noCredentials",n=a?Me:xt;return e.jsxs("div",{className:X("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."})]})},uo=()=>{const{data:t,isLoading:s,error:a,refetch:n}=Ct(),r=la(),[c,l]=o.useState(!1),[h,u]=o.useState(!1),[m,d]=o.useState(null),g=y=>{d(y),l(!0)},S=(y=null)=>{d(y),u(!0)},p=()=>{l(!1),u(!1),d(null)},k=async y=>{try{await r.mutateAsync(y),p(),await n()}catch(F){console.error("Error saving credential:",F)}},A=async y=>{try{await r.mutateAsync({key:y,value:""}),await n()}catch(F){console.error("Error clearing credential:",F)}},E=o.useMemo(()=>t?.keys?.filter(y=>!ve.find(F=>F.key===y)?.internal)??[],[t]),R=o.useMemo(()=>ve.filter(y=>!E.includes(y.key)&&!y.internal),[E]),$=()=>s?e.jsx("div",{className:"flex min-h-40 items-center justify-center",children:e.jsx(ee,{size:"lg",label:"Loading credentials"})}):a||!t?e.jsxs(V,{variant:"danger",role:"alert",children:[e.jsx(Ot,{children:"Could not load credentials"}),e.jsx(Pt,{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(lt,{title:"Configured credentials",description:"These API credentials are currently configured and available for use.",isEmpty:E.length===0,emptyStateType:"noCredentials",children:E.map(y=>e.jsx(tt,{credentialKey:y,isConfigured:!0,onEdit:g,onClear:A},y))}),e.jsx(lt,{title:"Available credentials",description:"These are common API credentials you can configure to enhance functionality.",isEmpty:R.length===0,emptyStateType:"allConfigured",children:R.map(y=>e.jsx(tt,{credentialKey:y.key,isConfigured:!1,onAdd:()=>S(y.key)},y.key))}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(M,{variant:"secondary",size:"sm",onClick:()=>S(null),children:[e.jsx(da,{}),"Add custom credential"]})}),c&&e.jsx(ct,{open:c,onClose:p,onSave:k,initialKey:m||"",existingKeys:E,isSaving:r.isPending,isEditMode:!0}),h&&e.jsx(ct,{open:h,onClose:p,onSave:k,initialKey:m||"",existingKeys:E,isSaving:r.isPending,isEditMode:!1})]});return e.jsx("div",{className:"flex flex-col gap-6",children:$()})},mo=[[[".claude.json"],"Claude Code"],[[".claude",".mcp.json"],"Claude Code"],[[".cursor","mcp.json"],"Cursor"],[[".vscode","mcp.json"],"VS Code"],[[".codex","config.toml"],"Codex CLI"]];function ho(t){if(!t)return null;const s=t.split("\\").join("/").split("/").filter(Boolean);for(const[a,n]of mo)if(!(s.length<a.length)&&s.slice(-a.length).join("/")===a.join("/"))return n;return null}const po={list:"status",add:"add",remove:"remove",reload:"reload",connect:"reconnect",probe:"probe",disconnect:"disconnect",login:"grant",logout:"disconnect",reauth:"grant",status:"status",cancel:"cancel"},fo=(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}},xo=t=>t.reduce((s,a)=>s?(a.updated_at??0)>(s.updated_at??0)?a:s:a,null),go=({sessionId:t,onAdded:s})=>{const[a,n]=o.useState(""),[r,c]=o.useState("command"),[l,h]=o.useState(""),[u,m]=o.useState(""),[d,g]=o.useState(""),[S,p]=o.useState("global"),[k,A]=o.useState(null),[E,R]=o.useState(!1),$=async()=>{R(!0),A(null);try{await fe({op:"mcp.control",sessionId:t,control:{action:"add",name:a,scope:S,...r==="command"?{command:l,args:u.split(`
317
+ `).map(y=>y.trim()).filter(Boolean)}:{url:d}}}),n(""),h(""),m(""),g(""),s()}catch(y){A(Mt("add",y,!1))}finally{R(!1)}};return e.jsxs("form",{className:"flex flex-col gap-3 rounded-md border border-control bg-surface p-4",onSubmit:y=>{y.preventDefault(),$()},children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(le,{htmlFor:"mcp-add-name",children:"Name"}),e.jsx(oe,{id:"mcp-add-name",value:a,onChange:y=>n(y.target.value),required:!0})]}),e.jsxs("fieldset",{className:"flex gap-2",children:[e.jsx("legend",{className:"sr-only",children:"Server transport"}),e.jsx(M,{type:"button",variant:r==="command"?"secondary":"ghost",size:"sm",onClick:()=>c("command"),children:"Local command"}),e.jsx(M,{type:"button",variant:r==="url"?"secondary":"ghost",size:"sm",onClick:()=>c("url"),children:"Remote URL"})]}),r==="command"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(le,{htmlFor:"mcp-add-command",children:"Command"}),e.jsx(oe,{id:"mcp-add-command",value:l,onChange:y=>h(y.target.value),className:"font-mono",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(le,{htmlFor:"mcp-add-args",children:"Arguments, one per line"}),e.jsx("textarea",{id:"mcp-add-args",value:u,onChange:y=>m(y.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(le,{htmlFor:"mcp-add-url",children:"URL"}),e.jsx(oe,{id:"mcp-add-url",type:"url",value:d,onChange:y=>g(y.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(M,{type:"button",variant:S==="global"?"secondary":"ghost",size:"sm",onClick:()=>p("global"),children:"Global"}),e.jsx(M,{type:"button",variant:S==="project"?"secondary":"ghost",size:"sm",onClick:()=>p("project"),children:"This project"})]}),k&&e.jsxs(V,{variant:"danger",children:[e.jsx("p",{children:k.message}),k.detail?e.jsx("p",{className:"font-mono text-ink-dim text-mono-sm",title:k.detail,children:k.detail}):null]}),e.jsx("div",{children:e.jsxs(M,{type:"submit",variant:"primary",size:"sm",disabled:E||!a||!(r==="command"?l:d),children:[E?e.jsx(ee,{size:"sm"}):null,"Add server"]})})]})},yo=({sessionId:t,sectionRef:s,highlightServer:a})=>{const n=Pe(),r=Ce(n.data,"mcp"),c=kt(),l=je(v=>v.sessions),h=je(v=>v.fetchSessions),u=je(v=>v.loading),m=o.useMemo(()=>t?null:xo(l),[t,l]),d=t??m?.session_id,[g,S]=o.useState(null),[p,k]=o.useState(null),[A,E]=o.useState(!1),[R,$]=o.useState(null),y=ua({sessionId:d}),[F,L]=o.useState("");o.useEffect(()=>{t||!r||l.length>0||h()},[t,r,l.length,h]);const P=ge({queryKey:Ee.list(d??""),queryFn:()=>{if(!d)throw new Error("No conversation selected.");return ya(d)},enabled:r&&!!d,staleTime:1e4}),T=ma(P.data),C=o.useMemo(()=>fo(a,T.map(v=>v.name)),[a,T]),b=C?.kind==="matched"?C.name:null,D=o.useRef(null),j=o.useRef(null),Q=F.trim().toLowerCase(),G=o.useMemo(()=>Q?T.filter(v=>v.name.toLowerCase().includes(Q)):T,[T,Q]);o.useEffect(()=>{!b||j.current===b||!F||L("")},[b,F]),o.useEffect(()=>{b&&j.current!==b&&G.some(v=>v.name===b)&&(j.current=b,D.current?.scrollIntoView({block:"center",behavior:"smooth"}))},[b,G]);const te=o.useCallback(()=>{d&&c.invalidateQueries({queryKey:Ee.list(d)})},[c,d]),K=o.useCallback(async(v,Y,ae={})=>{if(d){k(null);try{await fe({op:"mcp.control",sessionId:d,control:{action:v,name:Y,...ae}}),te()}catch(W){const N=c.getQueryData(Ee.list(d));k(Mt(po[v],W,ha(N?.operations)))}}},[c,d,te]);return r?d?e.jsx(H,{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:[p&&e.jsxs(V,{variant:"danger",children:[e.jsx("p",{children:p.message}),p.detail?e.jsx("p",{className:"font-mono text-ink-dim text-mono-sm",title:p.detail,children:p.detail}):null]}),m&&e.jsxs("p",{className:"text-body-sm text-ink-muted",children:["Showing MCP servers for"," ",m.title?.trim()||m.session_id.slice(0,6),", your most recent conversation. Open a conversation to see its own list."]}),P.isLoading&&e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(ee,{size:"lg",label:"Loading MCP servers"})}),P.isError&&e.jsx(V,{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(M,{variant:"secondary",size:"sm",onClick:()=>void P.refetch(),children:"Retry"})]})}),T.length>0&&e.jsxs("div",{className:"relative",children:[e.jsx(Nt,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-ink-dim"}),e.jsx(oe,{value:F,onChange:v=>L(v.target.value),placeholder:"Search MCP servers","aria-label":"Search MCP servers",className:"pl-9"})]}),C?.kind==="miss"&&T.length>0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:`No MCP server matches "${C.asked}".`}),C?.kind==="matched"&&C.unresolved&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:`Showing "${C.name}" — "${C.unresolved}" is not one of your servers.`}),P.isSuccess&&T.length===0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No MCP servers configured yet. Add one below."}),T.length>0&&G.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(M,{variant:"secondary",size:"sm",onClick:()=>L(""),children:"Clear search"})]}),G.length>0&&e.jsx("ul",{className:"flex flex-col gap-2",children:G.map(v=>{const Y=v.status==="connected",ae=v.name===b,W=v.owned_scope,N=v.transport==="http"&&v.transport_oauth_supported!==!1,U=ho(v.source);return e.jsxs("li",{ref:ae?D:void 0,className:X("flex flex-col gap-2 rounded-md border border-control bg-surface p-3",ae&&"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:v.name}),W&&e.jsx(Se,{variant:"outline",children:W==="project"?"This project":"Global"}),v.transport&&e.jsx("span",{className:"text-meta text-ink-dim",children:v.transport})]}),e.jsx(Se,{variant:Y?"success":v.status==="connecting"?"info":v.status==="auth-required"?"warning":"neutral",children:v.status??"unknown"})]}),typeof v.tool_count=="number"&&e.jsxs("p",{className:"text-meta text-ink-dim",children:[v.tool_count," tools available"]}),v.status==="auth-required"&&!N&&e.jsx("p",{className:"text-meta text-ink-dim",children:v.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."}),!W&&e.jsxs("p",{className:"text-meta text-ink-dim",children:[U?`Imported from ${U}.`:"Imported from a configuration local-operator does not write."," ",v.source?e.jsxs(e.Fragment,{children:["Remove it in"," ",e.jsx("span",{className:"font-mono text-mono-sm text-ink-dim",children:pa(v.source)}),"."]}):e.jsx(e.Fragment,{children:"Remove it wherever it is defined."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Y?e.jsxs(M,{variant:"secondary",size:"sm",onClick:()=>{S(null),K("disconnect",v.name,{confirmed:!0})},children:[e.jsx(At,{"aria-hidden":"true"}),"Disconnect"]}):e.jsxs(M,{variant:"secondary",size:"sm",onClick:()=>void K("connect",v.name),children:[e.jsx(Nn,{"aria-hidden":"true"}),"Connect"]}),e.jsxs(M,{variant:"ghost",size:"sm",onClick:()=>void K("reload",v.name),children:[e.jsx(Ut,{"aria-hidden":"true"}),"Reload"]}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>{const I=fa(P.data?.servers??[]).find(se=>se.name===v.name);I&&$({row:I,sessionId:d})},children:"Sign in"}),v.setup?.text?e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>{navigator.clipboard.writeText(v.setup?.text??"").catch(()=>{})},children:"Copy setup prompt"}):null,W?g===v.name?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-body-sm text-ink",children:["Remove ",v.name,"?"]}),e.jsx(M,{variant:"danger",size:"sm",onClick:()=>{S(null),K("remove",v.name,{confirmed:!0,scope:W})},children:"Confirm removal"}),e.jsx(M,{variant:"ghost",size:"sm",onClick:()=>S(null),children:"Keep"})]}):e.jsxs(M,{variant:"ghost",size:"sm",className:"text-danger",onClick:()=>S(v.name),children:[e.jsx(_t,{"aria-hidden":"true"}),"Remove"]}):null]})]},v.name)})}),R?.sessionId===d?e.jsx(xa,{row:R.row,remedy:y,onClose:()=>$(null)},d):null,A?e.jsx(go,{sessionId:d,onAdded:()=>{E(!1),te()}}):e.jsx("div",{children:e.jsx(M,{variant:"secondary",size:"sm",onClick:()=>E(!0),"data-tour-tag":"mcp-add-server",children:"Add server"})})]})}):e.jsx(H,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts.",sectionRef:s,children:u?e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(ee,{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(H,{title:"Integrations",description:"MCP servers connect agents to your tools and accounts.",sectionRef:s,children:e.jsx(V,{variant:"warning",children:"Integration management needs a newer Local Operator backend. Update the backend and restart the app to manage MCP servers here."})})},vo=({onAfterCredentialUpdate:t})=>{const{isAuthenticated:s,user:a,isLoading:n,error:r,signOut:c}=va(),l=Et(d=>d.isSigningOut),h=o.useCallback(async()=>{try{await c()}catch(d){console.error("Error signing out:",d)}},[c]),u=o.useMemo(()=>{if(!s||!a?.radientUser)return null;const{account:d,identity:g}=a.radientUser;return e.jsxs(e.Fragment,{children:[e.jsxs(qe,{children:[e.jsx(Z,{label:"Status",value:e.jsxs("span",{className:"inline-flex items-center gap-2",children:["Connected",e.jsx(Se,{variant:"success",className:"capitalize",children:d.status})]})}),e.jsx(Z,{label:"Name",value:d.name||"Not provided"}),e.jsx(Z,{label:"Email",value:d.email}),e.jsx(Z,{label:"Account ID",value:e.jsx("span",{className:"text-mono-sm",children:d.id})}),e.jsx(Z,{label:"Tenant ID",value:e.jsx("span",{className:"text-mono-sm",children:d.tenant_id})}),e.jsx(Z,{label:"Provider",value:e.jsx("span",{className:"capitalize",children:g.provider})}),e.jsx(Z,{label:"Created",value:Tt(d.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(M,{variant:"danger",className:"mt-3",onClick:h,children:[e.jsx(ka,{}),"Sign out from Radient"]})]})]})},[s,a?.radientUser,h]),m=o.useMemo(()=>s&&a?null:e.jsxs("div",{children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:"You are not currently signed in to Radient. 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(Va,{titleText:"",onAfterCredentialUpdate:t,descriptionText:"",onSignInSuccess:()=>{}})})]}),[s,a,t]);return n||l?e.jsx("div",{className:"flex min-h-36 items-center justify-center",children:e.jsx(ee,{size:"lg",label:"Loading account"})}):s&&a?.radientUser?u:e.jsxs("div",{className:"flex flex-col gap-4",children:[r&&e.jsxs(V,{variant:"danger",children:["Error checking account status:"," ",r instanceof Error?r.message:String(r)]}),m]})};function ko({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(gr,{data:s,children:e.jsx(bt,{type:"monotone",dataKey:"value",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:0},name:t==="credits"?"Credits consumed":"Tokens used"})})})}const bo=()=>{const{data:t,isLoading:s,error:a,refetch:n}=pr(),r=fr(),[c,l]=o.useState(""),[h,u]=o.useState(!1);o.useEffect(()=>{l(t?.content??""),u(!1)},[t]);const m=k=>{const A=k.target.value;l(A),u(A!==(t?.content??""))},d=async()=>{if(!(!h||r.isPending))try{const k={content:c};await r.mutateAsync(k),await n(),u(!1)}catch(k){console.error("Error updating system prompt:",k)}},g=()=>{l(t?.content??""),u(!1)},S=r.isPending,p=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(le,{htmlFor:"app-system-prompt",children:"Instructions"}),e.jsx(ze,{id:"app-system-prompt",name:"systemPrompt",value:c,onChange:m,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(M,{variant:"primary",onClick:d,disabled:!h||S,children:[S?e.jsx(ee,{size:"sm"}):e.jsx(wa,{}),S?"Saving...":"Save changes"]}),e.jsx(M,{onClick:g,disabled:!h||S,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:Rt(t.last_modified)})]})]});return e.jsx(H,{title:"System prompt",icon:Ga,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(ee,{size:"lg",label:"Loading system prompt"})}):a?e.jsxs(V,{variant:"danger",children:["Failed to load system prompt:"," ",a instanceof Error?a.message:"Unknown error"]}):p()})},jo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],wo=t=>jo.includes(t),No=t=>{const s=[];let a=0;for(const n of t){const r=Math.max(0,Math.floor(n.count)),c=Math.max(1,Math.floor(n.columns));for(let l=0;l<r;l+=c)s.push({start:a+l,count:Math.min(c,r-l)});a+=r}return s},_o=({index:t,key:s,groups:a})=>{const n=No(a),r=n.reduce((c,l)=>c+l.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 c=n.findIndex(u=>t>=u.start&&t<u.start+u.count),l=n[c+(s==="ArrowDown"?1:-1)];if(!l)return t;const h=t-n[c].start;return l.start+Math.min(h,l.count-1)}default:return t}},So={localOperatorDark:yn,localOperatorLight:Pn,dracula:Rn,dune:Bs,sage:cn,monokai:Ht,tokyoNight:jn,iceberg:In,radient:tn,neon:mr,obsidian:Lt,synth:as,catppuccinMocha:Ms,catppuccinLatte:pn,tokyoNightStorm:ks,gruvbox:ds,nord:dr,oneDark:es,solarizedDark:Fn,rosePine:Ks,rosePineMoon:xn,rosePineDawn:Ss,alucard:Zs,gruvboxLight:zs,tokyoNightDay:kn,oneLight:dn,catppuccinFrappe:Ls,catppuccinMacchiato:sn,palenight:Sa,everforest:er,everforestLight:Jn,kanagawaWave:or,kanagawaLotus:Vs,ayuDark:Ds,ayuMirage:Os,ayuLight:Mn,nightfox:js,duskfox:Hn,synthwave:Sn,matrix:ns,tron:ys,cyberpunk:_a,vaporwave:Qn,outrun:cs,neonNoir:ar,arcade:rn,forest:Yn,ocean:Us,desert:Gn,autumn:cr,lavender:$n,arctic:Ns,rosewood:Xs,solarizedLight:qn,githubLight:Ws,paper:Na,linen:En,highContrastLight:Ja,mintLight:os},dt="bg-[color-mix(in_srgb,var(--color-accent)_8%,var(--color-accent-wash))]",Co=({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"})]})]})]}),Mo=({id:t,name:s,description:a,isSelected:n,isTabStop:r,onSelect:c,onFocusTile:l})=>{const h=So[t];return e.jsx(_e,{side:"bottom",align:"start",content:a,children:e.jsxs("button",{type:"button","data-theme-tile":t,"aria-pressed":n,tabIndex:r?0:-1,onFocus:l,onClick:c,className:X("relative flex flex-col gap-1.5 rounded-md p-1 text-left transition-colors duration-fast ease-out-quart",n?dt:"hover:bg-surface"),children:[e.jsxs("span",{className:X("relative block h-10 overflow-hidden rounded-sm border transition-colors duration-fast ease-out-quart",n?"border-accent":"border-hairline"),children:[e.jsx(Co,{id:t}),n&&e.jsx("span",{className:X("pointer-events-none absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full",dt),children:e.jsx(xt,{size:12,className:"text-accent","aria-hidden":"true"})})]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(h,{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})]})]})})},Ao=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)}}),Eo=()=>{const{themeName:t,setTheme:s}=De(),a=o.useMemo(()=>{const h=Object.values(qt);return[{label:"Dark",items:h.filter(u=>u.theme.palette.mode==="dark")},{label:"Light",items:h.filter(u=>u.theme.palette.mode==="light")}].filter(u=>u.items.length>0)},[]),[n,r]=o.useState(null),c=o.useMemo(()=>{const h=a.flatMap(u=>u.items.map(m=>m.id));return n&&h.includes(n)?n:h.includes(t)?t:h[0]},[a,n,t]),l=h=>{if(!wo(h.key))return;const u=[...h.currentTarget.querySelectorAll("[data-theme-tile]")],m=u.indexOf(h.target);if(m<0)return;h.preventDefault();const d=_o({index:m,key:h.key,groups:Ao(h.currentTarget)});d!==m&&u[d]?.focus()};return e.jsx(Bt,{children:e.jsx("div",{onKeyDown:l,className:"flex flex-col gap-6",children:a.map(h=>e.jsxs("div",{children:[e.jsx("h3",{className:"px-1 pb-2 text-meta text-ink-dim",children:h.label}),e.jsx("div",{"data-theme-grid":h.label,className:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-2",children:h.items.map(({id:u,name:m,description:d})=>e.jsx(Mo,{id:u,name:m,description:d,isSelected:u===t,isTabStop:u===c,onSelect:()=>s(u),onFocusTile:()=>r(u)},u))})]},h.label))})})},To=()=>{const{data:t,isLoading:s,error:a}=kr({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(Ts,{size:16,className:"shrink-0 text-ink-dim"}),"Radient Pass"]}),s&&e.jsx(gt,{className:"h-6 w-36"}),a&&e.jsxs(V,{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(M,{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(xs,{}),"Add credits"]})})]})]})},Ro=[{id:"credits",label:"Credits"},{id:"tokens",label:"Tokens"}],Lo=()=>{const[t,s]=o.useState("credits"),a=o.useMemo(()=>{const h=new Date,u=yr(h);return{start_date:Qe(u),end_date:Qe(h),rollup:"daily"}},[]),{data:n,isLoading:r,error:c}=wr(a,{enabled:!0}),l=o.useMemo(()=>n?.data_points?[...n.data_points].sort((u,m)=>Re(u.timestamp).getTime()-Re(m.timestamp).getTime()).map(u=>({bucket:qa(Qa(Re(u.timestamp),"yyyy-MM-dd")),value:t==="credits"?Number.parseFloat(u.total_cost.toFixed(2)):u.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(ms,{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:Ro.map(({id:h,label:u})=>e.jsx(M,{variant:"ghost",size:"sm","aria-pressed":t===h,onClick:()=>s(h),className:X(t===h&&"bg-surface text-ink hover:bg-surface"),children:u},h))})]})]}),r&&e.jsx(gt,{className:"h-62 w-full"}),c&&e.jsxs(V,{variant:"warning",children:["Could not load your usage data. ",c.message]}),!r&&!c&&n&&l.length>0&&e.jsx(ko,{metric:t,data:l}),!r&&!c&&(!n||l.length===0)&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:"No usage recorded in the last 30 days."})]})},Io=()=>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(Ba,{size:16,className:"shrink-0 text-ink-dim"}),"Radient account"]}),e.jsx(M,{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(St,{})]})})]}),Po=()=>{const t=De(N=>N.showAgentReasoning),s=De(N=>N.setShowAgentReasoning),{data:a,isLoading:n,isFetching:r,error:c,refetch:l}=Ca(),h=Ma(),[u,m]=o.useState(null),d=Et(),{isAuthenticated:g,isLoading:S}=Oe(),p=je(N=>N.activeSessionId),[k,A]=o.useState("general"),[E,R]=o.useState(!1),$=o.useRef(null),y=o.useRef(null),{startTour:F}=Aa(),L=Ea(),{data:P,refetch:T}=Ct(),{refreshModels:C}=Ta(),b=o.useMemo(()=>P?.keys?[...P.keys].sort():[],[P?.keys]),D=o.useRef({keys:"",hosting:void 0});o.useEffect(()=>{const N=b.join(","),U=a?.values?.hosting;(D.current.keys!==N||D.current.hosting!==U)&&(D.current={keys:N,hosting:U},C().catch(I=>{console.error("Failed to refresh models after credentials or hosting change:",I)}))},[b,a?.values?.hosting,C]);const j=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,Q=o.useMemo(()=>new URLSearchParams(L.search).get("setting"),[L.search]),G=o.useMemo(()=>new URLSearchParams(L.search).get("filter")??"",[L.search]),te=o.useMemo(()=>new URLSearchParams(L.search).get("mcp")??void 0,[L.search]),K=o.useMemo(()=>new URLSearchParams(L.search).get("provider"),[L.search]),v=o.useCallback(N=>{A(N),R(!0);const U=j[N],I=y.current;if(U?.current&&I){const q=U.current.getBoundingClientRect().top-I.getBoundingClientRect().top;I.scrollHeight>I.clientHeight?I.scrollTo({top:Math.max(0,I.scrollTop+q-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,U.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout($.current??void 0),$.current=setTimeout(()=>{R(!1),$.current=null},800)}else R(!1)},[j]);o.useEffect(()=>{const N=setTimeout(()=>{const U=y.current;if(!U)return;const I=()=>{if(E)return;const se=U.getBoundingClientRect(),q=se.height;let B="",J=0;for(const[he,ne]of Object.entries(j))if(ne.current){const re=ne.current.getBoundingClientRect(),de=se.top,ie=re.top-de,ke=re.bottom-de,be=re.height,Ae=Math.max(0,ie),i=Math.min(q,ke),w=Math.max(0,i-Ae)/be,_=w+(ie<q*.3?.1:0);_>J&&w>.1&&(J=_,B=he)}B&&B!==k&&A(B)};return I(),U.addEventListener("scroll",I,{passive:!0}),()=>{U.removeEventListener("scroll",I),clearTimeout($.current??void 0)}},100);return()=>clearTimeout(N)},[j,k,E]),o.useEffect(()=>{const N=new URLSearchParams(L.search),U=N.get("section"),I=N.get("setting")?"backend":U,se=I?j[I]:void 0;if(!I||!se)return;let q=!1,B=Number.NaN,J=0;const he=window.setTimeout(()=>{q||(q=!0,re.disconnect(),v(I))},2e3),ne=()=>{if(q)return;const de=se.current;if(!de){J=requestAnimationFrame(ne);return}const ie=Math.round(de.getBoundingClientRect().top+window.scrollY);if(ie===B&&ie>0){q=!0,re.disconnect(),window.clearTimeout(he),v(I);return}B=ie,J=requestAnimationFrame(ne)},re=new ResizeObserver(()=>{q||(cancelAnimationFrame(J),J=requestAnimationFrame(ne))});return y.current&&re.observe(y.current),J=requestAnimationFrame(ne),()=>{q=!0,cancelAnimationFrame(J),re.disconnect(),window.clearTimeout(he)}},[L.search,j,v]);const Y=async(N,U)=>{m(N);try{await h.mutateAsync({[N]:U}),await l()}catch(I){console.error(`Error updating ${N}:`,I)}finally{m(null)}},ae=n||S,W=br(ae,4e3);return c?e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(V,{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:Ue("Your settings could not be loaded.",c)}),e.jsx(M,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void l(),disabled:r,children:r?"Retrying":"Retry"})]})})}):ae?e.jsxs("div",{role:"status",className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-canvas",children:[e.jsx(ee,{size:"lg",label:W?void 0:"Loading settings"}),W&&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(Ra,{activeSection:k,onSelectSection:v,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(Ha,{title:"Settings",icon:Ye}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsxs("div",{ref:j.general,className:"flex flex-col gap-8",children:[e.jsx(H,{title:"User profile",icon:Ia,description:`Your user profile information displayed in the application. This information is not provided to the agents. ${g?"These details are provided through your Radient account.":""}`,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Ze,{value:d.profile.name,label:"Display name",placeholder:"Enter your name...",isSaving:u==="user_name",onSave:async N=>{m("user_name");try{d.updateName(N)}finally{m(null)}},readOnly:g}),e.jsx(Ze,{value:d.profile.email,label:"Email address",placeholder:"Enter your email...",isSaving:u==="user_email",onSave:async N=>{m("user_email");try{d.updateEmail(N)}finally{m(null)}},readOnly:g})]})}),e.jsx(H,{title:"Application tour",description:"Missed the application onboarding tour or want a refresher? Start it again here.",children:e.jsxs(M,{variant:"secondary",onClick:()=>{F({forceModalCompleted:!0})},children:[e.jsx(ps,{}),"Take the tour"]})}),e.jsx(H,{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($a,{value:a.values.hosting,isSaving:u==="hosting",onSave:N=>Y("hosting",N),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:"No hosting providers available. Add one in API credentials, in the list on the left."}),e.jsx(Da,{value:a.values.model_name,hostingId:a.values.hosting,isSaving:u==="model_name",onSave:N=>Y("model_name",N),allowCustom:!0,allowDefault:!1}),e.jsx(V,{variant:"neutral",icon:e.jsx(Ie,{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(bo,{}),e.jsx(H,{title:"History settings",icon:Za,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(Te,{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:Fa,isSaving:u==="conversation_length",onChange:N=>Y("conversation_length",N)}),e.jsx(Te,{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:u==="detail_length",onChange:N=>Y("detail_length",N)}),e.jsx(Te,{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:u==="max_learnings_history",onChange:N=>Y("max_learnings_history",N)})]})}),e.jsx(H,{title:"Configuration information",icon:Ie,description:"System information about the current configuration.",children:e.jsxs(qe,{children:[e.jsx(Z,{label:"Version",value:e.jsx("span",{className:"text-mono-sm",children:a.version})}),e.jsx(Z,{label:"Created",value:Tt(a.metadata.created_at)}),e.jsx(Z,{label:"Last modified",value:Rt(a.metadata.last_modified)}),e.jsx(Z,{label:"Description",value:a.metadata.description||"No description available"})]})})]}),e.jsx(H,{title:"Appearance",icon:Lt,description:"Customize the look and feel of Local Operator",sectionRef:j.appearance,dataTourTag:"settings-appearance-section",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Eo,{}),e.jsx(xr,{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 N=>s(N)})]})}),e.jsx(H,{title:"Radient account",titleComponent:e.jsx(Io,{}),description:"Manage your Radient account, Radient Pass details, and credits.",sectionRef:j.radient,dataTourTag:"settings-radient-account-section",children:e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsx(vo,{onAfterCredentialUpdate:()=>{C(),T()}}),g&&e.jsxs(e.Fragment,{children:[e.jsx(To,{}),e.jsx(Lo,{})]})]})}),e.jsx(H,{title:"Providers",icon:At,description:"Model providers, how you sign in to each, and which are connected.",sectionRef:j.providers,children:e.jsx(Ua,{initialProviderId:K})}),e.jsx(H,{title:"Backend settings",icon:Ye,description:"Every setting the backend registry owns, searchable, with typed editors and scopes.",sectionRef:j.backend,children:e.jsx(co,{focusKey:Q,initialFilter:G})}),e.jsx(yo,{sessionId:p??void 0,sectionRef:j.integrations,highlightServer:te}),e.jsx(H,{title:"API credentials",icon:Me,description:"Manage your API keys for various services and integrations",sectionRef:j.credentials,dataTourTag:"settings-api-credentials-section",children:e.jsx(uo,{})}),e.jsx("div",{ref:j.updates,children:e.jsx(Sr,{})})]})]})})]}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:e.jsx(V,{variant:"warning",className:"w-full max-w-xl",children:"Your settings could not be loaded."})})};export{Po as SettingsPage};