turtlecode 0.3.26 → 0.3.27

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 (110) hide show
  1. package/assets/assets/{_basePickBy-DRtwLXA1.js → _basePickBy-Dseor5mu.js} +1 -1
  2. package/assets/assets/{_baseUniq-BHwt5rYB.js → _baseUniq-Bh4-EzYg.js} +1 -1
  3. package/assets/assets/{arc-703VkapN.js → arc-DDkUJ-vf.js} +1 -1
  4. package/assets/assets/{architectureDiagram-2XIMDMQ5-CObMcrTw.js → architectureDiagram-2XIMDMQ5-Cu_GwT11.js} +1 -1
  5. package/assets/assets/{auth-callback-CsdLcoFy.js → auth-callback-DM_zJivD.js} +1 -1
  6. package/assets/assets/{blockDiagram-WCTKOSBZ-DnMHcn1Q.js → blockDiagram-WCTKOSBZ-Ds4_MC0T.js} +1 -1
  7. package/assets/assets/{c4Diagram-IC4MRINW-D3AcE34_.js → c4Diagram-IC4MRINW-C1os6NTb.js} +1 -1
  8. package/assets/assets/channel-BAzJXAXH.js +1 -0
  9. package/assets/assets/{chunk-4BX2VUAB-C2qzI0O4.js → chunk-4BX2VUAB-CzOSrGqV.js} +1 -1
  10. package/assets/assets/{chunk-55IACEB6-D-1nWAoQ.js → chunk-55IACEB6-B1ttgmiW.js} +1 -1
  11. package/assets/assets/{chunk-FMBD7UC4-CMssrhkO.js → chunk-FMBD7UC4-B499Kca1.js} +1 -1
  12. package/assets/assets/{chunk-JSJVCQXG-zTAdatO4.js → chunk-JSJVCQXG-DrDqUScK.js} +1 -1
  13. package/assets/assets/{chunk-KX2RTZJC-D2iD22zX.js → chunk-KX2RTZJC-DoPKMzaO.js} +1 -1
  14. package/assets/assets/{chunk-NQ4KR5QH-9oNozb5s.js → chunk-NQ4KR5QH-BjJ1jZNF.js} +1 -1
  15. package/assets/assets/{chunk-QZHKN3VN-DvUEPOTC.js → chunk-QZHKN3VN-gDsChDdu.js} +1 -1
  16. package/assets/assets/{chunk-WL4C6EOR-Wh9y8TId.js → chunk-WL4C6EOR-C5oC_TBi.js} +1 -1
  17. package/assets/assets/classDiagram-VBA2DB6C-zr3CTQn1.js +1 -0
  18. package/assets/assets/classDiagram-v2-RAHNMMFH-zr3CTQn1.js +1 -0
  19. package/assets/assets/clone-CPL09VTv.js +1 -0
  20. package/assets/assets/{cose-bilkent-S5V4N54A-D9mCVMc8.js → cose-bilkent-S5V4N54A-ik_5VCSt.js} +1 -1
  21. package/assets/assets/{cssMode-CmvvTrej.js → cssMode-mb36Grza.js} +1 -1
  22. package/assets/assets/{dagre-KLK3FWXG-BPgqvJaS.js → dagre-KLK3FWXG-8P1fIO85.js} +1 -1
  23. package/assets/assets/design-panel-6tFmW_B_.js +1 -0
  24. package/assets/assets/design-panel-D2wi9Dg-.css +1 -0
  25. package/assets/assets/{diagram-E7M64L7V-C_ZIX-Xv.js → diagram-E7M64L7V-BLOJFu6-.js} +1 -1
  26. package/assets/assets/{diagram-IFDJBPK2-BN5GipZ0.js → diagram-IFDJBPK2-OV42IA4f.js} +1 -1
  27. package/assets/assets/{diagram-P4PSJMXO-CxTi_B96.js → diagram-P4PSJMXO-CaMvBW1Z.js} +1 -1
  28. package/assets/assets/{dialog-clone-project-B1_PrPJM.js → dialog-clone-project-w2gsbuNI.js} +1 -1
  29. package/assets/assets/{dialog-connect-provider-Cj4eonFs.js → dialog-connect-provider-DdYA-iVa.js} +2 -2
  30. package/assets/assets/{dialog-create-project-D7nhbRJT.js → dialog-create-project-Dw9WU914.js} +1 -1
  31. package/assets/assets/{dialog-edit-project-CqdgozNA.js → dialog-edit-project-5fEpR5ot.js} +1 -1
  32. package/assets/assets/dialog-fork-SsSEd7Gd.js +1 -0
  33. package/assets/assets/{dialog-manage-models-BRoXOlAb.js → dialog-manage-models-BGCaMX3K.js} +1 -1
  34. package/assets/assets/{dialog-select-directory-UI063Sn3.js → dialog-select-directory-BmhGo7hs.js} +3 -3
  35. package/assets/assets/dialog-select-file-BAlD1Ycx.js +1 -0
  36. package/assets/assets/{dialog-select-mcp-B2qrDpZJ.js → dialog-select-mcp-zSO7yt3A.js} +1 -1
  37. package/assets/assets/dialog-select-model-unpaid-CzFXK3Wy.js +2 -0
  38. package/assets/assets/{dialog-select-provider-CPzhHCE0.js → dialog-select-provider-B1pJlMg-.js} +1 -1
  39. package/assets/assets/{dialog-select-server-S25UIVNU.js → dialog-select-server-COPMeCxW.js} +1 -1
  40. package/assets/assets/dialog-settings-CXlKXQA5.js +1 -0
  41. package/assets/assets/{erDiagram-INFDFZHY-zDzvyTJC.js → erDiagram-INFDFZHY-DmuZ1S1z.js} +1 -1
  42. package/assets/assets/{flowDiagram-PKNHOUZH-BT5lef3c.js → flowDiagram-PKNHOUZH-DKoU7L24.js} +1 -1
  43. package/assets/assets/{freemarker2-B_agDxL9.js → freemarker2-DLqz4_VA.js} +1 -1
  44. package/assets/assets/{ganttDiagram-A5KZAMGK-C3gLXPPH.js → ganttDiagram-A5KZAMGK-DbIBL0_R.js} +3 -3
  45. package/assets/assets/{ghostty-web-CTQlHMh7.js → ghostty-web-DFI9ftn5.js} +1 -1
  46. package/assets/assets/{gitGraphDiagram-K3NZZRJ6-Cj8ImX2I.js → gitGraphDiagram-K3NZZRJ6-CQqTl59q.js} +1 -1
  47. package/assets/assets/{graph-C0gMaluZ.js → graph-CrTunjeA.js} +1 -1
  48. package/assets/assets/{handlebars-Ucfp6mQq.js → handlebars-BDL8K3Y_.js} +1 -1
  49. package/assets/assets/{home-CjCyqVsb.js → home-D7OQgy6F.js} +1 -1
  50. package/assets/assets/{html-CQRzQlxt.js → html-8dPmOEoE.js} +1 -1
  51. package/assets/assets/{htmlMode-C6bXUIxs.js → htmlMode-Bhhem-U-.js} +1 -1
  52. package/assets/assets/{index-DNqzOxQM.js → index-Cl9Gy4vs.js} +525 -525
  53. package/assets/assets/{index-DFs_ngob.css → index-b2zsFxHN.css} +1 -1
  54. package/assets/assets/{infoDiagram-LFFYTUFH-C9qP-enQ.js → infoDiagram-LFFYTUFH-BiTkmEo0.js} +1 -1
  55. package/assets/assets/{ishikawaDiagram-PHBUUO56-Cjovburu.js → ishikawaDiagram-PHBUUO56-DFiA_QyF.js} +1 -1
  56. package/assets/assets/{javascript-j93ymrV_.js → javascript-DqYKby0P.js} +1 -1
  57. package/assets/assets/{journeyDiagram-4ABVD52K-CrVd-mIS.js → journeyDiagram-4ABVD52K-Dvm95U5p.js} +1 -1
  58. package/assets/assets/{jsonMode-DhYPC_Dw.js → jsonMode-DNVxNWJA.js} +1 -1
  59. package/assets/assets/{kanban-definition-K7BYSVSG-D3vax9LP.js → kanban-definition-K7BYSVSG-Bg07LtOy.js} +1 -1
  60. package/assets/assets/{layout-BkR0MXN2.js → layout-BO4GaxHC.js} +1 -1
  61. package/assets/assets/{liquid-Cv6_-LR_.js → liquid-Bi6CZ4qd.js} +1 -1
  62. package/assets/assets/{list-ee-VXnAh.js → list-CbLd2QpP.js} +1 -1
  63. package/assets/assets/{mdx-2mj8UhYN.js → mdx-DB3BLyJY.js} +1 -1
  64. package/assets/assets/{mermaid.core-A5qPJp89.js → mermaid.core-DekouHcR.js} +5 -5
  65. package/assets/assets/{mindmap-definition-YRQLILUH-DbHKqgt9.js → mindmap-definition-YRQLILUH-CPS4QuqT.js} +1 -1
  66. package/assets/assets/{model-viewer-ShLx2vST.js → model-viewer-OosROonL.js} +1 -1
  67. package/assets/assets/{pieDiagram-SKSYHLDU-CxXVoqmk.js → pieDiagram-SKSYHLDU-zz3NxaCg.js} +1 -1
  68. package/assets/assets/{python-DKFJGIak.js → python-dfHvjKmx.js} +1 -1
  69. package/assets/assets/{quadrantDiagram-337W2JSQ-DiMOi3tY.js → quadrantDiagram-337W2JSQ-Brh_f_kd.js} +1 -1
  70. package/assets/assets/{razor-CZah6fcj.js → razor-DF4OOi_x.js} +1 -1
  71. package/assets/assets/{requirementDiagram-Z7DCOOCP-DsTtcYr2.js → requirementDiagram-Z7DCOOCP-kQXvpU2f.js} +1 -1
  72. package/assets/assets/{sankeyDiagram-WA2Y5GQK-AnsZMvNw.js → sankeyDiagram-WA2Y5GQK-7a0tOx42.js} +1 -1
  73. package/assets/assets/select-yT_m8Opa.js +1 -0
  74. package/assets/assets/{sequenceDiagram-2WXFIKYE-BzSTAatC.js → sequenceDiagram-2WXFIKYE-CfqOEUPe.js} +1 -1
  75. package/assets/assets/{server-row-m8CRVHgX.js → server-row-gThwY27P.js} +1 -1
  76. package/assets/assets/session-C1WGvWnQ.js +47 -0
  77. package/assets/assets/session-DUC9Epge.css +1 -0
  78. package/assets/assets/{stateDiagram-RAJIS63D-CvJMC4hk.js → stateDiagram-RAJIS63D-C2rvyf8y.js} +1 -1
  79. package/assets/assets/stateDiagram-v2-FVOUBMTO-Bygu4WaE.js +1 -0
  80. package/assets/assets/status-popover-body-nrXdjhgo.js +2 -0
  81. package/assets/assets/{switch-DetrEpsF.js → switch-DnfWoh_i.js} +1 -1
  82. package/assets/assets/{tag-y9dl2dWD.js → tag-CzzNjHnn.js} +1 -1
  83. package/assets/assets/{timeline-definition-YZTLITO2-Cy0Hq0kG.js → timeline-definition-YZTLITO2-gBwlsZuH.js} +1 -1
  84. package/assets/assets/{treemap-KZPCXAKY-BbdOpBUG.js → treemap-KZPCXAKY-CkeXn87D.js} +1 -1
  85. package/assets/assets/{trellis-badge-demo-BlvzkIiY.js → trellis-badge-demo-B_CUPFto.js} +1 -1
  86. package/assets/assets/{tsMode-MzPZXMAV.js → tsMode-BScrNcq4.js} +1 -1
  87. package/assets/assets/{typescript-CDbDQl2h.js → typescript-BVCwsEpW.js} +1 -1
  88. package/assets/assets/{vennDiagram-LZ73GAT5-BJmalk25.js → vennDiagram-LZ73GAT5-DggLRdTn.js} +1 -1
  89. package/assets/assets/{xlsx-editor-C9bjtFG2.js → xlsx-editor-slR-Oj8_.js} +1 -1
  90. package/assets/assets/{xml-CKlebqQw.js → xml-B3C8PLq5.js} +1 -1
  91. package/assets/assets/{xychartDiagram-JWTSCODW-Ck3Uy__Y.js → xychartDiagram-JWTSCODW-DGguDmaO.js} +1 -1
  92. package/assets/assets/{yaml-fEl6zfTt.js → yaml-7L4M4RJ2.js} +1 -1
  93. package/assets/index.html +2 -2
  94. package/package.json +13 -13
  95. package/assets/assets/channel-BJNb-x5G.js +0 -1
  96. package/assets/assets/classDiagram-VBA2DB6C-CBQLSjUy.js +0 -1
  97. package/assets/assets/classDiagram-v2-RAHNMMFH-CBQLSjUy.js +0 -1
  98. package/assets/assets/clone-XxsBxEOa.js +0 -1
  99. package/assets/assets/connection-popover-CIBeFtIY.js +0 -1
  100. package/assets/assets/context-popover-DtmOjL4X.js +0 -1
  101. package/assets/assets/dialog-fork-BeMaSR4N.js +0 -1
  102. package/assets/assets/dialog-select-file-DfY7AN91.js +0 -1
  103. package/assets/assets/dialog-select-model-unpaid-By8CfCF9.js +0 -2
  104. package/assets/assets/dialog-settings-Doa3-467.js +0 -1
  105. package/assets/assets/select-CmLNgPBv.js +0 -1
  106. package/assets/assets/session-BBXKye8M.js +0 -46
  107. package/assets/assets/session-BqnQGct0.css +0 -1
  108. package/assets/assets/stateDiagram-v2-FVOUBMTO-CsYqNbJd.js +0 -1
  109. package/assets/assets/status-popover-body-D1kGt0wd.js +0 -2
  110. package/assets/assets/tabs-6_4pkHSU.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-create-project-D7nhbRJT.js","assets/index-DNqzOxQM.js","assets/index-DFs_ngob.css","assets/dialog-clone-project-B1_PrPJM.js"])))=>i.map(i=>d[i]);
2
- import{u as K,y as B,c as G,f as M,h as V,i as b,z as Z,m,l as y,I as z,A as D,C as q,E as R,_ as j,G as H,t as S}from"./index-DNqzOxQM.js";import{L as N,f as Y}from"./list-ee-VXnAh.js";var P=S('<div class="w-full flex items-center justify-between rounded-md"><div class="flex items-center gap-x-3 grow min-w-0"><span class="text-14-regular text-text-interactive-base">'),J=S('<div class="w-full flex items-center justify-between rounded-md"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular min-w-0"><span class="text-text-strong whitespace-nowrap">~</span><span class="text-text-weak whitespace-nowrap">/'),Q=S('<div class="w-full flex items-center justify-between rounded-md"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular min-w-0"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap"></span><span class="text-text-weak whitespace-nowrap">/');const $="__clone__";function W(r){return((r??"").split(/\r?\n/)[0]??"").replace(/[\u0000-\u001F\u007F]/g,"").trim()}function U(r){const e=r.replaceAll("\\","/");return e.startsWith("//")&&!e.startsWith("///")?"//"+e.slice(2).replace(/\/+/g,"/"):e.replace(/\/+/g,"/")}function w(r){const e=U(r);return/^[A-Za-z]:$/.test(e)?e+"/":e}function _(r){const e=w(r);return e==="/"||e==="//"||/^[A-Za-z]:\/$/.test(e)?e:e.replace(/\/+$/,"")}function X(r){const e=w(r);return e.startsWith("//")?"//":e.startsWith("/")?"/":/^[A-Za-z]:\//.test(e)?e.slice(0,3):""}function ee(r){const e=w(r.trim());return e?e.startsWith("~")?"tilde":X(e)?"absolute":"relative":"relative"}function E(r,e){const i=_(r);if(!e)return"";const n=_(e),a=i.toLowerCase(),c=n.toLowerCase();return a===c?"~":a.startsWith(c+"/")?"~"+i.slice(n.length):""}function A(r,e,i){const n=_(r);return ee(e)==="absolute"?n:E(n,i)||n}function te(r,e,i){const n=_(r),a=E(n,e),c=o=>o?o.endsWith("/")?o:o+"/":"",d=Array.from(new Set([n,c(n),a,c(a),R(n)].filter(Boolean))).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-create-project-Dw9WU914.js","assets/index-Cl9Gy4vs.js","assets/index-b2zsFxHN.css","assets/dialog-clone-project-w2gsbuNI.js"])))=>i.map(i=>d[i]);
2
+ import{u as K,y as B,c as G,f as M,h as V,i as b,z as Z,m,l as y,I as z,A as D,C as q,E as R,_ as j,G as H,t as S}from"./index-Cl9Gy4vs.js";import{L as N,f as Y}from"./list-CbLd2QpP.js";var P=S('<div class="w-full flex items-center justify-between rounded-md"><div class="flex items-center gap-x-3 grow min-w-0"><span class="text-14-regular text-text-interactive-base">'),J=S('<div class="w-full flex items-center justify-between rounded-md"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular min-w-0"><span class="text-text-strong whitespace-nowrap">~</span><span class="text-text-weak whitespace-nowrap">/'),Q=S('<div class="w-full flex items-center justify-between rounded-md"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular min-w-0"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap"></span><span class="text-text-weak whitespace-nowrap">/');const $="__clone__";function W(r){return((r??"").split(/\r?\n/)[0]??"").replace(/[\u0000-\u001F\u007F]/g,"").trim()}function U(r){const e=r.replaceAll("\\","/");return e.startsWith("//")&&!e.startsWith("///")?"//"+e.slice(2).replace(/\/+/g,"/"):e.replace(/\/+/g,"/")}function w(r){const e=U(r);return/^[A-Za-z]:$/.test(e)?e+"/":e}function _(r){const e=w(r);return e==="/"||e==="//"||/^[A-Za-z]:\/$/.test(e)?e:e.replace(/\/+$/,"")}function X(r){const e=w(r);return e.startsWith("//")?"//":e.startsWith("/")?"/":/^[A-Za-z]:\//.test(e)?e.slice(0,3):""}function ee(r){const e=w(r.trim());return e?e.startsWith("~")?"tilde":X(e)?"absolute":"relative":"relative"}function E(r,e){const i=_(r);if(!e)return"";const n=_(e),a=i.toLowerCase(),c=n.toLowerCase();return a===c?"~":a.startsWith(c+"/")?"~"+i.slice(n.length):""}function A(r,e,i){const n=_(r);return ee(e)==="absolute"?n:E(n,i)||n}function te(r,e,i){const n=_(r),a=E(n,e),c=o=>o?o.endsWith("/")?o:o+"/":"",d=Array.from(new Set([n,c(n),a,c(a),R(n)].filter(Boolean))).join(`
3
3
  `);return{absolute:n,search:d,group:i}}function re(r){const e=new Set;return r.filter(i=>e.has(i.absolute)?!1:(e.add(i.absolute),!0))}function ne(r){const e=new Map;let i=0;const n=async c=>{const d=_(c),o=e.get(d);if(o)return o;const g=r.sdk.client.file.list({directory:d,path:""}).then(h=>h.data??[]).catch(()=>[]).then(h=>h.filter(u=>u.type==="directory").map(u=>({name:u.name,absolute:_(w(u.absolute))})));return e.set(d,g),g},a=async(c,d,o)=>{const g=await n(c);return d?Y.go(d,g,{key:"name",limit:o}).map(h=>h.obj.absolute):g.slice(0,o).map(h=>h.absolute)};return async c=>{const d=++i,o=()=>d===i,g=W(c),h=_(r.start()??"");if(!h)return[];const u=w(g),v=u.startsWith("~/")?u.slice(2):u.replace(/^\/+/,""),x=await a(h,v.split("/")[0]??"",50);return o()?Array.from(new Set(x)).slice(0,50):[]}}function ie(r){const e=K(),i=B(),n=G(),a=M(),[c,d]=V("");let o;const g=b(()=>!(e.data.path.home||e.data.path.directory)),[h]=Z(()=>g()?!0:void 0,async()=>i.client.path.get().then(t=>t.data).catch(()=>{}),{initialValue:void 0}),u=b(()=>e.data.path.home||h.latest?.home||""),v=b(()=>u()+"/.turtlecode"),x=b(()=>v()),L=ne({sdk:i,start:x}),F={absolute:"__create__",search:a.t("dialog.directory.create")+`
4
4
  new blank project`,group:"create"},I={absolute:$,search:a.t("dialog.clone.title")+`
5
- clone github import`,group:"create"},O=async t=>{const s=(await L(t)).map(f=>te(f,u(),"folders"));return[F,I,...re(s)]};function k(t){r.onSelect(r.multiple?[t]:t),n.close()}return m(H,{get title(){return r.title??a.t("command.project.open")},get children(){return m(N,{get search(){return{placeholder:a.t("dialog.directory.search.placeholder"),autofocus:!0}},get emptyMessage(){return a.t("dialog.directory.empty")},get loadingMessage(){return a.t("common.loading")},items:O,key:t=>t.absolute,filterKeys:["search"],groupBy:t=>t.group,sortGroupsBy:(t,l)=>t.category===l.category?0:t.category==="create"?-1:l.category==="create"?1:t.category==="recent"?-1:1,groupHeader:t=>{if(t.category!=="create")return t.category==="recent"?a.t("home.recentProjects"):a.t("command.project.open")},ref:t=>o=t,onFilter:t=>d(W(t)),onKeyEvent:(t,l)=>{if(t.key!=="Tab"||t.shiftKey||!l)return;t.preventDefault(),t.stopPropagation();const s=A(l.absolute,c(),u());o?.setFilter(s.endsWith("/")?s:s+"/")},onSelect:t=>{if(t){if(t.absolute==="__create__"){n.close(),setTimeout(()=>{j(()=>import("./dialog-create-project-D7nhbRJT.js"),__vite__mapDeps([0,1,2])).then(l=>{n.show(()=>m(l.DialogCreateProject,{get multiple(){return r.multiple},get onSelect(){return r.onSelect}}),()=>r.onSelect(null))})});return}if(t.absolute===$){n.close(),setTimeout(()=>{j(()=>import("./dialog-clone-project-B1_PrPJM.js"),__vite__mapDeps([3,1,2])).then(l=>{n.show(()=>m(l.DialogCloneProject,{onSelect:s=>s&&k(s)}),()=>r.onSelect(null))})});return}k(t.absolute)}},children:t=>{if(t.absolute==="__create__")return(()=>{var s=P(),f=s.firstChild,p=f.firstChild;return y(f,m(z,{name:"plus",size:"small",class:"shrink-0 size-4 text-icon-interactive-base"}),p),y(p,()=>a.t("dialog.directory.create")),s})();if(t.absolute===$)return(()=>{var s=P(),f=s.firstChild,p=f.firstChild;return y(f,m(z,{name:"branch",size:"small",class:"shrink-0 size-4 text-icon-interactive-base"}),p),y(p,()=>a.t("dialog.clone.title")),s})();const l=A(t.absolute,c(),u());return l==="~"?(()=>{var s=J(),f=s.firstChild,p=f.firstChild;return y(f,m(D,{get node(){return{path:t.absolute,type:"directory"}},class:"shrink-0 size-4"}),p),s})():(()=>{var s=Q(),f=s.firstChild,p=f.firstChild,C=p.firstChild,T=C.nextSibling;return y(f,m(D,{get node(){return{path:t.absolute,type:"directory"}},class:"shrink-0 size-4"}),p),y(C,()=>q(l)),y(T,()=>R(l)),s})()}})}})}export{ie as DialogSelectDirectory};
5
+ clone github import`,group:"create"},O=async t=>{const s=(await L(t)).map(f=>te(f,u(),"folders"));return[F,I,...re(s)]};function k(t){r.onSelect(r.multiple?[t]:t),n.close()}return m(H,{get title(){return r.title??a.t("command.project.open")},get children(){return m(N,{get search(){return{placeholder:a.t("dialog.directory.search.placeholder"),autofocus:!0}},get emptyMessage(){return a.t("dialog.directory.empty")},get loadingMessage(){return a.t("common.loading")},items:O,key:t=>t.absolute,filterKeys:["search"],groupBy:t=>t.group,sortGroupsBy:(t,l)=>t.category===l.category?0:t.category==="create"?-1:l.category==="create"?1:t.category==="recent"?-1:1,groupHeader:t=>{if(t.category!=="create")return t.category==="recent"?a.t("home.recentProjects"):a.t("command.project.open")},ref:t=>o=t,onFilter:t=>d(W(t)),onKeyEvent:(t,l)=>{if(t.key!=="Tab"||t.shiftKey||!l)return;t.preventDefault(),t.stopPropagation();const s=A(l.absolute,c(),u());o?.setFilter(s.endsWith("/")?s:s+"/")},onSelect:t=>{if(t){if(t.absolute==="__create__"){n.close(),setTimeout(()=>{j(()=>import("./dialog-create-project-Dw9WU914.js"),__vite__mapDeps([0,1,2])).then(l=>{n.show(()=>m(l.DialogCreateProject,{get multiple(){return r.multiple},get onSelect(){return r.onSelect}}),()=>r.onSelect(null))})});return}if(t.absolute===$){n.close(),setTimeout(()=>{j(()=>import("./dialog-clone-project-w2gsbuNI.js"),__vite__mapDeps([3,1,2])).then(l=>{n.show(()=>m(l.DialogCloneProject,{onSelect:s=>s&&k(s)}),()=>r.onSelect(null))})});return}k(t.absolute)}},children:t=>{if(t.absolute==="__create__")return(()=>{var s=P(),f=s.firstChild,p=f.firstChild;return y(f,m(z,{name:"plus",size:"small",class:"shrink-0 size-4 text-icon-interactive-base"}),p),y(p,()=>a.t("dialog.directory.create")),s})();if(t.absolute===$)return(()=>{var s=P(),f=s.firstChild,p=f.firstChild;return y(f,m(z,{name:"branch",size:"small",class:"shrink-0 size-4 text-icon-interactive-base"}),p),y(p,()=>a.t("dialog.clone.title")),s})();const l=A(t.absolute,c(),u());return l==="~"?(()=>{var s=J(),f=s.firstChild,p=f.firstChild;return y(f,m(D,{get node(){return{path:t.absolute,type:"directory"}},class:"shrink-0 size-4"}),p),s})():(()=>{var s=Q(),f=s.firstChild,p=f.firstChild,C=p.firstChild,T=C.nextSibling;return y(f,m(D,{get node(){return{path:t.absolute,type:"directory"}},class:"shrink-0 size-4"}),p),y(C,()=>q(l)),y(T,()=>R(l)),s})()}})}})}export{ie as DialogSelectDirectory};
@@ -0,0 +1 @@
1
+ import{l as g,q as T,V as Q,t as S,aL as U,f as X,a as Z,aM as ee,c as te,d as ne,y as se,u as re,h as ae,i as b,P as oe,m as y,aN as ie,aG as ce,aH as j,S as C,aO as le,I as de,A as ue,C as fe,E as P,G as ge,r as he}from"./index-Cl9Gy4vs.js";import{L as me}from"./list-CbLd2QpP.js";import{u as pe,c as we}from"./session-C1WGvWnQ.js";import"./select-yT_m8Opa.js";import"./tag-CzzNjHnn.js";import"./transform-BwXaE9hv.js";var ye=S("<span data-component=keybind>");function ve(t){return(()=>{var n=ye();return g(n,()=>t.children),T(a=>Q(n,{...t.classList??{},[t.class??""]:!!t.class},a)),n})()}function be(t,n){const a=new Date(t),r=new Date().getTime()-a.getTime(),c=Math.floor(r/1e3),u=Math.floor(c/60),o=Math.floor(u/60),f=Math.floor(o/24);return c<60?n("common.time.justNow"):u<60?n("common.time.minutesAgo.short",{count:u}):o<24?n("common.time.hoursAgo.short",{count:o}):n("common.time.daysAgo.short",{count:f})}var A=S('<span class="text-14-regular text-text-weak truncate">'),xe=S('<div class="w-full flex items-center justify-between gap-4"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong whitespace-nowrap">'),$e=S('<span class="text-12-regular text-text-weak whitespace-nowrap ml-2">'),ke=S('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong truncate">'),Se=S('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap">');const E=5,_e=["session.new","workspace.new","session.previous","session.next","terminal.toggle","review.toggle"],K=t=>{const n=new Set,a=[];for(const h of t)n.has(h.id)||(n.add(h.id),a.push(h));return a},N=(t,n)=>({id:"command:"+t.id,type:"command",title:t.title,description:t.description,keybind:t.keybind,category:n,option:t}),D=(t,n)=>({id:"file:"+t,type:"file",title:t,category:n,path:t}),Me=(t,n)=>({id:`session:${t.directory}:${t.id}`,type:"session",title:t.title,description:t.description,category:n,directory:t.directory,sessionID:t.id,archived:t.archived,updated:t.updated});function Ce(t){const n=b(()=>t.filesOnly()?[]:t.command.options.filter(r=>!r.disabled&&!r.id.startsWith("suggested.")&&r.id!=="file.open")),a=b(()=>{const r=t.language.t("palette.group.commands");return n().map(c=>N(c,r))}),h=b(()=>{const r=n(),c=new Map(_e.map((i,l)=>[i,l])),u=r.filter(i=>c.has(i.id)),o=u.length?u:r.slice(0,E),f=u.length?[...o].sort((i,l)=>(c.get(i.id)??0)-(c.get(l.id)??0)):o,v=t.language.t("palette.group.commands");return f.map(i=>N(i,v))});return{allowed:n,list:a,picks:h}}function De(t){const n=we({tabs:t.tabs,pathFromTab:t.file.pathFromTab,normalizeTab:r=>r.startsWith("file://")?t.file.tab(r):r}),a=b(()=>{const r=n.openedTabs(),c=n.activeFileTab(),u=c?[c,...r.filter(i=>i!==c)]:r,o=new Set,f=t.language.t("palette.group.files"),v=[];for(const i of u){const l=t.file.pathFromTab(i);l&&(o.has(l)||(o.add(l),v.push(D(l,f))))}return v.slice(0,E)}),h=b(()=>{const r=t.language.t("palette.group.files");return t.file.tree.children("").filter(o=>o.type==="file").map(o=>o.path).sort((o,f)=>o.localeCompare(f)).slice(0,E).map(o=>D(o,r))});return{recent:a,root:h}}function Fe(t){const n={token:0,inflight:void 0,cached:void 0};return{sessions:h=>{if(!h.trim())return n.token+=1,n.inflight=void 0,n.cached=void 0,[];if(n.cached)return n.cached;if(n.inflight)return n.inflight;const c=n.token,u=t.workspaces();return u.length===0?[]:(n.inflight=Promise.all(u.map(o=>{const f=t.label(o);return t.globalSDK.client.session.list({directory:o,roots:!0}).then(v=>(v.data??[]).filter(i=>!!i?.id).map(i=>({id:i.id,title:i.title??t.language.t("command.session.new"),description:f,directory:o,archived:i.time?.archived,updated:i.time?.updated}))).catch(()=>[])})).then(o=>{if(n.token!==c)return[];const f=new Set,v=t.language.t("command.category.session"),i=o.flat().filter(l=>{const $=`${l.directory}:${l.id}`;return f.has($)?!1:(f.add($),!0)}).map(l=>Me(l,v));return n.cached=i,i}).catch(()=>[]).finally(()=>{n.inflight=void 0}),n.inflight)}}}function Pe(t){const n=U(),a=X(),h=Z(),r=ee(),c=te(),u=ne(),o=se(),f=re(),{params:v,tabs:i,view:l}=pe(),$=()=>t.mode==="files",k={cleanup:void 0,committed:!1},[q,G]=ae(!1),I=Ce({filesOnly:$,command:n,language:a}),_=De({file:r,tabs:i,language:a}),L=b(()=>ie(v.dir)??""),O=b(()=>{const e=L();if(e)return h.projects.list().find(s=>s.worktree===e||s.sandboxes?.includes(e))}),z=b(()=>{const e=L(),s=O();if(!s)return e?[e]:[];const d=[s.worktree,...s.sandboxes??[]];return e&&!d.includes(e)?[...d,e]:d}),H=b(()=>f.data.path.home),R=e=>{const s=O(),d=s&&e===s.worktree?a.t("workspace.type.local"):a.t("workspace.type.sandbox"),[p]=f.child(e,{bootstrap:!1}),m=H(),w=m?e.replace(m,"~"):e,x=p.vcs?.branch??P(e);return`${d} : ${x||w}`},{sessions:W}=Fe({workspaces:z,label:R,globalSDK:o,language:a}),B=async e=>{const s=e.trim();if(G(s.length>0),!s&&$()){const x=r.tree.state("")?.loaded,F=x?Promise.resolve():r.tree.list(""),M=K([..._.recent(),..._.root()]);return x||M.length>0?M:(await F,K([..._.recent(),..._.root()]))}if(!s)return[...I.picks(),..._.recent()];if($()){const x=await r.searchFiles(s),F=a.t("palette.group.files");return x.map(M=>D(M,F))}const[d,p]=await Promise.all([r.searchFiles(s),Promise.resolve(W(s))]),m=a.t("palette.group.files"),w=d.map(x=>D(x,m));return[...I.list(),...p,...w]},V=e=>{k.cleanup?.(),e&&e.type==="command"&&(k.cleanup=e.option?.onHighlight?.())},Y=e=>{const s=r.tab(e);i().open(s),r.load(e),l().reviewPanel.opened()||l().reviewPanel.open(),h.fileTree.setTab("all"),t.onOpenFile?.(e),i().setActive(s)},J=e=>{if(e){if(k.committed=!0,k.cleanup=void 0,c.close(),e.type==="command"){e.option?.onSelect?.("palette");return}if(e.type==="session"){if(!e.directory||!e.sessionID)return;u(`/${he(e.directory)}/session/${e.sessionID}`);return}if(e.path){if(t.onSelectFile){t.onSelectFile(e.path);return}Y(e.path)}}};return oe(()=>{k.committed||k.cleanup?.()}),y(ge,{class:"pt-3 pb-0 !max-h-[480px]",transition:!0,get children(){return y(me,{get search(){return{placeholder:$()?a.t("session.header.searchFiles"):a.t("palette.search.placeholder"),autofocus:!0,hideIcon:!0}},get emptyMessage(){return a.t("palette.empty")},get loadingMessage(){return a.t("common.loading")},items:B,key:e=>e.id,filterKeys:["title","description","category"],get groupBy(){return q()?e=>e.category:()=>""},onMove:V,onSelect:J,children:e=>y(ce,{get fallback(){return(()=>{var s=Se(),d=s.firstChild,p=d.firstChild,m=p.firstChild,w=m.nextSibling;return g(d,y(ue,{get node(){return{path:e.path??"",type:"file"}},class:"shrink-0 size-4"}),p),g(m,()=>fe(e.path??"")),g(w,()=>P(e.path??"")),s})()},get children(){return[y(j,{get when(){return e.type==="command"},get children(){var s=xe(),d=s.firstChild,p=d.firstChild;return g(p,()=>e.title),g(d,y(C,{get when(){return e.description},get children(){var m=A();return g(m,()=>e.description),m}}),null),g(s,y(C,{get when(){return e.keybind},get children(){return y(ve,{class:"rounded-[4px]",get children(){return le(e.keybind??"",a.t)}})}}),null),s}}),y(j,{get when(){return e.type==="session"},get children(){var s=ke(),d=s.firstChild,p=d.firstChild,m=p.firstChild;return g(d,y(de,{name:"bubble-5",size:"small",class:"shrink-0 text-icon-weak"}),p),g(m,()=>e.title),g(p,y(C,{get when(){return e.description},get children(){var w=A();return g(w,()=>e.description),T(()=>w.classList.toggle("opacity-70",!!e.archived)),w}}),null),g(s,y(C,{get when(){return e.updated},get children(){var w=$e();return g(w,()=>be(new Date(e.updated).toISOString(),a.t)),w}}),null),T(()=>m.classList.toggle("opacity-70",!!e.archived)),s}})]}})})}})}export{Pe as DialogSelectFile};
@@ -1 +1 @@
1
- import{a3 as P,a4 as M,f as D,H as E,O as $,a7 as j,J as F,i as h,L as K,m as u,v as O,l as c,S as v,n as b,G as q,t as m}from"./index-DNqzOxQM.js";import{L as B}from"./list-ee-VXnAh.js";import{S as G}from"./switch-DetrEpsF.js";var H=m('<span class="text-11-regular text-text-weaker">'),J=m('<span class="text-11-regular text-text-weak">'),T=m('<span class="text-11-regular text-text-weaker truncate">'),z=m('<div class="w-full flex items-center justify-between gap-x-3"><div class="flex flex-col gap-0.5 min-w-0"><div class="flex items-center gap-2"><span class=truncate></span></div></div><div>');const A={connected:"mcp.status.connected",failed:"mcp.status.failed",needs_auth:"mcp.status.needs_auth",disabled:"mcp.status.disabled"},R=()=>{const s=P(),d=M(),l=D(),[_,o]=E({done:!1,loading:!1});$(j(()=>s.data.mcp_ready,(e,t)=>{!e&&t&&o("done",!1)},{defer:!0})),$(()=>{if(!(_.done||_.loading)){if(s.data.mcp_ready){o("done",!0);return}o("loading",!0),d.client.mcp.status().then(e=>{s.set("mcp",e.data??{}),s.set("mcp_ready",!0),o("done",!0)}).catch(e=>{o("done",!0),F({variant:"error",title:l.t("common.requestFailed"),description:e instanceof Error?e.message:String(e)})}).finally(()=>{o("loading",!1)})}});const p=h(()=>Object.entries(s.data.mcp??{}).map(([e,t])=>({name:e,status:t.status})).sort((e,t)=>e.name.localeCompare(t.name))),n=K(()=>({mutationFn:async e=>{s.data.mcp[e]?.status==="connected"?await d.client.mcp.disconnect({name:e}):await d.client.mcp.connect({name:e});const i=await d.client.mcp.status();i.data&&s.set("mcp",i.data)}})),S=h(()=>p().filter(e=>e.status==="connected").length),k=h(()=>p().length);return u(q,{get title(){return l.t("dialog.mcp.title")},get description(){return l.t("dialog.mcp.description",{enabled:S(),total:k()})},get children(){return u(B,{get search(){return{placeholder:l.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return l.t("dialog.mcp.empty")},key:e=>e?.name??"",items:p,filterKeys:["name","status"],sortBy:(e,t)=>e.name.localeCompare(t.name),onSelect:e=>{!e||n.isPending||n.mutate(e.name)},children:e=>{const t=()=>s.data.mcp[e.name],i=()=>t()?.status,w=()=>{const r=i()?A[i()]:void 0;if(r)return l.t(r)},x=()=>{const r=t();return r?.status==="failed"?r.error:void 0},C=()=>i()==="connected";return(()=>{var r=z(),g=r.firstChild,f=g.firstChild,L=f.firstChild,y=g.nextSibling;return c(L,()=>e.name),c(f,u(v,{get when(){return w()},get children(){var a=H();return c(a,w),a}}),null),c(f,u(v,{get when(){return b(()=>!!n.isPending)()&&n.variables===e.name},get children(){var a=J();return c(a,()=>l.t("common.loading.ellipsis")),a}}),null),c(g,u(v,{get when(){return x()},get children(){var a=T();return c(a,x),a}}),null),y.$$click=a=>a.stopPropagation(),c(y,u(G,{get checked(){return C()},get disabled(){return b(()=>!!n.isPending)()&&n.variables===e.name},onChange:()=>{n.isPending||n.mutate(e.name)}})),r})()}})}})};O(["click"]);export{R as DialogSelectMcp};
1
+ import{a5 as P,a6 as M,f as D,H as E,O as $,a7 as j,J as F,i as h,L as K,m as u,v as O,l as c,S as v,n as b,G as q,t as m}from"./index-Cl9Gy4vs.js";import{L as B}from"./list-CbLd2QpP.js";import{S as G}from"./switch-DnfWoh_i.js";var H=m('<span class="text-11-regular text-text-weaker">'),J=m('<span class="text-11-regular text-text-weak">'),T=m('<span class="text-11-regular text-text-weaker truncate">'),z=m('<div class="w-full flex items-center justify-between gap-x-3"><div class="flex flex-col gap-0.5 min-w-0"><div class="flex items-center gap-2"><span class=truncate></span></div></div><div>');const A={connected:"mcp.status.connected",failed:"mcp.status.failed",needs_auth:"mcp.status.needs_auth",disabled:"mcp.status.disabled"},R=()=>{const s=P(),d=M(),l=D(),[_,o]=E({done:!1,loading:!1});$(j(()=>s.data.mcp_ready,(e,t)=>{!e&&t&&o("done",!1)},{defer:!0})),$(()=>{if(!(_.done||_.loading)){if(s.data.mcp_ready){o("done",!0);return}o("loading",!0),d.client.mcp.status().then(e=>{s.set("mcp",e.data??{}),s.set("mcp_ready",!0),o("done",!0)}).catch(e=>{o("done",!0),F({variant:"error",title:l.t("common.requestFailed"),description:e instanceof Error?e.message:String(e)})}).finally(()=>{o("loading",!1)})}});const p=h(()=>Object.entries(s.data.mcp??{}).map(([e,t])=>({name:e,status:t.status})).sort((e,t)=>e.name.localeCompare(t.name))),n=K(()=>({mutationFn:async e=>{s.data.mcp[e]?.status==="connected"?await d.client.mcp.disconnect({name:e}):await d.client.mcp.connect({name:e});const i=await d.client.mcp.status();i.data&&s.set("mcp",i.data)}})),S=h(()=>p().filter(e=>e.status==="connected").length),k=h(()=>p().length);return u(q,{get title(){return l.t("dialog.mcp.title")},get description(){return l.t("dialog.mcp.description",{enabled:S(),total:k()})},get children(){return u(B,{get search(){return{placeholder:l.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return l.t("dialog.mcp.empty")},key:e=>e?.name??"",items:p,filterKeys:["name","status"],sortBy:(e,t)=>e.name.localeCompare(t.name),onSelect:e=>{!e||n.isPending||n.mutate(e.name)},children:e=>{const t=()=>s.data.mcp[e.name],i=()=>t()?.status,w=()=>{const r=i()?A[i()]:void 0;if(r)return l.t(r)},x=()=>{const r=t();return r?.status==="failed"?r.error:void 0},C=()=>i()==="connected";return(()=>{var r=z(),g=r.firstChild,f=g.firstChild,L=f.firstChild,y=g.nextSibling;return c(L,()=>e.name),c(f,u(v,{get when(){return w()},get children(){var a=H();return c(a,w),a}}),null),c(f,u(v,{get when(){return b(()=>!!n.isPending)()&&n.variables===e.name},get children(){var a=J();return c(a,()=>l.t("common.loading.ellipsis")),a}}),null),c(g,u(v,{get when(){return x()},get children(){var a=T();return c(a,x),a}}),null),y.$$click=a=>a.stopPropagation(),c(y,u(G,{get checked(){return C()},get disabled(){return b(()=>!!n.isPending)()&&n.variables===e.name},onChange:()=>{n.isPending||n.mutate(e.name)}})),r})()}})}})};O(["click"]);export{R as DialogSelectMcp};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-connect-provider-DdYA-iVa.js","assets/index-Cl9Gy4vs.js","assets/index-b2zsFxHN.css","assets/list-CbLd2QpP.js","assets/tag-CzzNjHnn.js","assets/dialog-select-provider-B1pJlMg-.js"])))=>i.map(i=>d[i]);
2
+ import{ab as k,c as S,ac as E,f as I,m as t,l as r,S as c,Z as L,n as T,ad as g,B as M,G as O,t as u,_ as w,v as A}from"./index-Cl9Gy4vs.js";import{L as $}from"./list-CbLd2QpP.js";import{T as m,P as B}from"./tag-CzzNjHnn.js";import{M as R}from"./session-C1WGvWnQ.js";import"./select-yT_m8Opa.js";import"./transform-BwXaE9hv.js";var G=u('<div class="flex flex-col gap-3 px-2.5"><div class="text-14-medium text-text-base px-2.5">'),K=u('<div class="px-1.5 pb-1.5"><div class="w-full rounded-sm border border-border-weak-base bg-surface-raised-base"><div class="w-full flex flex-col items-start gap-4 px-1.5 pt-4 pb-4"><div class="px-2 text-14-medium text-text-base"></div><div class=w-full>'),V=u('<div class="w-full flex items-center gap-x-2.5"><span>'),h=u('<div class="text-14-regular text-text-weak">'),j=u('<div class="w-full flex items-center gap-x-3"><span>');const H=b=>{const v=b.model??k().model,f=S(),y=E(),i=I(),D=l=>{w(()=>import("./dialog-connect-provider-DdYA-iVa.js").then(s=>s.d),__vite__mapDeps([0,1,2,3,4])).then(s=>{f.show(()=>t(s.DialogConnectProvider,{provider:l}))})},C=()=>{w(()=>import("./dialog-select-provider-B1pJlMg-.js").then(l=>l.d),__vite__mapDeps([5,1,2,3,4,0])).then(l=>{f.show(()=>t(l.DialogSelectProvider,{}))})};let _;const P=l=>{l.key!=="Escape"&&_?.onKeyDown(l)};return t(O,{get title(){return i.t("dialog.model.select.title")},class:"overflow-y-auto [&_[data-slot=dialog-body]]:overflow-visible [&_[data-slot=dialog-body]]:flex-none",get children(){return[(()=>{var l=G(),s=l.firstChild;return l.$$keydown=P,r(s,()=>i.t("dialog.model.unpaid.freeModels.title")),r(l,t($,{class:"[&_[data-slot=list-scroll]]:overflow-visible",ref:e=>_=e,get items(){return v.list},get current(){return v.current()},key:e=>`${e.provider.id}:${e.id}`,itemWrapper:(e,n)=>t(L,{class:"w-full",placement:"right-start",gutter:12,get value(){return t(R,{model:e,get latest(){return e.latest},get free(){return T(()=>e.provider.id==="opencode")()&&(!e.cost||e.cost.input===0)}})},children:n}),onSelect:e=>{v.set(e?{modelID:e.id,providerID:e.provider.id}:void 0,{recent:!0}),f.close()},children:e=>(()=>{var n=V(),p=n.firstChild;return r(p,()=>e.name),r(n,t(m,{get children(){return i.t("model.tag.free")}}),null),r(n,t(c,{get when(){return e.latest},get children(){return t(m,{get children(){return i.t("model.tag.latest")}})}}),null),n})()}),null),l})(),(()=>{var l=K(),s=l.firstChild,e=s.firstChild,n=e.firstChild,p=n.nextSibling;return r(n,()=>i.t("dialog.model.unpaid.addMore.title")),r(p,t($,{class:"w-full px-0",key:o=>o?.id,get items(){return y.popular},activeIcon:"plus-small",sortBy:(o,d)=>g.includes(o.id)&&g.includes(d.id)?g.indexOf(o.id)-g.indexOf(d.id):o.name.localeCompare(d.name),onSelect:o=>{o&&D(o.id)},children:o=>(()=>{var d=j(),x=d.firstChild;return r(d,t(B,{"data-slot":"list-item-extra-icon",get id(){return o.id}}),x),r(x,()=>o.name),r(d,t(c,{get when(){return o.id==="opencode"},get children(){var a=h();return r(a,()=>i.t("dialog.provider.opencode.tagline")),a}}),null),r(d,t(c,{get when(){return o.id==="opencode"},get children(){return t(m,{get children(){return i.t("dialog.provider.tag.recommended")}})}}),null),r(d,t(c,{get when(){return o.id==="opencode-go"},get children(){return[(()=>{var a=h();return r(a,()=>i.t("dialog.provider.opencodeGo.tagline")),a})(),t(m,{get children(){return i.t("dialog.provider.tag.recommended")}})]}}),null),r(d,t(c,{get when(){return o.id==="anthropic"},get children(){var a=h();return r(a,()=>i.t("dialog.provider.anthropic.note")),a}}),null),d})()}),null),r(p,t(M,{variant:"ghost",class:"w-full justify-start px-[11px] py-3.5 gap-4.5 text-14-medium",icon:"dot-grid",onClick:C,get children(){return i.t("dialog.provider.viewAll")}}),null),l})()]}})};A(["keydown"]);export{H as DialogSelectModelUnpaid};
@@ -1 +1 @@
1
- import{c as Z,u as le,y as ne,f as ee,H as se,L as de,J as A,m as o,l as a,p as k,F as V,Q as G,q as J,$ as N,B as T,n as ce,G as re,t as B,aJ as j,aI as q,ab as ue,S as U,ac as K}from"./index-DNqzOxQM.js";import{L as ve}from"./list-ee-VXnAh.js";import{P as te,T as H}from"./tag-y9dl2dWD.js";import{L as me,D as pe}from"./dialog-connect-provider-Cj4eonFs.js";const ge=/^[a-z0-9][a-z0-9-_]*$/,he="@ai-sdk/openai-compatible";function fe(n){const h=n.form.providerID.trim(),s=n.form.name.trim(),y=n.form.baseURL.trim(),r=n.form.apiKey.trim(),d=r.match(/^\{env:([^}]+)\}$/)?.[1]?.trim(),v=r&&!d?r:void 0,t=h?ge.test(h)?void 0:n.t("provider.custom.error.providerID.format"):n.t("provider.custom.error.providerID.required"),u=s?void 0:n.t("provider.custom.error.name.required"),g=y?/^https?:\/\//.test(y)?void 0:n.t("provider.custom.error.baseURL.format"):n.t("provider.custom.error.baseURL.required"),x=n.disabledProviders.includes(h),_=t?void 0:n.existingProviderIDs.has(h)&&!x?n.t("provider.custom.error.providerID.exists"):void 0,w=new Set,S=n.form.models.map(l=>{const p=l.id.trim(),f=p?w.has(p)?n.t("provider.custom.error.duplicate"):(()=>{w.add(p)})():n.t("provider.custom.error.required"),P=l.name.trim()?void 0:n.t("provider.custom.error.required");return{id:f,name:P}}),M=S.every(l=>!l.id&&!l.name),z=Object.fromEntries(n.form.models.map(l=>[l.id.trim(),{name:l.name.trim()}])),D=new Set,L=n.form.headers.map(l=>{const p=l.key.trim(),f=l.value.trim();if(!p&&!f)return{};const P=p?D.has(p.toLowerCase())?n.t("provider.custom.error.duplicate"):(()=>{D.add(p.toLowerCase())})():n.t("provider.custom.error.required"),E=f?void 0:n.t("provider.custom.error.required");return{key:P,value:E}}),e=L.every(l=>!l.key&&!l.value),i=Object.fromEntries(n.form.headers.map(l=>({key:l.key.trim(),value:l.value.trim()})).filter(l=>!!l.key&&!!l.value).map(l=>[l.key,l.value])),m={providerID:t??_,name:u,baseURL:g};return!t&&!_&&!u&&!g&&M&&e?{err:m,models:S,headers:L,result:{providerID:h,name:s,key:v,config:{npm:he,name:s,...d?{env:[d]}:{},options:{baseURL:y,...Object.keys(i).length?{headers:i}:{}},models:z}}}:{err:m,models:S,headers:L}}let be=0;const oe=()=>`row-${be++}`,Q=()=>({row:oe(),id:"",name:"",err:{}}),W=()=>({row:oe(),key:"",value:"",err:{}});var ye=B('<div class="flex flex-col gap-6 px-2.5 pb-3 overflow-y-auto max-h-[60vh]"><div class="px-2.5 flex gap-4 items-center"><div class="text-16-medium text-text-strong"></div></div><form class="px-2.5 pb-6 flex flex-col gap-6"><p class="text-14-regular text-text-base"></p><div class="flex flex-col gap-4"></div><div class="flex flex-col gap-3"><label class="text-12-medium text-text-weak"></label></div><div class="flex flex-col gap-3"><label class="text-12-medium text-text-weak">'),X=B('<div class="flex gap-2 items-start"><div class=flex-1></div><div class=flex-1>');function xe(n){const h=Z(),s=le(),y=ne(),r=ee(),[d,v]=se({providerID:"",name:"",baseURL:"",apiKey:"",models:[Q()],headers:[W()],err:{}}),t=()=>{if(n.back==="close"){h.close();return}h.show(()=>o(ae,{}))},u=()=>{v("models",q(e=>{e.push(Q())}))},g=e=>{d.models.length<=1||v("models",q(i=>{i.splice(e,1)}))},x=()=>{v("headers",q(e=>{e.push(W())}))},_=e=>{d.headers.length<=1||v("headers",q(i=>{i.splice(e,1)}))},w=(e,i)=>{v(e,i),e!=="apiKey"&&v("err",e,void 0)},S=(e,i,m)=>{j(()=>{v("models",e,i,m),v("models",e,"err",i,void 0)})},M=(e,i,m)=>{j(()=>{v("headers",e,i,m),v("headers",e,"err",i,void 0)})},z=()=>{const e=fe({form:d,t:r.t,disabledProviders:s.data.config.disabled_providers??[],existingProviderIDs:new Set(s.data.provider.all.map(i=>i.id))});return j(()=>{v("err",e.err),e.models.forEach((i,m)=>v("models",m,"err",i)),e.headers.forEach((i,m)=>v("headers",m,"err",i))}),e.result},D=de(()=>({mutationFn:async e=>{const m=(s.data.config.disabled_providers??[]).filter($=>$!==e.providerID);return e.key&&await y.client.auth.set({providerID:e.providerID,auth:{type:"api",key:e.key}}),await s.updateConfig({provider:{[e.providerID]:e.config},disabled_providers:m}),e},onSuccess:e=>{h.close(),A({variant:"success",icon:"circle-check",title:r.t("provider.connect.toast.connected.title",{provider:e.name}),description:r.t("provider.connect.toast.connected.description",{provider:e.name})})},onError:e=>{const i=e instanceof Error?e.message:String(e);A({title:r.t("common.requestFailed"),description:i})}})),L=e=>{if(e.preventDefault(),D.isPending)return;const i=z();i&&D.mutate(i)};return o(re,{get title(){return o(G,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:t,get"aria-label"(){return r.t("common.goBack")}})},transition:!0,get children(){var e=ye(),i=e.firstChild,m=i.firstChild,$=i.nextSibling,l=$.firstChild,p=l.nextSibling,f=p.nextSibling,P=f.firstChild,E=f.nextSibling,ie=E.firstChild;return a(i,o(te,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),m),a(m,()=>r.t("provider.custom.title")),$.addEventListener("submit",L),a(l,()=>r.t("provider.custom.description.prefix"),null),a(l,o(me,{href:"https://opencode.ai/docs/providers/#custom-provider",tabIndex:-1,get children(){return r.t("provider.custom.description.link")}}),null),a(l,()=>r.t("provider.custom.description.suffix"),null),a(p,o(k,{autofocus:!0,get label(){return r.t("provider.custom.field.providerID.label")},get placeholder(){return r.t("provider.custom.field.providerID.placeholder")},get description(){return r.t("provider.custom.field.providerID.description")},get value(){return d.providerID},onChange:c=>w("providerID",c),get validationState(){return d.err.providerID?"invalid":void 0},get error(){return d.err.providerID}}),null),a(p,o(k,{get label(){return r.t("provider.custom.field.name.label")},get placeholder(){return r.t("provider.custom.field.name.placeholder")},get value(){return d.name},onChange:c=>w("name",c),get validationState(){return d.err.name?"invalid":void 0},get error(){return d.err.name}}),null),a(p,o(k,{get label(){return r.t("provider.custom.field.baseURL.label")},get placeholder(){return r.t("provider.custom.field.baseURL.placeholder")},get value(){return d.baseURL},onChange:c=>w("baseURL",c),get validationState(){return d.err.baseURL?"invalid":void 0},get error(){return d.err.baseURL}}),null),a(p,o(k,{get label(){return r.t("provider.custom.field.apiKey.label")},get placeholder(){return r.t("provider.custom.field.apiKey.placeholder")},get description(){return r.t("provider.custom.field.apiKey.description")},get value(){return d.apiKey},onChange:c=>w("apiKey",c)}),null),a(P,()=>r.t("provider.custom.models.label")),a(f,o(V,{get each(){return d.models},children:(c,C)=>(()=>{var b=X(),R=b.firstChild,F=R.nextSibling;return a(R,o(k,{get label(){return r.t("provider.custom.models.id.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.models.id.placeholder")},get value(){return c.id},onChange:I=>S(C(),"id",I),get validationState(){return c.err.id?"invalid":void 0},get error(){return c.err.id}})),a(F,o(k,{get label(){return r.t("provider.custom.models.name.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.models.name.placeholder")},get value(){return c.name},onChange:I=>S(C(),"name",I),get validationState(){return c.err.name?"invalid":void 0},get error(){return c.err.name}})),a(b,o(G,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>g(C()),get disabled(){return d.models.length<=1},get"aria-label"(){return r.t("provider.custom.models.remove")}}),null),J(()=>N(b,"data-row",c.row)),b})()}),null),a(f,o(T,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:u,class:"self-start",get children(){return r.t("provider.custom.models.add")}}),null),a(ie,()=>r.t("provider.custom.headers.label")),a(E,o(V,{get each(){return d.headers},children:(c,C)=>(()=>{var b=X(),R=b.firstChild,F=R.nextSibling;return a(R,o(k,{get label(){return r.t("provider.custom.headers.key.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.headers.key.placeholder")},get value(){return c.key},onChange:I=>M(C(),"key",I),get validationState(){return c.err.key?"invalid":void 0},get error(){return c.err.key}})),a(F,o(k,{get label(){return r.t("provider.custom.headers.value.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.headers.value.placeholder")},get value(){return c.value},onChange:I=>M(C(),"value",I),get validationState(){return c.err.value?"invalid":void 0},get error(){return c.err.value}})),a(b,o(G,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>_(C()),get disabled(){return d.headers.length<=1},get"aria-label"(){return r.t("provider.custom.headers.remove")}}),null),J(()=>N(b,"data-row",c.row)),b})()}),null),a(E,o(T,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:x,class:"self-start",get children(){return r.t("provider.custom.headers.add")}}),null),a($,o(T,{class:"w-auto self-start",type:"submit",size:"large",variant:"primary",get disabled(){return D.isPending},get children(){return ce(()=>!!D.isPending)()?r.t("common.saving"):r.t("common.submit")}}),null),e}})}var Y=B('<div class="text-14-regular text-text-weak">'),ke=B('<div class="px-1.25 w-full flex items-center gap-x-3"><span>');const O="_custom",ae=()=>{const n=Z(),h=ue(),s=ee(),y=()=>s.t("dialog.provider.group.popular"),r=()=>s.t("dialog.provider.group.other"),d=()=>s.t("settings.providers.tag.custom"),v=t=>{if(t==="anthropic")return s.t("dialog.provider.anthropic.note");if(t==="openai")return s.t("dialog.provider.openai.note");if(t.startsWith("github-copilot"))return s.t("dialog.provider.copilot.note");if(t==="opencode-go")return s.t("dialog.provider.opencodeGo.tagline")};return o(re,{get title(){return s.t("command.provider.connect")},transition:!0,get children(){return o(ve,{get search(){return{placeholder:s.t("dialog.provider.search.placeholder"),autofocus:!0}},get emptyMessage(){return s.t("dialog.provider.empty")},activeIcon:"plus-small",key:t=>t?.id,items:()=>(s.locale(),[{id:O,name:d()},...h.all()]),filterKeys:["id","name"],groupBy:t=>K.includes(t.id)?y():r(),sortBy:(t,u)=>t.id===O?-1:u.id===O?1:K.includes(t.id)&&K.includes(u.id)?K.indexOf(t.id)-K.indexOf(u.id):t.name.localeCompare(u.name),sortGroupsBy:(t,u)=>{const g=y();return t.category===g&&u.category!==g?-1:u.category===g&&t.category!==g?1:0},onSelect:t=>{if(t){if(t.id===O){n.show(()=>o(xe,{back:"providers"}));return}n.show(()=>o(pe,{get provider(){return t.id}}))}},children:t=>(()=>{var u=ke(),g=u.firstChild;return a(u,o(te,{"data-slot":"list-item-extra-icon",get id(){return t.id}}),g),a(g,()=>t.name),a(u,o(U,{get when(){return t.id==="opencode"},get children(){var x=Y();return a(x,()=>s.t("dialog.provider.opencode.tagline")),x}}),null),a(u,o(U,{get when(){return t.id===O},get children(){return o(H,{get children(){return s.t("settings.providers.tag.custom")}})}}),null),a(u,o(U,{get when(){return t.id==="opencode"},get children(){return o(H,{get children(){return s.t("dialog.provider.tag.recommended")}})}}),null),a(u,o(U,{get when(){return v(t.id)},children:x=>(()=>{var _=Y();return a(_,x),_})()}),null),a(u,o(U,{get when(){return t.id==="opencode-go"},get children(){return o(H,{get children(){return s.t("dialog.provider.tag.recommended")}})}}),null),u})()})}})},Ie=Object.freeze(Object.defineProperty({__proto__:null,DialogSelectProvider:ae},Symbol.toStringTag,{value:"Module"}));export{ae as D,xe as a,Ie as d};
1
+ import{c as Z,u as le,y as ne,f as ee,H as se,L as de,J as A,m as o,l as a,p as k,F as V,Q as G,q as J,$ as N,B as T,n as ce,G as re,t as B,aK as j,aJ as q,ac as ue,S as K,ad as U}from"./index-Cl9Gy4vs.js";import{L as ve}from"./list-CbLd2QpP.js";import{P as te,T as H}from"./tag-CzzNjHnn.js";import{L as me,D as pe}from"./dialog-connect-provider-DdYA-iVa.js";const ge=/^[a-z0-9][a-z0-9-_]*$/,he="@ai-sdk/openai-compatible";function fe(n){const h=n.form.providerID.trim(),s=n.form.name.trim(),y=n.form.baseURL.trim(),r=n.form.apiKey.trim(),d=r.match(/^\{env:([^}]+)\}$/)?.[1]?.trim(),v=r&&!d?r:void 0,t=h?ge.test(h)?void 0:n.t("provider.custom.error.providerID.format"):n.t("provider.custom.error.providerID.required"),u=s?void 0:n.t("provider.custom.error.name.required"),g=y?/^https?:\/\//.test(y)?void 0:n.t("provider.custom.error.baseURL.format"):n.t("provider.custom.error.baseURL.required"),x=n.disabledProviders.includes(h),_=t?void 0:n.existingProviderIDs.has(h)&&!x?n.t("provider.custom.error.providerID.exists"):void 0,w=new Set,I=n.form.models.map(l=>{const p=l.id.trim(),f=p?w.has(p)?n.t("provider.custom.error.duplicate"):(()=>{w.add(p)})():n.t("provider.custom.error.required"),P=l.name.trim()?void 0:n.t("provider.custom.error.required");return{id:f,name:P}}),M=I.every(l=>!l.id&&!l.name),z=Object.fromEntries(n.form.models.map(l=>[l.id.trim(),{name:l.name.trim()}])),D=new Set,L=n.form.headers.map(l=>{const p=l.key.trim(),f=l.value.trim();if(!p&&!f)return{};const P=p?D.has(p.toLowerCase())?n.t("provider.custom.error.duplicate"):(()=>{D.add(p.toLowerCase())})():n.t("provider.custom.error.required"),E=f?void 0:n.t("provider.custom.error.required");return{key:P,value:E}}),e=L.every(l=>!l.key&&!l.value),i=Object.fromEntries(n.form.headers.map(l=>({key:l.key.trim(),value:l.value.trim()})).filter(l=>!!l.key&&!!l.value).map(l=>[l.key,l.value])),m={providerID:t??_,name:u,baseURL:g};return!t&&!_&&!u&&!g&&M&&e?{err:m,models:I,headers:L,result:{providerID:h,name:s,key:v,config:{npm:he,name:s,...d?{env:[d]}:{},options:{baseURL:y,...Object.keys(i).length?{headers:i}:{}},models:z}}}:{err:m,models:I,headers:L}}let be=0;const oe=()=>`row-${be++}`,Q=()=>({row:oe(),id:"",name:"",err:{}}),W=()=>({row:oe(),key:"",value:"",err:{}});var ye=B('<div class="flex flex-col gap-6 px-2.5 pb-3 overflow-y-auto max-h-[60vh]"><div class="px-2.5 flex gap-4 items-center"><div class="text-16-medium text-text-strong"></div></div><form class="px-2.5 pb-6 flex flex-col gap-6"><p class="text-14-regular text-text-base"></p><div class="flex flex-col gap-4"></div><div class="flex flex-col gap-3"><label class="text-12-medium text-text-weak"></label></div><div class="flex flex-col gap-3"><label class="text-12-medium text-text-weak">'),X=B('<div class="flex gap-2 items-start"><div class=flex-1></div><div class=flex-1>');function xe(n){const h=Z(),s=le(),y=ne(),r=ee(),[d,v]=se({providerID:"",name:"",baseURL:"",apiKey:"",models:[Q()],headers:[W()],err:{}}),t=()=>{if(n.back==="close"){h.close();return}h.show(()=>o(ae,{}))},u=()=>{v("models",q(e=>{e.push(Q())}))},g=e=>{d.models.length<=1||v("models",q(i=>{i.splice(e,1)}))},x=()=>{v("headers",q(e=>{e.push(W())}))},_=e=>{d.headers.length<=1||v("headers",q(i=>{i.splice(e,1)}))},w=(e,i)=>{v(e,i),e!=="apiKey"&&v("err",e,void 0)},I=(e,i,m)=>{j(()=>{v("models",e,i,m),v("models",e,"err",i,void 0)})},M=(e,i,m)=>{j(()=>{v("headers",e,i,m),v("headers",e,"err",i,void 0)})},z=()=>{const e=fe({form:d,t:r.t,disabledProviders:s.data.config.disabled_providers??[],existingProviderIDs:new Set(s.data.provider.all.map(i=>i.id))});return j(()=>{v("err",e.err),e.models.forEach((i,m)=>v("models",m,"err",i)),e.headers.forEach((i,m)=>v("headers",m,"err",i))}),e.result},D=de(()=>({mutationFn:async e=>{const m=(s.data.config.disabled_providers??[]).filter($=>$!==e.providerID);return e.key&&await y.client.auth.set({providerID:e.providerID,auth:{type:"api",key:e.key}}),await s.updateConfig({provider:{[e.providerID]:e.config},disabled_providers:m}),e},onSuccess:e=>{h.close(),A({variant:"success",icon:"circle-check",title:r.t("provider.connect.toast.connected.title",{provider:e.name}),description:r.t("provider.connect.toast.connected.description",{provider:e.name})})},onError:e=>{const i=e instanceof Error?e.message:String(e);A({title:r.t("common.requestFailed"),description:i})}})),L=e=>{if(e.preventDefault(),D.isPending)return;const i=z();i&&D.mutate(i)};return o(re,{get title(){return o(G,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:t,get"aria-label"(){return r.t("common.goBack")}})},transition:!0,get children(){var e=ye(),i=e.firstChild,m=i.firstChild,$=i.nextSibling,l=$.firstChild,p=l.nextSibling,f=p.nextSibling,P=f.firstChild,E=f.nextSibling,ie=E.firstChild;return a(i,o(te,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),m),a(m,()=>r.t("provider.custom.title")),$.addEventListener("submit",L),a(l,()=>r.t("provider.custom.description.prefix"),null),a(l,o(me,{href:"https://opencode.ai/docs/providers/#custom-provider",tabIndex:-1,get children(){return r.t("provider.custom.description.link")}}),null),a(l,()=>r.t("provider.custom.description.suffix"),null),a(p,o(k,{autofocus:!0,get label(){return r.t("provider.custom.field.providerID.label")},get placeholder(){return r.t("provider.custom.field.providerID.placeholder")},get description(){return r.t("provider.custom.field.providerID.description")},get value(){return d.providerID},onChange:c=>w("providerID",c),get validationState(){return d.err.providerID?"invalid":void 0},get error(){return d.err.providerID}}),null),a(p,o(k,{get label(){return r.t("provider.custom.field.name.label")},get placeholder(){return r.t("provider.custom.field.name.placeholder")},get value(){return d.name},onChange:c=>w("name",c),get validationState(){return d.err.name?"invalid":void 0},get error(){return d.err.name}}),null),a(p,o(k,{get label(){return r.t("provider.custom.field.baseURL.label")},get placeholder(){return r.t("provider.custom.field.baseURL.placeholder")},get value(){return d.baseURL},onChange:c=>w("baseURL",c),get validationState(){return d.err.baseURL?"invalid":void 0},get error(){return d.err.baseURL}}),null),a(p,o(k,{get label(){return r.t("provider.custom.field.apiKey.label")},get placeholder(){return r.t("provider.custom.field.apiKey.placeholder")},get description(){return r.t("provider.custom.field.apiKey.description")},get value(){return d.apiKey},onChange:c=>w("apiKey",c)}),null),a(P,()=>r.t("provider.custom.models.label")),a(f,o(V,{get each(){return d.models},children:(c,C)=>(()=>{var b=X(),R=b.firstChild,F=R.nextSibling;return a(R,o(k,{get label(){return r.t("provider.custom.models.id.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.models.id.placeholder")},get value(){return c.id},onChange:S=>I(C(),"id",S),get validationState(){return c.err.id?"invalid":void 0},get error(){return c.err.id}})),a(F,o(k,{get label(){return r.t("provider.custom.models.name.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.models.name.placeholder")},get value(){return c.name},onChange:S=>I(C(),"name",S),get validationState(){return c.err.name?"invalid":void 0},get error(){return c.err.name}})),a(b,o(G,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>g(C()),get disabled(){return d.models.length<=1},get"aria-label"(){return r.t("provider.custom.models.remove")}}),null),J(()=>N(b,"data-row",c.row)),b})()}),null),a(f,o(T,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:u,class:"self-start",get children(){return r.t("provider.custom.models.add")}}),null),a(ie,()=>r.t("provider.custom.headers.label")),a(E,o(V,{get each(){return d.headers},children:(c,C)=>(()=>{var b=X(),R=b.firstChild,F=R.nextSibling;return a(R,o(k,{get label(){return r.t("provider.custom.headers.key.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.headers.key.placeholder")},get value(){return c.key},onChange:S=>M(C(),"key",S),get validationState(){return c.err.key?"invalid":void 0},get error(){return c.err.key}})),a(F,o(k,{get label(){return r.t("provider.custom.headers.value.label")},hideLabel:!0,get placeholder(){return r.t("provider.custom.headers.value.placeholder")},get value(){return c.value},onChange:S=>M(C(),"value",S),get validationState(){return c.err.value?"invalid":void 0},get error(){return c.err.value}})),a(b,o(G,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>_(C()),get disabled(){return d.headers.length<=1},get"aria-label"(){return r.t("provider.custom.headers.remove")}}),null),J(()=>N(b,"data-row",c.row)),b})()}),null),a(E,o(T,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:x,class:"self-start",get children(){return r.t("provider.custom.headers.add")}}),null),a($,o(T,{class:"w-auto self-start",type:"submit",size:"large",variant:"primary",get disabled(){return D.isPending},get children(){return ce(()=>!!D.isPending)()?r.t("common.saving"):r.t("common.submit")}}),null),e}})}var Y=B('<div class="text-14-regular text-text-weak">'),ke=B('<div class="px-1.25 w-full flex items-center gap-x-3"><span>');const O="_custom",ae=()=>{const n=Z(),h=ue(),s=ee(),y=()=>s.t("dialog.provider.group.popular"),r=()=>s.t("dialog.provider.group.other"),d=()=>s.t("settings.providers.tag.custom"),v=t=>{if(t==="anthropic")return s.t("dialog.provider.anthropic.note");if(t==="openai")return s.t("dialog.provider.openai.note");if(t.startsWith("github-copilot"))return s.t("dialog.provider.copilot.note");if(t==="opencode-go")return s.t("dialog.provider.opencodeGo.tagline")};return o(re,{get title(){return s.t("command.provider.connect")},transition:!0,get children(){return o(ve,{get search(){return{placeholder:s.t("dialog.provider.search.placeholder"),autofocus:!0}},get emptyMessage(){return s.t("dialog.provider.empty")},activeIcon:"plus-small",key:t=>t?.id,items:()=>(s.locale(),[{id:O,name:d()},...h.all()]),filterKeys:["id","name"],groupBy:t=>U.includes(t.id)?y():r(),sortBy:(t,u)=>t.id===O?-1:u.id===O?1:U.includes(t.id)&&U.includes(u.id)?U.indexOf(t.id)-U.indexOf(u.id):t.name.localeCompare(u.name),sortGroupsBy:(t,u)=>{const g=y();return t.category===g&&u.category!==g?-1:u.category===g&&t.category!==g?1:0},onSelect:t=>{if(t){if(t.id===O){n.show(()=>o(xe,{back:"providers"}));return}n.show(()=>o(pe,{get provider(){return t.id}}))}},children:t=>(()=>{var u=ke(),g=u.firstChild;return a(u,o(te,{"data-slot":"list-item-extra-icon",get id(){return t.id}}),g),a(g,()=>t.name),a(u,o(K,{get when(){return t.id==="opencode"},get children(){var x=Y();return a(x,()=>s.t("dialog.provider.opencode.tagline")),x}}),null),a(u,o(K,{get when(){return t.id===O},get children(){return o(H,{get children(){return s.t("settings.providers.tag.custom")}})}}),null),a(u,o(K,{get when(){return t.id==="opencode"},get children(){return o(H,{get children(){return s.t("dialog.provider.tag.recommended")}})}}),null),a(u,o(K,{get when(){return v(t.id)},children:x=>(()=>{var _=Y();return a(_,x),_})()}),null),a(u,o(K,{get when(){return t.id==="opencode-go"},get children(){return o(H,{get children(){return s.t("dialog.provider.tag.recommended")}})}}),null),u})()})}})},Se=Object.freeze(Object.defineProperty({__proto__:null,DialogSelectProvider:ae},Symbol.toStringTag,{value:"Module"}));export{ae as D,xe as a,Se as d};
@@ -1 +1 @@
1
- import{d as me,c as he,e as fe,b as Y,f as R,K as Z,H as pe,L as O,M as z,N as h,i as C,O as Q,P as Se,l as S,m as a,Q as V,n as w,S as $,I as we,R as p,B as W,G as ye,z as be,U as ke,t as F,p as N,J as Ce}from"./index-DNqzOxQM.js";import{L as xe}from"./list-ee-VXnAh.js";import{S as Pe,a as _e}from"./server-row-m8CRVHgX.js";var De=F('<div class=px-5><div class="bg-surface-base rounded-md p-5 flex flex-col gap-3"><div class="flex-1 min-w-0 [&amp;_[data-slot=input-wrapper]]:relative"></div><div class="grid grid-cols-2 gap-2 min-w-0">'),$e=F('<div class="flex items-center gap-2 -ml-2"><span>'),Ie=F('<div class="flex flex-col gap-2"><div class="px-5 pb-5">'),Ee=F('<div class="flex items-center gap-3 min-w-0 flex-1 w-full group/item"><div class="flex flex-col h-full items-start w-5"></div><div class="flex items-center justify-center gap-4 pl-4">'),Ae=F('<span class="text-text-base bg-surface-base text-14-regular px-1.5 rounded-xs">');const K="opencode";function X(i,l){Ce({variant:"error",title:i.t("common.requestFailed"),description:l instanceof Error?l.message:String(l)})}function Fe(){const i=R(),l=Y(),[o,u]=be(async()=>{try{const g=await l.getDefaultServer?.();return g||null}catch(g){return X(i,g),null}},{initialValue:null}),s=C(()=>!!l.getDefaultServer&&!!l.setDefaultServer);return{defaultKey:o,canDefault:s,setDefault:async g=>{try{await l.setDefaultServer?.(g),u.mutate(g)}catch(x){X(i,x)}}}}function Me(){const i=Z(),l=u=>{const s=z(u);if(!s)return!1;const m=s.replace(/^https?:\/\//,"").split("/")[0];return m?m.includes("localhost")||m.startsWith("127.0.0.1")?!0:m.includes(".")||m.includes(":"):!1};return{previewStatus:async(u,s,m,g)=>{if(g(void 0),!l(u))return;const x=z(u);if(!x)return;const y={url:x};s&&(y.username=s),m&&(y.password=m);const A=await i(y);g(A.healthy)}}}function Ne(i){const l=R(),o=u=>{if(u.stopPropagation(),u.key==="Escape"){u.preventDefault(),i.onBack();return}u.key!=="Enter"||u.isComposing||(u.preventDefault(),i.onSubmit())};return(()=>{var u=De(),s=u.firstChild,m=s.firstChild,g=m.nextSibling;return S(m,a(N,{type:"text",get label(){return l.t("dialog.server.add.url")},get placeholder(){return i.placeholder},get value(){return i.value},autofocus:!0,get validationState(){return i.error?"invalid":"valid"},get error(){return i.error},get disabled(){return i.busy},get onChange(){return i.onChange},onKeyDown:o})),S(s,a(N,{type:"text",get label(){return l.t("dialog.server.add.name")},get placeholder(){return l.t("dialog.server.add.namePlaceholder")},get value(){return i.name},get disabled(){return i.busy},get onChange(){return i.onNameChange},onKeyDown:o}),g),S(g,a(N,{type:"text",get label(){return l.t("dialog.server.add.username")},get placeholder(){return l.t("dialog.server.add.usernamePlaceholder")},get value(){return i.username},get disabled(){return i.busy},get onChange(){return i.onUsernameChange},onKeyDown:o}),null),S(g,a(N,{type:"password",get label(){return l.t("dialog.server.add.password")},get placeholder(){return l.t("dialog.server.add.passwordPlaceholder")},get value(){return i.password},get disabled(){return i.busy},get onChange(){return i.onPasswordChange},onKeyDown:o}),null),u})()}function Be(){const i=me(),l=he(),o=fe(),u=Y(),s=R(),{defaultKey:m,canDefault:g,setDefault:x}=Fe(),{previewStatus:y}=Me(),A=Z(),[r,d]=pe({status:{},addServer:{url:"",name:"",username:K,password:"",error:"",showForm:!1,status:void 0},editServer:{id:void 0,value:"",name:"",username:"",password:"",error:"",status:void 0}}),M=()=>{d("addServer",{url:"",name:"",username:K,password:"",error:"",showForm:!1,status:void 0})},I=()=>{d("editServer",{id:void 0,value:"",name:"",username:"",password:"",error:"",status:void 0})},P=O(()=>({mutationFn:async e=>{const t=z(e);if(!t){M();return}const n={type:"http",http:{url:t}};if(r.addServer.name.trim()&&(n.displayName=r.addServer.name.trim()),r.addServer.password&&(n.http.password=r.addServer.password),r.addServer.password&&r.addServer.username&&(n.http.username=r.addServer.username),!(await A(n.http)).healthy){d("addServer",{error:s.t("dialog.server.add.error")});return}M(),await q(n,!0)}})),_=O(()=>({mutationFn:async e=>{if(e.original.type!=="http")return;const t=z(e.value);if(!t){I();return}const n=r.editServer.name.trim()||void 0,v=r.editServer.username||void 0,c=r.editServer.password||void 0,b=e.original.displayName;if(t===e.original.http.url&&n===b&&v===e.original.http.username&&c===e.original.http.password){I();return}const k={type:"http",displayName:n,http:{url:t,username:v,password:c}};if(!(await A(k.http)).healthy){d("editServer",{error:s.t("dialog.server.add.error")});return}t===e.original.http.url?o.add(k):ee(e.original,k),I()}})),ee=(e,t)=>{const n=o.key,v=o.add(t);if(!v)return;const c=n===h.key(e)?h.key(v):n;c&&o.setActive(c),o.remove(h.key(e))},E=C(()=>{const e=o.current,t=o.list;return e?t.includes(e)?[e,...t.filter(n=>n!==e)]:[e,...t]:t}),H=C(()=>E().find(e=>h.key(e)===o.key)??E()[0]),re=C(()=>{const e=E();if(!e.length)return e;const t=H(),n=new Map(e.map((c,b)=>[c,b])),v=c=>c?.healthy===!0?0:c?.healthy===!1?2:1;return e.slice().sort((c,b)=>{if(c===t)return-1;if(b===t)return 1;const k=v(r.status[h.key(c)])-v(r.status[h.key(b)]);return k!==0?k:(n.get(c)??0)-(n.get(b)??0)})});async function T(){const e={};await Promise.all(E().map(async t=>{e[h.key(t)]=await A(t.http)})),d("status",ke(e))}Q(()=>{E(),T();const e=setInterval(T,1e4);Se(()=>clearInterval(e))});async function q(e,t){if(!(!t&&r.status[h.key(e)]?.healthy===!1)){if(l.close(),t&&e.type==="http"){o.add(e),i("/");return}i("/"),queueMicrotask(()=>o.setActive(h.key(e)))}}const te=e=>{P.isPending||(d("addServer",{url:e,error:""}),y(e,r.addServer.username,r.addServer.password,t=>d("addServer",{status:t})))},ae=e=>{P.isPending||d("addServer",{name:e,error:""})},ne=e=>{P.isPending||(d("addServer",{username:e,error:""}),y(r.addServer.url,e,r.addServer.password,t=>d("addServer",{status:t})))},se=e=>{P.isPending||(d("addServer",{password:e,error:""}),y(r.addServer.url,r.addServer.username,e,t=>d("addServer",{status:t})))},ie=e=>{_.isPending||(d("editServer",{value:e,error:""}),y(e,r.editServer.username,r.editServer.password,t=>d("editServer",{status:t})))},de=e=>{_.isPending||d("editServer",{name:e,error:""})},le=e=>{_.isPending||(d("editServer",{username:e,error:""}),y(r.editServer.value,e,r.editServer.password,t=>d("editServer",{status:t})))},oe=e=>{_.isPending||(d("editServer",{password:e,error:""}),y(r.editServer.value,r.editServer.username,e,t=>d("editServer",{status:t})))},L=C(()=>r.editServer.id?"edit":r.addServer.showForm?"add":"list"),j=C(()=>{if(r.editServer.id)return E().find(e=>e.type==="http"&&e.http.url===r.editServer.id)}),G=()=>{M(),I()},ue=()=>{I(),d("addServer",{showForm:!0,url:"",name:"",username:K,password:"",error:"",status:void 0})},ce=e=>{M(),d("editServer",{id:e.http.url,value:e.http.url,name:e.displayName??"",username:e.http.username??"",password:e.http.password??"",error:"",status:r.status[h.key(e)]?.healthy})},J=()=>{if(L()==="add"){if(P.isPending)return;d("addServer",{error:""}),P.mutate(r.addServer.url);return}const e=j();e&&(_.isPending||(d("editServer",{error:""}),_.mutate({original:e,value:r.editServer.value})))},U=C(()=>L()!=="list"),f=C(()=>L()==="add"),B=C(()=>f()?P.isPending:_.isPending),ge=C(()=>U()?(()=>{var e=$e(),t=e.firstChild;return S(e,a(V,{icon:"arrow-left",variant:"ghost",onClick:G,get"aria-label"(){return s.t("common.goBack")}}),t),S(t,(()=>{var n=w(()=>!!f());return()=>n()?s.t("dialog.server.add.title"):s.t("dialog.server.edit.title")})()),e})():s.t("dialog.server.title"));Q(()=>{r.editServer.id&&(j()||I())});async function ve(e){o.remove(e),await u.getDefaultServer?.()===e&&u.setDefaultServer?.(null)}return a(ye,{get title(){return ge()},get children(){var e=Ie(),t=e.firstChild;return S(e,a($,{get when(){return!U()},get fallback(){return a(Ne,{get value(){return w(()=>!!f())()?r.addServer.url:r.editServer.value},get name(){return w(()=>!!f())()?r.addServer.name:r.editServer.name},get username(){return w(()=>!!f())()?r.addServer.username:r.editServer.username},get password(){return w(()=>!!f())()?r.addServer.password:r.editServer.password},get placeholder(){return s.t("dialog.server.add.placeholder")},get busy(){return B()},get error(){return w(()=>!!f())()?r.addServer.error:r.editServer.error},get status(){return w(()=>!!f())()?r.addServer.status:r.editServer.status},get onChange(){return f()?te:ie},get onNameChange(){return f()?ae:de},get onUsernameChange(){return f()?ne:le},get onPasswordChange(){return f()?se:oe},onSubmit:J,onBack:G})},get children(){return a(xe,{get search(){return{placeholder:s.t("dialog.server.search.placeholder"),autofocus:!1}},noInitialSelection:!0,get emptyMessage(){return s.t("dialog.server.empty")},items:re,key:n=>n.http.url,onSelect:n=>{n&&q(n)},divider:!0,class:"px-5 [&_[data-slot=list-search-wrapper]]:w-full [&_[data-slot=list-scroll]]h-[300px] [&_[data-slot=list-scroll]]:overflow-y-auto [&_[data-slot=list-items]]:bg-surface-base [&_[data-slot=list-items]]:rounded-md [&_[data-slot=list-item]]:min-h-14 [&_[data-slot=list-item]]:p-3 [&_[data-slot=list-item]]:!bg-transparent",children:n=>{const v=h.key(n);return(()=>{var c=Ee(),b=c.firstChild,k=b.nextSibling;return S(b,a(Pe,{get health(){return r.status[v]}})),S(c,a(_e,{conn:n,get dimmed(){return r.status[v]?.healthy===!1},get status(){return r.status[v]},class:"flex items-center gap-3 min-w-0 flex-1",get badge(){return a($,{get when(){return m.latest===h.key(n)},get children(){var D=Ae();return S(D,()=>s.t("dialog.server.status.default")),D}})},showCredentials:!0}),k),S(k,a($,{get when(){return h.key(H())===v},get children(){return a(we,{name:"check",class:"h-6"})}}),null),S(k,a($,{get when(){return n.type==="http"},get children(){return a(p,{get children(){return[a(p.Trigger,{as:V,icon:"dot-grid",variant:"ghost",class:"shrink-0 size-8 hover:bg-surface-base-hover data-[expanded]:bg-surface-base-active",onClick:D=>D.stopPropagation(),onPointerDown:D=>D.stopPropagation()}),a(p.Portal,{get children(){return a(p.Content,{class:"mt-1",get children(){return[a(p.Item,{onSelect:()=>{n.type==="http"&&ce(n)},get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.edit")}})}}),a($,{get when(){return w(()=>!!g())()&&m.latest!==v},get children(){return a(p.Item,{onSelect:()=>x(v),get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.default")}})}})}}),a($,{get when(){return w(()=>!!g())()&&m.latest===v},get children(){return a(p.Item,{onSelect:()=>x(null),get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.defaultRemove")}})}})}}),a(p.Separator,{}),a(p.Item,{onSelect:()=>ve(h.key(n)),class:"text-text-on-critical-base hover:bg-surface-critical-weak",get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.delete")}})}})]}})}})]}})}}),null),c})()}})}}),t),S(t,a($,{get when(){return U()},get fallback(){return a(W,{variant:"secondary",icon:"plus-small",size:"large",onClick:ue,class:"py-1.5 pl-1.5 pr-3 flex items-center gap-1.5",get children(){return s.t("dialog.server.add.button")}})},get children(){return a(W,{variant:"primary",size:"large",onClick:J,get disabled(){return B()},class:"px-3 py-1.5",get children(){return w(()=>!!B())()?s.t("dialog.server.add.checking"):w(()=>!!f())()?s.t("dialog.server.add.button"):s.t("common.save")}})}})),e}})}export{Be as DialogSelectServer};
1
+ import{d as me,c as he,e as fe,b as Y,f as R,K as Z,H as pe,L as O,M as z,N as h,i as C,O as Q,P as Se,l as S,m as a,Q as V,n as w,S as $,I as we,R as p,B as W,G as ye,z as be,U as ke,t as F,p as N,J as Ce}from"./index-Cl9Gy4vs.js";import{L as xe}from"./list-CbLd2QpP.js";import{S as Pe,a as _e}from"./server-row-gThwY27P.js";var De=F('<div class=px-5><div class="bg-surface-base rounded-md p-5 flex flex-col gap-3"><div class="flex-1 min-w-0 [&amp;_[data-slot=input-wrapper]]:relative"></div><div class="grid grid-cols-2 gap-2 min-w-0">'),$e=F('<div class="flex items-center gap-2 -ml-2"><span>'),Ie=F('<div class="flex flex-col gap-2"><div class="px-5 pb-5">'),Ee=F('<div class="flex items-center gap-3 min-w-0 flex-1 w-full group/item"><div class="flex flex-col h-full items-start w-5"></div><div class="flex items-center justify-center gap-4 pl-4">'),Ae=F('<span class="text-text-base bg-surface-base text-14-regular px-1.5 rounded-xs">');const K="opencode";function X(i,l){Ce({variant:"error",title:i.t("common.requestFailed"),description:l instanceof Error?l.message:String(l)})}function Fe(){const i=R(),l=Y(),[o,u]=be(async()=>{try{const g=await l.getDefaultServer?.();return g||null}catch(g){return X(i,g),null}},{initialValue:null}),s=C(()=>!!l.getDefaultServer&&!!l.setDefaultServer);return{defaultKey:o,canDefault:s,setDefault:async g=>{try{await l.setDefaultServer?.(g),u.mutate(g)}catch(x){X(i,x)}}}}function Me(){const i=Z(),l=u=>{const s=z(u);if(!s)return!1;const m=s.replace(/^https?:\/\//,"").split("/")[0];return m?m.includes("localhost")||m.startsWith("127.0.0.1")?!0:m.includes(".")||m.includes(":"):!1};return{previewStatus:async(u,s,m,g)=>{if(g(void 0),!l(u))return;const x=z(u);if(!x)return;const y={url:x};s&&(y.username=s),m&&(y.password=m);const A=await i(y);g(A.healthy)}}}function Ne(i){const l=R(),o=u=>{if(u.stopPropagation(),u.key==="Escape"){u.preventDefault(),i.onBack();return}u.key!=="Enter"||u.isComposing||(u.preventDefault(),i.onSubmit())};return(()=>{var u=De(),s=u.firstChild,m=s.firstChild,g=m.nextSibling;return S(m,a(N,{type:"text",get label(){return l.t("dialog.server.add.url")},get placeholder(){return i.placeholder},get value(){return i.value},autofocus:!0,get validationState(){return i.error?"invalid":"valid"},get error(){return i.error},get disabled(){return i.busy},get onChange(){return i.onChange},onKeyDown:o})),S(s,a(N,{type:"text",get label(){return l.t("dialog.server.add.name")},get placeholder(){return l.t("dialog.server.add.namePlaceholder")},get value(){return i.name},get disabled(){return i.busy},get onChange(){return i.onNameChange},onKeyDown:o}),g),S(g,a(N,{type:"text",get label(){return l.t("dialog.server.add.username")},get placeholder(){return l.t("dialog.server.add.usernamePlaceholder")},get value(){return i.username},get disabled(){return i.busy},get onChange(){return i.onUsernameChange},onKeyDown:o}),null),S(g,a(N,{type:"password",get label(){return l.t("dialog.server.add.password")},get placeholder(){return l.t("dialog.server.add.passwordPlaceholder")},get value(){return i.password},get disabled(){return i.busy},get onChange(){return i.onPasswordChange},onKeyDown:o}),null),u})()}function Be(){const i=me(),l=he(),o=fe(),u=Y(),s=R(),{defaultKey:m,canDefault:g,setDefault:x}=Fe(),{previewStatus:y}=Me(),A=Z(),[r,d]=pe({status:{},addServer:{url:"",name:"",username:K,password:"",error:"",showForm:!1,status:void 0},editServer:{id:void 0,value:"",name:"",username:"",password:"",error:"",status:void 0}}),M=()=>{d("addServer",{url:"",name:"",username:K,password:"",error:"",showForm:!1,status:void 0})},I=()=>{d("editServer",{id:void 0,value:"",name:"",username:"",password:"",error:"",status:void 0})},P=O(()=>({mutationFn:async e=>{const t=z(e);if(!t){M();return}const n={type:"http",http:{url:t}};if(r.addServer.name.trim()&&(n.displayName=r.addServer.name.trim()),r.addServer.password&&(n.http.password=r.addServer.password),r.addServer.password&&r.addServer.username&&(n.http.username=r.addServer.username),!(await A(n.http)).healthy){d("addServer",{error:s.t("dialog.server.add.error")});return}M(),await q(n,!0)}})),_=O(()=>({mutationFn:async e=>{if(e.original.type!=="http")return;const t=z(e.value);if(!t){I();return}const n=r.editServer.name.trim()||void 0,v=r.editServer.username||void 0,c=r.editServer.password||void 0,b=e.original.displayName;if(t===e.original.http.url&&n===b&&v===e.original.http.username&&c===e.original.http.password){I();return}const k={type:"http",displayName:n,http:{url:t,username:v,password:c}};if(!(await A(k.http)).healthy){d("editServer",{error:s.t("dialog.server.add.error")});return}t===e.original.http.url?o.add(k):ee(e.original,k),I()}})),ee=(e,t)=>{const n=o.key,v=o.add(t);if(!v)return;const c=n===h.key(e)?h.key(v):n;c&&o.setActive(c),o.remove(h.key(e))},E=C(()=>{const e=o.current,t=o.list;return e?t.includes(e)?[e,...t.filter(n=>n!==e)]:[e,...t]:t}),H=C(()=>E().find(e=>h.key(e)===o.key)??E()[0]),re=C(()=>{const e=E();if(!e.length)return e;const t=H(),n=new Map(e.map((c,b)=>[c,b])),v=c=>c?.healthy===!0?0:c?.healthy===!1?2:1;return e.slice().sort((c,b)=>{if(c===t)return-1;if(b===t)return 1;const k=v(r.status[h.key(c)])-v(r.status[h.key(b)]);return k!==0?k:(n.get(c)??0)-(n.get(b)??0)})});async function T(){const e={};await Promise.all(E().map(async t=>{e[h.key(t)]=await A(t.http)})),d("status",ke(e))}Q(()=>{E(),T();const e=setInterval(T,1e4);Se(()=>clearInterval(e))});async function q(e,t){if(!(!t&&r.status[h.key(e)]?.healthy===!1)){if(l.close(),t&&e.type==="http"){o.add(e),i("/");return}i("/"),queueMicrotask(()=>o.setActive(h.key(e)))}}const te=e=>{P.isPending||(d("addServer",{url:e,error:""}),y(e,r.addServer.username,r.addServer.password,t=>d("addServer",{status:t})))},ae=e=>{P.isPending||d("addServer",{name:e,error:""})},ne=e=>{P.isPending||(d("addServer",{username:e,error:""}),y(r.addServer.url,e,r.addServer.password,t=>d("addServer",{status:t})))},se=e=>{P.isPending||(d("addServer",{password:e,error:""}),y(r.addServer.url,r.addServer.username,e,t=>d("addServer",{status:t})))},ie=e=>{_.isPending||(d("editServer",{value:e,error:""}),y(e,r.editServer.username,r.editServer.password,t=>d("editServer",{status:t})))},de=e=>{_.isPending||d("editServer",{name:e,error:""})},le=e=>{_.isPending||(d("editServer",{username:e,error:""}),y(r.editServer.value,e,r.editServer.password,t=>d("editServer",{status:t})))},oe=e=>{_.isPending||(d("editServer",{password:e,error:""}),y(r.editServer.value,r.editServer.username,e,t=>d("editServer",{status:t})))},L=C(()=>r.editServer.id?"edit":r.addServer.showForm?"add":"list"),j=C(()=>{if(r.editServer.id)return E().find(e=>e.type==="http"&&e.http.url===r.editServer.id)}),G=()=>{M(),I()},ue=()=>{I(),d("addServer",{showForm:!0,url:"",name:"",username:K,password:"",error:"",status:void 0})},ce=e=>{M(),d("editServer",{id:e.http.url,value:e.http.url,name:e.displayName??"",username:e.http.username??"",password:e.http.password??"",error:"",status:r.status[h.key(e)]?.healthy})},J=()=>{if(L()==="add"){if(P.isPending)return;d("addServer",{error:""}),P.mutate(r.addServer.url);return}const e=j();e&&(_.isPending||(d("editServer",{error:""}),_.mutate({original:e,value:r.editServer.value})))},U=C(()=>L()!=="list"),f=C(()=>L()==="add"),B=C(()=>f()?P.isPending:_.isPending),ge=C(()=>U()?(()=>{var e=$e(),t=e.firstChild;return S(e,a(V,{icon:"arrow-left",variant:"ghost",onClick:G,get"aria-label"(){return s.t("common.goBack")}}),t),S(t,(()=>{var n=w(()=>!!f());return()=>n()?s.t("dialog.server.add.title"):s.t("dialog.server.edit.title")})()),e})():s.t("dialog.server.title"));Q(()=>{r.editServer.id&&(j()||I())});async function ve(e){o.remove(e),await u.getDefaultServer?.()===e&&u.setDefaultServer?.(null)}return a(ye,{get title(){return ge()},get children(){var e=Ie(),t=e.firstChild;return S(e,a($,{get when(){return!U()},get fallback(){return a(Ne,{get value(){return w(()=>!!f())()?r.addServer.url:r.editServer.value},get name(){return w(()=>!!f())()?r.addServer.name:r.editServer.name},get username(){return w(()=>!!f())()?r.addServer.username:r.editServer.username},get password(){return w(()=>!!f())()?r.addServer.password:r.editServer.password},get placeholder(){return s.t("dialog.server.add.placeholder")},get busy(){return B()},get error(){return w(()=>!!f())()?r.addServer.error:r.editServer.error},get status(){return w(()=>!!f())()?r.addServer.status:r.editServer.status},get onChange(){return f()?te:ie},get onNameChange(){return f()?ae:de},get onUsernameChange(){return f()?ne:le},get onPasswordChange(){return f()?se:oe},onSubmit:J,onBack:G})},get children(){return a(xe,{get search(){return{placeholder:s.t("dialog.server.search.placeholder"),autofocus:!1}},noInitialSelection:!0,get emptyMessage(){return s.t("dialog.server.empty")},items:re,key:n=>n.http.url,onSelect:n=>{n&&q(n)},divider:!0,class:"px-5 [&_[data-slot=list-search-wrapper]]:w-full [&_[data-slot=list-scroll]]h-[300px] [&_[data-slot=list-scroll]]:overflow-y-auto [&_[data-slot=list-items]]:bg-surface-base [&_[data-slot=list-items]]:rounded-md [&_[data-slot=list-item]]:min-h-14 [&_[data-slot=list-item]]:p-3 [&_[data-slot=list-item]]:!bg-transparent",children:n=>{const v=h.key(n);return(()=>{var c=Ee(),b=c.firstChild,k=b.nextSibling;return S(b,a(Pe,{get health(){return r.status[v]}})),S(c,a(_e,{conn:n,get dimmed(){return r.status[v]?.healthy===!1},get status(){return r.status[v]},class:"flex items-center gap-3 min-w-0 flex-1",get badge(){return a($,{get when(){return m.latest===h.key(n)},get children(){var D=Ae();return S(D,()=>s.t("dialog.server.status.default")),D}})},showCredentials:!0}),k),S(k,a($,{get when(){return h.key(H())===v},get children(){return a(we,{name:"check",class:"h-6"})}}),null),S(k,a($,{get when(){return n.type==="http"},get children(){return a(p,{get children(){return[a(p.Trigger,{as:V,icon:"dot-grid",variant:"ghost",class:"shrink-0 size-8 hover:bg-surface-base-hover data-[expanded]:bg-surface-base-active",onClick:D=>D.stopPropagation(),onPointerDown:D=>D.stopPropagation()}),a(p.Portal,{get children(){return a(p.Content,{class:"mt-1",get children(){return[a(p.Item,{onSelect:()=>{n.type==="http"&&ce(n)},get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.edit")}})}}),a($,{get when(){return w(()=>!!g())()&&m.latest!==v},get children(){return a(p.Item,{onSelect:()=>x(v),get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.default")}})}})}}),a($,{get when(){return w(()=>!!g())()&&m.latest===v},get children(){return a(p.Item,{onSelect:()=>x(null),get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.defaultRemove")}})}})}}),a(p.Separator,{}),a(p.Item,{onSelect:()=>ve(h.key(n)),class:"text-text-on-critical-base hover:bg-surface-critical-weak",get children(){return a(p.ItemLabel,{get children(){return s.t("dialog.server.menu.delete")}})}})]}})}})]}})}}),null),c})()}})}}),t),S(t,a($,{get when(){return U()},get fallback(){return a(W,{variant:"secondary",icon:"plus-small",size:"large",onClick:ue,class:"py-1.5 pl-1.5 pr-3 flex items-center gap-1.5",get children(){return s.t("dialog.server.add.button")}})},get children(){return a(W,{variant:"primary",size:"large",onClick:J,get disabled(){return B()},class:"px-3 py-1.5",get children(){return w(()=>!!B())()?s.t("dialog.server.add.checking"):w(()=>!!f())()?s.t("dialog.server.add.button"):s.t("common.save")}})}})),e}})}export{Be as DialogSelectServer};
@@ -0,0 +1 @@
1
+ import{l as s,t as p,aP as Se,f as ee,b as he,aQ as me,o as ve,H as ce,i as K,m as t,z as Ce,Z as Pe,I as G,S as C,n as B,p as se,aR as Te,aS as Ee,aT as ze,aU as je,a1 as ie,B as Q,aV as Fe,aW as Ae,aX as Le,J as V,aY as De,v as xe,aL as Ke,P as be,Q as $e,F as U,$ as Oe,q as H,V as We,aZ as Ie,aO as Me,c as Ne,y as Re,u as Ve,ac as Ge,ad as ne,a_ as Be,a6 as Ue,h as ue,O as qe,a$ as He,b0 as Ye,b1 as Qe,b2 as Ze,s as Je,b3 as Xe,b4 as et,b5 as tt,b6 as rt,b7 as st,G as nt}from"./index-Cl9Gy4vs.js";import{S as q,T as O}from"./select-yT_m8Opa.js";import{S as M}from"./switch-DnfWoh_i.js";import{L as it,D as lt}from"./dialog-connect-provider-DdYA-iVa.js";import{f as at,u as ot}from"./list-CbLd2QpP.js";import{P as re,T as te}from"./tag-CzzNjHnn.js";import{a as ct,D as dt}from"./dialog-select-provider-B1pJlMg-.js";var ut=p('<div class="bg-surface-base px-3 rounded-lg sm:px-4">');const N=r=>(()=>{var e=ut();return s(e,()=>r.children),e})();var gt=p("<div data-action=settings-feed-reasoning-summaries>"),pt=p("<div data-action=settings-feed-shell-tool-parts-expanded>"),ft=p("<div data-action=settings-feed-edit-tool-parts-expanded>"),ht=p("<div data-action=settings-feed-auto-save-links>"),mt=p('<div class="flex flex-col gap-1">'),ge=p('<div class="w-full sm:w-[220px]">'),J=p('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),vt=p("<div data-action=settings-notifications-agent>"),xt=p("<div data-action=settings-notifications-permissions>"),bt=p("<div data-action=settings-notifications-errors>"),$t=p("<div data-action=settings-updates-startup>"),_t=p("<div data-action=settings-release-notes>"),wt=p('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-3 pb-8 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-4 pb-5 sm:pt-6 sm:pb-8"><h2 class="text-15-medium text-text-strong sm:text-16-medium"></h2></div></div><div class="flex flex-col gap-5 w-full sm:gap-8">'),yt=p("<div data-action=settings-wayland>"),kt=p("<span class=text-text-weak>"),St=p('<div class="flex items-center gap-2"><span>'),Ct=p('<div class="flex flex-wrap items-center gap-2 py-2.5 border-b border-border-weak-base last:border-none sm:flex-nowrap sm:gap-4 sm:py-3"><div class="flex min-w-0 flex-1 flex-col gap-0.5"><span class="text-13-medium text-text-strong sm:text-14-medium"></span><span class="text-11-regular text-text-weak sm:text-12-regular"></span></div><div class="flex w-full justify-end sm:w-auto sm:shrink-0">');let R={cleanup:void 0,timeout:void 0,run:0};const _e=()=>{R.run+=1,R.cleanup&&R.cleanup(),clearTimeout(R.timeout),R.cleanup=void 0},pe=r=>{if(_e(),!r)return;const e=++R.run;R.timeout=setTimeout(()=>{De(r).then(a=>{if(R.run!==e){a?.();return}R.cleanup=a})},100)},Pt=()=>{const r=Se(),e=ee(),a=he(),n=me();ve(()=>{r.loadThemes()});const[o,f]=ce({checking:!1}),S=K(()=>a.platform==="desktop"&&a.os==="linux"),b=()=>{a.checkUpdate&&(f("checking",!0),a.checkUpdate().then(c=>{if(!c.updateAvailable){V({variant:"success",icon:"circle-check",title:e.t("settings.updates.toast.latest.title"),description:e.t("settings.updates.toast.latest.description",{version:a.version??""})});return}const l=a.update&&a.restart?[{label:e.t("toast.update.action.installRestart"),onClick:async()=>{await a.update(),await a.restart()}},{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}]:[{label:e.t("toast.update.action.notYet"),onClick:"dismiss"}];V({persistent:!0,icon:"download",title:e.t("toast.update.title"),description:e.t("toast.update.description",{version:c.version??""}),actions:l})}).catch(c=>{const l=c instanceof Error?c.message:String(c);V({title:e.t("common.requestFailed"),description:l})}).finally(()=>f("checking",!1)))},x=K(()=>r.ids().map(c=>({id:c,name:r.name(c)}))),k=K(()=>[{value:"system",label:e.t("theme.scheme.system")},{value:"light",label:e.t("theme.scheme.light")},{value:"dark",label:e.t("theme.scheme.dark")}]),T=K(()=>[{value:"queue",label:e.t("settings.general.row.followup.option.queue")},{value:"steer",label:e.t("settings.general.row.followup.option.steer")}]),j=K(()=>e.locales.map(c=>({value:c,label:e.label(c)}))),L={id:"none",label:"sound.option.none"},F=[L,...Le],m=()=>Ae(n.appearance.font()),h=()=>Fe(n.appearance.uiFont()),d=(c,l,i,u)=>({options:F,current:c()?F.find(g=>g.id===l())??L:L,value:g=>g.id,label:g=>e.t(g.label),onHighlight:g=>{g&&pe(g.id==="none"?void 0:g.id)},onSelect:g=>{if(g){if(g.id==="none"){i(!1),_e();return}i(!0),u(g.id),pe(g.id)}},variant:"secondary",size:"small",triggerVariant:"settings"}),v=()=>(()=>{var c=mt();return s(c,t(N,{get children(){return[t(P,{get title(){return e.t("settings.general.row.language.title")},get description(){return e.t("settings.general.row.language.description")},get children(){return t(q,{"data-action":"settings-language",get options(){return j()},get current(){return j().find(l=>l.value===e.locale())},value:l=>l.value,label:l=>l.label,onSelect:l=>l&&e.setLocale(l.value),variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(P,{get title(){return e.t("settings.general.row.reasoningSummaries.title")},get description(){return e.t("settings.general.row.reasoningSummaries.description")},get children(){var l=gt();return s(l,t(M,{get checked(){return n.general.showReasoningSummaries()},onChange:i=>n.general.setShowReasoningSummaries(i)})),l}}),t(P,{get title(){return e.t("settings.general.row.shellToolPartsExpanded.title")},get description(){return e.t("settings.general.row.shellToolPartsExpanded.description")},get children(){var l=pt();return s(l,t(M,{get checked(){return n.general.shellToolPartsExpanded()},onChange:i=>n.general.setShellToolPartsExpanded(i)})),l}}),t(P,{get title(){return e.t("settings.general.row.editToolPartsExpanded.title")},get description(){return e.t("settings.general.row.editToolPartsExpanded.description")},get children(){var l=ft();return s(l,t(M,{get checked(){return n.general.editToolPartsExpanded()},onChange:i=>n.general.setEditToolPartsExpanded(i)})),l}}),t(P,{get title(){return e.t("settings.general.row.autoSaveLinks.title")},get description(){return e.t("settings.general.row.autoSaveLinks.description")},get children(){var l=ht();return s(l,t(M,{get checked(){return n.general.autoSaveLinks()},onChange:i=>n.general.setAutoSaveLinks(i)})),l}}),t(P,{get title(){return e.t("settings.general.row.followup.title")},get description(){return e.t("settings.general.row.followup.description")},get children(){return t(q,{"data-action":"settings-followup",get options(){return T()},get current(){return T().find(l=>l.value===n.general.followup())},value:l=>l.value,label:l=>l.label,onSelect:l=>l&&n.general.setFollowup(l.value),variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"min(100%, 180px)"}})}})]}})),c})(),w=()=>(()=>{var c=J(),l=c.firstChild;return s(l,()=>e.t("settings.general.section.appearance")),s(c,t(N,{get children(){return[t(P,{get title(){return e.t("settings.general.row.colorScheme.title")},get description(){return e.t("settings.general.row.colorScheme.description")},get children(){return t(q,{"data-action":"settings-color-scheme",get options(){return k()},get current(){return k().find(i=>i.value===r.colorScheme())},value:i=>i.value,label:i=>i.label,onSelect:i=>i&&r.setColorScheme(i.value),onHighlight:i=>{if(i)return r.previewColorScheme(i.value),()=>r.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"min(100%, 220px)"}})}}),t(P,{get title(){return e.t("settings.general.row.theme.title")},get description(){return[B(()=>e.t("settings.general.row.theme.description"))," ",t(it,{href:"https://opencode.ai/docs/themes/",get children(){return e.t("common.learnMore")}})]},get children(){return t(q,{"data-action":"settings-theme",get options(){return x()},get current(){return x().find(i=>i.id===r.themeId())},value:i=>i.id,label:i=>i.name,onSelect:i=>{i&&r.setTheme(i.id)},onHighlight:i=>{if(i)return r.previewTheme(i.id),()=>r.cancelPreview()},variant:"secondary",size:"small",triggerVariant:"settings"})}}),t(P,{get title(){return e.t("settings.general.row.uiFont.title")},get description(){return e.t("settings.general.row.uiFont.description")},get children(){var i=ge();return s(i,t(se,{"data-action":"settings-ui-font",get label(){return e.t("settings.general.row.uiFont.title")},hideLabel:!0,type:"text",get value(){return h()},onChange:u=>n.appearance.setUIFont(u),placeholder:Te,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Ee(n.appearance.uiFont())}}})),i}}),t(P,{get title(){return e.t("settings.general.row.font.title")},get description(){return e.t("settings.general.row.font.description")},get children(){var i=ge();return s(i,t(se,{"data-action":"settings-code-font",get label(){return e.t("settings.general.row.font.title")},hideLabel:!0,type:"text",get value(){return m()},onChange:u=>n.appearance.setFont(u),placeholder:ze,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":je(n.appearance.font())}}})),i}})]}}),null),c})(),A=()=>(()=>{var c=J(),l=c.firstChild;return s(l,()=>e.t("settings.general.section.notifications")),s(c,t(N,{get children(){return[t(P,{get title(){return e.t("settings.general.notifications.agent.title")},get description(){return e.t("settings.general.notifications.agent.description")},get children(){var i=vt();return s(i,t(M,{get checked(){return n.notifications.agent()},onChange:u=>n.notifications.setAgent(u)})),i}}),t(P,{get title(){return e.t("settings.general.notifications.permissions.title")},get description(){return e.t("settings.general.notifications.permissions.description")},get children(){var i=xt();return s(i,t(M,{get checked(){return n.notifications.permissions()},onChange:u=>n.notifications.setPermissions(u)})),i}}),t(P,{get title(){return e.t("settings.general.notifications.errors.title")},get description(){return e.t("settings.general.notifications.errors.description")},get children(){var i=bt();return s(i,t(M,{get checked(){return n.notifications.errors()},onChange:u=>n.notifications.setErrors(u)})),i}})]}}),null),c})(),y=()=>(()=>{var c=J(),l=c.firstChild;return s(l,()=>e.t("settings.general.section.sounds")),s(c,t(N,{get children(){return[t(P,{get title(){return e.t("settings.general.sounds.agent.title")},get description(){return e.t("settings.general.sounds.agent.description")},get children(){return t(q,ie({"data-action":"settings-sounds-agent"},()=>d(()=>n.sounds.agentEnabled(),()=>n.sounds.agent(),i=>n.sounds.setAgentEnabled(i),i=>n.sounds.setAgent(i))))}}),t(P,{get title(){return e.t("settings.general.sounds.permissions.title")},get description(){return e.t("settings.general.sounds.permissions.description")},get children(){return t(q,ie({"data-action":"settings-sounds-permissions"},()=>d(()=>n.sounds.permissionsEnabled(),()=>n.sounds.permissions(),i=>n.sounds.setPermissionsEnabled(i),i=>n.sounds.setPermissions(i))))}}),t(P,{get title(){return e.t("settings.general.sounds.errors.title")},get description(){return e.t("settings.general.sounds.errors.description")},get children(){return t(q,ie({"data-action":"settings-sounds-errors"},()=>d(()=>n.sounds.errorsEnabled(),()=>n.sounds.errors(),i=>n.sounds.setErrorsEnabled(i),i=>n.sounds.setErrors(i))))}})]}}),null),c})(),$=()=>(()=>{var c=J(),l=c.firstChild;return s(l,()=>e.t("settings.general.section.updates")),s(c,t(N,{get children(){return[t(P,{get title(){return e.t("settings.updates.row.startup.title")},get description(){return e.t("settings.updates.row.startup.description")},get children(){var i=$t();return s(i,t(M,{get checked(){return n.updates.startup()},get disabled(){return!a.checkUpdate},onChange:u=>n.updates.setStartup(u)})),i}}),t(P,{get title(){return e.t("settings.general.row.releaseNotes.title")},get description(){return e.t("settings.general.row.releaseNotes.description")},get children(){var i=_t();return s(i,t(M,{get checked(){return n.general.releaseNotes()},onChange:u=>n.general.setReleaseNotes(u)})),i}}),t(P,{get title(){return e.t("settings.updates.row.check.title")},get description(){return e.t("settings.updates.row.check.description")},get children(){return t(Q,{size:"small",variant:"secondary",get disabled(){return o.checking||!a.checkUpdate},onClick:b,get children(){return B(()=>!!o.checking)()?e.t("settings.updates.action.checking"):e.t("settings.updates.action.checkNow")}})}})]}}),null),c})();return(()=>{var c=wt(),l=c.firstChild,i=l.firstChild,u=i.firstChild,g=l.nextSibling;return s(u,()=>e.t("settings.tab.general")),s(g,t(v,{}),null),s(g,t(w,{}),null),s(g,t(A,{}),null),s(g,t(y,{}),null),s(g,t($,{}),null),s(g,t(C,{get when(){return S()},children:_=>{const[z,D]=Ce(()=>a.getDisplayBackend?.(),{initialValue:void 0}),W=()=>z.loading?void 0:z.latest,E=I=>a.setDisplayBackend?.(I?"wayland":"auto").finally(()=>D.refetch());return(()=>{var I=J(),ye=I.firstChild;return s(ye,()=>e.t("settings.general.section.display")),s(I,t(N,{get children(){return t(P,{get title(){return(()=>{var Y=St(),ke=Y.firstChild;return s(ke,()=>e.t("settings.general.row.wayland.title")),s(Y,t(Pe,{get value(){return e.t("settings.general.row.wayland.tooltip")},placement:"top",get children(){var de=kt();return s(de,t(G,{name:"help",size:"small"})),de}}),null),Y})()},get description(){return e.t("settings.general.row.wayland.description")},get children(){var Y=yt();return s(Y,t(M,{get checked(){return W()==="wayland"},onChange:E})),Y}})}}),null),I})()}}),null),c})()},P=r=>(()=>{var e=Ct(),a=e.firstChild,n=a.firstChild,o=n.nextSibling,f=a.nextSibling;return s(n,()=>r.title),s(o,()=>r.description),s(f,()=>r.children),e})();var Tt=p('<span class="text-14-regular text-text-strong mt-1">"<!>"'),Et=p('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),zt=p('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-4 pt-6 pb-6 max-w-[720px]"><div class="flex items-center justify-between gap-4"><h2 class="text-16-medium text-text-strong"></h2></div><div class="flex items-center gap-2 px-3 h-9 rounded-lg bg-surface-base"></div></div></div><div class="flex flex-col gap-8 max-w-[720px]">'),jt=p('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Ft=p('<div class="flex items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none"><span class="text-14-regular text-text-strong"></span><button type=button>');const le=typeof navigator=="object"&&/(Mac|iPod|iPhone|iPad)/.test(navigator.platform),Z="command.palette",At="mod+shift+p",X=["General","Session","Navigation","Model and agent","Terminal","Prompt","Editor","File","View","App"],Lt={General:"settings.shortcuts.group.general",Session:"settings.shortcuts.group.session",Navigation:"settings.shortcuts.group.navigation","Model and agent":"settings.shortcuts.group.modelAndAgent",Terminal:"settings.shortcuts.group.terminal",Prompt:"settings.shortcuts.group.prompt",Editor:"settings.shortcuts.group.editor",File:"settings.shortcuts.group.file",View:"settings.shortcuts.group.view",App:"settings.shortcuts.group.app"};function ae(r){return r===Z?"General":r.startsWith("terminal.")?"Terminal":r.startsWith("model.")||r.startsWith("agent.")||r.startsWith("mcp.")?"Model and agent":r.startsWith("file.")||r.startsWith("fileTree.")||r.startsWith("folder.")?"File":r.startsWith("prompt.")?"Prompt":r.startsWith("editor.")?"Editor":r.startsWith("view.")?"View":r.startsWith("app.")?"App":r.startsWith("tab.")?"Navigation":r.startsWith("session.")||r.startsWith("message.")||r.startsWith("permissions.")||r.startsWith("steps.")||r.startsWith("review.")?"Session":"General"}function Dt(r){return r==="Shift"||r==="Control"||r==="Alt"||r==="Meta"}function Kt(r){return r===","?"comma":r==="+"?"plus":r===" "?"space":r.toLowerCase()}function Ot(r){if(Dt(r.key))return;const e=[];(le?r.metaKey:r.ctrlKey)&&e.push("mod"),le&&r.ctrlKey&&e.push("ctrl"),!le&&r.metaKey&&e.push("meta"),r.altKey&&e.push("alt"),r.shiftKey&&e.push("shift");const n=Kt(r.key);if(n)return e.push(n),e.join("+")}function oe(r){if(!r)return[];const e=[];for(const a of Ie(r)){const n=[];a.ctrl&&n.push("ctrl"),a.alt&&n.push("alt"),a.shift&&n.push("shift"),a.meta&&n.push("meta"),a.key&&n.push(a.key),n.length!==0&&e.push(n.join("+"))}return e}function Wt(r){return!r||typeof r!="object"||Array.isArray(r)?{}:r}function It(r,e,a){const n=new Map;n.set(Z,{title:a,group:"General"});for(const o of r.catalog)o.id.startsWith("suggested.")||n.set(o.id,{title:o.title,group:ae(o.id)});for(const o of r.options)o.id.startsWith("suggested.")||n.set(o.id,{title:o.title,group:ae(o.id)});for(const[o,f]of Object.entries(e))typeof f=="string"&&(n.has(o)||n.set(o,{title:o,group:ae(o)}));return n}function Mt(r){const e=new Map;for(const a of X)e.set(a,[]);for(const[a,n]of r){const o=e.get(n.group);o&&o.push(a)}for(const a of X){const n=e.get(a);n&&n.sort((o,f)=>(r.get(o)?.title??"").localeCompare(r.get(f)?.title??""))}return e}function Nt(r,e,a,n){const o=r.toLowerCase().trim();if(!o)return a;const f=new Map;for(const x of X)f.set(x,[]);const S=Array.from(e.entries()).map(([x,k])=>({id:x,title:k.title,group:k.group,keybind:n(x)})),b=at.go(o,S,{keys:["title","keybind"],threshold:-1e4});for(const x of b){const k=f.get(x.obj.group);k&&k.push(x.obj.id)}return f}function Rt(r){ve(()=>{const e=a=>{const n=r.active();if(!n)return;if(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation(),a.key==="Escape"){r.stop();return}if((a.key==="Backspace"||a.key==="Delete")&&!a.ctrlKey&&!a.metaKey&&!a.altKey&&!a.shiftKey){r.set(n,"none"),r.stop();return}const f=Ot(a);if(!f)return;const S=new Map;for(const b of oe(f))for(const x of r.used().get(b)??[])x.id!==n&&S.set(x.id,x.title);if(S.size>0){V({title:r.language.t("settings.shortcuts.conflict.title"),description:r.language.t("settings.shortcuts.conflict.description",{keybind:Me(f,r.language.t),titles:[...S.values()].join(", ")})});return}r.set(n,f),r.stop()};document.addEventListener("keydown",e,!0),be(()=>document.removeEventListener("keydown",e,!0))})}const Vt=()=>{const r=Ke(),e=ee(),a=me(),[n,o]=ce({active:null,filter:""}),f=()=>{n.active&&(o("active",null),r.keybinds(!0))},S=v=>{if(n.active===v){f();return}n.active&&f(),o("active",v),r.keybinds(!1)},b=K(()=>Wt(a.current.keybinds)),x=K(()=>Object.values(b()).some(v=>typeof v=="string")),k=()=>{f(),a.keybinds.resetAll(),V({title:e.t("settings.shortcuts.reset.toast.title"),description:e.t("settings.shortcuts.reset.toast.description")})},T=K(()=>(e.locale(),It(r,b(),e.t("command.palette")))),j=v=>T().get(v)?.title??"",L=K(()=>Mt(T())),F=K(()=>Nt(n.filter,T(),L(),v=>r.keybind(v)||"")),m=K(()=>{for(const v of X)if((F().get(v)??[]).length>0)return!0;return!1}),h=K(()=>{const v=new Map,w=($,c)=>{const l=v.get($);if(!l){v.set($,[c]);return}l.push(c)},A=a.keybinds.get(Z)??At;for(const $ of oe(A))w($,{id:Z,title:j(Z)});const y=$=>{const c=a.keybinds.get($);if(typeof c=="string")return c;const l=r.options.find(u=>u.id===$);return l?.keybind?l.keybind:r.catalog.find(u=>u.id===$)?.keybind};for(const $ of T().keys())if($!==Z)for(const c of oe(y($)))w(c,{id:$,title:j($)});return v});return Rt({active:()=>n.active,stop:f,set:(v,w)=>a.keybinds.set(v,w),used:h,language:e}),be(()=>{n.active&&r.keybinds(!0)}),(()=>{var v=zt(),w=v.firstChild,A=w.firstChild,y=A.firstChild,$=y.firstChild,c=y.nextSibling,l=w.nextSibling;return s($,()=>e.t("settings.shortcuts.title")),s(y,t(Q,{size:"small",variant:"secondary",onClick:k,get disabled(){return!x()},get children(){return e.t("settings.shortcuts.reset.button")}}),null),s(c,t(G,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),s(c,t(se,{variant:"ghost",type:"text",get value(){return n.filter},onChange:i=>o("filter",i),get placeholder(){return e.t("settings.shortcuts.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),s(c,t(C,{get when(){return n.filter},get children(){return t($e,{icon:"circle-x",variant:"ghost",onClick:()=>o("filter","")})}}),null),s(l,t(U,{each:X,children:i=>t(C,{get when(){return(F().get(i)??[]).length>0},get children(){var u=jt(),g=u.firstChild;return s(g,()=>e.t(Lt[i])),s(u,t(N,{get children(){return t(U,{get each(){return F().get(i)??[]},children:_=>(()=>{var z=Ft(),D=z.firstChild,W=D.nextSibling;return s(D,()=>j(_)),W.$$click=()=>S(_),Oe(W,"data-keybind-id",_),s(W,t(C,{get when(){return n.active===_},get fallback(){return r.keybind(_)||e.t("settings.shortcuts.unassigned")},get children(){return e.t("settings.shortcuts.pressKeys")}})),H(E=>We(W,{"h-8 px-3 rounded-md text-12-regular":!0,"bg-surface-base text-text-subtle hover:bg-surface-raised-base-hover active:bg-surface-raised-base-active":n.active!==_,"border border-border-weak-base bg-surface-inset-base text-text-weak":n.active===_},E)),z})()})}}),null),u}})}),null),s(l,t(C,{get when(){return B(()=>!!n.filter)()&&!m()},get children(){var i=Et(),u=i.firstChild;return s(u,()=>e.t("settings.shortcuts.search.empty")),s(i,t(C,{get when(){return n.filter},get children(){var g=Tt(),_=g.firstChild,z=_.nextSibling;return z.nextSibling,s(g,()=>n.filter,z),g}}),null),i}}),null),v})()};xe(["click"]);var Gt=p('<div class="flex items-center justify-between gap-4 min-h-16 border-b border-border-weak-base last:border-none flex-wrap py-3"data-component=custom-provider-section><div class="flex flex-col min-w-0"><div class="flex flex-wrap items-center gap-x-3 gap-y-1"><span class="text-14-medium text-text-strong"></span></div><span class="text-12-regular text-text-weak pl-8">'),Bt=p('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8 max-w-[720px]"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 max-w-[720px]"><div class="flex flex-col gap-1"data-component=connected-providers-section><h3 class="text-14-medium text-text-strong pb-2"></h3></div><div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Ut=p('<div class="py-4 text-14-regular text-text-weak">'),qt=p('<div class="group flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex items-center gap-3 min-w-0"><span class="text-14-medium text-text-strong truncate">'),Ht=p('<span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default">'),Yt=p('<div class="flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex flex-col min-w-0"><div class="flex items-center gap-x-3"><span class="text-14-medium text-text-strong">'),Qt=p('<span class="text-12-regular text-text-weak pl-8">');const Zt=[{match:r=>r==="opencode",key:"dialog.provider.opencode.note"},{match:r=>r==="opencode-go",key:"dialog.provider.opencodeGo.tagline"},{match:r=>r==="anthropic",key:"dialog.provider.anthropic.note"},{match:r=>r.startsWith("github-copilot"),key:"dialog.provider.copilot.note"},{match:r=>r==="openai",key:"dialog.provider.openai.note"},{match:r=>r==="google",key:"dialog.provider.google.note"},{match:r=>r==="openrouter",key:"dialog.provider.openrouter.note"},{match:r=>r==="vercel",key:"dialog.provider.vercel.note"}],Jt=()=>{const r=Ne(),e=ee(),a=Re(),n=Ve(),o=Ge(),f=K(()=>o.connected().filter(m=>m.id!=="opencode"||Object.values(m.models).find(h=>h.cost?.input))),S=K(()=>{const m=new Set(f().map(d=>d.id)),h=o.popular().filter(d=>!m.has(d.id)).slice();return h.sort((d,v)=>ne.indexOf(d.id)-ne.indexOf(v.id)),h}),b=m=>{if(!("source"in m))return;const h=m.source;if(h==="env"||h==="api"||h==="config"||h==="custom")return h},x=m=>{const h=b(m);return h==="env"?e.t("settings.providers.tag.environment"):h==="api"?e.t("provider.connect.method.apiKey"):h==="config"?j(m.id)?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.config"):h==="custom"?e.t("settings.providers.tag.custom"):e.t("settings.providers.tag.other")},k=m=>b(m)!=="env",T=m=>Zt.find(h=>h.match(m))?.key,j=m=>{const h=n.data.config.provider?.[m];return!(!h||h.npm!=="@ai-sdk/openai-compatible"||!h.models||Object.keys(h.models).length===0)},L=async(m,h)=>{const d=n.data.config.disabled_providers??[],v=d.includes(m)?d:[...d,m];n.set("config","disabled_providers",v),await n.updateConfig({disabled_providers:v}).then(()=>{V({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:h}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:h})})}).catch(w=>{n.set("config","disabled_providers",d);const A=w instanceof Error?w.message:String(w);V({title:e.t("common.requestFailed"),description:A})})},F=async(m,h)=>{if(j(m)){await a.client.auth.remove({providerID:m}).catch(()=>{}),await L(m,h);return}await a.client.auth.remove({providerID:m}).then(async()=>{await a.client.global.dispose(),V({variant:"success",icon:"circle-check",title:e.t("provider.disconnect.toast.disconnected.title",{provider:h}),description:e.t("provider.disconnect.toast.disconnected.description",{provider:h})})}).catch(d=>{const v=d instanceof Error?d.message:String(d);V({title:e.t("common.requestFailed"),description:v})})};return(()=>{var m=Bt(),h=m.firstChild,d=h.firstChild,v=d.firstChild,w=h.nextSibling,A=w.firstChild,y=A.firstChild,$=A.nextSibling,c=$.firstChild;return s(v,()=>e.t("settings.providers.title")),s(y,()=>e.t("settings.providers.section.connected")),s(A,t(N,{get children(){return t(C,{get when(){return f().length>0},get fallback(){return(()=>{var l=Ut();return s(l,()=>e.t("settings.providers.connected.empty")),l})()},get children(){return t(U,{get each(){return f()},children:l=>(()=>{var i=qt(),u=i.firstChild,g=u.firstChild;return s(u,t(re,{get id(){return l.id},class:"size-5 shrink-0 icon-strong-base"}),g),s(g,()=>l.name),s(u,t(te,{get children(){return x(l)}}),null),s(i,t(C,{get when(){return k(l)},get fallback(){return(()=>{var _=Ht();return s(_,()=>e.t("settings.providers.connected.environmentDescription")),_})()},get children(){return t(Q,{size:"large",variant:"ghost",onClick:()=>void F(l.id,l.name),get children(){return e.t("common.disconnect")}})}}),null),i})()})}})}}),null),s(c,()=>e.t("settings.providers.section.popular")),s($,t(N,{get children(){return[t(U,{get each(){return S()},children:l=>(()=>{var i=Yt(),u=i.firstChild,g=u.firstChild,_=g.firstChild;return s(g,t(re,{get id(){return l.id},class:"size-5 shrink-0 icon-strong-base"}),_),s(_,()=>l.name),s(g,t(C,{get when(){return l.id==="opencode"},get children(){return t(te,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),s(g,t(C,{get when(){return l.id==="opencode-go"},get children(){return t(te,{get children(){return e.t("dialog.provider.tag.recommended")}})}}),null),s(u,t(C,{get when(){return T(l.id)},children:z=>(()=>{var D=Qt();return s(D,()=>e.t(z())),D})()}),null),s(i,t(Q,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{r.show(()=>t(lt,{get provider(){return l.id}}))},get children(){return e.t("common.connect")}}),null),i})()}),(()=>{var l=Gt(),i=l.firstChild,u=i.firstChild,g=u.firstChild,_=u.nextSibling;return s(u,t(re,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),g),s(g,()=>e.t("provider.custom.title")),s(u,t(te,{get children(){return e.t("settings.providers.tag.custom")}}),null),s(_,()=>e.t("settings.providers.custom.description")),s(l,t(Q,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{r.show(()=>t(ct,{back:"close"}))},get children(){return e.t("common.connect")}}),null),l})()]}}),null),s($,t(Q,{variant:"ghost",class:"px-0 py-0 mt-5 text-14-medium text-text-interactive-base text-left justify-start hover:bg-transparent active:bg-transparent",onClick:()=>{r.show(()=>t(dt,{}))},get children(){return e.t("dialog.provider.viewAll")}}),null),m})()};var we=p('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),Xt=p('<span class="text-14-regular text-text-strong mt-1">&quot;<!>&quot;'),er=p('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-4 pt-6 pb-6 max-w-[720px]"><h2 class="text-16-medium text-text-strong"></h2><div class="flex items-center gap-2 px-3 h-9 rounded-lg bg-surface-base"></div></div></div><div class="flex flex-col gap-8 max-w-[720px]">'),tr=p('<div class="flex flex-col gap-1"><div class="flex items-center gap-2 pb-2"><span class="text-14-medium text-text-strong">'),rr=p('<div class="flex flex-wrap items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none"><div class=min-w-0><span class="text-14-regular text-text-strong truncate block"></span></div><div class=flex-shrink-0>');const sr=r=>(()=>{var e=we(),a=e.firstChild;return s(a,()=>r.label),e})(),nr=r=>(()=>{var e=we(),a=e.firstChild;return s(a,()=>r.message),s(e,t(C,{get when(){return r.filter},get children(){var n=Xt(),o=n.firstChild,f=o.nextSibling;return f.nextSibling,s(n,()=>r.filter,f),n}}),null),e})(),ir=()=>{const r=ee(),e=Be(),a=ot({items:n=>e.list(),key:n=>`${n.provider.id}:${n.id}`,filterKeys:["provider.name","name","id"],sortBy:(n,o)=>n.name.localeCompare(o.name),groupBy:n=>n.provider.id,sortGroupsBy:(n,o)=>{const f=ne.indexOf(n.category),S=ne.indexOf(o.category),b=f>=0,x=S>=0;if(b&&!x)return-1;if(!b&&x)return 1;if(b&&x)return f-S;const k=n.items[0].provider.name,T=o.items[0].provider.name;return k.localeCompare(T)}});return(()=>{var n=er(),o=n.firstChild,f=o.firstChild,S=f.firstChild,b=S.nextSibling,x=o.nextSibling;return s(S,()=>r.t("settings.models.title")),s(b,t(G,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),s(b,t(se,{variant:"ghost",type:"text",get value(){return a.filter()},get onChange(){return a.onInput},get placeholder(){return r.t("dialog.model.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),s(b,t(C,{get when(){return a.filter()},get children(){return t($e,{icon:"circle-x",variant:"ghost",get onClick(){return a.clear}})}}),null),s(x,t(C,{get when(){return!a.grouped.loading},get fallback(){return t(sr,{get label(){return`${r.t("common.loading")}${r.t("common.loading.ellipsis")}`}})},get children(){return t(C,{get when(){return a.flat().length>0},get fallback(){return t(nr,{get message(){return r.t("dialog.model.empty")},get filter(){return a.filter()}})},get children(){return t(U,{get each(){return a.grouped.latest},children:k=>(()=>{var T=tr(),j=T.firstChild,L=j.firstChild;return s(j,t(re,{get id(){return k.category},class:"size-5 shrink-0 icon-strong-base"}),L),s(L,()=>k.items[0].provider.name),s(T,t(N,{get children(){return t(U,{get each(){return k.items},children:F=>{const m={providerID:F.provider.id,modelID:F.id};return(()=>{var h=rr(),d=h.firstChild,v=d.firstChild,w=d.nextSibling;return s(v,()=>F.name),s(w,t(M,{get checked(){return e.visible(m)},onChange:A=>{e.setVisibility(m,A)},hideLabel:!0,get children(){return F.name}})),h})()}})}}),null),T})()})}})}})),n})()};var fe=p("<div class=settings-services-list>"),lr=p("<div class=settings-services-drafts-title>New services (add to opencode.jsonc)"),ar=p('<div class=settings-services-hint>Copy the configuration above into your <code>opencode.jsonc</code> under the <code>"preview"</code> key.'),or=p("<div class=settings-services-empty>No preview services configured. Click <strong>Auto-detect</strong> to scan your project or <strong>Add</strong> to configure manually."),cr=p("<div class=settings-services><div class=settings-services-header><div><div class=settings-services-title>Preview Services</div><div class=settings-services-desc>Configure dev servers and preview services for this project.</div></div><div class=settings-services-actions><button class=settings-services-btn></button><button class=settings-services-btn>Add"),dr=p("<span class=settings-services-port>:"),ur=p("<button class=settings-services-icon-btn title=Stop>"),gr=p("<button class=settings-services-icon-btn title=Start>"),pr=p("<div class=settings-services-item><span class=settings-services-dot></span><span class=settings-services-name></span><span class=settings-services-cmd></span><div class=settings-services-item-actions>"),fr=p('<div class=settings-services-draft><input class="settings-services-input settings-services-input--name"placeholder=name><select class=settings-services-select><option value=web>web</option><option value=api>api</option><option value=terminal>terminal</option></select><input class="settings-services-input settings-services-input--port"placeholder=port type=number><input class="settings-services-input settings-services-input--cmd"placeholder=command><button class="settings-services-icon-btn settings-services-rm">');function hr(){const r=Ue(),e=K(()=>`?directory=${encodeURIComponent(r.directory)}`),[a,n]=ue([]),[o,f]=ce([]),[S,b]=ue(!1),x=async()=>{try{const d=await r.fetch(`${r.url}/preview/services${e()}`);d.ok&&n(await d.json())}catch{}};qe(()=>{x()});const k=async d=>{await r.fetch(`${r.url}/preview/services/${d}/start${e()}`,{method:"POST"}),await x()},T=async d=>{await r.fetch(`${r.url}/preview/services/${d}/stop${e()}`,{method:"POST"}),await x()},j=async()=>{b(!0);try{const d=await r.fetch(`${r.url}/preview/infer${e()}`,{method:"POST"});if(d.ok){const v=await d.json(),w=new Set(a().map(y=>y.name)),A=v.filter(y=>!w.has(y.name)).map(y=>({name:y.name,port:String(y.port),type:y.type,command:y.command}));f([...o,...A])}}finally{b(!1)}},L=()=>f([...o,{name:"",port:"3000",type:"web",command:""}]),F=d=>f(o.filter((v,w)=>w!==d)),m=d=>d==="web"?et:d==="api"?tt:rt,h=d=>d==="running"?"var(--color-green-500)":d==="starting"?"var(--color-yellow-500)":d==="error"?"var(--color-red-500)":"var(--text-weaker)";return(()=>{var d=cr(),v=d.firstChild,w=v.firstChild,A=w.nextSibling,y=A.firstChild,$=y.nextSibling,c=$.firstChild;return y.$$click=()=>void j(),s(y,t(He,{class:"size-3.5"}),null),s(y,()=>S()?"Scanning…":"Auto-detect",null),$.$$click=L,s($,t(Ye,{class:"size-3.5"}),c),s(d,t(C,{get when(){return a().length>0},get children(){var l=fe();return s(l,t(U,{get each(){return a()},children:i=>{const u=m(i.type);return(()=>{var g=pr(),_=g.firstChild,z=_.nextSibling,D=z.nextSibling,W=D.nextSibling;return s(g,t(u,{class:"size-3.5 text-icon-weak"}),z),s(z,()=>i.name),s(g,t(C,{get when(){return i.port},get children(){var E=dr();return E.firstChild,s(E,()=>i.port,null),E}}),D),s(D,()=>i.command),s(W,t(C,{get when(){return i.status==="running"},get children(){var E=ur();return E.$$click=()=>void T(i.name),s(E,t(Qe,{class:"size-3.5"})),E}}),null),s(W,t(C,{get when(){return i.status==="stopped"},get children(){var E=gr();return E.$$click=()=>void k(i.name),s(E,t(Ze,{class:"size-3.5"})),E}}),null),H(E=>Je(_,"background",h(i.status))),g})()}})),l}}),null),s(d,t(C,{get when(){return o.length>0},get children(){return[lr(),(()=>{var l=fe();return s(l,t(U,{each:o,children:(i,u)=>(()=>{var g=fr(),_=g.firstChild,z=_.nextSibling,D=z.nextSibling,W=D.nextSibling,E=W.nextSibling;return _.$$input=I=>f(u(),"name",I.currentTarget.value),z.addEventListener("change",I=>f(u(),"type",I.currentTarget.value)),D.$$input=I=>f(u(),"port",I.currentTarget.value),W.$$input=I=>f(u(),"command",I.currentTarget.value),E.$$click=()=>F(u()),s(E,t(Xe,{class:"size-3.5"})),H(()=>_.value=i.name),H(()=>z.value=i.type),H(()=>D.value=i.port),H(()=>W.value=i.command),g})()})),l})(),ar()]}}),null),s(d,t(C,{get when(){return B(()=>a().length===0)()&&o.length===0},get children(){return or()}}),null),H(()=>y.disabled=S()),d})()}xe(["click","input"]);var mr=p('<div class="flex h-full w-full shrink-0 justify-between gap-2 sm:flex-col"><div class="flex w-full shrink-0 gap-2 py-2 sm:flex-col sm:gap-3 sm:pt-3"><div class="flex shrink-0 gap-2 sm:flex-col sm:gap-3"><div class="flex shrink-0 gap-1.5 sm:flex-col"><div class="hidden sm:block"></div><div class="flex shrink-0 gap-1.5 sm:w-full sm:flex-col"></div></div><div class="flex shrink-0 gap-1.5 sm:flex-col"><div class="hidden sm:block"></div><div class="flex shrink-0 gap-1.5 sm:w-full sm:flex-col"></div></div></div></div><div class="hidden flex-col gap-1 pl-1 py-1 text-12-medium text-text-weak sm:flex"><span></span><span class=text-11-regular>v');const kr=r=>{const e=ee(),a=he(),n=st("(max-width: 639px)");return t(nt,{size:"x-large",transition:!0,class:"!h-[calc(100dvh-2rem)] !w-[calc(100vw-2rem)] [&_[data-slot=dialog-body]]:min-h-0 sm:!h-[min(720px,calc(100dvh-2rem))] sm:!w-[min(960px,calc(100vw-2rem))]",get children(){return t(O,{get orientation(){return n()?"horizontal":"vertical"},variant:"settings",get defaultValue(){return r.tab??"general"},class:"h-full min-h-0 settings-dialog",get children(){return[t(O.List,{class:"shrink-0 overflow-x-auto no-scrollbar sm:overflow-visible",get children(){var o=mr(),f=o.firstChild,S=f.firstChild,b=S.firstChild,x=b.firstChild,k=x.nextSibling,T=b.nextSibling,j=T.firstChild,L=j.nextSibling,F=f.nextSibling,m=F.firstChild,h=m.nextSibling;return h.firstChild,s(x,t(O.SectionTitle,{get children(){return e.t("settings.section.desktop")}})),s(k,t(O.Trigger,{value:"general",get children(){return[t(G,{name:"sliders"}),B(()=>e.t("settings.tab.general"))]}}),null),s(k,t(O.Trigger,{value:"shortcuts",get children(){return[t(G,{name:"keyboard"}),B(()=>e.t("settings.tab.shortcuts"))]}}),null),s(j,t(O.SectionTitle,{get children(){return e.t("settings.section.server")}})),s(L,t(O.Trigger,{value:"providers",get children(){return[t(G,{name:"providers"}),B(()=>e.t("settings.providers.title"))]}}),null),s(L,t(O.Trigger,{value:"models",get children(){return[t(G,{name:"models"}),B(()=>e.t("settings.models.title"))]}}),null),s(L,t(O.Trigger,{value:"services",get children(){return[t(G,{name:"terminal"}),"Services"]}}),null),s(m,()=>e.t("app.name.desktop")),s(h,()=>a.version,null),o}}),t(O.Content,{value:"general",class:"min-h-0 no-scrollbar",get children(){return t(Pt,{})}}),t(O.Content,{value:"shortcuts",class:"min-h-0 no-scrollbar",get children(){return t(Vt,{})}}),t(O.Content,{value:"providers",class:"min-h-0 no-scrollbar",get children(){return t(Jt,{})}}),t(O.Content,{value:"models",class:"min-h-0 no-scrollbar",get children(){return t(ir,{})}}),t(O.Content,{value:"services",class:"min-h-0 no-scrollbar",get children(){return t(hr,{})}})]}})}})};export{kr as DialogSettings};
@@ -1,4 +1,4 @@
1
- import{g as wt}from"./chunk-55IACEB6-D-1nWAoQ.js";import{s as Vt}from"./chunk-KX2RTZJC-D2iD22zX.js";import{_ as o,b as Mt,a as Bt,s as Ft,g as Yt,p as Pt,q as zt,c as st,l as L,y as Gt,x as Kt,A as Ut,B as Zt,o as jt,r as Wt,u as Qt}from"./mermaid.core-A5qPJp89.js";import{s as Xt}from"./transform-BwXaE9hv.js";import{c as qt}from"./channel-BJNb-x5G.js";import"./index-DNqzOxQM.js";var yt=(function(){var e=o(function(A,n,a,c){for(a=a||{},c=A.length;c--;a[A[c]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],d=[1,10],l=[1,11],h=[1,12],p=[1,13],R=[1,23],g=[1,24],m=[1,25],w=[1,26],j=[1,27],k=[1,19],it=[1,28],W=[1,29],S=[1,20],I=[1,18],V=[1,21],M=[1,22],rt=[1,36],nt=[1,37],at=[1,38],ct=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],T=[1,45],O=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],N=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],_t=[65,66,67,68,69],gt=[1,84],bt=[1,83],mt=[1,81],Et=[1,82],kt=[6,10,42,47],v=[6,10,13,41,42,47,48,49],X=[1,92],q=[1,91],H=[1,90],U=[19,58],St=[1,101],Tt=[1,100],ot=[19,58,60,62],ht={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:o(function(n,a,c,r,u,t,Z){var s=t.length-1;switch(u){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:d,24:l,26:h,28:p,29:14,30:15,31:16,32:17,33:R,34:g,35:m,36:w,37:j,40:k,43:it,44:W,48:S,50:I,51:V,52:M},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:d,24:l,26:h,28:p,29:14,30:15,31:16,32:17,33:R,34:g,35:m,36:w,37:j,40:k,43:it,44:W,48:S,50:I,51:V,52:M},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:rt,66:nt,67:at,68:ct,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:T,41:O},{16:47,40:T,41:O},{16:48,40:T,41:O},e(i,[2,4]),{11:49,40:k,48:S,50:I,51:V,52:M},{16:50,40:T,41:O},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:k,48:S,50:I,51:V,52:M},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:N,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:T,41:O,42:N},{13:P,38:69,41:z,42:N,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:N,65:rt,66:nt,67:at,68:ct,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:rt,66:nt,67:at,68:ct,69:lt},e(_t,[2,77]),e(_t,[2,78]),{6:gt,10:bt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(kt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(v,[2,45]),e(v,[2,50]),e(v,[2,51]),e(v,[2,52]),e(v,[2,53]),e(i,[2,41],{42:N}),{6:gt,10:bt,39:88,42:mt,47:Et},{14:89,40:X,50:q,72:H},{16:93,40:T,41:O},{11:94,40:k,48:S,50:I,51:V,52:M},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Tt}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(v,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:N},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Tt}),e(U,[2,63]),e(ot,[2,67]),e(U,[2,70]),e(ot,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:T,41:O},e(kt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:X,50:q,72:H},{16:115,40:T,41:O},{14:116,40:X,50:q,72:H},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:N}),e(i,[2,11]),{13:[1,120],42:N},e(i,[2,10]),e(ot,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:X,50:q,72:H},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:o(function(n,a){if(a.recoverable)this.trace(n);else{var c=new Error(n);throw c.hash=a,c}},"parseError"),parse:o(function(n){var a=this,c=[0],r=[],u=[null],t=[],Z=this.table,s="",$=0,Ot=0,Ct=2,Nt=1,vt=t.slice.call(arguments,1),f=Object.create(this.lexer),x={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(x.yy[ut]=this.yy[ut]);f.setInput(n,x.yy),x.yy.lexer=f,x.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var dt=f.yylloc;t.push(dt);var Dt=f.options&&f.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Lt(_){c.length=c.length-2*_,u.length=u.length-_,t.length=t.length-_}o(Lt,"popStack");function At(){var _;return _=r.pop()||f.lex()||Nt,typeof _!="number"&&(_ instanceof Array&&(r=_,_=r.pop()),_=a.symbols_[_]||_),_}o(At,"lex");for(var y,C,b,pt,D={},tt,E,Rt,et;;){if(C=c[c.length-1],this.defaultActions[C]?b=this.defaultActions[C]:((y===null||typeof y>"u")&&(y=At()),b=Z[C]&&Z[C][y]),typeof b>"u"||!b.length||!b[0]){var ft="";et=[];for(tt in Z[C])this.terminals_[tt]&&tt>Ct&&et.push("'"+this.terminals_[tt]+"'");f.showPosition?ft="Parse error on line "+($+1)+`:
1
+ import{g as wt}from"./chunk-55IACEB6-B1ttgmiW.js";import{s as Vt}from"./chunk-KX2RTZJC-DoPKMzaO.js";import{_ as o,b as Mt,a as Bt,s as Ft,g as Yt,p as Pt,q as zt,c as st,l as L,y as Gt,x as Kt,A as Ut,B as Zt,o as jt,r as Wt,u as Qt}from"./mermaid.core-DekouHcR.js";import{s as Xt}from"./transform-BwXaE9hv.js";import{c as qt}from"./channel-BAzJXAXH.js";import"./index-Cl9Gy4vs.js";var yt=(function(){var e=o(function(A,n,a,c){for(a=a||{},c=A.length;c--;a[A[c]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],d=[1,10],l=[1,11],h=[1,12],p=[1,13],R=[1,23],g=[1,24],m=[1,25],w=[1,26],j=[1,27],k=[1,19],it=[1,28],W=[1,29],S=[1,20],I=[1,18],V=[1,21],M=[1,22],rt=[1,36],nt=[1,37],at=[1,38],ct=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],T=[1,45],O=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],N=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],_t=[65,66,67,68,69],gt=[1,84],bt=[1,83],mt=[1,81],Et=[1,82],kt=[6,10,42,47],v=[6,10,13,41,42,47,48,49],X=[1,92],q=[1,91],H=[1,90],U=[19,58],St=[1,101],Tt=[1,100],ot=[19,58,60,62],ht={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:o(function(n,a,c,r,u,t,Z){var s=t.length-1;switch(u){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:d,24:l,26:h,28:p,29:14,30:15,31:16,32:17,33:R,34:g,35:m,36:w,37:j,40:k,43:it,44:W,48:S,50:I,51:V,52:M},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:d,24:l,26:h,28:p,29:14,30:15,31:16,32:17,33:R,34:g,35:m,36:w,37:j,40:k,43:it,44:W,48:S,50:I,51:V,52:M},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:rt,66:nt,67:at,68:ct,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:T,41:O},{16:47,40:T,41:O},{16:48,40:T,41:O},e(i,[2,4]),{11:49,40:k,48:S,50:I,51:V,52:M},{16:50,40:T,41:O},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:k,48:S,50:I,51:V,52:M},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:N,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:T,41:O,42:N},{13:P,38:69,41:z,42:N,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:N,65:rt,66:nt,67:at,68:ct,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:rt,66:nt,67:at,68:ct,69:lt},e(_t,[2,77]),e(_t,[2,78]),{6:gt,10:bt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(kt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(v,[2,45]),e(v,[2,50]),e(v,[2,51]),e(v,[2,52]),e(v,[2,53]),e(i,[2,41],{42:N}),{6:gt,10:bt,39:88,42:mt,47:Et},{14:89,40:X,50:q,72:H},{16:93,40:T,41:O},{11:94,40:k,48:S,50:I,51:V,52:M},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Tt}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(v,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:N},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Tt}),e(U,[2,63]),e(ot,[2,67]),e(U,[2,70]),e(ot,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:T,41:O},e(kt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:X,50:q,72:H},{16:115,40:T,41:O},{14:116,40:X,50:q,72:H},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:N}),e(i,[2,11]),{13:[1,120],42:N},e(i,[2,10]),e(ot,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:X,50:q,72:H},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:o(function(n,a){if(a.recoverable)this.trace(n);else{var c=new Error(n);throw c.hash=a,c}},"parseError"),parse:o(function(n){var a=this,c=[0],r=[],u=[null],t=[],Z=this.table,s="",$=0,Ot=0,Ct=2,Nt=1,vt=t.slice.call(arguments,1),f=Object.create(this.lexer),x={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(x.yy[ut]=this.yy[ut]);f.setInput(n,x.yy),x.yy.lexer=f,x.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var dt=f.yylloc;t.push(dt);var Dt=f.options&&f.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Lt(_){c.length=c.length-2*_,u.length=u.length-_,t.length=t.length-_}o(Lt,"popStack");function At(){var _;return _=r.pop()||f.lex()||Nt,typeof _!="number"&&(_ instanceof Array&&(r=_,_=r.pop()),_=a.symbols_[_]||_),_}o(At,"lex");for(var y,C,b,pt,D={},tt,E,Rt,et;;){if(C=c[c.length-1],this.defaultActions[C]?b=this.defaultActions[C]:((y===null||typeof y>"u")&&(y=At()),b=Z[C]&&Z[C][y]),typeof b>"u"||!b.length||!b[0]){var ft="";et=[];for(tt in Z[C])this.terminals_[tt]&&tt>Ct&&et.push("'"+this.terminals_[tt]+"'");f.showPosition?ft="Parse error on line "+($+1)+`:
2
2
  `+f.showPosition()+`
3
3
  Expecting `+et.join(", ")+", got '"+(this.terminals_[y]||y)+"'":ft="Parse error on line "+($+1)+": Unexpected "+(y==Nt?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(ft,{text:f.match,token:this.terminals_[y]||y,line:f.yylineno,loc:dt,expected:et})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+y);switch(b[0]){case 1:c.push(y),u.push(f.yytext),t.push(f.yylloc),c.push(b[1]),y=null,Ot=f.yyleng,s=f.yytext,$=f.yylineno,dt=f.yylloc;break;case 2:if(E=this.productions_[b[1]][1],D.$=u[u.length-E],D._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Dt&&(D._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),pt=this.performAction.apply(D,[s,Ot,$,x.yy,b[1],u,t].concat(vt)),typeof pt<"u")return pt;E&&(c=c.slice(0,-1*E*2),u=u.slice(0,-1*E),t=t.slice(0,-1*E)),c.push(this.productions_[b[1]][0]),u.push(D.$),t.push(D._$),Rt=Z[c[c.length-2]][c[c.length-1]],c.push(Rt);break;case 3:return!0}}return!0},"parse")},xt=(function(){var A={EOF:1,parseError:o(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:o(function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:o(function(n){var a=n.length,c=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===r.length?this.yylloc.first_column:0)+r[r.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(n){this.unput(this.match.slice(n))},"less"),pastInput:o(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as qe}from"./chunk-FMBD7UC4-CMssrhkO.js";import{_ as A,n as Oe,l as $,c as g1,o as He,r as Xe,u as ie,b as Qe,s as Je,p as Ze,a as $e,g as et,q as tt,j as st,t as it,J as rt,v as at,x as se,y as nt,z as ut,A as ot}from"./mermaid.core-A5qPJp89.js";import{c as lt}from"./chunk-JSJVCQXG-zTAdatO4.js";import{g as ct}from"./chunk-55IACEB6-D-1nWAoQ.js";import{s as ht}from"./chunk-KX2RTZJC-D2iD22zX.js";import{s as G1}from"./transform-BwXaE9hv.js";import{ad as dt}from"./index-DNqzOxQM.js";import{c as pt}from"./channel-BJNb-x5G.js";var ft="flowchart-",gt=class{constructor(){this.vertexCounter=0,this.config=g1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Qe,this.setAccDescription=Je,this.setDiagramTitle=Ze,this.getAccTitle=$e,this.getAccDescription=et,this.getDiagramTitle=tt,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{A(this,"FlowDB")}sanitizeText(e){return st.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return i.domId;return e}addVertex(e,i,r,a,o,d,l={},b){if(!e||e.trim().length===0)return;let n;if(b!==void 0){let D;b.includes(`
1
+ import{g as qe}from"./chunk-FMBD7UC4-B499Kca1.js";import{_ as A,n as Oe,l as $,c as g1,o as He,r as Xe,u as ie,b as Qe,s as Je,p as Ze,a as $e,g as et,q as tt,j as st,t as it,J as rt,v as at,x as se,y as nt,z as ut,A as ot}from"./mermaid.core-DekouHcR.js";import{c as lt}from"./chunk-JSJVCQXG-DrDqUScK.js";import{g as ct}from"./chunk-55IACEB6-B1ttgmiW.js";import{s as ht}from"./chunk-KX2RTZJC-DoPKMzaO.js";import{s as G1}from"./transform-BwXaE9hv.js";import{ae as dt}from"./index-Cl9Gy4vs.js";import{c as pt}from"./channel-BAzJXAXH.js";var ft="flowchart-",gt=class{constructor(){this.vertexCounter=0,this.config=g1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Qe,this.setAccDescription=Je,this.setDiagramTitle=Ze,this.getAccTitle=$e,this.getAccDescription=et,this.getDiagramTitle=tt,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{A(this,"FlowDB")}sanitizeText(e){return st.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return i.domId;return e}addVertex(e,i,r,a,o,d,l={},b){if(!e||e.trim().length===0)return;let n;if(b!==void 0){let D;b.includes(`
2
2
  `)?D=b+`
3
3
  `:D=`{
4
4
  `+b+`
@@ -1,4 +1,4 @@
1
- import{a5 as f}from"./index-DNqzOxQM.js";/*!-----------------------------------------------------------------------------
1
+ import{a3 as f}from"./index-Cl9Gy4vs.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license