sparkforensics-server 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -0
- package/package.json +1 -1
- package/public/assets/AutoscalingChurn-9Zo6IMGS.js +1 -0
- package/public/assets/CacheUtilization-MBDfMsKC.js +1 -0
- package/public/assets/CachingOpportunity-Cfw3wAFa.js +1 -0
- package/public/assets/ColdStart-BtS12b6_.js +1 -0
- package/public/assets/ConfigAudit-DNPV6EQg.js +1 -0
- package/public/assets/CoreUsageArea-BObEeenE.js +1 -0
- package/public/assets/Dashboard-CC_BXrNy.js +2 -0
- package/public/assets/DisclosureContext-Ds0hcZFn.js +1 -0
- package/public/assets/DuplicatePlanSubtree-vN3zqRsi.js +1 -0
- package/public/assets/ExecutorUtilization-CZObSLIj.js +1 -0
- package/public/assets/GcPressure-ByJlLOua.js +1 -0
- package/public/assets/IncompleteRun-MzqV4W8y.js +1 -0
- package/public/assets/JobFailures-LbMvAwAb.js +1 -0
- package/public/assets/MemoryUtilization-DH4jYvJK.js +1 -0
- package/public/assets/OverBroadcast-euk6HKg4.js +1 -0
- package/public/assets/PartitionHint-DThaMMRT.js +1 -0
- package/public/assets/PartitionSizing-yIN-iZzx.js +1 -0
- package/public/assets/{PlanExplorer-DdmPkKO1.js → PlanExplorer-Dd9WPK4S.js} +1 -1
- package/public/assets/PlanGraphRoute-NV5mCXRm.js +1 -0
- package/public/assets/RetryWaste-CXH4D-xH.js +1 -0
- package/public/assets/ShuffleIO-CW7U68ph.js +1 -0
- package/public/assets/Skew-PL79TppX.js +1 -0
- package/public/assets/SlowHost-GBO73hCi.js +1 -0
- package/public/assets/SmallFiles-B5cUjEav.js +1 -0
- package/public/assets/SpeculationWaste-mxi3jgb0.js +1 -0
- package/public/assets/Spill-CH1bNpxL.js +1 -0
- package/public/assets/StageFailed-YvxC11ii.js +1 -0
- package/public/assets/StageFindingGroup-B1A0nf-e.js +1 -0
- package/public/assets/{StageHeader-BSV8ALhT.js → StageHeader-BMNmUy-s.js} +1 -1
- package/public/assets/StageShape-DO3mQ6NS.js +1 -0
- package/public/assets/StageSlowness-SwRxfAEx.js +1 -0
- package/public/assets/Straggler-DHLTiBY-.js +1 -0
- package/public/assets/TaskFailures-Bj0QxiOc.js +1 -0
- package/public/assets/{TinyTask-CIPRxWfT.js → TinyTask-COUQQ5bQ.js} +1 -1
- package/public/assets/UnderBroadcast-RAUbQ6vw.js +1 -0
- package/public/assets/{finding-anchor-DF1cSHO1.js → finding-anchor-Dl8mIHiU.js} +1 -1
- package/public/assets/{impact-sort-7z0ZcBZf.js → impact-sort-Eihua9dY.js} +1 -1
- package/public/assets/index-DaC8A2FS.js +13 -0
- package/public/assets/{parser-worker-Q5KCPdKT.js → parser-worker-CfDvPkwF.js} +5 -5
- package/public/assets/{select-Cy5pmbrh.js → select-DkjFHlXR.js} +1 -1
- package/public/assets/{usePagedRows-BjPOpUU8.js → usePagedRows-Bo-aSztx.js} +1 -1
- package/public/assets/useRecentFiles-Bb4-ukVz.js +11 -0
- package/public/assets/{useSortMode-CU0vzThu.js → useSortMode-lDedD5a3.js} +1 -1
- package/public/docs/404.html +4 -3
- package/public/docs/assets/{app.C6w47a9W.js → app.yjczoibf.js} +1 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.r9imX8Aq.js +1 -0
- package/public/docs/assets/chunks/{VPLocalSearchBox.BcTNvT55.js → VPLocalSearchBox.DOBbPfix.js} +1 -1
- package/public/docs/assets/chunks/{theme.D-mE6j02.js → theme.DFcAl8Ws.js} +2 -2
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.D0Kkk_r5.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.D0Kkk_r5.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.caA46z-u.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_drill-down.md.CdtlKHl-.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_drill-down.md.CFNCE8JB.lean.js → contributor-guide_architecture_drill-down.md.CdtlKHl-.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.BNp14LtL.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.BNp14LtL.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_index.md.B9yZieYL.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_index.md.3TO9ic6w.lean.js → contributor-guide_architecture_index.md.B9yZieYL.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.DBGo-bwn.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_overview.md.DBGo-bwn.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.w4lwybdh.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_state-and-history.md.DOTVHjTV.lean.js → contributor-guide_architecture_state-and-history.md.w4lwybdh.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.CcvqxnZI.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_widget-rendering.md.BmpARZve.lean.js → contributor-guide_architecture_widget-rendering.md.CcvqxnZI.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.CKeFttKj.js +6 -0
- package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.21pTYhFF.lean.js → contributor-guide_architecture_worker-protocol.md.CKeFttKj.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_contributing.md.CQMvGwFt.js +1 -0
- package/public/docs/assets/{contributor-guide_contributing.md.B2E9ni79.lean.js → contributor-guide_contributing.md.CQMvGwFt.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_development-setup.md.D9bu4j_c.js +15 -0
- package/public/docs/assets/contributor-guide_development-setup.md.D9bu4j_c.lean.js +1 -0
- package/public/docs/assets/contributor-guide_testing.md.By6XGR9a.js +1 -0
- package/public/docs/assets/{contributor-guide_testing.md.DTwhpoN2.lean.js → contributor-guide_testing.md.By6XGR9a.lean.js} +1 -1
- package/public/docs/assets/{style.DSixAiZE.css → style.tmDhD3c8.css} +1 -1
- package/public/docs/assets/user-guide_alternative-log-retrieval.md.z-8npxNk.js +7 -0
- package/public/docs/assets/user-guide_alternative-log-retrieval.md.z-8npxNk.lean.js +1 -0
- package/public/docs/assets/user-guide_getting-started.md.BJW5oVhe.js +24 -0
- package/public/docs/assets/user-guide_getting-started.md.BJW5oVhe.lean.js +1 -0
- package/public/docs/assets/{user-guide_mcp-tools.md.dQwIvdTF.js → user-guide_mcp-tools.md.DcLiOa9t.js} +40 -23
- package/public/docs/assets/{user-guide_mcp-tools.md.dQwIvdTF.lean.js → user-guide_mcp-tools.md.DcLiOa9t.lean.js} +1 -1
- package/public/docs/assets/user-guide_run-comparison.md.qin0a4IX.js +1 -0
- package/public/docs/assets/{user-guide_run-comparison.md.ChLI3MK0.lean.js → user-guide_run-comparison.md.qin0a4IX.lean.js} +1 -1
- package/public/docs/assets/user-guide_understanding-findings.md.DzReyCXb.js +1 -0
- package/public/docs/contributor-guide/architecture/board-widgets.html +7 -6
- package/public/docs/contributor-guide/architecture/detector-contract.html +7 -6
- package/public/docs/contributor-guide/architecture/drill-down.html +7 -6
- package/public/docs/contributor-guide/architecture/impact-estimation.html +7 -6
- package/public/docs/contributor-guide/architecture/index.html +7 -6
- package/public/docs/contributor-guide/architecture/overview.html +7 -6
- package/public/docs/contributor-guide/architecture/state-and-history.html +7 -6
- package/public/docs/contributor-guide/architecture/widget-rendering.html +7 -6
- package/public/docs/contributor-guide/architecture/worker-protocol.html +10 -9
- package/public/docs/contributor-guide/contributing.html +7 -6
- package/public/docs/contributor-guide/development-setup.html +11 -10
- package/public/docs/contributor-guide/testing.html +7 -6
- package/public/docs/hashmap.json +1 -1
- package/public/docs/index.html +5 -4
- package/public/docs/tuning-reference/anti-patterns.html +5 -4
- package/public/docs/tuning-reference/aqe.html +5 -4
- package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +5 -4
- package/public/docs/tuning-reference/bottleneck-cold-start.html +5 -4
- package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +5 -4
- package/public/docs/tuning-reference/bottleneck-failures.html +5 -4
- package/public/docs/tuning-reference/bottleneck-gc.html +5 -4
- package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +5 -4
- package/public/docs/tuning-reference/bottleneck-memory-utilization.html +5 -4
- package/public/docs/tuning-reference/bottleneck-retry-waste.html +5 -4
- package/public/docs/tuning-reference/bottleneck-shuffle.html +5 -4
- package/public/docs/tuning-reference/bottleneck-skew.html +5 -4
- package/public/docs/tuning-reference/bottleneck-slow-host.html +5 -4
- package/public/docs/tuning-reference/bottleneck-small-files.html +5 -4
- package/public/docs/tuning-reference/bottleneck-spill.html +5 -4
- package/public/docs/tuning-reference/bottleneck-straggler.html +5 -4
- package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +5 -4
- package/public/docs/tuning-reference/bottleneck-utilization.html +5 -4
- package/public/docs/tuning-reference/caching.html +5 -4
- package/public/docs/tuning-reference/cluster-config.html +5 -4
- package/public/docs/tuning-reference/config.html +5 -4
- package/public/docs/tuning-reference/data-formats.html +5 -4
- package/public/docs/tuning-reference/index.html +5 -4
- package/public/docs/tuning-reference/intro.html +5 -4
- package/public/docs/tuning-reference/joins.html +5 -4
- package/public/docs/tuning-reference/memory-model.html +5 -4
- package/public/docs/tuning-reference/metrics.html +5 -4
- package/public/docs/tuning-reference/partitioning.html +5 -4
- package/public/docs/tuning-reference/pyspark.html +5 -4
- package/public/docs/tuning-reference/shuffle.html +5 -4
- package/public/docs/tuning-reference/spark-architecture.html +5 -4
- package/public/docs/tuning-reference/table-formats.html +5 -4
- package/public/docs/user-guide/alternative-log-retrieval.html +14 -7
- package/public/docs/user-guide/getting-started.html +27 -8
- package/public/docs/user-guide/mcp-tools.html +46 -28
- package/public/docs/user-guide/run-comparison.html +7 -6
- package/public/docs/user-guide/understanding-findings.html +7 -6
- package/public/export-template.html +44 -44
- package/public/index.html +2 -2
- package/vendor-core/allocation.js +106 -0
- package/vendor-core/analyzer.js +13 -13
- package/vendor-core/cli/budgets.js +23 -9
- package/vendor-core/cli/collect-run.js +11 -4
- package/vendor-core/cli/regression-budgets.js +83 -0
- package/vendor-core/comparison-verdict.js +22 -22
- package/vendor-core/core-source-hash.txt +1 -1
- package/vendor-core/detectors.js +202 -68
- package/vendor-core/docs-content/detection/cache.md +3 -2
- package/vendor-core/docs-content/detection/cfg.md +9 -8
- package/vendor-core/docs-content/detection/chrn.md +1 -2
- package/vendor-core/docs-content/detection/cold.md +4 -2
- package/vendor-core/docs-content/detection/fail.md +3 -2
- package/vendor-core/docs-content/detection/gc.md +3 -2
- package/vendor-core/docs-content/detection/host.md +2 -1
- package/vendor-core/docs-content/detection/local.md +1 -1
- package/vendor-core/docs-content/detection/mem.md +5 -2
- package/vendor-core/docs-content/detection/plan.md +2 -1
- package/vendor-core/docs-content/detection/sfail.md +2 -1
- package/vendor-core/docs-content/detection/shape.md +5 -4
- package/vendor-core/docs-content/detection/skew.md +3 -1
- package/vendor-core/docs-content/detection/slow.md +2 -2
- package/vendor-core/docs-content/detection/spec.md +2 -3
- package/vendor-core/docs-content/detection/spill.md +1 -1
- package/vendor-core/docs-site-config.js +1 -1
- package/vendor-core/effective-conf.js +107 -0
- package/vendor-core/efficiency-model.js +8 -6
- package/vendor-core/event-handlers.js +160 -47
- package/vendor-core/event-schemas.js +2 -0
- package/vendor-core/evidence-report.js +18 -10
- package/vendor-core/finding-generic-recommendation.js +20 -1
- package/vendor-core/finding-names.js +7 -0
- package/vendor-core/finding-presentation.js +61 -26
- package/vendor-core/finding-tag-help.js +1 -1
- package/vendor-core/finding-types.js +12 -0
- package/vendor-core/format-utils.js +4 -3
- package/vendor-core/impact-estimator.js +20 -2
- package/vendor-core/impact-format.js +14 -13
- package/vendor-core/impact-model.js +27 -5
- package/vendor-core/ingest.js +4 -2
- package/vendor-core/list-runs.js +5 -2
- package/vendor-core/mcp-tools.js +1 -1
- package/vendor-core/model-assembler.js +23 -1
- package/vendor-core/parser-worker.js +1 -1
- package/vendor-core/proxy.js +3 -1
- package/vendor-core/python-stage.js +25 -0
- package/vendor-core/recommendation-rollup.js +16 -9
- package/vendor-core/redact.js +51 -10
- package/vendor-core/remediation.js +20 -0
- package/vendor-core/run-comparison.js +43 -24
- package/vendor-core/run-interpretation.js +2 -1
- package/vendor-core/run-metrics.js +198 -0
- package/vendor-core/run-totals.js +24 -0
- package/vendor-core/run-verdict.js +3 -4
- package/vendor-core/scorecard-estimates.js +1 -0
- package/vendor-core/session-snapshot.js +7 -0
- package/vendor-core/shs-schemas.js +2 -2
- package/vendor-core/spark-memory.js +17 -0
- package/vendor-core/stage-plan-nodes.js +18 -0
- package/vendor-core/stage-quantiles.js +4 -0
- package/vendor-core/types.js +49 -1
- package/vendor-core/wasted-core-hours.js +10 -7
- package/vendor-core/write-targets.js +312 -0
- package/public/assets/AutoscalingChurn-CUSIvvab.js +0 -1
- package/public/assets/CacheUtilization-Ce0K6_X2.js +0 -1
- package/public/assets/CachingOpportunity-Cn-LmRA4.js +0 -1
- package/public/assets/ColdStart-BoiYzEyV.js +0 -1
- package/public/assets/ConfigAudit-BoJc6PAw.js +0 -1
- package/public/assets/CoreUsageArea-BFfXKu7K.js +0 -1
- package/public/assets/Dashboard-Bo_1jGqH.js +0 -2
- package/public/assets/DisclosureContext-LYzHroHO.js +0 -1
- package/public/assets/DuplicatePlanSubtree-BaAuGAoo.js +0 -1
- package/public/assets/ExecutorUtilization-OE6VMFkG.js +0 -1
- package/public/assets/GcPressure-AoL_ZNrV.js +0 -1
- package/public/assets/IncompleteRun-Bv6IzgsQ.js +0 -1
- package/public/assets/JobFailures-DF3U2z1f.js +0 -1
- package/public/assets/MemoryUtilization-B65OVZlq.js +0 -1
- package/public/assets/OverBroadcast-DXbJREDl.js +0 -1
- package/public/assets/PartitionSizing-DZLnjy0d.js +0 -1
- package/public/assets/PlanGraphRoute-C-BGmC6j.js +0 -1
- package/public/assets/RetryWaste-BbEPsdMw.js +0 -1
- package/public/assets/ShuffleIO-wZB94LS8.js +0 -1
- package/public/assets/Skew-SpQE7zeJ.js +0 -1
- package/public/assets/SlowHost-DwDBCTvr.js +0 -1
- package/public/assets/SmallFiles-yjY_6sT1.js +0 -1
- package/public/assets/SpeculationWaste-73PDmj0c.js +0 -1
- package/public/assets/Spill-DEw0Kd1i.js +0 -1
- package/public/assets/StageFailed-BEfXdEJc.js +0 -1
- package/public/assets/StageFindingGroup-Bzm2TY03.js +0 -1
- package/public/assets/StageShape-CzR4jHOt.js +0 -1
- package/public/assets/StageSlowness-vMPsnAaa.js +0 -1
- package/public/assets/Straggler-Cf__OGl5.js +0 -1
- package/public/assets/TaskFailures-BZ8kLZiO.js +0 -1
- package/public/assets/UnderBroadcast-CBm8ZPoS.js +0 -1
- package/public/assets/index-CEM9bz_x.js +0 -13
- package/public/assets/useRecentFiles-BrBl-AP1.js +0 -11
- package/public/docs/assets/chunks/@localSearchIndexroot.DbZy5EtM.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.VTcYTH4d.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.VTcYTH4d.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.CsqZHz_T.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_drill-down.md.CFNCE8JB.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.HT9IJGIl.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.HT9IJGIl.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_index.md.3TO9ic6w.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.CTEqVeV4.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.CTEqVeV4.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.DOTVHjTV.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.BmpARZve.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.21pTYhFF.js +0 -6
- package/public/docs/assets/contributor-guide_contributing.md.B2E9ni79.js +0 -1
- package/public/docs/assets/contributor-guide_development-setup.md.CjgZJwjK.js +0 -15
- package/public/docs/assets/contributor-guide_development-setup.md.CjgZJwjK.lean.js +0 -1
- package/public/docs/assets/contributor-guide_testing.md.DTwhpoN2.js +0 -1
- package/public/docs/assets/user-guide_alternative-log-retrieval.md.ZHPSbBkF.js +0 -1
- package/public/docs/assets/user-guide_alternative-log-retrieval.md.ZHPSbBkF.lean.js +0 -1
- package/public/docs/assets/user-guide_getting-started.md.CEa2ZX-l.js +0 -6
- package/public/docs/assets/user-guide_getting-started.md.CEa2ZX-l.lean.js +0 -1
- package/public/docs/assets/user-guide_run-comparison.md.ChLI3MK0.js +0 -1
- package/public/docs/assets/user-guide_understanding-findings.md.D1ccs60C.js +0 -1
- /package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.CsqZHz_T.lean.js → contributor-guide_architecture_detector-contract.md.caA46z-u.lean.js} +0 -0
- /package/public/docs/assets/{user-guide_understanding-findings.md.D1ccs60C.lean.js → user-guide_understanding-findings.md.DzReyCXb.lean.js} +0 -0
package/index.js
CHANGED
|
@@ -121,6 +121,9 @@ Server fetches on your behalf (server-to-server, so no browser CORS
|
|
|
121
121
|
restriction). Binds to 127.0.0.1 only. Default port ${DEFAULT_PORT},
|
|
122
122
|
overridden by --port or the PORT env var.
|
|
123
123
|
|
|
124
|
+
Also serves the SparkForensics MCP tools over streamable HTTP at /mcp,
|
|
125
|
+
for clients on this machine, with the default detector thresholds.
|
|
126
|
+
|
|
124
127
|
See https://github.com/shuffle-works/sparkforensics#readme for details.
|
|
125
128
|
`;
|
|
126
129
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sparkforensics-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Local companion server for the SparkForensics dashboard: serves the app and proxies Spark History Server fetches to avoid browser CORS restrictions.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,T as n,f as r,l as i,o as a,s as o,t as s,v as c,w as l}from"./charts-vendor-0VMaLVLN.js";import{S as u,d,u as f}from"./DisclosureContext-Ds0hcZFn.js";import{p}from"./plan-graph-vendor-B0sEms9Z.js";import{_ as m,b as h}from"./useRecentFiles-Bb4-ukVz.js";import{C as g}from"./index-DaC8A2FS.js";import{c as _,o as v,t as y}from"./Dashboard-CC_BXrNy.js";var b=e(t(),1),x=p(),S=60,C=6e4,w=220;function T(e,t,n,r,i){if(e.length===0&&t.length===0)return[];let a=Math.max(i,r-n),o=Math.max(1,Math.ceil(a/i)),s=[];for(let e=0;e<o;e++)s.push({tStart:n+e*i,adds:0,removes:0});let c=e=>Math.min(o-1,Math.max(0,Math.floor((e-n)/i)));for(let t of e)s[c(t.timestamp)].adds++;for(let e of t)s[c(e.timestamp)].removes++;return s}function E(e,t){let n=Math.max(1,t-e);return Math.max(C,Math.ceil(n/S))}function D(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e)),n=e/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function O(e){let t=D(e.reduce((e,t)=>Math.max(e,Math.abs(t.added),Math.abs(t.removed)),0));return{domain:[-t,t],ticks:[-t,-t/2,0,t/2,t]}}function k(e){return Math.abs(e.height)<1?null:(0,x.jsx)(l,{...e})}function A({finding:e}){return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1 transition-colors`,children:[(0,x.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Short-lived executors: `,(0,x.jsxs)(`strong`,{children:[e.value,`%`]})]}),(0,x.jsx)(y,{finding:e}),(0,x.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,x.jsx)(f,{impactBand:e.impactBand,className:`mt-1.5`}),(0,x.jsx)(`span`,{children:(0,x.jsx)(u,{anchor:`#config-autoscale-bounds`,children:`Tuning executorIdleTimeout and the min/max bounds`})})]})]})}var j=(0,b.memo)(function({appModel:e,activeFileId:t,catalog:l=[],defaultCollapsed:u=!0}){let f=(0,b.useMemo)(()=>{let t=e.executors.added,n=e.executors.removed;if(t.length===0&&n.length===0)return{hasEvents:!1,added:t,removed:n};let r=e.app,i=r?.startTime??0,a=r?.endTime??i,o=E(i,a),s=_(T(t,n,i,a,o)).map(e=>({t:`${Math.round((e.tStart-i)/1e3)}s`,added:e.adds,removed:-e.removes}));return{hasEvents:!0,added:t,removed:n,rows:s,yAxisScale:O(s)}},[e,t]);if(!f.hasEvents)return(0,x.jsx)(g,{title:`Autoscaling Churn`,summary:(0,x.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`No executor add/remove events (static allocation).`}),children:(0,x.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No executor add/remove events (static allocation).`})});let{added:p,removed:y,rows:S,yAxisScale:C}=f,D=l.find(e=>e.type===`autoscalingChurn`);return(0,x.jsx)(g,{title:`Autoscaling Churn`,impactBand:D?.impactBand,fixFor:D?[D]:[],badges:D&&(0,x.jsx)(d,{type:`autoscalingChurn`,impactBand:D.impactBand}),defaultCollapsed:u,summary:(0,x.jsx)(v,{value:`${p.length} added / ${y.length} removed`,context:D?`${D.value}% short-lived executors, ${D.impactBand}`:`executor churn events`}),children:(0,x.jsxs)(`div`,{className:`space-y-2`,children:[D&&(0,x.jsx)(A,{finding:D}),(0,x.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`executors added / removed over time`}),(0,x.jsx)(h,{ariaLabel:`Executor added and removed counts per time bucket over the run.`,height:w,table:{caption:`Executor added/removed counts by time bucket`,columns:[`Time`,`Executors added`,`Executors removed`],rows:S.map(e=>[e.t,e.added,Math.abs(e.removed)]),align:[`right`,`right`,`right`]},children:(0,x.jsxs)(s,{data:S,children:[(0,x.jsx)(r,{stroke:m.muted,strokeOpacity:.2}),(0,x.jsx)(o,{dataKey:`t`,tick:{fontSize:10}}),(0,x.jsx)(a,{tick:{fontSize:10},width:32,domain:C.domain,ticks:C.ticks}),(0,x.jsx)(c,{formatter:(e,t)=>[Math.abs(Number(e)),t]}),(0,x.jsx)(n,{wrapperStyle:{fontSize:10}}),(0,x.jsx)(i,{dataKey:`added`,name:`Added`,stackId:`churn`,fill:m.clean,shape:k}),(0,x.jsx)(i,{dataKey:`removed`,name:`Removed`,stackId:`churn`,fill:m.muted,shape:k})]})})]})})});export{j as AutoscalingChurn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,S as r,U as i,Y as a,at as o,d as s,it as c,u as l,ut as u}from"./DisclosureContext-Ds0hcZFn.js";import{p as d}from"./plan-graph-vendor-B0sEms9Z.js";import{m as f}from"./useRecentFiles-Bb4-ukVz.js";import{C as p,F as m,I as h,L as g,M as _,N as v,O as y,R as b}from"./index-DaC8A2FS.js";import{o as x,r as S,t as C}from"./Dashboard-CC_BXrNy.js";import{n as w}from"./finding-anchor-Dl8mIHiU.js";import{t as T}from"./usePagedRows-Bo-aSztx.js";var E=e(t(),1),D=d(),O=70;function k(e){if(!e)return`—`;let t=[];return e.useMemory&&t.push(`Memory`),e.useDisk&&t.push(`Disk`),e.deserialized?t.push(`Deserialized`):(e.useMemory||e.useDisk)&&t.push(`Serialized`),(e.replication??1)>1&&t.push(`x${e.replication}`),t.join(` · `)||`—`}function A(e){return e.name||`RDD ${e.id}`}function j(e){let t=o(A(e));return t.length<=O?t:`${t.slice(0,O)}…`}function M(e){if(e.variant===`storageUnobserved`)return`No block updates logged: cached partition counts and sizes are unknown`;let t=n(`pct`,c(e));return e.variant===`diskSpillover`?`${t} spilled to disk: ${a(e.diskSize??0)} disk / ${a(e.memorySize??0)} memory`:`${t} cached (${e.numCachedPartitions??0}/${e.numPartitions??0} partitions)`}function N({finding:e}){let t=w([e]),n=e.dataUnavailable?`Cache storage not logged`:e.rddName??`RDD ${e.rddId}`;return(0,D.jsxs)(`div`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 transition-colors ${t.flashClassName}`,children:[(0,D.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2`,children:[(0,D.jsx)(l,{impactBand:e.impactBand,className:`mt-1.5`}),(0,D.jsx)(`span`,{children:n})]}),(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.dataUnavailable?e.recommendation:M(e)}),(0,D.jsx)(C,{finding:e})]})}var P=(0,E.memo)(function({appModel:e,catalog:t}){let[n,o]=(0,E.useState)(0),[d,C]=(0,E.useState)(0),w=e.app?.rddInfo,O=(0,E.useMemo)(()=>w?[...w.values()].filter(e=>(e.storageLevel?.useMemory||e.storageLevel?.useDisk)&&(e.numCachedPartitions??0)>0).sort((e,t)=>(t.memorySize??0)+(t.diskSize??0)-((e.memorySize??0)+(e.diskSize??0))):[],[w]),M=(0,E.useMemo)(()=>f(t,`cacheUtilization`).sort((e,t)=>i[e.impactBand]-i[t.impactBand]),[t]),P=T(O,n,o),F=y(),I=F?M.findIndex(e=>e===F.finding):null,L=T(M,d,C,I),R=M.find(e=>e.dataUnavailable);if(O.length===0&&!R)return null;let z=e=>M.filter(t=>t.rddId===e),B=O.reduce((e,t)=>e+(t.memorySize??0)+(t.diskSize??0),0);return(0,D.jsx)(`div`,{"data-widget":`cache-utilization`,children:(0,D.jsxs)(p,{title:`Cache Storage`,fixFor:M,impactBand:u(M),badges:(0,D.jsxs)(D.Fragment,{children:[M.length>0?(0,D.jsx)(s,{type:`cacheUtilization`,impactBand:u(M)??`info`}):null,(0,D.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[O.length>0?`${O.length} cached RDD${O.length===1?``:`s`}`:`cache storage not logged`,`, see`,` `,(0,D.jsx)(r,{anchor:`#memory-model`,children:`how Spark accounts cached memory`})]})]}),defaultCollapsed:!0,summary:O.length>0?(0,D.jsx)(x,{value:a(B),context:`cached across memory + disk`}):(0,D.jsx)(x,{value:`Unknown`,context:`${c(R)} persisted, no block updates`}),children:[O.length>0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(_,{children:[(0,D.jsx)(g,{children:(0,D.jsxs)(b,{children:[(0,D.jsx)(h,{children:`RDD`}),(0,D.jsx)(h,{children:`Storage level`}),(0,D.jsx)(h,{className:`text-right`,children:`Cached partitions`}),(0,D.jsx)(h,{className:`text-right`,children:`Memory`}),(0,D.jsx)(h,{className:`text-right`,children:`Disk`})]})}),(0,D.jsx)(v,{children:P.visible.map(e=>{let t=A(e),n=j(e),r=z(e.id);return(0,D.jsxs)(b,{children:[(0,D.jsxs)(m,{className:`max-w-80 truncate`,title:t===n?void 0:t,children:[n,r.length>0&&(0,D.jsx)(l,{impactBand:u(r)??`info`,className:`ml-1.5`})]}),(0,D.jsx)(m,{children:k(e.storageLevel)}),(0,D.jsxs)(m,{className:`text-right`,children:[e.numCachedPartitions,` / `,e.numPartitions]}),(0,D.jsx)(m,{className:`text-right`,children:a(e.memorySize??0)}),(0,D.jsx)(m,{className:`text-right`,children:a(e.diskSize??0)})]},e.id)})})]}),(0,D.jsx)(S,{page:P.effectivePage,totalPages:P.totalPages,onPrev:()=>o(e=>e-1),onNext:()=>o(e=>e+1)})]}):null,M.length>0?(0,D.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm`,children:[L.visible.map(e=>(0,D.jsx)(N,{finding:e},e.id)),(0,D.jsx)(S,{page:L.effectivePage,totalPages:L.totalPages,onPrev:()=>C(e=>e-1),onNext:()=>C(e=>e+1)})]}):null]})})});export{P as CacheUtilization};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{E as n,Y as r,_t as i,d as a,p as o}from"./DisclosureContext-Ds0hcZFn.js";import{p as s}from"./plan-graph-vendor-B0sEms9Z.js";import{h as c,m as l}from"./useRecentFiles-Bb4-ukVz.js";import{C as u,F as d,I as f,L as p,M as m,N as h,O as g,R as _}from"./index-DaC8A2FS.js";import{o as v,r as y,t as b}from"./Dashboard-CC_BXrNy.js";import{n as x}from"./finding-anchor-Dl8mIHiU.js";import{t as S}from"./usePagedRows-Bo-aSztx.js";var C={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};C.node;var w=i(C),T=e(t(),1),E=s();function D({relations:e,operator:t}){let n=t===`union`?`union`:`join`;return(0,E.jsx)(`span`,{className:`inline-flex flex-wrap items-baseline`,children:e.map((e,t)=>(0,E.jsxs)(`span`,{children:[t>0?(0,E.jsxs)(E.Fragment,{children:[` `,(0,E.jsx)(`span`,{className:`mx-1 font-semibold uppercase text-xs tracking-wide text-primary`,children:n}),` `]}):null,e.relation]},e.relation))})}function O({finding:e}){let t=x([e]),i=e.variant===`composite`;return(0,E.jsxs)(_,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`transition-colors ${t.flashClassName}`,children:[(0,E.jsx)(d,{children:(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[i?(0,E.jsx)(w,{className:`size-3.5 text-muted-foreground`,"aria-hidden":`true`}):null,i&&e.relations&&e.relations.length>0?(0,E.jsx)(D,{relations:e.relations,operator:e.operator}):(0,E.jsx)(`span`,{children:e.relation}),i?(0,E.jsx)(n,{variant:`outline`,className:`text-xs uppercase border-dashed`,children:e.operator?.toUpperCase()}):(0,E.jsx)(n,{variant:`secondary`,className:`text-xs uppercase`,children:e.format})]})}),(0,E.jsxs)(d,{children:[e.value,` queries`]}),(0,E.jsx)(d,{className:`text-right`,children:r(e.totalReadBytes)}),(0,E.jsxs)(d,{children:[(0,E.jsx)(b,{finding:e}),(0,E.jsx)(o,{children:(0,E.jsx)(c,{confidence:e.confidence,validationRequired:e.validationRequired})})]})]})}var k=(0,T.memo)(function({catalog:e,defaultCollapsed:t=!0}){let[n,r]=(0,T.useState)(0),i=(0,T.useMemo)(()=>l(e,`cachingOpportunity`).sort((e,t)=>t.totalReadBytes-e.totalReadBytes||(t.value??0)-(e.value??0)),[e]),s=g(),c=s?i.findIndex(e=>e===s.finding):null,{totalPages:d,effectivePage:b,visible:x}=S(i,n,r,c);if(i.length===0)return null;let C=i[0];return(0,E.jsx)(u,{title:`Caching Opportunities`,fixFor:i,impactBand:`info`,badges:(0,E.jsx)(a,{type:`cachingOpportunity`,impactBand:`info`}),defaultCollapsed:t,summary:(0,E.jsx)(v,{value:`${C.value}×`,context:`read by ${C.value} queries: ${C.relation}`}),children:(0,E.jsxs)(`div`,{className:`space-y-3`,children:[(0,E.jsxs)(m,{children:[(0,E.jsx)(p,{children:(0,E.jsxs)(_,{children:[(0,E.jsx)(f,{children:`Relation`}),(0,E.jsx)(f,{children:`Read by`}),(0,E.jsx)(f,{className:`text-right`,children:`Data read`}),(0,E.jsx)(f,{children:`Estimate`})]})}),(0,E.jsx)(h,{children:x.map((e,t)=>(0,E.jsx)(O,{finding:e},`${e.format}:${e.relation}:${(e.executionIds??[]).join(`,`)}:${t}`))})]}),(0,E.jsx)(o,{children:(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Reuse is inferred from plan structure, not confirmed by execution. Verify before caching.`})}),(0,E.jsx)(y,{page:b,totalPages:d,onPrev:()=>r(e=>e-1),onNext:()=>r(e=>e+1)})]})})});export{k as CachingOpportunity};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{U as n,d as r,u as i}from"./DisclosureContext-Ds0hcZFn.js";import{p as a}from"./plan-graph-vendor-B0sEms9Z.js";import{C as o,O as s}from"./index-DaC8A2FS.js";import{o as c,r as l,s as u,t as d}from"./Dashboard-CC_BXrNy.js";import{r as f}from"./impact-sort-Eihua9dY.js";import{n as p}from"./finding-anchor-Dl8mIHiU.js";import{t as m}from"./usePagedRows-Bo-aSztx.js";import{n as h,t as g}from"./useSortMode-lDedD5a3.js";var _=e(t(),1),v=a();function y(e){return`${e.value}s`}function b({finding:e}){let t=p([e]);return(0,v.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 text-sm transition-colors ${t.flashClassName}`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(i,{impactBand:e.impactBand}),(0,v.jsx)(`strong`,{children:y(e)})]}),(0,v.jsx)(d,{finding:e})]})}var x=(0,_.memo)(function({catalog:e,defaultCollapsed:t=!0}){let{sortMode:i,setSortMode:a,orderBy:d}=g(),[p,x]=(0,_.useState)(!t),[S,C]=(0,_.useState)(0),w=e.filter(e=>e.type===`coldStart`).slice().sort((e,t)=>n[e.impactBand]-n[t.impactBand]),T=d(w,e=>[e],e=>e.stageId??null),E=s(),D=E?T.findIndex(e=>e===E.finding):null,{totalPages:O,effectivePage:k,visible:A}=m(T,S,C,D);return w.length===0?null:(0,v.jsxs)(o,{title:`Cold Start`,fixFor:w,impactBand:w[0].impactBand,badges:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(r,{type:`coldStart`,impactBand:w[0].impactBand}),f(w,w.length,p)?(0,v.jsx)(h,{mode:i,onChange:a}):null]}),open:p,onOpenChange:x,summary:(0,v.jsx)(c,{value:y(w[0]),context:u(w.length)}),children:[(0,v.jsx)(`ul`,{className:`space-y-2`,children:A.map(e=>(0,v.jsx)(b,{finding:e},e.id))}),(0,v.jsx)(l,{page:k,totalPages:O,onPrev:()=>C(e=>e-1),onNext:()=>C(e=>e+1)})]})});export{x as ColdStart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{S as n,U as r,d as i,j as a,p as o,u as s,ut as c}from"./DisclosureContext-Ds0hcZFn.js";import{p as l}from"./plan-graph-vendor-B0sEms9Z.js";import{h as u,m as d}from"./useRecentFiles-Bb4-ukVz.js";import{C as f,O as p,l as m}from"./index-DaC8A2FS.js";import{o as h,r as g,t as _}from"./Dashboard-CC_BXrNy.js";import{n as v}from"./finding-anchor-Dl8mIHiU.js";import{t as y}from"./usePagedRows-Bo-aSztx.js";var b=e(t(),1),x=l();function S({finding:e}){let t=v([e]);return(0,x.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-1 transition-colors ${t.flashClassName}`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(s,{impactBand:e.impactBand}),(0,x.jsx)(`code`,{className:`text-xs`,children:e.property}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`=`}),(0,x.jsx)(`code`,{className:`rounded bg-accent/10 px-1.5 py-0.5 font-mono text-xs text-accent`,children:e.valueText})]}),(0,x.jsx)(_,{finding:e}),(0,x.jsxs)(`p`,{className:`text-sm`,children:[m(e.recommendation??``).measured??e.recommendation,e.docAnchor?(0,x.jsxs)(x.Fragment,{children:[` `,(0,x.jsxs)(n,{anchor:e.docAnchor,children:[`Why `,e.property,` matters`]})]}):null]})]})}var C=(0,b.memo)(function({appModel:e,configFindings:t,defaultCollapsed:n=!0}){let[s,l]=(0,b.useState)(0),m=(0,b.useMemo)(()=>d(t??[],`configAudit`).sort((e,t)=>r[e.impactBand]-r[t.impactBand]),[t]),_=p(),v=_?m.findIndex(e=>e===_.finding):null,{totalPages:C,effectivePage:w,visible:T}=y(m,s,l,v);if(m.length===0){let t=e.evidenceAvailability?.entries.find(e=>e.key===`sparkConfiguration`),n;if(t)n=t.state===`present`?`No misconfigurations detected.`:t.state===`unknown`&&t.reasonCode===`parseIncomplete`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{children:[t.summary,` `]}),(0,x.jsx)(o,{children:(0,x.jsx)(u,{evidenceKey:`sparkConfiguration`})})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{children:`No environment info captured in this log. `}),(0,x.jsx)(o,{children:(0,x.jsx)(u,{evidenceKey:`sparkConfiguration`})})]});else{let t=e.app?.evidenceInputs;n=(t?t.environmentUpdates>0:Object.keys(e.app?.config??{}).length>0||e.app?.resources)?`No misconfigurations detected.`:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{children:`No environment info captured in this log. `}),(0,x.jsx)(o,{children:(0,x.jsx)(u,{evidenceKey:`sparkConfiguration`})})]})}let r=(0,x.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:n});return(0,x.jsx)(f,{title:`Config Audit`,compact:!0,summary:r,children:r})}let E=c(m);return(0,x.jsxs)(f,{title:`Config Audit`,fixFor:m,impactBand:E,badges:(0,x.jsx)(i,{type:`configAudit`,impactBand:E??`info`,docAnchor:a(m)}),statusBadge:(0,x.jsx)(o,{children:(0,x.jsx)(u,{evidenceKey:`sparkConfiguration`})}),defaultCollapsed:n,summary:(0,x.jsx)(h,{value:`${m.length}`,context:`misconfiguration${m.length===1?``:`s`} flagged`}),children:[(0,x.jsx)(`ul`,{className:`space-y-4`,children:T.map(e=>(0,x.jsx)(S,{finding:e},e.id))}),(0,x.jsx)(g,{page:w,totalPages:C,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1)})]})});export{C as ConfigAudit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,T as n,f as r,n as i,o as a,s as o,u as s,v as c}from"./charts-vendor-0VMaLVLN.js";import{B as l,S as u,X as d,b as f,d as p,p as m,u as h}from"./DisclosureContext-Ds0hcZFn.js";import{p as g}from"./plan-graph-vendor-B0sEms9Z.js";import{_,b as v,h as y,y as b}from"./useRecentFiles-Bb4-ukVz.js";import{C as x}from"./index-DaC8A2FS.js";import{c as S,f as C,o as w,p as T,r as E,t as D}from"./Dashboard-CC_BXrNy.js";import{t as O}from"./usePagedRows-Bo-aSztx.js";var k=e(t(),1),A=g(),j=240,M={PROCESS_LOCAL:`Process-local`,NODE_LOCAL:`Node-local`,RACK_LOCAL:`Rack-local`,NO_PREF:`No preference`,ANY:`Any`,OTHER:`Other`,idle:`Idle`},N={PROCESS_LOCAL:_.clean,NODE_LOCAL:_.accent,RACK_LOCAL:_.warning,NO_PREF:_.muted,ANY:_.critical,OTHER:_.muted,idle:_.muted},P=`Core Usage by Locality`,F=(0,k.memo)(function({catalog:e,defaultCollapsed:t=!0}){let[g,F]=(0,k.useState)(0),I=f()?.data.coreLocality,L=(0,k.useMemo)(()=>{let e=I?.chart??{hasActivity:!1};return e.hasActivity?{...e,sampled:S(e.points)}:e},[I]),R=I?.ratio.topStages??[],z=e.find(e=>e.type===`coreLocality`),B=e.some(e=>e.type===`memoryUtilization`&&e.variant===`idleCores`),V=R.filter(e=>e.nonLocalTasks>0),{totalPages:H,effectivePage:U,visible:W}=O(V,g,F);if(!L.hasActivity)return(0,A.jsx)(x,{title:P,summary:(0,A.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`No stage activity to plot.`}),children:(0,A.jsx)(C,{tone:`neutral`,icon:T,title:`No stage activity to plot.`})});let{order:G,points:K,sampled:q,peakCores:J}=L;return(0,A.jsx)(x,{title:P,impactBand:z?.impactBand,badges:z?(0,A.jsx)(p,{type:`coreLocality`,impactBand:z.impactBand}):null,defaultCollapsed:t,summary:(0,A.jsx)(w,{value:`${d(J)} cores`,context:`busy at the peak`}),children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(m,{children:(0,A.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`approximate: stage-level attribution`,z?null:(0,A.jsxs)(A.Fragment,{children:[`, see `,(0,A.jsx)(u,{anchor:`#bottleneck-utilization`,children:`how utilization is measured`})]})]})}),z?(0,A.jsxs)(`p`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,A.jsx)(h,{impactBand:z.impactBand,className:`mt-1.5`}),(0,A.jsxs)(`span`,{children:[(0,A.jsxs)(`strong`,{children:[z.value,`% non-local`]}),`. `,l(z)]})]}):null,z?(0,A.jsx)(D,{finding:z}):null,(0,A.jsx)(m,{children:z?(0,A.jsx)(y,{confidence:z.confidence,validationRequired:z.validationRequired}):null}),(0,A.jsx)(v,{ariaLabel:`Approximate concurrent core usage over time, stacked by task locality tier, with idle capacity shown. See the legend for tier colors.`,height:j,table:{caption:`Concurrent core usage over time by locality tier`,columns:[`Time (s)`,...G.map(e=>M[e]??e)],rows:K.map(e=>[e.t,...G.map(t=>Math.round(e[t]))]),align:Array.from({length:G.length+1},()=>`right`)},children:(0,A.jsxs)(i,{data:q,children:[(0,A.jsx)(r,{vertical:!1,stroke:_.muted,strokeOpacity:.2}),(0,A.jsx)(o,{dataKey:`t`,tick:{fontSize:10},label:{value:`seconds from app start`,position:`insideBottom`,offset:-2,fontSize:10}}),(0,A.jsx)(a,{tick:{fontSize:10},width:36,label:{value:`avg concurrent cores`,angle:-90,position:`insideLeft`,fontSize:10}}),(0,A.jsx)(c,{...b}),(0,A.jsx)(n,{wrapperStyle:{fontSize:10}}),G.map(e=>(0,A.jsx)(s,{type:`monotone`,dataKey:e,name:M[e]??e,stackId:`cores`,stroke:N[e]??_.muted,fill:N[e]??_.muted,fillOpacity:e===`idle`?.15:.8,isAnimationActive:!1},e))]})}),(0,A.jsx)(m,{children:W.length>0?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`ul`,{className:`space-y-1 text-xs text-muted-foreground`,children:W.map(e=>(0,A.jsxs)(`li`,{children:[`Stage `,e.stageId,`: `,Math.round(e.ratio*100),`% non-local (`,e.nonLocalTasks,`/`,e.taskCount,` tasks)`]},e.stageId))}),(0,A.jsx)(E,{page:U,totalPages:H,onPrev:()=>F(e=>e-1),onNext:()=>F(e=>e+1)})]}):null}),(0,A.jsx)(m,{children:B?(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Idle cores also flagged → see Memory Utilization widget`}):null})]})})});export{F as CoreUsageArea};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Skew-PL79TppX.js","./rolldown-runtime-hePW80VL.js","./charts-vendor-0VMaLVLN.js","./DisclosureContext-Ds0hcZFn.js","./react-vendor-BAKt3vny.js","./plan-graph-vendor-B0sEms9Z.js","./plan-graph-vendor-DLioOiRN.css","./StageFindingGroup-B1A0nf-e.js","./useRecentFiles-Bb4-ukVz.js","./index-DaC8A2FS.js","./index-BcqTLKFp.css","./impact-sort-Eihua9dY.js","./finding-anchor-Dl8mIHiU.js","./usePagedRows-Bo-aSztx.js","./useSortMode-lDedD5a3.js","./StageHeader-BMNmUy-s.js","./PlanExplorer-Dd9WPK4S.js","./StageShape-DO3mQ6NS.js","./TinyTask-COUQQ5bQ.js","./ShuffleIO-CW7U68ph.js","./select-DkjFHlXR.js","./PartitionHint-DThaMMRT.js","./PartitionSizing-yIN-iZzx.js","./Spill-CH1bNpxL.js","./GcPressure-ByJlLOua.js","./StageFailed-YvxC11ii.js","./TaskFailures-Bj0QxiOc.js","./RetryWaste-CXH4D-xH.js","./SlowHost-GBO73hCi.js","./StageSlowness-SwRxfAEx.js","./Straggler-DHLTiBY-.js","./SpeculationWaste-mxi3jgb0.js","./ColdStart-BtS12b6_.js","./MemoryUtilization-DH4jYvJK.js","./ExecutorUtilization-CZObSLIj.js","./CachingOpportunity-Cfw3wAFa.js","./JobFailures-LbMvAwAb.js","./ConfigAudit-DNPV6EQg.js","./DuplicatePlanSubtree-vN3zqRsi.js","./SmallFiles-B5cUjEav.js","./UnderBroadcast-RAUbQ6vw.js","./OverBroadcast-euk6HKg4.js","./CacheUtilization-MBDfMsKC.js","./CoreUsageArea-BObEeenE.js","./AutoscalingChurn-9Zo6IMGS.js","./IncompleteRun-MzqV4W8y.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{D as t,M as n,O as r,T as i,_ as a,a as o,d as s,f as c,i as l,l as u,n as d,o as f,p,s as m,u as h,v as g}from"./charts-vendor-0VMaLVLN.js";import{A as _,D as v,E as y,M as b,O as x,P as S,j as C,k as ee}from"./react-vendor-BAKt3vny.js";import{B as te,E as w,G as ne,K as re,O as ie,P as T,S as ae,T as E,Tt as D,U as oe,Y as O,Z as k,_ as se,_t as ce,at as le,b as A,bt as j,d as ue,g as de,gt as fe,h as pe,ht as me,j as he,l as ge,lt as _e,m as ve,o as ye,p as M,q as be,s as xe,tt as Se,u as Ce,ut as we,v as Te,vt as Ee,wt as De,y as Oe,yt as N}from"./DisclosureContext-Ds0hcZFn.js";import{p as ke}from"./plan-graph-vendor-B0sEms9Z.js";import{A as Ae,C as je,D as Me,E as Ne,F as Pe,I as Fe,M as Ie,N as Le,O as Re,P as ze,S as Be,T as Ve,_ as P,a as He,b as F,c as Ue,d as We,f as Ge,g as Ke,h as qe,i as Je,j as Ye,k as Xe,n as Ze,o as Qe,p as $e,r as et,s as tt,t as nt,u as rt,v as it,w as at,x as ot,y as st}from"./useRecentFiles-Bb4-ukVz.js";import{C as I,D as ct,E as L,Et as lt,F as R,I as ut,L as dt,M as ft,N as pt,O as mt,R as z,St as ht,T as gt,Tt as B,U as _t,a as vt,b as V,c as yt,ht as bt,j as xt,l as St,rt as Ct,s as wt,u as Tt,w as Et,x as Dt,xt as Ot}from"./index-DaC8A2FS.js";var kt={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};kt.node;var At=ce(kt),jt={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};jt.node;var Mt=ce(jt),Nt={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Nt.node;var Pt=ce(Nt),Ft={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};Ft.node;var It=ce(Ft),Lt={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Lt.node;var Rt=ce(Lt),zt={name:`search-x`,size:24,node:[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]};zt.node;var Bt=ce(zt),H=e(n(),1),Vt=(0,H.lazy)(()=>V(()=>import(`./Skew-PL79TppX.js`).then(e=>({default:e.Skew})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)),Ht=(0,H.lazy)(()=>V(()=>import(`./StageShape-DO3mQ6NS.js`).then(e=>({default:e.StageShape})),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)),Ut=(0,H.lazy)(()=>V(()=>import(`./TinyTask-COUQQ5bQ.js`).then(e=>({default:e.TinyTask})),__vite__mapDeps([18,1,2,5,6,7,3,4,8,9,10,11,12,13,14,15,16]),import.meta.url)),Wt=(0,H.lazy)(()=>V(()=>import(`./ShuffleIO-CW7U68ph.js`).then(e=>({default:e.ShuffleIO})),__vite__mapDeps([19,1,2,3,4,5,6,8,9,10,11,12,13,14,15,20,16,21]),import.meta.url)),Gt=(0,H.lazy)(()=>V(()=>import(`./PartitionSizing-yIN-iZzx.js`).then(e=>({default:e.PartitionSizing})),__vite__mapDeps([22,1,2,3,4,5,6,8,9,10,11,12,13,14,15,20,16]),import.meta.url)),Kt=(0,H.lazy)(()=>V(()=>import(`./Spill-CH1bNpxL.js`).then(e=>({default:e.Spill})),__vite__mapDeps([23,1,2,3,4,5,6,8,9,10,11,12,13,14,16,21]),import.meta.url)),qt=(0,H.lazy)(()=>V(()=>import(`./GcPressure-ByJlLOua.js`).then(e=>({default:e.GcPressure})),__vite__mapDeps([24,1,2,3,4,5,6,8,9,10,11,12,13,14,15]),import.meta.url)),Jt=(0,H.lazy)(()=>V(()=>import(`./StageFailed-YvxC11ii.js`).then(e=>({default:e.StageFailed})),__vite__mapDeps([25,1,2,3,4,5,6,8,9,10,11,12,13,14]),import.meta.url)),Yt=(0,H.lazy)(()=>V(()=>import(`./TaskFailures-Bj0QxiOc.js`).then(e=>({default:e.TaskFailures})),__vite__mapDeps([26,1,2,3,4,5,6,8,9,10,11,12,13,14]),import.meta.url)),Xt=(0,H.lazy)(()=>V(()=>import(`./RetryWaste-CXH4D-xH.js`).then(e=>({default:e.RetryWaste})),__vite__mapDeps([27,1,2,3,4,5,6,8,9,10,11,12,13,14]),import.meta.url)),Zt=(0,H.lazy)(()=>V(()=>import(`./SlowHost-GBO73hCi.js`).then(e=>({default:e.SlowHost})),__vite__mapDeps([28,1,2,3,4,5,6,8,9,10,11,12,13,14,15]),import.meta.url)),Qt=(0,H.lazy)(()=>V(()=>import(`./StageSlowness-SwRxfAEx.js`).then(e=>({default:e.StageSlowness})),__vite__mapDeps([29,1,2,3,4,5,6,9,10,11,8,12,13,14,15]),import.meta.url)),$t=(0,H.lazy)(()=>V(()=>import(`./Straggler-DHLTiBY-.js`).then(e=>({default:e.Straggler})),__vite__mapDeps([30,1,2,3,4,5,6,8,9,10,11,12,13,14,15]),import.meta.url)),en=(0,H.lazy)(()=>V(()=>import(`./SpeculationWaste-mxi3jgb0.js`).then(e=>({default:e.SpeculationWaste})),__vite__mapDeps([31,1,2,3,4,5,6,9,10,11,8,12,13,14,15]),import.meta.url)),tn=(0,H.lazy)(()=>V(()=>import(`./ColdStart-BtS12b6_.js`).then(e=>({default:e.ColdStart})),__vite__mapDeps([32,1,2,3,4,5,6,9,10,11,8,12,13,14]),import.meta.url)),nn=(0,H.lazy)(()=>V(()=>import(`./MemoryUtilization-DH4jYvJK.js`).then(e=>({default:e.MemoryUtilization})),__vite__mapDeps([33,1,2,3,4,5,6,8,9,10,12,13]),import.meta.url)),rn=(0,H.lazy)(()=>V(()=>import(`./ExecutorUtilization-CZObSLIj.js`).then(e=>({default:e.ExecutorUtilization})),__vite__mapDeps([34,1,2,3,4,5,6,9,10,12,13]),import.meta.url)),an=(0,H.lazy)(()=>V(()=>import(`./CachingOpportunity-Cfw3wAFa.js`).then(e=>({default:e.CachingOpportunity})),__vite__mapDeps([35,1,2,3,4,5,6,8,9,10,12,13]),import.meta.url)),on=(0,H.lazy)(()=>V(()=>import(`./JobFailures-LbMvAwAb.js`).then(e=>({default:e.JobFailures})),__vite__mapDeps([36,3,1,2,4,5,6,8,9,10]),import.meta.url)),sn=(0,H.lazy)(()=>V(()=>import(`./ConfigAudit-DNPV6EQg.js`).then(e=>({default:e.ConfigAudit})),__vite__mapDeps([37,1,2,3,4,5,6,8,9,10,12,13]),import.meta.url)),cn=(0,H.lazy)(()=>V(()=>import(`./DuplicatePlanSubtree-vN3zqRsi.js`).then(e=>({default:e.DuplicatePlanSubtree})),__vite__mapDeps([38,1,2,3,4,5,6,8,9,10,11,12,13,14]),import.meta.url)),ln=(0,H.lazy)(()=>V(()=>import(`./SmallFiles-B5cUjEav.js`).then(e=>({default:e.SmallFiles})),__vite__mapDeps([39,1,2,3,4,5,6,8,9,10,11,12,13,14]),import.meta.url)),un=(0,H.lazy)(()=>V(()=>import(`./UnderBroadcast-RAUbQ6vw.js`).then(e=>({default:e.UnderBroadcast})),__vite__mapDeps([40,1,2,3,4,5,6,8,9,10,11,12,13,14]),import.meta.url)),dn=(0,H.lazy)(()=>V(()=>import(`./OverBroadcast-euk6HKg4.js`).then(e=>({default:e.OverBroadcast})),__vite__mapDeps([41,1,2,3,4,5,6,8,9,10,11,12,13,14]),import.meta.url)),fn=(0,H.lazy)(()=>V(()=>import(`./CacheUtilization-MBDfMsKC.js`).then(e=>({default:e.CacheUtilization})),__vite__mapDeps([42,1,2,3,4,5,6,8,9,10,12,13]),import.meta.url)),pn=(0,H.lazy)(()=>V(()=>import(`./CoreUsageArea-BObEeenE.js`).then(e=>({default:e.CoreUsageArea})),__vite__mapDeps([43,1,2,3,4,5,6,8,9,10,13]),import.meta.url)),mn=(0,H.lazy)(()=>V(()=>import(`./AutoscalingChurn-9Zo6IMGS.js`).then(e=>({default:e.AutoscalingChurn})),__vite__mapDeps([44,1,2,3,4,5,6,8,9,10]),import.meta.url)),hn=(0,H.lazy)(()=>V(()=>import(`./IncompleteRun-MzqV4W8y.js`).then(e=>({default:e.IncompleteRun})),__vite__mapDeps([45,3,1,2,4,5,6,9,10]),import.meta.url));function U(e,t){e.displayName=t}U(Vt,`Skew`),U(Ht,`StageShape`),U(Ut,`TinyTask`),U(Wt,`ShuffleIO`),U(Gt,`PartitionSizing`),U(Kt,`Spill`),U(qt,`GcPressure`),U(Jt,`StageFailed`),U(Yt,`TaskFailures`),U(Xt,`RetryWaste`),U(Zt,`SlowHost`),U(Qt,`StageSlowness`),U($t,`Straggler`),U(en,`SpeculationWaste`),U(tn,`ColdStart`),U(nn,`MemoryUtilization`),U(rn,`ExecutorUtilization`),U(an,`CachingOpportunity`),U(on,`JobFailures`),U(sn,`ConfigAudit`),U(cn,`DuplicatePlanSubtree`),U(ln,`SmallFiles`),U(un,`UnderBroadcast`),U(dn,`OverBroadcast`),U(fn,`CacheUtilization`),U(pn,`CoreUsageArea`),U(mn,`AutoscalingChurn`),U(hn,`IncompleteRun`);var gn={incompleteRun:{component:hn,region:`action`,widgetId:`incomplete-run`,routeable:!0},skew:{component:Vt,region:`action`,widgetId:`skew`,routeable:!0},stageShape:{component:Ht,region:`action`,widgetId:`stage-shape`,routeable:!0},tinyTask:{component:Ut,region:`action`,widgetId:`tiny-task`,routeable:!0},shuffle:{component:Wt,region:`action`,widgetId:`shuffle-io`,routeable:!0},partitionSizing:{component:Gt,region:`action`,widgetId:`partition-sizing`,routeable:!0},spill:{component:Kt,region:`action`,widgetId:`spill`,routeable:!0},gc:{component:qt,region:`action`,widgetId:`gc-pressure`,routeable:!0},stageFailed:{component:Jt,region:`action`,widgetId:`stage-failed`,routeable:!0},failures:{component:Yt,region:`action`,widgetId:`task-failures`,routeable:!0},retryWaste:{component:Xt,region:`action`,widgetId:`retry-waste`,routeable:!0},slowHost:{component:Zt,region:`action`,widgetId:`slow-host`,routeable:!0},stageSlowness:{component:Qt,region:`action`,widgetId:`stage-slowness`,routeable:!0},straggler:{component:$t,region:`action`,widgetId:`straggler`,routeable:!0},speculationWaste:{component:en,region:`action`,widgetId:`speculation-waste`,routeable:!0},coldStart:{component:tn,region:`action`,widgetId:`cold-start`,routeable:!0},memoryUtilization:{component:nn,region:`reference`,widgetId:`memory-utilization`,routeable:!0},utilization:{component:rn,region:`reference`,widgetId:`executor-utilization`,routeable:!0},coreLocality:{component:pn,region:`reference`,widgetId:`core-usage-area`,routeable:!0},cachingOpportunity:{component:an,region:`action`,widgetId:`caching-opportunity`,routeable:!0},cacheUtilization:{component:fn,region:`reference`,widgetId:`cache-utilization`,routeable:!0},jobFailureRate:{component:on,region:`action`,widgetId:`job-failures`,routeable:!0},autoscalingChurn:{component:mn,region:`action`,widgetId:`autoscaling-churn`,routeable:!0},configAudit:{component:sn,region:`action`,widgetId:`config-audit`,routeable:!0},duplicatePlanSubtree:{component:cn,region:`action`,widgetId:`duplicate-plan-subtree`,routeable:!0},smallFiles:{component:ln,region:`action`,widgetId:`small-files`,routeable:!0},underBroadcast:{component:un,region:`action`,widgetId:`under-broadcast`,routeable:!0},overBroadcast:{component:dn,region:`action`,widgetId:`over-broadcast`,routeable:!0}},_n={action:0,reference:1};function vn(e){return Object.entries(e).filter(([e])=>gn[e]!==void 0).map(([e,{order:t}])=>({entry:gn[e],type:e,order:t})).sort((e,t)=>_n[e.entry.region]-_n[t.entry.region]||e.order-t.order).map(({entry:e,type:t})=>({component:e.component,region:e.region,widgetId:e.widgetId,type:t}))}var yn=new Set([`cacheUtilization`,`memoryUtilization`,`utilization`]);function bn(e){let t=gn[e];return t!==void 0&&t.region===`reference`&&!yn.has(e)}function xn(){return Object.entries(gn).filter(([e])=>bn(e)).map(([,e])=>({component:e.component,widgetId:e.widgetId}))}var W=ke(),Sn={clean:{box:`border-clean/40 bg-clean/10`,icon:`text-clean`,title:`text-clean`},neutral:{box:`border-border/60 bg-muted/40`,icon:`text-muted-foreground`,title:`text-foreground`}};function Cn({icon:e,tone:t=`neutral`,title:n,description:r,action:i,className:a}){let o=Sn[t];return(0,W.jsxs)(`div`,{className:D(`flex items-start gap-3 rounded-xl border p-4`,o.box,a),children:[(0,W.jsx)(e,{"aria-hidden":`true`,className:D(`mt-0.5 size-4 shrink-0`,o.icon)}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`p`,{className:D(`text-sm font-medium`,o.title),children:n}),r?(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}):null]}),i]})}var wn=[`critical`,`warning`,`info`];function Tn(){return{impactBands:new Set,types:new Set,stages:new Set}}function En(e){return e.impactBands.size===0&&e.types.size===0&&e.stages.size===0}function Dn(e,t){return vt(e,{impactBand:t.impactBands,type:t.types,stageId:t.stages})}function On(e,t){return e.filter(e=>Dn(e,t))}function kn(e,t){return[`impactBands`,`types`,`stages`].filter(n=>!Dn(e,{...Tn(),[n]:t[n]}))}function An(e,t){let n=new Set,r=new Set,i=new Set;for(let a of[...e,...t])n.add(a.impactBand),r.add(a.type),a.stageId!=null&&i.add(a.stageId);return{impactBands:wn.filter(e=>n.has(e)),types:[...r].sort(),stages:[...i].sort((e,t)=>e-t)}}function jn(e){return e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[]}function Mn(e,t){let n=new URLSearchParams(e),r=Tn();for(let e of jn(n.get(`impact`)))wn.includes(e)&&r.impactBands.add(e);let i=new Set(t.types);for(let e of jn(n.get(`type`)))i.has(e)&&r.types.add(e);for(let e of jn(n.get(`stage`))){let t=Number(e);Number.isInteger(t)&&r.stages.add(t)}return r}function Nn(e){let t=[];return e.impactBands.size&&t.push(`impact=${wn.filter(t=>e.impactBands.has(t)).join(`,`)}`),e.types.size&&t.push(`type=${[...e.types].sort().join(`,`)}`),e.stages.size&&t.push(`stage=${[...e.stages].sort((e,t)=>e-t).join(`,`)}`),t.length?`?${t.join(`&`)}`:``}var Pn=(0,H.createContext)(null);function Fn(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function In({options:e,fileId:t,children:n}){let[r,i]=(0,H.useState)(()=>Mn(typeof window>`u`?``:window.location.search,e));(0,H.useEffect)(()=>{if(typeof window>`u`)return;let e=Nn(r),t=`${window.location.pathname}${e}${window.location.hash}`;window.history.replaceState(window.history.state,``,t)},[r]);let a=(0,H.useRef)(t);(0,H.useEffect)(()=>{a.current!==t&&(a.current=t,i(Tn()))},[t]),(0,H.useEffect)(()=>()=>{if(typeof window>`u`)return;let e=`${window.location.pathname}${window.location.hash}`;window.history.replaceState(window.history.state,``,e)},[]),(0,H.useEffect)(()=>{if(typeof window>`u`)return;let t=()=>i(Mn(window.location.search,e));return window.addEventListener(`popstate`,t),()=>window.removeEventListener(`popstate`,t)},[e]);let o=(0,H.useCallback)(e=>i(t=>({...t,impactBands:Fn(t.impactBands,e)})),[]),s=(0,H.useCallback)(e=>i(t=>({...t,types:Fn(t.types,e)})),[]),c=(0,H.useCallback)(e=>i(t=>({...t,stages:Fn(t.stages,e)})),[]),l=(0,H.useCallback)(()=>i(Tn()),[]),u=(0,H.useMemo)(()=>({selection:r,toggleImpactBand:o,toggleType:s,toggleStage:c,clearAll:l,replaceSelection:i}),[r,o,s,c,l]);return(0,W.jsx)(Pn.Provider,{value:u,children:n})}function Ln(){let e=(0,H.useContext)(Pn);if(!e)throw Error(`useFindingFilter outside FindingFilterProvider`);return e}function Rn(){let{clearAll:e}=Ln();return(0,W.jsx)(Cn,{icon:Bt,title:`No findings match the active filters`,description:`Adjust or clear the filters to see findings.`,action:(0,W.jsx)(`button`,{type:`button`,onClick:e,className:`cursor-pointer text-sm underline`,children:`Clear all filters`})})}function zn({className:e,orientation:t=`horizontal`,...n}){return(0,W.jsx)(S,{"data-slot":`separator`,orientation:t,className:D(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var Bn=H.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function Vn({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,W.jsx)(C,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:D(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,W.jsx)(Bn.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function Hn({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=H.useContext(Bn);return(0,W.jsx)(b,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:D(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,Be({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}var Un={critical:`aria-pressed:bg-critical/10 aria-pressed:text-critical`,warning:`aria-pressed:bg-warning/10 aria-pressed:text-warning`,info:`aria-pressed:bg-info/10 aria-pressed:text-info`};function Wn(e,t,n){let r=new Set(e);for(let e of r)t.has(e)||n(e);for(let e of t)r.has(e)||n(e)}function Gn({label:e,count:t,children:n}){return(0,W.jsxs)(at,{children:[(0,W.jsxs)(Me,{className:D(lt({variant:`outline`,size:`sm`}),`gap-1.5`),"aria-label":`Filter by ${e.toLowerCase()}`,children:[e,t>0&&(0,W.jsx)(`span`,{className:`rounded-full bg-primary px-1.5 text-xs font-medium text-primary-foreground`,children:t}),(0,W.jsx)(fe,{"aria-hidden":`true`,className:`opacity-60`})]}),(0,W.jsx)(Ne,{align:`start`,className:`max-h-72 w-56 overflow-y-auto`,children:n})]})}function Kn({options:e,resultCount:t}){let{selection:n,toggleImpactBand:r,toggleType:i,toggleStage:a,clearAll:o}=Ln(),[s,c]=(0,H.useState)(``),[l,u]=(0,H.useState)(``),d=(0,H.useMemo)(()=>{let t=s.trim();return t?e.stages.filter(e=>String(e).includes(t)):e.stages},[e.stages,s]),f=(0,H.useMemo)(()=>{let t=l.trim().toLowerCase();return t?e.types.filter(e=>e.toLowerCase().includes(t)||_e(e).toLowerCase().includes(t)):e.types},[e.types,l]);if(e.impactBands.length===0&&e.types.length===0&&e.stages.length===0)return null;let p=!En(n),m=[...[...n.impactBands].map(e=>({key:`impact-${e}`,label:`impact ${e}`,onRemove:()=>r(e)})),...[...n.types].map(e=>({key:`type-${e}`,label:`type ${e}`,onRemove:()=>i(e)})),...[...n.stages].map(e=>({key:`stage-${e}`,label:`stage ${e}`,onRemove:()=>a(e)}))];return(0,W.jsxs)(`section`,{"aria-label":`Filter findings`,className:`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-xl border border-border/60 p-2`,children:[(0,W.jsxs)(`span`,{title:`Narrow the whole dashboard to findings matching the chosen impact bands, types, or stages`,className:`flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,W.jsx)(Rt,{"aria-hidden":`true`,className:`size-3.5`}),`Filter findings`]}),(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-xs text-muted-foreground`,children:p?`${t} finding${t===1?``:`s`} match${t===1?`es`:``} the active filters`:`Showing all ${t} finding${t===1?``:`s`}`}),(0,W.jsx)(zn,{orientation:`vertical`,className:`h-6`}),e.impactBands.length>0&&(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Impact`}),(0,W.jsx)(Vn,{multiple:!0,"aria-label":`Filter by impact`,value:[...n.impactBands],onValueChange:e=>Wn(e,n.impactBands,r),children:e.impactBands.map(e=>(0,W.jsxs)(Hn,{value:e,variant:`outline`,size:`sm`,"aria-label":`Filter by impact: ${e}`,className:D(`tap-target-comfortable gap-1.5`,Un[e]),children:[(0,W.jsx)(Ce,{impactBand:e}),e]},e))})]}),e.types.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(zn,{orientation:`vertical`,className:`h-6`}),(0,W.jsxs)(Gn,{label:`Type`,count:n.types.size,children:[(0,W.jsx)(`div`,{className:`p-1`,children:(0,W.jsx)(je,{type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>e.stopPropagation(),placeholder:`Search type…`,"aria-label":`Search types`,autoComplete:`off`,className:`h-8`})}),f.map(e=>(0,W.jsxs)(Ve,{checked:n.types.has(e),onCheckedChange:()=>i(e),"aria-label":`Filter by type: ${e}`,children:[(0,W.jsx)(`span`,{className:`rounded bg-muted px-1 text-xs font-medium text-foreground!`,children:_e(e)}),` `,e]},e)),f.length===0&&(0,W.jsx)(`p`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`No matching type`})]})]}),e.stages.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(zn,{orientation:`vertical`,className:`h-6`}),(0,W.jsxs)(Gn,{label:`Stage`,count:n.stages.size,children:[(0,W.jsx)(`div`,{className:`p-1`,children:(0,W.jsx)(je,{type:`text`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>e.stopPropagation(),placeholder:`Search stage id…`,"aria-label":`Search stages`,autoComplete:`off`,className:`h-8`})}),d.map(e=>(0,W.jsxs)(Ve,{checked:n.stages.has(e),onCheckedChange:()=>a(e),"aria-label":`Filter by stage: ${e}`,children:[`Stage `,e]},e)),d.length===0&&(0,W.jsx)(`p`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`No matching stage`})]})]}),p&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(zn,{orientation:`vertical`,className:`h-6`}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[m.map(e=>(0,W.jsxs)(`button`,{type:`button`,onClick:e.onRemove,"aria-label":`Remove filter: ${e.label}`,className:`tap-target-comfortable inline-flex cursor-pointer items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-xs hover:bg-muted/70`,children:[e.label,` `,(0,W.jsx)(bt,{"aria-hidden":`true`,className:`size-3`})]},e.key)),(0,W.jsx)(`button`,{type:`button`,onClick:o,className:`tap-target-comfortable cursor-pointer text-xs underline`,children:`Clear all filters`})]})]})]})}function qn(e,t){let n=[];for(let{launch:t,finish:r}of e)r>t&&(n.push({t,delta:1}),n.push({t:r,delta:-1}));n.sort((e,t)=>e.t-t.t||e.delta-t.delta);let r=[],i=0;for(let e=0;e<n.length;e++){let a=n[e];i+=a.delta;let o=n[e+1];if(!o||o.t===a.t)continue;let s=t==null?i:Math.min(i,t);r.push({tStart:a.t,tEnd:o.t,busy:s})}return r}function Jn(e,{bucketBy:t=`time`,bucketWidthMs:n=1e3,hypotheticalCores:r=null}={}){let i=qn(e,r);if(t===`coreCount`){let e=[];for(let t of i)e[t.busy]=(e[t.busy]??0)+(t.tEnd-t.tStart);for(let t=0;t<e.length;t++)e[t]===void 0&&(e[t]=0);return{mode:`coreCount`,histogram:e}}if(i.length===0)return{mode:`time`,bucketWidthMs:n,startTime:null,endTime:null,buckets:[]};let a=i[0].tStart,o=i[i.length-1].tEnd,s=[];for(let e=a;e<o;e+=n){let t=e+n,r=0;for(let n of i){let i=Math.max(n.tStart,e),a=Math.min(n.tEnd,t);a>i&&(r+=n.busy*(a-i))}s.push({tStart:e,tEnd:t,busyCoreMs:r,avgBusyCores:r/n})}return{mode:`time`,bucketWidthMs:n,startTime:a,endTime:o,buckets:s}}async function Yn(e,t){let n=[...e.stages.keys()],r=await Promise.all(n.map(e=>t(e).catch(()=>null))),i=[],a=!1;for(let e of r){if(!e){a=!0;continue}let{metrics:t,fieldNames:n}=e,r=n.length,o=n.indexOf(`launchTime`),s=n.indexOf(`finishTime`);if(o!==-1&&s!==-1)for(let e=0;e<t.length;e+=r)i.push({launch:t[e+o],finish:t[e+s]})}return{intervals:i,incomplete:a}}async function Xn(e,t){let{intervals:n,incomplete:r}=await Yn(e,t),{histogram:i}=Jn(n,{bucketBy:`coreCount`});return{histogram:i??[],incomplete:r}}function Zn(e){let t=N(e=>e.exportMode);return{exportMode:t,getTaskData:t?void 0:e}}function Qn(e,t=2e3){if(e.length<=t)return e;if(t<=1)return e.length?[e[0]]:[];let n=e.length-1,r=n/(t-1),i=Array(t);for(let a=0;a<t;a++)i[a]=e[Math.min(n,Math.round(a*r))];return i}function $n(e){return`${e} finding${e===1?``:`s`}`}function G({value:e,context:t}){return(0,W.jsx)(`div`,{className:`space-y-2`,children:(0,W.jsxs)(`p`,{className:`flex min-h-[4rem] flex-wrap content-start items-baseline gap-x-2`,children:[(0,W.jsx)(`span`,{className:`line-clamp-2 text-2xl font-semibold tracking-tight`,title:typeof e==`string`?e:void 0,children:e}),(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})})}var er=220;function tr({appModel:e,getTaskData:t}){let{exportMode:n,getTaskData:r}=Zn(t),[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(!1),[d,p]=(0,H.useState)(!1),h=e.stages.size>0;if((0,H.useEffect)(()=>{if(!h||!d||i!==null||!r)return;let t=!1;return Xn(e,r).then(({histogram:e,incomplete:n})=>{t||(a(e),s(n))}),()=>{t=!0}},[e,r,h,d,i]),!h)return null;let g=(i??[]).map((e,t)=>({cores:String(t),coreCount:t,ms:e})),_=Qn(g),v=g.reduce((e,t)=>t.ms>e.ms?t:e,g[0]);return(0,W.jsx)(I,{title:`Core-Usage Distribution`,id:`core-usage-histogram`,open:d,onOpenChange:p,summary:i!==null&&v?(0,W.jsx)(G,{value:k(v.ms),context:`at ${v.coreCount} concurrent core${v.coreCount===1?``:`s`}`}):void 0,children:i===null?n?(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Core-usage detail isn’t included in exported reports.`}):(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Loading core usage…`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(F,{ariaLabel:`Wall-clock time spent at each concurrent-core count across the run. See the table below for exact values.`,height:er,table:{caption:`Wall-clock time by concurrent-core count`,columns:[`Concurrent cores`,`Time`],rows:i.map((e,t)=>[t,k(e)]),align:[`right`,`right`]},children:(0,W.jsxs)(l,{data:_,children:[(0,W.jsx)(c,{vertical:!1,stroke:P.muted,strokeOpacity:.2}),(0,W.jsx)(m,{dataKey:`cores`,tick:{fontSize:10},label:{value:`Concurrent busy cores`,position:`insideBottom`,offset:-5,fontSize:10}}),(0,W.jsx)(f,{tick:{fontSize:10},width:48,tickFormatter:e=>k(e)}),(0,W.jsx)(u,{dataKey:`ms`,name:`Time`,fill:P.accent})]})}),o?(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Reopen this file to compute full core usage because some task data was released.`}):null,(0,W.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`See `,(0,W.jsx)(ae,{anchor:`#bottleneck-utilization`,children:`how to read concurrent-core utilization`}),`.`]})]})})}var nr=`This estimate is derived from a simplified compute model; compare it against wall-clock data before acting on it.`,K=e=>`${Math.round(e*100)/100} core-h`;function rr(){let e=A()?.data,t=e?.efficiency;if(!e||!t||t.availableComputeHours<=0)return null;let{usefulCoreHours:n,totalCores:r,topStages:i}=e.wastedCoreHours,a=null;return t.dominantWaste===`driver`?a=(0,W.jsxs)(`p`,{children:[(0,W.jsx)(`strong`,{children:`Most of it is driver waste:`}),` review spark.driver.memory and spark.driver.cores before scaling executors.`]}):t.dominantWaste===`executor`&&(a=(0,W.jsxs)(`p`,{children:[(0,W.jsx)(`strong`,{children:`Most of it is executor waste:`}),` reduce cluster size or enable dynamic allocation.`]})),(0,W.jsx)(I,{title:`Compute Efficiency`,statusBadge:(0,W.jsx)(M,{children:(0,W.jsx)(qe,{confidence:`low`,validationRequired:nr})}),defaultCollapsed:!0,summary:(0,W.jsx)(G,{value:t.wastagePct==null?K(t.availableComputeHours):`${t.wastagePct}% wasted`,context:`of ${K(t.availableComputeHours)} available`}),children:(0,W.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[!e.wallClockReliable&&(0,W.jsx)(M,{children:(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`This run used concurrent job groups: the driver/executor split below is approximate, not precise.`})}),(0,W.jsxs)(`p`,{children:[`Available: `,(0,W.jsx)(`strong`,{children:K(t.availableComputeHours)}),n!=null&&(0,W.jsxs)(W.Fragment,{children:[` `,`· Used: `,(0,W.jsx)(`strong`,{children:K(n)})]}),t.wastagePct!=null&&(0,W.jsxs)(W.Fragment,{children:[` `,`· wasted `,(0,W.jsxs)(`strong`,{children:[t.wastagePct,`%`]})]})]}),r!=null&&(0,W.jsx)(M,{children:(0,W.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Available = `,r,` cores over the run (peak concurrent cores × run time); used = core-time that actually ran tasks.`]})}),(0,W.jsxs)(`p`,{children:[(0,W.jsx)(Ce,{impactBand:`info`}),` Driver-bound waste: `,(0,W.jsx)(`strong`,{children:K(t.driverWasteHours)})]}),(0,W.jsxs)(`p`,{children:[(0,W.jsx)(Ce,{impactBand:`info`}),` Executor-bound waste: `,(0,W.jsx)(`strong`,{children:K(t.executorWasteHours)})]}),(0,W.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Floor (same executors, zero skew): `,k(t.floorZeroSkewMs)]}),a,i.length>0&&(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Top stages by task core-time`}),(0,W.jsx)(`ul`,{className:`space-y-0.5`,children:i.map(e=>(0,W.jsxs)(`li`,{className:`flex justify-between gap-2`,children:[(0,W.jsxs)(`span`,{children:[`Stage `,e.stageId]}),(0,W.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:K(e.coreMs/36e5)})]},e.stageId))})]})]})})}var ir=[{label:`Extract`,key:`extract`},{label:`Transform`,key:`transform`},{label:`Load`,key:`load`}];function ar(){let e=A()?.data.etlPhases;if(!e||e.extract+e.transform+e.load===0)return null;let t=ir.reduce((t,n)=>e[n.key]>e[t.key]?n:t);return(0,W.jsx)(I,{title:`ETL Phase Attribution`,defaultCollapsed:!0,summary:(0,W.jsx)(G,{value:`${t.label} ${k(e[t.key])}`,context:`largest phase`}),children:(0,W.jsxs)(`div`,{className:`space-y-1`,children:[ir.map(({label:t,key:n})=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:t}),`: `,k(e[n])]},n)),(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Sums the run time of each phase's stages, so overlapping stages count twice and a phase can exceed the wall-clock.`}),(0,W.jsx)(M,{children:(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Heuristic: a stage that both shuffles and writes counts in Transform and Load.`})})]})})}var or=220;function sr(e){let t=e.app,n=e.executors.added,r=e.executors.removed;if(t?.startTime==null||t?.endTime==null)return{times:[],counts:[]};let i=t.endTime-t.startTime,a=Math.max(5e3,Math.floor(i/100)),o=[],s=[],c=new Map(r.map(e=>[e.executorId,e.timestamp]));for(let e=t.startTime;e<=t.endTime;e+=a){let r=n.filter(t=>{let n=c.get(t.executorId)??1/0;return t.timestamp<=e&&e<n}).length;o.push(((e-t.startTime)/1e3).toFixed(0)+`s`),s.push(r)}return{times:o,counts:s}}function cr({active:e,payload:t,label:n}){return!e||!t||t.length===0?null:(0,W.jsxs)(`div`,{style:it,"data-testid":`executor-count-tooltip`,children:[`At `,String(n),`: Active executors `,String(t[0].value)]})}var lr=(0,H.memo)(function({appModel:e,activeFileId:t}){let{chartData:n,sampled:r,hasSeries:i,peak:a}=(0,H.useMemo)(()=>{let{times:t,counts:n}=sr(e),r=t.map((e,t)=>({label:e,count:n[t]})),i=Qn(r),a=n.length>0;return{chartData:r,sampled:i,hasSeries:a,peak:a?Math.max(...n):0}},[e,t]);return i?(0,W.jsx)(I,{title:`Executor Count Over Time`,summary:(0,W.jsx)(G,{value:`${a} peak`,context:`concurrent executors`}),children:(0,W.jsx)(F,{ariaLabel:`Executor count over time. See the table below for exact values.`,height:or,table:{caption:`Executor timeline: active executor count over time`,columns:[`Time`,`Active executors`],rows:n.map(e=>[e.label,e.count]),align:[`left`,`right`]},children:(0,W.jsxs)(d,{data:r,children:[(0,W.jsx)(c,{vertical:!1,stroke:P.muted,strokeOpacity:.2}),(0,W.jsx)(m,{dataKey:`label`,tick:{fontSize:10},minTickGap:24}),(0,W.jsx)(f,{allowDecimals:!1,tick:{fontSize:10},width:32}),(0,W.jsx)(g,{content:cr}),(0,W.jsx)(h,{type:`stepAfter`,dataKey:`count`,name:`Active executors`,stroke:P.clean,fill:P.clean,fillOpacity:.15})]})})}):(0,W.jsx)(I,{title:`Executor Count Over Time`,summary:(0,W.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Timeline unavailable: no end time recorded.`}),children:(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This run has no ApplicationEnd event, so the executor timeline can't be plotted without fabricating an end time. See the Incomplete Run finding for what's still reliable.`})})}),ur=[10,20,50,80,100,110,120,150,200,300,400,500];function dr(e,t,n){return t<=0||n<=0?0:e/Math.min(n,t)}function fr(e,t){let n=0;for(let r of Object.keys(e)){let{totalTaskDurationSum:i,taskCount:a}=e[r];n+=dr(i,a,t)}return n}function pr({app:e,observedActiveMs:t,runAggregates:n,executorsAdded:r}){let i=n?.perStage??{},a=Ct(e??{},r),o=a>0?fr(i,a):0,s=t>0?Math.round(Math.abs(o-t)/t*100):null,c=o>0?t/o:1;return{baselineCores:a,testPercentages:ur,predictions:ur.map(e=>{let t=Math.max(1,Math.round(a*e/100));return{pct:e,cores:t,estMakespanMs:Math.round(fr(i,t)*c)}}),modelErrorPct:s}}var mr=`What-If Executor Scaling`,hr=220,gr=20;function _r([e,t]){let n=(t-e)*.1;return[Math.max(0,e-n),t+n]}function vr(e){return[...e.stages.values()].some(e=>{let t=e.submittedAt,n=e.completedAt;return typeof t==`number`&&Number.isFinite(t)&&typeof n==`number`&&Number.isFinite(n)&&n>t})}function yr(e){return e.evidenceAvailability?.entries.find(e=>e.key===`taskCoreTime`)}function br({reason:e,evidence:t}){return(0,W.jsx)(I,{title:mr,summary:(0,W.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Not available: `,e]}),children:(0,W.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Not available: `,e,` `,(0,W.jsx)(qe,{evidenceKey:t})]})})}function xr(e){if(e===100)return`with the current executors`;if(e<100)return`with ${e}% of the executors`;let t=e/100;return`with ${Number.isInteger(t)?t:t.toFixed(1)}× the executors`}function Sr({appModel:e}){let t=A()?.data,n=yr(e);if(!De(e.runAggregates)||n!=null&&n.state!==`present`)return(0,W.jsx)(br,{reason:n?.summary??`No usable task and core-time evidence in this log.`,evidence:`taskCoreTime`});if(!t)return null;let r=pr({app:e.app,observedActiveMs:t.wallClock.stagesActive,runAggregates:e.runAggregates,executorsAdded:e.executors.added});if(r.baselineCores<=0)return(0,W.jsx)(br,{reason:`Baseline executor/core capacity is unavailable in this log.`});if(!vr(e))return(0,W.jsx)(br,{reason:`Usable stage timing is unavailable in this log.`});let i=r.modelErrorPct!=null&&r.modelErrorPct>=gr,a=Qn(r.predictions),l=r.predictions.reduce((e,t)=>t.estMakespanMs<e.estMakespanMs?t:e);return(0,W.jsx)(I,{title:mr,defaultCollapsed:!0,summary:(0,W.jsx)(G,{value:k(l.estMakespanMs),context:`best case, ${xr(l.pct)}`}),children:(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(M,{children:(0,W.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Model Error:`,` `,(0,W.jsx)(`strong`,{className:i?`text-warning`:void 0,children:r.modelErrorPct==null?`—`:`${r.modelErrorPct}%`}),` `,`(idealized makespan vs. observed); higher means all estimates below carry more error, since a single log only observes one scale.`]})}),(0,W.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Move along this curve by changing `,(0,W.jsx)(`code`,{children:`spark.dynamicAllocation`}),`’s executor bounds, see the `,(0,W.jsx)(ae,{anchor:`#config-autoscale-bounds`,children:`autoscaling config guide`}),`.`]}),t.wallClockReliable?null:(0,W.jsx)(M,{children:(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This run used concurrent job groups, so the wall-clock-based estimates below may be unreliable.`})}),(0,W.jsx)(M,{children:(0,W.jsx)(`p`,{className:`text-xs`,children:(0,W.jsx)(qe,{evidenceKey:`taskCoreTime`})})}),(0,W.jsx)(F,{ariaLabel:`Estimated makespan by executor percentage: diminishing-returns curve.`,height:hr,table:{caption:`Estimated makespan by executor percentage`,columns:[`% Executors`,`Cores`,`Est. makespan`],rows:r.predictions.map(e=>[`${e.pct}%`,e.cores,k(e.estMakespanMs)]),align:[`right`,`right`,`right`]},children:(0,W.jsxs)(o,{data:a,children:[(0,W.jsx)(c,{stroke:P.muted,strokeOpacity:.2}),(0,W.jsx)(m,{dataKey:`pct`,tickFormatter:e=>`${e}%`,tick:{fontSize:10}}),(0,W.jsx)(f,{domain:_r,tickFormatter:e=>k(e),tick:{fontSize:10},width:56}),(0,W.jsx)(g,{formatter:e=>[k(Number(e)),`Est. makespan`],labelFormatter:e=>`${e}% executors`}),(0,W.jsx)(s,{type:`monotone`,dataKey:`estMakespanMs`,name:`Est. makespan`,stroke:P.accent,dot:{r:3}})]})})]})})}function Cr(e){let t=gn[e.type],n=typeof e.recommendation==`string`?e.recommendation.trim():``;return!t?.routeable||!n?null:{finding:e,widgetId:t.widgetId,region:t.region,findingLabel:yt(e.type),stageId:typeof e.stageId==`number`?e.stageId:null,recommendation:n}}function wr(e,t){return t.includes(e)?Cr(e):null}function Tr(e,t){return Er(e,t)[0]??null}function Er(e,t){return se(e,t).map(Cr).filter(e=>e!==null)}function Dr(e,t){return`${e} ${t}${e===1?``:`s`}`}function Or({text:e,label:t,testId:n}){let[r,i]=(0,H.useState)(!1);return(0,W.jsxs)(B,{variant:`outline`,size:`sm`,"data-testid":n,onClick:()=>{ot(e).then(()=>{i(!0),setTimeout(()=>i(!1),1500)}).catch(()=>{})},children:[r?(0,W.jsx)(Fe,{"aria-hidden":`true`}):(0,W.jsx)(Pt,{"aria-hidden":`true`}),r?`Copied`:t]})}function kr({text:e}){let[t,n]=(0,H.useState)(!1),r=async()=>{try{await ot(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return(0,W.jsxs)(B,{variant:`ghost`,size:`sm`,"data-testid":`copy-finding-button`,onClick:()=>void r(),children:[t?(0,W.jsx)(Fe,{"aria-hidden":`true`}):(0,W.jsx)(Pt,{"aria-hidden":`true`}),t?`Copied`:`Copy`]})}function Ar({step:e,finding:t,interpretation:n,index:r,onRoute:i}){let{openStage:a}=Dt(),{measured:o,fix:s}=St(e.recommendation),c=Te(n,t),l=c?.figure??null,u=c?.meaning??null,d=`next-step-${r}-title`,f=j()===`advanced`,p=f?c?.provenance??null:null,m=f&&t.confidence&&t.confidence!==`high`?t.confidence:null;return(0,W.jsxs)(`li`,{className:`flex gap-3`,"data-testid":`next-step`,"aria-labelledby":d,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:D(`mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold tabular-nums`,r===0?`bg-primary text-primary-foreground`:`bg-muted text-foreground`),children:r+1}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5 [overflow-wrap:anywhere]`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,W.jsx)(ue,{type:t.type,impactBand:t.impactBand,docAnchor:t.docAnchor}),(0,W.jsxs)(`h3`,{id:d,className:`text-sm font-semibold`,children:[wt(t),e.stageId==null?null:(0,W.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` in Stage `,e.stageId]})]}),l?(0,W.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground tabular-nums sm:ml-auto`,children:[(0,W.jsx)(`span`,{className:`font-sans`,children:`Potential savings `}),(0,W.jsx)(`span`,{className:`font-semibold text-foreground`,children:l}),u?(0,W.jsxs)(`span`,{className:`font-sans`,children:[` `,u]}):null]}):null]}),o?(0,W.jsxs)(`p`,{className:`text-sm`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:`What's happening: `}),o]}):null,(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:`What to try: `}),s]}),p||m?(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`next-step-provenance`,children:[p?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:`Estimate: `}),p]}):null,m?(0,W.jsxs)(`span`,{title:typeof t.validationRequired==`string`?t.validationRequired:void 0,children:[p?` `:``,`${m[0].toUpperCase()}${m.slice(1)} confidence: verify before acting.`]}):null]}):null,e.relatedTypes.length>0?(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Also flagged here, likely the same cause: `,e.relatedTypes.map(yt).join(`, `),`.`]}):null,(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[(0,W.jsxs)(B,{size:`sm`,variant:r===0?`default`:`outline`,"data-shortcut-target":!0,onClick:()=>{let e=Cr(t);e&&i(e)},children:[`Show evidence`,(0,W.jsx)(ht,{"aria-hidden":`true`})]}),e.stageId==null?null:(0,W.jsxs)(B,{size:`sm`,variant:`ghost`,onClick:()=>a(e.stageId),children:[`Stage `,e.stageId,` details`]}),(0,W.jsx)(kr,{text:e.copyText})]})]})]})}var jr=`docs/user-guide/understanding-findings.html`;function Mr(){let[e,t]=(0,H.useState)(!1),n=E(),r=N(e=>e.exportMode);return(0,W.jsxs)(`div`,{className:`text-sm`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`tap-target-comfortable inline-flex cursor-pointer items-center gap-1 rounded-sm text-left font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"aria-expanded":e,"aria-controls":`newcomer-primer`,onClick:()=>t(e=>!e),children:[`New to Spark tuning? How to read this report`,e?(0,W.jsx)(me,{"aria-hidden":`true`,className:`size-4`}):(0,W.jsx)(fe,{"aria-hidden":`true`,className:`size-4`})]}),e?(0,W.jsxs)(`div`,{id:`newcomer-primer`,className:`mt-2 max-w-prose space-y-2 rounded-md border border-border bg-muted/40 p-3 text-muted-foreground`,children:[(0,W.jsxs)(`p`,{children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:`Stages and tasks.`}),` Spark splits each job into stages. A stage runs the same code as many tasks, one per slice (partition) of the data, and it finishes only when its slowest task does. Stage numbers match the Spark UI.`]}),(0,W.jsxs)(`p`,{children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:`Executors and cores.`}),` Tasks run on executors, the worker processes of your cluster, one task per core at a time. Idle capacity is how much of those cores ran nothing.`]}),(0,W.jsxs)(`p`,{children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:`Shuffle.`}),` Moving data between stages, for example for a join or a group-by. It is often the most expensive part of a job.`]}),(0,W.jsxs)(`p`,{children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:`Potential savings and colors.`}),` A time figure, such as 58.6s of run time, estimates how much sooner the run could finish; it is not a guarantee. A resource figure in core-hours (core-h) or gigabyte-hours of memory (GB-h) is cluster time a fix would free up: it cuts cost, but may not shorten the run. Red (critical), amber (warning) and blue (info) show how serious each finding is. When a finding shows a time-savings figure, its color usually follows that figure.`]}),r?null:(0,W.jsx)(`a`,{href:jr,target:`_blank`,rel:`noopener noreferrer`,className:`inline-block text-primary underline-offset-4 hover:underline`,onClick:e=>{!n||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n.openSite(jr))},children:`What every finding means`})]}):null]})}function Nr({interpretation:e,onRoute:t}){let{title:n,summary:r,failed:i,clean:a,failureReason:o,remaining:s,copyText:c}=e.data.verdict,l=e.data.verdict.steps.map(t=>({step:t,finding:de(e,t.leadIndex)})).filter(e=>e.finding!=null),u=j();return(0,W.jsxs)(`section`,{id:`run-verdict`,tabIndex:-1,"aria-labelledby":`run-verdict-title`,"data-testid":`run-verdict`,className:D(`scroll-mt-20 space-y-4 rounded-xl border bg-card p-4 outline-none focus-visible:ring-2 focus-visible:ring-ring sm:p-5`,a?`border-clean/40`:i?`border-critical/40`:`border-border`),children:[(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsxs)(`h2`,{id:`run-verdict-title`,className:D(`flex items-center gap-2 font-heading text-lg font-semibold`,a&&`text-clean`,i&&`text-critical`),children:[a?(0,W.jsx)(Ot,{"aria-hidden":`true`,className:`size-5 shrink-0`}):null,i?(0,W.jsx)(Mt,{"aria-hidden":`true`,className:`size-5 shrink-0`}):null,n]}),(0,W.jsx)(`p`,{className:`max-w-prose text-sm text-muted-foreground`,children:r.join(` `)}),o?(0,W.jsxs)(`p`,{"data-testid":`run-failure-reason`,className:`max-w-prose pt-1 text-sm`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:`Spark's recorded reason: `}),(0,W.jsx)(`code`,{className:`font-mono text-xs [overflow-wrap:anywhere]`,children:o})]}):null]}),u===`advanced`?null:(0,W.jsx)(Mr,{}),l.length>0?(0,W.jsx)(`ol`,{"aria-label":`Next steps`,className:`space-y-4`,children:l.map(({step:n,finding:r},i)=>(0,W.jsx)(Ar,{step:n,finding:r,interpretation:e,index:i,onRoute:t},n.key))}):null,l.length>0?(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[s>0?(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[Dr(s,`more place`),` under Findings.`]}):(0,W.jsx)(`span`,{}),(0,W.jsx)(Or,{label:`Copy next steps`,testId:`copy-plan-button`,text:c??``})]}):null,u===`advanced`&&l.length>1?(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i?`Order: failures first, then highest potential savings; impact band breaks ties.`:`Order: highest potential savings first, unestimated last; impact band breaks ties.`}):null]})}function Pr(){let e=N(e=>e.activeFileId),t=N(e=>e.exportMode),{resetToDropZone:n}=_t(),r=E();return t||e!==`sample-run`?null:(0,W.jsxs)(`section`,{"aria-label":`Sample run`,"data-testid":`sample-run-notice`,className:`flex flex-col gap-3 rounded-xl border border-primary/30 bg-primary/5 p-4 text-sm sm:flex-row sm:items-center sm:justify-between`,children:[(0,W.jsxs)(`p`,{className:`max-w-prose`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:`This is the sample run`}),`, a real Spark job from a public example corpus, picked because it shows several common problems. Everything below works the same on your own event log.`]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[(0,W.jsxs)(B,{size:`sm`,variant:`outline`,onClick:n,children:[`Load my event log`,(0,W.jsx)(ht,{"aria-hidden":`true`})]}),(0,W.jsx)(`a`,{href:ie,target:`_blank`,rel:`noopener noreferrer`,className:`tap-target-comfortable inline-flex items-center rounded-sm px-2 text-primary underline-offset-4 hover:underline`,onClick:e=>{!r||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),r.openSite(ie))},children:`Where do I find my log?`})]})]})}var Fr={critical:`inset 4px 0 0 var(--color-critical)`,warning:`inset 4px 0 0 var(--color-warning)`};function Ir({eyebrow:e,value:t,meta:n,flag:r=null,bar:i,dataTestid:a}){return(0,W.jsxs)(`div`,{"data-testid":a,className:`flex flex-col gap-1 p-3`,style:r?{boxShadow:Fr[r]}:void 0,children:[(0,W.jsxs)(`span`,{className:D(`flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,r&&ge[r]),children:[r&&(0,W.jsx)(Ce,{impactBand:r}),e]}),(0,W.jsx)(`div`,{className:D(`font-heading text-2xl font-semibold`,r&&ge[r]),children:t}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n}),i]})}function Lr({pct:e,flag:t,label:n}){let r=Math.max(0,Math.min(100,e));return(0,W.jsx)(`div`,{role:`img`,"aria-label":n,className:`mt-0.5 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,W.jsx)(`div`,{className:D(`h-full rounded-full`,t?xe[t]:`bg-clean`),style:{width:`${r}%`}})})}function Rr({active:e,total:t}){let n=t>0?Math.max(0,Math.min(100,e/t*100)):0;return(0,W.jsxs)(`div`,{role:`img`,"aria-label":`Active ${k(e)} of ${k(t)} total`,className:`mt-0.5 flex h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:[(0,W.jsx)(`div`,{className:`h-full bg-clean`,style:{width:`${n}%`}}),(0,W.jsx)(`div`,{className:`h-full flex-1 bg-muted-foreground/60`})]})}function zr(e){return e>0?`Ran ${k(e)}`:`No stage activity recorded`}function Br(){return(0,W.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl border border-warning/40 bg-warning/10 p-4`,children:[(0,W.jsx)(Ce,{impactBand:`warning`,className:`mt-1.5`}),(0,W.jsxs)(`p`,{className:`text-sm text-warning`,children:[(0,W.jsx)(`span`,{className:`font-semibold tracking-wide uppercase`,children:`Timing unavailable`}),`. This run has no complete application timing interval, so wall-clock, efficiency, and unused core time can’t be measured.`]})]})}function Vr({interpretation:e,catalog:t}){let n=j(),{runShape:r,coverage:i,wallClock:a}=e;if(r.wallClockMs==null)return(0,W.jsx)(Br,{});let o=r.wallClockMs,s=a.stagesActive,c=!i.noFinishedStages,l=r.efficiencyPct,u=r.efficiencyFlag,d=t.find(e=>e.type===`coldStart`),f=r.unusedCoreTimePct,p=r.unusedCoreTimeFlag;return(0,W.jsx)(xt,{className:`overflow-hidden py-0`,children:(0,W.jsxs)(`div`,{className:`grid grid-cols-1 divide-y divide-border sm:grid-cols-3 sm:divide-x sm:divide-y-0`,children:[(0,W.jsx)(Ir,{eyebrow:`Wall-clock`,dataTestid:`kpi-wall-clock`,value:o>0?k(o):`—`,meta:n===`advanced`||s<=0?(0,W.jsxs)(W.Fragment,{children:[zr(s),d?` · ${d.value}s cold start`:``]}):`Total run time.`,bar:(0,W.jsx)(Rr,{active:s,total:o})}),(0,W.jsx)(Ir,{eyebrow:`Efficiency`,dataTestid:`kpi-efficiency`,value:c?l==null?`Unavailable`:(0,W.jsxs)(W.Fragment,{children:[l,(0,W.jsx)(`small`,{children:`%`})]}):`Not measured`,flag:u,meta:c?l==null?`This run has no complete application timing interval.`:n===`advanced`?o>s?`${zr(s)} · ${k(o-s)} idle/gap time`:`executors active the whole run`:`Share of the run with a stage running (${k(s)}). Higher is better.`:`No stage in this log recorded an end, so there is no stage time to measure.`,bar:l==null?void 0:(0,W.jsx)(Lr,{pct:l,flag:u,label:`Efficiency ${l}%`})}),(0,W.jsx)(Ir,{eyebrow:`Unused core time`,dataTestid:`kpi-wastage`,value:f==null?`Unavailable`:(0,W.jsxs)(W.Fragment,{children:[f,(0,W.jsx)(`small`,{children:`%`})]}),flag:p,meta:r.unusedCoreTimeUnavailableReason===`application-timing`?`Unused core time needs complete application timing.`:r.unusedCoreTimeUnavailableReason===`core-usage-summary`?`Unused core time needs the core-usage summary.`:r.unusedCoreTimeUnavailableReason===`executor-capacity`?`Unused core time needs usable executor-capacity data.`:n===`advanced`?`Driver-idle + executor-slack core-hours as a share of available capacity. Directional, not a cost figure.`:`Share of executor core time that ran no task. Lower is better. Not a cost figure.`,bar:f==null?void 0:(0,W.jsx)(Lr,{pct:f,flag:p,label:`Unused core time ${f}%`})})]})})}function Hr({className:e,...t}){return(0,W.jsx)(_,{"data-slot":`accordion`,className:D(`flex w-full flex-col`,e),...t})}function Ur({className:e,...t}){return(0,W.jsx)(ee,{"data-slot":`accordion-item`,className:D(`not-last:border-b`,e),...t})}function Wr({className:e,children:t,headingLevel:n=3,...r}){let i=`h${n}`;return(0,W.jsx)(x,{className:`flex`,render:(0,W.jsx)(i,{}),children:(0,W.jsxs)(v,{"data-slot":`accordion-trigger`,className:D(`group/accordion-trigger relative flex flex-1 cursor-pointer items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:cursor-default aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground`,e),...r,children:[t,(0,W.jsx)(fe,{"data-slot":`accordion-trigger-icon`,className:`pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden`}),(0,W.jsx)(me,{"data-slot":`accordion-trigger-icon`,className:`pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline`})]})})}function Gr({className:e,children:t,...n}){return(0,W.jsx)(y,{"data-slot":`accordion-content`,className:`h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-150 ease-out data-ending-style:h-0 data-starting-style:h-0 motion-reduce:transition-none`,...n,children:(0,W.jsx)(`div`,{className:D(`pt-0 pb-2.5 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),children:t})})}function Kr(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function qr({type:e,label:t,thresholdSummary:n,status:r=`passed`}){let i=r===`notRun`;return(0,W.jsxs)(z,{"data-testid":`clean-check-row`,"data-clean-check-type":e,"data-clean-check-status":r,children:[(0,W.jsx)(R,{className:`w-px`,children:(0,W.jsxs)(`span`,{className:i?`inline-flex h-6 items-center gap-1 rounded-full bg-muted px-2 font-mono text-xs font-medium whitespace-nowrap text-muted-foreground`:`inline-flex h-6 items-center gap-1 rounded-full bg-clean/10 px-2 font-mono text-xs font-medium whitespace-nowrap text-clean`,children:[(0,W.jsx)(i?At:Ot,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),_e(e)]})}),(0,W.jsxs)(R,{className:`whitespace-normal`,children:[(0,W.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:Kr(t)}),(0,W.jsx)(M,{children:(0,W.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:Kr(`${n}.`)})})]})]})}var Jr=`suggested-improvements`,Yr={stage:`per-stage`,app:`app-level`,sql:`sql-scope`,config:`config-scope`},Xr=[`per-stage`,`app-level`,`sql-scope`,`config-scope`],Zr={"per-stage":`Per-stage checks`,"app-level":`App-level checks`,"sql-scope":`SQL plan checks`,"config-scope":`Config checks`};function Qr(e,t,n){let r=[...e,...t].filter(T);return vn(n).filter(({type:e})=>!bn(e)).map(({component:e,widgetId:t,type:n},i)=>{let a=r.filter(e=>e.type===n);return{component:e,widgetId:t,index:i,findings:a,impactBand:we(a)}}).filter(e=>e.impactBand!==void 0).sort((e,t)=>oe[e.impactBand]-oe[t.impactBand]||e.index-t.index)}function $r({catalog:e,configFindings:t=[],coverage:n,detectors:r}){let i=[...e,...t].filter(T),a=e=>e in n.notRunReasons,o=Object.keys(gn).filter(e=>!bn(e)).filter(e=>!i.some(t=>t.type===e)).map(e=>({type:e,findingLabel:yt(e)})),s=o.filter(({type:e})=>!a(e)),c=o.filter(({type:e})=>a(e)),l=c.length>0?n.gaps:[],u=new Map;for(let e of s){let t=r[e.type]?.scope,n=t?Yr[t]:`app-level`;u.has(n)||u.set(n,[]),u.get(n).push(e)}return(0,W.jsx)(Hr,{children:(0,W.jsxs)(Ur,{value:`clean-checks`,children:[(0,W.jsx)(Wr,{children:`Clean checks`}),(0,W.jsxs)(Gr,{children:[c.length>0?(0,W.jsxs)(`div`,{"data-testid":`clean-checks-not-run`,className:`pb-4`,children:[(0,W.jsx)(`p`,{className:`pb-1 text-xs font-medium text-muted-foreground`,children:`Not checked on this log`}),(0,W.jsx)(`p`,{className:`pb-2 text-xs text-muted-foreground`,children:`The log lacked the data these checks need, so they neither passed nor failed.`}),l.length>0?(0,W.jsx)(`ul`,{"data-testid":`clean-checks-not-run-reasons`,className:`list-disc space-y-0.5 pb-2 pl-5 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:l.map(e=>(0,W.jsx)(`li`,{children:e},e))}):null,(0,W.jsx)(ft,{children:(0,W.jsx)(pt,{children:c.map(({type:e,findingLabel:t})=>(0,W.jsx)(qr,{type:e,label:t,thresholdSummary:r[e]?.thresholdSummary??``,status:`notRun`},e))})})]}):null,(0,W.jsxs)(`p`,{className:`pb-2 text-xs text-muted-foreground`,children:[s.length===0?`No check could run on this log.`:`Every check below passed.`,(0,W.jsx)(M,{children:` Each caption gives the threshold it was held to.`})]}),Xr.map(e=>{let t=u.get(e);return!t||t.length===0?null:(0,W.jsxs)(`div`,{className:`pt-3 first:pt-0`,children:[(0,W.jsx)(`p`,{className:`pb-1 text-xs font-medium text-muted-foreground`,children:Zr[e]}),(0,W.jsx)(ft,{children:(0,W.jsx)(pt,{children:t.map(({type:e,findingLabel:t})=>(0,W.jsx)(qr,{type:e,label:t,thresholdSummary:r[e]?.thresholdSummary??``},e))})})]},e)})]})]})})}var ei=`inline-flex h-7 shrink-0 cursor-pointer items-center gap-1 rounded-full border border-border bg-background px-2.5 text-xs font-medium whitespace-nowrap outline-none transition-colors hover:bg-muted focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`;function ti({stageId:e,className:t}){let{openStage:n}=Dt();return(0,W.jsxs)(`button`,{type:`button`,className:D(ei,t),title:`Open details for Stage ${e}`,"aria-label":`Open details for Stage ${e}`,onClick:()=>n(e),children:[`Stage `,(0,W.jsx)(`b`,{children:e})]})}var ni=30;function ri(e,{limit:t=6,chunk:n=ni,dataset:r=e}={}){let[i,a]=(0,H.useState)({dataset:r,revealed:0}),o=!Object.is(i.dataset,r);o&&a({dataset:r,revealed:0});let s=t+(o?0:i.revealed);return{visible:e.slice(0,s),remaining:Math.max(0,e.length-s),revealMore:()=>a(e=>({dataset:r,revealed:(Object.is(e.dataset,r)?e.revealed:0)+n})),revealThrough:e=>a(n=>{let i=Object.is(n.dataset,r)?n.revealed:0,a=Math.max(i,e-t+1);return a>i?{dataset:r,revealed:a}:n})}}function ii({pills:e}){let t=new Set,n=e.filter(e=>!t.has(e.id)&&(t.add(e.id),!0)),{visible:r,remaining:i,revealMore:a}=ri(n,{limit:6,dataset:JSON.stringify(n.map(({id:e})=>e))}),o=n.slice(r.length);return(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[r.map(e=>(0,W.jsx)(ti,{stageId:e.id},e.id)),i>0&&(0,W.jsxs)(`button`,{type:`button`,className:D(ei,`bg-muted`),title:`Also flagged: Stage ${o.map(e=>e.id).join(`, Stage `)}`,"aria-label":`Show ${i} more stage${i===1?``:`s`}`,onClick:a,children:[`+`,i]})]})}function ai({page:e,totalPages:t,onPrev:n,onNext:r,renderJumpControl:i}){return t<=1?null:(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs ${i?`justify-between`:`justify-end`}`,children:[i?.(),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`tap-target-comfortable tap-target-comfortable--sm`,onClick:n,disabled:e===0,children:`Previous`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Page `,e+1,` of `,t]}),(0,W.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`tap-target-comfortable tap-target-comfortable--sm`,onClick:r,disabled:e===t-1,children:`Next`})]})]})}var oi=10,si=`max-sm:flex max-sm:flex-wrap max-sm:items-start`,ci=`max-sm:w-auto max-sm:shrink-0`,li=`max-sm:min-w-0 max-sm:flex-1 max-sm:whitespace-normal max-sm:[overflow-wrap:anywhere]`,ui=`max-sm:w-full max-sm:basis-full max-sm:pt-0 max-sm:text-left`;function di(e){let t=$e(e),n=e.stageId==null?t&&t.length>0?`St.${Se(t)}`:null:`St.${e.stageId}`;if(e.type===`duplicatePlanSubtree`&&e.rootName!=null){let t=fi(e);return n&&t?`${n} · ${t}`:t??n}return n||(e.type===`configAudit`?e.property:null)}function fi(e){if(e.type!==`duplicatePlanSubtree`||e.rootName==null)return null;let t=le(e.rootName),n=e.groupIndex==null?t:`${t} #${Number(e.groupIndex)+1}`;return e.executionId==null?n:`${n} (SQL ${e.executionId})`}function pi({finding:e,textClassName:t}){let{stageId:n}=e,r=$e(e);if(n!=null)return(0,W.jsx)(ti,{stageId:n});if(r&&r.length>0){let n=fi(e);return(0,W.jsxs)(`span`,{className:`inline-flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,W.jsx)(ii,{pills:r.map(e=>({id:e}))}),n?(0,W.jsx)(`span`,{className:D(`truncate`,t),title:n,children:n}):null]})}let i=di(e);return i?(0,W.jsx)(`span`,{className:D(`min-w-0 truncate`,t),title:i,children:i}):null}function mi({finding:e,allFindings:t,onRoute:n}){let r=wr(e,t),i=di(e),a=Oe(e)?.figure??null,o=Tt(e),s=wt(e);return(0,W.jsxs)(z,{"data-testid":`fix-these-first-row`,"data-finding-type":e.type,className:si,children:[(0,W.jsx)(R,{className:D(`w-px`,ci),children:(0,W.jsx)(ue,{type:e.type,impactBand:e.impactBand,docAnchor:e.docAnchor})}),(0,W.jsx)(R,{className:D(`whitespace-normal`,li),children:(0,W.jsxs)(`button`,{type:`button`,"data-shortcut-target":!0,className:`cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,onClick:()=>r&&n(r),children:[(0,W.jsx)(`span`,{className:`block text-sm font-medium`,children:s}),(0,W.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:o})]})}),(0,W.jsx)(R,{className:D(`w-px text-right font-mono text-xs text-muted-foreground`,ui),title:[i,a].filter(Boolean).join(` · `),children:(0,W.jsxs)(`span`,{className:`flex items-center justify-end gap-1.5 max-sm:justify-start`,children:[(0,W.jsx)(pi,{finding:e}),a?(0,W.jsx)(`span`,{className:`shrink-0`,children:a}):null]})})]})}function hi({finding:e,allFindings:t,onRoute:n,id:r}){let i=wr(e,t),a=di(e),o=Oe(e)?.figure??null,s=Tt(e),c=wt(e),l=e.stageId!=null||a!=null;return(0,W.jsxs)(z,{id:r,"data-testid":`fix-these-first-row`,"data-finding-type":e.type,className:`bg-muted/50`,children:[(0,W.jsxs)(R,{colSpan:2,className:`whitespace-normal`,children:[l?(0,W.jsx)(`div`,{className:`mb-1`,children:(0,W.jsx)(pi,{finding:e,textClassName:`line-clamp-1 break-words text-xs font-medium font-mono`})}):null,(0,W.jsxs)(`button`,{type:`button`,"data-shortcut-target":!0,className:`block w-full cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,onClick:()=>i&&n(i),children:[l?null:(0,W.jsx)(`span`,{className:`line-clamp-1 break-words text-xs font-medium`,children:c}),(0,W.jsx)(`span`,{className:`line-clamp-1 break-words text-xs text-muted-foreground`,children:s})]})]}),(0,W.jsx)(R,{className:`w-px text-right font-mono text-xs text-muted-foreground`,children:o})]})}function gi({group:e,allFindings:t,expanded:n,onToggle:r,onRoute:i}){let[a,o]=(0,H.useState)(0),s=e.findings,c=s[0],l=te(c),u=wt(c),d=Math.ceil(s.length/oi),f=Math.min(a,Math.max(0,d-1)),p=s.slice(f*oi,f*oi+oi),m=`fix-these-first-group-content-${e.kind}-${e.type}${e.unit?`-${e.unit}`:``}`;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(z,{"data-testid":`fix-these-first-group-row`,"data-finding-type":e.type,className:si,children:[(0,W.jsx)(R,{className:D(`w-px`,ci),children:(0,W.jsx)(ue,{type:e.type,impactBand:c.impactBand,docAnchor:he(e.findings)})}),(0,W.jsx)(R,{className:D(`whitespace-normal`,li),children:(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":n,"aria-controls":m,"data-shortcut-target":!0,className:`cursor-pointer rounded-sm text-left focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,onClick:r,children:[(0,W.jsx)(`span`,{className:`block text-sm font-medium`,children:u}),l?(0,W.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:l}):null]})}),(0,W.jsx)(R,{className:D(`w-px text-right font-mono text-xs text-muted-foreground`,ui),children:(0,W.jsxs)(`span`,{className:`inline-flex items-center justify-end gap-1.5`,title:e.statTitle,children:[e.stat,n?(0,W.jsx)(me,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}):(0,W.jsx)(fe,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]})})]}),n&&p.map((e,n)=>(0,W.jsx)(hi,{finding:e,allFindings:t,onRoute:i,id:n===0?m:void 0},e.id)),n&&d>1&&(0,W.jsx)(z,{className:`bg-muted/50`,children:(0,W.jsx)(R,{colSpan:3,children:(0,W.jsx)(ai,{page:f,totalPages:d,onPrev:()=>o(e=>e-1),onNext:()=>o(e=>e+1)})})})]})}function _i(e,t,n,r){let{eligible:i,groups:a}=ve(r,[...e,...t],n);return{eligible:i,groups:a,triageTarget:Tr(r,i)}}var vi={critical:`Critical`,warning:`Warning`,info:`Info`},yi=[`critical`,`warning`,`info`];function bi({impactBand:e,groups:t,widgets:n,allFindings:r,expandedGroupKey:i,onToggleGroup:a,onRoute:o,appModel:s,catalog:c,configFindings:l,getTaskData:u,activeFileId:d}){let f=j(),[p,m]=(0,H.useState)(!1),h=mt(),g=h!=null&&n.some(e=>e.widgetId===h.widgetId);if((0,H.useLayoutEffect)(()=>{g&&m(!0)},[g]),t.length===0&&n.length===0)return null;let _=`impact-band-${e}-heading`,v=`impact-band-${e}-evidence`,y=f===`basic`&&t.length>0&&n.length>0,b=!y||p||g;return(0,W.jsxs)(`section`,{"aria-labelledby":_,className:`space-y-3`,children:[(0,W.jsx)(`h2`,{id:_,tabIndex:-1,className:`scroll-mt-20 rounded-sm font-heading text-base font-semibold outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:vi[e]}),t.length>0&&(0,W.jsx)(ft,{children:(0,W.jsx)(pt,{children:t.map(e=>{if(e.findings.length===1)return(0,W.jsx)(mi,{finding:e.findings[0],allFindings:r,onRoute:o},e.findings[0].id);let{key:t}=e;return(0,W.jsx)(gi,{group:e,allFindings:r,expanded:i===t,onToggle:()=>a(t),onRoute:o},t)})})}),y?(0,W.jsxs)(B,{variant:`ghost`,size:`sm`,"aria-expanded":b,"aria-controls":v,onClick:()=>m(!b),children:[b?`Hide the evidence`:`Show the evidence (${n.length} ${n.length===1?`card`:`cards`})`,b?(0,W.jsx)(me,{"aria-hidden":`true`}):(0,W.jsx)(fe,{"aria-hidden":`true`})]}):null,n.length>0&&b&&(0,W.jsx)(`div`,{id:v,children:(0,W.jsx)(gt,{children:n.map(({component:e,widgetId:t,index:n})=>(0,W.jsx)(L,{cardId:`alert-${n}`,widgetId:t,children:(0,W.jsx)(H.Suspense,{fallback:(0,W.jsx)(Et,{}),children:(0,W.jsx)(e,{appModel:s,catalog:c,configFindings:l,getTaskData:u,activeFileId:d,defaultCollapsed:!0})})},t))})})]})}function xi({appModel:e,catalog:t,configFindings:n=[],stages:r,getTaskData:i,activeFileId:a,onRoute:o}){let s=A(),{groups:c}=(0,H.useMemo)(()=>_i(t,n,r,s),[t,n,r,s]),l=[...t,...n],u=s?.data.detectors,d=(0,H.useMemo)(()=>u?Qr(t,n,u):[],[t,n,u]),[f,p]=(0,H.useState)(null),{groupsByImpactBand:m,widgetsByImpactBand:h}=(0,H.useMemo)(()=>{let e=new Map;for(let t of c){let n=t.band;e.has(n)||e.set(n,[]),e.get(n).push(t)}let t=new Map;for(let e of d)t.has(e.impactBand)||t.set(e.impactBand,[]),t.get(e.impactBand).push(e);return{groupsByImpactBand:e,widgetsByImpactBand:t}},[c,d]);return(0,W.jsxs)(`div`,{id:Jr,className:`space-y-6 scroll-mt-20`,children:[yi.map(r=>(0,W.jsx)(bi,{impactBand:r,groups:m.get(r)??[],widgets:h.get(r)??[],allFindings:l,expandedGroupKey:f,onToggleGroup:e=>p(t=>t===e?null:e),onRoute:o,appModel:e,catalog:t,configFindings:n,getTaskData:i,activeFileId:a},r)),s?(0,W.jsx)($r,{catalog:t,configFindings:n,coverage:s.data.coverage,detectors:s.data.detectors}):null]})}var Si=5,Ci=30,wi=220;function Ti(e,t){if(e.length<2)return e[0]??null;let n=e[1]-e[0],r=Math.round((t-e[0])/n);return e[Math.min(e.length-1,Math.max(0,r))]}function Ei({metrics:e,fieldNames:t,markers:n={}}){let r=t.indexOf(`duration`);if(r===-1)return null;let i=t.length,a=e.length/i,o=[];for(let t=0;t<a;t++)o.push(e[t*i+r]);if(o.length<Si)return(0,W.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Too few tasks (`,o.length,`) for a distribution.`]});let{labels:s,data:d}=be(o,Ci),h=s[1]-s[0],_=s.map((e,t)=>({bin:`${(e/1e3).toFixed(1)}s`,range:`${(e/1e3).toFixed(1)}s – ${((e+h)/1e3).toFixed(1)}s`,ms:e,count:d[t]})),v=n.p50==null?null:Ti(s,n.p50),y=n.p95==null?null:Ti(s,n.p95),b=v==null?void 0:_.find(e=>e.ms===v)?.bin,x=y==null?void 0:_.find(e=>e.ms===y)?.bin;return(0,W.jsx)(F,{title:`Task duration`,ariaLabel:`Task duration histogram`,height:wi,table:{caption:`Task duration histogram`,columns:[`Duration bin`,`Task count`],rows:_.map(e=>[e.range,e.count]),align:[`right`,`right`]},children:(0,W.jsxs)(l,{data:_,children:[(0,W.jsx)(c,{vertical:!1,stroke:P.muted,strokeOpacity:.2}),(0,W.jsx)(m,{dataKey:`bin`,tick:{fontSize:10}}),(0,W.jsx)(f,{allowDecimals:!1,tick:{fontSize:10},width:32}),(0,W.jsx)(g,{...st,formatter:e=>[`${Number(e)} task${Number(e)===1?``:`s`}`,`Count`],labelFormatter:(e,t)=>t?.[0]?.payload?.range??e}),(0,W.jsx)(u,{dataKey:`count`,name:`Tasks`,fill:P.accent}),b?(0,W.jsx)(p,{x:b,stroke:P.accent,label:`P50`}):null,x?(0,W.jsx)(p,{x,stroke:P.warning,label:`P95`}):null]})})}function Di({finding:e}){let t=(0,H.useId)(),n=Oe(e),r=e.impactEstimate;if(!r)return null;let i=n?.board;if(!i)return null;let a=`Estimate method: ${r.estimateMethod}`;return(0,W.jsxs)(`span`,{className:`impact-estimate text-xs text-muted-foreground`,title:a,tabIndex:0,"aria-describedby":t,children:[`Potential savings: `,(0,W.jsx)(`strong`,{children:i}),(0,W.jsx)(`span`,{id:t,className:`sr-only`,children:a})]})}var Oi=[`PROCESS_LOCAL`,`NODE_LOCAL`,`RACK_LOCAL`,`NO_PREF`,`ANY`],ki=[P.clean,P.accent,P.warning,P.muted,P.critical];function Ai(e){return e?new Date(e).toLocaleString():`—`}function ji({stats:e}){let t=new Map(e.map(e=>[e.locality,e.count])),n=Oi.filter(e=>t.has(e));for(let t of e)Oi.includes(t.locality)||n.push(t.locality);let r=n.map((e,n)=>({locality:e,count:t.get(e)??0,color:ki[Math.min(n,ki.length-1)]}));return(0,W.jsx)(F,{ariaLabel:`Task locality distribution`,height:140,table:{caption:`Task locality distribution`,columns:[`Locality tier`,`Task count`],rows:r.map(e=>[e.locality,e.count]),align:[`left`,`right`]},children:(0,W.jsxs)(l,{data:r,children:[(0,W.jsx)(c,{vertical:!1,stroke:P.muted,strokeOpacity:.2}),(0,W.jsx)(m,{dataKey:`locality`,tick:{fontSize:10}}),(0,W.jsx)(f,{allowDecimals:!1,tick:{fontSize:10},width:32}),(0,W.jsx)(g,{formatter:e=>[`${Number(e)} task${Number(e)===1?``:`s`}`,`Tasks`]}),(0,W.jsx)(u,{dataKey:`count`,name:`Tasks`,children:r.map(e=>(0,W.jsx)(a,{fill:e.color},e.locality))})]})})}function Mi(e,t){let n=new Map;for(let t of e){n.has(t.type)||n.set(t.type,{impactBand:t.impactBand,finding:t,recs:new Map});let e=n.get(t.type);oe[t.impactBand]<oe[e.impactBand]&&(e.impactBand=t.impactBand,e.finding=t),t.recommendation&&!e.recs.has(t.recommendation)&&e.recs.set(t.recommendation,{extended:t.type===`retryWaste`?t.extended??null:null})}let r=e=>t.includes(e)?t.indexOf(e):t.length;return[...n.entries()].sort(([e],[t])=>r(e)-r(t))}function Ni({rec:e,extended:t,finding:n,showImpactEstimate:r}){let{measured:i,fix:a}=St(e);return(0,W.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[i?(0,W.jsxs)(`p`,{className:`max-w-full leading-normal break-words`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:`What's happening: `}),i]}):null,(0,W.jsxs)(`p`,{className:`max-w-full leading-normal break-words`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:`What to try: `}),a]}),t?(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null,r?(0,W.jsx)(Di,{finding:n}):null]})}function Pi(e,t){return`${e} ${t}${e===1?``:`s`}`}function Fi(e,t,n){let r=(e.completedAt??0)-(e.submittedAt??0),i=[];if(r>0){let e=t!=null&&t>0?Math.round(r/t*100):null;i.push(`Ran for ${k(r)}${e==null?``:`, ${e}% of this ${k(t)} run`}`)}return(e.taskCount??0)>0&&i.push(`split into ${Pi(e.taskCount,`task`)}`),[i.length>0?`${i.join(`, `)}.`:``,n===0?`Nothing was flagged on this stage.`:n===1?`1 finding here.`:`${n} findings here. They often share one cause, so start with the first.`].filter(Boolean).join(` `)}function Ii({stage:e,findings:t,typeOrder:n,catalog:r,runMs:i,onShowEvidence:a}){let o=A(),s=Mi(t,n);return(0,W.jsxs)(`section`,{"aria-label":`Why this stage was flagged`,className:`space-y-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Fi(e,i,s.length)}),s.length>0?(0,W.jsx)(`ol`,{className:`space-y-4 rounded-md border p-3`,children:s.map(([e,{impactBand:t,finding:n,recs:i}])=>{let s=Te(o,n)?.compact!=null,c=a?wr(n,r):null;return(0,W.jsxs)(`li`,{className:`space-y-1.5`,"data-testid":`stage-finding`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(ue,{type:e,impactBand:t}),(0,W.jsx)(`h3`,{className:`text-sm font-semibold`,children:wt(n)})]}),[...i.entries()].map(([e,{extended:t}],r)=>(0,W.jsx)(Ni,{rec:e,extended:t,finding:n,showImpactEstimate:r===0&&s},r)),c&&a?(0,W.jsxs)(B,{size:`sm`,variant:`outline`,onClick:()=>a(c),children:[`Show evidence`,(0,W.jsx)(ht,{"aria-hidden":`true`})]}):null]},e)})}):null]})}function Li({stage:e,appModel:t}){return Je(e.id,t)?(0,W.jsx)(Ge,{title:`Query Plan`,children:(0,W.jsx)(et,{stageId:e.id,appModel:t})}):null}function Ri({stage:e,appModel:t,catalog:n,getTaskData:r,onShowEvidence:i}){let{exportMode:a,getTaskData:o}=Zn(r),[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(0),p=(e.taskCount??0)>0,m=A(),h=m?.data.stages[String(e.id)],g=m&&h?h.findingIndexes.map(e=>de(m,e)).filter(e=>e!=null):[];(0,H.useEffect)(()=>{if(!p||!o)return;let t=!1;return u(!1),o(e.id).catch(()=>null).then(e=>{t||(e?c(e):u(!0))}),()=>{t=!0}},[d]);let _=(e.completedAt??0)-(e.submittedAt??0),v=(e.memoryBytesSpilled??0)>0||(e.diskBytesSpilled??0)>0,y=(e.jvmGCTime??0)>0||(e.gcPct??0)>0,b=e.fetchWaitTime??0,x=b>0&&_>0?Math.round(b/_*100):null,S=(e.inputBytes??0)>0?((e.outputBytes??0)/(e.inputBytes??0)).toFixed(2):null,C=e.localityStats??[];return(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsx)(Ii,{stage:e,findings:g,typeOrder:h?.typeOrder??[],catalog:n,runMs:m?.data.runShape.wallClockMs??null,onShowEvidence:i}),(0,W.jsx)(He,{title:`Overview`,collapsible:!0,defaultOpen:!0,rows:[[`Duration`,k(_)],[`Submitted`,Ai(e.submittedAt)],[`Completed`,Ai(e.completedAt)],e.sqlExecutionId!=null&&[`SQL Execution`,`#${e.sqlExecutionId}`],e.stageType?[`Stage type`,e.stageType]:!1]}),(0,W.jsx)(He,{title:`Tasks`,collapsible:!0,rows:[[`Total`,String(e.taskCount)],[`Failed`,String(e.failedTasks)],[`P50 duration`,(e.taskDurationP50??0)>0?k(e.taskDurationP50):`—`],[`P95 duration`,(e.taskDurationP95??0)>0?k(e.taskDurationP95):`—`],[`Max duration`,(e.taskDurationMax??0)>0?k(e.taskDurationMax):`—`],(e.peakExecutionMemoryMax??0)>0&&[`Peak execution memory`,O(e.peakExecutionMemoryMax)]],children:p?a?(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Per-task duration data isn’t included in exported reports.`}):s?(0,W.jsx)(Ei,{metrics:s.metrics,fieldNames:s.fieldNames,markers:{p50:e.taskDurationP50,p95:e.taskDurationP95}}):l?(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Couldn’t load task data for this stage.`}),(0,W.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>f(e=>e+1),children:`Retry`})]}):(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading task data…`}):null}),(0,W.jsx)(He,{title:`Locality`,collapsible:!0,rows:[],children:C.length>0?(0,W.jsx)(ji,{stats:C}):null}),(0,W.jsx)(He,{title:`I/O`,collapsible:!0,rows:[[`Input`,O(e.inputBytes)],[`Output`,O(e.outputBytes)],[`Shuffle read`,O(e.shuffleReadBytes)],[`Shuffle write`,O(e.shuffleWriteBytes)],b>0&&[`Fetch wait`,`${k(b)}${x==null?``:` (${x}%)`}`],S!=null&&[`I/O ratio`,S]]}),v?(0,W.jsx)(He,{title:`Spill`,collapsible:!0,rows:[[`Memory spilled`,O(e.memoryBytesSpilled)],[`Disk spilled`,O(e.diskBytesSpilled)],(e.memoryBytesSpilled??0)>0&&[`Classification`,e.spillClassification??`unclassified`]]}):null,y?(0,W.jsx)(He,{title:`GC`,collapsible:!0,rows:[[`JVM GC time`,k(e.jvmGCTime)],[`Executor run time`,k(e.executorRunTime)],[`GC %`,`${(e.gcPct??0).toFixed(1)}%`]]}):null,e.details?(0,W.jsx)(M,{children:(0,W.jsx)(Ge,{title:`Call Stack`,children:(0,W.jsx)(`pre`,{className:`overflow-x-auto rounded-md bg-muted p-2 text-xs whitespace-pre-wrap`,children:e.details})})}):null,(0,W.jsx)(Li,{stage:e,appModel:t})]})}function zi({appModel:e,catalog:t,getTaskData:n,onRoute:r}){let{stageId:i,close:a}=Dt(),o=i==null?void 0:e.stages.get(i),s=o!=null,c=(0,H.useRef)(!1),l=r?e=>{c.current=!0,a(),r(e)}:void 0;return(0,W.jsx)(Qe,{open:s,onOpenChange:e=>{e||a()},children:(0,W.jsx)(tt,{className:`max-h-[85vh] overflow-y-auto sm:max-w-4xl`,finalFocus:()=>{let e=c.current;return c.current=!1,!e},children:o?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(rt,{children:[(0,W.jsxs)(We,{children:[`Stage `,o.id]}),o.name?(0,W.jsxs)(Ue,{className:`font-mono text-xs [overflow-wrap:anywhere]`,children:[(0,W.jsx)(`span`,{className:`font-sans`,children:`Code location: `}),o.name]}):null]}),(0,W.jsx)(Ri,{stage:o,appModel:e,catalog:t,getTaskData:n,onShowEvidence:l},o.id)]}):null})})}function Bi(e){return Vi(e)||typeof e==`function`||Hi(e)}function Vi(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Hi(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function Ui(e,t){return e==null?null:Bi(e)?H.createElement(e,t):e}function Wi(e){if(`cell`in e&&e.cell){let t=e.cell,n=t.column.columnDef,r=t,i=n;return r.getIsAggregated?.()?Ui(i.aggregatedCell??n.cell,t.getContext()):r.getIsPlaceholder?.()?null:Ui(n.cell,t.getContext())}return`header`in e&&e.header?Ui(e.header.column.columnDef.header,e.header.getContext()):`footer`in e&&e.footer?Ui(e.footer.column.columnDef.footer,e.footer.getContext()):null}function Gi({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Ki(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var qi=[],Ji=0,{link:Yi,unlink:Xi,propagate:Zi,checkDirty:Qi,shallowPropagate:$i}=Gi({update(e){return e._update()},notify(e){qi[ta++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ia(e))}}),ea=0,ta=0,q,na=0;function ra(e){try{++na,e()}finally{--na||aa()}}function ia(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Xi(n,e)}function aa(){if(!(na>0)){for(;ea<ta;){let e=qi[ea];qi[ea++]=void 0,e.notify()}ea=0,ta=0}}function oa(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return q!==void 0&&Yi(i,q,Ji),i._snapshot},subscribe(e){let t=Ki(e),n={current:!1},r=sa(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=q,o=t?.compare??Object.is;if(n)q=i,++Ji,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{q=a,n&&(i.flags&=-5),ia(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&Qi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&$i(e)}}else e&32&&(i.flags=e&-33);return q!==void 0&&Yi(i,q,Ji),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Zi(e),$i(e),aa())}},i}function sa(e){let t=()=>{let t=q;q=n,++Ji,n.depsTail=void 0,n.flags=6;try{return e()}finally{q=t,n.flags&=-5,ia(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&Qi(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,ia(this)}};return t(),n}function ca(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=la(e);if(n.length!==la(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function la(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var ua=e(r(),1);function da(e,t){return e===t}function fa(e,t=e=>e,n){let r=n?.compare??da,i=(0,H.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,H.useCallback)(()=>e.get(),[e]);return(0,ua.useSyncExternalStoreWithSelector)(i,a,a,t,r)}function pa(e){let t=fa(e.source,e.selector,{compare:ca});return typeof e.children==`function`?e.children(t):e.children}function ma(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}function ha(e){let{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},schedule:e.schedule??(e=>queueMicrotask(e)),batch:n,untrack:e=>e(),createReadonlyAtom:(e,n)=>{let i=n?.compare??Object.is,a=!1,o,s=()=>{let t=e();return(!a||!i(o,t))&&(o=t,a=!0),o},c=t(()=>(r.get(),s()),{compare:i});return{get:s,subscribe:c.subscribe.bind(c)}},createWritableAtom:(e,n)=>t(e,{compare:n?.compare}),commit:()=>{r.set(e=>e+1)}}}function ga(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:e=>{r=e,n=!0},subscribe:i=>e.subscribe(e=>{(!n||!t(r,e))&&i(e)})}}function _a(){return ha({createAtom:oa,batch:ra})}function va(e,t){return typeof e==`function`?e(t):e}function J(e){if(Array.isArray(e))return e.map(J);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?Y():{},r=Object.keys(e);for(let t=0;t<r.length;t++){let i=r[t];Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:J(e[i]),writable:!0})}return n}return e}function ya(e,t){let n=Object.keys(t),r=e;for(let e=0;e<n.length;e++){let i=n[e];!i.startsWith(`_memo_`)&&i!==`_cellsCache`&&(r[i]=t[i])}return e}function Y(){return Object.create(null)}function ba(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xa(e,t){return n=>{(t.options.atoms?.[e]??t.baseAtoms[e]).set(e=>va(n,e))}}function Sa(e){if(typeof e!=`object`||!e)return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ca(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var wa=3;function Ta(e,t){return Ea(e,t,wa)}function Ea(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!Sa(e)||!Sa(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;let r=Ca(e),i=Ca(t);if(r.length!==i.length)return!1;let a=e,o=t;for(let e=0;e<r.length;e++){let i=r[e];if(!Object.prototype.propertyIsEnumerable.call(t,i)||!Ea(a[i],o[i],n-1))return!1}return!0}function Da(e,t,n,r=Ta){let i=`on${t.charAt(0).toUpperCase()}${t.slice(1)}Change`,a=e.options[i];a&&a(e=>{let t=va(n,e);return r(e,t)?e:t})}function Oa(e){return e instanceof Function}function ka(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}var Aa=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e<l.length;e++)if(l[e]!==o[e]){u=!0;break}}return n?.(u),u?(o=l,a?.(),s=e(...l??[]),r?.(s),s):s}};function ja(e){let t=!1;return()=>{if(!t){t=!0;return}e()}}function Ma({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o=()=>{if(!r)return;let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))},s={onAfterUpdate:()=>{o()}};return Aa({...a,...s})}function Na(e,t=`_`){let[n,r]=e.split(t);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function X(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=Na(r);t[n]=a?Ma({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function Z(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=Na(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=Ma({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function Q(e,t,n,...r){return e[t]?.(...r)??n(e,...r)}function Pa(e){return e.row.getValue(e.column.id)}function Fa(e){return e.getValue()??e.table.options.renderFallbackValue}function Ia(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}var La={assignCellPrototype:(e,t)=>{Z(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>Pa(e)},cell_renderValue:{fn:e=>Fa(e)},cell_getContext:{fn:e=>Ia(e),memoDeps:e=>[e]}})}};function Ra(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignHeaderPrototype?.(e._headerPrototype,e)}return e._headerPrototype}function za(e,t,n){let r=Ra(e),i=Object.create(r);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];let a=e._headerInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function Ba(){return{start:[],end:[]}}function Va(){return Y()}function Ha(e,t){Ua(e)&&Ya(e.table,n=>{let r=Object.assign(Y(),n),i=t??!Q(e,`getIsVisible`,$),a=e.getLeafColumns();for(let e=0;e<a.length;e++){let t=a[e];Ua(t)&&(r[t.id]=i)}return r})}function $(e){let t=e.table.atoms.columnVisibility?.get();if(!t)return!0;let n=e.columns;return n.length?n.some(e=>Q(e,`getIsVisible`,$)):(ba(t,e.id)?t[e.id]:void 0)??!0}function Ua(e){return(e.columnDef.enableHiding??!0)&&(e.table.options.enableHiding??!0)}function Wa(e){return t=>{Ha(e,t.target.checked)}}function Ga(e){let t=e.getAllCells(),n=[];for(let e=0;e<t.length;e++){let r=t[e];Q(r.column,`getIsVisible`,$)&&n.push(r)}let{start:r,end:i}=e.table.atoms.columnPinning?.get()??Ba();if(!r.length&&!i.length)return n;let a=Q(e,`getVisibleCellsByColumnId`,Ka),o=[];for(let e=0;e<r.length;e++){let t=a[r[e]];t&&o.push(t)}let s=[];for(let e=0;e<i.length;e++){let t=a[i[e]];t&&s.push(t)}let c=[];for(let e=0;e<n.length;e++){let t=n[e],a=t.column.id;!r.includes(a)&&!i.includes(a)&&c.push(t)}return[...o,...c,...s]}function Ka(e){let t=Y(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];Q(r.column,`getIsVisible`,$)&&(t[r.column.id]=r)}return t}function qa(e){return e.getAllFlatColumns().filter(e=>Q(e,`getIsVisible`,$))}function Ja(e){return e.getAllLeafColumns().filter(e=>Q(e,`getIsVisible`,$))}function Ya(e,t){Da(e,`columnVisibility`,t)}function Xa(e,t){Ya(e,t?Y():Object.assign(Y(),J(e.initialState.columnVisibility??{})))}function Za(e,t){t??=!Qa(e);let n=Y(),r=e.getAllLeafColumns();for(let e=0;e<r.length;e++){let i=r[e];n[i.id]=t||!Ua(i)}Ya(e,n)}function Qa(e){return!e.getAllLeafColumns().some(e=>!Q(e,`getIsVisible`,$))}function $a(e){return e.getAllLeafColumns().some(e=>Q(e,`getIsVisible`,$))}function eo(e){return t=>{Za(e,t.target.checked)}}function to(e,t=1){let n=t;for(let r=0;r<e.length;r++){let i=e[r];Q(i,`getIsVisible`,$)&&i.columns.length&&(n=Math.max(n,to(i.columns,t+1)))}return n}function no(e,t){return e?`${e}_${t}`:String(t)}function ro(e,t,n,r){let i=e??``;return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),r&&(i=i?`${i}_${r}`:r),i}function io(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].column===t&&n++;return n}function ao(e,t,n,r,i,a){let o={depth:t,id:no(r,t),headers:[]},s=[];for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i],c=s[s.length-1],l=a.column.depth===o.depth,u,d=!1;if(l&&a.column.parent?u=a.column.parent:(u=a.column,d=!0),c&&c.column===u)c.subHeaders.push(a);else{let e=za(n,u,{id:ro(r,t,u.id,a.id),isPlaceholder:d,placeholderId:d?String(io(s,u)):void 0,depth:t,index:s.length});e.subHeaders.push(a),s.push(e)}o.headers.push(a),a.headerGroup=o}for(let e=0;e<a.length;e++)a[e](o);i.push(o),t>0&&ao(s,t-1,n,r,i,a)}function oo(e){for(let t=0;t<e.length;t++){let n=e[t];if(!Q(n.column,`getIsVisible`,$))continue;let r=0;if(n.subHeaders.length){oo(n.subHeaders);for(let e=0;e<n.subHeaders.length;e++){let t=n.subHeaders[e];Q(t.column,`getIsVisible`,$)&&(r+=t.colSpan)}}else r=1;if(n.colSpan=r,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let e=1,t=n.subHeaders[0];for(;t;)t.rowSpan=0,e++,t=t.subHeaders.length===1&&t.subHeaders[0].column===n.column?t.subHeaders[0]:void 0;n.rowSpan=e}else n.rowSpan=1}}function so(e,t,n,r){let i=to(e),a=[],o=n._headerGroupInstanceInitFns,s=Array(t.length);for(let e=0;e<t.length;e++)e in t&&(s[e]=za(n,t[e],{depth:i,index:e}));return ao(s,i-1,n,r,a,o),a.reverse(),oo(a[0]?.headers??[]),a}function co(e){if(!e._columnPrototype){e._columnPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignColumnPrototype?.(e._columnPrototype,e)}return e._columnPrototype}function lo(e,t,n,r){let i={...e.getDefaultColumnDef(),...t},a=i.accessorKey,o=a===void 0?void 0:String(a),s=i.id??o?.replaceAll(`.`,`_`)??(typeof i.header==`string`?i.header:void 0),c;if(i.accessorFn)c=i.accessorFn;else if(a!==void 0){if(typeof a==`string`&&a.includes(`.`)){let e=a.split(`.`);c=t=>{let n=t;for(let t=0;t<e.length;t++){let r=e[t];n=n?.[r]}return n}}else c=e=>e[i.accessorKey]}if(!s)throw Error();let l=co(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;e<d.length;e++)d[e](u);return u}function uo(e){let t=e.atoms.columnOrder?.get();return n=>{let r=[];if(!t?.length)r=n;else{let e=new Map;for(let t=0;t<n.length;t++){let r=n[t];e.set(r.id,r)}for(let n=0;n<t.length;n++){let i=t[n],a=e.get(i);a&&(r.push(a),e.delete(i))}for(let t=0;t<n.length;t++){let i=n[t];e.has(i.id)&&r.push(i)}}return fo(e,r)}}function fo(e,t){let n=e.atoms.grouping?.get()??[],{groupedColumnMode:r}=e.options;if(!n.length||!r)return t;let i=t.filter(e=>!n.includes(e.id));if(r===`remove`)return i;let a=new Map;for(let e=0;e<t.length;e++){let n=t[e];a.set(n.id,n)}let o=[];for(let e=0;e<n.length;e++){let t=a.get(n[e]);t&&o.push(t)}return[...o,...i]}function po(e){return[e,...e.columns.flatMap(e=>e.getFlatColumns())]}function mo(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return Q(e.table,`getOrderColumns`,uo)(t)}return[e]}function ho(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function go(e,t,n,r=0){let i=Array(t.length);for(let a=0;a<t.length;a++){if(!(a in t))continue;let o=t[a],s=lo(e,o,r,n),c=o;s.columns=c.columns?go(e,c.columns,s,r+1):[],i[a]=s}return i}function _o(e){return go(e,e.options.columns)}function vo(e){return e.getAllColumns().flatMap(e=>e.getFlatColumns())}function yo(e){let t=Y(),n=e.getAllFlatColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function bo(e){let t=e.getAllColumns().flatMap(e=>e.getLeafColumns());return Q(e,`getOrderColumns`,uo)(t)}function xo(e){let t=Y(),n=e.getAllLeafColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function So(e,t){return e.getAllFlatColumnsById()[t]}var Co={assignColumnPrototype:(e,t)=>{Z(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>po(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>mo(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{X(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>ho(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>_o(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>vo(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>yo(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>bo(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>xo(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>So(e,t)}})}};function wo(e,t){for(let n=0;n<e.subHeaders.length;n++)wo(e.subHeaders[n],t);t.push(e)}function To(e){let t=[];return wo(e,t),t}function Eo(e){return{column:e.column,header:e,table:e.column.table}}function Do(e){let{start:t,end:n}=e.atoms.columnPinning?.get()??Ba(),r=e.getAllColumns(),i=Q(e,`getVisibleLeafColumns`,Ja);if(!t.length&&!n.length)return so(r,i,e);let a=e.getAllLeafColumnsById(),o=[];for(let e=0;e<t.length;e++){let n=a[t[e]];n&&Q(n,`getIsVisible`,$)&&o.push(n)}let s=[];for(let e=0;e<n.length;e++){let t=a[n[e]];t&&Q(t,`getIsVisible`,$)&&s.push(t)}let c=i.filter(e=>!t.includes(e.id)&&!n.includes(e.id));return so(r,[...o,...c,...s],e)}function Oo(e){return[...e.getHeaderGroups()].reverse()}function ko(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Ao(e){let t=e.getHeaderGroups()[0]?.headers??[],n=[];for(let e=0;e<t.length;e++){let r=t[e].getLeafHeaders();for(let e=0;e<r.length;e++)n.push(r[e])}return n}var jo={assignHeaderPrototype:(e,t)=>{Z(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>To(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>Eo(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{X(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>Do(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>Oo(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>ko(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>Ao(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function Mo(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignRowPrototype?.(e._rowPrototype,e)}return e._rowPrototype}var No=(e,t,n,r,i,a,o)=>{let s=Mo(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=Y(),c._valuesCache=Y(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;e<l.length;e++)l[e](c);return c},Po=/([0-9]+)/gm;function Fo(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r),o=t.resolveDataValue;return o&&(i=o(i),a=o(a)),t.sort(i,a,e,n,r)},e);return t}Fo({resolveDataValue:e=>zo(e).toLowerCase(),sort:(e,t)=>Bo(e,t)}),Fo({resolveDataValue:e=>zo(e),sort:(e,t)=>Bo(e,t)}),Fo({resolveDataValue:e=>zo(e).toLowerCase(),sort:(e,t)=>Lo(e,t)}),Fo({resolveDataValue:e=>zo(e),sort:(e,t)=>Lo(e,t)}),Fo({resolveDataValue:e=>Ro(e),sort:(e,t)=>e>t?1:e<t?-1:0});var Io=Fo({sort:(e,t)=>Lo(e,t)});function Lo(e,t){return e===t?0:e>t?1:-1}function Ro(e){return e instanceof Date?e.getTime():e}function zo(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function Bo(e,t){let n=0,r=0,i=e.length,a=t.length;for(;n<i&&r<a;){let i=Vo(e.charCodeAt(n)),a=Vo(t.charCodeAt(r)),o=Ho(e,n,i),s=Ho(t,r,a);if(!i&&!a){let i=Uo(e,n,o,t,r,s);if(i)return i;n=o,r=s;continue}if(i!==a)return i?1:-1;let c=Wo(e,n,o,t,r,s);if(c)return c;n=o,r=s}return Ko(e,n)-Ko(t,r)}function Vo(e){return e>=48&&e<=57}function Ho(e,t,n){let r=t+1;for(;r<e.length&&Vo(e.charCodeAt(r))===n;)r++;return r}function Uo(e,t,n,r,i,a){let o=n-t,s=a-i,c=o<s?o:s;for(let n=0;n<c;n++){let a=e.charCodeAt(t+n),o=r.charCodeAt(i+n);if(a>o)return 1;if(o>a)return-1}return o>s?1:s>o?-1:0}function Wo(e,t,n,r,i,a){let o=t;for(;o<n&&e.charCodeAt(o)===48;)o++;let s=i;for(;s<a&&r.charCodeAt(s)===48;)s++;let c=n-o,l=a-s;if(c===0&&l===0)return 0;if(c<=15&&l<=15){let t=Go(e,o,n),i=Go(r,s,a);return t>i?1:i>t?-1:0}let u=parseInt(e.slice(t,n),10),d=parseInt(r.slice(i,a),10);return u>d?1:d>u?-1:0}function Go(e,t,n){let r=0;for(let i=t;i<n;i++)r=r*10+e.charCodeAt(i)-48;return r}function Ko(e,t){let n=0,r=t;for(;r<e.length;)n++,r=Ho(e,r,Vo(e.charCodeAt(r)));return n}function qo(){return[]}function Jo(e,t){Da(e,`cellSelection`,t?qo():J(e.initialState.cellSelection)??qo())}function Yo(e){e.atoms.cellSelection&&(e.options.autoResetAll??e.options.autoResetCellSelection??!0)&&e._reactivity.schedule(()=>Jo(e))}function Xo(e){e.atoms.expanded&&(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding)&&e._reactivity.schedule(()=>Zo(e))}function Zo(e,t){let n=e.initialState.expanded;Da(e,`expanded`,t?Y():n===!0||Object.assign(Y(),J(n??{})))}function Qo(e){let t=e.table.atoms.expanded?.get()??{};return!!(e.table.options.getIsRowExpanded?.(e)??(t===!0||$o(t,e.id)))}function $o(e,t){return!!(e&&e!==!0&&ba(e,t)&&e[t])}var es=0,ts=10;function ns(){return{pageIndex:es,pageSize:ts}}function rs(e){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if((e.atoms.pagination?.get()?.pageIndex??es)===es)return;ss(e,!0)}}function is(e,t){Da(e,`pagination`,t)}function as(e,t){is(e,t?ns():J(e.initialState.pagination??ns()))}function os(e,t){is(e,n=>{let r=va(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})}function ss(e,t){os(e,t?es:e.initialState.pagination?.pageIndex??es)}function cs(e,t){ls(e,t?ts:e.initialState.pagination?.pageSize??ts)}function ls(e,t){is(e,e=>{let n=Math.max(1,va(t,e.pageSize)),r=e.pageSize===1/0?0:e.pageSize*e.pageIndex,i=n===1/0?0:Math.floor(r/n);return{...e,pageIndex:i,pageSize:n}})}function us(e){let t=vs(e),n=[];return t&&t>0&&(n=[...Array(t)].fill(null).map((e,t)=>t)),n}function ds(e){return(e.atoms.pagination?.get()?.pageIndex??0)>0}function fs(e){let t=e.atoms.pagination?.get()?.pageIndex??es,n=vs(e);return n===-1||n!==0&&t<n-1}function ps(e){let t=e.atoms.pagination?.get()?.pageIndex??es,n=vs(e);return Number.isFinite(n)&&n>0&&t<n-1}function ms(e){return os(e,e=>e-1)}function hs(e){return os(e,e=>e+1)}function gs(e){return os(e,0)}function _s(e){let t=vs(e);if(!(!Number.isFinite(t)||t<=0))return os(e,t-1)}function vs(e){let t=e.options.pageCount;if(t!=null)return t;let n=ys(e),r=e.atoms.pagination?.get()?.pageSize??ts;return r===1/0&&Number.isFinite(n)&&n>0?1:Math.ceil(n/r)}function ys(e){return e.options.rowCount??e.getPrePaginatedRowModel().rows.length}function bs(){return[]}function xs(e,t){Da(e,`sorting`,t)}function Ss(e,t){xs(e,t?[]:J(e.initialState.sorting??[]))}function Cs(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&Ss(e)}function ws(e){let t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10),r,i=!1;for(let t=0;t<n.length;t++){let a=n[t].getValue(e.id);if(Object.prototype.toString.call(a)===`[object Date]`){r=`datetime`;break}if(typeof a==`string`&&(i=!0,a.split(Po).length>1)){r=`alphanumeric`;break}}if(!r&&i&&(r=`text`),r){let e=t?.[r];if(e||r===`alphanumeric`&&(e=t?.text),e)return e}return Io}function Ts(e){let t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<t.length;n++){let r=t[n].getValue(e.id);if(r!=null)return typeof r==`string`?`asc`:`desc`}return`desc`}function Es(e){let t=e.table._rowModelFns.sortFns;return Oa(e.columnDef.sortFn)?e.columnDef.sortFn:e.columnDef.sortFn===`auto`?ws(e):t?.[e.columnDef.sortFn]??Io}function Ds(e,t,n){let r=ks(e,n&&js(e)),i=t!==void 0;xs(e.table,a=>{let o=a.findIndex(t=>t.id===e.id),s=o===-1?void 0:a[o],c=[],l,u=i?t:r===`desc`,d=!!(a.length&&js(e)&&n);return l=d?s?`toggle`:`add`:s?`toggle`:`replace`,l===`toggle`&&(i||r||(l=`remove`)),l===`add`?(c=[...a,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??2**53-1))):c=l===`toggle`?d?a.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:l===`remove`?d?a.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function Os(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??Ts(e)===`desc`?`desc`:`asc`}function ks(e,t){let n=Os(e),r=Ms(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r===`desc`?`asc`:`desc`:n}function As(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function js(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function Ms(e){let t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return t?t.desc?`desc`:`asc`:!1}function Ns(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function Ps(e){xs(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}function Fs(e){let t=As(e);return n=>{t&&Ds(e,void 0,js(e)?e.table.options.isMultiSortEvent?.(n):!1)}}function Is(){return e=>Ma({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>Rs(e,e.options.data),onAfterUpdate:ja(()=>{Xo(e),rs(e),Cs(e),Yo(e)})})}function Ls(e,t,n,r=0,i){let a=[];for(let o=0;o<n.length;o++){let s=n[o],c=No(e,e.getRowId(s,o,i),s,o,r,void 0,i?.id);t.flatRows.push(c),t.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(s,o),c.originalSubRows?.length&&(c.subRows=Ls(e,t,c.originalSubRows,r+1,c)))}return a}function Rs(e,t){let n={rows:[],flatRows:[],rowsById:Y()};return n.rows=Ls(e,n,t),n}function zs(e){return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=e.options.features.coreRowModel?.(e)??Is()(e)),e._rowModels.coreRowModel()}function Bs(e){return e.getCoreRowModel()}function Vs(e){return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=e.options.features.filteredRowModel?.(e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function Hs(e){return e.getFilteredRowModel()}function Us(e){return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=e.options.features.groupedRowModel?.(e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function Ws(e){return e.getGroupedRowModel()}function Gs(e){return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=e.options.features.sortedRowModel?.(e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function Ks(e){return e.getSortedRowModel()}function qs(e){return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=e.options.features.expandedRowModel?.(e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function Js(e){return e.getExpandedRowModel()}function Ys(e){return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=e.options.features.paginatedRowModel?.(e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function Xs(e){return e.getPaginatedRowModel()}var Zs={constructTableAPIs:e=>{X(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>zs(e)},table_getPreFilteredRowModel:{fn:()=>Bs(e)},table_getFilteredRowModel:{fn:()=>Vs(e)},table_getPreGroupedRowModel:{fn:()=>Hs(e)},table_getGroupedRowModel:{fn:()=>Us(e)},table_getPreSortedRowModel:{fn:()=>Ws(e)},table_getSortedRowModel:{fn:()=>Gs(e)},table_getPreExpandedRowModel:{fn:()=>Ks(e)},table_getExpandedRowModel:{fn:()=>qs(e)},table_getPrePaginatedRowModel:{fn:()=>Js(e)},table_getPaginatedRowModel:{fn:()=>Ys(e)},table_getRowModel:{fn:()=>Xs(e)}})}};function Qs(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignCellPrototype?.(e._cellPrototype,e)}return e._cellPrototype}function $s(e,t,n){let r=Qs(n),i=Object.create(r);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;let a=n._cellInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function ec(e){let t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}function tc(e){let t=e.getPrePaginatedRowModel().rows;if(e.options.paginateExpandedRows===!1){let e=[],n=t=>{t._displayIndexCache=e.length,e.push(t),t.subRows.length&&t.getIsExpanded?.()&&t.subRows.forEach(n)};return t.forEach(n),e}for(let e=0;e<t.length;e++)t[e]._displayIndexCache=e;return t}function nc(e,t){if(ba(e._valuesCache,t))return e._valuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]}function rc(e,t){if(ba(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function ic(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function ac(e){return ka(e.subRows,e=>e.subRows)}function oc(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e<t.length;e++)n=Math.max(n,t[e].depth);return n}function sc(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function cc(e){let t=[],n=e;for(;;){let e=n.getParentRow();if(!e)break;t.push(e),n=e}return t.reverse()}function lc(e){let t=e.table.getAllLeafColumns(),n=e._cellsCache;n||=e._cellsCache=new WeakMap;let r=Array(t.length);for(let i=0;i<t.length;i++){let a=t[i],o=n.get(a);o||(o=$s(a,e,e.table),n.set(a,o)),r[i]=o}return r}function uc(e){let t=Y(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];t[r.column.id]=r}return t}function dc(e,t,n,r){return t.options.getRowId?.(e,n,r)??(r?`${r.id}.${n}`:String(n))}function fc(e,t,n){let r=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!r&&(r=e.getCoreRowModel().rowsById[t],!r))throw Error();return r}var pc={assignRowPrototype:(e,t)=>{Z(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>ec(e)},row_getAllCellsByColumnId:{fn:e=>uc(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>lc(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>ac(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>sc(e)},row_getParentRows:{fn:e=>cc(e)},row_getUniqueValues:{fn:(e,t)=>rc(e,t)},row_getValue:{fn:(e,t)=>nc(e,t)},row_renderValue:{fn:(e,t)=>ic(e,t)}})},constructTableAPIs:e=>{X(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>tc(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>dc(t,e,n,r)},table_getRow:{fn:(t,n)=>fc(e,t,n)},table_getMaxSubRowDepth:{fn:()=>oc(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function mc(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function hc(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{mc(e,t,n),e._reactivity.commit?.()})}function gc(e){let t=J(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r];e.baseAtoms[i].set(t[i])}});let n=Object.values(e._features);for(let t=0;t<n.length;t++)n[t].resetTableInstanceData?.(e)}function _c(e,t){let{features:n,atoms:r,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:r,initialState:i};let a=e.options.mergeOptions(e.options,t),o={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...o,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:r,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function vc(e,t,n){let r=_c(e,va(t,e.options));e.optionsStore?e.optionsStore.set(()=>r):e.options=r,n?.syncExternalState!==!1&&hc(e,r.state??null)}var yc={coreCellsFeature:La,coreColumnsFeature:Co,coreHeadersFeature:jo,coreRowModelsFeature:Zs,coreRowsFeature:pc,coreTablesFeature:{constructTableAPIs:e=>{X(`coreTablesFeature`,e,{table_reset:{fn:()=>gc(e)},table_setOptions:{fn:t=>vc(e,t)}})}}};function bc(e){return e}function xc(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),J(t)}function Sc(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:c,filterFns:l,filterMeta:u,filteredRowModel:d,groupedRowModel:f,paginatedRowModel:p,sortFns:m,sortedRowModel:h,tableMeta:g,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...yc,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:l,sortFns:m},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=xc(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e<x.length;e++){let n=x[e];v.baseAtoms[n]=t.createWritableAtom(v.initialState[n],{debugName:`table/baseAtoms/${n}`}),v.atoms[n]=t.createReadonlyAtom(()=>{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&ba(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}mc(v),v.store=ma(t.createReadonlyAtom(()=>{let e={};for(let t=0;t<x.length;t++){let n=x[t];e[n]=v.atoms[n].get()}return e},{compare:ca,debugName:`table/store`}));for(let e=0;e<y.length;e++){let t=y[e];t.initTableInstanceData?.(v),t.initCellInstanceData&&v._cellInstanceInitFns.push(t.initCellInstanceData.bind(t)),t.initColumnInstanceData&&v._columnInstanceInitFns.push(t.initColumnInstanceData.bind(t)),t.initHeaderGroupInstanceData&&v._headerGroupInstanceInitFns.push(t.initHeaderGroupInstanceData.bind(t)),t.initHeaderInstanceData&&v._headerInstanceInitFns.push(t.initHeaderInstanceData.bind(t)),t.initRowInstanceData&&v._rowInstanceInitFns.push(t.initRowInstanceData.bind(t)),t.constructTableAPIs?.(v)}return v}var Cc={getInitialState:e=>({columnVisibility:Va(),...e}),getDefaultTableOptions:e=>({onColumnVisibilityChange:xa(`columnVisibility`,e)}),assignColumnPrototype:(e,t)=>{Z(`columnVisibilityFeature`,e,t,{column_getIsVisible:{fn:e=>$(e),memoDeps:e=>[t.options.columns,t.atoms.columnVisibility?.get(),e.columns]},column_getCanHide:{fn:e=>Ua(e)},column_getToggleVisibilityHandler:{fn:e=>Wa(e)},column_toggleVisibility:{fn:(e,t)=>Ha(e,t)}})},assignRowPrototype:(e,t)=>{Z(`columnVisibilityFeature`,e,t,{row_getVisibleCells:{fn:e=>Ga(e),memoDeps:e=>[e.getAllCells(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get()]},row_getVisibleCellsByColumnId:{fn:e=>Ka(e),memoDeps:e=>[e.getAllCells(),t.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{X(`columnVisibilityFeature`,e,{table_getVisibleFlatColumns:{fn:()=>qa(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getVisibleLeafColumns:{fn:()=>Ja(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_setColumnVisibility:{fn:t=>Ya(e,t)},table_resetColumnVisibility:{fn:t=>Xa(e,t)},table_toggleAllColumnsVisible:{fn:t=>Za(e,t)},table_getIsAllColumnsVisible:{fn:()=>Qa(e)},table_getIsSomeColumnsVisible:{fn:()=>$a(e)},table_getToggleAllColumnsVisibilityHandler:{fn:()=>eo(e)}})}},wc={getInitialState:e=>({...e,pagination:{...ns(),...e.pagination}}),getDefaultTableOptions:e=>({onPaginationChange:xa(`pagination`,e)}),constructTableAPIs:e=>{X(`rowPaginationFeature`,e,{table_autoResetPageIndex:{fn:()=>rs(e)},table_setPagination:{fn:t=>is(e,t)},table_resetPagination:{fn:t=>as(e,t)},table_setPageIndex:{fn:t=>os(e,t)},table_resetPageIndex:{fn:t=>ss(e,t)},table_setPageSize:{fn:t=>ls(e,t)},table_getPageCount:{fn:()=>vs(e)},table_resetPageSize:{fn:t=>cs(e,t)},table_getPageOptions:{fn:()=>us(e)},table_getCanPreviousPage:{fn:()=>ds(e)},table_getCanNextPage:{fn:()=>fs(e)},table_getCanLastPage:{fn:()=>ps(e)},table_previousPage:{fn:()=>ms(e)},table_nextPage:{fn:()=>hs(e)},table_firstPage:{fn:()=>gs(e)},table_lastPage:{fn:()=>_s(e)},table_getRowCount:{fn:()=>ys(e)}})}},Tc={getInitialState(e){return{sorting:bs(),...e}},getDefaultColumnDef(){return{sortFn:`auto`,sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:xa(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}},assignColumnPrototype(e,t){Z(`rowSortingFeature`,e,t,{column_getAutoSortFn:{fn:e=>ws(e)},column_getAutoSortDir:{fn:e=>Ts(e)},column_getSortFn:{fn:e=>Es(e)},column_toggleSorting:{fn:(e,t,n)=>Ds(e,t,n)},column_getFirstSortDir:{fn:e=>Os(e)},column_getNextSortingOrder:{fn:(e,t)=>ks(e,t)},column_getCanSort:{fn:e=>As(e)},column_getCanMultiSort:{fn:e=>js(e)},column_getIsSorted:{fn:e=>Ms(e)},column_getSortIndex:{fn:e=>Ns(e)},column_clearSorting:{fn:e=>Ps(e)},column_getToggleSortingHandler:{fn:e=>Fs(e)}})},constructTableAPIs(e){X(`rowSortingFeature`,e,{table_setSorting:{fn:t=>xs(e,t)},table_resetSorting:{fn:t=>Ss(e,t)}})}};function Ec(e){let t=[],n=e=>{t.push(e),e.subRows.length&&Qo(e)&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Dc(){return e=>{let t=e;return Ma({feature:`rowPaginationFeature`,table:t,fnName:`table.getPaginatedRowModel`,memoDeps:()=>[t.getPrePaginatedRowModel(),t.atoms.pagination?.get(),t.options.paginateExpandedRows?void 0:t.atoms.expanded?.get()],fn:()=>Oc(t)})}}function Oc(e){let t=e.getPrePaginatedRowModel(),n=e.atoms.pagination?.get();if(!t.rows.length)return t;let{pageSize:r,pageIndex:i}=n??ns(),{rows:a,flatRows:o,rowsById:s}=t,c=a;if(r!==1/0||i!==0){let e=r*i,t=e+r;c=a.slice(e,t)}let l;l=e.options.paginateExpandedRows?{rows:c,flatRows:o,rowsById:s}:Ec({rows:c,flatRows:o,rowsById:s}),l.flatRows=[];let u=new Set,d=e=>{u.has(e.id)||(u.add(e.id),l.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d))};return l.rows.forEach(d),l}function kc(){return e=>{let t=e;return Ma({feature:`rowSortingFeature`,table:t,fnName:`table.getSortedRowModel`,memoDeps:()=>[t.atoms.sorting?.get(),t.getPreSortedRowModel()],fn:()=>Ac(t),onAfterUpdate:ja(()=>rs(t))})}}function Ac(e){let t=e.getPreSortedRowModel(),n=e.atoms.sorting?.get();if(!t.rows.length||!n?.length)return t;let r=[],i=n.filter(t=>{let n=e.getColumn(t.id);return n?As(n):!1});if(!i.length)return t;let a=[];for(let t=0;t<i.length;t++){let n=i[t],r=e.getColumn(n.id);r&&a.push({id:n.id,desc:n.desc,sortUndefined:r.columnDef.sortUndefined,invertSorting:r.columnDef.invertSorting,sortFn:Es(r)})}let o=(e,t)=>{for(let n=0;n<a.length;n++){let r=a[n],i=r.sortUndefined,o=r.desc,s=0;if(i){let n=e.getValue(r.id),a=t.getValue(r.id),o=n===void 0,c=a===void 0;if(o&&c)continue;if(o||c){if(i===`first`)return o?-1:1;if(i===`last`)return o?1:-1;s=o?i:-i}}if(s===0&&(s=r.sortFn(e,t,r.id)),s!==0)return o&&(s*=-1),r.invertSorting&&(s*=-1),s}return e.index-t.index},s=e=>{let t=e.slice();t.sort(o);let n=!1;for(let i=0;i<t.length;i++){let a=t[i];a!==e[i]&&(n=!0);let o=r.length;if(r.push(a),a.subRows.length){let e=s(a.subRows);if(e.changed){let s=Object.create(Object.getPrototypeOf(a));ya(s,a),s.subRows=e.rows,t[i]=s,r[o]=s,n=!0}}}return{rows:t,changed:n}};return{rows:s(t.rows).rows,flatRows:r,rowsById:t.rowsById}}var jc=typeof window>`u`?H.useEffect:H.useLayoutEffect;function Mc(e,t){let[{table:n,rootSource:r}]=(0,H.useState)(()=>{let t=Sc({...e,features:{coreReactivityFeature:_a(),...e.features}});return t.Subscribe=(e=>pa({...e,source:e.source??t.store})),t.FlexRender=Wi,{table:t,rootSource:ga(t.store,ca)}}),i=n;vc(i,t=>({...t,...e}),{syncExternalState:!1});let a=i.options.state,o=r.get(),s=fa(r,t,{compare:ca});return jc(()=>{r.markCommitted(o),hc(i,a??null,ca)}),(0,H.useMemo)(()=>({...n,options:e,state:s}),[n,e,s])}var Nc=bc({columnVisibilityFeature:Cc,rowSortingFeature:Tc,rowPaginationFeature:wc,sortedRowModel:kc(),paginatedRowModel:Dc()}),Pc=10,Fc=10,Ic=new Set([`duration`,`taskCount`,`shuffleRead`,`fetchWait`,`gcPct`,`skew`,`spill`,`findingCount`]);function Lc(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function Rc(e){return e<=0?(0,W.jsx)(W.Fragment,{children:`0`}):(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[e,` `,(0,W.jsx)(ye,{label:`RETRY`,impactBand:`critical`})]})}function zc(e,t,n){if(e<=0)return(0,W.jsx)(W.Fragment,{children:`—`});let r=k(e);if(t<=0)return(0,W.jsx)(W.Fragment,{children:r});let i=e/t;return i>.3?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[r,` `,(0,W.jsx)(ye,{label:n===`advanced`?`${Math.round(i*100)}%`:`High`,impactBand:`critical`})]}):i>.15?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[r,` `,(0,W.jsx)(ye,{label:n===`advanced`?`${Math.round(i*100)}%`:`Elevated`,impactBand:`info`})]}):(0,W.jsx)(W.Fragment,{children:r})}function Bc(e,t){if(!e||e<=0||!t||t<=0)return(0,W.jsx)(W.Fragment,{children:`—`});let n=t/e,r=n<.01?`${n.toExponential(1)}×`:`${n.toFixed(2)}×`;return n>2||n<.1?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[r,` `,(0,W.jsx)(ye,{label:`extreme`,impactBand:`info`})]}):(0,W.jsx)(W.Fragment,{children:r})}function Vc(e,t){if(e<=0)return(0,W.jsx)(W.Fragment,{children:`—`});let n=t??`unclassified`;return(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[O(e),` `,(0,W.jsx)(ye,{label:ne[n],impactBand:`warning`,title:re[n]})]})}function Hc(e,t){return!e||e<=0?0:(t??0)/e}function Uc(e){let t=new Map;for(let n of e)t.has(n.type)||t.set(n.type,[]),t.get(n.type).push(n);return[...t.values()].map(e=>{let t=we(e);return e.find(e=>e.impactBand===t)??e[0]})}function Wc({appModel:e,catalog:t,getTaskData:n,onRoute:r}){let{openStage:i}=Dt(),a=j(),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)([]),[f,p]=(0,H.useState)({pageIndex:0,pageSize:Pc}),{catalogByStage:m,flaggedStageIds:h}=(0,H.useMemo)(()=>{let e=new Map,n=new Set;for(let r of t)r.stageId!=null&&(n.add(r.stageId),e.has(r.stageId)||e.set(r.stageId,[]),e.get(r.stageId).push(r));return{catalogByStage:e,flaggedStageIds:n}},[t]),g=(0,H.useMemo)(()=>{let t=[...e.stages.values()],n=o?t.filter(e=>h.has(e.id)):[...t].sort((e,t)=>(t.completedAt??0)-(t.submittedAt??0)-((e.completedAt??0)-(e.submittedAt??0))).slice(0,Fc),r=c.trim().toLowerCase();return(r?n.filter(e=>(e.name??``).toLowerCase().includes(r)||String(e.id).includes(r)):n).map(e=>({stage:e,tags:Uc(m.get(e.id)??[])}))},[e.stages,o,h,m,c]),_=A(),v=(0,H.useMemo)(()=>{if(!r)return null;let e=new Map;for(let n of t){let r=wr(n,t);r&&e.set(n,r)}return e},[t,r]),y=(0,H.useMemo)(()=>[{id:`id`,header:`Stage`,accessorFn:e=>e.stage.id,cell:({getValue:e})=>{let t=e();return(0,W.jsx)(`button`,{type:`button`,"aria-label":`Open Stage ${t} details`,className:`inline-flex cursor-pointer items-center rounded-sm hover:underline underline-offset-2 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,onClick:e=>{e.stopPropagation(),i(t)},children:(0,W.jsx)(`strong`,{children:t})})}},{id:`name`,header:`Operation`,accessorFn:e=>e.stage.name??``,cell:({row:e})=>{let t=e.original.stage.id;return(0,W.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-1.5`,children:[Lc(e.original.stage.name??``,40),e.original.tags.map((e,n)=>{let i=v?v.get(e)??null:null,a=i&&r?{target:i,onRoute:r}:null,o=Te(_,e)?.compact??null;return(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[a?(0,W.jsx)(`button`,{type:`button`,"aria-label":`Investigate ${a.target.findingLabel} in Stage ${t}`,title:`Investigate ${a.target.findingLabel} in Stage ${t}`,className:`inline-flex cursor-pointer items-center rounded-full hover:underline underline-offset-2 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,onClick:e=>{e.stopPropagation(),a.onRoute(a.target)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},children:(0,W.jsx)(ue,{type:e.type,impactBand:e.impactBand,plainBadge:!0})}):(0,W.jsx)(ue,{type:e.type,impactBand:e.impactBand}),o?(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o}):null]},n)})]})}},{id:`type`,header:`Type`,accessorFn:e=>e.stage.stageType??``,cell:({row:e})=>(0,W.jsx)(w,{variant:`outline`,children:e.original.stage.stageType??`—`})},{id:`duration`,header:`Duration`,accessorFn:e=>(e.stage.completedAt??0)-(e.stage.submittedAt??0),cell:({getValue:e})=>(0,W.jsx)(W.Fragment,{children:k(e())})},{id:`taskCount`,header:`Tasks`,accessorFn:e=>e.stage.taskCount},{id:`retried`,header:`Retried`,accessorFn:e=>e.stage.failedTasks??0,cell:({getValue:e})=>Rc(e())},{id:`shuffleRead`,header:`Shuffle Read`,accessorFn:e=>e.stage.shuffleReadBytes??0,cell:({getValue:e})=>(0,W.jsx)(W.Fragment,{children:O(e())})},{id:`fetchWait`,header:`Fetch Wait`,accessorFn:e=>e.stage.fetchWaitTime??0,cell:({row:e})=>zc(e.original.stage.fetchWaitTime??0,e.original.stage.executorRunTime??0,a)},...a===`advanced`?[{id:`ioRatio`,header:`I/O Ratio`,accessorFn:e=>e.stage.inputBytes?(e.stage.outputBytes??0)/e.stage.inputBytes:0,cell:({row:e})=>Bc(e.original.stage.inputBytes??0,e.original.stage.outputBytes??0)}]:[],{id:`spill`,header:`Spill (mem)`,accessorFn:e=>e.stage.memoryBytesSpilled??0,cell:({row:e})=>Vc(e.original.stage.memoryBytesSpilled??0,e.original.stage.spillClassification)},...a===`advanced`?[{id:`gcPct`,header:`GC%`,accessorFn:e=>e.stage.gcPct??0,cell:({getValue:e})=>(0,W.jsxs)(W.Fragment,{children:[e().toFixed(1),`%`]})},{id:`skew`,header:`Skew P95/median`,accessorFn:e=>Hc(e.stage.taskDurationP50,e.stage.taskDurationP95),cell:({getValue:e})=>{let t=e();return(0,W.jsx)(W.Fragment,{children:t>0?`${t.toFixed(1)}×`:`—`})}}]:[],{id:`findingCount`,header:`Findings`,accessorFn:e=>e.tags.length,cell:({getValue:e})=>{let t=e();return(0,W.jsx)(W.Fragment,{children:t>0?t:`—`})}}],[t,r,v,i,a,_]),b=Mc({features:Nc,data:g,columns:y,state:{sorting:u,pagination:f},sortDescFirst:!1,onSortingChange:d,onPaginationChange:p});function x(){s(e=>!e),d([]),p({pageIndex:0,pageSize:Pc})}let S=(0,H.useRef)(null),[C,ee]=(0,H.useState)(!0);(0,H.useLayoutEffect)(()=>{let e=S.current?.querySelector(`[data-slot="table-container"]`);if(!e?.firstElementChild||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>ee(e.scrollWidth>e.clientWidth));return t.observe(e),t.observe(e.firstElementChild),()=>t.disconnect()},[]);let te=e=>e===`asc`?` ▲`:e===`desc`?` ▼`:``,ne=e=>e===`asc`?`ascending`:e===`desc`?`descending`:`none`;return(0,W.jsx)(I,{title:`Stage Summary`,children:(0,W.jsxs)(`div`,{ref:S,className:`space-y-3`,children:[(0,W.jsx)(je,{type:`text`,value:c,onChange:e=>{l(e.target.value),p(e=>({...e,pageIndex:0}))},placeholder:`Filter by stage name or ID…`,"aria-label":`Filter by stage name or ID`,className:`max-w-xs`}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`p`,{className:D(`text-muted-foreground text-xs`,!C&&`invisible`),children:`Scroll sideways to see all columns →`}),(0,W.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,onClick:x,children:o?`Top ${Fc} by duration`:`Problems only`})]}),(0,W.jsxs)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:[`Showing `,g.length,` stage`,g.length===1?``:`s`,`: `,` `,o?`problems only`:`top ${Fc} by duration`,`.`]}),(0,W.jsxs)(ft,{children:[(0,W.jsx)(dt,{children:b.getHeaderGroups().map(e=>(0,W.jsx)(z,{children:e.headers.map(e=>{let t=e.column.getIsSorted(),n=e.column.getToggleSortingHandler();return(0,W.jsxs)(ut,{scope:`col`,tabIndex:e.column.getCanSort()?0:void 0,"aria-sort":ne(t),className:D(e.column.getCanSort()&&`tap-target-comfortable cursor-pointer select-none`,Ic.has(e.column.id)&&`text-right`),onClick:n,onKeyDown:e=>{n&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n(e))},children:[Ui(e.column.columnDef.header,e.getContext()),te(t)]},e.id)})},e.id))}),(0,W.jsx)(pt,{children:b.getRowModel().rows.length===0?(0,W.jsx)(z,{children:(0,W.jsx)(R,{colSpan:y.length,className:`text-muted-foreground`,children:(0,W.jsxs)(`span`,{className:`flex items-center justify-center gap-2 py-2`,children:[(0,W.jsx)(It,{"aria-hidden":`true`,className:`size-4 shrink-0`}),`No stages to show.`]})})}):b.getRowModel().rows.map(e=>(0,W.jsx)(z,{className:`cursor-pointer`,onClick:()=>i(e.original.stage.id),children:e.getVisibleCells().map(e=>(0,W.jsx)(R,{className:Ic.has(e.column.id)?`text-right`:void 0,children:Ui(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]}),b.getPageCount()>1?(0,W.jsxs)(`div`,{className:`flex items-center justify-end gap-2 text-xs`,children:[(0,W.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`tap-target-comfortable`,onClick:()=>b.previousPage(),disabled:!b.getCanPreviousPage(),children:`Previous`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Page `,f.pageIndex+1,` of `,b.getPageCount()]}),(0,W.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`tap-target-comfortable`,onClick:()=>b.nextPage(),disabled:!b.getCanNextPage(),children:`Next`})]}):null]})})}var Gc=20,Kc=24,qc=40,Jc=200,Yc=640;function Xc(e,t=Gc){let n=[...e].filter(e=>e.submittedAt&&e.completedAt),r=n.length;return r<=t?{stages:n.sort((e,t)=>e.submittedAt-t.submittedAt),total:r,capped:!1}:{stages:[...n].sort((e,t)=>t.completedAt-t.submittedAt-(e.completedAt-e.submittedAt)).slice(0,t).sort((e,t)=>e.submittedAt-t.submittedAt),total:r,capped:!0}}function Zc({appModel:e,catalog:t}){let{openStage:n}=Dt(),r=[...e.stages.values()].filter(e=>e.submittedAt&&e.completedAt),i=r.length,o=r.reduce((e,t)=>Math.min(e,t.submittedAt),1/0),s=e.app?.startTime??(Number.isFinite(o)?o:0),d=new Set(t.filter(e=>e.stageId!=null).map(e=>e.stageId)),p=j(),[h,_]=(0,H.useState)(()=>p===`advanced`?i:Gc),{stages:v}=Xc(r,h),y=Qn(v).map(e=>({stageId:e.id,label:`Stage ${e.id}`,wait:e.submittedAt-s,duration:e.completedAt-e.submittedAt,flagged:d.has(e.id)})),b=Math.min(Yc,Math.max(Jc,y.length*Kc+qc)),x=b-qc,S=Math.max(1,Math.floor(x/Kc)),C=Math.max(1,Math.ceil(y.length/S));return(0,W.jsx)(I,{title:`Job Timeline`,summary:i>0?(0,W.jsx)(G,{value:`${i} stage${i===1?``:`s`}`,context:`${d.size} flagged`}):void 0,children:i===0?(0,W.jsx)(Cn,{tone:`neutral`,icon:It,title:`No stages in this run.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`label`,{htmlFor:`timeline-topn`,children:`showing top`}),(0,W.jsx)(`input`,{id:`timeline-topn`,type:`number`,min:1,max:i,value:Math.min(h,i),onChange:e=>{let t=parseInt(e.target.value,10);Number.isFinite(t)||(t=h),_(Math.max(1,Math.min(i,t)))},className:`w-16 rounded border border-input bg-transparent px-1 py-0.5`,"aria-label":`Number of stages to show`}),(0,W.jsxs)(`span`,{children:[`of `,i,` by duration · flagged in red`]})]}),(0,W.jsx)(F,{ariaLabel:`Job timeline: stage durations by time from app start.`,height:b,table:{caption:`Job timeline: stage durations by time from app start`,columns:[`Stage`,`Start`,`Duration`],rows:y.map(e=>[e.label,k(e.wait),k(e.duration)]),align:[`left`,`right`,`right`]},children:(0,W.jsxs)(l,{data:y,layout:`vertical`,children:[(0,W.jsx)(c,{stroke:P.muted,strokeOpacity:.2,horizontal:!1}),(0,W.jsx)(m,{type:`number`,tickFormatter:e=>`${Math.round(e/1e3)}s`,tick:{fontSize:10},tickCount:10}),(0,W.jsx)(f,{type:`category`,dataKey:`label`,tick:{fontSize:10},width:64,interval:0,tickFormatter:(e,t)=>t%C===0?e:``}),(0,W.jsx)(g,{formatter:(e,t)=>t===`Duration`?k(Number(e)):[null,null]}),(0,W.jsx)(u,{dataKey:`wait`,stackId:`timeline`,fill:`transparent`,name:`Wait`}),(0,W.jsx)(u,{dataKey:`duration`,stackId:`timeline`,name:`Duration`,cursor:`pointer`,onClick:e=>n(e.payload.stageId),children:y.map(e=>(0,W.jsx)(a,{fill:e.flagged?P.critical:P.accent,stroke:e.flagged?P.critical:`none`,strokeWidth:e.flagged?2:0},e.stageId))})]})})]})})}var Qc={present:`present`,disabled:`disabled`,notEmitted:`not emitted`,notApplicable:`not applicable`,outsideEventLog:`outside event log`,unknown:`unknown`},$c={present:`info`,disabled:`warning`,notEmitted:`warning`,notApplicable:`muted`,outsideEventLog:`muted`,unknown:`muted`},el=new Set([`noRddStorageSnapshot`,`noUsableCoreTimeAggregate`,`parseIncomplete`]);function tl({entry:e}){let t=e.evidence?.count,n=Ye(),r=`${e.summary}${t==null?``:` · ${t} observed`}`,i=el.has(e.reasonCode)?r:t==null?null:`${t} observed`,{tooltipProps:a,srOnlyTooltip:o}=Ke(r);return(0,W.jsxs)(`li`,{id:`evidence-availability-${e.key}`,tabIndex:-1,ref:t=>n(e.key,t),className:`flex flex-col gap-0.5 rounded-md px-2 py-1 outline-none focus:ring-2 focus:ring-ring`,...a,children:[(0,W.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(Ce,{impactBand:$c[e.state]}),(0,W.jsx)(`span`,{className:`truncate text-sm font-medium`,children:Xe(e.key)})]}),(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:Qc[e.state]}),o]}),i?(0,W.jsx)(M,{children:(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i})}):null]})}function nl(e){return Object.keys(Qc).map(t=>[t,e.filter(e=>e.state===t).length]).filter(([,e])=>e>0).map(([e,t])=>`${t} ${Qc[e]}`).join(` · `)}function rl({ledger:e}){let{evidenceCardOpen:t,setEvidenceCardOpen:n}=Ae();return(0,W.jsx)(I,{title:`Evidence availability`,open:t,onOpenChange:n,summary:(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e?nl(e.entries):`Unavailable for this restored run`}),children:e?(0,W.jsx)(`ul`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 sm:grid-cols-2`,"aria-label":`Evidence availability ledger`,children:e.entries.map(e=>(0,W.jsx)(tl,{entry:e},e.key))}):(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Evidence availability is unavailable for this restored run.`})})}var il=64;function al(e,t){return t>=1?e:`color-mix(in srgb, ${e} ${t*100}%, transparent)`}function ol(e){return[{key:`startup`,label:`Startup`,value:e.startup,color:P.info,fillOpacity:1},{key:`stagesActive`,label:`Stages active`,value:e.stagesActive,color:P.clean,fillOpacity:1},{key:`gaps`,label:`Scheduler gaps`,value:e.gaps,color:P.warning,fillOpacity:1},{key:`idle`,label:`Idle`,value:e.idle,color:P.muted,fillOpacity:.6}].filter(e=>e.value>0).map(e=>({...e,legendColor:al(e.color,e.fillOpacity)}))}var sl=(0,H.memo)(function(){let e=A()?.data.wallClock;if(!e||e.total<=0)return null;let n=ol(e),r=t=>e.total>0?t/e.total*100:0,a=n.reduce((e,t)=>t.value>e.value?t:e,n[0]),o=[n.reduce((e,t)=>({...e,[t.key]:t.value}),{name:`total`})];return(0,W.jsxs)(I,{title:`Wall-Clock Breakdown`,badges:(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[k(e.total),` total`]}),summary:(0,W.jsx)(G,{value:`${a.label} ${Math.round(r(a.value))}%`,context:`of ${k(e.total)} total`}),children:[(0,W.jsx)(F,{ariaLabel:`Wall-clock breakdown: ${k(e.total)} total, split across startup, active stages, scheduler gaps and idle time. See the table below for exact values.`,height:il,table:{caption:`Wall-clock time breakdown`,columns:[`Segment`,`Duration`,`% of total`],rows:n.map(e=>[e.label,k(e.value),`${Math.round(r(e.value))}%`]),align:[`left`,`right`,`right`]},children:(0,W.jsxs)(l,{data:o,layout:`vertical`,stackOffset:`expand`,margin:{top:0,right:0,bottom:0,left:0},children:[(0,W.jsx)(m,{type:`number`,hide:!0,domain:[0,1]}),(0,W.jsx)(f,{type:`category`,dataKey:`name`,hide:!0}),(0,W.jsx)(g,{shared:!1,labelFormatter:()=>``,formatter:(e,t)=>[k(Number(e)),t]}),(0,W.jsx)(i,{wrapperStyle:{fontSize:12},itemSorter:e=>n.findIndex(t=>t.key===e.dataKey),formatter:(e,t)=>{let r=n.find(e=>e.key===t.dataKey);return(0,W.jsx)(`span`,{style:{color:r?.color},children:e})},content:e=>(0,W.jsx)(t,{...e,payload:e.payload?.map(e=>{let t=n.find(t=>t.key===e.dataKey);return t?{...e,color:t.legendColor}:e})})}),n.map(e=>(0,W.jsx)(u,{dataKey:e.key,name:e.label,stackId:`wallclock`,fill:e.color,fillOpacity:e.fillOpacity},e.key))]})}),(0,W.jsx)(M,{children:(0,W.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-3 text-xs text-muted-foreground`,children:n.map(e=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`inline-block size-2.5 rounded-sm`,style:{backgroundColor:e.color,opacity:e.fillOpacity}}),e.label,` (`,k(e.value),`)`]},e.key))})})]})}),cl=[`[data-testid="next-step"] [data-shortcut-target]`,`[data-testid="fix-these-first-row"] button[data-shortcut-target]`,`[data-testid="fix-these-first-group-row"] button[data-shortcut-target]`].join(`, `);function ll(e){if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)return!0;let t=e.target,n=t?.tagName;return n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable||t?.closest?.(`[role="listbox"], [role="combobox"]`)?!0:[...document.querySelectorAll(`[role="dialog"], [role="menu"], [role="alertdialog"], [role="listbox"]`)].some(e=>!e.closest(`[hidden]`)&&e.getClientRects().length>0)}function ul(){return[...document.querySelectorAll(cl)].filter(e=>e.offsetParent!==null||e.getClientRects().length>0)}function dl(e){let t=ul();if(t.length===0)return null;let n=t.indexOf(document.activeElement),r=t[n===-1?e===1?0:t.length-1:Math.min(t.length-1,Math.max(0,n+e))],i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;return r.focus({preventScroll:!0}),r.scrollIntoView?.({block:`nearest`,behavior:i?`auto`:`smooth`}),r}function fl({enabled:e,showFindings:t,showFullReport:n}){(0,H.useEffect)(()=>{if(!e)return;function r(e){if(!ll(e))switch(e.key){case`j`:case`k`:{let n=e.key===`j`?1:-1;e.preventDefault(),t(),requestAnimationFrame(()=>dl(n));return}case`f`:{let t=document.querySelector(`[aria-label="Filter findings"] button`);if(!t)return;e.preventDefault(),t.focus();return}case`1`:t(),e.preventDefault();return;case`2`:n(),e.preventDefault();return}}return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,t,n])}function pl({appModel:e,catalog:t,configFindings:n,getTaskData:r,activeFileId:i,onRoute:a}){return(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsx)(`h2`,{className:`sr-only`,children:`Full app report`}),(0,W.jsx)(sl,{}),(0,W.jsx)(Zc,{appModel:e,catalog:t}),(0,W.jsx)(lr,{appModel:e,activeFileId:i}),(0,W.jsx)(Wc,{appModel:e,catalog:t,getTaskData:r,onRoute:a}),(0,W.jsxs)(gt,{children:[xn().map(({component:a,widgetId:o})=>(0,W.jsx)(L,{cardId:`reference-${o}`,widgetId:o,collapsedTile:!0,children:(0,W.jsx)(H.Suspense,{fallback:(0,W.jsx)(Et,{}),children:(0,W.jsx)(a,{appModel:e,catalog:t,configFindings:n,getTaskData:r,activeFileId:i,defaultCollapsed:!0})})},o)),(0,W.jsx)(L,{cardId:`reference-evidence-availability`,collapsedTile:!0,children:(0,W.jsx)(rl,{ledger:e.evidenceAvailability})}),(0,W.jsx)(L,{cardId:`reference-etl-phases`,collapsedTile:!0,children:(0,W.jsx)(ar,{})}),(0,W.jsx)(L,{cardId:`reference-scaling-sim`,collapsedTile:!0,children:(0,W.jsx)(Sr,{appModel:e})}),(0,W.jsx)(L,{cardId:`reference-efficiency-model`,collapsedTile:!0,children:(0,W.jsx)(rr,{})}),(0,W.jsx)(L,{cardId:`reference-core-usage-histogram`,collapsedTile:!0,children:(0,W.jsx)(tr,{appModel:e,getTaskData:r})})]})]})}function ml(e,t,n){let r=e.map(e=>e===`impactBands`?`${[...t.impactBands].join(`, `)} impact`:e===`types`?[...t.types].map(e=>yt(e)).join(`, `):[...t.stages].map(e=>`Stage ${e}`).join(`, `));return`Cleared the ${r.join(` and `)} filter${r.length===1?``:`s`} to show ${n}.`}function hl({appModel:e,catalog:t,configFindings:n,getTaskData:r,activeFileId:i,options:a,onRoute:o,activeTab:s,onActiveTabChange:c,renderTopbar:l}){let{selection:u,replaceSelection:d}=Ln(),f=j(),p=A(),[m,h]=(0,H.useState)(null),g=(0,H.useCallback)((e,t)=>{let n=kn(e,u);if(n.length===0)return;let r={...u};for(let e of n)Object.assign(r,{[e]:Tn()[e]});d(r),h({text:ml(n,u,t),selection:r})},[u,d]),_=(0,H.useCallback)(e=>{bn(e.finding.type)||g(e.finding,`this finding`),o(e)},[g,o]),v=(0,H.useCallback)(e=>{let t=pe(p).filter(t=>t.impactBand===e).reduce((e,t)=>!e||kn(t,u).length<kn(e,u).length?t:e,null);t&&g(t,`the ${e} findings`),c(`findings`),requestAnimationFrame(()=>{let t=document.getElementById(`impact-band-${e}-heading`);if(!t)return;let n=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;t.scrollIntoView?.({block:`start`,behavior:n?`auto`:`smooth`}),t.focus({preventScroll:!0})})},[p,u,g,c]),y=(0,H.useMemo)(()=>On(t,u),[t,u]),b=(0,H.useMemo)(()=>On(n??[],u),[n,u]),x=y.length+b.length,S=t.length+(n??[]).length>0&&x===0,C=f===`advanced`||!En(u);return(0,W.jsxs)(W.Fragment,{children:[l(v),(0,W.jsxs)(`main`,{className:`flex-1 space-y-6 p-4`,children:[(0,W.jsx)(Pr,{}),p?(0,W.jsx)(Nr,{interpretation:p,onRoute:_}):null,p?(0,W.jsx)(Vr,{interpretation:p.data,catalog:y}):null,C&&(0,W.jsx)(Kn,{options:a,resultCount:x}),C&&m?.selection===u?(0,W.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:m.text}):null,S&&(0,W.jsx)(Rn,{}),!S&&(0,W.jsxs)(Ie,{value:s,onValueChange:e=>c(e),children:[(0,W.jsxs)(ze,{variant:`chrome`,"aria-label":`Report view`,children:[(0,W.jsx)(Pe,{value:`findings`,className:`tap-target-comfortable`,children:`Findings`}),(0,W.jsx)(Pe,{value:`full-report`,className:`tap-target-comfortable`,children:`Full app report`})]}),(0,W.jsxs)(Le,{value:`findings`,keepMounted:!0,children:[(0,W.jsx)(`h2`,{className:`sr-only`,children:`Findings`}),(0,W.jsx)(xi,{appModel:e,catalog:y,configFindings:b,stages:e.stages,getTaskData:r,activeFileId:i,onRoute:o})]}),(0,W.jsx)(Le,{value:`full-report`,keepMounted:!0,children:(0,W.jsx)(pl,{appModel:e,catalog:y,getTaskData:r,configFindings:b,activeFileId:i,onRoute:o})})]}),(0,W.jsx)(zi,{appModel:e,catalog:t,getTaskData:r,onRoute:_})]})]})}function gl(){let{resetToDropZone:e,startLoad:t,getTaskData:n,compareWithAnotherRun:r}=_t(),i=N(e=>e.appModel),a=N(e=>e.catalog),o=N(e=>e.activeFileId),s=N(e=>e.exportMode),{recentEntries:c,onPickRecent:l,onRemoveRecent:u}=nt(o),[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(`findings`),h=j(),g=(0,H.useCallback)(()=>m(`findings`),[]),_=(0,H.useCallback)(()=>m(`full-report`),[]);fl({enabled:h===`advanced`,showFindings:g,showFullReport:_});let{revealRequest:v}=Ae(),[y,b]=(0,H.useState)(null),[x,S]=(0,H.useState)(null),[C,ee]=(0,H.useState)(null),te=(0,H.useRef)(0),w=(0,H.useRef)(null),ne=(0,H.useRef)(null),re=(0,H.useRef)(new Map),ie=(0,H.useRef)(new Map),T=(0,H.useRef)(null),ae=y?.target??null;(0,H.useEffect)(()=>()=>{T.current&&clearTimeout(T.current)},[]),(0,H.useLayoutEffect)(()=>{v>0&&m(`full-report`)},[v]);let E=(0,H.useCallback)(e=>{w.current?.token===e&&(w.current=null,ne.current=null,b(t=>t?.token===e?null:t))},[]),D=(0,H.useCallback)(e=>{if(w.current?.token!==e.token)return null;let{catalog:t,configFindings:n,activeFileId:r}=Ee.getState();if(ne.current!==r)return null;let i=wr(e.target.finding,[...t,...n]);return!i||i.widgetId!==e.target.widgetId||i.region!==e.target.region?null:i},[]),oe=(0,H.useCallback)(e=>{m(bn(e.finding.type)?`full-report`:`findings`);let t=te.current+1;te.current=t;let{catalog:n,configFindings:r,activeFileId:i}=Ee.getState(),a=wr(e.finding,[...n,...r]);if(!a||a.widgetId!==e.widgetId||a.region!==e.region){w.current=null,ne.current=null,b(null);return}let o={target:a,token:t};w.current=o,ne.current=i,b(o)},[]),O=(0,H.useCallback)((e,t)=>{re.current.set(e,t);let n=w.current;return n?.target.widgetId===e&&D(n)&&t.open(),()=>{re.current.get(e)===t&&re.current.delete(e)}},[D]),k=(0,H.useCallback)((e,t)=>(ie.current.set(e,t),()=>{ie.current.get(e)===t&&ie.current.delete(e)}),[]),se=(0,H.useCallback)((e,t)=>{if(!t)return;let n=w.current;if(!n||n.target.widgetId!==e)return;let r=D(n);if(!r){E(n.token);return}let i=re.current.get(e);if(!i)return;let a=i.getDisclosureButton();if(!a){E(n.token);return}let o=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,s=ie.current.get(r.finding);s?(s.scrollIntoView({behavior:o?`auto`:`smooth`,block:`center`,inline:`nearest`}),s.focus({preventScroll:!0}),T.current&&clearTimeout(T.current),ee(r.finding),T.current=setTimeout(()=>{T.current=null,ee(null)},2e3)):(i.wrapperElement.scrollIntoView({behavior:o?`auto`:`smooth`,block:`start`,inline:`nearest`}),a.focus({preventScroll:!0}),S(e)),E(n.token)},[E,D]),ce=(0,H.useCallback)(e=>{S(t=>t===e?null:t)},[]);(0,H.useLayoutEffect)(()=>{if(!y)return;let e=D(y);if(!e){E(y.token);return}re.current.get(e.widgetId)?.open()},[E,D,y]),(0,H.useLayoutEffect)(()=>{let e=w.current;e&&!D(e)&&E(e.token)},[o,a,E,D]);let le=N(e=>e.configFindings),A=(0,H.useMemo)(()=>An(a,le),[a,le]);return(0,W.jsxs)(`div`,{"data-testid":`dashboard`,className:`relative flex min-h-screen flex-col`,style:{paddingRight:`var(--docs-inset, 0px)`},onDragOver:e=>{s||(e.preventDefault(),f(!0))},onDragLeave:()=>f(!1),onDrop:e=>{if(s)return;e.preventDefault(),f(!1);let n=e.dataTransfer.files[0];n&&t(n)},children:[(0,W.jsx)(`button`,{type:`button`,className:`sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50 focus:rounded-md focus:bg-background focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow focus:ring-2 focus:ring-ring`,onClick:()=>{let e=document.getElementById(`run-verdict`);e?.scrollIntoView?.({block:`start`}),e?.focus({preventScroll:!0})},children:`Skip to the verdict`}),(0,W.jsx)(In,{options:A,fileId:o,children:(0,W.jsx)(ct,{registerWidget:O,registerFindingAnchor:k,reportWidgetOpen:se,clearRouteFocus:ce,focusedWidgetId:x,activeRouteTarget:ae,flashedFinding:C,children:(0,W.jsx)(hl,{appModel:i,catalog:a,configFindings:le,getTaskData:n,activeFileId:o,options:A,onRoute:oe,activeTab:p,onActiveTabChange:m,renderTopbar:t=>(0,W.jsx)(Ze,{onJumpToFindings:t,onLoadNew:e,onCompare:r,recentEntries:c,activeFileId:o,onPickRecent:l,onRemoveRecent:u})})})}),d&&(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 z-50 flex items-center justify-center bg-background/80`,children:(0,W.jsx)(`p`,{className:`rounded-lg border-2 border-dashed border-primary px-6 py-4 text-lg font-medium`,children:`Drop to load a new event log`})})]})}function _l(){return(0,W.jsx)(Re,{children:(0,W.jsx)(gl,{})})}export{_l as Dashboard,ii as a,Qn as c,Hn as d,Cn as f,ti as i,Zn as l,Ei as n,G as o,It as p,ai as r,$n as s,Di as t,Vn as u};
|