coding-tool-x 3.9.9-261027 → 3.9.9-261105

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 (120) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/dist/web/assets/AgentsDrawer-DWnAsTH_.js +1 -0
  3. package/dist/web/assets/Analytics-D_WWRO5h.js +1 -0
  4. package/dist/web/assets/AssetPathField-CoIuoSZr.js +1 -0
  5. package/dist/web/assets/ChatHistoryDrawer-B_OnCpxR.js +1 -0
  6. package/dist/web/assets/CollapseItem-DEV7PQ-o.js +1 -0
  7. package/dist/web/assets/CommandsDrawer-gG61nb7a.js +1 -0
  8. package/dist/web/assets/ConfigExportDrawer-BkSzLSuZ.js +1 -0
  9. package/dist/web/assets/ConfigTemplates-DvEDpIso.js +1 -0
  10. package/dist/web/assets/ConfigTemplatesDrawer-DMPO4gjt.js +1 -0
  11. package/dist/web/assets/ConfigTemplatesPanel-BQe31_bq.js +1 -0
  12. package/dist/web/assets/Divider-CEqaZMTW.js +1 -0
  13. package/dist/web/assets/DrawerContent-BYlV968f.js +1 -0
  14. package/dist/web/assets/FavoritesDrawer-Y-MmIIE9.js +1 -0
  15. package/dist/web/assets/{Forward-DLCL7aMY.js → Forward-kgMPT2RI.js} +1 -1
  16. package/dist/web/assets/GatewayConvertDrawer-BvYhzJD6.js +1 -0
  17. package/dist/web/assets/Home-BOwk4kTa.js +1 -0
  18. package/dist/web/assets/MarkdownEditor-Bf9QKKaV.js +1 -0
  19. package/dist/web/assets/McpDrawer-B7cwI24B.js +1 -0
  20. package/dist/web/assets/McpFormDrawer-Djt5CJyE.js +1 -0
  21. package/dist/web/assets/PluginManager-B4J_hR0V.js +1 -0
  22. package/dist/web/assets/PluginsDrawer-Ch4x66-E.js +1 -0
  23. package/dist/web/assets/PluginsPanel-mqXBlKZg.js +1 -0
  24. package/dist/web/assets/ProjectList-DtmQyoPc.css +1 -0
  25. package/dist/web/assets/ProjectList-xToRgLVw.js +1 -0
  26. package/dist/web/assets/PromptsDrawer-VYrlk-F6.js +1 -0
  27. package/dist/web/assets/RecentSessionsDrawer-DCsgGSBu.js +1 -0
  28. package/dist/web/assets/SessionCard-C9n9lC_Y.css +1 -0
  29. package/dist/web/assets/SessionCard-DwzxeSe9.js +1 -0
  30. package/dist/web/assets/{SessionList-qG_XpPBJ.css → SessionList-CCuKp6ib.css} +1 -1
  31. package/dist/web/assets/SessionList-GqzUHgOu.js +1 -0
  32. package/dist/web/assets/SettingsDrawer-Q_aTOBhf.js +1 -0
  33. package/dist/web/assets/SkillManager-B1B58WKe.js +1 -0
  34. package/dist/web/assets/SkillsDrawer-Ch1b1hLn.js +1 -0
  35. package/dist/web/assets/SkillsPanel-B_xxyDpy.js +1 -0
  36. package/dist/web/assets/{Upload-xqorL26i.js → Upload-B6Kn1TvG.js} +1 -1
  37. package/dist/web/assets/WorkspaceDrawer-C3w-Z87U.js +1 -0
  38. package/dist/web/assets/WorkspaceManager-BFzjeEWh.js +1 -0
  39. package/dist/web/assets/WorkspacePanel-DkrwFSLs.js +1 -0
  40. package/dist/web/assets/_plugin-vue_export-helper-DyHLuIR4.js +1 -0
  41. package/dist/web/assets/{client-oU6RT-6I.js → client-B31QOzWk.js} +1 -1
  42. package/dist/web/assets/{dsh-agent-presets-DjJRVMT6.js → dsh-agent-presets-DopJnuAZ.js} +1 -1
  43. package/dist/web/assets/headers-nTUGmJee.js +1 -0
  44. package/dist/web/assets/{icons-B-AzZoeE.js → icons-C6KNTFqo.js} +1 -1
  45. package/dist/web/assets/index-BXWpib7P.js +2 -0
  46. package/dist/web/assets/{index-DjIuAtaS.css → index-CvL_fRpL.css} +1 -1
  47. package/dist/web/assets/light-DeIjG9s_.js +1 -0
  48. package/dist/web/assets/markdown-xLK9ekFg.js +1 -0
  49. package/dist/web/assets/platforms-BdTllxKt.js +1 -0
  50. package/dist/web/assets/{platforms-p9AiybLU.js → platforms-CDltfh5G.js} +1 -1
  51. package/dist/web/assets/{project-config-CzFKBw_m.js → project-config-C16yaWHF.js} +1 -1
  52. package/dist/web/assets/rolldown-runtime-DcNxTHDL.js +1 -0
  53. package/dist/web/assets/sessions-B4RD8wDx.js +1 -0
  54. package/dist/web/assets/{sessions-DJiJJgvg.js → sessions-Xl0HAvhA.js} +1 -1
  55. package/dist/web/assets/use-lock-html-scroll-Bu94jdUB.js +1 -0
  56. package/dist/web/assets/use-message-BYx0IRj1.js +1 -0
  57. package/dist/web/assets/useResponsiveDrawer-Deh7Xdcj.js +1 -0
  58. package/dist/web/assets/vendors-CvGw6U_t.js +1 -0
  59. package/dist/web/assets/vue-vendor-Cr_NLmXY.js +1 -0
  60. package/dist/web/assets/{workspaces-D2yLnT-B.js → workspaces-Y7hS24p2.js} +1 -1
  61. package/dist/web/assets/xml-B78loRzO.js +1 -0
  62. package/dist/web/index.html +13 -12
  63. package/package.json +3 -3
  64. package/src/config/model-metadata.json +30 -4
  65. package/src/platforms/drivers/dsh/api-operations.js +1 -1
  66. package/src/platforms/drivers/dsh/channels-implementation.js +10 -0
  67. package/src/platforms/drivers/dsh/channels.js +10 -0
  68. package/src/platforms/drivers/dsh/proxy-implementation.js +7 -1
  69. package/src/platforms/drivers/dsh/sessions.js +5 -1
  70. package/src/platforms/manifest-schema.js +1 -1
  71. package/src/platforms/manifests/dsh.json +8 -0
  72. package/src/server/services/model-detector.js +22 -3
  73. package/dist/web/assets/AgentsDrawer-CKEf8ie1.js +0 -1
  74. package/dist/web/assets/Analytics-0BCMxQ-o.js +0 -1
  75. package/dist/web/assets/AssetPathField-pfN6L814.js +0 -1
  76. package/dist/web/assets/ChatHistoryDrawer-nuUPRqje.js +0 -1
  77. package/dist/web/assets/CollapseItem-B2SdqQp2.js +0 -1
  78. package/dist/web/assets/CommandsDrawer-D8m0qLzQ.js +0 -1
  79. package/dist/web/assets/ConfigExportDrawer-BlCBLdue.js +0 -1
  80. package/dist/web/assets/ConfigTemplates-CePBARK8.js +0 -1
  81. package/dist/web/assets/ConfigTemplatesDrawer-DbVY4rD1.js +0 -1
  82. package/dist/web/assets/ConfigTemplatesPanel-CwYPLEFV.js +0 -1
  83. package/dist/web/assets/Divider-BLLhMTSt.js +0 -1
  84. package/dist/web/assets/DrawerContent-ChXgZ1Xm.js +0 -1
  85. package/dist/web/assets/FavoritesDrawer-BKAKQNqP.js +0 -1
  86. package/dist/web/assets/GatewayConvertDrawer-D2MFXcqS.js +0 -1
  87. package/dist/web/assets/Home-BmElvXVZ.js +0 -1
  88. package/dist/web/assets/MarkdownEditor-buNC2iDj.js +0 -1
  89. package/dist/web/assets/McpDrawer-NBjAyFU5.js +0 -1
  90. package/dist/web/assets/McpFormDrawer-BUnW9j4A.js +0 -1
  91. package/dist/web/assets/PluginManager-BgHpsF5S.js +0 -1
  92. package/dist/web/assets/PluginsDrawer-CFnmqzV0.js +0 -1
  93. package/dist/web/assets/PluginsPanel-ClSdnSCu.js +0 -1
  94. package/dist/web/assets/ProjectList-CjlHEyU1.js +0 -1
  95. package/dist/web/assets/ProjectList-VbIYSHbH.css +0 -1
  96. package/dist/web/assets/PromptsDrawer-xeSGgpCd.js +0 -1
  97. package/dist/web/assets/RecentSessionsDrawer-DELB6-rU.js +0 -1
  98. package/dist/web/assets/SessionCard-BaH42eOe.js +0 -1
  99. package/dist/web/assets/SessionCard-aM2NHu6i.css +0 -1
  100. package/dist/web/assets/SessionList-BGB9GwYE.js +0 -1
  101. package/dist/web/assets/SettingsDrawer-DdYC8GIa.js +0 -1
  102. package/dist/web/assets/SkillManager-CF7EiSps.js +0 -1
  103. package/dist/web/assets/SkillsDrawer-Bc5zA1bk.js +0 -1
  104. package/dist/web/assets/SkillsPanel-SnzwzqW5.js +0 -1
  105. package/dist/web/assets/WorkspaceDrawer-DBiEnZ7j.js +0 -1
  106. package/dist/web/assets/WorkspaceManager-C1dNfoAy.js +0 -1
  107. package/dist/web/assets/WorkspacePanel-CWNQZjm1.js +0 -1
  108. package/dist/web/assets/_plugin-vue_export-helper-BeLZJZij.js +0 -1
  109. package/dist/web/assets/headers-DbowkmZJ.js +0 -1
  110. package/dist/web/assets/index-BKpL4XdU.js +0 -2
  111. package/dist/web/assets/light-C2X7hegj.js +0 -1
  112. package/dist/web/assets/markdown-u082bbtj.js +0 -1
  113. package/dist/web/assets/platforms-Cq6XDXfy.js +0 -1
  114. package/dist/web/assets/sessions-DSLpMXCq.js +0 -1
  115. package/dist/web/assets/use-lock-html-scroll-DXIqmUW4.js +0 -1
  116. package/dist/web/assets/use-message-DBsCm7FJ.js +0 -1
  117. package/dist/web/assets/useResponsiveDrawer-CTQPBATk.js +0 -1
  118. package/dist/web/assets/vendors-D0c_0KLP.js +0 -1
  119. package/dist/web/assets/vue-vendor-BqZbbXHA.js +0 -1
  120. package/dist/web/assets/xml-CgY3RMlX.js +0 -1
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-BOwk4kTa.js","assets/vue-vendor-Cr_NLmXY.js","assets/vendors-CvGw6U_t.js","assets/rolldown-runtime-DcNxTHDL.js","assets/_plugin-vue_export-helper-DyHLuIR4.js","assets/use-message-BYx0IRj1.js","assets/icons-C6KNTFqo.js","assets/platforms-BdTllxKt.js","assets/platforms-CDltfh5G.js","assets/client-B31QOzWk.js","assets/RecentSessionsDrawer-DCsgGSBu.js","assets/useResponsiveDrawer-Deh7Xdcj.js","assets/use-lock-html-scroll-Bu94jdUB.js","assets/DrawerContent-BYlV968f.js","assets/SessionCard-DwzxeSe9.js","assets/SessionCard-C9n9lC_Y.css","assets/sessions-B4RD8wDx.js","assets/clipboard-B46yyoz_.js","assets/session-visibility-BAmxh3cK.js","assets/RecentSessionsDrawer-yrAD4p1A.css","assets/Home-BRNWE0Qy.css","assets/ProjectList-xToRgLVw.js","assets/headers-nTUGmJee.js","assets/light-DeIjG9s_.js","assets/sessions-Xl0HAvhA.js","assets/ProjectList-DtmQyoPc.css","assets/SessionList-GqzUHgOu.js","assets/Forward-kgMPT2RI.js","assets/ChatHistoryDrawer-B_OnCpxR.js","assets/markdown-xLK9ekFg.js","assets/xml-B78loRzO.js","assets/ChatHistoryDrawer-B2qBQs9L.css","assets/AssetPathField-CoIuoSZr.js","assets/project-config-C16yaWHF.js","assets/McpFormDrawer-Djt5CJyE.js","assets/CollapseItem-DEV7PQ-o.js","assets/McpFormDrawer-BRbDcawn.css","assets/SkillsPanel-B_xxyDpy.js","assets/skill-repo-input-B_fkGlUK.js","assets/Upload-B6Kn1TvG.js","assets/MarkdownEditor-Bf9QKKaV.js","assets/MarkdownEditor-qfVgSre_.css","assets/SkillsPanel-C4ke56nF.css","assets/SessionList-CCuKp6ib.css","assets/WorkspaceManager-BFzjeEWh.js","assets/WorkspacePanel-DkrwFSLs.js","assets/workspaces-Y7hS24p2.js","assets/Divider-CEqaZMTW.js","assets/WorkspacePanel-D0-zHTHP.css","assets/WorkspaceManager-CrwgQgmP.css","assets/ConfigTemplates-DvEDpIso.js","assets/ConfigTemplatesPanel-BQe31_bq.js","assets/ConfigTemplatesPanel-CWyPtk67.css","assets/ConfigTemplates-Bidwfdf2.css","assets/SkillManager-B1B58WKe.js","assets/SkillManager-C0GCT2Kb.css","assets/PluginManager-B4J_hR0V.js","assets/PluginsPanel-mqXBlKZg.js","assets/dsh-agent-presets-DopJnuAZ.js","assets/PluginsPanel-B1PcHqhB.css","assets/PluginManager-ROyoZ-6m.css","assets/Analytics-D_WWRO5h.js","assets/Analytics-CyHhR126.css","assets/FavoritesDrawer-Y-MmIIE9.js","assets/FavoritesDrawer-CG9eI9Ay.css","assets/SettingsDrawer-Q_aTOBhf.js","assets/SettingsDrawer-Cw-6Joic.css","assets/McpDrawer-B7cwI24B.js","assets/McpDrawer-C0dnsZhQ.css","assets/PromptsDrawer-VYrlk-F6.js","assets/PromptsDrawer-BIgiYCEQ.css","assets/GatewayConvertDrawer-BvYhzJD6.js","assets/GatewayConvertDrawer-CvUkvNQy.css","assets/SkillsDrawer-Ch1b1hLn.js","assets/SkillsDrawer-BCNme-aJ.css","assets/CommandsDrawer-gG61nb7a.js","assets/CommandsDrawer-BZJxlPvV.css","assets/AgentsDrawer-DWnAsTH_.js","assets/AgentsDrawer-Dubq1kQI.css","assets/PluginsDrawer-Ch4x66-E.js","assets/PluginsDrawer-DM3QjprE.css","assets/WorkspaceDrawer-C3w-Z87U.js","assets/WorkspaceDrawer-CGnMu9p1.css","assets/ConfigTemplatesDrawer-DMPO4gjt.js","assets/ConfigTemplatesDrawer-BfDi8yO3.css","assets/ConfigExportDrawer-BkSzLSuZ.js","assets/ConfigExportDrawer-dwruRKWr.css"])))=>i.map(i=>d[i]);
2
+ import{A as e,B as o,C as n,D as t,F as r,G as a,H as l,I as i,J as s,K as d,L as c,M as u,N as p,O as h,Q as f,R as m,S as v,T as g,V as b,W as y,Y as x,Z as C,_ as w,_t as S,a as k,at as P,b as I,c as T,d as A,dt as z,et as R,f as M,g as F,gt as O,h as B,ht as $,i as E,j as D,k as _,l as L,m as H,mt as j,n as U,o as W,ot as N,p as K,q as V,r as q,rt as G,st as J,t as Y,tt as Z,w as X,x as Q,z as ee}from"./vue-vendor-Cr_NLmXY.js";import{a as oe,d as ne,f as te,i as re,l as ae,n as le,o as ie,t as se}from"./platforms-BdTllxKt.js";import{$t as de,A as ce,At as ue,C as pe,Cn as he,Ct as fe,D as me,Dt as ve,E as ge,F as be,Ft as ye,Ht as xe,I as Ce,L as we,Lt as Se,M as ke,Mt as Pe,N as Ie,O as Te,Ot as Ae,P as ze,Pt as Re,Qt as Me,R as Fe,S as Oe,Sn as Be,St as $e,T as Ee,Tn as De,Tt as _e,Ut as Le,Wt as He,Xt as je,Yt as Ue,Zt as We,_ as Ne,_t as Ke,a as Ve,an as qe,b as Ge,bn as Je,bt as Ye,c as Ze,cn as Xe,dn as Qe,f as eo,fn as oo,g as no,gn as to,gt as ro,h as ao,hn as lo,ht as io,i as so,j as co,jt as uo,k as po,l as ho,ln as fo,mt as mo,n as vo,nn as go,o as bo,on as yo,pn as xo,pt as Co,qt as wo,r as So,rn as ko,s as Po,sn as Io,t as To,tn as Ao,u as zo,un as Ro,v as Mo,vn as Fo,vt as Oo,w as Bo,x as $o,xn as Eo,xt as Do,y as _o,yn as Lo,zt as Ho}from"./_plugin-vue_export-helper-DyHLuIR4.js";import{A as jo,C as Uo,D as Wo,E as No,F as Ko,N as Vo,O as qo,S as Go,T as Jo,_ as Yo,a as Zo,b as Xo,c as Qo,d as en,f as on,g as nn,h as tn,i as rn,j as an,k as ln,l as sn,m as dn,n as cn,o as un,p as pn,r as hn,s as fn,t as mn,u as vn,v as gn,w as bn,x as yn,y as xn}from"./use-message-BYx0IRj1.js";import{A as Cn,C as wn,D as Sn,E as kn,F as Pn,I as In,L as Tn,M as An,N as zn,P as Rn,S as Mn,T as Fn,_ as On,a as Bn,b as $n,c as En,d as Dn,f as _n,g as Ln,h as Hn,i as jn,j as Un,k as Wn,l as Nn,m as Kn,n as Vn,o as qn,p as Gn,r as Jn,s as Yn,t as Zn,u as Xn,v as Qn,w as et,x as ot,y as nt}from"./light-DeIjG9s_.js";import{B as tt,Dt as rt,K as at,M as lt,Mt as it,Nt as st,O as dt,Ot as ct,P as ut,R as pt,Y as ht,Z as ft,a as mt,bt as vt,dt as gt,ft as bt,h as yt,i as xt,m as Ct,o as wt,p as St,pt as kt,r as Pt,s as It,t as Tt,tt as At,u as zt,vt as Rt,wt as Mt,xt as Ft,yt as Ot}from"./icons-C6KNTFqo.js";import{a as Bt,r as $t,s as Et,t as Dt}from"./client-B31QOzWk.js";import{n as _t}from"./vendors-CvGw6U_t.js";import{r as Lt,t as Ht}from"./platforms-CDltfh5G.js";function jt({platformStore:e,configRef:o}={}){const n=e||se(),{uiConfig:t}=ie(),r=o||t,a=I(()=>n.all||n.platforms||[]),l=I(()=>oe({catalog:a.value,enabledCliPlatforms:r.value?.enabledCliPlatforms})),i=I(()=>new Map(a.value.map(e=>[e.key,e]))),s=I(()=>l.value.map(e=>i.value.get(e)).filter(Boolean));return{catalog:a,enabledPlatforms:s,enabledKeys:l,byCapability:function(e){return s.value.filter(o=>!0===o.capabilities?.[e]||!0===o.resourceTypes?.[e])},getPlatform:function(e){const o=String(e||"").trim().toLowerCase();return i.value.get(o)||null}}}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))o(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&o(e)}).observe(document,{childList:!0,subtree:!0})}function o(e){if(e.ep)return;e.ep=!0;const o=function(e){const o={};return e.integrity&&(o.integrity=e.integrity),e.referrerPolicy&&(o.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?o.credentials="include":"anonymous"===e.crossOrigin?o.credentials="omit":o.credentials="same-origin",o}(e);fetch(e.href,o)}}();var Ut={},Wt=function(e,o,n){let t=Promise.resolve();if(o&&o.length>0){let e;const n=document.querySelector("meta[property=csp-nonce]"),a=n?.nonce||n?.getAttribute("nonce");r=o.map(o=>{o=function(e){return"/"+e}(o);const n=(t=o,import.meta.resolve?new URL(import.meta.resolve(t)):new URL(t,import.meta.url));var t;const r=n.pathname.endsWith(".css");return function(e,o,n){if(o in e)return e[o];const t=n();if(!t)return void(e[o]=void 0);const r=t.then(()=>{e[o]=void 0},n=>{throw e[o]=void 0,n});return e[o]=r,r}(Ut,n.href,()=>{if(void 0===e){e={all:new Set,styles:new Set};const o=document.getElementsByTagName("link");for(let n=o.length-1;n>=0;n--){const t=o[n];e.all.add(t.href),"stylesheet"===t.rel&&e.styles.add(t.href)}}if((r?e.styles:e.all).has(n.href))return;const o=document.createElement("link");return o.rel=r?"stylesheet":"modulepreload",r||(o.as="script"),o.crossOrigin="",o.href=n.href,a&&o.setAttribute("nonce",a),document.head.appendChild(o),r?new Promise((e,t)=>{o.addEventListener("load",e),o.addEventListener("error",()=>t(new Error(`Unable to preload CSS for ${n}`)))}):void 0})}).filter(e=>void 0!==e),t=Promise.all(r.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))}var r;function a(e){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=e,window.dispatchEvent(o),!o.defaultPrevented)throw e}return t.then(o=>{for(const e of o||[])"rejected"===e.status&&a(e.reason);return e().catch(a)})};var Nt=[{path:"/",name:"home",component:()=>Wt(()=>import("./Home-BOwk4kTa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))},{path:"/cli/:platform",name:"cli-projects",component:()=>Wt(()=>import("./ProjectList-xToRgLVw.js"),__vite__mapDeps([21,1,22,4,23,5,12,6,24,9,2,3,8,16,17,18,7,25])),meta:{requiresCli:!0}},{path:"/cli/:platform/sessions/:projectName",name:"cli-sessions",component:()=>Wt(()=>import("./SessionList-GqzUHgOu.js"),__vite__mapDeps([26,1,4,22,23,5,12,27,6,24,9,2,3,8,16,17,18,7,28,11,29,30,31,13,32,33,34,35,36,37,38,39,40,41,42,43])),props:!0,meta:{requiresCli:!0}},...["claude","codex","gemini","opencode","omp"].flatMap(e=>[{path:`/${e}`,name:`${e}-projects-legacy`,redirect:{name:"cli-projects",params:{platform:e}}},{path:`/${e}/sessions/:projectName`,name:`${e}-sessions-legacy`,redirect:o=>({name:"cli-sessions",params:{platform:e,projectName:o.params.projectName}})}]),{path:"/workspaces",name:"workspaces",component:()=>Wt(()=>import("./WorkspaceManager-BFzjeEWh.js"),__vite__mapDeps([44,1,23,4,5,12,45,6,46,9,2,3,47,17,48,49]))},{path:"/config-templates",name:"config-templates",component:()=>Wt(()=>import("./ConfigTemplates-DvEDpIso.js"),__vite__mapDeps([50,1,23,4,5,12,51,6,46,9,2,3,40,29,30,41,47,35,52,53]))},{path:"/skills",name:"skills",component:()=>Wt(()=>import("./SkillManager-B1B58WKe.js"),__vite__mapDeps([54,1,23,4,5,12,37,6,33,9,2,3,32,17,38,39,40,29,30,41,11,13,7,8,42,55]))},{path:"/plugins",name:"plugins",component:()=>Wt(()=>import("./PluginManager-B4J_hR0V.js"),__vite__mapDeps([56,1,23,4,5,12,57,6,9,2,3,58,32,17,38,11,13,29,7,8,59,60]))},{path:"/analytics",name:"analytics",component:()=>Wt(()=>import("./Analytics-D_WWRO5h.js"),__vite__mapDeps([61,3,1,4,5,27,6,62]))},{path:"/:pathMatch(.*)*",redirect:"/"}],Kt=Y({history:U(),routes:Nt});function Vt(e,o){let{target:n}=e;for(;n;){if(n.dataset&&void 0!==n.dataset[o])return!0;n=n.parentElement}return!1}function qt(e={},o){const n=P({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:t,keyup:r}=e,a=e=>{switch(e.key){case"Control":n.ctrl=!0;break;case"Meta":n.command=!0,n.win=!0;break;case"Shift":n.shift=!0;break;case"Tab":n.tab=!0}void 0!==t&&Object.keys(t).forEach(o=>{if(o!==e.key)return;const n=t[o];if("function"==typeof n)n(e);else{const{stop:o=!1,prevent:t=!1}=n;o&&e.stopPropagation(),t&&e.preventDefault(),n.handler(e)}})},l=e=>{switch(e.key){case"Control":n.ctrl=!1;break;case"Meta":n.command=!1,n.win=!1;break;case"Shift":n.shift=!1;break;case"Tab":n.tab=!1}void 0!==r&&Object.keys(r).forEach(o=>{if(o!==e.key)return;const n=r[o];if("function"==typeof n)n(e);else{const{stop:o=!1,prevent:t=!1}=n;o&&e.stopPropagation(),t&&e.preventDefault(),n.handler(e)}})},i=()=>{(void 0===o||o.value)&&(go("keydown",document,a),go("keyup",document,l)),void 0!==o&&C(o,e=>{e?(go("keydown",document,a),go("keyup",document,l)):(Ao("keydown",document,a),Ao("keyup",document,l))})};return Vo()?(m(i),ee(()=>{(void 0===o||o.value)&&(Ao("keydown",document,a),Ao("keyup",document,l))})):i(),N(n)}function Gt(e,o,n){var t;const r=p(e,null);if(null===r)return;const a=null===(t=D())||void 0===t?void 0:t.proxy;function l(e,n){if(!r)return;const t=r[o];void 0!==n&&function(e,o){e[o]||(e[o]=[]);e[o].splice(e[o].findIndex(e=>e===a),1)}(t,n),void 0!==e&&function(e,o){e[o]||(e[o]=[]);~e[o].findIndex(e=>e===a)||e[o].push(a)}(t,e)}C(n,l),l(n.value),ee(()=>{l(void 0,n.value)})}function Jt(e){return e&-e}Kt.beforeEach(async e=>{if(!0!==e.meta.requiresCli)return!0;const o=re(e);if(!o)return{name:"home"};try{const e=se(),{uiConfig:n,loadUIConfig:t}=ie();await Promise.all([e.load(),t()]);const{enabledKeys:r}=jt({platformStore:e,configRef:n});return!!r.value.includes(o)||{name:"home"}}catch{return{name:"home"}}});var Yt,Zt,Xt=class{constructor(e,o){this.l=e,this.min=o;const n=new Array(e+1);for(let t=0;t<e+1;++t)n[t]=0;this.ft=n}add(e,o){if(0===o)return;const{l:n,ft:t}=this;for(e+=1;e<=n;)t[e]+=o,e+=Jt(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(void 0===e&&(e=this.l),e<=0)return 0;const{ft:o,min:n,l:t}=this;if(e>t)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let r=e*n;for(;e>0;)r+=o[e],e-=Jt(e);return r}getBound(e){let o=0,n=this.l;for(;n>o;){const t=Math.floor((o+n)/2),r=this.sum(t);if(r>e)n=t;else{if(!(r<e))return t;if(o===t)return this.sum(o+1)<=e?o+1:t;o=t}}return o}};function Qt(){return"undefined"==typeof document?1:(void 0===Zt&&(Zt="chrome"in window?window.devicePixelRatio:1),Zt)}var er="VVirtualListXScroll";var or=e({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:o,columnsRef:n,getLeft:t,renderColRef:r,renderItemWithColsRef:a}=p(er);return{startIndex:e,endIndex:o,columns:n,renderCol:r,renderItemWithCols:a,getLeft:t}},render(){const{startIndex:e,endIndex:o,columns:n,renderCol:t,renderItemWithCols:r,getLeft:a,item:l}=this;if(null!=r)return r({itemIndex:this.index,startColIndex:e,endColIndex:o,allColumns:n,item:l,getLeft:a});if(null!=t){const r=[];for(let i=e;i<=o;++i){const e=n[i];r.push(t({column:e,left:a(i),item:l}))}return r}return null}}),nr=Jo(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jo("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jo("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),tr=e({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const n=Se();nr.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:No,ssr:n}),b(()=>{const{defaultScrollIndex:o,defaultScrollKey:n}=e;null!=o?x({index:o}):null!=n&&x({key:n})});let t=!1,r=!1;c(()=>{t=!1,r?x({top:v.value,left:s.value}):r=!0}),o(()=>{t=!0,r||(r=!0)});const l=de(()=>{if(null==e.renderCol&&null==e.renderItemWithCols)return;if(0===e.columns.length)return;let o=0;return e.columns.forEach(e=>{o+=e.width}),o}),i=I(()=>{const o=new Map,{keyField:n}=e;return e.items.forEach((e,t)=>{o.set(e[n],t)}),o}),{scrollLeftRef:s,listWidthRef:d}=function({columnsRef:e,renderColRef:o,renderItemWithColsRef:n}){const t=J(0),r=J(0),l=I(()=>{const o=e.value;if(0===o.length)return null;const n=new Xt(o.length,0);return o.forEach((e,o)=>{n.add(o,e.width)}),n}),i=de(()=>{const e=l.value;return null!==e?Math.max(e.getBound(r.value)-1,0):0}),s=de(()=>{const o=l.value;return null!==o?Math.min(o.getBound(r.value+t.value)+1,e.value.length-1):0});return a(er,{startIndexRef:i,endIndexRef:s,columnsRef:e,renderColRef:o,renderItemWithColsRef:n,getLeft:e=>{const o=l.value;return null!==o?o.sum(e):0}}),{listWidthRef:t,scrollLeftRef:r}}({columnsRef:z(e,"columns"),renderColRef:z(e,"renderCol"),renderItemWithColsRef:z(e,"renderItemWithCols")}),u=J(null),p=J(void 0),h=new Map,f=I(()=>{const{items:o,itemSize:n,keyField:t}=e,r=new Xt(o.length,n);return o.forEach((e,o)=>{const n=e[t],a=h.get(n);void 0!==a&&r.add(o,a)}),r}),m=J(0),v=J(0),g=de(()=>Math.max(f.value.getBound(v.value-fo(e.paddingTop))-1,0)),y=I(()=>{const{value:o}=p;if(void 0===o)return[];const{items:n,itemSize:t}=e,r=g.value,a=Math.min(r+Math.ceil(o/t+1),n.length-1),l=[];for(let e=r;e<=a;++e)l.push(n[e]);return l}),x=(e,o)=>{if("number"==typeof e)return void k(e,o,"auto");const{left:n,top:t,index:r,key:a,position:l,behavior:s,debounce:d=!0}=e;if(void 0!==n||void 0!==t)k(n,t,s);else if(void 0!==r)S(r,s,d);else if(void 0!==a){const e=i.value.get(a);void 0!==e&&S(e,s,d)}else"bottom"===l?k(0,Number.MAX_SAFE_INTEGER,s):"top"===l&&k(0,0,s)};let C,w=null;function S(o,n,t){const{value:r}=f,a=r.sum(o)+fo(e.paddingTop);if(t){C=o,null!==w&&window.clearTimeout(w),w=window.setTimeout(()=>{C=void 0,w=null},16);const{scrollTop:e,offsetHeight:t}=u.value;if(a>e){const l=r.get(o);a+l<=e+t||u.value.scrollTo({left:0,top:a+l-t,behavior:n})}else u.value.scrollTo({left:0,top:a,behavior:n})}else u.value.scrollTo({left:0,top:a,behavior:n})}function k(e,o,n){u.value.scrollTo({left:e,top:o,behavior:n})}const P=!("undefined"!=typeof document&&(void 0===Yt&&(Yt="matchMedia"in window&&window.matchMedia("(pointer:coarse)").matches),Yt));let T=!1;function A(){const{value:e}=u;null!=e&&(v.value=e.scrollTop,s.value=e.scrollLeft)}function R(e){let o=e;for(;null!==o;){if("none"===o.style.display)return!0;o=o.parentElement}return!1}return{listHeight:p,listStyle:{overflow:"auto"},keyToIndex:i,itemsStyle:I(()=>{const{itemResizable:o}=e,n=oo(f.value.sum());return m.value,[e.itemsStyle,{boxSizing:"content-box",width:oo(l.value),height:o?"":n,minHeight:o?n:"",paddingTop:oo(e.paddingTop),paddingBottom:oo(e.paddingBottom)}]}),visibleItemsStyle:I(()=>(m.value,{transform:`translateY(${oo(f.value.sum(g.value))})`})),viewportItems:y,listElRef:u,itemsElRef:J(null),scrollTo:x,handleListResize:function(o){if(t)return;if(R(o.target))return;if(null==e.renderCol&&null==e.renderItemWithCols){if(o.contentRect.height===p.value)return}else if(o.contentRect.height===p.value&&o.contentRect.width===d.value)return;p.value=o.contentRect.height,d.value=o.contentRect.width;const{onResize:n}=e;void 0!==n&&n(o)},handleListScroll:function(o){var n;null===(n=e.onScroll)||void 0===n||n.call(e,o),P&&T||A()},handleListWheel:function(o){var n;if(null===(n=e.onWheel)||void 0===n||n.call(e,o),P){const e=u.value;if(null!=e){if(0===o.deltaX){if(0===e.scrollTop&&o.deltaY<=0)return;if(e.scrollTop+e.offsetHeight>=e.scrollHeight&&o.deltaY>=0)return}o.preventDefault(),e.scrollTop+=o.deltaY/Qt(),e.scrollLeft+=o.deltaX/Qt(),A(),T=!0,Ko(()=>{T=!1})}}},handleItemResize:function(o,n){var r,a,l;if(t)return;if(e.ignoreItemResize)return;if(R(n.target))return;const{value:s}=f,d=i.value.get(o),c=s.get(d),p=null!==(l=null===(a=null===(r=n.borderBoxSize)||void 0===r?void 0:r[0])||void 0===a?void 0:a.blockSize)&&void 0!==l?l:n.contentRect.height;if(p===c)return;p-e.itemSize===0?h.delete(o):h.set(o,p-e.itemSize);const v=p-c;if(0===v)return;s.add(d,v);const g=u.value;if(null!=g){if(void 0===C){const e=s.sum(d);g.scrollTop>e&&g.scrollBy(0,v)}else(d<C||d===C&&p+s.sum(d)>g.scrollTop+g.offsetHeight)&&g.scrollBy(0,v);A()}m.value++}}},render(){const{itemResizable:e,keyField:o,keyToIndex:n,visibleItemsTag:t}=this;return u(Re,{onResize:this.handleListResize},{default:()=>{var a,l;return u("div",r(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[0!==this.items.length?u("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[u(t,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:t,renderItemWithCols:r}=this;return this.viewportItems.map(a=>{const l=a[o],i=n.get(l),s=null!=t?u(or,{index:i,item:a}):void 0,d=null!=r?u(or,{index:i,item:a}):void 0,c=this.$slots.default({item:a,renderedCols:s,renderedItemWithCols:d,index:i})[0];return e?u(Re,{key:l,onResize:e=>this.handleItemResize(l,e)},{default:()=>c}):(c.key=l,c)})}})]):null===(l=(a=this.$slots).empty)||void 0===l?void 0:l.call(a)])}})}}),rr="v-hidden",ar=Jo("[v-hidden]",{display:"none!important"}),lr=e({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:o}){const n=J(null),t=J(null);function r(r){const{value:a}=n,{getCounter:l,getTail:i}=e;let s;if(s=void 0!==l?l():t.value,!a||!s)return;s.hasAttribute(rr)&&s.removeAttribute(rr);const{children:d}=a;if(r.showAllItemsBeforeCalculate)for(const e of d)e.hasAttribute(rr)&&e.removeAttribute(rr);const c=a.offsetWidth,u=[],p=o.tail?null==i?void 0:i():null;let h=p?p.offsetWidth:0,f=!1;const m=a.children.length-(o.tail?1:0);for(let o=0;o<m-1;++o){if(o<0)continue;const n=d[o];if(f){n.hasAttribute(rr)||n.setAttribute(rr,"");continue}n.hasAttribute(rr)&&n.removeAttribute(rr);const t=n.offsetWidth;if(h+=t,u[o]=t,h>c){const{updateCounter:n}=e;for(let t=o;t>=0;--t){const r=m-1-t;void 0!==n?n(r):s.textContent=`${r}`;const a=s.offsetWidth;if(h-=u[t],h+a<=c||0===t){f=!0,o=t-1,p&&(-1===o?(p.style.maxWidth=c-a+"px",p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:n}=e;n&&n(r);break}}}}const{onUpdateOverflow:v}=e;f?void 0!==v&&v(!0):(void 0!==v&&v(!1),s.setAttribute(rr,""))}const a=Se();return ar.mount({id:"vueuc/overflow",head:!0,anchorMetaName:No,ssr:a}),b(()=>r({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:t,sync:r}},render(){const{$slots:e}=this;return i(()=>this.sync({showAllItemsBeforeCalculate:!1})),u("div",{class:"v-overflow",ref:"selfRef"},[V(e,"default"),e.counter?e.counter():u("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function ir(e,o){o&&(b(()=>{const{value:n}=e;n&&ye.registerHandler(n,o)}),C(e,(e,o)=>{o&&ye.unregisterHandler(o)},{deep:!1}),ee(()=>{const{value:o}=e;o&&ye.unregisterHandler(o)}))}function sr(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function dr(e){return o=>{e.value=o?o.$el:null}}function cr(e,o="default",n=[]){const t=e.$slots[o];return void 0===t?n:t()}function ur(e){const o=e.filter(e=>void 0!==e);if(0!==o.length)return 1===o.length?o[0]:o=>{e.forEach(e=>{e&&e(o)})}}function pr(e,o=[],n){const t={};return Object.getOwnPropertyNames(e).forEach(n=>{o.includes(n)||(t[n]=e[n])}),Object.assign(t,n)}var hr=e({name:"Add",render:()=>u("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}),fr=e({name:"Checkmark",render:()=>u("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},u("g",{fill:"none"},u("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}),mr=e({name:"ChevronDown",render:()=>u("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}),vr=e({name:"ChevronRight",render:()=>u("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u("path",{d:"M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",fill:"currentColor"}))}),gr=po("clear",()=>u("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},u("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},u("g",{fill:"currentColor","fill-rule":"nonzero"},u("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),br=e({name:"Empty",render:()=>u("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),u("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}),yr=e({name:"EyeOff",render:()=>u("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},u("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),u("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),u("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),u("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),u("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}),xr=e({name:"Remove",render:()=>u("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},u("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:"\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 32px;\n "}))}),Cr=to("base-clear","\n flex-shrink: 0;\n height: 1em;\n width: 1em;\n position: relative;\n",[lo(">",[Fo("clear","\n font-size: var(--n-clear-size);\n height: 1em;\n width: 1em;\n cursor: pointer;\n color: var(--n-clear-color);\n transition: color .3s var(--n-bezier);\n display: flex;\n ",[lo("&:hover","\n color: var(--n-clear-color-hover)!important;\n "),lo("&:active","\n color: var(--n-clear-color-pressed)!important;\n ")]),Fo("placeholder","\n display: flex;\n "),Fo("clear, placeholder","\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n ",[Te({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),wr=e({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup:e=>(ze("-base-clear",Cr,z(e,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}),render(){const{clsPrefix:e}=this;return u("div",{class:`${e}-base-clear`},u(ce,null,{default:()=>{var o,n;return this.show?u("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Do(this.$slots.icon,()=>[u(co,{clsPrefix:e},{default:()=>u(gr,null)})])):u("div",{key:"icon",class:`${e}-base-clear__placeholder`},null===(n=(o=this.$slots).placeholder)||void 0===n?void 0:n.call(o))}}))}}),Sr=e({props:{onFocus:Function,onBlur:Function},setup:e=>()=>u("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}),kr="#000",Pr="#fff",Ir="#fff",Tr="rgb(72, 72, 78)",Ar="rgb(24, 24, 28)",zr="rgb(44, 44, 50)",Rr="rgb(16, 16, 20)",Mr="0.9",Fr="0.82",Or="0.52",Br="0.38",$r="0.28",Er="0.52",Dr="0.38",_r="0.06",Lr="0.09",Hr="0.06",jr="0.05",Ur="0.05",Wr="0.18",Nr="0.2",Kr="0.12",Vr="0.24",qr="0.09",Gr="0.1",Jr="0.06",Yr="0.04",Zr="0.2",Xr="0.3",Qr="0.12",ea="0.2",oa="#7fe7c4",na="#63e2b7",ta="#5acea7",ra="rgb(42, 148, 125)",aa="#8acbec",la="#70c0e8",ia="#66afd3",sa="rgb(56, 137, 197)",da="#e98b8b",ca="#e88080",ua="#e57272",pa="rgb(208, 58, 82)",ha="#f5d599",fa="#f2c97d",ma="#e6c260",va="rgb(240, 138, 0)",ga="#7fe7c4",ba="#63e2b7",ya="#5acea7",xa="rgb(42, 148, 125)",Ca=Io(kr),wa=Io(Pr),Sa=`rgba(${wa.slice(0,3).join(", ")}, `;function ka(e){return`${Sa+String(e)})`}var Pa=Object.assign(Object.assign({name:"common"},be),{baseColor:kr,primaryColor:na,primaryColorHover:oa,primaryColorPressed:ta,primaryColorSuppl:ra,infoColor:la,infoColorHover:aa,infoColorPressed:ia,infoColorSuppl:sa,successColor:ba,successColorHover:ga,successColorPressed:ya,successColorSuppl:xa,warningColor:fa,warningColorHover:ha,warningColorPressed:ma,warningColorSuppl:va,errorColor:ca,errorColorHover:da,errorColorPressed:ua,errorColorSuppl:pa,textColorBase:Ir,textColor1:ka(Mr),textColor2:ka(Fr),textColor3:ka(Or),textColorDisabled:ka(Br),placeholderColor:ka(Br),placeholderColorDisabled:ka($r),iconColor:ka(Br),iconColorDisabled:ka($r),iconColorHover:ka(1.25*Number(Br)),iconColorPressed:ka(.8*Number(Br)),opacity1:Mr,opacity2:Fr,opacity3:Or,opacity4:Br,opacity5:$r,dividerColor:ka(qr),borderColor:ka(Vr),closeIconColorHover:ka(Number(Er)),closeIconColor:ka(Number(Er)),closeIconColorPressed:ka(Number(Er)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:ka(Br),clearColorHover:Xe(ka(Br),{alpha:1.25}),clearColorPressed:Xe(ka(Br),{alpha:.8}),scrollbarColor:ka(Zr),scrollbarColorHover:ka(Xr),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ka(Kr),railColor:ka(Nr),popoverColor:Tr,tableColor:Ar,cardColor:Ar,modalColor:zr,bodyColor:Rr,tagColor:function(e){const o=Array.from(wa);return o[3]=Number(e),yo(Ca,o)}(ea),avatarColor:ka(Wr),invertedColor:kr,inputColor:ka(Gr),codeColor:ka(Qr),tabColor:ka(Yr),actionColor:ka(Jr),tableHeaderColor:ka(Jr),hoverColor:ka(Lr),tableColorHover:ka(Hr),tableColorStriped:ka(jr),pressedColor:ka(Ur),opacityDisabled:Dr,inputColorDisabled:ka(_r),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),Ia={name:"Scrollbar",common:Pa,self:Oe};function Ta(e){return Array.isArray(e)?e:[e]}var Aa="STOP";function za(e,o){const n=o(e);void 0!==e.children&&n!==Aa&&e.children.forEach(e=>za(e,o))}function Ra(e){return e.children}function Ma(e){return e.key}function Fa(){return!1}function Oa(e){return!0===e.disabled}function Ba(e){var o;return null==e?[]:Array.isArray(e)?e:null!==(o=e.checkedKeys)&&void 0!==o?o:[]}function $a(e){var o;return null==e||Array.isArray(e)?[]:null!==(o=e.indeterminateKeys)&&void 0!==o?o:[]}function Ea(e,o){const n=new Set(e);return o.forEach(e=>{n.has(e)||n.add(e)}),Array.from(n)}function Da(e,o){const n=new Set(e);return o.forEach(e=>{n.has(e)&&n.delete(e)}),Array.from(n)}function _a(e){return"group"===(null==e?void 0:e.type)}var La=class extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}};function Ha(e,o,n,t){const r=Ua(o,n,t,!1),a=Ua(e,n,t,!0),l=function(e,o){const n=new Set;return e.forEach(e=>{const t=o.treeNodeMap.get(e);if(void 0!==t){let e=t.parent;for(;null!==e&&!e.disabled&&!n.has(e.key);)n.add(e.key),e=e.parent}}),n}(e,n),i=[];return r.forEach(e=>{(a.has(e)||l.has(e))&&i.push(e)}),i.forEach(e=>r.delete(e)),r}function ja(e,o){const{checkedKeys:n,keysToCheck:t,keysToUncheck:r,indeterminateKeys:a,cascade:l,leafOnly:i,checkStrategy:s,allowNotLoaded:d}=e;if(!l)return void 0!==t?{checkedKeys:Ea(n,t),indeterminateKeys:Array.from(a)}:void 0!==r?{checkedKeys:Da(n,r),indeterminateKeys:Array.from(a)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)};const{levelTreeNodeMap:c}=o;let u;u=void 0!==r?Ha(r,n,o,d):void 0!==t?function(e,o,n,t){return Ua(o.concat(e),n,t,!1)}(t,n,o,d):Ua(n,o,d,!1);const p="parent"===s,h="child"===s||i,f=u,m=new Set;for(let v=Math.max.apply(null,Array.from(c.keys()));v>=0;v-=1){const e=0===v,o=c.get(v);for(const n of o){if(n.isLeaf)continue;const{key:o,shallowLoaded:t}=n;if(h&&t&&n.children.forEach(e=>{!e.disabled&&!e.isLeaf&&e.shallowLoaded&&f.has(e.key)&&f.delete(e.key)}),n.disabled||!t)continue;let r=!0,a=!1,l=!0;for(const e of n.children){const o=e.key;if(!e.disabled)if(l&&(l=!1),f.has(o))a=!0;else{if(m.has(o)){a=!0,r=!1;break}if(r=!1,a)break}}r&&!l?(p&&n.children.forEach(e=>{!e.disabled&&f.has(e.key)&&f.delete(e.key)}),f.add(o)):a&&m.add(o),e&&h&&f.has(o)&&f.delete(o)}}return{checkedKeys:Array.from(f),indeterminateKeys:Array.from(m)}}function Ua(e,o,n,t){const{treeNodeMap:r,getChildren:a}=o,l=new Set,i=new Set(e);return e.forEach(e=>{const o=r.get(e);void 0!==o&&za(o,e=>{if(e.disabled)return Aa;const{key:o}=e;if(!l.has(o)&&(l.add(o),i.add(o),function(e,o){return!1===e.isLeaf&&!Array.isArray(o(e))}(e.rawNode,a))){if(t)return Aa;if(!n)throw new La}})}),i}function Wa(e,o){const n=e.siblings,t=n.length,{index:r}=e;return o?n[(r+1)%t]:r===n.length-1?null:n[r+1]}function Na(e,o,{loop:n=!1,includeDisabled:t=!1}={}){const r="prev"===o?Ka:Wa,a={reverse:"prev"===o};let l=!1,i=null;return function o(s){if(null!==s){if(s===e)if(l){if(!e.disabled&&!e.isGroup)return void(i=e)}else l=!0;else if((!s.disabled||t)&&!s.ignored&&!s.isGroup)return void(i=s);if(s.isGroup){const e=Va(s,a);null!==e?i=e:o(r(s,n))}else{const e=r(s,!1);if(null!==e)o(e);else{const e=function(e){return e.parent}(s);(null==e?void 0:e.isGroup)?o(r(e,n)):n&&o(r(s,!0))}}}}(e),i}function Ka(e,o){const n=e.siblings,t=n.length,{index:r}=e;return o?n[(r-1+t)%t]:0===r?null:n[r-1]}function Va(e,o={}){const{reverse:n=!1}=o,{children:t}=e;if(t){const{length:e}=t,r=n?-1:e,a=n?-1:1;for(let l=n?e-1:0;l!==r;l+=a){const e=t[l];if(!e.disabled&&!e.ignored){if(!e.isGroup)return e;{const n=Va(e,o);if(null!==n)return n}}}}return null}var qa={getChild(){return this.ignored?null:Va(this)},getParent(){const{parent:e}=this;return(null==e?void 0:e.isGroup)?e.getParent():e},getNext(e={}){return Na(this,"next",e)},getPrev(e={}){return Na(this,"prev",e)}};function Ga(e,o,n,t,r,a=null,l=0){const i=[];return e.forEach((s,d)=>{var c;const u=Object.create(t);if(u.rawNode=s,u.siblings=i,u.level=l,u.index=d,u.isFirstChild=0===d,u.isLastChild=d+1===e.length,u.parent=a,!u.ignored){const e=r(s);Array.isArray(e)&&(u.children=Ga(e,o,n,t,r,u,l+1))}i.push(u),o.set(u.key,u),n.has(l)||n.set(l,[]),null===(c=n.get(l))||void 0===c||c.push(u)}),i}function Ja(e,o={}){var n;const t=new Map,r=new Map,{getDisabled:a=Oa,getIgnored:l=Fa,getIsGroup:i=_a,getKey:s=Ma}=o,d=null!==(n=o.getChildren)&&void 0!==n?n:Ra,c=o.ignoreEmptyChildren?e=>{const o=d(e);return Array.isArray(o)?o.length?o:null:o}:d,u=Ga(e,t,r,Object.assign({get key(){return s(this.rawNode)},get disabled(){return a(this.rawNode)},get isGroup(){return i(this.rawNode)},get isLeaf(){return function(e,o){const{isLeaf:n}=e;return void 0!==n?n:!o(e)}(this.rawNode,c)},get shallowLoaded(){return function(e,o){const{isLeaf:n}=e;return!(!1===n&&!Array.isArray(o(e)))}(this.rawNode,c)},get ignored(){return l(this.rawNode)},contains(e){return function(e,o){const n=e.key;for(;o;){if(o.key===n)return!0;o=o.parent}return!1}(this,e)}},qa),c);function p(e){if(null==e)return null;const o=t.get(e);return o&&!o.ignored?o:null}const h={treeNodes:u,treeNodeMap:t,levelTreeNodeMap:r,maxLevel:Math.max(...r.keys()),getChildren:c,getFlattenedNodes:e=>function(e,o){const n=o?new Set(o):void 0,t=[];return function e(o){o.forEach(o=>{t.push(o),o.isLeaf||!o.children||o.ignored||(o.isGroup||void 0===n||n.has(o.key))&&e(o.children)})}(e),t}(u,e),getNode:function(e){if(null==e)return null;const o=t.get(e);return!o||o.isGroup||o.ignored?null:o},getPrev:function(e,o){const n=p(e);return n?n.getPrev(o):null},getNext:function(e,o){const n=p(e);return n?n.getNext(o):null},getParent:function(e){const o=p(e);return o?o.getParent():null},getChild:function(e){const o=p(e);return o?o.getChild():null},getFirstAvailableNode:()=>function(e){if(0===e.length)return null;const o=e[0];return o.isGroup||o.ignored||o.disabled?o.getNext():o}(u),getPath:(e,o={})=>function(e,{includeGroup:o=!1,includeSelf:n=!0},t){var r;const a=t.treeNodeMap;let l=null==e?null:null!==(r=a.get(e))&&void 0!==r?r:null;const i={keyPath:[],treeNodePath:[],treeNode:l};if(null==l?void 0:l.ignored)return i.treeNode=null,i;for(;l;)l.ignored||!o&&l.isGroup||i.treeNodePath.push(l),l=l.parent;return i.treeNodePath.reverse(),n||i.treeNodePath.pop(),i.keyPath=i.treeNodePath.map(e=>e.key),i}(e,o,h),getCheckedKeys(e,o={}){const{cascade:n=!0,leafOnly:t=!1,checkStrategy:r="all",allowNotLoaded:a=!1}=o;return ja({checkedKeys:Ba(e),indeterminateKeys:$a(e),cascade:n,leafOnly:t,checkStrategy:r,allowNotLoaded:a},h)},check(e,o,n={}){const{cascade:t=!0,leafOnly:r=!1,checkStrategy:a="all",allowNotLoaded:l=!1}=n;return ja({checkedKeys:Ba(o),indeterminateKeys:$a(o),keysToCheck:null==e?[]:Ta(e),cascade:t,leafOnly:r,checkStrategy:a,allowNotLoaded:l},h)},uncheck(e,o,n={}){const{cascade:t=!0,leafOnly:r=!1,checkStrategy:a="all",allowNotLoaded:l=!1}=n;return ja({checkedKeys:Ba(o),indeterminateKeys:$a(o),keysToUncheck:null==e?[]:Ta(e),cascade:t,leafOnly:r,checkStrategy:a,allowNotLoaded:l},h)},getNonLeafKeys:(e={})=>function(e,o={}){const{preserveGroup:n=!1}=o,t=[],r=n?e=>{e.isLeaf||(t.push(e.key),a(e.children))}:e=>{e.isLeaf||(e.isGroup||t.push(e.key),a(e.children))};function a(e){e.forEach(r)}return a(e),t}(u,e)};return h}var Ya={name:"Empty",common:Pa,self:Mo},Za=to("empty","\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: var(--n-font-size);\n",[Fo("icon","\n width: var(--n-icon-size);\n height: var(--n-icon-size);\n font-size: var(--n-icon-size);\n line-height: var(--n-icon-size);\n color: var(--n-icon-color);\n transition:\n color .3s var(--n-bezier);\n ",[lo("+",[Fo("description","\n margin-top: 8px;\n ")])]),Fo("description","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n "),Fo("extra","\n text-align: center;\n transition: color .3s var(--n-bezier);\n margin-top: 12px;\n color: var(--n-extra-text-color);\n ")]),Xa=e({name:"Empty",props:Object.assign(Object.assign({},Ie.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),slots:Object,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:n,mergedComponentPropsRef:t}=ro(e),r=Ie("Empty","-empty",Za,Ne,e,o),{localeRef:a}=we("Empty"),l=I(()=>{var o,n,r;return null!==(o=e.description)&&void 0!==o?o:null===(r=null===(n=null==t?void 0:t.value)||void 0===n?void 0:n.Empty)||void 0===r?void 0:r.description}),i=I(()=>{var e,o;return(null===(o=null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.Empty)||void 0===o?void 0:o.renderIcon)||(()=>u(br,null))}),s=I(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:{[Eo("iconSize",o)]:t,[Eo("fontSize",o)]:a,textColor:l,iconColor:i,extraTextColor:s}}=r.value;return{"--n-icon-size":t,"--n-font-size":a,"--n-bezier":n,"--n-text-color":l,"--n-icon-color":i,"--n-extra-text-color":s}}),d=n?io("empty",I(()=>{let o="";const{size:n}=e;return o+=n[0],o}),s,e):void 0;return{mergedClsPrefix:o,mergedRenderIcon:i,localizedDescription:I(()=>l.value||a.value.description),cssVars:n?void 0:s,themeClass:null==d?void 0:d.themeClass,onRender:null==d?void 0:d.onRender}},render(){const{$slots:e,mergedClsPrefix:o,onRender:n}=this;return null==n||n(),u("div",{class:[`${o}-empty`,this.themeClass],style:this.cssVars},this.showIcon?u("div",{class:`${o}-empty__icon`},e.icon?e.icon():u(co,{clsPrefix:o},{default:this.mergedRenderIcon})):null,this.showDescription?u("div",{class:`${o}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?u("div",{class:`${o}-empty__extra`},e.extra()):null)}}),Qa={name:"InternalSelectMenu",common:Pa,peers:{Scrollbar:Ia,Empty:Ya},self:Yo},el=e({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:o,labelFieldRef:n,nodePropsRef:t}=p(an);return{labelField:n,nodeProps:t,renderLabel:e,renderOption:o}},render(){const{clsPrefix:e,renderLabel:o,renderOption:n,nodeProps:t,tmNode:{rawNode:r}}=this,a=null==t?void 0:t(r),l=o?o(r,!1):Xo(r[this.labelField],r,!1),i=u("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,null==a?void 0:a.class]}),l);return r.render?r.render({node:i,option:r}):n?n({node:i,option:r,selected:!1}):i}});var ol=e({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:o,pendingTmNodeRef:n,multipleRef:t,valueSetRef:r,renderLabelRef:a,renderOptionRef:l,labelFieldRef:i,valueFieldRef:s,showCheckmarkRef:d,nodePropsRef:c,handleOptionClick:u,handleOptionMouseEnter:h}=p(an),f=de(()=>{const{value:o}=n;return!!o&&e.tmNode.key===o.key});return{multiple:t,isGrouped:de(()=>{const{tmNode:o}=e,{parent:n}=o;return n&&"group"===n.rawNode.type}),showCheckmark:d,nodeProps:c,isPending:f,isSelected:de(()=>{const{value:n}=o,{value:a}=t;if(null===n)return!1;const l=e.tmNode.rawNode[s.value];if(a){const{value:e}=r;return e.has(l)}return n===l}),labelField:i,renderLabel:a,renderOption:l,handleMouseMove:function(o){const{tmNode:n}=e,{value:t}=f;n.disabled||t||h(o,n)},handleMouseEnter:function(o){const{tmNode:n}=e;n.disabled||h(o,n)},handleClick:function(o){const{tmNode:n}=e;n.disabled||u(o,n)}}},render(){const{clsPrefix:e,tmNode:{rawNode:o},isSelected:n,isPending:t,isGrouped:r,showCheckmark:a,nodeProps:l,renderOption:i,renderLabel:s,handleClick:d,handleMouseEnter:c,handleMouseMove:p}=this,h=function(e,o){return u(L,{name:"fade-in-scale-up-transition"},{default:()=>e?u(co,{clsPrefix:o,class:`${o}-base-select-option__check`},{default:()=>u(fr)}):null})}(n,e),f=s?[s(o,n),a&&h]:[Xo(o[this.labelField],o,n),a&&h],m=null==l?void 0:l(o),v=u("div",Object.assign({},m,{class:[`${e}-base-select-option`,o.class,null==m?void 0:m.class,{[`${e}-base-select-option--disabled`]:o.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:r,[`${e}-base-select-option--pending`]:t,[`${e}-base-select-option--show-checkmark`]:a}],style:[(null==m?void 0:m.style)||"",o.style||""],onClick:ur([d,null==m?void 0:m.onClick]),onMouseenter:ur([c,null==m?void 0:m.onMouseenter]),onMousemove:ur([p,null==m?void 0:m.onMousemove])}),u("div",{class:`${e}-base-select-option__content`},f));return o.render?o.render({node:v,option:o,selected:n}):i?i({node:v,option:o,selected:n}):v}}),nl=to("base-select-menu","\n line-height: 1.5;\n outline: none;\n z-index: 0;\n position: relative;\n border-radius: var(--n-border-radius);\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n background-color: var(--n-color);\n",[to("scrollbar","\n max-height: var(--n-height);\n "),to("virtual-list","\n max-height: var(--n-height);\n "),to("base-select-option","\n min-height: var(--n-option-height);\n font-size: var(--n-option-font-size);\n display: flex;\n align-items: center;\n ",[Fo("content","\n z-index: 1;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n ")]),to("base-select-group-header","\n min-height: var(--n-option-height);\n font-size: .93em;\n display: flex;\n align-items: center;\n "),to("base-select-menu-option-wrapper","\n position: relative;\n width: 100%;\n "),Fo("loading, empty","\n display: flex;\n padding: 12px 32px;\n flex: 1;\n justify-content: center;\n "),Fo("loading","\n color: var(--n-loading-color);\n font-size: var(--n-loading-size);\n "),Fo("header","\n padding: 8px var(--n-option-padding-left);\n font-size: var(--n-option-font-size);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n border-bottom: 1px solid var(--n-action-divider-color);\n color: var(--n-action-text-color);\n "),Fo("action","\n padding: 8px var(--n-option-padding-left);\n font-size: var(--n-option-font-size);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n border-top: 1px solid var(--n-action-divider-color);\n color: var(--n-action-text-color);\n "),to("base-select-group-header","\n position: relative;\n cursor: default;\n padding: var(--n-option-padding);\n color: var(--n-group-header-text-color);\n "),to("base-select-option","\n cursor: pointer;\n position: relative;\n padding: var(--n-option-padding);\n transition:\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier);\n box-sizing: border-box;\n color: var(--n-option-text-color);\n opacity: 1;\n ",[Lo("show-checkmark","\n padding-right: calc(var(--n-option-padding-right) + 20px);\n "),lo("&::before",'\n content: "";\n position: absolute;\n left: 4px;\n right: 4px;\n top: 0;\n bottom: 0;\n border-radius: var(--n-border-radius);\n transition: background-color .3s var(--n-bezier);\n '),lo("&:active","\n color: var(--n-option-text-color-pressed);\n "),Lo("grouped","\n padding-left: calc(var(--n-option-padding-left) * 1.5);\n "),Lo("pending",[lo("&::before","\n background-color: var(--n-option-color-pending);\n ")]),Lo("selected","\n color: var(--n-option-text-color-active);\n ",[lo("&::before","\n background-color: var(--n-option-color-active);\n "),Lo("pending",[lo("&::before","\n background-color: var(--n-option-color-active-pending);\n ")])]),Lo("disabled","\n cursor: not-allowed;\n ",[Je("selected","\n color: var(--n-option-text-color-disabled);\n "),Lo("selected","\n opacity: var(--n-option-opacity-disabled);\n ")]),Fo("check","\n font-size: 16px;\n position: absolute;\n right: calc(var(--n-option-padding-right) - 4px);\n top: calc(50% - 7px);\n color: var(--n-option-check-color);\n transition: color .3s var(--n-bezier);\n ",[tn({enterScale:"0.5"})])])]),tl=e({name:"InternalSelectMenu",props:Object.assign(Object.assign({},Ie.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:n}=ro(e),t=Ce("InternalSelectMenu",n,o),r=Ie("InternalSelectMenu","-internal-select-menu",nl,nn,e,z(e,"clsPrefix")),l=J(null),s=J(null),d=J(null),c=I(()=>e.treeMate.getFlattenedNodes()),u=I(()=>function(e){const o=new Map;return e.forEach((e,n)=>{o.set(e.key,n)}),e=>{var n;return null!==(n=o.get(e))&&void 0!==n?n:null}}(c.value)),p=J(null);function h(){const{value:o}=p;o&&!e.treeMate.getNode(o.key)&&(p.value=null)}let f;C(()=>e.show,o=>{o?f=C(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?function(){const{treeMate:o}=e;let n=null;const{value:t}=e;null===t?n=o.getFirstAvailableNode():(n=e.multiple?o.getNode((t||[])[(t||[]).length-1]):o.getNode(t),n&&!n.disabled||(n=o.getFirstAvailableNode())),w(n||null)}():h(),i(S)):h()},{immediate:!0}):null==f||f()},{immediate:!0}),ee(()=>{null==f||f()});const m=I(()=>fo(r.value.self[Eo("optionHeight",e.size)])),v=I(()=>Qe(r.value.self[Eo("padding",e.size)])),g=I(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),y=I(()=>{const e=c.value;return e&&0===e.length});function x(o){const{onScroll:n}=e;n&&n(o)}function w(e,o=!1){p.value=e,o&&S()}function S(){var o,n;const t=p.value;if(!t)return;const r=u.value(t.key);null!==r&&(e.virtualScroll?null===(o=s.value)||void 0===o||o.scrollTo({index:r}):null===(n=d.value)||void 0===n||n.scrollTo({index:r,elSize:m.value}))}a(an,{handleOptionMouseEnter:function(e,o){o.disabled||w(o,!1)},handleOptionClick:function(o,n){n.disabled||function(o){const{onToggle:n}=e;n&&n(o)}(n)},valueSetRef:g,pendingTmNodeRef:p,nodePropsRef:z(e,"nodeProps"),showCheckmarkRef:z(e,"showCheckmark"),multipleRef:z(e,"multiple"),valueRef:z(e,"value"),renderLabelRef:z(e,"renderLabel"),renderOptionRef:z(e,"renderOption"),labelFieldRef:z(e,"labelField"),valueFieldRef:z(e,"valueField")}),a(jo,l),b(()=>{const{value:e}=d;e&&e.sync()});const k=I(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:{height:t,borderRadius:a,color:l,groupHeaderTextColor:i,actionDividerColor:s,optionTextColorPressed:d,optionTextColor:c,optionTextColorDisabled:u,optionTextColorActive:p,optionOpacityDisabled:h,optionCheckColor:f,actionTextColor:m,optionColorPending:v,optionColorActive:g,loadingColor:b,loadingSize:y,optionColorActivePending:x,[Eo("optionFontSize",o)]:C,[Eo("optionHeight",o)]:w,[Eo("optionPadding",o)]:S}}=r.value;return{"--n-height":t,"--n-action-divider-color":s,"--n-action-text-color":m,"--n-bezier":n,"--n-border-radius":a,"--n-color":l,"--n-option-font-size":C,"--n-group-header-text-color":i,"--n-option-check-color":f,"--n-option-color-pending":v,"--n-option-color-active":g,"--n-option-color-active-pending":x,"--n-option-height":w,"--n-option-opacity-disabled":h,"--n-option-text-color":c,"--n-option-text-color-active":p,"--n-option-text-color-disabled":u,"--n-option-text-color-pressed":d,"--n-option-padding":S,"--n-option-padding-left":Qe(S,"left"),"--n-option-padding-right":Qe(S,"right"),"--n-loading-color":b,"--n-loading-size":y}}),{inlineThemeDisabled:P}=e,T=P?io("internal-select-menu",I(()=>e.size[0]),k,e):void 0,A={selfRef:l,next:function(){const{value:e}=p;e&&w(e.getNext({loop:!0}),!0)},prev:function(){const{value:e}=p;e&&w(e.getPrev({loop:!0}),!0)},getPendingTmNode:function(){const{value:e}=p;return e||null}};return ir(l,e.onResize),Object.assign({mergedTheme:r,mergedClsPrefix:o,rtlEnabled:t,virtualListRef:s,scrollbarRef:d,itemSize:m,padding:v,flattenedNodes:c,empty:y,virtualListContainer(){const{value:e}=s;return null==e?void 0:e.listElRef},virtualListContent(){const{value:e}=s;return null==e?void 0:e.itemsElRef},doScroll:x,handleFocusin:function(o){var n,t;(null===(n=l.value)||void 0===n?void 0:n.contains(o.target))&&(null===(t=e.onFocus)||void 0===t||t.call(e,o))},handleFocusout:function(o){var n,t;(null===(n=l.value)||void 0===n?void 0:n.contains(o.relatedTarget))||null===(t=e.onBlur)||void 0===t||t.call(e,o)},handleKeyUp:function(o){var n;Vt(o,"action")||null===(n=e.onKeyup)||void 0===n||n.call(e,o)},handleKeyDown:function(o){var n;Vt(o,"action")||null===(n=e.onKeydown)||void 0===n||n.call(e,o)},handleMouseDown:function(o){var n;null===(n=e.onMousedown)||void 0===n||n.call(e,o),e.focusable||o.preventDefault()},handleVirtualListResize:function(){var e;null===(e=d.value)||void 0===e||e.sync()},handleVirtualListScroll:function(e){var o;null===(o=d.value)||void 0===o||o.sync(),x(e)},cssVars:P?void 0:k,themeClass:null==T?void 0:T.themeClass,onRender:null==T?void 0:T.onRender},A)},render(){const{$slots:e,virtualScroll:o,clsPrefix:n,mergedTheme:t,themeClass:r,onRender:a}=this;return null==a||a(),u("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,r,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},fe(e.header,e=>e&&u("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},e)),this.loading?u("div",{class:`${n}-base-select-menu__loading`},u(Ee,{clsPrefix:n,strokeWidth:20})):this.empty?u("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Do(e.empty,()=>[u(Xa,{theme:t.peers.Empty,themeOverrides:t.peerOverrides.Empty,size:this.size})])):u(_o,{ref:"scrollbarRef",theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,scrollable:this.scrollable,container:o?this.virtualListContainer:void 0,content:o?this.virtualListContent:void 0,onScroll:o?void 0:this.doScroll},{default:()=>o?u(tr,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:e})=>e.isGroup?u(el,{key:e.key,clsPrefix:n,tmNode:e}):e.ignored?null:u(ol,{clsPrefix:n,key:e.key,tmNode:e})}):u("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(e=>e.isGroup?u(el,{key:e.key,clsPrefix:n,tmNode:e}):u(ol,{clsPrefix:n,key:e.key,tmNode:e})))}),fe(e.action,e=>e&&[u("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},e),u(Sr,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),rl={name:"Popover",common:Pa,peers:{Scrollbar:Ia},self:dn},al={name:"Tag",common:Pa,self(e){const{textColor2:o,primaryColorHover:n,primaryColorPressed:t,primaryColor:r,infoColor:a,successColor:l,warningColor:i,errorColor:s,baseColor:d,borderColor:c,tagColor:u,opacityDisabled:p,closeIconColor:h,closeIconColorHover:f,closeIconColorPressed:m,closeColorHover:v,closeColorPressed:g,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:w,heightMini:S,heightTiny:k,heightSmall:P,heightMedium:I,buttonColor2Hover:T,buttonColor2Pressed:A,fontWeightStrong:z}=e;return Object.assign(Object.assign({},no),{closeBorderRadius:b,heightTiny:S,heightSmall:k,heightMedium:P,heightLarge:I,borderRadius:b,opacityDisabled:p,fontSizeTiny:y,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:w,fontWeightStrong:z,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:T,colorPressedCheckable:A,colorChecked:r,colorCheckedHover:n,colorCheckedPressed:t,border:`1px solid ${c}`,textColor:o,color:u,colorBordered:"#0000",closeIconColor:h,closeIconColorHover:f,closeIconColorPressed:m,closeColorHover:v,closeColorPressed:g,borderPrimary:`1px solid ${qe(r,{alpha:.3})}`,textColorPrimary:r,colorPrimary:qe(r,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:Xe(r,{lightness:.7}),closeIconColorHoverPrimary:Xe(r,{lightness:.7}),closeIconColorPressedPrimary:Xe(r,{lightness:.7}),closeColorHoverPrimary:qe(r,{alpha:.16}),closeColorPressedPrimary:qe(r,{alpha:.12}),borderInfo:`1px solid ${qe(a,{alpha:.3})}`,textColorInfo:a,colorInfo:qe(a,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:Xe(a,{alpha:.7}),closeIconColorHoverInfo:Xe(a,{alpha:.7}),closeIconColorPressedInfo:Xe(a,{alpha:.7}),closeColorHoverInfo:qe(a,{alpha:.16}),closeColorPressedInfo:qe(a,{alpha:.12}),borderSuccess:`1px solid ${qe(l,{alpha:.3})}`,textColorSuccess:l,colorSuccess:qe(l,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:Xe(l,{alpha:.7}),closeIconColorHoverSuccess:Xe(l,{alpha:.7}),closeIconColorPressedSuccess:Xe(l,{alpha:.7}),closeColorHoverSuccess:qe(l,{alpha:.16}),closeColorPressedSuccess:qe(l,{alpha:.12}),borderWarning:`1px solid ${qe(i,{alpha:.3})}`,textColorWarning:i,colorWarning:qe(i,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:Xe(i,{alpha:.7}),closeIconColorHoverWarning:Xe(i,{alpha:.7}),closeIconColorPressedWarning:Xe(i,{alpha:.7}),closeColorHoverWarning:qe(i,{alpha:.16}),closeColorPressedWarning:qe(i,{alpha:.11}),borderError:`1px solid ${qe(s,{alpha:.3})}`,textColorError:s,colorError:qe(s,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:Xe(s,{alpha:.7}),closeIconColorHoverError:Xe(s,{alpha:.7}),closeIconColorPressedError:Xe(s,{alpha:.7}),closeColorHoverError:qe(s,{alpha:.16}),closeColorPressedError:qe(s,{alpha:.12})})}},ll={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},il=to("tag","\n --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);\n white-space: nowrap;\n position: relative;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n padding: var(--n-padding);\n border-radius: var(--n-border-radius);\n color: var(--n-text-color);\n background-color: var(--n-color);\n transition: \n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n opacity .3s var(--n-bezier);\n line-height: 1;\n height: var(--n-height);\n font-size: var(--n-font-size);\n",[Lo("strong","\n font-weight: var(--n-font-weight-strong);\n "),Fo("border","\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border-radius: inherit;\n border: var(--n-border);\n transition: border-color .3s var(--n-bezier);\n "),Fo("icon","\n display: flex;\n margin: 0 4px 0 0;\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n font-size: var(--n-avatar-size-override);\n "),Fo("avatar","\n display: flex;\n margin: 0 6px 0 0;\n "),Fo("close","\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n "),Lo("round","\n padding: 0 calc(var(--n-height) / 3);\n border-radius: calc(var(--n-height) / 2);\n ",[Fo("icon","\n margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);\n "),Fo("avatar","\n margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);\n "),Lo("closable","\n padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);\n ")]),Lo("icon, avatar",[Lo("round","\n padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);\n ")]),Lo("disabled","\n cursor: not-allowed !important;\n opacity: var(--n-opacity-disabled);\n "),Lo("checkable","\n cursor: pointer;\n box-shadow: none;\n color: var(--n-text-color-checkable);\n background-color: var(--n-color-checkable);\n ",[Je("disabled",[lo("&:hover","background-color: var(--n-color-hover-checkable);",[Je("checked","color: var(--n-text-color-hover-checkable);")]),lo("&:active","background-color: var(--n-color-pressed-checkable);",[Je("checked","color: var(--n-text-color-pressed-checkable);")])]),Lo("checked","\n color: var(--n-text-color-checked);\n background-color: var(--n-color-checked);\n ",[Je("disabled",[lo("&:hover","background-color: var(--n-color-checked-hover);"),lo("&:active","background-color: var(--n-color-checked-pressed);")])])])]),sl=Object.assign(Object.assign(Object.assign({},Ie.props),ll),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),dl=Ue("n-tag"),cl=e({name:"Tag",props:sl,slots:Object,setup(e){const o=J(null),{mergedBorderedRef:n,mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:l}=ro(e),i=Ie("Tag","-tag",il,ao,e,t);a(dl,{roundRef:z(e,"round")});const s={setTextContent(e){const{value:n}=o;n&&(n.textContent=e)}},d=Ce("Tag",l,t),c=I(()=>{const{type:o,size:t,color:{color:r,textColor:a}={}}=e,{common:{cubicBezierEaseInOut:l},self:{padding:s,closeMargin:d,borderRadius:c,opacityDisabled:u,textColorCheckable:p,textColorHoverCheckable:h,textColorPressedCheckable:f,textColorChecked:m,colorCheckable:v,colorHoverCheckable:g,colorPressedCheckable:b,colorChecked:y,colorCheckedHover:x,colorCheckedPressed:C,closeBorderRadius:w,fontWeightStrong:S,[Eo("colorBordered",o)]:k,[Eo("closeSize",t)]:P,[Eo("closeIconSize",t)]:I,[Eo("fontSize",t)]:T,[Eo("height",t)]:A,[Eo("color",o)]:z,[Eo("textColor",o)]:R,[Eo("border",o)]:M,[Eo("closeIconColor",o)]:F,[Eo("closeIconColorHover",o)]:O,[Eo("closeIconColorPressed",o)]:B,[Eo("closeColorHover",o)]:$,[Eo("closeColorPressed",o)]:E}}=i.value,D=Qe(d);return{"--n-font-weight-strong":S,"--n-avatar-size-override":`calc(${A} - 8px)`,"--n-bezier":l,"--n-border-radius":c,"--n-border":M,"--n-close-icon-size":I,"--n-close-color-pressed":E,"--n-close-color-hover":$,"--n-close-border-radius":w,"--n-close-icon-color":F,"--n-close-icon-color-hover":O,"--n-close-icon-color-pressed":B,"--n-close-icon-color-disabled":F,"--n-close-margin-top":D.top,"--n-close-margin-right":D.right,"--n-close-margin-bottom":D.bottom,"--n-close-margin-left":D.left,"--n-close-size":P,"--n-color":r||(n.value?k:z),"--n-color-checkable":v,"--n-color-checked":y,"--n-color-checked-hover":x,"--n-color-checked-pressed":C,"--n-color-hover-checkable":g,"--n-color-pressed-checkable":b,"--n-font-size":T,"--n-height":A,"--n-opacity-disabled":u,"--n-padding":s,"--n-text-color":a||R,"--n-text-color-checkable":p,"--n-text-color-checked":m,"--n-text-color-hover-checkable":h,"--n-text-color-pressed-checkable":f}}),u=r?io("tag",I(()=>{let o="";const{type:t,size:r,color:{color:a,textColor:l}={}}=e;return o+=t[0],o+=r[0],a&&(o+=`a${Pe(a)}`),l&&(o+=`b${Pe(l)}`),n.value&&(o+="c"),o}),c,e):void 0;return Object.assign(Object.assign({},s),{rtlEnabled:d,mergedClsPrefix:t,contentRef:o,mergedBordered:n,handleClick:function(){if(!e.disabled&&e.checkable){const{checked:o,onCheckedChange:n,onUpdateChecked:t,"onUpdate:checked":r}=e;t&&t(!o),r&&r(!o),n&&n(!o)}},handleCloseClick:function(o){if(e.triggerClickOnClose||o.stopPropagation(),!e.disabled){const{onClose:n}=e;n&&_e(n,o)}},cssVars:r?void 0:c,themeClass:null==u?void 0:u.themeClass,onRender:null==u?void 0:u.onRender})},render(){var e,o;const{mergedClsPrefix:n,rtlEnabled:t,closable:r,color:{borderColor:a}={},round:l,onRender:i,$slots:s}=this;null==i||i();const d=fe(s.avatar,e=>e&&u("div",{class:`${n}-tag__avatar`},e)),c=fe(s.icon,e=>e&&u("div",{class:`${n}-tag__icon`},e));return u("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:t,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:l,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:c,[`${n}-tag--closable`]:r}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},c||d,u("span",{class:`${n}-tag__content`,ref:"contentRef"},null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)),!this.checkable&&r?u(me,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:l,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?u("div",{class:`${n}-tag__border`,style:{borderColor:a}}):null)}}),ul=e({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup:(e,{slots:o})=>()=>{const{clsPrefix:n}=e;return u(Ee,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?u(wr,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>u(co,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Do(o.default,()=>[u(mr,null)])})}):null})}}),pl={name:"InternalSelection",common:Pa,peers:{Popover:rl},self(e){const{borderRadius:o,textColor2:n,textColorDisabled:t,inputColor:r,inputColorDisabled:a,primaryColor:l,primaryColorHover:i,warningColor:s,warningColorHover:d,errorColor:c,errorColorHover:u,iconColor:p,iconColorDisabled:h,clearColor:f,clearColorHover:m,clearColorPressed:v,placeholderColor:g,placeholderColorDisabled:b,fontSizeTiny:y,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:w,heightTiny:S,heightSmall:k,heightMedium:P,heightLarge:I,fontWeight:T}=e;return Object.assign(Object.assign({},sn),{fontWeight:T,fontSizeTiny:y,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:w,heightTiny:S,heightSmall:k,heightMedium:P,heightLarge:I,borderRadius:o,textColor:n,textColorDisabled:t,placeholderColor:g,placeholderColorDisabled:b,color:r,colorDisabled:a,colorActive:qe(l,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${i}`,borderActive:`1px solid ${l}`,borderFocus:`1px solid ${i}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${qe(l,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${qe(l,{alpha:.4})}`,caretColor:l,arrowColor:p,arrowColorDisabled:h,loadingColor:l,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${qe(s,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${qe(s,{alpha:.4})}`,colorActiveWarning:qe(s,{alpha:.1}),caretColorWarning:s,borderError:`1px solid ${c}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${c}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${qe(c,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${qe(c,{alpha:.4})}`,colorActiveError:qe(c,{alpha:.1}),caretColorError:c,clearColor:f,clearColorHover:m,clearColorPressed:v})}},hl=lo([to("base-selection","\n --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);\n --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);\n position: relative;\n z-index: auto;\n box-shadow: none;\n width: 100%;\n max-width: 100%;\n display: inline-block;\n vertical-align: bottom;\n border-radius: var(--n-border-radius);\n min-height: var(--n-height);\n line-height: 1.5;\n font-size: var(--n-font-size);\n ",[to("base-loading","\n color: var(--n-loading-color);\n "),to("base-selection-tags","min-height: var(--n-height);"),Fo("border, state-border","\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n border: var(--n-border);\n border-radius: inherit;\n transition:\n box-shadow .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n "),Fo("state-border","\n z-index: 1;\n border-color: #0000;\n "),to("base-suffix","\n cursor: pointer;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 10px;\n ",[Fo("arrow","\n font-size: var(--n-arrow-size);\n color: var(--n-arrow-color);\n transition: color .3s var(--n-bezier);\n ")]),to("base-selection-overlay","\n display: flex;\n align-items: center;\n white-space: nowrap;\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n padding: var(--n-padding-single);\n transition: color .3s var(--n-bezier);\n ",[Fo("wrapper","\n flex-basis: 0;\n flex-grow: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n ")]),to("base-selection-placeholder","\n color: var(--n-placeholder-color);\n ",[Fo("inner","\n max-width: 100%;\n overflow: hidden;\n ")]),to("base-selection-tags","\n cursor: pointer;\n outline: none;\n box-sizing: border-box;\n position: relative;\n z-index: auto;\n display: flex;\n padding: var(--n-padding-multiple);\n flex-wrap: wrap;\n align-items: center;\n width: 100%;\n vertical-align: bottom;\n background-color: var(--n-color);\n border-radius: inherit;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n "),to("base-selection-label","\n height: var(--n-height);\n display: inline-flex;\n width: 100%;\n vertical-align: bottom;\n cursor: pointer;\n outline: none;\n z-index: auto;\n box-sizing: border-box;\n position: relative;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n border-radius: inherit;\n background-color: var(--n-color);\n align-items: center;\n ",[to("base-selection-input","\n font-size: inherit;\n line-height: inherit;\n outline: none;\n cursor: pointer;\n box-sizing: border-box;\n border:none;\n width: 100%;\n padding: var(--n-padding-single);\n background-color: #0000;\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n caret-color: var(--n-caret-color);\n ",[Fo("content","\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap; \n ")]),Fo("render-label","\n color: var(--n-text-color);\n ")]),Je("disabled",[lo("&:hover",[Fo("state-border","\n box-shadow: var(--n-box-shadow-hover);\n border: var(--n-border-hover);\n ")]),Lo("focus",[Fo("state-border","\n box-shadow: var(--n-box-shadow-focus);\n border: var(--n-border-focus);\n ")]),Lo("active",[Fo("state-border","\n box-shadow: var(--n-box-shadow-active);\n border: var(--n-border-active);\n "),to("base-selection-label","background-color: var(--n-color-active);"),to("base-selection-tags","background-color: var(--n-color-active);")])]),Lo("disabled","cursor: not-allowed;",[Fo("arrow","\n color: var(--n-arrow-color-disabled);\n "),to("base-selection-label","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n ",[to("base-selection-input","\n cursor: not-allowed;\n color: var(--n-text-color-disabled);\n "),Fo("render-label","\n color: var(--n-text-color-disabled);\n ")]),to("base-selection-tags","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n "),to("base-selection-placeholder","\n cursor: not-allowed;\n color: var(--n-placeholder-color-disabled);\n ")]),to("base-selection-input-tag","\n height: calc(var(--n-height) - 6px);\n line-height: calc(var(--n-height) - 6px);\n outline: none;\n display: none;\n position: relative;\n margin-bottom: 3px;\n max-width: 100%;\n vertical-align: bottom;\n ",[Fo("input","\n font-size: inherit;\n font-family: inherit;\n min-width: 1px;\n padding: 0;\n background-color: #0000;\n outline: none;\n border: none;\n max-width: 100%;\n overflow: hidden;\n width: 1em;\n line-height: inherit;\n cursor: pointer;\n color: var(--n-text-color);\n caret-color: var(--n-caret-color);\n "),Fo("mirror","\n position: absolute;\n left: 0;\n top: 0;\n white-space: pre;\n visibility: hidden;\n user-select: none;\n -webkit-user-select: none;\n opacity: 0;\n ")]),["warning","error"].map(e=>Lo(`${e}-status`,[Fo("state-border",`border: var(--n-border-${e});`),Je("disabled",[lo("&:hover",[Fo("state-border",`\n box-shadow: var(--n-box-shadow-hover-${e});\n border: var(--n-border-hover-${e});\n `)]),Lo("active",[Fo("state-border",`\n box-shadow: var(--n-box-shadow-active-${e});\n border: var(--n-border-active-${e});\n `),to("base-selection-label",`background-color: var(--n-color-active-${e});`),to("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),Lo("focus",[Fo("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)])])]))]),to("base-selection-popover","\n margin-bottom: -3px;\n display: flex;\n flex-wrap: wrap;\n margin-right: -8px;\n "),to("base-selection-tag-wrapper","\n max-width: 100%;\n display: inline-flex;\n padding: 0 7px 3px 0;\n ",[lo("&:last-child","padding-right: 0;"),to("tag","\n font-size: 14px;\n max-width: 100%;\n ",[Fo("content","\n line-height: 1.25;\n text-overflow: ellipsis;\n overflow: hidden;\n ")])])]),fl=e({name:"InternalSelection",props:Object.assign(Object.assign({},Ie.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:n}=ro(e),t=Ce("InternalSelection",n,o),r=J(null),a=J(null),l=J(null),s=J(null),d=J(null),c=J(null),u=J(null),p=J(null),h=J(null),m=J(null),v=J(!1),g=J(!1),y=J(!1),x=Ie("InternalSelection","-internal-selection",hl,Qo,e,z(e,"clsPrefix")),w=I(()=>e.clearable&&!e.disabled&&(y.value||e.active)),S=I(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Xo(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),k=I(()=>{const o=e.selectedOption;if(o)return o[e.labelField]}),P=I(()=>e.multiple?!(!Array.isArray(e.selectedOptions)||!e.selectedOptions.length):null!==e.selectedOption);function T(){var o;const{value:n}=r;if(n){const{value:t}=a;t&&(t.style.width=`${n.offsetWidth}px`,"responsive"!==e.maxTagCount&&(null===(o=h.value)||void 0===o||o.sync({showAllItemsBeforeCalculate:!1})))}}function A(o){const{onPatternInput:n}=e;n&&n(o)}function R(o){!function(o){const{onDeleteOption:n}=e;n&&n(o)}(o)}C(z(e,"active"),e=>{e||function(){const{value:e}=m;e&&(e.style.display="none")}()}),C(z(e,"pattern"),()=>{e.multiple&&i(T)});const M=J(!1);let F=null;let O=null;function B(){null!==O&&window.clearTimeout(O)}C(P,e=>{e||(v.value=!1)}),b(()=>{f(()=>{const o=c.value;o&&(e.disabled?o.removeAttribute("tabindex"):o.tabIndex=g.value?-1:0)})}),ir(l,e.onResize);const{inlineThemeDisabled:$}=e,E=I(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:{fontWeight:t,borderRadius:r,color:a,placeholderColor:l,textColor:i,paddingSingle:s,paddingMultiple:d,caretColor:c,colorDisabled:u,textColorDisabled:p,placeholderColorDisabled:h,colorActive:f,boxShadowFocus:m,boxShadowActive:v,boxShadowHover:g,border:b,borderFocus:y,borderHover:C,borderActive:w,arrowColor:S,arrowColorDisabled:k,loadingColor:P,colorActiveWarning:I,boxShadowFocusWarning:T,boxShadowActiveWarning:A,boxShadowHoverWarning:z,borderWarning:R,borderFocusWarning:M,borderHoverWarning:F,borderActiveWarning:O,colorActiveError:B,boxShadowFocusError:$,boxShadowActiveError:E,boxShadowHoverError:D,borderError:_,borderFocusError:L,borderHoverError:H,borderActiveError:j,clearColor:U,clearColorHover:W,clearColorPressed:N,clearSize:K,arrowSize:V,[Eo("height",o)]:q,[Eo("fontSize",o)]:G}}=x.value,J=Qe(s),Y=Qe(d);return{"--n-bezier":n,"--n-border":b,"--n-border-active":w,"--n-border-focus":y,"--n-border-hover":C,"--n-border-radius":r,"--n-box-shadow-active":v,"--n-box-shadow-focus":m,"--n-box-shadow-hover":g,"--n-caret-color":c,"--n-color":a,"--n-color-active":f,"--n-color-disabled":u,"--n-font-size":G,"--n-height":q,"--n-padding-single-top":J.top,"--n-padding-multiple-top":Y.top,"--n-padding-single-right":J.right,"--n-padding-multiple-right":Y.right,"--n-padding-single-left":J.left,"--n-padding-multiple-left":Y.left,"--n-padding-single-bottom":J.bottom,"--n-padding-multiple-bottom":Y.bottom,"--n-placeholder-color":l,"--n-placeholder-color-disabled":h,"--n-text-color":i,"--n-text-color-disabled":p,"--n-arrow-color":S,"--n-arrow-color-disabled":k,"--n-loading-color":P,"--n-color-active-warning":I,"--n-box-shadow-focus-warning":T,"--n-box-shadow-active-warning":A,"--n-box-shadow-hover-warning":z,"--n-border-warning":R,"--n-border-focus-warning":M,"--n-border-hover-warning":F,"--n-border-active-warning":O,"--n-color-active-error":B,"--n-box-shadow-focus-error":$,"--n-box-shadow-active-error":E,"--n-box-shadow-hover-error":D,"--n-border-error":_,"--n-border-focus-error":L,"--n-border-hover-error":H,"--n-border-active-error":j,"--n-clear-size":K,"--n-clear-color":U,"--n-clear-color-hover":W,"--n-clear-color-pressed":N,"--n-arrow-size":V,"--n-font-weight":t}}),D=$?io("internal-selection",I(()=>e.size[0]),E,e):void 0;return{mergedTheme:x,mergedClearable:w,mergedClsPrefix:o,rtlEnabled:t,patternInputFocused:g,filterablePlaceholder:S,label:k,selected:P,showTagsPanel:v,isComposing:M,counterRef:u,counterWrapperRef:p,patternInputMirrorRef:r,patternInputRef:a,selfRef:l,multipleElRef:s,singleElRef:d,patternInputWrapperRef:c,overflowRef:h,inputTagElRef:m,handleMouseDown:function(o){e.active&&e.filterable&&o.target!==a.value&&o.preventDefault()},handleFocusin:function(o){var n;o.relatedTarget&&(null===(n=l.value)||void 0===n?void 0:n.contains(o.relatedTarget))||function(o){const{onFocus:n}=e;n&&n(o)}(o)},handleClear:function(o){!function(o){const{onClear:n}=e;n&&n(o)}(o)},handleMouseEnter:function(){y.value=!0},handleMouseLeave:function(){y.value=!1},handleDeleteOption:R,handlePatternKeyDown:function(o){if("Backspace"===o.key&&!M.value&&!e.pattern.length){const{selectedOptions:o}=e;(null==o?void 0:o.length)&&R(o[o.length-1])}},handlePatternInputInput:function(o){const{value:n}=r;n&&(n.textContent=o.target.value,T()),e.ignoreComposition&&M.value?F=o:A(o)},handlePatternInputBlur:function(o){var n;g.value=!1,null===(n=e.onPatternBlur)||void 0===n||n.call(e,o)},handlePatternInputFocus:function(o){var n;g.value=!0,null===(n=e.onPatternFocus)||void 0===n||n.call(e,o)},handleMouseEnterCounter:function(){e.active||(B(),O=window.setTimeout(()=>{P.value&&(v.value=!0)},100))},handleMouseLeaveCounter:function(){B()},handleFocusout:function(o){var n;(null===(n=l.value)||void 0===n?void 0:n.contains(o.relatedTarget))||function(o){const{onBlur:n}=e;n&&n(o)}(o)},handleCompositionEnd:function(){M.value=!1,e.ignoreComposition&&A(F),F=null},handleCompositionStart:function(){M.value=!0},onPopoverUpdateShow:function(e){e||(B(),v.value=!1)},focus:function(){var o,n,t;e.filterable?(g.value=!1,null===(o=c.value)||void 0===o||o.focus()):e.multiple?null===(n=s.value)||void 0===n||n.focus():null===(t=d.value)||void 0===t||t.focus()},focusInput:function(){const{value:e}=a;e&&(!function(){const{value:e}=m;e&&(e.style.display="inline-block")}(),e.focus())},blur:function(){var o,n;if(e.filterable)g.value=!1,null===(o=c.value)||void 0===o||o.blur(),null===(n=a.value)||void 0===n||n.blur();else if(e.multiple){const{value:e}=s;null==e||e.blur()}else{const{value:e}=d;null==e||e.blur()}},blurInput:function(){const{value:e}=a;e&&e.blur()},updateCounter:function(e){const{value:o}=u;o&&o.setTextContent(`+${e}`)},getCounter:function(){const{value:e}=p;return e},getTail:function(){return a.value},renderLabel:e.renderLabel,cssVars:$?void 0:E,themeClass:null==D?void 0:D.themeClass,onRender:null==D?void 0:D.onRender}},render(){const{status:e,multiple:o,size:n,disabled:t,filterable:r,maxTagCount:a,bordered:l,clsPrefix:i,ellipsisTagPopoverProps:s,onRender:d,renderTag:c,renderLabel:p}=this;null==d||d();const h="responsive"===a,f="number"==typeof a,m=h||f,v=u(Oo,null,{default:()=>u(ul,{clsPrefix:i,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var e,o;return null===(o=(e=this.$slots).arrow)||void 0===o?void 0:o.call(e)}})});let g;if(o){const{labelField:e}=this,o=o=>u("div",{class:`${i}-base-selection-tag-wrapper`,key:o.value},c?c({option:o,handleClose:()=>{this.handleDeleteOption(o)}}):u(cl,{size:n,closable:!o.disabled,disabled:t,onClose:()=>{this.handleDeleteOption(o)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>p?p(o,!0):Xo(o[e],o,!0)})),l=()=>(f?this.selectedOptions.slice(0,a):this.selectedOptions).map(o),d=r?u("div",{class:`${i}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},u("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:t,value:this.pattern,autofocus:this.autofocus,class:`${i}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),u("span",{ref:"patternInputMirrorRef",class:`${i}-base-selection-input-tag__mirror`},this.pattern)):null,b=h?()=>u("div",{class:`${i}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},u(cl,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:t})):void 0;let y;if(f){const e=this.selectedOptions.length-a;e>0&&(y=u("div",{class:`${i}-base-selection-tag-wrapper`,key:"__counter__"},u(cl,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:t},{default:()=>`+${e}`})))}const x=h?r?u(lr,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:l,counter:b,tail:()=>d}):u(lr,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:l,counter:b}):f&&y?l().concat(y):l(),C=m?()=>u("div",{class:`${i}-base-selection-popover`},h?l():this.selectedOptions.map(o)):void 0,w=m?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},s):null,S=this.selected||this.active&&(this.pattern||this.isComposing)?null:u("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`},u("div",{class:`${i}-base-selection-placeholder__inner`},this.placeholder)),k=r?u("div",{ref:"patternInputWrapperRef",class:`${i}-base-selection-tags`},x,h?null:d,v):u("div",{ref:"multipleElRef",class:`${i}-base-selection-tags`,tabindex:t?void 0:0},x,v);g=u(F,null,m?u(vn,Object.assign({},w,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>k,default:C}):k,S)}else if(r){const e=this.pattern||this.isComposing,o=this.active?!e:!this.selected,n=!this.active&&this.selected;g=u("div",{ref:"patternInputWrapperRef",class:`${i}-base-selection-label`,title:this.patternInputFocused?void 0:sr(this.label)},u("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${i}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:t,disabled:t,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),n?u("div",{class:`${i}-base-selection-label__render-label ${i}-base-selection-overlay`,key:"input"},u("div",{class:`${i}-base-selection-overlay__wrapper`},c?c({option:this.selectedOption,handleClose:()=>{}}):p?p(this.selectedOption,!0):Xo(this.label,this.selectedOption,!0))):null,o?u("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`,key:"placeholder"},u("div",{class:`${i}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,v)}else g=u("div",{ref:"singleElRef",class:`${i}-base-selection-label`,tabindex:this.disabled?void 0:0},void 0!==this.label?u("div",{class:`${i}-base-selection-input`,title:sr(this.label),key:"input"},u("div",{class:`${i}-base-selection-input__content`},c?c({option:this.selectedOption,handleClose:()=>{}}):p?p(this.selectedOption,!0):Xo(this.label,this.selectedOption,!0))):u("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`,key:"placeholder"},u("div",{class:`${i}-base-selection-placeholder__inner`},this.placeholder)),v);return u("div",{ref:"selfRef",class:[`${i}-base-selection`,this.rtlEnabled&&`${i}-base-selection--rtl`,this.themeClass,e&&`${i}-base-selection--${e}-status`,{[`${i}-base-selection--active`]:this.active,[`${i}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${i}-base-selection--disabled`]:this.disabled,[`${i}-base-selection--multiple`]:this.multiple,[`${i}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},g,l?u("div",{class:`${i}-base-selection__border`}):null,l?u("div",{class:`${i}-base-selection__state-border`}):null)}}),ml={iconMargin:"11px 8px 0 12px",iconMarginRtl:"11px 12px 0 8px",iconSize:"24px",closeIconSize:"16px",closeSize:"20px",closeMargin:"13px 14px 0 0",closeMarginRtl:"13px 0 0 14px",padding:"13px"},vl={name:"Alert",common:Pa,self(e){const{lineHeight:o,borderRadius:n,fontWeightStrong:t,dividerColor:r,inputColor:a,textColor1:l,textColor2:i,closeColorHover:s,closeColorPressed:d,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:p,infoColorSuppl:h,successColorSuppl:f,warningColorSuppl:m,errorColorSuppl:v,fontSize:g}=e;return Object.assign(Object.assign({},ml),{fontSize:g,lineHeight:o,titleFontWeight:t,borderRadius:n,border:`1px solid ${r}`,color:a,titleTextColor:l,iconColor:i,contentTextColor:i,closeBorderRadius:n,closeColorHover:s,closeColorPressed:d,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:p,borderInfo:`1px solid ${qe(h,{alpha:.35})}`,colorInfo:qe(h,{alpha:.25}),titleTextColorInfo:l,iconColorInfo:h,contentTextColorInfo:i,closeColorHoverInfo:s,closeColorPressedInfo:d,closeIconColorInfo:c,closeIconColorHoverInfo:u,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${qe(f,{alpha:.35})}`,colorSuccess:qe(f,{alpha:.25}),titleTextColorSuccess:l,iconColorSuccess:f,contentTextColorSuccess:i,closeColorHoverSuccess:s,closeColorPressedSuccess:d,closeIconColorSuccess:c,closeIconColorHoverSuccess:u,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${qe(m,{alpha:.35})}`,colorWarning:qe(m,{alpha:.25}),titleTextColorWarning:l,iconColorWarning:m,contentTextColorWarning:i,closeColorHoverWarning:s,closeColorPressedWarning:d,closeIconColorWarning:c,closeIconColorHoverWarning:u,closeIconColorPressedWarning:p,borderError:`1px solid ${qe(v,{alpha:.35})}`,colorError:qe(v,{alpha:.25}),titleTextColorError:l,iconColorError:v,contentTextColorError:i,closeColorHoverError:s,closeColorPressedError:d,closeIconColorError:c,closeIconColorHoverError:u,closeIconColorPressedError:p})}};var gl={name:"Alert",common:pe,self:function(e){const{lineHeight:o,borderRadius:n,fontWeightStrong:t,baseColor:r,dividerColor:a,actionColor:l,textColor1:i,textColor2:s,closeColorHover:d,closeColorPressed:c,closeIconColor:u,closeIconColorHover:p,closeIconColorPressed:h,infoColor:f,successColor:m,warningColor:v,errorColor:g,fontSize:b}=e;return Object.assign(Object.assign({},ml),{fontSize:b,lineHeight:o,titleFontWeight:t,borderRadius:n,border:`1px solid ${a}`,color:l,titleTextColor:i,iconColor:s,contentTextColor:s,closeBorderRadius:n,closeColorHover:d,closeColorPressed:c,closeIconColor:u,closeIconColorHover:p,closeIconColorPressed:h,borderInfo:`1px solid ${yo(r,qe(f,{alpha:.25}))}`,colorInfo:yo(r,qe(f,{alpha:.08})),titleTextColorInfo:i,iconColorInfo:f,contentTextColorInfo:s,closeColorHoverInfo:d,closeColorPressedInfo:c,closeIconColorInfo:u,closeIconColorHoverInfo:p,closeIconColorPressedInfo:h,borderSuccess:`1px solid ${yo(r,qe(m,{alpha:.25}))}`,colorSuccess:yo(r,qe(m,{alpha:.08})),titleTextColorSuccess:i,iconColorSuccess:m,contentTextColorSuccess:s,closeColorHoverSuccess:d,closeColorPressedSuccess:c,closeIconColorSuccess:u,closeIconColorHoverSuccess:p,closeIconColorPressedSuccess:h,borderWarning:`1px solid ${yo(r,qe(v,{alpha:.33}))}`,colorWarning:yo(r,qe(v,{alpha:.08})),titleTextColorWarning:i,iconColorWarning:v,contentTextColorWarning:s,closeColorHoverWarning:d,closeColorPressedWarning:c,closeIconColorWarning:u,closeIconColorHoverWarning:p,closeIconColorPressedWarning:h,borderError:`1px solid ${yo(r,qe(g,{alpha:.25}))}`,colorError:yo(r,qe(g,{alpha:.08})),titleTextColorError:i,iconColorError:g,contentTextColorError:s,closeColorHoverError:d,closeColorPressedError:c,closeIconColorError:u,closeIconColorHoverError:p,closeIconColorPressedError:h})}},{cubicBezierEaseInOut:bl,cubicBezierEaseOut:yl,cubicBezierEaseIn:xl}=be;function Cl({overflow:e="hidden",duration:o=".3s",originalTransition:n="",leavingDelay:t="0s",foldPadding:r=!1,enterToProps:a,leaveToProps:l,reverse:i=!1}={}){const s=i?"leave":"enter",d=i?"enter":"leave";return[lo(`&.fade-in-height-expand-transition-${d}-from,\n &.fade-in-height-expand-transition-${s}-to`,Object.assign(Object.assign({},a),{opacity:1})),lo(`&.fade-in-height-expand-transition-${d}-to,\n &.fade-in-height-expand-transition-${s}-from`,Object.assign(Object.assign({},l),{opacity:0,marginTop:"0 !important",marginBottom:"0 !important",paddingTop:r?"0 !important":void 0,paddingBottom:r?"0 !important":void 0})),lo(`&.fade-in-height-expand-transition-${d}-active`,`\n overflow: ${e};\n transition:\n max-height ${o} ${bl} ${t},\n opacity ${o} ${yl} ${t},\n margin-top ${o} ${bl} ${t},\n margin-bottom ${o} ${bl} ${t},\n padding-top ${o} ${bl} ${t},\n padding-bottom ${o} ${bl} ${t}\n ${n?`,${n}`:""}\n `),lo(`&.fade-in-height-expand-transition-${s}-active`,`\n overflow: ${e};\n transition:\n max-height ${o} ${bl},\n opacity ${o} ${xl},\n margin-top ${o} ${bl},\n margin-bottom ${o} ${bl},\n padding-top ${o} ${bl},\n padding-bottom ${o} ${bl}\n ${n?`,${n}`:""}\n `)]}var wl=to("alert","\n line-height: var(--n-line-height);\n border-radius: var(--n-border-radius);\n position: relative;\n transition: background-color .3s var(--n-bezier);\n background-color: var(--n-color);\n text-align: start;\n word-break: break-word;\n",[Fo("border","\n border-radius: inherit;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n transition: border-color .3s var(--n-bezier);\n border: var(--n-border);\n pointer-events: none;\n "),Lo("closable",[to("alert-body",[Fo("title","\n padding-right: 24px;\n ")])]),Fo("icon",{color:"var(--n-icon-color)"}),to("alert-body",{padding:"var(--n-padding)"},[Fo("title",{color:"var(--n-title-text-color)"}),Fo("content",{color:"var(--n-content-text-color)"})]),Cl({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),Fo("icon","\n position: absolute;\n left: 0;\n top: 0;\n align-items: center;\n justify-content: center;\n display: flex;\n width: var(--n-icon-size);\n height: var(--n-icon-size);\n font-size: var(--n-icon-size);\n margin: var(--n-icon-margin);\n "),Fo("close","\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n position: absolute;\n right: 0;\n top: 0;\n margin: var(--n-close-margin);\n "),Lo("show-icon",[to("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),Lo("right-adjust",[to("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),to("alert-body","\n border-radius: var(--n-border-radius);\n transition: border-color .3s var(--n-bezier);\n ",[Fo("title","\n transition: color .3s var(--n-bezier);\n font-size: 16px;\n line-height: 19px;\n font-weight: var(--n-title-font-weight);\n ",[lo("& +",[Fo("content",{marginTop:"9px"})])]),Fo("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),Fo("icon",{transition:"color .3s var(--n-bezier)"})]),Sl=e({name:"Alert",inheritAttrs:!1,props:Object.assign(Object.assign({},Ie.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),slots:Object,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:n,inlineThemeDisabled:t,mergedRtlRef:r}=ro(e),a=Ie("Alert","-alert",wl,gl,e,o),l=Ce("Alert",r,o),i=I(()=>{const{common:{cubicBezierEaseInOut:o},self:n}=a.value,{fontSize:t,borderRadius:r,titleFontWeight:l,lineHeight:i,iconSize:s,iconMargin:d,iconMarginRtl:c,closeIconSize:u,closeBorderRadius:p,closeSize:h,closeMargin:f,closeMarginRtl:m,padding:v}=n,{type:g}=e,{left:b,right:y}=Qe(d);return{"--n-bezier":o,"--n-color":n[Eo("color",g)],"--n-close-icon-size":u,"--n-close-border-radius":p,"--n-close-color-hover":n[Eo("closeColorHover",g)],"--n-close-color-pressed":n[Eo("closeColorPressed",g)],"--n-close-icon-color":n[Eo("closeIconColor",g)],"--n-close-icon-color-hover":n[Eo("closeIconColorHover",g)],"--n-close-icon-color-pressed":n[Eo("closeIconColorPressed",g)],"--n-icon-color":n[Eo("iconColor",g)],"--n-border":n[Eo("border",g)],"--n-title-text-color":n[Eo("titleTextColor",g)],"--n-content-text-color":n[Eo("contentTextColor",g)],"--n-line-height":i,"--n-border-radius":r,"--n-font-size":t,"--n-title-font-weight":l,"--n-icon-size":s,"--n-icon-margin":d,"--n-icon-margin-rtl":c,"--n-close-size":h,"--n-close-margin":f,"--n-close-margin-rtl":m,"--n-padding":v,"--n-icon-margin-left":b,"--n-icon-margin-right":y}}),s=t?io("alert",I(()=>e.type[0]),i,e):void 0,d=J(!0);return{rtlEnabled:l,mergedClsPrefix:o,mergedBordered:n,visible:d,handleCloseClick:()=>{var o;Promise.resolve(null===(o=e.onClose)||void 0===o?void 0:o.call(e)).then(e=>{!1!==e&&(d.value=!1)})},handleAfterLeave:()=>{(()=>{const{onAfterLeave:o,onAfterHide:n}=e;o&&o(),n&&n()})()},mergedTheme:a,cssVars:t?void 0:i,themeClass:null==s?void 0:s.themeClass,onRender:null==s?void 0:s.onRender}},render(){var e;return null===(e=this.onRender)||void 0===e||e.call(this),u(ge,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:e,$slots:o}=this,n={class:[`${e}-alert`,this.themeClass,this.closable&&`${e}-alert--closable`,this.showIcon&&`${e}-alert--show-icon`,!this.title&&this.closable&&`${e}-alert--right-adjust`,this.rtlEnabled&&`${e}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?u("div",Object.assign({},r(this.$attrs,n)),this.closable&&u(me,{clsPrefix:e,class:`${e}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&u("div",{class:`${e}-alert__border`}),this.showIcon&&u("div",{class:`${e}-alert__icon`,"aria-hidden":"true"},Do(o.icon,()=>[u(co,{clsPrefix:e},{default:()=>{switch(this.type){case"success":return u(An,null);case"info":return u(zn,null);case"warning":return u(Un,null);case"error":return u(Rn,null);default:return null}}})])),u("div",{class:[`${e}-alert-body`,this.mergedBordered&&`${e}-alert-body--bordered`]},fe(o.header,o=>{const n=o||this.title;return n?u("div",{class:`${e}-alert-body__title`},n):null}),o.default&&u("div",{class:`${e}-alert-body__content`},o))):null}})}}),kl={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"};function Pl(e){const{borderRadius:o,railColor:n,primaryColor:t,primaryColorHover:r,primaryColorPressed:a,textColor2:l}=e;return Object.assign(Object.assign({},kl),{borderRadius:o,railColor:n,railColorActive:t,linkColor:qe(t,{alpha:.15}),linkTextColor:l,linkTextColorHover:r,linkTextColorPressed:a,linkTextColorActive:t})}var Il={name:"Anchor",common:pe,self:Pl},Tl={name:"Anchor",common:Pa,self:Pl};var Al=ke({name:"Input",common:Pa,peers:{Scrollbar:Ia},self:function(e){const{textColor2:o,textColor3:n,textColorDisabled:t,primaryColor:r,primaryColorHover:a,inputColor:l,inputColorDisabled:i,warningColor:s,warningColorHover:d,errorColor:c,errorColorHover:u,borderRadius:p,lineHeight:h,fontSizeTiny:f,fontSizeSmall:m,fontSizeMedium:v,fontSizeLarge:g,heightTiny:b,heightSmall:y,heightMedium:x,heightLarge:C,clearColor:w,clearColorHover:S,clearColorPressed:k,placeholderColor:P,placeholderColorDisabled:I,iconColor:T,iconColorDisabled:A,iconColorHover:z,iconColorPressed:R,fontWeight:M}=e;return Object.assign(Object.assign({},fn),{fontWeight:M,countTextColorDisabled:t,countTextColor:n,heightTiny:b,heightSmall:y,heightMedium:x,heightLarge:C,fontSizeTiny:f,fontSizeSmall:m,fontSizeMedium:v,fontSizeLarge:g,lineHeight:h,lineHeightTextarea:h,borderRadius:p,iconSize:"16px",groupLabelColor:l,textColor:o,textColorDisabled:t,textDecorationColor:o,groupLabelTextColor:o,caretColor:r,placeholderColor:P,placeholderColorDisabled:I,color:l,colorDisabled:i,colorFocus:qe(r,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${a}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${a}`,boxShadowFocus:`0 0 8px 0 ${qe(r,{alpha:.3})}`,loadingColor:r,loadingColorWarning:s,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:qe(s,{alpha:.1}),borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 8px 0 ${qe(s,{alpha:.3})}`,caretColorWarning:s,loadingColorError:c,borderError:`1px solid ${c}`,borderHoverError:`1px solid ${u}`,colorFocusError:qe(c,{alpha:.1}),borderFocusError:`1px solid ${u}`,boxShadowFocusError:`0 0 8px 0 ${qe(c,{alpha:.3})}`,caretColorError:c,clearColor:w,clearColorHover:S,clearColorPressed:k,iconColor:T,iconColorDisabled:A,iconColorHover:z,iconColorPressed:R,suffixTextColor:o})}}),zl=Ue("n-input"),Rl=to("input","\n max-width: 100%;\n cursor: text;\n line-height: 1.5;\n z-index: auto;\n outline: none;\n box-sizing: border-box;\n position: relative;\n display: inline-flex;\n border-radius: var(--n-border-radius);\n background-color: var(--n-color);\n transition: background-color .3s var(--n-bezier);\n font-size: var(--n-font-size);\n font-weight: var(--n-font-weight);\n --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);\n",[Fo("input, textarea","\n overflow: hidden;\n flex-grow: 1;\n position: relative;\n "),Fo("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder","\n box-sizing: border-box;\n font-size: inherit;\n line-height: 1.5;\n font-family: inherit;\n border: none;\n outline: none;\n background-color: #0000;\n text-align: inherit;\n transition:\n -webkit-text-fill-color .3s var(--n-bezier),\n caret-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n text-decoration-color .3s var(--n-bezier);\n "),Fo("input-el, textarea-el","\n -webkit-appearance: none;\n scrollbar-width: none;\n width: 100%;\n min-width: 0;\n text-decoration-color: var(--n-text-decoration-color);\n color: var(--n-text-color);\n caret-color: var(--n-caret-color);\n background-color: transparent;\n ",[lo("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb","\n width: 0;\n height: 0;\n display: none;\n "),lo("&::placeholder","\n color: #0000;\n -webkit-text-fill-color: transparent !important;\n "),lo("&:-webkit-autofill ~",[Fo("placeholder","display: none;")])]),Lo("round",[Je("textarea","border-radius: calc(var(--n-height) / 2);")]),Fo("placeholder","\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n overflow: hidden;\n color: var(--n-placeholder-color);\n ",[lo("span","\n width: 100%;\n display: inline-block;\n ")]),Lo("textarea",[Fo("placeholder","overflow: visible;")]),Je("autosize","width: 100%;"),Lo("autosize",[Fo("textarea-el, input-el","\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n ")]),to("input-wrapper","\n overflow: hidden;\n display: inline-flex;\n flex-grow: 1;\n position: relative;\n padding-left: var(--n-padding-left);\n padding-right: var(--n-padding-right);\n "),Fo("input-mirror","\n padding: 0;\n height: var(--n-height);\n line-height: var(--n-height);\n overflow: hidden;\n visibility: hidden;\n position: static;\n white-space: pre;\n pointer-events: none;\n "),Fo("input-el","\n padding: 0;\n height: var(--n-height);\n line-height: var(--n-height);\n ",[lo("&[type=password]::-ms-reveal","display: none;"),lo("+",[Fo("placeholder","\n display: flex;\n align-items: center; \n ")])]),Je("textarea",[Fo("placeholder","white-space: nowrap;")]),Fo("eye","\n display: flex;\n align-items: center;\n justify-content: center;\n transition: color .3s var(--n-bezier);\n "),Lo("textarea","width: 100%;",[to("input-word-count","\n position: absolute;\n right: var(--n-padding-right);\n bottom: var(--n-padding-vertical);\n "),Lo("resizable",[to("input-wrapper","\n resize: vertical;\n min-height: var(--n-height);\n ")]),Fo("textarea-el, textarea-mirror, placeholder","\n height: 100%;\n padding-left: 0;\n padding-right: 0;\n padding-top: var(--n-padding-vertical);\n padding-bottom: var(--n-padding-vertical);\n word-break: break-word;\n display: inline-block;\n vertical-align: bottom;\n box-sizing: border-box;\n line-height: var(--n-line-height-textarea);\n margin: 0;\n resize: none;\n white-space: pre-wrap;\n scroll-padding-block-end: var(--n-padding-vertical);\n "),Fo("textarea-mirror","\n width: 100%;\n pointer-events: none;\n overflow: hidden;\n visibility: hidden;\n position: static;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n ")]),Lo("pair",[Fo("input-el, placeholder","text-align: center;"),Fo("separator","\n display: flex;\n align-items: center;\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n white-space: nowrap;\n ",[to("icon","\n color: var(--n-icon-color);\n "),to("base-icon","\n color: var(--n-icon-color);\n ")])]),Lo("disabled","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n ",[Fo("border","border: var(--n-border-disabled);"),Fo("input-el, textarea-el","\n cursor: not-allowed;\n color: var(--n-text-color-disabled);\n text-decoration-color: var(--n-text-color-disabled);\n "),Fo("placeholder","color: var(--n-placeholder-color-disabled);"),Fo("separator","color: var(--n-text-color-disabled);",[to("icon","\n color: var(--n-icon-color-disabled);\n "),to("base-icon","\n color: var(--n-icon-color-disabled);\n ")]),to("input-word-count","\n color: var(--n-count-text-color-disabled);\n "),Fo("suffix, prefix","color: var(--n-text-color-disabled);",[to("icon","\n color: var(--n-icon-color-disabled);\n "),to("internal-icon","\n color: var(--n-icon-color-disabled);\n ")])]),Je("disabled",[Fo("eye","\n color: var(--n-icon-color);\n cursor: pointer;\n ",[lo("&:hover","\n color: var(--n-icon-color-hover);\n "),lo("&:active","\n color: var(--n-icon-color-pressed);\n ")]),lo("&:hover",[Fo("state-border","border: var(--n-border-hover);")]),Lo("focus","background-color: var(--n-color-focus);",[Fo("state-border","\n border: var(--n-border-focus);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),Fo("border, state-border","\n box-sizing: border-box;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n border-radius: inherit;\n border: var(--n-border);\n transition:\n box-shadow .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n "),Fo("state-border","\n border-color: #0000;\n z-index: 1;\n "),Fo("prefix","margin-right: 4px;"),Fo("suffix","\n margin-left: 4px;\n "),Fo("suffix, prefix","\n transition: color .3s var(--n-bezier);\n flex-wrap: nowrap;\n flex-shrink: 0;\n line-height: var(--n-height);\n white-space: nowrap;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--n-suffix-text-color);\n ",[to("base-loading","\n font-size: var(--n-icon-size);\n margin: 0 2px;\n color: var(--n-loading-color);\n "),to("base-clear","\n font-size: var(--n-icon-size);\n ",[Fo("placeholder",[to("base-icon","\n transition: color .3s var(--n-bezier);\n color: var(--n-icon-color);\n font-size: var(--n-icon-size);\n ")])]),lo(">",[to("icon","\n transition: color .3s var(--n-bezier);\n color: var(--n-icon-color);\n font-size: var(--n-icon-size);\n ")]),to("base-icon","\n font-size: var(--n-icon-size);\n ")]),to("input-word-count","\n pointer-events: none;\n line-height: 1.5;\n font-size: .85em;\n color: var(--n-count-text-color);\n transition: color .3s var(--n-bezier);\n margin-left: 4px;\n font-variant: tabular-nums;\n "),["warning","error"].map(e=>Lo(`${e}-status`,[Je("disabled",[to("base-loading",`\n color: var(--n-loading-color-${e})\n `),Fo("input-el, textarea-el",`\n caret-color: var(--n-caret-color-${e});\n `),Fo("state-border",`\n border: var(--n-border-${e});\n `),lo("&:hover",[Fo("state-border",`\n border: var(--n-border-hover-${e});\n `)]),lo("&:focus",`\n background-color: var(--n-color-focus-${e});\n `,[Fo("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)]),Lo("focus",`\n background-color: var(--n-color-focus-${e});\n `,[Fo("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)])])]))]),Ml=to("input",[Lo("disabled",[Fo("input-el, textarea-el","\n -webkit-text-fill-color: var(--n-text-color-disabled);\n ")])]);function Fl(e){let o=0;for(const n of e)o++;return o}function Ol(e){return""===e||null==e}var Bl=e({name:"InputWordCount",setup(e,{slots:o}){const{mergedValueRef:n,maxlengthRef:t,mergedClsPrefixRef:r,countGraphemesRef:a}=p(zl),l=I(()=>{const{value:e}=n;return null===e||Array.isArray(e)?0:(a.value||Fl)(e)});return()=>{const{value:e}=t,{value:a}=n;return u("span",{class:`${r.value}-input-word-count`},$e(o.default,{value:null===a||Array.isArray(a)?"":a},()=>[void 0===e?l.value:`${l.value} / ${e}`]))}}}),$l=e({name:"Input",props:Object.assign(Object.assign({},Ie.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),slots:Object,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:n,inlineThemeDisabled:t,mergedRtlRef:r}=ro(e),l=Ie("Input","-input",Rl,un,e,o);eo&&ze("-input-safari",Ml,o);const s=J(null),d=J(null),c=J(null),u=J(null),p=J(null),h=J(null),m=J(null),v=function(e){const o=J(null);function n(){o.value=null}return C(e,n),{recordCursor:function(){const{value:t}=e;if(!(null==t?void 0:t.focus))return void n();const{selectionStart:r,selectionEnd:a,value:l}=t;null!=r&&null!=a?o.value={start:r,end:a,beforeText:l.slice(0,r),afterText:l.slice(a)}:n()},restoreCursor:function(){var n;const{value:t}=o,{value:r}=e;if(!t||!r)return;const{value:a}=r,{start:l,beforeText:i,afterText:s}=t;let d=a.length;if(a.endsWith(s))d=a.length-s.length;else if(a.startsWith(i))d=i.length;else{const e=i[l-1],o=a.indexOf(e,l-1);-1!==o&&(d=o+1)}null===(n=r.setSelectionRange)||void 0===n||n.call(r,d,d)}}}(m),g=J(null),{localeRef:y}=we("Input"),x=J(e.defaultValue),w=z(e,"value"),S=Me(w,x),k=mo(e),{mergedSizeRef:P,mergedDisabledRef:T,mergedStatusRef:A}=k,R=J(!1),M=J(!1),F=J(!1),O=J(!1);let B=null;const $=I(()=>{const{placeholder:o,pair:n}=e;return n?Array.isArray(o)?o:void 0===o?["",""]:[o,o]:void 0===o?[y.value.placeholder]:[o]}),E=I(()=>{const{value:e}=F,{value:o}=S,{value:n}=$;return!e&&(Ol(o)||Array.isArray(o)&&Ol(o[0]))&&n[0]}),_=I(()=>{const{value:e}=F,{value:o}=S,{value:n}=$;return!e&&n[1]&&(Ol(o)||Array.isArray(o)&&Ol(o[1]))}),L=de(()=>e.internalForceFocus||R.value),H=de(()=>{if(T.value||e.readonly||!e.clearable||!L.value&&!M.value)return!1;const{value:o}=S,{value:n}=L;return e.pair?!(!Array.isArray(o)||!o[0]&&!o[1])&&(M.value||n):!!o&&(M.value||n)}),j=I(()=>{const{showPasswordOn:o}=e;return o||(e.showPasswordToggle?"click":void 0)}),U=J(!1),W=I(()=>{const{textDecoration:o}=e;return o?Array.isArray(o)?o.map(e=>({textDecoration:e})):[{textDecoration:o}]:["",""]}),N=J(void 0),K=I(()=>{const{maxlength:o}=e;return void 0===o?void 0:Number(o)});b(()=>{const{value:e}=S;Array.isArray(e)||oe(e)});const V=D().proxy;function q(o,n){const{onUpdateValue:t,"onUpdate:value":r,onInput:a}=e,{nTriggerFormInput:l}=k;t&&_e(t,o,n),r&&_e(r,o,n),a&&_e(a,o,n),x.value=o,l()}function G(o,n){const{onChange:t}=e,{nTriggerFormChange:r}=k;t&&_e(t,o,n),x.value=o,r()}function Y(o,n=0,t="input"){const r=o.target.value;if(oe(r),o instanceof InputEvent&&!o.isComposing&&(F.value=!1),"textarea"===e.type){const{value:e}=g;e&&e.syncUnifiedContainer()}if(B=r,F.value)return;v.recordCursor();const a=function(o){const{countGraphemes:n,maxlength:t,minlength:r}=e;if(n){let e;if(void 0!==t&&(void 0===e&&(e=n(o)),e>Number(t)))return!1;if(void 0!==r&&(void 0===e&&(e=n(o)),e<Number(t)))return!1}const{allowInput:a}=e;return"function"!=typeof a||a(o)}(r);if(a)if(e.pair){let{value:e}=S;e=Array.isArray(e)?[e[0],e[1]]:["",""],e[n]=r,"input"===t?q(e,{source:n}):G(e,{source:n})}else"input"===t?q(r,{source:n}):G(r,{source:n});V.$forceUpdate(),a||i(v.restoreCursor)}function Z(o,n){(null===o.relatedTarget||o.relatedTarget!==p.value&&o.relatedTarget!==h.value&&o.relatedTarget!==d.value&&o.relatedTarget!==s.value)&&("focus"===n?(!function(o){const{onFocus:n}=e,{nTriggerFormFocus:t}=k;n&&_e(n,o),t()}(o),R.value=!0):"blur"===n&&(!function(o){const{onBlur:n}=e,{nTriggerFormBlur:t}=k;n&&_e(n,o),t()}(o),R.value=!1))}function X(){e.pair?(q(["",""],{source:"clear"}),G(["",""],{source:"clear"})):(q("",{source:"clear"}),G("",{source:"clear"}))}function Q(){e.passivelyActivated&&(O.value=!1,i(()=>{var e;null===(e=s.value)||void 0===e||e.focus()}))}function ee(){var o,n,t;T.value||(e.passivelyActivated?null===(o=s.value)||void 0===o||o.focus():(null===(n=d.value)||void 0===n||n.focus(),null===(t=p.value)||void 0===t||t.focus()))}function oe(o){const{type:n,pair:t,autosize:r}=e;if(!t&&r)if("textarea"===n){const{value:e}=c;e&&(e.textContent=`${null!=o?o:""}\r\n`)}else{const{value:e}=u;e&&(o?e.textContent=o:e.innerHTML="&nbsp;")}}const ne=J({top:"0"});let te=null;f(()=>{const{autosize:o,type:n}=e;o&&"textarea"===n?te=C(S,e=>{Array.isArray(e)||e===B||oe(e)}):null==te||te()});let re=null;f(()=>{"textarea"===e.type?re=C(S,e=>{var o;Array.isArray(e)||e===B||null===(o=g.value)||void 0===o||o.syncUnifiedContainer()}):null==re||re()}),a(zl,{mergedValueRef:S,maxlengthRef:K,mergedClsPrefixRef:o,countGraphemesRef:z(e,"countGraphemes")});const ae={wrapperElRef:s,inputElRef:p,textareaElRef:d,isCompositing:F,clear:X,focus:ee,blur:function(){var e;(null===(e=s.value)||void 0===e?void 0:e.contains(document.activeElement))&&document.activeElement.blur()},select:function(){var e,o;null===(e=d.value)||void 0===e||e.select(),null===(o=p.value)||void 0===o||o.select()},deactivate:function(){const{value:e}=s;(null==e?void 0:e.contains(document.activeElement))&&e!==document.activeElement&&Q()},activate:function(){T.value||(d.value?d.value.focus():p.value&&p.value.focus())},scrollTo:function(o){if("textarea"===e.type){const{value:e}=d;null==e||e.scrollTo(o)}else{const{value:e}=p;null==e||e.scrollTo(o)}}},le=Ce("Input",r,o),ie=I(()=>{const{value:e}=P,{common:{cubicBezierEaseInOut:o},self:{color:n,borderRadius:t,textColor:r,caretColor:a,caretColorError:i,caretColorWarning:s,textDecorationColor:d,border:c,borderDisabled:u,borderHover:p,borderFocus:h,placeholderColor:f,placeholderColorDisabled:m,lineHeightTextarea:v,colorDisabled:g,colorFocus:b,textColorDisabled:y,boxShadowFocus:x,iconSize:C,colorFocusWarning:w,boxShadowFocusWarning:S,borderWarning:k,borderFocusWarning:I,borderHoverWarning:T,colorFocusError:A,boxShadowFocusError:z,borderError:R,borderFocusError:M,borderHoverError:F,clearSize:O,clearColor:B,clearColorHover:$,clearColorPressed:E,iconColor:D,iconColorDisabled:_,suffixTextColor:L,countTextColor:H,countTextColorDisabled:j,iconColorHover:U,iconColorPressed:W,loadingColor:N,loadingColorError:K,loadingColorWarning:V,fontWeight:q,[Eo("padding",e)]:G,[Eo("fontSize",e)]:J,[Eo("height",e)]:Y}}=l.value,{left:Z,right:X}=Qe(G);return{"--n-bezier":o,"--n-count-text-color":H,"--n-count-text-color-disabled":j,"--n-color":n,"--n-font-size":J,"--n-font-weight":q,"--n-border-radius":t,"--n-height":Y,"--n-padding-left":Z,"--n-padding-right":X,"--n-text-color":r,"--n-caret-color":a,"--n-text-decoration-color":d,"--n-border":c,"--n-border-disabled":u,"--n-border-hover":p,"--n-border-focus":h,"--n-placeholder-color":f,"--n-placeholder-color-disabled":m,"--n-icon-size":C,"--n-line-height-textarea":v,"--n-color-disabled":g,"--n-color-focus":b,"--n-text-color-disabled":y,"--n-box-shadow-focus":x,"--n-loading-color":N,"--n-caret-color-warning":s,"--n-color-focus-warning":w,"--n-box-shadow-focus-warning":S,"--n-border-warning":k,"--n-border-focus-warning":I,"--n-border-hover-warning":T,"--n-loading-color-warning":V,"--n-caret-color-error":i,"--n-color-focus-error":A,"--n-box-shadow-focus-error":z,"--n-border-error":R,"--n-border-focus-error":M,"--n-border-hover-error":F,"--n-loading-color-error":K,"--n-clear-color":B,"--n-clear-size":O,"--n-clear-color-hover":$,"--n-clear-color-pressed":E,"--n-icon-color":D,"--n-icon-color-hover":U,"--n-icon-color-pressed":W,"--n-icon-color-disabled":_,"--n-suffix-text-color":L}}),se=t?io("input",I(()=>{const{value:e}=P;return e[0]}),ie,e):void 0;return Object.assign(Object.assign({},ae),{wrapperElRef:s,inputElRef:p,inputMirrorElRef:u,inputEl2Ref:h,textareaElRef:d,textareaMirrorElRef:c,textareaScrollbarInstRef:g,rtlEnabled:le,uncontrolledValue:x,mergedValue:S,passwordVisible:U,mergedPlaceholder:$,showPlaceholder1:E,showPlaceholder2:_,mergedFocus:L,isComposing:F,activated:O,showClearButton:H,mergedSize:P,mergedDisabled:T,textDecorationStyle:W,mergedClsPrefix:o,mergedBordered:n,mergedShowPasswordOn:j,placeholderStyle:ne,mergedStatus:A,textAreaScrollContainerWidth:N,handleTextAreaScroll:function(e){var o;const{scrollTop:n}=e.target;ne.value.top=-n+"px",null===(o=g.value)||void 0===o||o.syncUnifiedContainer()},handleCompositionStart:function(){F.value=!0},handleCompositionEnd:function(e){F.value=!1,e.target===h.value?Y(e,1):Y(e,0)},handleInput:Y,handleInputBlur:function(o){!function(o){const{onInputBlur:n}=e;n&&_e(n,o)}(o),o.relatedTarget===s.value&&function(){const{onDeactivate:o}=e;o&&_e(o)}(),(null===o.relatedTarget||o.relatedTarget!==p.value&&o.relatedTarget!==h.value&&o.relatedTarget!==d.value)&&(O.value=!1),Z(o,"blur"),m.value=null},handleInputFocus:function(o,n){!function(o){const{onInputFocus:n}=e;n&&_e(n,o)}(o),R.value=!0,O.value=!0,function(){const{onActivate:o}=e;o&&_e(o)}(),Z(o,"focus"),0===n?m.value=p.value:1===n?m.value=h.value:2===n&&(m.value=d.value)},handleWrapperBlur:function(o){e.passivelyActivated&&(!function(o){const{onWrapperBlur:n}=e;n&&_e(n,o)}(o),Z(o,"blur"))},handleWrapperFocus:function(o){e.passivelyActivated&&(R.value=!0,function(o){const{onWrapperFocus:n}=e;n&&_e(n,o)}(o),Z(o,"focus"))},handleMouseEnter:function(){var o;M.value=!0,"textarea"===e.type&&(null===(o=g.value)||void 0===o||o.handleMouseEnterWrapper())},handleMouseLeave:function(){var o;M.value=!1,"textarea"===e.type&&(null===(o=g.value)||void 0===o||o.handleMouseLeaveWrapper())},handleMouseDown:function(o){const{onMousedown:n}=e;n&&n(o);const{tagName:t}=o.target;if("INPUT"!==t&&"TEXTAREA"!==t){if(e.resizable){const{value:e}=s;if(e){const{left:n,top:t,width:r,height:a}=e.getBoundingClientRect(),l=14;if(n+r-l<o.clientX&&o.clientX<n+r&&t+a-l<o.clientY&&o.clientY<t+a)return}}o.preventDefault(),R.value||ee()}},handleChange:function(e,o){Y(e,o,"change")},handleClick:function(o){!function(o){const{onClick:n}=e;n&&_e(n,o)}(o)},handleClear:function(o){!function(o){const{onClear:n}=e;n&&_e(n,o)}(o),X()},handlePasswordToggleClick:function(){T.value||"click"===j.value&&(U.value=!U.value)},handlePasswordToggleMousedown:function(e){if(T.value)return;e.preventDefault();const o=e=>{e.preventDefault(),Ao("mouseup",document,o)};if(go("mouseup",document,o),"mousedown"!==j.value)return;U.value=!0;const n=()=>{U.value=!1,Ao("mouseup",document,n)};go("mouseup",document,n)},handleWrapperKeydown:function(o){switch(e.onKeydown&&_e(e.onKeydown,o),o.key){case"Escape":Q();break;case"Enter":!function(o){var n,t;if(e.passivelyActivated){const{value:r}=O;if(r)return void(e.internalDeactivateOnEnter&&Q());o.preventDefault(),"textarea"===e.type?null===(n=d.value)||void 0===n||n.focus():null===(t=p.value)||void 0===t||t.focus()}}(o)}},handleWrapperKeyup:function(o){e.onKeyup&&_e(e.onKeyup,o)},handleTextAreaMirrorResize:function(){(()=>{var o,n;if("textarea"===e.type){const{autosize:t}=e;if(t&&(N.value=null===(n=null===(o=g.value)||void 0===o?void 0:o.$el)||void 0===n?void 0:n.offsetWidth),!d.value)return;if("boolean"==typeof t)return;const{paddingTop:r,paddingBottom:a,lineHeight:l}=window.getComputedStyle(d.value),i=Number(r.slice(0,-2)),s=Number(a.slice(0,-2)),u=Number(l.slice(0,-2)),{value:p}=c;if(!p)return;if(t.minRows){const e=`${i+s+u*Math.max(t.minRows,1)}px`;p.style.minHeight=e}if(t.maxRows){const e=`${i+s+u*t.maxRows}px`;p.style.maxHeight=e}}})()},getTextareaScrollContainer:()=>d.value,mergedTheme:l,cssVars:t?void 0:ie,themeClass:null==se?void 0:se.themeClass,onRender:null==se?void 0:se.onRender})},render(){var e,o,n,t,r,a,l;const{mergedClsPrefix:i,mergedStatus:s,themeClass:d,type:c,countGraphemes:p,onRender:h}=this,f=this.$slots;return null==h||h(),u("div",{ref:"wrapperElRef",class:[`${i}-input`,d,s&&`${i}-input--${s}-status`,{[`${i}-input--rtl`]:this.rtlEnabled,[`${i}-input--disabled`]:this.mergedDisabled,[`${i}-input--textarea`]:"textarea"===c,[`${i}-input--resizable`]:this.resizable&&!this.autosize,[`${i}-input--autosize`]:this.autosize,[`${i}-input--round`]:this.round&&!("textarea"===c),[`${i}-input--pair`]:this.pair,[`${i}-input--focus`]:this.mergedFocus,[`${i}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:this.mergedDisabled||!this.passivelyActivated||this.activated?void 0:0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},u("div",{class:`${i}-input-wrapper`},fe(f.prefix,e=>e&&u("div",{class:`${i}-input__prefix`},e)),"textarea"===c?u(_o,{ref:"textareaScrollbarInstRef",class:`${i}-input__textarea`,container:this.getTextareaScrollContainer,theme:null===(o=null===(e=this.theme)||void 0===e?void 0:e.peers)||void 0===o?void 0:o.Scrollbar,themeOverrides:null===(t=null===(n=this.themeOverrides)||void 0===n?void 0:n.peers)||void 0===t?void 0:t.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var e,o;const{textAreaScrollContainerWidth:n}=this,t={width:this.autosize&&n&&`${n}px`};return u(F,null,u("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${i}-input__textarea-el`,null===(e=this.inputProps)||void 0===e?void 0:e.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:p?void 0:this.maxlength,minlength:p?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],null===(o=this.inputProps)||void 0===o?void 0:o.style,t],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?u("div",{class:`${i}-input__placeholder`,style:[this.placeholderStyle,t],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?u(Re,{onResize:this.handleTextAreaMirrorResize},{default:()=>u("div",{ref:"textareaMirrorElRef",class:`${i}-input__textarea-mirror`,key:"mirror"})}):null)}}):u("div",{class:`${i}-input__input`},u("input",Object.assign({type:"password"===c&&this.mergedShowPasswordOn&&this.passwordVisible?"text":c},this.inputProps,{ref:"inputElRef",class:[`${i}-input__input-el`,null===(r=this.inputProps)||void 0===r?void 0:r.class],style:[this.textDecorationStyle[0],null===(a=this.inputProps)||void 0===a?void 0:a.style],tabindex:this.passivelyActivated&&!this.activated?-1:null===(l=this.inputProps)||void 0===l?void 0:l.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:p?void 0:this.maxlength,minlength:p?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,0)},onInput:e=>{this.handleInput(e,0)},onChange:e=>{this.handleChange(e,0)}})),this.showPlaceholder1?u("div",{class:`${i}-input__placeholder`},u("span",null,this.mergedPlaceholder[0])):null,this.autosize?u("div",{class:`${i}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&fe(f.suffix,e=>e||this.clearable||this.showCount||this.mergedShowPasswordOn||void 0!==this.loading?u("div",{class:`${i}-input__suffix`},[fe(f["clear-icon-placeholder"],e=>(this.clearable||e)&&u(wr,{clsPrefix:i,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>e,icon:()=>{var e,o;return null===(o=(e=this.$slots)["clear-icon"])||void 0===o?void 0:o.call(e)}})),this.internalLoadingBeforeSuffix?null:e,void 0!==this.loading?u(ul,{clsPrefix:i,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?e:null,this.showCount&&"textarea"!==this.type?u(Bl,null,{default:e=>{var o;const{renderCount:n}=this;return n?n(e):null===(o=f.count)||void 0===o?void 0:o.call(f,e)}}):null,this.mergedShowPasswordOn&&"password"===this.type?u("div",{class:`${i}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Do(f["password-visible-icon"],()=>[u(co,{clsPrefix:i},{default:()=>u(gn,null)})]):Do(f["password-invisible-icon"],()=>[u(co,{clsPrefix:i},{default:()=>u(yr,null)})])):null]):null)),this.pair?u("span",{class:`${i}-input__separator`},Do(f.separator,()=>[this.separator])):null,this.pair?u("div",{class:`${i}-input-wrapper`},u("div",{class:`${i}-input__input`},u("input",{ref:"inputEl2Ref",type:this.type,class:`${i}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:p?void 0:this.maxlength,minlength:p?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,1)},onInput:e=>{this.handleInput(e,1)},onChange:e=>{this.handleChange(e,1)}}),this.showPlaceholder2?u("div",{class:`${i}-input__placeholder`},u("span",null,this.mergedPlaceholder[1])):null),fe(f.suffix,e=>(this.clearable||e)&&u("div",{class:`${i}-input__suffix`},[this.clearable&&u(wr,{clsPrefix:i,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var e;return null===(e=f["clear-icon"])||void 0===e?void 0:e.call(f)},placeholder:()=>{var e;return null===(e=f["clear-icon-placeholder"])||void 0===e?void 0:e.call(f)}}),e]))):null,this.mergedBordered?u("div",{class:`${i}-input__border`}):null,this.mergedBordered?u("div",{class:`${i}-input__state-border`}):null,this.showCount&&"textarea"===c?u(Bl,null,{default:e=>{var o;const{renderCount:n}=this;return n?n(e):null===(o=f.count)||void 0===o?void 0:o.call(f,e)}}):null)}});function El(e){return"group"===e.type}function Dl(e){return"ignored"===e.type}function _l(e,o){try{return!!(1+o.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch(n){return!1}}function Ll(e,o){return{getIsGroup:El,getIgnored:Dl,getKey:o=>El(o)?o.name||o.key||"key-required":o[e],getChildren:e=>e[o]}}function Hl(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}var jl=ke({name:"AutoComplete",common:pe,peers:{InternalSelectMenu:nn,Input:un},self:Hl}),Ul={name:"AutoComplete",common:Pa,peers:{InternalSelectMenu:Qa,Input:Al},self:Hl},Wl=lo([to("auto-complete","\n z-index: auto;\n position: relative;\n display: inline-flex;\n width: 100%;\n "),to("auto-complete-menu","\n margin: 4px 0;\n box-shadow: var(--n-menu-box-shadow);\n ",[tn({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Nl(e){var o,n;return"string"==typeof e?{label:e,value:e}:"group"===e.type?{type:"group",label:null!==(o=e.label)&&void 0!==o?o:e.name,value:null!==(n=e.value)&&void 0!==n?n:e.name,key:e.key||e.name,children:e.children.map(e=>Nl(e))}:e}var Kl=e({name:"AutoComplete",props:Object.assign(Object.assign({},Ie.props),{to:ln.propTo,menuProps:Object,append:Boolean,bordered:{type:Boolean,default:void 0},clearable:{type:Boolean,default:void 0},defaultValue:{type:String,default:null},loading:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},placeholder:String,placement:{type:String,default:"bottom-start"},value:String,blurAfterSelect:Boolean,clearAfterSelect:Boolean,getShow:Function,showEmpty:Boolean,inputProps:Object,renderOption:Function,renderLabel:Function,size:String,options:{type:Array,default:()=>[]},zIndex:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onSelect:[Function,Array],onBlur:[Function,Array],onFocus:[Function,Array],onInput:[Function,Array]}),slots:Object,setup(e){const{mergedBorderedRef:o,namespaceRef:n,mergedClsPrefixRef:t,inlineThemeDisabled:r}=ro(e),a=mo(e),{mergedSizeRef:l,mergedDisabledRef:i,mergedStatusRef:s}=a,d=J(null),c=J(null),u=J(e.defaultValue),p=z(e,"value"),h=Me(p,u),f=J(!1),m=J(!1),v=Ie("AutoComplete","-auto-complete",Wl,jl,e,t),g=I(()=>e.options.map(Nl)),b=I(()=>{const{getShow:o}=e;return o?o(h.value||""):!!h.value}),y=I(()=>b.value&&f.value&&(!!e.showEmpty||!!g.value.length)),x=I(()=>Ja(g.value,Ll("value","children")));function C(o){const{"onUpdate:value":n,onUpdateValue:t,onInput:r}=e,{nTriggerFormInput:l,nTriggerFormChange:i}=a;t&&_e(t,o),n&&_e(n,o),r&&_e(r,o),u.value=o,l(),i()}function w(o){var n,t;void 0!==(null==o?void 0:o.value)&&(!function(o){const{onSelect:n}=e,{nTriggerFormInput:t,nTriggerFormChange:r}=a;n&&_e(n,o),t(),r()}(o.value),e.clearAfterSelect?C(null):void 0!==o.label&&C(e.append?`${h.value}${o.label}`:o.label),f.value=!1,e.blurAfterSelect&&(null===(n=d.value)||void 0===n?void 0:n.contains(document.activeElement))&&(null===(t=document.activeElement)||void 0===t||t.blur()))}const S=I(()=>{const{common:{cubicBezierEaseInOut:e},self:{menuBoxShadow:o}}=v.value;return{"--n-menu-box-shadow":o,"--n-bezier":e}}),k=r?io("auto-complete",void 0,S,e):void 0,P=J(null),T={focus:()=>{var e;null===(e=P.value)||void 0===e||e.focus()},blur:()=>{var e;null===(e=P.value)||void 0===e||e.blur()}};return{focus:T.focus,blur:T.blur,inputInstRef:P,uncontrolledValue:u,mergedValue:h,isMounted:We(),adjustedTo:ln(e),menuInstRef:c,triggerElRef:d,treeMate:x,mergedSize:l,mergedDisabled:i,active:y,mergedStatus:s,handleClear:function(){C(null)},handleFocus:function(o){f.value=!0,function(o){const{onFocus:n}=e,{nTriggerFormFocus:t}=a;n&&_e(n,o),t()}(o)},handleBlur:function(o){f.value=!1,function(o){const{onBlur:n}=e,{nTriggerFormBlur:t}=a;n&&_e(n,o),t()}(o)},handleInput:function(e){f.value=!0,C(e)},handleToggle:function(e){w(e.rawNode)},handleClickOutsideMenu:function(e){var o;(null===(o=d.value)||void 0===o?void 0:o.contains(xo(e)))||(f.value=!1)},handleCompositionStart:function(){m.value=!0},handleCompositionEnd:function(){window.setTimeout(()=>{m.value=!1},0)},handleKeyDown:function(e){var o,n,t;switch(e.key){case"Enter":if(!m.value){const n=null===(o=c.value)||void 0===o?void 0:o.getPendingTmNode();n&&(w(n.rawNode),e.preventDefault())}break;case"ArrowDown":null===(n=c.value)||void 0===n||n.next();break;case"ArrowUp":null===(t=c.value)||void 0===t||t.prev()}},mergedTheme:v,cssVars:r?void 0:S,themeClass:null==k?void 0:k.themeClass,onRender:null==k?void 0:k.onRender,mergedBordered:o,namespace:n,mergedClsPrefix:t}},render(){const{mergedClsPrefix:e}=this;return u("div",{class:`${e}-auto-complete`,ref:"triggerElRef",onKeydown:this.handleKeyDown,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd},u(qo,null,{default:()=>[u(Wo,null,{default:()=>{const e=this.$slots.default;if(e)return Go("default",e,{handleInput:this.handleInput,handleFocus:this.handleFocus,handleBlur:this.handleBlur,value:this.mergedValue});const{mergedTheme:o}=this;return u($l,{ref:"inputInstRef",status:this.mergedStatus,theme:o.peers.Input,themeOverrides:o.peerOverrides.Input,bordered:this.mergedBordered,value:this.mergedValue,placeholder:this.placeholder,size:this.mergedSize,disabled:this.mergedDisabled,clearable:this.clearable,loading:this.loading,inputProps:this.inputProps,onClear:this.handleClear,onFocus:this.handleFocus,onUpdateValue:this.handleInput,onBlur:this.handleBlur},{suffix:()=>{var e,o;return null===(o=(e=this.$slots).suffix)||void 0===o?void 0:o.call(e)},prefix:()=>{var e,o;return null===(o=(e=this.$slots).prefix)||void 0===o?void 0:o.call(e)}})}}),u(bn,{show:this.active,to:this.adjustedTo,containerClass:this.namespace,zIndex:this.zIndex,teleportDisabled:this.adjustedTo===ln.tdkey,placement:this.placement,width:"target"},{default:()=>u(L,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{var o;if(null===(o=this.onRender)||void 0===o||o.call(this),!this.active)return null;const{menuProps:n}=this;return Z(u(tl,Object.assign({},n,{clsPrefix:e,ref:"menuInstRef",theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,"auto-pending":!0,class:[`${e}-auto-complete-menu`,this.themeClass,null==n?void 0:n.class],style:[null==n?void 0:n.style,this.cssVars],treeMate:this.treeMate,multiple:!1,renderLabel:this.renderLabel,renderOption:this.renderOption,size:"medium",onToggle:this.handleToggle}),{empty:()=>{var e,o;return null===(o=(e=this.$slots).empty)||void 0===o?void 0:o.call(e)}}),[[Ho,this.handleClickOutsideMenu,void 0,{capture:!0}]])}})})]}))}});function Vl(e){const{borderRadius:o,avatarColor:n,cardColor:t,fontSize:r,heightTiny:a,heightSmall:l,heightMedium:i,heightLarge:s,heightHuge:d,modalColor:c,popoverColor:u}=e;return{borderRadius:o,fontSize:r,border:`2px solid ${t}`,heightTiny:a,heightSmall:l,heightMedium:i,heightLarge:s,heightHuge:d,color:yo(t,n),colorModal:yo(c,n),colorPopover:yo(u,n)}}var ql={name:"Avatar",common:pe,self:Vl},Gl={name:"Avatar",common:Pa,self:Vl};function Jl(){return{gap:"-12px"}}var Yl=ke({name:"AvatarGroup",common:pe,peers:{Avatar:ql},self:Jl}),Zl={name:"AvatarGroup",common:Pa,peers:{Avatar:Gl},self:Jl},Xl={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},Ql={name:"BackTop",common:Pa,self(e){const{popoverColor:o,textColor2:n,primaryColorHover:t,primaryColorPressed:r}=e;return Object.assign(Object.assign({},Xl),{color:o,textColor:n,iconColor:n,iconColorHover:t,iconColorPressed:r,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}};var ei={name:"BackTop",common:pe,self:function(e){const{popoverColor:o,textColor2:n,primaryColorHover:t,primaryColorPressed:r}=e;return Object.assign(Object.assign({},Xl),{color:o,textColor:n,iconColor:n,iconColorHover:t,iconColorPressed:r,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},oi={name:"Badge",common:Pa,self(e){const{errorColorSuppl:o,infoColorSuppl:n,successColorSuppl:t,warningColorSuppl:r,fontFamily:a}=e;return{color:o,colorInfo:n,colorSuccess:t,colorError:o,colorWarning:r,fontSize:"12px",fontFamily:a}}};var ni={name:"Badge",common:pe,self:function(e){const{errorColor:o,infoColor:n,successColor:t,warningColor:r,fontFamily:a}=e;return{color:o,colorInfo:n,colorSuccess:t,colorError:o,colorWarning:r,fontSize:"12px",fontFamily:a}}},ti={fontWeightActive:"400"};function ri(e){const{fontSize:o,textColor3:n,textColor2:t,borderRadius:r,buttonColor2Hover:a,buttonColor2Pressed:l}=e;return Object.assign(Object.assign({},ti),{fontSize:o,itemLineHeight:"1.25",itemTextColor:n,itemTextColorHover:t,itemTextColorPressed:t,itemTextColorActive:t,itemBorderRadius:r,itemColorHover:a,itemColorPressed:l,separatorColor:n})}var ai={name:"Breadcrumb",common:pe,self:ri},li={name:"Breadcrumb",common:Pa,self:ri},ii={name:"Button",common:Pa,self(e){const o=zo(e);return o.waveOpacity="0.8",o.colorOpacitySecondary="0.16",o.colorOpacitySecondaryHover="0.2",o.colorOpacitySecondaryPressed="0.12",o}},si={titleFontSize:"22px"};function di(e){const{borderRadius:o,fontSize:n,lineHeight:t,textColor2:r,textColor1:a,textColorDisabled:l,dividerColor:i,fontWeightStrong:s,primaryColor:d,baseColor:c,hoverColor:u,cardColor:p,modalColor:h,popoverColor:f}=e;return Object.assign(Object.assign({},si),{borderRadius:o,borderColor:yo(p,i),borderColorModal:yo(h,i),borderColorPopover:yo(f,i),textColor:r,titleFontWeight:s,titleTextColor:a,dayTextColor:l,fontSize:n,lineHeight:t,dateColorCurrent:d,dateTextColorCurrent:c,cellColorHover:yo(p,u),cellColorHoverModal:yo(h,u),cellColorHoverPopover:yo(f,u),cellColor:p,cellColorModal:h,cellColorPopover:f,barColor:d})}var ci=ke({name:"Calendar",common:pe,peers:{Button:ho},self:di}),ui={name:"Calendar",common:Pa,peers:{Button:ii},self:di},pi={name:"Card",common:Pa,self(e){const o=Cn(e),{cardColor:n,modalColor:t,popoverColor:r}=e;return o.colorEmbedded=n,o.colorEmbeddedModal=t,o.colorEmbeddedPopover=r,o}};function hi(){return{dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}}var fi={name:"Carousel",common:pe,self:hi},mi={name:"Carousel",common:Pa,self:hi},vi={name:"Checkbox",common:Pa,self(e){const{cardColor:o}=e,n=Sn(e);return n.color="#0000",n.checkMarkColor=o,n}};function gi(e){const{borderRadius:o,boxShadow2:n,popoverColor:t,textColor2:r,textColor3:a,primaryColor:l,textColorDisabled:i,dividerColor:s,hoverColor:d,fontSizeMedium:c,heightMedium:u}=e;return{menuBorderRadius:o,menuColor:t,menuBoxShadow:n,menuDividerColor:s,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:a,optionHeight:u,optionFontSize:c,optionColorHover:d,optionTextColor:r,optionTextColorActive:l,optionTextColorDisabled:i,optionCheckMarkColor:l,loadingColor:l,columnWidth:"180px"}}var bi=ke({name:"Cascader",common:pe,peers:{InternalSelectMenu:nn,InternalSelection:Qo,Scrollbar:$o,Checkbox:kn,Empty:Ne},self:gi}),yi={name:"Cascader",common:Pa,peers:{InternalSelectMenu:Qa,InternalSelection:pl,Scrollbar:Ia,Checkbox:vi,Empty:Ne},self:gi},xi=Ue("n-checkbox-group"),Ci=e({name:"CheckboxGroup",props:{min:Number,max:Number,size:String,value:Array,defaultValue:{type:Array,default:null},disabled:{type:Boolean,default:void 0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onChange:[Function,Array]},setup(e){const{mergedClsPrefixRef:o}=ro(e),n=mo(e),{mergedSizeRef:t,mergedDisabledRef:r}=n,l=J(e.defaultValue),i=I(()=>e.value),s=Me(i,l),d=I(()=>{var e;return(null===(e=s.value)||void 0===e?void 0:e.length)||0}),c=I(()=>Array.isArray(s.value)?new Set(s.value):new Set);return a(xi,{checkedCountRef:d,maxRef:z(e,"max"),minRef:z(e,"min"),valueSetRef:c,disabledRef:r,mergedSizeRef:t,toggleCheckbox:function(o,t){const{nTriggerFormInput:r,nTriggerFormChange:a}=n,{onChange:i,"onUpdate:value":d,onUpdateValue:c}=e;if(Array.isArray(s.value)){const e=Array.from(s.value),n=e.findIndex(e=>e===t);o?~n||(e.push(t),c&&_e(c,e,{actionType:"check",value:t}),d&&_e(d,e,{actionType:"check",value:t}),r(),a(),l.value=e,i&&_e(i,e)):~n&&(e.splice(n,1),c&&_e(c,e,{actionType:"uncheck",value:t}),d&&_e(d,e,{actionType:"uncheck",value:t}),i&&_e(i,e),l.value=e,r(),a())}else o?(c&&_e(c,[t],{actionType:"check",value:t}),d&&_e(d,[t],{actionType:"check",value:t}),i&&_e(i,[t]),l.value=[t],r(),a()):(c&&_e(c,[],{actionType:"uncheck",value:t}),d&&_e(d,[],{actionType:"uncheck",value:t}),i&&_e(i,[]),l.value=[],r(),a())}}),{mergedClsPrefix:o}},render(){return u("div",{class:`${this.mergedClsPrefix}-checkbox-group`,role:"group"},this.$slots)}}),wi=lo([to("checkbox","\n font-size: var(--n-font-size);\n outline: none;\n cursor: pointer;\n display: inline-flex;\n flex-wrap: nowrap;\n align-items: flex-start;\n word-break: break-word;\n line-height: var(--n-size);\n --n-merged-color-table: var(--n-color-table);\n ",[Lo("show-label","line-height: var(--n-label-line-height);"),lo("&:hover",[to("checkbox-box",[Fo("border","border: var(--n-border-checked);")])]),lo("&:focus:not(:active)",[to("checkbox-box",[Fo("border","\n border: var(--n-border-focus);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),Lo("inside-table",[to("checkbox-box","\n background-color: var(--n-merged-color-table);\n ")]),Lo("checked",[to("checkbox-box","\n background-color: var(--n-color-checked);\n ",[to("checkbox-icon",[lo(".check-icon","\n opacity: 1;\n transform: scale(1);\n ")])])]),Lo("indeterminate",[to("checkbox-box",[to("checkbox-icon",[lo(".check-icon","\n opacity: 0;\n transform: scale(.5);\n "),lo(".line-icon","\n opacity: 1;\n transform: scale(1);\n ")])])]),Lo("checked, indeterminate",[lo("&:focus:not(:active)",[to("checkbox-box",[Fo("border","\n border: var(--n-border-checked);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),to("checkbox-box","\n background-color: var(--n-color-checked);\n border-left: 0;\n border-top: 0;\n ",[Fo("border",{border:"var(--n-border-checked)"})])]),Lo("disabled",{cursor:"not-allowed"},[Lo("checked",[to("checkbox-box","\n background-color: var(--n-color-disabled-checked);\n ",[Fo("border",{border:"var(--n-border-disabled-checked)"}),to("checkbox-icon",[lo(".check-icon, .line-icon",{fill:"var(--n-check-mark-color-disabled-checked)"})])])]),to("checkbox-box","\n background-color: var(--n-color-disabled);\n ",[Fo("border","\n border: var(--n-border-disabled);\n "),to("checkbox-icon",[lo(".check-icon, .line-icon","\n fill: var(--n-check-mark-color-disabled);\n ")])]),Fo("label","\n color: var(--n-text-color-disabled);\n ")]),to("checkbox-box-wrapper","\n position: relative;\n width: var(--n-size);\n flex-shrink: 0;\n flex-grow: 0;\n user-select: none;\n -webkit-user-select: none;\n "),to("checkbox-box","\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n height: var(--n-size);\n width: var(--n-size);\n display: inline-block;\n box-sizing: border-box;\n border-radius: var(--n-border-radius);\n background-color: var(--n-color);\n transition: background-color 0.3s var(--n-bezier);\n ",[Fo("border","\n transition:\n border-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n border-radius: inherit;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border: var(--n-border);\n "),to("checkbox-icon","\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n left: 1px;\n right: 1px;\n top: 1px;\n bottom: 1px;\n ",[lo(".check-icon, .line-icon","\n width: 100%;\n fill: var(--n-check-mark-color);\n opacity: 0;\n transform: scale(0.5);\n transform-origin: center;\n transition:\n fill 0.3s var(--n-bezier),\n transform 0.3s var(--n-bezier),\n opacity 0.3s var(--n-bezier),\n border-color 0.3s var(--n-bezier);\n "),Te({left:"1px",top:"1px"})])]),Fo("label","\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n user-select: none;\n -webkit-user-select: none;\n padding: var(--n-label-padding);\n font-weight: var(--n-label-font-weight);\n ",[lo("&:empty",{display:"none"})])]),Be(to("checkbox","\n --n-merged-color-table: var(--n-color-table-modal);\n ")),he(to("checkbox","\n --n-merged-color-table: var(--n-color-table-popover);\n "))]),Si=e({name:"Checkbox",props:Object.assign(Object.assign({},Ie.props),{size:String,checked:{type:[Boolean,String,Number],default:void 0},defaultChecked:{type:[Boolean,String,Number],default:!1},value:[String,Number],disabled:{type:Boolean,default:void 0},indeterminate:Boolean,label:String,focusable:{type:Boolean,default:!0},checkedValue:{type:[Boolean,String,Number],default:!0},uncheckedValue:{type:[Boolean,String,Number],default:!1},"onUpdate:checked":[Function,Array],onUpdateChecked:[Function,Array],privateInsideTable:Boolean,onChange:[Function,Array]}),setup(e){const o=p(xi,null),n=J(null),{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:a}=ro(e),l=J(e.defaultChecked),i=z(e,"checked"),s=Me(i,l),d=de(()=>{if(o){const n=o.valueSetRef.value;return!(!n||void 0===e.value)&&n.has(e.value)}return s.value===e.checkedValue}),c=mo(e,{mergedSize(n){const{size:t}=e;if(void 0!==t)return t;if(o){const{value:e}=o.mergedSizeRef;if(void 0!==e)return e}if(n){const{mergedSize:e}=n;if(void 0!==e)return e.value}return"medium"},mergedDisabled(n){const{disabled:t}=e;if(void 0!==t)return t;if(o){if(o.disabledRef.value)return!0;const{maxRef:{value:e},checkedCountRef:n}=o;if(void 0!==e&&n.value>=e&&!d.value)return!0;const{minRef:{value:t}}=o;if(void 0!==t&&n.value<=t&&d.value)return!0}return!!n&&n.disabled.value}}),{mergedDisabledRef:u,mergedSizeRef:h}=c,f=Ie("Checkbox","-checkbox",wi,kn,e,t);function m(n){if(o&&void 0!==e.value)o.toggleCheckbox(!d.value,e.value);else{const{onChange:o,"onUpdate:checked":t,onUpdateChecked:r}=e,{nTriggerFormInput:a,nTriggerFormChange:i}=c,s=d.value?e.uncheckedValue:e.checkedValue;t&&_e(t,s,n),r&&_e(r,s,n),o&&_e(o,s,n),a(),i(),l.value=s}}const v={focus:()=>{var e;null===(e=n.value)||void 0===e||e.focus()},blur:()=>{var e;null===(e=n.value)||void 0===e||e.blur()}},g=Ce("Checkbox",a,t),b=I(()=>{const{value:e}=h,{common:{cubicBezierEaseInOut:o},self:{borderRadius:n,color:t,colorChecked:r,colorDisabled:a,colorTableHeader:l,colorTableHeaderModal:i,colorTableHeaderPopover:s,checkMarkColor:d,checkMarkColorDisabled:c,border:u,borderFocus:p,borderDisabled:m,borderChecked:v,boxShadowFocus:g,textColor:b,textColorDisabled:y,checkMarkColorDisabledChecked:x,colorDisabledChecked:C,borderDisabledChecked:w,labelPadding:S,labelLineHeight:k,labelFontWeight:P,[Eo("fontSize",e)]:I,[Eo("size",e)]:T}}=f.value;return{"--n-label-line-height":k,"--n-label-font-weight":P,"--n-size":T,"--n-bezier":o,"--n-border-radius":n,"--n-border":u,"--n-border-checked":v,"--n-border-focus":p,"--n-border-disabled":m,"--n-border-disabled-checked":w,"--n-box-shadow-focus":g,"--n-color":t,"--n-color-checked":r,"--n-color-table":l,"--n-color-table-modal":i,"--n-color-table-popover":s,"--n-color-disabled":a,"--n-color-disabled-checked":C,"--n-text-color":b,"--n-text-color-disabled":y,"--n-check-mark-color":d,"--n-check-mark-color-disabled":c,"--n-check-mark-color-disabled-checked":x,"--n-font-size":I,"--n-label-padding":S}}),y=r?io("checkbox",I(()=>h.value[0]),b,e):void 0;return Object.assign(c,v,{rtlEnabled:g,selfRef:n,mergedClsPrefix:t,mergedDisabled:u,renderedChecked:d,mergedTheme:f,labelId:ko(),handleClick:function(e){u.value||m(e)},handleKeyUp:function(e){if(!u.value)switch(e.key){case" ":case"Enter":m(e)}},handleKeyDown:function(e){if(" "===e.key)e.preventDefault()},cssVars:r?void 0:b,themeClass:null==y?void 0:y.themeClass,onRender:null==y?void 0:y.onRender})},render(){var e;const{$slots:o,renderedChecked:n,mergedDisabled:t,indeterminate:r,privateInsideTable:a,cssVars:l,labelId:i,label:s,mergedClsPrefix:d,focusable:c,handleKeyUp:p,handleKeyDown:h,handleClick:f}=this;null===(e=this.onRender)||void 0===e||e.call(this);const m=fe(o.default,e=>s||e?u("span",{class:`${d}-checkbox__label`,id:i},s||e):null);return u("div",{ref:"selfRef",class:[`${d}-checkbox`,this.themeClass,this.rtlEnabled&&`${d}-checkbox--rtl`,n&&`${d}-checkbox--checked`,t&&`${d}-checkbox--disabled`,r&&`${d}-checkbox--indeterminate`,a&&`${d}-checkbox--inside-table`,m&&`${d}-checkbox--show-label`],tabindex:t||!c?void 0:0,role:"checkbox","aria-checked":r?"mixed":n,"aria-labelledby":i,style:l,onKeyup:p,onKeydown:h,onClick:f,onMousedown:()=>{go("selectstart",window,e=>{e.preventDefault()},{once:!0})}},u("div",{class:`${d}-checkbox-box-wrapper`}," ",u("div",{class:`${d}-checkbox-box`},u(ce,null,{default:()=>this.indeterminate?u("div",{key:"indeterminate",class:`${d}-checkbox-icon`},u("svg",{viewBox:"0 0 100 100",class:"line-icon"},u("path",{d:"M80.2,55.5H21.4c-2.8,0-5.1-2.5-5.1-5.5l0,0c0-3,2.3-5.5,5.1-5.5h58.7c2.8,0,5.1,2.5,5.1,5.5l0,0C85.2,53.1,82.9,55.5,80.2,55.5z"}))):u("div",{key:"check",class:`${d}-checkbox-icon`},u("svg",{viewBox:"0 0 64 64",class:"check-icon"},u("path",{d:"M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51 c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92 C54.13,15.78,51.93,15.55,50.42,16.76z"})))}),u("div",{class:`${d}-checkbox-box__border`}))),m)}}),ki={name:"Code",common:Pa,self(e){const{textColor2:o,fontSize:n,fontWeightStrong:t,textColor3:r}=e;return{textColor:o,fontSize:n,fontWeightStrong:t,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:r}}};var Pi={name:"Code",common:pe,self:function(e){const{textColor2:o,fontSize:n,fontWeightStrong:t,textColor3:r}=e;return{textColor:o,fontSize:n,fontWeightStrong:t,"mono-3":"#a0a1a7","hue-1":"#0184bb","hue-2":"#4078f2","hue-3":"#a626a4","hue-4":"#50a14f","hue-5":"#e45649","hue-5-2":"#c91243","hue-6":"#986801","hue-6-2":"#c18401",lineNumberTextColor:r}}};function Ii(e){const{fontWeight:o,textColor1:n,textColor2:t,textColorDisabled:r,dividerColor:a,fontSize:l}=e;return{titleFontSize:l,titleFontWeight:o,dividerColor:a,titleTextColor:n,titleTextColorDisabled:r,fontSize:l,textColor:t,arrowColor:t,arrowColorDisabled:r,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}}var Ti={name:"Collapse",common:pe,self:Ii},Ai={name:"Collapse",common:Pa,self:Ii};function zi(e){const{cubicBezierEaseInOut:o}=e;return{bezier:o}}var Ri={name:"CollapseTransition",common:pe,self:zi},Mi={name:"CollapseTransition",common:Pa,self:zi};function Fi(e){const{fontSize:o,boxShadow2:n,popoverColor:t,textColor2:r,borderRadius:a,borderColor:l,heightSmall:i,heightMedium:s,heightLarge:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:p,dividerColor:h}=e;return{panelFontSize:o,boxShadow:n,color:t,textColor:r,borderRadius:a,border:`1px solid ${l}`,heightSmall:i,heightMedium:s,heightLarge:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:p,dividerColor:h}}var Oi=ke({name:"ColorPicker",common:pe,peers:{Input:un,Button:ho},self:Fi}),Bi={name:"ColorPicker",common:Pa,peers:{Input:Al,Button:ii},self:Fi},$i=e({name:"ConfigProvider",alias:["App"],props:{abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,styleMountTarget:Object,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(Ae("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},setup(e){const o=p(Ke,null),n=I(()=>{const{theme:n}=e;if(null===n)return;const t=null==o?void 0:o.mergedThemeRef.value;return void 0===n?t:void 0===t?n:Object.assign({},t,n)}),t=I(()=>{const{themeOverrides:n}=e;if(null!==n){if(void 0===n)return null==o?void 0:o.mergedThemeOverridesRef.value;{const e=null==o?void 0:o.mergedThemeOverridesRef.value;return void 0===e?n:Fe({},e,n)}}}),r=de(()=>{const{namespace:n}=e;return void 0===n?null==o?void 0:o.mergedNamespaceRef.value:n}),l=de(()=>{const{bordered:n}=e;return void 0===n?null==o?void 0:o.mergedBorderedRef.value:n}),i=I(()=>{const{icons:n}=e;return void 0===n?null==o?void 0:o.mergedIconsRef.value:n}),s=I(()=>{const{componentOptions:n}=e;return void 0!==n?n:null==o?void 0:o.mergedComponentPropsRef.value}),d=I(()=>{const{clsPrefix:n}=e;return void 0!==n?n:o?o.mergedClsPrefixRef.value:"n"}),c=I(()=>{var n;const{rtl:t}=e;if(void 0===t)return null==o?void 0:o.mergedRtlRef.value;const r={};for(const e of t)r[e.name]=G(e),null===(n=e.peers)||void 0===n||n.forEach(e=>{e.name in r||(r[e.name]=G(e))});return r}),u=I(()=>e.breakpoints||(null==o?void 0:o.mergedBreakpointsRef.value)),h=e.inlineThemeDisabled||(null==o?void 0:o.inlineThemeDisabled),f=e.preflightStyleDisabled||(null==o?void 0:o.preflightStyleDisabled),m=e.styleMountTarget||(null==o?void 0:o.styleMountTarget),v=I(()=>{const{value:e}=n,{value:o}=t,r=o&&0!==Object.keys(o).length,a=null==e?void 0:e.name;return a?r?`${a}-${De(JSON.stringify(t.value))}`:a:r?De(JSON.stringify(t.value)):""});return a(Ke,{mergedThemeHashRef:v,mergedBreakpointsRef:u,mergedRtlRef:c,mergedIconsRef:i,mergedComponentPropsRef:s,mergedBorderedRef:l,mergedNamespaceRef:r,mergedClsPrefixRef:d,mergedLocaleRef:I(()=>{const{locale:n}=e;if(null!==n)return void 0===n?null==o?void 0:o.mergedLocaleRef.value:n}),mergedDateLocaleRef:I(()=>{const{dateLocale:n}=e;if(null!==n)return void 0===n?null==o?void 0:o.mergedDateLocaleRef.value:n}),mergedHljsRef:I(()=>{const{hljs:n}=e;return void 0===n?null==o?void 0:o.mergedHljsRef.value:n}),mergedKatexRef:I(()=>{const{katex:n}=e;return void 0===n?null==o?void 0:o.mergedKatexRef.value:n}),mergedThemeRef:n,mergedThemeOverridesRef:t,inlineThemeDisabled:h||!1,preflightStyleDisabled:f||!1,styleMountTarget:m}),{mergedClsPrefix:d,mergedBordered:l,mergedNamespace:r,mergedTheme:n,mergedThemeOverrides:t}},render(){var e,o,n,t;return this.abstract?null===(t=(n=this.$slots).default)||void 0===t?void 0:t.call(n):u(this.as||this.tag,{class:`${this.mergedClsPrefix||"n"}-config-provider`},null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e))}}),Ei={name:"Popselect",common:Pa,peers:{Popover:rl,InternalSelectMenu:Qa}};var Di=ke({name:"Popselect",common:pe,peers:{Popover:pn,InternalSelectMenu:nn},self:function(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}}),_i={name:"Select",common:Pa,peers:{InternalSelection:pl,InternalSelectMenu:Qa},self:Zo},Li=lo([to("select","\n z-index: auto;\n outline: none;\n width: 100%;\n position: relative;\n font-weight: var(--n-font-weight);\n "),to("select-menu","\n margin: 4px 0;\n box-shadow: var(--n-menu-box-shadow);\n ",[tn({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),Hi=e({name:"Select",props:Object.assign(Object.assign({},Ie.props),{to:ln.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),slots:Object,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:n,namespaceRef:t,inlineThemeDisabled:r}=ro(e),a=Ie("Select","-select",Li,rn,e,o),l=J(e.defaultValue),i=z(e,"value"),s=Me(i,l),d=J(!1),c=J(""),u=je(e,["items","options"]),p=J([]),h=J([]),f=I(()=>h.value.concat(p.value).concat(u.value)),m=I(()=>{const{filter:o}=e;if(o)return o;const{labelField:n,valueField:t}=e;return(e,o)=>{if(!o)return!1;const r=o[n];if("string"==typeof r)return _l(e,r);const a=o[t];return"string"==typeof a?_l(e,a):"number"==typeof a&&_l(e,String(a))}}),v=I(()=>{if(e.remote)return u.value;{const{value:o}=f,{value:n}=c;return n.length&&e.filterable?function(e,o,n,t){return o?function e(r){if(!Array.isArray(r))return[];const a=[];for(const l of r)if(El(l)){const o=e(l[t]);o.length&&a.push(Object.assign({},l,{[t]:o}))}else{if(Dl(l))continue;o(n,l)&&a.push(l)}return a}(e):e}(o,m.value,n,e.childrenField):o}}),g=I(()=>{const{valueField:o,childrenField:n}=e,t=Ll(o,n);return Ja(v.value,t)}),b=I(()=>function(e,o,n){const t=new Map;return e.forEach(e=>{El(e)?e[n].forEach(e=>{t.set(e[o],e)}):t.set(e[o],e)}),t}(f.value,e.valueField,e.childrenField)),y=J(!1),x=Me(z(e,"show"),y),w=J(null),S=J(null),k=J(null),{localeRef:P}=we("Select"),T=I(()=>{var o;return null!==(o=e.placeholder)&&void 0!==o?o:P.value.placeholder}),A=[],R=J(new Map),M=I(()=>{const{fallbackOption:o}=e;if(void 0===o){const{labelField:o,valueField:n}=e;return e=>({[o]:String(e),[n]:e})}return!1!==o&&(e=>Object.assign(o(e),{value:e}))});function F(o){const n=e.remote,{value:t}=R,{value:r}=b,{value:a}=M,l=[];return o.forEach(e=>{if(r.has(e))l.push(r.get(e));else if(n&&t.has(e))l.push(t.get(e));else if(a){const o=a(e);o&&l.push(o)}}),l}const O=I(()=>{if(e.multiple){const{value:e}=s;return Array.isArray(e)?F(e):[]}return null}),B=I(()=>{const{value:o}=s;return e.multiple||Array.isArray(o)||null===o?null:F([o])[0]||null}),$=mo(e),{mergedSizeRef:E,mergedDisabledRef:D,mergedStatusRef:_}=$;function L(o,n){const{onChange:t,"onUpdate:value":r,onUpdateValue:a}=e,{nTriggerFormChange:i,nTriggerFormInput:s}=$;t&&_e(t,o,n),a&&_e(a,o,n),r&&_e(r,o,n),l.value=o,i(),s()}function H(o){const{onBlur:n}=e,{nTriggerFormBlur:t}=$;n&&_e(n,o),t()}function j(){var o;const{remote:n,multiple:t}=e;if(n){const{value:n}=R;if(t){const{valueField:t}=e;null===(o=O.value)||void 0===o||o.forEach(e=>{n.set(e[t],e)})}else{const o=B.value;o&&n.set(o[e.valueField],o)}}}function U(o){const{onUpdateShow:n,"onUpdate:show":t}=e;n&&_e(n,o),t&&_e(t,o),y.value=o}function W(){D.value||(U(!0),y.value=!0,e.filterable&&Q())}function N(){U(!1)}function K(){c.value="",h.value=A}const V=J(!1);function q(e){G(e.rawNode)}function G(o){if(D.value)return;const{tag:n,remote:t,clearFilterAfterSelect:r,valueField:a}=e;if(n&&!t){const{value:e}=h,o=e[0]||null;if(o){const e=p.value;e.length?e.push(o):p.value=[o],h.value=A}}if(t&&R.value.set(o[a],o),e.multiple){const l=function(o){if(!Array.isArray(o))return[];if(M.value)return Array.from(o);{const{remote:n}=e,{value:t}=b;if(n){const{value:e}=R;return o.filter(o=>t.has(o)||e.has(o))}return o.filter(e=>t.has(e))}}(s.value),i=l.findIndex(e=>e===o[a]);if(~i){if(l.splice(i,1),n&&!t){const e=Y(o[a]);~e&&(p.value.splice(e,1),r&&(c.value=""))}}else l.push(o[a]),r&&(c.value="");L(l,F(l))}else{if(n&&!t){const e=Y(o[a]);p.value=~e?[p.value[e]]:A}X(),N(),L(o[a],o)}}function Y(o){return p.value.findIndex(n=>n[e.valueField]===o)}function Z(o){var n,t,r,a,l;if(e.keyboard)switch(o.key){case" ":if(e.filterable)break;o.preventDefault();case"Enter":if(!(null===(n=w.value)||void 0===n?void 0:n.isComposing))if(x.value){const o=null===(t=k.value)||void 0===t?void 0:t.getPendingTmNode();o?q(o):e.filterable||(N(),X())}else if(W(),e.tag&&V.value){const o=h.value[0];if(o){const n=o[e.valueField],{value:t}=s;e.multiple&&Array.isArray(t)&&t.includes(n)||G(o)}}o.preventDefault();break;case"ArrowUp":if(o.preventDefault(),e.loading)return;x.value&&(null===(r=k.value)||void 0===r||r.prev());break;case"ArrowDown":if(o.preventDefault(),e.loading)return;x.value?null===(a=k.value)||void 0===a||a.next():W();break;case"Escape":x.value&&(ue(o),N()),null===(l=w.value)||void 0===l||l.focus()}else o.preventDefault()}function X(){var e;null===(e=w.value)||void 0===e||e.focus()}function Q(){var e;null===(e=w.value)||void 0===e||e.focusInput()}j(),C(z(e,"options"),j);const ee={focus:()=>{var e;null===(e=w.value)||void 0===e||e.focus()},focusInput:()=>{var e;null===(e=w.value)||void 0===e||e.focusInput()},blur:()=>{var e;null===(e=w.value)||void 0===e||e.blur()},blurInput:()=>{var e;null===(e=w.value)||void 0===e||e.blurInput()}},oe=I(()=>{const{self:{menuBoxShadow:e}}=a.value;return{"--n-menu-box-shadow":e}}),ne=r?io("select",void 0,oe,e):void 0;return Object.assign(Object.assign({},ee),{mergedStatus:_,mergedClsPrefix:o,mergedBordered:n,namespace:t,treeMate:g,isMounted:We(),triggerRef:w,menuRef:k,pattern:c,uncontrolledShow:y,mergedShow:x,adjustedTo:ln(e),uncontrolledValue:l,mergedValue:s,followerRef:S,localizedPlaceholder:T,selectedOption:B,selectedOptions:O,mergedSize:E,mergedDisabled:D,focused:d,activeWithoutMenuOpen:V,inlineThemeDisabled:r,onTriggerInputFocus:function(){e.filterable&&(V.value=!0)},onTriggerInputBlur:function(){e.filterable&&(V.value=!1,x.value||K())},handleTriggerOrMenuResize:function(){var e;x.value&&(null===(e=S.value)||void 0===e||e.syncPosition())},handleMenuFocus:function(){d.value=!0},handleMenuBlur:function(e){var o;(null===(o=w.value)||void 0===o?void 0:o.$el.contains(e.relatedTarget))||(d.value=!1,H(e),N())},handleMenuTabOut:function(){var e;null===(e=w.value)||void 0===e||e.focus(),N()},handleTriggerClick:function(){D.value||(x.value?e.filterable?Q():N():W())},handleToggle:q,handleDeleteOption:G,handlePatternInput:function(o){x.value||W();const{value:n}=o.target;c.value=n;const{tag:t,remote:r}=e;if(function(o){const{onSearch:n}=e;n&&_e(n,o)}(n),t&&!r){if(!n)return void(h.value=A);const{onCreate:o}=e,t=o?o(n):{[e.labelField]:n,[e.valueField]:n},{valueField:r,labelField:a}=e;u.value.some(e=>e[r]===t[r]||e[a]===t[a])||p.value.some(e=>e[r]===t[r]||e[a]===t[a])?h.value=A:h.value=[t]}},handleClear:function(o){o.stopPropagation();const{multiple:n}=e;!n&&e.filterable&&N(),function(){const{onClear:o}=e;o&&_e(o)}(),n?L([],[]):L(null,null)},handleTriggerBlur:function(e){var o,n;(null===(n=null===(o=k.value)||void 0===o?void 0:o.selfRef)||void 0===n?void 0:n.contains(e.relatedTarget))||(d.value=!1,H(e),N())},handleTriggerFocus:function(o){!function(o){const{onFocus:n,showOnFocus:t}=e,{nTriggerFormFocus:r}=$;n&&_e(n,o),r(),t&&W()}(o),d.value=!0},handleKeydown:Z,handleMenuAfterLeave:K,handleMenuClickOutside:function(e){var o;x.value&&((null===(o=w.value)||void 0===o?void 0:o.$el.contains(xo(e)))||N())},handleMenuScroll:function(o){!function(o){const{onScroll:n}=e;n&&_e(n,o)}(o)},handleMenuKeydown:Z,handleMenuMousedown:function(e){Vt(e,"action")||Vt(e,"empty")||Vt(e,"header")||e.preventDefault()},mergedTheme:a,cssVars:r?void 0:oe,themeClass:null==ne?void 0:ne.themeClass,onRender:null==ne?void 0:ne.onRender})},render(){return u("div",{class:`${this.mergedClsPrefix}-select`},u(qo,null,{default:()=>[u(Wo,null,{default:()=>u(fl,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,o;return[null===(o=(e=this.$slots).arrow)||void 0===o?void 0:o.call(e)]}})}),u(bn,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===ln.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>u(L,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,o,n;return this.mergedShow||"show"===this.displayDirective?(null===(e=this.onRender)||void 0===e||e.call(this),Z(u(tl,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,null===(o=this.menuProps)||void 0===o?void 0:o.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[null===(n=this.menuProps)||void 0===n?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var e,o;return[null===(o=(e=this.$slots).empty)||void 0===o?void 0:o.call(e)]},header:()=>{var e,o;return[null===(o=(e=this.$slots).header)||void 0===o?void 0:o.call(e)]},action:()=>{var e,o;return[null===(o=(e=this.$slots).action)||void 0===o?void 0:o.call(e)]}}),"show"===this.displayDirective?[[M,this.mergedShow],[Ho,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Ho,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),ji={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"};function Ui(e){const{textColor2:o,primaryColor:n,primaryColorHover:t,primaryColorPressed:r,inputColorDisabled:a,textColorDisabled:l,borderColor:i,borderRadius:s,fontSizeTiny:d,fontSizeSmall:c,fontSizeMedium:u,heightTiny:p,heightSmall:h,heightMedium:f}=e;return Object.assign(Object.assign({},ji),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${i}`,buttonBorderHover:`1px solid ${i}`,buttonBorderPressed:`1px solid ${i}`,buttonIconColor:o,buttonIconColorHover:o,buttonIconColorPressed:o,itemTextColor:o,itemTextColorHover:t,itemTextColorPressed:r,itemTextColorActive:n,itemTextColorDisabled:l,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:a,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${n}`,itemBorderDisabled:`1px solid ${i}`,itemBorderRadius:s,itemSizeSmall:p,itemSizeMedium:h,itemSizeLarge:f,itemFontSizeSmall:d,itemFontSizeMedium:c,itemFontSizeLarge:u,jumperFontSizeSmall:d,jumperFontSizeMedium:c,jumperFontSizeLarge:u,jumperTextColor:o,jumperTextColorDisabled:l})}var Wi=ke({name:"Pagination",common:pe,peers:{Select:rn,Input:un,Popselect:Di},self:Ui}),Ni={name:"Pagination",common:Pa,peers:{Select:_i,Input:Al,Popselect:Ei},self(e){const{primaryColor:o,opacity3:n}=e,t=qe(o,{alpha:Number(n)}),r=Ui(e);return r.itemBorderActive=`1px solid ${t}`,r.itemBorderDisabled="1px solid #0000",r}},Ki={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};function Vi(e){const{primaryColor:o,textColor2:n,dividerColor:t,hoverColor:r,popoverColor:a,invertedColor:l,borderRadius:i,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,fontSizeHuge:u,heightSmall:p,heightMedium:h,heightLarge:f,heightHuge:m,textColor3:v,opacityDisabled:g}=e;return Object.assign(Object.assign({},Ki),{optionHeightSmall:p,optionHeightMedium:h,optionHeightLarge:f,optionHeightHuge:m,borderRadius:i,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,fontSizeHuge:u,optionTextColor:n,optionTextColorHover:n,optionTextColorActive:o,optionTextColorChildActive:o,color:a,dividerColor:t,suffixColor:n,prefixColor:n,optionColorHover:r,optionColorActive:qe(o,{alpha:.1}),groupHeaderTextColor:v,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:l,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:o,optionColorActiveInverted:o,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:g})}var qi=ke({name:"Dropdown",common:pe,peers:{Popover:pn},self:Vi}),Gi={name:"Dropdown",common:Pa,peers:{Popover:rl},self(e){const{primaryColorSuppl:o,primaryColor:n,popoverColor:t}=e,r=Vi(e);return r.colorInverted=t,r.optionColorActive=qe(n,{alpha:.15}),r.optionColorActiveInverted=o,r.optionColorHoverInverted=o,r}},Ji={padding:"8px 14px"},Yi={name:"Tooltip",common:Pa,peers:{Popover:rl},self(e){const{borderRadius:o,boxShadow2:n,popoverColor:t,textColor2:r}=e;return Object.assign(Object.assign({},Ji),{borderRadius:o,boxShadow:n,color:t,textColor:r})}};var Zi=ke({name:"Tooltip",common:pe,peers:{Popover:pn},self:function(e){const{borderRadius:o,boxShadow2:n,baseColor:t}=e;return Object.assign(Object.assign({},Ji),{borderRadius:o,boxShadow:n,color:yo(t,"rgba(0, 0, 0, .85)"),textColor:t})}}),Xi={name:"Ellipsis",common:Pa,peers:{Tooltip:Yi}},Qi=ke({name:"Ellipsis",common:pe,peers:{Tooltip:Zi}}),es={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},os={name:"Radio",common:Pa,self(e){const{borderColor:o,primaryColor:n,baseColor:t,textColorDisabled:r,inputColorDisabled:a,textColor2:l,opacityDisabled:i,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,heightSmall:p,heightMedium:h,heightLarge:f,lineHeight:m}=e;return Object.assign(Object.assign({},es),{labelLineHeight:m,buttonHeightSmall:p,buttonHeightMedium:h,buttonHeightLarge:f,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${n}`,boxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${qe(n,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${n}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:"#0000",colorDisabled:a,colorActive:"#0000",textColor:l,textColorDisabled:r,dotColorActive:n,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:n,buttonBorderColorHover:n,buttonColor:"#0000",buttonColorActive:n,buttonTextColor:l,buttonTextColorActive:t,buttonTextColorHover:n,opacityDisabled:i,buttonBoxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${qe(n,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${n}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}};var ns={name:"Radio",common:pe,self:function(e){const{borderColor:o,primaryColor:n,baseColor:t,textColorDisabled:r,inputColorDisabled:a,textColor2:l,opacityDisabled:i,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,heightSmall:p,heightMedium:h,heightLarge:f,lineHeight:m}=e;return Object.assign(Object.assign({},es),{labelLineHeight:m,buttonHeightSmall:p,buttonHeightMedium:h,buttonHeightLarge:f,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${n}`,boxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${qe(n,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${n}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:t,colorDisabled:a,colorActive:"#0000",textColor:l,textColorDisabled:r,dotColorActive:n,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:n,buttonBorderColorHover:o,buttonColor:t,buttonColorActive:t,buttonTextColor:l,buttonTextColorActive:n,buttonTextColorHover:n,opacityDisabled:i,buttonBoxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${qe(n,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}},ts={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"};function rs(e){const{cardColor:o,modalColor:n,popoverColor:t,textColor2:r,textColor1:a,tableHeaderColor:l,tableColorHover:i,iconColor:s,primaryColor:d,fontWeightStrong:c,borderRadius:u,lineHeight:p,fontSizeSmall:h,fontSizeMedium:f,fontSizeLarge:m,dividerColor:v,heightSmall:g,opacityDisabled:b,tableColorStriped:y}=e;return Object.assign(Object.assign({},ts),{actionDividerColor:v,lineHeight:p,borderRadius:u,fontSizeSmall:h,fontSizeMedium:f,fontSizeLarge:m,borderColor:yo(o,v),tdColorHover:yo(o,i),tdColorSorting:yo(o,i),tdColorStriped:yo(o,y),thColor:yo(o,l),thColorHover:yo(yo(o,l),i),thColorSorting:yo(yo(o,l),i),tdColor:o,tdTextColor:r,thTextColor:a,thFontWeight:c,thButtonColorHover:i,thIconColor:s,thIconColorActive:d,borderColorModal:yo(n,v),tdColorHoverModal:yo(n,i),tdColorSortingModal:yo(n,i),tdColorStripedModal:yo(n,y),thColorModal:yo(n,l),thColorHoverModal:yo(yo(n,l),i),thColorSortingModal:yo(yo(n,l),i),tdColorModal:n,borderColorPopover:yo(t,v),tdColorHoverPopover:yo(t,i),tdColorSortingPopover:yo(t,i),tdColorStripedPopover:yo(t,y),thColorPopover:yo(t,l),thColorHoverPopover:yo(yo(t,l),i),thColorSortingPopover:yo(yo(t,l),i),tdColorPopover:t,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:d,loadingSize:g,opacityLoading:b})}var as=ke({name:"DataTable",common:pe,peers:{Button:ho,Checkbox:kn,Radio:ns,Pagination:Wi,Scrollbar:$o,Empty:Ne,Popover:pn,Ellipsis:Qi,Dropdown:qi},self:rs}),ls={name:"DataTable",common:Pa,peers:{Button:ii,Checkbox:vi,Radio:os,Pagination:Ni,Scrollbar:Ia,Empty:Ya,Popover:rl,Ellipsis:Xi,Dropdown:Gi},self(e){const o=rs(e);return o.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",o.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",o}},is=to("radio","\n line-height: var(--n-label-line-height);\n outline: none;\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n display: inline-flex;\n align-items: flex-start;\n flex-wrap: nowrap;\n font-size: var(--n-font-size);\n word-break: break-word;\n",[Lo("checked",[Fo("dot","\n background-color: var(--n-color-active);\n ")]),Fo("dot-wrapper","\n position: relative;\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--n-radio-size);\n "),to("radio-input","\n position: absolute;\n border: 0;\n width: 0;\n height: 0;\n opacity: 0;\n margin: 0;\n "),Fo("dot","\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: var(--n-radio-size);\n width: var(--n-radio-size);\n background: var(--n-color);\n box-shadow: var(--n-box-shadow);\n border-radius: 50%;\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n ",[lo("&::before",'\n content: "";\n opacity: 0;\n position: absolute;\n left: 4px;\n top: 4px;\n height: calc(100% - 8px);\n width: calc(100% - 8px);\n border-radius: 50%;\n transform: scale(.8);\n background: var(--n-dot-color-active);\n transition: \n opacity .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n transform .3s var(--n-bezier);\n '),Lo("checked",{boxShadow:"var(--n-box-shadow-active)"},[lo("&::before","\n opacity: 1;\n transform: scale(1);\n ")])]),Fo("label","\n color: var(--n-text-color);\n padding: var(--n-label-padding);\n font-weight: var(--n-label-font-weight);\n display: inline-block;\n transition: color .3s var(--n-bezier);\n "),Je("disabled","\n cursor: pointer;\n ",[lo("&:hover",[Fo("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),Lo("focus",[lo("&:not(:active)",[Fo("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),Lo("disabled","\n cursor: not-allowed;\n ",[Fo("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[lo("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),Lo("checked","\n opacity: 1;\n ")]),Fo("label",{color:"var(--n-text-color-disabled)"}),to("radio-input","\n cursor: not-allowed;\n ")])]),ss={name:String,value:{type:[String,Number,Boolean],default:"on"},checked:{type:Boolean,default:void 0},defaultChecked:Boolean,disabled:{type:Boolean,default:void 0},label:String,size:String,onUpdateChecked:[Function,Array],"onUpdate:checked":[Function,Array],checkedValue:{type:Boolean,default:void 0}},ds=Ue("n-radio-group");function cs(e){const o=p(ds,null),n=mo(e,{mergedSize(n){const{size:t}=e;if(void 0!==t)return t;if(o){const{mergedSizeRef:{value:e}}=o;if(void 0!==e)return e}return n?n.mergedSize.value:"medium"},mergedDisabled:n=>!!e.disabled||(!!(null==o?void 0:o.disabledRef.value)||!!(null==n?void 0:n.disabled.value))}),{mergedSizeRef:t,mergedDisabledRef:r}=n,a=J(null),l=J(null),i=J(e.defaultChecked),s=z(e,"checked"),d=Me(s,i),c=de(()=>o?o.valueRef.value===e.value:d.value),u=de(()=>{const{name:n}=e;return void 0!==n?n:o?o.nameRef.value:void 0}),h=J(!1);function f(){r.value||c.value||function(){if(o){const{doUpdateValue:n}=o,{value:t}=e;_e(n,t)}else{const{onUpdateChecked:o,"onUpdate:checked":t}=e,{nTriggerFormInput:r,nTriggerFormChange:a}=n;o&&_e(o,!0),t&&_e(t,!0),r(),a(),i.value=!0}}()}return{mergedClsPrefix:o?o.mergedClsPrefixRef:ro(e).mergedClsPrefixRef,inputRef:a,labelRef:l,mergedName:u,mergedDisabled:r,renderSafeChecked:c,focus:h,mergedSize:t,handleRadioInputChange:function(){f(),a.value&&(a.value.checked=c.value)},handleRadioInputBlur:function(){h.value=!1},handleRadioInputFocus:function(){h.value=!0}}}var us=e({name:"Radio",props:Object.assign(Object.assign({},Ie.props),ss),setup(e){const o=cs(e),n=Ie("Radio","-radio",is,ns,e,o.mergedClsPrefix),t=I(()=>{const{mergedSize:{value:e}}=o,{common:{cubicBezierEaseInOut:t},self:{boxShadow:r,boxShadowActive:a,boxShadowDisabled:l,boxShadowFocus:i,boxShadowHover:s,color:d,colorDisabled:c,colorActive:u,textColor:p,textColorDisabled:h,dotColorActive:f,dotColorDisabled:m,labelPadding:v,labelLineHeight:g,labelFontWeight:b,[Eo("fontSize",e)]:y,[Eo("radioSize",e)]:x}}=n.value;return{"--n-bezier":t,"--n-label-line-height":g,"--n-label-font-weight":b,"--n-box-shadow":r,"--n-box-shadow-active":a,"--n-box-shadow-disabled":l,"--n-box-shadow-focus":i,"--n-box-shadow-hover":s,"--n-color":d,"--n-color-active":u,"--n-color-disabled":c,"--n-dot-color-active":f,"--n-dot-color-disabled":m,"--n-font-size":y,"--n-radio-size":x,"--n-text-color":p,"--n-text-color-disabled":h,"--n-label-padding":v}}),{inlineThemeDisabled:r,mergedClsPrefixRef:a,mergedRtlRef:l}=ro(e),i=Ce("Radio",l,a),s=r?io("radio",I(()=>o.mergedSize.value[0]),t,e):void 0;return Object.assign(o,{rtlEnabled:i,cssVars:r?void 0:t,themeClass:null==s?void 0:s.themeClass,onRender:null==s?void 0:s.onRender})},render(){const{$slots:e,mergedClsPrefix:o,onRender:n,label:t}=this;return null==n||n(),u("label",{class:[`${o}-radio`,this.themeClass,this.rtlEnabled&&`${o}-radio--rtl`,this.mergedDisabled&&`${o}-radio--disabled`,this.renderSafeChecked&&`${o}-radio--checked`,this.focus&&`${o}-radio--focus`],style:this.cssVars},u("div",{class:`${o}-radio__dot-wrapper`}," ",u("div",{class:[`${o}-radio__dot`,this.renderSafeChecked&&`${o}-radio__dot--checked`]}),u("input",{ref:"inputRef",type:"radio",class:`${o}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur})),fe(e.default,e=>e||t?u("div",{ref:"labelRef",class:`${o}-radio__label`},e||t):null))}}),ps=to("radio-group","\n display: inline-block;\n font-size: var(--n-font-size);\n",[Fo("splitor","\n display: inline-block;\n vertical-align: bottom;\n width: 1px;\n transition:\n background-color .3s var(--n-bezier),\n opacity .3s var(--n-bezier);\n background: var(--n-button-border-color);\n ",[Lo("checked",{backgroundColor:"var(--n-button-border-color-active)"}),Lo("disabled",{opacity:"var(--n-opacity-disabled)"})]),Lo("button-group","\n white-space: nowrap;\n height: var(--n-height);\n line-height: var(--n-height);\n ",[to("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),Fo("splitor",{height:"var(--n-height)"})]),to("radio-button","\n vertical-align: bottom;\n outline: none;\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n display: inline-block;\n box-sizing: border-box;\n padding-left: 14px;\n padding-right: 14px;\n white-space: nowrap;\n transition:\n background-color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n border-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n background: var(--n-button-color);\n color: var(--n-button-text-color);\n border-top: 1px solid var(--n-button-border-color);\n border-bottom: 1px solid var(--n-button-border-color);\n ",[to("radio-input","\n pointer-events: none;\n position: absolute;\n border: 0;\n border-radius: inherit;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: 0;\n z-index: 1;\n "),Fo("state-border","\n z-index: 1;\n pointer-events: none;\n position: absolute;\n box-shadow: var(--n-button-box-shadow);\n transition: box-shadow .3s var(--n-bezier);\n left: -1px;\n bottom: -1px;\n right: -1px;\n top: -1px;\n "),lo("&:first-child","\n border-top-left-radius: var(--n-button-border-radius);\n border-bottom-left-radius: var(--n-button-border-radius);\n border-left: 1px solid var(--n-button-border-color);\n ",[Fo("state-border","\n border-top-left-radius: var(--n-button-border-radius);\n border-bottom-left-radius: var(--n-button-border-radius);\n ")]),lo("&:last-child","\n border-top-right-radius: var(--n-button-border-radius);\n border-bottom-right-radius: var(--n-button-border-radius);\n border-right: 1px solid var(--n-button-border-color);\n ",[Fo("state-border","\n border-top-right-radius: var(--n-button-border-radius);\n border-bottom-right-radius: var(--n-button-border-radius);\n ")]),Je("disabled","\n cursor: pointer;\n ",[lo("&:hover",[Fo("state-border","\n transition: box-shadow .3s var(--n-bezier);\n box-shadow: var(--n-button-box-shadow-hover);\n "),Je("checked",{color:"var(--n-button-text-color-hover)"})]),Lo("focus",[lo("&:not(:active)",[Fo("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),Lo("checked","\n background: var(--n-button-color-active);\n color: var(--n-button-text-color-active);\n border-color: var(--n-button-border-color-active);\n "),Lo("disabled","\n cursor: not-allowed;\n opacity: var(--n-opacity-disabled);\n ")])]);var hs=e({name:"RadioGroup",props:Object.assign(Object.assign({},Ie.props),{name:String,value:[String,Number,Boolean],defaultValue:{type:[String,Number,Boolean],default:null},size:String,disabled:{type:Boolean,default:void 0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array]}),setup(e){const o=J(null),{mergedSizeRef:n,mergedDisabledRef:t,nTriggerFormChange:r,nTriggerFormInput:l,nTriggerFormBlur:i,nTriggerFormFocus:s}=mo(e),{mergedClsPrefixRef:d,inlineThemeDisabled:c,mergedRtlRef:u}=ro(e),p=Ie("Radio","-radio-group",ps,ns,e,d),h=J(e.defaultValue),f=z(e,"value"),m=Me(f,h);a(ds,{mergedClsPrefixRef:d,nameRef:z(e,"name"),valueRef:m,disabledRef:t,mergedSizeRef:n,doUpdateValue:function(o){const{onUpdateValue:n,"onUpdate:value":t}=e;n&&_e(n,o),t&&_e(t,o),h.value=o,r(),l()}});const v=Ce("Radio",u,d),g=I(()=>{const{value:e}=n,{common:{cubicBezierEaseInOut:o},self:{buttonBorderColor:t,buttonBorderColorActive:r,buttonBorderRadius:a,buttonBoxShadow:l,buttonBoxShadowFocus:i,buttonBoxShadowHover:s,buttonColor:d,buttonColorActive:c,buttonTextColor:u,buttonTextColorActive:h,buttonTextColorHover:f,opacityDisabled:m,[Eo("buttonHeight",e)]:v,[Eo("fontSize",e)]:g}}=p.value;return{"--n-font-size":g,"--n-bezier":o,"--n-button-border-color":t,"--n-button-border-color-active":r,"--n-button-border-radius":a,"--n-button-box-shadow":l,"--n-button-box-shadow-focus":i,"--n-button-box-shadow-hover":s,"--n-button-color":d,"--n-button-color-active":c,"--n-button-text-color":u,"--n-button-text-color-hover":f,"--n-button-text-color-active":h,"--n-height":v,"--n-opacity-disabled":m}}),b=c?io("radio-group",I(()=>n.value[0]),g,e):void 0;return{selfElRef:o,rtlEnabled:v,mergedClsPrefix:d,mergedValue:m,handleFocusout:function(e){const{value:n}=o;n&&(n.contains(e.relatedTarget)||i())},handleFocusin:function(e){const{value:n}=o;n&&(n.contains(e.relatedTarget)||s())},cssVars:c?void 0:g,themeClass:null==b?void 0:b.themeClass,onRender:null==b?void 0:b.onRender}},render(){var e;const{mergedValue:o,mergedClsPrefix:n,handleFocusin:t,handleFocusout:r}=this,{children:a,isButtonGroup:l}=function(e,o,n){var t;const r=[];let a=!1;for(let l=0;l<e.length;++l){const i=e[l],s=null===(t=i.type)||void 0===t?void 0:t.name;"RadioButton"===s&&(a=!0);const d=i.props;if("RadioButton"===s)if(0===l)r.push(i);else{const e=r[r.length-1].props,t=o===e.value,a=e.disabled,l=o===d.value,s=d.disabled,c=(t?2:0)+(a?0:1),p=(l?2:0)+(s?0:1),h={[`${n}-radio-group__splitor--disabled`]:a,[`${n}-radio-group__splitor--checked`]:t},f=c<p?{[`${n}-radio-group__splitor--disabled`]:s,[`${n}-radio-group__splitor--checked`]:l}:h;r.push(u("div",{class:[`${n}-radio-group__splitor`,f]}),i)}else r.push(i)}return{children:r,isButtonGroup:a}}(Uo(cr(this)),o,n);return null===(e=this.onRender)||void 0===e||e.call(this),u("div",{onFocusin:t,onFocusout:r,ref:"selfElRef",class:[`${n}-radio-group`,this.rtlEnabled&&`${n}-radio-group--rtl`,this.themeClass,l&&`${n}-radio-group--button-group`],style:this.cssVars},a)}}),fs=e({name:"Tooltip",props:Object.assign(Object.assign({},en),Ie.props),slots:Object,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=ro(e),n=Ie("Tooltip","-tooltip",void 0,Zi,e,o),t=J(null);return Object.assign(Object.assign({},{syncPosition(){t.value.syncPosition()},setShow(e){t.value.setShow(e)}}),{popoverRef:t,mergedTheme:n,popoverThemeOverrides:I(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:o}=this;return u(vn,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:o.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),ms=Ue("n-dropdown-menu"),vs=Ue("n-dropdown"),gs=Ue("n-dropdown-option"),bs=e({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return u("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),ys=e({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:o}=p(ms),{renderLabelRef:n,labelFieldRef:t,nodePropsRef:r,renderOptionRef:a}=p(vs);return{labelField:t,showIcon:e,hasSubmenu:o,renderLabel:n,nodeProps:r,renderOption:a}},render(){var e;const{clsPrefix:o,hasSubmenu:n,showIcon:t,nodeProps:r,renderLabel:a,renderOption:l}=this,{rawNode:i}=this.tmNode,s=u("div",Object.assign({class:`${o}-dropdown-option`},null==r?void 0:r(i)),u("div",{class:`${o}-dropdown-option-body ${o}-dropdown-option-body--group`},u("div",{"data-dropdown-option":!0,class:[`${o}-dropdown-option-body__prefix`,t&&`${o}-dropdown-option-body__prefix--show-icon`]},Xo(i.icon)),u("div",{class:`${o}-dropdown-option-body__label`,"data-dropdown-option":!0},a?a(i):Xo(null!==(e=i.title)&&void 0!==e?e:i[this.labelField])),u("div",{class:[`${o}-dropdown-option-body__suffix`,n&&`${o}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return l?l({node:s,option:i}):s}}),xs={name:"Icon",common:Pa,self:bo};function Cs(e,o){return"submenu"===e.type||void 0===e.type&&void 0!==e[o]}function ws(e){return"divider"===e.type}var Ss=e({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const o=p(vs),{hoverKeyRef:n,keyboardKeyRef:t,lastToggledSubmenuKeyRef:r,pendingKeyPathRef:l,activeKeyPathRef:i,animatedRef:s,mergedShowRef:d,renderLabelRef:c,renderIconRef:u,labelFieldRef:h,childrenFieldRef:f,renderOptionRef:m,nodePropsRef:v,menuPropsRef:g}=o,b=p(gs,null),y=p(ms),x=p(Le),w=I(()=>e.tmNode.rawNode),S=I(()=>{const{value:o}=f;return Cs(e.tmNode.rawNode,o)}),k=I(()=>{const{disabled:o}=e.tmNode;return o}),P=function(e,o,n){if(!o)return e;const t=J(e.value);let r=null;return C(e,e=>{null!==r&&window.clearTimeout(r),!0===e?n&&!n.value?t.value=!0:r=window.setTimeout(()=>{t.value=!0},o):t.value=!1}),t}(I(()=>{if(!S.value)return!1;const{key:o,disabled:a}=e.tmNode;if(a)return!1;const{value:i}=n,{value:s}=t,{value:d}=r,{value:c}=l;return null!==i?c.includes(o):null!==s?c.includes(o)&&c[c.length-1]!==o:null!==d&&c.includes(o)}),300,I(()=>null===t.value&&!s.value)),T=I(()=>!!(null==b?void 0:b.enteringSubmenuRef.value)),A=J(!1);function z(){const{parentKey:o,tmNode:a}=e;a.disabled||d.value&&(r.value=o,t.value=null,n.value=a.key)}return a(gs,{enteringSubmenuRef:A}),{labelField:h,renderLabel:c,renderIcon:u,siblingHasIcon:y.showIconRef,siblingHasSubmenu:y.hasSubmenuRef,menuProps:g,popoverBody:x,animated:s,mergedShowSubmenu:I(()=>P.value&&!T.value),rawNode:w,hasSubmenu:S,pending:de(()=>{const{value:o}=l,{key:n}=e.tmNode;return o.includes(n)}),childActive:de(()=>{const{value:o}=i,{key:n}=e.tmNode,t=o.findIndex(e=>n===e);return-1!==t&&t<o.length-1}),active:de(()=>{const{value:o}=i,{key:n}=e.tmNode,t=o.findIndex(e=>n===e);return-1!==t&&t===o.length-1}),mergedDisabled:k,renderOption:m,nodeProps:v,handleClick:function(){const{value:n}=S,{tmNode:t}=e;d.value&&(n||t.disabled||(o.doSelect(t.key,t.rawNode),o.doUpdateShow(!1)))},handleMouseMove:function(){const{tmNode:o}=e;o.disabled||d.value&&n.value!==o.key&&z()},handleMouseEnter:z,handleMouseLeave:function(o){if(e.tmNode.disabled)return;if(!d.value)return;const{relatedTarget:t}=o;!t||Vt({target:t},"dropdownOption")||Vt({target:t},"scrollbarRail")||(n.value=null)},handleSubmenuBeforeEnter:function(){A.value=!0},handleSubmenuAfterEnter:function(){A.value=!1}}},render(){var e,o;const{animated:n,rawNode:t,mergedShowSubmenu:a,clsPrefix:l,siblingHasIcon:i,siblingHasSubmenu:s,renderLabel:d,renderIcon:c,renderOption:p,nodeProps:h,props:f,scrollable:m}=this;let v=null;if(a){const o=null===(e=this.menuProps)||void 0===e?void 0:e.call(this,t,t.children);v=u(Is,Object.assign({},o,{clsPrefix:l,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const g={class:[`${l}-dropdown-option-body`,this.pending&&`${l}-dropdown-option-body--pending`,this.active&&`${l}-dropdown-option-body--active`,this.childActive&&`${l}-dropdown-option-body--child-active`,this.mergedDisabled&&`${l}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},b=null==h?void 0:h(t),y=u("div",Object.assign({class:[`${l}-dropdown-option`,null==b?void 0:b.class],"data-dropdown-option":!0},b),u("div",r(g,f),[u("div",{class:[`${l}-dropdown-option-body__prefix`,i&&`${l}-dropdown-option-body__prefix--show-icon`]},[c?c(t):Xo(t.icon)]),u("div",{"data-dropdown-option":!0,class:`${l}-dropdown-option-body__label`},d?d(t):Xo(null!==(o=t[this.labelField])&&void 0!==o?o:t.title)),u("div",{"data-dropdown-option":!0,class:[`${l}-dropdown-option-body__suffix`,s&&`${l}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?u(so,null,{default:()=>u(vr,null)}):null)]),this.hasSubmenu?u(qo,null,{default:()=>[u(Wo,null,{default:()=>u("div",{class:`${l}-dropdown-offset-container`},u(bn,{show:this.mergedShowSubmenu,placement:this.placement,to:m&&this.popoverBody||void 0,teleportDisabled:!m},{default:()=>u("div",{class:`${l}-dropdown-menu-wrapper`},n?u(L,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>v}):v)}))})]}):null);return p?p({node:y,option:t}):y}}),ks=e({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:o,clsPrefix:n}=this,{children:t}=e;return u(F,null,u(ys,{clsPrefix:n,tmNode:e,key:e.key}),null==t?void 0:t.map(e=>{const{rawNode:t}=e;return!1===t.show?null:ws(t)?u(bs,{clsPrefix:n,key:e.key}):e.isGroup?(Ae("dropdown","`group` node is not allowed to be put in `group` node."),null):u(Ss,{clsPrefix:n,tmNode:e,parentKey:o,key:e.key})}))}}),Ps=e({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:o}}=this.tmNode;return u("div",o,[null==e?void 0:e()])}}),Is=e({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:o,childrenFieldRef:n}=p(vs);a(ms,{showIconRef:I(()=>{const n=o.value;return e.tmNodes.some(e=>{var o;if(e.isGroup)return null===(o=e.children)||void 0===o?void 0:o.some(({rawNode:e})=>n?n(e):e.icon);const{rawNode:t}=e;return n?n(t):t.icon})}),hasSubmenuRef:I(()=>{const{value:o}=n;return e.tmNodes.some(e=>{var n;if(e.isGroup)return null===(n=e.children)||void 0===n?void 0:n.some(({rawNode:e})=>Cs(e,o));const{rawNode:t}=e;return Cs(t,o)})})});const t=J(null);return a(He,null),a(wo,null),a(Le,t),{bodyRef:t}},render(){const{parentKey:e,clsPrefix:o,scrollable:n}=this,t=this.tmNodes.map(t=>{const{rawNode:r}=t;return!1===r.show?null:function(e){return"render"===e.type}(r)?u(Ps,{tmNode:t,key:t.key}):ws(r)?u(bs,{clsPrefix:o,key:t.key}):function(e){return"group"===e.type}(r)?u(ks,{clsPrefix:o,tmNode:t,parentKey:e,key:t.key}):u(Ss,{clsPrefix:o,tmNode:t,parentKey:e,key:t.key,props:r.props,scrollable:n})});return u("div",{class:[`${o}-dropdown-menu`,n&&`${o}-dropdown-menu--scrollable`],ref:"bodyRef"},n?u(Ge,{contentClass:`${o}-dropdown-menu__content`},{default:()=>t}):t,this.showArrow?on({clsPrefix:o,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),Ts=to("dropdown-menu","\n transform-origin: var(--v-transform-origin);\n background-color: var(--n-color);\n border-radius: var(--n-border-radius);\n box-shadow: var(--n-box-shadow);\n position: relative;\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n",[tn(),to("dropdown-option","\n position: relative;\n ",[lo("a","\n text-decoration: none;\n color: inherit;\n outline: none;\n ",[lo("&::before",'\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n ')]),to("dropdown-option-body","\n display: flex;\n cursor: pointer;\n position: relative;\n height: var(--n-option-height);\n line-height: var(--n-option-height);\n font-size: var(--n-font-size);\n color: var(--n-option-text-color);\n transition: color .3s var(--n-bezier);\n ",[lo("&::before",'\n content: "";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 4px;\n right: 4px;\n transition: background-color .3s var(--n-bezier);\n border-radius: var(--n-border-radius);\n '),Je("disabled",[Lo("pending","\n color: var(--n-option-text-color-hover);\n ",[Fo("prefix, suffix","\n color: var(--n-option-text-color-hover);\n "),lo("&::before","background-color: var(--n-option-color-hover);")]),Lo("active","\n color: var(--n-option-text-color-active);\n ",[Fo("prefix, suffix","\n color: var(--n-option-text-color-active);\n "),lo("&::before","background-color: var(--n-option-color-active);")]),Lo("child-active","\n color: var(--n-option-text-color-child-active);\n ",[Fo("prefix, suffix","\n color: var(--n-option-text-color-child-active);\n ")])]),Lo("disabled","\n cursor: not-allowed;\n opacity: var(--n-option-opacity-disabled);\n "),Lo("group","\n font-size: calc(var(--n-font-size) - 1px);\n color: var(--n-group-header-text-color);\n ",[Fo("prefix","\n width: calc(var(--n-option-prefix-width) / 2);\n ",[Lo("show-icon","\n width: calc(var(--n-option-icon-prefix-width) / 2);\n ")])]),Fo("prefix","\n width: var(--n-option-prefix-width);\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--n-prefix-color);\n transition: color .3s var(--n-bezier);\n z-index: 1;\n ",[Lo("show-icon","\n width: var(--n-option-icon-prefix-width);\n "),to("icon","\n font-size: var(--n-option-icon-size);\n ")]),Fo("label","\n white-space: nowrap;\n flex: 1;\n z-index: 1;\n "),Fo("suffix","\n box-sizing: border-box;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n min-width: var(--n-option-suffix-width);\n padding: 0 8px;\n transition: color .3s var(--n-bezier);\n color: var(--n-suffix-color);\n z-index: 1;\n ",[Lo("has-submenu","\n width: var(--n-option-icon-suffix-width);\n "),to("icon","\n font-size: var(--n-option-icon-size);\n ")]),to("dropdown-menu","pointer-events: all;")]),to("dropdown-offset-container","\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: -4px;\n bottom: -4px;\n ")]),to("dropdown-divider","\n transition: background-color .3s var(--n-bezier);\n background-color: var(--n-divider-color);\n height: 1px;\n margin: 4px 0;\n "),to("dropdown-menu-wrapper","\n transform-origin: var(--v-transform-origin);\n width: fit-content;\n "),lo(">",[to("scrollbar","\n height: inherit;\n max-height: inherit;\n ")]),Je("scrollable","\n padding: var(--n-padding);\n "),Lo("scrollable",[Fo("content","\n padding: var(--n-padding);\n ")])]),As={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},zs=Object.keys(en),Rs=e({name:"Dropdown",inheritAttrs:!1,props:Object.assign(Object.assign(Object.assign({},en),As),Ie.props),setup(e){const o=J(!1),n=Me(z(e,"show"),o),t=I(()=>{const{keyField:o,childrenField:n}=e;return Ja(e.options,{getKey:e=>e[o],getDisabled:e=>!0===e.disabled,getIgnored:e=>"divider"===e.type||"render"===e.type,getChildren:e=>e[n]})}),r=I(()=>t.value.treeNodes),l=J(null),i=J(null),s=J(null),d=I(()=>{var e,o,n;return null!==(n=null!==(o=null!==(e=l.value)&&void 0!==e?e:i.value)&&void 0!==o?o:s.value)&&void 0!==n?n:null}),c=I(()=>t.value.getPath(d.value).keyPath),u=I(()=>t.value.getPath(e.value).keyPath);qt({keydown:{ArrowUp:{prevent:!0,handler:function(){y("up")}},ArrowRight:{prevent:!0,handler:function(){y("right")}},ArrowDown:{prevent:!0,handler:function(){y("down")}},ArrowLeft:{prevent:!0,handler:function(){y("left")}},Enter:{prevent:!0,handler:function(){const e=b();(null==e?void 0:e.isLeaf)&&n.value&&(m(e.key,e.rawNode),v(!1))}},Escape:function(){v(!1)}}},de(()=>e.keyboard&&n.value));const{mergedClsPrefixRef:p,inlineThemeDisabled:h}=ro(e),f=Ie("Dropdown","-dropdown",Ts,qi,e,p);function m(o,n){const{onSelect:t}=e;t&&_e(t,o,n)}function v(n){const{"onUpdate:show":t,onUpdateShow:r}=e;t&&_e(t,n),r&&_e(r,n),o.value=n}function g(){l.value=null,i.value=null,s.value=null}function b(){var e;const{value:o}=t,{value:n}=d;return o&&null!==n&&null!==(e=o.getNode(n))&&void 0!==e?e:null}function y(e){const{value:o}=d,{value:{getFirstAvailableNode:n}}=t;let r=null;if(null===o){const e=n();null!==e&&(r=e.key)}else{const o=b();if(o){let n;switch(e){case"down":n=o.getNext();break;case"up":n=o.getPrev();break;case"right":n=o.getChild();break;case"left":n=o.getParent()}n&&(r=n.key)}}null!==r&&(l.value=null,i.value=r)}a(vs,{labelFieldRef:z(e,"labelField"),childrenFieldRef:z(e,"childrenField"),renderLabelRef:z(e,"renderLabel"),renderIconRef:z(e,"renderIcon"),hoverKeyRef:l,keyboardKeyRef:i,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:c,activeKeyPathRef:u,animatedRef:z(e,"animated"),mergedShowRef:n,nodePropsRef:z(e,"nodeProps"),renderOptionRef:z(e,"renderOption"),menuPropsRef:z(e,"menuProps"),doSelect:m,doUpdateShow:v}),C(n,o=>{e.animated||o||g()});const x=I(()=>{const{size:o,inverted:n}=e,{common:{cubicBezierEaseInOut:t},self:r}=f.value,{padding:a,dividerColor:l,borderRadius:i,optionOpacityDisabled:s,[Eo("optionIconSuffixWidth",o)]:d,[Eo("optionSuffixWidth",o)]:c,[Eo("optionIconPrefixWidth",o)]:u,[Eo("optionPrefixWidth",o)]:p,[Eo("fontSize",o)]:h,[Eo("optionHeight",o)]:m,[Eo("optionIconSize",o)]:v}=r,g={"--n-bezier":t,"--n-font-size":h,"--n-padding":a,"--n-border-radius":i,"--n-option-height":m,"--n-option-prefix-width":p,"--n-option-icon-prefix-width":u,"--n-option-suffix-width":c,"--n-option-icon-suffix-width":d,"--n-option-icon-size":v,"--n-divider-color":l,"--n-option-opacity-disabled":s};return n?(g["--n-color"]=r.colorInverted,g["--n-option-color-hover"]=r.optionColorHoverInverted,g["--n-option-color-active"]=r.optionColorActiveInverted,g["--n-option-text-color"]=r.optionTextColorInverted,g["--n-option-text-color-hover"]=r.optionTextColorHoverInverted,g["--n-option-text-color-active"]=r.optionTextColorActiveInverted,g["--n-option-text-color-child-active"]=r.optionTextColorChildActiveInverted,g["--n-prefix-color"]=r.prefixColorInverted,g["--n-suffix-color"]=r.suffixColorInverted,g["--n-group-header-text-color"]=r.groupHeaderTextColorInverted):(g["--n-color"]=r.color,g["--n-option-color-hover"]=r.optionColorHover,g["--n-option-color-active"]=r.optionColorActive,g["--n-option-text-color"]=r.optionTextColor,g["--n-option-text-color-hover"]=r.optionTextColorHover,g["--n-option-text-color-active"]=r.optionTextColorActive,g["--n-option-text-color-child-active"]=r.optionTextColorChildActive,g["--n-prefix-color"]=r.prefixColor,g["--n-suffix-color"]=r.suffixColor,g["--n-group-header-text-color"]=r.groupHeaderTextColor),g}),w=h?io("dropdown",I(()=>`${e.size[0]}${e.inverted?"i":""}`),x,e):void 0;return{mergedClsPrefix:p,mergedTheme:f,tmNodes:r,mergedShow:n,handleAfterLeave:()=>{e.animated&&g()},doUpdateShow:v,cssVars:h?void 0:x,themeClass:null==w?void 0:w.themeClass,onRender:null==w?void 0:w.onRender}},render(){const{mergedTheme:e}=this,o={show:this.mergedShow,theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:(e,o,n,t,a)=>{var l;const{mergedClsPrefix:i,menuProps:s}=this;null===(l=this.onRender)||void 0===l||l.call(this);const d=(null==s?void 0:s(void 0,this.tmNodes.map(e=>e.rawNode)))||{},c={ref:dr(o),class:[e,`${i}-dropdown`,this.themeClass],clsPrefix:i,tmNodes:this.tmNodes,style:[...n,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:t,onMouseleave:a};return u(Is,r(this.$attrs,c,d))},onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return u(vn,Object.assign({},yn(this.$props,zs),o),{trigger:()=>{var e,o;return null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)}})}}),Ms={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"};function Fs(e){const{popoverColor:o,textColor2:n,primaryColor:t,hoverColor:r,dividerColor:a,opacityDisabled:l,boxShadow2:i,borderRadius:s,iconColor:d,iconColorDisabled:c}=e;return Object.assign(Object.assign({},Ms),{panelColor:o,panelBoxShadow:i,panelDividerColor:a,itemTextColor:n,itemTextColorActive:t,itemColorHover:r,itemOpacityDisabled:l,itemBorderRadius:s,borderRadius:s,iconColor:d,iconColorDisabled:c})}var Os=ke({name:"TimePicker",common:pe,peers:{Scrollbar:$o,Button:ho,Input:un},self:Fs}),Bs={name:"TimePicker",common:Pa,peers:{Scrollbar:Ia,Button:ii,Input:Al},self:Fs},$s={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarLeftPaddingWeek:"6px 12px 4px 12px",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0",calendarRightPaddingWeek:"0"};function Es(e){const{hoverColor:o,fontSize:n,textColor2:t,textColorDisabled:r,popoverColor:a,primaryColor:l,borderRadiusSmall:i,iconColor:s,iconColorDisabled:d,textColor1:c,dividerColor:u,boxShadow2:p,borderRadius:h,fontWeightStrong:f}=e;return Object.assign(Object.assign({},$s),{itemFontSize:n,calendarDaysFontSize:n,calendarTitleFontSize:n,itemTextColor:t,itemTextColorDisabled:r,itemTextColorActive:a,itemTextColorCurrent:l,itemColorIncluded:qe(l,{alpha:.1}),itemColorHover:o,itemColorDisabled:o,itemColorActive:l,itemBorderRadius:i,panelColor:a,panelTextColor:t,arrowColor:s,calendarTitleTextColor:c,calendarTitleColorHover:o,calendarDaysTextColor:t,panelHeaderDividerColor:u,calendarDaysDividerColor:u,calendarDividerColor:u,panelActionDividerColor:u,panelBoxShadow:p,panelBorderRadius:h,calendarTitleFontWeight:f,scrollItemBorderRadius:h,iconColor:s,iconColorDisabled:d})}var Ds=ke({name:"DatePicker",common:pe,peers:{Input:un,Button:ho,TimePicker:Os,Scrollbar:$o},self:Es}),_s={name:"DatePicker",common:Pa,peers:{Input:Al,Button:ii,TimePicker:Bs,Scrollbar:Ia},self(e){const{popoverColor:o,hoverColor:n,primaryColor:t}=e,r=Es(e);return r.itemColorDisabled=yo(o,n),r.itemColorIncluded=qe(t,{alpha:.15}),r.itemColorHover=yo(o,n),r}},Ls={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"};function Hs(e){const{tableHeaderColor:o,textColor2:n,textColor1:t,cardColor:r,modalColor:a,popoverColor:l,dividerColor:i,borderRadius:s,fontWeightStrong:d,lineHeight:c,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:h}=e;return Object.assign(Object.assign({},Ls),{lineHeight:c,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:h,titleTextColor:t,thColor:yo(r,o),thColorModal:yo(a,o),thColorPopover:yo(l,o),thTextColor:t,thFontWeight:d,tdTextColor:n,tdColor:r,tdColorModal:a,tdColorPopover:l,borderColor:yo(r,i),borderColorModal:yo(a,i),borderColorPopover:yo(l,i),borderRadius:s})}var js={name:"Descriptions",common:pe,self:Hs},Us={name:"Descriptions",common:Pa,self:Hs},Ws={name:"Dialog",common:Pa,peers:{Button:ii},self:ot},Ns={name:"Modal",common:Pa,peers:{Scrollbar:Ia,Dialog:Ws,Card:pi},self:Ln},Ks=Object.assign(Object.assign({},nt),{onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},internalStyle:[String,Object],maskClosable:{type:Boolean,default:!0},zIndex:Number,onPositiveClick:Function,onNegativeClick:Function,onClose:Function,onMaskClick:Function,draggable:[Boolean,Object]}),Vs=e({name:"DialogEnvironment",props:Object.assign(Object.assign({},Ks),{internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const o=J(!0);function n(){o.value=!1}return{show:o,hide:n,handleUpdateShow:function(e){o.value=e},handleAfterLeave:function(){const{onInternalAfterLeave:o,internalKey:n,onAfterLeave:t}=e;o&&o(n),t&&t()},handleCloseClick:function(){const{onClose:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&n()}):n()},handleNegativeClick:function(o){const{onNegativeClick:t}=e;t?Promise.resolve(t(o)).then(e=>{!1!==e&&n()}):n()},handlePositiveClick:function(o){const{onPositiveClick:t}=e;t?Promise.resolve(t(o)).then(e=>{!1!==e&&n()}):n()},handleMaskClick:function(o){const{onMaskClick:t,maskClosable:r}=e;t&&(t(o),r&&n())},handleEsc:function(){const{onEsc:o}=e;o&&o()}}},render(){const{handlePositiveClick:e,handleUpdateShow:o,handleNegativeClick:n,handleCloseClick:t,handleAfterLeave:r,handleMaskClick:a,handleEsc:l,to:i,zIndex:s,maskClosable:d,show:c}=this;return u(Nn,{show:c,onUpdateShow:o,onMaskClick:a,onEsc:l,to:i,zIndex:s,maskClosable:d,onAfterEnter:this.onAfterEnter,onAfterLeave:r,closeOnEsc:this.closeOnEsc,blockScroll:this.blockScroll,autoFocus:this.autoFocus,transformOrigin:this.transformOrigin,draggable:this.draggable,internalAppear:!0,internalDialog:!0},{default:({draggableClass:o})=>u(On,Object.assign({},yn(this.$props,Qn),{titleClass:$([this.titleClass,o]),style:this.internalStyle,onClose:t,onNegativeClick:n,onPositiveClick:e}))})}}),qs=e({name:"DialogProvider",props:{injectionKey:String,to:[String,Object]},setup(){const e=J([]),o={};function n(n={}){const t=ko(),r=P(Object.assign(Object.assign({},n),{key:t,destroy:()=>{var e;null===(e=o[`n-dialog-${t}`])||void 0===e||e.hide()}}));return e.value.push(r),r}const t=["info","success","warning","error"].map(e=>o=>n(Object.assign(Object.assign({},o),{type:e})));const r={create:n,destroyAll:function(){Object.values(o).forEach(e=>{null==e||e.hide()})},info:t[0],success:t[1],warning:t[2],error:t[3]};return a(wn,r),a(et,{clickedRef:In(64),clickedPositionRef:Tn()}),a(Fn,e),Object.assign(Object.assign({},r),{dialogList:e,dialogInstRefs:o,handleAfterLeave:function(o){const{value:n}=e;n.splice(n.findIndex(e=>e.key===o),1)}})},render(){var e,o;return u(F,null,[this.dialogList.map(e=>u(Vs,pr(e,["destroy","style"],{internalStyle:e.style,to:this.to,ref:o=>{null===o?delete this.dialogInstRefs[`n-dialog-${e.key}`]:this.dialogInstRefs[`n-dialog-${e.key}`]=o},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave}))),null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)])}}),Gs=Ue("n-loading-bar"),Js=Ue("n-loading-bar-api"),Ys={name:"LoadingBar",common:Pa,self(e){const{primaryColor:o}=e;return{colorError:"red",colorLoading:o,height:"2px"}}};var Zs={name:"LoadingBar",common:pe,self:function(e){const{primaryColor:o,errorColor:n}=e;return{colorError:n,colorLoading:o,height:"2px"}}},Xs=to("loading-bar-container","\n z-index: 5999;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 2px;\n",[Bo({enterDuration:"0.3s",leaveDuration:"0.8s"}),to("loading-bar","\n width: 100%;\n transition:\n max-width 4s linear,\n background .2s linear;\n height: var(--n-height);\n ",[Lo("starting","\n background: var(--n-color-loading);\n "),Lo("finishing","\n background: var(--n-color-loading);\n transition:\n max-width .2s linear,\n background .2s linear;\n "),Lo("error","\n background: var(--n-color-error);\n transition:\n max-width .2s linear,\n background .2s linear;\n ")])]),Qs=function(e,o,n,t){return new(n||(n=Promise))(function(r,a){function l(e){try{s(t.next(e))}catch(o){a(o)}}function i(e){try{s(t.throw(e))}catch(o){a(o)}}function s(e){var o;e.done?r(e.value):(o=e.value,o instanceof n?o:new n(function(e){e(o)})).then(l,i)}s((t=t.apply(e,o||[])).next())})};function ed(e,o){return`${o}-loading-bar ${o}-loading-bar--${e}`}var od=e({name:"LoadingBar",props:{containerClass:String,containerStyle:[String,Object]},setup(){const{inlineThemeDisabled:e}=ro(),{props:o,mergedClsPrefixRef:n}=p(Gs),t=J(null),r=J(!1),a=J(!1),l=J(!1),s=J(!1);let d=!1;const c=J(!1),u=I(()=>{const{loadingBarStyle:e}=o;return e?e[c.value?"error":"loading"]:""});function h(){return Qs(this,void 0,void 0,function*(){r.value=!1,l.value=!1,d=!1,c.value=!1,s.value=!0,yield i(),s.value=!1})}function f(){return Qs(this,arguments,void 0,function*(e=0,o=80,r="starting"){if(a.value=!0,yield h(),d)return;l.value=!0,yield i();const s=t.value;s&&(s.style.maxWidth=`${e}%`,s.style.transition="none",s.offsetWidth,s.className=ed(r,n.value),s.style.transition="",s.style.maxWidth=`${o}%`)})}const m=Ie("LoadingBar","-loading-bar",Xs,Zs,o,n),v=I(()=>{const{self:{height:e,colorError:o,colorLoading:n}}=m.value;return{"--n-height":e,"--n-color-loading":n,"--n-color-error":o}}),g=e?io("loading-bar",void 0,v,o):void 0;return{mergedClsPrefix:n,loadingBarRef:t,started:a,loading:l,entering:r,transitionDisabled:s,start:f,error:function(){if(!d&&!c.value)if(l.value){c.value=!0;const e=t.value;if(!e)return;e.className=ed("error",n.value),e.style.maxWidth="100%",e.offsetWidth,l.value=!1}else f(100,100,"error").then(()=>{c.value=!0;const e=t.value;e&&(e.className=ed("error",n.value),e.offsetWidth,l.value=!1)})},finish:function(){return Qs(this,void 0,void 0,function*(){if(d||c.value)return;a.value&&(yield i()),d=!0;const e=t.value;e&&(e.className=ed("finishing",n.value),e.style.maxWidth="100%",e.offsetWidth,l.value=!1)})},handleEnter:function(){r.value=!0},handleAfterEnter:function(){r.value=!1},handleAfterLeave:function(){return Qs(this,void 0,void 0,function*(){yield h()})},mergedLoadingBarStyle:u,cssVars:e?void 0:v,themeClass:null==g?void 0:g.themeClass,onRender:null==g?void 0:g.onRender}},render(){if(!this.started)return null;const{mergedClsPrefix:e}=this;return u(L,{name:"fade-in-transition",appear:!0,onEnter:this.handleEnter,onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave,css:!this.transitionDisabled},{default:()=>{var o;return null===(o=this.onRender)||void 0===o||o.call(this),Z(u("div",{class:[`${e}-loading-bar-container`,this.themeClass,this.containerClass],style:this.containerStyle},u("div",{ref:"loadingBarRef",class:[`${e}-loading-bar`],style:[this.cssVars,this.mergedLoadingBarStyle]})),[[M,this.loading||!this.loading&&this.entering]])}})}}),nd=e({name:"LoadingBarProvider",props:Object.assign(Object.assign({},Ie.props),{to:{type:[String,Object,Boolean],default:void 0},containerClass:String,containerStyle:[String,Object],loadingBarStyle:{type:Object}}),setup(e){const o=We(),n=J(null),t={start(){var e;o.value?null===(e=n.value)||void 0===e||e.start():i(()=>{var e;null===(e=n.value)||void 0===e||e.start()})},error(){var e;o.value?null===(e=n.value)||void 0===e||e.error():i(()=>{var e;null===(e=n.value)||void 0===e||e.error()})},finish(){var e;o.value?null===(e=n.value)||void 0===e||e.finish():i(()=>{var e;null===(e=n.value)||void 0===e||e.finish()})}},{mergedClsPrefixRef:r}=ro(e);return a(Js,t),a(Gs,{props:e,mergedClsPrefixRef:r}),Object.assign(t,{loadingBarRef:n})},render(){var e,o;return u(F,null,u(w,{disabled:!1===this.to,to:this.to||"body"},u(od,{ref:"loadingBarRef",containerStyle:this.containerStyle,containerClass:this.containerClass})),null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e))}});var td={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"};function rd(e){const{textColor2:o,closeIconColor:n,closeIconColorHover:t,closeIconColorPressed:r,infoColor:a,successColor:l,errorColor:i,warningColor:s,popoverColor:d,boxShadow2:c,primaryColor:u,lineHeight:p,borderRadius:h,closeColorHover:f,closeColorPressed:m}=e;return Object.assign(Object.assign({},td),{closeBorderRadius:h,textColor:o,textColorInfo:o,textColorSuccess:o,textColorError:o,textColorWarning:o,textColorLoading:o,color:d,colorInfo:d,colorSuccess:d,colorError:d,colorWarning:d,colorLoading:d,boxShadow:c,boxShadowInfo:c,boxShadowSuccess:c,boxShadowError:c,boxShadowWarning:c,boxShadowLoading:c,iconColor:o,iconColorInfo:a,iconColorSuccess:l,iconColorWarning:s,iconColorError:i,iconColorLoading:u,closeColorHover:f,closeColorPressed:m,closeIconColor:n,closeIconColorHover:t,closeIconColorPressed:r,closeColorHoverInfo:f,closeColorPressedInfo:m,closeIconColorInfo:n,closeIconColorHoverInfo:t,closeIconColorPressedInfo:r,closeColorHoverSuccess:f,closeColorPressedSuccess:m,closeIconColorSuccess:n,closeIconColorHoverSuccess:t,closeIconColorPressedSuccess:r,closeColorHoverError:f,closeColorPressedError:m,closeIconColorError:n,closeIconColorHoverError:t,closeIconColorPressedError:r,closeColorHoverWarning:f,closeColorPressedWarning:m,closeIconColorWarning:n,closeIconColorHoverWarning:t,closeIconColorPressedWarning:r,closeColorHoverLoading:f,closeColorPressedLoading:m,closeIconColorLoading:n,closeIconColorHoverLoading:t,closeIconColorPressedLoading:r,loadingColor:u,lineHeight:p,borderRadius:h,border:"0"})}var ad={name:"Message",common:pe,self:rd},ld={name:"Message",common:Pa,self:rd},id={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},sd=lo([to("message-wrapper","\n margin: var(--n-margin);\n z-index: 0;\n transform-origin: top center;\n display: flex;\n ",[Cl({overflow:"visible",originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.85)"}})]),to("message","\n box-sizing: border-box;\n display: flex;\n align-items: center;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier),\n margin-bottom .3s var(--n-bezier);\n padding: var(--n-padding);\n border-radius: var(--n-border-radius);\n border: var(--n-border);\n flex-wrap: nowrap;\n overflow: hidden;\n max-width: var(--n-max-width);\n color: var(--n-text-color);\n background-color: var(--n-color);\n box-shadow: var(--n-box-shadow);\n ",[Fo("content","\n display: inline-block;\n line-height: var(--n-line-height);\n font-size: var(--n-font-size);\n "),Fo("icon","\n position: relative;\n margin: var(--n-icon-margin);\n height: var(--n-icon-size);\n width: var(--n-icon-size);\n font-size: var(--n-icon-size);\n flex-shrink: 0;\n ",[["default","info","success","warning","error","loading"].map(e=>Lo(`${e}-type`,[lo("> *",`\n color: var(--n-icon-color-${e});\n transition: color .3s var(--n-bezier);\n `)])),lo("> *","\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n ",[Te()])]),Fo("close","\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n flex-shrink: 0;\n ",[lo("&:hover","\n color: var(--n-close-icon-color-hover);\n "),lo("&:active","\n color: var(--n-close-icon-color-pressed);\n ")])]),to("message-container","\n z-index: 6000;\n position: fixed;\n height: 0;\n overflow: visible;\n display: flex;\n flex-direction: column;\n align-items: center;\n ",[Lo("top","\n top: 12px;\n left: 0;\n right: 0;\n "),Lo("top-left","\n top: 12px;\n left: 12px;\n right: 0;\n align-items: flex-start;\n "),Lo("top-right","\n top: 12px;\n left: 0;\n right: 12px;\n align-items: flex-end;\n "),Lo("bottom","\n bottom: 4px;\n left: 0;\n right: 0;\n justify-content: flex-end;\n "),Lo("bottom-left","\n bottom: 4px;\n left: 12px;\n right: 0;\n justify-content: flex-end;\n align-items: flex-start;\n "),Lo("bottom-right","\n bottom: 4px;\n left: 0;\n right: 12px;\n justify-content: flex-end;\n align-items: flex-end;\n ")])]),dd={info:()=>u(zn,null),success:()=>u(An,null),warning:()=>u(Un,null),error:()=>u(Rn,null),default:()=>null},cd=e({name:"Message",props:Object.assign(Object.assign({},id),{render:Function}),setup(e){const{inlineThemeDisabled:o,mergedRtlRef:n}=ro(e),{props:t,mergedClsPrefixRef:r}=p(hn),a=Ce("Message",n,r),l=Ie("Message","-message",sd,ad,t,r),i=I(()=>{const{type:o}=e,{common:{cubicBezierEaseInOut:n},self:{padding:t,margin:r,maxWidth:a,iconMargin:i,closeMargin:s,closeSize:d,iconSize:c,fontSize:u,lineHeight:p,borderRadius:h,border:f,iconColorInfo:m,iconColorSuccess:v,iconColorWarning:g,iconColorError:b,iconColorLoading:y,closeIconSize:x,closeBorderRadius:C,[Eo("textColor",o)]:w,[Eo("boxShadow",o)]:S,[Eo("color",o)]:k,[Eo("closeColorHover",o)]:P,[Eo("closeColorPressed",o)]:I,[Eo("closeIconColor",o)]:T,[Eo("closeIconColorPressed",o)]:A,[Eo("closeIconColorHover",o)]:z}}=l.value;return{"--n-bezier":n,"--n-margin":r,"--n-padding":t,"--n-max-width":a,"--n-font-size":u,"--n-icon-margin":i,"--n-icon-size":c,"--n-close-icon-size":x,"--n-close-border-radius":C,"--n-close-size":d,"--n-close-margin":s,"--n-text-color":w,"--n-color":k,"--n-box-shadow":S,"--n-icon-color-info":m,"--n-icon-color-success":v,"--n-icon-color-warning":g,"--n-icon-color-error":b,"--n-icon-color-loading":y,"--n-close-color-hover":P,"--n-close-color-pressed":I,"--n-close-icon-color":T,"--n-close-icon-color-pressed":A,"--n-close-icon-color-hover":z,"--n-line-height":p,"--n-border-radius":h,"--n-border":f}}),s=o?io("message",I(()=>e.type[0]),i,{}):void 0;return{mergedClsPrefix:r,rtlEnabled:a,messageProviderProps:t,handleClose(){var o;null===(o=e.onClose)||void 0===o||o.call(e)},cssVars:o?void 0:i,themeClass:null==s?void 0:s.themeClass,onRender:null==s?void 0:s.onRender,placement:t.placement}},render(){const{render:e,type:o,closable:n,content:t,mergedClsPrefix:r,cssVars:a,themeClass:l,onRender:i,icon:s,handleClose:d,showIcon:c}=this;let p;return null==i||i(),u("div",{class:[`${r}-message-wrapper`,l],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},a]},e?e(this.$props):u("div",{class:[`${r}-message ${r}-message--${o}-type`,this.rtlEnabled&&`${r}-message--rtl`]},(p=function(e,o,n){if("function"==typeof e)return e();{const e="loading"===o?u(Ee,{clsPrefix:n,strokeWidth:24,scale:.85}):dd[o]();return e?u(co,{clsPrefix:n,key:o},{default:()=>e}):null}}(s,o,r))&&c?u("div",{class:`${r}-message__icon ${r}-message__icon--${o}-type`},u(ce,null,{default:()=>p})):null,u("div",{class:`${r}-message__content`},Xo(t)),n?u(me,{clsPrefix:r,class:`${r}-message__close`,onClick:d,absolute:!0}):null))}});var ud=e({name:"MessageEnvironment",props:Object.assign(Object.assign({},id),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let o=null;const n=J(!0);function t(){const{duration:n}=e;n&&(o=window.setTimeout(r,n))}function r(){const{onHide:t}=e;n.value=!1,o&&(window.clearTimeout(o),o=null),t&&t()}return b(()=>{t()}),{show:n,hide:r,handleClose:function(){const{onClose:o}=e;o&&o(),r()},handleAfterLeave:function(){const{onAfterLeave:o,onInternalAfterLeave:n,onAfterHide:t,internalKey:r}=e;o&&o(),n&&n(r),t&&t()},handleMouseleave:function(e){e.currentTarget===e.target&&t()},handleMouseenter:function(e){e.currentTarget===e.target&&null!==o&&(window.clearTimeout(o),o=null)},deactivate:function(){r()}}},render(){return u(ge,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?u(cd,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),pd=e({name:"MessageProvider",props:Object.assign(Object.assign({},Ie.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),setup(e){const{mergedClsPrefixRef:o}=ro(e),n=J([]),t=J({}),r={create:(e,o)=>l(e,Object.assign({type:"default"},o)),info:(e,o)=>l(e,Object.assign(Object.assign({},o),{type:"info"})),success:(e,o)=>l(e,Object.assign(Object.assign({},o),{type:"success"})),warning:(e,o)=>l(e,Object.assign(Object.assign({},o),{type:"warning"})),error:(e,o)=>l(e,Object.assign(Object.assign({},o),{type:"error"})),loading:(e,o)=>l(e,Object.assign(Object.assign({},o),{type:"loading"})),destroyAll:function(){Object.values(t.value).forEach(e=>{e.hide()})}};function l(o,r){const a=ko(),l=P(Object.assign(Object.assign({},r),{content:o,key:a,destroy:()=>{var e;null===(e=t.value[a])||void 0===e||e.hide()}})),{max:i}=e;return i&&n.value.length>=i&&n.value.shift(),n.value.push(l),l}return a(hn,{props:e,mergedClsPrefixRef:o}),a(cn,r),Object.assign({mergedClsPrefix:o,messageRefs:t,messageList:n,handleAfterLeave:function(e){n.value.splice(n.value.findIndex(o=>o.key===e),1),delete t.value[e]}},r)},render(){var e,o,n;return u(F,null,null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e),this.messageList.length?u(w,{to:null!==(n=this.to)&&void 0!==n?n:"body"},u("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(e=>u(ud,Object.assign({ref:o=>{o&&(this.messageRefs[e.key]=o)},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave},pr(e,["destroy"],void 0),{duration:void 0===e.duration?this.duration:e.duration,keepAliveOnHover:void 0===e.keepAliveOnHover?this.keepAliveOnHover:e.keepAliveOnHover,closable:void 0===e.closable?this.closable:e.closable}))))):null)}}),hd=e({name:"ModalEnvironment",props:Object.assign(Object.assign({},Xn),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const o=J(!0);function n(){o.value=!1}return{show:o,hide:n,handleUpdateShow:function(e){o.value=e},handleAfterLeave:function(){const{onInternalAfterLeave:o,internalKey:n,onAfterLeave:t}=e;o&&o(n),t&&t()},handleCloseClick:function(){const{onClose:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&n()}):n()},handleNegativeClick:function(){const{onNegativeClick:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&n()}):n()},handlePositiveClick:function(){const{onPositiveClick:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&n()}):n()},handleMaskClick:function(o){const{onMaskClick:t,maskClosable:r}=e;t&&(t(o),r&&n())},handleEsc:function(){const{onEsc:o}=e;o&&o()}}},render(){const{handleUpdateShow:e,handleAfterLeave:o,handleMaskClick:n,handleEsc:t,show:r}=this;return u(Nn,Object.assign({},this.$props,{show:r,onUpdateShow:e,onMaskClick:n,onEsc:t,onAfterLeave:o,internalAppear:!0,internalModal:!0}),this.$slots)}}),fd=e({name:"ModalProvider",props:{to:[String,Object]},setup(){const e=J([]),o={};const n={create:function(n={}){const t=ko(),r=P(Object.assign(Object.assign({},n),{key:t,destroy:()=>{var e;null===(e=o[`n-modal-${t}`])||void 0===e||e.hide()}}));return e.value.push(r),r},destroyAll:function(){Object.values(o).forEach(e=>{null==e||e.hide()})}};return a(_n,n),a(Gn,{clickedRef:In(64),clickedPositionRef:Tn()}),a(Kn,e),Object.assign(Object.assign({},n),{modalList:e,modalInstRefs:o,handleAfterLeave:function(o){const{value:n}=e;n.splice(n.findIndex(e=>e.key===o),1)}})},render(){var e,o;return u(F,null,[this.modalList.map(e=>{var o;return u(hd,pr(e,["destroy","render"],{to:null!==(o=e.to)&&void 0!==o?o:this.to,ref:o=>{null===o?delete this.modalInstRefs[`n-modal-${e.key}`]:this.modalInstRefs[`n-modal-${e.key}`]=o},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave}),{default:e.render})}),null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)])}}),md={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"};function vd(e){const{textColor2:o,successColor:n,infoColor:t,warningColor:r,errorColor:a,popoverColor:l,closeIconColor:i,closeIconColorHover:s,closeIconColorPressed:d,closeColorHover:c,closeColorPressed:u,textColor1:p,textColor3:h,borderRadius:f,fontWeightStrong:m,boxShadow2:v,lineHeight:g,fontSize:b}=e;return Object.assign(Object.assign({},md),{borderRadius:f,lineHeight:g,fontSize:b,headerFontWeight:m,iconColor:o,iconColorSuccess:n,iconColorInfo:t,iconColorWarning:r,iconColorError:a,color:l,textColor:o,closeIconColor:i,closeIconColorHover:s,closeIconColorPressed:d,closeBorderRadius:f,closeColorHover:c,closeColorPressed:u,headerTextColor:p,descriptionTextColor:h,actionTextColor:o,boxShadow:v})}var gd=ke({name:"Notification",common:pe,peers:{Scrollbar:$o},self:vd}),bd={name:"Notification",common:Pa,peers:{Scrollbar:Ia},self:vd},yd=Ue("n-notification-provider"),xd=e({name:"NotificationContainer",props:{scrollable:{type:Boolean,required:!0},placement:{type:String,required:!0}},setup(){const{mergedThemeRef:e,mergedClsPrefixRef:o,wipTransitionCountRef:n}=p(yd),t=J(null);return f(()=>{var e,o;n.value>0?null===(e=null==t?void 0:t.value)||void 0===e||e.classList.add("transitioning"):null===(o=null==t?void 0:t.value)||void 0===o||o.classList.remove("transitioning")}),{selfRef:t,mergedTheme:e,mergedClsPrefix:o,transitioning:n}},render(){const{$slots:e,scrollable:o,mergedClsPrefix:n,mergedTheme:t,placement:r}=this;return u("div",{ref:"selfRef",class:[`${n}-notification-container`,o&&`${n}-notification-container--scrollable`,`${n}-notification-container--${r}`]},o?u(_o,{theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,contentStyle:{overflow:"hidden"}},e):e)}}),Cd={info:()=>u(zn,null),success:()=>u(An,null),warning:()=>u(Un,null),error:()=>u(Rn,null),default:()=>null},wd={closable:{type:Boolean,default:!0},type:{type:String,default:"default"},avatar:Function,title:[String,Function],description:[String,Function],content:[String,Function],meta:[String,Function],action:[String,Function],onClose:{type:Function,required:!0},keepAliveOnHover:Boolean,onMouseenter:Function,onMouseleave:Function},Sd=Pn(wd),kd=e({name:"Notification",props:wd,setup(e){const{mergedClsPrefixRef:o,mergedThemeRef:n,props:t}=p(yd),{inlineThemeDisabled:r,mergedRtlRef:a}=ro(),l=Ce("Notification",a,o),i=I(()=>{const{type:o}=e,{self:{color:t,textColor:r,closeIconColor:a,closeIconColorHover:l,closeIconColorPressed:i,headerTextColor:s,descriptionTextColor:d,actionTextColor:c,borderRadius:u,headerFontWeight:p,boxShadow:h,lineHeight:f,fontSize:m,closeMargin:v,closeSize:g,width:b,padding:y,closeIconSize:x,closeBorderRadius:C,closeColorHover:w,closeColorPressed:S,titleFontSize:k,metaFontSize:P,descriptionFontSize:I,[Eo("iconColor",o)]:T},common:{cubicBezierEaseOut:A,cubicBezierEaseIn:z,cubicBezierEaseInOut:R}}=n.value,{left:M,right:F,top:O,bottom:B}=Qe(y);return{"--n-color":t,"--n-font-size":m,"--n-text-color":r,"--n-description-text-color":d,"--n-action-text-color":c,"--n-title-text-color":s,"--n-title-font-weight":p,"--n-bezier":R,"--n-bezier-ease-out":A,"--n-bezier-ease-in":z,"--n-border-radius":u,"--n-box-shadow":h,"--n-close-border-radius":C,"--n-close-color-hover":w,"--n-close-color-pressed":S,"--n-close-icon-color":a,"--n-close-icon-color-hover":l,"--n-close-icon-color-pressed":i,"--n-line-height":f,"--n-icon-color":T,"--n-close-margin":v,"--n-close-size":g,"--n-close-icon-size":x,"--n-width":b,"--n-padding-left":M,"--n-padding-right":F,"--n-padding-top":O,"--n-padding-bottom":B,"--n-title-font-size":k,"--n-meta-font-size":P,"--n-description-font-size":I}}),s=r?io("notification",I(()=>e.type[0]),i,t):void 0;return{mergedClsPrefix:o,showAvatar:I(()=>e.avatar||"default"!==e.type),handleCloseClick(){e.onClose()},rtlEnabled:l,cssVars:r?void 0:i,themeClass:null==s?void 0:s.themeClass,onRender:null==s?void 0:s.onRender}},render(){var e;const{mergedClsPrefix:o}=this;return null===(e=this.onRender)||void 0===e||e.call(this),u("div",{class:[`${o}-notification-wrapper`,this.themeClass],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:this.cssVars},u("div",{class:[`${o}-notification`,this.rtlEnabled&&`${o}-notification--rtl`,this.themeClass,{[`${o}-notification--closable`]:this.closable,[`${o}-notification--show-avatar`]:this.showAvatar}],style:this.cssVars},this.showAvatar?u("div",{class:`${o}-notification__avatar`},this.avatar?Xo(this.avatar):"default"!==this.type?u(co,{clsPrefix:o},{default:()=>Cd[this.type]()}):null):null,this.closable?u(me,{clsPrefix:o,class:`${o}-notification__close`,onClick:this.handleCloseClick}):null,u("div",{ref:"bodyRef",class:`${o}-notification-main`},this.title?u("div",{class:`${o}-notification-main__header`},Xo(this.title)):null,this.description?u("div",{class:`${o}-notification-main__description`},Xo(this.description)):null,this.content?u("pre",{class:`${o}-notification-main__content`},Xo(this.content)):null,this.meta||this.action?u("div",{class:`${o}-notification-main-footer`},this.meta?u("div",{class:`${o}-notification-main-footer__meta`},Xo(this.meta)):null,this.action?u("div",{class:`${o}-notification-main-footer__action`},Xo(this.action)):null):null)))}}),Pd=Object.assign(Object.assign({},wd),{duration:Number,onClose:Function,onLeave:Function,onAfterEnter:Function,onAfterLeave:Function,onHide:Function,onAfterShow:Function,onAfterHide:Function}),Id=e({name:"NotificationEnvironment",props:Object.assign(Object.assign({},Pd),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const{wipTransitionCountRef:o}=p(yd),n=J(!0);let t=null;function r(){n.value=!1,t&&window.clearTimeout(t)}return b(()=>{e.duration&&(t=window.setTimeout(r,e.duration))}),{show:n,hide:r,handleClose:function(){const{onClose:o}=e;o?Promise.resolve(o()).then(e=>{!1!==e&&r()}):r()},handleAfterLeave:function(){o.value--;const{onAfterLeave:n,onInternalAfterLeave:t,onAfterHide:r,internalKey:a}=e;n&&n(),t(a),r&&r()},handleLeave:function(o){const{onHide:n}=e;n&&n(),o.style.maxHeight="0",o.offsetHeight},handleBeforeLeave:function(e){o.value++,e.style.maxHeight=`${e.offsetHeight}px`,e.style.height=`${e.offsetHeight}px`,e.offsetHeight},handleAfterEnter:function(n){o.value--,n.style.height="",n.style.maxHeight="";const{onAfterEnter:t,onAfterShow:r}=e;t&&t(),r&&r()},handleBeforeEnter:function(e){o.value++,i(()=>{e.style.height=`${e.offsetHeight}px`,e.style.maxHeight="0",e.style.transition="none",e.offsetHeight,e.style.transition="",e.style.maxHeight=e.style.height})},handleMouseenter:function(e){e.currentTarget===e.target&&null!==t&&(window.clearTimeout(t),t=null)},handleMouseleave:function(o){o.currentTarget===o.target&&function(){const{duration:o}=e;o&&(t=window.setTimeout(r,o))}()}}},render(){return u(L,{name:"notification-transition",appear:!0,onBeforeEnter:this.handleBeforeEnter,onAfterEnter:this.handleAfterEnter,onBeforeLeave:this.handleBeforeLeave,onLeave:this.handleLeave,onAfterLeave:this.handleAfterLeave},{default:()=>this.show?u(kd,Object.assign({},yn(this.$props,Sd),{onClose:this.handleClose,onMouseenter:this.duration&&this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.duration&&this.keepAliveOnHover?this.handleMouseleave:void 0})):null})}}),Td=lo([to("notification-container","\n z-index: 4000;\n position: fixed;\n overflow: visible;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n ",[lo(">",[to("scrollbar","\n width: initial;\n overflow: visible;\n height: -moz-fit-content !important;\n height: fit-content !important;\n max-height: 100vh !important;\n ",[lo(">",[to("scrollbar-container","\n height: -moz-fit-content !important;\n height: fit-content !important;\n max-height: 100vh !important;\n ",[to("scrollbar-content","\n padding-top: 12px;\n padding-bottom: 33px;\n ")])])])]),Lo("top, top-right, top-left","\n top: 12px;\n ",[lo("&.transitioning >",[to("scrollbar",[lo(">",[to("scrollbar-container","\n min-height: 100vh !important;\n ")])])])]),Lo("bottom, bottom-right, bottom-left","\n bottom: 12px;\n ",[lo(">",[to("scrollbar",[lo(">",[to("scrollbar-container",[to("scrollbar-content","\n padding-bottom: 12px;\n ")])])])]),to("notification-wrapper","\n display: flex;\n align-items: flex-end;\n margin-bottom: 0;\n margin-top: 12px;\n ")]),Lo("top, bottom","\n left: 50%;\n transform: translateX(-50%);\n ",[to("notification-wrapper",[lo("&.notification-transition-enter-from, &.notification-transition-leave-to","\n transform: scale(0.85);\n "),lo("&.notification-transition-leave-from, &.notification-transition-enter-to","\n transform: scale(1);\n ")])]),Lo("top",[to("notification-wrapper","\n transform-origin: top center;\n ")]),Lo("bottom",[to("notification-wrapper","\n transform-origin: bottom center;\n ")]),Lo("top-right, bottom-right",[to("notification","\n margin-left: 28px;\n margin-right: 16px;\n ")]),Lo("top-left, bottom-left",[to("notification","\n margin-left: 16px;\n margin-right: 28px;\n ")]),Lo("top-right","\n right: 0;\n ",[Ad("top-right")]),Lo("top-left","\n left: 0;\n ",[Ad("top-left")]),Lo("bottom-right","\n right: 0;\n ",[Ad("bottom-right")]),Lo("bottom-left","\n left: 0;\n ",[Ad("bottom-left")]),Lo("scrollable",[Lo("top-right","\n top: 0;\n "),Lo("top-left","\n top: 0;\n "),Lo("bottom-right","\n bottom: 0;\n "),Lo("bottom-left","\n bottom: 0;\n ")]),to("notification-wrapper","\n margin-bottom: 12px;\n ",[lo("&.notification-transition-enter-from, &.notification-transition-leave-to","\n opacity: 0;\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n "),lo("&.notification-transition-leave-from, &.notification-transition-enter-to","\n opacity: 1;\n "),lo("&.notification-transition-leave-active","\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier-ease-in),\n max-height .3s var(--n-bezier),\n margin-top .3s linear,\n margin-bottom .3s linear,\n box-shadow .3s var(--n-bezier);\n "),lo("&.notification-transition-enter-active","\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier-ease-out),\n max-height .3s var(--n-bezier),\n margin-top .3s linear,\n margin-bottom .3s linear,\n box-shadow .3s var(--n-bezier);\n ")]),to("notification","\n background-color: var(--n-color);\n color: var(--n-text-color);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n font-family: inherit;\n font-size: var(--n-font-size);\n font-weight: 400;\n position: relative;\n display: flex;\n overflow: hidden;\n flex-shrink: 0;\n padding-left: var(--n-padding-left);\n padding-right: var(--n-padding-right);\n width: var(--n-width);\n max-width: calc(100vw - 16px - 16px);\n border-radius: var(--n-border-radius);\n box-shadow: var(--n-box-shadow);\n box-sizing: border-box;\n opacity: 1;\n ",[Fo("avatar",[to("icon","\n color: var(--n-icon-color);\n "),to("base-icon","\n color: var(--n-icon-color);\n ")]),Lo("show-avatar",[to("notification-main","\n margin-left: 40px;\n width: calc(100% - 40px); \n ")]),Lo("closable",[to("notification-main",[lo("> *:first-child","\n padding-right: 20px;\n ")]),Fo("close","\n position: absolute;\n top: 0;\n right: 0;\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n ")]),Fo("avatar","\n position: absolute;\n top: var(--n-padding-top);\n left: var(--n-padding-left);\n width: 28px;\n height: 28px;\n font-size: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n ",[to("icon","transition: color .3s var(--n-bezier);")]),to("notification-main","\n padding-top: var(--n-padding-top);\n padding-bottom: var(--n-padding-bottom);\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n width: calc(100% - 8px);\n ",[to("notification-main-footer","\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 12px;\n ",[Fo("meta","\n font-size: var(--n-meta-font-size);\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-description-text-color);\n "),Fo("action","\n cursor: pointer;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-action-text-color);\n ")]),Fo("header","\n font-weight: var(--n-title-font-weight);\n font-size: var(--n-title-font-size);\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-title-text-color);\n "),Fo("description","\n margin-top: 8px;\n font-size: var(--n-description-font-size);\n white-space: pre-wrap;\n word-wrap: break-word;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-description-text-color);\n "),Fo("content","\n line-height: var(--n-line-height);\n margin: 12px 0 0 0;\n font-family: inherit;\n white-space: pre-wrap;\n word-wrap: break-word;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-text-color);\n ",[lo("&:first-child","margin: 0;")])])])])]);function Ad(e){const o="left"===e.split("-")[1]?"calc(-100%)":"calc(100%)";return to("notification-wrapper",[lo("&.notification-transition-enter-from, &.notification-transition-leave-to",`\n transform: translate(${o}, 0);\n `),lo("&.notification-transition-leave-from, &.notification-transition-enter-to","\n transform: translate(0, 0);\n ")])}var zd=Ue("n-notification-api"),Rd=e({name:"NotificationProvider",props:Object.assign(Object.assign({},Ie.props),{containerClass:String,containerStyle:[String,Object],to:[String,Object],scrollable:{type:Boolean,default:!0},max:Number,placement:{type:String,default:"top-right"},keepAliveOnHover:Boolean}),setup(e){const{mergedClsPrefixRef:o}=ro(e),n=J([]),t={},r=new Set;function l(o){const a=ko(),l=()=>{r.add(a),t[a]&&t[a].hide()},i=P(Object.assign(Object.assign({},o),{key:a,destroy:l,hide:l,deactivate:l})),{max:s}=e;if(s&&n.value.length-r.size>=s){let e=!1,o=0;for(const a of n.value){if(!r.has(a.key)){t[a.key]&&(a.destroy(),e=!0);break}o++}e||n.value.splice(o,1)}return n.value.push(i),i}const i=["info","success","warning","error"].map(e=>o=>l(Object.assign(Object.assign({},o),{type:e})));const s=Ie("Notification","-notification",Td,gd,e,o),d={create:l,info:i[0],success:i[1],warning:i[2],error:i[3],open:function(e){return l(e)},destroyAll:function(){Object.values(n.value).forEach(e=>{e.hide()})}},c=J(0);return a(zd,d),a(yd,{props:e,mergedClsPrefixRef:o,mergedThemeRef:s,wipTransitionCountRef:c}),Object.assign({mergedClsPrefix:o,notificationList:n,notificationRefs:t,handleAfterLeave:function(e){r.delete(e),n.value.splice(n.value.findIndex(o=>o.key===e),1)}},d)},render(){var e,o,n;const{placement:t}=this;return u(F,null,null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e),this.notificationList.length?u(w,{to:null!==(n=this.to)&&void 0!==n?n:"body"},u(xd,{class:this.containerClass,style:this.containerStyle,scrollable:this.scrollable&&"top"!==t&&"bottom"!==t,placement:t},{default:()=>this.notificationList.map(e=>u(Id,Object.assign({ref:o=>{const n=e.key;null===o?delete this.notificationRefs[n]:this.notificationRefs[n]=o}},pr(e,["destroy","hide","deactivate"]),{internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave,keepAliveOnHover:void 0===e.keepAliveOnHover?this.keepAliveOnHover:e.keepAliveOnHover})))})):null)}});var Md=e({name:"InjectionExtractor",props:{onSetup:Function},setup(e,{slots:o}){var n;return null===(n=e.onSetup)||void 0===n||n.call(e),()=>{var e;return null===(e=o.default)||void 0===e?void 0:e.call(o)}}}),Fd={message:mn,notification:function(){const e=p(zd,null);return null===e&&ve("use-notification","No outer `n-notification-provider` found."),e},loadingBar:function(){const e=p(Js,null);return null===e&&ve("use-loading-bar","No outer <n-loading-bar-provider /> founded."),e},dialog:Mn,modal:Dn};function Od(e,{configProviderProps:o,messageProviderProps:n,dialogProviderProps:t,notificationProviderProps:r,loadingBarProviderProps:a,modalProviderProps:l}={}){const i=[];return e.forEach(e=>{switch(e){case"message":i.push({type:e,Provider:pd,props:n});break;case"notification":i.push({type:e,Provider:Rd,props:r});break;case"dialog":i.push({type:e,Provider:qs,props:t});break;case"loadingBar":i.push({type:e,Provider:nd,props:a});break;case"modal":i.push({type:e,Provider:fd,props:l})}}),function({providersAndProps:e,configProviderProps:o}){let n=A(function(){return u($i,j(o),{default:()=>e.map(({type:e,Provider:o,props:n})=>u(o,j(n),{default:()=>u(Md,{onSetup:()=>t[e]=Fd[e]()})}))})});const t={app:n};let r;return xe&&(r=document.createElement("div"),document.body.appendChild(r),n.mount(r)),Object.assign({unmount:()=>{var e;null!==n&&null!==r?(n.unmount(),null===(e=r.parentNode)||void 0===e||e.removeChild(r),r=null,n=null):Ae("discrete","unmount call no need because discrete app has been unmounted")}},t)}({providersAndProps:i,configProviderProps:o})}var Bd={name:"Divider",common:Pa,self:En};function $d(e){const{modalColor:o,textColor1:n,textColor2:t,boxShadow3:r,lineHeight:a,fontWeightStrong:l,dividerColor:i,closeColorHover:s,closeColorPressed:d,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:p,borderRadius:h,primaryColorHover:f}=e;return{bodyPadding:"16px 24px",borderRadius:h,headerPadding:"16px 24px",footerPadding:"16px 24px",color:o,textColor:t,titleTextColor:n,titleFontSize:"18px",titleFontWeight:l,boxShadow:r,lineHeight:a,headerBorderBottom:`1px solid ${i}`,footerBorderTop:`1px solid ${i}`,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:p,closeSize:"22px",closeIconSize:"18px",closeColorHover:s,closeColorPressed:d,closeBorderRadius:h,resizableTriggerColorHover:f}}var Ed=ke({name:"Drawer",common:pe,peers:{Scrollbar:$o},self:$d}),Dd={name:"Drawer",common:Pa,peers:{Scrollbar:Ia},self:$d},_d={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},Ld={name:"DynamicInput",common:Pa,peers:{Input:Al,Button:ii},self:()=>_d};var Hd,jd=ke({name:"DynamicInput",common:pe,peers:{Input:un,Button:ho},self:function(){return _d}}),Ud={name:"Space",self:()=>qn};function Wd(){if(!xe)return!0;if(void 0===Hd){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const o=1===e.scrollHeight;return document.body.removeChild(e),Hd=o}return Hd}var Nd=e({name:"Space",props:Object.assign(Object.assign({},Ie.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:n}=ro(e),t=Ie("Space","-space",void 0,Bn,e,o),r=Ce("Space",n,o);return{useGap:Wd(),rtlEnabled:r,mergedClsPrefix:o,margin:I(()=>{const{size:o}=e;if(Array.isArray(o))return{horizontal:o[0],vertical:o[1]};if("number"==typeof o)return{horizontal:o,vertical:o};const{self:{[Eo("gap",o)]:n}}=t.value,{row:r,col:a}=Ro(n);return{horizontal:fo(a),vertical:fo(r)}})}},render(){const{vertical:e,reverse:o,align:n,inline:t,justify:r,itemClass:a,itemStyle:l,margin:i,wrap:s,mergedClsPrefix:d,rtlEnabled:c,useGap:p,wrapItem:h,internalUseGap:f}=this,m=Uo(cr(this),!1);if(!m.length)return null;const v=`${i.horizontal}px`,g=i.horizontal/2+"px",b=`${i.vertical}px`,y=i.vertical/2+"px",x=m.length-1,C=r.startsWith("space-");return u("div",{role:"none",class:[`${d}-space`,c&&`${d}-space--rtl`],style:{display:t?"inline-flex":"flex",flexDirection:e&&!o?"column":e&&o?"column-reverse":!e&&o?"row-reverse":"row",justifyContent:["start","end"].includes(r)?`flex-${r}`:r,flexWrap:!s||e?"nowrap":"wrap",marginTop:p||e?"":`-${y}`,marginBottom:p||e?"":`-${y}`,alignItems:n,gap:p?`${i.vertical}px ${i.horizontal}px`:""}},h||!p&&!f?m.map((o,n)=>o.type===B?o:u("div",{role:"none",class:a,style:[l,{maxWidth:"100%"},p?"":e?{marginBottom:n!==x?b:""}:c?{marginLeft:C?"space-between"===r&&n===x?"":g:n!==x?v:"",marginRight:C?"space-between"===r&&0===n?"":g:"",paddingTop:y,paddingBottom:y}:{marginRight:C?"space-between"===r&&n===x?"":g:n!==x?v:"",marginLeft:C?"space-between"===r&&0===n?"":g:"",paddingTop:y,paddingBottom:y}]},o)):m)}}),Kd={name:"DynamicTags",common:Pa,peers:{Input:Al,Button:ii,Tag:al,Space:Ud},self:()=>({inputWidth:"64px"})},Vd=ke({name:"DynamicTags",common:pe,peers:{Input:un,Button:ho,Tag:ao,Space:Bn},self:()=>({inputWidth:"64px"})}),qd={name:"Element",common:Pa},Gd={name:"Element",common:pe},Jd={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},Yd={name:"Flex",self:()=>Jd};var Zd={name:"Flex",self:function(){return Jd}},Xd={name:"ButtonGroup",common:Pa},Qd={name:"ButtonGroup",common:pe},ec={name:"Form",common:Pa,self:jn},oc={name:"GradientText",common:Pa,self(e){const{primaryColor:o,successColor:n,warningColor:t,errorColor:r,infoColor:a,primaryColorSuppl:l,successColorSuppl:i,warningColorSuppl:s,errorColorSuppl:d,infoColorSuppl:c,fontWeightStrong:u}=e;return{fontWeight:u,rotate:"252deg",colorStartPrimary:o,colorEndPrimary:l,colorStartInfo:a,colorEndInfo:c,colorStartWarning:t,colorEndWarning:s,colorStartError:r,colorEndError:d,colorStartSuccess:n,colorEndSuccess:i}}};var nc={name:"GradientText",common:pe,self:function(e){const{primaryColor:o,successColor:n,warningColor:t,errorColor:r,infoColor:a,fontWeightStrong:l}=e;return{fontWeight:l,rotate:"252deg",colorStartPrimary:qe(o,{alpha:.6}),colorEndPrimary:o,colorStartInfo:qe(a,{alpha:.6}),colorEndInfo:a,colorStartWarning:qe(t,{alpha:.6}),colorEndWarning:t,colorStartError:qe(r,{alpha:.6}),colorEndError:r,colorStartSuccess:qe(n,{alpha:.6}),colorEndSuccess:n}}},tc={name:"InputNumber",common:Pa,peers:{Button:ii,Input:Al},self(e){const{textColorDisabled:o}=e;return{iconColorDisabled:o}}};var rc=ke({name:"InputNumber",common:pe,peers:{Button:ho,Input:un},self:function(e){const{textColorDisabled:o}=e;return{iconColorDisabled:o}}});function ac(){return{inputWidthSmall:"24px",inputWidthMedium:"30px",inputWidthLarge:"36px",gapSmall:"8px",gapMedium:"8px",gapLarge:"8px"}}var lc=ke({name:"InputOtp",common:pe,peers:{Input:un},self:ac}),ic={name:"InputOtp",common:Pa,peers:{Input:Al},self:ac},sc={name:"Layout",common:Pa,peers:{Scrollbar:Ia},self(e){const{textColor2:o,bodyColor:n,popoverColor:t,cardColor:r,dividerColor:a,scrollbarColor:l,scrollbarColorHover:i}=e;return{textColor:o,textColorInverted:o,color:n,colorEmbedded:n,headerColor:r,headerColorInverted:r,footerColor:r,footerColorInverted:r,headerBorderColor:a,headerBorderColorInverted:a,footerBorderColor:a,footerBorderColorInverted:a,siderBorderColor:a,siderBorderColorInverted:a,siderColor:r,siderColorInverted:r,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:t,siderToggleButtonIconColor:o,siderToggleButtonIconColorInverted:o,siderToggleBarColor:yo(n,l),siderToggleBarColorHover:yo(n,i),__invertScrollbar:"false"}}};var dc=ke({name:"Layout",common:pe,peers:{Scrollbar:$o},self:function(e){const{baseColor:o,textColor2:n,bodyColor:t,cardColor:r,dividerColor:a,actionColor:l,scrollbarColor:i,scrollbarColorHover:s,invertedColor:d}=e;return{textColor:n,textColorInverted:"#FFF",color:t,colorEmbedded:l,headerColor:r,headerColorInverted:d,footerColor:l,footerColorInverted:d,headerBorderColor:a,headerBorderColorInverted:d,footerBorderColor:a,footerBorderColorInverted:d,siderBorderColor:a,siderBorderColorInverted:d,siderColor:r,siderColorInverted:d,siderToggleButtonBorder:`1px solid ${a}`,siderToggleButtonColor:o,siderToggleButtonIconColor:n,siderToggleButtonIconColorInverted:n,siderToggleBarColor:yo(t,i),siderToggleBarColorHover:yo(t,s),__invertScrollbar:"true"}}}),cc={name:"Row",common:Pa},uc={name:"Row",common:pe};function pc(e){const{textColor2:o,cardColor:n,modalColor:t,popoverColor:r,dividerColor:a,borderRadius:l,fontSize:i,hoverColor:s}=e;return{textColor:o,color:n,colorHover:s,colorModal:t,colorHoverModal:yo(t,s),colorPopover:r,colorHoverPopover:yo(r,s),borderColor:a,borderColorModal:yo(t,a),borderColorPopover:yo(r,a),borderRadius:l,fontSize:i}}var hc={name:"List",common:pe,self:pc},fc={name:"List",common:Pa,self:pc},mc={name:"Log",common:Pa,peers:{Scrollbar:Ia,Code:ki},self(e){const{textColor2:o,inputColor:n,fontSize:t,primaryColor:r}=e;return{loaderFontSize:t,loaderTextColor:o,loaderColor:n,loaderBorder:"1px solid #0000",loadingColor:r}}};var vc=ke({name:"Log",common:pe,peers:{Scrollbar:$o,Code:Pi},self:function(e){const{textColor2:o,modalColor:n,borderColor:t,fontSize:r,primaryColor:a}=e;return{loaderFontSize:r,loaderTextColor:o,loaderColor:n,loaderBorder:`1px solid ${t}`,loadingColor:a}}}),gc={name:"Mention",common:Pa,peers:{InternalSelectMenu:Qa,Input:Al},self(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}};var bc=ke({name:"Mention",common:pe,peers:{InternalSelectMenu:nn,Input:un},self:function(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}});function yc(e){const{borderRadius:o,textColor3:n,primaryColor:t,textColor2:r,textColor1:a,fontSize:l,dividerColor:i,hoverColor:s,primaryColorHover:d}=e;return Object.assign({borderRadius:o,color:"#0000",groupTextColor:n,itemColorHover:s,itemColorActive:qe(t,{alpha:.1}),itemColorActiveHover:qe(t,{alpha:.1}),itemColorActiveCollapsed:qe(t,{alpha:.1}),itemTextColor:r,itemTextColorHover:r,itemTextColorActive:t,itemTextColorActiveHover:t,itemTextColorChildActive:t,itemTextColorChildActiveHover:t,itemTextColorHorizontal:r,itemTextColorHoverHorizontal:d,itemTextColorActiveHorizontal:t,itemTextColorActiveHoverHorizontal:t,itemTextColorChildActiveHorizontal:t,itemTextColorChildActiveHoverHorizontal:t,itemIconColor:a,itemIconColorHover:a,itemIconColorActive:t,itemIconColorActiveHover:t,itemIconColorChildActive:t,itemIconColorChildActiveHover:t,itemIconColorCollapsed:a,itemIconColorHorizontal:a,itemIconColorHoverHorizontal:d,itemIconColorActiveHorizontal:t,itemIconColorActiveHoverHorizontal:t,itemIconColorChildActiveHorizontal:t,itemIconColorChildActiveHoverHorizontal:t,itemHeight:"42px",arrowColor:r,arrowColorHover:r,arrowColorActive:t,arrowColorActiveHover:t,arrowColorChildActive:t,arrowColorChildActiveHover:t,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:l,dividerColor:i},{itemColorHoverInverted:"#0000",itemColorActiveInverted:u=t,itemColorActiveHoverInverted:u,itemColorActiveCollapsedInverted:u,itemTextColorInverted:c="#BBB",itemTextColorHoverInverted:p="#FFF",itemTextColorChildActiveInverted:p,itemTextColorChildActiveHoverInverted:p,itemTextColorActiveInverted:p,itemTextColorActiveHoverInverted:p,itemTextColorHorizontalInverted:c,itemTextColorHoverHorizontalInverted:p,itemTextColorChildActiveHorizontalInverted:p,itemTextColorChildActiveHoverHorizontalInverted:p,itemTextColorActiveHorizontalInverted:p,itemTextColorActiveHoverHorizontalInverted:p,itemIconColorInverted:c,itemIconColorHoverInverted:p,itemIconColorActiveInverted:p,itemIconColorActiveHoverInverted:p,itemIconColorChildActiveInverted:p,itemIconColorChildActiveHoverInverted:p,itemIconColorCollapsedInverted:c,itemIconColorHorizontalInverted:c,itemIconColorHoverHorizontalInverted:p,itemIconColorActiveHorizontalInverted:p,itemIconColorActiveHoverHorizontalInverted:p,itemIconColorChildActiveHorizontalInverted:p,itemIconColorChildActiveHoverHorizontalInverted:p,arrowColorInverted:c,arrowColorHoverInverted:p,arrowColorActiveInverted:p,arrowColorActiveHoverInverted:p,arrowColorChildActiveInverted:p,arrowColorChildActiveHoverInverted:p,groupTextColorInverted:"#AAA"});var c,u,p}var xc=ke({name:"Menu",common:pe,peers:{Tooltip:Zi,Dropdown:qi},self:yc}),Cc={name:"Menu",common:Pa,peers:{Tooltip:Yi,Dropdown:Gi},self(e){const{primaryColor:o,primaryColorSuppl:n}=e,t=yc(e);return t.itemColorActive=qe(o,{alpha:.15}),t.itemColorActiveHover=qe(o,{alpha:.15}),t.itemColorActiveCollapsed=qe(o,{alpha:.15}),t.itemColorActiveInverted=n,t.itemColorActiveHoverInverted=n,t.itemColorActiveCollapsedInverted=n,t}},wc={titleFontSize:"18px",backSize:"22px"};function Sc(e){const{textColor1:o,textColor2:n,textColor3:t,fontSize:r,fontWeightStrong:a,primaryColorHover:l,primaryColorPressed:i}=e;return Object.assign(Object.assign({},wc),{titleFontWeight:a,fontSize:r,titleTextColor:o,backColor:n,backColorHover:l,backColorPressed:i,subtitleTextColor:t})}var kc=ke({name:"PageHeader",common:pe,self:Sc}),Pc={name:"PageHeader",common:Pa,self:Sc},Ic={iconSize:"22px"};function Tc(e){const{fontSize:o,warningColor:n}=e;return Object.assign(Object.assign({},Ic),{fontSize:o,iconColor:n})}var Ac=ke({name:"Popconfirm",common:pe,peers:{Button:ho,Popover:pn},self:Tc}),zc={name:"Popconfirm",common:Pa,peers:{Button:ii,Popover:rl},self:Tc};function Rc(e){const{infoColor:o,successColor:n,warningColor:t,errorColor:r,textColor2:a,progressRailColor:l,fontSize:i,fontWeight:s}=e;return{fontSize:i,fontSizeCircle:"28px",fontWeightCircle:s,railColor:l,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:o,iconColorInfo:o,iconColorSuccess:n,iconColorWarning:t,iconColorError:r,textColorCircle:a,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:a,fillColor:o,fillColorInfo:o,fillColorSuccess:n,fillColorWarning:t,fillColorError:r,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}}var Mc={name:"Progress",common:pe,self:Rc},Fc={name:"Progress",common:Pa,self(e){const o=Rc(e);return o.textColorLineInner="rgb(0, 0, 0)",o.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",o}},Oc={name:"Rate",common:Pa,self(e){const{railColor:o}=e;return{itemColor:o,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}};var Bc={name:"Rate",common:pe,self:function(e){const{railColor:o}=e;return{itemColor:o,itemColorActive:"#FFCC33",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}},$c={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0};function Ec(e){const{textColor2:o,textColor1:n,errorColor:t,successColor:r,infoColor:a,warningColor:l,lineHeight:i,fontWeightStrong:s}=e;return Object.assign(Object.assign({},$c),{lineHeight:i,titleFontWeight:s,titleTextColor:n,textColor:o,iconColorError:t,iconColorSuccess:r,iconColorInfo:a,iconColorWarning:l})}var Dc={name:"Result",common:pe,self:Ec},_c={name:"Result",common:Pa,self:Ec},Lc={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},Hc={name:"Slider",common:Pa,self(e){const{railColor:o,modalColor:n,primaryColorSuppl:t,popoverColor:r,textColor2:a,cardColor:l,borderRadius:i,fontSize:s,opacityDisabled:d}=e;return Object.assign(Object.assign({},Lc),{fontSize:s,markFontSize:s,railColor:o,railColorHover:o,fillColor:t,fillColorHover:t,opacityDisabled:d,handleColor:"#FFF",dotColor:l,dotColorModal:n,dotColorPopover:r,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:r,indicatorBoxShadow:"0 2px 8px 0 rgba(0, 0, 0, 0.12)",indicatorTextColor:a,indicatorBorderRadius:i,dotBorder:`2px solid ${o}`,dotBorderActive:`2px solid ${t}`,dotBoxShadow:""})}};var jc={name:"Slider",common:pe,self:function(e){const{railColor:o,primaryColor:n,baseColor:t,cardColor:r,modalColor:a,popoverColor:l,borderRadius:i,fontSize:s,opacityDisabled:d}=e;return Object.assign(Object.assign({},Lc),{fontSize:s,markFontSize:s,railColor:o,railColorHover:o,fillColor:n,fillColorHover:n,opacityDisabled:d,handleColor:"#FFF",dotColor:r,dotColorModal:a,dotColorPopover:l,handleBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",handleBoxShadowHover:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",handleBoxShadowActive:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",handleBoxShadowFocus:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",indicatorColor:"rgba(0, 0, 0, .85)",indicatorBoxShadow:"0 2px 8px 0 rgba(0, 0, 0, 0.12)",indicatorTextColor:t,indicatorBorderRadius:i,dotBorder:`2px solid ${o}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}},Uc={name:"Spin",common:Pa,self:vo};function Wc(e){const{textColor2:o,textColor3:n,fontSize:t,fontWeight:r}=e;return{labelFontSize:t,labelFontWeight:r,valueFontWeight:r,valueFontSize:"24px",labelTextColor:n,valuePrefixTextColor:o,valueSuffixTextColor:o,valueTextColor:o}}var Nc={name:"Statistic",common:pe,self:Wc},Kc={name:"Statistic",common:Pa,self:Wc},Vc={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"};function qc(e){const{fontWeightStrong:o,baseColor:n,textColorDisabled:t,primaryColor:r,errorColor:a,textColor1:l,textColor2:i}=e;return Object.assign(Object.assign({},Vc),{stepHeaderFontWeight:o,indicatorTextColorProcess:n,indicatorTextColorWait:t,indicatorTextColorFinish:r,indicatorTextColorError:a,indicatorBorderColorProcess:r,indicatorBorderColorWait:t,indicatorBorderColorFinish:r,indicatorBorderColorError:a,indicatorColorProcess:r,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:t,splitorColorWait:t,splitorColorFinish:r,splitorColorError:t,headerTextColorProcess:l,headerTextColorWait:t,headerTextColorFinish:t,headerTextColorError:a,descriptionTextColorProcess:i,descriptionTextColorWait:t,descriptionTextColorFinish:t,descriptionTextColorError:a})}var Gc={name:"Steps",common:pe,self:qc},Jc={name:"Steps",common:Pa,self:qc},Yc={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},Zc={name:"Switch",common:Pa,self(e){const{primaryColorSuppl:o,opacityDisabled:n,borderRadius:t,primaryColor:r,textColor2:a,baseColor:l}=e;return Object.assign(Object.assign({},Yc),{iconColor:l,textColor:a,loadingColor:o,opacityDisabled:n,railColor:"rgba(255, 255, 255, .20)",railColorActive:o,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:t,railBorderRadiusMedium:t,railBorderRadiusLarge:t,buttonBorderRadiusSmall:t,buttonBorderRadiusMedium:t,buttonBorderRadiusLarge:t,boxShadowFocus:`0 0 8px 0 ${qe(r,{alpha:.3})}`})}};var Xc={name:"Switch",common:pe,self:function(e){const{primaryColor:o,opacityDisabled:n,borderRadius:t,textColor3:r}=e;return Object.assign(Object.assign({},Yc),{iconColor:r,textColor:"white",loadingColor:o,opacityDisabled:n,railColor:"rgba(0, 0, 0, .14)",railColorActive:o,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:t,railBorderRadiusMedium:t,railBorderRadiusLarge:t,buttonBorderRadiusSmall:t,buttonBorderRadiusMedium:t,buttonBorderRadiusLarge:t,boxShadowFocus:`0 0 0 2px ${qe(o,{alpha:.2})}`})}},Qc={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"};function eu(e){const{dividerColor:o,cardColor:n,modalColor:t,popoverColor:r,tableHeaderColor:a,tableColorStriped:l,textColor1:i,textColor2:s,borderRadius:d,fontWeightStrong:c,lineHeight:u,fontSizeSmall:p,fontSizeMedium:h,fontSizeLarge:f}=e;return Object.assign(Object.assign({},Qc),{fontSizeSmall:p,fontSizeMedium:h,fontSizeLarge:f,lineHeight:u,borderRadius:d,borderColor:yo(n,o),borderColorModal:yo(t,o),borderColorPopover:yo(r,o),tdColor:n,tdColorModal:t,tdColorPopover:r,tdColorStriped:yo(n,l),tdColorStripedModal:yo(t,l),tdColorStripedPopover:yo(r,l),thColor:yo(n,a),thColorModal:yo(t,a),thColorPopover:yo(r,a),thTextColor:i,tdTextColor:s,thFontWeight:c})}var ou={name:"Table",common:pe,self:eu},nu={name:"Table",common:Pa,self:eu},tu={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"};function ru(e){const{textColor2:o,primaryColor:n,textColorDisabled:t,closeIconColor:r,closeIconColorHover:a,closeIconColorPressed:l,closeColorHover:i,closeColorPressed:s,tabColor:d,baseColor:c,dividerColor:u,fontWeight:p,textColor1:h,borderRadius:f,fontSize:m,fontWeightStrong:v}=e;return Object.assign(Object.assign({},tu),{colorSegment:d,tabFontSizeCard:m,tabTextColorLine:h,tabTextColorActiveLine:n,tabTextColorHoverLine:n,tabTextColorDisabledLine:t,tabTextColorSegment:h,tabTextColorActiveSegment:o,tabTextColorHoverSegment:o,tabTextColorDisabledSegment:t,tabTextColorBar:h,tabTextColorActiveBar:n,tabTextColorHoverBar:n,tabTextColorDisabledBar:t,tabTextColorCard:h,tabTextColorHoverCard:h,tabTextColorActiveCard:n,tabTextColorDisabledCard:t,barColor:n,closeIconColor:r,closeIconColorHover:a,closeIconColorPressed:l,closeColorHover:i,closeColorPressed:s,closeBorderRadius:f,tabColor:d,tabColorSegment:c,tabBorderColor:u,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:f,paneTextColor:o,fontWeightStrong:v})}var au={name:"Tabs",common:pe,self:ru},lu={name:"Tabs",common:Pa,self(e){const o=ru(e),{inputColor:n}=e;return o.colorSegment=n,o.tabColorSegment=n,o}};function iu(e){const{textColor1:o,textColor2:n,fontWeightStrong:t,fontSize:r}=e;return{fontSize:r,titleTextColor:o,textColor:n,titleFontWeight:t}}var su={name:"Thing",common:pe,self:iu},du={name:"Thing",common:Pa,self:iu},cu={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},uu={name:"Timeline",common:Pa,self(e){const{textColor3:o,infoColorSuppl:n,errorColorSuppl:t,successColorSuppl:r,warningColorSuppl:a,textColor1:l,textColor2:i,railColor:s,fontWeightStrong:d,fontSize:c}=e;return Object.assign(Object.assign({},cu),{contentFontSize:c,titleFontWeight:d,circleBorder:`2px solid ${o}`,circleBorderInfo:`2px solid ${n}`,circleBorderError:`2px solid ${t}`,circleBorderSuccess:`2px solid ${r}`,circleBorderWarning:`2px solid ${a}`,iconColor:o,iconColorInfo:n,iconColorError:t,iconColorSuccess:r,iconColorWarning:a,titleTextColor:l,contentTextColor:i,metaTextColor:o,lineColor:s})}};var pu={name:"Timeline",common:pe,self:function(e){const{textColor3:o,infoColor:n,errorColor:t,successColor:r,warningColor:a,textColor1:l,textColor2:i,railColor:s,fontWeightStrong:d,fontSize:c}=e;return Object.assign(Object.assign({},cu),{contentFontSize:c,titleFontWeight:d,circleBorder:`2px solid ${o}`,circleBorderInfo:`2px solid ${n}`,circleBorderError:`2px solid ${t}`,circleBorderSuccess:`2px solid ${r}`,circleBorderWarning:`2px solid ${a}`,iconColor:o,iconColorInfo:n,iconColorError:t,iconColorSuccess:r,iconColorWarning:a,titleTextColor:l,contentTextColor:i,metaTextColor:o,lineColor:s})}},hu={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},fu={name:"Transfer",common:Pa,peers:{Checkbox:vi,Scrollbar:Ia,Input:Al,Empty:Ya,Button:ii},self(e){const{fontWeight:o,fontSizeLarge:n,fontSizeMedium:t,fontSizeSmall:r,heightLarge:a,heightMedium:l,borderRadius:i,inputColor:s,tableHeaderColor:d,textColor1:c,textColorDisabled:u,textColor2:p,textColor3:h,hoverColor:f,closeColorHover:m,closeColorPressed:v,closeIconColor:g,closeIconColorHover:b,closeIconColorPressed:y,dividerColor:x}=e;return Object.assign(Object.assign({},hu),{itemHeightSmall:l,itemHeightMedium:l,itemHeightLarge:a,fontSizeSmall:r,fontSizeMedium:t,fontSizeLarge:n,borderRadius:i,dividerColor:x,borderColor:"#0000",listColor:s,headerColor:d,titleTextColor:c,titleTextColorDisabled:u,extraTextColor:h,extraTextColorDisabled:u,itemTextColor:p,itemTextColorDisabled:u,itemColorPending:f,titleFontWeight:o,closeColorHover:m,closeColorPressed:v,closeIconColor:g,closeIconColorHover:b,closeIconColorPressed:y})}};var mu=ke({name:"Transfer",common:pe,peers:{Checkbox:kn,Scrollbar:$o,Input:un,Empty:Ne,Button:ho},self:function(e){const{fontWeight:o,fontSizeLarge:n,fontSizeMedium:t,fontSizeSmall:r,heightLarge:a,heightMedium:l,borderRadius:i,cardColor:s,tableHeaderColor:d,textColor1:c,textColorDisabled:u,textColor2:p,textColor3:h,borderColor:f,hoverColor:m,closeColorHover:v,closeColorPressed:g,closeIconColor:b,closeIconColorHover:y,closeIconColorPressed:x}=e;return Object.assign(Object.assign({},hu),{itemHeightSmall:l,itemHeightMedium:l,itemHeightLarge:a,fontSizeSmall:r,fontSizeMedium:t,fontSizeLarge:n,borderRadius:i,dividerColor:f,borderColor:f,listColor:s,headerColor:yo(s,d),titleTextColor:c,titleTextColorDisabled:u,extraTextColor:h,extraTextColorDisabled:u,itemTextColor:p,itemTextColorDisabled:u,itemColorPending:m,titleFontWeight:o,closeColorHover:v,closeColorPressed:g,closeIconColor:b,closeIconColorHover:y,closeIconColorPressed:x})}});function vu(e){const{borderRadiusSmall:o,dividerColor:n,hoverColor:t,pressedColor:r,primaryColor:a,textColor3:l,textColor2:i,textColorDisabled:s,fontSize:d}=e;return{fontSize:d,lineHeight:"1.5",nodeHeight:"30px",nodeWrapperPadding:"3px 0",nodeBorderRadius:o,nodeColorHover:t,nodeColorPressed:r,nodeColorActive:qe(a,{alpha:.1}),arrowColor:l,nodeTextColor:i,nodeTextColorDisabled:s,loadingColor:a,dropMarkColor:a,lineColor:n}}var gu=ke({name:"Tree",common:pe,peers:{Checkbox:kn,Scrollbar:$o,Empty:Ne},self:vu}),bu={name:"Tree",common:Pa,peers:{Checkbox:vi,Scrollbar:Ia,Empty:Ya},self(e){const{primaryColor:o}=e,n=vu(e);return n.nodeColorActive=qe(o,{alpha:.15}),n}},yu={name:"TreeSelect",common:Pa,peers:{Tree:bu,Empty:Ya,InternalSelection:pl}};var xu=ke({name:"TreeSelect",common:pe,peers:{Tree:gu,Empty:Ne,InternalSelection:Qo},self:function(e){const{popoverColor:o,boxShadow2:n,borderRadius:t,heightMedium:r,dividerColor:a,textColor2:l}=e;return{menuPadding:"4px",menuColor:o,menuBoxShadow:n,menuBorderRadius:t,menuHeight:`calc(${r} * 7.6)`,actionDividerColor:a,actionTextColor:l,actionPadding:"8px 12px",headerDividerColor:a,headerTextColor:l,headerPadding:"8px 12px"}}}),Cu={name:"Typography",common:Pa,self:Zn};function wu(e){const{iconColor:o,primaryColor:n,errorColor:t,textColor2:r,successColor:a,opacityDisabled:l,actionColor:i,borderColor:s,hoverColor:d,lineHeight:c,borderRadius:u,fontSize:p}=e;return{fontSize:p,lineHeight:c,borderRadius:u,draggerColor:i,draggerBorder:`1px dashed ${s}`,draggerBorderHover:`1px dashed ${n}`,itemColorHover:d,itemColorHoverError:qe(t,{alpha:.06}),itemTextColor:r,itemTextColorError:t,itemTextColorSuccess:a,itemIconColor:o,itemDisabledOpacity:l,itemBorderImageCardError:`1px solid ${t}`,itemBorderImageCard:`1px solid ${s}`}}var Su=ke({name:"Upload",common:pe,peers:{Button:ho,Progress:Mc},self:wu}),ku={name:"Upload",common:Pa,peers:{Button:ii,Progress:Fc},self(e){const{errorColor:o}=e,n=wu(e);return n.itemColorHoverError=qe(o,{alpha:.09}),n}},Pu={name:"Watermark",common:Pa,self(e){const{fontFamily:o}=e;return{fontFamily:o}}},Iu=ke({name:"Watermark",common:pe,self(e){const{fontFamily:o}=e;return{fontFamily:o}}});var Tu={name:"FloatButtonGroup",common:pe,self:function(e){const{popoverColor:o,dividerColor:n,borderRadius:t}=e;return{color:o,buttonBorderColor:n,borderRadiusSquare:t,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)"}}},Au={name:"FloatButton",common:Pa,self(e){const{popoverColor:o,textColor2:n,buttonColor2Hover:t,buttonColor2Pressed:r,primaryColor:a,primaryColorHover:l,primaryColorPressed:i,baseColor:s,borderRadius:d}=e;return{color:o,textColor:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)",colorHover:t,colorPressed:r,colorPrimary:a,colorPrimaryHover:l,colorPrimaryPressed:i,textColorPrimary:s,borderRadiusSquare:d}}};var zu={name:"FloatButton",common:pe,self:function(e){const{popoverColor:o,textColor2:n,buttonColor2Hover:t,buttonColor2Pressed:r,primaryColor:a,primaryColorHover:l,primaryColorPressed:i,borderRadius:s}=e;return{color:o,colorHover:t,colorPressed:r,colorPrimary:a,colorPrimaryHover:l,colorPrimaryPressed:i,textColor:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .16)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .24)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .24)",textColorPrimary:"#fff",borderRadiusSquare:s}}},Ru=Ue("n-form"),Mu=Ue("n-form-item-insts"),Fu=to("form",[Lo("inline","\n width: 100%;\n display: inline-flex;\n align-items: flex-start;\n align-content: space-around;\n ",[to("form-item",{width:"auto",marginRight:"18px"},[lo("&:last-child",{marginRight:0})])])]),Ou=function(e,o,n,t){return new(n||(n=Promise))(function(r,a){function l(e){try{s(t.next(e))}catch(o){a(o)}}function i(e){try{s(t.throw(e))}catch(o){a(o)}}function s(e){var o;e.done?r(e.value):(o=e.value,o instanceof n?o:new n(function(e){e(o)})).then(l,i)}s((t=t.apply(e,o||[])).next())})},Bu=e({name:"Form",props:Object.assign(Object.assign({},Ie.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),setup(e){const{mergedClsPrefixRef:o}=ro(e);Ie("Form","-form",Fu,Jn,e,o);const n={},t=J(void 0);return a(Ru,{props:e,maxChildLabelWidthRef:t,deriveMaxChildLabelWidth:e=>{const o=t.value;(void 0===o||e>=o)&&(t.value=e)}}),a(Mu,{formItems:n}),Object.assign({validate:function(e){return Ou(this,arguments,void 0,function*(e,o=()=>!0){return yield new Promise((t,r)=>{const a=[];for(const e of Pn(n)){const t=n[e];for(const e of t)e.path&&a.push(e.internalValidate(null,o))}Promise.all(a).then(o=>{const n=o.some(e=>!e.valid),a=[],l=[];o.forEach(e=>{var o,n;(null===(o=e.errors)||void 0===o?void 0:o.length)&&a.push(e.errors),(null===(n=e.warnings)||void 0===n?void 0:n.length)&&l.push(e.warnings)}),e&&e(a.length?a:void 0,{warnings:l.length?l:void 0}),n?r(a.length?a:void 0):t({warnings:l.length?l:void 0})})})})},restoreValidation:function(){for(const e of Pn(n)){const o=n[e];for(const e of o)e.restoreValidation()}}},{mergedClsPrefix:o})},render(){const{mergedClsPrefix:e}=this;return u("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function $u(){return $u=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},$u.apply(this,arguments)}function Eu(e){return Eu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Eu(e)}function Du(e,o){return Du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,o){return e.__proto__=o,e},Du(e,o)}function _u(e,o,n){return _u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,o,n){var t=[null];t.push.apply(t,o);var r=new(Function.bind.apply(e,t));return n&&Du(r,n.prototype),r},_u.apply(null,arguments)}function Lu(e){var o="function"==typeof Map?new Map:void 0;return Lu=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(e))return o.get(e);o.set(e,t)}function t(){return _u(e,arguments,Eu(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Du(t,e)},Lu(e)}var Hu=/%[sdj%]/g;function ju(e){if(!e||!e.length)return null;var o={};return e.forEach(function(e){var n=e.field;o[n]=o[n]||[],o[n].push(e)}),o}function Uu(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),t=1;t<o;t++)n[t-1]=arguments[t];var r=0,a=n.length;return"function"==typeof e?e.apply(null,n):"string"==typeof e?e.replace(Hu,function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(o){return"[Circular]"}default:return e}}):e}function Wu(e,o){return null==e||(!("array"!==o||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(o)||"string"!=typeof e||e))}function Nu(e,o,n){var t=0,r=e.length;!function a(l){if(l&&l.length)n(l);else{var i=t;t+=1,i<r?o(e[i],a):n([])}}([])}var Ku=function(e){var o,n;function t(o,n){var t=e.call(this,"Async Validation Error")||this;return t.errors=o,t.fields=n,t}return n=e,(o=t).prototype=Object.create(n.prototype),o.prototype.constructor=o,Du(o,n),t}(Lu(Error));function Vu(e,o,n,t,r){if(o.first){var a=new Promise(function(o,a){Nu(function(e){var o=[];return Object.keys(e).forEach(function(n){o.push.apply(o,e[n]||[])}),o}(e),n,function(e){return t(e),e.length?a(new Ku(e,ju(e))):o(r)})});return a.catch(function(e){return e}),a}var l=!0===o.firstFields?Object.keys(e):o.firstFields||[],i=Object.keys(e),s=i.length,d=0,c=[],u=new Promise(function(o,a){var u=function(e){if(c.push.apply(c,e),++d===s)return t(c),c.length?a(new Ku(c,ju(c))):o(r)};i.length||(t(c),o(r)),i.forEach(function(o){var t=e[o];-1!==l.indexOf(o)?Nu(t,n,u):function(e,o,n){var t=[],r=0,a=e.length;function l(e){t.push.apply(t,e||[]),++r===a&&n(t)}e.forEach(function(e){o(e,l)})}(t,n,u)})});return u.catch(function(e){return e}),u}function qu(e,o){return function(n){var t,r;return t=e.fullFields?function(e,o){for(var n=e,t=0;t<o.length;t++){if(null==n)return n;n=n[o[t]]}return n}(o,e.fullFields):o[n.field||e.fullField],(r=n)&&void 0!==r.message?(n.field=n.field||e.fullField,n.fieldValue=t,n):{message:"function"==typeof n?n():n,fieldValue:t,field:n.field||e.fullField}}}function Gu(e,o){if(o)for(var n in o)if(o.hasOwnProperty(n)){var t=o[n];"object"==typeof t&&"object"==typeof e[n]?e[n]=$u({},e[n],t):e[n]=t}return e}var Ju,Yu=function(e,o,n,t,r,a){!e.required||n.hasOwnProperty(e.field)&&!Wu(o,a||e.type)||t.push(Uu(r.messages.required,e.fullField))},Zu=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,Xu=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Qu={integer:function(e){return Qu.number(e)&&parseInt(e,10)===e},float:function(e){return Qu.number(e)&&!Qu.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(o){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"==typeof e&&!Qu.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(Zu)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(function(){if(Ju)return Ju;var e="[a-fA-F\\d:]",o=function(o){return o&&o.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",t="[a-fA-F\\d]{1,4}",r=("\n(?:\n(?:"+t+":){7}(?:"+t+"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:"+t+":){6}(?:"+n+"|:"+t+"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:"+t+":){5}(?::"+n+"|(?::"+t+"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:"+t+":){4}(?:(?::"+t+"){0,1}:"+n+"|(?::"+t+"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:"+t+":){3}(?:(?::"+t+"){0,2}:"+n+"|(?::"+t+"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:"+t+":){2}(?:(?::"+t+"){0,3}:"+n+"|(?::"+t+"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:"+t+":){1}(?:(?::"+t+"){0,4}:"+n+"|(?::"+t+"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::"+t+"){0,5}:"+n+"|(?::"+t+"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+n+"$)|(?:^"+r+"$)"),l=new RegExp("^"+n+"$"),i=new RegExp("^"+r+"$"),s=function(e){return e&&e.exact?a:new RegExp("(?:"+o(e)+n+o(e)+")|(?:"+o(e)+r+o(e)+")","g")};s.v4=function(e){return e&&e.exact?l:new RegExp(""+o(e)+n+o(e),"g")},s.v6=function(e){return e&&e.exact?i:new RegExp(""+o(e)+r+o(e),"g")};var d=s.v4().source,c=s.v6().source;return Ju=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+d+"|"+c+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(e){return"string"==typeof e&&!!e.match(Xu)}},ep="enum",op={required:Yu,whitespace:function(e,o,n,t,r){(/^\s+$/.test(o)||""===o)&&t.push(Uu(r.messages.whitespace,e.fullField))},type:function(e,o,n,t,r){if(e.required&&void 0===o)Yu(e,o,n,t,r);else{var a=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(a)>-1?Qu[a](o)||t.push(Uu(r.messages.types[a],e.fullField,e.type)):a&&typeof o!==e.type&&t.push(Uu(r.messages.types[a],e.fullField,e.type))}},range:function(e,o,n,t,r){var a="number"==typeof e.len,l="number"==typeof e.min,i="number"==typeof e.max,s=o,d=null,c="number"==typeof o,u="string"==typeof o,p=Array.isArray(o);if(c?d="number":u?d="string":p&&(d="array"),!d)return!1;p&&(s=o.length),u&&(s=o.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?s!==e.len&&t.push(Uu(r.messages[d].len,e.fullField,e.len)):l&&!i&&s<e.min?t.push(Uu(r.messages[d].min,e.fullField,e.min)):i&&!l&&s>e.max?t.push(Uu(r.messages[d].max,e.fullField,e.max)):l&&i&&(s<e.min||s>e.max)&&t.push(Uu(r.messages[d].range,e.fullField,e.min,e.max))},enum:function(e,o,n,t,r){e[ep]=Array.isArray(e[ep])?e[ep]:[],-1===e[ep].indexOf(o)&&t.push(Uu(r.messages[ep],e.fullField,e[ep].join(", ")))},pattern:function(e,o,n,t,r){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(o)||t.push(Uu(r.messages.pattern.mismatch,e.fullField,o,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(o)||t.push(Uu(r.messages.pattern.mismatch,e.fullField,o,e.pattern))))}},np=function(e,o,n,t,r){var a=e.type,l=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o,a)&&!e.required)return n();op.required(e,o,t,l,r,a),Wu(o,a)||op.type(e,o,t,l,r)}n(l)},tp={string:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o,"string")&&!e.required)return n();op.required(e,o,t,a,r,"string"),Wu(o,"string")||(op.type(e,o,t,a,r),op.range(e,o,t,a,r),op.pattern(e,o,t,a,r),!0===e.whitespace&&op.whitespace(e,o,t,a,r))}n(a)},method:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o)&&!e.required)return n();op.required(e,o,t,a,r),void 0!==o&&op.type(e,o,t,a,r)}n(a)},number:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(""===o&&(o=void 0),Wu(o)&&!e.required)return n();op.required(e,o,t,a,r),void 0!==o&&(op.type(e,o,t,a,r),op.range(e,o,t,a,r))}n(a)},boolean:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o)&&!e.required)return n();op.required(e,o,t,a,r),void 0!==o&&op.type(e,o,t,a,r)}n(a)},regexp:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o)&&!e.required)return n();op.required(e,o,t,a,r),Wu(o)||op.type(e,o,t,a,r)}n(a)},integer:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o)&&!e.required)return n();op.required(e,o,t,a,r),void 0!==o&&(op.type(e,o,t,a,r),op.range(e,o,t,a,r))}n(a)},float:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o)&&!e.required)return n();op.required(e,o,t,a,r),void 0!==o&&(op.type(e,o,t,a,r),op.range(e,o,t,a,r))}n(a)},array:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(null==o&&!e.required)return n();op.required(e,o,t,a,r,"array"),null!=o&&(op.type(e,o,t,a,r),op.range(e,o,t,a,r))}n(a)},object:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o)&&!e.required)return n();op.required(e,o,t,a,r),void 0!==o&&op.type(e,o,t,a,r)}n(a)},enum:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o)&&!e.required)return n();op.required(e,o,t,a,r),void 0!==o&&op.enum(e,o,t,a,r)}n(a)},pattern:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o,"string")&&!e.required)return n();op.required(e,o,t,a,r),Wu(o,"string")||op.pattern(e,o,t,a,r)}n(a)},date:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o,"date")&&!e.required)return n();var l;if(op.required(e,o,t,a,r),!Wu(o,"date"))l=o instanceof Date?o:new Date(o),op.type(e,l,t,a,r),l&&op.range(e,l.getTime(),t,a,r)}n(a)},url:np,hex:np,email:np,required:function(e,o,n,t,r){var a=[],l=Array.isArray(o)?"array":typeof o;op.required(e,o,t,a,r,l),n(a)},any:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Wu(o)&&!e.required)return n();op.required(e,o,t,a,r)}n(a)}};function rp(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var ap=rp(),lp=function(){function e(e){this.rules=null,this._messages=ap,this.define(e)}var o=e.prototype;return o.define=function(e){var o=this;if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach(function(n){var t=e[n];o.rules[n]=Array.isArray(t)?t:[t]})},o.messages=function(e){return e&&(this._messages=Gu(rp(),e)),this._messages},o.validate=function(o,n,t){var r=this;void 0===n&&(n={}),void 0===t&&(t=function(){});var a=o,l=n,i=t;if("function"==typeof l&&(i=l,l={}),!this.rules||0===Object.keys(this.rules).length)return i&&i(null,a),Promise.resolve(a);if(l.messages){var s=this.messages();s===ap&&(s=rp()),Gu(s,l.messages),l.messages=s}else l.messages=this.messages();var d={};(l.keys||Object.keys(this.rules)).forEach(function(e){var n=r.rules[e],t=a[e];n.forEach(function(n){var l=n;"function"==typeof l.transform&&(a===o&&(a=$u({},a)),t=a[e]=l.transform(t)),(l="function"==typeof l?{validator:l}:$u({},l)).validator=r.getValidationMethod(l),l.validator&&(l.field=e,l.fullField=l.fullField||e,l.type=r.getType(l),d[e]=d[e]||[],d[e].push({rule:l,value:t,source:a,field:e}))})});var c={};return Vu(d,l,function(o,n){var t,r=o.rule,i=!("object"!==r.type&&"array"!==r.type||"object"!=typeof r.fields&&"object"!=typeof r.defaultField);function s(e,o){return $u({},o,{fullField:r.fullField+"."+e,fullFields:r.fullFields?[].concat(r.fullFields,[e]):[e]})}function d(t){void 0===t&&(t=[]);var d=Array.isArray(t)?t:[t];!l.suppressWarning&&d.length&&e.warning("async-validator:",d),d.length&&void 0!==r.message&&(d=[].concat(r.message));var u=d.map(qu(r,a));if(l.first&&u.length)return c[r.field]=1,n(u);if(i){if(r.required&&!o.value)return void 0!==r.message?u=[].concat(r.message).map(qu(r,a)):l.error&&(u=[l.error(r,Uu(l.messages.required,r.field))]),n(u);var p={};r.defaultField&&Object.keys(o.value).map(function(e){p[e]=r.defaultField}),p=$u({},p,o.rule.fields);var h={};Object.keys(p).forEach(function(e){var o=p[e];h[e]=(Array.isArray(o)?o:[o]).map(s.bind(null,e))});var f=new e(h);f.messages(l.messages),o.rule.options&&(o.rule.options.messages=l.messages,o.rule.options.error=l.error),f.validate(o.value,o.rule.options||l,function(e){var o=[];u&&u.length&&o.push.apply(o,u),e&&e.length&&o.push.apply(o,e),n(o.length?o:null)})}else n(u)}if(i=i&&(r.required||!r.required&&o.value),r.field=o.field,r.asyncValidator)t=r.asyncValidator(r,o.value,d,o.source,l);else if(r.validator){try{t=r.validator(r,o.value,d,o.source,l)}catch(u){console.error,l.suppressValidatorError||setTimeout(function(){throw u},0),d(u.message)}!0===t?d():!1===t?d("function"==typeof r.message?r.message(r.fullField||r.field):r.message||(r.fullField||r.field)+" fails"):t instanceof Array?d(t):t instanceof Error&&d(t.message)}t&&t.then&&t.then(function(){return d()},function(e){return d(e)})},function(e){!function(e){var o=[],n={};function t(e){var n;Array.isArray(e)?o=(n=o).concat.apply(n,e):o.push(e)}for(var r=0;r<e.length;r++)t(e[r]);o.length?(n=ju(o),i(o,n)):i(null,a)}(e)},a)},o.getType=function(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!tp.hasOwnProperty(e.type))throw new Error(Uu("Unknown rule type %s",e.type));return e.type||"string"},o.getValidationMethod=function(e){if("function"==typeof e.validator)return e.validator;var o=Object.keys(e),n=o.indexOf("message");return-1!==n&&o.splice(n,1),1===o.length&&"required"===o[0]?tp.required:tp[this.getType(e)]||void 0},e}();lp.register=function(e,o){if("function"!=typeof o)throw new Error("Cannot register a validator by type, validator is not a function");tp[e]=o},lp.warning=function(){},lp.messages=ap,lp.validators=tp;var{cubicBezierEaseInOut:ip}=be;var sp=to("form-item","\n display: grid;\n line-height: var(--n-line-height);\n",[to("form-item-label","\n grid-area: label;\n align-items: center;\n line-height: 1.25;\n text-align: var(--n-label-text-align);\n font-size: var(--n-label-font-size);\n min-height: var(--n-label-height);\n padding: var(--n-label-padding);\n color: var(--n-label-text-color);\n transition: color .3s var(--n-bezier);\n box-sizing: border-box;\n font-weight: var(--n-label-font-weight);\n ",[Fo("asterisk","\n white-space: nowrap;\n user-select: none;\n -webkit-user-select: none;\n color: var(--n-asterisk-color);\n transition: color .3s var(--n-bezier);\n "),Fo("asterisk-placeholder","\n grid-area: mark;\n user-select: none;\n -webkit-user-select: none;\n visibility: hidden; \n ")]),to("form-item-blank","\n grid-area: blank;\n min-height: var(--n-blank-height);\n "),Lo("auto-label-width",[to("form-item-label","white-space: nowrap;")]),Lo("left-labelled",'\n grid-template-areas:\n "label blank"\n "label feedback";\n grid-template-columns: auto minmax(0, 1fr);\n grid-template-rows: auto 1fr;\n align-items: flex-start;\n ',[to("form-item-label","\n display: grid;\n grid-template-columns: 1fr auto;\n min-height: var(--n-blank-height);\n height: auto;\n box-sizing: border-box;\n flex-shrink: 0;\n flex-grow: 0;\n ",[Lo("reverse-columns-space","\n grid-template-columns: auto 1fr;\n "),Lo("left-mark",'\n grid-template-areas:\n "mark text"\n ". text";\n '),Lo("right-mark",'\n grid-template-areas: \n "text mark"\n "text .";\n '),Lo("right-hanging-mark",'\n grid-template-areas: \n "text mark"\n "text .";\n '),Fo("text","\n grid-area: text; \n "),Fo("asterisk","\n grid-area: mark; \n align-self: end;\n ")])]),Lo("top-labelled",'\n grid-template-areas:\n "label"\n "blank"\n "feedback";\n grid-template-rows: minmax(var(--n-label-height), auto) 1fr;\n grid-template-columns: minmax(0, 100%);\n ',[Lo("no-label",'\n grid-template-areas:\n "blank"\n "feedback";\n grid-template-rows: 1fr;\n '),to("form-item-label","\n display: flex;\n align-items: flex-start;\n justify-content: var(--n-label-text-align);\n ")]),to("form-item-blank","\n box-sizing: border-box;\n display: flex;\n align-items: center;\n position: relative;\n "),to("form-item-feedback-wrapper","\n grid-area: feedback;\n box-sizing: border-box;\n min-height: var(--n-feedback-height);\n font-size: var(--n-feedback-font-size);\n line-height: 1.25;\n transform-origin: top left;\n ",[lo("&:not(:empty)","\n padding: var(--n-feedback-padding);\n "),to("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[Lo("warning",{color:"var(--n-feedback-text-color-warning)"}),Lo("error",{color:"var(--n-feedback-text-color-error)"}),function({name:e="fade-down",fromOffset:o="-4px",enterDuration:n=".3s",leaveDuration:t=".3s",enterCubicBezier:r=ip,leaveCubicBezier:a=ip}={}){return[lo(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0,transform:`translateY(${o})`}),lo(`&.${e}-transition-enter-to, &.${e}-transition-leave-from`,{opacity:1,transform:"translateY(0)"}),lo(`&.${e}-transition-leave-active`,{transition:`opacity ${t} ${a}, transform ${t} ${a}`}),lo(`&.${e}-transition-enter-active`,{transition:`opacity ${n} ${r}, transform ${n} ${r}`})]}({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var dp=function(e,o,n,t){return new(n||(n=Promise))(function(r,a){function l(e){try{s(t.next(e))}catch(o){a(o)}}function i(e){try{s(t.throw(e))}catch(o){a(o)}}function s(e){var o;e.done?r(e.value):(o=e.value,o instanceof n?o:new n(function(e){e(o)})).then(l,i)}s((t=t.apply(e,o||[])).next())})},cp=Object.assign(Object.assign({},Ie.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object,contentClass:String,contentStyle:[String,Object]});Pn(cp);function up(e,o){return(...n)=>{try{const t=e(...n);return!o&&("boolean"==typeof t||t instanceof Error||Array.isArray(t))||(null==t?void 0:t.then)?t:(void 0===t||Ae("form-item/validate",`You return a ${typeof t} typed value in the validator method, which is not recommended. Please use ${o?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(t){return void Ae("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation.")}}}var pp=e({name:"FormItem",props:cp,setup(e){Gt(Mu,"formItems",z(e,"path"));const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=ro(e),t=p(Ru,null),r=function(e){const o=p(Ru,null);return{mergedSize:I(()=>void 0!==e.size?e.size:void 0!==(null==o?void 0:o.props.size)?o.props.size:"medium")}}(e),l=function(e){const o=p(Ru,null),n=I(()=>{const{labelPlacement:n}=e;return void 0!==n?n:(null==o?void 0:o.props.labelPlacement)?o.props.labelPlacement:"top"}),t=I(()=>"left"===n.value&&("auto"===e.labelWidth||"auto"===(null==o?void 0:o.props.labelWidth))),r=I(()=>{if("top"===n.value)return;const{labelWidth:r}=e;if(void 0!==r&&"auto"!==r)return uo(r);if(t.value){const e=null==o?void 0:o.maxChildLabelWidthRef.value;return void 0!==e?uo(e):void 0}return void 0!==(null==o?void 0:o.props.labelWidth)?uo(o.props.labelWidth):void 0}),a=I(()=>{const{labelAlign:n}=e;return n||((null==o?void 0:o.props.labelAlign)?o.props.labelAlign:void 0)}),l=I(()=>{var o;return[null===(o=e.labelProps)||void 0===o?void 0:o.style,e.labelStyle,{width:r.value}]}),i=I(()=>{const{showRequireMark:n}=e;return void 0!==n?n:null==o?void 0:o.props.showRequireMark}),s=I(()=>{const{requireMarkPlacement:n}=e;return void 0!==n?n:(null==o?void 0:o.props.requireMarkPlacement)||"right"}),d=J(!1),c=J(!1);return{validationErrored:d,validationWarned:c,mergedLabelStyle:l,mergedLabelPlacement:n,mergedLabelAlign:a,mergedShowRequireMark:i,mergedRequireMarkPlacement:s,mergedValidationStatus:I(()=>{const{validationStatus:o}=e;return void 0!==o?o:d.value?"error":c.value?"warning":void 0}),mergedShowFeedback:I(()=>{const{showFeedback:n}=e;return void 0!==n?n:void 0===(null==o?void 0:o.props.showFeedback)||o.props.showFeedback}),mergedShowLabel:I(()=>{const{showLabel:n}=e;return void 0!==n?n:void 0===(null==o?void 0:o.props.showLabel)||o.props.showLabel}),isAutoLabelWidth:t}}(e),{validationErrored:i,validationWarned:s}=l,{mergedRequired:d,mergedRules:c}=function(e){const o=p(Ru,null),n=I(()=>{const{rulePath:o}=e;if(void 0!==o)return o;const{path:n}=e;return void 0!==n?n:void 0}),t=I(()=>{const t=[],{rule:r}=e;if(void 0!==r&&(Array.isArray(r)?t.push(...r):t.push(r)),o){const{rules:e}=o.props,{value:r}=n;if(void 0!==e&&void 0!==r){const o=xn(e,r);void 0!==o&&(Array.isArray(o)?t.push(...o):t.push(o))}}return t}),r=I(()=>t.value.some(e=>e.required));return{mergedRules:t,mergedRequired:I(()=>r.value||e.required)}}(e),{mergedSize:u}=r,{mergedLabelPlacement:h,mergedLabelAlign:f,mergedRequireMarkPlacement:m}=l,v=J([]),g=J(ko()),y=t?z(t.props,"disabled"):J(!1),x=Ie("Form","-form-item",sp,Jn,e,o);function w(){v.value=[],i.value=!1,s.value=!1,e.feedback&&(g.value=ko())}C(z(e,"path"),()=>{e.ignorePathChange||w()});const S=(...o)=>dp(this,[...o],void 0,function*(o=null,n=()=>!0,r={suppressWarning:!0}){const{path:a}=e;r?r.first||(r.first=e.first):r={};const{value:l}=c,d=t?xn(t.props.model,a||""):void 0,u={},p={},h=(o?l.filter(e=>Array.isArray(e.trigger)?e.trigger.includes(o):e.trigger===o):l).filter(n).map((e,o)=>{const n=Object.assign({},e);if(n.validator&&(n.validator=up(n.validator,!1)),n.asyncValidator&&(n.asyncValidator=up(n.asyncValidator,!0)),n.renderMessage){const e=`__renderMessage__${o}`;p[e]=n.message,n.message=e,u[e]=n.renderMessage}return n}),f=h.filter(e=>"warning"!==e.level),m=h.filter(e=>"warning"===e.level),g={valid:!0,errors:void 0,warnings:void 0};if(!h.length)return g;const b=null!=a?a:"__n_no_path__",y=new lp({[b]:f}),x=new lp({[b]:m}),{validateMessages:C}=(null==t?void 0:t.props)||{};C&&(y.messages(C),x.messages(C));const S=e=>{v.value=e.map(e=>{const o=(null==e?void 0:e.message)||"";return{key:o,render:()=>o.startsWith("__renderMessage__")?u[o]():o}}),e.forEach(e=>{var o;(null===(o=e.message)||void 0===o?void 0:o.startsWith("__renderMessage__"))&&(e.message=p[e.message])})};if(f.length){const e=yield new Promise(e=>{y.validate({[b]:d},r,e)});(null==e?void 0:e.length)&&(g.valid=!1,g.errors=e,S(e))}if(m.length&&!g.errors){const e=yield new Promise(e=>{x.validate({[b]:d},r,e)});(null==e?void 0:e.length)&&(S(e),g.warnings=e)}return g.errors||g.warnings?(i.value=!!g.errors,s.value=!!g.warnings):w(),g});a(Co,{path:z(e,"path"),disabled:y,mergedSize:r.mergedSize,mergedValidationStatus:l.mergedValidationStatus,restoreValidation:w,handleContentBlur:function(){S("blur")},handleContentChange:function(){S("change")},handleContentFocus:function(){S("focus")},handleContentInput:function(){S("input")}});const k={validate:function(e,o){return dp(this,void 0,void 0,function*(){let n,t,r,a;return"string"==typeof e?(n=e,t=o):null!==e&&"object"==typeof e&&(n=e.trigger,t=e.callback,r=e.shouldRuleBeApplied,a=e.options),yield new Promise((e,o)=>{S(n,r,a).then(({valid:n,errors:r,warnings:a})=>{n?(t&&t(void 0,{warnings:a}),e({warnings:a})):(t&&t(r,{warnings:a}),o(r))})})})},restoreValidation:w,internalValidate:S},P=J(null);b(()=>{if(!l.isAutoLabelWidth.value)return;const e=P.value;if(null!==e){const o=e.style.whiteSpace;e.style.whiteSpace="nowrap",e.style.width="",null==t||t.deriveMaxChildLabelWidth(Number(getComputedStyle(e).width.slice(0,-2))),e.style.whiteSpace=o}});const T=I(()=>{var e;const{value:o}=u,{value:n}=h,t="top"===n?"vertical":"horizontal",{common:{cubicBezierEaseInOut:r},self:{labelTextColor:a,asteriskColor:l,lineHeight:i,feedbackTextColor:s,feedbackTextColorWarning:d,feedbackTextColorError:c,feedbackPadding:p,labelFontWeight:m,[Eo("labelHeight",o)]:v,[Eo("blankHeight",o)]:g,[Eo("feedbackFontSize",o)]:b,[Eo("feedbackHeight",o)]:y,[Eo("labelPadding",t)]:C,[Eo("labelTextAlign",t)]:w,[Eo(Eo("labelFontSize",n),o)]:S}}=x.value;let k=null!==(e=f.value)&&void 0!==e?e:w;return"top"===n&&(k="right"===k?"flex-end":"flex-start"),{"--n-bezier":r,"--n-line-height":i,"--n-blank-height":g,"--n-label-font-size":S,"--n-label-text-align":k,"--n-label-height":v,"--n-label-padding":C,"--n-label-font-weight":m,"--n-asterisk-color":l,"--n-label-text-color":a,"--n-feedback-padding":p,"--n-feedback-font-size":b,"--n-feedback-height":y,"--n-feedback-text-color":s,"--n-feedback-text-color-warning":d,"--n-feedback-text-color-error":c}}),A=n?io("form-item",I(()=>{var e;return`${u.value[0]}${h.value[0]}${(null===(e=f.value)||void 0===e?void 0:e[0])||""}`}),T,e):void 0,R=I(()=>"left"===h.value&&"left"===m.value&&"left"===f.value);return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:P,mergedClsPrefix:o,mergedRequired:d,feedbackId:g,renderExplains:v,reverseColSpace:R},l),r),k),{cssVars:n?void 0:T,themeClass:null==A?void 0:A.themeClass,onRender:null==A?void 0:A.onRender})},render(){const{$slots:e,mergedClsPrefix:o,mergedShowLabel:n,mergedShowRequireMark:t,mergedRequireMarkPlacement:r,onRender:a}=this,l=void 0!==t?t:this.mergedRequired;null==a||a();return u("div",{class:[`${o}-form-item`,this.themeClass,`${o}-form-item--${this.mergedSize}-size`,`${o}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${o}-form-item--auto-label-width`,!n&&`${o}-form-item--no-label`],style:this.cssVars},n&&(()=>{const e=this.$slots.label?this.$slots.label():this.label;if(!e)return null;const n=u("span",{class:`${o}-form-item-label__text`},e),t=l?u("span",{class:`${o}-form-item-label__asterisk`},"left"!==r?" *":"* "):"right-hanging"===r&&u("span",{class:`${o}-form-item-label__asterisk-placeholder`}," *"),{labelProps:a}=this;return u("label",Object.assign({},a,{class:[null==a?void 0:a.class,`${o}-form-item-label`,`${o}-form-item-label--${r}-mark`,this.reverseColSpace&&`${o}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),"left"===r?[t,n]:[n,t])})(),u("div",{class:[`${o}-form-item-blank`,this.contentClass,this.mergedValidationStatus&&`${o}-form-item-blank--${this.mergedValidationStatus}`],style:this.contentStyle},e),this.mergedShowFeedback?u("div",{key:this.feedbackId,style:this.feedbackStyle,class:[`${o}-form-item-feedback-wrapper`,this.feedbackClass]},u(L,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:n}=this;return fe(e.feedback,e=>{var t;const{feedback:r}=this,a=e||r?u("div",{key:"__feedback__",class:`${o}-form-item-feedback__line`},e||r):this.renderExplains.length?null===(t=this.renderExplains)||void 0===t?void 0:t.map(({key:e,render:n})=>u("div",{key:e,class:`${o}-form-item-feedback__line`},n())):null;return a?u("div","warning"===n?{key:"controlled-warning",class:`${o}-form-item-feedback ${o}-form-item-feedback--warning`}:"error"===n?{key:"controlled-error",class:`${o}-form-item-feedback ${o}-form-item-feedback--error`}:"success"===n?{key:"controlled-success",class:`${o}-form-item-feedback ${o}-form-item-feedback--success`}:{key:"controlled-default",class:`${o}-form-item-feedback`},a):null})}})):null)}});function hp(e){const{borderRadius:o,fontSizeMini:n,fontSizeTiny:t,fontSizeSmall:r,fontWeight:a,textColor2:l,cardColor:i,buttonColor2Hover:s}=e;return{activeColors:["#9be9a8","#40c463","#30a14e","#216e39"],borderRadius:o,borderColor:i,textColor:l,mininumColor:s,fontWeight:a,loadingColorStart:"rgba(0, 0, 0, 0.06)",loadingColorEnd:"rgba(0, 0, 0, 0.12)",rectSizeSmall:"10px",rectSizeMedium:"11px",rectSizeLarge:"12px",borderRadiusSmall:"2px",borderRadiusMedium:"2px",borderRadiusLarge:"2px",xGapSmall:"2px",xGapMedium:"3px",xGapLarge:"3px",yGapSmall:"2px",yGapMedium:"3px",yGapLarge:"3px",fontSizeSmall:t,fontSizeMedium:n,fontSizeLarge:r}}var fp=ke({name:"Heatmap",common:pe,self:hp}),mp={name:"Heatmap",common:Pa,self(e){const o=hp(e);return Object.assign(Object.assign({},o),{activeColors:["#0d4429","#006d32","#26a641","#39d353"],mininumColor:"rgba(255, 255, 255, 0.1)",loadingColorStart:"rgba(255, 255, 255, 0.12)",loadingColorEnd:"rgba(255, 255, 255, 0.18)"})}};function vp(e){const{primaryColor:o,baseColor:n}=e;return{color:o,iconColor:n}}var gp={name:"IconWrapper",common:pe,self:vp},bp={name:"IconWrapper",common:Pa,self:vp},yp={name:"Image",common:Pa,peers:{Tooltip:Yi},self:e=>{const{textColor2:o}=e;return{toolbarIconColor:o,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}};var xp=ke({name:"Image",common:pe,peers:{Tooltip:Zi},self:function(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}}),Cp=lo([to("input-number-suffix","\n display: inline-block;\n margin-right: 10px;\n "),to("input-number-prefix","\n display: inline-block;\n margin-left: 10px;\n ")]);function wp(e){return null==e||"string"==typeof e&&""===e.trim()?null:Number(e)}function Sp(e){return null==e||!Number.isNaN(e)}function kp(e,o){return"number"!=typeof e?"":void 0===o?String(e):e.toFixed(o)}function Pp(e){if(null===e)return null;if("number"==typeof e)return e;{const o=Number(e);return Number.isNaN(o)?null:o}}var Ip=e({name:"InputNumber",props:Object.assign(Object.assign({},Ie.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),slots:Object,setup(e){const{mergedBorderedRef:o,mergedClsPrefixRef:n,mergedRtlRef:t}=ro(e),r=Ie("InputNumber","-input-number",Cp,rc,e,n),{localeRef:a}=we("InputNumber"),l=mo(e),{mergedSizeRef:s,mergedDisabledRef:d,mergedStatusRef:c}=l,u=J(null),p=J(null),h=J(null),f=J(e.defaultValue),m=z(e,"value"),v=Me(m,f),g=J(""),b=e=>{const o=String(e).split(".")[1];return o?o.length:0},y=de(()=>{const{placeholder:o}=e;return void 0!==o?o:a.value.placeholder}),x=de(()=>{const o=Pp(e.step);return null!==o?0===o?1:Math.abs(o):1}),w=de(()=>{const o=Pp(e.min);return null!==o?o:null}),S=de(()=>{const o=Pp(e.max);return null!==o?o:null}),k=()=>{const{value:o}=v;if(Sp(o)){const{format:n,precision:t}=e;n?g.value=n(o):null===o||void 0===t||b(o)>t?g.value=kp(o,void 0):g.value=kp(o,t)}else g.value=String(o)};k();const P=o=>{const{value:n}=v;if(o===n)return void k();const{"onUpdate:value":t,onUpdateValue:r,onChange:a}=e,{nTriggerFormInput:i,nTriggerFormChange:s}=l;a&&_e(a,o),r&&_e(r,o),t&&_e(t,o),f.value=o,i(),s()},T=({offset:o,doUpdateIfValid:n,fixPrecision:t,isInputing:r})=>{const{value:a}=g;if(r&&((l=a).includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(l)||/^-?\d*$/.test(l))||"-"===l||"-0"===l))return!1;var l;const i=(e.parse||wp)(a);if(null===i)return n&&P(null),null;if(Sp(i)){const a=b(i),{precision:l}=e;if(void 0!==l&&l<a&&!t)return!1;let s=Number.parseFloat((i+o).toFixed(null!=l?l:(o=>{const n=[e.min,e.max,e.step,o].map(e=>void 0===e?0:b(e));return Math.max(...n)})(i)));if(Sp(s)){const{value:o}=S,{value:t}=w;if(null!==o&&s>o){if(!n||r)return!1;s=o}if(null!==t&&s<t){if(!n||r)return!1;s=t}return!(e.validator&&!e.validator(s))&&(n&&P(s),s)}}return!1},A=de(()=>!1===T({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})),R=de(()=>{const{value:o}=v;if(e.validator&&null===o)return!1;const{value:n}=x;return!1!==T({offset:-n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})}),M=de(()=>{const{value:o}=v;if(e.validator&&null===o)return!1;const{value:n}=x;return!1!==T({offset:+n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})});function F(){const{value:o}=M;if(!o)return void U();const{value:n}=v;if(null===n)e.validator||P(E());else{const{value:e}=x;T({offset:e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function O(){const{value:o}=R;if(!o)return void H();const{value:n}=v;if(null===n)e.validator||P(E());else{const{value:e}=x;T({offset:-e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const B=function(o){const{onFocus:n}=e,{nTriggerFormFocus:t}=l;n&&_e(n,o),t()},$=function(o){var n,t;if(o.target===(null===(n=u.value)||void 0===n?void 0:n.wrapperElRef))return;const r=T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(!1!==r){const e=null===(t=u.value)||void 0===t?void 0:t.inputElRef;e&&(e.value=String(r||"")),v.value===r&&k()}else k();const{onBlur:a}=e,{nTriggerFormBlur:s}=l;a&&_e(a,o),s(),i(()=>{k()})};function E(){if(e.validator)return null;const{value:o}=w,{value:n}=S;return null!==o?Math.max(0,o):null!==n?Math.min(0,n):0}let D=null,_=null,L=null;function H(){L&&(window.clearTimeout(L),L=null),D&&(window.clearInterval(D),D=null)}let j=null;function U(){j&&(window.clearTimeout(j),j=null),_&&(window.clearInterval(_),_=null)}C(v,()=>{k()});const W={focus:()=>{var e;return null===(e=u.value)||void 0===e?void 0:e.focus()},blur:()=>{var e;return null===(e=u.value)||void 0===e?void 0:e.blur()},select:()=>{var e;return null===(e=u.value)||void 0===e?void 0:e.select()}},N=Ce("InputNumber",t,n);return Object.assign(Object.assign({},W),{rtlEnabled:N,inputInstRef:u,minusButtonInstRef:p,addButtonInstRef:h,mergedClsPrefix:n,mergedBordered:o,uncontrolledValue:f,mergedValue:v,mergedPlaceholder:y,displayedValueInvalid:A,mergedSize:s,mergedDisabled:d,displayedValue:g,addable:M,minusable:R,mergedStatus:c,handleFocus:B,handleBlur:$,handleClear:function(o){!function(o){const{onClear:n}=e;n&&_e(n,o)}(o),P(null)},handleMouseDown:function(e){var o,n,t;(null===(o=h.value)||void 0===o?void 0:o.$el.contains(e.target))&&e.preventDefault(),(null===(n=p.value)||void 0===n?void 0:n.$el.contains(e.target))&&e.preventDefault(),null===(t=u.value)||void 0===t||t.activate()},handleAddClick:()=>{_||F()},handleMinusClick:()=>{D||O()},handleAddMousedown:function(){U(),j=window.setTimeout(()=>{_=window.setInterval(()=>{F()},100)},800),go("mouseup",document,U,{once:!0})},handleMinusMousedown:function(){H(),L=window.setTimeout(()=>{D=window.setInterval(()=>{O()},100)},800),go("mouseup",document,H,{once:!0})},handleKeyDown:function(o){var n,t;if("Enter"===o.key){if(o.target===(null===(n=u.value)||void 0===n?void 0:n.wrapperElRef))return;!1!==T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&(null===(t=u.value)||void 0===t||t.deactivate())}else if("ArrowUp"===o.key){if(!M.value)return;if(!1===e.keyboard.ArrowUp)return;o.preventDefault(),!1!==T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&F()}else if("ArrowDown"===o.key){if(!R.value)return;if(!1===e.keyboard.ArrowDown)return;o.preventDefault(),!1!==T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&O()}},handleUpdateDisplayedValue:function(o){g.value=o,!e.updateValueOnInput||e.format||e.parse||void 0!==e.precision||T({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})},mergedTheme:r,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:I(()=>{const{self:{iconColorDisabled:e}}=r.value,[o,n,t,a]=Io(e);return{textColorTextDisabled:`rgb(${o}, ${n}, ${t})`,opacityDisabled:`${a}`}})})},render(){const{mergedClsPrefix:e,$slots:o}=this,n=()=>u(Ze,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>Do(o["minus-icon"],()=>[u(co,{clsPrefix:e},{default:()=>u(xr,null)})])}),t=()=>u(Ze,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>Do(o["add-icon"],()=>[u(co,{clsPrefix:e},{default:()=>u(hr,null)})])});return u("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},u($l,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>{var t;return this.showButton&&"both"===this.buttonPlacement?[n(),fe(o.prefix,o=>o?u("span",{class:`${e}-input-number-prefix`},o):null)]:null===(t=o.prefix)||void 0===t?void 0:t.call(o)},suffix:()=>{var r;return this.showButton?[fe(o.suffix,o=>o?u("span",{class:`${e}-input-number-suffix`},o):null),"right"===this.buttonPlacement?n():null,t()]:null===(r=o.suffix)||void 0===r?void 0:r.call(o)}}))}}),Tp={extraFontSize:"12px",width:"440px"},Ap={name:"Transfer",common:Pa,peers:{Checkbox:vi,Scrollbar:Ia,Input:Al,Empty:Ya,Button:ii},self(e){const{iconColorDisabled:o,iconColor:n,fontWeight:t,fontSizeLarge:r,fontSizeMedium:a,fontSizeSmall:l,heightLarge:i,heightMedium:s,heightSmall:d,borderRadius:c,inputColor:u,tableHeaderColor:p,textColor1:h,textColorDisabled:f,textColor2:m,hoverColor:v}=e;return Object.assign(Object.assign({},Tp),{itemHeightSmall:d,itemHeightMedium:s,itemHeightLarge:i,fontSizeSmall:l,fontSizeMedium:a,fontSizeLarge:r,borderRadius:c,borderColor:"#0000",listColor:u,headerColor:p,titleTextColor:h,titleTextColorDisabled:f,extraTextColor:m,filterDividerColor:"#0000",itemTextColor:m,itemTextColorDisabled:f,itemColorPending:v,titleFontWeight:t,iconColor:n,iconColorDisabled:o})}};var zp=ke({name:"Transfer",common:pe,peers:{Checkbox:kn,Scrollbar:$o,Input:un,Empty:Ne,Button:ho},self:function(e){const{fontWeight:o,iconColorDisabled:n,iconColor:t,fontSizeLarge:r,fontSizeMedium:a,fontSizeSmall:l,heightLarge:i,heightMedium:s,heightSmall:d,borderRadius:c,cardColor:u,tableHeaderColor:p,textColor1:h,textColorDisabled:f,textColor2:m,borderColor:v,hoverColor:g}=e;return Object.assign(Object.assign({},Tp),{itemHeightSmall:d,itemHeightMedium:s,itemHeightLarge:i,fontSizeSmall:l,fontSizeMedium:a,fontSizeLarge:r,borderRadius:c,borderColor:v,listColor:u,headerColor:yo(u,p),titleTextColor:h,titleTextColorDisabled:f,extraTextColor:m,filterDividerColor:v,itemTextColor:m,itemTextColorDisabled:f,itemColorPending:g,titleFontWeight:o,iconColor:t,iconColorDisabled:n})}});function Rp(){return{}}var Mp={name:"Marquee",common:pe,self:Rp},Fp={name:"Marquee",common:Pa,self:Rp},Op={name:"QrCode",common:Pa,self:e=>({borderRadius:e.borderRadius})};var Bp={name:"QrCode",common:pe,self:function(e){return{borderRadius:e.borderRadius}}},$p=e({name:"Scrollbar",props:Object.assign(Object.assign({},Ie.props),{trigger:String,xScrollable:Boolean,onScroll:Function,contentClass:String,contentStyle:[Object,String],size:Number,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),setup(){const e=J(null);return Object.assign(Object.assign({},{scrollTo:(...o)=>{var n;null===(n=e.value)||void 0===n||n.scrollTo(o[0],o[1])},scrollBy:(...o)=>{var n;null===(n=e.value)||void 0===n||n.scrollBy(o[0],o[1])}}),{scrollbarInstRef:e})},render(){return u(_o,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}}),Ep={name:"Skeleton",common:Pa,self(e){const{heightSmall:o,heightMedium:n,heightLarge:t,borderRadius:r}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:r,heightSmall:o,heightMedium:n,heightLarge:t}}};var Dp={name:"Skeleton",common:pe,self:function(e){const{heightSmall:o,heightMedium:n,heightLarge:t,borderRadius:r}=e;return{color:"#eee",colorEnd:"#ddd",borderRadius:r,heightSmall:o,heightMedium:n,heightLarge:t}}},_p=lo([lo("@keyframes spin-rotate","\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n "),to("spin-container","\n position: relative;\n ",[to("spin-body","\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n ",[Bo()])]),to("spin-body","\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n "),to("spin","\n display: inline-flex;\n height: var(--n-size);\n width: var(--n-size);\n font-size: var(--n-size);\n color: var(--n-color);\n ",[Lo("rotate","\n animation: spin-rotate 2s linear infinite;\n ")]),to("spin-description","\n display: inline-block;\n font-size: var(--n-font-size);\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n margin-top: 8px;\n "),to("spin-content","\n opacity: 1;\n transition: opacity .3s var(--n-bezier);\n pointer-events: all;\n ",[Lo("spinning","\n user-select: none;\n -webkit-user-select: none;\n pointer-events: none;\n opacity: var(--n-opacity-spinning);\n ")])]),Lp={small:20,medium:18,large:16},Hp=e({name:"Spin",props:Object.assign(Object.assign({},Ie.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),slots:Object,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=ro(e),t=Ie("Spin","-spin",_p,So,e,o),r=I(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:r}=t.value,{opacitySpinning:a,color:l,textColor:i}=r;return{"--n-bezier":n,"--n-opacity-spinning":a,"--n-size":"number"==typeof o?oo(o):r[Eo("size",o)],"--n-color":l,"--n-text-color":i}}),a=n?io("spin",I(()=>{const{size:o}=e;return"number"==typeof o?String(o):o[0]}),r,e):void 0,l=je(e,["spinning","show"]),i=J(!1);return f(o=>{let n;if(l.value){const{delay:t}=e;if(t)return n=window.setTimeout(()=>{i.value=!0},t),void o(()=>{clearTimeout(n)})}i.value=l.value}),{mergedClsPrefix:o,active:i,mergedStrokeWidth:I(()=>{const{strokeWidth:o}=e;if(void 0!==o)return o;const{size:n}=e;return Lp["number"==typeof n?"medium":n]}),cssVars:n?void 0:r,themeClass:null==a?void 0:a.themeClass,onRender:null==a?void 0:a.onRender}},render(){var e,o;const{$slots:n,mergedClsPrefix:t,description:r}=this,a=n.icon&&this.rotate,l=(r||n.description)&&u("div",{class:`${t}-spin-description`},r||(null===(e=n.description)||void 0===e?void 0:e.call(n))),i=n.icon?u("div",{class:[`${t}-spin-body`,this.themeClass]},u("div",{class:[`${t}-spin`,a&&`${t}-spin--rotate`],style:n.default?"":this.cssVars},n.icon()),l):u("div",{class:[`${t}-spin-body`,this.themeClass]},u(Ee,{clsPrefix:t,style:n.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${t}-spin`}),l);return null===(o=this.onRender)||void 0===o||o.call(this),n.default?u("div",{class:[`${t}-spin-container`,this.themeClass],style:this.cssVars},u("div",{class:[`${t}-spin-content`,this.active&&`${t}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),u(L,{name:"fade-in-transition"},{default:()=>this.active?i:null})):i}}),jp={name:"Split",common:Pa};var Up,Wp={name:"Split",common:pe,self:function(e){const{primaryColorHover:o,borderColor:n}=e;return{resizableTriggerColorHover:o,resizableTriggerColor:n}}},Np=to("switch","\n height: var(--n-height);\n min-width: var(--n-width);\n vertical-align: middle;\n user-select: none;\n -webkit-user-select: none;\n display: inline-flex;\n outline: none;\n justify-content: center;\n align-items: center;\n",[Fo("children-placeholder","\n height: var(--n-rail-height);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: none;\n visibility: hidden;\n "),Fo("rail-placeholder","\n display: flex;\n flex-wrap: none;\n "),Fo("button-placeholder","\n width: calc(1.75 * var(--n-rail-height));\n height: var(--n-rail-height);\n "),to("base-loading","\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n font-size: calc(var(--n-button-width) - 4px);\n color: var(--n-loading-color);\n transition: color .3s var(--n-bezier);\n ",[Te({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),Fo("checked, unchecked","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n box-sizing: border-box;\n position: absolute;\n white-space: nowrap;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n line-height: 1;\n "),Fo("checked","\n right: 0;\n padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));\n "),Fo("unchecked","\n left: 0;\n justify-content: flex-end;\n padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));\n "),lo("&:focus",[Fo("rail","\n box-shadow: var(--n-box-shadow-focus);\n ")]),Lo("round",[Fo("rail","border-radius: calc(var(--n-rail-height) / 2);",[Fo("button","border-radius: calc(var(--n-button-height) / 2);")])]),Je("disabled",[Je("icon",[Lo("rubber-band",[Lo("pressed",[Fo("rail",[Fo("button","max-width: var(--n-button-width-pressed);")])]),Fo("rail",[lo("&:active",[Fo("button","max-width: var(--n-button-width-pressed);")])]),Lo("active",[Lo("pressed",[Fo("rail",[Fo("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),Fo("rail",[lo("&:active",[Fo("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),Lo("active",[Fo("rail",[Fo("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),Fo("rail","\n overflow: hidden;\n height: var(--n-rail-height);\n min-width: var(--n-rail-width);\n border-radius: var(--n-rail-border-radius);\n cursor: pointer;\n position: relative;\n transition:\n opacity .3s var(--n-bezier),\n background .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n background-color: var(--n-rail-color);\n ",[Fo("button-icon","\n color: var(--n-icon-color);\n transition: color .3s var(--n-bezier);\n font-size: calc(var(--n-button-height) - 4px);\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n line-height: 1;\n ",[Te()]),Fo("button",'\n align-items: center; \n top: var(--n-offset);\n left: var(--n-offset);\n height: var(--n-button-height);\n width: var(--n-button-width-pressed);\n max-width: var(--n-button-width);\n border-radius: var(--n-button-border-radius);\n background-color: var(--n-button-color);\n box-shadow: var(--n-button-box-shadow);\n box-sizing: border-box;\n cursor: inherit;\n content: "";\n position: absolute;\n transition:\n background-color .3s var(--n-bezier),\n left .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n max-width .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n ')]),Lo("active",[Fo("rail","background-color: var(--n-rail-color-active);")]),Lo("loading",[Fo("rail","\n cursor: wait;\n ")]),Lo("disabled",[Fo("rail","\n cursor: not-allowed;\n opacity: .5;\n ")])]),Kp=e({name:"Switch",props:Object.assign(Object.assign({},Ie.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]}),slots:Object,setup(e){void 0===Up&&(Up="undefined"==typeof CSS||void 0!==CSS.supports&&CSS.supports("width","max(1px)"));const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=ro(e),t=Ie("Switch","-switch",Np,Xc,e,o),r=mo(e),{mergedSizeRef:a,mergedDisabledRef:l}=r,i=J(e.defaultValue),s=z(e,"value"),d=Me(s,i),c=I(()=>d.value===e.checkedValue),u=J(!1),p=J(!1),h=I(()=>{const{railStyle:o}=e;if(o)return o({focused:p.value,checked:c.value})});function f(o){const{"onUpdate:value":n,onChange:t,onUpdateValue:a}=e,{nTriggerFormInput:l,nTriggerFormChange:s}=r;n&&_e(n,o),a&&_e(a,o),t&&_e(t,o),i.value=o,l(),s()}const m=I(()=>{const{value:e}=a,{self:{opacityDisabled:o,railColor:n,railColorActive:r,buttonBoxShadow:l,buttonColor:i,boxShadowFocus:s,loadingColor:d,textColor:c,iconColor:u,[Eo("buttonHeight",e)]:p,[Eo("buttonWidth",e)]:h,[Eo("buttonWidthPressed",e)]:f,[Eo("railHeight",e)]:m,[Eo("railWidth",e)]:v,[Eo("railBorderRadius",e)]:g,[Eo("buttonBorderRadius",e)]:b},common:{cubicBezierEaseInOut:y}}=t.value;let x,C,w;return Up?(x=`calc((${m} - ${p}) / 2)`,C=`max(${m}, ${p})`,w=`max(${v}, calc(${v} + ${p} - ${m}))`):(x=oo((fo(m)-fo(p))/2),C=oo(Math.max(fo(m),fo(p))),w=fo(m)>fo(p)?v:oo(fo(v)+fo(p)-fo(m))),{"--n-bezier":y,"--n-button-border-radius":b,"--n-button-box-shadow":l,"--n-button-color":i,"--n-button-width":h,"--n-button-width-pressed":f,"--n-button-height":p,"--n-height":C,"--n-offset":x,"--n-opacity-disabled":o,"--n-rail-border-radius":g,"--n-rail-color":n,"--n-rail-color-active":r,"--n-rail-height":m,"--n-rail-width":v,"--n-width":w,"--n-box-shadow-focus":s,"--n-loading-color":d,"--n-text-color":c,"--n-icon-color":u}}),v=n?io("switch",I(()=>a.value[0]),m,e):void 0;return{handleClick:function(){e.loading||l.value||(d.value!==e.checkedValue?f(e.checkedValue):f(e.uncheckedValue))},handleBlur:function(){p.value=!1,function(){const{nTriggerFormBlur:e}=r;e()}(),u.value=!1},handleFocus:function(){p.value=!0,function(){const{nTriggerFormFocus:e}=r;e()}()},handleKeyup:function(o){e.loading||l.value||" "===o.key&&(d.value!==e.checkedValue?f(e.checkedValue):f(e.uncheckedValue),u.value=!1)},handleKeydown:function(o){e.loading||l.value||" "===o.key&&(o.preventDefault(),u.value=!0)},mergedRailStyle:h,pressed:u,mergedClsPrefix:o,mergedValue:d,checked:c,mergedDisabled:l,cssVars:n?void 0:m,themeClass:null==v?void 0:v.themeClass,onRender:null==v?void 0:v.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:o,checked:n,mergedRailStyle:t,onRender:r,$slots:a}=this;null==r||r();const{checked:l,unchecked:i,icon:s,"checked-icon":d,"unchecked-icon":c}=a,p=!(Ye(s)&&Ye(d)&&Ye(c));return u("div",{role:"switch","aria-checked":n,class:[`${e}-switch`,this.themeClass,p&&`${e}-switch--icon`,n&&`${e}-switch--active`,o&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},u("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:t},fe(l,o=>fe(i,n=>o||n?u("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},u("div",{class:`${e}-switch__rail-placeholder`},u("div",{class:`${e}-switch__button-placeholder`}),o),u("div",{class:`${e}-switch__rail-placeholder`},u("div",{class:`${e}-switch__button-placeholder`}),n)):null)),u("div",{class:`${e}-switch__button`},fe(s,o=>fe(d,n=>fe(c,t=>u(ce,null,{default:()=>this.loading?u(Ee,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(n||o)?u("div",{class:`${e}-switch__button-icon`,key:n?"checked-icon":"icon"},n||o):this.checked||!t&&!o?null:u("div",{class:`${e}-switch__button-icon`,key:t?"unchecked-icon":"icon"},t||o)})))),fe(l,o=>o&&u("div",{key:"checked",class:`${e}-switch__checked`},o)),fe(i,o=>o&&u("div",{key:"unchecked",class:`${e}-switch__unchecked`},o)))))}}),Vp=to("text","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n",[Lo("strong","\n font-weight: var(--n-font-weight-strong);\n "),Lo("italic",{fontStyle:"italic"}),Lo("underline",{textDecoration:"underline"}),Lo("code","\n line-height: 1.4;\n display: inline-block;\n font-family: var(--n-font-famliy-mono);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n box-sizing: border-box;\n padding: .05em .35em 0 .35em;\n border-radius: var(--n-code-border-radius);\n font-size: .9em;\n color: var(--n-code-text-color);\n background-color: var(--n-code-color);\n border: var(--n-code-border);\n ")]),qp=e({name:"Text",props:Object.assign(Object.assign({},Ie.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=ro(e),t=Ie("Typography","-text",Vp,Vn,e,o),r=I(()=>{const{depth:o,type:n}=e,r="default"===n?void 0===o?"textColor":`textColor${o}Depth`:Eo("textColor",n),{common:{fontWeightStrong:a,fontFamilyMono:l,cubicBezierEaseInOut:i},self:{codeTextColor:s,codeBorderRadius:d,codeColor:c,codeBorder:u,[r]:p}}=t.value;return{"--n-bezier":i,"--n-text-color":p,"--n-font-weight-strong":a,"--n-font-famliy-mono":l,"--n-code-border-radius":d,"--n-code-text-color":s,"--n-code-color":c,"--n-code-border":u}}),a=n?io("text",I(()=>`${e.type[0]}${e.depth||""}`),r,e):void 0;return{mergedClsPrefix:o,compitableTag:je(e,["as","tag"]),cssVars:n?void 0:r,themeClass:null==a?void 0:a.themeClass,onRender:null==a?void 0:a.onRender}},render(){var e,o,n;const{mergedClsPrefix:t}=this;null===(e=this.onRender)||void 0===e||e.call(this);const r=[`${t}-text`,this.themeClass,{[`${t}-text--code`]:this.code,[`${t}-text--delete`]:this.delete,[`${t}-text--strong`]:this.strong,[`${t}-text--italic`]:this.italic,[`${t}-text--underline`]:this.underline}],a=null===(n=(o=this.$slots).default)||void 0===n?void 0:n.call(o);return this.code?u("code",{class:r,style:this.cssVars},this.delete?u("del",null,a):a):this.delete?u("del",{class:r,style:this.cssVars},a):u(this.compitableTag||"span",{class:r,style:this.cssVars},a)}}),Gp=()=>({}),Jp={name:"light",common:pe,Alert:gl,Anchor:Il,AutoComplete:jl,Avatar:ql,AvatarGroup:Yl,BackTop:ei,Badge:ni,Breadcrumb:ai,Button:ho,ButtonGroup:Qd,Calendar:ci,Card:Wn,Carousel:fi,Cascader:bi,Checkbox:kn,Code:Pi,Collapse:Ti,CollapseTransition:Ri,ColorPicker:Oi,DataTable:as,DatePicker:Ds,Descriptions:js,Dialog:$n,Divider:Yn,Drawer:Ed,Dropdown:qi,DynamicInput:jd,DynamicTags:Vd,Element:Gd,Empty:Ne,Equation:{name:"Equation",common:pe,self:Gp},Ellipsis:Qi,Flex:Zd,Form:Jn,GradientText:nc,Heatmap:fp,Icon:Ve,IconWrapper:gp,Image:xp,Input:un,InputNumber:rc,InputOtp:lc,Layout:dc,LegacyTransfer:zp,List:hc,LoadingBar:Zs,Log:vc,Menu:xc,Mention:bc,Message:ad,Modal:Hn,Notification:gd,PageHeader:kc,Pagination:Wi,Popconfirm:Ac,Popover:pn,Popselect:Di,Progress:Mc,QrCode:Bp,Radio:ns,Rate:Bc,Row:uc,Result:Dc,Scrollbar:$o,Skeleton:Dp,Select:rn,Slider:jc,Space:Bn,Spin:So,Statistic:Nc,Steps:Gc,Switch:Xc,Table:ou,Tabs:au,Tag:ao,Thing:su,TimePicker:Os,Timeline:pu,Tooltip:Zi,Transfer:mu,Tree:gu,TreeSelect:xu,Typography:Vn,Upload:Su,Watermark:Iu,Split:Wp,FloatButton:zu,FloatButtonGroup:Tu,Marquee:Mp},Yp={name:"dark",common:Pa,Alert:vl,Anchor:Tl,AutoComplete:Ul,Avatar:Gl,AvatarGroup:Zl,BackTop:Ql,Badge:oi,Breadcrumb:li,Button:ii,ButtonGroup:Xd,Calendar:ui,Card:pi,Carousel:mi,Cascader:yi,Checkbox:vi,Code:ki,Collapse:Ai,CollapseTransition:Mi,ColorPicker:Bi,DataTable:ls,DatePicker:_s,Descriptions:Us,Dialog:Ws,Divider:Bd,Drawer:Dd,Dropdown:Gi,DynamicInput:Ld,DynamicTags:Kd,Element:qd,Empty:Ya,Ellipsis:Xi,Equation:{name:"Equation",common:Pa,self:Gp},Flex:Yd,Form:ec,GradientText:oc,Heatmap:mp,Icon:xs,IconWrapper:bp,Image:yp,Input:Al,InputNumber:tc,InputOtp:ic,LegacyTransfer:Ap,Layout:sc,List:fc,LoadingBar:Ys,Log:mc,Menu:Cc,Mention:gc,Message:ld,Modal:Ns,Notification:bd,PageHeader:Pc,Pagination:Ni,Popconfirm:zc,Popover:rl,Popselect:Ei,Progress:Fc,QrCode:Op,Radio:os,Rate:Oc,Result:_c,Row:cc,Scrollbar:Ia,Select:_i,Skeleton:Ep,Slider:Hc,Space:Ud,Spin:Uc,Statistic:Kc,Steps:Jc,Switch:Zc,Table:nu,Tabs:lu,Tag:al,Thing:du,TimePicker:Bs,Timeline:uu,Tooltip:Yi,Transfer:fu,Tree:bu,TreeSelect:yu,Typography:Cu,Upload:ku,Watermark:Pu,Split:jp,FloatButton:Au,FloatButtonGroup:{name:"FloatButtonGroup",common:Pa,self(e){const{popoverColor:o,dividerColor:n,borderRadius:t}=e;return{color:o,buttonBorderColor:n,borderRadiusSquare:t,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)"}}},Marquee:Fp},Zp=["disabled"],Xp=To({__name:"HeaderButton",props:{icon:{type:Object,required:!0},tooltip:{type:String,default:""},tooltipPlacement:{type:String,default:"bottom"},iconSize:{type:Number,default:18},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:o}){const n=e,r=o,a=I(()=>n.disabled?"#6b7280":n.active?"#18a058":void 0);function l(){n.disabled||r("click")}return(o,n)=>(y(),v(j(fs),{placement:e.tooltipPlacement},{trigger:R(()=>[Q("button",{class:$(["header-button",{active:e.active,disabled:e.disabled}]),disabled:e.disabled,onClick:l},[h(j(so),{size:e.iconSize,color:a.value},{default:R(()=>[(y(),v(x(e.icon)))]),_:1},8,["size","color"])],10,Zp)]),default:R(()=>[V(o.$slots,"default",{},()=>[t(S(e.tooltip),1)],!0)]),_:3},8,["placement"]))}},[["__scopeId","data-v-b515354d"]]);async function Qp(e=null){const o=e?{platform:e}:{};return(await Dt.get("/env/check",{params:o})).data}function eh(){return Od(["message","dialog"],{configProviderProps:{theme:"dark"===document.documentElement.getAttribute("data-theme")?Yp:Jp}})}var oh=eh();new MutationObserver(()=>{oh=eh()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var nh={success:(...e)=>oh.message.success(...e),error:(...e)=>oh.message.error(...e),warning:(...e)=>oh.message.warning(...e),info:(...e)=>oh.message.info(...e),loading:(...e)=>oh.message.loading(...e)},th={success:(...e)=>oh.dialog.success(...e),error:(...e)=>oh.dialog.error(...e),warning:(...e)=>oh.dialog.warning(...e),info:(...e)=>oh.dialog.info(...e),create:(...e)=>oh.dialog.create(...e)},rh={class:"modal-header"},ah={class:"modal-content"},lh={class:"desc-text"},ih={class:"conflict-list"},sh={class:"list-header"},dh={key:0,class:"selected-hint"},ch={class:"conflict-items"},uh=["onClick"],ph={class:"item-content"},hh={class:"item-header"},fh={class:"var-name"},mh={class:"var-value"},vh={class:"var-source"},gh={class:"modal-footer"},bh={__name:"EnvConflictModal",props:{visible:{type:Boolean,default:!1},conflicts:{type:Array,default:()=>[]}},emits:["update:visible","deleted","close","ignore","never-remind"],setup(e,{emit:o}){const r=e,a=o,l=I({get:()=>r.visible,set:e=>a("update:visible",e)}),i=J(new Set),s=J(!1),c=I(()=>i.value.size),u=I(()=>r.conflicts.length>0&&i.value.size===r.conflicts.length),p=I(()=>i.value.size>0&&i.value.size<r.conflicts.length),f=I(()=>r.conflicts.length>0&&r.conflicts.every(e=>"process"===e.sourceType));function m(e){return`${e.varName}:${e.sourcePath}`}function g(e){return"process"===e.sourceType?"进程环境变量":e.sourcePath}function b(e){i.value=e?new Set(r.conflicts.map(m)):new Set}function x(){a("close")}function C(){a("ignore")}function w(){a("never-remind")}async function k(){const e=r.conflicts.filter(e=>i.value.has(m(e)));e.every(e=>"process"===e.sourceType)?nh.warning("进程环境变量无法直接删除,请手动从 shell 配置文件中移除"):th.warning({title:"确认删除",content:`确定要删除选中的 ${e.length} 个环境变量吗?删除前会自动备份。`,positiveText:"删除",negativeText:"取消",onPositiveClick:async()=>{s.value=!0;try{(await async function(e){return(await Dt.post("/env/delete",{conflicts:e})).data}(e)).success&&(nh.success("删除成功,备份已保存"),i.value=new Set,a("deleted"))}catch(o){nh.error("删除失败: "+o.message)}finally{s.value=!1}}})}return(o,r)=>(y(),v(j(Nn),{show:l.value,"onUpdate:show":r[1]||(r[1]=e=>l.value=e),preset:"card",title:null,bordered:!1,closable:!0,"mask-closable":!1,style:{width:"560px","max-width":"90vw"},onClose:x},{header:R(()=>[Q("div",rh,[h(j(so),{class:"warning-icon",size:22},{default:R(()=>[h(j(Tt))]),_:1}),r[2]||(r[2]=Q("span",{class:"header-title"},"检测到环境变量冲突",-1))])]),footer:R(()=>[Q("div",gh,[h(j(Po),{tertiary:"",onClick:C},{default:R(()=>[...r[8]||(r[8]=[t(" 暂时忽略 ",-1)])]),_:1}),h(j(Po),{tertiary:"",onClick:w},{default:R(()=>[...r[9]||(r[9]=[t(" 不再提醒 ",-1)])]),_:1}),f.value?n("",!0):(y(),v(j(Po),{key:0,type:"error",disabled:0===c.value,loading:s.value,onClick:k},{default:R(()=>[t(" 删除选中 ("+S(c.value)+") ",1)]),_:1},8,["disabled","loading"]))])]),default:R(()=>[Q("div",ah,[Q("p",lh,[r[3]||(r[3]=t(" 发现 ",-1)),Q("strong",null,S(e.conflicts.length),1),r[4]||(r[4]=t(" 个环境变量可能影响代理配置,建议清理后再使用代理功能。 ",-1))]),f.value?(y(),v(j(Sl),{key:0,type:"info",bordered:!1,class:"process-env-alert"},{icon:R(()=>[h(j(so),null,{default:R(()=>[h(j(pt))]),_:1})]),default:R(()=>[r[5]||(r[5]=Q("div",{class:"alert-content"},[Q("p",{class:"alert-title"},"这些环境变量来自当前进程,请按以下步骤处理:"),Q("ol",{class:"alert-list"},[Q("li",null,"检查对应 shell 配置文件(如 ~/.zshrc、~/.bashrc 或 PowerShell Profile)中是否有这些变量"),Q("li",null,"如果有,删除或注释掉相关行"),Q("li",null,[Q("strong",null,"重启终端"),t(",然后重新运行 "),Q("code",null,"ct")])]),Q("p",{class:"alert-hint"},"如果配置文件中没有,可能是终端临时设置的,直接重启终端即可")],-1))]),_:1})):n("",!0),Q("div",ih,[Q("div",sh,[h(j(Si),{checked:u.value,indeterminate:p.value,"onUpdate:checked":b},{default:R(()=>[...r[6]||(r[6]=[t(" 全选 ",-1)])]),_:1},8,["checked","indeterminate"]),c.value>0?(y(),X("span",dh," 已选 "+S(c.value)+" 项 ",1)):n("",!0)]),h(j($p),{style:{"max-height":"280px"}},{default:R(()=>[Q("div",ch,[(y(!0),X(F,null,d(e.conflicts,e=>{return y(),X("div",{key:m(e),class:$(["conflict-item",{selected:i.value.has(m(e))}]),onClick:o=>function(e){const o=m(e);i.value.has(o)?i.value.delete(o):i.value.add(o),i.value=new Set(i.value)}(e)},[h(j(Si),{checked:i.value.has(m(e)),onClick:r[0]||(r[0]=H(()=>{},["stop"])),"onUpdate:checked":o=>function(e,o){const n=m(e);o?i.value.add(n):i.value.delete(n),i.value=new Set(i.value)}(e,o)},null,8,["checked","onUpdate:checked"]),Q("div",ph,[Q("div",hh,[Q("code",fh,S(e.varName),1),h(j(cl),{type:(o=e.platform,{claude:"warning",codex:"success",gemini:"info"}[o]||"default"),size:"tiny",bordered:!1},{default:R(()=>[t(S(e.platform),1)]),_:2},1032,["type"])]),Q("div",mh,S(e.varValue),1),Q("div",vh,[r[7]||(r[7]=Q("span",{class:"source-label"},"来源:",-1)),t(" "+S(g(e)),1)])])],10,uh);var o}),128))])]),_:1})])])]),_:1},8,["show"]))}},yh=To(bh,[["__scopeId","data-v-7ea71ef7"]]);async function xh(){return(await Dt.get("/security")).data}async function Ch(e){return(await Dt.post("/security/password",e)).data}var wh=new Map;function Sh(e,o="",n="",t=""){return`${e}:${o}:${n}:${function(e=""){return e?String(e):""}(t)}`}function kh(e,o,n=e.split(":",1)[0],t=n){const r=wh.get(e);if(r)return r.promise;for(const[i,s]of wh)s.abortGroup===t&&i!==e&&s.abortController.abort();const a=new AbortController,l={promise:null,startedAt:Date.now(),abortController:a,resource:n,abortGroup:t};return l.promise=Promise.resolve().then(()=>o(a.signal)).finally(()=>{wh.get(e)===l&&wh.delete(e)}),wh.set(e,l),l.promise}var Ph="__ccAdvancedConfigBound__",Ih=null,Th=0,Ah=!1,zh=null,Rh=Object.create(null);function Mh(e,o,n,t={},r){return kh(Sh(e,o,"",""),e=>_t.get(n,{params:t,signal:e}),e,`${e}:${o}`).catch(()=>r)}function Fh(){const e=new Date;return e.setHours(0,0,0,0),{start:e.getTime(),end:e.getTime()+864e5}}function Oh(e,o){if(o.usageMissing)return null;if(void 0!==o.totalTokens&&null!==o.totalTokens)return Number(o.totalTokens)||0;const n=Number(o.inputTokens)||0,t=Number(o.outputTokens)||0,r=Number(o.cacheCreation)||0,a=Number(o.cacheRead)||0;return"claude"===e?n+t+r+a:n+t}function Bh(e={}){const o=[e.model,e.redirectedModel,e.modelFromUrl,e.originalModel];for(const n of o)if("string"==typeof n&&n.trim())return n.trim();return""}var $h=W("global",()=>{const{catalog:e,enabledKeys:o}=jt(),n=P({}),t=P({}),r=P({}),a=P({}),l=new Map,i=new Map,s=new Set;function d(e){return String(e||"").trim().toLowerCase()}function c(o){const n=d(o);return Boolean(n)&&e.value.some(e=>e.key===n)}function u(e){const n=d(e);return o.value.includes(n)}function p(o,n){const t=d(o);return c(t)&&e.value.some(e=>e.key===t&&(!0===e.capabilities?.[n]||!0===e.resourceTypes?.[n]))}function h(e){const n=Array.isArray(e)?e:o.value,t=new Set(o.value),r=[],a=new Set;return n.forEach(e=>{const o=d(e);o&&!a.has(o)&&t.has(o)&&(a.add(o),r.push(o))}),r}function f(e){const o=d(e);return c(o)?(n[o]||(n[o]={running:!1,loading:!1,activeChannel:null,port:null,runtime:null,startTime:null,defaultPort:null}),t[o]||(t[o]=[]),r[o]||(r[o]={channels:[],pending:0}),a[o]||(a[o]=[]),o):null}function m(e){const o=f(e);return o?(l.has(o)||l.set(o,z(n,o)),l.get(o)):null}function v(e){const o=f(e);return o?(i.has(o)||i.set(o,z(t,o)),i.get(o)):null}function g(e){const o=f(e);return o?r[o]:null}function b(e){const o=f(e);return o?a[o]:[]}function y(){Object.keys(Rh).forEach(e=>{delete Rh[e]}),Object.entries(t).forEach(([e,o])=>{o.forEach(o=>{o?.name&&(Rh[o.name]=e)})})}o.value.forEach(f);const x=J(!1),C=J(!1);let w="",S="";const k=J(100),T=J(30);let A=null,R=100,M=Fh();function F(e){return function(){const e=Date.now();(e<M.start||e>=M.end)&&(M=Fh(),D())}(),e>=M.start&&e<M.end}function O(e){for(;e.length>R;)e.pop()}function B(e){R=e,k.value=e,Object.values(a).forEach(O)}function $(e){const o=parseInt(e,10);if(Number.isNaN(o))return;const n=Math.min(Math.max(o,10),300);T.value!==n&&(T.value=n)}function E(e){const o=function(e){if(e.source)return d(e.source);if(e.toolType){const o=d(e.toolType);return c(o)?o:""}if(e.channel)return Rh[e.channel]||"";if(e.model){const o=e.model.toLowerCase();if(o.includes("claude"))return"claude";if(o.includes("gpt")||o.includes("o1")||o.includes("o3"))return"codex";if(o.includes("gemini"))return"gemini";if(o.includes("opencode")||o.includes("deepseek")||o.includes("qwen"))return"opencode";if(o.includes("omp"))return"omp"}return e.action?.includes("opencode")?"opencode":e.action?.includes("omp")?"omp":e.action?.includes("codex")?"codex":e.action?.includes("gemini")?"gemini":e.action?.includes("claude")?"claude":""}(e);if(!c(o)||!u(o))return;const n=b(o);if(!n)return;const t=e.timestamp||Date.now();if(!F(t))return;const r=e.time||new Date(t).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),a={id:e.id||`${Date.now()}-${Math.random()}`,source:o,type:e.type||(e.action?"action":"log"),status:e.status||(e.error?"error":"success"),action:e.action||null,channel:e.channel||e.channelName||"Unknown",model:Bh(e),originalModel:e.originalModel||null,redirectedModel:e.redirectedModel||null,message:e.message,error:e.error||null,statusCode:e.statusCode||null,stage:e.stage||null,usageMissing:Boolean(e.usageMissing),cacheUsageAvailable:"boolean"==typeof e.cacheUsageAvailable?e.cacheUsageAvailable:void 0,timestamp:t,time:r,tokens:{input:e.inputTokens||0,output:e.outputTokens||0,cacheCreation:e.cacheCreation||0,cacheRead:e.cacheRead||0,cached:e.cachedTokens||0,reasoning:e.reasoningTokens||0,total:Oh(o,e)},cost:e.cost||0,isHistory:Ah,isNew:!Ah};n.unshift(a),O(n),a.isNew&&setTimeout(()=>{a.isNew=!1},4500)}function D(){Object.keys(a).forEach(e=>{a[e].splice(0,a[e].length)})}function _(e,o={},n){e.value={...e.value,...o,activeChannel:n||e.value.activeChannel}}function L(e,o){const n=v(e);if(!n)return;const t=(r=o,Array.isArray(r)?r:Array.isArray(r?.channels)?r.channels:[]);var r;n.value=function(e=[],o=[]){if(!Array.isArray(o))return e;const n=new Map(e.filter(e=>e?.id).map(e=>[e.id,e]));return o.map(e=>{const o=n.get(e?.id);return o?!Object.prototype.hasOwnProperty.call(e,"apiKey")&&o.apiKey?{...o,...e,apiKey:o.apiKey}:{...o,...e}:e})}(n.value,t)}function H(e){const o=d(e?.source);if(!o||!u(o))return;const n=m(o);n&&(_(n,e.proxy,e.activeChannel),e.channels&&(L(o,e.channels),y()))}async function j(e={}){const n=h(e.keys).filter(e=>p(e,"channels"));if(S===o.value.join(",")&&!e.force)return{success:!0,channels:Object.fromEntries(n.map(e=>[e,v(e)?.value||[]]))};const t=o.value.join(","),a=!Array.isArray(e.keys);return A||(A=async function(e){try{return(await Promise.all(e.map(async e=>{const o=Mh("channels",e,`/api${await Lt(e,"channels","list")}`,{},{data:{channels:[]}}),n=Lt(e,"channels","poolStatus").then(o=>Mh("channel-pool",e,`/api${o}`,{},{data:null})).catch(()=>({data:null}));return{key:e,channelResponse:await o,poolResponse:await n}}))).forEach(({key:e,channelResponse:o,poolResponse:n})=>{const t=o?.data;L(e,Array.isArray(t)?t:t?.channels),n?.data?.scheduler&&(r[e]=n.data.scheduler)}),y(),{success:!0,channels:Object.fromEntries(e.map(e=>[e,v(e)?.value||[]]))}}catch(o){return{success:!1,channels:Object.fromEntries(e.map(e=>[e,v(e)?.value||[]]))}}}(n).then(e=>(a&&(S=t),e)).finally(()=>{A=null}),A)}return"undefined"==typeof window||window[Ph]||(window.addEventListener("advanced-config-change",e=>{e.detail?.maxLogs&&B(e.detail.maxLogs),e.detail?.statsInterval&&$(e.detail.statsInterval)}),window[Ph]=!0),{proxyStateByPlatform:n,channelsByPlatform:t,schedulerStateByPlatform:r,logsBySource:a,ensurePlatformState:f,connectWebSocket:function e(){if(Ih&&Ih.readyState===WebSocket.OPEN)return;const o=`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}/ws`;try{(Ih=new WebSocket(o)).onopen=()=>{Th=0,x.value=!0,Ah=!0,clearTimeout(zh),zh=setTimeout(()=>{Ah=!1},2e3)},Ih.onmessage=e=>{try{const o=JSON.parse(e.data);"proxy-state"===o.type?H(o):"scheduler-state"===o.type?function(e){const o=d(e?.source);o&&u(o)&&e.scheduler&&g(o)&&(r[o]=e.scheduler)}(o):"browser-notification"===o.type?function(e){if("undefined"==typeof window||"undefined"==typeof Notification)return;if("granted"!==Notification.permission)return;const o=e.id||`${e.source||"claude"}-${e.timestamp||Date.now()}`;if(s.has(o))return;s.add(o),new Notification(e.title||"coding-tool-x",{body:e.message||"任务已完成",tag:o,icon:"/logo.png"}).onclick=()=>{try{window.focus(),e.url&&window.location.assign(e.url)}catch(o){}}}(o):E(o)}catch(o){}},Ih.onclose=()=>{x.value=!1,Ih=null,Ah=!1,clearTimeout(zh);const o=Math.min(1e3*Math.pow(2,Th),1e4);Th+=1,setTimeout(e,o)},Ih.onerror=e=>{x.value=!1}}catch(n){x.value=!1}},initializeState:async function(){const e=o.value.join(",");if(C.value&&w===e)return;const n=h().filter(e=>p(e,"proxy"));try{(await Promise.all(n.map(e=>Lt(e,"proxy","status").then(o=>Mh("proxy-status",e,`/api${o}`,{},{data:{}}))))).forEach((e,o)=>{const t=e?.data||{},r=m(n[o]);r&&t.proxy&&_(r,t.proxy,t.activeChannel)}),w=e,C.value=!0}catch(t){}},loadChannels:j,getProxyState:m,getChannels:v,getSchedulerState:g,handleProxyStateUpdate:H,hydrateFromDashboard:function(e={}){const n=e.channels||{};Object.entries(n).forEach(([e,o])=>{u(e)&&L(e,o)}),y();const t=e.proxyStatus||{};Object.entries(t).forEach(([e,o])=>{if(!u(e)||!o||"object"!=typeof o)return;const n=m(e);n&&_(n,o,o.activeChannel)}),w=o.value.join(","),C.value=!0},startProxy:async function(e){const o=d(e);if(!u(o)||!p(o,"proxy"))throw $t(o,"unsupported");const n=m(o);if(!n)throw $t(o,"not_found");const t=await Lt(o,"proxy","start"),r=await _t.post(`/api${t}`);return r.data.success&&(n.value.running=!0,n.value.activeChannel=r.data.activeChannel,n.value.startTime=Date.now()),r.data},stopProxy:async function(e,o={}){const n=d(e);if(!u(n)||!p(n,"proxy"))throw $t(n,"unsupported");const t=m(n);if(!t)throw $t(n,"not_found");const r=await Lt(n,"proxy","stop"),a=await _t.post(`/api${r}`);return t.value.running=!1,t.value.activeChannel=null,t.value.startTime=null,t.value.runtime=null,!1!==a.data?.success&&await j({force:!0,keys:[n]}),o.refreshChannelsDrawer&&!1!==a.data?.success&&"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:n,reason:"proxy-stop"}})),a.data},getLogs:function(e){return I(()=>b(e))},wsConnected:x,dashboardHydrated:C,clearLogsState:D,clearLogsForSource:function(e){a[e]&&a[e].splice(0,a[e].length)},logLimit:k,statsInterval:T,loadAdvancedConfig:async function(){try{const e=await fetch("/api/config/advanced");if(e.ok){const o=await e.json();B(o.maxLogs||100),o.statsInterval&&$(o.statsInterval)}}catch(e){}}}}),Eh=!1;function Dh(e,o,n){return Ht(e,"channels",o,n)}function _h(e){return Dh(e,"list")}function Lh(e,o){return Dh(e,"create",{body:o})}function Hh(e,o,n){return Dh(e,"update",{pathParams:{channelId:o},body:n})}function jh(e,o){return Dh(e,"remove",{pathParams:{channelId:o}})}function Uh(e,o){return Hh("dsh",e,o)}function Wh(e){return jh("dsh",e)}function Nh(){return Dh("dsh","sync")}function Kh(e,o=2e4){return Dh("dsh","speedTest",{pathParams:{channelId:e},body:{timeout:o}})}function Vh(e,o=""){return Dh(e,"getAuth",{query:o?{channelId:o}:void 0})}function qh(e,o,n=!1){return Dh(e,"getAuthQuota",{pathParams:{channelId:o},query:n?{refresh:"true"}:void 0})}function Gh(e,o,n){const t=e?.authRef||{},r=o?.authRef||{};if(t.credentialId&&r.credentialId&&t.credentialId===r.credentialId)return!0;if((t.accountId||t.identityKey)&&(r.accountId||r.identityKey)&&!(t.providerId&&r.providerId&&t.providerId!==r.providerId||(t.accountId||t.identityKey)!==(r.accountId||r.identityKey)))return!0;if(t.accountEmail&&r.accountEmail&&t.accountEmail===r.accountEmail)return!0;const a=Boolean(t.credentialId||t.providerId||t.accountId||t.identityKey||t.accountEmail),l=t.providerId||e?.oauthProviderId||e?.providerKey||"",i=l?n.filter(e=>(e?.authRef?.providerId||e?.providerId)===l):[];return 1===i.length&&i[0]===o||!a&&1===n.length&&n[0]===o}async function Jh(e,o){const n=await Vh(e,o),t=n?.channel;if(!t||"oauth"!==t.authMode)return{status:"missing",level:"failed",title:"未找到 OAuth 渠道",checkedAt:(new Date).toISOString()};const r=Array.isArray(n.candidates)?n.candidates:[],a=r.find(e=>Gh(t,e,r));if(!a)return{status:"missing",level:"failed",title:"未找到匹配的本地 OAuth 凭证",warning:(n.warnings||[]).join(" "),checkedAt:(new Date).toISOString()};let l;try{l=await qh(e,o,!0)}catch(f){l={status:"unavailable",warning:f?.response?.data?.error||f?.message||"在线授权检查失败"}}let i=null;if("available"===l.status)try{i=await Vh(e,o)}catch{}const s=Array.isArray(i?.candidates)?i.candidates:[],d=function(e){if(null==e||""===e)return null;const o="number"==typeof e||/^\d+$/.test(String(e))?Number(e):NaN,n=Number.isFinite(o)?new Date(o<1e12?1e3*o:o):new Date(e);return Number.isNaN(n.getTime())?null:n.toISOString()}(s.find(e=>Gh(t,e,s))?.expiresAt||a.expiresAt),c=d&&new Date(d).getTime()<=Date.now(),u=["available","unauthorized","unsupported"].includes(l.status)?l.status:"unavailable",p=c&&"available"!==u?"expired":u,h={available:{level:"success",title:"OAuth 授权可用"},unauthorized:{level:"failed",title:"OAuth 授权已失效或过期"},expired:{level:"failed",title:"Token 已过期"},unsupported:{level:"warning",title:"凭证已找到,暂时无法在线验证"},unavailable:{level:"warning",title:"凭证已找到,暂时无法验证"}};return{status:p,...h[p]||h.unavailable,account:a.accountEmail||a.authRef?.accountEmail||"",expiresAt:d,warning:l.warning||l.error||"",checkedAt:l.checkedAt||(new Date).toISOString()}}function Yh(){return Dh("claude","sync")}function Zh(e,o){return Hh("claude",e,o)}function Xh(e){return jh("claude",e)}async function Qh(e,o){return(await Dt.post(`/channel-balances/${encodeURIComponent(e)}/${encodeURIComponent(o)}/refresh`)).data}function ef(){return Dh("codex","sync")}function of(e,o){return Hh("codex",e,o)}function nf(e){return jh("codex",e)}function tf(){return Dh("gemini","sync")}function rf(e,o){return Hh("gemini",e,o)}function af(e){return jh("gemini",e)}function lf(e,o=2e4){return Dh("claude","speedTest",{pathParams:{channelId:e},body:{timeout:o}})}function sf(e,o=2e4){return Dh("codex","speedTest",{pathParams:{channelId:e},body:{timeout:o}})}function df(e,o=2e4){return Dh("gemini","speedTest",{pathParams:{channelId:e},body:{timeout:o}})}function cf(){return Dh("opencode","sync")}function uf(e,o){return Hh("opencode",e,o)}function pf(e){return jh("opencode",e)}function hf(e,o=2e4){return Dh("opencode","speedTest",{pathParams:{channelId:e},body:{timeout:o}})}function ff(){return Dh("omp","sync")}function mf(e,o){return Hh("omp",e,o)}function vf(e){return jh("omp",e)}function gf(e,o,n){return Hh(e,o,n)}function bf(e,o=2e4){return Dh("omp","speedTest",{pathParams:{channelId:e},body:{timeout:o}})}async function yf(e){const o=Et(e),n={claude:"/claude",codex:"/codex",gemini:"/gemini",opencode:"/opencode",omp:"/omp"}[o]||Bt(o);return(await Dt.get(`${n}/statistics/today`)).data}async function xf(e){return(await Dt.get("/statistics/trend",{params:e})).data}async function Cf(e){return(await Dt.get("/statistics/filters",{params:e})).data}function wf(e){return`/api/statistics/trend/export?${new URLSearchParams(e).toString()}`}function Sf(e){return Array.isArray(e)?e:Array.isArray(e?.channels)?e.channels:[]}function kf(e={}){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,o={}])=>{const n="object"==typeof o.tokens?o.tokens?.total:o.tokens;return[e,{...o,requests:o.requests||0,tokens:n||0,cost:o.cost||0}]})):{}}function Pf(e={}){const o="object"==typeof e.tokens?e.tokens?.total:e.tokens;return{requests:e.requests||0,tokens:o||0,cost:e.cost||0,byModel:e.byModel||{},byChannel:kf(e.byChannel)}}var If=W("dashboard",()=>{const{enabledKeys:e,getPlatform:o}=jt(),n=J({uiConfig:null,favorites:null,channels:{},proxyStatus:{},todayStats:{},counts:{},meta:null}),t=J(!1),r=J(!1);let a=null,l="",i=null,s=0,d=null;function c(e){if(!e?.refreshing)return s=0,void(i&&(clearTimeout(i),i=null));if(s>=8||i)return;const o=s;s+=1,i=setTimeout(()=>{i=null,f(!0,{fresh:!1}).catch(()=>{})},Math.min(1200+1200*o,5e3))}function u(){return e.value}function p(e,o=e=>e){const n=e&&"object"==typeof e?e:{};return Object.fromEntries(u().map(e=>[e,o(n[e])]))}function h(e,n){const t=function(e){const o=String(e||"").trim().toLowerCase();return u().includes(o)?o:null}(e),r=t?o(t):null;return!t||!0!==r?.capabilities?.[n]&&!0!==r?.resourceTypes?.[n]?null:t}async function f(e=!1,o={}){const i=u().join(",");return r.value&&!e&&l===i?n.value:a||(t.value=!0,a=(async()=>{try{const t=await async function(e={}){return(await Dt.get("/dashboard/init",{params:e.fresh?{fresh:"1"}:void 0})).data}({fresh:!0===o.fresh});if(!t||!1===t.success)throw new Error(t?.message||"Failed to load dashboard");const a=t.data||{},s=u();n.value={uiConfig:a.uiConfig||null,favorites:a.favorites||null,channels:p(a.channels,Sf),proxyStatus:p(a.proxyStatus,e=>e&&"object"==typeof e?e:{}),todayStats:p(a.todayStats,Pf),counts:p(a.counts,e=>e&&"object"==typeof e?e:{projectCount:0,sessionCount:0}),meta:a.meta||null},0===s.length&&(n.value.channels={},n.value.proxyStatus={},n.value.todayStats={},n.value.counts={});try{$h().hydrateFromDashboard(n.value)}catch(e){}return c(n.value.meta),l=i,r.value=!0,n.value}finally{t.value=!1,a=null}})().catch(e=>{throw e}),a)}return{dashboardData:n,isLoading:t,isLoaded:r,loadDashboard:f,enableAutoRefresh:function(){d||(d=setInterval(()=>{f(!0,{fresh:!0}).catch(()=>{})},3e5))},disableAutoRefresh:function(){d&&(clearInterval(d),d=null)},refreshChannels:async function(e){const o=h(e,"channels");if(o)try{const e=await _h(o);n.value.channels[o]=Sf(e)}catch(t){}},refreshProxyStatus:async function(e){const o=h(e,"proxy");if(o)try{n.value.proxyStatus[o]=await async function(e){return(await Dt.get(`${Bt(e)}/proxy/status`)).data}(o)}catch(t){}},refreshStats:async function(e){const o=h(e,"statistics");if(o)try{const e=await yf(o),t=e?.summary||{};n.value.todayStats[o]=Pf({requests:t.requests||0,tokens:t.tokens||0,cost:t.cost||0,byModel:e?.byModel||{},byChannel:e?.byChannel||{}})}catch(t){}}}}),Tf="cc-theme",Af=J(!1),zf=!1,Rf=null,Mf=null,Ff=!1;function Of(){return Rf||(Rf=If(),Mf=T(Rf).dashboardData),Rf}function Bf(){Ff||Mf&&(C(()=>Mf.value?.uiConfig?.theme,e=>{if(!e)return;const o="dark"===e;if(!zf)return zf=!0,Af.value=o,void Ef(o);Af.value!==o&&(Af.value=o,Ef(o))}),Ff=!0)}async function $f(){if(zf)return;const e="undefined"!=typeof window?window.localStorage?.getItem(Tf):null;"dark"!==e&&"light"!==e||(Af.value="dark"===e,Ef(Af.value));try{const o=Of();Bf();let n=Mf?.value?.uiConfig?.theme;n||(n=(await o.loadDashboard().catch(()=>null))?.uiConfig?.theme),n||e?n&&(Af.value="dark"===n):Af.value=window.matchMedia("(prefers-color-scheme: dark)").matches}catch(o){e||(Af.value=window.matchMedia("(prefers-color-scheme: dark)").matches)}Ef(Af.value),zf=!0}function Ef(e){e?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme")}function Df(){Af.value=!Af.value}function _f(){return{isDark:Af,toggleTheme:Df,loadTheme:$f}}function Lf(){const e=$h(),{proxyStateByPlatform:o,channelsByPlatform:n,schedulerStateByPlatform:t,logsBySource:r,wsConnected:a,logLimit:l,statsInterval:i}=T(e);return{proxyStateByPlatform:o,channelsByPlatform:n,schedulerStateByPlatform:t,logsBySource:r,ensurePlatformState:e.ensurePlatformState,connectWebSocket:e.connectWebSocket,initializeState:e.initializeState,loadChannels:e.loadChannels,getProxyState:e.getProxyState,getChannels:e.getChannels,getSchedulerState:e.getSchedulerState,handleProxyStateUpdate:e.handleProxyStateUpdate,hydrateFromDashboard:e.hydrateFromDashboard,startProxy:e.startProxy,stopProxy:e.stopProxy,getLogs:e.getLogs,wsConnected:a,clearLogsState:e.clearLogsState,clearLogsForSource:e.clearLogsForSource,logLimit:l,statsInterval:i,loadAdvancedConfig:e.loadAdvancedConfig}}function Hf(){!function(){if(Eh)return;const e=$h();e.connectWebSocket(),queueMicrotask(()=>{const o=()=>{e.loadAdvancedConfig()};"undefined"==typeof window||"function"!=typeof window.requestIdleCallback?setTimeout(o,0):window.requestIdleCallback(o,{timeout:1e3})}),Eh=!0}()}C(Af,async e=>{Ef(e);try{window.localStorage?.setItem(Tf,e?"dark":"light")}catch(o){}try{await te("theme",e?"dark":"light"),Of(),Bf(),Mf.value&&(Mf.value={...Mf.value,uiConfig:{...Mf.value.uiConfig||{},theme:e?"dark":"light"}})}catch(o){}});var jf=W("favorites",()=>{const e=J({claude:[],codex:[],gemini:[]}),o=J(!1),n=J(!1);let t=null;return{favorites:e,totalFavorites:I(()=>(e.value.claude?.length||0)+(e.value.codex?.length||0)+(e.value.gemini?.length||0)),isLoaded:o,loading:n,loadFavorites:async function(r=!1){if(o.value&&!r)return e.value;if(t&&!r)return t;let a=null;return a=(async()=>{n.value=!0;try{const n=await async function(){return(await Dt.get("/favorites")).data}();return n.success&&n.favorites&&(e.value={claude:n.favorites.claude||[],codex:n.favorites.codex||[],gemini:n.favorites.gemini||[]}),o.value=!0,e.value}catch(r){throw r}finally{n.value=!1,t===a&&(t=null)}})(),t=a,a},addFavorite:async function(o,n){try{const t=await async function(e,o){return(await Dt.post("/favorites",{channel:e,sessionData:o})).data}(o,n);if(t.success&&t.favorites)return e.value=t.favorites,!0}catch(t){}return!1},removeFavorite:async function(o,n,t){try{const r=await async function(e,o,n){return(await Dt.delete(`/favorites/${e}/${encodeURIComponent(o)}/${n}`)).data}(o,n,t);if(r.success&&r.favorites)return e.value=r.favorites,!0}catch(r){}return!1},isFavorite:function(o,n,t){return!!e.value[o]&&e.value[o].some(e=>e.sessionId===t&&e.projectName===n)},getFavoritesByChannel:function(o){return e.value[o]||[]}}});function Uf(){const e=jf(),{favorites:o,totalFavorites:n}=T(e);return e.isLoaded||e.loadFavorites().catch(()=>{}),{favorites:o,addFavorite:e.addFavorite,removeFavorite:e.removeFavorite,isFavorite:e.isFavorite,getFavorites:function(o){return e.getFavoritesByChannel(o)},getAllFavorites:function(){return o.value},totalFavorites:n,loadFavorites:e.loadFavorites}}function Wf(){const e=If(),{dashboardData:o,isLoading:n,isLoaded:t}=T(e);return{dashboardData:o,isLoading:n,isLoaded:t,loadDashboard:e.loadDashboard,scheduleRefresh:e.scheduleRefresh,enableAutoRefresh:e.enableAutoRefresh,disableAutoRefresh:e.disableAutoRefresh,refreshChannels:e.refreshChannels,refreshProxyStatus:e.refreshProxyStatus,refreshStats:e.refreshStats}}var Nf={class:"channel-header"},Kf={class:"channel-title"},Vf=["title"],qf={class:"channel-actions"},Gf={class:"test-result-header"},Jf={class:"test-result-status"},Yf={class:"test-result-info"},Zf={key:0,class:"status-code"},Xf={key:1,class:"status-code"},Qf={key:2,class:"status-code"},em={key:3,class:"status-code"},om={key:0,class:"latency"},nm={key:1,class:"status-code"},tm={key:0,class:"test-result-error"},rm={key:1,class:"test-result-warning"},am={class:"channel-info"},lm={class:"info-main"},im={class:"info-footer"},sm={class:"channel-meta"},dm={class:"meta-item"},cm={class:"meta-value"},um={class:"meta-item"},pm={__name:"ChannelCard",props:{channel:{type:Object,required:!0},collapsed:{type:Boolean,default:!1},headerTags:{type:Array,default:()=>[]},infoRows:{type:Array,default:()=>[]},meta:{type:Object,default:()=>({weight:1,concurrencyText:"不限",concurrencyActive:!1})},balance:{type:Object,default:null},showApplyButton:{type:Boolean,default:!1},channelType:{type:String,default:"claude"},testFn:{type:Function,default:null},authCheckFn:{type:Function,default:null},toggling:{type:Boolean,default:!1}},emits:["toggle-collapse","apply","edit","delete","toggle-enabled","open-website","refresh-balance"],setup(e,{emit:o}){const r=e,a=o,l=J(!1),i=J(null),s=I(()=>"oauth"===r.channel?.authMode),c=I(()=>{if(!r.balance?.visible||"oauth-quota"!==r.balance.kind)return[];const e=Array.isArray(r.balance.windows)?r.balance.windows:[],o=e.filter(e=>"primary"===e?.id||"secondary"===e?.id);return o.length?o:e}),u=I(()=>c.value.length>0);function p(e){const o=Number(e);return Number.isFinite(o)?Number.isInteger(o)?String(o):o.toFixed(1).replace(/\.0$/,""):"—"}function f(e){const o=[];if(r.balance?.platform&&o.push(r.balance.platform),e?.label&&o.push(`${e.label} 剩余 ${p(e.remainingPercent)}%`),e?.resetsAt)try{o.push(`重置 ${new Date(e.resetsAt).toLocaleString()}`)}catch{}return o.join(" · ")}const m=I(()=>{if(!r.balance?.visible)return"";const e=[];if(r.balance.platform&&e.push(r.balance.platform),r.balance.stale&&e.push("缓存"),r.balance.updatedAt)try{e.push(new Date(r.balance.updatedAt).toLocaleString())}catch{}if(Array.isArray(r.balance.windows)&&r.balance.windows.length){const o=r.balance.windows.map(e=>{const o=null==e.remainingPercent?"":`剩余 ${e.remainingPercent}%`;let n="";if(e.resetsAt)try{n=`,重置 ${new Date(e.resetsAt).toLocaleString()}`}catch{}return`${e.label||e.id||"额度"} ${o}${n}`});e.push(o.join("\n"))}return e.join(" · ")});async function g(){const e=s.value?r.authCheckFn:r.testFn;if(e){l.value=!0,i.value=null;try{const o=s.value?await e(r.channel.id):await e(r.channel.id,2e4);i.value=s.value?{...o,kind:"oauth"}:o}catch(o){i.value=s.value?{kind:"oauth",level:"failed",title:"授权检查失败",error:o.message||"检查失败"}:{success:!1,error:o.message||"测试失败",latency:null,statusCode:null}}finally{l.value=!1}}}function b(e){const o=new Date(e);return Number.isNaN(o.getTime())?String(e):o.toLocaleString()}return(o,r)=>(y(),X("div",{class:$(["channel-card",{collapsed:e.collapsed,disabled:!1===e.channel.enabled,"status-frozen":"frozen"===e.channel.health?.status,"status-checking":"checking"===e.channel.health?.status}])},[Q("div",Nf,[Q("div",Kf,[h(j(Po),{text:"",size:"tiny",class:"collapse-btn",onClick:r[0]||(r[0]=H(e=>o.$emit("toggle-collapse"),["stop"]))},{default:R(()=>[h(j(so),{size:"16",class:$({collapsed:e.collapsed})},{default:R(()=>[h(j(Rt))]),_:1},8,["class"])]),_:1}),Q("span",{class:"channel-name",title:e.channel.name},S(e.channel.name),9,Vf),(y(!0),X(F,null,d(e.headerTags,e=>(y(),v(j(cl),{key:e.text,size:"tiny",type:e.type||"default",bordered:!1},{default:R(()=>[t(S(e.text),1)]),_:2},1032,["type"]))),128))]),Q("div",qf,[e.showApplyButton?(y(),v(j(Po),{key:0,size:"tiny",type:"primary",class:"apply-btn",onClick:r[1]||(r[1]=e=>o.$emit("apply"))},{default:R(()=>[...r[9]||(r[9]=[t(" 写入配置 ",-1)])]),_:1})):n("",!0),h(j(Po),{size:"tiny",loading:l.value,onClick:g},{icon:R(()=>[h(j(so),null,{default:R(()=>[s.value?(y(),v(j(St),{key:0})):(y(),v(j(zt),{key:1}))]),_:1})]),default:R(()=>[t(" "+S(s.value?"检查授权":"测速"),1)]),_:1},8,["loading"]),h(j(Po),{size:"tiny",onClick:r[2]||(r[2]=e=>o.$emit("edit"))},{default:R(()=>[...r[10]||(r[10]=[t(" 编辑 ",-1)])]),_:1}),h(j(Po),{size:"tiny",type:"error",onClick:r[3]||(r[3]=e=>o.$emit("delete"))},{default:R(()=>[...r[11]||(r[11]=[t(" 删除 ",-1)])]),_:1}),h(j(Kp),{size:"small",value:!1!==e.channel.enabled,loading:e.toggling,disabled:e.toggling,"onUpdate:value":r[4]||(r[4]=e=>o.$emit("toggle-enabled",e))},null,8,["value","loading","disabled"])])]),i.value?(y(),X("div",{key:0,class:$(["test-result","oauth"===i.value.kind?i.value.level:i.value.success?"success":"failed"])},[Q("div",Gf,[Q("span",Jf,["oauth"===i.value.kind?(y(),X(F,{key:0},["success"===i.value.level?(y(),v(j(so),{key:0,color:"#18a058"},{default:R(()=>[h(j(Ot))]),_:1})):"warning"===i.value.level?(y(),v(j(so),{key:1,color:"#d99000"},{default:R(()=>[h(j(it))]),_:1})):(y(),v(j(so),{key:2,color:"#f56c6c"},{default:R(()=>[h(j(bt))]),_:1})),t(" "+S(i.value.title),1)],64)):(y(),X(F,{key:1},[i.value.success?(y(),v(j(so),{key:0,color:"#18a058"},{default:R(()=>[h(j(Ot))]),_:1})):(y(),v(j(so),{key:1,color:"#f56c6c"},{default:R(()=>[h(j(bt))]),_:1})),t(" "+S(i.value.success?"测试成功":"测试失败"),1)],64))]),Q("div",Yf,["oauth"===i.value.kind?(y(),X(F,{key:0},[i.value.account?(y(),X("span",Zf,S(i.value.account),1)):n("",!0),i.value.expiresAt?(y(),X("span",Xf,"Token 到期 "+S(b(i.value.expiresAt)),1)):(y(),X("span",Qf,"Token 有效期未知")),i.value.checkedAt?(y(),X("span",em,"检查于 "+S(b(i.value.checkedAt)),1)):n("",!0)],64)):(y(),X(F,{key:1},[i.value.latency?(y(),X("span",om,S(i.value.latency)+"ms",1)):n("",!0),i.value.statusCode?(y(),X("span",nm,"HTTP "+S(i.value.statusCode),1)):n("",!0)],64))]),h(j(Po),{text:"",size:"tiny",onClick:r[5]||(r[5]=e=>i.value=null)},{default:R(()=>[h(j(so),null,{default:R(()=>[h(j(gt))]),_:1})]),_:1})]),i.value.error?(y(),X("div",tm,S(i.value.error),1)):n("",!0),i.value.warning?(y(),X("div",rm,S(i.value.warning),1)):n("",!0)],2)):n("",!0),Z(Q("div",am,[Q("div",lm,[(y(!0),X(F,null,d(e.infoRows,e=>(y(),X("div",{key:e.label,class:"info-row"},[h(j(qp),{depth:"3",class:"label"},{default:R(()=>[t(S(e.label)+":",1)]),_:2},1024),h(j(qp),{depth:"2",class:$(["value",{mono:e.mono}])},{default:R(()=>[t(S(e.value||"—"),1)]),_:2},1032,["class"]),"function"==typeof e.action?(y(),v(j(Po),{key:0,size:"tiny",text:"",type:"primary",onClick:o=>e.action()},{default:R(()=>[t(S(e.actionLabel||"操作"),1)]),_:2},1032,["onClick"])):n("",!0)]))),128))]),Q("div",im,[e.channel.websiteUrl?(y(),v(j(Po),{key:0,text:"",size:"tiny",onClick:r[6]||(r[6]=n=>o.$emit("open-website",e.channel.websiteUrl))},{icon:R(()=>[h(j(so),{size:"14"},{default:R(()=>[h(j(lt))]),_:1})]),default:R(()=>[r[12]||(r[12]=t(" 前往官网 ",-1))]),_:1})):n("",!0),r[15]||(r[15]=Q("div",{class:"footer-spacer"},null,-1)),Q("div",sm,[u.value?(y(!0),X(F,{key:0},d(c.value,e=>(y(),v(j(cl),{key:e.id||e.label,size:"tiny",type:"success",bordered:!1,class:"balance-meta-tag",title:f(e),onClick:r[7]||(r[7]=H(e=>a("refresh-balance"),["stop"]))},{default:R(()=>[t(S(e.label)+" 剩余 "+S(p(e.remainingPercent))+"% ",1)]),_:2},1032,["title"]))),128)):e.balance?.visible&&e.balance.label?(y(),v(j(cl),{key:1,size:"tiny",type:"success",bordered:!1,class:"balance-meta-tag",title:m.value,onClick:r[8]||(r[8]=H(e=>a("refresh-balance"),["stop"]))},{default:R(()=>[t(S(e.balance.label),1)]),_:1},8,["title"])):n("",!0),Q("span",dm,[r[13]||(r[13]=t(" 权重: ",-1)),Q("span",cm,S(e.meta.weight),1)]),Q("span",um,[r[14]||(r[14]=t(" 并发: ",-1)),Q("span",{class:$(["meta-value",{"meta-active":e.meta.concurrencyActive}])},S(e.meta.concurrencyText),3)])])])],512),[[M,!e.collapsed]])],2))}},hm=To(pm,[["__scopeId","data-v-beb1848e"]]),fm=J(null),mm=J(null),vm=J(!1),gm={claude:["claude-opus-4-7","claude-opus-4-6","claude-sonnet-4-6","claude-opus-4-5-20251101","claude-sonnet-4-5-20250929","claude-haiku-4-5-20251001"],codex:["gpt-5.5","gpt-5.4","gpt-5.4-mini","gpt-5.3-codex","gpt-5.3-codex-spark","gpt-5.2-codex","gpt-5.1-codex-max","gpt-5.1-codex","gpt-5.1-codex-mini","gpt-5-codex","gpt-5.2","gpt-5.1","gpt-5"],gemini:["gemini-3.1-pro-preview","gemini-3.1-flash-preview","gemini-3-pro-preview","gemini-3-flash-preview","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite"],opencode:[],omp:[]},bm=Object.freeze(Object.keys(gm));function ym(e=[]){const o=new Set,n=[];return e.forEach(e=>{if("string"!=typeof e)return;const t=e.trim();if(!t)return;const r=t.toLowerCase();o.has(r)||(o.add(r),n.push(t))}),n}function xm(e){const o=String(e||"").trim().toLowerCase();return o.startsWith("claude-")?"claude":o.startsWith("gemini-")?"gemini":o.startsWith("gpt-")||o.startsWith("o1")||o.startsWith("o3")||o.startsWith("o4")?"codex":""}function Cm(){return Object.fromEntries(bm.map(e=>[e,[...gm[e]||[]]]))}var wm=null;async function Sm(e={}){const o=!0===e.forceRefresh;return!o&&fm.value&&mm.value?fm.value:wm||(vm.value=!0,wm=(async()=>{try{const n=new URLSearchParams;o&&n.set("forceRefresh","true");const t=n.toString(),r=t?`/api/config/default-models?${t}`:"/api/config/default-models",a=await fetch(r);if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);const l=await a.json();fm.value=l.defaultModels;try{const e=await fetch("/api/settings/model-settings");if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);const o=await e.json(),n=function(e,o={}){const n=Object.values(e||{}).flatMap(e=>Array.isArray(e?.toolTypes)?e.toolTypes:[]),t=[...new Set([...bm,...Object.keys(o||{}),...n])],r=Object.fromEntries(t.map(e=>[e,[]]));if(Object.keys(o||{}).length>0){for(const e of t)r[e]=ym(o[e]||[]);return r}for(const[a,l]of Object.entries(e||{})){if(!l||"object"!=typeof l||!l.limit||!l.pricing)continue;const e=Array.isArray(l.toolTypes)?l.toolTypes:[xm(a)];for(const o of e)r[o]&&r[o].push(a)}return Object.fromEntries(t.map(e=>[e,ym(r[e])]))}(o.models||{},o.toolModels||{});mm.value=Object.fromEntries(Object.entries(n).map(([e,o])=>[e,o.length>0?o:[...gm[e]||[]]]))}catch(e){mm.value=Cm()}}catch(n){fm.value=gm,mm.value=Cm()}finally{vm.value=!1,wm=null}return fm.value})())}function km(e){const o=fm.value?.[e];if(Array.isArray(o)&&o.length>0)return o;const n=mm.value?.[e];return Array.isArray(n)&&n.length>0?n:gm[e]||[]}function Pm(e){return mm.value?.[e]||gm[e]||[]}function Im(){return{defaultModels:fm,allModels:mm,loading:vm,loadDefaultModels:Sm,getDefaultModels:km,getAllModelsByToolType:Pm}}var Tm={class:"model-redirect-editor"},Am={class:"redirect-input"},zm={class:"redirect-arrow"},Rm={class:"redirect-input"},Mm={__name:"ModelRedirectEditor",props:{modelValue:{type:Array,default:()=>[]},availableModels:{type:Array,default:()=>[]},channelType:{type:String,default:"claude"}},emits:["update:modelValue"],setup(e,{emit:o}){const n=e,r=o,{getDefaultModels:a,loadDefaultModels:l}=Im();b(async()=>{await l()});const i=I(()=>n.availableModels&&n.availableModels.length>0?n.availableModels:a(n.channelType).map(e=>({label:e,value:e})));function s(e){if(!e)return i.value;const o=e.toLowerCase();return i.value.filter(e=>(e.label||e.value||"").toLowerCase().includes(o))}function c(e,o,t){const a=[...n.modelValue];a[e]={...a[e],[o]:t},r("update:modelValue",a)}function u(){r("update:modelValue",[...n.modelValue,{from:"",to:""}])}return(o,a)=>(y(),X("div",Tm,[(y(!0),X(F,null,d(e.modelValue,(e,o)=>(y(),X("div",{key:o,class:"redirect-row"},[Q("div",Am,[h(j(Kl),{value:e.from,options:s(e.from),placeholder:"源模型",clearable:"","get-show":()=>!0,"onUpdate:value":e=>c(o,"from",e)},null,8,["value","options","onUpdate:value"])]),Q("div",zm,[h(j(so),{size:"16",color:"#999"},{default:R(()=>[h(j(ct))]),_:1})]),Q("div",Rm,[h(j(Kl),{value:e.to,options:s(e.to),placeholder:"目标模型",clearable:"","get-show":()=>!0,"onUpdate:value":e=>c(o,"to",e)},null,8,["value","options","onUpdate:value"])]),h(j(Po),{quaternary:"",circle:"",size:"small",onClick:e=>function(e){const o=n.modelValue.filter((o,n)=>n!==e);r("update:modelValue",o)}(o)},{icon:R(()=>[h(j(so),null,{default:R(()=>[h(j(gt))]),_:1})]),_:1},8,["onClick"])]))),128)),h(j(Po),{dashed:"",size:"small",onClick:u,class:"add-btn"},{icon:R(()=>[h(j(so),null,{default:R(()=>[h(j(st))]),_:1})]),default:R(()=>[a[0]||(a[0]=t(" 添加重定向规则 ",-1))]),_:1})]))}},Fm=To(Mm,[["__scopeId","data-v-8ebdcad0"]]);function Om(e,o=""){const n=J(!1),t=J([]),r=J(""),a=J(null);return{loading:n,candidates:t,warning:r,quota:a,sync:async function(){n.value=!0,r.value="";try{const n=await function(e,o=""){return Dh(e,"syncLocalAuth",{body:o?{channelId:o}:{}})}(j(e),j(o));return t.value=n.candidates||[],r.value=(n.warnings||[]).join(" "),n}catch(a){throw r.value=a?.response?.data?.error||a.message||"同步本地 OAuth 失败",a}finally{n.value=!1}},refreshQuota:async function(n=!0){const t=j(o);if(!t)return null;const l=await qh(j(e),t,n);return a.value=l.quota||null,l.warning&&(r.value=l.warning),l}}}var Bm={class:"channel-auth-section"},$m={class:"oauth-content"},Em={key:2,class:"oauth-meta"},Dm={key:3,class:"oauth-quota"},_m={__name:"ChannelAuthSection",props:{platform:String,channelId:String,formData:Object,authMeta:Object},emits:["update-auth"],setup(e,{emit:o}){const r=e,a=o;function l(e){const o=e.authRef||e;return`${o.credentialId||o.providerId}:${o.accountId||o.identityKey||o.accountEmail||"account"}`}const i=I(()=>l({authRef:r.formData.authRef})),{loading:s,candidates:c,warning:u,quota:p,sync:f,refreshQuota:m}=Om(z(r,"platform"),z(r,"channelId")),g=I(()=>Array.isArray(p.value?.windows)&&p.value.windows.length?p.value.windows:[p.value?.primary,p.value?.secondary]);function b(e){const o=c.value.find(o=>l(o)===e);o&&a("update-auth",o)}return(o,r)=>(y(),X("div",Bm,[Q("div",$m,[h(j(Po),{size:"small",type:"primary",loading:j(s),onClick:j(f)},{default:R(()=>[...r[0]||(r[0]=[t("同步本地 OAuth",-1)])]),_:1},8,["loading","onClick"]),j(u)?(y(),v(j(Sl),{key:0,type:"warning","show-icon":!1},{default:R(()=>[t(S(j(u)),1)]),_:1})):n("",!0),j(c).length?(y(),v(j(hs),{key:1,value:i.value,"onUpdate:value":b},{default:R(()=>[h(j(Nd),{vertical:""},{default:R(()=>[(y(!0),X(F,null,d(j(c),o=>(y(),v(j(us),{key:o.id,value:l(o)},{default:R(()=>[t(S(o.providerId||e.platform)+" / "+S(o.accountEmail||o.accountId||o.authRef?.identityKey||"本地账户"),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])):n("",!0),e.authMeta?.channel?(y(),X("div",Em,S(e.authMeta.channel.authRef?.providerId||e.platform)+" · "+S(e.authMeta.channel.authRef?.accountEmail||e.authMeta.channel.authRef?.accountId||"已同步"),1)):n("",!0),j(p)?(y(),X("div",Dm,[(y(!0),X(F,null,d(g.value,e=>(y(),X("span",{key:e?.id||e?.label||"missing-window"},S(e?.label||"—")+": "+S(e?`${e.remainingPercent}%`:"—"),1))),128)),h(j(Po),{text:"",size:"tiny",onClick:j(m)},{default:R(()=>[...r[1]||(r[1]=[t("刷新额度",-1)])]),_:1},8,["onClick"])])):n("",!0)])]))}},Lm=To(_m,[["__scopeId","data-v-8fcf77d4"]]),Hm=[{id:"official",name:"Claude 官方",category:"official",websiteUrl:"https://www.anthropic.com",baseUrl:"https://api.anthropic.com",env:{}},{id:"claude_oauth",name:"Claude OAuth",category:"oauth",description:"使用本地 Claude 登录凭据",websiteUrl:"",baseUrl:"",authMode:"oauth",oauthProviderId:"claude",env:{}},{id:"openai",name:"OpenAI",category:"third_party",websiteUrl:"https://platform.openai.com",baseUrl:"https://api.openai.com/v1",gatewaySourceType:"openai_compatible",targetApi:"responses",env:{}},{id:"deepseek",name:"DeepSeek",category:"cn_official",websiteUrl:"https://platform.deepseek.com",baseUrl:"https://api.deepseek.com/anthropic",env:{ANTHROPIC_MODEL:"DeepSeek-V3.2-Exp",ANTHROPIC_DEFAULT_HAIKU_MODEL:"DeepSeek-V3.2-Exp",ANTHROPIC_DEFAULT_SONNET_MODEL:"DeepSeek-V3.2-Exp",ANTHROPIC_DEFAULT_OPUS_MODEL:"DeepSeek-V3.2-Exp"}},{id:"zhipu",name:"智谱 GLM",category:"cn_official",websiteUrl:"https://open.bigmodel.cn",baseUrl:"https://open.bigmodel.cn/api/anthropic",env:{ANTHROPIC_MODEL:"glm-4.6",ANTHROPIC_DEFAULT_HAIKU_MODEL:"glm-4.5-air",ANTHROPIC_DEFAULT_SONNET_MODEL:"glm-4.6",ANTHROPIC_DEFAULT_OPUS_MODEL:"glm-4.6"}},{id:"kimi",name:"Kimi K2",category:"cn_official",websiteUrl:"https://platform.moonshot.cn",baseUrl:"https://api.moonshot.cn/anthropic",env:{ANTHROPIC_MODEL:"kimi-k2-thinking",ANTHROPIC_DEFAULT_HAIKU_MODEL:"kimi-k2-thinking",ANTHROPIC_DEFAULT_SONNET_MODEL:"kimi-k2-thinking",ANTHROPIC_DEFAULT_OPUS_MODEL:"kimi-k2-thinking"}},{id:"minimax",name:"MiniMax",category:"cn_official",websiteUrl:"https://platform.minimaxi.com",baseUrl:"https://api.minimaxi.com/anthropic",env:{ANTHROPIC_MODEL:"MiniMax-M2",ANTHROPIC_DEFAULT_HAIKU_MODEL:"MiniMax-M2",ANTHROPIC_DEFAULT_SONNET_MODEL:"MiniMax-M2",ANTHROPIC_DEFAULT_OPUS_MODEL:"MiniMax-M2"}},{id:"qwen",name:"通义千问",category:"cn_official",websiteUrl:"https://bailian.console.aliyun.com",baseUrl:"https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy",env:{ANTHROPIC_MODEL:"qwen3-max",ANTHROPIC_DEFAULT_HAIKU_MODEL:"qwen3-max",ANTHROPIC_DEFAULT_SONNET_MODEL:"qwen3-max",ANTHROPIC_DEFAULT_OPUS_MODEL:"qwen3-max"}},{id:"doubao",name:"豆包 Seed",category:"cn_official",websiteUrl:"https://www.volcengine.com/product/doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/coding",env:{ANTHROPIC_MODEL:"doubao-seed-code-preview-latest",ANTHROPIC_DEFAULT_HAIKU_MODEL:"doubao-seed-code-preview-latest",ANTHROPIC_DEFAULT_SONNET_MODEL:"doubao-seed-code-preview-latest",ANTHROPIC_DEFAULT_OPUS_MODEL:"doubao-seed-code-preview-latest"}},{id:"custom",name:"自定义",category:"custom",websiteUrl:"",baseUrl:"",env:{}}],jm={official:"官方",cn_official:"国内官方",aggregator:"聚合服务",third_party:"第三方",oauth:"OAuth",custom:"自定义"};function Um(e){return Hm.find(o=>o.id===e)}var Wm=[{id:"openai",name:"OpenAI",category:"official",websiteUrl:"https://platform.openai.com",baseUrl:"https://api.openai.com/v1",providerKey:"openai-official"},{id:"codex_oauth",name:"Codex OAuth",category:"oauth",description:"使用本地 Codex 登录凭据",websiteUrl:"",baseUrl:"",providerKey:"codex-oauth",authMode:"oauth",oauthProviderId:"codex"},{id:"custom",name:"自定义",category:"custom",websiteUrl:"",baseUrl:"",providerKey:""}],Nm={official:"官方",oauth:"OAuth",custom:"自定义"};function Km(e){return Wm.find(o=>o.id===e)}var Vm=[{id:"google",name:"Google AI",category:"official",websiteUrl:"https://ai.google.dev",baseUrl:"https://generativelanguage.googleapis.com/v1beta",apiFormat:"gemini_api"},{id:"gemini_oauth",name:"Gemini OAuth",category:"oauth",description:"使用本地 Gemini 登录凭据",websiteUrl:"",baseUrl:"",model:"gemini-2.5-pro",authMode:"oauth",oauthProviderId:"gemini"},{id:"vertex_ai_v1",name:"Vertex AI v1",category:"official",websiteUrl:"https://cloud.google.com/vertex-ai/generative-ai/docs",baseUrl:"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google",apiFormat:"vertex_ai_v1"},{id:"custom",name:"自定义",category:"custom",websiteUrl:"",baseUrl:"",apiFormat:"gemini_api"}],qm={official:"官方",oauth:"OAuth",custom:"自定义"};function Gm(e){return Vm.find(o=>o.id===e)}var Jm=[{id:"opencode_oauth",name:"OpenCode OAuth",category:"oauth",description:"使用本地 OpenCode / Codex OAuth 登录凭据",websiteUrl:"",baseUrl:"",wireApi:"openai",authMode:"oauth",oauthProviderId:"openai-codex",models:[]},{id:"openrouter",name:"OpenRouter",category:"apikey",description:"统一接口访问 200+ 模型",websiteUrl:"https://openrouter.ai",baseUrl:"https://openrouter.ai/api/v1",wireApi:"openai",models:["anthropic/claude-3.5-sonnet","openai/gpt-4o","meta-llama/llama-3.1-405b"]},{id:"openai_api",name:"OpenAI API",category:"apikey",description:"OpenAI 官方 API(需要 API Key)",websiteUrl:"https://platform.openai.com",baseUrl:"https://api.openai.com/v1",wireApi:"openai",models:["gpt-4o","gpt-4o-mini","o1","o1-mini","gpt-4-turbo"]},{id:"anthropic_api",name:"Anthropic API",category:"apikey",description:"Anthropic 官方 API(需要 API Key)",websiteUrl:"https://console.anthropic.com",baseUrl:"https://api.anthropic.com/v1",wireApi:"anthropic",models:["claude-3-5-sonnet","claude-3-opus","claude-3-haiku"]},{id:"deepseek",name:"DeepSeek",category:"apikey",description:"DeepSeek AI 模型",websiteUrl:"https://platform.deepseek.com",baseUrl:"https://api.deepseek.com/v1",wireApi:"openai",models:["deepseek-chat","deepseek-coder"]},{id:"groq",name:"Groq",category:"apikey",description:"超快推理速度",websiteUrl:"https://console.groq.com",baseUrl:"https://api.groq.com/openai/v1",wireApi:"openai",models:["llama-3.1-70b-versatile","llama-3.1-8b-instant","mixtral-8x7b-32768"]},{id:"together",name:"Together AI",category:"apikey",description:"开源模型托管",websiteUrl:"https://www.together.ai",baseUrl:"https://api.together.xyz/v1",wireApi:"openai",models:["meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo","mistralai/Mixtral-8x7B-Instruct-v0.1"]},{id:"entry_claude",name:"Claude Code 入口",category:"entry",description:"渠道按 Claude Code 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",gatewaySourceType:"claude",providerApi:"anthropic-messages",models:[]},{id:"entry_codex",name:"Codex 入口",category:"entry",description:"渠道按 Codex 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"responses",gatewaySourceType:"codex",models:[]},{id:"entry_gemini",name:"Gemini 入口",category:"entry",description:"渠道按 Gemini 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",gatewaySourceType:"gemini",providerApi:"google-generative-ai",models:[]},{id:"custom",name:"自定义",category:"custom",description:"自定义 OpenAI 兼容的 API 端点",websiteUrl:"",baseUrl:"",wireApi:"openai",models:[]}],Ym={oauth:"OAuth",apikey:"API Key",entry:"转换入口",custom:"自定义"};function Zm(e){return Jm.find(o=>o.id===e)}var Xm=[{id:"openrouter",name:"OpenRouter",category:"apikey",description:"统一接口访问 200+ 模型",websiteUrl:"https://openrouter.ai",baseUrl:"https://openrouter.ai/api/v1",wireApi:"openai",models:["anthropic/claude-3.5-sonnet","openai/gpt-4o","meta-llama/llama-3.1-405b"]},{id:"openai_api",name:"OpenAI API",category:"apikey",description:"OpenAI 官方 API(需要 API Key)",websiteUrl:"https://platform.openai.com",baseUrl:"https://api.openai.com/v1",wireApi:"openai",models:["gpt-4o","gpt-4o-mini","o1","o1-mini","gpt-4-turbo"]},{id:"anthropic_api",name:"Anthropic API",category:"apikey",description:"Anthropic 官方 API(需要 API Key)",websiteUrl:"https://console.anthropic.com",baseUrl:"https://api.anthropic.com/v1",wireApi:"anthropic",models:["claude-3-5-sonnet","claude-3-opus","claude-3-haiku"]},{id:"deepseek",name:"DeepSeek",category:"apikey",description:"DeepSeek AI 模型",websiteUrl:"https://platform.deepseek.com",baseUrl:"https://api.deepseek.com/v1",wireApi:"openai",models:["deepseek-chat","deepseek-coder"]},{id:"groq",name:"Groq",category:"apikey",description:"超快推理速度",websiteUrl:"https://console.groq.com",baseUrl:"https://api.groq.com/openai/v1",wireApi:"openai",models:["llama-3.1-70b-versatile","llama-3.1-8b-instant","mixtral-8x7b-32768"]},{id:"together",name:"Together AI",category:"apikey",description:"开源模型托管",websiteUrl:"https://www.together.ai",baseUrl:"https://api.together.xyz/v1",wireApi:"openai",models:["meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo","mistralai/Mixtral-8x7B-Instruct-v0.1"]},{id:"entry_claude",name:"Claude Code 入口",category:"entry",description:"渠道按 Claude Code 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",gatewaySourceType:"claude",providerApi:"anthropic-messages",models:[]},{id:"entry_codex",name:"Codex 入口",category:"entry",description:"渠道按 Codex 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"responses",gatewaySourceType:"codex",models:[]},{id:"entry_gemini",name:"Gemini 入口",category:"entry",description:"渠道按 Gemini 请求入口管理",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"google-generative-ai",gatewaySourceType:"gemini",models:[]},{id:"custom",name:"自定义",category:"custom",description:"自定义 OpenAI 兼容的 API 端点",websiteUrl:"",baseUrl:"",wireApi:"openai",models:[]},{id:"omp_oauth",name:"OMP OAuth",category:"oauth",description:"使用本地 OMP broker OAuth 登录凭据",websiteUrl:"",baseUrl:"",providerKey:"omp-oauth",authMode:"oauth",oauthProviderId:""},{id:"omp_oauth_gateway",name:"OMP OAuth Auth Gateway",category:"oauth",description:"通过健康的 pi-native Auth Gateway 转发 OMP broker OAuth 登录态",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"openai-completions",gatewaySourceType:"openai_compatible",transport:"pi-native",authMode:"oauth",oauthProviderId:"",models:[]}],Qm={apikey:"API Key",entry:"转换入口",oauth:"OAuth",custom:"自定义"};function ev(e){return Xm.find(o=>o.id===e)}function ov(e,o=new Set){if(null==e)return"";if("string"==typeof e)return e.trim();if("number"==typeof e||"boolean"==typeof e)return String(e);if(e instanceof Error)return String(e.message||"").trim();if("object"!=typeof e)return"";if(o.has(e))return"";o.add(e);for(const n of["message","error","detail","reason"]){const t=ov(e[n],o);if(t)return t}if("unsupported"===e.status)return"当前 CLI 暂不支持该操作";if("invalid"===e.status)return"渠道参数无效";if("failed"===e.status)return"渠道操作失败";if(e.code)return String(e.code);try{const o=JSON.stringify(e);return o&&"{}"!==o?o:""}catch{return""}}function nv(e,o="操作失败"){const n=[e?.response?.data?.error,e?.response?.data?.message,e?.data?.error,e?.data?.message,e?.message,e];for(const t of n){const e=ov(t);if(e&&"[object Object]"!==e)return e}return o}var{getAllModelsByToolType:tv,loadDefaultModels:rv}=Im(),av=/^https?:\/\//i,lv=/^[a-z0-9_-]+$/i,iv=new Set(["anyrouter","newcli"]),sv=["model","allowedModels","speedTestModel","presetId","modelConfig","models","modelMetadataMode","modelBindings","modelRedirects","targetApi","apiFormat","proxyUrl"];function dv(e){const o=e?.extra;if(!o||"object"!=typeof o||Array.isArray(o))return e;const n={...e};return sv.forEach(e=>{void 0!==n[e]&&null!==n[e]||void 0===o[e]||(n[e]=o[e])}),n}function cv(e){const o=Array.isArray(e)?e:e?.channels||[];return Array.isArray(o)?o.map(dv):[]}function uv(e){return cv(e)}function pv(e){const o=Number(e);return!Number.isFinite(o)||o<=0?null:Math.round(o)}function hv(e){const o=Number(e);return!Number.isFinite(o)||o<1?1:Math.min(100,Math.round(o))}function fv(e,o,{required:n}={}){if(!o)return n?`${e}不能为空`:"";if(!av.test(o))return`${e}必须以 http:// 或 https:// 开头`;try{new URL(o)}catch(t){return`${e}不是合法的链接`}return""}function mv(e){const o=String(e||"").trim();return o?lv.test(o)?"openai"===o.toLowerCase()?"Provider Key 不能使用保留值 openai,请改成 openai-official 之类的自定义标识":"":"只能包含字母、数字、下划线和中划线,例如 openai-official":"Provider Key 不能为空"}function vv(e,o){try{return JSON.stringify(e??o,null,2)}catch{return JSON.stringify(o,null,2)}}function gv(e,o,n){const t=String(e||"").trim();if(!t)return n;try{return JSON.parse(t)}catch(r){throw new Error(`${o}不是合法 JSON:${r.message}`)}}function bv(e){const o=gv(e,"模型定义",[]);if(!Array.isArray(o))throw new Error("模型定义必须是 JSON 数组");return o}function yv(e){try{const o=bv(e),n=new Set;for(const e of o){if(!e||"object"!=typeof e||Array.isArray(e))return"每个模型定义必须是对象";const o=String(e.id||"").trim();if(!o)return"每个模型定义都必须包含 id";const t=o.toLowerCase();if(n.has(t))return`模型 ID 重复:${o}`;n.add(t)}}catch(o){return o.message}return""}function xv(e){const o=gv(e,"Provider 高级配置",{});if(!o||"object"!=typeof o||Array.isArray(o))throw new Error("Provider 高级配置必须是 JSON 对象");return o}function Cv(e){const o=!0!==e._showChannelBalance||Mv(e),n=["api_key","oauth","none"].includes(e.authMode)?e.authMode:"api_key",t="oauth"===n?Object.fromEntries(["credentialId","providerId","accountId","identityKey","accountEmail"].map(o=>[o,String(e.authRef?.[o]||"").trim()])):void 0;return{apiKey:"oauth"===n||"none"===n?"":e.apiKey||"",authMode:n,...t?{authRef:t,authSource:"synced-local",authStatus:e.authStatus||"available"}:{},oauthProviderId:"oauth"===n&&(e.oauthProviderId||e.providerKey)||"",balanceToken:o&&e.balanceToken||"",balanceUserId:o&&e.balanceUserId||null}}function wv(e){const o=Cv(e);return"oauth"!==o.authMode?o:Av(e)?{...o,apiKey:String(e.apiKey||"").trim(),transport:"pi-native"}:{...o,transport:""}}function Sv(e){return{authMode:e.authMode,...e.authRef?{authRef:e.authRef,authSource:e.authSource,authStatus:e.authStatus}:{},...e.oauthProviderId?{oauthProviderId:e.oauthProviderId}:{},...Object.prototype.hasOwnProperty.call(e,"transport")?{transport:e.transport}:{}}}function kv(e={}){return"oauth"===e.authMode}function Pv(e={}){return"oauth"===e.authMode&&"pi-native"!==e.transport}function Iv(e){return!kv(e)}function Tv(){return{key:"authMode",label:"本地登录",type:"channel-auth",showWhen:kv}}function Av(e={}){return kv(e)&&!0===e.oauthGatewayMode}function zv(e={}){return!kv(e)||Av(e)}function Rv(e={}){return!kv(e)}function Mv(e={}){return!0===e._showChannelBalance&&iv.has(function(e={}){const o=[e.presetId,e.providerKey,e.name,e.websiteUrl,e.baseUrl].map(e=>String(e||"").trim().toLowerCase()).join(" ");return o.includes("anyrouter")?"anyrouter":o.includes("code.newcli.com")||o.includes("newcli")||o.includes("new-cli")?"newcli":null}(e))}function Fv(e="余额凭据"){return{key:"balanceToken",label:e,type:"password",showWhen:e=>Iv(e)&&Mv(e),placeholder:"选填:余额接口需要的会话 Token / Cookie(NewCLI 可填完整 Cookie)"}}function Ov(){return{key:"balanceUserId",label:"余额用户 ID",type:"number",min:1,clearable:!0,showWhen:e=>Iv(e)&&Mv(e),placeholder:"选填:New API / AnyRouter 需要 New-Api-User 时填写"}}function Bv(e={}){const o=Array.isArray(e.allowedModels)?e.allowedModels.map(e=>String(e||"").trim()).filter(Boolean):[];return 0===o.length?"(默认/测速模型)":o.length<=3?o.join(", "):`${o.slice(0,3).join(", ")} +${o.length-3}`}function $v(e){const o=String(e||"").trim().toLowerCase();return"claude"===o?"Claude Code":"gemini"===o?"Gemini":"Codex"}function Ev(e,o){return"oauth"===o?.authMode?{...e,authMode:"oauth",baseUrl:"",apiKey:"",websiteUrl:"",oauthProviderId:o.oauthProviderId||e.providerKey||""}:{...e,authMode:"api_key",authRef:void 0,authSource:void 0,authStatus:void 0,oauthProviderId:""}}function Dv(e=[]){return e.map(e=>({label:e,value:e}))}function _v(...e){const o=new Set,n=[];for(const t of e)for(const e of t||[]){const t=String(e?.value||"").trim();if(!t)continue;const r=t.toLowerCase();o.has(r)||(o.add(r),n.push({label:e?.label||t,value:t}))}return n}function Lv(e){return Dv(tv(e))}function Hv(e,o={}){if("omp"===e)return Lv("omp");if("opencode"===e){const e=["claude","codex","gemini"].includes(o.gatewaySourceType)?o.gatewaySourceType:"";return _v(Lv("opencode"),e?Lv(e):[])}return Lv(e)}var jv={schedule:[{key:"maxConcurrency",label:"最大并发",type:"number",placeholder:"留空表示不限",clearable:!0,validate:e=>{if(null==e||""===e)return"";const o=Number(e);return!Number.isFinite(o)||o<=0?"并发需为大于 0 的数字":o>100?"并发最多 100":""}},{key:"weight",label:"调度权重",type:"number",placeholder:"默认 1",min:1,max:100,validate:e=>{const o=Number(e);return!Number.isFinite(o)||o<1?"调度权重至少为 1":""}},{key:"enabled",label:"渠道状态",type:"switch",checkedText:"启用",uncheckedText:"停用"}]},Uv={dsh:()=>({type:"dsh",displayName:"DSH",storageKeys:{localCollapse:"dshChannelCollapse",collapseConfigKey:"dsh",orderConfigKey:"dsh"},emptyDescription:"暂无 DSH 渠道",showEmptyAction:!0,emptyActionText:"添加 DSH 渠道",addTitle:"添加 DSH 渠道",editTitle:"编辑 DSH 渠道",modalWidth:600,formLabelWidth:95,showApplyButton:!0,formSections:[{title:"基本信息",fields:[{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"providerKey",label:"Provider Key",type:"text",required:!0,disabledOnEdit:!0,placeholder:"英文标识,如 deepseek-official",validate:mv},{key:"providerApi",label:"API 格式",type:"select",options:[{label:"OpenAI Chat Completions",value:"openai-completions"},{label:"OpenAI Responses",value:"openai-responses"},{label:"Anthropic Messages",value:"anthropic-messages"}]},{key:"baseUrl",label:"Base URL",type:"text",required:!0,placeholder:"https://api.example.com/v1",validate:e=>fv("Base URL",e,{required:!0})},{key:"apiKey",label:"API Key",type:"password",required:!0,placeholder:"sk-..."},{key:"model",label:"默认模型",type:"select",required:!0,placeholder:"输入或选择默认模型"},{key:"models",label:"可用模型",type:"model-multi-select",required:!0,placeholder:"输入模型名称后回车,可多选"},{key:"speedTestModel",label:"测速模型",type:"select",placeholder:"留空则使用默认模型",options:Lv("dsh"),clearable:!0}]},{title:"模型重定向",description:"将代理收到的模型名重定向到该渠道的实际模型。",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:jv.schedule}],getInitialForm:()=>({name:"DSH 渠道",providerKey:"",providerApi:"openai-completions",baseUrl:"",apiKey:"",model:"",models:[],speedTestModel:"",modelRedirects:[],maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),mapChannelToForm:e=>({name:e.name||"",providerKey:e.providerKey||"",providerApi:e.providerApi||"openai-completions",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",model:e.model||e.models?.[0]?.id||"",models:Array.isArray(e.models)?e.models.map(e=>"string"==typeof e?e:e?.id).filter(Boolean):[],speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),fetchModelsForChannel:async(e,o,{forceRefresh:n=!1}={})=>{await rv();const t=Lv("dsh"),r=e?await function(e,{forceRefresh:o=!1}={}){return Dh("dsh","models",{pathParams:{channelId:e},query:o?{forceRefresh:"true"}:void 0})}(e,{forceRefresh:n}):o.baseUrl?await function({baseUrl:e,apiKey:o,providerApi:n}={},{forceRefresh:t=!1}={}){return Dh("dsh","modelsFromConfig",{body:{baseUrl:e,apiKey:o,providerApi:n,forceRefresh:t}})}(o,{forceRefresh:n}):null;o.availableModels=_v(Dv(Array.isArray(r?.models)?r.models.map(e=>"string"==typeof e?e:e?.id).filter(Boolean):[]),t),(r?.fallbackUsed||r?.disabledByConfig)&&(o.modelsFetchError=r.error||"无法自动获取模型列表",o.modelsFetchErrorHint=r.errorHint||"已使用本地默认模型列表,也可以手动填写模型名称")},testFn:Kh,api:{fetch:async()=>cv(await _h("dsh")),syncCurrent:Nh,create:e=>Lh("dsh",{name:e.name,providerKey:e.providerKey,providerApi:e.providerApi,baseUrl:e.baseUrl,apiKey:e.apiKey,model:e.model,models:e.models,speedTestModel:e.speedTestModel||null,modelRedirects:e.modelRedirects||[],maxConcurrency:pv(e.maxConcurrency),weight:hv(e.weight),enabled:e.enabled}),update:(e,o)=>Uh(e.id,{name:o.name,providerApi:o.providerApi,baseUrl:o.baseUrl,apiKey:o.apiKey,model:o.model,models:o.models,speedTestModel:o.speedTestModel||null,modelRedirects:o.modelRedirects||[],maxConcurrency:pv(o.maxConcurrency),weight:hv(o.weight),enabled:o.enabled}),toggle:(e,o)=>Uh(e.id,{enabled:o}),remove:Wh,applyToSettings:e=>Dh("dsh","applyToSettings",{pathParams:{channelId:e.id}})},getHeaderTags:(e,o)=>{const n=[];return"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),e.proxy&&n.push({text:"代理中",type:"info"}),n},buildInfoRows:(e,o)=>[{label:"Provider",value:e.providerKey||"(未设置)",mono:!0},{label:"API 格式",value:e.providerApi||"openai-completions",mono:!0},{label:"Model",value:e.model||"(未设置)",mono:!0},{label:"URL",value:e.baseUrl,mono:!0},{label:"Key",value:o.maskApiKey(e.apiKey),mono:!0}]}),claude:()=>({type:"claude",displayName:"Claude",storageKeys:{localCollapse:"claudeChannelCollapse",collapseConfigKey:"claude",orderConfigKey:"claude"},emptyDescription:"暂无渠道",showEmptyAction:!1,emptyActionText:"",modalWidth:520,formLabelWidth:95,showApplyButton:!0,presets:Hm,presetCategories:jm,getPresetById:Um,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[Tv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"输入渠道名称"},{key:"baseUrl",showWhen:Iv,label:"接口地址",type:"text",required:!0,placeholder:"https://api.example.com",validate:e=>fv("接口地址",e,{required:!0})},{key:"apiKey",showWhen:Iv,label:"接口密钥",type:"password",required:!0,placeholder:"sk-..."},Fv(),Ov(),{key:"websiteUrl",showWhen:Iv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>fv("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:Iv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则自动检测)",description:"指定用于速度测试的模型,留空则使用自动检测",options:Lv("claude"),clearable:!0}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,showWhen:e=>"official"===e.presetId||"openai_compatible"===e.gatewaySourceType,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"OpenAI 网关",description:"OpenAI 格式渠道需要通过 Claude 代理使用;优先选择 Responses API,不兼容时再切到 Chat Completions",showWhen:e=>"openai_compatible"===e.gatewaySourceType,fields:[{key:"targetApi",label:"上游接口",type:"radio-group",options:[{label:"Responses API",value:"responses"},{label:"Chat Completions",value:"chat.completions"}]}]},{title:"模型配置",description:"代理关闭时:模型映射(写入 settings.json);代理开启时:模型重定向(如 opus → sonnet 节省 token)",collapsible:!0,showWhen:e=>!kv(e)&&e.presetId&&"official"!==e.presetId,fields:[{key:"modelConfig.model",label:"主模型",type:"autocomplete",placeholder:"如 glm-4.6"},{key:"modelConfig.haikuModel",label:"Haiku 模型",type:"autocomplete",placeholder:"如 glm-4.5-air"},{key:"modelConfig.sonnetModel",label:"Sonnet 模型",type:"autocomplete",placeholder:"如 glm-4.6"},{key:"modelConfig.opusModel",label:"Opus 模型",type:"autocomplete",placeholder:"如 glm-4.6"}]},{title:"调度配置",fields:jv.schedule},{title:"网络代理",description:"部分渠道可能需要代理才能访问",collapsible:!0,fields:[{key:"proxyUrl",label:"代理地址",type:"text",placeholder:"http://127.0.0.1:7890(选填)"}]}],getInitialForm:()=>({presetId:"official",name:"Claude 官方",baseUrl:"https://api.anthropic.com",apiKey:"",balanceToken:"",balanceUserId:null,websiteUrl:"https://www.anthropic.com",speedTestModel:"",modelConfig:{model:"",haikuModel:"",sonnetModel:"",opusModel:""},modelRedirects:[],proxyUrl:"",gatewaySourceType:"claude",targetApi:"responses",maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null}),mapChannelToForm:e=>({presetId:e.presetId||"official",name:e.name||"",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",speedTestModel:e.speedTestModel||"",modelConfig:{model:e.modelConfig?.model||"",haikuModel:e.modelConfig?.haikuModel||"",sonnetModel:e.modelConfig?.sonnetModel||"",opusModel:e.modelConfig?.opusModel||""},modelRedirects:e.modelRedirects||[],proxyUrl:e.proxyUrl||"",gatewaySourceType:e.gatewaySourceType||"claude",targetApi:e.targetApi||"responses",maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null}),onPresetChange:(e,o)=>{const n=Um(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,t.baseUrl=n.baseUrl,t.websiteUrl=n.websiteUrl||"",t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"claude",t.targetApi=n.targetApi||t.targetApi||"responses",n.env&&(t.modelConfig={model:n.env.ANTHROPIC_MODEL||"",haikuModel:n.env.ANTHROPIC_DEFAULT_HAIKU_MODEL||"",sonnetModel:n.env.ANTHROPIC_DEFAULT_SONNET_MODEL||"",opusModel:n.env.ANTHROPIC_DEFAULT_OPUS_MODEL||""}),Ev(t,n)},fetchModelsForChannel:async(e,o)=>{await rv();const n=Lv((t=o.gatewaySourceType,"openai_compatible"===String(t||"").trim().toLowerCase()?"codex":"claude"));var t;if(o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null,!e)return o.availableModels=n,void(o.modelsFetching=!1);try{const t=await function(e,o="claude"){return Dh(o||"claude","models",{pathParams:{channelId:e},query:o?{type:o}:void 0})}(e,o.gatewaySourceType||null);t.models&&t.models.length>0?(o.availableModels=_v(Dv(t.models),n),t.fallbackUsed&&(o.modelsFetchError=nv(t?.error,"无法自动获取模型列表(API 端点受保护)"),o.modelsFetchErrorHint=t.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!t.fallbackUsed&&t.supported||(o.availableModels=n,o.modelsFetchError=nv(t?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=t.errorHint||"已使用默认模型列表")}catch(r){o.availableModels=n;const e=r.response?.data;e?(o.modelsFetchError=nv(e?.error||r,"获取模型列表失败"),o.modelsFetchErrorHint=e.errorHint||"已使用默认模型列表"):(o.modelsFetchError=nv(r,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表")}finally{o.modelsFetching=!1}},testFn:lf,api:{fetch:async()=>cv(await _h("claude")),syncCurrent:Yh,create:async e=>{const o=Cv(e);return await function(e,o,n,t,r={}){return Lh("claude",{name:e,baseUrl:o,apiKey:n,websiteUrl:t,...r})}(e.name,e.baseUrl,o.apiKey,e.websiteUrl||void 0,{maxConcurrency:pv(e.maxConcurrency),weight:hv(e.weight),enabled:e.enabled,presetId:e.presetId,modelConfig:e.modelConfig,modelRedirects:e.modelRedirects||[],proxyUrl:e.proxyUrl||"",speedTestModel:e.speedTestModel||null,gatewaySourceType:e.gatewaySourceType||"claude",targetApi:e.targetApi||"responses",...Sv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=Cv(o);return await Zh(e.id,{name:o.name,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:pv(o.maxConcurrency),weight:hv(o.weight),enabled:o.enabled,presetId:o.presetId,modelConfig:o.modelConfig,modelRedirects:o.modelRedirects||[],proxyUrl:o.proxyUrl||"",speedTestModel:o.speedTestModel||null,gatewaySourceType:o.gatewaySourceType||"claude",targetApi:o.targetApi||"responses",...Sv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:(e,o)=>Zh(e.id,{enabled:o}),remove:Xh,applyToSettings:async e=>Dh("claude","applyToSettings",{pathParams:{channelId:e.id}}),resetHealth:async e=>{return Dh("claude","resetHealth",{pathParams:{channelId:o=e.id},body:{channelId:o}});var o}},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>[{label:"URL",value:e.baseUrl},{label:"Key",value:o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}]}),codex:()=>({type:"codex",displayName:"Codex",storageKeys:{localCollapse:"codexChannelCollapse",collapseConfigKey:"codex",orderConfigKey:"codex"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 Codex 渠道",modalWidth:600,formLabelWidth:90,showApplyButton:!0,presets:Wm,presetCategories:Nm,getPresetById:Km,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[Tv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"providerKey",showWhen:Iv,label:"Provider Key",type:"text",required:!0,placeholder:"英文标识,如 openai-official",disabledOnEdit:!0,validate:mv},{key:"baseUrl",showWhen:Iv,label:"Base URL",type:"text",required:!0,placeholder:"https://api.example.com",validate:e=>fv("Base URL",e,{required:!0})},{key:"apiKey",showWhen:Iv,label:"API Key",type:"password",required:!0,placeholder:"sk-..."},Fv(),Ov(),{key:"websiteUrl",showWhen:Iv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>fv("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:Iv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则使用默认)",description:"指定用于速度测试的模型,留空则使用默认模型",options:Lv("codex"),clearable:!0}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:jv.schedule}],getInitialForm:()=>({presetId:"openai",name:"OpenAI",providerKey:"openai-official",baseUrl:"https://api.openai.com/v1",apiKey:"",balanceToken:"",balanceUserId:null,websiteUrl:"https://platform.openai.com",gatewaySourceType:"codex",speedTestModel:"",modelRedirects:[],maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),mapChannelToForm:e=>({presetId:e.presetId||"custom",name:e.name||"",providerKey:e.providerKey||"",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",gatewaySourceType:e.gatewaySourceType||"codex",speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),onPresetChange:(e,o)=>{const n=Km(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,t.websiteUrl=n.websiteUrl||"",t.providerKey=n.providerKey||"",t.baseUrl=n.baseUrl,t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"codex",Ev(t,n)},fetchModelsForChannel:async(e,o)=>{if(await rv(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null,!e)return o.availableModels=Lv("codex"),void(o.modelsFetching=!1);try{const n=await function(e){return Dh("codex","models",{pathParams:{channelId:e}})}(e);n.models&&n.models.length>0?(o.availableModels=_v(Dv(n.models),Lv("codex")),n.fallbackUsed&&(o.modelsFetchError=nv(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!n.fallbackUsed&&n.supported||(o.availableModels=Lv("codex"),o.modelsFetchError=nv(n?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表")}catch(n){o.availableModels=Lv("codex"),o.modelsFetchError=nv(n,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表"}finally{o.modelsFetching=!1}},testFn:sf,api:{fetch:async()=>cv(await _h("codex")),syncCurrent:ef,create:async e=>{const o=Cv(e);return await function(e,o,n,t,r,a={}){return Lh("codex",{name:e,providerKey:o,baseUrl:n,apiKey:t,websiteUrl:r,...a})}(e.name,e.providerKey,e.baseUrl,o.apiKey,e.websiteUrl||"",{maxConcurrency:pv(e.maxConcurrency),weight:hv(e.weight),enabled:e.enabled,modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,gatewaySourceType:e.gatewaySourceType||"codex",...Sv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=Cv(o);return await of(e.id,{name:o.name,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:pv(o.maxConcurrency),weight:hv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,gatewaySourceType:o.gatewaySourceType||"codex",...Sv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>of(e.id,{enabled:o}),remove:nf,applyToSettings:async e=>Dh("codex","applyToSettings",{pathParams:{channelId:e.id}}),resetHealth:async e=>{return Dh("codex","resetHealth",{pathParams:{channelId:o=e.id},body:{channelId:o}});var o}},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>[{label:"Provider",value:e.providerKey,mono:!0},{label:"Auth",value:"oauth"===e.authMode?"OAuth":"API Key",mono:!0},{label:"URL",value:Pv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:Pv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}]}),gemini:()=>({type:"gemini",displayName:"Gemini",storageKeys:{localCollapse:"geminiChannelCollapse",collapseConfigKey:"gemini",orderConfigKey:"gemini"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 Gemini 渠道",modalWidth:520,formLabelWidth:90,showApplyButton:!1,presets:Vm,presetCategories:qm,getPresetById:Gm,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[Tv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"model",label:"Model",type:"text",required:!0,placeholder:"例如 gemini-2.5-pro"},{key:"baseUrl",showWhen:Iv,label:"Base URL",type:"text",required:!0,placeholder:"https://generativelanguage.googleapis.com/v1beta",validate:e=>fv("Base URL",e,{required:!0})},{key:"apiKey",showWhen:Iv,label:"API Key",type:"password",required:!0,placeholder:"AIza..."},Fv(),Ov(),{key:"websiteUrl",showWhen:Iv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>fv("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:Iv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则使用 model 字段)",description:"指定用于速度测试的模型,留空则使用上方配置的 Model",options:Lv("gemini"),clearable:!0}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:jv.schedule}],getInitialForm:()=>({presetId:"google",name:"Google AI",model:"gemini-2.5-pro",baseUrl:"https://generativelanguage.googleapis.com/v1beta",apiKey:"",apiFormat:"gemini_api",balanceToken:"",balanceUserId:null,websiteUrl:"https://ai.google.dev",gatewaySourceType:"gemini",speedTestModel:"",modelRedirects:[],maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),mapChannelToForm:e=>({presetId:e.presetId||"custom",name:e.name||"",model:e.model||"",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",apiFormat:e.apiFormat||"gemini_api",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",gatewaySourceType:e.gatewaySourceType||"gemini",speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),onPresetChange:(e,o)=>{const n=Gm(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,n.model&&(t.model=n.model),t.websiteUrl=n.websiteUrl||"",t.baseUrl=n.baseUrl,t.apiFormat=n.apiFormat||"gemini_api",t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"gemini",Ev(t,n)},fetchModelsForChannel:async(e,o)=>{if(await rv(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null,!e)return o.availableModels=Lv("gemini"),void(o.modelsFetching=!1);try{const n=await function(e){return Dh("gemini","models",{pathParams:{channelId:e}})}(e);n.models&&n.models.length>0?(o.availableModels=_v(Dv(n.models),Lv("gemini")),n.fallbackUsed&&(o.modelsFetchError=nv(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!n.fallbackUsed&&n.supported||(o.availableModels=Lv("gemini"),o.modelsFetchError=nv(n?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表")}catch(n){o.availableModels=Lv("gemini"),o.modelsFetchError=nv(n,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表"}finally{o.modelsFetching=!1}},testFn:df,api:{fetch:async()=>cv(await _h("gemini")),syncCurrent:tf,create:async e=>{const o=Cv(e);return await function(e,o,n,t,r,a={}){return Lh("gemini",{name:e,baseUrl:o,apiKey:n,model:t,websiteUrl:r,...a})}(e.name,e.baseUrl,o.apiKey,e.model,e.websiteUrl||"",{maxConcurrency:pv(e.maxConcurrency),weight:hv(e.weight),enabled:e.enabled,modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,apiFormat:e.apiFormat||"gemini_api",gatewaySourceType:e.gatewaySourceType||"gemini",...Sv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=Cv(o);return await rf(e.id,{name:o.name,model:o.model,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:pv(o.maxConcurrency),weight:hv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,apiFormat:o.apiFormat||"gemini_api",gatewaySourceType:o.gatewaySourceType||"gemini",...Sv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>rf(e.id,{enabled:o}),remove:af,resetHealth:async e=>{return Dh("gemini","resetHealth",{pathParams:{channelId:o=e.id},body:{channelId:o}});var o}},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>{return[{label:"Model",value:e.model,mono:!0},{label:"API",value:(n=e.apiFormat,"vertex_ai_v1"===String(n||"").trim().toLowerCase()?"Vertex AI v1":"Gemini API")},{label:"URL",value:Pv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:Pv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}];var n}}),opencode:()=>({type:"opencode",displayName:"OpenCode",storageKeys:{localCollapse:"opencodeChannelCollapse",collapseConfigKey:"opencode",orderConfigKey:"opencode"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 OpenCode 渠道",modalWidth:600,formLabelWidth:95,showApplyButton:!1,presets:Jm,presetCategories:Ym,getPresetById:Zm,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[Tv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"baseUrl",label:"Base URL",type:"text",required:!0,showWhen:Iv,placeholder:"https://api.example.com/v1",validate:e=>fv("Base URL",e,{required:!0})},{key:"apiKey",label:"API Key",type:"password",required:!0,showWhen:Iv,placeholder:"sk-..."},Fv(),Ov(),{key:"websiteUrl",label:"官网链接",type:"text",showWhen:Iv,placeholder:"https://(选填)",validate:e=>fv("官网链接",e,{required:!1})},{key:"model",label:"默认模型",type:"select",placeholder:"选择或输入默认模型(留空则由调度器决定)",options:[],clearable:!0},{key:"speedTestModel",label:"测速模型",type:"select",showWhen:Iv,placeholder:"选择用于测速的模型(留空则使用默认模型)",description:"指定用于速度测试的模型,留空则自动检测",options:[],clearable:!0},{key:"allowedModels",label:"可用模型",type:"model-multi-select",placeholder:"选择注册到 OpenCode 的模型(留空则使用检测到的所有模型)",description:"选择哪些模型注册到 opencode.json 的 provider 配置中"}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:jv.schedule}],getInitialForm:()=>({presetId:"openrouter",name:"OpenRouter",providerKey:"openrouter",baseUrl:"https://openrouter.ai/api/v1",wireApi:"openai",apiKey:"",authMode:"api_key",authRef:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},authSource:void 0,authStatus:void 0,oauthProviderId:"",balanceToken:"",balanceUserId:null,websiteUrl:"https://openrouter.ai",model:"",gatewaySourceType:"codex",speedTestModel:"",modelRedirects:[],allowedModels:[],maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),mapChannelToForm:e=>({presetId:e.presetId||"custom",name:e.name||"",providerKey:e.providerKey||"",baseUrl:e.baseUrl||"",wireApi:e.wireApi||"openai",apiKey:e.apiKey||"",authMode:e.authMode||"api_key",authRef:e.authRef?{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:"",...e.authRef}:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},authSource:e.authSource,authStatus:e.authStatus,oauthProviderId:e.oauthProviderId||"",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",model:e.model||"",gatewaySourceType:e.gatewaySourceType||"codex",speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],allowedModels:e.allowedModels||[],maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null}),onPresetChange:(e,o)=>{const n=Zm(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,t.websiteUrl=n.websiteUrl||"",t.baseUrl=n.baseUrl,t.wireApi=n.wireApi||"openai",t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"codex",Ev(t,n)},fetchModelsForChannel:async(e,o,{forceRefresh:n=!1}={})=>{await rv(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null;const t=o.presetId||"";if(["entry_claude","entry_codex","entry_gemini"].includes(t)){const e=o.gatewaySourceType||"codex";return o.availableModels=Lv("claude"===e?"claude":"gemini"===e?"gemini":"codex"),void(o.modelsFetching=!1)}if(!e){const e=Hv("opencode",o);if(!o.baseUrl)return o.availableModels=e,o.modelsFetchMeta={offline:!0,source:"Models.dev"},void(o.modelsFetching=!1);try{const n=await function({baseUrl:e,apiKey:o,gatewaySourceType:n}){return Dh("opencode","probeModels",{body:{baseUrl:e,apiKey:o,gatewaySourceType:n}})}({baseUrl:o.baseUrl,apiKey:o.apiKey||"",gatewaySourceType:o.gatewaySourceType||"codex"});o.availableModels=_v(Dv(n.models||[]),e),n.error&&(o.modelsFetchError=nv(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||(e.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"))}catch(a){o.availableModels=e,o.modelsFetchError=nv(a,"获取模型列表失败"),o.modelsFetchErrorHint=e.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}return}const r=Hv("opencode",o);try{const t=await function(e,{forceRefresh:o=!1}={}){return Dh("opencode","models",{pathParams:{channelId:e},query:o?{forceRefresh:"true"}:void 0})}(e,{forceRefresh:n}),a=Dv(t.models||[]);o.availableModels=_v(a,r),(t.fallbackUsed||0===a.length&&r.length>0)&&(o.modelsFetchError=nv(t?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=t.errorHint||"已使用 Models.dev 离线模型列表")}catch(a){o.availableModels=r,o.modelsFetchError=nv(a,"获取模型列表失败"),o.modelsFetchErrorHint=r.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}},testFn:hf,api:{fetch:async()=>cv(await _h("opencode")),syncCurrent:cf,create:async e=>{const o=Cv(e);return await function(e,o,n,t={}){return Lh("opencode",{name:e,baseUrl:o,apiKey:n,...t})}(e.name,e.baseUrl,o.apiKey,{wireApi:e.wireApi||"openai",providerKey:e.providerKey||"",maxConcurrency:pv(e.maxConcurrency),weight:hv(e.weight),enabled:e.enabled,model:e.model||null,gatewaySourceType:e.gatewaySourceType||"codex",modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,websiteUrl:e.websiteUrl||"",allowedModels:e.allowedModels||[],...Sv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=Cv(o);return await uf(e.id,{name:o.name,baseUrl:o.baseUrl,apiKey:n.apiKey,wireApi:o.wireApi||"openai",websiteUrl:o.websiteUrl,model:o.model||null,gatewaySourceType:o.gatewaySourceType||"codex",maxConcurrency:pv(o.maxConcurrency),weight:hv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,allowedModels:o.allowedModels||[],...Sv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>uf(e.id,{enabled:o}),remove:pf,resetHealth:async e=>{return Dh("opencode","resetHealth",{pathParams:{channelId:o=e.id},body:{channelId:o}});var o}},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>[{label:"入口协议",value:$v(e.gatewaySourceType),mono:!0},{label:"Wire API",value:e.wireApi||"openai",mono:!0},{label:"Provider Key",value:e.providerKey||"(未设置)",mono:!0},{label:"Auth",value:e.authMode||"api_key",mono:!0},{label:"Model",value:e.model||"(默认)",mono:!0},{label:"URL",value:Pv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:Pv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}]}),omp:()=>({type:"omp",displayName:"OMP",storageKeys:{localCollapse:"ompChannelCollapse",collapseConfigKey:"omp",orderConfigKey:"omp"},emptyDescription:"暂无 OMP 渠道",showEmptyAction:!0,emptyActionText:"添加 OMP 渠道",modalWidth:600,formLabelWidth:95,showApplyButton:!1,presets:Xm,presetCategories:Qm,getPresetById:ev,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[{...Tv(),showWhen:e=>kv(e)&&!Av(e)},{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"providerKey",showWhen:zv,label:"Provider Key",type:"text",required:!0,placeholder:"openai-official",validate:mv},{key:"baseUrl",showWhen:zv,label:e=>kv(e)?"Auth Gateway URL":"Base URL",type:"text",required:!0,skipOnOAuth:!1,placeholder:"https://api.example.com/v1",validate:(e,o)=>fv(kv(o)?"Auth Gateway URL":"Base URL",e,{required:!0})},{key:"apiKey",showWhen:zv,label:e=>kv(e)?"Gateway Token":"API Key",type:"password",required:!0,skipOnOAuth:!1,placeholder:"sk-...",validate:(e,o)=>function(e,o){if(null==o||""===o)return`${e}不能为空`}(kv(o)?"Gateway Token":"API Key",e)},{key:"routingGroup",showWhen:zv,label:"路由组",type:"text",placeholder:"相同路由组的兼容渠道可动态切换",description:"相同 Provider、API 协议和认证方式的渠道填写相同路由组后共用一个入口;需保持模型映射兼容。留空时按渠道 ID 隔离。"},Fv(),Ov(),{key:"websiteUrl",showWhen:Rv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>fv("官网链接",e,{required:!1})},{key:"model",label:"默认模型",type:"select",placeholder:"选择或输入默认模型(留空则由 OMP 决定)",options:[],clearable:!0},{key:"speedTestModel",showWhen:Rv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则使用默认模型)",options:[],clearable:!0},{key:"allowedModels",label:"可用模型",type:"model-multi-select",placeholder:"选择注册到 OMP models.yml 的模型",description:"仅选中的模型会暴露给 OMP;留空时仅使用默认模型/测速模型,不回退到 provider 全量目录"}]},{title:"模型 Metadata",description:"自动获取后可直接修改;保存时以当前内容覆盖自动结果",collapsible:!0,fields:[{key:"modelDefinitionsJson",label:"模型定义",type:"model-definitions",fullWidth:!0,placeholder:'[\n { "id": "gpt-5.5", "reasoning": true, "contextWindow": 1050000 }\n]',validate:yv}]},{title:"模型重定向",description:"仅在 coding-tool-x 托管 OMP models.yml provider 启用时用于模型选择提示",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:jv.schedule}],getInitialForm:()=>({presetId:"openrouter",name:"OpenRouter",providerKey:"openrouter",baseUrl:"https://openrouter.ai/api/v1",wireApi:"openai",providerApi:"openai-completions",apiKey:"",authMode:"api_key",oauthGatewayMode:!1,authSource:void 0,authStatus:void 0,oauthProviderId:"",transport:"",routingGroup:"",balanceToken:"",balanceUserId:null,websiteUrl:"https://openrouter.ai",model:"",gatewaySourceType:"openai_compatible",speedTestModel:"",modelRedirects:[],allowedModels:[],modelMetadataMode:"hybrid",modelDefinitionsJson:"[]",providerConfigJson:"{}",modelMetadataFetching:!1,modelMetadataStatus:"",maxConcurrency:null,weight:1,enabled:!0,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null,modelsFetchMeta:null}),mapChannelToForm:e=>({presetId:e.presetId||"custom",name:e.name||"",providerKey:e.providerKey||e.provider||e.name||"",baseUrl:e.baseUrl||"",wireApi:e.wireApi||"openai",providerApi:e.providerApi||e.api||"openai-completions",apiKey:e.apiKey||"",authMode:e.authMode||"api_key",authRef:e.authRef?{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:"",...e.authRef}:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},oauthGatewayMode:"oauth"===e.authMode&&("pi-native"===e.transport||"pi-native"===e.providerConfig?.transport),authSource:e.authSource,authStatus:e.authStatus,oauthProviderId:e.oauthProviderId||"",transport:e.transport||e.extra?.transport||e.providerConfig?.transport||"",routingGroup:e.routingGroup||"",balanceToken:e.balanceToken||"",balanceUserId:e.balanceUserId??null,websiteUrl:e.websiteUrl||"",model:e.model||"",gatewaySourceType:e.gatewaySourceType||"openai_compatible",speedTestModel:e.speedTestModel||"",modelRedirects:e.modelRedirects||[],allowedModels:e.allowedModels||[],modelMetadataMode:"hybrid",modelDefinitionsJson:vv(e.models||[],[]),providerConfigJson:vv(e.providerConfig||{},{}),modelMetadataFetching:!1,modelMetadataStatus:"",maxConcurrency:e.maxConcurrency??null,weight:e.weight||1,enabled:!1!==e.enabled,availableModels:[],modelsFetching:!1,modelsFetchError:null,modelsFetchErrorHint:null,modelsFetchMeta:null}),onPresetChange:(e,o)=>{const n=ev(e);if(!n)return o;const t={...o,presetId:e};return t.name=n.name,t.providerKey=n.providerKey||(n.id||n.name||"provider").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,""),t.baseUrl=n.baseUrl,t.wireApi=n.wireApi||"openai",t.gatewaySourceType=n.gatewaySourceType||t.gatewaySourceType||"openai_compatible",t.transport=n.transport||"",t.websiteUrl=n.websiteUrl||"",t.oauthGatewayMode="omp_oauth_gateway"===n.id,"oauth"===n.authMode?{...t,authMode:"oauth",apiKey:"",authRef:void 0,authSource:void 0,authStatus:void 0,oauthProviderId:n.oauthProviderId||""}:Ev(t,n)},fetchModelsForChannel:async(e,o,{forceRefresh:n=!1}={})=>{await rv(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null;const t=Hv("omp",o);if(e)try{const r=await function(e,{forceRefresh:o=!1}={}){return Dh("omp","models",{pathParams:{channelId:e},query:o?{forceRefresh:"true"}:void 0})}(e,{forceRefresh:n}),a=Dv(r.models||[]);o.availableModels=_v(a,t),o.modelsFetchMeta={cached:!!r.cached,stale:!!r.stale,retryAfter:r.retryAfter||null,fetchedAt:r.fetchedAt||null,offline:0===a.length,source:a.length>0?"channel":"Models.dev"},(r.error||0===a.length&&t.length>0)&&(o.modelsFetchError=nv(r?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=r.errorHint||"已使用 Models.dev 离线模型列表")}catch(r){o.availableModels=t,o.modelsFetchError=nv(r,"获取模型列表失败"),o.modelsFetchErrorHint=t.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}else{if(!o.baseUrl)return o.availableModels=t,o.modelsFetchMeta={offline:!0,source:"Models.dev"},void(o.modelsFetching=!1);try{const e=await function(e,{forceRefresh:o=!1}={}){return Dh("omp","probeModels",{body:{...e,forceRefresh:o}})}({baseUrl:o.baseUrl,apiKey:o.apiKey||"",gatewaySourceType:o.gatewaySourceType||"openai_compatible",authMode:o.authMode||"api_key",oauthProviderId:o.oauthProviderId||"",transport:o.transport||(kv(o)?"pi-native":""),model:o.model||null,speedTestModel:o.speedTestModel||null,allowedModels:Array.isArray(o.allowedModels)?o.allowedModels:[],modelRedirects:Array.isArray(o.modelRedirects)?o.modelRedirects:[]},{forceRefresh:n}),r=Dv(e.models||[]);o.availableModels=_v(r,t),o.modelsFetchMeta={cached:!!e.cached,stale:!!e.stale,retryAfter:e.retryAfter||null,fetchedAt:e.fetchedAt||null,offline:0===r.length,source:r.length>0?"channel":"Models.dev"},e.error&&(o.modelsFetchError=nv(e?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=e.errorHint||(t.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"))}catch(r){o.availableModels=t,o.modelsFetchError=nv(r,"获取模型列表失败"),o.modelsFetchErrorHint=t.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}}},fetchModelMetadataForChannel:async e=>{const o=String(e.providerKey||"").trim(),n=Array.isArray(e.allowedModels)?e.allowedModels:[],t=await function(e,o={},{forceRefresh:n=!1}={}){return Dh("omp","catalogMetadata",{body:{providerKey:e,forceRefresh:n,...o}})}(o,{model:e.model||null,speedTestModel:e.speedTestModel||null,allowedModels:n,models:bv(e.modelDefinitionsJson),availableModels:n.length>0?[]:Array.isArray(e.availableModels)?e.availableModels.map(e=>e&&"object"==typeof e?e.value||e.id||e.name:e):[]}),r=bv(e.modelDefinitionsJson),a=new Map((t.models||[]).map(e=>[String(e.id||"").toLowerCase(),e]));for(const s of r){const e=String(s.id||"").toLowerCase(),o=a.get(e)||{};a.set(e,{...o,...s})}e.modelDefinitionsJson=vv([...a.values()].filter(e=>e.id),[]),e.modelMetadataMode="hybrid";const l=Array.isArray(t.warnings)?t.warnings.length:0,i="models.dev"===t.source?.name?"Models.dev":t.source?.name||"Models.dev";e.modelMetadataStatus=`已读取 ${t.models?.length||0} 个模型(${i} 离线快照)${l?`,${l} 条兼容提示`:""}`},testFn:bf,api:{fetch:async()=>{const e=await _h("omp");return{channels:uv(e),authProviderMeta:Array.isArray(e)?null:e.authProviderMeta||null}},syncCurrent:ff,create:async e=>{const o=wv(e),n=xv(e.providerConfigJson);return await function(e,o,n,t={}){return Lh("omp",{name:e,baseUrl:o,apiKey:n,...t})}(e.name,e.baseUrl,o.apiKey,{wireApi:e.wireApi||"openai",providerApi:e.providerApi||"openai-completions",providerKey:e.providerKey,...Sv(o),routingGroup:e.routingGroup||"",maxConcurrency:pv(e.maxConcurrency),weight:hv(e.weight),enabled:e.enabled,model:e.model||null,gatewaySourceType:e.gatewaySourceType||"openai_compatible",modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,websiteUrl:e.websiteUrl||"",allowedModels:e.allowedModels||[],balanceToken:o.balanceToken,balanceUserId:o.balanceUserId,models:bv(e.modelDefinitionsJson),modelMetadataMode:"hybrid",providerConfig:Object.prototype.hasOwnProperty.call(o,"transport")?{...n,transport:o.transport}:n})},update:async(e,o)=>{const n=wv(o),t=xv(o.providerConfigJson);return await mf(e.id,{name:o.name,providerKey:o.providerKey,baseUrl:o.baseUrl,apiKey:n.apiKey,wireApi:o.wireApi||"openai",providerApi:o.providerApi||"openai-completions",...Sv(n),routingGroup:o.routingGroup||"",websiteUrl:o.websiteUrl,model:o.model||null,gatewaySourceType:o.gatewaySourceType||"openai_compatible",maxConcurrency:pv(o.maxConcurrency),weight:hv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,allowedModels:o.allowedModels||[],balanceToken:n.balanceToken,balanceUserId:n.balanceUserId,models:bv(o.modelDefinitionsJson),modelMetadataMode:"hybrid",providerConfig:Object.prototype.hasOwnProperty.call(n,"transport")?{...t,transport:n.transport}:t})},toggle:async(e,o)=>mf(e.id,{enabled:o}),remove:vf,resetHealth:async e=>{return Dh("omp","resetHealth",{pathParams:{channelId:o=e.id},body:{channelId:o}});var o}},getHeaderTags:(e,o)=>{const n=[];return"frozen"===e.health?.status?n.push({text:o.formatFreeze(e.health.freezeRemaining),type:"error"}):"checking"===e.health?.status&&n.push({text:"检测中",type:"warning"}),n},buildInfoRows:(e,o)=>{const n=e.ompAuthProvider,t=[{label:"Provider",value:e.providerKey||e.provider||"(未设置)",mono:!0},{label:"API",value:e.providerApi||e.api||"openai-completions",mono:!0},{label:"Auth",value:e.authMode||"api_key",mono:!0},{label:"Routing Group",value:e.routingGroup||"(独立)",mono:!0},{label:"Model",value:e.model||"(默认)",mono:!0},{label:"Allowed",value:Bv(e),mono:!0}];return n&&t.push({label:"Login",value:n.loggedIn?`${n.name||n.id} (${n.accountCount||0})`:`${n.name||n.id} (未登录)`}),t.push({label:"URL",value:Pv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:Pv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}),t}})},Wv=[1500,3e3,5e3,8e3];function Nv(e){try{const o=localStorage.getItem(e);if(o)return JSON.parse(o)}catch(o){}return{}}function Kv(e,o){try{localStorage.setItem(e,JSON.stringify(o))}catch(n){}}function Vv(e,o){return nv(e,o||"操作失败")}function qv(){return"undefined"==typeof document||"hidden"!==document.visibilityState}function Gv(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Jv(e){const o=$h();let n=null,t=null,r=null,a=null,i=null,s=null,d=null,c=null,u=null,p=0,h=!1;const f=P({channels:[],channelMeta:null,balances:{},loading:!1,saving:!1,balanceLoading:!1,balanceError:null,syncing:!1,toggling:{},collapsed:Nv(e.storageKeys.localCollapse),showDialog:!1,editingChannel:null,showChannelBalance:!1,formData:e.getInitialForm()}),m=P({});function v(e,{fallback:o=null,allowInsert:n=!1}={}){const t=function(e){return Gv(e?.channel)&&e.channel.id?e.channel:Gv(e)&&e.id?e:null}(e)||o;if(!t?.id)return!1;const r=f.channels.findIndex(e=>e.id===t.id);if(-1===r){if(!n)return!1;f.channels=[...f.channels,t]}else f.channels[r]={...f.channels[r],...t};return B(),g(),R(),!0}function g(){const n=o.getSchedulerState(e.schedulerSource);n?.channels?.length&&f.channels.length&&(f.channels.forEach(e=>{const o=n.channels.find(o=>o.id===e.id);o?.health&&(e.health=o.health)}),R())}const b=C(()=>o.getSchedulerState(e.schedulerSource)?.channels,g);function y(){const n=function(){if("function"!=typeof o.getChannels)return[];const n=o.getChannels(e.type);return Array.isArray(n?.value)?n.value:[]}();n.length&&!f.channels.length&&(f.channels=[...n],B(),g(),R())}function x(){c&&(clearTimeout(c),c=null)}function w(e){if(x(),!function(e){return Boolean(e?.refreshing||e?.authProvider?.refreshing)}(e))return void(p=0);if(p>=Wv.length)return;const o=Wv[p];p+=1,c=setTimeout(()=>{c=null,S({silent:!0,skipBalance:!0}).catch(()=>{})},o)}async function S(o={}){return u||(u=async function({silent:o=!1,skipBalance:n=!1}={}){o||(p=0);y(),f.loading=!o&&0===f.channels.length;try{const o=function(e){if(Array.isArray(e))return{channels:e,meta:null};if(!Gv(e))return{channels:[],meta:null};const o=Gv(e.authProviderMeta)?e.authProviderMeta:null,n=Gv(e.meta)?{...e.meta}:{};return o&&(n.authProvider=o),{channels:Array.isArray(e.channels)?e.channels:[],meta:Object.keys(n).length>0?n:null}}(await e.api.fetch());f.channels=[...o.channels],f.channelMeta=o.meta,await B(),g(),R(),w(f.channelMeta),n||A()}catch(t){0===f.channels.length&&nh.error(Vv(t,`${e.displayName} 渠道加载失败`))}finally{f.loading=!1}}(o).finally(()=>{u=null}),u)}async function k(){return s||(f.balanceLoading=!0,f.balanceError=null,s=(async()=>{try{if(!0!==(await O())?.channelBalance?.showRemaining)return f.showChannelBalance=!1,f.formData._showChannelBalance=!1,f.balances={},null;f.showChannelBalance=!0,f.formData._showChannelBalance=!0;const o=await async function(e){return(await Dt.get("/channel-balances",{params:{source:e}})).data}(e.type);return f.balances=o?.enabled&&o.balances?o.balances:{},o?.refreshing&&(a&&clearTimeout(a),a=setTimeout(()=>{a=null,qv()&&k().catch(()=>{})},1200)),o}catch(o){return f.balanceError=Vv(o,`${e.displayName} 余额加载失败`),null}finally{f.balanceLoading=!1,s=null,T()}})(),s)}function I(){t&&(clearTimeout(t),t=null),null!==i&&"undefined"!=typeof window&&"function"==typeof window.cancelIdleCallback&&window.cancelIdleCallback(i),i=null,a&&(clearTimeout(a),a=null),r&&(clearTimeout(r),r=null)}function T(){r&&(clearTimeout(r),r=null),f.showChannelBalance&&qv()&&(r=setTimeout(()=>{r=null,qv()&&async function(){const o=f.channels.filter(e=>!1!==e?.enabled&&"oauth"===e?.authMode&&e.id);await Promise.all(o.map(async o=>{try{const n=await Qh(e.type,o.id);n?.enabled&&n.balance&&(f.balances[o.id]=n.balance)}catch{}}))}().finally(T)},6e4))}function A(){if(I(),!qv())return;const e=()=>{t&&clearTimeout(t),i=null,t=null,k()};t=setTimeout(()=>{"undefined"==typeof window||"function"!=typeof window.requestIdleCallback?e():i=window.requestIdleCallback(e,{timeout:1500})},5e3)}function z(){n&&(clearTimeout(n),n=null)}function R(){z();const e=f.channels.filter(e=>"frozen"===e.health?.status&&Number(e.health?.freezeRemaining)>0).sort((e,o)=>Number(e.health?.freezeRemaining||0)-Number(o.health?.freezeRemaining||0))[0];if(!e)return;const o=Math.max(1e3,1e3*Number(e.health.freezeRemaining||0));n=setTimeout(()=>{n=null,S()},o+250)}let M=null,F=0;async function O(){return M&&Date.now()-F<6e4?M:d||(d=(async()=>{try{const e=await ae();if(e.success&&e.config)return M=e.config,F=Date.now(),M}catch(e){}finally{d=null}return null})(),d)}async function B(){try{if(f.channels.length>0){const e=[...f.channels].sort((e,o)=>{const n=e.updatedAt||e.createdAt||0;return(o.updatedAt||o.createdAt||0)-n}),o=e.filter(e=>!1!==e.enabled),n=e.filter(e=>!1===e.enabled);n.forEach(e=>{f.collapsed[e.id]=!0}),f.channels=[...o,...n]}}catch(e){}}async function $(){try{await ne("channelCollapse",e.storageKeys.collapseConfigKey,f.collapsed)}catch(o){}}function E(){Object.keys(m).forEach(e=>{delete m[e]})}function D(){let o=!0;const n=e=>{const o=e.key.replace(/\./g,"_");delete m[e.key],delete m[o]};return e.formSections.forEach(e=>{const t=(e=>!e.showWhen||e.showWhen(f.formData))(e);e.fields.forEach(e=>{if(!t||!(e=>!e.showWhen||e.showWhen(f.formData))(e)||"oauth"===f.formData.authMode&&["baseUrl","apiKey","providerApi","gatewaySourceType"].includes(e.key)&&!1!==e.skipOnOAuth)return void n(e);if(e.disabledOnEdit&&f.editingChannel)return void n(e);const r=((e,o)=>{if(!o||"string"!=typeof o||!o.includes("."))return e[o];const n=o.split(".");let t=e;for(const r of n)t=t?.[r];return t})(f.formData,e.key);let a="";e.required&&(a=e.customRequiredMessage?null==r||""===r?e.customRequiredMessage:"":null==r||""===r?`${(e=>"function"==typeof e.label?e.label(f.formData):e.label)(e)}不能为空`:""),a||"function"!=typeof e.validate||(a=e.validate(r,f.formData)||""),a?(m[e.key]={status:"error",message:a},o=!1):n(e)})}),o}function _(o={}){const n=Number(o.added||0),t=Number(o.updated||0),r=Number(o.skipped||0);if(n>0||t>0){const o=[];return n>0&&o.push(`新增 ${n} 个`),t>0&&o.push(`更新 ${t} 个`),`${e.displayName} 同步完成:${o.join(",")}`}return r>0?`${e.displayName} 已在列表中,未重复导入`:`${e.displayName} 无需同步`}async function L(){M=null,F=0,d=null,await k(),f.formData._showChannelBalance=f.showChannelBalance}function H(){qv()&&A()}return"undefined"!=typeof window&&window.addEventListener("channel-balance-visibility-change",L),"undefined"!=typeof document&&document.addEventListener("visibilitychange",H),y(),S().catch(()=>{}),async function(){try{const o=await O();if(o){const n=o.channelCollapse?.[e.storageKeys.collapseConfigKey]||{};f.collapsed=n,Kv(e.storageKeys.localCollapse,n)}}catch(o){}}().catch(()=>{}),l(()=>{z(),I(),x(),b(),"undefined"!=typeof window&&window.removeEventListener("channel-balance-visibility-change",L),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",H)}),{state:f,validation:m,actions:{loadChannels:S,loadChannelBalances:k,openAddDialog:function(){h||(f.editingChannel=null,f.formData={authMode:"api_key",authRef:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},...e.getInitialForm()||{}},f.formData._showChannelBalance=f.showChannelBalance,E(),f.showDialog=!0)},closeDialog:function(){h||(f.showDialog=!1,f.editingChannel=null,f.formData=e.getInitialForm())},toggleCollapse:function(o){f.collapsed[o]=!f.collapsed[o],Kv(e.storageKeys.localCollapse,f.collapsed),$()},handleEdit:function(o){h||(f.editingChannel=o,f.formData={authMode:o.authMode||"api_key",authRef:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:"",...o.authRef||{}},...e.mapChannelToForm(o)||{}},f.formData._showChannelBalance=f.showChannelBalance,E(),f.showDialog=!0)},handleSave:async function(){if(h)return!1;h=!0,f.saving=!0;try{return await async function(){if(!D()){const e=Object.values(m).map(e=>e?.message).filter(Boolean);return nh.error(e.length>0?`请检查表单:${e.join(";")}`:"请检查表单填写是否完整"),!1}const o=Boolean(f.editingChannel);try{const n=v(o?await e.api.update(f.editingChannel,f.formData):await e.api.create(f.formData),{allowInsert:!o});return nh.success(`${e.displayName} 渠道已${o?"更新":"添加"}`),f.showDialog=!1,f.editingChannel=null,f.formData=e.getInitialForm(),n||await S(),!0}catch(n){return nh.error(Vv(n)),!1}}()}finally{h=!1,f.saving=!1}},isSaving:()=>h,handleDelete:function(o){th.warning({title:`删除 ${e.displayName} 渠道`,content:"确定要删除这个渠道吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{await e.api.remove(o),f.channels=f.channels.filter(e=>e.id!==o),delete f.collapsed[o],Kv(e.storageKeys.localCollapse,f.collapsed),nh.success(`${e.displayName} 渠道已删除`)}catch(n){nh.error(Vv(n))}}})},handleToggleEnabled:async function(o,n){if(o&&!f.toggling[o.id]){f.toggling[o.id]=!0;try{const t="boolean"==typeof n?n:!1===o.enabled,r=await e.api.toggle(o,t);nh.success(`${e.displayName} 渠道已${t?"启用":"禁用"}`),t?(delete f.collapsed[o.id],Kv(e.storageKeys.localCollapse,f.collapsed),$()):(f.collapsed[o.id]=!0,Kv(e.storageKeys.localCollapse,f.collapsed),$()),v(r,{fallback:{...o,enabled:t}})||await S(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}))}catch(t){nh.error(Vv(t))}finally{f.toggling[o.id]=!1}}},handleSyncCurrentChannels:async function(){if("function"!=typeof e.api.syncCurrent)return nh.warning(`${e.displayName} 暂不支持同步`),null;if(f.syncing)return null;f.syncing=!0;try{const o=await e.api.syncCurrent();await S(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}));const n=Array.isArray(o?.warnings)?o.warnings.filter(Boolean):[];n.length>0&&nh.warning(n.join(";"));const t=Number(o?.added||0),r=Number(o?.updated||0);return t>0||r>0?nh.success(_(o)):nh.info(_(o)),o}catch(o){return nh.error(Vv(o,`${e.displayName} 同步失败`)),null}finally{f.syncing=!1}},handleApplyToSettings:function(o){"function"==typeof e.api.applyToSettings&&th.warning({title:"写入配置",content:"写入配置后会关闭动态切换并默认使用该渠道,是否继续?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{const n=await e.api.applyToSettings(o);nh.success("已将渠道写入配置文件"),v(n)||!1===n?.success||await S(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}))}catch(n){nh.error(Vv(n))}}})},handleResetHealth:async function(o){if("function"==typeof e.api.resetHealth)try{const n=await e.api.resetHealth(o);n?.health?(o.health=n.health,g(),R()):await S(),nh.success("渠道健康状态已重置")}catch(n){nh.error(Vv(n))}},handleRefreshBalance:async function(o){if(o?.id)try{const n=await Qh(e.type,o.id);n?.enabled&&n.balance&&(f.balances[o.id]=n.balance,f.balanceError=null)}catch(n){f.balanceError=Vv(n,`${o.name||e.displayName} 余额刷新失败`)}}}}}var Yv=Object.freeze({endpoint:Object.freeze([{key:"baseUrl",label:"Base URL",type:"text",required:!0},{key:"websiteUrl",label:"官网链接",type:"text",required:!1}]),auth:Object.freeze([{key:"authMode",label:"认证方式",type:"select",options:["api_key","none"]},{key:"apiKey",label:"API Key",type:"password",required:!1}]),schedule:Object.freeze([{key:"maxConcurrency",label:"最大并发",type:"number",required:!1},{key:"weight",label:"调度权重",type:"number",min:1,max:100},{key:"enabled",label:"渠道状态",type:"switch",default:!0}])});function Zv(){return{name:"",baseUrl:"",websiteUrl:"",apiKey:"",authMode:"api_key",maxConcurrency:null,weight:1,enabled:!0}}var Xv={key:0,class:"loading-container"},Qv={key:1},eg={key:0,class:"empty-state"},og={key:1,class:"channels-list"},ng={class:"section-title"},tg={key:0,class:"section-desc"},rg={key:0,class:"model-catalog-control"},ag={key:4,class:"auth-provider-status"},lg={key:10,class:"model-definitions-editor"},ig={class:"model-definitions-toolbar"},sg={class:"model-catalog-status",role:"status","aria-live":"polite"},dg={class:"dialog-footer"},cg={__name:"BaseChannelPanel",props:{type:{type:String,required:!0}},emits:["open-website"],setup(e,{expose:o,emit:a}){const l=e,i=a,s=se().get(l.type)||{key:l.type,label:l.type,capabilities:{channels:!0}},c=(Uv[l.type]||(()=>function(e={},o={}){const n=String(e.key||"").trim().toLowerCase(),t=String(e.label||e.title||n).trim();return{type:n,displayName:t,schedulerSource:n,storageKeys:{localCollapse:`${n}ChannelCollapse`,collapseConfigKey:n,orderConfigKey:n},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加渠道",addTitle:`添加 ${t} 渠道`,editTitle:`编辑 ${t} 渠道`,modalWidth:520,formLabelWidth:95,showApplyButton:!1,formSections:[{title:"基本信息",fields:Yv.endpoint},{title:"认证",fields:Yv.auth},{title:"调度配置",fields:Yv.schedule}],api:o,getInitialForm:Zv,mapChannelToForm:e=>({name:"",baseUrl:"",websiteUrl:"",apiKey:"",authMode:"api_key",maxConcurrency:null,weight:1,enabled:!0,...e||{}}),normalizeForm:e=>({...e}),getFormTitle:e=>e?`编辑 ${t} 渠道`:`添加 ${t} 渠道`,getChannelTitle:e=>e?.name||t,getHeaderTags:(e,o={})=>"frozen"===e.health?.status?[{text:"function"==typeof o.formatFreeze?o.formatFreeze(e.health.freezeRemaining):"已冻结",type:"error"}]:"checking"===e.health?.status?[{text:"检测中",type:"warning"}]:[],buildInfoRows:(e,o={})=>[{label:"URL",value:e.baseUrl,mono:!0},{label:"Key",value:e.apiKey?"function"==typeof o.maskApiKey?o.maskApiKey(e.apiKey):"已设置":"none"===e.authMode?"无需认证":"未设置",mono:!0,action:e.health?.status&&"healthy"!==e.health.status&&"function"==typeof o.handleResetHealth?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}],fetch:o.fetch,create:o.create,update:o.update,remove:o.remove}}(s,{fetch:()=>_h(l.type),create:e=>Lh(l.type,e),update:(e,o)=>Hh(l.type,e.id,o),remove:e=>jh(l.type,e),toggle:(e,o)=>Hh(l.type,e.id,{...e,enabled:o})})))(),{state:u,validation:p,actions:f}=Jv(c),{getChannelInflight:m}=function(e="claude"){const o=$h();return{getChannelInflight:function(n){const t=(o.getSchedulerState(e)||{channels:[]}).channels?.find(e=>e.id===n);return t?t.inflight:0}}}(l.type);function b(e){return"function"==typeof e.label?e.label(u.formData):e.label}function C(e){return Array.isArray(e)?e.map(C):e&&"object"==typeof e?Object.keys(e).sort().reduce((o,n)=>(o[n]=C(e[n]),o),{}):null==e?"":String(e)}function w(){const e=u.formData||{},o=String(e.apiKey||"");return JSON.stringify(C({channelId:u.editingChannel?.id||null,presetId:e.presetId||"",providerKey:e.providerKey||"",providerApi:e.providerApi||"",wireApi:e.wireApi||"",targetApi:e.targetApi||"",gatewaySourceType:e.gatewaySourceType||"",authMode:e.authMode||"",oauthProviderId:e.oauthProviderId||"",baseUrl:e.baseUrl||"",apiKeyMarker:o?`${o.length}:${o.slice(-4)}`:""}))}function k({clearOptions:e=!1}={}){u.formData.modelsFetching=!1,u.formData._modelsLoadedOnce=!1,u.formData._modelsFetchSignature=null,u.formData.modelsFetchError=null,u.formData.modelsFetchErrorHint=null,u.formData.modelsFetchMeta=null,e&&(u.formData.availableModels=[])}async function P(){if(!c.fetchModelsForChannel||u.formData.modelsFetching)return;const e=w();(u.formData.availableModels||[]).length>0&&u.formData._modelsLoadedOnce&&u.formData._modelsFetchSignature===e||await L({signature:e})}const T=I(()=>u.formData.modelsFetching?"正在加载模型":u.formData.modelsFetchError?"重试加载模型":(u.formData.availableModels||[]).length>0?"刷新可选模型":"加载可选模型"),A=I(()=>{if(u.formData.modelsFetching)return"正在读取模型列表,仍可继续填写表单。";if(u.formData.modelsFetchError){const e=u.formData.modelsFetchErrorHint,o=u.formData.modelsFetchMeta?.stale&&u.formData.modelsFetchMeta?.retryAfter?`当前使用缓存目录,${new Date(u.formData.modelsFetchMeta.retryAfter).toLocaleString()} 后可自动重试,也可手动刷新。`:"";return`${e?`模型列表未能更新:${u.formData.modelsFetchError}。${e}`:`模型列表未能更新:${u.formData.modelsFetchError}。可重试或手动填写模型名称。`}${o?` ${o}`:""}`}const e=u.formData.modelsFetchMeta;if(e?.stale&&e?.retryAfter)return`正在使用缓存的模型目录;${new Date(e.retryAfter).toLocaleString()} 后可自动重试,也可手动刷新。`;if(e?.stale)return"正在使用已过期的模型目录;可点击“刷新可选模型”更新。";if(e?.cached)return"已从本地缓存加载可选模型。";const o=(u.formData.availableModels||[]).length;return o>0?`已加载 ${o} 个可选模型。`:"可手动填写模型名称,或加载该渠道的可选模型。"});function z(e){return e.fields?.some(e=>(!e.showWhen||e.showWhen(u.formData))&&function(e){return!!["model-redirect","model-multi-select","autocomplete"].includes(e.type)||"select"===e.type&&["model","speedTestModel"].includes(e.key)}(e))&&Boolean(c.fetchModelsForChannel)}async function B(){if(!c.fetchModelsForChannel||u.formData.modelsFetching)return;const e=w();await L({forceRefresh:u.formData._modelsLoadedOnce&&u.formData._modelsFetchSignature===e,signature:e})}async function E(){if("function"==typeof c.fetchModelMetadataForChannel&&!u.formData.modelMetadataFetching){u.formData.modelMetadataFetching=!0,u.formData.modelMetadataStatus="正在读取 OMP metadata…";try{await c.fetchModelMetadataForChannel(u.formData)}catch(e){u.formData.modelMetadataStatus=e?.response?.data?.error||e?.message||"读取 OMP metadata 失败"}finally{u.formData.modelMetadataFetching=!1}}}const D=I(()=>{if(!c.presets)return[];const e={};return c.presets.forEach(o=>{const n=o.category||"custom";e[n]||(e[n]={type:"group",label:c.presetCategories?.[n]||n,key:`preset-group:${n}`,children:[]}),e[n].children.push({label:o.name,value:o.id})}),Object.values(e)});function _(e){if(c.onPresetChange){const o=c.onPresetChange(e,u.formData);Object.assign(u.formData,o)}else u.formData.presetId=e;k({clearOptions:!0})}async function L({forceRefresh:e=!1,signature:o=w()}={}){if(c.fetchModelsForChannel){u.formData.modelsFetching=!0,u.formData.modelsFetchError=null,u.formData.modelsFetchErrorHint=null,u.formData.modelsFetchMeta=null;try{await c.fetchModelsForChannel(u.editingChannel?.id||null,u.formData,{forceRefresh:e})}catch(n){w()===o&&(u.formData.modelsFetchError=nv(n,"获取模型列表失败"),u.formData.modelsFetchErrorHint="可重试,或先手动填写模型名称")}finally{w()===o&&(u.formData.modelsFetching=!1)}if(w()!==o)return void k({clearOptions:!0});u.formData._modelsLoadedOnce=!0,u.formData._modelsFetchSignature=o}}function H(e,o){if(!o.includes("."))return e[o];const n=o.split(".");let t=e;for(const r of n)t=t?.[r];return t}function U(e,o,n){if(!o.includes("."))return void(e[o]=n);const t=o.split(".");let r=e;for(let a=0;a<t.length-1;a++)r[t[a]]||(r[t[a]]={}),r=r[t[a]];r[t[t.length-1]]=n}function W(e){const o=u.formData.availableModels||[];if(!e||!o.length)return o;const n=e.toLowerCase();return o.filter(e=>(e.label||e.value||"").toLowerCase().includes(n))}function N(e,o){const n=[],t=new Set,r=e=>{for(const o of e||[]){const e=String(o?.value||"").trim();if(!e)continue;const r=e.toLowerCase();t.has(r)||(t.add(r),n.push({label:o?.label||e,value:e}))}};r(u.formData.availableModels||[]),r(o||[]);const a=n;if(!e||!a.length)return a;const l=e.toLowerCase();return a.filter(e=>(e.label||e.value||"").toLowerCase().includes(l))}function K(e){const o=e.replace(/\./g,"_");return p[o]?.status||p[e]?.status}function V(e){const o=e.replace(/\./g,"_");return p[o]?.message||p[e]?.message}function q(e){if("function"!=typeof e.getStatus)return{tags:[],message:""};const o=e.getStatus(u.formData)||{};return{tags:Array.isArray(o.tags)?o.tags:[],message:o.message||"",warning:!0===o.warning}}const G={getChannelInflight:m,getChannelBalance:e=>u.balances[e.id]||null,formatFreeze:e=>`冻结 ${e||0}s`,maskApiKey:e=>void 0===e?"已隐藏":e?e.length<=12?"******":`${e.slice(0,8)}******${e.slice(-4)}`:"(未设置)",handleResetHealth:e=>f.handleResetHealth(e),handleRefreshBalance:e=>f.handleRefreshBalance(e),handleOpenWebsite:e=>i("open-website",e)};function J(e){const o=m(e.id),n=e.maxConcurrency?`${o}/${e.maxConcurrency}`:o>0?o:"不限";return{weight:e.weight||1,concurrencyText:n,concurrencyActive:o>0}}function Y(e){switch(e.type){case"password":case"text":case"textarea":default:return $l;case"number":return Ip;case"switch":return Kp;case"radio-group":return hs}}function ee(e){const o={placeholder:e.placeholder};return"password"===e.type&&(o.type="password",o["show-password-on"]="click"),"textarea"===e.type&&(o.type="textarea",o.autosize=e.autosize||{minRows:5,maxRows:16}),"number"===e.type&&(o.min=e.min??1,o.max=e.max??100,o.step=e.step??1,o.clearable=e.clearable,o.style="width: 100%;"),e.disabledOnEdit&&u.editingChannel&&(o.disabled=!0),o}return o({openAddDialog:f.openAddDialog,syncCurrentChannels:f.handleSyncCurrentChannels,refresh:f.loadChannels}),(o,a)=>(y(),X("div",null,[j(u).loading?(y(),X("div",Xv,[h(j(Hp),{size:"small"})])):(y(),X("div",Qv,[0===j(u).channels.length?(y(),X("div",eg,[h(j(Xa),{description:j(c).emptyDescription},g({_:2},[j(c).showEmptyAction?{name:"extra",fn:R(()=>[h(j(Po),{type:"primary",size:"small",onClick:j(f).openAddDialog},{icon:R(()=>[h(j(so),null,{default:R(()=>[h(j(st))]),_:1})]),default:R(()=>[t(" "+S(j(c).emptyActionText),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1032,["description"])])):(y(),X("div",og,[(y(!0),X(F,null,d(j(u).channels,e=>(y(),v(hm,{key:e.id,channel:e,collapsed:j(u).collapsed[e.id],"header-tags":j(c).getHeaderTags(e,G),balance:G.getChannelBalance(e),"info-rows":j(c).buildInfoRows(e,G),meta:J(e),"show-apply-button":j(c).showApplyButton,"channel-type":j(c).type,"test-fn":j(c).testFn,"auth-check-fn":e=>j(Jh)(j(c).type,e),toggling:!!j(u).toggling[e.id],onToggleCollapse:o=>j(f).toggleCollapse(e.id),onApply:o=>j(f).handleApplyToSettings(e),onEdit:o=>j(f).handleEdit(e),onDelete:o=>j(f).handleDelete(e.id),onToggleEnabled:o=>j(f).handleToggleEnabled(e,o),onRefreshBalance:o=>j(f).handleRefreshBalance(e),onOpenWebsite:a[0]||(a[0]=e=>i("open-website",e))},null,8,["channel","collapsed","header-tags","balance","info-rows","meta","show-apply-button","channel-type","test-fn","auth-check-fn","toggling","onToggleCollapse","onApply","onEdit","onDelete","onToggleEnabled","onRefreshBalance"]))),128))]))])),h(j(Nn),{show:j(u).showDialog,"onUpdate:show":a[6]||(a[6]=e=>j(u).showDialog=e),preset:"card",title:j(u).editingChannel?j(c).editTitle:j(c).addTitle,class:"channel-dialog",style:O({width:j(c).modalWidth+"px",maxHeight:"80vh"}),"content-style":{maxHeight:"calc(80vh - 100px)",overflowY:"auto"},"mask-closable":!j(u).saving,"close-on-esc":!j(u).saving,closable:!j(u).saving},{footer:R(()=>[Q("div",dg,[h(j(Po),{disabled:j(u).saving,onClick:j(f).closeDialog},{default:R(()=>[...a[8]||(a[8]=[t("取消",-1)])]),_:1},8,["disabled","onClick"]),h(j(Po),{type:"primary",loading:j(u).saving,disabled:j(u).saving,"data-test":"channel-save",onClick:j(f).handleSave},{default:R(()=>[t(S(j(u).saving?"提交中…":j(u).editingChannel?"保存修改":"添加渠道"),1)]),_:1},8,["loading","disabled","onClick"])])]),default:R(()=>[h(j(Bu),{"label-placement":"left","label-width":j(c).formLabelWidth,class:"channel-form"},{default:R(()=>[(y(!0),X(F,null,d(j(c).formSections,o=>(y(),X(F,{key:o.title},[!o.showWhen||o.showWhen(j(u).formData)?(y(),X("div",{key:0,class:$(["form-section",{collapsible:o.collapsible}])},[Q("div",ng,[t(S(o.title)+" ",1),o.description?(y(),X("span",tg,S(o.description),1)):n("",!0)]),z(o)?(y(),X("div",rg,[h(j(Po),{text:"",type:"primary",size:"tiny",loading:j(u).formData.modelsFetching,onClick:B},{default:R(()=>[t(S(T.value),1)]),_:1},8,["loading"]),Q("span",{class:$(["model-catalog-status",{"is-error":j(u).formData.modelsFetchError,"is-loading":j(u).formData.modelsFetching}]),role:"status","aria-live":"polite"},S(A.value),3)])):n("",!0),(y(!0),X(F,null,d(o.fields,o=>Z((y(),v(j(pp),{label:b(o),"label-style":o.fullWidth?{display:"none"}:void 0,required:o.required,"validation-status":K(o.key),feedback:V(o.key)},{default:R(()=>["channel-auth"===o.type?(y(),v(Lm,{key:0,platform:e.type,"channel-id":j(u).editingChannel?.id||"","form-data":j(u).formData,"auth-meta":j(u).authMeta,onUpdateAuth:a[1]||(a[1]=e=>{j(u).formData.authMode="oauth",j(u).formData.authRef=e.authRef,j(u).formData.authSource=e.authSource,j(u).formData.authStatus=e.authStatus,j(u).formData.oauthProviderId=e.oauthProviderId||e.authRef?.providerId||""})},null,8,["platform","channel-id","form-data","auth-meta"])):"preset"===o.type?(y(),v(j(Hi),{key:1,value:j(u).formData.presetId,options:D.value,placeholder:o.placeholder,"onUpdate:value":_},null,8,["value","options","placeholder"])):"select"!==o.type||["model","speedTestModel"].includes(o.key)?"model-redirect"===o.type?(y(),v(Fm,{key:3,modelValue:j(u).formData.modelRedirects,"onUpdate:modelValue":a[2]||(a[2]=e=>j(u).formData.modelRedirects=e),"available-models":j(u).formData.availableModels,"channel-type":j(c).type,onFocusin:P},null,8,["modelValue","available-models","channel-type"])):"auth-provider-status"===o.type?(y(),X("div",ag,[q(o).tags.length>0?(y(),v(j(Nd),{key:0,size:"small",class:"auth-provider-tags"},{default:R(()=>[(y(!0),X(F,null,d(q(o).tags,e=>(y(),v(j(cl),{key:e.text,size:"small",type:e.type||"default",bordered:!1},{default:R(()=>[t(S(e.text),1)]),_:2},1032,["type"]))),128))]),_:2},1024)):n("",!0),q(o).message?(y(),X("div",{key:1,class:$(["auth-provider-message",{warning:q(o).warning}])},S(q(o).message),3)):n("",!0)])):"model-multi-select"===o.type?(y(),v(j(Hi),{key:5,value:H(j(u).formData,o.key),options:j(u).formData.availableModels||[],placeholder:o.placeholder,loading:j(u).formData.modelsFetching,multiple:"",filterable:"",clearable:"",tag:"",onFocus:P,"onUpdate:value":e=>U(j(u).formData,o.key,e)},null,8,["value","options","placeholder","loading","onUpdate:value"])):"select"===o.type&&"speedTestModel"===o.key?(y(),v(j(Kl),{key:6,value:j(u).formData.speedTestModel,options:N(j(u).formData.speedTestModel,o.options),placeholder:o.placeholder,loading:j(u).formData.modelsFetching,"get-show":()=>!0,clearable:"",onFocus:P,"onUpdate:value":a[3]||(a[3]=e=>j(u).formData.speedTestModel=e)},null,8,["value","options","placeholder","loading"])):"select"===o.type&&"model"===o.key?(y(),v(j(Kl),{key:7,value:j(u).formData.model,options:N(j(u).formData.model,o.options),placeholder:o.placeholder,loading:j(u).formData.modelsFetching,"get-show":()=>!0,clearable:"",onFocus:P,"onUpdate:value":a[4]||(a[4]=e=>j(u).formData.model=e)},null,8,["value","options","placeholder","loading"])):"autocomplete"===o.type?(y(),v(j(Kl),{key:8,value:H(j(u).formData,o.key),options:W(H(j(u).formData,o.key)),placeholder:o.placeholder,loading:j(u).formData.modelsFetching,"get-show":()=>!0,onFocus:P,"onUpdate:value":e=>U(j(u).formData,o.key,e)},null,8,["value","options","placeholder","loading","onUpdate:value"])):"radio-group"===o.type?(y(),v(j(hs),{key:9,value:H(j(u).formData,o.key),"onUpdate:value":e=>U(j(u).formData,o.key,e)},{default:R(()=>[h(j(Nd),null,{default:R(()=>[(y(!0),X(F,null,d(o.options,e=>(y(),v(j(us),{key:e.value,value:e.value},{default:R(()=>[t(S(e.label),1)]),_:2},1032,["value"]))),128))]),_:2},1024)]),_:2},1032,["value","onUpdate:value"])):"model-definitions"===o.type?(y(),X("div",lg,[Q("div",ig,[h(j(Po),{size:"tiny",secondary:"",loading:j(u).formData.modelMetadataFetching,onClick:E},{default:R(()=>[...a[7]||(a[7]=[t(" 自动获取 Metadata ",-1)])]),_:1},8,["loading"]),Q("span",sg,S(j(u).formData.modelMetadataStatus||"Metadata 读取 Models.dev 离线快照;模型列表按钮才探测渠道,普通保存不会启动网络或 OMP 命令。"),1)]),h(j($l),{value:j(u).formData.modelDefinitionsJson,type:"textarea",autosize:{minRows:8,maxRows:20},placeholder:o.placeholder,"onUpdate:value":a[5]||(a[5]=e=>j(u).formData.modelDefinitionsJson=e)},null,8,["value","placeholder"])])):(y(),v(x(Y(o)),r({key:11,value:H(j(u).formData,o.key)},{ref_for:!0},ee(o),{"onUpdate:value":e=>U(j(u).formData,o.key,e)}),null,16,["value","onUpdate:value"])):(y(),v(j(Hi),{key:2,value:H(j(u).formData,o.key),options:o.options||[],placeholder:o.placeholder,clearable:o.clearable,disabled:o.disabledOnEdit&&!!j(u).editingChannel,"onUpdate:value":e=>U(j(u).formData,o.key,e)},null,8,["value","options","placeholder","clearable","disabled","onUpdate:value"]))]),_:2},1032,["label","label-style","required","validation-status","feedback"])),[[M,!o.showWhen||o.showWhen(j(u).formData)]])),256))],2)):n("",!0)],64))),128))]),_:1},8,["label-width"])]),_:1},8,["show","title","style","mask-closable","close-on-esc","closable"])]))}},ug=To(cg,[["__scopeId","data-v-8bbd05fc"]]),pg={__name:"ClaudeChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=J(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(y(),v(ug,{ref_key:"baseRef",ref:r,type:"claude",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},hg={__name:"CodexChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=J(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(y(),v(ug,{ref_key:"baseRef",ref:r,type:"codex",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},fg={__name:"GeminiChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=J(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(y(),v(ug,{ref_key:"baseRef",ref:r,type:"gemini",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},mg={__name:"OpenCodeChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=J(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(y(),v(ug,{ref_key:"baseRef",ref:r,type:"opencode",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},vg={__name:"OmpChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=J(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(y(),v(ug,{ref_key:"baseRef",ref:r,type:"omp",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},gg={class:"proxy-logs"},bg={class:"logs-header"},yg={class:"header-left"},xg={class:"today-stats"},Cg={class:"logs-table"},wg={key:0,class:"empty-state"},Sg={class:"action-message"},kg={class:"action-time"},Pg={class:"action-message"},Ig={class:"action-time"},Tg=["title"],Ag={key:0},zg={style:{"font-family":"monospace","font-size":"12px"}},Rg={key:0,style:{"margin-top":"4px"}},Mg={style:{"font-family":"monospace","font-size":"12px"}},Fg={key:1,style:{"margin-top":"6px",color:"#d97706","font-size":"12px"}},Og={key:1},Bg={class:"logs-footer"},$g={class:"count"},Eg=To({__name:"ProxyLogs",props:{source:{type:String,default:"claude"}},setup(e){const o=e,{logsBySource:r,wsConnected:a,clearLogsState:s,logLimit:c}=Lf(),u=se(),p=I(()=>u.get(o.source)?.logLayout||String(o.source||"").trim().toLowerCase()),f=I(()=>{const e=String(o.source||"").trim().toLowerCase();return(r.value[e]||[]).slice(0,c.value)});J(f.value.length);const m=J(null),g=J({requests:0,tokens:0});let w=null,k=null;function P(e,n){return e.usageMissing||"cached"===n&&"dsh"===o.source&&!0!==e.cacheUsageAvailable?"--":e.tokens?.[n]||0}async function T(){try{const e=(await yf(o.source))?.summary||{},n="object"==typeof e.tokens?e.tokens.total:e.tokens;g.value={requests:e.requests||0,tokens:n||0}}catch(e){}}async function A(){try{await async function(){return(await Dt.post("/proxy/logs/clear")).data}(),s(),nh.success("日志已清空")}catch(e){nh.error("清空失败: "+e.message)}}return C(f,e=>{const o=e[0]?.id||null;o&&o!==k?(k=o,(!m.value||m.value.scrollTop<20)&&i(()=>{m.value&&(m.value.scrollTop=0)})):k=o}),C(()=>o.source,()=>{T(),k=f.value[0]?.id||null}),b(()=>{T(),w=setInterval(()=>{T()},3e4)}),l(()=>{w&&(clearInterval(w),w=null)}),(o,r)=>(y(),X("div",gg,[Q("div",bg,[Q("div",yg,[r[0]||(r[0]=Q("h3",{class:"title"},"实时日志",-1)),Q("div",xg,[h(j(cl),{size:"tiny",bordered:!1,type:"info"},{default:R(()=>[t(" 今日请求: "+S(g.value.requests),1)]),_:1}),h(j(cl),{size:"tiny",bordered:!1,type:"success"},{default:R(()=>{return[t(" 今日Token: "+S((e=g.value.tokens,e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toString())),1)];var e}),_:1})])]),h(j(Po),{text:"",size:"small",onClick:A},{default:R(()=>[h(j(so),{size:"16"},{default:R(()=>[h(j(Pt))]),_:1}),r[1]||(r[1]=t(" 清空 ",-1))]),_:1})]),Q("div",Cg,[Q("div",{class:$(["table-header",`table-header-${e.source}`])},[Q("div",{class:$(["col col-channel",`col-channel-${p.value}`])},"渠道",2),Q("div",{class:$(["col col-token",`col-token-${p.value}`])},"请求",2),Q("div",{class:$(["col col-token",`col-token-${p.value}`])},"回复",2),"claude"===e.source?(y(),X(F,{key:0},[Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"写入",2),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"命中",2)],64)):"dsh"===e.source?(y(),X(F,{key:1},[Q("div",{class:$(["col col-token",`col-token-${p.value}`])},"缓存",2),Q("div",{class:$(["col col-token",`col-token-${p.value}`])},"总计",2)],64)):"codex"===e.source?(y(),X(F,{key:2},[Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"推理",2),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"缓存",2),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):"gemini"===e.source?(y(),X(F,{key:3},[Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"缓存",2),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):"opencode"===e.source||"omp"===e.source?(y(),X(F,{key:4},[Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"推理",2),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"缓存",2),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):n("",!0),Q("div",{class:$(["col col-time",`col-time-${p.value}`])},"时间",2)],2),Q("div",{class:"table-body",ref_key:"tableBody",ref:m},[0===f.value.length?(y(),X("div",wg," 暂无日志 ")):n("",!0),(y(!0),X(F,null,d(f.value,o=>(y(),X("div",{key:o.id,class:$(["action"===o.type?"action-row":"error"===o.status?"error-row":"table-row",{"new-log":o.isNew}])},["action"===o.type?(y(),X(F,{key:0},[h(j(so),{size:"16",style:{color:"#18a058","margin-right":"8px"}},{default:R(()=>[h(j(vt))]),_:1}),Q("span",Sg,S(o.message),1),Q("span",kg,S(o.time),1)],64)):"error"===o.status?(y(),X(F,{key:1},[h(j(so),{size:"16",style:{color:"#d03050","margin-right":"8px"}},{default:R(()=>[h(j(kt))]),_:1}),Q("span",Pg,S(o.channel)+": "+S(o.error||o.message||"请求失败"),1),Q("span",Ig,S(o.time),1)],64)):(y(),v(j(fs),{key:2,placement:"top",style:{maxWidth:"300px"}},{trigger:R(()=>[Q("div",{class:$(["table-row-content",`table-row-content-${e.source}`])},[Q("div",{class:$(["col col-channel",`col-channel-${p.value}`]),title:o.channel},[h(j(cl),{size:"small",type:"success"},{default:R(()=>[t(S(o.channel),1)]),_:2},1024)],10,Tg),Q("div",{class:$(["col col-token",`col-token-${p.value}`])},S(P(o,"input")),3),Q("div",{class:$(["col col-token",`col-token-${p.value}`])},S(P(o,"output")),3),"claude"===e.source?(y(),X(F,{key:0},[Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"cacheCreation")),3),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"cacheRead")),3)],64)):"dsh"===e.source?(y(),X(F,{key:1},[Q("div",{class:$(["col col-token",`col-token-${p.value}`])},S(P(o,"cached")),3),Q("div",{class:$(["col col-token",`col-token-${p.value}`])},S(P(o,"total")),3)],64)):"codex"===e.source?(y(),X(F,{key:2},[Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"reasoning")),3),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"cached")),3),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"total")),3)],64)):"gemini"===e.source?(y(),X(F,{key:3},[Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"cached")),3),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"total")),3)],64)):"opencode"===e.source||"omp"===e.source?(y(),X(F,{key:4},[Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"reasoning")),3),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"cached")),3),Q("div",{class:$(["col col-token",`col-token-${e.source}`])},S(P(o,"total")),3)],64)):n("",!0),Q("div",{class:$(["col col-time",`col-time-${p.value}`])},S(o.time),3)],2)]),default:R(()=>[o.model?(y(),X("div",Ag,[r[3]||(r[3]=Q("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"模型信息",-1)),Q("div",zg,S(o.model),1),o.originalModel&&o.originalModel!==o.model?(y(),X("div",Rg,[r[2]||(r[2]=Q("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"模型重定向",-1)),Q("div",Mg,S(o.originalModel)+" → "+S(o.model),1)])):n("",!0),o.usageMissing?(y(),X("div",Fg," 上游响应未返回 usage,当前仅确认实际模型,无法计算 token。 ")):n("",!0)])):(y(),X("div",Og,"暂无模型信息"))]),_:2},1024))],2))),128))],512)]),Q("div",Bg,[Q("span",{class:$(["status",{connected:j(a)}])},[h(j(so),{size:"14"},{default:R(()=>[(y(),v(x(j(a)?j(vt):j(kt))))]),_:1}),t(" "+S(j(a)?"已连接":"未连接"),1)],2),Q("span",$g,"共 "+S(f.value.length)+" 条",1)])]))}},[["__scopeId","data-v-1d31e3d2"]]),Dg=new Map;function _g(e={}){return{...e.platform?{platform:e.platform}:{},...e.cwd?{cwd:e.cwd}:{},...e.scope?{scope:e.scope}:{}}}async function Lg(e="claude",o={}){const n=function(e,o={}){return Sh("skills",e,o.scope||"user",o.cwd||"")}(e,o);if(Dg.has(n))return Dg.get(n);const t=kh(n,t=>Dt.get("/skills",{params:{platform:e,scope:o.scope||"user",..._g(o)},signal:t}).then(e=>e.data).catch(e=>{throw Dg.delete(n),e}),"skills",`skills:${e}`);return Dg.set(n,t),t}async function Hg(e="claude",o={}){return function(e=""){for(const o of Dg.keys())e&&!o.includes(`:${e}:`)||Dg.delete(o)}(e),(await Dt.post("/skills/refresh",{platform:e,scope:o.scope||"user",...o.cwd?{cwd:o.cwd}:{}})).data}async function jg(e,o={}){return(await Dt.get(`/skills/refresh/${encodeURIComponent(e)}`,{params:_g(o)})).data}async function Ug(e,o,n="claude",t={}){return(await Dt.put("/skills/toggle",{controlKey:e,enabled:o,platform:n,scope:t.scope||"user",...t.cwd?{cwd:t.cwd}:{}})).data}async function Wg(e,o,n="claude",t={}){return(await Dt.put("/skills/trust",{controlKey:e,trust:o,platform:n,scope:t.scope||"user",...t.cwd?{cwd:t.cwd}:{}})).data}async function Ng(){return(await Dt.get("/skills/omp-settings")).data}async function Kg(e){return(await Dt.put("/skills/omp-settings",e)).data}async function Vg(e,o="claude",n=null,t=null,r={}){const a={platform:o,..._g(r)};t&&(a.fullDirectory=t),n&&(n.id&&(a.repoId=n.id),n.provider&&(a.provider=n.provider),n.host&&(a.host=n.host),n.owner&&(a.owner=n.owner),n.name&&(a.name=n.name),n.branch&&(a.branch=n.branch),n.directory&&(a.directory=n.directory),n.projectPath&&(a.projectPath=n.projectPath),n.localPath&&(a.localPath=n.localPath),n.repoUrl&&(a.repoUrl=n.repoUrl));return kh(Sh(`skill-detail:${e}:${t||""}`,o,r.scope||"",`${r.cwd||""}:${n?.localPath||n?.projectPath||""}`),o=>Dt.get(`/skills/detail/${e}`,{params:a,signal:o}).then(e=>e.data),"skill-detail",`skill-detail:${o}`)}async function qg(e,o="claude"){return(await Dt.post("/skills/create",{...e,platform:o})).data}async function Gg(e="claude"){return(await Dt.get("/skills/repos",{params:{platform:e}})).data}async function Jg(e,o="claude"){return(await Dt.post("/skills/repos",{...e,platform:o})).data}async function Yg(e,o="claude"){return(await Dt.delete("/skills/repos",{params:{platform:o,id:e.id||"",owner:e.owner||"",name:e.name||"",directory:e.directory||""}})).data}async function Zg(e,o,n="claude"){return(await Dt.put("/skills/repos/toggle",{id:e.id||"",owner:e.owner||"",name:e.name||"",enabled:o,directory:e.directory||"",platform:n})).data}async function Xg(e,o={},n="claude"){return(await Dt.put("/skills/repos/auth",{id:e.id||"",owner:e.owner||"",name:e.name||"",directory:e.directory||"",token:o.token||"",clearToken:!!o.clearToken,platform:n})).data}async function Qg(e,o="claude"){return(await Dt.post("/skills/create-with-files",{...e,platform:o})).data}var eb={class:"right-panel"},ob={class:"toolbar-section"},nb={class:"toolbar-left"},tb={class:"toolbar-right"},rb={class:"panel-header"},ab={class:"header-title"},lb={class:"header-actions"},ib={class:"channels-scroll-area"},sb={key:1,class:"channels-section channels-unsupported"},db=To({__name:"RightPanel",props:{showChannels:{type:Boolean,default:!0},showLogs:{type:Boolean,default:!0},proxyRunning:{type:Boolean,default:!1},proxyLoading:{type:Boolean,default:!1}},emits:["proxy-toggle","show-recent"],setup(e,{emit:o}){const a=q(),i=e,s=o,d=I(()=>re(a)),{getPlatform:c}=jt(),u=I(()=>c(d.value)),p=J(null),f=J(!1),m=J(0),g={claude:pg,codex:hg,gemini:fg,opencode:mg,omp:vg},w=I(()=>g[d.value]||ug),k=I(()=>g[d.value]?{}:{type:d.value});function P(e){return!0===u.value?.capabilities?.[e]||!0===u.value?.resourceTypes?.[e]}function T(e){return P(e)||!0===u.value?.resourceTypes?.[e]}I(()=>["skills","commands","agents","plugins"].some(T));const A=I(()=>T("skills")),z=I(()=>T("commands")),M=I(()=>T("plugins")),F=I(()=>T("agents")),O=I(()=>u.value?.proxyLabels?.toggle||"动态切换");async function B(){if(A.value)try{const e=await Lg(d.value);e.success&&e.skills&&(m.value=e.skills.filter(e=>e.enabled).length)}catch(e){}else m.value=0}const E=I(()=>`${u.value?.label||u.value?.title||d.value} 渠道管理`);function D(e){window.open(e,"_blank")}function _(){p.value?.openAddDialog?.()}async function L(){const e=p.value;if(e?.syncCurrentChannels&&!f.value){f.value=!0;try{await e.syncCurrentChannels()}finally{f.value=!1}}}function H(e){const o=String(e?.detail?.channel||"").trim().toLowerCase();o&&o!==d.value||p.value?.refresh?.()}function U(e){s("proxy-toggle",e)}function W(){s("show-recent")}function N(e){e?.currentTarget?.blur?.()}function K(e){window.dispatchEvent(new CustomEvent("open-skills-drawer",{detail:{platform:d.value}})),N(e)}function V(e){window.dispatchEvent(new CustomEvent("open-commands-drawer",{detail:{platform:d.value}})),N(e)}function G(e){window.dispatchEvent(new CustomEvent("open-agents-drawer",{detail:{platform:d.value}})),N(e)}function Y(e){window.dispatchEvent(new CustomEvent("open-plugins-drawer",{detail:{platform:d.value}})),N(e)}return b(()=>{B(),"undefined"!=typeof window&&window.addEventListener("channel-management-refresh",H)}),C(()=>d.value,()=>{B()}),C(()=>i.proxyRunning,()=>{}),l(()=>{"undefined"!=typeof window&&window.removeEventListener("channel-management-refresh",H)}),(o,a)=>(y(),X("div",eb,[Q("div",ob,[Q("div",nb,[h(j(qp),{depth:"3",class:"toolbar-label"},{default:R(()=>[t(S(O.value),1)]),_:1}),P("proxy")?(y(),v(j(Kp),{key:0,value:e.proxyRunning,loading:e.proxyLoading,disabled:e.proxyLoading,size:"small","onUpdate:value":U},null,8,["value","loading","disabled"])):(y(),v(j(qp),{key:1,depth:"3",class:"toolbar-label"},{default:R(()=>[...a[0]||(a[0]=[t("当前平台暂无代理控制",-1)])]),_:1})),A.value&&m.value>0?(y(),v(j(cl),{key:2,type:"success",size:"small",bordered:!1},{default:R(()=>[t(S(m.value)+" 技能 ",1)]),_:1})):n("",!0)]),Q("div",tb,[A.value?(y(),v(j(fs),{key:0,trigger:"hover"},{trigger:R(()=>[h(j(Po),{text:"",size:"small",class:"toolbar-btn",onClick:K},{icon:R(()=>[h(j(so),{size:18},{default:R(()=>[h(j(ht))]),_:1})]),_:1})]),default:R(()=>[a[1]||(a[1]=t(" Skills 技能 ",-1))]),_:1})):n("",!0),F.value?(y(),v(j(fs),{key:1,trigger:"hover"},{trigger:R(()=>[h(j(Po),{text:"",size:"small",class:"toolbar-btn",onClick:G},{icon:R(()=>[h(j(so),{size:18},{default:R(()=>[h(j(dt))]),_:1})]),_:1})]),default:R(()=>[a[2]||(a[2]=t(" Agents 代理 ",-1))]),_:1})):n("",!0),M.value?(y(),v(j(fs),{key:2,trigger:"hover"},{trigger:R(()=>[h(j(Po),{text:"",size:"small",class:"toolbar-btn",onClick:Y},{icon:R(()=>[h(j(so),{size:18},{default:R(()=>[h(j(At))]),_:1})]),_:1})]),default:R(()=>[a[3]||(a[3]=t(" Plugins 插件 ",-1))]),_:1})):n("",!0),z.value?(y(),v(j(fs),{key:3,trigger:"hover"},{trigger:R(()=>[h(j(Po),{text:"",size:"small",class:"toolbar-btn",onClick:V},{icon:R(()=>[h(j(so),{size:18},{default:R(()=>[h(j(xt))]),_:1})]),_:1})]),default:R(()=>[a[4]||(a[4]=t(" Commands 命令 ",-1))]),_:1})):n("",!0),P("sessions")?(y(),v(j(fs),{key:4,trigger:"hover"},{trigger:R(()=>[h(j(Po),{text:"",size:"small",class:"toolbar-btn",onClick:W},{icon:R(()=>[h(j(so),{size:18},{default:R(()=>[h(j(Ft))]),_:1})]),_:1})]),default:R(()=>[a[5]||(a[5]=t(" 最新对话 ",-1))]),_:1})):n("",!0)])]),e.showChannels&&P("channels")?(y(),X("div",{key:0,class:$(["channels-section",{"full-height":!e.showLogs||!P("nativeLogs")}])},[Q("div",rb,[Q("div",ab,[Q("h3",null,S(E.value),1),h(j(qp),{depth:"3",class:"header-hint"},{default:R(()=>[...a[6]||(a[6]=[t("启用渠道优先显示",-1)])]),_:1})]),Q("div",lb,[h(j(Po),{secondary:"",size:"small",loading:f.value,disabled:f.value,onClick:L},{icon:R(()=>[h(j(so),null,{default:R(()=>[h(j(mt))]),_:1})]),default:R(()=>[a[7]||(a[7]=t(" 同步 ",-1))]),_:1},8,["loading","disabled"]),h(j(Po),{type:"primary",size:"small",onClick:_},{icon:R(()=>[h(j(so),null,{default:R(()=>[h(j(st))]),_:1})]),default:R(()=>[a[8]||(a[8]=t(" 添加 ",-1))]),_:1})])]),Q("div",ib,[(y(),v(x(w.value),r({ref_key:"currentPanelRef",ref:p},k.value,{onOpenWebsite:D}),null,16))])],2)):e.showChannels?(y(),X("div",sb,[h(j(Sl),{type:"info","show-icon":!1},{default:R(()=>[t(S(E.value)+" 未声明渠道管理能力。 ",1)]),_:1})])):n("",!0),e.showLogs&&P("nativeLogs")?(y(),X("div",{key:2,class:$(["logs-section",{"full-height":!e.showChannels}])},[h(Eg,{source:d.value},null,8,["source"])],2)):n("",!0)]))}},[["__scopeId","data-v-71b20d97"]]),cb={class:"layout"},ub={class:"panel-security-auth"},pb={class:"header"},hb={class:"logo-wrapper"},fb=["alt"],mb={class:"nav-tabs"},vb=["onClick"],gb={class:"nav-label"},bb={class:"header-actions"},yb={class:"env-warning-count"},xb={class:"favorites-button-wrapper"},Cb={key:0,class:"favorites-badge"},wb={class:"more-menu-trigger","aria-label":"更多工具"},Sb={class:"main-container"},kb={key:0,class:"global-loading-overlay"},Pb={class:"left-content"},Ib="coding-tool-x",Tb={__name:"Layout",setup(e){const o=_(()=>Wt(()=>import("./RecentSessionsDrawer-DCsgGSBu.js").then(e=>e.n),__vite__mapDeps([10,3,1,11,4,12,13,6,14,15,16,9,2,8,17,18,19]))),r=_(()=>Wt(()=>import("./FavoritesDrawer-Y-MmIIE9.js"),__vite__mapDeps([63,1,11,4,12,13,23,5,6,14,15,24,9,2,3,8,16,17,18,64]))),a=_(()=>Wt(()=>import("./ChatHistoryDrawer-B_OnCpxR.js"),__vite__mapDeps([28,1,11,4,12,6,29,3,30,17,16,9,2,8,31]))),i=_(()=>Wt(()=>import("./SettingsDrawer-Q_aTOBhf.js"),__vite__mapDeps([65,1,11,4,12,13,5,47,23,6,7,8,9,2,3,66]))),c=_(()=>Wt(()=>import("./McpDrawer-B7cwI24B.js"),__vite__mapDeps([67,1,11,4,12,13,23,5,6,34,35,9,2,3,33,36,17,68]))),u=_(()=>Wt(()=>import("./PromptsDrawer-VYrlk-F6.js"),__vite__mapDeps([69,1,11,4,12,13,6,9,2,3,40,29,30,41,70]))),p=_(()=>Wt(()=>import("./GatewayConvertDrawer-BvYhzJD6.js"),__vite__mapDeps([71,1,11,4,12,13,6,2,3,72]))),f=_(()=>Wt(()=>import("./SkillsDrawer-Ch1b1hLn.js"),__vite__mapDeps([73,1,11,4,12,13,37,5,6,33,9,2,3,32,17,23,38,39,40,29,30,41,7,8,42,74]))),m=_(()=>Wt(()=>import("./CommandsDrawer-gG61nb7a.js"),__vite__mapDeps([75,1,11,4,12,13,6,9,2,3,32,5,17,7,8,23,40,29,30,41,76]))),g=_(()=>Wt(()=>import("./AgentsDrawer-DWnAsTH_.js"),__vite__mapDeps([77,1,11,4,12,13,6,9,2,3,32,5,17,23,40,29,30,41,7,8,58,78]))),w=_(()=>Wt(()=>import("./PluginsDrawer-Ch4x66-E.js"),__vite__mapDeps([79,1,11,4,12,13,57,5,6,9,2,3,58,32,17,23,38,29,7,8,59,80]))),k=_(()=>Wt(()=>import("./WorkspaceDrawer-C3w-Z87U.js"),__vite__mapDeps([81,1,11,4,12,13,45,5,23,6,46,9,2,3,47,17,48,82]))),T=_(()=>Wt(()=>import("./ConfigTemplatesDrawer-DMPO4gjt.js"),__vite__mapDeps([83,1,11,4,12,13,51,5,23,6,46,9,2,3,40,29,30,41,47,35,52,84]))),A=_(()=>Wt(()=>import("./ConfigExportDrawer-BkSzLSuZ.js"),__vite__mapDeps([85,1,11,4,12,13,47,23,5,39,6,9,2,3,86]))),{isDark:z,toggleTheme:M}=_f(),{getProxyState:O,startProxy:B,stopProxy:D}=Lf(),{totalFavorites:L}=Uf(),{dashboardData:H,isLoading:U,loadDashboard:W}=Wf(),N=E(),V=q(),G=I(()=>V.name),Y=I(()=>re(V)||null),Z=I(()=>{const e=[{label:"配置模板",key:"config-templates"},{label:"配置导入/导出",key:"config-export"},{type:"divider",key:"divider-1"},{label:"使用帮助",key:"help"},{label:"GitHub 仓库",key:"github"}];return["opencode","omp"].includes(Y.value)&&e.unshift({label:"CLI 请求转换",key:"gateway-convert"}),e}),{enabledPlatforms:ee}=jt(),oe=I(()=>ee.value.find(e=>e.key===Y.value)||null),te=I(()=>!0===oe.value?.capabilities?.nativeLogs),ae=I(()=>le(ee.value)),ie=I(()=>V.path),se=J(!0),de=J(!0),ce=I(()=>Y.value&&(se.value||de.value&&te.value)),ue=J(!1),pe=J(!1),he=J(!1),fe=J(!1),me=J(!1),ve=J(!1),ge=J(!1),be=J(!1),ye=J(!1),xe=J(!1),Ce=J(!1),we=J(""),Se=J(""),ke=J(!1),Pe=J(""),Ie=J(!1),Te=J(""),Ae=J(!1),ze=J(""),Re=J(""),Me=J(!1),Fe=J(null),Oe=J(null),Be=J(null),$e=P(new Set);function Ee(e){return $e.has(e)}C([Be,Fe,Oe,Me],([e,o,,n])=>{e&&o&&n&&e.open()},{flush:"post"});const De=J([]),_e=J(!1),Le=J(!1),He=J(!1),je=J(""),Ue=J(""),We=J(!1),Ne=I(()=>Le.value&&!He.value);function Ke(){je.value="",Ue.value="",We.value=!1}async function Ve(){if(je.value){We.value=!0,Ue.value="";try{const e=await async function(e){return(await Dt.post("/security/verify",{password:e})).data}(je.value);e.success?(He.value=!0,Ke()):Ue.value=e.error||"密码错误"}catch(e){Ue.value=e.response?.data?.error||"密码错误"}finally{We.value=!1}}else Ue.value="请输入密码"}async function qe(){try{const e=await Qp();e.success&&(De.value=e.conflicts||[],0===De.value.length&&(_e.value=!1))}catch(e){}}function Ge(){_e.value=!1}function Je(){_e.value=!1,localStorage.setItem("envConflictNeverRemind","true")}const Ye=J(!1),Ze=I(()=>Boolean(O(Y.value)?.value?.running)),Xe=I(()=>Boolean(O(Y.value)?.value?.loading));function Qe(e,o){!function(e){$e.add(e)}(e),o.value=!0}function eo(){Qe("recent",ue)}function oo(){Qe("favorites",pe)}function no(){Qe("settings",he)}function to(){Qe("mcp",fe)}function ro(){Qe("prompts",me)}function ao(){Qe("workspace",be)}function lo(e){"gateway-convert"!==e?"config-templates"!==e?"config-export"!==e?"help"!==e?"github"===e&&window.open("https://github.com/ZeaoZhang/coding-tool","_blank"):ge.value=!0:Qe("config-export",xe):Qe("config-templates",ye):mo()}async function io(e){const o=Y.value;if(!o)return;const n=function(e=Y.value){return O(e)}(o);n.value.loading=!0;try{let n;n=e?await B(o):await D(o,{refreshChannelsDrawer:!0}),!1!==n.success?(nh.success("omp"===o?e?"OMP 动态切换已启用":"OMP 已切换为单渠道直连模式":e?"代理已启动":"代理已停止"),e&&(de.value=!0),async function(){try{await ne("panelVisibility","showChannels",se.value),await ne("panelVisibility","showLogs",de.value)}catch(e){}}()):nh.error(n.error||"操作失败")}catch(t){nh.error(t.response?.data?.error||t.message||"操作失败")}finally{n.value.loading=!1}}function co(e){const{showChannels:o,showLogs:n}=e.detail;se.value=o,de.value=n}function uo(e){we.value=e?.detail?.platform||"",Se.value=e?.detail?.cwd||e?.detail?.projectPath||"",Qe("skills",Ce)}function po(e){Pe.value=e?.detail?.platform||"",Qe("commands",ke)}function ho(e){Te.value=e?.detail?.platform||"",Qe("agents",Ie)}function fo(e){ze.value=e?.detail?.platform||"",Re.value=e?.detail?.cwd||e?.detail?.projectPath||"",Qe("plugins",Ae)}function mo(){["opencode","omp"].includes(Y.value)&&Qe("gateway",ve)}function vo({session:e,channel:o}){Fe.value=e,Oe.value=o,Me.value=!0}return b(()=>{!async function(){Ye.value=!0;try{const e=await xh();Le.value=Boolean(e?.success&&e.hasPassword),He.value=!Le.value,Le.value||Ke()}catch(e){Le.value=!1,He.value=!0,Ke()}finally{Ye.value=!1}}(),async function(){try{const e=await W();e&&e.uiConfig&&(se.value=!1!==e.uiConfig.panelVisibility?.showChannels,de.value=!1!==e.uiConfig.panelVisibility?.showLogs)}catch(e){}}(),window.addEventListener("panel-visibility-change",co),window.addEventListener("open-skills-drawer",uo),window.addEventListener("open-commands-drawer",po),window.addEventListener("open-agents-drawer",ho),window.addEventListener("open-plugins-drawer",fo),window.addEventListener("open-gateway-convert-drawer",mo),async function(){try{const e=await Qp();e.success&&e.conflicts?.length>0&&(De.value=e.conflicts,"true"!==localStorage.getItem("envConflictNeverRemind")&&(_e.value=!0))}catch(e){}}()}),l(()=>{window.removeEventListener("panel-visibility-change",co),window.removeEventListener("open-skills-drawer",uo),window.removeEventListener("open-commands-drawer",po),window.removeEventListener("open-agents-drawer",ho),window.removeEventListener("open-plugins-drawer",fo),window.removeEventListener("open-gateway-convert-drawer",mo)}),C(()=>Y.value,e=>{!["opencode","omp"].includes(e)&&ve.value&&(ve.value=!1)}),(e,l)=>{const b=s("router-link"),C=s("router-view");return y(),X("div",cb,[h(yh,{visible:_e.value,"onUpdate:visible":l[0]||(l[0]=e=>_e.value=e),conflicts:De.value,onDeleted:qe,onClose:l[1]||(l[1]=e=>_e.value=!1),onIgnore:Ge,onNeverRemind:Je},null,8,["visible","conflicts"]),h(j(Nn),{show:Ne.value,preset:"card",title:"验证访问密码","mask-closable":!1,"close-on-esc":!1,closable:!1,style:{width:"460px","max-width":"92vw"}},{default:R(()=>[Q("div",ub,[h(j(qp),{depth:"3",style:{"font-size":"13px"}},{default:R(()=>[...l[21]||(l[21]=[t(" 请输入访问密码后进入面板 ",-1)])]),_:1}),h(j($l),{value:je.value,"onUpdate:value":l[2]||(l[2]=e=>je.value=e),type:"password",placeholder:"访问密码","show-password-on":"click",autofocus:"",onKeydown:K(Ve,["enter"])},null,8,["value"]),Ue.value?(y(),v(j(qp),{key:0,depth:"3",class:"panel-security-error"},{default:R(()=>[t(S(Ue.value),1)]),_:1})):n("",!0),h(j(qp),{depth:"3",class:"panel-security-hint"},{default:R(()=>[l[23]||(l[23]=t(" 忘记密码可在终端执行 ",-1)),h(j(qp),{code:""},{default:R(()=>[...l[22]||(l[22]=[t("ctx security reset",-1)])]),_:1}),l[24]||(l[24]=t(" 关闭密码 ",-1))]),_:1}),h(j(Nd),{justify:"end",style:{"margin-top":"16px"}},{default:R(()=>[h(j(Po),{type:"primary",loading:We.value,onClick:Ve},{default:R(()=>[...l[25]||(l[25]=[t(" 验证 ",-1)])]),_:1},8,["loading"])]),_:1})])]),_:1},8,["show"]),Q("header",pb,[h(b,{class:"logo-section",to:{name:"home"},"aria-label":"返回首页"},{default:R(()=>[Q("div",hb,[Q("img",{src:"/logo.png",alt:`${Ib} logo`,class:"logo-image"},null,8,fb)]),Q("div",{class:"title-group"},[Q("h1",{class:"title-main"},S(Ib)),l[26]||(l[26]=Q("span",{class:"title-sub"},"AI 编程工作台",-1))])]),_:1}),Q("div",mb,[Q("div",{class:$(["nav-tab",{active:"home"===G.value}]),onClick:l[3]||(l[3]=e=>j(N).push({name:"home"}))},[h(j(so),{size:18,class:"nav-icon"},{default:R(()=>[h(j(tt))]),_:1}),l[27]||(l[27]=Q("span",{class:"nav-label"},"Home",-1))],2),(y(!0),X(F,null,d(ae.value,e=>(y(),X("div",{key:e.key,class:$(["nav-tab",{active:Y.value===e.key}]),onClick:o=>j(N).push({name:"cli-projects",params:{platform:e.key}})},[h(j(so),{size:18,class:"nav-icon"},{default:R(()=>[(y(),v(x(e.icon)))]),_:2},1024),Q("span",gb,S(e.label),1)],10,vb))),128)),Q("div",{class:$(["nav-tab",{active:"analytics"===G.value}]),onClick:l[4]||(l[4]=e=>j(N).push({name:"analytics"}))},[h(j(so),{size:18,class:"nav-icon"},{default:R(()=>[h(j(It))]),_:1}),l[28]||(l[28]=Q("span",{class:"nav-label"},"Analytics",-1))],2)]),Q("div",bb,[De.value.length>0?(y(),v(j(fs),{key:0,trigger:"hover"},{trigger:R(()=>[Q("div",{class:"env-warning-btn",onClick:l[5]||(l[5]=e=>_e.value=!0)},[h(j(so),{size:18,class:"env-warning-icon"},{default:R(()=>[h(j(Tt))]),_:1}),Q("span",yb,S(De.value.length),1)])]),default:R(()=>[t(" 检测到 "+S(De.value.length)+" 个环境变量冲突,点击查看 ",1)]),_:1})):n("",!0),h(Xp,{icon:j(z)?j(wt):j(ut),tooltip:j(z)?"切换到亮色主题":"切换到暗色主题",onClick:j(M)},null,8,["icon","tooltip","onClick"]),l[29]||(l[29]=Q("div",{class:"header-divider"},null,-1)),Q("div",xb,[h(Xp,{icon:j(rt),tooltip:`我的收藏 (${j(L)})`,onClick:oo},null,8,["icon","tooltip"]),j(L)>0?(y(),X("div",Cb,S(j(L)),1)):n("",!0)]),h(Xp,{icon:j(at),tooltip:"工作区管理",onClick:ao},null,8,["icon"]),h(Xp,{icon:j(Mt),tooltip:"Prompts 管理",onClick:ro},null,8,["icon"]),h(Xp,{icon:j(yt),tooltip:"MCP 服务器管理",onClick:to},null,8,["icon"]),h(Xp,{icon:j(Ct),tooltip:"设置",onClick:no},null,8,["icon"]),h(j(Rs),{trigger:"click",placement:"bottom-end",options:Z.value,onSelect:lo},{default:R(()=>[Q("div",wb,[h(Xp,{icon:j(ft),tooltip:"更多工具"},null,8,["icon"])])]),_:1},8,["options"])])]),Q("div",Sb,[Ye.value?(y(),X("div",kb,[h(j(Hp),{size:"large"},{description:R(()=>[...l[30]||(l[30]=[t(" 加载配置中... ",-1)])]),_:1})])):n("",!0),Q("div",Pb,[h(C,null,{default:R(({Component:e})=>[(y(),v(x(e),{key:ie.value}))]),_:1})]),ce.value?(y(),v(db,{key:1,"show-channels":se.value,"show-logs":de.value,"proxy-running":Ze.value,"proxy-loading":Xe.value,onProxyToggle:io,onShowRecent:eo},null,8,["show-channels","show-logs","proxy-running","proxy-loading"])):n("",!0)]),Ee("recent")?(y(),v(j(o),{key:0,visible:ue.value,"onUpdate:visible":l[6]||(l[6]=e=>ue.value=e),channel:Y.value},null,8,["visible","channel"])):n("",!0),Ee("favorites")?(y(),v(j(r),{key:1,visible:pe.value,"onUpdate:visible":l[7]||(l[7]=e=>pe.value=e),onViewHistory:vo},null,8,["visible"])):n("",!0),Fe.value?(y(),v(j(a),{key:2,ref_key:"chatHistoryRef",ref:Be,show:Me.value,"onUpdate:show":l[8]||(l[8]=e=>Me.value=e),"project-name":Fe.value.projectName,"session-id":Fe.value.sessionId,"session-alias":Fe.value.alias,channel:Oe.value},null,8,["show","project-name","session-id","session-alias","channel"])):n("",!0),Ee("settings")?(y(),v(j(i),{key:3,visible:he.value,"onUpdate:visible":l[9]||(l[9]=e=>he.value=e)},null,8,["visible"])):n("",!0),Ee("mcp")?(y(),v(j(c),{key:4,visible:fe.value,"onUpdate:visible":l[10]||(l[10]=e=>fe.value=e)},null,8,["visible"])):n("",!0),Ee("prompts")?(y(),v(j(u),{key:5,visible:me.value,"onUpdate:visible":l[11]||(l[11]=e=>me.value=e)},null,8,["visible"])):n("",!0),["opencode","omp"].includes(Y.value)&&Ee("gateway")?(y(),v(j(p),{key:6,target:Y.value,visible:ve.value,"onUpdate:visible":l[12]||(l[12]=e=>ve.value=e)},null,8,["target","visible"])):n("",!0),Ee("workspace")?(y(),v(j(k),{key:7,visible:be.value,"onUpdate:visible":l[13]||(l[13]=e=>be.value=e)},null,8,["visible"])):n("",!0),Ee("config-templates")?(y(),v(j(T),{key:8,visible:ye.value,"onUpdate:visible":l[14]||(l[14]=e=>ye.value=e)},null,8,["visible"])):n("",!0),Ee("config-export")?(y(),v(j(A),{key:9,visible:xe.value,"onUpdate:visible":l[15]||(l[15]=e=>xe.value=e)},null,8,["visible"])):n("",!0),Ee("skills")?(y(),v(j(f),{key:10,visible:Ce.value,"onUpdate:visible":l[16]||(l[16]=e=>Ce.value=e),platform:we.value,"project-path":Se.value},null,8,["visible","platform","project-path"])):n("",!0),Ee("commands")?(y(),v(j(m),{key:11,visible:ke.value,"onUpdate:visible":l[17]||(l[17]=e=>ke.value=e),platform:Pe.value},null,8,["visible","platform"])):n("",!0),Ee("agents")?(y(),v(j(g),{key:12,visible:Ie.value,"onUpdate:visible":l[18]||(l[18]=e=>Ie.value=e),platform:Te.value},null,8,["visible","platform"])):n("",!0),Ee("plugins")?(y(),v(j(w),{key:13,visible:Ae.value,"onUpdate:visible":l[19]||(l[19]=e=>Ae.value=e),platform:ze.value,"project-path":Re.value},null,8,["visible","platform","project-path"])):n("",!0),h(j(Nn),{show:ge.value,"onUpdate:show":l[20]||(l[20]=e=>ge.value=e),preset:"card",title:`${Ib} 使用帮助`,style:{width:"800px","max-width":"90vw"}},{default:R(()=>[Q("div",{class:"help-content"},[Q("div",{class:"help-section"},[l[31]||(l[31]=Q("h4",null,"[START] 快速开始",-1)),Q("p",null,S(Ib)+" 是面向 Claude Code、Codex、Gemini 和 OpenCode 的统一 AI 编程工作台,提供会话管理、动态渠道切换、全局搜索与实时监控能力。"),l[32]||(l[32]=Q("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"[STAR] 最简单的启动方式:",-1)),l[33]||(l[33]=Q("div",{style:{background:"var(--bg-primary)",padding:"12px","border-radius":"6px",margin:"8px 0","border-left":"3px solid #18a058"}},[Q("p",{style:{margin:"0","font-family":"'Courier New', monospace","font-size":"13px","font-weight":"600",color:"var(--primary-color)"}},"ctx start"),Q("p",{style:{margin:"4px 0 0 0","font-size":"12px",color:"var(--text-secondary)"}},[t("• 后台启动所有服务"),Q("br"),t("• 可以关闭终端窗口"),Q("br"),t("• 代理服务保持运行")])],-1)),l[34]||(l[34]=Q("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"[LOG] 日常工作流:",-1)),l[35]||(l[35]=Q("div",{style:{"font-size":"12px","line-height":"1.8",color:"var(--text-secondary)"}},[Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx start"),t(" 启动服务"),Q("br"),Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx status"),t(" 查看状态"),Q("br"),Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx logs"),t(" 查看日志"),Q("br"),Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx stop"),t(" 停止服务 ")],-1))]),l[44]||(l[44]=Q("div",{class:"help-section"},[Q("h4",null,"[AI] 支持的 AI 工具"),Q("ul",null,[Q("li",null,[Q("strong",null,"Claude Code"),t(":Anthropic 官方命令行工具,支持 Claude 系列模型")]),Q("li",null,[Q("strong",null,"Codex"),t(":支持 OpenAI GPT 系列和 Claude 模型(通过 OpenAI 兼容格式)")]),Q("li",null,[Q("strong",null,"Gemini"),t(":支持 Google Gemini 系列模型")])])],-1)),l[45]||(l[45]=Q("div",{class:"help-section"},[Q("h4",null,"[LOG] 命令行用法"),Q("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[START] 服务管理"),Q("div",{class:"command-list"},[Q("div",{class:"command-item"},[Q("code",null,"ctx start"),Q("span",null,"后台启动所有服务(推荐)")]),Q("div",{class:"command-item"},[Q("code",null,"ctx stop"),Q("span",null,"停止所有服务")]),Q("div",{class:"command-item"},[Q("code",null,"ctx restart"),Q("span",null,"重启所有服务")]),Q("div",{class:"command-item"},[Q("code",null,"ctx status"),Q("span",null,"查看服务状态")])]),Q("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[PROXY] 代理管理"),Q("div",{class:"command-list"},[Q("div",{class:"command-item"},[Q("code",null,"ctx claude start"),Q("span",null,"启动 Claude 代理")]),Q("div",{class:"command-item"},[Q("code",null,"ctx codex start"),Q("span",null,"启动 Codex 代理")]),Q("div",{class:"command-item"},[Q("code",null,"ctx gemini start"),Q("span",null,"启动 Gemini 代理")]),Q("div",{class:"command-item"},[Q("code",null,"ctx claude stop"),Q("span",null,"停止指定代理(支持 stop/restart/status)")])]),Q("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[LOG] 日志管理"),Q("div",{class:"command-list"},[Q("div",{class:"command-item"},[Q("code",null,"ctx logs"),Q("span",null,"查看所有日志")]),Q("div",{class:"command-item"},[Q("code",null,"ctx logs claude"),Q("span",null,"查看 Claude 日志(支持 ui/codex/gemini)")]),Q("div",{class:"command-item"},[Q("code",null,"ctx logs --follow"),Q("span",null,"实时跟踪日志")]),Q("div",{class:"command-item"},[Q("code",null,"ctx logs --clear"),Q("span",null,"清空日志")])]),Q("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[STATS] 其他命令"),Q("div",{class:"command-list"},[Q("div",{class:"command-item"},[Q("code",null,"ctx stats"),Q("span",null,"查看统计信息")]),Q("div",{class:"command-item"},[Q("code",null,"ctx doctor"),Q("span",null,"系统诊断")]),Q("div",{class:"command-item"},[Q("code",null,"ctx -h"),Q("span",null,"完整帮助")])])],-1)),l[46]||(l[46]=Q("div",{class:"help-section"},[Q("h4",null,"[TARGET] Web UI 功能"),Q("ul",null,[Q("li",null,[Q("strong",null,"多类型支持"),t(":统一管理 Claude Code、Codex、Gemini 三种工具的项目和会话")]),Q("li",null,[Q("strong",null,"项目管理"),t(":查看所有项目,支持拖拽排序、搜索过滤、删除项目")]),Q("li",null,[Q("strong",null,"会话管理"),t(":查看项目会话列表,支持搜索、Fork、删除、重命名")]),Q("li",null,[Q("strong",null,"快速启动"),t(":点击会话可直接复制对应 AI 工具启动命令")]),Q("li",null,[Q("strong",null,"动态切换"),t(":每种工具独立的渠道管理,可在右侧面板快速切换 API 渠道")]),Q("li",null,[Q("strong",null,"实时日志"),t(":查看各类型代理的实时请求日志、token 消耗和成本统计")]),Q("li",null,[Q("strong",null,"全局搜索"),t(":使用 "),Q("kbd",null,"Cmd/Ctrl"),t(" + "),Q("kbd",null,"K"),t(" 在所有项目中搜索对话内容")])])],-1)),l[47]||(l[47]=Q("div",{class:"help-section"},[Q("h4",null,"[BOLT] 代理服务与渠道管理"),Q("p",null,"每种 AI 工具都有独立的代理服务和渠道配置:"),Q("ul",null,[Q("li",null,[Q("strong",null,"Claude 代理"),t(":端口 20088,支持 Anthropic API 格式")]),Q("li",null,[Q("strong",null,"Codex 代理"),t(":端口 20089,支持 OpenAI API 格式(兼容 Claude)")]),Q("li",null,[Q("strong",null,"Gemini 代理"),t(":端口 20090,支持 Gemini API 格式")])]),Q("p",null,"在 Dashboard 或各工具详情页,可以添加多个渠道并快速切换,无需修改配置文件或重启工具。")],-1)),Q("div",{class:"help-section"},[l[36]||(l[36]=Q("h4",null,"[STAR] 后台启动与开机自启",-1)),l[37]||(l[37]=Q("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"后台启动服务",-1)),l[38]||(l[38]=Q("p",{style:{"font-size":"12px","line-height":"1.8"}},[t("使用 "),Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx start"),t(" 命令后台启动所有服务,可以安全关闭终端窗口而不影响代理服务的运行。")],-1)),l[39]||(l[39]=Q("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"配置开机自启(可选)",-1)),l[40]||(l[40]=Q("p",{style:{"font-size":"12px",color:"var(--text-secondary)",margin:"0 0 8px 0"}},"第一次启用开机自启只需三个步骤:",-1)),l[41]||(l[41]=Q("div",{style:{background:"var(--bg-primary)",padding:"12px","border-radius":"6px",margin:"8px 0","border-left":"3px solid #18a058","font-family":"'Courier New', monospace","font-size":"11px","line-height":"1.8",color:"var(--text-secondary)"}},[t(" # 第 1 步:启用 PM2 开机自启"),Q("br"),Q("span",{style:{color:"var(--primary-color)"}},"pm2 startup"),Q("br"),Q("br"),t(" # 第 2 步:保存配置"),Q("br"),Q("span",{style:{color:"var(--primary-color)"}},"pm2 save"),Q("br"),Q("br"),t(" # 第 3 步:重启电脑,服务自动启动 [v] ")],-1)),l[42]||(l[42]=Q("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"相关命令",-1)),l[43]||(l[43]=Q("div",{style:{"font-size":"12px",color:"var(--text-secondary)","line-height":"1.8"}},[Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx start"),t(" 后台启动"),Q("br"),Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx status"),t(" 查看状态"),Q("br"),Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx logs"),t(" 查看日志"),Q("br"),Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"pm2 list"),t(" 查看所有后台进程"),Q("br"),Q("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"pm2 unstartup"),t(" 禁用开机自启 ")],-1)),Q("p",{style:{color:"#18a058","font-size":"12px","margin-top":"8px"}},"[TIP] 提示:配置开机自启后,重启电脑时 "+S(Ib)+" 会自动启动,无需手动运行命令。")]),l[48]||(l[48]=Q("div",{class:"help-section"},[Q("h4",null,"[LINK] 相关链接"),Q("div",{class:"link-list"},[Q("a",{href:"https://github.com/ZeaoZhang/coding-tool",target:"_blank"},"GitHub 仓库"),Q("a",{href:"https://github.com/ZeaoZhang/coding-tool/issues",target:"_blank"},"问题反馈")])],-1))])]),_:1},8,["show","title"])])}}},Ab=To(Tb,[["__scopeId","data-v-182ef64e"]]),zb={__name:"App",setup(e){const{isDark:o,loadTheme:n}=_f(),t=I(()=>o.value?Yp:null),r=I(()=>o.value?{common:{primaryColor:"#18a058",primaryColorHover:"#1db165",primaryColorPressed:"#0c7a43",fontFamily:'"SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',fontFamilyMono:'"SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", monospace',borderRadius:"16px",borderRadiusSmall:"12px",bodyColor:"#0a1116",cardColor:"#121b22",modalColor:"#121b22",popoverColor:"#121b22",tableColor:"#121b22",inputColor:"#16222a",codeColor:"#0d171d",tabColor:"#121b22",actionColor:"#16222a",tableHeaderColor:"#16222a",hoverColor:"rgba(255, 255, 255, 0.08)",pressedColor:"rgba(255, 255, 255, 0.12)",borderColor:"#263740",dividerColor:"#263740"},Drawer:{color:"#121b22",headerColor:"#121b22",footerColor:"#121b22"},Modal:{color:"#121b22",boxShadow:"0 24px 64px rgba(0, 0, 0, 0.42)"},Card:{color:"#121b22",borderColor:"#263740"},Popover:{color:"#121b22",textColor:"#edf5f4",boxShadow:"0 20px 48px rgba(0, 0, 0, 0.34)"},Tooltip:{color:"#121b22",textColor:"#edf5f4",boxShadow:"0 20px 48px rgba(0, 0, 0, 0.34)"},Dialog:{color:"#121b22"},Button:{borderRadiusMedium:"12px"},Input:{borderRadius:"12px"}}:{common:{primaryColor:"#18a058",primaryColorHover:"#1db165",primaryColorPressed:"#0c7a43",fontFamily:'"SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',fontFamilyMono:'"SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", monospace',borderRadius:"16px",borderRadiusSmall:"12px",bodyColor:"#f4f7f8",cardColor:"#ffffff",modalColor:"#ffffff",popoverColor:"#ffffff",tableColor:"#ffffff",inputColor:"#f7faf8",codeColor:"#edf3f1",tabColor:"#ffffff",actionColor:"#f7faf8",tableHeaderColor:"#edf3f1",hoverColor:"rgba(24, 160, 88, 0.08)",pressedColor:"rgba(24, 160, 88, 0.12)",borderColor:"#d8e1de",dividerColor:"#d8e1de"},Modal:{color:"#ffffff",boxShadow:"0 24px 64px rgba(15, 23, 29, 0.16)"},Card:{color:"#ffffff",borderColor:"#d8e1de"},Popover:{color:"#ffffff",textColor:"#122025",boxShadow:"0 18px 42px rgba(15, 23, 29, 0.12)"},Tooltip:{color:"rgba(18, 32, 37, 0.94)",textColor:"#f7faf8",boxShadow:"0 18px 42px rgba(15, 23, 29, 0.18)"},Drawer:{color:"#ffffff",headerColor:"#ffffff",footerColor:"#ffffff"},Button:{borderRadiusMedium:"12px"},Input:{borderRadius:"12px"}});return b(()=>{n()}),(e,o)=>(y(),v(j($i),{theme:t.value,"theme-overrides":r.value},{default:R(()=>[h(j(qs),null,{default:R(()=>[h(j(pd),null,{default:R(()=>[h(Ab)]),_:1})]),_:1})]),_:1},8,["theme","theme-overrides"]))}};!async function(){const e=A(zb),o=k();e.use(o);const n=se(o),{loadUIConfig:t}=ie();await Promise.all([n.load(),t()]),e.use(Kt),e.mount("#app"),Hf()}();export{Hi as $,qp as A,au as B,gf as C,tr as Ct,Ch as D,xh as E,jt as Et,xp as F,js as G,Nd as H,pp as I,Rs as J,Ds as K,Bu as L,Hp as M,$p as N,th as O,Ip as P,Wi as Q,Su as R,xf as S,sr as St,kh as T,Vt as Tt,jd as U,Mc as V,Ed as W,hs as X,fs as Y,us as Z,Uf as _,hr as _t,Vg as a,ni as at,Cf as b,cr as bt,Lg as c,Sl as ct,Wg as d,tl as dt,Di as et,Ug as f,Xa as ft,Wf as g,vr as gt,Xg as h,xr as ht,Ng as i,Ci as it,Kp as j,nh as k,Hg as l,Cl as lt,Kg as m,Sr as mt,qg as n,Ti as nt,jg as o,Ll as ot,Zg as p,Ja as pt,Os as q,Qg as r,Si as rt,Gg as s,$l as st,Jg as t,Ri as tt,Yg as u,cl as ut,Lf as v,pr as vt,Sh as w,qt as wt,wf as x,dr as xt,_f as y,ur as yt,mu as z};