@weapp-vite/dashboard 6.16.2 → 6.16.4

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.
@@ -1,5 +1,5 @@
1
1
  import{B as e,C as t,D as n,E as r,I as i,J as a,K as o,N as s,P as c,R as l,S as u,U as d,V as f,X as p,_ as m,g as h,h as g,j as _,k as v,l as y,p as b,q as x,v as S,w as C,x as w,y as T,z as E}from"./vue.js";import{C as D,O,a as k,d as A,f as j,i as M,l as N,n as ee,p as P,r as te,t as ne,w as F,x as I}from"./index.js";import{n as L,t as R}from"./AppEmptyState.js";import{t as z}from"./AppRuntimeBadge.js";import{n as B,t as re}from"./AppMetricTile.js";import{t as ie}from"./AppInsetPanel.js";var ae={class:`flex flex-wrap items-center justify-between gap-2 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2`},V={class:`text-xs text-(--dashboard-text-soft)`},H={class:`flex flex-wrap items-center gap-2`},U={key:0,class:`text-xs font-medium text-(--dashboard-accent)`},W=[`disabled`],G=[`disabled`],K=t({__name:`ActivityEventSortBar`,props:r({events:{},filteredCount:{},totalCount:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let n=t,r=i(t,`modelValue`),a=d(``),o=null;function s(e){return e.replaceAll(`|`,`\\|`).replaceAll(`
2
2
  `,` `)}let c=g(()=>[`# dashboard 事件流`,``,`事件数量:${n.events.length}`,``,`| 时间 | 等级 | 类型 | 来源 | 标题 | 耗时 | 标签 |`,`| --- | --- | --- | --- | --- | ---: | --- |`,...n.events.map(e=>[e.timestamp,j(e.level),A(e.kind),e.source??`dashboard`,e.title,N(e.durationMs),e.tags?.join(`, `)||`-`].map(s).join(` | `)).map(e=>`| ${e} |`),``].join(`
3
- `));function l(e){a.value=e,o&&clearTimeout(o),o=setTimeout(()=>{a.value=``,o=null},1800)}async function u(){try{await L(c.value),l(`已复制`)}catch{l(`复制失败`)}}function f(){let e=new Blob([`${JSON.stringify(n.events,null,2)}\n`],{type:`application/json`}),t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`weapp-vite-dashboard-events.json`,r.click(),URL.revokeObjectURL(t),l(`已导出`)}return v(()=>{o&&clearTimeout(o)}),(n,i)=>(_(),T(`div`,ae,[h(`p`,V,` 匹配 `+p(t.filteredCount)+` / `+p(t.totalCount)+` 条事件 `,1),h(`div`,H,[a.value?(_(),T(`span`,U,p(a.value),1)):S(``,!0),h(`button`,{type:`button`,class:`h-9 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-3 text-sm text-(--dashboard-text-soft) transition hover:border-(--dashboard-border-strong) hover:text-(--dashboard-accent) focus:border-(--dashboard-border-strong) focus:outline-none disabled:opacity-50`,disabled:t.events.length===0,onClick:u},` 复制事件 `,8,W),h(`button`,{type:`button`,class:`h-9 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-3 text-sm text-(--dashboard-text-soft) transition hover:border-(--dashboard-border-strong) hover:text-(--dashboard-accent) focus:border-(--dashboard-border-strong) focus:outline-none disabled:opacity-50`,disabled:t.events.length===0,onClick:f},` 导出 JSON `,8,G),e(h(`select`,{"onUpdate:modelValue":i[0]||=e=>r.value=e,class:`h-9 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-2.5 text-sm text-(--dashboard-text) outline-none transition focus:border-(--dashboard-accent)`},[...i[1]||=[h(`option`,{value:`time`},` 按时间 `,-1),h(`option`,{value:`duration`},` 按耗时 `,-1),h(`option`,{value:`severity`},` 按等级 `,-1),h(`option`,{value:`source`},` 按来源 `,-1)]],512),[[y,r.value]])])]))}}),q={class:`flex items-start justify-between gap-3`},J={key:0,class:`text-[11px] uppercase tracking-[0.18em] text-(--dashboard-accent)`},oe={class:`mt-1 text-lg font-semibold tracking-tight`},se={class:`mt-3 text-sm leading-6 text-(--dashboard-text-muted)`},ce={key:0,class:`mt-3 text-[11px] uppercase tracking-[0.18em] text-(--dashboard-text-soft)`},le={key:1,class:`mt-2 text-sm font-medium text-(--dashboard-text)`},ue=t({__name:`AppRuntimeFocusCard`,props:{event:{},eyebrow:{},emptyTitle:{},emptyDetail:{},durationText:{}},setup(e){let t=e,r=g(()=>t.event?M(t.event):null),i=g(()=>t.event?.title??t.emptyTitle??`尚无运行事件`),s=g(()=>t.event?.detail??t.emptyDetail??`当前工作区还没有推入结构化运行事件。`),l=g(()=>t.event?P(t.event):null);return(e,u)=>(_(),T(`div`,{class:x(o(D)())},[h(`div`,q,[h(`div`,null,[t.eyebrow?(_(),T(`p`,J,p(t.eyebrow),1)):S(``,!0),h(`h3`,oe,p(i.value),1)]),r.value?(_(),m(z,a(n({key:0},r.value)),null,16)):S(``,!0)]),h(`p`,se,p(s.value),1),t.event?(_(),T(`p`,ce,p(l.value),1)):S(``,!0),t.durationText?(_(),T(`p`,le,p(t.durationText),1)):S(``,!0),c(e.$slots,`default`)],2))}}),de={key:0,class:`mt-3 flex flex-wrap gap-1.5`},fe=t({__name:`ActivitySelectedEventPanel`,props:{event:{}},setup(e){let t=e,n=g(()=>t.event?.durationMs===void 0?void 0:`耗时 ${N(t.event.durationMs)}`);return(t,r)=>(_(),m(I,{eyebrow:`Selected`,title:`当前事件`,"icon-name":`metric-search`},{default:E(()=>[u(ue,{event:e.event,eyebrow:`focus`,"empty-title":`未选择事件`,"empty-detail":`选择左侧事件后查看详情。`,"duration-text":n.value},{default:E(()=>[e.event?.tags?.length?(_(),T(`div`,de,[(_(!0),T(b,null,s(e.event.tags,e=>(_(),m(z,{key:e,label:e,tone:`neutral`},null,8,[`label`]))),128))])):S(``,!0)]),_:1},8,[`event`,`duration-text`])]),_:1}))}}),pe={class:`flex items-start justify-between gap-3`},me={class:`min-w-0`},he={class:`truncate font-medium text-(--dashboard-text)`},ge={class:`mt-1 text-[11px] uppercase tracking-[0.16em] text-(--dashboard-text-soft)`},_e={key:0,class:`mt-3 flex flex-wrap gap-2 text-[11px] uppercase tracking-[0.14em] text-(--dashboard-text-soft)`},ve={key:1,class:`mt-3 text-sm text-(--dashboard-text-muted)`},ye=t({__name:`AppRuntimeSourceCard`,props:{source:{},count:{},errorCount:{},averageDuration:{},latestTimestamp:{},countLabel:{}},setup(e){let t=e,n=g(()=>k(t)),r=g(()=>t.latestTimestamp?`最近事件 ${t.latestTimestamp}`:`${t.count} ${t.countLabel??`条事件`}`),i=g(()=>[{key:`error-count`,label:`错误 ${t.errorCount}`},{key:`average-duration`,label:`平均耗时 ${t.averageDuration}`}]),c=g(()=>`平均耗时 ${t.averageDuration}`);return(e,l)=>(_(),T(`div`,{class:x(o(D)({padding:`sm`}))},[h(`div`,pe,[h(`div`,me,[h(`p`,he,p(t.source),1),h(`p`,ge,p(r.value),1)]),u(z,a(C(n.value)),null,16)]),t.latestTimestamp?(_(),T(`div`,_e,[(_(!0),T(b,null,s(i.value,e=>(_(),T(`span`,{key:e.key,class:`rounded-full border border-(--dashboard-border) px-2 py-0.5`},p(e.label),1))),128))])):(_(),T(`p`,ve,p(c.value),1))],2))}}),be={class:`mt-1 text-lg font-semibold`},xe=t({__name:`AppStatCard`,props:{label:{},value:{}},setup(e){let t=D({padding:`sm`});return(n,r)=>(_(),T(`div`,{class:x(o(t))},[u(B,null,{default:E(()=>[w(p(e.label),1)]),_:1}),h(`p`,be,p(e.value),1)],2))}}),Se={class:`flex shrink-0 items-center gap-2`},Ce={key:0,class:`text-xs font-medium text-(--dashboard-accent)`},we={class:`h-3.5 w-3.5`},Te={class:`grid gap-3`},Ee={class:`flex items-start justify-between gap-3`},De={class:`min-w-0`},Oe={class:`text-sm font-semibold text-(--dashboard-text)`},ke={class:`mt-1 text-xs leading-5 text-(--dashboard-text-muted)`},Ae={class:`grid grid-cols-2 gap-2 sm:grid-cols-5 xl:grid-cols-2 2xl:grid-cols-5`},je={key:0,class:`grid max-h-52 gap-2 overflow-y-auto pr-1`},Me={class:`flex items-start justify-between gap-3`},Ne={class:`min-w-0`},Pe={class:`truncate text-sm font-medium text-(--dashboard-text)`},Fe={class:`mt-1 truncate text-xs text-(--dashboard-text-soft)`},Ie={class:`mt-2 line-clamp-2 text-xs leading-5 text-(--dashboard-text-muted)`},Le=t({__name:`RuntimeIncidentDigestPanel`,props:{digest:{}},setup(e){let t=e,n=d(``),r=null,i=g(()=>t.digest.status===`critical`?`error`:t.digest.status===`warning`?`warning`:`success`);function a(e){return e===`error`?`text-rose-600 dark:text-rose-300`:e===`warning`?`text-amber-600 dark:text-amber-300`:`text-(--dashboard-accent)`}function o(e){return e===`critical`?`border-rose-400/60 bg-(--dashboard-panel-muted)`:e===`warning`?`border-amber-400/60 bg-(--dashboard-panel-muted)`:`border-emerald-400/60 bg-(--dashboard-panel-muted)`}function c(e){n.value=e,r&&clearTimeout(r),r=setTimeout(()=>{n.value=``,r=null},1800)}async function l(){try{await L(t.digest.report),c(`摘要已复制`)}catch{c(`复制失败`)}}return v(()=>{r&&clearTimeout(r)}),(t,r)=>(_(),m(I,{eyebrow:`Incident`,title:`事故摘要`,"icon-name":`metric-quality`},{header:E(()=>[h(`div`,Se,[n.value?(_(),T(`span`,Ce,p(n.value),1)):S(``,!0),h(`button`,{type:`button`,class:`inline-flex h-8 items-center gap-1.5 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 text-xs text-(--dashboard-text-soft) transition hover:border-(--dashboard-border-strong) hover:text-(--dashboard-accent) focus:border-(--dashboard-border-strong) focus:outline-none`,onClick:l},[h(`span`,we,[u(O,{name:`metric-copy`})]),r[0]||=w(` 复制 `,-1)])])]),default:E(()=>[h(`div`,Te,[h(`div`,{class:x([`rounded-md border px-3 py-2.5`,o(e.digest.status)])},[h(`div`,Ee,[h(`div`,De,[h(`p`,Oe,p(e.digest.statusLabel),1),h(`p`,ke,p(e.digest.statusDetail),1)]),u(z,{label:e.digest.statusLabel,tone:i.value},null,8,[`label`,`tone`])])],2),h(`div`,Ae,[(_(!0),T(b,null,s(e.digest.metrics,e=>(_(),m(re,{key:e.label,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),e.digest.incidents.length>0?(_(),T(`div`,je,[(_(!0),T(b,null,s(e.digest.incidents,e=>(_(),T(`article`,{key:e.id,class:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2.5`},[h(`div`,Me,[h(`div`,Ne,[h(`p`,Pe,p(e.title),1),h(`p`,Fe,p(e.source)+` · `+p(e.kindLabel)+` · `+p(e.timestamp)+` · `+p(e.duration),1)]),h(`span`,{class:x([`shrink-0 text-xs font-semibold`,a(e.level)])},p(e.levelLabel),3)]),h(`p`,Ie,p(e.reason)+` · `+p(e.detail),1)]))),128))])):(_(),m(R,{key:1,compact:``},{default:E(()=>[...r[1]||=[w(` 当前筛选范围内没有需要处理的运行时事件。 `,-1)]]),_:1}))])]),_:1}))}}),Re={class:`grid min-h-0 content-start gap-3 overflow-y-auto pr-1`},ze={class:`grid gap-2 sm:grid-cols-2`},Be={class:`grid max-h-44 gap-2 overflow-y-auto pr-1`},Ve={class:`flex items-start justify-between gap-3`},He={class:`font-medium`},Ue={class:`mt-1 text-sm leading-6 text-(--dashboard-text-muted)`},We={key:0,class:`grid max-h-full gap-2 overflow-y-auto pr-1`},Ge=t({__name:`ActivityInsightPanel`,props:{selectedEvent:{},incidentDigest:{},eventSummary:{},filteredEventSummary:{},diagnostics:{},sourceBreakdown:{}},setup(e){return(t,r)=>(_(),T(`div`,Re,[u(fe,{event:e.selectedEvent},null,8,[`event`]),u(Le,{digest:e.incidentDigest},null,8,[`digest`]),u(I,{eyebrow:`Runtime`,title:`事件摘要`,"icon-name":`metric-time`},{default:E(()=>[h(`div`,ze,[(_(!0),T(b,null,s([...e.eventSummary,...e.filteredEventSummary],e=>(_(),m(xe,n({key:e.label},{ref_for:!0},e),null,16))),128))])]),_:1}),u(I,{eyebrow:`Diagnostics`,title:`当前诊断队列`,"icon-name":`metric-health`,"content-class":`min-h-0 overflow-hidden`},{default:E(()=>[h(`ul`,Be,[(_(!0),T(b,null,s(e.diagnostics,e=>(_(),T(`li`,{key:e.label,class:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-4 py-3`},[h(`div`,Ve,[h(`div`,null,[h(`p`,He,p(e.label),1),h(`p`,Ue,p(e.detail),1)]),u(z,{label:e.status,tone:`info`},null,8,[`label`])])]))),128))])]),_:1}),u(I,{eyebrow:`Sources`,title:`事件来源`,"icon-name":`hero-system`,"content-class":`min-h-0 overflow-hidden`},{default:E(()=>[e.sourceBreakdown.length>0?(_(),T(`div`,We,[(_(!0),T(b,null,s(e.sourceBreakdown,e=>(_(),m(ye,n({key:e.source},{ref_for:!0},e),null,16))),128))])):S(``,!0)]),_:1})]))}}),Ke={class:`grid gap-3 xl:grid-cols-[minmax(14rem,0.85fr)_minmax(0,1.15fr)]`},qe={for:`dashboard-event-search`},Je=[`value`],Ye={class:`grid gap-3`},Xe={class:`mt-2 flex flex-wrap gap-2`},Ze=[`onClick`],Qe={key:0,class:`mt-2 text-xs leading-5 text-(--dashboard-text-soft)`},$e={class:`grid gap-3 md:grid-cols-3`},et={class:`mt-2 flex flex-wrap gap-2`},tt=[`onClick`],nt={class:`mt-2 flex flex-wrap gap-2`},rt=[`onClick`],it={class:`mt-2 flex flex-wrap gap-2`},at=[`onClick`],ot=t({__name:`AppEventFilterPanel`,props:{searchQuery:{},presetDescription:{},filterPresets:{},eventKindOptions:{},eventLevelOptions:{},eventSourceOptions:{},eventKindFilter:{},eventLevelFilter:{},eventSourceFilter:{}},emits:[`update:searchQuery`,`update:eventKindFilter`,`update:eventLevelFilter`,`update:eventSourceFilter`,`applyPreset`],setup(e,{emit:t}){let n=e,r=t;function i(){return F({kind:`theme`,active:!1})}function a(e,t){return F({kind:`theme`,active:e===t})}return(t,o)=>(_(),m(ie,null,{default:E(()=>[h(`div`,Ke,[h(`div`,null,[h(`label`,qe,[u(B,null,{default:E(()=>[...o[1]||=[w(` 搜索事件 `,-1)]]),_:1})]),h(`input`,{id:`dashboard-event-search`,value:e.searchQuery,type:`text`,placeholder:`搜索标题、详情、来源或标签`,class:`mt-2 w-full rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-3 py-2 text-sm text-(--dashboard-text) outline-none transition focus:border-(--dashboard-border-strong)`,onInput:o[0]||=e=>r(`update:searchQuery`,e.target.value)},null,40,Je)]),h(`div`,Ye,[h(`div`,null,[u(B,null,{default:E(()=>[...o[2]||=[w(` 快速预设 `,-1)]]),_:1}),h(`div`,Xe,[(_(!0),T(b,null,s(e.filterPresets,e=>(_(),T(`button`,{key:e.key,class:x(i()),onClick:t=>r(`applyPreset`,e.key)},p(e.label),11,Ze))),128))]),e.presetDescription?(_(),T(`p`,Qe,p(e.presetDescription),1)):S(``,!0)]),h(`div`,$e,[h(`div`,null,[u(B,null,{default:E(()=>[...o[3]||=[w(` 类型过滤 `,-1)]]),_:1}),h(`div`,et,[(_(!0),T(b,null,s(e.eventKindOptions,e=>(_(),T(`button`,{key:e.value,class:x(a(n.eventKindFilter,e.value)),onClick:t=>r(`update:eventKindFilter`,e.value)},p(e.label),11,tt))),128))])]),h(`div`,null,[u(B,null,{default:E(()=>[...o[4]||=[w(` 等级过滤 `,-1)]]),_:1}),h(`div`,nt,[(_(!0),T(b,null,s(e.eventLevelOptions,e=>(_(),T(`button`,{key:e.value,class:x(a(n.eventLevelFilter,e.value)),onClick:t=>r(`update:eventLevelFilter`,e.value)},p(e.label),11,rt))),128))])]),h(`div`,null,[u(B,null,{default:E(()=>[...o[5]||=[w(` 来源过滤 `,-1)]]),_:1}),h(`div`,it,[(_(!0),T(b,null,s(e.eventSourceOptions,e=>(_(),T(`button`,{key:e.value,class:x(a(n.eventSourceFilter,e.value)),onClick:t=>r(`update:eventSourceFilter`,e.value)},p(e.label),11,at))),128))])])])])])]),_:1}))}}),st={class:`flex items-start justify-between gap-3`},ct={class:`font-medium text-(--dashboard-text)`},lt=t({__name:`AppRuntimeEventListItem`,props:{event:{},selected:{type:Boolean}},setup(e){let t=e,n=g(()=>M(t.event)),r=g(()=>P(t.event)),i=g(()=>t.selected?`border-(--dashboard-border-strong) bg-(--dashboard-panel)`:`border-(--dashboard-border)`);return(e,o)=>(_(),T(`li`,{class:x([`rounded-md border bg-(--dashboard-panel-muted) px-4 py-3 transition`,i.value])},[h(`div`,st,[h(`div`,null,[h(`p`,ct,p(t.event.title),1),u(B,{class:`mt-1`},{default:E(()=>[w(p(r.value),1)]),_:1})]),u(z,a(C(n.value)),null,16)])],2))}}),ut=1e3,dt=5,Y={error:4,warning:3,success:2,info:1};function X(e){let t=Date.parse(e.timestamp);return Number.isFinite(t)?t:0}function Z(e,t){return typeof e.durationMs==`number`&&e.durationMs>=t}function ft(e,t){return e.level===`error`||e.level===`warning`||Z(e,t)}function pt(e,t){let n=[];return e.level===`error`?n.push(`错误事件`):e.level===`warning`&&n.push(`警告事件`),Z(e,t)&&n.push(`耗时 ${N(e.durationMs)}`),n.join(` · `)||`需要关注`}function mt(e,t){return{id:e.id,title:e.title,detail:e.detail,level:e.level,levelLabel:j(e.level),kindLabel:A(e.kind),source:e.source??`dashboard`,timestamp:e.timestamp,duration:N(e.durationMs),reason:pt(e,t)}}function ht(e,t,n){return e>0?`critical`:t>0||n>0?`warning`:`healthy`}function gt(e){return e===`critical`?`需要立即处理`:e===`warning`?`需要关注`:`运行平稳`}function _t(e,t,n,r){return e===`critical`?`检测到 ${t} 个错误事件,优先排查失败来源。`:e===`warning`?`检测到 ${n} 个警告和 ${r} 个慢事件,建议跟进。`:`当前筛选范围内没有错误、警告或慢事件。`}function vt(e){let t=e.incidents.length>0?e.incidents.map(e=>`- [${e.levelLabel}] ${e.title}(${e.source} · ${e.kindLabel} · ${e.timestamp} · ${e.duration}):${e.detail}`):[`- 当前筛选范围内没有需要处理的事件。`];return[`# dashboard 运行时事故摘要`,``,`状态:${e.statusLabel}`,`说明:${e.statusDetail}`,``,`## 指标`,...e.metrics.map(e=>`- ${e.label}:${e.value}`),``,`## 影响来源`,e.affectedSources.length>0?e.affectedSources.map(e=>`- ${e}`).join(`
3
+ `));function l(e){a.value=e,o&&clearTimeout(o),o=setTimeout(()=>{a.value=``,o=null},1800)}async function u(){try{await L(c.value),l(`已复制`)}catch{l(`复制失败`)}}function f(){let e=new Blob([`${JSON.stringify(n.events,null,2)}\n`],{type:`application/json`}),t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`weapp-vite-dashboard-events.json`,r.click(),URL.revokeObjectURL(t),l(`已导出`)}return v(()=>{o&&clearTimeout(o)}),(n,i)=>(_(),T(`div`,ae,[h(`p`,V,` 匹配 `+p(t.filteredCount)+` / `+p(t.totalCount)+` 条事件 `,1),h(`div`,H,[a.value?(_(),T(`span`,U,p(a.value),1)):S(``,!0),h(`button`,{type:`button`,class:`h-9 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-3 text-sm text-(--dashboard-text-soft) transition hover:border-(--dashboard-border-strong) hover:text-(--dashboard-accent) focus:border-(--dashboard-border-strong) focus:outline-none disabled:opacity-50`,disabled:t.events.length===0,onClick:u},` 复制事件 `,8,W),h(`button`,{type:`button`,class:`h-9 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-3 text-sm text-(--dashboard-text-soft) transition hover:border-(--dashboard-border-strong) hover:text-(--dashboard-accent) focus:border-(--dashboard-border-strong) focus:outline-none disabled:opacity-50`,disabled:t.events.length===0,onClick:f},` 导出 JSON `,8,G),e(h(`select`,{"onUpdate:modelValue":i[0]||=e=>r.value=e,class:`h-9 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-2.5 text-sm text-(--dashboard-text) outline-none transition focus:border-(--dashboard-accent)`},[...i[1]||=[h(`option`,{value:`time`},` 按时间 `,-1),h(`option`,{value:`duration`},` 按耗时 `,-1),h(`option`,{value:`severity`},` 按等级 `,-1),h(`option`,{value:`source`},` 按来源 `,-1)]],512),[[y,r.value]])])]))}}),q={class:`flex items-start justify-between gap-3`},J={key:0,class:`text-[11px] uppercase tracking-[0.18em] text-(--dashboard-accent)`},oe={class:`mt-1 text-lg font-semibold tracking-tight`},se={class:`mt-3 text-sm leading-6 text-(--dashboard-text-muted)`},ce={key:0,class:`mt-3 text-[11px] uppercase tracking-[0.18em] text-(--dashboard-text-soft)`},le={key:1,class:`mt-2 text-sm font-medium text-(--dashboard-text)`},ue=t({__name:`AppRuntimeFocusCard`,props:{event:{},eyebrow:{},emptyTitle:{},emptyDetail:{},durationText:{}},setup(e){let t=e,r=g(()=>t.event?M(t.event):null),i=g(()=>t.event?.title??t.emptyTitle??`尚无运行事件`),s=g(()=>t.event?.detail??t.emptyDetail??`当前工作区还没有推入结构化运行事件。`),l=g(()=>t.event?P(t.event):null);return(e,u)=>(_(),T(`div`,{class:x(o(D)())},[h(`div`,q,[h(`div`,null,[t.eyebrow?(_(),T(`p`,J,p(t.eyebrow),1)):S(``,!0),h(`h3`,oe,p(i.value),1)]),r.value?(_(),m(z,a(n({key:0},r.value)),null,16)):S(``,!0)]),h(`p`,se,p(s.value),1),t.event?(_(),T(`p`,ce,p(l.value),1)):S(``,!0),t.durationText?(_(),T(`p`,le,p(t.durationText),1)):S(``,!0),c(e.$slots,`default`)],2))}}),de={key:0,class:`mt-3 flex flex-wrap gap-1.5`},fe={key:1,class:`mt-4 grid gap-3 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) p-3`},pe={class:`flex min-w-0 items-start justify-between gap-3`},me={class:`min-w-0`},he={key:0,class:`mt-1 truncate font-mono text-xs text-(--dashboard-text-soft)`},ge={key:0,class:`grid gap-2 sm:grid-cols-2`},_e={class:`text-[11px] text-(--dashboard-text-soft)`},ve={class:`mt-1 text-sm font-semibold text-(--dashboard-text)`},ye={key:1,class:`flex flex-wrap gap-1.5`},be={key:2,class:`grid gap-2 text-xs leading-5 text-(--dashboard-text-muted)`},xe={key:0},Se={key:1},Ce=t({__name:`ActivitySelectedEventPanel`,props:{event:{}},setup(e){let t=e,n=g(()=>t.event?.durationMs===void 0?void 0:`耗时 ${N(t.event.durationMs)}`),r=g(()=>{let e=t.event?.profile;return e?[{label:`总耗时`,value:N(e.totalMs)},{label:`构建核心`,value:N(e.buildCoreMs)},{label:`转换`,value:N(e.transformMs)},{label:`写入`,value:N(e.writeMs)},{label:`监听到脏标记`,value:N(e.watchToDirtyMs)},{label:`产物发射`,value:N(e.emitMs)},{label:`共享 chunk`,value:N(e.sharedChunkResolveMs)}].filter(e=>e.value!==`未记录`):[]}),i=g(()=>{let e=t.event?.profile;return e?[{label:`脏入口`,value:e.dirtyCount},{label:`待处理`,value:e.pendingCount},{label:`已发射`,value:e.emittedCount}].filter(e=>typeof e.value==`number`):[]}),a=g(()=>t.event?.profile?.sourceRootFile??t.event?.profile?.relativeFile??t.event?.profile?.file);return(t,o)=>(_(),m(I,{eyebrow:`Selected`,title:`当前事件`,"icon-name":`metric-search`},{default:E(()=>[u(ue,{event:e.event,eyebrow:`focus`,"empty-title":`未选择事件`,"empty-detail":`选择左侧事件后查看详情。`,"duration-text":n.value},{default:E(()=>[e.event?.tags?.length?(_(),T(`div`,de,[(_(!0),T(b,null,s(e.event.tags,e=>(_(),m(z,{key:e,label:e,tone:`neutral`},null,8,[`label`]))),128))])):S(``,!0),e.event?.profile?(_(),T(`div`,fe,[h(`div`,pe,[h(`div`,me,[o[0]||=h(`p`,{class:`text-sm font-semibold text-(--dashboard-text)`},` HMR 阶段明细 `,-1),a.value?(_(),T(`p`,he,p(a.value),1)):S(``,!0)]),e.event.profile.event?(_(),m(z,{key:0,label:e.event.profile.event,tone:`info`},null,8,[`label`])):S(``,!0)]),r.value.length>0?(_(),T(`dl`,ge,[(_(!0),T(b,null,s(r.value,e=>(_(),T(`div`,{key:e.label,class:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-3 py-2`},[h(`dt`,_e,p(e.label),1),h(`dd`,ve,p(e.value),1)]))),128))])):S(``,!0),i.value.length>0?(_(),T(`div`,ye,[(_(!0),T(b,null,s(i.value,e=>(_(),m(z,{key:e.label,label:`${e.label} ${e.value}`,tone:`neutral`},null,8,[`label`]))),128))])):S(``,!0),e.event.profile.dirtyReasonSummary?.length||e.event.profile.pendingReasonSummary?.length?(_(),T(`div`,be,[e.event.profile.dirtyReasonSummary?.length?(_(),T(`p`,xe,` 脏标记:`+p(e.event.profile.dirtyReasonSummary.join(`、`)),1)):S(``,!0),e.event.profile.pendingReasonSummary?.length?(_(),T(`p`,Se,` 待处理:`+p(e.event.profile.pendingReasonSummary.join(`、`)),1)):S(``,!0)])):S(``,!0)])):S(``,!0)]),_:1},8,[`event`,`duration-text`])]),_:1}))}}),we={class:`flex items-start justify-between gap-3`},Te={class:`min-w-0`},Ee={class:`truncate font-medium text-(--dashboard-text)`},De={class:`mt-1 text-[11px] uppercase tracking-[0.16em] text-(--dashboard-text-soft)`},Oe={key:0,class:`mt-3 flex flex-wrap gap-2 text-[11px] uppercase tracking-[0.14em] text-(--dashboard-text-soft)`},ke={key:1,class:`mt-3 text-sm text-(--dashboard-text-muted)`},Ae=t({__name:`AppRuntimeSourceCard`,props:{source:{},count:{},errorCount:{},averageDuration:{},latestTimestamp:{},countLabel:{}},setup(e){let t=e,n=g(()=>k(t)),r=g(()=>t.latestTimestamp?`最近事件 ${t.latestTimestamp}`:`${t.count} ${t.countLabel??`条事件`}`),i=g(()=>[{key:`error-count`,label:`错误 ${t.errorCount}`},{key:`average-duration`,label:`平均耗时 ${t.averageDuration}`}]),c=g(()=>`平均耗时 ${t.averageDuration}`);return(e,l)=>(_(),T(`div`,{class:x(o(D)({padding:`sm`}))},[h(`div`,we,[h(`div`,Te,[h(`p`,Ee,p(t.source),1),h(`p`,De,p(r.value),1)]),u(z,a(C(n.value)),null,16)]),t.latestTimestamp?(_(),T(`div`,Oe,[(_(!0),T(b,null,s(i.value,e=>(_(),T(`span`,{key:e.key,class:`rounded-full border border-(--dashboard-border) px-2 py-0.5`},p(e.label),1))),128))])):(_(),T(`p`,ke,p(c.value),1))],2))}}),je={class:`mt-1 text-lg font-semibold`},Me=t({__name:`AppStatCard`,props:{label:{},value:{}},setup(e){let t=D({padding:`sm`});return(n,r)=>(_(),T(`div`,{class:x(o(t))},[u(B,null,{default:E(()=>[w(p(e.label),1)]),_:1}),h(`p`,je,p(e.value),1)],2))}}),Ne={class:`flex shrink-0 items-center gap-2`},Pe={key:0,class:`text-xs font-medium text-(--dashboard-accent)`},Fe={class:`h-3.5 w-3.5`},Ie={class:`grid gap-3`},Le={class:`flex items-start justify-between gap-3`},Re={class:`min-w-0`},ze={class:`text-sm font-semibold text-(--dashboard-text)`},Be={class:`mt-1 text-xs leading-5 text-(--dashboard-text-muted)`},Ve={class:`grid grid-cols-2 gap-2 sm:grid-cols-5 xl:grid-cols-2 2xl:grid-cols-5`},He={key:0,class:`grid max-h-52 gap-2 overflow-y-auto pr-1`},Ue={class:`flex items-start justify-between gap-3`},We={class:`min-w-0`},Ge={class:`truncate text-sm font-medium text-(--dashboard-text)`},Ke={class:`mt-1 truncate text-xs text-(--dashboard-text-soft)`},qe={class:`mt-2 line-clamp-2 text-xs leading-5 text-(--dashboard-text-muted)`},Je=t({__name:`RuntimeIncidentDigestPanel`,props:{digest:{}},setup(e){let t=e,n=d(``),r=null,i=g(()=>t.digest.status===`critical`?`error`:t.digest.status===`warning`?`warning`:`success`);function a(e){return e===`error`?`text-rose-600 dark:text-rose-300`:e===`warning`?`text-amber-600 dark:text-amber-300`:`text-(--dashboard-accent)`}function o(e){return e===`critical`?`border-rose-400/60 bg-(--dashboard-panel-muted)`:e===`warning`?`border-amber-400/60 bg-(--dashboard-panel-muted)`:`border-emerald-400/60 bg-(--dashboard-panel-muted)`}function c(e){n.value=e,r&&clearTimeout(r),r=setTimeout(()=>{n.value=``,r=null},1800)}async function l(){try{await L(t.digest.report),c(`摘要已复制`)}catch{c(`复制失败`)}}return v(()=>{r&&clearTimeout(r)}),(t,r)=>(_(),m(I,{eyebrow:`Incident`,title:`事故摘要`,"icon-name":`metric-quality`},{header:E(()=>[h(`div`,Ne,[n.value?(_(),T(`span`,Pe,p(n.value),1)):S(``,!0),h(`button`,{type:`button`,class:`inline-flex h-8 items-center gap-1.5 rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 text-xs text-(--dashboard-text-soft) transition hover:border-(--dashboard-border-strong) hover:text-(--dashboard-accent) focus:border-(--dashboard-border-strong) focus:outline-none`,onClick:l},[h(`span`,Fe,[u(O,{name:`metric-copy`})]),r[0]||=w(` 复制 `,-1)])])]),default:E(()=>[h(`div`,Ie,[h(`div`,{class:x([`rounded-md border px-3 py-2.5`,o(e.digest.status)])},[h(`div`,Le,[h(`div`,Re,[h(`p`,ze,p(e.digest.statusLabel),1),h(`p`,Be,p(e.digest.statusDetail),1)]),u(z,{label:e.digest.statusLabel,tone:i.value},null,8,[`label`,`tone`])])],2),h(`div`,Ve,[(_(!0),T(b,null,s(e.digest.metrics,e=>(_(),m(re,{key:e.label,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),e.digest.incidents.length>0?(_(),T(`div`,He,[(_(!0),T(b,null,s(e.digest.incidents,e=>(_(),T(`article`,{key:e.id,class:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2.5`},[h(`div`,Ue,[h(`div`,We,[h(`p`,Ge,p(e.title),1),h(`p`,Ke,p(e.source)+` · `+p(e.kindLabel)+` · `+p(e.timestamp)+` · `+p(e.duration),1)]),h(`span`,{class:x([`shrink-0 text-xs font-semibold`,a(e.level)])},p(e.levelLabel),3)]),h(`p`,qe,p(e.reason)+` · `+p(e.detail),1)]))),128))])):(_(),m(R,{key:1,compact:``},{default:E(()=>[...r[1]||=[w(` 当前筛选范围内没有需要处理的运行时事件。 `,-1)]]),_:1}))])]),_:1}))}}),Ye={class:`grid min-h-0 content-start gap-3 overflow-y-auto pr-1`},Xe={class:`grid gap-2 sm:grid-cols-2`},Ze={class:`grid max-h-44 gap-2 overflow-y-auto pr-1`},Qe={class:`flex items-start justify-between gap-3`},$e={class:`font-medium`},et={class:`mt-1 text-sm leading-6 text-(--dashboard-text-muted)`},tt={key:0,class:`grid max-h-full gap-2 overflow-y-auto pr-1`},nt=t({__name:`ActivityInsightPanel`,props:{selectedEvent:{},incidentDigest:{},eventSummary:{},filteredEventSummary:{},diagnostics:{},sourceBreakdown:{}},setup(e){return(t,r)=>(_(),T(`div`,Ye,[u(Ce,{event:e.selectedEvent},null,8,[`event`]),u(Je,{digest:e.incidentDigest},null,8,[`digest`]),u(I,{eyebrow:`Runtime`,title:`事件摘要`,"icon-name":`metric-time`},{default:E(()=>[h(`div`,Xe,[(_(!0),T(b,null,s([...e.eventSummary,...e.filteredEventSummary],e=>(_(),m(Me,n({key:e.label},{ref_for:!0},e),null,16))),128))])]),_:1}),u(I,{eyebrow:`Diagnostics`,title:`当前诊断队列`,"icon-name":`metric-health`,"content-class":`min-h-0 overflow-hidden`},{default:E(()=>[h(`ul`,Ze,[(_(!0),T(b,null,s(e.diagnostics,e=>(_(),T(`li`,{key:e.label,class:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-4 py-3`},[h(`div`,Qe,[h(`div`,null,[h(`p`,$e,p(e.label),1),h(`p`,et,p(e.detail),1)]),u(z,{label:e.status,tone:`info`},null,8,[`label`])])]))),128))])]),_:1}),u(I,{eyebrow:`Sources`,title:`事件来源`,"icon-name":`hero-system`,"content-class":`min-h-0 overflow-hidden`},{default:E(()=>[e.sourceBreakdown.length>0?(_(),T(`div`,tt,[(_(!0),T(b,null,s(e.sourceBreakdown,e=>(_(),m(Ae,n({key:e.source},{ref_for:!0},e),null,16))),128))])):S(``,!0)]),_:1})]))}}),rt={class:`grid gap-3 xl:grid-cols-[minmax(14rem,0.85fr)_minmax(0,1.15fr)]`},it={for:`dashboard-event-search`},at=[`value`],ot={class:`grid gap-3`},st={class:`mt-2 flex flex-wrap gap-2`},ct=[`onClick`],lt={key:0,class:`mt-2 text-xs leading-5 text-(--dashboard-text-soft)`},ut={class:`grid gap-3 md:grid-cols-3`},dt={class:`mt-2 flex flex-wrap gap-2`},ft=[`onClick`],pt={class:`mt-2 flex flex-wrap gap-2`},mt=[`onClick`],ht={class:`mt-2 flex flex-wrap gap-2`},gt=[`onClick`],_t=t({__name:`AppEventFilterPanel`,props:{searchQuery:{},presetDescription:{},filterPresets:{},eventKindOptions:{},eventLevelOptions:{},eventSourceOptions:{},eventKindFilter:{},eventLevelFilter:{},eventSourceFilter:{}},emits:[`update:searchQuery`,`update:eventKindFilter`,`update:eventLevelFilter`,`update:eventSourceFilter`,`applyPreset`],setup(e,{emit:t}){let n=e,r=t;function i(){return F({kind:`theme`,active:!1})}function a(e,t){return F({kind:`theme`,active:e===t})}return(t,o)=>(_(),m(ie,null,{default:E(()=>[h(`div`,rt,[h(`div`,null,[h(`label`,it,[u(B,null,{default:E(()=>[...o[1]||=[w(` 搜索事件 `,-1)]]),_:1})]),h(`input`,{id:`dashboard-event-search`,value:e.searchQuery,type:`text`,placeholder:`搜索标题、详情、来源或标签`,class:`mt-2 w-full rounded-md border border-(--dashboard-border) bg-(--dashboard-panel) px-3 py-2 text-sm text-(--dashboard-text) outline-none transition focus:border-(--dashboard-border-strong)`,onInput:o[0]||=e=>r(`update:searchQuery`,e.target.value)},null,40,at)]),h(`div`,ot,[h(`div`,null,[u(B,null,{default:E(()=>[...o[2]||=[w(` 快速预设 `,-1)]]),_:1}),h(`div`,st,[(_(!0),T(b,null,s(e.filterPresets,e=>(_(),T(`button`,{key:e.key,class:x(i()),onClick:t=>r(`applyPreset`,e.key)},p(e.label),11,ct))),128))]),e.presetDescription?(_(),T(`p`,lt,p(e.presetDescription),1)):S(``,!0)]),h(`div`,ut,[h(`div`,null,[u(B,null,{default:E(()=>[...o[3]||=[w(` 类型过滤 `,-1)]]),_:1}),h(`div`,dt,[(_(!0),T(b,null,s(e.eventKindOptions,e=>(_(),T(`button`,{key:e.value,class:x(a(n.eventKindFilter,e.value)),onClick:t=>r(`update:eventKindFilter`,e.value)},p(e.label),11,ft))),128))])]),h(`div`,null,[u(B,null,{default:E(()=>[...o[4]||=[w(` 等级过滤 `,-1)]]),_:1}),h(`div`,pt,[(_(!0),T(b,null,s(e.eventLevelOptions,e=>(_(),T(`button`,{key:e.value,class:x(a(n.eventLevelFilter,e.value)),onClick:t=>r(`update:eventLevelFilter`,e.value)},p(e.label),11,mt))),128))])]),h(`div`,null,[u(B,null,{default:E(()=>[...o[5]||=[w(` 来源过滤 `,-1)]]),_:1}),h(`div`,ht,[(_(!0),T(b,null,s(e.eventSourceOptions,e=>(_(),T(`button`,{key:e.value,class:x(a(n.eventSourceFilter,e.value)),onClick:t=>r(`update:eventSourceFilter`,e.value)},p(e.label),11,gt))),128))])])])])])]),_:1}))}}),vt={class:`flex items-start justify-between gap-3`},yt={class:`font-medium text-(--dashboard-text)`},bt=t({__name:`AppRuntimeEventListItem`,props:{event:{},selected:{type:Boolean}},setup(e){let t=e,n=g(()=>M(t.event)),r=g(()=>P(t.event)),i=g(()=>t.selected?`border-(--dashboard-border-strong) bg-(--dashboard-panel)`:`border-(--dashboard-border)`);return(e,o)=>(_(),T(`li`,{class:x([`rounded-md border bg-(--dashboard-panel-muted) px-4 py-3 transition`,i.value])},[h(`div`,vt,[h(`div`,null,[h(`p`,yt,p(t.event.title),1),u(B,{class:`mt-1`},{default:E(()=>[w(p(r.value),1)]),_:1})]),u(z,a(C(n.value)),null,16)])],2))}}),xt=1e3,St=5,Y={error:4,warning:3,success:2,info:1};function X(e){let t=Date.parse(e.timestamp);return Number.isFinite(t)?t:0}function Z(e,t){return typeof e.durationMs==`number`&&e.durationMs>=t}function Ct(e,t){return e.level===`error`||e.level===`warning`||Z(e,t)}function wt(e,t){let n=[];return e.level===`error`?n.push(`错误事件`):e.level===`warning`&&n.push(`警告事件`),Z(e,t)&&n.push(`耗时 ${N(e.durationMs)}`),n.join(` · `)||`需要关注`}function Tt(e,t){return{id:e.id,title:e.title,detail:e.detail,level:e.level,levelLabel:j(e.level),kindLabel:A(e.kind),source:e.source??`dashboard`,timestamp:e.timestamp,duration:N(e.durationMs),reason:wt(e,t)}}function Et(e,t,n){return e>0?`critical`:t>0||n>0?`warning`:`healthy`}function Dt(e){return e===`critical`?`需要立即处理`:e===`warning`?`需要关注`:`运行平稳`}function Ot(e,t,n,r){return e===`critical`?`检测到 ${t} 个错误事件,优先排查失败来源。`:e===`warning`?`检测到 ${n} 个警告和 ${r} 个慢事件,建议跟进。`:`当前筛选范围内没有错误、警告或慢事件。`}function kt(e){let t=e.incidents.length>0?e.incidents.map(e=>`- [${e.levelLabel}] ${e.title}(${e.source} · ${e.kindLabel} · ${e.timestamp} · ${e.duration}):${e.detail}`):[`- 当前筛选范围内没有需要处理的事件。`];return[`# dashboard 运行时事故摘要`,``,`状态:${e.statusLabel}`,`说明:${e.statusDetail}`,``,`## 指标`,...e.metrics.map(e=>`- ${e.label}:${e.value}`),``,`## 影响来源`,e.affectedSources.length>0?e.affectedSources.map(e=>`- ${e}`).join(`
4
4
  `):`- 无`,``,`## 优先处理`,...t,``].join(`
5
- `)}function yt(e,t={}){let n=t.slowEventThresholdMs??ut,r=e.filter(e=>e.level===`error`).length,i=e.filter(e=>e.level===`warning`).length,a=e.filter(e=>Z(e,n)).length,o=e.filter(e=>ft(e,n)),s=[...new Set(o.map(e=>e.source??`dashboard`))].sort((e,t)=>e.localeCompare(t,`zh-CN`)),c=ht(r,i,a),l=o.toSorted((e,t)=>Y[t.level]-Y[e.level]||(t.durationMs??-1)-(e.durationMs??-1)||X(t)-X(e)).slice(0,dt).map(e=>mt(e,n)),u={status:c,statusLabel:gt(c),statusDetail:_t(c,r,i,a),metrics:[{label:`事件总数`,value:e.length},{label:`错误`,value:r},{label:`警告`,value:i},{label:`慢事件`,value:a},{label:`影响来源`,value:s.length}],affectedSources:s,incidents:l};return{...u,report:vt(u)}}var Q={error:4,warning:3,success:2,info:1},$=[{value:`all`,label:`全部类型`},{value:`command`,label:`命令`},{value:`build`,label:`构建`},{value:`diagnostic`,label:`诊断`},{value:`hmr`,label:`HMR`},{value:`system`,label:`系统`}],bt=[{value:`all`,label:`全部等级`},{value:`info`,label:`信息`},{value:`success`,label:`成功`},{value:`warning`,label:`警告`},{value:`error`,label:`错误`}];function xt(e,t){return[e.title,e.detail,e.kind,e.level,e.source??``,...e.tags??[]].join(` `).toLowerCase().includes(t)}function St(e,t){return[...e].sort((e,n)=>t===`duration`?(n.durationMs??-1)-(e.durationMs??-1)||Date.parse(n.timestamp)-Date.parse(e.timestamp):t===`severity`?Q[n.level]-Q[e.level]||Date.parse(n.timestamp)-Date.parse(e.timestamp):t===`source`&&(e.source??`dashboard`).localeCompare(n.source??`dashboard`)||Date.parse(n.timestamp)-Date.parse(e.timestamp))}function Ct(e){let t=d(`all`),n=d(`all`),r=d(`all`),i=d(`time`),a=d(``),o=d(null),s=[{key:`all`,label:`查看全部`,description:`回到完整事件流`,apply(){t.value=`all`,n.value=`all`,r.value=`all`,a.value=``}},{key:`issues`,label:`异常优先`,description:`只看警告和错误`,apply(){t.value=`all`,n.value=`warning`,r.value=`all`,a.value=``}},{key:`commands`,label:`命令流`,description:`聚焦命令执行事件`,apply(){t.value=`command`,n.value=`all`,r.value=`all`,a.value=``}},{key:`hmr`,label:`HMR`,description:`观察热更新相关事件`,apply(){t.value=`hmr`,n.value=`all`,r.value=`all`,a.value=``}}],c=g(()=>[{value:`all`,label:`全部来源`},...[...new Set(e.value.map(e=>e.source??`dashboard`).filter(Boolean))].sort((e,t)=>e.localeCompare(t,`zh-CN`)).map(e=>({value:e,label:e}))]),u=g(()=>{let o=a.value.trim().toLowerCase();return St(e.value.filter(e=>t.value!==`all`&&e.kind!==t.value||n.value!==`all`&&e.level!==n.value||r.value!==`all`&&(e.source??`dashboard`)!==r.value?!1:!o||xt(e,o)),i.value)}),f=g(()=>{let e=u.value.filter(e=>typeof e.durationMs==`number`),i=e.length>0?Math.round(e.reduce((e,t)=>e+(t.durationMs??0),0)/e.length):void 0;return[{label:`筛选后事件`,value:String(u.value.length)},{label:`当前类型`,value:t.value===`all`?`全部`:A(t.value)},{label:`当前等级`,value:n.value===`all`?`全部`:j(n.value)},{label:`当前来源`,value:r.value===`all`?`全部`:r.value},{label:`搜索关键字`,value:a.value.trim()||`未设置`},{label:`筛选平均耗时`,value:N(i)}]}),p=g(()=>ee(te(u.value))),m=g(()=>yt(u.value)),h=g(()=>u.value.find(e=>e.id===o.value)??u.value[0]??null),_=g(()=>s.find(e=>e.key===`issues`?t.value===`all`&&n.value===`warning`&&r.value===`all`&&a.value===``:e.key===`commands`?t.value===`command`&&n.value===`all`&&r.value===`all`&&a.value===``:e.key===`hmr`?t.value===`hmr`&&n.value===`all`&&r.value===`all`&&a.value===``:t.value===`all`&&n.value===`all`&&r.value===`all`&&a.value===``)?.description??``);return l(u,e=>{if(e.length===0){o.value=null;return}e.some(e=>e.id===o.value)||(o.value=e[0]?.id??null)},{immediate:!0}),{eventKindFilter:t,eventKindOptions:$,eventLevelFilter:n,eventLevelOptions:bt,eventSortMode:i,eventSourceFilter:r,eventSourceOptions:c,filteredEventSummary:f,filteredRuntimeEvents:u,filterPresets:s,incidentDigest:m,presetDescription:_,searchQuery:a,selectedEvent:h,selectedEventId:o,sourceBreakdown:p}}var wt={class:`grid h-full min-h-0 gap-3 overflow-hidden xl:grid-cols-[minmax(0,1.25fr)_minmax(22rem,0.75fr)]`},Tt={class:`grid h-full min-h-0 grid-rows-[minmax(0,9rem)_auto_minmax(6rem,1fr)] gap-3 overflow-hidden`},Et={class:`grid min-h-0 gap-2 overflow-y-auto pr-1 text-sm leading-6 text-(--dashboard-text-muted)`},Dt=t({__name:`activity`,setup(e){let{diagnostics:t,eventSummary:n,runtimeEvents:r}=ne(),{eventKindFilter:i,eventKindOptions:a,eventLevelFilter:c,eventLevelOptions:l,eventSortMode:d,eventSourceFilter:p,eventSourceOptions:g,filteredEventSummary:v,filteredRuntimeEvents:y,filterPresets:x,incidentDigest:C,presetDescription:D,searchQuery:O,selectedEvent:k,selectedEventId:A,sourceBreakdown:j}=Ct(r);return(e,M)=>(_(),T(`div`,wt,[u(I,{eyebrow:`Event Feed`,title:`事件控制台`,"icon-name":`hero-commands`,"content-class":`min-h-0 overflow-hidden`},{default:E(()=>[h(`div`,Tt,[u(ot,{class:`min-h-0 overflow-y-auto`,"search-query":o(O),"preset-description":o(D),"filter-presets":o(x),"event-kind-options":o(a),"event-level-options":o(l),"event-source-options":o(g),"event-kind-filter":o(i),"event-level-filter":o(c),"event-source-filter":o(p),"onUpdate:searchQuery":M[0]||=e=>O.value=e,"onUpdate:eventKindFilter":M[1]||=e=>i.value=e,"onUpdate:eventLevelFilter":M[2]||=e=>c.value=e,"onUpdate:eventSourceFilter":M[3]||=e=>p.value=e,onApplyPreset:M[4]||=e=>o(x).find(t=>t.key===e)?.apply()},null,8,[`search-query`,`preset-description`,`filter-presets`,`event-kind-options`,`event-level-options`,`event-source-options`,`event-kind-filter`,`event-level-filter`,`event-source-filter`]),u(K,{modelValue:o(d),"onUpdate:modelValue":M[5]||=e=>f(d)?d.value=e:null,events:o(y),"filtered-count":o(y).length,"total-count":o(r).length},null,8,[`modelValue`,`events`,`filtered-count`,`total-count`]),o(y).length===0?(_(),m(R,{key:0,as:`p`},{default:E(()=>[...M[6]||=[w(` 当前过滤条件下没有匹配事件。 `,-1)]]),_:1})):S(``,!0),h(`ul`,Et,[(_(!0),T(b,null,s(o(y),e=>(_(),m(lt,{key:e.id,event:e,selected:o(k)?.id===e.id,onClick:t=>A.value=e.id},null,8,[`event`,`selected`,`onClick`]))),128))])])]),_:1}),u(Ge,{"selected-event":o(k),"incident-digest":o(C),"event-summary":o(n),"filtered-event-summary":o(v),diagnostics:o(t),"source-breakdown":o(j)},null,8,[`selected-event`,`incident-digest`,`event-summary`,`filtered-event-summary`,`diagnostics`,`source-breakdown`])]))}});export{Dt as default};
5
+ `)}function At(e,t={}){let n=t.slowEventThresholdMs??xt,r=e.filter(e=>e.level===`error`).length,i=e.filter(e=>e.level===`warning`).length,a=e.filter(e=>Z(e,n)).length,o=e.filter(e=>Ct(e,n)),s=[...new Set(o.map(e=>e.source??`dashboard`))].sort((e,t)=>e.localeCompare(t,`zh-CN`)),c=Et(r,i,a),l=o.toSorted((e,t)=>Y[t.level]-Y[e.level]||(t.durationMs??-1)-(e.durationMs??-1)||X(t)-X(e)).slice(0,St).map(e=>Tt(e,n)),u={status:c,statusLabel:Dt(c),statusDetail:Ot(c,r,i,a),metrics:[{label:`事件总数`,value:e.length},{label:`错误`,value:r},{label:`警告`,value:i},{label:`慢事件`,value:a},{label:`影响来源`,value:s.length}],affectedSources:s,incidents:l};return{...u,report:kt(u)}}var Q={error:4,warning:3,success:2,info:1},jt=[{value:`all`,label:`全部类型`},{value:`command`,label:`命令`},{value:`build`,label:`构建`},{value:`diagnostic`,label:`诊断`},{value:`hmr`,label:`HMR`},{value:`system`,label:`系统`}],Mt=[{value:`all`,label:`全部等级`},{value:`info`,label:`信息`},{value:`success`,label:`成功`},{value:`warning`,label:`警告`},{value:`error`,label:`错误`}];function $(e,t){return[e.title,e.detail,e.kind,e.level,e.source??``,...e.tags??[]].join(` `).toLowerCase().includes(t)}function Nt(e,t){return[...e].sort((e,n)=>t===`duration`?(n.durationMs??-1)-(e.durationMs??-1)||Date.parse(n.timestamp)-Date.parse(e.timestamp):t===`severity`?Q[n.level]-Q[e.level]||Date.parse(n.timestamp)-Date.parse(e.timestamp):t===`source`&&(e.source??`dashboard`).localeCompare(n.source??`dashboard`)||Date.parse(n.timestamp)-Date.parse(e.timestamp))}function Pt(e){let t=d(`all`),n=d(`all`),r=d(`all`),i=d(`time`),a=d(``),o=d(null),s=[{key:`all`,label:`查看全部`,description:`回到完整事件流`,apply(){t.value=`all`,n.value=`all`,r.value=`all`,a.value=``}},{key:`issues`,label:`异常优先`,description:`只看警告和错误`,apply(){t.value=`all`,n.value=`warning`,r.value=`all`,a.value=``}},{key:`commands`,label:`命令流`,description:`聚焦命令执行事件`,apply(){t.value=`command`,n.value=`all`,r.value=`all`,a.value=``}},{key:`hmr`,label:`HMR`,description:`观察热更新相关事件`,apply(){t.value=`hmr`,n.value=`all`,r.value=`all`,a.value=``}}],c=g(()=>[{value:`all`,label:`全部来源`},...[...new Set(e.value.map(e=>e.source??`dashboard`).filter(Boolean))].sort((e,t)=>e.localeCompare(t,`zh-CN`)).map(e=>({value:e,label:e}))]),u=g(()=>{let o=a.value.trim().toLowerCase();return Nt(e.value.filter(e=>t.value!==`all`&&e.kind!==t.value||n.value!==`all`&&e.level!==n.value||r.value!==`all`&&(e.source??`dashboard`)!==r.value?!1:!o||$(e,o)),i.value)}),f=g(()=>{let e=u.value.filter(e=>typeof e.durationMs==`number`),i=e.length>0?Math.round(e.reduce((e,t)=>e+(t.durationMs??0),0)/e.length):void 0;return[{label:`筛选后事件`,value:String(u.value.length)},{label:`当前类型`,value:t.value===`all`?`全部`:A(t.value)},{label:`当前等级`,value:n.value===`all`?`全部`:j(n.value)},{label:`当前来源`,value:r.value===`all`?`全部`:r.value},{label:`搜索关键字`,value:a.value.trim()||`未设置`},{label:`筛选平均耗时`,value:N(i)}]}),p=g(()=>ee(te(u.value))),m=g(()=>At(u.value)),h=g(()=>u.value.find(e=>e.id===o.value)??u.value[0]??null),_=g(()=>s.find(e=>e.key===`issues`?t.value===`all`&&n.value===`warning`&&r.value===`all`&&a.value===``:e.key===`commands`?t.value===`command`&&n.value===`all`&&r.value===`all`&&a.value===``:e.key===`hmr`?t.value===`hmr`&&n.value===`all`&&r.value===`all`&&a.value===``:t.value===`all`&&n.value===`all`&&r.value===`all`&&a.value===``)?.description??``);return l(u,e=>{if(e.length===0){o.value=null;return}e.some(e=>e.id===o.value)||(o.value=e[0]?.id??null)},{immediate:!0}),{eventKindFilter:t,eventKindOptions:jt,eventLevelFilter:n,eventLevelOptions:Mt,eventSortMode:i,eventSourceFilter:r,eventSourceOptions:c,filteredEventSummary:f,filteredRuntimeEvents:u,filterPresets:s,incidentDigest:m,presetDescription:_,searchQuery:a,selectedEvent:h,selectedEventId:o,sourceBreakdown:p}}var Ft={class:`grid h-full min-h-0 gap-3 overflow-hidden xl:grid-cols-[minmax(0,1.25fr)_minmax(22rem,0.75fr)]`},It={class:`grid h-full min-h-0 grid-rows-[minmax(0,9rem)_auto_minmax(6rem,1fr)] gap-3 overflow-hidden`},Lt={class:`grid min-h-0 gap-2 overflow-y-auto pr-1 text-sm leading-6 text-(--dashboard-text-muted)`},Rt=t({__name:`activity`,setup(e){let{diagnostics:t,eventSummary:n,runtimeEvents:r}=ne(),{eventKindFilter:i,eventKindOptions:a,eventLevelFilter:c,eventLevelOptions:l,eventSortMode:d,eventSourceFilter:p,eventSourceOptions:g,filteredEventSummary:v,filteredRuntimeEvents:y,filterPresets:x,incidentDigest:C,presetDescription:D,searchQuery:O,selectedEvent:k,selectedEventId:A,sourceBreakdown:j}=Pt(r);return(e,M)=>(_(),T(`div`,Ft,[u(I,{eyebrow:`Event Feed`,title:`事件控制台`,"icon-name":`hero-commands`,"content-class":`min-h-0 overflow-hidden`},{default:E(()=>[h(`div`,It,[u(_t,{class:`min-h-0 overflow-y-auto`,"search-query":o(O),"preset-description":o(D),"filter-presets":o(x),"event-kind-options":o(a),"event-level-options":o(l),"event-source-options":o(g),"event-kind-filter":o(i),"event-level-filter":o(c),"event-source-filter":o(p),"onUpdate:searchQuery":M[0]||=e=>O.value=e,"onUpdate:eventKindFilter":M[1]||=e=>i.value=e,"onUpdate:eventLevelFilter":M[2]||=e=>c.value=e,"onUpdate:eventSourceFilter":M[3]||=e=>p.value=e,onApplyPreset:M[4]||=e=>o(x).find(t=>t.key===e)?.apply()},null,8,[`search-query`,`preset-description`,`filter-presets`,`event-kind-options`,`event-level-options`,`event-source-options`,`event-kind-filter`,`event-level-filter`,`event-source-filter`]),u(K,{modelValue:o(d),"onUpdate:modelValue":M[5]||=e=>f(d)?d.value=e:null,events:o(y),"filtered-count":o(y).length,"total-count":o(r).length},null,8,[`modelValue`,`events`,`filtered-count`,`total-count`]),o(y).length===0?(_(),m(R,{key:0,as:`p`},{default:E(()=>[...M[6]||=[w(` 当前过滤条件下没有匹配事件。 `,-1)]]),_:1})):S(``,!0),h(`ul`,Lt,[(_(!0),T(b,null,s(o(y),e=>(_(),m(bt,{key:e.id,event:e,selected:o(k)?.id===e.id,onClick:t=>A.value=e.id},null,8,[`event`,`selected`,`onClick`]))),128))])])]),_:1}),u(nt,{"selected-event":o(k),"incident-digest":o(C),"event-summary":o(n),"filtered-event-summary":o(v),diagnostics:o(t),"source-breakdown":o(j)},null,8,[`selected-event`,`incident-digest`,`event-summary`,`filtered-event-summary`,`diagnostics`,`source-breakdown`])]))}});export{Rt as default};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./monaco.css"])))=>i.map(i=>d[i]);
2
- import{A as e,C as t,K as n,L as r,M as i,N as a,P as o,R as s,S as c,T as l,U as u,W as d,X as f,_ as p,a as ee,c as m,g as h,h as g,i as _,j as v,k as y,n as te,p as b,q as x,r as S,s as C,t as w,v as T,x as E,y as D,z as O}from"./vue.js";import{n as ne,t as k}from"./vendor.js";import{Rt as A}from"./monaco.js";function re(e,t){if(e){if(Array.isArray(e)){for(let n of e)re(n,t);return}if(typeof e==`object`){for(let[n,r]of Object.entries(e))r&&t.push(n);return}t.push(String(e))}}function j(...e){let t=[];for(let n of e)re(n,t);return ne(t.join(` `))}var M=t({__name:`DashboardIcon`,props:{name:{}},setup(e){let t=e,n={"theme-system":`icon-[mdi--theme-light-dark]`,"theme-light":`icon-[mdi--white-balance-sunny]`,"theme-dark":`icon-[mdi--moon-waning-crescent]`,"nav-menu":`icon-[mdi--menu]`,"nav-home":`icon-[mdi--view-grid-outline]`,"nav-analyze":`icon-[mdi--chart-box-outline]`,"nav-activity":`icon-[mdi--timeline-text-outline]`,"nav-tokens":`icon-[mdi--palette-outline]`,"tab-overview":`icon-[mdi--view-dashboard-outline]`,"tab-packages":`icon-[mdi--package-variant-closed]`,"tab-modules":`icon-[mdi--vector-link]`,"tab-source":`icon-[mdi--source-branch]`,"status-dark":`icon-[mdi--circle-slice-8]`,"status-light":`icon-[mdi--checkbox-blank-circle]`,"status-live":`icon-[mdi--motion-play-outline]`,"metric-packages":`icon-[mdi--package-variant]`,"metric-subpackages":`icon-[mdi--layers-triple-outline]`,"metric-chunks":`icon-[mdi--chart-tree]`,"metric-assets":`icon-[mdi--file-document-multiple-outline]`,"metric-size-outline":`icon-[mdi--database-outline]`,"metric-modules":`icon-[mdi--cube-outline]`,"metric-duplicates":`icon-[mdi--vector-link]`,"metric-sources":`icon-[mdi--source-branch]`,"metric-copy":`icon-[mdi--content-copy]`,"metric-time":`icon-[mdi--clock-outline]`,"metric-entries":`icon-[mdi--export-variant]`,"metric-size":`icon-[mdi--database]`,treemap:`icon-[mdi--chart-box-outline]`,"top-files":`icon-[mdi--file-star-outline]`,subpackages:`icon-[mdi--layers-triple-outline]`,"duplicate-modules":`icon-[mdi--vector-link]`,"module-sources":`icon-[mdi--source-branch]`,"file-samples":`icon-[mdi--file-document-outline]`,"hero-workspace":`icon-[mdi--view-quilt-outline]`,"hero-commands":`icon-[mdi--console-line]`,"hero-system":`icon-[mdi--shape-outline]`,"metric-ready":`icon-[mdi--rocket-launch-outline]`,"metric-health":`icon-[mdi--heart-pulse]`,"metric-latency":`icon-[mdi--timer-sand]`,"metric-quality":`icon-[mdi--shield-check-outline]`,"metric-search":`icon-[mdi--magnify]`,"metric-history":`icon-[mdi--history]`,"metric-bookmark":`icon-[mdi--bookmark-check-outline]`,"metric-link":`icon-[mdi--link-variant]`,"metric-reset":`icon-[mdi--restore]`,"token-color":`icon-[mdi--palette-outline]`,"token-surface":`icon-[mdi--card-bulleted-outline]`,"token-type":`icon-[mdi--format-letter-spacing]`},r=g(()=>n[t.name]??`icon-[mdi--file-document-multiple-outline]`);return(e,t)=>(v(),D(`span`,{class:x([`h-full w-full`,r.value])},null,2))}}),ie={class:`grid gap-2 overflow-y-auto pr-1`},ae={class:`flex items-start gap-3`},oe={class:`h-5 w-5`},se={class:`min-w-0`},ce={class:`font-medium text-(--dashboard-text)`},le={key:0,class:`ml-5 grid gap-1 border-l border-(--dashboard-border) pl-3`},ue={class:`h-4 w-4 shrink-0`},de={class:`min-w-0 truncate`},N=t({__name:`AppNavigationList`,props:{currentAnalyzeTab:{},currentPath:{},items:{},mobile:{type:Boolean,default:!1}},emits:[`navigate`],setup(e,{emit:t}){let r=e,i=t;function o(e){return e===`/`?r.currentPath===`/`:r.currentPath===e||r.currentPath.startsWith(`${e}/`)}function s(e){let t=e.indexOf(`?`);return t===-1?`overview`:new URLSearchParams(e.slice(t+1)).get(`tab`)??`overview`}function l(e){return e.startsWith(`/analyze`)?r.currentPath===`/analyze`&&s(e)===r.currentAnalyzeTab:o(e)}function u(e){return o(e.to)||!!e.children?.some(e=>l(e.to))}return(t,r)=>(v(),D(`nav`,ie,[(v(!0),D(b,null,a(e.items,t=>(v(),D(`div`,{key:t.to,class:`grid gap-1`},[c(n(w),{to:t.to,class:x(n(j)(`group rounded-md border px-3 py-3 transition`,u(t)?`border-(--dashboard-border-strong) bg-(--dashboard-panel-strong) shadow-(--dashboard-shadow)`:`border-(--dashboard-border) bg-(--dashboard-panel-muted) hover:border-(--dashboard-border-strong) hover:bg-(--dashboard-panel)`)),onClick:r[0]||=e=>i(`navigate`)},{default:O(()=>[h(`div`,ae,[h(`span`,{class:x(n(j)(`flex h-10 w-10 shrink-0 items-center justify-center rounded-md`,u(t)?`bg-(--dashboard-accent-soft) text-(--dashboard-accent)`:`bg-(--dashboard-panel) text-(--dashboard-text-soft) group-hover:text-(--dashboard-accent)`))},[h(`span`,oe,[c(M,{name:t.iconName},null,8,[`name`])])],2),h(`div`,se,[h(`p`,ce,f(t.label),1),h(`p`,{class:x([`text-xs leading-5 text-(--dashboard-text-soft)`,e.mobile?`mt-1`:`mt-0.5 truncate`])},f(t.caption),3)])])]),_:2},1032,[`to`,`class`]),t.children?.length&&u(t)?(v(),D(`div`,le,[(v(!0),D(b,null,a(t.children,e=>(v(),p(n(w),{key:e.to,to:e.to,class:x(n(j)(`group flex min-w-0 items-center gap-2 rounded-md px-2.5 py-2 text-sm transition`,l(e.to)?`bg-(--dashboard-accent-soft) text-(--dashboard-accent)`:`text-(--dashboard-text-soft) hover:bg-(--dashboard-panel-muted) hover:text-(--dashboard-text)`)),onClick:r[1]||=e=>i(`navigate`)},{default:O(()=>[h(`span`,ue,[c(M,{name:e.iconName},null,8,[`name`])]),h(`span`,de,f(e.label),1)]),_:2},1032,[`to`,`class`]))),128))])):T(``,!0)]))),128))]))}}),fe={key:0,class:`mr-1.5 h-4 w-4 text-(--dashboard-accent)`},P=t({__name:`AppInfoPill`,props:{label:{},iconName:{},uppercase:{type:Boolean}},setup(e){return(t,n)=>(v(),D(`span`,{class:x([`inline-flex items-center rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-2.5 py-1 text-xs font-medium text-(--dashboard-text-soft)`,e.uppercase?`tracking-[0.18em] uppercase`:void 0])},[e.iconName?(v(),D(`span`,fe,[c(M,{name:e.iconName},null,8,[`name`])])):T(``,!0),E(` `+f(e.label),1)],2))}}),pe={class:`flex flex-col gap-3 rounded-lg border border-(--dashboard-border-strong) bg-(--dashboard-panel-strong) px-4 py-3 shadow-(--dashboard-shadow) md:px-5`},me={class:`flex items-start justify-between gap-3`},he={class:`flex items-start gap-3`},ge={class:`h-5 w-5`},_e={class:`mt-1 text-2xl font-semibold tracking-tight md:text-[1.8rem]`},ve={key:0,class:`mt-1 max-w-3xl text-sm leading-6 text-(--dashboard-text-muted)`},ye={key:0,class:`hidden items-center gap-2 rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2 text-xs font-medium text-(--dashboard-text-soft) md:inline-flex`,for:`dashboard-global-theme`},be={class:`h-4 w-4 text-(--dashboard-accent)`},xe=[`value`],Se=[`value`],Ce={class:`flex flex-wrap items-center gap-2 md:hidden`},we={key:0,class:`inline-flex items-center gap-2 rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2 text-xs font-medium text-(--dashboard-text-soft)`,for:`dashboard-mobile-theme`},Te={class:`h-4 w-4 text-(--dashboard-accent)`},Ee=[`value`],De=[`value`],Oe=t({__name:`AppShellHeader`,props:{title:{},description:{},themeOptions:{},themePreference:{}},emits:[`menu`,`setTheme`],setup(e,{emit:t}){let n=e,r=t,i=g(()=>n.themeOptions.find(e=>e.value===n.themePreference)?.iconName??`theme-system`),o=g(()=>n.themeOptions.length>0);function s(e){r(`setTheme`,e.target.value)}return(t,n)=>(v(),D(`header`,pe,[h(`div`,me,[h(`div`,he,[h(`button`,{class:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text) md:hidden`,type:`button`,onClick:n[0]||=e=>r(`menu`)},[h(`span`,ge,[c(M,{name:`nav-menu`})])]),h(`div`,null,[n[1]||=h(`p`,{class:`text-[11px] uppercase tracking-[0.28em] text-(--dashboard-accent)`},` weapp-vite dashboard `,-1),h(`h1`,_e,f(e.title),1),e.description?(v(),D(`p`,ve,f(e.description),1)):T(``,!0)])]),o.value?(v(),D(`label`,ye,[h(`span`,be,[c(M,{name:i.value},null,8,[`name`])]),h(`select`,{id:`dashboard-global-theme`,class:`min-w-32 bg-transparent text-(--dashboard-text) outline-none`,value:e.themePreference,onChange:s},[(v(!0),D(b,null,a(e.themeOptions,e=>(v(),D(`option`,{key:e.value,value:e.value},f(e.label),9,Se))),128))],40,xe)])):T(``,!0)]),h(`div`,Ce,[o.value?(v(),D(`label`,we,[h(`span`,Te,[c(M,{name:i.value},null,8,[`name`])]),h(`select`,{id:`dashboard-mobile-theme`,class:`min-w-32 bg-transparent text-(--dashboard-text) outline-none`,value:e.themePreference,onChange:s},[(v(!0),D(b,null,a(e.themeOptions,e=>(v(),D(`option`,{key:e.value,value:e.value},f(e.label),9,De))),128))],40,Ee)])):T(``,!0),o.value?(v(),p(P,{key:1,"icon-name":`status-live`,label:`shell ready`,uppercase:``})):T(``,!0)])]))}}),F=k({base:`flex flex-col rounded-lg border shadow-(--dashboard-shadow)`,variants:{tone:{default:`border-(--dashboard-border) bg-(--dashboard-panel)`,strong:`border-(--dashboard-border-strong) bg-(--dashboard-panel-strong)`,muted:`border-(--dashboard-border) bg-(--dashboard-panel-muted)`},padding:{none:``,sm:`p-3`,md:`p-4`,header:`px-4 py-4 md:px-5`}},defaultVariants:{tone:`default`,padding:`md`}}),I=k({base:`flex items-center justify-center rounded-md bg-(--dashboard-accent-soft) text-(--dashboard-accent)`,variants:{size:{sm:`h-8 w-8`,md:`h-9 w-9`,lg:`h-10 w-10`}},defaultVariants:{size:`md`}}),ke=k({base:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted)`,variants:{padding:{sm:`px-4 py-3`,md:`p-4`},interactive:{true:`transition hover:border-(--dashboard-border-strong) hover:bg-(--dashboard-panel)`,false:``}},defaultVariants:{padding:`md`,interactive:!1}}),Ae=k({base:`inline-flex items-center gap-2 rounded-full border transition`,variants:{kind:{nav:`px-3.5 py-1.5 text-sm`,theme:`px-3 py-1.5 text-xs font-medium`,badge:`px-2.5 py-1 text-[11px] uppercase tracking-[0.18em]`},active:{true:`border-(--dashboard-accent) bg-(--dashboard-accent-soft) text-(--dashboard-text)`,false:`border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text-soft) hover:border-(--dashboard-border-strong) hover:text-(--dashboard-text)`}},defaultVariants:{kind:`nav`,active:!1}}),je=k({base:`rounded-full border px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.16em]`,variants:{tone:{neutral:`border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text-soft)`,info:`border-(--dashboard-border-strong) bg-(--dashboard-accent-soft) text-(--dashboard-accent)`,success:`border-emerald-200 bg-emerald-100 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/12 dark:text-emerald-300`,warning:`border-amber-200 bg-amber-100 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/12 dark:text-amber-300`,error:`border-rose-200 bg-rose-100 text-rose-700 dark:border-rose-500/30 dark:bg-rose-500/12 dark:text-rose-300`}},defaultVariants:{tone:`neutral`}});k({base:`rounded-lg border border-(--dashboard-border) bg-(--dashboard-panel) px-4 py-3 text-[11px] uppercase tracking-[0.24em] text-(--dashboard-text-soft) shadow-(--dashboard-shadow)`});var Me={key:0,class:`flex items-start justify-between gap-4`},Ne={class:`flex min-w-0 items-start gap-3`},Pe={class:`h-5 w-5`},Fe={class:`min-w-0`},Ie={key:0,class:`text-[11px] uppercase tracking-[0.24em] text-(--dashboard-accent)`},Le={key:1,class:`text-lg font-semibold tracking-tight`},Re={key:2,class:`mt-1 text-sm leading-6 text-(--dashboard-text-muted)`},L=t({__name:`AppSurfaceCard`,props:{title:{default:void 0},description:{default:void 0},eyebrow:{default:void 0},iconName:{default:void 0},tone:{default:`default`},padding:{default:`md`},contentClass:{default:``}},setup(e){let t=e,i=r(),a=!!(t.title||t.description||i.header);return(t,r)=>(v(),D(`section`,{class:x(n(j)(n(F)({tone:e.tone,padding:e.padding}),e.contentClass))},[n(a)?(v(),D(`header`,Me,[h(`div`,Ne,[e.iconName?(v(),D(`span`,{key:0,class:x([n(I)({size:`md`}),`shrink-0`])},[h(`span`,Pe,[c(M,{name:e.iconName},null,8,[`name`])])],2)):T(``,!0),h(`div`,Fe,[e.eyebrow?(v(),D(`p`,Ie,f(e.eyebrow),1)):T(``,!0),e.title?(v(),D(`h2`,Le,f(e.title),1)):T(``,!0),e.description?(v(),D(`p`,Re,f(e.description),1)):T(``,!0)])]),o(t.$slots,`header`)])):T(``,!0),h(`div`,{class:x(n(j)(`min-h-0 flex-1`,n(a)?`mt-4`:``))},[o(t.$slots,`default`)],2)],2))}}),R=`weapp-vite-dashboard-theme`;function ze(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(R);return e===`light`||e===`dark`||e===`system`?e:`system`}function Be(e,t){return e===`light`||e===`dark`?e:t?.matches?`dark`:`light`}function z(){let t=u(ze()),n=typeof window<`u`?window.matchMedia(`(prefers-color-scheme: dark)`):null,r=g(()=>Be(t.value,n)),i=e=>{typeof document>`u`||(document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e)},a=e=>{typeof window>`u`||window.localStorage.setItem(R,e)},o=()=>{i(r.value)};return s(t,e=>{a(e),i(r.value)},{immediate:!0}),e(()=>{n?.addEventListener(`change`,o),i(r.value)}),y(()=>{n?.removeEventListener(`change`,o)}),{themePreference:t,resolvedTheme:r,setThemePreference(e){t.value=e}}}var B=Symbol(`dashboard-theme`);function Ve(e){i(B,e)}function He(){return l(B,null)||z()}var V=`weapp-vite-dashboard:analyze-result-history`;function Ue(e){return e.toLocaleString(`zh-CN`,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function H(e){return e?JSON.stringify({packages:e.packages,modules:e.modules,subPackages:e.subPackages,budgets:e.metadata?.budgets}):``}function U(e,t){return H(e)===H(t)}function W(e){return e.packages.flatMap(e=>e.files).reduce((e,t)=>e+(t.size??0),0)}function We(e){return e.packages.flatMap(e=>e.files).reduce((e,t)=>e+(t.brotliSize??t.gzipSize??Math.round((t.size??0)*.32)),0)}function Ge(e,t){let n=W(e);return`${Date.parse(t).toString(36)}-${n.toString(36)}-${e.modules.length.toString(36)}`}function G(e,t=new Date().toISOString()){let n=e.modules.filter(e=>e.packages.length>1).length;return{id:Ge(e,t),capturedAt:t,label:Ue(new Date(t)),result:e,totalBytes:W(e),compressedBytes:We(e),packageCount:e.packages.length,moduleCount:e.modules.length,duplicateCount:n}}function Ke(e){let t=[...e.snapshots??[]];e.previous&&t.push(G(e.previous)),t.push(G(e.current));let n=new Map;for(let e of t){let t=H(e.result);n.has(t)||n.set(t,e)}return[...n.values()].sort((e,t)=>Date.parse(t.capturedAt)-Date.parse(e.capturedAt)).slice(0,12)}function qe(){try{let e=window.localStorage.getItem(V);if(!e)return null;let t=JSON.parse(e);return!t?.current?.packages||!Array.isArray(t.current.packages)?null:{current:t.current,previous:t.previous?.packages?t.previous:null,snapshots:Array.isArray(t.snapshots)?t.snapshots.filter(e=>e?.result?.packages&&Array.isArray(e.result.packages)):void 0,baselineSnapshotId:typeof t.baselineSnapshotId==`string`?t.baselineSnapshotId:null,comparisonMode:t.comparisonMode===`baseline`?`baseline`:`previous`}}catch{return null}}function K(e){try{window.localStorage.setItem(V,JSON.stringify(e))}catch{}}function Je(e,t,n){return t||(e&&n?.current&&!U(e,n.current)?n.current:n?.previous??null)}var Ye=[{value:`system`,label:`跟随系统`,iconName:`theme-system`},{value:`light`,label:`亮色`,iconName:`theme-light`},{value:`dark`,label:`暗色`,iconName:`theme-dark`}],Xe=[{key:`overview`,label:`总览`,iconName:`tab-overview`},{key:`diagnostics`,label:`诊断`,iconName:`metric-health`},{key:`review`,label:`评审清单`,iconName:`metric-bookmark`},{key:`treemap`,label:`体积地图`,iconName:`treemap`},{key:`files`,label:`文件详情`,iconName:`top-files`},{key:`source`,label:`源码对比`,iconName:`tab-source`},{key:`packages`,label:`包与产物`,iconName:`tab-packages`},{key:`modules`,label:`模块与复用`,iconName:`tab-modules`}],Ze=[{value:`all`,label:`全部`},{value:`growth`,label:`增长`},{value:`duplicates`,label:`重复`},{value:`node_modules`,label:`依赖`},{value:`source`,label:`业务`},{value:`selected-package`,label:`当前包`}],q=[{to:`/`,label:`工作台`,caption:`应用入口与状态总览`,iconName:`nav-home`},{to:`/analyze`,label:`分析视图`,caption:`包体、模块与分包结构`,iconName:`nav-analyze`,children:Xe.map(e=>({to:e.key===`overview`?`/analyze`:`/analyze?tab=${e.key}`,label:e.label,caption:e.key===`overview`?`全局摘要和建议动作`:e.key===`diagnostics`?`预算、增量和历史基线`:e.key===`review`?`PR 风险和评审清单`:e.key===`treemap`?`产物体积地图`:e.key===`files`?`文件、预算和模块明细`:e.key===`source`?`源码与产物 Diff`:e.key===`packages`?`包体和产物列表`:`模块复用与来源`,iconName:e.iconName}))},{to:`/activity`,label:`活动流`,caption:`命令、诊断与运行事件`,iconName:`nav-activity`},{to:`/tokens`,label:`设计令牌`,caption:`主题、表面与组件状态`,iconName:`nav-tokens`}],Qe=[{label:`启动开发`,command:`pnpm --filter @weapp-vite/dashboard dev`,note:`本地预览完整 UI 壳子`,category:`dev`},{label:`生产构建`,command:`pnpm --filter @weapp-vite/dashboard build`,note:`验证静态产物可发布`,category:`build`},{label:`主包联调`,command:`weapp-vite build --ui`,note:`从 CLI 注入真实分析数据`,category:`analyze`}],$e=["`analyze` payload 契约保持兼容,CLI 注入无需迁移。",`工作台可在无 payload 状态下展示稳定空态和示例事件。`,`主题偏好在应用级共享,页面之间状态一致。`],et=[{time:`09:12`,title:`analyze payload synced`,summary:`CLI 已把最新构建结果注入 dashboard,全局状态已完成一次同步。`,tone:`live`},{time:`09:26`,title:`workspace shell extended`,summary:`工作台、活动流、设计令牌已经拆成独立页面。`,tone:`default`},{time:`10:03`,title:`theme system unified`,summary:`主题偏好收敛到应用根部,所有页面共享同一套明暗模式。`,tone:`default`}],tt=[{label:`CLI 注入链路`,detail:"保留 `window.__WEAPP_VITE_ANALYZE_RESULT__` 兼容层。",status:`兼容`},{label:`路由拓展性`,detail:`页面采用文件路由,主路由表保持稳定。`,status:`可扩展`},{label:`组件复用`,detail:`通用卡片与区块标题已独立,避免页面继续拷贝结构。`,status:`已落地`},{label:`视觉令牌`,detail:`颜色、表面、排版预览集中在 tokens 页面统一检查。`,status:`可验证`}],nt=[{id:`evt-command-build-ui`,kind:`command`,level:`success`,title:`build --ui completed`,detail:`示例事件: dashboard 已经准备好承接来自 CLI 的真实命令生命周期事件。`,timestamp:`10:18:12`,source:`cli`,durationMs:842,tags:[`build`,`ui`]},{id:`evt-hmr-shell`,kind:`hmr`,level:`info`,title:`workspace shell hot updated`,detail:`工作台页面已完成一次热更新并记录到事件流。`,timestamp:`10:19:44`,source:`vite-hmr`,tags:[`hmr`,`shell`]},{id:`evt-diagnostic-payload`,kind:`diagnostic`,level:`warning`,title:`analyze payload pending`,detail:`当前页面支持在没有 payload 时进入空态。`,timestamp:`10:20:07`,source:`dashboard`,tags:[`diagnostic`]}],rt=[{title:`Accent`,iconName:`token-color`,tokens:[{name:`--dashboard-accent`,sample:`var(--dashboard-accent)`},{name:`--dashboard-accent-soft`,sample:`var(--dashboard-accent-soft)`},{name:`--dashboard-border-strong`,sample:`var(--dashboard-border-strong)`}]},{title:`Surfaces`,iconName:`token-surface`,tokens:[{name:`--dashboard-panel`,sample:`var(--dashboard-panel)`},{name:`--dashboard-panel-strong`,sample:`var(--dashboard-panel-strong)`},{name:`--dashboard-panel-muted`,sample:`var(--dashboard-panel-muted)`}]},{title:`Typography`,iconName:`token-type`,tokens:[{name:`--dashboard-text`,sample:`var(--dashboard-text)`},{name:`--dashboard-text-muted`,sample:`var(--dashboard-text-muted)`},{name:`--dashboard-text-soft`,sample:`var(--dashboard-text-soft)`}]}];function J(e){if(!e||Number.isNaN(e))return`—`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=e,i=0;for(;r>=t&&i<n.length-1;)r/=t,i++;return`${r.toFixed(r>=100||i===0?0:2)} ${n[i]}`}function it(e,t=``,n=``){if(!e||Number.isNaN(e)||e<=0)return 0;let r=t.toLowerCase().split(`.`).pop()??``,i=new Set([`cjs`,`css`,`html`,`js`,`json`,`map`,`mjs`,`svg`,`txt`,`wxml`,`wxss`,`xml`]),a=new Set([`avif`,`br`,`gif`,`gz`,`jpeg`,`jpg`,`mp3`,`mp4`,`ogg`,`otf`,`png`,`webp`,`woff`,`woff2`,`zip`]);return i.has(r)?Math.max(1,Math.round(e*.34)):a.has(r)?Math.max(1,Math.round(e*.92)):n===`chunk`?Math.max(1,Math.round(e*.38)):Math.max(1,Math.round(e*.72))}function at(e){switch(e){case`main`:return`主包`;case`subPackage`:return`分包`;case`independent`:return`独立分包`;case`virtual`:return`虚拟包`;default:return e}}function ot(e){return e===`independent`?`独立构建`:`主构建`}function st(e){switch(e){case`src`:return`业务源码`;case`workspace`:return`工作区包`;case`plugin`:return`插件`;case`node_modules`:return`依赖`;default:return e}}function ct(e){switch(e){case`command`:return`命令`;case`build`:return`构建`;case`diagnostic`:return`诊断`;case`hmr`:return`HMR`;case`system`:return`系统`;default:return e}}function lt(e){switch(e){case`info`:return`信息`;case`success`:return`成功`;case`warning`:return`警告`;case`error`:return`错误`;default:return e}}function ut(e){return e??`dashboard`}function dt(e){return e}function ft(e){return{label:lt(e.level),tone:dt(e.level)}}function pt(e){return e>0?`error`:`info`}function mt(e){return{label:e.latestTimestamp?`${e.count} 条`:`错误 ${e.errorCount}`,tone:pt(e.errorCount)}}function Y(e){return typeof e!=`number`||Number.isNaN(e)||e<0?`未记录`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?1:2)} s`:`${e} ms`}function ht(e){let t=[ct(e.kind),ut(e.source),e.timestamp];return typeof e.durationMs==`number`&&Number.isFinite(e.durationMs)&&e.durationMs>=0&&t.push(Y(e.durationMs)),t.join(` · `)}function X(e,t){return{label:e,value:t}}function gt(){return new Date().toLocaleTimeString(`zh-CN`,{hour12:!1})}function _t(e){if(!e)return{packageCount:0,moduleCount:0,duplicateCount:0,totalBytes:0};let t=e.packages.flatMap(e=>e.files);return{packageCount:e.packages.length,moduleCount:e.modules.length,duplicateCount:e.modules.filter(e=>e.packages.length>1).length,totalBytes:t.reduce((e,t)=>e+(t.size??0),0)}}function vt(e){let t=e.filter(e=>e.level===`error`).length,n=e.filter(e=>e.level===`warning`).length,r=e.filter(e=>e.kind===`command`).length,i=e.filter(e=>typeof e.durationMs==`number`),a=i.length>0?Math.round(i.reduce((e,t)=>e+(t.durationMs??0),0)/i.length):void 0;return[X(`总事件数`,String(e.length)),X(`命令事件`,String(r)),X(`已记录耗时`,String(i.length)),X(`平均耗时`,Y(a)),X(`警告事件`,String(n)),X(`错误事件`,String(t))]}function yt(e){return[{label:`页面骨架`,value:`4 个`,iconName:`metric-ready`},{label:`连接状态`,value:e.result?`已接入 payload`:`等待注入`,iconName:e.result?`status-live`:`metric-health`},{label:`数据同步`,value:`${e.updateCount} 次`,iconName:`metric-latency`},{label:`产物体积`,value:e.result?J(e.summary.totalBytes):`未载入`,iconName:`metric-quality`},{label:`运行事件`,value:`${e.runtimeEventCount} 条`,iconName:e.latestRuntimeEvent?.level===`error`?`metric-health`:`metric-time`}]}function bt(e){return e.result?[{label:`重新分析当前工程`,command:`weapp-vite analyze`,note:`最近同步于 ${e.lastUpdatedAt},当前可读取 ${e.summary.packageCount} 个包。`,category:`analyze`},{label:`进入构建联调`,command:`weapp-vite build --ui`,note:`当前产物总体积 ${J(e.summary.totalBytes)},适合继续核对 chunk 结构。`,category:`build`},{label:`观察开发态更新`,command:`weapp-vite dev --ui`,note:`已记录 ${e.updateCount} 次 payload 同步,后续可继续接入更细粒度事件。`,category:`dev`}]:Qe}function xt(e){let t=[...et];for(let n of e.runtimeEvents.slice(0,4))t.unshift({time:n.timestamp,title:n.title,summary:n.detail,tone:n.level===`error`||n.level===`warning`?`default`:`live`});return e.result&&t.unshift({time:e.lastUpdatedAt,title:`workspace payload received`,summary:`已收到一份真实 analyze 结果,包含 ${e.summary.packageCount} 个包和 ${e.summary.moduleCount} 个模块。`,tone:`live`}),t}function St(e){let t=[...tt];return e.latestRuntimeEvent&&t.unshift({label:`最新运行事件`,detail:`${e.latestRuntimeEvent.title} · ${e.latestRuntimeEvent.detail}`,status:e.latestRuntimeEvent.level}),e.result?[{label:`实时分析状态`,detail:`已接入 payload,当前记录 ${e.summary.duplicateCount} 个跨包复用模块。`,status:`在线`},{label:`产物规模`,detail:`总产物体积 ${J(e.summary.totalBytes)},可继续进入分析页查看 treemap 与最大文件。`,status:`可分析`},...t]:[{label:`CLI 注入链路`,detail:`尚未接收到 analyze payload,当前页面以空态方式工作。`,status:`待接入`},...t]}var Ct=Symbol(`dashboard-workspace`),wt=[`command`,`build`,`diagnostic`,`hmr`,`system`],Tt=[`info`,`success`,`warning`,`error`];function Et(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Dt(e){return typeof e==`string`&&wt.includes(e)?e:`system`}function Ot(e){return typeof e==`string`&&Tt.includes(e)?e:`info`}function Z(e,t){return typeof e==`string`&&e.trim()?e:t}function kt(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function At(e){if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&e.trim()).map(e=>String(e));return t.length>0?t:void 0}function jt(e,t){return{id:Z(e.id,`dashboard-runtime-event-${t}`),kind:Dt(e.kind),level:Ot(e.level),title:Z(e.title,`untitled event`),detail:Z(e.detail,`no event detail`),timestamp:Z(e.timestamp,`—`),source:Z(e.source,`dashboard`),durationMs:kt(e.durationMs),tags:At(e.tags)}}function Mt(e){return{count:1,errorCount:+(e.level===`error`),latestTimestamp:e.timestamp,durationTotal:e.durationMs??0,timedCount:+(typeof e.durationMs==`number`)}}function Nt(e,t){return{count:e.count+1,errorCount:e.errorCount+ +(t.level===`error`),latestTimestamp:e.latestTimestamp,durationTotal:e.durationTotal+(t.durationMs??0),timedCount:e.timedCount+ +(typeof t.durationMs==`number`)}}function Pt(e,t){return{source:e,count:t.count,errorCount:t.errorCount,latestTimestamp:t.latestTimestamp,averageDurationMs:t.timedCount>0?Math.round(t.durationTotal/t.timedCount):void 0}}function Ft(e){return{...e,averageDuration:Y(e.averageDurationMs)}}function It(e,t){return Et(e)?jt(e,t):null}function Q(e){let t=(Array.isArray(e)?e:[e]).map((e,t)=>It(e,t)).filter(e=>!!e),n=new Map;for(let e of t)n.set(e.id,e);return[...n.values()]}function $(e){let t=new Map;for(let n of e){let e=n.source??`dashboard`,r=t.get(e);if(!r){t.set(e,Mt(n));continue}t.set(e,Nt(r,n))}return Array.from(t,([e,t])=>Pt(e,t)).sort((e,t)=>t.count-e.count||e.source.localeCompare(t.source,`zh-CN`))}function Lt(e){return e.map(e=>Ft(e))}function Rt(){return window.__WEAPP_VITE_DASHBOARD_EVENTS__?.length?Q(window.__WEAPP_VITE_DASHBOARD_EVENTS__):Q(nt)}function zt(t){let n=g(()=>t.value[0]??null),r=g(()=>vt(t.value)),i=g(()=>$(t.value)),a=e=>{let n=Q(e);if(n.length===0)return;let r=[...n,...t.value],i=new Map;for(let e of r)i.set(e.id,e);t.value=[...i.values()].slice(0,24),window.__WEAPP_VITE_DASHBOARD_EVENTS__=[...t.value]},o=e=>{let t=e instanceof CustomEvent?e.detail:null;a(Array.isArray(t)?t:t?[t]:null)};return e(()=>{window.addEventListener(`weapp-dashboard:event`,o),a(window.__WEAPP_VITE_DASHBOARD_EVENTS__)}),y(()=>{window.removeEventListener(`weapp-dashboard:event`,o)}),{eventSummary:r,latestRuntimeEvent:n,runtimeSourceSummary:i}}function Bt(){let t=window.__WEAPP_VITE_ANALYZE_RESULT__??null,n=window.__WEAPP_VITE_PREVIOUS_ANALYZE_RESULT__??null,r=qe(),i=d(t),a=d(Je(t,n,r)),o=d(r?Ke(r):t?[G(t)]:[]),s=d(r?.baselineSnapshotId&&o.value.some(e=>e.id===r.baselineSnapshotId)?r.baselineSnapshotId:null),c=d(r?.comparisonMode===`baseline`&&s.value?`baseline`:`previous`),l=d(Rt()),u=d(0),f=d(i.value?gt():`—`);t&&K({current:t,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value});let p=g(()=>_t(i.value)),{eventSummary:ee,latestRuntimeEvent:m,runtimeSourceSummary:h}=zt(l),_=g(()=>i.value?`payload ready`:`awaiting payload`),v=g(()=>i.value?`${p.value.packageCount} 个包 · ${p.value.moduleCount} 个模块`:`尚未接收到 CLI analyze 数据`),te=g(()=>o.value.find(e=>e.id===s.value)??null),b=g(()=>c.value===`baseline`?te.value?.result??a.value:a.value),x=g(()=>yt({result:i.value,updateCount:u.value,summary:p.value,runtimeEventCount:l.value.length,latestRuntimeEvent:m.value})),S=g(()=>bt({result:i.value,lastUpdatedAt:f.value,summary:p.value,updateCount:u.value})),C=g(()=>xt({runtimeEvents:l.value,result:i.value,lastUpdatedAt:f.value,summary:p.value})),w=g(()=>St({result:i.value,latestRuntimeEvent:m.value,summary:p.value})),T=()=>{let e=window.__WEAPP_VITE_ANALYZE_RESULT__;if(!e)return;let t=window.__WEAPP_VITE_PREVIOUS_ANALYZE_RESULT__??null,n=qe(),r=n?.previous??a.value;n?.current&&!U(e,n.current)&&(r=n.current),i.value&&!U(e,i.value)&&(r=i.value),t&&!U(e,t)&&(r=t),a.value=U(e,r)?null:r,i.value=e;let l=G(e),d=Ke({current:e,previous:a.value,snapshots:[l,...o.value]});o.value=d,s.value&&!d.some(e=>e.id===s.value)&&(s.value=d.at(-1)?.id??null),c.value===`baseline`&&!s.value&&(c.value=`previous`),K({current:e,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value}),u.value+=1,f.value=gt()},E=()=>{i.value&&K({current:i.value,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value})};return e(()=>{window.addEventListener(`weapp-analyze:update`,T),T()}),y(()=>{window.removeEventListener(`weapp-analyze:update`,T)}),{resultRef:i,previousResultRef:a,comparisonResultRef:b,historySnapshots:o,baselineSnapshotId:s,comparisonMode:c,updateCount:u,lastUpdatedAt:f,statusLabel:_,statusSummary:v,commandItems:S,activityItems:C,diagnostics:w,signals:x,runtimeEvents:l,latestRuntimeEvent:m,eventSummary:ee,runtimeSourceSummary:h,setBaselineSnapshot:e=>{o.value.some(t=>t.id===e)&&(s.value=e,c.value=`baseline`,E())},setComparisonMode:e=>{c.value=e===`baseline`&&!s.value?`previous`:e,E()}}}function Vt(e){i(Ct,e)}function Ht(){let e=l(Ct,null);if(!e)throw Error(`[dashboard] workspace context is not available`);return e}var Ut={class:`h-dvh overflow-hidden px-3 py-3 text-(--dashboard-text) md:px-4 md:py-4 lg:px-5`},Wt={class:`mx-auto grid h-full max-w-400 gap-3 overflow-hidden lg:grid-cols-[17rem_minmax(0,1fr)]`},Gt={class:`hidden min-h-0 overflow-hidden lg:block`},Kt={class:`grid h-full grid-rows-[minmax(0,1fr)_auto] gap-3`},qt={class:`grid min-h-0 min-w-0 grid-rows-[auto_minmax(0,1fr)] gap-3 overflow-hidden`},Jt={class:`min-h-0 overflow-hidden`},Yt={key:0,class:`fixed inset-y-3 left-3 z-50 w-[min(22rem,calc(100vw-1.5rem))] lg:hidden`},Xt=t({__name:`App`,setup(e){let t=ee(),r=u(!1),{themePreference:i,resolvedTheme:a,setThemePreference:o}=z(),l=Bt(),d=g(()=>!!l.resultRef.value),f=g(()=>typeof t.query.tab==`string`?t.query.tab:`overview`);Ve({themePreference:i,resolvedTheme:a,setThemePreference:o}),Vt(l);let p=g(()=>t.path.startsWith(`/analyze`)?{title:`Analyze Workspace`}:t.path.startsWith(`/activity`)?{title:`Activity Stream`}:t.path.startsWith(`/tokens`)?{title:`Design Tokens`}:{title:`Workspace Console`});return s(()=>t.fullPath,()=>{r.value=!1}),(e,s)=>(v(),D(`div`,Ut,[h(`div`,Wt,[h(`aside`,Gt,[h(`div`,Kt,[c(L,{eyebrow:`Shell`,title:`weapp-vite dashboard`,"icon-name":`hero-system`,tone:`strong`,"content-class":`min-h-0 overflow-hidden`},{default:O(()=>[c(N,{"current-analyze-tab":f.value,"current-path":n(t).path,items:n(q)},null,8,[`current-analyze-tab`,`current-path`,`items`])]),_:1}),c(L,{eyebrow:`Status`,title:n(l).statusLabel.value,description:n(l).statusSummary.value,"icon-name":d.value?`status-live`:n(a)===`dark`?`theme-dark`:`theme-light`,padding:`sm`},null,8,[`title`,`description`,`icon-name`])])]),h(`div`,qt,[c(Oe,{title:p.value.title,description:p.value.description,"theme-options":n(Ye),"theme-preference":n(i),onMenu:s[0]||=e=>r.value=!0,onSetTheme:n(o)},null,8,[`title`,`description`,`theme-options`,`theme-preference`,`onSetTheme`]),h(`div`,Jt,[c(n(te))])])]),c(C,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:O(()=>[r.value?(v(),D(`div`,{key:0,class:`fixed inset-0 z-40 bg-slate-950/35 backdrop-blur-sm lg:hidden`,onClick:s[1]||=e=>r.value=!1})):T(``,!0)]),_:1}),c(C,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`-translate-x-6 opacity-0`,"enter-to-class":`translate-x-0 opacity-100`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`translate-x-0 opacity-100`,"leave-to-class":`-translate-x-6 opacity-0`},{default:O(()=>[r.value?(v(),D(`aside`,Yt,[c(L,{eyebrow:`Navigation`,title:`Workspace Modules`,description:`选择要查看的工作区。`,"icon-name":`nav-menu`,tone:`strong`,"content-class":`h-full`},{default:O(()=>[c(N,{mobile:``,"current-analyze-tab":f.value,"current-path":n(t).path,items:n(q),onNavigate:s[2]||=e=>r.value=!1},null,8,[`current-analyze-tab`,`current-path`,`items`])]),_:1})])):T(``,!0)]),_:1})]))}}),Zt=S({history:_(),routes:[{path:`/`,name:`/`,component:()=>A(()=>import(`./pages.js`),[],import.meta.url)},{path:`/activity`,name:`/activity`,component:()=>A(()=>import(`./activity.js`),[],import.meta.url)},{path:`/analyze`,name:`/analyze`,component:()=>A(()=>import(`./analyze.js`),__vite__mapDeps([0]),import.meta.url)},{path:`/tokens`,name:`/tokens`,component:()=>A(()=>import(`./tokens.js`),[],import.meta.url)}]});function Qt(){let e=m(Xt);e.config.errorHandler=(e,t,n)=>{},e.use(Zt),e.mount(`#app`)}try{Qt()}catch{}export{ke as C,P as D,F as E,M as O,I as S,je as T,q as _,mt as a,He as b,J as c,ct as d,lt as f,rt as g,$e as h,ft as i,Y as l,st as m,Lt as n,it as o,ht as p,$ as r,ot as s,Ht as t,at as u,Ye as v,Ae as w,L as x,Ze as y};
2
+ import{A as e,C as t,K as n,L as r,M as i,N as a,P as o,R as s,S as c,T as l,U as u,W as d,X as f,_ as p,a as ee,c as m,g as h,h as g,i as _,j as v,k as y,n as te,p as b,q as x,r as S,s as C,t as w,v as T,x as E,y as D,z as O}from"./vue.js";import{n as ne,t as k}from"./vendor.js";import{Rt as A}from"./monaco.js";function re(e,t){if(e){if(Array.isArray(e)){for(let n of e)re(n,t);return}if(typeof e==`object`){for(let[n,r]of Object.entries(e))r&&t.push(n);return}t.push(String(e))}}function j(...e){let t=[];for(let n of e)re(n,t);return ne(t.join(` `))}var M=t({__name:`DashboardIcon`,props:{name:{}},setup(e){let t=e,n={"theme-system":`icon-[mdi--theme-light-dark]`,"theme-light":`icon-[mdi--white-balance-sunny]`,"theme-dark":`icon-[mdi--moon-waning-crescent]`,"nav-menu":`icon-[mdi--menu]`,"nav-home":`icon-[mdi--view-grid-outline]`,"nav-analyze":`icon-[mdi--chart-box-outline]`,"nav-activity":`icon-[mdi--timeline-text-outline]`,"nav-tokens":`icon-[mdi--palette-outline]`,"tab-overview":`icon-[mdi--view-dashboard-outline]`,"tab-packages":`icon-[mdi--package-variant-closed]`,"tab-modules":`icon-[mdi--vector-link]`,"tab-source":`icon-[mdi--source-branch]`,"status-dark":`icon-[mdi--circle-slice-8]`,"status-light":`icon-[mdi--checkbox-blank-circle]`,"status-live":`icon-[mdi--motion-play-outline]`,"metric-packages":`icon-[mdi--package-variant]`,"metric-subpackages":`icon-[mdi--layers-triple-outline]`,"metric-chunks":`icon-[mdi--chart-tree]`,"metric-assets":`icon-[mdi--file-document-multiple-outline]`,"metric-size-outline":`icon-[mdi--database-outline]`,"metric-modules":`icon-[mdi--cube-outline]`,"metric-duplicates":`icon-[mdi--vector-link]`,"metric-sources":`icon-[mdi--source-branch]`,"metric-copy":`icon-[mdi--content-copy]`,"metric-time":`icon-[mdi--clock-outline]`,"metric-entries":`icon-[mdi--export-variant]`,"metric-size":`icon-[mdi--database]`,treemap:`icon-[mdi--chart-box-outline]`,"top-files":`icon-[mdi--file-star-outline]`,subpackages:`icon-[mdi--layers-triple-outline]`,"duplicate-modules":`icon-[mdi--vector-link]`,"module-sources":`icon-[mdi--source-branch]`,"file-samples":`icon-[mdi--file-document-outline]`,"hero-workspace":`icon-[mdi--view-quilt-outline]`,"hero-commands":`icon-[mdi--console-line]`,"hero-system":`icon-[mdi--shape-outline]`,"metric-ready":`icon-[mdi--rocket-launch-outline]`,"metric-health":`icon-[mdi--heart-pulse]`,"metric-latency":`icon-[mdi--timer-sand]`,"metric-quality":`icon-[mdi--shield-check-outline]`,"metric-search":`icon-[mdi--magnify]`,"metric-history":`icon-[mdi--history]`,"metric-bookmark":`icon-[mdi--bookmark-check-outline]`,"metric-link":`icon-[mdi--link-variant]`,"metric-reset":`icon-[mdi--restore]`,"token-color":`icon-[mdi--palette-outline]`,"token-surface":`icon-[mdi--card-bulleted-outline]`,"token-type":`icon-[mdi--format-letter-spacing]`},r=g(()=>n[t.name]??`icon-[mdi--file-document-multiple-outline]`);return(e,t)=>(v(),D(`span`,{class:x([`h-full w-full`,r.value])},null,2))}}),ie={class:`grid gap-2 overflow-y-auto pr-1`},ae={class:`flex items-start gap-3`},oe={class:`h-5 w-5`},se={class:`min-w-0`},ce={class:`font-medium text-(--dashboard-text)`},le={key:0,class:`ml-5 grid gap-1 border-l border-(--dashboard-border) pl-3`},ue={class:`h-4 w-4 shrink-0`},de={class:`min-w-0 truncate`},N=t({__name:`AppNavigationList`,props:{currentAnalyzeTab:{},currentPath:{},items:{},mobile:{type:Boolean,default:!1}},emits:[`navigate`],setup(e,{emit:t}){let r=e,i=t;function o(e){return e===`/`?r.currentPath===`/`:r.currentPath===e||r.currentPath.startsWith(`${e}/`)}function s(e){let t=e.indexOf(`?`);return t===-1?`overview`:new URLSearchParams(e.slice(t+1)).get(`tab`)??`overview`}function l(e){return e.startsWith(`/analyze`)?r.currentPath===`/analyze`&&s(e)===r.currentAnalyzeTab:o(e)}function u(e){return o(e.to)||!!e.children?.some(e=>l(e.to))}return(t,r)=>(v(),D(`nav`,ie,[(v(!0),D(b,null,a(e.items,t=>(v(),D(`div`,{key:t.to,class:`grid gap-1`},[c(n(w),{to:t.to,class:x(n(j)(`group rounded-md border px-3 py-3 transition`,u(t)?`border-(--dashboard-border-strong) bg-(--dashboard-panel-strong) shadow-(--dashboard-shadow)`:`border-(--dashboard-border) bg-(--dashboard-panel-muted) hover:border-(--dashboard-border-strong) hover:bg-(--dashboard-panel)`)),onClick:r[0]||=e=>i(`navigate`)},{default:O(()=>[h(`div`,ae,[h(`span`,{class:x(n(j)(`flex h-10 w-10 shrink-0 items-center justify-center rounded-md`,u(t)?`bg-(--dashboard-accent-soft) text-(--dashboard-accent)`:`bg-(--dashboard-panel) text-(--dashboard-text-soft) group-hover:text-(--dashboard-accent)`))},[h(`span`,oe,[c(M,{name:t.iconName},null,8,[`name`])])],2),h(`div`,se,[h(`p`,ce,f(t.label),1),h(`p`,{class:x([`text-xs leading-5 text-(--dashboard-text-soft)`,e.mobile?`mt-1`:`mt-0.5 truncate`])},f(t.caption),3)])])]),_:2},1032,[`to`,`class`]),t.children?.length&&u(t)?(v(),D(`div`,le,[(v(!0),D(b,null,a(t.children,e=>(v(),p(n(w),{key:e.to,to:e.to,class:x(n(j)(`group flex min-w-0 items-center gap-2 rounded-md px-2.5 py-2 text-sm transition`,l(e.to)?`bg-(--dashboard-accent-soft) text-(--dashboard-accent)`:`text-(--dashboard-text-soft) hover:bg-(--dashboard-panel-muted) hover:text-(--dashboard-text)`)),onClick:r[1]||=e=>i(`navigate`)},{default:O(()=>[h(`span`,ue,[c(M,{name:e.iconName},null,8,[`name`])]),h(`span`,de,f(e.label),1)]),_:2},1032,[`to`,`class`]))),128))])):T(``,!0)]))),128))]))}}),fe={key:0,class:`mr-1.5 h-4 w-4 text-(--dashboard-accent)`},P=t({__name:`AppInfoPill`,props:{label:{},iconName:{},uppercase:{type:Boolean}},setup(e){return(t,n)=>(v(),D(`span`,{class:x([`inline-flex items-center rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-2.5 py-1 text-xs font-medium text-(--dashboard-text-soft)`,e.uppercase?`tracking-[0.18em] uppercase`:void 0])},[e.iconName?(v(),D(`span`,fe,[c(M,{name:e.iconName},null,8,[`name`])])):T(``,!0),E(` `+f(e.label),1)],2))}}),pe={class:`flex flex-col gap-3 rounded-lg border border-(--dashboard-border-strong) bg-(--dashboard-panel-strong) px-4 py-3 shadow-(--dashboard-shadow) md:px-5`},me={class:`flex items-start justify-between gap-3`},he={class:`flex items-start gap-3`},ge={class:`h-5 w-5`},_e={class:`mt-1 text-2xl font-semibold tracking-tight md:text-[1.8rem]`},ve={key:0,class:`mt-1 max-w-3xl text-sm leading-6 text-(--dashboard-text-muted)`},ye={key:0,class:`hidden items-center gap-2 rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2 text-xs font-medium text-(--dashboard-text-soft) md:inline-flex`,for:`dashboard-global-theme`},be={class:`h-4 w-4 text-(--dashboard-accent)`},xe=[`value`],Se=[`value`],Ce={class:`flex flex-wrap items-center gap-2 md:hidden`},we={key:0,class:`inline-flex items-center gap-2 rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2 text-xs font-medium text-(--dashboard-text-soft)`,for:`dashboard-mobile-theme`},Te={class:`h-4 w-4 text-(--dashboard-accent)`},Ee=[`value`],De=[`value`],Oe=t({__name:`AppShellHeader`,props:{title:{},description:{},themeOptions:{},themePreference:{}},emits:[`menu`,`setTheme`],setup(e,{emit:t}){let n=e,r=t,i=g(()=>n.themeOptions.find(e=>e.value===n.themePreference)?.iconName??`theme-system`),o=g(()=>n.themeOptions.length>0);function s(e){r(`setTheme`,e.target.value)}return(t,n)=>(v(),D(`header`,pe,[h(`div`,me,[h(`div`,he,[h(`button`,{class:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text) md:hidden`,type:`button`,onClick:n[0]||=e=>r(`menu`)},[h(`span`,ge,[c(M,{name:`nav-menu`})])]),h(`div`,null,[n[1]||=h(`p`,{class:`text-[11px] uppercase tracking-[0.28em] text-(--dashboard-accent)`},` weapp-vite dashboard `,-1),h(`h1`,_e,f(e.title),1),e.description?(v(),D(`p`,ve,f(e.description),1)):T(``,!0)])]),o.value?(v(),D(`label`,ye,[h(`span`,be,[c(M,{name:i.value},null,8,[`name`])]),h(`select`,{id:`dashboard-global-theme`,class:`min-w-32 bg-transparent text-(--dashboard-text) outline-none`,value:e.themePreference,onChange:s},[(v(!0),D(b,null,a(e.themeOptions,e=>(v(),D(`option`,{key:e.value,value:e.value},f(e.label),9,Se))),128))],40,xe)])):T(``,!0)]),h(`div`,Ce,[o.value?(v(),D(`label`,we,[h(`span`,Te,[c(M,{name:i.value},null,8,[`name`])]),h(`select`,{id:`dashboard-mobile-theme`,class:`min-w-32 bg-transparent text-(--dashboard-text) outline-none`,value:e.themePreference,onChange:s},[(v(!0),D(b,null,a(e.themeOptions,e=>(v(),D(`option`,{key:e.value,value:e.value},f(e.label),9,De))),128))],40,Ee)])):T(``,!0),o.value?(v(),p(P,{key:1,"icon-name":`status-live`,label:`shell ready`,uppercase:``})):T(``,!0)])]))}}),F=k({base:`flex flex-col rounded-lg border shadow-(--dashboard-shadow)`,variants:{tone:{default:`border-(--dashboard-border) bg-(--dashboard-panel)`,strong:`border-(--dashboard-border-strong) bg-(--dashboard-panel-strong)`,muted:`border-(--dashboard-border) bg-(--dashboard-panel-muted)`},padding:{none:``,sm:`p-3`,md:`p-4`,header:`px-4 py-4 md:px-5`}},defaultVariants:{tone:`default`,padding:`md`}}),I=k({base:`flex items-center justify-center rounded-md bg-(--dashboard-accent-soft) text-(--dashboard-accent)`,variants:{size:{sm:`h-8 w-8`,md:`h-9 w-9`,lg:`h-10 w-10`}},defaultVariants:{size:`md`}}),ke=k({base:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted)`,variants:{padding:{sm:`px-4 py-3`,md:`p-4`},interactive:{true:`transition hover:border-(--dashboard-border-strong) hover:bg-(--dashboard-panel)`,false:``}},defaultVariants:{padding:`md`,interactive:!1}}),Ae=k({base:`inline-flex items-center gap-2 rounded-full border transition`,variants:{kind:{nav:`px-3.5 py-1.5 text-sm`,theme:`px-3 py-1.5 text-xs font-medium`,badge:`px-2.5 py-1 text-[11px] uppercase tracking-[0.18em]`},active:{true:`border-(--dashboard-accent) bg-(--dashboard-accent-soft) text-(--dashboard-text)`,false:`border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text-soft) hover:border-(--dashboard-border-strong) hover:text-(--dashboard-text)`}},defaultVariants:{kind:`nav`,active:!1}}),je=k({base:`rounded-full border px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.16em]`,variants:{tone:{neutral:`border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text-soft)`,info:`border-(--dashboard-border-strong) bg-(--dashboard-accent-soft) text-(--dashboard-accent)`,success:`border-emerald-200 bg-emerald-100 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/12 dark:text-emerald-300`,warning:`border-amber-200 bg-amber-100 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/12 dark:text-amber-300`,error:`border-rose-200 bg-rose-100 text-rose-700 dark:border-rose-500/30 dark:bg-rose-500/12 dark:text-rose-300`}},defaultVariants:{tone:`neutral`}});k({base:`rounded-lg border border-(--dashboard-border) bg-(--dashboard-panel) px-4 py-3 text-[11px] uppercase tracking-[0.24em] text-(--dashboard-text-soft) shadow-(--dashboard-shadow)`});var Me={key:0,class:`flex items-start justify-between gap-4`},Ne={class:`flex min-w-0 items-start gap-3`},Pe={class:`h-5 w-5`},Fe={class:`min-w-0`},Ie={key:0,class:`text-[11px] uppercase tracking-[0.24em] text-(--dashboard-accent)`},Le={key:1,class:`text-lg font-semibold tracking-tight`},Re={key:2,class:`mt-1 text-sm leading-6 text-(--dashboard-text-muted)`},L=t({__name:`AppSurfaceCard`,props:{title:{default:void 0},description:{default:void 0},eyebrow:{default:void 0},iconName:{default:void 0},tone:{default:`default`},padding:{default:`md`},contentClass:{default:``}},setup(e){let t=e,i=r(),a=!!(t.title||t.description||i.header);return(t,r)=>(v(),D(`section`,{class:x(n(j)(n(F)({tone:e.tone,padding:e.padding}),e.contentClass))},[n(a)?(v(),D(`header`,Me,[h(`div`,Ne,[e.iconName?(v(),D(`span`,{key:0,class:x([n(I)({size:`md`}),`shrink-0`])},[h(`span`,Pe,[c(M,{name:e.iconName},null,8,[`name`])])],2)):T(``,!0),h(`div`,Fe,[e.eyebrow?(v(),D(`p`,Ie,f(e.eyebrow),1)):T(``,!0),e.title?(v(),D(`h2`,Le,f(e.title),1)):T(``,!0),e.description?(v(),D(`p`,Re,f(e.description),1)):T(``,!0)])]),o(t.$slots,`header`)])):T(``,!0),h(`div`,{class:x(n(j)(`min-h-0 flex-1`,n(a)?`mt-4`:``))},[o(t.$slots,`default`)],2)],2))}}),R=`weapp-vite-dashboard-theme`;function ze(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(R);return e===`light`||e===`dark`||e===`system`?e:`system`}function Be(e,t){return e===`light`||e===`dark`?e:t?.matches?`dark`:`light`}function z(){let t=u(ze()),n=typeof window<`u`?window.matchMedia(`(prefers-color-scheme: dark)`):null,r=g(()=>Be(t.value,n)),i=e=>{typeof document>`u`||(document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e)},a=e=>{typeof window>`u`||window.localStorage.setItem(R,e)},o=()=>{i(r.value)};return s(t,e=>{a(e),i(r.value)},{immediate:!0}),e(()=>{n?.addEventListener(`change`,o),i(r.value)}),y(()=>{n?.removeEventListener(`change`,o)}),{themePreference:t,resolvedTheme:r,setThemePreference(e){t.value=e}}}var B=Symbol(`dashboard-theme`);function Ve(e){i(B,e)}function He(){return l(B,null)||z()}var V=`weapp-vite-dashboard:analyze-result-history`;function Ue(e){return e.toLocaleString(`zh-CN`,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function H(e){return e?JSON.stringify({packages:e.packages,modules:e.modules,subPackages:e.subPackages,budgets:e.metadata?.budgets}):``}function U(e,t){return H(e)===H(t)}function W(e){return e.packages.flatMap(e=>e.files).reduce((e,t)=>e+(t.size??0),0)}function We(e){return e.packages.flatMap(e=>e.files).reduce((e,t)=>e+(t.brotliSize??t.gzipSize??Math.round((t.size??0)*.32)),0)}function Ge(e,t){let n=W(e);return`${Date.parse(t).toString(36)}-${n.toString(36)}-${e.modules.length.toString(36)}`}function G(e,t=new Date().toISOString()){let n=e.modules.filter(e=>e.packages.length>1).length;return{id:Ge(e,t),capturedAt:t,label:Ue(new Date(t)),result:e,totalBytes:W(e),compressedBytes:We(e),packageCount:e.packages.length,moduleCount:e.modules.length,duplicateCount:n}}function Ke(e){let t=[...e.snapshots??[]];e.previous&&t.push(G(e.previous)),t.push(G(e.current));let n=new Map;for(let e of t){let t=H(e.result);n.has(t)||n.set(t,e)}return[...n.values()].sort((e,t)=>Date.parse(t.capturedAt)-Date.parse(e.capturedAt)).slice(0,12)}function qe(){try{let e=window.localStorage.getItem(V);if(!e)return null;let t=JSON.parse(e);return!t?.current?.packages||!Array.isArray(t.current.packages)?null:{current:t.current,previous:t.previous?.packages?t.previous:null,snapshots:Array.isArray(t.snapshots)?t.snapshots.filter(e=>e?.result?.packages&&Array.isArray(e.result.packages)):void 0,baselineSnapshotId:typeof t.baselineSnapshotId==`string`?t.baselineSnapshotId:null,comparisonMode:t.comparisonMode===`baseline`?`baseline`:`previous`}}catch{return null}}function K(e){try{window.localStorage.setItem(V,JSON.stringify(e))}catch{}}function Je(e,t,n){return t||(e&&n?.current&&!U(e,n.current)?n.current:n?.previous??null)}var Ye=[{value:`system`,label:`跟随系统`,iconName:`theme-system`},{value:`light`,label:`亮色`,iconName:`theme-light`},{value:`dark`,label:`暗色`,iconName:`theme-dark`}],Xe=[{key:`overview`,label:`总览`,iconName:`tab-overview`},{key:`diagnostics`,label:`诊断`,iconName:`metric-health`},{key:`review`,label:`评审清单`,iconName:`metric-bookmark`},{key:`treemap`,label:`体积地图`,iconName:`treemap`},{key:`files`,label:`文件详情`,iconName:`top-files`},{key:`source`,label:`源码对比`,iconName:`tab-source`},{key:`packages`,label:`包与产物`,iconName:`tab-packages`},{key:`modules`,label:`模块与复用`,iconName:`tab-modules`}],Ze=[{value:`all`,label:`全部`},{value:`growth`,label:`增长`},{value:`duplicates`,label:`重复`},{value:`node_modules`,label:`依赖`},{value:`source`,label:`业务`},{value:`selected-package`,label:`当前包`}],q=[{to:`/`,label:`工作台`,caption:`应用入口与状态总览`,iconName:`nav-home`},{to:`/analyze`,label:`分析视图`,caption:`包体、模块与分包结构`,iconName:`nav-analyze`,children:Xe.map(e=>({to:e.key===`overview`?`/analyze`:`/analyze?tab=${e.key}`,label:e.label,caption:e.key===`overview`?`全局摘要和建议动作`:e.key===`diagnostics`?`预算、增量和历史基线`:e.key===`review`?`PR 风险和评审清单`:e.key===`treemap`?`产物体积地图`:e.key===`files`?`文件、预算和模块明细`:e.key===`source`?`源码与产物 Diff`:e.key===`packages`?`包体和产物列表`:`模块复用与来源`,iconName:e.iconName}))},{to:`/activity`,label:`活动流`,caption:`命令、诊断与运行事件`,iconName:`nav-activity`},{to:`/tokens`,label:`设计令牌`,caption:`主题、表面与组件状态`,iconName:`nav-tokens`}],Qe=[{label:`启动开发`,command:`pnpm --filter @weapp-vite/dashboard dev`,note:`本地预览完整 UI 壳子`,category:`dev`},{label:`生产构建`,command:`pnpm --filter @weapp-vite/dashboard build`,note:`验证静态产物可发布`,category:`build`},{label:`主包联调`,command:`weapp-vite build --ui`,note:`从 CLI 注入真实分析数据`,category:`analyze`}],$e=["`analyze` payload 契约保持兼容,CLI 注入无需迁移。",`工作台可在无 payload 状态下展示稳定空态和示例事件。`,`主题偏好在应用级共享,页面之间状态一致。`],et=[{time:`09:12`,title:`analyze payload synced`,summary:`CLI 已把最新构建结果注入 dashboard,全局状态已完成一次同步。`,tone:`live`},{time:`09:26`,title:`workspace shell extended`,summary:`工作台、活动流、设计令牌已经拆成独立页面。`,tone:`default`},{time:`10:03`,title:`theme system unified`,summary:`主题偏好收敛到应用根部,所有页面共享同一套明暗模式。`,tone:`default`}],tt=[{label:`CLI 注入链路`,detail:"保留 `window.__WEAPP_VITE_ANALYZE_RESULT__` 兼容层。",status:`兼容`},{label:`路由拓展性`,detail:`页面采用文件路由,主路由表保持稳定。`,status:`可扩展`},{label:`组件复用`,detail:`通用卡片与区块标题已独立,避免页面继续拷贝结构。`,status:`已落地`},{label:`视觉令牌`,detail:`颜色、表面、排版预览集中在 tokens 页面统一检查。`,status:`可验证`}],nt=[{id:`evt-command-build-ui`,kind:`command`,level:`success`,title:`build --ui completed`,detail:`示例事件: dashboard 已经准备好承接来自 CLI 的真实命令生命周期事件。`,timestamp:`10:18:12`,source:`cli`,durationMs:842,tags:[`build`,`ui`]},{id:`evt-hmr-shell`,kind:`hmr`,level:`info`,title:`workspace shell hot updated`,detail:`工作台页面已完成一次热更新并记录到事件流。`,timestamp:`10:19:44`,source:`vite-hmr`,tags:[`hmr`,`shell`]},{id:`evt-diagnostic-payload`,kind:`diagnostic`,level:`warning`,title:`analyze payload pending`,detail:`当前页面支持在没有 payload 时进入空态。`,timestamp:`10:20:07`,source:`dashboard`,tags:[`diagnostic`]}],rt=[{title:`Accent`,iconName:`token-color`,tokens:[{name:`--dashboard-accent`,sample:`var(--dashboard-accent)`},{name:`--dashboard-accent-soft`,sample:`var(--dashboard-accent-soft)`},{name:`--dashboard-border-strong`,sample:`var(--dashboard-border-strong)`}]},{title:`Surfaces`,iconName:`token-surface`,tokens:[{name:`--dashboard-panel`,sample:`var(--dashboard-panel)`},{name:`--dashboard-panel-strong`,sample:`var(--dashboard-panel-strong)`},{name:`--dashboard-panel-muted`,sample:`var(--dashboard-panel-muted)`}]},{title:`Typography`,iconName:`token-type`,tokens:[{name:`--dashboard-text`,sample:`var(--dashboard-text)`},{name:`--dashboard-text-muted`,sample:`var(--dashboard-text-muted)`},{name:`--dashboard-text-soft`,sample:`var(--dashboard-text-soft)`}]}];function J(e){if(!e||Number.isNaN(e))return`—`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=e,i=0;for(;r>=t&&i<n.length-1;)r/=t,i++;return`${r.toFixed(r>=100||i===0?0:2)} ${n[i]}`}function it(e,t=``,n=``){if(!e||Number.isNaN(e)||e<=0)return 0;let r=t.toLowerCase().split(`.`).pop()??``,i=new Set([`cjs`,`css`,`html`,`js`,`json`,`map`,`mjs`,`svg`,`txt`,`wxml`,`wxss`,`xml`]),a=new Set([`avif`,`br`,`gif`,`gz`,`jpeg`,`jpg`,`mp3`,`mp4`,`ogg`,`otf`,`png`,`webp`,`woff`,`woff2`,`zip`]);return i.has(r)?Math.max(1,Math.round(e*.34)):a.has(r)?Math.max(1,Math.round(e*.92)):n===`chunk`?Math.max(1,Math.round(e*.38)):Math.max(1,Math.round(e*.72))}function at(e){switch(e){case`main`:return`主包`;case`subPackage`:return`分包`;case`independent`:return`独立分包`;case`virtual`:return`虚拟包`;default:return e}}function ot(e){return e===`independent`?`独立构建`:`主构建`}function st(e){switch(e){case`src`:return`业务源码`;case`workspace`:return`工作区包`;case`plugin`:return`插件`;case`node_modules`:return`依赖`;default:return e}}function ct(e){switch(e){case`command`:return`命令`;case`build`:return`构建`;case`diagnostic`:return`诊断`;case`hmr`:return`HMR`;case`system`:return`系统`;default:return e}}function lt(e){switch(e){case`info`:return`信息`;case`success`:return`成功`;case`warning`:return`警告`;case`error`:return`错误`;default:return e}}function ut(e){return e??`dashboard`}function dt(e){return e}function ft(e){return{label:lt(e.level),tone:dt(e.level)}}function pt(e){return e>0?`error`:`info`}function mt(e){return{label:e.latestTimestamp?`${e.count} 条`:`错误 ${e.errorCount}`,tone:pt(e.errorCount)}}function Y(e){return typeof e!=`number`||Number.isNaN(e)||e<0?`未记录`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?1:2)} s`:`${e} ms`}function ht(e){let t=[ct(e.kind),ut(e.source),e.timestamp];return typeof e.durationMs==`number`&&Number.isFinite(e.durationMs)&&e.durationMs>=0&&t.push(Y(e.durationMs)),t.join(` · `)}function X(e,t){return{label:e,value:t}}function gt(){return new Date().toLocaleTimeString(`zh-CN`,{hour12:!1})}function _t(e){if(!e)return{packageCount:0,moduleCount:0,duplicateCount:0,totalBytes:0};let t=e.packages.flatMap(e=>e.files);return{packageCount:e.packages.length,moduleCount:e.modules.length,duplicateCount:e.modules.filter(e=>e.packages.length>1).length,totalBytes:t.reduce((e,t)=>e+(t.size??0),0)}}function vt(e){let t=e.filter(e=>e.level===`error`).length,n=e.filter(e=>e.level===`warning`).length,r=e.filter(e=>e.kind===`command`).length,i=e.filter(e=>typeof e.durationMs==`number`),a=i.length>0?Math.round(i.reduce((e,t)=>e+(t.durationMs??0),0)/i.length):void 0;return[X(`总事件数`,String(e.length)),X(`命令事件`,String(r)),X(`已记录耗时`,String(i.length)),X(`平均耗时`,Y(a)),X(`警告事件`,String(n)),X(`错误事件`,String(t))]}function yt(e){return[{label:`页面骨架`,value:`4 个`,iconName:`metric-ready`},{label:`连接状态`,value:e.result?`已接入 payload`:`等待注入`,iconName:e.result?`status-live`:`metric-health`},{label:`数据同步`,value:`${e.updateCount} 次`,iconName:`metric-latency`},{label:`产物体积`,value:e.result?J(e.summary.totalBytes):`未载入`,iconName:`metric-quality`},{label:`运行事件`,value:`${e.runtimeEventCount} 条`,iconName:e.latestRuntimeEvent?.level===`error`?`metric-health`:`metric-time`}]}function bt(e){return e.result?[{label:`重新分析当前工程`,command:`weapp-vite analyze`,note:`最近同步于 ${e.lastUpdatedAt},当前可读取 ${e.summary.packageCount} 个包。`,category:`analyze`},{label:`进入构建联调`,command:`weapp-vite build --ui`,note:`当前产物总体积 ${J(e.summary.totalBytes)},适合继续核对 chunk 结构。`,category:`build`},{label:`观察开发态更新`,command:`weapp-vite dev --ui`,note:`已记录 ${e.updateCount} 次 payload 同步,后续可继续接入更细粒度事件。`,category:`dev`}]:Qe}function xt(e){let t=[...et];for(let n of e.runtimeEvents.slice(0,4))t.unshift({time:n.timestamp,title:n.title,summary:n.detail,tone:n.level===`error`||n.level===`warning`?`default`:`live`});return e.result&&t.unshift({time:e.lastUpdatedAt,title:`workspace payload received`,summary:`已收到一份真实 analyze 结果,包含 ${e.summary.packageCount} 个包和 ${e.summary.moduleCount} 个模块。`,tone:`live`}),t}function St(e){let t=[...tt];return e.latestRuntimeEvent&&t.unshift({label:`最新运行事件`,detail:`${e.latestRuntimeEvent.title} · ${e.latestRuntimeEvent.detail}`,status:e.latestRuntimeEvent.level}),e.result?[{label:`实时分析状态`,detail:`已接入 payload,当前记录 ${e.summary.duplicateCount} 个跨包复用模块。`,status:`在线`},{label:`产物规模`,detail:`总产物体积 ${J(e.summary.totalBytes)},可继续进入分析页查看 treemap 与最大文件。`,status:`可分析`},...t]:[{label:`CLI 注入链路`,detail:`尚未接收到 analyze payload,当前页面以空态方式工作。`,status:`待接入`},...t]}var Ct=Symbol(`dashboard-workspace`),wt=[`command`,`build`,`diagnostic`,`hmr`,`system`],Tt=[`info`,`success`,`warning`,`error`];function Et(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Dt(e){return typeof e==`string`&&wt.includes(e)?e:`system`}function Ot(e){return typeof e==`string`&&Tt.includes(e)?e:`info`}function Z(e,t){return typeof e==`string`&&e.trim()?e:t}function Q(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function kt(e){if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&e.trim()).map(e=>String(e));return t.length>0?t:void 0}function At(e){if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&e.trim()).map(e=>String(e));return t.length>0?t:void 0}function jt(e){if(!Et(e))return;let t={timestamp:typeof e.timestamp==`string`?e.timestamp:void 0,totalMs:Q(e.totalMs),eventId:typeof e.eventId==`string`?e.eventId:void 0,event:typeof e.event==`string`?e.event:void 0,file:typeof e.file==`string`?e.file:void 0,relativeFile:typeof e.relativeFile==`string`?e.relativeFile:void 0,sourceRootFile:typeof e.sourceRootFile==`string`?e.sourceRootFile:void 0,buildCoreMs:Q(e.buildCoreMs),transformMs:Q(e.transformMs),writeMs:Q(e.writeMs),watchToDirtyMs:Q(e.watchToDirtyMs),emitMs:Q(e.emitMs),sharedChunkResolveMs:Q(e.sharedChunkResolveMs),dirtyCount:Q(e.dirtyCount),pendingCount:Q(e.pendingCount),emittedCount:Q(e.emittedCount),dirtyReasonSummary:At(e.dirtyReasonSummary),pendingReasonSummary:At(e.pendingReasonSummary)};return Object.values(t).some(e=>e!==void 0)?t:void 0}function Mt(e,t){return{id:Z(e.id,`dashboard-runtime-event-${t}`),kind:Dt(e.kind),level:Ot(e.level),title:Z(e.title,`untitled event`),detail:Z(e.detail,`no event detail`),timestamp:Z(e.timestamp,`—`),source:Z(e.source,`dashboard`),durationMs:Q(e.durationMs),tags:kt(e.tags),profile:jt(e.profile)}}function Nt(e){return{count:1,errorCount:+(e.level===`error`),latestTimestamp:e.timestamp,durationTotal:e.durationMs??0,timedCount:+(typeof e.durationMs==`number`)}}function Pt(e,t){return{count:e.count+1,errorCount:e.errorCount+ +(t.level===`error`),latestTimestamp:e.latestTimestamp,durationTotal:e.durationTotal+(t.durationMs??0),timedCount:e.timedCount+ +(typeof t.durationMs==`number`)}}function Ft(e,t){return{source:e,count:t.count,errorCount:t.errorCount,latestTimestamp:t.latestTimestamp,averageDurationMs:t.timedCount>0?Math.round(t.durationTotal/t.timedCount):void 0}}function It(e){return{...e,averageDuration:Y(e.averageDurationMs)}}function Lt(e,t){return Et(e)?Mt(e,t):null}function $(e){let t=(Array.isArray(e)?e:[e]).map((e,t)=>Lt(e,t)).filter(e=>!!e),n=new Map;for(let e of t)n.set(e.id,e);return[...n.values()]}function Rt(e){let t=new Map;for(let n of e){let e=n.source??`dashboard`,r=t.get(e);if(!r){t.set(e,Nt(n));continue}t.set(e,Pt(r,n))}return Array.from(t,([e,t])=>Ft(e,t)).sort((e,t)=>t.count-e.count||e.source.localeCompare(t.source,`zh-CN`))}function zt(e){return e.map(e=>It(e))}function Bt(){return window.__WEAPP_VITE_DASHBOARD_EVENTS__?.length?$(window.__WEAPP_VITE_DASHBOARD_EVENTS__):$(nt)}function Vt(t){let n=g(()=>t.value[0]??null),r=g(()=>vt(t.value)),i=g(()=>Rt(t.value)),a=e=>{let n=$(e);if(n.length===0)return;let r=[...n,...t.value],i=new Map;for(let e of r)i.set(e.id,e);t.value=[...i.values()].slice(0,24),window.__WEAPP_VITE_DASHBOARD_EVENTS__=[...t.value]},o=e=>{let t=e instanceof CustomEvent?e.detail:null;a(Array.isArray(t)?t:t?[t]:null)};return e(()=>{window.addEventListener(`weapp-dashboard:event`,o),a(window.__WEAPP_VITE_DASHBOARD_EVENTS__)}),y(()=>{window.removeEventListener(`weapp-dashboard:event`,o)}),{eventSummary:r,latestRuntimeEvent:n,runtimeSourceSummary:i}}function Ht(){let t=window.__WEAPP_VITE_ANALYZE_RESULT__??null,n=window.__WEAPP_VITE_PREVIOUS_ANALYZE_RESULT__??null,r=qe(),i=d(t),a=d(Je(t,n,r)),o=d(r?Ke(r):t?[G(t)]:[]),s=d(r?.baselineSnapshotId&&o.value.some(e=>e.id===r.baselineSnapshotId)?r.baselineSnapshotId:null),c=d(r?.comparisonMode===`baseline`&&s.value?`baseline`:`previous`),l=d(Bt()),u=d(0),f=d(i.value?gt():`—`);t&&K({current:t,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value});let p=g(()=>_t(i.value)),{eventSummary:ee,latestRuntimeEvent:m,runtimeSourceSummary:h}=Vt(l),_=g(()=>i.value?`payload ready`:`awaiting payload`),v=g(()=>i.value?`${p.value.packageCount} 个包 · ${p.value.moduleCount} 个模块`:`尚未接收到 CLI analyze 数据`),te=g(()=>o.value.find(e=>e.id===s.value)??null),b=g(()=>c.value===`baseline`?te.value?.result??a.value:a.value),x=g(()=>yt({result:i.value,updateCount:u.value,summary:p.value,runtimeEventCount:l.value.length,latestRuntimeEvent:m.value})),S=g(()=>bt({result:i.value,lastUpdatedAt:f.value,summary:p.value,updateCount:u.value})),C=g(()=>xt({runtimeEvents:l.value,result:i.value,lastUpdatedAt:f.value,summary:p.value})),w=g(()=>St({result:i.value,latestRuntimeEvent:m.value,summary:p.value})),T=()=>{let e=window.__WEAPP_VITE_ANALYZE_RESULT__;if(!e)return;let t=window.__WEAPP_VITE_PREVIOUS_ANALYZE_RESULT__??null,n=qe(),r=n?.previous??a.value;n?.current&&!U(e,n.current)&&(r=n.current),i.value&&!U(e,i.value)&&(r=i.value),t&&!U(e,t)&&(r=t),a.value=U(e,r)?null:r,i.value=e;let l=G(e),d=Ke({current:e,previous:a.value,snapshots:[l,...o.value]});o.value=d,s.value&&!d.some(e=>e.id===s.value)&&(s.value=d.at(-1)?.id??null),c.value===`baseline`&&!s.value&&(c.value=`previous`),K({current:e,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value}),u.value+=1,f.value=gt()},E=()=>{i.value&&K({current:i.value,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value})};return e(()=>{window.addEventListener(`weapp-analyze:update`,T),T()}),y(()=>{window.removeEventListener(`weapp-analyze:update`,T)}),{resultRef:i,previousResultRef:a,comparisonResultRef:b,historySnapshots:o,baselineSnapshotId:s,comparisonMode:c,updateCount:u,lastUpdatedAt:f,statusLabel:_,statusSummary:v,commandItems:S,activityItems:C,diagnostics:w,signals:x,runtimeEvents:l,latestRuntimeEvent:m,eventSummary:ee,runtimeSourceSummary:h,setBaselineSnapshot:e=>{o.value.some(t=>t.id===e)&&(s.value=e,c.value=`baseline`,E())},setComparisonMode:e=>{c.value=e===`baseline`&&!s.value?`previous`:e,E()}}}function Ut(e){i(Ct,e)}function Wt(){let e=l(Ct,null);if(!e)throw Error(`[dashboard] workspace context is not available`);return e}var Gt={class:`h-dvh overflow-hidden px-3 py-3 text-(--dashboard-text) md:px-4 md:py-4 lg:px-5`},Kt={class:`mx-auto grid h-full max-w-400 gap-3 overflow-hidden lg:grid-cols-[17rem_minmax(0,1fr)]`},qt={class:`hidden min-h-0 overflow-hidden lg:block`},Jt={class:`grid h-full grid-rows-[minmax(0,1fr)_auto] gap-3`},Yt={class:`grid min-h-0 min-w-0 grid-rows-[auto_minmax(0,1fr)] gap-3 overflow-hidden`},Xt={class:`min-h-0 overflow-hidden`},Zt={key:0,class:`fixed inset-y-3 left-3 z-50 w-[min(22rem,calc(100vw-1.5rem))] lg:hidden`},Qt=t({__name:`App`,setup(e){let t=ee(),r=u(!1),{themePreference:i,resolvedTheme:a,setThemePreference:o}=z(),l=Ht(),d=g(()=>!!l.resultRef.value),f=g(()=>typeof t.query.tab==`string`?t.query.tab:`overview`);Ve({themePreference:i,resolvedTheme:a,setThemePreference:o}),Ut(l);let p=g(()=>t.path.startsWith(`/analyze`)?{title:`Analyze Workspace`}:t.path.startsWith(`/activity`)?{title:`Activity Stream`}:t.path.startsWith(`/tokens`)?{title:`Design Tokens`}:{title:`Workspace Console`});return s(()=>t.fullPath,()=>{r.value=!1}),(e,s)=>(v(),D(`div`,Gt,[h(`div`,Kt,[h(`aside`,qt,[h(`div`,Jt,[c(L,{eyebrow:`Shell`,title:`weapp-vite dashboard`,"icon-name":`hero-system`,tone:`strong`,"content-class":`min-h-0 overflow-hidden`},{default:O(()=>[c(N,{"current-analyze-tab":f.value,"current-path":n(t).path,items:n(q)},null,8,[`current-analyze-tab`,`current-path`,`items`])]),_:1}),c(L,{eyebrow:`Status`,title:n(l).statusLabel.value,description:n(l).statusSummary.value,"icon-name":d.value?`status-live`:n(a)===`dark`?`theme-dark`:`theme-light`,padding:`sm`},null,8,[`title`,`description`,`icon-name`])])]),h(`div`,Yt,[c(Oe,{title:p.value.title,description:p.value.description,"theme-options":n(Ye),"theme-preference":n(i),onMenu:s[0]||=e=>r.value=!0,onSetTheme:n(o)},null,8,[`title`,`description`,`theme-options`,`theme-preference`,`onSetTheme`]),h(`div`,Xt,[c(n(te))])])]),c(C,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:O(()=>[r.value?(v(),D(`div`,{key:0,class:`fixed inset-0 z-40 bg-slate-950/35 backdrop-blur-sm lg:hidden`,onClick:s[1]||=e=>r.value=!1})):T(``,!0)]),_:1}),c(C,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`-translate-x-6 opacity-0`,"enter-to-class":`translate-x-0 opacity-100`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`translate-x-0 opacity-100`,"leave-to-class":`-translate-x-6 opacity-0`},{default:O(()=>[r.value?(v(),D(`aside`,Zt,[c(L,{eyebrow:`Navigation`,title:`Workspace Modules`,description:`选择要查看的工作区。`,"icon-name":`nav-menu`,tone:`strong`,"content-class":`h-full`},{default:O(()=>[c(N,{mobile:``,"current-analyze-tab":f.value,"current-path":n(t).path,items:n(q),onNavigate:s[2]||=e=>r.value=!1},null,8,[`current-analyze-tab`,`current-path`,`items`])]),_:1})])):T(``,!0)]),_:1})]))}}),$t=S({history:_(),routes:[{path:`/`,name:`/`,component:()=>A(()=>import(`./pages.js`),[],import.meta.url)},{path:`/activity`,name:`/activity`,component:()=>A(()=>import(`./activity.js`),[],import.meta.url)},{path:`/analyze`,name:`/analyze`,component:()=>A(()=>import(`./analyze.js`),__vite__mapDeps([0]),import.meta.url)},{path:`/tokens`,name:`/tokens`,component:()=>A(()=>import(`./tokens.js`),[],import.meta.url)}]});function en(){let e=m(Qt);e.config.errorHandler=(e,t,n)=>{},e.use($t),e.mount(`#app`)}try{en()}catch{}export{ke as C,P as D,F as E,M as O,I as S,je as T,q as _,mt as a,He as b,J as c,ct as d,lt as f,rt as g,$e as h,ft as i,Y as l,st as m,zt as n,it as o,ht as p,Rt as r,ot as s,Wt as t,at as u,Ye as v,Ae as w,L as x,Ze as y};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-vite/dashboard",
3
3
  "type": "module",
4
- "version": "6.16.2",
4
+ "version": "6.16.4",
5
5
  "description": "Optional analyze dashboard for weapp-vite",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  "tailwindcss": "^4.2.4",
46
46
  "typescript": "^6.0.3",
47
47
  "vite": "8.0.10",
48
- "vue-tsc": "^3.2.7"
48
+ "vue-tsc": "^3.2.8"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public",