coding-tool-x 3.9.1 → 3.9.3-260928
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.
- package/README.md +1 -1
- package/dist/web/assets/{AgentsDrawer-CobzHziM.css → AgentsDrawer-Dubq1kQI.css} +1 -1
- package/dist/web/assets/AgentsDrawer-x29vGIIi.js +1 -0
- package/dist/web/assets/{Analytics-DTIvvMXu.js → Analytics-BJbR6XJO.js} +1 -1
- package/dist/web/assets/{AssetPathField-jv-lopQ3.js → AssetPathField-2W-16zgR.js} +1 -1
- package/dist/web/assets/{ChatHistoryDrawer-T4OVnJzM.js → ChatHistoryDrawer-C1URzQ_4.js} +1 -1
- package/dist/web/assets/{CollapseItem-P6BvSxEu.js → CollapseItem-DjkOkbwE.js} +1 -1
- package/dist/web/assets/{CommandsDrawer-DtFJRtow.js → CommandsDrawer-DcnfrHC4.js} +1 -1
- package/dist/web/assets/{ConfigExportDrawer-Di7KXhVS.js → ConfigExportDrawer-CKwG_RGJ.js} +1 -1
- package/dist/web/assets/{ConfigTemplates-VdKE5Kp0.js → ConfigTemplates-C1tNpfzi.js} +1 -1
- package/dist/web/assets/{ConfigTemplatesDrawer-bQvPnUQ0.js → ConfigTemplatesDrawer-gZNPbcUR.js} +1 -1
- package/dist/web/assets/{ConfigTemplatesPanel-ChdyQ3C6.js → ConfigTemplatesPanel-C-Fy53Qo.js} +1 -1
- package/dist/web/assets/{FavoritesDrawer-A25XfI7C.js → FavoritesDrawer-Bp8FYHPk.js} +1 -1
- package/dist/web/assets/GatewayConvertDrawer-CvUkvNQy.css +1 -0
- package/dist/web/assets/GatewayConvertDrawer-j5IJzb2Y.js +1 -0
- package/dist/web/assets/Home-2MAvBnml.js +1 -0
- package/dist/web/assets/Home-BRNWE0Qy.css +1 -0
- package/dist/web/assets/{MarkdownEditor-BXwTqbMo.js → MarkdownEditor-BA_PcLed.js} +1 -1
- package/dist/web/assets/{McpDrawer-DIaiFq4R.js → McpDrawer-DAep5PP_.js} +1 -1
- package/dist/web/assets/{McpFormDrawer-CQgTYAux.js → McpFormDrawer-BRm-hzv1.js} +1 -1
- package/dist/web/assets/{PluginManager-BkGrr21J.js → PluginManager-C2yY8-FP.js} +1 -1
- package/dist/web/assets/{PluginsDrawer-Bq1JkM5r.js → PluginsDrawer-CxKnWzTO.js} +1 -1
- package/dist/web/assets/{PluginsPanel-CzGMK-Ap.css → PluginsPanel-DsmiW9TU.css} +1 -1
- package/dist/web/assets/PluginsPanel-DtbXSoXu.js +1 -0
- package/dist/web/assets/{ProjectList-QIC7-9ic.js → ProjectList-Cb25pa2s.js} +1 -1
- package/dist/web/assets/{PromptsDrawer-BLeUYZWW.js → PromptsDrawer-D39OJVRP.js} +1 -1
- package/dist/web/assets/{RecentSessionsDrawer-yOpScIwI.js → RecentSessionsDrawer-DkCjc4kS.js} +1 -1
- package/dist/web/assets/{SessionCard-DeKRHAzu.js → SessionCard-5Mwig8zy.js} +1 -1
- package/dist/web/assets/{SessionList-B0fPT_VB.js → SessionList-DVkIlraF.js} +1 -1
- package/dist/web/assets/{SettingsDrawer-DpZoDj3M.js → SettingsDrawer-Cr9qZDgO.js} +1 -1
- package/dist/web/assets/{SkillManager-BpPqV2o4.js → SkillManager-D935sPSV.js} +1 -1
- package/dist/web/assets/{SkillsDrawer-BgMlJbgS.js → SkillsDrawer-D1_3j74b.js} +1 -1
- package/dist/web/assets/{SkillsPanel-CK-pSSHU.js → SkillsPanel-6SehnNG8.js} +1 -1
- package/dist/web/assets/{Upload-DtuQ7ady.js → Upload-38eKB6wv.js} +1 -1
- package/dist/web/assets/{WorkspaceDrawer-Bu5mOGsF.js → WorkspaceDrawer-Bkfmlr5M.js} +1 -1
- package/dist/web/assets/{WorkspaceManager-D1mhnNV-.js → WorkspaceManager-DFVQ5YoE.js} +1 -1
- package/dist/web/assets/{WorkspacePanel-BIrkMC_5.js → WorkspacePanel-CEnogXEv.js} +1 -1
- package/dist/web/assets/client-oU6RT-6I.js +1 -0
- package/dist/web/assets/dsh-agent-presets-DjJRVMT6.js +1 -0
- package/dist/web/assets/index-CCATqHAD.js +2 -0
- package/dist/web/assets/index-p-yggtLj.css +1 -0
- package/dist/web/assets/{platforms-DrzAtnjY.js → platforms-DILqyP72.js} +1 -1
- package/dist/web/assets/platforms-JV36QBCw.js +1 -0
- package/dist/web/assets/{project-config-BVt5s-pH.js → project-config-CzFKBw_m.js} +1 -1
- package/dist/web/assets/{sessions-CaWUaysM.js → sessions-WXODMvLY.js} +1 -1
- package/dist/web/assets/{sessions-53-Fr68H.js → sessions-wvj5oaYr.js} +1 -1
- package/dist/web/assets/{useResponsiveDrawer-C-UacYVP.js → useResponsiveDrawer-BWRBXImg.js} +1 -1
- package/dist/web/assets/{workspaces-DQuZd4qw.js → workspaces-D2yLnT-B.js} +1 -1
- package/dist/web/index.html +5 -5
- package/package.json +4 -4
- package/src/config/model-metadata.json +143 -7
- package/src/platforms/drivers/dsh/api-operations.js +60 -2
- package/src/platforms/drivers/dsh/common.js +222 -11
- package/src/platforms/drivers/dsh/native-config.js +2 -2
- package/src/platforms/drivers/dsh/native-logs.js +16 -1
- package/src/platforms/drivers/dsh/plugin-manager.js +64 -6
- package/src/platforms/drivers/omp/gateway.js +27 -1
- package/src/platforms/drivers/opencode/conversion.js +60 -8
- package/src/platforms/manifest-schema.js +4 -0
- package/src/platforms/manifests/dsh.json +29 -4
- package/src/platforms/manifests/omp.json +2 -1
- package/src/platforms/registry.js +1 -0
- package/src/server/api/convert.js +26 -76
- package/src/server/api/platforms.js +1 -0
- package/src/server/services/model-detector.js +13 -22
- package/src/server/services/native-log-observer.js +1 -0
- package/src/server/services/plugins-service.js +13 -14
- package/src/server/services/request-logger.js +95 -0
- package/src/server/services/usage-log-utils.js +2 -1
- package/dist/web/assets/AgentsDrawer-MeGfH4I0.js +0 -1
- package/dist/web/assets/GatewayConvertDrawer-CuNlf7AC.css +0 -1
- package/dist/web/assets/GatewayConvertDrawer-TSJPvY4f.js +0 -1
- package/dist/web/assets/Home-CSuFuJ9Y.css +0 -1
- package/dist/web/assets/Home-CzB85lKE.js +0 -1
- package/dist/web/assets/PluginsPanel-Clz1r67v.js +0 -1
- package/dist/web/assets/client-BgcNg4Bt.js +0 -1
- package/dist/web/assets/index-B86H0_5y.css +0 -1
- package/dist/web/assets/index-Bw6YXbBA.js +0 -2
- package/dist/web/assets/platforms-mqqe_82d.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-CzB85lKE.js","assets/_plugin-vue_export-helper-BeLZJZij.js","assets/vue-vendor-BqZbbXHA.js","assets/vendors-D0c_0KLP.js","assets/platforms-mqqe_82d.js","assets/client-BgcNg4Bt.js","assets/icons-B-AzZoeE.js","assets/platforms-DrzAtnjY.js","assets/use-message-DBsCm7FJ.js","assets/RecentSessionsDrawer-yOpScIwI.js","assets/useResponsiveDrawer-C-UacYVP.js","assets/use-lock-html-scroll-DXIqmUW4.js","assets/DrawerContent-ChXgZ1Xm.js","assets/sessions-CaWUaysM.js","assets/clipboard-B46yyoz_.js","assets/SessionCard-DeKRHAzu.js","assets/SessionCard-aM2NHu6i.css","assets/session-visibility-BAmxh3cK.js","assets/RecentSessionsDrawer-yrAD4p1A.css","assets/Home-CSuFuJ9Y.css","assets/ProjectList-QIC7-9ic.js","assets/light-C2X7hegj.js","assets/headers-DbowkmZJ.js","assets/sessions-53-Fr68H.js","assets/ProjectList-VbIYSHbH.css","assets/SessionList-B0fPT_VB.js","assets/AssetPathField-jv-lopQ3.js","assets/McpFormDrawer-CQgTYAux.js","assets/CollapseItem-P6BvSxEu.js","assets/project-config-BVt5s-pH.js","assets/McpFormDrawer-BRbDcawn.css","assets/Forward-DLCL7aMY.js","assets/SkillsPanel-CK-pSSHU.js","assets/Upload-DtuQ7ady.js","assets/markdown-u082bbtj.js","assets/MarkdownEditor-BXwTqbMo.js","assets/xml-CgY3RMlX.js","assets/MarkdownEditor-qfVgSre_.css","assets/skill-repo-input-B_fkGlUK.js","assets/SkillsPanel-C4ke56nF.css","assets/ChatHistoryDrawer-T4OVnJzM.js","assets/ChatHistoryDrawer-B2qBQs9L.css","assets/SessionList-qG_XpPBJ.css","assets/WorkspaceManager-D1mhnNV-.js","assets/WorkspacePanel-BIrkMC_5.js","assets/Divider-BLLhMTSt.js","assets/workspaces-DQuZd4qw.js","assets/WorkspacePanel-D0-zHTHP.css","assets/WorkspaceManager-CrwgQgmP.css","assets/ConfigTemplates-VdKE5Kp0.js","assets/ConfigTemplatesPanel-ChdyQ3C6.js","assets/ConfigTemplatesPanel-CWyPtk67.css","assets/ConfigTemplates-Bidwfdf2.css","assets/SkillManager-BpPqV2o4.js","assets/SkillManager-C0GCT2Kb.css","assets/PluginManager-BkGrr21J.js","assets/PluginsPanel-Clz1r67v.js","assets/PluginsPanel-CzGMK-Ap.css","assets/PluginManager-ROyoZ-6m.css","assets/Analytics-DTIvvMXu.js","assets/Analytics-CyHhR126.css","assets/FavoritesDrawer-A25XfI7C.js","assets/FavoritesDrawer-CG9eI9Ay.css","assets/SettingsDrawer-DpZoDj3M.js","assets/SettingsDrawer-BFzaxbgC.css","assets/McpDrawer-DIaiFq4R.js","assets/McpDrawer-C0dnsZhQ.css","assets/PromptsDrawer-BLeUYZWW.js","assets/PromptsDrawer-BIgiYCEQ.css","assets/GatewayConvertDrawer-TSJPvY4f.js","assets/GatewayConvertDrawer-CuNlf7AC.css","assets/SkillsDrawer-BgMlJbgS.js","assets/SkillsDrawer-BCNme-aJ.css","assets/CommandsDrawer-DtFJRtow.js","assets/CommandsDrawer-BZJxlPvV.css","assets/AgentsDrawer-MeGfH4I0.js","assets/AgentsDrawer-CobzHziM.css","assets/PluginsDrawer-Bq1JkM5r.js","assets/PluginsDrawer-DM3QjprE.css","assets/WorkspaceDrawer-Bu5mOGsF.js","assets/WorkspaceDrawer-CGnMu9p1.css","assets/ConfigTemplatesDrawer-bQvPnUQ0.js","assets/ConfigTemplatesDrawer-BfDi8yO3.css","assets/ConfigExportDrawer-Di7KXhVS.js","assets/ConfigExportDrawer-dwruRKWr.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$t as e,A as o,At as n,C as t,Cn as r,Ct as a,D as l,Dt as i,E as s,F as d,Ft as c,Ht as u,I as p,L as h,Lt as f,M as m,Mt as v,N as g,O as b,Ot as y,P as x,Pt as C,Qt as w,R as S,S as k,Sn as I,St as P,T,Tn as A,Tt as z,Ut as R,Wt as M,Xt as F,Yt as O,Zt as $,_ as B,_t as E,a as D,an as _,b as L,bn as H,bt as j,c as U,cn as W,dn as N,f as K,fn as V,g as q,gn as G,gt as J,h as Y,hn as Z,ht as X,i as Q,j as ee,jt as oe,k as ne,l as te,ln as re,mt as ae,n as le,nn as ie,o as se,on as de,pn as ce,pt as ue,qt as pe,r as he,rn as fe,s as me,sn as ve,t as ge,tn as be,u as ye,un as xe,v as Ce,vn as we,vt as Se,w as ke,x as Ie,xn as Pe,xt as Te,y as Ae,yn as ze,zt as Re}from"./_plugin-vue_export-helper-BeLZJZij.js";import{A as Me,B as Fe,C as Oe,D as $e,F as Be,G as Ee,H as De,I as _e,J as Le,K as He,L as je,M as Ue,N as We,O as Ne,Q as Ke,R as Ve,S as qe,T as Ge,V as Je,W as Ye,Y as Ze,Z as Xe,_ as Qe,_t as eo,a as oo,at as no,b as to,c as ro,d as ao,dt as lo,et as io,f as so,g as co,gt as uo,h as po,ht as ho,i as fo,j as mo,k as vo,l as go,m as bo,mt as yo,n as xo,o as Co,ot as wo,p as So,q as ko,r as Io,rt as Po,st as To,t as Ao,tt as zo,w as Ro,x as Mo,z as Fo}from"./vue-vendor-BqZbbXHA.js";import{n as Oo}from"./vendors-D0c_0KLP.js";import{a as $o,o as Bo,r as Eo,s as Do,t as _o}from"./client-BgcNg4Bt.js";import{a as Lo,c as Ho,d as jo,i as Uo,n as Wo,r as No,t as Ko,u as Vo}from"./platforms-mqqe_82d.js";import{B as qo,Dt as Go,K as Jo,M as Yo,Mt as Zo,Nt as Xo,O as Qo,Ot as en,P as on,R as nn,Y as tn,Z as rn,a as an,bt as ln,dt as sn,ft as dn,h as cn,i as un,m as pn,o as hn,p as fn,pt as mn,r as vn,s as gn,t as bn,tt as yn,u as xn,vt as Cn,wt as wn,xt as Sn,yt as kn}from"./icons-B-AzZoeE.js";import{A as In,C as Pn,D as Tn,E as An,F as zn,N as Rn,O as Mn,S as Fn,T as On,_ as $n,a as Bn,b as En,c as Dn,d as _n,f as Ln,g as Hn,h as jn,i as Un,j as Wn,k as Nn,l as Kn,m as Vn,n as qn,o as Gn,p as Jn,r as Yn,s as Zn,t as Xn,u as Qn,v as et,w as ot,x as nt,y as tt}from"./use-message-DBsCm7FJ.js";import{A as rt,C as at,D as lt,E as it,F as st,I as dt,L as ct,M as ut,N as pt,P as ht,S as ft,T as mt,_ as vt,a as gt,b as bt,c as yt,d as xt,f as Ct,g as wt,h as St,i as kt,j as It,k as Pt,l as Tt,m as At,n as zt,o as Rt,p as Mt,r as Ft,s as Ot,t as $t,u as Bt,v as Et,w as Dt,x as _t,y as Lt}from"./light-C2X7hegj.js";function Ht({platformStore:e,configRef:o}={}){const n=e||Ko(),{uiConfig:t}=Lo(),r=o||t,a=to(()=>n.all||n.platforms||[]),l=to(()=>Uo({catalog:a.value,enabledCliPlatforms:r.value?.enabledCliPlatforms})),i=to(()=>new Map(a.value.map(e=>[e.key,e]))),s=to(()=>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 jt={},Ut=function(e,o,n){let t=Promise.resolve();if(o&&o.length>0){const e=document.getElementsByTagName("link"),n=document.querySelector("meta[property=csp-nonce]"),a=n?.nonce||n?.getAttribute("nonce");r=o.map(o=>{var n;if(o=function(e){return"/"+e}(o),n=o,(o=import.meta.resolve?import.meta.resolve(n):new URL(n,import.meta.url).href)in jt)return;jt[o]=!0;const t=o.endsWith(".css");for(let a=e.length-1;a>=0;a--){const n=e[a];if(n.href===o&&(!t||"stylesheet"===n.rel))return}const r=document.createElement("link");return r.rel=t?"stylesheet":"modulepreload",t||(r.as="script"),r.crossOrigin="",r.href=o,a&&r.setAttribute("nonce",a),document.head.appendChild(r),t?new Promise((e,n)=>{r.addEventListener("load",e),r.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${o}`)))}):void 0}),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 Wt=[{path:"/",name:"home",component:()=>Ut(()=>import("./Home-CzB85lKE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))},{path:"/cli/:platform",name:"cli-projects",component:()=>Ut(()=>import("./ProjectList-QIC7-9ic.js"),__vite__mapDeps([20,1,2,4,5,3,6,7,21,8,11,22,14,13,23,17,24])),meta:{requiresCli:!0}},{path:"/cli/:platform/sessions/:projectName",name:"cli-sessions",component:()=>Ut(()=>import("./SessionList-B0fPT_VB.js"),__vite__mapDeps([25,1,2,4,5,3,6,7,8,21,11,26,14,27,28,10,12,29,30,31,22,32,33,34,35,36,37,38,39,13,40,41,23,17,42])),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:()=>Ut(()=>import("./WorkspaceManager-D1mhnNV-.js"),__vite__mapDeps([43,1,2,21,8,11,44,6,45,14,46,5,3,47,48]))},{path:"/config-templates",name:"config-templates",component:()=>Ut(()=>import("./ConfigTemplates-VdKE5Kp0.js"),__vite__mapDeps([49,1,2,21,8,11,50,6,28,45,34,36,35,37,46,5,3,51,52]))},{path:"/skills",name:"skills",component:()=>Ut(()=>import("./SkillManager-BpPqV2o4.js"),__vite__mapDeps([53,1,2,21,8,11,32,4,5,3,6,7,26,14,33,10,12,34,35,36,37,29,38,39,54]))},{path:"/plugins",name:"plugins",component:()=>Ut(()=>import("./PluginManager-BkGrr21J.js"),__vite__mapDeps([55,1,2,21,8,11,56,5,3,4,6,7,26,14,10,12,34,38,57,58]))},{path:"/analytics",name:"analytics",component:()=>Ut(()=>import("./Analytics-DTIvvMXu.js"),__vite__mapDeps([59,1,2,6,8,31,60]))},{path:"/:pathMatch(.*)*",redirect:"/"}],Nt=Ao({history:xo(),routes:Wt});function Kt(e,o){let{target:n}=e;for(;n;){if(n.dataset&&void 0!==n.dataset[o])return!0;n=n.parentElement}return!1}function Vt(e={},o){const n=no({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)&&(ie("keydown",document,a),ie("keyup",document,l)),void 0!==o&&Xe(o,e=>{e?(ie("keydown",document,a),ie("keyup",document,l)):(be("keydown",document,a),be("keyup",document,l))})};return Rn()?(Ve(i),Fo(()=>{(void 0===o||o.value)&&(be("keydown",document,a),be("keyup",document,l))})):i(),wo(n)}function qt(e,o,n){var t;const r=We(e,null);if(null===r)return;const a=null===(t=mo())||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)}Xe(n,l),l(n.value),Fo(()=>{l(void 0,n.value)})}function Gt(e){return e&-e}Nt.beforeEach(async e=>{if(!0!==e.meta.requiresCli)return!0;const o=No(e);if(!o)return{name:"home"};try{const e=Ko(),{uiConfig:n,loadUIConfig:t}=Lo();await Promise.all([e.load(),t()]);const{enabledKeys:r}=Ht({platformStore:e,configRef:n});return!!r.value.includes(o)||{name:"home"}}catch{return{name:"home"}}});var Jt,Yt,Zt=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+=Gt(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-=Gt(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 Xt(){return"undefined"==typeof document?1:(void 0===Yt&&(Yt="chrome"in window?window.devicePixelRatio:1),Yt)}var Qt="VVirtualListXScroll";var er=Me({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}=We(Qt);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}}),or=On(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[On("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[On("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),nr=Me({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(o){const n=f();or.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:An,ssr:n}),Je(()=>{const{defaultScrollIndex:e,defaultScrollKey:n}=o;null!=e?b({index:e}):null!=n&&b({key:n})});let t=!1,r=!1;je(()=>{t=!1,r?b({top:m.value,left:i.value}):r=!0}),Fe(()=>{t=!0,r||(r=!0)});const a=e(()=>{if(null==o.renderCol&&null==o.renderItemWithCols)return;if(0===o.columns.length)return;let e=0;return o.columns.forEach(o=>{e+=o.width}),e}),l=to(()=>{const e=new Map,{keyField:n}=o;return o.items.forEach((o,t)=>{e.set(o[n],t)}),e}),{scrollLeftRef:i,listWidthRef:s}=function({columnsRef:o,renderColRef:n,renderItemWithColsRef:t}){const r=To(0),a=To(0),l=to(()=>{const e=o.value;if(0===e.length)return null;const n=new Zt(e.length,0);return e.forEach((e,o)=>{n.add(o,e.width)}),n}),i=e(()=>{const e=l.value;return null!==e?Math.max(e.getBound(a.value)-1,0):0}),s=e(()=>{const e=l.value;return null!==e?Math.min(e.getBound(a.value+r.value)+1,o.value.length-1):0});return Ee(Qt,{startIndexRef:i,endIndexRef:s,columnsRef:o,renderColRef:n,renderItemWithColsRef:t,getLeft:e=>{const o=l.value;return null!==o?o.sum(e):0}}),{listWidthRef:r,scrollLeftRef:a}}({columnsRef:lo(o,"columns"),renderColRef:lo(o,"renderCol"),renderItemWithColsRef:lo(o,"renderItemWithCols")}),d=To(null),c=To(void 0),u=new Map,p=to(()=>{const{items:e,itemSize:n,keyField:t}=o,r=new Zt(e.length,n);return e.forEach((e,o)=>{const n=e[t],a=u.get(n);void 0!==a&&r.add(o,a)}),r}),h=To(0),m=To(0),v=e(()=>Math.max(p.value.getBound(m.value-re(o.paddingTop))-1,0)),g=to(()=>{const{value:e}=c;if(void 0===e)return[];const{items:n,itemSize:t}=o,r=v.value,a=Math.min(r+Math.ceil(e/t+1),n.length-1),l=[];for(let o=r;o<=a;++o)l.push(n[o]);return l}),b=(e,o)=>{if("number"==typeof e)return void w(e,o,"auto");const{left:n,top:t,index:r,key:a,position:i,behavior:s,debounce:d=!0}=e;if(void 0!==n||void 0!==t)w(n,t,s);else if(void 0!==r)C(r,s,d);else if(void 0!==a){const e=l.value.get(a);void 0!==e&&C(e,s,d)}else"bottom"===i?w(0,Number.MAX_SAFE_INTEGER,s):"top"===i&&w(0,0,s)};let y,x=null;function C(e,n,t){const{value:r}=p,a=r.sum(e)+re(o.paddingTop);if(t){y=e,null!==x&&window.clearTimeout(x),x=window.setTimeout(()=>{y=void 0,x=null},16);const{scrollTop:o,offsetHeight:t}=d.value;if(a>o){const l=r.get(e);a+l<=o+t||d.value.scrollTo({left:0,top:a+l-t,behavior:n})}else d.value.scrollTo({left:0,top:a,behavior:n})}else d.value.scrollTo({left:0,top:a,behavior:n})}function w(e,o,n){d.value.scrollTo({left:e,top:o,behavior:n})}const S=!("undefined"!=typeof document&&(void 0===Jt&&(Jt="matchMedia"in window&&window.matchMedia("(pointer:coarse)").matches),Jt));let k=!1;function I(){const{value:e}=d;null!=e&&(m.value=e.scrollTop,i.value=e.scrollLeft)}function P(e){let o=e;for(;null!==o;){if("none"===o.style.display)return!0;o=o.parentElement}return!1}return{listHeight:c,listStyle:{overflow:"auto"},keyToIndex:l,itemsStyle:to(()=>{const{itemResizable:e}=o,n=V(p.value.sum());return h.value,[o.itemsStyle,{boxSizing:"content-box",width:V(a.value),height:e?"":n,minHeight:e?n:"",paddingTop:V(o.paddingTop),paddingBottom:V(o.paddingBottom)}]}),visibleItemsStyle:to(()=>(h.value,{transform:`translateY(${V(p.value.sum(v.value))})`})),viewportItems:g,listElRef:d,itemsElRef:To(null),scrollTo:b,handleListResize:function(e){if(t)return;if(P(e.target))return;if(null==o.renderCol&&null==o.renderItemWithCols){if(e.contentRect.height===c.value)return}else if(e.contentRect.height===c.value&&e.contentRect.width===s.value)return;c.value=e.contentRect.height,s.value=e.contentRect.width;const{onResize:n}=o;void 0!==n&&n(e)},handleListScroll:function(e){var n;null===(n=o.onScroll)||void 0===n||n.call(o,e),S&&k||I()},handleListWheel:function(e){var n;if(null===(n=o.onWheel)||void 0===n||n.call(o,e),S){const o=d.value;if(null!=o){if(0===e.deltaX){if(0===o.scrollTop&&e.deltaY<=0)return;if(o.scrollTop+o.offsetHeight>=o.scrollHeight&&e.deltaY>=0)return}e.preventDefault(),o.scrollTop+=e.deltaY/Xt(),o.scrollLeft+=e.deltaX/Xt(),I(),k=!0,zn(()=>{k=!1})}}},handleItemResize:function(e,n){var r,a,i;if(t)return;if(o.ignoreItemResize)return;if(P(n.target))return;const{value:s}=p,c=l.value.get(e),f=s.get(c),m=null!==(i=null===(a=null===(r=n.borderBoxSize)||void 0===r?void 0:r[0])||void 0===a?void 0:a.blockSize)&&void 0!==i?i:n.contentRect.height;if(m===f)return;m-o.itemSize===0?u.delete(e):u.set(e,m-o.itemSize);const v=m-f;if(0===v)return;s.add(c,v);const g=d.value;if(null!=g){if(void 0===y){const e=s.sum(c);g.scrollTop>e&&g.scrollBy(0,v)}else(c<y||c===y&&m+s.sum(c)>g.scrollTop+g.offsetHeight)&&g.scrollBy(0,v);I()}h.value++}}},render(){const{itemResizable:e,keyField:o,keyToIndex:n,visibleItemsTag:t}=this;return Ue(C,{onResize:this.handleListResize},{default:()=>{var r,a;return Ue("div",Be(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[0!==this.items.length?Ue("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[Ue(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?Ue(er,{index:i,item:a}):void 0,d=null!=r?Ue(er,{index:i,item:a}):void 0,c=this.$slots.default({item:a,renderedCols:s,renderedItemWithCols:d,index:i})[0];return e?Ue(C,{key:l,onResize:e=>this.handleItemResize(l,e)},{default:()=>c}):(c.key=l,c)})}})]):null===(a=(r=this.$slots).empty)||void 0===a?void 0:a.call(r)])}})}}),tr="v-hidden",rr=On("[v-hidden]",{display:"none!important"}),ar=Me({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:o}){const n=To(null),t=To(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(tr)&&s.removeAttribute(tr);const{children:d}=a;if(r.showAllItemsBeforeCalculate)for(const e of d)e.hasAttribute(tr)&&e.removeAttribute(tr);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(tr)||n.setAttribute(tr,"");continue}n.hasAttribute(tr)&&n.removeAttribute(tr);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(tr,""))}const a=f();return rr.mount({id:"vueuc/overflow",head:!0,anchorMetaName:An,ssr:a}),Je(()=>r({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:t,sync:r}},render(){const{$slots:e}=this;return _e(()=>this.sync({showAllItemsBeforeCalculate:!1})),Ue("div",{class:"v-overflow",ref:"selfRef"},[ko(e,"default"),e.counter?e.counter():Ue("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function lr(e,o){o&&(Je(()=>{const{value:n}=e;n&&c.registerHandler(n,o)}),Xe(e,(e,o)=>{o&&c.unregisterHandler(o)},{deep:!1}),Fo(()=>{const{value:o}=e;o&&c.unregisterHandler(o)}))}function ir(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function sr(e){return o=>{e.value=o?o.$el:null}}function dr(e,o="default",n=[]){const t=e.$slots[o];return void 0===t?n:t()}function cr(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 ur(e,o=[],n){const t={};return Object.getOwnPropertyNames(e).forEach(n=>{o.includes(n)||(t[n]=e[n])}),Object.assign(t,n)}var pr=Me({name:"Add",render:()=>Ue("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}),hr=Me({name:"Checkmark",render:()=>Ue("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Ue("g",{fill:"none"},Ue("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"})))}),fr=Me({name:"ChevronDown",render:()=>Ue("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue("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"}))}),mr=Me({name:"ChevronRight",render:()=>Ue("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue("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"}))}),vr=ne("clear",()=>Ue("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Ue("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},Ue("g",{fill:"currentColor","fill-rule":"nonzero"},Ue("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"}))))),gr=Me({name:"Empty",render:()=>Ue("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue("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"}),Ue("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"}))}),br=Me({name:"EyeOff",render:()=>Ue("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Ue("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"}),Ue("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"}),Ue("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"}),Ue("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"}),Ue("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"}))}),yr=Me({name:"Remove",render:()=>Ue("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Ue("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 "}))}),xr=G("base-clear","\n flex-shrink: 0;\n height: 1em;\n width: 1em;\n position: relative;\n",[Z(">",[we("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 ",[Z("&:hover","\n color: var(--n-clear-color-hover)!important;\n "),Z("&:active","\n color: var(--n-clear-color-pressed)!important;\n ")]),we("placeholder","\n display: flex;\n "),we("clear, placeholder","\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n ",[b({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),Cr=Me({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup:e=>(x("-base-clear",xr,lo(e,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}),render(){const{clsPrefix:e}=this;return Ue("div",{class:`${e}-base-clear`},Ue(o,null,{default:()=>{var o,n;return this.show?Ue("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Te(this.$slots.icon,()=>[Ue(ee,{clsPrefix:e},{default:()=>Ue(vr,null)})])):Ue("div",{key:"icon",class:`${e}-base-clear__placeholder`},null===(n=(o=this.$slots).placeholder)||void 0===n?void 0:n.call(o))}}))}}),wr=Me({props:{onFocus:Function,onBlur:Function},setup:e=>()=>Ue("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}),Sr="#000",kr="#fff",Ir="#fff",Pr="rgb(72, 72, 78)",Tr="rgb(24, 24, 28)",Ar="rgb(44, 44, 50)",zr="rgb(16, 16, 20)",Rr="0.9",Mr="0.82",Fr="0.52",Or="0.38",$r="0.28",Br="0.52",Er="0.38",Dr="0.06",_r="0.09",Lr="0.06",Hr="0.05",jr="0.05",Ur="0.18",Wr="0.2",Nr="0.12",Kr="0.24",Vr="0.09",qr="0.1",Gr="0.06",Jr="0.04",Yr="0.2",Zr="0.3",Xr="0.12",Qr="0.2",ea="#7fe7c4",oa="#63e2b7",na="#5acea7",ta="rgb(42, 148, 125)",ra="#8acbec",aa="#70c0e8",la="#66afd3",ia="rgb(56, 137, 197)",sa="#e98b8b",da="#e88080",ca="#e57272",ua="rgb(208, 58, 82)",pa="#f5d599",ha="#f2c97d",fa="#e6c260",ma="rgb(240, 138, 0)",va="#7fe7c4",ga="#63e2b7",ba="#5acea7",ya="rgb(42, 148, 125)",xa=ve(Sr),Ca=ve(kr),wa=`rgba(${Ca.slice(0,3).join(", ")}, `;function Sa(e){return`${wa+String(e)})`}var ka=Object.assign(Object.assign({name:"common"},d),{baseColor:Sr,primaryColor:oa,primaryColorHover:ea,primaryColorPressed:na,primaryColorSuppl:ta,infoColor:aa,infoColorHover:ra,infoColorPressed:la,infoColorSuppl:ia,successColor:ga,successColorHover:va,successColorPressed:ba,successColorSuppl:ya,warningColor:ha,warningColorHover:pa,warningColorPressed:fa,warningColorSuppl:ma,errorColor:da,errorColorHover:sa,errorColorPressed:ca,errorColorSuppl:ua,textColorBase:Ir,textColor1:Sa(Rr),textColor2:Sa(Mr),textColor3:Sa(Fr),textColorDisabled:Sa(Or),placeholderColor:Sa(Or),placeholderColorDisabled:Sa($r),iconColor:Sa(Or),iconColorDisabled:Sa($r),iconColorHover:Sa(1.25*Number(Or)),iconColorPressed:Sa(.8*Number(Or)),opacity1:Rr,opacity2:Mr,opacity3:Fr,opacity4:Or,opacity5:$r,dividerColor:Sa(Vr),borderColor:Sa(Kr),closeIconColorHover:Sa(Number(Br)),closeIconColor:Sa(Number(Br)),closeIconColorPressed:Sa(Number(Br)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:Sa(Or),clearColorHover:W(Sa(Or),{alpha:1.25}),clearColorPressed:W(Sa(Or),{alpha:.8}),scrollbarColor:Sa(Yr),scrollbarColorHover:Sa(Zr),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Sa(Nr),railColor:Sa(Wr),popoverColor:Pr,tableColor:Tr,cardColor:Tr,modalColor:Ar,bodyColor:zr,tagColor:function(e){const o=Array.from(Ca);return o[3]=Number(e),de(xa,o)}(Qr),avatarColor:Sa(Ur),invertedColor:Sr,inputColor:Sa(qr),codeColor:Sa(Xr),tabColor:Sa(Jr),actionColor:Sa(Gr),tableHeaderColor:Sa(Gr),hoverColor:Sa(_r),tableColorHover:Sa(Lr),tableColorStriped:Sa(Hr),pressedColor:Sa(jr),opacityDisabled:Er,inputColorDisabled:Sa(Dr),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:ka,self:k};function Pa(e){return Array.isArray(e)?e:[e]}var Ta="STOP";function Aa(e,o){const n=o(e);void 0!==e.children&&n!==Ta&&e.children.forEach(e=>Aa(e,o))}function za(e){return e.children}function Ra(e){return e.key}function Ma(){return!1}function Fa(e){return!0===e.disabled}function Oa(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 Ba(e,o){const n=new Set(e);return o.forEach(e=>{n.has(e)||n.add(e)}),Array.from(n)}function Ea(e,o){const n=new Set(e);return o.forEach(e=>{n.has(e)&&n.delete(e)}),Array.from(n)}function Da(e){return"group"===(null==e?void 0:e.type)}var _a=class extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}};function La(e,o,n,t){const r=ja(o,n,t,!1),a=ja(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 Ha(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:Ba(n,t),indeterminateKeys:Array.from(a)}:void 0!==r?{checkedKeys:Ea(n,r),indeterminateKeys:Array.from(a)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)};const{levelTreeNodeMap:c}=o;let u;u=void 0!==r?La(r,n,o,d):void 0!==t?function(e,o,n,t){return ja(o.concat(e),n,t,!1)}(t,n,o,d):ja(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 ja(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&&Aa(o,e=>{if(e.disabled)return Ta;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 Ta;if(!n)throw new _a}})}),i}function Ua(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 Wa(e,o,{loop:n=!1,includeDisabled:t=!1}={}){const r="prev"===o?Na:Ua,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=Ka(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 Na(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 Ka(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=Ka(e,o);if(null!==n)return n}}}}return null}var Va={getChild(){return this.ignored?null:Ka(this)},getParent(){const{parent:e}=this;return(null==e?void 0:e.isGroup)?e.getParent():e},getNext(e={}){return Wa(this,"next",e)},getPrev(e={}){return Wa(this,"prev",e)}};function qa(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=qa(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 Ga(e,o={}){var n;const t=new Map,r=new Map,{getDisabled:a=Fa,getIgnored:l=Ma,getIsGroup:i=Da,getKey:s=Ra}=o,d=null!==(n=o.getChildren)&&void 0!==n?n:za,c=o.ignoreEmptyChildren?e=>{const o=d(e);return Array.isArray(o)?o.length?o:null:o}:d,u=qa(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)}},Va),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 Ha({checkedKeys:Oa(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 Ha({checkedKeys:Oa(o),indeterminateKeys:$a(o),keysToCheck:null==e?[]:Pa(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 Ha({checkedKeys:Oa(o),indeterminateKeys:$a(o),keysToUncheck:null==e?[]:Pa(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 Ja={name:"Empty",common:ka,self:Ce},Ya=G("empty","\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: var(--n-font-size);\n",[we("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 ",[Z("+",[we("description","\n margin-top: 8px;\n ")])]),we("description","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n "),we("extra","\n text-align: center;\n transition: color .3s var(--n-bezier);\n margin-top: 12px;\n color: var(--n-extra-text-color);\n ")]),Za=Me({name:"Empty",props:Object.assign(Object.assign({},g.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}=J(e),r=g("Empty","-empty",Ya,B,e,o),{localeRef:a}=h("Empty"),l=to(()=>{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=to(()=>{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)||(()=>Ue(gr,null))}),s=to(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:n},self:{[Pe("iconSize",o)]:t,[Pe("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?X("empty",to(()=>{let o="";const{size:n}=e;return o+=n[0],o}),s,e):void 0;return{mergedClsPrefix:o,mergedRenderIcon:i,localizedDescription:to(()=>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(),Ue("div",{class:[`${o}-empty`,this.themeClass],style:this.cssVars},this.showIcon?Ue("div",{class:`${o}-empty__icon`},e.icon?e.icon():Ue(ee,{clsPrefix:o},{default:this.mergedRenderIcon})):null,this.showDescription?Ue("div",{class:`${o}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?Ue("div",{class:`${o}-empty__extra`},e.extra()):null)}}),Xa={name:"InternalSelectMenu",common:ka,peers:{Scrollbar:Ia,Empty:Ja},self:$n},Qa=Me({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:o,labelFieldRef:n,nodePropsRef:t}=We(Wn);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):En(r[this.labelField],r,!1),i=Ue("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 el=Me({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(o){const{valueRef:n,pendingTmNodeRef:t,multipleRef:r,valueSetRef:a,renderLabelRef:l,renderOptionRef:i,labelFieldRef:s,valueFieldRef:d,showCheckmarkRef:c,nodePropsRef:u,handleOptionClick:p,handleOptionMouseEnter:h}=We(Wn),f=e(()=>{const{value:e}=t;return!!e&&o.tmNode.key===e.key});return{multiple:r,isGrouped:e(()=>{const{tmNode:e}=o,{parent:n}=e;return n&&"group"===n.rawNode.type}),showCheckmark:c,nodeProps:u,isPending:f,isSelected:e(()=>{const{value:e}=n,{value:t}=r;if(null===e)return!1;const l=o.tmNode.rawNode[d.value];if(t){const{value:e}=a;return e.has(l)}return e===l}),labelField:s,renderLabel:l,renderOption:i,handleMouseMove:function(e){const{tmNode:n}=o,{value:t}=f;n.disabled||t||h(e,n)},handleMouseEnter:function(e){const{tmNode:n}=o;n.disabled||h(e,n)},handleClick:function(e){const{tmNode:n}=o;n.disabled||p(e,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:u}=this,p=function(e,o){return Ue(go,{name:"fade-in-scale-up-transition"},{default:()=>e?Ue(ee,{clsPrefix:o,class:`${o}-base-select-option__check`},{default:()=>Ue(hr)}):null})}(n,e),h=s?[s(o,n),a&&p]:[En(o[this.labelField],o,n),a&&p],f=null==l?void 0:l(o),m=Ue("div",Object.assign({},f,{class:[`${e}-base-select-option`,o.class,null==f?void 0:f.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==f?void 0:f.style)||"",o.style||""],onClick:cr([d,null==f?void 0:f.onClick]),onMouseenter:cr([c,null==f?void 0:f.onMouseenter]),onMousemove:cr([u,null==f?void 0:f.onMousemove])}),Ue("div",{class:`${e}-base-select-option__content`},h));return o.render?o.render({node:m,option:o,selected:n}):i?i({node:m,option:o,selected:n}):m}}),ol=G("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",[G("scrollbar","\n max-height: var(--n-height);\n "),G("virtual-list","\n max-height: var(--n-height);\n "),G("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 ",[we("content","\n z-index: 1;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n ")]),G("base-select-group-header","\n min-height: var(--n-option-height);\n font-size: .93em;\n display: flex;\n align-items: center;\n "),G("base-select-menu-option-wrapper","\n position: relative;\n width: 100%;\n "),we("loading, empty","\n display: flex;\n padding: 12px 32px;\n flex: 1;\n justify-content: center;\n "),we("loading","\n color: var(--n-loading-color);\n font-size: var(--n-loading-size);\n "),we("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 "),we("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 "),G("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 "),G("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 ",[ze("show-checkmark","\n padding-right: calc(var(--n-option-padding-right) + 20px);\n "),Z("&::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 '),Z("&:active","\n color: var(--n-option-text-color-pressed);\n "),ze("grouped","\n padding-left: calc(var(--n-option-padding-left) * 1.5);\n "),ze("pending",[Z("&::before","\n background-color: var(--n-option-color-pending);\n ")]),ze("selected","\n color: var(--n-option-text-color-active);\n ",[Z("&::before","\n background-color: var(--n-option-color-active);\n "),ze("pending",[Z("&::before","\n background-color: var(--n-option-color-active-pending);\n ")])]),ze("disabled","\n cursor: not-allowed;\n ",[H("selected","\n color: var(--n-option-text-color-disabled);\n "),ze("selected","\n opacity: var(--n-option-opacity-disabled);\n ")]),we("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 ",[jn({enterScale:"0.5"})])])]),nl=Me({name:"InternalSelectMenu",props:Object.assign(Object.assign({},g.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}=J(e),t=p("InternalSelectMenu",n,o),r=g("InternalSelectMenu","-internal-select-menu",ol,Hn,e,lo(e,"clsPrefix")),a=To(null),l=To(null),i=To(null),s=to(()=>e.treeMate.getFlattenedNodes()),d=to(()=>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}}(s.value)),c=To(null);function u(){const{value:o}=c;o&&!e.treeMate.getNode(o.key)&&(c.value=null)}let h;Xe(()=>e.show,o=>{o?h=Xe(()=>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())),x(n||null)}():u(),_e(C)):u()},{immediate:!0}):null==h||h()},{immediate:!0}),Fo(()=>{null==h||h()});const f=to(()=>re(r.value.self[Pe("optionHeight",e.size)])),m=to(()=>N(r.value.self[Pe("padding",e.size)])),v=to(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),b=to(()=>{const e=s.value;return e&&0===e.length});function y(o){const{onScroll:n}=e;n&&n(o)}function x(e,o=!1){c.value=e,o&&C()}function C(){var o,n;const t=c.value;if(!t)return;const r=d.value(t.key);null!==r&&(e.virtualScroll?null===(o=l.value)||void 0===o||o.scrollTo({index:r}):null===(n=i.value)||void 0===n||n.scrollTo({index:r,elSize:f.value}))}Ee(Wn,{handleOptionMouseEnter:function(e,o){o.disabled||x(o,!1)},handleOptionClick:function(o,n){n.disabled||function(o){const{onToggle:n}=e;n&&n(o)}(n)},valueSetRef:v,pendingTmNodeRef:c,nodePropsRef:lo(e,"nodeProps"),showCheckmarkRef:lo(e,"showCheckmark"),multipleRef:lo(e,"multiple"),valueRef:lo(e,"value"),renderLabelRef:lo(e,"renderLabel"),renderOptionRef:lo(e,"renderOption"),labelFieldRef:lo(e,"labelField"),valueFieldRef:lo(e,"valueField")}),Ee(In,a),Je(()=>{const{value:e}=i;e&&e.sync()});const w=to(()=>{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,[Pe("optionFontSize",o)]:C,[Pe("optionHeight",o)]:w,[Pe("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":N(S,"left"),"--n-option-padding-right":N(S,"right"),"--n-loading-color":b,"--n-loading-size":y}}),{inlineThemeDisabled:S}=e,k=S?X("internal-select-menu",to(()=>e.size[0]),w,e):void 0,I={selfRef:a,next:function(){const{value:e}=c;e&&x(e.getNext({loop:!0}),!0)},prev:function(){const{value:e}=c;e&&x(e.getPrev({loop:!0}),!0)},getPendingTmNode:function(){const{value:e}=c;return e||null}};return lr(a,e.onResize),Object.assign({mergedTheme:r,mergedClsPrefix:o,rtlEnabled:t,virtualListRef:l,scrollbarRef:i,itemSize:f,padding:m,flattenedNodes:s,empty:b,virtualListContainer(){const{value:e}=l;return null==e?void 0:e.listElRef},virtualListContent(){const{value:e}=l;return null==e?void 0:e.itemsElRef},doScroll:y,handleFocusin:function(o){var n,t;(null===(n=a.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=a.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;Kt(o,"action")||null===(n=e.onKeyup)||void 0===n||n.call(e,o)},handleKeyDown:function(o){var n;Kt(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=i.value)||void 0===e||e.sync()},handleVirtualListScroll:function(e){var o;null===(o=i.value)||void 0===o||o.sync(),y(e)},cssVars:S?void 0:w,themeClass:null==k?void 0:k.themeClass,onRender:null==k?void 0:k.onRender},I)},render(){const{$slots:e,virtualScroll:o,clsPrefix:n,mergedTheme:t,themeClass:r,onRender:l}=this;return null==l||l(),Ue("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},a(e.header,e=>e&&Ue("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},e)),this.loading?Ue("div",{class:`${n}-base-select-menu__loading`},Ue(T,{clsPrefix:n,strokeWidth:20})):this.empty?Ue("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Te(e.empty,()=>[Ue(Za,{theme:t.peers.Empty,themeOverrides:t.peerOverrides.Empty,size:this.size})])):Ue(Ae,{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?Ue(nr,{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?Ue(Qa,{key:e.key,clsPrefix:n,tmNode:e}):e.ignored?null:Ue(el,{clsPrefix:n,key:e.key,tmNode:e})}):Ue("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(e=>e.isGroup?Ue(Qa,{key:e.key,clsPrefix:n,tmNode:e}):Ue(el,{clsPrefix:n,key:e.key,tmNode:e})))}),a(e.action,e=>e&&[Ue("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},e),Ue(wr,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),tl={name:"Popover",common:ka,peers:{Scrollbar:Ia},self:Vn},rl={name:"Tag",common:ka,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:I,heightMedium:P,buttonColor2Hover:T,buttonColor2Pressed:A,fontWeightStrong:z}=e;return Object.assign(Object.assign({},q),{closeBorderRadius:b,heightTiny:S,heightSmall:k,heightMedium:I,heightLarge:P,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 ${_(r,{alpha:.3})}`,textColorPrimary:r,colorPrimary:_(r,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:W(r,{lightness:.7}),closeIconColorHoverPrimary:W(r,{lightness:.7}),closeIconColorPressedPrimary:W(r,{lightness:.7}),closeColorHoverPrimary:_(r,{alpha:.16}),closeColorPressedPrimary:_(r,{alpha:.12}),borderInfo:`1px solid ${_(a,{alpha:.3})}`,textColorInfo:a,colorInfo:_(a,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:W(a,{alpha:.7}),closeIconColorHoverInfo:W(a,{alpha:.7}),closeIconColorPressedInfo:W(a,{alpha:.7}),closeColorHoverInfo:_(a,{alpha:.16}),closeColorPressedInfo:_(a,{alpha:.12}),borderSuccess:`1px solid ${_(l,{alpha:.3})}`,textColorSuccess:l,colorSuccess:_(l,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:W(l,{alpha:.7}),closeIconColorHoverSuccess:W(l,{alpha:.7}),closeIconColorPressedSuccess:W(l,{alpha:.7}),closeColorHoverSuccess:_(l,{alpha:.16}),closeColorPressedSuccess:_(l,{alpha:.12}),borderWarning:`1px solid ${_(i,{alpha:.3})}`,textColorWarning:i,colorWarning:_(i,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:W(i,{alpha:.7}),closeIconColorHoverWarning:W(i,{alpha:.7}),closeIconColorPressedWarning:W(i,{alpha:.7}),closeColorHoverWarning:_(i,{alpha:.16}),closeColorPressedWarning:_(i,{alpha:.11}),borderError:`1px solid ${_(s,{alpha:.3})}`,textColorError:s,colorError:_(s,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:W(s,{alpha:.7}),closeIconColorHoverError:W(s,{alpha:.7}),closeIconColorPressedError:W(s,{alpha:.7}),closeColorHoverError:_(s,{alpha:.16}),closeColorPressedError:_(s,{alpha:.12})})}},al={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},ll=G("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",[ze("strong","\n font-weight: var(--n-font-weight-strong);\n "),we("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 "),we("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 "),we("avatar","\n display: flex;\n margin: 0 6px 0 0;\n "),we("close","\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n "),ze("round","\n padding: 0 calc(var(--n-height) / 3);\n border-radius: calc(var(--n-height) / 2);\n ",[we("icon","\n margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);\n "),we("avatar","\n margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);\n "),ze("closable","\n padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);\n ")]),ze("icon, avatar",[ze("round","\n padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);\n ")]),ze("disabled","\n cursor: not-allowed !important;\n opacity: var(--n-opacity-disabled);\n "),ze("checkable","\n cursor: pointer;\n box-shadow: none;\n color: var(--n-text-color-checkable);\n background-color: var(--n-color-checkable);\n ",[H("disabled",[Z("&:hover","background-color: var(--n-color-hover-checkable);",[H("checked","color: var(--n-text-color-hover-checkable);")]),Z("&:active","background-color: var(--n-color-pressed-checkable);",[H("checked","color: var(--n-text-color-pressed-checkable);")])]),ze("checked","\n color: var(--n-text-color-checked);\n background-color: var(--n-color-checked);\n ",[H("disabled",[Z("&:hover","background-color: var(--n-color-checked-hover);"),Z("&:active","background-color: var(--n-color-checked-pressed);")])])])]),il=Object.assign(Object.assign(Object.assign({},g.props),al),{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}),sl=O("n-tag"),dl=Me({name:"Tag",props:il,slots:Object,setup(e){const o=To(null),{mergedBorderedRef:n,mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:a}=J(e),l=g("Tag","-tag",ll,Y,e,t);Ee(sl,{roundRef:lo(e,"round")});const i={setTextContent(e){const{value:n}=o;n&&(n.textContent=e)}},s=p("Tag",a,t),d=to(()=>{const{type:o,size:t,color:{color:r,textColor:a}={}}=e,{common:{cubicBezierEaseInOut:i},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,[Pe("colorBordered",o)]:k,[Pe("closeSize",t)]:I,[Pe("closeIconSize",t)]:P,[Pe("fontSize",t)]:T,[Pe("height",t)]:A,[Pe("color",o)]:z,[Pe("textColor",o)]:R,[Pe("border",o)]:M,[Pe("closeIconColor",o)]:F,[Pe("closeIconColorHover",o)]:O,[Pe("closeIconColorPressed",o)]:$,[Pe("closeColorHover",o)]:B,[Pe("closeColorPressed",o)]:E}}=l.value,D=N(d);return{"--n-font-weight-strong":S,"--n-avatar-size-override":`calc(${A} - 8px)`,"--n-bezier":i,"--n-border-radius":c,"--n-border":M,"--n-close-icon-size":P,"--n-close-color-pressed":E,"--n-close-color-hover":B,"--n-close-border-radius":w,"--n-close-icon-color":F,"--n-close-icon-color-hover":O,"--n-close-icon-color-pressed":$,"--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":I,"--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}}),c=r?X("tag",to(()=>{let o="";const{type:t,size:r,color:{color:a,textColor:l}={}}=e;return o+=t[0],o+=r[0],a&&(o+=`a${v(a)}`),l&&(o+=`b${v(l)}`),n.value&&(o+="c"),o}),d,e):void 0;return Object.assign(Object.assign({},i),{rtlEnabled:s,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&&z(n,o)}},cssVars:r?void 0:d,themeClass:null==c?void 0:c.themeClass,onRender:null==c?void 0:c.onRender})},render(){var e,o;const{mergedClsPrefix:n,rtlEnabled:t,closable:r,color:{borderColor:i}={},round:s,onRender:d,$slots:c}=this;null==d||d();const u=a(c.avatar,e=>e&&Ue("div",{class:`${n}-tag__avatar`},e)),p=a(c.icon,e=>e&&Ue("div",{class:`${n}-tag__icon`},e));return Ue("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`]:s,[`${n}-tag--avatar`]:u,[`${n}-tag--icon`]:p,[`${n}-tag--closable`]:r}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},p||u,Ue("span",{class:`${n}-tag__content`,ref:"contentRef"},null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)),!this.checkable&&r?Ue(l,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:s,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?Ue("div",{class:`${n}-tag__border`,style:{borderColor:i}}):null)}}),cl=Me({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 Ue(T,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?Ue(Cr,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>Ue(ee,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Te(o.default,()=>[Ue(fr,null)])})}):null})}}),ul={name:"InternalSelection",common:ka,peers:{Popover:tl},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:I,heightLarge:P,fontWeight:T}=e;return Object.assign(Object.assign({},Kn),{fontWeight:T,fontSizeTiny:y,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:w,heightTiny:S,heightSmall:k,heightMedium:I,heightLarge:P,borderRadius:o,textColor:n,textColorDisabled:t,placeholderColor:g,placeholderColorDisabled:b,color:r,colorDisabled:a,colorActive:_(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 ${_(l,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${_(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 ${_(s,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${_(s,{alpha:.4})}`,colorActiveWarning:_(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 ${_(c,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${_(c,{alpha:.4})}`,colorActiveError:_(c,{alpha:.1}),caretColorError:c,clearColor:f,clearColorHover:m,clearColorPressed:v})}},pl=Z([G("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 ",[G("base-loading","\n color: var(--n-loading-color);\n "),G("base-selection-tags","min-height: var(--n-height);"),we("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 "),we("state-border","\n z-index: 1;\n border-color: #0000;\n "),G("base-suffix","\n cursor: pointer;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 10px;\n ",[we("arrow","\n font-size: var(--n-arrow-size);\n color: var(--n-arrow-color);\n transition: color .3s var(--n-bezier);\n ")]),G("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 ",[we("wrapper","\n flex-basis: 0;\n flex-grow: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n ")]),G("base-selection-placeholder","\n color: var(--n-placeholder-color);\n ",[we("inner","\n max-width: 100%;\n overflow: hidden;\n ")]),G("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 "),G("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 ",[G("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 ",[we("content","\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap; \n ")]),we("render-label","\n color: var(--n-text-color);\n ")]),H("disabled",[Z("&:hover",[we("state-border","\n box-shadow: var(--n-box-shadow-hover);\n border: var(--n-border-hover);\n ")]),ze("focus",[we("state-border","\n box-shadow: var(--n-box-shadow-focus);\n border: var(--n-border-focus);\n ")]),ze("active",[we("state-border","\n box-shadow: var(--n-box-shadow-active);\n border: var(--n-border-active);\n "),G("base-selection-label","background-color: var(--n-color-active);"),G("base-selection-tags","background-color: var(--n-color-active);")])]),ze("disabled","cursor: not-allowed;",[we("arrow","\n color: var(--n-arrow-color-disabled);\n "),G("base-selection-label","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n ",[G("base-selection-input","\n cursor: not-allowed;\n color: var(--n-text-color-disabled);\n "),we("render-label","\n color: var(--n-text-color-disabled);\n ")]),G("base-selection-tags","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n "),G("base-selection-placeholder","\n cursor: not-allowed;\n color: var(--n-placeholder-color-disabled);\n ")]),G("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 ",[we("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 "),we("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=>ze(`${e}-status`,[we("state-border",`border: var(--n-border-${e});`),H("disabled",[Z("&:hover",[we("state-border",`\n box-shadow: var(--n-box-shadow-hover-${e});\n border: var(--n-border-hover-${e});\n `)]),ze("active",[we("state-border",`\n box-shadow: var(--n-box-shadow-active-${e});\n border: var(--n-border-active-${e});\n `),G("base-selection-label",`background-color: var(--n-color-active-${e});`),G("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),ze("focus",[we("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)])])]))]),G("base-selection-popover","\n margin-bottom: -3px;\n display: flex;\n flex-wrap: wrap;\n margin-right: -8px;\n "),G("base-selection-tag-wrapper","\n max-width: 100%;\n display: inline-flex;\n padding: 0 7px 3px 0;\n ",[Z("&:last-child","padding-right: 0;"),G("tag","\n font-size: 14px;\n max-width: 100%;\n ",[we("content","\n line-height: 1.25;\n text-overflow: ellipsis;\n overflow: hidden;\n ")])])]),hl=Me({name:"InternalSelection",props:Object.assign(Object.assign({},g.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}=J(e),t=p("InternalSelection",n,o),r=To(null),a=To(null),l=To(null),i=To(null),s=To(null),d=To(null),c=To(null),u=To(null),h=To(null),f=To(null),m=To(!1),v=To(!1),b=To(!1),y=g("InternalSelection","-internal-selection",pl,Dn,e,lo(e,"clsPrefix")),x=to(()=>e.clearable&&!e.disabled&&(b.value||e.active)),C=to(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):En(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),w=to(()=>{const o=e.selectedOption;if(o)return o[e.labelField]}),S=to(()=>e.multiple?!(!Array.isArray(e.selectedOptions)||!e.selectedOptions.length):null!==e.selectedOption);function k(){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 I(o){const{onPatternInput:n}=e;n&&n(o)}function P(o){!function(o){const{onDeleteOption:n}=e;n&&n(o)}(o)}Xe(lo(e,"active"),e=>{e||function(){const{value:e}=f;e&&(e.style.display="none")}()}),Xe(lo(e,"pattern"),()=>{e.multiple&&_e(k)});const T=To(!1);let A=null;let z=null;function R(){null!==z&&window.clearTimeout(z)}Xe(S,e=>{e||(m.value=!1)}),Je(()=>{Ke(()=>{const o=d.value;o&&(e.disabled?o.removeAttribute("tabindex"):o.tabIndex=v.value?-1:0)})}),lr(l,e.onResize);const{inlineThemeDisabled:M}=e,F=to(()=>{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:x,borderHover:C,borderActive:w,arrowColor:S,arrowColorDisabled:k,loadingColor:I,colorActiveWarning:P,boxShadowFocusWarning:T,boxShadowActiveWarning:A,boxShadowHoverWarning:z,borderWarning:R,borderFocusWarning:M,borderHoverWarning:F,borderActiveWarning:O,colorActiveError:$,boxShadowFocusError:B,boxShadowActiveError:E,boxShadowHoverError:D,borderError:_,borderFocusError:L,borderHoverError:H,borderActiveError:j,clearColor:U,clearColorHover:W,clearColorPressed:K,clearSize:V,arrowSize:q,[Pe("height",o)]:G,[Pe("fontSize",o)]:J}}=y.value,Y=N(s),Z=N(d);return{"--n-bezier":n,"--n-border":b,"--n-border-active":w,"--n-border-focus":x,"--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":J,"--n-height":G,"--n-padding-single-top":Y.top,"--n-padding-multiple-top":Z.top,"--n-padding-single-right":Y.right,"--n-padding-multiple-right":Z.right,"--n-padding-single-left":Y.left,"--n-padding-multiple-left":Z.left,"--n-padding-single-bottom":Y.bottom,"--n-padding-multiple-bottom":Z.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":I,"--n-color-active-warning":P,"--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":$,"--n-box-shadow-focus-error":B,"--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":V,"--n-clear-color":U,"--n-clear-color-hover":W,"--n-clear-color-pressed":K,"--n-arrow-size":q,"--n-font-weight":t}}),O=M?X("internal-selection",to(()=>e.size[0]),F,e):void 0;return{mergedTheme:y,mergedClearable:x,mergedClsPrefix:o,rtlEnabled:t,patternInputFocused:v,filterablePlaceholder:C,label:w,selected:S,showTagsPanel:m,isComposing:T,counterRef:c,counterWrapperRef:u,patternInputMirrorRef:r,patternInputRef:a,selfRef:l,multipleElRef:i,singleElRef:s,patternInputWrapperRef:d,overflowRef:h,inputTagElRef:f,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(){b.value=!0},handleMouseLeave:function(){b.value=!1},handleDeleteOption:P,handlePatternKeyDown:function(o){if("Backspace"===o.key&&!T.value&&!e.pattern.length){const{selectedOptions:o}=e;(null==o?void 0:o.length)&&P(o[o.length-1])}},handlePatternInputInput:function(o){const{value:n}=r;n&&(n.textContent=o.target.value,k()),e.ignoreComposition&&T.value?A=o:I(o)},handlePatternInputBlur:function(o){var n;v.value=!1,null===(n=e.onPatternBlur)||void 0===n||n.call(e,o)},handlePatternInputFocus:function(o){var n;v.value=!0,null===(n=e.onPatternFocus)||void 0===n||n.call(e,o)},handleMouseEnterCounter:function(){e.active||(R(),z=window.setTimeout(()=>{S.value&&(m.value=!0)},100))},handleMouseLeaveCounter:function(){R()},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(){T.value=!1,e.ignoreComposition&&I(A),A=null},handleCompositionStart:function(){T.value=!0},onPopoverUpdateShow:function(e){e||(R(),m.value=!1)},focus:function(){var o,n,t;e.filterable?(v.value=!1,null===(o=d.value)||void 0===o||o.focus()):e.multiple?null===(n=i.value)||void 0===n||n.focus():null===(t=s.value)||void 0===t||t.focus()},focusInput:function(){const{value:e}=a;e&&(!function(){const{value:e}=f;e&&(e.style.display="inline-block")}(),e.focus())},blur:function(){var o,n;if(e.filterable)v.value=!1,null===(o=d.value)||void 0===o||o.blur(),null===(n=a.value)||void 0===n||n.blur();else if(e.multiple){const{value:e}=i;null==e||e.blur()}else{const{value:e}=s;null==e||e.blur()}},blurInput:function(){const{value:e}=a;e&&e.blur()},updateCounter:function(e){const{value:o}=c;o&&o.setTextContent(`+${e}`)},getCounter:function(){const{value:e}=u;return e},getTail:function(){return a.value},renderLabel:e.renderLabel,cssVars:M?void 0:F,themeClass:null==O?void 0:O.themeClass,onRender:null==O?void 0:O.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:u}=this;null==d||d();const p="responsive"===a,h="number"==typeof a,f=p||h,m=Ue(Se,null,{default:()=>Ue(cl,{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 v;if(o){const{labelField:e}=this,o=o=>Ue("div",{class:`${i}-base-selection-tag-wrapper`,key:o.value},c?c({option:o,handleClose:()=>{this.handleDeleteOption(o)}}):Ue(dl,{size:n,closable:!o.disabled,disabled:t,onClose:()=>{this.handleDeleteOption(o)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(o,!0):En(o[e],o,!0)})),l=()=>(h?this.selectedOptions.slice(0,a):this.selectedOptions).map(o),d=r?Ue("div",{class:`${i}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},Ue("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})),Ue("span",{ref:"patternInputMirrorRef",class:`${i}-base-selection-input-tag__mirror`},this.pattern)):null,g=p?()=>Ue("div",{class:`${i}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},Ue(dl,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:t})):void 0;let b;if(h){const e=this.selectedOptions.length-a;e>0&&(b=Ue("div",{class:`${i}-base-selection-tag-wrapper`,key:"__counter__"},Ue(dl,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:t},{default:()=>`+${e}`})))}const y=p?r?Ue(ar,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:l,counter:g,tail:()=>d}):Ue(ar,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:l,counter:g}):h&&b?l().concat(b):l(),x=f?()=>Ue("div",{class:`${i}-base-selection-popover`},p?l():this.selectedOptions.map(o)):void 0,C=f?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,w=this.selected||this.active&&(this.pattern||this.isComposing)?null:Ue("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`},Ue("div",{class:`${i}-base-selection-placeholder__inner`},this.placeholder)),S=r?Ue("div",{ref:"patternInputWrapperRef",class:`${i}-base-selection-tags`},y,p?null:d,m):Ue("div",{ref:"multipleElRef",class:`${i}-base-selection-tags`,tabindex:t?void 0:0},y,m);v=Ue(co,null,f?Ue(Qn,Object.assign({},C,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>S,default:x}):S,w)}else if(r){const e=this.pattern||this.isComposing,o=this.active?!e:!this.selected,n=!this.active&&this.selected;v=Ue("div",{ref:"patternInputWrapperRef",class:`${i}-base-selection-label`,title:this.patternInputFocused?void 0:ir(this.label)},Ue("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?Ue("div",{class:`${i}-base-selection-label__render-label ${i}-base-selection-overlay`,key:"input"},Ue("div",{class:`${i}-base-selection-overlay__wrapper`},c?c({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):En(this.label,this.selectedOption,!0))):null,o?Ue("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`,key:"placeholder"},Ue("div",{class:`${i}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else v=Ue("div",{ref:"singleElRef",class:`${i}-base-selection-label`,tabindex:this.disabled?void 0:0},void 0!==this.label?Ue("div",{class:`${i}-base-selection-input`,title:ir(this.label),key:"input"},Ue("div",{class:`${i}-base-selection-input__content`},c?c({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):En(this.label,this.selectedOption,!0))):Ue("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`,key:"placeholder"},Ue("div",{class:`${i}-base-selection-placeholder__inner`},this.placeholder)),m);return Ue("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},v,l?Ue("div",{class:`${i}-base-selection__border`}):null,l?Ue("div",{class:`${i}-base-selection__state-border`}):null)}}),fl={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"},ml={name:"Alert",common:ka,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({},fl),{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 ${_(h,{alpha:.35})}`,colorInfo:_(h,{alpha:.25}),titleTextColorInfo:l,iconColorInfo:h,contentTextColorInfo:i,closeColorHoverInfo:s,closeColorPressedInfo:d,closeIconColorInfo:c,closeIconColorHoverInfo:u,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${_(f,{alpha:.35})}`,colorSuccess:_(f,{alpha:.25}),titleTextColorSuccess:l,iconColorSuccess:f,contentTextColorSuccess:i,closeColorHoverSuccess:s,closeColorPressedSuccess:d,closeIconColorSuccess:c,closeIconColorHoverSuccess:u,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${_(m,{alpha:.35})}`,colorWarning:_(m,{alpha:.25}),titleTextColorWarning:l,iconColorWarning:m,contentTextColorWarning:i,closeColorHoverWarning:s,closeColorPressedWarning:d,closeIconColorWarning:c,closeIconColorHoverWarning:u,closeIconColorPressedWarning:p,borderError:`1px solid ${_(v,{alpha:.35})}`,colorError:_(v,{alpha:.25}),titleTextColorError:l,iconColorError:v,contentTextColorError:i,closeColorHoverError:s,closeColorPressedError:d,closeIconColorError:c,closeIconColorHoverError:u,closeIconColorPressedError:p})}};var vl={name:"Alert",common:t,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({},fl),{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 ${de(r,_(f,{alpha:.25}))}`,colorInfo:de(r,_(f,{alpha:.08})),titleTextColorInfo:i,iconColorInfo:f,contentTextColorInfo:s,closeColorHoverInfo:d,closeColorPressedInfo:c,closeIconColorInfo:u,closeIconColorHoverInfo:p,closeIconColorPressedInfo:h,borderSuccess:`1px solid ${de(r,_(m,{alpha:.25}))}`,colorSuccess:de(r,_(m,{alpha:.08})),titleTextColorSuccess:i,iconColorSuccess:m,contentTextColorSuccess:s,closeColorHoverSuccess:d,closeColorPressedSuccess:c,closeIconColorSuccess:u,closeIconColorHoverSuccess:p,closeIconColorPressedSuccess:h,borderWarning:`1px solid ${de(r,_(v,{alpha:.33}))}`,colorWarning:de(r,_(v,{alpha:.08})),titleTextColorWarning:i,iconColorWarning:v,contentTextColorWarning:s,closeColorHoverWarning:d,closeColorPressedWarning:c,closeIconColorWarning:u,closeIconColorHoverWarning:p,closeIconColorPressedWarning:h,borderError:`1px solid ${de(r,_(g,{alpha:.25}))}`,colorError:de(r,_(g,{alpha:.08})),titleTextColorError:i,iconColorError:g,contentTextColorError:s,closeColorHoverError:d,closeColorPressedError:c,closeIconColorError:u,closeIconColorHoverError:p,closeIconColorPressedError:h})}},{cubicBezierEaseInOut:gl,cubicBezierEaseOut:bl,cubicBezierEaseIn:yl}=d;function xl({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[Z(`&.fade-in-height-expand-transition-${d}-from,\n &.fade-in-height-expand-transition-${s}-to`,Object.assign(Object.assign({},a),{opacity:1})),Z(`&.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})),Z(`&.fade-in-height-expand-transition-${d}-active`,`\n overflow: ${e};\n transition:\n max-height ${o} ${gl} ${t},\n opacity ${o} ${bl} ${t},\n margin-top ${o} ${gl} ${t},\n margin-bottom ${o} ${gl} ${t},\n padding-top ${o} ${gl} ${t},\n padding-bottom ${o} ${gl} ${t}\n ${n?`,${n}`:""}\n `),Z(`&.fade-in-height-expand-transition-${s}-active`,`\n overflow: ${e};\n transition:\n max-height ${o} ${gl},\n opacity ${o} ${yl},\n margin-top ${o} ${gl},\n margin-bottom ${o} ${gl},\n padding-top ${o} ${gl},\n padding-bottom ${o} ${gl}\n ${n?`,${n}`:""}\n `)]}var Cl=G("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",[we("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 "),ze("closable",[G("alert-body",[we("title","\n padding-right: 24px;\n ")])]),we("icon",{color:"var(--n-icon-color)"}),G("alert-body",{padding:"var(--n-padding)"},[we("title",{color:"var(--n-title-text-color)"}),we("content",{color:"var(--n-content-text-color)"})]),xl({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),we("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 "),we("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 "),ze("show-icon",[G("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),ze("right-adjust",[G("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),G("alert-body","\n border-radius: var(--n-border-radius);\n transition: border-color .3s var(--n-bezier);\n ",[we("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 ",[Z("& +",[we("content",{marginTop:"9px"})])]),we("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),we("icon",{transition:"color .3s var(--n-bezier)"})]),wl=Me({name:"Alert",inheritAttrs:!1,props:Object.assign(Object.assign({},g.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}=J(e),a=g("Alert","-alert",Cl,vl,e,o),l=p("Alert",r,o),i=to(()=>{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}=N(d);return{"--n-bezier":o,"--n-color":n[Pe("color",g)],"--n-close-icon-size":u,"--n-close-border-radius":p,"--n-close-color-hover":n[Pe("closeColorHover",g)],"--n-close-color-pressed":n[Pe("closeColorPressed",g)],"--n-close-icon-color":n[Pe("closeIconColor",g)],"--n-close-icon-color-hover":n[Pe("closeIconColorHover",g)],"--n-close-icon-color-pressed":n[Pe("closeIconColorPressed",g)],"--n-icon-color":n[Pe("iconColor",g)],"--n-border":n[Pe("border",g)],"--n-title-text-color":n[Pe("titleTextColor",g)],"--n-content-text-color":n[Pe("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?X("alert",to(()=>e.type[0]),i,e):void 0,d=To(!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),Ue(s,{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?Ue("div",Object.assign({},Be(this.$attrs,n)),this.closable&&Ue(l,{clsPrefix:e,class:`${e}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&Ue("div",{class:`${e}-alert__border`}),this.showIcon&&Ue("div",{class:`${e}-alert__icon`,"aria-hidden":"true"},Te(o.icon,()=>[Ue(ee,{clsPrefix:e},{default:()=>{switch(this.type){case"success":return Ue(ut,null);case"info":return Ue(pt,null);case"warning":return Ue(It,null);case"error":return Ue(ht,null);default:return null}}})])),Ue("div",{class:[`${e}-alert-body`,this.mergedBordered&&`${e}-alert-body--bordered`]},a(o.header,o=>{const n=o||this.title;return n?Ue("div",{class:`${e}-alert-body__title`},n):null}),o.default&&Ue("div",{class:`${e}-alert-body__content`},o))):null}})}}),Sl={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"};function kl(e){const{borderRadius:o,railColor:n,primaryColor:t,primaryColorHover:r,primaryColorPressed:a,textColor2:l}=e;return Object.assign(Object.assign({},Sl),{borderRadius:o,railColor:n,railColorActive:t,linkColor:_(t,{alpha:.15}),linkTextColor:l,linkTextColorHover:r,linkTextColorPressed:a,linkTextColorActive:t})}var Il={name:"Anchor",common:t,self:kl},Pl={name:"Anchor",common:ka,self:kl};var Tl=m({name:"Input",common:ka,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:I,placeholderColorDisabled:P,iconColor:T,iconColorDisabled:A,iconColorHover:z,iconColorPressed:R,fontWeight:M}=e;return Object.assign(Object.assign({},Zn),{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:I,placeholderColorDisabled:P,color:l,colorDisabled:i,colorFocus:_(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 ${_(r,{alpha:.3})}`,loadingColor:r,loadingColorWarning:s,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:_(s,{alpha:.1}),borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 8px 0 ${_(s,{alpha:.3})}`,caretColorWarning:s,loadingColorError:c,borderError:`1px solid ${c}`,borderHoverError:`1px solid ${u}`,colorFocusError:_(c,{alpha:.1}),borderFocusError:`1px solid ${u}`,boxShadowFocusError:`0 0 8px 0 ${_(c,{alpha:.3})}`,caretColorError:c,clearColor:w,clearColorHover:S,clearColorPressed:k,iconColor:T,iconColorDisabled:A,iconColorHover:z,iconColorPressed:R,suffixTextColor:o})}}),Al=O("n-input"),zl=G("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",[we("input, textarea","\n overflow: hidden;\n flex-grow: 1;\n position: relative;\n "),we("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 "),we("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 ",[Z("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb","\n width: 0;\n height: 0;\n display: none;\n "),Z("&::placeholder","\n color: #0000;\n -webkit-text-fill-color: transparent !important;\n "),Z("&:-webkit-autofill ~",[we("placeholder","display: none;")])]),ze("round",[H("textarea","border-radius: calc(var(--n-height) / 2);")]),we("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 ",[Z("span","\n width: 100%;\n display: inline-block;\n ")]),ze("textarea",[we("placeholder","overflow: visible;")]),H("autosize","width: 100%;"),ze("autosize",[we("textarea-el, input-el","\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n ")]),G("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 "),we("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 "),we("input-el","\n padding: 0;\n height: var(--n-height);\n line-height: var(--n-height);\n ",[Z("&[type=password]::-ms-reveal","display: none;"),Z("+",[we("placeholder","\n display: flex;\n align-items: center; \n ")])]),H("textarea",[we("placeholder","white-space: nowrap;")]),we("eye","\n display: flex;\n align-items: center;\n justify-content: center;\n transition: color .3s var(--n-bezier);\n "),ze("textarea","width: 100%;",[G("input-word-count","\n position: absolute;\n right: var(--n-padding-right);\n bottom: var(--n-padding-vertical);\n "),ze("resizable",[G("input-wrapper","\n resize: vertical;\n min-height: var(--n-height);\n ")]),we("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 "),we("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 ")]),ze("pair",[we("input-el, placeholder","text-align: center;"),we("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 ",[G("icon","\n color: var(--n-icon-color);\n "),G("base-icon","\n color: var(--n-icon-color);\n ")])]),ze("disabled","\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n ",[we("border","border: var(--n-border-disabled);"),we("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 "),we("placeholder","color: var(--n-placeholder-color-disabled);"),we("separator","color: var(--n-text-color-disabled);",[G("icon","\n color: var(--n-icon-color-disabled);\n "),G("base-icon","\n color: var(--n-icon-color-disabled);\n ")]),G("input-word-count","\n color: var(--n-count-text-color-disabled);\n "),we("suffix, prefix","color: var(--n-text-color-disabled);",[G("icon","\n color: var(--n-icon-color-disabled);\n "),G("internal-icon","\n color: var(--n-icon-color-disabled);\n ")])]),H("disabled",[we("eye","\n color: var(--n-icon-color);\n cursor: pointer;\n ",[Z("&:hover","\n color: var(--n-icon-color-hover);\n "),Z("&:active","\n color: var(--n-icon-color-pressed);\n ")]),Z("&:hover",[we("state-border","border: var(--n-border-hover);")]),ze("focus","background-color: var(--n-color-focus);",[we("state-border","\n border: var(--n-border-focus);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),we("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 "),we("state-border","\n border-color: #0000;\n z-index: 1;\n "),we("prefix","margin-right: 4px;"),we("suffix","\n margin-left: 4px;\n "),we("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 ",[G("base-loading","\n font-size: var(--n-icon-size);\n margin: 0 2px;\n color: var(--n-loading-color);\n "),G("base-clear","\n font-size: var(--n-icon-size);\n ",[we("placeholder",[G("base-icon","\n transition: color .3s var(--n-bezier);\n color: var(--n-icon-color);\n font-size: var(--n-icon-size);\n ")])]),Z(">",[G("icon","\n transition: color .3s var(--n-bezier);\n color: var(--n-icon-color);\n font-size: var(--n-icon-size);\n ")]),G("base-icon","\n font-size: var(--n-icon-size);\n ")]),G("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=>ze(`${e}-status`,[H("disabled",[G("base-loading",`\n color: var(--n-loading-color-${e})\n `),we("input-el, textarea-el",`\n caret-color: var(--n-caret-color-${e});\n `),we("state-border",`\n border: var(--n-border-${e});\n `),Z("&:hover",[we("state-border",`\n border: var(--n-border-hover-${e});\n `)]),Z("&:focus",`\n background-color: var(--n-color-focus-${e});\n `,[we("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)]),ze("focus",`\n background-color: var(--n-color-focus-${e});\n `,[we("state-border",`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)])])]))]),Rl=G("input",[ze("disabled",[we("input-el, textarea-el","\n -webkit-text-fill-color: var(--n-text-color-disabled);\n ")])]);function Ml(e){let o=0;for(const n of e)o++;return o}function Fl(e){return""===e||null==e}var Ol=Me({name:"InputWordCount",setup(e,{slots:o}){const{mergedValueRef:n,maxlengthRef:t,mergedClsPrefixRef:r,countGraphemesRef:a}=We(Al),l=to(()=>{const{value:e}=n;return null===e||Array.isArray(e)?0:(a.value||Ml)(e)});return()=>{const{value:e}=t,{value:a}=n;return Ue("span",{class:`${r.value}-input-word-count`},P(o.default,{value:null===a||Array.isArray(a)?"":a},()=>[void 0===e?l.value:`${l.value} / ${e}`]))}}}),$l=Me({name:"Input",props:Object.assign(Object.assign({},g.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(o){const{mergedClsPrefixRef:n,mergedBorderedRef:t,inlineThemeDisabled:r,mergedRtlRef:a}=J(o),l=g("Input","-input",zl,Gn,o,n);K&&x("-input-safari",Rl,n);const i=To(null),s=To(null),d=To(null),c=To(null),u=To(null),f=To(null),m=To(null),v=function(e){const o=To(null);function n(){o.value=null}return Xe(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),b=To(null),{localeRef:y}=h("Input"),C=To(o.defaultValue),S=lo(o,"value"),k=w(S,C),I=ae(o),{mergedSizeRef:P,mergedDisabledRef:T,mergedStatusRef:A}=I,R=To(!1),M=To(!1),F=To(!1),O=To(!1);let $=null;const B=to(()=>{const{placeholder:e,pair:n}=o;return n?Array.isArray(e)?e:void 0===e?["",""]:[e,e]:void 0===e?[y.value.placeholder]:[e]}),E=to(()=>{const{value:e}=F,{value:o}=k,{value:n}=B;return!e&&(Fl(o)||Array.isArray(o)&&Fl(o[0]))&&n[0]}),D=to(()=>{const{value:e}=F,{value:o}=k,{value:n}=B;return!e&&n[1]&&(Fl(o)||Array.isArray(o)&&Fl(o[1]))}),_=e(()=>o.internalForceFocus||R.value),L=e(()=>{if(T.value||o.readonly||!o.clearable||!_.value&&!M.value)return!1;const{value:e}=k,{value:n}=_;return o.pair?!(!Array.isArray(e)||!e[0]&&!e[1])&&(M.value||n):!!e&&(M.value||n)}),H=to(()=>{const{showPasswordOn:e}=o;return e||(o.showPasswordToggle?"click":void 0)}),j=To(!1),U=to(()=>{const{textDecoration:e}=o;return e?Array.isArray(e)?e.map(e=>({textDecoration:e})):[{textDecoration:e}]:["",""]}),W=To(void 0),V=to(()=>{const{maxlength:e}=o;return void 0===e?void 0:Number(e)});Je(()=>{const{value:e}=k;Array.isArray(e)||te(e)});const q=mo().proxy;function G(e,n){const{onUpdateValue:t,"onUpdate:value":r,onInput:a}=o,{nTriggerFormInput:l}=I;t&&z(t,e,n),r&&z(r,e,n),a&&z(a,e,n),C.value=e,l()}function Y(e,n){const{onChange:t}=o,{nTriggerFormChange:r}=I;t&&z(t,e,n),C.value=e,r()}function Z(e,n=0,t="input"){const r=e.target.value;if(te(r),e instanceof InputEvent&&!e.isComposing&&(F.value=!1),"textarea"===o.type){const{value:e}=b;e&&e.syncUnifiedContainer()}if($=r,F.value)return;v.recordCursor();const a=function(e){const{countGraphemes:n,maxlength:t,minlength:r}=o;if(n){let o;if(void 0!==t&&(void 0===o&&(o=n(e)),o>Number(t)))return!1;if(void 0!==r&&(void 0===o&&(o=n(e)),o<Number(t)))return!1}const{allowInput:a}=o;return"function"!=typeof a||a(e)}(r);if(a)if(o.pair){let{value:e}=k;e=Array.isArray(e)?[e[0],e[1]]:["",""],e[n]=r,"input"===t?G(e,{source:n}):Y(e,{source:n})}else"input"===t?G(r,{source:n}):Y(r,{source:n});q.$forceUpdate(),a||_e(v.restoreCursor)}function Q(e,n){(null===e.relatedTarget||e.relatedTarget!==u.value&&e.relatedTarget!==f.value&&e.relatedTarget!==s.value&&e.relatedTarget!==i.value)&&("focus"===n?(!function(e){const{onFocus:n}=o,{nTriggerFormFocus:t}=I;n&&z(n,e),t()}(e),R.value=!0):"blur"===n&&(!function(e){const{onBlur:n}=o,{nTriggerFormBlur:t}=I;n&&z(n,e),t()}(e),R.value=!1))}function ee(){o.pair?(G(["",""],{source:"clear"}),Y(["",""],{source:"clear"})):(G("",{source:"clear"}),Y("",{source:"clear"}))}function oe(){o.passivelyActivated&&(O.value=!1,_e(()=>{var e;null===(e=i.value)||void 0===e||e.focus()}))}function ne(){var e,n,t;T.value||(o.passivelyActivated?null===(e=i.value)||void 0===e||e.focus():(null===(n=s.value)||void 0===n||n.focus(),null===(t=u.value)||void 0===t||t.focus()))}function te(e){const{type:n,pair:t,autosize:r}=o;if(!t&&r)if("textarea"===n){const{value:o}=d;o&&(o.textContent=`${null!=e?e:""}\r\n`)}else{const{value:o}=c;o&&(e?o.textContent=e:o.innerHTML=" ")}}const re=To({top:"0"});let le=null;Ke(()=>{const{autosize:e,type:n}=o;e&&"textarea"===n?le=Xe(k,e=>{Array.isArray(e)||e===$||te(e)}):null==le||le()});let se=null;Ke(()=>{"textarea"===o.type?se=Xe(k,e=>{var o;Array.isArray(e)||e===$||null===(o=b.value)||void 0===o||o.syncUnifiedContainer()}):null==se||se()}),Ee(Al,{mergedValueRef:k,maxlengthRef:V,mergedClsPrefixRef:n,countGraphemesRef:lo(o,"countGraphemes")});const de={wrapperElRef:i,inputElRef:u,textareaElRef:s,isCompositing:F,clear:ee,focus:ne,blur:function(){var e;(null===(e=i.value)||void 0===e?void 0:e.contains(document.activeElement))&&document.activeElement.blur()},select:function(){var e,o;null===(e=s.value)||void 0===e||e.select(),null===(o=u.value)||void 0===o||o.select()},deactivate:function(){const{value:e}=i;(null==e?void 0:e.contains(document.activeElement))&&e!==document.activeElement&&oe()},activate:function(){T.value||(s.value?s.value.focus():u.value&&u.value.focus())},scrollTo:function(e){if("textarea"===o.type){const{value:o}=s;null==o||o.scrollTo(e)}else{const{value:o}=u;null==o||o.scrollTo(e)}}},ce=p("Input",a,n),ue=to(()=>{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:$,clearColorHover:B,clearColorPressed:E,iconColor:D,iconColorDisabled:_,suffixTextColor:L,countTextColor:H,countTextColorDisabled:j,iconColorHover:U,iconColorPressed:W,loadingColor:K,loadingColorError:V,loadingColorWarning:q,fontWeight:G,[Pe("padding",e)]:J,[Pe("fontSize",e)]:Y,[Pe("height",e)]:Z}}=l.value,{left:X,right:Q}=N(J);return{"--n-bezier":o,"--n-count-text-color":H,"--n-count-text-color-disabled":j,"--n-color":n,"--n-font-size":Y,"--n-font-weight":G,"--n-border-radius":t,"--n-height":Z,"--n-padding-left":X,"--n-padding-right":Q,"--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":K,"--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":q,"--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":V,"--n-clear-color":$,"--n-clear-size":O,"--n-clear-color-hover":B,"--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}}),pe=r?X("input",to(()=>{const{value:e}=P;return e[0]}),ue,o):void 0;return Object.assign(Object.assign({},de),{wrapperElRef:i,inputElRef:u,inputMirrorElRef:c,inputEl2Ref:f,textareaElRef:s,textareaMirrorElRef:d,textareaScrollbarInstRef:b,rtlEnabled:ce,uncontrolledValue:C,mergedValue:k,passwordVisible:j,mergedPlaceholder:B,showPlaceholder1:E,showPlaceholder2:D,mergedFocus:_,isComposing:F,activated:O,showClearButton:L,mergedSize:P,mergedDisabled:T,textDecorationStyle:U,mergedClsPrefix:n,mergedBordered:t,mergedShowPasswordOn:H,placeholderStyle:re,mergedStatus:A,textAreaScrollContainerWidth:W,handleTextAreaScroll:function(e){var o;const{scrollTop:n}=e.target;re.value.top=-n+"px",null===(o=b.value)||void 0===o||o.syncUnifiedContainer()},handleCompositionStart:function(){F.value=!0},handleCompositionEnd:function(e){F.value=!1,e.target===f.value?Z(e,1):Z(e,0)},handleInput:Z,handleInputBlur:function(e){!function(e){const{onInputBlur:n}=o;n&&z(n,e)}(e),e.relatedTarget===i.value&&function(){const{onDeactivate:e}=o;e&&z(e)}(),(null===e.relatedTarget||e.relatedTarget!==u.value&&e.relatedTarget!==f.value&&e.relatedTarget!==s.value)&&(O.value=!1),Q(e,"blur"),m.value=null},handleInputFocus:function(e,n){!function(e){const{onInputFocus:n}=o;n&&z(n,e)}(e),R.value=!0,O.value=!0,function(){const{onActivate:e}=o;e&&z(e)}(),Q(e,"focus"),0===n?m.value=u.value:1===n?m.value=f.value:2===n&&(m.value=s.value)},handleWrapperBlur:function(e){o.passivelyActivated&&(!function(e){const{onWrapperBlur:n}=o;n&&z(n,e)}(e),Q(e,"blur"))},handleWrapperFocus:function(e){o.passivelyActivated&&(R.value=!0,function(e){const{onWrapperFocus:n}=o;n&&z(n,e)}(e),Q(e,"focus"))},handleMouseEnter:function(){var e;M.value=!0,"textarea"===o.type&&(null===(e=b.value)||void 0===e||e.handleMouseEnterWrapper())},handleMouseLeave:function(){var e;M.value=!1,"textarea"===o.type&&(null===(e=b.value)||void 0===e||e.handleMouseLeaveWrapper())},handleMouseDown:function(e){const{onMousedown:n}=o;n&&n(e);const{tagName:t}=e.target;if("INPUT"!==t&&"TEXTAREA"!==t){if(o.resizable){const{value:o}=i;if(o){const{left:n,top:t,width:r,height:a}=o.getBoundingClientRect(),l=14;if(n+r-l<e.clientX&&e.clientX<n+r&&t+a-l<e.clientY&&e.clientY<t+a)return}}e.preventDefault(),R.value||ne()}},handleChange:function(e,o){Z(e,o,"change")},handleClick:function(e){!function(e){const{onClick:n}=o;n&&z(n,e)}(e)},handleClear:function(e){!function(e){const{onClear:n}=o;n&&z(n,e)}(e),ee()},handlePasswordToggleClick:function(){T.value||"click"===H.value&&(j.value=!j.value)},handlePasswordToggleMousedown:function(e){if(T.value)return;e.preventDefault();const o=e=>{e.preventDefault(),be("mouseup",document,o)};if(ie("mouseup",document,o),"mousedown"!==H.value)return;j.value=!0;const n=()=>{j.value=!1,be("mouseup",document,n)};ie("mouseup",document,n)},handleWrapperKeydown:function(e){switch(o.onKeydown&&z(o.onKeydown,e),e.key){case"Escape":oe();break;case"Enter":!function(e){var n,t;if(o.passivelyActivated){const{value:r}=O;if(r)return void(o.internalDeactivateOnEnter&&oe());e.preventDefault(),"textarea"===o.type?null===(n=s.value)||void 0===n||n.focus():null===(t=u.value)||void 0===t||t.focus()}}(e)}},handleWrapperKeyup:function(e){o.onKeyup&&z(o.onKeyup,e)},handleTextAreaMirrorResize:function(){(()=>{var e,n;if("textarea"===o.type){const{autosize:t}=o;if(t&&(W.value=null===(n=null===(e=b.value)||void 0===e?void 0:e.$el)||void 0===n?void 0:n.offsetWidth),!s.value)return;if("boolean"==typeof t)return;const{paddingTop:r,paddingBottom:a,lineHeight:l}=window.getComputedStyle(s.value),i=Number(r.slice(0,-2)),c=Number(a.slice(0,-2)),u=Number(l.slice(0,-2)),{value:p}=d;if(!p)return;if(t.minRows){const e=`${i+c+u*Math.max(t.minRows,1)}px`;p.style.minHeight=e}if(t.maxRows){const e=`${i+c+u*t.maxRows}px`;p.style.maxHeight=e}}})()},getTextareaScrollContainer:()=>s.value,mergedTheme:l,cssVars:r?void 0:ue,themeClass:null==pe?void 0:pe.themeClass,onRender:null==pe?void 0:pe.onRender})},render(){var e,o,n,t,r,l,i;const{mergedClsPrefix:s,mergedStatus:d,themeClass:c,type:u,countGraphemes:p,onRender:h}=this,f=this.$slots;return null==h||h(),Ue("div",{ref:"wrapperElRef",class:[`${s}-input`,c,d&&`${s}-input--${d}-status`,{[`${s}-input--rtl`]:this.rtlEnabled,[`${s}-input--disabled`]:this.mergedDisabled,[`${s}-input--textarea`]:"textarea"===u,[`${s}-input--resizable`]:this.resizable&&!this.autosize,[`${s}-input--autosize`]:this.autosize,[`${s}-input--round`]:this.round&&!("textarea"===u),[`${s}-input--pair`]:this.pair,[`${s}-input--focus`]:this.mergedFocus,[`${s}-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},Ue("div",{class:`${s}-input-wrapper`},a(f.prefix,e=>e&&Ue("div",{class:`${s}-input__prefix`},e)),"textarea"===u?Ue(Ae,{ref:"textareaScrollbarInstRef",class:`${s}-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 Ue(co,null,Ue("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${s}-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?Ue("div",{class:`${s}-input__placeholder`,style:[this.placeholderStyle,t],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?Ue(C,{onResize:this.handleTextAreaMirrorResize},{default:()=>Ue("div",{ref:"textareaMirrorElRef",class:`${s}-input__textarea-mirror`,key:"mirror"})}):null)}}):Ue("div",{class:`${s}-input__input`},Ue("input",Object.assign({type:"password"===u&&this.mergedShowPasswordOn&&this.passwordVisible?"text":u},this.inputProps,{ref:"inputElRef",class:[`${s}-input__input-el`,null===(r=this.inputProps)||void 0===r?void 0:r.class],style:[this.textDecorationStyle[0],null===(l=this.inputProps)||void 0===l?void 0:l.style],tabindex:this.passivelyActivated&&!this.activated?-1:null===(i=this.inputProps)||void 0===i?void 0:i.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?Ue("div",{class:`${s}-input__placeholder`},Ue("span",null,this.mergedPlaceholder[0])):null,this.autosize?Ue("div",{class:`${s}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&a(f.suffix,e=>e||this.clearable||this.showCount||this.mergedShowPasswordOn||void 0!==this.loading?Ue("div",{class:`${s}-input__suffix`},[a(f["clear-icon-placeholder"],e=>(this.clearable||e)&&Ue(Cr,{clsPrefix:s,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?Ue(cl,{clsPrefix:s,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?e:null,this.showCount&&"textarea"!==this.type?Ue(Ol,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?Ue("div",{class:`${s}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Te(f["password-visible-icon"],()=>[Ue(ee,{clsPrefix:s},{default:()=>Ue(et,null)})]):Te(f["password-invisible-icon"],()=>[Ue(ee,{clsPrefix:s},{default:()=>Ue(br,null)})])):null]):null)),this.pair?Ue("span",{class:`${s}-input__separator`},Te(f.separator,()=>[this.separator])):null,this.pair?Ue("div",{class:`${s}-input-wrapper`},Ue("div",{class:`${s}-input__input`},Ue("input",{ref:"inputEl2Ref",type:this.type,class:`${s}-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?Ue("div",{class:`${s}-input__placeholder`},Ue("span",null,this.mergedPlaceholder[1])):null),a(f.suffix,e=>(this.clearable||e)&&Ue("div",{class:`${s}-input__suffix`},[this.clearable&&Ue(Cr,{clsPrefix:s,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?Ue("div",{class:`${s}-input__border`}):null,this.mergedBordered?Ue("div",{class:`${s}-input__state-border`}):null,this.showCount&&"textarea"===u?Ue(Ol,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 Bl(e){return"group"===e.type}function El(e){return"ignored"===e.type}function Dl(e,o){try{return!!(1+o.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch(n){return!1}}function _l(e,o){return{getIsGroup:Bl,getIgnored:El,getKey:o=>Bl(o)?o.name||o.key||"key-required":o[e],getChildren:e=>e[o]}}function Ll(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}var Hl=m({name:"AutoComplete",common:t,peers:{InternalSelectMenu:Hn,Input:Gn},self:Ll}),jl={name:"AutoComplete",common:ka,peers:{InternalSelectMenu:Xa,Input:Tl},self:Ll},Ul=Z([G("auto-complete","\n z-index: auto;\n position: relative;\n display: inline-flex;\n width: 100%;\n "),G("auto-complete-menu","\n margin: 4px 0;\n box-shadow: var(--n-menu-box-shadow);\n ",[jn({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Wl(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=>Wl(e))}:e}var Nl=Me({name:"AutoComplete",props:Object.assign(Object.assign({},g.props),{to:Nn.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}=J(e),a=ae(e),{mergedSizeRef:l,mergedDisabledRef:i,mergedStatusRef:s}=a,d=To(null),c=To(null),u=To(e.defaultValue),p=lo(e,"value"),h=w(p,u),f=To(!1),m=To(!1),v=g("AutoComplete","-auto-complete",Ul,Hl,e,t),b=to(()=>e.options.map(Wl)),y=to(()=>{const{getShow:o}=e;return o?o(h.value||""):!!h.value}),x=to(()=>y.value&&f.value&&(!!e.showEmpty||!!b.value.length)),C=to(()=>Ga(b.value,_l("value","children")));function S(o){const{"onUpdate:value":n,onUpdateValue:t,onInput:r}=e,{nTriggerFormInput:l,nTriggerFormChange:i}=a;t&&z(t,o),n&&z(n,o),r&&z(r,o),u.value=o,l(),i()}function k(o){var n,t;void 0!==(null==o?void 0:o.value)&&(!function(o){const{onSelect:n}=e,{nTriggerFormInput:t,nTriggerFormChange:r}=a;n&&z(n,o),t(),r()}(o.value),e.clearAfterSelect?S(null):void 0!==o.label&&S(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 I=to(()=>{const{common:{cubicBezierEaseInOut:e},self:{menuBoxShadow:o}}=v.value;return{"--n-menu-box-shadow":o,"--n-bezier":e}}),P=r?X("auto-complete",void 0,I,e):void 0,T=To(null),A={focus:()=>{var e;null===(e=T.value)||void 0===e||e.focus()},blur:()=>{var e;null===(e=T.value)||void 0===e||e.blur()}};return{focus:A.focus,blur:A.blur,inputInstRef:T,uncontrolledValue:u,mergedValue:h,isMounted:$(),adjustedTo:Nn(e),menuInstRef:c,triggerElRef:d,treeMate:C,mergedSize:l,mergedDisabled:i,active:x,mergedStatus:s,handleClear:function(){S(null)},handleFocus:function(o){f.value=!0,function(o){const{onFocus:n}=e,{nTriggerFormFocus:t}=a;n&&z(n,o),t()}(o)},handleBlur:function(o){f.value=!1,function(o){const{onBlur:n}=e,{nTriggerFormBlur:t}=a;n&&z(n,o),t()}(o)},handleInput:function(e){f.value=!0,S(e)},handleToggle:function(e){k(e.rawNode)},handleClickOutsideMenu:function(e){var o;(null===(o=d.value)||void 0===o?void 0:o.contains(ce(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&&(k(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:I,themeClass:null==P?void 0:P.themeClass,onRender:null==P?void 0:P.onRender,mergedBordered:o,namespace:n,mergedClsPrefix:t}},render(){const{mergedClsPrefix:e}=this;return Ue("div",{class:`${e}-auto-complete`,ref:"triggerElRef",onKeydown:this.handleKeyDown,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd},Ue(Mn,null,{default:()=>[Ue(Tn,null,{default:()=>{const e=this.$slots.default;if(e)return Fn("default",e,{handleInput:this.handleInput,handleFocus:this.handleFocus,handleBlur:this.handleBlur,value:this.mergedValue});const{mergedTheme:o}=this;return Ue($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)}})}}),Ue(ot,{show:this.active,to:this.adjustedTo,containerClass:this.namespace,zIndex:this.zIndex,teleportDisabled:this.adjustedTo===Nn.tdkey,placement:this.placement,width:"target"},{default:()=>Ue(go,{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 zo(Ue(nl,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)}}),[[Re,this.handleClickOutsideMenu,void 0,{capture:!0}]])}})})]}))}});function Kl(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:de(t,n),colorModal:de(c,n),colorPopover:de(u,n)}}var Vl={name:"Avatar",common:t,self:Kl},ql={name:"Avatar",common:ka,self:Kl};function Gl(){return{gap:"-12px"}}var Jl=m({name:"AvatarGroup",common:t,peers:{Avatar:Vl},self:Gl}),Yl={name:"AvatarGroup",common:ka,peers:{Avatar:ql},self:Gl},Zl={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},Xl={name:"BackTop",common:ka,self(e){const{popoverColor:o,textColor2:n,primaryColorHover:t,primaryColorPressed:r}=e;return Object.assign(Object.assign({},Zl),{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 Ql={name:"BackTop",common:t,self:function(e){const{popoverColor:o,textColor2:n,primaryColorHover:t,primaryColorPressed:r}=e;return Object.assign(Object.assign({},Zl),{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)"})}},ei={name:"Badge",common:ka,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 oi={name:"Badge",common:t,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}}},ni={fontWeightActive:"400"};function ti(e){const{fontSize:o,textColor3:n,textColor2:t,borderRadius:r,buttonColor2Hover:a,buttonColor2Pressed:l}=e;return Object.assign(Object.assign({},ni),{fontSize:o,itemLineHeight:"1.25",itemTextColor:n,itemTextColorHover:t,itemTextColorPressed:t,itemTextColorActive:t,itemBorderRadius:r,itemColorHover:a,itemColorPressed:l,separatorColor:n})}var ri={name:"Breadcrumb",common:t,self:ti},ai={name:"Breadcrumb",common:ka,self:ti},li={name:"Button",common:ka,self(e){const o=ye(e);return o.waveOpacity="0.8",o.colorOpacitySecondary="0.16",o.colorOpacitySecondaryHover="0.2",o.colorOpacitySecondaryPressed="0.12",o}},ii={titleFontSize:"22px"};function si(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({},ii),{borderRadius:o,borderColor:de(p,i),borderColorModal:de(h,i),borderColorPopover:de(f,i),textColor:r,titleFontWeight:s,titleTextColor:a,dayTextColor:l,fontSize:n,lineHeight:t,dateColorCurrent:d,dateTextColorCurrent:c,cellColorHover:de(p,u),cellColorHoverModal:de(h,u),cellColorHoverPopover:de(f,u),cellColor:p,cellColorModal:h,cellColorPopover:f,barColor:d})}var di=m({name:"Calendar",common:t,peers:{Button:te},self:si}),ci={name:"Calendar",common:ka,peers:{Button:li},self:si},ui={name:"Card",common:ka,self(e){const o=rt(e),{cardColor:n,modalColor:t,popoverColor:r}=e;return o.colorEmbedded=n,o.colorEmbeddedModal=t,o.colorEmbeddedPopover=r,o}};function pi(){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 hi={name:"Carousel",common:t,self:pi},fi={name:"Carousel",common:ka,self:pi},mi={name:"Checkbox",common:ka,self(e){const{cardColor:o}=e,n=lt(e);return n.color="#0000",n.checkMarkColor=o,n}};function vi(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 gi=m({name:"Cascader",common:t,peers:{InternalSelectMenu:Hn,InternalSelection:Dn,Scrollbar:Ie,Checkbox:it,Empty:B},self:vi}),bi={name:"Cascader",common:ka,peers:{InternalSelectMenu:Xa,InternalSelection:ul,Scrollbar:Ia,Checkbox:mi,Empty:B},self:vi},yi=O("n-checkbox-group"),xi=Me({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}=J(e),n=ae(e),{mergedSizeRef:t,mergedDisabledRef:r}=n,a=To(e.defaultValue),l=to(()=>e.value),i=w(l,a),s=to(()=>{var e;return(null===(e=i.value)||void 0===e?void 0:e.length)||0}),d=to(()=>Array.isArray(i.value)?new Set(i.value):new Set);return Ee(yi,{checkedCountRef:s,maxRef:lo(e,"max"),minRef:lo(e,"min"),valueSetRef:d,disabledRef:r,mergedSizeRef:t,toggleCheckbox:function(o,t){const{nTriggerFormInput:r,nTriggerFormChange:l}=n,{onChange:s,"onUpdate:value":d,onUpdateValue:c}=e;if(Array.isArray(i.value)){const e=Array.from(i.value),n=e.findIndex(e=>e===t);o?~n||(e.push(t),c&&z(c,e,{actionType:"check",value:t}),d&&z(d,e,{actionType:"check",value:t}),r(),l(),a.value=e,s&&z(s,e)):~n&&(e.splice(n,1),c&&z(c,e,{actionType:"uncheck",value:t}),d&&z(d,e,{actionType:"uncheck",value:t}),s&&z(s,e),a.value=e,r(),l())}else o?(c&&z(c,[t],{actionType:"check",value:t}),d&&z(d,[t],{actionType:"check",value:t}),s&&z(s,[t]),a.value=[t],r(),l()):(c&&z(c,[],{actionType:"uncheck",value:t}),d&&z(d,[],{actionType:"uncheck",value:t}),s&&z(s,[]),a.value=[],r(),l())}}),{mergedClsPrefix:o}},render(){return Ue("div",{class:`${this.mergedClsPrefix}-checkbox-group`,role:"group"},this.$slots)}}),Ci=Z([G("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 ",[ze("show-label","line-height: var(--n-label-line-height);"),Z("&:hover",[G("checkbox-box",[we("border","border: var(--n-border-checked);")])]),Z("&:focus:not(:active)",[G("checkbox-box",[we("border","\n border: var(--n-border-focus);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),ze("inside-table",[G("checkbox-box","\n background-color: var(--n-merged-color-table);\n ")]),ze("checked",[G("checkbox-box","\n background-color: var(--n-color-checked);\n ",[G("checkbox-icon",[Z(".check-icon","\n opacity: 1;\n transform: scale(1);\n ")])])]),ze("indeterminate",[G("checkbox-box",[G("checkbox-icon",[Z(".check-icon","\n opacity: 0;\n transform: scale(.5);\n "),Z(".line-icon","\n opacity: 1;\n transform: scale(1);\n ")])])]),ze("checked, indeterminate",[Z("&:focus:not(:active)",[G("checkbox-box",[we("border","\n border: var(--n-border-checked);\n box-shadow: var(--n-box-shadow-focus);\n ")])]),G("checkbox-box","\n background-color: var(--n-color-checked);\n border-left: 0;\n border-top: 0;\n ",[we("border",{border:"var(--n-border-checked)"})])]),ze("disabled",{cursor:"not-allowed"},[ze("checked",[G("checkbox-box","\n background-color: var(--n-color-disabled-checked);\n ",[we("border",{border:"var(--n-border-disabled-checked)"}),G("checkbox-icon",[Z(".check-icon, .line-icon",{fill:"var(--n-check-mark-color-disabled-checked)"})])])]),G("checkbox-box","\n background-color: var(--n-color-disabled);\n ",[we("border","\n border: var(--n-border-disabled);\n "),G("checkbox-icon",[Z(".check-icon, .line-icon","\n fill: var(--n-check-mark-color-disabled);\n ")])]),we("label","\n color: var(--n-text-color-disabled);\n ")]),G("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 "),G("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 ",[we("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 "),G("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 ",[Z(".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 "),b({left:"1px",top:"1px"})])]),we("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 ",[Z("&:empty",{display:"none"})])]),I(G("checkbox","\n --n-merged-color-table: var(--n-color-table-modal);\n ")),r(G("checkbox","\n --n-merged-color-table: var(--n-color-table-popover);\n "))]),wi=Me({name:"Checkbox",props:Object.assign(Object.assign({},g.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(o){const n=We(yi,null),t=To(null),{mergedClsPrefixRef:r,inlineThemeDisabled:a,mergedRtlRef:l}=J(o),i=To(o.defaultChecked),s=lo(o,"checked"),d=w(s,i),c=e(()=>{if(n){const e=n.valueSetRef.value;return!(!e||void 0===o.value)&&e.has(o.value)}return d.value===o.checkedValue}),u=ae(o,{mergedSize(e){const{size:t}=o;if(void 0!==t)return t;if(n){const{value:e}=n.mergedSizeRef;if(void 0!==e)return e}if(e){const{mergedSize:o}=e;if(void 0!==o)return o.value}return"medium"},mergedDisabled(e){const{disabled:t}=o;if(void 0!==t)return t;if(n){if(n.disabledRef.value)return!0;const{maxRef:{value:e},checkedCountRef:o}=n;if(void 0!==e&&o.value>=e&&!c.value)return!0;const{minRef:{value:t}}=n;if(void 0!==t&&o.value<=t&&c.value)return!0}return!!e&&e.disabled.value}}),{mergedDisabledRef:h,mergedSizeRef:f}=u,m=g("Checkbox","-checkbox",Ci,it,o,r);function v(e){if(n&&void 0!==o.value)n.toggleCheckbox(!c.value,o.value);else{const{onChange:n,"onUpdate:checked":t,onUpdateChecked:r}=o,{nTriggerFormInput:a,nTriggerFormChange:l}=u,s=c.value?o.uncheckedValue:o.checkedValue;t&&z(t,s,e),r&&z(r,s,e),n&&z(n,s,e),a(),l(),i.value=s}}const b={focus:()=>{var e;null===(e=t.value)||void 0===e||e.focus()},blur:()=>{var e;null===(e=t.value)||void 0===e||e.blur()}},y=p("Checkbox",l,r),x=to(()=>{const{value:e}=f,{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:h,borderChecked:v,boxShadowFocus:g,textColor:b,textColorDisabled:y,checkMarkColorDisabledChecked:x,colorDisabledChecked:C,borderDisabledChecked:w,labelPadding:S,labelLineHeight:k,labelFontWeight:I,[Pe("fontSize",e)]:P,[Pe("size",e)]:T}}=m.value;return{"--n-label-line-height":k,"--n-label-font-weight":I,"--n-size":T,"--n-bezier":o,"--n-border-radius":n,"--n-border":u,"--n-border-checked":v,"--n-border-focus":p,"--n-border-disabled":h,"--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":P,"--n-label-padding":S}}),C=a?X("checkbox",to(()=>f.value[0]),x,o):void 0;return Object.assign(u,b,{rtlEnabled:y,selfRef:t,mergedClsPrefix:r,mergedDisabled:h,renderedChecked:c,mergedTheme:m,labelId:fe(),handleClick:function(e){h.value||v(e)},handleKeyUp:function(e){if(!h.value)switch(e.key){case" ":case"Enter":v(e)}},handleKeyDown:function(e){if(" "===e.key)e.preventDefault()},cssVars:a?void 0:x,themeClass:null==C?void 0:C.themeClass,onRender:null==C?void 0:C.onRender})},render(){var e;const{$slots:n,renderedChecked:t,mergedDisabled:r,indeterminate:l,privateInsideTable:i,cssVars:s,labelId:d,label:c,mergedClsPrefix:u,focusable:p,handleKeyUp:h,handleKeyDown:f,handleClick:m}=this;null===(e=this.onRender)||void 0===e||e.call(this);const v=a(n.default,e=>c||e?Ue("span",{class:`${u}-checkbox__label`,id:d},c||e):null);return Ue("div",{ref:"selfRef",class:[`${u}-checkbox`,this.themeClass,this.rtlEnabled&&`${u}-checkbox--rtl`,t&&`${u}-checkbox--checked`,r&&`${u}-checkbox--disabled`,l&&`${u}-checkbox--indeterminate`,i&&`${u}-checkbox--inside-table`,v&&`${u}-checkbox--show-label`],tabindex:r||!p?void 0:0,role:"checkbox","aria-checked":l?"mixed":t,"aria-labelledby":d,style:s,onKeyup:h,onKeydown:f,onClick:m,onMousedown:()=>{ie("selectstart",window,e=>{e.preventDefault()},{once:!0})}},Ue("div",{class:`${u}-checkbox-box-wrapper`}," ",Ue("div",{class:`${u}-checkbox-box`},Ue(o,null,{default:()=>this.indeterminate?Ue("div",{key:"indeterminate",class:`${u}-checkbox-icon`},Ue("svg",{viewBox:"0 0 100 100",class:"line-icon"},Ue("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"}))):Ue("div",{key:"check",class:`${u}-checkbox-icon`},Ue("svg",{viewBox:"0 0 64 64",class:"check-icon"},Ue("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"})))}),Ue("div",{class:`${u}-checkbox-box__border`}))),v)}}),Si={name:"Code",common:ka,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 ki={name:"Code",common:t,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 Pi={name:"Collapse",common:t,self:Ii},Ti={name:"Collapse",common:ka,self:Ii};function Ai(e){const{cubicBezierEaseInOut:o}=e;return{bezier:o}}var zi={name:"CollapseTransition",common:t,self:Ai},Ri={name:"CollapseTransition",common:ka,self:Ai};function Mi(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 Fi=m({name:"ColorPicker",common:t,peers:{Input:Gn,Button:te},self:Mi}),Oi={name:"ColorPicker",common:ka,peers:{Input:Tl,Button:li},self:Mi},$i=Me({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:()=>(y("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},setup(o){const n=We(E,null),t=to(()=>{const{theme:e}=o;if(null===e)return;const t=null==n?void 0:n.mergedThemeRef.value;return void 0===e?t:void 0===t?e:Object.assign({},t,e)}),r=to(()=>{const{themeOverrides:e}=o;if(null!==e){if(void 0===e)return null==n?void 0:n.mergedThemeOverridesRef.value;{const o=null==n?void 0:n.mergedThemeOverridesRef.value;return void 0===o?e:S({},o,e)}}}),a=e(()=>{const{namespace:e}=o;return void 0===e?null==n?void 0:n.mergedNamespaceRef.value:e}),l=e(()=>{const{bordered:e}=o;return void 0===e?null==n?void 0:n.mergedBorderedRef.value:e}),i=to(()=>{const{icons:e}=o;return void 0===e?null==n?void 0:n.mergedIconsRef.value:e}),s=to(()=>{const{componentOptions:e}=o;return void 0!==e?e:null==n?void 0:n.mergedComponentPropsRef.value}),d=to(()=>{const{clsPrefix:e}=o;return void 0!==e?e:n?n.mergedClsPrefixRef.value:"n"}),c=to(()=>{var e;const{rtl:t}=o;if(void 0===t)return null==n?void 0:n.mergedRtlRef.value;const r={};for(const o of t)r[o.name]=Po(o),null===(e=o.peers)||void 0===e||e.forEach(e=>{e.name in r||(r[e.name]=Po(e))});return r}),u=to(()=>o.breakpoints||(null==n?void 0:n.mergedBreakpointsRef.value)),p=o.inlineThemeDisabled||(null==n?void 0:n.inlineThemeDisabled),h=o.preflightStyleDisabled||(null==n?void 0:n.preflightStyleDisabled),f=o.styleMountTarget||(null==n?void 0:n.styleMountTarget),m=to(()=>{const{value:e}=t,{value:o}=r,n=o&&0!==Object.keys(o).length,a=null==e?void 0:e.name;return a?n?`${a}-${A(JSON.stringify(r.value))}`:a:n?A(JSON.stringify(r.value)):""});return Ee(E,{mergedThemeHashRef:m,mergedBreakpointsRef:u,mergedRtlRef:c,mergedIconsRef:i,mergedComponentPropsRef:s,mergedBorderedRef:l,mergedNamespaceRef:a,mergedClsPrefixRef:d,mergedLocaleRef:to(()=>{const{locale:e}=o;if(null!==e)return void 0===e?null==n?void 0:n.mergedLocaleRef.value:e}),mergedDateLocaleRef:to(()=>{const{dateLocale:e}=o;if(null!==e)return void 0===e?null==n?void 0:n.mergedDateLocaleRef.value:e}),mergedHljsRef:to(()=>{const{hljs:e}=o;return void 0===e?null==n?void 0:n.mergedHljsRef.value:e}),mergedKatexRef:to(()=>{const{katex:e}=o;return void 0===e?null==n?void 0:n.mergedKatexRef.value:e}),mergedThemeRef:t,mergedThemeOverridesRef:r,inlineThemeDisabled:p||!1,preflightStyleDisabled:h||!1,styleMountTarget:f}),{mergedClsPrefix:d,mergedBordered:l,mergedNamespace:a,mergedTheme:t,mergedThemeOverrides:r}},render(){var e,o,n,t;return this.abstract?null===(t=(n=this.$slots).default)||void 0===t?void 0:t.call(n):Ue(this.as||this.tag,{class:`${this.mergedClsPrefix||"n"}-config-provider`},null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e))}}),Bi={name:"Popselect",common:ka,peers:{Popover:tl,InternalSelectMenu:Xa}};var Ei=m({name:"Popselect",common:t,peers:{Popover:Jn,InternalSelectMenu:Hn},self:function(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}}),Di={name:"Select",common:ka,peers:{InternalSelection:ul,InternalSelectMenu:Xa},self:Bn},_i=Z([G("select","\n z-index: auto;\n outline: none;\n width: 100%;\n position: relative;\n font-weight: var(--n-font-weight);\n "),G("select-menu","\n margin: 4px 0;\n box-shadow: var(--n-menu-box-shadow);\n ",[jn({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),Li=Me({name:"Select",props:Object.assign(Object.assign({},g.props),{to:Nn.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:t,namespaceRef:r,inlineThemeDisabled:a}=J(e),l=g("Select","-select",_i,Un,e,o),i=To(e.defaultValue),s=lo(e,"value"),d=w(s,i),c=To(!1),u=To(""),p=F(e,["items","options"]),f=To([]),m=To([]),v=to(()=>m.value.concat(f.value).concat(p.value)),b=to(()=>{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 Dl(e,r);const a=o[t];return"string"==typeof a?Dl(e,a):"number"==typeof a&&Dl(e,String(a))}}),y=to(()=>{if(e.remote)return p.value;{const{value:o}=v,{value:n}=u;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(Bl(l)){const o=e(l[t]);o.length&&a.push(Object.assign({},l,{[t]:o}))}else{if(El(l))continue;o(n,l)&&a.push(l)}return a}(e):e}(o,b.value,n,e.childrenField):o}}),x=to(()=>{const{valueField:o,childrenField:n}=e,t=_l(o,n);return Ga(y.value,t)}),C=to(()=>function(e,o,n){const t=new Map;return e.forEach(e=>{Bl(e)?e[n].forEach(e=>{t.set(e[o],e)}):t.set(e[o],e)}),t}(v.value,e.valueField,e.childrenField)),S=To(!1),k=w(lo(e,"show"),S),I=To(null),P=To(null),T=To(null),{localeRef:A}=h("Select"),R=to(()=>{var o;return null!==(o=e.placeholder)&&void 0!==o?o:A.value.placeholder}),M=[],O=To(new Map),B=to(()=>{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 E(o){const n=e.remote,{value:t}=O,{value:r}=C,{value:a}=B,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 D=to(()=>{if(e.multiple){const{value:e}=d;return Array.isArray(e)?E(e):[]}return null}),_=to(()=>{const{value:o}=d;return e.multiple||Array.isArray(o)||null===o?null:E([o])[0]||null}),L=ae(e),{mergedSizeRef:H,mergedDisabledRef:j,mergedStatusRef:U}=L;function W(o,n){const{onChange:t,"onUpdate:value":r,onUpdateValue:a}=e,{nTriggerFormChange:l,nTriggerFormInput:s}=L;t&&z(t,o,n),a&&z(a,o,n),r&&z(r,o,n),i.value=o,l(),s()}function N(o){const{onBlur:n}=e,{nTriggerFormBlur:t}=L;n&&z(n,o),t()}function K(){var o;const{remote:n,multiple:t}=e;if(n){const{value:n}=O;if(t){const{valueField:t}=e;null===(o=D.value)||void 0===o||o.forEach(e=>{n.set(e[t],e)})}else{const o=_.value;o&&n.set(o[e.valueField],o)}}}function V(o){const{onUpdateShow:n,"onUpdate:show":t}=e;n&&z(n,o),t&&z(t,o),S.value=o}function q(){j.value||(V(!0),S.value=!0,e.filterable&&re())}function G(){V(!1)}function Y(){u.value="",m.value=M}const Z=To(!1);function Q(e){ee(e.rawNode)}function ee(o){if(j.value)return;const{tag:n,remote:t,clearFilterAfterSelect:r,valueField:a}=e;if(n&&!t){const{value:e}=m,o=e[0]||null;if(o){const e=f.value;e.length?e.push(o):f.value=[o],m.value=M}}if(t&&O.value.set(o[a],o),e.multiple){const l=function(o){if(!Array.isArray(o))return[];if(B.value)return Array.from(o);{const{remote:n}=e,{value:t}=C;if(n){const{value:e}=O;return o.filter(o=>t.has(o)||e.has(o))}return o.filter(e=>t.has(e))}}(d.value),i=l.findIndex(e=>e===o[a]);if(~i){if(l.splice(i,1),n&&!t){const e=oe(o[a]);~e&&(f.value.splice(e,1),r&&(u.value=""))}}else l.push(o[a]),r&&(u.value="");W(l,E(l))}else{if(n&&!t){const e=oe(o[a]);f.value=~e?[f.value[e]]:M}te(),G(),W(o[a],o)}}function oe(o){return f.value.findIndex(n=>n[e.valueField]===o)}function ne(o){var t,r,a,l,i;if(e.keyboard)switch(o.key){case" ":if(e.filterable)break;o.preventDefault();case"Enter":if(!(null===(t=I.value)||void 0===t?void 0:t.isComposing))if(k.value){const o=null===(r=T.value)||void 0===r?void 0:r.getPendingTmNode();o?Q(o):e.filterable||(G(),te())}else if(q(),e.tag&&Z.value){const o=m.value[0];if(o){const n=o[e.valueField],{value:t}=d;e.multiple&&Array.isArray(t)&&t.includes(n)||ee(o)}}o.preventDefault();break;case"ArrowUp":if(o.preventDefault(),e.loading)return;k.value&&(null===(a=T.value)||void 0===a||a.prev());break;case"ArrowDown":if(o.preventDefault(),e.loading)return;k.value?null===(l=T.value)||void 0===l||l.next():q();break;case"Escape":k.value&&(n(o),G()),null===(i=I.value)||void 0===i||i.focus()}else o.preventDefault()}function te(){var e;null===(e=I.value)||void 0===e||e.focus()}function re(){var e;null===(e=I.value)||void 0===e||e.focusInput()}K(),Xe(lo(e,"options"),K);const le={focus:()=>{var e;null===(e=I.value)||void 0===e||e.focus()},focusInput:()=>{var e;null===(e=I.value)||void 0===e||e.focusInput()},blur:()=>{var e;null===(e=I.value)||void 0===e||e.blur()},blurInput:()=>{var e;null===(e=I.value)||void 0===e||e.blurInput()}},ie=to(()=>{const{self:{menuBoxShadow:e}}=l.value;return{"--n-menu-box-shadow":e}}),se=a?X("select",void 0,ie,e):void 0;return Object.assign(Object.assign({},le),{mergedStatus:U,mergedClsPrefix:o,mergedBordered:t,namespace:r,treeMate:x,isMounted:$(),triggerRef:I,menuRef:T,pattern:u,uncontrolledShow:S,mergedShow:k,adjustedTo:Nn(e),uncontrolledValue:i,mergedValue:d,followerRef:P,localizedPlaceholder:R,selectedOption:_,selectedOptions:D,mergedSize:H,mergedDisabled:j,focused:c,activeWithoutMenuOpen:Z,inlineThemeDisabled:a,onTriggerInputFocus:function(){e.filterable&&(Z.value=!0)},onTriggerInputBlur:function(){e.filterable&&(Z.value=!1,k.value||Y())},handleTriggerOrMenuResize:function(){var e;k.value&&(null===(e=P.value)||void 0===e||e.syncPosition())},handleMenuFocus:function(){c.value=!0},handleMenuBlur:function(e){var o;(null===(o=I.value)||void 0===o?void 0:o.$el.contains(e.relatedTarget))||(c.value=!1,N(e),G())},handleMenuTabOut:function(){var e;null===(e=I.value)||void 0===e||e.focus(),G()},handleTriggerClick:function(){j.value||(k.value?e.filterable?re():G():q())},handleToggle:Q,handleDeleteOption:ee,handlePatternInput:function(o){k.value||q();const{value:n}=o.target;u.value=n;const{tag:t,remote:r}=e;if(function(o){const{onSearch:n}=e;n&&z(n,o)}(n),t&&!r){if(!n)return void(m.value=M);const{onCreate:o}=e,t=o?o(n):{[e.labelField]:n,[e.valueField]:n},{valueField:r,labelField:a}=e;p.value.some(e=>e[r]===t[r]||e[a]===t[a])||f.value.some(e=>e[r]===t[r]||e[a]===t[a])?m.value=M:m.value=[t]}},handleClear:function(o){o.stopPropagation();const{multiple:n}=e;!n&&e.filterable&&G(),function(){const{onClear:o}=e;o&&z(o)}(),n?W([],[]):W(null,null)},handleTriggerBlur:function(e){var o,n;(null===(n=null===(o=T.value)||void 0===o?void 0:o.selfRef)||void 0===n?void 0:n.contains(e.relatedTarget))||(c.value=!1,N(e),G())},handleTriggerFocus:function(o){!function(o){const{onFocus:n,showOnFocus:t}=e,{nTriggerFormFocus:r}=L;n&&z(n,o),r(),t&&q()}(o),c.value=!0},handleKeydown:ne,handleMenuAfterLeave:Y,handleMenuClickOutside:function(e){var o;k.value&&((null===(o=I.value)||void 0===o?void 0:o.$el.contains(ce(e)))||G())},handleMenuScroll:function(o){!function(o){const{onScroll:n}=e;n&&z(n,o)}(o)},handleMenuKeydown:ne,handleMenuMousedown:function(e){Kt(e,"action")||Kt(e,"empty")||Kt(e,"header")||e.preventDefault()},mergedTheme:l,cssVars:a?void 0:ie,themeClass:null==se?void 0:se.themeClass,onRender:null==se?void 0:se.onRender})},render(){return Ue("div",{class:`${this.mergedClsPrefix}-select`},Ue(Mn,null,{default:()=>[Ue(Tn,null,{default:()=>Ue(hl,{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)]}})}),Ue(ot,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Nn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>Ue(go,{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),zo(Ue(nl,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?[[so,this.mergedShow],[Re,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Re,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Hi={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 ji(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({},Hi),{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 Ui=m({name:"Pagination",common:t,peers:{Select:Un,Input:Gn,Popselect:Ei},self:ji}),Wi={name:"Pagination",common:ka,peers:{Select:Di,Input:Tl,Popselect:Bi},self(e){const{primaryColor:o,opacity3:n}=e,t=_(o,{alpha:Number(n)}),r=ji(e);return r.itemBorderActive=`1px solid ${t}`,r.itemBorderDisabled="1px solid #0000",r}},Ni={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 Ki(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({},Ni),{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:_(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 Vi=m({name:"Dropdown",common:t,peers:{Popover:Jn},self:Ki}),qi={name:"Dropdown",common:ka,peers:{Popover:tl},self(e){const{primaryColorSuppl:o,primaryColor:n,popoverColor:t}=e,r=Ki(e);return r.colorInverted=t,r.optionColorActive=_(n,{alpha:.15}),r.optionColorActiveInverted=o,r.optionColorHoverInverted=o,r}},Gi={padding:"8px 14px"},Ji={name:"Tooltip",common:ka,peers:{Popover:tl},self(e){const{borderRadius:o,boxShadow2:n,popoverColor:t,textColor2:r}=e;return Object.assign(Object.assign({},Gi),{borderRadius:o,boxShadow:n,color:t,textColor:r})}};var Yi=m({name:"Tooltip",common:t,peers:{Popover:Jn},self:function(e){const{borderRadius:o,boxShadow2:n,baseColor:t}=e;return Object.assign(Object.assign({},Gi),{borderRadius:o,boxShadow:n,color:de(t,"rgba(0, 0, 0, .85)"),textColor:t})}}),Zi={name:"Ellipsis",common:ka,peers:{Tooltip:Ji}},Xi=m({name:"Ellipsis",common:t,peers:{Tooltip:Yi}}),Qi={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},es={name:"Radio",common:ka,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({},Qi),{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 ${_(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 ${_(n,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${n}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}};var os={name:"Radio",common:t,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({},Qi),{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 ${_(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 ${_(n,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}},ns={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 ts(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({},ns),{actionDividerColor:v,lineHeight:p,borderRadius:u,fontSizeSmall:h,fontSizeMedium:f,fontSizeLarge:m,borderColor:de(o,v),tdColorHover:de(o,i),tdColorSorting:de(o,i),tdColorStriped:de(o,y),thColor:de(o,l),thColorHover:de(de(o,l),i),thColorSorting:de(de(o,l),i),tdColor:o,tdTextColor:r,thTextColor:a,thFontWeight:c,thButtonColorHover:i,thIconColor:s,thIconColorActive:d,borderColorModal:de(n,v),tdColorHoverModal:de(n,i),tdColorSortingModal:de(n,i),tdColorStripedModal:de(n,y),thColorModal:de(n,l),thColorHoverModal:de(de(n,l),i),thColorSortingModal:de(de(n,l),i),tdColorModal:n,borderColorPopover:de(t,v),tdColorHoverPopover:de(t,i),tdColorSortingPopover:de(t,i),tdColorStripedPopover:de(t,y),thColorPopover:de(t,l),thColorHoverPopover:de(de(t,l),i),thColorSortingPopover:de(de(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 rs=m({name:"DataTable",common:t,peers:{Button:te,Checkbox:it,Radio:os,Pagination:Ui,Scrollbar:Ie,Empty:B,Popover:Jn,Ellipsis:Xi,Dropdown:Vi},self:ts}),as={name:"DataTable",common:ka,peers:{Button:li,Checkbox:mi,Radio:es,Pagination:Wi,Scrollbar:Ia,Empty:Ja,Popover:tl,Ellipsis:Zi,Dropdown:qi},self(e){const o=ts(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}},ls=G("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",[ze("checked",[we("dot","\n background-color: var(--n-color-active);\n ")]),we("dot-wrapper","\n position: relative;\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--n-radio-size);\n "),G("radio-input","\n position: absolute;\n border: 0;\n width: 0;\n height: 0;\n opacity: 0;\n margin: 0;\n "),we("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 ",[Z("&::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 '),ze("checked",{boxShadow:"var(--n-box-shadow-active)"},[Z("&::before","\n opacity: 1;\n transform: scale(1);\n ")])]),we("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 "),H("disabled","\n cursor: pointer;\n ",[Z("&:hover",[we("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),ze("focus",[Z("&:not(:active)",[we("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),ze("disabled","\n cursor: not-allowed;\n ",[we("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[Z("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),ze("checked","\n opacity: 1;\n ")]),we("label",{color:"var(--n-text-color-disabled)"}),G("radio-input","\n cursor: not-allowed;\n ")])]),is={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}},ss=O("n-radio-group");function ds(o){const n=We(ss,null),t=ae(o,{mergedSize(e){const{size:t}=o;if(void 0!==t)return t;if(n){const{mergedSizeRef:{value:e}}=n;if(void 0!==e)return e}return e?e.mergedSize.value:"medium"},mergedDisabled:e=>!!o.disabled||(!!(null==n?void 0:n.disabledRef.value)||!!(null==e?void 0:e.disabled.value))}),{mergedSizeRef:r,mergedDisabledRef:a}=t,l=To(null),i=To(null),s=To(o.defaultChecked),d=lo(o,"checked"),c=w(d,s),u=e(()=>n?n.valueRef.value===o.value:c.value),p=e(()=>{const{name:e}=o;return void 0!==e?e:n?n.nameRef.value:void 0}),h=To(!1);function f(){a.value||u.value||function(){if(n){const{doUpdateValue:e}=n,{value:t}=o;z(e,t)}else{const{onUpdateChecked:e,"onUpdate:checked":n}=o,{nTriggerFormInput:r,nTriggerFormChange:a}=t;e&&z(e,!0),n&&z(n,!0),r(),a(),s.value=!0}}()}return{mergedClsPrefix:n?n.mergedClsPrefixRef:J(o).mergedClsPrefixRef,inputRef:l,labelRef:i,mergedName:p,mergedDisabled:a,renderSafeChecked:u,focus:h,mergedSize:r,handleRadioInputChange:function(){f(),l.value&&(l.value.checked=u.value)},handleRadioInputBlur:function(){h.value=!1},handleRadioInputFocus:function(){h.value=!0}}}var cs=Me({name:"Radio",props:Object.assign(Object.assign({},g.props),is),setup(e){const o=ds(e),n=g("Radio","-radio",ls,os,e,o.mergedClsPrefix),t=to(()=>{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,[Pe("fontSize",e)]:y,[Pe("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}=J(e),i=p("Radio",l,a),s=r?X("radio",to(()=>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(),Ue("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},Ue("div",{class:`${o}-radio__dot-wrapper`}," ",Ue("div",{class:[`${o}-radio__dot`,this.renderSafeChecked&&`${o}-radio__dot--checked`]}),Ue("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})),a(e.default,e=>e||t?Ue("div",{ref:"labelRef",class:`${o}-radio__label`},e||t):null))}}),us=G("radio-group","\n display: inline-block;\n font-size: var(--n-font-size);\n",[we("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 ",[ze("checked",{backgroundColor:"var(--n-button-border-color-active)"}),ze("disabled",{opacity:"var(--n-opacity-disabled)"})]),ze("button-group","\n white-space: nowrap;\n height: var(--n-height);\n line-height: var(--n-height);\n ",[G("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),we("splitor",{height:"var(--n-height)"})]),G("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 ",[G("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 "),we("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 "),Z("&: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 ",[we("state-border","\n border-top-left-radius: var(--n-button-border-radius);\n border-bottom-left-radius: var(--n-button-border-radius);\n ")]),Z("&: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 ",[we("state-border","\n border-top-right-radius: var(--n-button-border-radius);\n border-bottom-right-radius: var(--n-button-border-radius);\n ")]),H("disabled","\n cursor: pointer;\n ",[Z("&:hover",[we("state-border","\n transition: box-shadow .3s var(--n-bezier);\n box-shadow: var(--n-button-box-shadow-hover);\n "),H("checked",{color:"var(--n-button-text-color-hover)"})]),ze("focus",[Z("&:not(:active)",[we("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),ze("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 "),ze("disabled","\n cursor: not-allowed;\n opacity: var(--n-opacity-disabled);\n ")])]);var ps=Me({name:"RadioGroup",props:Object.assign(Object.assign({},g.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=To(null),{mergedSizeRef:n,mergedDisabledRef:t,nTriggerFormChange:r,nTriggerFormInput:a,nTriggerFormBlur:l,nTriggerFormFocus:i}=ae(e),{mergedClsPrefixRef:s,inlineThemeDisabled:d,mergedRtlRef:c}=J(e),u=g("Radio","-radio-group",us,os,e,s),h=To(e.defaultValue),f=lo(e,"value"),m=w(f,h);Ee(ss,{mergedClsPrefixRef:s,nameRef:lo(e,"name"),valueRef:m,disabledRef:t,mergedSizeRef:n,doUpdateValue:function(o){const{onUpdateValue:n,"onUpdate:value":t}=e;n&&z(n,o),t&&z(t,o),h.value=o,r(),a()}});const v=p("Radio",c,s),b=to(()=>{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:p,buttonTextColorActive:h,buttonTextColorHover:f,opacityDisabled:m,[Pe("buttonHeight",e)]:v,[Pe("fontSize",e)]:g}}=u.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":p,"--n-button-text-color-hover":f,"--n-button-text-color-active":h,"--n-height":v,"--n-opacity-disabled":m}}),y=d?X("radio-group",to(()=>n.value[0]),b,e):void 0;return{selfElRef:o,rtlEnabled:v,mergedClsPrefix:s,mergedValue:m,handleFocusout:function(e){const{value:n}=o;n&&(n.contains(e.relatedTarget)||l())},handleFocusin:function(e){const{value:n}=o;n&&(n.contains(e.relatedTarget)||i())},cssVars:d?void 0:b,themeClass:null==y?void 0:y.themeClass,onRender:null==y?void 0:y.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),u=(l?2:0)+(s?0:1),p={[`${n}-radio-group__splitor--disabled`]:a,[`${n}-radio-group__splitor--checked`]:t},h=c<u?{[`${n}-radio-group__splitor--disabled`]:s,[`${n}-radio-group__splitor--checked`]:l}:p;r.push(Ue("div",{class:[`${n}-radio-group__splitor`,h]}),i)}else r.push(i)}return{children:r,isButtonGroup:a}}(Pn(dr(this)),o,n);return null===(e=this.onRender)||void 0===e||e.call(this),Ue("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)}}),hs=Me({name:"Tooltip",props:Object.assign(Object.assign({},_n),g.props),slots:Object,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=J(e),n=g("Tooltip","-tooltip",void 0,Yi,e,o),t=To(null);return Object.assign(Object.assign({},{syncPosition(){t.value.syncPosition()},setShow(e){t.value.setShow(e)}}),{popoverRef:t,mergedTheme:n,popoverThemeOverrides:to(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:o}=this;return Ue(Qn,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)}}),fs=O("n-dropdown-menu"),ms=O("n-dropdown"),vs=O("n-dropdown-option"),gs=Me({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return Ue("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),bs=Me({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:o}=We(fs),{renderLabelRef:n,labelFieldRef:t,nodePropsRef:r,renderOptionRef:a}=We(ms);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=Ue("div",Object.assign({class:`${o}-dropdown-option`},null==r?void 0:r(i)),Ue("div",{class:`${o}-dropdown-option-body ${o}-dropdown-option-body--group`},Ue("div",{"data-dropdown-option":!0,class:[`${o}-dropdown-option-body__prefix`,t&&`${o}-dropdown-option-body__prefix--show-icon`]},En(i.icon)),Ue("div",{class:`${o}-dropdown-option-body__label`,"data-dropdown-option":!0},a?a(i):En(null!==(e=i.title)&&void 0!==e?e:i[this.labelField])),Ue("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}}),ys={name:"Icon",common:ka,self:se};function xs(e,o){return"submenu"===e.type||void 0===e.type&&void 0!==e[o]}function Cs(e){return"divider"===e.type}var ws=Me({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(o){const n=We(ms),{hoverKeyRef:t,keyboardKeyRef:r,lastToggledSubmenuKeyRef:a,pendingKeyPathRef:l,activeKeyPathRef:i,animatedRef:s,mergedShowRef:d,renderLabelRef:c,renderIconRef:u,labelFieldRef:p,childrenFieldRef:h,renderOptionRef:f,nodePropsRef:m,menuPropsRef:v}=n,g=We(vs,null),b=We(fs),y=We(R),x=to(()=>o.tmNode.rawNode),C=to(()=>{const{value:e}=h;return xs(o.tmNode.rawNode,e)}),w=to(()=>{const{disabled:e}=o.tmNode;return e}),S=function(e,o,n){if(!o)return e;const t=To(e.value);let r=null;return Xe(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}(to(()=>{if(!C.value)return!1;const{key:e,disabled:n}=o.tmNode;if(n)return!1;const{value:i}=t,{value:s}=r,{value:d}=a,{value:c}=l;return null!==i?c.includes(e):null!==s?c.includes(e)&&c[c.length-1]!==e:null!==d&&c.includes(e)}),300,to(()=>null===r.value&&!s.value)),k=to(()=>!!(null==g?void 0:g.enteringSubmenuRef.value)),I=To(!1);function P(){const{parentKey:e,tmNode:n}=o;n.disabled||d.value&&(a.value=e,r.value=null,t.value=n.key)}return Ee(vs,{enteringSubmenuRef:I}),{labelField:p,renderLabel:c,renderIcon:u,siblingHasIcon:b.showIconRef,siblingHasSubmenu:b.hasSubmenuRef,menuProps:v,popoverBody:y,animated:s,mergedShowSubmenu:to(()=>S.value&&!k.value),rawNode:x,hasSubmenu:C,pending:e(()=>{const{value:e}=l,{key:n}=o.tmNode;return e.includes(n)}),childActive:e(()=>{const{value:e}=i,{key:n}=o.tmNode,t=e.findIndex(e=>n===e);return-1!==t&&t<e.length-1}),active:e(()=>{const{value:e}=i,{key:n}=o.tmNode,t=e.findIndex(e=>n===e);return-1!==t&&t===e.length-1}),mergedDisabled:w,renderOption:f,nodeProps:m,handleClick:function(){const{value:e}=C,{tmNode:t}=o;d.value&&(e||t.disabled||(n.doSelect(t.key,t.rawNode),n.doUpdateShow(!1)))},handleMouseMove:function(){const{tmNode:e}=o;e.disabled||d.value&&t.value!==e.key&&P()},handleMouseEnter:P,handleMouseLeave:function(e){if(o.tmNode.disabled)return;if(!d.value)return;const{relatedTarget:n}=e;!n||Kt({target:n},"dropdownOption")||Kt({target:n},"scrollbarRail")||(t.value=null)},handleSubmenuBeforeEnter:function(){I.value=!0},handleSubmenuAfterEnter:function(){I.value=!1}}},render(){var e,o;const{animated:n,rawNode:t,mergedShowSubmenu:r,clsPrefix:a,siblingHasIcon:l,siblingHasSubmenu:i,renderLabel:s,renderIcon:d,renderOption:c,nodeProps:u,props:p,scrollable:h}=this;let f=null;if(r){const o=null===(e=this.menuProps)||void 0===e?void 0:e.call(this,t,t.children);f=Ue(Is,Object.assign({},o,{clsPrefix:a,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const m={class:[`${a}-dropdown-option-body`,this.pending&&`${a}-dropdown-option-body--pending`,this.active&&`${a}-dropdown-option-body--active`,this.childActive&&`${a}-dropdown-option-body--child-active`,this.mergedDisabled&&`${a}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},v=null==u?void 0:u(t),g=Ue("div",Object.assign({class:[`${a}-dropdown-option`,null==v?void 0:v.class],"data-dropdown-option":!0},v),Ue("div",Be(m,p),[Ue("div",{class:[`${a}-dropdown-option-body__prefix`,l&&`${a}-dropdown-option-body__prefix--show-icon`]},[d?d(t):En(t.icon)]),Ue("div",{"data-dropdown-option":!0,class:`${a}-dropdown-option-body__label`},s?s(t):En(null!==(o=t[this.labelField])&&void 0!==o?o:t.title)),Ue("div",{"data-dropdown-option":!0,class:[`${a}-dropdown-option-body__suffix`,i&&`${a}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?Ue(Q,null,{default:()=>Ue(mr,null)}):null)]),this.hasSubmenu?Ue(Mn,null,{default:()=>[Ue(Tn,null,{default:()=>Ue("div",{class:`${a}-dropdown-offset-container`},Ue(ot,{show:this.mergedShowSubmenu,placement:this.placement,to:h&&this.popoverBody||void 0,teleportDisabled:!h},{default:()=>Ue("div",{class:`${a}-dropdown-menu-wrapper`},n?Ue(go,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>f}):f)}))})]}):null);return c?c({node:g,option:t}):g}}),Ss=Me({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 Ue(co,null,Ue(bs,{clsPrefix:n,tmNode:e,key:e.key}),null==t?void 0:t.map(e=>{const{rawNode:t}=e;return!1===t.show?null:Cs(t)?Ue(gs,{clsPrefix:n,key:e.key}):e.isGroup?(y("dropdown","`group` node is not allowed to be put in `group` node."),null):Ue(ws,{clsPrefix:n,tmNode:e,parentKey:o,key:e.key})}))}}),ks=Me({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:o}}=this.tmNode;return Ue("div",o,[null==e?void 0:e()])}}),Is=Me({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}=We(ms);Ee(fs,{showIconRef:to(()=>{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:to(()=>{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})=>xs(e,o));const{rawNode:t}=e;return xs(t,o)})})});const t=To(null);return Ee(M,null),Ee(pe,null),Ee(R,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)?Ue(ks,{tmNode:t,key:t.key}):Cs(r)?Ue(gs,{clsPrefix:o,key:t.key}):function(e){return"group"===e.type}(r)?Ue(Ss,{clsPrefix:o,tmNode:t,parentKey:e,key:t.key}):Ue(ws,{clsPrefix:o,tmNode:t,parentKey:e,key:t.key,props:r.props,scrollable:n})});return Ue("div",{class:[`${o}-dropdown-menu`,n&&`${o}-dropdown-menu--scrollable`],ref:"bodyRef"},n?Ue(L,{contentClass:`${o}-dropdown-menu__content`},{default:()=>t}):t,this.showArrow?Ln({clsPrefix:o,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),Ps=G("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",[jn(),G("dropdown-option","\n position: relative;\n ",[Z("a","\n text-decoration: none;\n color: inherit;\n outline: none;\n ",[Z("&::before",'\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n ')]),G("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 ",[Z("&::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 '),H("disabled",[ze("pending","\n color: var(--n-option-text-color-hover);\n ",[we("prefix, suffix","\n color: var(--n-option-text-color-hover);\n "),Z("&::before","background-color: var(--n-option-color-hover);")]),ze("active","\n color: var(--n-option-text-color-active);\n ",[we("prefix, suffix","\n color: var(--n-option-text-color-active);\n "),Z("&::before","background-color: var(--n-option-color-active);")]),ze("child-active","\n color: var(--n-option-text-color-child-active);\n ",[we("prefix, suffix","\n color: var(--n-option-text-color-child-active);\n ")])]),ze("disabled","\n cursor: not-allowed;\n opacity: var(--n-option-opacity-disabled);\n "),ze("group","\n font-size: calc(var(--n-font-size) - 1px);\n color: var(--n-group-header-text-color);\n ",[we("prefix","\n width: calc(var(--n-option-prefix-width) / 2);\n ",[ze("show-icon","\n width: calc(var(--n-option-icon-prefix-width) / 2);\n ")])]),we("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 ",[ze("show-icon","\n width: var(--n-option-icon-prefix-width);\n "),G("icon","\n font-size: var(--n-option-icon-size);\n ")]),we("label","\n white-space: nowrap;\n flex: 1;\n z-index: 1;\n "),we("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 ",[ze("has-submenu","\n width: var(--n-option-icon-suffix-width);\n "),G("icon","\n font-size: var(--n-option-icon-size);\n ")]),G("dropdown-menu","pointer-events: all;")]),G("dropdown-offset-container","\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: -4px;\n bottom: -4px;\n ")]),G("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 "),G("dropdown-menu-wrapper","\n transform-origin: var(--v-transform-origin);\n width: fit-content;\n "),Z(">",[G("scrollbar","\n height: inherit;\n max-height: inherit;\n ")]),H("scrollable","\n padding: var(--n-padding);\n "),ze("scrollable",[we("content","\n padding: var(--n-padding);\n ")])]),Ts={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]},As=Object.keys(_n),zs=Me({name:"Dropdown",inheritAttrs:!1,props:Object.assign(Object.assign(Object.assign({},_n),Ts),g.props),setup(o){const n=To(!1),t=w(lo(o,"show"),n),r=to(()=>{const{keyField:e,childrenField:n}=o;return Ga(o.options,{getKey:o=>o[e],getDisabled:e=>!0===e.disabled,getIgnored:e=>"divider"===e.type||"render"===e.type,getChildren:e=>e[n]})}),a=to(()=>r.value.treeNodes),l=To(null),i=To(null),s=To(null),d=to(()=>{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=to(()=>r.value.getPath(d.value).keyPath),u=to(()=>r.value.getPath(o.value).keyPath);Vt({keydown:{ArrowUp:{prevent:!0,handler:function(){x("up")}},ArrowRight:{prevent:!0,handler:function(){x("right")}},ArrowDown:{prevent:!0,handler:function(){x("down")}},ArrowLeft:{prevent:!0,handler:function(){x("left")}},Enter:{prevent:!0,handler:function(){const e=y();(null==e?void 0:e.isLeaf)&&t.value&&(m(e.key,e.rawNode),v(!1))}},Escape:function(){v(!1)}}},e(()=>o.keyboard&&t.value));const{mergedClsPrefixRef:p,inlineThemeDisabled:h}=J(o),f=g("Dropdown","-dropdown",Ps,Vi,o,p);function m(e,n){const{onSelect:t}=o;t&&z(t,e,n)}function v(e){const{"onUpdate:show":t,onUpdateShow:r}=o;t&&z(t,e),r&&z(r,e),n.value=e}function b(){l.value=null,i.value=null,s.value=null}function y(){var e;const{value:o}=r,{value:n}=d;return o&&null!==n&&null!==(e=o.getNode(n))&&void 0!==e?e:null}function x(e){const{value:o}=d,{value:{getFirstAvailableNode:n}}=r;let t=null;if(null===o){const e=n();null!==e&&(t=e.key)}else{const o=y();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&&(t=n.key)}}null!==t&&(l.value=null,i.value=t)}Ee(ms,{labelFieldRef:lo(o,"labelField"),childrenFieldRef:lo(o,"childrenField"),renderLabelRef:lo(o,"renderLabel"),renderIconRef:lo(o,"renderIcon"),hoverKeyRef:l,keyboardKeyRef:i,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:c,activeKeyPathRef:u,animatedRef:lo(o,"animated"),mergedShowRef:t,nodePropsRef:lo(o,"nodeProps"),renderOptionRef:lo(o,"renderOption"),menuPropsRef:lo(o,"menuProps"),doSelect:m,doUpdateShow:v}),Xe(t,e=>{o.animated||e||b()});const C=to(()=>{const{size:e,inverted:n}=o,{common:{cubicBezierEaseInOut:t},self:r}=f.value,{padding:a,dividerColor:l,borderRadius:i,optionOpacityDisabled:s,[Pe("optionIconSuffixWidth",e)]:d,[Pe("optionSuffixWidth",e)]:c,[Pe("optionIconPrefixWidth",e)]:u,[Pe("optionPrefixWidth",e)]:p,[Pe("fontSize",e)]:h,[Pe("optionHeight",e)]:m,[Pe("optionIconSize",e)]: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}),S=h?X("dropdown",to(()=>`${o.size[0]}${o.inverted?"i":""}`),C,o):void 0;return{mergedClsPrefix:p,mergedTheme:f,tmNodes:a,mergedShow:t,handleAfterLeave:()=>{o.animated&&b()},doUpdateShow:v,cssVars:h?void 0:C,themeClass:null==S?void 0:S.themeClass,onRender:null==S?void 0:S.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,r)=>{var a;const{mergedClsPrefix:l,menuProps:i}=this;null===(a=this.onRender)||void 0===a||a.call(this);const s=(null==i?void 0:i(void 0,this.tmNodes.map(e=>e.rawNode)))||{},d={ref:sr(o),class:[e,`${l}-dropdown`,this.themeClass],clsPrefix:l,tmNodes:this.tmNodes,style:[...n,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:t,onMouseleave:r};return Ue(Is,Be(this.$attrs,d,s))},onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return Ue(Qn,Object.assign({},nt(this.$props,As),o),{trigger:()=>{var e,o;return null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e)}})}}),Rs={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"};function Ms(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({},Rs),{panelColor:o,panelBoxShadow:i,panelDividerColor:a,itemTextColor:n,itemTextColorActive:t,itemColorHover:r,itemOpacityDisabled:l,itemBorderRadius:s,borderRadius:s,iconColor:d,iconColorDisabled:c})}var Fs=m({name:"TimePicker",common:t,peers:{Scrollbar:Ie,Button:te,Input:Gn},self:Ms}),Os={name:"TimePicker",common:ka,peers:{Scrollbar:Ia,Button:li,Input:Tl},self:Ms},$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 Bs(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:_(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 Es=m({name:"DatePicker",common:t,peers:{Input:Gn,Button:te,TimePicker:Fs,Scrollbar:Ie},self:Bs}),Ds={name:"DatePicker",common:ka,peers:{Input:Tl,Button:li,TimePicker:Os,Scrollbar:Ia},self(e){const{popoverColor:o,hoverColor:n,primaryColor:t}=e,r=Bs(e);return r.itemColorDisabled=de(o,n),r.itemColorIncluded=_(t,{alpha:.15}),r.itemColorHover=de(o,n),r}},_s={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 Ls(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({},_s),{lineHeight:c,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:h,titleTextColor:t,thColor:de(r,o),thColorModal:de(a,o),thColorPopover:de(l,o),thTextColor:t,thFontWeight:d,tdTextColor:n,tdColor:r,tdColorModal:a,tdColorPopover:l,borderColor:de(r,i),borderColorModal:de(a,i),borderColorPopover:de(l,i),borderRadius:s})}var Hs={name:"Descriptions",common:t,self:Ls},js={name:"Descriptions",common:ka,self:Ls},Us={name:"Dialog",common:ka,peers:{Button:li},self:_t},Ws={name:"Modal",common:ka,peers:{Scrollbar:Ia,Dialog:Us,Card:ui},self:wt},Ns=Object.assign(Object.assign({},Lt),{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]}),Ks=Me({name:"DialogEnvironment",props:Object.assign(Object.assign({},Ns),{internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const o=To(!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 Ue(Tt,{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})=>Ue(vt,Object.assign({},nt(this.$props,Et),{titleClass:ho([this.titleClass,o]),style:this.internalStyle,onClose:t,onNegativeClick:n,onPositiveClick:e}))})}}),Vs=Me({name:"DialogProvider",props:{injectionKey:String,to:[String,Object]},setup(){const e=To([]),o={};function n(n={}){const t=fe(),r=no(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 Ee(at,r),Ee(Dt,{clickedRef:dt(64),clickedPositionRef:ct()}),Ee(mt,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 Ue(co,null,[this.dialogList.map(e=>Ue(Ks,ur(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)])}}),qs=O("n-loading-bar"),Gs=O("n-loading-bar-api"),Js={name:"LoadingBar",common:ka,self(e){const{primaryColor:o}=e;return{colorError:"red",colorLoading:o,height:"2px"}}};var Ys={name:"LoadingBar",common:t,self:function(e){const{primaryColor:o,errorColor:n}=e;return{colorError:n,colorLoading:o,height:"2px"}}},Zs=G("loading-bar-container","\n z-index: 5999;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 2px;\n",[ke({enterDuration:"0.3s",leaveDuration:"0.8s"}),G("loading-bar","\n width: 100%;\n transition:\n max-width 4s linear,\n background .2s linear;\n height: var(--n-height);\n ",[ze("starting","\n background: var(--n-color-loading);\n "),ze("finishing","\n background: var(--n-color-loading);\n transition:\n max-width .2s linear,\n background .2s linear;\n "),ze("error","\n background: var(--n-color-error);\n transition:\n max-width .2s linear,\n background .2s linear;\n ")])]),Xs=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 Qs(e,o){return`${o}-loading-bar ${o}-loading-bar--${e}`}var ed=Me({name:"LoadingBar",props:{containerClass:String,containerStyle:[String,Object]},setup(){const{inlineThemeDisabled:e}=J(),{props:o,mergedClsPrefixRef:n}=We(qs),t=To(null),r=To(!1),a=To(!1),l=To(!1),i=To(!1);let s=!1;const d=To(!1),c=to(()=>{const{loadingBarStyle:e}=o;return e?e[d.value?"error":"loading"]:""});function u(){return Xs(this,void 0,void 0,function*(){r.value=!1,l.value=!1,s=!1,d.value=!1,i.value=!0,yield _e(),i.value=!1})}function p(){return Xs(this,arguments,void 0,function*(e=0,o=80,r="starting"){if(a.value=!0,yield u(),s)return;l.value=!0,yield _e();const i=t.value;i&&(i.style.maxWidth=`${e}%`,i.style.transition="none",i.offsetWidth,i.className=Qs(r,n.value),i.style.transition="",i.style.maxWidth=`${o}%`)})}const h=g("LoadingBar","-loading-bar",Zs,Ys,o,n),f=to(()=>{const{self:{height:e,colorError:o,colorLoading:n}}=h.value;return{"--n-height":e,"--n-color-loading":n,"--n-color-error":o}}),m=e?X("loading-bar",void 0,f,o):void 0;return{mergedClsPrefix:n,loadingBarRef:t,started:a,loading:l,entering:r,transitionDisabled:i,start:p,error:function(){if(!s&&!d.value)if(l.value){d.value=!0;const e=t.value;if(!e)return;e.className=Qs("error",n.value),e.style.maxWidth="100%",e.offsetWidth,l.value=!1}else p(100,100,"error").then(()=>{d.value=!0;const e=t.value;e&&(e.className=Qs("error",n.value),e.offsetWidth,l.value=!1)})},finish:function(){return Xs(this,void 0,void 0,function*(){if(s||d.value)return;a.value&&(yield _e()),s=!0;const e=t.value;e&&(e.className=Qs("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 Xs(this,void 0,void 0,function*(){yield u()})},mergedLoadingBarStyle:c,cssVars:e?void 0:f,themeClass:null==m?void 0:m.themeClass,onRender:null==m?void 0:m.onRender}},render(){if(!this.started)return null;const{mergedClsPrefix:e}=this;return Ue(go,{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),zo(Ue("div",{class:[`${e}-loading-bar-container`,this.themeClass,this.containerClass],style:this.containerStyle},Ue("div",{ref:"loadingBarRef",class:[`${e}-loading-bar`],style:[this.cssVars,this.mergedLoadingBarStyle]})),[[so,this.loading||!this.loading&&this.entering]])}})}}),od=Me({name:"LoadingBarProvider",props:Object.assign(Object.assign({},g.props),{to:{type:[String,Object,Boolean],default:void 0},containerClass:String,containerStyle:[String,Object],loadingBarStyle:{type:Object}}),setup(e){const o=$(),n=To(null),t={start(){var e;o.value?null===(e=n.value)||void 0===e||e.start():_e(()=>{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():_e(()=>{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():_e(()=>{var e;null===(e=n.value)||void 0===e||e.finish()})}},{mergedClsPrefixRef:r}=J(e);return Ee(Gs,t),Ee(qs,{props:e,mergedClsPrefixRef:r}),Object.assign(t,{loadingBarRef:n})},render(){var e,o;return Ue(co,null,Ue(Qe,{disabled:!1===this.to,to:this.to||"body"},Ue(ed,{ref:"loadingBarRef",containerStyle:this.containerStyle,containerClass:this.containerClass})),null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e))}});var nd={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 td(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({},nd),{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 rd={name:"Message",common:t,self:td},ad={name:"Message",common:ka,self:td},ld={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},id=Z([G("message-wrapper","\n margin: var(--n-margin);\n z-index: 0;\n transform-origin: top center;\n display: flex;\n ",[xl({overflow:"visible",originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.85)"}})]),G("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 ",[we("content","\n display: inline-block;\n line-height: var(--n-line-height);\n font-size: var(--n-font-size);\n "),we("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=>ze(`${e}-type`,[Z("> *",`\n color: var(--n-icon-color-${e});\n transition: color .3s var(--n-bezier);\n `)])),Z("> *","\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n ",[b()])]),we("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 ",[Z("&:hover","\n color: var(--n-close-icon-color-hover);\n "),Z("&:active","\n color: var(--n-close-icon-color-pressed);\n ")])]),G("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 ",[ze("top","\n top: 12px;\n left: 0;\n right: 0;\n "),ze("top-left","\n top: 12px;\n left: 12px;\n right: 0;\n align-items: flex-start;\n "),ze("top-right","\n top: 12px;\n left: 0;\n right: 12px;\n align-items: flex-end;\n "),ze("bottom","\n bottom: 4px;\n left: 0;\n right: 0;\n justify-content: flex-end;\n "),ze("bottom-left","\n bottom: 4px;\n left: 12px;\n right: 0;\n justify-content: flex-end;\n align-items: flex-start;\n "),ze("bottom-right","\n bottom: 4px;\n left: 0;\n right: 12px;\n justify-content: flex-end;\n align-items: flex-end;\n ")])]),sd={info:()=>Ue(pt,null),success:()=>Ue(ut,null),warning:()=>Ue(It,null),error:()=>Ue(ht,null),default:()=>null},dd=Me({name:"Message",props:Object.assign(Object.assign({},ld),{render:Function}),setup(e){const{inlineThemeDisabled:o,mergedRtlRef:n}=J(e),{props:t,mergedClsPrefixRef:r}=We(Yn),a=p("Message",n,r),l=g("Message","-message",id,rd,t,r),i=to(()=>{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,[Pe("textColor",o)]:w,[Pe("boxShadow",o)]:S,[Pe("color",o)]:k,[Pe("closeColorHover",o)]:I,[Pe("closeColorPressed",o)]:P,[Pe("closeIconColor",o)]:T,[Pe("closeIconColorPressed",o)]:A,[Pe("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":I,"--n-close-color-pressed":P,"--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?X("message",to(()=>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:n,closable:t,content:r,mergedClsPrefix:a,cssVars:i,themeClass:s,onRender:d,icon:c,handleClose:u,showIcon:p}=this;let h;return null==d||d(),Ue("div",{class:[`${a}-message-wrapper`,s],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},i]},e?e(this.$props):Ue("div",{class:[`${a}-message ${a}-message--${n}-type`,this.rtlEnabled&&`${a}-message--rtl`]},(h=function(e,o,n){if("function"==typeof e)return e();{const e="loading"===o?Ue(T,{clsPrefix:n,strokeWidth:24,scale:.85}):sd[o]();return e?Ue(ee,{clsPrefix:n,key:o},{default:()=>e}):null}}(c,n,a))&&p?Ue("div",{class:`${a}-message__icon ${a}-message__icon--${n}-type`},Ue(o,null,{default:()=>h})):null,Ue("div",{class:`${a}-message__content`},En(r)),t?Ue(l,{clsPrefix:a,class:`${a}-message__close`,onClick:u,absolute:!0}):null))}});var cd=Me({name:"MessageEnvironment",props:Object.assign(Object.assign({},ld),{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=To(!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 Je(()=>{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 Ue(s,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?Ue(dd,{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]})}}),ud=Me({name:"MessageProvider",props:Object.assign(Object.assign({},g.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}=J(e),n=To([]),t=To({}),r={create:(e,o)=>a(e,Object.assign({type:"default"},o)),info:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"info"})),success:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"success"})),warning:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"warning"})),error:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"error"})),loading:(e,o)=>a(e,Object.assign(Object.assign({},o),{type:"loading"})),destroyAll:function(){Object.values(t.value).forEach(e=>{e.hide()})}};function a(o,r){const a=fe(),l=no(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 Ee(Yn,{props:e,mergedClsPrefixRef:o}),Ee(qn,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 Ue(co,null,null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e),this.messageList.length?Ue(Qe,{to:null!==(n=this.to)&&void 0!==n?n:"body"},Ue("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(e=>Ue(cd,Object.assign({ref:o=>{o&&(this.messageRefs[e.key]=o)},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave},ur(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)}}),pd=Me({name:"ModalEnvironment",props:Object.assign(Object.assign({},Bt),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const o=To(!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 Ue(Tt,Object.assign({},this.$props,{show:r,onUpdateShow:e,onMaskClick:n,onEsc:t,onAfterLeave:o,internalAppear:!0,internalModal:!0}),this.$slots)}}),hd=Me({name:"ModalProvider",props:{to:[String,Object]},setup(){const e=To([]),o={};const n={create:function(n={}){const t=fe(),r=no(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 Ee(Ct,n),Ee(Mt,{clickedRef:dt(64),clickedPositionRef:ct()}),Ee(At,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 Ue(co,null,[this.modalList.map(e=>{var o;return Ue(pd,ur(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)])}}),fd={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"};function md(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({},fd),{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 vd=m({name:"Notification",common:t,peers:{Scrollbar:Ie},self:md}),gd={name:"Notification",common:ka,peers:{Scrollbar:Ia},self:md},bd=O("n-notification-provider"),yd=Me({name:"NotificationContainer",props:{scrollable:{type:Boolean,required:!0},placement:{type:String,required:!0}},setup(){const{mergedThemeRef:e,mergedClsPrefixRef:o,wipTransitionCountRef:n}=We(bd),t=To(null);return Ke(()=>{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 Ue("div",{ref:"selfRef",class:[`${n}-notification-container`,o&&`${n}-notification-container--scrollable`,`${n}-notification-container--${r}`]},o?Ue(Ae,{theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,contentStyle:{overflow:"hidden"}},e):e)}}),xd={info:()=>Ue(pt,null),success:()=>Ue(ut,null),warning:()=>Ue(It,null),error:()=>Ue(ht,null),default:()=>null},Cd={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},wd=st(Cd),Sd=Me({name:"Notification",props:Cd,setup(e){const{mergedClsPrefixRef:o,mergedThemeRef:n,props:t}=We(bd),{inlineThemeDisabled:r,mergedRtlRef:a}=J(),l=p("Notification",a,o),i=to(()=>{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:I,descriptionFontSize:P,[Pe("iconColor",o)]:T},common:{cubicBezierEaseOut:A,cubicBezierEaseIn:z,cubicBezierEaseInOut:R}}=n.value,{left:M,right:F,top:O,bottom:$}=N(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":$,"--n-title-font-size":k,"--n-meta-font-size":I,"--n-description-font-size":P}}),s=r?X("notification",to(()=>e.type[0]),i,t):void 0;return{mergedClsPrefix:o,showAvatar:to(()=>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),Ue("div",{class:[`${o}-notification-wrapper`,this.themeClass],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:this.cssVars},Ue("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?Ue("div",{class:`${o}-notification__avatar`},this.avatar?En(this.avatar):"default"!==this.type?Ue(ee,{clsPrefix:o},{default:()=>xd[this.type]()}):null):null,this.closable?Ue(l,{clsPrefix:o,class:`${o}-notification__close`,onClick:this.handleCloseClick}):null,Ue("div",{ref:"bodyRef",class:`${o}-notification-main`},this.title?Ue("div",{class:`${o}-notification-main__header`},En(this.title)):null,this.description?Ue("div",{class:`${o}-notification-main__description`},En(this.description)):null,this.content?Ue("pre",{class:`${o}-notification-main__content`},En(this.content)):null,this.meta||this.action?Ue("div",{class:`${o}-notification-main-footer`},this.meta?Ue("div",{class:`${o}-notification-main-footer__meta`},En(this.meta)):null,this.action?Ue("div",{class:`${o}-notification-main-footer__action`},En(this.action)):null):null)))}}),kd=Object.assign(Object.assign({},Cd),{duration:Number,onClose:Function,onLeave:Function,onAfterEnter:Function,onAfterLeave:Function,onHide:Function,onAfterShow:Function,onAfterHide:Function}),Id=Me({name:"NotificationEnvironment",props:Object.assign(Object.assign({},kd),{internalKey:{type:String,required:!0},onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const{wipTransitionCountRef:o}=We(bd),n=To(!0);let t=null;function r(){n.value=!1,t&&window.clearTimeout(t)}return Je(()=>{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++,_e(()=>{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 Ue(go,{name:"notification-transition",appear:!0,onBeforeEnter:this.handleBeforeEnter,onAfterEnter:this.handleAfterEnter,onBeforeLeave:this.handleBeforeLeave,onLeave:this.handleLeave,onAfterLeave:this.handleAfterLeave},{default:()=>this.show?Ue(Sd,Object.assign({},nt(this.$props,wd),{onClose:this.handleClose,onMouseenter:this.duration&&this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.duration&&this.keepAliveOnHover?this.handleMouseleave:void 0})):null})}}),Pd=Z([G("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 ",[Z(">",[G("scrollbar","\n width: initial;\n overflow: visible;\n height: -moz-fit-content !important;\n height: fit-content !important;\n max-height: 100vh !important;\n ",[Z(">",[G("scrollbar-container","\n height: -moz-fit-content !important;\n height: fit-content !important;\n max-height: 100vh !important;\n ",[G("scrollbar-content","\n padding-top: 12px;\n padding-bottom: 33px;\n ")])])])]),ze("top, top-right, top-left","\n top: 12px;\n ",[Z("&.transitioning >",[G("scrollbar",[Z(">",[G("scrollbar-container","\n min-height: 100vh !important;\n ")])])])]),ze("bottom, bottom-right, bottom-left","\n bottom: 12px;\n ",[Z(">",[G("scrollbar",[Z(">",[G("scrollbar-container",[G("scrollbar-content","\n padding-bottom: 12px;\n ")])])])]),G("notification-wrapper","\n display: flex;\n align-items: flex-end;\n margin-bottom: 0;\n margin-top: 12px;\n ")]),ze("top, bottom","\n left: 50%;\n transform: translateX(-50%);\n ",[G("notification-wrapper",[Z("&.notification-transition-enter-from, &.notification-transition-leave-to","\n transform: scale(0.85);\n "),Z("&.notification-transition-leave-from, &.notification-transition-enter-to","\n transform: scale(1);\n ")])]),ze("top",[G("notification-wrapper","\n transform-origin: top center;\n ")]),ze("bottom",[G("notification-wrapper","\n transform-origin: bottom center;\n ")]),ze("top-right, bottom-right",[G("notification","\n margin-left: 28px;\n margin-right: 16px;\n ")]),ze("top-left, bottom-left",[G("notification","\n margin-left: 16px;\n margin-right: 28px;\n ")]),ze("top-right","\n right: 0;\n ",[Td("top-right")]),ze("top-left","\n left: 0;\n ",[Td("top-left")]),ze("bottom-right","\n right: 0;\n ",[Td("bottom-right")]),ze("bottom-left","\n left: 0;\n ",[Td("bottom-left")]),ze("scrollable",[ze("top-right","\n top: 0;\n "),ze("top-left","\n top: 0;\n "),ze("bottom-right","\n bottom: 0;\n "),ze("bottom-left","\n bottom: 0;\n ")]),G("notification-wrapper","\n margin-bottom: 12px;\n ",[Z("&.notification-transition-enter-from, &.notification-transition-leave-to","\n opacity: 0;\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n "),Z("&.notification-transition-leave-from, &.notification-transition-enter-to","\n opacity: 1;\n "),Z("&.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 "),Z("&.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 ")]),G("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 ",[we("avatar",[G("icon","\n color: var(--n-icon-color);\n "),G("base-icon","\n color: var(--n-icon-color);\n ")]),ze("show-avatar",[G("notification-main","\n margin-left: 40px;\n width: calc(100% - 40px); \n ")]),ze("closable",[G("notification-main",[Z("> *:first-child","\n padding-right: 20px;\n ")]),we("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 ")]),we("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 ",[G("icon","transition: color .3s var(--n-bezier);")]),G("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 ",[G("notification-main-footer","\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 12px;\n ",[we("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 "),we("action","\n cursor: pointer;\n transition: color .3s var(--n-bezier-ease-out);\n color: var(--n-action-text-color);\n ")]),we("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 "),we("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 "),we("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 ",[Z("&:first-child","margin: 0;")])])])])]);function Td(e){const o="left"===e.split("-")[1]?"calc(-100%)":"calc(100%)";return G("notification-wrapper",[Z("&.notification-transition-enter-from, &.notification-transition-leave-to",`\n transform: translate(${o}, 0);\n `),Z("&.notification-transition-leave-from, &.notification-transition-enter-to","\n transform: translate(0, 0);\n ")])}var Ad=O("n-notification-api"),zd=Me({name:"NotificationProvider",props:Object.assign(Object.assign({},g.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}=J(e),n=To([]),t={},r=new Set;function a(o){const a=fe(),l=()=>{r.add(a),t[a]&&t[a].hide()},i=no(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 l=["info","success","warning","error"].map(e=>o=>a(Object.assign(Object.assign({},o),{type:e})));const i=g("Notification","-notification",Pd,vd,e,o),s={create:a,info:l[0],success:l[1],warning:l[2],error:l[3],open:function(e){return a(e)},destroyAll:function(){Object.values(n.value).forEach(e=>{e.hide()})}},d=To(0);return Ee(Ad,s),Ee(bd,{props:e,mergedClsPrefixRef:o,mergedThemeRef:i,wipTransitionCountRef:d}),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)}},s)},render(){var e,o,n;const{placement:t}=this;return Ue(co,null,null===(o=(e=this.$slots).default)||void 0===o?void 0:o.call(e),this.notificationList.length?Ue(Qe,{to:null!==(n=this.to)&&void 0!==n?n:"body"},Ue(yd,{class:this.containerClass,style:this.containerStyle,scrollable:this.scrollable&&"top"!==t&&"bottom"!==t,placement:t},{default:()=>this.notificationList.map(e=>Ue(Id,Object.assign({ref:o=>{const n=e.key;null===o?delete this.notificationRefs[n]:this.notificationRefs[n]=o}},ur(e,["destroy","hide","deactivate"]),{internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave,keepAliveOnHover:void 0===e.keepAliveOnHover?this.keepAliveOnHover:e.keepAliveOnHover})))})):null)}});var Rd=Me({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)}}}),Md={message:Xn,notification:function(){const e=We(Ad,null);return null===e&&i("use-notification","No outer `n-notification-provider` found."),e},loadingBar:function(){const e=We(Gs,null);return null===e&&i("use-loading-bar","No outer <n-loading-bar-provider /> founded."),e},dialog:ft,modal:xt};function Fd(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:ud,props:n});break;case"notification":i.push({type:e,Provider:zd,props:r});break;case"dialog":i.push({type:e,Provider:Vs,props:t});break;case"loadingBar":i.push({type:e,Provider:od,props:a});break;case"modal":i.push({type:e,Provider:hd,props:l})}}),function({providersAndProps:e,configProviderProps:o}){let n=ao(function(){return Ue($i,yo(o),{default:()=>e.map(({type:e,Provider:o,props:n})=>Ue(o,yo(n),{default:()=>Ue(Rd,{onSetup:()=>t[e]=Md[e]()})}))})});const t={app:n};let r;return u&&(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):y("discrete","unmount call no need because discrete app has been unmounted")}},t)}({providersAndProps:i,configProviderProps:o})}var Od={name:"Divider",common:ka,self:yt};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 Bd=m({name:"Drawer",common:t,peers:{Scrollbar:Ie},self:$d}),Ed={name:"Drawer",common:ka,peers:{Scrollbar:Ia},self:$d},Dd={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},_d={name:"DynamicInput",common:ka,peers:{Input:Tl,Button:li},self:()=>Dd};var Ld,Hd=m({name:"DynamicInput",common:t,peers:{Input:Gn,Button:te},self:function(){return Dd}}),jd={name:"Space",self:()=>Rt};function Ud(){if(!u)return!0;if(void 0===Ld){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),Ld=o}return Ld}var Wd=Me({name:"Space",props:Object.assign(Object.assign({},g.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}=J(e),t=g("Space","-space",void 0,gt,e,o),r=p("Space",n,o);return{useGap:Ud(),rtlEnabled:r,mergedClsPrefix:o,margin:to(()=>{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:{[Pe("gap",o)]:n}}=t.value,{row:r,col:a}=xe(n);return{horizontal:re(a),vertical:re(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:u,wrapItem:p,internalUseGap:h}=this,f=Pn(dr(this),!1);if(!f.length)return null;const m=`${i.horizontal}px`,v=i.horizontal/2+"px",g=`${i.vertical}px`,b=i.vertical/2+"px",y=f.length-1,x=r.startsWith("space-");return Ue("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:u||e?"":`-${b}`,marginBottom:u||e?"":`-${b}`,alignItems:n,gap:u?`${i.vertical}px ${i.horizontal}px`:""}},p||!u&&!h?f.map((o,n)=>o.type===po?o:Ue("div",{role:"none",class:a,style:[l,{maxWidth:"100%"},u?"":e?{marginBottom:n!==y?g:""}:c?{marginLeft:x?"space-between"===r&&n===y?"":v:n!==y?m:"",marginRight:x?"space-between"===r&&0===n?"":v:"",paddingTop:b,paddingBottom:b}:{marginRight:x?"space-between"===r&&n===y?"":v:n!==y?m:"",marginLeft:x?"space-between"===r&&0===n?"":v:"",paddingTop:b,paddingBottom:b}]},o)):f)}}),Nd={name:"DynamicTags",common:ka,peers:{Input:Tl,Button:li,Tag:rl,Space:jd},self:()=>({inputWidth:"64px"})},Kd=m({name:"DynamicTags",common:t,peers:{Input:Gn,Button:te,Tag:Y,Space:gt},self:()=>({inputWidth:"64px"})}),Vd={name:"Element",common:ka},qd={name:"Element",common:t},Gd={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},Jd={name:"Flex",self:()=>Gd};var Yd={name:"Flex",self:function(){return Gd}},Zd={name:"ButtonGroup",common:ka},Xd={name:"ButtonGroup",common:t},Qd={name:"Form",common:ka,self:kt},ec={name:"GradientText",common:ka,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 oc={name:"GradientText",common:t,self:function(e){const{primaryColor:o,successColor:n,warningColor:t,errorColor:r,infoColor:a,fontWeightStrong:l}=e;return{fontWeight:l,rotate:"252deg",colorStartPrimary:_(o,{alpha:.6}),colorEndPrimary:o,colorStartInfo:_(a,{alpha:.6}),colorEndInfo:a,colorStartWarning:_(t,{alpha:.6}),colorEndWarning:t,colorStartError:_(r,{alpha:.6}),colorEndError:r,colorStartSuccess:_(n,{alpha:.6}),colorEndSuccess:n}}},nc={name:"InputNumber",common:ka,peers:{Button:li,Input:Tl},self(e){const{textColorDisabled:o}=e;return{iconColorDisabled:o}}};var tc=m({name:"InputNumber",common:t,peers:{Button:te,Input:Gn},self:function(e){const{textColorDisabled:o}=e;return{iconColorDisabled:o}}});function rc(){return{inputWidthSmall:"24px",inputWidthMedium:"30px",inputWidthLarge:"36px",gapSmall:"8px",gapMedium:"8px",gapLarge:"8px"}}var ac=m({name:"InputOtp",common:t,peers:{Input:Gn},self:rc}),lc={name:"InputOtp",common:ka,peers:{Input:Tl},self:rc},ic={name:"Layout",common:ka,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:de(n,l),siderToggleBarColorHover:de(n,i),__invertScrollbar:"false"}}};var sc=m({name:"Layout",common:t,peers:{Scrollbar:Ie},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:de(t,i),siderToggleBarColorHover:de(t,s),__invertScrollbar:"true"}}}),dc={name:"Row",common:ka},cc={name:"Row",common:t};function uc(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:de(t,s),colorPopover:r,colorHoverPopover:de(r,s),borderColor:a,borderColorModal:de(t,a),borderColorPopover:de(r,a),borderRadius:l,fontSize:i}}var pc={name:"List",common:t,self:uc},hc={name:"List",common:ka,self:uc},fc={name:"Log",common:ka,peers:{Scrollbar:Ia,Code:Si},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 mc=m({name:"Log",common:t,peers:{Scrollbar:Ie,Code:ki},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}}}),vc={name:"Mention",common:ka,peers:{InternalSelectMenu:Xa,Input:Tl},self(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}};var gc=m({name:"Mention",common:t,peers:{InternalSelectMenu:Hn,Input:Gn},self:function(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}});function bc(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:_(t,{alpha:.1}),itemColorActiveHover:_(t,{alpha:.1}),itemColorActiveCollapsed:_(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 yc=m({name:"Menu",common:t,peers:{Tooltip:Yi,Dropdown:Vi},self:bc}),xc={name:"Menu",common:ka,peers:{Tooltip:Ji,Dropdown:qi},self(e){const{primaryColor:o,primaryColorSuppl:n}=e,t=bc(e);return t.itemColorActive=_(o,{alpha:.15}),t.itemColorActiveHover=_(o,{alpha:.15}),t.itemColorActiveCollapsed=_(o,{alpha:.15}),t.itemColorActiveInverted=n,t.itemColorActiveHoverInverted=n,t.itemColorActiveCollapsedInverted=n,t}},Cc={titleFontSize:"18px",backSize:"22px"};function wc(e){const{textColor1:o,textColor2:n,textColor3:t,fontSize:r,fontWeightStrong:a,primaryColorHover:l,primaryColorPressed:i}=e;return Object.assign(Object.assign({},Cc),{titleFontWeight:a,fontSize:r,titleTextColor:o,backColor:n,backColorHover:l,backColorPressed:i,subtitleTextColor:t})}var Sc=m({name:"PageHeader",common:t,self:wc}),kc={name:"PageHeader",common:ka,self:wc},Ic={iconSize:"22px"};function Pc(e){const{fontSize:o,warningColor:n}=e;return Object.assign(Object.assign({},Ic),{fontSize:o,iconColor:n})}var Tc=m({name:"Popconfirm",common:t,peers:{Button:te,Popover:Jn},self:Pc}),Ac={name:"Popconfirm",common:ka,peers:{Button:li,Popover:tl},self:Pc};function zc(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 Rc={name:"Progress",common:t,self:zc},Mc={name:"Progress",common:ka,self(e){const o=zc(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}},Fc={name:"Rate",common:ka,self(e){const{railColor:o}=e;return{itemColor:o,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}};var Oc={name:"Rate",common:t,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 Bc(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 Ec={name:"Result",common:t,self:Bc},Dc={name:"Result",common:ka,self:Bc},_c={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},Lc={name:"Slider",common:ka,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({},_c),{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 Hc={name:"Slider",common:t,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({},_c),{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:""})}},jc={name:"Spin",common:ka,self:le};function Uc(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 Wc={name:"Statistic",common:t,self:Uc},Nc={name:"Statistic",common:ka,self:Uc},Kc={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"};function Vc(e){const{fontWeightStrong:o,baseColor:n,textColorDisabled:t,primaryColor:r,errorColor:a,textColor1:l,textColor2:i}=e;return Object.assign(Object.assign({},Kc),{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 qc={name:"Steps",common:t,self:Vc},Gc={name:"Steps",common:ka,self:Vc},Jc={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"},Yc={name:"Switch",common:ka,self(e){const{primaryColorSuppl:o,opacityDisabled:n,borderRadius:t,primaryColor:r,textColor2:a,baseColor:l}=e;return Object.assign(Object.assign({},Jc),{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 ${_(r,{alpha:.3})}`})}};var Zc={name:"Switch",common:t,self:function(e){const{primaryColor:o,opacityDisabled:n,borderRadius:t,textColor3:r}=e;return Object.assign(Object.assign({},Jc),{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 ${_(o,{alpha:.2})}`})}},Xc={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"};function Qc(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({},Xc),{fontSizeSmall:p,fontSizeMedium:h,fontSizeLarge:f,lineHeight:u,borderRadius:d,borderColor:de(n,o),borderColorModal:de(t,o),borderColorPopover:de(r,o),tdColor:n,tdColorModal:t,tdColorPopover:r,tdColorStriped:de(n,l),tdColorStripedModal:de(t,l),tdColorStripedPopover:de(r,l),thColor:de(n,a),thColorModal:de(t,a),thColorPopover:de(r,a),thTextColor:i,tdTextColor:s,thFontWeight:c})}var eu={name:"Table",common:t,self:Qc},ou={name:"Table",common:ka,self:Qc},nu={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 tu(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({},nu),{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 ru={name:"Tabs",common:t,self:tu},au={name:"Tabs",common:ka,self(e){const o=tu(e),{inputColor:n}=e;return o.colorSegment=n,o.tabColorSegment=n,o}};function lu(e){const{textColor1:o,textColor2:n,fontWeightStrong:t,fontSize:r}=e;return{fontSize:r,titleTextColor:o,textColor:n,titleFontWeight:t}}var iu={name:"Thing",common:t,self:lu},su={name:"Thing",common:ka,self:lu},du={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},cu={name:"Timeline",common:ka,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({},du),{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 uu={name:"Timeline",common:t,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({},du),{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})}},pu={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},hu={name:"Transfer",common:ka,peers:{Checkbox:mi,Scrollbar:Ia,Input:Tl,Empty:Ja,Button:li},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({},pu),{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 fu=m({name:"Transfer",common:t,peers:{Checkbox:it,Scrollbar:Ie,Input:Gn,Empty:B,Button:te},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({},pu),{itemHeightSmall:l,itemHeightMedium:l,itemHeightLarge:a,fontSizeSmall:r,fontSizeMedium:t,fontSizeLarge:n,borderRadius:i,dividerColor:f,borderColor:f,listColor:s,headerColor:de(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 mu(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:_(a,{alpha:.1}),arrowColor:l,nodeTextColor:i,nodeTextColorDisabled:s,loadingColor:a,dropMarkColor:a,lineColor:n}}var vu=m({name:"Tree",common:t,peers:{Checkbox:it,Scrollbar:Ie,Empty:B},self:mu}),gu={name:"Tree",common:ka,peers:{Checkbox:mi,Scrollbar:Ia,Empty:Ja},self(e){const{primaryColor:o}=e,n=mu(e);return n.nodeColorActive=_(o,{alpha:.15}),n}},bu={name:"TreeSelect",common:ka,peers:{Tree:gu,Empty:Ja,InternalSelection:ul}};var yu=m({name:"TreeSelect",common:t,peers:{Tree:vu,Empty:B,InternalSelection:Dn},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"}}}),xu={name:"Typography",common:ka,self:$t};function Cu(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:_(t,{alpha:.06}),itemTextColor:r,itemTextColorError:t,itemTextColorSuccess:a,itemIconColor:o,itemDisabledOpacity:l,itemBorderImageCardError:`1px solid ${t}`,itemBorderImageCard:`1px solid ${s}`}}var wu=m({name:"Upload",common:t,peers:{Button:te,Progress:Rc},self:Cu}),Su={name:"Upload",common:ka,peers:{Button:li,Progress:Mc},self(e){const{errorColor:o}=e,n=Cu(e);return n.itemColorHoverError=_(o,{alpha:.09}),n}},ku={name:"Watermark",common:ka,self(e){const{fontFamily:o}=e;return{fontFamily:o}}},Iu=m({name:"Watermark",common:t,self(e){const{fontFamily:o}=e;return{fontFamily:o}}});var Pu={name:"FloatButtonGroup",common:t,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)"}}},Tu={name:"FloatButton",common:ka,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 Au={name:"FloatButton",common:t,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}}},zu=O("n-form"),Ru=O("n-form-item-insts"),Mu=G("form",[ze("inline","\n width: 100%;\n display: inline-flex;\n align-items: flex-start;\n align-content: space-around;\n ",[G("form-item",{width:"auto",marginRight:"18px"},[Z("&:last-child",{marginRight:0})])])]),Fu=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())})},Ou=Me({name:"Form",props:Object.assign(Object.assign({},g.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}=J(e);g("Form","-form",Mu,Ft,e,o);const n={},t=To(void 0);return Ee(zu,{props:e,maxChildLabelWidthRef:t,deriveMaxChildLabelWidth:e=>{const o=t.value;(void 0===o||e>=o)&&(t.value=e)}}),Ee(Ru,{formItems:n}),Object.assign({validate:function(e){return Fu(this,arguments,void 0,function*(e,o=()=>!0){return yield new Promise((t,r)=>{const a=[];for(const e of st(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 st(n)){const o=n[e];for(const e of o)e.restoreValidation()}}},{mergedClsPrefix:o})},render(){const{mergedClsPrefix:e}=this;return Ue("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 Bu(e){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bu(e)}function Eu(e,o){return Eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,o){return e.__proto__=o,e},Eu(e,o)}function Du(e,o,n){return Du=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&&Eu(r,n.prototype),r},Du.apply(null,arguments)}function _u(e){var o="function"==typeof Map?new Map:void 0;return _u=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 Du(e,arguments,Bu(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Eu(t,e)},_u(e)}var Lu=/%[sdj%]/g;function Hu(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 ju(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(Lu,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 Uu(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 Wu(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 Nu=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,Eu(o,n),t}(_u(Error));function Ku(e,o,n,t,r){if(o.first){var a=new Promise(function(o,a){Wu(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 Nu(e,Hu(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 Nu(c,Hu(c))):o(r)};i.length||(t(c),o(r)),i.forEach(function(o){var t=e[o];-1!==l.indexOf(o)?Wu(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 Vu(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 qu(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 Gu,Ju=function(e,o,n,t,r,a){!e.required||n.hasOwnProperty(e.field)&&!Uu(o,a||e.type)||t.push(ju(r.messages.required,e.fullField))},Yu=/^(([^<>()\[\]\\.,;:\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,}))$/,Zu=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Xu={integer:function(e){return Xu.number(e)&&parseInt(e,10)===e},float:function(e){return Xu.number(e)&&!Xu.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&&!Xu.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(Yu)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(function(){if(Gu)return Gu;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 Gu=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(Zu)}},Qu="enum",ep={required:Ju,whitespace:function(e,o,n,t,r){(/^\s+$/.test(o)||""===o)&&t.push(ju(r.messages.whitespace,e.fullField))},type:function(e,o,n,t,r){if(e.required&&void 0===o)Ju(e,o,n,t,r);else{var a=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(a)>-1?Xu[a](o)||t.push(ju(r.messages.types[a],e.fullField,e.type)):a&&typeof o!==e.type&&t.push(ju(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(ju(r.messages[d].len,e.fullField,e.len)):l&&!i&&s<e.min?t.push(ju(r.messages[d].min,e.fullField,e.min)):i&&!l&&s>e.max?t.push(ju(r.messages[d].max,e.fullField,e.max)):l&&i&&(s<e.min||s>e.max)&&t.push(ju(r.messages[d].range,e.fullField,e.min,e.max))},enum:function(e,o,n,t,r){e[Qu]=Array.isArray(e[Qu])?e[Qu]:[],-1===e[Qu].indexOf(o)&&t.push(ju(r.messages[Qu],e.fullField,e[Qu].join(", ")))},pattern:function(e,o,n,t,r){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(o)||t.push(ju(r.messages.pattern.mismatch,e.fullField,o,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(o)||t.push(ju(r.messages.pattern.mismatch,e.fullField,o,e.pattern))))}},op=function(e,o,n,t,r){var a=e.type,l=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Uu(o,a)&&!e.required)return n();ep.required(e,o,t,l,r,a),Uu(o,a)||ep.type(e,o,t,l,r)}n(l)},np={string:function(e,o,n,t,r){var a=[];if(e.required||!e.required&&t.hasOwnProperty(e.field)){if(Uu(o,"string")&&!e.required)return n();ep.required(e,o,t,a,r,"string"),Uu(o,"string")||(ep.type(e,o,t,a,r),ep.range(e,o,t,a,r),ep.pattern(e,o,t,a,r),!0===e.whitespace&&ep.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(Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r),void 0!==o&&ep.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),Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r),void 0!==o&&(ep.type(e,o,t,a,r),ep.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(Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r),void 0!==o&&ep.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(Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r),Uu(o)||ep.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(Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r),void 0!==o&&(ep.type(e,o,t,a,r),ep.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(Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r),void 0!==o&&(ep.type(e,o,t,a,r),ep.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();ep.required(e,o,t,a,r,"array"),null!=o&&(ep.type(e,o,t,a,r),ep.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(Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r),void 0!==o&&ep.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(Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r),void 0!==o&&ep.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(Uu(o,"string")&&!e.required)return n();ep.required(e,o,t,a,r),Uu(o,"string")||ep.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(Uu(o,"date")&&!e.required)return n();var l;if(ep.required(e,o,t,a,r),!Uu(o,"date"))l=o instanceof Date?o:new Date(o),ep.type(e,l,t,a,r),l&&ep.range(e,l.getTime(),t,a,r)}n(a)},url:op,hex:op,email:op,required:function(e,o,n,t,r){var a=[],l=Array.isArray(o)?"array":typeof o;ep.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(Uu(o)&&!e.required)return n();ep.required(e,o,t,a,r)}n(a)}};function tp(){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 rp=tp(),ap=function(){function e(e){this.rules=null,this._messages=rp,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=qu(tp(),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===rp&&(s=tp()),qu(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 Ku(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(Vu(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(Vu(r,a)):l.error&&(u=[l.error(r,ju(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=Hu(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&&!np.hasOwnProperty(e.type))throw new Error(ju("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]?np.required:np[this.getType(e)]||void 0},e}();ap.register=function(e,o){if("function"!=typeof o)throw new Error("Cannot register a validator by type, validator is not a function");np[e]=o},ap.warning=function(){},ap.messages=rp,ap.validators=np;var{cubicBezierEaseInOut:lp}=d;var ip=G("form-item","\n display: grid;\n line-height: var(--n-line-height);\n",[G("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 ",[we("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 "),we("asterisk-placeholder","\n grid-area: mark;\n user-select: none;\n -webkit-user-select: none;\n visibility: hidden; \n ")]),G("form-item-blank","\n grid-area: blank;\n min-height: var(--n-blank-height);\n "),ze("auto-label-width",[G("form-item-label","white-space: nowrap;")]),ze("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 ',[G("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 ",[ze("reverse-columns-space","\n grid-template-columns: auto 1fr;\n "),ze("left-mark",'\n grid-template-areas:\n "mark text"\n ". text";\n '),ze("right-mark",'\n grid-template-areas: \n "text mark"\n "text .";\n '),ze("right-hanging-mark",'\n grid-template-areas: \n "text mark"\n "text .";\n '),we("text","\n grid-area: text; \n "),we("asterisk","\n grid-area: mark; \n align-self: end;\n ")])]),ze("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 ',[ze("no-label",'\n grid-template-areas:\n "blank"\n "feedback";\n grid-template-rows: 1fr;\n '),G("form-item-label","\n display: flex;\n align-items: flex-start;\n justify-content: var(--n-label-text-align);\n ")]),G("form-item-blank","\n box-sizing: border-box;\n display: flex;\n align-items: center;\n position: relative;\n "),G("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 ",[Z("&:not(:empty)","\n padding: var(--n-feedback-padding);\n "),G("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[ze("warning",{color:"var(--n-feedback-text-color-warning)"}),ze("error",{color:"var(--n-feedback-text-color-error)"}),function({name:e="fade-down",fromOffset:o="-4px",enterDuration:n=".3s",leaveDuration:t=".3s",enterCubicBezier:r=lp,leaveCubicBezier:a=lp}={}){return[Z(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0,transform:`translateY(${o})`}),Z(`&.${e}-transition-enter-to, &.${e}-transition-leave-from`,{opacity:1,transform:"translateY(0)"}),Z(`&.${e}-transition-leave-active`,{transition:`opacity ${t} ${a}, transform ${t} ${a}`}),Z(`&.${e}-transition-enter-active`,{transition:`opacity ${n} ${r}, transform ${n} ${r}`})]}({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var sp=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())})},dp=Object.assign(Object.assign({},g.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]});st(dp);function cp(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||y("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 y("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 up=Me({name:"FormItem",props:dp,setup(e){qt(Ru,"formItems",lo(e,"path"));const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=J(e),t=We(zu,null),r=function(e){const o=We(zu,null);return{mergedSize:to(()=>void 0!==e.size?e.size:void 0!==(null==o?void 0:o.props.size)?o.props.size:"medium")}}(e),a=function(e){const o=We(zu,null),n=to(()=>{const{labelPlacement:n}=e;return void 0!==n?n:(null==o?void 0:o.props.labelPlacement)?o.props.labelPlacement:"top"}),t=to(()=>"left"===n.value&&("auto"===e.labelWidth||"auto"===(null==o?void 0:o.props.labelWidth))),r=to(()=>{if("top"===n.value)return;const{labelWidth:r}=e;if(void 0!==r&&"auto"!==r)return oe(r);if(t.value){const e=null==o?void 0:o.maxChildLabelWidthRef.value;return void 0!==e?oe(e):void 0}return void 0!==(null==o?void 0:o.props.labelWidth)?oe(o.props.labelWidth):void 0}),a=to(()=>{const{labelAlign:n}=e;return n||((null==o?void 0:o.props.labelAlign)?o.props.labelAlign:void 0)}),l=to(()=>{var o;return[null===(o=e.labelProps)||void 0===o?void 0:o.style,e.labelStyle,{width:r.value}]}),i=to(()=>{const{showRequireMark:n}=e;return void 0!==n?n:null==o?void 0:o.props.showRequireMark}),s=to(()=>{const{requireMarkPlacement:n}=e;return void 0!==n?n:(null==o?void 0:o.props.requireMarkPlacement)||"right"}),d=To(!1),c=To(!1);return{validationErrored:d,validationWarned:c,mergedLabelStyle:l,mergedLabelPlacement:n,mergedLabelAlign:a,mergedShowRequireMark:i,mergedRequireMarkPlacement:s,mergedValidationStatus:to(()=>{const{validationStatus:o}=e;return void 0!==o?o:d.value?"error":c.value?"warning":void 0}),mergedShowFeedback:to(()=>{const{showFeedback:n}=e;return void 0!==n?n:void 0===(null==o?void 0:o.props.showFeedback)||o.props.showFeedback}),mergedShowLabel:to(()=>{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:l,validationWarned:i}=a,{mergedRequired:s,mergedRules:d}=function(e){const o=We(zu,null),n=to(()=>{const{rulePath:o}=e;if(void 0!==o)return o;const{path:n}=e;return void 0!==n?n:void 0}),t=to(()=>{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=tt(e,r);void 0!==o&&(Array.isArray(o)?t.push(...o):t.push(o))}}return t}),r=to(()=>t.value.some(e=>e.required));return{mergedRules:t,mergedRequired:to(()=>r.value||e.required)}}(e),{mergedSize:c}=r,{mergedLabelPlacement:u,mergedLabelAlign:p,mergedRequireMarkPlacement:h}=a,f=To([]),m=To(fe()),v=t?lo(t.props,"disabled"):To(!1),b=g("Form","-form-item",ip,Ft,e,o);function y(){f.value=[],l.value=!1,i.value=!1,e.feedback&&(m.value=fe())}Xe(lo(e,"path"),()=>{e.ignorePathChange||y()});const x=(...o)=>sp(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:s}=d,c=t?tt(t.props.model,a||""):void 0,u={},p={},h=(o?s.filter(e=>Array.isArray(e.trigger)?e.trigger.includes(o):e.trigger===o):s).filter(n).map((e,o)=>{const n=Object.assign({},e);if(n.validator&&(n.validator=cp(n.validator,!1)),n.asyncValidator&&(n.asyncValidator=cp(n.asyncValidator,!0)),n.renderMessage){const e=`__renderMessage__${o}`;p[e]=n.message,n.message=e,u[e]=n.renderMessage}return n}),m=h.filter(e=>"warning"!==e.level),v=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__",x=new ap({[b]:m}),C=new ap({[b]:v}),{validateMessages:w}=(null==t?void 0:t.props)||{};w&&(x.messages(w),C.messages(w));const S=e=>{f.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(m.length){const e=yield new Promise(e=>{x.validate({[b]:c},r,e)});(null==e?void 0:e.length)&&(g.valid=!1,g.errors=e,S(e))}if(v.length&&!g.errors){const e=yield new Promise(e=>{C.validate({[b]:c},r,e)});(null==e?void 0:e.length)&&(S(e),g.warnings=e)}return g.errors||g.warnings?(l.value=!!g.errors,i.value=!!g.warnings):y(),g});Ee(ue,{path:lo(e,"path"),disabled:v,mergedSize:r.mergedSize,mergedValidationStatus:a.mergedValidationStatus,restoreValidation:y,handleContentBlur:function(){x("blur")},handleContentChange:function(){x("change")},handleContentFocus:function(){x("focus")},handleContentInput:function(){x("input")}});const C={validate:function(e,o){return sp(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)=>{x(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:y,internalValidate:x},w=To(null);Je(()=>{if(!a.isAutoLabelWidth.value)return;const e=w.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 S=to(()=>{var e;const{value:o}=c,{value:n}=u,t="top"===n?"vertical":"horizontal",{common:{cubicBezierEaseInOut:r},self:{labelTextColor:a,asteriskColor:l,lineHeight:i,feedbackTextColor:s,feedbackTextColorWarning:d,feedbackTextColorError:h,feedbackPadding:f,labelFontWeight:m,[Pe("labelHeight",o)]:v,[Pe("blankHeight",o)]:g,[Pe("feedbackFontSize",o)]:y,[Pe("feedbackHeight",o)]:x,[Pe("labelPadding",t)]:C,[Pe("labelTextAlign",t)]:w,[Pe(Pe("labelFontSize",n),o)]:S}}=b.value;let k=null!==(e=p.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":f,"--n-feedback-font-size":y,"--n-feedback-height":x,"--n-feedback-text-color":s,"--n-feedback-text-color-warning":d,"--n-feedback-text-color-error":h}}),k=n?X("form-item",to(()=>{var e;return`${c.value[0]}${u.value[0]}${(null===(e=p.value)||void 0===e?void 0:e[0])||""}`}),S,e):void 0,I=to(()=>"left"===u.value&&"left"===h.value&&"left"===p.value);return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:w,mergedClsPrefix:o,mergedRequired:s,feedbackId:m,renderExplains:f,reverseColSpace:I},a),r),C),{cssVars:n?void 0:S,themeClass:null==k?void 0:k.themeClass,onRender:null==k?void 0:k.onRender})},render(){const{$slots:e,mergedClsPrefix:o,mergedShowLabel:n,mergedShowRequireMark:t,mergedRequireMarkPlacement:r,onRender:l}=this,i=void 0!==t?t:this.mergedRequired;null==l||l();return Ue("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=Ue("span",{class:`${o}-form-item-label__text`},e),t=i?Ue("span",{class:`${o}-form-item-label__asterisk`},"left"!==r?" *":"* "):"right-hanging"===r&&Ue("span",{class:`${o}-form-item-label__asterisk-placeholder`}," *"),{labelProps:a}=this;return Ue("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])})(),Ue("div",{class:[`${o}-form-item-blank`,this.contentClass,this.mergedValidationStatus&&`${o}-form-item-blank--${this.mergedValidationStatus}`],style:this.contentStyle},e),this.mergedShowFeedback?Ue("div",{key:this.feedbackId,style:this.feedbackStyle,class:[`${o}-form-item-feedback-wrapper`,this.feedbackClass]},Ue(go,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:n}=this;return a(e.feedback,e=>{var t;const{feedback:r}=this,a=e||r?Ue("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})=>Ue("div",{key:e,class:`${o}-form-item-feedback__line`},n())):null;return a?Ue("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 pp(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 hp=m({name:"Heatmap",common:t,self:pp}),fp={name:"Heatmap",common:ka,self(e){const o=pp(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 mp(e){const{primaryColor:o,baseColor:n}=e;return{color:o,iconColor:n}}var vp={name:"IconWrapper",common:t,self:mp},gp={name:"IconWrapper",common:ka,self:mp},bp={name:"Image",common:ka,peers:{Tooltip:Ji},self:e=>{const{textColor2:o}=e;return{toolbarIconColor:o,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}};var yp=m({name:"Image",common:t,peers:{Tooltip:Yi},self:function(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}}),xp=Z([G("input-number-suffix","\n display: inline-block;\n margin-right: 10px;\n "),G("input-number-prefix","\n display: inline-block;\n margin-left: 10px;\n ")]);function Cp(e){return null==e||"string"==typeof e&&""===e.trim()?null:Number(e)}function wp(e){return null==e||!Number.isNaN(e)}function Sp(e,o){return"number"!=typeof e?"":void 0===o?String(e):e.toFixed(o)}function kp(e){if(null===e)return null;if("number"==typeof e)return e;{const o=Number(e);return Number.isNaN(o)?null:o}}var Ip=Me({name:"InputNumber",props:Object.assign(Object.assign({},g.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(o){const{mergedBorderedRef:n,mergedClsPrefixRef:t,mergedRtlRef:r}=J(o),a=g("InputNumber","-input-number",xp,tc,o,t),{localeRef:l}=h("InputNumber"),i=ae(o),{mergedSizeRef:s,mergedDisabledRef:d,mergedStatusRef:c}=i,u=To(null),f=To(null),m=To(null),v=To(o.defaultValue),b=lo(o,"value"),y=w(b,v),x=To(""),C=e=>{const o=String(e).split(".")[1];return o?o.length:0},S=e(()=>{const{placeholder:e}=o;return void 0!==e?e:l.value.placeholder}),k=e(()=>{const e=kp(o.step);return null!==e?0===e?1:Math.abs(e):1}),I=e(()=>{const e=kp(o.min);return null!==e?e:null}),P=e(()=>{const e=kp(o.max);return null!==e?e:null}),T=()=>{const{value:e}=y;if(wp(e)){const{format:n,precision:t}=o;n?x.value=n(e):null===e||void 0===t||C(e)>t?x.value=Sp(e,void 0):x.value=Sp(e,t)}else x.value=String(e)};T();const A=e=>{const{value:n}=y;if(e===n)return void T();const{"onUpdate:value":t,onUpdateValue:r,onChange:a}=o,{nTriggerFormInput:l,nTriggerFormChange:s}=i;a&&z(a,e),r&&z(r,e),t&&z(t,e),v.value=e,l(),s()},R=({offset:e,doUpdateIfValid:n,fixPrecision:t,isInputing:r})=>{const{value:a}=x;if(r&&((l=a).includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(l)||/^-?\d*$/.test(l))||"-"===l||"-0"===l))return!1;var l;const i=(o.parse||Cp)(a);if(null===i)return n&&A(null),null;if(wp(i)){const a=C(i),{precision:l}=o;if(void 0!==l&&l<a&&!t)return!1;let s=Number.parseFloat((i+e).toFixed(null!=l?l:(e=>{const n=[o.min,o.max,o.step,e].map(e=>void 0===e?0:C(e));return Math.max(...n)})(i)));if(wp(s)){const{value:e}=P,{value:t}=I;if(null!==e&&s>e){if(!n||r)return!1;s=e}if(null!==t&&s<t){if(!n||r)return!1;s=t}return!(o.validator&&!o.validator(s))&&(n&&A(s),s)}}return!1},M=e(()=>!1===R({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})),F=e(()=>{const{value:e}=y;if(o.validator&&null===e)return!1;const{value:n}=k;return!1!==R({offset:-n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})}),O=e(()=>{const{value:e}=y;if(o.validator&&null===e)return!1;const{value:n}=k;return!1!==R({offset:+n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})});function $(){const{value:e}=O;if(!e)return void N();const{value:n}=y;if(null===n)o.validator||A(_());else{const{value:e}=k;R({offset:e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function B(){const{value:e}=F;if(!e)return void U();const{value:n}=y;if(null===n)o.validator||A(_());else{const{value:e}=k;R({offset:-e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const E=function(e){const{onFocus:n}=o,{nTriggerFormFocus:t}=i;n&&z(n,e),t()},D=function(e){var n,t;if(e.target===(null===(n=u.value)||void 0===n?void 0:n.wrapperElRef))return;const r=R({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||"")),y.value===r&&T()}else T();const{onBlur:a}=o,{nTriggerFormBlur:l}=i;a&&z(a,e),l(),_e(()=>{T()})};function _(){if(o.validator)return null;const{value:e}=I,{value:n}=P;return null!==e?Math.max(0,e):null!==n?Math.min(0,n):0}let L=null,H=null,j=null;function U(){j&&(window.clearTimeout(j),j=null),L&&(window.clearInterval(L),L=null)}let W=null;function N(){W&&(window.clearTimeout(W),W=null),H&&(window.clearInterval(H),H=null)}Xe(y,()=>{T()});const K={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()}},V=p("InputNumber",r,t);return Object.assign(Object.assign({},K),{rtlEnabled:V,inputInstRef:u,minusButtonInstRef:f,addButtonInstRef:m,mergedClsPrefix:t,mergedBordered:n,uncontrolledValue:v,mergedValue:y,mergedPlaceholder:S,displayedValueInvalid:M,mergedSize:s,mergedDisabled:d,displayedValue:x,addable:O,minusable:F,mergedStatus:c,handleFocus:E,handleBlur:D,handleClear:function(e){!function(e){const{onClear:n}=o;n&&z(n,e)}(e),A(null)},handleMouseDown:function(e){var o,n,t;(null===(o=m.value)||void 0===o?void 0:o.$el.contains(e.target))&&e.preventDefault(),(null===(n=f.value)||void 0===n?void 0:n.$el.contains(e.target))&&e.preventDefault(),null===(t=u.value)||void 0===t||t.activate()},handleAddClick:()=>{H||$()},handleMinusClick:()=>{L||B()},handleAddMousedown:function(){N(),W=window.setTimeout(()=>{H=window.setInterval(()=>{$()},100)},800),ie("mouseup",document,N,{once:!0})},handleMinusMousedown:function(){U(),j=window.setTimeout(()=>{L=window.setInterval(()=>{B()},100)},800),ie("mouseup",document,U,{once:!0})},handleKeyDown:function(e){var n,t;if("Enter"===e.key){if(e.target===(null===(n=u.value)||void 0===n?void 0:n.wrapperElRef))return;!1!==R({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&(null===(t=u.value)||void 0===t||t.deactivate())}else if("ArrowUp"===e.key){if(!O.value)return;if(!1===o.keyboard.ArrowUp)return;e.preventDefault(),!1!==R({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&$()}else if("ArrowDown"===e.key){if(!F.value)return;if(!1===o.keyboard.ArrowDown)return;e.preventDefault(),!1!==R({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})&&B()}},handleUpdateDisplayedValue:function(e){x.value=e,!o.updateValueOnInput||o.format||o.parse||void 0!==o.precision||R({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})},mergedTheme:a,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:to(()=>{const{self:{iconColorDisabled:e}}=a.value,[o,n,t,r]=ve(e);return{textColorTextDisabled:`rgb(${o}, ${n}, ${t})`,opacityDisabled:`${r}`}})})},render(){const{mergedClsPrefix:e,$slots:o}=this,n=()=>Ue(U,{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:()=>Te(o["minus-icon"],()=>[Ue(ee,{clsPrefix:e},{default:()=>Ue(yr,null)})])}),t=()=>Ue(U,{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:()=>Te(o["add-icon"],()=>[Ue(ee,{clsPrefix:e},{default:()=>Ue(pr,null)})])});return Ue("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},Ue($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(),a(o.prefix,o=>o?Ue("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?[a(o.suffix,o=>o?Ue("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)}}))}}),Pp={extraFontSize:"12px",width:"440px"},Tp={name:"Transfer",common:ka,peers:{Checkbox:mi,Scrollbar:Ia,Input:Tl,Empty:Ja,Button:li},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({},Pp),{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 Ap=m({name:"Transfer",common:t,peers:{Checkbox:it,Scrollbar:Ie,Input:Gn,Empty:B,Button:te},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({},Pp),{itemHeightSmall:d,itemHeightMedium:s,itemHeightLarge:i,fontSizeSmall:l,fontSizeMedium:a,fontSizeLarge:r,borderRadius:c,borderColor:v,listColor:u,headerColor:de(u,p),titleTextColor:h,titleTextColorDisabled:f,extraTextColor:m,filterDividerColor:v,itemTextColor:m,itemTextColorDisabled:f,itemColorPending:g,titleFontWeight:o,iconColor:t,iconColorDisabled:n})}});function zp(){return{}}var Rp={name:"Marquee",common:t,self:zp},Mp={name:"Marquee",common:ka,self:zp},Fp={name:"QrCode",common:ka,self:e=>({borderRadius:e.borderRadius})};var Op={name:"QrCode",common:t,self:function(e){return{borderRadius:e.borderRadius}}},$p=Me({name:"Scrollbar",props:Object.assign(Object.assign({},g.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=To(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 Ue(Ae,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}}),Bp={name:"Skeleton",common:ka,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 Ep={name:"Skeleton",common:t,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}}},Dp=Z([Z("@keyframes spin-rotate","\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n "),G("spin-container","\n position: relative;\n ",[G("spin-body","\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n ",[ke()])]),G("spin-body","\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n "),G("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 ",[ze("rotate","\n animation: spin-rotate 2s linear infinite;\n ")]),G("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 "),G("spin-content","\n opacity: 1;\n transition: opacity .3s var(--n-bezier);\n pointer-events: all;\n ",[ze("spinning","\n user-select: none;\n -webkit-user-select: none;\n pointer-events: none;\n opacity: var(--n-opacity-spinning);\n ")])]),_p={small:20,medium:18,large:16},Lp=Me({name:"Spin",props:Object.assign(Object.assign({},g.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}=J(e),t=g("Spin","-spin",Dp,he,e,o),r=to(()=>{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?V(o):r[Pe("size",o)],"--n-color":l,"--n-text-color":i}}),a=n?X("spin",to(()=>{const{size:o}=e;return"number"==typeof o?String(o):o[0]}),r,e):void 0,l=F(e,["spinning","show"]),i=To(!1);return Ke(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:to(()=>{const{strokeWidth:o}=e;if(void 0!==o)return o;const{size:n}=e;return _p["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)&&Ue("div",{class:`${t}-spin-description`},r||(null===(e=n.description)||void 0===e?void 0:e.call(n))),i=n.icon?Ue("div",{class:[`${t}-spin-body`,this.themeClass]},Ue("div",{class:[`${t}-spin`,a&&`${t}-spin--rotate`],style:n.default?"":this.cssVars},n.icon()),l):Ue("div",{class:[`${t}-spin-body`,this.themeClass]},Ue(T,{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?Ue("div",{class:[`${t}-spin-container`,this.themeClass],style:this.cssVars},Ue("div",{class:[`${t}-spin-content`,this.active&&`${t}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),Ue(go,{name:"fade-in-transition"},{default:()=>this.active?i:null})):i}}),Hp={name:"Split",common:ka};var jp,Up={name:"Split",common:t,self:function(e){const{primaryColorHover:o,borderColor:n}=e;return{resizableTriggerColorHover:o,resizableTriggerColor:n}}},Wp=G("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",[we("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 "),we("rail-placeholder","\n display: flex;\n flex-wrap: none;\n "),we("button-placeholder","\n width: calc(1.75 * var(--n-rail-height));\n height: var(--n-rail-height);\n "),G("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 ",[b({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),we("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 "),we("checked","\n right: 0;\n padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));\n "),we("unchecked","\n left: 0;\n justify-content: flex-end;\n padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));\n "),Z("&:focus",[we("rail","\n box-shadow: var(--n-box-shadow-focus);\n ")]),ze("round",[we("rail","border-radius: calc(var(--n-rail-height) / 2);",[we("button","border-radius: calc(var(--n-button-height) / 2);")])]),H("disabled",[H("icon",[ze("rubber-band",[ze("pressed",[we("rail",[we("button","max-width: var(--n-button-width-pressed);")])]),we("rail",[Z("&:active",[we("button","max-width: var(--n-button-width-pressed);")])]),ze("active",[ze("pressed",[we("rail",[we("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),we("rail",[Z("&:active",[we("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),ze("active",[we("rail",[we("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),we("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 ",[we("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 ",[b()]),we("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 ')]),ze("active",[we("rail","background-color: var(--n-rail-color-active);")]),ze("loading",[we("rail","\n cursor: wait;\n ")]),ze("disabled",[we("rail","\n cursor: not-allowed;\n opacity: .5;\n ")])]),Np=Me({name:"Switch",props:Object.assign(Object.assign({},g.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===jp&&(jp="undefined"==typeof CSS||void 0!==CSS.supports&&CSS.supports("width","max(1px)"));const{mergedClsPrefixRef:o,inlineThemeDisabled:n}=J(e),t=g("Switch","-switch",Wp,Zc,e,o),r=ae(e),{mergedSizeRef:a,mergedDisabledRef:l}=r,i=To(e.defaultValue),s=lo(e,"value"),d=w(s,i),c=to(()=>d.value===e.checkedValue),u=To(!1),p=To(!1),h=to(()=>{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&&z(n,o),a&&z(a,o),t&&z(t,o),i.value=o,l(),s()}const m=to(()=>{const{value:e}=a,{self:{opacityDisabled:o,railColor:n,railColorActive:r,buttonBoxShadow:l,buttonColor:i,boxShadowFocus:s,loadingColor:d,textColor:c,iconColor:u,[Pe("buttonHeight",e)]:p,[Pe("buttonWidth",e)]:h,[Pe("buttonWidthPressed",e)]:f,[Pe("railHeight",e)]:m,[Pe("railWidth",e)]:v,[Pe("railBorderRadius",e)]:g,[Pe("buttonBorderRadius",e)]:b},common:{cubicBezierEaseInOut:y}}=t.value;let x,C,w;return jp?(x=`calc((${m} - ${p}) / 2)`,C=`max(${m}, ${p})`,w=`max(${v}, calc(${v} + ${p} - ${m}))`):(x=V((re(m)-re(p))/2),C=V(Math.max(re(m),re(p))),w=re(m)>re(p)?v:V(re(v)+re(p)-re(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?X("switch",to(()=>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:n,checked:t,mergedRailStyle:r,onRender:l,$slots:i}=this;null==l||l();const{checked:s,unchecked:d,icon:c,"checked-icon":u,"unchecked-icon":p}=i,h=!(j(c)&&j(u)&&j(p));return Ue("div",{role:"switch","aria-checked":t,class:[`${e}-switch`,this.themeClass,h&&`${e}-switch--icon`,t&&`${e}-switch--active`,n&&`${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},Ue("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:r},a(s,o=>a(d,n=>o||n?Ue("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},Ue("div",{class:`${e}-switch__rail-placeholder`},Ue("div",{class:`${e}-switch__button-placeholder`}),o),Ue("div",{class:`${e}-switch__rail-placeholder`},Ue("div",{class:`${e}-switch__button-placeholder`}),n)):null)),Ue("div",{class:`${e}-switch__button`},a(c,n=>a(u,t=>a(p,r=>Ue(o,null,{default:()=>this.loading?Ue(T,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(t||n)?Ue("div",{class:`${e}-switch__button-icon`,key:t?"checked-icon":"icon"},t||n):this.checked||!r&&!n?null:Ue("div",{class:`${e}-switch__button-icon`,key:r?"unchecked-icon":"icon"},r||n)})))),a(s,o=>o&&Ue("div",{key:"checked",class:`${e}-switch__checked`},o)),a(d,o=>o&&Ue("div",{key:"unchecked",class:`${e}-switch__unchecked`},o)))))}}),Kp=G("text","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n",[ze("strong","\n font-weight: var(--n-font-weight-strong);\n "),ze("italic",{fontStyle:"italic"}),ze("underline",{textDecoration:"underline"}),ze("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 ")]),Vp=Me({name:"Text",props:Object.assign(Object.assign({},g.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}=J(e),t=g("Typography","-text",Kp,zt,e,o),r=to(()=>{const{depth:o,type:n}=e,r="default"===n?void 0===o?"textColor":`textColor${o}Depth`:Pe("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?X("text",to(()=>`${e.type[0]}${e.depth||""}`),r,e):void 0;return{mergedClsPrefix:o,compitableTag:F(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?Ue("code",{class:r,style:this.cssVars},this.delete?Ue("del",null,a):a):this.delete?Ue("del",{class:r,style:this.cssVars},a):Ue(this.compitableTag||"span",{class:r,style:this.cssVars},a)}}),qp=()=>({}),Gp={name:"light",common:t,Alert:vl,Anchor:Il,AutoComplete:Hl,Avatar:Vl,AvatarGroup:Jl,BackTop:Ql,Badge:oi,Breadcrumb:ri,Button:te,ButtonGroup:Xd,Calendar:di,Card:Pt,Carousel:hi,Cascader:gi,Checkbox:it,Code:ki,Collapse:Pi,CollapseTransition:zi,ColorPicker:Fi,DataTable:rs,DatePicker:Es,Descriptions:Hs,Dialog:bt,Divider:Ot,Drawer:Bd,Dropdown:Vi,DynamicInput:Hd,DynamicTags:Kd,Element:qd,Empty:B,Equation:{name:"Equation",common:t,self:qp},Ellipsis:Xi,Flex:Yd,Form:Ft,GradientText:oc,Heatmap:hp,Icon:D,IconWrapper:vp,Image:yp,Input:Gn,InputNumber:tc,InputOtp:ac,Layout:sc,LegacyTransfer:Ap,List:pc,LoadingBar:Ys,Log:mc,Menu:yc,Mention:gc,Message:rd,Modal:St,Notification:vd,PageHeader:Sc,Pagination:Ui,Popconfirm:Tc,Popover:Jn,Popselect:Ei,Progress:Rc,QrCode:Op,Radio:os,Rate:Oc,Row:cc,Result:Ec,Scrollbar:Ie,Skeleton:Ep,Select:Un,Slider:Hc,Space:gt,Spin:he,Statistic:Wc,Steps:qc,Switch:Zc,Table:eu,Tabs:ru,Tag:Y,Thing:iu,TimePicker:Fs,Timeline:uu,Tooltip:Yi,Transfer:fu,Tree:vu,TreeSelect:yu,Typography:zt,Upload:wu,Watermark:Iu,Split:Up,FloatButton:Au,FloatButtonGroup:Pu,Marquee:Rp},Jp={name:"dark",common:ka,Alert:ml,Anchor:Pl,AutoComplete:jl,Avatar:ql,AvatarGroup:Yl,BackTop:Xl,Badge:ei,Breadcrumb:ai,Button:li,ButtonGroup:Zd,Calendar:ci,Card:ui,Carousel:fi,Cascader:bi,Checkbox:mi,Code:Si,Collapse:Ti,CollapseTransition:Ri,ColorPicker:Oi,DataTable:as,DatePicker:Ds,Descriptions:js,Dialog:Us,Divider:Od,Drawer:Ed,Dropdown:qi,DynamicInput:_d,DynamicTags:Nd,Element:Vd,Empty:Ja,Ellipsis:Zi,Equation:{name:"Equation",common:ka,self:qp},Flex:Jd,Form:Qd,GradientText:ec,Heatmap:fp,Icon:ys,IconWrapper:gp,Image:bp,Input:Tl,InputNumber:nc,InputOtp:lc,LegacyTransfer:Tp,Layout:ic,List:hc,LoadingBar:Js,Log:fc,Menu:xc,Mention:vc,Message:ad,Modal:Ws,Notification:gd,PageHeader:kc,Pagination:Wi,Popconfirm:Ac,Popover:tl,Popselect:Bi,Progress:Mc,QrCode:Fp,Radio:es,Rate:Fc,Result:Dc,Row:dc,Scrollbar:Ia,Select:Di,Skeleton:Bp,Slider:Lc,Space:jd,Spin:jc,Statistic:Nc,Steps:Gc,Switch:Yc,Table:ou,Tabs:au,Tag:rl,Thing:su,TimePicker:Os,Timeline:cu,Tooltip:Ji,Transfer:hu,Tree:gu,TreeSelect:bu,Typography:xu,Upload:Su,Watermark:ku,Split:Hp,FloatButton:Tu,FloatButtonGroup:{name:"FloatButtonGroup",common:ka,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:Mp},Yp=["disabled"],Zp=ge({__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,t=o,r=to(()=>n.disabled?"#6b7280":n.active?"#18a058":void 0);function a(){n.disabled||t("click")}return(o,n)=>(Ye(),qe(yo(hs),{placement:e.tooltipPlacement},{trigger:io(()=>[Mo("button",{class:ho(["header-button",{active:e.active,disabled:e.disabled}]),disabled:e.disabled,onClick:a},[Ne(yo(Q),{size:e.iconSize,color:r.value},{default:io(()=>[(Ye(),qe(Ze(e.icon)))]),_:1},8,["size","color"])],10,Yp)]),default:io(()=>[ko(o.$slots,"default",{},()=>[$e(eo(e.tooltip),1)],!0)]),_:3},8,["placement"]))}},[["__scopeId","data-v-b515354d"]]);async function Xp(e=null){const o=e?{platform:e}:{};return(await _o.get("/env/check",{params:o})).data}function Qp(){return Fd(["message","dialog"],{configProviderProps:{theme:"dark"===document.documentElement.getAttribute("data-theme")?Jp:Gp}})}var eh=Qp();new MutationObserver(()=>{eh=Qp()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var oh={success:(...e)=>eh.message.success(...e),error:(...e)=>eh.message.error(...e),warning:(...e)=>eh.message.warning(...e),info:(...e)=>eh.message.info(...e),loading:(...e)=>eh.message.loading(...e)},nh={success:(...e)=>eh.dialog.success(...e),error:(...e)=>eh.dialog.error(...e),warning:(...e)=>eh.dialog.warning(...e),info:(...e)=>eh.dialog.info(...e),create:(...e)=>eh.dialog.create(...e)},th={class:"modal-header"},rh={class:"modal-content"},ah={class:"desc-text"},lh={class:"conflict-list"},ih={class:"list-header"},sh={key:0,class:"selected-hint"},dh={class:"conflict-items"},ch=["onClick"],uh={class:"item-content"},ph={class:"item-header"},hh={class:"var-name"},fh={class:"var-value"},mh={class:"var-source"},vh={class:"modal-footer"},gh={__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 n=e,t=o,r=to({get:()=>n.visible,set:e=>t("update:visible",e)}),a=To(new Set),l=To(!1),i=to(()=>a.value.size),s=to(()=>n.conflicts.length>0&&a.value.size===n.conflicts.length),d=to(()=>a.value.size>0&&a.value.size<n.conflicts.length),c=to(()=>n.conflicts.length>0&&n.conflicts.every(e=>"process"===e.sourceType));function u(e){return`${e.varName}:${e.sourcePath}`}function p(e){return"process"===e.sourceType?"进程环境变量":e.sourcePath}function h(e){a.value=e?new Set(n.conflicts.map(u)):new Set}function f(){t("close")}function m(){t("ignore")}function v(){t("never-remind")}async function g(){const e=n.conflicts.filter(e=>a.value.has(u(e)));e.every(e=>"process"===e.sourceType)?oh.warning("进程环境变量无法直接删除,请手动从 shell 配置文件中移除"):nh.warning({title:"确认删除",content:`确定要删除选中的 ${e.length} 个环境变量吗?删除前会自动备份。`,positiveText:"删除",negativeText:"取消",onPositiveClick:async()=>{l.value=!0;try{(await async function(e){return(await _o.post("/env/delete",{conflicts:e})).data}(e)).success&&(oh.success("删除成功,备份已保存"),a.value=new Set,t("deleted"))}catch(o){oh.error("删除失败: "+o.message)}finally{l.value=!1}}})}return(o,n)=>(Ye(),qe(yo(Tt),{show:r.value,"onUpdate:show":n[1]||(n[1]=e=>r.value=e),preset:"card",title:null,bordered:!1,closable:!0,"mask-closable":!1,style:{width:"560px","max-width":"90vw"},onClose:f},{header:io(()=>[Mo("div",th,[Ne(yo(Q),{class:"warning-icon",size:22},{default:io(()=>[Ne(yo(bn))]),_:1}),n[2]||(n[2]=Mo("span",{class:"header-title"},"检测到环境变量冲突",-1))])]),footer:io(()=>[Mo("div",vh,[Ne(yo(me),{tertiary:"",onClick:m},{default:io(()=>[...n[8]||(n[8]=[$e(" 暂时忽略 ",-1)])]),_:1}),Ne(yo(me),{tertiary:"",onClick:v},{default:io(()=>[...n[9]||(n[9]=[$e(" 不再提醒 ",-1)])]),_:1}),c.value?Oe("",!0):(Ye(),qe(yo(me),{key:0,type:"error",disabled:0===i.value,loading:l.value,onClick:g},{default:io(()=>[$e(" 删除选中 ("+eo(i.value)+") ",1)]),_:1},8,["disabled","loading"]))])]),default:io(()=>[Mo("div",rh,[Mo("p",ah,[n[3]||(n[3]=$e(" 发现 ",-1)),Mo("strong",null,eo(e.conflicts.length),1),n[4]||(n[4]=$e(" 个环境变量可能影响代理配置,建议清理后再使用代理功能。 ",-1))]),c.value?(Ye(),qe(yo(wl),{key:0,type:"info",bordered:!1,class:"process-env-alert"},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(nn))]),_:1})]),default:io(()=>[n[5]||(n[5]=Mo("div",{class:"alert-content"},[Mo("p",{class:"alert-title"},"这些环境变量来自当前进程,请按以下步骤处理:"),Mo("ol",{class:"alert-list"},[Mo("li",null,"检查对应 shell 配置文件(如 ~/.zshrc、~/.bashrc 或 PowerShell Profile)中是否有这些变量"),Mo("li",null,"如果有,删除或注释掉相关行"),Mo("li",null,[Mo("strong",null,"重启终端"),$e(",然后重新运行 "),Mo("code",null,"ct")])]),Mo("p",{class:"alert-hint"},"如果配置文件中没有,可能是终端临时设置的,直接重启终端即可")],-1))]),_:1})):Oe("",!0),Mo("div",lh,[Mo("div",ih,[Ne(yo(wi),{checked:s.value,indeterminate:d.value,"onUpdate:checked":h},{default:io(()=>[...n[6]||(n[6]=[$e(" 全选 ",-1)])]),_:1},8,["checked","indeterminate"]),i.value>0?(Ye(),Ro("span",sh," 已选 "+eo(i.value)+" 项 ",1)):Oe("",!0)]),Ne(yo($p),{style:{"max-height":"280px"}},{default:io(()=>[Mo("div",dh,[(Ye(!0),Ro(co,null,He(e.conflicts,e=>{return Ye(),Ro("div",{key:u(e),class:ho(["conflict-item",{selected:a.value.has(u(e))}]),onClick:o=>function(e){const o=u(e);a.value.has(o)?a.value.delete(o):a.value.add(o),a.value=new Set(a.value)}(e)},[Ne(yo(wi),{checked:a.value.has(u(e)),onClick:n[0]||(n[0]=bo(()=>{},["stop"])),"onUpdate:checked":o=>function(e,o){const n=u(e);o?a.value.add(n):a.value.delete(n),a.value=new Set(a.value)}(e,o)},null,8,["checked","onUpdate:checked"]),Mo("div",uh,[Mo("div",ph,[Mo("code",hh,eo(e.varName),1),Ne(yo(dl),{type:(o=e.platform,{claude:"warning",codex:"success",gemini:"info"}[o]||"default"),size:"tiny",bordered:!1},{default:io(()=>[$e(eo(e.platform),1)]),_:2},1032,["type"])]),Mo("div",fh,eo(e.varValue),1),Mo("div",mh,[n[7]||(n[7]=Mo("span",{class:"source-label"},"来源:",-1)),$e(" "+eo(p(e)),1)])])],10,ch);var o}),128))])]),_:1})])])]),_:1},8,["show"]))}},bh=ge(gh,[["__scopeId","data-v-7ea71ef7"]]);async function yh(){return(await _o.get("/security")).data}async function xh(e){return(await _o.post("/security/password",e)).data}var Ch=new Map;function wh(e,o="",n="",t=""){return`${e}:${o}:${n}:${function(e=""){return e?String(e):""}(t)}`}function Sh(e,o,n=e.split(":",1)[0],t=n){const r=Ch.get(e);if(r)return r.promise;for(const[i,s]of Ch)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(()=>{Ch.get(e)===l&&Ch.delete(e)}),Ch.set(e,l),l.promise}var kh="__ccAdvancedConfigBound__",Ih=null,Ph=0,Th=!1,Ah=null,zh=Object.create(null);function Rh(e,o,n,t={},r){return Sh(wh(e,o,"",""),e=>Oo.get(n,{params:t,signal:e}),e,`${e}:${o}`).catch(()=>r)}function Mh(){const e=new Date;return e.setHours(0,0,0,0),{start:e.getTime(),end:e.getTime()+864e5}}function Fh(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 Oh(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=Co("global",()=>{const{catalog:e,enabledKeys:o}=Ht(),n=no({}),t=no({}),r=no({}),a=no({}),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,lo(n,o)),l.get(o)):null}function v(e){const o=f(e);return o?(i.has(o)||i.set(o,lo(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(zh).forEach(e=>{delete zh[e]}),Object.entries(t).forEach(([e,o])=>{o.forEach(o=>{o?.name&&(zh[o.name]=e)})})}o.value.forEach(f);const x=To(!1),C=To(!1);let w="",S="";const k=To(100),I=To(30);let P=null,T=100,A=Mh();function z(e){return function(){const e=Date.now();(e<A.start||e>=A.end)&&(A=Mh(),$())}(),e>=A.start&&e<A.end}function R(e){for(;e.length>T;)e.pop()}function M(e){T=e,k.value=e,Object.values(a).forEach(R)}function F(e){const o=parseInt(e,10);if(Number.isNaN(o))return;const n=Math.min(Math.max(o,10),300);I.value!==n&&(I.value=n)}function O(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 zh[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(!z(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:Oh(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),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:Fh(o,e)},cost:e.cost||0,isHistory:Th,isNew:!Th};n.unshift(a),R(n),a.isNew&&setTimeout(()=>{a.isNew=!1},4500)}function $(){Object.keys(a).forEach(e=>{a[e].splice(0,a[e].length)})}function B(e,o={},n){e.value={...e.value,...o,activeChannel:n||e.value.activeChannel}}function E(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 D(e){const o=d(e?.source);if(!o||!u(o))return;const n=m(o);n&&(B(n,e.proxy,e.activeChannel),e.channels&&(E(o,e.channels),y()))}async function _(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 P||(P=async function(e){try{return(await Promise.all(e.map(async e=>{const o=$o(e),n=Rh("channels",e,`/api${o}/channels`,{},{data:{channels:[]}}),t=Bo(e)?Rh("channel-pool",e,`/api${o}/channels/pool/status?source=${encodeURIComponent(e)}`,{},{data:null}):Promise.resolve({data:null});return{key:e,channelResponse:await n,poolResponse:await t}}))).forEach(({key:e,channelResponse:o,poolResponse:n})=>{const t=o?.data;E(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(()=>{P=null}),P)}return"undefined"==typeof window||window[kh]||(window.addEventListener("advanced-config-change",e=>{e.detail?.maxLogs&&M(e.detail.maxLogs),e.detail?.statsInterval&&F(e.detail.statsInterval)}),window[kh]=!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=()=>{Ph=0,x.value=!0,Th=!0,clearTimeout(Ah),Ah=setTimeout(()=>{Th=!1},2e3)},Ih.onmessage=e=>{try{const o=JSON.parse(e.data);"proxy-state"===o.type?D(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):O(o)}catch(o){}},Ih.onclose=()=>{x.value=!1,Ih=null,Th=!1,clearTimeout(Ah);const o=Math.min(1e3*Math.pow(2,Ph),1e4);Ph+=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=>Rh("proxy-status",e,`/api${$o(e)}/proxy/status`,{},{data:{}})))).forEach((e,o)=>{const t=e?.data||{},r=m(n[o]);r&&t.proxy&&B(r,t.proxy,t.activeChannel)}),w=e,C.value=!0}catch(t){}},loadChannels:_,getProxyState:m,getChannels:v,getSchedulerState:g,handleProxyStateUpdate:D,hydrateFromDashboard:function(e={}){const n=e.channels||{};Object.entries(n).forEach(([e,o])=>{u(e)&&E(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&&B(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 Eo(o,"unsupported");const n=m(o);if(!n)throw Eo(o,"not_found");const t=await Oo.post(`/api${$o(o)}/proxy/start`);return t.data.success&&(n.value.running=!0,n.value.activeChannel=t.data.activeChannel,n.value.startTime=Date.now()),t.data},stopProxy:async function(e,o={}){const n=d(e);if(!u(n)||!p(n,"proxy"))throw Eo(n,"unsupported");const t=m(n);if(!t)throw Eo(n,"not_found");const r=await Oo.post(`/api${$o(n)}/proxy/stop`);return t.value.running=!1,t.value.activeChannel=null,t.value.startTime=null,t.value.runtime=null,!1!==r.data?.success&&await _({force:!0,keys:[n]}),o.refreshChannelsDrawer&&!1!==r.data?.success&&"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:n,reason:"proxy-stop"}})),r.data},getLogs:function(e){return to(()=>b(e))},wsConnected:x,dashboardHydrated:C,clearLogsState:$,clearLogsForSource:function(e){a[e]&&a[e].splice(0,a[e].length)},logLimit:k,statsInterval:I,loadAdvancedConfig:async function(){try{const e=await fetch("/api/config/advanced");if(e.ok){const o=await e.json();M(o.maxLogs||100),o.statsInterval&&F(o.statsInterval)}}catch(e){}}}}),Bh=!1;function Eh(e){return`${$o(e)}/channels`}async function Dh(e){return(await _o.get(Eh(e))).data}async function _h(e,o){return(await _o.post(Eh(e),o)).data}async function Lh(e,o,n){return(await _o.put(`${Eh(e)}/${encodeURIComponent(o)}`,n)).data}async function Hh(e,o){return(await _o.delete(`${Eh(e)}/${encodeURIComponent(o)}`)).data}async function jh(e,o){return Lh("dsh",e,o)}async function Uh(e){return Hh("dsh",e)}async function Wh(){return(await _o.post("/dsh/channels/sync")).data}async function Nh(e,o=2e4){return(await _o.post(`/dsh/channels/${encodeURIComponent(e)}/speed-test`,{timeout:o})).data}async function Kh(e,o=""){const n=o?`${Eh(e)}/auth?channelId=${encodeURIComponent(o)}`:`${Eh(e)}/auth`;return(await _o.get(n)).data}async function Vh(e,o,n=!1){const t=n?"?refresh=true":"";return(await _o.get(`${Eh(e)}/${encodeURIComponent(o)}/auth/quota${t}`)).data}function qh(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 Gh(e,o){const n=await Kh(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=>qh(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 Vh(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 Kh(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=>qh(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()}}async function Jh(){return(await _o.post("/channels/sync-current")).data}async function Yh(e,o){return(await _o.put(`/channels/${e}`,o)).data}async function Zh(e){return(await _o.delete(`/channels/${e}`)).data}async function Xh(e,o){return(await _o.post(`/channel-balances/${e}/${o}/refresh`)).data}async function Qh(){return(await _o.post("/codex/channels/sync-current")).data}async function ef(e,o){return(await _o.put(`/codex/channels/${e}`,o)).data}async function of(e){return(await _o.delete(`/codex/channels/${e}`)).data}async function nf(){return(await _o.post("/gemini/channels/sync-current")).data}async function tf(e,o){return(await _o.put(`/gemini/channels/${e}`,o)).data}async function rf(e){return(await _o.delete(`/gemini/channels/${e}`)).data}async function af(e,o=2e4){return(await _o.post(`/channels/${e}/speed-test`,{timeout:o})).data}async function lf(e,o=2e4){return(await _o.post(`/codex/channels/${e}/speed-test`,{timeout:o})).data}async function sf(e,o=2e4){return(await _o.post(`/gemini/channels/${e}/speed-test`,{timeout:o})).data}async function df(){return(await _o.post("/opencode/channels/sync-current")).data}async function cf(e,o){return(await _o.put(`/opencode/channels/${e}`,o)).data}async function uf(e){return(await _o.delete(`/opencode/channels/${e}`)).data}async function pf(e,o=2e4){return(await _o.post(`/opencode/channels/${e}/speed-test`,{timeout:o})).data}async function hf(){return(await _o.post("/omp/channels/sync-current")).data}async function ff(e,o){return(await _o.put(`/omp/channels/${e}`,o)).data}async function mf(e){return(await _o.delete(`/omp/channels/${e}`)).data}async function vf(e,o,n){const t=Do(e),r={claude:Yh,codex:ef,gemini:tf,opencode:cf,omp:ff}[t];return r?r(o,n):Lh(t,o,n)}async function gf(e,o=2e4){return(await _o.post(`/omp/channels/${e}/speed-test`,{timeout:o})).data}async function bf(e){const o=Do(e),n={claude:"/claude",codex:"/codex",gemini:"/gemini",opencode:"/opencode",omp:"/omp"}[o]||$o(o);return(await _o.get(`${n}/statistics/today`)).data}async function yf(e){return(await _o.get("/statistics/trend",{params:e})).data}async function xf(e){return(await _o.get("/statistics/filters",{params:e})).data}function Cf(e){return`/api/statistics/trend/export?${new URLSearchParams(e).toString()}`}function wf(e){return Array.isArray(e)?e:Array.isArray(e?.channels)?e.channels:[]}function Sf(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 kf(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:Sf(e.byChannel)}}var If=Co("dashboard",()=>{const{enabledKeys:e,getPlatform:o}=Ht(),n=To({uiConfig:null,favorites:null,channels:{},proxyStatus:{},todayStats:{},counts:{},meta:null}),t=To(!1),r=To(!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 _o.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,wf),proxyStatus:p(a.proxyStatus,e=>e&&"object"==typeof e?e:{}),todayStats:p(a.todayStats,kf),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 Dh(o);n.value.channels[o]=wf(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 _o.get(`${$o(e)}/proxy/status`)).data}(o)}catch(t){}},refreshStats:async function(e){const o=h(e,"statistics");if(o)try{const e=await bf(o),t=e?.summary||{};n.value.todayStats[o]=kf({requests:t.requests||0,tokens:t.tokens||0,cost:t.cost||0,byModel:e?.byModel||{},byChannel:e?.byChannel||{}})}catch(t){}}}}),Pf="cc-theme",Tf=To(!1),Af=!1,zf=null,Rf=null,Mf=!1;function Ff(){return zf||(zf=If(),Rf=ro(zf).dashboardData),zf}function Of(){Mf||Rf&&(Xe(()=>Rf.value?.uiConfig?.theme,e=>{if(!e)return;const o="dark"===e;if(!Af)return Af=!0,Tf.value=o,void Bf(o);Tf.value!==o&&(Tf.value=o,Bf(o))}),Mf=!0)}async function $f(){if(Af)return;const e="undefined"!=typeof window?window.localStorage?.getItem(Pf):null;"dark"!==e&&"light"!==e||(Tf.value="dark"===e,Bf(Tf.value));try{const o=Ff();Of();let n=Rf?.value?.uiConfig?.theme;n||(n=(await o.loadDashboard().catch(()=>null))?.uiConfig?.theme),n||e?n&&(Tf.value="dark"===n):Tf.value=window.matchMedia("(prefers-color-scheme: dark)").matches}catch(o){e||(Tf.value=window.matchMedia("(prefers-color-scheme: dark)").matches)}Bf(Tf.value),Af=!0}function Bf(e){e?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme")}function Ef(){Tf.value=!Tf.value}function Df(){return{isDark:Tf,toggleTheme:Ef,loadTheme:$f}}function _f(){const e=$h(),{proxyStateByPlatform:o,channelsByPlatform:n,schedulerStateByPlatform:t,logsBySource:r,wsConnected:a,logLimit:l,statsInterval:i}=ro(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 Lf(){!function(){if(Bh)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})}),Bh=!0}()}Xe(Tf,async e=>{Bf(e);try{window.localStorage?.setItem(Pf,e?"dark":"light")}catch(o){}try{await jo("theme",e?"dark":"light"),Ff(),Of(),Rf.value&&(Rf.value={...Rf.value,uiConfig:{...Rf.value.uiConfig||{},theme:e?"dark":"light"}})}catch(o){}});var Hf=Co("favorites",()=>{const e=To({claude:[],codex:[],gemini:[]}),o=To(!1),n=To(!1);let t=null;return{favorites:e,totalFavorites:to(()=>(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 _o.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 _o.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 _o.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 jf(){const e=Hf(),{favorites:o,totalFavorites:n}=ro(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 Uf(){const e=If(),{dashboardData:o,isLoading:n,isLoaded:t}=ro(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 Wf={class:"channel-header"},Nf={class:"channel-title"},Kf=["title"],Vf={class:"channel-actions"},qf={class:"test-result-header"},Gf={class:"test-result-status"},Jf={class:"test-result-info"},Yf={key:0,class:"status-code"},Zf={key:1,class:"status-code"},Xf={key:2,class:"status-code"},Qf={key:3,class:"status-code"},em={key:0,class:"latency"},om={key:1,class:"status-code"},nm={key:0,class:"test-result-error"},tm={key:1,class:"test-result-warning"},rm={class:"channel-info"},am={class:"info-main"},lm={class:"info-footer"},im={class:"channel-meta"},sm={class:"meta-item"},dm={class:"meta-value"},cm={class:"meta-item"},um={__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 n=e,t=o,r=To(!1),a=To(null),l=to(()=>"oauth"===n.channel?.authMode),i=to(()=>{if(!n.balance?.visible||"oauth-quota"!==n.balance.kind)return[];const e=Array.isArray(n.balance.windows)?n.balance.windows:[],o=e.filter(e=>"primary"===e?.id||"secondary"===e?.id);return o.length?o:e}),s=to(()=>i.value.length>0);function d(e){const o=Number(e);return Number.isFinite(o)?Number.isInteger(o)?String(o):o.toFixed(1).replace(/\.0$/,""):"—"}function c(e){const o=[];if(n.balance?.platform&&o.push(n.balance.platform),e?.label&&o.push(`${e.label} 剩余 ${d(e.remainingPercent)}%`),e?.resetsAt)try{o.push(`重置 ${new Date(e.resetsAt).toLocaleString()}`)}catch{}return o.join(" · ")}const u=to(()=>{if(!n.balance?.visible)return"";const e=[];if(n.balance.platform&&e.push(n.balance.platform),n.balance.stale&&e.push("缓存"),n.balance.updatedAt)try{e.push(new Date(n.balance.updatedAt).toLocaleString())}catch{}if(Array.isArray(n.balance.windows)&&n.balance.windows.length){const o=n.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 p(){const e=l.value?n.authCheckFn:n.testFn;if(e){r.value=!0,a.value=null;try{const o=l.value?await e(n.channel.id):await e(n.channel.id,2e4);a.value=l.value?{...o,kind:"oauth"}:o}catch(o){a.value=l.value?{kind:"oauth",level:"failed",title:"授权检查失败",error:o.message||"检查失败"}:{success:!1,error:o.message||"测试失败",latency:null,statusCode:null}}finally{r.value=!1}}}function h(e){const o=new Date(e);return Number.isNaN(o.getTime())?String(e):o.toLocaleString()}return(o,n)=>(Ye(),Ro("div",{class:ho(["channel-card",{collapsed:e.collapsed,disabled:!1===e.channel.enabled,"status-frozen":"frozen"===e.channel.health?.status,"status-checking":"checking"===e.channel.health?.status}])},[Mo("div",Wf,[Mo("div",Nf,[Ne(yo(me),{text:"",size:"tiny",class:"collapse-btn",onClick:n[0]||(n[0]=bo(e=>o.$emit("toggle-collapse"),["stop"]))},{default:io(()=>[Ne(yo(Q),{size:"16",class:ho({collapsed:e.collapsed})},{default:io(()=>[Ne(yo(Cn))]),_:1},8,["class"])]),_:1}),Mo("span",{class:"channel-name",title:e.channel.name},eo(e.channel.name),9,Kf),(Ye(!0),Ro(co,null,He(e.headerTags,e=>(Ye(),qe(yo(dl),{key:e.text,size:"tiny",type:e.type||"default",bordered:!1},{default:io(()=>[$e(eo(e.text),1)]),_:2},1032,["type"]))),128))]),Mo("div",Vf,[e.showApplyButton?(Ye(),qe(yo(me),{key:0,size:"tiny",type:"primary",class:"apply-btn",onClick:n[1]||(n[1]=e=>o.$emit("apply"))},{default:io(()=>[...n[9]||(n[9]=[$e(" 写入配置 ",-1)])]),_:1})):Oe("",!0),Ne(yo(me),{size:"tiny",loading:r.value,onClick:p},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[l.value?(Ye(),qe(yo(fn),{key:0})):(Ye(),qe(yo(xn),{key:1}))]),_:1})]),default:io(()=>[$e(" "+eo(l.value?"检查授权":"测速"),1)]),_:1},8,["loading"]),Ne(yo(me),{size:"tiny",onClick:n[2]||(n[2]=e=>o.$emit("edit"))},{default:io(()=>[...n[10]||(n[10]=[$e(" 编辑 ",-1)])]),_:1}),Ne(yo(me),{size:"tiny",type:"error",onClick:n[3]||(n[3]=e=>o.$emit("delete"))},{default:io(()=>[...n[11]||(n[11]=[$e(" 删除 ",-1)])]),_:1}),Ne(yo(Np),{size:"small",value:!1!==e.channel.enabled,loading:e.toggling,disabled:e.toggling,"onUpdate:value":n[4]||(n[4]=e=>o.$emit("toggle-enabled",e))},null,8,["value","loading","disabled"])])]),a.value?(Ye(),Ro("div",{key:0,class:ho(["test-result","oauth"===a.value.kind?a.value.level:a.value.success?"success":"failed"])},[Mo("div",qf,[Mo("span",Gf,["oauth"===a.value.kind?(Ye(),Ro(co,{key:0},["success"===a.value.level?(Ye(),qe(yo(Q),{key:0,color:"#18a058"},{default:io(()=>[Ne(yo(kn))]),_:1})):"warning"===a.value.level?(Ye(),qe(yo(Q),{key:1,color:"#d99000"},{default:io(()=>[Ne(yo(Zo))]),_:1})):(Ye(),qe(yo(Q),{key:2,color:"#f56c6c"},{default:io(()=>[Ne(yo(dn))]),_:1})),$e(" "+eo(a.value.title),1)],64)):(Ye(),Ro(co,{key:1},[a.value.success?(Ye(),qe(yo(Q),{key:0,color:"#18a058"},{default:io(()=>[Ne(yo(kn))]),_:1})):(Ye(),qe(yo(Q),{key:1,color:"#f56c6c"},{default:io(()=>[Ne(yo(dn))]),_:1})),$e(" "+eo(a.value.success?"测试成功":"测试失败"),1)],64))]),Mo("div",Jf,["oauth"===a.value.kind?(Ye(),Ro(co,{key:0},[a.value.account?(Ye(),Ro("span",Yf,eo(a.value.account),1)):Oe("",!0),a.value.expiresAt?(Ye(),Ro("span",Zf,"Token 到期 "+eo(h(a.value.expiresAt)),1)):(Ye(),Ro("span",Xf,"Token 有效期未知")),a.value.checkedAt?(Ye(),Ro("span",Qf,"检查于 "+eo(h(a.value.checkedAt)),1)):Oe("",!0)],64)):(Ye(),Ro(co,{key:1},[a.value.latency?(Ye(),Ro("span",em,eo(a.value.latency)+"ms",1)):Oe("",!0),a.value.statusCode?(Ye(),Ro("span",om,"HTTP "+eo(a.value.statusCode),1)):Oe("",!0)],64))]),Ne(yo(me),{text:"",size:"tiny",onClick:n[5]||(n[5]=e=>a.value=null)},{default:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(sn))]),_:1})]),_:1})]),a.value.error?(Ye(),Ro("div",nm,eo(a.value.error),1)):Oe("",!0),a.value.warning?(Ye(),Ro("div",tm,eo(a.value.warning),1)):Oe("",!0)],2)):Oe("",!0),zo(Mo("div",rm,[Mo("div",am,[(Ye(!0),Ro(co,null,He(e.infoRows,e=>(Ye(),Ro("div",{key:e.label,class:"info-row"},[Ne(yo(Vp),{depth:"3",class:"label"},{default:io(()=>[$e(eo(e.label)+":",1)]),_:2},1024),Ne(yo(Vp),{depth:"2",class:ho(["value",{mono:e.mono}])},{default:io(()=>[$e(eo(e.value||"—"),1)]),_:2},1032,["class"]),"function"==typeof e.action?(Ye(),qe(yo(me),{key:0,size:"tiny",text:"",type:"primary",onClick:o=>e.action()},{default:io(()=>[$e(eo(e.actionLabel||"操作"),1)]),_:2},1032,["onClick"])):Oe("",!0)]))),128))]),Mo("div",lm,[e.channel.websiteUrl?(Ye(),qe(yo(me),{key:0,text:"",size:"tiny",onClick:n[6]||(n[6]=n=>o.$emit("open-website",e.channel.websiteUrl))},{icon:io(()=>[Ne(yo(Q),{size:"14"},{default:io(()=>[Ne(yo(Yo))]),_:1})]),default:io(()=>[n[12]||(n[12]=$e(" 前往官网 ",-1))]),_:1})):Oe("",!0),n[15]||(n[15]=Mo("div",{class:"footer-spacer"},null,-1)),Mo("div",im,[s.value?(Ye(!0),Ro(co,{key:0},He(i.value,e=>(Ye(),qe(yo(dl),{key:e.id||e.label,size:"tiny",type:"success",bordered:!1,class:"balance-meta-tag",title:c(e),onClick:n[7]||(n[7]=bo(e=>t("refresh-balance"),["stop"]))},{default:io(()=>[$e(eo(e.label)+" 剩余 "+eo(d(e.remainingPercent))+"% ",1)]),_:2},1032,["title"]))),128)):e.balance?.visible&&e.balance.label?(Ye(),qe(yo(dl),{key:1,size:"tiny",type:"success",bordered:!1,class:"balance-meta-tag",title:u.value,onClick:n[8]||(n[8]=bo(e=>t("refresh-balance"),["stop"]))},{default:io(()=>[$e(eo(e.balance.label),1)]),_:1},8,["title"])):Oe("",!0),Mo("span",sm,[n[13]||(n[13]=$e(" 权重: ",-1)),Mo("span",dm,eo(e.meta.weight),1)]),Mo("span",cm,[n[14]||(n[14]=$e(" 并发: ",-1)),Mo("span",{class:ho(["meta-value",{"meta-active":e.meta.concurrencyActive}])},eo(e.meta.concurrencyText),3)])])])],512),[[so,!e.collapsed]])],2))}},pm=ge(um,[["__scopeId","data-v-beb1848e"]]),hm=To(null),fm=To(null),mm=To(!1),vm={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:[]},gm=Object.freeze(Object.keys(vm));function bm(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 ym(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 xm(){return Object.fromEntries(gm.map(e=>[e,[...vm[e]||[]]]))}var Cm=null;async function wm(e={}){const o=!0===e.forceRefresh;return!o&&hm.value&&fm.value?hm.value:Cm||(mm.value=!0,Cm=(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();hm.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([...gm,...Object.keys(o||{}),...n])],r=Object.fromEntries(t.map(e=>[e,[]]));if(Object.keys(o||{}).length>0){for(const e of t)r[e]=bm(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:[ym(a)];for(const o of e)r[o]&&r[o].push(a)}return Object.fromEntries(t.map(e=>[e,bm(r[e])]))}(o.models||{},o.toolModels||{});fm.value=Object.fromEntries(Object.entries(n).map(([e,o])=>[e,o.length>0?o:[...vm[e]||[]]]))}catch(e){fm.value=xm()}}catch(n){hm.value=vm,fm.value=xm()}finally{mm.value=!1,Cm=null}return hm.value})())}function Sm(e){const o=hm.value?.[e];if(Array.isArray(o)&&o.length>0)return o;const n=fm.value?.[e];return Array.isArray(n)&&n.length>0?n:vm[e]||[]}function km(e){return fm.value?.[e]||vm[e]||[]}function Im(){return{defaultModels:hm,allModels:fm,loading:mm,loadDefaultModels:wm,getDefaultModels:Sm,getAllModelsByToolType:km}}var Pm={class:"model-redirect-editor"},Tm={class:"redirect-input"},Am={class:"redirect-arrow"},zm={class:"redirect-input"},Rm={__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,t=o,{getDefaultModels:r,loadDefaultModels:a}=Im();Je(async()=>{await a()});const l=to(()=>n.availableModels&&n.availableModels.length>0?n.availableModels:r(n.channelType).map(e=>({label:e,value:e})));function i(e){if(!e)return l.value;const o=e.toLowerCase();return l.value.filter(e=>(e.label||e.value||"").toLowerCase().includes(o))}function s(e,o,r){const a=[...n.modelValue];a[e]={...a[e],[o]:r},t("update:modelValue",a)}function d(){t("update:modelValue",[...n.modelValue,{from:"",to:""}])}return(o,r)=>(Ye(),Ro("div",Pm,[(Ye(!0),Ro(co,null,He(e.modelValue,(e,o)=>(Ye(),Ro("div",{key:o,class:"redirect-row"},[Mo("div",Tm,[Ne(yo(Nl),{value:e.from,options:i(e.from),placeholder:"源模型",clearable:"","get-show":()=>!0,"onUpdate:value":e=>s(o,"from",e)},null,8,["value","options","onUpdate:value"])]),Mo("div",Am,[Ne(yo(Q),{size:"16",color:"#999"},{default:io(()=>[Ne(yo(en))]),_:1})]),Mo("div",zm,[Ne(yo(Nl),{value:e.to,options:i(e.to),placeholder:"目标模型",clearable:"","get-show":()=>!0,"onUpdate:value":e=>s(o,"to",e)},null,8,["value","options","onUpdate:value"])]),Ne(yo(me),{quaternary:"",circle:"",size:"small",onClick:e=>function(e){const o=n.modelValue.filter((o,n)=>n!==e);t("update:modelValue",o)}(o)},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(sn))]),_:1})]),_:1},8,["onClick"])]))),128)),Ne(yo(me),{dashed:"",size:"small",onClick:d,class:"add-btn"},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(Xo))]),_:1})]),default:io(()=>[r[0]||(r[0]=$e(" 添加重定向规则 ",-1))]),_:1})]))}},Mm=ge(Rm,[["__scopeId","data-v-8ebdcad0"]]);function Fm(e,o=""){const n=To(!1),t=To([]),r=To(""),a=To(null);return{loading:n,candidates:t,warning:r,quota:a,sync:async function(){n.value=!0,r.value="";try{const n=await async function(e,o=""){return(await _o.post(`${Eh(e)}/auth/sync-local`,o?{channelId:o}:{})).data}(yo(e),yo(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=yo(o);if(!t)return null;const l=await Vh(yo(e),t,n);return a.value=l.quota||null,l.warning&&(r.value=l.warning),l}}}var Om={class:"channel-auth-section"},$m={class:"oauth-content"},Bm={key:2,class:"oauth-meta"},Em={key:3,class:"oauth-quota"},Dm={__name:"ChannelAuthSection",props:{platform:String,channelId:String,formData:Object,authMeta:Object},emits:["update-auth"],setup(e,{emit:o}){const n=e,t=o;function r(e){const o=e.authRef||e;return`${o.credentialId||o.providerId}:${o.accountId||o.identityKey||o.accountEmail||"account"}`}const a=to(()=>r({authRef:n.formData.authRef})),{loading:l,candidates:i,warning:s,quota:d,sync:c,refreshQuota:u}=Fm(lo(n,"platform"),lo(n,"channelId")),p=to(()=>Array.isArray(d.value?.windows)&&d.value.windows.length?d.value.windows:[d.value?.primary,d.value?.secondary]);function h(e){const o=i.value.find(o=>r(o)===e);o&&t("update-auth",o)}return(o,n)=>(Ye(),Ro("div",Om,[Mo("div",$m,[Ne(yo(me),{size:"small",type:"primary",loading:yo(l),onClick:yo(c)},{default:io(()=>[...n[0]||(n[0]=[$e("同步本地 OAuth",-1)])]),_:1},8,["loading","onClick"]),yo(s)?(Ye(),qe(yo(wl),{key:0,type:"warning","show-icon":!1},{default:io(()=>[$e(eo(yo(s)),1)]),_:1})):Oe("",!0),yo(i).length?(Ye(),qe(yo(ps),{key:1,value:a.value,"onUpdate:value":h},{default:io(()=>[Ne(yo(Wd),{vertical:""},{default:io(()=>[(Ye(!0),Ro(co,null,He(yo(i),o=>(Ye(),qe(yo(cs),{key:o.id,value:r(o)},{default:io(()=>[$e(eo(o.providerId||e.platform)+" / "+eo(o.accountEmail||o.accountId||o.authRef?.identityKey||"本地账户"),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])):Oe("",!0),e.authMeta?.channel?(Ye(),Ro("div",Bm,eo(e.authMeta.channel.authRef?.providerId||e.platform)+" · "+eo(e.authMeta.channel.authRef?.accountEmail||e.authMeta.channel.authRef?.accountId||"已同步"),1)):Oe("",!0),yo(d)?(Ye(),Ro("div",Em,[(Ye(!0),Ro(co,null,He(p.value,e=>(Ye(),Ro("span",{key:e?.id||e?.label||"missing-window"},eo(e?.label||"—")+": "+eo(e?`${e.remainingPercent}%`:"—"),1))),128)),Ne(yo(me),{text:"",size:"tiny",onClick:yo(u)},{default:io(()=>[...n[1]||(n[1]=[$e("刷新额度",-1)])]),_:1},8,["onClick"])])):Oe("",!0)])]))}},_m=ge(Dm,[["__scopeId","data-v-8fcf77d4"]]),Lm=[{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:{}}],Hm={official:"官方",cn_official:"国内官方",aggregator:"聚合服务",third_party:"第三方",oauth:"OAuth",custom:"自定义"};function jm(e){return Lm.find(o=>o.id===e)}var Um=[{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:""}],Wm={official:"官方",oauth:"OAuth",custom:"自定义"};function Nm(e){return Um.find(o=>o.id===e)}var Km=[{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"}],Vm={official:"官方",oauth:"OAuth",custom:"自定义"};function qm(e){return Km.find(o=>o.id===e)}var Gm=[{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:"entry_responses",name:"Responses 入口",category:"entry",description:"渠道按 OpenAI Responses 请求入口管理(非 Codex)",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"responses",gatewaySourceType:"openai_compatible",models:[]},{id:"custom",name:"自定义",category:"custom",description:"自定义 OpenAI 兼容的 API 端点",websiteUrl:"",baseUrl:"",wireApi:"openai",models:[]}],Jm={oauth:"OAuth",apikey:"API Key",entry:"转换入口",custom:"自定义"};function Ym(e){return Gm.find(o=>o.id===e)}var Zm=[{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:"entry_responses",name:"Responses 入口",category:"entry",description:"渠道按 OpenAI Responses 请求入口管理(非 Codex)",websiteUrl:"",baseUrl:"",wireApi:"openai",providerApi:"responses",gatewaySourceType:"openai_compatible",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:[]}],Xm={apikey:"API Key",entry:"转换入口",oauth:"OAuth",custom:"自定义"};function Qm(e){return Zm.find(o=>o.id===e)}function ev(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=ev(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 ov(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=ev(t);if(e&&"[object Object]"!==e)return e}return o}var{getAllModelsByToolType:nv,loadDefaultModels:tv}=Im(),rv=/^https?:\/\//i,av=/^[a-z0-9_-]+$/i,lv=new Set(["anyrouter","newcli"]),iv=["model","allowedModels","speedTestModel","presetId","modelConfig","models","modelMetadataMode","modelBindings","modelRedirects","targetApi","apiFormat","proxyUrl"];function sv(e){const o=e?.extra;if(!o||"object"!=typeof o||Array.isArray(o))return e;const n={...e};return iv.forEach(e=>{void 0!==n[e]&&null!==n[e]||void 0===o[e]||(n[e]=o[e])}),n}function dv(e){const o=Array.isArray(e)?e:e?.channels||[];return Array.isArray(o)?o.map(sv):[]}function cv(e){return dv(e)}function uv(e){const o=Number(e);return!Number.isFinite(o)||o<=0?null:Math.round(o)}function pv(e){const o=Number(e);return!Number.isFinite(o)||o<1?1:Math.min(100,Math.round(o))}function hv(e,o,{required:n}={}){if(!o)return n?`${e}不能为空`:"";if(!rv.test(o))return`${e}必须以 http:// 或 https:// 开头`;try{new URL(o)}catch(t){return`${e}不是合法的链接`}return""}function fv(e){const o=String(e||"").trim();return o?av.test(o)?"openai"===o.toLowerCase()?"Provider Key 不能使用保留值 openai,请改成 openai-official 之类的自定义标识":"":"只能包含字母、数字、下划线和中划线,例如 openai-official":"Provider Key 不能为空"}function mv(e,o){try{return JSON.stringify(e??o,null,2)}catch{return JSON.stringify(o,null,2)}}function vv(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 gv(e){const o=vv(e,"模型定义",[]);if(!Array.isArray(o))throw new Error("模型定义必须是 JSON 数组");return o}function bv(e){try{const o=gv(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 yv(e){const o=vv(e,"Provider 高级配置",{});if(!o||"object"!=typeof o||Array.isArray(o))throw new Error("Provider 高级配置必须是 JSON 对象");return o}function xv(e){const o=!0!==e._showChannelBalance||Rv(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 Cv(e){const o=xv(e);return"oauth"!==o.authMode?o:Tv(e)?{...o,apiKey:String(e.apiKey||"").trim(),transport:"pi-native"}:{...o,transport:""}}function wv(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 Sv(e={}){return"oauth"===e.authMode}function kv(e={}){return"oauth"===e.authMode&&"pi-native"!==e.transport}function Iv(e){return!Sv(e)}function Pv(){return{key:"authMode",label:"本地登录",type:"channel-auth",showWhen:Sv}}function Tv(e={}){return Sv(e)&&!0===e.oauthGatewayMode}function Av(e={}){return!Sv(e)||Tv(e)}function zv(e={}){return!Sv(e)}function Rv(e={}){return!0===e._showChannelBalance&&lv.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 Mv(e="余额凭据"){return{key:"balanceToken",label:e,type:"password",showWhen:e=>Iv(e)&&Rv(e),placeholder:"选填:余额接口需要的会话 Token / Cookie(NewCLI 可填完整 Cookie)"}}function Fv(){return{key:"balanceUserId",label:"余额用户 ID",type:"number",min:1,clearable:!0,showWhen:e=>Iv(e)&&Rv(e),placeholder:"选填:New API / AnyRouter 需要 New-Api-User 时填写"}}function Ov(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 Bv(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 Ev(e=[]){return e.map(e=>({label:e,value:e}))}function Dv(...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 _v(e){return Ev(nv(e))}function Lv(e,o={}){if("omp"===e)return _v("omp");if("opencode"===e){const e=["claude","codex","gemini"].includes(o.gatewaySourceType)?o.gatewaySourceType:"";return Dv(_v("opencode"),e?_v(e):[])}return _v(e)}var Hv={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:"停用"}]},jv={dsh:()=>({type:"dsh",displayName:"DSH",schedulerSource:"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:fv},{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=>hv("Base URL",e,{required:!0})},{key:"apiKey",label:"API Key",type:"password",required:!0,placeholder:"sk-..."},{key:"apiKeyEnv",label:"Key 环境变量",type:"text",placeholder:"CTX_DSH_PROVIDER_API_KEY"},{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:_v("dsh"),clearable:!0}]},{title:"模型重定向",description:"将代理收到的模型名重定向到该渠道的实际模型。",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Hv.schedule}],getInitialForm:()=>({name:"DSH 渠道",providerKey:"",providerApi:"openai-completions",baseUrl:"",apiKey:"",apiKeyEnv:"",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||"",apiKeyEnv:e.apiKeyEnv||"",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 tv();const t=_v("dsh");if(!e)return void(o.availableModels=t);const r=await async function(e,{forceRefresh:o=!1}={}){return(await _o.get(`/dsh/channels/${encodeURIComponent(e)}/models`,{params:o?{forceRefresh:"true"}:{}})).data}(e,{forceRefresh:n});o.availableModels=Dv(Ev(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:Nh,api:{fetch:async()=>dv(await async function(){return Dh("dsh")}()),syncCurrent:Wh,create:e=>async function(e){return _h("dsh",e)}({name:e.name,providerKey:e.providerKey,providerApi:e.providerApi,baseUrl:e.baseUrl,apiKey:e.apiKey,apiKeyEnv:e.apiKeyEnv||void 0,model:e.model,models:e.models,speedTestModel:e.speedTestModel||null,modelRedirects:e.modelRedirects||[],maxConcurrency:uv(e.maxConcurrency),weight:pv(e.weight),enabled:e.enabled}),update:(e,o)=>jh(e.id,{name:o.name,providerApi:o.providerApi,baseUrl:o.baseUrl,apiKey:o.apiKey,apiKeyEnv:o.apiKeyEnv||void 0,model:o.model,models:o.models,speedTestModel:o.speedTestModel||null,modelRedirects:o.modelRedirects||[],maxConcurrency:uv(o.maxConcurrency),weight:pv(o.weight),enabled:o.enabled}),toggle:(e,o)=>jh(e.id,{enabled:o}),remove:Uh,applyToSettings:e=>async function(e){return(await _o.post(`/dsh/channels/${encodeURIComponent(e)}/apply`)).data}(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",schedulerSource:"claude",storageKeys:{localCollapse:"claudeChannelCollapse",collapseConfigKey:"claude",orderConfigKey:"claude"},emptyDescription:"暂无渠道",showEmptyAction:!1,emptyActionText:"",modalWidth:520,formLabelWidth:95,showApplyButton:!0,presets:Lm,presetCategories:Hm,getPresetById:jm,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[Pv(),{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"输入渠道名称"},{key:"baseUrl",showWhen:Iv,label:"接口地址",type:"text",required:!0,placeholder:"https://api.example.com",validate:e=>hv("接口地址",e,{required:!0})},{key:"apiKey",showWhen:Iv,label:"接口密钥",type:"password",required:!0,placeholder:"sk-..."},Mv(),Fv(),{key:"websiteUrl",showWhen:Iv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>hv("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:Iv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则自动检测)",description:"指定用于速度测试的模型,留空则使用自动检测",options:_v("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=>!Sv(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:Hv.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=jm(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||""}),Bv(t,n)},fetchModelsForChannel:async(e,o)=>{await tv();const n=_v((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 async function(e,o="claude"){const n=o?{params:{type:o}}:void 0;return(await _o.get(`/channels/${e}/models`,n)).data}(e,o.gatewaySourceType||null);t.models&&t.models.length>0?(o.availableModels=Dv(Ev(t.models),n),t.fallbackUsed&&(o.modelsFetchError=ov(t?.error,"无法自动获取模型列表(API 端点受保护)"),o.modelsFetchErrorHint=t.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!t.fallbackUsed&&t.supported||(o.availableModels=n,o.modelsFetchError=ov(t?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=t.errorHint||"已使用默认模型列表")}catch(r){o.availableModels=n;const e=r.response?.data;e?(o.modelsFetchError=ov(e?.error||r,"获取模型列表失败"),o.modelsFetchErrorHint=e.errorHint||"已使用默认模型列表"):(o.modelsFetchError=ov(r,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表")}finally{o.modelsFetching=!1}},testFn:af,api:{fetch:async()=>dv(await async function(){return(await _o.get("/channels")).data}()),syncCurrent:Jh,create:async e=>{const o=xv(e);return await async function(e,o,n,t,r={}){const a={name:e,baseUrl:o,apiKey:n,websiteUrl:t,...r};return(await _o.post("/channels",a)).data}(e.name,e.baseUrl,o.apiKey,e.websiteUrl||void 0,{maxConcurrency:uv(e.maxConcurrency),weight:pv(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",...wv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=xv(o);return await Yh(e.id,{name:o.name,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:uv(o.maxConcurrency),weight:pv(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",...wv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:(e,o)=>Yh(e.id,{enabled:o}),remove:Zh,applyToSettings:async e=>async function(e){return(await _o.post(`/channels/${e}/apply-to-settings`)).data}(e.id),resetHealth:async e=>async function(e){return(await _o.post(`/channels/${e}/reset-health`)).data}(e.id)},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",schedulerSource:"codex",storageKeys:{localCollapse:"codexChannelCollapse",collapseConfigKey:"codex",orderConfigKey:"codex"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 Codex 渠道",modalWidth:600,formLabelWidth:90,showApplyButton:!0,presets:Um,presetCategories:Wm,getPresetById:Nm,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[Pv(),{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:fv},{key:"baseUrl",showWhen:Iv,label:"Base URL",type:"text",required:!0,placeholder:"https://api.example.com",validate:e=>hv("Base URL",e,{required:!0})},{key:"apiKey",showWhen:Iv,label:"API Key",type:"password",required:!0,placeholder:"sk-..."},Mv(),Fv(),{key:"websiteUrl",showWhen:Iv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>hv("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:Iv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则使用默认)",description:"指定用于速度测试的模型,留空则使用默认模型",options:_v("codex"),clearable:!0}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Hv.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=Nm(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",Bv(t,n)},fetchModelsForChannel:async(e,o)=>{if(await tv(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null,!e)return o.availableModels=_v("codex"),void(o.modelsFetching=!1);try{const n=await async function(e){return(await _o.get(`/codex/channels/${e}/models`)).data}(e);n.models&&n.models.length>0?(o.availableModels=Dv(Ev(n.models),_v("codex")),n.fallbackUsed&&(o.modelsFetchError=ov(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!n.fallbackUsed&&n.supported||(o.availableModels=_v("codex"),o.modelsFetchError=ov(n?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表")}catch(n){o.availableModels=_v("codex"),o.modelsFetchError=ov(n,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表"}finally{o.modelsFetching=!1}},testFn:lf,api:{fetch:async()=>dv(await async function(){return(await _o.get("/codex/channels")).data}()),syncCurrent:Qh,create:async e=>{const o=xv(e);return await async function(e,o,n,t,r,a={}){return(await _o.post("/codex/channels",{name:e,providerKey:o,baseUrl:n,apiKey:t,websiteUrl:r,...a})).data}(e.name,e.providerKey,e.baseUrl,o.apiKey,e.websiteUrl||"",{maxConcurrency:uv(e.maxConcurrency),weight:pv(e.weight),enabled:e.enabled,modelRedirects:e.modelRedirects||[],speedTestModel:e.speedTestModel||null,presetId:e.presetId||null,gatewaySourceType:e.gatewaySourceType||"codex",...wv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=xv(o);return await ef(e.id,{name:o.name,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:uv(o.maxConcurrency),weight:pv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,gatewaySourceType:o.gatewaySourceType||"codex",...wv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>ef(e.id,{enabled:o}),remove:of,applyToSettings:async e=>async function(e){return(await _o.post(`/codex/channels/${e}/apply-to-settings`)).data}(e.id),resetHealth:async e=>async function(e){return(await _o.post(`/codex/channels/${e}/reset-health`)).data}(e.id)},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:kv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:kv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}]}),gemini:()=>({type:"gemini",displayName:"Gemini",schedulerSource:"gemini",storageKeys:{localCollapse:"geminiChannelCollapse",collapseConfigKey:"gemini",orderConfigKey:"gemini"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 Gemini 渠道",modalWidth:520,formLabelWidth:90,showApplyButton:!1,presets:Km,presetCategories:Vm,getPresetById:qm,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[Pv(),{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=>hv("Base URL",e,{required:!0})},{key:"apiKey",showWhen:Iv,label:"API Key",type:"password",required:!0,placeholder:"AIza..."},Mv(),Fv(),{key:"websiteUrl",showWhen:Iv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>hv("官网链接",e,{required:!1})},{key:"speedTestModel",showWhen:Iv,label:"测速模型",type:"select",placeholder:"选择用于测速的模型(留空则使用 model 字段)",description:"指定用于速度测试的模型,留空则使用上方配置的 Model",options:_v("gemini"),clearable:!0}]},{title:"模型重定向",description:"仅在代理开启时生效,将请求的模型重定向到指定模型",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Hv.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=qm(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",Bv(t,n)},fetchModelsForChannel:async(e,o)=>{if(await tv(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null,!e)return o.availableModels=_v("gemini"),void(o.modelsFetching=!1);try{const n=await async function(e){return(await _o.get(`/gemini/channels/${e}/models`)).data}(e);n.models&&n.models.length>0?(o.availableModels=Dv(Ev(n.models),_v("gemini")),n.fallbackUsed&&(o.modelsFetchError=ov(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表,您也可以手动输入模型名称")):!n.fallbackUsed&&n.supported||(o.availableModels=_v("gemini"),o.modelsFetchError=ov(n?.error,"该供应商不支持模型列表接口"),o.modelsFetchErrorHint=n.errorHint||"已使用默认模型列表")}catch(n){o.availableModels=_v("gemini"),o.modelsFetchError=ov(n,"获取模型列表失败"),o.modelsFetchErrorHint="已使用默认模型列表"}finally{o.modelsFetching=!1}},testFn:sf,api:{fetch:async()=>dv(await async function(){return(await _o.get("/gemini/channels")).data}()),syncCurrent:nf,create:async e=>{const o=xv(e);return await async function(e,o,n,t,r,a={}){return(await _o.post("/gemini/channels",{name:e,baseUrl:o,apiKey:n,model:t,websiteUrl:r,...a})).data}(e.name,e.baseUrl,o.apiKey,e.model,e.websiteUrl||"",{maxConcurrency:uv(e.maxConcurrency),weight:pv(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",...wv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=xv(o);return await tf(e.id,{name:o.name,model:o.model,baseUrl:o.baseUrl,apiKey:n.apiKey,websiteUrl:o.websiteUrl,maxConcurrency:uv(o.maxConcurrency),weight:pv(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",...wv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>tf(e.id,{enabled:o}),remove:rf,resetHealth:async e=>async function(e){return(await _o.post(`/gemini/channels/${e}/reset-health`)).data}(e.id)},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:kv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:kv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}];var n}}),opencode:()=>({type:"opencode",displayName:"OpenCode",schedulerSource:"opencode",storageKeys:{localCollapse:"opencodeChannelCollapse",collapseConfigKey:"opencode",orderConfigKey:"opencode"},emptyDescription:"暂无渠道",showEmptyAction:!0,emptyActionText:"添加 OpenCode 渠道",modalWidth:600,formLabelWidth:95,showApplyButton:!1,presets:Gm,presetCategories:Jm,getPresetById:Ym,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[Pv(),{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=>hv("Base URL",e,{required:!0})},{key:"apiKey",label:"API Key",type:"password",required:!0,showWhen:Iv,placeholder:"sk-..."},Mv(),Fv(),{key:"websiteUrl",label:"官网链接",type:"text",showWhen:Iv,placeholder:"https://(选填)",validate:e=>hv("官网链接",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:Hv.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=Ym(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",Bv(t,n)},fetchModelsForChannel:async(e,o,{forceRefresh:n=!1}={})=>{await tv(),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=_v("claude"===e?"claude":"gemini"===e?"gemini":"codex"),void(o.modelsFetching=!1)}if(!e){const e=Lv("opencode",o);if(!o.baseUrl)return o.availableModels=e,o.modelsFetchMeta={offline:!0,source:"Models.dev"},void(o.modelsFetching=!1);try{const n=await async function({baseUrl:e,apiKey:o,gatewaySourceType:n}){return(await _o.post("/opencode/channels/probe-models",{baseUrl:e,apiKey:o,gatewaySourceType:n})).data}({baseUrl:o.baseUrl,apiKey:o.apiKey||"",gatewaySourceType:o.gatewaySourceType||"codex"});o.availableModels=Dv(Ev(n.models||[]),e),n.error&&(o.modelsFetchError=ov(n?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=n.errorHint||(e.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"))}catch(a){o.availableModels=e,o.modelsFetchError=ov(a,"获取模型列表失败"),o.modelsFetchErrorHint=e.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}return}const r=Lv("opencode",o);try{const t=await async function(e,{forceRefresh:o=!1}={}){return(await _o.get(`/opencode/channels/${e}/models`,{params:o?{forceRefresh:"true"}:{}})).data}(e,{forceRefresh:n}),a=Ev(t.models||[]);o.availableModels=Dv(a,r),(t.fallbackUsed||0===a.length&&r.length>0)&&(o.modelsFetchError=ov(t?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=t.errorHint||"已使用 Models.dev 离线模型列表")}catch(a){o.availableModels=r,o.modelsFetchError=ov(a,"获取模型列表失败"),o.modelsFetchErrorHint=r.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"}finally{o.modelsFetching=!1}},testFn:pf,api:{fetch:async()=>dv(await async function(){return(await _o.get("/opencode/channels")).data}()),syncCurrent:df,create:async e=>{const o=xv(e);return await async function(e,o,n,t={}){return(await _o.post("/opencode/channels",{name:e,baseUrl:o,apiKey:n,wireApi:t.wireApi||"openai",gatewaySourceType:t.gatewaySourceType||"codex",enabled:!1!==t.enabled,weight:t.weight||1,maxConcurrency:t.maxConcurrency||null,model:t.model||null,modelRedirects:t.modelRedirects||[],speedTestModel:t.speedTestModel||null,presetId:t.presetId||null,providerKey:t.providerKey||"",websiteUrl:t.websiteUrl||"",allowedModels:t.allowedModels||[],authMode:t.authMode||"api_key",authRef:t.authRef,authSource:t.authSource,authStatus:t.authStatus,oauthProviderId:t.oauthProviderId||"",balanceToken:t.balanceToken||"",balanceUserId:t.balanceUserId||null})).data}(e.name,e.baseUrl,o.apiKey,{wireApi:e.wireApi||"openai",providerKey:e.providerKey||"",maxConcurrency:uv(e.maxConcurrency),weight:pv(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||[],...wv(o),balanceToken:o.balanceToken,balanceUserId:o.balanceUserId})},update:async(e,o)=>{const n=xv(o);return await cf(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:uv(o.maxConcurrency),weight:pv(o.weight),enabled:o.enabled,modelRedirects:o.modelRedirects||[],speedTestModel:o.speedTestModel||null,presetId:o.presetId||null,allowedModels:o.allowedModels||[],...wv(n),balanceToken:n.balanceToken,balanceUserId:n.balanceUserId})},toggle:async(e,o)=>cf(e.id,{enabled:o}),remove:uf,resetHealth:async e=>async function(e){return(await _o.post(`/opencode/channels/${e}/reset-health`)).data}(e.id)},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:kv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:kv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}]}),omp:()=>({type:"omp",displayName:"OMP",schedulerSource:"omp",storageKeys:{localCollapse:"ompChannelCollapse",collapseConfigKey:"omp",orderConfigKey:"omp"},emptyDescription:"暂无 OMP 渠道",showEmptyAction:!0,emptyActionText:"添加 OMP 渠道",modalWidth:600,formLabelWidth:95,showApplyButton:!1,presets:Zm,presetCategories:Xm,getPresetById:Qm,formSections:[{title:"供应商预设",fields:[{key:"presetId",label:"选择预设",type:"preset",placeholder:"选择供应商预设"}]},{title:"基本信息",fields:[{...Pv(),showWhen:e=>Sv(e)&&!Tv(e)},{key:"name",label:"渠道名称",type:"text",required:!0,placeholder:"显示名称"},{key:"providerKey",showWhen:Av,label:"Provider Key",type:"text",required:!0,placeholder:"openai-official",validate:fv},{key:"baseUrl",showWhen:Av,label:e=>Sv(e)?"Auth Gateway URL":"Base URL",type:"text",required:!0,skipOnOAuth:!1,placeholder:"https://api.example.com/v1",validate:(e,o)=>hv(Sv(o)?"Auth Gateway URL":"Base URL",e,{required:!0})},{key:"apiKey",showWhen:Av,label:e=>Sv(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}不能为空`}(Sv(o)?"Gateway Token":"API Key",e)},{key:"routingGroup",showWhen:Av,label:"路由组",type:"text",placeholder:"相同路由组的兼容渠道可动态切换",description:"留空时按渠道 ID 隔离"},Mv(),Fv(),{key:"websiteUrl",showWhen:zv,label:"官网链接",type:"text",placeholder:"https://(选填)",validate:e=>hv("官网链接",e,{required:!1})},{key:"model",label:"默认模型",type:"select",placeholder:"选择或输入默认模型(留空则由 OMP 决定)",options:[],clearable:!0},{key:"speedTestModel",showWhen:zv,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:bv}]},{title:"模型重定向",description:"仅在 coding-tool-x 托管 OMP models.yml provider 启用时用于模型选择提示",collapsible:!0,fields:[{key:"modelRedirects",type:"model-redirect",fullWidth:!0}]},{title:"调度配置",fields:Hv.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:mv(e.models||[],[]),providerConfigJson:mv(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=Qm(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||""}:Bv(t,n)},fetchModelsForChannel:async(e,o,{forceRefresh:n=!1}={})=>{await tv(),o.modelsFetching=!0,o.modelsFetchError=null,o.modelsFetchErrorHint=null;const t=Lv("omp",o);if(e)try{const r=await async function(e,{forceRefresh:o=!1}={}){return(await _o.get(`/omp/channels/${e}/models`,{params:o?{forceRefresh:"true"}:{}})).data}(e,{forceRefresh:n}),a=Ev(r.models||[]);o.availableModels=Dv(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=ov(r?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=r.errorHint||"已使用 Models.dev 离线模型列表")}catch(r){o.availableModels=t,o.modelsFetchError=ov(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 async function(e,{forceRefresh:o=!1}={}){return(await _o.post("/omp/channels/probe-models",{...e,forceRefresh:o})).data}({baseUrl:o.baseUrl,apiKey:o.apiKey||"",gatewaySourceType:o.gatewaySourceType||"openai_compatible",authMode:o.authMode||"api_key",oauthProviderId:o.oauthProviderId||"",transport:o.transport||(Sv(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=Ev(e.models||[]);o.availableModels=Dv(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=ov(e?.error,"无法自动获取模型列表"),o.modelsFetchErrorHint=e.errorHint||(t.length?"已使用 Models.dev 离线模型列表":"请手动填写模型名称"))}catch(r){o.availableModels=t,o.modelsFetchError=ov(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 async function(e,o={},{forceRefresh:n=!1}={}){return(await _o.post("/omp/channels/catalog-metadata",{providerKey:e,forceRefresh:n,...o})).data}(o,{model:e.model||null,speedTestModel:e.speedTestModel||null,allowedModels:n,models:gv(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=gv(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=mv([...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:gf,api:{fetch:async()=>{const e=await async function(){return(await _o.get("/omp/channels")).data}();return{channels:cv(e),authProviderMeta:Array.isArray(e)?null:e.authProviderMeta||null}},syncCurrent:hf,create:async e=>{const o=Cv(e),n=yv(e.providerConfigJson);return await async function(e,o,n,t={}){const r=t.gatewaySourceType||"openai_compatible";let a=t.providerApi;return a||(a="claude"===r?"anthropic-messages":"gemini"===r?"google-generative-ai":"codex"===r?"responses":t.wireApi||"openai-completions"),(await _o.post("/omp/channels",{name:e,baseUrl:o,apiKey:n,wireApi:t.wireApi||"openai",providerApi:a,providerKey:t.providerKey||"",authMode:t.authMode||"api_key",authRef:t.authRef,authSource:t.authSource,authStatus:t.authStatus,oauthProviderId:t.oauthProviderId||"",transport:t.transport||"",routingGroup:t.routingGroup||"",gatewaySourceType:r,enabled:!1!==t.enabled,model:t.model||null,allowedModels:t.allowedModels||[],speedTestModel:t.speedTestModel||null,presetId:t.presetId||null,websiteUrl:t.websiteUrl||"",balanceToken:t.balanceToken||"",balanceUserId:t.balanceUserId||null,models:Array.isArray(t.models)?t.models:[],modelMetadataMode:t.modelMetadataMode||"auto",modelBindings:Array.isArray(t.modelBindings)?t.modelBindings:[],providerConfig:t.providerConfig||{}})).data}(e.name,e.baseUrl,o.apiKey,{wireApi:e.wireApi||"openai",providerApi:e.providerApi||"openai-completions",providerKey:e.providerKey,...wv(o),routingGroup:e.routingGroup||"",maxConcurrency:uv(e.maxConcurrency),weight:pv(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:gv(e.modelDefinitionsJson),modelMetadataMode:"hybrid",providerConfig:Object.prototype.hasOwnProperty.call(o,"transport")?{...n,transport:o.transport}:n})},update:async(e,o)=>{const n=Cv(o),t=yv(o.providerConfigJson);return await ff(e.id,{name:o.name,providerKey:o.providerKey,baseUrl:o.baseUrl,apiKey:n.apiKey,wireApi:o.wireApi||"openai",providerApi:o.providerApi||"openai-completions",...wv(n),routingGroup:o.routingGroup||"",websiteUrl:o.websiteUrl,model:o.model||null,gatewaySourceType:o.gatewaySourceType||"openai_compatible",maxConcurrency:uv(o.maxConcurrency),weight:pv(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:gv(o.modelDefinitionsJson),modelMetadataMode:"hybrid",providerConfig:Object.prototype.hasOwnProperty.call(n,"transport")?{...t,transport:n.transport}:t})},toggle:async(e,o)=>ff(e.id,{enabled:o}),remove:mf,resetHealth:async e=>async function(e){return(await _o.post(`/omp/channels/${e}/reset-health`)).data}(e.id)},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:Ov(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:kv(e)?"本地 OAuth":e.baseUrl},{label:"Key",value:kv(e)?"本地凭据":o.maskApiKey(e.apiKey),mono:!0,action:"healthy"!==e.health?.status?()=>o.handleResetHealth(e):null,actionLabel:"重置状态"}),t}})},Uv=[1500,3e3,5e3,8e3];function Wv(e){try{const o=localStorage.getItem(e);if(o)return JSON.parse(o)}catch(o){}return{}}function Nv(e,o){try{localStorage.setItem(e,JSON.stringify(o))}catch(n){}}function Kv(e,o){return ov(e,o||"操作失败")}function Vv(){return"undefined"==typeof document||"hidden"!==document.visibilityState}function qv(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Gv(e){const o=$h();let n=null,t=null,r=null,a=null,l=null,i=null,s=null,d=null,c=null,u=0;const p=no({channels:[],channelMeta:null,balances:{},loading:!1,balanceLoading:!1,balanceError:null,syncing:!1,toggling:{},collapsed:Wv(e.storageKeys.localCollapse),showDialog:!1,editingChannel:null,showChannelBalance:!1,formData:e.getInitialForm()}),h=no({});function f(e,{fallback:o=null,allowInsert:n=!1}={}){const t=function(e){return qv(e?.channel)&&e.channel.id?e.channel:qv(e)&&e.id?e:null}(e)||o;if(!t?.id)return!1;const r=p.channels.findIndex(e=>e.id===t.id);if(-1===r){if(!n)return!1;p.channels=[...p.channels,t]}else p.channels[r]={...p.channels[r],...t};return R(),m(),P(),!0}function m(){const n=o.getSchedulerState(e.schedulerSource);n?.channels?.length&&p.channels.length&&(p.channels.forEach(e=>{const o=n.channels.find(o=>o.id===e.id);o?.health&&(e.health=o.health)}),P())}const v=Xe(()=>o.getSchedulerState(e.schedulerSource)?.channels,m);function g(){const n=function(){if("function"!=typeof o.getChannels)return[];const n=o.getChannels(e.type);return Array.isArray(n?.value)?n.value:[]}();n.length&&!p.channels.length&&(p.channels=[...n],R(),m(),P())}function b(){d&&(clearTimeout(d),d=null)}function y(e){if(b(),!function(e){return Boolean(e?.refreshing||e?.authProvider?.refreshing)}(e))return void(u=0);if(u>=Uv.length)return;const o=Uv[u];u+=1,d=setTimeout(()=>{d=null,x({silent:!0,skipBalance:!0}).catch(()=>{})},o)}async function x(o={}){return c||(c=async function({silent:o=!1,skipBalance:n=!1}={}){o||(u=0);g(),p.loading=!o&&0===p.channels.length;try{const o=function(e){if(Array.isArray(e))return{channels:e,meta:null};if(!qv(e))return{channels:[],meta:null};const o=qv(e.authProviderMeta)?e.authProviderMeta:null,n=qv(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());p.channels=[...o.channels],p.channelMeta=o.meta,await R(),m(),P(),y(p.channelMeta),n||k()}catch(t){0===p.channels.length&&oh.error(Kv(t,`${e.displayName} 渠道加载失败`))}finally{p.loading=!1}}(o).finally(()=>{c=null}),c)}async function C(){return i||(p.balanceLoading=!0,p.balanceError=null,i=(async()=>{try{if(!0!==(await z())?.channelBalance?.showRemaining)return p.showChannelBalance=!1,p.formData._showChannelBalance=!1,p.balances={},null;p.showChannelBalance=!0,p.formData._showChannelBalance=!0;const o=await async function(e){return(await _o.get("/channel-balances",{params:{source:e}})).data}(e.type);return p.balances=o?.enabled&&o.balances?o.balances:{},o?.refreshing&&(a&&clearTimeout(a),a=setTimeout(()=>{a=null,Vv()&&C().catch(()=>{})},1200)),o}catch(o){return p.balanceError=Kv(o,`${e.displayName} 余额加载失败`),null}finally{p.balanceLoading=!1,i=null,S()}})(),i)}function w(){t&&(clearTimeout(t),t=null),null!==l&&"undefined"!=typeof window&&"function"==typeof window.cancelIdleCallback&&window.cancelIdleCallback(l),l=null,a&&(clearTimeout(a),a=null),r&&(clearTimeout(r),r=null)}function S(){r&&(clearTimeout(r),r=null),p.showChannelBalance&&Vv()&&(r=setTimeout(()=>{r=null,Vv()&&async function(){const o=p.channels.filter(e=>!1!==e?.enabled&&"oauth"===e?.authMode&&e.id);await Promise.all(o.map(async o=>{try{const n=await Xh(e.type,o.id);n?.enabled&&n.balance&&(p.balances[o.id]=n.balance)}catch{}}))}().finally(S)},6e4))}function k(){if(w(),!Vv())return;const e=()=>{t&&clearTimeout(t),l=null,t=null,C()};t=setTimeout(()=>{"undefined"==typeof window||"function"!=typeof window.requestIdleCallback?e():l=window.requestIdleCallback(e,{timeout:1500})},5e3)}function I(){n&&(clearTimeout(n),n=null)}function P(){I();const e=p.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,x()},o+250)}let T=null,A=0;async function z(){return T&&Date.now()-A<6e4?T:s||(s=(async()=>{try{const e=await Ho();if(e.success&&e.config)return T=e.config,A=Date.now(),T}catch(e){}finally{s=null}return null})(),s)}async function R(){try{if(p.channels.length>0){const e=[...p.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=>{p.collapsed[e.id]=!0}),p.channels=[...o,...n]}}catch(e){}}async function M(){try{await Vo("channelCollapse",e.storageKeys.collapseConfigKey,p.collapsed)}catch(o){}}function F(){p.showDialog=!1,p.editingChannel=null,p.formData=e.getInitialForm()}function O(){Object.keys(h).forEach(e=>{delete h[e]})}function $(){let o=!0;const n=e=>{const o=e.key.replace(/\./g,"_");delete h[e.key],delete h[o]};return e.formSections.forEach(e=>{const t=(e=>!e.showWhen||e.showWhen(p.formData))(e);e.fields.forEach(e=>{if(!t||!(e=>!e.showWhen||e.showWhen(p.formData))(e)||"oauth"===p.formData.authMode&&["baseUrl","apiKey","providerApi","gatewaySourceType"].includes(e.key)&&!1!==e.skipOnOAuth)return void n(e);if(e.disabledOnEdit&&p.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})(p.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(p.formData):e.label)(e)}不能为空`:""),a||"function"!=typeof e.validate||(a=e.validate(r,p.formData)||""),a?(h[e.key]={status:"error",message:a},o=!1):n(e)})}),o}function B(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 E(){T=null,A=0,s=null,await C(),p.formData._showChannelBalance=p.showChannelBalance}function D(){Vv()&&k()}return"undefined"!=typeof window&&window.addEventListener("channel-balance-visibility-change",E),"undefined"!=typeof document&&document.addEventListener("visibilitychange",D),g(),x().catch(()=>{}),async function(){try{const o=await z();if(o){const n=o.channelCollapse?.[e.storageKeys.collapseConfigKey]||{};p.collapsed=n,Nv(e.storageKeys.localCollapse,n)}}catch(o){}}().catch(()=>{}),De(()=>{I(),w(),b(),v(),"undefined"!=typeof window&&window.removeEventListener("channel-balance-visibility-change",E),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",D)}),{state:p,validation:h,actions:{loadChannels:x,loadChannelBalances:C,openAddDialog:function(){p.editingChannel=null,p.formData={authMode:"api_key",authRef:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:""},...e.getInitialForm()||{}},p.formData._showChannelBalance=p.showChannelBalance,O(),p.showDialog=!0},closeDialog:F,toggleCollapse:function(o){p.collapsed[o]=!p.collapsed[o],Nv(e.storageKeys.localCollapse,p.collapsed),M()},handleEdit:function(o){p.editingChannel=o,p.formData={authMode:o.authMode||"api_key",authRef:{credentialId:"",providerId:"",accountId:"",identityKey:"",accountEmail:"",...o.authRef||{}},...e.mapChannelToForm(o)||{}},p.formData._showChannelBalance=p.showChannelBalance,O(),p.showDialog=!0},handleSave:async function(){if(!$()){const e=Object.values(h).map(e=>e?.message).filter(Boolean);return void oh.error(e.length>0?`请检查表单:${e.join(";")}`:"请检查表单填写是否完整")}try{const o=Boolean(p.editingChannel),n=f(o?await e.api.update(p.editingChannel,p.formData):await e.api.create(p.formData),{allowInsert:!o});oh.success(`${e.displayName} 渠道已${o?"更新":"添加"}`),F(),n||await x()}catch(o){oh.error(Kv(o))}},handleDelete:function(o){nh.warning({title:`删除 ${e.displayName} 渠道`,content:"确定要删除这个渠道吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{await e.api.remove(o),p.channels=p.channels.filter(e=>e.id!==o),delete p.collapsed[o],Nv(e.storageKeys.localCollapse,p.collapsed),oh.success(`${e.displayName} 渠道已删除`)}catch(n){oh.error(Kv(n))}}})},handleToggleEnabled:async function(o,n){if(o&&!p.toggling[o.id]){p.toggling[o.id]=!0;try{const t="boolean"==typeof n?n:!1===o.enabled,r=await e.api.toggle(o,t);oh.success(`${e.displayName} 渠道已${t?"启用":"禁用"}`),t?(delete p.collapsed[o.id],Nv(e.storageKeys.localCollapse,p.collapsed),M()):(p.collapsed[o.id]=!0,Nv(e.storageKeys.localCollapse,p.collapsed),M()),f(r,{fallback:{...o,enabled:t}})||await x(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}))}catch(t){oh.error(Kv(t))}finally{p.toggling[o.id]=!1}}},handleSyncCurrentChannels:async function(){if("function"!=typeof e.api.syncCurrent)return oh.warning(`${e.displayName} 暂不支持同步`),null;if(p.syncing)return null;p.syncing=!0;try{const o=await e.api.syncCurrent();await x(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}));const n=Array.isArray(o?.warnings)?o.warnings.filter(Boolean):[];n.length>0&&oh.warning(n.join(";"));const t=Number(o?.added||0),r=Number(o?.updated||0);return t>0||r>0?oh.success(B(o)):oh.info(B(o)),o}catch(o){return oh.error(Kv(o,`${e.displayName} 同步失败`)),null}finally{p.syncing=!1}},handleApplyToSettings:function(o){"function"==typeof e.api.applyToSettings&&nh.warning({title:"写入配置",content:"写入配置后会关闭动态切换并默认使用该渠道,是否继续?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{try{const n=await e.api.applyToSettings(o);oh.success("已将渠道写入配置文件"),f(n)||!1===n?.success||await x(),window.dispatchEvent(new CustomEvent("channel-management-refresh",{detail:{channel:e.type}}))}catch(n){oh.error(Kv(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,m(),P()):await x(),oh.success("渠道健康状态已重置")}catch(n){oh.error(Kv(n))}},handleRefreshBalance:async function(o){if(o?.id)try{const n=await Xh(e.type,o.id);n?.enabled&&n.balance&&(p.balances[o.id]=n.balance,p.balanceError=null)}catch(n){p.balanceError=Kv(n,`${o.name||e.displayName} 余额刷新失败`)}}}}}var Jv=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 Yv(){return{name:"",baseUrl:"",websiteUrl:"",apiKey:"",authMode:"api_key",maxConcurrency:null,weight:1,enabled:!0}}var Zv={key:0,class:"loading-container"},Xv={key:1},Qv={key:0,class:"empty-state"},eg={key:1,class:"channels-list"},og={class:"section-title"},ng={key:0,class:"section-desc"},tg={key:0,class:"model-catalog-control"},rg={key:3,class:"auth-provider-status"},ag={key:9,class:"model-definitions-editor"},lg={class:"model-definitions-toolbar"},ig={class:"model-catalog-status",role:"status","aria-live":"polite"},sg={class:"dialog-footer"},dg={__name:"BaseChannelPanel",props:{type:{type:String,required:!0}},emits:["open-website"],setup(e,{expose:o,emit:n}){const t=e,r=n,a=Ko().get(t.type)||{key:t.type,label:t.type,capabilities:{channels:!0}},l=(jv[t.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:Jv.endpoint},{title:"认证",fields:Jv.auth},{title:"调度配置",fields:Jv.schedule}],api:o,getInitialForm:Yv,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}}(a,{fetch:()=>Dh(t.type),create:e=>_h(t.type,e),update:(e,o)=>Lh(t.type,e.id,o),remove:e=>Hh(t.type,e),toggle:(e,o)=>Lh(t.type,e.id,{...e,enabled:o})})))(),{state:i,validation:s,actions:d}=Gv(l),{getChannelInflight:c}=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.schedulerSource);function u(e){return"function"==typeof e.label?e.label(i.formData):e.label}function p(e){return Array.isArray(e)?e.map(p):e&&"object"==typeof e?Object.keys(e).sort().reduce((o,n)=>(o[n]=p(e[n]),o),{}):null==e?"":String(e)}function h(){const e=i.formData||{},o=String(e.apiKey||"");return JSON.stringify(p({channelId:i.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 f({clearOptions:e=!1}={}){i.formData.modelsFetching=!1,i.formData._modelsLoadedOnce=!1,i.formData._modelsFetchSignature=null,i.formData.modelsFetchError=null,i.formData.modelsFetchErrorHint=null,i.formData.modelsFetchMeta=null,e&&(i.formData.availableModels=[])}async function m(){if(!l.fetchModelsForChannel||i.formData.modelsFetching)return;const e=h();(i.formData.availableModels||[]).length>0&&i.formData._modelsLoadedOnce&&i.formData._modelsFetchSignature===e||await S({signature:e})}const v=to(()=>i.formData.modelsFetching?"正在加载模型":i.formData.modelsFetchError?"重试加载模型":(i.formData.availableModels||[]).length>0?"刷新可选模型":"加载可选模型"),g=to(()=>{if(i.formData.modelsFetching)return"正在读取模型列表,仍可继续填写表单。";if(i.formData.modelsFetchError){const e=i.formData.modelsFetchErrorHint,o=i.formData.modelsFetchMeta?.stale&&i.formData.modelsFetchMeta?.retryAfter?`当前使用缓存目录,${new Date(i.formData.modelsFetchMeta.retryAfter).toLocaleString()} 后可自动重试,也可手动刷新。`:"";return`${e?`模型列表未能更新:${i.formData.modelsFetchError}。${e}`:`模型列表未能更新:${i.formData.modelsFetchError}。可重试或手动填写模型名称。`}${o?` ${o}`:""}`}const e=i.formData.modelsFetchMeta;if(e?.stale&&e?.retryAfter)return`正在使用缓存的模型目录;${new Date(e.retryAfter).toLocaleString()} 后可自动重试,也可手动刷新。`;if(e?.stale)return"正在使用已过期的模型目录;可点击“刷新可选模型”更新。";if(e?.cached)return"已从本地缓存加载可选模型。";const o=(i.formData.availableModels||[]).length;return o>0?`已加载 ${o} 个可选模型。`:"可手动填写模型名称,或加载该渠道的可选模型。"});function b(e){return e.fields?.some(e=>(!e.showWhen||e.showWhen(i.formData))&&function(e){return!!["model-redirect","model-multi-select","autocomplete"].includes(e.type)||"select"===e.type&&["model","speedTestModel"].includes(e.key)}(e))&&Boolean(l.fetchModelsForChannel)}async function y(){if(!l.fetchModelsForChannel||i.formData.modelsFetching)return;const e=h();await S({forceRefresh:i.formData._modelsLoadedOnce&&i.formData._modelsFetchSignature===e,signature:e})}async function x(){if("function"==typeof l.fetchModelMetadataForChannel&&!i.formData.modelMetadataFetching){i.formData.modelMetadataFetching=!0,i.formData.modelMetadataStatus="正在读取 OMP metadata…";try{await l.fetchModelMetadataForChannel(i.formData)}catch(e){i.formData.modelMetadataStatus=e?.response?.data?.error||e?.message||"读取 OMP metadata 失败"}finally{i.formData.modelMetadataFetching=!1}}}const C=to(()=>{if(!l.presets)return[];const e={};return l.presets.forEach(o=>{const n=o.category||"custom";e[n]||(e[n]={type:"group",label:l.presetCategories?.[n]||n,key:n,children:[]}),e[n].children.push({label:o.name,value:o.id})}),Object.values(e)});function w(e){if(l.onPresetChange){const o=l.onPresetChange(e,i.formData);Object.assign(i.formData,o)}else i.formData.presetId=e;f({clearOptions:!0})}async function S({forceRefresh:e=!1,signature:o=h()}={}){if(l.fetchModelsForChannel){i.formData.modelsFetching=!0,i.formData.modelsFetchError=null,i.formData.modelsFetchErrorHint=null,i.formData.modelsFetchMeta=null;try{await l.fetchModelsForChannel(i.editingChannel?.id||null,i.formData,{forceRefresh:e})}catch(n){h()===o&&(i.formData.modelsFetchError=ov(n,"获取模型列表失败"),i.formData.modelsFetchErrorHint="可重试,或先手动填写模型名称")}finally{h()===o&&(i.formData.modelsFetching=!1)}if(h()!==o)return void f({clearOptions:!0});i.formData._modelsLoadedOnce=!0,i.formData._modelsFetchSignature=o}}function k(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 I(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 P(e){const o=i.formData.availableModels||[];if(!e||!o.length)return o;const n=e.toLowerCase();return o.filter(e=>(e.label||e.value||"").toLowerCase().includes(n))}function T(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(i.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 A(e){const o=e.replace(/\./g,"_");return s[o]?.status||s[e]?.status}function z(e){const o=e.replace(/\./g,"_");return s[o]?.message||s[e]?.message}function R(e){if("function"!=typeof e.getStatus)return{tags:[],message:""};const o=e.getStatus(i.formData)||{};return{tags:Array.isArray(o.tags)?o.tags:[],message:o.message||"",warning:!0===o.warning}}const M={getChannelInflight:c,getChannelBalance:e=>i.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=>d.handleResetHealth(e),handleRefreshBalance:e=>d.handleRefreshBalance(e),handleOpenWebsite:e=>r("open-website",e)};function F(e){const o=c(e.id),n=e.maxConcurrency?`${o}/${e.maxConcurrency}`:o>0?o:"不限";return{weight:e.weight||1,concurrencyText:n,concurrencyActive:o>0}}function O(e){switch(e.type){case"password":case"text":case"textarea":default:return $l;case"number":return Ip;case"switch":return Np;case"radio-group":return ps}}function $(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&&i.editingChannel&&(o.disabled=!0),o}return o({openAddDialog:d.openAddDialog,syncCurrentChannels:d.handleSyncCurrentChannels,refresh:d.loadChannels}),(o,n)=>(Ye(),Ro("div",null,[yo(i).loading?(Ye(),Ro("div",Zv,[Ne(yo(Lp),{size:"small"})])):(Ye(),Ro("div",Xv,[0===yo(i).channels.length?(Ye(),Ro("div",Qv,[Ne(yo(Za),{description:yo(l).emptyDescription},Ge({_:2},[yo(l).showEmptyAction?{name:"extra",fn:io(()=>[Ne(yo(me),{type:"primary",size:"small",onClick:yo(d).openAddDialog},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(Xo))]),_:1})]),default:io(()=>[$e(" "+eo(yo(l).emptyActionText),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1032,["description"])])):(Ye(),Ro("div",eg,[(Ye(!0),Ro(co,null,He(yo(i).channels,e=>(Ye(),qe(pm,{key:e.id,channel:e,collapsed:yo(i).collapsed[e.id],"header-tags":yo(l).getHeaderTags(e,M),balance:M.getChannelBalance(e),"info-rows":yo(l).buildInfoRows(e,M),meta:F(e),"show-apply-button":yo(l).showApplyButton,"channel-type":yo(l).type,"test-fn":yo(l).testFn,"auth-check-fn":e=>yo(Gh)(yo(l).type,e),toggling:!!yo(i).toggling[e.id],onToggleCollapse:o=>yo(d).toggleCollapse(e.id),onApply:o=>yo(d).handleApplyToSettings(e),onEdit:o=>yo(d).handleEdit(e),onDelete:o=>yo(d).handleDelete(e.id),onToggleEnabled:o=>yo(d).handleToggleEnabled(e,o),onRefreshBalance:o=>yo(d).handleRefreshBalance(e),onOpenWebsite:n[0]||(n[0]=e=>r("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))]))])),Ne(yo(Tt),{show:yo(i).showDialog,"onUpdate:show":n[7]||(n[7]=e=>yo(i).showDialog=e),preset:"card",title:yo(i).editingChannel?yo(l).editTitle:yo(l).addTitle,class:"channel-dialog",style:uo({width:yo(l).modalWidth+"px",maxHeight:"80vh"}),"content-style":{maxHeight:"calc(80vh - 100px)",overflowY:"auto"}},{footer:io(()=>[Mo("div",sg,[Ne(yo(me),{onClick:yo(d).closeDialog},{default:io(()=>[...n[9]||(n[9]=[$e("取消",-1)])]),_:1},8,["onClick"]),Ne(yo(me),{type:"primary",onClick:yo(d).handleSave},{default:io(()=>[$e(eo(yo(i).editingChannel?"保存修改":"添加渠道"),1)]),_:1},8,["onClick"])])]),default:io(()=>[Ne(yo(Ou),{"label-placement":"left","label-width":yo(l).formLabelWidth,class:"channel-form"},{default:io(()=>[(Ye(!0),Ro(co,null,He(yo(l).formSections,o=>(Ye(),Ro(co,{key:o.title},[!o.showWhen||o.showWhen(yo(i).formData)?(Ye(),Ro("div",{key:0,class:ho(["form-section",{collapsible:o.collapsible}])},[Mo("div",og,[$e(eo(o.title)+" ",1),o.description?(Ye(),Ro("span",ng,eo(o.description),1)):Oe("",!0)]),b(o)?(Ye(),Ro("div",tg,[Ne(yo(me),{text:"",type:"primary",size:"tiny",loading:yo(i).formData.modelsFetching,onClick:y},{default:io(()=>[$e(eo(v.value),1)]),_:1},8,["loading"]),Mo("span",{class:ho(["model-catalog-status",{"is-error":yo(i).formData.modelsFetchError,"is-loading":yo(i).formData.modelsFetching}]),role:"status","aria-live":"polite"},eo(g.value),3)])):Oe("",!0),(Ye(!0),Ro(co,null,He(o.fields,o=>zo((Ye(),qe(yo(up),{label:u(o),"label-style":o.fullWidth?{display:"none"}:void 0,required:o.required,"validation-status":A(o.key),feedback:z(o.key)},{default:io(()=>["channel-auth"===o.type?(Ye(),qe(_m,{key:0,platform:e.type,"channel-id":yo(i).editingChannel?.id||"","form-data":yo(i).formData,"auth-meta":yo(i).authMeta,onUpdateAuth:n[1]||(n[1]=e=>{yo(i).formData.authMode="oauth",yo(i).formData.authRef=e.authRef,yo(i).formData.authSource=e.authSource,yo(i).formData.authStatus=e.authStatus,yo(i).formData.oauthProviderId=e.oauthProviderId||e.authRef?.providerId||""})},null,8,["platform","channel-id","form-data","auth-meta"])):"preset"===o.type?(Ye(),qe(yo(Li),{key:1,value:yo(i).formData.presetId,options:C.value,placeholder:o.placeholder,"onUpdate:value":w},null,8,["value","options","placeholder"])):"model-redirect"===o.type?(Ye(),qe(Mm,{key:2,modelValue:yo(i).formData.modelRedirects,"onUpdate:modelValue":n[2]||(n[2]=e=>yo(i).formData.modelRedirects=e),"available-models":yo(i).formData.availableModels,"channel-type":yo(l).type,onFocusin:m},null,8,["modelValue","available-models","channel-type"])):"auth-provider-status"===o.type?(Ye(),Ro("div",rg,[R(o).tags.length>0?(Ye(),qe(yo(Wd),{key:0,size:"small",class:"auth-provider-tags"},{default:io(()=>[(Ye(!0),Ro(co,null,He(R(o).tags,e=>(Ye(),qe(yo(dl),{key:e.text,size:"small",type:e.type||"default",bordered:!1},{default:io(()=>[$e(eo(e.text),1)]),_:2},1032,["type"]))),128))]),_:2},1024)):Oe("",!0),R(o).message?(Ye(),Ro("div",{key:1,class:ho(["auth-provider-message",{warning:R(o).warning}])},eo(R(o).message),3)):Oe("",!0)])):"model-multi-select"===o.type?(Ye(),qe(yo(Li),{key:4,value:yo(i).formData.allowedModels,"onUpdate:value":n[3]||(n[3]=e=>yo(i).formData.allowedModels=e),options:yo(i).formData.availableModels||[],placeholder:o.placeholder,loading:yo(i).formData.modelsFetching,multiple:"",filterable:"",clearable:"",tag:"",onFocus:m},null,8,["value","options","placeholder","loading"])):"select"===o.type&&"speedTestModel"===o.key?(Ye(),qe(yo(Nl),{key:5,value:yo(i).formData.speedTestModel,options:T(yo(i).formData.speedTestModel,o.options),placeholder:o.placeholder,loading:yo(i).formData.modelsFetching,"get-show":()=>!0,clearable:"",onFocus:m,"onUpdate:value":n[4]||(n[4]=e=>yo(i).formData.speedTestModel=e)},null,8,["value","options","placeholder","loading"])):"select"===o.type&&"model"===o.key?(Ye(),qe(yo(Nl),{key:6,value:yo(i).formData.model,options:T(yo(i).formData.model,o.options),placeholder:o.placeholder,loading:yo(i).formData.modelsFetching,"get-show":()=>!0,clearable:"",onFocus:m,"onUpdate:value":n[5]||(n[5]=e=>yo(i).formData.model=e)},null,8,["value","options","placeholder","loading"])):"autocomplete"===o.type?(Ye(),qe(yo(Nl),{key:7,value:k(yo(i).formData,o.key),options:P(k(yo(i).formData,o.key)),placeholder:o.placeholder,loading:yo(i).formData.modelsFetching,"get-show":()=>!0,onFocus:m,"onUpdate:value":e=>I(yo(i).formData,o.key,e)},null,8,["value","options","placeholder","loading","onUpdate:value"])):"radio-group"===o.type?(Ye(),qe(yo(ps),{key:8,value:k(yo(i).formData,o.key),"onUpdate:value":e=>I(yo(i).formData,o.key,e)},{default:io(()=>[Ne(yo(Wd),null,{default:io(()=>[(Ye(!0),Ro(co,null,He(o.options,e=>(Ye(),qe(yo(cs),{key:e.value,value:e.value},{default:io(()=>[$e(eo(e.label),1)]),_:2},1032,["value"]))),128))]),_:2},1024)]),_:2},1032,["value","onUpdate:value"])):"model-definitions"===o.type?(Ye(),Ro("div",ag,[Mo("div",lg,[Ne(yo(me),{size:"tiny",secondary:"",loading:yo(i).formData.modelMetadataFetching,onClick:x},{default:io(()=>[...n[8]||(n[8]=[$e(" 自动获取 Metadata ",-1)])]),_:1},8,["loading"]),Mo("span",ig,eo(yo(i).formData.modelMetadataStatus||"Metadata 读取 Models.dev 离线快照;模型列表按钮才探测渠道,普通保存不会启动网络或 OMP 命令。"),1)]),Ne(yo($l),{value:yo(i).formData.modelDefinitionsJson,type:"textarea",autosize:{minRows:8,maxRows:20},placeholder:o.placeholder,"onUpdate:value":n[6]||(n[6]=e=>yo(i).formData.modelDefinitionsJson=e)},null,8,["value","placeholder"])])):(Ye(),qe(Ze(O(o)),Be({key:10,value:k(yo(i).formData,o.key)},{ref_for:!0},$(o),{"onUpdate:value":e=>I(yo(i).formData,o.key,e)}),null,16,["value","onUpdate:value"]))]),_:2},1032,["label","label-style","required","validation-status","feedback"])),[[so,!o.showWhen||o.showWhen(yo(i).formData)]])),256))],2)):Oe("",!0)],64))),128))]),_:1},8,["label-width"])]),_:1},8,["show","title","style"])]))}},cg=ge(dg,[["__scopeId","data-v-cb026422"]]),ug={__name:"ClaudeChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=To(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(cg,{ref_key:"baseRef",ref:r,type:"claude",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},pg={__name:"CodexChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=To(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(cg,{ref_key:"baseRef",ref:r,type:"codex",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},hg={__name:"GeminiChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=To(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(cg,{ref_key:"baseRef",ref:r,type:"gemini",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},fg={__name:"OpenCodeChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=To(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(cg,{ref_key:"baseRef",ref:r,type:"opencode",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},mg={__name:"OmpChannelPanel",emits:["open-website"],setup(e,{expose:o,emit:n}){const t=n,r=To(null);return o({openAddDialog:()=>r.value?.openAddDialog(),syncCurrentChannels:()=>r.value?.syncCurrentChannels(),refresh:()=>r.value?.refresh()}),(e,o)=>(Ye(),qe(cg,{ref_key:"baseRef",ref:r,type:"omp",onOpenWebsite:o[0]||(o[0]=e=>t("open-website",e))},null,512))}},vg={class:"proxy-logs"},gg={class:"logs-header"},bg={class:"header-left"},yg={class:"today-stats"},xg={class:"logs-table"},Cg={key:0,class:"empty-state"},wg={class:"action-message"},Sg={class:"action-time"},kg={class:"action-message"},Ig={class:"action-time"},Pg=["title"],Tg={key:0},Ag={style:{"font-family":"monospace","font-size":"12px"}},zg={key:0,style:{"margin-top":"4px"}},Rg={style:{"font-family":"monospace","font-size":"12px"}},Mg={key:1,style:{"margin-top":"6px",color:"#d97706","font-size":"12px"}},Fg={key:1},Og={class:"logs-footer"},$g={class:"count"},Bg=ge({__name:"ProxyLogs",props:{source:{type:String,default:"claude"}},setup(e){const o=e,{logsBySource:n,wsConnected:t,clearLogsState:r,logLimit:a}=_f(),l=to(()=>{const e=String(o.source||"").trim().toLowerCase();return(n.value[e]||[]).slice(0,a.value)});To(l.value.length);const i=To(null),s=To({requests:0,tokens:0});let d=null,c=null;function u(e,o){return e.usageMissing?"--":e.tokens?.[o]||0}async function p(){try{const e=(await bf(o.source))?.summary||{},n="object"==typeof e.tokens?e.tokens.total:e.tokens;s.value={requests:e.requests||0,tokens:n||0}}catch(e){}}async function h(){try{await async function(){return(await _o.post("/proxy/logs/clear")).data}(),r(),oh.success("日志已清空")}catch(e){oh.error("清空失败: "+e.message)}}return Xe(l,e=>{const o=e[0]?.id||null;o&&o!==c?(c=o,(!i.value||i.value.scrollTop<20)&&_e(()=>{i.value&&(i.value.scrollTop=0)})):c=o}),Xe(()=>o.source,()=>{p(),c=l.value[0]?.id||null}),Je(()=>{p(),d=setInterval(()=>{p()},3e4)}),De(()=>{d&&(clearInterval(d),d=null)}),(o,n)=>(Ye(),Ro("div",vg,[Mo("div",gg,[Mo("div",bg,[n[0]||(n[0]=Mo("h3",{class:"title"},"实时日志",-1)),Mo("div",yg,[Ne(yo(dl),{size:"tiny",bordered:!1,type:"info"},{default:io(()=>[$e(" 今日请求: "+eo(s.value.requests),1)]),_:1}),Ne(yo(dl),{size:"tiny",bordered:!1,type:"success"},{default:io(()=>{return[$e(" 今日Token: "+eo((e=s.value.tokens,e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toString())),1)];var e}),_:1})])]),Ne(yo(me),{text:"",size:"small",onClick:h},{default:io(()=>[Ne(yo(Q),{size:"16"},{default:io(()=>[Ne(yo(vn))]),_:1}),n[1]||(n[1]=$e(" 清空 ",-1))]),_:1})]),Mo("div",xg,[Mo("div",{class:ho(["table-header",`table-header-${e.source}`])},[Mo("div",{class:ho(["col col-channel",`col-channel-${e.source}`])},"渠道",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"请求",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"回复",2),"claude"===e.source?(Ye(),Ro(co,{key:0},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"写入",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"命中",2)],64)):"codex"===e.source?(Ye(),Ro(co,{key:1},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"推理",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"缓存",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):"gemini"===e.source?(Ye(),Ro(co,{key:2},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"缓存",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):"opencode"===e.source||"omp"===e.source?(Ye(),Ro(co,{key:3},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"推理",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"缓存",2),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},"总计",2)],64)):Oe("",!0),Mo("div",{class:ho(["col col-time",`col-time-${e.source}`])},"时间",2)],2),Mo("div",{class:"table-body",ref_key:"tableBody",ref:i},[0===l.value.length?(Ye(),Ro("div",Cg," 暂无日志 ")):Oe("",!0),(Ye(!0),Ro(co,null,He(l.value,o=>(Ye(),Ro("div",{key:o.id,class:ho(["action"===o.type?"action-row":"error"===o.status?"error-row":"table-row",{"new-log":o.isNew}])},["action"===o.type?(Ye(),Ro(co,{key:0},[Ne(yo(Q),{size:"16",style:{color:"#18a058","margin-right":"8px"}},{default:io(()=>[Ne(yo(ln))]),_:1}),Mo("span",wg,eo(o.message),1),Mo("span",Sg,eo(o.time),1)],64)):"error"===o.status?(Ye(),Ro(co,{key:1},[Ne(yo(Q),{size:"16",style:{color:"#d03050","margin-right":"8px"}},{default:io(()=>[Ne(yo(mn))]),_:1}),Mo("span",kg,eo(o.channel)+": "+eo(o.error||o.message||"请求失败"),1),Mo("span",Ig,eo(o.time),1)],64)):(Ye(),qe(yo(hs),{key:2,placement:"top",style:{maxWidth:"300px"}},{trigger:io(()=>[Mo("div",{class:ho(["table-row-content",`table-row-content-${e.source}`])},[Mo("div",{class:ho(["col col-channel",`col-channel-${e.source}`]),title:o.channel},[Ne(yo(dl),{size:"small",type:"success"},{default:io(()=>[$e(eo(o.channel),1)]),_:2},1024)],10,Pg),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"input")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"output")),3),"claude"===e.source?(Ye(),Ro(co,{key:0},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cacheCreation")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cacheRead")),3)],64)):"codex"===e.source?(Ye(),Ro(co,{key:1},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"reasoning")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cached")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"total")),3)],64)):"gemini"===e.source?(Ye(),Ro(co,{key:2},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cached")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"total")),3)],64)):"opencode"===e.source||"omp"===e.source?(Ye(),Ro(co,{key:3},[Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"reasoning")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"cached")),3),Mo("div",{class:ho(["col col-token",`col-token-${e.source}`])},eo(u(o,"total")),3)],64)):Oe("",!0),Mo("div",{class:ho(["col col-time",`col-time-${e.source}`])},eo(o.time),3)],2)]),default:io(()=>[o.model?(Ye(),Ro("div",Tg,[n[3]||(n[3]=Mo("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"模型信息",-1)),Mo("div",Ag,eo(o.model),1),o.originalModel&&o.originalModel!==o.model?(Ye(),Ro("div",zg,[n[2]||(n[2]=Mo("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"模型重定向",-1)),Mo("div",Rg,eo(o.originalModel)+" → "+eo(o.model),1)])):Oe("",!0),o.usageMissing?(Ye(),Ro("div",Mg," 上游响应未返回 usage,当前仅确认实际模型,无法计算 token。 ")):Oe("",!0)])):(Ye(),Ro("div",Fg,"暂无模型信息"))]),_:2},1024))],2))),128))],512)]),Mo("div",Og,[Mo("span",{class:ho(["status",{connected:yo(t)}])},[Ne(yo(Q),{size:"14"},{default:io(()=>[(Ye(),qe(Ze(yo(t)?yo(ln):yo(mn))))]),_:1}),$e(" "+eo(yo(t)?"已连接":"未连接"),1)],2),Mo("span",$g,"共 "+eo(l.value.length)+" 条",1)])]))}},[["__scopeId","data-v-b403c421"]]),Eg=new Map;function Dg(e={}){return{...e.platform?{platform:e.platform}:{},...e.cwd?{cwd:e.cwd}:{},...e.scope?{scope:e.scope}:{}}}async function _g(e="claude",o={}){const n=function(e,o={}){return wh("skills",e,o.scope||"user",o.cwd||"")}(e,o);if(Eg.has(n))return Eg.get(n);const t=Sh(n,t=>_o.get("/skills",{params:{platform:e,scope:o.scope||"user",...Dg(o)},signal:t}).then(e=>e.data).catch(e=>{throw Eg.delete(n),e}),"skills",`skills:${e}`);return Eg.set(n,t),t}async function Lg(e="claude",o={}){return function(e=""){for(const o of Eg.keys())e&&!o.includes(`:${e}:`)||Eg.delete(o)}(e),(await _o.post("/skills/refresh",{platform:e,scope:o.scope||"user",...o.cwd?{cwd:o.cwd}:{}})).data}async function Hg(e,o={}){return(await _o.get(`/skills/refresh/${encodeURIComponent(e)}`,{params:Dg(o)})).data}async function jg(e,o,n="claude",t={}){return(await _o.put("/skills/toggle",{controlKey:e,enabled:o,platform:n,scope:t.scope||"user",...t.cwd?{cwd:t.cwd}:{}})).data}async function Ug(e,o,n="claude",t={}){return(await _o.put("/skills/trust",{controlKey:e,trust:o,platform:n,scope:t.scope||"user",...t.cwd?{cwd:t.cwd}:{}})).data}async function Wg(){return(await _o.get("/skills/omp-settings")).data}async function Ng(e){return(await _o.put("/skills/omp-settings",e)).data}async function Kg(e,o="claude",n=null,t=null,r={}){const a={platform:o,...Dg(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 Sh(wh(`skill-detail:${e}:${t||""}`,o,r.scope||"",`${r.cwd||""}:${n?.localPath||n?.projectPath||""}`),o=>_o.get(`/skills/detail/${e}`,{params:a,signal:o}).then(e=>e.data),"skill-detail",`skill-detail:${o}`)}async function Vg(e,o="claude"){return(await _o.post("/skills/create",{...e,platform:o})).data}async function qg(e="claude"){return(await _o.get("/skills/repos",{params:{platform:e}})).data}async function Gg(e,o="claude"){return(await _o.post("/skills/repos",{...e,platform:o})).data}async function Jg(e,o="claude"){return(await _o.delete("/skills/repos",{params:{platform:o,id:e.id||"",owner:e.owner||"",name:e.name||"",directory:e.directory||""}})).data}async function Yg(e,o,n="claude"){return(await _o.put("/skills/repos/toggle",{id:e.id||"",owner:e.owner||"",name:e.name||"",enabled:o,directory:e.directory||"",platform:n})).data}async function Zg(e,o={},n="claude"){return(await _o.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 Xg(e,o="claude"){return(await _o.post("/skills/create-with-files",{...e,platform:o})).data}var Qg={class:"right-panel"},eb={class:"toolbar-section"},ob={class:"toolbar-left"},nb={class:"toolbar-right"},tb={class:"panel-header"},rb={class:"header-title"},ab={class:"header-actions"},lb={class:"channels-scroll-area"},ib={key:1,class:"channels-section channels-unsupported"},sb=ge({__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 n=Io(),t=e,r=o,a=to(()=>No(n)),{getPlatform:l}=Ht(),i=to(()=>l(a.value)),s=To(null),d=To(!1),c=To(0),u={claude:ug,codex:pg,gemini:hg,opencode:fg,omp:mg},p=to(()=>u[a.value]||cg),h=to(()=>u[a.value]?{}:{type:a.value});function f(e){return!0===i.value?.capabilities?.[e]||!0===i.value?.resourceTypes?.[e]}function m(e){return f(e)||!0===i.value?.resourceTypes?.[e]}to(()=>["skills","commands","agents","plugins"].some(m));const v=to(()=>m("skills")),g=to(()=>m("commands")),b=to(()=>m("plugins")),y=to(()=>m("agents")),x=to(()=>i.value?.proxyLabels?.toggle||"动态切换");async function C(){if(v.value)try{const e=await _g(a.value);e.success&&e.skills&&(c.value=e.skills.filter(e=>e.enabled).length)}catch(e){}else c.value=0}const w=to(()=>`${i.value?.label||i.value?.title||a.value} 渠道管理`);function S(e){window.open(e,"_blank")}function k(){s.value?.openAddDialog?.()}async function I(){const e=s.value;if(e?.syncCurrentChannels&&!d.value){d.value=!0;try{await e.syncCurrentChannels()}finally{d.value=!1}}}function P(e){const o=String(e?.detail?.channel||"").trim().toLowerCase();o&&o!==a.value||s.value?.refresh?.()}function T(e){r("proxy-toggle",e)}function A(){r("show-recent")}function z(e){e?.currentTarget?.blur?.()}function R(e){window.dispatchEvent(new CustomEvent("open-skills-drawer",{detail:{platform:a.value}})),z(e)}function M(e){window.dispatchEvent(new CustomEvent("open-commands-drawer",{detail:{platform:a.value}})),z(e)}function F(e){window.dispatchEvent(new CustomEvent("open-agents-drawer",{detail:{platform:a.value}})),z(e)}function O(e){window.dispatchEvent(new CustomEvent("open-plugins-drawer",{detail:{platform:a.value}})),z(e)}return Je(()=>{C(),"undefined"!=typeof window&&window.addEventListener("channel-management-refresh",P)}),Xe(()=>a.value,()=>{C()}),Xe(()=>t.proxyRunning,()=>{}),De(()=>{"undefined"!=typeof window&&window.removeEventListener("channel-management-refresh",P)}),(o,n)=>(Ye(),Ro("div",Qg,[Mo("div",eb,[Mo("div",ob,[Ne(yo(Vp),{depth:"3",class:"toolbar-label"},{default:io(()=>[$e(eo(x.value),1)]),_:1}),f("proxy")?(Ye(),qe(yo(Np),{key:0,value:e.proxyRunning,loading:e.proxyLoading,disabled:e.proxyLoading,size:"small","onUpdate:value":T},null,8,["value","loading","disabled"])):(Ye(),qe(yo(Vp),{key:1,depth:"3",class:"toolbar-label"},{default:io(()=>[...n[0]||(n[0]=[$e("当前平台暂无代理控制",-1)])]),_:1})),v.value&&c.value>0?(Ye(),qe(yo(dl),{key:2,type:"success",size:"small",bordered:!1},{default:io(()=>[$e(eo(c.value)+" 技能 ",1)]),_:1})):Oe("",!0)]),Mo("div",nb,[v.value?(Ye(),qe(yo(hs),{key:0,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:R},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(tn))]),_:1})]),_:1})]),default:io(()=>[n[1]||(n[1]=$e(" Skills 技能 ",-1))]),_:1})):Oe("",!0),y.value?(Ye(),qe(yo(hs),{key:1,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:F},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(Qo))]),_:1})]),_:1})]),default:io(()=>[n[2]||(n[2]=$e(" Agents 代理 ",-1))]),_:1})):Oe("",!0),b.value?(Ye(),qe(yo(hs),{key:2,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:O},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(yn))]),_:1})]),_:1})]),default:io(()=>[n[3]||(n[3]=$e(" Plugins 插件 ",-1))]),_:1})):Oe("",!0),g.value?(Ye(),qe(yo(hs),{key:3,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:M},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(un))]),_:1})]),_:1})]),default:io(()=>[n[4]||(n[4]=$e(" Commands 命令 ",-1))]),_:1})):Oe("",!0),f("sessions")?(Ye(),qe(yo(hs),{key:4,trigger:"hover"},{trigger:io(()=>[Ne(yo(me),{text:"",size:"small",class:"toolbar-btn",onClick:A},{icon:io(()=>[Ne(yo(Q),{size:18},{default:io(()=>[Ne(yo(Sn))]),_:1})]),_:1})]),default:io(()=>[n[5]||(n[5]=$e(" 最新对话 ",-1))]),_:1})):Oe("",!0)])]),e.showChannels&&f("channels")?(Ye(),Ro("div",{key:0,class:ho(["channels-section",{"full-height":!e.showLogs||!f("nativeLogs")}])},[Mo("div",tb,[Mo("div",rb,[Mo("h3",null,eo(w.value),1),Ne(yo(Vp),{depth:"3",class:"header-hint"},{default:io(()=>[...n[6]||(n[6]=[$e("启用渠道优先显示",-1)])]),_:1})]),Mo("div",ab,[Ne(yo(me),{secondary:"",size:"small",loading:d.value,disabled:d.value,onClick:I},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(an))]),_:1})]),default:io(()=>[n[7]||(n[7]=$e(" 同步 ",-1))]),_:1},8,["loading","disabled"]),Ne(yo(me),{type:"primary",size:"small",onClick:k},{icon:io(()=>[Ne(yo(Q),null,{default:io(()=>[Ne(yo(Xo))]),_:1})]),default:io(()=>[n[8]||(n[8]=$e(" 添加 ",-1))]),_:1})])]),Mo("div",lb,[(Ye(),qe(Ze(p.value),Be({ref_key:"currentPanelRef",ref:s},h.value,{onOpenWebsite:S}),null,16))])],2)):e.showChannels?(Ye(),Ro("div",ib,[Ne(yo(wl),{type:"info","show-icon":!1},{default:io(()=>[$e(eo(w.value)+" 未声明渠道管理能力。 ",1)]),_:1})])):Oe("",!0),e.showLogs&&f("nativeLogs")?(Ye(),Ro("div",{key:2,class:ho(["logs-section",{"full-height":!e.showChannels}])},[Ne(Bg,{source:a.value},null,8,["source"])],2)):Oe("",!0)]))}},[["__scopeId","data-v-71b20d97"]]),db={class:"layout"},cb={class:"panel-security-auth"},ub={class:"header"},pb={class:"logo-wrapper"},hb=["alt"],fb={class:"nav-tabs"},mb=["onClick"],vb={class:"nav-label"},gb={class:"header-actions"},bb={class:"env-warning-count"},yb={class:"favorites-button-wrapper"},xb={key:0,class:"favorites-badge"},Cb={class:"more-menu-trigger","aria-label":"更多工具"},wb={class:"main-container"},Sb={key:0,class:"global-loading-overlay"},kb={class:"left-content"},Ib="coding-tool-x",Pb={__name:"Layout",setup(e){const o=vo(()=>Ut(()=>import("./RecentSessionsDrawer-yOpScIwI.js").then(e=>e.n),__vite__mapDeps([9,1,2,6,10,11,12,13,5,3,7,14,15,16,17,18]))),n=vo(()=>Ut(()=>import("./FavoritesDrawer-A25XfI7C.js"),__vite__mapDeps([61,1,2,6,21,8,11,10,12,13,5,3,7,14,15,16,23,17,62]))),t=vo(()=>Ut(()=>import("./ChatHistoryDrawer-T4OVnJzM.js"),__vite__mapDeps([40,1,2,6,10,11,14,34,36,13,5,3,7,41]))),r=vo(()=>Ut(()=>import("./SettingsDrawer-DpZoDj3M.js"),__vite__mapDeps([63,1,2,5,3,4,6,7,8,21,11,45,10,12,64]))),a=vo(()=>Ut(()=>import("./McpDrawer-DIaiFq4R.js"),__vite__mapDeps([65,1,2,5,3,6,21,8,11,27,28,10,12,29,30,14,66]))),l=vo(()=>Ut(()=>import("./PromptsDrawer-BLeUYZWW.js"),__vite__mapDeps([67,1,2,5,3,6,10,11,12,35,34,36,37,68]))),i=vo(()=>Ut(()=>import("./GatewayConvertDrawer-TSJPvY4f.js"),__vite__mapDeps([69,1,2,3,6,10,11,12,70]))),s=vo(()=>Ut(()=>import("./SkillsDrawer-BgMlJbgS.js"),__vite__mapDeps([71,1,2,10,11,12,32,4,5,3,6,7,8,21,26,14,33,34,35,36,37,29,38,39,72]))),d=vo(()=>Ut(()=>import("./CommandsDrawer-DtFJRtow.js"),__vite__mapDeps([73,1,2,5,3,4,6,7,21,8,11,26,14,10,12,35,34,36,37,74]))),c=vo(()=>Ut(()=>import("./AgentsDrawer-MeGfH4I0.js"),__vite__mapDeps([75,1,2,5,3,4,6,7,21,8,11,26,14,10,12,35,34,36,37,76]))),u=vo(()=>Ut(()=>import("./PluginsDrawer-Bq1JkM5r.js"),__vite__mapDeps([77,1,2,10,11,12,56,5,3,4,6,7,8,21,26,14,34,38,57,78]))),p=vo(()=>Ut(()=>import("./WorkspaceDrawer-Bu5mOGsF.js"),__vite__mapDeps([79,1,2,44,6,8,21,11,45,14,46,5,3,47,10,12,80]))),h=vo(()=>Ut(()=>import("./ConfigTemplatesDrawer-bQvPnUQ0.js"),__vite__mapDeps([81,1,2,50,6,8,21,11,28,45,34,36,35,37,46,5,3,51,10,12,82]))),f=vo(()=>Ut(()=>import("./ConfigExportDrawer-Di7KXhVS.js"),__vite__mapDeps([83,1,2,5,3,6,33,8,21,11,45,10,12,84]))),{isDark:m,toggleTheme:v}=Df(),{getProxyState:g,startProxy:b,stopProxy:y}=_f(),{totalFavorites:x}=jf(),{dashboardData:C,isLoading:w,loadDashboard:S}=Uf(),k=fo(),I=Io(),P=[{label:"配置模板",key:"config-templates"},{label:"配置导入/导出",key:"config-export"},{type:"divider",key:"divider-1"},{label:"使用帮助",key:"help"},{label:"GitHub 仓库",key:"github"}],T=to(()=>I.name),A=to(()=>No(I)||null),{enabledPlatforms:z}=Ht(),R=to(()=>z.value.find(e=>e.key===A.value)||null),M=to(()=>!0===R.value?.capabilities?.nativeLogs),F=to(()=>Wo(z.value)),O=to(()=>I.path),$=To(!0),B=To(!0),E=to(()=>A.value&&($.value||B.value&&M.value)),D=To(!1),_=To(!1),L=To(!1),H=To(!1),j=To(!1),U=To(!1),W=To(!1),N=To(!1),K=To(!1),V=To(!1),q=To(!1),G=To(""),J=To(""),Y=To(!1),Z=To(""),X=To(!1),ee=To(""),oe=To(!1),ne=To(""),te=To(""),re=To(!1),ae=To(null),le=To(null),ie=To(null),se=no(new Set);function de(e){return se.has(e)}Xe([ie,ae,le,re],([e,o,,n])=>{e&&o&&n&&e.open()},{flush:"post"});const ce=To([]),ue=To(!1),pe=To(!1),he=To(!1),fe=To(""),ve=To(""),ge=To(!1),be=to(()=>pe.value&&!he.value);function ye(){fe.value="",ve.value="",ge.value=!1}async function xe(){if(fe.value){ge.value=!0,ve.value="";try{const e=await async function(e){return(await _o.post("/security/verify",{password:e})).data}(fe.value);e.success?(he.value=!0,ye()):ve.value=e.error||"密码错误"}catch(e){ve.value=e.response?.data?.error||"密码错误"}finally{ge.value=!1}}else ve.value="请输入密码"}async function Ce(){try{const e=await Xp();e.success&&(ce.value=e.conflicts||[],0===ce.value.length&&(ue.value=!1))}catch(e){}}function we(){ue.value=!1}function Se(){ue.value=!1,localStorage.setItem("envConflictNeverRemind","true")}const ke=To(!1),Ie=to(()=>Boolean(g(A.value)?.value?.running)),Pe=to(()=>Boolean(g(A.value)?.value?.loading));function Te(e,o){!function(e){se.add(e)}(e),o.value=!0}function Ae(){Te("recent",D)}function ze(){Te("favorites",_)}function Re(){Te("settings",L)}function Me(){Te("mcp",H)}function Fe(){Te("prompts",j)}function Be(){Te("workspace",N)}function Ee(e){"config-templates"!==e?"config-export"!==e?"help"!==e?"github"===e&&window.open("https://github.com/ZeaoZhang/coding-tool","_blank"):W.value=!0:Te("config-export",V):Te("config-templates",K)}async function _e(e){const o=A.value;if(!o)return;const n=function(e=A.value){return g(e)}(o);n.value.loading=!0;try{let n;n=e?await b(o):await y(o,{refreshChannelsDrawer:!0}),!1!==n.success?(oh.success("omp"===o?e?"OMP 动态切换已启用":"OMP 已切换为单渠道直连模式":e?"代理已启动":"代理已停止"),e&&(B.value=!0),async function(){try{await Vo("panelVisibility","showChannels",$.value),await Vo("panelVisibility","showLogs",B.value)}catch(e){}}()):oh.error(n.error||"操作失败")}catch(t){oh.error(t.response?.data?.error||t.message||"操作失败")}finally{n.value.loading=!1}}function je(e){const{showChannels:o,showLogs:n}=e.detail;$.value=o,B.value=n}function Ue(e){G.value=e?.detail?.platform||"",J.value=e?.detail?.cwd||e?.detail?.projectPath||"",Te("skills",q)}function We(e){Z.value=e?.detail?.platform||"",Te("commands",Y)}function Ke(e){ee.value=e?.detail?.platform||"",Te("agents",X)}function Ve(e){ne.value=e?.detail?.platform||"",te.value=e?.detail?.cwd||e?.detail?.projectPath||"",Te("plugins",oe)}function Ge(){"opencode"===A.value&&Te("gateway",U)}function Qe({session:e,channel:o}){ae.value=e,le.value=o,re.value=!0}return Je(()=>{!async function(){ke.value=!0;try{const e=await yh();pe.value=Boolean(e?.success&&e.hasPassword),he.value=!pe.value,pe.value||ye()}catch(e){pe.value=!1,he.value=!0,ye()}finally{ke.value=!1}}(),async function(){try{const e=await S();e&&e.uiConfig&&($.value=!1!==e.uiConfig.panelVisibility?.showChannels,B.value=!1!==e.uiConfig.panelVisibility?.showLogs)}catch(e){}}(),window.addEventListener("panel-visibility-change",je),window.addEventListener("open-skills-drawer",Ue),window.addEventListener("open-commands-drawer",We),window.addEventListener("open-agents-drawer",Ke),window.addEventListener("open-plugins-drawer",Ve),window.addEventListener("open-gateway-convert-drawer",Ge),async function(){try{const e=await Xp();e.success&&e.conflicts?.length>0&&(ce.value=e.conflicts,"true"!==localStorage.getItem("envConflictNeverRemind")&&(ue.value=!0))}catch(e){}}()}),De(()=>{window.removeEventListener("panel-visibility-change",je),window.removeEventListener("open-skills-drawer",Ue),window.removeEventListener("open-commands-drawer",We),window.removeEventListener("open-agents-drawer",Ke),window.removeEventListener("open-plugins-drawer",Ve),window.removeEventListener("open-gateway-convert-drawer",Ge)}),Xe(()=>A.value,e=>{"opencode"!==e&&U.value&&(U.value=!1)}),(e,g)=>{const b=Le("router-link"),y=Le("router-view");return Ye(),Ro("div",db,[Ne(bh,{visible:ue.value,"onUpdate:visible":g[0]||(g[0]=e=>ue.value=e),conflicts:ce.value,onDeleted:Ce,onClose:g[1]||(g[1]=e=>ue.value=!1),onIgnore:we,onNeverRemind:Se},null,8,["visible","conflicts"]),Ne(yo(Tt),{show:be.value,preset:"card",title:"验证访问密码","mask-closable":!1,"close-on-esc":!1,closable:!1,style:{width:"460px","max-width":"92vw"}},{default:io(()=>[Mo("div",cb,[Ne(yo(Vp),{depth:"3",style:{"font-size":"13px"}},{default:io(()=>[...g[21]||(g[21]=[$e(" 请输入访问密码后进入面板 ",-1)])]),_:1}),Ne(yo($l),{value:fe.value,"onUpdate:value":g[2]||(g[2]=e=>fe.value=e),type:"password",placeholder:"访问密码","show-password-on":"click",autofocus:"",onKeydown:So(xe,["enter"])},null,8,["value"]),ve.value?(Ye(),qe(yo(Vp),{key:0,depth:"3",class:"panel-security-error"},{default:io(()=>[$e(eo(ve.value),1)]),_:1})):Oe("",!0),Ne(yo(Vp),{depth:"3",class:"panel-security-hint"},{default:io(()=>[g[23]||(g[23]=$e(" 忘记密码可在终端执行 ",-1)),Ne(yo(Vp),{code:""},{default:io(()=>[...g[22]||(g[22]=[$e("ctx security reset",-1)])]),_:1}),g[24]||(g[24]=$e(" 关闭密码 ",-1))]),_:1}),Ne(yo(Wd),{justify:"end",style:{"margin-top":"16px"}},{default:io(()=>[Ne(yo(me),{type:"primary",loading:ge.value,onClick:xe},{default:io(()=>[...g[25]||(g[25]=[$e(" 验证 ",-1)])]),_:1},8,["loading"])]),_:1})])]),_:1},8,["show"]),Mo("header",ub,[Ne(b,{class:"logo-section",to:{name:"home"},"aria-label":"返回首页"},{default:io(()=>[Mo("div",pb,[Mo("img",{src:"/logo.png",alt:`${Ib} logo`,class:"logo-image"},null,8,hb)]),Mo("div",{class:"title-group"},[Mo("h1",{class:"title-main"},eo(Ib)),g[26]||(g[26]=Mo("span",{class:"title-sub"},"AI 编程工作台",-1))])]),_:1}),Mo("div",fb,[Mo("div",{class:ho(["nav-tab",{active:"home"===T.value}]),onClick:g[3]||(g[3]=e=>yo(k).push({name:"home"}))},[Ne(yo(Q),{size:18,class:"nav-icon"},{default:io(()=>[Ne(yo(qo))]),_:1}),g[27]||(g[27]=Mo("span",{class:"nav-label"},"Home",-1))],2),(Ye(!0),Ro(co,null,He(F.value,e=>(Ye(),Ro("div",{key:e.key,class:ho(["nav-tab",{active:A.value===e.key}]),onClick:o=>yo(k).push({name:"cli-projects",params:{platform:e.key}})},[Ne(yo(Q),{size:18,class:"nav-icon"},{default:io(()=>[(Ye(),qe(Ze(e.icon)))]),_:2},1024),Mo("span",vb,eo(e.label),1)],10,mb))),128)),Mo("div",{class:ho(["nav-tab",{active:"analytics"===T.value}]),onClick:g[4]||(g[4]=e=>yo(k).push({name:"analytics"}))},[Ne(yo(Q),{size:18,class:"nav-icon"},{default:io(()=>[Ne(yo(gn))]),_:1}),g[28]||(g[28]=Mo("span",{class:"nav-label"},"Analytics",-1))],2)]),Mo("div",gb,[ce.value.length>0?(Ye(),qe(yo(hs),{key:0,trigger:"hover"},{trigger:io(()=>[Mo("div",{class:"env-warning-btn",onClick:g[5]||(g[5]=e=>ue.value=!0)},[Ne(yo(Q),{size:18,class:"env-warning-icon"},{default:io(()=>[Ne(yo(bn))]),_:1}),Mo("span",bb,eo(ce.value.length),1)])]),default:io(()=>[$e(" 检测到 "+eo(ce.value.length)+" 个环境变量冲突,点击查看 ",1)]),_:1})):Oe("",!0),Ne(Zp,{icon:yo(m)?yo(hn):yo(on),tooltip:yo(m)?"切换到亮色主题":"切换到暗色主题",onClick:yo(v)},null,8,["icon","tooltip","onClick"]),g[29]||(g[29]=Mo("div",{class:"header-divider"},null,-1)),Mo("div",yb,[Ne(Zp,{icon:yo(Go),tooltip:`我的收藏 (${yo(x)})`,onClick:ze},null,8,["icon","tooltip"]),yo(x)>0?(Ye(),Ro("div",xb,eo(yo(x)),1)):Oe("",!0)]),Ne(Zp,{icon:yo(Jo),tooltip:"工作区管理",onClick:Be},null,8,["icon"]),Ne(Zp,{icon:yo(wn),tooltip:"Prompts 管理",onClick:Fe},null,8,["icon"]),Ne(Zp,{icon:yo(cn),tooltip:"MCP 服务器管理",onClick:Me},null,8,["icon"]),Ne(Zp,{icon:yo(pn),tooltip:"设置",onClick:Re},null,8,["icon"]),Ne(yo(zs),{trigger:"click",placement:"bottom-end",options:P,onSelect:Ee},{default:io(()=>[Mo("div",Cb,[Ne(Zp,{icon:yo(rn),tooltip:"更多工具"},null,8,["icon"])])]),_:1})])]),Mo("div",wb,[ke.value?(Ye(),Ro("div",Sb,[Ne(yo(Lp),{size:"large"},{description:io(()=>[...g[30]||(g[30]=[$e(" 加载配置中... ",-1)])]),_:1})])):Oe("",!0),Mo("div",kb,[Ne(y,null,{default:io(({Component:e})=>[(Ye(),qe(Ze(e),{key:O.value}))]),_:1})]),E.value?(Ye(),qe(sb,{key:1,"show-channels":$.value,"show-logs":B.value,"proxy-running":Ie.value,"proxy-loading":Pe.value,onProxyToggle:_e,onShowRecent:Ae},null,8,["show-channels","show-logs","proxy-running","proxy-loading"])):Oe("",!0)]),de("recent")?(Ye(),qe(yo(o),{key:0,visible:D.value,"onUpdate:visible":g[6]||(g[6]=e=>D.value=e),channel:A.value},null,8,["visible","channel"])):Oe("",!0),de("favorites")?(Ye(),qe(yo(n),{key:1,visible:_.value,"onUpdate:visible":g[7]||(g[7]=e=>_.value=e),onViewHistory:Qe},null,8,["visible"])):Oe("",!0),ae.value?(Ye(),qe(yo(t),{key:2,ref_key:"chatHistoryRef",ref:ie,show:re.value,"onUpdate:show":g[8]||(g[8]=e=>re.value=e),"project-name":ae.value.projectName,"session-id":ae.value.sessionId,"session-alias":ae.value.alias,channel:le.value},null,8,["show","project-name","session-id","session-alias","channel"])):Oe("",!0),de("settings")?(Ye(),qe(yo(r),{key:3,visible:L.value,"onUpdate:visible":g[9]||(g[9]=e=>L.value=e)},null,8,["visible"])):Oe("",!0),de("mcp")?(Ye(),qe(yo(a),{key:4,visible:H.value,"onUpdate:visible":g[10]||(g[10]=e=>H.value=e)},null,8,["visible"])):Oe("",!0),de("prompts")?(Ye(),qe(yo(l),{key:5,visible:j.value,"onUpdate:visible":g[11]||(g[11]=e=>j.value=e)},null,8,["visible"])):Oe("",!0),"opencode"===A.value&&de("gateway")?(Ye(),qe(yo(i),{key:6,visible:U.value,"onUpdate:visible":g[12]||(g[12]=e=>U.value=e)},null,8,["visible"])):Oe("",!0),de("workspace")?(Ye(),qe(yo(p),{key:7,visible:N.value,"onUpdate:visible":g[13]||(g[13]=e=>N.value=e)},null,8,["visible"])):Oe("",!0),de("config-templates")?(Ye(),qe(yo(h),{key:8,visible:K.value,"onUpdate:visible":g[14]||(g[14]=e=>K.value=e)},null,8,["visible"])):Oe("",!0),de("config-export")?(Ye(),qe(yo(f),{key:9,visible:V.value,"onUpdate:visible":g[15]||(g[15]=e=>V.value=e)},null,8,["visible"])):Oe("",!0),de("skills")?(Ye(),qe(yo(s),{key:10,visible:q.value,"onUpdate:visible":g[16]||(g[16]=e=>q.value=e),platform:G.value,"project-path":J.value},null,8,["visible","platform","project-path"])):Oe("",!0),de("commands")?(Ye(),qe(yo(d),{key:11,visible:Y.value,"onUpdate:visible":g[17]||(g[17]=e=>Y.value=e),platform:Z.value},null,8,["visible","platform"])):Oe("",!0),de("agents")?(Ye(),qe(yo(c),{key:12,visible:X.value,"onUpdate:visible":g[18]||(g[18]=e=>X.value=e),platform:ee.value},null,8,["visible","platform"])):Oe("",!0),de("plugins")?(Ye(),qe(yo(u),{key:13,visible:oe.value,"onUpdate:visible":g[19]||(g[19]=e=>oe.value=e),platform:ne.value,"project-path":te.value},null,8,["visible","platform","project-path"])):Oe("",!0),Ne(yo(Tt),{show:W.value,"onUpdate:show":g[20]||(g[20]=e=>W.value=e),preset:"card",title:`${Ib} 使用帮助`,style:{width:"800px","max-width":"90vw"}},{default:io(()=>[Mo("div",{class:"help-content"},[Mo("div",{class:"help-section"},[g[31]||(g[31]=Mo("h4",null,"[START] 快速开始",-1)),Mo("p",null,eo(Ib)+" 是面向 Claude Code、Codex、Gemini 和 OpenCode 的统一 AI 编程工作台,提供会话管理、动态渠道切换、全局搜索与实时监控能力。"),g[32]||(g[32]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"[STAR] 最简单的启动方式:",-1)),g[33]||(g[33]=Mo("div",{style:{background:"var(--bg-primary)",padding:"12px","border-radius":"6px",margin:"8px 0","border-left":"3px solid #18a058"}},[Mo("p",{style:{margin:"0","font-family":"'Courier New', monospace","font-size":"13px","font-weight":"600",color:"var(--primary-color)"}},"ctx start"),Mo("p",{style:{margin:"4px 0 0 0","font-size":"12px",color:"var(--text-secondary)"}},[$e("• 后台启动所有服务"),Mo("br"),$e("• 可以关闭终端窗口"),Mo("br"),$e("• 代理服务保持运行")])],-1)),g[34]||(g[34]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"[LOG] 日常工作流:",-1)),g[35]||(g[35]=Mo("div",{style:{"font-size":"12px","line-height":"1.8",color:"var(--text-secondary)"}},[Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx start"),$e(" 启动服务"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx status"),$e(" 查看状态"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx logs"),$e(" 查看日志"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px","border-radius":"3px",color:"var(--primary-color)"}},"ctx stop"),$e(" 停止服务 ")],-1))]),g[44]||(g[44]=Mo("div",{class:"help-section"},[Mo("h4",null,"[AI] 支持的 AI 工具"),Mo("ul",null,[Mo("li",null,[Mo("strong",null,"Claude Code"),$e(":Anthropic 官方命令行工具,支持 Claude 系列模型")]),Mo("li",null,[Mo("strong",null,"Codex"),$e(":支持 OpenAI GPT 系列和 Claude 模型(通过 OpenAI 兼容格式)")]),Mo("li",null,[Mo("strong",null,"Gemini"),$e(":支持 Google Gemini 系列模型")])])],-1)),g[45]||(g[45]=Mo("div",{class:"help-section"},[Mo("h4",null,"[LOG] 命令行用法"),Mo("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[START] 服务管理"),Mo("div",{class:"command-list"},[Mo("div",{class:"command-item"},[Mo("code",null,"ctx start"),Mo("span",null,"后台启动所有服务(推荐)")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx stop"),Mo("span",null,"停止所有服务")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx restart"),Mo("span",null,"重启所有服务")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx status"),Mo("span",null,"查看服务状态")])]),Mo("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[PROXY] 代理管理"),Mo("div",{class:"command-list"},[Mo("div",{class:"command-item"},[Mo("code",null,"ctx claude start"),Mo("span",null,"启动 Claude 代理")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx codex start"),Mo("span",null,"启动 Codex 代理")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx gemini start"),Mo("span",null,"启动 Gemini 代理")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx claude stop"),Mo("span",null,"停止指定代理(支持 stop/restart/status)")])]),Mo("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[LOG] 日志管理"),Mo("div",{class:"command-list"},[Mo("div",{class:"command-item"},[Mo("code",null,"ctx logs"),Mo("span",null,"查看所有日志")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx logs claude"),Mo("span",null,"查看 Claude 日志(支持 ui/codex/gemini)")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx logs --follow"),Mo("span",null,"实时跟踪日志")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx logs --clear"),Mo("span",null,"清空日志")])]),Mo("h5",{style:{margin:"16px 0 8px 0","font-size":"14px",color:"var(--primary-color)"}},"[STATS] 其他命令"),Mo("div",{class:"command-list"},[Mo("div",{class:"command-item"},[Mo("code",null,"ctx stats"),Mo("span",null,"查看统计信息")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx doctor"),Mo("span",null,"系统诊断")]),Mo("div",{class:"command-item"},[Mo("code",null,"ctx -h"),Mo("span",null,"完整帮助")])])],-1)),g[46]||(g[46]=Mo("div",{class:"help-section"},[Mo("h4",null,"[TARGET] Web UI 功能"),Mo("ul",null,[Mo("li",null,[Mo("strong",null,"多类型支持"),$e(":统一管理 Claude Code、Codex、Gemini 三种工具的项目和会话")]),Mo("li",null,[Mo("strong",null,"项目管理"),$e(":查看所有项目,支持拖拽排序、搜索过滤、删除项目")]),Mo("li",null,[Mo("strong",null,"会话管理"),$e(":查看项目会话列表,支持搜索、Fork、删除、重命名")]),Mo("li",null,[Mo("strong",null,"快速启动"),$e(":点击会话可直接复制对应 AI 工具启动命令")]),Mo("li",null,[Mo("strong",null,"动态切换"),$e(":每种工具独立的渠道管理,可在右侧面板快速切换 API 渠道")]),Mo("li",null,[Mo("strong",null,"实时日志"),$e(":查看各类型代理的实时请求日志、token 消耗和成本统计")]),Mo("li",null,[Mo("strong",null,"全局搜索"),$e(":使用 "),Mo("kbd",null,"Cmd/Ctrl"),$e(" + "),Mo("kbd",null,"K"),$e(" 在所有项目中搜索对话内容")])])],-1)),g[47]||(g[47]=Mo("div",{class:"help-section"},[Mo("h4",null,"[BOLT] 代理服务与渠道管理"),Mo("p",null,"每种 AI 工具都有独立的代理服务和渠道配置:"),Mo("ul",null,[Mo("li",null,[Mo("strong",null,"Claude 代理"),$e(":端口 20088,支持 Anthropic API 格式")]),Mo("li",null,[Mo("strong",null,"Codex 代理"),$e(":端口 20089,支持 OpenAI API 格式(兼容 Claude)")]),Mo("li",null,[Mo("strong",null,"Gemini 代理"),$e(":端口 20090,支持 Gemini API 格式")])]),Mo("p",null,"在 Dashboard 或各工具详情页,可以添加多个渠道并快速切换,无需修改配置文件或重启工具。")],-1)),Mo("div",{class:"help-section"},[g[36]||(g[36]=Mo("h4",null,"[STAR] 后台启动与开机自启",-1)),g[37]||(g[37]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"后台启动服务",-1)),g[38]||(g[38]=Mo("p",{style:{"font-size":"12px","line-height":"1.8"}},[$e("使用 "),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx start"),$e(" 命令后台启动所有服务,可以安全关闭终端窗口而不影响代理服务的运行。")],-1)),g[39]||(g[39]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"配置开机自启(可选)",-1)),g[40]||(g[40]=Mo("p",{style:{"font-size":"12px",color:"var(--text-secondary)",margin:"0 0 8px 0"}},"第一次启用开机自启只需三个步骤:",-1)),g[41]||(g[41]=Mo("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)"}},[$e(" # 第 1 步:启用 PM2 开机自启"),Mo("br"),Mo("span",{style:{color:"var(--primary-color)"}},"pm2 startup"),Mo("br"),Mo("br"),$e(" # 第 2 步:保存配置"),Mo("br"),Mo("span",{style:{color:"var(--primary-color)"}},"pm2 save"),Mo("br"),Mo("br"),$e(" # 第 3 步:重启电脑,服务自动启动 [v] ")],-1)),g[42]||(g[42]=Mo("h5",{style:{margin:"12px 0 8px 0","font-size":"13px",color:"#18a058"}},"相关命令",-1)),g[43]||(g[43]=Mo("div",{style:{"font-size":"12px",color:"var(--text-secondary)","line-height":"1.8"}},[Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx start"),$e(" 后台启动"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx status"),$e(" 查看状态"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"ctx logs"),$e(" 查看日志"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"pm2 list"),$e(" 查看所有后台进程"),Mo("br"),Mo("code",{style:{background:"var(--bg-primary)",padding:"2px 6px"}},"pm2 unstartup"),$e(" 禁用开机自启 ")],-1)),Mo("p",{style:{color:"#18a058","font-size":"12px","margin-top":"8px"}},"[TIP] 提示:配置开机自启后,重启电脑时 "+eo(Ib)+" 会自动启动,无需手动运行命令。")]),g[48]||(g[48]=Mo("div",{class:"help-section"},[Mo("h4",null,"[LINK] 相关链接"),Mo("div",{class:"link-list"},[Mo("a",{href:"https://github.com/ZeaoZhang/coding-tool",target:"_blank"},"GitHub 仓库"),Mo("a",{href:"https://github.com/ZeaoZhang/coding-tool/issues",target:"_blank"},"问题反馈")])],-1))])]),_:1},8,["show","title"])])}}},Tb=ge(Pb,[["__scopeId","data-v-80eb81f5"]]),Ab={__name:"App",setup(e){const{isDark:o,loadTheme:n}=Df(),t=to(()=>o.value?Jp:null),r=to(()=>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 Je(()=>{n()}),(e,o)=>(Ye(),qe(yo($i),{theme:t.value,"theme-overrides":r.value},{default:io(()=>[Ne(yo(Vs),null,{default:io(()=>[Ne(yo(ud),null,{default:io(()=>[Ne(Tb)]),_:1})]),_:1})]),_:1},8,["theme","theme-overrides"]))}};!async function(){const e=ao(Ab),o=oo();e.use(o);const n=Ko(o),{loadUIConfig:t}=Lo();await Promise.all([n.load(),t()]),e.use(Nt),e.mount("#app"),Lf()}();export{Li as $,Vp as A,ru as B,vf as C,nr as Ct,xh as D,yh as E,Ht as Et,yp as F,Hs as G,Wd as H,up as I,zs as J,Es as K,Ou as L,Lp as M,$p as N,nh as O,Ip as P,Ui as Q,wu as R,yf as S,ir as St,Sh as T,Kt as Tt,Hd as U,Rc as V,Bd as W,ps as X,hs as Y,cs as Z,jf as _,pr as _t,Kg as a,oi as at,xf as b,dr as bt,_g as c,wl as ct,Ug as d,nl as dt,Ei as et,jg as f,Za as ft,Uf as g,mr as gt,Zg as h,yr as ht,Wg as i,xi as it,Np as j,oh as k,Lg as l,xl as lt,Ng as m,wr as mt,Vg as n,Pi as nt,Hg as o,_l as ot,Yg as p,Ga as pt,Fs as q,Xg as r,wi as rt,qg as s,$l as st,Gg as t,zi as tt,Jg as u,dl as ut,_f as v,ur as vt,wh as w,Vt as wt,Cf as x,sr as xt,Df as y,cr as yt,fu as z};
|