semiotic 3.8.9 → 3.9.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/README.md +83 -67
- package/agent-skill/semiotic-charts/SKILL.md +11 -2
- package/ai/behaviorContracts.cjs +33 -3
- package/ai/cli.js +53 -2
- package/ai/componentMetadata.cjs +15 -0
- package/ai/dist/mcp-server.js +1530 -611
- package/ai/examples.md +48 -42
- package/{CLAUDE.md → ai/reference.md} +43 -22
- package/ai/schema.json +10603 -986
- package/ai/surface-manifest.json +643 -2
- package/ai/system-prompt.md +83 -130
- package/dist/c-3BLJEQNG.min.js +1 -0
- package/dist/c-3KZD6AXJ.min.js +1 -0
- package/dist/c-4TWEX5HG.min.js +1 -0
- package/dist/c-52TEGIUJ.min.js +1 -0
- package/dist/c-5YCIX3VZ.min.js +1 -0
- package/dist/c-6FEKTA3U.min.js +1 -0
- package/dist/c-6O5EVOPH.min.js +1 -0
- package/dist/c-74HEEZGK.min.js +1 -0
- package/dist/c-AKAF6JAD.min.js +1 -0
- package/dist/c-BBKITSXB.min.js +1 -0
- package/dist/c-BWNB6USU.min.js +1 -0
- package/dist/c-C25ENHIK.min.js +1 -0
- package/dist/c-CDR5AO3R.min.js +1 -0
- package/dist/c-COHXCW3Q.min.js +1 -0
- package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
- package/dist/c-E3JFRRMI.min.js +1 -0
- package/dist/c-EBFPQHHO.min.js +1 -0
- package/dist/c-G36WS6LN.min.js +1 -0
- package/dist/c-GIKRQI4X.min.js +1 -0
- package/dist/c-GPYOFETM.min.js +1 -0
- package/dist/c-IDUHYYSI.min.js +1 -0
- package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
- package/dist/c-J5G56TUH.min.js +1 -0
- package/dist/c-JAZ73J32.min.js +1 -0
- package/dist/c-KG3NXHAL.min.js +1 -0
- package/dist/c-KII3PLZE.min.js +1 -0
- package/dist/c-LIXGXMNS.min.js +1 -0
- package/dist/c-LVEY6D6B.min.js +1 -0
- package/dist/c-M4Y3BHFR.min.js +1 -0
- package/dist/c-MAIICR2Z.min.js +1 -0
- package/dist/c-MG5DM6VE.min.js +1 -0
- package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
- package/dist/c-MT3WBK7M.min.js +1 -0
- package/dist/c-NY3JWV2K.min.js +1 -0
- package/dist/c-O6U6K4CW.min.js +1 -0
- package/dist/c-OCI56QF2.min.js +1 -0
- package/dist/c-OQ7M4AGV.min.js +1 -0
- package/dist/c-OXYMVK7Q.min.js +1 -0
- package/dist/c-PPWDL5ZI.min.js +1 -0
- package/dist/c-QHF5YON3.min.js +1 -0
- package/dist/c-RR3GO5SW.min.js +1 -0
- package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
- package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
- package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
- package/dist/c-SUILCHWU.min.js +1 -0
- package/dist/c-TZW3JGJ5.min.js +1 -0
- package/dist/c-US5ZFT6E.min.js +1 -0
- package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
- package/dist/c-UUKVD4WB.min.js +1 -0
- package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
- package/dist/c-W3CE4A4S.min.js +1 -0
- package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
- package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
- package/dist/c-YDAY2WFR.min.js +1 -0
- package/dist/c-ZOWWU34K.min.js +1 -0
- package/dist/components/AccessibleNavTree.d.ts +1 -1
- package/dist/components/CategoryColors.d.ts +1 -1
- package/dist/components/GradientLegend.d.ts +14 -0
- package/dist/components/Legend.d.ts +2 -7
- package/dist/components/LinkedCharts.d.ts +1 -1
- package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
- package/dist/components/ObservationReadout.d.ts +45 -0
- package/dist/components/ThemeProvider.d.ts +4 -4
- package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
- package/dist/components/Tooltip/Tooltip.d.ts +30 -5
- package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
- package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
- package/dist/components/ai/chartClinic.d.ts +2 -0
- package/dist/components/ai/deriveProfileFields.d.ts +40 -0
- package/dist/components/ai/evaluateChart.d.ts +85 -0
- package/dist/components/ai/fieldPolicy.d.ts +7 -0
- package/dist/components/ai/fieldRoles.d.ts +24 -0
- package/dist/components/ai/generativeChart.d.ts +18 -2
- package/dist/components/ai/inferIntent.d.ts +26 -2
- package/dist/components/ai/intents.d.ts +35 -0
- package/dist/components/ai/navigationTree.d.ts +2 -2
- package/dist/components/ai/observedSceneAudit.d.ts +2 -1
- package/dist/components/ai/profileData.d.ts +11 -0
- package/dist/components/ai/repairChartConfig.d.ts +2 -3
- package/dist/components/ai/semanticEvidence.d.ts +4 -0
- package/dist/components/ai/semanticViability.d.ts +11 -0
- package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
- package/dist/components/ai/streamingTypes.d.ts +4 -0
- package/dist/components/ai/suggestCharts.d.ts +5 -6
- package/dist/components/ai/suggestDashboard.d.ts +2 -3
- package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
- package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
- package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
- package/dist/components/ai/variantDiscovery.d.ts +3 -1
- package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
- package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
- package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
- package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
- package/dist/components/charts/index.d.ts +4 -3
- package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
- package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
- package/dist/components/charts/network/Treemap.d.ts +2 -1
- package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
- package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
- package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
- package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
- package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
- package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
- package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
- package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
- package/dist/components/charts/physics/chainReactionTypes.d.ts +5 -1
- package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
- package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
- package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
- package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
- package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
- package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
- package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
- package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
- package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
- package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +25 -12
- package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
- package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +15 -12
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +10 -7
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +35 -14
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +21 -14
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +20 -13
- package/dist/components/charts/realtime/aggregate.d.ts +4 -1
- package/dist/components/charts/realtime/eventTime.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
- package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
- package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
- package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
- package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
- package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
- package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
- package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
- package/dist/components/charts/shared/annotationRules.d.ts +1 -15
- package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
- package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
- package/dist/components/charts/shared/chartMode.d.ts +3 -2
- package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
- package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
- package/dist/components/charts/shared/gradient.d.ts +16 -0
- package/dist/components/charts/shared/hatchFill.d.ts +15 -0
- package/dist/components/charts/shared/hooks.d.ts +4 -4
- package/dist/components/charts/shared/legendUtils.d.ts +1 -0
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -1
- package/dist/components/charts/shared/styleRules.d.ts +9 -2
- package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
- package/dist/components/charts/shared/types.d.ts +18 -9
- package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
- package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
- package/dist/components/charts/value/types.d.ts +1 -1
- package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
- package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
- package/dist/components/charts/xy/BumpChart.d.ts +13 -73
- package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
- package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
- package/dist/components/charts/xy/LineChart.d.ts +2 -2
- package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
- package/dist/components/charts/xy/bumpData.d.ts +44 -0
- package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
- package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
- package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
- package/dist/components/legendLayout.d.ts +131 -4
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
- package/dist/components/realtime/types.d.ts +10 -1
- package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
- package/dist/components/recipes/directedReachability.d.ts +14 -0
- package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
- package/dist/components/recipes/gridObservatory.d.ts +1 -1
- package/dist/components/recipes/networkAnalysis.d.ts +1 -18
- package/dist/components/recipes/physics.d.ts +7 -4
- package/dist/components/recipes/processPhysics.d.ts +0 -1
- package/dist/components/recipes/waffle.d.ts +7 -4
- package/dist/components/semiotic-ai-core.d.ts +13 -4
- package/dist/components/semiotic-ai-observations.d.ts +3 -0
- package/dist/components/semiotic-ai.d.ts +16 -9
- package/dist/components/semiotic-client-shared.d.ts +10 -0
- package/dist/components/semiotic-experimental.d.ts +1 -1
- package/dist/components/semiotic-geo.d.ts +4 -1
- package/dist/components/semiotic-network.d.ts +7 -4
- package/dist/components/semiotic-ordinal.d.ts +4 -1
- package/dist/components/semiotic-physics.d.ts +11 -4
- package/dist/components/semiotic-realtime-core.d.ts +11 -4
- package/dist/components/semiotic-realtime-react.d.ts +4 -3
- package/dist/components/semiotic-realtime.d.ts +3 -1
- package/dist/components/semiotic-recipes-core.d.ts +7 -5
- package/dist/components/semiotic-server-edge.d.ts +3 -2
- package/dist/components/semiotic-server.d.ts +3 -2
- package/dist/components/semiotic-themes-core.d.ts +5 -48
- package/dist/components/semiotic-utils-core.d.ts +10 -5
- package/dist/components/semiotic-utils-react.d.ts +2 -0
- package/dist/components/semiotic-xy.d.ts +4 -1
- package/dist/components/semiotic.d.ts +68 -26
- package/dist/components/server/animatedGif.d.ts +1 -1
- package/dist/components/server/renderEvidence.d.ts +25 -2
- package/dist/components/server/renderToStaticSVG.d.ts +15 -7
- package/dist/components/server/serverChartConfigShared.d.ts +8 -1
- package/dist/components/server/serverChartConfigs.d.ts +1 -0
- package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
- package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
- package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
- package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
- package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
- package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
- package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
- package/dist/components/server/staticAnnotations.d.ts +28 -1
- package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticLegendMargin.d.ts +41 -0
- package/dist/components/server/staticOrdinal.d.ts +8 -2
- package/dist/components/server/staticPhysics.d.ts +13 -1
- package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
- package/dist/components/server/staticRawLegend.d.ts +15 -0
- package/dist/components/server/staticSVGChrome.d.ts +16 -55
- package/dist/components/server/staticXYAxes.d.ts +27 -0
- package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
- package/dist/components/server/staticXYGrid.d.ts +11 -0
- package/dist/components/server/themeResolver.d.ts +5 -1
- package/dist/components/store/ThemeStore.d.ts +2 -98
- package/dist/components/store/designTokens.d.ts +1 -1
- package/dist/components/store/themeCSSVariables.d.ts +10 -0
- package/dist/components/store/themeCore.d.ts +91 -0
- package/dist/components/store/themePresets.d.ts +81 -0
- package/dist/components/store/themeSerialization.d.ts +2 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
- package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +2 -0
- package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
- package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
- package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
- package/dist/components/stream/SVGChartTitle.d.ts +9 -0
- package/dist/components/stream/SVGOverlay.d.ts +1 -21
- package/dist/components/stream/SVGUnderlay.d.ts +24 -0
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
- package/dist/components/stream/StreamXYFrame.d.ts +1 -1
- package/dist/components/stream/accessibleDataRows.d.ts +11 -0
- package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
- package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
- package/dist/components/stream/axisTickUtils.d.ts +19 -0
- package/dist/components/stream/canvasBackground.d.ts +10 -0
- package/dist/components/stream/canvasSetup.d.ts +9 -0
- package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
- package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
- package/dist/components/stream/frameGraphics.d.ts +18 -0
- package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
- package/dist/components/stream/frameLegendOptions.d.ts +18 -0
- package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
- package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
- package/dist/components/stream/geoTypes.d.ts +10 -11
- package/dist/components/stream/hitTarget.d.ts +61 -2
- package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
- package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
- package/dist/components/stream/networkCustomLayout.d.ts +2 -2
- package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
- package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
- package/dist/components/stream/networkFramePaint.d.ts +7 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
- package/dist/components/stream/networkTypes.d.ts +30 -32
- package/dist/components/stream/normalizeXYData.d.ts +7 -0
- package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
- package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
- package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
- package/dist/components/stream/ordinalTypes.d.ts +10 -4
- package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
- package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
- package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
- package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
- package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +23 -4
- package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
- package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
- package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
- package/dist/components/stream/pipelineConfig.d.ts +6 -17
- package/dist/components/stream/pipelineDomainResolution.d.ts +1 -1
- package/dist/components/stream/renderBackend.d.ts +2 -0
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
- package/dist/components/stream/responsiveSize.d.ts +17 -0
- package/dist/components/stream/sceneCursor.d.ts +41 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
- package/dist/components/stream/types.d.ts +25 -12
- package/dist/components/stream/useCanvasFrameHost.d.ts +3 -1
- package/dist/components/stream/useFrame.d.ts +24 -1
- package/dist/components/stream/useResponsiveSize.d.ts +6 -1
- package/dist/components/stream/useStalenessCheck.d.ts +1 -1
- package/dist/components/stream/xyFrameAxisTypes.d.ts +15 -4
- package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
- package/dist/components/types/legendTypes.d.ts +6 -0
- package/dist/components/types/marginType.d.ts +7 -8
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +13 -4
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +16 -9
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1 -0
- package/dist/semiotic-client-glyph.module.min.js +2 -0
- package/dist/semiotic-client-responsive.module.min.js +2 -0
- package/dist/semiotic-client-shared.module.min.js +2 -0
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node.module.min.js +2 -0
- package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-experimental.d.ts +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +4 -1
- package/dist/semiotic-network.d.ts +7 -4
- package/dist/semiotic-ordinal.d.ts +4 -1
- package/dist/semiotic-physics.d.ts +11 -4
- package/dist/semiotic-realtime-core.d.ts +11 -4
- package/dist/semiotic-realtime-core.min.js +2 -1
- package/dist/semiotic-realtime-core.module.min.js +2 -1
- package/dist/semiotic-realtime-react.d.ts +4 -3
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-realtime.d.ts +3 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
- package/dist/semiotic-recipes-core.d.ts +7 -5
- package/dist/semiotic-recipes-core.min.js +9 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-recipes-react.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +7 -1
- package/dist/semiotic-recipes.module.min.js +2 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -0
- package/dist/semiotic-server-edge.d.ts +3 -2
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-server.d.ts +3 -2
- package/dist/semiotic-themes-core.d.ts +5 -48
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.min.js +1 -1
- package/dist/semiotic-themes-react.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +10 -5
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.d.ts +2 -0
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +2 -1
- package/dist/semiotic-utils.module.min.js +2 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -1
- package/dist/semiotic.d.ts +68 -26
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +53 -19
- package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
- package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
- package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
- package/dist/chunk-chunk-2X3FJCME.module.min.js +0 -1
- package/dist/chunk-chunk-2ZHHWZQM.module.min.js +0 -2
- package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
- package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
- package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
- package/dist/chunk-chunk-5ZON5NMV.module.min.js +0 -2
- package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
- package/dist/chunk-chunk-6S3YGYW7.module.min.js +0 -1
- package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
- package/dist/chunk-chunk-7C5EDZ3Z.module.min.js +0 -2
- package/dist/chunk-chunk-A3I4HBD5.module.min.js +0 -1
- package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
- package/dist/chunk-chunk-AFQHURLO.module.min.js +0 -2
- package/dist/chunk-chunk-DDB4TLQG.module.min.js +0 -2
- package/dist/chunk-chunk-DTH3SUOU.module.min.js +0 -2
- package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
- package/dist/chunk-chunk-DVCWU7MT.module.min.js +0 -2
- package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
- package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
- package/dist/chunk-chunk-FSIHAW6L.module.min.js +0 -2
- package/dist/chunk-chunk-G2RGVEYY.module.min.js +0 -2
- package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
- package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
- package/dist/chunk-chunk-HAJVODLO.module.min.js +0 -2
- package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
- package/dist/chunk-chunk-HIV7AW2V.module.min.js +0 -2
- package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
- package/dist/chunk-chunk-JZAMMSQQ.module.min.js +0 -2
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
- package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
- package/dist/chunk-chunk-MXMRXSCI.module.min.js +0 -2
- package/dist/chunk-chunk-MXVBXFKW.module.min.js +0 -2
- package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
- package/dist/chunk-chunk-OFAP623Y.module.min.js +0 -2
- package/dist/chunk-chunk-OHLRAEQZ.module.min.js +0 -2
- package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
- package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
- package/dist/chunk-chunk-PRNXOCYZ.module.min.js +0 -2
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
- package/dist/chunk-chunk-RLKZVJMQ.module.min.js +0 -2
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
- package/dist/chunk-chunk-SK2TQMG4.module.min.js +0 -2
- package/dist/chunk-chunk-SKLYXNYW.module.min.js +0 -2
- package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
- package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
- package/dist/chunk-chunk-U4NZCU5T.module.min.js +0 -2
- package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
- package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
- package/dist/chunk-chunk-VKL6DI43.module.min.js +0 -2
- package/dist/chunk-chunk-W62673ZE.module.min.js +0 -1
- package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
- package/dist/chunk-chunk-XCC25CZZ.module.min.js +0 -2
- package/dist/chunk-chunk-XECNOUZY.module.min.js +0 -2
- package/dist/chunk-chunk-XYZDTYAF.module.min.js +0 -2
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
- package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
- package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
- package/dist/test-utils/canvasMock.d.ts +0 -86
- package/dist/test-utils/capturedFrameProps.d.ts +0 -67
- package/dist/test-utils/frameMock.d.ts +0 -81
- package/dist/test-utils/ordinalFixtures.d.ts +0 -48
- /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
- /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
- /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
- /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{GeoCustomChart as e}from"./chunk-chunk-G2RGVEYY.module.min.js";import{VALIDATION_MAP as t,accessibilityCaveats as r,auditAccessibility as a,buildReaderGrounding as i,contrastRatio as n,diagnoseConfig as o,diagnoseTokenEncoding as s,formatAccessibilityAudit as c,normalizeTokenEncoding as l,suggestTokenEncoding as u,tokenTaskIntentToCapabilityIntents as d,validateProps as m}from"./chunk-chunk-5ZON5NMV.module.min.js";import{BUILT_IN_NUMERIC_CONTRACTS as p,auditData as h,formatDataAudit as y,profileNumericFields as f,registerNumericContracts as g,toDataAuditNotifications as b,unregisterNumericContracts as v}from"./chunk-chunk-2B3AIKUZ.module.min.js";import{BigNumber as w}from"./chunk-chunk-DTSNLGRK.module.min.js";import{AccessibleNavTree as k,ChartContainer as C,ChartGrid as x,ContextLayout as A,DetailsPanel as S,IntentMark as P,MobileAnnotationCalloutList as M,MobileChartContainer as D,SmallMultipleChart as T,auditMobileVisualization as F,createIndexedDBConversationArcSink as $,createLocalStorageConversationArcSink as j,createWebhookConversationArcSink as N,disableConversationArc as B,enableConversationArc as R,exportChart as z,formatMobileVisualizationAudit as _,getConversationArcStore as I,intentManifestFromRecipe as O,loadConversationArc as q,mobileVisualizationCaveats as H,recordAnnotationStatusChange as L,recordAudienceChange as G,registerConversationArcSink as E,replayConversationArc as V,subscribeToConversationArcChange as X,summarizeIntentManifest as K,useNavigationSync as U}from"./chunk-chunk-DDB4TLQG.module.min.js";import{MobileStandardControls as W,clampMobileRange as Q,useMobileRangeControls as Y,zoomMobileRange as Z}from"./chunk-chunk-UOQRPGPK.module.min.js";import{buildNavigationTree as J,buildRecipeNavigationTree as ee,communicativeActForIntent as te,configToJSX as re,copyConfig as ae,countNodes as ie,defineChartRecipe as ne,describeChart as oe,describeRecipeChart as se,deserializeSelections as ce,fieldForRole as le,flattenVisible as ue,fromConfig as de,fromURL as me,fromVegaLite as pe,getChartRecipe as he,getRecipeLayout as ye,getRegisteredRecipeCapabilities as fe,hasRegisteredRecipeCapabilities as ge,isJsonSafe as be,isRegisteredRecipeLayout as ve,listChartRecipes as we,recipeConfig as ke,recipeIntentId as Ce,recipeToChartCapability as xe,registerChartRecipe as Ae,registerRecipeLayout as Se,resolveChartRecipe as Pe,resolveCommunicativeAct as Me,resolveRecipeRoleField as De,serializeSelections as Te,toConfig as Fe,toURL as $e,unregisterChartRecipe as je,unregisterRecipeLayout as Ne,validateChartRecipe as Be}from"./chunk-chunk-XCC25CZZ.module.min.js";import{auditVisualizationControls as Re}from"./chunk-chunk-FQPKOAIH.module.min.js";import{AreaChart as ze,BubbleChart as _e,BumpChart as Ie,CandlestickChart as Oe,ConnectedScatterplot as qe,DEFAULT_QUADRANTS as He,DifferenceChart as Le,Heatmap as Ge,LineChart as Ee,MinimapChart as Ve,MultiAxisLineChart as Xe,QuadrantChart as Ke,Scatterplot as Ue,ScatterplotMatrix as We,StackedAreaChart as Qe,XYCustomChart as Ye,rankBumpData as Ze}from"./chunk-chunk-MXVBXFKW.module.min.js";import{BarChart as Je,BoxPlot as et,DonutChart as tt,DotPlot as rt,FunnelChart as at,GaugeChart as it,GroupedBarChart as nt,Histogram as ot,LikertChart as st,OrdinalCustomChart as ct,PieChart as lt,RidgelinePlot as ut,StackedBarChart as dt,SwarmPlot as mt,SwimlaneChart as pt,ViolinPlot as ht}from"./chunk-chunk-HAJVODLO.module.min.js";import"./chunk-chunk-YCQYG6J5.module.min.js";import{ChordDiagram as yt,CirclePack as ft,ForceDirectedGraph as gt,NetworkCustomChart as bt,OrbitDiagram as vt,ProcessSankey as wt,SankeyDiagram as kt,TreeDiagram as Ct,Treemap as xt}from"./chunk-chunk-SKLYXNYW.module.min.js";import"./chunk-chunk-G75OPF5N.module.min.js";import"./chunk-chunk-MXMRXSCI.module.min.js";import"./chunk-chunk-J5QD4RAM.module.min.js";import{RealtimeHeatmap as At,RealtimeHistogram as St,RealtimeLineChart as Pt,RealtimeSwarmChart as Mt,RealtimeWaterfallChart as Dt,TemporalHistogram as Tt}from"./chunk-chunk-RLKZVJMQ.module.min.js";import"./chunk-chunk-FSIHAW6L.module.min.js";import"./chunk-chunk-XECNOUZY.module.min.js";import"./chunk-chunk-6V5VQVCT.module.min.js";import"./chunk-chunk-U4NZCU5T.module.min.js";import"./chunk-chunk-VKL6DI43.module.min.js";import"./chunk-chunk-OFAP623Y.module.min.js";import"./chunk-chunk-DTH3SUOU.module.min.js";import"./chunk-chunk-PRNXOCYZ.module.min.js";import"./chunk-chunk-DVCWU7MT.module.min.js";import"./chunk-chunk-5UKL5W76.module.min.js";import"./chunk-chunk-NWIGA3UK.module.min.js";import{annotationFreshnessFor as Ft,applyAnnotationLifecycle as $t,applyAnnotationStatus as jt,computeAnnotationFreshness as Nt,currentTimestamp as Bt,filterAnnotationsByStatus as Rt,withCurrentProvenance as zt,withProvenance as _t}from"./chunk-chunk-XYZDTYAF.module.min.js";import{ChainReactionChart as It}from"./chunk-chunk-HIV7AW2V.module.min.js";import{CollisionSwarmChart as Ot,CrucibleChart as qt,EventDropChart as Ht,GaltonBoardChart as Lt,GauntletChart as Gt,PacketFlowChart as Et,ProcessFlowChart as Vt,UnitPileChart as Xt}from"./chunk-chunk-JZAMMSQQ.module.min.js";import{PhysicsCustomChart as Kt}from"./chunk-chunk-7C5EDZ3Z.module.min.js";import"./chunk-chunk-SIRIJ3DY.module.min.js";import"./chunk-chunk-EMO5NUGE.module.min.js";import"./chunk-chunk-SV4XAZ3Q.module.min.js";import"./chunk-chunk-OHLRAEQZ.module.min.js";import"./chunk-chunk-AFQHURLO.module.min.js";import{CategoryColorProvider as Ut,DEFAULT_LIFECYCLE_THRESHOLDS as Wt,LinkedCharts as Qt,MultiLineTooltip as Yt,annotationStableId as Zt,bandFromAge as Jt,extractAllRows as er,resolveResponsiveRules as tr,responsiveRuleMatches as rr,useBrushSelection as ar,useCategoryColors as ir,useChartObserver as nr,useFilteredData as or,useLinkedChartsActive as sr,useLinkedHover as cr,useSelection as lr,useSelectionActions as ur}from"./chunk-chunk-SK2TQMG4.module.min.js";import"./chunk-chunk-2NVFEB7P.module.min.js";import{ThemeProviderWrapper as dr,createStore as mr,useTheme as pr}from"./chunk-chunk-PMR47KRY.module.min.js";import"./chunk-chunk-KTWEBFMX.module.min.js";import"./chunk-chunk-ACLDBMRH.module.min.js";import"./chunk-chunk-YHNZCPOZ.module.min.js";var[hr,yr]=mr(e=>({tooltip:null,changeTooltip(t){e(()=>({tooltip:t}))}}));import{useCallback as fr,useMemo as gr,useRef as br,useState as vr}from"react";var wr=/^\d{4}[-/]\d{2}/,kr=/^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Cr(e){return"number"==typeof e?Number.isFinite(e)?"numeric":"unknown":e instanceof Date?"date":"string"==typeof e?wr.test(e)&&!Number.isNaN(Date.parse(e))?"date":kr.test(e)&&Number.isFinite(Number(e))?"numeric":"categorical":"boolean"==typeof e?"categorical":"unknown"}function xr(e){let t=1/0,r=-1/0;for(let a=0;e.length>a;a++){const i=e[a];t>i&&(t=i),i>r&&(r=i)}return{min:t,max:r}}function Ar(e){const t=e.length;if(0===t)return NaN;const r=t>>1;return t%2==0?(e[r-1]+e[r])/2:e[r]}function Sr(e,t={}){const{maxDistinct:r=10,sampleSize:a=5,keyScanRows:i=100}=t;if(!Array.isArray(e)||0===e.length)return{rowCount:0,fields:{},sample:[]};const n=new Set,o=Math.min(e.length,i);for(let t=0;o>t;t++){const r=e[t];if(r&&"object"==typeof r)for(const e of Object.keys(r))n.add(e)}const s={};for(const t of n){const a=[];for(let r=0;e.length>r;r++){const i=e[r]?.[t];null!=i&&a.push(i)}if(0===a.length){s[t]={type:"unknown"};continue}const i=Cr(a[0]);if("numeric"===i){const e=[];for(let t=0;a.length>t;t++){const r=Number(a[t]);Number.isFinite(r)&&e.push(r)}if(0===e.length){s[t]={type:"unknown"};continue}const{min:r,max:i}=xr(e);let n=0;for(let t=0;e.length>t;t++)n+=e[t];const o=[...e].sort((e,t)=>e-t);s[t]={type:"numeric",min:r,max:i,mean:n/e.length,median:Ar(o)}}else if("date"===i){const e=[];for(let t=0;a.length>t;t++){const r=a[t],i=r instanceof Date?r.getTime():Date.parse(r);Number.isFinite(i)&&e.push(i)}if(0===e.length){s[t]={type:"unknown"};continue}const{min:r,max:i}=xr(e);s[t]={type:"date",min:new Date(r).toISOString(),max:new Date(i).toISOString()}}else if("categorical"===i){const e=new Map;for(let t=0;a.length>t;t++){const r=a[t]+"";e.set(r,(e.get(r)??0)+1)}const i=[...e.entries()].sort((e,t)=>t[1]-e[1]).slice(0,r).map(([e,t])=>({value:e,count:t}));s[t]={type:"categorical",distinctCount:e.size,topValues:i,distinctValues:e.size>r?void 0:i.map(e=>e.value)}}else s[t]={type:"unknown"}}return{rowCount:e.length,fields:s,sample:e.slice(0,a)}}var Pr=/^(x|index|rank|order|step|sequence|year|quarter|qtr|fiscal|month|week|day|date|time|timestamp)$/i,Mr=/^(y|value|amount|total|count|revenue|sales|price|score|rate|population|measure)$/i,Dr=/(size|magnitude|volume|weight|count|amount)/i,Tr=/^(category|label|name|type|group|region|segment|kind|class)$/i,Fr=/^(series|group|type|category|segment|cohort|product)$/i,$r=new Set(["numeric"]),jr=new Set(["numeric","date"]),Nr=new Set(["numeric"]),Br=new Set(["date"]),Rr=new Set(["categorical","boolean"]);function zr(e){return"numeric"===e.type?"numeric":"date"===e.type?"date":"categorical"===e.type?"categorical":"unknown"}function _r(e,t){return t.test(e)?.2:0}function Ir(e,t){let r=null;for(let a=0;e.length>a;a++){const i=e[a]?.[t];if(null==i)continue;const n=i instanceof Date?i.getTime():Number(i);if(!Number.isFinite(n))return!1;if(null!==r&&r>n)return!1;r=n}return null!==r}function Or(e,t,r,a,i={}){const n=[];for(const[o,s]of Object.entries(e)){const e=zr(s);if(!r.has(e))continue;let c,l=.5;l+=_r(o,a),"categorical"===s.type&&(c=s.distinctCount,!c||2>c||c>12||(l+=.2),c&&c>50&&(l-=.2)),"numeric"===s.type&&Number.isFinite(s.min)&&Number.isFinite(s.max)&&s.max>s.min&&(l+=.1);const u={field:o,kind:e,quality:Math.max(0,Math.min(1,l)),distinctCount:c};!i.computeMonotonic||"numeric"!==e&&"date"!==e||(u.monotonic=Ir(t,o),u.monotonic&&(u.quality=Math.min(1,u.quality+.2))),n.push(u)}return n.sort((e,t)=>t.quality-e.quality),n}function qr(e,t){const r=new Set;for(let a=0;e.length>a;a++){const i=e[a]?.[t];null!=i&&r.add(i+"")}return r.size}var Hr=/^(source|from|origin|stage|currentstage|sourcestage|fromstage)$/i,Lr=/^(target|to|destination|nextstage|next|targetstage|tostage|destinationstage|status)$/i,Gr=/^(starttime|startedat|enteredat|startdate|start|timestamp|date|time)$/i,Er=/^(endtime|endedat|exitedat|completedat|finishtime|enddate|end)$/i,Vr=/^(value|weight|amount|count|magnitude|volume)$/i;function Xr(e,t){return e.find(e=>t.test(e))}function Kr(e,t={}){const r=Sr(e??[]),a=Array.isArray(e)?e:[],i=function(e){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=e;if("FeatureCollection"===t.type&&Array.isArray(t.features))return{hasHierarchy:!1,hasNetwork:!1,hasGeo:!0,geo:{features:t.features,points:Array.isArray(t.points)?t.points:void 0,flows:Array.isArray(t.flows)?t.flows:void 0}};if(Array.isArray(t.children))return{hasHierarchy:!0,hasNetwork:!1,hasGeo:!1,hierarchy:t};if(Array.isArray(t.nodes)&&(Array.isArray(t.edges)||Array.isArray(t.links)))return{hasHierarchy:!1,hasNetwork:!0,hasGeo:!1,network:{nodes:t.nodes,edges:t.edges??t.links}}}return{hasHierarchy:!1,hasNetwork:!1,hasGeo:!1}}(t.rawInput);if(!i.hasNetwork&&!i.hasHierarchy&&!i.hasGeo){const e=function(e){if(3>e.length)return null;const t=e[0];if(!t||"object"!=typeof t)return null;const r=Object.keys(t),a=Xr(r,Hr),i=Xr(r,Lr);if(!a||!i||a===i)return null;const n=Xr(r,Gr),o=Xr(r,Er),s=Xr(r,Vr),c=[];for(const t of e){if(!t)continue;const e=t[a],r=t[i];if(null==e||null==r)continue;const n=(e+"").trim(),o=(r+"").trim();n&&o&&n!==o&&c.push(t)}if(3>c.length)return null;const l=new Map,u=new Map,d=new Map;for(const e of c){const t=(e[a]+"").trim(),r=(e[i]+"").trim();l.has(t)||l.set(t,{id:t,label:t}),l.has(r)||l.set(r,{id:r,label:r});const c=`${t}->${r}`,m=s?Number(e[s]):1,p=Number.isFinite(m)?m:1;u.set(c,(u.get(c)??0)+p),d.has(c)||d.set(c,{source:t,target:r,...n?{startTime:e[n]}:{},...o?{endTime:e[o]}:{}})}const m=[];for(const[e,t]of d)m.push({...t,value:u.get(e)??1});return{nodes:Array.from(l.values()),edges:m}}(a);e&&(i.hasNetwork=!0,i.network=e)}const n=Or(r.fields,a,jr,Pr,{computeMonotonic:!0}),o=Or(r.fields,a,Nr,Mr),s=Or(r.fields,a,$r,Dr),c=Or(r.fields,a,Rr,Tr),l=Or(r.fields,a,Rr,Fr),u=Or(r.fields,a,Br,/(date|time|timestamp)/i,{computeMonotonic:!0}),d=u[0]?.field;let m=d,p=d?"time":"none";if(!m){const e=n.find(e=>Pr.test(e.field)&&"numeric"===e.kind);e&&(m=e.field,p="named")}const h=o.find(e=>e.field!==m)?.field;if(!m&&h){const e=Object.entries(r.fields).filter(([e,t])=>"numeric"===t.type).map(([e])=>e);2>e.length||(m=e.find(e=>e!==h),m&&(p="scatter"))}const y=s.find(e=>e.field!==m&&e.field!==h)?.field,g="time"===p||"named"===p,b=c.map(e=>e.field);let v,w;g?(w=t.seriesField??b[0],v=b.find(e=>e!==w)):(v=b[0],w=t.seriesField??b.find(e=>e!==v));const k=v?qr(a,v):void 0,C=w?qr(a,w):void 0,x=m?qr(a,m):void 0,A=!!m&&function(e,t){const r=new Set;for(let a=0;e.length>a;a++){const i=e[a]?.[t];if(null==i)continue;const n=i+"";if(r.has(n))return!0;r.add(n)}return!1}(a,m),S=n.find(e=>e.field===m)?.monotonic??!1,P=u.length>0;return{...r,data:a,numericFields:f(a,{quantiles:!1}),candidates:{x:n,y:o,size:s,category:c,series:l,time:u},primary:{x:m,y:h,size:y,category:v,series:w,time:d},categoryCount:k,seriesCount:C,uniqueXCount:x,hasRepeatedX:A,monotonicX:S,hasTimeAxis:P,hasHierarchy:i.hasHierarchy,hasNetwork:i.hasNetwork,hasGeo:i.hasGeo,xProvenance:p,network:i.network,hierarchy:i.hierarchy,geo:i.geo}}var Ur={rows:{tiny:3,small:25,medium:250,large:5e3},cardinality:{low:7,medium:25},fields:{narrow:3,typical:10}},Wr=["tiny","small","medium","large","huge"];function Qr(e){return{rows:{...Ur.rows,...e?.rows??{}},cardinality:{...Ur.cardinality,...e?.cardinality??{}},fields:{...Ur.fields,...e?.fields??{}}}}function Yr(e,t){if(!Number.isFinite(e)||0>e)return"tiny";const r=Qr(t?.thresholds).rows;return e>r.tiny?e>r.small?e>r.medium?e>r.large?"huge":"large":"medium":"small":"tiny"}function Zr(e,t){if(!Number.isFinite(e)||0>e)return"low";const r=Qr(t?.thresholds).cardinality;return e>r.low?e>r.medium?"high":"medium":"low"}function Jr(e,t){if(!Number.isFinite(e)||0>e)return"narrow";const r=Qr(t?.thresholds).fields;return e>r.narrow?e>r.typical?"wide":"typical":"narrow"}function ea(e,t){return Wr.indexOf(e)-Wr.indexOf(t)}function ta(e,t,r){if("number"==typeof e&&Number.isFinite(e))return e;if(void 0!==e){const t=Qr(r?.thresholds).rows;switch(e){case"tiny":return Math.max(1,Math.floor(t.tiny/2));case"small":return Math.floor((t.tiny+t.small)/2);case"medium":return Math.floor((t.small+t.medium)/2);case"large":return Math.floor((t.medium+t.large)/2);case"huge":return Math.floor(2*t.large)}}return t}function ra(e,t,r){if("number"==typeof e&&Number.isFinite(e))return e;if(void 0!==e){const t=Qr(r?.thresholds).cardinality;switch(e){case"low":return Math.max(1,Math.floor(t.low/2));case"medium":return Math.floor((t.low+t.medium)/2);case"high":return Math.floor(2*t.medium)}}return t}function aa(e,t){const r=e.rowCount??0,a=t?.rows,i=ta(a,r,t),n=Yr(i,t),o=Object.keys(e.fields??{}).length,s=t?.fields,c="number"==typeof s?s:"string"==typeof s?function(e,t){const r=Qr(t?.thresholds).fields;switch(e){case"narrow":return Math.max(1,Math.floor(r.narrow/2));case"typical":return Math.floor((r.narrow+r.typical)/2);case"wide":return Math.floor(2*r.typical)}}(s,t):o,l=Jr(c,t),u=e.primary.category,d=ra((u?t?.cardinality?.[u]:void 0)??t?.typicalCardinality,e.categoryCount,t);return{rows:i,rowBand:n,fields:c,fieldBand:l,typicalCardinality:d,cardinalityBand:void 0!==d?Zr(d,t):void 0,growth:t?.growth??"static",rowsSource:void 0!==a?"declared":"measured"}}var ia=2.5;function na(e,t,r,a,i){const n=[],o=[];let s=0,c=!1;if(e.scaleFit){const i=e.scaleFit(t,r,a);if(i&&(s+=Math.max(-2.5,Math.min(ia,i.delta??0)),i.reason&&n.push(i.reason),i.caveats))for(const e of i.caveats)o.push(e)}const l=a?.charts?.[e.component];if(l&&(l.minBand&&0>ea(r.rowBand,l.minBand)||l.maxBand&&ea(r.rowBand,l.maxBand)>0?c=!0:"number"==typeof l.bias?(s+=Math.max(-3,Math.min(3,l.bias)),l.reason&&n.push(`${a?.name?a.name+": ":""}${l.reason}`)):l.reason&&n.push(`${a?.name?a.name+": ":""}${l.reason}`)),i&&e.qualityFit){const r=e.qualityFit(t,i);if(r&&(s+=Math.max(-1,Math.min(1,r.delta??0)),r.reason&&n.push(r.reason),r.caveats))for(const e of r.caveats)o.push(e)}else if(i){const e=t.primary.y;if(e){const t=function(e,t){if(void 0===e)return;if("number"==typeof e)return e;const r=e[t];return"number"==typeof r?r:void 0}(i.completeness,e);void 0!==t&&.85>t&&o.push(`${e} is only ${Math.round(100*t)}% complete — expect gaps`)}}return{delta:s,reasons:n,caveats:o,excluded:c}}function oa(e){return(t,r)=>{let a=0;const i=[];let n;if(e.rows){const[t,o]=e.rows.sweetSpot;t>r.rows||r.rows>o?t>r.rows?(a-=Math.min(ia,.8*(0===t?1:(t-r.rows)/t)),void 0===e.rows.caveatBelow||r.rows>e.rows.caveatBelow||i.push(`only ${r.rows} rows — chart may feel sparse`)):(a-=Math.min(ia,.4*(0===o?1:(r.rows-o)/o)),void 0===e.rows.caveatAbove||e.rows.caveatAbove>r.rows||i.push(r.rows+" rows is past this chart's comfortable density")):(a+=.6,n=r.rows+" rows is in the sweet spot for this chart")}if(e.cardinality&&void 0!==r.typicalCardinality){const t=r.typicalCardinality,[n,o]=e.cardinality.sweetSpot;n>t||t>o?t>o&&(a-=Math.min(ia,.5*(0===o?1:(t-o)/o)),void 0===e.cardinality.caveatAbove||e.cardinality.caveatAbove>t||i.push(t+" distinct categories may overwhelm this chart")):a+=.4}return 0!==a||0!==i.length||n?{delta:a,reason:n,caveats:i}:null}}var sa={component:"LineChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:5,accuracy:4,precision:4},numericContracts:p.LineChart,fits:e=>{if(2>e.rowCount)return"needs at least 2 rows";if(!e.primary.x)return"needs a numeric or time x field";if(!e.primary.y)return"needs a numeric y field";const t=e.candidates.x.find(t=>t.field===e.primary.x)?.kind;return t&&"numeric"!==t&&"date"!==t?`x field "${e.primary.x}" is ${t}, LineChart needs numeric or time`:"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — given x looks like a scatter pattern, not a sequence"},intentScores:{trend:e=>"scatter"!==e.xProvenance||e.monotonicX?!e.uniqueXCount||4>e.uniqueXCount?3:!e.seriesCount||2>e.seriesCount?4:5:1,"compare-series":e=>"scatter"!==e.xProvenance||e.monotonicX?!e.seriesCount||2>e.seriesCount?1:e.seriesCount>8?2:4:1,"change-detection":e=>"scatter"!==e.xProvenance||e.monotonicX?4:1,"outlier-detection":2,correlation:2},caveats:e=>{const t=[];return!e.hasRepeatedX||e.seriesCount&&e.seriesCount>=2||t.push("x values repeat — consider aggregating or adding a series field"),e.seriesCount&&e.seriesCount>8&&t.push(e.seriesCount+" series may produce a spaghetti chart"),t},variants:[{key:"linear",label:"Linear trend",props:{curve:"linear",showPoints:!1},tags:["linear"]},{key:"smooth",label:"Smooth trend",description:"Monotone smoothing — emphasizes the shape over individual points.",props:{curve:"monotoneX",showPoints:!1},tags:["smooth","narrative"],intentDeltas:{trend:1,"outlier-detection":-2},rubricDeltas:{precision:-1},caveats:["smoothing hides individual outliers"]},{key:"stepped-with-points",label:"Discrete steps",description:"Step curve plus visible points — for state changes or discrete events.",props:{curve:"step",showPoints:!0,pointRadius:3},tags:["step","discrete"],intentDeltas:{"change-detection":1,trend:-1},rubricDeltas:{precision:1}},{key:"annotated-threshold",label:"With alert threshold",description:'A reference threshold or band turns the chart from a report into an alert — read it for breaches of the expected range. Pair with a provenanced annotation (e.g. from the data-quality bridge) and the chart\'s communicative act becomes "alerting".',props:{showGrid:!0,showPoints:!0},tags:["alert","annotated-threshold","monitoring"],intentDeltas:{"outlier-detection":2,"change-detection":1}}],buildProps:(e,t)=>{const r={data:e.data,xAccessor:e.primary.x,yAccessor:e.primary.y};return e.seriesCount&&e.seriesCount>=2&&e.primary.series&&(r.lineBy=e.primary.series,r.colorBy=e.primary.series),e.hasTimeAxis&&e.primary.x===e.primary.time&&(r.xScaleType="time"),{...r,...t?.props??{}}},scaleFit:oa({rows:{sweetSpot:[25,2e3],caveatBelow:4,caveatAbove:1e4}})},ca={component:"AreaChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:4,accuracy:3,precision:3},numericContracts:p.AreaChart,fits:e=>3>e.rowCount?"needs at least 3 rows":e.primary.x?e.primary.y?"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — given x looks like a scatter pattern, not a sequence":"needs a numeric y field":"needs a numeric or time x field",intentScores:{trend:e=>"scatter"!==e.xProvenance||e.monotonicX?e.seriesCount&&e.seriesCount>=2||!e.uniqueXCount||4>e.uniqueXCount?3:5:1,"change-detection":e=>"scatter"!==e.xProvenance||e.monotonicX?3:1},caveats:e=>{const t=[];return e.seriesCount&&e.seriesCount>=2&&e.primary.series&&t.push(`showing only the leading "${e.primary.series}" series — for multi-series comparison use LineChart or DifferenceChart`),t},variants:[{key:"smooth",label:"Smooth gradient",props:{curve:"monotoneX"},tags:["smooth","gradient","narrative"]},{key:"linear",label:"Linear",props:{curve:"linear",gradientFill:!1,areaOpacity:.5},tags:["linear"]},{key:"stepped",label:"Stepped",props:{curve:"stepAfter"},tags:["step"],intentDeltas:{"change-detection":1}},{key:"annotated-threshold",label:"With alert threshold",description:'A reference threshold or expected band turns the area into an alert — read for breaches. Pair with a provenanced annotation (e.g. from the data-quality bridge) and the communicative act becomes "alerting".',props:{showGrid:!0},tags:["alert","annotated-threshold","monitoring"],intentDeltas:{"outlier-detection":2,"change-detection":1}}],buildProps:(e,t)=>{let r=e.data;if(e.seriesCount&&e.seriesCount>=2&&e.primary.series){const t=e.primary.series,a=e.primary.y,i=new Map;for(const r of e.data){const e=r[t];if(null==e||""===e)continue;const n=Number(r[a]);i.set(e,(i.get(e)??0)+(Number.isFinite(n)?n:0))}let n,o=-1/0;for(const[e,t]of i)t>o&&(o=t,n=e);null!=n&&i.size>0&&(r=e.data.filter(e=>e[t]===n))}const a={data:r,xAccessor:e.primary.x,yAccessor:e.primary.y,gradientFill:{stops:[{offset:0,opacity:.8},{offset:1,opacity:.05}]},areaOpacity:.55};return e.hasTimeAxis&&e.primary.x===e.primary.time&&(a.xScaleType="time"),{...a,...t?.props??{}}},scaleFit:oa({rows:{sweetSpot:[6,200],caveatAbove:2e3}})},la={component:"BumpChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:p.BumpChart,fits:e=>{if(4>e.rowCount)return"needs at least 4 rows";if(!e.primary.series||2>(e.seriesCount??0))return"needs a series field with at least 2 series to rank against each other";if(!e.primary.y)return"needs a numeric value to rank by";const t=!(!e.primary.x&&!e.primary.time);return t||e.primary.category?2>(t?e.uniqueXCount??0:e.categoryCount??0)?"needs at least 2 ranking columns to show rank movement":null:"needs an ordered x (time or sequence) or a categorical ranking column"},intentScores:{rank:e=>{if(!e.seriesCount||2>e.seriesCount)return 1;const t=!(!e.primary.x&&!e.primary.time);return 2>(t?e.uniqueXCount??0:e.categoryCount??0)?2:e.seriesCount>12?3:t?5:4},"compare-series":e=>e.seriesCount&&e.seriesCount>=2?2:1,"change-detection":e=>(e.primary.x||e.primary.time)&&e.seriesCount&&e.seriesCount>=2?3:1,trend:e=>e.primary.time||e.primary.x&&("scatter"!==e.xProvenance||e.monotonicX)?2:0},caveats:e=>{const t=[];return e.seriesCount&&e.seriesCount>12&&t.push(e.seriesCount+" series will cross into a hard-to-follow tangle — use highlightTop to foreground the leaders"),t.push("rank position hides absolute magnitude — use ribbon to also encode value, or pair with a value chart"),t},variants:[{key:"ribbon",label:"Magnitude ribbons",description:"Encodes the ranked value as ribbon width, so the chart shows both order and magnitude instead of order alone.",props:{ribbon:!0},tags:["ribbon","magnitude"],rubricDeltas:{precision:1}}],buildProps:(e,t)=>{const r={data:e.data,xAccessor:e.primary.x??e.primary.time??e.primary.category,yAccessor:e.primary.y,lineBy:e.primary.series};return e.seriesCount&&e.seriesCount>6&&(r.highlightTop=5),{...r,...t?.props??{}}},scaleFit:oa({rows:{sweetSpot:[8,200],caveatBelow:4,caveatAbove:1500}})},ua={component:"StackedAreaChart",family:"time-series",importPath:"semiotic/xy",numericContracts:p.StackedAreaChart,rubric:{familiarity:4,accuracy:3,precision:3},fits:e=>4>e.rowCount?"needs at least 4 rows":e.primary.x?e.primary.y?!e.seriesCount||2>e.seriesCount?"needs 2+ stack groups (series field)":e.seriesCount>10?e.seriesCount+" series is too many to stack legibly":"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — stacking only makes sense across a sequence":"needs a numeric y field":"needs an ordered x field",intentScores:{"composition-over-time":5,"part-to-whole":e=>e.hasTimeAxis?4:3,trend:3,"compare-series":2},caveats:()=>["readability of individual layers degrades below the baseline"],variants:[{key:"baseline-zero",label:"Zero baseline",props:{baseline:"zero",stackOrder:"key"},tags:["zero-baseline"]},{key:"streamgraph",label:"Streamgraph",description:"Wiggle baseline + inside-out ordering — emphasizes momentum over precise totals.",props:{baseline:"wiggle",stackOrder:"insideOut",showLine:!1},tags:["streamgraph","narrative"],intentDeltas:{"composition-over-time":0,trend:1,"part-to-whole":-2},rubricDeltas:{accuracy:-1,precision:-1},caveats:["streamgraph hides absolute totals; precise reads not possible"]},{key:"centered",label:"Centered baseline",props:{baseline:"silhouette",stackOrder:"insideOut"},tags:["silhouette"],intentDeltas:{"part-to-whole":-1}}],buildProps:(e,t)=>{const r={data:e.data,xAccessor:e.primary.x,yAccessor:e.primary.y,areaBy:e.primary.series,colorBy:e.primary.series};return e.hasTimeAxis&&e.primary.x===e.primary.time&&(r.xScaleType="time"),{...r,...t?.props??{}}},scaleFit:oa({rows:{sweetSpot:[30,1500],caveatBelow:12,caveatAbove:1e4}})},da={component:"Scatterplot",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:4,accuracy:5,precision:5},numericContracts:p.Scatterplot,fits:e=>{if(3>e.rowCount)return"needs at least 3 rows";if(!e.primary.x)return"needs a numeric x field";if(!e.primary.y)return"needs a numeric y field";const t=e.candidates.x.find(t=>t.field===e.primary.x)?.kind;return"date"===t?null:t&&"numeric"!==t?`x field "${e.primary.x}" is ${t}, Scatterplot needs numeric`:null},intentScores:{correlation:e=>{const t="time"===e.xProvenance||"named"===e.xProvenance?e.primary.x:e.primary.time,r=t?e.candidates.y.filter(e=>e.field!==t).map(e=>e.field):[];return t&&r.length>=2||e.primary.size?4:5},"outlier-detection":5,distribution:3,"compare-series":e=>!e.seriesCount||2>e.seriesCount||e.seriesCount>6?1:3,rank:1},variants:[{key:"points",label:"Points only",props:{},tags:["points"]},{key:"with-trend",label:"Points with regression line",props:{regression:"linear"},tags:["regression","trend"],intentDeltas:{correlation:0,trend:1}}],buildProps:(e,t)=>{const r={data:e.data},a="time"===e.xProvenance||"named"===e.xProvenance?e.primary.x:void 0,i=a?e.candidates.y.filter(e=>e.field!==a).map(e=>e.field):[];return a&&i.length>=2?(r.xAccessor=i[0],r.yAccessor=i[1]):(r.xAccessor=e.primary.x,r.yAccessor=e.primary.y,e.primary.size&&(r.sizeBy=e.primary.size)),e.primary.series&&e.seriesCount&&6>=e.seriesCount&&(r.colorBy=e.primary.series),{...r,...t?.props??{}}},scaleFit:oa({rows:{sweetSpot:[50,5e3],caveatBelow:20,caveatAbove:1e4}})},ma={component:"ConnectedScatterplot",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:p.ConnectedScatterplot,fits:e=>4>e.rowCount?"needs at least 4 ordered points":e.primary.x?e.primary.y?e.monotonicX||e.hasTimeAxis?null:"needs an ordered x sequence":"needs a y field":"needs an x field",intentScores:{trend:3,correlation:e=>{const t="time"===e.xProvenance||"named"===e.xProvenance?e.primary.x:e.primary.time,r=t?e.candidates.y.filter(e=>e.field!==t).map(e=>e.field):[];return t&&r.length>=2?5:4},"change-detection":3},caveats:()=>["readers can confuse path direction without explicit start/end markers"],buildProps:e=>{const t={data:e.data},r="time"===e.xProvenance||"named"===e.xProvenance?e.primary.x:e.primary.time,a=r?e.candidates.y.filter(e=>e.field!==r).map(e=>e.field):[];return r&&a.length>=2?(t.xAccessor=a[0],t.yAccessor=a[1],t.orderAccessor=r):(t.xAccessor=e.primary.x,t.yAccessor=e.primary.y,t.orderAccessor=e.primary.time??e.primary.x),e.primary.series&&6>=(e.seriesCount??0)&&(t.colorBy=e.primary.series),t}},pa={component:"BubbleChart",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:p.BubbleChart,fits:e=>4>e.rowCount?"needs at least 4 points":e.primary.x?e.primary.y?e.primary.size?null:"needs a third numeric measure for bubble size":"needs a numeric y field":"needs a numeric x field",intentScores:{correlation:5,"compare-categories":3,"outlier-detection":4},caveats:()=>["bubble area is harder to compare than length — large dynamic ranges distort"],buildProps:e=>({data:e.data,xAccessor:e.primary.x,yAccessor:e.primary.y,sizeBy:e.primary.size,...e.primary.series&&6>=(e.seriesCount??0)?{colorBy:e.primary.series}:{}}),scaleFit:oa({rows:{sweetSpot:[10,500],caveatAbove:1500}})},ha={component:"QuadrantChart",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:p.QuadrantChart,fits:e=>4>e.rowCount?"needs at least 4 points":e.primary.x?e.primary.y?null:"needs a numeric y field":"needs a numeric x field",intentScores:{"compare-categories":2,correlation:3,"outlier-detection":3},buildProps:e=>{const t=e.primary.x,r=e.primary.y,a=e.fields[t],i=e.fields[r],n="numeric"===a?.type?a.median:void 0,o="numeric"===i?.type?i.median:void 0;return{data:e.data,xAccessor:t,yAccessor:r,...void 0!==n?{xCenter:n}:{},...void 0!==o?{yCenter:o}:{},...e.primary.series&&6>=(e.seriesCount??0)?{colorBy:e.primary.series}:{},quadrants:{topLeft:{...He.topLeft},topRight:{...He.topRight},bottomLeft:{...He.bottomLeft},bottomRight:{...He.bottomRight}}}}},ya={component:"MultiAxisLineChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:3,precision:3},fits:e=>4>e.rowCount?"needs at least 4 rows":e.primary.x?2>Object.entries(e.fields).filter(([t,r])=>"numeric"===r.type&&t!==e.primary.x).map(([e])=>e).length?"needs at least 2 numeric measures":"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — multi-axis lines need a shared sequence":"needs an x field",intentScores:{"compare-series":4,trend:3,correlation:3},caveats:()=>["dual axes can mislead — only use when measures share interpretation"],buildProps:e=>{const t=Object.entries(e.fields).filter(([t,r])=>"numeric"===r.type&&t!==e.primary.x).slice(0,2).map(([e])=>({yAccessor:e,label:e}));return{data:e.data,xAccessor:e.primary.x,series:t}}},fa={component:"MinimapChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:4,accuracy:4,precision:4},numericContracts:p.MinimapChart,fits:e=>30>e.rowCount?"minimap pays off only on long sequences (30+ rows)":e.primary.x?e.primary.y?"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — minimap previews a sequence":"needs a numeric y field":"needs an ordered x field",intentScores:{trend:4,"change-detection":4,"outlier-detection":3},buildProps:e=>({data:e.data,xAccessor:e.primary.x,yAccessor:e.primary.y,...e.hasTimeAxis&&e.primary.x===e.primary.time?{xScaleType:"time"}:{}})},ga={component:"DifferenceChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:p.DifferenceChart,fits:e=>4>e.rowCount?"needs at least 4 rows":e.primary.x?e.primary.series?!e.seriesCount||2>e.seriesCount?`needs 2+ series (got ${e.seriesCount??0})`:e.primary.y?"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — given x looks like a scatter pattern, not a sequence":"needs a numeric y field":"needs a series field with at least two groups":"needs an x field (numeric or time)",intentScores:{"compare-series":e=>2===e.seriesCount?5:3,"change-detection":4,trend:3},caveats:e=>{const t=[];return e.seriesCount&&e.seriesCount>2&&t.push(`showing the top 2 of ${e.seriesCount} series — for full multi-series comparison use LineChart`),t},buildProps:e=>{const t=e.primary.x,r=e.primary.y,a=e.primary.series,i=e=>null!=e&&(e+"").length>0,n=new Map;for(const t of e.data){const e=t[a];if(!i(e))continue;const o=e+"",s=Number(t[r]);n.set(o,(n.get(o)??0)+(Number.isFinite(s)?s:0))}const o=[...n.entries()].sort((e,t)=>t[1]-e[1]),s=o[0]?.[0],c=o[1]?.[0],l=e=>e instanceof Date?e.getTime():e,u=new Map;for(const n of e.data){const e=n[a];if(!i(e))continue;const o=e+"";if(o!==s&&o!==c)continue;const d=n[t],m=n[r],p=l(d);let h=u.get(p);h||(h={[t]:d},u.set(p,h)),o===s?h.a=m:o===c&&(h.b=m)}return{data:Array.from(u.values()).filter(e=>null!=e.a&&null!=e.b),xAccessor:t,seriesAAccessor:"a",seriesBAccessor:"b",seriesALabel:s,seriesBLabel:c}}},ba={component:"CandlestickChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:p.CandlestickChart,fits:e=>{if(4>e.rowCount)return"needs at least 4 rows";if(!e.primary.x)return"needs an x field (typically date)";const t=new Set(Object.keys(e.fields).map(e=>e.toLowerCase())),r=t.has("high"),a=t.has("low");return r&&a?null:"needs at minimum high/low fields (open/close optional)"},intentScores:{"change-detection":4,trend:3,"outlier-detection":3},buildProps:e=>{const t=Object.keys(e.fields),r=e=>t.find(t=>t.toLowerCase()===e);return{data:e.data,xAccessor:e.primary.x,highAccessor:r("high"),lowAccessor:r("low"),openAccessor:r("open"),closeAccessor:r("close")}}},va={component:"Heatmap",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:p.Heatmap,fits:e=>{if(4>e.rowCount)return"needs at least 4 cells";if(!e.primary.y)return"needs a numeric value to encode in cell color";const t=e.candidates.category.length;return t>=2||t>=1&&e.hasTimeAxis?(e.uniqueXCount??0)>50?"too many x cells for a legible heatmap":null:"needs two categorical-or-time dimensions for the axes"},intentScores:{correlation:3,distribution:2,"compare-categories":e=>2>e.candidates.category.length?1:4,"composition-over-time":e=>e.hasTimeAxis&&e.candidates.category.length>=1?4:1},caveats:e=>{const t=[];return(e.uniqueXCount??0)>30&&t.push("many x values — cells will be narrow"),t},variants:[{key:"default",label:"Sequential color",props:{},tags:["sequential"]},{key:"show-values",label:"With cell labels",props:{showValues:!0},tags:["labeled"],intentDeltas:{"compare-categories":1},rubricDeltas:{precision:1},caveats:["cell labels crowd dense matrices"]}],buildProps:(e,t)=>{const r=e.candidates.category.map(e=>e.field),a=e.primary.time??r[0],i=r.find(e=>e!==a)??r[0]??e.primary.series;return{data:e.data,xAccessor:a,yAccessor:i,valueAccessor:e.primary.y,...t?.props??{}}},scaleFit:oa({rows:{sweetSpot:[100,1e4],caveatBelow:25,caveatAbove:5e4}})},wa=/(^|[^a-z])(date|time|timestamp|month|week|day|year|quarter|qtr|hour|minute)(?=[^a-z]|$)/i,ka=/^(jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec|january|february|march|april|june|july|august|september|october|november|december|mon|tue|wed|thu|fri|sat|sun|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i,Ca=/^(\d{4}(-\d{1,2}(-\d{1,2})?)?|q[1-4]|week\s*\d+|wk\s*\d+|\d{1,2}:\d{2})$/i,xa={component:"BarChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:5,accuracy:5,precision:4},numericContracts:p.BarChart,fits:e=>e.primary.category?e.primary.y?1>(e.categoryCount??0)?"needs at least 1 category":(e.categoryCount??0)>50?"too many categories — consider aggregating or use a different chart":null:"needs a numeric value field":"needs a category field",intentScores:{"compare-categories":e=>e.categoryCount?2>e.candidates.category.length?10>e.rowCount/e.categoryCount?5:2:3:0,rank:5,"part-to-whole":e=>(e.categoryCount??0)>8?2:3,distribution:1},caveats:e=>{const t=[];return function(e){const t=e.primary.category;if(!t)return!1;const r=t.replace(/([a-z])([A-Z])/g,"$1 $2");if(wa.test(r))return!0;const a=e.data;if(!a||0===a.length)return!1;let i=0,n=0;for(const e of a){const r=e[t];if(null==r)continue;n++;const a=(r+"").trim();(ka.test(a)||Ca.test(a))&&i++}return n>0&&i/n>=.6}(e)&&t.push("category axis looks like time bins — for a time series, supply real dates and use LineChart/AreaChart (reads trend, scales the time axis); for streaming counts use a temporal histogram"),t},variants:[{key:"sorted-desc",label:"Ranked",props:{sort:"desc"},tags:["sorted","ranked"],intentDeltas:{rank:0,"compare-categories":0}},{key:"source-order",label:"Source order",props:{sort:!1},tags:["source-order"],intentDeltas:{rank:-2}},{key:"horizontal",label:"Horizontal bars",props:{orientation:"horizontal",sort:"desc"},tags:["horizontal","ranked"],intentDeltas:{rank:1},rubricDeltas:{precision:1}},{key:"annotated-threshold",label:"With alert threshold",description:'A target/threshold reference turns the bars into an alert — read for which categories breach. Pair with a provenanced annotation (e.g. from the data-quality bridge) and the communicative act becomes "alerting".',props:{showGrid:!0},tags:["alert","annotated-threshold","monitoring"],intentDeltas:{"outlier-detection":2}}],buildProps:(e,t)=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,...t?.props??{}}),scaleFit:oa({cardinality:{sweetSpot:[3,15],caveatAbove:25},rows:{sweetSpot:[3,200]}})},Aa={component:"GroupedBarChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:5,precision:4},numericContracts:p.GroupedBarChart,fits:e=>e.primary.category?e.primary.y?e.primary.series?2>(e.seriesCount??0)?"needs 2+ groups":(e.seriesCount??0)>6?e.seriesCount+" groups is too many for grouped bars":(e.categoryCount??0)>25?"too many categories for grouped bars":null:"needs a series field to group by":"needs a numeric value field":"needs a category field",intentScores:{"compare-categories":5,"compare-series":4,rank:3},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,groupBy:e.primary.series,colorBy:e.primary.series})},Sa={component:"StackedBarChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:4,precision:3},numericContracts:p.StackedBarChart,fits:e=>e.primary.category?e.primary.y?e.primary.series?2>(e.seriesCount??0)?"needs 2+ stack groups":(e.seriesCount??0)>8?e.seriesCount+" stacked groups is too many":null:"needs a series field to stack by":"needs a numeric value field":"needs a category field",intentScores:{"part-to-whole":4,"compare-categories":4,"composition-over-time":e=>e.hasTimeAxis?3:1,"compare-series":2},caveats:()=>["only the bottom segment shares a baseline; others are harder to compare across categories"],variants:[{key:"absolute",label:"Absolute stacks",props:{normalize:!1},tags:["absolute"]},{key:"normalized",label:"100% stacked",description:"Each bar normalized to 1 — emphasizes composition, hides totals.",props:{normalize:!0},tags:["normalized","part-to-whole"],intentDeltas:{"part-to-whole":1,"compare-categories":-1},caveats:["absolute magnitudes are no longer comparable across bars"]}],buildProps:(e,t)=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,stackBy:e.primary.series,colorBy:e.primary.series,...t?.props??{}})},Pa={component:"DotPlot",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:5,precision:5},numericContracts:p.DotPlot,fits:e=>e.primary.category?e.primary.y?(e.categoryCount??0)>30?"too many categories for a dot plot":null:"needs a numeric value field":"needs a category field",intentScores:{"compare-categories":e=>e.categoryCount?10>e.rowCount/e.categoryCount?5:3:0,rank:5,"outlier-detection":3},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y}),scaleFit:oa({cardinality:{sweetSpot:[10,30],caveatAbove:40},rows:{sweetSpot:[5,300]}})},Ma={component:"PieChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:5,accuracy:3,precision:2},numericContracts:p.PieChart,fits:e=>{if(!e.primary.category)return"needs a category field";if(!e.primary.y)return"needs a numeric value field";const t=e.categoryCount??0;return 2>t?"needs 2+ categories":t>8?t+" slices is too many for a pie chart":null},intentScores:{"part-to-whole":4,"compare-categories":2,rank:1},caveats:()=>["angle comparisons are less accurate than length — prefer a bar chart unless part-to-whole is the explicit message"],variants:[{key:"pie",label:"Pie",props:{},tags:["pie"]}],buildProps:(e,t)=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,...t?.props??{}}),scaleFit:oa({cardinality:{sweetSpot:[2,5],caveatAbove:6}})},Da={component:"DonutChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:3,precision:2},numericContracts:p.DonutChart,fits:e=>{if(!e.primary.category)return"needs a category field";if(!e.primary.y)return"needs a numeric value field";const t=e.categoryCount??0;return 2>t?"needs 2+ categories":t>8?t+" slices is too many for a donut":null},intentScores:{"part-to-whole":4,"compare-categories":2},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,innerRadius:40})},Ta=/(stage|step|funnel|status|outcome|phase)/i,Fa={component:"FunnelChart",family:"flow",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:3,precision:3},numericContracts:p.FunnelChart,fits:e=>e.primary.y?Object.keys(e.fields).find(e=>Ta.test(e))?null:"needs a stage/step/funnel-named field":"needs a numeric value field",intentScores:{flow:4,rank:3,"part-to-whole":2},caveats:()=>["readers infer conversion drop-off — make sure rows actually represent sequential stages"],buildProps:e=>{const t=Object.keys(e.fields).find(e=>Ta.test(e));return{data:e.data,stepAccessor:t,valueAccessor:e.primary.y,...e.primary.category&&e.primary.category!==t?{categoryAccessor:e.primary.category}:{}}}},$a={component:"GaugeChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:2,precision:2},fits:e=>e.rowCount>1?"GaugeChart shows a single value — provide a 1-row dataset or use BarChart":e.primary.y?null:"needs a numeric value",intentScores:{"compare-categories":1,rank:1,"part-to-whole":e=>1===e.rowCount?5:1},caveats:()=>["gauges only show a single value; consider a stat card or bar instead for comparison"],buildProps:e=>{const t=e.primary.y,r=e.data[0],a=r?Number(r[t]):0,i=e.fields[t],n="numeric"===i?.type?i.max:100;return{value:Number.isFinite(a)?a:0,min:0,max:n}},scaleFit:(e,t)=>"tiny"===t.rowBand?{delta:.6,reason:"designed for single-value displays"}:null},ja=/(rating|score|likert|satisfaction|nps|agree|sentiment|level)/i,Na={component:"LikertChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:4,precision:3},fits:e=>e.primary.category?e.primary.y?Object.keys(e.fields).find(e=>ja.test(e))?null:"needs an ordinal rating/level field (rating, score, level...)":"needs a numeric rating/count field":"needs a category (question) field",intentScores:{"compare-categories":4,distribution:3,"part-to-whole":3},buildProps:e=>{const t=Object.keys(e.fields).find(e=>ja.test(e));return{data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,levelAccessor:t,levels:["Very Low","Low","Neutral","High","Very High"]}}},Ba={component:"SwimlaneChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:4,precision:4},fits:e=>e.primary.category?e.primary.series?e.primary.y?2>(e.categoryCount??0)?"needs 2+ categories":null:"needs a numeric value field":"needs a sub-category (lane) field":"needs a category field",intentScores:{"compare-categories":4,"composition-over-time":e=>e.hasTimeAxis?3:1,"compare-series":3},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,subcategoryAccessor:e.primary.series,valueAccessor:e.primary.y,colorBy:e.primary.series})},Ra={component:"Histogram",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:4,precision:3},numericContracts:p.Histogram,fits:e=>{if(10>e.rowCount)return"histograms need at least ~10 observations";if(!e.primary.y)return"needs a numeric field to bin";const t=e.primary.y,r=e.candidates.y.find(e=>e.field===t);return void 0!==r?.distinctCount&&6>r.distinctCount?"too few distinct numeric values; a bar chart of counts is a better fit":null},intentScores:{distribution:5,"outlier-detection":3,"compare-categories":1},variants:[{key:"count-bins",label:"Count bins",props:{bins:10,relative:!1},tags:["count"]},{key:"share-bins",label:"Share bins (relative)",props:{bins:10,relative:!0},tags:["share"],intentDeltas:{distribution:0}}],buildProps:(e,t)=>({data:e.data,valueAccessor:e.primary.y,...t?.props??{}})},za={component:"BoxPlot",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:4,precision:3},numericContracts:p.BoxPlot,fits:e=>e.primary.y?e.primary.category?3>e.rowCount/Math.max(e.categoryCount??1,1)?"needs 3+ observations per category":null:"needs a category to split distributions":"needs a numeric field",intentScores:{distribution:5,"compare-categories":4,"outlier-detection":4},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y})},_a={component:"SwarmPlot",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:p.SwarmPlot,fits:e=>e.primary.y?e.primary.category?4>e.rowCount/Math.max(e.categoryCount??1,1)?"needs 4+ observations per category":e.rowCount>2e3?"too many points for a swarm — consider a violin or box":null:"needs a category":"needs a numeric field",intentScores:{distribution:4,"outlier-detection":5,"compare-categories":3},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,...e.primary.series&&e.primary.series!==e.primary.category?{colorBy:e.primary.series}:{}})},Ia={component:"ViolinPlot",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:p.ViolinPlot,fits:e=>e.primary.y?e.primary.category?6>e.rowCount/Math.max(e.categoryCount??1,1)?"needs 6+ observations per category":null:"needs a category to split distributions":"needs a numeric field",intentScores:{distribution:5,"compare-categories":4},variants:[{key:"density",label:"Density only",props:{showIQR:!1},tags:["density"]},{key:"density-iqr",label:"Density with IQR",props:{showIQR:!0},tags:["density","iqr"],intentDeltas:{distribution:0},rubricDeltas:{precision:1}}],buildProps:(e,t)=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,...t?.props??{}})},Oa={component:"RidgelinePlot",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:2,accuracy:3,precision:3},numericContracts:p.RidgelinePlot,fits:e=>e.primary.y?e.primary.category?3>(e.categoryCount??0)?"needs 3+ categories to make a ridgeline meaningful":6>e.rowCount/Math.max(e.categoryCount??1,1)?"needs 6+ observations per category":null:"needs a category dimension to stack distributions":"needs a numeric field",intentScores:{distribution:4,"compare-categories":3,"composition-over-time":2},caveats:()=>["readers can confuse overlapping ridges — limit categories or use small multiples"],buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y})},qa={component:"ForceDirectedGraph",family:"network",importPath:"semiotic/network",rubric:{familiarity:3,accuracy:3,precision:3},fits:e=>e.hasNetwork&&e.network?2>e.network.nodes.length?"needs at least 2 nodes":1>e.network.edges.length?"needs at least 1 edge":null:"needs a {nodes, edges} network passed via rawInput",intentScores:{flow:3,correlation:2},caveats:e=>(e.network?.nodes.length??0)>500?["large graphs become hairballs — consider filtering or aggregating"]:[],buildProps:e=>({nodes:e.network?.nodes??[],edges:e.network?.edges??[],nodeIdAccessor:"id",sourceAccessor:"source",targetAccessor:"target"}),scaleFit:e=>{const t=e.network?.nodes.length??0;return 5>t?{delta:-.4,caveats:[`only ${t} nodes — force layout is overkill for this size`]}:t>100?t>300?{delta:-.8,caveats:[t+" nodes — expect a hairball; filter or aggregate before rendering"]}:{delta:0}:{delta:.5,reason:t+" nodes is in the readable range for force layout"}}},Ha={component:"SankeyDiagram",family:"flow",importPath:"semiotic/network",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:p.SankeyDiagram,fits:e=>e.hasNetwork&&e.network?2>e.network.edges.length?"needs 2+ weighted edges":null:"needs a {nodes, edges} network with edge weights",intentScores:{flow:5,"part-to-whole":3},buildProps:e=>({nodes:e.network?.nodes??[],edges:e.network?.edges??[],sourceAccessor:"source",targetAccessor:"target",valueAccessor:"value",nodeIdAccessor:"id"})},La={component:"ChordDiagram",family:"flow",importPath:"semiotic/network",rubric:{familiarity:2,accuracy:3,precision:2},numericContracts:p.ChordDiagram,fits:e=>e.hasNetwork&&e.network?3>e.network.nodes.length?"needs 3+ nodes":3>e.network.edges.length?"needs 3+ edges":null:"needs a {nodes, edges} network",intentScores:{flow:4},caveats:()=>["chord diagrams trade accuracy for symmetry; use Sankey if direction matters"],buildProps:e=>({nodes:e.network?.nodes??[],edges:e.network?.edges??[],valueAccessor:"value"})},Ga={component:"ProcessSankey",family:"flow",importPath:"semiotic/network",rubric:{familiarity:2,accuracy:4,precision:3},fits:e=>{if(!e.hasNetwork||!e.network)return"needs a {nodes, edges} network";const t=e.network.edges[0];return t?void 0===t.startTime&&void 0===t.start||void 0===t.endTime&&void 0===t.end?"edges need both startTime and endTime (or start/end) for a temporal sankey":null:"needs at least one edge with start/end times"},intentScores:{flow:5,"composition-over-time":4,"change-detection":3},buildProps:e=>{const t=e.network?.edges??[],r={nodes:e.network?.nodes??[],edges:t,pairing:"temporal",laneOrder:"crossing-min"},a=t[0],i=a&&void 0===a.startTime&&void 0!==a.start?"start":"startTime",n=a&&void 0===a.endTime&&void 0!==a.end?"end":"endTime";a&&("start"===i&&(r.startTimeAccessor="start"),"end"===n&&(r.endTimeAccessor="end"));let o=1/0,s=-1/0;for(const e of t){const t=e?.[i],r=e?.[n],a=t instanceof Date?t.getTime():"number"==typeof t?t:null!=t?new Date(t).getTime():NaN,c=r instanceof Date?r.getTime():"number"==typeof r?r:null!=r?new Date(r).getTime():NaN;Number.isFinite(a)&&(o=Math.min(o,a),s=Math.max(s,a)),Number.isFinite(c)&&(o=Math.min(o,c),s=Math.max(s,c))}return Number.isFinite(o)&&Number.isFinite(s)&&s>=o&&(r.domain=[o,s===o?o+1:s]),r}},Ea={component:"TreeDiagram",family:"hierarchy",importPath:"semiotic/network",rubric:{familiarity:4,accuracy:4,precision:3},fits:e=>e.hasHierarchy&&e.hierarchy?null:"needs a hierarchical root (object with children) via rawInput",intentScores:{hierarchy:5},variants:[{key:"vertical-tree",label:"Vertical tree",props:{layout:"tree",orientation:"vertical"},tags:["vertical"]},{key:"horizontal-cluster",label:"Horizontal cluster",props:{layout:"cluster",orientation:"horizontal"},tags:["horizontal"]}],buildProps:(e,t)=>({data:e.hierarchy??{name:"root",children:[]},...t?.props??{}})};function Va(e){if(!e||"object"!=typeof e)return 0;const t=e.children;return Array.isArray(t)&&t.length>0?t.reduce((e,t)=>e+Va(t),0):1}var Xa={component:"Treemap",family:"hierarchy",importPath:"semiotic/network",rubric:{familiarity:4,accuracy:3,precision:3},fits:e=>e.hasHierarchy&&e.hierarchy?4>e.rowCount?"declared scale is too small to render a hierarchy meaningfully":null:"needs a hierarchical root with values",intentScores:{hierarchy:4,"part-to-whole":e=>e.hasHierarchy?5:4,"compare-categories":3},caveats:()=>["rectangle area comparisons are less precise than length — prefer a bar chart for ranking"],buildProps:e=>({data:e.hierarchy??{name:"root",children:[]},valueAccessor:"value"}),scaleFit:(e,t)=>{const r=Va(e.hierarchy);let a=0;const i=[];let n;return 5>r?(a-=.5,i.push(`only ${r} leaves — treemap needs more cells to show structure`)):r>100?r>500&&(a-=.7,i.push(r+" leaves — most tiles will be sub-pixel; prefer aggregation or zoomable treatment")):(a+=.4,n=r+" leaves is in the legible band for treemap"),"huge"===t.rowBand&&(a-=.5,i.push("at huge declared scale a stacked or matrix view aggregates better than hierarchical browsing")),{delta:a,reason:n,caveats:i}}},Ka={component:"CirclePack",family:"hierarchy",importPath:"semiotic/network",rubric:{familiarity:3,accuracy:3,precision:2},fits:e=>e.hasHierarchy&&e.hierarchy?null:"needs a hierarchical root with values",intentScores:{hierarchy:4,"part-to-whole":3},caveats:()=>["circle area is harder to compare than rectangle area"],buildProps:e=>({data:e.hierarchy??{name:"root",children:[]},valueAccessor:"value"})},Ua={component:"OrbitDiagram",family:"hierarchy",importPath:"semiotic/network",rubric:{familiarity:1,accuracy:2,precision:2},fits:e=>e.hasHierarchy&&e.hierarchy?null:"needs a hierarchical root",intentScores:{hierarchy:3},caveats:()=>["decorative — readers without context will not infer hierarchy easily"],buildProps:e=>({data:e.hierarchy??{name:"root",children:[]},orbitMode:"solar"})},Wa={component:"ChoroplethMap",family:"geo",importPath:"semiotic/geo",rubric:{familiarity:4,accuracy:3,precision:2},fits:e=>e.hasGeo&&e.geo?2>e.geo.features.length?"needs at least 2 area features to compare":null:"needs a GeoJSON FeatureCollection via rawInput",intentScores:{geo:5,"compare-categories":3},caveats:()=>["large areas dominate visual weight regardless of measurement"],buildProps:e=>({areas:e.geo?.features??[],valueAccessor:e.primary.y??"value"})},Qa={component:"ProportionalSymbolMap",family:"geo",importPath:"semiotic/geo",numericContracts:p.ProportionalSymbolMap,rubric:{familiarity:3,accuracy:3,precision:3},fits:e=>e.hasGeo&&e.geo?(e.geo.points?.length??0)>0||0!==(e.geo.features.length??0)?null:"needs points or area features":"needs a GeoJSON FeatureCollection (with points or area centroids)",intentScores:{geo:4,rank:3,"compare-categories":3},buildProps:e=>({points:e.geo?.points??[],areas:e.geo?.features??void 0,xAccessor:"lon",yAccessor:"lat",sizeBy:e.primary.size??"value"})},Ya={component:"FlowMap",family:"geo",importPath:"semiotic/geo",rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>e.hasGeo&&e.geo?e.geo.flows?.length?e.geo.points?.length?null:"needs point nodes with lat/lon":"needs flow records (source/target/value)":"needs a geo dataset",intentScores:{geo:4,flow:5},buildProps:e=>({flows:e.geo?.flows??[],nodes:e.geo?.points??[],valueAccessor:"value"})},Za={component:"DistanceCartogram",family:"geo",importPath:"semiotic/geo",rubric:{familiarity:1,accuracy:3,precision:3},fits:e=>e.hasGeo&&e.geo?e.geo.points?.length?null:"needs point nodes with lat/lon and a cost field":"needs a geo dataset",intentScores:{geo:3,rank:3,"compare-categories":2},caveats:()=>["non-standard projection — requires explanation for most readers"],buildProps:e=>({points:e.geo?.points??[],costAccessor:"cost"})};function Ja(e){return Number.isFinite("number"==typeof e?e:Number(e))}function ei(e){return["value","throughput","traffic","rate","volume","count"].find(t=>e.some(e=>{const r=Number(e?.[t]);return Number.isFinite(r)&&r>0}))??"value"}function ti(e,t){return e.data.some(e=>e&&"object"==typeof e&&t in e)}var ri=[sa,ca,la,ua,da,ma,pa,ha,ya,fa,ga,ba,va,xa,Aa,Sa,Pa,Ma,Da,Fa,$a,Na,Ba,Ra,za,_a,Ia,Oa,qa,Ha,La,Ga,Ea,Xa,Ka,Ua,Wa,Qa,Ya,Za,{component:"GaltonBoardChart",family:"distribution",importPath:"semiotic/physics",rubric:{familiarity:3,accuracy:3,precision:2},fits:e=>20>e.rowCount?"Galton boards need enough observations for a distribution to form":e.primary.y?null:"needs a numeric field to drop into bins",intentScores:{distribution:4,"outlier-detection":1},variants:[{key:"observed",label:"Observed samples",description:"Drop the supplied rows through the board and read the settled bins.",props:{simulationMode:"sample"},tags:["observed"]},{key:"mechanical",label:"Mechanical demonstration",description:"Seeded Bernoulli draws with no input data — explains where a bell curve comes from rather than reporting one.",props:{simulationMode:"mechanical"},tags:["explainer","no-data"],intentDeltas:{distribution:-2,"outlier-detection":-1},rubricDeltas:{accuracy:-2,precision:-1}}],caveats:()=>["The settled projection is the chart; motion is explanatory context and should not be used for exact value reading"],buildProps:e=>({data:e.data,valueAccessor:e.primary.y,bins:Math.max(8,Math.min(24,Math.round(Math.sqrt(e.rowCount))))})},{component:"EventDropChart",family:"realtime",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>e.primary.time??e.primary.x?3>e.rowCount?"needs multiple events to show arrival/window behavior":null:"needs an event-time field",intentScores:{"change-detection":3,trend:1,distribution:1},caveats:()=>["Use for event-time arrival stories, watermarks, and lateness; use a line or histogram for precise temporal values"],buildProps:e=>{const t=e.primary.time??e.primary.x,r=(function(e){return e.data.some(e=>e&&"object"==typeof e&&"arrivalTime"in e)}(e)?"arrivalTime":e.candidates.time.find(e=>e.field!==t)?.field)||t;return{data:e.data,timeAccessor:t,arrivalAccessor:r,windows:{size:Math.max(1,Math.ceil(e.rowCount/8))},watermark:{delay:1}}}},{component:"UnitPileChart",family:"categorical",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>e.primary.category?e.primary.y?(e.categoryCount??0)>12?"too many categories for readable physics piles":null:"needs a numeric value to unitize into bodies":"needs a categorical field for piles",intentScores:{"compare-categories":3,"part-to-whole":2,distribution:1},variants:[{key:"projected",label:"Piles with stated totals",description:"Countable units plus the exact per-category total, so accumulation is dramatized without losing precision.",props:{showProjection:!0},tags:["observed"]},{key:"units-only",label:"Units only",description:"Piles without the totals overlay — reads as texture, and the reader must count.",props:{showProjection:!1},tags:["narrative"],intentDeltas:{"compare-categories":-1,"part-to-whole":-1},rubricDeltas:{precision:-1}}],caveats:()=>["Physics piles dramatize accumulation; use bars or dots when exact rank or precise value comparison is the task"],buildProps:e=>{const t=e.primary.y,r=t?e.data.map(e=>Number(e?.[t])).filter(e=>Number.isFinite(e)):[],a=r.length?Math.max(...r):1;return{data:e.data,categoryAccessor:e.primary.category,valueAccessor:t,unitValue:Math.max(1,Math.ceil(a/40))}}},{component:"CollisionSwarmChart",family:"distribution",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:4,precision:3},fits:e=>e.primary.y??e.primary.x?8>e.rowCount?"needs enough points for collision density to matter":e.rowCount>1200?"too many points for browser collision relaxation":(e.categoryCount??0)>12?"too many group lanes for a physics swarm":null:"needs a numeric field for the swarm axis",intentScores:{distribution:3,"outlier-detection":3,"compare-categories":2},caveats:()=>["CollisionSwarmChart makes overlap and settling visible; use SwarmPlot when a static distribution is enough"],buildProps:e=>{const t=e.primary.category&&8>=(e.categoryCount??0)?e.primary.category:void 0;return{data:e.data,xAccessor:e.primary.y??e.primary.x,...t?{groupAccessor:t,colorBy:t}:{},...e.primary.size?{radiusAccessor:e.primary.size}:{}}}},{component:"PacketFlowChart",family:"flow",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:2,precision:1},fits:e=>{return e.hasNetwork&&e.network?1>e.network.edges.length?"needs at least 1 flow link":e.network.edges.length>160?"too many links for animated particle flow":(t=e.network.edges,e.network.nodes.some(e=>Ja(e.x)&&Ja(e.y))||t.some(e=>Array.isArray(e.path)||Array.isArray(e.points)||Array.isArray(e.route))?null:"requires authored node x/y coordinates or per-link path geometry; use SankeyDiagram for plain source-target-value data"):"needs explicit {nodes, edges} or {nodes, links} route input";var t},intentScores:{flow:4,"change-detection":1,"part-to-whole":1},caveats:()=>["PacketFlowChart is experimental: keep showStaticFlow enabled so throughput remains readable when animation is paused or reduced","Requires explicit route geometry; it does not infer physical pipe paths from a flat source-target table"],buildProps:e=>{const t=e.network?.edges??[];return{nodes:e.network?.nodes??[],links:e.network?.edges??[],nodeIdAccessor:"id",nodeXAccessor:"x",nodeYAccessor:"y",sourceAccessor:"source",targetAccessor:"target",throughputAccessor:ei(t),showStaticFlow:!0,showSensors:!0,maxParticles:160}},scaleFit:e=>{const t=e.network?.edges.length??0;return t>4?t>60?{delta:-.7,caveats:[t+" links can create occlusion and packet budget pressure; aggregate routes first"]}:{delta:.2,reason:t+" links is small enough for route-constrained packet animation"}:{delta:-.2,caveats:[`only ${t} links — a static Sankey may communicate the flow more directly`]}}},{component:"ProcessFlowChart",family:"realtime",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>3>e.rowCount?"needs multiple work items to show stage flow":ti(e,"stage")||ti(e,"status")||e.primary.category?null:"needs a categorical stage/status field",intentScores:{flow:4,"change-detection":3,"compare-categories":2,rank:1},caveats:()=>["Use for capacitated multi-body process stories (review queues, triage, merge pipelines); use a bar or Sankey for precise stage totals without motion","Motion dramatizes backlog and capacity; settled stage counts and group completion are the readable chart"],buildProps:e=>{const t=(ti(e,"stage")?"stage":ti(e,"status")&&"status")||e.primary.category||"stage",r=ti(e,"id")?"id":void 0,a=(ti(e,"featureId")?"featureId":ti(e,"group")&&"group")||e.primary.series||void 0,i=new Set;for(const r of e.data){if(!r||"object"!=typeof r)continue;const e=r[t];null!=e&&""!==e&&i.add(e+"")}const n=i.size>0?Array.from(i):["coding","review","merged"],o=n.map((t,r)=>{const a=r===n.length-1,i=r===Math.floor(n.length/2);return{id:t,label:t,force:a?20:12,capacity:i?{unitsPerSecond:Math.max(2,Math.round(e.rowCount/8))}:void 0,pressure:i||void 0,absorb:a||void 0}});return{data:e.data,...r?{idAccessor:r}:{},stageAccessor:t,...a?{groupBy:a,groupCompletion:"allAbsorbed"}:{},stages:o,showProjection:!0,showChrome:!0}}},{component:"GauntletChart",family:"realtime",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:2,precision:2},fits:e=>{if(1>e.rowCount)return"needs at least one project/plan row";const t=e.data.some(e=>e&&"object"==typeof e&&"id"in e);return e.primary.category||t?null:"needs project rows with stable ids (or a categorical identity field)"},intentScores:{flow:3,"change-detection":2,"compare-categories":1},caveats:()=>["GauntletChart is for compound entities whose attached properties transform at gates. Use ProcessFlowChart when work items do not need compound property bodies.","Read viability, property inventory, and outcomes — not body trajectories."],buildProps:e=>({data:e.data.map((e,t)=>({...e,id:e?.id??"project-"+t,positives:Array.isArray(e?.positives)?e.positives:["value"],negatives:Array.isArray(e?.negatives)?e.negatives:["cost"]})),idAccessor:"id",positiveAccessor:"positives",negativeAccessor:"negatives",positiveProperties:[{id:"value",label:"Value",short:"V",color:"#22c55e",buoyancy:2,radius:9}],negativeProperties:[{id:"cost",label:"Cost",short:"$",color:"#ef4444",load:1.1,radius:7}],gates:[{id:"review",label:"Review"},{id:"approval",label:"Approval"}],showProjection:!0,showChrome:!0})},{component:"CrucibleChart",family:"flow",importPath:"semiotic/physics",rubric:{familiarity:1,accuracy:4,precision:3},fits:()=>"requires authored phases, product molds, events, and outlets; these cannot be inferred from flat data",intentScores:{flow:4,"change-detection":3,"compare-categories":1},caveats:()=>["CrucibleChart presents an authored treatment and its accounting; collisions never discover products, affinity, failure, or causality.","Supply stable source ids plus explicit phases, products, events, and reason-labelled outlets. Use the settled projection for the exact reading.","buildCrucibleProductEvents can serialize an explicit form → contribute → complete lifecycle, but the caller must still author every member, relation, event position, and outlet."],buildProps:e=>({data:e.data})},{component:"ChainReactionChart",family:"hierarchy",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:4,precision:3},fits:()=>"requires an authored dependency graph (stable task ids plus an explicit array of prerequisite ids per task); edges cannot be inferred from flat data",intentScores:{flow:3,hierarchy:3,"change-detection":3,"outlier-detection":2},caveats:()=>["The settled projection is the chart: task state (completed / blocked / armed / waiting) plus each blocker's downstream reach. Ball motion shows prerequisites being delivered and never decides whether a task is done.","Task completion is an explicit data event, not something the simulation discovers. Supply completionTimeAccessor or statusAccessor.","Blocker amplification counts unfinished downstream tasks and affected lanes; it is a graph reachability result, not a schedule forecast."],buildProps:e=>({data:e.data})},{component:"BigNumber",family:"value",importPath:"semiotic/value",rubric:{familiarity:5,accuracy:5,precision:5},fits:e=>e.primary.y||e.primary.size||0!==e.candidates.y.length?e.rowCount>50?"BigNumber shows a single focal value — pass scalar data, or use a chart family for >50 rows":null:"needs a numeric value to display",intentScores:{trend:e=>e.hasTimeAxis||"named"===e.xProvenance||e.monotonicX?e.rowCount>8?1:3:0,"compare-categories":1,rank:1,"part-to-whole":e=>1===e.rowCount?5:1,"change-detection":e=>e.hasTimeAxis||"named"===e.xProvenance||e.monotonicX?e.rowCount>8?1:4:0},caveats:e=>{const t=[];return e.rowCount>1&&t.push("BigNumber renders the latest row's value as the focal number; earlier rows feed an optional sparkline"),t},buildProps:e=>{const t=e.primary.y??e.primary.size??e.candidates.y[0]?.field;if(!t)return{value:0};const r=e.data,a=r.length>0?r[r.length-1]:null,i=a?Number(a[t]):0,n={value:Number.isFinite(i)?i:0,label:t};if(r.length>=2){const e=Number(r[r.length-2][t]);Number.isFinite(e)&&(n.comparison={value:e,label:"vs previous"})}return n},scaleFit:(e,t)=>"tiny"===t.rowBand?{delta:.8,reason:"single-value displays beat charts when there is one number to show"}:"small"===t.rowBand?{delta:.2,reason:"the latest value with a trend spark is often more legible than a chart at small scale"}:null}],ai=new Map;function ii(e){ai.set(e.component,e),g(e.component,e.numericContracts)}function ni(e){ai.delete(e),v(e)}function oi(){if(0===ai.size&&!ge())return ri;const e=new Map;for(const t of ri)e.set(t.component,t);for(const t of fe())e.set(t.component,t);for(const[t,r]of ai)e.set(t,r);return Array.from(e.values())}function si(e){return oi().find(t=>t.component===e)}var ci=new Set(["perceivable.content-only-visual","perceivable.color-alone","assistive.data-density","assistive.human-readable-numbers","assistive.skippable-navigation","compromising.table","compromising.navigable-structure"]),li={"screen-reader":"a screen reader",sonified:"sonification",agent:"an AI reader"};function ui(e,t){if("visual"===t)return{delta:0,caveats:[]};let r=0;const a=[],i=[];for(const t of e.findings){if(!ci.has(t.id))continue;let e=0;"fail"===t.status?e=t.critical?1.2:.8:"warn"===t.status&&(e=.4),e>0&&(r-=e,a.push(t.heuristic.charAt(0).toLowerCase()+t.heuristic.slice(1)),i.push(t.message))}return 0===a.length?{delta:0,caveats:[]}:{delta:Math.max(-3,r),reason:`Harder to receive via ${li[t]}: ${a.slice(0,3).join("; ")}`,caveats:i}}function di(e,t,r,a,i){if(!a)return{score:e,rubric:t};const n=a.familiarity?.[r],o=n??t.familiarity,s=a.targets?.[r];let c,l,u=0;void 0!==n&&(u+=.5*(n-3)),s&&(u+=1*("increase"===s.direction?1:-1)*Math.max(1,Math.min(3,s.weight??1)),c=s.reason?`${a.name?a.name+": ":""}${s.reason}`:`${a.name?a.name+" ":""}target: ${s.direction} ${r}`);const d=a.receptionModality;return i&&d&&"visual"!==d&&(u+=i.delta,l=i.reason),{score:e+u,rubric:{...t,familiarity:o},appliedReason:c,receivabilityReason:l}}function mi(e,t,r){return r?r.familiarity?.[e]??t:t}function pi(e){return e&&2===e.exposureLevel?4:3}function hi(e,t){if(void 0===e)return 0;const r="function"==typeof e?e(t):e;return Number.isFinite(r)?Math.max(0,Math.min(5,r)):0}function yi(e,t){if(!t?.intentDeltas)return e;const r={...e};for(const[e,a]of Object.entries(t.intentDeltas))r[e]=Math.max(0,Math.min(5,(r[e]??0)+a));return r}function fi(e,t){return t?.rubricDeltas?function(e){const t=e=>Math.max(1,Math.min(5,Math.round(e)));return{familiarity:t(e.familiarity),accuracy:t(e.accuracy),precision:t(e.precision)}}({familiarity:e.familiarity+(t.rubricDeltas.familiarity??0),accuracy:e.accuracy+(t.rubricDeltas.accuracy??0),precision:e.precision+(t.rubricDeltas.precision??0)}):e}function gi(e,t,r,a){const i=[],n=a.map(e=>({intent:e,score:r[e]??0})).filter(e=>e.score>=3).sort((e,t)=>t.score-e.score).slice(0,2);for(const{intent:e,score:t}of n)i.push(`Strong fit for ${e} (${t}/5)`);if(t.primary.x&&t.primary.y&&i.push(`x = ${t.primary.x}, y = ${t.primary.y}`),t.seriesCount&&t.seriesCount>1&&i.push(`${t.seriesCount} series detected on field "${t.primary.series??"series"}"`),"recipe"===e.candidateKind){for(const t of e.positiveRationale?.slice(0,2)??[])i.push(t);e.whyCustom?.reason&&i.push("Why leave the catalog: "+e.whyCustom.reason)}return i}function bi(e,t){if("recipe"!==e.candidateKind||!e.recipe)return{delta:0,reasons:[],caveats:[]};const r=e.recipe;if(t.portability&&r.portability!==t.portability)return{delta:0,reasons:[],caveats:[],excluded:`requires a ${t.portability} recipe`};let a=0;const i=[],n=[],o=t.audience?.name?.trim().toLowerCase();if(o){const e=r.audienceFit?.find(e=>e.audience.trim().toLowerCase()===o);e&&(a+={strong:.75,moderate:.25,weak:-.5,avoid:-2}[e.fit],i.push(e.rationale??`${e.fit} fit for ${t.audience?.name??e.audience}`))}const s=t.receptionChannel??t.audience?.receptionModality??"visual";r.reception?.channels?.includes(s)?(a+=.25,i.push(`Designed for ${s} reception`)):r.reception?.channels?.length&&(a-=1,n.push(`Recipe does not declare support for the ${s} reception channel.`));const c=r.reception?.risks??[];return"low"===t.riskTolerance&&c.length>0?(a-=Math.min(1.5,.35*c.length),n.push(...c)):"medium"===t.riskTolerance&&c.length>2&&(a-=.25),"local"===r.portability?n.push("Local-only recipe: cannot be rendered remotely by CLI or MCP."):i.push("Portable registered recipe"),{delta:a,reasons:i,caveats:n}}function vi(e,t){if(0===t.length){const t=Object.values(e).filter(e=>"number"==typeof e&&e>0);return 0===t.length?0:t.reduce((e,t)=>e+t,0)/t.length}let r=0;for(const a of t)r+=e[a]??0;return r/t.length}function wi(e,t={}){const r=t.profile??Kr(e??[],{rawInput:t.rawInput,seriesField:t.seriesField}),i=t.capabilities??oi(),n=t.intent?Array.isArray(t.intent)?t.intent:[t.intent]:[],o=!1!==t.includeVariants,s=t.minScore??0,c=t.maxResults??10,l=t.allow?new Set(t.allow):null,u=t.deny?new Set(t.deny):null,d=t.audience?.receptionModality,m=void 0!==d&&"visual"!==d,p=aa(r,t.scale),h=void 0!==t.scale&&p.rows!==r.rowCount?{...r,rowCount:p.rows}:r,y=[];for(const e of i){if(l&&!l.has(e.component))continue;if(u&&u.has(e.component))continue;if(null!==e.fits(h))continue;const i={};for(const[t,r]of Object.entries(e.intentScores))i[t]=hi(r,h);const c=e.caveats?Array.from(e.caveats(h)):[],f=o&&e.variants&&e.variants.length>0?e.variants:[void 0];for(const o of f){const l=yi(i,o),u=vi(l,n),f=fi(e.rubric,o),g=e.buildProps(r,o);let b;m&&(b=ui(a(e.component,g),d));const v=di(u,f,e.component,t.audience,b),w=na(e,h,p,t.scale,t.quality);if(w.excluded)continue;const k=bi(e,t);if(k.excluded)continue;const C=v.score+w.delta+k.delta;if(s>C)continue;const x=gi(e,h,l,n);v.appliedReason&&x.push(v.appliedReason),v.receivabilityReason&&x.push(v.receivabilityReason);for(const e of w.reasons)x.push(e);x.push(...k.reasons);const A=[...c,...o?.caveats??[],...w.caveats,...b?.caveats.slice(0,3)??[],...k.caveats],S={band:p.rowBand,cardinalityBand:p.cardinalityBand,rows:p.rows,rowsSource:p.rowsSource},P=o?.component??e.component;y.push({component:P,displayName:e.displayName??P,candidateKind:e.candidateKind??"built-in",...e.recipe?{recipeId:e.recipe.id}:{},family:e.family,importPath:e.importPath,variant:o,score:C,intentScores:l,rubric:v.rubric,reasons:x,caveats:A,props:g,...e.whyCustom?{whyCustom:e.whyCustom}:{},scaleRange:S})}}y.sort((e,t)=>t.score!==e.score?t.score-e.score:t.rubric.accuracy!==e.rubric.accuracy?t.rubric.accuracy-e.rubric.accuracy:t.rubric.familiarity-e.rubric.familiarity);const f=new Set;return y.filter(e=>{const t=`${e.component}:${e.score.toFixed(4)}`;return!f.has(t)&&(f.add(t),!0)}).slice(0,c)}function ki(e,t={}){const r=t.profile??Kr(e??[],{rawInput:t.rawInput,seriesField:t.seriesField}),a=t.capabilities??oi(),i=t.allow?new Set(t.allow):null,n=t.deny?new Set(t.deny):null,o=aa(r,t.scale),s=void 0!==t.scale&&o.rows!==r.rowCount?{...r,rowCount:o.rows}:r,c=[];for(const e of a){if(i&&!i.has(e.component))continue;if(n&&n.has(e.component))continue;const t=e.fits(s);null!==t&&c.push({component:e.component,family:e.family,importPath:e.importPath,reason:t})}return{fitting:wi(e,{...t,profile:r}),rejected:c,profile:r}}function Ci(e,t,r={}){const a=oi().find(t=>t.component===e);if(!a)return{reason:`No capability registered for "${e}"`};const i=r.profile??Kr(t??[]),n=a.fits(i);if(null!==n)return{reason:n};const o=r.variantKey?a.variants?.find(e=>e.key===r.variantKey):void 0,s=r.intent?Array.isArray(r.intent)?r.intent:[r.intent]:[],c={};for(const[e,t]of Object.entries(a.intentScores))c[e]=hi(t,i);const l=yi(c,o),u=vi(l,s),d=fi(a.rubric,o),m=gi(a,i,l,s),p=bi(a,r);if(p.excluded)return{reason:p.excluded};m.push(...p.reasons);const h=[...a.caveats?a.caveats(i):[],...o?.caveats??[],...p.caveats],y=o?.component??a.component;return{component:y,displayName:a.displayName??y,candidateKind:a.candidateKind??"built-in",...a.recipe?{recipeId:a.recipe.id}:{},family:a.family,importPath:a.importPath,variant:o,score:u+p.delta,intentScores:l,rubric:d,reasons:m,caveats:h,props:a.buildProps(i,o),...a.whyCustom?{whyCustom:a.whyCustom}:{}}}function xi(e,t={}){const r=t.profile??Kr(e??[],{rawInput:t.rawInput,seriesField:t.seriesField}),a=aa(r,t.scale),i=t.maxPerBand??t.maxResults??5,n=["tiny","small","medium","large","huge"],o={};for(const a of n){const n={...t.scale??{},rows:a};o[a]=wi(e,{...t,profile:r,scale:n,maxResults:i})}return{tiny:o.tiny??[],small:o.small??[],medium:o.medium??[],large:o.large??[],huge:o.huge??[],effective:a}}function Ai(e,t){return null==e?e:e.length>t?e.slice(0,t-1)+"…":e}function Si(e){const{data:t,onQuery:r,initialAnnotations:a,componentName:n,props:o,includeProfile:s,includeSuggestions:c,suggestionsIntent:l,suggestionsMax:u,focus:d,includeGrounding:m}=e,[p,h]=vr([]),[y,f]=vr([]),[g,b]=vr(!1),[v,w]=vr(null),k=gr(()=>Sr(t??[]),[t]),C=s||c,x=gr(()=>C?Kr(t??[]):void 0,[C,t]),A=gr(()=>c&&x?wi(t,{profile:x,intent:l,maxResults:u??5}):void 0,[c,x,t,l,u]),S=gr(()=>{if(m&&n)return i(n,{data:t??[],...o??{}},"object"==typeof m?m:void 0)},[m,n,o,t]),P=br(r);P.current=r;const M=br(n);M.current=n;const D=br(o);D.current=o;const T=br(t);T.current=t;const F=br(k);F.current=k;const $=br(x);$.current=x;const j=br(A);j.current=A;const N=br(d);N.current=d;const B=br(S);B.current=S;const R=fr(async e=>{const t=e.trim();if(!t)return;b(!0),w(null),h(e=>[...e,{role:"user",text:t}]);const r="undefined"!=typeof performance?performance.now():Date.now();I().record({type:"interrogation-asked",component:M.current,query:Ai(t,500)});try{const e=await P.current(t,{data:T.current??[],summary:F.current,profile:$.current,suggestions:j.current,componentName:M.current,props:D.current,grounding:B.current,focus:N.current??void 0});h(t=>[...t,{role:"assistant",text:e.answer}]),e.annotations&&f(e.annotations);const a="undefined"!=typeof performance?performance.now():Date.now();I().record({type:"interrogation-answered",component:M.current,answer:Ai(e.answer,2e3),annotationCount:e.annotations?.length,latencyMs:Math.max(0,Math.round(a-r))})}catch(e){w(e instanceof Error?e:Error(e+"")),h(e=>[...e,{role:"assistant",text:"Sorry, I couldn't process that query."}]);const t="undefined"!=typeof performance?performance.now():Date.now();I().record({type:"interrogation-answered",component:M.current,error:!0,latencyMs:Math.max(0,Math.round(t-r))})}finally{b(!1)}},[]),z=fr(({text:e,annotations:t})=>{const r=e.trim();r&&(h(e=>[...e,{role:"assistant",text:r}]),t&&t.length>0&&f(e=>[...e,...t]))},[]),_=fr(()=>{h([]),f([]),w(null)},[]);return{ask:R,announce:z,history:p,summary:k,annotations:gr(()=>{const e=a??[];return 0===e.length?y:0===y.length?e:[...e,...y]},[a,y]),loading:g,error:v,reset:_}}import{useMemo as Pi}from"react";var Mi=["hover","hover-end","click","click-end","selection","selection-end","brush-end"];function Di(e={}){const{chartId:t,types:r=Mi}=e,{latest:a}=nr({chartId:t,types:r,limit:1});return Pi(()=>{if(!a)return null;if("hover-end"===a.type||"selection-end"===a.type||"brush-end"===a.type||"click-end"===a.type)return null;let e;if("selection"===a.type)e=a.selection.fields;else{if("hover"!==a.type&&"click"!==a.type)return null;e=a.datum}return e&&"object"==typeof e?{datum:e,x:a.x,y:a.y,source:a.type}:null},[a])}function Ti(e){if("number"==typeof e)return e;const t=Date.parse(e);return Number.isNaN(t)?void 0:t}function Fi(e,t){return"pass"===e?t.passColor??"var(--semiotic-success)":"warn"===e?t.warnColor??"var(--semiotic-warning)":t.failColor??"var(--semiotic-danger)"}function $i(e){if(null==e)return;const t="number"==typeof e?e:Date.parse(e);return Number.isNaN(t)?void 0:new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ji(e){const t=e.label??e.name??e.id;return"number"==typeof e.confidence&&1>e.confidence?`${t} · ${Math.round(100*e.confidence)}%`:t}function Ni(e){return{author:e.name??e.id,authorKind:"system",source:e.source,basis:e.basis??"rule",confidence:e.confidence,createdAt:e.createdAt,dataVersion:e.dataVersion,stableId:e.id}}function Bi(e,t={}){const r=[],a=[],i=t.valueAxis??"y",n={status:t.status??"proposed",anchor:t.anchor??"semantic",...void 0!==t.ttlHint?{ttlHint:t.ttlHint}:{}};for(const o of e){if("pass"===o.status&&!t.includePassed)continue;const e=Fi(o.status,t),s=ji(o),c={provenance:Ni(o),lifecycle:n},l=e=>a.push({result:o,reason:e}),u=e=>r.push(_t(e,c));switch(o.kind){case"range":if("number"!=typeof o.min||"number"!=typeof o.max){l("range check is missing numeric min/max bounds");break}u({type:"band",y0:o.min,y1:o.max,fill:e,fillOpacity:.12,color:e,label:s});break;case"min":case"max":case"threshold":{const t=o.value??("min"===o.kind?o.min:o.max);if("number"!=typeof t){l(o.kind+" check is missing a numeric value");break}u({type:"x"===i?"x-threshold":"y-threshold",value:t,label:s,color:e});break}case"freshness":{const t=void 0!==o.at?Ti(o.at):void 0;if(void 0===t){l("freshness check has no parseable timestamp (`at`); render as a chart-level status badge");break}u({type:"x-threshold",value:t,label:s,color:e});break}default:l(`${o.kind} check on "${o.column??"?"}" has no single chart coordinate; surface it as a chart-level status badge or a row-level mark in your UI`)}}return{annotations:r,unplaced:a}}function Ri(e){switch(e){case"pass":return"pass";case"warn":return"warn";case"fail":return"fail";default:return"error"}}function zi(e){if(!e)return"dbt check";const t=e.split(".");return t[t.length-1]||e}function _i(e,t={}){const r=[],a=e.sources;if(a?.results){const e=a.metadata?.generated_at,t=a.metadata?.invocation_id;for(const i of a.results){const a=Ri(i.status),n=zi(i.unique_id),o=$i(i.max_loaded_at);r.push({id:i.unique_id??n,name:"dbt freshness: "+n,label:"pass"===a?n+" fresh":`${n} stale${o?" since "+o:""}`,status:a,kind:"freshness",at:i.max_loaded_at,message:`freshness ${a}${i.max_loaded_at?" — last load "+i.max_loaded_at:""}`,source:"dbt",basis:"rule",createdAt:e,dataVersion:t})}}const i=e.runResults;if(i?.results){const e=i.metadata?.generated_at,a=i.metadata?.invocation_id;for(const n of i.results){const i=Ri(n.status);if("pass"===i&&!t.includePassed)continue;const o=zi(n.unique_id);r.push({id:n.unique_id??o,name:"dbt test · "+o,status:i,kind:"custom",message:n.message??void 0,observedCount:"number"==typeof n.failures?n.failures:void 0,source:"dbt",basis:"rule",createdAt:e,dataVersion:a})}}return Bi(r,t)}function Ii(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}function Oi(e){return e.replace(/^expect_/,"").replace(/column_values_to_be_|column_values_to_|column_|to_be_|to_/g," ").replace(/_/g," ").replace(/\s+/g," ").trim()||e}function qi(e,t={}){const{createdAt:r,dataVersion:a}=function(e){const t=e?.run_id;return t?"string"==typeof t?{dataVersion:t}:{createdAt:t.run_time,dataVersion:t.run_name??t.run_time}:{}}(e.meta),i=[];for(const[t,n]of(e.results??[]).entries()){const e=n.expectation_config??{},o=e.expectation_type??"unknown_expectation",s=e.kwargs??{},c=s.column,l=n.success?"pass":"fail",u=Ii(s.min_value),d=Ii(s.max_value),m=Ii(s.value),p=Ii(n.result?.observed_value),h=c??"value",y=Oi(o),f=void 0!==p?`${h}: ${p} `:"",g={id:`ge:${o}:${c??t}`,name:`GE ${y}${c?` (${c})`:""}`,status:l,column:c,message:void 0!==p?"observed "+p:void 0,observedCount:n.result?.unexpected_count,source:"great-expectations",basis:"statistical-test",createdAt:r,dataVersion:a},b=/_to_be_between$/.test(o);i.push(b&&void 0!==u&&void 0!==d?{...g,kind:"range",min:u,max:d,label:`${f}(expected ${u}–${d})`}:b&&void 0!==u?{...g,kind:"min",value:u,label:`${f}(min ${u})`}:b&&void 0!==d?{...g,kind:"max",value:d,label:`${f}(max ${d})`}:void 0!==m?{...g,kind:"threshold",value:m,label:`${f}(target ${m})`}:{...g,kind:"custom",label:`${h} ${y}`})}return Bi(i,t)}function Hi(e,t,r={}){const a=r.profile??Kr(t??[],{rawInput:r.rawInput}),i=si(e),n=r.maxAlternatives??3,o=i?.recipe?function(e,t){const r=[];"required"===e.accessibility.description&&"string"!=typeof(t.props??{}).description&&r.push("This custom recipe needs a generated or authored description."),e.reception?.risks?.some(e=>/unfamiliar/i.test(e))&&!(e.reception.scaffolds??[]).some(e=>["legend","annotation","summary","description"].includes(e))&&r.push("This recipe is unfamiliar; add an orienting legend, annotation, or summary.");const a=e.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length));a&&r.push("This recipe is color-dependent; add a shape, position, texture, or label cue."),e.reception?.channels.includes("interactive")&&!e.accessibility.fallbackTable&&"required"!==e.accessibility.accessibleTable&&r.push("This interactive recipe needs a static data fallback."),"local"===e.portability&&r.push("This recipe is local-only and cannot be exported to MCP or CLI rendering.");for(const e of t.observedSceneAudit?.observedSceneEvidence??[])"fail"!==e.status&&"warn"!==e.status||("interaction.hit-targets"===e.id?r.push("Scene audit found data-bearing marks without hit targets."):"accessibility.table-fields"===e.id?r.push("Scene audit found accessible-table field loss."):"accessibility.navigation-depth"===e.id&&r.push("The recipe navigation tree is root-only; expose groups and reachable data marks."));return[...new Set(r)]}(i.recipe,r):[];if(!i)return{status:"unknown",component:e,alternatives:wi(t,{profile:a,intent:r.intent,maxResults:n,includeVariants:!1}),profile:a};const s=i.fits(a);return null===s?{status:"ok",component:e,profile:a,...o.length?{repairs:o}:{}}:{status:"alternative",component:e,reason:s,alternatives:wi(t,{profile:a,intent:r.intent,maxResults:n,deny:[e],includeVariants:!1}),profile:a,...o.length?{repairs:o}:{}}}var Li={valid:!1,errors:[]};function Gi(e,r={}){const a=e.component,i=e.props??{},n=[],s=!!t[a];s||n.push(`Unknown component "${a}". It is not in the chart registry — pick a known chart.`);const c=s?m(a,i):{...Li};if(!c.valid)for(const e of c.errors)n.push(e);const l=!1!==r.diagnose&&s?o(a,i).diagnoses:[],u=l.filter(e=>"error"===e.severity),d=!1!==r.treatErrorsAsBlocking;if(d)for(const e of u)n.push(`${e.code}: ${e.message}`);let p,h,y,f,g;if((r.repair??!!r.data)&&r.data&&(p=Hi(a,r.data,{intent:r.intent}),"alternative"===p.status?n.push(`${a} is a poor fit: ${p.reason}. Consider ${p.alternatives.map(e=>e.component).slice(0,3).join(", ")}.`):"unknown"===p.status&&n.push(`${a} could not be evaluated against the data; consider ${p.alternatives.map(e=>e.component).slice(0,3).join(", ")}.`)),s&&(h=Fe(a,i),y=re(h)),r.render&&s&&c.valid&&(!d||0===u.length)){const e=r.render(a,i);g=e.svg,f=e.evidence,f.empty&&n.push("Rendered to an empty scene (no marks) — the data or accessors produce nothing to draw.");for(const e of f.warnings)n.push(e)}const b=s&&c.valid&&(!d||0===u.length)&&(!p||"ok"===p.status)&&(!f||!f.empty);return{ok:b,component:a,props:i,config:h,jsx:y,validation:c,diagnostics:l,repair:p,evidence:f,svg:g,reasons:b?[]:n}}function Ei(e={}){const r=e.components??Object.keys(t).sort();return{name:e.name??"render_semiotic_chart",description:"Render a Semiotic chart from a component name and props. The result is validated, diagnosed for anti-patterns, and (when data is supplied) checked for fit against the data. Inject a renderer to prove it paints; otherwise the result returns validation and repair reasons plus ranked alternatives.",inputSchema:{type:"object",additionalProperties:!1,required:["component"],properties:{component:{type:"string",enum:[...r],description:"The chart component to render."},props:{type:"object",description:"Props for the chart (accessors, data, encodings). See the component schema.",additionalProperties:!0}}}}}function Vi(e){return{name:e.name,description:e.description,input_schema:e.inputSchema}}function Xi(e){return{type:"function",function:{name:e.name,description:e.description,parameters:e.inputSchema}}}function Ki(e,t=!0){if(!e||"object"!=typeof e||Array.isArray(e))return!1;const r=e,a=Array.isArray(r.type)?r.type:[r.type],i=a.includes("object")||!!r.properties;if(t&&!i)return!1;if(i){if(!1!==r.additionalProperties)return!1;const e=r.properties;if(!e||"object"!=typeof e||Array.isArray(e))return!1;const t=new Set(Array.isArray(r.required)?r.required:[]);if(Object.keys(e).some(e=>!t.has(e)))return!1;if(!Object.values(e).every(e=>Ki(e,!1)))return!1}if(a.includes("array")&&(!r.items||!Ki(r.items,!1)))return!1;for(const e of["anyOf","oneOf","allOf"]){if(void 0===r[e])continue;const t=r[e];if(!Array.isArray(t)||0===t.length)return!1;if(!t.every(e=>Ki(e,!1)))return!1}return!0}function Ui(e,t={}){const r=t.strict??!1;if(r&&!Ki(e.inputSchema))throw Error("OpenAI strict mode requires a top-level object schema, closed object schemas, and every property required. chartGenerationTool() intentionally leaves props open for chart-specific props; use strict: false or pass a component-specific closed schema.");return{type:"function",name:e.name,description:e.description,parameters:e.inputSchema,strict:r}}function Wi(e){return t=>Gi(t,e?e(t):{})}var Qi=[{intent:"outlier-detection",weight:4,patterns:[/\b(outlier|outliers|anomal|anomaly|anomalies|extreme|extremes|unusual|stands? out|sticks? out|odd one)\b/i,/\b(peak|peaks|highest|lowest|biggest spike|spike|min|max|maximum|minimum)\b/i]},{intent:"trend",weight:4,patterns:[/\b(trend|trends|trending|trajectory|over time|across time|growth|decline|rising|falling|increasing|decreasing)\b/i,/\b(history|historical|evolved|evolution|change over)\b/i]},{intent:"change-detection",weight:3,patterns:[/\b(when did|what changed|shift|shifted|breakpoint|inflection|turning point|sudden|abrupt)\b/i]},{intent:"rank",weight:4,patterns:[/\b(rank|ranking|ranked|biggest|smallest|largest|order by|sorted|best|worst|leaderboard)\b/i,/\btop\s+(\d+|sellers?|performers?|picks?|results?|categories|items?)\b/i,/\bbottom\s+(\d+|results?|items?)\b/i,/\b(who has the most|which.*most|which.*highest|which.*lowest)\b/i]},{intent:"part-to-whole",weight:4,patterns:[/\b(share|shares|composition|portion|portions|fraction|percentage of|percent of|breakdown|make up|made up of|slice|slices)\b/i,/\b(part of|part to whole|piece of the pie|how much of)\b/i]},{intent:"composition-over-time",weight:5,patterns:[/\b(composition.*time|share.*over time|share.*across|how.*mix.*changed|stacked.*time)\b/i,/\b(over time.*share|over time.*composition|over time.*breakdown)\b/i]},{intent:"distribution",weight:4,patterns:[/\b(distribution|distributions|spread|variance|variation|histogram|skew|skewed|range of|how.*spread|shape of|bell curve)\b/i,/\b(typical value|typical range|where do most|mode|median)\b/i]},{intent:"correlation",weight:4,patterns:[/\b(correl|correlation|relationship|related to|connected to|associated|connection between|relate to)\b/i,/\b(\w+ vs\.? \w+|\w+ versus \w+|\w+ against \w+|scatter)\b/i]},{intent:"compare-series",weight:3,patterns:[/\b(compare.*series|compare.*groups|compare.*cohorts|side by side|group.*vs|series.*vs)\b/i,/\b(how do.*compare|each group|each series|each cohort)\b/i]},{intent:"compare-categories",weight:3,patterns:[/\b(compare.*categor|category.*compar|which is bigger|how does.*compare|differences? between)\b/i]},{intent:"flow",weight:4,patterns:[/\b(flow|flows|transition|transitions|movement|moved from|funnel|conversion|drop[- ]off|sankey|chord)\b/i,/\b(from.*to|source.*target|path|journey|pipeline)\b/i]},{intent:"hierarchy",weight:4,patterns:[/\b(hierarchy|hierarchical|tree|nested|parent.*child|subcategory|sub-?categor|drill down|drilldown|breakdown by level)\b/i]},{intent:"geo",weight:5,patterns:[/\b(geographic|geography|geospatial|map|maps|country|countries|cities|latitude|longitude|spatial|cartogr|choropleth)\b/i,/\b(city|us state|each state|the states)\b/i,/\bacross\s+(countries|states|regions|cities|the world|the country)\b/i]}];function Yi(e){if("string"!=typeof e||0===e.trim().length)return null;const t=new Map;for(const r of Qi)for(const a of r.patterns)if(a.test(e)){const e=t.get(r.intent)??0;t.set(r.intent,Math.min(5,0===e?r.weight:e+.5));break}if(0===t.size)return null;const r=Array.from(t.entries()).map(([e,t])=>({intent:e,confidence:t})).sort((e,t)=>t.confidence-e.confidence),[a,...i]=r;return{intent:a.intent,confidence:a.confidence,alternates:i}}function Zi(e,t={}){const r=t.audience;if(!r)return[];const a=t.profile??Kr(e??[],{rawInput:t.rawInput}),i=pi(r),n=t.scoreTolerance??1.5,o=t.maxResults??5,s=oi(),c=new Map;for(const e of s)c.set(e.component,mi(e.component,e.rubric.familiarity,r));const l=wi(e,{profile:a,intent:t.intent,maxResults:30,includeVariants:!0,minScore:1,allow:t.allow,deny:t.deny}),u=l.filter(e=>(c.get(e.component)??e.rubric.familiarity)>=4)[0],d=[];for(const e of l)(c.get(e.component)??e.rubric.familiarity)>i||("increase"===r.targets?.[e.component]?.direction||!u||n>=u.score-e.score)&&d.push({stretch:e,familiar:u});const m=new Set,p=[];for(const{stretch:e,familiar:t}of d){const a=`${e.component}/${e.variant?.key??"base"}`;if(m.has(a))continue;m.add(a);const i=c.get(e.component)??e.rubric.familiarity,n=r.targets?.[e.component],s=n?.reason??("increase"===n?.direction?`${r.name??"your audience"} is growing adoption of ${e.component}`:t?`${e.component} is on the data, and within reach of ${t.component} which you're already familiar with`:e.component+" fits this data and would expand your team's vocabulary");if(p.push({suggestion:e,replacing:t?.component,rationale:s,familiarity:i}),p.length>=o)break}return p}function Ji(e,t={}){const r=t.profile??Kr(e??[],{rawInput:t.rawInput}),a=t.maxPanels??6,i=!1!==t.diversifyByFamily,n=t.intents??function(e){const t=[];return e.hasTimeAxis&&(t.push("trend"),e.seriesCount&&e.seriesCount>=2&&t.push("compare-series","composition-over-time"),t.push("change-detection")),e.categoryCount&&t.push("rank","compare-categories","part-to-whole"),e.primary.y&&e.rowCount>=10&&t.push("distribution"),2>Object.values(e.fields).filter(e=>"numeric"===e.type).length||t.push("correlation","outlier-detection"),e.hasHierarchy&&t.push("hierarchy"),e.hasNetwork&&t.push("flow"),e.hasGeo&&t.push("geo"),Array.from(new Set(t))}(r),o=[],s=[],c=[],l=new Set,u=new Set;for(const d of n){if(o.length>=a){c.push(d);continue}const n=wi(e,{profile:r,intent:d,allow:t.allow,deny:t.deny,maxResults:20,includeVariants:!0,minScore:1.5,audience:t.audience});let m;for(const e of n)if(!(u.has(`${e.component}/${e.variant?.key??"base"}`)||i&&l.has(e.family))){m=e;break}if(!m&&i)for(const e of n)if(!u.has(`${e.component}/${e.variant?.key??"base"}`)){m=e;break}m?(o.push({intent:d,suggestion:m}),s.push(d),l.add(m.family),u.add(`${m.component}/${m.variant?.key??"base"}`)):c.push(d)}return{panels:o,intentsCovered:s,intentsMissing:c,stretchPanels:t.audience&&(t.audience.exposureLevel??1)>0?Zi(e,{profile:r,audience:t.audience,deny:Array.from(u).map(e=>e.split("/")[0]),maxResults:t.maxStretchPanels??Math.min(3,a)}):[],profile:r}}var en={name:"Executive",familiarity:{BarChart:5,LineChart:5,PieChart:5,DonutChart:4,GaugeChart:5,AreaChart:4,FunnelChart:4,ChoroplethMap:4,Histogram:3,Heatmap:3,StackedBarChart:3,StackedAreaChart:3,Scatterplot:3,BubbleChart:3,GroupedBarChart:3,DotPlot:3,BoxPlot:2,ViolinPlot:1,SwarmPlot:1,RidgelinePlot:1,MultiAxisLineChart:2,CandlestickChart:2,DifferenceChart:2,QuadrantChart:3,LikertChart:3,SwimlaneChart:2,MinimapChart:2,ConnectedScatterplot:1,SankeyDiagram:2,TreeDiagram:3,Treemap:3,CirclePack:2,OrbitDiagram:1,ChordDiagram:1,ProcessSankey:2,ForceDirectedGraph:1,ProportionalSymbolMap:3,FlowMap:2,DistanceCartogram:1},targets:{PieChart:{direction:"decrease",weight:1,reason:"shifting from share-by-angle toward share-by-length for accuracy"},BarChart:{direction:"increase",weight:1}},exposureLevel:1},tn={name:"Analyst",familiarity:{BarChart:5,LineChart:5,PieChart:4,DonutChart:4,AreaChart:5,StackedAreaChart:4,StackedBarChart:5,GroupedBarChart:5,Histogram:5,Heatmap:5,Scatterplot:5,BubbleChart:4,BoxPlot:4,DotPlot:4,GaugeChart:3,FunnelChart:4,LikertChart:4,QuadrantChart:4,SwimlaneChart:4,MinimapChart:4,DifferenceChart:3,MultiAxisLineChart:4,CandlestickChart:3,ConnectedScatterplot:3,ViolinPlot:3,SwarmPlot:3,RidgelinePlot:2,TreeDiagram:4,Treemap:4,CirclePack:3,SankeyDiagram:4,ProcessSankey:3,ChordDiagram:3,OrbitDiagram:2,ForceDirectedGraph:3,ChoroplethMap:4,ProportionalSymbolMap:4,FlowMap:3,DistanceCartogram:2},targets:{PieChart:{direction:"decrease",weight:1},BoxPlot:{direction:"increase",weight:1,reason:"team is shifting from averages to distribution-aware comparisons"}},exposureLevel:1},rn={name:"Data scientist",familiarity:{BarChart:5,LineChart:5,PieChart:3,DonutChart:3,AreaChart:5,StackedAreaChart:5,StackedBarChart:5,GroupedBarChart:5,Histogram:5,Heatmap:5,Scatterplot:5,BubbleChart:5,BoxPlot:5,ViolinPlot:5,SwarmPlot:4,RidgelinePlot:4,DotPlot:4,QuadrantChart:4,LikertChart:4,DifferenceChart:4,MultiAxisLineChart:4,ConnectedScatterplot:4,GaugeChart:2,FunnelChart:3,SwimlaneChart:3,MinimapChart:4,CandlestickChart:3,TreeDiagram:4,Treemap:4,CirclePack:4,SankeyDiagram:4,ProcessSankey:3,ChordDiagram:3,OrbitDiagram:2,ForceDirectedGraph:4,ChoroplethMap:4,ProportionalSymbolMap:4,FlowMap:3,DistanceCartogram:3},targets:{PieChart:{direction:"decrease",weight:2,reason:"preferring length-encoded comparisons for precision"},BarChart:{direction:"decrease",weight:1,reason:"promoting distribution-aware charts over single-value bars when raw observations are available"},BoxPlot:{direction:"increase",weight:1},ViolinPlot:{direction:"increase",weight:1}},exposureLevel:2},an={executive:en,analyst:tn,"data-scientist":rn},nn=[{component:"RealtimeLineChart",importPath:"semiotic/realtime",rubric:{familiarity:4,accuracy:4,precision:3},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"y"===e.role||"value"===e.role)?"high"===e.throughput?"for high-throughput streams, prefer RealtimeHeatmap or RealtimeWaterfallChart":null:"needs a numeric value field":"needs a date/time field for the x axis",intentScores:{trend:5,"change-detection":4,"outlier-detection":2},caveats:e=>{const t=[];return"cumulative"===e.retention&&t.push("cumulative retention will eventually exhaust the buffer — set a windowSize or downsample"),t},buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"y"===e.role||"value"===e.role||"numeric"===e.kind)?.name;return{timeAccessor:t,valueAccessor:r}}},{component:"RealtimeHistogram",importPath:"semiotic/realtime",rubric:{familiarity:3,accuracy:4,precision:3},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?null:"needs a numeric field to bin":"needs a time field",intentScores:{distribution:5,"outlier-detection":4,"change-detection":2},buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"value"===e.role||"numeric"===e.kind)?.name;return{timeAccessor:t,valueAccessor:r}}},{component:"RealtimeSwarmChart",importPath:"semiotic/realtime",rubric:{familiarity:2,accuracy:4,precision:4},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?e.fields.some(e=>"categorical"===e.kind||"category"===e.role)?null:"needs a category to swarm by":"needs a numeric field":"needs a time field (points are placed at (time, value))",intentScores:{"outlier-detection":5,distribution:4,"compare-categories":3},caveats:e=>"high"===e.throughput?["high-throughput swarms get crowded — consider RealtimeHistogram"]:[],buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"value"===e.role||"numeric"===e.kind)?.name,a=e.fields.find(e=>"category"===e.role||"categorical"===e.kind)?.name;return{timeAccessor:t,valueAccessor:r,categoryAccessor:a}}},{component:"RealtimeWaterfallChart",importPath:"semiotic/realtime",rubric:{familiarity:2,accuracy:4,precision:3},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?null:"needs a numeric value field":"needs a time field",intentScores:{"change-detection":5,trend:3,"outlier-detection":4,distribution:e=>"high"===e.throughput?4:2},buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"value"===e.role||"numeric"===e.kind)?.name;return{timeAccessor:t,valueAccessor:r}}},{component:"RealtimeHeatmap",importPath:"semiotic/realtime",rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?null:"needs a numeric value field":"needs a time field for the x axis",intentScores:{trend:e=>"high"===e.throughput?4:2,distribution:3,"change-detection":3,"compare-series":e=>e.fields.find(e=>"series"===e.role||"categorical"===e.kind&&"category"!==e.role)?4:1},buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"y"===e.role||"value"===e.role||"numeric"===e.kind)?.name,a=e.fields.find(e=>"category"===e.role||"categorical"===e.kind&&"series"!==e.role)?.name;return{timeAccessor:t,valueAccessor:r,...a?{categoryAccessor:a}:{}}}},{component:"TemporalHistogram",importPath:"semiotic/realtime",rubric:{familiarity:3,accuracy:4,precision:3},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?"windowed"===e.retention?"windowed retention is RealtimeHistogram's job; TemporalHistogram serves bounded/cumulative data":null:"needs a numeric value field":"needs a time field",intentScores:{distribution:5,"change-detection":3,trend:2},buildProps:e=>{const t=e.fields.find(e=>"value"===e.role||"numeric"===e.kind)?.name,r=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name;return{timeAccessor:r,valueAccessor:t}}}],on=new Map;function sn(e){on.set(e.component,e)}function cn(e){on.delete(e)}function ln(){if(0===on.size)return nn;const e=new Map;for(const t of nn)e.set(t.component,t);for(const[t,r]of on)e.set(t,r);return Array.from(e.values())}function un(e,t){if(void 0===e)return 0;const r="function"==typeof e?e(t):e;return Number.isFinite(r)?Math.max(0,Math.min(5,r)):0}function dn(e,t){if(0===t.length){const t=Object.values(e).filter(e=>"number"==typeof e&&e>0);return 0===t.length?0:t.reduce((e,t)=>e+t,0)/t.length}let r=0;for(const a of t)r+=e[a]??0;return r/t.length}function mn(e,t,r){const a=[],i=r.map(e=>({intent:e,score:t[e]??0})).filter(e=>e.score>=3).sort((e,t)=>t.score-e.score).slice(0,2);for(const{intent:e,score:t}of i)a.push(`Strong fit for ${e} (${t}/5)`);return e.throughput&&a.push(`tuned for ${e.throughput} throughput`),a}function pn(e,t={}){const r=t.capabilities??ln(),a=t.intent?Array.isArray(t.intent)?t.intent:[t.intent]:[],i=t.minScore??0,n=t.maxResults??10,o=t.allow?new Set(t.allow):null,s=t.deny?new Set(t.deny):null,c=[];for(const t of r){if(o&&!o.has(t.component))continue;if(s&&s.has(t.component))continue;if(null!==t.fits(e))continue;const r={};for(const[a,i]of Object.entries(t.intentScores))r[a]=un(i,e);const n=dn(r,a);if(i>n)continue;const l={...t.rubric},u=t.caveats?Array.from(t.caveats(e)):[],d=mn(e,r,a),m=t.buildProps(e);c.push({component:t.component,family:"realtime",importPath:t.importPath,score:n,intentScores:r,rubric:l,reasons:d,caveats:u,props:m})}return c.sort((e,t)=>t.score!==e.score?t.score-e.score:t.rubric.accuracy!==e.rubric.accuracy?t.rubric.accuracy-e.rubric.accuracy:t.rubric.familiarity-e.rubric.familiarity),c.slice(0,n)}var hn=["x","y","size","category","series","time"];function yn(e,t){const r=e.fields[t];return r?"numeric"===r.type?"numeric":"categorical"===r.type?"categorical":"date"===r.type?"date":"unknown":"unknown"}function fn(e){const t=new Set;for(const r of oi())null===r.fits(e)&&t.add(r.component);return t}function gn(e,t){const r=new Set(Object.keys(e.fields)),a=new Set(Object.keys(t.fields)),i=[],n=[];for(const e of a)r.has(e)||i.push(e);for(const e of r)a.has(e)||n.push(e);i.sort(),n.sort();const o=[];for(const i of a){if(!r.has(i))continue;const a=yn(e,i),n=yn(t,i);a!==n&&o.push({field:i,from:a,to:n})}o.sort((e,t)=>e.field.localeCompare(t.field));const s=[];for(const r of hn){const a=e.primary[r],i=t.primary[r];a!==i&&s.push({role:r,from:a,to:i})}const c=fn(e),l=fn(t),u=Array.from(c).filter(e=>!l.has(e)).sort(),d=Array.from(l).filter(e=>!c.has(e)).sort();return{rowCountChange:t.rowCount-e.rowCount,added:i,removed:n,typeChanges:o,primaryChanges:s,becameUnfit:u,becameFit:d,unchanged:0===i.length&&0===n.length&&0===o.length&&0===s.length&&0===u.length&&0===d.length&&e.rowCount===t.rowCount}}function bn(e,t=oi()){const r=new Map;for(const e of t)r.set(e.component,{component:e.component,family:e.family,fitsOn:0,rejectedOn:0,inTopThreeOn:0,topPickOn:0,expertAgreementCount:0,averageScore:0,caveatCoverage:0,variantUtilization:0});const a=new Map,i=new Map,n=new Map,o=new Map,s=[];for(const c of e){let e,l;try{e=Kr(c.data,{rawInput:c.rawInput}),l=ki(c.data,{profile:e,intent:c.intent,capabilities:t,maxResults:40})}catch{const e=!!c.expected&&c.expected.length>0;s.push({fixture:c.name,shape:c.shape,intent:c.intent,expected:c.expected,topPick:void 0,topThree:[],fittingCount:0,rejectedCount:0,expertAgreement:!e&&null,topPickAgreement:!e&&null,noFitHonored:null});continue}const u=[],d=new Set;for(const e of l.fitting)if(!d.has(e.component)&&(d.add(e.component),u.push({component:e.component,variantKey:e.variant?.key,score:e.score}),3===u.length))break;const m=c.expected&&c.expected.length>0?u.some(e=>c.expected.includes(e.component)):null,p=c.expected&&c.expected.length>0?u.length>0&&c.expected.includes(u[0].component):null;s.push({fixture:c.name,shape:c.shape,intent:c.intent,expected:c.expected,topPick:u[0],topThree:u,fittingCount:l.fitting.length,rejectedCount:l.rejected.length,expertAgreement:m,topPickAgreement:p,noFitHonored:!0===c.expectsNoFit?0===l.fitting.length:null});for(const e of l.fitting){const t=r.get(e.component);t&&(t.fitsOn+=1,a.set(e.component,(a.get(e.component)??0)+e.score),i.set(e.component,(i.get(e.component)??0)+1),e.caveats.length>0&&n.set(e.component,(n.get(e.component)??0)+1),e.variant&&o.set(e.component,(o.get(e.component)??0)+1))}for(const e of l.rejected){const t=r.get(e.component);t&&(t.rejectedOn+=1)}for(const e of u){const t=r.get(e.component);t&&(t.inTopThreeOn+=1)}if(u[0]){const e=r.get(u[0].component);e&&(e.topPickOn+=1)}if(c.expected&&m)for(const e of u)if(c.expected.includes(e.component)){const t=r.get(e.component);t&&(t.expertAgreementCount+=1)}}for(const e of r.values()){const t=i.get(e.component)??0;e.averageScore=0===t?0:(a.get(e.component)??0)/t,e.caveatCoverage=0===t?0:(n.get(e.component)??0)/t,e.variantUtilization=0===t?0:(o.get(e.component)??0)/t}const c=Array.from(r.values()).sort((e,t)=>{const r=e.expertAgreementCount-t.expertAgreementCount;return 0!==r?r:t.fitsOn-e.fitsOn}),l=s.filter(e=>null!==e.expertAgreement),u=0===l.length?0:l.filter(e=>!0===e.expertAgreement).length/l.length,d=0===l.length?0:l.filter(e=>!0===e.topPickAgreement).length/l.length,m=Array.from(i.values()).reduce((e,t)=>e+t,0),p=Array.from(n.values()).reduce((e,t)=>e+t,0),h=Array.from(o.values()).reduce((e,t)=>e+t,0);return{perCapability:c,perFixture:s,summary:{fixtureCount:e.length,capabilityCount:t.length,expertAgreementRate:u,top1AgreementRate:d,overallCaveatCoverage:0===m?0:p/m,overallVariantUtilization:0===m?0:h/m}}}var vn=(()=>{const e=Array.from({length:12},(e,t)=>t+1);return["EU","NA","APAC"].flatMap((t,r)=>e.map(e=>({month:e,revenue:800+e*(200+40*r)+150*Math.sin(e),region:t})))})(),wn=Array.from({length:12},(e,t)=>({month:t+1,revenue:1e3+150*t+100*Math.sin(t/2)})),kn=[{product:"Widget",units:480},{product:"Gadget",units:620},{product:"Sprocket",units:290},{product:"Whatsit",units:740},{product:"Doohickey",units:410}],Cn=Array.from({length:150},(e,t)=>({respondent_id:t+1,satisfaction:Math.max(1,Math.min(10,6+2*Math.sin(t/7)+3*Math.random()-1)),cohort:["Beta","GA","Enterprise"][t%3]})),xn=Array.from({length:80},(e,t)=>{const r=Math.max(0,40*Math.random());return{student_id:"s"+(t+1),hours:r,grade:Math.min(100,1.8*r+30+20*(Math.random()-.5))}}),An=Array.from({length:50},(e,t)=>({observation:50+12*Math.sin(t/4)+6*Math.random()})),Sn=[{product:"Widget",region:"EU",units:480},{product:"Widget",region:"NA",units:620},{product:"Widget",region:"APAC",units:290},{product:"Gadget",region:"EU",units:320},{product:"Gadget",region:"NA",units:740},{product:"Gadget",region:"APAC",units:410},{product:"Sprocket",region:"EU",units:200},{product:"Sprocket",region:"NA",units:380},{product:"Sprocket",region:"APAC",units:150},{product:"Whatsit",region:"EU",units:290},{product:"Whatsit",region:"NA",units:550},{product:"Whatsit",region:"APAC",units:180}],Pn=[{name:"monthly revenue with regions, intent=trend",shape:"12 months × 3 regions, numeric month, numeric revenue",data:vn,intent:"trend",expected:["LineChart","AreaChart","MinimapChart"]},{name:"monthly revenue with regions, intent=compare-series",shape:"12 months × 3 regions",data:vn,intent:"compare-series",expected:["LineChart","GroupedBarChart"]},{name:"monthly revenue with regions, intent=composition-over-time",shape:"12 months × 3 regions, additive",data:vn,intent:"composition-over-time",expected:["StackedAreaChart","StackedBarChart"]},{name:"monthly revenue single series, intent=trend",shape:"12 months, no series",data:wn,intent:"trend",expected:["LineChart","AreaChart"]},{name:"product sales, intent=rank",shape:"5 products, single numeric measure",data:kn,intent:"rank",expected:["BarChart","DotPlot"]},{name:"product sales, intent=part-to-whole",shape:"5 products, single numeric measure",data:kn,intent:"part-to-whole",expected:["PieChart","DonutChart","BarChart"]},{name:"satisfaction scores, intent=distribution",shape:"150 numeric observations across 3 cohorts",data:Cn,intent:"distribution",expected:["Histogram","BoxPlot","ViolinPlot"]},{name:"satisfaction scores, intent=compare-categories",shape:"150 obs × 3 cohorts",data:Cn,intent:"compare-categories",expected:["BoxPlot","ViolinPlot","SwarmPlot"]},{name:"hours vs grade, intent=correlation",shape:"80 students, hours + grade",data:xn,intent:"correlation",expected:["Scatterplot"]},{name:"hours vs grade, intent=outlier-detection",shape:"80 students",data:xn,intent:"outlier-detection",expected:["Scatterplot"]},{name:"conversion funnel, intent=flow",shape:"4 stages, descending values",data:[{stage:"Visit",users:1e4},{stage:"Signup",users:2400},{stage:"Trial",users:1100},{stage:"Paid",users:380}],intent:"flow",expected:["FunnelChart"]},{name:"org chart, intent=hierarchy",shape:"3-deep org tree",data:[],rawInput:{name:"Acme",children:[{name:"Engineering",children:[{name:"Platform",value:18},{name:"Product",value:22}]},{name:"Sales",children:[{name:"EMEA",value:12},{name:"AMER",value:26}]},{name:"Ops",value:9}]},intent:"hierarchy",expected:["TreeDiagram","Treemap","CirclePack"]},{name:"approval workflow transitions, intent=flow",shape:"5 nodes / 4 weighted edges",data:[],rawInput:{nodes:[{id:"draft"},{id:"review"},{id:"approved"},{id:"shipped"},{id:"rejected"}],edges:[{source:"draft",target:"review",value:100},{source:"review",target:"approved",value:60},{source:"review",target:"rejected",value:40},{source:"approved",target:"shipped",value:58}]},intent:"flow",expected:["SankeyDiagram","ChordDiagram"]},{name:"US states with values, intent=geo",shape:"3 polygon features with numeric values",data:[],rawInput:{type:"FeatureCollection",features:[{type:"Feature",id:"CA",properties:{name:"California",value:39},geometry:{type:"Polygon",coordinates:[[[-124,32],[-114,32],[-114,42],[-124,42],[-124,32]]]}},{type:"Feature",id:"TX",properties:{name:"Texas",value:29},geometry:{type:"Polygon",coordinates:[[[-106,26],[-93,26],[-93,36],[-106,36],[-106,26]]]}},{type:"Feature",id:"NY",properties:{name:"New York",value:19},geometry:{type:"Polygon",coordinates:[[[-79,40],[-72,40],[-72,45],[-79,45],[-79,40]]]}}]},intent:"geo",expected:["ChoroplethMap","ProportionalSymbolMap"]},{name:"country economies, intent=correlation",shape:"10 countries × 3 numeric measures (gdp, hours, population)",data:[{country:"USA",gdp_per_capita:70,hours_worked:1700,population_size:330},{country:"UK",gdp_per_capita:48,hours_worked:1500,population_size:67},{country:"Germany",gdp_per_capita:53,hours_worked:1330,population_size:84},{country:"Japan",gdp_per_capita:40,hours_worked:1600,population_size:125},{country:"France",gdp_per_capita:45,hours_worked:1480,population_size:67},{country:"Italy",gdp_per_capita:38,hours_worked:1700,population_size:60},{country:"Spain",gdp_per_capita:32,hours_worked:1640,population_size:47},{country:"Canada",gdp_per_capita:52,hours_worked:1690,population_size:38},{country:"Australia",gdp_per_capita:56,hours_worked:1700,population_size:26},{country:"South Korea",gdp_per_capita:35,hours_worked:1900,population_size:52}],intent:"correlation",expected:["Scatterplot","BubbleChart"]},{name:"website metrics with 3 measures, intent=compare-series",shape:"24 months × 3 numeric measures with different ranges",data:Array.from({length:24},(e,t)=>({month:t+1,page_views:Math.round(5e4+1200*t+8e3*Math.sin(t/3)),conversion_rate:2.5+.8*Math.sin(t/4)+.05*t,avg_session_seconds:Math.round(120+2*t+15*Math.cos(t/5))})),intent:"compare-series",expected:["MultiAxisLineChart","LineChart"]},{name:"sales by region and product, intent=compare-series",shape:"12 rows = 4 products × 3 regions",data:Sn,intent:"compare-series",expected:["GroupedBarChart","StackedBarChart"]},{name:"sales by region and product, intent=part-to-whole",shape:"12 rows = 4 products × 3 regions",data:Sn,intent:"part-to-whole",expected:["StackedBarChart","PieChart"]},{name:"revenue vs expenses, intent=compare-series",shape:"48 rows = 24 months × 2 series",data:[...Array.from({length:24},(e,t)=>({month:t+1,amount:100+8*t+25*Math.sin(t/3),series:"revenue"})),...Array.from({length:24},(e,t)=>({month:t+1,amount:80+6*t+15*Math.cos(t/4),series:"expenses"}))],intent:"compare-series",expected:["DifferenceChart","LineChart","GroupedBarChart"]},{name:"stock OHLC prices, intent=change-detection",shape:"30 days × open/high/low/close",data:Array.from({length:30},(e,t)=>{const r=100+1.2*t+8*Math.sin(t/4),a=r+4*(Math.random()-.5),i=r+4*(Math.random()-.5);return{day:t+1,open:a,high:Math.max(a,i)+3*Math.random(),low:Math.min(a,i)-3*Math.random(),close:i}}),intent:"change-detection",expected:["CandlestickChart","LineChart"]},{name:"unemployment vs inflation by year, intent=correlation",shape:"20 years × 2 measures, ordered by year",data:Array.from({length:20},(e,t)=>({year:2005+t,unemployment:5+2*Math.sin(t/2)+(t>4&&10>t?3:0),inflation:2+1.5*Math.cos(t/3)})),intent:"correlation",expected:["ConnectedScatterplot","Scatterplot"]},{name:"transition events, intent=flow",shape:"11 stage transitions across 3 deals with startTime + value",data:[{case:"deal-001",stage:"Inbound Lead",nextStage:"Qualified",startTime:"2024-04-01T09:00:00",value:18},{case:"deal-001",stage:"Qualified",nextStage:"Discovery",startTime:"2024-04-01T13:00:00",value:16},{case:"deal-001",stage:"Discovery",nextStage:"Proposal",startTime:"2024-04-02T11:00:00",value:14},{case:"deal-001",stage:"Proposal",nextStage:"Closed Won",startTime:"2024-04-04T09:00:00",value:12},{case:"deal-002",stage:"Inbound Lead",nextStage:"Qualified",startTime:"2024-04-01T10:00:00",value:10},{case:"deal-002",stage:"Qualified",nextStage:"Discovery",startTime:"2024-04-02T09:00:00",value:9},{case:"deal-002",stage:"Discovery",nextStage:"Proposal",startTime:"2024-04-03T09:00:00",value:7},{case:"deal-002",stage:"Proposal",nextStage:"Closed Lost",startTime:"2024-04-04T11:00:00",value:5},{case:"deal-003",stage:"Signup",nextStage:"Activated",startTime:"2024-04-01T08:30:00",value:28},{case:"deal-003",stage:"Activated",nextStage:"Trial",startTime:"2024-04-01T10:00:00",value:24},{case:"deal-003",stage:"Trial",nextStage:"Subscribed",startTime:"2024-04-02T10:00:00",value:18}],intent:"flow",expected:["SankeyDiagram","ProcessSankey","ChordDiagram"]},{name:"incidents by service and weekday, intent=compare-categories",shape:"56 cells = 8 services × 7 weekdays, numeric incident count",data:(()=>{const e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return["auth","billing","search","ingest","notify","reports","exports","webhooks"].flatMap((t,r)=>e.map((e,a)=>({service:t,day:e,incidents:Math.round(2+9*Math.abs(Math.sin(1.7*r+a))+(5>a?1.5:-1.5))})))})(),intent:"compare-categories",expected:["Heatmap","GroupedBarChart"]},{name:"capacity utilization single value, intent=part-to-whole",shape:"1 row, one numeric value against an implicit 0–100 plan",data:[{metric:"Cluster capacity used",value:78}],intent:"part-to-whole",expected:["GaugeChart","BigNumber"]},{name:"shipping flows between cities, intent=flow",shape:"6 lat/lon nodes, 6 weighted flows, 1 outline feature",data:[],rawInput:{type:"FeatureCollection",features:[{type:"Feature",id:"outline",properties:{name:"Region"},geometry:{type:"Polygon",coordinates:[[[-125,24],[-66,24],[-66,50],[-125,50],[-125,24]]]}}],points:[{id:"SEA",lon:-122.3,lat:47.6},{id:"SFO",lon:-122.4,lat:37.8},{id:"DEN",lon:-104.9,lat:39.7},{id:"ORD",lon:-87.6,lat:41.9},{id:"ATL",lon:-84.4,lat:33.7},{id:"JFK",lon:-73.8,lat:40.6}],flows:[{source:"SEA",target:"ORD",value:320},{source:"SFO",target:"JFK",value:540},{source:"SFO",target:"ATL",value:210},{source:"DEN",target:"ORD",value:180},{source:"ORD",target:"JFK",value:460},{source:"ATL",target:"JFK",value:250}]},intent:"flow",expected:["FlowMap"]},{name:"travel times from HQ, intent=geo",shape:"6 lat/lon points with a cost field measured from a center",data:[],rawInput:{type:"FeatureCollection",features:[{type:"Feature",id:"outline",properties:{name:"Region"},geometry:{type:"Polygon",coordinates:[[[-125,24],[-66,24],[-66,50],[-125,50],[-125,24]]]}}],points:[{id:"HQ",lon:-122.4,lat:37.8,cost:0},{id:"Seattle",lon:-122.3,lat:47.6,cost:95},{id:"Denver",lon:-104.9,lat:39.7,cost:150},{id:"Chicago",lon:-87.6,lat:41.9,cost:245},{id:"Atlanta",lon:-84.4,lat:33.7,cost:280},{id:"New York",lon:-73.8,lat:40.6,cost:330}]},intent:"geo",expected:["DistanceCartogram","ProportionalSymbolMap"]},{name:"flat single column",shape:"50 rows, one numeric column",data:An,expected:["Histogram"]},{name:"sparse 3-row data, intent=rank",shape:"3 rows total",data:[{name:"A",value:12},{name:"B",value:34},{name:"C",value:8}],intent:"rank",expected:["BarChart","DotPlot"]}];import{useEffect as Mn,useMemo as Dn,useRef as Tn,useSyncExternalStore as Fn}from"react";var $n=e=>X(e),jn=()=>I().enabled,Nn=()=>!1;function Bn(e,t={}){const{intent:r,allow:a,deny:i,maxResults:n,includeVariants:o,minScore:s,rawInput:c,seriesField:l,capabilities:u,audience:d,profile:m}=t,p=Dn(()=>m??Kr(e??[],{rawInput:c,seriesField:l}),[m,e,c,l]),h=Dn(()=>wi(e,{intent:r,allow:a,deny:i,maxResults:n,includeVariants:o,minScore:s,capabilities:u,audience:d,profile:p}),[e,r,a,i,n,o,s,u,d,p]),y=Fn($n,jn,Nn),f=Tn(null);return Mn(()=>{if(0===h.length)return void(f.current=null);if(!y)return void(f.current=null);const e=I(),t=d?.name??(d?"custom":void 0),a=`${r??""}|${t??""}|${h.map(e=>e.component).join(",")}`;if(a===f.current)return;const i=e.getEvents();for(let e=i.length-1;e>=0;e--){const t=i[e];if("suggestion-shown"===t.type){if(`${Array.isArray(t.intent)?t.intent.join(","):t.intent??""}|${t.audience??""}|${t.components.join(",")}`===a)return void(f.current=a);break}}f.current=a,e.record({type:"suggestion-shown",intent:r,components:h.map(e=>e.component),topScore:h[0]?.score,audience:t})},[h,r,d,y]),{suggestions:h,profile:p}}import*as Rn from"react";function zn(t){const r=Pe(t.recipe)??(t.recipeId?he(t.recipeId):void 0);if(!r)throw Error(`Unknown chart recipe "${t.recipeId??"(missing recipeId)"}". Register it before rendering.`);const a=function(e){return"function"==typeof e.layout?e.layout:ve(e.layout)?ye(e.layout.id):void 0}(r);if(!a){const e=ve(r.layout)?r.layout.id:r.id;throw Error(`No runtime layout registered for chart recipe "${r.id}" (${e}).`)}const i="semiotic-chart-recipe semiotic-chart-recipe-"+r.id.replace(/[^a-zA-Z0-9_-]+/g,"-"),n={...t,chartId:t.chartId??r.id,className:t.className?`${i} ${t.className}`:i,recipeId:r.id,recipe:r,layout:a},o="XYFrame"===r.frameFamily||"XYCustomChart"===r.frameFamily?Ye:"OrdinalFrame"===r.frameFamily||"OrdinalCustomChart"===r.frameFamily?ct:"NetworkFrame"===r.frameFamily||"NetworkCustomChart"===r.frameFamily?bt:"GeoFrame"===r.frameFamily||"GeoCustomChart"===r.frameFamily?e:void 0;if(!o)throw Error(`Chart recipe "${r.id}" uses unsupported frame family "${r.frameFamily}".`);return Rn.createElement(o,n)}function _n(e){const t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:t+""}function In(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function On(e){return"number"==typeof e&&Number.isFinite(e)}function qn(e){if(On(e.x)&&On(e.y)&&On(e.w)&&On(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(On(e.x)&&On(e.y)&&On(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(On(e.cx)&&On(e.cy)&&On(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(On(e.cx)&&On(e.cy)&&On(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};const t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&On(e[0])&&On(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function Hn(e,t){const r=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.min(Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0));return a>0?r/a:0}function Ln(e,t,r,a,i){if(e===t)return!0;const n=r.dataRoles.map(e=>le(e,a,i)).filter(e=>!!e).filter(r=>null!=e[r]&&null!=t[r]);return n.length>0&&n.every(r=>e[r]+""==t[r]+"")}function Gn(e,t,r,a,i,n="warn",o){return{id:e,category:t,status:r?"pass":n,message:r?a:i,...o?{evidence:o}:{}}}function En(e){const{recipe:t}=e,r=function(e){return Array.isArray(e)?e:e&&"object"==typeof e?[...e.nodes??e.sceneNodes??[],...e.sceneEdges??[]]:[]}(e.scene),a=e.layoutConfig??ke({layoutConfig:e.layoutConfig}),i=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},o=i.x??0,s=i.y??0,c=[],l=r.filter(e=>null!=In(e)),u=r.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||function(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));c.push(Gn("geometry.finite","geometry",0===u.length,"All emitted geometry is finite.",u.length+" marks contain non-finite geometry.","fail",{count:u.length}));const d=r.map(qn),m=d.filter(e=>e&&(e.x0>=e.x1||e.y0>=e.y1)).length;c.push(Gn("geometry.nonzero-area","geometry",0===m,"All bounded marks have positive area.",m+" marks have zero or negative area.","warn",{count:m}));const p=d.filter(e=>e&&(o>e.x0||s>e.y0||e.x1>o+i.width||e.y1>s+i.height)).length;c.push(Gn("geometry.bounds","geometry",0===p,"All bounded marks stay inside the plot.",p+" marks extend outside the plot bounds.","warn",{count:p}));const h=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,y=d.filter(e=>!!e&&(h>e.x1-e.x0||h>e.y1-e.y0)).length;c.push(Gn("interaction.target-size","interaction",0===y,`All bounded targets meet the declared ${h}px minimum.`,`${y} targets are smaller than ${h}px in at least one dimension.`,"warn",{count:y,minimumTarget:h}));const f=l.map(_n),g=f.filter(e=>!e).length,b=new Set,v=f.filter(e=>!(!e||!b.has(e)&&(b.add(e),1)));c.push(Gn("identity.stable-ids","identity",0===g,"Every data-bearing mark exposes a stable id.",g+" data-bearing marks have no pointId, id, or transition key.",t.audit?.requireStableIds?"fail":"warn",{missing:g})),c.push(Gn("identity.unique-ids","identity",0===v.length,"Stable mark ids are unique.",v.length+" duplicate stable ids were observed.","fail",{duplicates:[...new Set(v)].slice(0,10)}));const w=f.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;w>0&&c.push({id:"identity.index-pattern",category:"identity",status:"warn",message:w+" ids look index-derived and may change when data is reordered.",remediation:"Derive ids from a declared identifier role or stable domain key."});const k=new Set;let C=0;const x=e.inputData;for(const e of l){const r=In(e),i=Array.isArray(r)?r:[r];let n=!1;for(const e of i)if(e&&"object"==typeof e)for(let r=0;x.length>r;r+=1)Ln(e,x[r],t,a,x)&&(k.add(r),n=!0);n||(C+=1)}const A=Math.max(0,x.length-k.size);c.push(Gn("coverage.input-data","coverage",0===A,"Every input datum is represented by the observed scene.",A+" input data items have no matching scene mark.",t.audit?.requireDatumCoverage?"fail":"warn",{represented:k.size,input:x.length})),c.push(Gn("coverage.scene-data","coverage",0===C,"Every data-bearing scene mark maps back to input data.",C+" scene marks do not map back to an input datum.","warn",{count:C}));const S=t.encodings?.some(e=>"count"===e.channel);!S&&l.length>k.size&&k.size>0&&c.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});const P=l.filter(e=>!1===e.interactive).length;c.push(Gn("interaction.hit-targets","interaction",0===P&&l.length>0,"Every observed data-bearing scene node participates in hit testing.",0===l.length?"No data-bearing scene nodes were emitted for interaction.":P+" data-bearing marks explicitly disable interaction.","fail"));const M=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),D=M.filter(e=>!b.has(e));c.push(Gn("coverage.annotation-anchors","coverage",0===D.length,M.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",D.length+" annotations point to missing scene ids.","fail",{unresolved:D}));const T=(e.chart?.selectedIds??[]).filter(e=>!b.has(e));e.chart?.selectedIds&&c.push(Gn("interaction.selection-reachability","interaction",0===T.length,"Selected/highlighted states resolve to observed marks.",T.length+" selected ids are not reachable in the scene.","fail",{missing:T}));const F=er(r),$=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;const r=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return r?le(r,a,x):void 0}).filter(e=>!!e),j=new Set(F.flatMap(e=>Object.keys(e.values))),N=$.filter(e=>!j.has(e));c.push(Gn("accessibility.table-fields","accessibility",0===N.length,$.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${N.join(", ")}.`,"fail",{expectedFields:$,observedFields:[...j]})),new Set(x.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&2>=j.size&&[...j].every(e=>"category"===e||"value"===e)&&c.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});const B=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);c.push(Gn("accessibility.color-only","accessibility",0===B.length,"Every declared color encoding names a redundant cue.",B.length+" color encodings have no declared redundant cue.","warn"));const R=e.chart;if(R){for(const[e,r]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])r&&c.push(Gn("accessibility."+e,"accessibility","string"==typeof R[e]&&R[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&c.push(Gn("accessibility.fallback-table","accessibility",!1!==R.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),R.navigationTree&&c.push(Gn("accessibility.navigation-depth","accessibility",(R.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}const z=e.theme?.background??"#ffffff",_=r.filter(e=>{const t=e.style?.fill??e.fill;if("string"!=typeof t||!t.startsWith("#")||!z.startsWith("#"))return!1;const r=n(t,z);return null!=r&&3>r}).length;c.push(Gn("visual.contrast","visual",0===_,"All statically checkable mark fills meet 3:1 contrast.",_+" marks have fill contrast below 3:1.","warn",{background:z}));let I=0;const O=d.filter(e=>!!e).slice(0,500);for(let e=0;O.length>e;e+=1)for(let t=e+1;O.length>t;t+=1).8>Hn(O[e],O[t])||(I+=1);I>O.length&&c.push({id:"visual.overlap-density",category:"visual",status:"warn",message:I+" near-total mark overlaps suggest occlusion or excessive density.",remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});const q=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),H={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map(Ce).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>"table field: "+e.label)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},L=[...c,...q],G=c.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===G,summary:{marks:r.length,passes:L.filter(e=>"pass"===e.status).length,warnings:L.filter(e=>"warn"===e.status).length,failures:G,manual:L.filter(e=>"manual"===e.status).length},declaredSemantics:H,observedSceneEvidence:c,manualATChecks:q}}var Vn=[{id:"trend",label:"Trend over time",description:"How a single metric changes over an ordered sequence (typically time).",familyHint:"time-series"},{id:"compare-series",label:"Compare series",description:"Compare multiple measured series across a shared x domain.",familyHint:"time-series"},{id:"compare-categories",label:"Compare categories",description:"Compare a single measure across discrete categories.",familyHint:"categorical"},{id:"rank",label:"Rank",description:"Show category ordering by a measure (largest to smallest).",familyHint:"categorical"},{id:"part-to-whole",label:"Part to whole",description:"Show how individual categories share a total.",familyHint:"categorical"},{id:"distribution",label:"Distribution",description:"Show the shape, spread, and central tendency of a numeric variable.",familyHint:"distribution"},{id:"correlation",label:"Correlation",description:"Show the relationship between two (or more) numeric variables.",familyHint:"relationship"},{id:"flow",label:"Flow",description:"Show movement, transitions, or transfers between states.",familyHint:"flow"},{id:"hierarchy",label:"Hierarchy",description:"Show parent/child structure or nested totals.",familyHint:"hierarchy"},{id:"geo",label:"Geography",description:"Show values bound to geographic locations or regions.",familyHint:"geo"},{id:"outlier-detection",label:"Outlier detection",description:"Surface individual data points that diverge from the rest.",familyHint:"distribution"},{id:"composition-over-time",label:"Composition over time",description:"Show how the share of categories changes across an ordered sequence.",familyHint:"time-series"},{id:"change-detection",label:"Change detection",description:"Surface where or when a metric shifted meaningfully.",familyHint:"time-series"}],Xn=new Map(Vn.map(e=>[e.id,e]));function Kn(e){return Xn.get(e)}function Un(){return Array.from(Xn.values())}function Wn(e){Xn.set(e.id,e)}var Qn=new Set(Vn.map(e=>e.id)),Yn=new Set;function Zn(e,t,r){return Number.isFinite(e)?Math.max(t,Math.min(r,e)):t}function Jn(e,t){return void 0===e?0:Zn("function"==typeof e?e(t):e,0,5)}function eo(e){return e?Array.isArray(e)?[...e]:[e]:[]}function to(e,t,r){const a={};for(const[r,i]of Object.entries(e.intentScores))a[r]=Jn(i,t);if(r)for(const[e,t]of Object.entries(r))a[e]=Zn((a[e]??0)+t,0,5);return a}function ro(e,t){if(t.length>0)return t.reduce((t,r)=>t+(e[r]??0),0)/t.length;const r=Object.values(e).filter(e=>"number"==typeof e&&e>0);return r.length?r.reduce((e,t)=>e+t,0)/r.length:0}function ao(e,t){return{id:`${e.component}:${t.key}`,baseComponent:e.component,label:t.label,intentDeltas:t.intentDeltas,rubricDeltas:t.rubricDeltas,buildProps:r=>e.buildProps(r,t),rationale:t.description??`Registered ${e.component} variant: ${t.label}.`,source:"manual",variantKey:t.key,tags:t.tags}}function io(e,t,r){return e.some(e=>e.props?.[t]===r)}var no=new Set(["BarChart","GroupedBarChart","StackedBarChart","DotPlot"]);var oo=(e,t,r)=>function(e,t,r){const a=new Map,i=e=>{for(const t of e)t&&t.id&&t.baseComponent&&(a.has(t.id)||a.set(t.id,t))};i(function(e,t,r){const a=r.profile,i=r.existingVariants??t.variants??[],n=eo(r.intent),o=[];for(const e of i)o.push(ao(t,e));const s=n.includes("rank")||n.includes("compare-categories");!no.has(e)||"categorical"!==t.family||io(i,"orientation","horizontal")||!s&&6>(a.categoryCount??0)||o.push({id:e+":heuristic-horizontal",baseComponent:e,label:"Horizontal ranked view",intentDeltas:{rank:1,"compare-categories":.5},rubricDeltas:{precision:1},buildProps:e=>({...t.buildProps(e),orientation:"horizontal",sort:"desc"}),rationale:"Horizontal orientation improves label legibility and rank scanning for categorical comparisons.",source:"heuristic",tags:["horizontal","ranked"]});const c=io(i,"normalize",!0)||io(i,"type","percent")||i.some(e=>/normal|percent/i.test(`${e.key} ${e.label}`));if(/Stacked/.test(e)&&!c&&(n.includes("part-to-whole")||n.includes("composition-over-time"))&&o.push({id:e+":heuristic-normalized",baseComponent:e,label:"Normalized composition",intentDeltas:{"part-to-whole":1,"compare-categories":-.5},rubricDeltas:{precision:-1},buildProps:e=>({...t.buildProps(e),normalize:!0}),rationale:"Normalization emphasizes proportional composition when absolute magnitude is secondary.",source:"heuristic",tags:["normalized","part-to-whole"]}),n.length>0){const t=oi().filter(t=>t.component!==e).filter(e=>null===e.fits(a)).map(e=>{const t=to(e,a);return{candidate:e,fit:ro(t,n),scores:t}}).filter(e=>e.fit>=4).sort((e,t)=>t.fit!==e.fit?t.fit-e.fit:t.candidate.rubric.accuracy!==e.candidate.rubric.accuracy?t.candidate.rubric.accuracy-e.candidate.rubric.accuracy:t.candidate.rubric.familiarity-e.candidate.rubric.familiarity).slice(0,3);for(const{candidate:e,fit:r}of t)o.push({id:`${e.component}:heuristic-${n.join("-")}`,baseComponent:e.component,label:e.component+" alternative",buildProps:t=>e.buildProps(t),rationale:`${e.component} is a strong ${n.join(" + ")} alternative (${r.toFixed(1)}/5) for this data shape.`,source:"heuristic",tags:["cross-family",e.family]})}return o}(e,t,r));for(const a of Yn)try{i(a(e,t,r)??[])}catch(e){void 0!==console&&console.warn("[variantDiscovery] proposer threw:",e)}return Array.from(a.values())}(e,t,r),so=(e,t,r,i={})=>{const n=si(e.baseComponent);if(!n)return{proposalId:e.id,fit:0,novelty:1,risk:1,reasons:[`No capability registered for proposed component "${e.baseComponent}".`]};const o=n.fits(t);if(null!==o)return{proposalId:e.id,fit:0,novelty:"manual"===e.source?.2:.7,risk:1,reasons:["Rejected: "+o]};const s=eo(i.intent),c=to(n,t,e.intentDeltas),l=ro(c,s),u=function(e,t){return t?{familiarity:Math.round(Zn((r={familiarity:e.familiarity+(t.familiarity??0),accuracy:e.accuracy+(t.accuracy??0),precision:e.precision+(t.precision??0)}).familiarity,1,5)),accuracy:Math.round(Zn(r.accuracy,1,5)),precision:Math.round(Zn(r.precision,1,5))}:e;var r}(n.rubric,e.rubricDeltas);let d;const m=r?.receptionModality;if(m&&"visual"!==m){const i=e.variantKey?n.variants?.find(t=>t.key===e.variantKey):void 0,o=e.buildProps?e.buildProps(t,r):n.buildProps(t,i);d=ui(a(e.baseComponent,o),m)}const p=di(l,u,e.baseComponent,r,d),h=Zn(p.score,0,5);let y="manual"===e.source?.15:"heuristic"===e.source?.45:.75;i.baselineComponent&&i.baselineComponent!==e.baseComponent&&(y+=.2),e.variantKey||(y+=.05),y=Zn(y,0,1);let f="manual"===e.source?.1:"heuristic"===e.source?.25:.45;0>(e.rubricDeltas?.accuracy??0)&&(f+=.15),0>(e.rubricDeltas?.precision??0)&&(f+=.1),u.accuracy>3||(f+=.1),3>h&&(f+=.2),f=Zn(f,0,1);const g=[];if(e.rationale&&g.push(e.rationale),s.length>0){const e=s.map(e=>`${e}: ${(c[e]??0).toFixed(1)}/5`).join(", ");g.push(`Intent fit — ${e}.`)}else g.push(`Mean non-zero intent fit ${l.toFixed(1)}/5.`);return"manual"!==e.source&&g.push(e.source+" proposal; verify against domain context."),p.appliedReason&&g.push(p.appliedReason),p.receivabilityReason&&g.push(p.receivabilityReason),e.rubricDeltas&&Object.values(e.rubricDeltas).some(e=>0>(e??0))&&g.push("Rubric tradeoff: improves one reading mode while reducing precision or accuracy."),{proposalId:e.id,fit:h,novelty:y,risk:f,reasons:g}};function co(e){return Yn.add(e),()=>{Yn.delete(e)}}function lo(){return Array.from(Yn)}function uo(){Yn.clear()}import{useCallback as mo,useEffect as po,useMemo as ho,useState as yo,useSyncExternalStore as fo}from"react";var go={total:0,byType:{},componentsSeen:[],audiencesSeen:[],startedAt:null,lastAt:null,durationMs:0};function bo(e){if(0===e.length)return go;const t={},r=new Set,a=[];let i;for(const n of e){t[n.type]=(t[n.type]??0)+1,n.arcId&&(i=n.arcId);const e="component"in n&&"string"==typeof n.component?n.component:void 0;if(e&&r.add(e),"from"in n&&"string"==typeof n.from&&r.add(n.from),"to"in n&&"string"==typeof n.to&&r.add(n.to),"components"in n&&Array.isArray(n.components))for(const e of n.components)"string"==typeof e&&r.add(e);"audience-set"===n.type&&"string"==typeof n.audience&&a.push(n.audience)}const n=e[0].timestamp,o=e[e.length-1].timestamp;return{total:e.length,byType:t,componentsSeen:Array.from(r),audiencesSeen:a,latestArcId:i,startedAt:n,lastAt:o,durationMs:Math.max(0,o-n)}}function vo(e={}){const{enableOnMount:t=!0,disableOnUnmount:r=!1,capacity:a,sessionId:i}=e;po(()=>(t&&R({capacity:a,sessionId:i}),()=>{r&&B()}),[t,r,a,i]);const n=mo(e=>X(e),[]),o=mo(()=>I().getEvents(),[]),s=fo(n,o,o),[c,l]=yo(()=>I().enabled),[u,d]=yo(()=>I().sessionId);po(()=>(l(I().enabled),d(I().sessionId),X(()=>{const e=I();l(e.enabled),d(e.sessionId)})),[]);const m=ho(()=>bo(s),[s]),p=mo(e=>I().record(e),[]),h=mo(()=>I().clear(),[]);return{history:s,summary:m,enabled:c,sessionId:u,record:p,clear:h}}export{k as AccessibleNavTree,ze as AreaChart,ca as AreaChartCapability,an as BUILT_IN_AUDIENCES,Qn as BUILT_IN_INTENT_IDS,Je as BarChart,xa as BarChartCapability,w as BigNumber,et as BoxPlot,za as BoxPlotCapability,_e as BubbleChart,pa as BubbleChartCapability,Ie as BumpChart,la as BumpChartCapability,Pn as CANONICAL_FIXTURES,Oe as CandlestickChart,ba as CandlestickChartCapability,Ut as CategoryColorProvider,It as ChainReactionChart,C as ChartContainer,x as ChartGrid,zn as ChartRecipe,yt as ChordDiagram,La as ChordDiagramCapability,Wa as ChoroplethMapCapability,ft as CirclePack,Ka as CirclePackCapability,Ot as CollisionSwarmChart,qe as ConnectedScatterplot,ma as ConnectedScatterplotCapability,A as ContextLayout,qt as CrucibleChart,Wt as DEFAULT_LIFECYCLE_THRESHOLDS,Ur as DEFAULT_SCALE_THRESHOLDS,S as DetailsPanel,Le as DifferenceChart,ga as DifferenceChartCapability,Za as DistanceCartogramCapability,tt as DonutChart,Da as DonutChartCapability,rt as DotPlot,Pa as DotPlotCapability,Ht as EventDropChart,Ya as FlowMapCapability,gt as ForceDirectedGraph,qa as ForceDirectedGraphCapability,at as FunnelChart,Fa as FunnelChartCapability,Lt as GaltonBoardChart,it as GaugeChart,$a as GaugeChartCapability,Gt as GauntletChart,nt as GroupedBarChart,Aa as GroupedBarChartCapability,Ge as Heatmap,va as HeatmapCapability,ot as Histogram,Ra as HistogramCapability,P as IntentMark,st as LikertChart,Na as LikertChartCapability,Ee as LineChart,sa as LineChartCapability,Qt as LinkedCharts,Ve as MinimapChart,fa as MinimapChartCapability,M as MobileAnnotationCalloutList,D as MobileChartContainer,W as MobileStandardControls,Xe as MultiAxisLineChart,ya as MultiAxisLineChartCapability,Yt as MultiLineTooltip,vt as OrbitDiagram,Ua as OrbitDiagramCapability,Et as PacketFlowChart,Kt as PhysicsCustomChart,lt as PieChart,Ma as PieChartCapability,Vt as ProcessFlowChart,wt as ProcessSankey,Ga as ProcessSankeyCapability,Qa as ProportionalSymbolMapCapability,Ke as QuadrantChart,ha as QuadrantChartCapability,At as RealtimeHeatmap,St as RealtimeHistogram,Pt as RealtimeLineChart,Mt as RealtimeSwarmChart,Dt as RealtimeWaterfallChart,ut as RidgelinePlot,Oa as RidgelinePlotCapability,kt as SankeyDiagram,Ha as SankeyDiagramCapability,Ue as Scatterplot,da as ScatterplotCapability,We as ScatterplotMatrix,T as SmallMultipleChart,Qe as StackedAreaChart,ua as StackedAreaChartCapability,dt as StackedBarChart,Sa as StackedBarChartCapability,mt as SwarmPlot,_a as SwarmPlotCapability,pt as SwimlaneChart,Ba as SwimlaneChartCapability,Tt as TemporalHistogram,dr as ThemeProvider,hr as TooltipProvider,Ct as TreeDiagram,Ea as TreeDiagramCapability,xt as Treemap,Xa as TreemapCapability,Xt as UnitPileChart,ht as ViolinPlot,Ia as ViolinPlotCapability,r as accessibilityCaveats,tn as analystPersona,Ft as annotationFreshnessFor,Zt as annotationStableId,$t as applyAnnotationLifecycle,jt as applyAnnotationStatus,di as applyAudienceBias,na as applyScaleBias,a as auditAccessibility,h as auditData,F as auditMobileVisualization,En as auditObservedScene,Re as auditVisualizationControls,Jt as bandFromAge,J as buildNavigationTree,i as buildReaderGrounding,ee as buildRecipeNavigationTree,Ei as chartGenerationTool,Q as clampMobileRange,Zr as classifyCardinalityBand,Jr as classifyFieldBand,Yr as classifyRowBand,uo as clearVariantDiscovery,te as communicativeActForIntent,ea as compareBands,Nt as computeAnnotationFreshness,aa as computeEffectiveScale,re as configToJSX,ae as copyConfig,ie as countNodes,Wi as createChartToolHandler,$ as createIndexedDBConversationArcSink,j as createLocalStorageConversationArcSink,N as createWebhookConversationArcSink,Bt as currentTimestamp,Bi as dataQualityToAnnotations,rn as dataScientistPersona,ne as defineChartRecipe,oe as describeChart,se as describeRecipeChart,ce as deserializeSelections,o as diagnoseConfig,s as diagnoseTokenEncoding,gn as diffProfile,B as disableConversationArc,mi as effectiveFamiliarity,R as enableConversationArc,so as evaluateVariantProposal,en as executivePersona,ki as explainCapabilityFit,z as exportChart,Rt as filterAnnotationsByStatus,ue as flattenVisible,c as formatAccessibilityAudit,y as formatDataAudit,_ as formatMobileVisualizationAudit,de as fromConfig,_i as fromDbtArtifacts,qi as fromGreatExpectations,me as fromURL,pe as fromVegaLite,oi as getCapabilities,si as getCapability,he as getChartRecipe,I as getConversationArcStore,Kn as getIntent,ye as getRecipeLayout,lo as getRegisteredVariantDiscovery,ln as getStreamCapabilities,Yi as inferIntent,O as intentManifestFromRecipe,be as isJsonSafe,ve as isRegisteredRecipeLayout,we as listChartRecipes,Un as listIntents,q as loadConversationArc,H as mobileVisualizationCaveats,l as normalizeTokenEncoding,Gi as prepareChart,Kr as profileData,f as profileNumericFields,oo as proposeVariant,Ze as rankBumpData,ui as receivabilityBias,xe as recipeToChartCapability,L as recordAnnotationStatusChange,G as recordAudienceChange,ii as registerChartCapability,Ae as registerChartRecipe,E as registerConversationArcSink,Wn as registerIntent,Se as registerRecipeLayout,sn as registerStreamChartCapability,co as registerVariantDiscovery,Hi as repairChartConfig,V as replayConversationArc,ra as resolveCardinalityToNumber,Pe as resolveChartRecipe,Me as resolveCommunicativeAct,De as resolveRecipeRoleField,tr as resolveResponsiveRules,ta as resolveRowsToNumber,rr as responsiveRuleMatches,bn as runQualityScorecard,oa as scaleHints,Ci as scoreChart,Te as serializeSelections,pi as stretchFamiliarityCeiling,X as subscribeToConversationArcChange,wi as suggestCharts,xi as suggestChartsGrouped,Ji as suggestDashboard,pn as suggestStreamCharts,Zi as suggestStretchCharts,u as suggestTokenEncoding,bo as summarizeArc,Sr as summarizeData,K as summarizeIntentManifest,Vi as toAnthropicTool,Fe as toConfig,b as toDataAuditNotifications,Ui as toOpenAIResponsesTool,Xi as toOpenAITool,$e as toURL,d as tokenTaskIntentToCapabilityIntents,ni as unregisterChartCapability,je as unregisterChartRecipe,Ne as unregisterRecipeLayout,cn as unregisterStreamChartCapability,ar as useBrushSelection,ir as useCategoryColors,Di as useChartFocus,Si as useChartInterrogation,nr as useChartObserver,Bn as useChartSuggestions,vo as useConversationArc,or as useFilteredData,sr as useLinkedChartsActive,cr as useLinkedHover,Y as useMobileRangeControls,U as useNavigationSync,lr as useSelection,ur as useSelectionActions,pr as useTheme,Be as validateChartRecipe,m as validateProps,zt as withCurrentProvenance,_t as withProvenance,Z as zoomMobileRange};
|
|
2
|
+
import{BUILT_IN_NUMERIC_CONTRACTS as e,auditData as t,formatDataAudit as r,profileNumericFields as a,registerNumericContracts as i,toDataAuditNotifications as n,unregisterNumericContracts as o}from"./c-BBKITSXB.min.js";import{AccessibleNavTree as s,BAR_AREA_CHARTS as c,CONTINUOUS_MOTION_CHARTS as l,CURVE_CHARTS as u,ChartContainer as d,ChartGrid as m,ContextLayout as p,DUAL_AXIS_CHARTS as h,DetailsPanel as f,GEO_CHARTS as g,HIERARCHY_CHARTS as y,IntentMark as b,MobileAnnotationCalloutList as v,MobileChartContainer as w,MobileStandardControls as x,NETWORK_CHARTS as A,NORMALIZED_STACK_ACCESSORS as C,ORDINAL_BAR_CHARTS as k,ObservationReadout as S,PART_TO_WHOLE_ACCESSORS as P,PART_TO_WHOLE_CHARTS as $,PHYSICS_DIAGNOSTIC_CHARTS as N,PHYSICS_MOTION_CHARTS as M,PHYSICS_SETTLED_CHARTS as T,PIE_CHARTS as I,POINT_TARGET_RADIUS_PROP as R,REALTIME_CHARTS as D,SmallMultipleChart as E,TREND_SERIES_CHARTS as _,VALUE_CHARTS as F,XY_WITH_AXES_CHARTS as j,auditMobileVisualization as B,auditVisualizationControls as O,buildNavigationTree as z,buildRecipeNavigationTree as L,clampMobileRange as H,communicativeActForIntent as G,configToJSX as q,copyConfig as U,countNodes as V,createIndexedDBConversationArcSink as W,createLocalStorageConversationArcSink as Y,createWebhookConversationArcSink as X,defineChartRecipe as K,describeChart as Q,describeRecipeChart as Z,deserializeSelections as J,disableConversationArc as ee,enableConversationArc as te,exportChart as re,fieldForRole as ae,flattenVisible as ie,formatMobileVisualizationAudit as ne,fromConfig as oe,fromURL as se,fromVegaLite as ce,getChartRecipe as le,getConversationArcStore as ue,getRecipeLayout as de,getRegisteredRecipeCapabilities as me,hasRegisteredRecipeCapabilities as pe,intentManifestFromRecipe as he,isJsonSafe as fe,isRegisteredRecipeLayout as ge,listChartRecipes as ye,loadConversationArc as be,mobileVisualizationCaveats as ve,nonNegativeFinite as we,observedDatum as xe,recipeConfig as Ae,recipeIntentId as Ce,recipeToChartCapability as ke,recordAnnotationStatusChange as Se,recordAudienceChange as Pe,registerChartRecipe as $e,registerConversationArcSink as Ne,registerRecipeLayout as Me,replayConversationArc as Te,resolveChartRecipe as Ie,resolveCommunicativeAct as Re,resolveRecipeRoleField as De,serializeSelections as Ee,subscribeToConversationArcChange as _e,summarizeIntentManifest as Fe,toConfig as je,toURL as Be,unregisterChartRecipe as Oe,unregisterRecipeLayout as ze,useMobileRangeControls as Le,useNavigationSync as He,validateChartRecipe as Ge,zoomMobileRange as qe}from"./c-CDR5AO3R.min.js";import{AreaChart as Ue,BubbleChart as Ve,BumpChart as We,CandlestickChart as Ye,ConnectedScatterplot as Xe,DEFAULT_QUADRANTS as Ke,DifferenceChart as Qe,Heatmap as Ze,LineChart as Je,MinimapChart as et,MultiAxisLineChart as tt,QuadrantChart as rt,Scatterplot as at,ScatterplotMatrix as it,StackedAreaChart as nt,XYCustomChart as ot,bumpXIdentity as st,rankBumpData as ct}from"./c-KII3PLZE.min.js";import{BarChart as lt,BoxPlot as ut,DonutChart as dt,DotPlot as mt,FunnelChart as pt,GaugeChart as ht,GroupedBarChart as ft,Histogram as gt,LikertChart as yt,OrdinalCustomChart as bt,PieChart as vt,RidgelinePlot as wt,StackedBarChart as xt,SwarmPlot as At,SwimlaneChart as Ct,ViolinPlot as kt}from"./c-5YCIX3VZ.min.js";import"./c-SLGMUBUL.min.js";import{ChordDiagram as St,CirclePack as Pt,ForceDirectedGraph as $t,NetworkCustomChart as Nt,OrbitDiagram as Mt,ProcessSankey as Tt,SankeyDiagram as It,TreeDiagram as Rt,Treemap as Dt,diagnoseProcessSankeyProps as Et}from"./c-QHF5YON3.min.js";import{closestMatch as _t,validateArrayData as Ft,validateNetworkData as jt,validateObjectData as Bt}from"./c-RSVIHIQ4.min.js";import{RealtimeHeatmap as Ot,RealtimeHistogram as zt,RealtimeLineChart as Lt,RealtimeSwarmChart as Ht,RealtimeWaterfallChart as Gt,TemporalHistogram as qt}from"./c-LVEY6D6B.min.js";import"./c-UUKVD4WB.min.js";import"./c-W3CE4A4S.min.js";import"./c-M4Y3BHFR.min.js";import"./c-C25ENHIK.min.js";import"./c-OXYMVK7Q.min.js";import"./c-RR3GO5SW.min.js";import{ChainReactionChart as Ut,CollisionSwarmChart as Vt,CrucibleChart as Wt,EventDropChart as Yt,GaltonBoardChart as Xt,GauntletChart as Kt,PacketFlowChart as Qt,PhysicsCustomChart as Zt,ProcessFlowChart as Jt,UnitPileChart as er}from"./c-US5ZFT6E.min.js";import"./c-N4G2L7ID.min.js";import"./c-VGW3VG3I.min.js";import{GeoCustomChart as tr}from"./c-74HEEZGK.min.js";import"./c-3KZD6AXJ.min.js";import"./c-ZOWWU34K.min.js";import"./c-MG5DM6VE.min.js";import"./c-OCI56QF2.min.js";import{annotationFreshnessFor as rr,applyAnnotationLifecycle as ar,applyAnnotationStatus as ir,computeAnnotationFreshness as nr,currentTimestamp as or,filterAnnotationsByStatus as sr,withCurrentProvenance as cr,withProvenance as lr}from"./c-GPYOFETM.min.js";import"./c-G36WS6LN.min.js";import"./c-S2BXNNJN.min.js";import"./c-J5G56TUH.min.js";import{CategoryColorProvider as ur,DEFAULT_LIFECYCLE_THRESHOLDS as dr,LinkedCharts as mr,MultiLineTooltip as pr,SafeRender as hr,annotationBudget as fr,annotationDrawsConnector as gr,annotationStableId as yr,annotationType as br,bandFromAge as vr,extractAllRows as wr,isNoteAnnotation as xr,resolveResponsiveRules as Ar,responsiveRuleMatches as Cr,useBrushSelection as kr,useCategoryColors as Sr,useChartObserver as Pr,useFilteredData as $r,useLinkedChartsActive as Nr,useLinkedHover as Mr,useSelection as Tr,useSelectionActions as Ir,useWasHydratingFromSSR as Rr}from"./c-GIKRQI4X.min.js";import{ThemeProviderWrapper as Dr,createStore as Er,useReducedMotion as _r,useTheme as Fr}from"./c-YDAY2WFR.min.js";import"./c-WJCD5EUY.min.js";import{forwardRef as jr,useCallback as Br,useEffect as Or,useImperativeHandle as zr,useMemo as Lr,useRef as Hr,useState as Gr}from"react";function qr(e,t={}){if("function"==typeof e)return e;const r=t.locale??"en-US";if("currency"===e){const e=t.precision??2,a=new Intl.NumberFormat(r,{style:"currency",currency:t.currency??"USD",maximumFractionDigits:e,minimumFractionDigits:e});return e=>a.format(e)}if("percent"===e){const e=new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:t.precision??1,minimumFractionDigits:0});return t=>e.format(t)}if("compact"===e){const e=new Intl.NumberFormat(r,{notation:"compact",maximumFractionDigits:t.precision??1,minimumFractionDigits:0});return t=>e.format(t)}if("duration"===e)return e=>function(e){if(!Number.isFinite(e))return e+"";const t=0>e?"-":"",r=Math.abs(e);if(1e3>r)return`${t}${Math.round(r)}ms`;const a=r/1e3;if(60>a)return`${t}${i=a,Math.round(100*i)/100+""}s`;var i;const n=a/60;if(60>n){const e=Math.floor(n),r=Math.round(a-60*e);return 0===r?`${t}${e}m`:`${t}${e}m ${r}s`}const o=n/60;if(24>o){const e=Math.floor(o),r=Math.round(n-60*e);return 0===r?`${t}${e}h`:`${t}${e}h ${r}m`}const s=Math.floor(o/24),c=Math.round(o-24*s);return 0===c?`${t}${s}d`:`${t}${s}d ${c}h`}(e);const a=new Intl.NumberFormat(r,{notation:t.notation??"standard",maximumFractionDigits:t.precision??0,minimumFractionDigits:0});return e=>a.format(e)}function Ur(e,t,r){return`${t??""}${e}${r??""}`}import{useMemo as Vr}from"react";import{Fragment as Wr,jsx as Yr,jsxs as Xr}from"react/jsx-runtime";var Kr={tile:{width:280,height:184,align:"start",labelSize:13,captionSize:11,valueSize:40,deltaSize:13,padding:{top:14,right:16,bottom:14,left:16},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:44},presentation:{width:540,height:320,align:"center",labelSize:18,captionSize:14,valueSize:96,deltaSize:18,padding:{top:32,right:32,bottom:32,left:32},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:80},inline:{width:void 0,height:void 0,align:"inherit",labelSize:0,captionSize:0,valueSize:0,deltaSize:0,padding:{top:0,right:0,bottom:0,left:0},background:"transparent",border:!1,showHeader:!1,showDelta:!0,showTrend:!1,showChart:!1,chartSize:0},thumbnail:{width:96,height:56,align:"center",labelSize:0,captionSize:0,valueSize:22,deltaSize:0,padding:{top:4,right:6,bottom:4,left:6},background:"transparent",border:!1,showHeader:!1,showDelta:!1,showTrend:!1,showChart:!1,chartSize:0}};function Qr(e,t,r){return void 0===e?r:"function"==typeof e?e(t):e}function Zr(e){return"positive"===e?"var(--semiotic-success, currentColor)":"negative"===e?"var(--semiotic-danger, currentColor)":"var(--semiotic-text-secondary, currentColor)"}function Jr(e){return"positive"===e?"▲":"negative"===e?"▼":"■"}var ea=jr((e,t)=>{const{value:r,label:a,caption:i,format:n,locale:o,currency:s,precision:c,prefix:l,suffix:u,unit:d,comparison:m,target:p,delta:h,deltaFormat:f,showDeltaPercent:g,direction:y,sentiment:b,thresholds:v,windowSize:w=60,mode:x="tile",align:A,width:C,height:k,padding:S,emphasis:P,color:$,background:N,borderColor:M,borderRadius:T,className:I,style:R,animate:D,stalenessThreshold:E,staleLabel:_,headerSlot:F,valueSlot:j,deltaSlot:B,trendSlot:O,chartSlot:z,chartSize:L,footerSlot:H,onClick:G,onObservation:q,chartId:U,description:V,summary:W,loading:Y,loadingContent:X,emptyContent:K}=e,Q=Kr[x]??Kr.tile,Z=A??Q.align,J=C??Q.width,ee=k??Q.height,te=_r(),re=Rr(),[ae,ie]=Gr([]),[ne,oe]=Gr(null),[se,ce]=Gr(null),[le,ue]=Gr(null),de=Hr([]),me=Hr(null),pe=Hr(r);Or(()=>{pe.current=r},[r]);const he=Hr(w);Or(()=>{he.current=w},[w]);const fe=Br(e=>{const t="number"==typeof e?{value:e,time:Date.now()}:{time:Date.now(),...e},r="number"==typeof t.time?t.time:t.time instanceof Date?t.time.getTime():Date.now();return{...t,time:r}},[]),ge=Br(e=>{if(0===e.length)return;const t=he.current,r=e.map(fe);let a=de.current.concat(r);a.length>t&&(a=a.slice(a.length-t)),de.current=a;const i=r[r.length-1];me.current=i.value,ie(a),oe(i.value);for(let e=r.length-1;e>=0;e--){const t=r[e].comparison;if(null!=t){ce(t);break}}ue(i.time)},[fe]),ye=Br(e=>ge([e]),[ge]);zr(t,()=>({push:e=>ye(e),pushMany:e=>ge(e),clear:()=>{de.current=[],me.current=null,ie([]),oe(null),ce(null),ue(null)},getValue:()=>me.current??(Number.isFinite(pe.current)?pe.current:null),getData:()=>de.current.slice()}),[ye,ge]);const be=ne??r,ve=null==be||"number"!=typeof be||!Number.isFinite(be),we=Lr(()=>qr(n??"number",{locale:o,currency:s,precision:c}),[n,o,s,c]),xe=Lr(()=>qr(f??n??"number",{locale:o,currency:s,precision:null==f&&null==n?0:c}),[f,n,o,s,c]),Ae=D??!1,Ce=("object"!=typeof Ae||!1!==Ae.intro)&&!!Ae,ke=Number.isFinite(be)?be:0,Se=function(e,t,r,a=e){const[i,n]=Gr(()=>a),o=Hr(a),s=Hr(null),c=Hr(e),l=Hr(0),u=!!t,d="object"==typeof t?t.duration:void 0,m="number"==typeof d&&Number.isFinite(d)?Math.max(0,d):300,p="object"==typeof t&&"linear"===t.easing?"linear":"ease-out",h=Hr(e);return Or(()=>{const t=e=>{o.current=e,n(e)};if(!Number.isFinite(e))return void t(e);if(!u||r)return void t(e);if(0===m)return void t(e);c.current=o.current,h.current=e,l.current="undefined"!=typeof performance?performance.now():Date.now();const a="linear"===p?e=>e:e=>1-Math.pow(1-e,3),i=e=>{const r=Math.min(1,(e-l.current)/m),n=a(r);t(c.current+(h.current-c.current)*n),1>r?s.current=requestAnimationFrame(i):(s.current=null,t(h.current))};return s.current=requestAnimationFrame(i),()=>{null!=s.current&&cancelAnimationFrame(s.current),s.current=null}},[u,m,p,r,e]),i}(ke,Ae,te,Hr(!Ce||te||re?ke:0).current),Pe=Ae?Se:Number.isFinite(be)?be:0,$e=Lr(()=>function(e,t){if(!t||0===t.length)return null;if(!Number.isFinite(e))return null;const r=t.filter(e=>Number.isFinite(e.at)||e.at===-1/0).slice().sort((e,t)=>e.at-t.at);let a=null;for(const t of r){if(t.at>e)break;a=t}return a}(Number.isFinite(be)?be:NaN,v),[be,v]),Ne=$e?$e.level:"neutral",Me=$??function(e,t){return t||("neutral"===e?"var(--semiotic-text, currentColor)":`var(--semiotic-${e}, currentColor)`)}(Ne,$e?.color),Te=se??m?.value??null,Ie=null!=h?h:null!=Te&&Number.isFinite(be)?be-Te:null,Re=function(e,t,r){if(r&&"auto"!==r)return r;if(null==e||0===e||!Number.isFinite(e))return"neutral";const a=t??"higher-is-better";return"neutral"===a?"neutral":("higher-is-better"===a?e>0:0>e)?"positive":"negative"}(Ie,m?.direction??p?.direction??y,b),De=null!=Ie&&Number.isFinite(Ie)?function(e,t){return Number.isFinite(e)?0===e?t(0):`${e>0?"+":"−"}${t(Math.abs(e))}`:""}(Ie,xe):null,Ee=Lr(()=>new Intl.NumberFormat(o??"en-US",{style:"percent",maximumFractionDigits:1,minimumFractionDigits:0,signDisplay:"exceptZero"}),[o]),_e=null!=Te&&Number.isFinite(be)&&(g??1)&&0!==Te?Ee.format((be-Te)/Math.abs(Te)):null,Fe=function({target:e,value:t,format:r,locale:a,currency:i,precision:n}){const o=Vr(()=>new Intl.NumberFormat(a??"en-US",{style:"percent",maximumFractionDigits:0}),[a]),s=Vr(()=>qr(e?.format??r??"number",{locale:a,currency:i,precision:n}),[e?.format,r,a,i,n]);return Vr(()=>{if(!e||!Number.isFinite(e.value))return null;const r="number"==typeof t&&Number.isFinite(t)&&0!==e.value?o.format(t/e.value):null,a=s(e.value);return{label:e.label,percent:r,formattedValue:a,text:r?e.label?`${r} of ${e.label} (${a})`:`${r} of ${a}`:e.label?`target ${e.label} (${a})`:"target "+a}},[e,t,s,o])}({target:p,value:be,format:n,locale:o,currency:s,precision:c}),je=Fe?.percent??null,Be=Fe?.text??null,Oe=function(e,t){const[r,a]=Gr(!1);return Or(()=>{if(!t||null==e)return void a(!1);const r=()=>{a(Date.now()-e>=t)};r();const i=setInterval(r,Math.max(250,Math.floor(t/4)));return()=>clearInterval(i)},[e,t]),r}(le,E),ze=Number.isFinite(Pe)?Ur(we(Pe),l,u):"",Le={value:ve?null:be,formattedValue:ze,level:Ne,color:Me,delta:Ie,deltaFormatted:De,deltaPercent:_e,sentiment:Re,isStale:Oe,pushBuffer:ae},He=V??function(e){const t=[];if(e.label&&t.push(e.label+":"),t.push(e.unit?`${e.formattedValue} ${e.unit}`:e.formattedValue),e.deltaFormatted){const r=e.delta,a=null!=r&&Number.isFinite(r)&&0!==r?r>0?"up":"down":"change";t.push(`${a} ${e.deltaFormatted}${e.deltaPercent?` (${e.deltaPercent})`:""}${e.comparisonLabel?" from "+e.comparisonLabel:""}`)}return e.targetText&&t.push(e.targetText),e.thresholdLabel&&t.push(e.thresholdLabel),e.stale&&t.push(e.staleLabel??"stale"),t.join(", ")}({label:a,formattedValue:Number.isFinite(be)?Ur(we(be),l,u):"",unit:d,comparisonLabel:m?.label,delta:Ie,deltaFormatted:De,deltaPercent:_e,targetText:Be,thresholdLabel:$e?.label,stale:Oe,staleLabel:_}),Ge="number"==typeof S?{top:S,right:S,bottom:S,left:S}:{...Q.padding,...S??{}},qe="end"===Z?"flex-end":"center"===Z?"center":"start"===Z?"flex-start":"inherit",Ue={position:"relative",boxSizing:"border-box",width:J,height:ee,padding:`${Ge.top}px ${Ge.right}px ${Ge.bottom}px ${Ge.left}px`,background:N??Q.background,border:Q.border?"1px solid "+(M??"var(--semiotic-border, #e2e2e2)"):void 0,borderRadius:"number"==typeof T?T+"px":T??"var(--semiotic-border-radius, 8px)",display:"inline"===x?"inline-flex":"flex",flexDirection:"column",alignItems:"inherit"===qe?void 0:qe,textAlign:Z,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",color:"var(--semiotic-text, #111)",opacity:Oe?.55:1,transition:"opacity 240ms ease-out",gridColumn:"primary"===P?"span 2":void 0,cursor:G?"pointer":void 0,...R},Ve=Br(e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientX-t.left,a=e.clientY-t.top,i={value:ve?NaN:be,level:Ne,delta:Ie};G&&G(i,{x:r,y:a}),q&&q({type:"click",datum:i,x:r,y:a,chartType:"BigNumber",chartId:U,timestamp:Date.now()})},[G,q,U,ve,be,Ne,Ie]),We="inline"===x?"span":"div",Ye=["semiotic-bignumber","semiotic-bignumber--mode-"+x,"semiotic-bignumber--level-"+Ne,"semiotic-bignumber--sentiment-"+Re,Oe?"semiotic-bignumber--stale":null,I].filter(Boolean).join(" "),Xe="positive"===Re?"up":"negative"===Re?"down":"flat";if(Y){const e="number"==typeof J?J:280,t="number"==typeof ee?ee:160;return Yr(We,{role:"status","aria-live":"polite","aria-busy":"true",className:Ye+" semiotic-bignumber--loading",style:{...Ue,opacity:1},children:X??Yr(ra,{width:e,height:t,mode:x})})}return ve?!1===K?null:Yr(We,{role:"status","aria-label":a?a+": no value":"no value",className:Ye+" semiotic-bignumber--empty",style:{...Ue,color:"var(--semiotic-text-secondary, #666)",fontSize:13,alignItems:"center",justifyContent:"center"},children:K??"—"}):Yr(hr,{componentName:"BigNumber",width:"number"==typeof J?J:280,height:"number"==typeof ee?ee:160,children:Xr(We,{role:"group","aria-label":He,"data-chart":"BigNumber","data-mode":x,"data-level":Ne,"data-stale":Oe?"true":void 0,"data-sentiment":Re,className:Ye,style:Ue,onClick:G||q?Ve:void 0,children:[Q.showHeader&&(a||i||F)?Yr("div",{className:"semiotic-bignumber__header",style:{display:"flex",flexDirection:"column",gap:2,marginBottom:6,paddingRight:Q.showChart&&null!=z?(L??Q.chartSize)+8:0},children:Qr(F,Le,Xr(Wr,{children:[a?Yr("span",{className:"semiotic-bignumber__label",style:{fontSize:Q.labelSize,color:"var(--semiotic-text-secondary, #6b7280)",fontWeight:500,letterSpacing:.2},children:a}):null,i?Yr("span",{className:"semiotic-bignumber__caption",style:{fontSize:Q.captionSize,color:"var(--semiotic-text-secondary, #9ca3af)"},children:i}):null]}))}):null,Qr(j,Le,Xr(We,{className:"semiotic-bignumber__value semiotic-bignumber__value--"+Ne,style:{display:"inline"===x?"inline-flex":"flex",alignItems:"baseline",gap:6,fontVariantNumeric:"tabular-nums",fontWeight:600,color:Me,fontSize:Q.valueSize||void 0,lineHeight:1.05},children:[Yr("span",{className:"semiotic-bignumber__value-text",children:ze}),d?Yr("span",{className:"semiotic-bignumber__unit",style:{fontSize:Q.valueSize?Math.max(11,Math.round(.32*Q.valueSize)):"0.75em",color:"var(--semiotic-text-secondary, #9ca3af)",fontWeight:500},children:d}):null]})),Q.showDelta&&(De||Fe||m)?Yr(We,{className:"semiotic-bignumber__delta semiotic-bignumber__delta--"+Xe,style:{display:"inline"===x?"inline-flex":"flex",flexWrap:"wrap",gap:8,alignItems:"baseline",marginTop:"inline"===x?0:6,fontSize:Q.deltaSize||void 0,color:"var(--semiotic-text-secondary, #6b7280)"},children:Qr(B,Le,Xr(Wr,{children:[De?Xr("span",{className:"semiotic-bignumber__delta-row semiotic-bignumber__delta-row--"+Xe,style:{display:"inline-flex",alignItems:"center",gap:4,color:Zr(Re),fontWeight:600},children:[Yr("span",{"aria-hidden":"true",className:"semiotic-bignumber__arrow semiotic-bignumber__arrow--"+Xe,children:Jr(Re)}),Yr("span",{className:"semiotic-bignumber__delta-amount",children:De}),_e?Xr("span",{className:"semiotic-bignumber__delta-percent",style:{fontWeight:500},children:["(",_e,")"]}):null]}):null,m?.label?Yr("span",{className:"semiotic-bignumber__comparison-label",children:m.label}):null,Fe?Xr("span",{className:"semiotic-bignumber__target",style:{display:"inline-flex",alignItems:"baseline",gap:4},children:[De||m?.label?Yr("span",{"aria-hidden":"true",className:"semiotic-bignumber__separator",children:"·"}):null,Yr("span",{className:"semiotic-bignumber__target-percent",style:{fontWeight:500,color:"var(--semiotic-text, #111)"},children:je}),Xr("span",{className:"semiotic-bignumber__target-value",children:["of ",Fe.formattedValue,Fe.label?" "+Fe.label:""]})]}):null]}))}):null,Q.showChart&&null!=z?Yr("div",{className:"semiotic-bignumber__chart",style:{position:"absolute",top:Ge.top,right:Ge.right,width:L??Q.chartSize,height:L??Q.chartSize,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:Yr("div",{style:{pointerEvents:"auto",lineHeight:0},children:Qr(z,Le,null)})}):null,Q.showTrend&&null!=O?Yr("div",{className:"semiotic-bignumber__trend",style:{position:"absolute",left:Ge.left,right:Ge.right,bottom:Ge.bottom+(null!=H?28:0)},children:Qr(O,Le,null)}):null,null!=H?Yr(We,{className:"semiotic-bignumber__footer",style:{position:"absolute",left:Ge.left,right:Ge.right,bottom:Ge.bottom,fontSize:Q.deltaSize||void 0,color:"var(--semiotic-text-secondary, #9ca3af)"},children:Qr(H,Le,null)}):null,W?Yr("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:W}):null]})})});ea.displayName="BigNumber";var ta=ea;function ra(e){const t=Math.floor(.45*e.width),r=Math.floor(.6*e.width),a=(e,t)=>Yr("div",{style:{width:e,height:t,background:"var(--semiotic-border, #e0e0e0)",borderRadius:4,opacity:.55}});return Xr("div",{style:{display:"flex",flexDirection:"column",gap:10,justifyContent:"center",width:"100%",height:"100%"},children:["thumbnail"!==e.mode&&"inline"!==e.mode?a(t,10):null,a(r,"presentation"===e.mode?48:28),"tile"===e.mode||"presentation"===e.mode?a(Math.floor(.35*e.width),8):null]})}var[aa,ia]=Er(e=>({tooltip:null,changeTooltip(t){e(()=>({tooltip:t}))}})),na=["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["string","object"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["array","function"],["string","number","array","object","function"]],oa=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["up","down"],["count","sum","mean"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],sa={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},xyAxis:{xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:13,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:14,loading:4,loadingContent:3,emptyContent:3,frameProps:10}};function ca(e){const[t,r]=Array.isArray(e)?e:[e,void 0],a=na[t],i=Array.isArray(a)?[...a]:a;return void 0===r?{type:i}:{type:i,enum:[...oa[r]]}}var la=Object.fromEntries(Object.entries({BarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,regression:14}],StackedBarChart:[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,9],normalize:4,sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4}],GroupedBarChart:[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4}],SwarmPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,brush:4,onBrush:12,linkedBrush:17}],BoxPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9}],Histogram:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,brush:4,onBrush:12,linkedBrush:17}],ViolinPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,brush:4,onBrush:12,linkedBrush:17}],RidgelinePlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,9],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9}],DotPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,9],sort:15,dotRadius:1,categoryPadding:1,valueExtent:9,showGrid:4,regression:14}],PieChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],DonutChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,innerRadius:1,centerContent:18,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],GaugeChart:[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,showScaleLabels:4,backgroundColor:0}],FunnelChart:[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,10],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2]}],SwimlaneChart:[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,10],barPadding:1,roundedTop:16,valueExtent:9,trackFill:17,gradientFill:3,brush:4,onBrush:12,linkedBrush:17,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2]}],LikertChart:[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,9],barPadding:1,valueExtent:9}],LineChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,11],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,12],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],BumpChart:[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,13],ribbon:4,curve:[0,14],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,15],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,16]}],AreaChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,11],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],DifferenceChart:[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,11],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1}],StackedAreaChart:[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,11],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,17],stackOrder:[0,18],pointIdAccessor:6,xExtent:9,yExtent:9}],Scatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10}],BubbleChart:[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14}],Heatmap:[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,19],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2]}],QuadrantChart:[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],MultiAxisLineChart:[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1}],CandlestickChart:[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],ConnectedScatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10}],ScatterplotMatrix:[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,20],histogramBins:1,brushMode:[23,21],hoverMode:4,unselectedOpacity:1,idAccessor:6}],MinimapChart:[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,lineDataAccessor:0,curve:[0,11],lineWidth:1,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,brushExtent:9,yExtent:9}],ForceDirectedGraph:[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common"],{styleRules:9,nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,22],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],SankeyDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,23],orientation:[0,9],nodeAlign:[0,24],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],ProcessSankey:[["domain"],"network",["sourceAccessor","targetAccessor"],["common"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,10],legendPosition:[0,2],pairing:[0,25],packing:[0,26],laneOrder:[0,27],maxValueScale:1,lanePlacement:[0,28],nodeSizing:[0,29],showLabels:[11,30],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,31],groupPadding:1,ribbonLane:[0,32],ribbonMinRun:25,lifetimeMode:[0,33],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,styleRules:9,layoutExecution:[0,22],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],ChordDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,34],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],TreeDiagram:[["data"],"object",[],["common"],{data:10,layout:[0,35],orientation:[0,36],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,37],nodeLabel:6,showLabels:4,nodeSize:1}],Treemap:[["data"],"object",[],["common"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,38],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],CirclePack:[["data"],"object",[],["common"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],OrbitDiagram:[["data"],"object",[],["common"],{data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:16,speed:1,eccentricity:16,showRings:4,nodeRadius:16,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,39],foregroundGraphics:10}],ChoroplethMap:[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],ProportionalSymbolMap:[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],FlowMap:[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,40],flowStyle:[0,41],areas:28,areaStyle:10,edgeColorBy:6,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,42],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],DistanceCartogram:[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,43],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,44],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],RealtimeLineChart:[[],"realtime",[],["realtime"],{stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,aggregate:10,eventTime:10,transition:10}],RealtimeHistogram:[["binSize"],"realtime",[],["realtime"],{binSize:1,direction:[0,45],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:14,onBrush:12,linkedBrush:17,transition:10}],TemporalHistogram:[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{data:9,binSize:1,size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,direction:[0,45],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:14,linkedBrush:17,brush:14,onBrush:12}],RealtimeSwarmChart:[[],"realtime",[],["realtime"],{categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],RealtimeWaterfallChart:[[],"realtime",[],["realtime"],{positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],RealtimeHeatmap:[[],"realtime",[],["realtime"],{heatmapXBins:1,heatmapYBins:1,aggregation:[0,46],categoryAccessor:6,colorScheme:[0,19],customColorScale:12}],GaltonBoardChart:[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,47],simulationMode:[0,48],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],EventDropChart:[["data"],"array",["timeAccessor","arrivalAccessor"],["physics"],{styleRules:9,timeAccessor:6,arrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],UnitPileChart:[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,47],simulationMode:[0,48],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],CollisionSwarmChart:[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],GauntletChart:[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:32,bodyGroups:32,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,49],terminalBehavior:[0,50]}],CrucibleChart:[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,51],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],ProcessFlowChart:[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,radiusAccessor:6,ballRadius:1,route:[0,52],groupCompletion:[0,53],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,54],seed:1}],PacketFlowChart:[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,55],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,56],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],ChainReactionChart:[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,57],insight:[0,58],currentTime:2,controls:20,mechanism:[0,59],orientation:[0,60],reducedMotion:[0,61],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],BigNumber:[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,62],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,62],showDeltaPercent:4,direction:[0,63],sentiment:[0,64],thresholds:9,chartSlot:33,chartSize:1,windowSize:1,mode:[0,65],align:[0,66],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:33,valueSlot:33,deltaSlot:33,trendSlot:33,footerSlot:33,onClick:12,onObservation:12}]}).map(([e,[t,r,a,i,n]])=>[e,{required:[...t],dataShape:r,dataAccessors:[...a],props:Object.fromEntries(Object.entries(Object.assign({},...i.map(e=>sa[e]),n)).map(([e,t])=>[e,ca(t)]))}]));function ua(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}var da=new Set(["start","center","end","left","right"]),ma={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}};function pa(e,t){const r=[];null!=t&&"object"==typeof t||(t={});const a=la[e];if(!a)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(la).join(", ")}`]};for(const i of a.required)null==t[i]&&r.push(`"${i}" is required for ${e}.`);"array"!==a.dataShape||!Object.prototype.hasOwnProperty.call(a.props,"data")||a.required.includes("data")||function(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}(e,t)||null!=t.data||r.push(`"data" is required for ${e}.`);for(const[e,i]of Object.entries(t)){if(null==i)continue;const t=a.props[e];if(t){if(!ua(i,t.type)){const a=Array.isArray(t.type)?t.type.join(" | "):t.type;r.push(`"${e}" should be ${a}, got ${Array.isArray(i)?"array":typeof i}.`);continue}t.enum&&"string"==typeof i&&!t.enum.includes(i)&&r.push(`"${e}" value "${i}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const i=Object.keys(a.props),n=new Set(i);for(const a of Object.keys(t))if(void 0!==t[a]&&!n.has(a)){const t=_t(a,i),n=t?`Unknown prop "${a}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${a}" for ${e}. Valid props: ${i.join(", ")}.`;r.push(n)}if("array"===a.dataShape){const i=t.data,n={};for(const e of a.dataAccessors){const r=t[e];"string"==typeof r&&(n[e]=r)}const o=Ft({componentName:e,data:i,accessors:Object.keys(n).length>0?n:void 0});o&&r.push(o)}else if("object"===a.dataShape){const a=Bt({componentName:e,data:t.data});a&&r.push(a)}else if("network"===a.dataShape){const i=t.nodeIdAccessor??t.nodeIDAccessor??"id",n="string"==typeof i?{nodeIdAccessor:i}:void 0,o=jt({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:a.required.includes("nodes"),edgesRequired:a.required.includes("edges"),accessors:n});o&&r.push(o)}return"GaugeChart"===e&&r.push(...function(e){if(!Array.isArray(e.thresholds))return[];const t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,r)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${r}]" for GaugeChart should be an object with numeric "value" and string "color".`);const a=e;"number"==typeof a.value&&Number.isFinite(a.value)||t.push(`"thresholds[${r}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),"string"==typeof a.color&&0!==a.color.length||t.push(`"thresholds[${r}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==a.label&&"string"!=typeof a.label&&t.push(`"thresholds[${r}].label" for GaugeChart should be a string.`);const i=Object.keys(a).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);i.length>0&&t.push(`"thresholds[${r}]" has unsupported GaugeChart key(s): ${i.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&r.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),r.push(...function(e){const t=e.frameProps;if(null==t||"object"!=typeof t||Array.isArray(t))return[];const r=t.legendLayout;if(null==r||"object"!=typeof r||Array.isArray(r))return null==r?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(r)?"array":typeof r)+"."];const a=[],i=r,n=new Set(["align",...Object.keys(ma)]);for(const e of Object.keys(i))n.has(e)||a.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...n].join(", ")}.`);void 0!==i.align&&"string"!=typeof i.align?a.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(i.align)?"array":typeof i.align}.`):"string"!=typeof i.align||da.has(i.align)||a.push(`"frameProps.legendLayout.align" value "${i.align}" is not valid. Expected one of: ${[...da].join(", ")}.`);for(const[e,t]of Object.entries(ma)){const r=i[e];void 0!==r&&("number"==typeof r&&Number.isFinite(r)?t.minimum>r&&a.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${r}.`):a.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(r)?"array":typeof r}.`))}return a}(t)),{valid:0===r.length,errors:r}}function ha(e){const t=e.unitValue??e.unit,r=e.icon??e.token;return{...e,...null!=t&&{unitValue:t},...null!=r&&{icon:r}}}function fa(e,t={}){const r=[],a=e.tokenSemantics,i=e.countStrategy,n=t.maxRecommendedTokens??("fixed-denominator"!==i||we(e.denominator)>100?80:100);return a||r.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),i||r.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),"icon"!==e.tokenType&&"glyph"!==e.tokenType||"icon-only"!==e.labelPolicy&&"token-only"!==e.labelPolicy||r.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>n&&r.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"!==a||"icon"!==e.tokenType&&"glyph"!==e.tokenType||r.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===a&&i&&"unitized"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===a&&i&&"fixed-denominator"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),"possible-outcome"!==a&&"posterior-sample"!==a&&"hypothetical-case"!==a||!i||"quantile"===i||"sample"===i||"posterior-sample"===i||"random-sample"===i||r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===a&&"unitized"===i&&null==e.unitValue&&null==e.unit&&r.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"!==a||"unitized"!==i||e.unitMeaning||r.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),r}function ga(e){return"measure"===e?"precise-comparison":"estimate probability"===e?"probability-estimation":"understand risk"===e?"risk-communication":"remember"===e?"memory":"decide"===e?"support-decision":e}function ya(e){const t=ga(e);return"precise-comparison"===t?["compare-categories","rank"]:"probability-estimation"===t?["distribution"]:"risk-communication"===t?["part-to-whole","distribution"]:"frequency-reasoning"===t?["distribution","compare-categories"]:"memory"===t||"editorial-engagement"===t?["compare-categories"]:"public-explanation"===t||"support-decision"===t?["distribution","compare-categories"]:["compare-categories"]}function ba(e){const t=ga(e.taskIntent),r="small"===(a=e.availableSpace)?25:"large"===a?100:50;var a;if("precise-comparison"===t)return{recommendedEncoding:"bar-or-line",rationale:"Use continuous position/length encodings when precise magnitude comparison is the primary task.",warnings:[],alternatives:["hybrid-bar-token","unitized-measure"]};if("probability-estimation"===t){const e={tokenType:"dot",tokenSemantics:"possible-outcome",countStrategy:"quantile",tokenCount:r,layout:"dotplot",labelPolicy:"text-plus-token"};return{recommendedEncoding:"quantile-dotplot",tokenEncoding:e,rationale:"This task asks readers to estimate probability from a distribution. Quantile tokens turn probability mass into countable possible outcomes.",warnings:fa(e),alternatives:["cdf-with-threshold","density-with-threshold"]}}if("risk-communication"===t){const t={tokenType:e.concreteEntity?"icon":"dot",icon:e.concreteEntity,tokenSemantics:"risk-case",countStrategy:"fixed-denominator",denominator:100,layout:"waffle",labelPolicy:"text-plus-token"};return{recommendedEncoding:"fixed-denominator-icon-array",tokenEncoding:t,rationale:"Risk is often clearer as natural frequency: highlighted cases out of a fixed denominator.",warnings:fa(t,{visibleTokens:100,maxRecommendedTokens:100}),alternatives:["labeled-percent","bar-with-risk-threshold"]}}if("memory"===t||"editorial-engagement"===t){const t={tokenType:e.concreteEntity?"glyph":"icon",icon:e.concreteEntity,tokenSemantics:"unitized-measure",countStrategy:"unitized",unitValue:1,layout:"grid",labelPolicy:"text-plus-token",unitMeaning:e.concreteEntity?"one token represents a unit of "+e.concreteEntity:"one token represents one unit"};return{recommendedEncoding:"semantic-isotype",tokenEncoding:t,rationale:"Semantic tokens are useful when the chart needs to make a topic concrete and memorable.",warnings:fa(t),alternatives:["labeled-bar","hybrid-bar-token"]}}if("frequency-reasoning"===t||"public-explanation"===t||"support-decision"===t){const t={tokenType:e.concreteEntity?"icon":"dot",icon:e.concreteEntity,tokenSemantics:"distribution"===e.dataType?"possible-outcome":"unitized-measure",countStrategy:"distribution"===e.dataType?"quantile":"unitized",unitValue:"distribution"===e.dataType?void 0:1,tokenCount:r,layout:"distribution"===e.dataType?"dotplot":"bar-segment",labelPolicy:"text-plus-token",unitMeaning:"distribution"===e.dataType?void 0:"one token represents one unit interval"};return{recommendedEncoding:"hybrid-continuous-token",tokenEncoding:t,rationale:"A hybrid view preserves measurement while adding countable tokens for explanation and decisions.",warnings:fa(t),alternatives:["bar-or-line","quantile-dotplot","fixed-denominator-icon-array"]}}return{recommendedEncoding:"bar-or-line",rationale:"Use continuous encodings unless the task needs frequency, risk, memory, or outcome reasoning.",warnings:[],alternatives:["unitized-measure","quantile-dotplot","fixed-denominator-icon-array"]}}function va(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));const r=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;const[a,i,n]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],o=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*o(a)+.7152*o(i)+.0722*o(n)}function wa(e,t){const r=va(e),a=va(t);return null===r||null===a?null:(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}var xa=["xExtent","yExtent","rExtent"];function Aa(e){const t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function Ca(e,t,r){if("function"==typeof t)return t(e);const a="string"==typeof t?t:r;return e?.[a]}var ka=new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),Sa=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"];function Pa(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function $a(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function Na(e,t){const r=$a(e.visibleTokens);if(null!=r)return r;const a=$a(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=a)return a;const i=$a(t.tokenCount),n=$a(t.maxTokens);return null!=i&&null!=n?Math.min(i,n):i??a??n}function Ma(e,r){const a=[],i=pa(e,function(e){const t={...e};return delete t.tokenEncoding,delete t.visibleTokens,Pa(t.encoding)&&delete t.encoding,t}(r));for(const e of i.errors)a.push({severity:"error",code:"VALIDATION",message:e,fix:""});if(!la[e])return{ok:0===a.length,diagnoses:a};!function(e,t,r){const a=la[e];if(a){if("array"===a.dataShape){const e=t.data;e&&Array.isArray(e)&&0===e.length&&r.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===a.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&r.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}(e,r,a),function(e,t,r){const a=t.width,i=t.height;if(void 0===a||"number"==typeof a&&a>0||r.push({severity:"error",code:"BAD_WIDTH",message:`width=${JSON.stringify(a)} — chart needs a positive number.`,fix:"Set width={600} or use responsiveWidth={true}."}),void 0===i||"number"==typeof i&&i>0||r.push({severity:"error",code:"BAD_HEIGHT",message:`height=${JSON.stringify(i)} — chart needs a positive number.`,fix:"Set height={400} or use responsiveHeight={true}."}),t.size&&Array.isArray(t.size)){const[e,a]=t.size;(null!=e&&0>=e||null!=a&&0>=a)&&r.push({severity:"error",code:"BAD_SIZE",message:`size=[${e}, ${a}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}(0,r,a),function(e,t,r){const a=la[e];if(!a||"array"!==a.dataShape)return;const i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;const n=i[0];if(!n||"object"!=typeof n)return;const o=Object.keys(n);for(const e of a.dataAccessors){const a=t[e];"string"==typeof a&&(a in n||r.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${a}" not found in data. Available fields: ${o.join(", ")}.`,fix:`Change ${e} to one of: ${o.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}(e,r,a),function(e,t,r){y.has(e)&&Array.isArray(t.data)&&r.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:e+" expects hierarchical data but received a flat array.",fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}(e,r,a),function(e,t,r){A.has(e)&&(t.edges||t.data||r.push({severity:"error",code:"NETWORK_NO_EDGES",message:e+" requires an edges prop.",fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'}))}(e,r,a),function(e,t,r){const a=la[e];if(!a||"array"!==a.dataShape)return;const i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;const n=i[0];if(!n||"object"!=typeof n)return;const o=t.xAccessor;"string"==typeof o&&n[o]instanceof Date&&!t.xFormat&&r.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${o}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}(e,r,a),function(e,t,r){t.linkedHover&&!t.selection&&r.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}(0,r,a),function(e,t,r){if(!c.has(e))return;const a=t.rExtent||t.yExtent||t.valueExtent;a&&Array.isArray(a)&&a.length>=1&&null!=a[0]&&0!==a[0]&&r.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${a[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${a[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}(e,r,a),function(e,t,r){if(!_.has(e))return;if(t.gapStrategy)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=t.yAccessor||"y";"string"==typeof i&&a.some(e=>{const t=e[i];return null==t||Number.isNaN(t)})&&r.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${i}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}(e,r,a),function(e,t,r){const a=t.width??600,i=t.height??400,n=t.margin;if(!n||"object"!=typeof n)return;const o=(n.left||0)+(n.right||0),s=(n.top||0)+(n.bottom||0);a>o||r.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${o}px) >= width (${a}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),i>s||r.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${s}px) >= height (${i}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}(0,r,a);const n=t(e,r,void 0,{checkOutliers:!1}).diagnoses;for(const e of n)"EMPTY_DATA"===e.code&&a.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||a.push(e);if(function(e,t,r){if(!k.has(e))return;const a=t.barPadding;"number"==typeof a&&10>a&&r.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${a} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}(e,r,a),function(e,t,r){if("Heatmap"!==e)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=a[0];if(i&&"object"==typeof i)for(const e of["xAccessor","yAccessor"]){const a=t[e];if("string"!=typeof a)continue;const n=i[a];"string"==typeof n&&r.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${a}" resolves to string values (e.g. "${n}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}(e,r,a),function(e,t,r){const a=t.colorScheme;if(!a||!Array.isArray(a))return;const i="string"==typeof t.background?t.background:"#ffffff";if(!i.startsWith("#"))return;const n=[];for(const e of a){if("string"!=typeof e||!e.startsWith("#"))continue;const t=wa(e,i);null!==t&&3>t&&n.push(`${e} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${n.length} color(s) in colorScheme have < 3:1 contrast against background "${i}": ${n.join(", ")}. Data marks may be hard to see.`,fix:'Use darker colors on light backgrounds or lighter colors on dark backgrounds. Import COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for an accessible preset.'})}(0,r,a),function(e,t,r){const a=t.colorScheme;if(!a||!Array.isArray(a)||2>a.length)return;const i=a.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>i.length)return;const n=[];for(let e=0;i.length-1>e;e++){const t=wa(i[e],i[e+1]);null!==t&&1.5>t&&n.push(`${i[e]} / ${i[e+1]} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${n.length} adjacent color pair(s) in colorScheme have very similar luminance: ${n.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}(0,r,a),function(e,t,r){const a=t.colorScheme;if("string"!=typeof a)return;const i=la[e];i?.props?.colorScheme?.enum||ka.has(a)||r.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${a}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...ka].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}(e,r,a),function(e,t,r){const a=la[e]?.props,i=e=>!!a?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,n=i("title"),o=i("description"),s=i("summary");n||o||s||r.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}(e,r,a),function(e,t,r){const a=[];for(const e of Sa)"function"==typeof t[e]&&a.push(e);a.length>0&&r.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${a.length>1?"s":""} detected: ${a.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}(0,r,a),function(e,t,r){const a=t.hoverRadius;"number"==typeof a&&a>0&&24>a&&!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick)&&r.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${a}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}(0,r,a),function(e,t,r){!0===t.responsiveWidth&&!0===t.responsiveHeight&&r.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}(0,r,a),function(e,t,r){if(!0!==t.showParticles)return;const a=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},i="number"==typeof a.maxPerLine?a.maxPerLine:void 0,n="number"==typeof a.spawnRate?a.spawnRate:void 0;("number"==typeof i&&i>20||"number"==typeof n&&n>.08)&&r.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}(0,r,a),function(e,t,r){const a=[];Pa(t.tokenEncoding)&&a.push({source:"tokenEncoding",encoding:t.tokenEncoding}),Pa(t.encoding)&&a.push({source:"encoding",encoding:t.encoding});for(const{source:e,encoding:i}of a){const a=Na(t,i);for(const t of fa(i,{visibleTokens:a}))r.push({severity:"warning",code:"TOKEN_"+t.code,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}(0,r,a),function(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(const e of a){if(!e||"object"!=typeof e)continue;const t=br(e);if(!xr(e)||"widget"===t)continue;const a=Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0),i="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,n=gr(e);!n&&a>120?r.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${i}" sits ~${Math.round(a)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):n&&a>250&&r.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${i}" uses a very long connector (~${Math.round(a)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}(0,r,a),function(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(!a)return;const i=a.filter(xr).length;if(0===i)return;const n="number"==typeof t.width?t.width:600,o="number"==typeof t.height?t.height:400,s=fr(n,o);Number.isFinite(s)&&i>s&&r.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${i} note annotations on a ${n}×${o} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}(0,r,a),function(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(const e of a)e&&"object"==typeof e&&"widget"===br(e)&&null!=e.content&&!yr(e)&&r.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}(0,r,a),function(e,t,r){for(const e of xa){const a=t[e];if(!Array.isArray(a)||2>a.length)continue;const[i,n]=a;"number"==typeof i&&"number"==typeof n&&i>n&&r.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${i}, ${n}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${n}, ${i}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}(0,r,a),function(e,t,r){if("MultiAxisLineChart"!==e)return;const a=t.series;if(!Array.isArray(a)||2!==a.length)return;const i=a.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);i.length>0&&r.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${i.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}(e,r,a),function(e,t,r){if(!_.has(e))return;const a=t.xExtent;if(!Array.isArray(a)||2>a.length)return;const[i,n]=a;if("number"!=typeof i||"number"!=typeof n||i>=n)return;const o=t.data;if(!o||!Array.isArray(o)||4>o.length)return;const s=t.xAccessor??"x";if("string"!=typeof s)return;let c=1/0,l=-1/0;for(const e of o){const t=e?.[s];"number"==typeof t&&Number.isFinite(t)&&(c>t&&(c=t),t>l&&(l=t))}if(!Number.isFinite(c)||!Number.isFinite(l)||c>=l)return;const u=l-c,d=Math.max(0,Math.min(n,l)-Math.max(i,c))/u;.7>d&&r.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${i}, ${n}] shows only ~${Math.round(100*d)}% of the data's x range [${c}, ${l}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}(e,r,a),a.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||function(e,t,r){const a=P[e],i=C[e];if(!a&&!i)return;if(i&&!t.normalize)return;const n=a??i,o=t[n],s="string"==typeof o?o:"yAccessor"===n?"y":"value",c=t.data;if(!c||!Array.isArray(c)||0===c.length)return;const l=c.filter(e=>{const t=e?.[s];return"number"==typeof t&&0>t});l.length>0&&r.push({severity:a?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${l.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${a?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:a?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}(e,r,a),function(e,t,r){u.has(e)&&"basis"===t.curve&&r.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}(e,r,a),function(e,t,r){if("LineChart"!==e&&"AreaChart"!==e)return;if("sparkline"===t.mode)return;if(t.responsiveWidth||t.responsiveHeight)return;const a="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400;if(0>=a||0>=i)return;const n=a/i;if(n>8||.25>n){const e=n>8?"flattens":"exaggerates";r.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${a}×${i} (${n.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:n>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}(e,r,a),function(e,t,r){if(!I.has(e))return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=t.categoryAccessor,n="string"==typeof i?i:"category",o=new Set;for(const e of a){const t=e?.[n];null!=t&&o.add(t)}o.size>8&&r.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:o.size+" slices — angle judgments degrade rapidly past ~8 categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.",fix:`Use a BarChart or DotPlot for ${o.size} categories, or group the long tail into an "Other" slice before charting.`})}(e,r,a),function(e,t,r){if(N.has(e)){if("GaltonBoardChart"===e){const e=t.bins;"number"==typeof e&&2>e&&r.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} leaves no meaningful settled projection for a Galton board.`,fix:"Use at least two bins; 8-24 bins is a practical range for physics distributions."});const a=Aa(t.branchProbability);null!=t.branchProbability&&(null==a||0>a||a>1)&&r.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${t.branchProbability+""} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});const i=Aa(t.mechanicalCount);null==t.mechanicalCount||null!=i&&i>0||r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){const e=t.windows,a=e&&"object"==typeof e?Aa(e.size):null;null==a||a>0||r.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${a} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"!=typeof t.timeScale||t.timeScale>0||r.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});const i=Array.isArray(t.data)?t.data:[];if(i.length>0){const e=t.timeAccessor||"time",a=t.arrivalAccessor||"arrivalTime";i.some(t=>{const r=Aa(Ca(t,e,"time")),i=Aa(Ca(t,a,"arrivalTime"));return null!=r&&null!=i&&r!==i})||r.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){const e=Aa(t.mechanicalCount);null==t.mechanicalCount||null!=e&&e>0||r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),"mechanical"===t.mode&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&r.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});const a=Aa(t.unitValue??1)??1;if(0>=a)return void r.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});const i=t.valueAccessor||"value",n=(Array.isArray(t.data)?t.data:[]).reduce((e,t)=>{const r=Aa(Ca(t,i,"value"))??0;return e+Math.max(0,Math.round(r/a))},0);n>1500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${n} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Increase unitValue, cap visible units, or aggregate before rendering so the settled projection remains readable."})}if("CollisionSwarmChart"===e){if((Aa(t.pointRadius??5)??5)>0||r.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),(Aa(t.collisionIterations??6)??6)>0||r.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){const e=Array.isArray(t.xExtent)?t.xExtent:[],a=Aa(e[0]),i=Aa(e[1]);(2>e.length||null==a||null==i)&&r.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}const e=Array.isArray(t.data)?t.data:[];e.length>1200&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});const a=t.groupAccessor;if(e.length>0&&a){const t=new Set;for(const r of e){const e=Ca(r,a,"group");null!=e&&t.add(e)}t.size>12&&r.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if("GaltonBoardChart"!==e&&"UnitPileChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"EventDropChart"!==e||(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&r.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:e+" appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.",fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),"UnitPileChart"!==e&&"GaltonBoardChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"CrucibleChart"!==e||!1!==t.showProjection||r.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:e+" has showProjection={false}. Without a settled projection, motion is easy to over-read as data.",fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){const e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)r.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===(e.id+"").trim())&&r.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});const a=e.filter(e=>e?.absorb).length;t.groupBy&&0===a&&r.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||r.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){const e=Array.isArray(t.phases)?t.phases:[],a=Array.isArray(t.products)?t.products:[],i=Array.isArray(t.events)?t.events:[],n=Array.isArray(t.outlets)?t.outlets:[];0===e.length?r.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===(e.id+"").trim()||null==Aa(e.duration)||0>=Number(e.duration))&&r.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===a.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===i.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||r.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});const o=new Set(a.map(e=>e?.id).filter(e=>null!=e).map(String)),s=new Set(["product","retained","residue","failed","recovered",...n.map(e=>e?.id).filter(e=>null!=e).map(String)]),c=new Set,l=new Set;for(const e of i)if(e&&Array.isArray(e.effects))for(const t of e.effects){if(!t||"object"!=typeof t)continue;const e=t.type;if("combine"!==e&&"contribute"!==e&&"complete-product"!==e||null==t.productId||o.has(t.productId+"")||c.add(t.productId+""),"split"===e&&Array.isArray(t.products))for(const e of t.products)null==e?.productId||o.has(e.productId+"")||c.add(e.productId+"");null==t.outletId||s.has(t.outletId+"")||l.add(t.outletId+"")}c.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...c].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),l.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...l].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});const u=Aa(t.playbackRate);null==t.playbackRate||null!=u&&u>0||r.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${t.playbackRate+""} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});const d=Aa(t.rerunMS);null==t.rerunMS||null!=d&&d>=0||r.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${t.rerunMS+""} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){const a=Array.isArray(t.data)?t.data:[],i=Aa(t.mechanicalCount)??0,n=a.length>0?a.length:i;n>2500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(n)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}(e,r,a),"ProcessSankey"===e)for(const e of Et(r))a.push(e);return{ok:a.every(e=>"warning"===e.severity),diagnoses:a}}var Ta=["title","description","summary"];function Ia(e){return"string"==typeof e&&e.trim().length>0}var Ra=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]);function Da(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=function(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}(e)}function Ea(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;const r=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return r?r.length:1}function _a(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function Fa(e,t,r={}){const a=[],i=le(e),n=M.has(e),o=!!la[e]||!!i||n,s=!0===r.inChartContainer,c=!0===r.describe,u=!0===r.navigable,d=F.has(e),m=y.has(e),{hasTitle:p,hasDescription:f,hasSummary:b,unsupportedFinding:v}=function(e,t){const r=la[e]?.props,a=e=>!!r?.[e],i=Ta.filter(e=>Ia(t[e])&&!a(e));return{hasTitle:a("title")&&Ia(t.title),hasDescription:a("description")&&Ia(t.description),hasSummary:a("summary")&&Ia(t.summary),unsupportedFinding:i.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${i.join(" and ")} text was supplied, but ${1===i.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}(e,t),w=!1!==t.accessibleTable&&!d,x=p||f||b,A=function(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}(t),C=function(e){const t=_a(e),r=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===r.pause||"function"==typeof r.pause}(t),k=n,S=function(e){const t=_a(e);return!0===e.settledProjection||!0===t.settledProjection}(t)||T.has(e)&&w,P=function(e){const t=_a(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}(t)||k,N=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],I=o?"pass":"manual",E=o?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(v&&a.push(v),a.push(function(e){const t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},r=e.colorScheme,a="string"==typeof e.background?e.background:null;if(a&&!a.startsWith("#"))return{...t,status:"manual",message:`Background "${a}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};const i=a??"#ffffff";if(!Array.isArray(r))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};const n=[];let o=0;for(const e of r){if("string"!=typeof e||!e.startsWith("#"))continue;const t=wa(e,i);null!=t&&(o++,3>t&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===o?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${i}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${o} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}(t)),a.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...d?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:w?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:f&&b?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),a.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),a.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||l.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),null!=t.colorBy){const e=!0===t.directLabel||!0===t.showLabels,r=function(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;const t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;const r=t.fill;return"object"==typeof r&&null!==r&&"hatch"===r.type})}(t);a.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:r?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:r?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});const i=function(e){if(!Array.isArray(e))return!1;const t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>Ra.has(e))}(t.colorScheme);a.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...i?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),a.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:r?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:r?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{const e=N.filter(xr);if(e.length>0){const r=t.autoPlaceAnnotations,i="object"==typeof r&&null!==r&&!0===r.redundantCues,n=e.filter(e=>{if("string"!=typeof e.color)return!1;const t=br(e),r=i&&"text"===t;return!(gr(e)||r)});a.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===n.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${n.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}a.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...o?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{const e=[];null==t.brush&&null==t.onBrush||e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||e.push("legend filtering"),e.length>0&&a.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{const r=R[e];if(r&&A){const e=t[r];"number"==typeof e&&e>0&&24>2*e&&a.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${r}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}a.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:I,message:`The chart takes a single tab stop and navigates data with arrow keys${E} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),a.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...A?b||f?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),a.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:I,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${E}.`}),a.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:I,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${E}.`,fix:o?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),a.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...x?{status:"pass",message:`Provided: ${[p&&"title",f&&"description",b&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),a.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...f||b?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:c?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:p?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{const e=[t.description,t.summary].filter(Ia).join(". "),r=e?function(e){const t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),r=e.trim().split(/\s+/).filter(Boolean);if(0===r.length||0===t.length)return null;let a=0;for(const e of r)a+=Ea(e);return r.length/t.length*.39+a/r.length*11.8-15.59}(e):null;a.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==r?{status:"not-applicable",message:"No description/summary text to grade."}:r>9?{status:"warn",message:`Description/summary reads at ~grade ${r.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(r))} (≤ 9).`}})}if(j.has(e)){const e=Ia(t.xLabel),r=Ia(t.yLabel);a.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&r?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!r&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(h.has(e)&&a.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),N.length>1){const e=N.filter(Da).length;a.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===N.length?{status:"pass",message:`All ${N.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:N.length+" annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.",fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${N.length-e} of ${N.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&a.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&a.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:I,message:`Transitions animate with object constancy and data changes are mirrored to the live region${E}.`,fix:o?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),a.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),a.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),a.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:I,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${E}.`,fix:o?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),a.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...d?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:w?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),d||a.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),a.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:o?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${o?"":E}.`,fix:o?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),a.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...u?m?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:m?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:I,message:`Keyboard navigation steps through points and switches series/groups${E}.`,fix:o?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{const r=Array.isArray(t.data)?t.data:null,i=Array.isArray(t.nodes)?t.nodes:null,n={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};let o;o=$.has(e)&&r&&r.length>7?{...n,status:"warn",message:r.length+" slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.",fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:i&&i.length>200?{...n,status:"warn",message:i.length+" nodes. A network this size is hard to navigate non-visually node by node.",fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:r&&r.length>5e3?{...n,status:"warn",message:r.length+" data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.",fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:r?{...n,status:"pass",message:r.length+" data points — a reasonable density for non-visual consumption."}:i?{...n,status:"pass",message:i.length+" nodes — a reasonable density for non-visual consumption."}:{...n,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},a.push(o)}{const e=Array.isArray(t.data)?t.data:null,r=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]);let i=!1;if(e&&!r)for(const t of e.slice(0,50))if(t&&"object"==typeof t){for(const e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){i=!0;break}if(i)break}i&&a.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}a.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...c?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:b?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),a.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...d?{status:"not-applicable",message:"Single value — nothing to skip."}:w?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),a.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:I,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${E}.`,fix:o?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),a.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...l.has(e)||D.has(e)?C?{status:"pass",message:e+" animates continuously and declares an in-chart pause/stop control."}:{status:"warn",message:e+" animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.",fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:I,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${E}.`}}),n&&(a.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...C?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),a.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...S?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),a.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...P?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{const r=!0===t.responsiveWidth||!0===t.responsiveHeight,i=g.has(e)&&!0===t.zoomable;a.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...r?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}if(i){const e=i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length));e&&a.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:i.name+" declares a color encoding without a redundant cue.",fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"!==i.accessibility.description||Ia(t.description)||a.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:i.name+" requires a recipe-aware description, but none is attached.",fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&a.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:i.name+" requires a fallback table, but accessibleTable is disabled.",fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."})}const _=a.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),B={criticalsPassed:_.filter(e=>"pass"===e.status).length,criticalsEvaluated:_.length,fails:a.filter(e=>"fail"===e.status).length,warnings:a.filter(e=>"warn"===e.status).length,manual:a.filter(e=>"manual"===e.status).length,passes:a.filter(e=>"pass"===e.status).length};return{component:e,ok:!_.some(e=>"fail"===e.status),summary:B,findings:a,reference:"Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari)."}}function ja(e,{onlyCritical:t=!1}={}){const r=[];for(const a of e.findings)"fail"!==a.status&&"warn"!==a.status||t&&!a.critical||r.push(a.message);return r}var Ba={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},Oa=["perceivable","operable","understandable","robust","compromising","assistive","flexible"];function za(e){const t=[],r=e.summary,a=e.ok?`${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`:`${r.fails} blocking failure(s) — ${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${a} · ${r.warnings} warning(s) · ${r.manual} to verify manually`);for(const r of Oa){const a=e.findings.filter(e=>e.principle===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(" "+r.toUpperCase());for(const e of a)t.push(` ${Ba[e.status]} ${e.id}${e.critical?" [critical]":""}: ${e.message}`),!e.fix||"fail"!==e.status&&"warn"!==e.status&&"manual"!==e.status||t.push(" → "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}var La={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."};function Ha(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[La]:[]}var Ga={error:0,warning:1,manual:2},qa={data:0,deception:1,accessibility:2,render:3};function Ua(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Va(e,t,r){return{id:`${t}.${e.code.toLowerCase()}.${r+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function Wa(e,t){const r=e.filter(e=>"manual"!==e.severity),a=r.slice(0,t).map(e=>({id:"chart-evaluation-"+e.id,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${Ua(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return r.length>t&&a.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:r.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),a}function Ya(e){const t=[`${e.component}: ${e.ok?"PASS":"ISSUES FOUND"}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(const r of e.findings)t.push(`${r.rank}. [${r.stage}/${r.code}] ${r.message}`),r.fix&&t.push(" Fix: "+r.fix);return t.join("\n")}function Xa(e,r={},a,i={}){const n=void 0===a?r:{...r,data:a},o=pa(e,n),s=t(e,n,a,i.dataAudit),c=Ma(e,n).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),l=Fa(e,n,{inChartContainer:i.inChartContainer,describe:i.describe,navigable:i.navigable}),u=[];for(const[e,t]of o.errors.entries())u.push({id:"validation."+(e+1),stage:"deception",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});let d;s.diagnoses.forEach((e,t)=>{u.push(Va(e,"data",t))}),c.forEach((e,t)=>{u.push(Va(e,"deception",t))}),l.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{u.push(function(e,t){return{id:e.id||"accessibility."+(t+1),stage:"accessibility",severity:"fail"===e.status?"error":"warn"===e.status?"warning":"manual",code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}(e,t))});const m=u.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(i.render&&o.valid&&!m)try{d=i.render(e,n).evidence,u.push(...function(e){const t=[];e.empty&&t.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});const r=new Set;for(const a of Ha(e))r.add(a.code),t.push({id:"render."+a.code.toLowerCase(),stage:"render",severity:a.severity,code:a.code,message:a.message,...a.fix?{fix:a.fix}:{},source:"capability.semanticViability"});for(const a of e.warnings)r.has(a)||t.push({id:"render."+a.toLowerCase(),stage:"render",severity:"warning",code:a,message:`The renderer reported ${Ua(a).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return t}(d))}catch{u.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}const p=function(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{const r=Ga[e.finding.severity]-Ga[t.finding.severity];if(0!==r)return r;const a=!0===e.finding.critical;if(a!==(!0===t.finding.critical))return a?-1:1;const i=qa[e.finding.stage]-qa[t.finding.stage];return 0!==i?i:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}(u),h=p.filter(e=>"error"===e.severity).length,f=p.filter(e=>"warning"===e.severity).length,g=p.filter(e=>"manual"===e.severity).length,y=Wa(p,Math.max(0,Math.floor(i.notificationMax??8)));return{component:e,validation:o,data:s,deception:c,accessibility:l,...d?{evidence:d}:{},ok:0===h,summary:{errors:h,warnings:f,manual:g,findings:p.length,notifications:y.length},findings:p,notifications:y}}function Ka(e,t=8){return Wa(e,Math.max(0,Math.floor(t)))}import{useCallback as Qa,useMemo as Za,useRef as Ja,useState as ei}from"react";var ti=/^\d{4}[-/]\d{2}/,ri=/^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ai(e){return"number"==typeof e?Number.isFinite(e)?"numeric":"unknown":e instanceof Date?"date":"string"==typeof e?ti.test(e)&&!Number.isNaN(Date.parse(e))?"date":ri.test(e)&&Number.isFinite(Number(e))?"numeric":"categorical":"boolean"==typeof e?"categorical":"unknown"}function ii(e){let t=1/0,r=-1/0;for(let a=0;e.length>a;a++){const i=e[a];t>i&&(t=i),i>r&&(r=i)}return{min:t,max:r}}function ni(e){const t=e.length;if(0===t)return NaN;const r=t>>1;return t%2==0?(e[r-1]+e[r])/2:e[r]}function oi(e,t={}){const{maxDistinct:r=10,sampleSize:a=5,keyScanRows:i=100}=t;if(!Array.isArray(e)||0===e.length)return{rowCount:0,fields:{},sample:[]};const n=new Set,o=Math.min(e.length,i);for(let t=0;o>t;t++){const r=e[t];if(r&&"object"==typeof r)for(const e of Object.keys(r))n.add(e)}const s={};for(const t of n){const a=[];for(let r=0;e.length>r;r++){const i=e[r]?.[t];null!=i&&a.push(i)}if(0===a.length){s[t]={type:"unknown"};continue}const i=ai(a[0]);if("numeric"===i){const e=[];for(let t=0;a.length>t;t++){const r=Number(a[t]);Number.isFinite(r)&&e.push(r)}if(0===e.length){s[t]={type:"unknown"};continue}const{min:r,max:i}=ii(e);let n=0;for(let t=0;e.length>t;t++)n+=e[t];const o=[...e].sort((e,t)=>e-t);s[t]={type:"numeric",min:r,max:i,mean:n/e.length,median:ni(o)}}else if("date"===i){const e=[];for(let t=0;a.length>t;t++){const r=a[t],i=r instanceof Date?r.getTime():Date.parse(r);Number.isFinite(i)&&e.push(i)}if(0===e.length){s[t]={type:"unknown"};continue}const{min:r,max:i}=ii(e);s[t]={type:"date",min:new Date(r).toISOString(),max:new Date(i).toISOString()}}else if("categorical"===i){const e=new Map;for(let t=0;a.length>t;t++){const r=a[t]+"";e.set(r,(e.get(r)??0)+1)}const i=[...e.entries()].sort((e,t)=>t[1]-e[1]).slice(0,r).map(([e,t])=>({value:e,count:t}));s[t]={type:"categorical",distinctCount:e.size,topValues:i,distinctValues:e.size>r?void 0:i.map(e=>e.value)}}else s[t]={type:"unknown"}}return{rowCount:e.length,fields:s,sample:e.slice(0,a)}}var si=/^(x|index|rank|order|step|sequence|year|quarter|qtr|fiscal|month|week|day|date|time|timestamp)$/i,ci=new Set(["identifier","measure","dimension","temporal","x","y","size","category","series","time","ignore"]);function li(e,t,r){const a={};for(const[t,r]of Object.entries(e??{}))a[t]=Array.from(new Set((Array.isArray(r)?r:[r]).filter(e=>"string"==typeof e&&ci.has(e))));for(const e of t??[])"string"==typeof e&&0!==e.length&&(a[e]=Array.from(new Set([...a[e]??[],"identifier"])));return r&&(a[r]=Array.from(new Set([...a[r]??[],"series"]))),a}function ui(e,t,r){return e[t]?.includes(r)??!1}function di(e){return Object.keys(e).filter(t=>ui(e,t,"identifier"))}function mi(e,t,r,a){const i=e[t]??[];if(i.includes("identifier")||i.includes("ignore"))return 0;if(0===i.length)return a?1:0;const n="category"===r||"series"===r?"dimension":"time"===r?"temporal":"measure",o=i.includes(r)||i.includes(n)||"x"===r&&i.includes("temporal"),s=i.includes(r)&&("x"===r||"category"===r||"series"===r);return o&&(a||s)?2:0}function pi(e,t){if(!t)return{repeated:!1};const r=new Set;let a=0;for(const i of e){const e=i?.[t];null!=e&&(a++,r.add(e+""))}return{distinct:r.size,repeated:a>r.size}}function hi(e,t,r){return e?e===t?"time":ui(r,e,"x")||si.test(e)?"named":"scatter":"none"}function fi(e,t,r){if(!t||!r)return;const a=new Map;for(const i of e){const e=i?.[t],n=i?.[r];if(null==e||null==n)continue;const o=e+"",s=a.get(o)??new Set;s.add(n+""),a.set(o,s)}if(0===a.size)return;let i=0,n=0;for(const e of a.values())i+=e.size,2>e.size||n++;return{seriesPerX:i/a.size,multiSeriesFraction:n/a.size,xColumns:a.size}}function gi(e,t,r,a){if((t[a]??[]).some(e=>"identifier"===e||"ignore"===e)||!e[r].some(e=>e.field===a))throw Error(`Invalid ${r} field "${a}": identifier, ignored, or not a candidate.`)}function yi(e,t,r,a={}){const i=t.time[0]?.field;let n=t.x.find(e=>ui(r,e.field,"x"))?.field??i;n||(n=t.x.find(e=>"numeric"===e.kind&&si.test(e.field))?.field);const o=t.y.find(e=>e.field!==n)?.field;!n&&o&&(n=t.x.find(e=>"numeric"===e.kind&&e.field!==o)?.field);const s=t.size.find(e=>e.field!==n&&e.field!==o)?.field,c=hi(n,i,r);let l,u;"time"===c||"named"===c?(u=t.series[0]?.field,l=t.category.find(e=>e.field!==u)?.field):(l=t.category[0]?.field,u=t.series.find(e=>e.field!==l)?.field);const d={x:n,y:o,size:s,category:l,series:u,time:i};if(a.primary)for(const[e,i]of Object.entries(a.primary))void 0!==i&&gi(t,r,e,i),d[e]=i;const m=hi(d.x,d.time,r),p=pi(e,d.category),h=pi(e,d.series),f=pi(e,d.x);return{primary:d,categoryCount:p.distinct,seriesCount:h.distinct,uniqueXCount:f.distinct,hasRepeatedX:f.repeated,monotonicX:t.x.find(e=>e.field===d.x)?.monotonic??!1,hasTimeAxis:t.time.length>0,xProvenance:m,stackability:fi(e,d.x,d.series)}}function bi(e,t={}){const r=li(e.fieldRoles,e.identifiers);return{...e,fieldRoles:r,identifiers:di(r),...yi(e.data,e.candidates,r,t)}}var vi=/^(y|value|amount|total|count|revenue|sales|price|score|rate|population|measure)$/i,wi=/(size|magnitude|volume|weight|count|amount)/i,xi=/^(category|label|name|type|group|region|segment|kind|class)$/i,Ai=/^(series|group|type|category|segment|cohort|product)$/i,Ci=new Set(["numeric"]),ki=new Set(["numeric","date"]),Si=new Set(["numeric"]),Pi=new Set(["date"]),$i=new Set(["categorical","boolean"]);function Ni(e){return"numeric"===e.type?"numeric":"date"===e.type?"date":"categorical"===e.type?"categorical":"unknown"}function Mi(e,t){return t.test(e)?.2:0}function Ti(e,t){let r=null;for(let a=0;e.length>a;a++){const i=e[a]?.[t];if(null==i)continue;const n=i instanceof Date?i.getTime():Number(i);if(!Number.isFinite(n))return!1;if(null!==r&&r>n)return!1;r=n}return null!==r}function Ii(e,t,r,a,i,n,o={}){const s=[];for(const[c,l]of Object.entries(e)){const e=Ni(l),u=mi(n,c,i,r.has(e));if(0===u)continue;const d=2===u;let m,p=.5;p+=Mi(c,a),d&&(p+=.35),"categorical"===l.type&&(m=l.distinctCount,!m||2>m||m>12||(p+=.2),m&&m>50&&(p-=.2)),"numeric"===l.type&&Number.isFinite(l.min)&&Number.isFinite(l.max)&&l.max>l.min&&(p+=.1);const h={field:c,kind:e,quality:Math.max(0,Math.min(1,p)),distinctCount:m,...d?{hinted:!0}:{}};!o.computeMonotonic||"numeric"!==e&&"date"!==e||(h.monotonic=Ti(t,c),h.monotonic&&(h.quality=Math.min(1,h.quality+.2))),s.push(h)}return s.sort((e,t)=>t.quality-e.quality),s}var Ri=/^(source|from|origin|stage|currentstage|sourcestage|fromstage)$/i,Di=/^(target|to|destination|nextstage|next|targetstage|tostage|destinationstage|status)$/i,Ei=/^(starttime|startedat|enteredat|startdate|start|timestamp|date|time)$/i,_i=/^(endtime|endedat|exitedat|completedat|finishtime|enddate|end)$/i,Fi=/^(value|weight|amount|count|magnitude|volume)$/i;function ji(e,t){return e.find(e=>t.test(e))}function Bi(e,t={}){const r=oi(e??[]),i=Array.isArray(e)?e:[],n=function(e){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=e;if("FeatureCollection"===t.type&&Array.isArray(t.features))return{hasHierarchy:!1,hasNetwork:!1,hasGeo:!0,geo:{features:t.features,points:Array.isArray(t.points)?t.points:void 0,flows:Array.isArray(t.flows)?t.flows:void 0}};if(Array.isArray(t.children))return{hasHierarchy:!0,hasNetwork:!1,hasGeo:!1,hierarchy:t};if(Array.isArray(t.nodes)&&(Array.isArray(t.edges)||Array.isArray(t.links)))return{hasHierarchy:!1,hasNetwork:!0,hasGeo:!1,network:{nodes:t.nodes,edges:t.edges??t.links}}}return{hasHierarchy:!1,hasNetwork:!1,hasGeo:!1}}(t.rawInput),o=li(t.fieldRoles,t.identifiers,t.seriesField);if(!n.hasNetwork&&!n.hasHierarchy&&!n.hasGeo){const e=function(e){if(3>e.length)return null;const t=e[0];if(!t||"object"!=typeof t)return null;const r=Object.keys(t),a=ji(r,Ri),i=ji(r,Di);if(!a||!i||a===i)return null;const n=ji(r,Ei),o=ji(r,_i),s=ji(r,Fi),c=[];for(const t of e){if(!t)continue;const e=t[a],r=t[i];if(null==e||null==r)continue;const n=(e+"").trim(),o=(r+"").trim();n&&o&&n!==o&&c.push(t)}if(3>c.length)return null;const l=new Map,u=new Map,d=new Map;for(const e of c){const t=(e[a]+"").trim(),r=(e[i]+"").trim();l.has(t)||l.set(t,{id:t,label:t}),l.has(r)||l.set(r,{id:r,label:r});const c=`${t}->${r}`,m=s?Number(e[s]):1,p=Number.isFinite(m)?m:1;u.set(c,(u.get(c)??0)+p),d.has(c)||d.set(c,{source:t,target:r,...n?{startTime:e[n]}:{},...o?{endTime:e[o]}:{}})}const m=[];for(const[e,t]of d)m.push({...t,value:u.get(e)??1});return{nodes:Array.from(l.values()),edges:m}}(i);e&&(n.hasNetwork=!0,n.network=e)}const s={x:Ii(r.fields,i,ki,si,"x",o,{computeMonotonic:!0}),y:Ii(r.fields,i,Si,vi,"y",o),size:Ii(r.fields,i,Ci,wi,"size",o),category:Ii(r.fields,i,$i,xi,"category",o),series:Ii(r.fields,i,$i,Ai,"series",o),time:Ii(r.fields,i,Pi,/(date|time|timestamp)/i,"time",o,{computeMonotonic:!0})},c=yi(i,s,o);return{...r,data:i,numericFields:a(i,{quantiles:!1}),fieldRoles:o,identifiers:di(o),candidates:s,...c,hasHierarchy:n.hasHierarchy,hasNetwork:n.hasNetwork,hasGeo:n.hasGeo,network:n.network,hierarchy:n.hierarchy,geo:n.geo}}var Oi=e=>e.split(" "),zi=[{id:"trend",label:"Trend over time",description:"How a single metric changes over an ordered sequence (typically time).",familyHint:"time-series",signals:{fieldNames:Oi("date time timestamp year month quarter period"),minimumFieldMatches:1,dataShape:{minNumericFields:1,minDateFields:1,confidence:3.5}}},{id:"compare-series",label:"Compare series",description:"Compare multiple measured series across a shared x domain.",familyHint:"time-series",signals:{fieldNames:Oi("series cohort segment group"),minimumFieldMatches:1}},{id:"compare-categories",label:"Compare categories",description:"Compare a single measure across discrete categories.",familyHint:"categorical",signals:{fieldNames:Oi("category product class type"),minimumFieldMatches:1,dataShape:{minNumericFields:1,minCategoricalFields:1,confidence:3}}},{id:"rank",label:"Rank",description:"Show category ordering by a measure (largest to smallest).",familyHint:"categorical",signals:{fieldNames:Oi("rank ranking position order"),minimumFieldMatches:1}},{id:"part-to-whole",label:"Part to whole",description:"Show how individual categories share a total.",familyHint:"categorical",signals:{fieldNames:Oi("share percentage percent portion total"),minimumFieldMatches:1}},{id:"distribution",label:"Distribution",description:"Show the shape, spread, and central tendency of a numeric variable.",familyHint:"distribution",signals:{fieldNames:Oi("frequency bin bucket percentile quantile"),minimumFieldMatches:1}},{id:"correlation",label:"Correlation",description:"Show the relationship between two (or more) numeric variables.",familyHint:"relationship",signals:{dataShape:{minNumericFields:2,confidence:3}}},{id:"flow",label:"Flow",description:"Show movement, transitions, or transfers between states.",familyHint:"flow",signals:{fieldNames:Oi("source target origin destination stage phase step"),minimumFieldMatches:2}},{id:"hierarchy",label:"Hierarchy",description:"Show parent/child structure or nested totals.",familyHint:"hierarchy",signals:{fieldNames:Oi("parent child level depth path"),minimumFieldMatches:2}},{id:"geo",label:"Geography",description:"Show values bound to geographic locations or regions.",familyHint:"geo",signals:{fieldNames:Oi("latitude longitude country state region city postal zip"),minimumFieldMatches:1}},{id:"outlier-detection",label:"Outlier detection",description:"Surface individual data points that diverge from the rest.",familyHint:"distribution",signals:{fieldNames:Oi("anomaly outlier zscore deviation"),minimumFieldMatches:1}},{id:"composition-over-time",label:"Composition over time",description:"Show how the share of categories changes across an ordered sequence.",familyHint:"time-series",signals:{fieldNames:Oi("share percentage percent date time period"),minimumFieldMatches:2,dataShape:{minNumericFields:1,minCategoricalFields:1,minDateFields:1,confidence:3.5}}},{id:"change-detection",label:"Change detection",description:"Surface where or when a metric shifted meaningfully.",familyHint:"time-series",signals:{fieldNames:Oi("delta change before after variance"),minimumFieldMatches:1}}],Li=Symbol.for("semiotic.intentRegistry");function Hi(){const e=globalThis;return e[Li]??(e[Li]={intents:new Map(zi.map(e=>[e.id,e]))}),e[Li]}function Gi(e){return Hi().intents.get(e)}function qi(){return Array.from(Hi().intents.values())}function Ui(e){Hi().intents.set(e.id,e)}function Vi(e,t,r){const a=t[e];if(Number.isFinite(a))return a;const i=Hi().intents.get(e);if(!i?.composes?.length||r.has(e))return;r.add(e);let n=0,o=0;for(const e of i.composes){const a=i.weights?.[e]??1;Number.isFinite(a)&&a>0&&(n+=(Vi(e,t,r)??0)*a,o+=a)}return r.delete(e),o>0?n/o:void 0}function Wi(e,t){const r={...e};for(const e of t){if(Number.isFinite(r[e]))continue;const t=Vi(e,r,new Set);void 0!==t&&(r[e]=t)}return r}var Yi=new Set(zi.map(e=>e.id)),Xi=Symbol.for("semiotic.semantic-viability"),Ki=globalThis,Qi=Ki[Xi]??(Ki[Xi]=new Map),Zi={rows:{tiny:3,small:25,medium:250,large:5e3},cardinality:{low:7,medium:25},fields:{narrow:3,typical:10}},Ji=["tiny","small","medium","large","huge"];function en(e){return{rows:{...Zi.rows,...e?.rows??{}},cardinality:{...Zi.cardinality,...e?.cardinality??{}},fields:{...Zi.fields,...e?.fields??{}}}}function tn(e,t){if(!Number.isFinite(e)||0>e)return"tiny";const r=en(t?.thresholds).rows;return e>r.tiny?e>r.small?e>r.medium?e>r.large?"huge":"large":"medium":"small":"tiny"}function rn(e,t){if(!Number.isFinite(e)||0>e)return"low";const r=en(t?.thresholds).cardinality;return e>r.low?e>r.medium?"high":"medium":"low"}function an(e,t){if(!Number.isFinite(e)||0>e)return"narrow";const r=en(t?.thresholds).fields;return e>r.narrow?e>r.typical?"wide":"typical":"narrow"}function nn(e,t){return Ji.indexOf(e)-Ji.indexOf(t)}function on(e,t,r){if("number"==typeof e&&Number.isFinite(e))return e;if(void 0!==e){const t=en(r?.thresholds).rows;switch(e){case"tiny":return Math.max(1,Math.floor(t.tiny/2));case"small":return Math.floor((t.tiny+t.small)/2);case"medium":return Math.floor((t.small+t.medium)/2);case"large":return Math.floor((t.medium+t.large)/2);case"huge":return Math.floor(2*t.large)}}return t}function sn(e,t,r){if("number"==typeof e&&Number.isFinite(e))return e;if(void 0!==e){const t=en(r?.thresholds).cardinality;switch(e){case"low":return Math.max(1,Math.floor(t.low/2));case"medium":return Math.floor((t.low+t.medium)/2);case"high":return Math.floor(2*t.medium)}}return t}function cn(e,t){const r=e.rowCount??0,a=t?.rows,i=on(a,r,t),n=tn(i,t),o=Object.keys(e.fields??{}).length,s=t?.fields,c="number"==typeof s?s:"string"==typeof s?function(e,t){const r=en(t?.thresholds).fields;switch(e){case"narrow":return Math.max(1,Math.floor(r.narrow/2));case"typical":return Math.floor((r.narrow+r.typical)/2);case"wide":return Math.floor(2*r.typical)}}(s,t):o,l=an(c,t),u=e.primary.category,d=sn((u?t?.cardinality?.[u]:void 0)??t?.typicalCardinality,e.categoryCount,t);return{rows:i,rowBand:n,fields:c,fieldBand:l,typicalCardinality:d,cardinalityBand:void 0!==d?rn(d,t):void 0,growth:t?.growth??"static",rowsSource:void 0!==a?"declared":"measured"}}var ln=2.5;function un(e,t,r,a,i){const n=[],o=[];let s=0,c=!1;if(e.scaleFit){const i=e.scaleFit(t,r,a);if(i&&(s+=Math.max(-2.5,Math.min(ln,i.delta??0)),i.reason&&n.push(i.reason),i.caveats))for(const e of i.caveats)o.push(e)}const l=a?.charts?.[e.component];if(l&&(l.minBand&&0>nn(r.rowBand,l.minBand)||l.maxBand&&nn(r.rowBand,l.maxBand)>0?c=!0:"number"==typeof l.bias?(s+=Math.max(-3,Math.min(3,l.bias)),l.reason&&n.push(`${a?.name?a.name+": ":""}${l.reason}`)):l.reason&&n.push(`${a?.name?a.name+": ":""}${l.reason}`)),i&&e.qualityFit){const r=e.qualityFit(t,i);if(r&&(s+=Math.max(-1,Math.min(1,r.delta??0)),r.reason&&n.push(r.reason),r.caveats))for(const e of r.caveats)o.push(e)}else if(i){const e=t.primary.y;if(e){const t=function(e,t){if(void 0===e)return;if("number"==typeof e)return e;const r=e[t];return"number"==typeof r?r:void 0}(i.completeness,e);void 0!==t&&.85>t&&o.push(`${e} is only ${Math.round(100*t)}% complete — expect gaps`)}}return{delta:s,reasons:n,caveats:o,excluded:c}}function dn(e){return(t,r)=>{let a=0;const i=[];let n;if(e.rows){const[t,o]=e.rows.sweetSpot;t>r.rows||r.rows>o?t>r.rows?(a-=Math.min(ln,.8*(0===t?1:(t-r.rows)/t)),void 0===e.rows.caveatBelow||r.rows>e.rows.caveatBelow||i.push(`only ${r.rows} rows — chart may feel sparse`)):(a-=Math.min(ln,.4*(0===o?1:(r.rows-o)/o)),void 0===e.rows.caveatAbove||e.rows.caveatAbove>r.rows||i.push(r.rows+" rows is past this chart's comfortable density")):(a+=.6,n=r.rows+" rows is in the sweet spot for this chart")}if(e.cardinality&&void 0!==r.typicalCardinality){const t=r.typicalCardinality,[n,o]=e.cardinality.sweetSpot;n>t||t>o?t>o&&(a-=Math.min(ln,.5*(0===o?1:(t-o)/o)),void 0===e.cardinality.caveatAbove||e.cardinality.caveatAbove>t||i.push(t+" distinct categories may overwhelm this chart")):a+=.4}return 0!==a||0!==i.length||n?{delta:a,reason:n,caveats:i}:null}}var mn={component:"LineChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:5,accuracy:4,precision:4},numericContracts:e.LineChart,fits:e=>{if(2>e.rowCount)return"needs at least 2 rows";if(!e.primary.x)return"needs a numeric or time x field";if(!e.primary.y)return"needs a numeric y field";const t=e.candidates.x.find(t=>t.field===e.primary.x)?.kind;return t&&"numeric"!==t&&"date"!==t?`x field "${e.primary.x}" is ${t}, LineChart needs numeric or time`:"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — given x looks like a scatter pattern, not a sequence"},intentScores:{trend:e=>"scatter"!==e.xProvenance||e.monotonicX?!e.uniqueXCount||4>e.uniqueXCount?3:!e.seriesCount||2>e.seriesCount?4:5:1,"compare-series":e=>"scatter"!==e.xProvenance||e.monotonicX?!e.seriesCount||2>e.seriesCount?1:e.seriesCount>8?2:4:1,"change-detection":e=>"scatter"!==e.xProvenance||e.monotonicX?4:1,"outlier-detection":2,correlation:2},caveats:e=>{const t=[];return!e.hasRepeatedX||e.seriesCount&&e.seriesCount>=2||t.push("x values repeat — consider aggregating or adding a series field"),e.seriesCount&&e.seriesCount>8&&t.push(e.seriesCount+" series may produce a spaghetti chart"),t},variants:[{key:"linear",label:"Linear trend",props:{curve:"linear",showPoints:!1},tags:["linear"]},{key:"smooth",label:"Smooth trend",description:"Monotone smoothing — emphasizes the shape over individual points.",props:{curve:"monotoneX",showPoints:!1},tags:["smooth","narrative"],intentDeltas:{trend:1,"outlier-detection":-2},rubricDeltas:{precision:-1},caveats:["smoothing hides individual outliers"]},{key:"stepped-with-points",label:"Discrete steps",description:"Step curve plus visible points — for state changes or discrete events.",props:{curve:"step",showPoints:!0,pointRadius:3},tags:["step","discrete"],intentDeltas:{"change-detection":1,trend:-1},rubricDeltas:{precision:1}},{key:"annotated-threshold",label:"With alert threshold",description:'A reference threshold or band turns the chart from a report into an alert — read it for breaches of the expected range. Pair with a provenanced annotation (e.g. from the data-quality bridge) and the chart\'s communicative act becomes "alerting".',props:{showGrid:!0,showPoints:!0},tags:["alert","annotated-threshold","monitoring"],intentDeltas:{"outlier-detection":2,"change-detection":1}}],buildProps:(e,t)=>{const r={data:e.data,xAccessor:e.primary.x,yAccessor:e.primary.y};return e.seriesCount&&e.seriesCount>=2&&e.primary.series&&(r.lineBy=e.primary.series,r.colorBy=e.primary.series),e.hasTimeAxis&&e.primary.x===e.primary.time&&(r.xScaleType="time"),{...r,...t?.props??{}}},scaleFit:dn({rows:{sweetSpot:[25,2e3],caveatBelow:4,caveatAbove:1e4}})},pn={component:"AreaChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:4,accuracy:3,precision:3},numericContracts:e.AreaChart,fits:e=>3>e.rowCount?"needs at least 3 rows":e.primary.x?e.primary.y?"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — given x looks like a scatter pattern, not a sequence":"needs a numeric y field":"needs a numeric or time x field",intentScores:{trend:e=>"scatter"!==e.xProvenance||e.monotonicX?e.seriesCount&&e.seriesCount>=2||!e.uniqueXCount||4>e.uniqueXCount?3:5:1,"change-detection":e=>"scatter"!==e.xProvenance||e.monotonicX?3:1},caveats:e=>{const t=[];return e.seriesCount&&e.seriesCount>=2&&e.primary.series&&t.push(`showing only the leading "${e.primary.series}" series — for multi-series comparison use LineChart or DifferenceChart`),t},variants:[{key:"smooth",label:"Smooth gradient",props:{curve:"monotoneX"},tags:["smooth","gradient","narrative"]},{key:"linear",label:"Linear",props:{curve:"linear",gradientFill:!1,areaOpacity:.5},tags:["linear"]},{key:"stepped",label:"Stepped",props:{curve:"stepAfter"},tags:["step"],intentDeltas:{"change-detection":1}},{key:"annotated-threshold",label:"With alert threshold",description:'A reference threshold or expected band turns the area into an alert — read for breaches. Pair with a provenanced annotation (e.g. from the data-quality bridge) and the communicative act becomes "alerting".',props:{showGrid:!0},tags:["alert","annotated-threshold","monitoring"],intentDeltas:{"outlier-detection":2,"change-detection":1}}],buildProps:(e,t)=>{let r=e.data;if(e.seriesCount&&e.seriesCount>=2&&e.primary.series){const t=e.primary.series,a=e.primary.y,i=new Map;for(const r of e.data){const e=r[t];if(null==e||""===e)continue;const n=Number(r[a]);i.set(e,(i.get(e)??0)+(Number.isFinite(n)?n:0))}let n,o=-1/0;for(const[e,t]of i)t>o&&(o=t,n=e);null!=n&&i.size>0&&(r=e.data.filter(e=>e[t]===n))}const a={data:r,xAccessor:e.primary.x,yAccessor:e.primary.y,gradientFill:{stops:[{offset:0,opacity:.8},{offset:1,opacity:.05}]},areaOpacity:.55};return e.hasTimeAxis&&e.primary.x===e.primary.time&&(a.xScaleType="time"),{...a,...t?.props??{}}},scaleFit:dn({rows:{sweetSpot:[6,200],caveatAbove:2e3}})},hn={component:"BumpChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:e.BumpChart,fits:e=>{if(4>e.rowCount)return"needs at least 4 rows";if(!e.primary.series||2>(e.seriesCount??0))return"needs a series field with at least 2 series to rank against each other";if(!e.primary.y)return"needs a numeric value to rank by";const t=!(!e.primary.x&&!e.primary.time);if(!t&&!e.primary.category)return"needs an ordered x (time or sequence) or a categorical ranking column";const r=t?e.uniqueXCount??0:e.categoryCount??0;if(2>r)return"needs at least 2 ranking columns to show rank movement";const a=function(e){const t=e.primary.x||e.primary.time?e.primary.x??e.primary.time:e.primary.category,r=e.primary.series,a=e.primary.y;if(!t||!r||!a)return;const i=new Map;for(const n of e.data){const e=n[t],o=n[r];if(null==e||null==o||!Number.isFinite(Number(n[a])))continue;const s=st(e),c=i.get(s)??new Set;c.add(o+""),i.set(s,c)}const n=Array.from(i.values(),e=>e.size);if(0===n.length)return;n.sort((e,t)=>e-t);const o=Math.floor(n.length/2);return{columns:n.length,min:n[0],median:n.length%2==0?(n[o-1]+n[o])/2:n[o],max:n[n.length-1],contestedColumns:n.filter(e=>e>=2).length}}(e);return!a||2>a.median||2>a.contestedColumns?`needs series that compete within the same x column; ${a?.columns??r} columns hold a median of ${a?.median??0} series, ${1===a?.max?"so every trajectory would sit at rank 1":"so rank movement would be poorly supported"}`:null},intentScores:{rank:e=>{if(!e.seriesCount||2>e.seriesCount)return 1;const t=!(!e.primary.x&&!e.primary.time);return 2>(t?e.uniqueXCount??0:e.categoryCount??0)?2:e.seriesCount>12?3:t?5:4},"compare-series":e=>e.seriesCount&&e.seriesCount>=2?2:1,"change-detection":e=>(e.primary.x||e.primary.time)&&e.seriesCount&&e.seriesCount>=2?3:1,trend:e=>e.primary.time||e.primary.x&&("scatter"!==e.xProvenance||e.monotonicX)?2:0},semanticViability:{kind:"rank-competition"},caveats:(e,t)=>{const r=[];return e.seriesCount&&e.seriesCount>12&&r.push(e.seriesCount+" series will cross into a hard-to-follow tangle — use highlightTop to foreground the leaders"),!0!==t?.props.ribbon&&r.push("rank position hides absolute magnitude — use ribbon to also encode value, or pair with a value chart"),r},variants:[{key:"ribbon",label:"Magnitude ribbons",description:"Encodes the ranked value as ribbon width, so the chart shows both order and magnitude instead of order alone.",props:{ribbon:!0},tags:["ribbon","magnitude"],rubricDeltas:{precision:1}}],buildProps:(e,t)=>{const r={data:e.data,xAccessor:e.primary.x??e.primary.time??e.primary.category,yAccessor:e.primary.y,lineBy:e.primary.series};return e.seriesCount&&e.seriesCount>6&&(r.highlightTop=5),{...r,...t?.props??{}}},scaleFit:dn({rows:{sweetSpot:[8,200],caveatBelow:4,caveatAbove:1500}})},fn={component:"StackedAreaChart",family:"time-series",importPath:"semiotic/xy",numericContracts:e.StackedAreaChart,rubric:{familiarity:4,accuracy:3,precision:3},fits:e=>4>e.rowCount?"needs at least 4 rows":e.primary.x?e.primary.y?!e.seriesCount||2>e.seriesCount?"needs 2+ stack groups (series field)":e.seriesCount>10?e.seriesCount+" series is too many to stack legibly":"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — stacking only makes sense across a sequence":"needs a numeric y field":"needs an ordered x field",intentScores:{"composition-over-time":5,"part-to-whole":e=>e.hasTimeAxis?4:3,trend:3,"compare-series":2},caveats:()=>["readability of individual layers degrades below the baseline"],variants:[{key:"baseline-zero",label:"Zero baseline",props:{baseline:"zero",stackOrder:"key"},tags:["zero-baseline"]},{key:"streamgraph",label:"Streamgraph",description:"Wiggle baseline + inside-out ordering — emphasizes momentum over precise totals.",props:{baseline:"wiggle",stackOrder:"insideOut",showLine:!1},tags:["streamgraph","narrative"],intentDeltas:{"composition-over-time":0,trend:1,"part-to-whole":-2},rubricDeltas:{accuracy:-1,precision:-1},caveats:["streamgraph hides absolute totals; precise reads not possible"]},{key:"centered",label:"Centered baseline",props:{baseline:"silhouette",stackOrder:"insideOut"},tags:["silhouette"],intentDeltas:{"part-to-whole":-1}}],buildProps:(e,t)=>{const r={data:e.data,xAccessor:e.primary.x,yAccessor:e.primary.y,areaBy:e.primary.series,colorBy:e.primary.series};return e.hasTimeAxis&&e.primary.x===e.primary.time&&(r.xScaleType="time"),{...r,...t?.props??{}}},scaleFit:dn({rows:{sweetSpot:[30,1500],caveatBelow:12,caveatAbove:1e4}})},gn={component:"Scatterplot",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:4,accuracy:5,precision:5},numericContracts:e.Scatterplot,fits:e=>{if(3>e.rowCount)return"needs at least 3 rows";if(!e.primary.x)return"needs a numeric x field";if(!e.primary.y)return"needs a numeric y field";const t=e.candidates.x.find(t=>t.field===e.primary.x)?.kind;return"date"===t?null:t&&"numeric"!==t?`x field "${e.primary.x}" is ${t}, Scatterplot needs numeric`:null},intentScores:{correlation:e=>{const t="time"===e.xProvenance||"named"===e.xProvenance?e.primary.x:e.primary.time,r=t?e.candidates.y.filter(e=>e.field!==t).map(e=>e.field):[];return t&&r.length>=2||e.primary.size?4:5},"outlier-detection":5,distribution:3,"compare-series":e=>!e.seriesCount||2>e.seriesCount||e.seriesCount>6?1:3,rank:1},variants:[{key:"points",label:"Points only",props:{},tags:["points"]},{key:"with-trend",label:"Points with regression line",props:{regression:"linear"},tags:["regression","trend"],intentDeltas:{correlation:0,trend:1}}],buildProps:(e,t)=>{const r={data:e.data},a="time"===e.xProvenance||"named"===e.xProvenance?e.primary.x:void 0,i=a?e.candidates.y.filter(e=>e.field!==a).map(e=>e.field):[];return a&&i.length>=2?(r.xAccessor=i[0],r.yAccessor=i[1]):(r.xAccessor=e.primary.x,r.yAccessor=e.primary.y,e.primary.size&&(r.sizeBy=e.primary.size)),e.primary.series&&e.seriesCount&&6>=e.seriesCount&&(r.colorBy=e.primary.series),{...r,...t?.props??{}}},scaleFit:dn({rows:{sweetSpot:[50,5e3],caveatBelow:20,caveatAbove:1e4}})},yn={component:"ConnectedScatterplot",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:e.ConnectedScatterplot,fits:e=>4>e.rowCount?"needs at least 4 ordered points":e.primary.x?e.primary.y?e.monotonicX||e.hasTimeAxis?null:"needs an ordered x sequence":"needs a y field":"needs an x field",intentScores:{trend:3,correlation:e=>{const t="time"===e.xProvenance||"named"===e.xProvenance?e.primary.x:e.primary.time,r=t?e.candidates.y.filter(e=>e.field!==t).map(e=>e.field):[];return t&&r.length>=2?5:4},"change-detection":3},caveats:()=>["readers can confuse path direction without explicit start/end markers"],buildProps:e=>{const t={data:e.data},r="time"===e.xProvenance||"named"===e.xProvenance?e.primary.x:e.primary.time,a=r?e.candidates.y.filter(e=>e.field!==r).map(e=>e.field):[];return r&&a.length>=2?(t.xAccessor=a[0],t.yAccessor=a[1],t.orderAccessor=r):(t.xAccessor=e.primary.x,t.yAccessor=e.primary.y,t.orderAccessor=e.primary.time??e.primary.x),e.primary.series&&6>=(e.seriesCount??0)&&(t.colorBy=e.primary.series),t}},bn={component:"BubbleChart",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:e.BubbleChart,fits:e=>4>e.rowCount?"needs at least 4 points":e.primary.x?e.primary.y?e.primary.size?null:"needs a third numeric measure for bubble size":"needs a numeric y field":"needs a numeric x field",intentScores:{correlation:5,"compare-categories":3,"outlier-detection":4},caveats:()=>["bubble area is harder to compare than length — large dynamic ranges distort"],buildProps:e=>({data:e.data,xAccessor:e.primary.x,yAccessor:e.primary.y,sizeBy:e.primary.size,...e.primary.series&&6>=(e.seriesCount??0)?{colorBy:e.primary.series}:{}}),scaleFit:dn({rows:{sweetSpot:[10,500],caveatAbove:1500}})},vn={component:"QuadrantChart",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:e.QuadrantChart,fits:e=>4>e.rowCount?"needs at least 4 points":e.primary.x?e.primary.y?null:"needs a numeric y field":"needs a numeric x field",intentScores:{"compare-categories":2,correlation:3,"outlier-detection":3},buildProps:e=>{const t=e.primary.x,r=e.primary.y,a=e.fields[t],i=e.fields[r],n="numeric"===a?.type?a.median:void 0,o="numeric"===i?.type?i.median:void 0;return{data:e.data,xAccessor:t,yAccessor:r,...void 0!==n?{xCenter:n}:{},...void 0!==o?{yCenter:o}:{},...e.primary.series&&6>=(e.seriesCount??0)?{colorBy:e.primary.series}:{},quadrants:{topLeft:{...Ke.topLeft},topRight:{...Ke.topRight},bottomLeft:{...Ke.bottomLeft},bottomRight:{...Ke.bottomRight}}}}},wn={component:"MultiAxisLineChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:3,precision:3},fits:e=>4>e.rowCount?"needs at least 4 rows":e.primary.x?2>Object.entries(e.fields).filter(([t,r])=>"numeric"===r.type&&t!==e.primary.x).map(([e])=>e).length?"needs at least 2 numeric measures":"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — multi-axis lines need a shared sequence":"needs an x field",intentScores:{"compare-series":4,trend:3,correlation:3},caveats:()=>["dual axes can mislead — only use when measures share interpretation"],buildProps:e=>{const t=Object.entries(e.fields).filter(([t,r])=>"numeric"===r.type&&t!==e.primary.x).slice(0,2).map(([e])=>({yAccessor:e,label:e}));return{data:e.data,xAccessor:e.primary.x,series:t}}},xn={component:"MinimapChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:4,accuracy:4,precision:4},numericContracts:e.MinimapChart,fits:e=>30>e.rowCount?"minimap pays off only on long sequences (30+ rows)":e.primary.x?e.primary.y?"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — minimap previews a sequence":"needs a numeric y field":"needs an ordered x field",intentScores:{trend:4,"change-detection":4,"outlier-detection":3},buildProps:e=>({data:e.data,xAccessor:e.primary.x,yAccessor:e.primary.y,...e.hasTimeAxis&&e.primary.x===e.primary.time?{xScaleType:"time"}:{}})},An={component:"DifferenceChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:e.DifferenceChart,fits:e=>4>e.rowCount?"needs at least 4 rows":e.primary.x?e.primary.series?!e.seriesCount||2>e.seriesCount?`needs 2+ series (got ${e.seriesCount??0})`:e.primary.y?"scatter"!==e.xProvenance||e.monotonicX?null:"needs an ordered/temporal x — given x looks like a scatter pattern, not a sequence":"needs a numeric y field":"needs a series field with at least two groups":"needs an x field (numeric or time)",intentScores:{"compare-series":e=>2===e.seriesCount?5:3,"change-detection":4,trend:3},caveats:e=>{const t=[];return e.seriesCount&&e.seriesCount>2&&t.push(`showing the top 2 of ${e.seriesCount} series — for full multi-series comparison use LineChart`),t},buildProps:e=>{const t=e.primary.x,r=e.primary.y,a=e.primary.series,i=e=>null!=e&&(e+"").length>0,n=new Map;for(const t of e.data){const e=t[a];if(!i(e))continue;const o=e+"",s=Number(t[r]);n.set(o,(n.get(o)??0)+(Number.isFinite(s)?s:0))}const o=[...n.entries()].sort((e,t)=>t[1]-e[1]),s=o[0]?.[0],c=o[1]?.[0],l=e=>e instanceof Date?e.getTime():e,u=new Map;for(const n of e.data){const e=n[a];if(!i(e))continue;const o=e+"";if(o!==s&&o!==c)continue;const d=n[t],m=n[r],p=l(d);let h=u.get(p);h||(h={[t]:d},u.set(p,h)),o===s?h.a=m:o===c&&(h.b=m)}return{data:Array.from(u.values()).filter(e=>null!=e.a&&null!=e.b),xAccessor:t,seriesAAccessor:"a",seriesBAccessor:"b",seriesALabel:s,seriesBLabel:c}}},Cn={component:"CandlestickChart",family:"time-series",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:e.CandlestickChart,fits:e=>{if(4>e.rowCount)return"needs at least 4 rows";if(!e.primary.x)return"needs an x field (typically date)";const t=new Set(Object.keys(e.fields).map(e=>e.toLowerCase())),r=t.has("high"),a=t.has("low");return r&&a?null:"needs at minimum high/low fields (open/close optional)"},intentScores:{"change-detection":4,trend:3,"outlier-detection":3},buildProps:e=>{const t=Object.keys(e.fields),r=e=>t.find(t=>t.toLowerCase()===e);return{data:e.data,xAccessor:e.primary.x,highAccessor:r("high"),lowAccessor:r("low"),openAccessor:r("open"),closeAccessor:r("close")}}},kn={component:"Heatmap",family:"relationship",importPath:"semiotic/xy",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:e.Heatmap,fits:e=>{if(4>e.rowCount)return"needs at least 4 cells";if(!e.primary.y)return"needs a numeric value to encode in cell color";const t=e.candidates.category.length;return t>=2||t>=1&&e.hasTimeAxis?(e.uniqueXCount??0)>50?"too many x cells for a legible heatmap":null:"needs two categorical-or-time dimensions for the axes"},intentScores:{correlation:3,distribution:2,"compare-categories":e=>2>e.candidates.category.length?1:4,"composition-over-time":e=>e.hasTimeAxis&&e.candidates.category.length>=1?4:1},caveats:e=>{const t=[];return(e.uniqueXCount??0)>30&&t.push("many x values — cells will be narrow"),t},variants:[{key:"default",label:"Sequential color",props:{},tags:["sequential"]},{key:"show-values",label:"With cell labels",props:{showValues:!0},tags:["labeled"],intentDeltas:{"compare-categories":1},rubricDeltas:{precision:1},caveats:["cell labels crowd dense matrices"]}],buildProps:(e,t)=>{const r=e.candidates.category.map(e=>e.field),a=e.primary.time??r[0],i=r.find(e=>e!==a)??r[0]??e.primary.series;return{data:e.data,xAccessor:a,yAccessor:i,valueAccessor:e.primary.y,...t?.props??{}}},scaleFit:dn({rows:{sweetSpot:[100,1e4],caveatBelow:25,caveatAbove:5e4}})},Sn=/(^|[^a-z])(date|time|timestamp|month|week|day|year|quarter|qtr|hour|minute)(?=[^a-z]|$)/i,Pn=/^(jan|feb|mar|apr|may|jun|jul|aug|sep|sept|oct|nov|dec|january|february|march|april|june|july|august|september|october|november|december|mon|tue|wed|thu|fri|sat|sun|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i,$n=/^(\d{4}(-\d{1,2}(-\d{1,2})?)?|q[1-4]|week\s*\d+|wk\s*\d+|\d{1,2}:\d{2})$/i,Nn={component:"BarChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:5,accuracy:5,precision:4},numericContracts:e.BarChart,fits:e=>e.primary.category?e.primary.y?1>(e.categoryCount??0)?"needs at least 1 category":(e.categoryCount??0)>50?"too many categories — consider aggregating or use a different chart":null:"needs a numeric value field":"needs a category field",intentScores:{"compare-categories":e=>e.categoryCount?2>e.candidates.category.length?10>e.rowCount/e.categoryCount?5:2:3:0,rank:5,"part-to-whole":e=>(e.categoryCount??0)>8?2:3,distribution:1},caveats:e=>{const t=[];return function(e){const t=e.primary.category;if(!t)return!1;const r=t.replace(/([a-z])([A-Z])/g,"$1 $2");if(Sn.test(r))return!0;const a=e.data;if(!a||0===a.length)return!1;let i=0,n=0;for(const e of a){const r=e[t];if(null==r)continue;n++;const a=(r+"").trim();(Pn.test(a)||$n.test(a))&&i++}return n>0&&i/n>=.6}(e)&&t.push("category axis looks like time bins — for a time series, supply real dates and use LineChart/AreaChart (reads trend, scales the time axis); for streaming counts use a temporal histogram"),t},variants:[{key:"sorted-desc",label:"Ranked",props:{sort:"desc"},tags:["sorted","ranked"],intentDeltas:{rank:0,"compare-categories":0}},{key:"source-order",label:"Source order",props:{sort:!1},tags:["source-order"],intentDeltas:{rank:-2}},{key:"horizontal",label:"Horizontal bars",props:{orientation:"horizontal",sort:"desc"},tags:["horizontal","ranked"],intentDeltas:{rank:1},rubricDeltas:{precision:1}},{key:"annotated-threshold",label:"With alert threshold",description:'A target/threshold reference turns the bars into an alert — read for which categories breach. Pair with a provenanced annotation (e.g. from the data-quality bridge) and the communicative act becomes "alerting".',props:{showGrid:!0},tags:["alert","annotated-threshold","monitoring"],intentDeltas:{"outlier-detection":2}}],buildProps:(e,t)=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,...t?.props??{}}),scaleFit:dn({cardinality:{sweetSpot:[3,15],caveatAbove:25},rows:{sweetSpot:[3,200]}})},Mn={component:"GroupedBarChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:5,precision:4},numericContracts:e.GroupedBarChart,fits:e=>e.primary.category?e.primary.y?e.primary.series?2>(e.seriesCount??0)?"needs 2+ groups":(e.seriesCount??0)>6?e.seriesCount+" groups is too many for grouped bars":(e.categoryCount??0)>25?"too many categories for grouped bars":null:"needs a series field to group by":"needs a numeric value field":"needs a category field",intentScores:{"compare-categories":5,"compare-series":4,rank:3},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,groupBy:e.primary.series,colorBy:e.primary.series})},Tn={component:"StackedBarChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:4,precision:3},numericContracts:e.StackedBarChart,fits:e=>e.primary.category?e.primary.y?e.primary.series?2>(e.seriesCount??0)?"needs 2+ stack groups":(e.seriesCount??0)>8?e.seriesCount+" stacked groups is too many":null:"needs a series field to stack by":"needs a numeric value field":"needs a category field",intentScores:{"part-to-whole":4,"compare-categories":4,"composition-over-time":e=>e.hasTimeAxis?3:1,"compare-series":2},caveats:()=>["only the bottom segment shares a baseline; others are harder to compare across categories"],variants:[{key:"absolute",label:"Absolute stacks",props:{normalize:!1},tags:["absolute"]},{key:"normalized",label:"100% stacked",description:"Each bar normalized to 1 — emphasizes composition, hides totals.",props:{normalize:!0},tags:["normalized","part-to-whole"],intentDeltas:{"part-to-whole":1,"compare-categories":-1},caveats:["absolute magnitudes are no longer comparable across bars"]}],buildProps:(e,t)=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,stackBy:e.primary.series,colorBy:e.primary.series,...t?.props??{}})},In={component:"DotPlot",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:5,precision:5},numericContracts:e.DotPlot,fits:e=>e.primary.category?e.primary.y?(e.categoryCount??0)>30?"too many categories for a dot plot":null:"needs a numeric value field":"needs a category field",intentScores:{"compare-categories":e=>e.categoryCount?10>e.rowCount/e.categoryCount?5:3:0,rank:5,"outlier-detection":3},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y}),scaleFit:dn({cardinality:{sweetSpot:[10,30],caveatAbove:40},rows:{sweetSpot:[5,300]}})},Rn={component:"PieChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:5,accuracy:3,precision:2},numericContracts:e.PieChart,fits:e=>{if(!e.primary.category)return"needs a category field";if(!e.primary.y)return"needs a numeric value field";const t=e.categoryCount??0;return 2>t?"needs 2+ categories":t>8?t+" slices is too many for a pie chart":null},intentScores:{"part-to-whole":4,"compare-categories":2,rank:1},caveats:()=>["angle comparisons are less accurate than length — prefer a bar chart unless part-to-whole is the explicit message"],variants:[{key:"pie",label:"Pie",props:{},tags:["pie"]}],buildProps:(e,t)=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,...t?.props??{}}),scaleFit:dn({cardinality:{sweetSpot:[2,5],caveatAbove:6}})},Dn={component:"DonutChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:3,precision:2},numericContracts:e.DonutChart,fits:e=>{if(!e.primary.category)return"needs a category field";if(!e.primary.y)return"needs a numeric value field";const t=e.categoryCount??0;return 2>t?"needs 2+ categories":t>8?t+" slices is too many for a donut":null},intentScores:{"part-to-whole":4,"compare-categories":2},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,innerRadius:40})},En=/(stage|step|funnel|status|outcome|phase)/i,_n={component:"FunnelChart",family:"flow",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:3,precision:3},numericContracts:e.FunnelChart,fits:e=>e.primary.y?Object.keys(e.fields).find(e=>En.test(e))?null:"needs a stage/step/funnel-named field":"needs a numeric value field",intentScores:{flow:4,rank:3,"part-to-whole":2},caveats:()=>["readers infer conversion drop-off — make sure rows actually represent sequential stages"],buildProps:e=>{const t=Object.keys(e.fields).find(e=>En.test(e));return{data:e.data,stepAccessor:t,valueAccessor:e.primary.y,...e.primary.category&&e.primary.category!==t?{categoryAccessor:e.primary.category}:{}}}},Fn={component:"GaugeChart",family:"categorical",importPath:"semiotic/ordinal",fieldPolicy:{measureFields:e=>e.primary.y?[e.primary.y]:[]},rubric:{familiarity:4,accuracy:2,precision:2},fits:e=>e.rowCount>1?"GaugeChart shows a single value — provide a 1-row dataset or use BarChart":e.primary.y?null:"needs a numeric value",intentScores:{"compare-categories":1,rank:1,"part-to-whole":e=>1===e.rowCount?5:1},caveats:()=>["gauges only show a single value; consider a stat card or bar instead for comparison"],buildProps:e=>{const t=e.primary.y,r=e.data[0],a=r?Number(r[t]):0,i=e.fields[t],n="numeric"===i?.type?i.max:100;return{value:Number.isFinite(a)?a:0,min:0,max:n}},scaleFit:(e,t)=>"tiny"===t.rowBand?{delta:.6,reason:"designed for single-value displays"}:null},jn=/(rating|score|likert|satisfaction|nps|agree|sentiment|level)/i,Bn={component:"LikertChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:4,precision:3},fits:e=>e.primary.category?e.primary.y?Object.keys(e.fields).find(e=>jn.test(e))?null:"needs an ordinal rating/level field (rating, score, level...)":"needs a numeric rating/count field":"needs a category (question) field",intentScores:{"compare-categories":4,distribution:3,"part-to-whole":3},buildProps:e=>{const t=Object.keys(e.fields).find(e=>jn.test(e));return{data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,levelAccessor:t,levels:["Very Low","Low","Neutral","High","Very High"]}}},On={component:"SwimlaneChart",family:"categorical",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:4,precision:4},fits:e=>e.primary.category?e.primary.series?e.primary.y?2>(e.categoryCount??0)?"needs 2+ categories":null:"needs a numeric value field":"needs a sub-category (lane) field":"needs a category field",intentScores:{"compare-categories":4,"composition-over-time":e=>e.hasTimeAxis?3:1,"compare-series":3},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,subcategoryAccessor:e.primary.series,valueAccessor:e.primary.y,colorBy:e.primary.series})},zn={component:"Histogram",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:4,precision:3},numericContracts:e.Histogram,fits:e=>{if(10>e.rowCount)return"histograms need at least ~10 observations";if(!e.primary.y)return"needs a numeric field to bin";const t=e.primary.y,r=e.candidates.y.find(e=>e.field===t);return void 0!==r?.distinctCount&&6>r.distinctCount?"too few distinct numeric values; a bar chart of counts is a better fit":null},intentScores:{distribution:5,"outlier-detection":3,"compare-categories":1},variants:[{key:"count-bins",label:"Count bins",props:{bins:10,relative:!1},tags:["count"]},{key:"share-bins",label:"Share bins (relative)",props:{bins:10,relative:!0},tags:["share"],intentDeltas:{distribution:0}}],buildProps:(e,t)=>({data:e.data,valueAccessor:e.primary.y,...t?.props??{}})},Ln={component:"BoxPlot",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:4,accuracy:4,precision:3},numericContracts:e.BoxPlot,fits:e=>e.primary.y?e.primary.category?3>e.rowCount/Math.max(e.categoryCount??1,1)?"needs 3+ observations per category":null:"needs a category to split distributions":"needs a numeric field",intentScores:{distribution:5,"compare-categories":4,"outlier-detection":4},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y})},Hn={component:"SwarmPlot",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:4,precision:4},numericContracts:e.SwarmPlot,fits:e=>e.primary.y?e.primary.category?4>e.rowCount/Math.max(e.categoryCount??1,1)?"needs 4+ observations per category":e.rowCount>2e3?"too many points for a swarm — consider a violin or box":null:"needs a category":"needs a numeric field",intentScores:{distribution:4,"outlier-detection":5,"compare-categories":3},buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,...e.primary.series&&e.primary.series!==e.primary.category?{colorBy:e.primary.series}:{}})},Gn={component:"ViolinPlot",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:e.ViolinPlot,fits:e=>e.primary.y?e.primary.category?6>e.rowCount/Math.max(e.categoryCount??1,1)?"needs 6+ observations per category":null:"needs a category to split distributions":"needs a numeric field",intentScores:{distribution:5,"compare-categories":4},variants:[{key:"density",label:"Density only",props:{showIQR:!1},tags:["density"]},{key:"density-iqr",label:"Density with IQR",props:{showIQR:!0},tags:["density","iqr"],intentDeltas:{distribution:0},rubricDeltas:{precision:1}}],buildProps:(e,t)=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y,...t?.props??{}})},qn={component:"RidgelinePlot",family:"distribution",importPath:"semiotic/ordinal",rubric:{familiarity:2,accuracy:3,precision:3},numericContracts:e.RidgelinePlot,fits:e=>e.primary.y?e.primary.category?3>(e.categoryCount??0)?"needs 3+ categories to make a ridgeline meaningful":6>e.rowCount/Math.max(e.categoryCount??1,1)?"needs 6+ observations per category":null:"needs a category dimension to stack distributions":"needs a numeric field",intentScores:{distribution:4,"compare-categories":3,"composition-over-time":2},caveats:()=>["readers can confuse overlapping ridges — limit categories or use small multiples"],buildProps:e=>({data:e.data,categoryAccessor:e.primary.category,valueAccessor:e.primary.y})},Un={component:"ForceDirectedGraph",family:"network",importPath:"semiotic/network",rubric:{familiarity:3,accuracy:3,precision:3},fits:e=>e.hasNetwork&&e.network?2>e.network.nodes.length?"needs at least 2 nodes":1>e.network.edges.length?"needs at least 1 edge":null:"needs a {nodes, edges} network passed via rawInput",intentScores:{flow:3,correlation:2},caveats:e=>(e.network?.nodes.length??0)>500?["large graphs become hairballs — consider filtering or aggregating"]:[],buildProps:e=>({nodes:e.network?.nodes??[],edges:e.network?.edges??[],nodeIdAccessor:"id",sourceAccessor:"source",targetAccessor:"target"}),scaleFit:e=>{const t=e.network?.nodes.length??0;return 5>t?{delta:-.4,caveats:[`only ${t} nodes — force layout is overkill for this size`]}:t>100?t>300?{delta:-.8,caveats:[t+" nodes — expect a hairball; filter or aggregate before rendering"]}:{delta:0}:{delta:.5,reason:t+" nodes is in the readable range for force layout"}}},Vn={component:"SankeyDiagram",family:"flow",importPath:"semiotic/network",rubric:{familiarity:3,accuracy:4,precision:3},numericContracts:e.SankeyDiagram,fits:e=>e.hasNetwork&&e.network?2>e.network.edges.length?"needs 2+ weighted edges":null:"needs a {nodes, edges} network with edge weights",intentScores:{flow:5,"part-to-whole":3},buildProps:e=>({nodes:e.network?.nodes??[],edges:e.network?.edges??[],sourceAccessor:"source",targetAccessor:"target",valueAccessor:"value",nodeIdAccessor:"id"})},Wn={component:"ChordDiagram",family:"flow",importPath:"semiotic/network",rubric:{familiarity:2,accuracy:3,precision:2},numericContracts:e.ChordDiagram,fits:e=>e.hasNetwork&&e.network?3>e.network.nodes.length?"needs 3+ nodes":3>e.network.edges.length?"needs 3+ edges":null:"needs a {nodes, edges} network",intentScores:{flow:4},caveats:()=>["chord diagrams trade accuracy for symmetry; use Sankey if direction matters"],buildProps:e=>({nodes:e.network?.nodes??[],edges:e.network?.edges??[],valueAccessor:"value"})},Yn={component:"ProcessSankey",family:"flow",importPath:"semiotic/network",rubric:{familiarity:2,accuracy:4,precision:3},fits:e=>{if(!e.hasNetwork||!e.network)return"needs a {nodes, edges} network";const t=e.network.edges[0];return t?void 0===t.startTime&&void 0===t.start||void 0===t.endTime&&void 0===t.end?"edges need both startTime and endTime (or start/end) for a temporal sankey":null:"needs at least one edge with start/end times"},intentScores:{flow:5,"composition-over-time":4,"change-detection":3},buildProps:e=>{const t=e.network?.edges??[],r={nodes:e.network?.nodes??[],edges:t,pairing:"temporal",laneOrder:"crossing-min"},a=t[0],i=a&&void 0===a.startTime&&void 0!==a.start?"start":"startTime",n=a&&void 0===a.endTime&&void 0!==a.end?"end":"endTime";a&&("start"===i&&(r.startTimeAccessor="start"),"end"===n&&(r.endTimeAccessor="end"));let o=1/0,s=-1/0;for(const e of t){const t=e?.[i],r=e?.[n],a=t instanceof Date?t.getTime():"number"==typeof t?t:null!=t?new Date(t).getTime():NaN,c=r instanceof Date?r.getTime():"number"==typeof r?r:null!=r?new Date(r).getTime():NaN;Number.isFinite(a)&&(o=Math.min(o,a),s=Math.max(s,a)),Number.isFinite(c)&&(o=Math.min(o,c),s=Math.max(s,c))}return Number.isFinite(o)&&Number.isFinite(s)&&s>=o&&(r.domain=[o,s===o?o+1:s]),r}},Xn={component:"TreeDiagram",family:"hierarchy",importPath:"semiotic/network",rubric:{familiarity:4,accuracy:4,precision:3},fits:e=>e.hasHierarchy&&e.hierarchy?null:"needs a hierarchical root (object with children) via rawInput",intentScores:{hierarchy:5},variants:[{key:"vertical-tree",label:"Vertical tree",props:{layout:"tree",orientation:"vertical"},tags:["vertical"]},{key:"horizontal-cluster",label:"Horizontal cluster",props:{layout:"cluster",orientation:"horizontal"},tags:["horizontal"]}],buildProps:(e,t)=>({data:e.hierarchy??{name:"root",children:[]},...t?.props??{}})};function Kn(e){if(!e||"object"!=typeof e)return 0;const t=e.children;return Array.isArray(t)&&t.length>0?t.reduce((e,t)=>e+Kn(t),0):1}var Qn={component:"Treemap",family:"hierarchy",importPath:"semiotic/network",rubric:{familiarity:4,accuracy:3,precision:3},fits:e=>e.hasHierarchy&&e.hierarchy?4>e.rowCount?"declared scale is too small to render a hierarchy meaningfully":null:"needs a hierarchical root with values",intentScores:{hierarchy:4,"part-to-whole":e=>e.hasHierarchy?5:4,"compare-categories":3},caveats:()=>["rectangle area comparisons are less precise than length — prefer a bar chart for ranking"],buildProps:e=>({data:e.hierarchy??{name:"root",children:[]},valueAccessor:"value"}),scaleFit:(e,t)=>{const r=Kn(e.hierarchy);let a=0;const i=[];let n;return 5>r?(a-=.5,i.push(`only ${r} leaves — treemap needs more cells to show structure`)):r>100?r>500&&(a-=.7,i.push(r+" leaves — most tiles will be sub-pixel; prefer aggregation or zoomable treatment")):(a+=.4,n=r+" leaves is in the legible band for treemap"),"huge"===t.rowBand&&(a-=.5,i.push("at huge declared scale a stacked or matrix view aggregates better than hierarchical browsing")),{delta:a,reason:n,caveats:i}}},Zn={component:"CirclePack",family:"hierarchy",importPath:"semiotic/network",rubric:{familiarity:3,accuracy:3,precision:2},fits:e=>e.hasHierarchy&&e.hierarchy?null:"needs a hierarchical root with values",intentScores:{hierarchy:4,"part-to-whole":3},caveats:()=>["circle area is harder to compare than rectangle area"],buildProps:e=>({data:e.hierarchy??{name:"root",children:[]},valueAccessor:"value"})},Jn={component:"OrbitDiagram",family:"hierarchy",importPath:"semiotic/network",rubric:{familiarity:1,accuracy:2,precision:2},fits:e=>e.hasHierarchy&&e.hierarchy?null:"needs a hierarchical root",intentScores:{hierarchy:3},caveats:()=>["decorative — readers without context will not infer hierarchy easily"],buildProps:e=>({data:e.hierarchy??{name:"root",children:[]},orbitMode:"solar"})},eo={component:"ChoroplethMap",family:"geo",importPath:"semiotic/geo",rubric:{familiarity:4,accuracy:3,precision:2},fits:e=>e.hasGeo&&e.geo?2>e.geo.features.length?"needs at least 2 area features to compare":null:"needs a GeoJSON FeatureCollection via rawInput",intentScores:{geo:5,"compare-categories":3},caveats:()=>["large areas dominate visual weight regardless of measurement"],buildProps:e=>({areas:e.geo?.features??[],valueAccessor:e.primary.y??"value"})},to={component:"ProportionalSymbolMap",family:"geo",importPath:"semiotic/geo",numericContracts:e.ProportionalSymbolMap,rubric:{familiarity:3,accuracy:3,precision:3},fits:e=>e.hasGeo&&e.geo?(e.geo.points?.length??0)>0||0!==(e.geo.features.length??0)?null:"needs points or area features":"needs a GeoJSON FeatureCollection (with points or area centroids)",intentScores:{geo:4,rank:3,"compare-categories":3},buildProps:e=>({points:e.geo?.points??[],areas:e.geo?.features??void 0,xAccessor:"lon",yAccessor:"lat",sizeBy:e.primary.size??"value"})},ro={component:"FlowMap",family:"geo",importPath:"semiotic/geo",rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>e.hasGeo&&e.geo?e.geo.flows?.length?e.geo.points?.length?null:"needs point nodes with lat/lon":"needs flow records (source/target/value)":"needs a geo dataset",intentScores:{geo:4,flow:5},buildProps:e=>({flows:e.geo?.flows??[],nodes:e.geo?.points??[],valueAccessor:"value"})},ao={component:"DistanceCartogram",family:"geo",importPath:"semiotic/geo",rubric:{familiarity:1,accuracy:3,precision:3},fits:e=>e.hasGeo&&e.geo?e.geo.points?.length?null:"needs point nodes with lat/lon and a cost field":"needs a geo dataset",intentScores:{geo:3,rank:3,"compare-categories":2},caveats:()=>["non-standard projection — requires explanation for most readers"],buildProps:e=>({points:e.geo?.points??[],costAccessor:"cost"})},io={componentKind:"chart-hoc",commonChartProps:"supported",headingProp:"title",modeValues:["primary","context","sparkline","mobile"]},no={...io,modeValues:["primary","context","sparkline","mobile","sample","mechanical"]},oo={...io,modeValues:["snapshot","replay","mechanical"]},so={componentKind:"value-component",commonChartProps:"component-specific",headingProp:"label",modeValues:[]};function co(e){return"value"===e?so:io}function lo(e){return Number.isFinite("number"==typeof e?e:Number(e))}function uo(e){return["value","throughput","traffic","rate","volume","count"].find(t=>e.some(e=>{const r=Number(e?.[t]);return Number.isFinite(r)&&r>0}))??"value"}function mo(e,t){return e.data.some(e=>e&&"object"==typeof e&&t in e)}var po=[mn,pn,hn,fn,gn,yn,bn,vn,wn,xn,An,Cn,kn,Nn,Mn,Tn,In,Rn,Dn,_n,Fn,Bn,On,zn,Ln,Hn,Gn,qn,Un,Vn,Wn,Yn,Xn,Qn,Zn,Jn,eo,to,ro,ao,{component:"GaltonBoardChart",family:"distribution",importPath:"semiotic/physics",rubric:{familiarity:3,accuracy:3,precision:2},suggestionPropContract:no,fits:e=>20>e.rowCount?"Galton boards need enough observations for a distribution to form":e.primary.y?null:"needs a numeric field to drop into bins",intentScores:{distribution:4,"outlier-detection":1},variants:[{key:"observed",label:"Observed samples",description:"Drop the supplied rows through the board and read the settled bins.",props:{simulationMode:"sample"},tags:["observed"]},{key:"mechanical",label:"Mechanical demonstration",description:"Seeded Bernoulli draws with no input data — explains where a bell curve comes from rather than reporting one.",props:{simulationMode:"mechanical"},tags:["explainer","no-data"],intentDeltas:{distribution:-2,"outlier-detection":-1},rubricDeltas:{accuracy:-2,precision:-1}}],caveats:()=>["The settled projection is the chart; motion is explanatory context and should not be used for exact value reading"],buildProps:e=>({data:e.data,valueAccessor:e.primary.y,bins:Math.max(8,Math.min(24,Math.round(Math.sqrt(e.rowCount))))})},{component:"EventDropChart",family:"realtime",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>e.primary.time??e.primary.x?3>e.rowCount?"needs multiple events to show arrival/window behavior":null:"needs an event-time field",intentScores:{"change-detection":3,trend:1,distribution:1},caveats:()=>["Use for event-time arrival stories, watermarks, and lateness; use a line or histogram for precise temporal values"],buildProps:e=>{const t=e.primary.time??e.primary.x,r=(function(e){return e.data.some(e=>e&&"object"==typeof e&&"arrivalTime"in e)}(e)?"arrivalTime":e.candidates.time.find(e=>e.field!==t)?.field)||t;return{data:e.data,timeAccessor:t,arrivalAccessor:r,windows:{size:Math.max(1,Math.ceil(e.rowCount/8))},watermark:{delay:1}}}},{component:"UnitPileChart",family:"categorical",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:3,precision:2},suggestionPropContract:no,fits:e=>e.primary.category?e.primary.y?(e.categoryCount??0)>12?"too many categories for readable physics piles":null:"needs a numeric value to unitize into bodies":"needs a categorical field for piles",intentScores:{"compare-categories":3,"part-to-whole":2,distribution:1},variants:[{key:"projected",label:"Piles with stated totals",description:"Countable units plus the exact per-category total, so accumulation is dramatized without losing precision.",props:{showProjection:!0},tags:["observed"]},{key:"units-only",label:"Units only",description:"Piles without the totals overlay — reads as texture, and the reader must count.",props:{showProjection:!1},tags:["narrative"],intentDeltas:{"compare-categories":-1,"part-to-whole":-1},rubricDeltas:{precision:-1}}],caveats:()=>["Physics piles dramatize accumulation; use bars or dots when exact rank or precise value comparison is the task"],buildProps:e=>{const t=e.primary.y,r=t?e.data.map(e=>Number(e?.[t])).filter(e=>Number.isFinite(e)):[],a=r.length?Math.max(...r):1;return{data:e.data,categoryAccessor:e.primary.category,valueAccessor:t,unitValue:Math.max(1,Math.ceil(a/40))}}},{component:"CollisionSwarmChart",family:"distribution",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:4,precision:3},fits:e=>e.primary.y??e.primary.x?8>e.rowCount?"needs enough points for collision density to matter":e.rowCount>1200?"too many points for browser collision relaxation":(e.categoryCount??0)>12?"too many group lanes for a physics swarm":null:"needs a numeric field for the swarm axis",intentScores:{distribution:3,"outlier-detection":3,"compare-categories":2},caveats:()=>["CollisionSwarmChart makes overlap and settling visible; use SwarmPlot when a static distribution is enough"],buildProps:e=>{const t=e.primary.category&&8>=(e.categoryCount??0)?e.primary.category:void 0;return{data:e.data,xAccessor:e.primary.y??e.primary.x,...t?{groupAccessor:t,colorBy:t}:{},...e.primary.size?{radiusAccessor:e.primary.size}:{}}}},{component:"PacketFlowChart",family:"flow",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:2,precision:1},fits:e=>{return e.hasNetwork&&e.network?1>e.network.edges.length?"needs at least 1 flow link":e.network.edges.length>160?"too many links for animated particle flow":(t=e.network.edges,e.network.nodes.some(e=>lo(e.x)&&lo(e.y))||t.some(e=>Array.isArray(e.path)||Array.isArray(e.points)||Array.isArray(e.route))?null:"requires authored node x/y coordinates or per-link path geometry; use SankeyDiagram for plain source-target-value data"):"needs explicit {nodes, edges} or {nodes, links} route input";var t},intentScores:{flow:4,"change-detection":1,"part-to-whole":1},caveats:()=>["PacketFlowChart is experimental: keep showStaticFlow enabled so throughput remains readable when animation is paused or reduced","Requires explicit route geometry; it does not infer physical pipe paths from a flat source-target table"],buildProps:e=>{const t=e.network?.edges??[];return{nodes:e.network?.nodes??[],links:e.network?.edges??[],nodeIdAccessor:"id",nodeXAccessor:"x",nodeYAccessor:"y",sourceAccessor:"source",targetAccessor:"target",throughputAccessor:uo(t),showStaticFlow:!0,showSensors:!0,maxParticles:160}},scaleFit:e=>{const t=e.network?.edges.length??0;return t>4?t>60?{delta:-.7,caveats:[t+" links can create occlusion and packet budget pressure; aggregate routes first"]}:{delta:.2,reason:t+" links is small enough for route-constrained packet animation"}:{delta:-.2,caveats:[`only ${t} links — a static Sankey may communicate the flow more directly`]}}},{component:"ProcessFlowChart",family:"realtime",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>3>e.rowCount?"needs multiple work items to show stage flow":mo(e,"stage")||mo(e,"status")||e.primary.category?null:"needs a categorical stage/status field",intentScores:{flow:4,"change-detection":3,"compare-categories":2,rank:1},caveats:()=>["Use for capacitated multi-body process stories (review queues, triage, merge pipelines); use a bar or Sankey for precise stage totals without motion","Motion dramatizes backlog and capacity; settled stage counts and group completion are the readable chart"],buildProps:e=>{const t=(mo(e,"stage")?"stage":mo(e,"status")&&"status")||e.primary.category||"stage",r=mo(e,"id")?"id":void 0,a=(mo(e,"featureId")?"featureId":mo(e,"group")&&"group")||e.primary.series||void 0,i=new Set;for(const r of e.data){if(!r||"object"!=typeof r)continue;const e=r[t];null!=e&&""!==e&&i.add(e+"")}const n=i.size>0?Array.from(i):["coding","review","merged"],o=n.map((t,r)=>{const a=r===n.length-1,i=r===Math.floor(n.length/2);return{id:t,label:t,force:a?20:12,capacity:i?{unitsPerSecond:Math.max(2,Math.round(e.rowCount/8))}:void 0,pressure:i||void 0,absorb:a||void 0}});return{data:e.data,...r?{idAccessor:r}:{},stageAccessor:t,...a?{groupBy:a,groupCompletion:"allAbsorbed"}:{},stages:o,showProjection:!0,showChrome:!0}}},{component:"GauntletChart",family:"realtime",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:2,precision:2},fits:e=>{if(1>e.rowCount)return"needs at least one project/plan row";const t=e.data.some(e=>e&&"object"==typeof e&&"id"in e);return e.primary.category||t?null:"needs project rows with stable ids (or a categorical identity field)"},intentScores:{flow:3,"change-detection":2,"compare-categories":1},caveats:()=>["GauntletChart is for compound entities whose attached properties transform at gates. Use ProcessFlowChart when work items do not need compound property bodies.","Read viability, property inventory, and outcomes — not body trajectories."],buildProps:e=>({data:e.data.map((e,t)=>({...e,id:e?.id??"project-"+t,positives:Array.isArray(e?.positives)?e.positives:["value"],negatives:Array.isArray(e?.negatives)?e.negatives:["cost"]})),idAccessor:"id",positiveAccessor:"positives",negativeAccessor:"negatives",positiveProperties:[{id:"value",label:"Value",short:"V",color:"#22c55e",buoyancy:2,radius:9}],negativeProperties:[{id:"cost",label:"Cost",short:"$",color:"#ef4444",load:1.1,radius:7}],gates:[{id:"review",label:"Review"},{id:"approval",label:"Approval"}],showProjection:!0,showChrome:!0})},{component:"CrucibleChart",family:"flow",importPath:"semiotic/physics",rubric:{familiarity:1,accuracy:4,precision:3},fits:()=>"requires authored phases, product molds, events, and outlets; these cannot be inferred from flat data",intentScores:{flow:4,"change-detection":3,"compare-categories":1},caveats:()=>["CrucibleChart presents an authored treatment and its accounting; collisions never discover products, affinity, failure, or causality.","Supply stable source ids plus explicit phases, products, events, and reason-labelled outlets. Use the settled projection for the exact reading.","buildCrucibleProductEvents can serialize an explicit form → contribute → complete lifecycle, but the caller must still author every member, relation, event position, and outlet."],buildProps:e=>({data:e.data})},{component:"ChainReactionChart",family:"hierarchy",importPath:"semiotic/physics",rubric:{familiarity:2,accuracy:4,precision:3},suggestionPropContract:oo,fits:()=>"requires an authored dependency graph (stable task ids plus an explicit array of prerequisite ids per task); edges cannot be inferred from flat data",intentScores:{flow:3,hierarchy:3,"change-detection":3,"outlier-detection":2},caveats:()=>["The settled projection is the chart: task state (completed / blocked / armed / waiting) plus each blocker's downstream reach. Ball motion shows prerequisites being delivered and never decides whether a task is done.","Task completion is an explicit data event, not something the simulation discovers. Supply completionTimeAccessor or statusAccessor.","Blocker amplification counts unfinished downstream tasks and affected lanes; it is a graph reachability result, not a schedule forecast."],buildProps:e=>({data:e.data})},{component:"BigNumber",family:"value",importPath:"semiotic/value",suggestionPropContract:{componentKind:"value-component",commonChartProps:"component-specific",headingProp:"label",modeValues:["tile","presentation","inline","thumbnail"]},fieldPolicy:{measureFields:e=>{const t=e.primary.y??e.primary.size??e.candidates.y[0]?.field;return t?[t]:[]}},rubric:{familiarity:5,accuracy:5,precision:5},fits:e=>e.primary.y||e.primary.size||0!==e.candidates.y.length?e.rowCount>50?"BigNumber shows a single focal value — pass scalar data, or use a chart family for >50 rows":null:"needs a numeric value to display",intentScores:{trend:e=>e.hasTimeAxis||"named"===e.xProvenance||e.monotonicX?e.rowCount>8?1:3:0,"compare-categories":1,rank:1,"part-to-whole":e=>1===e.rowCount?5:1,"change-detection":e=>e.hasTimeAxis||"named"===e.xProvenance||e.monotonicX?e.rowCount>8?1:4:0},caveats:e=>{const t=[];return e.rowCount>1&&t.push("BigNumber renders the latest row's value as the focal number; earlier rows feed an optional sparkline"),t},buildProps:e=>{const t=e.primary.y??e.primary.size??e.candidates.y[0]?.field;if(!t)return{value:0};const r=e.data,a=r.length>0?r[r.length-1]:null,i=a?Number(a[t]):0,n={value:Number.isFinite(i)?i:0,label:t};if(r.length>=2){const e=Number(r[r.length-2][t]);Number.isFinite(e)&&(n.comparison={value:e,label:"vs previous"})}return n},scaleFit:(e,t)=>"tiny"===t.rowBand?{delta:.8,reason:"single-value displays beat charts when there is one number to show"}:"small"===t.rowBand?{delta:.2,reason:"the latest value with a trend spark is often more legible than a chart at small scale"}:null}],ho=new Map;function fo(e){ho.set(e.component,e),i(e.component,e.numericContracts),Qi.set(e.component,e.semanticViability)}function go(e){ho.delete(e),o(e),function(e){Qi.delete(e)}(e)}function yo(){if(0===ho.size&&!pe())return po;const e=new Map;for(const t of po)e.set(t.component,t);for(const t of me())e.set(t.component,t);for(const[t,r]of ho)e.set(t,r);return Array.from(e.values())}function bo(e){return yo().find(t=>t.component===e)}var vo=new Set(["perceivable.content-only-visual","perceivable.color-alone","assistive.data-density","assistive.human-readable-numbers","assistive.skippable-navigation","compromising.table","compromising.navigable-structure"]),wo={"screen-reader":"a screen reader",sonified:"sonification",agent:"an AI reader"};function xo(e,t){if("visual"===t)return{delta:0,caveats:[]};let r=0;const a=[],i=[];for(const t of e.findings){if(!vo.has(t.id))continue;let e=0;"fail"===t.status?e=t.critical?1.2:.8:"warn"===t.status&&(e=.4),e>0&&(r-=e,a.push(t.heuristic.charAt(0).toLowerCase()+t.heuristic.slice(1)),i.push(t.message))}return 0===a.length?{delta:0,caveats:[]}:{delta:Math.max(-3,r),reason:`Harder to receive via ${wo[t]}: ${a.slice(0,3).join("; ")}`,caveats:i}}function Ao(e,t,r,a,i){if(!a)return{score:e,rubric:t};const n=a.familiarity?.[r],o=n??t.familiarity,s=a.targets?.[r];let c,l,u=0;void 0!==n&&(u+=.5*(n-3)),s&&(u+=1*("increase"===s.direction?1:-1)*Math.max(1,Math.min(3,s.weight??1)),c=s.reason?`${a.name?a.name+": ":""}${s.reason}`:`${a.name?a.name+" ":""}target: ${s.direction} ${r}`);const d=a.receptionModality;return i&&d&&"visual"!==d&&(u+=i.delta,l=i.reason),{score:e+u,rubric:{...t,familiarity:o},appliedReason:c,receivabilityReason:l}}function Co(e,t,r){return r?r.familiarity?.[e]??t:t}function ko(e){return e&&2===e.exposureLevel?4:3}var So=["xAccessor","yAccessor","valueAccessor","sizeAccessor","sizeBy","weightAccessor","radiusAccessor","rAccessor","amountAccessor","measureAccessor"];function Po(e,t,r,a){const i=new Set([...t.identifiers??[],...di(t.fieldRoles??{})]);if(0===i.size||!0===e.fieldPolicy?.allowIdentifierMeasures)return null;const n=new Set([...So,...e.fieldPolicy?.measureAccessorProps??[]]);for(const t of n){const a=r[t];if("string"==typeof a&&i.has(a))return`${e.component} cannot use identifier field "${a}" as the measure in "${t}".`}const o=(e.fieldPolicy?.measureFields?.(t,r,a)??[]).find(e=>i.has(e));return o?`${e.component} cannot use identifier field "${o}" as a measure.`:null}function $o(e,t){if(void 0===e)return 0;const r="function"==typeof e?e(t):e;return Number.isFinite(r)?Math.max(0,Math.min(5,r)):0}function No(e,t){if(!t?.intentDeltas)return e;const r={...e};for(const[e,a]of Object.entries(t.intentDeltas))r[e]=Math.max(0,Math.min(5,(r[e]??0)+a));return r}function Mo(e,t){return t?.rubricDeltas?function(e){const t=e=>Math.max(1,Math.min(5,Math.round(e)));return{familiarity:t(e.familiarity),accuracy:t(e.accuracy),precision:t(e.precision)}}({familiarity:e.familiarity+(t.rubricDeltas.familiarity??0),accuracy:e.accuracy+(t.rubricDeltas.accuracy??0),precision:e.precision+(t.rubricDeltas.precision??0)}):e}function To(e,t,r,a){const i=[],n=a.map(e=>({intent:e,score:r[e]??0})).filter(e=>e.score>=3).sort((e,t)=>t.score-e.score).slice(0,2);for(const{intent:e,score:t}of n)i.push(`Strong fit for ${e} (${t}/5)`);if(t.primary.x&&t.primary.y&&i.push(`x = ${t.primary.x}, y = ${t.primary.y}`),t.seriesCount&&t.seriesCount>1&&i.push(`${t.seriesCount} series detected on field "${t.primary.series??"series"}"`),"recipe"===e.candidateKind){for(const t of e.positiveRationale?.slice(0,2)??[])i.push(t);e.whyCustom?.reason&&i.push("Why leave the catalog: "+e.whyCustom.reason)}return i}function Io(e,t){if("recipe"!==e.candidateKind||!e.recipe)return{delta:0,reasons:[],caveats:[]};const r=e.recipe;if(t.portability&&r.portability!==t.portability)return{delta:0,reasons:[],caveats:[],excluded:`requires a ${t.portability} recipe`};let a=0;const i=[],n=[],o=t.audience?.name?.trim().toLowerCase();if(o){const e=r.audienceFit?.find(e=>e.audience.trim().toLowerCase()===o);e&&(a+={strong:.75,moderate:.25,weak:-.5,avoid:-2}[e.fit],i.push(e.rationale??`${e.fit} fit for ${t.audience?.name??e.audience}`))}const s=t.receptionChannel??t.audience?.receptionModality??"visual";r.reception?.channels?.includes(s)?(a+=.25,i.push(`Designed for ${s} reception`)):r.reception?.channels?.length&&(a-=1,n.push(`Recipe does not declare support for the ${s} reception channel.`));const c=r.reception?.risks??[];return"low"===t.riskTolerance&&c.length>0?(a-=Math.min(1.5,.35*c.length),n.push(...c)):"medium"===t.riskTolerance&&c.length>2&&(a-=.25),"local"===r.portability?n.push("Local-only recipe: cannot be rendered remotely by CLI or MCP."):i.push("Portable registered recipe"),{delta:a,reasons:i,caveats:n}}function Ro(e,t){if(0===t.length){const t=Object.values(e).filter(e=>"number"==typeof e&&e>0);return 0===t.length?0:t.reduce((e,t)=>e+t,0)/t.length}let r=0;for(const a of t)r+=e[a]??0;return r/t.length}function Do(e,t={}){const r=t.profile??Bi(e??[],t),a=t.capabilities??yo(),i=t.intent?Array.isArray(t.intent)?t.intent:[t.intent]:[],n=!1!==t.includeVariants,o=t.minScore??0,s=t.maxResults??10,c=t.allow?new Set(t.allow):null,l=t.deny?new Set(t.deny):null,u=t.audience?.receptionModality,d=void 0!==u&&"visual"!==u,m=cn(r,t.scale),p=void 0!==t.scale&&m.rows!==r.rowCount?{...r,rowCount:m.rows}:r,h=[];for(const e of a){if(c&&!c.has(e.component))continue;if(l&&l.has(e.component))continue;if(null!==e.fits(p))continue;const a={};for(const[t,r]of Object.entries(e.intentScores))a[t]=$o(r,p);const s=n&&e.variants&&e.variants.length>0?e.variants:[void 0];for(const n of s){const s=Wi(No(a,n),i),c=Ro(s,i),l=Mo(e.rubric,n),f=e.buildProps(r,n);if(Po(e,r,f,n))continue;const g=e.caveats?Array.from(e.caveats(p,n)):[];let y;d&&(y=xo(Fa(e.component,f),u));const b=Ao(c,l,e.component,t.audience,y),v=un(e,p,m,t.scale,t.quality);if(v.excluded)continue;const w=Io(e,t);if(w.excluded)continue;const x=b.score+v.delta+w.delta;if(o>x)continue;const A=To(e,p,s,i);b.appliedReason&&A.push(b.appliedReason),b.receivabilityReason&&A.push(b.receivabilityReason);for(const e of v.reasons)A.push(e);A.push(...w.reasons);const C=[...g,...n?.caveats??[],...v.caveats,...y?.caveats.slice(0,3)??[],...w.caveats],k={band:m.rowBand,cardinalityBand:m.cardinalityBand,rows:m.rows,rowsSource:m.rowsSource},S=n?.component??e.component;h.push({component:S,displayName:e.displayName??S,candidateKind:e.candidateKind??"built-in",...e.recipe?{recipeId:e.recipe.id}:{},family:e.family,importPath:e.importPath,variant:n,score:x,intentScores:s,rubric:b.rubric,reasons:A,caveats:C,props:f,propContract:e.suggestionPropContract??co(e.family),...e.whyCustom?{whyCustom:e.whyCustom}:{},scaleRange:k})}}h.sort((e,t)=>t.score!==e.score?t.score-e.score:t.rubric.accuracy!==e.rubric.accuracy?t.rubric.accuracy-e.rubric.accuracy:t.rubric.familiarity-e.rubric.familiarity);const f=new Set;return h.filter(e=>{const t=`${e.component}:${e.score.toFixed(4)}`;return!f.has(t)&&(f.add(t),!0)}).slice(0,s)}function Eo(e,t={}){const r=t.profile??Bi(e??[],t),a=t.capabilities??yo(),i=t.allow?new Set(t.allow):null,n=t.deny?new Set(t.deny):null,o=cn(r,t.scale),s=void 0!==t.scale&&o.rows!==r.rowCount?{...r,rowCount:o.rows}:r,c=[];for(const e of a){if(i&&!i.has(e.component))continue;if(n&&n.has(e.component))continue;const a=e.fits(s);if(null!==a){c.push({component:e.component,family:e.family,importPath:e.importPath,reason:a});continue}const o=(!1!==t.includeVariants&&e.variants?.length?e.variants:[void 0]).map(t=>{const a=e.buildProps(r,t);return Po(e,r,a,t)});o.length>0&&o.every(Boolean)&&c.push({component:e.component,family:e.family,importPath:e.importPath,reason:o[0]})}return{fitting:Do(e,{...t,profile:r}),rejected:c,profile:r}}function _o(e,t,r={}){const a=yo().find(t=>t.component===e);if(!a)return{status:"rejected",reason:`No capability registered for "${e}"`};const i=r.profile??Bi(t??[],r),n=a.fits(i);if(null!==n)return{status:"rejected",reason:n};const o=r.variantKey?a.variants?.find(e=>e.key===r.variantKey):void 0,s=r.intent?Array.isArray(r.intent)?r.intent:[r.intent]:[],c={};for(const[e,t]of Object.entries(a.intentScores))c[e]=$o(t,i);const l=Wi(No(c,o),s),u=Ro(l,s),d=Mo(a.rubric,o),m=Io(a,r);if(m.excluded)return{status:"rejected",reason:m.excluded};const p=a.buildProps(i,o),h=Po(a,i,p,o);if(h)return{status:"rejected",reason:h};const f=r.audience?.receptionModality,g=f&&"visual"!==f?xo(Fa(a.component,p),f):void 0,y=Ao(u,d,a.component,r.audience,g),b=To(a,i,l,s);y.appliedReason&&b.push(y.appliedReason),y.receivabilityReason&&b.push(y.receivabilityReason),b.push(...m.reasons);const v=[...a.caveats?a.caveats(i,o):[],...o?.caveats??[],...g?.caveats.slice(0,3)??[],...m.caveats],w=o?.component??a.component;return{status:"ok",component:w,displayName:a.displayName??w,candidateKind:a.candidateKind??"built-in",...a.recipe?{recipeId:a.recipe.id}:{},family:a.family,importPath:a.importPath,variant:o,score:y.score+m.delta,intentScores:l,rubric:y.rubric,reasons:b,caveats:v,props:p,propContract:a.suggestionPropContract??co(a.family),...a.whyCustom?{whyCustom:a.whyCustom}:{}}}function Fo(e,t={}){const r=t.profile??Bi(e??[],t),a=cn(r,t.scale),i=t.maxPerBand??t.maxResults??5,n=["tiny","small","medium","large","huge"],o={};for(const a of n){const n={...t.scale??{},rows:a};o[a]=Do(e,{...t,profile:r,scale:n,maxResults:i})}return{tiny:o.tiny??[],small:o.small??[],medium:o.medium??[],large:o.large??[],huge:o.huge??[],effective:a}}var jo=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]);function Bo(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Oo(e){return Bo(e)?e:void 0}function zo(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Lo(e){const t=zo(e);return null==t?void 0:Math.max(0,Math.floor(t))}function Ho(...e){return e.map(Oo).find(Boolean)}function Go(...e){return e.find(Array.isArray)}function qo(e){const t={};for(const[r,a]of Object.entries(e))void 0!==a&&(t[r]=a);return t}function Uo(e,t,r){return e["string"==typeof t&&t?t:r]}function Vo(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function Wo(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Yo(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function Xo(e,t,r){const a=e?.filter(e=>!0===Oo(e)?.sensor).length,i=Oo(t?.observation),n=Oo(i?.sensors),o=Go(r?.activeSensors);return Math.max(a??0,n?Object.keys(n).length:0,o?.length??0)||void 0}function Ko(e,t,r={}){const{capability:a,audience:i,locale:n}=r,o=r.levels??["l1","l2","l3"],s=!1!==r.includeStructure,c=Re(e,a),l=c?[...o,"l4"]:o,u=Q(e,t,{levels:l,locale:n,capability:a,audience:i}),{l4:d,...m}=u.levels,p=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),h={levels:m,text:u.annotations?`${u.annotations} ${p}`.trim():p,...u.annotations?{annotations:u.annotations}:{}};let f;if(c&&d){const e=(g=a)?"fits"in g||"buildProps"in g?{family:g.family}:{family:g.family,intentScores:g.intentScores}:{};f={act:c,sentence:d,family:e.family,intentScores:e.intentScores}}var g;const y=s?z(e,t,{maxLeaves:r.maxLeaves,locale:n}):void 0,b=function(e,t,r){if(!1===r)return;const a=Bo(r)?r:void 0,i=Oo(t.physics),n=Ho(a?.snapshot,i?.snapshot,t.physicsSnapshot,function(e){const t=Oo(e);return!!t&&(Bo(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),o=Ho(a?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),s=Ho(a?.config,i?.config,n?.config,t.config),c=Ho(Oo(n?.world),Oo(i?.world)),l=Ho(Oo(s?.kernel),Oo(c?.options)),u=Go(c?.bodies),d=Go(c?.colliders,s?.colliders),m=Go(n?.queue,i?.queue),p=Go(n?.liveBodyOrder),h=Go(c?.springs),f=Go(n?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const r=Oo(e);if(!r)return;const a=zo(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return;const i=(r.label??r.id??r.name??"container "+(t+1))+"",n=null==r.id?void 0:r.id+"",o=zo(r.secondary??r.secondaryCount),s=zo(r.observed??r.observedCount);return qo({id:n,label:i,count:a,secondary:o,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;const r=t.reduce((e,t)=>e+t.count,0),a=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:a,...i?{leader:i}:{}}}(function(e,t,r,a){const i=Oo(e.settledProjection),n=Oo(t?.settledProjection);return Go(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,n?.rows,a?.binCounts)}(t,i,a,o)),y=function(e,t){const r=e?.map((e,t)=>{const r=Oo(e);if(!r)return;const a=zo(r.count)??0,i=zo(r.total),n={label:(r.label??r.id??"sediment "+(t+1))+"",count:a};return null!=r.id&&(n.id=r.id+""),null!=i&&(n.total=i),n}).filter(e=>null!=e),a=Lo(t?.bins)??r?.length??0,i=zo(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,n=zo(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),o=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==a||0!==i||n)return{bins:a,count:i,...null!=n&&n>0?{total:n}:{},...o?{leader:o}:{}}}(Go(a?.sediment,i?.sediment,n?.sediment),Ho(a?.sedimentTotals,i?.sedimentTotals)),b=p?.length??u?.length??Lo(o?.bodyCount),v=function(e){if(e)return e.filter(e=>!0===Oo(e)?.sleeping).length}(u)??Lo(o?.sleepingCount),w=m?.length,x="string"==typeof n?.simulationState?n.simulationState:void 0,A="boolean"==typeof o?.settled?o.settled:x?"settled"===x:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,C=Oo(l?.gravity),k=zo(C?.x),S=zo(C?.y),P=qo({state:x,settled:A,elapsedSeconds:zo(n?.elapsedSeconds),paused:"boolean"==typeof n?.paused?n.paused:void 0,visible:"boolean"==typeof n?.visible?n.visible:void 0,seed:zo(l?.seed),gravity:null!=k&&null!=S?{x:k,y:S}:void 0,fixedDt:zo(s?.fixedDt??l?.fixedDt),timeScale:zo(s?.timeScale),maxSubsteps:Lo(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:zo(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),$=qo({colliders:d?.length,sensors:Xo(d,s,c),springs:h?.length,activeSensorPairs:f?.length}),N=Object.keys($).length>0,M=jo.has(e);if(!(Object.keys(P).length>0||N||g||y)||!M&&null==r)return;const T={simulation:P,...N?{geometry:$}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},I=function(e){const t=[],r=e.simulation,a=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${Wo(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?r.sleepingBodies+" sleeping":void 0,null!=r.queued?r.queued+" queued":void 0,null!=r.seed?"seed "+Yo(r.seed):void 0,r.gravity?`gravity (${Yo(r.gravity.x)}, ${Yo(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${Yo(r.fixedDt)}s`:void 0,null!=r.timeScale?Yo(r.timeScale)+"x time":void 0].filter(Boolean);a.length>0&&t.push(`Physics simulation: ${a.join("; ")}.`);const i=e.geometry;if(i){const e=[null!=i.colliders?`${i.colliders} ${Wo(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${Wo(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${Wo(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${Wo(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const n=e.aggregates;if(n){const e=n.leader,r=e?` Largest is ${e.label} with ${Yo(e.count)}.`:"";t.push(`Physics aggregates: ${Yo(n.totalCount)} settled ${Wo(n.totalCount,"body")} across ${n.rows.length} ${Wo(n.rows.length,"container")}; ${n.populatedCount} populated.${r}`)}const o=e.sediment;if(o){const e=null!=o.total?", value total "+Yo(o.total):"",r=o.leader?`; largest sediment bin is ${o.leader.label} with ${Yo(o.leader.count)}`:"";t.push(`Physics sediment: ${o.count} retained ${Wo(o.count,"body")} in ${o.bins} ${Wo(o.bins,"bin")}${e}${r}.`)}return t.join(" ")}(T);return{...T,text:I}}(e,t,r.physics),v=function(e,t,r){const a=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&a.push(`Current value is ${Vo(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;a.push(`The gauge scale runs from ${Vo(e)} to ${Vo(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&a.push(`The ProcessSankey time domain runs from ${Vo(t.domain[0])} to ${Vo(t.domain[1])}.`),i.length>0){a.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(const n of i.slice(0,r)){const r=Uo(n,t.sourceAccessor,"source"),i=Uo(n,t.targetAccessor,"target"),o=Uo(n,t.valueAccessor,"value");a.push("ProcessSankey"!==e||null==n.startTime&&null==n.endTime?`${Vo(r)} to ${Vo(i)} has value ${Vo(o)}.`:`${Vo(r)} to ${Vo(i)} has value ${Vo(o)} over ${Vo(n.startTime)}–${Vo(n.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=Oo(t.data),i="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",n="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",o="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],c=e=>{const t=Array.isArray(e[i])?e[i]:[];if(0!==t.length)for(const e of t){const t=Oo(e);t&&c(t)}else s.push(e)};if(e&&c(e),s.length>0){a.push(s.length+" hierarchy leaves are supplied.");for(const e of s.slice(0,r))a.push(`${Vo(e[o])} has value ${Vo(e[n])}.`)}}if(jo.has(e)&&Array.isArray(t.data)){const r=t.data;a.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);const i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,n="CollisionSwarmChart"===e?"x":"value",o=r.map(e=>zo(Uo(e,i,n))).filter(e=>null!=e);o.length>0&&a.push(`Observed ${"string"==typeof i?i:n} ranges from ${Vo(Math.min(...o))} to ${Vo(Math.max(...o))}.`)}if(0!==a.length)return{source:"chart-props",statements:a,text:"Exact chart-prop facts: "+a.join(" ")}}(e,t,Math.max(1,r.maxLeaves??200)),w=[h.text,f?.sentence,b?.text,v?.text].filter(Boolean).join(" ");return{component:e,description:h,intent:f,structure:y,physics:b,facts:v,text:w}}function Qo(e,t){return null==e?e:e.length>t?e.slice(0,t-1)+"…":e}function Zo(e){const{data:t,onQuery:r,initialAnnotations:a,componentName:i,props:n,includeProfile:o,includeSuggestions:s,suggestionsIntent:c,suggestionsMax:l,focus:u,includeGrounding:d}=e,[m,p]=ei([]),[h,f]=ei([]),[g,y]=ei(!1),[b,v]=ei(null),w=Za(()=>oi(t??[]),[t]),x=o||s,A=Za(()=>x?Bi(t??[]):void 0,[x,t]),C=Za(()=>s&&A?Do(t,{profile:A,intent:c,maxResults:l??5}):void 0,[s,A,t,c,l]),k=Za(()=>{if(d&&i)return Ko(i,{data:t??[],...n??{}},"object"==typeof d?d:void 0)},[d,i,n,t]),S=Ja(r);S.current=r;const P=Ja(i);P.current=i;const $=Ja(n);$.current=n;const N=Ja(t);N.current=t;const M=Ja(w);M.current=w;const T=Ja(A);T.current=A;const I=Ja(C);I.current=C;const R=Ja(u);R.current=u;const D=Ja(k);D.current=k;const E=Qa(async e=>{const t=e.trim();if(!t)return;y(!0),v(null),p(e=>[...e,{role:"user",text:t}]);const r="undefined"!=typeof performance?performance.now():Date.now();ue().record({type:"interrogation-asked",component:P.current,query:Qo(t,500)});try{const e=await S.current(t,{data:N.current??[],summary:M.current,profile:T.current,suggestions:I.current,componentName:P.current,props:$.current,grounding:D.current,focus:R.current??void 0});p(t=>[...t,{role:"assistant",text:e.answer}]),e.annotations&&f(e.annotations);const a="undefined"!=typeof performance?performance.now():Date.now();ue().record({type:"interrogation-answered",component:P.current,answer:Qo(e.answer,2e3),annotationCount:e.annotations?.length,latencyMs:Math.max(0,Math.round(a-r))})}catch(e){v(e instanceof Error?e:Error(e+"")),p(e=>[...e,{role:"assistant",text:"Sorry, I couldn't process that query."}]);const t="undefined"!=typeof performance?performance.now():Date.now();ue().record({type:"interrogation-answered",component:P.current,error:!0,latencyMs:Math.max(0,Math.round(t-r))})}finally{y(!1)}},[]),_=Qa(({text:e,annotations:t})=>{const r=e.trim();r&&(p(e=>[...e,{role:"assistant",text:r}]),t&&t.length>0&&f(e=>[...e,...t]))},[]),F=Qa(()=>{p([]),f([]),v(null)},[]);return{ask:E,announce:_,history:m,summary:w,annotations:Za(()=>{const e=a??[];return 0===e.length?h:0===h.length?e:[...e,...h]},[a,h]),loading:g,error:b,reset:F}}import{useMemo as Jo}from"react";var es=["hover","hover-end","click","click-end","selection","selection-end","brush-end"];function ts(e={}){const{chartId:t,types:r=es}=e,{latest:a}=Pr({chartId:t,types:r,limit:1});return Jo(()=>{if(!a)return null;if("hover-end"===a.type||"selection-end"===a.type||"brush-end"===a.type||"click-end"===a.type)return null;let e;if("selection"===a.type)e=a.selection.fields;else{if("hover"!==a.type&&"click"!==a.type)return null;e=a.datum}return e&&"object"==typeof e?{datum:e,x:a.x,y:a.y,source:a.type}:null},[a])}function rs(e){if("number"==typeof e)return e;const t=Date.parse(e);return Number.isNaN(t)?void 0:t}function as(e,t){return"pass"===e?t.passColor??"var(--semiotic-success)":"warn"===e?t.warnColor??"var(--semiotic-warning)":t.failColor??"var(--semiotic-danger)"}function is(e){if(null==e)return;const t="number"==typeof e?e:Date.parse(e);return Number.isNaN(t)?void 0:new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ns(e){const t=e.label??e.name??e.id;return"number"==typeof e.confidence&&1>e.confidence?`${t} · ${Math.round(100*e.confidence)}%`:t}function os(e){return{author:e.name??e.id,authorKind:"system",source:e.source,basis:e.basis??"rule",confidence:e.confidence,createdAt:e.createdAt,dataVersion:e.dataVersion,stableId:e.id}}function ss(e,t={}){const r=[],a=[],i=t.valueAxis??"y",n={status:t.status??"proposed",anchor:t.anchor??"semantic",...void 0!==t.ttlHint?{ttlHint:t.ttlHint}:{}};for(const o of e){if("pass"===o.status&&!t.includePassed)continue;const e=as(o.status,t),s=ns(o),c={provenance:os(o),lifecycle:n},l=e=>a.push({result:o,reason:e}),u=e=>r.push(lr(e,c));switch(o.kind){case"range":if("number"!=typeof o.min||"number"!=typeof o.max){l("range check is missing numeric min/max bounds");break}u({type:"band",y0:o.min,y1:o.max,fill:e,fillOpacity:.12,color:e,label:s});break;case"min":case"max":case"threshold":{const t=o.value??("min"===o.kind?o.min:o.max);if("number"!=typeof t){l(o.kind+" check is missing a numeric value");break}u({type:"x"===i?"x-threshold":"y-threshold",value:t,label:s,color:e});break}case"freshness":{const t=void 0!==o.at?rs(o.at):void 0;if(void 0===t){l("freshness check has no parseable timestamp (`at`); render as a chart-level status badge");break}u({type:"x-threshold",value:t,label:s,color:e});break}default:l(`${o.kind} check on "${o.column??"?"}" has no single chart coordinate; surface it as a chart-level status badge or a row-level mark in your UI`)}}return{annotations:r,unplaced:a}}function cs(e){switch(e){case"pass":return"pass";case"warn":return"warn";case"fail":return"fail";default:return"error"}}function ls(e){if(!e)return"dbt check";const t=e.split(".");return t[t.length-1]||e}function us(e,t={}){const r=[],a=e.sources;if(a?.results){const e=a.metadata?.generated_at,t=a.metadata?.invocation_id;for(const i of a.results){const a=cs(i.status),n=ls(i.unique_id),o=is(i.max_loaded_at);r.push({id:i.unique_id??n,name:"dbt freshness: "+n,label:"pass"===a?n+" fresh":`${n} stale${o?" since "+o:""}`,status:a,kind:"freshness",at:i.max_loaded_at,message:`freshness ${a}${i.max_loaded_at?" — last load "+i.max_loaded_at:""}`,source:"dbt",basis:"rule",createdAt:e,dataVersion:t})}}const i=e.runResults;if(i?.results){const e=i.metadata?.generated_at,a=i.metadata?.invocation_id;for(const n of i.results){const i=cs(n.status);if("pass"===i&&!t.includePassed)continue;const o=ls(n.unique_id);r.push({id:n.unique_id??o,name:"dbt test · "+o,status:i,kind:"custom",message:n.message??void 0,observedCount:"number"==typeof n.failures?n.failures:void 0,source:"dbt",basis:"rule",createdAt:e,dataVersion:a})}}return ss(r,t)}function ds(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}function ms(e){return e.replace(/^expect_/,"").replace(/column_values_to_be_|column_values_to_|column_|to_be_|to_/g," ").replace(/_/g," ").replace(/\s+/g," ").trim()||e}function ps(e,t={}){const{createdAt:r,dataVersion:a}=function(e){const t=e?.run_id;return t?"string"==typeof t?{dataVersion:t}:{createdAt:t.run_time,dataVersion:t.run_name??t.run_time}:{}}(e.meta),i=[];for(const[t,n]of(e.results??[]).entries()){const e=n.expectation_config??{},o=e.expectation_type??"unknown_expectation",s=e.kwargs??{},c=s.column,l=n.success?"pass":"fail",u=ds(s.min_value),d=ds(s.max_value),m=ds(s.value),p=ds(n.result?.observed_value),h=c??"value",f=ms(o),g=void 0!==p?`${h}: ${p} `:"",y={id:`ge:${o}:${c??t}`,name:`GE ${f}${c?` (${c})`:""}`,status:l,column:c,message:void 0!==p?"observed "+p:void 0,observedCount:n.result?.unexpected_count,source:"great-expectations",basis:"statistical-test",createdAt:r,dataVersion:a},b=/_to_be_between$/.test(o);i.push(b&&void 0!==u&&void 0!==d?{...y,kind:"range",min:u,max:d,label:`${g}(expected ${u}–${d})`}:b&&void 0!==u?{...y,kind:"min",value:u,label:`${g}(min ${u})`}:b&&void 0!==d?{...y,kind:"max",value:d,label:`${g}(max ${d})`}:void 0!==m?{...y,kind:"threshold",value:m,label:`${g}(target ${m})`}:{...y,kind:"custom",label:`${h} ${f}`})}return ss(i,t)}function hs(e,t,r,a,i){return function(e){const t=new Set;return e.filter(e=>{const r=`${e.component}::${e.variant?.key??"default"}`;return!t.has(r)&&(t.add(r),!0)})}(Do(e,{profile:r,intent:t.intent,maxResults:Number.MAX_SAFE_INTEGER,includeVariants:!0,...i?{deny:i}:{}})).slice(0,a)}function fs(e,t,r={}){const a=r.profile??Bi(t??[],r),i=bo(e),n=r.maxAlternatives??3,o=i?.recipe?function(e,t){const r=[];"required"===e.accessibility.description&&"string"!=typeof(t.props??{}).description&&r.push("This custom recipe needs a generated or authored description."),e.reception?.risks?.some(e=>/unfamiliar/i.test(e))&&!(e.reception.scaffolds??[]).some(e=>["legend","annotation","summary","description"].includes(e))&&r.push("This recipe is unfamiliar; add an orienting legend, annotation, or summary.");const a=e.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length));a&&r.push("This recipe is color-dependent; add a shape, position, texture, or label cue."),e.reception?.channels.includes("interactive")&&!e.accessibility.fallbackTable&&"required"!==e.accessibility.accessibleTable&&r.push("This interactive recipe needs a static data fallback."),"local"===e.portability&&r.push("This recipe is local-only and cannot be exported to MCP or CLI rendering.");for(const e of t.observedSceneAudit?.observedSceneEvidence??[])"fail"!==e.status&&"warn"!==e.status||("interaction.hit-targets"===e.id?r.push("Scene audit found data-bearing marks without hit targets."):"accessibility.table-fields"===e.id?r.push("Scene audit found accessible-table field loss."):"accessibility.navigation-depth"===e.id&&r.push("The recipe navigation tree is root-only; expose groups and reachable data marks."));return[...new Set(r)]}(i.recipe,r):[];if(!i)return{status:"unknown",component:e,alternatives:hs(t,r,a,n),profile:a};const s=i.fits(a);return null===s?{status:"ok",component:e,profile:a,...o.length?{repairs:o}:{}}:{status:"alternative",component:e,reason:s,alternatives:hs(t,r,a,n,[e]),profile:a,...o.length?{repairs:o}:{}}}function gs(e,t,r){if(null===e)return"null";switch(typeof e){case"undefined":return"undefined";case"string":return"string:"+e;case"number":return Number.isNaN(e)?"number:NaN":"number:"+(Object.is(e,-0)?"-0":e);case"boolean":return"boolean:"+e;case"bigint":return"bigint:"+e;case"symbol":return"symbol:"+e;case"function":case"object":{const a=e;let i=t.get(a);return void 0===i&&(i=r.value++,t.set(a,i)),"object:"+i}default:return"unknown"}}var ys=["data","nodes","edges"];function bs(e,t,r,a,i){const n=Object.keys(t).filter(e=>e!==i).sort().map(e=>[e,gs(t[e],r,a)]);return JSON.stringify([e,n])}function vs(e){let t=new WeakMap,r=new Map;const a=new WeakMap,i={value:1};return{render(n,o){const s=function(e){for(const t of ys){const r=e[t];if(null!==r&&("object"==typeof r||"function"==typeof r))return{prop:t,value:r}}}(o);if(!s){if(!Object.prototype.hasOwnProperty.call(o,"value"))return e(n,o);const t=bs(n,o,a,i),s=r.get(t);if(void 0!==s)return r.delete(t),r.set(t,s),s;const c=e(n,o);if(r.size>=64){const e=r.keys().next().value;void 0!==e&&r.delete(e)}return r.set(t,c),c}const c=bs(n,o,a,i,s.prop);let l=t.get(s.value);l||(l=new Map,t.set(s.value,l));const u=l.get(c);if(void 0!==u)return u;const d=e(n,o);return l.set(c,d),d},clear(){t=new WeakMap,r=new Map}}}var ws={valid:!1,errors:[]};function xs(e,t){return la[e]?Ma(e,t).diagnoses:[]}function As(e,t={}){const r=e.component,a={...e.props,...t.narration},i=[],n=!!la[r];n||i.push(`Unknown component "${r}". It is not in the chart registry — pick a known chart.`);const o=n?pa(r,a):{...ws};if(!o.valid)for(const e of o.errors)i.push(e);const s=!1!==t.diagnose&&n?xs(r,a):[],c=s.filter(e=>"error"===e.severity),l=!1!==t.treatErrorsAsBlocking;if(l)for(const e of c)i.push(`${e.code}: ${e.message}`);let u,d,m,p,h;if((t.repair??!!t.data)&&t.data&&(u=fs(r,t.data,{intent:t.intent}),"alternative"===u.status?i.push(`${r} is a poor fit: ${u.reason}. Consider ${u.alternatives.map(e=>e.component).slice(0,3).join(", ")}.`):"unknown"===u.status&&i.push(`${r} could not be evaluated against the data; consider ${u.alternatives.map(e=>e.component).slice(0,3).join(", ")}.`)),n&&(d=je(r,a),m=q(d)),t.render&&n&&o.valid&&(!l||0===c.length)){const e=t.render(r,a);h=e.svg,p=e.evidence,p.empty&&i.push("Rendered to an empty scene (no marks) — the data or accessors produce nothing to draw."),i.push(...function(e){return"degenerate"!==e.semanticStatus?[]:Ha(e).map(e=>`${e.code}: ${e.message}${e.fix?" "+e.fix:""}`)}(p));for(const e of p.warnings)i.push(e)}const f=n&&o.valid&&(!l||0===c.length)&&(!u||"ok"===u.status)&&(!p||!p.empty&&"degenerate"!==p.semanticStatus);return{ok:f,component:r,props:a,config:d,jsx:m,validation:o,diagnostics:s,repair:u,evidence:p,svg:h,reasons:f?[]:i}}function Cs(e={}){const t=e.components??Object.keys(la).sort();return{name:e.name??"render_semiotic_chart",description:"Render a Semiotic chart from a component name and props. The result is validated, diagnosed for anti-patterns, and (when data is supplied) checked for fit against the data. Inject a renderer to prove it paints; otherwise the result returns validation and repair reasons plus ranked alternatives.",inputSchema:{type:"object",additionalProperties:!1,required:["component"],properties:{component:{type:"string",enum:[...t],description:"The chart component to render."},props:{type:"object",description:"Props for the chart (accessors, data, encodings). See the component schema.",additionalProperties:!0}}}}}function ks(e){return{name:e.name,description:e.description,input_schema:e.inputSchema}}function Ss(e){return{type:"function",function:{name:e.name,description:e.description,parameters:e.inputSchema}}}function Ps(e,t=!0){if(!e||"object"!=typeof e||Array.isArray(e))return!1;const r=e,a=Array.isArray(r.type)?r.type:[r.type],i=a.includes("object")||!!r.properties;if(t&&!i)return!1;if(i){if(!1!==r.additionalProperties)return!1;const e=r.properties;if(!e||"object"!=typeof e||Array.isArray(e))return!1;const t=new Set(Array.isArray(r.required)?r.required:[]);if(Object.keys(e).some(e=>!t.has(e)))return!1;if(!Object.values(e).every(e=>Ps(e,!1)))return!1}if(a.includes("array")&&(!r.items||!Ps(r.items,!1)))return!1;for(const e of["anyOf","oneOf","allOf"]){if(void 0===r[e])continue;const t=r[e];if(!Array.isArray(t)||0===t.length)return!1;if(!t.every(e=>Ps(e,!1)))return!1}return!0}function $s(e,t={}){const r=t.strict??!1;if(r&&!Ps(e.inputSchema))throw Error("OpenAI strict mode requires a top-level object schema, closed object schemas, and every property required. chartGenerationTool() intentionally leaves props open for chart-specific props; use strict: false or pass a component-specific closed schema.");return{type:"function",name:e.name,description:e.description,parameters:e.inputSchema,strict:r}}function Ns(e){return t=>As(t,e?e(t):{})}var Ms=[{intent:"outlier-detection",weight:4,patterns:[/\b(outlier|outliers|anomal|anomaly|anomalies|extreme|extremes|unusual|stands? out|sticks? out|odd one)\b/i,/\b(peak|peaks|highest|lowest|biggest spike|spike|min|max|maximum|minimum)\b/i]},{intent:"trend",weight:4,patterns:[/\b(trend|trends|trending|trajectory|over time|across time|growth|decline|rising|falling|increasing|decreasing)\b/i,/\b(history|historical|evolved|evolution|change over)\b/i]},{intent:"change-detection",weight:3,patterns:[/\b(when did|what changed|shift|shifted|breakpoint|inflection|turning point|sudden|abrupt)\b/i]},{intent:"rank",weight:4,patterns:[/\b(rank|ranking|ranked|biggest|smallest|largest|order by|sorted|best|worst|leaderboard)\b/i,/\btop\s+(\d+|sellers?|performers?|picks?|results?|categories|items?)\b/i,/\bbottom\s+(\d+|results?|items?)\b/i,/\b(who has the most|which.*most|which.*highest|which.*lowest)\b/i]},{intent:"part-to-whole",weight:4,patterns:[/\b(share|shares|composition|portion|portions|fraction|percentage of|percent of|breakdown|make up|made up of|slice|slices)\b/i,/\b(part of|part to whole|piece of the pie|how much of)\b/i]},{intent:"composition-over-time",weight:5,patterns:[/\b(composition.*time|share.*over time|share.*across|how.*mix.*changed|stacked.*time)\b/i,/\b(over time.*share|over time.*composition|over time.*breakdown)\b/i]},{intent:"distribution",weight:4,patterns:[/\b(distribution|distributions|spread|variance|variation|histogram|skew|skewed|range of|how.*spread|shape of|bell curve)\b/i,/\b(typical value|typical range|where do most|mode|median)\b/i]},{intent:"correlation",weight:4,patterns:[/\b(correl|correlation|relationship|related to|connected to|associated|connection between|relate to)\b/i,/\b(\w+ vs\.? \w+|\w+ versus \w+|\w+ against \w+|scatter)\b/i]},{intent:"compare-series",weight:3,patterns:[/\b(compare.*series|compare.*groups|compare.*cohorts|side by side|group.*vs|series.*vs)\b/i,/\b(how do.*compare|each group|each series|each cohort)\b/i]},{intent:"compare-categories",weight:3,patterns:[/\b(compare.*categor|category.*compar|which is bigger|how does.*compare|differences? between)\b/i]},{intent:"flow",weight:4,patterns:[/\b(flow|flows|transition|transitions|movement|moved from|funnel|conversion|drop[- ]off|sankey|chord)\b/i,/\b(from.*to|source.*target|path|journey|pipeline)\b/i]},{intent:"hierarchy",weight:4,patterns:[/\b(hierarchy|hierarchical|tree|nested|parent.*child|subcategory|sub-?categor|drill down|drilldown|breakdown by level)\b/i]},{intent:"geo",weight:5,patterns:[/\b(geographic|geography|geospatial|map|maps|country|countries|cities|latitude|longitude|spatial|cartogr|choropleth)\b/i,/\b(city|us state|each state|the states)\b/i,/\bacross\s+(countries|states|regions|cities|the world|the country)\b/i]}],Ts=new Set(["date","time","datetime","timestamp","temporal"]);function Is(e,t,r,a){if(!Number.isFinite(r))return;const i=Math.max(0,Math.min(5,r)),n=e.get(t);n?(n[0]=Math.max(n[0],i),n[1]|=a):e.set(t,[i,a])}function Rs(e){const t=e?.trim().toLowerCase()??"";if(/^(num|int|float|double|decimal)/.test(t))return"numeric";if(/^(cat|string|enum|nominal|ordinal)/.test(t))return"categorical";const r=t.replace(/[\s_-]/g,"");return Ts.has(r)?"date":/^bool/.test(t)?"boolean":"unknown"}function Ds(e){return e.replace(/([a-z\d])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).flatMap(e=>[e,e.length>4&&e.endsWith("ies")?e.slice(0,-3)+"y":e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e])}function Es(e,t={}){if("string"!=typeof e)return null;const r=t.mode??"prose";if(!(e.trim()||"prose"!==r&&t.fields?.length))return null;const a=new Map;if("prose"===r||"combined"===r)for(const t of Ms)for(const r of t.patterns)if(r.test(e)){const e=a.get(t.intent)?.[0]??0;Is(a,t.intent,Math.min(5,0===e?t.weight:e+.5),1);break}if("schema"!==r&&"combined"!==r||function(e,t,r){const a=(t?.length?t:e.trim()?[{name:e}]:[]).map(e=>"string"==typeof e?{name:e}:e);if(0===a.length)return;const i=a.map(e=>new Set(Ds(e.name))),n={};for(const e of a){const t=Rs(e.kind);n[t]=(n[t]??0)+1}for(const e of qi()){const t=e.signals;if(!t)continue;const a=t.fieldNames??[];if(a.length>0){const n=a.filter(e=>{const t=Ds(e);return t.length>0&&i.some(e=>t.every(t=>e.has(t)))}).length;Math.max(1,t.minimumFieldMatches??Math.min(2,a.length))>n||Is(r,e.id,Math.min(5,2.5+.75*n),2)}const o=t.dataShape;if(!o)continue;const s=Object.entries(o).filter(([e])=>e.startsWith("min"));s.length>0&&s.every(([e,t])=>{const r=e.slice(3,-6).toLowerCase();return(n[r]??0)>=Number(t)})&&Is(r,e.id,o.confidence??3,4)}}(e,t.fields,a),0===a.size)return null;const i=[...a].sort((e,t)=>t[1][0]-e[1][0]),[n,...o]=i;if((t.minimumConfidence??3)>n[1][0])return null;const s=n[1][1];return{intent:n[0],confidence:n[1][0],alternates:o.map(([e,[t]])=>({intent:e,confidence:t})),source:1===s?"prose":2===s?"field-name":4===s?"data-shape":"combined"}}function _s(e,t={}){const r=t.audience;if(!r)return[];const a=t.profile??Bi(e??[],t),i=ko(r),n=t.scoreTolerance??1.5,o=t.maxResults??5,s=yo(),c=new Map;for(const e of s)c.set(e.component,Co(e.component,e.rubric.familiarity,r));const l=Do(e,{profile:a,intent:t.intent,maxResults:30,includeVariants:!0,minScore:1,allow:t.allow,deny:t.deny}),u=l.filter(e=>(c.get(e.component)??e.rubric.familiarity)>=4)[0],d=[];for(const e of l)(c.get(e.component)??e.rubric.familiarity)>i||("increase"===r.targets?.[e.component]?.direction||!u||n>=u.score-e.score)&&d.push({stretch:e,familiar:u});const m=new Set,p=[];for(const{stretch:e,familiar:t}of d){const a=`${e.component}/${e.variant?.key??"base"}`;if(m.has(a))continue;m.add(a);const i=c.get(e.component)??e.rubric.familiarity,n=r.targets?.[e.component],s=n?.reason??("increase"===n?.direction?`${r.name??"your audience"} is growing adoption of ${e.component}`:t?`${e.component} is on the data, and within reach of ${t.component} which you're already familiar with`:e.component+" fits this data and would expand your team's vocabulary");if(p.push({suggestion:e,replacing:t?.component,rationale:s,familiarity:i}),p.length>=o)break}return p}function Fs(e,t={}){const r=t.profile??Bi(e??[],t),a=t.maxPanels??6,i=!1!==t.diversifyByFamily,n=t.intents??function(e){const t=[];return e.hasTimeAxis&&(t.push("trend"),e.seriesCount&&e.seriesCount>=2&&t.push("compare-series","composition-over-time"),t.push("change-detection")),e.categoryCount&&t.push("rank","compare-categories","part-to-whole"),e.primary.y&&e.rowCount>=10&&t.push("distribution"),2>Object.values(e.fields).filter(e=>"numeric"===e.type).length||t.push("correlation","outlier-detection"),e.hasHierarchy&&t.push("hierarchy"),e.hasNetwork&&t.push("flow"),e.hasGeo&&t.push("geo"),Array.from(new Set(t))}(r),o=[],s=[],c=[],l=new Set,u=new Set;for(const d of n){if(o.length>=a){c.push(d);continue}const n=Do(e,{profile:r,intent:d,allow:t.allow,deny:t.deny,maxResults:20,includeVariants:!0,minScore:1.5,audience:t.audience});let m;for(const e of n)if(!(u.has(`${e.component}/${e.variant?.key??"base"}`)||i&&l.has(e.family))){m=e;break}if(!m&&i)for(const e of n)if(!u.has(`${e.component}/${e.variant?.key??"base"}`)){m=e;break}m?(o.push({intent:d,suggestion:m}),s.push(d),l.add(m.family),u.add(`${m.component}/${m.variant?.key??"base"}`)):c.push(d)}return{panels:o,intentsCovered:s,intentsMissing:c,stretchPanels:t.audience&&(t.audience.exposureLevel??1)>0?_s(e,{profile:r,audience:t.audience,deny:Array.from(u).map(e=>e.split("/")[0]),maxResults:t.maxStretchPanels??Math.min(3,a)}):[],profile:r}}var js={name:"Executive",familiarity:{BarChart:5,LineChart:5,PieChart:5,DonutChart:4,GaugeChart:5,AreaChart:4,FunnelChart:4,ChoroplethMap:4,Histogram:3,Heatmap:3,StackedBarChart:3,StackedAreaChart:3,Scatterplot:3,BubbleChart:3,GroupedBarChart:3,DotPlot:3,BoxPlot:2,ViolinPlot:1,SwarmPlot:1,RidgelinePlot:1,MultiAxisLineChart:2,CandlestickChart:2,DifferenceChart:2,QuadrantChart:3,LikertChart:3,SwimlaneChart:2,MinimapChart:2,ConnectedScatterplot:1,SankeyDiagram:2,TreeDiagram:3,Treemap:3,CirclePack:2,OrbitDiagram:1,ChordDiagram:1,ProcessSankey:2,ForceDirectedGraph:1,ProportionalSymbolMap:3,FlowMap:2,DistanceCartogram:1},targets:{PieChart:{direction:"decrease",weight:1,reason:"shifting from share-by-angle toward share-by-length for accuracy"},BarChart:{direction:"increase",weight:1}},exposureLevel:1},Bs={name:"Analyst",familiarity:{BarChart:5,LineChart:5,PieChart:4,DonutChart:4,AreaChart:5,StackedAreaChart:4,StackedBarChart:5,GroupedBarChart:5,Histogram:5,Heatmap:5,Scatterplot:5,BubbleChart:4,BoxPlot:4,DotPlot:4,GaugeChart:3,FunnelChart:4,LikertChart:4,QuadrantChart:4,SwimlaneChart:4,MinimapChart:4,DifferenceChart:3,MultiAxisLineChart:4,CandlestickChart:3,ConnectedScatterplot:3,ViolinPlot:3,SwarmPlot:3,RidgelinePlot:2,TreeDiagram:4,Treemap:4,CirclePack:3,SankeyDiagram:4,ProcessSankey:3,ChordDiagram:3,OrbitDiagram:2,ForceDirectedGraph:3,ChoroplethMap:4,ProportionalSymbolMap:4,FlowMap:3,DistanceCartogram:2},targets:{PieChart:{direction:"decrease",weight:1},BoxPlot:{direction:"increase",weight:1,reason:"team is shifting from averages to distribution-aware comparisons"}},exposureLevel:1},Os={name:"Data scientist",familiarity:{BarChart:5,LineChart:5,PieChart:3,DonutChart:3,AreaChart:5,StackedAreaChart:5,StackedBarChart:5,GroupedBarChart:5,Histogram:5,Heatmap:5,Scatterplot:5,BubbleChart:5,BoxPlot:5,ViolinPlot:5,SwarmPlot:4,RidgelinePlot:4,DotPlot:4,QuadrantChart:4,LikertChart:4,DifferenceChart:4,MultiAxisLineChart:4,ConnectedScatterplot:4,GaugeChart:2,FunnelChart:3,SwimlaneChart:3,MinimapChart:4,CandlestickChart:3,TreeDiagram:4,Treemap:4,CirclePack:4,SankeyDiagram:4,ProcessSankey:3,ChordDiagram:3,OrbitDiagram:2,ForceDirectedGraph:4,ChoroplethMap:4,ProportionalSymbolMap:4,FlowMap:3,DistanceCartogram:3},targets:{PieChart:{direction:"decrease",weight:2,reason:"preferring length-encoded comparisons for precision"},BarChart:{direction:"decrease",weight:1,reason:"promoting distribution-aware charts over single-value bars when raw observations are available"},BoxPlot:{direction:"increase",weight:1},ViolinPlot:{direction:"increase",weight:1}},exposureLevel:2},zs={executive:js,analyst:Bs,"data-scientist":Os},Ls=[{component:"RealtimeLineChart",importPath:"semiotic/realtime",requiresLiveData:!0,rubric:{familiarity:4,accuracy:4,precision:3},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"y"===e.role||"value"===e.role)?"high"===e.throughput?"for high-throughput streams, prefer RealtimeHeatmap or RealtimeWaterfallChart":null:"needs a numeric value field":"needs a date/time field for the x axis",intentScores:{trend:5,"change-detection":4,"outlier-detection":2},caveats:e=>{const t=[];return"cumulative"===e.retention&&t.push("cumulative retention will eventually exhaust the buffer — set a windowSize or downsample"),t},buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"y"===e.role||"value"===e.role||"numeric"===e.kind)?.name;return{timeAccessor:t,valueAccessor:r}}},{component:"RealtimeHistogram",importPath:"semiotic/realtime",requiresLiveData:!0,rubric:{familiarity:3,accuracy:4,precision:3},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?null:"needs a numeric field to bin":"needs a time field",intentScores:{distribution:5,"outlier-detection":4,"change-detection":2},buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"value"===e.role||"numeric"===e.kind)?.name;return{timeAccessor:t,valueAccessor:r}}},{component:"RealtimeSwarmChart",importPath:"semiotic/realtime",requiresLiveData:!0,rubric:{familiarity:2,accuracy:4,precision:4},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?e.fields.some(e=>"categorical"===e.kind||"category"===e.role)?null:"needs a category to swarm by":"needs a numeric field":"needs a time field (points are placed at (time, value))",intentScores:{"outlier-detection":5,distribution:4,"compare-categories":3},caveats:e=>"high"===e.throughput?["high-throughput swarms get crowded — consider RealtimeHistogram"]:[],buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"value"===e.role||"numeric"===e.kind)?.name,a=e.fields.find(e=>"category"===e.role||"categorical"===e.kind)?.name;return{timeAccessor:t,valueAccessor:r,categoryAccessor:a}}},{component:"RealtimeWaterfallChart",importPath:"semiotic/realtime",requiresLiveData:!0,rubric:{familiarity:2,accuracy:4,precision:3},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?null:"needs a numeric value field":"needs a time field",intentScores:{"change-detection":5,trend:3,"outlier-detection":4,distribution:e=>"high"===e.throughput?4:2},buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"value"===e.role||"numeric"===e.kind)?.name;return{timeAccessor:t,valueAccessor:r}}},{component:"RealtimeHeatmap",importPath:"semiotic/realtime",requiresLiveData:!0,rubric:{familiarity:2,accuracy:3,precision:2},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?null:"needs a numeric value field":"needs a time field for the x axis",intentScores:{trend:e=>"high"===e.throughput?4:2,distribution:3,"change-detection":3,"compare-series":e=>e.fields.find(e=>"series"===e.role||"categorical"===e.kind&&"category"!==e.role)?4:1},buildProps:e=>{const t=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name,r=e.fields.find(e=>"y"===e.role||"value"===e.role||"numeric"===e.kind)?.name,a=e.fields.find(e=>"category"===e.role||"categorical"===e.kind&&"series"!==e.role)?.name;return{timeAccessor:t,valueAccessor:r,...a?{categoryAccessor:a}:{}}}},{component:"TemporalHistogram",importPath:"semiotic/realtime",rubric:{familiarity:3,accuracy:4,precision:3},fits:e=>e.fields.some(e=>"date"===e.kind||"x"===e.role)?e.fields.some(e=>"numeric"===e.kind||"value"===e.role)?"windowed"===e.retention?"windowed retention is RealtimeHistogram's job; TemporalHistogram serves bounded/cumulative data":null:"needs a numeric value field":"needs a time field",intentScores:{distribution:5,"change-detection":3,trend:2},buildProps:e=>{const t=e.fields.find(e=>"value"===e.role||"numeric"===e.kind)?.name,r=e.fields.find(e=>"x"===e.role||"date"===e.kind)?.name;return{timeAccessor:r,valueAccessor:t}}}],Hs=new Map;function Gs(e){Hs.set(e.component,e)}function qs(e){Hs.delete(e)}function Us(){if(0===Hs.size)return Ls;const e=new Map;for(const t of Ls)e.set(t.component,t);for(const[t,r]of Hs)e.set(t,r);return Array.from(e.values())}function Vs(e,t){if(void 0===e)return 0;const r="function"==typeof e?e(t):e;return Number.isFinite(r)?Math.max(0,Math.min(5,r)):0}function Ws(e,t){if(0===t.length){const t=Object.values(e).filter(e=>"number"==typeof e&&e>0);return 0===t.length?0:t.reduce((e,t)=>e+t,0)/t.length}let r=0;for(const a of t)r+=e[a]??0;return r/t.length}function Ys(e,t,r){const a=[],i=r.map(e=>({intent:e,score:t[e]??0})).filter(e=>e.score>=3).sort((e,t)=>t.score-e.score).slice(0,2);for(const{intent:e,score:t}of i)a.push(`Strong fit for ${e} (${t}/5)`);return e.throughput&&a.push(`tuned for ${e.throughput} throughput`),a}function Xs(e,t={}){const r=t.capabilities??Us(),a=t.intent?Array.isArray(t.intent)?t.intent:[t.intent]:[],i=t.minScore??0,n=t.maxResults??10,o=t.allow?new Set(t.allow):null,s=t.deny?new Set(t.deny):null,c=[];for(const t of r){if(o&&!o.has(t.component))continue;if(s&&s.has(t.component))continue;if(null!==t.fits(e))continue;const r={};for(const[a,i]of Object.entries(t.intentScores))r[a]=Vs(i,e);const n=Wi(r,a),l=Ws(n,a);if(i>l)continue;const u={...t.rubric},d=t.caveats?Array.from(t.caveats(e)):[],m=Ys(e,n,a),p=t.buildProps(e);c.push({component:t.component,family:"realtime",importPath:t.importPath,requiresLiveData:!0===t.requiresLiveData,score:l,intentScores:n,rubric:u,reasons:m,caveats:d,props:p})}return c.sort((e,t)=>t.score!==e.score?t.score-e.score:t.rubric.accuracy!==e.rubric.accuracy?t.rubric.accuracy-e.rubric.accuracy:t.rubric.familiarity-e.rubric.familiarity),c.slice(0,n)}var Ks=["x","y","size","category","series","time"];function Qs(e,t){const r=e.fields[t];return r?"numeric"===r.type?"numeric":"categorical"===r.type?"categorical":"date"===r.type?"date":"unknown":"unknown"}function Zs(e){const t=new Set;for(const r of yo())null===r.fits(e)&&t.add(r.component);return t}function Js(e,t){const r=new Set(Object.keys(e.fields)),a=new Set(Object.keys(t.fields)),i=[],n=[];for(const e of a)r.has(e)||i.push(e);for(const e of r)a.has(e)||n.push(e);i.sort(),n.sort();const o=[];for(const i of a){if(!r.has(i))continue;const a=Qs(e,i),n=Qs(t,i);a!==n&&o.push({field:i,from:a,to:n})}o.sort((e,t)=>e.field.localeCompare(t.field));const s=[];for(const r of Ks){const a=e.primary[r],i=t.primary[r];a!==i&&s.push({role:r,from:a,to:i})}const c=Zs(e),l=Zs(t),u=Array.from(c).filter(e=>!l.has(e)).sort(),d=Array.from(l).filter(e=>!c.has(e)).sort();return{rowCountChange:t.rowCount-e.rowCount,added:i,removed:n,typeChanges:o,primaryChanges:s,becameUnfit:u,becameFit:d,unchanged:0===i.length&&0===n.length&&0===o.length&&0===s.length&&0===u.length&&0===d.length&&e.rowCount===t.rowCount}}function ec(e,t=yo()){const r=new Map;for(const e of t)r.set(e.component,{component:e.component,family:e.family,fitsOn:0,rejectedOn:0,inTopThreeOn:0,topPickOn:0,expertAgreementCount:0,averageScore:0,caveatCoverage:0,variantUtilization:0});const a=new Map,i=new Map,n=new Map,o=new Map,s=[];for(const c of e){let e,l;try{e=Bi(c.data,{rawInput:c.rawInput}),l=Eo(c.data,{profile:e,intent:c.intent,capabilities:t,maxResults:40})}catch{const e=!!c.expected&&c.expected.length>0;s.push({fixture:c.name,shape:c.shape,intent:c.intent,expected:c.expected,topPick:void 0,topThree:[],fittingCount:0,rejectedCount:0,expertAgreement:!e&&null,topPickAgreement:!e&&null,noFitHonored:null});continue}const u=[],d=new Set;for(const e of l.fitting)if(!d.has(e.component)&&(d.add(e.component),u.push({component:e.component,variantKey:e.variant?.key,score:e.score}),3===u.length))break;const m=c.expected&&c.expected.length>0?u.some(e=>c.expected.includes(e.component)):null,p=c.expected&&c.expected.length>0?u.length>0&&c.expected.includes(u[0].component):null;s.push({fixture:c.name,shape:c.shape,intent:c.intent,expected:c.expected,topPick:u[0],topThree:u,fittingCount:l.fitting.length,rejectedCount:l.rejected.length,expertAgreement:m,topPickAgreement:p,noFitHonored:!0===c.expectsNoFit?0===l.fitting.length:null});for(const e of l.fitting){const t=r.get(e.component);t&&(t.fitsOn+=1,a.set(e.component,(a.get(e.component)??0)+e.score),i.set(e.component,(i.get(e.component)??0)+1),e.caveats.length>0&&n.set(e.component,(n.get(e.component)??0)+1),e.variant&&o.set(e.component,(o.get(e.component)??0)+1))}for(const e of l.rejected){const t=r.get(e.component);t&&(t.rejectedOn+=1)}for(const e of u){const t=r.get(e.component);t&&(t.inTopThreeOn+=1)}if(u[0]){const e=r.get(u[0].component);e&&(e.topPickOn+=1)}if(c.expected&&m)for(const e of u)if(c.expected.includes(e.component)){const t=r.get(e.component);t&&(t.expertAgreementCount+=1)}}for(const e of r.values()){const t=i.get(e.component)??0;e.averageScore=0===t?0:(a.get(e.component)??0)/t,e.caveatCoverage=0===t?0:(n.get(e.component)??0)/t,e.variantUtilization=0===t?0:(o.get(e.component)??0)/t}const c=Array.from(r.values()).sort((e,t)=>{const r=e.expertAgreementCount-t.expertAgreementCount;return 0!==r?r:t.fitsOn-e.fitsOn}),l=s.filter(e=>null!==e.expertAgreement),u=0===l.length?0:l.filter(e=>!0===e.expertAgreement).length/l.length,d=0===l.length?0:l.filter(e=>!0===e.topPickAgreement).length/l.length,m=Array.from(i.values()).reduce((e,t)=>e+t,0),p=Array.from(n.values()).reduce((e,t)=>e+t,0),h=Array.from(o.values()).reduce((e,t)=>e+t,0);return{perCapability:c,perFixture:s,summary:{fixtureCount:e.length,capabilityCount:t.length,expertAgreementRate:u,top1AgreementRate:d,overallCaveatCoverage:0===m?0:p/m,overallVariantUtilization:0===m?0:h/m}}}var tc=(()=>{const e=Array.from({length:12},(e,t)=>t+1);return["EU","NA","APAC"].flatMap((t,r)=>e.map(e=>({month:e,revenue:800+e*(200+40*r)+150*Math.sin(e),region:t})))})(),rc=Array.from({length:12},(e,t)=>({month:t+1,revenue:1e3+150*t+100*Math.sin(t/2)})),ac=[{product:"Widget",units:480},{product:"Gadget",units:620},{product:"Sprocket",units:290},{product:"Whatsit",units:740},{product:"Doohickey",units:410}],ic=Array.from({length:150},(e,t)=>({respondent_id:t+1,satisfaction:Math.max(1,Math.min(10,6+2*Math.sin(t/7)+3*Math.random()-1)),cohort:["Beta","GA","Enterprise"][t%3]})),nc=Array.from({length:80},(e,t)=>{const r=Math.max(0,40*Math.random());return{student_id:"s"+(t+1),hours:r,grade:Math.min(100,1.8*r+30+20*(Math.random()-.5))}}),oc=Array.from({length:50},(e,t)=>({observation:50+12*Math.sin(t/4)+6*Math.random()})),sc=[{product:"Widget",region:"EU",units:480},{product:"Widget",region:"NA",units:620},{product:"Widget",region:"APAC",units:290},{product:"Gadget",region:"EU",units:320},{product:"Gadget",region:"NA",units:740},{product:"Gadget",region:"APAC",units:410},{product:"Sprocket",region:"EU",units:200},{product:"Sprocket",region:"NA",units:380},{product:"Sprocket",region:"APAC",units:150},{product:"Whatsit",region:"EU",units:290},{product:"Whatsit",region:"NA",units:550},{product:"Whatsit",region:"APAC",units:180}],cc=[{name:"monthly revenue with regions, intent=trend",shape:"12 months × 3 regions, numeric month, numeric revenue",data:tc,intent:"trend",expected:["LineChart","AreaChart","MinimapChart"]},{name:"monthly revenue with regions, intent=compare-series",shape:"12 months × 3 regions",data:tc,intent:"compare-series",expected:["LineChart","GroupedBarChart"]},{name:"monthly revenue with regions, intent=composition-over-time",shape:"12 months × 3 regions, additive",data:tc,intent:"composition-over-time",expected:["StackedAreaChart","StackedBarChart"]},{name:"monthly revenue single series, intent=trend",shape:"12 months, no series",data:rc,intent:"trend",expected:["LineChart","AreaChart"]},{name:"product sales, intent=rank",shape:"5 products, single numeric measure",data:ac,intent:"rank",expected:["BarChart","DotPlot"]},{name:"product sales, intent=part-to-whole",shape:"5 products, single numeric measure",data:ac,intent:"part-to-whole",expected:["PieChart","DonutChart","BarChart"]},{name:"satisfaction scores, intent=distribution",shape:"150 numeric observations across 3 cohorts",data:ic,intent:"distribution",expected:["Histogram","BoxPlot","ViolinPlot"]},{name:"satisfaction scores, intent=compare-categories",shape:"150 obs × 3 cohorts",data:ic,intent:"compare-categories",expected:["BoxPlot","ViolinPlot","SwarmPlot"]},{name:"hours vs grade, intent=correlation",shape:"80 students, hours + grade",data:nc,intent:"correlation",expected:["Scatterplot"]},{name:"hours vs grade, intent=outlier-detection",shape:"80 students",data:nc,intent:"outlier-detection",expected:["Scatterplot"]},{name:"conversion funnel, intent=flow",shape:"4 stages, descending values",data:[{stage:"Visit",users:1e4},{stage:"Signup",users:2400},{stage:"Trial",users:1100},{stage:"Paid",users:380}],intent:"flow",expected:["FunnelChart"]},{name:"org chart, intent=hierarchy",shape:"3-deep org tree",data:[],rawInput:{name:"Acme",children:[{name:"Engineering",children:[{name:"Platform",value:18},{name:"Product",value:22}]},{name:"Sales",children:[{name:"EMEA",value:12},{name:"AMER",value:26}]},{name:"Ops",value:9}]},intent:"hierarchy",expected:["TreeDiagram","Treemap","CirclePack"]},{name:"approval workflow transitions, intent=flow",shape:"5 nodes / 4 weighted edges",data:[],rawInput:{nodes:[{id:"draft"},{id:"review"},{id:"approved"},{id:"shipped"},{id:"rejected"}],edges:[{source:"draft",target:"review",value:100},{source:"review",target:"approved",value:60},{source:"review",target:"rejected",value:40},{source:"approved",target:"shipped",value:58}]},intent:"flow",expected:["SankeyDiagram","ChordDiagram"]},{name:"US states with values, intent=geo",shape:"3 polygon features with numeric values",data:[],rawInput:{type:"FeatureCollection",features:[{type:"Feature",id:"CA",properties:{name:"California",value:39},geometry:{type:"Polygon",coordinates:[[[-124,32],[-114,32],[-114,42],[-124,42],[-124,32]]]}},{type:"Feature",id:"TX",properties:{name:"Texas",value:29},geometry:{type:"Polygon",coordinates:[[[-106,26],[-93,26],[-93,36],[-106,36],[-106,26]]]}},{type:"Feature",id:"NY",properties:{name:"New York",value:19},geometry:{type:"Polygon",coordinates:[[[-79,40],[-72,40],[-72,45],[-79,45],[-79,40]]]}}]},intent:"geo",expected:["ChoroplethMap","ProportionalSymbolMap"]},{name:"country economies, intent=correlation",shape:"10 countries × 3 numeric measures (gdp, hours, population)",data:[{country:"USA",gdp_per_capita:70,hours_worked:1700,population_size:330},{country:"UK",gdp_per_capita:48,hours_worked:1500,population_size:67},{country:"Germany",gdp_per_capita:53,hours_worked:1330,population_size:84},{country:"Japan",gdp_per_capita:40,hours_worked:1600,population_size:125},{country:"France",gdp_per_capita:45,hours_worked:1480,population_size:67},{country:"Italy",gdp_per_capita:38,hours_worked:1700,population_size:60},{country:"Spain",gdp_per_capita:32,hours_worked:1640,population_size:47},{country:"Canada",gdp_per_capita:52,hours_worked:1690,population_size:38},{country:"Australia",gdp_per_capita:56,hours_worked:1700,population_size:26},{country:"South Korea",gdp_per_capita:35,hours_worked:1900,population_size:52}],intent:"correlation",expected:["Scatterplot","BubbleChart"]},{name:"website metrics with 3 measures, intent=compare-series",shape:"24 months × 3 numeric measures with different ranges",data:Array.from({length:24},(e,t)=>({month:t+1,page_views:Math.round(5e4+1200*t+8e3*Math.sin(t/3)),conversion_rate:2.5+.8*Math.sin(t/4)+.05*t,avg_session_seconds:Math.round(120+2*t+15*Math.cos(t/5))})),intent:"compare-series",expected:["MultiAxisLineChart","LineChart"]},{name:"sales by region and product, intent=compare-series",shape:"12 rows = 4 products × 3 regions",data:sc,intent:"compare-series",expected:["GroupedBarChart","StackedBarChart"]},{name:"sales by region and product, intent=part-to-whole",shape:"12 rows = 4 products × 3 regions",data:sc,intent:"part-to-whole",expected:["StackedBarChart","PieChart"]},{name:"revenue vs expenses, intent=compare-series",shape:"48 rows = 24 months × 2 series",data:[...Array.from({length:24},(e,t)=>({month:t+1,amount:100+8*t+25*Math.sin(t/3),series:"revenue"})),...Array.from({length:24},(e,t)=>({month:t+1,amount:80+6*t+15*Math.cos(t/4),series:"expenses"}))],intent:"compare-series",expected:["DifferenceChart","LineChart","GroupedBarChart"]},{name:"stock OHLC prices, intent=change-detection",shape:"30 days × open/high/low/close",data:Array.from({length:30},(e,t)=>{const r=100+1.2*t+8*Math.sin(t/4),a=r+4*(Math.random()-.5),i=r+4*(Math.random()-.5);return{day:t+1,open:a,high:Math.max(a,i)+3*Math.random(),low:Math.min(a,i)-3*Math.random(),close:i}}),intent:"change-detection",expected:["CandlestickChart","LineChart"]},{name:"unemployment vs inflation by year, intent=correlation",shape:"20 years × 2 measures, ordered by year",data:Array.from({length:20},(e,t)=>({year:2005+t,unemployment:5+2*Math.sin(t/2)+(t>4&&10>t?3:0),inflation:2+1.5*Math.cos(t/3)})),intent:"correlation",expected:["ConnectedScatterplot","Scatterplot"]},{name:"transition events, intent=flow",shape:"11 stage transitions across 3 deals with startTime + value",data:[{case:"deal-001",stage:"Inbound Lead",nextStage:"Qualified",startTime:"2024-04-01T09:00:00",value:18},{case:"deal-001",stage:"Qualified",nextStage:"Discovery",startTime:"2024-04-01T13:00:00",value:16},{case:"deal-001",stage:"Discovery",nextStage:"Proposal",startTime:"2024-04-02T11:00:00",value:14},{case:"deal-001",stage:"Proposal",nextStage:"Closed Won",startTime:"2024-04-04T09:00:00",value:12},{case:"deal-002",stage:"Inbound Lead",nextStage:"Qualified",startTime:"2024-04-01T10:00:00",value:10},{case:"deal-002",stage:"Qualified",nextStage:"Discovery",startTime:"2024-04-02T09:00:00",value:9},{case:"deal-002",stage:"Discovery",nextStage:"Proposal",startTime:"2024-04-03T09:00:00",value:7},{case:"deal-002",stage:"Proposal",nextStage:"Closed Lost",startTime:"2024-04-04T11:00:00",value:5},{case:"deal-003",stage:"Signup",nextStage:"Activated",startTime:"2024-04-01T08:30:00",value:28},{case:"deal-003",stage:"Activated",nextStage:"Trial",startTime:"2024-04-01T10:00:00",value:24},{case:"deal-003",stage:"Trial",nextStage:"Subscribed",startTime:"2024-04-02T10:00:00",value:18}],intent:"flow",expected:["SankeyDiagram","ProcessSankey","ChordDiagram"]},{name:"incidents by service and weekday, intent=compare-categories",shape:"56 cells = 8 services × 7 weekdays, numeric incident count",data:(()=>{const e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return["auth","billing","search","ingest","notify","reports","exports","webhooks"].flatMap((t,r)=>e.map((e,a)=>({service:t,day:e,incidents:Math.round(2+9*Math.abs(Math.sin(1.7*r+a))+(5>a?1.5:-1.5))})))})(),intent:"compare-categories",expected:["Heatmap","GroupedBarChart"]},{name:"capacity utilization single value, intent=part-to-whole",shape:"1 row, one numeric value against an implicit 0–100 plan",data:[{metric:"Cluster capacity used",value:78}],intent:"part-to-whole",expected:["GaugeChart","BigNumber"]},{name:"shipping flows between cities, intent=flow",shape:"6 lat/lon nodes, 6 weighted flows, 1 outline feature",data:[],rawInput:{type:"FeatureCollection",features:[{type:"Feature",id:"outline",properties:{name:"Region"},geometry:{type:"Polygon",coordinates:[[[-125,24],[-66,24],[-66,50],[-125,50],[-125,24]]]}}],points:[{id:"SEA",lon:-122.3,lat:47.6},{id:"SFO",lon:-122.4,lat:37.8},{id:"DEN",lon:-104.9,lat:39.7},{id:"ORD",lon:-87.6,lat:41.9},{id:"ATL",lon:-84.4,lat:33.7},{id:"JFK",lon:-73.8,lat:40.6}],flows:[{source:"SEA",target:"ORD",value:320},{source:"SFO",target:"JFK",value:540},{source:"SFO",target:"ATL",value:210},{source:"DEN",target:"ORD",value:180},{source:"ORD",target:"JFK",value:460},{source:"ATL",target:"JFK",value:250}]},intent:"flow",expected:["FlowMap"]},{name:"travel times from HQ, intent=geo",shape:"6 lat/lon points with a cost field measured from a center",data:[],rawInput:{type:"FeatureCollection",features:[{type:"Feature",id:"outline",properties:{name:"Region"},geometry:{type:"Polygon",coordinates:[[[-125,24],[-66,24],[-66,50],[-125,50],[-125,24]]]}}],points:[{id:"HQ",lon:-122.4,lat:37.8,cost:0},{id:"Seattle",lon:-122.3,lat:47.6,cost:95},{id:"Denver",lon:-104.9,lat:39.7,cost:150},{id:"Chicago",lon:-87.6,lat:41.9,cost:245},{id:"Atlanta",lon:-84.4,lat:33.7,cost:280},{id:"New York",lon:-73.8,lat:40.6,cost:330}]},intent:"geo",expected:["DistanceCartogram","ProportionalSymbolMap"]},{name:"flat single column",shape:"50 rows, one numeric column",data:oc,expected:["Histogram"]},{name:"sparse 3-row data, intent=rank",shape:"3 rows total",data:[{name:"A",value:12},{name:"B",value:34},{name:"C",value:8}],intent:"rank",expected:["BarChart","DotPlot"]}];import{useEffect as lc,useMemo as uc,useRef as dc,useSyncExternalStore as mc}from"react";var pc=e=>_e(e),hc=()=>ue().enabled,fc=()=>!1;function gc(e,t={}){const{intent:r,allow:a,deny:i,maxResults:n,includeVariants:o,minScore:s,rawInput:c,seriesField:l,identifiers:u,fieldRoles:d,capabilities:m,audience:p,profile:h}=t,f=uc(()=>h??Bi(e??[],{rawInput:c,seriesField:l,identifiers:u,fieldRoles:d}),[h,e,c,l,u,d]),g=uc(()=>Do(e,{intent:r,allow:a,deny:i,maxResults:n,includeVariants:o,minScore:s,capabilities:m,audience:p,profile:f}),[e,r,a,i,n,o,s,m,p,f]),y=mc(pc,hc,fc),b=dc(null);return lc(()=>{if(0===g.length)return void(b.current=null);if(!y)return void(b.current=null);const e=ue(),t=p?.name??(p?"custom":void 0),a=`${r??""}|${t??""}|${g.map(e=>e.component).join(",")}`;if(a===b.current)return;const i=e.getEvents();for(let e=i.length-1;e>=0;e--){const t=i[e];if("suggestion-shown"===t.type){if(`${Array.isArray(t.intent)?t.intent.join(","):t.intent??""}|${t.audience??""}|${t.components.join(",")}`===a)return void(b.current=a);break}}b.current=a,e.record({type:"suggestion-shown",intent:r,components:g.map(e=>e.component),topScore:g[0]?.score,audience:t})},[g,r,p,y]),{suggestions:g,profile:f}}import*as yc from"react";function bc(e){const t=Ie(e.recipe)??(e.recipeId?le(e.recipeId):void 0);if(!t)throw Error(`Unknown chart recipe "${e.recipeId??"(missing recipeId)"}". Register it before rendering.`);const r=function(e){return"function"==typeof e.layout?e.layout:ge(e.layout)?de(e.layout.id):void 0}(t);if(!r){const e=ge(t.layout)?t.layout.id:t.id;throw Error(`No runtime layout registered for chart recipe "${t.id}" (${e}).`)}const a="semiotic-chart-recipe semiotic-chart-recipe-"+t.id.replace(/[^a-zA-Z0-9_-]+/g,"-"),i={...e,chartId:e.chartId??t.id,className:e.className?`${a} ${e.className}`:a,recipeId:t.id,recipe:t,layout:r},n="XYFrame"===t.frameFamily||"XYCustomChart"===t.frameFamily?ot:"OrdinalFrame"===t.frameFamily||"OrdinalCustomChart"===t.frameFamily?bt:"NetworkFrame"===t.frameFamily||"NetworkCustomChart"===t.frameFamily?Nt:"GeoFrame"===t.frameFamily||"GeoCustomChart"===t.frameFamily?tr:void 0;if(!n)throw Error(`Chart recipe "${t.id}" uses unsupported frame family "${t.frameFamily}".`);return yc.createElement(n,i)}function vc(e){const t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:t+""}function wc(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function xc(e){return"number"==typeof e&&Number.isFinite(e)}function Ac(e){if(xc(e.x)&&xc(e.y)&&xc(e.w)&&xc(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(xc(e.x)&&xc(e.y)&&xc(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(xc(e.cx)&&xc(e.cy)&&xc(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(xc(e.cx)&&xc(e.cy)&&xc(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};const t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&xc(e[0])&&xc(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function Cc(e,t){const r=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.min(Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0));return a>0?r/a:0}function kc(e,t,r,a,i){if(e===t)return!0;const n=r.dataRoles.map(e=>ae(e,a,i)).filter(e=>!!e).filter(r=>null!=e[r]&&null!=t[r]);return n.length>0&&n.every(r=>e[r]+""==t[r]+"")}function Sc(e,t,r,a,i,n="warn",o){return{id:e,category:t,status:r?"pass":n,message:r?a:i,...o?{evidence:o}:{}}}function Pc(e){const{recipe:t}=e,r=function(e){return Array.isArray(e)?e:e&&"object"==typeof e?[...e.nodes??e.sceneNodes??[],...e.sceneEdges??[]]:[]}(e.scene),a=e.layoutConfig??Ae({layoutConfig:e.layoutConfig}),i=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},n=i.x??0,o=i.y??0,s=[],c=r.filter(e=>null!=wc(e)),l=r.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||function(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));s.push(Sc("geometry.finite","geometry",0===l.length,"All emitted geometry is finite.",l.length+" marks contain non-finite geometry.","fail",{count:l.length}));const u=r.map(Ac),d=u.filter(e=>e&&(e.x0>=e.x1||e.y0>=e.y1)).length;s.push(Sc("geometry.nonzero-area","geometry",0===d,"All bounded marks have positive area.",d+" marks have zero or negative area.","warn",{count:d}));const m=u.filter(e=>e&&(n>e.x0||o>e.y0||e.x1>n+i.width||e.y1>o+i.height)).length;s.push(Sc("geometry.bounds","geometry",0===m,"All bounded marks stay inside the plot.",m+" marks extend outside the plot bounds.","warn",{count:m}));const p=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,h=u.filter(e=>!!e&&(p>e.x1-e.x0||p>e.y1-e.y0)).length;s.push(Sc("interaction.target-size","interaction",0===h,`All bounded targets meet the declared ${p}px minimum.`,`${h} targets are smaller than ${p}px in at least one dimension.`,"warn",{count:h,minimumTarget:p}));const f=c.map(vc),g=f.filter(e=>!e).length,y=new Set,b=f.filter(e=>!(!e||!y.has(e)&&(y.add(e),1)));s.push(Sc("identity.stable-ids","identity",0===g,"Every data-bearing mark exposes a stable id.",g+" data-bearing marks have no pointId, id, or transition key.",t.audit?.requireStableIds?"fail":"warn",{missing:g})),s.push(Sc("identity.unique-ids","identity",0===b.length,"Stable mark ids are unique.",b.length+" duplicate stable ids were observed.","fail",{duplicates:[...new Set(b)].slice(0,10)}));const v=f.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;v>0&&s.push({id:"identity.index-pattern",category:"identity",status:"warn",message:v+" ids look index-derived and may change when data is reordered.",remediation:"Derive ids from a declared identifier role or stable domain key."});const w=new Set;let x=0;const A=e.inputData;for(const e of c){const r=wc(e),i=Array.isArray(r)?r:[r];let n=!1;for(const e of i)if(e&&"object"==typeof e)for(let r=0;A.length>r;r+=1)kc(e,A[r],t,a,A)&&(w.add(r),n=!0);n||(x+=1)}const C=Math.max(0,A.length-w.size);s.push(Sc("coverage.input-data","coverage",0===C,"Every input datum is represented by the observed scene.",C+" input data items have no matching scene mark.",t.audit?.requireDatumCoverage?"fail":"warn",{represented:w.size,input:A.length})),s.push(Sc("coverage.scene-data","coverage",0===x,"Every data-bearing scene mark maps back to input data.",x+" scene marks do not map back to an input datum.","warn",{count:x}));const k=t.encodings?.some(e=>"count"===e.channel);!k&&c.length>w.size&&w.size>0&&s.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});const S=c.filter(e=>!1===e.interactive).length;s.push(Sc("interaction.hit-targets","interaction",0===S&&c.length>0,"Every observed data-bearing scene node participates in hit testing.",0===c.length?"No data-bearing scene nodes were emitted for interaction.":S+" data-bearing marks explicitly disable interaction.","fail"));const P=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),$=P.filter(e=>!y.has(e));s.push(Sc("coverage.annotation-anchors","coverage",0===$.length,P.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",$.length+" annotations point to missing scene ids.","fail",{unresolved:$}));const N=(e.chart?.selectedIds??[]).filter(e=>!y.has(e));e.chart?.selectedIds&&s.push(Sc("interaction.selection-reachability","interaction",0===N.length,"Selected/highlighted states resolve to observed marks.",N.length+" selected ids are not reachable in the scene.","fail",{missing:N}));const M=wr(r),T=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;const r=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return r?ae(r,a,A):void 0}).filter(e=>!!e),I=new Set(M.flatMap(e=>Object.keys(e.values))),R=T.filter(e=>!I.has(e));s.push(Sc("accessibility.table-fields","accessibility",0===R.length,T.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${R.join(", ")}.`,"fail",{expectedFields:T,observedFields:[...I]})),new Set(A.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&2>=I.size&&[...I].every(e=>"category"===e||"value"===e)&&s.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});const D=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);s.push(Sc("accessibility.color-only","accessibility",0===D.length,"Every declared color encoding names a redundant cue.",D.length+" color encodings have no declared redundant cue.","warn"));const E=e.chart;if(E){for(const[e,r]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])r&&s.push(Sc("accessibility."+e,"accessibility","string"==typeof E[e]&&E[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&s.push(Sc("accessibility.fallback-table","accessibility",!1!==E.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),E.navigationTree&&s.push(Sc("accessibility.navigation-depth","accessibility",(E.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}const _=e.theme?.background??"#ffffff",F=r.filter(e=>{const t=e.style?.fill??e.fill;if("string"!=typeof t||!t.startsWith("#")||!_.startsWith("#"))return!1;const r=wa(t,_);return null!=r&&3>r}).length;s.push(Sc("visual.contrast","visual",0===F,"All statically checkable mark fills meet 3:1 contrast.",F+" marks have fill contrast below 3:1.","warn",{background:_}));let j=0;const B=u.filter(e=>!!e).slice(0,500);for(let e=0;B.length>e;e+=1)for(let t=e+1;B.length>t;t+=1).8>Cc(B[e],B[t])||(j+=1);j>B.length&&s.push({id:"visual.overlap-density",category:"visual",status:"warn",message:j+" near-total mark overlaps suggest occlusion or excessive density.",remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});const O=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),z={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map(Ce).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>"table field: "+e.label)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},L=[...s,...O],H=s.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===H,summary:{marks:r.length,passes:L.filter(e=>"pass"===e.status).length,warnings:L.filter(e=>"warn"===e.status).length,failures:H,manual:L.filter(e=>"manual"===e.status).length},declaredSemantics:z,observedSceneEvidence:s,manualATChecks:O}}var $c=new Set;function Nc(e,t,r){return Number.isFinite(e)?Math.max(t,Math.min(r,e)):t}function Mc(e,t){return void 0===e?0:Nc("function"==typeof e?e(t):e,0,5)}function Tc(e){return e?Array.isArray(e)?[...e]:[e]:[]}function Ic(e,t,r){const a={};for(const[r,i]of Object.entries(e.intentScores))a[r]=Mc(i,t);if(r)for(const[e,t]of Object.entries(r))a[e]=Nc((a[e]??0)+t,0,5);return a}function Rc(e,t){if(t.length>0)return t.reduce((t,r)=>t+(e[r]??0),0)/t.length;const r=Object.values(e).filter(e=>"number"==typeof e&&e>0);return r.length?r.reduce((e,t)=>e+t,0)/r.length:0}function Dc(e,t){return{id:`${e.component}:${t.key}`,baseComponent:e.component,label:t.label,intentDeltas:t.intentDeltas,rubricDeltas:t.rubricDeltas,buildProps:r=>e.buildProps(r,t),rationale:t.description??`Registered ${e.component} variant: ${t.label}.`,source:"manual",variantKey:t.key,tags:t.tags}}function Ec(e,t,r){return e.some(e=>e.props?.[t]===r)}var _c=new Set(["BarChart","GroupedBarChart","StackedBarChart","DotPlot"]);var Fc=(e,t,r)=>function(e,t,r){const a=new Map,i=e=>{for(const t of e)t&&t.id&&t.baseComponent&&(a.has(t.id)||a.set(t.id,t))};i(function(e,t,r){const a=r.profile,i=r.existingVariants??t.variants??[],n=Tc(r.intent),o=[];for(const e of i)o.push(Dc(t,e));const s=n.includes("rank")||n.includes("compare-categories");!_c.has(e)||"categorical"!==t.family||Ec(i,"orientation","horizontal")||!s&&6>(a.categoryCount??0)||o.push({id:e+":heuristic-horizontal",baseComponent:e,label:"Horizontal ranked view",intentDeltas:{rank:1,"compare-categories":.5},rubricDeltas:{precision:1},buildProps:e=>({...t.buildProps(e),orientation:"horizontal",sort:"desc"}),rationale:"Horizontal orientation improves label legibility and rank scanning for categorical comparisons.",source:"heuristic",tags:["horizontal","ranked"]});const c=Ec(i,"normalize",!0)||Ec(i,"type","percent")||i.some(e=>/normal|percent/i.test(`${e.key} ${e.label}`));if(/Stacked/.test(e)&&!c&&(n.includes("part-to-whole")||n.includes("composition-over-time"))&&o.push({id:e+":heuristic-normalized",baseComponent:e,label:"Normalized composition",intentDeltas:{"part-to-whole":1,"compare-categories":-.5},rubricDeltas:{precision:-1},buildProps:e=>({...t.buildProps(e),normalize:!0}),rationale:"Normalization emphasizes proportional composition when absolute magnitude is secondary.",source:"heuristic",tags:["normalized","part-to-whole"]}),n.length>0){const t=yo().filter(t=>t.component!==e).filter(e=>null===e.fits(a)).map(e=>{const t=Wi(Ic(e,a),n);return{candidate:e,fit:Rc(t,n),scores:t}}).filter(e=>e.fit>=4).sort((e,t)=>t.fit!==e.fit?t.fit-e.fit:t.candidate.rubric.accuracy!==e.candidate.rubric.accuracy?t.candidate.rubric.accuracy-e.candidate.rubric.accuracy:t.candidate.rubric.familiarity-e.candidate.rubric.familiarity).slice(0,3);for(const{candidate:e,fit:r}of t)o.push({id:`${e.component}:heuristic-${n.join("-")}`,baseComponent:e.component,label:e.component+" alternative",buildProps:t=>e.buildProps(t),rationale:`${e.component} is a strong ${n.join(" + ")} alternative (${r.toFixed(1)}/5) for this data shape.`,source:"heuristic",tags:["cross-family",e.family]})}return o}(e,t,r));for(const a of $c)try{i(a(e,t,r)??[])}catch(e){void 0!==console&&console.warn("[variantDiscovery] proposer threw:",e)}return Array.from(a.values())}(e,t,r),jc=(e,t,r,a={})=>{const i=bo(e.baseComponent);if(!i)return{proposalId:e.id,rejected:!0,fit:0,novelty:1,risk:1,reasons:[`No capability registered for proposed component "${e.baseComponent}".`]};const n=i.fits(t);if(null!==n)return{proposalId:e.id,rejected:!0,fit:0,novelty:"manual"===e.source?.2:.7,risk:1,reasons:["Rejected: "+n]};const o=Tc(a.intent),s=Wi(Ic(i,t,e.intentDeltas),o),c=e.variantKey?i.variants?.find(t=>t.key===e.variantKey):void 0,l=e.buildProps?e.buildProps(t,r):i.buildProps(t,c),u=Po(i,t,l,c);if(u)return{proposalId:e.id,rejected:!0,fit:0,novelty:"manual"===e.source?.2:.7,risk:1,reasons:["Rejected: "+u]};const d=Rc(s,o),m=function(e,t){return t?{familiarity:Math.round(Nc((r={familiarity:e.familiarity+(t.familiarity??0),accuracy:e.accuracy+(t.accuracy??0),precision:e.precision+(t.precision??0)}).familiarity,1,5)),accuracy:Math.round(Nc(r.accuracy,1,5)),precision:Math.round(Nc(r.precision,1,5))}:e;var r}(i.rubric,e.rubricDeltas);let p;const h=r?.receptionModality;h&&"visual"!==h&&(p=xo(Fa(e.baseComponent,l),h));const f=Ao(d,m,e.baseComponent,r,p),g=Nc(f.score,0,5);let y="manual"===e.source?.15:"heuristic"===e.source?.45:.75;a.baselineComponent&&a.baselineComponent!==e.baseComponent&&(y+=.2),e.variantKey||(y+=.05),y=Nc(y,0,1);let b="manual"===e.source?.1:"heuristic"===e.source?.25:.45;0>(e.rubricDeltas?.accuracy??0)&&(b+=.15),0>(e.rubricDeltas?.precision??0)&&(b+=.1),m.accuracy>3||(b+=.1),3>g&&(b+=.2),b=Nc(b,0,1);const v=[];if(e.rationale&&v.push(e.rationale),o.length>0){const e=o.map(e=>`${e}: ${(s[e]??0).toFixed(1)}/5`).join(", ");v.push(`Intent fit — ${e}.`)}else v.push(`Mean non-zero intent fit ${d.toFixed(1)}/5.`);return"manual"!==e.source&&v.push(e.source+" proposal; verify against domain context."),f.appliedReason&&v.push(f.appliedReason),f.receivabilityReason&&v.push(f.receivabilityReason),e.rubricDeltas&&Object.values(e.rubricDeltas).some(e=>0>(e??0))&&v.push("Rubric tradeoff: improves one reading mode while reducing precision or accuracy."),{proposalId:e.id,fit:g,novelty:y,risk:b,reasons:v}};function Bc(e){return $c.add(e),()=>{$c.delete(e)}}function Oc(){return Array.from($c)}function zc(){$c.clear()}import{useCallback as Lc,useEffect as Hc,useMemo as Gc,useState as qc,useSyncExternalStore as Uc}from"react";var Vc={total:0,byType:{},componentsSeen:[],audiencesSeen:[],startedAt:null,lastAt:null,durationMs:0};function Wc(e){if(0===e.length)return Vc;const t={},r=new Set,a=[];let i;for(const n of e){t[n.type]=(t[n.type]??0)+1,n.arcId&&(i=n.arcId);const e="component"in n&&"string"==typeof n.component?n.component:void 0;if(e&&r.add(e),"from"in n&&"string"==typeof n.from&&r.add(n.from),"to"in n&&"string"==typeof n.to&&r.add(n.to),"components"in n&&Array.isArray(n.components))for(const e of n.components)"string"==typeof e&&r.add(e);"audience-set"===n.type&&"string"==typeof n.audience&&a.push(n.audience)}const n=e[0].timestamp,o=e[e.length-1].timestamp;return{total:e.length,byType:t,componentsSeen:Array.from(r),audiencesSeen:a,latestArcId:i,startedAt:n,lastAt:o,durationMs:Math.max(0,o-n)}}function Yc(e={}){const{enableOnMount:t=!0,disableOnUnmount:r=!1,capacity:a,sessionId:i}=e;Hc(()=>(t&&te({capacity:a,sessionId:i}),()=>{r&&ee()}),[t,r,a,i]);const n=Lc(e=>_e(e),[]),o=Lc(()=>ue().getEvents(),[]),s=Uc(n,o,o),[c,l]=qc(()=>ue().enabled),[u,d]=qc(()=>ue().sessionId);Hc(()=>(l(ue().enabled),d(ue().sessionId),_e(()=>{const e=ue();l(e.enabled),d(e.sessionId)})),[]);const m=Gc(()=>Wc(s),[s]),p=Lc(e=>ue().record(e),[]),h=Lc(()=>ue().clear(),[]);return{history:s,summary:m,enabled:c,sessionId:u,record:p,clear:h}}export{s as AccessibleNavTree,Ue as AreaChart,pn as AreaChartCapability,zs as BUILT_IN_AUDIENCES,Yi as BUILT_IN_INTENT_IDS,lt as BarChart,Nn as BarChartCapability,ta as BigNumber,ut as BoxPlot,Ln as BoxPlotCapability,Ve as BubbleChart,bn as BubbleChartCapability,We as BumpChart,hn as BumpChartCapability,cc as CANONICAL_FIXTURES,Ye as CandlestickChart,Cn as CandlestickChartCapability,ur as CategoryColorProvider,Ut as ChainReactionChart,d as ChartContainer,m as ChartGrid,bc as ChartRecipe,St as ChordDiagram,Wn as ChordDiagramCapability,eo as ChoroplethMapCapability,Pt as CirclePack,Zn as CirclePackCapability,Vt as CollisionSwarmChart,Xe as ConnectedScatterplot,yn as ConnectedScatterplotCapability,p as ContextLayout,Wt as CrucibleChart,dr as DEFAULT_LIFECYCLE_THRESHOLDS,Zi as DEFAULT_SCALE_THRESHOLDS,f as DetailsPanel,Qe as DifferenceChart,An as DifferenceChartCapability,ao as DistanceCartogramCapability,dt as DonutChart,Dn as DonutChartCapability,mt as DotPlot,In as DotPlotCapability,Yt as EventDropChart,ro as FlowMapCapability,$t as ForceDirectedGraph,Un as ForceDirectedGraphCapability,pt as FunnelChart,_n as FunnelChartCapability,Xt as GaltonBoardChart,ht as GaugeChart,Fn as GaugeChartCapability,Kt as GauntletChart,ft as GroupedBarChart,Mn as GroupedBarChartCapability,Ze as Heatmap,kn as HeatmapCapability,gt as Histogram,zn as HistogramCapability,b as IntentMark,yt as LikertChart,Bn as LikertChartCapability,Je as LineChart,mn as LineChartCapability,mr as LinkedCharts,et as MinimapChart,xn as MinimapChartCapability,v as MobileAnnotationCalloutList,w as MobileChartContainer,x as MobileStandardControls,tt as MultiAxisLineChart,wn as MultiAxisLineChartCapability,pr as MultiLineTooltip,S as ObservationReadout,Mt as OrbitDiagram,Jn as OrbitDiagramCapability,Qt as PacketFlowChart,Zt as PhysicsCustomChart,vt as PieChart,Rn as PieChartCapability,Jt as ProcessFlowChart,Tt as ProcessSankey,Yn as ProcessSankeyCapability,to as ProportionalSymbolMapCapability,rt as QuadrantChart,vn as QuadrantChartCapability,Ot as RealtimeHeatmap,zt as RealtimeHistogram,Lt as RealtimeLineChart,Ht as RealtimeSwarmChart,Gt as RealtimeWaterfallChart,wt as RidgelinePlot,qn as RidgelinePlotCapability,It as SankeyDiagram,Vn as SankeyDiagramCapability,at as Scatterplot,gn as ScatterplotCapability,it as ScatterplotMatrix,E as SmallMultipleChart,nt as StackedAreaChart,fn as StackedAreaChartCapability,xt as StackedBarChart,Tn as StackedBarChartCapability,At as SwarmPlot,Hn as SwarmPlotCapability,Ct as SwimlaneChart,On as SwimlaneChartCapability,qt as TemporalHistogram,Dr as ThemeProvider,aa as TooltipProvider,Rt as TreeDiagram,Xn as TreeDiagramCapability,Dt as Treemap,Qn as TreemapCapability,er as UnitPileChart,kt as ViolinPlot,Gn as ViolinPlotCapability,ja as accessibilityCaveats,Bs as analystPersona,rr as annotationFreshnessFor,yr as annotationStableId,ar as applyAnnotationLifecycle,ir as applyAnnotationStatus,Ao as applyAudienceBias,un as applyScaleBias,Fa as auditAccessibility,t as auditData,B as auditMobileVisualization,Pc as auditObservedScene,O as auditVisualizationControls,vr as bandFromAge,z as buildNavigationTree,Ko as buildReaderGrounding,L as buildRecipeNavigationTree,Cs as chartGenerationTool,H as clampMobileRange,rn as classifyCardinalityBand,an as classifyFieldBand,tn as classifyRowBand,zc as clearVariantDiscovery,G as communicativeActForIntent,nn as compareBands,nr as computeAnnotationFreshness,cn as computeEffectiveScale,q as configToJSX,U as copyConfig,V as countNodes,Ns as createChartToolHandler,W as createIndexedDBConversationArcSink,Y as createLocalStorageConversationArcSink,vs as createRenderEvidenceMemo,X as createWebhookConversationArcSink,or as currentTimestamp,ss as dataQualityToAnnotations,Os as dataScientistPersona,K as defineChartRecipe,yi as deriveProfileFields,Q as describeChart,Z as describeRecipeChart,J as deserializeSelections,Ma as diagnoseConfig,fa as diagnoseTokenEncoding,Js as diffProfile,ee as disableConversationArc,Co as effectiveFamiliarity,te as enableConversationArc,Xa as evaluateChart,jc as evaluateVariantProposal,js as executivePersona,Eo as explainCapabilityFit,re as exportChart,sr as filterAnnotationsByStatus,ie as flattenVisible,za as formatAccessibilityAudit,r as formatDataAudit,Ya as formatEvaluateChart,ne as formatMobileVisualizationAudit,oe as fromConfig,us as fromDbtArtifacts,ps as fromGreatExpectations,se as fromURL,ce as fromVegaLite,yo as getCapabilities,bo as getCapability,le as getChartRecipe,ue as getConversationArcStore,Gi as getIntent,de as getRecipeLayout,Oc as getRegisteredVariantDiscovery,Us as getStreamCapabilities,Es as inferIntent,he as intentManifestFromRecipe,fe as isJsonSafe,ge as isRegisteredRecipeLayout,ye as listChartRecipes,qi as listIntents,be as loadConversationArc,ve as mobileVisualizationCaveats,ha as normalizeTokenEncoding,xe as observedDatum,As as prepareChart,Bi as profileData,a as profileNumericFields,Fc as proposeVariant,ct as rankBumpData,xo as receivabilityBias,ke as recipeToChartCapability,Se as recordAnnotationStatusChange,Pe as recordAudienceChange,bi as rederiveProfile,xs as refreshChartDiagnostics,fo as registerChartCapability,$e as registerChartRecipe,Ne as registerConversationArcSink,Ui as registerIntent,Me as registerRecipeLayout,Gs as registerStreamChartCapability,Bc as registerVariantDiscovery,fs as repairChartConfig,Te as replayConversationArc,sn as resolveCardinalityToNumber,Ie as resolveChartRecipe,Re as resolveCommunicativeAct,De as resolveRecipeRoleField,Ar as resolveResponsiveRules,on as resolveRowsToNumber,Cr as responsiveRuleMatches,ec as runQualityScorecard,dn as scaleHints,_o as scoreChart,Ee as serializeSelections,ko as stretchFamiliarityCeiling,_e as subscribeToConversationArcChange,Do as suggestCharts,Fo as suggestChartsGrouped,Fs as suggestDashboard,Xs as suggestStreamCharts,_s as suggestStretchCharts,ba as suggestTokenEncoding,Wc as summarizeArc,oi as summarizeData,Fe as summarizeIntentManifest,ks as toAnthropicTool,je as toConfig,n as toDataAuditNotifications,Ka as toEvaluateChartNotifications,$s as toOpenAIResponsesTool,Ss as toOpenAITool,Be as toURL,ya as tokenTaskIntentToCapabilityIntents,go as unregisterChartCapability,Oe as unregisterChartRecipe,ze as unregisterRecipeLayout,qs as unregisterStreamChartCapability,kr as useBrushSelection,Sr as useCategoryColors,ts as useChartFocus,Zo as useChartInterrogation,Pr as useChartObserver,gc as useChartSuggestions,Yc as useConversationArc,$r as useFilteredData,Nr as useLinkedChartsActive,Mr as useLinkedHover,Le as useMobileRangeControls,He as useNavigationSync,Tr as useSelection,Ir as useSelectionActions,Fr as useTheme,Ge as validateChartRecipe,pa as validateProps,cr as withCurrentProvenance,lr as withProvenance,qe as zoomMobileRange};
|