semiotic 3.6.0 → 3.7.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/CLAUDE.md +190 -227
- package/README.md +44 -14
- package/ai/cli.js +41 -0
- package/ai/componentMetadata.cjs +11 -2
- package/ai/dist/mcp-server.js +209 -6
- package/ai/examples.md +98 -0
- package/ai/schema.json +581 -1
- package/ai/system-prompt.md +5 -2
- package/dist/components/AccessibleNavTree.d.ts +25 -0
- package/dist/components/Annotation.d.ts +40 -14
- package/dist/components/ChartContainer.d.ts +32 -2
- package/dist/components/ai/annotationProvenance.d.ts +349 -0
- package/dist/components/ai/audienceProfile.d.ts +60 -3
- package/dist/components/ai/chartCapabilityTypes.d.ts +60 -2
- package/dist/components/ai/chartRoles.d.ts +27 -0
- package/dist/components/ai/conversationArc.d.ts +379 -0
- package/dist/components/ai/dataScaleProfile.d.ts +320 -0
- package/dist/components/ai/describeChart.d.ts +114 -0
- package/dist/components/ai/navigationTree.d.ts +45 -0
- package/dist/components/ai/readerGrounding.d.ts +70 -0
- package/dist/components/ai/suggestCharts.d.ts +34 -1
- package/dist/components/ai/useConversationArc.d.ts +89 -0
- package/dist/components/ai/useNavigationSync.d.ts +61 -0
- package/dist/components/ai/variantDiscovery.d.ts +168 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +3 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +3 -0
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +3 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +3 -0
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +3 -0
- package/dist/components/charts/shared/annotationHierarchy.d.ts +42 -0
- package/dist/components/charts/shared/annotationResolvers.d.ts +3 -2
- package/dist/components/charts/shared/annotationRules.d.ts +16 -0
- package/dist/components/charts/shared/annotationTypes.d.ts +14 -0
- package/dist/components/charts/shared/auditAccessibility.d.ts +90 -0
- package/dist/components/charts/shared/chartSpecs.d.ts +2 -3
- package/dist/components/charts/shared/diagnoseConfig.d.ts +4 -6
- package/dist/components/charts/shared/selectionUtils.d.ts +5 -2
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -0
- package/dist/components/charts/shared/types.d.ts +5 -1
- package/dist/components/charts/value/BigNumber.capability.d.ts +13 -0
- package/dist/components/charts/value/BigNumber.d.ts +14 -0
- package/dist/components/charts/value/formatting.d.ts +40 -0
- package/dist/components/charts/value/thresholdSparkline.d.ts +40 -0
- package/dist/components/charts/value/types.d.ts +292 -0
- package/dist/components/realtime/lifecycleBands.d.ts +44 -0
- package/dist/components/realtime/types.d.ts +23 -8
- package/dist/components/recipes/annotationDensity.d.ts +69 -0
- package/dist/components/recipes/annotationLayout.d.ts +93 -0
- package/dist/components/semiotic-ai.d.ts +38 -15
- package/dist/components/semiotic-realtime.d.ts +2 -0
- package/dist/components/semiotic-recipes.d.ts +4 -0
- package/dist/components/semiotic-utils.d.ts +8 -0
- package/dist/components/semiotic-value.d.ts +55 -0
- package/dist/components/semiotic.d.ts +7 -0
- package/dist/components/server/staticAnnotations.d.ts +2 -0
- package/dist/components/stream/AccessibleDataTable.d.ts +10 -1
- package/dist/components/stream/NetworkSVGOverlay.d.ts +11 -5
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -0
- package/dist/components/stream/SVGOverlay.d.ts +2 -0
- package/dist/components/stream/geoTypes.d.ts +3 -0
- package/dist/components/stream/networkTypes.d.ts +2 -0
- package/dist/components/stream/ordinalTypes.d.ts +2 -0
- package/dist/components/stream/types.d.ts +2 -0
- 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/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +38 -15
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-realtime.d.ts +2 -0
- package/dist/semiotic-recipes.d.ts +4 -0
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.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.d.ts +8 -0
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-value.d.ts +55 -0
- package/dist/semiotic-value.min.js +2 -0
- package/dist/semiotic-value.module.min.js +2 -0
- package/dist/semiotic.d.ts +7 -0
- 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 +18 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const e=require("react/jsx-runtime"),t=require("react");function r(e){if(e&&e.__esModule)return e;const t=Object.create(null);if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}return t.default=e,Object.freeze(t)}const o=r(t);function n(e,t){const r=new EventTarget;let o=Object.assign(Object.assign({},e(function(e){o=Object.assign(Object.assign({},o),e(o)),r.dispatchEvent(new Event("update"))})),null!=t?t:{});return{getState:()=>o,subscribe:function(e){return r.addEventListener("update",e),()=>r.removeEventListener("update",e)}}}function a(e){if(!e.accessibility)return e;let t=e;if(e.accessibility.colorBlindSafe&&(t=Object.assign(Object.assign({},t),{colors:Object.assign(Object.assign({},t.colors),{categorical:s})})),e.accessibility.highContrast){const e="dark"===t.mode;t=Object.assign(Object.assign({},t),{colors:Object.assign(Object.assign({},t.colors),{text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"})})}return t}const s=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],i={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:10}},c={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:10}},l={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:s,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"};function u(e,t){if("light"===t)return i;if("dark"===t)return c;if("high-contrast"===t)return l;if("string"==typeof t)return void 0!==console&&console.warn(`[ThemeStore] Unknown theme preset "${t}". Keeping current theme.`),e;if(t.mode&&"auto"!==t.mode){const e="dark"===t.mode?c:i;return a(Object.assign(Object.assign(Object.assign({},e),t),{colors:Object.assign(Object.assign({},e.colors),t.colors||{}),typography:Object.assign(Object.assign({},e.typography),t.typography||{})}))}return a(Object.assign(Object.assign(Object.assign({},e),t),{colors:Object.assign(Object.assign({},e.colors),t.colors||{}),typography:Object.assign(Object.assign({},e.typography),t.typography||{})}))}const[p,d]=function(r){let o=null;const a=()=>(o||(o=t.createContext(null)),o),s=n(r);return[function({children:o,initialState:s}){const i=t.useRef(s),c=t.useMemo(()=>n(r,i.current),[]),l=a();return e.jsx(l.Provider,{value:c,children:o})},e=>{var r;const o=a(),n=null!==(r=t.useContext(o))&&void 0!==r?r:s,i=t.useRef(e);i.current=e;const c=t.useCallback(()=>i.current(n.getState()),[n]),l=t.useCallback(()=>i.current(n.getState()),[n]);return t.useSyncExternalStore(n.subscribe,c,l)}]}(e=>({theme:i,setTheme(t){e(e=>({theme:u(e.theme,t)}))}})),y={light:i,dark:c,"high-contrast":l,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#8b7355",grid:"#e8d5c4",border:"#e8d5c4",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#7f8c9b",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:10,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#c05050",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#e45050",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:10,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#8b5cf6",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:10},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}};function f(e){return y[e]}function g(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const r=e;return r.addListener(t),()=>r.removeListener(t)}function b(e){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(e).matches}const h=o.createContext(void 0),m="undefined"==typeof window?o.useEffect:o.useLayoutEffect;function v(e){if("string"!=typeof e)return e;if("light"===e||"dark"===e||"high-contrast"===e)return e;return f(e)||(void 0!==console&&console.warn(`[ThemeProvider] Unknown theme preset "${e}". Falling back to light theme.`),"light")}function A({theme:e}){const t=d(e=>e.setTheme),r=d(e=>e.theme),n=o.useRef(r);n.current=r;const a=o.useRef(null);o.useEffect(()=>{if(void 0!==e)return;if("undefined"==typeof window||!window.matchMedia)return;const r=window.matchMedia("(forced-colors: active)");return r.matches&&(a.current=n.current===l?i:n.current,t("high-contrast")),g(r,e=>{var r,o;e.matches?(a.current=n.current===l?null!==(r=a.current)&&void 0!==r?r:i:n.current,t("high-contrast")):(function(e,t){e(t===i?"light":t===c?"dark":t===l?"high-contrast":t)}(t,null!==(o=a.current)&&void 0!==o?o:i),a.current=null)})},[e,t]);const s=o.useRef(!1);return m(()=>{s.current?void 0!==e&&t(v(e)):s.current=!0},[e,t]),null}function x({children:t}){var r,n,a,s,i;const c=d(e=>e.theme),l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({position:"relative","--semiotic-bg":c.colors.background,"--semiotic-text":c.colors.text,"--semiotic-text-secondary":c.colors.textSecondary,"--semiotic-grid":c.colors.grid,"--semiotic-border":c.colors.border,"--semiotic-cell-border":c.colors.cellBorder||c.colors.border,"--semiotic-primary":c.colors.primary,"--semiotic-font-family":c.typography.fontFamily},c.colors.focus?{"--semiotic-focus":c.colors.focus}:{}),(null===(r=c.tooltip)||void 0===r?void 0:r.background)?{"--semiotic-tooltip-bg":c.tooltip.background}:{}),(null===(n=c.tooltip)||void 0===n?void 0:n.text)?{"--semiotic-tooltip-text":c.tooltip.text}:{}),(null===(a=c.tooltip)||void 0===a?void 0:a.borderRadius)?{"--semiotic-tooltip-radius":c.tooltip.borderRadius}:{}),(null===(s=c.tooltip)||void 0===s?void 0:s.fontSize)?{"--semiotic-tooltip-font-size":c.tooltip.fontSize}:{}),(null===(i=c.tooltip)||void 0===i?void 0:i.shadow)?{"--semiotic-tooltip-shadow":c.tooltip.shadow}:{}),c.borderRadius?{"--semiotic-border-radius":c.borderRadius}:{}),c.colors.selection?{"--semiotic-selection-color":c.colors.selection}:{}),null!=c.colors.selectionOpacity?{"--semiotic-selection-opacity":c.colors.selectionOpacity+""}:{}),c.colors.diverging?{"--semiotic-diverging":c.colors.diverging}:{}),c.colors.annotation?{"--semiotic-annotation-color":c.colors.annotation}:{}),null!=c.typography.legendSize?{"--semiotic-legend-font-size":c.typography.legendSize+"px"}:{}),null!=c.typography.titleFontSize?{"--semiotic-title-font-size":c.typography.titleFontSize+"px"}:{}),null!=c.typography.tickFontFamily?{"--semiotic-tick-font-family":c.typography.tickFontFamily}:{}),null!=c.typography.tickSize?{"--semiotic-tick-font-size":c.typography.tickSize+"px"}:{}),null!=c.typography.labelSize?{"--semiotic-axis-label-font-size":c.typography.labelSize+"px"}:{}),{"--semiotic-secondary":c.colors.secondary||c.colors.primary,"--semiotic-surface":c.colors.surface||c.colors.background}),c.colors.success?{"--semiotic-success":c.colors.success}:{}),c.colors.danger?{"--semiotic-danger":c.colors.danger}:{}),c.colors.warning?{"--semiotic-warning":c.colors.warning}:{}),c.colors.error?{"--semiotic-error":c.colors.error}:{}),c.colors.info?{"--semiotic-info":c.colors.info}:{}),u=o.useContext(h),p={};return u&&(p["data-semiotic-theme"]=u),e.jsx("div",Object.assign({style:l},p,{children:t}))}const S=864e5;function j(e){return 10>e?"0"+e:e+""}const w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];let O=null;function k(e,t){const r=e.length,o=t.length,n=Array(o+1);for(let e=0;o>=e;e++)n[e]=e;for(let a=1;r>=a;a++){let r=n[0];n[0]=a;for(let s=1;o>=s;s++){const o=n[s];n[s]=e[a-1]===t[s-1]?r:1+Math.min(r,n[s],n[s-1]),r=o}}return n[o]}function $(e,t,r=3){let o,n=r+1;for(const r of t){const t=k(e.toLowerCase(),r.toLowerCase());n>t&&(n=t,o=r)}return n>r?void 0:o}function z(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:e}function C(e,t){var r;if(0===t.length)return null;const o=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(o)||o.includes(e.toLowerCase()))||(null!==(r=$(e,t,3))&&void 0!==r?r:null)}const R={width:{type:"number"},height:{type:"number"},margin:{type:"object"},className:{type:"string"},title:{type:"string"},enableHover:{type:"boolean"},showLegend:{type:"boolean"},showGrid:{type:"boolean"},colorBy:{type:["string","function"]},colorScheme:{type:["string","array"]},tooltip:{type:["boolean","function","object"]},annotations:{type:"array"},axisExtent:{type:"string",enum:["nice","exact"]},frameProps:{type:"object"},onClick:{type:"function"}},_={xLabel:{type:"string"},yLabel:{type:"string"},xFormat:{type:"function"},yFormat:{type:"function"}},T={categoryLabel:{type:"string"},valueLabel:{type:"string"},valueFormat:{type:"function"},categoryFormat:{type:"function"}},F=["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],L=["vertical","horizontal"],P={LineChart:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},lineBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:F},lineWidth:{type:"number"},showPoints:{type:"boolean"},pointRadius:{type:"number"},fillArea:{type:"boolean"},areaOpacity:{type:"number"},forecast:{type:"object"},anomaly:{type:"object"},band:{type:["object","array"]}})},AreaChart:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},areaBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:F},gradientFill:{type:["boolean","object"]},semanticGradient:{type:"array"},areaOpacity:{type:"number"},showLine:{type:"boolean"},lineWidth:{type:"number"},forecast:{type:"object"},anomaly:{type:"object"},band:{type:["object","array"]}})},DifferenceChart:{required:[],dataShape:"array",dataAccessors:["xAccessor","seriesAAccessor","seriesBAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},seriesAAccessor:{type:["string","function"]},seriesBAccessor:{type:["string","function"]},seriesALabel:{type:"string"},seriesBLabel:{type:"string"},seriesAColor:{type:"string"},seriesBColor:{type:"string"},showLines:{type:"boolean"},lineWidth:{type:"number"},showPoints:{type:"boolean"},pointRadius:{type:"number"},curve:{type:"string",enum:F},areaOpacity:{type:"number"},gradientFill:{type:["boolean","object"]},xExtent:{type:"array"},yExtent:{type:"array"},pointIdAccessor:{type:["string","function"]},windowSize:{type:"number"}})},StackedAreaChart:{required:["data","areaBy"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},areaBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:F},areaOpacity:{type:"number"},showLine:{type:"boolean"},lineWidth:{type:"number"},normalize:{type:"boolean"}})},Scatterplot:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"},regression:{type:["boolean","string","object"]},forecast:{type:"object"},anomaly:{type:"object"}})},BubbleChart:{required:["data","sizeBy"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},bubbleOpacity:{type:"number"},bubbleStrokeWidth:{type:"number"},bubbleStrokeColor:{type:"string"},regression:{type:["boolean","string","object"]}})},Heatmap:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},colorScheme:{type:"string",enum:["blues","reds","greens","viridis","custom"]},customColorScale:{type:["object","function"]},showValues:{type:"boolean"},valueFormat:{type:"function"},cellBorderColor:{type:"string"},cellBorderWidth:{type:"number"},showLegend:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},QuadrantChart:{required:[],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},quadrants:{type:"object"},xCenter:{type:"number"},yCenter:{type:"number"},centerlineStyle:{type:"object"},showQuadrantLabels:{type:"boolean"},quadrantLabelSize:{type:"number"},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"}})},MultiAxisLineChart:{required:["series"],dataShape:"array",dataAccessors:["xAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},series:{type:"array"},colorScheme:{type:["string","array"]},curve:{type:"string"},lineWidth:{type:"number"},annotations:{type:"array"}})},CandlestickChart:{required:["highAccessor","lowAccessor"],dataShape:"array",dataAccessors:["xAccessor","highAccessor","lowAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},highAccessor:{type:["string","function"]},lowAccessor:{type:["string","function"]},openAccessor:{type:["string","function"]},closeAccessor:{type:["string","function"]},candlestickStyle:{type:"object"},mode:{type:"string",enum:["primary","context","sparkline"]},annotations:{type:"array"}})},ConnectedScatterplot:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),_),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},orderAccessor:{type:["string","function"]},orderLabel:{type:"string"},pointRadius:{type:"number"},pointIdAccessor:{type:["string","function"]},annotations:{type:"array"},regression:{type:["boolean","string","object"]},forecast:{type:"object"},anomaly:{type:"object"}})},BarChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:L},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"},regression:{type:["boolean","string","object"]}})},StackedBarChart:{required:["data","stackBy"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},stackBy:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:L},normalize:{type:"boolean"},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"}})},LikertChart:{required:[],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},levelAccessor:{type:["string","function"]},countAccessor:{type:["string","function"]},levels:{type:"array"},orientation:{type:"string",enum:L},barPadding:{type:"number"}})},GroupedBarChart:{required:["data","groupBy"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},groupBy:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:L},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"}})},SwarmPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:L},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},BoxPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:L},showOutliers:{type:"boolean"},outlierRadius:{type:"number"},categoryPadding:{type:"number"}})},Histogram:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},bins:{type:"number"},relative:{type:"boolean"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},ViolinPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:L},bins:{type:"number"},curve:{type:"string"},showIQR:{type:"boolean"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},RidgelinePlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},bins:{type:"number"},amplitude:{type:"number"},categoryPadding:{type:"number"}})},DotPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:L},sort:{type:["boolean","string","function"]},dotRadius:{type:"number"},categoryPadding:{type:"number"},regression:{type:["boolean","string","object"]}})},PieChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign({},R),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},startAngle:{type:"number"},cornerRadius:{type:"number"}})},DonutChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign({},R),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},innerRadius:{type:"number"},centerContent:{type:["object","string","number"]},startAngle:{type:"number"},cornerRadius:{type:"number"}})},GaugeChart:{required:["value"],dataShape:"none",dataAccessors:[],props:Object.assign(Object.assign({},R),{value:{type:"number"},min:{type:"number"},max:{type:"number"},thresholds:{type:"array"},gradientFill:{type:"object"},arcWidth:{type:"number"},cornerRadius:{type:"number"},sweep:{type:"number"},fillZones:{type:"boolean"},showNeedle:{type:"boolean"},needleColor:{type:"string"},color:{type:"string"},centerContent:{type:["object","string","number","function"]},valueFormat:{type:"function"},showScaleLabels:{type:"boolean"},backgroundColor:{type:"string"}})},FunnelChart:{required:["data"],dataShape:"array",dataAccessors:["stepAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},stepAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},orientation:{type:"string",enum:["horizontal","vertical"]},connectorOpacity:{type:"number"},showCategoryTicks:{type:"boolean"},responsiveWidth:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},SwimlaneChart:{required:["subcategoryAccessor"],dataShape:"array",dataAccessors:["categoryAccessor","subcategoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),T),{data:{type:"array"},categoryAccessor:{type:["string","function"]},subcategoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:["horizontal","vertical"]},barPadding:{type:"number"},roundedTop:{type:"number"},showCategoryTicks:{type:"boolean"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]},responsiveWidth:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},ForceDirectedGraph:{required:["nodes","edges"],dataShape:"network",dataAccessors:["nodeIDAccessor","sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},R),{nodes:{type:"array"},edges:{type:"array"},nodeIDAccessor:{type:["string","function"]},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},nodeLabel:{type:["string","function"]},nodeSize:{type:["number","string","function"]},nodeSizeRange:{type:"array"},edgeWidth:{type:["number","string","function"]},edgeColor:{type:"string"},edgeOpacity:{type:"number"},iterations:{type:"number"},forceStrength:{type:"number"},showLabels:{type:"boolean"}})},SankeyDiagram:{required:["edges"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},R),{nodes:{type:"array"},edges:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},edgeColorBy:{type:["string","function"],enum:["source","target","gradient"]},orientation:{type:"string",enum:L},nodeAlign:{type:"string",enum:["justify","left","right","center"]},nodePaddingRatio:{type:"number"},nodeWidth:{type:"number"},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},edgeOpacity:{type:"number"},edgeSort:{type:"function"}})},ProcessSankey:{required:["domain"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},R),{nodes:{type:"array"},edges:{type:"array"},domain:{type:"array"},axisTicks:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},startTimeAccessor:{type:["string","function"]},endTimeAccessor:{type:["string","function"]},xExtentAccessor:{type:["string","function"]},edgeIdAccessor:{type:["string","function"]},legendPosition:{type:"string",enum:["right","left","top","bottom"]},pairing:{type:"string",enum:["value","temporal"]},packing:{type:"string",enum:["off","reuse"]},laneOrder:{type:"string",enum:["insertion","crossing-min","inside-out","crossing-min+inside-out"]},ribbonLane:{type:"string",enum:["source","target","both"]},lifetimeMode:{type:"string",enum:["full","half"]},showLaneRails:{type:"boolean"},showQualityReadout:{type:"boolean"},edgeOpacity:{type:"number"},timeFormat:{type:"function"},valueFormat:{type:"function"},showParticles:{type:"boolean"},particleStyle:{type:"object"}})},ChordDiagram:{required:["edges"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},R),{nodes:{type:"array"},edges:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},edgeColorBy:{type:["string","function"],enum:["source","target"]},padAngle:{type:"number"},groupWidth:{type:"number"},sortGroups:{type:"function"},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},edgeOpacity:{type:"number"}})},TreeDiagram:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"object"},layout:{type:"string",enum:["tree","cluster","partition","treemap","circlepack"]},orientation:{type:"string",enum:["vertical","horizontal","radial"]},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},edgeStyle:{type:"string",enum:["line","curve"]},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},nodeSize:{type:"number"}})},Treemap:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"object"},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},showLabels:{type:"boolean"},nodeLabel:{type:["string","function"]},nodeStyle:{type:"function"}})},CirclePack:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"object"},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},showLabels:{type:"boolean"},nodeLabel:{type:["string","function"]},circleOpacity:{type:"number"}})},OrbitDiagram:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"object"},childrenAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},orbitMode:{type:["string","array"]},speed:{type:"number"},revolution:{type:"function"},eccentricity:{type:["number","function"]},orbitSize:{type:["number","function"]},nodeRadius:{type:["number","function"]},showRings:{type:"boolean"},showLabels:{type:"boolean"},animated:{type:"boolean"},colorByDepth:{type:"boolean"},annotations:{type:"array"},foregroundGraphics:{type:"object"}})},RealtimeLineChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},stroke:{type:"string"},strokeWidth:{type:"number"},strokeDasharray:{type:"string"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeHistogram:{required:["binSize"],dataShape:"realtime",dataAccessors:[],props:{binSize:{type:"number"},direction:{type:"string",enum:["up","down"]},size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},fill:{type:"string"},stroke:{type:"string"},strokeWidth:{type:"number"},gap:{type:"number"},brush:{type:["boolean","string","object"]},onBrush:{type:"function"},linkedBrush:{type:["string","object"]},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},TemporalHistogram:{required:["data","binSize"],dataShape:"array",dataAccessors:["timeAccessor","valueAccessor","categoryAccessor"],props:{data:{type:"array"},binSize:{type:"number"},direction:{type:"string",enum:["up","down"]},size:{type:"array"},width:{type:"number"},height:{type:"number"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},fill:{type:"string"},stroke:{type:"string"},strokeWidth:{type:"number"},gap:{type:"number"},linkedHover:{type:["boolean","string","object"]},brush:{type:["boolean","string","object"]},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}}},RealtimeSwarmChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},radius:{type:"number"},fill:{type:"string"},opacity:{type:"number"},stroke:{type:"string"},strokeWidth:{type:"number"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeWaterfallChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},positiveColor:{type:"string"},negativeColor:{type:"string"},connectorStroke:{type:"string"},connectorWidth:{type:"number"},gap:{type:"number"},stroke:{type:"string"},strokeWidth:{type:"number"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeHeatmap:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},heatmapXBins:{type:"number"},heatmapYBins:{type:"number"},aggregation:{type:"string",enum:["count","sum","mean"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"}}},ScatterplotMatrix:{required:["data","fields"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"array"},fields:{type:"array"}})},MinimapChart:{required:["data"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"array"}})},ChoroplethMap:{required:["areas"],dataShape:"array",dataAccessors:["valueAccessor"],props:Object.assign(Object.assign({},R),{areas:{type:["array","string"]},valueAccessor:{type:["string","function"]},colorScheme:{type:["string","array"]},projection:{type:"string"}})},ProportionalSymbolMap:{required:["points"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign({},R),{points:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},areas:{type:["array","string"]}})},FlowMap:{required:["flows"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},R),{flows:{type:"array"},nodes:{type:"array"},valueAccessor:{type:["string","function"]},lineIdAccessor:{type:["string","function"]}})},DistanceCartogram:{required:["points"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},R),{points:{type:"array"},center:{type:"array"},costAccessor:{type:["string","function"]}})}};function B(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}function M(e,t){const r=[],o=P[e];if(!o)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(P).join(", ")}`]};for(const n of o.required)null==t[n]&&r.push(`"${n}" is required for ${e}.`);for(const[e,n]of Object.entries(t)){if(null==n)continue;const t=o.props[e];if(t){if(!B(n,t.type)){const o=Array.isArray(t.type)?t.type.join(" | "):t.type;r.push(`"${e}" should be ${o}, got ${Array.isArray(n)?"array":typeof n}.`);continue}t.enum&&"string"==typeof n&&!t.enum.includes(n)&&r.push(`"${e}" value "${n}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const n=Object.keys(o.props),a=new Set(n);for(const o of Object.keys(t))if(void 0!==t[o]&&!a.has(o)){const t=$(o,n),a=t?`Unknown prop "${o}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${o}" for ${e}. Valid props: ${n.join(", ")}.`;r.push(a)}if("array"===o.dataShape){const n=t.data,a={};for(const e of o.dataAccessors){const r=t[e];"string"==typeof r&&(a[e]=r)}const s=function({componentName:e,data:t,accessors:r,requiredProps:o}){if(o)for(const[t,r]of Object.entries(o))if(null==r)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(r){const o=z(t).find(e=>e&&"object"==typeof e);if(o){const t=Object.keys(o);for(const[n,a]of Object.entries(r))if(a&&"string"==typeof a&&!(a in o)){const r=C(a,t),o=r?` Try ${n}="${r}".`:"";return`${e}: ${n} "${a}" not found in data. Available fields: ${t.join(", ")}.${o}`}}}return null}({componentName:e,data:n,accessors:Object.keys(a).length>0?a:void 0});s&&r.push(s)}else if("object"===o.dataShape){const o=function({componentName:e,data:t,dataLabel:r="data"}){return null==t?`${e}: No ${r} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${r} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}({componentName:e,data:t.data});o&&r.push(o)}else if("network"===o.dataShape){const n=function({componentName:e,nodes:t,edges:r,nodesRequired:o=!1,edgesRequired:n=!0,accessors:a}){if(null==t&&null==r)return null;if(n&&(!r||!Array.isArray(r)||0===r.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(o&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(a&&t&&t.length>0){const r=z(t).find(e=>e&&"object"==typeof e);if(r){const t=Object.keys(r);for(const[o,n]of Object.entries(a))if(n&&"string"==typeof n&&!(n in r)){const r=C(n,t),a=r?` Try ${o}="${r}".`:"";return`${e}: ${o} "${n}" not found in node data. Available fields: ${t.join(", ")}.${a}`}}}return null}({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:o.required.includes("nodes"),edgesRequired:o.required.includes("edges")});n&&r.push(n)}return{valid:0===r.length,errors:r}}const E=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),I=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),N=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),q=new Set(["LineChart","AreaChart","StackedAreaChart"]),D=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]);function H(e){const t=e.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!t)return null;const[r,o,n]=[parseInt(t[1],16)/255,parseInt(t[2],16)/255,parseInt(t[3],16)/255],a=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*a(r)+.7152*a(o)+.0722*a(n)}function U(e,t){const r=H(e),o=H(t);return null===r||null===o?null:(Math.max(r,o)+.05)/(Math.min(r,o)+.05)}const G=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIDAccessor","childrenAccessor","costAccessor"];function W(e,t,r,o){return new(r||(r=Promise))(function(n,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function i(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,i)}c((o=o.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const V=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend"]),J=new Set(["data","nodes","edges"]),Y="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function X(e){const{component:t,props:r}=e,o=["<"+t];for(const[e,t]of Object.entries(r))if("string"==typeof t)o.push(` ${e}="${t}"`);else if("boolean"==typeof t&&!0===t)o.push(" "+e);else if("boolean"==typeof t&&!1===t)o.push(` ${e}={false}`);else if("number"==typeof t)o.push(` ${e}={${t}}`);else{const r=JSON.stringify(t);o.push(80>r.length?` ${e}={${r}}`:` ${e}={${JSON.stringify(t,null,2)}}`)}return o.push("/>"),o.join("\n")}function K(e,t){var r;const o=e.children,n=t.children,a=window.getComputedStyle(e),s=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of s){const o=a.getPropertyValue(e);o&&"none"!==o&&""!==o&&(null===(r=t.style)||void 0===r||r.setProperty(e,o))}for(let e=0;Math.min(o.length,n.length)>e;e++)K(o[e],n[e])}function Q(e,t){const r=URL.createObjectURL(e),o=document.createElement("a");o.href=r,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}function Z(e){return"nominal"===e||"ordinal"===e}function ee(e){return"quantitative"===e||"temporal"===e}const te={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},re={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},oe={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function ne(e,t,r,o,n){var a,s;(null==e?void 0:e.field)&&(r.xAccessor=o?"value":e.field),(null==t?void 0:t.field)&&(r.yAccessor=n?"value":t.field),(null===(a=null==e?void 0:e.axis)||void 0===a?void 0:a.title)&&(r.xLabel=e.axis.title),(null===(s=null==t?void 0:t.axis)||void 0===s?void 0:s.title)&&(r.yLabel=t.axis.title)}function ae(e,t,r){const o={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(r.length>0){o.warnings=r;for(const e of r)console.warn("[semiotic/fromVegaLite] "+e)}return o}class se{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const r of e){const e=this.push(r);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)e(this.buffer[(t+r)%this._capacity],r)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)e[r]=this.buffer[(t+r)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray(),r=[];for(;t.length>e;)r.push(t.shift());this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(const e of t)this.push(e);return r}update(e,t){const r=[],o=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++){const a=(o+n)%this._capacity,s=this.buffer[a];if(e(s)){let e;e="object"!=typeof s||null===s?s:Array.isArray(s)?[...s]:Object.assign({},s),r.push(e),this.buffer[a]=t(s)}}return r}remove(e){const t=[],r=[];if(this.forEach(o=>{e(o)?r.push(o):t.push(o)}),0===r.length)return r;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return r}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}}const ie={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function ce(e,t){return"function"==typeof t?t(e):e[t]}function le(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}return e instanceof Date?e.toLocaleDateString():"object"==typeof e&&null!==e?void 0!==e.id?e.id+"":void 0!==e.name?e.name+"":JSON.stringify(e):e+""}function ue(t={}){const{fields:r,title:o,format:n,style:a={},className:s=""}=t;return t=>{if(!t||"object"!=typeof t)return null;let i;const c=[];if(o){const e=ce(t,o);i=le(e,n)}if(r&&r.length>0)r.forEach(e=>{let r,o,a;"string"==typeof e?(r=e,o=e,a=n):(r=e.label,o=e.accessor||e.key||"",a=e.format||n);const s=ce(t,o);c.push({label:r,value:le(s,a)})});else if(!o){const e=["value","y","name","id","label"];for(const r of e)if(void 0!==t[r]){i=le(t[r],n);break}if(!i){const e=Object.keys(t).filter(e=>!e.startsWith("_"));e.length>0&&(i=le(t[e[0]],n))}}const l=Object.assign(Object.assign({},ie),a);return e.jsxs("div",{className:("semiotic-tooltip "+s).trim(),style:l,children:[i&&e.jsx("div",{style:{fontWeight:c.length>0?"bold":"normal"},children:i}),c.map((t,r)=>e.jsxs("div",{style:{marginTop:0===r&&i?"4px":0},children:[t.label&&e.jsxs("span",{children:[t.label,": "]}),t.value]},r))]})}}function pe(e=240){const t=360-e,r=180+t/2,o=r*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:r,startAngleRad:o,offsetRad:-Math.PI/2+o}}const de=Symbol("semiotic.useStreamStatus.wrapped");exports.CARBON_ALERT={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},exports.CARBON_CATEGORICAL_14=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],exports.COLOR_BLIND_SAFE_CATEGORICAL=s,exports.DARK_THEME=c,exports.HIGH_CONTRAST_THEME=l,exports.IncrementalExtent=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const r of e){const e=t?t(r):r;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},exports.LIGHT_THEME=i,exports.MultiPointTooltip=function(){return t=>{var r,o,n,a,s,i,c;const l=t.allSeries;if(!l||0===l.length){const a=null!==(o=null===(r=t.data)||void 0===r?void 0:r.value)&&void 0!==o?o:null===(n=t.data)||void 0===n?void 0:n.y;return e.jsx("div",{className:"semiotic-tooltip",style:ie,children:e.jsx("div",{children:le(a)})})}const u=null!==(i=null!==(a=t.xValue)&&void 0!==a?a:null===(s=t.data)||void 0===s?void 0:s.time)&&void 0!==i?i:null===(c=t.data)||void 0===c?void 0:c.x;return e.jsxs("div",{className:"semiotic-tooltip",style:ie,children:[null!=u&&e.jsx("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:le(u)}),l.map((t,r)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:t.color,flexShrink:0}}),e.jsx("span",{style:{flex:1,fontSize:"0.85em"},children:t.group}),e.jsx("span",{style:{fontWeight:500,fontSize:"0.85em"},children:le(t.value)})]},r))]})}},exports.RingBuffer=se,exports.THEME_PRESETS=y,exports.ThemeProvider=function({theme:t,children:r}){const n="string"==typeof t&&f(t)?t:void 0,a=o.useMemo(()=>function(e){return void 0!==e?u(i,v(e)):"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(forced-colors: active)").matches?l:i}(t),[t]);return e.jsx(p,{initialState:{theme:a},children:e.jsxs(h.Provider,{value:n,children:[e.jsx(A,{theme:t}),e.jsx(x,{children:r})]})})},exports.adaptiveTimeTicks=function(e){let t,r=e;return(o,n,a)=>{const s=o instanceof Date?o:new Date(o);e||!a||2>a.length||a===t||(t=a,r=function(e){if(2>e.length)return"days";const t=[];for(let r=1;e.length>r;r++)t.push(e[r]-e[r-1]);t.sort((e,t)=>e-t);const r=t[Math.floor(t.length/2)];return 12e4>r?"seconds":72e5>r?"minutes":2*S>r?"hours":60*S>r?"days":400*S>r?"months":"years"}(a));const i=r||"days";return null!=n&&0!==n&&a&&0!==a.length?function(e,t,r){const o=e.getUTCFullYear()!==t.getUTCFullYear(),n=o||e.getUTCMonth()!==t.getUTCMonth(),a=n||e.getUTCDate()!==t.getUTCDate(),s=a||e.getUTCHours()!==t.getUTCHours(),i=s||e.getUTCMinutes()!==t.getUTCMinutes(),c=w[e.getUTCMonth()],l=e.getUTCDate(),u=e.getUTCFullYear(),p=j(e.getUTCHours()),d=j(e.getUTCMinutes()),y=j(e.getUTCSeconds());switch(r){case"seconds":return o?`${c} ${l}, ${u} ${p}:${d}:${y}`:a?`${c} ${l} ${p}:${d}:${y}`:s?`${p}:${d}:${y}`:i?`${d}:${y}`:":"+y;case"minutes":return o?`${c} ${l}, ${u} ${p}:${d}`:a?`${c} ${l} ${p}:${d}`:s?`${p}:${d}`:":"+d;case"hours":return o?`${c} ${l}, ${u} ${p}:00`:n?`${c} ${l} ${p}:${d}`:a?`${c} ${l} ${p}:00`:p+":00";case"days":return o?`${c} ${l}, ${u}`:n?`${c} ${l}`:""+l;case"months":return o?`${c} ${u}`:""+c;case"years":return""+u}}(s,new Date(a[n-1]),i):function(e,t){const r=w[e.getUTCMonth()],o=e.getUTCDate(),n=e.getUTCFullYear(),a=j(e.getUTCHours()),s=j(e.getUTCMinutes()),i=j(e.getUTCSeconds());switch(t){case"seconds":return`${r} ${o}, ${n} ${a}:${s}:${i}`;case"minutes":case"hours":return`${r} ${o}, ${n} ${a}:${s}`;case"days":return`${r} ${o}, ${n}`;case"months":return`${r} ${n}`;case"years":return""+n}}(s,i)}},exports.computeArcBoundingBox=function(e=240){const{sweepRad:t,offsetRad:r}=pe(e),o=[[Math.cos(r),Math.sin(r)],[Math.cos(r+t),Math.sin(r+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||o.push([Math.cos(e),Math.sin(e)]);const n=o.map(e=>e[0]),a=o.map(e=>e[1]),s=Math.min(...n),i=Math.max(...n),c=Math.min(...a),l=Math.max(...a);return{minX:s,maxX:i,minY:c,maxY:l,width:i-s,height:l-c,cx:(s+i)/2,cy:(c+l)/2}},exports.configToJSX=X,exports.copyConfig=function(e){return W(this,arguments,void 0,function*(e,t="json"){const r="jsx"===t?X(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");yield navigator.clipboard.writeText(r)})},exports.createHatchPattern=function(e={},t){const{background:r="transparent",stroke:o="#000",lineWidth:n=1.5,spacing:a=6,angle:s=45}=e,i=Math.max(8,Math.ceil(2*a));let c;try{c=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(O||(O=document.createElement("canvas")),O.width=e,O.height=e,O)}(i)}catch(e){return null}const l=c.getContext("2d");if(!l)return null;r&&"transparent"!==r?(l.fillStyle=r,l.fillRect(0,0,i,i)):l.clearRect(0,0,i,i),l.strokeStyle=o,l.lineWidth=n,l.lineCap="square";const u=s*Math.PI/180;if(45===s||-45===s){const e=s>0?1:-1;for(let t=-i;2*i>=t;t+=a)l.beginPath(),l.moveTo(t,0),l.lineTo(t+e*i,i),l.stroke()}else{l.save(),l.translate(i/2,i/2),l.rotate(u);const e=2*i;for(let t=-e;e>=t;t+=a)l.beginPath(),l.moveTo(-e,t),l.lineTo(e,t),l.stroke();l.restore()}return(t||l).createPattern(c,"repeat")},exports.darkenColor=function(e,t=.5){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;const o=Math.round(parseInt(r[1],16)*(1-t)),n=Math.round(parseInt(r[2],16)*(1-t)),a=Math.round(parseInt(r[3],16)*(1-t));return`#${o.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}`},exports.deserializeSelections=function(e){const t=new Map;for(const[r,o]of Object.entries(e)){const e=new Map;for(const t of o.clauses){const r={};for(const[e,o]of Object.entries(t.fields))r[e]="point"===o.type?{type:"point",values:new Set(o.values)}:{type:"interval",range:o.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:r})}t.set(r,{name:o.name,resolution:o.resolution,clauses:e})}return t},exports.diagnoseConfig=function(e,t){const r=[],o=M(e,t);for(const e of o.errors)r.push({severity:"error",code:"VALIDATION",message:e,fix:""});return P[e]?(function(e,t,r){const o=P[e];if(o){if("array"===o.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"===o.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,t,r),function(e,t,r){const o=t.width,n=t.height;if(void 0===o||"number"==typeof o&&o>0||r.push({severity:"error",code:"BAD_WIDTH",message:`width=${JSON.stringify(o)} — chart needs a positive number.`,fix:"Set width={600} or use responsiveWidth={true}."}),void 0===n||"number"==typeof n&&n>0||r.push({severity:"error",code:"BAD_HEIGHT",message:`height=${JSON.stringify(n)} — chart needs a positive number.`,fix:"Set height={400} or use responsiveHeight={true}."}),t.size&&Array.isArray(t.size)){const[e,o]=t.size;(null!=e&&0>=e||null!=o&&0>=o)&&r.push({severity:"error",code:"BAD_SIZE",message:`size=[${e}, ${o}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}(0,t,r),function(e,t,r){const o=P[e];if(!o||"array"!==o.dataShape)return;const n=t.data;if(!n||!Array.isArray(n)||0===n.length)return;const a=n[0];if(!a||"object"!=typeof a)return;const s=Object.keys(a);for(const e of o.dataAccessors){const o=t[e];"string"==typeof o&&(o in a||r.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${o}" not found in data. Available fields: ${s.join(", ")}.`,fix:`Change ${e} to one of: ${s.map(e=>`"${e}"`).join(", ")}.`}))}}(e,t,r),function(e,t,r){E.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,t,r),function(e,t,r){I.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,t,r),function(e,t,r){const o=P[e];if(!o||"array"!==o.dataShape)return;const n=t.data;if(!n||!Array.isArray(n)||0===n.length)return;const a=n[0];if(!a||"object"!=typeof a)return;const s=t.xAccessor;"string"==typeof s&&a[s]instanceof Date&&!t.xFormat&&r.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${s}" 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,t,r),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,t,r),function(e,t,r){var o;if(!N.has(e))return;const n=t.rExtent||t.yExtent;n&&Array.isArray(n)&&n.length>=1&&null!=n[0]&&0!==n[0]&&r.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${n[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, ${null!==(o=n[1])&&void 0!==o?o:"auto"}]}. For trend-focused charts, use LineChart instead.`})}(e,t,r),function(e,t,r){if(!q.has(e))return;if(t.gapStrategy)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const n=t.yAccessor||"y";"string"==typeof n&&o.some(e=>{const t=e[n];return null==t||Number.isNaN(t)})&&r.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${n}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}(e,t,r),function(e,t,r){var o,n;const a=null!==(o=t.width)&&void 0!==o?o:600,s=null!==(n=t.height)&&void 0!==n?n:400,i=t.margin;if(!i||"object"!=typeof i)return;const c=(i.left||0)+(i.right||0),l=(i.top||0)+(i.bottom||0);a>c||r.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${c}px) >= width (${a}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),s>l||r.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${l}px) >= height (${s}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}(0,t,r),function(e,t,r){var o;const n=P[e];if(!n||"array"!==n.dataShape)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const s=[];t.xAccessor&&"string"==typeof t.xAccessor&&s.push({prop:"xAccessor",name:t.xAccessor}),t.yAccessor&&"string"==typeof t.yAccessor&&s.push({prop:"yAccessor",name:t.yAccessor}),t.valueAccessor&&"string"==typeof t.valueAccessor&&s.push({prop:"valueAccessor",name:t.valueAccessor});const i=Math.min(a.length,5);for(const e of s){let t=!0;for(let r=0;i>r;r++){const n=null===(o=a[r])||void 0===o?void 0:o[e.name];if("number"==typeof n&&Number.isFinite(n)){t=!1;break}}t&&r.push({severity:"error",code:"DEGENERATE_EXTENT",message:`${e.prop}="${e.name}" produces NaN or non-finite values for all sampled data points — chart extents will be invalid.`,fix:`Ensure data[].${e.name} contains finite numbers, or use a function accessor to transform values.`})}}(e,t,r),function(e,t,r){if(!D.has(e))return;const o=t.barPadding;"number"==typeof o&&10>o&&r.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${o} 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,t,r),function(e,t,r){if("bottom"!==t.legendPosition)return;const o=t.margin;if(!o||"object"!=typeof o)return;const n=o.bottom;"number"==typeof n&&70>n&&r.push({severity:"warning",code:"BOTTOM_MARGIN_WITH_LEGEND",message:`legendPosition="bottom" with margin.bottom=${n}px — legend may overlap axis labels.`,fix:"Increase margin.bottom to at least 70, e.g. margin={{ ...margin, bottom: 80 }}."})}(0,t,r),function(e,t,r){var o;if(!t.showLegend)return;if("right"!==(null!==(o=t.legendPosition)&&void 0!==o?o:"right"))return;const n=t.margin;if(!n||"object"!=typeof n)return;const a=n.right;"number"==typeof a&&100>a&&r.push({severity:"warning",code:"LEGEND_MARGIN_TIGHT",message:`showLegend is true with legendPosition="right" but margin.right=${a}px — legend may be clipped or overlap the chart.`,fix:"Increase margin.right to at least 100, e.g. margin={{ ...margin, right: 120 }}."})}(0,t,r),function(e,t,r){if("Heatmap"!==e)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const n=o[0];if(n&&"object"==typeof n)for(const e of["xAccessor","yAccessor"]){const o=t[e];if("string"!=typeof o)continue;const a=n[o];"string"==typeof a&&r.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${o}" resolves to string values (e.g. "${a}"). 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,t,r),function(e,t,r){const o=t.colorScheme;if(!o||!Array.isArray(o))return;const n="string"==typeof t.background?t.background:"#ffffff";if(!n.startsWith("#"))return;const a=[];for(const e of o){if("string"!=typeof e||!e.startsWith("#"))continue;const t=U(e,n);null!==t&&3>t&&a.push(`${e} (${t.toFixed(1)}:1)`)}a.length>0&&r.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${a.length} color(s) in colorScheme have < 3:1 contrast against background "${n}": ${a.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,t,r),function(e,t,r){const o=t.colorScheme;if(!o||!Array.isArray(o)||2>o.length)return;const n=o.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>n.length)return;const a=[];for(let e=0;n.length-1>e;e++){const t=U(n[e],n[e+1]);null!==t&&1.5>t&&a.push(`${n[e]} / ${n[e+1]} (${t.toFixed(1)}:1)`)}a.length>0&&r.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${a.length} adjacent color pair(s) in colorScheme have very similar luminance: ${a.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,t,r),function(e,t,r){const o="string"==typeof t.title&&t.title.trim().length>0,n="string"==typeof t.description&&t.description.trim().length>0,a="string"==typeof t.summary&&t.summary.trim().length>0;o||n||a||r.push({severity:"warning",code:"MISSING_DESCRIPTION",message:'No title, description, or summary provided. Screen readers will use a generic label like "XY chart".',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.'})}(0,t,r),function(e,t,r){const o=[];for(const e of G)"function"==typeof t[e]&&o.push(e);o.length>0&&r.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${o.length>1?"s":""} detected: ${o.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference which may trigger unnecessary scene rebuilds.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}(0,t,r),{ok:r.every(e=>"warning"===e.severity),diagnoses:r}):{ok:0===r.length,diagnoses:r}},exports.exportChart=function(e,t){return W(this,void 0,void 0,function*(){const{format:r="png",filename:o="chart",scale:n=2,background:a="white"}=t||{},s=e.querySelector("svg");if(!s)throw Error("No SVG element found in the container");const i=s.cloneNode(!0),c=s.getBoundingClientRect();if(i.getAttribute("width")||i.setAttribute("width",c.width+""),i.getAttribute("height")||i.setAttribute("height",c.height+""),i.getAttribute("xmlns")||i.setAttribute("xmlns","http://www.w3.org/2000/svg"),K(s,i),"svg"===r){const e=(new XMLSerializer).serializeToString(i);Q(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),o+".svg")}else{const t=c.width*n,r=c.height*n,s=document.createElement("canvas");s.width=t,s.height=r;const l=s.getContext("2d");l.fillStyle=a,l.fillRect(0,0,t,r),l.scale(n,n);const u=e.querySelector("canvas");u&&l.drawImage(u,0,0,c.width,c.height);const p=(new XMLSerializer).serializeToString(i),d=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),y=URL.createObjectURL(d),f=new Image;f.width=c.width,f.height=c.height,yield new Promise((e,t)=>{f.onload=()=>{l.drawImage(f,0,0),s.toBlob(r=>{r?(Q(r,o+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(y)},f.onerror=()=>{URL.revokeObjectURL(y),t(Error("Failed to load SVG image"))},f.src=y})}})},exports.fromConfig=function(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if(!P[e.component])throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:Y(e.props)}},exports.fromURL=function(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const r=t.replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(escape(atob(r)));return JSON.parse(o)},exports.fromVegaLite=function(e){var t,r,o,n,a,s,i,c,l,u,p,d;const y=[],{type:f,markProps:g}=function(e){if("string"==typeof e)return{type:e,markProps:{}};const{type:t}=e;return{type:t,markProps:function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);o.length>n;n++)0>t.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["type"])}}(e.mark),b=e.encoding||{},h=b.x,m=b.y,v=b.color,A=b.size,x=b.theta,S=b.opacity;let j;(null===(t=e.data)||void 0===t?void 0:t.values)?j=e.data.values:(null===(r=e.data)||void 0===r?void 0:r.url)&&y.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&y.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&y.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&y.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||b.facet||b.row||b.column)&&y.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&y.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&y.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const w={};e.width&&(w.width=e.width),e.height&&(w.height=e.height);const O=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(O&&(w.title=O),(null==v?void 0:v.field)&&(w.colorBy=v.field,null===(o=v.scale)||void 0===o?void 0:o.scheme)){const e=te[v.scale.scheme];e&&(w.colorScheme=e)}void 0!==(null==S?void 0:S.value)&&(w.pointOpacity=S.value);const k=null==h?void 0:h.aggregate,$=null==m?void 0:m.aggregate;if(j&&(k||$)){const e=$?m:h,t=$?h:m,r=oe[e.aggregate];if(r&&(null==t?void 0:t.field)&&e.field)j=function(e,t){const{groupBy:r,value:o,agg:n="sum"}=t,a=new Map;for(const t of e){const e=t[r]+"";a.has(e)||a.set(e,[]),a.get(e).push(Number(t[o]))}const s=[];for(const[e,t]of a){let o;switch(n){case"count":o=t.length;break;case"mean":o=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":o=Math.min(...t);break;case"max":o=Math.max(...t);break;default:o=t.reduce((e,t)=>e+t,0)}s.push({[r]:e,value:o})}return s}(j,{groupBy:t.field,value:e.field,agg:r});else if(("count"===r||"count"===e.aggregate)&&(null==t?void 0:t.field)&&j){const e=new Map;for(const r of j){const o=r[t.field]+"";e.set(o,(e.get(o)||0)+1)}j=Array.from(e,([e,r])=>({[t.field]:e,value:r}))}}if((null==h?void 0:h.bin)||(null==m?void 0:m.bin)){const e="Histogram";j&&(w.data=j),(null==h?void 0:h.bin)?(w.valueAccessor=h.field,(null==m?void 0:m.field)&&(w.categoryAccessor=m.field),(null===(n=h.axis)||void 0===n?void 0:n.title)&&(w.valueLabel=h.axis.title)):(null==m?void 0:m.bin)&&(w.valueAccessor=m.field,(null==h?void 0:h.field)&&(w.categoryAccessor=h.field),(null===(a=m.axis)||void 0===a?void 0:a.title)&&(w.valueLabel=m.axis.title));const t=(null==h?void 0:h.bin)||(null==m?void 0:m.bin),r="object"==typeof t?t.maxbins:void 0;return r&&(w.bins=r),ae(e,w,y)}let z;switch(f){case"bar":z=function(e,t,r,o,n,a,s){var i,c,l,u,p,d;let y;return(null==r?void 0:r.field)&&!1!==(null==e?void 0:e.stack)&&!1!==(null==t?void 0:t.stack)&&null!==(null==e?void 0:e.stack)&&null!==(null==t?void 0:t.stack)?(y="StackedBarChart",o.stackBy=r.field):y="BarChart",Z(null==e?void 0:e.type)&&ee(null==t?void 0:t.type)?(o.categoryAccessor=e.field,o.valueAccessor=s?"value":t.field,(null===(i=null==e?void 0:e.axis)||void 0===i?void 0:i.title)&&(o.categoryLabel=e.axis.title),(null===(c=null==t?void 0:t.axis)||void 0===c?void 0:c.title)&&(o.valueLabel=t.axis.title)):ee(null==e?void 0:e.type)&&Z(null==t?void 0:t.type)?(o.categoryAccessor=t.field,o.valueAccessor=a?"value":e.field,o.orientation="horizontal",(null===(l=null==t?void 0:t.axis)||void 0===l?void 0:l.title)&&(o.categoryLabel=t.axis.title),(null===(u=null==e?void 0:e.axis)||void 0===u?void 0:u.title)&&(o.valueLabel=e.axis.title)):((null==e?void 0:e.field)&&(o.categoryAccessor=e.field),(null==t?void 0:t.field)&&(o.valueAccessor=s?"value":t.field),(null===(p=null==e?void 0:e.axis)||void 0===p?void 0:p.title)&&(o.categoryLabel=e.axis.title),(null===(d=null==t?void 0:t.axis)||void 0===d?void 0:d.title)&&(o.valueLabel=t.axis.title)),n&&(o.data=n),y}(h,m,v,w,j,k,$);break;case"line":if(z="LineChart",ne(h,m,w,k,$),(null==v?void 0:v.field)&&(w.lineBy=v.field),g.interpolate){const e=re[g.interpolate];e&&(w.curve=e)}!0===g.point&&(w.showPoints=!0),j&&(w.data=j);break;case"area":if((null==v?void 0:v.field)?(z="StackedAreaChart",w.areaBy=v.field):z="AreaChart",ne(h,m,w,k,$),g.interpolate){const e=re[g.interpolate];e&&(w.curve=e)}void 0!==g.opacity&&(w.areaOpacity=g.opacity),j&&(w.data=j);break;case"point":case"circle":case"square":(null==A?void 0:A.field)?(z="BubbleChart",w.sizeBy=A.field,(null===(s=A.scale)||void 0===s?void 0:s.range)&&(w.sizeRange=A.scale.range)):z="Scatterplot",ne(h,m,w,k,$),j&&(w.data=j);break;case"rect":z="Heatmap",(null==h?void 0:h.field)&&(w.xAccessor=h.field),(null==m?void 0:m.field)&&(w.yAccessor=m.field),(null==v?void 0:v.field)&&(w.valueAccessor=v.field,delete w.colorBy),(null===(i=null==h?void 0:h.axis)||void 0===i?void 0:i.title)&&(w.xLabel=h.axis.title),(null===(c=null==m?void 0:m.axis)||void 0===c?void 0:c.title)&&(w.yLabel=m.axis.title),j&&(w.data=j);break;case"arc":g.innerRadius&&g.innerRadius>0?(z="DonutChart",w.innerRadius=g.innerRadius):z="PieChart",(null==x?void 0:x.field)?w.valueAccessor=x.field:(null==m?void 0:m.field)&&(w.valueAccessor=$?"value":m.field),(null==v?void 0:v.field)&&(w.categoryAccessor=v.field),(null==h?void 0:h.field)&&!(null==x?void 0:x.field)&&(w.categoryAccessor=h.field),j&&(w.data=j);break;case"tick":z="DotPlot",Z(null==h?void 0:h.type)?(w.categoryAccessor=h.field,(null==m?void 0:m.field)&&(w.valueAccessor=$?"value":m.field),(null===(l=null==h?void 0:h.axis)||void 0===l?void 0:l.title)&&(w.categoryLabel=h.axis.title),(null===(u=null==m?void 0:m.axis)||void 0===u?void 0:u.title)&&(w.valueLabel=m.axis.title)):Z(null==m?void 0:m.type)?(w.categoryAccessor=m.field,(null==h?void 0:h.field)&&(w.valueAccessor=k?"value":h.field),w.orientation="horizontal",(null===(p=null==m?void 0:m.axis)||void 0===p?void 0:p.title)&&(w.categoryLabel=m.axis.title),(null===(d=null==h?void 0:h.axis)||void 0===d?void 0:d.title)&&(w.valueLabel=h.axis.title)):((null==h?void 0:h.field)&&(w.categoryAccessor=h.field),(null==m?void 0:m.field)&&(w.valueAccessor=$?"value":m.field)),j&&(w.data=j);break;default:y.push(`Unsupported mark type "${f}". Defaulting to Scatterplot.`),z="Scatterplot",ne(h,m,w,k,$),j&&(w.data=j)}return ae(z,w,y)},exports.getHitRadius=function(e,t=30){return Math.max((null!=e?e:4)+5,12,t)},exports.lightenColor=function(e,t=.5){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;const o=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*t),n=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*t),a=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*t);return`#${o.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}`},exports.normalizeTooltip=function(t){if(!0!==t){if("function"==typeof t){const r=t;return t=>{var o;const n=(a=!0===(null==t?void 0:t.__semioticHoverData)||t&&void 0!==t.data&&"number"==typeof t.x&&"number"==typeof t.y&&t&&("node"===t.type||"edge"===t.type||void 0!==t.nodeOrEdge||void 0!==t.allSeries||void 0!==t.stats||void 0!==t.__chartType)?null!==(o=t.data)&&void 0!==o?o:{}:t,Array.isArray(a)?a[0]:a);var a;const s=r(n);return null==s?null:e.jsx("div",{className:"semiotic-tooltip",style:ie,children:s})}}return!1!==t&&void 0!==t&&("object"==typeof t&&null!==t&&("fields"in t||"title"in t)?ue(t):ue())}},exports.resolveThemePreset=f,exports.serializeSelections=function(e){const t={};for(const[r,o]of e){const e=[];for(const[,t]of o.clauses){const r={};for(const[e,o]of Object.entries(t.fields))r[e]="point"===o.type?{type:"point",values:Array.from(o.values)}:{type:"interval",range:o.range};e.push({clientId:t.clientId,type:t.type,fields:r})}t[r]={name:o.name,resolution:o.resolution,clauses:e}}return t},exports.smartTickFormat=function(e){if(null==e)return"";if("number"!=typeof e)return e+"";if(!isFinite(e))return e+"";if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),r=Math.abs(t);return 1e9>r?1e6>r?1e4>r?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"},exports.sweepToAngles=pe,exports.themeToCSS=function(e,t=":root"){var r,o,n,a,s;const i=[];return i.push(` --semiotic-bg: ${e.colors.background};`),i.push(` --semiotic-text: ${e.colors.text};`),i.push(` --semiotic-text-secondary: ${e.colors.textSecondary};`),i.push(` --semiotic-grid: ${e.colors.grid};`),i.push(` --semiotic-border: ${e.colors.border};`),i.push(` --semiotic-primary: ${e.colors.primary};`),i.push(` --semiotic-font-family: ${e.typography.fontFamily};`),e.colors.focus&&i.push(` --semiotic-focus: ${e.colors.focus};`),e.colors.selection&&i.push(` --semiotic-selection-color: ${e.colors.selection};`),null!=e.colors.selectionOpacity&&i.push(` --semiotic-selection-opacity: ${e.colors.selectionOpacity};`),e.colors.diverging&&i.push(` --semiotic-diverging: ${e.colors.diverging};`),(null===(r=e.tooltip)||void 0===r?void 0:r.background)&&i.push(` --semiotic-tooltip-bg: ${e.tooltip.background};`),(null===(o=e.tooltip)||void 0===o?void 0:o.text)&&i.push(` --semiotic-tooltip-text: ${e.tooltip.text};`),(null===(n=e.tooltip)||void 0===n?void 0:n.borderRadius)&&i.push(` --semiotic-tooltip-radius: ${e.tooltip.borderRadius};`),(null===(a=e.tooltip)||void 0===a?void 0:a.fontSize)&&i.push(` --semiotic-tooltip-font-size: ${e.tooltip.fontSize};`),(null===(s=e.tooltip)||void 0===s?void 0:s.shadow)&&i.push(` --semiotic-tooltip-shadow: ${e.tooltip.shadow};`),e.borderRadius&&i.push(` --semiotic-border-radius: ${e.borderRadius};`),e.colors.annotation&&i.push(` --semiotic-annotation-color: ${e.colors.annotation};`),null!=e.typography.legendSize&&i.push(` --semiotic-legend-font-size: ${e.typography.legendSize}px;`),null!=e.typography.titleFontSize&&i.push(` --semiotic-title-font-size: ${e.typography.titleFontSize}px;`),null!=e.typography.tickFontFamily&&i.push(` --semiotic-tick-font-family: ${e.typography.tickFontFamily};`),null!=e.typography.tickSize&&i.push(` --semiotic-tick-font-size: ${e.typography.tickSize}px;`),null!=e.typography.labelSize&&i.push(` --semiotic-axis-label-font-size: ${e.typography.labelSize}px;`),i.push(` --semiotic-secondary: ${e.colors.secondary||e.colors.primary};`),i.push(` --semiotic-surface: ${e.colors.surface||e.colors.background};`),e.colors.success&&i.push(` --semiotic-success: ${e.colors.success};`),e.colors.danger&&i.push(` --semiotic-danger: ${e.colors.danger};`),e.colors.warning&&i.push(` --semiotic-warning: ${e.colors.warning};`),e.colors.error&&i.push(` --semiotic-error: ${e.colors.error};`),e.colors.info&&i.push(` --semiotic-info: ${e.colors.info};`),`${t} {\n${i.join("\n")}\n}`},exports.themeToTokens=function(e){var t,r,o,n,a,s;return{semiotic:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:(null===(t=e.tooltip)||void 0===t?void 0:t.background)||e.colors.background,$type:"color"},text:{$value:(null===(r=e.tooltip)||void 0===r?void 0:r.text)||e.colors.text,$type:"color"},radius:{$value:(null===(o=e.tooltip)||void 0===o?void 0:o.borderRadius)||"6px",$type:"dimension"},"font-size":{$value:(null===(n=e.tooltip)||void 0===n?void 0:n.fontSize)||"14px",$type:"dimension"},shadow:{$value:(null===(a=e.tooltip)||void 0===a?void 0:a.shadow)||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:null!==(s=e.colors.selectionOpacity)&&void 0!==s?s:.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"}},e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{}),e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{}),null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{}),null!=e.typography.titleFontSize?{"title-font-size":{$value:e.typography.titleFontSize+"px",$type:"dimension"}}:{}),null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{}),null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{}),null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{}),{secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"}}),e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{}),e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{}),e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{}),e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{}),e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{})}},exports.toConfig=function(e,t,r){if(!P[e])throw Error(`Unknown component "${e}". Known components: ${Object.keys(P).join(", ")}`);const o=!1!==(null==r?void 0:r.includeData),n={};for(const[e,r]of Object.entries(t))null!=r&&(V.has(e)||!o&&J.has(e)||"function"!=typeof r&&((null==r?void 0:r.$$typeof)||(n[e]=Y(r))));return Object.assign({component:e,props:n,version:"1",createdAt:(new Date).toISOString()},(null==r?void 0:r.selections)?{selections:r.selections}:{})},exports.toURL=function(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},exports.useHighContrast=function(){const[e,r]=t.useState(()=>b("(forced-colors: active)"));return t.useEffect(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(forced-colors: active)");return r(e.matches),g(e,e=>r(e.matches))},[]),e},exports.useReducedMotion=function(){const[e,r]=t.useState(()=>b("(prefers-reduced-motion: reduce)"));return t.useEffect(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return r(e.matches),g(e,e=>r(e.matches))},[]),e},exports.useStreamStatus=function(e={}){const{staleThresholdMs:r=5e3,pollIntervalMs:o=1e3}=e,n=t.useRef(null),[a,s]=t.useState("idle"),[i,c]=t.useState(null),l=t.useMemo(()=>{const e={_frame:null,_origPush:null,_origPushMany:null};return{get current(){return e._frame},set current(t){const r=e._frame;if(r&&r!==t&&e._origPush&&e._origPushMany&&(r.push=e._origPush,r.pushMany=e._origPushMany,delete r[de]),e._frame=t,!t)return e._origPush=null,void(e._origPushMany=null);if(t[de])return;t[de]=!0;const o=t.push,n=t.pushMany,a=o.bind(t),s=n.bind(t);e._origPush=o,e._origPushMany=n,t.push=e=>(u(),a(e)),t.pushMany=e=>(e&&e.length>0&&u(),s(e))}}},[]),u=t.useCallback(()=>{const e="undefined"!=typeof performance?performance.now():Date.now();n.current=e,c(e),s(e=>"active"===e?e:"active")},[]);return t.useEffect(()=>{const e=setInterval(()=>{const e=n.current;if(null==e)return;const t=("undefined"!=typeof performance?performance.now():Date.now())-e>r;s(e=>{const r=t?"stale":"active";return e===r?e:r})},o);return()=>clearInterval(e)},[r,o]),{ref:l,status:a,lastPushTime:i}},exports.useTheme=function(){return d(e=>e.theme)},exports.validateProps=M,exports.valueToAngle=function(e,t,r,o,n){const a=r-t||1;return n+(Math.max(t,Math.min(r,e))-t)/a*o};
|
|
2
|
+
"use strict";const e=require("react/jsx-runtime"),t=require("react");function a(e){if(e&&e.__esModule)return e;const t=Object.create(null);if(e)for(const a in e)if("default"!==a){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}return t.default=e,Object.freeze(t)}const r=a(t);function n(e,t){const a=new EventTarget;let r=Object.assign(Object.assign({},e(function(e){r=Object.assign(Object.assign({},r),e(r)),a.dispatchEvent(new Event("update"))})),null!=t?t:{});return{getState:()=>r,subscribe:function(e){return a.addEventListener("update",e),()=>a.removeEventListener("update",e)}}}function o(e){if(!e.accessibility)return e;let t=e;if(e.accessibility.colorBlindSafe&&(t=Object.assign(Object.assign({},t),{colors:Object.assign(Object.assign({},t.colors),{categorical:i})})),e.accessibility.highContrast){const e="dark"===t.mode;t=Object.assign(Object.assign({},t),{colors:Object.assign(Object.assign({},t.colors),{text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"})})}return t}const i=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],s={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},c={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},l={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:i,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"};function u(e,t){if("light"===t)return s;if("dark"===t)return c;if("high-contrast"===t)return l;if("string"==typeof t)return void 0!==console&&console.warn(`[ThemeStore] Unknown theme preset "${t}". Keeping current theme.`),e;if(t.mode&&"auto"!==t.mode){const e="dark"===t.mode?c:s;return o(Object.assign(Object.assign(Object.assign({},e),t),{colors:Object.assign(Object.assign({},e.colors),t.colors||{}),typography:Object.assign(Object.assign({},e.typography),t.typography||{})}))}return o(Object.assign(Object.assign(Object.assign({},e),t),{colors:Object.assign(Object.assign({},e.colors),t.colors||{}),typography:Object.assign(Object.assign({},e.typography),t.typography||{})}))}const[p,d]=function(a){let r=null;const o=()=>(r||(r=t.createContext(null)),r),i=n(a);return[function({children:r,initialState:i}){const s=t.useRef(i),c=t.useMemo(()=>n(a,s.current),[]),l=o();return e.jsx(l.Provider,{value:c,children:r})},e=>{var a;const r=o(),n=null!==(a=t.useContext(r))&&void 0!==a?a:i,s=t.useRef(e);s.current=e;const c=t.useCallback(()=>s.current(n.getState()),[n]),l=t.useCallback(()=>s.current(n.getState()),[n]);return t.useSyncExternalStore(n.subscribe,c,l)}]}(e=>({theme:s,setTheme(t){e(e=>({theme:u(e.theme,t)}))}})),f={light:s,dark:c,"high-contrast":l,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#8b7355",grid:"#e8d5c4",border:"#e8d5c4",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#7f8c9b",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#c05050",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#e45050",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#8b5cf6",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}};function g(e){return f[e]}function y(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const a=e;return a.addListener(t),()=>a.removeListener(t)}function h(e){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(e).matches}const m=r.createContext(void 0),b="undefined"==typeof window?r.useEffect:r.useLayoutEffect;function v(e){if("string"!=typeof e)return e;if("light"===e||"dark"===e||"high-contrast"===e)return e;return g(e)||(void 0!==console&&console.warn(`[ThemeProvider] Unknown theme preset "${e}". Falling back to light theme.`),"light")}function x({theme:e}){const t=d(e=>e.setTheme),a=d(e=>e.theme),n=r.useRef(a);n.current=a;const o=r.useRef(null);r.useEffect(()=>{if(void 0!==e)return;if("undefined"==typeof window||!window.matchMedia)return;const a=window.matchMedia("(forced-colors: active)");return a.matches&&(o.current=n.current===l?s:n.current,t("high-contrast")),y(a,e=>{var a,r;e.matches?(o.current=n.current===l?null!==(a=o.current)&&void 0!==a?a:s:n.current,t("high-contrast")):(function(e,t){e(t===s?"light":t===c?"dark":t===l?"high-contrast":t)}(t,null!==(r=o.current)&&void 0!==r?r:s),o.current=null)})},[e,t]);const i=r.useRef(!1);return b(()=>{i.current?void 0!==e&&t(v(e)):i.current=!0},[e,t]),null}function A({children:t}){var a,n,o,i,s;const c=d(e=>e.theme),l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({position:"relative","--semiotic-bg":c.colors.background,"--semiotic-text":c.colors.text,"--semiotic-text-secondary":c.colors.textSecondary,"--semiotic-grid":c.colors.grid,"--semiotic-border":c.colors.border,"--semiotic-cell-border":c.colors.cellBorder||c.colors.border,"--semiotic-primary":c.colors.primary,"--semiotic-font-family":c.typography.fontFamily},c.colors.focus?{"--semiotic-focus":c.colors.focus}:{}),(null===(a=c.tooltip)||void 0===a?void 0:a.background)?{"--semiotic-tooltip-bg":c.tooltip.background}:{}),(null===(n=c.tooltip)||void 0===n?void 0:n.text)?{"--semiotic-tooltip-text":c.tooltip.text}:{}),(null===(o=c.tooltip)||void 0===o?void 0:o.borderRadius)?{"--semiotic-tooltip-radius":c.tooltip.borderRadius}:{}),(null===(i=c.tooltip)||void 0===i?void 0:i.fontSize)?{"--semiotic-tooltip-font-size":c.tooltip.fontSize}:{}),(null===(s=c.tooltip)||void 0===s?void 0:s.shadow)?{"--semiotic-tooltip-shadow":c.tooltip.shadow}:{}),c.borderRadius?{"--semiotic-border-radius":c.borderRadius}:{}),c.colors.selection?{"--semiotic-selection-color":c.colors.selection}:{}),null!=c.colors.selectionOpacity?{"--semiotic-selection-opacity":c.colors.selectionOpacity+""}:{}),c.colors.diverging?{"--semiotic-diverging":c.colors.diverging}:{}),c.colors.annotation?{"--semiotic-annotation-color":c.colors.annotation}:{}),null!=c.typography.legendSize?{"--semiotic-legend-font-size":c.typography.legendSize+"px"}:{}),null!=c.typography.titleFontSize?{"--semiotic-title-font-size":c.typography.titleFontSize+"px"}:{}),null!=c.typography.tickFontFamily?{"--semiotic-tick-font-family":c.typography.tickFontFamily}:{}),null!=c.typography.tickSize?{"--semiotic-tick-font-size":c.typography.tickSize+"px"}:{}),null!=c.typography.labelSize?{"--semiotic-axis-label-font-size":c.typography.labelSize+"px"}:{}),{"--semiotic-secondary":c.colors.secondary||c.colors.primary,"--semiotic-surface":c.colors.surface||c.colors.background}),c.colors.success?{"--semiotic-success":c.colors.success}:{}),c.colors.danger?{"--semiotic-danger":c.colors.danger}:{}),c.colors.warning?{"--semiotic-warning":c.colors.warning}:{}),c.colors.error?{"--semiotic-error":c.colors.error}:{}),c.colors.info?{"--semiotic-info":c.colors.info}:{}),u=r.useContext(m),p={};return u&&(p["data-semiotic-theme"]=u),e.jsx("div",Object.assign({style:l},p,{children:t}))}const w=864e5;function $(e){return 10>e?"0"+e:e+""}const S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];let j=null;function k(e,t){const a=e.length,r=t.length,n=Array(r+1);for(let e=0;r>=e;e++)n[e]=e;for(let o=1;a>=o;o++){let a=n[0];n[0]=o;for(let i=1;r>=i;i++){const r=n[i];n[i]=e[o-1]===t[i-1]?a:1+Math.min(a,n[i],n[i-1]),a=r}}return n[r]}function O(e,t,a=3){let r,n=a+1;for(const a of t){const t=k(e.toLowerCase(),a.toLowerCase());n>t&&(n=t,r=a)}return n>a?void 0:r}function C(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:e}function z(e,t){var a;if(0===t.length)return null;const r=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(r)||r.includes(e.toLowerCase()))||(null!==(a=O(e,t,3))&&void 0!==a?a:null)}const R={width:{type:"number"},height:{type:"number"},margin:{type:"object"},className:{type:"string"},title:{type:"string"},enableHover:{type:"boolean"},showLegend:{type:"boolean"},showGrid:{type:"boolean"},colorBy:{type:["string","function"]},colorScheme:{type:["string","array"]},tooltip:{type:["boolean","function","object"]},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},axisExtent:{type:"string",enum:["nice","exact"]},frameProps:{type:"object"},onClick:{type:"function"}},L={xLabel:{type:"string"},yLabel:{type:"string"},xFormat:{type:"function"},yFormat:{type:"function"}},F={categoryLabel:{type:"string"},valueLabel:{type:"string"},valueFormat:{type:"function"},categoryFormat:{type:"function"}},T=["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],P=["vertical","horizontal"],B={LineChart:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},lineBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:T},lineWidth:{type:"number"},showPoints:{type:"boolean"},pointRadius:{type:"number"},fillArea:{type:"boolean"},areaOpacity:{type:"number"},forecast:{type:"object"},anomaly:{type:"object"},band:{type:["object","array"]}})},AreaChart:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},areaBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:T},gradientFill:{type:["boolean","object"]},semanticGradient:{type:"array"},areaOpacity:{type:"number"},showLine:{type:"boolean"},lineWidth:{type:"number"},forecast:{type:"object"},anomaly:{type:"object"},band:{type:["object","array"]}})},DifferenceChart:{required:[],dataShape:"array",dataAccessors:["xAccessor","seriesAAccessor","seriesBAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},seriesAAccessor:{type:["string","function"]},seriesBAccessor:{type:["string","function"]},seriesALabel:{type:"string"},seriesBLabel:{type:"string"},seriesAColor:{type:"string"},seriesBColor:{type:"string"},showLines:{type:"boolean"},lineWidth:{type:"number"},showPoints:{type:"boolean"},pointRadius:{type:"number"},curve:{type:"string",enum:T},areaOpacity:{type:"number"},gradientFill:{type:["boolean","object"]},xExtent:{type:"array"},yExtent:{type:"array"},pointIdAccessor:{type:["string","function"]},windowSize:{type:"number"}})},StackedAreaChart:{required:["data","areaBy"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},areaBy:{type:["string","function"]},lineDataAccessor:{type:"string"},curve:{type:"string",enum:T},areaOpacity:{type:"number"},showLine:{type:"boolean"},lineWidth:{type:"number"},normalize:{type:"boolean"}})},Scatterplot:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"},regression:{type:["boolean","string","object"]},forecast:{type:"object"},anomaly:{type:"object"}})},BubbleChart:{required:["data","sizeBy"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},bubbleOpacity:{type:"number"},bubbleStrokeWidth:{type:"number"},bubbleStrokeColor:{type:"string"},regression:{type:["boolean","string","object"]}})},Heatmap:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},colorScheme:{type:"string",enum:["blues","reds","greens","viridis","custom"]},customColorScale:{type:["object","function"]},showValues:{type:"boolean"},valueFormat:{type:"function"},cellBorderColor:{type:"string"},cellBorderWidth:{type:"number"},showLegend:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},QuadrantChart:{required:[],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},quadrants:{type:"object"},xCenter:{type:"number"},yCenter:{type:"number"},centerlineStyle:{type:"object"},showQuadrantLabels:{type:"boolean"},quadrantLabelSize:{type:"number"},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"}})},MultiAxisLineChart:{required:["series"],dataShape:"array",dataAccessors:["xAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},series:{type:"array"},colorScheme:{type:["string","array"]},curve:{type:"string"},lineWidth:{type:"number"},annotations:{type:"array"}})},CandlestickChart:{required:["highAccessor","lowAccessor"],dataShape:"array",dataAccessors:["xAccessor","highAccessor","lowAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},highAccessor:{type:["string","function"]},lowAccessor:{type:["string","function"]},openAccessor:{type:["string","function"]},closeAccessor:{type:["string","function"]},candlestickStyle:{type:"object"},mode:{type:"string",enum:["primary","context","sparkline"]},annotations:{type:"array"}})},ConnectedScatterplot:{required:["data"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign(Object.assign({},R),L),{data:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},orderAccessor:{type:["string","function"]},orderLabel:{type:"string"},pointRadius:{type:"number"},pointIdAccessor:{type:["string","function"]},annotations:{type:"array"},regression:{type:["boolean","string","object"]},forecast:{type:"object"},anomaly:{type:"object"}})},BarChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:P},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"},regression:{type:["boolean","string","object"]}})},StackedBarChart:{required:["data","stackBy"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},stackBy:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:P},normalize:{type:"boolean"},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"}})},LikertChart:{required:[],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},levelAccessor:{type:["string","function"]},countAccessor:{type:["string","function"]},levels:{type:"array"},orientation:{type:"string",enum:P},barPadding:{type:"number"}})},GroupedBarChart:{required:["data","groupBy"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},groupBy:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:P},sort:{type:["boolean","string","function"]},barPadding:{type:"number"},roundedTop:{type:"number"}})},SwarmPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:P},sizeBy:{type:["string","function"]},sizeRange:{type:"array"},pointRadius:{type:"number"},pointOpacity:{type:"number"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},BoxPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:P},showOutliers:{type:"boolean"},outlierRadius:{type:"number"},categoryPadding:{type:"number"}})},Histogram:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},bins:{type:"number"},relative:{type:"boolean"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},ViolinPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:P},bins:{type:"number"},curve:{type:"string"},showIQR:{type:"boolean"},categoryPadding:{type:"number"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}})},RidgelinePlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},bins:{type:"number"},amplitude:{type:"number"},categoryPadding:{type:"number"}})},DotPlot:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:P},sort:{type:["boolean","string","function"]},dotRadius:{type:"number"},categoryPadding:{type:"number"},regression:{type:["boolean","string","object"]}})},PieChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign({},R),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},startAngle:{type:"number"},cornerRadius:{type:"number"}})},DonutChart:{required:["data"],dataShape:"array",dataAccessors:["categoryAccessor","valueAccessor"],props:Object.assign(Object.assign({},R),{data:{type:"array"},categoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},innerRadius:{type:"number"},centerContent:{type:["object","string","number"]},startAngle:{type:"number"},cornerRadius:{type:"number"}})},GaugeChart:{required:["value"],dataShape:"none",dataAccessors:[],props:Object.assign(Object.assign({},R),{value:{type:"number"},min:{type:"number"},max:{type:"number"},thresholds:{type:"array"},gradientFill:{type:"object"},arcWidth:{type:"number"},cornerRadius:{type:"number"},sweep:{type:"number"},fillZones:{type:"boolean"},showNeedle:{type:"boolean"},needleColor:{type:"string"},color:{type:"string"},centerContent:{type:["object","string","number","function"]},valueFormat:{type:"function"},showScaleLabels:{type:"boolean"},backgroundColor:{type:"string"}})},FunnelChart:{required:["data"],dataShape:"array",dataAccessors:["stepAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},stepAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},orientation:{type:"string",enum:["horizontal","vertical"]},connectorOpacity:{type:"number"},showCategoryTicks:{type:"boolean"},responsiveWidth:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},SwimlaneChart:{required:["subcategoryAccessor"],dataShape:"array",dataAccessors:["categoryAccessor","subcategoryAccessor","valueAccessor"],props:Object.assign(Object.assign(Object.assign({},R),F),{data:{type:"array"},categoryAccessor:{type:["string","function"]},subcategoryAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},orientation:{type:"string",enum:["horizontal","vertical"]},barPadding:{type:"number"},roundedTop:{type:"number"},showCategoryTicks:{type:"boolean"},brush:{type:"boolean"},onBrush:{type:"function"},linkedBrush:{type:["string","object"]},responsiveWidth:{type:"boolean"},legendPosition:{type:"string",enum:["right","left","top","bottom"]}})},ForceDirectedGraph:{required:["nodes","edges"],dataShape:"network",dataAccessors:["nodeIDAccessor","sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},R),{nodes:{type:"array"},edges:{type:"array"},nodeIDAccessor:{type:["string","function"]},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},nodeLabel:{type:["string","function"]},nodeSize:{type:["number","string","function"]},nodeSizeRange:{type:"array"},edgeWidth:{type:["number","string","function"]},edgeColor:{type:"string"},edgeOpacity:{type:"number"},iterations:{type:"number"},forceStrength:{type:"number"},showLabels:{type:"boolean"}})},SankeyDiagram:{required:["edges"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},R),{nodes:{type:"array"},edges:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},edgeColorBy:{type:["string","function"],enum:["source","target","gradient"]},orientation:{type:"string",enum:P},nodeAlign:{type:"string",enum:["justify","left","right","center"]},nodePaddingRatio:{type:"number"},nodeWidth:{type:"number"},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},edgeOpacity:{type:"number"},edgeSort:{type:"function"}})},ProcessSankey:{required:["domain"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},R),{nodes:{type:"array"},edges:{type:"array"},domain:{type:"array"},axisTicks:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},startTimeAccessor:{type:["string","function"]},endTimeAccessor:{type:["string","function"]},xExtentAccessor:{type:["string","function"]},edgeIdAccessor:{type:["string","function"]},legendPosition:{type:"string",enum:["right","left","top","bottom"]},pairing:{type:"string",enum:["value","temporal"]},packing:{type:"string",enum:["off","reuse"]},laneOrder:{type:"string",enum:["insertion","crossing-min","inside-out","crossing-min+inside-out"]},ribbonLane:{type:"string",enum:["source","target","both"]},lifetimeMode:{type:"string",enum:["full","half"]},showLaneRails:{type:"boolean"},showQualityReadout:{type:"boolean"},edgeOpacity:{type:"number"},timeFormat:{type:"function"},valueFormat:{type:"function"},showParticles:{type:"boolean"},particleStyle:{type:"object"}})},ChordDiagram:{required:["edges"],dataShape:"network",dataAccessors:["sourceAccessor","targetAccessor"],props:Object.assign(Object.assign({},R),{nodes:{type:"array"},edges:{type:"array"},sourceAccessor:{type:["string","function"]},targetAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},edgeColorBy:{type:["string","function"],enum:["source","target"]},padAngle:{type:"number"},groupWidth:{type:"number"},sortGroups:{type:"function"},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},edgeOpacity:{type:"number"}})},TreeDiagram:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"object"},layout:{type:"string",enum:["tree","cluster","partition","treemap","circlepack"]},orientation:{type:"string",enum:["vertical","horizontal","radial"]},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},edgeStyle:{type:"string",enum:["line","curve"]},nodeLabel:{type:["string","function"]},showLabels:{type:"boolean"},nodeSize:{type:"number"}})},Treemap:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"object"},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},showLabels:{type:"boolean"},nodeLabel:{type:["string","function"]},nodeStyle:{type:"function"}})},CirclePack:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"object"},childrenAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},colorByDepth:{type:"boolean"},showLabels:{type:"boolean"},nodeLabel:{type:["string","function"]},circleOpacity:{type:"number"}})},OrbitDiagram:{required:["data"],dataShape:"object",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"object"},childrenAccessor:{type:["string","function"]},nodeIdAccessor:{type:["string","function"]},orbitMode:{type:["string","array"]},speed:{type:"number"},revolution:{type:"function"},eccentricity:{type:["number","function"]},orbitSize:{type:["number","function"]},nodeRadius:{type:["number","function"]},showRings:{type:"boolean"},showLabels:{type:"boolean"},animated:{type:"boolean"},colorByDepth:{type:"boolean"},annotations:{type:"array"},foregroundGraphics:{type:"object"}})},RealtimeLineChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},stroke:{type:"string"},strokeWidth:{type:"number"},strokeDasharray:{type:"string"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeHistogram:{required:["binSize"],dataShape:"realtime",dataAccessors:[],props:{binSize:{type:"number"},direction:{type:"string",enum:["up","down"]},size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},fill:{type:"string"},stroke:{type:"string"},strokeWidth:{type:"number"},gap:{type:"number"},brush:{type:["boolean","string","object"]},onBrush:{type:"function"},linkedBrush:{type:["string","object"]},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},TemporalHistogram:{required:["data","binSize"],dataShape:"array",dataAccessors:["timeAccessor","valueAccessor","categoryAccessor"],props:{data:{type:"array"},binSize:{type:"number"},direction:{type:"string",enum:["up","down"]},size:{type:"array"},width:{type:"number"},height:{type:"number"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},fill:{type:"string"},stroke:{type:"string"},strokeWidth:{type:"number"},gap:{type:"number"},linkedHover:{type:["boolean","string","object"]},brush:{type:["boolean","string","object"]},onBrush:{type:"function"},linkedBrush:{type:["string","object"]}}},RealtimeSwarmChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},categoryAccessor:{type:["string","function"]},colors:{type:"object"},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},radius:{type:"number"},fill:{type:"string"},opacity:{type:"number"},stroke:{type:"string"},strokeWidth:{type:"number"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeWaterfallChart:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},positiveColor:{type:"string"},negativeColor:{type:"string"},connectorStroke:{type:"string"},connectorWidth:{type:"number"},gap:{type:"number"},stroke:{type:"string"},strokeWidth:{type:"number"},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"},transition:{type:"object"}}},RealtimeHeatmap:{required:[],dataShape:"realtime",dataAccessors:[],props:{size:{type:"array"},margin:{type:"object"},className:{type:"string"},timeAccessor:{type:["string","function"]},valueAccessor:{type:["string","function"]},heatmapXBins:{type:"number"},heatmapYBins:{type:"number"},aggregation:{type:"string",enum:["count","sum","mean"]},windowSize:{type:"number"},windowMode:{type:"string",enum:["sliding","stepping"]},arrowOfTime:{type:"string",enum:["left","right"]},timeExtent:{type:"array"},valueExtent:{type:"array"},extentPadding:{type:"number"},showAxes:{type:"boolean"},background:{type:"string"},enableHover:{type:["boolean","object"]},tooltipContent:{type:"function"},tooltip:{type:["function","object"]},onHover:{type:"function"},annotations:{type:"array"},autoPlaceAnnotations:{type:["boolean","object"]},svgAnnotationRules:{type:"function"},tickFormatTime:{type:"function"},tickFormatValue:{type:"function"},width:{type:"number"},height:{type:"number"},decay:{type:"object"},pulse:{type:"object"},staleness:{type:"object"}}},ScatterplotMatrix:{required:["data","fields"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"array"},fields:{type:"array"}})},MinimapChart:{required:["data"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},R),{data:{type:"array"}})},ChoroplethMap:{required:["areas"],dataShape:"array",dataAccessors:["valueAccessor"],props:Object.assign(Object.assign({},R),{areas:{type:["array","string"]},valueAccessor:{type:["string","function"]},colorScheme:{type:["string","array"]},projection:{type:"string"}})},ProportionalSymbolMap:{required:["points"],dataShape:"array",dataAccessors:["xAccessor","yAccessor"],props:Object.assign(Object.assign({},R),{points:{type:"array"},xAccessor:{type:["string","function"]},yAccessor:{type:["string","function"]},sizeBy:{type:["string","function"]},areas:{type:["array","string"]}})},FlowMap:{required:["flows"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},R),{flows:{type:"array"},nodes:{type:"array"},valueAccessor:{type:["string","function"]},lineIdAccessor:{type:["string","function"]}})},DistanceCartogram:{required:["points"],dataShape:"array",dataAccessors:[],props:Object.assign(Object.assign({},R),{points:{type:"array"},center:{type:"array"},costAccessor:{type:["string","function"]}})},BigNumber:{required:[],dataShape:"none",dataAccessors:[],props:{width:{type:["number","string"]},height:{type:["number","string"]},className:{type:"string"},onClick:{type:"function"},value:{type:"number"},label:{type:"string"},caption:{type:"string"},format:{type:["string","function"],enum:["number","currency","percent","compact","duration"]},locale:{type:"string"},currency:{type:"string"},precision:{type:"number"},prefix:{type:"string"},suffix:{type:"string"},unit:{type:"string"},comparison:{type:"object"},target:{type:"object"},delta:{type:"number"},deltaFormat:{type:["string","function"],enum:["number","currency","percent","compact","duration"]},showDeltaPercent:{type:"boolean"},direction:{type:"string",enum:["higher-is-better","lower-is-better","neutral"]},sentiment:{type:"string",enum:["auto","positive","negative","neutral"]},thresholds:{type:"array"},chartSlot:{type:["string","number","array","object","function"]},chartSize:{type:"number"},windowSize:{type:"number"},mode:{type:"string",enum:["tile","presentation","inline","thumbnail"]},align:{type:"string",enum:["start","center","end"]},padding:{type:["number","object"]},emphasis:{type:"string",enum:["primary","secondary"]},color:{type:"string"},background:{type:"string"},borderColor:{type:"string"},borderRadius:{type:["number","string"]},animate:{type:["boolean","object"]},stalenessThreshold:{type:"number"},staleLabel:{type:"string"},headerSlot:{type:["string","number","array","object","function"]},valueSlot:{type:["string","number","array","object","function"]},deltaSlot:{type:["string","number","array","object","function"]},trendSlot:{type:["string","number","array","object","function"]},footerSlot:{type:["string","number","array","object","function"]},onObservation:{type:"function"}}}};function N(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}function M(e,t){const a=[],r=B[e];if(!r)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(B).join(", ")}`]};for(const n of r.required)null==t[n]&&a.push(`"${n}" is required for ${e}.`);for(const[e,n]of Object.entries(t)){if(null==n)continue;const t=r.props[e];if(t){if(!N(n,t.type)){const r=Array.isArray(t.type)?t.type.join(" | "):t.type;a.push(`"${e}" should be ${r}, got ${Array.isArray(n)?"array":typeof n}.`);continue}t.enum&&"string"==typeof n&&!t.enum.includes(n)&&a.push(`"${e}" value "${n}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const n=Object.keys(r.props),o=new Set(n);for(const r of Object.keys(t))if(void 0!==t[r]&&!o.has(r)){const t=O(r,n),o=t?`Unknown prop "${r}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${r}" for ${e}. Valid props: ${n.join(", ")}.`;a.push(o)}if("array"===r.dataShape){const n=t.data,o={};for(const e of r.dataAccessors){const a=t[e];"string"==typeof a&&(o[e]=a)}const i=function({componentName:e,data:t,accessors:a,requiredProps:r}){if(r)for(const[t,a]of Object.entries(r))if(null==a)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(a){const r=C(t).find(e=>e&&"object"==typeof e);if(r){const t=Object.keys(r);for(const[n,o]of Object.entries(a))if(o&&"string"==typeof o&&!(o in r)){const a=z(o,t),r=a?` Try ${n}="${a}".`:"";return`${e}: ${n} "${o}" not found in data. Available fields: ${t.join(", ")}.${r}`}}}return null}({componentName:e,data:n,accessors:Object.keys(o).length>0?o:void 0});i&&a.push(i)}else if("object"===r.dataShape){const r=function({componentName:e,data:t,dataLabel:a="data"}){return null==t?`${e}: No ${a} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${a} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}({componentName:e,data:t.data});r&&a.push(r)}else if("network"===r.dataShape){const n=function({componentName:e,nodes:t,edges:a,nodesRequired:r=!1,edgesRequired:n=!0,accessors:o}){if(null==t&&null==a)return null;if(n&&(!a||!Array.isArray(a)||0===a.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(r&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(o&&t&&t.length>0){const a=C(t).find(e=>e&&"object"==typeof e);if(a){const t=Object.keys(a);for(const[r,n]of Object.entries(o))if(n&&"string"==typeof n&&!(n in a)){const a=z(n,t),o=a?` Try ${r}="${a}".`:"";return`${e}: ${r} "${n}" not found in node data. Available fields: ${t.join(", ")}.${o}`}}}return null}({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:r.required.includes("nodes"),edgesRequired:r.required.includes("edges")});n&&a.push(n)}return{valid:0===a.length,errors:a}}const _=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),I=new Set(["label","callout","callout-circle","callout-rect"]);function E(e){return"string"==typeof(null==e?void 0:e.type)?e.type:""}function D(e){return!!e&&"object"==typeof e&&_.has(E(e))}function q(e){return I.has(E(e))&&!function(e){return Array.isArray(null==e?void 0:e.disable)&&e.disable.includes("connector")}(e)}const H=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),U=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),G=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),W=new Set(["LineChart","AreaChart","StackedAreaChart"]),V=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]);function J(e){const t=e.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!t)return null;const[a,r,n]=[parseInt(t[1],16)/255,parseInt(t[2],16)/255,parseInt(t[3],16)/255],o=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*o(a)+.7152*o(r)+.0722*o(n)}function Y(e,t){const a=J(e),r=J(t);return null===a||null===r?null:(Math.max(a,r)+.05)/(Math.min(a,r)+.05)}const K=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIDAccessor","childrenAccessor","costAccessor"];const X=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Q=new Set(["PieChart","DonutChart","FunnelChart"]),Z=new Set(["BigNumber"]),ee=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),te=new Set(["OrbitDiagram"]),ae=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),re=new Set(["MultiAxisLineChart"]),ne=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),oe={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},ie=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]);function se(e){return"string"==typeof e&&e.trim().length>0}function ce(e){return"primary"===(null==e?void 0:e.emphasis)||"secondary"===(null==e?void 0:e.emphasis)||null!=function(e){var t;const a=null===(t=null==e?void 0:e.provenance)||void 0===t?void 0:t.confidence;return"number"==typeof a&&Number.isFinite(a)?a:null}(e)}function le(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;const a=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return a?a.length:1}const ue={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},pe=["perceivable","operable","understandable","robust","compromising","assistive","flexible"];function de(e,t){if("function"==typeof e)return t=>+e(t);const a=e||t;return e=>+e[a]}function fe(e,t){if("function"==typeof e)return e;const a=e||t;return e=>e[a]}const ge=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),ye=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),he=new Set(["PieChart","DonutChart","FunnelChart"]),me=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function be(e,t){var a,r;return ye.has(e)||he.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:null!==(a=t.categoryAccessor)&&void 0!==a?a:t.stepAccessor,dimensionFallback:"category"}:{measure:null!==(r=t.yAccessor)&&void 0!==r?r:t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function ve(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const a=e[t];if("string"==typeof a&&a)return a}}function xe(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function Ae(e,t={}){var a,r;const n=!0===t.showRetractedAnnotations,o=!0===t.showSupersededAnnotations,i=new Set;for(const t of e){const e=null===(a=null==t?void 0:t.lifecycle)||void 0===a?void 0:a.supersedes;e&&"retracted"!==(null===(r=null==t?void 0:t.lifecycle)||void 0===r?void 0:r.status)&&i.add(e)}return e.filter(e=>{var t,a;if("retracted"===(null===(t=null==e?void 0:e.lifecycle)||void 0===t?void 0:t.status)&&!n)return!1;const r=null===(a=null==e?void 0:e.provenance)||void 0===a?void 0:a.stableId;return!(r&&i.has(r)&&!o)})}const we={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value"},$e=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]);function Se(e){return we[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}const je=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),ke={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},Oe={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Ce=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],ze={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function Re(e,t){var a;const r=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,a={};for(const[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}(t);if(null==r?void 0:r.act)return r.act;if(null==r?void 0:r.intentScores){const e=function(e){let t,a=0;for(const[r,n]of Object.entries(e))if("number"==typeof n&&n>0)if(n>a)t=r,a=n;else if(n===a&&void 0!==t){const e=Ce.indexOf(r),a=Ce.indexOf(t);-1===e||-1!==a&&e>=a||(t=r)}return t}(r.intentScores);if(e&&ke[e]&&(null!==(a=r.intentScores[e])&&void 0!==a?a:0)>=3)return ke[e]}return(null==r?void 0:r.family)?Oe[r.family]:function(e){return he.has(e)||"StackedAreaChart"===e?"apportioning":je.has(e)?"relating":ye.has(e)?"comparing":me.has(e)?"characterizing":ge.has(e)?"tracking":$e.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function Le(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch(e){t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?a.format(e):t.format(e):e+""}const Fe={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function Te(e){const t=Fe["string"==typeof e.type?e.type:"annotation"]||"an annotation",a=function(e){var t,a;const r=e.provenance&&"object"==typeof e.provenance?e.provenance:null,n=null!==(a=null!==(t=null==r?void 0:r.authorKind)&&void 0!==t?t:null==r?void 0:r.source)&&void 0!==a?a:null==r?void 0:r.basis;return"watcher"===n?"a watcher-flagged ":"agent"===n||"ai"===n||"llm-inference"===n?"an AI-suggested ":""}(e),r=a?a+t.replace(/^an? /,""):t,n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return n?`${r} labeled "${n}"`:r}function Pe(e,t,a={}){var r,n;const o=void 0!==a.levels,i=new Set(null!==(r=a.levels)&&void 0!==r?r:["l1","l2","l3"]);!o&&a.capability&&i.add("l4");const s=Le(null!==(n=a.locale)&&void 0!==n?n:"en"),c=Se(e),l=Array.isArray(t.data)?t.data:null,u=ve(t),{measure:p,measureFallback:d,dimension:f,dimensionFallback:g}=be(e,t),y="string"==typeof p&&p?p:d,h="string"==typeof f&&f?f:g,m={};if(i.has("l1"))if(ge.has(e)||ye.has(e))m.l1=`A ${c} of ${y} by ${h}`+(u?`, split by ${u}.`:".");else if(he.has(e))m.l1=`A ${c} showing ${y} across ${h} categories.`;else if(me.has(e))m.l1=`A ${c} of the distribution of ${y}`+(u?` by ${u}.`:".");else if($e.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,a=Array.isArray(t.edges)?t.edges.length:void 0,r=[null!=e?`${e} ${Ne(e,"node")}`:null,null!=a?`${a} ${Ne(a,"edge")}`:null].filter(Boolean);m.l1=`A ${c}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:y;m.l1=`A single value${e?" for "+e:""}.`}else m.l1=`A ${c}.`;const b=ge.has(e)||ye.has(e)||he.has(e)||me.has(e);let v=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&b&&l&&l.length>0&&(v=function(e,t,a,r){let n=0,o=0,i=1/0,s=-1/0,c=null,l=null,u=0,p=0,d=null,f=null,g=NaN,y=NaN;for(const a of e){const e=t(a);Number.isFinite(e)&&(0===n&&(g=e,d=a),y=e,f=a,i>e&&(i=e,c=a,u=n),e>s&&(s=e,l=a,p=n),n++,o+=e)}return 0===n?null:{count:n,min:i,max:s,mean:o/n,minLabel:xe(null!=c?a(c):null,r),maxLabel:xe(null!=l?a(l):null,r),first:g,last:y,firstLabel:xe(null!=d?a(d):null,r),lastLabel:xe(null!=f?a(f):null,r),minIndex:u,maxIndex:p}}(l,de(p,d),fe(f,g),s)),i.has("l2")&&b&&(l&&0!==l.length?v&&(m.l2=he.has(e)?`${v.count} segments totaling ${s(function(e){return e.mean*e.count}(v))}. Largest is ${v.maxLabel} at ${s(v.max)}; smallest is ${v.minLabel} at ${s(v.min)}.`:`${y} ranges from ${s(v.min)} (${v.minLabel}) to ${s(v.max)} (${v.maxLabel}), with a mean of ${s(v.mean)} across ${v.count} points.`):m.l2="No data is loaded yet."),i.has("l3")&&v&&ge.has(e)?m.l3=function(e,t,a){const{first:r,last:n,min:o,max:i,maxLabel:s,minLabel:c,firstLabel:l,lastLabel:u,minIndex:p,maxIndex:d,count:f}=e,g=i-o,y=n-r;if(0===g)return`${Be(t)} is constant at ${a(r)} across the series.`;if(.04>g/(Math.abs(e.mean)||1))return`${Be(t)} ends roughly where it started (${a(r)} at ${l} to ${a(n)} at ${u}), ranging between ${a(o)} and ${a(i)}.`;const h=d>0&&f-1>d,m=p>0&&f-1>p,b=(i-Math.max(r,n))/g,v=(Math.min(r,n)-o)/g;return h&&b>.15?`Overall ${t} climbs to a peak of ${a(i)} (${s}), then falls to ${a(n)} (${u}).`:m&&v>.15?`Overall ${t} drops to a low of ${a(o)} (${c}), then recovers to ${a(n)} (${u}).`:.05>Math.abs(y)/g?`${Be(t)} ends roughly where it started (${a(r)} at ${l} to ${a(n)} at ${u}), ranging between ${a(o)} and ${a(i)}.`:y>0?d===f-1?`Overall ${t} rises from ${a(r)} (${l}) to a peak of ${a(n)} (${u}).`:`Overall ${t} rises from ${a(r)} (${l}) to ${a(n)} (${u}), after peaking at ${a(i)} (${s}).`:p===f-1?`Overall ${t} falls from ${a(r)} (${l}) to a low of ${a(n)} (${u}).`:`Overall ${t} falls from ${a(r)} (${l}) to ${a(n)} (${u}), after dipping to ${a(o)} (${c}).`}(v,y,s):i.has("l3")&&v&&ye.has(e)&&(m.l3=`The highest ${h} is ${v.maxLabel} and the lowest is ${v.minLabel}.`),i.has("l4")){const r=Re(e,a.capability);r&&(m.l4=function(e,t,a,r,n,o,i,s){const c=ze[e],l=/^[aeiou]/i.test(c)?"an":"a";let u,p;switch(e){case"locating":u="This is a map",p="read values by location";break;case"presenting":u="This is a single-value display",p=`read ${"string"==typeof a.label&&a.label?a.label:n} as the headline number`;break;case"tracing":u=`This is ${l} ${c} chart`,p="follow the movement between states";break;case"nesting":u=`This is ${l} ${c} chart`,p="read it for nested structure and how children sum into their parents";break;case"relating":u=`This is ${l} ${c} chart`,p=`read it for whether ${o} and ${n} move together`;break;default:u=`This is ${l} ${c} chart`,p=function(e,t,a,r,n,o){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+a;case"comparing":return`compare ${a} across ${r}`;case"ranking":return"read it top to bottom by "+a;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+a;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,a){if(ye.has(a)||he.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:r,last:n,min:o,max:i,minLabel:s,maxLabel:c,lastLabel:l,minIndex:u,maxIndex:p,count:d}=e,f=i-o;if(f>0){const e=p>0&&d-1>p,a=u>0&&d-1>u,g=(i-Math.max(r,n))/f,y=(Math.min(r,n)-o)/f;if(e&&g>.15)return`the peak of ${t(i)} at ${c} is the point to investigate`;if(a&&y>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(n>=i)return`the climb to ${t(n)} at ${l} warrants a closer look`;if(o>=n)return`the drop to ${t(n)} at ${l} warrants a closer look`}return`the extremes — ${c} (${t(i)}) and ${s} (${t(o)}) — are the points to check`}(t,n,o);case"tracking":return`read it for the trajectory of ${a}, which ${function(e){const t=e.max-e.min,a=e.last-e.first;return 0===t||.05>Math.abs(a)/t?"holds roughly steady":a>0?"rises":"falls"}(t)} from ${n(t.first)} (${t.firstLabel}) to ${n(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${n(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${n(t.max)}`;case"apportioning":{const e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${n(e)} total; ${t.maxLabel} is the largest at ${n(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${n(t.min)} to ${n(t.max)}`;default:return"read the highlighted features"}}(e,r,n,o,i,t)}return`${u}; ${p}.${function(e,t){var a;if(!t)return"";const r=null===(a=t.familiarity)||void 0===a?void 0:a[e];return"number"!=typeof r||r>2?"":` This ${Se(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(r,e,t,v,y,h,s,a.audience))}const x=["l1","l2","l3","l4"].filter(e=>i.has(e)&&m[e]).map(e=>m[e]).join(" "),A=function(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const a=Ae(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;const r=a.map(Te),n=r.slice(0,5),o=r.length-n.length,i=function(e){var t;return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:null!==(t=e[0])&&void 0!==t?t:""}(n)+(o>0?`, and ${o} more`:""),s=a.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${i}.`}(t);return Object.assign({text:A?`${A} ${x}`.trim():x,levels:m},A?{annotations:A}:{})}function Be(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Ne(e,t){return 1===e?t:t+"s"}function Me(e,t,a={}){var r,n,o;const i=null!==(r=a.locale)&&void 0!==r?r:"en",s=Math.max(1,null!==(n=a.maxLeaves)&&void 0!==n?n:200),c=Le(i),l={id:"root",role:"chart",label:Pe(e,t,{locale:i}).text||"Chart.",level:1,children:[]},u=function(e,t){const a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;const r=Ae(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let n=0;const o=r.slice(0,t).map(e=>{var t;const a=null===(t=e.lifecycle)||void 0===t?void 0:t.status,r=a&&"accepted"!==a?` (${a})`:"";return{id:"annotation-"+n++,role:"annotation",level:3,label:`${o=Te(e),o?o.charAt(0).toUpperCase()+o.slice(1):o}${r}.`,datum:e};var o});r.length>t&&o.push({id:"annotation-"+n++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});const i=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===i?"one marked feature":i+" marked features"}.`,children:o}}(t,s),p=Array.isArray(t.data)?t.data:null,d=ge.has(e)||ye.has(e)||he.has(e)||me.has(e);if(!p||0===p.length||!d)return u&&(l.children=[u]),l;const{measure:f,measureFallback:g,dimension:y,dimensionFallback:h}=be(e,t),m=de(f,g),b=fe(y,h),v="string"==typeof f&&f?f:g,x="string"==typeof y&&y?y:h,A=ve(t);let w=0;const $=e=>`${e}-${w++}`,S=(e,t)=>{const a=e.slice(0,s).map(e=>((e,t)=>{const a=m(e),r=xe(b(e),c);return{id:$("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?c(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}})(e,t));return e.length>s&&a.push({id:$("more"),role:"datum",level:t,label:`…and ${e.length-s} more points`}),a},j=[];if(ge.has(e)||ye.has(e)){let t=1/0,a=-1/0,r=1/0,n=-1/0;const o=[];let i=!0;for(const e of p){const s=m(e);Number.isFinite(s)&&(t>s&&(t=s),s>a&&(a=s));const c=b(e);o.push(c),"number"==typeof c&&Number.isFinite(c)?(r>c&&(r=c),c>n&&(n=c)):i=!1}const s=new Set,l=[];for(const e of o){const t=e+"";s.has(t)||(s.add(t),l.push(e))}const u=i?`${c(r)} to ${c(n)}`:`${xe(l[0],c)} to ${xe(l[l.length-1],c)} (${ye.has(e)?l.length+" categories":p.length+" points"})`;j.push({id:$("axis"),role:"axis",level:2,label:`${ye.has(e)?"Category axis":"X axis"}: ${x}, ${u}.`}),t>a||j.push({id:$("axis"),role:"axis",level:2,label:`Value axis: ${v}, ${c(t)} to ${c(a)}.`})}if(A){const a=fe(A,A),r=new Map;for(const e of p){const t=(null!==(o=a(e))&&void 0!==o?o:"—")+"",n=r.get(t);n?n.push(e):r.set(t,[e])}const n=[];for(const[a,o]of r){const r=Pe(e,Object.assign(Object.assign({},t),{data:o}),{levels:["l2","l3"],locale:i}).text;n.push({id:$("series"),role:"series",level:2,label:`Series ${a}: ${r}`,children:S(o,3)})}l.children=[...j,...n]}else l.children=[...j,...S(p,2)];return u&&l.children.push(u),l}function _e(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);r.length>n;n++)0>t.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]])}return a}function Ie(e,t,a,r){return new(a||(a=Promise))(function(n,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,s)}c((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const Ee=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend"]),De=new Set(["data","nodes","edges"]),qe="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function He(e){const{component:t,props:a}=e,r=["<"+t];for(const[e,t]of Object.entries(a))if("string"==typeof t)r.push(` ${e}="${t}"`);else if("boolean"==typeof t&&!0===t)r.push(" "+e);else if("boolean"==typeof t&&!1===t)r.push(` ${e}={false}`);else if("number"==typeof t)r.push(` ${e}={${t}}`);else{const a=JSON.stringify(t);r.push(80>a.length?` ${e}={${a}}`:` ${e}={${JSON.stringify(t,null,2)}}`)}return r.push("/>"),r.join("\n")}function Ue(e,t){var a;const r=e.children,n=t.children,o=window.getComputedStyle(e),i=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of i){const r=o.getPropertyValue(e);r&&"none"!==r&&""!==r&&(null===(a=t.style)||void 0===a||a.setProperty(e,r))}for(let e=0;Math.min(r.length,n.length)>e;e++)Ue(r[e],n[e])}function Ge(e,t){const a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}function We(e){return"nominal"===e||"ordinal"===e}function Ve(e){return"quantitative"===e||"temporal"===e}const Je={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},Ye={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},Ke={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function Xe(e,t,a,r,n){var o,i;(null==e?void 0:e.field)&&(a.xAccessor=r?"value":e.field),(null==t?void 0:t.field)&&(a.yAccessor=n?"value":t.field),(null===(o=null==e?void 0:e.axis)||void 0===o?void 0:o.title)&&(a.xLabel=e.axis.title),(null===(i=null==t?void 0:t.axis)||void 0===i?void 0:i.title)&&(a.yLabel=t.axis.title)}function Qe(e,t,a){const r={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){r.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return r}class Ze{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const a of e){const e=this.push(a);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e(this.buffer[(t+a)%this._capacity],a)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e[a]=this.buffer[(t+a)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray(),a=[];for(;t.length>e;)a.push(t.shift());this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(const e of t)this.push(e);return a}update(e,t){const a=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++){const o=(r+n)%this._capacity,i=this.buffer[o];if(e(i)){let e;e="object"!=typeof i||null===i?i:Array.isArray(i)?[...i]:Object.assign({},i),a.push(e),this.buffer[o]=t(i)}}return a}remove(e){const t=[],a=[];if(this.forEach(r=>{e(r)?a.push(r):t.push(r)}),0===a.length)return a;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return a}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}}const et={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function tt(e,t){return"function"==typeof t?t(e):e[t]}function at(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}return e instanceof Date?e.toLocaleDateString():"object"==typeof e&&null!==e?void 0!==e.id?e.id+"":void 0!==e.name?e.name+"":JSON.stringify(e):e+""}function rt(t={}){const{fields:a,title:r,format:n,style:o={},className:i=""}=t;return t=>{if(!t||"object"!=typeof t)return null;let s;const c=[];if(r){const e=tt(t,r);s=at(e,n)}if(a&&a.length>0)a.forEach(e=>{let a,r,o;"string"==typeof e?(a=e,r=e,o=n):(a=e.label,r=e.accessor||e.key||"",o=e.format||n);const i=tt(t,r);c.push({label:a,value:at(i,o)})});else if(!r){const e=["value","y","name","id","label"];for(const a of e)if(void 0!==t[a]){s=at(t[a],n);break}if(!s){const e=Object.keys(t).filter(e=>!e.startsWith("_"));e.length>0&&(s=at(t[e[0]],n))}}const l=Object.assign(Object.assign({},et),o);return e.jsxs("div",{className:("semiotic-tooltip "+i).trim(),style:l,children:[s&&e.jsx("div",{style:{fontWeight:c.length>0?"bold":"normal"},children:s}),c.map((t,a)=>e.jsxs("div",{style:{marginTop:0===a&&s?"4px":0},children:[t.label&&e.jsxs("span",{children:[t.label,": "]}),t.value]},a))]})}}function nt(e=240){const t=360-e,a=180+t/2,r=a*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:a,startAngleRad:r,offsetRad:-Math.PI/2+r}}const ot=Symbol("semiotic.useStreamStatus.wrapped");exports.CARBON_ALERT={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},exports.CARBON_CATEGORICAL_14=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],exports.COLOR_BLIND_SAFE_CATEGORICAL=i,exports.DARK_THEME=c,exports.HIGH_CONTRAST_THEME=l,exports.IncrementalExtent=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const a of e){const e=t?t(a):a;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},exports.LIGHT_THEME=s,exports.MultiPointTooltip=function(){return t=>{var a,r,n,o,i,s,c;const l=t.allSeries;if(!l||0===l.length){const o=null!==(r=null===(a=t.data)||void 0===a?void 0:a.value)&&void 0!==r?r:null===(n=t.data)||void 0===n?void 0:n.y;return e.jsx("div",{className:"semiotic-tooltip",style:et,children:e.jsx("div",{children:at(o)})})}const u=null!==(s=null!==(o=t.xValue)&&void 0!==o?o:null===(i=t.data)||void 0===i?void 0:i.time)&&void 0!==s?s:null===(c=t.data)||void 0===c?void 0:c.x;return e.jsxs("div",{className:"semiotic-tooltip",style:et,children:[null!=u&&e.jsx("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:at(u)}),l.map((t,a)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:t.color,flexShrink:0}}),e.jsx("span",{style:{flex:1,fontSize:"0.85em"},children:t.group}),e.jsx("span",{style:{fontWeight:500,fontSize:"0.85em"},children:at(t.value)})]},a))]})}},exports.RingBuffer=Ze,exports.THEME_PRESETS=f,exports.ThemeProvider=function({theme:t,children:a}){const n="string"==typeof t&&g(t)?t:void 0,o=r.useMemo(()=>function(e){return void 0!==e?u(s,v(e)):"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(forced-colors: active)").matches?l:s}(t),[t]);return e.jsx(p,{initialState:{theme:o},children:e.jsxs(m.Provider,{value:n,children:[e.jsx(x,{theme:t}),e.jsx(A,{children:a})]})})},exports.accessibilityCaveats=function(e,{onlyCritical:t=!1}={}){const a=[];for(const r of e.findings)"fail"!==r.status&&"warn"!==r.status||t&&!r.critical||a.push(r.message);return a},exports.adaptiveTimeTicks=function(e){let t,a=e;return(r,n,o)=>{const i=r instanceof Date?r:new Date(r);e||!o||2>o.length||o===t||(t=o,a=function(e){if(2>e.length)return"days";const t=[];for(let a=1;e.length>a;a++)t.push(e[a]-e[a-1]);t.sort((e,t)=>e-t);const a=t[Math.floor(t.length/2)];return 12e4>a?"seconds":72e5>a?"minutes":2*w>a?"hours":60*w>a?"days":400*w>a?"months":"years"}(o));const s=a||"days";return null!=n&&0!==n&&o&&0!==o.length?function(e,t,a){const r=e.getUTCFullYear()!==t.getUTCFullYear(),n=r||e.getUTCMonth()!==t.getUTCMonth(),o=n||e.getUTCDate()!==t.getUTCDate(),i=o||e.getUTCHours()!==t.getUTCHours(),s=i||e.getUTCMinutes()!==t.getUTCMinutes(),c=S[e.getUTCMonth()],l=e.getUTCDate(),u=e.getUTCFullYear(),p=$(e.getUTCHours()),d=$(e.getUTCMinutes()),f=$(e.getUTCSeconds());switch(a){case"seconds":return r?`${c} ${l}, ${u} ${p}:${d}:${f}`:o?`${c} ${l} ${p}:${d}:${f}`:i?`${p}:${d}:${f}`:s?`${d}:${f}`:":"+f;case"minutes":return r?`${c} ${l}, ${u} ${p}:${d}`:o?`${c} ${l} ${p}:${d}`:i?`${p}:${d}`:":"+d;case"hours":return r?`${c} ${l}, ${u} ${p}:00`:n?`${c} ${l} ${p}:${d}`:o?`${c} ${l} ${p}:00`:p+":00";case"days":return r?`${c} ${l}, ${u}`:n?`${c} ${l}`:""+l;case"months":return r?`${c} ${u}`:""+c;case"years":return""+u}}(i,new Date(o[n-1]),s):function(e,t){const a=S[e.getUTCMonth()],r=e.getUTCDate(),n=e.getUTCFullYear(),o=$(e.getUTCHours()),i=$(e.getUTCMinutes()),s=$(e.getUTCSeconds());switch(t){case"seconds":return`${a} ${r}, ${n} ${o}:${i}:${s}`;case"minutes":case"hours":return`${a} ${r}, ${n} ${o}:${i}`;case"days":return`${a} ${r}, ${n}`;case"months":return`${a} ${n}`;case"years":return""+n}}(i,s)}},exports.auditAccessibility=function(e,t,a={}){const r=[],n=!!B[e],o=!0===a.inChartContainer,i=!0===a.describe,s=!0===a.navigable,c=Z.has(e),l=X.has(e),u=!1!==t.accessibleTable&&!c,p=se(t.title),d=se(t.description),f=se(t.summary),g=p||d||f,y=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),h=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],m=n?"pass":"manual",b=n?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(r.push(function(e){const t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},a=e.colorScheme,r="string"==typeof e.background?e.background:null;if(r&&!r.startsWith("#"))return Object.assign(Object.assign({},t),{status:"manual",message:`Background "${r}" 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 n=null!=r?r:"#ffffff";if(!Array.isArray(a))return Object.assign(Object.assign({},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 o=[];let i=0;for(const e of a){if("string"!=typeof e||!e.startsWith("#"))continue;const t=Y(e,n);null!=t&&(i++,3>t&&o.push(`${e} (${t.toFixed(1)}:1)`))}return Object.assign(Object.assign({},t),0===i?{status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:o.length>0?{status:"fail",message:`${o.length} color(s) fall below 3:1 contrast vs ${n}: ${o.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{status:"pass",message:`All ${i} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${n}.`})}(t)),r.push(Object.assign({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0},c?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:u?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:d&&f?{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."})),r.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."}),r.push(Object.assign({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0},null!=t.pulse||te.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){r.push(Object.assign({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1},!0===t.directLabel||!0===t.showLabels?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:"Categories are encoded by color (colorBy) with no redundant channel — Semiotic does not yet ship texture/pattern fills.",fix:"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy), keep categories ≤ ~7, and use a CVD-safe palette."}));const e=Array.isArray(t.colorScheme)?t.colorScheme:null,a=e?e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase()):[],n=a.length>0&&a.every(e=>ie.has(e));r.push(Object.assign({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1},n?{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.'})),r.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:"There's no per-category texture/pattern channel to toggle as an alternative to color.",fix:"Until texture fills land, ensure the encoding survives color removal: direct labels + a CVD-safe palette. Contrast itself is themeable via CSS variables."})}{const e=h.filter(D);if(e.length>0){const a=t.autoPlaceAnnotations,n="object"==typeof a&&null!==a&&!0===a.redundantCues,o=e.filter(e=>{if("string"!=typeof e.color)return!1;const t=E(e),a=n&&"text"===t;return!(q(e)||a)});r.push(Object.assign({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1},0===o.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:`${o.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."}))}}r.push(Object.assign({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0},n?{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&&r.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 a=oe[e];if(a&&y){const e=t[a];"number"==typeof e&&e>0&&24>2*e&&r.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${a}=${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."})}}r.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:m,message:`The chart takes a single tab stop and navigates data with arrow keys${b} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),r.push(Object.assign({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0},y?f||d?{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."})),r.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:m,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${b}.`}),r.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:m,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${b}.`,fix:n?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),r.push(Object.assign({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0},g?{status:"pass",message:`Provided: ${[p&&"title",d&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:o?{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)."})),r.push(Object.assign({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0},d||f?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:i?{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(se).join(". "),a=e?function(e){const t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),a=e.trim().split(/\s+/).filter(Boolean);if(0===a.length||0===t.length)return null;let r=0;for(const e of a)r+=le(e);return a.length/t.length*.39+r/a.length*11.8-15.59}(e):null;r.push(Object.assign({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0},null==a?{status:"not-applicable",message:"No description/summary text to grade."}:a>9?{status:"warn",message:`Description/summary reads at ~grade ${a.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(a))} (≤ 9).`}))}if(ee.has(e)){const e=se(t.xLabel),a=se(t.yLabel);r.push(Object.assign({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1},e&&a?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!a&&"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(re.has(e)&&r.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."}),h.length>1){const e=h.filter(ce).length;r.push(Object.assign({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1},e===h.length?{status:"pass",message:`All ${h.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:h.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:`${h.length-e} of ${h.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)&&r.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&&r.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:m,message:`Transitions animate with object constancy and data changes are mirrored to the live region${b}.`,fix:n?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),r.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."}),r.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."}),r.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:m,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${b}.`,fix:n?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),r.push(Object.assign({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0},c?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:u?{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)."})),c||r.push(Object.assign({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1},o?{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)."})),r.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:n?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${n?"":b}.`,fix:n?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),r.push(Object.assign({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1},s?{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:l?{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:m,message:`Keyboard navigation steps through points and switches series/groups${b}.`,fix:n?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}));{const a=Array.isArray(t.data)?t.data:null,n=Array.isArray(t.nodes)?t.nodes:null,o={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};let i;i=Q.has(e)&&a&&a.length>7?Object.assign(Object.assign({},o),{status:"warn",message:a.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.'}):Object.assign(Object.assign({},o),n&&n.length>200?{status:"warn",message:n.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."}:a&&a.length>5e3?{status:"warn",message:a.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."}:a?{status:"pass",message:a.length+" data points — a reasonable density for non-visual consumption."}:n?{status:"pass",message:n.length+" nodes — a reasonable density for non-visual consumption."}:{status:"manual",message:"Data not provided inline (push mode); verify density at runtime."}),r.push(i)}{const e=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]);let n=!1;if(e&&!a)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){n=!0;break}if(n)break}n&&r.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.'})}r.push(Object.assign({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1},i?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{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."})),r.push(Object.assign({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0},c?{status:"not-applicable",message:"Single value — nothing to skip."}:u?{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."})),r.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:m,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${b}.`,fix:n?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),r.push(Object.assign({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1},te.has(e)||ae.has(e)?{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:m,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${b}.`}));{const a=!0===t.responsiveWidth||!0===t.responsiveHeight,n=ne.has(e)&&!0===t.zoomable;r.push(Object.assign({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1},a?{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.`}:n?{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."}))}const v=r.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),x={criticalsPassed:v.filter(e=>"pass"===e.status).length,criticalsEvaluated:v.length,fails:r.filter(e=>"fail"===e.status).length,warnings:r.filter(e=>"warn"===e.status).length,manual:r.filter(e=>"manual"===e.status).length,passes:r.filter(e=>"pass"===e.status).length};return{component:e,ok:!v.some(e=>"fail"===e.status),summary:x,findings:r,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)."}},exports.buildNavigationTree=Me,exports.buildReaderGrounding=function(e,t,a={}){var r;const{capability:n,audience:o,locale:i}=a,s=null!==(r=a.levels)&&void 0!==r?r:["l1","l2","l3"],c=!1!==a.includeStructure,l=Re(e,n),u=Pe(e,t,{levels:l?[...s,"l4"]:s,locale:i,capability:n,audience:o}),p=u.levels,{l4:d}=p,f=_e(p,["l4"]),g=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),y=Object.assign({levels:f,text:u.annotations?`${u.annotations} ${g}`.trim():g},u.annotations?{annotations:u.annotations}:{});let h;if(l&&d){const e=(m=n)?"fits"in m||"buildProps"in m?{family:m.family}:{family:m.family,intentScores:m.intentScores}:{};h={act:l,sentence:d,family:e.family,intentScores:e.intentScores}}var m;const b=c?Me(e,t,{maxLeaves:a.maxLeaves,locale:i}):void 0,v=[y.text,null==h?void 0:h.sentence].filter(Boolean).join(" ");return{component:e,description:y,intent:h,structure:b,text:v}},exports.communicativeActForIntent=function(e){return ke[e]},exports.computeArcBoundingBox=function(e=240){const{sweepRad:t,offsetRad:a}=nt(e),r=[[Math.cos(a),Math.sin(a)],[Math.cos(a+t),Math.sin(a+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-a)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||r.push([Math.cos(e),Math.sin(e)]);const n=r.map(e=>e[0]),o=r.map(e=>e[1]),i=Math.min(...n),s=Math.max(...n),c=Math.min(...o),l=Math.max(...o);return{minX:i,maxX:s,minY:c,maxY:l,width:s-i,height:l-c,cx:(i+s)/2,cy:(c+l)/2}},exports.configToJSX=He,exports.copyConfig=function(e){return Ie(this,arguments,void 0,function*(e,t="json"){const a="jsx"===t?He(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");yield navigator.clipboard.writeText(a)})},exports.countNodes=function e(t){let a=1;if(t.children)for(const r of t.children)a+=e(r);return a},exports.createHatchPattern=function(e={},t){const{background:a="transparent",stroke:r="#000",lineWidth:n=1.5,spacing:o=6,angle:i=45}=e,s=Math.max(8,Math.ceil(2*o));let c;try{c=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(j||(j=document.createElement("canvas")),j.width=e,j.height=e,j)}(s)}catch(e){return null}const l=c.getContext("2d");if(!l)return null;a&&"transparent"!==a?(l.fillStyle=a,l.fillRect(0,0,s,s)):l.clearRect(0,0,s,s),l.strokeStyle=r,l.lineWidth=n,l.lineCap="square";const u=i*Math.PI/180;if(45===i||-45===i){const e=i>0?1:-1;for(let t=-s;2*s>=t;t+=o)l.beginPath(),l.moveTo(t,0),l.lineTo(t+e*s,s),l.stroke()}else{l.save(),l.translate(s/2,s/2),l.rotate(u);const e=2*s;for(let t=-e;e>=t;t+=o)l.beginPath(),l.moveTo(-e,t),l.lineTo(e,t),l.stroke();l.restore()}return(t||l).createPattern(c,"repeat")},exports.darkenColor=function(e,t=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;const r=Math.round(parseInt(a[1],16)*(1-t)),n=Math.round(parseInt(a[2],16)*(1-t)),o=Math.round(parseInt(a[3],16)*(1-t));return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`},exports.describeChart=Pe,exports.deserializeSelections=function(e){const t=new Map;for(const[a,r]of Object.entries(e)){const e=new Map;for(const t of r.clauses){const a={};for(const[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:new Set(r.values)}:{type:"interval",range:r.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:a})}t.set(a,{name:r.name,resolution:r.resolution,clauses:e})}return t},exports.diagnoseConfig=function(e,t){const a=[],r=M(e,t);for(const e of r.errors)a.push({severity:"error",code:"VALIDATION",message:e,fix:""});return B[e]?(function(e,t,a){const r=B[e];if(r){if("array"===r.dataShape){const e=t.data;e&&Array.isArray(e)&&0===e.length&&a.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"===r.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&a.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,t,a),function(e,t,a){const r=t.width,n=t.height;if(void 0===r||"number"==typeof r&&r>0||a.push({severity:"error",code:"BAD_WIDTH",message:`width=${JSON.stringify(r)} — chart needs a positive number.`,fix:"Set width={600} or use responsiveWidth={true}."}),void 0===n||"number"==typeof n&&n>0||a.push({severity:"error",code:"BAD_HEIGHT",message:`height=${JSON.stringify(n)} — chart needs a positive number.`,fix:"Set height={400} or use responsiveHeight={true}."}),t.size&&Array.isArray(t.size)){const[e,r]=t.size;(null!=e&&0>=e||null!=r&&0>=r)&&a.push({severity:"error",code:"BAD_SIZE",message:`size=[${e}, ${r}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}(0,t,a),function(e,t,a){const r=B[e];if(!r||"array"!==r.dataShape)return;const n=t.data;if(!n||!Array.isArray(n)||0===n.length)return;const o=n[0];if(!o||"object"!=typeof o)return;const i=Object.keys(o);for(const e of r.dataAccessors){const r=t[e];"string"==typeof r&&(r in o||a.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${r}" not found in data. Available fields: ${i.join(", ")}.`,fix:`Change ${e} to one of: ${i.map(e=>`"${e}"`).join(", ")}.`}))}}(e,t,a),function(e,t,a){H.has(e)&&Array.isArray(t.data)&&a.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,t,a),function(e,t,a){U.has(e)&&(t.edges||t.data||a.push({severity:"error",code:"NETWORK_NO_EDGES",message:e+" requires an edges prop.",fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'}))}(e,t,a),function(e,t,a){const r=B[e];if(!r||"array"!==r.dataShape)return;const n=t.data;if(!n||!Array.isArray(n)||0===n.length)return;const o=n[0];if(!o||"object"!=typeof o)return;const i=t.xAccessor;"string"==typeof i&&o[i]instanceof Date&&!t.xFormat&&a.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${i}" 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,t,a),function(e,t,a){t.linkedHover&&!t.selection&&a.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,t,a),function(e,t,a){var r;if(!G.has(e))return;const n=t.rExtent||t.yExtent;n&&Array.isArray(n)&&n.length>=1&&null!=n[0]&&0!==n[0]&&a.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${n[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, ${null!==(r=n[1])&&void 0!==r?r:"auto"}]}. For trend-focused charts, use LineChart instead.`})}(e,t,a),function(e,t,a){if(!W.has(e))return;if(t.gapStrategy)return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const n=t.yAccessor||"y";"string"==typeof n&&r.some(e=>{const t=e[n];return null==t||Number.isNaN(t)})&&a.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${n}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}(e,t,a),function(e,t,a){var r,n;const o=null!==(r=t.width)&&void 0!==r?r:600,i=null!==(n=t.height)&&void 0!==n?n:400,s=t.margin;if(!s||"object"!=typeof s)return;const c=(s.left||0)+(s.right||0),l=(s.top||0)+(s.bottom||0);o>c||a.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${c}px) >= width (${o}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),i>l||a.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${l}px) >= height (${i}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}(0,t,a),function(e,t,a){var r;const n=B[e];if(!n||"array"!==n.dataShape)return;const o=t.data;if(!o||!Array.isArray(o)||0===o.length)return;const i=[];t.xAccessor&&"string"==typeof t.xAccessor&&i.push({prop:"xAccessor",name:t.xAccessor}),t.yAccessor&&"string"==typeof t.yAccessor&&i.push({prop:"yAccessor",name:t.yAccessor}),t.valueAccessor&&"string"==typeof t.valueAccessor&&i.push({prop:"valueAccessor",name:t.valueAccessor});const s=Math.min(o.length,5);for(const e of i){let t=!0;for(let a=0;s>a;a++){const n=null===(r=o[a])||void 0===r?void 0:r[e.name];if("number"==typeof n&&Number.isFinite(n)){t=!1;break}}t&&a.push({severity:"error",code:"DEGENERATE_EXTENT",message:`${e.prop}="${e.name}" produces NaN or non-finite values for all sampled data points — chart extents will be invalid.`,fix:`Ensure data[].${e.name} contains finite numbers, or use a function accessor to transform values.`})}}(e,t,a),function(e,t,a){if(!V.has(e))return;const r=t.barPadding;"number"==typeof r&&10>r&&a.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${r} 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,t,a),function(e,t,a){if("bottom"!==t.legendPosition)return;const r=t.margin;if(!r||"object"!=typeof r)return;const n=r.bottom;"number"==typeof n&&70>n&&a.push({severity:"warning",code:"BOTTOM_MARGIN_WITH_LEGEND",message:`legendPosition="bottom" with margin.bottom=${n}px — legend may overlap axis labels.`,fix:"Increase margin.bottom to at least 70, e.g. margin={{ ...margin, bottom: 80 }}."})}(0,t,a),function(e,t,a){var r;if(!t.showLegend)return;if("right"!==(null!==(r=t.legendPosition)&&void 0!==r?r:"right"))return;const n=t.margin;if(!n||"object"!=typeof n)return;const o=n.right;"number"==typeof o&&100>o&&a.push({severity:"warning",code:"LEGEND_MARGIN_TIGHT",message:`showLegend is true with legendPosition="right" but margin.right=${o}px — legend may be clipped or overlap the chart.`,fix:"Increase margin.right to at least 100, e.g. margin={{ ...margin, right: 120 }}."})}(0,t,a),function(e,t,a){if("Heatmap"!==e)return;const r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;const n=r[0];if(n&&"object"==typeof n)for(const e of["xAccessor","yAccessor"]){const r=t[e];if("string"!=typeof r)continue;const o=n[r];"string"==typeof o&&a.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${r}" resolves to string values (e.g. "${o}"). 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,t,a),function(e,t,a){const r=t.colorScheme;if(!r||!Array.isArray(r))return;const n="string"==typeof t.background?t.background:"#ffffff";if(!n.startsWith("#"))return;const o=[];for(const e of r){if("string"!=typeof e||!e.startsWith("#"))continue;const t=Y(e,n);null!==t&&3>t&&o.push(`${e} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${o.length} color(s) in colorScheme have < 3:1 contrast against background "${n}": ${o.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,t,a),function(e,t,a){const r=t.colorScheme;if(!r||!Array.isArray(r)||2>r.length)return;const n=r.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>n.length)return;const o=[];for(let e=0;n.length-1>e;e++){const t=Y(n[e],n[e+1]);null!==t&&1.5>t&&o.push(`${n[e]} / ${n[e+1]} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${o.length} adjacent color pair(s) in colorScheme have very similar luminance: ${o.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,t,a),function(e,t,a){const r="string"==typeof t.title&&t.title.trim().length>0,n="string"==typeof t.description&&t.description.trim().length>0,o="string"==typeof t.summary&&t.summary.trim().length>0;r||n||o||a.push({severity:"warning",code:"MISSING_DESCRIPTION",message:'No title, description, or summary provided. Screen readers will use a generic label like "XY chart".',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.'})}(0,t,a),function(e,t,a){const r=[];for(const e of K)"function"==typeof t[e]&&r.push(e);r.length>0&&a.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${r.length>1?"s":""} detected: ${r.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference which may trigger unnecessary scene rebuilds.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}(0,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(const e of r){if(!e||"object"!=typeof e)continue;const t=E(e);if(!D(e)||"widget"===t)continue;const r=Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0),n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,o=q(e);!o&&r>120?a.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${n}" sits ~${Math.round(r)}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).'}):o&&r>250&&a.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${n}" uses a very long connector (~${Math.round(r)}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,t,a),function(e,t,a){const r=Array.isArray(t.annotations)?t.annotations:null;if(!r)return;const n=r.filter(D).length;if(0===n)return;const o="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400,s=function(e,t,a={}){return"number"==typeof a.maxAnnotations&&Number.isFinite(a.maxAnnotations)?Math.max(0,Math.floor(a.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(a.areaPerAnnotation&&a.areaPerAnnotation>0?a.areaPerAnnotation:2e4))):1/0}(o,i);Number.isFinite(s)&&n>s&&a.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${n} note annotations on a ${o}×${i} 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,t,a),{ok:a.every(e=>"warning"===e.severity),diagnoses:a}):{ok:0===a.length,diagnoses:a}},exports.exportChart=function(e,t){return Ie(this,void 0,void 0,function*(){const{format:a="png",filename:r="chart",scale:n=2,background:o="white"}=t||{},i=e.querySelector("svg");if(!i)throw Error("No SVG element found in the container");const s=i.cloneNode(!0),c=i.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",c.width+""),s.getAttribute("height")||s.setAttribute("height",c.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ue(i,s),"svg"===a){const e=(new XMLSerializer).serializeToString(s);Ge(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),r+".svg")}else{const t=c.width*n,a=c.height*n,i=document.createElement("canvas");i.width=t,i.height=a;const l=i.getContext("2d");l.fillStyle=o,l.fillRect(0,0,t,a),l.scale(n,n);const u=e.querySelector("canvas");u&&l.drawImage(u,0,0,c.width,c.height);const p=(new XMLSerializer).serializeToString(s),d=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),f=URL.createObjectURL(d),g=new Image;g.width=c.width,g.height=c.height,yield new Promise((e,t)=>{g.onload=()=>{l.drawImage(g,0,0),i.toBlob(a=>{a?(Ge(a,r+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(f)},g.onerror=()=>{URL.revokeObjectURL(f),t(Error("Failed to load SVG image"))},g.src=f})}})},exports.flattenVisible=function(e,t){const a=[],r=e=>{if(a.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)r(t)};return r(e),a},exports.formatAccessibilityAudit=function(e){const t=[],a=e.summary,r=e.ok?`${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`:`${a.fails} blocking failure(s) — ${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${r} · ${a.warnings} warning(s) · ${a.manual} to verify manually`);for(const a of pe){const r=e.findings.filter(e=>e.principle===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(const e of r)t.push(` ${ue[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")},exports.fromConfig=function(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if(!B[e.component])throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:qe(e.props)}},exports.fromURL=function(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const a=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(escape(atob(a)));return JSON.parse(r)},exports.fromVegaLite=function(e){var t,a,r,n,o,i,s,c,l,u,p,d;const f=[],{type:g,markProps:y}=function(e){if("string"==typeof e)return{type:e,markProps:{}};const{type:t}=e;return{type:t,markProps:_e(e,["type"])}}(e.mark),h=e.encoding||{},m=h.x,b=h.y,v=h.color,x=h.size,A=h.theta,w=h.opacity;let $;(null===(t=e.data)||void 0===t?void 0:t.values)?$=e.data.values:(null===(a=e.data)||void 0===a?void 0:a.url)&&f.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&f.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&f.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&f.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||h.facet||h.row||h.column)&&f.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&f.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&f.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const S={};e.width&&(S.width=e.width),e.height&&(S.height=e.height);const j=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(j&&(S.title=j),(null==v?void 0:v.field)&&(S.colorBy=v.field,null===(r=v.scale)||void 0===r?void 0:r.scheme)){const e=Je[v.scale.scheme];e&&(S.colorScheme=e)}void 0!==(null==w?void 0:w.value)&&(S.pointOpacity=w.value);const k=null==m?void 0:m.aggregate,O=null==b?void 0:b.aggregate;if($&&(k||O)){const e=O?b:m,t=O?m:b,a=Ke[e.aggregate];if(a&&(null==t?void 0:t.field)&&e.field)$=function(e,t){const{groupBy:a,value:r,agg:n="sum"}=t,o=new Map;for(const t of e){const e=t[a]+"";o.has(e)||o.set(e,[]),o.get(e).push(Number(t[r]))}const i=[];for(const[e,t]of o){let r;switch(n){case"count":r=t.length;break;case"mean":r=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":r=Math.min(...t);break;case"max":r=Math.max(...t);break;default:r=t.reduce((e,t)=>e+t,0)}i.push({[a]:e,value:r})}return i}($,{groupBy:t.field,value:e.field,agg:a});else if(("count"===a||"count"===e.aggregate)&&(null==t?void 0:t.field)&&$){const e=new Map;for(const a of $){const r=a[t.field]+"";e.set(r,(e.get(r)||0)+1)}$=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if((null==m?void 0:m.bin)||(null==b?void 0:b.bin)){const e="Histogram";$&&(S.data=$),(null==m?void 0:m.bin)?(S.valueAccessor=m.field,(null==b?void 0:b.field)&&(S.categoryAccessor=b.field),(null===(n=m.axis)||void 0===n?void 0:n.title)&&(S.valueLabel=m.axis.title)):(null==b?void 0:b.bin)&&(S.valueAccessor=b.field,(null==m?void 0:m.field)&&(S.categoryAccessor=m.field),(null===(o=b.axis)||void 0===o?void 0:o.title)&&(S.valueLabel=b.axis.title));const t=(null==m?void 0:m.bin)||(null==b?void 0:b.bin),a="object"==typeof t?t.maxbins:void 0;return a&&(S.bins=a),Qe(e,S,f)}let C;switch(g){case"bar":C=function(e,t,a,r,n,o,i){var s,c,l,u,p,d;let f;return(null==a?void 0:a.field)&&!1!==(null==e?void 0:e.stack)&&!1!==(null==t?void 0:t.stack)&&null!==(null==e?void 0:e.stack)&&null!==(null==t?void 0:t.stack)?(f="StackedBarChart",r.stackBy=a.field):f="BarChart",We(null==e?void 0:e.type)&&Ve(null==t?void 0:t.type)?(r.categoryAccessor=e.field,r.valueAccessor=i?"value":t.field,(null===(s=null==e?void 0:e.axis)||void 0===s?void 0:s.title)&&(r.categoryLabel=e.axis.title),(null===(c=null==t?void 0:t.axis)||void 0===c?void 0:c.title)&&(r.valueLabel=t.axis.title)):Ve(null==e?void 0:e.type)&&We(null==t?void 0:t.type)?(r.categoryAccessor=t.field,r.valueAccessor=o?"value":e.field,r.orientation="horizontal",(null===(l=null==t?void 0:t.axis)||void 0===l?void 0:l.title)&&(r.categoryLabel=t.axis.title),(null===(u=null==e?void 0:e.axis)||void 0===u?void 0:u.title)&&(r.valueLabel=e.axis.title)):((null==e?void 0:e.field)&&(r.categoryAccessor=e.field),(null==t?void 0:t.field)&&(r.valueAccessor=i?"value":t.field),(null===(p=null==e?void 0:e.axis)||void 0===p?void 0:p.title)&&(r.categoryLabel=e.axis.title),(null===(d=null==t?void 0:t.axis)||void 0===d?void 0:d.title)&&(r.valueLabel=t.axis.title)),n&&(r.data=n),f}(m,b,v,S,$,k,O);break;case"line":if(C="LineChart",Xe(m,b,S,k,O),(null==v?void 0:v.field)&&(S.lineBy=v.field),y.interpolate){const e=Ye[y.interpolate];e&&(S.curve=e)}!0===y.point&&(S.showPoints=!0),$&&(S.data=$);break;case"area":if((null==v?void 0:v.field)?(C="StackedAreaChart",S.areaBy=v.field):C="AreaChart",Xe(m,b,S,k,O),y.interpolate){const e=Ye[y.interpolate];e&&(S.curve=e)}void 0!==y.opacity&&(S.areaOpacity=y.opacity),$&&(S.data=$);break;case"point":case"circle":case"square":(null==x?void 0:x.field)?(C="BubbleChart",S.sizeBy=x.field,(null===(i=x.scale)||void 0===i?void 0:i.range)&&(S.sizeRange=x.scale.range)):C="Scatterplot",Xe(m,b,S,k,O),$&&(S.data=$);break;case"rect":C="Heatmap",(null==m?void 0:m.field)&&(S.xAccessor=m.field),(null==b?void 0:b.field)&&(S.yAccessor=b.field),(null==v?void 0:v.field)&&(S.valueAccessor=v.field,delete S.colorBy),(null===(s=null==m?void 0:m.axis)||void 0===s?void 0:s.title)&&(S.xLabel=m.axis.title),(null===(c=null==b?void 0:b.axis)||void 0===c?void 0:c.title)&&(S.yLabel=b.axis.title),$&&(S.data=$);break;case"arc":y.innerRadius&&y.innerRadius>0?(C="DonutChart",S.innerRadius=y.innerRadius):C="PieChart",(null==A?void 0:A.field)?S.valueAccessor=A.field:(null==b?void 0:b.field)&&(S.valueAccessor=O?"value":b.field),(null==v?void 0:v.field)&&(S.categoryAccessor=v.field),(null==m?void 0:m.field)&&!(null==A?void 0:A.field)&&(S.categoryAccessor=m.field),$&&(S.data=$);break;case"tick":C="DotPlot",We(null==m?void 0:m.type)?(S.categoryAccessor=m.field,(null==b?void 0:b.field)&&(S.valueAccessor=O?"value":b.field),(null===(l=null==m?void 0:m.axis)||void 0===l?void 0:l.title)&&(S.categoryLabel=m.axis.title),(null===(u=null==b?void 0:b.axis)||void 0===u?void 0:u.title)&&(S.valueLabel=b.axis.title)):We(null==b?void 0:b.type)?(S.categoryAccessor=b.field,(null==m?void 0:m.field)&&(S.valueAccessor=k?"value":m.field),S.orientation="horizontal",(null===(p=null==b?void 0:b.axis)||void 0===p?void 0:p.title)&&(S.categoryLabel=b.axis.title),(null===(d=null==m?void 0:m.axis)||void 0===d?void 0:d.title)&&(S.valueLabel=m.axis.title)):((null==m?void 0:m.field)&&(S.categoryAccessor=m.field),(null==b?void 0:b.field)&&(S.valueAccessor=O?"value":b.field)),$&&(S.data=$);break;default:f.push(`Unsupported mark type "${g}". Defaulting to Scatterplot.`),C="Scatterplot",Xe(m,b,S,k,O),$&&(S.data=$)}return Qe(C,S,f)},exports.getHitRadius=function(e,t=30){return Math.max((null!=e?e:4)+5,12,t)},exports.lightenColor=function(e,t=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;const r=Math.round(parseInt(a[1],16)+(255-parseInt(a[1],16))*t),n=Math.round(parseInt(a[2],16)+(255-parseInt(a[2],16))*t),o=Math.round(parseInt(a[3],16)+(255-parseInt(a[3],16))*t);return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`},exports.normalizeTooltip=function(t){if(!0!==t){if("function"==typeof t){const a=t;return t=>{var r;const n=(o=!0===(null==t?void 0:t.__semioticHoverData)||t&&void 0!==t.data&&"number"==typeof t.x&&"number"==typeof t.y&&t&&("node"===t.type||"edge"===t.type||void 0!==t.nodeOrEdge||void 0!==t.allSeries||void 0!==t.stats||void 0!==t.__chartType)?null!==(r=t.data)&&void 0!==r?r:{}:t,Array.isArray(o)?o[0]:o);var o;const i=a(n);return null==i?null:e.jsx("div",{className:"semiotic-tooltip",style:et,children:i})}}return!1!==t&&void 0!==t&&("object"==typeof t&&null!==t&&("fields"in t||"title"in t)?rt(t):rt())}},exports.resolveCommunicativeAct=Re,exports.resolveThemePreset=g,exports.serializeSelections=function(e){const t={};for(const[a,r]of e){const e=[];for(const[,t]of r.clauses){const a={};for(const[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:Array.from(r.values)}:{type:"interval",range:r.range};e.push({clientId:t.clientId,type:t.type,fields:a})}t[a]={name:r.name,resolution:r.resolution,clauses:e}}return t},exports.smartTickFormat=function(e){if(null==e)return"";if("number"!=typeof e)return e+"";if(!isFinite(e))return e+"";if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),a=Math.abs(t);return 1e9>a?1e6>a?1e4>a?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"},exports.sweepToAngles=nt,exports.themeToCSS=function(e,t=":root"){var a,r,n,o,i;const s=[];return s.push(` --semiotic-bg: ${e.colors.background};`),s.push(` --semiotic-text: ${e.colors.text};`),s.push(` --semiotic-text-secondary: ${e.colors.textSecondary};`),s.push(` --semiotic-grid: ${e.colors.grid};`),s.push(` --semiotic-border: ${e.colors.border};`),s.push(` --semiotic-primary: ${e.colors.primary};`),s.push(` --semiotic-font-family: ${e.typography.fontFamily};`),e.colors.focus&&s.push(` --semiotic-focus: ${e.colors.focus};`),e.colors.selection&&s.push(` --semiotic-selection-color: ${e.colors.selection};`),null!=e.colors.selectionOpacity&&s.push(` --semiotic-selection-opacity: ${e.colors.selectionOpacity};`),e.colors.diverging&&s.push(` --semiotic-diverging: ${e.colors.diverging};`),(null===(a=e.tooltip)||void 0===a?void 0:a.background)&&s.push(` --semiotic-tooltip-bg: ${e.tooltip.background};`),(null===(r=e.tooltip)||void 0===r?void 0:r.text)&&s.push(` --semiotic-tooltip-text: ${e.tooltip.text};`),(null===(n=e.tooltip)||void 0===n?void 0:n.borderRadius)&&s.push(` --semiotic-tooltip-radius: ${e.tooltip.borderRadius};`),(null===(o=e.tooltip)||void 0===o?void 0:o.fontSize)&&s.push(` --semiotic-tooltip-font-size: ${e.tooltip.fontSize};`),(null===(i=e.tooltip)||void 0===i?void 0:i.shadow)&&s.push(` --semiotic-tooltip-shadow: ${e.tooltip.shadow};`),e.borderRadius&&s.push(` --semiotic-border-radius: ${e.borderRadius};`),e.colors.annotation&&s.push(` --semiotic-annotation-color: ${e.colors.annotation};`),null!=e.typography.legendSize&&s.push(` --semiotic-legend-font-size: ${e.typography.legendSize}px;`),null!=e.typography.titleFontSize&&s.push(` --semiotic-title-font-size: ${e.typography.titleFontSize}px;`),null!=e.typography.tickFontFamily&&s.push(` --semiotic-tick-font-family: ${e.typography.tickFontFamily};`),null!=e.typography.tickSize&&s.push(` --semiotic-tick-font-size: ${e.typography.tickSize}px;`),null!=e.typography.labelSize&&s.push(` --semiotic-axis-label-font-size: ${e.typography.labelSize}px;`),s.push(` --semiotic-secondary: ${e.colors.secondary||e.colors.primary};`),s.push(` --semiotic-surface: ${e.colors.surface||e.colors.background};`),e.colors.success&&s.push(` --semiotic-success: ${e.colors.success};`),e.colors.danger&&s.push(` --semiotic-danger: ${e.colors.danger};`),e.colors.warning&&s.push(` --semiotic-warning: ${e.colors.warning};`),e.colors.error&&s.push(` --semiotic-error: ${e.colors.error};`),e.colors.info&&s.push(` --semiotic-info: ${e.colors.info};`),`${t} {\n${s.join("\n")}\n}`},exports.themeToTokens=function(e){var t,a,r,n,o,i;return{semiotic:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:(null===(t=e.tooltip)||void 0===t?void 0:t.background)||e.colors.background,$type:"color"},text:{$value:(null===(a=e.tooltip)||void 0===a?void 0:a.text)||e.colors.text,$type:"color"},radius:{$value:(null===(r=e.tooltip)||void 0===r?void 0:r.borderRadius)||"6px",$type:"dimension"},"font-size":{$value:(null===(n=e.tooltip)||void 0===n?void 0:n.fontSize)||"14px",$type:"dimension"},shadow:{$value:(null===(o=e.tooltip)||void 0===o?void 0:o.shadow)||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:null!==(i=e.colors.selectionOpacity)&&void 0!==i?i:.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"}},e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{}),e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{}),null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{}),null!=e.typography.titleFontSize?{"title-font-size":{$value:e.typography.titleFontSize+"px",$type:"dimension"}}:{}),null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{}),null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{}),null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{}),{secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"}}),e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{}),e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{}),e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{}),e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{}),e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{})}},exports.toConfig=function(e,t,a){if(!B[e])throw Error(`Unknown component "${e}". Known components: ${Object.keys(B).join(", ")}`);const r=!1!==(null==a?void 0:a.includeData),n={};for(const[e,a]of Object.entries(t))null!=a&&(Ee.has(e)||!r&&De.has(e)||"function"!=typeof a&&((null==a?void 0:a.$$typeof)||(n[e]=qe(a))));return Object.assign({component:e,props:n,version:"1",createdAt:(new Date).toISOString()},(null==a?void 0:a.selections)?{selections:a.selections}:{})},exports.toURL=function(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},exports.useHighContrast=function(){const[e,a]=t.useState(()=>h("(forced-colors: active)"));return t.useEffect(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(forced-colors: active)");return a(e.matches),y(e,e=>a(e.matches))},[]),e},exports.useReducedMotion=function(){const[e,a]=t.useState(()=>h("(prefers-reduced-motion: reduce)"));return t.useEffect(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return a(e.matches),y(e,e=>a(e.matches))},[]),e},exports.useStreamStatus=function(e={}){const{staleThresholdMs:a=5e3,pollIntervalMs:r=1e3}=e,n=t.useRef(null),[o,i]=t.useState("idle"),[s,c]=t.useState(null),l=t.useMemo(()=>{const e={_frame:null,_origPush:null,_origPushMany:null};return{get current(){return e._frame},set current(t){const a=e._frame;if(a&&a!==t&&e._origPush&&e._origPushMany&&(a.push=e._origPush,a.pushMany=e._origPushMany,delete a[ot]),e._frame=t,!t)return e._origPush=null,void(e._origPushMany=null);if(t[ot])return;t[ot]=!0;const r=t.push,n=t.pushMany,o=r.bind(t),i=n.bind(t);e._origPush=r,e._origPushMany=n,t.push=e=>(u(),o(e)),t.pushMany=e=>(e&&e.length>0&&u(),i(e))}}},[]),u=t.useCallback(()=>{const e="undefined"!=typeof performance?performance.now():Date.now();n.current=e,c(e),i(e=>"active"===e?e:"active")},[]);return t.useEffect(()=>{const e=setInterval(()=>{const e=n.current;if(null==e)return;const t=("undefined"!=typeof performance?performance.now():Date.now())-e>a;i(e=>{const a=t?"stale":"active";return e===a?e:a})},r);return()=>clearInterval(e)},[a,r]),{ref:l,status:o,lastPushTime:s}},exports.useTheme=function(){return d(e=>e.theme)},exports.validateProps=M,exports.valueToAngle=function(e,t,a,r,n){const o=a-t||1;return n+(Math.max(t,Math.min(a,e))-t)/o*r};
|