sparkforensics-server 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/package.json +1 -1
  2. package/public/assets/{AutoscalingChurn-B96FKx97.js → AutoscalingChurn-Bf5TN-s_.js} +1 -1
  3. package/public/assets/CacheUtilization-DRf_FNrK.js +1 -0
  4. package/public/assets/CachingOpportunity-BTJzIhtI.js +1 -0
  5. package/public/assets/{ColdStart-w8QYTNKo.js → ColdStart-DnFgnD3n.js} +1 -1
  6. package/public/assets/ConfigAudit-B5FsOdmu.js +1 -0
  7. package/public/assets/{CoreUsageArea-o3kqQwyi.js → CoreUsageArea-CTksBPuq.js} +1 -1
  8. package/public/assets/Dashboard-BFMsMuc_.js +1 -0
  9. package/public/assets/{DuplicatePlanSubtree-Cm_UU3lY.js → DuplicatePlanSubtree-BCt-Guuh.js} +1 -1
  10. package/public/assets/{DurationHistogram-ltF-7M0A.js → DurationHistogram-xRcnND4k.js} +1 -1
  11. package/public/assets/{EmptyState-BCA3xioa.js → EmptyState-CnTrSjtU.js} +1 -1
  12. package/public/assets/{ExecutorUtilization-Cn69i0uq.js → ExecutorUtilization-CP21XlUq.js} +1 -1
  13. package/public/assets/GcPressure-BoEJsLjb.js +1 -0
  14. package/public/assets/{ImpactEstimate-BGt-4WX5.js → ImpactEstimate-BHcqJkcZ.js} +1 -1
  15. package/public/assets/{IncompleteRun-s6uQ8OLf.js → IncompleteRun-b9FWrOHn.js} +1 -1
  16. package/public/assets/{JobFailures-DJ2dDvPA.js → JobFailures-C5FkTq3O.js} +1 -1
  17. package/public/assets/{MemoryUtilization-C9G7P94X.js → MemoryUtilization-D2W4AB_f.js} +1 -1
  18. package/public/assets/{OverBroadcast-DYauoYWQ.js → OverBroadcast-Btu3xorf.js} +1 -1
  19. package/public/assets/PartitionSizing-yZWhLN0e.js +1 -0
  20. package/public/assets/{PlanExplorer-_2oB5ouy.js → PlanExplorer-DSk1ivS4.js} +1 -1
  21. package/public/assets/PlanGraphRoute-C3iOzUdB.js +1 -0
  22. package/public/assets/{RetryWaste-D_m8ASwP.js → RetryWaste-B4436kr1.js} +1 -1
  23. package/public/assets/{RowPagination-BLsm8I6i.js → RowPagination-oeWB8gBm.js} +1 -1
  24. package/public/assets/ShuffleIO-DUiv8EJe.js +1 -0
  25. package/public/assets/{Skew-BGLJuZZR.js → Skew-D2lB1oQc.js} +1 -1
  26. package/public/assets/{SlowHost-ChdWVvGO.js → SlowHost-Qb_8aa-W.js} +1 -1
  27. package/public/assets/{SmallFiles-gTilBtjW.js → SmallFiles-u6suTgfj.js} +1 -1
  28. package/public/assets/{SpeculationWaste-CVzgJnSj.js → SpeculationWaste-vUCniiFP.js} +1 -1
  29. package/public/assets/{Spill-NGJGQaTB.js → Spill-BskXFX2e.js} +1 -1
  30. package/public/assets/{StageFailed-sGhki53z.js → StageFailed-D9b83Jvy.js} +1 -1
  31. package/public/assets/{StageFindingGroup-AyI7BMd3.js → StageFindingGroup-DagqHOUz.js} +1 -1
  32. package/public/assets/{StageHeader-BTzGkK8k.js → StageHeader-DibMSunO.js} +1 -1
  33. package/public/assets/{StagePill-BlMOW_pU.js → StagePill-Dt6V9yVw.js} +1 -1
  34. package/public/assets/{StageShape-DfOW93Z1.js → StageShape-CfdrDUZa.js} +1 -1
  35. package/public/assets/{StageSlowness-BMZ-K_5e.js → StageSlowness-BoGLIYKR.js} +1 -1
  36. package/public/assets/Straggler-DU1WSU-m.js +1 -0
  37. package/public/assets/{TaskFailures-DGDwUK2A.js → TaskFailures-DkY6zBNJ.js} +1 -1
  38. package/public/assets/{TinyTask-CfT8zZDr.js → TinyTask-Lsnt5mJF.js} +1 -1
  39. package/public/assets/{UnderBroadcast-CiOiJ0k1.js → UnderBroadcast-DxHc0lwy.js} +1 -1
  40. package/public/assets/{finding-anchor-DEV8JvgH.js → finding-anchor-Bl1hRK5E.js} +1 -1
  41. package/public/assets/{inbox-_QCYkBsP.js → inbox-DHIFHqcn.js} +1 -1
  42. package/public/assets/index-U654cmB8.js +9 -0
  43. package/public/assets/parser-worker-5a9aUx3o.js +115 -0
  44. package/public/assets/{select-kuy1MiAo.js → select-CtKaJ5Hx.js} +1 -1
  45. package/public/assets/{toggle-group-CUd-KWkp.js → toggle-group-DB2VfFIx.js} +1 -1
  46. package/public/assets/useRecentFiles-BiYdWs8J.js +11 -0
  47. package/public/assets/{useSortMode-BaeAA5cw.js → useSortMode-BhPky1lW.js} +1 -1
  48. package/public/docs/404.html +2 -2
  49. package/public/docs/assets/{app.APoq_UBs.js → app.BczRxXPr.js} +1 -1
  50. package/public/docs/assets/chunks/@localSearchIndexroot.c2HfrwDg.js +1 -0
  51. package/public/docs/assets/chunks/{VPLocalSearchBox.B3TPzlHq.js → VPLocalSearchBox.DXvkTVnC.js} +1 -1
  52. package/public/docs/assets/chunks/{theme.PavXO_vz.js → theme.ByUdwrLG.js} +2 -2
  53. package/public/docs/assets/contributor-guide_architecture_board-widgets.md.9ToZXcTk.js +1 -0
  54. package/public/docs/assets/{contributor-guide_architecture_board-widgets.md.CWpj01WU.lean.js → contributor-guide_architecture_board-widgets.md.9ToZXcTk.lean.js} +1 -1
  55. package/public/docs/assets/contributor-guide_architecture_detector-contract.md.B1vUqtry.js +1 -0
  56. package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.CgzUsQ6W.lean.js → contributor-guide_architecture_detector-contract.md.B1vUqtry.lean.js} +1 -1
  57. package/public/docs/assets/{contributor-guide_architecture_drill-down.md.BtPdlM7r.js → contributor-guide_architecture_drill-down.md.Bawx6NgP.js} +1 -1
  58. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DHVq1UPt.js +1 -0
  59. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DHVq1UPt.lean.js +1 -0
  60. package/public/docs/assets/{contributor-guide_architecture_overview.md.CehiRmGn.js → contributor-guide_architecture_overview.md.DkXdJ9jE.js} +1 -1
  61. package/public/docs/assets/contributor-guide_architecture_overview.md.DkXdJ9jE.lean.js +1 -0
  62. package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.DYwFeyjV.js +1 -0
  63. package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.IbnfNrV3.js → contributor-guide_architecture_worker-protocol.md.C0SovZX8.js} +2 -2
  64. package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.IbnfNrV3.lean.js → contributor-guide_architecture_worker-protocol.md.C0SovZX8.lean.js} +1 -1
  65. package/public/docs/assets/{contributor-guide_development-setup.md.DvAN_9mK.js → contributor-guide_development-setup.md.DvMV1xhQ.js} +3 -3
  66. package/public/docs/assets/contributor-guide_development-setup.md.DvMV1xhQ.lean.js +1 -0
  67. package/public/docs/assets/{contributor-guide_testing.md.6rIKqSyY.js → contributor-guide_testing.md.BohuQWvl.js} +1 -1
  68. package/public/docs/assets/{contributor-guide_testing.md.6rIKqSyY.lean.js → contributor-guide_testing.md.BohuQWvl.lean.js} +1 -1
  69. package/public/docs/assets/{tuning-reference_bottleneck-failures.md.4z5BXGJ2.js → tuning-reference_bottleneck-failures.md.CAsFf3RR.js} +1 -1
  70. package/public/docs/assets/{tuning-reference_bottleneck-gc.md.DSxzZRK7.js → tuning-reference_bottleneck-gc.md.B4T3kJYV.js} +2 -2
  71. package/public/docs/assets/{tuning-reference_bottleneck-gc.md.DSxzZRK7.lean.js → tuning-reference_bottleneck-gc.md.B4T3kJYV.lean.js} +1 -1
  72. package/public/docs/assets/tuning-reference_bottleneck-shuffle.md.DDMQVOW6.js +12 -0
  73. package/public/docs/assets/{tuning-reference_bottleneck-shuffle.md.CM-nTmIH.lean.js → tuning-reference_bottleneck-shuffle.md.DDMQVOW6.lean.js} +1 -1
  74. package/public/docs/assets/{tuning-reference_bottleneck-skew.md.BdUwiDhn.js → tuning-reference_bottleneck-skew.md.B0MzhWcX.js} +4 -4
  75. package/public/docs/assets/{tuning-reference_bottleneck-skew.md.BdUwiDhn.lean.js → tuning-reference_bottleneck-skew.md.B0MzhWcX.lean.js} +1 -1
  76. package/public/docs/assets/{tuning-reference_bottleneck-small-files.md.B8kloyx8.js → tuning-reference_bottleneck-small-files.md.DHGMTmPs.js} +2 -2
  77. package/public/docs/assets/{tuning-reference_bottleneck-small-files.md.B8kloyx8.lean.js → tuning-reference_bottleneck-small-files.md.DHGMTmPs.lean.js} +1 -1
  78. package/public/docs/assets/{tuning-reference_bottleneck-straggler.md.DY36fHN5.js → tuning-reference_bottleneck-straggler.md.DIbXdAcQ.js} +2 -2
  79. package/public/docs/assets/{tuning-reference_bottleneck-straggler.md.DY36fHN5.lean.js → tuning-reference_bottleneck-straggler.md.DIbXdAcQ.lean.js} +1 -1
  80. package/public/docs/assets/{tuning-reference_bottleneck-tiny-tasks.md.QTV7O8kU.js → tuning-reference_bottleneck-tiny-tasks.md.CB05v3zh.js} +1 -1
  81. package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DqC_iGkw.js +5 -0
  82. package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DqC_iGkw.lean.js +1 -0
  83. package/public/docs/assets/{tuning-reference_cluster-config.md.ZVmDGsQ3.js → tuning-reference_cluster-config.md.CD6vzYtD.js} +1 -1
  84. package/public/docs/assets/{tuning-reference_cluster-config.md.ZVmDGsQ3.lean.js → tuning-reference_cluster-config.md.CD6vzYtD.lean.js} +1 -1
  85. package/public/docs/assets/{tuning-reference_memory-model.md.DhT-n4y3.js → tuning-reference_memory-model.md.CWhvgevP.js} +1 -1
  86. package/public/docs/assets/{tuning-reference_memory-model.md.DhT-n4y3.lean.js → tuning-reference_memory-model.md.CWhvgevP.lean.js} +1 -1
  87. package/public/docs/assets/{user-guide_mcp-tools.md.Vi3RoflJ.js → user-guide_mcp-tools.md.DGvolGzt.js} +1 -1
  88. package/public/docs/assets/user-guide_understanding-findings.md.B29f0ucS.js +1 -0
  89. package/public/docs/assets/{user-guide_understanding-findings.md.DL1UDhvR.lean.js → user-guide_understanding-findings.md.B29f0ucS.lean.js} +1 -1
  90. package/public/docs/contributor-guide/architecture/board-widgets.html +5 -5
  91. package/public/docs/contributor-guide/architecture/detector-contract.html +5 -5
  92. package/public/docs/contributor-guide/architecture/drill-down.html +5 -5
  93. package/public/docs/contributor-guide/architecture/impact-estimation.html +5 -5
  94. package/public/docs/contributor-guide/architecture/index.html +3 -3
  95. package/public/docs/contributor-guide/architecture/overview.html +5 -5
  96. package/public/docs/contributor-guide/architecture/state-and-history.html +3 -3
  97. package/public/docs/contributor-guide/architecture/widget-rendering.html +5 -5
  98. package/public/docs/contributor-guide/architecture/worker-protocol.html +6 -6
  99. package/public/docs/contributor-guide/contributing.html +3 -3
  100. package/public/docs/contributor-guide/development-setup.html +5 -5
  101. package/public/docs/contributor-guide/testing.html +5 -5
  102. package/public/docs/hashmap.json +1 -1
  103. package/public/docs/index.html +3 -3
  104. package/public/docs/tuning-reference/anti-patterns.html +3 -3
  105. package/public/docs/tuning-reference/aqe.html +3 -3
  106. package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +3 -3
  107. package/public/docs/tuning-reference/bottleneck-cold-start.html +3 -3
  108. package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +3 -3
  109. package/public/docs/tuning-reference/bottleneck-failures.html +5 -5
  110. package/public/docs/tuning-reference/bottleneck-gc.html +5 -5
  111. package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +3 -3
  112. package/public/docs/tuning-reference/bottleneck-memory-utilization.html +3 -3
  113. package/public/docs/tuning-reference/bottleneck-retry-waste.html +3 -3
  114. package/public/docs/tuning-reference/bottleneck-shuffle.html +6 -6
  115. package/public/docs/tuning-reference/bottleneck-skew.html +7 -7
  116. package/public/docs/tuning-reference/bottleneck-slow-host.html +3 -3
  117. package/public/docs/tuning-reference/bottleneck-small-files.html +6 -6
  118. package/public/docs/tuning-reference/bottleneck-spill.html +3 -3
  119. package/public/docs/tuning-reference/bottleneck-straggler.html +5 -5
  120. package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +5 -5
  121. package/public/docs/tuning-reference/bottleneck-utilization.html +6 -6
  122. package/public/docs/tuning-reference/caching.html +3 -3
  123. package/public/docs/tuning-reference/cluster-config.html +5 -5
  124. package/public/docs/tuning-reference/config.html +3 -3
  125. package/public/docs/tuning-reference/data-formats.html +3 -3
  126. package/public/docs/tuning-reference/index.html +3 -3
  127. package/public/docs/tuning-reference/intro.html +3 -3
  128. package/public/docs/tuning-reference/joins.html +3 -3
  129. package/public/docs/tuning-reference/memory-model.html +5 -5
  130. package/public/docs/tuning-reference/metrics.html +3 -3
  131. package/public/docs/tuning-reference/partitioning.html +3 -3
  132. package/public/docs/tuning-reference/pyspark.html +3 -3
  133. package/public/docs/tuning-reference/shuffle.html +3 -3
  134. package/public/docs/tuning-reference/spark-architecture.html +3 -3
  135. package/public/docs/tuning-reference/table-formats.html +3 -3
  136. package/public/docs/user-guide/alternative-log-retrieval.html +3 -3
  137. package/public/docs/user-guide/getting-started.html +3 -3
  138. package/public/docs/user-guide/mcp-tools.html +5 -5
  139. package/public/docs/user-guide/run-comparison.html +3 -3
  140. package/public/docs/user-guide/understanding-findings.html +5 -5
  141. package/public/index.html +1 -1
  142. package/vendor-core/cli/collect-run.js +3 -2
  143. package/vendor-core/cli/native-zstd.js +351 -0
  144. package/vendor-core/detectors.js +243 -53
  145. package/vendor-core/docs-config.js +34 -8
  146. package/vendor-core/docs-content/chapters/03-memory-model.md +39 -0
  147. package/vendor-core/docs-content/chapters/11-cluster-config.md +40 -0
  148. package/vendor-core/docs-content/detection/gc.md +2 -0
  149. package/vendor-core/docs-content/detection/host.md +2 -1
  150. package/vendor-core/docs-content/detection/plan.md +3 -1
  151. package/vendor-core/docs-content/detection/shape.md +2 -1
  152. package/vendor-core/docs-content/detection/shfl.md +2 -1
  153. package/vendor-core/docs-content/detection/spill.md +1 -1
  154. package/vendor-core/docs-content/detection/strag.md +2 -1
  155. package/vendor-core/docs-content/detection/tiny.md +2 -1
  156. package/vendor-core/docs-content/tuning/failures.md +1 -1
  157. package/vendor-core/docs-content/tuning/gc.md +11 -4
  158. package/vendor-core/docs-content/tuning/shuffle.md +25 -5
  159. package/vendor-core/docs-content/tuning/skew.md +14 -6
  160. package/vendor-core/docs-content/tuning/small-files.md +12 -7
  161. package/vendor-core/docs-content/tuning/straggler.md +34 -0
  162. package/vendor-core/docs-content/tuning/tiny-tasks.md +1 -1
  163. package/vendor-core/docs-content/tuning/utilization.md +57 -7
  164. package/vendor-core/docs-content/upstream.json +4 -0
  165. package/vendor-core/event-handlers.js +321 -69
  166. package/vendor-core/event-schemas.js +8 -6
  167. package/vendor-core/evidence-report.js +3 -1
  168. package/vendor-core/impact-estimator.js +150 -34
  169. package/vendor-core/mcp-tools.js +20 -7
  170. package/vendor-core/occupancy.js +70 -2
  171. package/vendor-core/parser-worker.js +28 -12
  172. package/vendor-core/plan-summary.js +4 -0
  173. package/vendor-core/run-comparison.js +1 -15
  174. package/vendor-core/shs-fetch.js +18 -7
  175. package/vendor-core/shs-load.js +2 -1
  176. package/vendor-core/stage-quantiles.js +59 -3
  177. package/vendor-core/string-hash.js +15 -0
  178. package/vendor-core/types.js +9 -1
  179. package/vendor-core/vendor/fzstd.js +94 -18
  180. package/public/assets/CacheUtilization-lKua3J1x.js +0 -1
  181. package/public/assets/CachingOpportunity-U0g-8HPV.js +0 -1
  182. package/public/assets/ConfigAudit-ClZp5BpV.js +0 -1
  183. package/public/assets/Dashboard-Bjl-MYMm.js +0 -1
  184. package/public/assets/GcPressure-CYsmU1d7.js +0 -1
  185. package/public/assets/PartitionSizing-Cz_B0-uG.js +0 -1
  186. package/public/assets/PlanGraphRoute-Cj-GWM8W.js +0 -1
  187. package/public/assets/ShuffleIO-pyDhxdaz.js +0 -1
  188. package/public/assets/Straggler-dffcAN7t.js +0 -1
  189. package/public/assets/index-3vlFVNCg.js +0 -9
  190. package/public/assets/parser-worker-B2bc0lWe.js +0 -112
  191. package/public/assets/useRecentFiles-D0OA_EOK.js +0 -11
  192. package/public/docs/assets/chunks/@localSearchIndexroot.CvM5fuxe.js +0 -1
  193. package/public/docs/assets/contributor-guide_architecture_board-widgets.md.CWpj01WU.js +0 -1
  194. package/public/docs/assets/contributor-guide_architecture_detector-contract.md.CgzUsQ6W.js +0 -1
  195. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.CooslVJt.js +0 -1
  196. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.CooslVJt.lean.js +0 -1
  197. package/public/docs/assets/contributor-guide_architecture_overview.md.CehiRmGn.lean.js +0 -1
  198. package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.R27gQrgY.js +0 -1
  199. package/public/docs/assets/contributor-guide_development-setup.md.DvAN_9mK.lean.js +0 -1
  200. package/public/docs/assets/tuning-reference_bottleneck-shuffle.md.CM-nTmIH.js +0 -12
  201. package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DTiueZC3.js +0 -5
  202. package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DTiueZC3.lean.js +0 -1
  203. package/public/docs/assets/user-guide_understanding-findings.md.DL1UDhvR.js +0 -1
  204. /package/public/docs/assets/{contributor-guide_architecture_drill-down.md.BtPdlM7r.lean.js → contributor-guide_architecture_drill-down.md.Bawx6NgP.lean.js} +0 -0
  205. /package/public/docs/assets/{contributor-guide_architecture_widget-rendering.md.R27gQrgY.lean.js → contributor-guide_architecture_widget-rendering.md.DYwFeyjV.lean.js} +0 -0
  206. /package/public/docs/assets/{tuning-reference_bottleneck-failures.md.4z5BXGJ2.lean.js → tuning-reference_bottleneck-failures.md.CAsFf3RR.lean.js} +0 -0
  207. /package/public/docs/assets/{tuning-reference_bottleneck-tiny-tasks.md.QTV7O8kU.lean.js → tuning-reference_bottleneck-tiny-tasks.md.CB05v3zh.lean.js} +0 -0
  208. /package/public/docs/assets/{user-guide_mcp-tools.md.Vi3RoflJ.lean.js → user-guide_mcp-tools.md.DGvolGzt.lean.js} +0 -0
@@ -1,11 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Skew-BGLJuZZR.js","./rolldown-runtime-hePW80VL.js","./charts-vendor-0VMaLVLN.js","./plan-graph-vendor-B0sEms9Z.js","./plan-graph-vendor-DLioOiRN.css","./index-3vlFVNCg.js","./react-vendor-D2TLlSzI.js","./index-CjVklAdW.css","./StageFindingGroup-AyI7BMd3.js","./DurationHistogram-ltF-7M0A.js","./WidgetLeadSummary-BdUUi7L5.js","./ImpactEstimate-BGt-4WX5.js","./RowPagination-BLsm8I6i.js","./impact-sort-DxaUheWV.js","./finding-anchor-DEV8JvgH.js","./usePagedRows-jNUWgVTD.js","./useSortMode-BaeAA5cw.js","./toggle-group-CUd-KWkp.js","./StageHeader-BTzGkK8k.js","./StagePill-BlMOW_pU.js","./PlanExplorer-_2oB5ouy.js","./StageShape-DfOW93Z1.js","./TinyTask-CfT8zZDr.js","./ShuffleIO-pyDhxdaz.js","./select-kuy1MiAo.js","./PartitionSizing-Cz_B0-uG.js","./Spill-NGJGQaTB.js","./EmptyState-BCA3xioa.js","./downsample-WmNM1qc9.js","./GcPressure-CYsmU1d7.js","./StageFailed-sGhki53z.js","./TaskFailures-DGDwUK2A.js","./RetryWaste-D_m8ASwP.js","./SlowHost-ChdWVvGO.js","./StageSlowness-BMZ-K_5e.js","./Straggler-dffcAN7t.js","./SpeculationWaste-CVzgJnSj.js","./ColdStart-w8QYTNKo.js","./MemoryUtilization-C9G7P94X.js","./ExecutorUtilization-Cn69i0uq.js","./CachingOpportunity-U0g-8HPV.js","./JobFailures-DJ2dDvPA.js","./ConfigAudit-ClZp5BpV.js","./DuplicatePlanSubtree-Cm_UU3lY.js","./SmallFiles-gTilBtjW.js","./UnderBroadcast-CiOiJ0k1.js","./OverBroadcast-DYauoYWQ.js","./CacheUtilization-lKua3J1x.js","./CoreUsageArea-o3kqQwyi.js","./inbox-_QCYkBsP.js","./AutoscalingChurn-B96FKx97.js","./IncompleteRun-s6uQ8OLf.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{E as t,M as n,c as r,d as i,g as a,h as o,l as s,m as c,u as l}from"./charts-vendor-0VMaLVLN.js";import{$ as u,B as d,F as f,G as p,H as m,I as h,J as g,K as _,L as ee,M as v,N as te,P as y,Q as b,R as ne,U as re,V as x,W as S,X as ie,Y as ae,Z as oe,q as se,z as ce}from"./react-vendor-D2TLlSzI.js";import{p as le}from"./plan-graph-vendor-B0sEms9Z.js";import{$ as ue,At as de,B as fe,C as pe,Ct as me,D as he,Dt as ge,F as _e,H as ve,I as ye,It as C,K as be,L as xe,M as Se,Mt as w,N as T,Nt as E,O as Ce,Ot as we,P as Te,Pt as Ee,Q as De,R as Oe,S as ke,St as Ae,Tt as je,U as Me,V as Ne,W as Pe,X as Fe,Y as Ie,Z as Le,_ as Re,at as D,b as ze,bt as Be,et as Ve,f as He,g as Ue,h as We,it as Ge,jt as Ke,k as O,kt as k,lt as qe,m as Je,r as Ye,t as A,tt as Xe,ut as j,v as Ze,vt as Qe,w as $e,x as et,xt as M,y as tt,yt as N,z as nt}from"./index-3vlFVNCg.js";var rt={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};rt.node;var it=k(rt),at={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};at.node;var ot=k(at),st={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};st.node;var ct=k(st),lt={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};lt.node;var ut=k(lt),dt={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};dt.node;var ft=k(dt),pt={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};pt.node;var mt=k(pt),P=e(n(),1),F=le();function ht({className:e,orientation:t=`horizontal`,...n}){return(0,F.jsx)(_,{"data-slot":`tabs`,"data-orientation":t,className:C(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var gt=_e(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none data-[variant=chrome]:w-full data-[variant=chrome]:items-end data-[variant=chrome]:justify-start data-[variant=chrome]:gap-1 data-[variant=chrome]:rounded-none data-[variant=chrome]:border-b data-[variant=chrome]:border-border data-[variant=chrome]:p-0 group-data-horizontal/tabs:data-[variant=chrome]:h-auto`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`,chrome:`bg-transparent`}},defaultVariants:{variant:`default`}});function _t({className:e,variant:t=`default`,...n}){return(0,F.jsx)(re,{"data-slot":`tabs-list`,"data-variant":t,className:C(gt({variant:t}),e),...n})}function I({className:e,...t}){return(0,F.jsx)(p,{"data-slot":`tabs-trigger`,className:C(`relative inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:cursor-default aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,`group-data-[variant=chrome]/tabs-list:h-auto group-data-[variant=chrome]/tabs-list:flex-none group-data-[variant=chrome]/tabs-list:gap-2 group-data-[variant=chrome]/tabs-list:rounded-t-md group-data-[variant=chrome]/tabs-list:rounded-b-none group-data-[variant=chrome]/tabs-list:border-x group-data-[variant=chrome]/tabs-list:border-t group-data-[variant=chrome]/tabs-list:border-transparent group-data-[variant=chrome]/tabs-list:px-4 group-data-[variant=chrome]/tabs-list:py-2 group-data-[variant=chrome]/tabs-list:text-sm group-data-[variant=chrome]/tabs-list:font-semibold group-data-[variant=chrome]/tabs-list:text-muted-foreground group-data-[variant=chrome]/tabs-list:hover:bg-muted/40 group-data-[variant=chrome]/tabs-list:hover:text-foreground`,`group-data-[variant=chrome]/tabs-list:data-active:-mb-px group-data-[variant=chrome]/tabs-list:data-active:border-border group-data-[variant=chrome]/tabs-list:data-active:bg-background group-data-[variant=chrome]/tabs-list:data-active:text-foreground group-data-[variant=chrome]/tabs-list:data-active:shadow-none dark:group-data-[variant=chrome]/tabs-list:data-active:border-border dark:group-data-[variant=chrome]/tabs-list:data-active:bg-background`,`before:absolute before:inset-x-3 before:top-0 before:h-0.5 before:rounded-full before:bg-accent before:opacity-0 before:transition-opacity group-data-[variant=chrome]/tabs-list:data-active:before:opacity-100`,`tap-target-comfortable tap-target-comfortable--sm`,e),...t})}function L({className:e,...t}){return(0,F.jsx)(S,{"data-slot":`tabs-content`,className:C(`flex-1 text-sm outline-none`,e),...t})}function R(e){return e!=null&&(Array.isArray(e)?e.length:e.size)>0}function z(e,t){return Array.isArray(e)?e.includes(t):e.has(t)}function vt(e,t){if(R(t.impactBand)&&!z(t.impactBand,e.impactBand)||R(t.type)&&!z(t.type,e.type))return!1;let{stageId:n}=t;if(typeof n==`number`){if(e.stageId!==n)return!1}else if(R(n)&&(e.stageId==null||!z(n,e.stageId)))return!1;return!0}var yt={executorMetrics:`Executor metrics`,rddStorageSnapshots:`RDD storage snapshots`,sqlPlan:`SQL plan`,sparkConfiguration:`Spark configuration`,taskCoreTime:`Task and core time`,infrastructureContext:`Infrastructure context`,sourceContext:`Source context`,costContext:`Cost context`};function B(e){return yt[e]}var bt={referenceOpen:!1,setReferenceOpen:()=>{},evidenceCardOpen:!0,setEvidenceCardOpen:()=>{},revealEvidence:()=>{},registerRow:()=>{}},xt=(0,P.createContext)(null);function St({children:e}){let[t,n]=(0,P.useState)(!1),[r,i]=(0,P.useState)(!1),a=(0,P.useRef)(null),[o,s]=(0,P.useState)(0),c=(0,P.useRef)(new Map),l=(0,P.useCallback)((e,t)=>{t?c.current.set(e,t):c.current.delete(e)},[]),u=(0,P.useCallback)(e=>{a.current=e,n(!0),i(!0),s(e=>e+1)},[]);(0,P.useLayoutEffect)(()=>{let e=a.current;e&&o!==0&&queueMicrotask(()=>{c.current.get(e)?.focus()})},[o]);let d=(0,P.useMemo)(()=>({referenceOpen:t,setReferenceOpen:n,evidenceCardOpen:r,setEvidenceCardOpen:i,revealEvidence:u,registerRow:l}),[t,r,u,l]);return(0,F.jsx)(xt.Provider,{value:d,children:e})}function Ct(){return(0,P.useContext)(xt)??bt}function wt(){let{revealEvidence:e}=Ct();return{revealEvidence:e}}function Tt(){let{referenceOpen:e,setReferenceOpen:t,evidenceCardOpen:n,setEvidenceCardOpen:r}=Ct();return{referenceOpen:e,setReferenceOpen:t,evidenceCardOpen:n,setEvidenceCardOpen:r}}function Et(){let{registerRow:e}=Ct();return e}function V({...e}){return(0,F.jsx)(h,{"data-slot":`dropdown-menu`,...e})}function H({...e}){return(0,F.jsx)(f,{"data-slot":`dropdown-menu-trigger`,...e})}function U({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,F.jsx)(ne,{children:(0,F.jsx)(ee,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,F.jsx)(ce,{"data-slot":`dropdown-menu-content`,className:C(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none`,i),...a})})})}function W({className:e,inset:t,variant:n=`default`,...r}){return(0,F.jsx)(d,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:C(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function G({className:e,children:t,checked:n,inset:r,...i}){return(0,F.jsxs)(m,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:C(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,F.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,F.jsx)(x,{children:(0,F.jsx)(it,{})})}),t]})}function K({className:e,...t}){return(0,F.jsx)(y,{"data-slot":`dropdown-menu-separator`,className:C(`-mx-1 my-1 h-px bg-border`,e),...t})}function Dt({className:e,type:t,...n}){return(0,F.jsx)(te,{type:t,"data-slot":`input`,className:C(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}var Ot=_e(`group/toggle inline-flex cursor-pointer items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function kt({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,F.jsx)(v,{"data-slot":`toggle`,className:C(Ot({variant:t,size:n,className:e})),...r})}var At={light:``,dark:`.dark`},jt={width:320,height:200},Mt=P.createContext(null);function Nt({id:e,className:n,children:r,config:i,initialDimension:a=jt,...o}){let s=P.useId(),c=`chart-${e??s.replace(/:/g,``)}`;return(0,F.jsx)(Mt.Provider,{value:{config:i},children:(0,F.jsxs)(`div`,{"data-slot":`chart`,"data-chart":c,className:C(`flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,n),...o,children:[(0,F.jsx)(Pt,{id:c,config:i}),(0,F.jsx)(t,{initialDimension:a,children:r})]})})}var Pt=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(At).map(([t,r])=>`
3
- ${r} [data-chart=${e}] {
4
- ${n.map(([e,n])=>{let r=n.theme?.[t]??n.color;return r?` --color-${e}: ${r};`:null}).join(`
5
- `)}
6
- }
7
- `).join(`
8
- `)}}):null};async function Ft(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t);try{if(t.select(),!document.execCommand(`copy`))throw Error(`copy unavailable`)}finally{t.remove()}}var It=`(prefers-reduced-motion: reduce)`;function Lt(e){if(typeof window>`u`||!window.matchMedia)return()=>{};let t=window.matchMedia(It);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function Rt(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(It).matches}function zt(){return(0,P.useSyncExternalStore)(Lt,Rt,()=>!1)}var Bt={accent:`var(--color-accent)`,warning:`var(--color-warning)`,critical:`var(--color-critical)`,info:`var(--color-info)`,clean:`var(--color-clean)`,muted:`var(--color-muted-foreground)`};function Vt(e,t){return[e,...t].map(e=>e.join(` `)).join(`
9
- `)}function Ht({caption:e,columns:t,rows:n,align:r}){let[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)(!1);async function c(){try{await Ft(Vt(t,n)),s(!0),setTimeout(()=>s(!1),1500)}catch{}}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(`button`,{type:`button`,className:`cursor-pointer text-muted-foreground text-xs underline`,"aria-expanded":i,onClick:()=>a(e=>!e),children:`▤ Table`}),(0,F.jsx)(`button`,{type:`button`,className:`cursor-pointer text-muted-foreground text-xs underline`,onClick:c,children:`⧉ Copy`}),(0,F.jsx)(`span`,{"aria-live":`polite`,className:`text-xs text-muted-foreground`,children:o?`Copied`:``})]}),(0,F.jsxs)(Je,{className:i?void 0:`sr-only`,children:[(0,F.jsx)(Ue,{className:`sr-only`,children:e}),(0,F.jsx)(tt,{children:(0,F.jsx)(ze,{children:t.map((e,t)=>(0,F.jsx)(Ze,{className:r?.[t]===`right`?`text-right`:void 0,children:e},e))})}),(0,F.jsx)(We,{children:n.map((e,t)=>(0,F.jsx)(ze,{children:e.map((e,t)=>(0,F.jsx)(Re,{className:r?.[t]===`right`?`text-right`:void 0,children:e},t))},t))})]})]})}var Ut=new Set([l,s,i,a,o,c,r]);function Wt(e){if(!(0,P.isValidElement)(e))return e;let{children:t,isAnimationActive:n}=e.props,r=t==null?t:P.Children.map(t,Wt),i=Ut.has(e.type)&&n===void 0;return!i&&r===t?e:(0,P.cloneElement)(e,i?{isAnimationActive:!1}:{},...t==null?[]:[r])}function Gt({title:e,ariaLabel:t,height:n,children:r,table:i}){let a=zt()?Wt(r):r,o=He();return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e?(0,F.jsx)(`p`,{className:`text-muted-foreground text-xs font-medium`,children:e}):null,o?(0,F.jsx)(Nt,{role:`img`,"aria-label":t,config:{},className:`aspect-auto w-full`,style:{height:n},initialDimension:{width:320,height:n},children:a}):(0,F.jsx)(`div`,{style:{height:n},"aria-hidden":!0}),i?(0,F.jsx)(Ht,{...i}):null]})}function Kt(e){let t=(0,P.useId)(),[n,r]=(0,P.useState)(!1);return e?{tooltipProps:{title:e,"aria-describedby":t,onFocus:()=>r(!0),onBlur:()=>r(!1)},srOnlyTooltip:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{id:t,className:`sr-only`,children:e}),n?(0,F.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`visible-tooltip`,className:`pointer-events-none absolute top-full left-0 z-50 mt-1 max-w-xs rounded-md border border-border bg-foreground px-2 py-1 text-xs font-normal whitespace-normal text-background shadow-md`,children:e}):null]})}:{tooltipProps:{},srOnlyTooltip:null}}function q({confidence:e,validationRequired:t,evidenceKey:n}){let{tooltipProps:r,srOnlyTooltip:i}=Kt(t),{revealEvidence:a}=wt(),o=!!e&&e!==`high`,s=!!n;return!o&&!s?null:(0,F.jsxs)(`span`,{className:`relative inline-flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border border-border bg-muted/60 px-2.5 text-xs font-medium text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,tabIndex:o?0:void 0,...o?r:{},children:[o?(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block size-2 shrink-0 rounded-full border border-dashed border-current`}):null,o?`${e} confidence`:null,o?i:null,o&&s?(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`opacity-60`,children:`·`}):null,s?(0,F.jsx)(`button`,{type:`button`,"aria-label":`Evidence: ${B(n)}`,className:`tap-target-comfortable tap-target-comfortable--sm inline-flex min-h-[22px] cursor-pointer items-center rounded-sm text-primary outline-none hover:underline underline-offset-2 focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>a(n),children:B(n)}):null]})}function qt(e,t){let n=[];for(let r of e){let e=t.get(r);e&&e.submittedAt!=null&&e.completedAt!=null&&n.push([e.submittedAt,e.completedAt])}return be(n).reduce((e,[t,n])=>e+(n-t),0)}function Jt(e){let t=new Map;for(let n of e){let e=t.get(n.type)??[];e.push(n),t.set(n.type,e)}return t}function Yt(e){return e.stageIds?e.stageIds:e.stageId==null?[]:[e.stageId]}function Xt(e,t,n){let r=[...new Set(t.flatMap(Yt))],i=t.reduce((e,t)=>e+(t.impactEstimate?.wallClock?.high??0),0),a=r.length>0?Math.min(i,qt(r,n)):i;return{kind:`time`,type:e,findingCount:t.length,stageCount:r.length,recoverableMsHigh:a,findings:t}}function Zt(e,t){let n=t[0].impactEstimate.rawWaste.unit,r=t.reduce((e,t)=>e+(t.impactEstimate?.rawWaste?.value??0),0);return{kind:`resource`,type:e,findingCount:t.length,unit:n,total:r,findings:t}}function Qt(e,t){let n={};for(let e of t)n[e.impactBand]=(n[e.impactBand]??0)+1;return{kind:`count`,type:e,findingCount:t.length,byImpactBand:n,findings:t}}var $t={time:0,resource:1,count:2};function en(e,t){let n=[];for(let[r,i]of Jt(e)){let e=i.filter(e=>e.impactEstimate?.wallClock!=null),a=i.filter(e=>e.impactEstimate?.wallClock==null&&e.impactEstimate?.rawWaste!=null),o=i.filter(e=>e.impactEstimate?.wallClock==null&&e.impactEstimate?.rawWaste==null);if(e.length>0&&n.push(Xt(r,e,t)),a.length>0){let e=new Map;for(let t of a){let n=t.impactEstimate.rawWaste.unit,r=e.get(n)??[];r.push(t),e.set(n,r)}for(let t of e.values())n.push(Zt(r,t))}o.length>0&&n.push(Qt(r,o))}return n.sort((e,t)=>{let n=$t[e.kind]-$t[t.kind];return n===0?e.kind===`time`&&t.kind===`time`?t.recoverableMsHigh-e.recoverableMsHigh:(D[N(e.findings)??`info`]??9)-(D[N(t.findings)??`info`]??9):n})}function tn(e){return!(e.type===`memoryUtilization`&&e.variant===`memoryBand`&&e.dataUnavailable)}function nn(e){return e.type!==`incompleteRun`&&tn(e)}var rn=0,an=1,on=2;function J(e){let t=e.impactEstimate;return t?.wallClock?rn:t?.rawWaste?an:on}function sn(e){return[...e].sort((e,t)=>{let n=J(e)-J(t);return n===0?J(e)===rn?t.impactEstimate.wallClock.high-e.impactEstimate.wallClock.high:(D[e.impactBand]??9)-(D[t.impactBand]??9):n})}var cn={spill:`single-task disk spill above 1 GiB`,shuffle:`shuffle read above the configured minimum byte threshold`,skew:`task duration skew above the configured ratio`,gc:`JVM GC time share above the configured ratio`,slowHost:`a host running 2x+ slower than its peers by mean task duration (per-executor byte/time dimensions use a separate, narrower ratio ladder starting at 1.33x; only those can reach critical on ratio alone)`,stageSlowness:`a stage running far longer than its peers, not attributable to a single slow host`,straggler:`one or more tasks finishing far after the rest of their stage`,speculationWaste:`speculative task attempts that completed after the original`,tinyTask:`median task duration below the configured floor`,partitionSizing:`partition byte size outside the configured target range`,stageShape:`low parallelism, data explosion, or task-count skew relative to core count`,stageFailed:`a stage that failed outright`,failures:`task failures above the configured rate`,retryWaste:`retried task attempts consuming executor time`,coldStart:`executor startup time above the configured floor`,incompleteRun:`an event log missing its terminal ApplicationEnd/job-completion event`,utilization:`core occupancy below the configured floor across the run`,memoryUtilization:`executor heap usage outside the configured band`,cacheUtilization:`cached partitions evicted or spilled to disk`,coreLocality:`task placement missing data-local core assignment`,cachingOpportunity:`a dataset re-read from source multiple times with no cache/persist`,jobFailureRate:`job failure rate above the configured threshold`,autoscalingChurn:`executor add/remove churn above the configured rate`,configAudit:`a Spark conf value outside the recommended range`,duplicatePlanSubtree:`the same physical plan subtree executed more than once`,smallFiles:`output files below the configured target size`,overBroadcast:`a broadcast join above the configured size ceiling`,underBroadcast:`a join below the configured size floor that skipped broadcast`,broadcastSizing:`a broadcast join outside the configured size range in either direction`};function ln(e){return cn[e]??`criteria not met`}var Y={incompleteRun:`incomplete run`,skew:`task skew`,stageShape:`stage shape`,tinyTask:`tiny tasks`,shuffle:`shuffle I/O`,partitionSizing:`partition sizing`,spill:`spill`,gc:`GC pressure`,stageFailed:`failed stage`,failures:`failed tasks`,retryWaste:`retry waste`,slowHost:`slow executor host`,stageSlowness:`slow stage`,straggler:`straggling task`,speculationWaste:`speculation waste`,coldStart:`cold start`,memoryUtilization:`memory utilization`,utilization:`executor utilization`,coreLocality:`core locality`,cachingOpportunity:`caching opportunity`,cacheUtilization:`cache utilization`,jobFailureRate:`job failure rate`,autoscalingChurn:`autoscaling churn`,configAudit:`config audit`,duplicatePlanSubtree:`duplicate plan subtree`,smallFiles:`small files`,broadcastSizing:`broadcast sizing`,underBroadcast:`missed broadcast join`,overBroadcast:`oversized broadcast join`};function un(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}var dn=(0,P.lazy)(()=>A(()=>import(`./Skew-BGLJuZZR.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,17,18,19,20]),import.meta.url)),fn=(0,P.lazy)(()=>A(()=>import(`./StageShape-DfOW93Z1.js`).then(e=>({default:e.StageShape})),__vite__mapDeps([21,1,2,3,4,8,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url)),pn=(0,P.lazy)(()=>A(()=>import(`./TinyTask-CfT8zZDr.js`).then(e=>({default:e.TinyTask})),__vite__mapDeps([22,1,2,3,4,8,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url)),mn=(0,P.lazy)(()=>A(()=>import(`./ShuffleIO-pyDhxdaz.js`).then(e=>({default:e.ShuffleIO})),__vite__mapDeps([23,1,2,3,4,5,6,7,10,19,11,12,13,14,15,16,17,18,24,20]),import.meta.url)),hn=(0,P.lazy)(()=>A(()=>import(`./PartitionSizing-Cz_B0-uG.js`).then(e=>({default:e.PartitionSizing})),__vite__mapDeps([25,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,19,24,20]),import.meta.url)),gn=(0,P.lazy)(()=>A(()=>import(`./Spill-NGJGQaTB.js`).then(e=>({default:e.Spill})),__vite__mapDeps([26,1,2,3,4,5,6,7,27,28,10,19,11,12,13,14,15,16,17,20]),import.meta.url)),_n=(0,P.lazy)(()=>A(()=>import(`./GcPressure-CYsmU1d7.js`).then(e=>({default:e.GcPressure})),__vite__mapDeps([29,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),vn=(0,P.lazy)(()=>A(()=>import(`./StageFailed-sGhki53z.js`).then(e=>({default:e.StageFailed})),__vite__mapDeps([30,1,2,3,4,5,6,7,10,19,11,12,13,14,15,16,17]),import.meta.url)),yn=(0,P.lazy)(()=>A(()=>import(`./TaskFailures-DGDwUK2A.js`).then(e=>({default:e.TaskFailures})),__vite__mapDeps([31,1,2,3,4,5,6,7,10,19,11,12,13,14,15,16,17]),import.meta.url)),bn=(0,P.lazy)(()=>A(()=>import(`./RetryWaste-D_m8ASwP.js`).then(e=>({default:e.RetryWaste})),__vite__mapDeps([32,1,2,3,4,5,6,7,10,19,11,12,13,14,15,16,17]),import.meta.url)),xn=(0,P.lazy)(()=>A(()=>import(`./SlowHost-ChdWVvGO.js`).then(e=>({default:e.SlowHost})),__vite__mapDeps([33,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),Sn=(0,P.lazy)(()=>A(()=>import(`./StageSlowness-BMZ-K_5e.js`).then(e=>({default:e.StageSlowness})),__vite__mapDeps([34,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),Cn=(0,P.lazy)(()=>A(()=>import(`./Straggler-dffcAN7t.js`).then(e=>({default:e.Straggler})),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),wn=(0,P.lazy)(()=>A(()=>import(`./SpeculationWaste-CVzgJnSj.js`).then(e=>({default:e.SpeculationWaste})),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),Tn=(0,P.lazy)(()=>A(()=>import(`./ColdStart-w8QYTNKo.js`).then(e=>({default:e.ColdStart})),__vite__mapDeps([37,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17]),import.meta.url)),En=(0,P.lazy)(()=>A(()=>import(`./MemoryUtilization-C9G7P94X.js`).then(e=>({default:e.MemoryUtilization})),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,14,15]),import.meta.url)),Dn=(0,P.lazy)(()=>A(()=>import(`./ExecutorUtilization-Cn69i0uq.js`).then(e=>({default:e.ExecutorUtilization})),__vite__mapDeps([39,1,2,3,4,5,6,7,10,11,12,14,15]),import.meta.url)),On=(0,P.lazy)(()=>A(()=>import(`./CachingOpportunity-U0g-8HPV.js`).then(e=>({default:e.CachingOpportunity})),__vite__mapDeps([40,1,2,3,4,5,6,7,10,11,12,14,15]),import.meta.url)),kn=(0,P.lazy)(()=>A(()=>import(`./JobFailures-DJ2dDvPA.js`).then(e=>({default:e.JobFailures})),__vite__mapDeps([41,3,1,2,4,5,6,7,10,11]),import.meta.url)),An=(0,P.lazy)(()=>A(()=>import(`./ConfigAudit-ClZp5BpV.js`).then(e=>({default:e.ConfigAudit})),__vite__mapDeps([42,1,2,3,4,5,6,7,10,11,12,14,15]),import.meta.url)),jn=(0,P.lazy)(()=>A(()=>import(`./DuplicatePlanSubtree-Cm_UU3lY.js`).then(e=>({default:e.DuplicatePlanSubtree})),__vite__mapDeps([43,1,2,3,4,5,6,7,10,19,11,12,13,14,15,16,17]),import.meta.url)),Mn=(0,P.lazy)(()=>A(()=>import(`./SmallFiles-gTilBtjW.js`).then(e=>({default:e.SmallFiles})),__vite__mapDeps([44,1,2,3,4,5,6,7,10,19,11,12,13,14,15,16,17]),import.meta.url)),Nn=(0,P.lazy)(()=>A(()=>import(`./UnderBroadcast-CiOiJ0k1.js`).then(e=>({default:e.UnderBroadcast})),__vite__mapDeps([45,1,2,3,4,5,6,7,10,19,11,12,13,14,15,16,17]),import.meta.url)),Pn=(0,P.lazy)(()=>A(()=>import(`./OverBroadcast-DYauoYWQ.js`).then(e=>({default:e.OverBroadcast})),__vite__mapDeps([46,1,2,3,4,5,6,7,10,19,11,12,13,14,15,16,17]),import.meta.url)),Fn=(0,P.lazy)(()=>A(()=>import(`./CacheUtilization-lKua3J1x.js`).then(e=>({default:e.CacheUtilization})),__vite__mapDeps([47,1,2,3,4,5,6,7,10,11,12,14,15]),import.meta.url)),In=(0,P.lazy)(()=>A(()=>import(`./CoreUsageArea-o3kqQwyi.js`).then(e=>({default:e.CoreUsageArea})),__vite__mapDeps([48,1,2,3,4,49,5,6,7,27,28,10,11,12,15]),import.meta.url)),Ln=(0,P.lazy)(()=>A(()=>import(`./AutoscalingChurn-B96FKx97.js`).then(e=>({default:e.AutoscalingChurn})),__vite__mapDeps([50,1,2,3,4,5,6,7,28,10,11]),import.meta.url)),Rn=(0,P.lazy)(()=>A(()=>import(`./IncompleteRun-s6uQ8OLf.js`).then(e=>({default:e.IncompleteRun})),__vite__mapDeps([51,3,1,2,4,5,6,7,11]),import.meta.url));function X(e,t){e.displayName=t}X(dn,`Skew`),X(fn,`StageShape`),X(pn,`TinyTask`),X(mn,`ShuffleIO`),X(hn,`PartitionSizing`),X(gn,`Spill`),X(_n,`GcPressure`),X(vn,`StageFailed`),X(yn,`TaskFailures`),X(bn,`RetryWaste`),X(xn,`SlowHost`),X(Sn,`StageSlowness`),X(Cn,`Straggler`),X(wn,`SpeculationWaste`),X(Tn,`ColdStart`),X(En,`MemoryUtilization`),X(Dn,`ExecutorUtilization`),X(On,`CachingOpportunity`),X(kn,`JobFailures`),X(An,`ConfigAudit`),X(jn,`DuplicatePlanSubtree`),X(Mn,`SmallFiles`),X(Nn,`UnderBroadcast`),X(Pn,`OverBroadcast`),X(Fn,`CacheUtilization`),X(In,`CoreUsageArea`),X(Ln,`AutoscalingChurn`),X(Rn,`IncompleteRun`);var Z={incompleteRun:{component:Rn,region:`action`,widgetId:`incomplete-run`,widgetTitle:`Incomplete Run`,findingLabel:Y.incompleteRun,routeable:!0},skew:{component:dn,region:`action`,widgetId:`skew`,widgetTitle:`Task Skew`,findingLabel:Y.skew,routeable:!0},stageShape:{component:fn,region:`action`,widgetId:`stage-shape`,widgetTitle:`Stage Shape`,findingLabel:Y.stageShape,routeable:!0},tinyTask:{component:pn,region:`action`,widgetId:`tiny-task`,widgetTitle:`Tiny Tasks`,findingLabel:Y.tinyTask,routeable:!0},shuffle:{component:mn,region:`action`,widgetId:`shuffle-io`,widgetTitle:`Shuffle I/O`,findingLabel:Y.shuffle,routeable:!0},partitionSizing:{component:hn,region:`action`,widgetId:`partition-sizing`,widgetTitle:`Partition Sizing`,findingLabel:Y.partitionSizing,routeable:!0},spill:{component:gn,region:`action`,widgetId:`spill`,widgetTitle:`Spill`,findingLabel:Y.spill,routeable:!0},gc:{component:_n,region:`action`,widgetId:`gc-pressure`,widgetTitle:`GC Pressure`,findingLabel:Y.gc,routeable:!0},stageFailed:{component:vn,region:`action`,widgetId:`stage-failed`,widgetTitle:`Failed Stages`,findingLabel:Y.stageFailed,routeable:!0},failures:{component:yn,region:`action`,widgetId:`task-failures`,widgetTitle:`Failed Tasks`,findingLabel:Y.failures,routeable:!0},retryWaste:{component:bn,region:`action`,widgetId:`retry-waste`,widgetTitle:`Retry Waste`,findingLabel:Y.retryWaste,routeable:!0},slowHost:{component:xn,region:`action`,widgetId:`slow-host`,widgetTitle:`Slow Executor Host`,findingLabel:Y.slowHost,routeable:!0},stageSlowness:{component:Sn,region:`action`,widgetId:`stage-slowness`,widgetTitle:`Slow Stage`,findingLabel:Y.stageSlowness,routeable:!0},straggler:{component:Cn,region:`action`,widgetId:`straggler`,widgetTitle:`Stragglers`,findingLabel:Y.straggler,routeable:!0},speculationWaste:{component:wn,region:`action`,widgetId:`speculation-waste`,widgetTitle:`Speculation Waste`,findingLabel:Y.speculationWaste,routeable:!0},coldStart:{component:Tn,region:`action`,widgetId:`cold-start`,widgetTitle:`Cold Start`,findingLabel:Y.coldStart,routeable:!0},memoryUtilization:{component:En,region:`reference`,widgetId:`memory-utilization`,widgetTitle:`Memory Utilization`,findingLabel:Y.memoryUtilization,routeable:!0},utilization:{component:Dn,region:`reference`,widgetId:`executor-utilization`,widgetTitle:`Executor Utilization`,findingLabel:Y.utilization,routeable:!0},coreLocality:{component:In,region:`reference`,widgetId:`core-usage-area`,widgetTitle:`Core Usage by Locality`,findingLabel:Y.coreLocality,routeable:!0},cachingOpportunity:{component:On,region:`action`,widgetId:`caching-opportunity`,widgetTitle:`Caching Opportunities`,findingLabel:Y.cachingOpportunity,routeable:!0},cacheUtilization:{component:Fn,region:`reference`,widgetId:`cache-utilization`,widgetTitle:`Cache Storage`,findingLabel:Y.cacheUtilization,routeable:!0},jobFailureRate:{component:kn,region:`action`,widgetId:`job-failures`,widgetTitle:`Job Failures`,findingLabel:Y.jobFailureRate,routeable:!0},autoscalingChurn:{component:Ln,region:`action`,widgetId:`autoscaling-churn`,widgetTitle:`Autoscaling Churn`,findingLabel:Y.autoscalingChurn,routeable:!0},configAudit:{component:An,region:`action`,widgetId:`config-audit`,widgetTitle:`Config Sanity`,findingLabel:Y.configAudit,routeable:!0},duplicatePlanSubtree:{component:jn,region:`action`,widgetId:`duplicate-plan-subtree`,widgetTitle:`Redundant Plan Subtree`,findingLabel:Y.duplicatePlanSubtree,routeable:!0},smallFiles:{component:Mn,region:`action`,widgetId:`small-files`,widgetTitle:`Excessive Small Files`,findingLabel:Y.smallFiles,routeable:!0},underBroadcast:{component:Nn,region:`action`,widgetId:`under-broadcast`,widgetTitle:`Missed Broadcast Join`,findingLabel:Y.underBroadcast,routeable:!0},overBroadcast:{component:Pn,region:`action`,widgetId:`over-broadcast`,widgetTitle:`Oversized Broadcast Join`,findingLabel:Y.overBroadcast,routeable:!0}},zn={action:0,reference:1},Bn=[`overBroadcast`,`underBroadcast`];function Vn(){let e=new Map;for(let t of ve){let n=t.type===`broadcastSizing`?Bn:[t.type];for(let r of n){let n=Z[r];if(!n)continue;let i=e.get(r);(!i||t.order<i.order)&&e.set(r,{entry:n,type:r,order:t.order})}}return[...e.values()].sort((e,t)=>zn[e.entry.region]-zn[t.entry.region]||e.order-t.order).map(({entry:e,type:t})=>({component:e.component,region:e.region,widgetId:e.widgetId,widgetTitle:e.widgetTitle,findingLabel:e.findingLabel,type:t}))}var Hn=new Set([`cacheUtilization`,`memoryUtilization`,`utilization`]);function Un(e){let t=Z[e];return t!==void 0&&t.region===`reference`&&!Hn.has(e)}function Wn(){return Object.entries(Z).filter(([e])=>Un(e)).map(([,e])=>({component:e.component,widgetId:e.widgetId}))}function Gn(e){switch(e.type){case`skew`:return`Fix task skew`;case`stageShape`:switch(e.rule){case`lowParallelism`:return`Increase parallelism`;case`dataExplosion`:return`Check for exploding join`;case`taskStageSkew`:return`Fix straggler task`}break;case`shuffle`:return`Reduce shuffle size`;case`partitionSizing`:switch(e.rule){case`shufflePartitionSkew`:return`Fix skewed partition`;case`lowShuffleParallelism`:return`Add shuffle partitions`;case`maxPartitionTooBig`:return`Repartition oversized data`}break;case`spill`:return`Reduce spill`;case`gc`:return e.direction===`low`?`Right-size executor memory`:`Reduce GC pressure`;case`slowHost`:return e.variant===`durationShare`?`Fix data locality`:e.variant===`multiDim`?`Investigate degraded executor`:`Check slow host`;case`stageSlowness`:return`Profile slow stage`;case`stageFailed`:return`Inspect stage failure`;case`failures`:return`Investigate task failures`;case`straggler`:return`Fix stragglers`;case`speculationWaste`:return`Tune speculation settings`;case`retryWaste`:return`Investigate retry cause`;case`tinyTask`:return`Coalesce small tasks`;case`coldStart`:return`Pre-warm cluster`;case`utilization`:return`Reduce cluster size`;case`memoryUtilization`:switch(e.variant){case`idleCores`:return`Reduce idle cores`;case`wasteModel`:return`Right-size executor memory`;case`memoryBand`:return e.dataUnavailable?`Enable memory metrics`:e.rule===`heapNearCapacity`?`Increase executor memory`:`Reduce executor memory`}break;case`cacheUtilization`:return`Increase cache memory`;case`coreLocality`:return`Fix data locality`;case`autoscalingChurn`:return`Reduce autoscaling churn`;case`cachingOpportunity`:return e.variant===`composite`?`Cache repeated result`:`Cache shared table`;case`jobFailureRate`:return`Investigate failed jobs`;case`configAudit`:switch(e.property){case`spark.shuffle.service.enabled`:return`Enable shuffle service`;case`spark.dynamicAllocation.minExecutors`:return`Fix autoscaling bounds`;case`spark.dynamicAllocation.maxExecutors`:return`Set max executors`;case`spark.serializer`:return`Switch to Kryo`;case`spark.executor.memoryOverhead`:return`Raise memory overhead`}break;case`duplicatePlanSubtree`:return`Dedupe repeated subtree`;case`smallFiles`:return e.direction===`write`?`Coalesce output files`:`Compact small files`;case`underBroadcast`:return`Use broadcast join`;case`overBroadcast`:return`Fix oversized broadcast`}}function Kn(e){return Gn(e)??Z[e.type]?.findingLabel??e.type}function qn({title:e,children:t,defaultOpen:n=!1}){let[r,i]=(0,P.useState)(n);return(0,F.jsxs)(et,{open:r,onOpenChange:i,className:`space-y-2`,children:[(0,F.jsxs)(pe,{"aria-expanded":String(r),className:`tap-target-comfortable tap-target-comfortable--sm flex cursor-pointer items-center gap-2 bg-transparent text-left`,children:[(0,F.jsx)(`h3`,{className:`font-heading text-sm font-medium`,children:e}),r?(0,F.jsx)(ge,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}):(0,F.jsx)(we,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),(0,F.jsx)(ke,{keepMounted:!0,children:t})]})}function Jn({...e}){return(0,F.jsx)(g,{"data-slot":`dialog`,...e})}function Yn({...e}){return(0,F.jsx)(ae,{"data-slot":`dialog-portal`,...e})}function Xn({className:e,...t}){return(0,F.jsx)(u,{"data-slot":`dialog-overlay`,className:C(`fixed inset-0 isolate z-50 bg-(--overlay-scrim) duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:animate-none`,e),...t})}function Zn({className:e,children:t,showCloseButton:n=!0,...r}){return(0,F.jsxs)(Yn,{children:[(0,F.jsx)(Xn,{}),(0,F.jsxs)(ie,{"data-slot":`dialog-content`,className:C(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none`,e),...r,children:[t,n&&(0,F.jsxs)(b,{"data-slot":`dialog-close`,render:(0,F.jsx)(T,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,F.jsx)(Be,{}),(0,F.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Qn({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`dialog-header`,className:C(`flex flex-col gap-2`,e),...t})}function $n({className:e,showCloseButton:t=!1,children:n,...r}){return(0,F.jsxs)(`div`,{"data-slot":`dialog-footer`,className:C(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,F.jsx)(b,{render:(0,F.jsx)(T,{variant:`outline`}),children:`Close`})]})}function er({className:e,...t}){return(0,F.jsx)(se,{"data-slot":`dialog-title`,className:C(`font-heading text-base leading-none font-medium`,e),...t})}function tr({className:e,...t}){return(0,F.jsx)(oe,{"data-slot":`dialog-description`,className:C(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Q({title:e,rows:t,children:n,collapsible:r=!1,defaultOpen:i=!1}){let a=t.filter(e=>!!e);if(a.length===0&&!n)return null;let o=(0,F.jsx)(`div`,{className:`grid min-w-0 grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm`,children:a.map(([e,t],n)=>(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,F.jsx)(`span`,{className:`break-words`,children:t})]},n))});return r&&e?(0,F.jsx)(qn,{title:e,defaultOpen:i,children:(0,F.jsxs)(`div`,{className:`space-y-2`,children:[o,n]})}):(0,F.jsxs)(`section`,{className:`space-y-2`,children:[e?(0,F.jsx)(`h3`,{className:`font-heading text-sm font-medium`,children:e}):null,o,n]})}function nr(e){return String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}function rr(e,{title:t=`plan`}={}){if(!e)return``;let n=[`digraph "${nr(t)}" {`,` rankdir=BT;`,` node [shape=box];`],r=new WeakMap,i=[],a=0;return Ge(e,(e,t)=>{let o=`n${a++}`;r.set(e,o);let s=e.detail&&e.detail!==e.name?`${e.name}\\n${e.detail}`:e.name;n.push(` ${o} [label="${nr(s)}"];`),t&&i.push(` ${r.get(t)} -> ${o};`)},{dedupe:!0}),[...n,...i,`}`].join(`
10
- `)}var ir=`Derived from best-effort plan-text parsing: cross-check against the Summary tab before acting.`,ar=`Derived from best-effort plan-text parsing: cross-check against the Tree tab before acting.`,or=`Derived from best-effort plan-text parsing: cross-check against the Tree tab or View plan graph before acting.`;function sr(e){try{return Ie(e)}catch{return null}}function cr(e){try{return Fe(e)}catch{return null}}function lr(e,t){try{return rr(e,{title:`stage-${t}`})||null}catch{return null}}function ur(e,t,n,r){if(!n||r==null)return null;try{return Le(e,t,n,r)}catch{return null}}function dr(e,t){let n=t.stages.get(e);return(n?.sqlExecutionId==null?null:t.sql.get(n.sqlExecutionId))?.planTree??null}function fr(e){switch(e.kind){case`scan`:return[e.path?[`Path`,e.path]:null,e.format?[`Format`,e.format]:null,e.projectedColumns?.length?[`Columns`,e.projectedColumns.join(`, `)]:null,e.pushedFilters?.length?[`Filters`,e.pushedFilters.join(`, `)]:null];case`join`:return[[`Left keys`,e.leftKeys?.length?e.leftKeys.join(`, `):`(none)`],[`Right keys`,e.rightKeys?.length?e.rightKeys.join(`, `):`(none)`]];case`agg`:return[[`Group by`,e.groupByKeys?.length?e.groupByKeys.join(`, `):`(none)`],[`Functions`,e.aggregations?.length?e.aggregations.join(`, `):`(none)`]];case`exchange`:return[e.partitioning?[`Partitioning`,e.partitioning]:null,e.keys?.length?[`Keys`,e.keys.join(`, `)]:null,e.numPartitions?[`Partitions`,String(e.numPartitions)]:null];default:return[]}}function pr({rows:e}){let[t,n]=(0,P.useState)(!1);return(0,F.jsxs)(`details`,{className:`pt-1 pl-4`,onToggle:e=>n(e.currentTarget.open),children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground`,children:`full detail`}),t?(0,F.jsx)(`div`,{className:`pt-1`,children:(0,F.jsx)(Q,{rows:e})}):null]})}function mr({node:e,depth:t,durationMap:n}){let r=(0,P.useRef)(null),[i,a]=(0,P.useState)(t<=1);(0,P.useEffect)(()=>{r.current&&(r.current.open=t<=1)},[]);let o=De(e.name),s=e.detail??``,c=sr(e),l=c?fr(c):[],u=l.some(Boolean),d=c?.kind===`scan`?``:Xe(e.name,s),f=e.exchangeRole===`read`?e.children[0]:void 0,p=n?.get(f??e),m=(f??e).metrics??[],h=m.length>0?Ve(m):``,g=(f??e).children??[],_=g.length>0||m.length>0||u;return(0,F.jsxs)(`details`,{ref:r,"data-op":o,className:`rounded-md`,onToggle:e=>a(e.currentTarget.open),children:[(0,F.jsxs)(`summary`,{className:`flex list-none flex-wrap items-center gap-2 rounded-md px-1.5 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden ${_?`cursor-pointer hover:bg-muted`:`cursor-default`}`,children:[_?(0,F.jsx)(ot,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform ${i?`rotate-90`:``}`}):(0,F.jsx)(`span`,{className:`size-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`font-medium`,children:e.name}),d?(0,F.jsx)(`span`,{title:s,className:`text-xs text-muted-foreground`,children:d}):null,c?.warning?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ce,{type:`duplicatePlanSubtree`,impactBand:`warning`,className:Ye}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.warning.detail}),(0,F.jsx)(O,{children:(0,F.jsx)(q,{confidence:`low`})})]}):null,p!=null&&p>0?(0,F.jsxs)(`span`,{title:`Approximate wall-time attributed to this operator`,className:`text-xs text-muted-foreground`,children:[`~`,j(p)]}):null,h?(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:h}):null]}),m.length>0?(0,F.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 pt-1 pl-6 text-xs text-muted-foreground`,children:m.map((e,t)=>(0,F.jsxs)(`span`,{children:[e.name,`: `,ue(e)]},t))}):null,u?(0,F.jsx)(pr,{rows:l}):null,g.length>0?(0,F.jsx)(`div`,{className:`ml-[7px] space-y-1 border-l border-border/60 pt-1 pl-3.5`,children:g.map((e,r)=>(0,F.jsx)(mr,{node:e,depth:t+1,durationMap:n},r))}):null]})}function hr(e){return`${e.path||`(unknown path)`} (${e.format})`}function gr(e){let t=e.leftKeys.length||e.rightKeys.length?` on ${e.leftKeys.join(`, `)||`(none)`} / ${e.rightKeys.join(`, `)||`(none)`}`:``;return`${e.joinType}${t}`}function _r(e){let t=e.aggregations.join(`, `)||`(none)`;return e.groupByKeys.length?`${t} by ${e.groupByKeys.join(`, `)}`:t}function vr(e){let t=new Map;for(let n of e)t.set(n.partitioning,(t.get(n.partitioning)??0)+1);return[...t.entries()].map(([e,t])=>`${e}×${t}`).join(`, `)}function yr({summary:e,hasPlanGraph:t}){let{scans:n,joins:r,aggs:i,exchanges:a,warnings:o}=e,s=a.length>=4,c=s||o.length>0,l=t?or:ar;return(0,F.jsx)(Q,{rows:[n.length>0&&[`Sources (${n.length})`,n.map(hr).join(`, `)],r.length>0&&[`Joins (${r.length})`,r.map(gr).join(`; `)],i.length>0&&[`Aggregations (${i.length})`,i.map(_r).join(`; `)],a.length>0&&[`Exchanges (${a.length})`,(0,F.jsxs)(F.Fragment,{children:[vr(a),s?(0,F.jsxs)(F.Fragment,{children:[` `,(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`— consider whether some joins/aggregations could share a partitioning scheme to avoid redundant shuffles.`}),` `,(0,F.jsx)(O,{children:(0,F.jsx)(q,{confidence:`low`})})]}):null]})],o.length>0&&[`Warnings (${o.length})`,(0,F.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,F.jsx)(Ce,{type:`duplicatePlanSubtree`,impactBand:`warning`,className:`bg-plan-aggregate/8 text-plan-aggregate`}),o.map(e=>e.detail).join(`; `),(0,F.jsx)(O,{children:(0,F.jsx)(q,{confidence:`low`})})]})]],children:c?(0,F.jsx)(O,{children:(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l})}):null})}function br({stageId:e,appModel:t}){let n=E(e=>e.openPlanGraph),r=dr(e,t);if(!r)return null;let i=t.stages.get(e),a=ur(r,t,i?.sqlExecutionId==null?null:t.sql.get(i.sqlExecutionId),i?.sqlExecutionId),o=cr(r),s=lr(r,e);return(0,F.jsxs)(ht,{defaultValue:`tree`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsxs)(_t,{"aria-label":`Plan view`,children:[(0,F.jsx)(I,{value:`tree`,children:`Tree`}),(0,F.jsx)(I,{value:`summary`,children:`Summary`})]}),(0,F.jsx)(`div`,{className:`flex gap-2`,children:s?(0,F.jsx)(T,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>n(e),children:`View plan graph`}):null})]}),(0,F.jsx)(L,{value:`tree`,children:(0,F.jsxs)(`div`,{className:`space-y-2 pt-3`,children:[(0,F.jsx)(mr,{node:r,depth:0,durationMap:a}),(0,F.jsx)(O,{children:(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Showing initial (pre-AQE) plan. Metrics reflect operators as planned; adaptive optimizations may have rewritten the actual execution.`})}),o&&o.warnings.length>0?(0,F.jsx)(O,{children:(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ir})}):null]})}),(0,F.jsx)(L,{value:`summary`,children:(0,F.jsx)(`div`,{className:`pt-3`,children:o?(0,F.jsx)(yr,{summary:o,hasPlanGraph:s!=null}):(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Plan summary couldn’t be parsed.`})})})]})}var xr=[/\bip(?:-\d{1,3}){4}(?:\.[a-z0-9][a-z0-9-]*)*/gi,/\b(?:\d{1,3}\.){3}\d{1,3}\b/g],Sr=[/\bapplication_\d{10,}_\d+\b/g];function Cr(e,t){if(typeof e==`string`){for(let{patterns:n,out:r}of t)for(let t of n){let n=e.match(t);if(n)for(let e of n)r.add(e)}return}if(Array.isArray(e)){for(let n of e)Cr(n,t);return}if(e&&typeof e==`object`)for(let n of Object.values(e))Cr(n,t)}function wr(e,t){if(Array.isArray(e)){for(let n of e)wr(n,t);return}if(e&&typeof e==`object`)for(let[n,r]of Object.entries(e))n===`host`&&typeof r==`string`&&r.length>0?t.add(r):wr(r,t)}function Tr(e){let t=new Set,n=new Set,r=e?.summary?.app?.id;return typeof r==`string`&&r.length>0&&t.add(r),wr(e?.findings,n),Cr(e,[{patterns:xr,out:n},{patterns:Sr,out:t}]),{appIds:t,hosts:n}}function Er(e,t){let n=new Map;return[...e].sort((e,t)=>e.localeCompare(t,`en`,{numeric:!0})).forEach((e,r)=>n.set(e,`${t}-${r+1}`)),n}function Dr(e,t){if(typeof e==`string`){let n=e;for(let[e,r]of t)n=n.split(e).join(r);return n}if(Array.isArray(e))return e.map(e=>Dr(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=Dr(i,t);return n}return e}function Or(e,t){let n=[...t.appIds?Er(t.appIds,`app`):[],...Er(t.hosts,`host`)];return n.sort((e,t)=>t[0].length-e[0].length),Dr(e,n)}function kr(e){let{appIds:t,hosts:n}=Tr(e);return Or(e,{appIds:t,hosts:n})}var Ar=new Set([`id`,`type`,`name`,`impactBand`,`stageId`,`metric`,`value`,`recommendation`,`detectorVersion`,`confidence`,`validationRequired`,`docAnchor`,`impactEstimate`,`actionLabel`]),jr=new Set([`planNodeIds`]);function Mr(e){let t={};for(let n of Object.keys(e).sort())!Ar.has(n)&&!jr.has(n)&&(t[n]=e[n]);let n={id:e.id??null,type:e.type,name:un(Y[e.type]??e.type),tag:Qe(e.type),impactBand:e.impactBand,stageId:e.stageId??null,metric:e.metric??null,value:e.value??null,recommendation:e.recommendation??null,detectorVersion:e.detectorVersion??1,evidence:t,actionLabel:Gn(e)??e.type};return e.confidence!=null&&(n.confidence=e.confidence),e.validationRequired!=null&&(n.validationRequired=e.validationRequired),e.docAnchor!=null&&(n.docAnchor=e.docAnchor),e.impactEstimate!=null&&(n.impactEstimate=e.impactEstimate),n}function Nr(e){return[...e].sort((e,t)=>{let n=(D[e.impactBand]??9)-(D[t.impactBand]??9);if(n!==0)return n;if(e.type!==t.type)return e.type<t.type?-1:1;let r=e.stageId??-1,i=t.stageId??-1;return r===i?(e.id??``)<(t.id??``)?-1:+((e.id??``)>(t.id??``)):r-i})}function Pr(e,t){return en(e.filter(nn),t).map(e=>{let t=sn(e.findings),n=t[0],r=t.map(e=>e.id).filter(e=>e!=null),i={type:e.type,tag:Qe(e.type),actionLabel:Gn(n)??n.type,findingCount:e.findingCount,findingIds:r};return e.kind===`time`?{...i,kind:`time`,stageCount:e.stageCount,recoverableMsHigh:e.recoverableMsHigh,impact:zr(e.recoverableMsHigh,e.recoverableMsHigh)}:e.kind===`resource`?{...i,kind:`resource`,unit:e.unit,total:e.total,impact:Br({value:e.total,unit:e.unit})}:{...i,kind:`count`,byImpactBand:e.byImpactBand,impact:null}})}function Fr(e){let t=new Set(e.map(e=>e.type)),n=new Set,r=[];for(let e of Me())t.has(e.type)||n.has(e.type)||(n.add(e.type),r.push({type:e.type,tag:Qe(e.type),thresholdSummary:ln(e.type)}));return r}var Ir=new WeakMap;function Lr(e){let t=Ir.get(e);if(t)return t;let{app:n,stages:r,executors:i,sql:a,jobs:o,runAggregates:s,evidenceAvailability:c}=e,l=fe(n,r,i?.added??[],i?.removed??[],o??new Map,a??new Map,s??null),u=Ne(n),d=[...l,...u],f=Nr(d.map(Mr)),p=Pr(d,r??new Map),m=Fr(d),h={critical:0,warning:0,info:0};for(let e of f)e.impactBand in h&&(h[e.impactBand]+=1);let g={schemaVersion:3,summary:{app:{id:n?.id??null,name:n?.name??null,sparkVersion:n?.sparkVersion??null},stageCount:r?.size??0,jobCount:o?.size??0,sqlExecutionCount:a?.size??0,findingCount:f.length,impactBandCounts:h},evidenceAvailability:c??null,detectors:Me(),findings:f,recommendations:p,cleanChecks:m};return Ir.set(e,g),g}function Rr(e,t){return typeof t==`number`&&/bytes$/i.test(e)?qe(t):typeof t==`object`&&t?JSON.stringify(t):String(t)}function zr(e,t){let n=e=>e===0?`0s`:j(e);return e===t?`Estimated ${n(t)}`:`Estimated ${n(e)}-${n(t)}`}function Br(e){let t=Math.round(e.value*10)/10;switch(e.unit){case`bytes`:return qe(e.value);case`ms`:return j(e.value);case`mbSeconds`:return`${t} MB-s`;case`coreHours`:return`${t.toFixed(1)} core-h`;case`coreMs`:return`${t} core-ms`;default:return String(e.value)}}function Vr(e){let t=e.wallClock?zr(e.wallClock.low,e.wallClock.high):null,n=e.rawWaste?Br(e.rawWaste):null;return!t&&!n?null:`${[t,n].filter(e=>e!=null).join(` · `)} (estimateMethod: ${e.estimateMethod})`}function Hr(e){let{summary:t,findings:n,evidenceAvailability:r,detectors:i,recommendations:a,cleanChecks:o}=e,s=[];s.push(`# Spark run evidence report`),s.push(``),s.push(`- Application: ${t.app.name??`(unknown)`} (${t.app.id??`n/a`})`),s.push(`- Spark version: ${t.app.sparkVersion??`n/a`}`),s.push(`- Stages: ${t.stageCount} · Jobs: ${t.jobCount} · SQL executions: ${t.sqlExecutionCount}`),s.push(`- Findings: ${t.findingCount} (critical ${t.impactBandCounts.critical}, warning ${t.impactBandCounts.warning}, info ${t.impactBandCounts.info})`),s.push(``),a.length>0&&(s.push(`## Fix these first (${a.length})`),s.push(``),a.forEach((e,t)=>{s.push(`${t+1}. [${e.tag}] ${e.actionLabel}`);let n=e.kind===`count`?Object.entries(e.byImpactBand??{}).map(([e,t])=>`${t} ${e}`).join(`, `):e.impact;s.push(` - ${n} · ×${e.findingCount} finding(s)`)}),s.push(``)),s.push(`## Findings (${n.length})`),s.push(``);for(let e of n){let t=e.stageId==null?``:` (stage ${e.stageId})`;s.push(`### ${e.name} · ${e.impactBand}${t}`),s.push(`- action: ${e.actionLabel}`),e.metric!=null&&s.push(`- ${e.metric}: ${e.value}`),e.recommendation&&s.push(`- ${e.recommendation}`),e.confidence&&s.push(`- confidence: ${e.confidence}`),e.validationRequired&&s.push(`- validation: ${e.validationRequired}`);let n=e.impactEstimate?Vr(e.impactEstimate):null;n&&s.push(`- impact: ${n}`),s.push(`- detector version: ${e.detectorVersion}`);let r=Object.entries(e.evidence??{}).sort(([e],[t])=>e<t?-1:+(e>t));if(r.length){s.push(`- evidence:`);for(let[e,t]of r)s.push(` - ${e}: ${Rr(e,t)}`)}s.push(``)}if(r?.entries?.length){s.push(`## Evidence availability`),s.push(``);for(let e of r.entries)s.push(`- ${e.key}: ${e.state} (${e.summary})`);s.push(``)}if(Array.isArray(i)&&i.length){s.push(`## Detectors`),s.push(``);for(let e of i)s.push(`- ${e.type} (v${e.version}, ${e.scope}), thresholds: ${JSON.stringify(e.thresholds)}`);s.push(``)}if(o.length>0){s.push(`## Clean checks (${o.length})`),s.push(``);for(let e of o)s.push(`- [${e.tag}] ${e.type}: ${e.thresholdSummary}`);s.push(``)}return s.join(`
11
- `)}function Ur(e,t){return vt(e,t)}function Wr(e,{redact:t=!1,markdown:n=!0,findingsFilter:r}={}){let i=Lr(e);return t&&(i=kr(i)),r&&(i={...i,findings:i.findings.filter(e=>Ur(e,r))}),{markdown:n?Hr(i):``,json:i}}function Gr(e,t,n){let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}function Kr(e,t,n){return`evidence-${String(e??`report`).replace(/[^\w.-]/g,`_`)}${n?`-redacted`:``}.${t===`json`?`json`:`md`}`}function qr(){let e=E(e=>e.appModel),[t,n]=(0,P.useState)(!1);return{redact:t,setRedact:n,download:n=>{let{markdown:r,json:i}=Wr(e,{redact:t}),a=Kr(i.summary?.app?.id??null,n,t);n===`json`?Gr(`${JSON.stringify(i,null,2)}\n`,a,`application/json`):Gr(`${r}\n`,a,`text/markdown`)}}}function Jr({redact:e,setRedact:t,download:n}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{checked:e,onClick:e=>e.preventDefault(),onCheckedChange:e=>t(!!e),children:`Redact identifiers`}),(0,F.jsx)(K,{}),(0,F.jsx)(W,{onClick:()=>n(`markdown`),children:`Download Markdown`}),(0,F.jsx)(W,{onClick:()=>n(`json`),children:`Download JSON`})]})}function Yr(){let e=qr();return(0,F.jsxs)(V,{children:[(0,F.jsxs)(H,{render:(0,F.jsx)(T,{variant:`ghost`,size:`sm`}),children:[(0,F.jsx)(ct,{"aria-hidden":`true`}),`Export evidence`]}),(0,F.jsx)(U,{align:`end`,children:(0,F.jsx)(Jr,{...e})})]})}function Xr({activeName:e,activeSub:t,activeId:n=null,entries:r,onPick:i,onRemove:a,onOpenNew:o}){let{pickRecent:s}=ye(),c=(0,P.useCallback)(e=>{if(i){i(e);return}s(e,r.find(t=>t.id===e)?.handle)},[i,r,s]);return(0,F.jsxs)(V,{children:[(0,F.jsxs)(H,{className:C(Te({variant:`ghost`}),`h-auto min-w-0 shrink max-w-40 flex-col items-start justify-center gap-0 py-1 sm:max-w-80`),children:[(0,F.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate font-heading text-sm font-semibold`,children:e??`No file`}),(0,F.jsx)(we,{"aria-hidden":`true`,className:`ml-auto shrink-0 opacity-60`})]}),t?(0,F.jsx)(`span`,{className:`w-full min-w-0 truncate text-left text-xs text-muted-foreground`,children:t}):null]}),(0,F.jsxs)(U,{className:`w-72 p-2`,children:[(0,F.jsx)(Se,{entries:r,activeId:n,onPick:c,onRemove:a}),(0,F.jsx)(K,{}),(0,F.jsx)(W,{onClick:()=>o?.(),children:`Load new file…`})]})]})}function Zr({open:e,entries:t,onSelect:n,onOpenChange:r}){let[i,a]=(0,P.useState)(``),o=(0,P.useRef)(null);(0,P.useEffect)(()=>{e||a(``)},[e]);let s=i.trim().toLowerCase(),c=s?t.filter(e=>e.label.toLowerCase().includes(s)||e.secondary.toLowerCase().includes(s)||String(e.executionId).includes(s)):t;function l(e){(o.current?.querySelectorAll(`button`)??[])[e]?.focus()}function u(e,t){e.key===`ArrowDown`?(e.preventDefault(),l(t+1)):e.key===`ArrowUp`&&(e.preventDefault(),l(t-1))}function d(e){e.key===`Enter`?c.length===1&&n(c[0].stageId):e.key===`ArrowDown`&&(e.preventDefault(),l(0))}return(0,F.jsx)(Jn,{open:e,onOpenChange:r,children:(0,F.jsxs)(Zn,{className:`flex max-h-[85vh] flex-col sm:max-w-xl`,children:[(0,F.jsxs)(Qn,{children:[(0,F.jsxs)(er,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(M,{"aria-hidden":`true`,className:`size-4 text-plan-aggregate`}),`Open plan graph`]}),(0,F.jsx)(tr,{children:`Choose which SQL execution's plan to open.`})]}),(0,F.jsx)(Dt,{autoFocus:!0,placeholder:`Filter executions…`,value:i,onChange:e=>a(e.target.value),onKeyDown:d}),c.length===0?(0,F.jsx)(`p`,{className:`px-1.5 py-1 text-sm text-muted-foreground`,children:`No matching executions`}):(0,F.jsx)(`ul`,{ref:o,className:`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto`,children:c.map((e,t)=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 cursor-pointer flex-col items-start gap-0.5 rounded-md px-1.5 py-1 text-left hover:bg-muted`,onClick:()=>n(e.stageId),onKeyDown:e=>u(e,t),children:[(0,F.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[e.impactBand!=null&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(he,{impactBand:e.impactBand}),(0,F.jsxs)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground`,children:[e.findingCount,` finding`,e.findingCount===1?``:`s`]})]}),(0,F.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.secondary})]}),(0,F.jsx)(`span`,{className:`w-full truncate text-xs text-muted-foreground`,children:e.label})]})},e.executionId))})]})})}var Qr={name:`sparkforensics`,version:`0.24.3`,description:`Zero-backend browser dashboard that parses Apache Spark event logs to diagnose performance bottlenecks: skew, spill, GC pressure, stragglers, cache utilization, and more.`,private:!0,type:`module`,workspaces:[`.`,`packages/*`],license:`MIT`,author:`Agustin Recoba`,repository:{type:`git`,url:`git+https://github.com/shuffle-works/sparkforensics.git`},bugs:{url:`https://github.com/shuffle-works/sparkforensics/issues`},homepage:`https://github.com/shuffle-works/sparkforensics#readme`,keywords:[`apache-spark`,`spark`,`spark-history-server`,`performance`,`diagnostics`,`observability`,`event-log`,`dashboard`,`query-plan`],engines:{node:`>=22.18.0 <23.0.0 || >=23.6.0`},scripts:{test:`vitest run`,"test:watch":`vitest`,"test:coverage":`vitest run --coverage`,"test:core":`npm run test:coverage --workspace packages/core`,"test:cli":`npm run test:coverage --workspace packages/cli`,"test:mcp":`npm run test:coverage --workspace packages/mcp`,"test:server":`npm test --workspace packages/server`,lint:`eslint .`,release:`node scripts/publish-packages.mjs`,"local-server":`node packages/server/index.js`,"capture-components":`node dev/component-capture/capture.mjs`,"update-docs":`node scripts/update-docs.mjs`,"doc-anchor-coverage":`node scripts/doc-anchor-coverage.js`,"split-detection-docs":`node scripts/split-detection-docs.mjs`,prepare:`git config core.hooksPath .githooks`,dev:`vite`,build:`npm run docs:build && vite build`,"build:export":`DOCS_MPA=1 npm run docs:build && vite build --config vite.export.config.ts`,preview:`vite preview`,"docs:dev":`node scripts/build-tuning-reference.mjs && vitepress dev docs-site`,"docs:build":`node scripts/build-tuning-reference.mjs && vitepress build docs-site`,"docs:preview":`vitepress preview docs-site`},devDependencies:{"@changesets/cli":`^3.0.3`,"@eslint/js":`^10.0.1`,"@tailwindcss/vite":`^4.3.3`,"@testing-library/jest-dom":`^7.0.1`,"@testing-library/react":`^16.3.3`,"@testing-library/user-event":`^14.6.7`,"@types/node":`^26.6.2`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@vitejs/plugin-react":`^5.2.0`,"@vitest/coverage-v8":`^5.0.1`,eslint:`^10.11.0`,"fake-indexeddb":`^6.2.5`,globals:`^17.12.0`,"js-yaml":`^5.4.2`,jsdom:`^30.1.1`,"markdown-it-footnote":`^4.0.0`,playwright:`^1.63.0`,shadcn:`^4.21.0`,tailwindcss:`^4.3.3`,typescript:`^7.0.2`,vite:`^8.3.0`,"vite-plugin-singlefile":`^2.3.3`,vitepress:`^1.6.4`,vitest:`^5.0.1`},dependencies:{"@base-ui/react":`^1.8.0`,"@dagrejs/dagre":`^3.1.1`,"@modelcontextprotocol/sdk":`^1.30.0`,"@sparkforensics/core":`*`,"@tanstack/react-table":`^9.2.4`,"@xyflow/react":`^12.11.6`,"class-variance-authority":`^0.7.1`,clsx:`^2.1.1`,"lucide-react":`^1.47.0`,react:`^19.3.0`,"react-dom":`^19.3.0`,"react-resizable-panels":`^4.13.2`,recharts:`^3.8.0`,sonner:`^2.0.8`,"tailwind-merge":`^3.7.0`,"tw-animate-css":`^1.4.0`,zod:`^4.6.5`,zustand:`^5.0.15`}};function $r({keys:e}){return(0,F.jsx)(`span`,{className:`flex shrink-0 items-center gap-1`,children:e.map((e,t)=>(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0?(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`or`}):null,(0,F.jsx)(`kbd`,{className:`rounded-md border border-border bg-muted px-1.5 py-0.5 font-mono text-xs font-medium text-foreground`,children:e})]},e))})}function $({keys:e,children:t}){return(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-1.5`,children:[(0,F.jsx)(`span`,{className:`text-sm text-foreground`,children:t}),(0,F.jsx)($r,{keys:e})]})}function ei({title:e,children:t}){return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`mb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:e}),(0,F.jsx)(`div`,{className:`divide-y divide-border/60`,children:t})]})}function ti({open:e,onOpenChange:t}){return(0,F.jsx)(Jn,{open:e,onOpenChange:t,children:(0,F.jsxs)(Zn,{className:`sm:max-w-md`,children:[(0,F.jsxs)(Qn,{children:[(0,F.jsx)(er,{children:`Keyboard shortcuts`}),(0,F.jsx)(tr,{children:`Everything below works from anywhere the board is loaded.`})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(ei,{title:`Navigation`,children:[(0,F.jsx)($,{keys:[`Tab`,`Shift+Tab`],children:`Move between controls`}),(0,F.jsx)($,{keys:[`Enter`,`Space`],children:`Activate the focused control, open a stage's details, or sort a column`}),(0,F.jsx)($,{keys:[`Esc`],children:`Close the open dialog, or leave a full-page view like Plan graph`})]}),(0,F.jsxs)(ei,{title:`Menus and lists`,children:[(0,F.jsx)($,{keys:[`↑`,`↓`],children:`Move between menu items or picker rows`}),(0,F.jsx)($,{keys:[`A–Z`,`0–9`],children:`Filter the Type and Stage dropdowns, and the plan execution picker, as you type`})]}),(0,F.jsx)(ei,{title:`Help`,children:(0,F.jsx)($,{keys:[`?`],children:`Open this list`})})]}),(0,F.jsxs)(`p`,{className:`text-center text-xs text-muted-foreground`,children:[`SparkForensics v`,Qr.version]})]})})}var ni=`Show confidence levels, evidence, and documentation links for each finding`;function ri(){let e=Ee()===`advanced`;return(0,F.jsx)(kt,{variant:`outline`,pressed:e,onPressedChange:e=>w.getState().setWidgetDensity(e?`advanced`:`basic`),className:`tap-target-comfortable aria-pressed:bg-primary aria-pressed:text-primary-foreground aria-pressed:hover:bg-[color-mix(in_oklch,var(--primary),var(--foreground)_5%)]`,title:ni,children:`Advanced view`})}function ii(){let e=Ee()===`advanced`;return(0,F.jsx)(G,{checked:e,onCheckedChange:e=>w.getState().setWidgetDensity(e?`advanced`:`basic`),title:ni,children:`Advanced view`})}var ai=`docs/`;function oi(e,t){return e===`warning`?`${t} warning${t===1?``:`s`}`:`${t} ${e}`}function si(e,t){return e.stageId!=null&&t.includes(e.stageId)?!0:e.stageIds?.some(e=>t.includes(e))??!1}function ci(e,t){let n=[];for(let[r,i]of e.sql){if(!i.planTree)continue;let a=Pe(r,e.stages),o=a.length>0?Math.min(...a):null;if(o==null)continue;let s=i.description,c=typeof s==`string`&&s.trim()?s:`SQL execution #${r}`,l=i.startTime,u=i.endTime,d=typeof l==`number`&&typeof u==`number`?j(u-l):null,f=t.filter(e=>si(e,a)),p=N(f)??null,m=f.length;n.push({executionId:r,stageId:o,label:c,secondary:d?`#${r} · ${d}`:`#${r}`,impactBand:p,findingCount:m})}return n.sort((e,t)=>{let n=e.impactBand?D[e.impactBand]:1/0,r=t.impactBand?D[t.impactBand]:1/0;return n===r?e.executionId-t.executionId:n-r}),n}function li({onLoadNew:e,recentEntries:t,activeFileId:n,onPickRecent:r,onRemoveRecent:i,sectionControls:a,leadingContent:o}){let s=E(e=>e.appModel.app),c=E(e=>e.catalog),l=E(e=>e.skippedLines),u=E(e=>e.exportMode),{theme:d,toggle:f}=Ke(),p=(0,P.useRef)(null),m=E(e=>e.comparison),h=qr(),g=E(e=>e.appModel),_=(0,P.useMemo)(()=>ci(g,c),[g,c]),[ee,v]=(0,P.useState)(!1),[te,y]=(0,P.useState)(!1);(0,P.useEffect)(()=>{function e(e){if(e.key!==`?`)return;let t=e.target,n=t?.tagName;n===`INPUT`||n===`TEXTAREA`||t?.isContentEditable||(e.preventDefault(),y(!0))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);function b(){if(_.length!==0){if(_.length===1){w.getState().openPlanGraph(_[0].stageId,{initialScope:`full`});return}v(!0)}}function ne(e){w.getState().openPlanGraph(e,{initialScope:`full`}),v(!1)}let re=s?.name||`Spark Application`,x=[s?.id,s?.sparkVersion?`Spark ${s.sparkVersion}`:null].filter(Boolean).join(` · `),S=N(c),ie=S?c.filter(e=>e.impactBand===S).length:0;return(0,F.jsxs)(`header`,{className:`sticky top-0 z-30 flex min-w-0 flex-wrap items-center gap-3 border-b border-border bg-background/95 px-4 py-2 backdrop-blur`,children:[a?null:(0,F.jsx)(`h1`,{className:`sr-only`,children:`SparkForensics`}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[!a&&!u?(0,F.jsx)(T,{variant:`ghost`,size:`icon`,className:`tap-target-comfortable shrink-0`,"aria-label":`New analysis`,title:`Start a new analysis`,onClick:e,children:(0,F.jsx)(ft,{"aria-hidden":`true`})}):null,u?(0,F.jsxs)(`div`,{className:`flex min-w-0 shrink flex-col items-start justify-center gap-0 py-1`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate font-heading text-sm font-semibold`,children:re}),x?(0,F.jsx)(`span`,{className:`w-full min-w-0 truncate text-left text-xs text-muted-foreground`,children:x}):null]}):(0,F.jsx)(Xr,{activeName:re,activeSub:x,activeId:n,entries:t,onPick:r,onRemove:i,onOpenNew:e}),l>0?(0,F.jsxs)(`div`,{className:`min-w-0 truncate text-xs text-warning`,children:[l,` line`,l===1?``:`s`,` skipped: malformed or invalid data`]}):null,o]}),a?(0,F.jsx)(`div`,{className:`flex min-w-0 shrink-0 flex-wrap items-center gap-3 max-sm:order-3 max-sm:w-full max-sm:shrink max-sm:gap-2`,children:a}):S?(0,F.jsx)($e,{label:oi(S,ie),impactBand:S,className:`shrink-0`}):(0,F.jsxs)(`span`,{className:C(`inline-flex shrink-0 items-center gap-1.5 rounded-full bg-clean/10 px-2 py-0.5 text-xs font-medium text-clean`),children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block size-2 shrink-0 rounded-full bg-clean`}),`No findings`]}),(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[!a&&m.baselineId&&!m.active?(0,F.jsx)(T,{variant:`ghost`,size:`sm`,className:`tap-target-comfortable`,onClick:()=>w.getState().setComparisonActive(!0),children:`← Back to comparison`}):null,(0,F.jsxs)(`div`,{className:`hidden items-center gap-1 sm:flex`,children:[a?null:(0,F.jsx)(Yr,{}),!a&&_.length>0?(0,F.jsxs)(T,{variant:`ghost`,size:`sm`,className:`tap-target-comfortable`,onClick:b,children:[(0,F.jsx)(M,{"aria-hidden":`true`,className:`text-plan-aggregate`}),`Plan graph`]}):null,a?null:(0,F.jsx)(ri,{}),(0,F.jsx)(T,{variant:`ghost`,size:`icon`,className:`tap-target-comfortable`,"aria-label":`Docs`,title:`Read the docs`,nativeButton:!1,render:(0,F.jsx)(`a`,{href:ai,target:`_blank`,rel:`noopener noreferrer`}),children:(0,F.jsx)(je,{"aria-hidden":`true`})}),(0,F.jsx)(T,{variant:`ghost`,size:`icon`,className:`tap-target-comfortable`,"aria-label":`Keyboard shortcuts`,title:`Keyboard shortcuts (?)`,onClick:()=>y(!0),children:(0,F.jsx)(mt,{"aria-hidden":`true`})}),(0,F.jsx)(T,{variant:`ghost`,size:`icon`,className:`tap-target-comfortable`,"aria-label":`Toggle theme`,"aria-pressed":d===`light`,title:`Toggle theme`,onClick:f,children:d===`dark`?(0,F.jsx)(Ae,{"aria-hidden":`true`}):(0,F.jsx)(me,{"aria-hidden":`true`})})]}),(0,F.jsxs)(V,{onOpenChange:(e,t)=>{!e&&t.reason===`outside-press`&&setTimeout(()=>{document.activeElement===document.body&&p.current?.focus()})},children:[(0,F.jsx)(H,{ref:p,className:`tap-target-comfortable inline-flex size-8 items-center justify-center rounded-lg hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 sm:hidden`,"aria-label":`More options`,children:(0,F.jsx)(ut,{"aria-hidden":`true`})}),(0,F.jsxs)(U,{align:`end`,children:[a?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Jr,{...h}),(0,F.jsx)(K,{})]}),!a&&_.length>0?(0,F.jsxs)(W,{onClick:b,children:[(0,F.jsx)(M,{"aria-hidden":`true`,className:`text-plan-aggregate`}),`Plan graph`]}):null,a?null:(0,F.jsx)(ii,{}),(0,F.jsx)(W,{nativeButton:!1,render:(0,F.jsx)(`a`,{href:ai,target:`_blank`,rel:`noopener noreferrer`}),children:`Docs`}),(0,F.jsx)(W,{onClick:()=>y(!0),children:`Keyboard shortcuts`}),(0,F.jsx)(W,{onClick:f,children:`Toggle theme`})]})]})]}),(0,F.jsx)(Zr,{open:ee,entries:_,onSelect:ne,onOpenChange:v}),(0,F.jsx)(ti,{open:te,onOpenChange:y})]})}function ui(e){let{pickRecent:t}=ye(),[n,r]=(0,P.useState)([]),i=(0,P.useCallback)(()=>{Oe().then(e=>r(e)).catch(()=>r([]))},[]);return(0,P.useEffect)(()=>{i()},[i,e]),{recentEntries:n,onPickRecent:(0,P.useCallback)(async e=>{let r=n.find(t=>t.id===e),a=await t(e,r?.handle);(a===`restored`||a===`gone`)&&i()},[n,t,i]),onRemoveRecent:(0,P.useCallback)(e=>{let t=n.find(t=>t.id===e);nt(e).catch(()=>{}).finally(i),t&&de(`Removed "${t.appName||t.name}" from recent files`,{action:{label:`Undo`,onClick:()=>{xe(t).catch(()=>{}).finally(i)}}})},[n,i])}}export{G as A,_t as B,Kt as C,Ot as D,Ft as E,Tt as F,it as H,Et as I,vt as L,H as M,St as N,Dt as O,B as P,ht as R,q as S,Gt as T,I as V,ln as _,Q as a,tn as b,$n as c,qn as d,Kn as f,Vn as g,Un as h,dr as i,U as j,V as k,Qn as l,Wn as m,li as n,Jn as o,Z as p,br as r,Zn as s,ui as t,er as u,en as v,Bt as w,sn as x,nn as y,L as z};