@graphysdk/react-renderer 0.0.1-plugins.6 → 0.0.1-plugins.7
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/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
require('./index.css');
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),N=require("clsx"),g=require("react"),xe=require("zustand"),f=require("@graphysdk/viz-engine"),ot=require("zustand/vanilla"),E=require("motion/react"),ee=require("d3-shape"),Ir=require("d3-interpolate-path"),H=require("zustand/react/shallow"),Ke=require("color2k"),F=require("@floating-ui/react-dom"),Or=require("@tiptap/core"),Ut=require("@tiptap/extension-bold"),Ze=require("@tiptap/extension-document"),Kt=require("@tiptap/extension-hard-break"),Zt=require("@tiptap/extension-heading"),Jt=require("@tiptap/extension-italic"),Qt=require("@tiptap/extension-link"),en=require("@tiptap/extension-text"),tn=require("@tiptap/extension-text-align"),le=require("@tiptap/extension-text-style"),nn=require("@tiptap/extension-underline"),_e=require("@tiptap/extensions"),Dr=require("@tiptap/extension-paragraph"),st=require("@tiptap/react"),_=require("@base-ui/react/toolbar"),ie=require("@base-ui/react/tooltip"),rn=require("react-dom"),zr=require("@vanilla-extract/dynamic"),M=require("@base-ui/react/popover"),ft=require("react-colorful"),B=require("@base-ui/react/menu"),Gr=require("@base-ui/react/toggle");typeof window<"u"&&(window.__GRAPHY_SDK__??={},window.__GRAPHY_SDK__.reactRenderer="0.0.1-plugins.6");const Wr=(e=[])=>{const t=new Map;for(const n of e)t.set(n.type,n);return n=>t.get(n)??null},$r=5,Xr=e=>{if(process.env.NODE_ENV==="production")return{emit:()=>{},subscribe:()=>Yr,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let n=null;return{emit:o=>{const s=e.getLastCompile();if(s){n=o;for(const a of t)a(o,s)}},subscribe:o=>(t.add(o),()=>{t.delete(o)}),getLastTrigger:()=>n,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},qr=()=>ot.createStore(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,n)=>e(o=>{if(o.lastSnapshot===n)return o;const s={id:o.nextId,label:Vr(t),stages:n.stages,durationMs:n.durationMs};return{lastCompile:s,history:Ur(o.history,s,$r),nextId:o.nextId+1,lastSnapshot:n}})})),Yr=()=>{},Vr=e=>{switch(e.kind){case"init":return"init";case"input":return"input change";case"data":return"data change";case"command":return e.command.metadata.description}},Ur=(e,t,n)=>{const o=e.length>=n?e.length-(n-1):0;return[...e.slice(o),t]};function Kr(e){return e}function Zr(e,t){return{...t,geom:e.type,highlightStrategy:e.highlightStrategy}}var on=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],l={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",grey100:"var(--graphy-grey-100)",grey95:"var(--graphy-grey-95)",grey90:"var(--graphy-grey-90)",grey85:"var(--graphy-grey-85)",grey80:"var(--graphy-grey-80)",grey75:"var(--graphy-grey-75)",grey70:"var(--graphy-grey-70)",grey60:"var(--graphy-grey-60)",grey50:"var(--graphy-grey-50)",grey0:"var(--graphy-grey-0)",greyGradient80:"var(--graphy-grey-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",gridLineColor:"var(--graphy-grid-line-color)",originLineColor:"var(--graphy-origin-line-color)",targetLineColor:"var(--graphy-target-line-color)",targetLineMarkerColor:"var(--graphy-target-line-marker-color)",targetLineLabelTextColor:"var(--graphy-target-line-label-text-color)",legendBackground:"var(--graphy-legend-background)",legendBorderColor:"var(--graphy-legend-border-color)",legendFocusOutlineColor:"var(--graphy-legend-focus-outline-color)",legendTextColor:"var(--graphy-legend-text-color)",dimmedSeriesLabelTextColor:"var(--graphy-dimmed-series-label-text-color)",dimmedSeriesLabelLineColor:"var(--graphy-dimmed-series-label-line-color)",trendNegativeColor:"var(--graphy-trend-negative-color)",trendPositiveColor:"var(--graphy-trend-positive-color)",trendNeutralColor:"var(--graphy-trend-neutral-color)",defaultAnnotationArrowStroke:"var(--graphy-default-annotation-arrow-stroke)",defaultAnnotationShapeStroke:"var(--graphy-default-annotation-shape-stroke)",defaultAnnotationShapeFill:"var(--graphy-default-annotation-shape-fill)",arrowAnnotationStickerOutlineColor:"var(--graphy-arrow-annotation-sticker-outline-color)",arrowAnnotationStickerOutlineColorInverse:"var(--graphy-arrow-annotation-sticker-outline-color-inverse)",annotationFrameBorderColor:"var(--graphy-annotation-frame-border-color)",annotationMenuTriggerIconColor:"var(--graphy-annotation-menu-trigger-icon-color)",heatmapEmptyTileBackground:"var(--graphy-heatmap-empty-tile-background)",dataLabelOutsideBackground:"var(--graphy-data-label-outside-background)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",tooltipBackground:"var(--graphy-tooltip-background)",tooltipBorderColor:"var(--graphy-tooltip-border-color)",tooltipHeadingTextColor:"var(--graphy-tooltip-heading-text-color)",tooltipLabelTextColor:"var(--graphy-tooltip-label-text-color)",tooltipValueTextColor:"var(--graphy-tooltip-value-text-color)",tooltipPrimaryRowColor:"var(--graphy-tooltip-primary-row-color)",hoverGuideLineColor:"var(--graphy-hover-guide-line-color)",hoverGuideFillColor:"var(--graphy-hover-guide-fill-color)",hoveredBarBorderColor:"var(--graphy-hovered-bar-border-color)",hoveredPointRingColor:"var(--graphy-hovered-point-ring-color)",pointStrokeColor:"var(--graphy-point-stroke-color)",stackedBarHoverBorderColor:"var(--graphy-stacked-bar-hover-border-color)",fontFamilyDefault:"var(--graphy-font-family-default)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",fontWeightBlack:"var(--graphy-font-weight-black)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontTickLabel:"var(--graphy-font-tick-label)",fontAxisLabel:"var(--graphy-font-axis-label)",fontDataLabel:"var(--graphy-font-data-label)",fontStackTotal:"var(--graphy-font-stack-total)",fontLegendLabel:"var(--graphy-font-legend-label)",fontSeriesLabel:"var(--graphy-font-series-label)",fontTooltipLabel:"var(--graphy-font-tooltip-label)",fontTooltipHeading:"var(--graphy-font-tooltip-heading)",fontTooltipFooter:"var(--graphy-font-tooltip-footer)",fontJumboTooltipLabel:"var(--graphy-font-jumbo-tooltip-label)",fontJumboTooltip:"var(--graphy-font-jumbo-tooltip)",fontMiniTooltipLabel:"var(--graphy-font-mini-tooltip-label)",fontMiniTooltipFooter:"var(--graphy-font-mini-tooltip-footer)",fontTooltipCaption:"var(--graphy-font-tooltip-caption)",fontTooltipCaptionSmall:"var(--graphy-font-tooltip-caption-small)",fontTrendTag:"var(--graphy-font-trend-tag)",fontTrendTagSmall:"var(--graphy-font-trend-tag-small)",fontGoalLineLabel:"var(--graphy-font-goal-line-label)",fontPieLabel:"var(--graphy-font-pie-label)",fontPieChartTotal:"var(--graphy-font-pie-chart-total)",fontDifferenceArrowSmall:"var(--graphy-font-difference-arrow-small)",fontDifferenceArrowMedium:"var(--graphy-font-difference-arrow-medium)",fontDifferenceArrowLarge:"var(--graphy-font-difference-arrow-large)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)"};const at=1,sn=8,Jr=12;l.pointStrokeColor;const Qr=1;function eo(e){return e}function z(e){return 1-e}const b=e=>`${Number.parseFloat((e*100).toFixed(4))}%`,to=2,no=.7,te=({hit:e})=>{const t=f.getColor(e.observation),n=(f.getAlpha(e.observation)??at)*no,o=(f.getSize(e.observation)??sn)/2;return r.jsx("circle",{cx:b(e.x),cy:b(z(e.y)),r:o,fill:t,opacity:n,stroke:l.hoveredPointRingColor,strokeWidth:to,"data-testid":"companion-point"})},an=.3,ln=1,I={type:"spring",stiffness:500,damping:60,mass:1},cn=1,ro=2,un=e=>e==="catmull-rom"?ee.curveCatmullRom:ee.curveLinear,He=e=>{switch(e){case"dashed":return"8 4";case"dotted":return"2 2";case"solid":return}},Be=(e,t)=>t.lineWidth!=="auto"?t.lineWidth:f.getStrokeWidth(e)??ro,Re=e=>t=>`${e}:${f.getIdentityKey(t)}`,Me=(e,t)=>{const n=E.useMotionValue(e);return g.useEffect(()=>{const o=Ir.interpolatePath(n.get(),e);E.animate(0,1,{...t,onUpdate:s=>{const a=o(s);return n.set(a)}})},[t,e,n]),n};var de="_1d8mpa10";const dn=(e,t)=>{const n=un(t.interpolate),o=ee.area().curve(n),s=ee.line().curve(n);if(e.mainAxis==="y"){const a=u=>z(f.getY(u)??0),c=u=>f.getXMin(u)??0,i=u=>f.getXMax(u)??f.getX(u)??0;o.y(a).x0(c).x1(i),s.y(a).x(i)}else{const a=u=>f.getX(u)??0,c=u=>z(f.getYMin(u)??0),i=u=>z(f.getYMax(u)??f.getY(u)??0);o.x(a).y0(c).y1(i),s.x(a).y(i)}if(t.missingValues==="gap"){const a=c=>f.getX(c)!==null&&f.getY(c)!==null;o.defined(a),s.defined(a)}return{lineGenerator:s,areaGenerator:o}},hn=(e,t)=>t!=="connect"?e:e.filter(n=>f.getX(n)!==null&&f.getY(n)!==null),oo=g.memo(function({layer:t,coordSystem:n,isAnimated:o}){const{lineGenerator:s,areaGenerator:a}=g.useMemo(()=>dn(n,t.params),[t.params,n]),c=g.useMemo(()=>{const i=Re(t.id),u=[];return t.data.groupBy(f.GROUP_VARIABLES.group).forEach(d=>{const h=hn([...d],t.params.missingValues),m=a(h),p=s(h);if(!m||!p)return;const x=h[0];if(!x)return;const v=f.getColor(x),y=f.getAlpha(x),S=Be(x,t.params),L=He(f.getLineType(x));u.push({key:i(x),areaPath:m,linePath:p,color:v,fillOpacity:y??an,strokeWidth:S,strokeOpacity:ln,strokeDasharray:L})}),u},[a,s,t.data,t.id,t.params]);return r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",className:de,children:c.map(i=>r.jsx(so,{areaPath:i.areaPath,linePath:i.linePath,color:i.color,fillOpacity:i.fillOpacity,strokeWidth:i.strokeWidth,strokeOpacity:i.strokeOpacity,strokeDasharray:i.strokeDasharray,isAnimated:o},i.key))})}),so=({areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,isAnimated:i})=>i?r.jsx(ao,{areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c}):r.jsxs("g",{children:[r.jsx("path",{d:e,fill:n,fillOpacity:o,stroke:"none"}),r.jsx("path",{d:t,fill:"none",stroke:n,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,vectorEffect:"non-scaling-stroke"})]}),ao=({areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c})=>{const i=Me(e,I),u=Me(t,I);return r.jsxs("g",{children:[r.jsx(E.motion.path,{d:i,fill:n,fillOpacity:o,stroke:"none"}),r.jsx(E.motion.path,{d:u,fill:"none",stroke:n,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,vectorEffect:"non-scaling-stroke"})]})};var io="_46ebsf0";const ze=1,lo=2,co=1,uo=Jr/2,ho=2.25,Ie=({hit:e,...t})=>{const n=go(e.observation),o=f.getColor(e.observation),s=f.getAlpha(e.observation)??at,a=b(e.x),c=b(z(e.y)),u=n+ze/2+co+ze/2;return r.jsxs("g",{...t,className:io,children:[r.jsx("circle",{cx:a,cy:c,r:u,fill:"none",stroke:l.hoveredPointRingColor,strokeWidth:lo}),r.jsx("circle",{cx:a,cy:c,r:n,fill:o,opacity:s,stroke:l.hoveredPointRingColor,strokeWidth:ze})]})},go=e=>{const t=f.getSize(e);return f.isDefined(t)?t/ho:uo},fo=({layer:e,coordSystem:t,primary:n,companions:o})=>{const s=f.getGroup(n.observation),a=g.useMemo(()=>{const p=e.data.filter(f.GROUP_VARIABLES.group,"eq",s);return hn([...p],e.params.missingValues)},[e.data,e.params.missingValues,s]),{areaPath:c,linePath:i}=g.useMemo(()=>{const{lineGenerator:p,areaGenerator:x}=dn(t,e.params);return{areaPath:x(a)??"",linePath:p(a)??""}},[t,e.params,a]);if(!c||!i)return null;const u=f.getColor(n.observation),d=f.getAlpha(n.observation)??an,h=Be(n.observation,e.params),m=He(f.getLineType(n.observation));return r.jsxs("g",{"data-testid":"hovered-area",children:[r.jsxs("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",className:de,children:[r.jsx("path",{d:c,fill:u,fillOpacity:d,stroke:"none","data-testid":"hovered-area-fill"}),r.jsx("path",{d:i,fill:"none",stroke:u,strokeWidth:h,strokeOpacity:ln,strokeDasharray:m,vectorEffect:"non-scaling-stroke","data-testid":"hovered-area-edge"})]}),o.map(p=>r.jsx(te,{hit:p},`companion-${p.layerId}-${p.pointIndex}`)),r.jsx(Ie,{hit:n,"data-testid":"hovered-area-point"})]})},po={geom:"area",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:"continuous",render:({layer:e,coordSystem:t,isAnimated:n})=>r.jsx(oo,{layer:e,coordSystem:t,isAnimated:n}),renderHover:({layer:e,coordSystem:t,primary:n,group:o,related:s})=>r.jsx(fo,{layer:e,coordSystem:t,primary:n,companions:[...o,...s]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e,coordSystem:t})=>{if(t.mainAxis==="x"){const s=f.getX(e),a=f.getYMax(e)??f.getY(e);return s===null||a===null?null:{x:s,y:a}}const n=f.getY(e),o=f.getXMax(e)??f.getX(e);return n===null||o===null?null:{x:o,y:n}}},gn=1,ve=4,fn=(e,t)=>{const n=f.getXMin(t),o=f.getXMax(t),s=f.getYMin(t),a=f.getYMax(t)??f.getY(t);if(n===null||o===null||s===null||a===null)return null;if(e==="x"){let u=1-a,d=a-s;return d<0&&(u+=d,d=-d),{x:n,y:u,width:o-n,height:d}}let c=n,i=o-n;return i<0&&(c+=i,i=-i),{x:c,y:1-a,width:i,height:a-s}},mo=g.memo(function({layer:t,coordSystem:n,isAnimated:o}){const s=g.useId(),a=g.useMemo(()=>{const i=Re(t.id),u=new Map;for(const d of t.data){const h=fn(n.mainAxis,d);if(!h)continue;const m=vo(n.mainAxis,h),p=u.get(m),x={key:i(d),...h,fill:f.getColor(d),opacity:f.getAlpha(d)??gn};p?p.push(x):u.set(m,[x])}return[...u.entries()].map(([d,h])=>({id:`${s}${d}`,bars:h,...yo(h)}))},[s,n.mainAxis,t]),c=a.filter(i=>i.bars.length>1);return r.jsxs(r.Fragment,{children:[c.length>0&&r.jsx("defs",{children:c.map(i=>r.jsx("clipPath",{id:i.id,children:r.jsx(xo,{column:i,isAnimated:o})},i.id))}),a.map(i=>{const[u]=i.bars;if(i.bars.length===1&&u!==void 0){const{key:d,...h}=u;return r.jsx(pt,{...h,rx:ve,isAnimated:o},d)}return r.jsx("g",{clipPath:`url(#${i.id})`,children:i.bars.map(d=>{const{key:h,...m}=d;return r.jsx(pt,{...m,isAnimated:o},h)})},i.id)})]})}),pt=({isAnimated:e,rx:t,...n})=>e?r.jsx(E.motion.rect,{initial:!1,style:{transformBox:"view-box"},transition:I,fill:n.fill,opacity:n.opacity,rx:t,animate:{x:b(n.x),y:b(n.y),width:b(n.width),height:b(n.height),opacity:n.opacity}}):r.jsx("rect",{style:{transformBox:"view-box"},x:b(n.x),y:b(n.y),width:b(n.width),height:b(n.height),fill:n.fill,opacity:n.opacity,rx:t}),xo=({column:e,isAnimated:t})=>t?r.jsx(E.motion.rect,{initial:!1,style:{transformBox:"view-box"},transition:I,rx:ve,animate:{x:b(e.x),y:b(e.y),width:b(e.width),height:b(e.height)}}):r.jsx("rect",{x:b(e.x),y:b(e.y),width:b(e.width),height:b(e.height),rx:ve}),vo=(e,t)=>e==="x"?`${t.x}-${t.width}`:`${t.y}-${t.height}`,yo=e=>{let t=1/0,n=1/0,o=-1/0,s=-1/0;for(const a of e)a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x+a.width>o&&(o=a.x+a.width),a.y+a.height>s&&(s=a.y+a.height);return{x:t,y:n,width:o-t,height:s-n}};var bo="_1i6dtb60";const fe=3,So=({coordSystem:e,primary:t,panelRect:n})=>{const o=fn(e.mainAxis,t.observation);if(!o)return null;const s=o.x*n.width,a=o.y*n.height,c=o.width*n.width,i=o.height*n.height,u=s-fe,d=a-fe,h=c+fe*2,m=i+fe*2,p=ve+fe,x=f.getColor(t.observation),v=f.getAlpha(t.observation)??gn;return r.jsxs("g",{"data-testid":"hovered-bar",children:[r.jsx("rect",{x:u,y:d,width:h,height:m,rx:p,fill:l.hoveredBarBorderColor,className:bo,"data-testid":"hovered-bar-border"}),r.jsx("rect",{x:b(o.x),y:b(o.y),width:b(o.width),height:b(o.height),fill:x,opacity:v,rx:ve,"data-testid":"hovered-bar-fill"})]})},jo={geom:"bar",coord:"cartesian",highlightStrategy:"observation-rerender",guideMode:"bar",render:({layer:e,coordSystem:t,isAnimated:n})=>r.jsx(mo,{layer:e,coordSystem:t,isAnimated:n}),renderHover:({coordSystem:e,primary:t,panelRect:n})=>r.jsx(So,{coordSystem:e,primary:t,panelRect:n}),renderHoverCompanions:()=>null},pn=e=>{const t=ee.line().x(n=>f.getX(n)??0).y(n=>z(f.getY(n)??0)).curve(un(e.interpolate));return e.missingValues==="gap"&&t.defined(n=>f.getX(n)!==null&&f.getY(n)!==null),t},mn=(e,t)=>t!=="connect"?e:e.filter(n=>f.getX(n)!==null&&f.getY(n)!==null),Lo=g.memo(function({layer:t,isAnimated:n}){const o=g.useMemo(()=>pn(t.params),[t.params]),s=g.useMemo(()=>{const a=Re(t.id),c=[];return t.data.groupBy(f.GROUP_VARIABLES.group).forEach(i=>{const u=mn([...i],t.params.missingValues),d=o(u);if(!d)return;const h=u[0];if(!h)return;const m=f.getColor(h),p=f.getAlpha(h),x=Be(h,t.params),v=He(f.getLineType(h));c.push({key:a(h),pathData:d,color:m,opacity:p??cn,strokeWidth:x,strokeDasharray:v})}),c},[o,t.data,t.id,t.params]);return r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",className:de,children:s.map(a=>r.jsx(Co,{pathData:a.pathData,color:a.color,strokeWidth:a.strokeWidth,opacity:a.opacity,strokeDasharray:a.strokeDasharray,isAnimated:n},a.key))})}),Co=({pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s,isAnimated:a})=>a?r.jsx(ko,{pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s}):r.jsx("path",{d:e,fill:"none",stroke:t,strokeWidth:n,opacity:o,strokeDasharray:s,vectorEffect:"non-scaling-stroke"}),ko=({pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s})=>{const a=Me(e,I);return r.jsx(E.motion.path,{d:a,fill:"none",stroke:t,strokeWidth:n,opacity:o,strokeDasharray:s,vectorEffect:"non-scaling-stroke"})},To=({layer:e,primary:t,companions:n})=>{const o=f.getGroup(t.observation),s=g.useMemo(()=>{const h=e.data.filter(f.GROUP_VARIABLES.group,"eq",o);return mn([...h],e.params.missingValues)},[e.data,e.params.missingValues,o]),a=g.useMemo(()=>pn(e.params)(s),[e.params,s]);if(!a)return null;const c=f.getColor(t.observation),i=f.getAlpha(t.observation)??cn,u=Be(t.observation,e.params),d=He(f.getLineType(t.observation));return r.jsxs("g",{"data-testid":"hovered-line",children:[r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",className:de,children:r.jsx("path",{d:a,fill:"none",stroke:c,strokeWidth:u,opacity:i,strokeDasharray:d,vectorEffect:"non-scaling-stroke","data-testid":"hovered-line-path"})}),n.map(h=>r.jsx(te,{hit:h},`companion-${h.layerId}-${h.pointIndex}`)),r.jsx(Ie,{hit:t,"data-testid":"hovered-line-point"})]})},wo={geom:"line",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:"continuous",render:({layer:e,isAnimated:t})=>r.jsx(Lo,{layer:e,isAnimated:t}),renderHover:({layer:e,primary:t,group:n,related:o})=>r.jsx(To,{layer:e,primary:t,companions:[...n,...o]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e})=>{const t=f.getX(e),n=f.getY(e);return t===null||n===null?null:{x:t,y:n}}},Ao=g.memo(function({layer:t,isAnimated:n}){const o=g.useMemo(()=>{const s=[];for(const a of t.data){const c=f.getX(a),i=f.getY(a);if(c===null||i===null)continue;const u=f.getColor(a),d=f.getAlpha(a),h=f.getSize(a),m=f.getStrokeWidth(a);s.push({key:f.getIdentityKey(a),cx:c,cy:z(i),radius:(h??t.params.size)/2,fill:u,stroke:l.pointStrokeColor,opacity:d??at,strokeWidth:m??Qr})}return s},[t.data,t.params.size]);return r.jsx(r.Fragment,{children:o.map(s=>n?r.jsx(E.motion.circle,{initial:!1,transition:I,fill:s.fill,stroke:s.stroke,strokeWidth:s.strokeWidth,animate:{cx:b(s.cx),cy:b(s.cy),r:s.radius,opacity:s.opacity}},s.key):r.jsx("circle",{cx:b(s.cx),cy:b(s.cy),r:s.radius,fill:s.fill,opacity:s.opacity,stroke:s.stroke,strokeWidth:s.strokeWidth},s.key))})}),Eo={geom:"point",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:null,render:({layer:e,isAnimated:t})=>r.jsx(Ao,{layer:e,isAnimated:t}),renderHover:({primary:e,group:t,related:n})=>r.jsxs("g",{"data-testid":"hovered-point",children:[[...t,...n].map(o=>r.jsx(te,{hit:o},`companion-${o.layerId}-${o.pointIndex}`)),r.jsx(Ie,{hit:e})]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e})=>{const t=f.getX(e),n=f.getY(e);return t===null||n===null?null:{x:t,y:n}}},xn=10,Y=(e,t)=>e*xn*t,_o=/\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu,vn="😀";class Oe{constructor(){this.emojiCorrections=new Map,this.currentFont="";const n=new OffscreenCanvas(1,1).getContext("2d");if(!n)throw new Error("Failed to create OffscreenCanvas 2D context");this.ctx=n}static async create(){return typeof document<"u"&&"fonts"in document&&await document.fonts.ready,new Oe}measureText(t,n){const o=f.buildFontString(n);this.setFont(o);const{width:s,fontBoundingBoxAscent:a,fontBoundingBoxDescent:c}=this.ctx.measureText(t);let i=s;const u=Mo(t);if(u>0){const d=this.getEmojiCorrection(o);i-=d*u}return{width:i,height:a+c,ascent:a,descent:c}}setFont(t){this.currentFont!==t&&(this.ctx.font=t,this.currentFont=t)}getEmojiCorrection(t){const n=this.emojiCorrections.get(t);if(n!==void 0)return n;this.setFont(t);const o=this.ctx.measureText(vn).width,s=Po(t);let a=0;if(s!==null){const c=o-s;a=c>.5?c:0}return this.emojiCorrections.set(t,a),a}}let X=null;const Mo=e=>{const t=e.match(_o);return t?t.length:0},Po=e=>{const t=Fo();return t?(t.style.font=e,t.getBoundingClientRect().width):null},Fo=()=>typeof document>"u"?null:(X||(X=document.createElement("span"),X.style.position="absolute",X.style.visibility="hidden",X.style.whiteSpace="nowrap",X.style.left="-9999px",X.textContent=vn,document.body.appendChild(X)),X),yn=g.createContext(null),bn=({children:e,measurer:t})=>{const[n,o]=g.useState(null);g.useEffect(()=>{if(t!==void 0)return;let a=!1;const c=()=>{a||o(No())};return(async()=>{typeof document<"u"&&"fonts"in document&&await document.fonts.ready,c()})(),typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",c),()=>{a=!0,typeof document<"u"&&"fonts"in document&&document.fonts.removeEventListener("loadingdone",c)}},[t]);const s=t??n;return s===null?null:r.jsx(yn.Provider,{value:s,children:e})},ne=()=>{const e=g.useContext(yn);if(e===null)throw new Error("useTextMeasurer must be used inside a <TextMeasurerProvider>.");return e},No=()=>{try{return new f.CachedTextMeasurer(new Oe)}catch{return new f.CachedTextMeasurer(new f.HeuristicTextMeasurer)}},O=`'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu',
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),N=require("clsx"),g=require("react"),xe=require("zustand"),f=require("@graphysdk/viz-engine"),ot=require("zustand/vanilla"),E=require("motion/react"),ee=require("d3-shape"),Ir=require("d3-interpolate-path"),H=require("zustand/react/shallow"),Ke=require("color2k"),F=require("@floating-ui/react-dom"),Or=require("@tiptap/core"),Ut=require("@tiptap/extension-bold"),Ze=require("@tiptap/extension-document"),Kt=require("@tiptap/extension-hard-break"),Zt=require("@tiptap/extension-heading"),Jt=require("@tiptap/extension-italic"),Qt=require("@tiptap/extension-link"),en=require("@tiptap/extension-text"),tn=require("@tiptap/extension-text-align"),le=require("@tiptap/extension-text-style"),nn=require("@tiptap/extension-underline"),_e=require("@tiptap/extensions"),Dr=require("@tiptap/extension-paragraph"),st=require("@tiptap/react"),_=require("@base-ui/react/toolbar"),ie=require("@base-ui/react/tooltip"),rn=require("react-dom"),zr=require("@vanilla-extract/dynamic"),M=require("@base-ui/react/popover"),ft=require("react-colorful"),B=require("@base-ui/react/menu"),Gr=require("@base-ui/react/toggle");typeof window<"u"&&(window.__GRAPHY_SDK__??={},window.__GRAPHY_SDK__.reactRenderer="0.0.1-plugins.7");const Wr=(e=[])=>{const t=new Map;for(const n of e)t.set(n.type,n);return n=>t.get(n)??null},$r=5,Xr=e=>{if(process.env.NODE_ENV==="production")return{emit:()=>{},subscribe:()=>Yr,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let n=null;return{emit:o=>{const s=e.getLastCompile();if(s){n=o;for(const a of t)a(o,s)}},subscribe:o=>(t.add(o),()=>{t.delete(o)}),getLastTrigger:()=>n,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},qr=()=>ot.createStore(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,n)=>e(o=>{if(o.lastSnapshot===n)return o;const s={id:o.nextId,label:Vr(t),stages:n.stages,durationMs:n.durationMs};return{lastCompile:s,history:Ur(o.history,s,$r),nextId:o.nextId+1,lastSnapshot:n}})})),Yr=()=>{},Vr=e=>{switch(e.kind){case"init":return"init";case"input":return"input change";case"data":return"data change";case"command":return e.command.metadata.description}},Ur=(e,t,n)=>{const o=e.length>=n?e.length-(n-1):0;return[...e.slice(o),t]};function Kr(e){return e}function Zr(e,t){return{...t,geom:e.type,highlightStrategy:e.highlightStrategy}}var on=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],l={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",grey100:"var(--graphy-grey-100)",grey95:"var(--graphy-grey-95)",grey90:"var(--graphy-grey-90)",grey85:"var(--graphy-grey-85)",grey80:"var(--graphy-grey-80)",grey75:"var(--graphy-grey-75)",grey70:"var(--graphy-grey-70)",grey60:"var(--graphy-grey-60)",grey50:"var(--graphy-grey-50)",grey0:"var(--graphy-grey-0)",greyGradient80:"var(--graphy-grey-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",gridLineColor:"var(--graphy-grid-line-color)",originLineColor:"var(--graphy-origin-line-color)",targetLineColor:"var(--graphy-target-line-color)",targetLineMarkerColor:"var(--graphy-target-line-marker-color)",targetLineLabelTextColor:"var(--graphy-target-line-label-text-color)",legendBackground:"var(--graphy-legend-background)",legendBorderColor:"var(--graphy-legend-border-color)",legendFocusOutlineColor:"var(--graphy-legend-focus-outline-color)",legendTextColor:"var(--graphy-legend-text-color)",dimmedSeriesLabelTextColor:"var(--graphy-dimmed-series-label-text-color)",dimmedSeriesLabelLineColor:"var(--graphy-dimmed-series-label-line-color)",trendNegativeColor:"var(--graphy-trend-negative-color)",trendPositiveColor:"var(--graphy-trend-positive-color)",trendNeutralColor:"var(--graphy-trend-neutral-color)",defaultAnnotationArrowStroke:"var(--graphy-default-annotation-arrow-stroke)",defaultAnnotationShapeStroke:"var(--graphy-default-annotation-shape-stroke)",defaultAnnotationShapeFill:"var(--graphy-default-annotation-shape-fill)",arrowAnnotationStickerOutlineColor:"var(--graphy-arrow-annotation-sticker-outline-color)",arrowAnnotationStickerOutlineColorInverse:"var(--graphy-arrow-annotation-sticker-outline-color-inverse)",annotationFrameBorderColor:"var(--graphy-annotation-frame-border-color)",annotationMenuTriggerIconColor:"var(--graphy-annotation-menu-trigger-icon-color)",heatmapEmptyTileBackground:"var(--graphy-heatmap-empty-tile-background)",dataLabelOutsideBackground:"var(--graphy-data-label-outside-background)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",tooltipBackground:"var(--graphy-tooltip-background)",tooltipBorderColor:"var(--graphy-tooltip-border-color)",tooltipHeadingTextColor:"var(--graphy-tooltip-heading-text-color)",tooltipLabelTextColor:"var(--graphy-tooltip-label-text-color)",tooltipValueTextColor:"var(--graphy-tooltip-value-text-color)",tooltipPrimaryRowColor:"var(--graphy-tooltip-primary-row-color)",hoverGuideLineColor:"var(--graphy-hover-guide-line-color)",hoverGuideFillColor:"var(--graphy-hover-guide-fill-color)",hoveredBarBorderColor:"var(--graphy-hovered-bar-border-color)",hoveredPointRingColor:"var(--graphy-hovered-point-ring-color)",pointStrokeColor:"var(--graphy-point-stroke-color)",stackedBarHoverBorderColor:"var(--graphy-stacked-bar-hover-border-color)",fontFamilyDefault:"var(--graphy-font-family-default)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",fontWeightBlack:"var(--graphy-font-weight-black)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontTickLabel:"var(--graphy-font-tick-label)",fontAxisLabel:"var(--graphy-font-axis-label)",fontDataLabel:"var(--graphy-font-data-label)",fontStackTotal:"var(--graphy-font-stack-total)",fontLegendLabel:"var(--graphy-font-legend-label)",fontSeriesLabel:"var(--graphy-font-series-label)",fontTooltipLabel:"var(--graphy-font-tooltip-label)",fontTooltipHeading:"var(--graphy-font-tooltip-heading)",fontTooltipFooter:"var(--graphy-font-tooltip-footer)",fontJumboTooltipLabel:"var(--graphy-font-jumbo-tooltip-label)",fontJumboTooltip:"var(--graphy-font-jumbo-tooltip)",fontMiniTooltipLabel:"var(--graphy-font-mini-tooltip-label)",fontMiniTooltipFooter:"var(--graphy-font-mini-tooltip-footer)",fontTooltipCaption:"var(--graphy-font-tooltip-caption)",fontTooltipCaptionSmall:"var(--graphy-font-tooltip-caption-small)",fontTrendTag:"var(--graphy-font-trend-tag)",fontTrendTagSmall:"var(--graphy-font-trend-tag-small)",fontGoalLineLabel:"var(--graphy-font-goal-line-label)",fontPieLabel:"var(--graphy-font-pie-label)",fontPieChartTotal:"var(--graphy-font-pie-chart-total)",fontDifferenceArrowSmall:"var(--graphy-font-difference-arrow-small)",fontDifferenceArrowMedium:"var(--graphy-font-difference-arrow-medium)",fontDifferenceArrowLarge:"var(--graphy-font-difference-arrow-large)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)"};const at=1,sn=8,Jr=12;l.pointStrokeColor;const Qr=1;function eo(e){return e}function z(e){return 1-e}const b=e=>`${Number.parseFloat((e*100).toFixed(4))}%`,to=2,no=.7,te=({hit:e})=>{const t=f.getColor(e.observation),n=(f.getAlpha(e.observation)??at)*no,o=(f.getSize(e.observation)??sn)/2;return r.jsx("circle",{cx:b(e.x),cy:b(z(e.y)),r:o,fill:t,opacity:n,stroke:l.hoveredPointRingColor,strokeWidth:to,"data-testid":"companion-point"})},an=.3,ln=1,I={type:"spring",stiffness:500,damping:60,mass:1},cn=1,ro=2,un=e=>e==="catmull-rom"?ee.curveCatmullRom:ee.curveLinear,He=e=>{switch(e){case"dashed":return"8 4";case"dotted":return"2 2";case"solid":return}},Be=(e,t)=>t.lineWidth!=="auto"?t.lineWidth:f.getStrokeWidth(e)??ro,Re=e=>t=>`${e}:${f.getIdentityKey(t)}`,Me=(e,t)=>{const n=E.useMotionValue(e);return g.useEffect(()=>{const o=Ir.interpolatePath(n.get(),e);E.animate(0,1,{...t,onUpdate:s=>{const a=o(s);return n.set(a)}})},[t,e,n]),n};var de="_1d8mpa10";const dn=(e,t)=>{const n=un(t.interpolate),o=ee.area().curve(n),s=ee.line().curve(n);if(e.mainAxis==="y"){const a=u=>z(f.getY(u)??0),c=u=>f.getXMin(u)??0,i=u=>f.getXMax(u)??f.getX(u)??0;o.y(a).x0(c).x1(i),s.y(a).x(i)}else{const a=u=>f.getX(u)??0,c=u=>z(f.getYMin(u)??0),i=u=>z(f.getYMax(u)??f.getY(u)??0);o.x(a).y0(c).y1(i),s.x(a).y(i)}if(t.missingValues==="gap"){const a=c=>f.getX(c)!==null&&f.getY(c)!==null;o.defined(a),s.defined(a)}return{lineGenerator:s,areaGenerator:o}},hn=(e,t)=>t!=="connect"?e:e.filter(n=>f.getX(n)!==null&&f.getY(n)!==null),oo=g.memo(function({layer:t,coordSystem:n,isAnimated:o}){const{lineGenerator:s,areaGenerator:a}=g.useMemo(()=>dn(n,t.params),[t.params,n]),c=g.useMemo(()=>{const i=Re(t.id),u=[];return t.data.groupBy(f.GROUP_VARIABLES.group).forEach(d=>{const h=hn([...d],t.params.missingValues),m=a(h),p=s(h);if(!m||!p)return;const x=h[0];if(!x)return;const v=f.getColor(x),y=f.getAlpha(x),S=Be(x,t.params),L=He(f.getLineType(x));u.push({key:i(x),areaPath:m,linePath:p,color:v,fillOpacity:y??an,strokeWidth:S,strokeOpacity:ln,strokeDasharray:L})}),u},[a,s,t.data,t.id,t.params]);return r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",className:de,children:c.map(i=>r.jsx(so,{areaPath:i.areaPath,linePath:i.linePath,color:i.color,fillOpacity:i.fillOpacity,strokeWidth:i.strokeWidth,strokeOpacity:i.strokeOpacity,strokeDasharray:i.strokeDasharray,isAnimated:o},i.key))})}),so=({areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,isAnimated:i})=>i?r.jsx(ao,{areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c}):r.jsxs("g",{children:[r.jsx("path",{d:e,fill:n,fillOpacity:o,stroke:"none"}),r.jsx("path",{d:t,fill:"none",stroke:n,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,vectorEffect:"non-scaling-stroke"})]}),ao=({areaPath:e,linePath:t,color:n,fillOpacity:o,strokeWidth:s,strokeOpacity:a,strokeDasharray:c})=>{const i=Me(e,I),u=Me(t,I);return r.jsxs("g",{children:[r.jsx(E.motion.path,{d:i,fill:n,fillOpacity:o,stroke:"none"}),r.jsx(E.motion.path,{d:u,fill:"none",stroke:n,strokeWidth:s,strokeOpacity:a,strokeDasharray:c,vectorEffect:"non-scaling-stroke"})]})};var io="_46ebsf0";const ze=1,lo=2,co=1,uo=Jr/2,ho=2.25,Ie=({hit:e,...t})=>{const n=go(e.observation),o=f.getColor(e.observation),s=f.getAlpha(e.observation)??at,a=b(e.x),c=b(z(e.y)),u=n+ze/2+co+ze/2;return r.jsxs("g",{...t,className:io,children:[r.jsx("circle",{cx:a,cy:c,r:u,fill:"none",stroke:l.hoveredPointRingColor,strokeWidth:lo}),r.jsx("circle",{cx:a,cy:c,r:n,fill:o,opacity:s,stroke:l.hoveredPointRingColor,strokeWidth:ze})]})},go=e=>{const t=f.getSize(e);return f.isDefined(t)?t/ho:uo},fo=({layer:e,coordSystem:t,primary:n,companions:o})=>{const s=f.getGroup(n.observation),a=g.useMemo(()=>{const p=e.data.filter(f.GROUP_VARIABLES.group,"eq",s);return hn([...p],e.params.missingValues)},[e.data,e.params.missingValues,s]),{areaPath:c,linePath:i}=g.useMemo(()=>{const{lineGenerator:p,areaGenerator:x}=dn(t,e.params);return{areaPath:x(a)??"",linePath:p(a)??""}},[t,e.params,a]);if(!c||!i)return null;const u=f.getColor(n.observation),d=f.getAlpha(n.observation)??an,h=Be(n.observation,e.params),m=He(f.getLineType(n.observation));return r.jsxs("g",{"data-testid":"hovered-area",children:[r.jsxs("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",className:de,children:[r.jsx("path",{d:c,fill:u,fillOpacity:d,stroke:"none","data-testid":"hovered-area-fill"}),r.jsx("path",{d:i,fill:"none",stroke:u,strokeWidth:h,strokeOpacity:ln,strokeDasharray:m,vectorEffect:"non-scaling-stroke","data-testid":"hovered-area-edge"})]}),o.map(p=>r.jsx(te,{hit:p},`companion-${p.layerId}-${p.pointIndex}`)),r.jsx(Ie,{hit:n,"data-testid":"hovered-area-point"})]})},po={geom:"area",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:"continuous",render:({layer:e,coordSystem:t,isAnimated:n})=>r.jsx(oo,{layer:e,coordSystem:t,isAnimated:n}),renderHover:({layer:e,coordSystem:t,primary:n,group:o,related:s})=>r.jsx(fo,{layer:e,coordSystem:t,primary:n,companions:[...o,...s]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e,coordSystem:t})=>{if(t.mainAxis==="x"){const s=f.getX(e),a=f.getYMax(e)??f.getY(e);return s===null||a===null?null:{x:s,y:a}}const n=f.getY(e),o=f.getXMax(e)??f.getX(e);return n===null||o===null?null:{x:o,y:n}}},gn=1,ve=4,fn=(e,t)=>{const n=f.getXMin(t),o=f.getXMax(t),s=f.getYMin(t),a=f.getYMax(t)??f.getY(t);if(n===null||o===null||s===null||a===null)return null;if(e==="x"){let u=1-a,d=a-s;return d<0&&(u+=d,d=-d),{x:n,y:u,width:o-n,height:d}}let c=n,i=o-n;return i<0&&(c+=i,i=-i),{x:c,y:1-a,width:i,height:a-s}},mo=g.memo(function({layer:t,coordSystem:n,isAnimated:o}){const s=g.useId(),a=g.useMemo(()=>{const i=Re(t.id),u=new Map;for(const d of t.data){const h=fn(n.mainAxis,d);if(!h)continue;const m=vo(n.mainAxis,h),p=u.get(m),x={key:i(d),...h,fill:f.getColor(d),opacity:f.getAlpha(d)??gn};p?p.push(x):u.set(m,[x])}return[...u.entries()].map(([d,h])=>({id:`${s}${d}`,bars:h,...yo(h)}))},[s,n.mainAxis,t]),c=a.filter(i=>i.bars.length>1);return r.jsxs(r.Fragment,{children:[c.length>0&&r.jsx("defs",{children:c.map(i=>r.jsx("clipPath",{id:i.id,children:r.jsx(xo,{column:i,isAnimated:o})},i.id))}),a.map(i=>{const[u]=i.bars;if(i.bars.length===1&&u!==void 0){const{key:d,...h}=u;return r.jsx(pt,{...h,rx:ve,isAnimated:o},d)}return r.jsx("g",{clipPath:`url(#${i.id})`,children:i.bars.map(d=>{const{key:h,...m}=d;return r.jsx(pt,{...m,isAnimated:o},h)})},i.id)})]})}),pt=({isAnimated:e,rx:t,...n})=>e?r.jsx(E.motion.rect,{initial:!1,style:{transformBox:"view-box"},transition:I,fill:n.fill,opacity:n.opacity,rx:t,animate:{x:b(n.x),y:b(n.y),width:b(n.width),height:b(n.height),opacity:n.opacity}}):r.jsx("rect",{style:{transformBox:"view-box"},x:b(n.x),y:b(n.y),width:b(n.width),height:b(n.height),fill:n.fill,opacity:n.opacity,rx:t}),xo=({column:e,isAnimated:t})=>t?r.jsx(E.motion.rect,{initial:!1,style:{transformBox:"view-box"},transition:I,rx:ve,animate:{x:b(e.x),y:b(e.y),width:b(e.width),height:b(e.height)}}):r.jsx("rect",{x:b(e.x),y:b(e.y),width:b(e.width),height:b(e.height),rx:ve}),vo=(e,t)=>e==="x"?`${t.x}-${t.width}`:`${t.y}-${t.height}`,yo=e=>{let t=1/0,n=1/0,o=-1/0,s=-1/0;for(const a of e)a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x+a.width>o&&(o=a.x+a.width),a.y+a.height>s&&(s=a.y+a.height);return{x:t,y:n,width:o-t,height:s-n}};var bo="_1i6dtb60";const fe=3,So=({coordSystem:e,primary:t,panelRect:n})=>{const o=fn(e.mainAxis,t.observation);if(!o)return null;const s=o.x*n.width,a=o.y*n.height,c=o.width*n.width,i=o.height*n.height,u=s-fe,d=a-fe,h=c+fe*2,m=i+fe*2,p=ve+fe,x=f.getColor(t.observation),v=f.getAlpha(t.observation)??gn;return r.jsxs("g",{"data-testid":"hovered-bar",children:[r.jsx("rect",{x:u,y:d,width:h,height:m,rx:p,fill:l.hoveredBarBorderColor,className:bo,"data-testid":"hovered-bar-border"}),r.jsx("rect",{x:b(o.x),y:b(o.y),width:b(o.width),height:b(o.height),fill:x,opacity:v,rx:ve,"data-testid":"hovered-bar-fill"})]})},jo={geom:"bar",coord:"cartesian",highlightStrategy:"observation-rerender",guideMode:"bar",render:({layer:e,coordSystem:t,isAnimated:n})=>r.jsx(mo,{layer:e,coordSystem:t,isAnimated:n}),renderHover:({coordSystem:e,primary:t,panelRect:n})=>r.jsx(So,{coordSystem:e,primary:t,panelRect:n}),renderHoverCompanions:()=>null},pn=e=>{const t=ee.line().x(n=>f.getX(n)??0).y(n=>z(f.getY(n)??0)).curve(un(e.interpolate));return e.missingValues==="gap"&&t.defined(n=>f.getX(n)!==null&&f.getY(n)!==null),t},mn=(e,t)=>t!=="connect"?e:e.filter(n=>f.getX(n)!==null&&f.getY(n)!==null),Lo=g.memo(function({layer:t,isAnimated:n}){const o=g.useMemo(()=>pn(t.params),[t.params]),s=g.useMemo(()=>{const a=Re(t.id),c=[];return t.data.groupBy(f.GROUP_VARIABLES.group).forEach(i=>{const u=mn([...i],t.params.missingValues),d=o(u);if(!d)return;const h=u[0];if(!h)return;const m=f.getColor(h),p=f.getAlpha(h),x=Be(h,t.params),v=He(f.getLineType(h));c.push({key:a(h),pathData:d,color:m,opacity:p??cn,strokeWidth:x,strokeDasharray:v})}),c},[o,t.data,t.id,t.params]);return r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",className:de,children:s.map(a=>r.jsx(Co,{pathData:a.pathData,color:a.color,strokeWidth:a.strokeWidth,opacity:a.opacity,strokeDasharray:a.strokeDasharray,isAnimated:n},a.key))})}),Co=({pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s,isAnimated:a})=>a?r.jsx(ko,{pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s}):r.jsx("path",{d:e,fill:"none",stroke:t,strokeWidth:n,opacity:o,strokeDasharray:s,vectorEffect:"non-scaling-stroke"}),ko=({pathData:e,color:t,strokeWidth:n,opacity:o,strokeDasharray:s})=>{const a=Me(e,I);return r.jsx(E.motion.path,{d:a,fill:"none",stroke:t,strokeWidth:n,opacity:o,strokeDasharray:s,vectorEffect:"non-scaling-stroke"})},To=({layer:e,primary:t,companions:n})=>{const o=f.getGroup(t.observation),s=g.useMemo(()=>{const h=e.data.filter(f.GROUP_VARIABLES.group,"eq",o);return mn([...h],e.params.missingValues)},[e.data,e.params.missingValues,o]),a=g.useMemo(()=>pn(e.params)(s),[e.params,s]);if(!a)return null;const c=f.getColor(t.observation),i=f.getAlpha(t.observation)??cn,u=Be(t.observation,e.params),d=He(f.getLineType(t.observation));return r.jsxs("g",{"data-testid":"hovered-line",children:[r.jsx("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",className:de,children:r.jsx("path",{d:a,fill:"none",stroke:c,strokeWidth:u,opacity:i,strokeDasharray:d,vectorEffect:"non-scaling-stroke","data-testid":"hovered-line-path"})}),n.map(h=>r.jsx(te,{hit:h},`companion-${h.layerId}-${h.pointIndex}`)),r.jsx(Ie,{hit:t,"data-testid":"hovered-line-point"})]})},wo={geom:"line",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:"continuous",render:({layer:e,isAnimated:t})=>r.jsx(Lo,{layer:e,isAnimated:t}),renderHover:({layer:e,primary:t,group:n,related:o})=>r.jsx(To,{layer:e,primary:t,companions:[...n,...o]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e})=>{const t=f.getX(e),n=f.getY(e);return t===null||n===null?null:{x:t,y:n}}},Ao=g.memo(function({layer:t,isAnimated:n}){const o=g.useMemo(()=>{const s=[];for(const a of t.data){const c=f.getX(a),i=f.getY(a);if(c===null||i===null)continue;const u=f.getColor(a),d=f.getAlpha(a),h=f.getSize(a),m=f.getStrokeWidth(a);s.push({key:f.getIdentityKey(a),cx:c,cy:z(i),radius:(h??t.params.size)/2,fill:u,stroke:l.pointStrokeColor,opacity:d??at,strokeWidth:m??Qr})}return s},[t.data,t.params.size]);return r.jsx(r.Fragment,{children:o.map(s=>n?r.jsx(E.motion.circle,{initial:!1,transition:I,fill:s.fill,stroke:s.stroke,strokeWidth:s.strokeWidth,animate:{cx:b(s.cx),cy:b(s.cy),r:s.radius,opacity:s.opacity}},s.key):r.jsx("circle",{cx:b(s.cx),cy:b(s.cy),r:s.radius,fill:s.fill,opacity:s.opacity,stroke:s.stroke,strokeWidth:s.strokeWidth},s.key))})}),Eo={geom:"point",coord:"cartesian",highlightStrategy:"overlay-anchor",guideMode:null,render:({layer:e,isAnimated:t})=>r.jsx(Ao,{layer:e,isAnimated:t}),renderHover:({primary:e,group:t,related:n})=>r.jsxs("g",{"data-testid":"hovered-point",children:[[...t,...n].map(o=>r.jsx(te,{hit:o},`companion-${o.layerId}-${o.pointIndex}`)),r.jsx(Ie,{hit:e})]}),renderHoverCompanions:({related:e})=>r.jsx(r.Fragment,{children:e.map(t=>r.jsx(te,{hit:t},`companion-${t.layerId}-${t.pointIndex}`))}),getOverlayAnchor:({observation:e})=>{const t=f.getX(e),n=f.getY(e);return t===null||n===null?null:{x:t,y:n}}},xn=10,Y=(e,t)=>e*xn*t,_o=/\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu,vn="😀";class Oe{constructor(){this.emojiCorrections=new Map,this.currentFont="";const n=new OffscreenCanvas(1,1).getContext("2d");if(!n)throw new Error("Failed to create OffscreenCanvas 2D context");this.ctx=n}static async create(){return typeof document<"u"&&"fonts"in document&&await document.fonts.ready,new Oe}measureText(t,n){const o=f.buildFontString(n);this.setFont(o);const{width:s,fontBoundingBoxAscent:a,fontBoundingBoxDescent:c}=this.ctx.measureText(t);let i=s;const u=Mo(t);if(u>0){const d=this.getEmojiCorrection(o);i-=d*u}return{width:i,height:a+c,ascent:a,descent:c}}setFont(t){this.currentFont!==t&&(this.ctx.font=t,this.currentFont=t)}getEmojiCorrection(t){const n=this.emojiCorrections.get(t);if(n!==void 0)return n;this.setFont(t);const o=this.ctx.measureText(vn).width,s=Po(t);let a=0;if(s!==null){const c=o-s;a=c>.5?c:0}return this.emojiCorrections.set(t,a),a}}let X=null;const Mo=e=>{const t=e.match(_o);return t?t.length:0},Po=e=>{const t=Fo();return t?(t.style.font=e,t.getBoundingClientRect().width):null},Fo=()=>typeof document>"u"?null:(X||(X=document.createElement("span"),X.style.position="absolute",X.style.visibility="hidden",X.style.whiteSpace="nowrap",X.style.left="-9999px",X.textContent=vn,document.body.appendChild(X)),X),yn=g.createContext(null),bn=({children:e,measurer:t})=>{const[n,o]=g.useState(null);g.useEffect(()=>{if(t!==void 0)return;let a=!1;const c=()=>{a||o(No())};return(async()=>{typeof document<"u"&&"fonts"in document&&await document.fonts.ready,c()})(),typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",c),()=>{a=!0,typeof document<"u"&&"fonts"in document&&document.fonts.removeEventListener("loadingdone",c)}},[t]);const s=t??n;return s===null?null:r.jsx(yn.Provider,{value:s,children:e})},ne=()=>{const e=g.useContext(yn);if(e===null)throw new Error("useTextMeasurer must be used inside a <TextMeasurerProvider>.");return e},No=()=>{try{return new f.CachedTextMeasurer(new Oe)}catch{return new f.CachedTextMeasurer(new f.HeuristicTextMeasurer)}},O=`'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu',
|
|
3
3
|
'Cantarell', 'Helvetica Neue', 'NotoSansArabic', 'NotoSansJP', 'NotoSansSC', 'NotoSansKR', 'NotoSerifKR', sans-serif, 'Apple Color Emoji', 'NotoColorEmoji'`,Ho=O,q={regular:400,medium:500,semibold:600,bold:700,extraBold:800,black:900},P={xxs:1,xs:1.1,sm:1.2,md:1.4,lg:1.6,xl:2,editorBody:1.5,headingSm:1.8,headingMd:2.2,headingLg:2.8},R={xxs:1,xs:1,sm:1.3,md:1.43,lg:1,xl:1,editorBody:1.47,headingSm:1.25,headingMd:1.41,headingLg:1.29},Bo=`var(--typography-chart-font-family, ${l.fontFamilyDefault})`,Ge=`var(--typography-chart-heading-font-family, ${l.fontFamilyHeading})`,W=e=>`${e}em`,Sn={textScale:"1",fontFamilyDefault:O,fontFamilyHeading:Ho,fontWeightRegular:q.regular.toString(),fontWeightMedium:q.medium.toString(),fontWeightSemibold:q.semibold.toString(),fontWeightBold:q.bold.toString(),fontWeightExtraBold:q.extraBold.toString(),fontWeightBlack:q.black.toString(),fontSizeXxs:W(P.xxs),fontSizeXs:W(P.xs),fontSizeSm:W(P.sm),fontSizeMd:W(P.md),fontSizeLg:W(P.lg),fontSizeXl:W(P.xl),fontLineHeightXxs:R.xxs.toString(),fontLineHeightXs:R.xs.toString(),fontLineHeightSm:R.sm.toString(),fontLineHeightMd:R.md.toString(),fontLineHeightLg:R.lg.toString(),fontLineHeightXl:R.xl.toString()},jn={fontSizeEditorBody:W(P.editorBody),fontSizeHeadingSm:W(P.headingSm),fontSizeHeadingMd:W(P.headingMd),fontSizeHeadingLg:W(P.headingLg),fontLineHeightEditorBody:R.editorBody.toString(),fontLineHeightHeadingSm:R.headingSm.toString(),fontLineHeightHeadingMd:R.headingMd.toString(),fontLineHeightHeadingLg:R.headingLg.toString()},j=(e,t,n,o=Bo)=>`${e} ${t}/${n} ${o}`,Ln={fontTickLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontAxisLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontDataLabel:j(l.fontWeightMedium,l.fontSizeXs,l.fontLineHeightXs),fontStackTotal:j(l.fontWeightSemibold,l.fontSizeXs,l.fontLineHeightXs),fontLegendLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontSeriesLabel:j(l.fontWeightSemibold,l.fontSizeSm,l.fontLineHeightSm),fontTooltipLabel:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontTooltipHeading:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontTooltipFooter:j(l.fontWeightRegular,l.fontSizeSm,l.fontLineHeightSm),fontJumboTooltipLabel:j(l.fontWeightRegular,l.fontSizeSm,l.fontLineHeightSm),fontJumboTooltip:j(l.fontWeightMedium,l.fontSizeHeadingMd,l.fontLineHeightHeadingMd),fontMiniTooltipLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontMiniTooltipFooter:j(l.fontWeightRegular,l.fontSizeSm,l.fontLineHeightSm),fontTooltipCaption:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontTooltipCaptionSmall:j(l.fontWeightMedium,l.fontSizeXxs,l.fontLineHeightXxs),fontUITooltip:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontUITooltipSecondary:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontTrendTag:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontTrendTagSmall:j(l.fontWeightMedium,l.fontSizeXs,l.fontLineHeightXs),fontGoalLineLabel:j(l.fontWeightMedium,l.fontSizeXs,l.fontLineHeightXs),fontPieLabel:j(l.fontWeightMedium,l.fontSizeXs,l.fontLineHeightXs),fontPieChartTotal:j(l.fontWeightBold,l.fontSizeHeadingLg,l.fontLineHeightHeadingLg),fontDifferenceArrowSmall:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontDifferenceArrowMedium:j(l.fontWeightMedium,l.fontSizeLg,l.fontLineHeightLg),fontDifferenceArrowLarge:j(l.fontWeightSemibold,l.fontSizeXl,l.fontLineHeightXl),fontButton:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontInput:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontInputLabel:j(l.fontWeightMedium,l.fontSizeXxs,l.fontLineHeightXxs),fontSelectLabel:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontSelectDescription:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontColorSelectLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontMenuTitle:j(l.fontWeightSemibold,l.fontSizeMd,l.fontLineHeightMd),fontMenuGroupTitle:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontMenuItemLabel:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontMenuItemLabelSecondary:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontErrorBoundaryTitle:j(l.fontWeightSemibold,l.fontSizeHeadingSm,l.fontLineHeightHeadingSm),fontErrorBoundaryMessage:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontTableCell:j(l.fontWeightMedium,l.fontSizeMd,l.fontLineHeightMd),fontTableHeaderCell:j(l.fontWeightSemibold,l.fontSizeSm,l.fontLineHeightSm),fontSourceLabel:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontSourceLink:j(l.fontWeightRegular,l.fontSizeSm,l.fontLineHeightSm),fontTextEditorH1:j(l.fontWeightBold,l.fontSizeHeadingLg,l.fontLineHeightHeadingLg,Ge),fontTextEditorH2:j(l.fontWeightBold,l.fontSizeHeadingMd,l.fontLineHeightHeadingMd,Ge),fontTextEditorH3:j(l.fontWeightSemibold,l.fontSizeHeadingSm,l.fontLineHeightHeadingSm,Ge),fontTextEditorH6:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm),fontTextEditorBody:j(l.fontWeightMedium,l.fontSizeEditorBody,l.fontLineHeightEditorBody),fontTextEditorLink:j(l.fontWeightRegular,l.fontSizeMd,l.fontLineHeightMd),fontHighlightModeTitle:j(l.fontWeightBold,l.fontSizeMd,l.fontLineHeightMd),fontHighlightModeSubtitle:j(l.fontWeightMedium,l.fontSizeSm,l.fontLineHeightSm)},Ro=11.7,Io=P.xs,Oo=O,Do=q.medium,me=5,zo=5,mt=10,xt=10,Go=4,Pe=13,Cn=6,We=12,vt=21.6,Wo="0 0 10 18",$o="M2.48935 16.9323L9.07098 9.82964C9.51595 9.34944 9.51504 8.60728 9.0689 8.12818L2.48866 1.06172C1.85811 0.384586 0.974477 0 0.049217 0H0V18H0.0443689C0.972463 18 1.85854 17.6131 2.48935 16.9323Z",yt="#FFFFFF",$e="#1A1A1A";var Xo="_16vokpr0";const qo=(e,t)=>{const n=e.mapping.y!==void 0,o=t.mainAxis==="y";return n!==o},Yo=(e,t)=>{const n=b(e?1-t:t);return e?{x1:"0%",y1:n,x2:"100%",y2:n}:{x1:n,y1:"0%",x2:n,y2:"100%"}},Vo=(e,t)=>e==="solid"?{}:e==="dotted"?{strokeDasharray:`0 ${t*2}`,strokeLinecap:"round"}:{strokeDasharray:`${t*2} ${t*3}`,strokeLinecap:"round",strokeMiterlimit:16},Uo=e=>{const t=e.params.color,n=t??l.targetLineColor;let o=l.targetLineLabelTextColor;if(t!==void 0)try{o=Ke.getContrast(t,yt)>Ke.getContrast(t,$e)?yt:$e}catch{o=$e}return{lineColor:n,labelTextColor:o}},Ko=(e,t)=>ke(e)&&ke(t)?`${e}: ${t}`:ke(e)?e:ke(t)?t:null,ke=e=>e!=null&&e.trim()!=="";var Zo="_2qyyu60";const bt=2,Jo=12,Qo=12,St=1,jt=2,es=4,ye=({shape:e,color:t,lineType:n="solid",width:o=Jo,height:s=Qo})=>r.jsx("svg",{className:Zo,width:o,height:s,viewBox:`0 0 ${o} ${s}`,"aria-hidden":!0,"data-testid":"chart-swatch","data-shape":e,children:ts({shape:e,color:t,lineType:n,width:o,height:s})}),ts=({shape:e,color:t,lineType:n,width:o,height:s})=>{const a=ns(n,o);switch(e){case"square":return r.jsx("rect",{x:1,y:1,width:o-2,height:s-2,rx:2,fill:t});case"line":return r.jsx("line",{x1:a.x1,y1:s/2,x2:a.x2,y2:s/2,stroke:t,strokeWidth:bt,strokeLinecap:a.linecap,strokeDasharray:a.dashArray});case"circle":{const c=(Math.min(o,s)-2)/2;return r.jsx("circle",{cx:o/2,cy:s/2,r:c,fill:t})}case"area":{const c=s/2-1;return r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:1,y:c,width:o-2,height:s-c-1,fill:t,opacity:.45}),r.jsx("line",{x1:a.x1,y1:c,x2:a.x2,y2:c,stroke:t,strokeWidth:bt,strokeLinecap:a.linecap,strokeDasharray:a.dashArray})]})}case"slice":return r.jsx("path",{d:`M 0 ${s} L ${o} ${s} A ${o} ${s} 0 0 0 0 0 Z`,fill:t})}},ns=(e,t)=>{if(e==="solid")return{x1:0,x2:t,dashArray:void 0,linecap:"round"};if(e==="dashed"){const o=(t-St*(jt-1))/jt;return{x1:0,x2:t,dashArray:`${o} ${St}`,linecap:"butt"}}const n=t/(es-1);return{x1:0,x2:t,dashArray:`1 ${n}`,linecap:"round"}},rs=({labelPosition:e,linePosition:t,color:n,pillWidth:o,pillHeight:s,text:a,isAnimated:c})=>{const i=e==="start",u=i?-Pe:-(o-Pe),d=i?u+o-me:u+me-We,h=i?void 0:`rotate(180 ${d+We/2} ${s/2})`,m=i?"0%":"100%",p=b(1-t),x=r.jsxs("g",{transform:`translate(0, ${-s/2})`,pointerEvents:"none",children:[r.jsx("rect",{x:u,y:0,width:o,height:s,rx:Cn,fill:n}),r.jsx("g",{transform:h,children:r.jsx("svg",{x:d,y:(s-vt)/2,width:We,height:vt,viewBox:Wo,overflow:"visible",children:r.jsx("path",{d:$o,fill:n})})}),r.jsx("g",{transform:`translate(${u+me}, ${s/2})`,children:a})]});return c?r.jsx(E.motion.svg,{initial:!1,transition:I,x:m,animate:{y:p},overflow:"visible",children:x}):r.jsx("svg",{x:m,y:p,overflow:"visible",children:x})},os=({labelPosition:e,linePosition:t,color:n,pillWidth:o,pillHeight:s,text:a,isAnimated:c})=>{const i=e==="start",u=i?-Pe:-(s-Pe),d=b(t),h=i?"100%":"0%",m=r.jsxs("g",{transform:`translate(${-o/2}, 0)`,pointerEvents:"none",children:[r.jsx("rect",{x:0,y:u,width:o,height:s,rx:Cn,fill:n}),r.jsx("g",{transform:`translate(${me}, ${u+s/2})`,children:a})]});return c?r.jsx(E.motion.svg,{initial:!1,transition:I,y:h,animate:{x:d},overflow:"visible",children:m}):r.jsx("svg",{x:d,y:h,overflow:"visible",children:m})},ss=({label:e,textWidth:t,labelPosition:n,isHorizontalLine:o,position:s,color:a,textColor:c,symbolShape:i,symbolColor:u,isAnimated:d})=>{const h=i===null?0:mt+Go,m=t+h+me*2,p=Ro+zo*2,x=r.jsxs(r.Fragment,{children:[i!==null&&u!==null&&r.jsx("g",{transform:`translate(0, ${-xt/2})`,children:r.jsx(ye,{shape:i,color:u,width:mt,height:xt})}),r.jsx("text",{x:h,textAnchor:"start",dominantBaseline:"central",fill:c,style:{font:l.fontGoalLineLabel},children:e})]});return o?r.jsx(rs,{labelPosition:n,linePosition:s,color:a,pillWidth:m,pillHeight:p,text:x,isAnimated:d}):r.jsx(os,{labelPosition:n,linePosition:s,color:a,pillWidth:m,pillHeight:p,text:x,isAnimated:d})},as=({layer:e,isHorizontalLine:t,position:n,lineColor:o,isAnimated:s})=>{const a=Yo(t,n),c=Vo(e.params.lineType,e.params.strokeWidth);return s?r.jsx(E.motion.line,{initial:!1,transition:I,animate:{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},...c,stroke:o,strokeWidth:e.params.strokeWidth,vectorEffect:"non-scaling-stroke"}):r.jsx("line",{...a,...c,stroke:o,strokeWidth:e.params.strokeWidth,vectorEffect:"non-scaling-stroke"})},is=g.memo(function({layer:t,coordSystem:n,formattingLocale:o,isAnimated:s}){const a=ne(),{guides:c,numberFormat:i,textScale:u,layers:d,compiledLayers:h,colorScale:m}=T(H.useShallow(k=>({guides:k.guides,numberFormat:k.config.numberFormat,textScale:k.config.appearance.textScale,layers:k.spec.layers,compiledLayers:k.layers,colorScale:k.scales.color}))),p=g.useMemo(()=>f.buildAverageLineSymbols(d,h,m,n).get(t.id)??null,[d,h,m,n,t.id]),x=g.useMemo(()=>Ko(t.params.label,f.formatRuleValue({guides:c,numberFormat:i,layer:t,locale:o})),[c,i,o,t]),v=g.useMemo(()=>({family:Oo,size:Y(Io,u),weight:Do}),[u]),y=g.useMemo(()=>x===null?0:a.measureText(x,v).width,[x,v,a]),S=t.data.getFirst();if(!S)return null;const{lineColor:L,labelTextColor:C}=Uo(t),w=qo(t,n),D=w?f.getY(S):f.getX(S);return D===null?null:r.jsxs("g",{"data-geom":"rule",className:Xo,children:[r.jsx(as,{layer:t,isHorizontalLine:w,position:D,lineColor:L,isAnimated:s}),x!==null&&r.jsx(ss,{label:x,textWidth:y,labelPosition:t.params.labelPosition,isHorizontalLine:w,position:D,color:L,textColor:C,symbolShape:p?.shape??null,symbolColor:p?.color??null,isAnimated:s})]})}),ls={geom:"rule",coord:"cartesian",highlightStrategy:null,guideMode:null,render:({layer:e,coordSystem:t,formattingLocale:n,isAnimated:o})=>r.jsx(is,{layer:e,coordSystem:t,formattingLocale:n,isAnimated:o}),renderHover:()=>null,renderHoverCompanions:()=>null},kn=1,Je=ee.arc(),Lt=Math.PI*2,cs=g.memo(function({layer:t,isAnimated:n}){const o=g.useRef(!1);g.useEffect(()=>{o.current=!0},[]);const s=g.useMemo(()=>{const a=Re(t.id),c=[];for(const i of t.data){const u=a(i),{startAngle:d,endAngle:h}=f.getAngleExtent(i),{innerRadius:m,outerRadius:p}=f.getRadiusExtent(i);d===null||h===null||m===null||p===null||c.push({key:u,startAngle:d,endAngle:h,innerRadius:m,outerRadius:p,fill:f.getColor(i),opacity:f.getAlpha(i)??kn})}return c},[t]);return r.jsx("svg",{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"bar",className:de,children:s.map(a=>{if(n){const{key:c,...i}=a;return r.jsx(us,{isInitialRender:!o.current,...i},c)}return r.jsx("path",{d:Je({startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius})??void 0,fill:a.fill,opacity:a.opacity},a.key)})})}),us=({startAngle:e,endAngle:t,innerRadius:n,outerRadius:o,fill:s,opacity:a,isInitialRender:c})=>{const i=c?e:Lt,u=c?t:Lt,d=E.useSpring(i,I),h=E.useSpring(u,I),m=E.useMotionValue(Je({startAngle:i,endAngle:u,innerRadius:n,outerRadius:o})??"");return g.useEffect(()=>{d.set(e),h.set(t)},[d,h,e,t]),g.useEffect(()=>{const p=()=>{const y=d.get(),S=h.get();m.set(Je({startAngle:y,endAngle:S,innerRadius:n,outerRadius:o})??"")},x=d.on("change",p),v=h.on("change",p);return()=>{x(),v()}},[d,h,n,o,m]),r.jsx(E.motion.path,{d:m,fill:s,opacity:a,transition:I})},ds=ee.arc(),hs=({primary:e})=>{const{startAngle:t,endAngle:n}=f.getAngleExtent(e.observation),{innerRadius:o,outerRadius:s}=f.getRadiusExtent(e.observation);if(t===null||n===null||o===null||s===null)return null;const a=ds({startAngle:t,endAngle:n,innerRadius:o,outerRadius:s});if(!a)return null;const c=f.getColor(e.observation),i=f.getAlpha(e.observation)??kn;return r.jsx("svg",{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"arc","data-testid":"hovered-arc",className:de,children:r.jsx("path",{d:a,fill:c,opacity:i})})},gs={geom:"bar",coord:"polar",highlightStrategy:"observation-rerender",guideMode:null,render:({layer:e,isAnimated:t})=>r.jsx(cs,{layer:e,isAnimated:t}),renderHover:({primary:e})=>r.jsx(hs,{primary:e}),renderHoverCompanions:()=>null},Ct={bar:{cartesian:jo,polar:gs},line:{cartesian:wo},area:{cartesian:po},point:{cartesian:Eo},rule:{cartesian:ls}},fs=(e=[])=>{const t={};for(const n of Object.keys(Ct))t[n]={...Ct[n]};for(const n of e){const o=t[n.geom]??{};o[n.coord]=n,t[n.geom]=o}return(n,o)=>t[n.geom]?.[o.type]??null},ps=e=>ot.createStore(t=>({compiled:e,setCompiled:n=>t(o=>o.compiled===n?o:{compiled:n})}));function ms(e,t){const n=f.isGraphConfig(e)?e.themeOverrides:void 0;return g.useMemo(()=>({...t,...n}),[t,n])}const Tn=g.createContext(null),xs=({data:e,input:t,formattingLocale:n,onChange:o,customPalettes:s,theme:a="light",themeOverrides:c,geoms:i,plugins:u,annotationPlugins:d,children:h})=>{const[m]=g.useState(()=>f.createCompiler({geoms:i})),[p]=g.useState(()=>Xr(m)),x=g.useMemo(()=>fs(u),[u]),v=g.useMemo(()=>Wr(d),[d]),y=ms(t,c),S=g.useMemo(()=>({customPalettes:s,theme:a}),[s,a]),[L]=g.useState(()=>{const k=m.compile({input:t,data:e,ctx:S});return p.emit({kind:"init"}),ps(k)}),C=g.useRef({input:t,data:e,ctx:S});g.useEffect(()=>{const k=t!==C.current.input,G=e!==C.current.data,U=S!==C.current.ctx;if(!k&&!G&&!U)return;const K=L.getState(),Z=k||U?m.compile({input:t,data:e,ctx:S}):m.recompile({spec:K.compiled.spec,data:e});C.current={input:t,data:e,ctx:S},K.setCompiled(Z),p.emit({kind:k?"input":"data"})},[t,e,S,m,L,p]);const w=g.useCallback(k=>{const G=L.getState(),U=k.apply(G.compiled.spec);if(!U)return;const K=m.recompile({spec:U.spec});if(G.setCompiled(K),p.emit({kind:"command",command:k}),!o)return;const Z=f.convertSpecToInput(U.spec);C.current={input:Z,data:C.current.data,ctx:C.current.ctx},o(Z)},[o,m,p,L]),D=g.useMemo(()=>({store:L,dispatch:w,formattingLocale:n,compileBus:p,theme:a,themeOverrides:y,resolvePlugin:x,resolveAnnotationPlugin:v}),[L,w,n,p,a,y,x,v]);return r.jsx(Tn.Provider,{value:D,children:h})},re=()=>{const e=g.useContext(Tn);if(!e)throw new Error("useGraph* hooks must be used inside a <GraphProvider>");return e},T=e=>{const{store:t}=re();return xe.useStore(t,n=>e(n.compiled))},it=()=>{const{dispatch:e}=re();return e},be=()=>{const{resolvePlugin:e}=re();return e},vs=()=>{const{resolveAnnotationPlugin:e}=re();return e};var ys="drqe3u0",bs="drqe3u1",Ss="drqe3u2",js="drqe3u3",Te="drqe3u4",Ls="drqe3u5",Cs="drqe3u6",ks="drqe3u7",Xe="drqe3u8",Ts="drqe3u9",ws="drqe3ua",As="drqe3ub",Es="drqe3uc",_s="drqe3ud",Ms="drqe3ue",Ps="drqe3uf",Fs="drqe3ug",Ns="drqe3uh",Hs="drqe3ui",kt={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},Tt={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},wn={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"};const Bs=({width:e=380,style:t,className:n}={})=>{const{compileBus:o}=re(),[s]=g.useState(()=>qr()),[a,c]=g.useState(!1),[i,u]=g.useState(f.isCompilerCachingEnabled);g.useEffect(()=>{const{recordCompile:v}=s.getState(),y=o.getLastTrigger(),S=o.getLastCompile();return y&&S&&v(y,S),o.subscribe(v)},[s,o]);const d=xe.useStore(s,v=>v.lastCompile),h=xe.useStore(s,v=>v.history),m=o.getCacheStats(),p=d===null&&h.length===0,x=()=>{u(v=>{const y=!v;return f.setCompilerCachingEnabled(y),y})};return r.jsxs("div",{className:N(ws,n),style:{width:e,...t},children:[r.jsxs("div",{className:ys,children:[r.jsxs("div",{children:[r.jsx("div",{className:bs,children:"compile cache"}),r.jsx("div",{className:Ms,children:p?"production: stats disabled":d?`last: ${d.label} · ${An(d.durationMs)}`:"awaiting first compile…"})]}),r.jsx("button",{type:"button",onClick:()=>c(v=>!v),className:Ps,children:a?"▾":"▴"})]}),!a&&r.jsxs("div",{className:As,children:[r.jsxs("button",{type:"button",onClick:x,className:i?kt.enabled:kt.disabled,"aria-pressed":i,children:["cache ",i?"enabled":"disabled"]}),r.jsx("span",{className:Fs,children:"next compile reflects this toggle"})]}),!a&&!p&&r.jsxs(r.Fragment,{children:[r.jsx(Rs,{delta:d?.stages,cumulative:m}),r.jsx(Is,{entries:h})]})]})},Rs=({delta:e,cumulative:t})=>r.jsxs("table",{className:Ss,children:[r.jsx("thead",{children:r.jsxs("tr",{className:Ns,children:[r.jsx("th",{className:js,children:"stage"}),r.jsx("th",{className:Te,children:"Δ miss"}),r.jsx("th",{className:Te,children:"Δ hit"}),r.jsx("th",{className:Te,children:"total miss"}),r.jsx("th",{className:Te,children:"total hit"})]})}),r.jsx("tbody",{children:f.COMPILER_STAGE_KEYS.map(n=>{const o=e?.[n],s=Os(o);return r.jsxs("tr",{className:Es,children:[r.jsxs("td",{className:Ls,children:[r.jsx("span",{className:wn[s],"aria-hidden":!0})," ",n]}),r.jsx("td",{className:s==="ran"?Tt.ran:Tt.dim,children:o?.misses??0}),r.jsx("td",{className:Xe,children:o?.hits??0}),r.jsx("td",{className:Xe,children:t[n].misses}),r.jsx("td",{className:Xe,children:t[n].hits})]},n)})})]}),Is=({entries:e})=>e.length===0?null:r.jsxs("div",{className:_s,children:[r.jsx("div",{className:Hs,children:"recent compiles"}),e.map(t=>{const n=Ds(t.stages,a=>a.misses>0),o=f.COMPILER_STAGE_KEYS.length,s=n===0?"cached":"ran";return r.jsxs("div",{className:Cs,children:[r.jsx("span",{className:wn[s],"aria-hidden":!0}),r.jsx("span",{className:ks,title:t.label,children:t.label}),r.jsxs("span",{className:Ts,children:[n,"/",o," ran · ",An(t.durationMs)]})]},t.id)})]}),Os=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",Ds=(e,t)=>{let n=0;for(const o of f.COMPILER_STAGE_KEYS)t(e[o])&&(n+=1);return n},An=e=>e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,zs={small:1.9,medium:2.3,large:2.6},Gs={small:1,medium:1,large:1.2},Ws=O,En=R.sm,$s=12,Xs=4,qs=4,Ys=12,Vs=4,Us=2,_n=24,Ks=()=>ot.createStore(e=>({hover:f.RESTING_HOVER_STATE,isPointerInside:!1,setHoverState:t=>e(n=>n.hover===t?n:{hover:t}),setPointerInside:t=>e(n=>n.isPointerInside===t?n:{isPointerInside:t})})),Zs=(e,t)=>{const n=g.useMemo(()=>({layers:e,coordSystem:t}),[e,t]),o=g.useRef(null);o.current===null&&(o.current=new f.HoverEngine(n));const s=o.current,a=g.useRef(!1);return g.useEffect(()=>{if(!a.current){a.current=!0;return}s.update(n)},[s,n]),s},Mn=g.createContext(null),Pn=({children:e})=>{const{layers:t,coordSystem:n}=T(H.useShallow(u=>({layers:u.layers,coordSystem:u.coordSystem}))),o=Zs(t,n),[s]=g.useState(()=>Ks()),a=g.useRef(null),c=g.useRef(null);if(c.current===null){const u=new Map,d={current:null},h=new Set,m=x=>{if(d.current=x,s.getState().setPointerInside(x!==null),x!==null)for(const v of h)v()},p=x=>(h.add(x),()=>{h.delete(x)});c.current={engine:o,store:s,overlayRef:a,hitTesterRegistry:u,cursorRef:d,setCursor:m,subscribeCursorMove:p}}const{hitTesterRegistry:i}=c.current;return g.useEffect(()=>{o.setHitTesters(i)},[o,i]),r.jsx(Mn.Provider,{value:c.current,children:e})},he=()=>{const e=g.useContext(Mn);if(e===null)throw new Error("useHoverContext must be used inside a <HoverProvider>.");return e};function Se(e){const{store:t}=he();return xe.useStore(t,e)}var Js="_19519k80",Qs="_19519k81",ea="_19519k82",ta="_19519k83",na="_19519k86",ra="_19519k87",oa="_19519k88";const Fn=({content:e})=>r.jsxs(r.Fragment,{children:[e.header!==null&&r.jsx("div",{className:Js,children:e.header}),r.jsx("div",{className:Qs,children:e.rows.map(t=>r.jsx(Nn,{row:t,shouldHighlight:t.isPrimary&&e.rows.length>1},t.key))})]}),Nn=({row:e,shouldHighlight:t})=>r.jsxs("div",{className:N(ea,{[ta]:t}),"data-testid":"chart-tooltip-row",children:[e.swatchColor!==null?r.jsx(ye,{shape:e.swatchShape,color:e.swatchColor,lineType:e.swatchLineType}):null,r.jsx("span",{className:na,children:e.label}),r.jsx("span",{className:ra,children:e.value})]}),sa=e=>{const{cursorRef:t,subscribeCursorMove:n}=he(),o=Se(a=>a.isPointerInside),s=g.useRef(e);return s.current=e,g.useEffect(()=>n(()=>s.current?.()),[n]),{cursorRef:t,isInside:o}},aa=16,ia=8,la={x:0,y:0,top:0,left:0,right:0,bottom:0,width:0,height:0,toJSON:()=>({})},ca=()=>{const e=T(H.useShallow(L=>({layers:L.layers,coordSystem:L.coordSystem,scales:L.scales,guides:L.guides,numberFormat:L.config.numberFormat,parsingLocale:L.config.parsingLocale}))),{formattingLocale:t}=re(),n=Se(L=>L.hover),o=be(),s=g.useRef(()=>{}),{cursorRef:a,isInside:c}=sa(()=>s.current()),i=g.useMemo(()=>f.buildTooltipContent({...e,hover:n,formattingLocale:t}),[e,n,t]),u=i!==null&&c,d=g.useMemo(()=>({getBoundingClientRect:()=>{const L=a.current;return L===null?la:ua(L)}}),[a]),{refs:h,floatingStyles:m,update:p}=F.useFloating({open:u,placement:"right",middleware:[F.offset(aa),F.flip(),F.shift({padding:ia})],elements:{reference:d}});if(s.current=p,!u)return null;const x=n.primary,v=x===null?null:e.layers.find(L=>L.id===x.layerId)??null,y=v===null?null:o(v,e.coordSystem),S=x!==null&&v!==null&&y?.renderTooltip?y.renderTooltip({content:i,layer:v,coordSystem:e.coordSystem,primary:x,group:n.group,related:n.related}):null;return r.jsx("div",{ref:h.setFloating,role:"tooltip",className:oa,style:m,"data-testid":"chart-tooltip",children:S??r.jsx(Fn,{content:i})})},ua=e=>({x:e.clientX,y:e.clientY,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,width:0,height:0,toJSON:()=>({})}),lt=P.sm,Hn=O,Bn=!1,we=6,J=10,da=(e,t)=>n=>{if(!n.isVisible||n.ticks.length===0)return 0;const o=n.position==="top"||n.position==="bottom",s=n.ticks.map(i=>e.measureText(i.formattedLabel,{family:Hn,size:Y(lt,t)})),a=n.labelMaxWidthPx??Number.POSITIVE_INFINITY;if(o){if(n.labelRotation!==0){const i=s.map(d=>d.width);return wt(i,a)+2*J}return Math.max(...s.map(i=>i.height))+J}return wt(s.map(i=>i.width),a)+J},wt=(e,t)=>Math.min(Math.max(...e),t),ha=e=>()=>Y(lt,e),ga=(e,t)=>(n,o)=>{const{labelLineHeight:s,labelFontWeight:a}=f.getDifferenceArrowDimensions(o,t);return e.measureText(n,{family:O,size:s,weight:a})},Rn=e=>{const{value:t,observationLabel:n,comparison:o,swatch:s,label:a}=e;return[{role:"valueRow",gap:qs,segments:qe([Ae("value","value",t??"–"),Ae("observation","label",n)])},{role:"trendRow",gap:Vs,ariaLabel:o===null?void 0:xa(o),segments:qe([pa(o),ma(o),Ae("trendReference","label",o?.reference??null)])},{role:"groupRow",gap:Xs,segments:qe([fa(s),Ae("label","label",a)])}].filter(i=>i.segments.length>0)},Ae=(e,t,n)=>n===null?null:{kind:"text",textRole:e,fontRole:t,text:n},fa=e=>e===null?null:{kind:"swatch",swatch:e,size:$s},pa=e=>e===null?null:{kind:"trendArrow",direction:e.direction,size:Ys},ma=e=>e===null?null:{kind:"text",textRole:"trendPercentage",fontRole:"label",text:e.percentage,trendDirection:e.direction},xa=e=>{switch(e.direction){case"up":return`Increased ${e.percentage} ${e.reference}`;case"down":return`Decreased ${e.percentage} ${e.reference}`;case"flat":return`No change ${e.reference}`}},qe=e=>e.filter(t=>t!==null),va=(e,t)=>(n,o)=>{const s=In(n,o,e,t),a=On(s.map(i=>i.width)),c=Math.max(0,s.length-1)*_n;return{width:a+c,height:Math.max(0,...s.map(i=>i.height))}},ya=(e,t)=>(n,o)=>In(n,o,e,t).map(s=>s.width),ba=(e,t)=>(n,o)=>{const s=Qe("value",o,t);return{width:e.measureText(n,s).width,height:s.size*En}},Sa=(e,t)=>{const n=va(e,t),o=ba(e,t);return(s,a)=>s.kind==="perGroup"?n(s,a):o(s.value,a)},In=(e,t,n,o)=>{const s={value:Qe("value",t,o),label:Qe("label",t,o)},a=c=>ja(c,s,n);return e.items.map(c=>{const i=Rn(c).map(a),u=Math.max(0,i.length-1)*Us;return{width:Math.max(0,...i.map(d=>d.width)),height:On(i.map(d=>d.height))+u}})},ja=(e,t,n)=>{let o=0,s=0;for(const a of e.segments)if(a.kind==="text"){const c=t[a.fontRole];o+=n.measureText(a.text,c).width,s=Math.max(s,c.size*En)}else o+=a.size,s=Math.max(s,a.size);return{width:o+Math.max(0,e.segments.length-1)*e.gap,height:s}},Qe=(e,t,n)=>{const o=e==="value"?zs[t]:Gs[t];return{family:Ws,size:Y(o,n)}},On=e=>e.reduce((t,n)=>t+n,0),ct=12,Dn=10,zn=8,La=8,Ca=8,ka=2,Gn=1,Wn=2,$n=4,Xn=P.sm,qn=R.sm,Yn=O,Vn=2*(Ca+Gn),ut=2*(ka+Gn),Ta=Wn*$n,Un=e=>{const t=Y(Xn,e);return{fontSizePx:t,lineBoxHeight:t*qn}},Kn=e=>e?Dn:0,wa=(e,t)=>n=>{if(n.items.length===0)return 0;const{fontSizePx:o,lineBoxHeight:s}=Un(t),a={family:Yn,size:o};if(n.position==="top"||n.position==="bottom")return Math.max(s,ct)+ut;const i=n.items.map(u=>{const d=e.measureText(u.formattedLabel,a).width,h=Kn(u.visual.color);return h+(h>0?zn:0)+d});return Math.max(...i)+Vn},Aa=(e,t)=>n=>e.measureText(n,{family:Hn,size:Y(lt,t)}),Ea=(e,t)=>g.useMemo(()=>e?{measureAxis:da(e,t),measureAxisLabel:ha(t),measureLegend:wa(e,t),measureHeadline:Sa(e,t),measureHeadlineItemWidths:ya(e,t),measureTickLabel:Aa(e,t),measureDifferenceArrowLabel:ga(e,t)}:null,[e,t]),_a=({measurer:e,axes:t,numberFormat:n,parsingLocale:o,formattedLegends:s,containerSize:a,externalMeasurements:c,headline:i,formattingLocale:u,annotations:d,coordSystem:h,textScale:m})=>g.useMemo(()=>e?new f.LayoutCompiler(e).compile({axes:t,numberFormat:n,parsingLocale:o,formattedLegends:s,containerSize:a,externalMeasurements:c,headline:i,formattingLocale:u,annotations:d,coordSystem:h,textScale:m}):null,[t,n,o,s,a,c,i,u,d,h,m,e]),At="data-variant",Zn=Dr.Paragraph.extend({addAttributes(){return{variant:{default:null,parseHTML:e=>e.getAttribute(At)??null,renderHTML:e=>e.variant?{[At]:e.variant}:{}}}}}),Ma=Or.Extension.create({name:"preventBackspaceAcrossTitleBoundary",addOptions(){return{isTitleVisible:!0}},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{if(!this.options.isTitleVisible)return!1;const{selection:t}=e.state;if(!t.empty)return!1;const{$from:n}=t;return n.depth!==1||n.parentOffset!==0?!1:n.index(0)===1}}}}),Pa=({titlePlaceholder:e,subtitlePlaceholder:t,isTitleVisible:n,isSubtitleVisible:o})=>[Na({isTitleVisible:n,isSubtitleVisible:o}),Zn,en.Text,_e.UndoRedo,Zt.Heading.configure({levels:[1,2,3]}),Ut.Bold,Jt.Italic,nn.Underline,tn.TextAlign.configure({types:["heading","paragraph"]}),Qt.Link.configure({openOnClick:!1,autolink:!0}),le.TextStyle,le.Color,le.FontFamily,Kt.HardBreak,Ma.configure({isTitleVisible:n}),_e.Placeholder.configure({showOnlyCurrent:!1,placeholder:({pos:s,editor:a})=>{if(n&&s===0)return e;const c=n?a.state.doc.firstChild?.nodeSize??-1:0;return o&&s===c?t:""}})],Fa=({placeholder:e})=>[Ze.Document,Zn,en.Text,_e.UndoRedo,Zt.Heading.configure({levels:[1,2,3]}),Ut.Bold,Jt.Italic,nn.Underline,tn.TextAlign.configure({types:["heading","paragraph"]}),Qt.Link.configure({openOnClick:!1,autolink:!0}),le.TextStyle,le.Color,le.FontFamily,Kt.HardBreak,_e.Placeholder.configure({showOnlyCurrent:!1,placeholder:({pos:t})=>t===0?e:""})],Na=({isTitleVisible:e,isSubtitleVisible:t})=>e&&t?Ze.Document.extend({content:"block{2,}"}):Ze.Document,A=(e,t)=>`color-mix(in srgb, transparent, ${e} ${t*100}%)`,De=(e,t)=>`hsl(from ${e} h s calc(l * ${1-t}))`,Jn=(e,t)=>`hsl(from ${e} h s calc(l * ${1+t}))`,et=(e,t,n)=>`color-mix(in srgb, ${e}, ${t} ${n*100}%)`,Ha=e=>/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e),Ba=e=>e.length===0?!1:typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("color",e):/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),Qn={elevationXs:"0 0 2px rgba(15, 15, 24, 0.12), 0 2px 2px rgba(14, 14, 52, 0.08)",elevationSm:"0 0 4px rgba(15, 15, 24, 0.12), 0 4px 4px rgba(14, 14, 52, 0.08)",elevationMd:"0 0 8px rgba(15, 15, 24, 0.12), 0 8px 8px rgba(14, 14, 52, 0.08)",elevationLg:"0 0 16px rgba(15, 15, 24, 0.12), 0 16px 16px rgba(14, 14, 52, 0.08)"},er={radiiXs:"4px",radiiSm:"6px",radiiMd:"8px",radiiLg:"12px"},tr={zIndexToolbar:"10",zIndexToolbarTooltip:"20",zIndexToolbarPopover:"30"},Ra=8,ae=e=>`${Ra*e}px`,nr={spaceXxs:ae(.25),spaceXs:ae(.5),spaceSm:ae(.75),spaceMd:ae(1),spaceLg:ae(1.5),spaceXl:ae(2)},Ia={transparent:"transparent",white:"#FFFFFF",black:"#000000",grey100:"#000000",grey95:"#0D0D0D",grey90:"#1A1A1A",grey85:"#1F1F1F",grey80:"#2A2A2A",grey75:"#2e2e2e",grey70:"#353535",grey60:"#494949",grey50:"#6F6F6F",grey0:"#FFFFFF",red60:"#CB3333",red50:"#F93939",amber70:"#F48135",amber50:"#FEAE47",amber40:"#FFC849",amber30:"#ffd061",green60:"#0AC600",green50:"#42CD69",blue80:"#2E62FF",blue60:"#3D70FF",purple50:"#7B56EA",purple30:"#E093FE",greyGradient80:"linear-gradient(to top, #222429, #31353f)"},Oa={textPrimary:l.grey0,textSecondary:A(l.textPrimary,.8),textDisabled:A(l.textPrimary,.5),iconPrimary:"currentColor",iconSecondary:A(l.textPrimary,.6),iconStickerBackground:l.grey70,border100:l.grey0,border50:A(l.grey0,.5),border10:A(l.grey0,.1),brand:l.purple50,success:l.green50,warning:l.amber50,alert:l.red50,sunkenBackground:l.grey100,defaultBackground:l.grey90,raisedBackground:l.grey80,overlayBackground:l.grey90,overlayBorderGradient:l.greyGradient80},Da={graphBackground:l.grey90,gridLineColor:l.border10,originLineColor:l.grey0,targetLineColor:l.border100,targetLineMarkerColor:l.border100,targetLineLabelTextColor:l.grey100,legendBackground:l.defaultBackground,legendBorderColor:l.border10,legendFocusOutlineColor:l.border50,legendTextColor:l.textPrimary,dimmedSeriesLabelTextColor:l.textDisabled,dimmedSeriesLabelLineColor:l.grey60,trendNegativeColor:l.red60,trendPositiveColor:l.green60,trendNeutralColor:l.textSecondary,toolbarBackgroundColor:l.overlayBackground,toolbarButtonBackgroundColor:"transparent",toolbarButtonBackgroundColorHovered:l.grey80,toolbarButtonBackgroundColorSelected:l.grey60,toolbarSeparatorColor:l.grey60,tooltipBackground:l.grey70,tooltipBorderColor:l.grey60,tooltipHeadingTextColor:l.textPrimary,tooltipLabelTextColor:l.textSecondary,tooltipValueTextColor:l.textPrimary,tooltipPrimaryRowColor:l.grey60,hoverGuideLineColor:A(l.white,.08),hoverGuideFillColor:A(l.white,.06),hoveredBarBorderColor:l.white,hoveredPointRingColor:l.white,pointStrokeColor:l.white,stackedBarHoverBorderColor:l.grey0,heatmapEmptyTileBackground:l.grey80,dataLabelOutsideBackground:A(l.textPrimary,.1),defaultAnnotationArrowStroke:l.white,defaultAnnotationShapeStroke:l.white,defaultAnnotationShapeFill:l.canvasBlue,arrowAnnotationStickerOutlineColor:"#FFFFFF",arrowAnnotationStickerOutlineColorInverse:"#1D2129",annotationFrameBorderColor:l.blue60,annotationMenuTriggerIconColor:l.white},za={canvasDefault:"#FFFFFF",canvasBlue:"#60a5fa",canvasCyan:"#22d3ee",canvasGreen:"#34d399",canvasYellow:"#FFC800",canvasOrange:"#fb923c",canvasRed:"#f87171",canvasPink:"#F979D9",canvasPurple:"#a78bfa",canvasGray:"#a8a29e",canvasInverse:"#000000"},Ga={...Ia,...Oa,...Qn,...er,...nr,...tr,...Da,...za,...Sn,...jn,...Ln},Wa={transparent:"transparent",white:"#FFFFFF",black:"#000000",grey100:"#FFFFFF",grey95:"#FCFCFC",grey90:"#FAFAFA",grey85:"#F5F5F5",grey80:"#F0F0F0",grey75:"#E8E8E8",grey70:"#E5E5E5",grey60:"#CCCCCC",grey50:"#C4C4C4",grey0:"#1D2129",red60:"#E14B49",red50:"#F93939",amber70:"#FFBA8C",amber50:"#FFC849",amber40:"#FEAE47",amber30:"#E7A816",green60:"#06B299",green50:"#42CD69",blue80:"#2E62FF",blue60:"#3D70FF",purple50:"#7B56EA",purple30:"#E093FE",greyGradient80:"linear-gradient(to top, #F0F0F1, #F9F9FF)"},$a={textPrimary:l.black,textSecondary:A(l.textPrimary,.6),textDisabled:A(l.textPrimary,.5),iconPrimary:"currentColor",iconSecondary:A(l.textPrimary,.6),iconStickerBackground:l.grey100,brand:l.purple50,success:l.green50,warning:l.amber50,alert:l.red50,border100:l.grey0,border50:A(l.grey0,.5),border10:A(l.grey0,.1),sunkenBackground:l.grey90,defaultBackground:l.grey100,raisedBackground:l.grey85,overlayBackground:l.grey100,overlayBorderGradient:l.border10},Xa={graphBackground:l.grey100,gridLineColor:l.border10,originLineColor:l.grey0,targetLineColor:l.border100,targetLineMarkerColor:"#A0A6C5",targetLineLabelTextColor:l.grey100,legendBackground:l.defaultBackground,legendBorderColor:l.border10,legendFocusOutlineColor:l.border50,legendTextColor:l.textPrimary,dimmedSeriesLabelTextColor:l.textDisabled,dimmedSeriesLabelLineColor:l.grey60,trendNegativeColor:l.red60,trendPositiveColor:l.green60,trendNeutralColor:l.textSecondary,toolbarBackgroundColor:l.overlayBackground,toolbarButtonBackgroundColor:"transparent",toolbarButtonBackgroundColorHovered:l.grey80,toolbarButtonBackgroundColorSelected:l.grey60,toolbarSeparatorColor:l.grey60,tooltipBackground:l.white,tooltipBorderColor:l.border10,tooltipHeadingTextColor:l.textPrimary,tooltipLabelTextColor:l.textSecondary,tooltipValueTextColor:l.textPrimary,tooltipPrimaryRowColor:l.grey80,hoverGuideLineColor:A(l.black,.08),hoverGuideFillColor:A(l.black,.04),hoveredBarBorderColor:l.white,hoveredPointRingColor:l.white,pointStrokeColor:l.white,stackedBarHoverBorderColor:l.grey0,heatmapEmptyTileBackground:l.grey80,dataLabelOutsideBackground:A(l.textPrimary,.1),defaultAnnotationArrowStroke:l.black,defaultAnnotationShapeStroke:l.black,defaultAnnotationShapeFill:l.canvasBlue,arrowAnnotationStickerOutlineColor:"#1D2129",arrowAnnotationStickerOutlineColorInverse:"#FFFFFF",annotationFrameBorderColor:l.blue60,annotationMenuTriggerIconColor:"#3d414c"},qa={canvasDefault:"#000000",canvasBlue:"#3b82f6",canvasCyan:"#06b6d4",canvasGreen:"#10b981",canvasYellow:"#E5B400",canvasOrange:"#f97316",canvasRed:"#ef4444",canvasPink:"#E845BF",canvasPurple:"#8b5cf6",canvasGray:"#78716c",canvasInverse:"#ffffff"},Ya={...Wa,...$a,...Qn,...er,...nr,...tr,...Xa,...qa,...Sn,...jn,...Ln},Fe=.1,Va={light:.05,dark:.1},Ua=(e,t)=>{switch(e.type){case"none":return null;case"solid":return e.color;case"tinted":return Ja(e.color,t);case"gradient":return Qa(e.color,t);case"preset":return f.BORDER_PRESET_GRADIENTS[e.preset]}},Ka=e=>e.type==="none"?0:e.width,Za=(e,t,n)=>{if(e.type==="solid")return e.color;if(e.type==="tinted")return et(n,e.color,Va[t])},Ja=(e,t)=>t==="dark"?De(e,Fe):Jn(e,Fe),Qa=(e,t,n=90)=>{const o=e,s=t==="dark"?De(e,Fe):Jn(e,Fe);return`linear-gradient(${n}deg, ${o} 0%, ${s} 100%)`};var ei="bow4tg0",ti="bow4tg1",ni="bow4tg2",ri="bow4tg3",rr="_1ii3bsb0",or="_1ii3bsb1";const dt=g.createContext(null),ht=()=>{const e=g.useContext(dt);if(!e)throw new Error("useThemeContext must be used inside a <ThemeProvider>.");return e},sr=({theme:e,themeOverrides:t={},appearance:n,children:o})=>{const s=g.useMemo(()=>({...e==="dark"?Ga:Ya,...t}),[e,t]),a=g.useMemo(()=>{const i={[l.textScale]:String(n.textScale)};for(const[d,h]of Object.entries(t))i[l[d]]=h;const u=Za(n.background,e,s.graphBackground);return u!==void 0&&(i[l.graphBackground]=u),zr.assignInlineVars(i)},[n.textScale,n.background,e,s.graphBackground,t]),c=g.useMemo(()=>({theme:e,themeClass:e==="dark"?or:rr,inlineVarsStyle:a,themeValues:s}),[e,a,s]);return r.jsx(dt.Provider,{value:c,children:o})},oe=({children:e,className:t,style:n})=>{const o=g.useContext(dt),s=o?N(o.themeClass,ti):void 0,a=o?{...o.inlineVarsStyle,...n}:n;return r.jsx("div",{className:N(s,t),style:a,children:e})},oi="graphy_root",se=()=>typeof document>"u"?null:document.getElementById(oi)??document.body;var si="yp3g0k0",ai="yp3g0k1",ar="yp3g0k3",ii="yp3g0k4",ir="yp3g0k5",tt="yp3g0k6",li="yp3g0k7",ci="yp3g0k8",lr="yp3g0k9",ui="yp3g0ka",di="yp3g0kb",hi="yp3g0kc",gi="yp3g0kd",fi="yp3g0ke";const pi=on.map(e=>l[e]),mi=Object.fromEntries(on.map(e=>[l[e],e])),xi=({editor:e,currentColor:t,isOpen:n,onOpenChange:o})=>{const s=yi(),a=g.useCallback(i=>{e.chain().setColor(i).run()},[e]),c=i=>{e.chain().focus().setColor(i).run(),o(!1)};return r.jsxs(M.Popover.Root,{open:n,onOpenChange:o,children:[r.jsx(M.Popover.Trigger,{render:r.jsx(_.Toolbar.Button,{}),"aria-label":"Text color",className:si,onMouseDown:i=>i.preventDefault(),children:r.jsx("span",{className:ai,style:{background:t??"transparent"}})}),r.jsx(M.Popover.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(M.Popover.Positioner,{sideOffset:6,align:"start",className:ar,children:r.jsxs(M.Popover.Popup,{className:ii,onMouseDown:i=>i.preventDefault(),children:[r.jsx(Et,{title:"Colors",colors:pi,currentColor:t,onPick:c}),s.length>0&&r.jsx(Et,{title:"Chart colors",colors:s,currentColor:t,onPick:c}),r.jsx(vi,{value:t??"#000000",onChange:a})]})})})})]})},Et=({title:e,colors:t,currentColor:n,onPick:o})=>r.jsxs("div",{className:ir,children:[r.jsx("div",{className:tt,children:e}),r.jsx("div",{className:li,children:t.map(s=>r.jsx("button",{type:"button","aria-label":s,className:ci,"data-active":Si(s,n),onMouseDown:a=>a.preventDefault(),onClick:()=>o(s),children:r.jsx("span",{className:lr,style:cr(s)})},s))})]}),vi=({value:e,onChange:t})=>{const[n,o]=g.useState(!1),s=Ba(e)?e:"#000000",a=bi(s);return r.jsxs(M.Popover.Root,{open:n,onOpenChange:o,children:[r.jsxs("div",{className:ir,children:[r.jsx("div",{className:tt,children:"Custom"}),r.jsxs(M.Popover.Trigger,{className:ui,onMouseDown:c=>c.preventDefault(),"aria-label":"Pick custom color",children:[r.jsx("span",{className:lr,style:cr(s)}),r.jsx("span",{className:di,children:a})]})]}),r.jsx(M.Popover.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(M.Popover.Positioner,{side:"right",align:"start",sideOffset:18,className:ar,children:r.jsxs(M.Popover.Popup,{className:hi,onMouseDown:c=>c.preventDefault(),children:[r.jsx("div",{className:tt,children:"Pick color"}),r.jsx(ft.HexColorPicker,{color:a,onChange:t,className:gi}),r.jsx(ft.HexColorInput,{color:a,onChange:t,prefixed:!0,className:fi,onMouseDown:c=>c.stopPropagation()})]})})})})]})},yi=()=>{const e=T(t=>t.scales.color);return g.useMemo(()=>{if(!e||e.kind!=="visual")return[];const t=new Set;for(const n of e.domain){const o=e.map(n);typeof o=="string"&&t.add(o)}return[...t]},[e])},cr=e=>({background:e,border:`1px solid ${De(e,.1)}`}),bi=e=>{const{themeValues:t}=ht();if(Ha(e))return e.toUpperCase();const n=mi[e];return n?t[n].toUpperCase():"#000000"},Si=(e,t)=>t===null?!1:e.toLowerCase()===t.toLowerCase(),ji={xxs:8,xs:12,sm:16,md:20,lg:24,xl:36};var Li={primary:"asohov1 asohov0",secondary:"asohov2 asohov0"};const V=({children:e,title:t,variant:n="primary",size:o="sm",...s})=>{const a=g.useId(),c=ji[o];return r.jsxs("svg",{className:Li[n],"aria-labelledby":t?a:void 0,height:c,width:c,fill:"none",viewBox:"0 0 24 24",role:"img",...s,children:[t&&r.jsx("title",{id:a,children:t}),e]})},ur=e=>r.jsx(V,{...e,children:r.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})}),Ci="'Noto Serif', Georgia, 'Times New Roman', serif, 'Apple Color Emoji', 'NotoColorEmoji'",dr=`'Aeonik', 'Aeonik Fallback', ${O}`,ki="'PT Mono', 'Courier New', monospace, 'Apple Color Emoji', 'NotoColorEmoji'",Ti="'Intruding Cat', cursive, 'Apple Color Emoji', 'NotoColorEmoji'",wi=`var(--brand-font-family), ${dr}`,nt=[{id:"modern",label:"Modern",preview:"Aa",fontFamily:O},{id:"fresh",label:"Fresh",preview:"Aa",fontFamily:dr},{id:"timeless",label:"Timeless",preview:"Aa",fontFamily:Ci},{id:"technical",label:"Technical",preview:"00",fontFamily:ki},{id:"fineliner",label:"Fineliner",preview:"Aa",fontFamily:Ti},{id:"brand",label:"Brand",preview:"Aa",fontFamily:wi}],Ai=e=>e?nt.find(t=>t.fontFamily===e)??null:null;var hr="_1qkyw7q0",gr="_1qkyw7q1",fr="_1qkyw7q3",pr="_1qkyw7q4",mr="_1qkyw7q5";const Ei=({editor:e,currentFontFamily:t,isOpen:n,onOpenChange:o})=>{const s=Ai(t)??nt[0],a=c=>{e.chain().focus().setFontFamily(c.fontFamily).run()};return r.jsxs(B.Menu.Root,{open:n,onOpenChange:o,children:[r.jsxs(B.Menu.Trigger,{render:r.jsx(_.Toolbar.Button,{}),"aria-label":"Font family",className:hr,onMouseDown:c=>c.preventDefault(),children:[r.jsx("span",{className:gr,style:{fontFamily:s?.fontFamily},children:s?.preview}),r.jsx(ur,{size:"sm"})]}),r.jsx(B.Menu.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(B.Menu.Positioner,{side:"bottom",align:"start",sideOffset:6,className:fr,children:r.jsx(B.Menu.Popup,{className:pr,onMouseDown:c=>c.preventDefault(),children:nt.map(c=>r.jsx(B.Menu.Item,{className:mr,"data-selected":c.id===s?.id,onClick:()=>a(c),children:r.jsx("span",{style:{fontFamily:c.fontFamily},children:c.label})},c.id))})})})})]})},xr={id:"text",label:"Text",previewFont:l.fontTextEditorBody},_t=[{id:"caption",label:"Caption",previewFont:l.fontTextEditorH6},xr,{id:"h3",label:"Heading 3",previewFont:l.fontTextEditorH3},{id:"h2",label:"Heading 2",previewFont:l.fontTextEditorH2},{id:"h1",label:"Heading 1",previewFont:l.fontTextEditorH1}],_i=({editor:e,activeStyle:t,isOpen:n,onOpenChange:o})=>{const s=_t.find(a=>a.id===t)??xr;return r.jsxs(B.Menu.Root,{open:n,onOpenChange:o,children:[r.jsxs(B.Menu.Trigger,{render:r.jsx(_.Toolbar.Button,{}),"aria-label":"Text style",className:hr,onMouseDown:a=>a.preventDefault(),children:[r.jsx("span",{className:gr,children:s.label}),r.jsx(ur,{size:"sm"})]}),r.jsx(B.Menu.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(B.Menu.Positioner,{side:"bottom",align:"start",sideOffset:6,className:fr,children:r.jsx(B.Menu.Popup,{className:pr,onMouseDown:a=>a.preventDefault(),children:_t.map(a=>r.jsx(B.Menu.Item,{className:mr,"data-selected":a.id===s.id,onClick:()=>Mi(e,a.id),children:r.jsx(Pi,{font:a.previewFont,children:a.label})},a.id))})})})})]})},Mi=(e,t)=>{switch(t){case"caption":{e.chain().focus().setNode("paragraph",{variant:"caption"}).run();return}case"text":{e.chain().focus().setNode("paragraph",{variant:null}).run();return}case"h1":e.chain().focus().setHeading({level:1}).run();return;case"h2":e.chain().focus().setHeading({level:2}).run();return;case"h3":e.chain().focus().setHeading({level:3}).run()}},Pi=({font:e,children:t})=>r.jsx("span",{style:{font:e,margin:0},children:t}),Fi=e=>r.jsx(V,{...e,children:r.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M20 6 9 17l-5-5"})})}),Ni=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),r.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),Hi=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M18 6 6 18"}),r.jsx("path",{d:"m6 6 12 12"})]})}),Bi=e=>!e.content||e.content.length===0?!0:e.content.every(t=>!t.content||t.content.length===0),Ri=e=>{const{$from:t}=e.state.selection,n=t.parent.textContent,o=t.parentOffset,s=t.start();let a=o;for(;a>0&&Mt(n[a-1]);)a-=1;let c=o;for(;c<n.length&&Mt(n[c]);)c+=1;return{from:s+a,to:s+c}},Mt=e=>e!==void 0&&/\S/.test(e);var Ii="b5kquu0",Oi="b5kquu1",Di="b5kquu2",zi="b5kquu3",Pt="b5kquu4";const Gi=({editor:e,currentUrl:t,isActive:n,isOpen:o,onOpenChange:s})=>{const[a,c]=g.useState(""),i=g.useRef(null);g.useEffect(()=>{o&&c(t??"")},[o,t]);const u=()=>{Wi(e,a),s(!1)},d=()=>{c(""),s(!1)},h=p=>{c(p.target.value)},m=p=>{p.key==="Enter"&&(p.preventDefault(),u())};return r.jsxs(M.Popover.Root,{open:o,onOpenChange:s,children:[r.jsx(M.Popover.Trigger,{render:r.jsx(_.Toolbar.Button,{}),"aria-label":"Link","data-active":n,className:Ii,onMouseDown:p=>p.preventDefault(),children:r.jsx(Ni,{})}),r.jsx(M.Popover.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(M.Popover.Positioner,{sideOffset:6,align:"end",className:Oi,children:r.jsxs(M.Popover.Popup,{className:Di,initialFocus:i,onMouseDown:p=>p.preventDefault(),children:[r.jsx("input",{ref:i,type:"url",value:a,placeholder:"Type or paste a link...","aria-label":"Link URL",className:zi,onMouseDown:p=>p.stopPropagation(),onChange:h,onKeyDown:m}),r.jsx("button",{type:"button","aria-label":"Cancel",className:Pt,onClick:d,children:r.jsx(Hi,{})}),r.jsx("button",{type:"button","aria-label":"Apply link",className:Pt,onClick:u,children:r.jsx(Fi,{})})]})})})})]})},Wi=(e,t)=>{const n=t.trim(),{selection:o}=e.state;if(!n){e.chain().focus().extendMarkRange("link").unsetLink().run();return}if(!o.empty){e.chain().focus().setLink({href:n}).run();return}if(e.isActive("link")){e.chain().focus().extendMarkRange("link").setLink({href:n}).run();return}const s=Ri(e);e.chain().focus().setTextSelection(s).setLink({href:n}).run()},$i=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 5H3"}),r.jsx("path",{d:"M17 12H7"}),r.jsx("path",{d:"M19 19H5"})]})}),Xi=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 5H3"}),r.jsx("path",{d:"M21 12H9"}),r.jsx("path",{d:"M21 19H7"})]})}),qi=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 5H3"}),r.jsx("path",{d:"M15 12H3"}),r.jsx("path",{d:"M17 19H3"})]})});var Yi="k91gos0",Vi="k91gos1";const Ui=6,ce=({label:e,isActive:t,onToggle:n,children:o})=>{const s=a=>a.preventDefault();return r.jsxs(ie.Tooltip.Root,{children:[r.jsx(ie.Tooltip.Trigger,{render:r.jsx(Gr.Toggle,{render:r.jsx(_.Toolbar.Button,{}),pressed:t,onPressedChange:()=>n()}),"aria-label":e,className:Yi,onMouseDown:s,children:o}),r.jsx(ie.Tooltip.Portal,{container:se(),children:r.jsx(oe,{children:r.jsx(ie.Tooltip.Positioner,{sideOffset:Ui,children:r.jsx(ie.Tooltip.Popup,{className:Vi,children:e})})})})]})},Ki=({editor:e,activeAlignment:t="left"})=>r.jsxs(r.Fragment,{children:[r.jsx(ce,{label:"Align left",isActive:t==="left",onToggle:()=>e.chain().focus().setTextAlign("left").run(),children:r.jsx(qi,{})}),r.jsx(ce,{label:"Align center",isActive:t==="center",onToggle:()=>e.chain().focus().setTextAlign("center").run(),children:r.jsx($i,{})}),r.jsx(ce,{label:"Align right",isActive:t==="right",onToggle:()=>e.chain().focus().setTextAlign("right").run(),children:r.jsx(Xi,{})})]});var Zi="_1bp10ig0",pe="_1bp10ig1",Ee="_1bp10ig2";const Ji=({editor:e})=>({isBold:e?.isActive("bold")??!1,isItalic:e?.isActive("italic")??!1,isUnderline:e?.isActive("underline")??!1,isLink:e?.isActive("link")??!1,linkUrl:e?.getAttributes("link").href??null,color:e?.getAttributes("textStyle").color??null,fontFamily:e?.getAttributes("textStyle").fontFamily??null,fontSize:Qi(e),textAlign:el(e)}),Qi=e=>e?e.isActive("heading",{level:1})?"h1":e.isActive("heading",{level:2})?"h2":e.isActive("heading",{level:3})?"h3":e.isActive("paragraph",{variant:"caption"})?"caption":"text":"text",el=e=>e?e.isActive({textAlign:"center"})?"center":e.isActive({textAlign:"right"})?"right":"left":"left",tl=8,nl=8,rl=({editor:e})=>{const[t,n]=g.useState(!1),[o,s]=g.useState(null),a=o!==null,c=x=>v=>{s(v?x:null)},{refs:i,floatingStyles:u}=F.useFloating({placement:"top-start",strategy:"fixed",middleware:[F.offset(tl),F.flip(),F.shift({padding:nl})],whileElementsMounted:F.autoUpdate}),d=g.useRef(null),h=st.useEditorState({editor:e,selector:Ji}),m=g.useCallback(x=>{d.current=x,i.setFloating(x)},[i]);if(g.useEffect(()=>{e&&i.setReference(e.view.dom)},[e,i]),g.useEffect(()=>{if(!e)return;const x=()=>n(!0),v=({event:y})=>{const{relatedTarget:S,currentTarget:L}=y,C=S instanceof Node&&d.current?.contains(S),w=S instanceof Node&&L instanceof Node&&L.contains(S);!C&&!w&&n(!1)};return e.on("focus",x),e.on("blur",v),()=>{e.off("focus",x),e.off("blur",v)}},[e]),!e||!t&&!a)return null;const p=se();return p?rn.createPortal(r.jsx(oe,{children:r.jsx(ie.Tooltip.Provider,{children:r.jsxs(_.Toolbar.Root,{ref:m,className:Zi,style:u,children:[r.jsxs(_.Toolbar.Group,{className:pe,children:[r.jsx(xi,{editor:e,currentColor:h?.color??null,isOpen:o==="color",onOpenChange:c("color")}),r.jsx(Ei,{editor:e,currentFontFamily:h?.fontFamily??null,isOpen:o==="fontFamily",onOpenChange:c("fontFamily")})]}),r.jsx(_.Toolbar.Separator,{className:Ee}),r.jsx(_.Toolbar.Group,{className:pe,children:r.jsx(_i,{editor:e,activeStyle:h?.fontSize??"text",isOpen:o==="fontSize",onOpenChange:c("fontSize")})}),r.jsx(_.Toolbar.Separator,{className:Ee}),r.jsxs(_.Toolbar.Group,{className:pe,children:[r.jsx(ce,{label:"Bold",isActive:h?.isBold??!1,onToggle:()=>e.chain().focus().toggleBold().run(),children:r.jsx("strong",{children:"B"})}),r.jsx(ce,{label:"Italic",isActive:h?.isItalic??!1,onToggle:()=>e.chain().focus().toggleItalic().run(),children:r.jsx("em",{children:"I"})}),r.jsx(ce,{label:"Underline",isActive:h?.isUnderline??!1,onToggle:()=>e.chain().focus().toggleUnderline().run(),children:r.jsx("u",{children:"U"})})]}),r.jsx(_.Toolbar.Separator,{className:Ee}),r.jsx(_.Toolbar.Group,{className:pe,children:r.jsx(Ki,{editor:e,activeAlignment:h?.textAlign})}),r.jsx(_.Toolbar.Separator,{className:Ee}),r.jsx(_.Toolbar.Group,{className:pe,children:r.jsx(Gi,{editor:e,currentUrl:h?.linkUrl??null,isActive:h?.isLink??!1,isOpen:o==="link",onOpenChange:c("link")})})]})})}),p):null};var ol="_2ngohc0";const vr=({editor:e,ariaLabel:t})=>r.jsxs("div",{className:ol,children:[r.jsx(rl,{editor:e}),r.jsx(st.EditorContent,{editor:e,"aria-label":t})]}),sl=(e,t)=>{const n=g.useRef(e);n.current=e;const o=g.useRef(t);o.current=t;const s=g.useRef(null),a=g.useRef(null),c=g.useMemo(()=>{const i=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null),s.current=null},u=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null);const h=s.current;h!==null&&(s.current=null,n.current(...h))};return{run:(...h)=>{if(o.current<=0){n.current(...h);return}s.current=h,a.current!==null&&clearTimeout(a.current),a.current=setTimeout(u,o.current)},flush:u,cancel:i}},[]);return g.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]),c},al=200,yr=({content:e,extensions:t,isEditable:n,onUpdate:o,updateDebounceMs:s=al})=>{const a=g.useRef(Ft(e)),c=g.useRef(!1),i=sl(d=>{c.current=!0,o?.(d)},s),u=st.useEditor({extensions:t,content:a.current,editable:n,immediatelyRender:!1,onUpdate:({editor:d})=>i.run(d.getJSON())});return g.useEffect(()=>{u?.setEditable(n)},[u,n]),g.useEffect(()=>{if(!u)return;if(c.current){c.current=!1;return}const d=Ft(e),h=u.getJSON();il(h,d)||(i.cancel(),u.commands.setContent(d,{emitUpdate:!1}))},[u,e,i]),g.useEffect(()=>()=>i.flush(),[i]),u},Ft=e=>e===null?{type:"doc",content:[]}:typeof e=="string"?{type:"doc",content:[{type:"paragraph",content:e?[{type:"text",text:e}]:[]}]}:e,il=(e,t)=>JSON.stringify(e)===JSON.stringify(t),ll=/^(?:https?:|mailto:)/i,br=e=>{if(typeof e!="string")return!1;const t=e.replace(/^[\x00-\x20]+/,"");return t.length===0?!1:ll.test(t)};var cl="_1cocly40";const ul={modern:"'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif",timeless:"'Noto Serif', Georgia, 'Times New Roman', serif",fresh:"'Aeonik', 'Aeonik Fallback', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif",technical:"'PT Mono', 'Courier New', monospace",handwritten:"'Permanent Marker', cursive",fineliner:"'Intruding Cat', cursive",brand:"var(--brand-font-family), 'Aeonik', 'Inter', sans-serif"},Ne=({content:e})=>r.jsx(r.Fragment,{children:Sr(e.content??[e])}),Sr=e=>e.map((t,n)=>dl(t,n)),dl=(e,t)=>{if(e.type==="text")return hl(e,t);if(e.type==="hardBreak"||e.type==="hard_break")return r.jsx("br",{},t);const n=e.content?Sr(e.content):null;switch(e.type){case"doc":return r.jsx(g.Fragment,{children:n},t);case"heading":{const o=ml(e.attrs?.level);return xl(o,t,n,Ht(e.attrs))}case"paragraph":{const o=ue(e.attrs?.variant);return r.jsx("p",{"data-variant":o??void 0,style:jr(Ht(e.attrs)),children:n},t)}case"blockquote":return r.jsx("blockquote",{children:n},t);case"bulletList":case"bullet_list":return r.jsx("ul",{children:n},t);case"orderedList":case"ordered_list":return r.jsx("ol",{children:n},t);case"listItem":case"list_item":return r.jsx("li",{children:n},t);default:return r.jsx("span",{children:n},t)}},hl=(e,t)=>{const n=e.text??"";return!e.marks||e.marks.length===0?r.jsx("span",{children:n},t):e.marks.reduceRight((o,s,a)=>gl(s,o,`${t}-${a}`),n)},gl=(e,t,n)=>{switch(e.type){case"bold":case"strong":return r.jsx("strong",{children:t},n);case"italic":case"em":return r.jsx("em",{children:t},n);case"underline":return r.jsx("u",{children:t},n);case"strike":case"strikethrough":case"s":return r.jsx("s",{children:t},n);case"code":return r.jsx("code",{children:t},n);case"link":{const o=ue(e.attrs?.href);return br(o)?r.jsx("a",{className:cl,href:o,rel:"noopener noreferrer",target:"_blank",children:t},n):r.jsx("span",{children:t},n)}case"textStyle":{const o=fl(e.attrs);return o?r.jsx("span",{style:o,children:t},n):r.jsx("span",{children:t},n)}default:return r.jsx("span",{children:t},n)}},Nt=e=>{const t=ue(e&&typeof e=="object"?e.fontFamily:e);if(t)return ul[t]??t},fl=e=>{if(!e)return null;const t={},n=ue(e.color);n&&(t.color=n);const o=Nt(e.font)??Nt(e.fontFamily);o&&(t.fontFamily=o);const s=pl(e.fontSize);return s&&(t.fontSize=s),Object.keys(t).length>0?t:null},pl=e=>typeof e=="number"&&Number.isFinite(e)?`${e/10}em`:ue(e),ue=e=>typeof e=="string"&&e.length>0?e:void 0,ml=e=>typeof e!="number"?3:e<1?1:e>3?3:Math.round(e),xl=(e,t,n,o)=>{const s=jr(o);switch(e){case 1:return r.jsx("h1",{style:s,children:n},t);case 2:return r.jsx("h2",{style:s,children:n},t);case 3:return r.jsx("h3",{style:s,children:n},t)}},Ht=e=>{const t=e?.textAlign;if(t==="left"||t==="right"||t==="center"||t==="justify")return t},jr=e=>e?{textAlign:e}:void 0;var vl="_4dlrid0",Lr="_4dlrid1",yl="xfz7dq0",bl="xfz7dq1",Sl="xfz7dq2",jl="xfz7dq3",Ll="xfz7dq4";const Cl=({ref:e,footerRect:t,mode:n="readonly"})=>{const{caption:o,isCaptionVisible:s,source:a,isSourceVisible:c}=T(H.useShallow(h=>({caption:h.config.content.caption,isCaptionVisible:h.config.content.isCaptionVisible,source:h.config.content.source,isSourceVisible:h.config.content.isSourceVisible}))),i=n==="editable",u=s&&(i||o!==null),d=c&&a!==null&&Al(a);return!u&&!d?null:r.jsxs("div",{ref:e,className:yl,style:{left:t.x,top:t.y,width:t.width},children:[u?i?r.jsx(El,{caption:o}):r.jsx(kl,{caption:o}):null,d&&r.jsx(Tl,{source:a})]})},kl=({caption:e})=>e===null?null:typeof e=="string"?r.jsx("p",{className:Lr,children:e}):r.jsx(Ne,{content:e}),Tl=({source:e})=>{const t=br(e.url)?e.url:void 0,n=e.label??(t!==void 0?wl(t):"");return n===""&&t===void 0?null:r.jsxs("div",{className:bl,children:[r.jsx("span",{className:jl,children:"Source:"}),t!==void 0?r.jsx("a",{className:Sl,href:t,target:"_blank",rel:"noopener noreferrer",children:n}):r.jsx("span",{className:Ll,children:n})]})},wl=e=>{try{return new URL(e).hostname}catch{return e}},Al=e=>e.label!==void 0&&e.label!==""||e.url!==void 0&&e.url!=="",El=({caption:e})=>{const t=it(),n=g.useMemo(()=>Fa({placeholder:"Add caption"}),[]),o=yr({content:e,extensions:n,isEditable:!0,onUpdate:s=>{const a=Bi(s)?null:s;t(new f.SetContentCaptionCommand({caption:a}))}});return r.jsx(vr,{editor:o,ariaLabel:"Chart caption"})};var _l="_1k4qtbg0";const Ml=3,Pl=({title:e,isTitleVisible:t,subtitle:n,isSubtitleVisible:o})=>{const s=[];return t&&s.push({type:"heading",attrs:{level:Ml},content:Nl(e)}),o&&s.push(...Hl(n)),{type:"doc",content:s}},Fl=e=>{const t=e.content??[],[n,...o]=t;return{title:Bl(n?.content??[]),subtitle:Rl(o)}},gt=e=>({type:e.type??"text",...e.content!==void 0?{content:e.content.map(gt)}:{},...e.text!==void 0?{text:e.text}:{},...e.marks!==void 0?{marks:e.marks}:{},...e.attrs!==void 0?{attrs:e.attrs}:{}}),Nl=e=>e===null?[]:typeof e=="string"?e===""?[]:[{type:"text",text:e}]:e.type==="doc"&&e.content?e.content.flatMap(t=>t.content??[]):e.type==="text"||e.type==="hardBreak"?[e]:e.content??[],Hl=e=>e===null?[{type:"paragraph"}]:typeof e=="string"?e===""?[{type:"paragraph"}]:[{type:"paragraph",content:[{type:"text",text:e}]}]:e.type==="doc"&&e.content?e.content.length===0?[{type:"paragraph"}]:e.content.map(Bt):[Bt(e)],Bt=e=>e.type==="paragraph"?e:{type:"paragraph",content:e.content??[e]},Bl=e=>{if(e.length===0)return null;const[t]=e;return t&&e.length===1&&t.type==="text"&&(!t.marks||t.marks.length===0)?t.text??null:{type:"paragraph",content:e.map(gt)}},Rl=e=>{const t=e.filter(o=>(o.content??[]).length>0);if(t.length===0)return null;const[n]=t;if(n&&t.length===1&&n.type==="paragraph"){const o=n.content??[],[s]=o;if(s&&o.length===1&&s.type==="text"&&(!s.marks||s.marks.length===0))return s.text??null}return{type:"doc",content:t.map(gt)}},Il=({ref:e,headerRect:t,mode:n="readonly"})=>{const{title:o,isTitleVisible:s,subtitle:a,isSubtitleVisible:c}=T(H.useShallow(h=>({isTitleVisible:h.config.content.isTitleVisible,isSubtitleVisible:h.config.content.isSubtitleVisible,title:h.config.content.title,subtitle:h.config.content.subtitle}))),i=n==="editable";return!(s&&(i||o!==null))&&!(c&&(i||a!==null))?null:r.jsx("div",{ref:e,className:_l,style:{left:t.x,top:t.y,width:t.width},children:i?r.jsx(Dl,{title:o,isTitleVisible:s,isSubtitleVisible:c,subtitle:a},[s?"title":"",c?"subtitle":""].join("-")):r.jsx(Ol,{title:o,isTitleVisible:s,isSubtitleVisible:c,subtitle:a})})},Ol=({title:e,isTitleVisible:t,isSubtitleVisible:n,subtitle:o})=>{const s=t&&e!==null,a=n&&o!==null;return r.jsxs(r.Fragment,{children:[s&&(typeof e=="string"?r.jsx("h1",{className:vl,children:e}):r.jsx(Ne,{content:e})),a&&(typeof o=="string"?r.jsx("p",{className:Lr,children:o}):r.jsx(Ne,{content:o}))]})},Dl=({title:e,isTitleVisible:t,isSubtitleVisible:n,subtitle:o})=>{const s=it(),a=g.useMemo(()=>Pa({titlePlaceholder:"Untitled",subtitlePlaceholder:"Untitled",isTitleVisible:t,isSubtitleVisible:n}),[t,n]),c=g.useMemo(()=>Pl({title:e,isTitleVisible:t,subtitle:o,isSubtitleVisible:n}),[e,t,o,n]),i=yr({content:c,extensions:a,isEditable:!0,onUpdate:u=>{const d=Fl(u);t&&s(new f.SetContentTitleCommand({title:d.title})),n&&s(new f.SetContentSubtitleCommand({subtitle:d.subtitle}))}});return r.jsx(vr,{editor:i,ariaLabel:"Chart title and subtitle"})};var zl="_1u9qprb0",Gl="_1u9qprb1",Wl="_9aen060",$l="_9aen061",Xl="_9aen062",Cr="_9aen063";const ql=Object.freeze(Object.defineProperty({__proto__:null,groupRow:Xl,item:Cr,trendRow:$l,valueRow:Wl},Symbol.toStringTag,{value:"Module"})),Yl=e=>r.jsx(V,{...e,children:r.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"m5 12 7-7 7 7"}),r.jsx("path",{d:"M12 19V5"})]})}),Vl=e=>r.jsx(V,{...e,children:r.jsx("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M5 12h14"})})});var kr="n7clvo0",Ul="n7clvo1",Kl="n7clvo2",Zl="n7clvo3",Tr={small:"n7clvo4",medium:"n7clvo5",large:"n7clvo6"},Jl={small:"n7clvo7",medium:"n7clvo8",large:"n7clvo9"},Ql={up:"n7clvoa",down:"n7clvob",flat:"n7clvoc"},ec={up:"n7clvoe n7clvod",down:"n7clvof n7clvod",flat:"n7clvog n7clvod"};const tc=({segment:e,resolvedSize:t})=>{if(e.kind==="swatch")return r.jsx(ye,{shape:e.swatch.shape,color:e.swatch.color,width:e.size,height:e.size});if(e.kind==="trendArrow")return r.jsx("div",{className:ec[e.direction],children:e.direction==="flat"?r.jsx(Vl,{size:"xs",title:""}):r.jsx(Yl,{size:"xs",title:""})});const n=e.fontRole==="value"?Tr[t]:Jl[t];return r.jsx("span",{className:N.clsx(nc(e),n),children:e.text})},nc=e=>{switch(e.textRole){case"value":return kr;case"observation":return Ul;case"trendPercentage":return Ql[e.trendDirection??"up"];case"trendReference":return Kl;case"label":return Zl}},rc=({item:e,resolvedSize:t})=>r.jsx("div",{className:Cr,children:Rn(e).map(n=>r.jsx(oc,{row:n,resolvedSize:t},n.role))}),oc=({row:e,resolvedSize:t})=>{const n=e.role==="trendRow";return r.jsx("div",{className:ql[e.role],"data-testid":n?"headline-trend":void 0,"data-direction":n?sc(e):void 0,role:n?"img":void 0,"aria-label":n?e.ariaLabel:void 0,children:e.segments.map((o,s)=>r.jsx(tc,{segment:o,resolvedSize:t},s))})},sc=e=>{const t=e.segments.find(n=>n.kind==="trendArrow");return t?.kind==="trendArrow"?t.direction:void 0},ac=({headline:e,rect:t,resolvedSize:n,visibleItemCount:o})=>{const s={left:t.x,top:t.y,width:t.width,height:t.height};return e.kind==="grandTotal"?r.jsx("div",{className:Gl,style:s,children:r.jsx("span",{className:N.clsx(kr,Tr[n]),children:e.value})}):r.jsx("div",{className:zl,style:s,children:e.items.slice(0,o).map((a,c)=>r.jsx(rc,{item:a,resolvedSize:n},`${a.label}-${c}`))})};var ic="_1oj6yix0",lc="_1oj6yix1",cc="_1oj6yix2";const uc=8,dc=16,hc=2,gc=({legends:e,containerRect:t,textScale:n})=>{const{lineBoxHeight:o}=Un(n),{placements:s,hasOverlap:a}=fc(e,t,o);if(s.length===0)return null;const c=a?dc:uc,i=c-hc;return r.jsxs("div",{className:ic,children:[a&&r.jsx("svg",{className:lc,width:t.width,height:t.height,children:s.map(u=>r.jsx(pc,{anchorY:u.anchorY,labelY:u.y,endX:i,color:u.payload.color},u.payload.key))}),s.map(u=>r.jsx("span",{className:cc,style:{left:c,top:u.y,color:u.payload.color},children:u.payload.label},u.payload.key))]})},fc=(e,t,n)=>g.useMemo(()=>{const o=[];for(const s of e)for(const a of s.items){if(a.normalizedY===null)continue;const c=typeof a.visual.color=="string"?a.visual.color:void 0;o.push({normalizedY:a.normalizedY,payload:{key:String(o.length),label:a.formattedLabel,color:c}})}return o.length===0||t.height<=0?{placements:[],hasOverlap:!1}:f.computeDirectLabelsLayout({items:o,containerHeight:t.height,labelHeight:n})},[e,t.height,n]),pc=({anchorY:e,labelY:t,endX:n,color:o})=>{const s=n/2;return r.jsx("path",{d:`M0,${e} C${s},${e} ${s},${t} ${n},${t}`,fill:"none",stroke:o??"currentColor",strokeWidth:1,strokeDasharray:"2 2"})};var mc="_6a636s0",xc="_1kjk02r0",vc="_1kjk02r1",yc="_1kjk02r2",bc="_1kjk02r3",Sc="_1kjk02r4",jc="_1kjk02r5",Lc="_1kjk02r6",Cc="_1kjk02r7",kc="_1kjk02r8",Tc="_1kjk02r9",wc="_1kjk02ra",Ac="_1kjk02rb",Ec="_1dw9dgx0";const _c="#9ca3af",Ye="\0",Mc=e=>{const t=[];return e.forEach((n,o)=>{const s=n.aesthetics.includes("size");for(const a of n.items){if(s){const d=Number(a.visual.size);if(!Number.isFinite(d)||d<=0)continue}const c=a.visual.color??"",i=s?`${Ye}${Number(a.visual.size)}`:"",u=a.visual.lineType;t.push({key:`${o}${Ye}${String(a.value)}${Ye}${c}${i}`,formattedLabel:a.formattedLabel,visual:a.visual,swatchShape:a.swatchShape,isBubble:s,primaryLineType:u})}}),t},wr=({pill:e})=>e.isBubble?r.jsx(Nc,{pill:e}):r.jsx(Fc,{pill:e}),Pc=({color:e,lineType:t,shape:n})=>e?r.jsx(ye,{shape:n,color:e,lineType:t,width:Dn,height:ct}):null,Fc=({pill:e})=>r.jsxs(r.Fragment,{children:[r.jsx(Pc,{color:e.visual.color,lineType:e.primaryLineType,shape:e.swatchShape}),r.jsx("span",{children:e.formattedLabel})]}),Nc=({pill:e})=>{const t=Number(e.visual.size);return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:Ec,style:{width:t,height:t,backgroundColor:e.visual.color??_c}}),r.jsx("span",{children:e.formattedLabel})]})},Hc=({hiddenPills:e,placement:t})=>{const[n,o]=g.useState(!1),{refs:s,floatingStyles:a}=F.useFloating({open:n,placement:t,middleware:[F.offset(4),F.flip(),F.shift({padding:8})]});g.useEffect(()=>{if(!n)return;const d=m=>{const p=m.target;if(!p)return;const x=s.reference.current,v=s.floating.current;x instanceof Element&&x.contains(p)||v instanceof Element&&v.contains(p)||o(!1)},h=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",d),document.addEventListener("keydown",h),()=>{document.removeEventListener("pointerdown",d),document.removeEventListener("keydown",h)}},[n,s.floating,s.reference]);const c=t==="left"||t==="right",i=Math.min(e.length-1,Wn),u=Array.from({length:i},(d,h)=>i-h);return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:s.setReference,className:N.clsx(xc,{[yc]:c,[vc]:!c}),children:[u.map(d=>r.jsx("span",{className:N.clsx(bc,{[jc]:c,[Sc]:!c}),style:Bc(d,c),"aria-hidden":!0},d)),r.jsx("button",{type:"button",className:N.clsx(Lc,{[Cc]:n}),onClick:()=>o(d=>!d),"aria-haspopup":"dialog","aria-expanded":n,"aria-label":`Show ${e.length} hidden legend ${e.length===1?"item":"items"}`,children:r.jsxs("span",{className:kc,children:["+",e.length]})})]}),n&&r.jsx("div",{ref:s.setFloating,role:"dialog","aria-label":"Hidden legend items",className:Tc,style:a,children:r.jsx("ul",{className:wc,children:e.map(d=>r.jsx("li",{className:Ac,children:r.jsx(wr,{pill:d})},d.key))})})]})},Bc=(e,t)=>{const n=-e*$n;return{transform:t?`translateY(${n}px)`:`translateX(${n}px)`}};var Rc="_1cecisi0",Ic="_1cecisi1",Oc="_1cecisi2",Dc="_1cecisi3";const zc=({edge:e,formattedLegends:t,containerWidth:n,containerHeight:o,textScale:s})=>{const a=ne(),c=g.useMemo(()=>Mc(t),[t]),i=e==="left"||e==="right",u=i?o:n,d=g.useMemo(()=>{if(c.length===0)return{visibleCount:0,hasOverflow:!1};if(u<=0)return{visibleCount:c.length,hasOverflow:!1};const x=Y(Xn,s),v={family:Yn,size:x},y=x*qn,S=D=>i?Gc(D,y):Rt({label:D.formattedLabel,swatchInlineSize:Wc(D),textMeasurer:a,font:v}),L=c.map(S),w=(i?y+ut:Rt({label:`+${c.length}`,swatchInlineSize:0,textMeasurer:a,font:v}))+Ta;return Xc({pillSizes:L,overflowPillSize:w,containerSize:u,gap:La})},[c,u,i,a,s]);if(c.length===0)return null;const h=c.slice(0,d.visibleCount),m=c.slice(d.visibleCount),p=d.hasOverflow&&m.length>0;return r.jsxs("div",{className:N.clsx(Rc,{[Oc]:i,[Ic]:!i}),children:[h.map(x=>r.jsx("div",{className:Dc,children:r.jsx(wr,{pill:x})},x.key)),p&&r.jsx(Hc,{hiddenPills:m,placement:qc(e)})]})},Rt=({label:e,swatchInlineSize:t,textMeasurer:n,font:o})=>{const s=n.measureText(e,o).width,a=t>0?zn:0;return t+a+s+Vn},Gc=(e,t)=>{const n=$c(e);return Math.max(t,n)+ut},Wc=e=>e.isBubble?Number(e.visual.size):Kn(e.visual.color),$c=e=>e.isBubble?Number(e.visual.size):ct,Xc=({pillSizes:e,overflowPillSize:t,containerSize:n,gap:o})=>{if(e.length===0)return{visibleCount:0,hasOverflow:!1};let s=0;for(let i=0;i<e.length;i+=1)i>0&&(s+=o),s+=e[i]??0;if(s<=n)return{visibleCount:e.length,hasOverflow:!1};let a=0,c=0;for(const i of e){const u=a+(c>0?o:0)+i;if(u+o+t>n)break;a=u,c+=1}return{visibleCount:c,hasOverflow:!0}},qc=e=>{switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}},Yc=g.memo(function({formattedLegends:t,rects:n,textScale:o}){const s=g.useMemo(()=>{const a=new Map;for(const c of t){let i=a.get(c.position);i||(i={pill:[],direct:[]},a.set(c.position,i)),c.display==="pill"?i.pill.push(c):i.direct.push(c)}return a},[t]);return r.jsx(r.Fragment,{children:Array.from(s,([a,c])=>{const i=n[a];return i===void 0?null:r.jsxs("div",{className:mc,style:{left:i.x,top:i.y,width:i.width,height:i.height},children:[r.jsx(zc,{edge:a,formattedLegends:c.pill,containerWidth:i.width,containerHeight:i.height,textScale:o}),r.jsx(gc,{legends:c.direct,containerRect:i,textScale:o})]},a)})})}),Vc=(e,t,n)=>{const o=e.filter(a=>a.interactive);if(o.length===0)return null;const s=o.map(a=>n(a,t)).filter(a=>a!==null).map(a=>a.guideMode);return s.length===0?null:s.some(a=>a==="bar")?"bar":s.every(a=>a==="continuous")?"continuous":null};function Uc(e,t){const n=f.getMainAxisCoordinate(e.mainAxis,t);if(e.mainAxis==="y"){const s=b(z(n));return{x1:0,x2:"100%",y1:s,y2:s}}const o=b(n);return{x1:o,x2:o,y1:0,y2:"100%"}}function Kc(e,t,n){const o=e.mainAxis==="y"?f.getY(n.observation):f.getX(n.observation);if(o===null)return null;const s=e.mainAxis==="y"?Jc(n):Zc(n),c=(t.x?.kind==="position"?t.x:null)?.bandwidth??s;if(c===null||c<=0)return null;const i=c/2;if(e.mainAxis==="y"){const h=b(z(o+i)),m=b(c);return{x:0,y:h,width:"100%",height:m}}const u=b(o-i),d=b(c);return{x:u,y:0,width:d,height:"100%"}}function Zc(e){const t=f.getXMin(e.observation),n=f.getXMax(e.observation);return t===null||n===null?null:n-t}function Jc(e){const t=f.getYMin(e.observation),n=f.getYMax(e.observation);return t===null||n===null?null:n-t}const Qc=1,eu="4 3",tu=({panelRect:e})=>{const{coordSystem:t,layers:n,scales:o}=T(H.useShallow(i=>({coordSystem:i.coordSystem,layers:i.layers,scales:i.scales}))),s=Se(i=>i.hover.primary),a=be();if(t.type!=="cartesian"||n.length===0||s===null)return null;const c=Vc(n,t,a);return c===null?null:c==="bar"?r.jsx(ru,{coordSystem:t,scales:o,primary:s,panelRect:e}):r.jsx(nu,{coordSystem:t,primary:s,panelRect:e})},nu=({coordSystem:e,primary:t,panelRect:n})=>{const o=Uc(e,t);return r.jsx(Ar,{panelRect:n,children:r.jsx("line",{...o,stroke:l.hoverGuideLineColor,strokeWidth:Qc,strokeDasharray:eu,strokeLinecap:"round","data-testid":"hover-guide-line"})})},ru=({coordSystem:e,scales:t,primary:n,panelRect:o})=>{const s=Kc(e,t,n);return s===null?null:r.jsx(Ar,{panelRect:o,children:r.jsx("rect",{...s,fill:l.hoverGuideFillColor,"data-testid":"hover-guide-rect"})})},Ar=({panelRect:e,children:t})=>r.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,style:{overflow:"visible",pointerEvents:"none"},"data-testid":"hover-guide",children:t}),ou=200,su=({engine:e,store:t,overlayRef:n,setCursor:o=au})=>{g.useEffect(()=>{const s=n.current;if(!s)return;const a=iu(s,e),c=lu(s,e,t,o);return()=>{c(),a()}},[e,t,n,o])},au=()=>{},iu=(e,t)=>{const n=()=>{const c=e.getBoundingClientRect();c.width===0||c.height===0||t.setViewport({width:c.width,height:c.height})};let o=null;const s=()=>{o!==null&&clearTimeout(o),o=setTimeout(()=>{o=null,n()},ou)},a=new ResizeObserver(s);return a.observe(e),n(),()=>{a.disconnect(),o!==null&&clearTimeout(o)}},lu=(e,t,n,o)=>{let s=null,a=null;const c=()=>{a=null;const d=s;if(s=null,!d)return;o({clientX:d.clientX,clientY:d.clientY});const h=e.getBoundingClientRect();if(h.width===0||h.height===0)return;const m={x:(d.clientX-h.left)/h.width,y:1-(d.clientY-h.top)/h.height};n.getState().setHoverState(t.query(m))},i=d=>{s=d,a===null&&(a=requestAnimationFrame(c))},u=()=>{s=null,a!==null&&(cancelAnimationFrame(a),a=null),o(null);const d=n.getState();d.hover.primary!==null&&d.setHoverState(f.RESTING_HOVER_STATE)};return e.addEventListener("pointermove",i),e.addEventListener("pointerleave",u),()=>{e.removeEventListener("pointermove",i),e.removeEventListener("pointerleave",u),a!==null&&cancelAnimationFrame(a),s=null}},cu=({panelRect:e})=>{const{engine:t,store:n,overlayRef:o,setCursor:s}=he();return su({engine:t,store:n,overlayRef:o,setCursor:s}),r.jsx("rect",{ref:o,x:e.x,y:e.y,width:e.width,height:e.height,fill:"transparent",pointerEvents:"all","data-testid":"pointer-capture-layer"})},Ve="data-hover-active",uu=e=>{const{store:t}=he(),n=xe.useStore(t,o=>o.hover.primary!==null);g.useEffect(()=>{const o=e.current;if(o)return n?o.setAttribute(Ve,"true"):o.removeAttribute(Ve),()=>{o.removeAttribute(Ve)}},[e,n])},It=({panelRect:e,zOrder:t})=>{const n=T(c=>c.annotations.custom),o=vs(),s=n.filter(c=>{const i=o(c.type);return i!==null&&(c.zOrder??i.zOrder)===t});if(s.length===0)return null;const a={width:e.width,height:e.height};return r.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":`custom-annotations-${t}`,children:s.map(c=>{const i=o(c.type);return i===null?null:r.jsx("g",{"data-annotation-type":c.type,children:i.draw({targets:c.targets,area:a,params:c.params})},c.id)})})},Er=P.xs,rt=O,_r=q.medium,du=q.semibold,Mr=6,Pr=2,hu=4,gu=2,Ot=4;var fu="_1agclyl0",pu="_1agclyl1",mu="_1agclyl2",xu={inside:"_1agclyl4 _1agclyl3",outside:"_1agclyl5 _1agclyl3"},vu="_1agclyl6 _1agclyl3";const Fr=({x:e,y:t,width:n,height:o,text:s,isRotated:a,target:c,position:i,coordType:u})=>{const d=a?`rotate(-90 ${e} ${t})`:void 0,h=c==="aggregate"?vu:xu[i],m=yu(c,i,u);return r.jsxs("g",{transform:d,children:[m&&r.jsx("rect",{className:m,x:e-n/2,y:t-o/2,width:n,height:o,rx:Ot,ry:Ot}),r.jsx("text",{className:h,x:e,y:t,textAnchor:"middle",dominantBaseline:"central",children:s})]})},yu=(e,t,n)=>{if(e==="aggregate")return mu;if(t==="outside"&&n==="cartesian")return pu},bu={dataLabel:{x:Mr,y:Pr},stackTotal:{x:hu,y:gu}},Su=({panelRect:e,formattingLocale:t})=>{const n=ne(),o=T(H.useShallow(i=>({layers:i.layers,coordSystem:i.coordSystem,axes:i.guides.axes,numberFormat:i.config.numberFormat,parsingLocale:i.config.parsingLocale,textScale:i.config.appearance.textScale}))),s=g.useMemo(()=>{const i=Y(Er,o.textScale);return{dataLabel:{family:rt,size:i,weight:_r},stackTotal:{family:rt,size:i,weight:du}}},[o.textScale]),a=g.useMemo(()=>(i,u)=>{const d=n.measureText(u,s[i]),h=bu[i];return{...d,width:d.width+h.x*2,height:d.height+h.y*2}},[n,s]),c=g.useMemo(()=>f.buildDataLabelsContent({...o,panelRect:e,measureDataLabel:a,formattingLocale:t}),[o,e,a,t]);return r.jsx("g",{className:fu,transform:`translate(${e.x}, ${e.y})`,"data-testid":"data-labels",children:c.labels.map(i=>r.jsx(Fr,{x:i.x,y:i.y,width:i.width,height:i.height,text:i.text,isRotated:i.isRotated,target:i.target,position:i.position,coordType:o.coordSystem.type},i.key))})},ju=({linePath:e,arrowheadPath:t,stroke:n,strokeWidth:o})=>{const s={stroke:n,strokeWidth:o,strokeLinecap:"round",fill:"none"};return r.jsxs("g",{children:[r.jsx("path",{d:e,...s}),r.jsx("path",{d:t,...s,strokeLinejoin:"round"})]})},Lu=({x:e,y:t,text:n,lineHeight:o,paddingX:s,paddingY:a,strokeWidth:c,strokeColor:i,fontWeight:u})=>{const d=ne(),m=g.useMemo(()=>d.measureText(n,{family:O,size:o,weight:u}),[d,n,o,u]).width+s*2,p=o+a*2;return r.jsxs("g",{style:{pointerEvents:"none"},children:[r.jsx("rect",{x:e-m/2,y:t-p/2,width:m,height:p,rx:4,fill:l.graphBackground,stroke:i,strokeWidth:c}),r.jsx("text",{x:e,y:t,dominantBaseline:"central",textAnchor:"middle",fill:l.textPrimary,style:{fontFamily:O,fontSize:o,fontWeight:u},children:n})]})},Cu=({panelRect:e,formattingLocale:t})=>{const n=T(H.useShallow(s=>({differenceArrows:s.annotations.differenceArrows,mainAxis:s.coordSystem.type==="cartesian"?s.coordSystem.mainAxis:"x",textScale:s.config.appearance.textScale}))),o=g.useMemo(()=>n.differenceArrows.map(s=>f.computeDifferenceArrow({arrow:s,mainAxis:n.mainAxis,panelWidth:e.width,panelHeight:e.height,textScale:n.textScale,locale:t})),[n,e.width,e.height,t]);return o.length===0?null:r.jsx("g",{transform:`translate(${e.x}, ${e.y})`,"data-testid":"difference-arrows",children:o.map(({color:s,id:a,linePath:c,arrowheadPath:i,strokeWidth:u,labelPosition:d,labelText:h,labelLineHeight:m,labelPaddingX:p,labelPaddingY:x,labelStrokeWidth:v,labelFontWeight:y})=>{const S=s??l.defaultAnnotationArrowStroke;return r.jsxs(g.Fragment,{children:[r.jsx(ju,{linePath:c,arrowheadPath:i,stroke:S,strokeWidth:u}),r.jsx(Lu,{x:d.x,y:d.y,text:h,lineHeight:m,paddingX:p,paddingY:x,strokeWidth:v,strokeColor:S,fontWeight:y})]},a)})})},ku=0,Tu=1.15,Dt=1.15,wu="rgba(0, 0, 0, 0.16)",zt=2,Au=1.4,Eu=({arrow:e,fallbackColor:t,stickerOutlineColor:n,stickerOutlineColorInverse:o})=>{const s=g.useId(),a=e.color??t,c=_u(e.color,n,o),i=e.dashArray?{strokeDasharray:e.dashArray,strokeDashoffset:e.dashOffset}:{},u=e.arrowheadExtent+e.strokeWidth+zt+Dt,d={x:Math.min(e.startX,e.endX)-u,y:Math.min(e.startY,e.endY)-u,width:Math.abs(e.endX-e.startX)+2*u,height:Math.abs(e.endY-e.startY)+2*u},h=[e.linePath,e.startArrowheadPath,e.endArrowheadPath].filter(m=>m.length>0).join(" ");return r.jsxs("g",{children:[e.hasStickerStyle&&r.jsx("defs",{children:r.jsx("filter",{id:s,filterUnits:"userSpaceOnUse",...d,children:r.jsx("feDropShadow",{dx:ku,dy:Tu,stdDeviation:Dt,floodColor:wu})})}),r.jsxs("g",{filter:e.hasStickerStyle?`url(#${s})`:void 0,children:[e.hasStickerStyle&&r.jsx("path",{d:h,stroke:c,strokeWidth:e.strokeWidth+2*zt,strokeLinecap:"round",fill:"none"}),r.jsx("path",{d:e.linePath,stroke:a,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none",...i}),e.startArrowheadPath.length>0&&r.jsx("path",{d:e.startArrowheadPath,stroke:a,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none"}),e.endArrowheadPath.length>0&&r.jsx("path",{d:e.endArrowheadPath,stroke:a,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none"})]})]})},_u=(e,t,n)=>{if(e===null)return n;try{return Ke.getContrast(e,t)<Au?n:t}catch{return n}},Mu=({panelRect:e})=>{const{themeValues:t}=ht(),n=T(s=>s.annotations.freeformArrows),o=g.useMemo(()=>n.map(s=>f.computeFreeformArrow({arrow:s,panelWidth:e.width,panelHeight:e.height})).filter(s=>s!==null),[n,e.width,e.height]);return o.length===0?null:r.jsx("g",{transform:`translate(${e.x}, ${e.y})`,"data-testid":"freeform-arrows",children:o.map(s=>r.jsx(Eu,{arrow:s,fallbackColor:l.defaultAnnotationArrowStroke,stickerOutlineColor:t.arrowAnnotationStickerOutlineColor,stickerOutlineColorInverse:t.arrowAnnotationStickerOutlineColorInverse},s.id))})},Pu=({edge:e,areTicksVisible:t,position:n,labelRotation:o,label:s})=>{const a=b(n),c=t?1:0,i={style:{font:l.fontTickLabel},fill:l.textSecondary},u=o!==0&&(e==="top"||e==="bottom"),d=e==="top";return u?r.jsx("svg",{x:a,y:d?"100%":0,style:{overflow:"visible"},children:r.jsx("text",{...Nu(d,c,o),...i,children:s})}):r.jsx("text",{...Fu(e,a,c),...i,children:s})},Fu=(e,t,n)=>{switch(e){case"bottom":return{x:t,y:J*n,textAnchor:"middle",dominantBaseline:"hanging"};case"top":return{x:t,y:"100%",dy:-J*n,textAnchor:"middle",dominantBaseline:"auto"};case"left":return{x:"100%",dx:-J*n,y:t,textAnchor:"end",dominantBaseline:"central"};case"right":return{x:J*n,y:t,textAnchor:"start",dominantBaseline:"central"}}},Nu=(e,t,n)=>{const o=J*t,s=e?-o:o;return{x:0,y:s,textAnchor:e?"start":"end",dominantBaseline:"central",transform:`rotate(${n}, 0, ${s})`}},Hu=({formattedAxis:e,rect:t})=>{const n=e.position==="bottom"||e.position==="top";return r.jsxs("svg",{x:t.x,y:t.y,width:t.width,height:t.height,style:{overflow:"visible"},children:[Bn,e.ticks.map((o,s)=>{const a=o.formattedLabel,c=n?o.position:1-o.position,i=Bu(e.position,c,t);return r.jsxs("g",{children:[e.ticksVisible&&r.jsx("line",{...i,stroke:l.gridLineColor,strokeWidth:1}),r.jsx(Pu,{edge:e.position,areTicksVisible:e.ticksVisible,position:c,labelRotation:e.labelRotation,label:a})]},s)})]})},Bu=(e,t,n)=>{const o=b(t);switch(e){case"bottom":return{x1:o,y1:0,x2:o,y2:we};case"top":return{x1:o,y1:n.height,x2:o,y2:n.height-we};case"left":return{x1:n.width,y1:o,x2:n.width-we,y2:o};case"right":return{x1:0,y1:o,x2:we,y2:o}}},Ru=({formattedAxes:e,rects:t})=>r.jsx(r.Fragment,{children:e.map(n=>{const o=t[n.position];return!o||!n.isVisible?null:r.jsx(Hu,{formattedAxis:n,rect:o},n.scaleAestheticKey)})}),Iu=({axes:e,rects:t})=>r.jsx(r.Fragment,{children:e.map(n=>{const o=t[n.position];if(!o||!n.isVisible)return null;const s=Ou(n.position,o);return r.jsxs("g",{transform:`translate(${o.x}, ${o.y})`,children:[Bn,r.jsx("text",{style:{font:l.fontAxisLabel},fill:l.textPrimary,...s,children:n.label})]},`axis-label-${n.position}`)})}),Ou=(e,t)=>{const n={x:t.width/2,y:t.height/2,textAnchor:"middle",dominantBaseline:"middle"};return e==="left"?(n.x=0,n.textAnchor="start"):e==="right"&&(n.x=t.width,n.textAnchor="end"),n},Gt={strokeWidth:1,strokeDashoffset:"0",strokeDasharray:"2 3",strokeLinecap:"round"},Du=({axes:e,panel:t,panelRect:n})=>r.jsxs("svg",{x:n.x,y:n.y,width:n.width,height:n.height,style:{overflow:"visible"},children:[t.border.isVisible&&r.jsx("rect",{x:0,y:0,width:n.width,height:n.height,fill:"none",stroke:l.gridLineColor,rx:8,ry:8,...Gt}),e.map(o=>{if(!o.gridVisible)return null;const s=o.position==="bottom"||o.position==="top";return r.jsx("g",{children:o.ticks.map((a,c)=>{if(a.position<=0||a.position>=1)return null;const i=s?a.position:1-a.position,u=b(i),d=s?{x1:u,y1:0,x2:u,y2:"100%"}:{x1:0,y1:u,x2:"100%",y2:u};return r.jsx("line",{...d,...Gt,stroke:l.gridLineColor},c)})},o.scaleAestheticKey)})]}),Wt=8,$t=.5,Xt={strokeWidth:1,strokeLinecap:"round"},zu=({axes:e,panelRect:t,coordSystem:n})=>{const o=e.find(y=>y.geometry==="circular"),s=e.find(y=>y.geometry==="radial");if(!o||o.ticks.length===0)return null;const a=t.x+t.width/2,c=t.y+t.height/2,i=Math.min(t.width,t.height)/2,{startAngle:u,innerRadius:d}=n,h=y=>y*2*Math.PI+u,m=(y,S)=>{const L=a+S*Math.sin(y),C=c-S*Math.cos(y);return`${L.toFixed(2)},${C.toFixed(2)}`},p=o.ticks.map(y=>h(y.position)),x=y=>`${p.map((S,L)=>`${L===0?"M":"L"} ${m(S,y)}`).join(" ")} Z`,v=(s?.ticks??[]).map(y=>(d+y.position*(1-d))*i).filter(y=>y>$t);return v.some(y=>Math.abs(y-i)<$t)||v.push(i),r.jsxs("g",{"data-guide":"polar",style:{overflow:"visible"},children:[v.map((y,S)=>r.jsx("path",{d:x(y),fill:"none",stroke:l.gridLineColor,...Xt},`ring-${S}`)),p.map((y,S)=>r.jsx("line",{x1:a,y1:c,x2:a+i*Math.sin(y),y2:c-i*Math.cos(y),stroke:l.gridLineColor,...Xt},`spoke-${S}`)),o.ticks.map((y,S)=>{const L=h(y.position),C=Math.sin(L),w=-Math.cos(L);return r.jsx("text",{x:a+C*(i+Wt),y:c+w*(i+Wt),textAnchor:C>.1?"start":C<-.1?"end":"middle",dominantBaseline:w>.1?"hanging":w<-.1?"auto":"central",style:{font:l.fontTickLabel},fill:l.textSecondary,children:y.formattedLabel},`label-${S}`)})]})},qt=({panelRect:e,zOrder:t})=>{const o=T(s=>s.annotations.shapes).filter(s=>s.zOrder===t);return o.length===0?null:r.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":`shapes-${t}`,children:o.map(({id:s,x:a,y:c,width:i,height:u,fillColor:d,fillOpacity:h,strokeWidth:m,strokeColor:p})=>r.jsx("rect",{x:b(a),y:b(c),width:b(i),height:b(u),fill:d,fillOpacity:h,stroke:m>0?p??l.defaultAnnotationShapeStroke:"none",strokeWidth:m},s))})};var Gu="_120wioc0";const Wu=({panelRect:e})=>{const t=T(n=>n.annotations.textAnnotations);return t.length===0?null:r.jsx("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":"text-annotations",children:t.map(n=>r.jsx("foreignObject",{x:b(n.x),y:b(n.y),width:b(n.width),height:b(1-n.y),overflow:"visible",children:r.jsx("div",{className:Gu,style:$u(n.backgroundColor,n.backgroundColorStyle),children:r.jsx(Ne,{content:n.content})})},n.id))})},$u=(e,t)=>e===null||e==="transparent"?{color:l.textPrimary}:t==="fade"?{color:l.textPrimary,backgroundColor:et(e,l.grey100,.5),boxShadow:`0 0 0 1.5px ${et(e,l.grey0,.2)}`}:{color:l.textPrimary,backgroundColor:e,boxShadow:`0 0 0 1.5px ${De(e,.1)}`};var Xu="usd3ea0",qu="usd3ea1";const Yu=({layer:e,coordSystem:t,isAnimated:n,isDimmed:o,highlightStyle:s,formattingLocale:a})=>{const i=be()(e,t);return i===null?r.jsxs("text",{children:[e.geom," not implemented"]}):r.jsx("g",{className:N({[qu]:o&&s==="desaturate",[Xu]:o&&s==="dim"}),children:i.render({layer:e,coordSystem:t,isAnimated:n,formattingLocale:a})})};function Vu({plugin:e,layer:t,coordSystem:n,candidates:o}){if(e?.getOverlayAnchor===void 0||o.length===0)return[];const s=[];for(const{observation:a,observationIndex:c}of o){const i=e.getOverlayAnchor({layer:t,coordSystem:n,observation:a});i!==null&&s.push({observation:a,observationIndex:c,anchor:i})}return s}const Uu=4,Ku=({plugin:e,layer:t,matchedLayer:n,overlayCandidates:o,coordSystem:s,isAnimated:a,panelRect:c,formattingLocale:i})=>{const{numberFormat:u,textScale:d}=T(H.useShallow(v=>({numberFormat:v.config.numberFormat,textScale:v.config.appearance.textScale}))),h=g.useMemo(()=>Vu({plugin:e,layer:t,coordSystem:s,candidates:o}),[e,t,s,o]),m=g.useMemo(()=>f.createSegmentYReader(t),[t]),p=g.useMemo(()=>f.buildLayerYValueFormatter({layer:t,numberFormat:u,locale:i}),[u,t,i]),x=Er*xn*d;return e===null||n===null&&h.length===0?null:r.jsxs(r.Fragment,{children:[n?e.render({layer:n,coordSystem:s,isAnimated:a,formattingLocale:i}):null,h.map(({observation:v,observationIndex:y,anchor:S})=>r.jsx(Zu,{observation:v,anchor:S,panelRect:c,readSegmentY:m,formatYValue:p,labelFontSizePx:x},Ju(v,y)))]})},Zu=({observation:e,anchor:t,panelRect:n,readSegmentY:o,formatYValue:s,labelFontSizePx:a})=>{const c=ne(),i=t.x,u=z(t.y),d=(f.getSize(e)??sn)/2,h=o(e),m=f.isDefined(h)?s(h,e):null,p=g.useMemo(()=>{if(m===null)return null;const x=c.measureText(m,{family:rt,size:a,weight:_r});return{width:x.width+Mr*2,height:x.height+Pr*2}},[m,c,a]);return r.jsxs(r.Fragment,{children:[r.jsx("circle",{"data-testid":"highlight-overlay-dot",cx:b(i),cy:b(u),r:d,fill:f.getColor(e)}),m!==null&&p!==null&&r.jsx(Fr,{x:i*n.width,y:u*n.height-d-Uu-p.height/2,width:p.width,height:p.height,text:m,isRotated:!1,target:"observation",position:"outside",coordType:"cartesian"})]})},Ju=(e,t)=>{const n=e[f.GROUP_VARIABLES.group];return`${String(n??"")}\0${t}`},Qu=({layer:e,coordSystem:t,panelRect:n})=>{const o=be(),{primary:s,group:a,related:c}=Se(H.useShallow(d=>({primary:d.hover.primary,group:d.hover.group,related:d.hover.related})));if(s===null)return null;const i=o(e,t);if(i===null)return null;const u=c.get(e.id)??[];return s.layerId===e.id?i.renderHover({layer:e,coordSystem:t,primary:s,group:a,related:u,panelRect:n}):u.length===0?null:i.renderHoverCompanions({layer:e,primary:s,related:u})};var ed="to1jkx0",td="to1jkx1";const nd=({shouldAnimate:e,panelRect:t,formattingLocale:n})=>{const{layers:o,coordSystem:s,highlightStyle:a}=T(H.useShallow(c=>({layers:c.layers,coordSystem:c.coordSystem,highlightStyle:c.config.appearance.highlightStyle})));return r.jsx("svg",{x:t.x,y:t.y,width:t.width,height:t.height,className:ed,"data-testid":"geom-layers",children:o.map(c=>r.jsxs(g.Fragment,{children:[r.jsx(sd,{layer:c,coordSystem:s,highlightStyle:a,shouldAnimate:e,panelRect:t,formattingLocale:n}),r.jsx(Qu,{layer:c,coordSystem:s,panelRect:t})]},`${c.id}-${rd(s)}`))})},rd=e=>e.type==="cartesian"?`cartesian-${e.mainAxis}`:e.type,od=e=>{if(e.highlight!==null)return td},sd=({layer:e,coordSystem:t,highlightStyle:n,shouldAnimate:o,panelRect:s,formattingLocale:a})=>{const c=be(),i=g.useMemo(()=>c(e,t),[c,e,t]),u=e.highlight;return r.jsxs("g",{className:od(e),children:[r.jsx(Yu,{layer:e,coordSystem:t,isAnimated:o,isDimmed:u?.composition.isDimmed??!1,highlightStyle:n,formattingLocale:a}),u!==null&&r.jsx(Ku,{plugin:i,layer:e,matchedLayer:u.composition.matchedLayer,overlayCandidates:u.composition.overlayCandidates,coordSystem:t,isAnimated:o,panelRect:s,formattingLocale:a})]})};var ad="_17uhij30";const id=({formattedAxes:e,formattedPolarAxes:t,plotRect:n,panelRect:o,axisRects:s,axisLabelRects:a,shouldAnimate:c,formattingLocale:i})=>{const u=g.useRef(null);uu(u);const{axes:d,panelGuide:h,coordSystem:m}=T(H.useShallow(S=>({axes:S.guides.axes,panelGuide:S.guides.panel,coordSystem:S.coordSystem}))),p=g.useMemo(()=>Nr(o,n),[o,n]),x=g.useMemo(()=>Yt(s,n),[s,n]),v=g.useMemo(()=>Yt(a,n),[a,n]),y=g.useMemo(()=>d.filter(S=>S.geometry==="linear"),[d]);return r.jsxs("svg",{ref:u,className:ad,width:n.width,height:n.height,style:{transform:`translate(${n.x}px, ${n.y}px)`},"data-testid":"plot",children:[r.jsx(Du,{axes:e,panel:h,panelRect:p}),m.type==="polar"&&r.jsx(zu,{axes:t,panelRect:p,coordSystem:m}),r.jsx(tu,{panelRect:p}),r.jsx(Ru,{formattedAxes:e,rects:x}),r.jsx(Iu,{axes:y,rects:v}),r.jsx(qt,{panelRect:p,zOrder:"background"}),r.jsx(It,{panelRect:p,zOrder:"background"}),r.jsx(nd,{shouldAnimate:c,panelRect:p,formattingLocale:i}),r.jsx(Su,{panelRect:p,formattingLocale:i}),r.jsx(Cu,{panelRect:p,formattingLocale:i}),r.jsx(qt,{panelRect:p,zOrder:"foreground"}),r.jsx(It,{panelRect:p,zOrder:"foreground"}),r.jsx(Mu,{panelRect:p}),r.jsx(Wu,{panelRect:p}),r.jsx(cu,{panelRect:p})]})},Nr=(e,t)=>({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}),Yt=(e,t)=>{const n={};for(const[o,s]of Object.entries(e))n[o]=Nr(s,t);return n},Ue={headerSize:{width:0,height:0},footerSize:{width:0,height:0}},ld=()=>{const[e,t]=g.useState(null),[n,o]=g.useState(null),[s,a]=g.useState(Ue);return g.useEffect(()=>{const c=()=>{const u=e?{width:e.offsetWidth,height:e.offsetHeight}:Ue.headerSize,d=n?{width:n.offsetWidth,height:n.offsetHeight}:Ue.footerSize;a(h=>cd(h,{headerSize:u,footerSize:d})?{headerSize:u,footerSize:d}:h)};c();const i=new ResizeObserver(c);return e&&i.observe(e),n&&i.observe(n),()=>i.disconnect()},[e,n]),{headerRef:t,footerRef:o,measurements:s}},cd=(e,t)=>e.headerSize.width!==t.headerSize.width||e.headerSize.height!==t.headerSize.height||e.footerSize.width!==t.footerSize.width||e.footerSize.height!==t.footerSize.height,ud=({appearance:e,isEditable:t,style:n,children:o})=>{const{theme:s,themeClass:a,inlineVarsStyle:c}=ht(),i=Ka(e.border),u=Math.max(0,e.cornerRadius),d=u===0?0:u+i,h=g.useMemo(()=>{const x={...n,borderRadius:`${d}px`,...c},v=Ua(e.border,s);return v!==null&&(x.background=v),x},[n,d,c,e.border,s]),m=g.useMemo(()=>({inset:`${i}px`,borderRadius:`${u}px`}),[i,u]),p=t&&e.background.type==="solid"&&e.background.color==="transparent";return r.jsx("div",{"data-testid":"graph-wrapper",className:N(ei,a),style:h,children:r.jsx("div",{"data-testid":"graph-inner",className:N(ni,{[ri]:p}),style:m,children:o})})},dd=e=>r.jsx(Pn,{children:r.jsx(bn,{children:r.jsx(hd,{...e})})}),hd=({width:e,height:t,isAnimated:n,showTooltips:o=!0,mode:s="readonly"})=>{const{axes:a,legends:c,numberFormat:i,parsingLocale:u,appearance:d,annotations:h,coordSystem:m,headline:p,headlineConfig:x}=T(H.useShallow($=>({axes:$.guides.axes,legends:$.guides.legends,numberFormat:$.config.numberFormat,parsingLocale:$.config.parsingLocale,appearance:$.config.appearance,annotations:$.annotations,coordSystem:$.coordSystem,headline:$.guides.headline,headlineConfig:$.config.headline}))),v=E.useReducedMotion(),{headerRef:y,footerRef:S,measurements:L}=ld(),{formattingLocale:C,theme:w,themeOverrides:D}=re(),k=g.useMemo(()=>f.formatLegends({legends:c,numberFormat:i,parsingLocale:u,formattingLocale:C}),[c,i,u,C]),G=g.useMemo(()=>f.formatHeadline({headline:p,show:x.show,numberFormat:i,parsingLocale:u,formattingLocale:C}),[p,x.show,i,u,C]),U=ne(),K=d.border.type==="none"?0:d.border.width,Z=g.useMemo(()=>({width:Math.max(0,e-2*K),height:Math.max(0,t-2*K)}),[e,t,K]),je=g.useMemo(()=>G?{formatted:G,size:x.size,position:x.position,innerRadius:m.type==="polar"?m.innerRadius:0}:void 0,[G,x.size,x.position,m]),Le=Ea(U,d.textScale),ge=_a({measurer:Le,axes:a,numberFormat:i,parsingLocale:u,formattedLegends:k,containerSize:Z,externalMeasurements:L,headline:je,formattingLocale:C,annotations:h,coordSystem:m,textScale:d.textScale}),Ce=g.useMemo(()=>!ge||!je||!Le?null:f.resolveHeadlinePlacement({headline:je,layout:ge.layout,containerSize:Z,measurer:Le,itemGap:_n}),[ge,je,Z,Le]);if(!ge)return null;const{layout:Q,formattedAxes:Br,formattedPolarAxes:Rr}=ge;return r.jsx(sr,{theme:w,themeOverrides:D,appearance:d,children:r.jsxs(ud,{appearance:d,isEditable:s==="editable",style:{width:e,height:t},children:[r.jsx(Il,{ref:y,headerRect:Q.header,mode:s}),r.jsx(id,{formattedAxes:Br,formattedPolarAxes:Rr,plotRect:Q.plot,panelRect:Q.panel,axisRects:Q.axes,axisLabelRects:Q.axisLabels,shouldAnimate:n??!v,formattingLocale:C??u}),r.jsx(Cl,{ref:S,footerRect:Q.footer,mode:s}),r.jsx(Yc,{formattedLegends:k,rects:Q.legends,textScale:d.textScale}),G&&Ce&&r.jsx(ac,{headline:G,rect:Ce.rect,resolvedSize:Ce.resolvedSize,visibleItemCount:Ce.visibleItemCount}),o&&r.jsx(ca,{})]})})};function gd(e,t){return{type:e.type,zOrder:t.zOrder,draw:t.draw}}const fd=2147483646;function pd(){const e=g.useRef(null),[t,n]=g.useState(null),o=g.useCallback(()=>{const a=e.current;if(!a)return;const c=a.getBoundingClientRect(),i={left:c.left,top:c.top,width:c.width,height:c.height};n(u=>u&&xd(u,i)?u:i)},[]),s=g.useCallback(a=>{e.current=a},[]);return g.useLayoutEffect(()=>{if(!e.current)return;o();const a=new ResizeObserver(o);return a.observe(e.current),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{a.disconnect(),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[o]),{ref:s,rect:t}}function md({rect:e,children:t}){return rn.createPortal(r.jsx("div",{style:{position:"fixed",left:e.left,top:e.top,width:e.width,height:e.height,pointerEvents:"none",zIndex:fd,overflow:"visible"},children:t}),document.body)}function xd(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function*vd(e,t){for(const n of e)yield{kind:n[t],observation:n}}function yd(e,t,n,o){return e>=n&&t>=o}const bd=({children:e,style:t,...n})=>r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 1 1",preserveAspectRatio:"none",...n,style:{overflow:"visible",...t},children:e});function Sd(){return g.useMemo(()=>{const e=f.DEFAULT_COLOR_PALETTE;return t=>e[t%e.length]??e[0]??"#000000"},[])}function jd(e,t){const{hitTesterRegistry:n}=he(),o=g.useRef(t);o.current=t,g.useLayoutEffect(()=>{const s=a=>o.current(a);return n.set(e,s),()=>{n.delete(e)}},[n,e])}function Ld(e){const{engine:t,store:n,setCursor:o}=he();return g.useCallback((s,a)=>{if(s===null){n.getState().setHoverState(f.RESTING_HOVER_STATE),o(null);return}n.getState().setHoverState(t.hoverByKey(e,s)),a&&o(a)},[t,n,o,e])}function Hr(e,t,n){const o=Vt(e),s=Vt(t),a=(c,i)=>Math.round(c+(i-c)*n);return`rgb(${a(o.red,s.red)}, ${a(o.green,s.green)}, ${a(o.blue,s.blue)})`}function Cd(e,t){return Hr(e,"#ffffff",t)}function Vt(e){const t=e.replace("#","");return{red:Number.parseInt(t.slice(0,2),16),green:Number.parseInt(t.slice(2,4),16),blue:Number.parseInt(t.slice(4,6),16)}}exports.CanvasTextMeasurer=Oe;exports.CompanionDot=te;exports.DevToolsPanel=Bs;exports.GraphProvider=xs;exports.GraphRenderer=dd;exports.HoverProvider=Pn;exports.PanelOverlayPortal=md;exports.PrimaryDot=Ie;exports.Swatch=ye;exports.TextMeasurerProvider=bn;exports.ThemeProvider=sr;exports.TooltipBody=Fn;exports.TooltipRowView=Nn;exports.UnitSpaceSvg=bd;exports.darkTheme=or;exports.defineAnnotationRenderer=gd;exports.defineGeomPlugin=Kr;exports.defineGeomRenderer=Zr;exports.emToPx=Y;exports.fitsLabel=yd;exports.lightTheme=rr;exports.lighten=Cd;exports.mixColor=Hr;exports.partitionByKind=vd;exports.toPercent=b;exports.toViewBoxX=eo;exports.toViewBoxY=z;exports.useCategoricalColor=Sd;exports.useCompiledSelector=T;exports.useGeomHitTest=jd;exports.useGeomHover=Ld;exports.useGraphCommandDispatcher=it;exports.useHoverState=Se;exports.usePanelScreenRect=pd;exports.useSvgPathMorph=Me;exports.useTextMeasurer=ne;exports.vars=l;
|
package/dist/index.mjs
CHANGED
|
@@ -33,7 +33,7 @@ import { Popover as B } from "@base-ui/react/popover";
|
|
|
33
33
|
import { HexColorPicker as oa, HexColorInput as aa } from "react-colorful";
|
|
34
34
|
import { Menu as D } from "@base-ui/react/menu";
|
|
35
35
|
import { Toggle as ia } from "@base-ui/react/toggle";
|
|
36
|
-
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "0.0.1-plugins.
|
|
36
|
+
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "0.0.1-plugins.7");
|
|
37
37
|
const sa = (e = []) => {
|
|
38
38
|
const t = /* @__PURE__ */ new Map();
|
|
39
39
|
for (const n of e) t.set(n.type, n);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphysdk/react-renderer",
|
|
3
3
|
"author": "Graphy",
|
|
4
|
-
"version": "0.0.1-plugins.
|
|
4
|
+
"version": "0.0.1-plugins.7",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"motion": "^12.23.12",
|
|
50
50
|
"react-colorful": "^5.6.1",
|
|
51
51
|
"zustand": "^5.0.12",
|
|
52
|
-
"@graphysdk/viz-engine": "0.0.1-plugins.
|
|
52
|
+
"@graphysdk/viz-engine": "0.0.1-plugins.7"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "^19.0.0"
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"vite-plugin-dts": "^4.5.4",
|
|
73
73
|
"vitest": "^4.1.0",
|
|
74
74
|
"@graphytools/eslint-plugin-graphy": "1.0.0",
|
|
75
|
-
"@graphytools/vitest-config": "1.0.0",
|
|
76
|
-
"@graphytools/eslint-config": "0.0.1",
|
|
77
75
|
"@graphytools/typescript-config": "0.0.1",
|
|
78
|
-
"@graphysdk/viz-engine": "0.0.1-plugins.
|
|
76
|
+
"@graphysdk/viz-engine": "0.0.1-plugins.7",
|
|
77
|
+
"@graphytools/vitest-config": "1.0.0",
|
|
78
|
+
"@graphytools/eslint-config": "0.0.1"
|
|
79
79
|
},
|
|
80
80
|
"lint-staged": {
|
|
81
81
|
"*.{ts,tsx,js,jsx,json,css,md}": [
|