@carbon/charts-react 1.22.17 → 1.22.18

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.
@@ -1,24 +1,24 @@
1
- (function(G,fe){typeof exports=="object"&&typeof module<"u"?fe(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],fe):(G=typeof globalThis<"u"?globalThis:G||self,fe(G.ChartsReact={},G.React))})(this,function(G,fe){"use strict";var bU=Object.defineProperty;var _U=(G,fe,Yn)=>fe in G?bU(G,fe,{enumerable:!0,configurable:!0,writable:!0,value:Yn}):G[fe]=Yn;var ju=(G,fe,Yn)=>_U(G,typeof fe!="symbol"?fe+"":fe,Yn);var Yn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Yn||{}),ko=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(ko||{}),Do=(e=>(e.UPDATE="model-update",e))(Do||{}),qu=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(qu||{}),Ro=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(Ro||{}),Io=(e=>(e.CHANGE="zoom-domain-change",e))(Io||{}),No=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(No||{}),Po=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(Po||{}),Uo=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Uo||{}),Bo=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(Bo||{}),Ho=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(Ho||{}),Vo=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(Vo||{}),Go=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Go||{}),zo=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(zo||{}),Fo=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Fo||{}),jo=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(jo||{}),Wo=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Wo||{}),qo=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(qo||{}),Yo=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Yo||{}),Nr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Nr||{}),Xo=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Xo||{}),Yu=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Yu||{}),Xu=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(Xu||{}),Zu=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(Zu||{}),Ku=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Ku||{}),Qu=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Qu||{}),Pr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Pr||{});const u0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Zu,Area:Uo,Axis:Po,Bar:Go,Boxplot:zo,CanvasZoom:No,Chart:Yn,Choropleth:Pr,CirclePack:Xu,Gauge:Vo,Heatmap:Qu,Legend:Yu,Line:jo,Meter:Ku,Modal:ko,Model:Do,Pie:Ho,Radar:Wo,Scatter:Fo,Threshold:Xo,Toolbar:qu,Tooltip:Nr,Tree:qo,Treemap:Yo,WordCloud:Bo,ZoomBar:Ro,ZoomDomain:Io},Symbol.toStringTag,{value:"Module"})),O=u0;var ot=(e=>(e.HTML="html",e.SVG="svg",e))(ot||{}),Zo=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Zo||{}),lt=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(lt||{}),F=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(F||{}),Ke=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ke||{}),Be=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Be||{}),Xt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Xt||{}),at=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(at||{}),Ur=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Ur||{}),Zt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Zt||{}),Br=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Br||{}),Ps=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Ps||{}),Rt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Rt||{}),pt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(pt||{}),sr=(e=>(e.CENTER="center",e))(sr||{}),Ei=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ei||{}),Kt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Kt||{}),un=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(un||{}),hn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(hn||{}),ar=(e=>(e.SEMI="semi",e.FULL="full",e))(ar||{}),Us=(e=>(e.UP="up",e.DOWN="down",e))(Us||{}),Ti=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Ti||{}),Si=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Si||{}),Ae=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(Ae||{}),Ot=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(Ot||{}),Bs=(e=>(e.LEFT="left",e.RIGHT="right",e))(Bs||{}),Qt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Qt||{}),Oi=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Oi||{}),Hr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Hr||{}),wi=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(wi||{}),dn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(dn||{}),Ju=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(Ju||{});function Ko(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function $i(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function Mi(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?d0(o,d=>d.test(a)):h0(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function h0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function d0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function p0(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const th=6048e5,f0=864e5,eh=6e4,nh=36e5,rh=Symbol.for("constructDateFrom");function He(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rh in e?e[rh](t):e instanceof Date?new e.constructor(t):new Date(t)}function or(e,...t){const n=He.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let m0={};function Hs(){return m0}function jt(e,t){return He(t||e,e)}function Ci(e,t){var n,r,i,s;const a=Hs(),o=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??a.weekStartsOn??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.weekStartsOn)??0,l=jt(e,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const g0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},v0=(e,t,n)=>{let r;const i=g0[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},y0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},x0=(e,t,n,r)=>y0[e],b0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},E0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},T0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},S0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},O0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},w0=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},$0={ordinalNumber:w0,era:$i({values:b0,defaultWidth:"wide"}),quarter:$i({values:_0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:$i({values:E0,defaultWidth:"wide"}),day:$i({values:T0,defaultWidth:"wide"}),dayPeriod:$i({values:S0,defaultWidth:"wide",formattingValues:O0,defaultFormattingWidth:"wide"})},M0=/^(\d+)(th|st|nd|rd)?/i,C0=/\d+/i,A0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},L0={any:[/^b/i,/^(a|c)/i]},k0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},D0={any:[/1/i,/2/i,/3/i,/4/i]},R0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},I0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},N0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},P0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},U0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},B0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},H0={ordinalNumber:p0({matchPattern:M0,parsePattern:C0,valueCallback:e=>parseInt(e,10)}),era:Mi({matchPatterns:A0,defaultMatchWidth:"wide",parsePatterns:L0,defaultParseWidth:"any"}),quarter:Mi({matchPatterns:k0,defaultMatchWidth:"wide",parsePatterns:D0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Mi({matchPatterns:R0,defaultMatchWidth:"wide",parsePatterns:I0,defaultParseWidth:"any"}),day:Mi({matchPatterns:N0,defaultMatchWidth:"wide",parsePatterns:P0,defaultParseWidth:"any"}),dayPeriod:Mi({matchPatterns:U0,defaultMatchWidth:"any",parsePatterns:B0,defaultParseWidth:"any"})},V0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},G0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},F0={date:Ko({formats:V0,defaultWidth:"full"}),time:Ko({formats:G0,defaultWidth:"full"}),dateTime:Ko({formats:z0,defaultWidth:"full"})},ih={code:"en-US",formatDistance:v0,formatLong:F0,formatRelative:x0,localize:$0,match:H0,options:{weekStartsOn:0,firstWeekContainsDate:1}};var sh=typeof global=="object"&&global&&global.Object===Object&&global,j0=typeof self=="object"&&self&&self.Object===Object&&self,Qe=sh||j0||Function("return this")(),Ve=Qe.Symbol,ah=Object.prototype,W0=ah.hasOwnProperty,q0=ah.toString,Ai=Ve?Ve.toStringTag:void 0;function Y0(e){var t=W0.call(e,Ai),n=e[Ai];try{e[Ai]=void 0;var r=!0}catch{}var i=q0.call(e);return r&&(t?e[Ai]=n:delete e[Ai]),i}var X0=Object.prototype,Z0=X0.toString;function K0(e){return Z0.call(e)}var Q0="[object Null]",J0="[object Undefined]",oh=Ve?Ve.toStringTag:void 0;function lr(e){return e==null?e===void 0?J0:Q0:oh&&oh in Object(e)?Y0(e):K0(e)}function pn(e){return e!=null&&typeof e=="object"}var t1="[object Symbol]";function Vs(e){return typeof e=="symbol"||pn(e)&&lr(e)==t1}function Qo(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ie=Array.isArray,lh=Ve?Ve.prototype:void 0,ch=lh?lh.toString:void 0;function uh(e){if(typeof e=="string")return e;if(ie(e))return Qo(e,uh)+"";if(Vs(e))return ch?ch.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ge(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Jo(e){return e}var e1="[object AsyncFunction]",n1="[object Function]",r1="[object GeneratorFunction]",i1="[object Proxy]";function tl(e){if(!Ge(e))return!1;var t=lr(e);return t==n1||t==r1||t==e1||t==i1}var el=Qe["__core-js_shared__"],hh=function(){var e=/[^.]+$/.exec(el&&el.keys&&el.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function s1(e){return!!hh&&hh in e}var a1=Function.prototype,o1=a1.toString;function cr(e){if(e!=null){try{return o1.call(e)}catch{}try{return e+""}catch{}}return""}var l1=/[\\^$.*+?()[\]{}|]/g,c1=/^\[object .+?Constructor\]$/,u1=Function.prototype,h1=Object.prototype,d1=u1.toString,p1=h1.hasOwnProperty,f1=RegExp("^"+d1.call(p1).replace(l1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m1(e){if(!Ge(e)||s1(e))return!1;var t=tl(e)?f1:c1;return t.test(cr(e))}function g1(e,t){return e==null?void 0:e[t]}function ur(e,t){var n=g1(e,t);return m1(n)?n:void 0}var nl=ur(Qe,"WeakMap"),dh=Object.create,v1=function(){function e(){}return function(t){if(!Ge(t))return{};if(dh)return dh(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function y1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function x1(){}function ph(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var b1=800,_1=16,E1=Date.now;function T1(e){var t=0,n=0;return function(){var r=E1(),i=_1-(r-n);if(n=r,i>0){if(++t>=b1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function S1(e){return function(){return e}}var Gs=function(){try{var e=ur(Object,"defineProperty");return e({},"",{}),e}catch{}}(),O1=Gs?function(e,t){return Gs(e,"toString",{configurable:!0,enumerable:!1,value:S1(t),writable:!0})}:Jo,fh=T1(O1);function w1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function $1(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function M1(e){return e!==e}function C1(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function A1(e,t,n){return t===t?C1(e,t,n):$1(e,M1,n)}function L1(e,t){var n=e==null?0:e.length;return!!n&&A1(e,t,0)>-1}var k1=9007199254740991,D1=/^(?:0|[1-9]\d*)$/;function rl(e,t){var n=typeof e;return t=t??k1,!!t&&(n=="number"||n!="symbol"&&D1.test(e))&&e>-1&&e%1==0&&e<t}function zs(e,t,n){t=="__proto__"&&Gs?Gs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Li(e,t){return e===t||e!==e&&t!==t}var R1=Object.prototype,I1=R1.hasOwnProperty;function mh(e,t,n){var r=e[t];(!(I1.call(e,t)&&Li(r,n))||n===void 0&&!(t in e))&&zs(e,t,n)}function Vr(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?zs(n,o,l):mh(n,o,l)}return n}var gh=Math.max;function vh(e,t,n){return t=gh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=gh(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),y1(e,this,o)}}function il(e,t){return fh(vh(e,t,Jo),e+"")}var N1=9007199254740991;function sl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=N1}function hr(e){return e!=null&&sl(e.length)&&!tl(e)}function P1(e,t,n){if(!Ge(n))return!1;var r=typeof t;return(r=="number"?hr(n)&&rl(t,n.length):r=="string"&&t in n)?Li(n[t],e):!1}function U1(e){return il(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&P1(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var B1=Object.prototype;function Fs(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||B1;return e===n}function H1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var V1="[object Arguments]";function yh(e){return pn(e)&&lr(e)==V1}var xh=Object.prototype,G1=xh.hasOwnProperty,z1=xh.propertyIsEnumerable,Gr=yh(function(){return arguments}())?yh:function(e){return pn(e)&&G1.call(e,"callee")&&!z1.call(e,"callee")};function F1(){return!1}var bh=typeof G=="object"&&G&&!G.nodeType&&G,_h=bh&&typeof module=="object"&&module&&!module.nodeType&&module,j1=_h&&_h.exports===bh,Eh=j1?Qe.Buffer:void 0,W1=Eh?Eh.isBuffer:void 0,zr=W1||F1,q1="[object Arguments]",Y1="[object Array]",X1="[object Boolean]",Z1="[object Date]",K1="[object Error]",Q1="[object Function]",J1="[object Map]",ty="[object Number]",ey="[object Object]",ny="[object RegExp]",ry="[object Set]",iy="[object String]",sy="[object WeakMap]",ay="[object ArrayBuffer]",oy="[object DataView]",ly="[object Float32Array]",cy="[object Float64Array]",uy="[object Int8Array]",hy="[object Int16Array]",dy="[object Int32Array]",py="[object Uint8Array]",fy="[object Uint8ClampedArray]",my="[object Uint16Array]",gy="[object Uint32Array]",Ut={};Ut[ly]=Ut[cy]=Ut[uy]=Ut[hy]=Ut[dy]=Ut[py]=Ut[fy]=Ut[my]=Ut[gy]=!0,Ut[q1]=Ut[Y1]=Ut[ay]=Ut[X1]=Ut[oy]=Ut[Z1]=Ut[K1]=Ut[Q1]=Ut[J1]=Ut[ty]=Ut[ey]=Ut[ny]=Ut[ry]=Ut[iy]=Ut[sy]=!1;function vy(e){return pn(e)&&sl(e.length)&&!!Ut[lr(e)]}function al(e){return function(t){return e(t)}}var Th=typeof G=="object"&&G&&!G.nodeType&&G,ki=Th&&typeof module=="object"&&module&&!module.nodeType&&module,yy=ki&&ki.exports===Th,ol=yy&&sh.process,Fr=function(){try{var e=ki&&ki.require&&ki.require("util").types;return e||ol&&ol.binding&&ol.binding("util")}catch{}}(),Sh=Fr&&Fr.isTypedArray,js=Sh?al(Sh):vy,xy=Object.prototype,by=xy.hasOwnProperty;function Oh(e,t){var n=ie(e),r=!n&&Gr(e),i=!n&&!r&&zr(e),s=!n&&!r&&!i&&js(e),a=n||r||i||s,o=a?H1(e.length,String):[],l=o.length;for(var c in e)(t||by.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||rl(c,l)))&&o.push(c);return o}function wh(e,t){return function(n){return e(t(n))}}var _y=wh(Object.keys,Object),Ey=Object.prototype,Ty=Ey.hasOwnProperty;function $h(e){if(!Fs(e))return _y(e);var t=[];for(var n in Object(e))Ty.call(e,n)&&n!="constructor"&&t.push(n);return t}function Di(e){return hr(e)?Oh(e):$h(e)}function Sy(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Oy=Object.prototype,wy=Oy.hasOwnProperty;function $y(e){if(!Ge(e))return Sy(e);var t=Fs(e),n=[];for(var r in e)r=="constructor"&&(t||!wy.call(e,r))||n.push(r);return n}function Ri(e){return hr(e)?Oh(e,!0):$y(e)}var My=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cy=/^\w*$/;function ll(e,t){if(ie(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Vs(e)?!0:Cy.test(e)||!My.test(e)||t!=null&&e in Object(t)}var Ii=ur(Object,"create");function Ay(){this.__data__=Ii?Ii(null):{},this.size=0}function Ly(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ky="__lodash_hash_undefined__",Dy=Object.prototype,Ry=Dy.hasOwnProperty;function Iy(e){var t=this.__data__;if(Ii){var n=t[e];return n===ky?void 0:n}return Ry.call(t,e)?t[e]:void 0}var Ny=Object.prototype,Py=Ny.hasOwnProperty;function Uy(e){var t=this.__data__;return Ii?t[e]!==void 0:Py.call(t,e)}var By="__lodash_hash_undefined__";function Hy(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ii&&t===void 0?By:t,this}function dr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dr.prototype.clear=Ay,dr.prototype.delete=Ly,dr.prototype.get=Iy,dr.prototype.has=Uy,dr.prototype.set=Hy;function Vy(){this.__data__=[],this.size=0}function Ws(e,t){for(var n=e.length;n--;)if(Li(e[n][0],t))return n;return-1}var Gy=Array.prototype,zy=Gy.splice;function Fy(e){var t=this.__data__,n=Ws(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():zy.call(t,n,1),--this.size,!0}function jy(e){var t=this.__data__,n=Ws(t,e);return n<0?void 0:t[n][1]}function Wy(e){return Ws(this.__data__,e)>-1}function qy(e,t){var n=this.__data__,r=Ws(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function On(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}On.prototype.clear=Vy,On.prototype.delete=Fy,On.prototype.get=jy,On.prototype.has=Wy,On.prototype.set=qy;var Ni=ur(Qe,"Map");function Yy(){this.size=0,this.__data__={hash:new dr,map:new(Ni||On),string:new dr}}function Xy(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function qs(e,t){var n=e.__data__;return Xy(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Zy(e){var t=qs(this,e).delete(e);return this.size-=t?1:0,t}function Ky(e){return qs(this,e).get(e)}function Qy(e){return qs(this,e).has(e)}function Jy(e,t){var n=qs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function wn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wn.prototype.clear=Yy,wn.prototype.delete=Zy,wn.prototype.get=Ky,wn.prototype.has=Qy,wn.prototype.set=Jy;var tx="Expected a function";function cl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(tx);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(cl.Cache||wn),n}cl.Cache=wn;var ex=500;function nx(e){var t=cl(e,function(r){return n.size===ex&&n.clear(),r}),n=t.cache;return t}var rx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ix=/\\(\\)?/g,sx=nx(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(rx,function(n,r,i,s){t.push(i?s.replace(ix,"$1"):r||n)}),t});function Pi(e){return e==null?"":uh(e)}function Ys(e,t){return ie(e)?e:ll(e,t)?[e]:sx(Pi(e))}function Ui(e){if(typeof e=="string"||Vs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function ul(e,t){t=Ys(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ui(t[n++])];return n&&n==r?e:void 0}function Et(e,t,n){var r=e==null?void 0:ul(e,t);return r===void 0?n:r}function hl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Mh=Ve?Ve.isConcatSpreadable:void 0;function ax(e){return ie(e)||Gr(e)||!!(Mh&&e&&e[Mh])}function Xs(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=ax),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Xs(o,t-1,n,r,i):hl(i,o):r||(i[i.length]=o)}return i}var dl=wh(Object.getPrototypeOf,Object),ox="[object Object]",lx=Function.prototype,cx=Object.prototype,Ch=lx.toString,ux=cx.hasOwnProperty,hx=Ch.call(Object);function Ah(e){if(!pn(e)||lr(e)!=ox)return!1;var t=dl(e);if(t===null)return!0;var n=ux.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ch.call(n)==hx}function dx(){this.__data__=new On,this.size=0}function px(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fx(e){return this.__data__.get(e)}function mx(e){return this.__data__.has(e)}var gx=200;function vx(e,t){var n=this.__data__;if(n instanceof On){var r=n.__data__;if(!Ni||r.length<gx-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new wn(r)}return n.set(e,t),this.size=n.size,this}function Je(e){var t=this.__data__=new On(e);this.size=t.size}Je.prototype.clear=dx,Je.prototype.delete=px,Je.prototype.get=fx,Je.prototype.has=mx,Je.prototype.set=vx;function yx(e,t){return e&&Vr(t,Di(t),e)}function xx(e,t){return e&&Vr(t,Ri(t),e)}var Lh=typeof G=="object"&&G&&!G.nodeType&&G,kh=Lh&&typeof module=="object"&&module&&!module.nodeType&&module,bx=kh&&kh.exports===Lh,Dh=bx?Qe.Buffer:void 0,Rh=Dh?Dh.allocUnsafe:void 0;function Ih(e,t){if(t)return e.slice();var n=e.length,r=Rh?Rh(n):new e.constructor(n);return e.copy(r),r}function _x(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Nh(){return[]}var Ex=Object.prototype,Tx=Ex.propertyIsEnumerable,Ph=Object.getOwnPropertySymbols,pl=Ph?function(e){return e==null?[]:(e=Object(e),_x(Ph(e),function(t){return Tx.call(e,t)}))}:Nh;function Sx(e,t){return Vr(e,pl(e),t)}var Ox=Object.getOwnPropertySymbols,Uh=Ox?function(e){for(var t=[];e;)hl(t,pl(e)),e=dl(e);return t}:Nh;function wx(e,t){return Vr(e,Uh(e),t)}function Bh(e,t,n){var r=t(e);return ie(e)?r:hl(r,n(e))}function fl(e){return Bh(e,Di,pl)}function Hh(e){return Bh(e,Ri,Uh)}var ml=ur(Qe,"DataView"),gl=ur(Qe,"Promise"),jr=ur(Qe,"Set"),Vh="[object Map]",$x="[object Object]",Gh="[object Promise]",zh="[object Set]",Fh="[object WeakMap]",jh="[object DataView]",Mx=cr(ml),Cx=cr(Ni),Ax=cr(gl),Lx=cr(jr),kx=cr(nl),ze=lr;(ml&&ze(new ml(new ArrayBuffer(1)))!=jh||Ni&&ze(new Ni)!=Vh||gl&&ze(gl.resolve())!=Gh||jr&&ze(new jr)!=zh||nl&&ze(new nl)!=Fh)&&(ze=function(e){var t=lr(e),n=t==$x?e.constructor:void 0,r=n?cr(n):"";if(r)switch(r){case Mx:return jh;case Cx:return Vh;case Ax:return Gh;case Lx:return zh;case kx:return Fh}return t});var Dx=Object.prototype,Rx=Dx.hasOwnProperty;function Ix(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Rx.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Zs=Qe.Uint8Array;function vl(e){var t=new e.constructor(e.byteLength);return new Zs(t).set(new Zs(e)),t}function Nx(e,t){var n=t?vl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Px=/\w*$/;function Ux(e){var t=new e.constructor(e.source,Px.exec(e));return t.lastIndex=e.lastIndex,t}var Wh=Ve?Ve.prototype:void 0,qh=Wh?Wh.valueOf:void 0;function Bx(e){return qh?Object(qh.call(e)):{}}function Yh(e,t){var n=t?vl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Hx="[object Boolean]",Vx="[object Date]",Gx="[object Map]",zx="[object Number]",Fx="[object RegExp]",jx="[object Set]",Wx="[object String]",qx="[object Symbol]",Yx="[object ArrayBuffer]",Xx="[object DataView]",Zx="[object Float32Array]",Kx="[object Float64Array]",Qx="[object Int8Array]",Jx="[object Int16Array]",tb="[object Int32Array]",eb="[object Uint8Array]",nb="[object Uint8ClampedArray]",rb="[object Uint16Array]",ib="[object Uint32Array]";function sb(e,t,n){var r=e.constructor;switch(t){case Yx:return vl(e);case Hx:case Vx:return new r(+e);case Xx:return Nx(e,n);case Zx:case Kx:case Qx:case Jx:case tb:case eb:case nb:case rb:case ib:return Yh(e,n);case Gx:return new r;case zx:case Wx:return new r(e);case Fx:return Ux(e);case jx:return new r;case qx:return Bx(e)}}function Xh(e){return typeof e.constructor=="function"&&!Fs(e)?v1(dl(e)):{}}var ab="[object Map]";function ob(e){return pn(e)&&ze(e)==ab}var Zh=Fr&&Fr.isMap,lb=Zh?al(Zh):ob,cb="[object Set]";function ub(e){return pn(e)&&ze(e)==cb}var Kh=Fr&&Fr.isSet,hb=Kh?al(Kh):ub,db=1,pb=2,fb=4,Qh="[object Arguments]",mb="[object Array]",gb="[object Boolean]",vb="[object Date]",yb="[object Error]",Jh="[object Function]",xb="[object GeneratorFunction]",bb="[object Map]",_b="[object Number]",td="[object Object]",Eb="[object RegExp]",Tb="[object Set]",Sb="[object String]",Ob="[object Symbol]",wb="[object WeakMap]",$b="[object ArrayBuffer]",Mb="[object DataView]",Cb="[object Float32Array]",Ab="[object Float64Array]",Lb="[object Int8Array]",kb="[object Int16Array]",Db="[object Int32Array]",Rb="[object Uint8Array]",Ib="[object Uint8ClampedArray]",Nb="[object Uint16Array]",Pb="[object Uint32Array]",Nt={};Nt[Qh]=Nt[mb]=Nt[$b]=Nt[Mb]=Nt[gb]=Nt[vb]=Nt[Cb]=Nt[Ab]=Nt[Lb]=Nt[kb]=Nt[Db]=Nt[bb]=Nt[_b]=Nt[td]=Nt[Eb]=Nt[Tb]=Nt[Sb]=Nt[Ob]=Nt[Rb]=Nt[Ib]=Nt[Nb]=Nt[Pb]=!0,Nt[yb]=Nt[Jh]=Nt[wb]=!1;function Bi(e,t,n,r,i,s){var a,o=t&db,l=t&pb,c=t&fb;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ge(e))return e;var u=ie(e);if(u){if(a=Ix(e),!o)return ph(e,a)}else{var d=ze(e),h=d==Jh||d==xb;if(zr(e))return Ih(e,o);if(d==td||d==Qh||h&&!i){if(a=l||h?{}:Xh(e),!o)return l?wx(e,xx(a,e)):Sx(e,yx(a,e))}else{if(!Nt[d])return i?e:{};a=sb(e,d,o)}}s||(s=new Je);var p=s.get(e);if(p)return p;s.set(e,a),hb(e)?e.forEach(function(m){a.add(Bi(m,t,n,m,e,s))}):lb(e)&&e.forEach(function(m,v){a.set(v,Bi(m,t,n,v,e,s))});var f=c?l?Hh:fl:l?Ri:Di,g=u?void 0:f(e);return w1(g||e,function(m,v){g&&(v=m,m=e[v]),mh(a,v,Bi(m,t,n,v,e,s))}),a}var Ub=1,Bb=4;function $n(e){return Bi(e,Ub|Bb)}var Hb="__lodash_hash_undefined__";function Vb(e){return this.__data__.set(e,Hb),this}function Gb(e){return this.__data__.has(e)}function Hi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new wn;++t<n;)this.add(e[t])}Hi.prototype.add=Hi.prototype.push=Vb,Hi.prototype.has=Gb;function ed(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function nd(e,t){return e.has(t)}var zb=1,Fb=2;function rd(e,t,n,r,i,s){var a=n&zb,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=n&Fb?new Hi:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var f=e[d],g=t[d];if(r)var m=a?r(g,f,d,t,e,s):r(f,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(p){if(!ed(t,function(v,x){if(!nd(p,x)&&(f===v||i(f,v,n,r,s)))return p.push(x)})){h=!1;break}}else if(!(f===g||i(f,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function jb(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function yl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Wb=1,qb=2,Yb="[object Boolean]",Xb="[object Date]",Zb="[object Error]",Kb="[object Map]",Qb="[object Number]",Jb="[object RegExp]",t_="[object Set]",e_="[object String]",n_="[object Symbol]",r_="[object ArrayBuffer]",i_="[object DataView]",id=Ve?Ve.prototype:void 0,xl=id?id.valueOf:void 0;function s_(e,t,n,r,i,s,a){switch(n){case i_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case r_:return!(e.byteLength!=t.byteLength||!s(new Zs(e),new Zs(t)));case Yb:case Xb:case Qb:return Li(+e,+t);case Zb:return e.name==t.name&&e.message==t.message;case Jb:case e_:return e==t+"";case Kb:var o=jb;case t_:var l=r&Wb;if(o||(o=yl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=qb,a.set(e,t);var u=rd(o(e),o(t),r,i,s,a);return a.delete(e),u;case n_:if(xl)return xl.call(e)==xl.call(t)}return!1}var a_=1,o_=Object.prototype,l_=o_.hasOwnProperty;function c_(e,t,n,r,i,s){var a=n&a_,o=fl(e),l=o.length,c=fl(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:l_.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var v=e[h],x=t[h];if(r)var _=a?r(x,v,h,t,e,s):r(v,x,h,e,t,s);if(!(_===void 0?v===x||i(v,x,n,r,s):_)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var E=e.constructor,b=t.constructor;E!=b&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof b=="function"&&b instanceof b)&&(g=!1)}return s.delete(e),s.delete(t),g}var u_=1,sd="[object Arguments]",ad="[object Array]",Ks="[object Object]",h_=Object.prototype,od=h_.hasOwnProperty;function d_(e,t,n,r,i,s){var a=ie(e),o=ie(t),l=a?ad:ze(e),c=o?ad:ze(t);l=l==sd?Ks:l,c=c==sd?Ks:c;var u=l==Ks,d=c==Ks,h=l==c;if(h&&zr(e)){if(!zr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Je),a||js(e)?rd(e,t,n,r,i,s):s_(e,t,l,n,r,i,s);if(!(n&u_)){var p=u&&od.call(e,"__wrapped__"),f=d&&od.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return s||(s=new Je),i(g,m,n,r,s)}}return h?(s||(s=new Je),c_(e,t,n,r,i,s)):!1}function Qs(e,t,n,r,i){return e===t?!0:e==null||t==null||!pn(e)&&!pn(t)?e!==e&&t!==t:d_(e,t,n,r,Qs,i)}var p_=1,f_=2;function m_(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new Je,d;if(!(d===void 0?Qs(c,l,p_|f_,r,u):d))return!1}}return!0}function ld(e){return e===e&&!Ge(e)}function g_(e){for(var t=Di(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ld(i)]}return t}function cd(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function v_(e){var t=g_(e);return t.length==1&&t[0][2]?cd(t[0][0],t[0][1]):function(n){return n===e||m_(n,e,t)}}function y_(e,t){return e!=null&&t in Object(e)}function x_(e,t,n){t=Ys(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Ui(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&sl(i)&&rl(a,i)&&(ie(e)||Gr(e)))}function b_(e,t){return e!=null&&x_(e,t,y_)}var __=1,E_=2;function T_(e,t){return ll(e)&&ld(t)?cd(Ui(e),t):function(n){var r=Et(n,e);return r===void 0&&r===t?b_(n,e):Qs(t,r,__|E_)}}function S_(e){return function(t){return t==null?void 0:t[e]}}function O_(e){return function(t){return ul(t,e)}}function w_(e){return ll(e)?S_(Ui(e)):O_(e)}function Js(e){return typeof e=="function"?e:e==null?Jo:typeof e=="object"?ie(e)?T_(e[0],e[1]):v_(e):w_(e)}function $_(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var ud=$_();function bl(e,t,n){(n!==void 0&&!Li(e[t],n)||n===void 0&&!(t in e))&&zs(e,t,n)}function _l(e){return pn(e)&&hr(e)}function El(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function M_(e){return Vr(e,Ri(e))}function C_(e,t,n,r,i,s,a){var o=El(e,n),l=El(t,n),c=a.get(l);if(c){bl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=ie(l),p=!h&&zr(l),f=!h&&!p&&js(l);u=l,h||p||f?ie(o)?u=o:_l(o)?u=ph(o):p?(d=!1,u=Ih(l,!0)):f?(d=!1,u=Yh(l,!0)):u=[]:Ah(l)||Gr(l)?(u=o,Gr(o)?u=M_(o):(!Ge(o)||tl(o))&&(u=Xh(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),bl(e,n,u)}function hd(e,t,n,r,i){e!==t&&ud(t,function(s,a){if(i||(i=new Je),Ge(s))C_(e,t,a,n,hd,r,i);else{var o=r?r(El(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),bl(e,a,o)}},Ri)}function dd(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var A_="[object Map]",L_="[object Set]",k_=Object.prototype,D_=k_.hasOwnProperty;function tn(e){if(e==null)return!0;if(hr(e)&&(ie(e)||typeof e=="string"||typeof e.splice=="function"||zr(e)||js(e)||Gr(e)))return!e.length;var t=ze(e);if(t==A_||t==L_)return!e.size;if(Fs(e))return!$h(e).length;for(var n in e)if(D_.call(e,n))return!1;return!0}var ht=U1(function(e,t,n){hd(e,t,n)}),R_=1/0,I_=jr&&1/yl(new jr([,-0]))[1]==R_?function(e){return new jr(e)}:x1,N_=200;function pd(e,t,n){var r=-1,i=L1,s=e.length,a=!0,o=[],l=o;if(s>=N_){var c=t?null:I_(e);if(c)return yl(c);a=!1,i=nd,l=new Hi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var P_=il(function(e){var t=dd(e);return _l(t)&&(t=void 0),pd(Xs(e,1,_l,!0),Js(t))});function Vi(e){return e&&e.length?pd(e):[]}function pr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function U_(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Tl(e){let t,n,r;e.length!==2?(t=pr,n=(o,l)=>pr(e(o),l),r=(o,l)=>e(o)-l):(t=e===pr||e===U_?e:B_,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function B_(){return 0}function H_(e){return e===null?NaN:+e}function*V_(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const G_=Tl(pr),Sl=G_.right;Tl(H_).center;function en(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}let fd=class extends Map{constructor(t,n=j_){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(md(this,t))}has(t){return super.has(md(this,t))}set(t,n){return super.set(z_(this,t),n)}delete(t){return super.delete(F_(this,t))}};function md({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function z_({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function F_({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function j_(e){return e!==null&&typeof e=="object"?e.valueOf():e}const W_=Math.sqrt(50),q_=Math.sqrt(10),Y_=Math.sqrt(2);function ta(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=W_?10:s>=q_?5:s>=Y_?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?ta(e,t,n*2):[o,l,c]}function ea(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?ta(t,e,n):ta(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function Wr(e,t,n){return t=+t,e=+e,n=+n,ta(e,t,n)[2]}function Ol(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Wr(t,e,n):Wr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function fr(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Xn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var X_={value:()=>{}};function wl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new na(n)}function na(e){this._=e}function Z_(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}na.prototype=wl.prototype={constructor:na,on:function(e,t){var n=this._,r=Z_(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=K_(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=gd(n[i],e.name,t);else if(t==null)for(i in n)n[i]=gd(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new na(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function K_(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function gd(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=X_,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var $l="http://www.w3.org/1999/xhtml";const vd={svg:"http://www.w3.org/2000/svg",xhtml:$l,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ra(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),vd.hasOwnProperty(t)?{space:vd[t],local:e}:e}function Q_(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$l&&t.documentElement.namespaceURI===$l?t.createElement(e):t.createElementNS(n,e)}}function J_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yd(e){var t=ra(e);return(t.local?J_:Q_)(t)}function tE(){}function Ml(e){return e==null?tE:function(){return this.querySelector(e)}}function eE(e){typeof e!="function"&&(e=Ml(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new Le(r,this._parents)}function nE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function rE(){return[]}function xd(e){return e==null?rE:function(){return this.querySelectorAll(e)}}function iE(e){return function(){return nE(e.apply(this,arguments))}}function sE(e){typeof e=="function"?e=iE(e):e=xd(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new Le(r,i)}function bd(e){return function(){return this.matches(e)}}function _d(e){return function(t){return t.matches(e)}}var aE=Array.prototype.find;function oE(e){return function(){return aE.call(this.children,e)}}function lE(){return this.firstElementChild}function cE(e){return this.select(e==null?lE:oE(typeof e=="function"?e:_d(e)))}var uE=Array.prototype.filter;function hE(){return Array.from(this.children)}function dE(e){return function(){return uE.call(this.children,e)}}function pE(e){return this.selectAll(e==null?hE:dE(typeof e=="function"?e:_d(e)))}function fE(e){typeof e!="function"&&(e=bd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Le(r,this._parents)}function Ed(e){return new Array(e.length)}function mE(){return new Le(this._enter||this._groups.map(Ed),this._parents)}function ia(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ia.prototype={constructor:ia,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function gE(e){return function(){return e}}function vE(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new ia(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function yE(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),p;for(o=0;o<u;++o)(l=t[o])&&(h[o]=p=a.call(l,l.__data__,o,t)+"",c.has(p)?i[o]=l:c.set(p,l));for(o=0;o<d;++o)p=a.call(e,s[o],o,s)+"",(l=c.get(p))?(r[o]=l,l.__data__=s[o],c.delete(p)):n[o]=new ia(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function xE(e){return e.__data__}function bE(e,t){if(!arguments.length)return Array.from(this,xE);var n=t?yE:vE,r=this._parents,i=this._groups;typeof e!="function"&&(e=gE(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,p=_E(e.call(u,u&&u.__data__,c,r)),f=p.length,g=o[c]=new Array(f),m=a[c]=new Array(f),v=l[c]=new Array(h);n(u,d,g,m,v,p,t);for(var x=0,_=0,E,b;x<f;++x)if(E=g[x]){for(x>=_&&(_=x+1);!(b=m[_])&&++_<f;);E._next=b||null}}return a=new Le(a,r),a._enter=o,a._exit=l,a}function _E(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function EE(){return new Le(this._exit||this._groups.map(Ed),this._parents)}function TE(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function SE(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),p,f=0;f<d;++f)(p=c[f]||u[f])&&(h[f]=p);for(;l<i;++l)o[l]=n[l];return new Le(o,this._parents)}function OE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function wE(e){e||(e=$E);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new Le(i,this._parents).order()}function $E(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ME(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function CE(){return Array.from(this)}function AE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function LE(){let e=0;for(const t of this)++e;return e}function kE(){return!this.node()}function DE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function RE(e){return function(){this.removeAttribute(e)}}function IE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function NE(e,t){return function(){this.setAttribute(e,t)}}function PE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function UE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function BE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function HE(e,t){var n=ra(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?IE:RE:typeof t=="function"?n.local?BE:UE:n.local?PE:NE)(n,t))}function Td(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function VE(e){return function(){this.style.removeProperty(e)}}function GE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function zE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function FE(e,t,n){return arguments.length>1?this.each((t==null?VE:typeof t=="function"?zE:GE)(e,t,n??"")):qr(this.node(),e)}function qr(e,t){return e.style.getPropertyValue(t)||Td(e).getComputedStyle(e,null).getPropertyValue(t)}function jE(e){return function(){delete this[e]}}function WE(e,t){return function(){this[e]=t}}function qE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function YE(e,t){return arguments.length>1?this.each((t==null?jE:typeof t=="function"?qE:WE)(e,t)):this.node()[e]}function Sd(e){return e.trim().split(/^|\s+/)}function Cl(e){return e.classList||new Od(e)}function Od(e){this._node=e,this._names=Sd(e.getAttribute("class")||"")}Od.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wd(e,t){for(var n=Cl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function $d(e,t){for(var n=Cl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function XE(e){return function(){wd(this,e)}}function ZE(e){return function(){$d(this,e)}}function KE(e,t){return function(){(t.apply(this,arguments)?wd:$d)(this,e)}}function QE(e,t){var n=Sd(e+"");if(arguments.length<2){for(var r=Cl(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?KE:t?XE:ZE)(n,t))}function JE(){this.textContent=""}function tT(e){return function(){this.textContent=e}}function eT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function nT(e){return arguments.length?this.each(e==null?JE:(typeof e=="function"?eT:tT)(e)):this.node().textContent}function rT(){this.innerHTML=""}function iT(e){return function(){this.innerHTML=e}}function sT(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function aT(e){return arguments.length?this.each(e==null?rT:(typeof e=="function"?sT:iT)(e)):this.node().innerHTML}function oT(){this.nextSibling&&this.parentNode.appendChild(this)}function lT(){return this.each(oT)}function cT(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function uT(){return this.each(cT)}function hT(e){var t=typeof e=="function"?e:yd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dT(){return null}function pT(e,t){var n=typeof e=="function"?e:yd(e),r=t==null?dT:typeof t=="function"?t:Ml(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function fT(){var e=this.parentNode;e&&e.removeChild(this)}function mT(){return this.each(fT)}function gT(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vT(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yT(e){return this.select(e?vT:gT)}function xT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function bT(e){return function(t){e.call(this,t,this.__data__)}}function _T(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ET(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function TT(e,t,n){return function(){var r=this.__on,i,s=bT(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function ST(e,t,n){var r=_T(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?TT:ET,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function Md(e,t,n){var r=Td(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function OT(e,t){return function(){return Md(this,e,t)}}function wT(e,t){return function(){return Md(this,e,t.apply(this,arguments))}}function $T(e,t){return this.each((typeof t=="function"?wT:OT)(e,t))}function*MT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var Cd=[null];function Le(e,t){this._groups=e,this._parents=t}function Gi(){return new Le([[document.documentElement]],Cd)}function CT(){return this}Le.prototype=Gi.prototype={constructor:Le,select:eE,selectAll:sE,selectChild:cE,selectChildren:pE,filter:fE,data:bE,enter:mE,exit:EE,join:TE,merge:SE,selection:CT,order:OE,sort:wE,call:ME,nodes:CE,node:AE,size:LE,empty:kE,each:DE,attr:HE,style:FE,property:YE,classed:QE,text:nT,html:aT,raise:lT,lower:uT,append:hT,insert:pT,remove:mT,clone:yT,datum:xT,on:ST,dispatch:$T,[Symbol.iterator]:MT};function AT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function mr(e,t){if(e=AT(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function Al(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ad(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zi(){}var Fi=.7,sa=1/Fi,Yr="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",LT=/^#([0-9a-f]{3,8})$/,kT=new RegExp(`^rgb\\(${Yr},${Yr},${Yr}\\)$`),DT=new RegExp(`^rgb\\(${fn},${fn},${fn}\\)$`),RT=new RegExp(`^rgba\\(${Yr},${Yr},${Yr},${ji}\\)$`),IT=new RegExp(`^rgba\\(${fn},${fn},${fn},${ji}\\)$`),NT=new RegExp(`^hsl\\(${ji},${fn},${fn}\\)$`),PT=new RegExp(`^hsla\\(${ji},${fn},${fn},${ji}\\)$`),Ld={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Al(zi,Mn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kd,formatHex:kd,formatHex8:UT,formatHsl:BT,formatRgb:Dd,toString:Dd});function kd(){return this.rgb().formatHex()}function UT(){return this.rgb().formatHex8()}function BT(){return Ud(this).formatHsl()}function Dd(){return this.rgb().formatRgb()}function Mn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=LT.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Rd(t):n===3?new Te(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?aa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?aa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=kT.exec(e))?new Te(t[1],t[2],t[3],1):(t=DT.exec(e))?new Te(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=RT.exec(e))?aa(t[1],t[2],t[3],t[4]):(t=IT.exec(e))?aa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=NT.exec(e))?Pd(t[1],t[2]/100,t[3]/100,1):(t=PT.exec(e))?Pd(t[1],t[2]/100,t[3]/100,t[4]):Ld.hasOwnProperty(e)?Rd(Ld[e]):e==="transparent"?new Te(NaN,NaN,NaN,0):null}function Rd(e){return new Te(e>>16&255,e>>8&255,e&255,1)}function aa(e,t,n,r){return r<=0&&(e=t=n=NaN),new Te(e,t,n,r)}function HT(e){return e instanceof zi||(e=Mn(e)),e?(e=e.rgb(),new Te(e.r,e.g,e.b,e.opacity)):new Te}function Ll(e,t,n,r){return arguments.length===1?HT(e):new Te(e,t,n,r??1)}function Te(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Al(Te,Ll,Ad(zi,{brighter(e){return e=e==null?sa:Math.pow(sa,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fi:Math.pow(Fi,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Te(gr(this.r),gr(this.g),gr(this.b),oa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Id,formatHex:Id,formatHex8:VT,formatRgb:Nd,toString:Nd}));function Id(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}`}function VT(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}${vr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Nd(){const e=oa(this.opacity);return`${e===1?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${e===1?")":`, ${e})`}`}function oa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vr(e){return e=gr(e),(e<16?"0":"")+e.toString(16)}function Pd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new nn(e,t,n,r)}function Ud(e){if(e instanceof nn)return new nn(e.h,e.s,e.l,e.opacity);if(e instanceof zi||(e=Mn(e)),!e)return new nn;if(e instanceof nn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new nn(a,o,l,e.opacity)}function Bd(e,t,n,r){return arguments.length===1?Ud(e):new nn(e,t,n,r??1)}function nn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Al(nn,Bd,Ad(zi,{brighter(e){return e=e==null?sa:Math.pow(sa,e),new nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fi:Math.pow(Fi,e),new nn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Te(kl(e>=240?e-240:e+120,i,r),kl(e,i,r),kl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new nn(Hd(this.h),la(this.s),la(this.l),oa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=oa(this.opacity);return`${e===1?"hsl(":"hsla("}${Hd(this.h)}, ${la(this.s)*100}%, ${la(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Hd(e){return e=(e||0)%360,e<0?e+360:e}function la(e){return Math.max(0,Math.min(1,e||0))}function kl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Dl=e=>()=>e;function GT(e,t){return function(n){return e+n*t}}function zT(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function FT(e){return(e=+e)==1?Vd:function(t,n){return n-t?zT(t,n,e):Dl(isNaN(t)?n:t)}}function Vd(e,t){var n=t-e;return n?GT(e,n):Dl(isNaN(e)?t:e)}const ca=function e(t){var n=FT(t);function r(i,s){var a=n((i=Ll(i)).r,(s=Ll(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Vd(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function jT(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function WT(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function qT(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=Wi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function YT(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ke(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function XT(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Wi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Rl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Il=new RegExp(Rl.source,"g");function ZT(e){return function(){return e}}function KT(e){return function(t){return e(t)+""}}function Gd(e,t){var n=Rl.lastIndex=Il.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Rl.exec(e))&&(i=Il.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:ke(r,i)})),n=Il.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?KT(l[0].x):ZT(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Wi(e,t){var n=typeof t,r;return t==null||n==="boolean"?Dl(t):(n==="number"?ke:n==="string"?(r=Mn(t))?(t=r,ca):Gd:t instanceof Mn?ca:t instanceof Date?YT:WT(t)?jT:Array.isArray(t)?qT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?XT:ke)(e,t)}function zd(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Fd=180/Math.PI,jd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Wd(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Fd,skewX:Math.atan(l)*Fd,scaleX:a,scaleY:o}}var ua;function QT(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jd:Wd(t.a,t.b,t.c,t.d,t.e,t.f)}function JT(e){return e==null||(ua||(ua=document.createElementNS("http://www.w3.org/2000/svg","g")),ua.setAttribute("transform",e),!(e=ua.transform.baseVal.consolidate()))?jd:(e=e.matrix,Wd(e.a,e.b,e.c,e.d,e.e,e.f))}function qd(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push("translate(",null,t,null,n);f.push({i:g-4,x:ke(c,d)},{i:g-2,x:ke(u,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:ke(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:ke(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push(i(p)+"scale(",null,",",null,")");f.push({i:g-4,x:ke(c,d)},{i:g-2,x:ke(u,h)})}else(d!==1||h!==1)&&p.push(i(p)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(p){for(var f=-1,g=h.length,m;++f<g;)d[(m=h[f]).i]=m.x(p);return d.join("")}}}var tS=qd(QT,"px, ","px)","deg)"),eS=qd(JT,", ",")",")"),Xr=0,qi=0,Yi=0,Yd=1e3,ha,Xi,da=0,yr=0,pa=0,Zi=typeof performance=="object"&&performance.now?performance:Date,Xd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nl(){return yr||(Xd(nS),yr=Zi.now()+pa)}function nS(){yr=0}function fa(){this._call=this._time=this._next=null}fa.prototype=Zd.prototype={constructor:fa,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Nl():+n)+(t==null?0:+t),!this._next&&Xi!==this&&(Xi?Xi._next=this:ha=this,Xi=this),this._call=e,this._time=n,Pl()},stop:function(){this._call&&(this._call=null,this._time=1/0,Pl())}};function Zd(e,t,n){var r=new fa;return r.restart(e,t,n),r}function rS(){Nl(),++Xr;for(var e=ha,t;e;)(t=yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Xr}function Kd(){yr=(da=Zi.now())+pa,Xr=qi=0;try{rS()}finally{Xr=0,sS(),yr=0}}function iS(){var e=Zi.now(),t=e-da;t>Yd&&(pa-=t,da=e)}function sS(){for(var e,t=ha,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ha=n);Xi=e,Pl(r)}function Pl(e){if(!Xr){qi&&(qi=clearTimeout(qi));var t=e-yr;t>24?(e<1/0&&(qi=setTimeout(Kd,e-Zi.now()-pa)),Yi&&(Yi=clearInterval(Yi))):(Yi||(da=Zi.now(),Yi=setInterval(iS,Yd)),Xr=1,Xd(Kd))}}function Qd(e,t,n){var r=new fa;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var aS=wl("start","end","cancel","interrupt"),oS=[],Jd=0,tp=1,Ul=2,ma=3,ep=4,Bl=5,ga=6;function va(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;lS(e,n,{name:t,index:r,group:i,on:aS,tween:oS,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Jd})}function Hl(e,t){var n=rn(e,t);if(n.state>Jd)throw new Error("too late; already scheduled");return n}function mn(e,t){var n=rn(e,t);if(n.state>ma)throw new Error("too late; already running");return n}function rn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function lS(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Zd(s,0,n.time);function s(c){n.state=tp,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,p;if(n.state!==tp)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===ma)return Qd(a);p.state===ep?(p.state=ga,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=ga,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Qd(function(){n.state===ma&&(n.state=ep,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Ul,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ul){for(n.state=ma,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Bl,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Bl&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ga,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Vl(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Ul&&r.state<Bl,r.state=ga,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function cS(e){return this.each(function(){Vl(this,e)})}function uS(e,t){var n,r;return function(){var i=mn(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function hS(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=mn(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function dS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=rn(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?uS:hS)(n,e,t))}function Gl(e,t,n){var r=e._id;return e.each(function(){var i=mn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return rn(i,r).value[t]}}function np(e,t){var n;return(typeof t=="number"?ke:t instanceof Mn?ca:(n=Mn(t))?(t=n,ca):Gd)(e,t)}function pS(e){return function(){this.removeAttribute(e)}}function fS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mS(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function gS(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function vS(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function yS(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function xS(e,t){var n=ra(e),r=n==="transform"?eS:np;return this.attrTween(e,typeof t=="function"?(n.local?yS:vS)(n,r,Gl(this,"attr."+e,t)):t==null?(n.local?fS:pS)(n):(n.local?gS:mS)(n,r,t))}function bS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _S(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ES(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&_S(e,s)),n}return i._value=t,i}function TS(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&bS(e,s)),n}return i._value=t,i}function SS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ra(e);return this.tween(n,(r.local?ES:TS)(r,t))}function OS(e,t){return function(){Hl(this,e).delay=+t.apply(this,arguments)}}function wS(e,t){return t=+t,function(){Hl(this,e).delay=t}}function $S(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OS:wS)(t,e)):rn(this.node(),t).delay}function MS(e,t){return function(){mn(this,e).duration=+t.apply(this,arguments)}}function CS(e,t){return t=+t,function(){mn(this,e).duration=t}}function AS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?MS:CS)(t,e)):rn(this.node(),t).duration}function LS(e,t){if(typeof t!="function")throw new Error;return function(){mn(this,e).ease=t}}function kS(e){var t=this._id;return arguments.length?this.each(LS(t,e)):rn(this.node(),t).ease}function DS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;mn(this,e).ease=n}}function RS(e){if(typeof e!="function")throw new Error;return this.each(DS(this._id,e))}function IS(e){typeof e!="function"&&(e=bd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Cn(r,this._parents,this._name,this._id)}function NS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,p=0;p<u;++p)(h=l[p]||c[p])&&(d[p]=h);for(;o<r;++o)a[o]=t[o];return new Cn(a,this._parents,this._name,this._id)}function PS(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function US(e,t,n){var r,i,s=PS(t)?Hl:mn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function BS(e,t){var n=this._id;return arguments.length<2?rn(this.node(),n).on.on(e):this.each(US(n,e,t))}function HS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function VS(){return this.on("end.remove",HS(this._id))}function GS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ml(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,va(c[h],t,n,h,c,rn(u,n)));return new Cn(s,this._parents,t,n)}function zS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xd(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),p,f=rn(u,n),g=0,m=h.length;g<m;++g)(p=h[g])&&va(p,t,n,g,h,f);s.push(h),a.push(u)}return new Cn(s,a,t,n)}var FS=Gi.prototype.constructor;function jS(){return new FS(this._groups,this._parents)}function WS(e,t){var n,r,i;return function(){var s=qr(this,e),a=(this.style.removeProperty(e),qr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function rp(e){return function(){this.style.removeProperty(e)}}function qS(e,t,n){var r,i=n+"",s;return function(){var a=qr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function YS(e,t,n){var r,i,s;return function(){var a=qr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),qr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function XS(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=mn(this,e),c=l.on,u=l.value[s]==null?o||(o=rp(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function ZS(e,t,n){var r=(e+="")=="transform"?tS:np;return t==null?this.styleTween(e,WS(e,r)).on("end.style."+e,rp(e)):typeof t=="function"?this.styleTween(e,YS(e,r,Gl(this,"style."+e,t))).each(XS(this._id,e)):this.styleTween(e,qS(e,r,t),n).on("end.style."+e,null)}function KS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function QS(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&KS(e,a,n)),r}return s._value=t,s}function JS(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,QS(e,t,n??""))}function tO(e){return function(){this.textContent=e}}function eO(e){return function(){var t=e(this);this.textContent=t??""}}function nO(e){return this.tween("text",typeof e=="function"?eO(Gl(this,"text",e)):tO(e==null?"":e+""))}function rO(e){return function(t){this.textContent=e.call(this,t)}}function iO(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&rO(i)),t}return r._value=e,r}function sO(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,iO(e))}function aO(){for(var e=this._name,t=this._id,n=ip(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=rn(l,t);va(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Cn(r,this._parents,e,n)}function oO(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=mn(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var lO=0;function Cn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ip(){return++lO}var An=Gi.prototype;Cn.prototype={constructor:Cn,select:GS,selectAll:zS,selectChild:An.selectChild,selectChildren:An.selectChildren,filter:IS,merge:NS,selection:jS,transition:aO,call:An.call,nodes:An.nodes,node:An.node,size:An.size,empty:An.empty,each:An.each,on:BS,attr:xS,attrTween:SS,style:ZS,styleTween:JS,text:nO,textTween:sO,remove:VS,tween:dS,delay:$S,duration:AS,ease:kS,easeVarying:RS,end:oO,[Symbol.iterator]:An[Symbol.iterator]};function sp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var cO={time:null,delay:0,duration:250,ease:sp};function uO(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function hO(e){var t,n;e instanceof Cn?(t=e._id,e=e._name):(t=ip(),(n=cO).time=Nl(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&va(l,e,t,c,a,n||uO(l,t));return new Cn(r,this._parents,e,t)}Gi.prototype.interrupt=cS,Gi.prototype.transition=hO;function dO(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ya(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Zr(e){return e=ya(Math.abs(e)),e?e[1]:NaN}function pO(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function fO(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var mO=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ki(e){if(!(t=mO.exec(e)))throw new Error("invalid format: "+e);var t;return new zl({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ki.prototype=zl.prototype;function zl(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}zl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function gO(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var ap;function vO(e,t){var n=ya(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(ap=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+ya(e,Math.max(0,t+s-1))[0]}function op(e,t){var n=ya(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const lp={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:dO,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>op(e*100,t),r:op,s:vO,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cp(e){return e}var up=Array.prototype.map,hp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yO(e){var t=e.grouping===void 0||e.thousands===void 0?cp:pO(up.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?cp:fO(up.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Ki(d);var h=d.fill,p=d.align,f=d.sign,g=d.symbol,m=d.zero,v=d.width,x=d.comma,_=d.precision,E=d.trim,b=d.type;b==="n"?(x=!0,b="g"):lp[b]||(_===void 0&&(_=12),E=!0,b="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var S=g==="$"?n:g==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",M=g==="$"?r:/[%p]/.test(b)?a:"",R=lp[b],C=/[defgprs%]/.test(b);_=_===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function I(w){var V=S,U=M,H,T,$;if(b==="c")U=R(w)+U,w="";else{w=+w;var A=w<0||1/w<0;if(w=isNaN(w)?l:R(Math.abs(w),_),E&&(w=gO(w)),A&&+w==0&&f!=="+"&&(A=!1),V=(A?f==="("?f:o:f==="-"||f==="("?"":f)+V,U=(b==="s"?hp[8+ap/3]:"")+U+(A&&f==="("?")":""),C){for(H=-1,T=w.length;++H<T;)if($=w.charCodeAt(H),48>$||$>57){U=($===46?i+w.slice(H+1):w.slice(H))+U,w=w.slice(0,H);break}}}x&&!m&&(w=t(w,1/0));var D=V.length+w.length+U.length,B=D<v?new Array(v-D+1).join(h):"";switch(x&&m&&(w=t(B+w,B.length?v-U.length:1/0),B=""),p){case"<":w=V+w+U+B;break;case"=":w=V+B+w+U;break;case"^":w=B.slice(0,D=B.length>>1)+V+w+U+B.slice(D);break;default:w=B+V+w+U;break}return s(w)}return I.toString=function(){return d+""},I}function u(d,h){var p=c((d=Ki(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Zr(h)/3)))*3,g=Math.pow(10,-f),m=hp[8+f/3];return function(v){return p(g*v)+m}}return{format:c,formatPrefix:u}}var xa,Fl,dp;xO({thousands:",",grouping:[3],currency:["$",""]});function xO(e){return xa=yO(e),Fl=xa.format,dp=xa.formatPrefix,xa}function bO(e){return Math.max(0,-Zr(Math.abs(e)))}function _O(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zr(t)/3)))*3-Zr(Math.abs(e)))}function EO(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Zr(t)-Zr(e))+1}function Kr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const pp=Symbol("implicit");function ba(){var e=new fd,t=[],n=[],r=pp;function i(s){let a=e.get(s);if(a===void 0){if(r!==pp)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new fd;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return ba(t,n).unknown(r)},Kr.apply(i,arguments),i}function TO(e){return function(){return e}}function SO(e){return+e}var fp=[0,1];function Qr(e){return e}function jl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:TO(isNaN(t)?NaN:.5)}function OO(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function wO(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=jl(i,r),s=n(a,s)):(r=jl(r,i),s=n(s,a)),function(o){return s(r(o))}}function $O(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=jl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Sl(e,o,1,r)-1;return s[l](i[l](o))}}function Wl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function mp(){var e=fp,t=fp,n=Wi,r,i,s,a=Qr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Qr&&(a=OO(e[0],e[h-1])),o=h>2?$O:wO,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),ke)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,SO),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=zd,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Qr,u()):a!==Qr},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,p){return r=h,i=p,u()}}function gp(){return mp()(Qr,Qr)}function MO(e,t,n,r){var i=Ol(e,t,n),s;switch(r=Ki(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=_O(i,a))&&(r.precision=s),dp(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=EO(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=bO(i))&&(r.precision=s-(r.type==="%")*2);break}}return Fl(r)}function vp(e){var t=e.domain;return e.ticks=function(n){var r=t();return ea(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return MO(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=Wr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function sn(){var e=gp();return e.copy=function(){return Wl(e,sn())},Kr.apply(e,arguments),vp(e)}function ql(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[Sl(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return ql().domain([e,t]).range(i).unknown(s)},Kr.apply(vp(a),arguments)}function Qi(e,t,n){this.k=e,this.x=t,this.y=n}Qi.prototype={constructor:Qi,scale:function(e){return e===1?this:new Qi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Qi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Qi.prototype;const Se="cds",Ln={opacity:{unselected:.05,selected:.4}},Zn={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Jr={duration:1e3,ease:sp,zoomLevel:3},ti={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},yp={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Fe={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},CO={defaultBins:10},zt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},kn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},se={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Pt={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},xr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},an={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},xp={minCellDividerDimension:16},bp={default:{size:24}},_p={defaultOffset:4,horizontalOffset:10},Ep={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},De={height:{[Ke.GRAPH_VIEW]:32,[Ke.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},AO=[{type:Qt.RADIUS,name:"Radius"},{type:Qt.AREA,name:"Poor area"},{type:Qt.AREA,name:"Satisfactory area"},{type:Qt.AREA,name:"Great area"},{type:Qt.QUARTILE,name:"Quartiles"}],ei={type:Be.END_LINE,threshold:16,numCharacter:14},LO={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},kO={enabled:!0,position:Ur.BOTTOM,clickable:!0,truncation:ei,alignment:Zt.LEFT,order:null,additionalItems:[]},DO={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},RO={enabled:!0},Tp={enabled:!0,showTotal:!0,truncation:ei,groupLabel:"Group"},Sp={top:{visible:!0,includeZero:!0,truncation:ei},bottom:{visible:!0,includeZero:!0,truncation:ei},left:{visible:!0,includeZero:!0,truncation:ei},right:{visible:!0,includeZero:!0,truncation:ei}},_a={addSpaceOnEdges:1,showDayName:!1,localeObject:ih,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let Op=!1;try{Op=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const oe={width:null,height:null,resizable:!0,theme:Zo.WHITE,tooltip:Tp,legend:kO,locale:LO,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:Ot.SHOW_AS_DATATABLE},...Op?[{type:Ot.MAKE_FULLSCREEN}]:[],{type:Ot.EXPORT_CSV},{type:Ot.EXPORT_PNG},{type:Ot.EXPORT_JPG}]}},wp=ht({},oe,{thematic:{projection:dn.geoNaturalEarth1}}),Ji=ht({},oe,{axes:Sp,timeScale:_a,grid:DO,ruler:RO,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ke.GRAPH_VIEW}}}),br=ht({},Ji,{bars:{maxWidth:16,spacingFactor:.25},timeScale:ht(_a,{addSpaceOnEdges:1})}),IO=ht({},br,{}),NO=ht({},br,{}),PO=ht({},br,{bars:ht({},br.bars,{dividerSize:1.5})}),UO=ht({},br,{}),Yl=ht({},Ji,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),BO=Yl,$p=ht({},Yl,{points:{radius:3,filled:!1,enabled:!0}}),Mp=ht({},$p,{timeScale:ht(_a,{addSpaceOnEdges:0})}),HO=Mp,VO=ht({},Ji,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:Qt.RADIUS,name:"Radius"}]}}),GO=ht({},Ji,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Qt.AREA,name:"Poor area"},{type:Qt.AREA,name:"Satisfactory area"},{type:Qt.AREA,name:"Great area"},{type:Qt.QUARTILE,name:"Quartiles"}]}}),zO=ht({},br,{bars:{dividerSize:1.5},timeScale:ht(_a,{addSpaceOnEdges:0})}),FO=ht({},oe,{tooltip:ht({},Tp,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),Cp=ht({},oe,{pie:{labels:{formatter:null,enabled:!0},alignment:Zt.LEFT,sortFunction:null,valueMapsTo:"value"}}),jO=ht({},oe,{legend:{enabled:!1},gauge:{type:ar.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:Zt.LEFT}}),WO=ht({},Cp,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:Zt.LEFT}}),Ap=ht({},oe,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),qO=ht({},Ap,{legend:{enabled:!0}}),YO=ht({},oe,{radar:{axes:{angle:"key",value:"value"},alignment:Zt.LEFT},tooltip:{gridline:{enabled:!0}}}),XO=ht({},br,{comboChartTypes:[]}),ZO=ht({tree:{type:Ps.TREE}},oe,{}),KO=ht({},oe,{data:ht(oe.data,{groupMapsTo:"name"})}),QO=ht({},oe,ti,{data:ht(oe.data,{groupMapsTo:"name"})}),JO=ht({},oe,{alluvial:{data:ht(oe.data,{groupMapsTo:"source"}),nodeAlignment:Zt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),tw=ht({},oe,{axes:Sp,heatmap:{divider:{state:Hr.AUTO},colorLegend:{type:"linear"}}}),ew=ht({},wp,{choropleth:{colorLegend:{type:"linear"}}}),It={alluvialChart:JO,areaChart:Mp,axisChart:Ji,boxplotChart:UO,bubbleChart:VO,bulletChart:GO,chart:oe,circlePackChart:QO,choroplethChart:ew,comboChart:XO,donutChart:WO,gaugeChart:jO,groupedBarChart:NO,heatmapChart:tw,histogramChart:zO,lineChart:$p,lollipopChart:BO,meterChart:Ap,pieChart:Cp,proportionalMeterChart:qO,radarChart:YO,scatterChart:Yl,simpleBarChart:IO,stackedAreaChart:HO,stackedBarChart:PO,thematicChart:wp,treeChart:ZO,treemapChart:KO,wordCloudChart:FO};function nw(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=mr(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Ht(e,t){var n;const r=$n(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===at.TIME?a.mapsTo="date":l===at.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return Zl(r,t),ht(r,t)}function Dn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function ts(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function Xl(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function es(e,t,n){if(n>e.length)return e;if(t===Be.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Be.FRONT_LINE)return"..."+e.substr(-n);if(t===Be.END_LINE)return e.substr(0,n)+"..."}function Zl(e,t){const n=y(e,"legend","additionalItems"),r=y(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=AO.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=P_(a,r,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},Lp=(e,t)=>t===Xt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,me=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Lp(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Rn(e,t,n){return n===Xt.VERTICAL?[e,t]:[t,e]}function kp(e){const t=jt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Dp(e,t){const n=jt(e,void 0);return n.setHours(0,0,0,0),n}function Rp(e,t,n){const[r,i]=or(void 0,e,t),s=Dp(r),a=Dp(i),o=+s-kp(s),l=+a-kp(a);return Math.round((o-l)/f0)}function rw(e,t){const n=jt(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function iw(e,t){const n=jt(e,void 0);return Rp(n,rw(n))+1}function Ea(e,t){return Ci(e,{...t,weekStartsOn:1})}function Ip(e,t){const n=jt(e,void 0),r=n.getFullYear(),i=He(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Ea(i),a=He(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=Ea(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function sw(e,t){const n=Ip(e),r=He(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ea(r)}function aw(e,t){const n=jt(e,void 0),r=+Ea(n)-+sw(n);return Math.round(r/th)+1}function Np(e,t){var n,r,i,s;const a=jt(e,t==null?void 0:t.in),o=a.getFullYear(),l=Hs(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(i=l.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,u=He((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=Ci(u,t),h=He((t==null?void 0:t.in)||e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=Ci(h,t);return+a>=+d?o+1:+a>=+p?o:o-1}function ow(e,t){var n,r,i,s;const a=Hs(),o=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,l=Np(e,t),c=He((t==null?void 0:t.in)||e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),Ci(c,t)}function lw(e,t){const n=jt(e,t==null?void 0:t.in),r=+Ci(n,t)-+ow(n,t);return Math.round(r/th)+1}function Mt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Kn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Mt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Mt(n+1,2)},d(e,t){return Mt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Mt(e.getHours()%12||12,t.length)},H(e,t){return Mt(e.getHours(),t.length)},m(e,t){return Mt(e.getMinutes(),t.length)},s(e,t){return Mt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Mt(i,t.length)}},ni={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Pp={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Kn.y(e,t)},Y:function(e,t,n,r){const i=Np(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Mt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Mt(s,t.length)},R:function(e,t){const n=Ip(e);return Mt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Mt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Mt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Mt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Kn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Mt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=lw(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Mt(i,t.length)},I:function(e,t,n){const r=aw(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Mt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Kn.d(e,t)},D:function(e,t,n){const r=iw(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Mt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Mt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Mt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Mt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=ni.noon:r===0?i=ni.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=ni.evening:r>=12?i=ni.afternoon:r>=4?i=ni.morning:i=ni.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Kn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Kn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Mt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Mt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Kn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Kn.s(e,t)},S:function(e,t){return Kn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Bp(r);case"XXXX":case"XX":return _r(r);case"XXXXX":case"XXX":default:return _r(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Bp(r);case"xxxx":case"xx":return _r(r);case"xxxxx":case"xxx":default:return _r(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Up(r,":");case"OOOO":default:return"GMT"+_r(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Up(r,":");case"zzzz":default:return"GMT"+_r(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Mt(r,t.length)},T:function(e,t,n){return Mt(+e,t.length)}};function Up(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Mt(s,2)}function Bp(e,t){return e%60===0?(e>0?"-":"+")+Mt(Math.abs(e)/60,2):_r(e,t)}function _r(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Mt(Math.trunc(r/60),2),s=Mt(r%60,2);return n+i+t+s}const Hp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Vp=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},cw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Hp(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Hp(r,t)).replace("{{time}}",Vp(i,t))},uw={p:Vp,P:cw},hw=/^D+$/,dw=/^Y+$/,pw=["D","DD","YY","YYYY"];function fw(e){return hw.test(e)}function mw(e){return dw.test(e)}function gw(e,t,n){const r=vw(e,t,n);if(console.warn(r),pw.includes(e))throw new RangeError(r)}function vw(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function yw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function xw(e){return!(!yw(e)&&typeof e!="number"||isNaN(+jt(e)))}const bw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_w=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ew=/^'([^]*?)'?$/,Tw=/''/g,Sw=/[a-zA-Z]/;function Kl(e,t,n){var r,i,s,a,o,l,c,u;const d=Hs(),h=(n==null?void 0:n.locale)??d.locale??ih,p=(n==null?void 0:n.firstWeekContainsDate)??((i=(r=n==null?void 0:n.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(s=d.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,f=(n==null?void 0:n.weekStartsOn)??((l=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,g=jt(e,n==null?void 0:n.in);if(!xw(g))throw new RangeError("Invalid time value");let m=t.match(_w).map(x=>{const _=x[0];if(_==="p"||_==="P"){const E=uw[_];return E(x,h.formatLong)}return x}).join("").match(bw).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const _=x[0];if(_==="'")return{isToken:!1,value:Ow(x)};if(Pp[_])return{isToken:!0,value:x};if(_.match(Sw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:x}});h.localize.preprocessor&&(m=h.localize.preprocessor(g,m));const v={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(x=>{if(!x.isToken)return x.value;const _=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&mw(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&fw(_))&&gw(_,t,String(e));const E=Pp[_[0]];return E(g,_,h.localize,v)}).join("")}function Ow(e){const t=e.match(Ew);return t?t[1].replace(Tw,"'"):e}const Ql=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Gp(e,t,n,r,i){const s=t===0,a=Number(Kl(new Date(e),"c"))===2,o=Number(Kl(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Sa(e)||ns(e,l)||Qn(e);case"minute":return s||Sa(e)||ns(e,l)||Qn(e);case"30minutes":return s||Sa(e)||ns(e,l)||Qn(e);case"hourly":return s||Sa(e)||ns(e,l)||Qn(e);case"daily":return i?s||a||Qn(e):s||ns(e,l)||Qn(e);case"weekly":return s||a||Qn(e);case"monthly":return s||Qn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function Jl(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=y(i,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=Gp(e,t,n,r,a);let p=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(p=p.replace("pp","h:mm:ss.SSS a"));const f=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,x=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!x){const _=Kl(l,p,{locale:f}).split("").map(E=>{const b=Number(E);return E!==" "&&!Number.isNaN(b)?b.toLocaleString(g):E});return s[v](l,g,{},_.join(""))}else return s[v](l,g,x)}function Ta(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function ww(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function $w(e){const t=Ql.reduce((n,[,r],i)=>{const s=Ql[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return Ql[t][0]}function tc(e,t){if(Ju[t])return t;if(e.length===1)return"15seconds";const n=ww(e),r=Xn(n);return $w(r)}function Sa(e){const{s:t,m:n,H:r}=Ta(e);return r===0&&n===0&&t===0}function ns(e,t){const n=Ta(e).M,r=Ta(t).M;return n!==r}function Qn(e){const{M:t,d:n,s:r,m:i,H:s}=Ta(e);return t===1&&n===1&&s===0&&i===0&&r===0}function zp(e){return e===void 0?"":e.toISOString()}function Fp(e){const t=en(e,r=>r.value),n=sn().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function jp(e,t){const n=y(t,"gradient","colors"),r=!tn(n);let i=y(t,"pairing","option");const s=Fp(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return ql().domain(s).range(o)}var vt=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(vt||{});function Mw(e,t){return e&&ud(e,t,Di)}function Cw(e,t){return function(n,r){if(n==null)return n;if(!hr(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var ec=Cw(Mw);function yt(e){return function(){return e}}var Aw=Array.prototype.slice;function Oa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Lw(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function kw(e,t,n,r){return ec(e,function(i,s,a){t(r,i,n(i),a)}),r}function Dw(e,t){return function(n,r){var i=ie(n)?Lw:kw,s={};return i(n,e,Js(r),s)}}function Rw(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var Iw=Object.prototype,Nw=Iw.hasOwnProperty,Pw=Dw(function(e,t,n){Nw.call(e,n)?e[n].push(t):zs(e,n,[t])});function Uw(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Bw(e){return e}function Hw(e=pr){if(e===pr)return Wp;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Wp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Vw=Array.prototype,Gw=Vw.slice;function nc(e){return()=>e}function zw(e,t,n){let r;for(;;){const i=Wr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function Fw(e){return Math.max(1,Math.ceil(Math.log(Uw(e))/Math.LN2)+1)}function jw(){var e=Bw,t=en,n=Fw;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],p=n(c,d,h);if(!Array.isArray(p)){const _=h,E=+p;if(t===en&&([d,h]=zw(d,h,E)),p=ea(d,h,E),p[0]<=d&&(l=Wr(d,h,E)),p[p.length-1]>=h)if(_>=h&&t===en){const b=Wr(d,h,E);isFinite(b)&&(b>0?h=(Math.floor(h/b)+1)*b:b<0&&(h=(Math.ceil(h*-b)+1)/-b))}else p.pop()}for(var f=p.length,g=0,m=f;p[g]<=d;)++g;for(;p[m-1]>h;)--m;(g||m<f)&&(p=p.slice(g,m),f=m-g);var v=new Array(f+1),x;for(s=0;s<=f;++s)x=v[s]=[],x.x0=s>0?p[s-1]:d,x.x1=s<f?p[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(f,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const _=Math.floor((d-o)*l);v[Math.min(f,_+(p[_]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Sl(p,o,0,f)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:nc(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:nc([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:nc(Array.isArray(i)?Gw.call(i):i),r):n},r}function qp(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Wp:Hw(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*d/l+h)),f=Math.min(r,Math.floor(t+(l-c)*d/l+h));qp(e,t,p,f,i)}const s=e[t];let a=n,o=r;for(rs(e,n,t),i(e[r],s)>0&&rs(e,n,r);a<o;){for(rs(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?rs(e,n,o):(++o,rs(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function rs(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function rc(e,t,n){if(e=Float64Array.from(V_(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Xn(e);if(t>=1)return fr(e);var r,i=(r-1)*t,s=Math.floor(i),a=fr(qp(e,s).subarray(0,s+1)),o=Xn(e.subarray(s+1));return a+(o-a)*(i-s)}}function Yp(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Xp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Ww(e,t){return e[t]}function qw(e){const t=[];return t.key=e,t}function ic(){var e=yt([]),t=Xp,n=Yp,r=Ww;function i(s){var a=Array.from(e.apply(this,arguments),qw),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=Oa(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:yt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:yt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Xp:typeof s=="function"?s:yt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Yp,i):n},i}function Yw(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function Xw(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class gn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=y(r,"locale"),o=y(r,"tabularRepModal","tableHeadingFormatter"),l=y(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===at.TIME&&(d=h=>s(h,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(h=>{d&&(h[1]=d(h[1]));for(const p in h){const f=h[p];typeof f=="number"&&(h[p]=a(f,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===at.LINEAR||c===at.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===at.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=zt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize($n(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=zt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return Pw(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=CO.defaultBins}=s,l=Array.isArray(o),c=jw().value(p=>p[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const p=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+p}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(p=>p[a]))),h=[];return c.forEach(p=>{const f=`${p.x0}-${p.x1}`,g=this.aggregateBinDataByGroup(p);d.forEach(m=>{h.push({group:m,key:f,value:g[m]||0,bin:p.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return ic().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Vi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?zp(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===at.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===at.LOG||o===at.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(p=>p.x0.toString()===c.toString());return a.forEach(p=>{d[p]=h.filter(f=>f[i]===p).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?zp(p[f])===l:p[f].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=Rw(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?ic().offset(Yw):ic()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[s]=a[c],d}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Zl(n,t),this.set({options:ht(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(O.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=zt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(s=>s.map(a=>`"${(a==="&ndash;"?"–":a).split(/[,;'"`]/).map(o=>Xw(o)).join("")}"`)).map(s=>s.join(",")).join(`
2
- `),n=this.getOptions();let r="myChart";const i=y(n,"fileDownload","fileName");typeof i=="function"?r=i("csv"):typeof i=="string"&&(r=i),this.services.files.downloadCSV(t,`${r}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=zt.items.status,s=this.getOptions(),a=Vi(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=y(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=y(t,"option");const i=yp.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=ba().range(o).domain(this.allDataGroups)}}class Er extends gn{constructor(t){super(t),this.axisFlavor=wi.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:y(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=y(this.getOptions(),"locale"),u=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"&ndash;":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"&ndash;":l(h[s.identifier],c),...a?[h[a.identifier]===null?"&ndash;":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),y(this.getOptions(),"zoomBar",F.TOP,"enabled"))){const r=y(this.getOptions(),"zoomBar",F.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize($n(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Vi(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(F).forEach(i=>{const s=F[i],a=n.axes[s];if(a&&a.scaleType===at.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{y(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let Zw=class extends Er{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const i=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}},Kw=class extends Er{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:rc(t,.25),q_50:rc(t,.5),q_75:rc(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(_=>_[o]).sort(pr),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,d=c.quartiles.q_75,h=(d-u)*1.5,p=u-h,f=d+h,g=[],m=[];for(const _ of l)_<p||_>f?g.push(_):m.push(_);c.outliers=g;const v=Xn(m),x=fr(m);c.whiskers={min:v||Xn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:x||fr([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData(),{number:i,code:s}=y(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=y(l,"outliers");return(c===null||c.length===0)&&(c=["&ndash;"]),[l[n],y(l,"whiskers","min")!==null?i(y(l,"whiskers","min"),s):"&ndash;",y(l,"quartiles","q_25")!==null?i(y(l,"quartiles","q_25"),s):"&ndash;",y(l,"quartiles","q_50")!==null?i(y(l,"quartiles","q_50"),s):"&ndash;",y(l,"quartiles","q_75")!==null?i(y(l,"quartiles","q_75"),s):"&ndash;",y(l,"whiskers","max")!==null?i(y(l,"whiskers","max"),s):"&ndash;",y(l,"quartiles","q_75")!==null&&y(l,"quartiles","q_25")!==null?(i(y(l,"quartiles","q_75")-y(l,"quartiles","q_25")),s):"&ndash;",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"option");const r=yp.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=ba().range(i).domain(this.allDataGroups)}},Qw=class extends Er{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{number:s,code:a}=y(n,"locale"),o=y(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"&ndash;":s(u.value,a),y(u,"marker")===null?"&ndash;":s(u.marker,a),y(u,"marker")===null?"&ndash;":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}},Jw=class extends gn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(tn(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!tn(n)&&!tn(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"&ndash;":a.id,a.name,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=y(this.getOptions(),"color");this._colorScale=jp(this.getDisplayData(),t)}},t$=class extends gn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=ht({},t,this.getZoomOptions(t));Zl(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ht(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Qt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}},e$=class extends gn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},n$=class extends gn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}},r$=class extends Er{constructor(t){super(t),this.axisFlavor=wi.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==at.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==at.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==at.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==at.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=en(this.getDisplayData(),r=>r.value),n=sn().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(tn(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(tn(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(tn(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=$n(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize($n(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){tn(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!tn(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=ql().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=jp(this.getDisplayData(),l)}},i$=class extends Er{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[Et(t,"bins.rangeLabel")||"Range",...s.map(l=>Et(l,`0.${n}`))],o=[...Et(s,0).map((l,c)=>[`${r(Number(Et(l,"data.x0")),i)} – ${r(Number(Et(l,"data.x1")),i)}`,...s.map(u=>r(Et(u[c],`data.${Et(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}};class s$ extends gn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}else u=y(s,"total")||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let p;h.value!==null&&h.value!==void 0?p=Number(h.value):p=0;const f=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"&ndash;":a(p,o),a(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}}class a$ extends Er{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}let o$=class extends gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}};class l$ extends gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}let c$=class extends gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}};var u$=/\s/;function h$(e){for(var t=e.length;t--&&u$.test(e.charAt(t)););return t}var d$=/^\s+/;function p$(e){return e&&e.slice(0,h$(e)+1).replace(d$,"")}var Zp=NaN,f$=/^[-+]0x[0-9a-f]+$/i,m$=/^0b[01]+$/i,g$=/^0o[0-7]+$/i,v$=parseInt;function ri(e){if(typeof e=="number")return e;if(Vs(e))return Zp;if(Ge(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ge(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=p$(e);var n=m$.test(e);return n||g$.test(e)?v$(e.slice(2),n?2:8):f$.test(e)?Zp:+e}var sc=function(){return Qe.Date.now()},y$="Expected a function",x$=Math.max,b$=Math.min;function wa(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(y$);t=ri(t)||0,Ge(n)&&(u=!!n.leading,d="maxWait"in n,s=d?x$(ri(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(S){var M=r,R=i;return r=i=void 0,c=S,a=e.apply(R,M),a}function f(S){return c=S,o=setTimeout(v,t),u?p(S):a}function g(S){var M=S-l,R=S-c,C=t-M;return d?b$(C,s-R):C}function m(S){var M=S-l,R=S-c;return l===void 0||M>=t||M<0||d&&R>=s}function v(){var S=sc();if(m(S))return x(S);o=setTimeout(v,g(S))}function x(S){return o=void 0,h&&r?p(S):(r=i=void 0,a)}function _(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function E(){return o===void 0?a:x(sc())}function b(){var S=sc(),M=m(S);if(r=arguments,i=this,l=S,M){if(o===void 0)return f(l);if(d)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),a}return b.cancel=_,b.flush=E,b}function _$(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function N(e){return typeof e=="string"?new Le([[document.querySelector(e)]],[document.documentElement]):new Le([[e]],Cd)}function is(){var e=ba().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,p=i<r,f=p?i:r,g=p?r:i;s=(g-f)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),f+=(g-f-s*(h-l))*u,a=s*(1-l),o&&(f=Math.round(f),a=Math.round(a));var m=_$(h).map(function(v){return f+s*v});return n(p?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return is(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Kr.apply(d(),arguments)}function Kp(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}const ac=new Date,oc=new Date;function te(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>te(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(ac.setTime(+s),oc.setTime(+a),e(ac),e(oc),Math.floor(n(ac,oc))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const $a=te(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$a.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?te(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$a),$a.range;const In=1e3,je=In*60,Nn=je*60,Pn=Nn*24,lc=Pn*7,Qp=Pn*30,cc=Pn*365,ii=te(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*In)},(e,t)=>(t-e)/In,e=>e.getUTCSeconds());ii.range;const uc=te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*In)},(e,t)=>{e.setTime(+e+t*je)},(e,t)=>(t-e)/je,e=>e.getMinutes());uc.range,te(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*je)},(e,t)=>(t-e)/je,e=>e.getUTCMinutes()).range;const hc=te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*In-e.getMinutes()*je)},(e,t)=>{e.setTime(+e+t*Nn)},(e,t)=>(t-e)/Nn,e=>e.getHours());hc.range,te(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Nn)},(e,t)=>(t-e)/Nn,e=>e.getUTCHours()).range;const ss=te(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*je)/Pn,e=>e.getDate()-1);ss.range;const dc=te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Pn,e=>e.getUTCDate()-1);dc.range,te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Pn,e=>Math.floor(e/Pn)).range;function Tr(e){return te(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*je)/lc)}const Ma=Tr(0),Ca=Tr(1),E$=Tr(2),T$=Tr(3),si=Tr(4),S$=Tr(5),O$=Tr(6);Ma.range,Ca.range,E$.range,T$.range,si.range,S$.range,O$.range;function Sr(e){return te(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/lc)}const Jp=Sr(0),Aa=Sr(1),w$=Sr(2),$$=Sr(3),ai=Sr(4),M$=Sr(5),C$=Sr(6);Jp.range,Aa.range,w$.range,$$.range,ai.range,M$.range,C$.range;const pc=te(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());pc.range,te(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const Un=te(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Un.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:te(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Un.range;const Or=te(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Or.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:te(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Or.range;function A$(e,t,n,r,i,s){const a=[[ii,1,In],[ii,5,5*In],[ii,15,15*In],[ii,30,30*In],[s,1,je],[s,5,5*je],[s,15,15*je],[s,30,30*je],[i,1,Nn],[i,3,3*Nn],[i,6,6*Nn],[i,12,12*Nn],[r,1,Pn],[r,2,2*Pn],[n,1,lc],[t,1,Qp],[t,3,3*Qp],[e,1,cc]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const p=d&&typeof d.range=="function"?d:l(c,u,d),f=p?p.range(c,+u+1):[];return h?f.reverse():f}function l(c,u,d){const h=Math.abs(u-c)/d,p=Tl(([,,m])=>m).right(a,h);if(p===a.length)return e.every(Ol(c/cc,u/cc,d));if(p===0)return $a.every(Math.max(Ol(c,u,d),1));const[f,g]=a[h/a[p-1][2]<a[p][2]/h?p-1:p];return f.every(g)}return[o,l]}const[L$,k$]=A$(Un,pc,Ma,ss,hc,uc);function fc(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function mc(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function as(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function D$(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=os(i),u=ls(i),d=os(s),h=ls(s),p=os(a),f=ls(a),g=os(o),m=ls(o),v=os(l),x=ls(l),_={a:A,A:D,b:B,B:Q,c:null,d:af,e:af,f:nM,g:dM,G:fM,H:J$,I:tM,j:eM,L:of,m:rM,M:iM,p:W,q,Q:pf,s:ff,S:sM,u:aM,U:oM,V:lM,w:cM,W:uM,x:null,X:null,y:hM,Y:pM,Z:mM,"%":df},E={a:X,A:ut,b:tt,B:Z,c:null,d:cf,e:cf,f:xM,g:CM,G:LM,H:gM,I:vM,j:yM,L:uf,m:bM,M:_M,p:et,q:dt,Q:pf,s:ff,S:EM,u:TM,U:SM,V:OM,w:wM,W:$M,x:null,X:null,y:MM,Y:AM,Z:kM,"%":df},b={a:I,A:w,b:V,B:U,c:H,d:rf,e:rf,f:X$,g:nf,G:ef,H:sf,I:sf,j:j$,L:Y$,m:F$,M:W$,p:C,q:z$,Q:K$,s:Q$,S:q$,u:U$,U:B$,V:H$,w:P$,W:V$,x:T,X:$,y:nf,Y:ef,Z:G$,"%":Z$};_.x=S(n,_),_.X=S(r,_),_.c=S(t,_),E.x=S(n,E),E.X=S(r,E),E.c=S(t,E);function S(j,Y){return function(K){var z=[],ft=-1,ct=0,Dt=j.length,Gt,st,Tt;for(K instanceof Date||(K=new Date(+K));++ft<Dt;)j.charCodeAt(ft)===37&&(z.push(j.slice(ct,ft)),(st=tf[Gt=j.charAt(++ft)])!=null?Gt=j.charAt(++ft):st=Gt==="e"?" ":"0",(Tt=Y[Gt])&&(Gt=Tt(K,st)),z.push(Gt),ct=ft+1);return z.push(j.slice(ct,ft)),z.join("")}}function M(j,Y){return function(K){var z=as(1900,void 0,1),ft=R(z,j,K+="",0),ct,Dt;if(ft!=K.length)return null;if("Q"in z)return new Date(z.Q);if("s"in z)return new Date(z.s*1e3+("L"in z?z.L:0));if(Y&&!("Z"in z)&&(z.Z=0),"p"in z&&(z.H=z.H%12+z.p*12),z.m===void 0&&(z.m="q"in z?z.q:0),"V"in z){if(z.V<1||z.V>53)return null;"w"in z||(z.w=1),"Z"in z?(ct=mc(as(z.y,0,1)),Dt=ct.getUTCDay(),ct=Dt>4||Dt===0?Aa.ceil(ct):Aa(ct),ct=dc.offset(ct,(z.V-1)*7),z.y=ct.getUTCFullYear(),z.m=ct.getUTCMonth(),z.d=ct.getUTCDate()+(z.w+6)%7):(ct=fc(as(z.y,0,1)),Dt=ct.getDay(),ct=Dt>4||Dt===0?Ca.ceil(ct):Ca(ct),ct=ss.offset(ct,(z.V-1)*7),z.y=ct.getFullYear(),z.m=ct.getMonth(),z.d=ct.getDate()+(z.w+6)%7)}else("W"in z||"U"in z)&&("w"in z||(z.w="u"in z?z.u%7:"W"in z?1:0),Dt="Z"in z?mc(as(z.y,0,1)).getUTCDay():fc(as(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(Dt+5)%7:z.w+z.U*7-(Dt+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,mc(z)):fc(z)}}function R(j,Y,K,z){for(var ft=0,ct=Y.length,Dt=K.length,Gt,st;ft<ct;){if(z>=Dt)return-1;if(Gt=Y.charCodeAt(ft++),Gt===37){if(Gt=Y.charAt(ft++),st=b[Gt in tf?Y.charAt(ft++):Gt],!st||(z=st(j,K,z))<0)return-1}else if(Gt!=K.charCodeAt(z++))return-1}return z}function C(j,Y,K){var z=c.exec(Y.slice(K));return z?(j.p=u.get(z[0].toLowerCase()),K+z[0].length):-1}function I(j,Y,K){var z=p.exec(Y.slice(K));return z?(j.w=f.get(z[0].toLowerCase()),K+z[0].length):-1}function w(j,Y,K){var z=d.exec(Y.slice(K));return z?(j.w=h.get(z[0].toLowerCase()),K+z[0].length):-1}function V(j,Y,K){var z=v.exec(Y.slice(K));return z?(j.m=x.get(z[0].toLowerCase()),K+z[0].length):-1}function U(j,Y,K){var z=g.exec(Y.slice(K));return z?(j.m=m.get(z[0].toLowerCase()),K+z[0].length):-1}function H(j,Y,K){return R(j,t,Y,K)}function T(j,Y,K){return R(j,n,Y,K)}function $(j,Y,K){return R(j,r,Y,K)}function A(j){return a[j.getDay()]}function D(j){return s[j.getDay()]}function B(j){return l[j.getMonth()]}function Q(j){return o[j.getMonth()]}function W(j){return i[+(j.getHours()>=12)]}function q(j){return 1+~~(j.getMonth()/3)}function X(j){return a[j.getUTCDay()]}function ut(j){return s[j.getUTCDay()]}function tt(j){return l[j.getUTCMonth()]}function Z(j){return o[j.getUTCMonth()]}function et(j){return i[+(j.getUTCHours()>=12)]}function dt(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var Y=S(j+="",_);return Y.toString=function(){return j},Y},parse:function(j){var Y=M(j+="",!1);return Y.toString=function(){return j},Y},utcFormat:function(j){var Y=S(j+="",E);return Y.toString=function(){return j},Y},utcParse:function(j){var Y=M(j+="",!0);return Y.toString=function(){return j},Y}}}var tf={"-":"",_:" ",0:"0"},ne=/^\s*\d+/,R$=/^%/,I$=/[\\^$*+?|[\]().{}]/g;function St(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function N$(e){return e.replace(I$,"\\$&")}function os(e){return new RegExp("^(?:"+e.map(N$).join("|")+")","i")}function ls(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function P$(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function U$(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function B$(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function H$(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function V$(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ef(e,t,n){var r=ne.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function nf(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function G$(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function z$(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function F$(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function rf(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function j$(e,t,n){var r=ne.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function sf(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function W$(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function q$(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Y$(e,t,n){var r=ne.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function X$(e,t,n){var r=ne.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Z$(e,t,n){var r=R$.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function K$(e,t,n){var r=ne.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Q$(e,t,n){var r=ne.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function af(e,t){return St(e.getDate(),t,2)}function J$(e,t){return St(e.getHours(),t,2)}function tM(e,t){return St(e.getHours()%12||12,t,2)}function eM(e,t){return St(1+ss.count(Un(e),e),t,3)}function of(e,t){return St(e.getMilliseconds(),t,3)}function nM(e,t){return of(e,t)+"000"}function rM(e,t){return St(e.getMonth()+1,t,2)}function iM(e,t){return St(e.getMinutes(),t,2)}function sM(e,t){return St(e.getSeconds(),t,2)}function aM(e){var t=e.getDay();return t===0?7:t}function oM(e,t){return St(Ma.count(Un(e)-1,e),t,2)}function lf(e){var t=e.getDay();return t>=4||t===0?si(e):si.ceil(e)}function lM(e,t){return e=lf(e),St(si.count(Un(e),e)+(Un(e).getDay()===4),t,2)}function cM(e){return e.getDay()}function uM(e,t){return St(Ca.count(Un(e)-1,e),t,2)}function hM(e,t){return St(e.getFullYear()%100,t,2)}function dM(e,t){return e=lf(e),St(e.getFullYear()%100,t,2)}function pM(e,t){return St(e.getFullYear()%1e4,t,4)}function fM(e,t){var n=e.getDay();return e=n>=4||n===0?si(e):si.ceil(e),St(e.getFullYear()%1e4,t,4)}function mM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+St(t/60|0,"0",2)+St(t%60,"0",2)}function cf(e,t){return St(e.getUTCDate(),t,2)}function gM(e,t){return St(e.getUTCHours(),t,2)}function vM(e,t){return St(e.getUTCHours()%12||12,t,2)}function yM(e,t){return St(1+dc.count(Or(e),e),t,3)}function uf(e,t){return St(e.getUTCMilliseconds(),t,3)}function xM(e,t){return uf(e,t)+"000"}function bM(e,t){return St(e.getUTCMonth()+1,t,2)}function _M(e,t){return St(e.getUTCMinutes(),t,2)}function EM(e,t){return St(e.getUTCSeconds(),t,2)}function TM(e){var t=e.getUTCDay();return t===0?7:t}function SM(e,t){return St(Jp.count(Or(e)-1,e),t,2)}function hf(e){var t=e.getUTCDay();return t>=4||t===0?ai(e):ai.ceil(e)}function OM(e,t){return e=hf(e),St(ai.count(Or(e),e)+(Or(e).getUTCDay()===4),t,2)}function wM(e){return e.getUTCDay()}function $M(e,t){return St(Aa.count(Or(e)-1,e),t,2)}function MM(e,t){return St(e.getUTCFullYear()%100,t,2)}function CM(e,t){return e=hf(e),St(e.getUTCFullYear()%100,t,2)}function AM(e,t){return St(e.getUTCFullYear()%1e4,t,4)}function LM(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ai(e):ai.ceil(e),St(e.getUTCFullYear()%1e4,t,4)}function kM(){return"+0000"}function df(){return"%"}function pf(e){return+e}function ff(e){return Math.floor(+e/1e3)}var oi,mf;DM({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function DM(e){return oi=D$(e),mf=oi.format,oi.parse,oi.utcFormat,oi.utcParse,oi}function RM(e){return new Date(e)}function IM(e){return e instanceof Date?+e:+new Date(+e)}function gf(e,t,n,r,i,s,a,o,l,c){var u=gp(),d=u.invert,h=u.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),x=c("%b %d"),_=c("%B"),E=c("%Y");function b(S){return(l(S)<S?p:o(S)<S?f:a(S)<S?g:s(S)<S?m:r(S)<S?i(S)<S?v:x:n(S)<S?_:E)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,IM)):h().map(RM)},u.ticks=function(S){var M=h();return e(M[0],M[M.length-1],S??10)},u.tickFormat=function(S,M){return M==null?b:c(M)},u.nice=function(S){var M=h();return(!S||typeof S.range!="function")&&(S=t(M[0],M[M.length-1],S??10)),S?h(Kp(M,S)):u},u.copy=function(){return Wl(u,gf(e,t,n,r,i,s,a,o,l,c))},u}function vf(){return Kr.apply(gf(L$,k$,Un,pc,Ma,ss,hc,uc,ii,mf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const yf=Math.abs,le=Math.atan2,wr=Math.cos,NM=Math.max,gc=Math.min,vn=Math.sin,li=Math.sqrt,ce=1e-12,cs=Math.PI,La=cs/2,ka=2*cs;function PM(e){return e>1?0:e<-1?cs:Math.acos(e)}function xf(e){return e>=1?La:e<=-1?-La:Math.asin(e)}function bf(e){this._context=e}bf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Da(e){return new bf(e)}function Jn(){}function _f(e){this._context=e}_f.prototype={areaStart:Jn,areaEnd:Jn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Ef(e){return new _f(e)}function UM(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const BM=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Bn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Ra(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function HM(e){const t=Ra(e,"border-left-width"),n=Ra(e,"border-right-width");return e.clientWidth+t+n}function VM(e){const t=Ra(e,"border-top-width"),n=Ra(e,"border-bottom-width");return e.clientHeight+t+n}function Tf(e,t={}){const n=t.width||HM(e),r=t.height||VM(e);return{width:n,height:r}}function GM(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Re=16384;function zM(e){(e.width>Re||e.height>Re)&&(e.width>Re&&e.height>Re?e.width>e.height?(e.height*=Re/e.width,e.width=Re):(e.width*=Re/e.height,e.height=Re):e.width>Re?(e.height*=Re/e.width,e.width=Re):(e.width*=Re/e.height,e.height=Re))}function Ia(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function FM(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function jM(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),FM(i)}const Oe=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Oe(n,t)};function WM(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qM(e){return Bn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function YM(e,t,n){const r=`.${e}:${t}`,i=n.cssText?WM(n):qM(n);return document.createTextNode(`${r}{${i}}`)}function Sf(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=BM();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(YM(s,n,r)),t.appendChild(a)}function XM(e,t){Sf(e,t,":before"),Sf(e,t,":after")}const Of="application/font-woff",wf="image/jpeg",ZM={woff:Of,woff2:Of,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:wf,jpeg:wf,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function KM(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function vc(e){const t=KM(e).toLowerCase();return ZM[t]||""}function QM(e){return e.split(/,/)[1]}function yc(e){return e.search(/^(data:)/)!==-1}function JM(e,t){return`data:${t};base64,${e}`}async function $f(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const xc={};function t2(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function bc(e,t,n){const r=t2(e,t,n.includeQueryParams);if(xc[r]!=null)return xc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await $f(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),QM(o)));i=JM(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return xc[r]=i,i}async function e2(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ia(t)}async function n2(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return Ia(o)}const n=e.poster,r=vc(n),i=await bc(n,r,t);return Ia(i)}async function r2(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await Na(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function i2(e,t){return Oe(e,HTMLCanvasElement)?e2(e):Oe(e,HTMLVideoElement)?n2(e,t):Oe(e,HTMLIFrameElement)?r2(e):e.cloneNode(!1)}const s2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function a2(e,t,n){var r,i;let s=[];return s2(e)&&e.assignedNodes?s=Bn(e.assignedNodes()):Oe(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=Bn(e.contentDocument.body.childNodes):s=Bn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||Oe(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>Na(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function o2(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Bn(r).forEach(i=>{let s=r.getPropertyValue(i);i==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),Oe(e,HTMLIFrameElement)&&i==="display"&&s==="inline"&&(s="block"),i==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(i,s,r.getPropertyPriority(i))})}function l2(e,t){Oe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Oe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function c2(e,t){if(Oe(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function u2(e,t){return Oe(t,Element)&&(o2(e,t),XM(e,t),l2(e,t),c2(e,t)),t}async function h2(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const a=n[s].getAttribute("xlink:href");if(a){const o=e.querySelector(a),l=document.querySelector(a);!o&&l&&!r[a]&&(r[a]=await Na(l,t,!0))}}const i=Object.values(r);if(i.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(a)}return e}async function Na(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>i2(r,t)).then(r=>a2(e,r,t)).then(r=>u2(e,r)).then(r=>h2(r,t))}const Mf=/url\((['"]?)([^'"]+?)\1\)/g,d2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,p2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function f2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function m2(e){const t=[];return e.replace(Mf,(n,r,i)=>(t.push(i),n)),t.filter(n=>!yc(n))}async function g2(e,t,n,r,i){try{const s=n?UM(t,n):t,a=vc(t);let o;return i||(o=await bc(s,a,r)),e.replace(f2(t),`$1${o}$3`)}catch{}return e}function v2(e,{preferredFontFormat:t}){return t?e.replace(p2,n=>{for(;;){const[r,,i]=d2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Cf(e){return e.search(Mf)!==-1}async function Af(e,t,n){if(!Cf(e))return e;const r=v2(e,n);return m2(r).reduce((i,s)=>i.then(a=>g2(a,s,t,n)),Promise.resolve(r))}async function Pa(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Af(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function y2(e,t){await Pa("background",e,t)||await Pa("background-image",e,t),await Pa("mask",e,t)||await Pa("mask-image",e,t)}async function x2(e,t){const n=Oe(e,HTMLImageElement);if(!(n&&!yc(e.src))&&!(Oe(e,SVGImageElement)&&!yc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await bc(r,vc(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function b2(e,t){const n=Bn(e.childNodes).map(r=>Lf(r,t));await Promise.all(n).then(()=>e)}async function Lf(e,t){Oe(e,Element)&&(await y2(e,t),await x2(e,t),await b2(e,t))}function _2(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const kf={};async function Df(e){let t=kf[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},kf[e]=t,t}async function Rf(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),$f(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function If(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function E2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Bn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Df(l).then(u=>Rf(u,t)).then(u=>If(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Df(i.href).then(o=>Rf(o,t)).then(o=>If(o).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Bn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function T2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Cf(t.style.getPropertyValue("src")))}async function S2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Bn(e.ownerDocument.styleSheets),r=await E2(n,t);return T2(r)}async function O2(e,t){const n=await S2(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Af(r.cssText,i,t)}))).join(`
3
- `)}async function w2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await O2(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function $2(e,t={}){const{width:n,height:r}=Tf(e,t),i=await Na(e,t,!0);return await w2(i,t),await Lf(i,t),_2(i,t),await jM(i,n,r)}async function Nf(e,t={}){const{width:n,height:r}=Tf(e,t),i=await $2(e,t),s=await Ia(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||GM(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||zM(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function M2(e,t={}){return(await Nf(e,t)).toDataURL()}async function C2(e,t={}){return(await Nf(e,t)).toDataURL("image/jpeg",t.quality||1)}let Hn=class{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}};const A2="DONT_STYLE_ME_css_styles_verifier";let P=class Wu extends Hn{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=N(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(p=>{if(h[p]){const f=h[p],g=parseFloat(f);f&&g>r[p]&&(""+f).indexOf("%")===-1&&(r[p]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=N(this.getHolder()).append("div").classed(`${Se}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",A2),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),N(this.getHolder()).classed(`${Se}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=N(r);i.classed("filled",!0),C2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=N(r);i.classed("filled",!0),M2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return N(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();N(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=N(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Wu.getSVGElementSize(N(this.mainContainer),{useBBox:!0}),n=N(this.mainContainer).attr("class"),r=N(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(Wu.getSVGElementSize(N(s),{useBBox:!0}).height)}),i<=t?N(this.mainContainer).attr("height",i):N(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&N(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=wa(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(O.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},_c=class o0 extends Hn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:o0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Pf(e){const t=L2(Uf(e),360);return tr(t,[0,10])||tr(t,[350,0])?{textAnchor:un.START,dominantBaseline:hn.MIDDLE}:tr(t,[10,80])?{textAnchor:un.START,dominantBaseline:hn.HANGING}:tr(t,[80,100])?{textAnchor:un.MIDDLE,dominantBaseline:hn.HANGING}:tr(t,[100,170])?{textAnchor:un.END,dominantBaseline:hn.HANGING}:tr(t,[170,190])?{textAnchor:un.END,dominantBaseline:hn.MIDDLE}:tr(t,[190,260])?{textAnchor:un.END,dominantBaseline:hn.BASELINE}:tr(t,[260,280])?{textAnchor:un.MIDDLE,dominantBaseline:hn.BASELINE}:{textAnchor:un.START,dominantBaseline:hn.BASELINE}}function L2(e,t){return(e%t+t)%t}function tr(e,[t,n]){return e>=t&&e<=n}function Uf(e){return e*(180/Math.PI)}function Wt(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function k2(e,t){return t*Math.sin(e-Math.PI/2)}function D2(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;)n=t(n,e[i],i,e);return n}function R2(e){return function(t){return e==null?void 0:e[t]}}var I2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},N2=R2(I2),P2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,U2="\\u0300-\\u036f",B2="\\ufe20-\\ufe2f",H2="\\u20d0-\\u20ff",V2=U2+B2+H2,G2="["+V2+"]",z2=RegExp(G2,"g");function F2(e){return e=Pi(e),e&&e.replace(P2,N2).replace(z2,"")}var j2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function W2(e){return e.match(j2)||[]}var q2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Y2(e){return q2.test(e)}var Bf="\\ud800-\\udfff",X2="\\u0300-\\u036f",Z2="\\ufe20-\\ufe2f",K2="\\u20d0-\\u20ff",Q2=X2+Z2+K2,Hf="\\u2700-\\u27bf",Vf="a-z\\xdf-\\xf6\\xf8-\\xff",J2="\\xac\\xb1\\xd7\\xf7",tC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",eC="\\u2000-\\u206f",nC=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gf="A-Z\\xc0-\\xd6\\xd8-\\xde",rC="\\ufe0e\\ufe0f",zf=J2+tC+eC+nC,Ff="['’]",jf="["+zf+"]",iC="["+Q2+"]",Wf="\\d+",sC="["+Hf+"]",qf="["+Vf+"]",Yf="[^"+Bf+zf+Wf+Hf+Vf+Gf+"]",aC="\\ud83c[\\udffb-\\udfff]",oC="(?:"+iC+"|"+aC+")",lC="[^"+Bf+"]",Xf="(?:\\ud83c[\\udde6-\\uddff]){2}",Zf="[\\ud800-\\udbff][\\udc00-\\udfff]",ci="["+Gf+"]",cC="\\u200d",Kf="(?:"+qf+"|"+Yf+")",uC="(?:"+ci+"|"+Yf+")",Qf="(?:"+Ff+"(?:d|ll|m|re|s|t|ve))?",Jf="(?:"+Ff+"(?:D|LL|M|RE|S|T|VE))?",tm=oC+"?",em="["+rC+"]?",hC="(?:"+cC+"(?:"+[lC,Xf,Zf].join("|")+")"+em+tm+")*",dC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",fC=em+tm+hC,mC="(?:"+[sC,Xf,Zf].join("|")+")"+fC,gC=RegExp([ci+"?"+qf+"+"+Qf+"(?="+[jf,ci,"$"].join("|")+")",uC+"+"+Jf+"(?="+[jf,ci+Kf,"$"].join("|")+")",ci+"?"+Kf+"+"+Qf,ci+"+"+Jf,pC,dC,Wf,mC].join("|"),"g");function vC(e){return e.match(gC)||[]}function yC(e,t,n){return e=Pi(e),t=t,t===void 0?Y2(e)?vC(e):W2(e):e.match(t)||[]}var xC="['’]",bC=RegExp(xC,"g");function nm(e){return function(t){return D2(yC(F2(t).replace(bC,"")),e,"")}}function _C(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function rm(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=ri(n),n=n===n?n:0),t!==void 0&&(t=ri(t),t=t===t?t:0),_C(ri(e),t,n)}var EC="Expected a function";function TC(e,t,n){if(typeof e!="function")throw new TypeError(EC);return setTimeout(function(){e.apply(void 0,n)},t)}var SC=il(function(e,t,n){return TC(e,ri(t)||0,n)});function OC(e,t){var n=-1,r=hr(e)?Array(e.length):[];return ec(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function wC(e,t){var n=ie(e)?Qo:OC;return n(e,Js(t))}var $C=1/0;function MC(e,t){return Xs(wC(e,t),$C)}function im(e,t){return Qs(e,t)}var ui=nm(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function CC(e,t){var n;return ec(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function AC(e,t,n){var r=ie(e)?ed:CC;return r(e,Js(t))}class $r{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}function*LC(e){for(const t of e)yield*t}function sm(e){return Array.from(LC(e))}function kC(e){return e}var Ua=1,Ba=2,Ec=3,us=4,am=1e-6;function DC(e){return"translate("+e+",0)"}function RC(e){return"translate(0,"+e+")"}function IC(e){return t=>+e(t)}function NC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function PC(){return!this.__axis}function Ha(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ua||e===us?-1:1,u=e===us||e===Ba?"x":"y",d=e===Ua||e===Ec?DC:RC;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):kC),m=Math.max(s,0)+o,v=t.range(),x=+v[0]+l,_=+v[v.length-1]+l,E=(t.bandwidth?NC:IC)(t.copy(),l),b=p.selection?p.selection():p,S=b.selectAll(".domain").data([null]),M=b.selectAll(".tick").data(f,t).order(),R=M.exit(),C=M.enter().append("g").attr("class","tick"),I=M.select("line"),w=M.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(C),I=I.merge(C.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),w=w.merge(C.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ua?"0em":e===Ec?"0.71em":"0.32em")),p!==b&&(S=S.transition(p),M=M.transition(p),I=I.transition(p),w=w.transition(p),R=R.transition(p).attr("opacity",am).attr("transform",function(V){return isFinite(V=E(V))?d(V+l):this.getAttribute("transform")}),C.attr("opacity",am).attr("transform",function(V){var U=this.parentNode.__axis;return d((U&&isFinite(U=U(V))?U:E(V))+l)})),R.remove(),S.attr("d",e===us||e===Ba?a?"M"+c*a+","+x+"H"+l+"V"+_+"H"+c*a:"M"+l+","+x+"V"+_:a?"M"+x+","+c*a+"V"+l+"H"+_+"V"+c*a:"M"+x+","+l+"H"+_),M.attr("opacity",1).attr("transform",function(V){return d(E(V)+l)}),I.attr(u+"2",c*s),w.attr(u,c*m).text(g),b.filter(PC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Ba?"start":e===us?"end":"middle"),b.each(function(){this.__axis=E})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(s=a=+p,h):s},h.tickSizeInner=function(p){return arguments.length?(s=+p,h):s},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function UC(e){return Ha(Ua,e)}function BC(e){return Ha(Ba,e)}function Tc(e){return Ha(Ec,e)}function om(e){return Ha(us,e)}const Sc={capture:!0,passive:!1};function Oc(e){e.preventDefault(),e.stopImmediatePropagation()}function HC(e){var t=e.document.documentElement,n=N(e).on("dragstart.drag",Oc,Sc);"onselectstart"in t?n.on("selectstart.drag",Oc,Sc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function VC(e,t){var n=e.document.documentElement,r=N(e).on("dragstart.drag",null);t&&(r.on("click.drag",Oc,Sc),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function GC(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const zC=e=>+e,wc=e=>()=>e;function FC(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function jC(e){e.stopImmediatePropagation()}function $c(e){e.preventDefault(),e.stopImmediatePropagation()}var lm={name:"drag"},Mc={name:"space"},hi={name:"handle"},di={name:"center"};const{abs:cm,max:ue,min:he}=Math;function um(e){return[+e[0],+e[1]]}function hm(e){return[um(e[0]),um(e[1])]}var Va={name:"x",handles:["w","e"].map(Ac),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Cc={},Vn={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},dm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},pm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},WC={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},qC={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ac(e){return{type:e}}function YC(e){return!e.ctrlKey&&!e.button}function XC(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function ZC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lc(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function KC(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function fm(){return QC(Va)}function QC(e){var t=XC,n=YC,r=ZC,i=!0,s=wl("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Ac("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Vn.overlay).merge(v).each(function(){var _=Lc(this).extent;N(this).attr("x",_[0][0]).attr("y",_[0][1]).attr("width",_[1][0]-_[0][0]).attr("height",_[1][1]-_[0][1])}),m.selectAll(".selection").data([Ac("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Vn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=m.selectAll(".handle").data(e.handles,function(_){return _.type});x.exit().remove(),x.enter().append("rect").attr("class",function(_){return"handle handle--"+_.type}).attr("cursor",function(_){return Vn[_.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,v,x){m.tween?m.on("start.brush",function(_){u(this,arguments).beforestart().start(_)}).on("interrupt.brush end.brush",function(_){u(this,arguments).end(_)}).tween("brush",function(){var _=this,E=_.__brush,b=u(_,arguments),S=E.selection,M=e.input(typeof v=="function"?v.apply(this,arguments):v,E.extent),R=Wi(S,M);function C(I){E.selection=I===1&&M===null?null:R(I),c.call(_),b.brush()}return S!==null&&M!==null?C:C(1)}):m.each(function(){var _=this,E=arguments,b=_.__brush,S=e.input(typeof v=="function"?v.apply(_,E):v,b.extent),M=u(_,E).beforestart();Vl(_),b.selection=S===null?null:S,c.call(_),M.start(x).brush(x).end(x)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=N(this),v=Lc(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(x){return x.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(x){return x.type==="e"||x.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,x){var _=m.__brush.emitter;return _&&(!x||!_.clean)?_:new d(m,v,x)}function d(m,v,x){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=x}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,x){var _=N(this.that).datum();s.call(m,this.that,new FC(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:x,dispatch:s}),_)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,x=m.target.__data__.type,_=(i&&m.metaKey?x="overlay":x)==="selection"?lm:i&&m.altKey?di:hi,E=e===Cc?null:WC[x],b=e===Va?null:qC[x],S=Lc(v),M=S.extent,R=S.selection,C=M[0][0],I,w,V=M[0][1],U,H,T=M[1][0],$,A,D=M[1][1],B,Q,W=0,q=0,X,ut=E&&b&&i&&m.shiftKey,tt,Z,et=Array.from(m.touches||[m],st=>{const Tt=st.identifier;return st=mr(st,v),st.point0=st.slice(),st.identifier=Tt,st});Vl(v);var dt=u(v,arguments,!0).beforestart();if(x==="overlay"){R&&(X=!0);const st=[et[0],et[1]||et[0]];S.selection=R=[[I=e===Cc?C:he(st[0][0],st[1][0]),U=e===Va?V:he(st[0][1],st[1][1])],[$=e===Cc?T:ue(st[0][0],st[1][0]),B=e===Va?D:ue(st[0][1],st[1][1])]],et.length>1&&ft(m)}else I=R[0][0],U=R[0][1],$=R[1][0],B=R[1][1];w=I,H=U,A=$,Q=B;var j=N(v).attr("pointer-events","none"),Y=j.selectAll(".overlay").attr("cursor",Vn[x]);if(m.touches)dt.moved=z,dt.ended=ct;else{var K=N(m.view).on("mousemove.brush",z,!0).on("mouseup.brush",ct,!0);i&&K.on("keydown.brush",Dt,!0).on("keyup.brush",Gt,!0),HC(m.view)}c.call(v),dt.start(m,_.name);function z(st){for(const Tt of st.changedTouches||[st])for(const _e of et)_e.identifier===Tt.identifier&&(_e.cur=mr(Tt,v));if(ut&&!tt&&!Z&&et.length===1){const Tt=et[0];cm(Tt.cur[0]-Tt[0])>cm(Tt.cur[1]-Tt[1])?Z=!0:tt=!0}for(const Tt of et)Tt.cur&&(Tt[0]=Tt.cur[0],Tt[1]=Tt.cur[1]);X=!0,$c(st),ft(st)}function ft(st){const Tt=et[0],_e=Tt.point0;var de;switch(W=Tt[0]-_e[0],q=Tt[1]-_e[1],_){case Mc:case lm:{E&&(W=ue(C-I,he(T-$,W)),w=I+W,A=$+W),b&&(q=ue(V-U,he(D-B,q)),H=U+q,Q=B+q);break}case hi:{et[1]?(E&&(w=ue(C,he(T,et[0][0])),A=ue(C,he(T,et[1][0])),E=1),b&&(H=ue(V,he(D,et[0][1])),Q=ue(V,he(D,et[1][1])),b=1)):(E<0?(W=ue(C-I,he(T-I,W)),w=I+W,A=$):E>0&&(W=ue(C-$,he(T-$,W)),w=I,A=$+W),b<0?(q=ue(V-U,he(D-U,q)),H=U+q,Q=B):b>0&&(q=ue(V-B,he(D-B,q)),H=U,Q=B+q));break}case di:{E&&(w=ue(C,he(T,I-W*E)),A=ue(C,he(T,$+W*E))),b&&(H=ue(V,he(D,U-q*b)),Q=ue(V,he(D,B+q*b)));break}}A<w&&(E*=-1,de=I,I=$,$=de,de=w,w=A,A=de,x in dm&&Y.attr("cursor",Vn[x=dm[x]])),Q<H&&(b*=-1,de=U,U=B,B=de,de=H,H=Q,Q=de,x in pm&&Y.attr("cursor",Vn[x=pm[x]])),S.selection&&(R=S.selection),tt&&(w=R[0][0],A=R[1][0]),Z&&(H=R[0][1],Q=R[1][1]),(R[0][0]!==w||R[0][1]!==H||R[1][0]!==A||R[1][1]!==Q)&&(S.selection=[[w,H],[A,Q]],c.call(v),dt.brush(st,_.name))}function ct(st){if(jC(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else VC(st.view,X),K.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);j.attr("pointer-events","all"),Y.attr("cursor",Vn.overlay),S.selection&&(R=S.selection),KC(R)&&(S.selection=null,c.call(v)),dt.end(st,_.name)}function Dt(st){switch(st.keyCode){case 16:{ut=E&&b;break}case 18:{_===hi&&(E&&($=A-W*E,I=w+W*E),b&&(B=Q-q*b,U=H+q*b),_=di,ft(st));break}case 32:{(_===hi||_===di)&&(E<0?$=A-W:E>0&&(I=w-W),b<0?B=Q-q:b>0&&(U=H-q),_=Mc,Y.attr("cursor",Vn.selection),ft(st));break}default:return}$c(st)}function Gt(st){switch(st.keyCode){case 16:{ut&&(tt=Z=ut=!1,ft(st));break}case 18:{_===di&&(E<0?$=A:E>0&&(I=w),b<0?B=Q:b>0&&(U=H),_=hi,ft(st));break}case 32:{_===Mc&&(st.altKey?(E&&($=A-W*E,I=w+W*E),b&&(B=Q-q*b,U=H+q*b),_=di):(E<0?$=A:E>0&&(I=w),b<0?B=Q:b>0&&(U=H),_=hi),Y.attr("cursor",Vn[x]),ft(st));break}default:return}$c(st)}}function p(m){u(this,arguments).moved(m)}function f(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=hm(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:wc(hm(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:wc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:wc(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const kc=Math.PI,Dc=2*kc,Mr=1e-6,JC=Dc-Mr;function mm(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function tA(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return mm;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let Rc=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?mm:tA(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Mr)if(!(Math.abs(d*l-c*u)>Mr)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,f=i-o,g=l*l+c*c,m=p*p+f*f,v=Math.sqrt(g),x=Math.sqrt(h),_=s*Math.tan((kc-Math.acos((g+h-m)/(2*v*x)))/2),E=_/x,b=_/v;Math.abs(E-1)>Mr&&this._append`L${t+E*u},${n+E*d}`,this._append`A${s},${s},0,0,${+(d*p>u*f)},${this._x1=t+b*l},${this._y1=n+b*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Mr||Math.abs(this._y1-u)>Mr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Dc+Dc),h>JC?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>Mr&&this._append`A${r},${r},0,${+(h>=kc)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function gm(){return new Rc}gm.prototype=Rc.prototype;var Lt=1e-6,eA=1e-12,xt=Math.PI,we=xt/2,vm=xt/4,Ie=xt*2,ge=180/xt,qt=xt/180,Ct=Math.abs,ym=Math.atan,Cr=Math.atan2,kt=Math.cos,nA=Math.exp,rA=Math.log,wt=Math.sin,er=Math.sign||function(e){return e>0?1:e<0?-1:0},on=Math.sqrt,iA=Math.tan;function sA(e){return e>1?0:e<-1?xt:Math.acos(e)}function Gn(e){return e>1?we:e<-1?-we:Math.asin(e)}function We(){}function Ga(e,t){e&&bm.hasOwnProperty(e.type)&&bm[e.type](e,t)}var xm={Feature:function(e,t){Ga(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Ga(n[r].geometry,t)}},bm={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Ic(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Ic(n[r],t,0)},Polygon:function(e,t){_m(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)_m(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Ga(n[r],t)}};function Ic(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function _m(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Ic(e[n],t,1);t.polygonEnd()}function pi(e,t){e&&xm.hasOwnProperty(e.type)?xm[e.type](e,t):Ga(e,t)}function Nc(e){return[Cr(e[1],e[0]),Gn(e[2])]}function fi(e){var t=e[0],n=e[1],r=kt(n);return[r*kt(t),r*wt(t),wt(n)]}function za(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fa(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Pc(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function ja(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Uc(e){var t=on(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Bc(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Hc(e,t){return Ct(e)>xt&&(e-=Math.round(e/Ie)*Ie),[e,t]}Hc.invert=Hc;function Em(e,t,n){return(e%=Ie)?t||n?Bc(Sm(e),Om(t,n)):Sm(e):t||n?Om(t,n):Hc}function Tm(e){return function(t,n){return t+=e,Ct(t)>xt&&(t-=Math.round(t/Ie)*Ie),[t,n]}}function Sm(e){var t=Tm(e);return t.invert=Tm(-e),t}function Om(e,t){var n=kt(e),r=wt(e),i=kt(t),s=wt(t);function a(o,l){var c=kt(l),u=kt(o)*c,d=wt(o)*c,h=wt(l),p=h*n+u*r;return[Cr(d*i-p*s,u*n-h*r),Gn(p*i+d*s)]}return a.invert=function(o,l){var c=kt(l),u=kt(o)*c,d=wt(o)*c,h=wt(l),p=h*i-d*s;return[Cr(d*i+h*s,u*n+p*r),Gn(p*n-u*r)]},a}function aA(e){e=Em(e[0]*qt,e[1]*qt,e.length>2?e[2]*qt:0);function t(n){return n=e(n[0]*qt,n[1]*qt),n[0]*=ge,n[1]*=ge,n}return t.invert=function(n){return n=e.invert(n[0]*qt,n[1]*qt),n[0]*=ge,n[1]*=ge,n},t}function oA(e,t,n,r,i,s){if(n){var a=kt(t),o=wt(t),l=r*n;i==null?(i=t+r*Ie,s=t-l/2):(i=wm(a,i),s=wm(a,s),(r>0?i<s:i>s)&&(i+=r*Ie));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Nc([a,-o*kt(u),-o*wt(u)]),e.point(c[0],c[1])}}function wm(e,t){t=fi(t),t[0]-=e,Uc(t);var n=sA(-t[1]);return((-t[2]<0?-n:n)+Ie-Lt)%Ie}function $m(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:We,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Wa(e,t){return Ct(e[0]-t[0])<Lt&&Ct(e[1]-t[1])<Lt}function qa(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Mm(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(f){if(!((g=f.length-1)<=0)){var g,m=f[0],v=f[g],x;if(Wa(m,v)){if(!m[2]&&!v[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=f[o])[0],m[1]);i.lineEnd();return}v[0]+=2*Lt}s.push(x=new qa(m,f,null,!0)),a.push(x.o=new qa(m,null,x,!1)),s.push(x=new qa(v,f,null,!1)),a.push(x.o=new qa(v,null,x,!0))}}),!!s.length){for(a.sort(t),Cm(s),Cm(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);i.lineEnd()}}}function Cm(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function Vc(e){return Ct(e[0])<=xt?e[0]:er(e[0])*((Ct(e[0])+xt)%Ie-xt)}function lA(e,t){var n=Vc(t),r=t[1],i=wt(r),s=[wt(n),-kt(n),0],a=0,o=0,l=new $r;i===1?r=we+Lt:i===-1&&(r=-we-Lt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],f=Vc(p),g=p[1]/2+vm,m=wt(g),v=kt(g),x=0;x<h;++x,f=E,m=S,v=M,p=_){var _=d[x],E=Vc(_),b=_[1]/2+vm,S=wt(b),M=kt(b),R=E-f,C=R>=0?1:-1,I=C*R,w=I>xt,V=m*S;if(l.add(Cr(V*C*wt(I),v*M+V*kt(I))),a+=w?R+C*Ie:R,w^f>=n^E>=n){var U=Fa(fi(p),fi(_));Uc(U);var H=Fa(s,U);Uc(H);var T=(w^R>=0?-1:1)*Gn(H[2]);(r>T||r===T&&(U[0]||U[1]))&&(o+=w^R>=0?1:-1)}}return(a<-1e-6||a<Lt&&l<-1e-12)^o&1}function Am(e,t,n,r){return function(i){var s=t(i),a=$m(),o=t(a),l=!1,c,u,d,h={point:p,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=x,h.lineEnd=_,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,u=sm(u);var E=lA(c,r);u.length?(l||(i.polygonStart(),l=!0),Mm(u,uA,E,n,i)):E&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(E,b){e(E,b)&&i.point(E,b)}function f(E,b){s.point(E,b)}function g(){h.point=f,s.lineStart()}function m(){h.point=p,s.lineEnd()}function v(E,b){d.push([E,b]),o.point(E,b)}function x(){o.lineStart(),d=[]}function _(){v(d[0][0],d[0][1]),o.lineEnd();var E=o.clean(),b=a.result(),S,M=b.length,R,C,I;if(d.pop(),c.push(d),d=null,!!M){if(E&1){if(C=b[0],(R=C.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<R;++S)i.point((I=C[S])[0],I[1]);i.lineEnd()}return}M>1&&E&2&&b.push(b.pop().concat(b.shift())),u.push(b.filter(cA))}}return h}}function cA(e){return e.length>1}function uA(e,t){return((e=e.x)[0]<0?e[1]-we-Lt:we-e[1])-((t=t.x)[0]<0?t[1]-we-Lt:we-t[1])}const Lm=Am(function(){return!0},hA,pA,[-xt,-we]);function hA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?xt:-xt,l=Ct(s-t);Ct(l-xt)<Lt?(e.point(t,n=(n+a)/2>0?we:-we),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=xt&&(Ct(t-r)<Lt&&(t-=r*Lt),Ct(s-o)<Lt&&(s-=o*Lt),n=dA(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function dA(e,t,n,r){var i,s,a=wt(e-n);return Ct(a)>Lt?ym((wt(t)*(s=kt(r))*wt(n)-wt(r)*(i=kt(t))*wt(e))/(i*s*a)):(t+r)/2}function pA(e,t,n,r){var i;if(e==null)i=n*we,r.point(-xt,i),r.point(0,i),r.point(xt,i),r.point(xt,0),r.point(xt,-i),r.point(0,-i),r.point(-xt,-i),r.point(-xt,0),r.point(-xt,i);else if(Ct(e[0]-t[0])>Lt){var s=e[0]<t[0]?xt:-xt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function fA(e){var t=kt(e),n=2*qt,r=t>0,i=Ct(t)>Lt;function s(u,d,h,p){oA(p,e,n,h,u,d)}function a(u,d){return kt(u)*kt(d)>t}function o(u){var d,h,p,f,g;return{lineStart:function(){f=p=!1,g=1},point:function(m,v){var x=[m,v],_,E=a(m,v),b=r?E?0:c(m,v):E?c(m+(m<0?xt:-xt),v):0;if(!d&&(f=p=E)&&u.lineStart(),E!==p&&(_=l(d,x),(!_||Wa(d,_)||Wa(x,_))&&(x[2]=1)),E!==p)g=0,E?(u.lineStart(),_=l(x,d),u.point(_[0],_[1])):(_=l(d,x),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(i&&d&&r^E){var S;!(b&h)&&(S=l(x,d,!0))&&(g=0,r?(u.lineStart(),u.point(S[0][0],S[0][1]),u.point(S[1][0],S[1][1]),u.lineEnd()):(u.point(S[1][0],S[1][1]),u.lineEnd(),u.lineStart(),u.point(S[0][0],S[0][1],3)))}E&&(!d||!Wa(d,x))&&u.point(x[0],x[1]),d=x,p=E,h=b},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return g|(f&&p)<<1}}}function l(u,d,h){var p=fi(u),f=fi(d),g=[1,0,0],m=Fa(p,f),v=za(m,m),x=m[0],_=v-x*x;if(!_)return!h&&u;var E=t*v/_,b=-t*x/_,S=Fa(g,m),M=ja(g,E),R=ja(m,b);Pc(M,R);var C=S,I=za(M,C),w=za(C,C),V=I*I-w*(za(M,M)-1);if(!(V<0)){var U=on(V),H=ja(C,(-I-U)/w);if(Pc(H,M),H=Nc(H),!h)return H;var T=u[0],$=d[0],A=u[1],D=d[1],B;$<T&&(B=T,T=$,$=B);var Q=$-T,W=Ct(Q-xt)<Lt,q=W||Q<Lt;if(!W&&D<A&&(B=A,A=D,D=B),q?W?A+D>0^H[1]<(Ct(H[0]-T)<Lt?A:D):A<=H[1]&&H[1]<=D:Q>xt^(T<=H[0]&&H[0]<=$)){var X=ja(C,(-I+U)/w);return Pc(X,M),[H,Nc(X)]}}}function c(u,d){var h=r?e:xt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return Am(a,o,s,r?[0,-e]:[-xt,e-xt])}function mA(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,p=c-o,f;if(f=n-a,!(!h&&f>0)){if(f/=h,h<0){if(f<u)return;f<d&&(d=f)}else if(h>0){if(f>d)return;f>u&&(u=f)}if(f=i-a,!(!h&&f<0)){if(f/=h,h<0){if(f>d)return;f>u&&(u=f)}else if(h>0){if(f<u)return;f<d&&(d=f)}if(f=r-o,!(!p&&f>0)){if(f/=p,p<0){if(f<u)return;f<d&&(d=f)}else if(p>0){if(f>d)return;f>u&&(u=f)}if(f=s-o,!(!p&&f<0)){if(f/=p,p<0){if(f>d)return;f>u&&(u=f)}else if(p>0){if(f<u)return;f<d&&(d=f)}return u>0&&(e[0]=a+u*h,e[1]=o+u*p),d<1&&(t[0]=a+d*h,t[1]=o+d*p),!0}}}}}var Ya=1e9,Xa=-1e9;function gA(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var p=0,f=0;if(c==null||(p=a(c,d))!==(f=a(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==f);else h.point(u[0],u[1])}function a(c,u){return Ct(c[0]-e)<Lt?u>0?0:3:Ct(c[0]-n)<Lt?u>0?2:1:Ct(c[1]-t)<Lt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=$m(),h,p,f,g,m,v,x,_,E,b,S,M={point:R,lineStart:V,lineEnd:U,polygonStart:I,polygonEnd:w};function R(T,$){i(T,$)&&u.point(T,$)}function C(){for(var T=0,$=0,A=p.length;$<A;++$)for(var D=p[$],B=1,Q=D.length,W=D[0],q,X,ut=W[0],tt=W[1];B<Q;++B)q=ut,X=tt,W=D[B],ut=W[0],tt=W[1],X<=r?tt>r&&(ut-q)*(r-X)>(tt-X)*(e-q)&&++T:tt<=r&&(ut-q)*(r-X)<(tt-X)*(e-q)&&--T;return T}function I(){u=d,h=[],p=[],S=!0}function w(){var T=C(),$=S&&T,A=(h=sm(h)).length;($||A)&&(c.polygonStart(),$&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),A&&Mm(h,o,T,s,c),c.polygonEnd()),u=c,h=p=f=null}function V(){M.point=H,p&&p.push(f=[]),b=!0,E=!1,x=_=NaN}function U(){h&&(H(g,m),v&&E&&d.rejoin(),h.push(d.result())),M.point=R,E&&u.lineEnd()}function H(T,$){var A=i(T,$);if(p&&f.push([T,$]),b)g=T,m=$,v=A,b=!1,A&&(u.lineStart(),u.point(T,$));else if(A&&E)u.point(T,$);else{var D=[x=Math.max(Xa,Math.min(Ya,x)),_=Math.max(Xa,Math.min(Ya,_))],B=[T=Math.max(Xa,Math.min(Ya,T)),$=Math.max(Xa,Math.min(Ya,$))];mA(D,B,e,t,n,r)?(E||(u.lineStart(),u.point(D[0],D[1])),u.point(B[0],B[1]),A||u.lineEnd(),S=!1):A&&(u.lineStart(),u.point(T,$),S=!1)}x=T,_=$,E=A}return M}}const Gc=e=>e;var zc=new $r,Fc=new $r,km,Dm,jc,Wc,zn={point:We,lineStart:We,lineEnd:We,polygonStart:function(){zn.lineStart=vA,zn.lineEnd=xA},polygonEnd:function(){zn.lineStart=zn.lineEnd=zn.point=We,zc.add(Ct(Fc)),Fc=new $r},result:function(){var e=zc/2;return zc=new $r,e}};function vA(){zn.point=yA}function yA(e,t){zn.point=Rm,km=jc=e,Dm=Wc=t}function Rm(e,t){Fc.add(Wc*e-jc*t),jc=e,Wc=t}function xA(){Rm(km,Dm)}var mi=1/0,Za=mi,hs=-mi,Ka=hs,Qa={point:bA,lineStart:We,lineEnd:We,polygonStart:We,polygonEnd:We,result:function(){var e=[[mi,Za],[hs,Ka]];return hs=Ka=-(Za=mi=1/0),e}};function bA(e,t){e<mi&&(mi=e),e>hs&&(hs=e),t<Za&&(Za=t),t>Ka&&(Ka=t)}var qc=0,Yc=0,ds=0,Ja=0,to=0,gi=0,Xc=0,Zc=0,ps=0,Im,Nm,yn,xn,qe={point:Ar,lineStart:Pm,lineEnd:Um,polygonStart:function(){qe.lineStart=TA,qe.lineEnd=SA},polygonEnd:function(){qe.point=Ar,qe.lineStart=Pm,qe.lineEnd=Um},result:function(){var e=ps?[Xc/ps,Zc/ps]:gi?[Ja/gi,to/gi]:ds?[qc/ds,Yc/ds]:[NaN,NaN];return qc=Yc=ds=Ja=to=gi=Xc=Zc=ps=0,e}};function Ar(e,t){qc+=e,Yc+=t,++ds}function Pm(){qe.point=_A}function _A(e,t){qe.point=EA,Ar(yn=e,xn=t)}function EA(e,t){var n=e-yn,r=t-xn,i=on(n*n+r*r);Ja+=i*(yn+e)/2,to+=i*(xn+t)/2,gi+=i,Ar(yn=e,xn=t)}function Um(){qe.point=Ar}function TA(){qe.point=OA}function SA(){Bm(Im,Nm)}function OA(e,t){qe.point=Bm,Ar(Im=yn=e,Nm=xn=t)}function Bm(e,t){var n=e-yn,r=t-xn,i=on(n*n+r*r);Ja+=i*(yn+e)/2,to+=i*(xn+t)/2,gi+=i,i=xn*e-yn*t,Xc+=i*(yn+e),Zc+=i*(xn+t),ps+=i*3,Ar(yn=e,xn=t)}function Hm(e){this._context=e}Hm.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ie);break}}},result:We};var Kc=new $r,Qc,Vm,Gm,fs,ms,gs={point:We,lineStart:function(){gs.point=wA},lineEnd:function(){Qc&&zm(Vm,Gm),gs.point=We},polygonStart:function(){Qc=!0},polygonEnd:function(){Qc=null},result:function(){var e=+Kc;return Kc=new $r,e}};function wA(e,t){gs.point=zm,Vm=fs=e,Gm=ms=t}function zm(e,t){fs-=e,ms-=t,Kc.add(on(fs*fs+ms*ms)),fs=e,ms=t}let Fm,eo,jm,Wm;class qm{constructor(t){this._append=t==null?Ym:$A(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==jm||this._append!==eo){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,jm=r,eo=this._append,Wm=this._,this._=i}this._+=Wm;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Ym(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function $A(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ym;if(t!==Fm){const n=10**t;Fm=t,eo=function(r){let i=1;this._+=r[0];for(const s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}return eo}function MA(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),pi(o,i(s))),s.result()}return a.area=function(o){return pi(o,i(zn)),zn.result()},a.measure=function(o){return pi(o,i(gs)),gs.result()},a.bounds=function(o){return pi(o,i(Qa)),Qa.result()},a.centroid=function(o){return pi(o,i(qe)),qe.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Gc):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new qm(n)):new Hm(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new qm(n)),a},a.projection(e).digits(n).context(t)}function Jc(e){return function(t){var n=new tu;for(var r in e)n[r]=e[r];return n.stream=t,n}}function tu(){}tu.prototype={constructor:tu,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function eu(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),pi(n,e.stream(Qa)),t(Qa.result()),r!=null&&e.clipExtent(r),e}function Xm(e,t,n){return eu(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function CA(e,t,n){return Xm(e,[[0,0],t],n)}function AA(e,t,n){return eu(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function LA(e,t,n){return eu(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Zm=16,kA=kt(30*qt);function Km(e,t){return+t?RA(e,t):DA(e)}function DA(e){return Jc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function RA(e,t){function n(r,i,s,a,o,l,c,u,d,h,p,f,g,m){var v=c-r,x=u-i,_=v*v+x*x;if(_>4*t&&g--){var E=a+h,b=o+p,S=l+f,M=on(E*E+b*b+S*S),R=Gn(S/=M),C=Ct(Ct(S)-1)<Lt||Ct(s-d)<Lt?(s+d)/2:Cr(b,E),I=e(C,R),w=I[0],V=I[1],U=w-r,H=V-i,T=x*U-v*H;(T*T/_>t||Ct((v*U+x*H)/_-.5)>.3||a*h+o*p+l*f<kA)&&(n(r,i,s,a,o,l,w,V,C,E/=M,b/=M,S,g,m),m.point(w,V),n(w,V,C,E,b,S,c,u,d,h,p,f,g,m))}}return function(r){var i,s,a,o,l,c,u,d,h,p,f,g,m={point:v,lineStart:x,lineEnd:E,polygonStart:function(){r.polygonStart(),m.lineStart=b},polygonEnd:function(){r.polygonEnd(),m.lineStart=x}};function v(R,C){R=e(R,C),r.point(R[0],R[1])}function x(){d=NaN,m.point=_,r.lineStart()}function _(R,C){var I=fi([R,C]),w=e(R,C);n(d,h,u,p,f,g,d=w[0],h=w[1],u=R,p=I[0],f=I[1],g=I[2],Zm,r),r.point(d,h)}function E(){m.point=v,r.lineEnd()}function b(){x(),m.point=S,m.lineEnd=M}function S(R,C){_(i=R,C),s=d,a=h,o=p,l=f,c=g,m.point=_}function M(){n(d,h,u,p,f,g,s,a,i,o,l,c,Zm,r),m.lineEnd=E,E()}return m}}var IA=Jc({point:function(e,t){this.stream.point(e*qt,t*qt)}});function NA(e){return Jc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function PA(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Qm(e,t,n,r,i,s){if(!s)return PA(e,t,n,r,i);var a=kt(s),o=wt(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,p=(o*t+a*n)/e;function f(g,m){return g*=r,m*=i,[l*g-c*m+t,n-c*g-l*m]}return f.invert=function(g,m){return[r*(u*g-d*m+h),i*(p-d*g-u*m)]},f}function no(e){return Jm(function(){return e})()}function Jm(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,p=1,f=null,g=Lm,m=null,v,x,_,E=Gc,b=.5,S,M,R,C,I;function w(T){return R(T[0]*qt,T[1]*qt)}function V(T){return T=R.invert(T[0],T[1]),T&&[T[0]*ge,T[1]*ge]}w.stream=function(T){return C&&I===T?C:C=IA(NA(u)(g(S(E(I=T)))))},w.preclip=function(T){return arguments.length?(g=T,f=void 0,H()):g},w.postclip=function(T){return arguments.length?(E=T,m=v=x=_=null,H()):E},w.clipAngle=function(T){return arguments.length?(g=+T?fA(f=T*qt):(f=null,Lm),H()):f*ge},w.clipExtent=function(T){return arguments.length?(E=T==null?(m=v=x=_=null,Gc):gA(m=+T[0][0],v=+T[0][1],x=+T[1][0],_=+T[1][1]),H()):m==null?null:[[m,v],[x,_]]},w.scale=function(T){return arguments.length?(n=+T,U()):n},w.translate=function(T){return arguments.length?(r=+T[0],i=+T[1],U()):[r,i]},w.center=function(T){return arguments.length?(s=T[0]%360*qt,a=T[1]%360*qt,U()):[s*ge,a*ge]},w.rotate=function(T){return arguments.length?(o=T[0]%360*qt,l=T[1]%360*qt,c=T.length>2?T[2]%360*qt:0,U()):[o*ge,l*ge,c*ge]},w.angle=function(T){return arguments.length?(d=T%360*qt,U()):d*ge},w.reflectX=function(T){return arguments.length?(h=T?-1:1,U()):h<0},w.reflectY=function(T){return arguments.length?(p=T?-1:1,U()):p<0},w.precision=function(T){return arguments.length?(S=Km(M,b=T*T),H()):on(b)},w.fitExtent=function(T,$){return Xm(w,T,$)},w.fitSize=function(T,$){return CA(w,T,$)},w.fitWidth=function(T,$){return AA(w,T,$)},w.fitHeight=function(T,$){return LA(w,T,$)};function U(){var T=Qm(n,0,0,h,p,d).apply(null,t(s,a)),$=Qm(n,r-T[0],i-T[1],h,p,d);return u=Em(o,l,c),M=Bc(t,$),R=Bc(u,M),S=Km(M,b),H()}function H(){return C=I=null,w}return function(){return t=e.apply(this,arguments),w.invert=t.invert&&V,U()}}function tg(e){var t=0,n=xt/3,r=Jm(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*qt,n=s[1]*qt):[t*ge,n*ge]},i}function UA(e){var t=kt(e);function n(r,i){return[r*t,wt(i)/t]}return n.invert=function(r,i){return[r/t,Gn(i*t)]},n}function BA(e,t){var n=wt(e),r=(n+wt(t))/2;if(Ct(r)<Lt)return UA(e);var i=1+n*(2*r-n),s=on(i)/r;function a(o,l){var c=on(i-2*r*wt(l))/r;return[c*wt(o*=r),s-c*kt(o)]}return a.invert=function(o,l){var c=s-l,u=Cr(o,Ct(c))*er(c);return c*r<0&&(u-=xt*er(o)*er(c)),[u/r,Gn((i-(o*o+c*c)*r*r)/(2*r))]},a}function eg(){return tg(BA).scale(155.424).center([0,33.6442])}function HA(){return eg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function nu(e,t){return[e,rA(iA((we+t)/2))]}nu.invert=function(e,t){return[e,2*ym(nA(t))-we]};function VA(){return GA(nu).scale(961/Ie)}function GA(e){var t=no(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=xt*r(),h=t(aA(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===nu?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function ro(e,t){return[e,t]}ro.invert=ro;function zA(){return no(ro).scale(152.63)}function FA(e,t){var n=kt(e),r=e===t?wt(e):(n-kt(t))/(t-e),i=n/r+e;if(Ct(r)<Lt)return ro;function s(a,o){var l=i-o,c=r*a;return[l*wt(c),i-l*kt(c)]}return s.invert=function(a,o){var l=i-o,c=Cr(a,Ct(l))*er(l);return l*r<0&&(c-=xt*er(a)*er(l)),[c/r,i-er(r)*on(a*a+l*l)]},s}function jA(){return tg(FA).scale(131.154).center([0,13.9389])}var vs=1.340264,ys=-.081106,xs=893e-6,bs=.003796,io=on(3)/2,WA=12;function ng(e,t){var n=Gn(io*wt(t)),r=n*n,i=r*r*r;return[e*kt(n)/(io*(vs+3*ys*r+i*(7*xs+9*bs*r))),n*(vs+ys*r+i*(xs+bs*r))]}ng.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<WA&&(o=n*(vs+ys*r+i*(xs+bs*r))-t,l=vs+3*ys*r+i*(7*xs+9*bs*r),n-=a=o/l,r=n*n,i=r*r*r,!(Ct(a)<eA));++s);return[io*e*(vs+3*ys*r+i*(7*xs+9*bs*r))/kt(n),Gn(wt(n)/io)]};function qA(){return no(ng).scale(177.158)}function rg(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}rg.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Ct(i)>Lt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function YA(){return no(rg).scale(175.295)}function XA(e,t){return e.parent===t.parent?1:2}function ZA(e){return e.reduce(KA,0)/e.length}function KA(e,t){return e+t.x}function QA(e){return 1+e.reduce(JA,0)}function JA(e,t){return Math.max(e,t.y)}function tL(e){for(var t;t=e.children;)e=t[0];return e}function eL(e){for(var t;t=e.children;)e=t[t.length-1];return e}function nL(){var e=XA,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var p=h.children;p?(h.x=ZA(p),h.y=QA(p)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=tL(s),c=eL(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function rL(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function iL(){return this.eachAfter(rL)}function sL(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function aL(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function oL(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function lL(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function cL(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function uL(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function hL(e){for(var t=this,n=dL(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function dL(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function pL(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function fL(){return Array.from(this)}function mL(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function gL(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*vL(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function _s(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=bL)):t===void 0&&(t=xL);for(var n=new Es(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new Es(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(EL)}function yL(){return _s(this).eachBefore(_L)}function xL(e){return e.children}function bL(e){return Array.isArray(e)?e[1]:null}function _L(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function EL(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Es(e){this.data=e,this.depth=this.height=0,this.parent=null}Es.prototype=_s.prototype={constructor:Es,count:iL,each:sL,eachAfter:oL,eachBefore:aL,find:lL,sum:cL,sort:uL,path:hL,ancestors:pL,descendants:fL,leaves:mL,links:gL,copy:yL,[Symbol.iterator]:vL};function TL(e){return e==null?null:ig(e)}function ig(e){if(typeof e!="function")throw new Error;return e}function Lr(){return 0}function vi(e){return function(){return e}}const SL=1664525,OL=1013904223,sg=4294967296;function wL(){let e=1;return()=>(e=(SL*e+OL)%sg)/sg}function $L(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ML(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function CL(e,t){for(var n=0,r=(e=ML(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&ag(a,s)?++n:(a=LL(i=AL(i,s)),n=0);return a}function AL(e,t){var n,r;if(ru(t,e))return[t];for(n=0;n<e.length;++n)if(so(t,e[n])&&ru(Ts(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(so(Ts(e[n],e[r]),t)&&so(Ts(e[n],t),e[r])&&so(Ts(e[r],t),e[n])&&ru(og(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function so(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function ag(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function ru(e,t){for(var n=0;n<t.length;++n)if(!ag(e,t[n]))return!1;return!0}function LL(e){switch(e.length){case 1:return kL(e[0]);case 2:return Ts(e[0],e[1]);case 3:return og(e[0],e[1],e[2])}}function kL(e){return{x:e.x,y:e.y,r:e.r}}function Ts(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function og(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-a,p=r-c,f=i-o,g=i-u,m=l-s,v=d-s,x=r*r+i*i-s*s,_=x-a*a-o*o+l*l,E=x-c*c-u*u+d*d,b=p*f-h*g,S=(f*E-g*_)/(b*2)-r,M=(g*m-f*v)/b,R=(p*_-h*E)/(b*2)-i,C=(h*v-p*m)/b,I=M*M+C*C-1,w=2*(s+S*M+R*C),V=S*S+R*R-s*s,U=-(Math.abs(I)>1e-6?(w+Math.sqrt(w*w-4*I*V))/(2*I):V/w);return{x:r+S+M*U,y:i+R+C*U,r:U}}function lg(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function cg(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function ug(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function ao(e){this._=e,this.next=null,this.previous=null}function DL(e,t){if(!(s=(e=$L(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;lg(r,n,i=e[2]),n=new ao(n),r=new ao(r),i=new ao(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){lg(n._,r._,i=e[l]),i=new ao(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(cg(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(cg(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=ug(n);(i=i.next)!==r;)(o=ug(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=CL(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function RL(e){return Math.sqrt(e.value)}function IL(){var e=null,t=1,n=1,r=Lr;function i(s){const a=wL();return s.x=t/2,s.y=n/2,e?s.eachBefore(hg(e)).eachAfter(iu(r,.5,a)).eachBefore(dg(1)):s.eachBefore(hg(RL)).eachAfter(iu(Lr,1,a)).eachAfter(iu(r,s.r/Math.min(t,n),a)).eachBefore(dg(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=TL(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:vi(+s),i):r},i}function hg(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function iu(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=DL(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function dg(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function NL(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function PL(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function UL(e,t){return e.parent===t.parent?1:2}function su(e){var t=e.children;return t?t[0]:e.t}function au(e){var t=e.children;return t?t[t.length-1]:e.t}function BL(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function HL(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function VL(e,t,n){return e.a.parent===t.parent?e.a:n}function oo(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}oo.prototype=Object.create(Es.prototype);function GL(e){for(var t=new oo(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new oo(s[a],a)),i.parent=n;return(t.parent=new oo(null,0)).children=[t],t}function zL(){var e=UL,t=1,n=1,r=null;function i(c){var u=GL(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,p=c;c.eachBefore(function(x){x.x<d.x&&(d=x),x.x>h.x&&(h=x),x.depth>p.depth&&(p=x)});var f=d===h?1:e(d,h)/2,g=f-d.x,m=t/(h.x+f+g),v=n/(p.depth||1);c.eachBefore(function(x){x.x=(x.x+g)*m,x.y=x.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){HL(c);var p=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-p):c.z=p}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,p=c,f=u,g=h.parent.children[0],m=h.m,v=p.m,x=f.m,_=g.m,E;f=au(f),h=su(h),f&&h;)g=su(g),p=au(p),p.a=c,E=f.z+x-h.z-m+e(f._,h._),E>0&&(BL(VL(f,c,d),c,E),m+=E,v+=E),x+=f.m,m+=h.m,_+=g.m,v+=p.m;f&&!au(p)&&(p.t=f,p.m+=x-v),h&&!su(g)&&(g.t=h,g.m+=m-_,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function FL(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var jL=(1+Math.sqrt(5))/2;function WL(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,p,f,g=t.value,m,v,x,_,E,b,S;u<h;){p=i-n,f=s-r;do m=o[d++].value;while(!m&&d<h);for(v=x=m,b=Math.max(f/p,p/f)/(g*e),S=m*m*b,E=Math.max(x/S,S/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>x&&(x=c),S=m*m*b,_=Math.max(x/S,S/v),_>E){m-=c;break}E=_}a.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?PL(l,n,r,i,g?r+=f*m/g:s):FL(l,n,r,g?n+=p*m/g:i,s),g-=m,u=d}return a}const qL=function e(t){function n(r,i,s,a,o){WL(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(jL);function YL(){var e=qL,t=!1,n=1,r=1,i=[0],s=Lr,a=Lr,o=Lr,l=Lr,c=Lr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(NL),h}function d(h){var p=i[h.depth],f=h.x0+p,g=h.y0+p,m=h.x1-p,v=h.y1-p;m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),h.x0=f,h.y0=g,h.x1=m,h.y1=v,h.children&&(p=i[h.depth+1]=s(h)/2,f+=c(h)-p,g+=a(h)-p,m-=o(h)-p,v-=l(h)-p,m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),e(h,f,g,m,v))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=ig(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:vi(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:vi(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:vi(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:vi(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:vi(+h),u):c},u}function lo(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Rc(t)}function XL(e){return e.innerRadius}function ZL(e){return e.outerRadius}function KL(e){return e.startAngle}function QL(e){return e.endAngle}function JL(e){return e&&e.padAngle}function tk(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<ce))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function co(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/li(o*o+l*l),u=c*l,d=-c*o,h=e+u,p=t+d,f=n+u,g=r+d,m=(h+f)/2,v=(p+g)/2,x=f-h,_=g-p,E=x*x+_*_,b=i-s,S=h*g-f*p,M=(_<0?-1:1)*li(NM(0,b*b*E-S*S)),R=(S*_-x*M)/E,C=(-S*x-_*M)/E,I=(S*_+x*M)/E,w=(-S*x+_*M)/E,V=R-m,U=C-v,H=I-m,T=w-v;return V*V+U*U>H*H+T*T&&(R=I,C=w),{cx:R,cy:C,x01:-u,y01:-d,x11:R*(i/b-1),y11:C*(i/b-1)}}function Ss(){var e=XL,t=ZL,n=yt(0),r=null,i=KL,s=QL,a=JL,o=null,l=lo(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-La,g=s.apply(this,arguments)-La,m=yf(g-f),v=g>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>ce))o.moveTo(0,0);else if(m>ka-ce)o.moveTo(p*wr(f),p*vn(f)),o.arc(0,0,p,f,g,!v),h>ce&&(o.moveTo(h*wr(g),h*vn(g)),o.arc(0,0,h,g,f,v));else{var x=f,_=g,E=f,b=g,S=m,M=m,R=a.apply(this,arguments)/2,C=R>ce&&(r?+r.apply(this,arguments):li(h*h+p*p)),I=gc(yf(p-h)/2,+n.apply(this,arguments)),w=I,V=I,U,H;if(C>ce){var T=xf(C/h*vn(R)),$=xf(C/p*vn(R));(S-=T*2)>ce?(T*=v?1:-1,E+=T,b-=T):(S=0,E=b=(f+g)/2),(M-=$*2)>ce?($*=v?1:-1,x+=$,_-=$):(M=0,x=_=(f+g)/2)}var A=p*wr(x),D=p*vn(x),B=h*wr(b),Q=h*vn(b);if(I>ce){var W=p*wr(_),q=p*vn(_),X=h*wr(E),ut=h*vn(E),tt;if(m<cs)if(tt=tk(A,D,X,ut,W,q,B,Q)){var Z=A-tt[0],et=D-tt[1],dt=W-tt[0],j=q-tt[1],Y=1/vn(PM((Z*dt+et*j)/(li(Z*Z+et*et)*li(dt*dt+j*j)))/2),K=li(tt[0]*tt[0]+tt[1]*tt[1]);w=gc(I,(h-K)/(Y-1)),V=gc(I,(p-K)/(Y+1))}else w=V=0}M>ce?V>ce?(U=co(X,ut,A,D,p,V,v),H=co(W,q,B,Q,p,V,v),o.moveTo(U.cx+U.x01,U.cy+U.y01),V<I?o.arc(U.cx,U.cy,V,le(U.y01,U.x01),le(H.y01,H.x01),!v):(o.arc(U.cx,U.cy,V,le(U.y01,U.x01),le(U.y11,U.x11),!v),o.arc(0,0,p,le(U.cy+U.y11,U.cx+U.x11),le(H.cy+H.y11,H.cx+H.x11),!v),o.arc(H.cx,H.cy,V,le(H.y11,H.x11),le(H.y01,H.x01),!v))):(o.moveTo(A,D),o.arc(0,0,p,x,_,!v)):o.moveTo(A,D),!(h>ce)||!(S>ce)?o.lineTo(B,Q):w>ce?(U=co(B,Q,W,q,h,-w,v),H=co(A,D,X,ut,h,-w,v),o.lineTo(U.cx+U.x01,U.cy+U.y01),w<I?o.arc(U.cx,U.cy,w,le(U.y01,U.x01),le(H.y01,H.x01),!v):(o.arc(U.cx,U.cy,w,le(U.y01,U.x01),le(U.y11,U.x11),!v),o.arc(0,0,h,le(U.cy+U.y11,U.cx+U.x11),le(H.cy+H.y11,H.cx+H.x11),v),o.arc(H.cx,H.cy,w,le(H.y11,H.x11),le(H.y01,H.x01),!v))):o.arc(0,0,h,b,E,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-cs/2;return[wr(d)*u,vn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:yt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:yt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:yt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:yt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:yt(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:yt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:yt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function ou(e){return e[0]}function lu(e){return e[1]}function Os(e,t){var n=yt(!0),r=null,i=Da,s=null,a=lo(o);e=typeof e=="function"?e:e===void 0?ou:yt(e),t=typeof t=="function"?t:t===void 0?lu:yt(t);function o(l){var c,u=(l=Oa(l)).length,d,h=!1,p;for(r==null&&(s=i(p=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(p)return s=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:yt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:yt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:yt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function cu(e,t,n){var r=null,i=yt(!0),s=null,a=Da,o=null,l=lo(c);e=typeof e=="function"?e:e===void 0?ou:yt(+e),t=typeof t=="function"?t:yt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?lu:yt(+n);function c(d){var h,p,f,g=(d=Oa(d)).length,m,v=!1,x,_=new Array(g),E=new Array(g);for(s==null&&(o=a(x=l())),h=0;h<=g;++h){if(!(h<g&&i(m=d[h],h,d))===v)if(v=!v)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=h-1;f>=p;--f)o.point(_[f],E[f]);o.lineEnd(),o.areaEnd()}v&&(_[h]=+e(m,h,d),E[h]=+t(m,h,d),o.point(r?+r(m,h,d):_[h],n?+n(m,h,d):E[h]))}if(x)return o=null,x+""||null}function u(){return Os().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:yt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:yt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:yt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:yt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:yt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:yt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:yt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function ek(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function nk(e){return e}function rk(){var e=nk,t=ek,n=null,r=yt(0),i=yt(ka),s=yt(0);function a(o){var l,c=(o=Oa(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),g=+r.apply(this,arguments),m=Math.min(ka,Math.max(-ka,i.apply(this,arguments)-g)),v,x=Math.min(Math.abs(m)/c,s.apply(this,arguments)),_=x*(m<0?-1:1),E;for(l=0;l<c;++l)(E=f[p[l]=l]=+e(o[l],l,o))>0&&(h+=E);for(t!=null?p.sort(function(b,S){return t(f[b],f[S])}):n!=null&&p.sort(function(b,S){return n(o[b],o[S])}),l=0,d=h?(m-c*_)/h:0;l<c;++l,g=v)u=p[l],E=f[u],v=g+(E>0?E*d:0)+_,f[u]={data:o[u],index:l,value:E,startAngle:g,endAngle:v,padAngle:x};return f}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:yt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:yt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:yt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:yt(+o),a):s},a}var ik=fg(Da);function pg(e){this._curve=e}pg.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function fg(e){function t(n){return new pg(e(n))}return t._curve=e,t}function sk(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(fg(n)):t()._curve},e}function ak(){return sk(Os().curve(ik))}class ok{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function lk(e){return new ok(e,!0)}function ck(e){return e.source}function uk(e){return e.target}function hk(e){let t=ck,n=uk,r=ou,i=lu,s=null,a=null,o=lo(l);function l(){let c;const u=Aw.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:yt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:yt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function dk(){return hk(lk)}let bt=class{constructor(t,n,r){if(this.type="",this.renderType=ot.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=y(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(N(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${Se}--${i}--${this.type}`,!0),r&&r.classed(`${Se}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=P.appendOrSelect(this.parent,`${this.renderType===ot.SVG?"svg":"div"}${r}.${Se}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=N(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ht({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:mg,setPrototypeOf:gg,isFrozen:pk,getPrototypeOf:fk,getOwnPropertyDescriptor:mk}=Object;let{freeze:ve,seal:Ye,create:vg}=Object,{apply:uu,construct:hu}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e}),Ye||(Ye=function(e){return e}),uu||(uu=function(e,t,n){return e.apply(t,n)}),hu||(hu=function(e,t){return new e(...t)});const uo=xe(Array.prototype.forEach),gk=xe(Array.prototype.lastIndexOf),yg=xe(Array.prototype.pop),ws=xe(Array.prototype.push),vk=xe(Array.prototype.splice),ho=xe(String.prototype.toLowerCase),du=xe(String.prototype.toString),xg=xe(String.prototype.match),$s=xe(String.prototype.replace),yk=xe(String.prototype.indexOf),xk=xe(String.prototype.trim),ln=xe(Object.prototype.hasOwnProperty),ye=xe(RegExp.prototype.test),Ms=bk(TypeError);function xe(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return uu(e,t,r)}}function bk(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hu(e,n)}}function _t(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ho;gg&&gg(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(pk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function _k(e){for(let t=0;t<e.length;t++)ln(e,t)||(e[t]=null);return e}function kr(e){const t=vg(null);for(const[n,r]of mg(e))ln(e,n)&&(Array.isArray(r)?t[n]=_k(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=kr(r):t[n]=r);return t}function Cs(e,t){for(;e!==null;){const r=mk(e,t);if(r){if(r.get)return xe(r.get);if(typeof r.value=="function")return xe(r.value)}e=fk(e)}function n(){return null}return n}const bg=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pu=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fu=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ek=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mu=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Tk=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_g=ve(["#text"]),Eg=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),gu=ve(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Tg=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),po=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Sk=Ye(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ok=Ye(/<%[\w\W]*|[\w\W]*%>/gm),wk=Ye(/\$\{[\w\W]*/gm),$k=Ye(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mk=Ye(/^aria-[\-\w]+$/),Sg=Ye(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ck=Ye(/^(?:\w+script|data):/i),Ak=Ye(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Og=Ye(/^html$/i),Lk=Ye(/^[a-z][.\w]*(-[.\w]+)+$/i);var wg=Object.freeze({__proto__:null,ARIA_ATTR:Mk,ATTR_WHITESPACE:Ak,CUSTOM_ELEMENT:Lk,DATA_ATTR:$k,DOCTYPE_NAME:Og,ERB_EXPR:Ok,IS_ALLOWED_URI:Sg,IS_SCRIPT_OR_DATA:Ck,MUSTACHE_EXPR:Sk,TMPLIT_EXPR:wk});const As={element:1,text:3,progressingInstruction:7,comment:8,document:9},kk=function(){return typeof window>"u"?null:window},Dk=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},$g=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Mg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kk();const t=L=>Mg(L);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==As.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,f=l.prototype,g=Cs(f,"cloneNode"),m=Cs(f,"remove"),v=Cs(f,"nextSibling"),x=Cs(f,"childNodes"),_=Cs(f,"parentNode");if(typeof a=="function"){const L=n.createElement("template");L.content&&L.content.ownerDocument&&(n=L.content.ownerDocument)}let E,b="";const{implementation:S,createNodeIterator:M,createDocumentFragment:R,getElementsByTagName:C}=n,{importNode:I}=r;let w=$g();t.isSupported=typeof mg=="function"&&typeof _=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:V,ERB_EXPR:U,TMPLIT_EXPR:H,DATA_ATTR:T,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:B}=wg;let{IS_ALLOWED_URI:Q}=wg,W=null;const q=_t({},[...bg,...pu,...fu,...mu,..._g]);let X=null;const ut=_t({},[...Eg,...gu,...Tg,...po]);let tt=Object.seal(vg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Z=null,et=null,dt=!0,j=!0,Y=!1,K=!0,z=!1,ft=!0,ct=!1,Dt=!1,Gt=!1,st=!1,Tt=!1,_e=!1,de=!0,k=!1;const it="user-content-";let rt=!0,mt=!1,Ft={},$t=null;const gt=_t({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Xe=null;const jn=_t({},["audio","video","img","source","image","track"]);let ee=null;const En=_t({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Tn="http://www.w3.org/1998/Math/MathML",Ue="http://www.w3.org/2000/svg",Ce="http://www.w3.org/1999/xhtml";let pe=Ce,Vu=!1,Gu=null;const dU=_t({},[Tn,Ue,Ce],du);let Mo=_t({},["mi","mo","mn","ms","mtext"]),Co=_t({},["annotation-xml"]);const pU=_t({},["title","style","font","a","script"]);let Ns=null;const fU=["application/xhtml+xml","text/html"],mU="text/html";let re=null,_i=null;const gU=n.createElement("form"),Zv=function(L){return L instanceof RegExp||L instanceof Function},zu=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(_i&&_i===L)){if((!L||typeof L!="object")&&(L={}),L=kr(L),Ns=fU.indexOf(L.PARSER_MEDIA_TYPE)===-1?mU:L.PARSER_MEDIA_TYPE,re=Ns==="application/xhtml+xml"?du:ho,W=ln(L,"ALLOWED_TAGS")?_t({},L.ALLOWED_TAGS,re):q,X=ln(L,"ALLOWED_ATTR")?_t({},L.ALLOWED_ATTR,re):ut,Gu=ln(L,"ALLOWED_NAMESPACES")?_t({},L.ALLOWED_NAMESPACES,du):dU,ee=ln(L,"ADD_URI_SAFE_ATTR")?_t(kr(En),L.ADD_URI_SAFE_ATTR,re):En,Xe=ln(L,"ADD_DATA_URI_TAGS")?_t(kr(jn),L.ADD_DATA_URI_TAGS,re):jn,$t=ln(L,"FORBID_CONTENTS")?_t({},L.FORBID_CONTENTS,re):gt,Z=ln(L,"FORBID_TAGS")?_t({},L.FORBID_TAGS,re):{},et=ln(L,"FORBID_ATTR")?_t({},L.FORBID_ATTR,re):{},Ft=ln(L,"USE_PROFILES")?L.USE_PROFILES:!1,dt=L.ALLOW_ARIA_ATTR!==!1,j=L.ALLOW_DATA_ATTR!==!1,Y=L.ALLOW_UNKNOWN_PROTOCOLS||!1,K=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=L.SAFE_FOR_TEMPLATES||!1,ft=L.SAFE_FOR_XML!==!1,ct=L.WHOLE_DOCUMENT||!1,st=L.RETURN_DOM||!1,Tt=L.RETURN_DOM_FRAGMENT||!1,_e=L.RETURN_TRUSTED_TYPE||!1,Gt=L.FORCE_BODY||!1,de=L.SANITIZE_DOM!==!1,k=L.SANITIZE_NAMED_PROPS||!1,rt=L.KEEP_CONTENT!==!1,mt=L.IN_PLACE||!1,Q=L.ALLOWED_URI_REGEXP||Sg,pe=L.NAMESPACE||Ce,Mo=L.MATHML_TEXT_INTEGRATION_POINTS||Mo,Co=L.HTML_INTEGRATION_POINTS||Co,tt=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&Zv(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(tt.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&Zv(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(tt.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(tt.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),z&&(j=!1),Tt&&(st=!0),Ft&&(W=_t({},_g),X=[],Ft.html===!0&&(_t(W,bg),_t(X,Eg)),Ft.svg===!0&&(_t(W,pu),_t(X,gu),_t(X,po)),Ft.svgFilters===!0&&(_t(W,fu),_t(X,gu),_t(X,po)),Ft.mathMl===!0&&(_t(W,mu),_t(X,Tg),_t(X,po))),L.ADD_TAGS&&(W===q&&(W=kr(W)),_t(W,L.ADD_TAGS,re)),L.ADD_ATTR&&(X===ut&&(X=kr(X)),_t(X,L.ADD_ATTR,re)),L.ADD_URI_SAFE_ATTR&&_t(ee,L.ADD_URI_SAFE_ATTR,re),L.FORBID_CONTENTS&&($t===gt&&($t=kr($t)),_t($t,L.FORBID_CONTENTS,re)),rt&&(W["#text"]=!0),ct&&_t(W,["html","head","body"]),W.table&&(_t(W,["tbody"]),delete Z.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ms('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ms('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=L.TRUSTED_TYPES_POLICY,b=E.createHTML("")}else E===void 0&&(E=Dk(p,i)),E!==null&&typeof b=="string"&&(b=E.createHTML(""));ve&&ve(L),_i=L}},Kv=_t({},[...pu,...fu,...Ek]),Qv=_t({},[...mu,...Tk]),vU=function(L){let nt=_(L);(!nt||!nt.tagName)&&(nt={namespaceURI:pe,tagName:"template"});const J=ho(L.tagName),At=ho(nt.tagName);return Gu[L.namespaceURI]?L.namespaceURI===Ue?nt.namespaceURI===Ce?J==="svg":nt.namespaceURI===Tn?J==="svg"&&(At==="annotation-xml"||Mo[At]):!!Kv[J]:L.namespaceURI===Tn?nt.namespaceURI===Ce?J==="math":nt.namespaceURI===Ue?J==="math"&&Co[At]:!!Qv[J]:L.namespaceURI===Ce?nt.namespaceURI===Ue&&!Co[At]||nt.namespaceURI===Tn&&!Mo[At]?!1:!Qv[J]&&(pU[J]||!Kv[J]):!!(Ns==="application/xhtml+xml"&&Gu[L.namespaceURI]):!1},Ir=function(L){ws(t.removed,{element:L});try{_(L).removeChild(L)}catch{m(L)}},Ao=function(L,nt){try{ws(t.removed,{attribute:nt.getAttributeNode(L),from:nt})}catch{ws(t.removed,{attribute:null,from:nt})}if(nt.removeAttribute(L),L==="is")if(st||Tt)try{Ir(nt)}catch{}else try{nt.setAttribute(L,"")}catch{}},Jv=function(L){let nt=null,J=null;if(Gt)L="<remove></remove>"+L;else{const Jt=xg(L,/^[\r\n\t ]+/);J=Jt&&Jt[0]}Ns==="application/xhtml+xml"&&pe===Ce&&(L='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+L+"</body></html>");const At=E?E.createHTML(L):L;if(pe===Ce)try{nt=new h().parseFromString(At,Ns)}catch{}if(!nt||!nt.documentElement){nt=S.createDocument(pe,"template",null);try{nt.documentElement.innerHTML=Vu?b:At}catch{}}const ae=nt.body||nt.documentElement;return L&&J&&ae.insertBefore(n.createTextNode(J),ae.childNodes[0]||null),pe===Ce?C.call(nt,ct?"html":"body")[0]:ct?nt.documentElement:ae},t0=function(L){return M.call(L.ownerDocument||L,L,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Fu=function(L){return L instanceof d&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof u)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},e0=function(L){return typeof o=="function"&&L instanceof o};function Wn(L,nt,J){uo(L,At=>{At.call(t,nt,J,_i)})}const n0=function(L){let nt=null;if(Wn(w.beforeSanitizeElements,L,null),Fu(L))return Ir(L),!0;const J=re(L.nodeName);if(Wn(w.uponSanitizeElement,L,{tagName:J,allowedTags:W}),L.hasChildNodes()&&!e0(L.firstElementChild)&&ye(/<[/\w]/g,L.innerHTML)&&ye(/<[/\w]/g,L.textContent)||L.nodeType===As.progressingInstruction||ft&&L.nodeType===As.comment&&ye(/<[/\w]/g,L.data))return Ir(L),!0;if(!W[J]||Z[J]){if(!Z[J]&&i0(J)&&(tt.tagNameCheck instanceof RegExp&&ye(tt.tagNameCheck,J)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(J)))return!1;if(rt&&!$t[J]){const At=_(L)||L.parentNode,ae=x(L)||L.childNodes;if(ae&&At){const Jt=ae.length;for(let qn=Jt-1;qn>=0;--qn){const Ze=g(ae[qn],!0);Ze.__removalCount=(L.__removalCount||0)+1,At.insertBefore(Ze,v(L))}}}return Ir(L),!0}return L instanceof l&&!vU(L)||(J==="noscript"||J==="noembed"||J==="noframes")&&ye(/<\/no(script|embed|frames)/i,L.innerHTML)?(Ir(L),!0):(z&&L.nodeType===As.text&&(nt=L.textContent,uo([V,U,H],At=>{nt=$s(nt,At," ")}),L.textContent!==nt&&(ws(t.removed,{element:L.cloneNode()}),L.textContent=nt)),Wn(w.afterSanitizeElements,L,null),!1)},r0=function(L,nt,J){if(de&&(nt==="id"||nt==="name")&&(J in n||J in gU))return!1;if(!(j&&!et[nt]&&ye(T,nt))&&!(dt&&ye($,nt))){if(!X[nt]||et[nt]){if(!(i0(L)&&(tt.tagNameCheck instanceof RegExp&&ye(tt.tagNameCheck,L)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(L))&&(tt.attributeNameCheck instanceof RegExp&&ye(tt.attributeNameCheck,nt)||tt.attributeNameCheck instanceof Function&&tt.attributeNameCheck(nt))||nt==="is"&&tt.allowCustomizedBuiltInElements&&(tt.tagNameCheck instanceof RegExp&&ye(tt.tagNameCheck,J)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(J))))return!1}else if(!ee[nt]&&!ye(Q,$s(J,D,""))&&!((nt==="src"||nt==="xlink:href"||nt==="href")&&L!=="script"&&yk(J,"data:")===0&&Xe[L])&&!(Y&&!ye(A,$s(J,D,"")))&&J)return!1}return!0},i0=function(L){return L!=="annotation-xml"&&xg(L,B)},s0=function(L){Wn(w.beforeSanitizeAttributes,L,null);const{attributes:nt}=L;if(!nt||Fu(L))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let At=nt.length;for(;At--;){const ae=nt[At],{name:Jt,namespaceURI:qn,value:Ze}=ae,Sn=re(Jt);let Ee=Jt==="value"?Ze:xk(Ze);if(J.attrName=Sn,J.attrValue=Ee,J.keepAttr=!0,J.forceKeepAttr=void 0,Wn(w.uponSanitizeAttribute,L,J),Ee=J.attrValue,k&&(Sn==="id"||Sn==="name")&&(Ao(Jt,L),Ee=it+Ee),ft&&ye(/((--!?|])>)|<\/(style|title)/i,Ee)){Ao(Jt,L);continue}if(J.forceKeepAttr||(Ao(Jt,L),!J.keepAttr))continue;if(!K&&ye(/\/>/i,Ee)){Ao(Jt,L);continue}z&&uo([V,U,H],xU=>{Ee=$s(Ee,xU," ")});const a0=re(L.nodeName);if(r0(a0,Sn,Ee)){if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!qn)switch(p.getAttributeType(a0,Sn)){case"TrustedHTML":{Ee=E.createHTML(Ee);break}case"TrustedScriptURL":{Ee=E.createScriptURL(Ee);break}}try{qn?L.setAttributeNS(qn,Jt,Ee):L.setAttribute(Jt,Ee),Fu(L)?Ir(L):yg(t.removed)}catch{}}}Wn(w.afterSanitizeAttributes,L,null)},yU=function L(nt){let J=null;const At=t0(nt);for(Wn(w.beforeSanitizeShadowDOM,nt,null);J=At.nextNode();)Wn(w.uponSanitizeShadowNode,J,null),n0(J),s0(J),J.content instanceof s&&L(J.content);Wn(w.afterSanitizeShadowDOM,nt,null)};return t.sanitize=function(L){let nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,At=null,ae=null,Jt=null;if(Vu=!L,Vu&&(L="<!-->"),typeof L!="string"&&!e0(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw Ms("dirty is not a string, aborting")}else throw Ms("toString is not a function");if(!t.isSupported)return L;if(Dt||zu(nt),t.removed=[],typeof L=="string"&&(mt=!1),mt){if(L.nodeName){const Sn=re(L.nodeName);if(!W[Sn]||Z[Sn])throw Ms("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof o)J=Jv("<!---->"),At=J.ownerDocument.importNode(L,!0),At.nodeType===As.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?J=At:J.appendChild(At);else{if(!st&&!z&&!ct&&L.indexOf("<")===-1)return E&&_e?E.createHTML(L):L;if(J=Jv(L),!J)return st?null:_e?b:""}J&&Gt&&Ir(J.firstChild);const qn=t0(mt?L:J);for(;ae=qn.nextNode();)n0(ae),s0(ae),ae.content instanceof s&&yU(ae.content);if(mt)return L;if(st){if(Tt)for(Jt=R.call(J.ownerDocument);J.firstChild;)Jt.appendChild(J.firstChild);else Jt=J;return(X.shadowroot||X.shadowrootmode)&&(Jt=I.call(r,Jt,!0)),Jt}let Ze=ct?J.outerHTML:J.innerHTML;return ct&&W["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&ye(Og,J.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
4
- `+Ze),z&&uo([V,U,H],Sn=>{Ze=$s(Ze,Sn," ")}),E&&_e?E.createHTML(Ze):Ze},t.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};zu(L),Dt=!0},t.clearConfig=function(){_i=null,Dt=!1},t.isValidAttribute=function(L,nt,J){_i||zu({});const At=re(L),ae=re(nt);return r0(At,ae,J)},t.addHook=function(L,nt){typeof nt=="function"&&ws(w[L],nt)},t.removeHook=function(L,nt){if(nt!==void 0){const J=gk(w[L],nt);return J===-1?void 0:vk(w[L],J,1)[0]}return yg(w[L])},t.removeHooks=function(L){w[L]=[]},t.removeAllHooks=function(){w=$g()},t}var vu=Mg();const fo=e=>vu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),Rk=e=>vu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),bn=e=>vu.sanitize(e,{ALLOWED_TAGS:[]}),Cg=class l0 extends bt{constructor(){super(...arguments),this.type="toolbar",this.renderType=ot.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(O.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(O.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(y(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
1
+ (function(V,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ft):(V=typeof globalThis<"u"?globalThis:V||self,ft(V.ChartsReact={},V.React))})(this,function(V,ft){"use strict";var mU=Object.defineProperty;var gU=(V,ft,Dn)=>ft in V?mU(V,ft,{enumerable:!0,configurable:!0,writable:!0,value:Dn}):V[ft]=Dn;var Uu=(V,ft,Dn)=>gU(V,typeof ft!="symbol"?ft+"":ft,Dn);var Dn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Dn||{}),To=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(To||{}),Oo=(e=>(e.UPDATE="model-update",e))(Oo||{}),Hu=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Hu||{}),wo=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(wo||{}),$o=(e=>(e.CHANGE="zoom-domain-change",e))($o||{}),Mo=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Mo||{}),Co=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(Co||{}),Ao=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Ao||{}),Lo=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(Lo||{}),ko=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(ko||{}),Do=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(Do||{}),Ro=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Ro||{}),Io=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Io||{}),No=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(No||{}),Po=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Po||{}),Uo=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Uo||{}),Bo=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Bo||{}),Ho=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Ho||{}),Sr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Sr||{}),Vo=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Vo||{}),Vu=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Vu||{}),Gu=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(Gu||{}),zu=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(zu||{}),Fu=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Fu||{}),ju=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(ju||{}),Tr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Tr||{});const o0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:zu,Area:Ao,Axis:Co,Bar:Ro,Boxplot:Io,CanvasZoom:Mo,Chart:Dn,Choropleth:Tr,CirclePack:Gu,Gauge:Do,Heatmap:ju,Legend:Vu,Line:Po,Meter:Fu,Modal:To,Model:Oo,Pie:ko,Radar:Uo,Scatter:No,Threshold:Vo,Toolbar:Hu,Tooltip:Sr,Tree:Bo,Treemap:Ho,WordCloud:Lo,ZoomBar:wo,ZoomDomain:$o},Symbol.toStringTag,{value:"Module"})),O=o0;var it=(e=>(e.HTML="html",e.SVG="svg",e))(it||{}),Go=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Go||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),Ue=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ue||{}),we=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(we||{}),Gt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Gt||{}),nt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(nt||{}),Or=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Or||{}),zt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(zt||{}),wr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(wr||{}),Cs=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Cs||{}),Mt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Mt||{}),lt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(lt||{}),jn=(e=>(e.CENTER="center",e))(jn||{}),pi=(e=>(e.LEFT="left",e.RIGHT="right",e))(pi||{}),Ft=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Ft||{}),Ke=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Ke||{}),Qe=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Qe||{}),Wn=(e=>(e.SEMI="semi",e.FULL="full",e))(Wn||{}),As=(e=>(e.UP="up",e.DOWN="down",e))(As||{}),fi=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(fi||{}),mi=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(mi||{}),ve=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(ve||{}),bt=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(bt||{}),Ls=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ls||{}),jt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(jt||{}),gi=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(gi||{}),$r=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))($r||{}),vi=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(vi||{}),Je=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Je||{}),Wu=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(Wu||{});function zo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function yi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function xi(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?c0(o,d=>d.test(a)):l0(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function l0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function c0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function u0(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const qu=6048e5,h0=864e5,Yu=6e4,Xu=36e5,Zu=Symbol.for("constructDateFrom");function $e(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Zu in e?e[Zu](t):e instanceof Date?new e.constructor(t):new Date(t)}function qn(e,...t){const n=$e.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let d0={};function ks(){return d0}function Pt(e,t){return $e(t||e,e)}function bi(e,t){var n,r,i,s;const a=ks(),o=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??a.weekStartsOn??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.weekStartsOn)??0,l=Pt(e,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const p0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},f0=(e,t,n)=>{let r;const i=p0[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},m0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},g0=(e,t,n,r)=>m0[e],v0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},y0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},x0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},b0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},E0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},S0=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},T0={ordinalNumber:S0,era:yi({values:v0,defaultWidth:"wide"}),quarter:yi({values:y0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:yi({values:x0,defaultWidth:"wide"}),day:yi({values:b0,defaultWidth:"wide"}),dayPeriod:yi({values:_0,defaultWidth:"wide",formattingValues:E0,defaultFormattingWidth:"wide"})},O0=/^(\d+)(th|st|nd|rd)?/i,w0=/\d+/i,$0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},M0={any:[/^b/i,/^(a|c)/i]},C0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},A0={any:[/1/i,/2/i,/3/i,/4/i]},L0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},k0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},D0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},R0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},I0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},N0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},P0={ordinalNumber:u0({matchPattern:O0,parsePattern:w0,valueCallback:e=>parseInt(e,10)}),era:xi({matchPatterns:$0,defaultMatchWidth:"wide",parsePatterns:M0,defaultParseWidth:"any"}),quarter:xi({matchPatterns:C0,defaultMatchWidth:"wide",parsePatterns:A0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:xi({matchPatterns:L0,defaultMatchWidth:"wide",parsePatterns:k0,defaultParseWidth:"any"}),day:xi({matchPatterns:D0,defaultMatchWidth:"wide",parsePatterns:R0,defaultParseWidth:"any"}),dayPeriod:xi({matchPatterns:I0,defaultMatchWidth:"any",parsePatterns:N0,defaultParseWidth:"any"})},U0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},B0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},H0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},V0={date:zo({formats:U0,defaultWidth:"full"}),time:zo({formats:B0,defaultWidth:"full"}),dateTime:zo({formats:H0,defaultWidth:"full"})},Ku={code:"en-US",formatDistance:f0,formatLong:V0,formatRelative:g0,localize:T0,match:P0,options:{weekStartsOn:0,firstWeekContainsDate:1}};var Qu=typeof global=="object"&&global&&global.Object===Object&&global,G0=typeof self=="object"&&self&&self.Object===Object&&self,Be=Qu||G0||Function("return this")(),Me=Be.Symbol,Ju=Object.prototype,z0=Ju.hasOwnProperty,F0=Ju.toString,_i=Me?Me.toStringTag:void 0;function j0(e){var t=z0.call(e,_i),n=e[_i];try{e[_i]=void 0;var r=!0}catch{}var i=F0.call(e);return r&&(t?e[_i]=n:delete e[_i]),i}var W0=Object.prototype,q0=W0.toString;function Y0(e){return q0.call(e)}var X0="[object Null]",Z0="[object Undefined]",th=Me?Me.toStringTag:void 0;function Yn(e){return e==null?e===void 0?Z0:X0:th&&th in Object(e)?j0(e):Y0(e)}function tn(e){return e!=null&&typeof e=="object"}var K0="[object Symbol]";function Ds(e){return typeof e=="symbol"||tn(e)&&Yn(e)==K0}function Fo(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Zt=Array.isArray,eh=Me?Me.prototype:void 0,nh=eh?eh.toString:void 0;function rh(e){if(typeof e=="string")return e;if(Zt(e))return Fo(e,rh)+"";if(Ds(e))return nh?nh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function jo(e){return e}var Q0="[object AsyncFunction]",J0="[object Function]",t1="[object GeneratorFunction]",e1="[object Proxy]";function Wo(e){if(!Ce(e))return!1;var t=Yn(e);return t==J0||t==t1||t==Q0||t==e1}var qo=Be["__core-js_shared__"],ih=function(){var e=/[^.]+$/.exec(qo&&qo.keys&&qo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function n1(e){return!!ih&&ih in e}var r1=Function.prototype,i1=r1.toString;function Xn(e){if(e!=null){try{return i1.call(e)}catch{}try{return e+""}catch{}}return""}var s1=/[\\^$.*+?()[\]{}|]/g,a1=/^\[object .+?Constructor\]$/,o1=Function.prototype,l1=Object.prototype,c1=o1.toString,u1=l1.hasOwnProperty,h1=RegExp("^"+c1.call(u1).replace(s1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d1(e){if(!Ce(e)||n1(e))return!1;var t=Wo(e)?h1:a1;return t.test(Xn(e))}function p1(e,t){return e==null?void 0:e[t]}function Zn(e,t){var n=p1(e,t);return d1(n)?n:void 0}var Yo=Zn(Be,"WeakMap"),sh=Object.create,f1=function(){function e(){}return function(t){if(!Ce(t))return{};if(sh)return sh(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function m1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function g1(){}function ah(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var v1=800,y1=16,x1=Date.now;function b1(e){var t=0,n=0;return function(){var r=x1(),i=y1-(r-n);if(n=r,i>0){if(++t>=v1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function _1(e){return function(){return e}}var Rs=function(){try{var e=Zn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),E1=Rs?function(e,t){return Rs(e,"toString",{configurable:!0,enumerable:!1,value:_1(t),writable:!0})}:jo,oh=b1(E1);function S1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function T1(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function O1(e){return e!==e}function w1(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function $1(e,t,n){return t===t?w1(e,t,n):T1(e,O1,n)}function M1(e,t){var n=e==null?0:e.length;return!!n&&$1(e,t,0)>-1}var C1=9007199254740991,A1=/^(?:0|[1-9]\d*)$/;function Xo(e,t){var n=typeof e;return t=t??C1,!!t&&(n=="number"||n!="symbol"&&A1.test(e))&&e>-1&&e%1==0&&e<t}function Is(e,t,n){t=="__proto__"&&Rs?Rs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ei(e,t){return e===t||e!==e&&t!==t}var L1=Object.prototype,k1=L1.hasOwnProperty;function lh(e,t,n){var r=e[t];(!(k1.call(e,t)&&Ei(r,n))||n===void 0&&!(t in e))&&Is(e,t,n)}function Mr(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?Is(n,o,l):lh(n,o,l)}return n}var ch=Math.max;function uh(e,t,n){return t=ch(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=ch(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),m1(e,this,o)}}function Zo(e,t){return oh(uh(e,t,jo),e+"")}var D1=9007199254740991;function Ko(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=D1}function Kn(e){return e!=null&&Ko(e.length)&&!Wo(e)}function R1(e,t,n){if(!Ce(n))return!1;var r=typeof t;return(r=="number"?Kn(n)&&Xo(t,n.length):r=="string"&&t in n)?Ei(n[t],e):!1}function I1(e){return Zo(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&R1(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var N1=Object.prototype;function Ns(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||N1;return e===n}function P1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var U1="[object Arguments]";function hh(e){return tn(e)&&Yn(e)==U1}var dh=Object.prototype,B1=dh.hasOwnProperty,H1=dh.propertyIsEnumerable,Cr=hh(function(){return arguments}())?hh:function(e){return tn(e)&&B1.call(e,"callee")&&!H1.call(e,"callee")};function V1(){return!1}var ph=typeof V=="object"&&V&&!V.nodeType&&V,fh=ph&&typeof module=="object"&&module&&!module.nodeType&&module,G1=fh&&fh.exports===ph,mh=G1?Be.Buffer:void 0,z1=mh?mh.isBuffer:void 0,Ar=z1||V1,F1="[object Arguments]",j1="[object Array]",W1="[object Boolean]",q1="[object Date]",Y1="[object Error]",X1="[object Function]",Z1="[object Map]",K1="[object Number]",Q1="[object Object]",J1="[object RegExp]",ty="[object Set]",ey="[object String]",ny="[object WeakMap]",ry="[object ArrayBuffer]",iy="[object DataView]",sy="[object Float32Array]",ay="[object Float64Array]",oy="[object Int8Array]",ly="[object Int16Array]",cy="[object Int32Array]",uy="[object Uint8Array]",hy="[object Uint8ClampedArray]",dy="[object Uint16Array]",py="[object Uint32Array]",kt={};kt[sy]=kt[ay]=kt[oy]=kt[ly]=kt[cy]=kt[uy]=kt[hy]=kt[dy]=kt[py]=!0,kt[F1]=kt[j1]=kt[ry]=kt[W1]=kt[iy]=kt[q1]=kt[Y1]=kt[X1]=kt[Z1]=kt[K1]=kt[Q1]=kt[J1]=kt[ty]=kt[ey]=kt[ny]=!1;function fy(e){return tn(e)&&Ko(e.length)&&!!kt[Yn(e)]}function Qo(e){return function(t){return e(t)}}var gh=typeof V=="object"&&V&&!V.nodeType&&V,Si=gh&&typeof module=="object"&&module&&!module.nodeType&&module,my=Si&&Si.exports===gh,Jo=my&&Qu.process,Lr=function(){try{var e=Si&&Si.require&&Si.require("util").types;return e||Jo&&Jo.binding&&Jo.binding("util")}catch{}}(),vh=Lr&&Lr.isTypedArray,Ps=vh?Qo(vh):fy,gy=Object.prototype,vy=gy.hasOwnProperty;function yh(e,t){var n=Zt(e),r=!n&&Cr(e),i=!n&&!r&&Ar(e),s=!n&&!r&&!i&&Ps(e),a=n||r||i||s,o=a?P1(e.length,String):[],l=o.length;for(var c in e)(t||vy.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Xo(c,l)))&&o.push(c);return o}function xh(e,t){return function(n){return e(t(n))}}var yy=xh(Object.keys,Object),xy=Object.prototype,by=xy.hasOwnProperty;function bh(e){if(!Ns(e))return yy(e);var t=[];for(var n in Object(e))by.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ti(e){return Kn(e)?yh(e):bh(e)}function _y(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ey=Object.prototype,Sy=Ey.hasOwnProperty;function Ty(e){if(!Ce(e))return _y(e);var t=Ns(e),n=[];for(var r in e)r=="constructor"&&(t||!Sy.call(e,r))||n.push(r);return n}function Oi(e){return Kn(e)?yh(e,!0):Ty(e)}var Oy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wy=/^\w*$/;function tl(e,t){if(Zt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ds(e)?!0:wy.test(e)||!Oy.test(e)||t!=null&&e in Object(t)}var wi=Zn(Object,"create");function $y(){this.__data__=wi?wi(null):{},this.size=0}function My(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Cy="__lodash_hash_undefined__",Ay=Object.prototype,Ly=Ay.hasOwnProperty;function ky(e){var t=this.__data__;if(wi){var n=t[e];return n===Cy?void 0:n}return Ly.call(t,e)?t[e]:void 0}var Dy=Object.prototype,Ry=Dy.hasOwnProperty;function Iy(e){var t=this.__data__;return wi?t[e]!==void 0:Ry.call(t,e)}var Ny="__lodash_hash_undefined__";function Py(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wi&&t===void 0?Ny:t,this}function Qn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qn.prototype.clear=$y,Qn.prototype.delete=My,Qn.prototype.get=ky,Qn.prototype.has=Iy,Qn.prototype.set=Py;function Uy(){this.__data__=[],this.size=0}function Us(e,t){for(var n=e.length;n--;)if(Ei(e[n][0],t))return n;return-1}var By=Array.prototype,Hy=By.splice;function Vy(e){var t=this.__data__,n=Us(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Hy.call(t,n,1),--this.size,!0}function Gy(e){var t=this.__data__,n=Us(t,e);return n<0?void 0:t[n][1]}function zy(e){return Us(this.__data__,e)>-1}function Fy(e,t){var n=this.__data__,r=Us(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hn.prototype.clear=Uy,hn.prototype.delete=Vy,hn.prototype.get=Gy,hn.prototype.has=zy,hn.prototype.set=Fy;var $i=Zn(Be,"Map");function jy(){this.size=0,this.__data__={hash:new Qn,map:new($i||hn),string:new Qn}}function Wy(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Bs(e,t){var n=e.__data__;return Wy(t)?n[typeof t=="string"?"string":"hash"]:n.map}function qy(e){var t=Bs(this,e).delete(e);return this.size-=t?1:0,t}function Yy(e){return Bs(this,e).get(e)}function Xy(e){return Bs(this,e).has(e)}function Zy(e,t){var n=Bs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=jy,dn.prototype.delete=qy,dn.prototype.get=Yy,dn.prototype.has=Xy,dn.prototype.set=Zy;var Ky="Expected a function";function el(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ky);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(el.Cache||dn),n}el.Cache=dn;var Qy=500;function Jy(e){var t=el(e,function(r){return n.size===Qy&&n.clear(),r}),n=t.cache;return t}var tx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ex=/\\(\\)?/g,nx=Jy(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tx,function(n,r,i,s){t.push(i?s.replace(ex,"$1"):r||n)}),t});function Mi(e){return e==null?"":rh(e)}function Hs(e,t){return Zt(e)?e:tl(e,t)?[e]:nx(Mi(e))}function Ci(e){if(typeof e=="string"||Ds(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function nl(e,t){t=Hs(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ci(t[n++])];return n&&n==r?e:void 0}function yt(e,t,n){var r=e==null?void 0:nl(e,t);return r===void 0?n:r}function rl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var _h=Me?Me.isConcatSpreadable:void 0;function rx(e){return Zt(e)||Cr(e)||!!(_h&&e&&e[_h])}function Vs(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=rx),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Vs(o,t-1,n,r,i):rl(i,o):r||(i[i.length]=o)}return i}var il=xh(Object.getPrototypeOf,Object),ix="[object Object]",sx=Function.prototype,ax=Object.prototype,Eh=sx.toString,ox=ax.hasOwnProperty,lx=Eh.call(Object);function Sh(e){if(!tn(e)||Yn(e)!=ix)return!1;var t=il(e);if(t===null)return!0;var n=ox.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Eh.call(n)==lx}function cx(){this.__data__=new hn,this.size=0}function ux(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hx(e){return this.__data__.get(e)}function dx(e){return this.__data__.has(e)}var px=200;function fx(e,t){var n=this.__data__;if(n instanceof hn){var r=n.__data__;if(!$i||r.length<px-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dn(r)}return n.set(e,t),this.size=n.size,this}function He(e){var t=this.__data__=new hn(e);this.size=t.size}He.prototype.clear=cx,He.prototype.delete=ux,He.prototype.get=hx,He.prototype.has=dx,He.prototype.set=fx;function mx(e,t){return e&&Mr(t,Ti(t),e)}function gx(e,t){return e&&Mr(t,Oi(t),e)}var Th=typeof V=="object"&&V&&!V.nodeType&&V,Oh=Th&&typeof module=="object"&&module&&!module.nodeType&&module,vx=Oh&&Oh.exports===Th,wh=vx?Be.Buffer:void 0,$h=wh?wh.allocUnsafe:void 0;function Mh(e,t){if(t)return e.slice();var n=e.length,r=$h?$h(n):new e.constructor(n);return e.copy(r),r}function yx(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Ch(){return[]}var xx=Object.prototype,bx=xx.propertyIsEnumerable,Ah=Object.getOwnPropertySymbols,sl=Ah?function(e){return e==null?[]:(e=Object(e),yx(Ah(e),function(t){return bx.call(e,t)}))}:Ch;function _x(e,t){return Mr(e,sl(e),t)}var Ex=Object.getOwnPropertySymbols,Lh=Ex?function(e){for(var t=[];e;)rl(t,sl(e)),e=il(e);return t}:Ch;function Sx(e,t){return Mr(e,Lh(e),t)}function kh(e,t,n){var r=t(e);return Zt(e)?r:rl(r,n(e))}function al(e){return kh(e,Ti,sl)}function Dh(e){return kh(e,Oi,Lh)}var ol=Zn(Be,"DataView"),ll=Zn(Be,"Promise"),kr=Zn(Be,"Set"),Rh="[object Map]",Tx="[object Object]",Ih="[object Promise]",Nh="[object Set]",Ph="[object WeakMap]",Uh="[object DataView]",Ox=Xn(ol),wx=Xn($i),$x=Xn(ll),Mx=Xn(kr),Cx=Xn(Yo),Ae=Yn;(ol&&Ae(new ol(new ArrayBuffer(1)))!=Uh||$i&&Ae(new $i)!=Rh||ll&&Ae(ll.resolve())!=Ih||kr&&Ae(new kr)!=Nh||Yo&&Ae(new Yo)!=Ph)&&(Ae=function(e){var t=Yn(e),n=t==Tx?e.constructor:void 0,r=n?Xn(n):"";if(r)switch(r){case Ox:return Uh;case wx:return Rh;case $x:return Ih;case Mx:return Nh;case Cx:return Ph}return t});var Ax=Object.prototype,Lx=Ax.hasOwnProperty;function kx(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Lx.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Gs=Be.Uint8Array;function cl(e){var t=new e.constructor(e.byteLength);return new Gs(t).set(new Gs(e)),t}function Dx(e,t){var n=t?cl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Rx=/\w*$/;function Ix(e){var t=new e.constructor(e.source,Rx.exec(e));return t.lastIndex=e.lastIndex,t}var Bh=Me?Me.prototype:void 0,Hh=Bh?Bh.valueOf:void 0;function Nx(e){return Hh?Object(Hh.call(e)):{}}function Vh(e,t){var n=t?cl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Px="[object Boolean]",Ux="[object Date]",Bx="[object Map]",Hx="[object Number]",Vx="[object RegExp]",Gx="[object Set]",zx="[object String]",Fx="[object Symbol]",jx="[object ArrayBuffer]",Wx="[object DataView]",qx="[object Float32Array]",Yx="[object Float64Array]",Xx="[object Int8Array]",Zx="[object Int16Array]",Kx="[object Int32Array]",Qx="[object Uint8Array]",Jx="[object Uint8ClampedArray]",tb="[object Uint16Array]",eb="[object Uint32Array]";function nb(e,t,n){var r=e.constructor;switch(t){case jx:return cl(e);case Px:case Ux:return new r(+e);case Wx:return Dx(e,n);case qx:case Yx:case Xx:case Zx:case Kx:case Qx:case Jx:case tb:case eb:return Vh(e,n);case Bx:return new r;case Hx:case zx:return new r(e);case Vx:return Ix(e);case Gx:return new r;case Fx:return Nx(e)}}function Gh(e){return typeof e.constructor=="function"&&!Ns(e)?f1(il(e)):{}}var rb="[object Map]";function ib(e){return tn(e)&&Ae(e)==rb}var zh=Lr&&Lr.isMap,sb=zh?Qo(zh):ib,ab="[object Set]";function ob(e){return tn(e)&&Ae(e)==ab}var Fh=Lr&&Lr.isSet,lb=Fh?Qo(Fh):ob,cb=1,ub=2,hb=4,jh="[object Arguments]",db="[object Array]",pb="[object Boolean]",fb="[object Date]",mb="[object Error]",Wh="[object Function]",gb="[object GeneratorFunction]",vb="[object Map]",yb="[object Number]",qh="[object Object]",xb="[object RegExp]",bb="[object Set]",_b="[object String]",Eb="[object Symbol]",Sb="[object WeakMap]",Tb="[object ArrayBuffer]",Ob="[object DataView]",wb="[object Float32Array]",$b="[object Float64Array]",Mb="[object Int8Array]",Cb="[object Int16Array]",Ab="[object Int32Array]",Lb="[object Uint8Array]",kb="[object Uint8ClampedArray]",Db="[object Uint16Array]",Rb="[object Uint32Array]",At={};At[jh]=At[db]=At[Tb]=At[Ob]=At[pb]=At[fb]=At[wb]=At[$b]=At[Mb]=At[Cb]=At[Ab]=At[vb]=At[yb]=At[qh]=At[xb]=At[bb]=At[_b]=At[Eb]=At[Lb]=At[kb]=At[Db]=At[Rb]=!0,At[mb]=At[Wh]=At[Sb]=!1;function Ai(e,t,n,r,i,s){var a,o=t&cb,l=t&ub,c=t&hb;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ce(e))return e;var u=Zt(e);if(u){if(a=kx(e),!o)return ah(e,a)}else{var d=Ae(e),h=d==Wh||d==gb;if(Ar(e))return Mh(e,o);if(d==qh||d==jh||h&&!i){if(a=l||h?{}:Gh(e),!o)return l?Sx(e,gx(a,e)):_x(e,mx(a,e))}else{if(!At[d])return i?e:{};a=nb(e,d,o)}}s||(s=new He);var p=s.get(e);if(p)return p;s.set(e,a),lb(e)?e.forEach(function(m){a.add(Ai(m,t,n,m,e,s))}):sb(e)&&e.forEach(function(m,v){a.set(v,Ai(m,t,n,v,e,s))});var f=c?l?Dh:al:l?Oi:Ti,g=u?void 0:f(e);return S1(g||e,function(m,v){g&&(v=m,m=e[v]),lh(a,v,Ai(m,t,n,v,e,s))}),a}var Ib=1,Nb=4;function pn(e){return Ai(e,Ib|Nb)}var Pb="__lodash_hash_undefined__";function Ub(e){return this.__data__.set(e,Pb),this}function Bb(e){return this.__data__.has(e)}function Li(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new dn;++t<n;)this.add(e[t])}Li.prototype.add=Li.prototype.push=Ub,Li.prototype.has=Bb;function Yh(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Xh(e,t){return e.has(t)}var Hb=1,Vb=2;function Zh(e,t,n,r,i,s){var a=n&Hb,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=n&Vb?new Li:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var f=e[d],g=t[d];if(r)var m=a?r(g,f,d,t,e,s):r(f,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(p){if(!Yh(t,function(v,x){if(!Xh(p,x)&&(f===v||i(f,v,n,r,s)))return p.push(x)})){h=!1;break}}else if(!(f===g||i(f,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function Gb(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function ul(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var zb=1,Fb=2,jb="[object Boolean]",Wb="[object Date]",qb="[object Error]",Yb="[object Map]",Xb="[object Number]",Zb="[object RegExp]",Kb="[object Set]",Qb="[object String]",Jb="[object Symbol]",t_="[object ArrayBuffer]",e_="[object DataView]",Kh=Me?Me.prototype:void 0,hl=Kh?Kh.valueOf:void 0;function n_(e,t,n,r,i,s,a){switch(n){case e_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case t_:return!(e.byteLength!=t.byteLength||!s(new Gs(e),new Gs(t)));case jb:case Wb:case Xb:return Ei(+e,+t);case qb:return e.name==t.name&&e.message==t.message;case Zb:case Qb:return e==t+"";case Yb:var o=Gb;case Kb:var l=r&zb;if(o||(o=ul),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=Fb,a.set(e,t);var u=Zh(o(e),o(t),r,i,s,a);return a.delete(e),u;case Jb:if(hl)return hl.call(e)==hl.call(t)}return!1}var r_=1,i_=Object.prototype,s_=i_.hasOwnProperty;function a_(e,t,n,r,i,s){var a=n&r_,o=al(e),l=o.length,c=al(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:s_.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var v=e[h],x=t[h];if(r)var _=a?r(x,v,h,t,e,s):r(v,x,h,e,t,s);if(!(_===void 0?v===x||i(v,x,n,r,s):_)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var E=e.constructor,b=t.constructor;E!=b&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof b=="function"&&b instanceof b)&&(g=!1)}return s.delete(e),s.delete(t),g}var o_=1,Qh="[object Arguments]",Jh="[object Array]",zs="[object Object]",l_=Object.prototype,td=l_.hasOwnProperty;function c_(e,t,n,r,i,s){var a=Zt(e),o=Zt(t),l=a?Jh:Ae(e),c=o?Jh:Ae(t);l=l==Qh?zs:l,c=c==Qh?zs:c;var u=l==zs,d=c==zs,h=l==c;if(h&&Ar(e)){if(!Ar(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new He),a||Ps(e)?Zh(e,t,n,r,i,s):n_(e,t,l,n,r,i,s);if(!(n&o_)){var p=u&&td.call(e,"__wrapped__"),f=d&&td.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return s||(s=new He),i(g,m,n,r,s)}}return h?(s||(s=new He),a_(e,t,n,r,i,s)):!1}function Fs(e,t,n,r,i){return e===t?!0:e==null||t==null||!tn(e)&&!tn(t)?e!==e&&t!==t:c_(e,t,n,r,Fs,i)}var u_=1,h_=2;function d_(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new He,d;if(!(d===void 0?Fs(c,l,u_|h_,r,u):d))return!1}}return!0}function ed(e){return e===e&&!Ce(e)}function p_(e){for(var t=Ti(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ed(i)]}return t}function nd(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function f_(e){var t=p_(e);return t.length==1&&t[0][2]?nd(t[0][0],t[0][1]):function(n){return n===e||d_(n,e,t)}}function m_(e,t){return e!=null&&t in Object(e)}function g_(e,t,n){t=Hs(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Ci(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Ko(i)&&Xo(a,i)&&(Zt(e)||Cr(e)))}function v_(e,t){return e!=null&&g_(e,t,m_)}var y_=1,x_=2;function b_(e,t){return tl(e)&&ed(t)?nd(Ci(e),t):function(n){var r=yt(n,e);return r===void 0&&r===t?v_(n,e):Fs(t,r,y_|x_)}}function __(e){return function(t){return t==null?void 0:t[e]}}function E_(e){return function(t){return nl(t,e)}}function S_(e){return tl(e)?__(Ci(e)):E_(e)}function js(e){return typeof e=="function"?e:e==null?jo:typeof e=="object"?Zt(e)?b_(e[0],e[1]):f_(e):S_(e)}function T_(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var rd=T_();function dl(e,t,n){(n!==void 0&&!Ei(e[t],n)||n===void 0&&!(t in e))&&Is(e,t,n)}function pl(e){return tn(e)&&Kn(e)}function fl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function O_(e){return Mr(e,Oi(e))}function w_(e,t,n,r,i,s,a){var o=fl(e,n),l=fl(t,n),c=a.get(l);if(c){dl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Zt(l),p=!h&&Ar(l),f=!h&&!p&&Ps(l);u=l,h||p||f?Zt(o)?u=o:pl(o)?u=ah(o):p?(d=!1,u=Mh(l,!0)):f?(d=!1,u=Vh(l,!0)):u=[]:Sh(l)||Cr(l)?(u=o,Cr(o)?u=O_(o):(!Ce(o)||Wo(o))&&(u=Gh(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),dl(e,n,u)}function id(e,t,n,r,i){e!==t&&rd(t,function(s,a){if(i||(i=new He),Ce(s))w_(e,t,a,n,id,r,i);else{var o=r?r(fl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),dl(e,a,o)}},Oi)}function sd(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var $_="[object Map]",M_="[object Set]",C_=Object.prototype,A_=C_.hasOwnProperty;function Ve(e){if(e==null)return!0;if(Kn(e)&&(Zt(e)||typeof e=="string"||typeof e.splice=="function"||Ar(e)||Ps(e)||Cr(e)))return!e.length;var t=Ae(e);if(t==$_||t==M_)return!e.size;if(Ns(e))return!bh(e).length;for(var n in e)if(A_.call(e,n))return!1;return!0}var at=I1(function(e,t,n){id(e,t,n)}),L_=1/0,k_=kr&&1/ul(new kr([,-0]))[1]==L_?function(e){return new kr(e)}:g1,D_=200;function ad(e,t,n){var r=-1,i=M1,s=e.length,a=!0,o=[],l=o;if(s>=D_){var c=t?null:k_(e);if(c)return ul(c);a=!1,i=Xh,l=new Li}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var R_=Zo(function(e){var t=sd(e);return pl(t)&&(t=void 0),ad(Vs(e,1,pl,!0),js(t))});function ki(e){return e&&e.length?ad(e):[]}function Jn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function I_(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ml(e){let t,n,r;e.length!==2?(t=Jn,n=(o,l)=>Jn(e(o),l),r=(o,l)=>e(o)-l):(t=e===Jn||e===I_?e:N_,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function N_(){return 0}function P_(e){return e===null?NaN:+e}function*U_(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const B_=ml(Jn),gl=B_.right;ml(P_).center;function Ge(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}let od=class extends Map{constructor(t,n=G_){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(ld(this,t))}has(t){return super.has(ld(this,t))}set(t,n){return super.set(H_(this,t),n)}delete(t){return super.delete(V_(this,t))}};function ld({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function H_({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function V_({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function G_(e){return e!==null&&typeof e=="object"?e.valueOf():e}const z_=Math.sqrt(50),F_=Math.sqrt(10),j_=Math.sqrt(2);function Ws(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=z_?10:s>=F_?5:s>=j_?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Ws(e,t,n*2):[o,l,c]}function qs(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Ws(t,e,n):Ws(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function Dr(e,t,n){return t=+t,e=+e,n=+n,Ws(e,t,n)[2]}function vl(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Dr(t,e,n):Dr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function tr(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Rn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var W_={value:()=>{}};function yl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ys(n)}function Ys(e){this._=e}function q_(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ys.prototype=yl.prototype={constructor:Ys,on:function(e,t){var n=this._,r=q_(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=Y_(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=cd(n[i],e.name,t);else if(t==null)for(i in n)n[i]=cd(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ys(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function Y_(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function cd(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=W_,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var xl="http://www.w3.org/1999/xhtml";const ud={svg:"http://www.w3.org/2000/svg",xhtml:xl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Xs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ud.hasOwnProperty(t)?{space:ud[t],local:e}:e}function X_(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===xl&&t.documentElement.namespaceURI===xl?t.createElement(e):t.createElementNS(n,e)}}function Z_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hd(e){var t=Xs(e);return(t.local?Z_:X_)(t)}function K_(){}function bl(e){return e==null?K_:function(){return this.querySelector(e)}}function Q_(e){typeof e!="function"&&(e=bl(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new ye(r,this._parents)}function J_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function tE(){return[]}function dd(e){return e==null?tE:function(){return this.querySelectorAll(e)}}function eE(e){return function(){return J_(e.apply(this,arguments))}}function nE(e){typeof e=="function"?e=eE(e):e=dd(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new ye(r,i)}function pd(e){return function(){return this.matches(e)}}function fd(e){return function(t){return t.matches(e)}}var rE=Array.prototype.find;function iE(e){return function(){return rE.call(this.children,e)}}function sE(){return this.firstElementChild}function aE(e){return this.select(e==null?sE:iE(typeof e=="function"?e:fd(e)))}var oE=Array.prototype.filter;function lE(){return Array.from(this.children)}function cE(e){return function(){return oE.call(this.children,e)}}function uE(e){return this.selectAll(e==null?lE:cE(typeof e=="function"?e:fd(e)))}function hE(e){typeof e!="function"&&(e=pd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new ye(r,this._parents)}function md(e){return new Array(e.length)}function dE(){return new ye(this._enter||this._groups.map(md),this._parents)}function Zs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zs.prototype={constructor:Zs,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function pE(e){return function(){return e}}function fE(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new Zs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function mE(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),p;for(o=0;o<u;++o)(l=t[o])&&(h[o]=p=a.call(l,l.__data__,o,t)+"",c.has(p)?i[o]=l:c.set(p,l));for(o=0;o<d;++o)p=a.call(e,s[o],o,s)+"",(l=c.get(p))?(r[o]=l,l.__data__=s[o],c.delete(p)):n[o]=new Zs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function gE(e){return e.__data__}function vE(e,t){if(!arguments.length)return Array.from(this,gE);var n=t?mE:fE,r=this._parents,i=this._groups;typeof e!="function"&&(e=pE(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,p=yE(e.call(u,u&&u.__data__,c,r)),f=p.length,g=o[c]=new Array(f),m=a[c]=new Array(f),v=l[c]=new Array(h);n(u,d,g,m,v,p,t);for(var x=0,_=0,E,b;x<f;++x)if(E=g[x]){for(x>=_&&(_=x+1);!(b=m[_])&&++_<f;);E._next=b||null}}return a=new ye(a,r),a._enter=o,a._exit=l,a}function yE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xE(){return new ye(this._exit||this._groups.map(md),this._parents)}function bE(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function _E(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),p,f=0;f<d;++f)(p=c[f]||u[f])&&(h[f]=p);for(;l<i;++l)o[l]=n[l];return new ye(o,this._parents)}function EE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function SE(e){e||(e=TE);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new ye(i,this._parents).order()}function TE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function OE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wE(){return Array.from(this)}function $E(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function ME(){let e=0;for(const t of this)++e;return e}function CE(){return!this.node()}function AE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function LE(e){return function(){this.removeAttribute(e)}}function kE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function DE(e,t){return function(){this.setAttribute(e,t)}}function RE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function IE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function NE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function PE(e,t){var n=Xs(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?kE:LE:typeof t=="function"?n.local?NE:IE:n.local?RE:DE)(n,t))}function gd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function UE(e){return function(){this.style.removeProperty(e)}}function BE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function HE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function VE(e,t,n){return arguments.length>1?this.each((t==null?UE:typeof t=="function"?HE:BE)(e,t,n??"")):Rr(this.node(),e)}function Rr(e,t){return e.style.getPropertyValue(t)||gd(e).getComputedStyle(e,null).getPropertyValue(t)}function GE(e){return function(){delete this[e]}}function zE(e,t){return function(){this[e]=t}}function FE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function jE(e,t){return arguments.length>1?this.each((t==null?GE:typeof t=="function"?FE:zE)(e,t)):this.node()[e]}function vd(e){return e.trim().split(/^|\s+/)}function _l(e){return e.classList||new yd(e)}function yd(e){this._node=e,this._names=vd(e.getAttribute("class")||"")}yd.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function xd(e,t){for(var n=_l(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function bd(e,t){for(var n=_l(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function WE(e){return function(){xd(this,e)}}function qE(e){return function(){bd(this,e)}}function YE(e,t){return function(){(t.apply(this,arguments)?xd:bd)(this,e)}}function XE(e,t){var n=vd(e+"");if(arguments.length<2){for(var r=_l(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?YE:t?WE:qE)(n,t))}function ZE(){this.textContent=""}function KE(e){return function(){this.textContent=e}}function QE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function JE(e){return arguments.length?this.each(e==null?ZE:(typeof e=="function"?QE:KE)(e)):this.node().textContent}function tS(){this.innerHTML=""}function eS(e){return function(){this.innerHTML=e}}function nS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function rS(e){return arguments.length?this.each(e==null?tS:(typeof e=="function"?nS:eS)(e)):this.node().innerHTML}function iS(){this.nextSibling&&this.parentNode.appendChild(this)}function sS(){return this.each(iS)}function aS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function oS(){return this.each(aS)}function lS(e){var t=typeof e=="function"?e:hd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function cS(){return null}function uS(e,t){var n=typeof e=="function"?e:hd(e),r=t==null?cS:typeof t=="function"?t:bl(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function hS(){var e=this.parentNode;e&&e.removeChild(this)}function dS(){return this.each(hS)}function pS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fS(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mS(e){return this.select(e?fS:pS)}function gS(e){return arguments.length?this.property("__data__",e):this.node().__data__}function vS(e){return function(t){e.call(this,t,this.__data__)}}function yS(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function xS(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function bS(e,t,n){return function(){var r=this.__on,i,s=vS(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function _S(e,t,n){var r=yS(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?bS:xS,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function _d(e,t,n){var r=gd(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function ES(e,t){return function(){return _d(this,e,t)}}function SS(e,t){return function(){return _d(this,e,t.apply(this,arguments))}}function TS(e,t){return this.each((typeof t=="function"?SS:ES)(e,t))}function*OS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var Ed=[null];function ye(e,t){this._groups=e,this._parents=t}function Di(){return new ye([[document.documentElement]],Ed)}function wS(){return this}ye.prototype=Di.prototype={constructor:ye,select:Q_,selectAll:nE,selectChild:aE,selectChildren:uE,filter:hE,data:vE,enter:dE,exit:xE,join:bE,merge:_E,selection:wS,order:EE,sort:SE,call:OE,nodes:wE,node:$E,size:ME,empty:CE,each:AE,attr:PE,style:VE,property:jE,classed:XE,text:JE,html:rS,raise:sS,lower:oS,append:lS,insert:uS,remove:dS,clone:mS,datum:gS,on:_S,dispatch:TS,[Symbol.iterator]:OS};function $S(e){let t;for(;t=e.sourceEvent;)e=t;return e}function er(e,t){if(e=$S(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function El(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Sd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ri(){}var Ii=.7,Ks=1/Ii,Ir="\\s*([+-]?\\d+)\\s*",Ni="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",en="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",MS=/^#([0-9a-f]{3,8})$/,CS=new RegExp(`^rgb\\(${Ir},${Ir},${Ir}\\)$`),AS=new RegExp(`^rgb\\(${en},${en},${en}\\)$`),LS=new RegExp(`^rgba\\(${Ir},${Ir},${Ir},${Ni}\\)$`),kS=new RegExp(`^rgba\\(${en},${en},${en},${Ni}\\)$`),DS=new RegExp(`^hsl\\(${Ni},${en},${en}\\)$`),RS=new RegExp(`^hsla\\(${Ni},${en},${en},${Ni}\\)$`),Td={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};El(Ri,fn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Od,formatHex:Od,formatHex8:IS,formatHsl:NS,formatRgb:wd,toString:wd});function Od(){return this.rgb().formatHex()}function IS(){return this.rgb().formatHex8()}function NS(){return Ld(this).formatHsl()}function wd(){return this.rgb().formatRgb()}function fn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=MS.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?$d(t):n===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=CS.exec(e))?new he(t[1],t[2],t[3],1):(t=AS.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LS.exec(e))?Qs(t[1],t[2],t[3],t[4]):(t=kS.exec(e))?Qs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=DS.exec(e))?Ad(t[1],t[2]/100,t[3]/100,1):(t=RS.exec(e))?Ad(t[1],t[2]/100,t[3]/100,t[4]):Td.hasOwnProperty(e)?$d(Td[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function $d(e){return new he(e>>16&255,e>>8&255,e&255,1)}function Qs(e,t,n,r){return r<=0&&(e=t=n=NaN),new he(e,t,n,r)}function PS(e){return e instanceof Ri||(e=fn(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function Sl(e,t,n,r){return arguments.length===1?PS(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}El(he,Sl,Sd(Ri,{brighter(e){return e=e==null?Ks:Math.pow(Ks,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ii:Math.pow(Ii,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(nr(this.r),nr(this.g),nr(this.b),Js(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Md,formatHex:Md,formatHex8:US,formatRgb:Cd,toString:Cd}));function Md(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function US(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cd(){const e=Js(this.opacity);return`${e===1?"rgb(":"rgba("}${nr(this.r)}, ${nr(this.g)}, ${nr(this.b)}${e===1?")":`, ${e})`}`}function Js(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rr(e){return e=nr(e),(e<16?"0":"")+e.toString(16)}function Ad(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ze(e,t,n,r)}function Ld(e){if(e instanceof ze)return new ze(e.h,e.s,e.l,e.opacity);if(e instanceof Ri||(e=fn(e)),!e)return new ze;if(e instanceof ze)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new ze(a,o,l,e.opacity)}function kd(e,t,n,r){return arguments.length===1?Ld(e):new ze(e,t,n,r??1)}function ze(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}El(ze,kd,Sd(Ri,{brighter(e){return e=e==null?Ks:Math.pow(Ks,e),new ze(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ii:Math.pow(Ii,e),new ze(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new he(Tl(e>=240?e-240:e+120,i,r),Tl(e,i,r),Tl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ze(Dd(this.h),ta(this.s),ta(this.l),Js(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Js(this.opacity);return`${e===1?"hsl(":"hsla("}${Dd(this.h)}, ${ta(this.s)*100}%, ${ta(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Dd(e){return e=(e||0)%360,e<0?e+360:e}function ta(e){return Math.max(0,Math.min(1,e||0))}function Tl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ol=e=>()=>e;function BS(e,t){return function(n){return e+n*t}}function HS(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function VS(e){return(e=+e)==1?Rd:function(t,n){return n-t?HS(t,n,e):Ol(isNaN(t)?n:t)}}function Rd(e,t){var n=t-e;return n?BS(e,n):Ol(isNaN(e)?t:e)}const ea=function e(t){var n=VS(t);function r(i,s){var a=n((i=Sl(i)).r,(s=Sl(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Rd(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function GS(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function zS(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function FS(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=Pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function jS(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function WS(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Pi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var wl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$l=new RegExp(wl.source,"g");function qS(e){return function(){return e}}function YS(e){return function(t){return e(t)+""}}function Id(e,t){var n=wl.lastIndex=$l.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=wl.exec(e))&&(i=$l.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:xe(r,i)})),n=$l.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?YS(l[0].x):qS(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Pi(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ol(t):(n==="number"?xe:n==="string"?(r=fn(t))?(t=r,ea):Id:t instanceof fn?ea:t instanceof Date?jS:zS(t)?GS:Array.isArray(t)?FS:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?WS:xe)(e,t)}function Nd(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Pd=180/Math.PI,Ud={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bd(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Pd,skewX:Math.atan(l)*Pd,scaleX:a,scaleY:o}}var na;function XS(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ud:Bd(t.a,t.b,t.c,t.d,t.e,t.f)}function ZS(e){return e==null||(na||(na=document.createElementNS("http://www.w3.org/2000/svg","g")),na.setAttribute("transform",e),!(e=na.transform.baseVal.consolidate()))?Ud:(e=e.matrix,Bd(e.a,e.b,e.c,e.d,e.e,e.f))}function Hd(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push("translate(",null,t,null,n);f.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:xe(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:xe(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push(i(p)+"scale(",null,",",null,")");f.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d!==1||h!==1)&&p.push(i(p)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(p){for(var f=-1,g=h.length,m;++f<g;)d[(m=h[f]).i]=m.x(p);return d.join("")}}}var KS=Hd(XS,"px, ","px)","deg)"),QS=Hd(ZS,", ",")",")"),Nr=0,Ui=0,Bi=0,Vd=1e3,ra,Hi,ia=0,ir=0,sa=0,Vi=typeof performance=="object"&&performance.now?performance:Date,Gd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ml(){return ir||(Gd(JS),ir=Vi.now()+sa)}function JS(){ir=0}function aa(){this._call=this._time=this._next=null}aa.prototype=zd.prototype={constructor:aa,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ml():+n)+(t==null?0:+t),!this._next&&Hi!==this&&(Hi?Hi._next=this:ra=this,Hi=this),this._call=e,this._time=n,Cl()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cl())}};function zd(e,t,n){var r=new aa;return r.restart(e,t,n),r}function tT(){Ml(),++Nr;for(var e=ra,t;e;)(t=ir-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nr}function Fd(){ir=(ia=Vi.now())+sa,Nr=Ui=0;try{tT()}finally{Nr=0,nT(),ir=0}}function eT(){var e=Vi.now(),t=e-ia;t>Vd&&(sa-=t,ia=e)}function nT(){for(var e,t=ra,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ra=n);Hi=e,Cl(r)}function Cl(e){if(!Nr){Ui&&(Ui=clearTimeout(Ui));var t=e-ir;t>24?(e<1/0&&(Ui=setTimeout(Fd,e-Vi.now()-sa)),Bi&&(Bi=clearInterval(Bi))):(Bi||(ia=Vi.now(),Bi=setInterval(eT,Vd)),Nr=1,Gd(Fd))}}function jd(e,t,n){var r=new aa;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var rT=yl("start","end","cancel","interrupt"),iT=[],Wd=0,qd=1,Al=2,oa=3,Yd=4,Ll=5,la=6;function ca(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;sT(e,n,{name:t,index:r,group:i,on:rT,tween:iT,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Wd})}function kl(e,t){var n=Fe(e,t);if(n.state>Wd)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Fe(e,t);if(n.state>oa)throw new Error("too late; already running");return n}function Fe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function sT(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zd(s,0,n.time);function s(c){n.state=qd,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,p;if(n.state!==qd)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===oa)return jd(a);p.state===Yd?(p.state=la,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=la,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(jd(function(){n.state===oa&&(n.state=Yd,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Al,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Al){for(n.state=oa,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Ll,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Ll&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=la,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Dl(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Al&&r.state<Ll,r.state=la,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function aT(e){return this.each(function(){Dl(this,e)})}function oT(e,t){var n,r;return function(){var i=nn(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function lT(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=nn(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function cT(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Fe(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?oT:lT)(n,e,t))}function Rl(e,t,n){var r=e._id;return e.each(function(){var i=nn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Fe(i,r).value[t]}}function Xd(e,t){var n;return(typeof t=="number"?xe:t instanceof fn?ea:(n=fn(t))?(t=n,ea):Id)(e,t)}function uT(e){return function(){this.removeAttribute(e)}}function hT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dT(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function pT(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function fT(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function mT(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function gT(e,t){var n=Xs(e),r=n==="transform"?QS:Xd;return this.attrTween(e,typeof t=="function"?(n.local?mT:fT)(n,r,Rl(this,"attr."+e,t)):t==null?(n.local?hT:uT)(n):(n.local?pT:dT)(n,r,t))}function vT(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function yT(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function xT(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&yT(e,s)),n}return i._value=t,i}function bT(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&vT(e,s)),n}return i._value=t,i}function _T(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Xs(e);return this.tween(n,(r.local?xT:bT)(r,t))}function ET(e,t){return function(){kl(this,e).delay=+t.apply(this,arguments)}}function ST(e,t){return t=+t,function(){kl(this,e).delay=t}}function TT(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ET:ST)(t,e)):Fe(this.node(),t).delay}function OT(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function wT(e,t){return t=+t,function(){nn(this,e).duration=t}}function $T(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OT:wT)(t,e)):Fe(this.node(),t).duration}function MT(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function CT(e){var t=this._id;return arguments.length?this.each(MT(t,e)):Fe(this.node(),t).ease}function AT(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function LT(e){if(typeof e!="function")throw new Error;return this.each(AT(this._id,e))}function kT(e){typeof e!="function"&&(e=pd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new mn(r,this._parents,this._name,this._id)}function DT(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,p=0;p<u;++p)(h=l[p]||c[p])&&(d[p]=h);for(;o<r;++o)a[o]=t[o];return new mn(a,this._parents,this._name,this._id)}function RT(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function IT(e,t,n){var r,i,s=RT(t)?kl:nn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function NT(e,t){var n=this._id;return arguments.length<2?Fe(this.node(),n).on.on(e):this.each(IT(n,e,t))}function PT(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function UT(){return this.on("end.remove",PT(this._id))}function BT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bl(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,ca(c[h],t,n,h,c,Fe(u,n)));return new mn(s,this._parents,t,n)}function HT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=dd(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),p,f=Fe(u,n),g=0,m=h.length;g<m;++g)(p=h[g])&&ca(p,t,n,g,h,f);s.push(h),a.push(u)}return new mn(s,a,t,n)}var VT=Di.prototype.constructor;function GT(){return new VT(this._groups,this._parents)}function zT(e,t){var n,r,i;return function(){var s=Rr(this,e),a=(this.style.removeProperty(e),Rr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Zd(e){return function(){this.style.removeProperty(e)}}function FT(e,t,n){var r,i=n+"",s;return function(){var a=Rr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function jT(e,t,n){var r,i,s;return function(){var a=Rr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Rr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function WT(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=nn(this,e),c=l.on,u=l.value[s]==null?o||(o=Zd(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function qT(e,t,n){var r=(e+="")=="transform"?KS:Xd;return t==null?this.styleTween(e,zT(e,r)).on("end.style."+e,Zd(e)):typeof t=="function"?this.styleTween(e,jT(e,r,Rl(this,"style."+e,t))).each(WT(this._id,e)):this.styleTween(e,FT(e,r,t),n).on("end.style."+e,null)}function YT(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function XT(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&YT(e,a,n)),r}return s._value=t,s}function ZT(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,XT(e,t,n??""))}function KT(e){return function(){this.textContent=e}}function QT(e){return function(){var t=e(this);this.textContent=t??""}}function JT(e){return this.tween("text",typeof e=="function"?QT(Rl(this,"text",e)):KT(e==null?"":e+""))}function tO(e){return function(t){this.textContent=e.call(this,t)}}function eO(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&tO(i)),t}return r._value=e,r}function nO(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,eO(e))}function rO(){for(var e=this._name,t=this._id,n=Kd(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Fe(l,t);ca(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new mn(r,this._parents,e,n)}function iO(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=nn(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var sO=0;function mn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Kd(){return++sO}var gn=Di.prototype;mn.prototype={constructor:mn,select:BT,selectAll:HT,selectChild:gn.selectChild,selectChildren:gn.selectChildren,filter:kT,merge:DT,selection:GT,transition:rO,call:gn.call,nodes:gn.nodes,node:gn.node,size:gn.size,empty:gn.empty,each:gn.each,on:NT,attr:gT,attrTween:_T,style:qT,styleTween:ZT,text:JT,textTween:nO,remove:UT,tween:cT,delay:TT,duration:$T,ease:CT,easeVarying:LT,end:iO,[Symbol.iterator]:gn[Symbol.iterator]};function Qd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var aO={time:null,delay:0,duration:250,ease:Qd};function oO(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function lO(e){var t,n;e instanceof mn?(t=e._id,e=e._name):(t=Kd(),(n=aO).time=Ml(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&ca(l,e,t,c,a,n||oO(l,t));return new mn(r,this._parents,e,t)}Di.prototype.interrupt=aT,Di.prototype.transition=lO;function cO(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ua(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pr(e){return e=ua(Math.abs(e)),e?e[1]:NaN}function uO(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function hO(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var dO=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gi(e){if(!(t=dO.exec(e)))throw new Error("invalid format: "+e);var t;return new Il({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Gi.prototype=Il.prototype;function Il(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Il.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function pO(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Jd;function fO(e,t){var n=ua(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Jd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+ua(e,Math.max(0,t+s-1))[0]}function tp(e,t){var n=ua(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const ep={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:cO,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>tp(e*100,t),r:tp,s:fO,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function np(e){return e}var rp=Array.prototype.map,ip=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mO(e){var t=e.grouping===void 0||e.thousands===void 0?np:uO(rp.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?np:hO(rp.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Gi(d);var h=d.fill,p=d.align,f=d.sign,g=d.symbol,m=d.zero,v=d.width,x=d.comma,_=d.precision,E=d.trim,b=d.type;b==="n"?(x=!0,b="g"):ep[b]||(_===void 0&&(_=12),E=!0,b="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var T=g==="$"?n:g==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",M=g==="$"?r:/[%p]/.test(b)?a:"",D=ep[b],A=/[defgprs%]/.test(b);_=_===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function R($){var H=T,P=M,B,S,w;if(b==="c")P=D($)+P,$="";else{$=+$;var L=$<0||1/$<0;if($=isNaN($)?l:D(Math.abs($),_),E&&($=pO($)),L&&+$==0&&f!=="+"&&(L=!1),H=(L?f==="("?f:o:f==="-"||f==="("?"":f)+H,P=(b==="s"?ip[8+Jd/3]:"")+P+(L&&f==="("?")":""),A){for(B=-1,S=$.length;++B<S;)if(w=$.charCodeAt(B),48>w||w>57){P=(w===46?i+$.slice(B+1):$.slice(B))+P,$=$.slice(0,B);break}}}x&&!m&&($=t($,1/0));var k=H.length+$.length+P.length,U=k<v?new Array(v-k+1).join(h):"";switch(x&&m&&($=t(U+$,U.length?v-P.length:1/0),U=""),p){case"<":$=H+$+P+U;break;case"=":$=H+U+$+P;break;case"^":$=U.slice(0,k=U.length>>1)+H+$+P+U.slice(k);break;default:$=U+H+$+P;break}return s($)}return R.toString=function(){return d+""},R}function u(d,h){var p=c((d=Gi(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Pr(h)/3)))*3,g=Math.pow(10,-f),m=ip[8+f/3];return function(v){return p(g*v)+m}}return{format:c,formatPrefix:u}}var ha,Nl,sp;gO({thousands:",",grouping:[3],currency:["$",""]});function gO(e){return ha=mO(e),Nl=ha.format,sp=ha.formatPrefix,ha}function vO(e){return Math.max(0,-Pr(Math.abs(e)))}function yO(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pr(t)/3)))*3-Pr(Math.abs(e)))}function xO(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pr(t)-Pr(e))+1}function Ur(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const ap=Symbol("implicit");function da(){var e=new od,t=[],n=[],r=ap;function i(s){let a=e.get(s);if(a===void 0){if(r!==ap)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new od;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return da(t,n).unknown(r)},Ur.apply(i,arguments),i}function bO(e){return function(){return e}}function _O(e){return+e}var op=[0,1];function Br(e){return e}function Pl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:bO(isNaN(t)?NaN:.5)}function EO(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function SO(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Pl(i,r),s=n(a,s)):(r=Pl(r,i),s=n(s,a)),function(o){return s(r(o))}}function TO(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Pl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=gl(e,o,1,r)-1;return s[l](i[l](o))}}function Ul(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function lp(){var e=op,t=op,n=Pi,r,i,s,a=Br,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Br&&(a=EO(e[0],e[h-1])),o=h>2?TO:SO,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),xe)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,_O),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Nd,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Br,u()):a!==Br},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,p){return r=h,i=p,u()}}function cp(){return lp()(Br,Br)}function OO(e,t,n,r){var i=vl(e,t,n),s;switch(r=Gi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=yO(i,a))&&(r.precision=s),sp(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=xO(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=vO(i))&&(r.precision=s-(r.type==="%")*2);break}}return Nl(r)}function up(e){var t=e.domain;return e.ticks=function(n){var r=t();return qs(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return OO(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=Dr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function je(){var e=cp();return e.copy=function(){return Ul(e,je())},Ur.apply(e,arguments),up(e)}function Bl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[gl(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Bl().domain([e,t]).range(i).unknown(s)},Ur.apply(up(a),arguments)}function zi(e,t,n){this.k=e,this.x=t,this.y=n}zi.prototype={constructor:zi,scale:function(e){return e===1?this:new zi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new zi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},zi.prototype;const de="cds",vn={opacity:{unselected:.05,selected:.4}},In={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Hr={duration:1e3,ease:Qd,zoomLevel:3},Vr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},hp={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Le={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},wO={defaultBins:10},Nt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},yn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Kt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Lt={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},sr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},We={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},dp={minCellDividerDimension:16},pp={default:{size:24}},fp={defaultOffset:4,horizontalOffset:10},mp={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},be={height:{[Ue.GRAPH_VIEW]:32,[Ue.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},$O=[{type:jt.RADIUS,name:"Radius"},{type:jt.AREA,name:"Poor area"},{type:jt.AREA,name:"Satisfactory area"},{type:jt.AREA,name:"Great area"},{type:jt.QUARTILE,name:"Quartiles"}],Gr={type:we.END_LINE,threshold:16,numCharacter:14},MO={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},CO={enabled:!0,position:Or.BOTTOM,clickable:!0,truncation:Gr,alignment:zt.LEFT,order:null,additionalItems:[]},AO={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},LO={enabled:!0},gp={enabled:!0,showTotal:!0,truncation:Gr,groupLabel:"Group"},vp={top:{visible:!0,includeZero:!0,truncation:Gr},bottom:{visible:!0,includeZero:!0,truncation:Gr},left:{visible:!0,includeZero:!0,truncation:Gr},right:{visible:!0,includeZero:!0,truncation:Gr}},pa={addSpaceOnEdges:1,showDayName:!1,localeObject:Ku,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let yp=!1;try{yp=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const Jt={width:null,height:null,resizable:!0,theme:Go.WHITE,tooltip:gp,legend:CO,locale:MO,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:bt.SHOW_AS_DATATABLE},...yp?[{type:bt.MAKE_FULLSCREEN}]:[],{type:bt.EXPORT_CSV},{type:bt.EXPORT_PNG},{type:bt.EXPORT_JPG}]}},xp=at({},Jt,{thematic:{projection:Je.geoNaturalEarth1}}),Fi=at({},Jt,{axes:vp,timeScale:pa,grid:AO,ruler:LO,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ue.GRAPH_VIEW}}}),ar=at({},Fi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:at(pa,{addSpaceOnEdges:1})}),kO=at({},ar,{}),DO=at({},ar,{}),RO=at({},ar,{bars:at({},ar.bars,{dividerSize:1.5})}),IO=at({},ar,{}),Hl=at({},Fi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),NO=Hl,bp=at({},Hl,{points:{radius:3,filled:!1,enabled:!0}}),_p=at({},bp,{timeScale:at(pa,{addSpaceOnEdges:0})}),PO=_p,UO=at({},Fi,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:jt.RADIUS,name:"Radius"}]}}),BO=at({},Fi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:jt.AREA,name:"Poor area"},{type:jt.AREA,name:"Satisfactory area"},{type:jt.AREA,name:"Great area"},{type:jt.QUARTILE,name:"Quartiles"}]}}),HO=at({},ar,{bars:{dividerSize:1.5},timeScale:at(pa,{addSpaceOnEdges:0})}),VO=at({},Jt,{tooltip:at({},gp,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),Ep=at({},Jt,{pie:{labels:{formatter:null,enabled:!0},alignment:zt.LEFT,sortFunction:null,valueMapsTo:"value"}}),GO=at({},Jt,{legend:{enabled:!1},gauge:{type:Wn.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:zt.LEFT}}),zO=at({},Ep,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:zt.LEFT}}),Sp=at({},Jt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),FO=at({},Sp,{legend:{enabled:!0}}),jO=at({},Jt,{radar:{axes:{angle:"key",value:"value"},alignment:zt.LEFT},tooltip:{gridline:{enabled:!0}}}),WO=at({},ar,{comboChartTypes:[]}),qO=at({tree:{type:Cs.TREE}},Jt,{}),YO=at({},Jt,{data:at(Jt.data,{groupMapsTo:"name"})}),XO=at({},Jt,Vr,{data:at(Jt.data,{groupMapsTo:"name"})}),ZO=at({},Jt,{alluvial:{data:at(Jt.data,{groupMapsTo:"source"}),nodeAlignment:zt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),KO=at({},Jt,{axes:vp,heatmap:{divider:{state:$r.AUTO},colorLegend:{type:"linear"}}}),QO=at({},xp,{choropleth:{colorLegend:{type:"linear"}}}),Ct={alluvialChart:ZO,areaChart:_p,axisChart:Fi,boxplotChart:IO,bubbleChart:UO,bulletChart:BO,chart:Jt,circlePackChart:XO,choroplethChart:QO,comboChart:WO,donutChart:zO,gaugeChart:GO,groupedBarChart:DO,heatmapChart:KO,histogramChart:HO,lineChart:bp,lollipopChart:NO,meterChart:Sp,pieChart:Ep,proportionalMeterChart:FO,radarChart:jO,scatterChart:Hl,simpleBarChart:kO,stackedAreaChart:PO,stackedBarChart:RO,thematicChart:xp,treeChart:qO,treemapChart:YO,wordCloudChart:VO};function JO(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=er(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Rt(e,t){var n;const r=pn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===nt.TIME?a.mapsTo="date":l===nt.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return Gl(r,t),at(r,t)}function xn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function ji(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function Vl(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function Wi(e,t,n){if(n>e.length)return e;if(t===we.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===we.FRONT_LINE)return"..."+e.substr(-n);if(t===we.END_LINE)return e.substr(0,n)+"..."}function Gl(e,t){const n=y(e,"legend","additionalItems"),r=y(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=$O.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=R_(a,r,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},Tp=(e,t)=>t===Gt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ie=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Tp(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function bn(e,t,n){return n===Gt.VERTICAL?[e,t]:[t,e]}function Op(e){const t=Pt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function wp(e,t){const n=Pt(e,void 0);return n.setHours(0,0,0,0),n}function $p(e,t,n){const[r,i]=qn(void 0,e,t),s=wp(r),a=wp(i),o=+s-Op(s),l=+a-Op(a);return Math.round((o-l)/h0)}function tw(e,t){const n=Pt(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ew(e,t){const n=Pt(e,void 0);return $p(n,tw(n))+1}function fa(e,t){return bi(e,{...t,weekStartsOn:1})}function Mp(e,t){const n=Pt(e,void 0),r=n.getFullYear(),i=$e(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=fa(i),a=$e(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=fa(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function nw(e,t){const n=Mp(e),r=$e(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),fa(r)}function rw(e,t){const n=Pt(e,void 0),r=+fa(n)-+nw(n);return Math.round(r/qu)+1}function Cp(e,t){var n,r,i,s;const a=Pt(e,t==null?void 0:t.in),o=a.getFullYear(),l=ks(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(i=l.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,u=$e((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=bi(u,t),h=$e((t==null?void 0:t.in)||e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=bi(h,t);return+a>=+d?o+1:+a>=+p?o:o-1}function iw(e,t){var n,r,i,s;const a=ks(),o=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,l=Cp(e,t),c=$e((t==null?void 0:t.in)||e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),bi(c,t)}function sw(e,t){const n=Pt(e,t==null?void 0:t.in),r=+bi(n,t)-+iw(n,t);return Math.round(r/qu)+1}function St(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Nn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return St(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):St(n+1,2)},d(e,t){return St(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return St(e.getHours()%12||12,t.length)},H(e,t){return St(e.getHours(),t.length)},m(e,t){return St(e.getMinutes(),t.length)},s(e,t){return St(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return St(i,t.length)}},zr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ap={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Nn.y(e,t)},Y:function(e,t,n,r){const i=Cp(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return St(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):St(s,t.length)},R:function(e,t){const n=Mp(e);return St(n,t.length)},u:function(e,t){const n=e.getFullYear();return St(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return St(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return St(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Nn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return St(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=sw(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):St(i,t.length)},I:function(e,t,n){const r=rw(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):St(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Nn.d(e,t)},D:function(e,t,n){const r=ew(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):St(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return St(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return St(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return St(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=zr.noon:r===0?i=zr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=zr.evening:r>=12?i=zr.afternoon:r>=4?i=zr.morning:i=zr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Nn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Nn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Nn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Nn.s(e,t)},S:function(e,t){return Nn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return kp(r);case"XXXX":case"XX":return or(r);case"XXXXX":case"XXX":default:return or(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return kp(r);case"xxxx":case"xx":return or(r);case"xxxxx":case"xxx":default:return or(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Lp(r,":");case"OOOO":default:return"GMT"+or(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Lp(r,":");case"zzzz":default:return"GMT"+or(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return St(r,t.length)},T:function(e,t,n){return St(+e,t.length)}};function Lp(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+St(s,2)}function kp(e,t){return e%60===0?(e>0?"-":"+")+St(Math.abs(e)/60,2):or(e,t)}function or(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=St(Math.trunc(r/60),2),s=St(r%60,2);return n+i+t+s}const Dp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Rp=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},aw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Dp(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Dp(r,t)).replace("{{time}}",Rp(i,t))},ow={p:Rp,P:aw},lw=/^D+$/,cw=/^Y+$/,uw=["D","DD","YY","YYYY"];function hw(e){return lw.test(e)}function dw(e){return cw.test(e)}function pw(e,t,n){const r=fw(e,t,n);if(console.warn(r),uw.includes(e))throw new RangeError(r)}function fw(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function mw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function gw(e){return!(!mw(e)&&typeof e!="number"||isNaN(+Pt(e)))}const vw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xw=/^'([^]*?)'?$/,bw=/''/g,_w=/[a-zA-Z]/;function zl(e,t,n){var r,i,s,a,o,l,c,u;const d=ks(),h=(n==null?void 0:n.locale)??d.locale??Ku,p=(n==null?void 0:n.firstWeekContainsDate)??((i=(r=n==null?void 0:n.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(s=d.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,f=(n==null?void 0:n.weekStartsOn)??((l=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,g=Pt(e,n==null?void 0:n.in);if(!gw(g))throw new RangeError("Invalid time value");let m=t.match(yw).map(x=>{const _=x[0];if(_==="p"||_==="P"){const E=ow[_];return E(x,h.formatLong)}return x}).join("").match(vw).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const _=x[0];if(_==="'")return{isToken:!1,value:Ew(x)};if(Ap[_])return{isToken:!0,value:x};if(_.match(_w))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:x}});h.localize.preprocessor&&(m=h.localize.preprocessor(g,m));const v={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(x=>{if(!x.isToken)return x.value;const _=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&dw(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&hw(_))&&pw(_,t,String(e));const E=Ap[_[0]];return E(g,_,h.localize,v)}).join("")}function Ew(e){const t=e.match(xw);return t?t[1].replace(bw,"'"):e}const Fl=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Ip(e,t,n,r,i){const s=t===0,a=Number(zl(new Date(e),"c"))===2,o=Number(zl(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||ga(e)||qi(e,l)||Pn(e);case"minute":return s||ga(e)||qi(e,l)||Pn(e);case"30minutes":return s||ga(e)||qi(e,l)||Pn(e);case"hourly":return s||ga(e)||qi(e,l)||Pn(e);case"daily":return i?s||a||Pn(e):s||qi(e,l)||Pn(e);case"weekly":return s||a||Pn(e);case"monthly":return s||Pn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function jl(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=y(i,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=Ip(e,t,n,r,a);let p=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(p=p.replace("pp","h:mm:ss.SSS a"));const f=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,x=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!x){const _=zl(l,p,{locale:f}).split("").map(E=>{const b=Number(E);return E!==" "&&!Number.isNaN(b)?b.toLocaleString(g):E});return s[v](l,g,{},_.join(""))}else return s[v](l,g,x)}function ma(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function Sw(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function Tw(e){const t=Fl.reduce((n,[,r],i)=>{const s=Fl[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return Fl[t][0]}function Wl(e,t){if(Wu[t])return t;if(e.length===1)return"15seconds";const n=Sw(e),r=Rn(n);return Tw(r)}function ga(e){const{s:t,m:n,H:r}=ma(e);return r===0&&n===0&&t===0}function qi(e,t){const n=ma(e).M,r=ma(t).M;return n!==r}function Pn(e){const{M:t,d:n,s:r,m:i,H:s}=ma(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Np(e){return e===void 0?"":e.toISOString()}function Pp(e){const t=Ge(e,r=>r.value),n=je().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Up(e,t){const n=y(t,"gradient","colors"),r=!Ve(n);let i=y(t,"pairing","option");const s=Pp(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return Bl().domain(s).range(o)}var ht=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(ht||{});function Ow(e,t){return e&&rd(e,t,Ti)}function ww(e,t){return function(n,r){if(n==null)return n;if(!Kn(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var ql=ww(Ow);function pt(e){return function(){return e}}var $w=Array.prototype.slice;function va(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Mw(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function Cw(e,t,n,r){return ql(e,function(i,s,a){t(r,i,n(i),a)}),r}function Aw(e,t){return function(n,r){var i=Zt(n)?Mw:Cw,s={};return i(n,e,js(r),s)}}function Lw(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var kw=Object.prototype,Dw=kw.hasOwnProperty,Rw=Aw(function(e,t,n){Dw.call(e,n)?e[n].push(t):Is(e,n,[t])});function Iw(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Nw(e){return e}function Pw(e=Jn){if(e===Jn)return Bp;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Bp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Uw=Array.prototype,Bw=Uw.slice;function Yl(e){return()=>e}function Hw(e,t,n){let r;for(;;){const i=Dr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function Vw(e){return Math.max(1,Math.ceil(Math.log(Iw(e))/Math.LN2)+1)}function Gw(){var e=Nw,t=Ge,n=Vw;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],p=n(c,d,h);if(!Array.isArray(p)){const _=h,E=+p;if(t===Ge&&([d,h]=Hw(d,h,E)),p=qs(d,h,E),p[0]<=d&&(l=Dr(d,h,E)),p[p.length-1]>=h)if(_>=h&&t===Ge){const b=Dr(d,h,E);isFinite(b)&&(b>0?h=(Math.floor(h/b)+1)*b:b<0&&(h=(Math.ceil(h*-b)+1)/-b))}else p.pop()}for(var f=p.length,g=0,m=f;p[g]<=d;)++g;for(;p[m-1]>h;)--m;(g||m<f)&&(p=p.slice(g,m),f=m-g);var v=new Array(f+1),x;for(s=0;s<=f;++s)x=v[s]=[],x.x0=s>0?p[s-1]:d,x.x1=s<f?p[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(f,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const _=Math.floor((d-o)*l);v[Math.min(f,_+(p[_]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[gl(p,o,0,f)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Yl(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Yl([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Yl(Array.isArray(i)?Bw.call(i):i),r):n},r}function Hp(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Bp:Pw(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*d/l+h)),f=Math.min(r,Math.floor(t+(l-c)*d/l+h));Hp(e,t,p,f,i)}const s=e[t];let a=n,o=r;for(Yi(e,n,t),i(e[r],s)>0&&Yi(e,n,r);a<o;){for(Yi(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Yi(e,n,o):(++o,Yi(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Yi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Xl(e,t,n){if(e=Float64Array.from(U_(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Rn(e);if(t>=1)return tr(e);var r,i=(r-1)*t,s=Math.floor(i),a=tr(Hp(e,s).subarray(0,s+1)),o=Rn(e.subarray(s+1));return a+(o-a)*(i-s)}}function Vp(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Gp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function zw(e,t){return e[t]}function Fw(e){const t=[];return t.key=e,t}function Zl(){var e=pt([]),t=Gp,n=Vp,r=zw;function i(s){var a=Array.from(e.apply(this,arguments),Fw),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=va(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:pt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:pt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Gp:typeof s=="function"?s:pt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Vp,i):n},i}function jw(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function Ww(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}let rn=class{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=y(r,"locale"),o=y(r,"tabularRepModal","tableHeadingFormatter"),l=y(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===nt.TIME&&(d=h=>s(h,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(h=>{d&&(h[1]=d(h[1]));for(const p in h){const f=h[p];typeof f=="number"&&(h[p]=a(f,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===nt.LINEAR||c===nt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===nt.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Nt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(pn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Nt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return Rw(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=wO.defaultBins}=s,l=Array.isArray(o),c=Gw().value(p=>p[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const p=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+p}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(p=>p[a]))),h=[];return c.forEach(p=>{const f=`${p.x0}-${p.x1}`,g=this.aggregateBinDataByGroup(p);d.forEach(m=>{h.push({group:m,key:f,value:g[m]||0,bin:p.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Zl().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=ki(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Np(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===nt.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===nt.LOG||o===nt.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(p=>p.x0.toString()===c.toString());return a.forEach(p=>{d[p]=h.filter(f=>f[i]===p).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?Np(p[f])===l:p[f].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=Lw(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?Zl().offset(jw):Zl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[s]=a[c],d}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Gl(n,t),this.set({options:at(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(O.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Nt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(s=>s.map(a=>`"${(a==="&ndash;"?"–":a).split(/[,;'"`]/).map(o=>Ww(o)).join("")}"`)).map(s=>s.join(",")).join(`
2
+ `),n=this.getOptions();let r="myChart";const i=y(n,"fileDownload","fileName");typeof i=="function"?r=i("csv"):typeof i=="string"&&(r=i),this.services.files.downloadCSV(t,`${r}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=Nt.items.status,s=this.getOptions(),a=ki(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=y(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=y(t,"option");const i=hp.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=da().range(o).domain(this.allDataGroups)}};class lr extends rn{constructor(t){super(t),this.axisFlavor=vi.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:y(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=y(this.getOptions(),"locale"),u=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"&ndash;":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"&ndash;":l(h[s.identifier],c),...a?[h[a.identifier]===null?"&ndash;":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),y(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const r=y(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(pn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=ki(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(z).forEach(i=>{const s=z[i],a=n.axes[s];if(a&&a.scaleType===nt.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{y(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let qw=class extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const i=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}},Yw=class extends lr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Xl(t,.25),q_50:Xl(t,.5),q_75:Xl(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(_=>_[o]).sort(Jn),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,d=c.quartiles.q_75,h=(d-u)*1.5,p=u-h,f=d+h,g=[],m=[];for(const _ of l)_<p||_>f?g.push(_):m.push(_);c.outliers=g;const v=Rn(m),x=tr(m);c.whiskers={min:v||Rn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:x||tr([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData(),{number:i,code:s}=y(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=y(l,"outliers");return(c===null||c.length===0)&&(c=["&ndash;"]),[l[n],y(l,"whiskers","min")!==null?i(y(l,"whiskers","min"),s):"&ndash;",y(l,"quartiles","q_25")!==null?i(y(l,"quartiles","q_25"),s):"&ndash;",y(l,"quartiles","q_50")!==null?i(y(l,"quartiles","q_50"),s):"&ndash;",y(l,"quartiles","q_75")!==null?i(y(l,"quartiles","q_75"),s):"&ndash;",y(l,"whiskers","max")!==null?i(y(l,"whiskers","max"),s):"&ndash;",y(l,"quartiles","q_75")!==null&&y(l,"quartiles","q_25")!==null?(i(y(l,"quartiles","q_75")-y(l,"quartiles","q_25")),s):"&ndash;",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"option");const r=hp.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=da().range(i).domain(this.allDataGroups)}},Xw=class extends lr{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{number:s,code:a}=y(n,"locale"),o=y(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"&ndash;":s(u.value,a),y(u,"marker")===null?"&ndash;":s(u.marker,a),y(u,"marker")===null?"&ndash;":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}},Zw=class extends rn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ve(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ve(n)&&!Ve(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"&ndash;":a.id,a.name,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=y(this.getOptions(),"color");this._colorScale=Up(this.getDisplayData(),t)}},Kw=class extends rn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=at({},t,this.getZoomOptions(t));Gl(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:at(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:jt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}},Qw=class extends rn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},Jw=class extends rn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}},t$=class extends lr{constructor(t){super(t),this.axisFlavor=vi.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==nt.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==nt.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==nt.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==nt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ge(this.getDisplayData(),r=>r.value),n=je().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ve(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Ve(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Ve(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=pn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(pn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ve(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!Ve(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Bl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=Up(this.getDisplayData(),l)}},e$=class extends lr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}};class n$ extends rn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}else u=y(s,"total")||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let p;h.value!==null&&h.value!==void 0?p=Number(h.value):p=0;const f=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"&ndash;":a(p,o),a(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}}let r$=class extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}};class i$ extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class s$ extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}let a$=class extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}};var o$=/\s/;function l$(e){for(var t=e.length;t--&&o$.test(e.charAt(t)););return t}var c$=/^\s+/;function u$(e){return e&&e.slice(0,l$(e)+1).replace(c$,"")}var zp=NaN,h$=/^[-+]0x[0-9a-f]+$/i,d$=/^0b[01]+$/i,p$=/^0o[0-7]+$/i,f$=parseInt;function Fr(e){if(typeof e=="number")return e;if(Ds(e))return zp;if(Ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ce(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=u$(e);var n=d$.test(e);return n||p$.test(e)?f$(e.slice(2),n?2:8):h$.test(e)?zp:+e}var Kl=function(){return Be.Date.now()},m$="Expected a function",g$=Math.max,v$=Math.min;function ya(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(m$);t=Fr(t)||0,Ce(n)&&(u=!!n.leading,d="maxWait"in n,s=d?g$(Fr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(T){var M=r,D=i;return r=i=void 0,c=T,a=e.apply(D,M),a}function f(T){return c=T,o=setTimeout(v,t),u?p(T):a}function g(T){var M=T-l,D=T-c,A=t-M;return d?v$(A,s-D):A}function m(T){var M=T-l,D=T-c;return l===void 0||M>=t||M<0||d&&D>=s}function v(){var T=Kl();if(m(T))return x(T);o=setTimeout(v,g(T))}function x(T){return o=void 0,h&&r?p(T):(r=i=void 0,a)}function _(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function E(){return o===void 0?a:x(Kl())}function b(){var T=Kl(),M=m(T);if(r=arguments,i=this,l=T,M){if(o===void 0)return f(l);if(d)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),a}return b.cancel=_,b.flush=E,b}function y$(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function I(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],Ed)}function Xi(){var e=da().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,p=i<r,f=p?i:r,g=p?r:i;s=(g-f)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),f+=(g-f-s*(h-l))*u,a=s*(1-l),o&&(f=Math.round(f),a=Math.round(a));var m=y$(h).map(function(v){return f+s*v});return n(p?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return Xi(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Ur.apply(d(),arguments)}function Fp(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}const Ql=new Date,Jl=new Date;function qt(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>qt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(Ql.setTime(+s),Jl.setTime(+a),e(Ql),e(Jl),Math.floor(n(Ql,Jl))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const xa=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);xa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):xa),xa.range;const _n=1e3,ke=_n*60,En=ke*60,Sn=En*24,tc=Sn*7,jp=Sn*30,ec=Sn*365,jr=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*_n)},(e,t)=>(t-e)/_n,e=>e.getUTCSeconds());jr.range;const nc=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_n)},(e,t)=>{e.setTime(+e+t*ke)},(e,t)=>(t-e)/ke,e=>e.getMinutes());nc.range,qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ke)},(e,t)=>(t-e)/ke,e=>e.getUTCMinutes()).range;const rc=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_n-e.getMinutes()*ke)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getHours());rc.range,qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getUTCHours()).range;const Zi=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ke)/Sn,e=>e.getDate()-1);Zi.range;const ic=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Sn,e=>e.getUTCDate()-1);ic.range,qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Sn,e=>Math.floor(e/Sn)).range;function cr(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ke)/tc)}const ba=cr(0),_a=cr(1),x$=cr(2),b$=cr(3),Wr=cr(4),_$=cr(5),E$=cr(6);ba.range,_a.range,x$.range,b$.range,Wr.range,_$.range,E$.range;function ur(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/tc)}const Wp=ur(0),Ea=ur(1),S$=ur(2),T$=ur(3),qr=ur(4),O$=ur(5),w$=ur(6);Wp.range,Ea.range,S$.range,T$.range,qr.range,O$.range,w$.range;const sc=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());sc.range,qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const Tn=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Tn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Tn.range;const hr=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());hr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),hr.range;function $$(e,t,n,r,i,s){const a=[[jr,1,_n],[jr,5,5*_n],[jr,15,15*_n],[jr,30,30*_n],[s,1,ke],[s,5,5*ke],[s,15,15*ke],[s,30,30*ke],[i,1,En],[i,3,3*En],[i,6,6*En],[i,12,12*En],[r,1,Sn],[r,2,2*Sn],[n,1,tc],[t,1,jp],[t,3,3*jp],[e,1,ec]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const p=d&&typeof d.range=="function"?d:l(c,u,d),f=p?p.range(c,+u+1):[];return h?f.reverse():f}function l(c,u,d){const h=Math.abs(u-c)/d,p=ml(([,,m])=>m).right(a,h);if(p===a.length)return e.every(vl(c/ec,u/ec,d));if(p===0)return xa.every(Math.max(vl(c,u,d),1));const[f,g]=a[h/a[p-1][2]<a[p][2]/h?p-1:p];return f.every(g)}return[o,l]}const[M$,C$]=$$(Tn,sc,ba,Zi,rc,nc);function ac(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function oc(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ki(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function A$(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Qi(i),u=Ji(i),d=Qi(s),h=Ji(s),p=Qi(a),f=Ji(a),g=Qi(o),m=Ji(o),v=Qi(l),x=Ji(l),_={a:L,A:k,b:U,B:K,c:null,d:Qp,e:Qp,f:J$,g:cM,G:hM,H:Z$,I:K$,j:Q$,L:Jp,m:tM,M:eM,p:W,q:j,Q:af,s:of,S:nM,u:rM,U:iM,V:sM,w:aM,W:oM,x:null,X:null,y:lM,Y:uM,Z:dM,"%":sf},E={a:X,A:ct,b:J,B:Y,c:null,d:ef,e:ef,f:gM,g:wM,G:MM,H:pM,I:fM,j:mM,L:nf,m:vM,M:yM,p:et,q:ut,Q:af,s:of,S:xM,u:bM,U:_M,V:EM,w:SM,W:TM,x:null,X:null,y:OM,Y:$M,Z:CM,"%":sf},b={a:R,A:$,b:H,B:P,c:B,d:Zp,e:Zp,f:W$,g:Xp,G:Yp,H:Kp,I:Kp,j:G$,L:j$,m:V$,M:z$,p:A,q:H$,Q:Y$,s:X$,S:F$,u:I$,U:N$,V:P$,w:R$,W:U$,x:S,X:w,y:Xp,Y:Yp,Z:B$,"%":q$};_.x=T(n,_),_.X=T(r,_),_.c=T(t,_),E.x=T(n,E),E.X=T(r,E),E.c=T(t,E);function T(F,q){return function(Z){var G=[],dt=-1,ot=0,It=F.length,Ht,rt,Et;for(Z instanceof Date||(Z=new Date(+Z));++dt<It;)F.charCodeAt(dt)===37&&(G.push(F.slice(ot,dt)),(rt=qp[Ht=F.charAt(++dt)])!=null?Ht=F.charAt(++dt):rt=Ht==="e"?" ":"0",(Et=q[Ht])&&(Ht=Et(Z,rt)),G.push(Ht),ot=dt+1);return G.push(F.slice(ot,dt)),G.join("")}}function M(F,q){return function(Z){var G=Ki(1900,void 0,1),dt=D(G,F,Z+="",0),ot,It;if(dt!=Z.length)return null;if("Q"in G)return new Date(G.Q);if("s"in G)return new Date(G.s*1e3+("L"in G?G.L:0));if(q&&!("Z"in G)&&(G.Z=0),"p"in G&&(G.H=G.H%12+G.p*12),G.m===void 0&&(G.m="q"in G?G.q:0),"V"in G){if(G.V<1||G.V>53)return null;"w"in G||(G.w=1),"Z"in G?(ot=oc(Ki(G.y,0,1)),It=ot.getUTCDay(),ot=It>4||It===0?Ea.ceil(ot):Ea(ot),ot=ic.offset(ot,(G.V-1)*7),G.y=ot.getUTCFullYear(),G.m=ot.getUTCMonth(),G.d=ot.getUTCDate()+(G.w+6)%7):(ot=ac(Ki(G.y,0,1)),It=ot.getDay(),ot=It>4||It===0?_a.ceil(ot):_a(ot),ot=Zi.offset(ot,(G.V-1)*7),G.y=ot.getFullYear(),G.m=ot.getMonth(),G.d=ot.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),It="Z"in G?oc(Ki(G.y,0,1)).getUTCDay():ac(Ki(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(It+5)%7:G.w+G.U*7-(It+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,oc(G)):ac(G)}}function D(F,q,Z,G){for(var dt=0,ot=q.length,It=Z.length,Ht,rt;dt<ot;){if(G>=It)return-1;if(Ht=q.charCodeAt(dt++),Ht===37){if(Ht=q.charAt(dt++),rt=b[Ht in qp?q.charAt(dt++):Ht],!rt||(G=rt(F,Z,G))<0)return-1}else if(Ht!=Z.charCodeAt(G++))return-1}return G}function A(F,q,Z){var G=c.exec(q.slice(Z));return G?(F.p=u.get(G[0].toLowerCase()),Z+G[0].length):-1}function R(F,q,Z){var G=p.exec(q.slice(Z));return G?(F.w=f.get(G[0].toLowerCase()),Z+G[0].length):-1}function $(F,q,Z){var G=d.exec(q.slice(Z));return G?(F.w=h.get(G[0].toLowerCase()),Z+G[0].length):-1}function H(F,q,Z){var G=v.exec(q.slice(Z));return G?(F.m=x.get(G[0].toLowerCase()),Z+G[0].length):-1}function P(F,q,Z){var G=g.exec(q.slice(Z));return G?(F.m=m.get(G[0].toLowerCase()),Z+G[0].length):-1}function B(F,q,Z){return D(F,t,q,Z)}function S(F,q,Z){return D(F,n,q,Z)}function w(F,q,Z){return D(F,r,q,Z)}function L(F){return a[F.getDay()]}function k(F){return s[F.getDay()]}function U(F){return l[F.getMonth()]}function K(F){return o[F.getMonth()]}function W(F){return i[+(F.getHours()>=12)]}function j(F){return 1+~~(F.getMonth()/3)}function X(F){return a[F.getUTCDay()]}function ct(F){return s[F.getUTCDay()]}function J(F){return l[F.getUTCMonth()]}function Y(F){return o[F.getUTCMonth()]}function et(F){return i[+(F.getUTCHours()>=12)]}function ut(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var q=T(F+="",_);return q.toString=function(){return F},q},parse:function(F){var q=M(F+="",!1);return q.toString=function(){return F},q},utcFormat:function(F){var q=T(F+="",E);return q.toString=function(){return F},q},utcParse:function(F){var q=M(F+="",!0);return q.toString=function(){return F},q}}}var qp={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,L$=/^%/,k$=/[\\^$*+?|[\]().{}]/g;function xt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function D$(e){return e.replace(k$,"\\$&")}function Qi(e){return new RegExp("^(?:"+e.map(D$).join("|")+")","i")}function Ji(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function R$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function I$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function N$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function P$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function U$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Yp(e,t,n){var r=Yt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Xp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function B$(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function H$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function V$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Zp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function G$(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Kp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function z$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function F$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function j$(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function W$(e,t,n){var r=Yt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function q$(e,t,n){var r=L$.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Y$(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function X$(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Qp(e,t){return xt(e.getDate(),t,2)}function Z$(e,t){return xt(e.getHours(),t,2)}function K$(e,t){return xt(e.getHours()%12||12,t,2)}function Q$(e,t){return xt(1+Zi.count(Tn(e),e),t,3)}function Jp(e,t){return xt(e.getMilliseconds(),t,3)}function J$(e,t){return Jp(e,t)+"000"}function tM(e,t){return xt(e.getMonth()+1,t,2)}function eM(e,t){return xt(e.getMinutes(),t,2)}function nM(e,t){return xt(e.getSeconds(),t,2)}function rM(e){var t=e.getDay();return t===0?7:t}function iM(e,t){return xt(ba.count(Tn(e)-1,e),t,2)}function tf(e){var t=e.getDay();return t>=4||t===0?Wr(e):Wr.ceil(e)}function sM(e,t){return e=tf(e),xt(Wr.count(Tn(e),e)+(Tn(e).getDay()===4),t,2)}function aM(e){return e.getDay()}function oM(e,t){return xt(_a.count(Tn(e)-1,e),t,2)}function lM(e,t){return xt(e.getFullYear()%100,t,2)}function cM(e,t){return e=tf(e),xt(e.getFullYear()%100,t,2)}function uM(e,t){return xt(e.getFullYear()%1e4,t,4)}function hM(e,t){var n=e.getDay();return e=n>=4||n===0?Wr(e):Wr.ceil(e),xt(e.getFullYear()%1e4,t,4)}function dM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+xt(t/60|0,"0",2)+xt(t%60,"0",2)}function ef(e,t){return xt(e.getUTCDate(),t,2)}function pM(e,t){return xt(e.getUTCHours(),t,2)}function fM(e,t){return xt(e.getUTCHours()%12||12,t,2)}function mM(e,t){return xt(1+ic.count(hr(e),e),t,3)}function nf(e,t){return xt(e.getUTCMilliseconds(),t,3)}function gM(e,t){return nf(e,t)+"000"}function vM(e,t){return xt(e.getUTCMonth()+1,t,2)}function yM(e,t){return xt(e.getUTCMinutes(),t,2)}function xM(e,t){return xt(e.getUTCSeconds(),t,2)}function bM(e){var t=e.getUTCDay();return t===0?7:t}function _M(e,t){return xt(Wp.count(hr(e)-1,e),t,2)}function rf(e){var t=e.getUTCDay();return t>=4||t===0?qr(e):qr.ceil(e)}function EM(e,t){return e=rf(e),xt(qr.count(hr(e),e)+(hr(e).getUTCDay()===4),t,2)}function SM(e){return e.getUTCDay()}function TM(e,t){return xt(Ea.count(hr(e)-1,e),t,2)}function OM(e,t){return xt(e.getUTCFullYear()%100,t,2)}function wM(e,t){return e=rf(e),xt(e.getUTCFullYear()%100,t,2)}function $M(e,t){return xt(e.getUTCFullYear()%1e4,t,4)}function MM(e,t){var n=e.getUTCDay();return e=n>=4||n===0?qr(e):qr.ceil(e),xt(e.getUTCFullYear()%1e4,t,4)}function CM(){return"+0000"}function sf(){return"%"}function af(e){return+e}function of(e){return Math.floor(+e/1e3)}var Yr,lf;AM({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function AM(e){return Yr=A$(e),lf=Yr.format,Yr.parse,Yr.utcFormat,Yr.utcParse,Yr}function LM(e){return new Date(e)}function kM(e){return e instanceof Date?+e:+new Date(+e)}function cf(e,t,n,r,i,s,a,o,l,c){var u=cp(),d=u.invert,h=u.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),x=c("%b %d"),_=c("%B"),E=c("%Y");function b(T){return(l(T)<T?p:o(T)<T?f:a(T)<T?g:s(T)<T?m:r(T)<T?i(T)<T?v:x:n(T)<T?_:E)(T)}return u.invert=function(T){return new Date(d(T))},u.domain=function(T){return arguments.length?h(Array.from(T,kM)):h().map(LM)},u.ticks=function(T){var M=h();return e(M[0],M[M.length-1],T??10)},u.tickFormat=function(T,M){return M==null?b:c(M)},u.nice=function(T){var M=h();return(!T||typeof T.range!="function")&&(T=t(M[0],M[M.length-1],T??10)),T?h(Fp(M,T)):u},u.copy=function(){return Ul(u,cf(e,t,n,r,i,s,a,o,l,c))},u}function uf(){return Ur.apply(cf(M$,C$,Tn,sc,ba,Zi,rc,nc,jr,lf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const hf=Math.abs,te=Math.atan2,dr=Math.cos,DM=Math.max,lc=Math.min,sn=Math.sin,Xr=Math.sqrt,ee=1e-12,ts=Math.PI,Sa=ts/2,Ta=2*ts;function RM(e){return e>1?0:e<-1?ts:Math.acos(e)}function df(e){return e>=1?Sa:e<=-1?-Sa:Math.asin(e)}function pf(e){this._context=e}pf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Oa(e){return new pf(e)}function Un(){}function ff(e){this._context=e}ff.prototype={areaStart:Un,areaEnd:Un,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function mf(e){return new ff(e)}function IM(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const NM=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Bn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let es=null;function gf(e={}){return es||(e.includeStyleProperties?(es=e.includeStyleProperties,es):(es=Bn(window.getComputedStyle(document.documentElement)),es))}function wa(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function PM(e){const t=wa(e,"border-left-width"),n=wa(e,"border-right-width");return e.clientWidth+t+n}function UM(e){const t=wa(e,"border-top-width"),n=wa(e,"border-bottom-width");return e.clientHeight+t+n}function vf(e,t={}){const n=t.width||PM(e),r=t.height||UM(e);return{width:n,height:r}}function BM(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const _e=16384;function HM(e){(e.width>_e||e.height>_e)&&(e.width>_e&&e.height>_e?e.width>e.height?(e.height*=_e/e.width,e.width=_e):(e.width*=_e/e.height,e.height=_e):e.width>_e?(e.height*=_e/e.width,e.width=_e):(e.width*=_e/e.height,e.height=_e))}function $a(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function VM(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function GM(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),VM(i)}const pe=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||pe(n,t)};function zM(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function FM(e,t){return gf(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function jM(e,t,n,r){const i=`.${e}:${t}`,s=n.cssText?zM(n):FM(n,r);return document.createTextNode(`${i}{${s}}`)}function yf(e,t,n,r){const i=window.getComputedStyle(e,n),s=i.getPropertyValue("content");if(s===""||s==="none")return;const a=NM();try{t.className=`${t.className} ${a}`}catch{return}const o=document.createElement("style");o.appendChild(jM(a,n,i,r)),t.appendChild(o)}function WM(e,t,n){yf(e,t,":before",n),yf(e,t,":after",n)}const xf="application/font-woff",bf="image/jpeg",qM={woff:xf,woff2:xf,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:bf,jpeg:bf,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function YM(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cc(e){const t=YM(e).toLowerCase();return qM[t]||""}function XM(e){return e.split(/,/)[1]}function uc(e){return e.search(/^(data:)/)!==-1}function ZM(e,t){return`data:${t};base64,${e}`}async function _f(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const hc={};function KM(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function dc(e,t,n){const r=KM(e,t,n.includeQueryParams);if(hc[r]!=null)return hc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await _f(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),XM(o)));i=ZM(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return hc[r]=i,i}async function QM(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):$a(t)}async function JM(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return $a(o)}const n=e.poster,r=cc(n),i=await dc(n,r,t);return $a(i)}async function t2(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await Ma(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function e2(e,t){return pe(e,HTMLCanvasElement)?QM(e):pe(e,HTMLVideoElement)?JM(e,t):pe(e,HTMLIFrameElement)?t2(e,t):e.cloneNode(Ef(e))}const n2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ef=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function r2(e,t,n){var r,i;if(Ef(t))return t;let s=[];return n2(e)&&e.assignedNodes?s=Bn(e.assignedNodes()):pe(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=Bn(e.contentDocument.body.childNodes):s=Bn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||pe(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>Ma(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function i2(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):gf(n).forEach(s=>{let a=i.getPropertyValue(s);s==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),pe(e,HTMLIFrameElement)&&s==="display"&&a==="inline"&&(a="block"),s==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),r.setProperty(s,a,i.getPropertyPriority(s))})}function s2(e,t){pe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),pe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function a2(e,t){if(pe(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function o2(e,t,n){return pe(t,Element)&&(i2(e,t,n),WM(e,t,n),s2(e,t),a2(e,t)),t}async function l2(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const a=n[s].getAttribute("xlink:href");if(a){const o=e.querySelector(a),l=document.querySelector(a);!o&&l&&!r[a]&&(r[a]=await Ma(l,t,!0))}}const i=Object.values(r);if(i.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(a)}return e}async function Ma(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>e2(r,t)).then(r=>r2(e,r,t)).then(r=>o2(e,r,t)).then(r=>l2(r,t))}const Sf=/url\((['"]?)([^'"]+?)\1\)/g,c2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,u2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function h2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function d2(e){const t=[];return e.replace(Sf,(n,r,i)=>(t.push(i),n)),t.filter(n=>!uc(n))}async function p2(e,t,n,r,i){try{const s=n?IM(t,n):t,a=cc(t);let o;return i||(o=await dc(s,a,r)),e.replace(h2(t),`$1${o}$3`)}catch{}return e}function f2(e,{preferredFontFormat:t}){return t?e.replace(u2,n=>{for(;;){const[r,,i]=c2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Tf(e){return e.search(Sf)!==-1}async function Of(e,t,n){if(!Tf(e))return e;const r=f2(e,n);return d2(r).reduce((i,s)=>i.then(a=>p2(a,s,t,n)),Promise.resolve(r))}async function Zr(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Of(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function m2(e,t){await Zr("background",e,t)||await Zr("background-image",e,t),await Zr("mask",e,t)||await Zr("-webkit-mask",e,t)||await Zr("mask-image",e,t)||await Zr("-webkit-mask-image",e,t)}async function g2(e,t){const n=pe(e,HTMLImageElement);if(!(n&&!uc(e.src))&&!(pe(e,SVGImageElement)&&!uc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await dc(r,cc(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...l)=>{try{s(t.onImageErrorHandler(...l))}catch(c){a(c)}}:a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function v2(e,t){const n=Bn(e.childNodes).map(r=>wf(r,t));await Promise.all(n).then(()=>e)}async function wf(e,t){pe(e,Element)&&(await m2(e,t),await g2(e,t),await v2(e,t))}function y2(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const $f={};async function Mf(e){let t=$f[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},$f[e]=t,t}async function Cf(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),_f(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function Af(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function x2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Bn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Mf(l).then(u=>Cf(u,t)).then(u=>Af(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Mf(i.href).then(o=>Cf(o,t)).then(o=>Af(o).forEach(l=>{a.insertRule(l,a.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Bn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function b2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Tf(t.style.getPropertyValue("src")))}async function _2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Bn(e.ownerDocument.styleSheets),r=await x2(n,t);return b2(r)}function Lf(e){return e.trim().replace(/["']/g,"")}function E2(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(i=>{t.add(Lf(i))}),Array.from(r.children).forEach(i=>{i instanceof HTMLElement&&n(i)})}return n(e),t}async function S2(e,t){const n=await _2(e,t),r=E2(e);return(await Promise.all(n.filter(i=>r.has(Lf(i.style.fontFamily))).map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return Of(i.cssText,s,t)}))).join(`
3
+ `)}async function T2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await S2(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function O2(e,t={}){const{width:n,height:r}=vf(e,t),i=await Ma(e,t,!0);return await T2(i,t),await wf(i,t),y2(i,t),await GM(i,n,r)}async function kf(e,t={}){const{width:n,height:r}=vf(e,t),i=await O2(e,t),s=await $a(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||BM(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||HM(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function w2(e,t={}){return(await kf(e,t)).toDataURL()}async function $2(e,t={}){return(await kf(e,t)).toDataURL("image/jpeg",t.quality||1)}class On{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const M2="DONT_STYLE_ME_css_styles_verifier";let N=class Bu extends On{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=I(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(p=>{if(h[p]){const f=h[p],g=parseFloat(f);f&&g>r[p]&&(""+f).indexOf("%")===-1&&(r[p]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=I(this.getHolder()).append("div").classed(`${de}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",M2),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),I(this.getHolder()).classed(`${de}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),$2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),w2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Bu.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(Bu.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=ya(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(O.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},pc=class i0 extends On{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:i0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Df(e){const t=C2(Rf(e),360);return Hn(t,[0,10])||Hn(t,[350,0])?{textAnchor:Ke.START,dominantBaseline:Qe.MIDDLE}:Hn(t,[10,80])?{textAnchor:Ke.START,dominantBaseline:Qe.HANGING}:Hn(t,[80,100])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.HANGING}:Hn(t,[100,170])?{textAnchor:Ke.END,dominantBaseline:Qe.HANGING}:Hn(t,[170,190])?{textAnchor:Ke.END,dominantBaseline:Qe.MIDDLE}:Hn(t,[190,260])?{textAnchor:Ke.END,dominantBaseline:Qe.BASELINE}:Hn(t,[260,280])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.BASELINE}:{textAnchor:Ke.START,dominantBaseline:Qe.BASELINE}}function C2(e,t){return(e%t+t)%t}function Hn(e,[t,n]){return e>=t&&e<=n}function Rf(e){return e*(180/Math.PI)}function Ut(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function A2(e,t){return t*Math.sin(e-Math.PI/2)}function L2(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;)n=t(n,e[i],i,e);return n}function k2(e){return function(t){return e==null?void 0:e[t]}}var D2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},R2=k2(D2),I2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,N2="\\u0300-\\u036f",P2="\\ufe20-\\ufe2f",U2="\\u20d0-\\u20ff",B2=N2+P2+U2,H2="["+B2+"]",V2=RegExp(H2,"g");function G2(e){return e=Mi(e),e&&e.replace(I2,R2).replace(V2,"")}var z2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function F2(e){return e.match(z2)||[]}var j2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function W2(e){return j2.test(e)}var If="\\ud800-\\udfff",q2="\\u0300-\\u036f",Y2="\\ufe20-\\ufe2f",X2="\\u20d0-\\u20ff",Z2=q2+Y2+X2,Nf="\\u2700-\\u27bf",Pf="a-z\\xdf-\\xf6\\xf8-\\xff",K2="\\xac\\xb1\\xd7\\xf7",Q2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",J2="\\u2000-\\u206f",tC=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Uf="A-Z\\xc0-\\xd6\\xd8-\\xde",eC="\\ufe0e\\ufe0f",Bf=K2+Q2+J2+tC,Hf="['’]",Vf="["+Bf+"]",nC="["+Z2+"]",Gf="\\d+",rC="["+Nf+"]",zf="["+Pf+"]",Ff="[^"+If+Bf+Gf+Nf+Pf+Uf+"]",iC="\\ud83c[\\udffb-\\udfff]",sC="(?:"+nC+"|"+iC+")",aC="[^"+If+"]",jf="(?:\\ud83c[\\udde6-\\uddff]){2}",Wf="[\\ud800-\\udbff][\\udc00-\\udfff]",Kr="["+Uf+"]",oC="\\u200d",qf="(?:"+zf+"|"+Ff+")",lC="(?:"+Kr+"|"+Ff+")",Yf="(?:"+Hf+"(?:d|ll|m|re|s|t|ve))?",Xf="(?:"+Hf+"(?:D|LL|M|RE|S|T|VE))?",Zf=sC+"?",Kf="["+eC+"]?",cC="(?:"+oC+"(?:"+[aC,jf,Wf].join("|")+")"+Kf+Zf+")*",uC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",hC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",dC=Kf+Zf+cC,pC="(?:"+[rC,jf,Wf].join("|")+")"+dC,fC=RegExp([Kr+"?"+zf+"+"+Yf+"(?="+[Vf,Kr,"$"].join("|")+")",lC+"+"+Xf+"(?="+[Vf,Kr+qf,"$"].join("|")+")",Kr+"?"+qf+"+"+Yf,Kr+"+"+Xf,hC,uC,Gf,pC].join("|"),"g");function mC(e){return e.match(fC)||[]}function gC(e,t,n){return e=Mi(e),t=t,t===void 0?W2(e)?mC(e):F2(e):e.match(t)||[]}var vC="['’]",yC=RegExp(vC,"g");function Qf(e){return function(t){return L2(gC(G2(t).replace(yC,"")),e,"")}}function xC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Jf(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Fr(n),n=n===n?n:0),t!==void 0&&(t=Fr(t),t=t===t?t:0),xC(Fr(e),t,n)}var bC="Expected a function";function _C(e,t,n){if(typeof e!="function")throw new TypeError(bC);return setTimeout(function(){e.apply(void 0,n)},t)}var EC=Zo(function(e,t,n){return _C(e,Fr(t)||0,n)});function SC(e,t){var n=-1,r=Kn(e)?Array(e.length):[];return ql(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function TC(e,t){var n=Zt(e)?Fo:SC;return n(e,js(t))}var OC=1/0;function wC(e,t){return Vs(TC(e,t),OC)}function tm(e,t){return Fs(e,t)}var Qr=Qf(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function $C(e,t){var n;return ql(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function MC(e,t,n){var r=Zt(e)?Yh:$C;return r(e,js(t))}class pr{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}function*CC(e){for(const t of e)yield*t}function em(e){return Array.from(CC(e))}function AC(e){return e}var Ca=1,Aa=2,fc=3,ns=4,nm=1e-6;function LC(e){return"translate("+e+",0)"}function kC(e){return"translate(0,"+e+")"}function DC(e){return t=>+e(t)}function RC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function IC(){return!this.__axis}function La(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ca||e===ns?-1:1,u=e===ns||e===Aa?"x":"y",d=e===Ca||e===fc?LC:kC;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):AC),m=Math.max(s,0)+o,v=t.range(),x=+v[0]+l,_=+v[v.length-1]+l,E=(t.bandwidth?RC:DC)(t.copy(),l),b=p.selection?p.selection():p,T=b.selectAll(".domain").data([null]),M=b.selectAll(".tick").data(f,t).order(),D=M.exit(),A=M.enter().append("g").attr("class","tick"),R=M.select("line"),$=M.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(A),R=R.merge(A.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),$=$.merge(A.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ca?"0em":e===fc?"0.71em":"0.32em")),p!==b&&(T=T.transition(p),M=M.transition(p),R=R.transition(p),$=$.transition(p),D=D.transition(p).attr("opacity",nm).attr("transform",function(H){return isFinite(H=E(H))?d(H+l):this.getAttribute("transform")}),A.attr("opacity",nm).attr("transform",function(H){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(H))?P:E(H))+l)})),D.remove(),T.attr("d",e===ns||e===Aa?a?"M"+c*a+","+x+"H"+l+"V"+_+"H"+c*a:"M"+l+","+x+"V"+_:a?"M"+x+","+c*a+"V"+l+"H"+_+"V"+c*a:"M"+x+","+l+"H"+_),M.attr("opacity",1).attr("transform",function(H){return d(E(H)+l)}),R.attr(u+"2",c*s),$.attr(u,c*m).text(g),b.filter(IC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Aa?"start":e===ns?"end":"middle"),b.each(function(){this.__axis=E})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(s=a=+p,h):s},h.tickSizeInner=function(p){return arguments.length?(s=+p,h):s},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function NC(e){return La(Ca,e)}function PC(e){return La(Aa,e)}function mc(e){return La(fc,e)}function rm(e){return La(ns,e)}const gc={capture:!0,passive:!1};function vc(e){e.preventDefault(),e.stopImmediatePropagation()}function UC(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",vc,gc);"onselectstart"in t?n.on("selectstart.drag",vc,gc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function BC(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",vc,gc),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function HC(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const VC=e=>+e,yc=e=>()=>e;function GC(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function zC(e){e.stopImmediatePropagation()}function xc(e){e.preventDefault(),e.stopImmediatePropagation()}var im={name:"drag"},bc={name:"space"},Jr={name:"handle"},ti={name:"center"};const{abs:sm,max:ne,min:re}=Math;function am(e){return[+e[0],+e[1]]}function om(e){return[am(e[0]),am(e[1])]}var ka={name:"x",handles:["w","e"].map(Ec),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},_c={},wn={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},lm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},cm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},FC={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},jC={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ec(e){return{type:e}}function WC(e){return!e.ctrlKey&&!e.button}function qC(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function YC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sc(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function XC(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function um(){return ZC(ka)}function ZC(e){var t=qC,n=WC,r=YC,i=!0,s=yl("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Ec("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",wn.overlay).merge(v).each(function(){var _=Sc(this).extent;I(this).attr("x",_[0][0]).attr("y",_[0][1]).attr("width",_[1][0]-_[0][0]).attr("height",_[1][1]-_[0][1])}),m.selectAll(".selection").data([Ec("selection")]).enter().append("rect").attr("class","selection").attr("cursor",wn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=m.selectAll(".handle").data(e.handles,function(_){return _.type});x.exit().remove(),x.enter().append("rect").attr("class",function(_){return"handle handle--"+_.type}).attr("cursor",function(_){return wn[_.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,v,x){m.tween?m.on("start.brush",function(_){u(this,arguments).beforestart().start(_)}).on("interrupt.brush end.brush",function(_){u(this,arguments).end(_)}).tween("brush",function(){var _=this,E=_.__brush,b=u(_,arguments),T=E.selection,M=e.input(typeof v=="function"?v.apply(this,arguments):v,E.extent),D=Pi(T,M);function A(R){E.selection=R===1&&M===null?null:D(R),c.call(_),b.brush()}return T!==null&&M!==null?A:A(1)}):m.each(function(){var _=this,E=arguments,b=_.__brush,T=e.input(typeof v=="function"?v.apply(_,E):v,b.extent),M=u(_,E).beforestart();Dl(_),b.selection=T===null?null:T,c.call(_),M.start(x).brush(x).end(x)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=I(this),v=Sc(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(x){return x.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(x){return x.type==="e"||x.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,x){var _=m.__brush.emitter;return _&&(!x||!_.clean)?_:new d(m,v,x)}function d(m,v,x){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=x}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,x){var _=I(this.that).datum();s.call(m,this.that,new GC(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:x,dispatch:s}),_)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,x=m.target.__data__.type,_=(i&&m.metaKey?x="overlay":x)==="selection"?im:i&&m.altKey?ti:Jr,E=e===_c?null:FC[x],b=e===ka?null:jC[x],T=Sc(v),M=T.extent,D=T.selection,A=M[0][0],R,$,H=M[0][1],P,B,S=M[1][0],w,L,k=M[1][1],U,K,W=0,j=0,X,ct=E&&b&&i&&m.shiftKey,J,Y,et=Array.from(m.touches||[m],rt=>{const Et=rt.identifier;return rt=er(rt,v),rt.point0=rt.slice(),rt.identifier=Et,rt});Dl(v);var ut=u(v,arguments,!0).beforestart();if(x==="overlay"){D&&(X=!0);const rt=[et[0],et[1]||et[0]];T.selection=D=[[R=e===_c?A:re(rt[0][0],rt[1][0]),P=e===ka?H:re(rt[0][1],rt[1][1])],[w=e===_c?S:ne(rt[0][0],rt[1][0]),U=e===ka?k:ne(rt[0][1],rt[1][1])]],et.length>1&&dt(m)}else R=D[0][0],P=D[0][1],w=D[1][0],U=D[1][1];$=R,B=P,L=w,K=U;var F=I(v).attr("pointer-events","none"),q=F.selectAll(".overlay").attr("cursor",wn[x]);if(m.touches)ut.moved=G,ut.ended=ot;else{var Z=I(m.view).on("mousemove.brush",G,!0).on("mouseup.brush",ot,!0);i&&Z.on("keydown.brush",It,!0).on("keyup.brush",Ht,!0),UC(m.view)}c.call(v),ut.start(m,_.name);function G(rt){for(const Et of rt.changedTouches||[rt])for(const Ne of et)Ne.identifier===Et.identifier&&(Ne.cur=er(Et,v));if(ct&&!J&&!Y&&et.length===1){const Et=et[0];sm(Et.cur[0]-Et[0])>sm(Et.cur[1]-Et[1])?Y=!0:J=!0}for(const Et of et)Et.cur&&(Et[0]=Et.cur[0],Et[1]=Et.cur[1]);X=!0,xc(rt),dt(rt)}function dt(rt){const Et=et[0],Ne=Et.point0;var Oe;switch(W=Et[0]-Ne[0],j=Et[1]-Ne[1],_){case bc:case im:{E&&(W=ne(A-R,re(S-w,W)),$=R+W,L=w+W),b&&(j=ne(H-P,re(k-U,j)),B=P+j,K=U+j);break}case Jr:{et[1]?(E&&($=ne(A,re(S,et[0][0])),L=ne(A,re(S,et[1][0])),E=1),b&&(B=ne(H,re(k,et[0][1])),K=ne(H,re(k,et[1][1])),b=1)):(E<0?(W=ne(A-R,re(S-R,W)),$=R+W,L=w):E>0&&(W=ne(A-w,re(S-w,W)),$=R,L=w+W),b<0?(j=ne(H-P,re(k-P,j)),B=P+j,K=U):b>0&&(j=ne(H-U,re(k-U,j)),B=P,K=U+j));break}case ti:{E&&($=ne(A,re(S,R-W*E)),L=ne(A,re(S,w+W*E))),b&&(B=ne(H,re(k,P-j*b)),K=ne(H,re(k,U+j*b)));break}}L<$&&(E*=-1,Oe=R,R=w,w=Oe,Oe=$,$=L,L=Oe,x in lm&&q.attr("cursor",wn[x=lm[x]])),K<B&&(b*=-1,Oe=P,P=U,U=Oe,Oe=B,B=K,K=Oe,x in cm&&q.attr("cursor",wn[x=cm[x]])),T.selection&&(D=T.selection),J&&($=D[0][0],L=D[1][0]),Y&&(B=D[0][1],K=D[1][1]),(D[0][0]!==$||D[0][1]!==B||D[1][0]!==L||D[1][1]!==K)&&(T.selection=[[$,B],[L,K]],c.call(v),ut.brush(rt,_.name))}function ot(rt){if(zC(rt),rt.touches){if(rt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else BC(rt.view,X),Z.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);F.attr("pointer-events","all"),q.attr("cursor",wn.overlay),T.selection&&(D=T.selection),XC(D)&&(T.selection=null,c.call(v)),ut.end(rt,_.name)}function It(rt){switch(rt.keyCode){case 16:{ct=E&&b;break}case 18:{_===Jr&&(E&&(w=L-W*E,R=$+W*E),b&&(U=K-j*b,P=B+j*b),_=ti,dt(rt));break}case 32:{(_===Jr||_===ti)&&(E<0?w=L-W:E>0&&(R=$-W),b<0?U=K-j:b>0&&(P=B-j),_=bc,q.attr("cursor",wn.selection),dt(rt));break}default:return}xc(rt)}function Ht(rt){switch(rt.keyCode){case 16:{ct&&(J=Y=ct=!1,dt(rt));break}case 18:{_===ti&&(E<0?w=L:E>0&&(R=$),b<0?U=K:b>0&&(P=B),_=Jr,dt(rt));break}case 32:{_===bc&&(rt.altKey?(E&&(w=L-W*E,R=$+W*E),b&&(U=K-j*b,P=B+j*b),_=ti):(E<0?w=L:E>0&&(R=$),b<0?U=K:b>0&&(P=B),_=Jr),q.attr("cursor",wn[x]),dt(rt));break}default:return}xc(rt)}}function p(m){u(this,arguments).moved(m)}function f(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=om(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:yc(om(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:yc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:yc(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const Tc=Math.PI,Oc=2*Tc,fr=1e-6,KC=Oc-fr;function hm(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function QC(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hm;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let wc=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?hm:QC(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>fr)if(!(Math.abs(d*l-c*u)>fr)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,f=i-o,g=l*l+c*c,m=p*p+f*f,v=Math.sqrt(g),x=Math.sqrt(h),_=s*Math.tan((Tc-Math.acos((g+h-m)/(2*v*x)))/2),E=_/x,b=_/v;Math.abs(E-1)>fr&&this._append`L${t+E*u},${n+E*d}`,this._append`A${s},${s},0,0,${+(d*p>u*f)},${this._x1=t+b*l},${this._y1=n+b*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>fr||Math.abs(this._y1-u)>fr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Oc+Oc),h>KC?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>fr&&this._append`A${r},${r},0,${+(h>=Tc)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function dm(){return new wc}dm.prototype=wc.prototype;var wt=1e-6,JC=1e-12,mt=Math.PI,fe=mt/2,pm=mt/4,Ee=mt*2,se=180/mt,Bt=mt/180,Tt=Math.abs,fm=Math.atan,mr=Math.atan2,$t=Math.cos,tA=Math.exp,eA=Math.log,_t=Math.sin,Vn=Math.sign||function(e){return e>0?1:e<0?-1:0},qe=Math.sqrt,nA=Math.tan;function rA(e){return e>1?0:e<-1?mt:Math.acos(e)}function $n(e){return e>1?fe:e<-1?-fe:Math.asin(e)}function De(){}function Da(e,t){e&&gm.hasOwnProperty(e.type)&&gm[e.type](e,t)}var mm={Feature:function(e,t){Da(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Da(n[r].geometry,t)}},gm={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){$c(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)$c(n[r],t,0)},Polygon:function(e,t){vm(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)vm(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Da(n[r],t)}};function $c(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function vm(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)$c(e[n],t,1);t.polygonEnd()}function ei(e,t){e&&mm.hasOwnProperty(e.type)?mm[e.type](e,t):Da(e,t)}function Mc(e){return[mr(e[1],e[0]),$n(e[2])]}function ni(e){var t=e[0],n=e[1],r=$t(n);return[r*$t(t),r*_t(t),_t(n)]}function Ra(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ia(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Cc(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Na(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Ac(e){var t=qe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Lc(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function kc(e,t){return Tt(e)>mt&&(e-=Math.round(e/Ee)*Ee),[e,t]}kc.invert=kc;function ym(e,t,n){return(e%=Ee)?t||n?Lc(bm(e),_m(t,n)):bm(e):t||n?_m(t,n):kc}function xm(e){return function(t,n){return t+=e,Tt(t)>mt&&(t-=Math.round(t/Ee)*Ee),[t,n]}}function bm(e){var t=xm(e);return t.invert=xm(-e),t}function _m(e,t){var n=$t(e),r=_t(e),i=$t(t),s=_t(t);function a(o,l){var c=$t(l),u=$t(o)*c,d=_t(o)*c,h=_t(l),p=h*n+u*r;return[mr(d*i-p*s,u*n-h*r),$n(p*i+d*s)]}return a.invert=function(o,l){var c=$t(l),u=$t(o)*c,d=_t(o)*c,h=_t(l),p=h*i-d*s;return[mr(d*i+h*s,u*n+p*r),$n(p*n-u*r)]},a}function iA(e){e=ym(e[0]*Bt,e[1]*Bt,e.length>2?e[2]*Bt:0);function t(n){return n=e(n[0]*Bt,n[1]*Bt),n[0]*=se,n[1]*=se,n}return t.invert=function(n){return n=e.invert(n[0]*Bt,n[1]*Bt),n[0]*=se,n[1]*=se,n},t}function sA(e,t,n,r,i,s){if(n){var a=$t(t),o=_t(t),l=r*n;i==null?(i=t+r*Ee,s=t-l/2):(i=Em(a,i),s=Em(a,s),(r>0?i<s:i>s)&&(i+=r*Ee));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Mc([a,-o*$t(u),-o*_t(u)]),e.point(c[0],c[1])}}function Em(e,t){t=ni(t),t[0]-=e,Ac(t);var n=rA(-t[1]);return((-t[2]<0?-n:n)+Ee-wt)%Ee}function Sm(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:De,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Pa(e,t){return Tt(e[0]-t[0])<wt&&Tt(e[1]-t[1])<wt}function Ua(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Tm(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(f){if(!((g=f.length-1)<=0)){var g,m=f[0],v=f[g],x;if(Pa(m,v)){if(!m[2]&&!v[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=f[o])[0],m[1]);i.lineEnd();return}v[0]+=2*wt}s.push(x=new Ua(m,f,null,!0)),a.push(x.o=new Ua(m,null,x,!1)),s.push(x=new Ua(v,f,null,!1)),a.push(x.o=new Ua(v,null,x,!0))}}),!!s.length){for(a.sort(t),Om(s),Om(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);i.lineEnd()}}}function Om(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function Dc(e){return Tt(e[0])<=mt?e[0]:Vn(e[0])*((Tt(e[0])+mt)%Ee-mt)}function aA(e,t){var n=Dc(t),r=t[1],i=_t(r),s=[_t(n),-$t(n),0],a=0,o=0,l=new pr;i===1?r=fe+wt:i===-1&&(r=-fe-wt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],f=Dc(p),g=p[1]/2+pm,m=_t(g),v=$t(g),x=0;x<h;++x,f=E,m=T,v=M,p=_){var _=d[x],E=Dc(_),b=_[1]/2+pm,T=_t(b),M=$t(b),D=E-f,A=D>=0?1:-1,R=A*D,$=R>mt,H=m*T;if(l.add(mr(H*A*_t(R),v*M+H*$t(R))),a+=$?D+A*Ee:D,$^f>=n^E>=n){var P=Ia(ni(p),ni(_));Ac(P);var B=Ia(s,P);Ac(B);var S=($^D>=0?-1:1)*$n(B[2]);(r>S||r===S&&(P[0]||P[1]))&&(o+=$^D>=0?1:-1)}}return(a<-1e-6||a<wt&&l<-1e-12)^o&1}function wm(e,t,n,r){return function(i){var s=t(i),a=Sm(),o=t(a),l=!1,c,u,d,h={point:p,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=x,h.lineEnd=_,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,u=em(u);var E=aA(c,r);u.length?(l||(i.polygonStart(),l=!0),Tm(u,lA,E,n,i)):E&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(E,b){e(E,b)&&i.point(E,b)}function f(E,b){s.point(E,b)}function g(){h.point=f,s.lineStart()}function m(){h.point=p,s.lineEnd()}function v(E,b){d.push([E,b]),o.point(E,b)}function x(){o.lineStart(),d=[]}function _(){v(d[0][0],d[0][1]),o.lineEnd();var E=o.clean(),b=a.result(),T,M=b.length,D,A,R;if(d.pop(),c.push(d),d=null,!!M){if(E&1){if(A=b[0],(D=A.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),T=0;T<D;++T)i.point((R=A[T])[0],R[1]);i.lineEnd()}return}M>1&&E&2&&b.push(b.pop().concat(b.shift())),u.push(b.filter(oA))}}return h}}function oA(e){return e.length>1}function lA(e,t){return((e=e.x)[0]<0?e[1]-fe-wt:fe-e[1])-((t=t.x)[0]<0?t[1]-fe-wt:fe-t[1])}const $m=wm(function(){return!0},cA,hA,[-mt,-fe]);function cA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?mt:-mt,l=Tt(s-t);Tt(l-mt)<wt?(e.point(t,n=(n+a)/2>0?fe:-fe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=mt&&(Tt(t-r)<wt&&(t-=r*wt),Tt(s-o)<wt&&(s-=o*wt),n=uA(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function uA(e,t,n,r){var i,s,a=_t(e-n);return Tt(a)>wt?fm((_t(t)*(s=$t(r))*_t(n)-_t(r)*(i=$t(t))*_t(e))/(i*s*a)):(t+r)/2}function hA(e,t,n,r){var i;if(e==null)i=n*fe,r.point(-mt,i),r.point(0,i),r.point(mt,i),r.point(mt,0),r.point(mt,-i),r.point(0,-i),r.point(-mt,-i),r.point(-mt,0),r.point(-mt,i);else if(Tt(e[0]-t[0])>wt){var s=e[0]<t[0]?mt:-mt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function dA(e){var t=$t(e),n=2*Bt,r=t>0,i=Tt(t)>wt;function s(u,d,h,p){sA(p,e,n,h,u,d)}function a(u,d){return $t(u)*$t(d)>t}function o(u){var d,h,p,f,g;return{lineStart:function(){f=p=!1,g=1},point:function(m,v){var x=[m,v],_,E=a(m,v),b=r?E?0:c(m,v):E?c(m+(m<0?mt:-mt),v):0;if(!d&&(f=p=E)&&u.lineStart(),E!==p&&(_=l(d,x),(!_||Pa(d,_)||Pa(x,_))&&(x[2]=1)),E!==p)g=0,E?(u.lineStart(),_=l(x,d),u.point(_[0],_[1])):(_=l(d,x),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(i&&d&&r^E){var T;!(b&h)&&(T=l(x,d,!0))&&(g=0,r?(u.lineStart(),u.point(T[0][0],T[0][1]),u.point(T[1][0],T[1][1]),u.lineEnd()):(u.point(T[1][0],T[1][1]),u.lineEnd(),u.lineStart(),u.point(T[0][0],T[0][1],3)))}E&&(!d||!Pa(d,x))&&u.point(x[0],x[1]),d=x,p=E,h=b},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return g|(f&&p)<<1}}}function l(u,d,h){var p=ni(u),f=ni(d),g=[1,0,0],m=Ia(p,f),v=Ra(m,m),x=m[0],_=v-x*x;if(!_)return!h&&u;var E=t*v/_,b=-t*x/_,T=Ia(g,m),M=Na(g,E),D=Na(m,b);Cc(M,D);var A=T,R=Ra(M,A),$=Ra(A,A),H=R*R-$*(Ra(M,M)-1);if(!(H<0)){var P=qe(H),B=Na(A,(-R-P)/$);if(Cc(B,M),B=Mc(B),!h)return B;var S=u[0],w=d[0],L=u[1],k=d[1],U;w<S&&(U=S,S=w,w=U);var K=w-S,W=Tt(K-mt)<wt,j=W||K<wt;if(!W&&k<L&&(U=L,L=k,k=U),j?W?L+k>0^B[1]<(Tt(B[0]-S)<wt?L:k):L<=B[1]&&B[1]<=k:K>mt^(S<=B[0]&&B[0]<=w)){var X=Na(A,(-R+P)/$);return Cc(X,M),[B,Mc(X)]}}}function c(u,d){var h=r?e:mt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return wm(a,o,s,r?[0,-e]:[-mt,e-mt])}function pA(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,p=c-o,f;if(f=n-a,!(!h&&f>0)){if(f/=h,h<0){if(f<u)return;f<d&&(d=f)}else if(h>0){if(f>d)return;f>u&&(u=f)}if(f=i-a,!(!h&&f<0)){if(f/=h,h<0){if(f>d)return;f>u&&(u=f)}else if(h>0){if(f<u)return;f<d&&(d=f)}if(f=r-o,!(!p&&f>0)){if(f/=p,p<0){if(f<u)return;f<d&&(d=f)}else if(p>0){if(f>d)return;f>u&&(u=f)}if(f=s-o,!(!p&&f<0)){if(f/=p,p<0){if(f>d)return;f>u&&(u=f)}else if(p>0){if(f<u)return;f<d&&(d=f)}return u>0&&(e[0]=a+u*h,e[1]=o+u*p),d<1&&(t[0]=a+d*h,t[1]=o+d*p),!0}}}}}var Ba=1e9,Ha=-1e9;function fA(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var p=0,f=0;if(c==null||(p=a(c,d))!==(f=a(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==f);else h.point(u[0],u[1])}function a(c,u){return Tt(c[0]-e)<wt?u>0?0:3:Tt(c[0]-n)<wt?u>0?2:1:Tt(c[1]-t)<wt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=Sm(),h,p,f,g,m,v,x,_,E,b,T,M={point:D,lineStart:H,lineEnd:P,polygonStart:R,polygonEnd:$};function D(S,w){i(S,w)&&u.point(S,w)}function A(){for(var S=0,w=0,L=p.length;w<L;++w)for(var k=p[w],U=1,K=k.length,W=k[0],j,X,ct=W[0],J=W[1];U<K;++U)j=ct,X=J,W=k[U],ct=W[0],J=W[1],X<=r?J>r&&(ct-j)*(r-X)>(J-X)*(e-j)&&++S:J<=r&&(ct-j)*(r-X)<(J-X)*(e-j)&&--S;return S}function R(){u=d,h=[],p=[],T=!0}function $(){var S=A(),w=T&&S,L=(h=em(h)).length;(w||L)&&(c.polygonStart(),w&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),L&&Tm(h,o,S,s,c),c.polygonEnd()),u=c,h=p=f=null}function H(){M.point=B,p&&p.push(f=[]),b=!0,E=!1,x=_=NaN}function P(){h&&(B(g,m),v&&E&&d.rejoin(),h.push(d.result())),M.point=D,E&&u.lineEnd()}function B(S,w){var L=i(S,w);if(p&&f.push([S,w]),b)g=S,m=w,v=L,b=!1,L&&(u.lineStart(),u.point(S,w));else if(L&&E)u.point(S,w);else{var k=[x=Math.max(Ha,Math.min(Ba,x)),_=Math.max(Ha,Math.min(Ba,_))],U=[S=Math.max(Ha,Math.min(Ba,S)),w=Math.max(Ha,Math.min(Ba,w))];pA(k,U,e,t,n,r)?(E||(u.lineStart(),u.point(k[0],k[1])),u.point(U[0],U[1]),L||u.lineEnd(),T=!1):L&&(u.lineStart(),u.point(S,w),T=!1)}x=S,_=w,E=L}return M}}const Rc=e=>e;var Ic=new pr,Nc=new pr,Mm,Cm,Pc,Uc,Mn={point:De,lineStart:De,lineEnd:De,polygonStart:function(){Mn.lineStart=mA,Mn.lineEnd=vA},polygonEnd:function(){Mn.lineStart=Mn.lineEnd=Mn.point=De,Ic.add(Tt(Nc)),Nc=new pr},result:function(){var e=Ic/2;return Ic=new pr,e}};function mA(){Mn.point=gA}function gA(e,t){Mn.point=Am,Mm=Pc=e,Cm=Uc=t}function Am(e,t){Nc.add(Uc*e-Pc*t),Pc=e,Uc=t}function vA(){Am(Mm,Cm)}var ri=1/0,Va=ri,rs=-ri,Ga=rs,za={point:yA,lineStart:De,lineEnd:De,polygonStart:De,polygonEnd:De,result:function(){var e=[[ri,Va],[rs,Ga]];return rs=Ga=-(Va=ri=1/0),e}};function yA(e,t){e<ri&&(ri=e),e>rs&&(rs=e),t<Va&&(Va=t),t>Ga&&(Ga=t)}var Bc=0,Hc=0,is=0,Fa=0,ja=0,ii=0,Vc=0,Gc=0,ss=0,Lm,km,an,on,Re={point:gr,lineStart:Dm,lineEnd:Rm,polygonStart:function(){Re.lineStart=_A,Re.lineEnd=EA},polygonEnd:function(){Re.point=gr,Re.lineStart=Dm,Re.lineEnd=Rm},result:function(){var e=ss?[Vc/ss,Gc/ss]:ii?[Fa/ii,ja/ii]:is?[Bc/is,Hc/is]:[NaN,NaN];return Bc=Hc=is=Fa=ja=ii=Vc=Gc=ss=0,e}};function gr(e,t){Bc+=e,Hc+=t,++is}function Dm(){Re.point=xA}function xA(e,t){Re.point=bA,gr(an=e,on=t)}function bA(e,t){var n=e-an,r=t-on,i=qe(n*n+r*r);Fa+=i*(an+e)/2,ja+=i*(on+t)/2,ii+=i,gr(an=e,on=t)}function Rm(){Re.point=gr}function _A(){Re.point=SA}function EA(){Im(Lm,km)}function SA(e,t){Re.point=Im,gr(Lm=an=e,km=on=t)}function Im(e,t){var n=e-an,r=t-on,i=qe(n*n+r*r);Fa+=i*(an+e)/2,ja+=i*(on+t)/2,ii+=i,i=on*e-an*t,Vc+=i*(an+e),Gc+=i*(on+t),ss+=i*3,gr(an=e,on=t)}function Nm(e){this._context=e}Nm.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ee);break}}},result:De};var zc=new pr,Fc,Pm,Um,as,os,ls={point:De,lineStart:function(){ls.point=TA},lineEnd:function(){Fc&&Bm(Pm,Um),ls.point=De},polygonStart:function(){Fc=!0},polygonEnd:function(){Fc=null},result:function(){var e=+zc;return zc=new pr,e}};function TA(e,t){ls.point=Bm,Pm=as=e,Um=os=t}function Bm(e,t){as-=e,os-=t,zc.add(qe(as*as+os*os)),as=e,os=t}let Hm,Wa,Vm,Gm;class zm{constructor(t){this._append=t==null?Fm:OA(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==Vm||this._append!==Wa){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Vm=r,Wa=this._append,Gm=this._,this._=i}this._+=Gm;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Fm(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function OA(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Fm;if(t!==Hm){const n=10**t;Hm=t,Wa=function(r){let i=1;this._+=r[0];for(const s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}return Wa}function wA(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),ei(o,i(s))),s.result()}return a.area=function(o){return ei(o,i(Mn)),Mn.result()},a.measure=function(o){return ei(o,i(ls)),ls.result()},a.bounds=function(o){return ei(o,i(za)),za.result()},a.centroid=function(o){return ei(o,i(Re)),Re.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Rc):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new zm(n)):new Nm(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new zm(n)),a},a.projection(e).digits(n).context(t)}function jc(e){return function(t){var n=new Wc;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Wc(){}Wc.prototype={constructor:Wc,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function qc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ei(n,e.stream(za)),t(za.result()),r!=null&&e.clipExtent(r),e}function jm(e,t,n){return qc(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function $A(e,t,n){return jm(e,[[0,0],t],n)}function MA(e,t,n){return qc(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function CA(e,t,n){return qc(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Wm=16,AA=$t(30*Bt);function qm(e,t){return+t?kA(e,t):LA(e)}function LA(e){return jc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function kA(e,t){function n(r,i,s,a,o,l,c,u,d,h,p,f,g,m){var v=c-r,x=u-i,_=v*v+x*x;if(_>4*t&&g--){var E=a+h,b=o+p,T=l+f,M=qe(E*E+b*b+T*T),D=$n(T/=M),A=Tt(Tt(T)-1)<wt||Tt(s-d)<wt?(s+d)/2:mr(b,E),R=e(A,D),$=R[0],H=R[1],P=$-r,B=H-i,S=x*P-v*B;(S*S/_>t||Tt((v*P+x*B)/_-.5)>.3||a*h+o*p+l*f<AA)&&(n(r,i,s,a,o,l,$,H,A,E/=M,b/=M,T,g,m),m.point($,H),n($,H,A,E,b,T,c,u,d,h,p,f,g,m))}}return function(r){var i,s,a,o,l,c,u,d,h,p,f,g,m={point:v,lineStart:x,lineEnd:E,polygonStart:function(){r.polygonStart(),m.lineStart=b},polygonEnd:function(){r.polygonEnd(),m.lineStart=x}};function v(D,A){D=e(D,A),r.point(D[0],D[1])}function x(){d=NaN,m.point=_,r.lineStart()}function _(D,A){var R=ni([D,A]),$=e(D,A);n(d,h,u,p,f,g,d=$[0],h=$[1],u=D,p=R[0],f=R[1],g=R[2],Wm,r),r.point(d,h)}function E(){m.point=v,r.lineEnd()}function b(){x(),m.point=T,m.lineEnd=M}function T(D,A){_(i=D,A),s=d,a=h,o=p,l=f,c=g,m.point=_}function M(){n(d,h,u,p,f,g,s,a,i,o,l,c,Wm,r),m.lineEnd=E,E()}return m}}var DA=jc({point:function(e,t){this.stream.point(e*Bt,t*Bt)}});function RA(e){return jc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function IA(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Ym(e,t,n,r,i,s){if(!s)return IA(e,t,n,r,i);var a=$t(s),o=_t(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,p=(o*t+a*n)/e;function f(g,m){return g*=r,m*=i,[l*g-c*m+t,n-c*g-l*m]}return f.invert=function(g,m){return[r*(u*g-d*m+h),i*(p-d*g-u*m)]},f}function qa(e){return Xm(function(){return e})()}function Xm(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,p=1,f=null,g=$m,m=null,v,x,_,E=Rc,b=.5,T,M,D,A,R;function $(S){return D(S[0]*Bt,S[1]*Bt)}function H(S){return S=D.invert(S[0],S[1]),S&&[S[0]*se,S[1]*se]}$.stream=function(S){return A&&R===S?A:A=DA(RA(u)(g(T(E(R=S)))))},$.preclip=function(S){return arguments.length?(g=S,f=void 0,B()):g},$.postclip=function(S){return arguments.length?(E=S,m=v=x=_=null,B()):E},$.clipAngle=function(S){return arguments.length?(g=+S?dA(f=S*Bt):(f=null,$m),B()):f*se},$.clipExtent=function(S){return arguments.length?(E=S==null?(m=v=x=_=null,Rc):fA(m=+S[0][0],v=+S[0][1],x=+S[1][0],_=+S[1][1]),B()):m==null?null:[[m,v],[x,_]]},$.scale=function(S){return arguments.length?(n=+S,P()):n},$.translate=function(S){return arguments.length?(r=+S[0],i=+S[1],P()):[r,i]},$.center=function(S){return arguments.length?(s=S[0]%360*Bt,a=S[1]%360*Bt,P()):[s*se,a*se]},$.rotate=function(S){return arguments.length?(o=S[0]%360*Bt,l=S[1]%360*Bt,c=S.length>2?S[2]%360*Bt:0,P()):[o*se,l*se,c*se]},$.angle=function(S){return arguments.length?(d=S%360*Bt,P()):d*se},$.reflectX=function(S){return arguments.length?(h=S?-1:1,P()):h<0},$.reflectY=function(S){return arguments.length?(p=S?-1:1,P()):p<0},$.precision=function(S){return arguments.length?(T=qm(M,b=S*S),B()):qe(b)},$.fitExtent=function(S,w){return jm($,S,w)},$.fitSize=function(S,w){return $A($,S,w)},$.fitWidth=function(S,w){return MA($,S,w)},$.fitHeight=function(S,w){return CA($,S,w)};function P(){var S=Ym(n,0,0,h,p,d).apply(null,t(s,a)),w=Ym(n,r-S[0],i-S[1],h,p,d);return u=ym(o,l,c),M=Lc(t,w),D=Lc(u,M),T=qm(M,b),B()}function B(){return A=R=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&H,P()}}function Zm(e){var t=0,n=mt/3,r=Xm(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Bt,n=s[1]*Bt):[t*se,n*se]},i}function NA(e){var t=$t(e);function n(r,i){return[r*t,_t(i)/t]}return n.invert=function(r,i){return[r/t,$n(i*t)]},n}function PA(e,t){var n=_t(e),r=(n+_t(t))/2;if(Tt(r)<wt)return NA(e);var i=1+n*(2*r-n),s=qe(i)/r;function a(o,l){var c=qe(i-2*r*_t(l))/r;return[c*_t(o*=r),s-c*$t(o)]}return a.invert=function(o,l){var c=s-l,u=mr(o,Tt(c))*Vn(c);return c*r<0&&(u-=mt*Vn(o)*Vn(c)),[u/r,$n((i-(o*o+c*c)*r*r)/(2*r))]},a}function Km(){return Zm(PA).scale(155.424).center([0,33.6442])}function UA(){return Km().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Yc(e,t){return[e,eA(nA((fe+t)/2))]}Yc.invert=function(e,t){return[e,2*fm(tA(t))-fe]};function BA(){return HA(Yc).scale(961/Ee)}function HA(e){var t=qa(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=mt*r(),h=t(iA(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Yc?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function Ya(e,t){return[e,t]}Ya.invert=Ya;function VA(){return qa(Ya).scale(152.63)}function GA(e,t){var n=$t(e),r=e===t?_t(e):(n-$t(t))/(t-e),i=n/r+e;if(Tt(r)<wt)return Ya;function s(a,o){var l=i-o,c=r*a;return[l*_t(c),i-l*$t(c)]}return s.invert=function(a,o){var l=i-o,c=mr(a,Tt(l))*Vn(l);return l*r<0&&(c-=mt*Vn(a)*Vn(l)),[c/r,i-Vn(r)*qe(a*a+l*l)]},s}function zA(){return Zm(GA).scale(131.154).center([0,13.9389])}var cs=1.340264,us=-.081106,hs=893e-6,ds=.003796,Xa=qe(3)/2,FA=12;function Qm(e,t){var n=$n(Xa*_t(t)),r=n*n,i=r*r*r;return[e*$t(n)/(Xa*(cs+3*us*r+i*(7*hs+9*ds*r))),n*(cs+us*r+i*(hs+ds*r))]}Qm.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<FA&&(o=n*(cs+us*r+i*(hs+ds*r))-t,l=cs+3*us*r+i*(7*hs+9*ds*r),n-=a=o/l,r=n*n,i=r*r*r,!(Tt(a)<JC));++s);return[Xa*e*(cs+3*us*r+i*(7*hs+9*ds*r))/$t(n),$n(_t(n)/Xa)]};function jA(){return qa(Qm).scale(177.158)}function Jm(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Jm.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Tt(i)>wt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function WA(){return qa(Jm).scale(175.295)}function qA(e,t){return e.parent===t.parent?1:2}function YA(e){return e.reduce(XA,0)/e.length}function XA(e,t){return e+t.x}function ZA(e){return 1+e.reduce(KA,0)}function KA(e,t){return Math.max(e,t.y)}function QA(e){for(var t;t=e.children;)e=t[0];return e}function JA(e){for(var t;t=e.children;)e=t[t.length-1];return e}function tL(){var e=qA,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var p=h.children;p?(h.x=YA(p),h.y=ZA(p)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=QA(s),c=JA(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function eL(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function nL(){return this.eachAfter(eL)}function rL(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function iL(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function sL(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function aL(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function oL(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function lL(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function cL(e){for(var t=this,n=uL(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function uL(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function hL(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function dL(){return Array.from(this)}function pL(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function fL(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*mL(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function ps(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=yL)):t===void 0&&(t=vL);for(var n=new fs(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new fs(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(bL)}function gL(){return ps(this).eachBefore(xL)}function vL(e){return e.children}function yL(e){return Array.isArray(e)?e[1]:null}function xL(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function bL(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function fs(e){this.data=e,this.depth=this.height=0,this.parent=null}fs.prototype=ps.prototype={constructor:fs,count:nL,each:rL,eachAfter:sL,eachBefore:iL,find:aL,sum:oL,sort:lL,path:cL,ancestors:hL,descendants:dL,leaves:pL,links:fL,copy:gL,[Symbol.iterator]:mL};function _L(e){return e==null?null:tg(e)}function tg(e){if(typeof e!="function")throw new Error;return e}function vr(){return 0}function si(e){return function(){return e}}const EL=1664525,SL=1013904223,eg=4294967296;function TL(){let e=1;return()=>(e=(EL*e+SL)%eg)/eg}function OL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function wL(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function $L(e,t){for(var n=0,r=(e=wL(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&ng(a,s)?++n:(a=CL(i=ML(i,s)),n=0);return a}function ML(e,t){var n,r;if(Xc(t,e))return[t];for(n=0;n<e.length;++n)if(Za(t,e[n])&&Xc(ms(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Za(ms(e[n],e[r]),t)&&Za(ms(e[n],t),e[r])&&Za(ms(e[r],t),e[n])&&Xc(rg(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Za(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function ng(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Xc(e,t){for(var n=0;n<t.length;++n)if(!ng(e,t[n]))return!1;return!0}function CL(e){switch(e.length){case 1:return AL(e[0]);case 2:return ms(e[0],e[1]);case 3:return rg(e[0],e[1],e[2])}}function AL(e){return{x:e.x,y:e.y,r:e.r}}function ms(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function rg(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-a,p=r-c,f=i-o,g=i-u,m=l-s,v=d-s,x=r*r+i*i-s*s,_=x-a*a-o*o+l*l,E=x-c*c-u*u+d*d,b=p*f-h*g,T=(f*E-g*_)/(b*2)-r,M=(g*m-f*v)/b,D=(p*_-h*E)/(b*2)-i,A=(h*v-p*m)/b,R=M*M+A*A-1,$=2*(s+T*M+D*A),H=T*T+D*D-s*s,P=-(Math.abs(R)>1e-6?($+Math.sqrt($*$-4*R*H))/(2*R):H/$);return{x:r+T+M*P,y:i+D+A*P,r:P}}function ig(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function sg(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function ag(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function Ka(e){this._=e,this.next=null,this.previous=null}function LL(e,t){if(!(s=(e=OL(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;ig(r,n,i=e[2]),n=new Ka(n),r=new Ka(r),i=new Ka(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){ig(n._,r._,i=e[l]),i=new Ka(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(sg(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(sg(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=ag(n);(i=i.next)!==r;)(o=ag(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=$L(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function kL(e){return Math.sqrt(e.value)}function DL(){var e=null,t=1,n=1,r=vr;function i(s){const a=TL();return s.x=t/2,s.y=n/2,e?s.eachBefore(og(e)).eachAfter(Zc(r,.5,a)).eachBefore(lg(1)):s.eachBefore(og(kL)).eachAfter(Zc(vr,1,a)).eachAfter(Zc(r,s.r/Math.min(t,n),a)).eachBefore(lg(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=_L(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:si(+s),i):r},i}function og(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Zc(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=LL(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function lg(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function RL(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function IL(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function NL(e,t){return e.parent===t.parent?1:2}function Kc(e){var t=e.children;return t?t[0]:e.t}function Qc(e){var t=e.children;return t?t[t.length-1]:e.t}function PL(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function UL(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function BL(e,t,n){return e.a.parent===t.parent?e.a:n}function Qa(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Qa.prototype=Object.create(fs.prototype);function HL(e){for(var t=new Qa(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new Qa(s[a],a)),i.parent=n;return(t.parent=new Qa(null,0)).children=[t],t}function VL(){var e=NL,t=1,n=1,r=null;function i(c){var u=HL(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,p=c;c.eachBefore(function(x){x.x<d.x&&(d=x),x.x>h.x&&(h=x),x.depth>p.depth&&(p=x)});var f=d===h?1:e(d,h)/2,g=f-d.x,m=t/(h.x+f+g),v=n/(p.depth||1);c.eachBefore(function(x){x.x=(x.x+g)*m,x.y=x.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){UL(c);var p=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-p):c.z=p}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,p=c,f=u,g=h.parent.children[0],m=h.m,v=p.m,x=f.m,_=g.m,E;f=Qc(f),h=Kc(h),f&&h;)g=Kc(g),p=Qc(p),p.a=c,E=f.z+x-h.z-m+e(f._,h._),E>0&&(PL(BL(f,c,d),c,E),m+=E,v+=E),x+=f.m,m+=h.m,_+=g.m,v+=p.m;f&&!Qc(p)&&(p.t=f,p.m+=x-v),h&&!Kc(g)&&(g.t=h,g.m+=m-_,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function GL(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var zL=(1+Math.sqrt(5))/2;function FL(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,p,f,g=t.value,m,v,x,_,E,b,T;u<h;){p=i-n,f=s-r;do m=o[d++].value;while(!m&&d<h);for(v=x=m,b=Math.max(f/p,p/f)/(g*e),T=m*m*b,E=Math.max(x/T,T/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>x&&(x=c),T=m*m*b,_=Math.max(x/T,T/v),_>E){m-=c;break}E=_}a.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?IL(l,n,r,i,g?r+=f*m/g:s):GL(l,n,r,g?n+=p*m/g:i,s),g-=m,u=d}return a}const jL=function e(t){function n(r,i,s,a,o){FL(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(zL);function WL(){var e=jL,t=!1,n=1,r=1,i=[0],s=vr,a=vr,o=vr,l=vr,c=vr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(RL),h}function d(h){var p=i[h.depth],f=h.x0+p,g=h.y0+p,m=h.x1-p,v=h.y1-p;m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),h.x0=f,h.y0=g,h.x1=m,h.y1=v,h.children&&(p=i[h.depth+1]=s(h)/2,f+=c(h)-p,g+=a(h)-p,m-=o(h)-p,v-=l(h)-p,m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),e(h,f,g,m,v))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=tg(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:si(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:si(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:si(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:si(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:si(+h),u):c},u}function Ja(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new wc(t)}function qL(e){return e.innerRadius}function YL(e){return e.outerRadius}function XL(e){return e.startAngle}function ZL(e){return e.endAngle}function KL(e){return e&&e.padAngle}function QL(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<ee))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function to(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Xr(o*o+l*l),u=c*l,d=-c*o,h=e+u,p=t+d,f=n+u,g=r+d,m=(h+f)/2,v=(p+g)/2,x=f-h,_=g-p,E=x*x+_*_,b=i-s,T=h*g-f*p,M=(_<0?-1:1)*Xr(DM(0,b*b*E-T*T)),D=(T*_-x*M)/E,A=(-T*x-_*M)/E,R=(T*_+x*M)/E,$=(-T*x+_*M)/E,H=D-m,P=A-v,B=R-m,S=$-v;return H*H+P*P>B*B+S*S&&(D=R,A=$),{cx:D,cy:A,x01:-u,y01:-d,x11:D*(i/b-1),y11:A*(i/b-1)}}function gs(){var e=qL,t=YL,n=pt(0),r=null,i=XL,s=ZL,a=KL,o=null,l=Ja(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-Sa,g=s.apply(this,arguments)-Sa,m=hf(g-f),v=g>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>ee))o.moveTo(0,0);else if(m>Ta-ee)o.moveTo(p*dr(f),p*sn(f)),o.arc(0,0,p,f,g,!v),h>ee&&(o.moveTo(h*dr(g),h*sn(g)),o.arc(0,0,h,g,f,v));else{var x=f,_=g,E=f,b=g,T=m,M=m,D=a.apply(this,arguments)/2,A=D>ee&&(r?+r.apply(this,arguments):Xr(h*h+p*p)),R=lc(hf(p-h)/2,+n.apply(this,arguments)),$=R,H=R,P,B;if(A>ee){var S=df(A/h*sn(D)),w=df(A/p*sn(D));(T-=S*2)>ee?(S*=v?1:-1,E+=S,b-=S):(T=0,E=b=(f+g)/2),(M-=w*2)>ee?(w*=v?1:-1,x+=w,_-=w):(M=0,x=_=(f+g)/2)}var L=p*dr(x),k=p*sn(x),U=h*dr(b),K=h*sn(b);if(R>ee){var W=p*dr(_),j=p*sn(_),X=h*dr(E),ct=h*sn(E),J;if(m<ts)if(J=QL(L,k,X,ct,W,j,U,K)){var Y=L-J[0],et=k-J[1],ut=W-J[0],F=j-J[1],q=1/sn(RM((Y*ut+et*F)/(Xr(Y*Y+et*et)*Xr(ut*ut+F*F)))/2),Z=Xr(J[0]*J[0]+J[1]*J[1]);$=lc(R,(h-Z)/(q-1)),H=lc(R,(p-Z)/(q+1))}else $=H=0}M>ee?H>ee?(P=to(X,ct,L,k,p,H,v),B=to(W,j,U,K,p,H,v),o.moveTo(P.cx+P.x01,P.cy+P.y01),H<R?o.arc(P.cx,P.cy,H,te(P.y01,P.x01),te(B.y01,B.x01),!v):(o.arc(P.cx,P.cy,H,te(P.y01,P.x01),te(P.y11,P.x11),!v),o.arc(0,0,p,te(P.cy+P.y11,P.cx+P.x11),te(B.cy+B.y11,B.cx+B.x11),!v),o.arc(B.cx,B.cy,H,te(B.y11,B.x11),te(B.y01,B.x01),!v))):(o.moveTo(L,k),o.arc(0,0,p,x,_,!v)):o.moveTo(L,k),!(h>ee)||!(T>ee)?o.lineTo(U,K):$>ee?(P=to(U,K,W,j,h,-$,v),B=to(L,k,X,ct,h,-$,v),o.lineTo(P.cx+P.x01,P.cy+P.y01),$<R?o.arc(P.cx,P.cy,$,te(P.y01,P.x01),te(B.y01,B.x01),!v):(o.arc(P.cx,P.cy,$,te(P.y01,P.x01),te(P.y11,P.x11),!v),o.arc(0,0,h,te(P.cy+P.y11,P.cx+P.x11),te(B.cy+B.y11,B.cx+B.x11),v),o.arc(B.cx,B.cy,$,te(B.y11,B.x11),te(B.y01,B.x01),!v))):o.arc(0,0,h,b,E,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-ts/2;return[dr(d)*u,sn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:pt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:pt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:pt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:pt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:pt(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:pt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:pt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function Jc(e){return e[0]}function tu(e){return e[1]}function vs(e,t){var n=pt(!0),r=null,i=Oa,s=null,a=Ja(o);e=typeof e=="function"?e:e===void 0?Jc:pt(e),t=typeof t=="function"?t:t===void 0?tu:pt(t);function o(l){var c,u=(l=va(l)).length,d,h=!1,p;for(r==null&&(s=i(p=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(p)return s=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:pt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:pt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:pt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function eu(e,t,n){var r=null,i=pt(!0),s=null,a=Oa,o=null,l=Ja(c);e=typeof e=="function"?e:e===void 0?Jc:pt(+e),t=typeof t=="function"?t:pt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?tu:pt(+n);function c(d){var h,p,f,g=(d=va(d)).length,m,v=!1,x,_=new Array(g),E=new Array(g);for(s==null&&(o=a(x=l())),h=0;h<=g;++h){if(!(h<g&&i(m=d[h],h,d))===v)if(v=!v)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=h-1;f>=p;--f)o.point(_[f],E[f]);o.lineEnd(),o.areaEnd()}v&&(_[h]=+e(m,h,d),E[h]=+t(m,h,d),o.point(r?+r(m,h,d):_[h],n?+n(m,h,d):E[h]))}if(x)return o=null,x+""||null}function u(){return vs().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:pt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:pt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:pt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function JL(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function tk(e){return e}function ek(){var e=tk,t=JL,n=null,r=pt(0),i=pt(Ta),s=pt(0);function a(o){var l,c=(o=va(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),g=+r.apply(this,arguments),m=Math.min(Ta,Math.max(-Ta,i.apply(this,arguments)-g)),v,x=Math.min(Math.abs(m)/c,s.apply(this,arguments)),_=x*(m<0?-1:1),E;for(l=0;l<c;++l)(E=f[p[l]=l]=+e(o[l],l,o))>0&&(h+=E);for(t!=null?p.sort(function(b,T){return t(f[b],f[T])}):n!=null&&p.sort(function(b,T){return n(o[b],o[T])}),l=0,d=h?(m-c*_)/h:0;l<c;++l,g=v)u=p[l],E=f[u],v=g+(E>0?E*d:0)+_,f[u]={data:o[u],index:l,value:E,startAngle:g,endAngle:v,padAngle:x};return f}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:pt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:pt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:pt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:pt(+o),a):s},a}var nk=ug(Oa);function cg(e){this._curve=e}cg.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function ug(e){function t(n){return new cg(e(n))}return t._curve=e,t}function rk(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(ug(n)):t()._curve},e}function ik(){return rk(vs().curve(nk))}class sk{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function ak(e){return new sk(e,!0)}function ok(e){return e.source}function lk(e){return e.target}function ck(e){let t=ok,n=lk,r=Jc,i=tu,s=null,a=null,o=Ja(l);function l(){let c;const u=$w.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:pt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:pt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function uk(){return ck(ak)}let gt=class{constructor(t,n,r){if(this.type="",this.renderType=it.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=y(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(I(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${de}--${i}--${this.type}`,!0),r&&r.classed(`${de}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===it.SVG?"svg":"div"}${r}.${de}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=I(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?at({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:hg,setPrototypeOf:dg,isFrozen:hk,getPrototypeOf:dk,getOwnPropertyDescriptor:pk}=Object;let{freeze:ae,seal:Ie,create:pg}=Object,{apply:nu,construct:ru}=typeof Reflect<"u"&&Reflect;ae||(ae=function(e){return e}),Ie||(Ie=function(e){return e}),nu||(nu=function(e,t,n){return e.apply(t,n)}),ru||(ru=function(e,t){return new e(...t)});const eo=le(Array.prototype.forEach),fk=le(Array.prototype.lastIndexOf),fg=le(Array.prototype.pop),ys=le(Array.prototype.push),mk=le(Array.prototype.splice),no=le(String.prototype.toLowerCase),iu=le(String.prototype.toString),mg=le(String.prototype.match),xs=le(String.prototype.replace),gk=le(String.prototype.indexOf),vk=le(String.prototype.trim),Ye=le(Object.prototype.hasOwnProperty),oe=le(RegExp.prototype.test),bs=yk(TypeError);function le(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return nu(e,t,r)}}function yk(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ru(e,n)}}function vt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:no;dg&&dg(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(hk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function xk(e){for(let t=0;t<e.length;t++)Ye(e,t)||(e[t]=null);return e}function yr(e){const t=pg(null);for(const[n,r]of hg(e))Ye(e,n)&&(Array.isArray(r)?t[n]=xk(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=yr(r):t[n]=r);return t}function _s(e,t){for(;e!==null;){const r=pk(e,t);if(r){if(r.get)return le(r.get);if(typeof r.value=="function")return le(r.value)}e=dk(e)}function n(){return null}return n}const gg=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),su=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),au=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),bk=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ou=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_k=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vg=ae(["#text"]),yg=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),lu=ae(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),xg=ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ro=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ek=Ie(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Sk=Ie(/<%[\w\W]*|[\w\W]*%>/gm),Tk=Ie(/\$\{[\w\W]*/gm),Ok=Ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),wk=Ie(/^aria-[\-\w]+$/),bg=Ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$k=Ie(/^(?:\w+script|data):/i),Mk=Ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_g=Ie(/^html$/i),Ck=Ie(/^[a-z][.\w]*(-[.\w]+)+$/i);var Eg=Object.freeze({__proto__:null,ARIA_ATTR:wk,ATTR_WHITESPACE:Mk,CUSTOM_ELEMENT:Ck,DATA_ATTR:Ok,DOCTYPE_NAME:_g,ERB_EXPR:Sk,IS_ALLOWED_URI:bg,IS_SCRIPT_OR_DATA:$k,MUSTACHE_EXPR:Ek,TMPLIT_EXPR:Tk});const Es={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ak=function(){return typeof window>"u"?null:window},Lk=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Sg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Tg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ak();const t=C=>Tg(C);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==Es.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,f=l.prototype,g=_s(f,"cloneNode"),m=_s(f,"remove"),v=_s(f,"nextSibling"),x=_s(f,"childNodes"),_=_s(f,"parentNode");if(typeof a=="function"){const C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}let E,b="";const{implementation:T,createNodeIterator:M,createDocumentFragment:D,getElementsByTagName:A}=n,{importNode:R}=r;let $=Sg();t.isSupported=typeof hg=="function"&&typeof _=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:P,TMPLIT_EXPR:B,DATA_ATTR:S,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:U}=Eg;let{IS_ALLOWED_URI:K}=Eg,W=null;const j=vt({},[...gg,...su,...au,...ou,...vg]);let X=null;const ct=vt({},[...yg,...lu,...xg,...ro]);let J=Object.seal(pg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,et=null,ut=!0,F=!0,q=!1,Z=!0,G=!1,dt=!0,ot=!1,It=!1,Ht=!1,rt=!1,Et=!1,Ne=!1,Oe=!0,ws=!1;const $s="user-content-";let _r=!0,Ze=!1,ci={},ui=null;const zv=vt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Fv=null;const jv=vt({},["audio","video","img","source","image","track"]);let Du=null;const Wv=vt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yo="http://www.w3.org/1998/Math/MathML",xo="http://www.w3.org/2000/svg",An="http://www.w3.org/1999/xhtml";let hi=An,Ru=!1,Iu=null;const oU=vt({},[yo,xo,An],iu);let bo=vt({},["mi","mo","mn","ms","mtext"]),_o=vt({},["annotation-xml"]);const lU=vt({},["title","style","font","a","script"]);let Ms=null;const cU=["application/xhtml+xml","text/html"],uU="text/html";let Xt=null,di=null;const hU=n.createElement("form"),qv=function(C){return C instanceof RegExp||C instanceof Function},Nu=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(di&&di===C)){if((!C||typeof C!="object")&&(C={}),C=yr(C),Ms=cU.indexOf(C.PARSER_MEDIA_TYPE)===-1?uU:C.PARSER_MEDIA_TYPE,Xt=Ms==="application/xhtml+xml"?iu:no,W=Ye(C,"ALLOWED_TAGS")?vt({},C.ALLOWED_TAGS,Xt):j,X=Ye(C,"ALLOWED_ATTR")?vt({},C.ALLOWED_ATTR,Xt):ct,Iu=Ye(C,"ALLOWED_NAMESPACES")?vt({},C.ALLOWED_NAMESPACES,iu):oU,Du=Ye(C,"ADD_URI_SAFE_ATTR")?vt(yr(Wv),C.ADD_URI_SAFE_ATTR,Xt):Wv,Fv=Ye(C,"ADD_DATA_URI_TAGS")?vt(yr(jv),C.ADD_DATA_URI_TAGS,Xt):jv,ui=Ye(C,"FORBID_CONTENTS")?vt({},C.FORBID_CONTENTS,Xt):zv,Y=Ye(C,"FORBID_TAGS")?vt({},C.FORBID_TAGS,Xt):{},et=Ye(C,"FORBID_ATTR")?vt({},C.FORBID_ATTR,Xt):{},ci=Ye(C,"USE_PROFILES")?C.USE_PROFILES:!1,ut=C.ALLOW_ARIA_ATTR!==!1,F=C.ALLOW_DATA_ATTR!==!1,q=C.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=C.SAFE_FOR_TEMPLATES||!1,dt=C.SAFE_FOR_XML!==!1,ot=C.WHOLE_DOCUMENT||!1,rt=C.RETURN_DOM||!1,Et=C.RETURN_DOM_FRAGMENT||!1,Ne=C.RETURN_TRUSTED_TYPE||!1,Ht=C.FORCE_BODY||!1,Oe=C.SANITIZE_DOM!==!1,ws=C.SANITIZE_NAMED_PROPS||!1,_r=C.KEEP_CONTENT!==!1,Ze=C.IN_PLACE||!1,K=C.ALLOWED_URI_REGEXP||bg,hi=C.NAMESPACE||An,bo=C.MATHML_TEXT_INTEGRATION_POINTS||bo,_o=C.HTML_INTEGRATION_POINTS||_o,J=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&qv(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&qv(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(F=!1),Et&&(rt=!0),ci&&(W=vt({},vg),X=[],ci.html===!0&&(vt(W,gg),vt(X,yg)),ci.svg===!0&&(vt(W,su),vt(X,lu),vt(X,ro)),ci.svgFilters===!0&&(vt(W,au),vt(X,lu),vt(X,ro)),ci.mathMl===!0&&(vt(W,ou),vt(X,xg),vt(X,ro))),C.ADD_TAGS&&(W===j&&(W=yr(W)),vt(W,C.ADD_TAGS,Xt)),C.ADD_ATTR&&(X===ct&&(X=yr(X)),vt(X,C.ADD_ATTR,Xt)),C.ADD_URI_SAFE_ATTR&&vt(Du,C.ADD_URI_SAFE_ATTR,Xt),C.FORBID_CONTENTS&&(ui===zv&&(ui=yr(ui)),vt(ui,C.FORBID_CONTENTS,Xt)),_r&&(W["#text"]=!0),ot&&vt(W,["html","head","body"]),W.table&&(vt(W,["tbody"]),delete Y.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw bs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw bs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=C.TRUSTED_TYPES_POLICY,b=E.createHTML("")}else E===void 0&&(E=Lk(p,i)),E!==null&&typeof b=="string"&&(b=E.createHTML(""));ae&&ae(C),di=C}},Yv=vt({},[...su,...au,...bk]),Xv=vt({},[...ou,..._k]),dU=function(C){let tt=_(C);(!tt||!tt.tagName)&&(tt={namespaceURI:hi,tagName:"template"});const Q=no(C.tagName),Ot=no(tt.tagName);return Iu[C.namespaceURI]?C.namespaceURI===xo?tt.namespaceURI===An?Q==="svg":tt.namespaceURI===yo?Q==="svg"&&(Ot==="annotation-xml"||bo[Ot]):!!Yv[Q]:C.namespaceURI===yo?tt.namespaceURI===An?Q==="math":tt.namespaceURI===xo?Q==="math"&&_o[Ot]:!!Xv[Q]:C.namespaceURI===An?tt.namespaceURI===xo&&!_o[Ot]||tt.namespaceURI===yo&&!bo[Ot]?!1:!Xv[Q]&&(lU[Q]||!Yv[Q]):!!(Ms==="application/xhtml+xml"&&Iu[C.namespaceURI]):!1},Er=function(C){ys(t.removed,{element:C});try{_(C).removeChild(C)}catch{m(C)}},Eo=function(C,tt){try{ys(t.removed,{attribute:tt.getAttributeNode(C),from:tt})}catch{ys(t.removed,{attribute:null,from:tt})}if(tt.removeAttribute(C),C==="is")if(rt||Et)try{Er(tt)}catch{}else try{tt.setAttribute(C,"")}catch{}},Zv=function(C){let tt=null,Q=null;if(Ht)C="<remove></remove>"+C;else{const Wt=mg(C,/^[\r\n\t ]+/);Q=Wt&&Wt[0]}Ms==="application/xhtml+xml"&&hi===An&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const Ot=E?E.createHTML(C):C;if(hi===An)try{tt=new h().parseFromString(Ot,Ms)}catch{}if(!tt||!tt.documentElement){tt=T.createDocument(hi,"template",null);try{tt.documentElement.innerHTML=Ru?b:Ot}catch{}}const Qt=tt.body||tt.documentElement;return C&&Q&&Qt.insertBefore(n.createTextNode(Q),Qt.childNodes[0]||null),hi===An?A.call(tt,ot?"html":"body")[0]:ot?tt.documentElement:Qt},Kv=function(C){return M.call(C.ownerDocument||C,C,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pu=function(C){return C instanceof d&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof u)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},Qv=function(C){return typeof o=="function"&&C instanceof o};function Ln(C,tt,Q){eo(C,Ot=>{Ot.call(t,tt,Q,di)})}const Jv=function(C){let tt=null;if(Ln($.beforeSanitizeElements,C,null),Pu(C))return Er(C),!0;const Q=Xt(C.nodeName);if(Ln($.uponSanitizeElement,C,{tagName:Q,allowedTags:W}),C.hasChildNodes()&&!Qv(C.firstElementChild)&&oe(/<[/\w]/g,C.innerHTML)&&oe(/<[/\w]/g,C.textContent)||C.nodeType===Es.progressingInstruction||dt&&C.nodeType===Es.comment&&oe(/<[/\w]/g,C.data))return Er(C),!0;if(!W[Q]||Y[Q]){if(!Y[Q]&&e0(Q)&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q)))return!1;if(_r&&!ui[Q]){const Ot=_(C)||C.parentNode,Qt=x(C)||C.childNodes;if(Qt&&Ot){const Wt=Qt.length;for(let kn=Wt-1;kn>=0;--kn){const Pe=g(Qt[kn],!0);Pe.__removalCount=(C.__removalCount||0)+1,Ot.insertBefore(Pe,v(C))}}}return Er(C),!0}return C instanceof l&&!dU(C)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&oe(/<\/no(script|embed|frames)/i,C.innerHTML)?(Er(C),!0):(G&&C.nodeType===Es.text&&(tt=C.textContent,eo([H,P,B],Ot=>{tt=xs(tt,Ot," ")}),C.textContent!==tt&&(ys(t.removed,{element:C.cloneNode()}),C.textContent=tt)),Ln($.afterSanitizeElements,C,null),!1)},t0=function(C,tt,Q){if(Oe&&(tt==="id"||tt==="name")&&(Q in n||Q in hU))return!1;if(!(F&&!et[tt]&&oe(S,tt))&&!(ut&&oe(w,tt))){if(!X[tt]||et[tt]){if(!(e0(C)&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,C)||J.tagNameCheck instanceof Function&&J.tagNameCheck(C))&&(J.attributeNameCheck instanceof RegExp&&oe(J.attributeNameCheck,tt)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(tt))||tt==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q))))return!1}else if(!Du[tt]&&!oe(K,xs(Q,k,""))&&!((tt==="src"||tt==="xlink:href"||tt==="href")&&C!=="script"&&gk(Q,"data:")===0&&Fv[C])&&!(q&&!oe(L,xs(Q,k,"")))&&Q)return!1}return!0},e0=function(C){return C!=="annotation-xml"&&mg(C,U)},n0=function(C){Ln($.beforeSanitizeAttributes,C,null);const{attributes:tt}=C;if(!tt||Pu(C))return;const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Ot=tt.length;for(;Ot--;){const Qt=tt[Ot],{name:Wt,namespaceURI:kn,value:Pe}=Qt,un=Xt(Wt);let ue=Wt==="value"?Pe:vk(Pe);if(Q.attrName=un,Q.attrValue=ue,Q.keepAttr=!0,Q.forceKeepAttr=void 0,Ln($.uponSanitizeAttribute,C,Q),ue=Q.attrValue,ws&&(un==="id"||un==="name")&&(Eo(Wt,C),ue=$s+ue),dt&&oe(/((--!?|])>)|<\/(style|title)/i,ue)){Eo(Wt,C);continue}if(Q.forceKeepAttr||(Eo(Wt,C),!Q.keepAttr))continue;if(!Z&&oe(/\/>/i,ue)){Eo(Wt,C);continue}G&&eo([H,P,B],fU=>{ue=xs(ue,fU," ")});const r0=Xt(C.nodeName);if(t0(r0,un,ue)){if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!kn)switch(p.getAttributeType(r0,un)){case"TrustedHTML":{ue=E.createHTML(ue);break}case"TrustedScriptURL":{ue=E.createScriptURL(ue);break}}try{kn?C.setAttributeNS(kn,Wt,ue):C.setAttribute(Wt,ue),Pu(C)?Er(C):fg(t.removed)}catch{}}}Ln($.afterSanitizeAttributes,C,null)},pU=function C(tt){let Q=null;const Ot=Kv(tt);for(Ln($.beforeSanitizeShadowDOM,tt,null);Q=Ot.nextNode();)Ln($.uponSanitizeShadowNode,Q,null),Jv(Q),n0(Q),Q.content instanceof s&&C(Q.content);Ln($.afterSanitizeShadowDOM,tt,null)};return t.sanitize=function(C){let tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,Ot=null,Qt=null,Wt=null;if(Ru=!C,Ru&&(C="<!-->"),typeof C!="string"&&!Qv(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw bs("dirty is not a string, aborting")}else throw bs("toString is not a function");if(!t.isSupported)return C;if(It||Nu(tt),t.removed=[],typeof C=="string"&&(Ze=!1),Ze){if(C.nodeName){const un=Xt(C.nodeName);if(!W[un]||Y[un])throw bs("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof o)Q=Zv("<!---->"),Ot=Q.ownerDocument.importNode(C,!0),Ot.nodeType===Es.element&&Ot.nodeName==="BODY"||Ot.nodeName==="HTML"?Q=Ot:Q.appendChild(Ot);else{if(!rt&&!G&&!ot&&C.indexOf("<")===-1)return E&&Ne?E.createHTML(C):C;if(Q=Zv(C),!Q)return rt?null:Ne?b:""}Q&&Ht&&Er(Q.firstChild);const kn=Kv(Ze?C:Q);for(;Qt=kn.nextNode();)Jv(Qt),n0(Qt),Qt.content instanceof s&&pU(Qt.content);if(Ze)return C;if(rt){if(Et)for(Wt=D.call(Q.ownerDocument);Q.firstChild;)Wt.appendChild(Q.firstChild);else Wt=Q;return(X.shadowroot||X.shadowrootmode)&&(Wt=R.call(r,Wt,!0)),Wt}let Pe=ot?Q.outerHTML:Q.innerHTML;return ot&&W["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&oe(_g,Q.ownerDocument.doctype.name)&&(Pe="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
4
+ `+Pe),G&&eo([H,P,B],un=>{Pe=xs(Pe,un," ")}),E&&Ne?E.createHTML(Pe):Pe},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Nu(C),It=!0},t.clearConfig=function(){di=null,It=!1},t.isValidAttribute=function(C,tt,Q){di||Nu({});const Ot=Xt(C),Qt=Xt(tt);return t0(Ot,Qt,Q)},t.addHook=function(C,tt){typeof tt=="function"&&ys($[C],tt)},t.removeHook=function(C,tt){if(tt!==void 0){const Q=fk($[C],tt);return Q===-1?void 0:mk($[C],Q,1)[0]}return fg($[C])},t.removeHooks=function(C){$[C]=[]},t.removeAllHooks=function(){$=Sg()},t}var cu=Tg();const io=e=>cu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),kk=e=>cu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ln=e=>cu.sanitize(e,{ALLOWED_TAGS:[]}),Og=class s0 extends gt{constructor(){super(...arguments),this.type="toolbar",this.renderType=it.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(O.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(O.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(y(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
5
5
  <button
6
6
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
7
- aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${bn(l.id)}`)}" aria-label="${bn(l.title)}">
7
+ aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${ln(l.id)}`)}" aria-label="${ln(l.title)}">
8
8
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
9
- ${Rk(l.iconSVG.content)}
9
+ ${kk(l.iconSVG.content)}
10
10
  </svg>
11
- </button>`).each(function(l,c){N(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),N(this).select("button").on("mouseover focus",function(u){const d=N(this);d.classed("hovered",!0),o.services.events.dispatchEvent(O.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(O.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),N(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(O.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(O.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=N(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=N(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=N(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=N(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=N(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(O.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===Ot.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${l0.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===Ot.MAKE_FULLSCREEN&&l?a.type=Ot.EXIT_FULLSCREEN:a.type===Ot.EXIT_FULLSCREEN&&!l&&(a.type=Ot.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
11
+ </button>`).each(function(l,c){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(u){const d=I(this);d.classed("hovered",!0),o.services.events.dispatchEvent(O.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(O.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(O.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(O.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=I(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(O.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===bt.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${s0.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===bt.MAKE_FULLSCREEN&&l?a.type=bt.EXIT_FULLSCREEN:a.type===bt.EXIT_FULLSCREEN&&!l&&(a.type=bt.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
12
12
  <circle cx="16" cy="16" r="2"></circle>
13
- <circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:p}=y(i,"locale","translations","toolbar");let f;switch(t){case Ot.ZOOM_IN:n&&(f={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case Ot.ZOOM_OUT:n&&(f={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case Ot.RESET_ZOOM:n&&(f={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case Ot.MAKE_FULLSCREEN:f={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Ot.EXIT_FULLSCREEN:f={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Ot.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:p,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(O.Modal.SHOW)};break;case Ot.EXPORT_CSV:f={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case Ot.EXPORT_PNG:f={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case Ot.EXPORT_JPG:f={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return f}getControlIconByType(t){switch(t){case Ot.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
14
- <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Ot.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
15
- <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Ot.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Ot.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case Ot.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case Ot.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case Ot.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Ot.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Ot.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};Cg.buttonID=0;let mo=Cg;const Ag=class c0 extends bt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=c0.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=y(r,"growth");return i===pt.PREFERRED||i===pt.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>y(t,"growth")===pt.STRETCH).size()}render(t=!0){const n=this.model.getOptions(),r=this.parent,{width:i,height:s}=P.getHTMLElementSize(r.node()),a=this.configs.direction===Rt.ROW||this.configs.direction===Rt.ROW_REVERSE,o=y(this.model.getOptions(),"style","prefix"),l=r.classed(`${Se}--${o}--layout-row`,this.configs.direction===Rt.ROW).classed(`${Se}--${o}--layout-row-reverse`,this.configs.direction===Rt.ROW_REVERSE).classed(`${Se}--${o}--layout-column`,this.configs.direction===Rt.COLUMN).classed(`${Se}--${o}--layout-column-reverse`,this.configs.direction===Rt.COLUMN_REVERSE).classed(`${Se}--${o}--layout-alignitems-center`,this.configs.alignItems===sr.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);l.enter().append("div").merge(r.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(d=>{var h;const p=N(this),f=y(u,"renderType")===ot.SVG;d.setParent(f?P.appendOrSelect(p,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):p),f&&!p.select("svg.layout-svg-wrapper").attr("aria-label")&&p.select("svg.layout-svg-wrapper").attr("aria-label",((h=n==null?void 0:n.accessibility)==null?void 0:h.svgAriaLabel)||(n==null?void 0:n.title));const g=y(u,"growth");(g===pt.PREFERRED||g===pt.FIXED)&&d.render(t)})}),r.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const d=y(u,"growth"),h=y(u,"renderType")===ot.SVG?P.getSVGElementSize(N(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):P.getHTMLElementSize(this);if(d===pt.PREFERRED){const p=a?h.width:h.height,f=a?i:s;u.size=p/f*100}}),l.exit().remove(),this.children.filter(u=>y(u,"growth")===pt.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const c=r.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);a?c.style("width",u=>`${u.size/100*i}px`).style("height","100%"):c.style("height",u=>`${u.size/100*s}px`).style("width","100%"),c.each(function(u){u.components.forEach(d=>{y(u,"growth")===pt.STRETCH&&d.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};Ag.instanceID=Math.floor(Math.random()*99999999999);let Ne=Ag;class Fn extends bt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||bp.default.size}px`).style("height",`${this.configs.size||bp.default.size}px`).attr("opacity",0)}}class go extends bt{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1).style("opacity",1).style("visibility","visible"),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),this.modal.on("click",this.handleHideModal),this.modal.select(".cds--modal-container").on("click",s=>{s.stopPropagation()}),this.modal.select(".cds--modal-close").on("click",this.handleHideModal),typeof window<"u"&&window.addEventListener("keydown",this.handleEscapeKey)},this.handleEscapeKey=i=>{i.key==="Escape"&&this.handleHideModal()},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null).style("opacity",0).style("visibility","hidden"),this.modal.on("click",null),this.modal.select(".cds--modal-container").on("click",null),this.modal.select(".cds--modal-close").on("click",null),typeof window<"u"&&window.removeEventListener("keydown",this.handleEscapeKey)},this.init()}addEventListeners(){this.services.events.addEventListener(O.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(O.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=y(n,"locale","translations","tabularRep"),s=y(n,"style","prefix"),a=this.model.getTabularDataArray();return`
13
+ <circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:p}=y(i,"locale","translations","toolbar");let f;switch(t){case bt.ZOOM_IN:n&&(f={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case bt.ZOOM_OUT:n&&(f={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case bt.RESET_ZOOM:n&&(f={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case bt.MAKE_FULLSCREEN:f={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case bt.EXIT_FULLSCREEN:f={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case bt.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:p,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(O.Modal.SHOW)};break;case bt.EXPORT_CSV:f={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case bt.EXPORT_PNG:f={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case bt.EXPORT_JPG:f={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return f}getControlIconByType(t){switch(t){case bt.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
14
+ <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case bt.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
15
+ <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case bt.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case bt.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case bt.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case bt.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case bt.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case bt.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case bt.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};Og.buttonID=0;let so=Og;const wg=class a0 extends gt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=a0.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=y(r,"growth");return i===lt.PREFERRED||i===lt.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>y(t,"growth")===lt.STRETCH).size()}render(t=!0){const n=this.model.getOptions(),r=this.parent,{width:i,height:s}=N.getHTMLElementSize(r.node()),a=this.configs.direction===Mt.ROW||this.configs.direction===Mt.ROW_REVERSE,o=y(this.model.getOptions(),"style","prefix"),l=r.classed(`${de}--${o}--layout-row`,this.configs.direction===Mt.ROW).classed(`${de}--${o}--layout-row-reverse`,this.configs.direction===Mt.ROW_REVERSE).classed(`${de}--${o}--layout-column`,this.configs.direction===Mt.COLUMN).classed(`${de}--${o}--layout-column-reverse`,this.configs.direction===Mt.COLUMN_REVERSE).classed(`${de}--${o}--layout-alignitems-center`,this.configs.alignItems===jn.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);l.enter().append("div").merge(r.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(d=>{var h;const p=I(this),f=y(u,"renderType")===it.SVG;d.setParent(f?N.appendOrSelect(p,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):p),f&&!p.select("svg.layout-svg-wrapper").attr("aria-label")&&p.select("svg.layout-svg-wrapper").attr("aria-label",((h=n==null?void 0:n.accessibility)==null?void 0:h.svgAriaLabel)||(n==null?void 0:n.title));const g=y(u,"growth");(g===lt.PREFERRED||g===lt.FIXED)&&d.render(t)})}),r.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const d=y(u,"growth"),h=y(u,"renderType")===it.SVG?N.getSVGElementSize(I(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):N.getHTMLElementSize(this);if(d===lt.PREFERRED){const p=a?h.width:h.height,f=a?i:s;u.size=p/f*100}}),l.exit().remove(),this.children.filter(u=>y(u,"growth")===lt.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const c=r.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);a?c.style("width",u=>`${u.size/100*i}px`).style("height","100%"):c.style("height",u=>`${u.size/100*s}px`).style("width","100%"),c.each(function(u){u.components.forEach(d=>{y(u,"growth")===lt.STRETCH&&d.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};wg.instanceID=Math.floor(Math.random()*99999999999);let Se=wg;class Cn extends gt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||pp.default.size}px`).style("height",`${this.configs.size||pp.default.size}px`).attr("opacity",0)}}class ao extends gt{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1).style("opacity",1).style("visibility","visible"),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),this.modal.on("click",this.handleHideModal),this.modal.select(".cds--modal-container").on("click",s=>{s.stopPropagation()}),this.modal.select(".cds--modal-close").on("click",this.handleHideModal),typeof window<"u"&&window.addEventListener("keydown",this.handleEscapeKey)},this.handleEscapeKey=i=>{i.key==="Escape"&&this.handleHideModal()},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null).style("opacity",0).style("visibility","hidden"),this.modal.on("click",null),this.modal.select(".cds--modal-container").on("click",null),this.modal.select(".cds--modal-close").on("click",null),typeof window<"u"&&window.removeEventListener("keydown",this.handleEscapeKey)},this.init()}addEventListeners(){this.services.events.addEventListener(O.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(O.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=y(n,"locale","translations","tabularRep"),s=y(n,"style","prefix"),a=this.model.getTabularDataArray();return`
16
16
  <div class="cds--modal-container">
17
17
  <div class="cds--modal-header">
18
18
 
19
19
  <p class="cds--modal-header__label cds--type-delta" id="modal-title">${r}</p>
20
20
 
21
- <p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${bn(n.title)}</p>
21
+ <p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${ln(n.title)}</p>
22
22
 
23
23
  <button class="cds--modal-close" type="button" data-modal-close aria-label="close modal" data-modal-primary-focus>
24
24
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-label="Close" width="20" height="20" viewBox="0 0 32 32" role="img" class="cds--modal-close__icon">
@@ -31,25 +31,25 @@
31
31
  <table class="cds--data-table cds--data-table--no-border">
32
32
  <thead>
33
33
  <tr>
34
- ${Et(a,0).map(o=>`<th scope="col">
35
- <div class="cds--table-header-label">${bn(o)}</div>
34
+ ${yt(a,0).map(o=>`<th scope="col">
35
+ <div class="cds--table-header-label">${ln(o)}</div>
36
36
  </th>`).join("")}
37
37
  </tr>
38
38
  </thead>
39
39
 
40
40
  <tbody>${a.slice(1).map(o=>`
41
41
  <tr>
42
- ${o.map(l=>`<td>${bn(l)}</td>`).join("")}
42
+ ${o.map(l=>`<td>${ln(l)}</td>`).join("")}
43
43
  </tr>`).join("")}
44
44
  </tbody>
45
45
  </table>
46
46
  </div>
47
47
 
48
48
  <div class="cds--modal-footer">
49
- <div class="${Se}--${s}-modal-footer-spacer"></div>
49
+ <div class="${de}--${s}-modal-footer-spacer"></div>
50
50
  <button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>
51
51
  </div>
52
- </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=N(this.services.domUtils.getHolder()),i=y(n,"style","prefix");this.modal=P.appendOrSelect(r,`div.${Se}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Ls extends bt{constructor(){super(...arguments),this.type="title",this.renderType=ot.HTML}render(t=!1){const n=this.getComponentContainer(),r=y(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>bn(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(O.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=P.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(O.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(O.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(O.Tooltip.HIDE)})}}getMaxTitleWidth(){return P.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class yu extends bt{constructor(){super(...arguments),this.type="legend",this.renderType=ot.HTML}render(t=!1){const n=this.getOptions(),r=y(n,"legend"),i=y(r,"alignment"),s=y(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=zt.items.status,l=a.some(x=>x.status===o),c=y(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Zt.CENTER).classed("right-aligned",i===Zt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",vt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,x=>x.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(x){return x.status===zt.items.status.ACTIVE});const p=y(this.getOptions(),"legend","clickable");u.classed("clickable",p&&a.length>1);const f=zt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",vt.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(x,_)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${_}-title`)).attr("aria-checked",({status:x})=>x===zt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.BACKGROUND],dataGroupName:x.name,originalClassName:"checkbox"})).style("background",x=>x.status===zt.items.status.ACTIVE?this.model.getFillColor(x.name)||this.model.getStrokeColor(x.name):null).classed("active",function(x){return x.status===zt.items.status.ACTIVE});g.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const v=y(n,"legend","additionalItems");if(v&&a.length){const x=this,_=u.selectAll("div.additional-item").data(v);_.exit().remove();const E=_.enter().append("div").merge(_).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,R)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+R}-title`));E.selectAll("*").remove();let b,S=1;E.append("svg").classed("icon",!0).each(function(M){const R=N(this);!b||b!=M.type?(b=M.type,S=1):S++,x.addAdditionalItem(R,M,S)}),E.append("p").merge(E.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),p&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=zt.area;if(n.type===Qt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Qt.RADIUS){const{iconData:a,fill:o,stroke:l}=zt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",vt.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===Qt.LINE){const a=zt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",vt.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===Qt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",vt.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?zt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Qt.SIZE){const{iconData:a,fill:o,stroke:l}=zt.size;t.attr("fill","none").attr("role",vt.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===Qt.QUARTILE){const{iconData:a}=zt.quartile;t.selectAll("rect").attr("role",vt.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===Qt.ZOOM){const{iconData:a,color:o}=y(zt,"zoom"),l=t.attr("role",vt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=y(this.getOptions(),"legend","truncation"),r=y(n,"type"),i=y(n,"threshold"),s=y(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==Be.NONE?a.html(function(o){const l=bn(o.name);return l.length>i&&l.length!==s?es(l,r,s):l}):a.html(o=>bn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=y(r,"legend"),s=y(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:N(this)});const o=N(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Be.NONE&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){N(this).datum().name.length>s.threshold&&s.type!==Be.NONE&&t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(O.Legend.ITEM_CLICK,{clickedElement:N(this)});const a=N(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=N(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Be.NONE&&t.services.events.dispatchEvent(O.Tooltip.HIDE),t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:N(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:N(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=N(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class Lg extends bt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=ot.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=P.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=P.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class Ik extends Lg{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=P.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=P.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=P.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var yi,Yt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Yt||(Yt={}));var kg=(yi={},yi[Yt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},yi[Yt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},yi[Yt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},yi[Yt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},yi),Dg=typeof window<"u"?window:{innerHeight:0,innerWidth:0},vo=function(){function e(t){t===void 0&&(t={}),this.positions=kg,this.positions=Object.assign({},kg,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,p=i();u.top<p.top?d=p.top-u.top:u.bottom>p.height&&(d=u.bottom-p.height),u.left<p.left?h=p.left-u.left:u.right>p.width&&(h=u.right-p.width),d&&!h?h=1:h&&!d&&(d=1);var f=n.offsetHeight*n.offsetWidth,g=d*h,m=f-g,v=m/f;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Dg.innerHeight,width:Dg.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new vo;class xu extends bt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=ot.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new vo,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=N(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${fo(i.detail.content)}</p></div>`:o=fo(this.getTooltipHTML(l));const c=P.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${fo(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${fo(this.model.getOptions().tooltip.customHTML(s,o,a))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&N(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(O.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==O.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(O.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(O.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(O.Tooltip.MOVE,null),this.services.events.removeEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(O.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(O.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=y(n,"tooltip","truncation","type"),i=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return r!==Be.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=es(a.label,r,s)),a.value&&a.value.length>i&&(a.value=es(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
52
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=I(this.services.domUtils.getHolder()),i=y(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${de}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Ss extends gt{constructor(){super(...arguments),this.type="title",this.renderType=it.HTML}render(t=!1){const n=this.getComponentContainer(),r=y(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>ln(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(O.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=N.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(O.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(O.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(O.Tooltip.HIDE)})}}getMaxTitleWidth(){return N.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class uu extends gt{constructor(){super(...arguments),this.type="legend",this.renderType=it.HTML}render(t=!1){const n=this.getOptions(),r=y(n,"legend"),i=y(r,"alignment"),s=y(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Nt.items.status,l=a.some(x=>x.status===o),c=y(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===zt.CENTER).classed("right-aligned",i===zt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ht.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,x=>x.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(x){return x.status===Nt.items.status.ACTIVE});const p=y(this.getOptions(),"legend","clickable");u.classed("clickable",p&&a.length>1);const f=Nt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",ht.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(x,_)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${_}-title`)).attr("aria-checked",({status:x})=>x===Nt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",x=>this.model.getColorClassName({classNameTypes:[st.BACKGROUND],dataGroupName:x.name,originalClassName:"checkbox"})).style("background",x=>x.status===Nt.items.status.ACTIVE?this.model.getFillColor(x.name)||this.model.getStrokeColor(x.name):null).classed("active",function(x){return x.status===Nt.items.status.ACTIVE});g.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const v=y(n,"legend","additionalItems");if(v&&a.length){const x=this,_=u.selectAll("div.additional-item").data(v);_.exit().remove();const E=_.enter().append("div").merge(_).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+D}-title`));E.selectAll("*").remove();let b,T=1;E.append("svg").classed("icon",!0).each(function(M){const D=I(this);!b||b!=M.type?(b=M.type,T=1):T++,x.addAdditionalItem(D,M,T)}),E.append("p").merge(E.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),p&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Nt.area;if(n.type===jt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===jt.RADIUS){const{iconData:a,fill:o,stroke:l}=Nt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ht.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===jt.LINE){const a=Nt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ht.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===jt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ht.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Nt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===jt.SIZE){const{iconData:a,fill:o,stroke:l}=Nt.size;t.attr("fill","none").attr("role",ht.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===jt.QUARTILE){const{iconData:a}=Nt.quartile;t.selectAll("rect").attr("role",ht.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===jt.ZOOM){const{iconData:a,color:o}=y(Nt,"zoom"),l=t.attr("role",ht.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=y(this.getOptions(),"legend","truncation"),r=y(n,"type"),i=y(n,"threshold"),s=y(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==we.NONE?a.html(function(o){const l=ln(o.name);return l.length>i&&l.length!==s?Wi(l,r,s):l}):a.html(o=>ln(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=y(r,"legend"),s=y(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:I(this)});const o=I(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==we.NONE&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){I(this).datum().name.length>s.threshold&&s.type!==we.NONE&&t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(O.Legend.ITEM_CLICK,{clickedElement:I(this)});const a=I(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=I(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==we.NONE&&t.services.events.dispatchEvent(O.Tooltip.HIDE),t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:I(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:I(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=I(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class $g extends gt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=it.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class Dk extends $g{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=N.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var ai,Vt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Vt||(Vt={}));var Mg=(ai={},ai[Vt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},ai[Vt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},ai[Vt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},ai[Vt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},ai),Cg=typeof window<"u"?window:{innerHeight:0,innerWidth:0},oo=function(){function e(t){t===void 0&&(t={}),this.positions=Mg,this.positions=Object.assign({},Mg,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,p=i();u.top<p.top?d=p.top-u.top:u.bottom>p.height&&(d=u.bottom-p.height),u.left<p.left?h=p.left-u.left:u.right>p.width&&(h=u.right-p.width),d&&!h?h=1:h&&!d&&(d=1);var f=n.offsetHeight*n.offsetWidth,g=d*h,m=f-g,v=m/f;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Cg.innerHeight,width:Cg.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new oo;class hu extends gt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=it.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new oo,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=I(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${io(i.detail.content)}</p></div>`:o=io(this.getTooltipHTML(l));const c=N.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${io(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${io(this.model.getOptions().tooltip.customHTML(s,o,a))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&I(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(O.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==O.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(O.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(O.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(O.Tooltip.MOVE,null),this.services.events.removeEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(O.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(O.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=y(n,"tooltip","truncation","type"),i=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return r!==we.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=Wi(a.label,r,s)),a.value&&a.value.length>i&&(a.value=Wi(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
53
53
  <div class="datapoint-tooltip${n.bold?" bold":""}">
54
54
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
55
55
  <div class="label">
@@ -58,51 +58,21 @@
58
58
  </div>
59
59
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
60
60
  </div>
61
- </li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=y(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=y(n,"tooltip","enabled");if(r){const i=N(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=P.appendOrSelect(i,`div.${Se}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Yt.LEFT?i.left-=r:n==Yt.RIGHT?i.left+=r:n==Yt.TOP?i.top-=r:n==Yt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Yt.RIGHT,Yt.LEFT,Yt.TOP,Yt.BOTTOM];let d,{horizontalOffset:h}=_p;const{defaultOffset:p}=_p;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let x=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));x=this.addOffsetByPlacement(x,d,p),this.positionService.setElement(s,x);return}let f=y(t,"detail","mousePosition");if(!f)f=mr(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=De.height[m];o&&(f[1]+=v+De.spacerHeight)}f[0]/r>.9?d=Yt.LEFT:f[0]/r<.1?d=Yt.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Yt.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},s,d);this.positionService.setElement(s,g)}}const Rg=class Lo extends bt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=ot.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=P.appendOrSelect(n,"svg.chart-grid-backdrop"),s=P.appendOrSelect(i,`g.${this.type}`),a=P.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=P.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const p=P.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===at.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const g=b=>{const S=b[1]-b[0];let M="0,"+S.toString();const R=Math.floor(l/Lo.DASH_LENGTH),C=R*Lo.DASH_LENGTH;for(let I=0;I<R;I++)M+=","+Lo.DASH_LENGTH;M+=","+(l-C),R%2===1&&(M+=",0"),M+=","+S.toString(),M+=","+l.toString(),p.attr("stroke-dasharray",M)},m=b=>{const S=b.selection;S===null||S[0]===S[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(S))},v=(b,S)=>{const M=vf().range([0,o]).domain(f);let R=[M.invert(b),M.invert(S)];R[0].valueOf()===R[1].valueOf()&&(R=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==R[0].valueOf()||f[1].valueOf()!==R[1].valueOf())&&this.services.zoom.handleDomainChange(R)};let x;const _=b=>{const S=b.selection;S!==null&&(v(S[0],S[1]),s.call(x.move,null),p.style("display","none"))};l!=0&&o!=0&&(x=fm().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",_),s.call(x));const E=this.services.zoom.getZoomRatio();i.on("click",function(b){if(b.shiftKey){const S=this.services.domUtils.getHolder(),M=mr(s.node(),S)[0];let R=M-o*E/2;R<0&&(R=0);let C=M+o*E/2;C>o&&(C=o),v(R,C)}})}}};Rg.DASH_LENGTH=4;let Nk=Rg;class Pk extends bt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=ot.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=fm(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",F.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(F.TOP),i=this.services.zoom.isZoomBarLocked(F.TOP),s=y(this.getOptions(),"zoomBar",F.TOP,"type"),a=y(this.getOptions(),"axes",F.BOTTOM,"highlights"),o=De.height[s],{width:l}=P.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=P.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(P.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",De.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ke.GRAPH_VIEW?P.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ke.SLIDER_VIEW&&P.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,p=h.getMainXScale(),f=h.getMainYScale(),g=h.getMainXScaleType();if(p&&g===at.TIME){let m=this.services.zoom.getZoomBarData();if(tn(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const x=this.model.get("initialZoomDomain"),_=y(this.getOptions(),"zoomBar",F.TOP,"initialZoomDomain");_&&_[0]&&_[1]&&(_[0]=new Date(_[0]),_[1]=new Date(_[1])),_&&!(x&&x[0].valueOf()===_[0].valueOf()&&x[1].valueOf()===_[1].valueOf())?this.model.set({initialZoomDomain:ht([],_),zoomDomain:_?ht([],_):v},{skipUpdate:!0}):_===null&&x!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ht([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(en(m,S=>S.value));const E=this.model.get("zoomDomain");if(s===Ke.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const S=a.highlightStartMapsTo,M=a.highlightEndMapsTo,R=a.color,C=a.labelMapsTo;a.data.forEach((I,w)=>{P.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(I[S])).attr("width",this.xScale(I[M])-this.xScale(I[S])).style("fill",R&&R.scale[I[C]]?R.scale[I[C]]:null).style("fill-opacity",.1).style("stroke",R&&R.scale[I[C]]?R.scale[I[C]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(E,c,l);const b=P.appendOrSelect(n,this.brushSelector).call(this.brush);if(E!==void 0)if(E[0].valueOf()===E[1].valueOf())b.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const S=E.map(M=>this.xScale(M));S[1]-S[0]<this.MIN_SELECTION_DIFF||(b.call(this.brush.move,S),this.updateBrushHandle(this.getComponentContainer(),S))}i&&(this.brush.filter(()=>!1),b.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",F.TOP,"type"),a=De.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=O.ZoomBar.SELECTION_START:t.type==="brush"?a=O.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=O.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=De.handleWidth,s=y(this.getOptions(),"zoomBar",F.TOP,"type"),a=De.height[s],o=-i/2,l=De.handleBarWidth,c=s===Ke.GRAPH_VIEW?De.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(p){if(p.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(p.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(p){return"handle-bar handle-bar--"+p.type}),h.attr("x",function(p){if(p.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(p.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ke.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",F.TOP,"type"),r=De.height[n],i=this.getComponentContainer().select("svg.zoom-container");P.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,x,_)=>E=>s.getValueFromScale(v,x,_,E),d=u(this.xScale,l,a),h=u(this.yScale,c,o),p=y(this.getOptions(),"zoomBar",F.TOP,"type"),f=De.height[p],g=cu().x(v=>d(v)).y0(f).y1(v=>f-h(v)),m=P.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=P.appendOrSelect(t,"clipPath").attr("id",n);P.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=$n(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",F.TOP,"type"),a=De.height[s],o=Os()([[n,a],[r,a]]);P.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),P.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",F.TOP,"type")===Ke.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(O.ZoomBar.UPDATE,this.render.bind(this))}}class Uk extends bt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=ot.SVG,this.positionService=new vo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(F).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,p=null;c===F.LEFT||c===F.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===at.LABELS,[g,m]=h.range(),[v,x]=p.range(),{cartesianScales:_}=l.services,E=_.getOrientation(),b=I=>_.getDomainValue(I),S=I=>_.getRangeValue(I),[M,R]=Rn(b,S,E),C=N(this);c===F.TOP||c===F.BOTTOM?(C.selectAll("line.threshold-line").transition().call(I=>l.services.transitions.setupTransition({transition:I,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",v).attr("x1",({datum:I})=>M(I)+(f?u.step()/2:0)).attr("x2",({datum:I})=>M(I)+(f?u.step()/2:0)).style("stroke",({fillColor:I})=>I),C.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:I})=>-M(I)).attr("width",Math.abs(v-x)).classed("rotate",!0)):(C.selectAll("line.threshold-line").transition().call(I=>l.services.transitions.setupTransition({transition:I,name:"threshold-line-update",animate:t})).attr("x1",g).attr("x2",m).attr("y1",({datum:I})=>R(I)+(f?u.step()/2:0)).attr("y2",({datum:I})=>R(I)+(f?u.step()/2:0)).style("stroke",({fillColor:I})=>I),C.selectAll("rect.threshold-hoverable-area").attr("x",g).attr("y",({datum:I})=>R(I)).attr("width",Math.abs(m-g)).classed("rotate",!1))}),this.services.events.addEventListener(O.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(O.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===at.TIME){const l=[F.LEFT,F.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),p=tc(d.ticks(),y(h,"timeInterval"));return Jl(n,0,d.ticks(),p,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=N(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=P.appendOrSelect(t,`div.${Se}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=mr(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(bn(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Yt.RIGHT,Yt.LEFT,Yt.TOP,Yt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){N(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:N(this),datum:N(this).datum()})}).on("mouseout",function(n){N(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:N(this),datum:N(this).datum()})})}}class Bk extends bt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=ot.SVG,this.positionService=new vo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(F).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,p]=u.range(),[f,g]=d.range(),{cartesianScales:m}=l.services,v=m.getOrientation(),x=M=>m.getDomainValue(M),_=M=>m.getRangeValue(M),[E,b]=Rn(x,_,v),S=N(this);c===F.TOP||c===F.BOTTOM?S.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("y",Math.max(g+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:M,...R})=>E(R[M])).attr("width",({highlightStartMapsTo:M,highlightEndMapsTo:R,...C})=>Math.max(E(C[R])-E(C[M]),0)).style("stroke",({color:M,labelMapsTo:R,...C})=>M&&M.scale[C[R]]?M.scale[C[R]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:R,...C})=>M&&M.scale[C[R]]?M.scale[C[R]]:null):S.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:M,...R})=>b(R[M])).attr("height",({highlightStartMapsTo:M,highlightEndMapsTo:R,...C})=>Math.max(b(C[M])-b(C[R]),0)).style("stroke",({color:M,labelMapsTo:R,...C})=>M&&M.scale[C[R]]?M.scale[C[R]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:R,...C})=>M&&M.scale[C[R]]?M.scale[C[R]]:null)})}}class Ig extends xu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const f=h[p];d=[{label:l,value:u},...Array.isArray(f)&&f.length===2?[{label:"Start",value:f[0]},{label:"End",value:f[1]}]:[{label:c,value:h[p]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:Et(r,"locale.translations.group")||Et(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const p=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(p)&&p.length===2?`${p[0]} - ${p[1]}`:p,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,p)=>p.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:Et(r,"locale.translations.total")||Et(r,"tooltip.totalLabel")||"Total",value:n.reduce((p,f)=>p+f[h],0),bold:!0})}return d}}function Ng(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Hk(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function bu(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function Vk(e){return e.depth}function Gk(e,t){return t-1-e.height}function Pg(e,t){return e.sourceLinks.length?e.depth:t-1}function yo(e){return function(){return e}}function Ug(e,t){return xo(e.source,t.source)||e.index-t.index}function Bg(e,t){return xo(e.target,t.target)||e.index-t.index}function xo(e,t){return e.y0-t.y0}function _u(e){return e.value}function zk(e){return e.index}function Fk(e){return e.nodes}function jk(e){return e.links}function Hg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Vg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function Wk(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=zk,l=Pg,c,u,d=Fk,h=jk,p=6;function f(){const T={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(T),m(T),v(T),x(T),b(T),Vg(T),T}f.update=function(T){return Vg(T),T},f.nodeId=function(T){return arguments.length?(o=typeof T=="function"?T:yo(T),f):o},f.nodeAlign=function(T){return arguments.length?(l=typeof T=="function"?T:yo(T),f):l},f.nodeSort=function(T){return arguments.length?(c=T,f):c},f.nodeWidth=function(T){return arguments.length?(i=+T,f):i},f.nodePadding=function(T){return arguments.length?(s=a=+T,f):s},f.nodes=function(T){return arguments.length?(d=typeof T=="function"?T:yo(T),f):d},f.links=function(T){return arguments.length?(h=typeof T=="function"?T:yo(T),f):h},f.linkSort=function(T){return arguments.length?(u=T,f):u},f.size=function(T){return arguments.length?(e=t=0,n=+T[0],r=+T[1],f):[n-e,r-t]},f.extent=function(T){return arguments.length?(e=+T[0][0],n=+T[1][0],t=+T[0][1],r=+T[1][1],f):[[e,t],[n,r]]},f.iterations=function(T){return arguments.length?(p=+T,f):p};function g({nodes:T,links:$}){for(const[D,B]of T.entries())B.index=D,B.sourceLinks=[],B.targetLinks=[];const A=new Map(T.map((D,B)=>[o(D,B,T),D]));for(const[D,B]of $.entries()){B.index=D;let{source:Q,target:W}=B;typeof Q!="object"&&(Q=B.source=Hg(A,Q)),typeof W!="object"&&(W=B.target=Hg(A,W)),Q.sourceLinks.push(B),W.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:D,targetLinks:B}of T)D.sort(u),B.sort(u)}function m({nodes:T}){for(const $ of T)$.value=$.fixedValue===void 0?Math.max(bu($.sourceLinks,_u),bu($.targetLinks,_u)):$.fixedValue}function v({nodes:T}){const $=T.length;let A=new Set(T),D=new Set,B=0;for(;A.size;){for(const Q of A){Q.depth=B;for(const{target:W}of Q.sourceLinks)D.add(W)}if(++B>$)throw new Error("circular link");A=D,D=new Set}}function x({nodes:T}){const $=T.length;let A=new Set(T),D=new Set,B=0;for(;A.size;){for(const Q of A){Q.height=B;for(const{source:W}of Q.targetLinks)D.add(W)}if(++B>$)throw new Error("circular link");A=D,D=new Set}}function _({nodes:T}){const $=Ng(T,B=>B.depth)+1,A=(n-e-i)/($-1),D=new Array($);for(const B of T){const Q=Math.max(0,Math.min($-1,Math.floor(l.call(null,B,$))));B.layer=Q,B.x0=e+Q*A,B.x1=B.x0+i,D[Q]?D[Q].push(B):D[Q]=[B]}if(c)for(const B of D)B.sort(c);return D}function E(T){const $=Hk(T,A=>(r-t-(A.length-1)*a)/bu(A,_u));for(const A of T){let D=t;for(const B of A){B.y0=D,B.y1=D+B.value*$,D=B.y1+a;for(const Q of B.sourceLinks)Q.width=Q.value*$}D=(r-D+a)/(A.length+1);for(let B=0;B<A.length;++B){const Q=A[B];Q.y0+=D*(B+1),Q.y1+=D*(B+1)}V(A)}}function b(T){const $=_(T);a=Math.min(s,(r-t)/(Ng($,A=>A.length)-1)),E($);for(let A=0;A<p;++A){const D=Math.pow(.99,A),B=Math.max(1-D,(A+1)/p);M($,D,B),S($,D,B)}}function S(T,$,A){for(let D=1,B=T.length;D<B;++D){const Q=T[D];for(const W of Q){let q=0,X=0;for(const{source:tt,value:Z}of W.targetLinks){let et=Z*(W.layer-tt.layer);q+=U(tt,W)*et,X+=et}if(!(X>0))continue;let ut=(q/X-W.y0)*$;W.y0+=ut,W.y1+=ut,w(W)}c===void 0&&Q.sort(xo),R(Q,A)}}function M(T,$,A){for(let D=T.length,B=D-2;B>=0;--B){const Q=T[B];for(const W of Q){let q=0,X=0;for(const{target:tt,value:Z}of W.sourceLinks){let et=Z*(tt.layer-W.layer);q+=H(W,tt)*et,X+=et}if(!(X>0))continue;let ut=(q/X-W.y0)*$;W.y0+=ut,W.y1+=ut,w(W)}c===void 0&&Q.sort(xo),R(Q,A)}}function R(T,$){const A=T.length>>1,D=T[A];I(T,D.y0-a,A-1,$),C(T,D.y1+a,A+1,$),I(T,r,T.length-1,$),C(T,t,0,$)}function C(T,$,A,D){for(;A<T.length;++A){const B=T[A],Q=($-B.y0)*D;Q>1e-6&&(B.y0+=Q,B.y1+=Q),$=B.y1+a}}function I(T,$,A,D){for(;A>=0;--A){const B=T[A],Q=(B.y1-$)*D;Q>1e-6&&(B.y0-=Q,B.y1-=Q),$=B.y0-a}}function w({sourceLinks:T,targetLinks:$}){if(u===void 0){for(const{source:{sourceLinks:A}}of $)A.sort(Bg);for(const{target:{targetLinks:A}}of T)A.sort(Ug)}}function V(T){if(u===void 0)for(const{sourceLinks:$,targetLinks:A}of T)$.sort(Bg),A.sort(Ug)}function U(T,$){let A=T.y0-(T.sourceLinks.length-1)*a/2;for(const{target:D,width:B}of T.sourceLinks){if(D===$)break;A+=B+a}for(const{source:D,width:B}of $.targetLinks){if(D===T)break;A-=B}return A}function H(T,$){let A=$.y0-($.targetLinks.length-1)*a/2;for(const{source:D,width:B}of $.targetLinks){if(D===T)break;A+=B+a}for(const{target:D,width:B}of T.sourceLinks){if(D===$)break;A-=B}return A}return f}var Eu=Math.PI,Tu=2*Eu,Dr=1e-6,qk=Tu-Dr;function Su(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Gg(){return new Su}Su.prototype=Gg.prototype={constructor:Su,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>Dr)if(!(Math.abs(u*o-l*c)>Dr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,f=o*o+l*l,g=h*h+p*p,m=Math.sqrt(f),v=Math.sqrt(d),x=i*Math.tan((Eu-Math.acos((f+d-g)/(2*m*v)))/2),_=x/v,E=x/m;Math.abs(_-1)>Dr&&(this._+="L"+(e+_*c)+","+(t+_*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+E*o)+","+(this._y1=t+E*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,d=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Dr||Math.abs(this._y1-c)>Dr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%Tu+Tu),d>qk?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>Dr&&(this._+="A"+n+","+n+",0,"+ +(d>=Eu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function zg(e){return function(){return e}}function Yk(e){return e[0]}function Xk(e){return e[1]}var Zk=Array.prototype.slice;function Kk(e){return e.source}function Qk(e){return e.target}function Jk(e){var t=Kk,n=Qk,r=Yk,i=Xk,s=null;function a(){var o,l=Zk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Gg()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:zg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:zg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function tD(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function eD(){return Jk(tD)}function nD(e){return[e.source.x1,e.y0]}function rD(e){return[e.target.x0,e.y1]}function iD(){return eD().source(nD).target(rD)}class sD extends bt{constructor(){super(...arguments),this.type="alluvial",this.renderType=ot.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:r,height:i}=P.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=an.minNodePadding;s.alluvial.nodePadding>an.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Pg;c===Zt.LEFT?u=Vk:c===Zt.RIGHT&&(u=Gk);const d=Wk().nodeId(x=>x.name).nodeWidth(an.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(x=>Object.assign({},x)),links:a.map(x=>Object.assign({},x))}),this.graph.nodes=this.graph.nodes.filter(x=>x.value!==0);const h={};this.graph.nodes.forEach(x=>{const _=x.x0;x.category&&(h[_]=x==null?void 0:x.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",x=>`translate(${x}, 0)`).append("text").attr("id",(x,_)=>this.services.domUtils.generateElementIDString(`alluvial-category-${_}`)).style("font-size","14px").text(x=>h[x]?h[x]:"").attr("y",20).attr("x",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-category-${_}`),{width:b}=P.getSVGElementSize(N(`text#${E}`),{useBBox:!0});let S=0;return x+S>=b&&(S=-b+4),S});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const x=y(this.getOptions(),"color","scale");x&&p.enter().append("linearGradient").attr("id",_=>`${this.gradient_id}-link-${_.index}`).attr("gradientUnits","userSpaceOnUse").call(_=>_.append("stop").attr("offset","0%").attr("stop-color",E=>x[E.source.name])).call(_=>_.append("stop").attr("offset","100%").attr("stop-color",E=>x[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",iD()).attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-line-${x.index}`)).attr("class",x=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:x.source.index,originalClassName:"link"})).style("stroke",x=>o?`url(#${this.gradient_id}-link-${x.index})`:this.model.getFillColor(x.source.name,null,{...x,source:x.source.name,target:x.target.name})).attr("stroke-width",x=>Math.max(1,x.width)).style("stroke-opacity",an.opacity.default).attr("aria-label",x=>`${x.source.name} → ${x.target.name} (${x.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-${x.index}`)).classed("node-group",!0).attr("transform",x=>`translate(${x.x0}, ${x.y0})`);f.append("rect").classed("node",!0).attr("height",x=>x.y1-x.y0).attr("width",x=>x.x1-x.x0).attr("fill","black");const g=f.append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${x.index}`)),{code:m,number:v}=y(s,"locale");g.append("text").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${x.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(x=>`${x.name} (${v(x.value,m)})`).attr("aria-label",x=>`${x.name} (${x.value})`),g.append("rect").classed("node-text-bg",!0).attr("width",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=P.getSVGElementSize(N(`text#${E}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),g.attr("transform",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=P.getSVGElementSize(N(`text#${E}`),{useBBox:!0}),S=(x.y1-x.y0)/2-9;let M=x.x1-x.x0;return x.x1>=b?M=M-(b+16):M+=4,`translate(${M}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=y(this.getOptions(),"locale"),s=wa((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(N(a).lower(),l.style("stroke-opacity",an.opacity.default)):l.style("stroke-opacity",function(){return a===this?(N(this).raise(),an.opacity.selected):an.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=N(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEMOVE,{event:a,element:N(this),datum:o}),n.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(O.Alluvial.LINE_CLICK,{event:a,element:N(this),datum:o})}).on("mouseout",function(a,o){const l=N(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(O.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=wa((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",an.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(N(this).classed("link-hovered",!0).raise(),an.opacity.selected):an.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=N(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=ts(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),d=ts(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEMOVE,{event:r,element:N(this),datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_CLICK,{event:r,element:N(this),datum:i})}).on("mouseout",function(r,i){const s=N(this),a=ts(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",an.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=ts(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
61
+ </li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=y(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=y(n,"tooltip","enabled");if(r){const i=I(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${de}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Vt.LEFT?i.left-=r:n==Vt.RIGHT?i.left+=r:n==Vt.TOP?i.top-=r:n==Vt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Vt.RIGHT,Vt.LEFT,Vt.TOP,Vt.BOTTOM];let d,{horizontalOffset:h}=fp;const{defaultOffset:p}=fp;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let x=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));x=this.addOffsetByPlacement(x,d,p),this.positionService.setElement(s,x);return}let f=y(t,"detail","mousePosition");if(!f)f=er(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=be.height[m];o&&(f[1]+=v+be.spacerHeight)}f[0]/r>.9?d=Vt.LEFT:f[0]/r<.1?d=Vt.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Vt.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},s,d);this.positionService.setElement(s,g)}}const Ag=class So extends gt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=it.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),s=N.appendOrSelect(i,`g.${this.type}`),a=N.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=N.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const p=N.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===nt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const g=b=>{const T=b[1]-b[0];let M="0,"+T.toString();const D=Math.floor(l/So.DASH_LENGTH),A=D*So.DASH_LENGTH;for(let R=0;R<D;R++)M+=","+So.DASH_LENGTH;M+=","+(l-A),D%2===1&&(M+=",0"),M+=","+T.toString(),M+=","+l.toString(),p.attr("stroke-dasharray",M)},m=b=>{const T=b.selection;T===null||T[0]===T[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(T))},v=(b,T)=>{const M=uf().range([0,o]).domain(f);let D=[M.invert(b),M.invert(T)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==D[0].valueOf()||f[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let x;const _=b=>{const T=b.selection;T!==null&&(v(T[0],T[1]),s.call(x.move,null),p.style("display","none"))};l!=0&&o!=0&&(x=um().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",_),s.call(x));const E=this.services.zoom.getZoomRatio();i.on("click",function(b){if(b.shiftKey){const T=this.services.domUtils.getHolder(),M=er(s.node(),T)[0];let D=M-o*E/2;D<0&&(D=0);let A=M+o*E/2;A>o&&(A=o),v(D,A)}})}}};Ag.DASH_LENGTH=4;let Rk=Ag;class Ik extends gt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=it.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=um(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=be.height[s],{width:l}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=N.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(N.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",be.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ue.GRAPH_VIEW?N.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ue.SLIDER_VIEW&&N.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,p=h.getMainXScale(),f=h.getMainYScale(),g=h.getMainXScaleType();if(p&&g===nt.TIME){let m=this.services.zoom.getZoomBarData();if(Ve(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const x=this.model.get("initialZoomDomain"),_=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");_&&_[0]&&_[1]&&(_[0]=new Date(_[0]),_[1]=new Date(_[1])),_&&!(x&&x[0].valueOf()===_[0].valueOf()&&x[1].valueOf()===_[1].valueOf())?this.model.set({initialZoomDomain:at([],_),zoomDomain:_?at([],_):v},{skipUpdate:!0}):_===null&&x!==null&&this.model.set({initialZoomDomain:null,zoomDomain:at([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ge(m,T=>T.value));const E=this.model.get("zoomDomain");if(s===Ue.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const T=a.highlightStartMapsTo,M=a.highlightEndMapsTo,D=a.color,A=a.labelMapsTo;a.data.forEach((R,$)=>{N.appendOrSelect(d,`rect.highlight-${$}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(R[T])).attr("width",this.xScale(R[M])-this.xScale(R[T])).style("fill",D&&D.scale[R[A]]?D.scale[R[A]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[R[A]]?D.scale[R[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(E,c,l);const b=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(E!==void 0)if(E[0].valueOf()===E[1].valueOf())b.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const T=E.map(M=>this.xScale(M));T[1]-T[0]<this.MIN_SELECTION_DIFF||(b.call(this.brush.move,T),this.updateBrushHandle(this.getComponentContainer(),T))}i&&(this.brush.filter(()=>!1),b.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=be.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=O.ZoomBar.SELECTION_START:t.type==="brush"?a=O.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=O.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=be.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=be.height[s],o=-i/2,l=be.handleBarWidth,c=s===Ue.GRAPH_VIEW?be.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(p){if(p.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(p.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(p){return"handle-bar handle-bar--"+p.type}),h.attr("x",function(p){if(p.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(p.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ue.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),r=be.height[n],i=this.getComponentContainer().select("svg.zoom-container");N.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,x,_)=>E=>s.getValueFromScale(v,x,_,E),d=u(this.xScale,l,a),h=u(this.yScale,c,o),p=y(this.getOptions(),"zoomBar",z.TOP,"type"),f=be.height[p],g=eu().x(v=>d(v)).y0(f).y1(v=>f-h(v)),m=N.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=pn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=be.height[s],o=vs()([[n,a],[r,a]]);N.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),N.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Ue.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(O.ZoomBar.UPDATE,this.render.bind(this))}}class Nk extends gt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=it.SVG,this.positionService=new oo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,p=null;c===z.LEFT||c===z.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===nt.LABELS,[g,m]=h.range(),[v,x]=p.range(),{cartesianScales:_}=l.services,E=_.getOrientation(),b=R=>_.getDomainValue(R),T=R=>_.getRangeValue(R),[M,D]=bn(b,T,E),A=I(this);c===z.TOP||c===z.BOTTOM?(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",v).attr("x1",({datum:R})=>M(R)+(f?u.step()/2:0)).attr("x2",({datum:R})=>M(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-M(R)).attr("width",Math.abs(v-x)).classed("rotate",!0)):(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",g).attr("x2",m).attr("y1",({datum:R})=>D(R)+(f?u.step()/2:0)).attr("y2",({datum:R})=>D(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",g).attr("y",({datum:R})=>D(R)).attr("width",Math.abs(m-g)).classed("rotate",!1))}),this.services.events.addEventListener(O.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(O.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===nt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),p=Wl(d.ticks(),y(h,"timeInterval"));return jl(n,0,d.ticks(),p,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${de}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=er(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Vt.RIGHT,Vt.LEFT,Vt.TOP,Vt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:I(this),datum:I(this).datum()})})}}class Pk extends gt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=it.SVG,this.positionService=new oo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,p]=u.range(),[f,g]=d.range(),{cartesianScales:m}=l.services,v=m.getOrientation(),x=M=>m.getDomainValue(M),_=M=>m.getRangeValue(M),[E,b]=bn(x,_,v),T=I(this);c===z.TOP||c===z.BOTTOM?T.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("y",Math.max(g+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:M,...D})=>E(D[M])).attr("width",({highlightStartMapsTo:M,highlightEndMapsTo:D,...A})=>Math.max(E(A[D])-E(A[M]),0)).style("stroke",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null):T.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:M,...D})=>b(D[M])).attr("height",({highlightStartMapsTo:M,highlightEndMapsTo:D,...A})=>Math.max(b(A[M])-b(A[D]),0)).style("stroke",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null)})}}class Lg extends hu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const f=h[p];d=[{label:l,value:u},...Array.isArray(f)&&f.length===2?[{label:"Start",value:f[0]},{label:"End",value:f[1]}]:[{label:c,value:h[p]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:yt(r,"locale.translations.group")||yt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const p=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(p)&&p.length===2?`${p[0]} - ${p[1]}`:p,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})}}).sort((h,p)=>p.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((p,f)=>p+f[h],0),bold:!0})}return d}}function kg(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Uk(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function du(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function Bk(e){return e.depth}function Hk(e,t){return t-1-e.height}function Dg(e,t){return e.sourceLinks.length?e.depth:t-1}function lo(e){return function(){return e}}function Rg(e,t){return co(e.source,t.source)||e.index-t.index}function Ig(e,t){return co(e.target,t.target)||e.index-t.index}function co(e,t){return e.y0-t.y0}function pu(e){return e.value}function Vk(e){return e.index}function Gk(e){return e.nodes}function zk(e){return e.links}function Ng(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Pg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function Fk(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=Vk,l=Dg,c,u,d=Gk,h=zk,p=6;function f(){const S={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(S),m(S),v(S),x(S),b(S),Pg(S),S}f.update=function(S){return Pg(S),S},f.nodeId=function(S){return arguments.length?(o=typeof S=="function"?S:lo(S),f):o},f.nodeAlign=function(S){return arguments.length?(l=typeof S=="function"?S:lo(S),f):l},f.nodeSort=function(S){return arguments.length?(c=S,f):c},f.nodeWidth=function(S){return arguments.length?(i=+S,f):i},f.nodePadding=function(S){return arguments.length?(s=a=+S,f):s},f.nodes=function(S){return arguments.length?(d=typeof S=="function"?S:lo(S),f):d},f.links=function(S){return arguments.length?(h=typeof S=="function"?S:lo(S),f):h},f.linkSort=function(S){return arguments.length?(u=S,f):u},f.size=function(S){return arguments.length?(e=t=0,n=+S[0],r=+S[1],f):[n-e,r-t]},f.extent=function(S){return arguments.length?(e=+S[0][0],n=+S[1][0],t=+S[0][1],r=+S[1][1],f):[[e,t],[n,r]]},f.iterations=function(S){return arguments.length?(p=+S,f):p};function g({nodes:S,links:w}){for(const[k,U]of S.entries())U.index=k,U.sourceLinks=[],U.targetLinks=[];const L=new Map(S.map((k,U)=>[o(k,U,S),k]));for(const[k,U]of w.entries()){U.index=k;let{source:K,target:W}=U;typeof K!="object"&&(K=U.source=Ng(L,K)),typeof W!="object"&&(W=U.target=Ng(L,W)),K.sourceLinks.push(U),W.targetLinks.push(U)}if(u!=null)for(const{sourceLinks:k,targetLinks:U}of S)k.sort(u),U.sort(u)}function m({nodes:S}){for(const w of S)w.value=w.fixedValue===void 0?Math.max(du(w.sourceLinks,pu),du(w.targetLinks,pu)):w.fixedValue}function v({nodes:S}){const w=S.length;let L=new Set(S),k=new Set,U=0;for(;L.size;){for(const K of L){K.depth=U;for(const{target:W}of K.sourceLinks)k.add(W)}if(++U>w)throw new Error("circular link");L=k,k=new Set}}function x({nodes:S}){const w=S.length;let L=new Set(S),k=new Set,U=0;for(;L.size;){for(const K of L){K.height=U;for(const{source:W}of K.targetLinks)k.add(W)}if(++U>w)throw new Error("circular link");L=k,k=new Set}}function _({nodes:S}){const w=kg(S,U=>U.depth)+1,L=(n-e-i)/(w-1),k=new Array(w);for(const U of S){const K=Math.max(0,Math.min(w-1,Math.floor(l.call(null,U,w))));U.layer=K,U.x0=e+K*L,U.x1=U.x0+i,k[K]?k[K].push(U):k[K]=[U]}if(c)for(const U of k)U.sort(c);return k}function E(S){const w=Uk(S,L=>(r-t-(L.length-1)*a)/du(L,pu));for(const L of S){let k=t;for(const U of L){U.y0=k,U.y1=k+U.value*w,k=U.y1+a;for(const K of U.sourceLinks)K.width=K.value*w}k=(r-k+a)/(L.length+1);for(let U=0;U<L.length;++U){const K=L[U];K.y0+=k*(U+1),K.y1+=k*(U+1)}H(L)}}function b(S){const w=_(S);a=Math.min(s,(r-t)/(kg(w,L=>L.length)-1)),E(w);for(let L=0;L<p;++L){const k=Math.pow(.99,L),U=Math.max(1-k,(L+1)/p);M(w,k,U),T(w,k,U)}}function T(S,w,L){for(let k=1,U=S.length;k<U;++k){const K=S[k];for(const W of K){let j=0,X=0;for(const{source:J,value:Y}of W.targetLinks){let et=Y*(W.layer-J.layer);j+=P(J,W)*et,X+=et}if(!(X>0))continue;let ct=(j/X-W.y0)*w;W.y0+=ct,W.y1+=ct,$(W)}c===void 0&&K.sort(co),D(K,L)}}function M(S,w,L){for(let k=S.length,U=k-2;U>=0;--U){const K=S[U];for(const W of K){let j=0,X=0;for(const{target:J,value:Y}of W.sourceLinks){let et=Y*(J.layer-W.layer);j+=B(W,J)*et,X+=et}if(!(X>0))continue;let ct=(j/X-W.y0)*w;W.y0+=ct,W.y1+=ct,$(W)}c===void 0&&K.sort(co),D(K,L)}}function D(S,w){const L=S.length>>1,k=S[L];R(S,k.y0-a,L-1,w),A(S,k.y1+a,L+1,w),R(S,r,S.length-1,w),A(S,t,0,w)}function A(S,w,L,k){for(;L<S.length;++L){const U=S[L],K=(w-U.y0)*k;K>1e-6&&(U.y0+=K,U.y1+=K),w=U.y1+a}}function R(S,w,L,k){for(;L>=0;--L){const U=S[L],K=(U.y1-w)*k;K>1e-6&&(U.y0-=K,U.y1-=K),w=U.y0-a}}function $({sourceLinks:S,targetLinks:w}){if(u===void 0){for(const{source:{sourceLinks:L}}of w)L.sort(Ig);for(const{target:{targetLinks:L}}of S)L.sort(Rg)}}function H(S){if(u===void 0)for(const{sourceLinks:w,targetLinks:L}of S)w.sort(Ig),L.sort(Rg)}function P(S,w){let L=S.y0-(S.sourceLinks.length-1)*a/2;for(const{target:k,width:U}of S.sourceLinks){if(k===w)break;L+=U+a}for(const{source:k,width:U}of w.targetLinks){if(k===S)break;L-=U}return L}function B(S,w){let L=w.y0-(w.targetLinks.length-1)*a/2;for(const{source:k,width:U}of w.targetLinks){if(k===S)break;L+=U+a}for(const{target:k,width:U}of S.sourceLinks){if(k===w)break;L-=U}return L}return f}var fu=Math.PI,mu=2*fu,xr=1e-6,jk=mu-xr;function gu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ug(){return new gu}gu.prototype=Ug.prototype={constructor:gu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>xr)if(!(Math.abs(u*o-l*c)>xr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,f=o*o+l*l,g=h*h+p*p,m=Math.sqrt(f),v=Math.sqrt(d),x=i*Math.tan((fu-Math.acos((f+d-g)/(2*m*v)))/2),_=x/v,E=x/m;Math.abs(_-1)>xr&&(this._+="L"+(e+_*c)+","+(t+_*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+E*o)+","+(this._y1=t+E*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,d=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>xr||Math.abs(this._y1-c)>xr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%mu+mu),d>jk?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>xr&&(this._+="A"+n+","+n+",0,"+ +(d>=fu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function Bg(e){return function(){return e}}function Wk(e){return e[0]}function qk(e){return e[1]}var Yk=Array.prototype.slice;function Xk(e){return e.source}function Zk(e){return e.target}function Kk(e){var t=Xk,n=Zk,r=Wk,i=qk,s=null;function a(){var o,l=Yk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Ug()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:Bg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Bg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function Qk(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function Jk(){return Kk(Qk)}function tD(e){return[e.source.x1,e.y0]}function eD(e){return[e.target.x0,e.y1]}function nD(){return Jk().source(tD).target(eD)}class rD extends gt{constructor(){super(...arguments),this.type="alluvial",this.renderType=it.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=We.minNodePadding;s.alluvial.nodePadding>We.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Dg;c===zt.LEFT?u=Bk:c===zt.RIGHT&&(u=Hk);const d=Fk().nodeId(x=>x.name).nodeWidth(We.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(x=>Object.assign({},x)),links:a.map(x=>Object.assign({},x))}),this.graph.nodes=this.graph.nodes.filter(x=>x.value!==0);const h={};this.graph.nodes.forEach(x=>{const _=x.x0;x.category&&(h[_]=x==null?void 0:x.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",x=>`translate(${x}, 0)`).append("text").attr("id",(x,_)=>this.services.domUtils.generateElementIDString(`alluvial-category-${_}`)).style("font-size","14px").text(x=>h[x]?h[x]:"").attr("y",20).attr("x",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-category-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});let T=0;return x+T>=b&&(T=-b+4),T});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const x=y(this.getOptions(),"color","scale");x&&p.enter().append("linearGradient").attr("id",_=>`${this.gradient_id}-link-${_.index}`).attr("gradientUnits","userSpaceOnUse").call(_=>_.append("stop").attr("offset","0%").attr("stop-color",E=>x[E.source.name])).call(_=>_.append("stop").attr("offset","100%").attr("stop-color",E=>x[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",nD()).attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-line-${x.index}`)).attr("class",x=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:x.source.index,originalClassName:"link"})).style("stroke",x=>o?`url(#${this.gradient_id}-link-${x.index})`:this.model.getFillColor(x.source.name,null,{...x,source:x.source.name,target:x.target.name})).attr("stroke-width",x=>Math.max(1,x.width)).style("stroke-opacity",We.opacity.default).attr("aria-label",x=>`${x.source.name} → ${x.target.name} (${x.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-${x.index}`)).classed("node-group",!0).attr("transform",x=>`translate(${x.x0}, ${x.y0})`);f.append("rect").classed("node",!0).attr("height",x=>x.y1-x.y0).attr("width",x=>x.x1-x.x0).attr("fill","black");const g=f.append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${x.index}`)),{code:m,number:v}=y(s,"locale");g.append("text").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${x.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(x=>`${x.name} (${v(x.value,m)})`).attr("aria-label",x=>`${x.name} (${x.value})`),g.append("rect").classed("node-text-bg",!0).attr("width",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),g.attr("transform",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0}),T=(x.y1-x.y0)/2-9;let M=x.x1-x.x0;return x.x1>=b?M=M-(b+16):M+=4,`translate(${M}, ${T})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=y(this.getOptions(),"locale"),s=ya((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",We.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),We.opacity.selected):We.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(O.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(O.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=ya((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",We.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(I(this).classed("link-hovered",!0).raise(),We.opacity.selected):We.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=I(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=ji(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),d=ji(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEMOVE,{event:r,element:I(this),datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=ji(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",We.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=ji(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
62
62
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
63
63
  <polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
64
64
  <rect width="32" height="32"/>
65
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Pe extends bt{constructor(){super(...arguments),this.type="grid",this.renderType=ot.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(P.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(P.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Tc(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=om(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Dn(u).tx)-Number(Dn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Dn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Dn(o).tx;else if(o)l=+Dn(o).tx-+Dn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=P.getSVGElementSize(u).width-+Dn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=Dn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=P.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=P.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Fg extends bt{constructor(){super(...arguments),this.type="area",this.renderType=ot.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?Ln.opacity.unselected:Ln.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Ln.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=cu().curve(this.services.curves.getD3Curve()).defined(b=>{const S=s.getRangeIdentifier();return b[S]!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(b,S)=>{y(r,"axes",b,"includeZero")===!1&&S[0]>0&&S[1]>0&&(d=S[0])},p=b=>u?s.getBoundedScaledValues(b)[0]:s.getRangeValue(d),f=b=>u?s.getBoundedScaledValues(b)[1]:s.getRangeValue(b);a===Xt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(b=>s.getDomainValue(b)).y0(b=>p(b)).y1(b=>f(b))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(b=>p(b)).x1(b=>f(b)).y(b=>s.getDomainValue(b)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,b=>b.name),x=N(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const b=x.select(`path.${this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:l[0].name})}`).node();let S;if(b)S=getComputedStyle(b,null).getPropertyValue("stroke");else{const M=y(this.model.getOptions(),"color","scale");if(M!==null){const R=Object.keys(M);S=M[R[0]]}}_c.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:_c.getStops(i,S)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const _=this,E=v.enter().append("path");m?E.merge(v).style("fill",b=>`url(#${this.services.domUtils.generateElementIDString(`${b.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:b.name,originalClassName:"area"})).attr("d",b=>{const{data:S}=b;return o(S)}):(E.attr("opacity",0).merge(v).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:b.name,originalClassName:"area"})).style("fill",b=>_.model.getFillColor(b.name,null,b.data)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"area-update-enter",animate:t})).attr("opacity",u?1:Ln.opacity.selected).attr("d",b=>{const{data:S}=b;return o(S)}),u&&E.attr("fill-opacity",Ln.opacity.selected).style("stroke",b=>_.model.getStrokeColor(b.name,null,b.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xi extends bt{constructor(){super(...arguments),this.type="line",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?kn.opacity.unselected:kn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",kn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=Rn(s,a,r.getOrientation()),c=this.getOptions(),u=Os().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const f=r.getRangeIdentifier(p);return p[f]!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(g=>c.axes[g].percentage),{groupMapsTo:f}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(g=>{const m=this.services.cartesianScales.getDomainIdentifier(g),v=this.services.cartesianScales.getRangeIdentifier(g);return{name:y(g,0,f),data:g.map(x=>({[m]:x.data.sharedStackKey,[f]:x[f],[v]:x[1]})),hidden:!AC(g,x=>x[0]!==x[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:f}=p;return f.map(g=>{const m=this.services.cartesianScales.getRangeIdentifier(g);return g[m]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:f}=p;return u(f)})}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const jg=5;function aD(e,t){return e>t-jg&&e<t+jg}class nr extends bt{constructor(){super(...arguments),this.type="ruler",this.renderType=ot.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Xt.HORIZONTAL?r:n,d=P.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=P.appendOrSelect(d,"line.ruler-line"),p=i.selectAll("[role=graphics-symbol]"),f=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>aD(m.domainValue,u));if(this.pointsWithinLine&&f.length===this.pointsWithinLine.length&&f.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=f,this.services.events.dispatchEvent(O.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const x=m[0].domainValue,_=Math.abs(u-v.domainValue),E=Math.abs(u-x);return _>E||(_<E?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(E=>E.originalData).filter(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]!=null}),v=g.map(E=>E.domainValue),x=p.filter(E=>{const b=this.services.cartesianScales.getDomainValue(E);return v.includes(b)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!im(this.elementsToHighlight,x)&&this.hideRuler(),x.dispatch("mouseover"),this.elementsToHighlight=x,this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const _=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",_.domainValue).attr("y2",_.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",_.domainValue).attr("x2",_.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=P.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(O.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=mr(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=nw(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=P.appendOrSelect(t,"svg.chart-grid-backdrop")}}let _n=class extends bt{constructor(){super(...arguments),this.type="scatter",this.renderType=ot.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=Rn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Rn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=p=>a.getDomainValue(p),c=p=>a.getRangeValue(p),[u,d]=Rn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=a.getDomainIdentifier(p),g=this.model.getIsFilled(p[o],p[f],p,i)?[lt.FILL,lt.STROKE]:[lt.STROKE];return this.model.getColorClassName({classNameTypes:g,dataGroupName:p[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",p=>this.isDatapointThresholdAnomaly(p)).classed("filled",p=>{const f=a.getDomainIdentifier(p);return this.model.getIsFilled(p[o],p[f],p,i)}).classed("unfilled",p=>{const f=a.getDomainIdentifier(p);return!this.model.getIsFilled(p[o],p[f],p,i)}).transition().call(p=>{var f;return(f=this.services.transitions)==null?void 0:f.setupTransition({transition:p,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",p=>{const f=a.getDomainIdentifier(p);if(this.model.getIsFilled(p[o],p[f],p,i))return this.model.getFillColor(p[o],p[f],p)}).style("stroke",p=>{const f=a.getDomainIdentifier(p);return this.model.getStrokeColor(p[o],p[f],p)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",p=>{const f=a.getRangeIdentifier(p);return p[f]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=N(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=N(this);(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_CLICK,{event:r,element:N(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=N(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}};class Wg extends bt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=ot.SVG,this.truncation={[F.LEFT]:!1,[F.RIGHT]:!1,[F.TOP]:!1,[F.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=P.getSVGElementSize(s,{useAttrs:!0}),l=P.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===F.BOTTOM||n===F.TOP?(c=this.configs.axes[F.LEFT]?this.margins.left:0,u=this.configs.axes[F.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===at.LABELS||this.scaleType===at.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case F.LEFT:h=om;break;case F.BOTTOM:h=Tc;break;case F.RIGHT:h=BC;break;case F.TOP:h=UC;break}l.attr("aria-label",`${n} axis`);const p=!l.select("g.ticks").empty();let f=P.appendOrSelect(l,"g.ticks");p||(f.attr("role",`${vt.GRAPHICS_OBJECT} ${vt.GROUP}`),f.attr("aria-label",`${n} ticks`));const g=P.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===at.TIME||m.scaleType===at.TIME,x=n===F.LEFT||n===F.RIGHT,_=this.model.get("zoomDomain");if(_&&v&&!x&&d.domain(_),!i){f.attr("aria-hidden",!0);return}const E=y(m,"scaleType"),b=y(r,"data","loading"),S=y(m,"ticks","number"),M=y(m,"ticks","values"),R=y(m,"truncation","type"),C=y(m,"truncation","threshold"),I=y(m,"truncation","numCharacter"),w=S!==null,V=y(r,"timeScale"),U=P.appendOrSelect(g,"g.tick"),H=P.appendOrSelect(U,"text").text("0"),T=P.getSVGElementSize(H.node(),{useBBox:!0}).height;U.remove();const $=this.scaleType||m.scaleType||at.LINEAR,A=h(d).tickSizeOuter(0);if(d.ticks){let Z;if(w?Z=S:(Z=Zn.ticks.number,x&&(Z=this.getNumberOfFittingTicks(o,T,Zn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(Z=0),A.ticks(Z),v)if(!d.ticks(Z).length)A.tickValues([]);else{const et=y(r,"timeScale","addSpaceOnEdges"),dt=y(r,"axes",n,"domain"),j=d.copy();et&&!dt&&j.nice(Z);const Y=j.ticks(Z);et&&Y.length>2&&!dt&&(Y.splice(Y.length-1,1),Y.splice(0,1)),A.tickValues(Y)}}let D;const B=y(m,"ticks","formatter"),{code:Q,number:W}=y(r,"locale");if(v){const Z=tc(A.tickValues(),y(r,"timeScale","timeInterval"));B===null?D=(et,dt)=>Jl(et,dt,A.tickValues(),Z,V,r.locale):D=(et,dt)=>{const j=Jl(et,dt,A.tickValues(),Z,V,r.locale);return B(et,dt,j)}}else B===null?$===at.LINEAR&&(D=Z=>W(Z,Q)):D=B;A.tickFormat(D);const[q,X]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(M){if(v)M.forEach((Z,et)=>{Z.getTime===void 0&&(M[et]=new Date(Z))}),ut=M.filter(Z=>{const et=Z.getTime();return et>=new Date(q).getTime()&&et<=new Date(X).getTime()});else if(E===at.LABELS){const Z=this.services.cartesianScales.getScaleByPosition(n).domain();ut=M.filter(et=>Z.includes(et))}else ut=M.filter(Z=>Z>=q&&Z<=X);A.tickValues(ut)}switch(n){case F.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case F.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case F.RIGHT:f.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case F.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const tt=this.model.isDataEmpty();if(m.title){const Z=P.appendOrSelect(l,"text.axis-title").html(tt||b?"":bn(m.title)),et=y(m,"titleOrientation");let dt;switch(n){case F.LEFT:et===Bs.RIGHT?Z.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):Z.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case F.BOTTOM:Z.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case F.RIGHT:et===Bs.LEFT?Z.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):Z.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case F.TOP:dt=P.getSVGElementSize(Z,{useBBox:!0}).height,Z.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${dt/2})`).style("text-anchor","middle");break}}if(v){const Z=tc(A.tickValues(),y(r,"timeScale","timeInterval")),et=V.showDayName,dt=f;t&&(f=f.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),f=f.call(A),dt.selectAll(".tick").data(A.tickValues(),d).order().select("text").attr("class",(j,Y)=>Gp(j,Y,A.tickValues(),Z,et)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call(A):f=f.transition().call(Z=>this.services.transitions.setupTransition({transition:Z,name:"axis-update",animate:t})).call(A);if(g.call(A),n===F.BOTTOM||n===F.TOP){let Z=!1;const et=y(m,"ticks","rotation");if(et===Si.ALWAYS)Z=!0;else if(et===Si.NEVER)Z=!1;else if(!et||et===Si.AUTO)if(d.step)Z=g.selectAll("g.tick text").nodes().some(dt=>P.getSVGElementSize(dt,{useBBox:!0}).width>=d.step());else{Z=!1;const dt=g.append("text").text("A"),j=P.getSVGElementSize(dt.node(),{useBBox:!0}).width;let Y;g.selectAll("g.tick").each(function(){const K=N(this),z=parseFloat(y(Dn(this),"tx"));z!==null&&Y+K.text().length*j*.8>=z&&(Z=!0),Y=z}),dt.remove()}Z?(w||(A.ticks(this.getNumberOfFittingTicks(a,T,Zn.ticks.horizontalSpaceRatio)),g.call(A),f.call(A)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===F.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(b?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",Z=>Z),g.selectAll("g.tick").attr("aria-label",Z=>Z),R!==Be.NONE&&E===at.LABELS&&!M){const Z=this.services.cartesianScales.getScaleDomain(n);if(Z.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const dt=this;l.selectAll("g.tick text").data(Z).text(function(j){return j.length>C?(dt.truncation[n]=!0,es(j,R,I)):j}),this.getInvisibleAxisRef().selectAll("g.tick text").data(Z).text(function(j){return j.length>C?es(j,R,I):j}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(Z)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=P.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:N(this),datum:u}),a===at.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:N(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:N(this),datum:u}),a===at.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:N(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:N(this),datum:u}),a===at.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return rm(i,2,Zn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;P.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class oD extends Wg{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=P.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=N(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=P.getSVGElementSize(c,{useBBox:!0}),h=P.appendOrSelect(l,"rect.axis-holder");let p=0,f=0;switch(n){case F.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case F.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case F.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,s.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case F.BOTTOM:p=-(u/2),f=d/2-2,s.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-Zn.hover.rectanglePadding).attr("y",f).attr("width",u+Zn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=P.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=N(this).select("text"),d=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===at.LABELS&&d.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=N(this).select("text"),d=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:N(this).select("text"),datum:N(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:N(this).select("text"),datum:N(this).select("text").datum()}),a===at.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:N(this),datum:N(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:N(this),datum:N(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(O.Tooltip.HIDE),l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:N(this),datum:N(this).select("text").datum()})),n===F.LEFT||n===F.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;P.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class $e extends bt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=ot.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(F),i=y(this.getOptions(),"axes");r.forEach(a=>{i[F[a]]&&(n[F[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=F[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===wi.DEFAULT?new Wg(this.model,this.services,l):new oD(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:d}=P.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=P.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===F.LEFT||l===F.RIGHT)&&(h+=5)),l){case F.TOP:s.top=d+h;break;case F.BOTTOM:s.bottom=d+h;break;case F.LEFT:s.left=u+h;break;case F.RIGHT:s.right=u+h;break}}),this.services.events.dispatchEvent(O.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(O.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class be extends bt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Kt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Kt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Kt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Kt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Xt.VERTICAL&&this.drawYGrid(t),n===Xt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=sn().domain([0,1]).range(t),this.yScale=sn().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=P.getSVGElementSize(n,{useAttrs:!0});this.backdrop=P.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=P.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=P.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=P.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=P.getSVGElementSize(i,{useAttrs:!0}),o=P.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");P.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ss().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Pt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,p=P.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let f=t+Pt.xOffset;c===Zt.CENTER?f=s/2:c===Zt.RIGHT&&(f=s-t-Pt.xOffset);const g=t+Pt.yOffset;p.attr("transform",`translate(${f}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=P.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Pt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=P.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=P.appendOrSelect(i,"defs").lower(),c=P.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
65
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Te extends gt{constructor(){super(...arguments),this.type="grid",this.renderType=it.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(N.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(N.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=mc(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=rm(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(xn(u).tx)-Number(xn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+xn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+xn(o).tx;else if(o)l=+xn(o).tx-+xn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+xn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=xn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=N.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=N.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Hg extends gt{constructor(){super(...arguments),this.type="area",this.renderType=it.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",vn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=eu().curve(this.services.curves.getD3Curve()).defined(b=>{const T=s.getRangeIdentifier();return b[T]!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(b,T)=>{y(r,"axes",b,"includeZero")===!1&&T[0]>0&&T[1]>0&&(d=T[0])},p=b=>u?s.getBoundedScaledValues(b)[0]:s.getRangeValue(d),f=b=>u?s.getBoundedScaledValues(b)[1]:s.getRangeValue(b);a===Gt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(b=>s.getDomainValue(b)).y0(b=>p(b)).y1(b=>f(b))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(b=>p(b)).x1(b=>f(b)).y(b=>s.getDomainValue(b)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,b=>b.name),x=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const b=x.select(`path.${this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:l[0].name})}`).node();let T;if(b)T=getComputedStyle(b,null).getPropertyValue("stroke");else{const M=y(this.model.getOptions(),"color","scale");if(M!==null){const D=Object.keys(M);T=M[D[0]]}}pc.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:pc.getStops(i,T)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const _=this,E=v.enter().append("path");m?E.merge(v).style("fill",b=>`url(#${this.services.domUtils.generateElementIDString(`${b.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:b.name,originalClassName:"area"})).attr("d",b=>{const{data:T}=b;return o(T)}):(E.attr("opacity",0).merge(v).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:b.name,originalClassName:"area"})).style("fill",b=>_.model.getFillColor(b.name,null,b.data)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"area-update-enter",animate:t})).attr("opacity",u?1:vn.opacity.selected).attr("d",b=>{const{data:T}=b;return o(T)}),u&&E.attr("fill-opacity",vn.opacity.selected).style("stroke",b=>_.model.getStrokeColor(b.name,null,b.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class oi extends gt{constructor(){super(...arguments),this.type="line",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?yn.opacity.unselected:yn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",yn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=bn(s,a,r.getOrientation()),c=this.getOptions(),u=vs().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const f=r.getRangeIdentifier(p);return p[f]!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(g=>c.axes[g].percentage),{groupMapsTo:f}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(g=>{const m=this.services.cartesianScales.getDomainIdentifier(g),v=this.services.cartesianScales.getRangeIdentifier(g);return{name:y(g,0,f),data:g.map(x=>({[m]:x.data.sharedStackKey,[f]:x[f],[v]:x[1]})),hidden:!MC(g,x=>x[0]!==x[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:f}=p;return f.map(g=>{const m=this.services.cartesianScales.getRangeIdentifier(g);return g[m]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:f}=p;return u(f)})}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Vg=5;function iD(e,t){return e>t-Vg&&e<t+Vg}class Gn extends gt{constructor(){super(...arguments),this.type="ruler",this.renderType=it.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Gt.HORIZONTAL?r:n,d=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=N.appendOrSelect(d,"line.ruler-line"),p=i.selectAll("[role=graphics-symbol]"),f=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>iD(m.domainValue,u));if(this.pointsWithinLine&&f.length===this.pointsWithinLine.length&&f.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=f,this.services.events.dispatchEvent(O.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const x=m[0].domainValue,_=Math.abs(u-v.domainValue),E=Math.abs(u-x);return _>E||(_<E?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(E=>E.originalData).filter(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]!=null}),v=g.map(E=>E.domainValue),x=p.filter(E=>{const b=this.services.cartesianScales.getDomainValue(E);return v.includes(b)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!tm(this.elementsToHighlight,x)&&this.hideRuler(),x.dispatch("mouseover"),this.elementsToHighlight=x,this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const _=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",_.domainValue).attr("y2",_.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",_.domainValue).attr("x2",_.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=N.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(O.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=er(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=JO(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-grid-backdrop")}}let cn=class extends gt{constructor(){super(...arguments),this.type="scatter",this.renderType=it.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=bn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=bn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=p=>a.getDomainValue(p),c=p=>a.getRangeValue(p),[u,d]=bn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=a.getDomainIdentifier(p),g=this.model.getIsFilled(p[o],p[f],p,i)?[st.FILL,st.STROKE]:[st.STROKE];return this.model.getColorClassName({classNameTypes:g,dataGroupName:p[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",p=>this.isDatapointThresholdAnomaly(p)).classed("filled",p=>{const f=a.getDomainIdentifier(p);return this.model.getIsFilled(p[o],p[f],p,i)}).classed("unfilled",p=>{const f=a.getDomainIdentifier(p);return!this.model.getIsFilled(p[o],p[f],p,i)}).transition().call(p=>{var f;return(f=this.services.transitions)==null?void 0:f.setupTransition({transition:p,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",p=>{const f=a.getDomainIdentifier(p);if(this.model.getIsFilled(p[o],p[f],p,i))return this.model.getFillColor(p[o],p[f],p)}).style("stroke",p=>{const f=a.getDomainIdentifier(p);return this.model.getStrokeColor(p[o],p[f],p)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",p=>{const f=a.getRangeIdentifier(p);return p[f]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=I(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=I(this);(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=I(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}};class Gg extends gt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=it.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=N.getSVGElementSize(s,{useAttrs:!0}),l=N.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===nt.LABELS||this.scaleType===nt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=rm;break;case z.BOTTOM:h=mc;break;case z.RIGHT:h=PC;break;case z.TOP:h=NC;break}l.attr("aria-label",`${n} axis`);const p=!l.select("g.ticks").empty();let f=N.appendOrSelect(l,"g.ticks");p||(f.attr("role",`${ht.GRAPHICS_OBJECT} ${ht.GROUP}`),f.attr("aria-label",`${n} ticks`));const g=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===nt.TIME||m.scaleType===nt.TIME,x=n===z.LEFT||n===z.RIGHT,_=this.model.get("zoomDomain");if(_&&v&&!x&&d.domain(_),!i){f.attr("aria-hidden",!0);return}const E=y(m,"scaleType"),b=y(r,"data","loading"),T=y(m,"ticks","number"),M=y(m,"ticks","values"),D=y(m,"truncation","type"),A=y(m,"truncation","threshold"),R=y(m,"truncation","numCharacter"),$=T!==null,H=y(r,"timeScale"),P=N.appendOrSelect(g,"g.tick"),B=N.appendOrSelect(P,"text").text("0"),S=N.getSVGElementSize(B.node(),{useBBox:!0}).height;P.remove();const w=this.scaleType||m.scaleType||nt.LINEAR,L=h(d).tickSizeOuter(0);if(d.ticks){let Y;if($?Y=T:(Y=In.ticks.number,x&&(Y=this.getNumberOfFittingTicks(o,S,In.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(Y=0),L.ticks(Y),v)if(!d.ticks(Y).length)L.tickValues([]);else{const et=y(r,"timeScale","addSpaceOnEdges"),ut=y(r,"axes",n,"domain"),F=d.copy();et&&!ut&&F.nice(Y);const q=F.ticks(Y);et&&q.length>2&&!ut&&(q.splice(q.length-1,1),q.splice(0,1)),L.tickValues(q)}}let k;const U=y(m,"ticks","formatter"),{code:K,number:W}=y(r,"locale");if(v){const Y=Wl(L.tickValues(),y(r,"timeScale","timeInterval"));U===null?k=(et,ut)=>jl(et,ut,L.tickValues(),Y,H,r.locale):k=(et,ut)=>{const F=jl(et,ut,L.tickValues(),Y,H,r.locale);return U(et,ut,F)}}else U===null?w===nt.LINEAR&&(k=Y=>W(Y,K)):k=U;L.tickFormat(k);const[j,X]=this.services.cartesianScales.getScaleByPosition(n).domain();let ct;if(M){if(v)M.forEach((Y,et)=>{Y.getTime===void 0&&(M[et]=new Date(Y))}),ct=M.filter(Y=>{const et=Y.getTime();return et>=new Date(j).getTime()&&et<=new Date(X).getTime()});else if(E===nt.LABELS){const Y=this.services.cartesianScales.getScaleByPosition(n).domain();ct=M.filter(et=>Y.includes(et))}else ct=M.filter(Y=>Y>=j&&Y<=X);L.tickValues(ct)}switch(n){case z.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:f.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const J=this.model.isDataEmpty();if(m.title){const Y=N.appendOrSelect(l,"text.axis-title").html(J||b?"":ln(m.title)),et=y(m,"titleOrientation");let ut;switch(n){case z.LEFT:et===Ls.RIGHT?Y.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):Y.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:et===Ls.LEFT?Y.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):Y.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ut=N.getSVGElementSize(Y,{useBBox:!0}).height,Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ut/2})`).style("text-anchor","middle");break}}if(v){const Y=Wl(L.tickValues(),y(r,"timeScale","timeInterval")),et=H.showDayName,ut=f;t&&(f=f.transition().call(F=>this.services.transitions.setupTransition({transition:F,name:"axis-update",animate:t}))),f=f.call(L),ut.selectAll(".tick").data(L.tickValues(),d).order().select("text").attr("class",(F,q)=>Ip(F,q,L.tickValues(),Y,et)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call(L):f=f.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:t})).call(L);if(g.call(L),n===z.BOTTOM||n===z.TOP){let Y=!1;const et=y(m,"ticks","rotation");if(et===mi.ALWAYS)Y=!0;else if(et===mi.NEVER)Y=!1;else if(!et||et===mi.AUTO)if(d.step)Y=g.selectAll("g.tick text").nodes().some(ut=>N.getSVGElementSize(ut,{useBBox:!0}).width>=d.step());else{Y=!1;const ut=g.append("text").text("A"),F=N.getSVGElementSize(ut.node(),{useBBox:!0}).width;let q;g.selectAll("g.tick").each(function(){const Z=I(this),G=parseFloat(y(xn(this),"tx"));G!==null&&q+Z.text().length*F*.8>=G&&(Y=!0),q=G}),ut.remove()}Y?($||(L.ticks(this.getNumberOfFittingTicks(a,S,In.ticks.horizontalSpaceRatio)),g.call(L),f.call(L)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(b?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",Y=>Y),g.selectAll("g.tick").attr("aria-label",Y=>Y),D!==we.NONE&&E===nt.LABELS&&!M){const Y=this.services.cartesianScales.getScaleDomain(n);if(Y.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const ut=this;l.selectAll("g.tick text").data(Y).text(function(F){return F.length>A?(ut.truncation[n]=!0,Wi(F,D,R)):F}),this.getInvisibleAxisRef().selectAll("g.tick text").data(Y).text(function(F){return F.length>A?Wi(F,D,R):F}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(Y)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===nt.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Jf(i,2,In.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class sD extends Gg{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=N.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0}),h=N.appendOrSelect(l,"rect.axis-holder");let p=0,f=0;switch(n){case z.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case z.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case z.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,s.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:p=-(u/2),f=d/2-2,s.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-In.hover.rectanglePadding).attr("y",f).attr("width",u+In.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===nt.LABELS&&d.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===nt.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(O.Tooltip.HIDE),l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends gt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=it.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(a=>{i[z[a]]&&(n[z[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=z[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===vi.DEFAULT?new Gg(this.model,this.services,l):new sD(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=N.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===z.LEFT||l===z.RIGHT)&&(h+=5)),l){case z.TOP:s.top=d+h;break;case z.BOTTOM:s.bottom=d+h;break;case z.LEFT:s.left=u+h;break;case z.RIGHT:s.right=u+h;break}}),this.services.events.dispatchEvent(O.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(O.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class ce extends gt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Ft.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Ft.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Ft.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Ft.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Gt.VERTICAL&&this.drawYGrid(t),n===Gt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=je().domain([0,1]).range(t),this.yScale=je().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});this.backdrop=N.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=N.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=N.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=N.getSVGElementSize(i,{useAttrs:!0}),o=N.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=gs().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,p=N.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let f=t+Lt.xOffset;c===zt.CENTER?f=s/2:c===zt.RIGHT&&(f=s-t-Lt.xOffset);const g=t+Lt.yOffset;p.attr("transform",`translate(${f}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=N.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=N.appendOrSelect(i,"defs").lower(),c=N.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
66
66
  <stop class="${n}" offset="${a}"></stop>
67
67
  <stop class="${r}" offset="${a+.2}"></stop>
68
68
  <stop class="${n}" offset="${a+2*.2}"></stop>
69
- `;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(zC).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class lD extends bt{constructor(){super(...arguments),this.type="boxplot",this.renderType=ot.SVG}render(t){const n=this.getComponentContainer({ariaLabel:"box plots",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,d]=o.range(),h=c-l,p=u-d;if(h===0)return;const{cartesianScales:f}=this.services,g=f.getOrientation(),m=g===Xt.VERTICAL,[v,x]=Rn(w=>this.services.cartesianScales.getDomainValue(w),w=>this.services.cartesianScales.getRangeValue(w),g),_=Math.floor((m?h:p)/s.length),E=Math.min(_/2,16),b=this.model.getBoxplotData(),S=n.selectAll(".box-group").data(b);S.exit().remove();const M=S.enter().append("g").attr("class","box-group"),R=S.merge(M);M.append("path").merge(S.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Fe.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalstartline",animate:t})).attr("d",w=>{const V=f.getDomainValue(w[i]),U=V,H=f.getRangeValue(w.whiskers.min),T=f.getRangeValue(w.quartiles.q_25);return me({x0:V,x1:U,y0:H,y1:T},g)}),M.append("path").merge(S.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Fe.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalendline",animate:t})).attr("d",w=>{const V=f.getDomainValue(w[i]),U=V,H=f.getRangeValue(w.whiskers.max),T=f.getRangeValue(w.quartiles.q_75);return me({x0:V,x1:U,y0:H,y1:T},g)}),M.append("path").merge(S.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],originalClassName:"box"})).attr("fill-opacity",Fe.box.opacity.default).attr("stroke-width",Fe.strokeWidth.default).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",w=>w[i]).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-quartiles",animate:t})).attr("d",w=>{const V=f.getDomainValue(w[i])-E/2,U=V+E,H=f.getRangeValue(Math[m?"max":"min"](w.quartiles.q_75,w.quartiles.q_25)),T=H+Math.abs(f.getRangeValue(w.quartiles.q_75)-f.getRangeValue(w.quartiles.q_25));return me({x0:V,x1:U,y0:H,y1:T},g)}),M.append("path").merge(S.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",w=>{const V=f.getDomainValue(w[i])-E/2,U=V+E,H=f.getRangeValue(w.whiskers.min),T=f.getRangeValue(w.whiskers.max);return me({x0:V,x1:U,y0:H,y1:T},g)}),M.append("path").merge(S.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Fe.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-startingwhisker",animate:t})).attr("d",w=>{const V=f.getDomainValue(w[i])-E/4,U=V+E/2,H=f.getRangeValue(w.whiskers.min),T=f.getRangeValue(w.whiskers.min);return me({x0:V,x1:U,y0:H,y1:T},g)}),M.append("path").merge(S.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-median",animate:t})).attr("d",w=>{const V=f.getDomainValue(w[i])-E/2,U=V+E,H=f.getRangeValue(w.quartiles.q_50);return me({x0:V,x1:U,y0:H,y1:H},g)}),M.append("path").merge(S.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Fe.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-endingwhisker",animate:t})).attr("d",w=>{const V=f.getDomainValue(w[i])-E/4,U=V+E/2,H=f.getRangeValue(w.whiskers.max),T=f.getRangeValue(w.whiskers.max);return me({x0:V,x1:U,y0:H,y1:T},g)});const C=R.selectAll("circle.outlier").data(w=>w.outliers.map(V=>({min:w.whiskers.min,max:w.whiskers.max,[i]:w[i],value:V})));C.exit().remove();const I=C.enter().append("circle");C.merge(I).attr("r",Fe.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Fe.circle.opacity.default).attr("cx",v).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-circles",animate:t})).attr("cy",x),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=N(this);N(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Fe.box.opacity.hovered),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=N(this);t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(O.Boxplot.BOX_CLICK,{event:i,element:N(this),datum:s})}).on("mouseout",function(i,s){const a=N(this);N(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Fe.box.opacity.default),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=N(this);o.classed("hovered",!0).attr("fill-opacity",Fe.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=N(this);t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Boxplot.OUTLIER_CLICK,{event:s,element:N(this),datum:a})}).on("mouseout",function(s,a){const o=N(this);o.classed("hovered",!1).attr("fill-opacity",Fe.circle.opacity.default),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class bi extends bt{constructor(){super(...arguments),this.type="zero-line",this.renderType=ot.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer({isPresentational:!0});if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const d=Lp({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());P.appendOrSelect(o,"line.domain").transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class cD extends _n{constructor(){super(...arguments),this.type="bubble",this.renderType=ot.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=P.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?en(s):[1,1];return sn().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=Rn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-label",h=>{const p=o.getRangeIdentifier(h);return h[p]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[p],h)}).style("stroke",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[p],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=y(this.getOptions(),"bubble");return[{label:y(n,"radiusLabel"),value:t[y(n,"radiusMapsTo")]}]}}class uD extends bt{constructor(){super(...arguments),this.type="bullet",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bullet graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),d=()=>{const g=[];s.forEach(v=>{v.ranges?v.ranges.forEach((x,_)=>{x!=null&&x<u&&g.push({datum:v,value:x,order:_+1})}):g.push({datum:v,order:1})});const m=P.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,v=>`${v[r]}-${v.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let x,_,E,b;return v.order===1?(x=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=x+16,E=c-2,b=l+1):(x=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=x+16,E=this.services.cartesianScales.getRangeValue(v.value),b=c),me({x0:x,x1:_,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=P.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const v=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[v],m)}).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-4,x=v+8,_=this.services.cartesianScales.getRangeValue(0)+1,E=this.services.cartesianScales.getRangeValue(m);return me({x0:v,x1:x,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const g=P.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>y(m,"marker")!==null),m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-12,x=v+24,_=this.services.cartesianScales.getRangeValue(m.marker);return me({x0:v,x1:x,y0:_,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let g=[];s.filter(v=>y(v,"marker")!==null).forEach(v=>{const x=v.marker,_=v[o];g=g.concat([{datum:v,value:x*.25,barValue:_},{datum:v,value:x*.5,barValue:_},{datum:v,value:x*.75,barValue:_}])});const m=P.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,v=>v[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:x})=>{let _=4;v.ranges&&v.ranges.indexOf(x)!==-1&&(_=8);const E=this.services.cartesianScales.getDomainValue(v)-_/2,b=E+_,S=this.services.cartesianScales.getRangeValue(x);return me({x0:E,x1:b,y0:S,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),p(),f(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=y(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=N(this);c.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=y(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:o,element:N(this),datum:l}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:o,element:N(this),datum:l})}).on("mouseout",function(o,l){const c=N(this);c.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:c})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function hD(e){return e}function dD(e){if(e==null)return hD;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,d=new Array(u);for(d[0]=(t+=o[0])*r+s,d[1]=(n+=o[1])*i+a;c<u;)d[c]=o[c],++c;return d}}function pD(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function fD(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return qg(e,n)})}:qg(e,t)}function qg(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Ou(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function Ou(e,t){var n=dD(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,f=h.length;p<f;++p)d.push(n(h[p],p));u<0&&pD(d,f)}function s(u){return n(u)}function a(u){for(var d=[],h=0,p=u.length;h<p;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function mD(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],p,f;if(p=i[d])if(delete i[p.end],p.push(c),p.end=h,f=r[h]){delete r[f.start];var g=f===p?p:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[p.start]=i[p.end]=p;else if(p=r[h])if(delete r[p.start],p.unshift(c),p.start=d,f=i[d]){delete i[f.end];var m=f===p?p:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[p.start]=i[p.end]=p;else p=[c],r[p.start=d]=i[p.end=h]=p});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(p){h[0]+=p[0],h[1]+=p[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(p){n[p<0?~p:p]=1}),s.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function gD(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function vD(e){return Ou(e,yD.apply(this,arguments))}function yD(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return gD(Ou(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(p){p._||(p._=1,u.push(p))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(g){g.forEach(function(m){m.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=mD(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),p,f;d<u;++d)(p=o(c[d]))>h&&(f=c[0],c[0]=c[d],c[d]=f,h=p);return c}).filter(function(l){return l.length>0})}}class xD extends nr{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=ot.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),d=a.getDomainScale(),h=d.invert(o===Xt.VERTICAL?n:r),p=P.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=P.appendOrSelect(p,"line.ruler-line"),g=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(Et(m,"data.x0"))<=h&&parseFloat(Et(m,"data.x1"))>=h)return!0});if(g.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!im(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g;const m=N(g.nodes()[0]).datum(),v=parseFloat(Et(m,"data.x0")),x=parseFloat(Et(m,"data.x1")),_=this.model.getActiveDataGroupNames(),E=_.reverse().map(b=>({label:b,value:Et(m,`data.${b}`),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:b})})).filter(b=>b.value!==0);if(E.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:f,items:[{label:Et(s,"bins.rangeLabel")||"Range",value:`${v} – ${x}`},...E,...y(s,"tooltip","showTotal")===!0?[{label:Et(s,"locale.translations.total")||Et(s,"tooltip.totalLabel")||"Total",value:_.reduce((S,M)=>S+parseFloat(Et(m,`data.${M}`)),0)}]:[]]}),p.attr("opacity",1);const b=d((v+x)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",b).attr("y2",b):f.attr("y1",u).attr("y2",c).attr("x1",b).attr("x2",b)}else this.hideRuler()}else this.hideRuler()}}class bo extends nr{formatTooltipData(t){return t.reverse()}}const bD=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=gm();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},_D={d:"M7 0v8L0 4z"},ED={d:"M0 0v8l7-4z"},TD={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z"},SD={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z"},OD={d:"M0 .44974747h8v8H0v-3.6830331z"},wD={d:"M0 0h1.5v8H0z"};class Yg extends yu{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=ot.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=P.getSVGElementSize(i,{useAttrs:!0}),a=y(this.getOptions(),"data","loading");if(s>zt.color.barWidth&&!a){const o=y(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=P.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),d=c[0]-u-9;d>1?i.select("g.legend-title").attr("transform",`translate(${d}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer({ariaLabel:"legend"}),{width:i}=P.getSVGElementSize(r,{useAttrs:!0}),s=y(n,"color","gradient","colors"),a=y(n,this.chartType,"colorLegend","type");let o=y(n,"color","pairing","option");const l=y(n,"heatmap","colorLegend","title");if(y(this.getOptions(),"data","loading")){r.html("");return}const c=!tn(s),u=Fp(this.model.getDisplayData()),d=!(i<=zt.color.barWidth),h=d?zt.color.barWidth:i,p=P.appendOrSelect(r,"g.legend"),f=P.appendOrSelect(p,"g.legend-axis");if(l){const C=P.appendOrSelect(r,"g.legend-title");P.appendOrSelect(C,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const g=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&g==="mono"||o<1&&o>2&&g==="diverge")&&(o=1);let m=[];const v=g==="diverge"?17:11;if(c)m=s;else for(let C=1;C<v+1;C++)m.push(a===Oi.LINEAR?`stop-color-${g}-${o}-${C}`:`fill-${g}-${o}-${C}`);const x=ke(u[0],u[1]),_=GC(x,3),E=sn().domain(u).range([0,h]),b=Tc(E).tickSize(0).tickValues(_),{code:S,number:M}=y(n,"locale");b.tickFormat(C=>M(C,S));let R;switch(a){case Oi.LINEAR:this.drawLinear(m,p,h);break;case Oi.QUANTIZE:R=this.drawQuantize(m,g,c,p,h),E.range([R,h]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${zt.color.axisYTranslation})`).call(b),f.select(".domain").remove(),f.select("g.tick:last-of-type text").style("text-anchor",d?"middle":"end"),f.select("g.tick:first-of-type text").style("text-anchor",d&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);P.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),P.appendOrSelect(n,"rect").attr("width",r).attr("height",zt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=is().domain(t).range([0,s]);return P.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",zt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class $D extends Ls{constructor(){super(...arguments),this.type="meter-title",this.renderType=ot.SVG}render(t=!1){const n=y(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(y(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=P.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=y(n,"meter","proportional","total"),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=y(n,"meter","proportional","breakdownFormatter"),{code:h,number:p}=y(n,"locale");a=d!==null?d({datasetsTotal:r,total:i}):`${p(r,h)} ${s} used (${p(u,h)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=P.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"meter","proportional","total"),i=r?y(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"",a=y(n,"meter","proportional","totalFormatter"),{code:o,number:l}=y(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=P.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-se.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=P.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=se.status.indicatorSize/2,a=P.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=y(this.model.getDisplayData(),0,"value"),{code:n,number:r}=y(this.getOptions(),"locale"),i=this.getComponentContainer(),s=P.appendOrSelect(i,"text.meter-title"),a=y(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=se.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=P.appendOrSelect(this.parent,"tspan"),i=se.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());P.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=y(this.getOptions(),"meter","proportional"),n=P.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=P.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=P.getSVGElementSize(r,{useBBox:!0}).width;return n-i-se.total.paddingLeft}else{const r=P.appendOrSelect(this.parent,"text.percent-value"),i=se.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=P.appendOrSelect(this.parent,"g.status-indicator").node(),o=P.getSVGElementSize(a,{useBBox:!0}).width+se.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case Ti.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case Ti.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Ti.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class wu extends bt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=P.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=y(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class MD extends bt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:ti.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"circle packs",withinChartClip:!0}),{width:r,height:i}=P.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=y(l,"canvasZoom","enabled");a&&y(s,0,"children")&&(s=y(s,0,"children"));const u=_s({children:s}).sum(f=>f.value).sort((f,g)=>g.value-f.value),d=IL().size([r,i]).padding(f=>f.depth>=1?ti.padding.children+3:ti.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=o),h=n.selectAll("circle.node").data(d);h.exit().attr("width",0).attr("height",0).remove();const p=h.enter().append("circle").classed("node",!0);p.merge(h).attr("class",f=>{const g=c&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${g}`:`node node-leaf ${g}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",ti.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,Jr),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName,null,r.data))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",ti.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){N(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=N(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,Jr)})}getZoomIcon(){return`
69
+ `;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(VC).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class aD extends gt{constructor(){super(...arguments),this.type="boxplot",this.renderType=it.SVG}render(t){const n=this.getComponentContainer({ariaLabel:"box plots",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,d]=o.range(),h=c-l,p=u-d;if(h===0)return;const{cartesianScales:f}=this.services,g=f.getOrientation(),m=g===Gt.VERTICAL,[v,x]=bn($=>this.services.cartesianScales.getDomainValue($),$=>this.services.cartesianScales.getRangeValue($),g),_=Math.floor((m?h:p)/s.length),E=Math.min(_/2,16),b=this.model.getBoxplotData(),T=n.selectAll(".box-group").data(b);T.exit().remove();const M=T.enter().append("g").attr("class","box-group"),D=T.merge(M);M.append("path").merge(T.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalstartline",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i]),P=H,B=f.getRangeValue($.whiskers.min),S=f.getRangeValue($.quartiles.q_25);return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalendline",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i]),P=H,B=f.getRangeValue($.whiskers.max),S=f.getRangeValue($.quartiles.q_75);return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"box"})).attr("fill-opacity",Le.box.opacity.default).attr("stroke-width",Le.strokeWidth.default).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",$=>$[i]).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-quartiles",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i])-E/2,P=H+E,B=f.getRangeValue(Math[m?"max":"min"]($.quartiles.q_75,$.quartiles.q_25)),S=B+Math.abs(f.getRangeValue($.quartiles.q_75)-f.getRangeValue($.quartiles.q_25));return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",$=>{const H=f.getDomainValue($[i])-E/2,P=H+E,B=f.getRangeValue($.whiskers.min),S=f.getRangeValue($.whiskers.max);return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-startingwhisker",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i])-E/4,P=H+E/2,B=f.getRangeValue($.whiskers.min),S=f.getRangeValue($.whiskers.min);return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-median",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i])-E/2,P=H+E,B=f.getRangeValue($.quartiles.q_50);return ie({x0:H,x1:P,y0:B,y1:B},g)}),M.append("path").merge(T.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-endingwhisker",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i])-E/4,P=H+E/2,B=f.getRangeValue($.whiskers.max),S=f.getRangeValue($.whiskers.max);return ie({x0:H,x1:P,y0:B,y1:S},g)});const A=D.selectAll("circle.outlier").data($=>$.outliers.map(H=>({min:$.whiskers.min,max:$.whiskers.max,[i]:$[i],value:H})));A.exit().remove();const R=A.enter().append("circle");A.merge(R).attr("r",Le.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Le.circle.opacity.default).attr("cx",v).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-circles",animate:t})).attr("cy",x),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Le.box.opacity.hovered),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=I(this);t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(O.Boxplot.BOX_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Le.box.opacity.default),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=I(this);o.classed("hovered",!0).attr("fill-opacity",Le.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Boxplot.OUTLIER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);o.classed("hovered",!1).attr("fill-opacity",Le.circle.opacity.default),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class li extends gt{constructor(){super(...arguments),this.type="zero-line",this.renderType=it.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer({isPresentational:!0});if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const d=Tp({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());N.appendOrSelect(o,"line.domain").transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class oD extends cn{constructor(){super(...arguments),this.type="bubble",this.renderType=it.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?Ge(s):[1,1];return je().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=bn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",h=>{const p=o.getRangeIdentifier(h);return h[p]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[p],h)}).style("stroke",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[p],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=y(this.getOptions(),"bubble");return[{label:y(n,"radiusLabel"),value:t[y(n,"radiusMapsTo")]}]}}class lD extends gt{constructor(){super(...arguments),this.type="bullet",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bullet graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),d=()=>{const g=[];s.forEach(v=>{v.ranges?v.ranges.forEach((x,_)=>{x!=null&&x<u&&g.push({datum:v,value:x,order:_+1})}):g.push({datum:v,order:1})});const m=N.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,v=>`${v[r]}-${v.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let x,_,E,b;return v.order===1?(x=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=x+16,E=c-2,b=l+1):(x=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=x+16,E=this.services.cartesianScales.getRangeValue(v.value),b=c),ie({x0:x,x1:_,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=N.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const v=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[v],m)}).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-4,x=v+8,_=this.services.cartesianScales.getRangeValue(0)+1,E=this.services.cartesianScales.getRangeValue(m);return ie({x0:v,x1:x,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const g=N.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>y(m,"marker")!==null),m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-12,x=v+24,_=this.services.cartesianScales.getRangeValue(m.marker);return ie({x0:v,x1:x,y0:_,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let g=[];s.filter(v=>y(v,"marker")!==null).forEach(v=>{const x=v.marker,_=v[o];g=g.concat([{datum:v,value:x*.25,barValue:_},{datum:v,value:x*.5,barValue:_},{datum:v,value:x*.75,barValue:_}])});const m=N.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,v=>v[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:x})=>{let _=4;v.ranges&&v.ranges.indexOf(x)!==-1&&(_=8);const E=this.services.cartesianScales.getDomainValue(v)-_/2,b=E+_,T=this.services.cartesianScales.getRangeValue(x);return ie({x0:E,x1:b,y0:T,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),p(),f(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=y(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=I(this);c.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=y(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:o,element:I(this),datum:l}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:o,element:I(this),datum:l})}).on("mouseout",function(o,l){const c=I(this);c.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:c})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function cD(e){return e}function uD(e){if(e==null)return cD;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,d=new Array(u);for(d[0]=(t+=o[0])*r+s,d[1]=(n+=o[1])*i+a;c<u;)d[c]=o[c],++c;return d}}function hD(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function dD(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return zg(e,n)})}:zg(e,t)}function zg(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=vu(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function vu(e,t){var n=uD(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,f=h.length;p<f;++p)d.push(n(h[p],p));u<0&&hD(d,f)}function s(u){return n(u)}function a(u){for(var d=[],h=0,p=u.length;h<p;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function pD(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],p,f;if(p=i[d])if(delete i[p.end],p.push(c),p.end=h,f=r[h]){delete r[f.start];var g=f===p?p:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[p.start]=i[p.end]=p;else if(p=r[h])if(delete r[p.start],p.unshift(c),p.start=d,f=i[d]){delete i[f.end];var m=f===p?p:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[p.start]=i[p.end]=p;else p=[c],r[p.start=d]=i[p.end=h]=p});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(p){h[0]+=p[0],h[1]+=p[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(p){n[p<0?~p:p]=1}),s.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function fD(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function mD(e){return vu(e,gD.apply(this,arguments))}function gD(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return fD(vu(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(p){p._||(p._=1,u.push(p))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(g){g.forEach(function(m){m.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=pD(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),p,f;d<u;++d)(p=o(c[d]))>h&&(f=c[0],c[0]=c[d],c[d]=f,h=p);return c}).filter(function(l){return l.length>0})}}class vD extends Gn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=it.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),d=a.getDomainScale(),h=d.invert(o===Gt.VERTICAL?n:r),p=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=N.appendOrSelect(p,"line.ruler-line"),g=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(yt(m,"data.x0"))<=h&&parseFloat(yt(m,"data.x1"))>=h)return!0});if(g.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!tm(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g;const m=I(g.nodes()[0]).datum(),v=parseFloat(yt(m,"data.x0")),x=parseFloat(yt(m,"data.x1")),_=this.model.getActiveDataGroupNames(),E=_.reverse().map(b=>({label:b,value:yt(m,`data.${b}`),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:b})})).filter(b=>b.value!==0);if(E.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:f,items:[{label:yt(s,"bins.rangeLabel")||"Range",value:`${v} – ${x}`},...E,...y(s,"tooltip","showTotal")===!0?[{label:yt(s,"locale.translations.total")||yt(s,"tooltip.totalLabel")||"Total",value:_.reduce((T,M)=>T+parseFloat(yt(m,`data.${M}`)),0)}]:[]]}),p.attr("opacity",1);const b=d((v+x)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",b).attr("y2",b):f.attr("y1",u).attr("y2",c).attr("x1",b).attr("x2",b)}else this.hideRuler()}else this.hideRuler()}}class uo extends Gn{formatTooltipData(t){return t.reverse()}}const yD=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=dm();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},xD={d:"M7 0v8L0 4z"},bD={d:"M0 0v8l7-4z"},_D={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z"},ED={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z"},SD={d:"M0 .44974747h8v8H0v-3.6830331z"},TD={d:"M0 0h1.5v8H0z"};class Fg extends uu{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=it.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=N.getSVGElementSize(i,{useAttrs:!0}),a=y(this.getOptions(),"data","loading");if(s>Nt.color.barWidth&&!a){const o=y(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=N.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),d=c[0]-u-9;d>1?i.select("g.legend-title").attr("transform",`translate(${d}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer({ariaLabel:"legend"}),{width:i}=N.getSVGElementSize(r,{useAttrs:!0}),s=y(n,"color","gradient","colors"),a=y(n,this.chartType,"colorLegend","type");let o=y(n,"color","pairing","option");const l=y(n,"heatmap","colorLegend","title");if(y(this.getOptions(),"data","loading")){r.html("");return}const c=!Ve(s),u=Pp(this.model.getDisplayData()),d=!(i<=Nt.color.barWidth),h=d?Nt.color.barWidth:i,p=N.appendOrSelect(r,"g.legend"),f=N.appendOrSelect(p,"g.legend-axis");if(l){const A=N.appendOrSelect(r,"g.legend-title");N.appendOrSelect(A,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const g=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&g==="mono"||o<1&&o>2&&g==="diverge")&&(o=1);let m=[];const v=g==="diverge"?17:11;if(c)m=s;else for(let A=1;A<v+1;A++)m.push(a===gi.LINEAR?`stop-color-${g}-${o}-${A}`:`fill-${g}-${o}-${A}`);const x=xe(u[0],u[1]),_=HC(x,3),E=je().domain(u).range([0,h]),b=mc(E).tickSize(0).tickValues(_),{code:T,number:M}=y(n,"locale");b.tickFormat(A=>M(A,T));let D;switch(a){case gi.LINEAR:this.drawLinear(m,p,h);break;case gi.QUANTIZE:D=this.drawQuantize(m,g,c,p,h),E.range([D,h]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${Nt.color.axisYTranslation})`).call(b),f.select(".domain").remove(),f.select("g.tick:last-of-type text").style("text-anchor",d?"middle":"end"),f.select("g.tick:first-of-type text").style("text-anchor",d&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);N.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),N.appendOrSelect(n,"rect").attr("width",r).attr("height",Nt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=Xi().domain(t).range([0,s]);return N.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Nt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class OD extends Ss{constructor(){super(...arguments),this.type="meter-title",this.renderType=it.SVG}render(t=!1){const n=y(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(y(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=N.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=y(n,"meter","proportional","total"),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=y(n,"meter","proportional","breakdownFormatter"),{code:h,number:p}=y(n,"locale");a=d!==null?d({datasetsTotal:r,total:i}):`${p(r,h)} ${s} used (${p(u,h)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=N.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"meter","proportional","total"),i=r?y(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"",a=y(n,"meter","proportional","totalFormatter"),{code:o,number:l}=y(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=N.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-Kt.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=N.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=Kt.status.indicatorSize/2,a=N.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=y(this.model.getDisplayData(),0,"value"),{code:n,number:r}=y(this.getOptions(),"locale"),i=this.getComponentContainer(),s=N.appendOrSelect(i,"text.meter-title"),a=y(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=Kt.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=N.appendOrSelect(this.parent,"tspan"),i=Kt.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());N.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=y(this.getOptions(),"meter","proportional"),n=N.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=N.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=N.getSVGElementSize(r,{useBBox:!0}).width;return n-i-Kt.total.paddingLeft}else{const r=N.appendOrSelect(this.parent,"text.percent-value"),i=Kt.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=N.appendOrSelect(this.parent,"g.status-indicator").node(),o=N.getSVGElementSize(a,{useBBox:!0}).width+Kt.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case fi.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case fi.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case fi.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class yu extends gt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=N.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=y(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class wD extends gt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:Vr.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"circle packs",withinChartClip:!0}),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=y(l,"canvasZoom","enabled");a&&y(s,0,"children")&&(s=y(s,0,"children"));const u=ps({children:s}).sum(f=>f.value).sort((f,g)=>g.value-f.value),d=DL().size([r,i]).padding(f=>f.depth>=1?Vr.padding.children+3:Vr.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=o),h=n.selectAll("circle.node").data(d);h.exit().attr("width",0).attr("height",0).remove();const p=h.enter().append("circle").classed("node",!0);p.merge(h).attr("class",f=>{const g=c&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${g}`:`node node-leaf ${g}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",Vr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,Hr),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName,null,r.data))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",Vr.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){I(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=I(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,Hr)})}getZoomIcon(){return`
70
70
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
71
71
  <polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
72
72
  <path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
73
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=N(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(f=>{if(f!==null)return typeof f.data.value=="number"?{label:f.data.name,value:f.data.value}:{label:f.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:Et(p,"locale.translations.total")||Et(p,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=N(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");N(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Jr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");N(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Jr),n.stopPropagation()}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function CD(e,t){const n=Wi(this._current,e);return r=>(this._current=n(r),t(this._current))}class Xg extends bt{constructor(){super(...arguments),this.type="pie",this.renderType=ot.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Pt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(C=>C[a]>0),l=this.computeRadius();this.arc=Ss().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ss().innerRadius(this.getInnerRadius()).outerRadius(l+Pt.hoverArc.outerRadiusOffset);const c=rk().value(C=>C[a]).sort(y(i,"pie","sortFunction")).padAngle(Pt.padAngle)(o),u=P.appendOrSelect(r,"g.slices").attr("role",vt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,C=>C.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",C=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:C.data[s],originalClassName:"slice"})).style("fill",C=>n.model.getFillColor(C.data[s],null,C.data)).attr("d",this.arc).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",C=>`${C[a]}, ${Xl(C.data[a],o,a)+"%"}`).attrTween("d",function(C){return CD.bind(this)(C,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=y(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(C=>C.data[a]>0):[],g=P.appendOrSelect(r,"g.labels").attr("role",vt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,C=>C.data[s]);g.exit().attr("opacity",0).remove();const m=g.enter().append("text").classed("pie-label",!0),v=[];m.merge(g).style("text-anchor","middle").text(C=>i.pie.labels.formatter?i.pie.labels.formatter({...C,percentageValue:Xl(C.data[a],o,a,!0)}):h(Xl(C.data[a],o,a),d)+"%").datum(function(C){const I=l+7,w=(C.endAngle-C.startAngle)/2+C.startAngle,V=w/Math.PI*180,U=this.getComputedTextLength();return C.textOffsetX=U/2,C.textOffsetY=V>90&&V<270?10:0,C.xPosition=(C.textOffsetX+I)*Math.sin(w),C.yPosition=(C.textOffsetY+I)*-Math.cos(w),C}).attr("transform",function(C,I){const w=f.length,V=(C.endAngle-C.startAngle)*(180/Math.PI);if(I>=w-2&&V<Pt.callout.minSliceDegree){let U,H;return C.index===w-1?(U=C.xPosition+Pt.callout.offsetX+Pt.callout.textMargin+C.textOffsetX,H=C.yPosition-Pt.callout.offsetY,C.direction=Ei.RIGHT,v.push(C)):(U=C.xPosition-Pt.callout.offsetX-C.textOffsetX-Pt.callout.textMargin,H=C.yPosition-Pt.callout.offsetY,C.direction=Ei.LEFT,v.push(C)),`translate(${U}, ${H})`}return`translate(${C.xPosition}, ${C.yPosition})`}),this.renderCallouts(v);const x=y(i,"donut")?"donut":"pie",_=y(i,x,"alignment"),{width:E}=P.getSVGElementSize(this.getParent(),{useAttrs:!0}),b=p?Pt.xOffset:0,S=p?Pt.yOffset:0;let M=l+b;_===Zt.CENTER?M=E/2:_===Zt.RIGHT&&(M=E-l-Pt.xOffset);let R=l+S;v.length>0&&(R+=Pt.yOffsetCallout),r.attr("x",M+7).attr("y",R),this.addEventListeners()}renderCallouts(t){const n=P.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",vt.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",vt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===Ei.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Pt.callout.offsetX,y:o-Pt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Pt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Pt.callout.offsetX,y:o-Pt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Pt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return N(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return N(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=N(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOVER,{event:n,element:N(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Pie.SLICE_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);SC(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=P.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Pt.radiusOffset:i}}class AD extends Xg{constructor(){super(...arguments),this.type="donut",this.renderType=ot.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=P.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");P.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(N(this))}),a!==null&&a!==""&&P.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=zd:s=ke;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const Zg="4,10 8,6 12,10",Kg="12,6 8,10 4,6";class LD extends bt{constructor(){super(...arguments),this.type="gauge",this.renderType=ot.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return rm(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===ar.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case Us.UP:return Zg;case Us.DOWN:return Kg;default:return t>0?Zg:Kg}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Ss().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ss().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),P.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const p=n.selectAll("path.arc-foreground").data([i]);p.enter().append("path").merge(p).attr("class",this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=y(r,"gauge","alignment"),{width:g}=P.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===Zt.CENTER?m=g/2:f===Zt.RIGHT&&(m=g-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===ar.FULL&&!s?d=l(a):r===ar.SEMI&&s&&(d=-(l(a)+c));const h=P.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(a),f=P.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),x=f.selectAll("text.gauge-value-number").data([i]);x.enter().append("text").attr("class","gauge-value-number").merge(x).style("font-size",`${p}px`).attr("text-anchor","middle").text(C=>{let I;return C!=null?I=Number(C.toFixed(2))%1!==0?C.toFixed(2):C.toFixed():I=0,v?v(I):m(Number(I),g)});const{width:_}=P.getSVGElementSize(P.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),E=p/2,b=u?"%":"",S=P.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${E}px`).attr("x",_/2).text(b),{width:M,height:R}=P.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${R/2}px`),f.attr("transform",`translate(-${M/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),p=P.appendOrSelect(n,"g.gauge-numbers"),f=P.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=P.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(E=>{let b;return E!=null?b=Number(E.toFixed(2))%1!==0?E.toFixed(2):E.toFixed():b=0,c?`${c(b)}${m}`:`${a(Number(b),s)}${m}`});const{width:v}=P.getSVGElementSize(P.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),x=y(r,"gauge","deltaArrow","enabled"),_=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&x?[i]:[]);_.enter().append("svg").merge(_).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const E=N(this);P.appendOrSelect(E,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=y(r,"gauge","status");P.appendOrSelect(E,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),_.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOVER,{event:n,element:N(this),datum:r})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=P.getSVGElementSize(this.parent,{useAttrs:!0});return n===ar.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Qg extends wu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=ot.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Vi(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",vt.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Xt.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),p=d,f=d+h,g=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(g),v=this.services.cartesianScales.getValueThroughAxisPosition(g,m),x=this.services.cartesianScales.getRangeValue(u),_=this.services.cartesianScales.getDomainValue(u)-h/2,E=_+h;if(!this.isOutsideZoomedDomain(_,E))return me({x0:p,x1:f,y0:v,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=N(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=is().domain(t).rangeRound([0,this.getGroupWidth()])}}class kD extends bt{constructor(){super(...arguments),this.type="heatmap",this.renderType=ot.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,p=null;this.matrix[r]!==void 0?(u=a,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const g=this.matrix[r][f].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=g<h?g:h,p=g>p?g:p}})):(u=o,s.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const g=this.matrix[f][r].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=g<h?g:h,p=g>p?g:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Xn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Xn(l.range())},${c(r)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:N(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:p!==null?p:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const p=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",p).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const f=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${p})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(f.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=P.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);P.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),P.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),P.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),P.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Hr.OFF&&(t===Hr.AUTO&&xp.minCellDividerDimension<=this.xBandwidth&&xp.minCellDividerDimension<=this.yBandwidth||t===Hr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=Et(r,"locale.translations.total")||Et(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=N(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ts(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:N(this),datum:u}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_CLICK,{event:c,element:N(this),datum:u})}).on("mouseout",function(c,u){const d=N(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class DD extends bt{constructor(){super(...arguments),this.type="histogram",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>Et(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",vt.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=Et(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Xt.VERTICAL?m+=1:m-=1),me({x0:p,x1:f,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=N(this);l.classed("hovered",!0);const c=i(parseFloat(Et(o,"data.x0")),r),u=i(parseFloat(Et(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:Et(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:Et(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){N(this).classed("hovered",!1),s.services.events.dispatchEvent(O.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class RD extends _n{constructor(){super(...arguments),this.type="lollipop",this.renderType=ot.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?kn.weight.unselected:kn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",kn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?kn.opacity.unselected:kn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",kn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,p]=Rn(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const g=f.enter().append("line").attr("opacity",0).merge(f).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Xt.HORIZONTAL?g.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):g.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>p(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class ID extends bt{constructor(){super(...arguments),this.type="meter",this.renderType=ot.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-se.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-se.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=P.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;y(i,"meter","proportional")===null?u=100:u=y(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=sn().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),p=y(i,"meter","height");P.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?se.height.proportional:se.height.default)),P.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?se.height.proportional:se.height.default));const f=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",_=>_.x).attr("y",0).attr("height",()=>p||(s?se.height.proportional:se.height.default)).attr("class",_=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:_[c],originalClassName:g})).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"meter-bar-update",animate:t})).attr("width",_=>_.value>u?d(u):Math.max(_.width,2)).style("fill",_=>n.model.getFillColor(_[c],null,_)).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",_=>_.value),f.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const x=r.selectAll("line.peak").data(v==null?[]:[v]);x.enter().append("line").classed("peak",!0).merge(x).attr("y1",0).attr("y2",()=>p||(s?se.height.proportional:se.height.default)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"peak-line-update",animate:t})).attr("x1",_=>d(_)).attr("x2",_=>d(_)).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",_=>_),x.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=N(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=N(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.Meter.METER_CLICK,{event:s,element:N(this),datum:a})}).on("mouseout",function(s,a){const o=N(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class ND extends bt{constructor(){super(...arguments),this.type="radar",this.renderType=ot.SVG,this.getLabelDimensions=t=>{const n=P.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=P.appendOrSelect(n,"text").text(t),{width:i,height:s}=P.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=MC(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ht(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ht(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?xr.opacity.unselected:xr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?xr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",xr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=P.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:g,xAxisRectHeight:m}=xr;this.uniqueKeys=Array.from(new Set(s.map(T=>T[u]))),this.uniqueGroups=Array.from(new Set(s.map(T=>T[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),x=(Math.min(r,i)-v)/2;if(x<=0)return;const _=is().domain(this.fullDataNormalized.map(T=>T[u])).range([0,2*Math.PI].map(T=>T-Math.PI/2)),E=Xn(this.fullDataNormalized.map(T=>T[d])),b=sn().domain([E>=0?0:E,fr(this.fullDataNormalized.map(T=>T[d]))]).range([g,x]).nice(f),S=b.ticks(f),M=(T,$,A)=>this.model.getFillColor(T,$,A),R=ak().angle(T=>_(T[u])+Math.PI/2).radius(T=>b(T[d])).curve(Ef),C=this.uniqueKeys.map(T=>{const $=this.getLabelDimensions(T).width,A=k2(_(T),x);return $+A}),I={x:fr(C)+h,y:i/2},w=P.appendOrSelect(n,"g.y-axes").attr("role",vt.GROUP).selectAll("path").data(S,T=>T),V=T=>this.uniqueKeys.map($=>({[u]:$,[d]:T}));w.join(T=>T.append("path").attr("opacity",0).attr("transform",`translate(${I.x}, ${I.y})`).attr("fill","none").call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",A=>R(V(A)))),T=>T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${I.x}, ${I.y})`).attr("d",A=>R(V(A)))),T=>T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_y_axes_exit",animate:t})).attr("d",A=>R(V(A))).attr("opacity",0).remove())),P.appendOrSelect(n,"g.x-axes").attr("role",vt.GROUP).selectAll("line").data(this.uniqueKeys,T=>T).join(T=>T.append("line").attr("opacity",0).attr("class",$=>`x-axis-${ui($)}`).attr("stroke-dasharray","0").attr("x1",$=>Wt(_($),0,I).x).attr("y1",$=>Wt(_($),0,I).y).attr("x2",$=>Wt(_($),0,I).x).attr("y2",$=>Wt(_($),0,I).y).call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",A=>Wt(_(A),b.range()[0],I).x).attr("y1",A=>Wt(_(A),b.range()[0],I).y).attr("x2",A=>Wt(_(A),b.range()[1],I).x).attr("y2",A=>Wt(_(A),b.range()[1],I).y)),T=>T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",A=>Wt(_(A),b.range()[0],I).x).attr("y1",A=>Wt(_(A),b.range()[0],I).y).attr("x2",A=>Wt(_(A),b.range()[1],I).x).attr("y2",A=>Wt(_(A),b.range()[1],I).y)),T=>T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),P.appendOrSelect(n,"g.x-labels").attr("role",vt.GROUP).selectAll("text").data(this.uniqueKeys).join(T=>T.append("text").text($=>$).attr("opacity",0).attr("x",$=>Wt(_($),b.range()[1]+h,I).x).attr("y",$=>Wt(_($),b.range()[1]+h,I).y).style("text-anchor",$=>Pf(_($)).textAnchor).style("dominant-baseline",$=>Pf(_($)).dominantBaseline).call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),T=>T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",A=>Wt(_(A),b.range()[1]+h,I).x).attr("y",A=>Wt(_(A),b.range()[1]+h,I).y).end().finally(()=>{const A=y(o,"radar","alignment"),D=this.getAlignmentXOffset(A,n,this.getParent());n.attr("x",D)})),T=>T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),P.appendOrSelect(n,"g.blobs").attr("role",vt.GROUP).selectAll("path").data(this.groupedDataNormalized,T=>T.name).join(T=>T.append("path").attr("class",$=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:$.name,originalClassName:"blob"})).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-label",$=>$.name).attr("opacity",0).attr("transform",t?()=>`translate(${I.x}, ${I.y}) scale(${1+Math.random()*.35})`:`translate(${I.x}, ${I.y})`).style("fill",$=>M($.name,null,$.data)).style("fill-opacity",xr.opacity.selected).style("stroke",$=>M($.name,null,$.data)).call($=>{const A=$.transition().call(D=>this.services.transitions.setupTransition({transition:D,name:"radar_blobs_enter",animate:t}));t&&A.delay(()=>Math.random()*30).attr("transform",`translate(${I.x}, ${I.y})`),A.attr("opacity",1).attr("d",D=>R(D.data))}),T=>(T.attr("class",$=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:$.name,originalClassName:"blob"})).style("fill",$=>M($.name,null,$.data)).style("stroke",$=>M($.name,null,$.data)),T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${I.x}, ${I.y})`).attr("d",A=>R(A.data))),T),T=>T.call($=>{const A=$.transition().call(D=>this.services.transitions.setupTransition({transition:D,name:"radar_blobs_exit",animate:t}));t&&A.delay(()=>Math.random()*30).attr("transform",()=>`translate(${I.x}, ${I.y}) scale(${1+Math.random()*.35})`),A.attr("opacity",0).remove()})),P.appendOrSelect(n,"g.dots").attr("role",vt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(T=>y(T,d)!==null)).join(T=>T.append("circle").attr("role",vt.GRAPHICS_SYMBOL).attr("aria-label",$=>$[c]),T=>T,T=>T.remove()).attr("class",T=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:T[l],originalClassName:ui(T[u])})).attr("cx",T=>Wt(_(T[u]),b(T[d]),I).x).attr("cy",T=>Wt(_(T[u]),b(T[d]),I).y).attr("r",0).attr("opacity",0).style("fill",T=>M(T[l])),P.appendOrSelect(n,"g.x-axes-rect").attr("role",vt.GROUP).selectAll("rect").data(this.uniqueKeys).join(T=>T.append("rect"),T=>T,T=>T.remove()).attr("x",I.x).attr("y",I.y-m/2).attr("width",b.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",T=>`rotate(${Uf(_(T))}, ${I.x}, ${I.y})`);const{code:U,number:H}=y(o,"locale");P.appendOrSelect(n,"g.y-labels").attr("role",vt.GROUP).selectAll("text").data(en(S)).join(T=>T.append("text").attr("opacity",0).text($=>H($,U)).attr("x",$=>Wt(-Math.PI/2,b($),I).x+p).attr("y",$=>Wt(-Math.PI/2,b($),I).y).style("text-anchor","start").style("dominant-baseline","middle").call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),T=>T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_y_labels_update",animate:t})).text(A=>A).attr("opacity",1).attr("x",A=>Wt(-Math.PI/2,b(A),I).x+p).attr("y",A=>Wt(-Math.PI/2,b(A),I).y)),T=>T.call($=>$.transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=P.getSVGElementSize(n,{useBBox:!0}),{width:s}=P.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Zt.CENTER?a=Math.floor((s-i.width)/2):t===Zt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=N(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${ui(i)}`),o=t.parent.selectAll(`.dots circle.${ui(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",xr.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(p=>typeof p[d]=="number").map(p=>({label:p[u],value:p[d],color:t.model.getFillColor(p[u],null,p),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const s=N(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Radar.X_AXIS_CLICK,{event:r,element:N(this),datum:i})}).on("mouseout",function(r,i){const s=N(this),a=t.parent.select(`.x-axes .x-axis-${ui(i)}`),o=t.parent.selectAll(`.dots circle.${ui(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE)})}}class Jg extends wu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,p=h+u;let f,g;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),g=this.services.cartesianScales.getRangeValue(d[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,v)),g=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(g-f);if(m!==0&&m<2&&(d>0&&a===Xt.VERTICAL||d<0&&a===Xt.HORIZONTAL?g=f-2:g=f+2),!this.isOutsideZoomedDomain(h,p))return me({x0:h,x1:p,y0:f,y1:g},a)}).attr("opacity",1).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=N(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:N(this),datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class PD extends be{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=P.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=P.appendOrSelect(t,"svg.chart-skeleton.DAII"),P.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class tv extends bt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?Ln.opacity.unselected:Ln.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Ln.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=cu().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Ln.opacity.selected).attr("d",this.areaGenerator)}}class ev extends wu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",vt.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,p=h+d,f=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(g-f)>0&&Math.abs(g-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Xt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Xt.VERTICAL?g+=1:g-=1)}return me({x0:h,x1:p,y0:f,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",vt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=N(this);a.classed("hovered",!0),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=N(this);r.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:i,element:N(this),datum:s})}).on("mouseout",function(i,s){const a=N(this);a.classed("hovered",!1),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=P.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class nv extends _n{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=ot.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>y(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",vt.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),p=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[p]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[v]:f}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const ks=6;class UD extends bt{constructor(){super(...arguments),this.type="tree",this.renderType=ot.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=P.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=P.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+ks:30-ks},h=_s({name:o,children:a}),p=10,f=r/6,g=S=>{const M=h.descendants().reverse(),R=h.links();let C=h,I=h;h.eachBefore(D=>{D.x<C.x&&(C=D),D.x>I.x&&(I=D)});const w=I.x-C.x,V=n.transition().call(D=>this.services.transitions.setupTransition({transition:D,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,C.x,r,w].join(" ")),U=b.selectAll("g").data(M,D=>D.id),H=this,T=U.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",D=>D.depth!==0&&D.children&&D.children.length>0?"clickable":null).on("mouseover",function(D,B){H.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:D,element:N(this),datum:B})}).on("click",function(D,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),H.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:D,element:N(this),datum:B})}).on("mouseout",function(D,B){H.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:D,element:N(this),datum:B})});T.append("circle").attr("r",2.5).attr("class",D=>D._children?"parent":"child").attr("stroke-width",10),T.append("text").attr("dy","0.31em").attr("x",D=>D._children?-6:ks).attr("text-anchor",D=>D._children?"end":"start").text(D=>D.data.name).clone(!0).attr("class","text-stroke").lower(),U.merge(T).transition(V).attr("transform",D=>`translate(${D.y},${D.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),U.exit().transition(V).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const $=E.selectAll("path").data(R,D=>D.target.id),A=$.enter().append("path").attr("d",()=>{const D={x:S.x0,y:S.y0};return _({source:D,target:D})});$.merge(A).transition(V).attr("d",_),$.exit().transition(V).remove().attr("d",()=>{const D={x:S.x,y:S.y};return _({source:D,target:D})}),h.eachBefore(D=>{D.x0=D.x,D.y0=D.y})},m=h.descendants(),v=m[m.length-1].depth,x=y(s,"tree","type")===Ps.DENDROGRAM?nL().size([i,r-u-v*ks-l]):zL().nodeSize([p,f]).size([i,r-u-v*ks-l]),_=dk().x(S=>S.y).y(S=>S.x);h.x0=f/2,h.y0=0,h.descendants().forEach((S,M)=>{S.id=M,S._children=S.children}),x(h),n.attr("viewBox",[-d.left,-0,r,p]).style("user-select","none");const E=n.append("g").attr("class","links"),b=n.append("g").attr("class","nodes");g(h)}}var BD="#000000",HD="#ffffff",VD="#fcf4d6",GD="#fddc69",zD="#f1c21b",FD="#d2a106",jD="#b28600",WD="#8e6a00",qD="#684e00",YD="#483700",XD="#302400",ZD="#1c1500",KD={10:VD,20:GD,30:zD,40:FD,50:jD,60:WD,70:qD,80:YD,90:XD,100:ZD},QD="#fff2e8",JD="#ffd9be",tR="#ffb784",eR="#ff832b",nR="#eb6200",rR="#ba4e00",iR="#8a3800",sR="#5e2900",aR="#3e1a00",oR="#231000",lR={10:QD,20:JD,30:tR,40:eR,50:nR,60:rR,70:iR,80:sR,90:aR,100:oR},cR="#fff1f1",uR="#ffd7d9",hR="#ffb3b8",dR="#ff8389",pR="#fa4d56",fR="#da1e28",mR="#a2191f",gR="#750e13",vR="#520408",yR="#2d0709",xR={10:cR,20:uR,30:hR,40:dR,50:pR,60:fR,70:mR,80:gR,90:vR,100:yR},bR="#fff0f7",_R="#ffd6e8",ER="#ffafd2",TR="#ff7eb6",SR="#ee5396",OR="#d02670",wR="#9f1853",$R="#740937",MR="#510224",CR="#2a0a18",AR={10:bR,20:_R,30:ER,40:TR,50:SR,60:OR,70:wR,80:$R,90:MR,100:CR},LR="#f6f2ff",kR="#e8daff",DR="#d4bbff",RR="#be95ff",IR="#a56eff",NR="#8a3ffc",PR="#6929c4",UR="#491d8b",BR="#31135e",HR="#1c0f30",VR={10:LR,20:kR,30:DR,40:RR,50:IR,60:NR,70:PR,80:UR,90:BR,100:HR},GR="#edf5ff",zR="#d0e2ff",FR="#a6c8ff",jR="#78a9ff",WR="#4589ff",qR="#0f62fe",YR="#0043ce",XR="#002d9c",ZR="#001d6c",KR="#001141",QR={10:GR,20:zR,30:FR,40:jR,50:WR,60:qR,70:YR,80:XR,90:ZR,100:KR},JR="#e5f6ff",tI="#bae6ff",eI="#82cfff",nI="#33b1ff",rI="#1192e8",iI="#0072c3",sI="#00539a",aI="#003a6d",oI="#012749",lI="#061727",cI={10:JR,20:tI,30:eI,40:nI,50:rI,60:iI,70:sI,80:aI,90:oI,100:lI},uI="#d9fbfb",hI="#9ef0f0",dI="#3ddbd9",pI="#08bdba",fI="#009d9a",mI="#007d79",gI="#005d5d",vI="#004144",yI="#022b30",xI="#081a1c",bI={10:uI,20:hI,30:dI,40:pI,50:fI,60:mI,70:gI,80:vI,90:yI,100:xI},_I="#defbe6",EI="#a7f0ba",TI="#6fdc8c",SI="#42be65",OI="#24a148",wI="#198038",$I="#0e6027",MI="#044317",CI="#022d0d",AI="#071908",LI={10:_I,20:EI,30:TI,40:SI,50:OI,60:wI,70:$I,80:MI,90:CI,100:AI},kI="#f2f4f8",DI="#dde1e6",RI="#c1c7cd",II="#a2a9b0",NI="#878d96",PI="#697077",UI="#4d5358",BI="#343a3f",HI="#21272a",VI="#121619",GI={10:kI,20:DI,30:RI,40:II,50:NI,60:PI,70:UI,80:BI,90:HI,100:VI},zI="#f4f4f4",FI="#e0e0e0",jI="#c6c6c6",WI="#a8a8a8",qI="#8d8d8d",YI="#6f6f6f",XI="#525252",ZI="#393939",KI="#262626",QI="#161616",JI={10:zI,20:FI,30:jI,40:WI,50:qI,60:YI,70:XI,80:ZI,90:KI,100:QI},tN="#f7f3f2",eN="#e5e0df",nN="#cac5c4",rN="#ada8a8",iN="#8f8b8b",sN="#726e6e",aN="#565151",oN="#3c3838",lN="#272525",cN="#171414",uN={10:tN,20:eN,30:nN,40:rN,50:iN,60:sN,70:aN,80:oN,90:lN,100:cN},rv={black:{100:BD},blue:QR,coolGray:GI,cyan:cI,gray:JI,green:LI,magenta:AR,orange:lR,purple:VR,red:xR,teal:bI,warmGray:uN,white:{0:HD},yellow:KD};const hN=e=>{if(!e)return null;for(const t of Object.keys(rv)){const n=rv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},iv=function(e){const t=N(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=Mn(n);let i;if(r&&(i=hN(r?r.hex():null)),i==null){const s=Bd(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let dN=0;class pN extends bt{constructor(){super(...arguments),this.type="treemap",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=P.getSVGElementSize(n,{useAttrs:!0}),l=_s({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=YL().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),p=>p.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>dN++).merge(u);d.attr("data-name","leaf").transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-group-update",animate:t})).attr("transform",p=>`translate(${p.x0},${p.y0})`);const h=d.selectAll("rect.leaf").data(p=>[p]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const p=N(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${p}`}).attr("class",p=>{for(;p.depth>1;)p=p.parent;return this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:p.data.name,originalClassName:"leaf"})}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-leaf-update-enter",animate:t})).attr("width",p=>p.x1-p.x0).attr("height",p=>p.y1-p.y0).style("fill",p=>{for(;p.depth>1;)p=p.parent;return this.model.getFillColor(p.data.name,null,p.data)}),d.selectAll("clipPath").data(p=>p.data.showLabel!==!0?[]:[1],p=>p).join(p=>p.append("clipPath").attr("id",function(){const f=N(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=N(this.parentNode.parentNode).attr("data-uid"),g=`${i.style.prefix}-leaf-${f}`;return new URL(`#${g}`,s)+""}),p=>null,p=>p.remove()),d.selectAll("text").data(p=>{if(p.data.showLabel!==!0)return[];let f=p;for(;f.depth>1;)f=f.parent;return[{text:p.data.name,backgroundColor:this.model.getFillColor(f.data.name)}]},p=>p).join(p=>{const f=p.append("text").text(g=>g.text).style("fill",iv).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const g=N(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${g}`;return`url(${new URL(`#${m}`,s)+""})`}),f},p=>p.text(f=>f.text).style("fill",iv),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=N(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),Mn(s).darker(.7).toString()}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Treemap.LEAF_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}}function fN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mN(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var gN={value:function(){}};function sv(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new _o(n)}function _o(e){this._=e}function vN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_o.prototype=sv.prototype={constructor:_o,on:function(e,t){var n=this._,r=vN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=yN(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=av(n[i],e.name,t);else if(t==null)for(i in n)n[i]=av(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _o(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function yN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function av(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=gN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const xN=Object.freeze(Object.defineProperty({__proto__:null,dispatch:sv},Symbol.toStringTag,{value:"Module"})),bN=mN(xN);var $u,ov;function _N(){if(ov)return $u;ov=1;const e=bN.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;$u=function(){var E=[256,256],b=s,S=a,M=l,R=o,C=o,I=c,w=u,V=g,U=[],H=1/0,T=e("word","end"),$=null,A=Math.random,D={},B=x;D.canvas=function(q){return arguments.length?(B=_(q),D):B},D.start=function(){var q=Q(B()),X=v((E[0]>>5)*E[1]),ut=null,tt=U.length,Z=-1,et=[],dt=U.map(function(Y,K){return Y.text=b.call(this,Y,K),Y.font=S.call(this,Y,K),Y.style=R.call(this,Y,K),Y.weight=C.call(this,Y,K),Y.rotate=I.call(this,Y,K),Y.size=~~M.call(this,Y,K),Y.padding=w.call(this,Y,K),Y}).sort(function(Y,K){return K.size-Y.size});return $&&clearInterval($),$=setInterval(j,0),j(),D;function j(){for(var Y=Date.now();Date.now()-Y<H&&++Z<tt&&$;){var K=dt[Z];K.x=E[0]*(A()+.5)>>1,K.y=E[1]*(A()+.5)>>1,d(q,K,dt,Z),K.hasText&&W(X,K,ut)&&(et.push(K),T.call("word",D,K),ut?p(ut,K):ut=[{x:K.x+K.x0,y:K.y+K.y0},{x:K.x+K.x1,y:K.y+K.y1}],K.x-=E[0]>>1,K.y-=E[1]>>1)}Z>=tt&&(D.stop(),T.call("end",D,et,ut))}},D.stop=function(){$&&(clearInterval($),$=null);for(const q of U)delete q.sprite;return D};function Q(q){const X=q.getContext("2d",{willReadFrequently:!0});q.width=q.height=1;const ut=Math.sqrt(X.getImageData(0,0,1,1).data.length>>2);return q.width=(r<<5)/ut,q.height=i/ut,X.fillStyle=X.strokeStyle="red",{context:X,ratio:ut}}function W(q,X,ut){E[0],E[1];for(var tt=X.x,Z=X.y,et=Math.sqrt(E[0]*E[0]+E[1]*E[1]),dt=V(E),j=A()<.5?1:-1,Y=-j,K,z,ft;(K=dt(Y+=j))&&(z=~~K[0],ft=~~K[1],!(Math.min(Math.abs(z),Math.abs(ft))>=et));)if(X.x=tt+z,X.y=Z+ft,!(X.x+X.x0<0||X.y+X.y0<0||X.x+X.x1>E[0]||X.y+X.y1>E[1])&&(!ut||f(X,ut))&&!h(X,q,E[0])){for(var ct=X.sprite,Dt=X.width>>5,Gt=E[0]>>5,st=X.x-(Dt<<4),Tt=st&127,_e=32-Tt,de=X.y1-X.y0,k=(X.y+X.y0)*Gt+(st>>5),it,rt=0;rt<de;rt++){it=0;for(var mt=0;mt<=Dt;mt++)q[k+mt]|=it<<_e|(mt<Dt?(it=ct[rt*Dt+mt])>>>Tt:0);k+=Gt}return!0}return!1}return D.timeInterval=function(q){return arguments.length?(H=q??1/0,D):H},D.words=function(q){return arguments.length?(U=q,D):U},D.size=function(q){return arguments.length?(E=[+q[0],+q[1]],D):E},D.font=function(q){return arguments.length?(S=_(q),D):S},D.fontStyle=function(q){return arguments.length?(R=_(q),D):R},D.fontWeight=function(q){return arguments.length?(C=_(q),D):C},D.rotate=function(q){return arguments.length?(I=_(q),D):I},D.text=function(q){return arguments.length?(b=_(q),D):b},D.spiral=function(q){return arguments.length?(V=n[q]||q,D):V},D.fontSize=function(q){return arguments.length?(M=_(q),D):M},D.padding=function(q){return arguments.length?(w=_(q),D):w},D.random=function(q){return arguments.length?(A=q,D):A},D.on=function(){var q=T.on.apply(T,arguments);return q===T?D:q},D};function s(E){return E.text}function a(){return"serif"}function o(){return"normal"}function l(E){return Math.sqrt(E.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(E,b,S,M){if(!b.sprite){var R=E.context,C=E.ratio;R.clearRect(0,0,(r<<5)/C,i/C);var I=0,w=0,V=0,U=S.length;for(--M;++M<U;){b=S[M],R.save(),R.font=b.style+" "+b.weight+" "+~~((b.size+1)/C)+"px "+b.font;const K=R.measureText(b.text),z=-Math.floor(K.width/2);let ft=(K.width+1)*C,ct=b.size<<1;if(b.rotate){var H=Math.sin(b.rotate*t),T=Math.cos(b.rotate*t),$=ft*T,A=ft*H,D=ct*T,B=ct*H;ft=Math.max(Math.abs($+B),Math.abs($-B))+31>>5<<5,ct=~~Math.max(Math.abs(A+D),Math.abs(A-D))}else ft=ft+31>>5<<5;if(ct>V&&(V=ct),I+ft>=r<<5&&(I=0,w+=V,V=0),w+ct>=i)break;R.translate((I+(ft>>1))/C,(w+(ct>>1))/C),b.rotate&&R.rotate(b.rotate*t),R.fillText(b.text,z,0),b.padding&&(R.lineWidth=2*b.padding,R.strokeText(b.text,z,0)),R.restore(),b.width=ft,b.height=ct,b.xoff=I,b.yoff=w,b.x1=ft>>1,b.y1=ct>>1,b.x0=-b.x1,b.y0=-b.y1,b.hasText=!0,I+=ft}for(var Q=R.getImageData(0,0,(r<<5)/C,i/C).data,W=[];--M>=0;)if(b=S[M],!!b.hasText){for(var q=b.width,X=q>>5,ut=b.y1-b.y0,tt=0;tt<ut*X;tt++)W[tt]=0;if(I=b.xoff,I==null)return;w=b.yoff;for(var Z=0,et=-1,dt=0;dt<ut;dt++){for(var tt=0;tt<q;tt++){var j=X*dt+(tt>>5),Y=Q[(w+dt)*(r<<5)+(I+tt)<<2]?1<<31-tt%32:0;W[j]|=Y,Z|=Y}Z?et=dt:(b.y0++,ut--,dt--,w++)}b.y1=b.y0+et,b.sprite=W.slice(0,(b.y1-b.y0)*X)}}}function h(E,b,S){S>>=5;for(var M=E.sprite,R=E.width>>5,C=E.x-(R<<4),I=C&127,w=32-I,V=E.y1-E.y0,U=(E.y+E.y0)*S+(C>>5),H,T=0;T<V;T++){H=0;for(var $=0;$<=R;$++)if((H<<w|($<R?(H=M[T*R+$])>>>I:0))&b[U+$])return!0;U+=S}return!1}function p(E,b){var S=E[0],M=E[1];b.x+b.x0<S.x&&(S.x=b.x+b.x0),b.y+b.y0<S.y&&(S.y=b.y+b.y0),b.x+b.x1>M.x&&(M.x=b.x+b.x1),b.y+b.y1>M.y&&(M.y=b.y+b.y1)}function f(E,b){return E.x+E.x1>b[0].x&&E.x+E.x0<b[1].x&&E.y+E.y1>b[0].y&&E.y+E.y0<b[1].y}function g(E){var b=E[0]/E[1];return function(S){return[b*(S*=.1)*Math.cos(S),S*Math.sin(S)]}}function m(E){var b=4,S=b*E[0]/E[1],M=0,R=0;return function(C){var I=C<0?-1:1;switch(Math.sqrt(1+4*I*C)-I&3){case 0:M+=S;break;case 1:R+=b;break;case 2:M-=S;break;default:R-=b;break}return[M,R]}}function v(E){for(var b=[],S=-1;++S<E;)b[S]=0;return b}function x(){return document.createElement("canvas")}function _(E){return typeof E=="function"?E:function(){return E}}return $u}var EN=_N();const TN=fN(EN);class SN extends bt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=ot.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=P.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=TN().size([u,d]).words(i.map(function(f){const g=f[o];if(typeof f[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:f[c],text:f[l],size:g,value:g}})).padding(5).rotate(0).fontSize(f=>s(f.size)).on("end",p);h.start();function p(f){const g=P.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(f,v=>`${v[c]}-${v.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=P.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?en(i):[1,1];return sn().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=wa(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOVER,{event:s,element:N(this),datum:a}),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:Et(t,"locale.translations.group")||Et(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=N(this);r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.WordCloud.WORD_CLICK,{event:s,element:N(this),datum:a})}).on("mouseout",function(s,a){const o=N(this);i(null),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class ON extends bt{constructor(){super(...arguments),this.type="geo",this.renderType=ot.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=P.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=vD(s,Object.values(l)),u=fD(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=MA().projection(d);P.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=P.appendOrSelect(t,"defs");P.appendOrSelect(f,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Os()([[0,0],[0,10]]));const g=P.appendOrSelect(t,"g.missing-data");P.appendOrSelect(g,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case dn.geoEqualEarth:t=qA();break;case dn.geoAlbers:t=HA();break;case dn.geoConicEqualArea:t=eg();break;case dn.geoConicEquidistant:t=jA();break;case dn.geoEquirectangular:t=zA();break;case dn.geoMercator:t=VA();break;case dn.geoNaturalEarth1:t=YA();break;default:throw new Error("Projection is not supported.")}return t}}class wN extends ON{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=N(this);t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEMOVE,{event:r,element:N(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Pr.CHOROPLETH_CLICK,{event:r,element:N(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=N(this);t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.HIDE,{event:r,hoveredElement:s})})}}function Mu(e){var t=e==null?0:e.length;return t?Xs(e,1):[]}function $N(e){return fh(vh(e,void 0,Mu),e+"")}function lv(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function MN(e,t){return t.length<2?e:ul(e,lv(t,0,-1))}function CN(e,t){return t=Ys(t,e),e=MN(e,t),e==null||delete e[Ui(dd(t))]}function AN(e){return Ah(e)?void 0:e}var LN=1,kN=2,DN=4,RN=$N(function(e,t){var n={};if(e==null)return n;var r=!1;t=Qo(t,function(s){return s=Ys(s,e),r||(r=s.length>1),s}),Vr(e,Hh(e),n),r&&(n=Bi(n,LN|kN|DN,AN));for(var i=t.length;i--;)CN(n,t[i]);return n});function cv(e){return Math.log(e)}function uv(e){return Math.exp(e)}function IN(e){return-Math.log(-e)}function NN(e){return-Math.exp(-e)}function PN(e){return isFinite(e)?+("1e"+e):e<0?0:e}function UN(e){return e===10?PN:e===Math.E?Math.exp:t=>Math.pow(e,t)}function BN(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function hv(e){return(t,n)=>-e(-t,n)}function HN(e){const t=e(cv,uv),n=t.domain;let r=10,i,s;function a(){return i=BN(r),s=UN(r),n()[0]<0?(i=hv(i),s=hv(s),e(IN,NN)):e(cv,uv),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),p=i(u),f,g;const m=o==null?10:+o;let v=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(f=1;f<r;++f)if(g=h<0?f/s(-h):f*s(h),!(g<c)){if(g>u)break;v.push(g)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(g=h>0?f/s(-h):f*s(h),!(g<c)){if(g>u)break;v.push(g)}v.length*2<m&&(v=ea(c,u,m))}else v=ea(h,p,Math.min(p-h,m)).map(s);return d?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Ki(l)).precision==null&&(l.trim=!0),l=Fl(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(Kp(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function dv(){const e=HN(mp()).domain([1,10]);return e.copy=()=>Wl(e,dv()).base(e.base()),Kr.apply(e,arguments),e}function Eo(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function To(e){this._context=e}To.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Eo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Eo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function VN(e){return new To(e)}function pv(e){this._context=e}pv.prototype={areaStart:Jn,areaEnd:Jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Eo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function GN(e){return new pv(e)}function fv(e){this._context=e}fv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Eo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zN(e){return new fv(e)}function mv(e,t){this._basis=new To(e),this._beta=t}mv.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const FN=function e(t){function n(r){return t===1?new To(r):new mv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function So(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Cu(e,t){this._context=e,this._k=(1-t)/6}Cu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:So(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:So(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jN=function e(t){function n(r){return new Cu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Au(e,t){this._context=e,this._k=(1-t)/6}Au.prototype={areaStart:Jn,areaEnd:Jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:So(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const WN=function e(t){function n(r){return new Au(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Lu(e,t){this._context=e,this._k=(1-t)/6}Lu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:So(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const qN=function e(t){function n(r){return new Lu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function ku(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ce){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ce){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function gv(e,t){this._context=e,this._alpha=t}gv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:ku(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const YN=function e(t){function n(r){return t?new gv(r,t):new Cu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function vv(e,t){this._context=e,this._alpha=t}vv.prototype={areaStart:Jn,areaEnd:Jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ku(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const XN=function e(t){function n(r){return t?new vv(r,t):new Au(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function yv(e,t){this._context=e,this._alpha=t}yv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ku(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ZN=function e(t){function n(r){return t?new yv(r,t):new Lu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function xv(e){return e<0?-1:1}function bv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(xv(s)+xv(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function _v(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Du(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function Oo(e){this._context=e}Oo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Du(this,this._t0,_v(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Du(this,_v(this,n=bv(this,e,t)),n);break;default:Du(this,this._t0,n=bv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ev(e){this._context=new Tv(e)}(Ev.prototype=Object.create(Oo.prototype)).point=function(e,t){Oo.prototype.point.call(this,t,e)};function Tv(e){this._context=e}Tv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function KN(e){return new Oo(e)}function QN(e){return new Ev(e)}function Sv(e){this._context=e}Sv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Ov(e),i=Ov(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Ov(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function JN(e){return new Sv(e)}function wo(e,t){this._context=e,this._t=t}wo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function tP(e){return new wo(e,.5)}function eP(e){return new wo(e,0)}function nP(e){return new wo(e,1)}class rP extends Hn{zoomIn(t,n,r){let i,s,a;const o=r||Jr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=P.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_IN,{element:N(t)})}zoomOut(t,n){const r=n||Jr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class iP extends Hn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class sP extends Hn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class aP extends Hn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(y(Ep,n,"duration")||Ep.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Ds(e,t){const n=+jt(e)-+jt(t);return n<0?-1:n>0?1:n}function oP(e,t,n){const[r,i]=or(void 0,e,t);return r.getFullYear()-i.getFullYear()}function lP(e,t,n){const[r,i]=or(void 0,e,t),s=Ds(r,i),a=Math.abs(oP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Ds(r,i)===-s,l=s*(a-+o);return l===0?0:l}function Ru(e,t,n){const r=jt(e,void 0);if(isNaN(t))return He(e,NaN);if(!t)return r;const i=r.getDate(),s=He(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function wv(e,t,n){return Ru(e,t*12)}function cP(e,t,n){return wv(e,-t)}function uP(e,t,n){const[r,i]=or(void 0,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function hP(e,t){const n=jt(e,void 0);return n.setHours(23,59,59,999),n}function dP(e,t){const n=jt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function pP(e,t){const n=jt(e,void 0);return+hP(n)==+dP(n)}function fP(e,t,n){const[r,i,s]=or(void 0,e,e,t),a=Ds(i,s),o=Math.abs(uP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Ds(i,s)===-a;pP(r)&&o===1&&Ds(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function mP(e,t,n){return Ru(e,-t)}function gP(e,t,n){const[r,i]=or(void 0,e,t),s=$v(r,i),a=Math.abs(Rp(r,i));r.setDate(r.getDate()-s*a);const o=+($v(r,i)===-s),l=s*(a-o);return l===0?0:l}function $v(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Mv(e,t,n){const r=jt(e,void 0);return isNaN(t)?He(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function vP(e,t,n){return Mv(e,-t)}function Iu(e){return t=>{const n=(0,Math.trunc)(t);return n===0?0:n}}function yP(e,t,n){const[r,i]=or(void 0,e,t),s=(+r-+i)/nh;return Iu()(s)}function Cv(e,t,n){return He(e,+jt(e)+t)}function Av(e,t,n){return Cv(e,t*nh)}function xP(e,t,n){return Av(e,-t)}function Lv(e,t){return+jt(e)-+jt(t)}function kv(e,t,n){const r=Lv(e,t)/eh;return Iu()(r)}function Nu(e,t,n){const r=jt(e,void 0);return r.setTime(r.getTime()+t*eh),r}function Dv(e,t,n){return Nu(e,-t)}function Rv(e,t,n){const r=Lv(e,t)/1e3;return Iu()(r)}function Pu(e,t,n){return Cv(e,t*1e3)}function Iv(e,t,n){return Pu(e,-t)}class bP extends Hn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===F.BOTTOM||t===F.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(F).map(t=>F[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===F.LEFT||this.rangeAxisPosition===F.RIGHT)&&(this.domainAxisPosition===F.BOTTOM||this.domainAxisPosition===F.TOP)?this.orientation=Xt.VERTICAL:this.orientation=Xt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=y(s,"axes");((t=a[F.LEFT])!=null&&t.correspondingDatasets&&a[F.RIGHT]||(n=a[F.RIGHT])!=null&&n.correspondingDatasets&&a[F.LEFT]||(r=a[F.TOP])!=null&&r.correspondingDatasets&&a[F.BOTTOM]||(i=a[F.BOTTOM])!=null&&i.correspondingDatasets&&a[F.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===at.LINEAR||this.scaleTypes[t]===at.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[F.BOTTOM,F.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[F.LEFT,F.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=y(i,o)!==null?i[o]:i;let c;switch(n){case at.LABELS:c=t(l)+t.step()/2;break;case at.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===at.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return _P(n,s)}else return EP(n,Zn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,F.LEFT)===null&&y(n,F.RIGHT)!==null||y(n,F.RIGHT,"main")===!0||r&&y(n,F.LEFT,"correspondingDatasets")?{primary:F.RIGHT,secondary:F.LEFT}:{primary:F.LEFT,secondary:F.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,F.BOTTOM)===null&&y(n,F.TOP)!==null||y(n,F.TOP,"main")===!0||r&&y(n,F.BOTTOM,"correspondingDatasets")?{primary:F.TOP,secondary:F.BOTTOM}:{primary:F.BOTTOM,secondary:F.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||at.LINEAR,o=s.scaleType||at.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===at.LABELS||o===at.TIME)&&a===at.LABELS||a===at.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||at.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,fr(v,x=>x.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),x=this.model.getStackKeys({bins:v});return[x[0].split(":")[0],x[x.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=Zn.ratio;if(r.domain)return a===at.LABELS?r.domain:(a===at.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===at.LABELS)return Vi(o.map(v=>v[c]));let f,g;const m=this.model.getDataGroupNames();if(a===at.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[p]}`);if(a===at.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,x=this.model.getDataValuesGroupedByKeys({groups:m}),_=o.filter(b=>!m.includes(b[v])),E=[];x.forEach(b=>{const{...S}=b;let M=0,R=0;Object.values(RN(S,"sharedStackKey")).forEach(C=>{isNaN(C)||(C<0?R+=C:M+=C)}),E.push([R,M])}),g=[...Mu(E),..._.map(b=>b[c])]}else g=[],o.forEach(v=>{const x=v[c];Array.isArray(x)&&x.length===2?(g.push(x[0]),g.push(x[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(x))});return a!==at.TIME&&a!==at.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const x=y(v,"value");x!==null&&g.push(x)}),f=en(g),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||at.LINEAR;this.scaleTypes[t]=i;let s;return i===at.TIME?s=vf():i===at.LOG?s=dv().base(r.base||10):i===at.LABELS||i===at.LABELS_RATIO?s=is():s=sn(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Xt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===at.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function _P(e,t){const n=new Date(e[0]),r=new Date(e[1]);return lP(r,n)>1?[cP(n,t),wv(r,t)]:fP(r,n)>1?[mP(n,t),Ru(r,t)]:gP(r,n)>1?[vP(n,t),Mv(r,t)]:yP(r,n)>1?[xP(n,t),Av(r,t)]:kv(r,n)>30?[Dv(n,t*30),Nu(r,t*30)]:kv(r,n)>1?[Dv(n,t),Nu(r,t)]:Rv(r,n)>15?[Iv(n,t*15),Pu(r,t*15)]:Rv(r,n)>1?[Iv(n,t),Pu(r,t)]:[n,r]}function EP([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===at.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}class TP extends Hn{constructor(){super(...arguments),this.curveTypes={curveLinear:Da,curveLinearClosed:Ef,curveBasis:VN,curveBasisClosed:GN,curveBasisOpen:zN,curveBundle:FN,curveCardinal:jN,curveCardinalClosed:WN,curveCardinalOpen:qN,curveCatmullRom:YN,curveCatmullRomClosed:XN,curveCatmullRomOpen:ZN,curveMonotoneX:KN,curveMonotoneY:QN,curveNatural:JN,curveStep:tP,curveStepAfter:nP,curveStepBefore:eP}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class SP extends Hn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===F.BOTTOM&&n===at.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,en(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=De.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=a+u,h=o-u;d>=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const p=[s.invert(d),s.invert(h)];(r[0].valueOf()!==p[0].valueOf()||r[1].valueOf()!==p[1].valueOf())&&this.handleDomainChange(p)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}function OP(e,t,n){var r=e.length;return n=n===void 0?r:n,lv(e,t,n)}var wP="\\ud800-\\udfff",$P="\\u0300-\\u036f",MP="\\ufe20-\\ufe2f",CP="\\u20d0-\\u20ff",AP=$P+MP+CP,LP="\\ufe0e\\ufe0f",kP="\\u200d",DP=RegExp("["+kP+wP+AP+LP+"]");function Nv(e){return DP.test(e)}function RP(e){return e.split("")}var Pv="\\ud800-\\udfff",IP="\\u0300-\\u036f",NP="\\ufe20-\\ufe2f",PP="\\u20d0-\\u20ff",UP=IP+NP+PP,BP="\\ufe0e\\ufe0f",HP="["+Pv+"]",Uu="["+UP+"]",Bu="\\ud83c[\\udffb-\\udfff]",VP="(?:"+Uu+"|"+Bu+")",Uv="[^"+Pv+"]",Bv="(?:\\ud83c[\\udde6-\\uddff]){2}",Hv="[\\ud800-\\udbff][\\udc00-\\udfff]",GP="\\u200d",Vv=VP+"?",Gv="["+BP+"]?",zP="(?:"+GP+"(?:"+[Uv,Bv,Hv].join("|")+")"+Gv+Vv+")*",FP=Gv+Vv+zP,jP="(?:"+[Uv+Uu+"?",Uu,Bv,Hv,HP].join("|")+")",WP=RegExp(Bu+"(?="+Bu+")|"+jP+FP,"g");function qP(e){return e.match(WP)||[]}function YP(e){return Nv(e)?qP(e):RP(e)}function XP(e){return function(t){t=Pi(t);var n=Nv(t)?YP(t):void 0,r=n?n[0]:t.charAt(0),i=n?OP(n,1).join(""):t.slice(1);return r[e]()+i}}var ZP=XP("toUpperCase");function KP(e){return ZP(Pi(e).toLowerCase())}var QP=nm(function(e,t,n){return t=t.toLowerCase(),e+(n?KP(t):t)});class cn{constructor(t,n){this.components=[],this.services={canvasZoom:rP,domUtils:P,events:iP,files:sP,gradientUtils:_c,transitions:aP},this.model=new gn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(O.Model.UPDATE,r=>{const i=!!y(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(O.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s={id:"legend",components:[new yu(this.model,this.services)],growth:pt.PREFERRED},a=y(r,"canvasZoom","enabled");a&&a===!0&&t.push(new Ik(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Ls(this.model,this.services)],growth:pt.STRETCH},c={id:"toolbar",components:[new mo(this.model,this.services)],growth:pt.PREFERRED},u={id:"header",components:[new Ne(this.model,this.services,[l,...i?[c]:[]],{direction:Rt.ROW,alignItems:sr.CENTER})],growth:pt.PREFERRED},d={id:"graph-frame",components:t,growth:pt.STRETCH,renderType:y(n,"graphFrameRenderType")||ot.SVG},h=y(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Rt.COLUMN;if(h){const v=y(r,"legend","position");v==="left"?(p=Rt.ROW,r.legend.orientation||(r.legend.orientation=Br.VERTICAL)):v==="right"?(p=Rt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Br.VERTICAL)):v==="bottom"&&(p=Rt.COLUMN_REVERSE)}const f={id:"spacer",components:[new Fn(this.model,this.services)],growth:pt.PREFERRED},g={id:"full-frame",components:[new Ne(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:pt.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new Fn(this.model,this.services,i?{size:15}:void 0)],growth:pt.PREFERRED};m.push(v)}return m.push(g),[new xu(this.model,this.services),new go(this.model,this.services),new Ne(this.model,this.services,m,{direction:Rt.COLUMN})]}}class Me extends cn{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:bP,curves:TP,zoom:SP}),this.model=new Er(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",F.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===F.BOTTOM&&o===at.TIME,c=this.services.zoom.isZoomBarLocked(F.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Ls(this.model,this.services)],growth:pt.STRETCH},h={id:"toolbar",components:[new mo(this.model,this.services)],growth:pt.PREFERRED},p={id:"header",components:[new Ne(this.model,this.services,[d,...s?[h]:[]],{direction:Rt.ROW,alignItems:sr.CENTER})],growth:pt.PREFERRED},f={id:"legend",components:[new yu(this.model,this.services)],growth:pt.PREFERRED};l&&!c&&t.push(new Lg(this.model,this.services),new Nk(this.model,this.services)),t.push(new Uk(this.model,this.services)),t.push(new Bk(this.model,this.services));const g={id:"graph-frame",components:t,growth:pt.STRETCH,renderType:ot.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Rt.COLUMN;if(m){const S=y(this.model.getOptions(),"legend","position");S===Ur.LEFT?(v=Rt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Br.VERTICAL)):S===Ur.RIGHT?(v=Rt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Br.VERTICAL)):S===Ur.BOTTOM&&(v=Rt.COLUMN_REVERSE)}const x={id:"spacer",components:[new Fn(this.model,this.services)],growth:pt.PREFERRED},_={id:"full-frame",components:[new Ne(this.model,this.services,[...m?[f]:[],...m?[x]:[],g],{direction:v})],growth:pt.STRETCH},E={id:"zoom-bar",components:[new Pk(this.model,this.services)],growth:pt.PREFERRED,renderType:ot.SVG},b=[];if(u||s){b.push(p);const S={id:"spacer",components:[new Fn(this.model,this.services,s?{size:15}:void 0)],growth:pt.PREFERRED};b.push(S)}return l&&b.push(E),b.push(_),[new Ig(this.model,this.services),new go(this.model,this.services),new Ne(this.model,this.services,b,{direction:Rt.COLUMN})]}}class JP extends cn{constructor(t,n){super(t,n),this.model=new Zw(this.services),this.model.setOptions(Ht(It.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new sD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class t3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht($n(It.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new nr(this.model,this.services),new xi(this.model,this.services),new Fg(this.model,this.services),new _n(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new be(this.model,this.services,{skeleton:Kt.GRID})];return this.getAxisChartComponents(t)}}class e3 extends Me{constructor(t,n){super(t,n),this.model=new Kw(this.services),this.model.setOptions(Ht(It.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new lD(this.model,this.services),new bi(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class n3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht(It.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new nr(this.model,this.services),new cD(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.GRID})];return this.getAxisChartComponents(t)}}class r3 extends Me{constructor(t,n){super(t,n),this.model=new Qw(this.services),this.model.setOptions(Ht(It.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new uD(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.GRID})];return this.getAxisChartComponents(t)}}class i3 extends cn{constructor(t,n){super(t,n),this.model=new Jw(this.services),this.model.setOptions(Ht(It.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Ls(this.model,this.services)],growth:pt.STRETCH},o={id:"toolbar",components:[new mo(this.model,this.services)],growth:pt.PREFERRED},l={id:"header",components:[new Ne(this.model,this.services,[a,...i?[o]:[]],{direction:Rt.ROW,alignItems:sr.CENTER})],growth:pt.PREFERRED},c={id:"legend",components:[new Yg(this.model,this.services,{chartType:"choropleth"})],growth:pt.PREFERRED,renderType:ot.SVG},u={id:"graph-frame",components:t,growth:pt.STRETCH,renderType:ot.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Rt.COLUMN_REVERSE,p={id:"spacer",components:[new Fn(this.model,this.services,{size:15})],growth:pt.PREFERRED},f={id:"full-frame",components:[new Ne(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:pt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Fn(this.model,this.services,i?{size:15}:void 0)],growth:pt.PREFERRED};g.push(m)}return g.push(f),[new xu(this.model,this.services),new go(this.model,this.services),new Ne(this.model,this.services,g,{direction:Rt.COLUMN})]}getComponents(){const t=[new wN(this.model,this.services)];return this.getChartComponents(t)}}class s3 extends cn{constructor(t,n){super(t,n),this.model=new t$(this.services),this.model.setOptions(Ht(It.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new MD(this.model,this.services)];return this.getChartComponents(t)}}const zv={[Ae.LINE]:[xi,_n],[Ae.SCATTER]:[_n],[Ae.AREA]:[Fg,xi,_n],[Ae.STACKED_AREA]:[tv,xi,nv,bo],[Ae.SIMPLE_BAR]:[Jg],[Ae.GROUPED_BAR]:[Qg,bi],[Ae.STACKED_BAR]:[ev,bo]};class a3 extends Me{constructor(t,n){super(t,n);const r=Ht(It.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Ae.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(zv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${QP(i.type)}Chart`;return a=ht({},It[l],this.model.getOptions(),i.options),i.type===Ae.STACKED_AREA&&(o=!0),zv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ht({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Mu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Ae.STACKED_BAR||i.type===Ae.STACKED_AREA),r=[new $e(this.model,this.services),new Pe(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.GRID}),...n?[]:[new nr(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Fv extends cn{constructor(t,n,r=!1){super(t,n),this.model=new e$(this.services),!r&&(this.model.setOptions(Ht(It.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Xg(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.PIE})];return this.getChartComponents(t)}}class o3 extends Fv{constructor(t,n){super(t,n,!0),this.model.setOptions(Ht(It.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new AD(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.DONUT})];return this.getChartComponents(t)}}class l3 extends cn{constructor(t,n){super(t,n),this.model=new n$(this.services),this.model.setOptions(Ht(It.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new LD(this.model,this.services)];return this.getChartComponents(t)}}class c3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht(It.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new Qg(this.model,this.services),new bi(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class u3 extends Me{constructor(t,n){super(t,n),this.model=new r$(this.services),this.model.setOptions(Ht(It.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Ls(this.model,this.services)],growth:pt.STRETCH},o={id:"toolbar",components:[new mo(this.model,this.services)],growth:pt.PREFERRED},l={id:"header",components:[new Ne(this.model,this.services,[a,...i?[o]:[]],{direction:Rt.ROW,alignItems:sr.CENTER})],growth:pt.PREFERRED},c={id:"legend",components:[new Yg(this.model,this.services,{chartType:"heatmap"})],growth:pt.PREFERRED,renderType:ot.SVG},u={id:"graph-frame",components:t,growth:pt.STRETCH,renderType:ot.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Rt.COLUMN_REVERSE,p={id:"spacer",components:[new Fn(this.model,this.services,{size:15})],growth:pt.PREFERRED},f={id:"full-frame",components:[new Ne(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:pt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Fn(this.model,this.services,i?{size:15}:void 0)],growth:pt.PREFERRED};g.push(m)}return g.push(f),[new Ig(this.model,this.services),new go(this.model,this.services),new Ne(this.model,this.services,g,{direction:Rt.COLUMN})]}getComponents(){const t=[new $e(this.model,this.services),new kD(this.model,this.services)];return this.getAxisChartComponents(t)}}class h3 extends Me{constructor(t,n){super(t,n),this.model=new i$(this.services),this.model.setOptions(Ht(It.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new xD(this.model,this.services),new DD(this.model,this.services)];return this.getAxisChartComponents(t)}}class d3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht(It.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new nr(this.model,this.services),new xi(this.model,this.services),new _n(this.model,this.services,{handleThresholds:!0}),new PD(this.model,this.services),new bi(this.model,this.services)];return this.getAxisChartComponents(t)}}class p3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht(It.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new nr(this.model,this.services),new RD(this.model,this.services),new _n(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.GRID})];return this.getAxisChartComponents(t)}}class f3 extends cn{constructor(t,n){var r;super(t,n),this.model=new s$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?ht($n(It.proportionalMeterChart),n.options):ht($n(It.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new $D(this.model,this.services)],growth:pt.STRETCH,renderType:ot.SVG},{id:"spacer",components:[new Fn(this.model,this.services,{size:8})],growth:pt.STRETCH}]:[],{id:"meter-graph",components:[new ID(this.model,this.services)],growth:pt.STRETCH,renderType:ot.SVG}],n=[new Ne(this.model,this.services,t,{direction:Rt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:ot.HTML})}}class m3 extends cn{constructor(t,n){super(t,n),this.model=new a$(this.services),this.model.setOptions(Ht(It.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ND(this.model,this.services)];return this.getChartComponents(t)}}class g3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht(It.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new nr(this.model,this.services),new _n(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.GRID})];return this.getAxisChartComponents(t)}}class v3 extends cn{constructor(t,n){super(t,n),this.model=new o$(this.services),this.model.setOptions(Ht(It.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new UD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class y3 extends cn{constructor(t,n){super(t,n),this.model=new l$(this.services),this.model.setOptions(Ht(It.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new pN(this.model,this.services)];return this.getChartComponents(t)}}class x3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht(It.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new Jg(this.model,this.services),new bi(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class b3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht(It.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new bo(this.model,this.services),new tv(this.model,this.services),new xi(this.model,this.services,{stacked:!0}),new nv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new be(this.model,this.services,{skeleton:Kt.GRID})];return this.getAxisChartComponents(t)}}class _3 extends Me{constructor(t,n){super(t,n),this.model.setOptions(Ht(It.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new $e(this.model,this.services),new Pe(this.model,this.services),new bo(this.model,this.services),new ev(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.VERT_OR_HORIZ}),new bi(this.model,this.services)];return this.getAxisChartComponents(t)}}class E3 extends cn{constructor(t,n){super(t,n),this.model=new c$(this.services),this.model.setOptions(Ht(It.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new SN(this.model,this.services),new be(this.model,this.services,{skeleton:Kt.PIE})];return this.getChartComponents(t)}}function T3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $o={exports:{}},Rs={};/**
74
- * @license React
75
- * react-jsx-runtime.production.js
76
- *
77
- * Copyright (c) Meta Platforms, Inc. and affiliates.
78
- *
79
- * This source code is licensed under the MIT license found in the
80
- * LICENSE file in the root directory of this source tree.
81
- */var jv;function S3(){if(jv)return Rs;jv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var o in i)o!=="key"&&(s[o]=i[o])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:s}}return Rs.Fragment=t,Rs.jsx=n,Rs.jsxs=n,Rs}var Is={};/**
82
- * @license React
83
- * react-jsx-runtime.development.js
84
- *
85
- * Copyright (c) Meta Platforms, Inc. and affiliates.
86
- *
87
- * This source code is licensed under the MIT license found in the
88
- * LICENSE file in the root directory of this source tree.
89
- */var Wv;function O3(){return Wv||(Wv=1,process.env.NODE_ENV!=="production"&&function(){function e(k){if(k==null)return null;if(typeof k=="function")return k.$$typeof===D?null:k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case S:return"Fragment";case b:return"Portal";case R:return"Profiler";case M:return"StrictMode";case V:return"Suspense";case U:return"SuspenseList"}if(typeof k=="object")switch(typeof k.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),k.$$typeof){case I:return(k.displayName||"Context")+".Provider";case C:return(k._context.displayName||"Context")+".Consumer";case w:var it=k.render;return k=k.displayName,k||(k=it.displayName||it.name||"",k=k!==""?"ForwardRef("+k+")":"ForwardRef"),k;case H:return it=k.displayName||null,it!==null?it:e(k.type)||"Memo";case T:it=k._payload,k=k._init;try{return e(k(it))}catch{}}return null}function t(k){return""+k}function n(k){try{t(k);var it=!1}catch{it=!0}if(it){it=console;var rt=it.error,mt=typeof Symbol=="function"&&Symbol.toStringTag&&k[Symbol.toStringTag]||k.constructor.name||"Object";return rt.call(it,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",mt),t(k)}}function r(){}function i(){if(ut===0){tt=console.log,Z=console.info,et=console.warn,dt=console.error,j=console.group,Y=console.groupCollapsed,K=console.groupEnd;var k={configurable:!0,enumerable:!0,value:r,writable:!0};Object.defineProperties(console,{info:k,log:k,warn:k,error:k,group:k,groupCollapsed:k,groupEnd:k})}ut++}function s(){if(ut--,ut===0){var k={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},k,{value:tt}),info:W({},k,{value:Z}),warn:W({},k,{value:et}),error:W({},k,{value:dt}),group:W({},k,{value:j}),groupCollapsed:W({},k,{value:Y}),groupEnd:W({},k,{value:K})})}0>ut&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function a(k){if(z===void 0)try{throw Error()}catch(rt){var it=rt.stack.trim().match(/\n( *(at )?)/);z=it&&it[1]||"",ft=-1<rt.stack.indexOf(`
90
- at`)?" (<anonymous>)":-1<rt.stack.indexOf("@")?"@unknown:0:0":""}return`
91
- `+z+k+ft}function o(k,it){if(!k||ct)return"";var rt=Dt.get(k);if(rt!==void 0)return rt;ct=!0,rt=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var mt=null;mt=B.H,B.H=null,i();try{var Ft={DetermineComponentFrameRoot:function(){try{if(it){var Ue=function(){throw Error()};if(Object.defineProperty(Ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ue,[])}catch(pe){var Ce=pe}Reflect.construct(k,[],Ue)}else{try{Ue.call()}catch(pe){Ce=pe}k.call(Ue.prototype)}}else{try{throw Error()}catch(pe){Ce=pe}(Ue=k())&&typeof Ue.catch=="function"&&Ue.catch(function(){})}}catch(pe){if(pe&&Ce&&typeof pe.stack=="string")return[pe.stack,Ce.stack]}return[null,null]}};Ft.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var $t=Object.getOwnPropertyDescriptor(Ft.DetermineComponentFrameRoot,"name");$t&&$t.configurable&&Object.defineProperty(Ft.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var gt=Ft.DetermineComponentFrameRoot(),Xe=gt[0],jn=gt[1];if(Xe&&jn){var ee=Xe.split(`
92
- `),En=jn.split(`
93
- `);for(gt=$t=0;$t<ee.length&&!ee[$t].includes("DetermineComponentFrameRoot");)$t++;for(;gt<En.length&&!En[gt].includes("DetermineComponentFrameRoot");)gt++;if($t===ee.length||gt===En.length)for($t=ee.length-1,gt=En.length-1;1<=$t&&0<=gt&&ee[$t]!==En[gt];)gt--;for(;1<=$t&&0<=gt;$t--,gt--)if(ee[$t]!==En[gt]){if($t!==1||gt!==1)do if($t--,gt--,0>gt||ee[$t]!==En[gt]){var Tn=`
94
- `+ee[$t].replace(" at new "," at ");return k.displayName&&Tn.includes("<anonymous>")&&(Tn=Tn.replace("<anonymous>",k.displayName)),typeof k=="function"&&Dt.set(k,Tn),Tn}while(1<=$t&&0<=gt);break}}}finally{ct=!1,B.H=mt,s(),Error.prepareStackTrace=rt}return ee=(ee=k?k.displayName||k.name:"")?a(ee):"",typeof k=="function"&&Dt.set(k,ee),ee}function l(k){if(k==null)return"";if(typeof k=="function"){var it=k.prototype;return o(k,!(!it||!it.isReactComponent))}if(typeof k=="string")return a(k);switch(k){case V:return a("Suspense");case U:return a("SuspenseList")}if(typeof k=="object")switch(k.$$typeof){case w:return k=o(k.render,!1),k;case H:return l(k.type);case T:it=k._payload,k=k._init;try{return l(k(it))}catch{}}return""}function c(){var k=B.A;return k===null?null:k.getOwner()}function u(k){if(Q.call(k,"key")){var it=Object.getOwnPropertyDescriptor(k,"key").get;if(it&&it.isReactWarning)return!1}return k.key!==void 0}function d(k,it){function rt(){st||(st=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",it))}rt.isReactWarning=!0,Object.defineProperty(k,"key",{get:rt,configurable:!0})}function h(){var k=e(this.type);return Tt[k]||(Tt[k]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),k=this.props.ref,k!==void 0?k:null}function p(k,it,rt,mt,Ft,$t){return rt=$t.ref,k={$$typeof:E,type:k,key:it,props:$t,_owner:Ft},(rt!==void 0?rt:null)!==null?Object.defineProperty(k,"ref",{enumerable:!1,get:h}):Object.defineProperty(k,"ref",{enumerable:!1,value:null}),k._store={},Object.defineProperty(k._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(k,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k}function f(k,it,rt,mt,Ft,$t){if(typeof k=="string"||typeof k=="function"||k===S||k===R||k===M||k===V||k===U||k===$||typeof k=="object"&&k!==null&&(k.$$typeof===T||k.$$typeof===H||k.$$typeof===I||k.$$typeof===C||k.$$typeof===w||k.$$typeof===q||k.getModuleId!==void 0)){var gt=it.children;if(gt!==void 0)if(mt)if(X(gt)){for(mt=0;mt<gt.length;mt++)g(gt[mt],k);Object.freeze&&Object.freeze(gt)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(gt,k)}else gt="",(k===void 0||typeof k=="object"&&k!==null&&Object.keys(k).length===0)&&(gt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),k===null?mt="null":X(k)?mt="array":k!==void 0&&k.$$typeof===E?(mt="<"+(e(k.type)||"Unknown")+" />",gt=" Did you accidentally export a JSX literal instead of a component?"):mt=typeof k,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",mt,gt);if(Q.call(it,"key")){gt=e(k);var Xe=Object.keys(it).filter(function(ee){return ee!=="key"});mt=0<Xe.length?"{key: someKey, "+Xe.join(": ..., ")+": ...}":"{key: someKey}",_e[gt+mt]||(Xe=0<Xe.length?"{"+Xe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
95
- let props = %s;
96
- <%s {...props} />
97
- React keys must be passed directly to JSX without using spread:
98
- let props = %s;
99
- <%s key={someKey} {...props} />`,mt,gt,Xe,gt),_e[gt+mt]=!0)}if(gt=null,rt!==void 0&&(n(rt),gt=""+rt),u(it)&&(n(it.key),gt=""+it.key),"key"in it){rt={};for(var jn in it)jn!=="key"&&(rt[jn]=it[jn])}else rt=it;return gt&&d(rt,typeof k=="function"?k.displayName||k.name||"Unknown":k),p(k,gt,$t,Ft,c(),rt)}function g(k,it){if(typeof k=="object"&&k&&k.$$typeof!==Gt){if(X(k))for(var rt=0;rt<k.length;rt++){var mt=k[rt];m(mt)&&v(mt,it)}else if(m(k))k._store&&(k._store.validated=1);else if(k===null||typeof k!="object"?rt=null:(rt=A&&k[A]||k["@@iterator"],rt=typeof rt=="function"?rt:null),typeof rt=="function"&&rt!==k.entries&&(rt=rt.call(k),rt!==k))for(;!(k=rt.next()).done;)m(k.value)&&v(k.value,it)}}function m(k){return typeof k=="object"&&k!==null&&k.$$typeof===E}function v(k,it){if(k._store&&!k._store.validated&&k.key==null&&(k._store.validated=1,it=x(it),!de[it])){de[it]=!0;var rt="";k&&k._owner!=null&&k._owner!==c()&&(rt=null,typeof k._owner.tag=="number"?rt=e(k._owner.type):typeof k._owner.name=="string"&&(rt=k._owner.name),rt=" It was passed a child from "+rt+".");var mt=B.getCurrentStack;B.getCurrentStack=function(){var Ft=l(k.type);return mt&&(Ft+=mt()||""),Ft},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',it,rt),B.getCurrentStack=mt}}function x(k){var it="",rt=c();return rt&&(rt=e(rt.type))&&(it=`
100
-
101
- Check the render method of \``+rt+"`."),it||(k=e(k))&&(it=`
102
-
103
- Check the top-level render call using <`+k+">."),it}var _=fe,E=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),I=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),A=Symbol.iterator,D=Symbol.for("react.client.reference"),B=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Object.prototype.hasOwnProperty,W=Object.assign,q=Symbol.for("react.client.reference"),X=Array.isArray,ut=0,tt,Z,et,dt,j,Y,K;r.__reactDisabledLog=!0;var z,ft,ct=!1,Dt=new(typeof WeakMap=="function"?WeakMap:Map),Gt=Symbol.for("react.client.reference"),st,Tt={},_e={},de={};Is.Fragment=S,Is.jsx=function(k,it,rt,mt,Ft){return f(k,it,rt,!1,mt,Ft)},Is.jsxs=function(k,it,rt,mt,Ft){return f(k,it,rt,!0,mt,Ft)}}()),Is}var qv;function w3(){return qv||(qv=1,process.env.NODE_ENV==="production"?$o.exports=S3():$o.exports=O3()),$o.exports}var Vt=w3();class Bt extends fe.PureComponent{constructor(){super(...arguments);ju(this,"chart");ju(this,"chartRef",fe.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}render(){return Vt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class $3 extends Bt{createChart(t,n,r){return new JP(t,{data:n,options:r})}}class M3 extends Bt{createChart(t,n,r){return new t3(t,{data:n,options:r})}}class C3 extends Bt{createChart(t,n,r){return new e3(t,{data:n,options:r})}}class A3 extends Bt{createChart(t,n,r){return new n3(t,{data:n,options:r})}}class L3 extends Bt{createChart(t,n,r){return new r3(t,{data:n,options:r})}}class Yv extends Bt{createChart(t,n,r){return new i3(t,{data:n,options:r})}}class k3 extends Bt{createChart(t,n,r){return new s3(t,{data:n,options:r})}}class D3 extends Bt{createChart(t,n,r){return new a3(t,{data:n,options:r})}}class R3 extends Bt{createChart(t,n,r){return new o3(t,{data:n,options:r})}}class I3 extends Bt{createChart(t,n,r){return new l3(t,{data:n,options:r})}}class N3 extends Bt{createChart(t,n,r){return new c3(t,{data:n,options:r})}}class P3 extends Bt{createChart(t,n,r){return new u3(t,{data:n,options:r})}}class U3 extends Bt{createChart(t,n,r){return new h3(t,{data:n,options:r})}}class B3 extends Bt{createChart(t,n,r){return new d3(t,{data:n,options:r})}}class H3 extends Bt{createChart(t,n,r){return new p3(t,{data:n,options:r})}}class V3 extends Bt{createChart(t,n,r){return new f3(t,{data:n,options:r})}}class G3 extends Bt{createChart(t,n,r){return new Fv(t,{data:n,options:r})}}class z3 extends Bt{createChart(t,n,r){return new m3(t,{data:n,options:r})}}class F3 extends Bt{createChart(t,n,r){return new g3(t,{data:n,options:r})}}class j3 extends Bt{createChart(t,n,r){return new x3(t,{data:n,options:r})}}class W3 extends Bt{createChart(t,n,r){return new b3(t,{data:n,options:r})}}class q3 extends Bt{createChart(t,n,r){return new _3(t,{data:n,options:r})}}class Y3 extends Bt{createChart(t,n,r){return new v3(t,{data:n,options:r})}}class X3 extends Bt{createChart(t,n,r){return new y3(t,{data:n,options:r})}}class Z3 extends Bt{createChart(t,n,r){return new E3(t,{data:n,options:r})}}var Hu={exports:{}};/*!
73
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(f=>{if(f!==null)return typeof f.data.value=="number"?{label:f.data.name,value:f.data.value}:{label:f.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:yt(p,"locale.translations.total")||yt(p,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Hr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Hr),n.stopPropagation()}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function $D(e,t){const n=Pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class jg extends gt{constructor(){super(...arguments),this.type="pie",this.renderType=it.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(A=>A[a]>0),l=this.computeRadius();this.arc=gs().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=gs().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const c=ek().value(A=>A[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",ht.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,A=>A.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",A=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:A.data[s],originalClassName:"slice"})).style("fill",A=>n.model.getFillColor(A.data[s],null,A.data)).attr("d",this.arc).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",A=>`${A[a]}, ${Vl(A.data[a],o,a)+"%"}`).attrTween("d",function(A){return $D.bind(this)(A,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=y(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(A=>A.data[a]>0):[],g=N.appendOrSelect(r,"g.labels").attr("role",ht.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,A=>A.data[s]);g.exit().attr("opacity",0).remove();const m=g.enter().append("text").classed("pie-label",!0),v=[];m.merge(g).style("text-anchor","middle").text(A=>i.pie.labels.formatter?i.pie.labels.formatter({...A,percentageValue:Vl(A.data[a],o,a,!0)}):h(Vl(A.data[a],o,a),d)+"%").datum(function(A){const R=l+7,$=(A.endAngle-A.startAngle)/2+A.startAngle,H=$/Math.PI*180,P=this.getComputedTextLength();return A.textOffsetX=P/2,A.textOffsetY=H>90&&H<270?10:0,A.xPosition=(A.textOffsetX+R)*Math.sin($),A.yPosition=(A.textOffsetY+R)*-Math.cos($),A}).attr("transform",function(A,R){const $=f.length,H=(A.endAngle-A.startAngle)*(180/Math.PI);if(R>=$-2&&H<Lt.callout.minSliceDegree){let P,B;return A.index===$-1?(P=A.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+A.textOffsetX,B=A.yPosition-Lt.callout.offsetY,A.direction=pi.RIGHT,v.push(A)):(P=A.xPosition-Lt.callout.offsetX-A.textOffsetX-Lt.callout.textMargin,B=A.yPosition-Lt.callout.offsetY,A.direction=pi.LEFT,v.push(A)),`translate(${P}, ${B})`}return`translate(${A.xPosition}, ${A.yPosition})`}),this.renderCallouts(v);const x=y(i,"donut")?"donut":"pie",_=y(i,x,"alignment"),{width:E}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),b=p?Lt.xOffset:0,T=p?Lt.yOffset:0;let M=l+b;_===zt.CENTER?M=E/2:_===zt.RIGHT&&(M=E-l-Lt.xOffset);let D=l+T;v.length>0&&(D+=Lt.yOffsetCallout),r.attr("x",M+7).attr("y",D),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ht.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ht.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===pi.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Lt.callout.offsetX,y:o-Lt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Lt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Lt.callout.offsetX,y:o-Lt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Lt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);EC(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class MD extends jg{constructor(){super(...arguments),this.type="donut",this.renderType=it.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Nd:s=xe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const Wg="4,10 8,6 12,10",qg="12,6 8,10 4,6";class CD extends gt{constructor(){super(...arguments),this.type="gauge",this.renderType=it.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Jf(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===Wn.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case As.UP:return Wg;case As.DOWN:return qg;default:return t>0?Wg:qg}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=gs().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=gs().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),N.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const p=n.selectAll("path.arc-foreground").data([i]);p.enter().append("path").merge(p).attr("class",this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=y(r,"gauge","alignment"),{width:g}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===zt.CENTER?m=g/2:f===zt.RIGHT&&(m=g-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===Wn.FULL&&!s?d=l(a):r===Wn.SEMI&&s&&(d=-(l(a)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(a),f=N.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),x=f.selectAll("text.gauge-value-number").data([i]);x.enter().append("text").attr("class","gauge-value-number").merge(x).style("font-size",`${p}px`).attr("text-anchor","middle").text(A=>{let R;return A!=null?R=Number(A.toFixed(2))%1!==0?A.toFixed(2):A.toFixed():R=0,v?v(R):m(Number(R),g)});const{width:_}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),E=p/2,b=u?"%":"",T=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${E}px`).attr("x",_/2).text(b),{width:M,height:D}=N.getSVGElementSize(T,{useBBox:!0});T.attr("y",`-${D/2}px`),f.attr("transform",`translate(-${M/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(E=>{let b;return E!=null?b=Number(E.toFixed(2))%1!==0?E.toFixed(2):E.toFixed():b=0,c?`${c(b)}${m}`:`${a(Number(b),s)}${m}`});const{width:v}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),x=y(r,"gauge","deltaArrow","enabled"),_=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&x?[i]:[]);_.enter().append("svg").merge(_).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const E=I(this);N.appendOrSelect(E,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=y(r,"gauge","status");N.appendOrSelect(E,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),_.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===Wn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Yg extends yu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=it.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=ki(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Gt.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),p=d,f=d+h,g=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(g),v=this.services.cartesianScales.getValueThroughAxisPosition(g,m),x=this.services.cartesianScales.getRangeValue(u),_=this.services.cartesianScales.getDomainValue(u)-h/2,E=_+h;if(!this.isOutsideZoomedDomain(_,E))return ie({x0:p,x1:f,y0:v,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Xi().domain(t).rangeRound([0,this.getGroupWidth()])}}class AD extends gt{constructor(){super(...arguments),this.type="heatmap",this.renderType=it.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,p=null;this.matrix[r]!==void 0?(u=a,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const g=this.matrix[r][f].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=g<h?g:h,p=g>p?g:p}})):(u=o,s.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const g=this.matrix[f][r].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=g<h?g:h,p=g>p?g:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Rn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Rn(l.range())},${c(r)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:p!==null?p:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const p=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",p).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const f=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${p})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(f.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=N.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);N.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),N.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),N.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),N.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==$r.OFF&&(t===$r.AUTO&&dp.minCellDividerDimension<=this.xBandwidth&&dp.minCellDividerDimension<=this.yBandwidth||t===$r.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ji(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const d=I(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class LD extends gt{constructor(){super(...arguments),this.type="histogram",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ht.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Gt.VERTICAL?m+=1:m-=1),ie({x0:p,x1:f,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(O.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class kD extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=it.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?yn.weight.unselected:yn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",yn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?yn.opacity.unselected:yn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",yn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,p]=bn(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const g=f.enter().append("line").attr("opacity",0).merge(f).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Gt.HORIZONTAL?g.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):g.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>p(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class DD extends gt{constructor(){super(...arguments),this.type="meter",this.renderType=it.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-Kt.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-Kt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;y(i,"meter","proportional")===null?u=100:u=y(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=je().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),p=y(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?Kt.height.proportional:Kt.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?Kt.height.proportional:Kt.height.default));const f=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",_=>_.x).attr("y",0).attr("height",()=>p||(s?Kt.height.proportional:Kt.height.default)).attr("class",_=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:_[c],originalClassName:g})).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"meter-bar-update",animate:t})).attr("width",_=>_.value>u?d(u):Math.max(_.width,2)).style("fill",_=>n.model.getFillColor(_[c],null,_)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",_=>_.value),f.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const x=r.selectAll("line.peak").data(v==null?[]:[v]);x.enter().append("line").classed("peak",!0).merge(x).attr("y1",0).attr("y2",()=>p||(s?Kt.height.proportional:Kt.height.default)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"peak-line-update",animate:t})).attr("x1",_=>d(_)).attr("x2",_=>d(_)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",_=>_),x.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class RD extends gt{constructor(){super(...arguments),this.type="radar",this.renderType=it.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:s}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=wC(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return at(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:at(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:sr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",sr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:g,xAxisRectHeight:m}=sr;this.uniqueKeys=Array.from(new Set(s.map(S=>S[u]))),this.uniqueGroups=Array.from(new Set(s.map(S=>S[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),x=(Math.min(r,i)-v)/2;if(x<=0)return;const _=Xi().domain(this.fullDataNormalized.map(S=>S[u])).range([0,2*Math.PI].map(S=>S-Math.PI/2)),E=Rn(this.fullDataNormalized.map(S=>S[d])),b=je().domain([E>=0?0:E,tr(this.fullDataNormalized.map(S=>S[d]))]).range([g,x]).nice(f),T=b.ticks(f),M=(S,w,L)=>this.model.getFillColor(S,w,L),D=ik().angle(S=>_(S[u])+Math.PI/2).radius(S=>b(S[d])).curve(mf),A=this.uniqueKeys.map(S=>{const w=this.getLabelDimensions(S).width,L=A2(_(S),x);return w+L}),R={x:tr(A)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",ht.GROUP).selectAll("path").data(T,S=>S),H=S=>this.uniqueKeys.map(w=>({[u]:w,[d]:S}));$.join(S=>S.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",L=>D(H(L)))),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",L=>D(H(L)))),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_exit",animate:t})).attr("d",L=>D(H(L))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",ht.GROUP).selectAll("line").data(this.uniqueKeys,S=>S).join(S=>S.append("line").attr("opacity",0).attr("class",w=>`x-axis-${Qr(w)}`).attr("stroke-dasharray","0").attr("x1",w=>Ut(_(w),0,R).x).attr("y1",w=>Ut(_(w),0,R).y).attr("x2",w=>Ut(_(w),0,R).x).attr("y2",w=>Ut(_(w),0,R).y).call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",L=>Ut(_(L),b.range()[0],R).x).attr("y1",L=>Ut(_(L),b.range()[0],R).y).attr("x2",L=>Ut(_(L),b.range()[1],R).x).attr("y2",L=>Ut(_(L),b.range()[1],R).y)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",L=>Ut(_(L),b.range()[0],R).x).attr("y1",L=>Ut(_(L),b.range()[0],R).y).attr("x2",L=>Ut(_(L),b.range()[1],R).x).attr("y2",L=>Ut(_(L),b.range()[1],R).y)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",ht.GROUP).selectAll("text").data(this.uniqueKeys).join(S=>S.append("text").text(w=>w).attr("opacity",0).attr("x",w=>Ut(_(w),b.range()[1]+h,R).x).attr("y",w=>Ut(_(w),b.range()[1]+h,R).y).style("text-anchor",w=>Df(_(w)).textAnchor).style("dominant-baseline",w=>Df(_(w)).dominantBaseline).call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",L=>Ut(_(L),b.range()[1]+h,R).x).attr("y",L=>Ut(_(L),b.range()[1]+h,R).y).end().finally(()=>{const L=y(o,"radar","alignment"),k=this.getAlignmentXOffset(L,n,this.getParent());n.attr("x",k)})),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",ht.GROUP).selectAll("path").data(this.groupedDataNormalized,S=>S.name).join(S=>S.append("path").attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:w.name,originalClassName:"blob"})).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",w=>w.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",w=>M(w.name,null,w.data)).style("fill-opacity",sr.opacity.selected).style("stroke",w=>M(w.name,null,w.data)).call(w=>{const L=w.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_enter",animate:t}));t&&L.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),L.attr("opacity",1).attr("d",k=>D(k.data))}),S=>(S.attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:w.name,originalClassName:"blob"})).style("fill",w=>M(w.name,null,w.data)).style("stroke",w=>M(w.name,null,w.data)),S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",L=>D(L.data))),S),S=>S.call(w=>{const L=w.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_exit",animate:t}));t&&L.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),L.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",ht.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(S=>y(S,d)!==null)).join(S=>S.append("circle").attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",w=>w[c]),S=>S,S=>S.remove()).attr("class",S=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:S[l],originalClassName:Qr(S[u])})).attr("cx",S=>Ut(_(S[u]),b(S[d]),R).x).attr("cy",S=>Ut(_(S[u]),b(S[d]),R).y).attr("r",0).attr("opacity",0).style("fill",S=>M(S[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",ht.GROUP).selectAll("rect").data(this.uniqueKeys).join(S=>S.append("rect"),S=>S,S=>S.remove()).attr("x",R.x).attr("y",R.y-m/2).attr("width",b.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",S=>`rotate(${Rf(_(S))}, ${R.x}, ${R.y})`);const{code:P,number:B}=y(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",ht.GROUP).selectAll("text").data(Ge(T)).join(S=>S.append("text").attr("opacity",0).text(w=>B(w,P)).attr("x",w=>Ut(-Math.PI/2,b(w),R).x+p).attr("y",w=>Ut(-Math.PI/2,b(w),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_update",animate:t})).text(L=>L).attr("opacity",1).attr("x",L=>Ut(-Math.PI/2,b(L),R).x+p).attr("y",L=>Ut(-Math.PI/2,b(L),R).y)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=N.getSVGElementSize(n,{useBBox:!0}),{width:s}=N.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===zt.CENTER?a=Math.floor((s-i.width)/2):t===zt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Qr(i)}`),o=t.parent.selectAll(`.dots circle.${Qr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",sr.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(p=>typeof p[d]=="number").map(p=>({label:p[u],value:p[d],color:t.model.getFillColor(p[u],null,p),class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Qr(i)}`),o=t.parent.selectAll(`.dots circle.${Qr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE)})}}class Xg extends yu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,p=h+u;let f,g;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),g=this.services.cartesianScales.getRangeValue(d[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,v)),g=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(g-f);if(m!==0&&m<2&&(d>0&&a===Gt.VERTICAL||d<0&&a===Gt.HORIZONTAL?g=f-2:g=f+2),!this.isOutsideZoomedDomain(h,p))return ie({x0:h,x1:p,y0:f,y1:g},a)}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ID extends ce{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=N.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-skeleton.DAII"),N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Zg extends gt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",vn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=eu().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",vn.opacity.selected).attr("d",this.areaGenerator)}}class Kg extends yu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,p=h+d,f=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(g-f)>0&&Math.abs(g-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Gt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Gt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:p,y0:f,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=N.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Qg extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=it.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>y(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",ht.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),p=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[p]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[v]:f}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const Ts=6;class ND extends gt{constructor(){super(...arguments),this.type="tree",this.renderType=it.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=N.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+Ts:30-Ts},h=ps({name:o,children:a}),p=10,f=r/6,g=T=>{const M=h.descendants().reverse(),D=h.links();let A=h,R=h;h.eachBefore(k=>{k.x<A.x&&(A=k),k.x>R.x&&(R=k)});const $=R.x-A.x,H=n.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,A.x,r,$].join(" ")),P=b.selectAll("g").data(M,k=>k.id),B=this,S=P.enter().append("g").attr("transform",()=>`translate(${T.y0},${T.x0})`).attr("class",k=>k.depth!==0&&k.children&&k.children.length>0?"clickable":null).on("mouseover",function(k,U){B.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:k,element:I(this),datum:U})}).on("click",function(k,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),B.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:k,element:I(this),datum:U})}).on("mouseout",function(k,U){B.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:k,element:I(this),datum:U})});S.append("circle").attr("r",2.5).attr("class",k=>k._children?"parent":"child").attr("stroke-width",10),S.append("text").attr("dy","0.31em").attr("x",k=>k._children?-6:Ts).attr("text-anchor",k=>k._children?"end":"start").text(k=>k.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(S).transition(H).attr("transform",k=>`translate(${k.y},${k.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${T.y},${T.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const w=E.selectAll("path").data(D,k=>k.target.id),L=w.enter().append("path").attr("d",()=>{const k={x:T.x0,y:T.y0};return _({source:k,target:k})});w.merge(L).transition(H).attr("d",_),w.exit().transition(H).remove().attr("d",()=>{const k={x:T.x,y:T.y};return _({source:k,target:k})}),h.eachBefore(k=>{k.x0=k.x,k.y0=k.y})},m=h.descendants(),v=m[m.length-1].depth,x=y(s,"tree","type")===Cs.DENDROGRAM?tL().size([i,r-u-v*Ts-l]):VL().nodeSize([p,f]).size([i,r-u-v*Ts-l]),_=uk().x(T=>T.y).y(T=>T.x);h.x0=f/2,h.y0=0,h.descendants().forEach((T,M)=>{T.id=M,T._children=T.children}),x(h),n.attr("viewBox",[-d.left,-0,r,p]).style("user-select","none");const E=n.append("g").attr("class","links"),b=n.append("g").attr("class","nodes");g(h)}}var PD="#000000",UD="#ffffff",BD="#fcf4d6",HD="#fddc69",VD="#f1c21b",GD="#d2a106",zD="#b28600",FD="#8e6a00",jD="#684e00",WD="#483700",qD="#302400",YD="#1c1500",XD={10:BD,20:HD,30:VD,40:GD,50:zD,60:FD,70:jD,80:WD,90:qD,100:YD},ZD="#fff2e8",KD="#ffd9be",QD="#ffb784",JD="#ff832b",tR="#eb6200",eR="#ba4e00",nR="#8a3800",rR="#5e2900",iR="#3e1a00",sR="#231000",aR={10:ZD,20:KD,30:QD,40:JD,50:tR,60:eR,70:nR,80:rR,90:iR,100:sR},oR="#fff1f1",lR="#ffd7d9",cR="#ffb3b8",uR="#ff8389",hR="#fa4d56",dR="#da1e28",pR="#a2191f",fR="#750e13",mR="#520408",gR="#2d0709",vR={10:oR,20:lR,30:cR,40:uR,50:hR,60:dR,70:pR,80:fR,90:mR,100:gR},yR="#fff0f7",xR="#ffd6e8",bR="#ffafd2",_R="#ff7eb6",ER="#ee5396",SR="#d02670",TR="#9f1853",OR="#740937",wR="#510224",$R="#2a0a18",MR={10:yR,20:xR,30:bR,40:_R,50:ER,60:SR,70:TR,80:OR,90:wR,100:$R},CR="#f6f2ff",AR="#e8daff",LR="#d4bbff",kR="#be95ff",DR="#a56eff",RR="#8a3ffc",IR="#6929c4",NR="#491d8b",PR="#31135e",UR="#1c0f30",BR={10:CR,20:AR,30:LR,40:kR,50:DR,60:RR,70:IR,80:NR,90:PR,100:UR},HR="#edf5ff",VR="#d0e2ff",GR="#a6c8ff",zR="#78a9ff",FR="#4589ff",jR="#0f62fe",WR="#0043ce",qR="#002d9c",YR="#001d6c",XR="#001141",ZR={10:HR,20:VR,30:GR,40:zR,50:FR,60:jR,70:WR,80:qR,90:YR,100:XR},KR="#e5f6ff",QR="#bae6ff",JR="#82cfff",tI="#33b1ff",eI="#1192e8",nI="#0072c3",rI="#00539a",iI="#003a6d",sI="#012749",aI="#061727",oI={10:KR,20:QR,30:JR,40:tI,50:eI,60:nI,70:rI,80:iI,90:sI,100:aI},lI="#d9fbfb",cI="#9ef0f0",uI="#3ddbd9",hI="#08bdba",dI="#009d9a",pI="#007d79",fI="#005d5d",mI="#004144",gI="#022b30",vI="#081a1c",yI={10:lI,20:cI,30:uI,40:hI,50:dI,60:pI,70:fI,80:mI,90:gI,100:vI},xI="#defbe6",bI="#a7f0ba",_I="#6fdc8c",EI="#42be65",SI="#24a148",TI="#198038",OI="#0e6027",wI="#044317",$I="#022d0d",MI="#071908",CI={10:xI,20:bI,30:_I,40:EI,50:SI,60:TI,70:OI,80:wI,90:$I,100:MI},AI="#f2f4f8",LI="#dde1e6",kI="#c1c7cd",DI="#a2a9b0",RI="#878d96",II="#697077",NI="#4d5358",PI="#343a3f",UI="#21272a",BI="#121619",HI={10:AI,20:LI,30:kI,40:DI,50:RI,60:II,70:NI,80:PI,90:UI,100:BI},VI="#f4f4f4",GI="#e0e0e0",zI="#c6c6c6",FI="#a8a8a8",jI="#8d8d8d",WI="#6f6f6f",qI="#525252",YI="#393939",XI="#262626",ZI="#161616",KI={10:VI,20:GI,30:zI,40:FI,50:jI,60:WI,70:qI,80:YI,90:XI,100:ZI},QI="#f7f3f2",JI="#e5e0df",tN="#cac5c4",eN="#ada8a8",nN="#8f8b8b",rN="#726e6e",iN="#565151",sN="#3c3838",aN="#272525",oN="#171414",lN={10:QI,20:JI,30:tN,40:eN,50:nN,60:rN,70:iN,80:sN,90:aN,100:oN},Jg={black:{100:PD},blue:ZR,coolGray:HI,cyan:oI,gray:KI,green:CI,magenta:MR,orange:aR,purple:BR,red:vR,teal:yI,warmGray:lN,white:{0:UD},yellow:XD};const cN=e=>{if(!e)return null;for(const t of Object.keys(Jg)){const n=Jg[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},tv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=fn(n);let i;if(r&&(i=cN(r?r.hex():null)),i==null){const s=kd(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let uN=0;class hN extends gt{constructor(){super(...arguments),this.type="treemap",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=ps({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=WL().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),p=>p.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>uN++).merge(u);d.attr("data-name","leaf").transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-group-update",animate:t})).attr("transform",p=>`translate(${p.x0},${p.y0})`);const h=d.selectAll("rect.leaf").data(p=>[p]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const p=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${p}`}).attr("class",p=>{for(;p.depth>1;)p=p.parent;return this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:p.data.name,originalClassName:"leaf"})}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-leaf-update-enter",animate:t})).attr("width",p=>p.x1-p.x0).attr("height",p=>p.y1-p.y0).style("fill",p=>{for(;p.depth>1;)p=p.parent;return this.model.getFillColor(p.data.name,null,p.data)}),d.selectAll("clipPath").data(p=>p.data.showLabel!==!0?[]:[1],p=>p).join(p=>p.append("clipPath").attr("id",function(){const f=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=I(this.parentNode.parentNode).attr("data-uid"),g=`${i.style.prefix}-leaf-${f}`;return new URL(`#${g}`,s)+""}),p=>null,p=>p.remove()),d.selectAll("text").data(p=>{if(p.data.showLabel!==!0)return[];let f=p;for(;f.depth>1;)f=f.parent;return[{text:p.data.name,backgroundColor:this.model.getFillColor(f.data.name)}]},p=>p).join(p=>{const f=p.append("text").text(g=>g.text).style("fill",tv).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const g=I(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${g}`;return`url(${new URL(`#${m}`,s)+""})`}),f},p=>p.text(f=>f.text).style("fill",tv),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),fn(s).darker(.7).toString()}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}}function dN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pN(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var fN={value:function(){}};function ev(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ho(n)}function ho(e){this._=e}function mN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ho.prototype=ev.prototype={constructor:ho,on:function(e,t){var n=this._,r=mN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=gN(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=nv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=nv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ho(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function gN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function nv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=fN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const vN=Object.freeze(Object.defineProperty({__proto__:null,dispatch:ev},Symbol.toStringTag,{value:"Module"})),yN=pN(vN);var xu,rv;function xN(){if(rv)return xu;rv=1;const e=yN.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;xu=function(){var E=[256,256],b=s,T=a,M=l,D=o,A=o,R=c,$=u,H=g,P=[],B=1/0,S=e("word","end"),w=null,L=Math.random,k={},U=x;k.canvas=function(j){return arguments.length?(U=_(j),k):U},k.start=function(){var j=K(U()),X=v((E[0]>>5)*E[1]),ct=null,J=P.length,Y=-1,et=[],ut=P.map(function(q,Z){return q.text=b.call(this,q,Z),q.font=T.call(this,q,Z),q.style=D.call(this,q,Z),q.weight=A.call(this,q,Z),q.rotate=R.call(this,q,Z),q.size=~~M.call(this,q,Z),q.padding=$.call(this,q,Z),q}).sort(function(q,Z){return Z.size-q.size});return w&&clearInterval(w),w=setInterval(F,0),F(),k;function F(){for(var q=Date.now();Date.now()-q<B&&++Y<J&&w;){var Z=ut[Y];Z.x=E[0]*(L()+.5)>>1,Z.y=E[1]*(L()+.5)>>1,d(j,Z,ut,Y),Z.hasText&&W(X,Z,ct)&&(et.push(Z),S.call("word",k,Z),ct?p(ct,Z):ct=[{x:Z.x+Z.x0,y:Z.y+Z.y0},{x:Z.x+Z.x1,y:Z.y+Z.y1}],Z.x-=E[0]>>1,Z.y-=E[1]>>1)}Y>=J&&(k.stop(),S.call("end",k,et,ct))}},k.stop=function(){w&&(clearInterval(w),w=null);for(const j of P)delete j.sprite;return k};function K(j){const X=j.getContext("2d",{willReadFrequently:!0});j.width=j.height=1;const ct=Math.sqrt(X.getImageData(0,0,1,1).data.length>>2);return j.width=(r<<5)/ct,j.height=i/ct,X.fillStyle=X.strokeStyle="red",{context:X,ratio:ct}}function W(j,X,ct){E[0],E[1];for(var J=X.x,Y=X.y,et=Math.sqrt(E[0]*E[0]+E[1]*E[1]),ut=H(E),F=L()<.5?1:-1,q=-F,Z,G,dt;(Z=ut(q+=F))&&(G=~~Z[0],dt=~~Z[1],!(Math.min(Math.abs(G),Math.abs(dt))>=et));)if(X.x=J+G,X.y=Y+dt,!(X.x+X.x0<0||X.y+X.y0<0||X.x+X.x1>E[0]||X.y+X.y1>E[1])&&(!ct||f(X,ct))&&!h(X,j,E[0])){for(var ot=X.sprite,It=X.width>>5,Ht=E[0]>>5,rt=X.x-(It<<4),Et=rt&127,Ne=32-Et,Oe=X.y1-X.y0,ws=(X.y+X.y0)*Ht+(rt>>5),$s,_r=0;_r<Oe;_r++){$s=0;for(var Ze=0;Ze<=It;Ze++)j[ws+Ze]|=$s<<Ne|(Ze<It?($s=ot[_r*It+Ze])>>>Et:0);ws+=Ht}return!0}return!1}return k.timeInterval=function(j){return arguments.length?(B=j??1/0,k):B},k.words=function(j){return arguments.length?(P=j,k):P},k.size=function(j){return arguments.length?(E=[+j[0],+j[1]],k):E},k.font=function(j){return arguments.length?(T=_(j),k):T},k.fontStyle=function(j){return arguments.length?(D=_(j),k):D},k.fontWeight=function(j){return arguments.length?(A=_(j),k):A},k.rotate=function(j){return arguments.length?(R=_(j),k):R},k.text=function(j){return arguments.length?(b=_(j),k):b},k.spiral=function(j){return arguments.length?(H=n[j]||j,k):H},k.fontSize=function(j){return arguments.length?(M=_(j),k):M},k.padding=function(j){return arguments.length?($=_(j),k):$},k.random=function(j){return arguments.length?(L=j,k):L},k.on=function(){var j=S.on.apply(S,arguments);return j===S?k:j},k};function s(E){return E.text}function a(){return"serif"}function o(){return"normal"}function l(E){return Math.sqrt(E.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(E,b,T,M){if(!b.sprite){var D=E.context,A=E.ratio;D.clearRect(0,0,(r<<5)/A,i/A);var R=0,$=0,H=0,P=T.length;for(--M;++M<P;){b=T[M],D.save(),D.font=b.style+" "+b.weight+" "+~~((b.size+1)/A)+"px "+b.font;const Z=D.measureText(b.text),G=-Math.floor(Z.width/2);let dt=(Z.width+1)*A,ot=b.size<<1;if(b.rotate){var B=Math.sin(b.rotate*t),S=Math.cos(b.rotate*t),w=dt*S,L=dt*B,k=ot*S,U=ot*B;dt=Math.max(Math.abs(w+U),Math.abs(w-U))+31>>5<<5,ot=~~Math.max(Math.abs(L+k),Math.abs(L-k))}else dt=dt+31>>5<<5;if(ot>H&&(H=ot),R+dt>=r<<5&&(R=0,$+=H,H=0),$+ot>=i)break;D.translate((R+(dt>>1))/A,($+(ot>>1))/A),b.rotate&&D.rotate(b.rotate*t),D.fillText(b.text,G,0),b.padding&&(D.lineWidth=2*b.padding,D.strokeText(b.text,G,0)),D.restore(),b.width=dt,b.height=ot,b.xoff=R,b.yoff=$,b.x1=dt>>1,b.y1=ot>>1,b.x0=-b.x1,b.y0=-b.y1,b.hasText=!0,R+=dt}for(var K=D.getImageData(0,0,(r<<5)/A,i/A).data,W=[];--M>=0;)if(b=T[M],!!b.hasText){for(var j=b.width,X=j>>5,ct=b.y1-b.y0,J=0;J<ct*X;J++)W[J]=0;if(R=b.xoff,R==null)return;$=b.yoff;for(var Y=0,et=-1,ut=0;ut<ct;ut++){for(var J=0;J<j;J++){var F=X*ut+(J>>5),q=K[($+ut)*(r<<5)+(R+J)<<2]?1<<31-J%32:0;W[F]|=q,Y|=q}Y?et=ut:(b.y0++,ct--,ut--,$++)}b.y1=b.y0+et,b.sprite=W.slice(0,(b.y1-b.y0)*X)}}}function h(E,b,T){T>>=5;for(var M=E.sprite,D=E.width>>5,A=E.x-(D<<4),R=A&127,$=32-R,H=E.y1-E.y0,P=(E.y+E.y0)*T+(A>>5),B,S=0;S<H;S++){B=0;for(var w=0;w<=D;w++)if((B<<$|(w<D?(B=M[S*D+w])>>>R:0))&b[P+w])return!0;P+=T}return!1}function p(E,b){var T=E[0],M=E[1];b.x+b.x0<T.x&&(T.x=b.x+b.x0),b.y+b.y0<T.y&&(T.y=b.y+b.y0),b.x+b.x1>M.x&&(M.x=b.x+b.x1),b.y+b.y1>M.y&&(M.y=b.y+b.y1)}function f(E,b){return E.x+E.x1>b[0].x&&E.x+E.x0<b[1].x&&E.y+E.y1>b[0].y&&E.y+E.y0<b[1].y}function g(E){var b=E[0]/E[1];return function(T){return[b*(T*=.1)*Math.cos(T),T*Math.sin(T)]}}function m(E){var b=4,T=b*E[0]/E[1],M=0,D=0;return function(A){var R=A<0?-1:1;switch(Math.sqrt(1+4*R*A)-R&3){case 0:M+=T;break;case 1:D+=b;break;case 2:M-=T;break;default:D-=b;break}return[M,D]}}function v(E){for(var b=[],T=-1;++T<E;)b[T]=0;return b}function x(){return document.createElement("canvas")}function _(E){return typeof E=="function"?E:function(){return E}}return xu}var bN=xN();const _N=dN(bN);class EN extends gt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=_N().size([u,d]).words(i.map(function(f){const g=f[o];if(typeof f[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:f[c],text:f[l],size:g,value:g}})).padding(5).rotate(0).fontSize(f=>s(f.size)).on("end",p);h.start();function p(f){const g=N.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(f,v=>`${v[c]}-${v.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Ge(i):[1,1];return je().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=ya(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class SN extends gt{constructor(){super(...arguments),this.type="geo",this.renderType=it.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=N.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=mD(s,Object.values(l)),u=dD(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=wA().projection(d);N.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=N.appendOrSelect(t,"defs");N.appendOrSelect(f,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",vs()([[0,0],[0,10]]));const g=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(g,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case Je.geoEqualEarth:t=jA();break;case Je.geoAlbers:t=UA();break;case Je.geoConicEqualArea:t=Km();break;case Je.geoConicEquidistant:t=zA();break;case Je.geoEquirectangular:t=VA();break;case Je.geoMercator:t=BA();break;case Je.geoNaturalEarth1:t=WA();break;default:throw new Error("Projection is not supported.")}return t}}class TN extends SN{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(Tr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Tr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Tr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Tr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.HIDE,{event:r,hoveredElement:s})})}}function bu(e){var t=e==null?0:e.length;return t?Vs(e,1):[]}function ON(e){return oh(uh(e,void 0,bu),e+"")}function iv(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function wN(e,t){return t.length<2?e:nl(e,iv(t,0,-1))}function $N(e,t){return t=Hs(t,e),e=wN(e,t),e==null||delete e[Ci(sd(t))]}function MN(e){return Sh(e)?void 0:e}var CN=1,AN=2,LN=4,kN=ON(function(e,t){var n={};if(e==null)return n;var r=!1;t=Fo(t,function(s){return s=Hs(s,e),r||(r=s.length>1),s}),Mr(e,Dh(e),n),r&&(n=Ai(n,CN|AN|LN,MN));for(var i=t.length;i--;)$N(n,t[i]);return n});function sv(e){return Math.log(e)}function av(e){return Math.exp(e)}function DN(e){return-Math.log(-e)}function RN(e){return-Math.exp(-e)}function IN(e){return isFinite(e)?+("1e"+e):e<0?0:e}function NN(e){return e===10?IN:e===Math.E?Math.exp:t=>Math.pow(e,t)}function PN(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function ov(e){return(t,n)=>-e(-t,n)}function UN(e){const t=e(sv,av),n=t.domain;let r=10,i,s;function a(){return i=PN(r),s=NN(r),n()[0]<0?(i=ov(i),s=ov(s),e(DN,RN)):e(sv,av),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),p=i(u),f,g;const m=o==null?10:+o;let v=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(f=1;f<r;++f)if(g=h<0?f/s(-h):f*s(h),!(g<c)){if(g>u)break;v.push(g)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(g=h>0?f/s(-h):f*s(h),!(g<c)){if(g>u)break;v.push(g)}v.length*2<m&&(v=qs(c,u,m))}else v=qs(h,p,Math.min(p-h,m)).map(s);return d?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Gi(l)).precision==null&&(l.trim=!0),l=Nl(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(Fp(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function lv(){const e=UN(lp()).domain([1,10]);return e.copy=()=>Ul(e,lv()).base(e.base()),Ur.apply(e,arguments),e}function po(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fo(e){this._context=e}fo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:po(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BN(e){return new fo(e)}function cv(e){this._context=e}cv.prototype={areaStart:Un,areaEnd:Un,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function HN(e){return new cv(e)}function uv(e){this._context=e}uv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function VN(e){return new uv(e)}function hv(e,t){this._basis=new fo(e),this._beta=t}hv.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const GN=function e(t){function n(r){return t===1?new fo(r):new hv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function mo(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function _u(e,t){this._context=e,this._k=(1-t)/6}_u.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:mo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:mo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const zN=function e(t){function n(r){return new _u(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Eu(e,t){this._context=e,this._k=(1-t)/6}Eu.prototype={areaStart:Un,areaEnd:Un,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:mo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const FN=function e(t){function n(r){return new Eu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Su(e,t){this._context=e,this._k=(1-t)/6}Su.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jN=function e(t){function n(r){return new Su(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Tu(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ee){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ee){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function dv(e,t){this._context=e,this._alpha=t}dv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Tu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const WN=function e(t){function n(r){return t?new dv(r,t):new _u(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function pv(e,t){this._context=e,this._alpha=t}pv.prototype={areaStart:Un,areaEnd:Un,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Tu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const qN=function e(t){function n(r){return t?new pv(r,t):new Eu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function fv(e,t){this._context=e,this._alpha=t}fv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const YN=function e(t){function n(r){return t?new fv(r,t):new Su(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function mv(e){return e<0?-1:1}function gv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(mv(s)+mv(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function vv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ou(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function go(e){this._context=e}go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ou(this,this._t0,vv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ou(this,vv(this,n=gv(this,e,t)),n);break;default:Ou(this,this._t0,n=gv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function yv(e){this._context=new xv(e)}(yv.prototype=Object.create(go.prototype)).point=function(e,t){go.prototype.point.call(this,t,e)};function xv(e){this._context=e}xv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function XN(e){return new go(e)}function ZN(e){return new yv(e)}function bv(e){this._context=e}bv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=_v(e),i=_v(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function _v(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function KN(e){return new bv(e)}function vo(e,t){this._context=e,this._t=t}vo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function QN(e){return new vo(e,.5)}function JN(e){return new vo(e,0)}function tP(e){return new vo(e,1)}class eP extends On{zoomIn(t,n,r){let i,s,a;const o=r||Hr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=N.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_IN,{element:I(t)})}zoomOut(t,n){const r=n||Hr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class nP extends On{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class rP extends On{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class iP extends On{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(y(mp,n,"duration")||mp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Os(e,t){const n=+Pt(e)-+Pt(t);return n<0?-1:n>0?1:n}function sP(e,t,n){const[r,i]=qn(void 0,e,t);return r.getFullYear()-i.getFullYear()}function aP(e,t,n){const[r,i]=qn(void 0,e,t),s=Os(r,i),a=Math.abs(sP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Os(r,i)===-s,l=s*(a-+o);return l===0?0:l}function wu(e,t,n){const r=Pt(e,void 0);if(isNaN(t))return $e(e,NaN);if(!t)return r;const i=r.getDate(),s=$e(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Ev(e,t,n){return wu(e,t*12)}function oP(e,t,n){return Ev(e,-t)}function lP(e,t,n){const[r,i]=qn(void 0,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function cP(e,t){const n=Pt(e,void 0);return n.setHours(23,59,59,999),n}function uP(e,t){const n=Pt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function hP(e,t){const n=Pt(e,void 0);return+cP(n)==+uP(n)}function dP(e,t,n){const[r,i,s]=qn(void 0,e,e,t),a=Os(i,s),o=Math.abs(lP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Os(i,s)===-a;hP(r)&&o===1&&Os(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function pP(e,t,n){return wu(e,-t)}function fP(e,t,n){const[r,i]=qn(void 0,e,t),s=Sv(r,i),a=Math.abs($p(r,i));r.setDate(r.getDate()-s*a);const o=+(Sv(r,i)===-s),l=s*(a-o);return l===0?0:l}function Sv(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Tv(e,t,n){const r=Pt(e,void 0);return isNaN(t)?$e(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function mP(e,t,n){return Tv(e,-t)}function $u(e){return t=>{const n=(0,Math.trunc)(t);return n===0?0:n}}function gP(e,t,n){const[r,i]=qn(void 0,e,t),s=(+r-+i)/Xu;return $u()(s)}function Ov(e,t,n){return $e(e,+Pt(e)+t)}function wv(e,t,n){return Ov(e,t*Xu)}function vP(e,t,n){return wv(e,-t)}function $v(e,t){return+Pt(e)-+Pt(t)}function Mv(e,t,n){const r=$v(e,t)/Yu;return $u()(r)}function Mu(e,t,n){const r=Pt(e,void 0);return r.setTime(r.getTime()+t*Yu),r}function Cv(e,t,n){return Mu(e,-t)}function Av(e,t,n){const r=$v(e,t)/1e3;return $u()(r)}function Cu(e,t,n){return Ov(e,t*1e3)}function Lv(e,t,n){return Cu(e,-t)}class yP extends On{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(t=>z[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Gt.VERTICAL:this.orientation=Gt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=y(s,"axes");((t=a[z.LEFT])!=null&&t.correspondingDatasets&&a[z.RIGHT]||(n=a[z.RIGHT])!=null&&n.correspondingDatasets&&a[z.LEFT]||(r=a[z.TOP])!=null&&r.correspondingDatasets&&a[z.BOTTOM]||(i=a[z.BOTTOM])!=null&&i.correspondingDatasets&&a[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===nt.LINEAR||this.scaleTypes[t]===nt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=y(i,o)!==null?i[o]:i;let c;switch(n){case nt.LABELS:c=t(l)+t.step()/2;break;case nt.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===nt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return xP(n,s)}else return bP(n,In.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||nt.LINEAR,o=s.scaleType||nt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===nt.LABELS||o===nt.TIME)&&a===nt.LABELS||a===nt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||nt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,tr(v,x=>x.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),x=this.model.getStackKeys({bins:v});return[x[0].split(":")[0],x[x.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=In.ratio;if(r.domain)return a===nt.LABELS?r.domain:(a===nt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===nt.LABELS)return ki(o.map(v=>v[c]));let f,g;const m=this.model.getDataGroupNames();if(a===nt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[p]}`);if(a===nt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,x=this.model.getDataValuesGroupedByKeys({groups:m}),_=o.filter(b=>!m.includes(b[v])),E=[];x.forEach(b=>{const{...T}=b;let M=0,D=0;Object.values(kN(T,"sharedStackKey")).forEach(A=>{isNaN(A)||(A<0?D+=A:M+=A)}),E.push([D,M])}),g=[...bu(E),..._.map(b=>b[c])]}else g=[],o.forEach(v=>{const x=v[c];Array.isArray(x)&&x.length===2?(g.push(x[0]),g.push(x[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(x))});return a!==nt.TIME&&a!==nt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const x=y(v,"value");x!==null&&g.push(x)}),f=Ge(g),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||nt.LINEAR;this.scaleTypes[t]=i;let s;return i===nt.TIME?s=uf():i===nt.LOG?s=lv().base(r.base||10):i===nt.LABELS||i===nt.LABELS_RATIO?s=Xi():s=je(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Gt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===nt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function xP(e,t){const n=new Date(e[0]),r=new Date(e[1]);return aP(r,n)>1?[oP(n,t),Ev(r,t)]:dP(r,n)>1?[pP(n,t),wu(r,t)]:fP(r,n)>1?[mP(n,t),Tv(r,t)]:gP(r,n)>1?[vP(n,t),wv(r,t)]:Mv(r,n)>30?[Cv(n,t*30),Mu(r,t*30)]:Mv(r,n)>1?[Cv(n,t),Mu(r,t)]:Av(r,n)>15?[Lv(n,t*15),Cu(r,t*15)]:Av(r,n)>1?[Lv(n,t),Cu(r,t)]:[n,r]}function bP([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===nt.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}class _P extends On{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:mf,curveBasis:BN,curveBasisClosed:HN,curveBasisOpen:VN,curveBundle:GN,curveCardinal:zN,curveCardinalClosed:FN,curveCardinalOpen:jN,curveCatmullRom:WN,curveCatmullRomClosed:qN,curveCatmullRomOpen:YN,curveMonotoneX:XN,curveMonotoneY:ZN,curveNatural:KN,curveStep:QN,curveStepAfter:tP,curveStepBefore:JN}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class EP extends On{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===nt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Ge(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=be.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=a+u,h=o-u;d>=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const p=[s.invert(d),s.invert(h)];(r[0].valueOf()!==p[0].valueOf()||r[1].valueOf()!==p[1].valueOf())&&this.handleDomainChange(p)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}function SP(e,t,n){var r=e.length;return n=n===void 0?r:n,iv(e,t,n)}var TP="\\ud800-\\udfff",OP="\\u0300-\\u036f",wP="\\ufe20-\\ufe2f",$P="\\u20d0-\\u20ff",MP=OP+wP+$P,CP="\\ufe0e\\ufe0f",AP="\\u200d",LP=RegExp("["+AP+TP+MP+CP+"]");function kv(e){return LP.test(e)}function kP(e){return e.split("")}var Dv="\\ud800-\\udfff",DP="\\u0300-\\u036f",RP="\\ufe20-\\ufe2f",IP="\\u20d0-\\u20ff",NP=DP+RP+IP,PP="\\ufe0e\\ufe0f",UP="["+Dv+"]",Au="["+NP+"]",Lu="\\ud83c[\\udffb-\\udfff]",BP="(?:"+Au+"|"+Lu+")",Rv="[^"+Dv+"]",Iv="(?:\\ud83c[\\udde6-\\uddff]){2}",Nv="[\\ud800-\\udbff][\\udc00-\\udfff]",HP="\\u200d",Pv=BP+"?",Uv="["+PP+"]?",VP="(?:"+HP+"(?:"+[Rv,Iv,Nv].join("|")+")"+Uv+Pv+")*",GP=Uv+Pv+VP,zP="(?:"+[Rv+Au+"?",Au,Iv,Nv,UP].join("|")+")",FP=RegExp(Lu+"(?="+Lu+")|"+zP+GP,"g");function jP(e){return e.match(FP)||[]}function WP(e){return kv(e)?jP(e):kP(e)}function qP(e){return function(t){t=Mi(t);var n=kv(t)?WP(t):void 0,r=n?n[0]:t.charAt(0),i=n?SP(n,1).join(""):t.slice(1);return r[e]()+i}}var YP=qP("toUpperCase");function XP(e){return YP(Mi(e).toLowerCase())}var ZP=Qf(function(e,t,n){return t=t.toLowerCase(),e+(n?XP(t):t)});class Xe{constructor(t,n){this.components=[],this.services={canvasZoom:eP,domUtils:N,events:nP,files:rP,gradientUtils:pc,transitions:iP},this.model=new rn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(O.Model.UPDATE,r=>{const i=!!y(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(O.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s={id:"legend",components:[new uu(this.model,this.services)],growth:lt.PREFERRED},a=y(r,"canvasZoom","enabled");a&&a===!0&&t.push(new Dk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Ss(this.model,this.services)],growth:lt.STRETCH},c={id:"toolbar",components:[new so(this.model,this.services)],growth:lt.PREFERRED},u={id:"header",components:[new Se(this.model,this.services,[l,...i?[c]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},d={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:y(n,"graphFrameRenderType")||it.SVG},h=y(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Mt.COLUMN;if(h){const v=y(r,"legend","position");v==="left"?(p=Mt.ROW,r.legend.orientation||(r.legend.orientation=wr.VERTICAL)):v==="right"?(p=Mt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=wr.VERTICAL)):v==="bottom"&&(p=Mt.COLUMN_REVERSE)}const f={id:"spacer",components:[new Cn(this.model,this.services)],growth:lt.PREFERRED},g={id:"full-frame",components:[new Se(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:lt.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new Cn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};m.push(v)}return m.push(g),[new hu(this.model,this.services),new ao(this.model,this.services),new Se(this.model,this.services,m,{direction:Mt.COLUMN})]}}class ge extends Xe{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:yP,curves:_P,zoom:EP}),this.model=new lr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===nt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Ss(this.model,this.services)],growth:lt.STRETCH},h={id:"toolbar",components:[new so(this.model,this.services)],growth:lt.PREFERRED},p={id:"header",components:[new Se(this.model,this.services,[d,...s?[h]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},f={id:"legend",components:[new uu(this.model,this.services)],growth:lt.PREFERRED};l&&!c&&t.push(new $g(this.model,this.services),new Rk(this.model,this.services)),t.push(new Nk(this.model,this.services)),t.push(new Pk(this.model,this.services));const g={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Mt.COLUMN;if(m){const T=y(this.model.getOptions(),"legend","position");T===Or.LEFT?(v=Mt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=wr.VERTICAL)):T===Or.RIGHT?(v=Mt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=wr.VERTICAL)):T===Or.BOTTOM&&(v=Mt.COLUMN_REVERSE)}const x={id:"spacer",components:[new Cn(this.model,this.services)],growth:lt.PREFERRED},_={id:"full-frame",components:[new Se(this.model,this.services,[...m?[f]:[],...m?[x]:[],g],{direction:v})],growth:lt.STRETCH},E={id:"zoom-bar",components:[new Ik(this.model,this.services)],growth:lt.PREFERRED,renderType:it.SVG},b=[];if(u||s){b.push(p);const T={id:"spacer",components:[new Cn(this.model,this.services,s?{size:15}:void 0)],growth:lt.PREFERRED};b.push(T)}return l&&b.push(E),b.push(_),[new Lg(this.model,this.services),new ao(this.model,this.services),new Se(this.model,this.services,b,{direction:Mt.COLUMN})]}}class KP extends Xe{constructor(t,n){super(t,n),this.model=new qw(this.services),this.model.setOptions(Rt(Ct.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new rD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class QP extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(pn(Ct.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new oi(this.model,this.services),new Hg(this.model,this.services),new cn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class JP extends ge{constructor(t,n){super(t,n),this.model=new Yw(this.services),this.model.setOptions(Rt(Ct.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new aD(this.model,this.services),new li(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class t3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new oD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class e3 extends ge{constructor(t,n){super(t,n),this.model=new Xw(this.services),this.model.setOptions(Rt(Ct.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new lD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class n3 extends Xe{constructor(t,n){super(t,n),this.model=new Zw(this.services),this.model.setOptions(Rt(Ct.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Ss(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new so(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new Se(this.model,this.services,[a,...i?[o]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Fg(this.model,this.services,{chartType:"choropleth"})],growth:lt.PREFERRED,renderType:it.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Mt.COLUMN_REVERSE,p={id:"spacer",components:[new Cn(this.model,this.services,{size:15})],growth:lt.PREFERRED},f={id:"full-frame",components:[new Se(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Cn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(m)}return g.push(f),[new hu(this.model,this.services),new ao(this.model,this.services),new Se(this.model,this.services,g,{direction:Mt.COLUMN})]}getComponents(){const t=[new TN(this.model,this.services)];return this.getChartComponents(t)}}class r3 extends Xe{constructor(t,n){super(t,n),this.model=new Kw(this.services),this.model.setOptions(Rt(Ct.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new wD(this.model,this.services)];return this.getChartComponents(t)}}const Bv={[ve.LINE]:[oi,cn],[ve.SCATTER]:[cn],[ve.AREA]:[Hg,oi,cn],[ve.STACKED_AREA]:[Zg,oi,Qg,uo],[ve.SIMPLE_BAR]:[Xg],[ve.GROUPED_BAR]:[Yg,li],[ve.STACKED_BAR]:[Kg,uo]};class i3 extends ge{constructor(t,n){super(t,n);const r=Rt(Ct.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ve.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Bv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${ZP(i.type)}Chart`;return a=at({},Ct[l],this.model.getOptions(),i.options),i.type===ve.STACKED_AREA&&(o=!0),Bv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=at({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return bu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===ve.STACKED_BAR||i.type===ve.STACKED_AREA),r=[new me(this.model,this.services),new Te(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID}),...n?[]:[new Gn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Hv extends Xe{constructor(t,n,r=!1){super(t,n),this.model=new Qw(this.services),!r&&(this.model.setOptions(Rt(Ct.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new jg(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.PIE})];return this.getChartComponents(t)}}class s3 extends Hv{constructor(t,n){super(t,n,!0),this.model.setOptions(Rt(Ct.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new MD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.DONUT})];return this.getChartComponents(t)}}class a3 extends Xe{constructor(t,n){super(t,n),this.model=new Jw(this.services),this.model.setOptions(Rt(Ct.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new CD(this.model,this.services)];return this.getChartComponents(t)}}class o3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Yg(this.model,this.services),new li(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class l3 extends ge{constructor(t,n){super(t,n),this.model=new t$(this.services),this.model.setOptions(Rt(Ct.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Ss(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new so(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new Se(this.model,this.services,[a,...i?[o]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Fg(this.model,this.services,{chartType:"heatmap"})],growth:lt.PREFERRED,renderType:it.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Mt.COLUMN_REVERSE,p={id:"spacer",components:[new Cn(this.model,this.services,{size:15})],growth:lt.PREFERRED},f={id:"full-frame",components:[new Se(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Cn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(m)}return g.push(f),[new Lg(this.model,this.services),new ao(this.model,this.services),new Se(this.model,this.services,g,{direction:Mt.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new AD(this.model,this.services)];return this.getAxisChartComponents(t)}}class c3 extends ge{constructor(t,n){super(t,n),this.model=new e$(this.services),this.model.setOptions(Rt(Ct.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new vD(this.model,this.services),new LD(this.model,this.services)];return this.getAxisChartComponents(t)}}class u3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new oi(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new ID(this.model,this.services),new li(this.model,this.services)];return this.getAxisChartComponents(t)}}class h3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new kD(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class d3 extends Xe{constructor(t,n){var r;super(t,n),this.model=new n$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?at(pn(Ct.proportionalMeterChart),n.options):at(pn(Ct.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new OD(this.model,this.services)],growth:lt.STRETCH,renderType:it.SVG},{id:"spacer",components:[new Cn(this.model,this.services,{size:8})],growth:lt.STRETCH}]:[],{id:"meter-graph",components:[new DD(this.model,this.services)],growth:lt.STRETCH,renderType:it.SVG}],n=[new Se(this.model,this.services,t,{direction:Mt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:it.HTML})}}class p3 extends Xe{constructor(t,n){super(t,n),this.model=new r$(this.services),this.model.setOptions(Rt(Ct.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new RD(this.model,this.services)];return this.getChartComponents(t)}}class f3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class m3 extends Xe{constructor(t,n){super(t,n),this.model=new i$(this.services),this.model.setOptions(Rt(Ct.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new ND(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class g3 extends Xe{constructor(t,n){super(t,n),this.model=new s$(this.services),this.model.setOptions(Rt(Ct.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new hN(this.model,this.services)];return this.getChartComponents(t)}}class v3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Xg(this.model,this.services),new li(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class y3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new uo(this.model,this.services),new Zg(this.model,this.services),new oi(this.model,this.services,{stacked:!0}),new Qg(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class x3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new uo(this.model,this.services),new Kg(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ}),new li(this.model,this.services)];return this.getAxisChartComponents(t)}}class b3 extends Xe{constructor(t,n){super(t,n),this.model=new a$(this.services),this.model.setOptions(Rt(Ct.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new EN(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.PIE})];return this.getChartComponents(t)}}class Dt extends ft.PureComponent{constructor(){super(...arguments);Uu(this,"chart");Uu(this,"chartRef",ft.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}render(){return ft.createElement("div",{ref:this.chartRef,className:"chart-holder"})}}class _3 extends Dt{createChart(t,n,r){return new KP(t,{data:n,options:r})}}class E3 extends Dt{createChart(t,n,r){return new QP(t,{data:n,options:r})}}class S3 extends Dt{createChart(t,n,r){return new JP(t,{data:n,options:r})}}class T3 extends Dt{createChart(t,n,r){return new t3(t,{data:n,options:r})}}class O3 extends Dt{createChart(t,n,r){return new e3(t,{data:n,options:r})}}class Vv extends Dt{createChart(t,n,r){return new n3(t,{data:n,options:r})}}class w3 extends Dt{createChart(t,n,r){return new r3(t,{data:n,options:r})}}class $3 extends Dt{createChart(t,n,r){return new i3(t,{data:n,options:r})}}class M3 extends Dt{createChart(t,n,r){return new s3(t,{data:n,options:r})}}class C3 extends Dt{createChart(t,n,r){return new a3(t,{data:n,options:r})}}class A3 extends Dt{createChart(t,n,r){return new o3(t,{data:n,options:r})}}class L3 extends Dt{createChart(t,n,r){return new l3(t,{data:n,options:r})}}class k3 extends Dt{createChart(t,n,r){return new c3(t,{data:n,options:r})}}class D3 extends Dt{createChart(t,n,r){return new u3(t,{data:n,options:r})}}class R3 extends Dt{createChart(t,n,r){return new h3(t,{data:n,options:r})}}class I3 extends Dt{createChart(t,n,r){return new d3(t,{data:n,options:r})}}class N3 extends Dt{createChart(t,n,r){return new Hv(t,{data:n,options:r})}}class P3 extends Dt{createChart(t,n,r){return new p3(t,{data:n,options:r})}}class U3 extends Dt{createChart(t,n,r){return new f3(t,{data:n,options:r})}}class B3 extends Dt{createChart(t,n,r){return new v3(t,{data:n,options:r})}}class H3 extends Dt{createChart(t,n,r){return new y3(t,{data:n,options:r})}}class V3 extends Dt{createChart(t,n,r){return new x3(t,{data:n,options:r})}}class G3 extends Dt{createChart(t,n,r){return new m3(t,{data:n,options:r})}}class z3 extends Dt{createChart(t,n,r){return new g3(t,{data:n,options:r})}}class F3 extends Dt{createChart(t,n,r){return new b3(t,{data:n,options:r})}}function j3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ku={exports:{}};/*!
104
74
  Copyright (c) 2018 Jed Watson.
105
75
  Licensed under the MIT License (MIT), see
106
76
  http://jedwatson.github.io/classnames
107
- */var Xv;function K3(){return Xv||(Xv=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=i(s,r(o)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)t.call(s,o)&&s[o]&&(a=i(a,o));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(Hu)),Hu.exports}var Q3=K3();const rr=T3(Q3),ir="cds",J3=({tag:e="div",className:t,children:n,color:r,href:i,position:s="static",stacked:a,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${ir}--cc--card-node`,u=rr(c,{[`${c}--stacked`]:a,[`${c}--${l}`]:l,[t]:t});return Vt.jsx(l,{className:u,style:{borderColor:r,position:s},tabIndex:0,...o,children:n})},tU=({children:e,farsideColumn:t=!1,...n})=>{const r=`${ir}--cc--card-node`,i=rr(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return Vt.jsx("div",{className:i,...n,children:e})},eU=({children:e,...t})=>{const n=`${ir}--cc--card-node`,r=rr(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return Vt.jsx("label",{className:r,...t,children:e})},nU=({children:e,...t})=>{const n=`${ir}--cc--card-node`,r=rr(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return Vt.jsx("div",{className:r,...t,children:e})},rU=({children:e,...t})=>{const n=`${ir}--cc--card-node`,r=rr(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return Vt.jsx("div",{className:r,...t,children:e})},iU=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${ir}--cc--edge`,c=rr(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=bD(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return Vt.jsxs("g",{className:c,...o,children:[Vt.jsx("path",{d:u,className:`${l}__container`}),Vt.jsx("path",{d:u,className:`${l}__outer`}),Vt.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},Rr=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const d=`${ir}--cc--marker`,h=rr(d,o),p=a==="end"?(s||0)/2+.5:.5,f=(i||0)/2;return Vt.jsx("marker",{className:h,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||p,refY:c||f,markerUnits:"userSpaceOnUse",...u,children:Vt.jsx("path",{d:t,style:{fill:e}})})},sU=e=>Vt.jsx(Rr,{d:_D.d,...e}),aU=e=>Vt.jsx(Rr,{d:ED.d,...e}),oU=e=>Vt.jsx(Rr,{d:TD.d,...e}),lU=e=>Vt.jsx(Rr,{d:SD.d,...e}),cU=e=>Vt.jsx(Rr,{d:OD.d,...e}),uU=e=>Vt.jsx(Rr,{d:wD.d,...e}),hU=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:s,renderIcon:a,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const p=o?"a":h.onClick?"button":t,f=`${ir}--cc--shape-node`,g=rr(f,{[`${f}--stacked`]:c,[`${f}--${e}`]:e,[`${f}--${p}`]:p,[r]:r}),m=n?Vt.jsx("div",{className:`${f}__title`,children:n}):null,v=i?Vt.jsx("div",{className:`${f}__subtitle`,children:i}):null,x=s?Vt.jsx("div",{className:`${f}__description`,children:s}):null;return Vt.jsxs(p,{className:g,style:{height:l,width:l,position:u},tabIndex:0,...h,children:[Vt.jsx("div",{className:`${f}__icon`,children:a}),Vt.jsxs("div",{className:`${f}__body`,style:{position:d},children:[m,v,x]})]})};G.Alignments=Zt,G.AlluvialChart=$3,G.AreaChart=M3,G.AreaEvent=Uo,G.ArrowDirections=Us,G.ArrowLeftMarker=sU,G.ArrowRightMarker=aU,G.AxisEvent=Po,G.AxisFlavor=wi,G.AxisPositions=F,G.AxisTitleOrientations=Bs,G.BarEvent=Go,G.BoxplotChart=C3,G.BoxplotEvent=zo,G.BubbleChart=A3,G.BulletChart=L3,G.CalloutDirections=Ei,G.CanvasZoomEvent=No,G.CardNode=J3,G.CardNodeColumn=tU,G.CardNodeLabel=eU,G.CardNodeSubtitle=nU,G.CardNodeTitle=rU,G.CartesianOrientations=Xt,G.ChartEvent=Yn,G.ChartTheme=Zo,G.ChartTypes=Ae,G.ChoroplethChart=Yv,G.CircleMarker=oU,G.CirclePackChart=k3,G.ColorClassNameTypes=lt,G.ColorLegendType=Oi,G.ComboChart=D3,G.DiamondMarker=lU,G.DividerStatus=Hr,G.DominantBaseline=hn,G.DonutChart=R3,G.Edge=iU,G.ExperimentalChoroplethChart=Yv,G.GaugeChart=I3,G.GaugeEvent=Vo,G.GaugeTypes=ar,G.GroupedBarChart=N3,G.HeatmapChart=P3,G.HistogramChart=U3,G.LayoutAlignItems=sr,G.LayoutDirection=Rt,G.LayoutGrowth=pt,G.LegendItemType=Qt,G.LegendOrientations=Br,G.LegendPositions=Ur,G.LineChart=B3,G.LineEvent=jo,G.LollipopChart=H3,G.Marker=Rr,G.MeterChart=V3,G.ModalEvent=ko,G.ModelEvent=Do,G.PieChart=G3,G.PieEvent=Ho,G.Projection=dn,G.RadarChart=z3,G.RadarEvent=Wo,G.RenderTypes=ot,G.ScaleTypes=at,G.ScatterChart=F3,G.ScatterEvent=Fo,G.ShapeNode=hU,G.SimpleBarChart=j3,G.Skeletons=Kt,G.SquareMarker=cU,G.StackedAreaChart=W3,G.StackedBarChart=q3,G.Statuses=Ti,G.TeeMarker=uU,G.TextAnchor=un,G.ThresholdEvent=Xo,G.TickRotations=Si,G.ToolbarControlTypes=Ot,G.TooltipEvent=Nr,G.TreeChart=Y3,G.TreeEvent=qo,G.TreeTypes=Ps,G.TreemapChart=X3,G.TreemapEvent=Yo,G.TruncationTypes=Be,G.WordCloudChart=Z3,G.WordCloudEvent=Bo,G.ZoomBarTypes=Ke,G.ZoomDomainEvent=Io,G.ZoombarEvent=Ro,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
77
+ */var Gv;function W3(){return Gv||(Gv=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=i(s,r(o)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)t.call(s,o)&&s[o]&&(a=i(a,o));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(ku)),ku.exports}var q3=W3();const zn=j3(q3),Fn="cds",Y3=({tag:e="div",className:t,children:n,color:r,href:i,position:s="static",stacked:a,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${Fn}--cc--card-node`,u=zn(c,{[`${c}--stacked`]:a,[`${c}--${l}`]:l,[t]:t});return ft.createElement(l,{className:u,style:{borderColor:r,position:s},tabIndex:0,...o},n)},X3=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Fn}--cc--card-node`,i=zn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return ft.createElement("div",{className:i,...n},e)},Z3=({children:e,...t})=>{const n=`${Fn}--cc--card-node`,r=zn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return ft.createElement("label",{className:r,...t},e)},K3=({children:e,...t})=>{const n=`${Fn}--cc--card-node`,r=zn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return ft.createElement("div",{className:r,...t},e)},Q3=({children:e,...t})=>{const n=`${Fn}--cc--card-node`,r=zn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return ft.createElement("div",{className:r,...t},e)},J3=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${Fn}--cc--edge`,c=zn(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=yD(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return ft.createElement("g",{className:c,...o},ft.createElement("path",{d:u,className:`${l}__container`}),ft.createElement("path",{d:u,className:`${l}__outer`}),ft.createElement("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}}))},br=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const d=`${Fn}--cc--marker`,h=zn(d,o),p=a==="end"?(s||0)/2+.5:.5,f=(i||0)/2;return ft.createElement("marker",{className:h,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||p,refY:c||f,markerUnits:"userSpaceOnUse",...u},ft.createElement("path",{d:t,style:{fill:e}}))},tU=e=>ft.createElement(br,{d:xD.d,...e}),eU=e=>ft.createElement(br,{d:bD.d,...e}),nU=e=>ft.createElement(br,{d:_D.d,...e}),rU=e=>ft.createElement(br,{d:ED.d,...e}),iU=e=>ft.createElement(br,{d:SD.d,...e}),sU=e=>ft.createElement(br,{d:TD.d,...e}),aU=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:s,renderIcon:a,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const p=o?"a":h.onClick?"button":t,f=`${Fn}--cc--shape-node`,g=zn(f,{[`${f}--stacked`]:c,[`${f}--${e}`]:e,[`${f}--${p}`]:p,[r]:r}),m=n?ft.createElement("div",{className:`${f}__title`},n):null,v=i?ft.createElement("div",{className:`${f}__subtitle`},i):null,x=s?ft.createElement("div",{className:`${f}__description`},s):null;return ft.createElement(p,{className:g,style:{height:l,width:l,position:u},tabIndex:0,...h},ft.createElement("div",{className:`${f}__icon`},a),ft.createElement("div",{className:`${f}__body`,style:{position:d}},m,v,x))};V.Alignments=zt,V.AlluvialChart=_3,V.AreaChart=E3,V.AreaEvent=Ao,V.ArrowDirections=As,V.ArrowLeftMarker=tU,V.ArrowRightMarker=eU,V.AxisEvent=Co,V.AxisFlavor=vi,V.AxisPositions=z,V.AxisTitleOrientations=Ls,V.BarEvent=Ro,V.BoxplotChart=S3,V.BoxplotEvent=Io,V.BubbleChart=T3,V.BulletChart=O3,V.CalloutDirections=pi,V.CanvasZoomEvent=Mo,V.CardNode=Y3,V.CardNodeColumn=X3,V.CardNodeLabel=Z3,V.CardNodeSubtitle=K3,V.CardNodeTitle=Q3,V.CartesianOrientations=Gt,V.ChartEvent=Dn,V.ChartTheme=Go,V.ChartTypes=ve,V.ChoroplethChart=Vv,V.CircleMarker=nU,V.CirclePackChart=w3,V.ColorClassNameTypes=st,V.ColorLegendType=gi,V.ComboChart=$3,V.DiamondMarker=rU,V.DividerStatus=$r,V.DominantBaseline=Qe,V.DonutChart=M3,V.Edge=J3,V.ExperimentalChoroplethChart=Vv,V.GaugeChart=C3,V.GaugeEvent=Do,V.GaugeTypes=Wn,V.GroupedBarChart=A3,V.HeatmapChart=L3,V.HistogramChart=k3,V.LayoutAlignItems=jn,V.LayoutDirection=Mt,V.LayoutGrowth=lt,V.LegendItemType=jt,V.LegendOrientations=wr,V.LegendPositions=Or,V.LineChart=D3,V.LineEvent=Po,V.LollipopChart=R3,V.Marker=br,V.MeterChart=I3,V.ModalEvent=To,V.ModelEvent=Oo,V.PieChart=N3,V.PieEvent=ko,V.Projection=Je,V.RadarChart=P3,V.RadarEvent=Uo,V.RenderTypes=it,V.ScaleTypes=nt,V.ScatterChart=U3,V.ScatterEvent=No,V.ShapeNode=aU,V.SimpleBarChart=B3,V.Skeletons=Ft,V.SquareMarker=iU,V.StackedAreaChart=H3,V.StackedBarChart=V3,V.Statuses=fi,V.TeeMarker=sU,V.TextAnchor=Ke,V.ThresholdEvent=Vo,V.TickRotations=mi,V.ToolbarControlTypes=bt,V.TooltipEvent=Sr,V.TreeChart=G3,V.TreeEvent=Bo,V.TreeTypes=Cs,V.TreemapChart=z3,V.TreemapEvent=Ho,V.TruncationTypes=we,V.WordCloudChart=F3,V.WordCloudEvent=Lo,V.ZoomBarTypes=Ue,V.ZoomDomainEvent=$o,V.ZoombarEvent=wo,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
108
78
  //# sourceMappingURL=index.umd.cjs.map