@carbon/charts-react 1.22.8 → 1.22.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +8409 -7561
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.cjs +49 -40
- package/dist/index.umd.cjs.map +1 -1
- package/dist/index.umd.js +49 -40
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
(function(V,ce){typeof exports=="object"&&typeof module<"u"?ce(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ce):(V=typeof globalThis<"u"?globalThis:V||self,ce(V.ChartsReact={},V.React))})(this,function(V,ce){"use strict";var LU=Object.defineProperty;var RU=(V,ce,jn)=>ce in V?LU(V,ce,{enumerable:!0,configurable:!0,writable:!0,value:jn}):V[ce]=jn;var hh=(V,ce,jn)=>RU(V,typeof ce!="symbol"?ce+"":ce,jn);var jn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(jn||{}),el=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(el||{}),nl=(e=>(e.UPDATE="model-update",e))(nl||{}),ph=(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))(ph||{}),rl=(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))(rl||{}),il=(e=>(e.CHANGE="zoom-domain-change",e))(il||{}),sl=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(sl||{}),al=(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))(al||{}),ol=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(ol||{}),ll=(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))(ll||{}),cl=(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))(cl||{}),ul=(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))(ul||{}),hl=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(hl||{}),dl=(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))(dl||{}),pl=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(pl||{}),fl=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(fl||{}),ml=(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))(ml||{}),gl=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(gl||{}),vl=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(vl||{}),Br=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Br||{}),yl=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(yl||{}),fh=(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))(fh||{}),mh=(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))(mh||{}),gh=(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))(gh||{}),vh=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(vh||{}),yh=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(yh||{}),Hr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Hr||{});const x0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:gh,Area:ol,Axis:al,Bar:hl,Boxplot:dl,CanvasZoom:sl,Chart:jn,Choropleth:Hr,CirclePack:mh,Gauge:ul,Heatmap:yh,Legend:fh,Line:fl,Meter:vh,Modal:el,Model:nl,Pie:cl,Radar:ml,Scatter:pl,Threshold:yl,Toolbar:ph,Tooltip:Br,Tree:gl,Treemap:vl,WordCloud:ll,ZoomBar:rl,ZoomDomain:il},Symbol.toStringTag,{value:"Module"})),S=x0;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),xl=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(xl||{}),at=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(at||{}),G=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(G||{}),Ye=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ye||{}),Ue=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ue||{}),Qt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Qt||{}),tt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(tt||{}),Vr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Vr||{}),Jt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Jt||{}),Fr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Fr||{}),Js=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Js||{}),It=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(It||{}),ht=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ht||{}),or=(e=>(e.CENTER="center",e))(or||{}),ki=(e=>(e.LEFT="left",e.RIGHT="right",e))(ki||{}),te=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(te||{}),ln=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(ln||{}),cn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(cn||{}),lr=(e=>(e.SEMI="semi",e.FULL="full",e))(lr||{}),ta=(e=>(e.UP="up",e.DOWN="down",e))(ta||{}),Li=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Li||{}),Ri=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Ri||{}),Me=(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))(Me||{}),St=(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))(St||{}),ea=(e=>(e.LEFT="left",e.RIGHT="right",e))(ea||{}),ee=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(ee||{}),Di=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Di||{}),Gr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Gr||{}),Ii=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Ii||{}),un=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(un||{}),xh=(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))(xh||{});function bl(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Ni(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 Pi(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)?_0(o,d=>d.test(a)):b0(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 b0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function _0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function E0(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 bh=6048e5,T0=864e5,_h=6e4,Eh=36e5,Th=Symbol.for("constructDateFrom");function Be(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Th in e?e[Th](t):e instanceof Date?new e.constructor(t):new Date(t)}function cr(e,...t){const n=Be.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let O0={};function na(){return O0}function Yt(e,t){return Be(t||e,e)}function Ui(e,t){var n,r,i,s;const a=na(),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=Yt(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 S0={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"}},w0=(e,t,n)=>{let r;const i=S0[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},$0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},M0=(e,t,n,r)=>$0[e],C0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},A0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},k0={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"]},L0={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"]},R0={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"}},D0={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"}},I0=(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"},N0={ordinalNumber:I0,era:Ni({values:C0,defaultWidth:"wide"}),quarter:Ni({values:A0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ni({values:k0,defaultWidth:"wide"}),day:Ni({values:L0,defaultWidth:"wide"}),dayPeriod:Ni({values:R0,defaultWidth:"wide",formattingValues:D0,defaultFormattingWidth:"wide"})},P0=/^(\d+)(th|st|nd|rd)?/i,U0=/\d+/i,B0={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},H0={any:[/^b/i,/^(a|c)/i]},V0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},F0={any:[/1/i,/2/i,/3/i,/4/i]},G0={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},z0={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]},j0={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},W0={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]},q0={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},Y0={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}},Z0={ordinalNumber:E0({matchPattern:P0,parsePattern:U0,valueCallback:e=>parseInt(e,10)}),era:Pi({matchPatterns:B0,defaultMatchWidth:"wide",parsePatterns:H0,defaultParseWidth:"any"}),quarter:Pi({matchPatterns:V0,defaultMatchWidth:"wide",parsePatterns:F0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Pi({matchPatterns:G0,defaultMatchWidth:"wide",parsePatterns:z0,defaultParseWidth:"any"}),day:Pi({matchPatterns:j0,defaultMatchWidth:"wide",parsePatterns:W0,defaultParseWidth:"any"}),dayPeriod:Pi({matchPatterns:q0,defaultMatchWidth:"any",parsePatterns:Y0,defaultParseWidth:"any"})},X0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},K0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Q0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},J0={date:bl({formats:X0,defaultWidth:"full"}),time:bl({formats:K0,defaultWidth:"full"}),dateTime:bl({formats:Q0,defaultWidth:"full"})},Oh={code:"en-US",formatDistance:w0,formatLong:J0,formatRelative:M0,localize:N0,match:Z0,options:{weekStartsOn:0,firstWeekContainsDate:1}};var Sh=typeof global=="object"&&global&&global.Object===Object&&global,t1=typeof self=="object"&&self&&self.Object===Object&&self,Ze=Sh||t1||Function("return this")(),He=Ze.Symbol,wh=Object.prototype,e1=wh.hasOwnProperty,n1=wh.toString,Bi=He?He.toStringTag:void 0;function r1(e){var t=e1.call(e,Bi),n=e[Bi];try{e[Bi]=void 0;var r=!0}catch{}var i=n1.call(e);return r&&(t?e[Bi]=n:delete e[Bi]),i}var i1=Object.prototype,s1=i1.toString;function a1(e){return s1.call(e)}var o1="[object Null]",l1="[object Undefined]",$h=He?He.toStringTag:void 0;function ur(e){return e==null?e===void 0?l1:o1:$h&&$h in Object(e)?r1(e):a1(e)}function hn(e){return e!=null&&typeof e=="object"}var c1="[object Symbol]";function ra(e){return typeof e=="symbol"||hn(e)&&ur(e)==c1}function _l(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 se=Array.isArray,u1=1/0,Mh=He?He.prototype:void 0,Ch=Mh?Mh.toString:void 0;function Ah(e){if(typeof e=="string")return e;if(se(e))return _l(e,Ah)+"";if(ra(e))return Ch?Ch.call(e):"";var t=e+"";return t=="0"&&1/e==-u1?"-0":t}function Ve(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function El(e){return e}var h1="[object AsyncFunction]",d1="[object Function]",p1="[object GeneratorFunction]",f1="[object Proxy]";function Tl(e){if(!Ve(e))return!1;var t=ur(e);return t==d1||t==p1||t==h1||t==f1}var Ol=Ze["__core-js_shared__"],kh=function(){var e=/[^.]+$/.exec(Ol&&Ol.keys&&Ol.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function m1(e){return!!kh&&kh in e}var g1=Function.prototype,v1=g1.toString;function hr(e){if(e!=null){try{return v1.call(e)}catch{}try{return e+""}catch{}}return""}var y1=/[\\^$.*+?()[\]{}|]/g,x1=/^\[object .+?Constructor\]$/,b1=Function.prototype,_1=Object.prototype,E1=b1.toString,T1=_1.hasOwnProperty,O1=RegExp("^"+E1.call(T1).replace(y1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function S1(e){if(!Ve(e)||m1(e))return!1;var t=Tl(e)?O1:x1;return t.test(hr(e))}function w1(e,t){return e==null?void 0:e[t]}function dr(e,t){var n=w1(e,t);return S1(n)?n:void 0}var Sl=dr(Ze,"WeakMap"),Lh=Object.create,$1=function(){function e(){}return function(t){if(!Ve(t))return{};if(Lh)return Lh(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 C1(){}function Rh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var A1=800,k1=16,L1=Date.now;function R1(e){var t=0,n=0;return function(){var r=L1(),i=k1-(r-n);if(n=r,i>0){if(++t>=A1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function D1(e){return function(){return e}}var ia=function(){try{var e=dr(Object,"defineProperty");return e({},"",{}),e}catch{}}(),I1=ia?function(e,t){return ia(e,"toString",{configurable:!0,enumerable:!1,value:D1(t),writable:!0})}:El,Dh=R1(I1);function N1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function P1(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 U1(e){return e!==e}function B1(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function H1(e,t,n){return t===t?B1(e,t,n):P1(e,U1,n)}function V1(e,t){var n=e==null?0:e.length;return!!n&&H1(e,t,0)>-1}var F1=9007199254740991,G1=/^(?:0|[1-9]\d*)$/;function wl(e,t){var n=typeof e;return t=t??F1,!!t&&(n=="number"||n!="symbol"&&G1.test(e))&&e>-1&&e%1==0&&e<t}function sa(e,t,n){t=="__proto__"&&ia?ia(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Hi(e,t){return e===t||e!==e&&t!==t}var z1=Object.prototype,j1=z1.hasOwnProperty;function Ih(e,t,n){var r=e[t];(!(j1.call(e,t)&&Hi(r,n))||n===void 0&&!(t in e))&&sa(e,t,n)}function zr(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?sa(n,o,l):Ih(n,o,l)}return n}var Nh=Math.max;function Ph(e,t,n){return t=Nh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=Nh(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 $l(e,t){return Dh(Ph(e,t,El),e+"")}var W1=9007199254740991;function Ml(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=W1}function pr(e){return e!=null&&Ml(e.length)&&!Tl(e)}function q1(e,t,n){if(!Ve(n))return!1;var r=typeof t;return(r=="number"?pr(n)&&wl(t,n.length):r=="string"&&t in n)?Hi(n[t],e):!1}function Y1(e){return $l(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&&q1(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 Z1=Object.prototype;function aa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Z1;return e===n}function X1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var K1="[object Arguments]";function Uh(e){return hn(e)&&ur(e)==K1}var Bh=Object.prototype,Q1=Bh.hasOwnProperty,J1=Bh.propertyIsEnumerable,jr=Uh(function(){return arguments}())?Uh:function(e){return hn(e)&&Q1.call(e,"callee")&&!J1.call(e,"callee")};function ty(){return!1}var Hh=typeof V=="object"&&V&&!V.nodeType&&V,Vh=Hh&&typeof module=="object"&&module&&!module.nodeType&&module,ey=Vh&&Vh.exports===Hh,Fh=ey?Ze.Buffer:void 0,ny=Fh?Fh.isBuffer:void 0,Wr=ny||ty,ry="[object Arguments]",iy="[object Array]",sy="[object Boolean]",ay="[object Date]",oy="[object Error]",ly="[object Function]",cy="[object Map]",uy="[object Number]",hy="[object Object]",dy="[object RegExp]",py="[object Set]",fy="[object String]",my="[object WeakMap]",gy="[object ArrayBuffer]",vy="[object DataView]",yy="[object Float32Array]",xy="[object Float64Array]",by="[object Int8Array]",_y="[object Int16Array]",Ey="[object Int32Array]",Ty="[object Uint8Array]",Oy="[object Uint8ClampedArray]",Sy="[object Uint16Array]",wy="[object Uint32Array]",Vt={};Vt[yy]=Vt[xy]=Vt[by]=Vt[_y]=Vt[Ey]=Vt[Ty]=Vt[Oy]=Vt[Sy]=Vt[wy]=!0,Vt[ry]=Vt[iy]=Vt[gy]=Vt[sy]=Vt[vy]=Vt[ay]=Vt[oy]=Vt[ly]=Vt[cy]=Vt[uy]=Vt[hy]=Vt[dy]=Vt[py]=Vt[fy]=Vt[my]=!1;function $y(e){return hn(e)&&Ml(e.length)&&!!Vt[ur(e)]}function Cl(e){return function(t){return e(t)}}var Gh=typeof V=="object"&&V&&!V.nodeType&&V,Vi=Gh&&typeof module=="object"&&module&&!module.nodeType&&module,My=Vi&&Vi.exports===Gh,Al=My&&Sh.process,qr=function(){try{var e=Vi&&Vi.require&&Vi.require("util").types;return e||Al&&Al.binding&&Al.binding("util")}catch{}}(),zh=qr&&qr.isTypedArray,oa=zh?Cl(zh):$y,Cy=Object.prototype,Ay=Cy.hasOwnProperty;function jh(e,t){var n=se(e),r=!n&&jr(e),i=!n&&!r&&Wr(e),s=!n&&!r&&!i&&oa(e),a=n||r||i||s,o=a?X1(e.length,String):[],l=o.length;for(var c in e)(t||Ay.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wl(c,l)))&&o.push(c);return o}function Wh(e,t){return function(n){return e(t(n))}}var ky=Wh(Object.keys,Object),Ly=Object.prototype,Ry=Ly.hasOwnProperty;function qh(e){if(!aa(e))return ky(e);var t=[];for(var n in Object(e))Ry.call(e,n)&&n!="constructor"&&t.push(n);return t}function Fi(e){return pr(e)?jh(e):qh(e)}function Dy(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Iy=Object.prototype,Ny=Iy.hasOwnProperty;function Py(e){if(!Ve(e))return Dy(e);var t=aa(e),n=[];for(var r in e)r=="constructor"&&(t||!Ny.call(e,r))||n.push(r);return n}function Gi(e){return pr(e)?jh(e,!0):Py(e)}var Uy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,By=/^\w*$/;function kl(e,t){if(se(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ra(e)?!0:By.test(e)||!Uy.test(e)||t!=null&&e in Object(t)}var zi=dr(Object,"create");function Hy(){this.__data__=zi?zi(null):{},this.size=0}function Vy(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Fy="__lodash_hash_undefined__",Gy=Object.prototype,zy=Gy.hasOwnProperty;function jy(e){var t=this.__data__;if(zi){var n=t[e];return n===Fy?void 0:n}return zy.call(t,e)?t[e]:void 0}var Wy=Object.prototype,qy=Wy.hasOwnProperty;function Yy(e){var t=this.__data__;return zi?t[e]!==void 0:qy.call(t,e)}var Zy="__lodash_hash_undefined__";function Xy(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=zi&&t===void 0?Zy:t,this}function fr(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])}}fr.prototype.clear=Hy,fr.prototype.delete=Vy,fr.prototype.get=jy,fr.prototype.has=Yy,fr.prototype.set=Xy;function Ky(){this.__data__=[],this.size=0}function la(e,t){for(var n=e.length;n--;)if(Hi(e[n][0],t))return n;return-1}var Qy=Array.prototype,Jy=Qy.splice;function tx(e){var t=this.__data__,n=la(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Jy.call(t,n,1),--this.size,!0}function ex(e){var t=this.__data__,n=la(t,e);return n<0?void 0:t[n][1]}function nx(e){return la(this.__data__,e)>-1}function rx(e,t){var n=this.__data__,r=la(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function _n(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])}}_n.prototype.clear=Ky,_n.prototype.delete=tx,_n.prototype.get=ex,_n.prototype.has=nx,_n.prototype.set=rx;var ji=dr(Ze,"Map");function ix(){this.size=0,this.__data__={hash:new fr,map:new(ji||_n),string:new fr}}function sx(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ca(e,t){var n=e.__data__;return sx(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ax(e){var t=ca(this,e).delete(e);return this.size-=t?1:0,t}function ox(e){return ca(this,e).get(e)}function lx(e){return ca(this,e).has(e)}function cx(e,t){var n=ca(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function En(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])}}En.prototype.clear=ix,En.prototype.delete=ax,En.prototype.get=ox,En.prototype.has=lx,En.prototype.set=cx;var ux="Expected a function";function Ll(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ux);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(Ll.Cache||En),n}Ll.Cache=En;var hx=500;function dx(e){var t=Ll(e,function(r){return n.size===hx&&n.clear(),r}),n=t.cache;return t}var px=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fx=/\\(\\)?/g,mx=dx(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(px,function(n,r,i,s){t.push(i?s.replace(fx,"$1"):r||n)}),t});function Wi(e){return e==null?"":Ah(e)}function ua(e,t){return se(e)?e:kl(e,t)?[e]:mx(Wi(e))}var gx=1/0;function qi(e){if(typeof e=="string"||ra(e))return e;var t=e+"";return t=="0"&&1/e==-gx?"-0":t}function Rl(e,t){t=ua(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[qi(t[n++])];return n&&n==r?e:void 0}function Et(e,t,n){var r=e==null?void 0:Rl(e,t);return r===void 0?n:r}function Dl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Yh=He?He.isConcatSpreadable:void 0;function vx(e){return se(e)||jr(e)||!!(Yh&&e&&e[Yh])}function ha(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=vx),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?ha(o,t-1,n,r,i):Dl(i,o):r||(i[i.length]=o)}return i}var Il=Wh(Object.getPrototypeOf,Object),yx="[object Object]",xx=Function.prototype,bx=Object.prototype,Zh=xx.toString,_x=bx.hasOwnProperty,Ex=Zh.call(Object);function Xh(e){if(!hn(e)||ur(e)!=yx)return!1;var t=Il(e);if(t===null)return!0;var n=_x.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Zh.call(n)==Ex}function Tx(){this.__data__=new _n,this.size=0}function Ox(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Sx(e){return this.__data__.get(e)}function wx(e){return this.__data__.has(e)}var $x=200;function Mx(e,t){var n=this.__data__;if(n instanceof _n){var r=n.__data__;if(!ji||r.length<$x-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new En(r)}return n.set(e,t),this.size=n.size,this}function Xe(e){var t=this.__data__=new _n(e);this.size=t.size}Xe.prototype.clear=Tx,Xe.prototype.delete=Ox,Xe.prototype.get=Sx,Xe.prototype.has=wx,Xe.prototype.set=Mx;function Cx(e,t){return e&&zr(t,Fi(t),e)}function Ax(e,t){return e&&zr(t,Gi(t),e)}var Kh=typeof V=="object"&&V&&!V.nodeType&&V,Qh=Kh&&typeof module=="object"&&module&&!module.nodeType&&module,kx=Qh&&Qh.exports===Kh,Jh=kx?Ze.Buffer:void 0,td=Jh?Jh.allocUnsafe:void 0;function ed(e,t){if(t)return e.slice();var n=e.length,r=td?td(n):new e.constructor(n);return e.copy(r),r}function Lx(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 nd(){return[]}var Rx=Object.prototype,Dx=Rx.propertyIsEnumerable,rd=Object.getOwnPropertySymbols,Nl=rd?function(e){return e==null?[]:(e=Object(e),Lx(rd(e),function(t){return Dx.call(e,t)}))}:nd;function Ix(e,t){return zr(e,Nl(e),t)}var Nx=Object.getOwnPropertySymbols,id=Nx?function(e){for(var t=[];e;)Dl(t,Nl(e)),e=Il(e);return t}:nd;function Px(e,t){return zr(e,id(e),t)}function sd(e,t,n){var r=t(e);return se(e)?r:Dl(r,n(e))}function Pl(e){return sd(e,Fi,Nl)}function ad(e){return sd(e,Gi,id)}var Ul=dr(Ze,"DataView"),Bl=dr(Ze,"Promise"),Yr=dr(Ze,"Set"),od="[object Map]",Ux="[object Object]",ld="[object Promise]",cd="[object Set]",ud="[object WeakMap]",hd="[object DataView]",Bx=hr(Ul),Hx=hr(ji),Vx=hr(Bl),Fx=hr(Yr),Gx=hr(Sl),Fe=ur;(Ul&&Fe(new Ul(new ArrayBuffer(1)))!=hd||ji&&Fe(new ji)!=od||Bl&&Fe(Bl.resolve())!=ld||Yr&&Fe(new Yr)!=cd||Sl&&Fe(new Sl)!=ud)&&(Fe=function(e){var t=ur(e),n=t==Ux?e.constructor:void 0,r=n?hr(n):"";if(r)switch(r){case Bx:return hd;case Hx:return od;case Vx:return ld;case Fx:return cd;case Gx:return ud}return t});var zx=Object.prototype,jx=zx.hasOwnProperty;function Wx(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&jx.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var da=Ze.Uint8Array;function Hl(e){var t=new e.constructor(e.byteLength);return new da(t).set(new da(e)),t}function qx(e,t){var n=t?Hl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Yx=/\w*$/;function Zx(e){var t=new e.constructor(e.source,Yx.exec(e));return t.lastIndex=e.lastIndex,t}var dd=He?He.prototype:void 0,pd=dd?dd.valueOf:void 0;function Xx(e){return pd?Object(pd.call(e)):{}}function fd(e,t){var n=t?Hl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Kx="[object Boolean]",Qx="[object Date]",Jx="[object Map]",tb="[object Number]",eb="[object RegExp]",nb="[object Set]",rb="[object String]",ib="[object Symbol]",sb="[object ArrayBuffer]",ab="[object DataView]",ob="[object Float32Array]",lb="[object Float64Array]",cb="[object Int8Array]",ub="[object Int16Array]",hb="[object Int32Array]",db="[object Uint8Array]",pb="[object Uint8ClampedArray]",fb="[object Uint16Array]",mb="[object Uint32Array]";function gb(e,t,n){var r=e.constructor;switch(t){case sb:return Hl(e);case Kx:case Qx:return new r(+e);case ab:return qx(e,n);case ob:case lb:case cb:case ub:case hb:case db:case pb:case fb:case mb:return fd(e,n);case Jx:return new r;case tb:case rb:return new r(e);case eb:return Zx(e);case nb:return new r;case ib:return Xx(e)}}function md(e){return typeof e.constructor=="function"&&!aa(e)?$1(Il(e)):{}}var vb="[object Map]";function yb(e){return hn(e)&&Fe(e)==vb}var gd=qr&&qr.isMap,xb=gd?Cl(gd):yb,bb="[object Set]";function _b(e){return hn(e)&&Fe(e)==bb}var vd=qr&&qr.isSet,Eb=vd?Cl(vd):_b,Tb=1,Ob=2,Sb=4,yd="[object Arguments]",wb="[object Array]",$b="[object Boolean]",Mb="[object Date]",Cb="[object Error]",xd="[object Function]",Ab="[object GeneratorFunction]",kb="[object Map]",Lb="[object Number]",bd="[object Object]",Rb="[object RegExp]",Db="[object Set]",Ib="[object String]",Nb="[object Symbol]",Pb="[object WeakMap]",Ub="[object ArrayBuffer]",Bb="[object DataView]",Hb="[object Float32Array]",Vb="[object Float64Array]",Fb="[object Int8Array]",Gb="[object Int16Array]",zb="[object Int32Array]",jb="[object Uint8Array]",Wb="[object Uint8ClampedArray]",qb="[object Uint16Array]",Yb="[object Uint32Array]",Bt={};Bt[yd]=Bt[wb]=Bt[Ub]=Bt[Bb]=Bt[$b]=Bt[Mb]=Bt[Hb]=Bt[Vb]=Bt[Fb]=Bt[Gb]=Bt[zb]=Bt[kb]=Bt[Lb]=Bt[bd]=Bt[Rb]=Bt[Db]=Bt[Ib]=Bt[Nb]=Bt[jb]=Bt[Wb]=Bt[qb]=Bt[Yb]=!0,Bt[Cb]=Bt[xd]=Bt[Pb]=!1;function Yi(e,t,n,r,i,s){var a,o=t&Tb,l=t&Ob,c=t&Sb;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ve(e))return e;var u=se(e);if(u){if(a=Wx(e),!o)return Rh(e,a)}else{var d=Fe(e),h=d==xd||d==Ab;if(Wr(e))return ed(e,o);if(d==bd||d==yd||h&&!i){if(a=l||h?{}:md(e),!o)return l?Px(e,Ax(a,e)):Ix(e,Cx(a,e))}else{if(!Bt[d])return i?e:{};a=gb(e,d,o)}}s||(s=new Xe);var p=s.get(e);if(p)return p;s.set(e,a),Eb(e)?e.forEach(function(m){a.add(Yi(m,t,n,m,e,s))}):xb(e)&&e.forEach(function(m,y){a.set(y,Yi(m,t,n,y,e,s))});var f=c?l?ad:Pl:l?Gi:Fi,v=u?void 0:f(e);return N1(v||e,function(m,y){v&&(y=m,m=e[y]),Ih(a,y,Yi(m,t,n,y,e,s))}),a}var Zb=1,Xb=4;function Tn(e){return Yi(e,Zb|Xb)}var Kb="__lodash_hash_undefined__";function Qb(e){return this.__data__.set(e,Kb),this}function Jb(e){return this.__data__.has(e)}function Zi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new En;++t<n;)this.add(e[t])}Zi.prototype.add=Zi.prototype.push=Qb,Zi.prototype.has=Jb;function _d(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 Ed(e,t){return e.has(t)}var t_=1,e_=2;function Td(e,t,n,r,i,s){var a=n&t_,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&e_?new Zi:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var f=e[d],v=t[d];if(r)var m=a?r(v,f,d,t,e,s):r(f,v,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(p){if(!_d(t,function(y,g){if(!Ed(p,g)&&(f===y||i(f,y,n,r,s)))return p.push(g)})){h=!1;break}}else if(!(f===v||i(f,v,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function n_(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Vl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var r_=1,i_=2,s_="[object Boolean]",a_="[object Date]",o_="[object Error]",l_="[object Map]",c_="[object Number]",u_="[object RegExp]",h_="[object Set]",d_="[object String]",p_="[object Symbol]",f_="[object ArrayBuffer]",m_="[object DataView]",Od=He?He.prototype:void 0,Fl=Od?Od.valueOf:void 0;function g_(e,t,n,r,i,s,a){switch(n){case m_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case f_:return!(e.byteLength!=t.byteLength||!s(new da(e),new da(t)));case s_:case a_:case c_:return Hi(+e,+t);case o_:return e.name==t.name&&e.message==t.message;case u_:case d_:return e==t+"";case l_:var o=n_;case h_:var l=r&r_;if(o||(o=Vl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=i_,a.set(e,t);var u=Td(o(e),o(t),r,i,s,a);return a.delete(e),u;case p_:if(Fl)return Fl.call(e)==Fl.call(t)}return!1}var v_=1,y_=Object.prototype,x_=y_.hasOwnProperty;function b_(e,t,n,r,i,s){var a=n&v_,o=Pl(e),l=o.length,c=Pl(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:x_.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var v=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var y=e[h],g=t[h];if(r)var b=a?r(g,y,h,t,e,s):r(y,g,h,e,t,s);if(!(b===void 0?y===g||i(y,g,n,r,s):b)){v=!1;break}m||(m=h=="constructor")}if(v&&!m){var T=e.constructor,E=t.constructor;T!=E&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof E=="function"&&E instanceof E)&&(v=!1)}return s.delete(e),s.delete(t),v}var __=1,Sd="[object Arguments]",wd="[object Array]",pa="[object Object]",E_=Object.prototype,$d=E_.hasOwnProperty;function T_(e,t,n,r,i,s){var a=se(e),o=se(t),l=a?wd:Fe(e),c=o?wd:Fe(t);l=l==Sd?pa:l,c=c==Sd?pa:c;var u=l==pa,d=c==pa,h=l==c;if(h&&Wr(e)){if(!Wr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Xe),a||oa(e)?Td(e,t,n,r,i,s):g_(e,t,l,n,r,i,s);if(!(n&__)){var p=u&&$d.call(e,"__wrapped__"),f=d&&$d.call(t,"__wrapped__");if(p||f){var v=p?e.value():e,m=f?t.value():t;return s||(s=new Xe),i(v,m,n,r,s)}}return h?(s||(s=new Xe),b_(e,t,n,r,i,s)):!1}function fa(e,t,n,r,i){return e===t?!0:e==null||t==null||!hn(e)&&!hn(t)?e!==e&&t!==t:T_(e,t,n,r,fa,i)}var O_=1,S_=2;function w_(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 Xe,d;if(!(d===void 0?fa(c,l,O_|S_,r,u):d))return!1}}return!0}function Md(e){return e===e&&!Ve(e)}function $_(e){for(var t=Fi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Md(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 M_(e){var t=$_(e);return t.length==1&&t[0][2]?Cd(t[0][0],t[0][1]):function(n){return n===e||w_(n,e,t)}}function C_(e,t){return e!=null&&t in Object(e)}function A_(e,t,n){t=ua(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=qi(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&&Ml(i)&&wl(a,i)&&(se(e)||jr(e)))}function k_(e,t){return e!=null&&A_(e,t,C_)}var L_=1,R_=2;function D_(e,t){return kl(e)&&Md(t)?Cd(qi(e),t):function(n){var r=Et(n,e);return r===void 0&&r===t?k_(n,e):fa(t,r,L_|R_)}}function I_(e){return function(t){return t==null?void 0:t[e]}}function N_(e){return function(t){return Rl(t,e)}}function P_(e){return kl(e)?I_(qi(e)):N_(e)}function ma(e){return typeof e=="function"?e:e==null?El:typeof e=="object"?se(e)?D_(e[0],e[1]):M_(e):P_(e)}function U_(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 Ad=U_();function Gl(e,t,n){(n!==void 0&&!Hi(e[t],n)||n===void 0&&!(t in e))&&sa(e,t,n)}function zl(e){return hn(e)&&pr(e)}function jl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function B_(e){return zr(e,Gi(e))}function H_(e,t,n,r,i,s,a){var o=jl(e,n),l=jl(t,n),c=a.get(l);if(c){Gl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=se(l),p=!h&&Wr(l),f=!h&&!p&&oa(l);u=l,h||p||f?se(o)?u=o:zl(o)?u=Rh(o):p?(d=!1,u=ed(l,!0)):f?(d=!1,u=fd(l,!0)):u=[]:Xh(l)||jr(l)?(u=o,jr(o)?u=B_(o):(!Ve(o)||Tl(o))&&(u=md(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Gl(e,n,u)}function kd(e,t,n,r,i){e!==t&&Ad(t,function(s,a){if(i||(i=new Xe),Ve(s))H_(e,t,a,n,kd,r,i);else{var o=r?r(jl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Gl(e,a,o)}},Gi)}function Ld(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var V_="[object Map]",F_="[object Set]",G_=Object.prototype,z_=G_.hasOwnProperty;function Ke(e){if(e==null)return!0;if(pr(e)&&(se(e)||typeof e=="string"||typeof e.splice=="function"||Wr(e)||oa(e)||jr(e)))return!e.length;var t=Fe(e);if(t==V_||t==F_)return!e.size;if(aa(e))return!qh(e).length;for(var n in e)if(z_.call(e,n))return!1;return!0}var ct=Y1(function(e,t,n){kd(e,t,n)}),j_=1/0,W_=Yr&&1/Vl(new Yr([,-0]))[1]==j_?function(e){return new Yr(e)}:C1,q_=200;function Rd(e,t,n){var r=-1,i=V1,s=e.length,a=!0,o=[],l=o;if(s>=q_){var c=t?null:W_(e);if(c)return Vl(c);a=!1,i=Ed,l=new Zi}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 Y_=$l(function(e){var t=Ld(e);return zl(t)&&(t=void 0),Rd(ha(e,1,zl,!0),ma(t))});function Xi(e){return e&&e.length?Rd(e):[]}function mr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Z_(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Wl(e){let t,n,r;e.length!==2?(t=mr,n=(o,l)=>mr(e(o),l),r=(o,l)=>e(o)-l):(t=e===mr||e===Z_?e:X_,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 X_(){return 0}function K_(e){return e===null?NaN:+e}function*Q_(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const J_=Wl(mr),ql=J_.right;Wl(K_).center;function Qe(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 Dd=class extends Map{constructor(t,n=nE){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(Id(this,t))}has(t){return super.has(Id(this,t))}set(t,n){return super.set(tE(this,t),n)}delete(t){return super.delete(eE(this,t))}};function Id({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function tE({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function eE({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function nE(e){return e!==null&&typeof e=="object"?e.valueOf():e}const rE=Math.sqrt(50),iE=Math.sqrt(10),sE=Math.sqrt(2);function ga(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>=rE?10:s>=iE?5:s>=sE?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?ga(e,t,n*2):[o,l,c]}function va(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?ga(t,e,n):ga(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 Zr(e,t,n){return t=+t,e=+e,n=+n,ga(e,t,n)[2]}function Yl(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Zr(t,e,n):Zr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function gr(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 Wn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var aE={value:()=>{}};function Zl(){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 ya(n)}function ya(e){this._=e}function oE(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}})}ya.prototype=Zl.prototype={constructor:ya,on:function(e,t){var n=this._,r=oE(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=lE(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]=Nd(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Nd(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 ya(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 lE(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Nd(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=aE,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 Pd={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 xa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Pd.hasOwnProperty(t)?{space:Pd[t],local:e}:e}function cE(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 uE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ud(e){var t=xa(e);return(t.local?uE:cE)(t)}function hE(){}function Kl(e){return e==null?hE:function(){return this.querySelector(e)}}function dE(e){typeof e!="function"&&(e=Kl(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 Ce(r,this._parents)}function pE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function fE(){return[]}function Bd(e){return e==null?fE:function(){return this.querySelectorAll(e)}}function mE(e){return function(){return pE(e.apply(this,arguments))}}function gE(e){typeof e=="function"?e=mE(e):e=Bd(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 Ce(r,i)}function Hd(e){return function(){return this.matches(e)}}function Vd(e){return function(t){return t.matches(e)}}var vE=Array.prototype.find;function yE(e){return function(){return vE.call(this.children,e)}}function xE(){return this.firstElementChild}function bE(e){return this.select(e==null?xE:yE(typeof e=="function"?e:Vd(e)))}var _E=Array.prototype.filter;function EE(){return Array.from(this.children)}function TE(e){return function(){return _E.call(this.children,e)}}function OE(e){return this.selectAll(e==null?EE:TE(typeof e=="function"?e:Vd(e)))}function SE(e){typeof e!="function"&&(e=Hd(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 Ce(r,this._parents)}function Fd(e){return new Array(e.length)}function wE(){return new Ce(this._enter||this._groups.map(Fd),this._parents)}function ba(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ba.prototype={constructor:ba,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 $E(e){return function(){return e}}function ME(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 ba(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function CE(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 ba(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function AE(e){return e.__data__}function kE(e,t){if(!arguments.length)return Array.from(this,AE);var n=t?CE:ME,r=this._parents,i=this._groups;typeof e!="function"&&(e=$E(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=LE(e.call(u,u&&u.__data__,c,r)),f=p.length,v=o[c]=new Array(f),m=a[c]=new Array(f),y=l[c]=new Array(h);n(u,d,v,m,y,p,t);for(var g=0,b=0,T,E;g<f;++g)if(T=v[g]){for(g>=b&&(b=g+1);!(E=m[b])&&++b<f;);T._next=E||null}}return a=new Ce(a,r),a._enter=o,a._exit=l,a}function LE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function RE(){return new Ce(this._exit||this._groups.map(Fd),this._parents)}function DE(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 IE(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 Ce(o,this._parents)}function NE(){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 PE(e){e||(e=UE);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 Ce(i,this._parents).order()}function UE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function BE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function HE(){return Array.from(this)}function VE(){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 FE(){let e=0;for(const t of this)++e;return e}function GE(){return!this.node()}function zE(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 jE(e){return function(){this.removeAttribute(e)}}function WE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qE(e,t){return function(){this.setAttribute(e,t)}}function YE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ZE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function XE(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 KE(e,t){var n=xa(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?WE:jE:typeof t=="function"?n.local?XE:ZE:n.local?YE:qE)(n,t))}function Gd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function QE(e){return function(){this.style.removeProperty(e)}}function JE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function tT(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function eT(e,t,n){return arguments.length>1?this.each((t==null?QE:typeof t=="function"?tT:JE)(e,t,n??"")):Xr(this.node(),e)}function Xr(e,t){return e.style.getPropertyValue(t)||Gd(e).getComputedStyle(e,null).getPropertyValue(t)}function nT(e){return function(){delete this[e]}}function rT(e,t){return function(){this[e]=t}}function iT(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function sT(e,t){return arguments.length>1?this.each((t==null?nT:typeof t=="function"?iT:rT)(e,t)):this.node()[e]}function zd(e){return e.trim().split(/^|\s+/)}function Ql(e){return e.classList||new jd(e)}function jd(e){this._node=e,this._names=zd(e.getAttribute("class")||"")}jd.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=Ql(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function qd(e,t){for(var n=Ql(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function aT(e){return function(){Wd(this,e)}}function oT(e){return function(){qd(this,e)}}function lT(e,t){return function(){(t.apply(this,arguments)?Wd:qd)(this,e)}}function cT(e,t){var n=zd(e+"");if(arguments.length<2){for(var r=Ql(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?lT:t?aT:oT)(n,t))}function uT(){this.textContent=""}function hT(e){return function(){this.textContent=e}}function dT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function pT(e){return arguments.length?this.each(e==null?uT:(typeof e=="function"?dT:hT)(e)):this.node().textContent}function fT(){this.innerHTML=""}function mT(e){return function(){this.innerHTML=e}}function gT(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function vT(e){return arguments.length?this.each(e==null?fT:(typeof e=="function"?gT:mT)(e)):this.node().innerHTML}function yT(){this.nextSibling&&this.parentNode.appendChild(this)}function xT(){return this.each(yT)}function bT(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _T(){return this.each(bT)}function ET(e){var t=typeof e=="function"?e:Ud(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function TT(){return null}function OT(e,t){var n=typeof e=="function"?e:Ud(e),r=t==null?TT:typeof t=="function"?t:Kl(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ST(){var e=this.parentNode;e&&e.removeChild(this)}function wT(){return this.each(ST)}function $T(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function MT(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function CT(e){return this.select(e?MT:$T)}function AT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function kT(e){return function(t){e.call(this,t,this.__data__)}}function LT(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 RT(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 DT(e,t,n){return function(){var r=this.__on,i,s=kT(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 IT(e,t,n){var r=LT(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?DT:RT,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function Yd(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 NT(e,t){return function(){return Yd(this,e,t)}}function PT(e,t){return function(){return Yd(this,e,t.apply(this,arguments))}}function UT(e,t){return this.each((typeof t=="function"?PT:NT)(e,t))}function*BT(){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 Zd=[null];function Ce(e,t){this._groups=e,this._parents=t}function Ki(){return new Ce([[document.documentElement]],Zd)}function HT(){return this}Ce.prototype=Ki.prototype={constructor:Ce,select:dE,selectAll:gE,selectChild:bE,selectChildren:OE,filter:SE,data:kE,enter:wE,exit:RE,join:DE,merge:IE,selection:HT,order:NE,sort:PE,call:BE,nodes:HE,node:VE,size:FE,empty:GE,each:zE,attr:KE,style:eT,property:sT,classed:cT,text:pT,html:vT,raise:xT,lower:_T,append:ET,insert:OT,remove:wT,clone:CT,datum:AT,on:IT,dispatch:UT,[Symbol.iterator]:BT};function VT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function vr(e,t){if(e=VT(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 Jl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Xd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qi(){}var Ji=.7,_a=1/Ji,Kr="\\s*([+-]?\\d+)\\s*",ts="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",FT=/^#([0-9a-f]{3,8})$/,GT=new RegExp(`^rgb\\(${Kr},${Kr},${Kr}\\)$`),zT=new RegExp(`^rgb\\(${dn},${dn},${dn}\\)$`),jT=new RegExp(`^rgba\\(${Kr},${Kr},${Kr},${ts}\\)$`),WT=new RegExp(`^rgba\\(${dn},${dn},${dn},${ts}\\)$`),qT=new RegExp(`^hsl\\(${ts},${dn},${dn}\\)$`),YT=new RegExp(`^hsla\\(${ts},${dn},${dn},${ts}\\)$`),Kd={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};Jl(Qi,On,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Qd,formatHex:Qd,formatHex8:ZT,formatHsl:XT,formatRgb:Jd,toString:Jd});function Qd(){return this.rgb().formatHex()}function ZT(){return this.rgb().formatHex8()}function XT(){return ip(this).formatHsl()}function Jd(){return this.rgb().formatRgb()}function On(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=FT.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tp(t):n===3?new _e(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ea(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ea(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=GT.exec(e))?new _e(t[1],t[2],t[3],1):(t=zT.exec(e))?new _e(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=jT.exec(e))?Ea(t[1],t[2],t[3],t[4]):(t=WT.exec(e))?Ea(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qT.exec(e))?rp(t[1],t[2]/100,t[3]/100,1):(t=YT.exec(e))?rp(t[1],t[2]/100,t[3]/100,t[4]):Kd.hasOwnProperty(e)?tp(Kd[e]):e==="transparent"?new _e(NaN,NaN,NaN,0):null}function tp(e){return new _e(e>>16&255,e>>8&255,e&255,1)}function Ea(e,t,n,r){return r<=0&&(e=t=n=NaN),new _e(e,t,n,r)}function KT(e){return e instanceof Qi||(e=On(e)),e?(e=e.rgb(),new _e(e.r,e.g,e.b,e.opacity)):new _e}function tc(e,t,n,r){return arguments.length===1?KT(e):new _e(e,t,n,r??1)}function _e(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Jl(_e,tc,Xd(Qi,{brighter(e){return e=e==null?_a:Math.pow(_a,e),new _e(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ji:Math.pow(Ji,e),new _e(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _e(yr(this.r),yr(this.g),yr(this.b),Ta(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:ep,formatHex:ep,formatHex8:QT,formatRgb:np,toString:np}));function ep(){return`#${xr(this.r)}${xr(this.g)}${xr(this.b)}`}function QT(){return`#${xr(this.r)}${xr(this.g)}${xr(this.b)}${xr((isNaN(this.opacity)?1:this.opacity)*255)}`}function np(){const e=Ta(this.opacity);return`${e===1?"rgb(":"rgba("}${yr(this.r)}, ${yr(this.g)}, ${yr(this.b)}${e===1?")":`, ${e})`}`}function Ta(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xr(e){return e=yr(e),(e<16?"0":"")+e.toString(16)}function rp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Je(e,t,n,r)}function ip(e){if(e instanceof Je)return new Je(e.h,e.s,e.l,e.opacity);if(e instanceof Qi||(e=On(e)),!e)return new Je;if(e instanceof Je)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 Je(a,o,l,e.opacity)}function sp(e,t,n,r){return arguments.length===1?ip(e):new Je(e,t,n,r??1)}function Je(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jl(Je,sp,Xd(Qi,{brighter(e){return e=e==null?_a:Math.pow(_a,e),new Je(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ji:Math.pow(Ji,e),new Je(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 _e(ec(e>=240?e-240:e+120,i,r),ec(e,i,r),ec(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Je(ap(this.h),Oa(this.s),Oa(this.l),Ta(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=Ta(this.opacity);return`${e===1?"hsl(":"hsla("}${ap(this.h)}, ${Oa(this.s)*100}%, ${Oa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ap(e){return e=(e||0)%360,e<0?e+360:e}function Oa(e){return Math.max(0,Math.min(1,e||0))}function ec(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 nc=e=>()=>e;function JT(e,t){return function(n){return e+n*t}}function tO(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 eO(e){return(e=+e)==1?op:function(t,n){return n-t?tO(t,n,e):nc(isNaN(t)?n:t)}}function op(e,t){var n=t-e;return n?JT(e,n):nc(isNaN(e)?t:e)}const Sa=function e(t){var n=eO(t);function r(i,s){var a=n((i=tc(i)).r,(s=tc(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=op(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 nO(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 rO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function iO(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]=es(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 sO(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ae(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function aO(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]=es(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var rc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ic=new RegExp(rc.source,"g");function oO(e){return function(){return e}}function lO(e){return function(t){return e(t)+""}}function lp(e,t){var n=rc.lastIndex=ic.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=rc.exec(e))&&(i=ic.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:Ae(r,i)})),n=ic.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?lO(l[0].x):oO(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 es(e,t){var n=typeof t,r;return t==null||n==="boolean"?nc(t):(n==="number"?Ae:n==="string"?(r=On(t))?(t=r,Sa):lp:t instanceof On?Sa:t instanceof Date?sO:rO(t)?nO:Array.isArray(t)?iO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?aO:Ae)(e,t)}function cp(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var up=180/Math.PI,hp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dp(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)*up,skewX:Math.atan(l)*up,scaleX:a,scaleY:o}}var wa;function cO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?hp:dp(t.a,t.b,t.c,t.d,t.e,t.f)}function uO(e){return e==null||(wa||(wa=document.createElementNS("http://www.w3.org/2000/svg","g")),wa.setAttribute("transform",e),!(e=wa.transform.baseVal.consolidate()))?hp:(e=e.matrix,dp(e.a,e.b,e.c,e.d,e.e,e.f))}function pp(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 v=p.push("translate(",null,t,null,n);f.push({i:v-4,x:Ae(c,d)},{i:v-2,x:Ae(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:Ae(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:Ae(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,p,f){if(c!==d||u!==h){var v=p.push(i(p)+"scale(",null,",",null,")");f.push({i:v-4,x:Ae(c,d)},{i:v-2,x:Ae(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,v=h.length,m;++f<v;)d[(m=h[f]).i]=m.x(p);return d.join("")}}}var hO=pp(cO,"px, ","px)","deg)"),dO=pp(uO,", ",")",")"),Qr=0,ns=0,rs=0,fp=1e3,$a,is,Ma=0,br=0,Ca=0,ss=typeof performance=="object"&&performance.now?performance:Date,mp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sc(){return br||(mp(pO),br=ss.now()+Ca)}function pO(){br=0}function Aa(){this._call=this._time=this._next=null}Aa.prototype=gp.prototype={constructor:Aa,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?sc():+n)+(t==null?0:+t),!this._next&&is!==this&&(is?is._next=this:$a=this,is=this),this._call=e,this._time=n,ac()},stop:function(){this._call&&(this._call=null,this._time=1/0,ac())}};function gp(e,t,n){var r=new Aa;return r.restart(e,t,n),r}function fO(){sc(),++Qr;for(var e=$a,t;e;)(t=br-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qr}function vp(){br=(Ma=ss.now())+Ca,Qr=ns=0;try{fO()}finally{Qr=0,gO(),br=0}}function mO(){var e=ss.now(),t=e-Ma;t>fp&&(Ca-=t,Ma=e)}function gO(){for(var e,t=$a,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:$a=n);is=e,ac(r)}function ac(e){if(!Qr){ns&&(ns=clearTimeout(ns));var t=e-br;t>24?(e<1/0&&(ns=setTimeout(vp,e-ss.now()-Ca)),rs&&(rs=clearInterval(rs))):(rs||(Ma=ss.now(),rs=setInterval(mO,fp)),Qr=1,mp(vp))}}function yp(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 vO=Zl("start","end","cancel","interrupt"),yO=[],xp=0,bp=1,oc=2,ka=3,_p=4,lc=5,La=6;function Ra(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;xO(e,n,{name:t,index:r,group:i,on:vO,tween:yO,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:xp})}function cc(e,t){var n=tn(e,t);if(n.state>xp)throw new Error("too late; already scheduled");return n}function pn(e,t){var n=tn(e,t);if(n.state>ka)throw new Error("too late; already running");return n}function tn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function xO(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=gp(s,0,n.time);function s(c){n.state=bp,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!==bp)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===ka)return yp(a);p.state===_p?(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(yp(function(){n.state===ka&&(n.state=_p,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=oc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===oc){for(n.state=ka,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=lc,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===lc&&(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 uc(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>oc&&r.state<lc,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 bO(e){return this.each(function(){uc(this,e)})}function _O(e,t){var n,r;return function(){var i=pn(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 EO(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=pn(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 TO(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=tn(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?_O:EO)(n,e,t))}function hc(e,t,n){var r=e._id;return e.each(function(){var i=pn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return tn(i,r).value[t]}}function Ep(e,t){var n;return(typeof t=="number"?Ae:t instanceof On?Sa:(n=On(t))?(t=n,Sa):lp)(e,t)}function OO(e){return function(){this.removeAttribute(e)}}function SO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wO(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 $O(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 MO(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 CO(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 AO(e,t){var n=xa(e),r=n==="transform"?dO:Ep;return this.attrTween(e,typeof t=="function"?(n.local?CO:MO)(n,r,hc(this,"attr."+e,t)):t==null?(n.local?SO:OO)(n):(n.local?$O:wO)(n,r,t))}function kO(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function LO(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function RO(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&LO(e,s)),n}return i._value=t,i}function DO(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&kO(e,s)),n}return i._value=t,i}function IO(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=xa(e);return this.tween(n,(r.local?RO:DO)(r,t))}function NO(e,t){return function(){cc(this,e).delay=+t.apply(this,arguments)}}function PO(e,t){return t=+t,function(){cc(this,e).delay=t}}function UO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?NO:PO)(t,e)):tn(this.node(),t).delay}function BO(e,t){return function(){pn(this,e).duration=+t.apply(this,arguments)}}function HO(e,t){return t=+t,function(){pn(this,e).duration=t}}function VO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BO:HO)(t,e)):tn(this.node(),t).duration}function FO(e,t){if(typeof t!="function")throw new Error;return function(){pn(this,e).ease=t}}function GO(e){var t=this._id;return arguments.length?this.each(FO(t,e)):tn(this.node(),t).ease}function zO(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pn(this,e).ease=n}}function jO(e){if(typeof e!="function")throw new Error;return this.each(zO(this._id,e))}function WO(e){typeof e!="function"&&(e=Hd(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 Sn(r,this._parents,this._name,this._id)}function qO(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 Sn(a,this._parents,this._name,this._id)}function YO(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 ZO(e,t,n){var r,i,s=YO(t)?cc:pn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function XO(e,t){var n=this._id;return arguments.length<2?tn(this.node(),n).on.on(e):this.each(ZO(n,e,t))}function KO(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function QO(){return this.on("end.remove",KO(this._id))}function JO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kl(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,Ra(c[h],t,n,h,c,tn(u,n)));return new Sn(s,this._parents,t,n)}function tS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Bd(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=tn(u,n),v=0,m=h.length;v<m;++v)(p=h[v])&&Ra(p,t,n,v,h,f);s.push(h),a.push(u)}return new Sn(s,a,t,n)}var eS=Ki.prototype.constructor;function nS(){return new eS(this._groups,this._parents)}function rS(e,t){var n,r,i;return function(){var s=Xr(this,e),a=(this.style.removeProperty(e),Xr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Tp(e){return function(){this.style.removeProperty(e)}}function iS(e,t,n){var r,i=n+"",s;return function(){var a=Xr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function sS(e,t,n){var r,i,s;return function(){var a=Xr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Xr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function aS(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=pn(this,e),c=l.on,u=l.value[s]==null?o||(o=Tp(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function oS(e,t,n){var r=(e+="")=="transform"?hO:Ep;return t==null?this.styleTween(e,rS(e,r)).on("end.style."+e,Tp(e)):typeof t=="function"?this.styleTween(e,sS(e,r,hc(this,"style."+e,t))).each(aS(this._id,e)):this.styleTween(e,iS(e,r,t),n).on("end.style."+e,null)}function lS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function cS(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&lS(e,a,n)),r}return s._value=t,s}function uS(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,cS(e,t,n??""))}function hS(e){return function(){this.textContent=e}}function dS(e){return function(){var t=e(this);this.textContent=t??""}}function pS(e){return this.tween("text",typeof e=="function"?dS(hc(this,"text",e)):hS(e==null?"":e+""))}function fS(e){return function(t){this.textContent=e.call(this,t)}}function mS(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&fS(i)),t}return r._value=e,r}function gS(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,mS(e))}function vS(){for(var e=this._name,t=this._id,n=Op(),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=tn(l,t);Ra(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Sn(r,this._parents,e,n)}function yS(){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=pn(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 xS=0;function Sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Op(){return++xS}var wn=Ki.prototype;Sn.prototype={constructor:Sn,select:JO,selectAll:tS,selectChild:wn.selectChild,selectChildren:wn.selectChildren,filter:WO,merge:qO,selection:nS,transition:vS,call:wn.call,nodes:wn.nodes,node:wn.node,size:wn.size,empty:wn.empty,each:wn.each,on:XO,attr:AO,attrTween:IO,style:oS,styleTween:uS,text:pS,textTween:gS,remove:QO,tween:TO,delay:UO,duration:VO,ease:GO,easeVarying:jO,end:yS,[Symbol.iterator]:wn[Symbol.iterator]};function Sp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var bS={time:null,delay:0,duration:250,ease:Sp};function _S(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 ES(e){var t,n;e instanceof Sn?(t=e._id,e=e._name):(t=Op(),(n=bS).time=sc(),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])&&Ra(l,e,t,c,a,n||_S(l,t));return new Sn(r,this._parents,e,t)}Ki.prototype.interrupt=bO,Ki.prototype.transition=ES;function TS(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Da(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 Jr(e){return e=Da(Math.abs(e)),e?e[1]:NaN}function OS(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 SS(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var wS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function as(e){if(!(t=wS.exec(e)))throw new Error("invalid format: "+e);var t;return new dc({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]})}as.prototype=dc.prototype;function dc(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+""}dc.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 $S(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 wp;function MS(e,t){var n=Da(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(wp=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")+Da(e,Math.max(0,t+s-1))[0]}function $p(e,t){var n=Da(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 Mp={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:TS,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)=>$p(e*100,t),r:$p,s:MS,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Cp(e){return e}var Ap=Array.prototype.map,kp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function CS(e){var t=e.grouping===void 0||e.thousands===void 0?Cp:OS(Ap.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:SS(Ap.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=as(d);var h=d.fill,p=d.align,f=d.sign,v=d.symbol,m=d.zero,y=d.width,g=d.comma,b=d.precision,T=d.trim,E=d.type;E==="n"?(g=!0,E="g"):Mp[E]||(b===void 0&&(b=12),T=!0,E="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var O=v==="$"?n:v==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",A=v==="$"?r:/[%p]/.test(E)?a:"",I=Mp[E],L=/[defgprs%]/.test(E);b=b===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function R($){var F=O,P=A,H,_,C;if(E==="c")P=I($)+P,$="";else{$=+$;var k=$<0||1/$<0;if($=isNaN($)?l:I(Math.abs($),b),T&&($=$S($)),k&&+$==0&&f!=="+"&&(k=!1),F=(k?f==="("?f:o:f==="-"||f==="("?"":f)+F,P=(E==="s"?kp[8+wp/3]:"")+P+(k&&f==="("?")":""),L){for(H=-1,_=$.length;++H<_;)if(C=$.charCodeAt(H),48>C||C>57){P=(C===46?i+$.slice(H+1):$.slice(H))+P,$=$.slice(0,H);break}}}g&&!m&&($=t($,1/0));var U=F.length+$.length+P.length,B=U<y?new Array(y-U+1).join(h):"";switch(g&&m&&($=t(B+$,B.length?y-P.length:1/0),B=""),p){case"<":$=F+$+P+B;break;case"=":$=F+B+$+P;break;case"^":$=B.slice(0,U=B.length>>1)+F+$+P+B.slice(U);break;default:$=B+F+$+P;break}return s($)}return R.toString=function(){return d+""},R}function u(d,h){var p=c((d=as(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Jr(h)/3)))*3,v=Math.pow(10,-f),m=kp[8+f/3];return function(y){return p(v*y)+m}}return{format:c,formatPrefix:u}}var Ia,pc,Lp;AS({thousands:",",grouping:[3],currency:["$",""]});function AS(e){return Ia=CS(e),pc=Ia.format,Lp=Ia.formatPrefix,Ia}function kS(e){return Math.max(0,-Jr(Math.abs(e)))}function LS(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jr(t)/3)))*3-Jr(Math.abs(e)))}function RS(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jr(t)-Jr(e))+1}function ti(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Rp=Symbol("implicit");function Na(){var e=new Dd,t=[],n=[],r=Rp;function i(s){let a=e.get(s);if(a===void 0){if(r!==Rp)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 Dd;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 Na(t,n).unknown(r)},ti.apply(i,arguments),i}function DS(e){return function(){return e}}function IS(e){return+e}var Dp=[0,1];function ei(e){return e}function fc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:DS(isNaN(t)?NaN:.5)}function NS(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function PS(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=fc(i,r),s=n(a,s)):(r=fc(r,i),s=n(s,a)),function(o){return s(r(o))}}function US(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]=fc(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=ql(e,o,1,r)-1;return s[l](i[l](o))}}function mc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ip(){var e=Dp,t=Dp,n=es,r,i,s,a=ei,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==ei&&(a=NS(e[0],e[h-1])),o=h>2?US:PS,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),Ae)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,IS),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=cp,u()},d.clamp=function(h){return arguments.length?(a=h?!0:ei,u()):a!==ei},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 Np(){return Ip()(ei,ei)}function BS(e,t,n,r){var i=Yl(e,t,n),s;switch(r=as(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=LS(i,a))&&(r.precision=s),Lp(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=RS(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=kS(i))&&(r.precision=s-(r.type==="%")*2);break}}return pc(r)}function Pp(e){var t=e.domain;return e.ticks=function(n){var r=t();return va(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return BS(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=Zr(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 en(){var e=Np();return e.copy=function(){return mc(e,en())},ti.apply(e,arguments),Pp(e)}function gc(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[ql(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 gc().domain([e,t]).range(i).unknown(s)},ti.apply(Pp(a),arguments)}function os(e,t,n){this.k=e,this.x=t,this.y=n}os.prototype={constructor:os,scale:function(e){return e===1?this:new os(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new os(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+")"}},os.prototype;const Ee="cds",$n={opacity:{unselected:.05,selected:.4}},qn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},ni={duration:1e3,ease:Sp,zoomLevel:3},ri={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},Up={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ge={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},HS={defaultBins:10},qt={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}},Mn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},ae={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Ht={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}},_r={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},nn={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Bp={minCellDividerDimension:16,chartPadding:.5},Hp={default:{size:24}},Vp={defaultOffset:4,horizontalOffset:10},Fp={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}},ke={height:{[Ye.GRAPH_VIEW]:32,[Ye.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},VS=[{type:ee.RADIUS,name:"Radius"},{type:ee.AREA,name:"Poor area"},{type:ee.AREA,name:"Satisfactory area"},{type:ee.AREA,name:"Great area"},{type:ee.QUARTILE,name:"Quartiles"}],ii={type:Ue.END_LINE,threshold:16,numCharacter:14},FS={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"}}},GS={enabled:!0,position:Vr.BOTTOM,clickable:!0,truncation:ii,alignment:Jt.LEFT,order:null,additionalItems:[]},zS={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},jS={enabled:!0},Gp={enabled:!0,showTotal:!0,truncation:ii,groupLabel:"Group"},zp={top:{visible:!0,includeZero:!0,truncation:ii},bottom:{visible:!0,includeZero:!0,truncation:ii},left:{visible:!0,includeZero:!0,truncation:ii},right:{visible:!0,includeZero:!0,truncation:ii}},Pa={addSpaceOnEdges:1,showDayName:!1,localeObject:Oh,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 jp=!1;try{jp=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const ue={width:null,height:null,resizable:!0,theme:xl.WHITE,tooltip:Gp,legend:GS,locale:FS,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:St.SHOW_AS_DATATABLE},...jp?[{type:St.MAKE_FULLSCREEN}]:[],{type:St.EXPORT_CSV},{type:St.EXPORT_PNG},{type:St.EXPORT_JPG}]}},Wp=ct({},ue,{thematic:{projection:un.geoNaturalEarth1}}),ls=ct({},ue,{axes:zp,timeScale:Pa,grid:zS,ruler:jS,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ye.GRAPH_VIEW}}}),Er=ct({},ls,{bars:{maxWidth:16,spacingFactor:.25},timeScale:ct(Pa,{addSpaceOnEdges:1})}),WS=ct({},Er,{}),qS=ct({},Er,{}),YS=ct({},Er,{bars:ct({},Er.bars,{dividerSize:1.5})}),ZS=ct({},Er,{}),vc=ct({},ls,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),XS=vc,qp=ct({},vc,{points:{radius:3,filled:!1,enabled:!0}}),Yp=ct({},qp,{timeScale:ct(Pa,{addSpaceOnEdges:0})}),KS=Yp,QS=ct({},ls,{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:ee.RADIUS,name:"Radius"}]}}),JS=ct({},ls,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:ee.AREA,name:"Poor area"},{type:ee.AREA,name:"Satisfactory area"},{type:ee.AREA,name:"Great area"},{type:ee.QUARTILE,name:"Quartiles"}]}}),tw=ct({},Er,{bars:{dividerSize:1.5},timeScale:ct(Pa,{addSpaceOnEdges:0})}),ew=ct({},ue,{tooltip:ct({},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"}}),Zp=ct({},ue,{pie:{labels:{formatter:null,enabled:!0},alignment:Jt.LEFT,sortFunction:null,valueMapsTo:"value"}}),nw=ct({},ue,{legend:{enabled:!1},gauge:{type:lr.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:Jt.LEFT}}),rw=ct({},Zp,{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:Jt.LEFT}}),Xp=ct({},ue,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),iw=ct({},Xp,{legend:{enabled:!0}}),sw=ct({},ue,{radar:{axes:{angle:"key",value:"value"},alignment:Jt.LEFT},tooltip:{gridline:{enabled:!0}}}),aw=ct({},Er,{comboChartTypes:[]}),ow=ct({tree:{type:Js.TREE}},ue,{}),lw=ct({},ue,{data:ct(ue.data,{groupMapsTo:"name"})}),cw=ct({},ue,ri,{data:ct(ue.data,{groupMapsTo:"name"})}),uw=ct({},ue,{alluvial:{data:ct(ue.data,{groupMapsTo:"source"}),nodeAlignment:Jt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),hw=ct({},ue,{axes:zp,heatmap:{divider:{state:Gr.AUTO},colorLegend:{type:"linear"}}}),dw=ct({},Wp,{choropleth:{colorLegend:{type:"linear"}}}),Nt={alluvialChart:uw,areaChart:Yp,axisChart:ls,boxplotChart:ZS,bubbleChart:QS,bulletChart:JS,chart:ue,circlePackChart:cw,choroplethChart:dw,comboChart:aw,donutChart:rw,gaugeChart:nw,groupedBarChart:qS,heatmapChart:hw,histogramChart:tw,lineChart:qp,lollipopChart:XS,meterChart:Xp,pieChart:Zp,proportionalMeterChart:iw,radarChart:sw,scatterChart:vc,simpleBarChart:WS,stackedAreaChart:KS,stackedBarChart:YS,thematicChart:Wp,treeChart:ow,treemapChart:lw,wordCloudChart:ew};function pw(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=vr(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function zt(e,t){var n;const r=Tn(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===tt.TIME?a.mapsTo="date":l===tt.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return xc(r,t),ct(r,t)}function Cn(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 cs(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 yc(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 us(e,t,n){if(n>e.length)return e;if(t===Ue.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ue.FRONT_LINE)return"..."+e.substr(-n);if(t===Ue.END_LINE)return e.substr(0,n)+"..."}function xc(e,t){const n=x(e,"legend","additionalItems"),r=x(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=VS.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=Y_(a,r,"name")}}const x=(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},Kp=(e,t)=>t===Qt.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}=Kp(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function An(e,t,n){return n===Qt.VERTICAL?[e,t]:[t,e]}function Qp(e){const t=Yt(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 Jp(e,t){const n=Yt(e,void 0);return n.setHours(0,0,0,0),n}function tf(e,t,n){const[r,i]=cr(void 0,e,t),s=Jp(r),a=Jp(i),o=+s-Qp(s),l=+a-Qp(a);return Math.round((o-l)/T0)}function fw(e,t){const n=Yt(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function mw(e,t){const n=Yt(e,void 0);return tf(n,fw(n))+1}function Ua(e,t){return Ui(e,{...t,weekStartsOn:1})}function ef(e,t){const n=Yt(e,void 0),r=n.getFullYear(),i=Be(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Ua(i),a=Be(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=Ua(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function gw(e,t){const n=ef(e),r=Be(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ua(r)}function vw(e,t){const n=Yt(e,void 0),r=+Ua(n)-+gw(n);return Math.round(r/bh)+1}function nf(e,t){var n,r,i,s;const a=Yt(e,t==null?void 0:t.in),o=a.getFullYear(),l=na(),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=Be((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=Ui(u,t),h=Be((t==null?void 0:t.in)||e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=Ui(h,t);return+a>=+d?o+1:+a>=+p?o:o-1}function yw(e,t){var n,r,i,s;const a=na(),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=nf(e,t),c=Be((t==null?void 0:t.in)||e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),Ui(c,t)}function xw(e,t){const n=Yt(e,t==null?void 0:t.in),r=+Ui(n,t)-+yw(n,t);return Math.round(r/bh)+1}function At(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Yn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return At(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):At(n+1,2)},d(e,t){return At(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 At(e.getHours()%12||12,t.length)},H(e,t){return At(e.getHours(),t.length)},m(e,t){return At(e.getMinutes(),t.length)},s(e,t){return At(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return At(i,t.length)}},si={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rf={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 Yn.y(e,t)},Y:function(e,t,n,r){const i=nf(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return At(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):At(s,t.length)},R:function(e,t){const n=ef(e);return At(n,t.length)},u:function(e,t){const n=e.getFullYear();return At(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 At(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 At(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 Yn.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 At(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=xw(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):At(i,t.length)},I:function(e,t,n){const r=vw(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):At(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Yn.d(e,t)},D:function(e,t,n){const r=mw(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):At(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 At(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 At(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 At(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=si.noon:r===0?i=si.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=si.evening:r>=12?i=si.afternoon:r>=4?i=si.morning:i=si.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 Yn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Yn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):At(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):At(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Yn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Yn.s(e,t)},S:function(e,t){return Yn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return af(r);case"XXXX":case"XX":return Tr(r);case"XXXXX":case"XXX":default:return Tr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return af(r);case"xxxx":case"xx":return Tr(r);case"xxxxx":case"xxx":default:return Tr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+sf(r,":");case"OOOO":default:return"GMT"+Tr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+sf(r,":");case"zzzz":default:return"GMT"+Tr(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return At(r,t.length)},T:function(e,t,n){return At(+e,t.length)}};function sf(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+At(s,2)}function af(e,t){return e%60===0?(e>0?"-":"+")+At(Math.abs(e)/60,2):Tr(e,t)}function Tr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=At(Math.trunc(r/60),2),s=At(r%60,2);return n+i+t+s}const of=(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"})}},lf=(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"})}},bw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return of(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}}",of(r,t)).replace("{{time}}",lf(i,t))},_w={p:lf,P:bw},Ew=/^D+$/,Tw=/^Y+$/,Ow=["D","DD","YY","YYYY"];function Sw(e){return Ew.test(e)}function ww(e){return Tw.test(e)}function $w(e,t,n){const r=Mw(e,t,n);if(console.warn(r),Ow.includes(e))throw new RangeError(r)}function Mw(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 Cw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Aw(e){return!(!Cw(e)&&typeof e!="number"||isNaN(+Yt(e)))}const kw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Lw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Rw=/^'([^]*?)'?$/,Dw=/''/g,Iw=/[a-zA-Z]/;function bc(e,t,n){var r,i,s,a,o,l,c,u;const d=na(),h=(n==null?void 0:n.locale)??d.locale??Oh,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,v=Yt(e,n==null?void 0:n.in);if(!Aw(v))throw new RangeError("Invalid time value");let m=t.match(Lw).map(g=>{const b=g[0];if(b==="p"||b==="P"){const T=_w[b];return T(g,h.formatLong)}return g}).join("").match(kw).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:Nw(g)};if(rf[b])return{isToken:!0,value:g};if(b.match(Iw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});h.localize.preprocessor&&(m=h.localize.preprocessor(v,m));const y={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(g=>{if(!g.isToken)return g.value;const b=g.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&ww(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Sw(b))&&$w(b,t,String(e));const T=rf[b[0]];return T(v,b,h.localize,y)}).join("")}function Nw(e){const t=e.match(Rw);return t?t[1].replace(Dw,"'"):e}const _c=[["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 cf(e,t,n,r,i){const s=t===0,a=Number(bc(new Date(e),"c"))===2,o=Number(bc(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ha(e)||hs(e,l)||Zn(e);case"minute":return s||Ha(e)||hs(e,l)||Zn(e);case"30minutes":return s||Ha(e)||hs(e,l)||Zn(e);case"hourly":return s||Ha(e)||hs(e,l)||Zn(e);case"daily":return i?s||a||Zn(e):s||hs(e,l)||Zn(e);case"weekly":return s||a||Zn(e);case"monthly":return s||Zn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function Ec(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=x(i,"timeIntervalFormats")[o],u=x(c,"primary"),d=x(c,"secondary"),h=cf(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:v,optionsObject:m}=s,y=m[r].type,g=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!g){const b=bc(l,p,{locale:f}).split("").map(T=>{const E=Number(T);return T!==" "&&!Number.isNaN(E)?E.toLocaleString(v):T});return s[y](l,v,{},b.join(""))}else return s[y](l,v,g)}function Ba(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function Pw(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function Uw(e){const t=_c.reduce((n,[,r],i)=>{const s=_c[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return _c[t][0]}function Tc(e,t){if(xh[t])return t;if(e.length===1)return"15seconds";const n=Pw(e),r=Wn(n);return Uw(r)}function Ha(e){const{s:t,m:n,H:r}=Ba(e);return r===0&&n===0&&t===0}function hs(e,t){const n=Ba(e).M,r=Ba(t).M;return n!==r}function Zn(e){const{M:t,d:n,s:r,m:i,H:s}=Ba(e);return t===1&&n===1&&s===0&&i===0&&r===0}function uf(e){return e===void 0?"":e.toISOString()}function hf(e){const t=Qe(e,r=>r.value),n=en().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 df(e,t){const n=x(t,"gradient","colors"),r=!Ke(n);let i=x(t,"pairing","option");const s=hf(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 gc().domain(s).range(o)}var pt=(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))(pt||{});function Bw(e,t){return e&&Ad(e,t,Fi)}function Hw(e,t){return function(n,r){if(n==null)return n;if(!pr(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 Oc=Hw(Bw);function ft(e){return function(){return e}}var Vw=Array.prototype.slice;function Va(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Fw(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 Gw(e,t,n,r){return Oc(e,function(i,s,a){t(r,i,n(i),a)}),r}function zw(e,t){return function(n,r){var i=se(n)?Fw:Gw,s={};return i(n,e,ma(r),s)}}function jw(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 Ww=Object.prototype,qw=Ww.hasOwnProperty,Yw=zw(function(e,t,n){qw.call(e,n)?e[n].push(t):sa(e,n,[t])});function Zw(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Xw(e){return e}function Kw(e=mr){if(e===mr)return pf;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 pf(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Qw=Array.prototype,Jw=Qw.slice;function Sc(e){return()=>e}function t$(e,t,n){let r;for(;;){const i=Zr(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 e$(e){return Math.max(1,Math.ceil(Math.log(Zw(e))/Math.LN2)+1)}function n$(){var e=Xw,t=Qe,n=e$;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 b=h,T=+p;if(t===Qe&&([d,h]=t$(d,h,T)),p=va(d,h,T),p[0]<=d&&(l=Zr(d,h,T)),p[p.length-1]>=h)if(b>=h&&t===Qe){const E=Zr(d,h,T);isFinite(E)&&(E>0?h=(Math.floor(h/E)+1)*E:E<0&&(h=(Math.ceil(h*-E)+1)/-E))}else p.pop()}for(var f=p.length,v=0,m=f;p[v]<=d;)++v;for(;p[m-1]>h;)--m;(v||m<f)&&(p=p.slice(v,m),f=m-v);var y=new Array(f+1),g;for(s=0;s<=f;++s)g=y[s]=[],g.x0=s>0?p[s-1]:d,g.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&&y[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 b=Math.floor((d-o)*l);y[Math.min(f,b+(p[b]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&y[ql(p,o,0,f)].push(i[s]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Sc(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Sc([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Sc(Array.isArray(i)?Jw.call(i):i),r):n},r}function ff(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?pf:Kw(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));ff(e,t,p,f,i)}const s=e[t];let a=n,o=r;for(ds(e,n,t),i(e[r],s)>0&&ds(e,n,r);a<o;){for(ds(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?ds(e,n,o):(++o,ds(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function ds(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function wc(e,t,n){if(e=Float64Array.from(Q_(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Wn(e);if(t>=1)return gr(e);var r,i=(r-1)*t,s=Math.floor(i),a=gr(ff(e,s).subarray(0,s+1)),o=Wn(e.subarray(s+1));return a+(o-a)*(i-s)}}function mf(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 gf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function r$(e,t){return e[t]}function i$(e){const t=[];return t.key=e,t}function $c(){var e=ft([]),t=gf,n=mf,r=r$;function i(s){var a=Array.from(e.apply(this,arguments),i$),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:ft(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ft(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?gf:typeof s=="function"?s:ft(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??mf,i):n},i}function s$(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 a$(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class fn{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}=x(r,"locale"),o=x(r,"tabularRepModal","tableHeadingFormatter"),l=x(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===tt.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}=x(n,"data"),a=x(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===tt.LINEAR||c===tt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===tt.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}=qt.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(Tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return x(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=qt.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 Yw(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=HS.defaultBins}=s,l=Array.isArray(o),c=n$().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}`,v=this.aggregateBinDataByGroup(p);d.forEach(m=>{h.push({group:m,key:f,value:v[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 $c().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=Xi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?uf(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===tt.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===tt.LOG||o===tt.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?uf(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=jw(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?$c().offset(s$):$c()).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();xc(n,t),this.set({options:ct(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(S.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=qt.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(S.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=x(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=x(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=x(s,"label");if(c===null){const d=x(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==="–"?"–":a).split(/[,;'"`]/).map(o=>a$(o)).join("")}"`)).map(s=>s.join(",")).join(`
|
|
2
|
-
`),n=this.getOptions();let r="myChart";const i=x(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}=qt.items.status,s=this.getOptions(),a=Xi(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=x(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=x(this.getOptions(),"color","pairing");let n=x(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=x(t,"option");const i=Up.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=Na().range(o).domain(this.allDataGroups)}}class Or extends fn{constructor(t){super(t),this.axisFlavor=Ii.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:x(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}=x(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?"–":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"–":l(h[s.identifier],c),...a?[h[a.identifier]===null?"–":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"–":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",G.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",G.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(Tn(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=Xi(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(G).forEach(i=>{const s=G[i],a=n.axes[s];if(a&&a.scaleType===tt.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{x(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let o$=class extends Or{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(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?"–":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}};class l$ extends Or{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:wc(t,.25),q_50:wc(t,.5),q_75:wc(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(b=>b[o]).sort(mr),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,v=[],m=[];for(const b of l)b<p||b>f?v.push(b):m.push(b);c.outliers=v;const y=Wn(m),g=gr(m);c.whiskers={min:y||Wn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:g||gr([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}=x(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=x(l,"outliers");return(c===null||c.length===0)&&(c=["–"]),[l[n],x(l,"whiskers","min")!==null?i(x(l,"whiskers","min"),s):"–",x(l,"quartiles","q_25")!==null?i(x(l,"quartiles","q_25"),s):"–",x(l,"quartiles","q_50")!==null?i(x(l,"quartiles","q_50"),s):"–",x(l,"quartiles","q_75")!==null?i(x(l,"quartiles","q_75"),s):"–",x(l,"whiskers","max")!==null?i(x(l,"whiskers","max"),s):"–",x(l,"quartiles","q_75")!==null&&x(l,"quartiles","q_25")!==null?(i(x(l,"quartiles","q_75")-x(l,"quartiles","q_25")),s):"–",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"option");const r=Up.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Na().range(i).domain(this.allDataGroups)}}let c$=class extends Or{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}=x(n,"locale"),o=x(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"–":s(u.value,a),x(u,"marker")===null?"–":s(u.marker,a),x(u,"marker")===null?"–":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}},u$=class extends fn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ke(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ke(n)&&!Ke(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}=x(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"–":a.id,a.name,a.value===null?"–":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=df(this.getDisplayData(),t)}},h$=class extends fn{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=ct({},t,this.getZoomOptions(t));xc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","depth");this.set({options:ct(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&&x(n,0,"children")?x(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}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:ee.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}=x(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(["–",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=x(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}},d$=class extends fn{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}=x(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"–":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}};class p$ extends fn{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}=x(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class f$ extends Or{constructor(t){super(t),this.axisFlavor=Ii.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==tt.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==tt.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==tt.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==tt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Qe(this.getDisplayData(),r=>r.value),n=en().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(Ke(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(Ke(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(Ke(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]=Tn(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(Tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ke(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}=x(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[r.identifier]===null?"–":l[r.identifier],l.value===null?"–":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=x(t,"color","gradient","colors"),r=!Ke(n);let i=x(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=gc().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=df(this.getDisplayData(),l)}}let m$=class extends Or{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=x(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 g$ extends fn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(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=x(n,"meter","proportional"),{number:a,code:o}=x(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?"–":a(d.value,o),...i?[i]:[]]]}else u=x(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?"–":a(p,o),a(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}}class v$ extends Or{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),{number:s,code:a}=x(t,"locale"),o=x(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>x(u,"data",h,i)!==null?s(x(u,"data",h,i),a):"–")])];return super.formatTable({headers:l,cells:c})}}let y$=class extends fn{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,"–"])}),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])})}},x$=class extends fn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(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?"–":n(o.value,r)])}):x(a.name)!==null&&x(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}};class b$ extends fn{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}=x(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 _$=/\s/;function E$(e){for(var t=e.length;t--&&_$.test(e.charAt(t)););return t}var T$=/^\s+/;function O$(e){return e&&e.slice(0,E$(e)+1).replace(T$,"")}var vf=NaN,S$=/^[-+]0x[0-9a-f]+$/i,w$=/^0b[01]+$/i,$$=/^0o[0-7]+$/i,M$=parseInt;function ai(e){if(typeof e=="number")return e;if(ra(e))return vf;if(Ve(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ve(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=O$(e);var n=w$.test(e);return n||$$.test(e)?M$(e.slice(2),n?2:8):S$.test(e)?vf:+e}var Mc=function(){return Ze.Date.now()},C$="Expected a function",A$=Math.max,k$=Math.min;function Fa(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(C$);t=ai(t)||0,Ve(n)&&(u=!!n.leading,d="maxWait"in n,s=d?A$(ai(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(O){var A=r,I=i;return r=i=void 0,c=O,a=e.apply(I,A),a}function f(O){return c=O,o=setTimeout(y,t),u?p(O):a}function v(O){var A=O-l,I=O-c,L=t-A;return d?k$(L,s-I):L}function m(O){var A=O-l,I=O-c;return l===void 0||A>=t||A<0||d&&I>=s}function y(){var O=Mc();if(m(O))return g(O);o=setTimeout(y,v(O))}function g(O){return o=void 0,h&&r?p(O):(r=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function T(){return o===void 0?a:g(Mc())}function E(){var O=Mc(),A=m(O);if(r=arguments,i=this,l=O,A){if(o===void 0)return f(l);if(d)return clearTimeout(o),o=setTimeout(y,t),p(l)}return o===void 0&&(o=setTimeout(y,t)),a}return E.cancel=b,E.flush=T,E}function L$(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 D(e){return typeof e=="string"?new Ce([[document.querySelector(e)]],[document.documentElement]):new Ce([[e]],Zd)}function ps(){var e=Na().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,v=p?r:i;s=(v-f)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),f+=(v-f-s*(h-l))*u,a=s*(1-l),o&&(f=Math.round(f),a=Math.round(a));var m=L$(h).map(function(y){return f+s*y});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 ps(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},ti.apply(d(),arguments)}function yf(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 Cc=new Date,Ac=new Date;function re(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=>re(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)=>(Cc.setTime(+s),Ac.setTime(+a),e(Cc),e(Ac),Math.floor(n(Cc,Ac))),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 Ga=re(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ga.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?re(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ga),Ga.range;const kn=1e3,ze=kn*60,Ln=ze*60,Rn=Ln*24,kc=Rn*7,xf=Rn*30,Lc=Rn*365,oi=re(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*kn)},(e,t)=>(t-e)/kn,e=>e.getUTCSeconds());oi.range;const Rc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kn)},(e,t)=>{e.setTime(+e+t*ze)},(e,t)=>(t-e)/ze,e=>e.getMinutes());Rc.range,re(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ze)},(e,t)=>(t-e)/ze,e=>e.getUTCMinutes()).range;const Dc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kn-e.getMinutes()*ze)},(e,t)=>{e.setTime(+e+t*Ln)},(e,t)=>(t-e)/Ln,e=>e.getHours());Dc.range,re(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ln)},(e,t)=>(t-e)/Ln,e=>e.getUTCHours()).range;const fs=re(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ze)/Rn,e=>e.getDate()-1);fs.range;const Ic=re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Rn,e=>e.getUTCDate()-1);Ic.range,re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Rn,e=>Math.floor(e/Rn)).range;function Sr(e){return re(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())*ze)/kc)}const za=Sr(0),ja=Sr(1),R$=Sr(2),D$=Sr(3),li=Sr(4),I$=Sr(5),N$=Sr(6);za.range,ja.range,R$.range,D$.range,li.range,I$.range,N$.range;function wr(e){return re(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)/kc)}const bf=wr(0),Wa=wr(1),P$=wr(2),U$=wr(3),ci=wr(4),B$=wr(5),H$=wr(6);bf.range,Wa.range,P$.range,U$.range,ci.range,B$.range,H$.range;const Nc=re(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());Nc.range,re(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 Dn=re(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());Dn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(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)}),Dn.range;const $r=re(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());$r.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(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)}),$r.range;function V$(e,t,n,r,i,s){const a=[[oi,1,kn],[oi,5,5*kn],[oi,15,15*kn],[oi,30,30*kn],[s,1,ze],[s,5,5*ze],[s,15,15*ze],[s,30,30*ze],[i,1,Ln],[i,3,3*Ln],[i,6,6*Ln],[i,12,12*Ln],[r,1,Rn],[r,2,2*Rn],[n,1,kc],[t,1,xf],[t,3,3*xf],[e,1,Lc]];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=Wl(([,,m])=>m).right(a,h);if(p===a.length)return e.every(Yl(c/Lc,u/Lc,d));if(p===0)return Ga.every(Math.max(Yl(c,u,d),1));const[f,v]=a[h/a[p-1][2]<a[p][2]/h?p-1:p];return f.every(v)}return[o,l]}const[F$,G$]=V$(Dn,Nc,za,fs,Dc,Rc);function Pc(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 Uc(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 ms(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function z$(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=gs(i),u=vs(i),d=gs(s),h=vs(s),p=gs(a),f=vs(a),v=gs(o),m=vs(o),y=gs(l),g=vs(l),b={a:k,A:U,b:B,B:X,c:null,d:wf,e:wf,f:pM,g:TM,G:SM,H:uM,I:hM,j:dM,L:$f,m:fM,M:mM,p:Y,q:ot,Q:Rf,s:Df,S:gM,u:vM,U:yM,V:xM,w:bM,W:_M,x:null,X:null,y:EM,Y:OM,Z:wM,"%":Lf},T={a:it,A:bt,b:st,B:K,c:null,d:Cf,e:Cf,f:AM,g:HM,G:FM,H:$M,I:MM,j:CM,L:Af,m:kM,M:LM,p:et,q:mt,Q:Rf,s:Df,S:RM,u:DM,U:IM,V:NM,w:PM,W:UM,x:null,X:null,y:BM,Y:VM,Z:GM,"%":Lf},E={a:R,A:$,b:F,B:P,c:H,d:Of,e:Of,f:aM,g:Tf,G:Ef,H:Sf,I:Sf,j:nM,L:sM,m:eM,M:rM,p:L,q:tM,Q:lM,s:cM,S:iM,u:Z$,U:X$,V:K$,w:Y$,W:Q$,x:_,X:C,y:Tf,Y:Ef,Z:J$,"%":oM};b.x=O(n,b),b.X=O(r,b),b.c=O(t,b),T.x=O(n,T),T.X=O(r,T),T.c=O(t,T);function O(q,J){return function(dt){var z=[],Dt=-1,gt=0,Wt=q.length,Gt,nt,$t;for(dt instanceof Date||(dt=new Date(+dt));++Dt<Wt;)q.charCodeAt(Dt)===37&&(z.push(q.slice(gt,Dt)),(nt=_f[Gt=q.charAt(++Dt)])!=null?Gt=q.charAt(++Dt):nt=Gt==="e"?" ":"0",($t=J[Gt])&&(Gt=$t(dt,nt)),z.push(Gt),gt=Dt+1);return z.push(q.slice(gt,Dt)),z.join("")}}function A(q,J){return function(dt){var z=ms(1900,void 0,1),Dt=I(z,q,dt+="",0),gt,Wt;if(Dt!=dt.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(J&&!("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?(gt=Uc(ms(z.y,0,1)),Wt=gt.getUTCDay(),gt=Wt>4||Wt===0?Wa.ceil(gt):Wa(gt),gt=Ic.offset(gt,(z.V-1)*7),z.y=gt.getUTCFullYear(),z.m=gt.getUTCMonth(),z.d=gt.getUTCDate()+(z.w+6)%7):(gt=Pc(ms(z.y,0,1)),Wt=gt.getDay(),gt=Wt>4||Wt===0?ja.ceil(gt):ja(gt),gt=fs.offset(gt,(z.V-1)*7),z.y=gt.getFullYear(),z.m=gt.getMonth(),z.d=gt.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),Wt="Z"in z?Uc(ms(z.y,0,1)).getUTCDay():Pc(ms(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(Wt+5)%7:z.w+z.U*7-(Wt+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,Uc(z)):Pc(z)}}function I(q,J,dt,z){for(var Dt=0,gt=J.length,Wt=dt.length,Gt,nt;Dt<gt;){if(z>=Wt)return-1;if(Gt=J.charCodeAt(Dt++),Gt===37){if(Gt=J.charAt(Dt++),nt=E[Gt in _f?J.charAt(Dt++):Gt],!nt||(z=nt(q,dt,z))<0)return-1}else if(Gt!=dt.charCodeAt(z++))return-1}return z}function L(q,J,dt){var z=c.exec(J.slice(dt));return z?(q.p=u.get(z[0].toLowerCase()),dt+z[0].length):-1}function R(q,J,dt){var z=p.exec(J.slice(dt));return z?(q.w=f.get(z[0].toLowerCase()),dt+z[0].length):-1}function $(q,J,dt){var z=d.exec(J.slice(dt));return z?(q.w=h.get(z[0].toLowerCase()),dt+z[0].length):-1}function F(q,J,dt){var z=y.exec(J.slice(dt));return z?(q.m=g.get(z[0].toLowerCase()),dt+z[0].length):-1}function P(q,J,dt){var z=v.exec(J.slice(dt));return z?(q.m=m.get(z[0].toLowerCase()),dt+z[0].length):-1}function H(q,J,dt){return I(q,t,J,dt)}function _(q,J,dt){return I(q,n,J,dt)}function C(q,J,dt){return I(q,r,J,dt)}function k(q){return a[q.getDay()]}function U(q){return s[q.getDay()]}function B(q){return l[q.getMonth()]}function X(q){return o[q.getMonth()]}function Y(q){return i[+(q.getHours()>=12)]}function ot(q){return 1+~~(q.getMonth()/3)}function it(q){return a[q.getUTCDay()]}function bt(q){return s[q.getUTCDay()]}function st(q){return l[q.getUTCMonth()]}function K(q){return o[q.getUTCMonth()]}function et(q){return i[+(q.getUTCHours()>=12)]}function mt(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var J=O(q+="",b);return J.toString=function(){return q},J},parse:function(q){var J=A(q+="",!1);return J.toString=function(){return q},J},utcFormat:function(q){var J=O(q+="",T);return J.toString=function(){return q},J},utcParse:function(q){var J=A(q+="",!0);return J.toString=function(){return q},J}}}var _f={"-":"",_:" ",0:"0"},ie=/^\s*\d+/,j$=/^%/,W$=/[\\^$*+?|[\]().{}]/g;function Ot(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 q$(e){return e.replace(W$,"\\$&")}function gs(e){return new RegExp("^(?:"+e.map(q$).join("|")+")","i")}function vs(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Y$(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Z$(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function X$(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function K$(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Q$(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ef(e,t,n){var r=ie.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Tf(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function J$(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 tM(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function eM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Of(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function nM(e,t,n){var r=ie.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=ie.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function rM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function iM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function sM(e,t,n){var r=ie.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function aM(e,t,n){var r=ie.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function oM(e,t,n){var r=j$.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function lM(e,t,n){var r=ie.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function cM(e,t,n){var r=ie.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function wf(e,t){return Ot(e.getDate(),t,2)}function uM(e,t){return Ot(e.getHours(),t,2)}function hM(e,t){return Ot(e.getHours()%12||12,t,2)}function dM(e,t){return Ot(1+fs.count(Dn(e),e),t,3)}function $f(e,t){return Ot(e.getMilliseconds(),t,3)}function pM(e,t){return $f(e,t)+"000"}function fM(e,t){return Ot(e.getMonth()+1,t,2)}function mM(e,t){return Ot(e.getMinutes(),t,2)}function gM(e,t){return Ot(e.getSeconds(),t,2)}function vM(e){var t=e.getDay();return t===0?7:t}function yM(e,t){return Ot(za.count(Dn(e)-1,e),t,2)}function Mf(e){var t=e.getDay();return t>=4||t===0?li(e):li.ceil(e)}function xM(e,t){return e=Mf(e),Ot(li.count(Dn(e),e)+(Dn(e).getDay()===4),t,2)}function bM(e){return e.getDay()}function _M(e,t){return Ot(ja.count(Dn(e)-1,e),t,2)}function EM(e,t){return Ot(e.getFullYear()%100,t,2)}function TM(e,t){return e=Mf(e),Ot(e.getFullYear()%100,t,2)}function OM(e,t){return Ot(e.getFullYear()%1e4,t,4)}function SM(e,t){var n=e.getDay();return e=n>=4||n===0?li(e):li.ceil(e),Ot(e.getFullYear()%1e4,t,4)}function wM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ot(t/60|0,"0",2)+Ot(t%60,"0",2)}function Cf(e,t){return Ot(e.getUTCDate(),t,2)}function $M(e,t){return Ot(e.getUTCHours(),t,2)}function MM(e,t){return Ot(e.getUTCHours()%12||12,t,2)}function CM(e,t){return Ot(1+Ic.count($r(e),e),t,3)}function Af(e,t){return Ot(e.getUTCMilliseconds(),t,3)}function AM(e,t){return Af(e,t)+"000"}function kM(e,t){return Ot(e.getUTCMonth()+1,t,2)}function LM(e,t){return Ot(e.getUTCMinutes(),t,2)}function RM(e,t){return Ot(e.getUTCSeconds(),t,2)}function DM(e){var t=e.getUTCDay();return t===0?7:t}function IM(e,t){return Ot(bf.count($r(e)-1,e),t,2)}function kf(e){var t=e.getUTCDay();return t>=4||t===0?ci(e):ci.ceil(e)}function NM(e,t){return e=kf(e),Ot(ci.count($r(e),e)+($r(e).getUTCDay()===4),t,2)}function PM(e){return e.getUTCDay()}function UM(e,t){return Ot(Wa.count($r(e)-1,e),t,2)}function BM(e,t){return Ot(e.getUTCFullYear()%100,t,2)}function HM(e,t){return e=kf(e),Ot(e.getUTCFullYear()%100,t,2)}function VM(e,t){return Ot(e.getUTCFullYear()%1e4,t,4)}function FM(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ci(e):ci.ceil(e),Ot(e.getUTCFullYear()%1e4,t,4)}function GM(){return"+0000"}function Lf(){return"%"}function Rf(e){return+e}function Df(e){return Math.floor(+e/1e3)}var ui,If;zM({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 zM(e){return ui=z$(e),If=ui.format,ui.parse,ui.utcFormat,ui.utcParse,ui}function jM(e){return new Date(e)}function WM(e){return e instanceof Date?+e:+new Date(+e)}function Nf(e,t,n,r,i,s,a,o,l,c){var u=Np(),d=u.invert,h=u.domain,p=c(".%L"),f=c(":%S"),v=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),g=c("%b %d"),b=c("%B"),T=c("%Y");function E(O){return(l(O)<O?p:o(O)<O?f:a(O)<O?v:s(O)<O?m:r(O)<O?i(O)<O?y:g:n(O)<O?b:T)(O)}return u.invert=function(O){return new Date(d(O))},u.domain=function(O){return arguments.length?h(Array.from(O,WM)):h().map(jM)},u.ticks=function(O){var A=h();return e(A[0],A[A.length-1],O??10)},u.tickFormat=function(O,A){return A==null?E:c(A)},u.nice=function(O){var A=h();return(!O||typeof O.range!="function")&&(O=t(A[0],A[A.length-1],O??10)),O?h(yf(A,O)):u},u.copy=function(){return mc(u,Nf(e,t,n,r,i,s,a,o,l,c))},u}function Pf(){return ti.apply(Nf(F$,G$,Dn,Nc,za,fs,Dc,Rc,oi,If).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const Uf=Math.abs,he=Math.atan2,Mr=Math.cos,qM=Math.max,Bc=Math.min,mn=Math.sin,hi=Math.sqrt,de=1e-12,ys=Math.PI,qa=ys/2,Ya=2*ys;function YM(e){return e>1?0:e<-1?ys:Math.acos(e)}function Bf(e){return e>=1?qa:e<=-1?-qa:Math.asin(e)}function Hf(e){this._context=e}Hf.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 Za(e){return new Hf(e)}function Xn(){}function Vf(e){this._context=e}Vf.prototype={areaStart:Xn,areaEnd:Xn,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 Ff(e){return new Vf(e)}function ZM(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 XM=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function In(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Xa(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function KM(e){const t=Xa(e,"border-left-width"),n=Xa(e,"border-right-width");return e.clientWidth+t+n}function QM(e){const t=Xa(e,"border-top-width"),n=Xa(e,"border-bottom-width");return e.clientHeight+t+n}function Gf(e,t={}){const n=t.width||KM(e),r=t.height||QM(e);return{width:n,height:r}}function JM(){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 Le=16384;function t2(e){(e.width>Le||e.height>Le)&&(e.width>Le&&e.height>Le?e.width>e.height?(e.height*=Le/e.width,e.width=Le):(e.width*=Le/e.height,e.height=Le):e.width>Le?(e.height*=Le/e.width,e.width=Le):(e.width*=Le/e.height,e.height=Le))}function Ka(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 e2(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function n2(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),e2(i)}const Te=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Te(n,t)};function r2(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function i2(e){return In(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function s2(e,t,n){const r=`.${e}:${t}`,i=n.cssText?r2(n):i2(n);return document.createTextNode(`${r}{${i}}`)}function zf(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=XM();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(s2(s,n,r)),t.appendChild(a)}function a2(e,t){zf(e,t,":before"),zf(e,t,":after")}const jf="application/font-woff",Wf="image/jpeg",o2={woff:jf,woff2:jf,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 l2(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Hc(e){const t=l2(e).toLowerCase();return o2[t]||""}function c2(e){return e.split(/,/)[1]}function Vc(e){return e.search(/^(data:)/)!==-1}function u2(e,t){return`data:${t};base64,${e}`}async function qf(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 Fc={};function h2(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 Gc(e,t,n){const r=h2(e,t,n.includeQueryParams);if(Fc[r]!=null)return Fc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await qf(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),c2(o)));i=u2(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 Fc[r]=i,i}async function d2(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ka(t)}async function p2(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 Ka(o)}const n=e.poster,r=Hc(n),i=await Gc(n,r,t);return Ka(i)}async function f2(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await Qa(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function m2(e,t){return Te(e,HTMLCanvasElement)?d2(e):Te(e,HTMLVideoElement)?p2(e,t):Te(e,HTMLIFrameElement)?f2(e):e.cloneNode(!1)}const g2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function v2(e,t,n){var r,i;let s=[];return g2(e)&&e.assignedNodes?s=In(e.assignedNodes()):Te(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=In(e.contentDocument.body.childNodes):s=In(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||Te(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>Qa(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function y2(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):In(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`),Te(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 x2(e,t){Te(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Te(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function b2(e,t){if(Te(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function _2(e,t){return Te(t,Element)&&(y2(e,t),a2(e,t),x2(e,t),b2(e,t)),t}async function E2(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 Qa(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 Qa(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>m2(r,t)).then(r=>v2(e,r,t)).then(r=>_2(e,r)).then(r=>E2(r,t))}const Yf=/url\((['"]?)([^'"]+?)\1\)/g,T2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,O2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function S2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function w2(e){const t=[];return e.replace(Yf,(n,r,i)=>(t.push(i),n)),t.filter(n=>!Vc(n))}async function $2(e,t,n,r,i){try{const s=n?ZM(t,n):t,a=Hc(t);let o;return i||(o=await Gc(s,a,r)),e.replace(S2(t),`$1${o}$3`)}catch{}return e}function M2(e,{preferredFontFormat:t}){return t?e.replace(O2,n=>{for(;;){const[r,,i]=T2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Zf(e){return e.search(Yf)!==-1}async function Xf(e,t,n){if(!Zf(e))return e;const r=M2(e,n);return w2(r).reduce((i,s)=>i.then(a=>$2(a,s,t,n)),Promise.resolve(r))}async function Ja(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Xf(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function C2(e,t){await Ja("background",e,t)||await Ja("background-image",e,t),await Ja("mask",e,t)||await Ja("mask-image",e,t)}async function A2(e,t){const n=Te(e,HTMLImageElement);if(!(n&&!Vc(e.src))&&!(Te(e,SVGImageElement)&&!Vc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Gc(r,Hc(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 k2(e,t){const n=In(e.childNodes).map(r=>Kf(r,t));await Promise.all(n).then(()=>e)}async function Kf(e,t){Te(e,Element)&&(await C2(e,t),await A2(e,t),await k2(e,t))}function L2(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 Qf={};async function Jf(e){let t=Qf[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Qf[e]=t,t}async function tm(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),qf(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function em(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 R2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{In(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Jf(l).then(u=>tm(u,t)).then(u=>em(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(Jf(i.href).then(o=>tm(o,t)).then(o=>em(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{In(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function D2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Zf(t.style.getPropertyValue("src")))}async function I2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=In(e.ownerDocument.styleSheets),r=await R2(n,t);return D2(r)}async function N2(e,t){const n=await I2(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Xf(r.cssText,i,t)}))).join(`
|
|
3
|
-
`)}async function P2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await N2(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 U2(e,t={}){const{width:n,height:r}=Gf(e,t),i=await Qa(e,t,!0);return await P2(i,t),await Kf(i,t),L2(i,t),await n2(i,n,r)}async function nm(e,t={}){const{width:n,height:r}=Gf(e,t),i=await U2(e,t),s=await Ka(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||JM(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||t2(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 B2(e,t={}){return(await nm(e,t)).toDataURL()}async function H2(e,t={}){return(await nm(e,t)).toDataURL("image/jpeg",t.quality||1)}let Nn=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 V2="DONT_STYLE_ME_css_styles_verifier";let N=class dh extends Nn{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=D(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(p=>{if(h[p]){const f=h[p],v=parseFloat(f);f&&v>r[p]&&(""+f).indexOf("%")===-1&&(r[p]=v)}})},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:x(t.node(),"width","baseVal","value"),height:x(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=x(t,"style","prefix"),r=D(this.getHolder()).append("div").classed(`${Ee}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",V2),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),D(this.getHolder()).classed(`${Ee}--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=D(r);i.classed("filled",!0),H2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=x(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=D(r);i.classed("filled",!0),B2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=x(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 D(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();D(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=D(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=dh.getSVGElementSize(D(this.mainContainer),{useBBox:!0}),n=D(this.mainContainer).attr("class"),r=D(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(dh.getSVGElementSize(D(s),{useBBox:!0}).height)}),i<=t?D(this.mainContainer).attr("height",i):D(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&D(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(S.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(S.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Fa(()=>{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(S.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},zc=class g0 extends Nn{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:g0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function rm(e){const t=F2(im(e),360);return Kn(t,[0,10])||Kn(t,[350,0])?{textAnchor:ln.START,dominantBaseline:cn.MIDDLE}:Kn(t,[10,80])?{textAnchor:ln.START,dominantBaseline:cn.HANGING}:Kn(t,[80,100])?{textAnchor:ln.MIDDLE,dominantBaseline:cn.HANGING}:Kn(t,[100,170])?{textAnchor:ln.END,dominantBaseline:cn.HANGING}:Kn(t,[170,190])?{textAnchor:ln.END,dominantBaseline:cn.MIDDLE}:Kn(t,[190,260])?{textAnchor:ln.END,dominantBaseline:cn.BASELINE}:Kn(t,[260,280])?{textAnchor:ln.MIDDLE,dominantBaseline:cn.BASELINE}:{textAnchor:ln.START,dominantBaseline:cn.BASELINE}}function F2(e,t){return(e%t+t)%t}function Kn(e,[t,n]){return e>=t&&e<=n}function im(e){return e*(180/Math.PI)}function Zt(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 G2(e,t){return t*Math.sin(e-Math.PI/2)}function z2(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 j2(e){return function(t){return e==null?void 0:e[t]}}var W2={À:"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"},q2=j2(W2),Y2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Z2="\\u0300-\\u036f",X2="\\ufe20-\\ufe2f",K2="\\u20d0-\\u20ff",Q2=Z2+X2+K2,J2="["+Q2+"]",tC=RegExp(J2,"g");function eC(e){return e=Wi(e),e&&e.replace(Y2,q2).replace(tC,"")}var nC=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function rC(e){return e.match(nC)||[]}var iC=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function sC(e){return iC.test(e)}var sm="\\ud800-\\udfff",aC="\\u0300-\\u036f",oC="\\ufe20-\\ufe2f",lC="\\u20d0-\\u20ff",cC=aC+oC+lC,am="\\u2700-\\u27bf",om="a-z\\xdf-\\xf6\\xf8-\\xff",uC="\\xac\\xb1\\xd7\\xf7",hC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",dC="\\u2000-\\u206f",pC=" \\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",lm="A-Z\\xc0-\\xd6\\xd8-\\xde",fC="\\ufe0e\\ufe0f",cm=uC+hC+dC+pC,um="['’]",hm="["+cm+"]",mC="["+cC+"]",dm="\\d+",gC="["+am+"]",pm="["+om+"]",fm="[^"+sm+cm+dm+am+om+lm+"]",vC="\\ud83c[\\udffb-\\udfff]",yC="(?:"+mC+"|"+vC+")",xC="[^"+sm+"]",mm="(?:\\ud83c[\\udde6-\\uddff]){2}",gm="[\\ud800-\\udbff][\\udc00-\\udfff]",di="["+lm+"]",bC="\\u200d",vm="(?:"+pm+"|"+fm+")",_C="(?:"+di+"|"+fm+")",ym="(?:"+um+"(?:d|ll|m|re|s|t|ve))?",xm="(?:"+um+"(?:D|LL|M|RE|S|T|VE))?",bm=yC+"?",_m="["+fC+"]?",EC="(?:"+bC+"(?:"+[xC,mm,gm].join("|")+")"+_m+bm+")*",TC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",OC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",SC=_m+bm+EC,wC="(?:"+[gC,mm,gm].join("|")+")"+SC,$C=RegExp([di+"?"+pm+"+"+ym+"(?="+[hm,di,"$"].join("|")+")",_C+"+"+xm+"(?="+[hm,di+vm,"$"].join("|")+")",di+"?"+vm+"+"+ym,di+"+"+xm,OC,TC,dm,wC].join("|"),"g");function MC(e){return e.match($C)||[]}function CC(e,t,n){return e=Wi(e),t=t,t===void 0?sC(e)?MC(e):rC(e):e.match(t)||[]}var AC="['’]",kC=RegExp(AC,"g");function Em(e){return function(t){return z2(CC(eC(t).replace(kC,"")),e,"")}}function LC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Tm(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=ai(n),n=n===n?n:0),t!==void 0&&(t=ai(t),t=t===t?t:0),LC(ai(e),t,n)}var RC="Expected a function";function DC(e,t,n){if(typeof e!="function")throw new TypeError(RC);return setTimeout(function(){e.apply(void 0,n)},t)}var IC=$l(function(e,t,n){return DC(e,ai(t)||0,n)});function NC(e,t){var n=-1,r=pr(e)?Array(e.length):[];return Oc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function PC(e,t){var n=se(e)?_l:NC;return n(e,ma(t))}var UC=1/0;function BC(e,t){return ha(PC(e,t),UC)}function Om(e,t){return fa(e,t)}var pi=Em(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function HC(e,t){var n;return Oc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function VC(e,t,n){var r=se(e)?_d:HC;return r(e,ma(t))}class Cr{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*FC(e){for(const t of e)yield*t}function Sm(e){return Array.from(FC(e))}function GC(e){return e}var to=1,eo=2,jc=3,xs=4,wm=1e-6;function zC(e){return"translate("+e+",0)"}function jC(e){return"translate(0,"+e+")"}function WC(e){return t=>+e(t)}function qC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function YC(){return!this.__axis}function no(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===to||e===xs?-1:1,u=e===xs||e===eo?"x":"y",d=e===to||e===jc?zC:jC;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),v=i??(t.tickFormat?t.tickFormat.apply(t,n):GC),m=Math.max(s,0)+o,y=t.range(),g=+y[0]+l,b=+y[y.length-1]+l,T=(t.bandwidth?qC:WC)(t.copy(),l),E=p.selection?p.selection():p,O=E.selectAll(".domain").data([null]),A=E.selectAll(".tick").data(f,t).order(),I=A.exit(),L=A.enter().append("g").attr("class","tick"),R=A.select("line"),$=A.select("text");O=O.merge(O.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(L),R=R.merge(L.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),$=$.merge(L.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===to?"0em":e===jc?"0.71em":"0.32em")),p!==E&&(O=O.transition(p),A=A.transition(p),R=R.transition(p),$=$.transition(p),I=I.transition(p).attr("opacity",wm).attr("transform",function(F){return isFinite(F=T(F))?d(F+l):this.getAttribute("transform")}),L.attr("opacity",wm).attr("transform",function(F){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(F))?P:T(F))+l)})),I.remove(),O.attr("d",e===xs||e===eo?a?"M"+c*a+","+g+"H"+l+"V"+b+"H"+c*a:"M"+l+","+g+"V"+b:a?"M"+g+","+c*a+"V"+l+"H"+b+"V"+c*a:"M"+g+","+l+"H"+b),A.attr("opacity",1).attr("transform",function(F){return d(T(F)+l)}),R.attr(u+"2",c*s),$.attr(u,c*m).text(v),E.filter(YC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===eo?"start":e===xs?"end":"middle"),E.each(function(){this.__axis=T})}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 ZC(e){return no(to,e)}function XC(e){return no(eo,e)}function Wc(e){return no(jc,e)}function $m(e){return no(xs,e)}const qc={capture:!0,passive:!1};function Yc(e){e.preventDefault(),e.stopImmediatePropagation()}function KC(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",Yc,qc);"onselectstart"in t?n.on("selectstart.drag",Yc,qc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function QC(e,t){var n=e.document.documentElement,r=D(e).on("dragstart.drag",null);t&&(r.on("click.drag",Yc,qc),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 JC(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const tA=e=>+e,Zc=e=>()=>e;function eA(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 nA(e){e.stopImmediatePropagation()}function Xc(e){e.preventDefault(),e.stopImmediatePropagation()}var Mm={name:"drag"},Kc={name:"space"},fi={name:"handle"},mi={name:"center"};const{abs:Cm,max:pe,min:fe}=Math;function Am(e){return[+e[0],+e[1]]}function km(e){return[Am(e[0]),Am(e[1])]}var ro={name:"x",handles:["w","e"].map(io),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]]}},Qc={name:"y",handles:["n","s"].map(io),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},Pn={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"},Rm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},rA={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},iA={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function io(e){return{type:e}}function sA(e){return!e.ctrlKey&&!e.button}function aA(){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 oA(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jc(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function lA(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Dm(){return cA(ro)}function cA(e){var t=aA,n=sA,r=oA,i=!0,s=Zl("start","brush","end"),a=6,o;function l(m){var y=m.property("__brush",v).selectAll(".overlay").data([io("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Pn.overlay).merge(y).each(function(){var b=Jc(this).extent;D(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),m.selectAll(".selection").data([io("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Pn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var g=m.selectAll(".handle").data(e.handles,function(b){return b.type});g.exit().remove(),g.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return Pn[b.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,y,g){m.tween?m.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,T=b.__brush,E=u(b,arguments),O=T.selection,A=e.input(typeof y=="function"?y.apply(this,arguments):y,T.extent),I=es(O,A);function L(R){T.selection=R===1&&A===null?null:I(R),c.call(b),E.brush()}return O!==null&&A!==null?L:L(1)}):m.each(function(){var b=this,T=arguments,E=b.__brush,O=e.input(typeof y=="function"?y.apply(b,T):y,E.extent),A=u(b,T).beforestart();uc(b),E.selection=O===null?null:O,c.call(b),A.start(g).brush(g).end(g)})},l.clear=function(m,y){l.move(m,null,y)};function c(){var m=D(this),y=Jc(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(g){return g.type[g.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(g){return g.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(g){return g.type==="n"||g.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(g){return g.type==="e"||g.type==="w"?y[1][1]-y[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,y,g){var b=m.__brush.emitter;return b&&(!g||!b.clean)?b:new d(m,y,g)}function d(m,y,g){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=g}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,g){var b=D(this.that).datum();s.call(m,this.that,new eA(m,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:g,dispatch:s}),b)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var y=this,g=m.target.__data__.type,b=(i&&m.metaKey?g="overlay":g)==="selection"?Mm:i&&m.altKey?mi:fi,T=e===Qc?null:rA[g],E=e===ro?null:iA[g],O=Jc(y),A=O.extent,I=O.selection,L=A[0][0],R,$,F=A[0][1],P,H,_=A[1][0],C,k,U=A[1][1],B,X,Y=0,ot=0,it,bt=T&&E&&i&&m.shiftKey,st,K,et=Array.from(m.touches||[m],nt=>{const $t=nt.identifier;return nt=vr(nt,y),nt.point0=nt.slice(),nt.identifier=$t,nt});uc(y);var mt=u(y,arguments,!0).beforestart();if(g==="overlay"){I&&(it=!0);const nt=[et[0],et[1]||et[0]];O.selection=I=[[R=e===Qc?L:fe(nt[0][0],nt[1][0]),P=e===ro?F:fe(nt[0][1],nt[1][1])],[C=e===Qc?_:pe(nt[0][0],nt[1][0]),B=e===ro?U:pe(nt[0][1],nt[1][1])]],et.length>1&&Dt(m)}else R=I[0][0],P=I[0][1],C=I[1][0],B=I[1][1];$=R,H=P,k=C,X=B;var q=D(y).attr("pointer-events","none"),J=q.selectAll(".overlay").attr("cursor",Pn[g]);if(m.touches)mt.moved=z,mt.ended=gt;else{var dt=D(m.view).on("mousemove.brush",z,!0).on("mouseup.brush",gt,!0);i&&dt.on("keydown.brush",Wt,!0).on("keyup.brush",Gt,!0),KC(m.view)}c.call(y),mt.start(m,b.name);function z(nt){for(const $t of nt.changedTouches||[nt])for(const be of et)be.identifier===$t.identifier&&(be.cur=vr($t,y));if(bt&&!st&&!K&&et.length===1){const $t=et[0];Cm($t.cur[0]-$t[0])>Cm($t.cur[1]-$t[1])?K=!0:st=!0}for(const $t of et)$t.cur&&($t[0]=$t.cur[0],$t[1]=$t.cur[1]);it=!0,Xc(nt),Dt(nt)}function Dt(nt){const $t=et[0],be=$t.point0;var Pe;switch(Y=$t[0]-be[0],ot=$t[1]-be[1],b){case Kc:case Mm:{T&&(Y=pe(L-R,fe(_-C,Y)),$=R+Y,k=C+Y),E&&(ot=pe(F-P,fe(U-B,ot)),H=P+ot,X=B+ot);break}case fi:{et[1]?(T&&($=pe(L,fe(_,et[0][0])),k=pe(L,fe(_,et[1][0])),T=1),E&&(H=pe(F,fe(U,et[0][1])),X=pe(F,fe(U,et[1][1])),E=1)):(T<0?(Y=pe(L-R,fe(_-R,Y)),$=R+Y,k=C):T>0&&(Y=pe(L-C,fe(_-C,Y)),$=R,k=C+Y),E<0?(ot=pe(F-P,fe(U-P,ot)),H=P+ot,X=B):E>0&&(ot=pe(F-B,fe(U-B,ot)),H=P,X=B+ot));break}case mi:{T&&($=pe(L,fe(_,R-Y*T)),k=pe(L,fe(_,C+Y*T))),E&&(H=pe(F,fe(U,P-ot*E)),X=pe(F,fe(U,B+ot*E)));break}}k<$&&(T*=-1,Pe=R,R=C,C=Pe,Pe=$,$=k,k=Pe,g in Lm&&J.attr("cursor",Pn[g=Lm[g]])),X<H&&(E*=-1,Pe=P,P=B,B=Pe,Pe=H,H=X,X=Pe,g in Rm&&J.attr("cursor",Pn[g=Rm[g]])),O.selection&&(I=O.selection),st&&($=I[0][0],k=I[1][0]),K&&(H=I[0][1],X=I[1][1]),(I[0][0]!==$||I[0][1]!==H||I[1][0]!==k||I[1][1]!==X)&&(O.selection=[[$,H],[k,X]],c.call(y),mt.brush(nt,b.name))}function gt(nt){if(nA(nt),nt.touches){if(nt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else QC(nt.view,it),dt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),J.attr("cursor",Pn.overlay),O.selection&&(I=O.selection),lA(I)&&(O.selection=null,c.call(y)),mt.end(nt,b.name)}function Wt(nt){switch(nt.keyCode){case 16:{bt=T&&E;break}case 18:{b===fi&&(T&&(C=k-Y*T,R=$+Y*T),E&&(B=X-ot*E,P=H+ot*E),b=mi,Dt(nt));break}case 32:{(b===fi||b===mi)&&(T<0?C=k-Y:T>0&&(R=$-Y),E<0?B=X-ot:E>0&&(P=H-ot),b=Kc,J.attr("cursor",Pn.selection),Dt(nt));break}default:return}Xc(nt)}function Gt(nt){switch(nt.keyCode){case 16:{bt&&(st=K=bt=!1,Dt(nt));break}case 18:{b===mi&&(T<0?C=k:T>0&&(R=$),E<0?B=X:E>0&&(P=H),b=fi,Dt(nt));break}case 32:{b===Kc&&(nt.altKey?(T&&(C=k-Y*T,R=$+Y*T),E&&(B=X-ot*E,P=H+ot*E),b=mi):(T<0?C=k:T>0&&(R=$),E<0?B=X:E>0&&(P=H),b=fi),J.attr("cursor",Pn[g]),Dt(nt));break}default:return}Xc(nt)}}function p(m){u(this,arguments).moved(m)}function f(m){u(this,arguments).ended(m)}function v(){var m=this.__brush||{selection:null};return m.extent=km(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Zc(km(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Zc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Zc(!!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 tu=Math.PI,eu=2*tu,Ar=1e-6,uA=eu-Ar;function Im(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function hA(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Im;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 nu=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Im:hA(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>Ar)if(!(Math.abs(d*l-c*u)>Ar)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,f=i-o,v=l*l+c*c,m=p*p+f*f,y=Math.sqrt(v),g=Math.sqrt(h),b=s*Math.tan((tu-Math.acos((v+h-m)/(2*y*g)))/2),T=b/g,E=b/y;Math.abs(T-1)>Ar&&this._append`L${t+T*u},${n+T*d}`,this._append`A${s},${s},0,0,${+(d*p>u*f)},${this._x1=t+E*l},${this._y1=n+E*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)>Ar||Math.abs(this._y1-u)>Ar)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%eu+eu),h>uA?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>Ar&&this._append`A${r},${r},0,${+(h>=tu)},${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 Nm(){return new nu}Nm.prototype=nu.prototype;var kt=1e-6,Pm=1e-12,vt=Math.PI,Oe=vt/2,Um=vt/4,Re=vt*2,ge=180/vt,Xt=vt/180,Lt=Math.abs,Bm=Math.atan,kr=Math.atan2,Rt=Math.cos,dA=Math.exp,pA=Math.log,wt=Math.sin,Qn=Math.sign||function(e){return e>0?1:e<0?-1:0},rn=Math.sqrt,fA=Math.tan;function mA(e){return e>1?0:e<-1?vt:Math.acos(e)}function Un(e){return e>1?Oe:e<-1?-Oe:Math.asin(e)}function je(){}function so(e,t){e&&Vm.hasOwnProperty(e.type)&&Vm[e.type](e,t)}var Hm={Feature:function(e,t){so(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)so(n[r].geometry,t)}},Vm={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){ru(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)ru(n[r],t,0)},Polygon:function(e,t){Fm(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Fm(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)so(n[r],t)}};function ru(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 Fm(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)ru(e[n],t,1);t.polygonEnd()}function gi(e,t){e&&Hm.hasOwnProperty(e.type)?Hm[e.type](e,t):so(e,t)}function iu(e){return[kr(e[1],e[0]),Un(e[2])]}function vi(e){var t=e[0],n=e[1],r=Rt(n);return[r*Rt(t),r*wt(t),wt(n)]}function ao(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function oo(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 su(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function lo(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function au(e){var t=rn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function ou(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 lu(e,t){return Lt(e)>vt&&(e-=Math.round(e/Re)*Re),[e,t]}lu.invert=lu;function Gm(e,t,n){return(e%=Re)?t||n?ou(jm(e),Wm(t,n)):jm(e):t||n?Wm(t,n):lu}function zm(e){return function(t,n){return t+=e,Lt(t)>vt&&(t-=Math.round(t/Re)*Re),[t,n]}}function jm(e){var t=zm(e);return t.invert=zm(-e),t}function Wm(e,t){var n=Rt(e),r=wt(e),i=Rt(t),s=wt(t);function a(o,l){var c=Rt(l),u=Rt(o)*c,d=wt(o)*c,h=wt(l),p=h*n+u*r;return[kr(d*i-p*s,u*n-h*r),Un(p*i+d*s)]}return a.invert=function(o,l){var c=Rt(l),u=Rt(o)*c,d=wt(o)*c,h=wt(l),p=h*i-d*s;return[kr(d*i+h*s,u*n+p*r),Un(p*n-u*r)]},a}function gA(e){e=Gm(e[0]*Xt,e[1]*Xt,e.length>2?e[2]*Xt:0);function t(n){return n=e(n[0]*Xt,n[1]*Xt),n[0]*=ge,n[1]*=ge,n}return t.invert=function(n){return n=e.invert(n[0]*Xt,n[1]*Xt),n[0]*=ge,n[1]*=ge,n},t}function vA(e,t,n,r,i,s){if(n){var a=Rt(t),o=wt(t),l=r*n;i==null?(i=t+r*Re,s=t-l/2):(i=qm(a,i),s=qm(a,s),(r>0?i<s:i>s)&&(i+=r*Re));for(var c,u=i;r>0?u>s:u<s;u-=l)c=iu([a,-o*Rt(u),-o*wt(u)]),e.point(c[0],c[1])}}function qm(e,t){t=vi(t),t[0]-=e,au(t);var n=mA(-t[1]);return((-t[2]<0?-n:n)+Re-kt)%Re}function Ym(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:je,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function co(e,t){return Lt(e[0]-t[0])<kt&&Lt(e[1]-t[1])<kt}function uo(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 Zm(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(f){if(!((v=f.length-1)<=0)){var v,m=f[0],y=f[v],g;if(co(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),o=0;o<v;++o)i.point((m=f[o])[0],m[1]);i.lineEnd();return}y[0]+=2*kt}s.push(g=new uo(m,f,null,!0)),a.push(g.o=new uo(m,null,g,!1)),s.push(g=new uo(y,f,null,!1)),a.push(g.o=new uo(y,null,g,!0))}}),!!s.length){for(a.sort(t),Xm(s),Xm(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 Xm(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 cu(e){return Lt(e[0])<=vt?e[0]:Qn(e[0])*((Lt(e[0])+vt)%Re-vt)}function yA(e,t){var n=cu(t),r=t[1],i=wt(r),s=[wt(n),-Rt(n),0],a=0,o=0,l=new Cr;i===1?r=Oe+kt:i===-1&&(r=-Oe-kt);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=cu(p),v=p[1]/2+Um,m=wt(v),y=Rt(v),g=0;g<h;++g,f=T,m=O,y=A,p=b){var b=d[g],T=cu(b),E=b[1]/2+Um,O=wt(E),A=Rt(E),I=T-f,L=I>=0?1:-1,R=L*I,$=R>vt,F=m*O;if(l.add(kr(F*L*wt(R),y*A+F*Rt(R))),a+=$?I+L*Re:I,$^f>=n^T>=n){var P=oo(vi(p),vi(b));au(P);var H=oo(s,P);au(H);var _=($^I>=0?-1:1)*Un(H[2]);(r>_||r===_&&(P[0]||P[1]))&&(o+=$^I>=0?1:-1)}}return(a<-kt||a<kt&&l<-Pm)^o&1}function Km(e,t,n,r){return function(i){var s=t(i),a=Ym(),o=t(a),l=!1,c,u,d,h={point:p,lineStart:v,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=g,h.lineEnd=b,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=v,h.lineEnd=m,u=Sm(u);var T=yA(c,r);u.length?(l||(i.polygonStart(),l=!0),Zm(u,bA,T,n,i)):T&&(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(T,E){e(T,E)&&i.point(T,E)}function f(T,E){s.point(T,E)}function v(){h.point=f,s.lineStart()}function m(){h.point=p,s.lineEnd()}function y(T,E){d.push([T,E]),o.point(T,E)}function g(){o.lineStart(),d=[]}function b(){y(d[0][0],d[0][1]),o.lineEnd();var T=o.clean(),E=a.result(),O,A=E.length,I,L,R;if(d.pop(),c.push(d),d=null,!!A){if(T&1){if(L=E[0],(I=L.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),O=0;O<I;++O)i.point((R=L[O])[0],R[1]);i.lineEnd()}return}A>1&&T&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(xA))}}return h}}function xA(e){return e.length>1}function bA(e,t){return((e=e.x)[0]<0?e[1]-Oe-kt:Oe-e[1])-((t=t.x)[0]<0?t[1]-Oe-kt:Oe-t[1])}const Qm=Km(function(){return!0},_A,TA,[-vt,-Oe]);function _A(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?vt:-vt,l=Lt(s-t);Lt(l-vt)<kt?(e.point(t,n=(n+a)/2>0?Oe:-Oe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=vt&&(Lt(t-r)<kt&&(t-=r*kt),Lt(s-o)<kt&&(s-=o*kt),n=EA(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 EA(e,t,n,r){var i,s,a=wt(e-n);return Lt(a)>kt?Bm((wt(t)*(s=Rt(r))*wt(n)-wt(r)*(i=Rt(t))*wt(e))/(i*s*a)):(t+r)/2}function TA(e,t,n,r){var i;if(e==null)i=n*Oe,r.point(-vt,i),r.point(0,i),r.point(vt,i),r.point(vt,0),r.point(vt,-i),r.point(0,-i),r.point(-vt,-i),r.point(-vt,0),r.point(-vt,i);else if(Lt(e[0]-t[0])>kt){var s=e[0]<t[0]?vt:-vt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function OA(e){var t=Rt(e),n=2*Xt,r=t>0,i=Lt(t)>kt;function s(u,d,h,p){vA(p,e,n,h,u,d)}function a(u,d){return Rt(u)*Rt(d)>t}function o(u){var d,h,p,f,v;return{lineStart:function(){f=p=!1,v=1},point:function(m,y){var g=[m,y],b,T=a(m,y),E=r?T?0:c(m,y):T?c(m+(m<0?vt:-vt),y):0;if(!d&&(f=p=T)&&u.lineStart(),T!==p&&(b=l(d,g),(!b||co(d,b)||co(g,b))&&(g[2]=1)),T!==p)v=0,T?(u.lineStart(),b=l(g,d),u.point(b[0],b[1])):(b=l(d,g),u.point(b[0],b[1],2),u.lineEnd()),d=b;else if(i&&d&&r^T){var O;!(E&h)&&(O=l(g,d,!0))&&(v=0,r?(u.lineStart(),u.point(O[0][0],O[0][1]),u.point(O[1][0],O[1][1]),u.lineEnd()):(u.point(O[1][0],O[1][1]),u.lineEnd(),u.lineStart(),u.point(O[0][0],O[0][1],3)))}T&&(!d||!co(d,g))&&u.point(g[0],g[1]),d=g,p=T,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return v|(f&&p)<<1}}}function l(u,d,h){var p=vi(u),f=vi(d),v=[1,0,0],m=oo(p,f),y=ao(m,m),g=m[0],b=y-g*g;if(!b)return!h&&u;var T=t*y/b,E=-t*g/b,O=oo(v,m),A=lo(v,T),I=lo(m,E);su(A,I);var L=O,R=ao(A,L),$=ao(L,L),F=R*R-$*(ao(A,A)-1);if(!(F<0)){var P=rn(F),H=lo(L,(-R-P)/$);if(su(H,A),H=iu(H),!h)return H;var _=u[0],C=d[0],k=u[1],U=d[1],B;C<_&&(B=_,_=C,C=B);var X=C-_,Y=Lt(X-vt)<kt,ot=Y||X<kt;if(!Y&&U<k&&(B=k,k=U,U=B),ot?Y?k+U>0^H[1]<(Lt(H[0]-_)<kt?k:U):k<=H[1]&&H[1]<=U:X>vt^(_<=H[0]&&H[0]<=C)){var it=lo(L,(-R+P)/$);return su(it,A),[H,iu(it)]}}}function c(u,d){var h=r?e:vt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return Km(a,o,s,r?[0,-e]:[-vt,e-vt])}function SA(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 bs=1e9,ho=-bs;function wA(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 Lt(c[0]-e)<kt?u>0?0:3:Lt(c[0]-n)<kt?u>0?2:1:Lt(c[1]-t)<kt?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=Ym(),h,p,f,v,m,y,g,b,T,E,O,A={point:I,lineStart:F,lineEnd:P,polygonStart:R,polygonEnd:$};function I(_,C){i(_,C)&&u.point(_,C)}function L(){for(var _=0,C=0,k=p.length;C<k;++C)for(var U=p[C],B=1,X=U.length,Y=U[0],ot,it,bt=Y[0],st=Y[1];B<X;++B)ot=bt,it=st,Y=U[B],bt=Y[0],st=Y[1],it<=r?st>r&&(bt-ot)*(r-it)>(st-it)*(e-ot)&&++_:st<=r&&(bt-ot)*(r-it)<(st-it)*(e-ot)&&--_;return _}function R(){u=d,h=[],p=[],O=!0}function $(){var _=L(),C=O&&_,k=(h=Sm(h)).length;(C||k)&&(c.polygonStart(),C&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),k&&Zm(h,o,_,s,c),c.polygonEnd()),u=c,h=p=f=null}function F(){A.point=H,p&&p.push(f=[]),E=!0,T=!1,g=b=NaN}function P(){h&&(H(v,m),y&&T&&d.rejoin(),h.push(d.result())),A.point=I,T&&u.lineEnd()}function H(_,C){var k=i(_,C);if(p&&f.push([_,C]),E)v=_,m=C,y=k,E=!1,k&&(u.lineStart(),u.point(_,C));else if(k&&T)u.point(_,C);else{var U=[g=Math.max(ho,Math.min(bs,g)),b=Math.max(ho,Math.min(bs,b))],B=[_=Math.max(ho,Math.min(bs,_)),C=Math.max(ho,Math.min(bs,C))];SA(U,B,e,t,n,r)?(T||(u.lineStart(),u.point(U[0],U[1])),u.point(B[0],B[1]),k||u.lineEnd(),O=!1):k&&(u.lineStart(),u.point(_,C),O=!1)}g=_,b=C,T=k}return A}}const uu=e=>e;var hu=new Cr,du=new Cr,Jm,tg,pu,fu,Bn={point:je,lineStart:je,lineEnd:je,polygonStart:function(){Bn.lineStart=$A,Bn.lineEnd=CA},polygonEnd:function(){Bn.lineStart=Bn.lineEnd=Bn.point=je,hu.add(Lt(du)),du=new Cr},result:function(){var e=hu/2;return hu=new Cr,e}};function $A(){Bn.point=MA}function MA(e,t){Bn.point=eg,Jm=pu=e,tg=fu=t}function eg(e,t){du.add(fu*e-pu*t),pu=e,fu=t}function CA(){eg(Jm,tg)}var yi=1/0,po=yi,_s=-yi,fo=_s,mo={point:AA,lineStart:je,lineEnd:je,polygonStart:je,polygonEnd:je,result:function(){var e=[[yi,po],[_s,fo]];return _s=fo=-(po=yi=1/0),e}};function AA(e,t){e<yi&&(yi=e),e>_s&&(_s=e),t<po&&(po=t),t>fo&&(fo=t)}var mu=0,gu=0,Es=0,go=0,vo=0,xi=0,vu=0,yu=0,Ts=0,ng,rg,gn,vn,We={point:Lr,lineStart:ig,lineEnd:sg,polygonStart:function(){We.lineStart=RA,We.lineEnd=DA},polygonEnd:function(){We.point=Lr,We.lineStart=ig,We.lineEnd=sg},result:function(){var e=Ts?[vu/Ts,yu/Ts]:xi?[go/xi,vo/xi]:Es?[mu/Es,gu/Es]:[NaN,NaN];return mu=gu=Es=go=vo=xi=vu=yu=Ts=0,e}};function Lr(e,t){mu+=e,gu+=t,++Es}function ig(){We.point=kA}function kA(e,t){We.point=LA,Lr(gn=e,vn=t)}function LA(e,t){var n=e-gn,r=t-vn,i=rn(n*n+r*r);go+=i*(gn+e)/2,vo+=i*(vn+t)/2,xi+=i,Lr(gn=e,vn=t)}function sg(){We.point=Lr}function RA(){We.point=IA}function DA(){ag(ng,rg)}function IA(e,t){We.point=ag,Lr(ng=gn=e,rg=vn=t)}function ag(e,t){var n=e-gn,r=t-vn,i=rn(n*n+r*r);go+=i*(gn+e)/2,vo+=i*(vn+t)/2,xi+=i,i=vn*e-gn*t,vu+=i*(gn+e),yu+=i*(vn+t),Ts+=i*3,Lr(gn=e,vn=t)}function og(e){this._context=e}og.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,Re);break}}},result:je};var xu=new Cr,bu,lg,cg,Os,Ss,ws={point:je,lineStart:function(){ws.point=NA},lineEnd:function(){bu&&ug(lg,cg),ws.point=je},polygonStart:function(){bu=!0},polygonEnd:function(){bu=null},result:function(){var e=+xu;return xu=new Cr,e}};function NA(e,t){ws.point=ug,lg=Os=e,cg=Ss=t}function ug(e,t){Os-=e,Ss-=t,xu.add(rn(Os*Os+Ss*Ss)),Os=e,Ss=t}let hg,yo,dg,pg;class fg{constructor(t){this._append=t==null?mg:PA(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!==dg||this._append!==yo){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`,dg=r,yo=this._append,pg=this._,this._=i}this._+=pg;break}}}result(){const t=this._;return this._="",t.length?t:null}}function mg(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function PA(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return mg;if(t!==hg){const n=10**t;hg=t,yo=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 yo}function UA(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),gi(o,i(s))),s.result()}return a.area=function(o){return gi(o,i(Bn)),Bn.result()},a.measure=function(o){return gi(o,i(ws)),ws.result()},a.bounds=function(o){return gi(o,i(mo)),mo.result()},a.centroid=function(o){return gi(o,i(We)),We.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,uu):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new fg(n)):new og(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 fg(n)),a},a.projection(e).digits(n).context(t)}function _u(e){return function(t){var n=new Eu;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Eu(){}Eu.prototype={constructor:Eu,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 Tu(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),gi(n,e.stream(mo)),t(mo.result()),r!=null&&e.clipExtent(r),e}function gg(e,t,n){return Tu(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 BA(e,t,n){return gg(e,[[0,0],t],n)}function HA(e,t,n){return Tu(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 VA(e,t,n){return Tu(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 vg=16,FA=Rt(30*Xt);function yg(e,t){return+t?zA(e,t):GA(e)}function GA(e){return _u({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function zA(e,t){function n(r,i,s,a,o,l,c,u,d,h,p,f,v,m){var y=c-r,g=u-i,b=y*y+g*g;if(b>4*t&&v--){var T=a+h,E=o+p,O=l+f,A=rn(T*T+E*E+O*O),I=Un(O/=A),L=Lt(Lt(O)-1)<kt||Lt(s-d)<kt?(s+d)/2:kr(E,T),R=e(L,I),$=R[0],F=R[1],P=$-r,H=F-i,_=g*P-y*H;(_*_/b>t||Lt((y*P+g*H)/b-.5)>.3||a*h+o*p+l*f<FA)&&(n(r,i,s,a,o,l,$,F,L,T/=A,E/=A,O,v,m),m.point($,F),n($,F,L,T,E,O,c,u,d,h,p,f,v,m))}}return function(r){var i,s,a,o,l,c,u,d,h,p,f,v,m={point:y,lineStart:g,lineEnd:T,polygonStart:function(){r.polygonStart(),m.lineStart=E},polygonEnd:function(){r.polygonEnd(),m.lineStart=g}};function y(I,L){I=e(I,L),r.point(I[0],I[1])}function g(){d=NaN,m.point=b,r.lineStart()}function b(I,L){var R=vi([I,L]),$=e(I,L);n(d,h,u,p,f,v,d=$[0],h=$[1],u=I,p=R[0],f=R[1],v=R[2],vg,r),r.point(d,h)}function T(){m.point=y,r.lineEnd()}function E(){g(),m.point=O,m.lineEnd=A}function O(I,L){b(i=I,L),s=d,a=h,o=p,l=f,c=v,m.point=b}function A(){n(d,h,u,p,f,v,s,a,i,o,l,c,vg,r),m.lineEnd=T,T()}return m}}var jA=_u({point:function(e,t){this.stream.point(e*Xt,t*Xt)}});function WA(e){return _u({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function qA(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 xg(e,t,n,r,i,s){if(!s)return qA(e,t,n,r,i);var a=Rt(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(v,m){return v*=r,m*=i,[l*v-c*m+t,n-c*v-l*m]}return f.invert=function(v,m){return[r*(u*v-d*m+h),i*(p-d*v-u*m)]},f}function xo(e){return bg(function(){return e})()}function bg(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,v=Qm,m=null,y,g,b,T=uu,E=.5,O,A,I,L,R;function $(_){return I(_[0]*Xt,_[1]*Xt)}function F(_){return _=I.invert(_[0],_[1]),_&&[_[0]*ge,_[1]*ge]}$.stream=function(_){return L&&R===_?L:L=jA(WA(u)(v(O(T(R=_)))))},$.preclip=function(_){return arguments.length?(v=_,f=void 0,H()):v},$.postclip=function(_){return arguments.length?(T=_,m=y=g=b=null,H()):T},$.clipAngle=function(_){return arguments.length?(v=+_?OA(f=_*Xt):(f=null,Qm),H()):f*ge},$.clipExtent=function(_){return arguments.length?(T=_==null?(m=y=g=b=null,uu):wA(m=+_[0][0],y=+_[0][1],g=+_[1][0],b=+_[1][1]),H()):m==null?null:[[m,y],[g,b]]},$.scale=function(_){return arguments.length?(n=+_,P()):n},$.translate=function(_){return arguments.length?(r=+_[0],i=+_[1],P()):[r,i]},$.center=function(_){return arguments.length?(s=_[0]%360*Xt,a=_[1]%360*Xt,P()):[s*ge,a*ge]},$.rotate=function(_){return arguments.length?(o=_[0]%360*Xt,l=_[1]%360*Xt,c=_.length>2?_[2]%360*Xt:0,P()):[o*ge,l*ge,c*ge]},$.angle=function(_){return arguments.length?(d=_%360*Xt,P()):d*ge},$.reflectX=function(_){return arguments.length?(h=_?-1:1,P()):h<0},$.reflectY=function(_){return arguments.length?(p=_?-1:1,P()):p<0},$.precision=function(_){return arguments.length?(O=yg(A,E=_*_),H()):rn(E)},$.fitExtent=function(_,C){return gg($,_,C)},$.fitSize=function(_,C){return BA($,_,C)},$.fitWidth=function(_,C){return HA($,_,C)},$.fitHeight=function(_,C){return VA($,_,C)};function P(){var _=xg(n,0,0,h,p,d).apply(null,t(s,a)),C=xg(n,r-_[0],i-_[1],h,p,d);return u=Gm(o,l,c),A=ou(t,C),I=ou(u,A),O=yg(A,E),H()}function H(){return L=R=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&F,P()}}function _g(e){var t=0,n=vt/3,r=bg(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Xt,n=s[1]*Xt):[t*ge,n*ge]},i}function YA(e){var t=Rt(e);function n(r,i){return[r*t,wt(i)/t]}return n.invert=function(r,i){return[r/t,Un(i*t)]},n}function ZA(e,t){var n=wt(e),r=(n+wt(t))/2;if(Lt(r)<kt)return YA(e);var i=1+n*(2*r-n),s=rn(i)/r;function a(o,l){var c=rn(i-2*r*wt(l))/r;return[c*wt(o*=r),s-c*Rt(o)]}return a.invert=function(o,l){var c=s-l,u=kr(o,Lt(c))*Qn(c);return c*r<0&&(u-=vt*Qn(o)*Qn(c)),[u/r,Un((i-(o*o+c*c)*r*r)/(2*r))]},a}function Eg(){return _g(ZA).scale(155.424).center([0,33.6442])}function XA(){return Eg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ou(e,t){return[e,pA(fA((Oe+t)/2))]}Ou.invert=function(e,t){return[e,2*Bm(dA(t))-Oe]};function KA(){return QA(Ou).scale(961/Re)}function QA(e){var t=xo(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=vt*r(),h=t(gA(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Ou?[[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 bo(e,t){return[e,t]}bo.invert=bo;function JA(){return xo(bo).scale(152.63)}function tk(e,t){var n=Rt(e),r=e===t?wt(e):(n-Rt(t))/(t-e),i=n/r+e;if(Lt(r)<kt)return bo;function s(a,o){var l=i-o,c=r*a;return[l*wt(c),i-l*Rt(c)]}return s.invert=function(a,o){var l=i-o,c=kr(a,Lt(l))*Qn(l);return l*r<0&&(c-=vt*Qn(a)*Qn(l)),[c/r,i-Qn(r)*rn(a*a+l*l)]},s}function ek(){return _g(tk).scale(131.154).center([0,13.9389])}var $s=1.340264,Ms=-.081106,Cs=893e-6,As=.003796,_o=rn(3)/2,nk=12;function Tg(e,t){var n=Un(_o*wt(t)),r=n*n,i=r*r*r;return[e*Rt(n)/(_o*($s+3*Ms*r+i*(7*Cs+9*As*r))),n*($s+Ms*r+i*(Cs+As*r))]}Tg.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<nk&&(o=n*($s+Ms*r+i*(Cs+As*r))-t,l=$s+3*Ms*r+i*(7*Cs+9*As*r),n-=a=o/l,r=n*n,i=r*r*r,!(Lt(a)<Pm));++s);return[_o*e*($s+3*Ms*r+i*(7*Cs+9*As*r))/Rt(n),Un(wt(n)/_o)]};function rk(){return xo(Tg).scale(177.158)}function Og(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)))]}Og.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(Lt(i)>kt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function ik(){return xo(Og).scale(175.295)}function sk(e,t){return e.parent===t.parent?1:2}function ak(e){return e.reduce(ok,0)/e.length}function ok(e,t){return e+t.x}function lk(e){return 1+e.reduce(ck,0)}function ck(e,t){return Math.max(e,t.y)}function uk(e){for(var t;t=e.children;)e=t[0];return e}function hk(e){for(var t;t=e.children;)e=t[t.length-1];return e}function dk(){var e=sk,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var p=h.children;p?(h.x=ak(p),h.y=lk(p)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=uk(s),c=hk(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 pk(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 fk(){return this.eachAfter(pk)}function mk(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function gk(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 vk(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 yk(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function xk(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 bk(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function _k(e){for(var t=this,n=Ek(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 Ek(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 Tk(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Ok(){return Array.from(this)}function Sk(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function wk(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*$k(){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 ks(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ak)):t===void 0&&(t=Ck);for(var n=new Ls(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 Ls(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Lk)}function Mk(){return ks(this).eachBefore(kk)}function Ck(e){return e.children}function Ak(e){return Array.isArray(e)?e[1]:null}function kk(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Lk(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ls(e){this.data=e,this.depth=this.height=0,this.parent=null}Ls.prototype=ks.prototype={constructor:Ls,count:fk,each:mk,eachAfter:vk,eachBefore:gk,find:yk,sum:xk,sort:bk,path:_k,ancestors:Tk,descendants:Ok,leaves:Sk,links:wk,copy:Mk,[Symbol.iterator]:$k};function Rk(e){return e==null?null:Sg(e)}function Sg(e){if(typeof e!="function")throw new Error;return e}function Rr(){return 0}function bi(e){return function(){return e}}const Dk=1664525,Ik=1013904223,wg=4294967296;function Nk(){let e=1;return()=>(e=(Dk*e+Ik)%wg)/wg}function Pk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Uk(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 Bk(e,t){for(var n=0,r=(e=Uk(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&$g(a,s)?++n:(a=Vk(i=Hk(i,s)),n=0);return a}function Hk(e,t){var n,r;if(Su(t,e))return[t];for(n=0;n<e.length;++n)if(Eo(t,e[n])&&Su(Rs(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(Eo(Rs(e[n],e[r]),t)&&Eo(Rs(e[n],t),e[r])&&Eo(Rs(e[r],t),e[n])&&Su(Mg(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Eo(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 $g(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 Su(e,t){for(var n=0;n<t.length;++n)if(!$g(e,t[n]))return!1;return!0}function Vk(e){switch(e.length){case 1:return Fk(e[0]);case 2:return Rs(e[0],e[1]);case 3:return Mg(e[0],e[1],e[2])}}function Fk(e){return{x:e.x,y:e.y,r:e.r}}function Rs(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 Mg(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,v=i-u,m=l-s,y=d-s,g=r*r+i*i-s*s,b=g-a*a-o*o+l*l,T=g-c*c-u*u+d*d,E=p*f-h*v,O=(f*T-v*b)/(E*2)-r,A=(v*m-f*y)/E,I=(p*b-h*T)/(E*2)-i,L=(h*y-p*m)/E,R=A*A+L*L-1,$=2*(s+O*A+I*L),F=O*O+I*I-s*s,P=-(Math.abs(R)>1e-6?($+Math.sqrt($*$-4*R*F))/(2*R):F/$);return{x:r+O+A*P,y:i+I+L*P,r:P}}function Cg(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 Ag(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 kg(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 To(e){this._=e,this.next=null,this.previous=null}function Gk(e,t){if(!(s=(e=Pk(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;Cg(r,n,i=e[2]),n=new To(n),r=new To(r),i=new To(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){Cg(n._,r._,i=e[l]),i=new To(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(Ag(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(Ag(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=kg(n);(i=i.next)!==r;)(o=kg(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Bk(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function zk(e){return Math.sqrt(e.value)}function jk(){var e=null,t=1,n=1,r=Rr;function i(s){const a=Nk();return s.x=t/2,s.y=n/2,e?s.eachBefore(Lg(e)).eachAfter(wu(r,.5,a)).eachBefore(Rg(1)):s.eachBefore(Lg(zk)).eachAfter(wu(Rr,1,a)).eachAfter(wu(r,s.r/Math.min(t,n),a)).eachBefore(Rg(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=Rk(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:bi(+s),i):r},i}function Lg(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function wu(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=Gk(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function Rg(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 Wk(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 qk(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 Yk(e,t){return e.parent===t.parent?1:2}function $u(e){var t=e.children;return t?t[0]:e.t}function Mu(e){var t=e.children;return t?t[t.length-1]:e.t}function Zk(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 Xk(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 Kk(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(Ls.prototype);function Qk(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 Jk(){var e=Yk,t=1,n=1,r=null;function i(c){var u=Qk(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(g){g.x<d.x&&(d=g),g.x>h.x&&(h=g),g.depth>p.depth&&(p=g)});var f=d===h?1:e(d,h)/2,v=f-d.x,m=t/(h.x+f+v),y=n/(p.depth||1);c.eachBefore(function(g){g.x=(g.x+v)*m,g.y=g.depth*y})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){Xk(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,v=h.parent.children[0],m=h.m,y=p.m,g=f.m,b=v.m,T;f=Mu(f),h=$u(h),f&&h;)v=$u(v),p=Mu(p),p.a=c,T=f.z+g-h.z-m+e(f._,h._),T>0&&(Zk(Kk(f,c,d),c,T),m+=T,y+=T),g+=f.m,m+=h.m,b+=v.m,y+=p.m;f&&!Mu(p)&&(p.t=f,p.m+=g-y),h&&!$u(v)&&(v.t=h,v.m+=m-b,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 tL(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 eL=(1+Math.sqrt(5))/2;function nL(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,p,f,v=t.value,m,y,g,b,T,E,O;u<h;){p=i-n,f=s-r;do m=o[d++].value;while(!m&&d<h);for(y=g=m,E=Math.max(f/p,p/f)/(v*e),O=m*m*E,T=Math.max(g/O,O/y);d<h;++d){if(m+=c=o[d].value,c<y&&(y=c),c>g&&(g=c),O=m*m*E,b=Math.max(g/O,O/y),b>T){m-=c;break}T=b}a.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?qk(l,n,r,i,v?r+=f*m/v:s):tL(l,n,r,v?n+=p*m/v:i,s),v-=m,u=d}return a}const rL=function e(t){function n(r,i,s,a,o){nL(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(eL);function iL(){var e=rL,t=!1,n=1,r=1,i=[0],s=Rr,a=Rr,o=Rr,l=Rr,c=Rr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(Wk),h}function d(h){var p=i[h.depth],f=h.x0+p,v=h.y0+p,m=h.x1-p,y=h.y1-p;m<f&&(f=m=(f+m)/2),y<v&&(v=y=(v+y)/2),h.x0=f,h.y0=v,h.x1=m,h.y1=y,h.children&&(p=i[h.depth+1]=s(h)/2,f+=c(h)-p,v+=a(h)-p,m-=o(h)-p,y-=l(h)-p,m<f&&(f=m=(f+m)/2),y<v&&(v=y=(v+y)/2),e(h,f,v,m,y))}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=Sg(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:bi(+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:bi(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:bi(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:bi(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:bi(+h),u):c},u}function So(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 nu(t)}function sL(e){return e.innerRadius}function aL(e){return e.outerRadius}function oL(e){return e.startAngle}function lL(e){return e.endAngle}function cL(e){return e&&e.padAngle}function uL(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<de))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function wo(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/hi(o*o+l*l),u=c*l,d=-c*o,h=e+u,p=t+d,f=n+u,v=r+d,m=(h+f)/2,y=(p+v)/2,g=f-h,b=v-p,T=g*g+b*b,E=i-s,O=h*v-f*p,A=(b<0?-1:1)*hi(qM(0,E*E*T-O*O)),I=(O*b-g*A)/T,L=(-O*g-b*A)/T,R=(O*b+g*A)/T,$=(-O*g+b*A)/T,F=I-m,P=L-y,H=R-m,_=$-y;return F*F+P*P>H*H+_*_&&(I=R,L=$),{cx:I,cy:L,x01:-u,y01:-d,x11:I*(i/E-1),y11:L*(i/E-1)}}function Ds(){var e=sL,t=aL,n=ft(0),r=null,i=oL,s=lL,a=cL,o=null,l=So(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-qa,v=s.apply(this,arguments)-qa,m=Uf(v-f),y=v>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>de))o.moveTo(0,0);else if(m>Ya-de)o.moveTo(p*Mr(f),p*mn(f)),o.arc(0,0,p,f,v,!y),h>de&&(o.moveTo(h*Mr(v),h*mn(v)),o.arc(0,0,h,v,f,y));else{var g=f,b=v,T=f,E=v,O=m,A=m,I=a.apply(this,arguments)/2,L=I>de&&(r?+r.apply(this,arguments):hi(h*h+p*p)),R=Bc(Uf(p-h)/2,+n.apply(this,arguments)),$=R,F=R,P,H;if(L>de){var _=Bf(L/h*mn(I)),C=Bf(L/p*mn(I));(O-=_*2)>de?(_*=y?1:-1,T+=_,E-=_):(O=0,T=E=(f+v)/2),(A-=C*2)>de?(C*=y?1:-1,g+=C,b-=C):(A=0,g=b=(f+v)/2)}var k=p*Mr(g),U=p*mn(g),B=h*Mr(E),X=h*mn(E);if(R>de){var Y=p*Mr(b),ot=p*mn(b),it=h*Mr(T),bt=h*mn(T),st;if(m<ys)if(st=uL(k,U,it,bt,Y,ot,B,X)){var K=k-st[0],et=U-st[1],mt=Y-st[0],q=ot-st[1],J=1/mn(YM((K*mt+et*q)/(hi(K*K+et*et)*hi(mt*mt+q*q)))/2),dt=hi(st[0]*st[0]+st[1]*st[1]);$=Bc(R,(h-dt)/(J-1)),F=Bc(R,(p-dt)/(J+1))}else $=F=0}A>de?F>de?(P=wo(it,bt,k,U,p,F,y),H=wo(Y,ot,B,X,p,F,y),o.moveTo(P.cx+P.x01,P.cy+P.y01),F<R?o.arc(P.cx,P.cy,F,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,F,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,p,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),!y),o.arc(H.cx,H.cy,F,he(H.y11,H.x11),he(H.y01,H.x01),!y))):(o.moveTo(k,U),o.arc(0,0,p,g,b,!y)):o.moveTo(k,U),!(h>de)||!(O>de)?o.lineTo(B,X):$>de?(P=wo(B,X,Y,ot,h,-$,y),H=wo(k,U,it,bt,h,-$,y),o.lineTo(P.cx+P.x01,P.cy+P.y01),$<R?o.arc(P.cx,P.cy,$,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,$,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,h,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),y),o.arc(H.cx,H.cy,$,he(H.y11,H.x11),he(H.y01,H.x01),!y))):o.arc(0,0,h,E,T,y)}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-ys/2;return[Mr(d)*u,mn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ft(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ft(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ft(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ft(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ft(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ft(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ft(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function Cu(e){return e[0]}function Au(e){return e[1]}function Is(e,t){var n=ft(!0),r=null,i=Za,s=null,a=So(o);e=typeof e=="function"?e:e===void 0?Cu:ft(e),t=typeof t=="function"?t:t===void 0?Au:ft(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:ft(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ft(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ft(!!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 ku(e,t,n){var r=null,i=ft(!0),s=null,a=Za,o=null,l=So(c);e=typeof e=="function"?e:e===void 0?Cu:ft(+e),t=typeof t=="function"?t:ft(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Au:ft(+n);function c(d){var h,p,f,v=(d=Va(d)).length,m,y=!1,g,b=new Array(v),T=new Array(v);for(s==null&&(o=a(g=l())),h=0;h<=v;++h){if(!(h<v&&i(m=d[h],h,d))===y)if(y=!y)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=h-1;f>=p;--f)o.point(b[f],T[f]);o.lineEnd(),o.areaEnd()}y&&(b[h]=+e(m,h,d),T[h]=+t(m,h,d),o.point(r?+r(m,h,d):b[h],n?+n(m,h,d):T[h]))}if(g)return o=null,g+""||null}function u(){return Is().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:ft(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:ft(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ft(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:ft(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:ft(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:ft(+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:ft(!!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 hL(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function dL(e){return e}function pL(){var e=dL,t=hL,n=null,r=ft(0),i=ft(Ya),s=ft(0);function a(o){var l,c=(o=Va(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),v=+r.apply(this,arguments),m=Math.min(Ya,Math.max(-Ya,i.apply(this,arguments)-v)),y,g=Math.min(Math.abs(m)/c,s.apply(this,arguments)),b=g*(m<0?-1:1),T;for(l=0;l<c;++l)(T=f[p[l]=l]=+e(o[l],l,o))>0&&(h+=T);for(t!=null?p.sort(function(E,O){return t(f[E],f[O])}):n!=null&&p.sort(function(E,O){return n(o[E],o[O])}),l=0,d=h?(m-c*b)/h:0;l<c;++l,v=y)u=p[l],T=f[u],y=v+(T>0?T*d:0)+b,f[u]={data:o[u],index:l,value:T,startAngle:v,endAngle:y,padAngle:g};return f}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ft(+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:ft(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ft(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ft(+o),a):s},a}var fL=Ig(Za);function Dg(e){this._curve=e}Dg.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 Ig(e){function t(n){return new Dg(e(n))}return t._curve=e,t}function mL(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(Ig(n)):t()._curve},e}function gL(){return mL(Is().curve(fL))}class vL{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 yL(e){return new vL(e,!0)}function xL(e){return e.source}function bL(e){return e.target}function _L(e){let t=xL,n=bL,r=Cu,i=Au,s=null,a=null,o=So(l);function l(){let c;const u=Vw.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:ft(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ft(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function EL(){return _L(yL)}let yt=class{constructor(t,n,r){if(this.type="",this.renderType=rt.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=x(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(D(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=x(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${Ee}--${i}--${this.type}`,!0),r&&r.classed(`${Ee}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=x(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===rt.SVG?"svg":"div"}${r}.${Ee}--${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=D(`#${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?ct({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.2.1 | (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.1/LICENSE */const{entries:Ng,setPrototypeOf:Pg,isFrozen:TL,getPrototypeOf:OL,getOwnPropertyDescriptor:SL}=Object;let{freeze:ve,seal:qe,create:Ug}=Object,{apply:Lu,construct:Ru}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e}),qe||(qe=function(e){return e}),Lu||(Lu=function(e,t,n){return e.apply(t,n)}),Ru||(Ru=function(e,t){return new e(...t)});const $o=De(Array.prototype.forEach),Bg=De(Array.prototype.pop),Ns=De(Array.prototype.push),Mo=De(String.prototype.toLowerCase),Du=De(String.prototype.toString),Hg=De(String.prototype.match),Ps=De(String.prototype.replace),wL=De(String.prototype.indexOf),$L=De(String.prototype.trim),sn=De(Object.prototype.hasOwnProperty),ye=De(RegExp.prototype.test),Us=ML(TypeError);function De(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 Lu(e,t,r)}}function ML(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 xt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Mo;Pg&&Pg(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(TL(t)||(t[r]=s),i=s)}e[i]=!0}return e}function CL(e){for(let t=0;t<e.length;t++)sn(e,t)||(e[t]=null);return e}function Dr(e){const t=Ug(null);for(const[n,r]of Ng(e))sn(e,n)&&(Array.isArray(r)?t[n]=CL(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Dr(r):t[n]=r);return t}function Bs(e,t){for(;e!==null;){const r=SL(e,t);if(r){if(r.get)return De(r.get);if(typeof r.value=="function")return De(r.value)}e=OL(e)}function n(){return null}return n}const Vg=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"]),Iu=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"]),Nu=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"]),AL=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"]),Pu=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"]),kL=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fg=ve(["#text"]),Gg=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"]),Uu=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"]),zg=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"]),Co=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),LL=qe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),RL=qe(/<%[\w\W]*|[\w\W]*%>/gm),DL=qe(/\${[\w\W]*}/gm),IL=qe(/^data-[\-\w.\u00B7-\uFFFF]/),NL=qe(/^aria-[\-\w]+$/),jg=qe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),PL=qe(/^(?:\w+script|data):/i),UL=qe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wg=qe(/^html$/i),BL=qe(/^[a-z][.\w]*(-[.\w]+)+$/i);var qg=Object.freeze({__proto__:null,ARIA_ATTR:NL,ATTR_WHITESPACE:UL,CUSTOM_ELEMENT:BL,DATA_ATTR:IL,DOCTYPE_NAME:Wg,ERB_EXPR:RL,IS_ALLOWED_URI:jg,IS_SCRIPT_OR_DATA:PL,MUSTACHE_EXPR:LL,TMPLIT_EXPR:DL});const Hs={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},HL=function(){return typeof window>"u"?null:window},VL=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}};function Yg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:HL();const t=w=>Yg(w);if(t.version="3.2.1",t.removed=[],!e||!e.document||e.document.nodeType!==Hs.document)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,v=Bs(f,"cloneNode"),m=Bs(f,"remove"),y=Bs(f,"nextSibling"),g=Bs(f,"childNodes"),b=Bs(f,"parentNode");if(typeof a=="function"){const w=n.createElement("template");w.content&&w.content.ownerDocument&&(n=w.content.ownerDocument)}let T,E="";const{implementation:O,createNodeIterator:A,createDocumentFragment:I,getElementsByTagName:L}=n,{importNode:R}=r;let $={};t.isSupported=typeof Ng=="function"&&typeof b=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:P,TMPLIT_EXPR:H,DATA_ATTR:_,ARIA_ATTR:C,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:B}=qg;let{IS_ALLOWED_URI:X}=qg,Y=null;const ot=xt({},[...Vg,...Iu,...Nu,...Pu,...Fg]);let it=null;const bt=xt({},[...Gg,...Uu,...zg,...Co]);let st=Object.seal(Ug(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}})),K=null,et=null,mt=!0,q=!0,J=!1,dt=!0,z=!1,Dt=!0,gt=!1,Wt=!1,Gt=!1,nt=!1,$t=!1,be=!1,Pe=!0,zo=!1;const Ws="user-content-";let qs=!0,Pr=!1,Vn={},Fn=null;const rr=xt({},["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 jo=null;const Ys=xt({},["audio","video","img","source","image","track"]);let Si=null;const wi=xt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$i="http://www.w3.org/1998/Math/MathML",Mi="http://www.w3.org/2000/svg",on="http://www.w3.org/1999/xhtml";let ir=on,Zs=!1,Xs=null;const ch=xt({},[$i,Mi,on],Du);let sr=xt({},["mi","mo","mn","ms","mtext"]),Ur=xt({},["annotation-xml"]);const ar=xt({},["title","style","font","a","script"]);let Gn=null;const Ks=["application/xhtml+xml","text/html"],Wo="text/html";let ne=null,zn=null;const uh=n.createElement("form"),Qs=function(w){return w instanceof RegExp||w instanceof Function},Ci=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(zn&&zn===w)){if((!w||typeof w!="object")&&(w={}),w=Dr(w),Gn=Ks.indexOf(w.PARSER_MEDIA_TYPE)===-1?Wo:w.PARSER_MEDIA_TYPE,ne=Gn==="application/xhtml+xml"?Du:Mo,Y=sn(w,"ALLOWED_TAGS")?xt({},w.ALLOWED_TAGS,ne):ot,it=sn(w,"ALLOWED_ATTR")?xt({},w.ALLOWED_ATTR,ne):bt,Xs=sn(w,"ALLOWED_NAMESPACES")?xt({},w.ALLOWED_NAMESPACES,Du):ch,Si=sn(w,"ADD_URI_SAFE_ATTR")?xt(Dr(wi),w.ADD_URI_SAFE_ATTR,ne):wi,jo=sn(w,"ADD_DATA_URI_TAGS")?xt(Dr(Ys),w.ADD_DATA_URI_TAGS,ne):Ys,Fn=sn(w,"FORBID_CONTENTS")?xt({},w.FORBID_CONTENTS,ne):rr,K=sn(w,"FORBID_TAGS")?xt({},w.FORBID_TAGS,ne):{},et=sn(w,"FORBID_ATTR")?xt({},w.FORBID_ATTR,ne):{},Vn=sn(w,"USE_PROFILES")?w.USE_PROFILES:!1,mt=w.ALLOW_ARIA_ATTR!==!1,q=w.ALLOW_DATA_ATTR!==!1,J=w.ALLOW_UNKNOWN_PROTOCOLS||!1,dt=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=w.SAFE_FOR_TEMPLATES||!1,Dt=w.SAFE_FOR_XML!==!1,gt=w.WHOLE_DOCUMENT||!1,nt=w.RETURN_DOM||!1,$t=w.RETURN_DOM_FRAGMENT||!1,be=w.RETURN_TRUSTED_TYPE||!1,Gt=w.FORCE_BODY||!1,Pe=w.SANITIZE_DOM!==!1,zo=w.SANITIZE_NAMED_PROPS||!1,qs=w.KEEP_CONTENT!==!1,Pr=w.IN_PLACE||!1,X=w.ALLOWED_URI_REGEXP||jg,ir=w.NAMESPACE||on,sr=w.MATHML_TEXT_INTEGRATION_POINTS||sr,Ur=w.HTML_INTEGRATION_POINTS||Ur,st=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&Qs(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(st.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&Qs(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(st.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(st.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),z&&(q=!1),$t&&(nt=!0),Vn&&(Y=xt({},Fg),it=[],Vn.html===!0&&(xt(Y,Vg),xt(it,Gg)),Vn.svg===!0&&(xt(Y,Iu),xt(it,Uu),xt(it,Co)),Vn.svgFilters===!0&&(xt(Y,Nu),xt(it,Uu),xt(it,Co)),Vn.mathMl===!0&&(xt(Y,Pu),xt(it,zg),xt(it,Co))),w.ADD_TAGS&&(Y===ot&&(Y=Dr(Y)),xt(Y,w.ADD_TAGS,ne)),w.ADD_ATTR&&(it===bt&&(it=Dr(it)),xt(it,w.ADD_ATTR,ne)),w.ADD_URI_SAFE_ATTR&&xt(Si,w.ADD_URI_SAFE_ATTR,ne),w.FORBID_CONTENTS&&(Fn===rr&&(Fn=Dr(Fn)),xt(Fn,w.FORBID_CONTENTS,ne)),qs&&(Y["#text"]=!0),gt&&xt(Y,["html","head","body"]),Y.table&&(xt(Y,["tbody"]),delete K.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Us('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Us('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=w.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=VL(p,i)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));ve&&ve(w),zn=w}},qo=xt({},[...Iu,...Nu,...AL]),Yo=xt({},[...Pu,...kL]),Zo=function(w){let Z=b(w);(!Z||!Z.tagName)&&(Z={namespaceURI:ir,tagName:"template"});const W=Mo(w.tagName),lt=Mo(Z.tagName);return Xs[w.namespaceURI]?w.namespaceURI===Mi?Z.namespaceURI===on?W==="svg":Z.namespaceURI===$i?W==="svg"&&(lt==="annotation-xml"||sr[lt]):!!qo[W]:w.namespaceURI===$i?Z.namespaceURI===on?W==="math":Z.namespaceURI===Mi?W==="math"&&Ur[lt]:!!Yo[W]:w.namespaceURI===on?Z.namespaceURI===Mi&&!Ur[lt]||Z.namespaceURI===$i&&!sr[lt]?!1:!Yo[W]&&(ar[W]||!qo[W]):!!(Gn==="application/xhtml+xml"&&Xs[w.namespaceURI]):!1},bn=function(w){Ns(t.removed,{element:w});try{b(w).removeChild(w)}catch{m(w)}},Ai=function(w,Z){try{Ns(t.removed,{attribute:Z.getAttributeNode(w),from:Z})}catch{Ns(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(w),w==="is"&&!it[w])if(nt||$t)try{bn(Z)}catch{}else try{Z.setAttribute(w,"")}catch{}},Xo=function(w){let Z=null,W=null;if(Gt)w="<remove></remove>"+w;else{const Pt=Hg(w,/^[\r\n\t ]+/);W=Pt&&Pt[0]}Gn==="application/xhtml+xml"&&ir===on&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");const lt=T?T.createHTML(w):w;if(ir===on)try{Z=new h().parseFromString(lt,Gn)}catch{}if(!Z||!Z.documentElement){Z=O.createDocument(ir,"template",null);try{Z.documentElement.innerHTML=Zs?E:lt}catch{}}const Ct=Z.body||Z.documentElement;return w&&W&&Ct.insertBefore(n.createTextNode(W),Ct.childNodes[0]||null),ir===on?L.call(Z,gt?"html":"body")[0]:gt?Z.documentElement:Ct},Ko=function(w){return A.call(w.ownerDocument||w,w,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Qo=function(w){return w instanceof d&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof u)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},M=function(w){return typeof o=="function"&&w instanceof o};function j(w,Z,W){$[w]&&$o($[w],lt=>{lt.call(t,Z,W,zn)})}const Q=function(w){let Z=null;if(j("beforeSanitizeElements",w,null),Qo(w))return bn(w),!0;const W=ne(w.nodeName);if(j("uponSanitizeElement",w,{tagName:W,allowedTags:Y}),w.hasChildNodes()&&!M(w.firstElementChild)&&ye(/<[/\w]/g,w.innerHTML)&&ye(/<[/\w]/g,w.textContent)||w.nodeType===Hs.progressingInstruction||Dt&&w.nodeType===Hs.comment&&ye(/<[/\w]/g,w.data))return bn(w),!0;if(!Y[W]||K[W]){if(!K[W]&&Tt(W)&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,W)||st.tagNameCheck instanceof Function&&st.tagNameCheck(W)))return!1;if(qs&&!Fn[W]){const lt=b(w)||w.parentNode,Ct=g(w)||w.childNodes;if(Ct&<){const Pt=Ct.length;for(let oe=Pt-1;oe>=0;--oe){const Ut=v(Ct[oe],!0);Ut.__removalCount=(w.__removalCount||0)+1,lt.insertBefore(Ut,y(w))}}}return bn(w),!0}return w instanceof l&&!Zo(w)||(W==="noscript"||W==="noembed"||W==="noframes")&&ye(/<\/no(script|embed|frames)/i,w.innerHTML)?(bn(w),!0):(z&&w.nodeType===Hs.text&&(Z=w.textContent,$o([F,P,H],lt=>{Z=Ps(Z,lt," ")}),w.textContent!==Z&&(Ns(t.removed,{element:w.cloneNode()}),w.textContent=Z)),j("afterSanitizeElements",w,null),!1)},ut=function(w,Z,W){if(Pe&&(Z==="id"||Z==="name")&&(W in n||W in uh))return!1;if(!(q&&!et[Z]&&ye(_,Z))&&!(mt&&ye(C,Z))){if(!it[Z]||et[Z]){if(!(Tt(w)&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,w)||st.tagNameCheck instanceof Function&&st.tagNameCheck(w))&&(st.attributeNameCheck instanceof RegExp&&ye(st.attributeNameCheck,Z)||st.attributeNameCheck instanceof Function&&st.attributeNameCheck(Z))||Z==="is"&&st.allowCustomizedBuiltInElements&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,W)||st.tagNameCheck instanceof Function&&st.tagNameCheck(W))))return!1}else if(!Si[Z]&&!ye(X,Ps(W,U,""))&&!((Z==="src"||Z==="xlink:href"||Z==="href")&&w!=="script"&&wL(W,"data:")===0&&jo[w])&&!(J&&!ye(k,Ps(W,U,"")))&&W)return!1}return!0},Tt=function(w){return w!=="annotation-xml"&&Hg(w,B)},Mt=function(w){j("beforeSanitizeAttributes",w,null);const{attributes:Z}=w;if(!Z)return;const W={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:it,forceKeepAttr:void 0};let lt=Z.length;for(;lt--;){const Ct=Z[lt],{name:Pt,namespaceURI:oe,value:Ut}=Ct,$e=ne(Pt);let le=Pt==="value"?Ut:$L(Ut);if(W.attrName=$e,W.attrValue=le,W.keepAttr=!0,W.forceKeepAttr=void 0,j("uponSanitizeAttribute",w,W),le=W.attrValue,zo&&($e==="id"||$e==="name")&&(Ai(Pt,w),le=Ws+le),Dt&&ye(/((--!?|])>)|<\/(style|title)/i,le)){Ai(Pt,w);continue}if(W.forceKeepAttr||(Ai(Pt,w),!W.keepAttr))continue;if(!dt&&ye(/\/>/i,le)){Ai(Pt,w);continue}z&&$o([F,P,H],kU=>{le=Ps(le,kU," ")});const Jo=ne(w.nodeName);if(ut(Jo,$e,le)){if(T&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!oe)switch(p.getAttributeType(Jo,$e)){case"TrustedHTML":{le=T.createHTML(le);break}case"TrustedScriptURL":{le=T.createScriptURL(le);break}}try{oe?w.setAttributeNS(oe,Pt,le):w.setAttribute(Pt,le),Qo(w)?bn(w):Bg(t.removed)}catch{}}}j("afterSanitizeAttributes",w,null)},_t=function w(Z){let W=null;const lt=Ko(Z);for(j("beforeSanitizeShadowDOM",Z,null);W=lt.nextNode();)j("uponSanitizeShadowNode",W,null),!Q(W)&&(W.content instanceof s&&w(W.content),Mt(W));j("afterSanitizeShadowDOM",Z,null)};return t.sanitize=function(w){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,lt=null,Ct=null,Pt=null;if(Zs=!w,Zs&&(w="<!-->"),typeof w!="string"&&!M(w))if(typeof w.toString=="function"){if(w=w.toString(),typeof w!="string")throw Us("dirty is not a string, aborting")}else throw Us("toString is not a function");if(!t.isSupported)return w;if(Wt||Ci(Z),t.removed=[],typeof w=="string"&&(Pr=!1),Pr){if(w.nodeName){const $e=ne(w.nodeName);if(!Y[$e]||K[$e])throw Us("root node is forbidden and cannot be sanitized in-place")}}else if(w instanceof o)W=Xo("<!---->"),lt=W.ownerDocument.importNode(w,!0),lt.nodeType===Hs.element&<.nodeName==="BODY"||lt.nodeName==="HTML"?W=lt:W.appendChild(lt);else{if(!nt&&!z&&!gt&&w.indexOf("<")===-1)return T&&be?T.createHTML(w):w;if(W=Xo(w),!W)return nt?null:be?E:""}W&&Gt&&bn(W.firstChild);const oe=Ko(Pr?w:W);for(;Ct=oe.nextNode();)Q(Ct)||(Ct.content instanceof s&&_t(Ct.content),Mt(Ct));if(Pr)return w;if(nt){if($t)for(Pt=I.call(W.ownerDocument);W.firstChild;)Pt.appendChild(W.firstChild);else Pt=W;return(it.shadowroot||it.shadowrootmode)&&(Pt=R.call(r,Pt,!0)),Pt}let Ut=gt?W.outerHTML:W.innerHTML;return gt&&Y["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&ye(Wg,W.ownerDocument.doctype.name)&&(Ut="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
|
|
4
|
-
`+
|
|
1
|
+
(function(Y,St){typeof exports=="object"&&typeof module<"u"?St(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],St):(Y=typeof globalThis<"u"?globalThis:Y||self,St(Y.ChartsReact={},Y.jsxRuntime))})(this,function(Y,St){"use strict";var nH=Object.defineProperty;var rH=(Y,St,er)=>St in Y?nH(Y,St,{enumerable:!0,configurable:!0,writable:!0,value:er}):Y[St]=er;var Gh=(Y,St,er)=>rH(Y,typeof St!="symbol"?St+"":St,er);var er=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(er||{}),Tl=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Tl||{}),Sl=(e=>(e.UPDATE="model-update",e))(Sl||{}),jh=(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))(jh||{}),wl=(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))(wl||{}),$l=(e=>(e.CHANGE="zoom-domain-change",e))($l||{}),Ml=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Ml||{}),Cl=(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))(Cl||{}),Al=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Al||{}),kl=(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))(kl||{}),Rl=(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))(Rl||{}),Ll=(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))(Ll||{}),Dl=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Dl||{}),Il=(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))(Il||{}),Nl=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Nl||{}),Pl=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Pl||{}),Ul=(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))(Ul||{}),Bl=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Bl||{}),Hl=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Hl||{}),Zr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Zr||{}),Vl=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Vl||{}),Wh=(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))(Wh||{}),qh=(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))(qh||{}),Yh=(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))(Yh||{}),Zh=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Zh||{}),Xh=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Xh||{}),Xr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Xr||{});const O1=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Yh,Area:Al,Axis:Cl,Bar:Dl,Boxplot:Il,CanvasZoom:Ml,Chart:er,Choropleth:Xr,CirclePack:qh,Gauge:Ll,Heatmap:Xh,Legend:Wh,Line:Pl,Meter:Zh,Modal:Tl,Model:Sl,Pie:Rl,Radar:Ul,Scatter:Nl,Threshold:Vl,Toolbar:jh,Tooltip:Zr,Tree:Bl,Treemap:Hl,WordCloud:kl,ZoomBar:wl,ZoomDomain:$l},Symbol.toStringTag,{value:"Module"})),w=O1;var ut=(e=>(e.HTML="html",e.SVG="svg",e))(ut||{}),Fl=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Fl||{}),dt=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(dt||{}),Z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(Z||{}),rn=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(rn||{}),We=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(We||{}),re=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(re||{}),lt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(lt||{}),Kr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Kr||{}),ie=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(ie||{}),Qr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Qr||{}),ps=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(ps||{}),Ut=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Ut||{}),mt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(mt||{}),vr=(e=>(e.CENTER="center",e))(vr||{}),qi=(e=>(e.LEFT="left",e.RIGHT="right",e))(qi||{}),ae=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(ae||{}),bn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(bn||{}),_n=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(_n||{}),yr=(e=>(e.SEMI="semi",e.FULL="full",e))(yr||{}),fs=(e=>(e.UP="up",e.DOWN="down",e))(fs||{}),Yi=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Yi||{}),Zi=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Zi||{}),Ie=(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))(Ie||{}),kt=(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))(kt||{}),ms=(e=>(e.LEFT="left",e.RIGHT="right",e))(ms||{}),se=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(se||{}),Xi=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Xi||{}),Jr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Jr||{}),Ki=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Ki||{}),xn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(xn||{}),Kh=(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))(Kh||{});function Gl(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Qi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):s;i=e.formattingValues[o]||e.formattingValues[s]}else{const s=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function Ji(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const s=a[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?S1(o,d=>d.test(s)):T1(o,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function T1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function S1(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function w1(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const o=t.slice(i.length);return{value:s,rest:o}}}const Qh=6048e5,$1=864e5,Jh=6e4,td=36e5,ed=Symbol.for("constructDateFrom");function qe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ed in e?e[ed](t):e instanceof Date?new e.constructor(t):new Date(t)}function br(e,...t){const n=qe.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let M1={};function gs(){return M1}function Xt(e,t){return qe(t||e,e)}function ta(e,t){var n,r,i,a;const s=gs(),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)??s.weekStartsOn??((a=(i=s.locale)==null?void 0:i.options)==null?void 0:a.weekStartsOn)??0,l=Xt(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 C1={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"}},A1=(e,t,n)=>{let r;const i=C1[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},k1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},R1=(e,t,n,r)=>k1[e],L1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},D1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},I1={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"]},N1={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"]},P1={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"}},U1={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"}},B1=(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"},H1={ordinalNumber:B1,era:Qi({values:L1,defaultWidth:"wide"}),quarter:Qi({values:D1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Qi({values:I1,defaultWidth:"wide"}),day:Qi({values:N1,defaultWidth:"wide"}),dayPeriod:Qi({values:P1,defaultWidth:"wide",formattingValues:U1,defaultFormattingWidth:"wide"})},V1=/^(\d+)(th|st|nd|rd)?/i,F1=/\d+/i,G1={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},z1={any:[/^b/i,/^(a|c)/i]},j1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},W1={any:[/1/i,/2/i,/3/i,/4/i]},q1={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},Y1={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]},Z1={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},X1={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]},K1={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},Q1={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}},J1={ordinalNumber:w1({matchPattern:V1,parsePattern:F1,valueCallback:e=>parseInt(e,10)}),era:Ji({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),quarter:Ji({matchPatterns:j1,defaultMatchWidth:"wide",parsePatterns:W1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ji({matchPatterns:q1,defaultMatchWidth:"wide",parsePatterns:Y1,defaultParseWidth:"any"}),day:Ji({matchPatterns:Z1,defaultMatchWidth:"wide",parsePatterns:X1,defaultParseWidth:"any"}),dayPeriod:Ji({matchPatterns:K1,defaultMatchWidth:"any",parsePatterns:Q1,defaultParseWidth:"any"})},ty={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ey={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ny={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ry={date:Gl({formats:ty,defaultWidth:"full"}),time:Gl({formats:ey,defaultWidth:"full"}),dateTime:Gl({formats:ny,defaultWidth:"full"})},nd={code:"en-US",formatDistance:A1,formatLong:ry,formatRelative:R1,localize:H1,match:J1,options:{weekStartsOn:0,firstWeekContainsDate:1}};var rd=typeof global=="object"&&global&&global.Object===Object&&global,iy=typeof self=="object"&&self&&self.Object===Object&&self,an=rd||iy||Function("return this")(),Ye=an.Symbol,id=Object.prototype,ay=id.hasOwnProperty,sy=id.toString,ea=Ye?Ye.toStringTag:void 0;function oy(e){var t=ay.call(e,ea),n=e[ea];try{e[ea]=void 0;var r=!0}catch{}var i=sy.call(e);return r&&(t?e[ea]=n:delete e[ea]),i}var ly=Object.prototype,cy=ly.toString;function uy(e){return cy.call(e)}var hy="[object Null]",dy="[object Undefined]",ad=Ye?Ye.toStringTag:void 0;function _r(e){return e==null?e===void 0?dy:hy:ad&&ad in Object(e)?oy(e):uy(e)}function En(e){return e!=null&&typeof e=="object"}var py="[object Symbol]";function vs(e){return typeof e=="symbol"||En(e)&&_r(e)==py}function zl(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 fe=Array.isArray,fy=1/0,sd=Ye?Ye.prototype:void 0,od=sd?sd.toString:void 0;function ld(e){if(typeof e=="string")return e;if(fe(e))return zl(e,ld)+"";if(vs(e))return od?od.call(e):"";var t=e+"";return t=="0"&&1/e==-fy?"-0":t}function Ze(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function jl(e){return e}var my="[object AsyncFunction]",gy="[object Function]",vy="[object GeneratorFunction]",yy="[object Proxy]";function Wl(e){if(!Ze(e))return!1;var t=_r(e);return t==gy||t==vy||t==my||t==yy}var ql=an["__core-js_shared__"],cd=function(){var e=/[^.]+$/.exec(ql&&ql.keys&&ql.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function by(e){return!!cd&&cd in e}var _y=Function.prototype,xy=_y.toString;function xr(e){if(e!=null){try{return xy.call(e)}catch{}try{return e+""}catch{}}return""}var Ey=/[\\^$.*+?()[\]{}|]/g,Oy=/^\[object .+?Constructor\]$/,Ty=Function.prototype,Sy=Object.prototype,wy=Ty.toString,$y=Sy.hasOwnProperty,My=RegExp("^"+wy.call($y).replace(Ey,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cy(e){if(!Ze(e)||by(e))return!1;var t=Wl(e)?My:Oy;return t.test(xr(e))}function Ay(e,t){return e==null?void 0:e[t]}function Er(e,t){var n=Ay(e,t);return Cy(n)?n:void 0}var Yl=Er(an,"WeakMap"),ud=Object.create,ky=function(){function e(){}return function(t){if(!Ze(t))return{};if(ud)return ud(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Ry(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 Ly(){}function hd(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Dy=800,Iy=16,Ny=Date.now;function Py(e){var t=0,n=0;return function(){var r=Ny(),i=Iy-(r-n);if(n=r,i>0){if(++t>=Dy)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Uy(e){return function(){return e}}var ys=function(){try{var e=Er(Object,"defineProperty");return e({},"",{}),e}catch{}}(),By=ys?function(e,t){return ys(e,"toString",{configurable:!0,enumerable:!1,value:Uy(t),writable:!0})}:jl,dd=Py(By);function Hy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function Vy(e,t,n,r){for(var i=e.length,a=n+-1;++a<i;)if(t(e[a],a,e))return a;return-1}function Fy(e){return e!==e}function Gy(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function zy(e,t,n){return t===t?Gy(e,t,n):Vy(e,Fy,n)}function jy(e,t){var n=e==null?0:e.length;return!!n&&zy(e,t,0)>-1}var Wy=9007199254740991,qy=/^(?:0|[1-9]\d*)$/;function Zl(e,t){var n=typeof e;return t=t??Wy,!!t&&(n=="number"||n!="symbol"&&qy.test(e))&&e>-1&&e%1==0&&e<t}function bs(e,t,n){t=="__proto__"&&ys?ys(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function na(e,t){return e===t||e!==e&&t!==t}var Yy=Object.prototype,Zy=Yy.hasOwnProperty;function pd(e,t,n){var r=e[t];(!(Zy.call(e,t)&&na(r,n))||n===void 0&&!(t in e))&&bs(e,t,n)}function ti(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var o=t[a],l=void 0;l===void 0&&(l=e[o]),i?bs(n,o,l):pd(n,o,l)}return n}var fd=Math.max;function md(e,t,n){return t=fd(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=fd(r.length-t,0),s=Array(a);++i<a;)s[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(s),Ry(e,this,o)}}function Xl(e,t){return dd(md(e,t,jl),e+"")}var Xy=9007199254740991;function Kl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Xy}function Or(e){return e!=null&&Kl(e.length)&&!Wl(e)}function Ky(e,t,n){if(!Ze(n))return!1;var r=typeof t;return(r=="number"?Or(n)&&Zl(t,n.length):r=="string"&&t in n)?na(n[t],e):!1}function Qy(e){return Xl(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,s&&Ky(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,a)}return t})}var Jy=Object.prototype;function _s(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Jy;return e===n}function tb(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var eb="[object Arguments]";function gd(e){return En(e)&&_r(e)==eb}var vd=Object.prototype,nb=vd.hasOwnProperty,rb=vd.propertyIsEnumerable,ei=gd(function(){return arguments}())?gd:function(e){return En(e)&&nb.call(e,"callee")&&!rb.call(e,"callee")};function ib(){return!1}var yd=typeof Y=="object"&&Y&&!Y.nodeType&&Y,bd=yd&&typeof module=="object"&&module&&!module.nodeType&&module,ab=bd&&bd.exports===yd,_d=ab?an.Buffer:void 0,sb=_d?_d.isBuffer:void 0,ni=sb||ib,ob="[object Arguments]",lb="[object Array]",cb="[object Boolean]",ub="[object Date]",hb="[object Error]",db="[object Function]",pb="[object Map]",fb="[object Number]",mb="[object Object]",gb="[object RegExp]",vb="[object Set]",yb="[object String]",bb="[object WeakMap]",_b="[object ArrayBuffer]",xb="[object DataView]",Eb="[object Float32Array]",Ob="[object Float64Array]",Tb="[object Int8Array]",Sb="[object Int16Array]",wb="[object Int32Array]",$b="[object Uint8Array]",Mb="[object Uint8ClampedArray]",Cb="[object Uint16Array]",Ab="[object Uint32Array]",Gt={};Gt[Eb]=Gt[Ob]=Gt[Tb]=Gt[Sb]=Gt[wb]=Gt[$b]=Gt[Mb]=Gt[Cb]=Gt[Ab]=!0,Gt[ob]=Gt[lb]=Gt[_b]=Gt[cb]=Gt[xb]=Gt[ub]=Gt[hb]=Gt[db]=Gt[pb]=Gt[fb]=Gt[mb]=Gt[gb]=Gt[vb]=Gt[yb]=Gt[bb]=!1;function kb(e){return En(e)&&Kl(e.length)&&!!Gt[_r(e)]}function Ql(e){return function(t){return e(t)}}var xd=typeof Y=="object"&&Y&&!Y.nodeType&&Y,ra=xd&&typeof module=="object"&&module&&!module.nodeType&&module,Rb=ra&&ra.exports===xd,Jl=Rb&&rd.process,ri=function(){try{var e=ra&&ra.require&&ra.require("util").types;return e||Jl&&Jl.binding&&Jl.binding("util")}catch{}}(),Ed=ri&&ri.isTypedArray,xs=Ed?Ql(Ed):kb,Lb=Object.prototype,Db=Lb.hasOwnProperty;function Od(e,t){var n=fe(e),r=!n&&ei(e),i=!n&&!r&&ni(e),a=!n&&!r&&!i&&xs(e),s=n||r||i||a,o=s?tb(e.length,String):[],l=o.length;for(var c in e)(t||Db.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Zl(c,l)))&&o.push(c);return o}function Td(e,t){return function(n){return e(t(n))}}var Ib=Td(Object.keys,Object),Nb=Object.prototype,Pb=Nb.hasOwnProperty;function Sd(e){if(!_s(e))return Ib(e);var t=[];for(var n in Object(e))Pb.call(e,n)&&n!="constructor"&&t.push(n);return t}function ia(e){return Or(e)?Od(e):Sd(e)}function Ub(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Bb=Object.prototype,Hb=Bb.hasOwnProperty;function Vb(e){if(!Ze(e))return Ub(e);var t=_s(e),n=[];for(var r in e)r=="constructor"&&(t||!Hb.call(e,r))||n.push(r);return n}function aa(e){return Or(e)?Od(e,!0):Vb(e)}var Fb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gb=/^\w*$/;function tc(e,t){if(fe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||vs(e)?!0:Gb.test(e)||!Fb.test(e)||t!=null&&e in Object(t)}var sa=Er(Object,"create");function zb(){this.__data__=sa?sa(null):{},this.size=0}function jb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Wb="__lodash_hash_undefined__",qb=Object.prototype,Yb=qb.hasOwnProperty;function Zb(e){var t=this.__data__;if(sa){var n=t[e];return n===Wb?void 0:n}return Yb.call(t,e)?t[e]:void 0}var Xb=Object.prototype,Kb=Xb.hasOwnProperty;function Qb(e){var t=this.__data__;return sa?t[e]!==void 0:Kb.call(t,e)}var Jb="__lodash_hash_undefined__";function t_(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=sa&&t===void 0?Jb:t,this}function Tr(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])}}Tr.prototype.clear=zb,Tr.prototype.delete=jb,Tr.prototype.get=Zb,Tr.prototype.has=Qb,Tr.prototype.set=t_;function e_(){this.__data__=[],this.size=0}function Es(e,t){for(var n=e.length;n--;)if(na(e[n][0],t))return n;return-1}var n_=Array.prototype,r_=n_.splice;function i_(e){var t=this.__data__,n=Es(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():r_.call(t,n,1),--this.size,!0}function a_(e){var t=this.__data__,n=Es(t,e);return n<0?void 0:t[n][1]}function s_(e){return Es(this.__data__,e)>-1}function o_(e,t){var n=this.__data__,r=Es(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Rn(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])}}Rn.prototype.clear=e_,Rn.prototype.delete=i_,Rn.prototype.get=a_,Rn.prototype.has=s_,Rn.prototype.set=o_;var oa=Er(an,"Map");function l_(){this.size=0,this.__data__={hash:new Tr,map:new(oa||Rn),string:new Tr}}function c_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Os(e,t){var n=e.__data__;return c_(t)?n[typeof t=="string"?"string":"hash"]:n.map}function u_(e){var t=Os(this,e).delete(e);return this.size-=t?1:0,t}function h_(e){return Os(this,e).get(e)}function d_(e){return Os(this,e).has(e)}function p_(e,t){var n=Os(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ln(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])}}Ln.prototype.clear=l_,Ln.prototype.delete=u_,Ln.prototype.get=h_,Ln.prototype.has=d_,Ln.prototype.set=p_;var f_="Expected a function";function ec(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(f_);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=e.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(ec.Cache||Ln),n}ec.Cache=Ln;var m_=500;function g_(e){var t=ec(e,function(r){return n.size===m_&&n.clear(),r}),n=t.cache;return t}var v_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,y_=/\\(\\)?/g,b_=g_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(v_,function(n,r,i,a){t.push(i?a.replace(y_,"$1"):r||n)}),t});function la(e){return e==null?"":ld(e)}function Ts(e,t){return fe(e)?e:tc(e,t)?[e]:b_(la(e))}var __=1/0;function ca(e){if(typeof e=="string"||vs(e))return e;var t=e+"";return t=="0"&&1/e==-__?"-0":t}function nc(e,t){t=Ts(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ca(t[n++])];return n&&n==r?e:void 0}function wt(e,t,n){var r=e==null?void 0:nc(e,t);return r===void 0?n:r}function rc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var wd=Ye?Ye.isConcatSpreadable:void 0;function x_(e){return fe(e)||ei(e)||!!(wd&&e&&e[wd])}function Ss(e,t,n,r,i){var a=-1,s=e.length;for(n||(n=x_),i||(i=[]);++a<s;){var o=e[a];t>0&&n(o)?t>1?Ss(o,t-1,n,r,i):rc(i,o):r||(i[i.length]=o)}return i}var ic=Td(Object.getPrototypeOf,Object),E_="[object Object]",O_=Function.prototype,T_=Object.prototype,$d=O_.toString,S_=T_.hasOwnProperty,w_=$d.call(Object);function Md(e){if(!En(e)||_r(e)!=E_)return!1;var t=ic(e);if(t===null)return!0;var n=S_.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&$d.call(n)==w_}function $_(){this.__data__=new Rn,this.size=0}function M_(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function C_(e){return this.__data__.get(e)}function A_(e){return this.__data__.has(e)}var k_=200;function R_(e,t){var n=this.__data__;if(n instanceof Rn){var r=n.__data__;if(!oa||r.length<k_-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ln(r)}return n.set(e,t),this.size=n.size,this}function sn(e){var t=this.__data__=new Rn(e);this.size=t.size}sn.prototype.clear=$_,sn.prototype.delete=M_,sn.prototype.get=C_,sn.prototype.has=A_,sn.prototype.set=R_;function L_(e,t){return e&&ti(t,ia(t),e)}function D_(e,t){return e&&ti(t,aa(t),e)}var Cd=typeof Y=="object"&&Y&&!Y.nodeType&&Y,Ad=Cd&&typeof module=="object"&&module&&!module.nodeType&&module,I_=Ad&&Ad.exports===Cd,kd=I_?an.Buffer:void 0,Rd=kd?kd.allocUnsafe:void 0;function Ld(e,t){if(t)return e.slice();var n=e.length,r=Rd?Rd(n):new e.constructor(n);return e.copy(r),r}function N_(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var s=e[n];t(s,n,e)&&(a[i++]=s)}return a}function Dd(){return[]}var P_=Object.prototype,U_=P_.propertyIsEnumerable,Id=Object.getOwnPropertySymbols,ac=Id?function(e){return e==null?[]:(e=Object(e),N_(Id(e),function(t){return U_.call(e,t)}))}:Dd;function B_(e,t){return ti(e,ac(e),t)}var H_=Object.getOwnPropertySymbols,Nd=H_?function(e){for(var t=[];e;)rc(t,ac(e)),e=ic(e);return t}:Dd;function V_(e,t){return ti(e,Nd(e),t)}function Pd(e,t,n){var r=t(e);return fe(e)?r:rc(r,n(e))}function sc(e){return Pd(e,ia,ac)}function Ud(e){return Pd(e,aa,Nd)}var oc=Er(an,"DataView"),lc=Er(an,"Promise"),ii=Er(an,"Set"),Bd="[object Map]",F_="[object Object]",Hd="[object Promise]",Vd="[object Set]",Fd="[object WeakMap]",Gd="[object DataView]",G_=xr(oc),z_=xr(oa),j_=xr(lc),W_=xr(ii),q_=xr(Yl),Xe=_r;(oc&&Xe(new oc(new ArrayBuffer(1)))!=Gd||oa&&Xe(new oa)!=Bd||lc&&Xe(lc.resolve())!=Hd||ii&&Xe(new ii)!=Vd||Yl&&Xe(new Yl)!=Fd)&&(Xe=function(e){var t=_r(e),n=t==F_?e.constructor:void 0,r=n?xr(n):"";if(r)switch(r){case G_:return Gd;case z_:return Bd;case j_:return Hd;case W_:return Vd;case q_:return Fd}return t});var Y_=Object.prototype,Z_=Y_.hasOwnProperty;function X_(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Z_.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var ws=an.Uint8Array;function cc(e){var t=new e.constructor(e.byteLength);return new ws(t).set(new ws(e)),t}function K_(e,t){var n=t?cc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Q_=/\w*$/;function J_(e){var t=new e.constructor(e.source,Q_.exec(e));return t.lastIndex=e.lastIndex,t}var zd=Ye?Ye.prototype:void 0,jd=zd?zd.valueOf:void 0;function tx(e){return jd?Object(jd.call(e)):{}}function Wd(e,t){var n=t?cc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var ex="[object Boolean]",nx="[object Date]",rx="[object Map]",ix="[object Number]",ax="[object RegExp]",sx="[object Set]",ox="[object String]",lx="[object Symbol]",cx="[object ArrayBuffer]",ux="[object DataView]",hx="[object Float32Array]",dx="[object Float64Array]",px="[object Int8Array]",fx="[object Int16Array]",mx="[object Int32Array]",gx="[object Uint8Array]",vx="[object Uint8ClampedArray]",yx="[object Uint16Array]",bx="[object Uint32Array]";function _x(e,t,n){var r=e.constructor;switch(t){case cx:return cc(e);case ex:case nx:return new r(+e);case ux:return K_(e,n);case hx:case dx:case px:case fx:case mx:case gx:case vx:case yx:case bx:return Wd(e,n);case rx:return new r;case ix:case ox:return new r(e);case ax:return J_(e);case sx:return new r;case lx:return tx(e)}}function qd(e){return typeof e.constructor=="function"&&!_s(e)?ky(ic(e)):{}}var xx="[object Map]";function Ex(e){return En(e)&&Xe(e)==xx}var Yd=ri&&ri.isMap,Ox=Yd?Ql(Yd):Ex,Tx="[object Set]";function Sx(e){return En(e)&&Xe(e)==Tx}var Zd=ri&&ri.isSet,wx=Zd?Ql(Zd):Sx,$x=1,Mx=2,Cx=4,Xd="[object Arguments]",Ax="[object Array]",kx="[object Boolean]",Rx="[object Date]",Lx="[object Error]",Kd="[object Function]",Dx="[object GeneratorFunction]",Ix="[object Map]",Nx="[object Number]",Qd="[object Object]",Px="[object RegExp]",Ux="[object Set]",Bx="[object String]",Hx="[object Symbol]",Vx="[object WeakMap]",Fx="[object ArrayBuffer]",Gx="[object DataView]",zx="[object Float32Array]",jx="[object Float64Array]",Wx="[object Int8Array]",qx="[object Int16Array]",Yx="[object Int32Array]",Zx="[object Uint8Array]",Xx="[object Uint8ClampedArray]",Kx="[object Uint16Array]",Qx="[object Uint32Array]",Vt={};Vt[Xd]=Vt[Ax]=Vt[Fx]=Vt[Gx]=Vt[kx]=Vt[Rx]=Vt[zx]=Vt[jx]=Vt[Wx]=Vt[qx]=Vt[Yx]=Vt[Ix]=Vt[Nx]=Vt[Qd]=Vt[Px]=Vt[Ux]=Vt[Bx]=Vt[Hx]=Vt[Zx]=Vt[Xx]=Vt[Kx]=Vt[Qx]=!0,Vt[Lx]=Vt[Kd]=Vt[Vx]=!1;function ua(e,t,n,r,i,a){var s,o=t&$x,l=t&Mx,c=t&Cx;if(n&&(s=i?n(e,r,i,a):n(e)),s!==void 0)return s;if(!Ze(e))return e;var u=fe(e);if(u){if(s=X_(e),!o)return hd(e,s)}else{var d=Xe(e),h=d==Kd||d==Dx;if(ni(e))return Ld(e,o);if(d==Qd||d==Xd||h&&!i){if(s=l||h?{}:qd(e),!o)return l?V_(e,D_(s,e)):B_(e,L_(s,e))}else{if(!Vt[d])return i?e:{};s=_x(e,d,o)}}a||(a=new sn);var p=a.get(e);if(p)return p;a.set(e,s),wx(e)?e.forEach(function(m){s.add(ua(m,t,n,m,e,a))}):Ox(e)&&e.forEach(function(m,y){s.set(y,ua(m,t,n,y,e,a))});var f=c?l?Ud:sc:l?aa:ia,g=u?void 0:f(e);return Hy(g||e,function(m,y){g&&(y=m,m=e[y]),pd(s,y,ua(m,t,n,y,e,a))}),s}var Jx=1,tE=4;function Dn(e){return ua(e,Jx|tE)}var eE="__lodash_hash_undefined__";function nE(e){return this.__data__.set(e,eE),this}function rE(e){return this.__data__.has(e)}function ha(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Ln;++t<n;)this.add(e[t])}ha.prototype.add=ha.prototype.push=nE,ha.prototype.has=rE;function Jd(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 tp(e,t){return e.has(t)}var iE=1,aE=2;function ep(e,t,n,r,i,a){var s=n&iE,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=n&aE?new ha:void 0;for(a.set(e,t),a.set(t,e);++d<o;){var f=e[d],g=t[d];if(r)var m=s?r(g,f,d,t,e,a):r(f,g,d,e,t,a);if(m!==void 0){if(m)continue;h=!1;break}if(p){if(!Jd(t,function(y,v){if(!tp(p,v)&&(f===y||i(f,y,n,r,a)))return p.push(v)})){h=!1;break}}else if(!(f===g||i(f,g,n,r,a))){h=!1;break}}return a.delete(e),a.delete(t),h}function sE(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function uc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var oE=1,lE=2,cE="[object Boolean]",uE="[object Date]",hE="[object Error]",dE="[object Map]",pE="[object Number]",fE="[object RegExp]",mE="[object Set]",gE="[object String]",vE="[object Symbol]",yE="[object ArrayBuffer]",bE="[object DataView]",np=Ye?Ye.prototype:void 0,hc=np?np.valueOf:void 0;function _E(e,t,n,r,i,a,s){switch(n){case bE:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case yE:return!(e.byteLength!=t.byteLength||!a(new ws(e),new ws(t)));case cE:case uE:case pE:return na(+e,+t);case hE:return e.name==t.name&&e.message==t.message;case fE:case gE:return e==t+"";case dE:var o=sE;case mE:var l=r&oE;if(o||(o=uc),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=lE,s.set(e,t);var u=ep(o(e),o(t),r,i,a,s);return s.delete(e),u;case vE:if(hc)return hc.call(e)==hc.call(t)}return!1}var xE=1,EE=Object.prototype,OE=EE.hasOwnProperty;function TE(e,t,n,r,i,a){var s=n&xE,o=sc(e),l=o.length,c=sc(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var h=o[d];if(!(s?h in t:OE.call(t,h)))return!1}var p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==e;var g=!0;a.set(e,t),a.set(t,e);for(var m=s;++d<l;){h=o[d];var y=e[h],v=t[h];if(r)var x=s?r(v,y,h,t,e,a):r(y,v,h,e,t,a);if(!(x===void 0?y===v||i(y,v,n,r,a):x)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var T=e.constructor,E=t.constructor;T!=E&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof E=="function"&&E instanceof E)&&(g=!1)}return a.delete(e),a.delete(t),g}var SE=1,rp="[object Arguments]",ip="[object Array]",$s="[object Object]",wE=Object.prototype,ap=wE.hasOwnProperty;function $E(e,t,n,r,i,a){var s=fe(e),o=fe(t),l=s?ip:Xe(e),c=o?ip:Xe(t);l=l==rp?$s:l,c=c==rp?$s:c;var u=l==$s,d=c==$s,h=l==c;if(h&&ni(e)){if(!ni(t))return!1;s=!0,u=!1}if(h&&!u)return a||(a=new sn),s||xs(e)?ep(e,t,n,r,i,a):_E(e,t,l,n,r,i,a);if(!(n&SE)){var p=u&&ap.call(e,"__wrapped__"),f=d&&ap.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return a||(a=new sn),i(g,m,n,r,a)}}return h?(a||(a=new sn),TE(e,t,n,r,i,a)):!1}function Ms(e,t,n,r,i){return e===t?!0:e==null||t==null||!En(e)&&!En(t)?e!==e&&t!==t:$E(e,t,n,r,Ms,i)}var ME=1,CE=2;function AE(e,t,n,r){var i=n.length,a=i;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var o=s[0],l=e[o],c=s[1];if(s[2]){if(l===void 0&&!(o in e))return!1}else{var u=new sn,d;if(!(d===void 0?Ms(c,l,ME|CE,r,u):d))return!1}}return!0}function sp(e){return e===e&&!Ze(e)}function kE(e){for(var t=ia(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,sp(i)]}return t}function op(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function RE(e){var t=kE(e);return t.length==1&&t[0][2]?op(t[0][0],t[0][1]):function(n){return n===e||AE(n,e,t)}}function LE(e,t){return e!=null&&t in Object(e)}function DE(e,t,n){t=Ts(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var s=ca(t[r]);if(!(a=e!=null&&n(e,s)))break;e=e[s]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Kl(i)&&Zl(s,i)&&(fe(e)||ei(e)))}function IE(e,t){return e!=null&&DE(e,t,LE)}var NE=1,PE=2;function UE(e,t){return tc(e)&&sp(t)?op(ca(e),t):function(n){var r=wt(n,e);return r===void 0&&r===t?IE(n,e):Ms(t,r,NE|PE)}}function BE(e){return function(t){return t==null?void 0:t[e]}}function HE(e){return function(t){return nc(t,e)}}function VE(e){return tc(e)?BE(ca(e)):HE(e)}function Cs(e){return typeof e=="function"?e:e==null?jl:typeof e=="object"?fe(e)?UE(e[0],e[1]):RE(e):VE(e)}function FE(e){return function(t,n,r){for(var i=-1,a=Object(t),s=r(t),o=s.length;o--;){var l=s[++i];if(n(a[l],l,a)===!1)break}return t}}var lp=FE();function dc(e,t,n){(n!==void 0&&!na(e[t],n)||n===void 0&&!(t in e))&&bs(e,t,n)}function pc(e){return En(e)&&Or(e)}function fc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function GE(e){return ti(e,aa(e))}function zE(e,t,n,r,i,a,s){var o=fc(e,n),l=fc(t,n),c=s.get(l);if(c){dc(e,n,c);return}var u=a?a(o,l,n+"",e,t,s):void 0,d=u===void 0;if(d){var h=fe(l),p=!h&&ni(l),f=!h&&!p&&xs(l);u=l,h||p||f?fe(o)?u=o:pc(o)?u=hd(o):p?(d=!1,u=Ld(l,!0)):f?(d=!1,u=Wd(l,!0)):u=[]:Md(l)||ei(l)?(u=o,ei(o)?u=GE(o):(!Ze(o)||Wl(o))&&(u=qd(l))):d=!1}d&&(s.set(l,u),i(u,l,r,a,s),s.delete(l)),dc(e,n,u)}function cp(e,t,n,r,i){e!==t&&lp(t,function(a,s){if(i||(i=new sn),Ze(a))zE(e,t,s,n,cp,r,i);else{var o=r?r(fc(e,s),a,s+"",e,t,i):void 0;o===void 0&&(o=a),dc(e,s,o)}},aa)}function up(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var jE="[object Map]",WE="[object Set]",qE=Object.prototype,YE=qE.hasOwnProperty;function on(e){if(e==null)return!0;if(Or(e)&&(fe(e)||typeof e=="string"||typeof e.splice=="function"||ni(e)||xs(e)||ei(e)))return!e.length;var t=Xe(e);if(t==jE||t==WE)return!e.size;if(_s(e))return!Sd(e).length;for(var n in e)if(YE.call(e,n))return!1;return!0}var pt=Qy(function(e,t,n){cp(e,t,n)}),ZE=1/0,XE=ii&&1/uc(new ii([,-0]))[1]==ZE?function(e){return new ii(e)}:Ly,KE=200;function hp(e,t,n){var r=-1,i=jy,a=e.length,s=!0,o=[],l=o;if(a>=KE){var c=t?null:XE(e);if(c)return uc(c);s=!1,i=tp,l=new ha}else l=t?[]:o;t:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,s&&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 QE=Xl(function(e){var t=up(e);return pc(t)&&(t=void 0),hp(Ss(e,1,pc,!0),Cs(t))});function da(e){return e&&e.length?hp(e):[]}function Sr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function JE(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function mc(e){let t,n,r;e.length!==2?(t=Sr,n=(o,l)=>Sr(e(o),l),r=(o,l)=>e(o)-l):(t=e===Sr||e===JE?e:tO,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 a(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){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:s,right:a}}function tO(){return 0}function eO(e){return e===null?NaN:+e}function*nO(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const rO=mc(Sr),gc=rO.right;mc(eO).center;function ln(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 a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}let dp=class extends Map{constructor(t,n=sO){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(pp(this,t))}has(t){return super.has(pp(this,t))}set(t,n){return super.set(iO(this,t),n)}delete(t){return super.delete(aO(this,t))}};function pp({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function iO({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function aO({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function sO(e){return e!==null&&typeof e=="object"?e.valueOf():e}const oO=Math.sqrt(50),lO=Math.sqrt(10),cO=Math.sqrt(2);function As(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=oO?10:a>=lO?5:a>=cO?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/s,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)*s,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?As(e,t,n*2):[o,l,c]}function ks(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?As(t,e,n):As(e,t,n);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(r)if(s<0)for(let c=0;c<o;++c)l[c]=(a-c)/-s;else for(let c=0;c<o;++c)l[c]=(a-c)*s;else if(s<0)for(let c=0;c<o;++c)l[c]=(i+c)/-s;else for(let c=0;c<o;++c)l[c]=(i+c)*s;return l}function ai(e,t,n){return t=+t,e=+e,n=+n,As(e,t,n)[2]}function vc(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ai(t,e,n):ai(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function wr(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 nr(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var uO={value:()=>{}};function yc(){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 Rs(n)}function Rs(e){this._=e}function hO(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}})}Rs.prototype=yc.prototype={constructor:Rs,on:function(e,t){var n=this._,r=hO(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=dO(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=fp(n[i],e.name,t);else if(t==null)for(i in n)n[i]=fp(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 Rs(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[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,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function dO(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function fp(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=uO,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bc="http://www.w3.org/1999/xhtml";const mp={svg:"http://www.w3.org/2000/svg",xhtml:bc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ls(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mp.hasOwnProperty(t)?{space:mp[t],local:e}:e}function pO(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bc&&t.documentElement.namespaceURI===bc?t.createElement(e):t.createElementNS(n,e)}}function fO(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gp(e){var t=Ls(e);return(t.local?fO:pO)(t)}function mO(){}function _c(e){return e==null?mO:function(){return this.querySelector(e)}}function gO(e){typeof e!="function"&&(e=_c(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=new Array(s),l,c,u=0;u<s;++u)(l=a[u])&&(c=e.call(l,l.__data__,u,a))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new Ne(r,this._parents)}function vO(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yO(){return[]}function vp(e){return e==null?yO:function(){return this.querySelectorAll(e)}}function bO(e){return function(){return vO(e.apply(this,arguments))}}function _O(e){typeof e=="function"?e=bO(e):e=vp(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var s=t[a],o=s.length,l,c=0;c<o;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),i.push(l));return new Ne(r,i)}function yp(e){return function(){return this.matches(e)}}function bp(e){return function(t){return t.matches(e)}}var xO=Array.prototype.find;function EO(e){return function(){return xO.call(this.children,e)}}function OO(){return this.firstElementChild}function TO(e){return this.select(e==null?OO:EO(typeof e=="function"?e:bp(e)))}var SO=Array.prototype.filter;function wO(){return Array.from(this.children)}function $O(e){return function(){return SO.call(this.children,e)}}function MO(e){return this.selectAll(e==null?wO:$O(typeof e=="function"?e:bp(e)))}function CO(e){typeof e!="function"&&(e=yp(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&o.push(l);return new Ne(r,this._parents)}function _p(e){return new Array(e.length)}function AO(){return new Ne(this._enter||this._groups.map(_p),this._parents)}function Ds(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ds.prototype={constructor:Ds,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 kO(e){return function(){return e}}function RO(e,t,n,r,i,a){for(var s=0,o,l=t.length,c=a.length;s<c;++s)(o=t[s])?(o.__data__=a[s],r[s]=o):n[s]=new Ds(e,a[s]);for(;s<l;++s)(o=t[s])&&(i[s]=o)}function LO(e,t,n,r,i,a,s){var o,l,c=new Map,u=t.length,d=a.length,h=new Array(u),p;for(o=0;o<u;++o)(l=t[o])&&(h[o]=p=s.call(l,l.__data__,o,t)+"",c.has(p)?i[o]=l:c.set(p,l));for(o=0;o<d;++o)p=s.call(e,a[o],o,a)+"",(l=c.get(p))?(r[o]=l,l.__data__=a[o],c.delete(p)):n[o]=new Ds(e,a[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function DO(e){return e.__data__}function IO(e,t){if(!arguments.length)return Array.from(this,DO);var n=t?LO:RO,r=this._parents,i=this._groups;typeof e!="function"&&(e=kO(e));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),c=0;c<a;++c){var u=r[c],d=i[c],h=d.length,p=NO(e.call(u,u&&u.__data__,c,r)),f=p.length,g=o[c]=new Array(f),m=s[c]=new Array(f),y=l[c]=new Array(h);n(u,d,g,m,y,p,t);for(var v=0,x=0,T,E;v<f;++v)if(T=g[v]){for(v>=x&&(x=v+1);!(E=m[x])&&++x<f;);T._next=E||null}}return s=new Ne(s,r),s._enter=o,s._exit=l,s}function NO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PO(){return new Ne(this._exit||this._groups.map(_p),this._parents)}function UO(e,t,n){var r=this.enter(),i=this,a=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?a.remove():n(a),r&&i?r.merge(i).order():i}function BO(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++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 Ne(o,this._parents)}function HO(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],s;--i>=0;)(s=r[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function VO(e){e||(e=FO);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),a=0;a<r;++a){for(var s=n[a],o=s.length,l=i[a]=new Array(o),c,u=0;u<o;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new Ne(i,this._parents).order()}function FO(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function GO(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zO(){return Array.from(this)}function jO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function WO(){let e=0;for(const t of this)++e;return e}function qO(){return!this.node()}function YO(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function ZO(e){return function(){this.removeAttribute(e)}}function XO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function KO(e,t){return function(){this.setAttribute(e,t)}}function QO(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function JO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tT(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 eT(e,t){var n=Ls(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?XO:ZO:typeof t=="function"?n.local?tT:JO:n.local?QO:KO)(n,t))}function xp(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nT(e){return function(){this.style.removeProperty(e)}}function rT(e,t,n){return function(){this.style.setProperty(e,t,n)}}function iT(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function aT(e,t,n){return arguments.length>1?this.each((t==null?nT:typeof t=="function"?iT:rT)(e,t,n??"")):si(this.node(),e)}function si(e,t){return e.style.getPropertyValue(t)||xp(e).getComputedStyle(e,null).getPropertyValue(t)}function sT(e){return function(){delete this[e]}}function oT(e,t){return function(){this[e]=t}}function lT(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function cT(e,t){return arguments.length>1?this.each((t==null?sT:typeof t=="function"?lT:oT)(e,t)):this.node()[e]}function Ep(e){return e.trim().split(/^|\s+/)}function xc(e){return e.classList||new Op(e)}function Op(e){this._node=e,this._names=Ep(e.getAttribute("class")||"")}Op.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 Tp(e,t){for(var n=xc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Sp(e,t){for(var n=xc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function uT(e){return function(){Tp(this,e)}}function hT(e){return function(){Sp(this,e)}}function dT(e,t){return function(){(t.apply(this,arguments)?Tp:Sp)(this,e)}}function pT(e,t){var n=Ep(e+"");if(arguments.length<2){for(var r=xc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?dT:t?uT:hT)(n,t))}function fT(){this.textContent=""}function mT(e){return function(){this.textContent=e}}function gT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function vT(e){return arguments.length?this.each(e==null?fT:(typeof e=="function"?gT:mT)(e)):this.node().textContent}function yT(){this.innerHTML=""}function bT(e){return function(){this.innerHTML=e}}function _T(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function xT(e){return arguments.length?this.each(e==null?yT:(typeof e=="function"?_T:bT)(e)):this.node().innerHTML}function ET(){this.nextSibling&&this.parentNode.appendChild(this)}function OT(){return this.each(ET)}function TT(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ST(){return this.each(TT)}function wT(e){var t=typeof e=="function"?e:gp(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function $T(){return null}function MT(e,t){var n=typeof e=="function"?e:gp(e),r=t==null?$T:typeof t=="function"?t:_c(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function CT(){var e=this.parentNode;e&&e.removeChild(this)}function AT(){return this.each(CT)}function kT(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function RT(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function LT(e){return this.select(e?RT:kT)}function DT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function IT(e){return function(t){e.call(this,t,this.__data__)}}function NT(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 PT(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function UT(e,t,n){return function(){var r=this.__on,i,a=IT(t);if(r){for(var s=0,o=r.length;s<o;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function BT(e,t,n){var r=NT(e+""),i,a=r.length,s;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<a;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(o=t?UT:PT,i=0;i<a;++i)this.each(o(r[i],t,n));return this}function wp(e,t,n){var r=xp(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 HT(e,t){return function(){return wp(this,e,t)}}function VT(e,t){return function(){return wp(this,e,t.apply(this,arguments))}}function FT(e,t){return this.each((typeof t=="function"?VT:HT)(e,t))}function*GT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,s;i<a;++i)(s=r[i])&&(yield s)}var $p=[null];function Ne(e,t){this._groups=e,this._parents=t}function pa(){return new Ne([[document.documentElement]],$p)}function zT(){return this}Ne.prototype=pa.prototype={constructor:Ne,select:gO,selectAll:_O,selectChild:TO,selectChildren:MO,filter:CO,data:IO,enter:AO,exit:PO,join:UO,merge:BO,selection:zT,order:HO,sort:VO,call:GO,nodes:zO,node:jO,size:WO,empty:qO,each:YO,attr:eT,style:aT,property:cT,classed:pT,text:vT,html:xT,raise:OT,lower:ST,append:wT,insert:MT,remove:AT,clone:LT,datum:DT,on:BT,dispatch:FT,[Symbol.iterator]:GT};function jT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function $r(e,t){if(e=jT(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 Ec(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Mp(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function fa(){}var ma=.7,Is=1/ma,oi="\\s*([+-]?\\d+)\\s*",ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",On="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",WT=/^#([0-9a-f]{3,8})$/,qT=new RegExp(`^rgb\\(${oi},${oi},${oi}\\)$`),YT=new RegExp(`^rgb\\(${On},${On},${On}\\)$`),ZT=new RegExp(`^rgba\\(${oi},${oi},${oi},${ga}\\)$`),XT=new RegExp(`^rgba\\(${On},${On},${On},${ga}\\)$`),KT=new RegExp(`^hsl\\(${ga},${On},${On}\\)$`),QT=new RegExp(`^hsla\\(${ga},${On},${On},${ga}\\)$`),Cp={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};Ec(fa,In,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ap,formatHex:Ap,formatHex8:JT,formatHsl:tS,formatRgb:kp,toString:kp});function Ap(){return this.rgb().formatHex()}function JT(){return this.rgb().formatHex8()}function tS(){return Np(this).formatHsl()}function kp(){return this.rgb().formatRgb()}function In(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=WT.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Rp(t):n===3?new Me(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ns(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ns(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=qT.exec(e))?new Me(t[1],t[2],t[3],1):(t=YT.exec(e))?new Me(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ZT.exec(e))?Ns(t[1],t[2],t[3],t[4]):(t=XT.exec(e))?Ns(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=KT.exec(e))?Ip(t[1],t[2]/100,t[3]/100,1):(t=QT.exec(e))?Ip(t[1],t[2]/100,t[3]/100,t[4]):Cp.hasOwnProperty(e)?Rp(Cp[e]):e==="transparent"?new Me(NaN,NaN,NaN,0):null}function Rp(e){return new Me(e>>16&255,e>>8&255,e&255,1)}function Ns(e,t,n,r){return r<=0&&(e=t=n=NaN),new Me(e,t,n,r)}function eS(e){return e instanceof fa||(e=In(e)),e?(e=e.rgb(),new Me(e.r,e.g,e.b,e.opacity)):new Me}function Oc(e,t,n,r){return arguments.length===1?eS(e):new Me(e,t,n,r??1)}function Me(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ec(Me,Oc,Mp(fa,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ma:Math.pow(ma,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Me(Mr(this.r),Mr(this.g),Mr(this.b),Ps(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:Lp,formatHex:Lp,formatHex8:nS,formatRgb:Dp,toString:Dp}));function Lp(){return`#${Cr(this.r)}${Cr(this.g)}${Cr(this.b)}`}function nS(){return`#${Cr(this.r)}${Cr(this.g)}${Cr(this.b)}${Cr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Dp(){const e=Ps(this.opacity);return`${e===1?"rgb(":"rgba("}${Mr(this.r)}, ${Mr(this.g)}, ${Mr(this.b)}${e===1?")":`, ${e})`}`}function Ps(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cr(e){return e=Mr(e),(e<16?"0":"")+e.toString(16)}function Ip(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new cn(e,t,n,r)}function Np(e){if(e instanceof cn)return new cn(e.h,e.s,e.l,e.opacity);if(e instanceof fa||(e=In(e)),!e)return new cn;if(e instanceof cn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new cn(s,o,l,e.opacity)}function Pp(e,t,n,r){return arguments.length===1?Np(e):new cn(e,t,n,r??1)}function cn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ec(cn,Pp,Mp(fa,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new cn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ma:Math.pow(ma,e),new cn(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 Me(Tc(e>=240?e-240:e+120,i,r),Tc(e,i,r),Tc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new cn(Up(this.h),Us(this.s),Us(this.l),Ps(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=Ps(this.opacity);return`${e===1?"hsl(":"hsla("}${Up(this.h)}, ${Us(this.s)*100}%, ${Us(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Up(e){return e=(e||0)%360,e<0?e+360:e}function Us(e){return Math.max(0,Math.min(1,e||0))}function Tc(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 Sc=e=>()=>e;function rS(e,t){return function(n){return e+n*t}}function iS(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 aS(e){return(e=+e)==1?Bp:function(t,n){return n-t?iS(t,n,e):Sc(isNaN(t)?n:t)}}function Bp(e,t){var n=t-e;return n?rS(e,n):Sc(isNaN(e)?t:e)}const Bs=function e(t){var n=aS(t);function r(i,a){var s=n((i=Oc(i)).r,(a=Oc(a)).r),o=n(i.g,a.g),l=n(i.b,a.b),c=Bp(i.opacity,a.opacity);return function(u){return i.r=s(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function sS(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function oS(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lS(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=va(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function cS(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Pe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uS(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]=va(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var wc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$c=new RegExp(wc.source,"g");function hS(e){return function(){return e}}function dS(e){return function(t){return e(t)+""}}function Hp(e,t){var n=wc.lastIndex=$c.lastIndex=0,r,i,a,s=-1,o=[],l=[];for(e=e+"",t=t+"";(r=wc.exec(e))&&(i=$c.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Pe(r,i)})),n=$c.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?l[0]?dS(l[0].x):hS(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 va(e,t){var n=typeof t,r;return t==null||n==="boolean"?Sc(t):(n==="number"?Pe:n==="string"?(r=In(t))?(t=r,Bs):Hp:t instanceof In?Bs:t instanceof Date?cS:oS(t)?sS:Array.isArray(t)?lS:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uS:Pe)(e,t)}function Vp(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Fp=180/Math.PI,Gp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zp(e,t,n,r,i,a){var s,o,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(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,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Fp,skewX:Math.atan(l)*Fp,scaleX:s,scaleY:o}}var Hs;function pS(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Gp:zp(t.a,t.b,t.c,t.d,t.e,t.f)}function fS(e){return e==null||(Hs||(Hs=document.createElementNS("http://www.w3.org/2000/svg","g")),Hs.setAttribute("transform",e),!(e=Hs.transform.baseVal.consolidate()))?Gp:(e=e.matrix,zp(e.a,e.b,e.c,e.d,e.e,e.f))}function jp(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function a(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:Pe(c,d)},{i:g-2,x:Pe(u,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function s(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:Pe(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:Pe(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:Pe(c,d)},{i:g-2,x:Pe(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),a(c.translateX,c.translateY,u.translateX,u.translateY,d,h),s(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 mS=jp(pS,"px, ","px)","deg)"),gS=jp(fS,", ",")",")"),li=0,ya=0,ba=0,Wp=1e3,Vs,_a,Fs=0,Ar=0,Gs=0,xa=typeof performance=="object"&&performance.now?performance:Date,qp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Mc(){return Ar||(qp(vS),Ar=xa.now()+Gs)}function vS(){Ar=0}function zs(){this._call=this._time=this._next=null}zs.prototype=Yp.prototype={constructor:zs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Mc():+n)+(t==null?0:+t),!this._next&&_a!==this&&(_a?_a._next=this:Vs=this,_a=this),this._call=e,this._time=n,Cc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cc())}};function Yp(e,t,n){var r=new zs;return r.restart(e,t,n),r}function yS(){Mc(),++li;for(var e=Vs,t;e;)(t=Ar-e._time)>=0&&e._call.call(void 0,t),e=e._next;--li}function Zp(){Ar=(Fs=xa.now())+Gs,li=ya=0;try{yS()}finally{li=0,_S(),Ar=0}}function bS(){var e=xa.now(),t=e-Fs;t>Wp&&(Gs-=t,Fs=e)}function _S(){for(var e,t=Vs,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:Vs=n);_a=e,Cc(r)}function Cc(e){if(!li){ya&&(ya=clearTimeout(ya));var t=e-Ar;t>24?(e<1/0&&(ya=setTimeout(Zp,e-xa.now()-Gs)),ba&&(ba=clearInterval(ba))):(ba||(Fs=xa.now(),ba=setInterval(bS,Wp)),li=1,qp(Zp))}}function Xp(e,t,n){var r=new zs;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var xS=yc("start","end","cancel","interrupt"),ES=[],Kp=0,Qp=1,Ac=2,js=3,Jp=4,kc=5,Ws=6;function qs(e,t,n,r,i,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;OS(e,n,{name:t,index:r,group:i,on:xS,tween:ES,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Kp})}function Rc(e,t){var n=un(e,t);if(n.state>Kp)throw new Error("too late; already scheduled");return n}function Tn(e,t){var n=un(e,t);if(n.state>js)throw new Error("too late; already running");return n}function un(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function OS(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Yp(a,0,n.time);function a(c){n.state=Qp,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,h,p;if(n.state!==Qp)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===js)return Xp(s);p.state===Jp?(p.state=Ws,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=Ws,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Xp(function(){n.state===js&&(n.state=Jp,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Ac,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ac){for(n.state=js,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=kc,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===kc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ws,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Lc(e,t){var n=e.__transition,r,i,a=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){a=!1;continue}i=r.state>Ac&&r.state<kc,r.state=Ws,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}a&&delete e.__transition}}function TS(e){return this.each(function(){Lc(this,e)})}function SS(e,t){var n,r;return function(){var i=Tn(this,e),a=i.tween;if(a!==n){r=n=a;for(var s=0,o=r.length;s<o;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function wS(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Tn(this,e),s=a.tween;if(s!==r){i=(r=s).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)}a.tween=i}}function $S(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=un(this.node(),n).tween,i=0,a=r.length,s;i<a;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?SS:wS)(n,e,t))}function Dc(e,t,n){var r=e._id;return e.each(function(){var i=Tn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return un(i,r).value[t]}}function tf(e,t){var n;return(typeof t=="number"?Pe:t instanceof In?Bs:(n=In(t))?(t=n,Bs):Hp)(e,t)}function MS(e){return function(){this.removeAttribute(e)}}function CS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function AS(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===r?a:a=t(r=s,n)}}function kS(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?a:a=t(r=s,n)}}function RS(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function LS(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function DS(e,t){var n=Ls(e),r=n==="transform"?gS:tf;return this.attrTween(e,typeof t=="function"?(n.local?LS:RS)(n,r,Dc(this,"attr."+e,t)):t==null?(n.local?CS:MS)(n):(n.local?kS:AS)(n,r,t))}function IS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function NS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function PS(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&NS(e,a)),n}return i._value=t,i}function US(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&IS(e,a)),n}return i._value=t,i}function BS(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=Ls(e);return this.tween(n,(r.local?PS:US)(r,t))}function HS(e,t){return function(){Rc(this,e).delay=+t.apply(this,arguments)}}function VS(e,t){return t=+t,function(){Rc(this,e).delay=t}}function FS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?HS:VS)(t,e)):un(this.node(),t).delay}function GS(e,t){return function(){Tn(this,e).duration=+t.apply(this,arguments)}}function zS(e,t){return t=+t,function(){Tn(this,e).duration=t}}function jS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?GS:zS)(t,e)):un(this.node(),t).duration}function WS(e,t){if(typeof t!="function")throw new Error;return function(){Tn(this,e).ease=t}}function qS(e){var t=this._id;return arguments.length?this.each(WS(t,e)):un(this.node(),t).ease}function YS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Tn(this,e).ease=n}}function ZS(e){if(typeof e!="function")throw new Error;return this.each(YS(this._id,e))}function XS(e){typeof e!="function"&&(e=yp(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&o.push(l);return new Nn(r,this._parents,this._name,this._id)}function KS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var l=t[o],c=n[o],u=l.length,d=s[o]=new Array(u),h,p=0;p<u;++p)(h=l[p]||c[p])&&(d[p]=h);for(;o<r;++o)s[o]=t[o];return new Nn(s,this._parents,this._name,this._id)}function QS(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 JS(e,t,n){var r,i,a=QS(t)?Rc:Tn;return function(){var s=a(this,e),o=s.on;o!==r&&(i=(r=o).copy()).on(t,n),s.on=i}}function tw(e,t){var n=this._id;return arguments.length<2?un(this.node(),n).on.on(e):this.each(JS(n,e,t))}function ew(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function nw(){return this.on("end.remove",ew(this._id))}function rw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_c(e));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o=r[s],l=o.length,c=a[s]=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,qs(c[h],t,n,h,c,un(u,n)));return new Nn(a,this._parents,t,n)}function iw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vp(e));for(var r=this._groups,i=r.length,a=[],s=[],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=un(u,n),g=0,m=h.length;g<m;++g)(p=h[g])&&qs(p,t,n,g,h,f);a.push(h),s.push(u)}return new Nn(a,s,t,n)}var aw=pa.prototype.constructor;function sw(){return new aw(this._groups,this._parents)}function ow(e,t){var n,r,i;return function(){var a=si(this,e),s=(this.style.removeProperty(e),si(this,e));return a===s?null:a===n&&s===r?i:i=t(n=a,r=s)}}function ef(e){return function(){this.style.removeProperty(e)}}function lw(e,t,n){var r,i=n+"",a;return function(){var s=si(this,e);return s===i?null:s===r?a:a=t(r=s,n)}}function cw(e,t,n){var r,i,a;return function(){var s=si(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),si(this,e))),s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o))}}function uw(e,t){var n,r,i,a="style."+t,s="end."+a,o;return function(){var l=Tn(this,e),c=l.on,u=l.value[a]==null?o||(o=ef(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(s,i=u),l.on=r}}function hw(e,t,n){var r=(e+="")=="transform"?mS:tf;return t==null?this.styleTween(e,ow(e,r)).on("end.style."+e,ef(e)):typeof t=="function"?this.styleTween(e,cw(e,r,Dc(this,"style."+e,t))).each(uw(this._id,e)):this.styleTween(e,lw(e,r,t),n).on("end.style."+e,null)}function dw(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function pw(e,t,n){var r,i;function a(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&dw(e,s,n)),r}return a._value=t,a}function fw(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,pw(e,t,n??""))}function mw(e){return function(){this.textContent=e}}function gw(e){return function(){var t=e(this);this.textContent=t??""}}function vw(e){return this.tween("text",typeof e=="function"?gw(Dc(this,"text",e)):mw(e==null?"":e+""))}function yw(e){return function(t){this.textContent=e.call(this,t)}}function bw(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&yw(i)),t}return r._value=e,r}function _w(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,bw(e))}function xw(){for(var e=this._name,t=this._id,n=nf(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,c=0;c<o;++c)if(l=s[c]){var u=un(l,t);qs(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Nn(r,this._parents,e,n)}function Ew(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,s){var o={value:s},l={value:function(){--i===0&&a()}};n.each(function(){var c=Tn(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&&a()})}var Ow=0;function Nn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function nf(){return++Ow}var Pn=pa.prototype;Nn.prototype={constructor:Nn,select:rw,selectAll:iw,selectChild:Pn.selectChild,selectChildren:Pn.selectChildren,filter:XS,merge:KS,selection:sw,transition:xw,call:Pn.call,nodes:Pn.nodes,node:Pn.node,size:Pn.size,empty:Pn.empty,each:Pn.each,on:tw,attr:DS,attrTween:BS,style:hw,styleTween:fw,text:vw,textTween:_w,remove:nw,tween:$S,delay:FS,duration:jS,ease:qS,easeVarying:ZS,end:Ew,[Symbol.iterator]:Pn[Symbol.iterator]};function rf(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Tw={time:null,delay:0,duration:250,ease:rf};function Sw(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 ww(e){var t,n;e instanceof Nn?(t=e._id,e=e._name):(t=nf(),(n=Tw).time=Mc(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,c=0;c<o;++c)(l=s[c])&&qs(l,e,t,c,s,n||Sw(l,t));return new Nn(r,this._parents,e,t)}pa.prototype.interrupt=TS,pa.prototype.transition=ww;function $w(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ys(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 ci(e){return e=Ys(Math.abs(e)),e?e[1]:NaN}function Mw(e,t){return function(n,r){for(var i=n.length,a=[],s=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),a.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[s=(s+1)%e.length];return a.reverse().join(t)}}function Cw(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Aw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ea(e){if(!(t=Aw.exec(e)))throw new Error("invalid format: "+e);var t;return new Ic({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]})}Ea.prototype=Ic.prototype;function Ic(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+""}Ic.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 kw(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 af;function Rw(e,t){var n=Ys(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(af=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ys(e,Math.max(0,t+a-1))[0]}function sf(e,t){var n=Ys(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 of={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$w,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)=>sf(e*100,t),r:sf,s:Rw,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lf(e){return e}var cf=Array.prototype.map,uf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lw(e){var t=e.grouping===void 0||e.thousands===void 0?lf:Mw(cf.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+"",a=e.numerals===void 0?lf:Cw(cf.call(e.numerals,String)),s=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=Ea(d);var h=d.fill,p=d.align,f=d.sign,g=d.symbol,m=d.zero,y=d.width,v=d.comma,x=d.precision,T=d.trim,E=d.type;E==="n"?(v=!0,E="g"):of[E]||(x===void 0&&(x=12),T=!0,E="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var S=g==="$"?n:g==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",L=g==="$"?r:/[%p]/.test(E)?s:"",N=of[E],D=/[defgprs%]/.test(E);x=x===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function I(M){var q=S,H=L,G,O,k;if(E==="c")H=N(M)+H,M="";else{M=+M;var $=M<0||1/M<0;if(M=isNaN(M)?l:N(Math.abs(M),x),T&&(M=kw(M)),$&&+M==0&&f!=="+"&&($=!1),q=($?f==="("?f:o:f==="-"||f==="("?"":f)+q,H=(E==="s"?uf[8+af/3]:"")+H+($&&f==="("?")":""),D){for(G=-1,O=M.length;++G<O;)if(k=M.charCodeAt(G),48>k||k>57){H=(k===46?i+M.slice(G+1):M.slice(G))+H,M=M.slice(0,G);break}}}v&&!m&&(M=t(M,1/0));var B=q.length+M.length+H.length,F=B<y?new Array(y-B+1).join(h):"";switch(v&&m&&(M=t(F+M,F.length?y-H.length:1/0),F=""),p){case"<":M=q+M+H+F;break;case"=":M=q+F+M+H;break;case"^":M=F.slice(0,B=F.length>>1)+q+M+H+F.slice(B);break;default:M=F+q+M+H;break}return a(M)}return I.toString=function(){return d+""},I}function u(d,h){var p=c((d=Ea(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(ci(h)/3)))*3,g=Math.pow(10,-f),m=uf[8+f/3];return function(y){return p(g*y)+m}}return{format:c,formatPrefix:u}}var Zs,Nc,hf;Dw({thousands:",",grouping:[3],currency:["$",""]});function Dw(e){return Zs=Lw(e),Nc=Zs.format,hf=Zs.formatPrefix,Zs}function Iw(e){return Math.max(0,-ci(Math.abs(e)))}function Nw(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ci(t)/3)))*3-ci(Math.abs(e)))}function Pw(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ci(t)-ci(e))+1}function ui(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const df=Symbol("implicit");function Xs(){var e=new dp,t=[],n=[],r=df;function i(a){let s=e.get(a);if(s===void 0){if(r!==df)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new dp;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Xs(t,n).unknown(r)},ui.apply(i,arguments),i}function Uw(e){return function(){return e}}function Bw(e){return+e}var pf=[0,1];function hi(e){return e}function Pc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Uw(isNaN(t)?NaN:.5)}function Hw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Vw(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=Pc(i,r),a=n(s,a)):(r=Pc(r,i),a=n(a,s)),function(o){return a(r(o))}}function Fw(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Pc(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(o){var l=gc(e,o,1,r)-1;return a[l](i[l](o))}}function Uc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ff(){var e=pf,t=pf,n=va,r,i,a,s=hi,o,l,c;function u(){var h=Math.min(e.length,t.length);return s!==hi&&(s=Hw(e[0],e[h-1])),o=h>2?Fw:Vw,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?a:(l||(l=o(e.map(r),t,n)))(r(s(h)))}return d.invert=function(h){return s(i((c||(c=o(t,e.map(r),Pe)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,Bw),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=Vp,u()},d.clamp=function(h){return arguments.length?(s=h?!0:hi,u()):s!==hi},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,p){return r=h,i=p,u()}}function mf(){return ff()(hi,hi)}function Gw(e,t,n,r){var i=vc(e,t,n),a;switch(r=Ea(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Nw(i,s))&&(r.precision=a),hf(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Pw(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Iw(i))&&(r.precision=a-(r.type==="%")*2);break}}return Nc(r)}function gf(e){var t=e.domain;return e.ticks=function(n){var r=t();return ks(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Gw(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],o=r[a],l,c,u=10;for(o<s&&(c=s,s=o,o=c,c=i,i=a,a=c);u-- >0;){if(c=ai(s,o,n),c===l)return r[i]=s,r[a]=o,t(r);if(c>0)s=Math.floor(s/c)*c,o=Math.ceil(o/c)*c;else if(c<0)s=Math.ceil(s*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function hn(){var e=mf();return e.copy=function(){return Uc(e,hn())},ui.apply(e,arguments),gf(e)}function Bc(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(l){return l!=null&&l<=l?i[gc(r,l,0,n)]:a}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return s}return s.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},s.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},s.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]]},s.unknown=function(l){return arguments.length&&(a=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return Bc().domain([e,t]).range(i).unknown(a)},ui.apply(gf(s),arguments)}function Oa(e,t,n){this.k=e,this.x=t,this.y=n}Oa.prototype={constructor:Oa,scale:function(e){return e===1?this:new Oa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Oa(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+")"}},Oa.prototype;const Ce="cds",Un={opacity:{unselected:.05,selected:.4}},rr={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},di={duration:1e3,ease:rf,zoomLevel:3},pi={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},vf={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ke={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},zw={defaultBins:10},Yt={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}},Bn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},me={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Ft={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}},kr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},dn={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},yf={minCellDividerDimension:16,chartPadding:.5},bf={default:{size:24}},_f={defaultOffset:4,horizontalOffset:10},xf={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}},Ue={height:{[rn.GRAPH_VIEW]:32,[rn.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},jw=[{type:se.RADIUS,name:"Radius"},{type:se.AREA,name:"Poor area"},{type:se.AREA,name:"Satisfactory area"},{type:se.AREA,name:"Great area"},{type:se.QUARTILE,name:"Quartiles"}],fi={type:We.END_LINE,threshold:16,numCharacter:14},Ww={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"}}},qw={enabled:!0,position:Kr.BOTTOM,clickable:!0,truncation:fi,alignment:ie.LEFT,order:null,additionalItems:[]},Yw={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},Zw={enabled:!0},Ef={enabled:!0,showTotal:!0,truncation:fi,groupLabel:"Group"},Of={top:{visible:!0,includeZero:!0,truncation:fi},bottom:{visible:!0,includeZero:!0,truncation:fi},left:{visible:!0,includeZero:!0,truncation:fi},right:{visible:!0,includeZero:!0,truncation:fi}},Ks={addSpaceOnEdges:1,showDayName:!1,localeObject:nd,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 Tf=!1;try{Tf=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const ye={width:null,height:null,resizable:!0,theme:Fl.WHITE,tooltip:Ef,legend:qw,locale:Ww,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:kt.SHOW_AS_DATATABLE},...Tf?[{type:kt.MAKE_FULLSCREEN}]:[],{type:kt.EXPORT_CSV},{type:kt.EXPORT_PNG},{type:kt.EXPORT_JPG}]}},Sf=pt({},ye,{thematic:{projection:xn.geoNaturalEarth1}}),Ta=pt({},ye,{axes:Of,timeScale:Ks,grid:Yw,ruler:Zw,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:rn.GRAPH_VIEW}}}),Rr=pt({},Ta,{bars:{maxWidth:16,spacingFactor:.25},timeScale:pt(Ks,{addSpaceOnEdges:1})}),Xw=pt({},Rr,{}),Kw=pt({},Rr,{}),Qw=pt({},Rr,{bars:pt({},Rr.bars,{dividerSize:1.5})}),Jw=pt({},Rr,{}),Hc=pt({},Ta,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),t$=Hc,wf=pt({},Hc,{points:{radius:3,filled:!1,enabled:!0}}),$f=pt({},wf,{timeScale:pt(Ks,{addSpaceOnEdges:0})}),e$=$f,n$=pt({},Ta,{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:se.RADIUS,name:"Radius"}]}}),r$=pt({},Ta,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:se.AREA,name:"Poor area"},{type:se.AREA,name:"Satisfactory area"},{type:se.AREA,name:"Great area"},{type:se.QUARTILE,name:"Quartiles"}]}}),i$=pt({},Rr,{bars:{dividerSize:1.5},timeScale:pt(Ks,{addSpaceOnEdges:0})}),a$=pt({},ye,{tooltip:pt({},Ef,{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"}}),Mf=pt({},ye,{pie:{labels:{formatter:null,enabled:!0},alignment:ie.LEFT,sortFunction:null,valueMapsTo:"value"}}),s$=pt({},ye,{legend:{enabled:!1},gauge:{type:yr.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:ie.LEFT}}),o$=pt({},Mf,{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:ie.LEFT}}),Cf=pt({},ye,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),l$=pt({},Cf,{legend:{enabled:!0}}),c$=pt({},ye,{radar:{axes:{angle:"key",value:"value"},alignment:ie.LEFT},tooltip:{gridline:{enabled:!0}}}),u$=pt({},Rr,{comboChartTypes:[]}),h$=pt({tree:{type:ps.TREE}},ye,{}),d$=pt({},ye,{data:pt(ye.data,{groupMapsTo:"name"})}),p$=pt({},ye,pi,{data:pt(ye.data,{groupMapsTo:"name"})}),f$=pt({},ye,{alluvial:{data:pt(ye.data,{groupMapsTo:"source"}),nodeAlignment:ie.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),m$=pt({},ye,{axes:Of,heatmap:{divider:{state:Jr.AUTO},colorLegend:{type:"linear"}}}),g$=pt({},Sf,{choropleth:{colorLegend:{type:"linear"}}}),Bt={alluvialChart:f$,areaChart:$f,axisChart:Ta,boxplotChart:Jw,bubbleChart:n$,bulletChart:r$,chart:ye,circlePackChart:p$,choroplethChart:g$,comboChart:u$,donutChart:o$,gaugeChart:s$,groupedBarChart:Kw,heatmapChart:m$,histogramChart:i$,lineChart:wf,lollipopChart:t$,meterChart:Cf,pieChart:Mf,proportionalMeterChart:l$,radarChart:c$,scatterChart:Hc,simpleBarChart:Xw,stackedAreaChart:e$,stackedBarChart:Qw,thematicChart:Sf,treeChart:h$,treemapChart:d$,wordCloudChart:a$};function v$(e,t,n){let r=null;return function(...i){const a=this;a.mousePosition=$r(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(a,i)},t)}}function jt(e,t){var n;const r=Dn(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 a in r.axes)if(i.includes(a)){const s=t.axes[a];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),s.mapsTo==null){const l=s.scaleType;l==null?s.mapsTo="value":l===lt.TIME?s.mapsTo="date":l===lt.LABELS&&(s.mapsTo="key")}}else delete r.axes[a];return Fc(r,t),pt(r,t)}function Hn(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 Sa(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 Vc(e,t,n="value",r=!1){const i=e/t.reduce((a,s)=>a+s[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function wa(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 Fc(e,t){const n=_(e,"legend","additionalItems"),r=_(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),a=n.map(o=>o.type),s=jw.filter(o=>a.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=s,t.legend.additionalItems=QE(s,r,"name")}}const _=(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},Af=(e,t)=>t===re.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,Oe=(e,t)=>{const{x0:n,x1:r,y0:i,y1:a}=Af(e,t);return`M${n},${i}L${n},${a}L${r},${a}L${r},${i}L${n},${i}`};function Vn(e,t,n){return n===re.VERTICAL?[e,t]:[t,e]}function kf(e){const t=Xt(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 Rf(e,t){const n=Xt(e,void 0);return n.setHours(0,0,0,0),n}function Lf(e,t,n){const[r,i]=br(void 0,e,t),a=Rf(r),s=Rf(i),o=+a-kf(a),l=+s-kf(s);return Math.round((o-l)/$1)}function y$(e,t){const n=Xt(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function b$(e,t){const n=Xt(e,void 0);return Lf(n,y$(n))+1}function Qs(e,t){return ta(e,{...t,weekStartsOn:1})}function Df(e,t){const n=Xt(e,void 0),r=n.getFullYear(),i=qe(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const a=Qs(i),s=qe(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const o=Qs(s);return n.getTime()>=a.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function _$(e,t){const n=Df(e),r=qe(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Qs(r)}function x$(e,t){const n=Xt(e,void 0),r=+Qs(n)-+_$(n);return Math.round(r/Qh)+1}function If(e,t){var n,r,i,a;const s=Xt(e,t==null?void 0:t.in),o=s.getFullYear(),l=gs(),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??((a=(i=l.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,u=qe((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=ta(u,t),h=qe((t==null?void 0:t.in)||e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=ta(h,t);return+s>=+d?o+1:+s>=+p?o:o-1}function E$(e,t){var n,r,i,a;const s=gs(),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)??s.firstWeekContainsDate??((a=(i=s.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,l=If(e,t),c=qe((t==null?void 0:t.in)||e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),ta(c,t)}function O$(e,t){const n=Xt(e,t==null?void 0:t.in),r=+ta(n,t)-+E$(n,t);return Math.round(r/Qh)+1}function Lt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ir={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Lt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Lt(n+1,2)},d(e,t){return Lt(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 Lt(e.getHours()%12||12,t.length)},H(e,t){return Lt(e.getHours(),t.length)},m(e,t){return Lt(e.getMinutes(),t.length)},s(e,t){return Lt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Lt(i,t.length)}},mi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Nf={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 ir.y(e,t)},Y:function(e,t,n,r){const i=If(e,r),a=i>0?i:1-i;if(t==="YY"){const s=a%100;return Lt(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):Lt(a,t.length)},R:function(e,t){const n=Df(e);return Lt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Lt(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 Lt(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 Lt(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 ir.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 Lt(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=O$(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Lt(i,t.length)},I:function(e,t,n){const r=x$(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Lt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ir.d(e,t)},D:function(e,t,n){const r=b$(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Lt(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(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Lt(a,2);case"eo":return n.ordinalNumber(a,{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(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Lt(a,t.length);case"co":return n.ordinalNumber(a,{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 Lt(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=mi.noon:r===0?i=mi.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=mi.evening:r>=12?i=mi.afternoon:r>=4?i=mi.morning:i=mi.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 ir.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ir.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Lt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Lt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ir.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ir.s(e,t)},S:function(e,t){return ir.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Uf(r);case"XXXX":case"XX":return Lr(r);case"XXXXX":case"XXX":default:return Lr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Uf(r);case"xxxx":case"xx":return Lr(r);case"xxxxx":case"xxx":default:return Lr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pf(r,":");case"OOOO":default:return"GMT"+Lr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pf(r,":");case"zzzz":default:return"GMT"+Lr(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Lt(r,t.length)},T:function(e,t,n){return Lt(+e,t.length)}};function Pf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Lt(a,2)}function Uf(e,t){return e%60===0?(e>0?"-":"+")+Lt(Math.abs(e)/60,2):Lr(e,t)}function Lr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Lt(Math.trunc(r/60),2),a=Lt(r%60,2);return n+i+t+a}const Bf=(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"})}},Hf=(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"})}},T$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Bf(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Bf(r,t)).replace("{{time}}",Hf(i,t))},S$={p:Hf,P:T$},w$=/^D+$/,$$=/^Y+$/,M$=["D","DD","YY","YYYY"];function C$(e){return w$.test(e)}function A$(e){return $$.test(e)}function k$(e,t,n){const r=R$(e,t,n);if(console.warn(r),M$.includes(e))throw new RangeError(r)}function R$(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 L$(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function D$(e){return!(!L$(e)&&typeof e!="number"||isNaN(+Xt(e)))}const I$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,N$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,P$=/^'([^]*?)'?$/,U$=/''/g,B$=/[a-zA-Z]/;function Gc(e,t,n){var r,i,a,s,o,l,c,u;const d=gs(),h=(n==null?void 0:n.locale)??d.locale??nd,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??((s=(a=d.locale)==null?void 0:a.options)==null?void 0:s.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=Xt(e,n==null?void 0:n.in);if(!D$(g))throw new RangeError("Invalid time value");let m=t.match(N$).map(v=>{const x=v[0];if(x==="p"||x==="P"){const T=S$[x];return T(v,h.formatLong)}return v}).join("").match(I$).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const x=v[0];if(x==="'")return{isToken:!1,value:H$(v)};if(Nf[x])return{isToken:!0,value:v};if(x.match(B$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:v}});h.localize.preprocessor&&(m=h.localize.preprocessor(g,m));const y={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(v=>{if(!v.isToken)return v.value;const x=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&A$(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&C$(x))&&k$(x,t,String(e));const T=Nf[x[0]];return T(g,x,h.localize,y)}).join("")}function H$(e){const t=e.match(P$);return t?t[1].replace(U$,"'"):e}const zc=[["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 Vf(e,t,n,r,i){const a=t===0,s=Number(Gc(new Date(e),"c"))===2,o=Number(Gc(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return a||to(e)||$a(e,l)||ar(e);case"minute":return a||to(e)||$a(e,l)||ar(e);case"30minutes":return a||to(e)||$a(e,l)||ar(e);case"hourly":return a||to(e)||$a(e,l)||ar(e);case"daily":return i?a||s||ar(e):a||$a(e,l)||ar(e);case"weekly":return a||s||ar(e);case"monthly":return a||ar(e);case"quarterly":return a||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function jc(e,t,n,r,i,a){const s=i.showDayName,o=r==="daily"&&s?"weekly":r,l=new Date(e),c=_(i,"timeIntervalFormats")[o],u=_(c,"primary"),d=_(c,"secondary"),h=Vf(e,t,n,r,s);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}=a,y=m[r].type,v=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!v){const x=Gc(l,p,{locale:f}).split("").map(T=>{const E=Number(T);return T!==" "&&!Number.isNaN(E)?E.toLocaleString(g):T});return a[y](l,g,{},x.join(""))}else return a[y](l,g,v)}function Js(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function V$(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function F$(e){const t=zc.reduce((n,[,r],i)=>{const a=zc[n][1],s=Math.abs(a-e),o=Math.abs(r-e);return s<o?n:i},0);return zc[t][0]}function Wc(e,t){if(Kh[t])return t;if(e.length===1)return"15seconds";const n=V$(e),r=nr(n);return F$(r)}function to(e){const{s:t,m:n,H:r}=Js(e);return r===0&&n===0&&t===0}function $a(e,t){const n=Js(e).M,r=Js(t).M;return n!==r}function ar(e){const{M:t,d:n,s:r,m:i,H:a}=Js(e);return t===1&&n===1&&a===0&&i===0&&r===0}function Ff(e){return e===void 0?"":e.toISOString()}function Gf(e){const t=ln(e,r=>r.value),n=hn().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 zf(e,t){const n=_(t,"gradient","colors"),r=!on(n);let i=_(t,"pairing","option");const a=Gf(e),s=a[0]<0&&a[1]>0?"diverge":"mono";(i<1&&i>4&&s==="mono"||i<1&&i>2&&s==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=s==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${s}-${i}-${c}`)}return Bc().domain(a).range(o)}var yt=(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))(yt||{});function G$(e,t){return e&&lp(e,t,ia)}function z$(e,t){return function(n,r){if(n==null)return n;if(!Or(n))return e(n,r);for(var i=n.length,a=-1,s=Object(n);++a<i&&r(s[a],a,s)!==!1;);return n}}var qc=z$(G$);function bt(e){return function(){return e}}var j$=Array.prototype.slice;function eo(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function W$(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var s=e[i];t(r,s,n(s),e)}return r}function q$(e,t,n,r){return qc(e,function(i,a,s){t(r,i,n(i),s)}),r}function Y$(e,t){return function(n,r){var i=fe(n)?W$:q$,a={};return i(n,e,Cs(r),a)}}function Z$(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 X$=Object.prototype,K$=X$.hasOwnProperty,Q$=Y$(function(e,t,n){K$.call(e,n)?e[n].push(t):bs(e,n,[t])});function J$(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function tM(e){return e}function eM(e=Sr){if(e===Sr)return jf;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 jf(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var nM=Array.prototype,rM=nM.slice;function Yc(e){return()=>e}function iM(e,t,n){let r;for(;;){const i=ai(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 aM(e){return Math.max(1,Math.ceil(Math.log(J$(e))/Math.LN2)+1)}function sM(){var e=tM,t=ln,n=aM;function r(i){Array.isArray(i)||(i=Array.from(i));var a,s=i.length,o,l,c=new Array(s);for(a=0;a<s;++a)c[a]=e(i[a],a,i);var u=t(c),d=u[0],h=u[1],p=n(c,d,h);if(!Array.isArray(p)){const x=h,T=+p;if(t===ln&&([d,h]=iM(d,h,T)),p=ks(d,h,T),p[0]<=d&&(l=ai(d,h,T)),p[p.length-1]>=h)if(x>=h&&t===ln){const E=ai(d,h,T);isFinite(E)&&(E>0?h=(Math.floor(h/E)+1)*E:E<0&&(h=(Math.ceil(h*-E)+1)/-E))}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 y=new Array(f+1),v;for(a=0;a<=f;++a)v=y[a]=[],v.x0=a>0?p[a-1]:d,v.x1=a<f?p[a]:h;if(isFinite(l)){if(l>0)for(a=0;a<s;++a)(o=c[a])!=null&&d<=o&&o<=h&&y[Math.min(f,Math.floor((o-d)/l))].push(i[a]);else if(l<0){for(a=0;a<s;++a)if((o=c[a])!=null&&d<=o&&o<=h){const x=Math.floor((d-o)*l);y[Math.min(f,x+(p[x]<=o))].push(i[a])}}}else for(a=0;a<s;++a)(o=c[a])!=null&&d<=o&&o<=h&&y[gc(p,o,0,f)].push(i[a]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Yc(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Yc([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Yc(Array.isArray(i)?rM.call(i):i),r):n},r}function Wf(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?jf:eM(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));Wf(e,t,p,f,i)}const a=e[t];let s=n,o=r;for(Ma(e,n,t),i(e[r],a)>0&&Ma(e,n,r);s<o;){for(Ma(e,s,o),++s,--o;i(e[s],a)<0;)++s;for(;i(e[o],a)>0;)--o}i(e[n],a)===0?Ma(e,n,o):(++o,Ma(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Ma(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Zc(e,t,n){if(e=Float64Array.from(nO(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return nr(e);if(t>=1)return wr(e);var r,i=(r-1)*t,a=Math.floor(i),s=wr(Wf(e,a).subarray(0,a+1)),o=nr(e.subarray(a+1));return s+(o-s)*(i-a)}}function qf(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Yf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function oM(e,t){return e[t]}function lM(e){const t=[];return t.key=e,t}function Xc(){var e=bt([]),t=Yf,n=qf,r=oM;function i(a){var s=Array.from(e.apply(this,arguments),lM),o,l=s.length,c=-1,u;for(const d of a)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(d,s[o].key,c,a)]).data=d;for(o=0,u=eo(t(s));o<l;++o)s[u[o]].index=o;return n(s,u),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:bt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:bt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Yf:typeof a=="function"?a:bt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??qf,i):n},i}function cM(e,t){if((l=e.length)>0)for(var n,r=0,i,a,s,o,l,c=e[t[0]].length;r<c;++r)for(s=o=0,n=0;n<l;++n)(a=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=s,i[1]=s+=a):a<0?(i[1]=o,i[0]=o+=a):(i[0]=0,i[1]=a)}function uM(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class Sn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:a,number:s}=_(r,"locale"),o=_(r,"tabularRepModal","tableHeadingFormatter"),l=_(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===lt.TIME&&(d=h=>a(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]=s(f,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:a}=_(n,"data"),s=_(n,"axes");return t&&(r=r.filter(o=>t.includes(o[a]))),s&&Object.keys(s).forEach(o=>{const l=s[o].mapsTo,c=s[o].scaleType;if((c===lt.LINEAR||c===lt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&s[o].domain)if(c===lt.LABELS)r=r.filter(u=>s[o].domain.includes(u[l]));else{const[u,d]=s[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[a]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Yt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>r.find(s=>s.name===a[i]&&s.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(Dn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return _(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Yt.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 Q$(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),a=n.axes[r],{groupMapsTo:s}=n.data,{bins:o=zw.defaultBins}=a,l=Array.isArray(o),c=sM().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[s]))),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(),a=this.getDataValuesGroupedByKeys({bins:i});return Xc().keys(r)(a).map((s,o)=>Object.keys(s).filter(l=>!isNaN(l)).map(l=>{const c=s[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(a=>{const s=a[i];r[s]!==null&&r[s]!==void 0?r[s].push(a):r[s]=[a]}),Object.keys(r).map(a=>({name:a,data:r[a]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let a;t?a=t.map(l=>`${l.x0}:${l.x1}`):a=da(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Ff(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const s=this.services.cartesianScales.domainAxisPosition,o=r.axes[s].scaleType;return o===lt.TIME?a.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===lt.LOG||o===lt.LINEAR)&&a.sort((l,c)=>l-c),a}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.getDisplayData(n),s=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 s.forEach(p=>{d[p]=h.filter(f=>f[i]===p).length}),d}):o.map(l=>{const c={sharedStackKey:l};return s.forEach(u=>{const d=a.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?Ff(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:a}=i.data,s=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=Z$(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{s.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{s.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?Xc().offset(cM):Xc()).keys(s)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[a]=s[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();Fc(n,t),this.set({options:pt(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(w.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Yt.items.status,i=this.getDataGroups(),a=i.some(c=>c.status===r),s=i.filter(c=>c.status===n);if(a)if(s.length===1&&s[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(w.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const a=this.getOptions();return a.getIsFilled?a.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),a=_(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,a):a}getStrokeColor(t,n,r){const i=this.getOptions(),a=_(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,a):a}isUserProvidedColorScaleValid(){const t=_(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(a=>{a.data.forEach((s,o)=>{let l;const c=_(a,"label");if(c===null){const d=_(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(s)?(u.value=s.value,u.date=s.date):u.value=s,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(a=>a.map(s=>`"${(s==="–"?"–":s).split(/[,;'"`]/).map(o=>uM(o)).join("")}"`)).map(a=>a.join(",")).join(`
|
|
2
|
+
`),n=this.getOptions();let r="myChart";const i=_(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}=Yt.items.status,a=this.getOptions(),s=da(t.map(l=>l[n]));a.data.selectedGroups.length&&(a.data.selectedGroups.every(l=>s.includes(l))||(a.data.selectedGroups=[]));const o=l=>!a.data.selectedGroups.length||a.data.selectedGroups.includes(l)?r:i;return s.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=_(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=_(this.getOptions(),"color","pairing");let n=_(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=_(t,"option");const i=vf.pairingOptions,a=n>5?14:n,s=`${a}-color`;r=r<=i[s]?r:1;const o=this.allDataGroups.map((l,c)=>`${a}-${r}-${c%14+1}`);this.colorClassNames=Xs().range(o).domain(this.allDataGroups)}}class Dr extends Sn{constructor(t){super(t),this.axisFlavor=Ki.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(a=>{const s=i[a];t.scales[s]?i[a]={position:s,label:t.getScaleLabel(s),identifier:_(n,"axes",s,"mapsTo")}:i[a]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:a,secondaryDomain:s,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=_(this.getOptions(),"locale"),u=["Group",i.label,a.label,...s?[s.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"–":h[i.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"–":l(h[a.identifier],c),...s?[h[s.identifier]===null?"–":h[s.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"–":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),_(this.getOptions(),"zoomBar",Z.TOP,"enabled"))){const r=_(this.getOptions(),"zoomBar",Z.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(Dn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const a=i.getDomainIdentifier(),s=i.getRangeIdentifier();let o=n.map(l=>l[a].getTime());o=da(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[a].getTime()===l&&(c+=d[s])}),u[a]=new Date(l),u[s]=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 a=Z[i],s=n.axes[a];if(s&&s.scaleType===lt.TIME){const o=s.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(a=>{_(i,a,"getTime")===null&&(i[a]=new Date(i[a]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let hM=class extends Dr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=_(this.getOptions(),"locale");t.sort((s,o)=>s.source.localeCompare(o.source));const i=["Source","Target","Value"],a=[...t.map(s=>[s.source,s.target,s.value===null?"–":n(s.value,r)])];return super.formatTable({headers:i,cells:a})}};class dM extends Dr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Zc(t,.25),q_50:Zc(t,.5),q_75:Zc(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:a,data:s}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=s.map(x=>x[o]).sort(Sr),c={[n]:a,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 x of l)x<p||x>f?g.push(x):m.push(x);c.outliers=g;const y=nr(m),v=wr(m);c.whiskers={min:y||nr([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:v||wr([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:a}=_(t,"locale"),s=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=_(l,"outliers");return(c===null||c.length===0)&&(c=["–"]),[l[n],_(l,"whiskers","min")!==null?i(_(l,"whiskers","min"),a):"–",_(l,"quartiles","q_25")!==null?i(_(l,"quartiles","q_25"),a):"–",_(l,"quartiles","q_50")!==null?i(_(l,"quartiles","q_50"),a):"–",_(l,"quartiles","q_75")!==null?i(_(l,"quartiles","q_75"),a):"–",_(l,"whiskers","max")!==null?i(_(l,"whiskers","max"),a):"–",_(l,"quartiles","q_75")!==null&&_(l,"quartiles","q_25")!==null?(i(_(l,"quartiles","q_75")-_(l,"quartiles","q_25")),a):"–",c.map(u=>i(u,a)).join(",")]})];return super.formatTable({headers:s,cells:o})}setColorClassNames(){const t=_(this.getOptions(),"color","pairing");let n=_(t,"option");const r=vf.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Xs().range(i).domain(this.allDataGroups)}}let pM=class extends Dr{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:a,code:s}=_(n,"locale"),o=_(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"–":a(u.value,s),_(u,"marker")===null?"–":a(u.marker,s),_(u,"marker")===null?"–":`${a(Math.floor(u[i]/u.marker*100),s)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}},fM=class extends Sn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(on(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!on(n)&&!on(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}=_(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],a=[...t.map(s=>[s.id===null?"–":s.id,s.name,s.value===null?"–":n(s.value,r)])];return super.formatTable({headers:i,cells:a})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=_(this.getOptions(),"color");this._colorScale=zf(this.getDisplayData(),t)}},mM=class extends Sn{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=pt({},t,this.getZoomOptions(t));Fc(n,r);const i=this.getHierarchyLevel(),a=_(n,"circlePack","depth");this.set({options:pt(n,r),depth:a&&a<4?a:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&_(n,0,"children")?_(n,0,"children"):n;let a=this.getHierarchyLevel();return i.some(s=>{if(s.children&&s.children.some(o=>o.children))return a=3,!1}),_(r,"canvasZoom","enabled")===!0&&a>2?{legend:{additionalItems:[{type:se.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(a=>{const s=a[r];return this.setChildrenDataGroup(a,s)});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}=_(this.getOptions(),"locale"),i=["Child","Parent","Value"],a=[];return t.forEach(s=>{let o=s.value?s.value:0;s.children&&(o+=this.getChildrenDatums(s.children,s.name,a,0)),a.push(["–",s.name,n(o,r)])}),super.formatTable({headers:i,cells:a})}getChildrenDatums(t,n,r=[],i=0){const a=n,{number:s,code:o}=_(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,a,s(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,a,s(d,o)])}}),i}},gM=class extends Sn{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:a,code:s}=_(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"–":a(c[i],s)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}};class vM extends Sn{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:a}=_(this.getOptions(),"locale"),s=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"–":i(l.value,a)])];return super.formatTable({headers:s,cells:o})}}class yM extends Dr{constructor(t){super(t),this.axisFlavor=Ki.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=_(this.getOptions(),"axes");if(_(n,"left","scaleType")&&_(n,"left","scaleType")!==lt.LABELS||_(n,"right","scaleType")&&_(n,"right","scaleType")!==lt.LABELS||_(n,"top","scaleType")&&_(n,"top","scaleType")!==lt.LABELS||_(n,"bottom","scaleType")&&_(n,"bottom","scaleType")!==lt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=ln(this.getDisplayData(),r=>r.value),n=hn().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(on(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),a=n.getCustomDomainValuesByposition(i);if(a)return a;this._domains=Array.from(new Set(t.map(s=>s[r])))}return this._domains}getUniqueRanges(){if(on(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),a=n.getCustomDomainValuesByposition(i);if(a)return a;this._ranges=Array.from(new Set(t.map(s=>s[r])))}return this._ranges}getMatrix(){if(on(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),a={};n.forEach(s=>{a[s]={value:null,index:-1}}),t.forEach(s=>{this._matrix[s]=Dn(a)}),this.getDisplayData().forEach((s,o)=>{this._matrix[s[r]][s[i]]={value:s.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(Dn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){on(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),a=[];return t.forEach(s=>{n.forEach(o=>{const l={value:this._matrix[s][o].value,index:this._matrix[s][o].index};l[r]=s,l[i]=o,a.push(l)})}),a}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:a}=_(this.getOptions(),"locale"),s=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[r.identifier]===null?"–":l[r.identifier],l.value===null?"–":i(l.value,a)])];return super.formatTable({headers:s,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=_(t,"color","gradient","colors"),r=!on(n);let i=_(t,"color","pairing","option");const a=this.getValueDomain(),s=a[0]<0&&a[1]>0?"diverge":"mono";(i<1&&i>4&&s==="mono"||i<1&&i>2&&s==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=s==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${s}-${i}-${u}`)}this._colorScale=Bc().domain(a).range(o);const l=_(this.getOptions(),"color");this._colorScale=zf(this.getDisplayData(),l)}}let bM=class extends Dr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=_(this.getOptions(),"locale"),a=this.getBinnedStackedData(),s=[wt(t,"bins.rangeLabel")||"Range",...a.map(l=>wt(l,`0.${n}`))],o=[...wt(a,0).map((l,c)=>[`${r(Number(wt(l,"data.x0")),i)} – ${r(Number(wt(l,"data.x1")),i)}`,...a.map(u=>r(wt(u[c],`data.${wt(u[c],n)}`),i))])];return super.formatTable({headers:s,cells:o})}};class _M extends Sn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=_(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=_(this.getDisplayData()),r=(n==null?void 0:n.reduce((s,o)=>s+o.value,0))??0,i=_(t,"meter","proportional")?r:r>100?100:r,a=_(t,"meter","status","ranges");if(a){const s=a.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(s.length>0)return s[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),a=_(n,"meter","proportional"),{number:s,code:o}=_(this.getOptions(),"locale");let l=[],c=[],u;if(a===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"–":s(d.value,o),...i?[i]:[]]]}else u=_(a,"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?"–":s(p,o),s(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}}class xM extends Dr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=_(t,"radar","axes"),{number:a,code:s}=_(t,"locale"),o=_(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>_(u,"data",h,i)!==null?a(_(u,"data",h,i),s):"–")])];return super.formatTable({headers:l,cells:c})}}let EM=class extends Sn{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,"–"])}),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])})}},OM=class extends Sn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=_(this.getOptions(),"locale"),i=["Child","Group","Value"],a=[];return t.forEach(s=>{Array.isArray(s.children)?s.children.forEach(o=>{a.push([o.name,s.name,o.value===null?"–":n(o.value,r)])}):_(s.name)!==null&&_(s.value)&&a.push(["–",s.name,n(s.value,r)])}),super.formatTable({headers:i,cells:a})}};class TM extends Sn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:a}=n.data,{code:s,number:o}=_(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[a],o(u[r],s)])];return super.formatTable({headers:l,cells:c})}}var SM=/\s/;function wM(e){for(var t=e.length;t--&&SM.test(e.charAt(t)););return t}var $M=/^\s+/;function MM(e){return e&&e.slice(0,wM(e)+1).replace($M,"")}var Zf=NaN,CM=/^[-+]0x[0-9a-f]+$/i,AM=/^0b[01]+$/i,kM=/^0o[0-7]+$/i,RM=parseInt;function gi(e){if(typeof e=="number")return e;if(vs(e))return Zf;if(Ze(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ze(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=MM(e);var n=AM.test(e);return n||kM.test(e)?RM(e.slice(2),n?2:8):CM.test(e)?Zf:+e}var Kc=function(){return an.Date.now()},LM="Expected a function",DM=Math.max,IM=Math.min;function no(e,t,n){var r,i,a,s,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(LM);t=gi(t)||0,Ze(n)&&(u=!!n.leading,d="maxWait"in n,a=d?DM(gi(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(S){var L=r,N=i;return r=i=void 0,c=S,s=e.apply(N,L),s}function f(S){return c=S,o=setTimeout(y,t),u?p(S):s}function g(S){var L=S-l,N=S-c,D=t-L;return d?IM(D,a-N):D}function m(S){var L=S-l,N=S-c;return l===void 0||L>=t||L<0||d&&N>=a}function y(){var S=Kc();if(m(S))return v(S);o=setTimeout(y,g(S))}function v(S){return o=void 0,h&&r?p(S):(r=i=void 0,s)}function x(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function T(){return o===void 0?s:v(Kc())}function E(){var S=Kc(),L=m(S);if(r=arguments,i=this,l=S,L){if(o===void 0)return f(l);if(d)return clearTimeout(o),o=setTimeout(y,t),p(l)}return o===void 0&&(o=setTimeout(y,t)),s}return E.cancel=x,E.flush=T,E}function NM(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,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function P(e){return typeof e=="string"?new Ne([[document.querySelector(e)]],[document.documentElement]):new Ne([[e]],$p)}function Ca(){var e=Xs().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,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;a=(g-f)/Math.max(1,h-l+c*2),o&&(a=Math.floor(a)),f+=(g-f-a*(h-l))*u,s=a*(1-l),o&&(f=Math.round(f),s=Math.round(s));var m=NM(h).map(function(y){return f+a*y});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 s},e.step=function(){return a},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 Ca(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},ui.apply(d(),arguments)}function Xf(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}const Qc=new Date,Jc=new Date;function ue(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return l;let c;do l.push(c=new Date(+a)),t(a,o),e(a);while(c<a&&a<s);return l},i.filter=a=>ue(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!a(s););else for(;--o>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(Qc.setTime(+a),Jc.setTime(+s),e(Qc),e(Jc),Math.floor(n(Qc,Jc))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const ro=ue(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ro.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ue(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ro),ro.range;const Fn=1e3,Qe=Fn*60,Gn=Qe*60,zn=Gn*24,tu=zn*7,Kf=zn*30,eu=zn*365,vi=ue(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Fn)},(e,t)=>(t-e)/Fn,e=>e.getUTCSeconds());vi.range;const nu=ue(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fn)},(e,t)=>{e.setTime(+e+t*Qe)},(e,t)=>(t-e)/Qe,e=>e.getMinutes());nu.range,ue(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Qe)},(e,t)=>(t-e)/Qe,e=>e.getUTCMinutes()).range;const ru=ue(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fn-e.getMinutes()*Qe)},(e,t)=>{e.setTime(+e+t*Gn)},(e,t)=>(t-e)/Gn,e=>e.getHours());ru.range,ue(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Gn)},(e,t)=>(t-e)/Gn,e=>e.getUTCHours()).range;const Aa=ue(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qe)/zn,e=>e.getDate()-1);Aa.range;const iu=ue(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/zn,e=>e.getUTCDate()-1);iu.range,ue(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/zn,e=>Math.floor(e/zn)).range;function Ir(e){return ue(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())*Qe)/tu)}const io=Ir(0),ao=Ir(1),PM=Ir(2),UM=Ir(3),yi=Ir(4),BM=Ir(5),HM=Ir(6);io.range,ao.range,PM.range,UM.range,yi.range,BM.range,HM.range;function Nr(e){return ue(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)/tu)}const Qf=Nr(0),so=Nr(1),VM=Nr(2),FM=Nr(3),bi=Nr(4),GM=Nr(5),zM=Nr(6);Qf.range,so.range,VM.range,FM.range,bi.range,GM.range,zM.range;const au=ue(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());au.range,ue(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 jn=ue(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());jn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ue(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)}),jn.range;const Pr=ue(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());Pr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ue(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)}),Pr.range;function jM(e,t,n,r,i,a){const s=[[vi,1,Fn],[vi,5,5*Fn],[vi,15,15*Fn],[vi,30,30*Fn],[a,1,Qe],[a,5,5*Qe],[a,15,15*Qe],[a,30,30*Qe],[i,1,Gn],[i,3,3*Gn],[i,6,6*Gn],[i,12,12*Gn],[r,1,zn],[r,2,2*zn],[n,1,tu],[t,1,Kf],[t,3,3*Kf],[e,1,eu]];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=mc(([,,m])=>m).right(s,h);if(p===s.length)return e.every(vc(c/eu,u/eu,d));if(p===0)return ro.every(Math.max(vc(c,u,d),1));const[f,g]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return f.every(g)}return[o,l]}const[WM,qM]=jM(jn,au,io,Aa,ru,nu);function su(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 ou(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 ka(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function YM(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,c=Ra(i),u=La(i),d=Ra(a),h=La(a),p=Ra(s),f=La(s),g=Ra(o),m=La(o),y=Ra(l),v=La(l),x={a:$,A:B,b:F,B:et,c:null,d:im,e:im,f:vC,g:$C,G:CC,H:fC,I:mC,j:gC,L:am,m:yC,M:bC,p:C,q:z,Q:hm,s:dm,S:_C,u:xC,U:EC,V:OC,w:TC,W:SC,x:null,X:null,y:wC,Y:MC,Z:AC,"%":um},T={a:Q,A:at,b:tt,B:K,c:null,d:om,e:om,f:DC,g:zC,G:WC,H:kC,I:RC,j:LC,L:lm,m:IC,M:NC,p:nt,q:ht,Q:hm,s:dm,S:PC,u:UC,U:BC,V:HC,w:VC,W:FC,x:null,X:null,y:GC,Y:jC,Z:qC,"%":um},E={a:I,A:M,b:q,B:H,c:G,d:nm,e:nm,f:uC,g:em,G:tm,H:rm,I:rm,j:sC,L:cC,m:aC,M:oC,p:D,q:iC,Q:dC,s:pC,S:lC,u:JM,U:tC,V:eC,w:QM,W:nC,x:O,X:k,y:em,Y:tm,Z:rC,"%":hC};x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),T.x=S(n,T),T.X=S(r,T),T.c=S(t,T);function S(W,it){return function(gt){var X=[],Ct=-1,_t=0,ne=W.length,Jt,ct,Nt;for(gt instanceof Date||(gt=new Date(+gt));++Ct<ne;)W.charCodeAt(Ct)===37&&(X.push(W.slice(_t,Ct)),(ct=Jf[Jt=W.charAt(++Ct)])!=null?Jt=W.charAt(++Ct):ct=Jt==="e"?" ":"0",(Nt=it[Jt])&&(Jt=Nt(gt,ct)),X.push(Jt),_t=Ct+1);return X.push(W.slice(_t,Ct)),X.join("")}}function L(W,it){return function(gt){var X=ka(1900,void 0,1),Ct=N(X,W,gt+="",0),_t,ne;if(Ct!=gt.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(it&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(_t=ou(ka(X.y,0,1)),ne=_t.getUTCDay(),_t=ne>4||ne===0?so.ceil(_t):so(_t),_t=iu.offset(_t,(X.V-1)*7),X.y=_t.getUTCFullYear(),X.m=_t.getUTCMonth(),X.d=_t.getUTCDate()+(X.w+6)%7):(_t=su(ka(X.y,0,1)),ne=_t.getDay(),_t=ne>4||ne===0?ao.ceil(_t):ao(_t),_t=Aa.offset(_t,(X.V-1)*7),X.y=_t.getFullYear(),X.m=_t.getMonth(),X.d=_t.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),ne="Z"in X?ou(ka(X.y,0,1)).getUTCDay():su(ka(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(ne+5)%7:X.w+X.U*7-(ne+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,ou(X)):su(X)}}function N(W,it,gt,X){for(var Ct=0,_t=it.length,ne=gt.length,Jt,ct;Ct<_t;){if(X>=ne)return-1;if(Jt=it.charCodeAt(Ct++),Jt===37){if(Jt=it.charAt(Ct++),ct=E[Jt in Jf?it.charAt(Ct++):Jt],!ct||(X=ct(W,gt,X))<0)return-1}else if(Jt!=gt.charCodeAt(X++))return-1}return X}function D(W,it,gt){var X=c.exec(it.slice(gt));return X?(W.p=u.get(X[0].toLowerCase()),gt+X[0].length):-1}function I(W,it,gt){var X=p.exec(it.slice(gt));return X?(W.w=f.get(X[0].toLowerCase()),gt+X[0].length):-1}function M(W,it,gt){var X=d.exec(it.slice(gt));return X?(W.w=h.get(X[0].toLowerCase()),gt+X[0].length):-1}function q(W,it,gt){var X=y.exec(it.slice(gt));return X?(W.m=v.get(X[0].toLowerCase()),gt+X[0].length):-1}function H(W,it,gt){var X=g.exec(it.slice(gt));return X?(W.m=m.get(X[0].toLowerCase()),gt+X[0].length):-1}function G(W,it,gt){return N(W,t,it,gt)}function O(W,it,gt){return N(W,n,it,gt)}function k(W,it,gt){return N(W,r,it,gt)}function $(W){return s[W.getDay()]}function B(W){return a[W.getDay()]}function F(W){return l[W.getMonth()]}function et(W){return o[W.getMonth()]}function C(W){return i[+(W.getHours()>=12)]}function z(W){return 1+~~(W.getMonth()/3)}function Q(W){return s[W.getUTCDay()]}function at(W){return a[W.getUTCDay()]}function tt(W){return l[W.getUTCMonth()]}function K(W){return o[W.getUTCMonth()]}function nt(W){return i[+(W.getUTCHours()>=12)]}function ht(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var it=S(W+="",x);return it.toString=function(){return W},it},parse:function(W){var it=L(W+="",!1);return it.toString=function(){return W},it},utcFormat:function(W){var it=S(W+="",T);return it.toString=function(){return W},it},utcParse:function(W){var it=L(W+="",!0);return it.toString=function(){return W},it}}}var Jf={"-":"",_:" ",0:"0"},de=/^\s*\d+/,ZM=/^%/,XM=/[\\^$*+?|[\]().{}]/g;function Mt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function KM(e){return e.replace(XM,"\\$&")}function Ra(e){return new RegExp("^(?:"+e.map(KM).join("|")+")","i")}function La(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function QM(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function JM(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function tC(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function eC(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function nC(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function tm(e,t,n){var r=de.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function em(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function rC(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 iC(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function aC(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function nm(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function sC(e,t,n){var r=de.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function rm(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function oC(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function lC(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function cC(e,t,n){var r=de.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function uC(e,t,n){var r=de.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function hC(e,t,n){var r=ZM.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function dC(e,t,n){var r=de.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function pC(e,t,n){var r=de.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function im(e,t){return Mt(e.getDate(),t,2)}function fC(e,t){return Mt(e.getHours(),t,2)}function mC(e,t){return Mt(e.getHours()%12||12,t,2)}function gC(e,t){return Mt(1+Aa.count(jn(e),e),t,3)}function am(e,t){return Mt(e.getMilliseconds(),t,3)}function vC(e,t){return am(e,t)+"000"}function yC(e,t){return Mt(e.getMonth()+1,t,2)}function bC(e,t){return Mt(e.getMinutes(),t,2)}function _C(e,t){return Mt(e.getSeconds(),t,2)}function xC(e){var t=e.getDay();return t===0?7:t}function EC(e,t){return Mt(io.count(jn(e)-1,e),t,2)}function sm(e){var t=e.getDay();return t>=4||t===0?yi(e):yi.ceil(e)}function OC(e,t){return e=sm(e),Mt(yi.count(jn(e),e)+(jn(e).getDay()===4),t,2)}function TC(e){return e.getDay()}function SC(e,t){return Mt(ao.count(jn(e)-1,e),t,2)}function wC(e,t){return Mt(e.getFullYear()%100,t,2)}function $C(e,t){return e=sm(e),Mt(e.getFullYear()%100,t,2)}function MC(e,t){return Mt(e.getFullYear()%1e4,t,4)}function CC(e,t){var n=e.getDay();return e=n>=4||n===0?yi(e):yi.ceil(e),Mt(e.getFullYear()%1e4,t,4)}function AC(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Mt(t/60|0,"0",2)+Mt(t%60,"0",2)}function om(e,t){return Mt(e.getUTCDate(),t,2)}function kC(e,t){return Mt(e.getUTCHours(),t,2)}function RC(e,t){return Mt(e.getUTCHours()%12||12,t,2)}function LC(e,t){return Mt(1+iu.count(Pr(e),e),t,3)}function lm(e,t){return Mt(e.getUTCMilliseconds(),t,3)}function DC(e,t){return lm(e,t)+"000"}function IC(e,t){return Mt(e.getUTCMonth()+1,t,2)}function NC(e,t){return Mt(e.getUTCMinutes(),t,2)}function PC(e,t){return Mt(e.getUTCSeconds(),t,2)}function UC(e){var t=e.getUTCDay();return t===0?7:t}function BC(e,t){return Mt(Qf.count(Pr(e)-1,e),t,2)}function cm(e){var t=e.getUTCDay();return t>=4||t===0?bi(e):bi.ceil(e)}function HC(e,t){return e=cm(e),Mt(bi.count(Pr(e),e)+(Pr(e).getUTCDay()===4),t,2)}function VC(e){return e.getUTCDay()}function FC(e,t){return Mt(so.count(Pr(e)-1,e),t,2)}function GC(e,t){return Mt(e.getUTCFullYear()%100,t,2)}function zC(e,t){return e=cm(e),Mt(e.getUTCFullYear()%100,t,2)}function jC(e,t){return Mt(e.getUTCFullYear()%1e4,t,4)}function WC(e,t){var n=e.getUTCDay();return e=n>=4||n===0?bi(e):bi.ceil(e),Mt(e.getUTCFullYear()%1e4,t,4)}function qC(){return"+0000"}function um(){return"%"}function hm(e){return+e}function dm(e){return Math.floor(+e/1e3)}var _i,pm;YC({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 YC(e){return _i=YM(e),pm=_i.format,_i.parse,_i.utcFormat,_i.utcParse,_i}function ZC(e){return new Date(e)}function XC(e){return e instanceof Date?+e:+new Date(+e)}function fm(e,t,n,r,i,a,s,o,l,c){var u=mf(),d=u.invert,h=u.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),v=c("%b %d"),x=c("%B"),T=c("%Y");function E(S){return(l(S)<S?p:o(S)<S?f:s(S)<S?g:a(S)<S?m:r(S)<S?i(S)<S?y:v:n(S)<S?x:T)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,XC)):h().map(ZC)},u.ticks=function(S){var L=h();return e(L[0],L[L.length-1],S??10)},u.tickFormat=function(S,L){return L==null?E:c(L)},u.nice=function(S){var L=h();return(!S||typeof S.range!="function")&&(S=t(L[0],L[L.length-1],S??10)),S?h(Xf(L,S)):u},u.copy=function(){return Uc(u,fm(e,t,n,r,i,a,s,o,l,c))},u}function mm(){return ui.apply(fm(WM,qM,jn,au,io,Aa,ru,nu,vi,pm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const gm=Math.abs,be=Math.atan2,Ur=Math.cos,KC=Math.max,lu=Math.min,wn=Math.sin,xi=Math.sqrt,_e=1e-12,Da=Math.PI,oo=Da/2,lo=2*Da;function QC(e){return e>1?0:e<-1?Da:Math.acos(e)}function vm(e){return e>=1?oo:e<=-1?-oo:Math.asin(e)}function ym(e){this._context=e}ym.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 co(e){return new ym(e)}function sr(){}function bm(e){this._context=e}bm.prototype={areaStart:sr,areaEnd:sr,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 _m(e){return new bm(e)}function JC(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 t2=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Wn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function uo(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function e2(e){const t=uo(e,"border-left-width"),n=uo(e,"border-right-width");return e.clientWidth+t+n}function n2(e){const t=uo(e,"border-top-width"),n=uo(e,"border-bottom-width");return e.clientHeight+t+n}function xm(e,t={}){const n=t.width||e2(e),r=t.height||n2(e);return{width:n,height:r}}function r2(){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 Be=16384;function i2(e){(e.width>Be||e.height>Be)&&(e.width>Be&&e.height>Be?e.width>e.height?(e.height*=Be/e.width,e.width=Be):(e.width*=Be/e.height,e.height=Be):e.width>Be?(e.height*=Be/e.width,e.width=Be):(e.width*=Be/e.height,e.height=Be))}function ho(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 a2(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function s2(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),a2(i)}const Ae=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Ae(n,t)};function o2(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function l2(e){return Wn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function c2(e,t,n){const r=`.${e}:${t}`,i=n.cssText?o2(n):l2(n);return document.createTextNode(`${r}{${i}}`)}function Em(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const a=t2();try{t.className=`${t.className} ${a}`}catch{return}const s=document.createElement("style");s.appendChild(c2(a,n,r)),t.appendChild(s)}function u2(e,t){Em(e,t,":before"),Em(e,t,":after")}const Om="application/font-woff",Tm="image/jpeg",h2={woff:Om,woff2:Om,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Tm,jpeg:Tm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function d2(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cu(e){const t=d2(e).toLowerCase();return h2[t]||""}function p2(e){return e.split(/,/)[1]}function uu(e){return e.search(/^(data:)/)!==-1}function f2(e,t){return`data:${t};base64,${e}`}async function Sm(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((a,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{a(n({res:r,result:o.result}))}catch(l){s(l)}},o.readAsDataURL(i)})}const hu={};function m2(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 du(e,t,n){const r=m2(e,t,n.includeQueryParams);if(hu[r]!=null)return hu[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Sm(e,n.fetchRequestInit,({res:s,result:o})=>(t||(t=s.headers.get("Content-Type")||""),p2(o)));i=f2(a,t)}catch(a){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${e}`;a&&(s=typeof a=="string"?a:a.message),s&&console.warn(s)}return hu[r]=i,i}async function g2(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ho(t)}async function v2(e,t){if(e.currentSrc){const a=document.createElement("canvas"),s=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,s==null||s.drawImage(e,0,0,a.width,a.height);const o=a.toDataURL();return ho(o)}const n=e.poster,r=cu(n),i=await du(n,r,t);return ho(i)}async function y2(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await po(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function b2(e,t){return Ae(e,HTMLCanvasElement)?g2(e):Ae(e,HTMLVideoElement)?v2(e,t):Ae(e,HTMLIFrameElement)?y2(e):e.cloneNode(!1)}const _2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function x2(e,t,n){var r,i;let a=[];return _2(e)&&e.assignedNodes?a=Wn(e.assignedNodes()):Ae(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?a=Wn(e.contentDocument.body.childNodes):a=Wn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Ae(e,HTMLVideoElement)||await a.reduce((s,o)=>s.then(()=>po(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function E2(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Wn(r).forEach(i=>{let a=r.getPropertyValue(i);i==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Ae(e,HTMLIFrameElement)&&i==="display"&&a==="inline"&&(a="block"),i==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),n.setProperty(i,a,r.getPropertyPriority(i))})}function O2(e,t){Ae(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Ae(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function T2(e,t){if(Ae(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function S2(e,t){return Ae(t,Element)&&(E2(e,t),u2(e,t),O2(e,t),T2(e,t)),t}async function w2(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const s=n[a].getAttribute("xlink:href");if(s){const o=e.querySelector(s),l=document.querySelector(s);!o&&l&&!r[s]&&(r[s]=await po(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",s=document.createElementNS(a,"svg");s.setAttribute("xmlns",a),s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.overflow="hidden",s.style.display="none";const o=document.createElementNS(a,"defs");s.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(s)}return e}async function po(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>b2(r,t)).then(r=>x2(e,r,t)).then(r=>S2(e,r)).then(r=>w2(r,t))}const wm=/url\((['"]?)([^'"]+?)\1\)/g,$2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,M2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function C2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function A2(e){const t=[];return e.replace(wm,(n,r,i)=>(t.push(i),n)),t.filter(n=>!uu(n))}async function k2(e,t,n,r,i){try{const a=n?JC(t,n):t,s=cu(t);let o;return i||(o=await du(a,s,r)),e.replace(C2(t),`$1${o}$3`)}catch{}return e}function R2(e,{preferredFontFormat:t}){return t?e.replace(M2,n=>{for(;;){const[r,,i]=$2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function $m(e){return e.search(wm)!==-1}async function Mm(e,t,n){if(!$m(e))return e;const r=R2(e,n);return A2(r).reduce((i,a)=>i.then(s=>k2(s,a,t,n)),Promise.resolve(r))}async function fo(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Mm(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function L2(e,t){await fo("background",e,t)||await fo("background-image",e,t),await fo("mask",e,t)||await fo("mask-image",e,t)}async function D2(e,t){const n=Ae(e,HTMLImageElement);if(!(n&&!uu(e.src))&&!(Ae(e,SVGImageElement)&&!uu(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await du(r,cu(r),t);await new Promise((a,s)=>{e.onload=a,e.onerror=s;const o=e;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function I2(e,t){const n=Wn(e.childNodes).map(r=>Cm(r,t));await Promise.all(n).then(()=>e)}async function Cm(e,t){Ae(e,Element)&&(await L2(e,t),await D2(e,t),await I2(e,t))}function N2(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 Am={};async function km(e){let t=Am[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Am[e]=t,t}async function Rm(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(r,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),Sm(s,t.fetchRequestInit,({result:o})=>(n=n.replace(a,`url(${o})`),[a,o]))});return Promise.all(i).then(()=>n)}function Lm(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 a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let l=a.exec(r);if(l===null){if(l=o.exec(r),l===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;t.push(l[0])}return t}async function P2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Wn(i.cssRules||[]).forEach((a,s)=>{if(a.type===CSSRule.IMPORT_RULE){let o=s+1;const l=a.href,c=km(l).then(u=>Rm(u,t)).then(u=>Lm(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(a){const s=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(km(i.href).then(o=>Rm(o,t)).then(o=>Lm(o).forEach(l=>{s.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Wn(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function U2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>$m(t.style.getPropertyValue("src")))}async function B2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Wn(e.ownerDocument.styleSheets),r=await P2(n,t);return U2(r)}async function H2(e,t){const n=await B2(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Mm(r.cssText,i,t)}))).join(`
|
|
3
|
+
`)}async function V2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await H2(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 F2(e,t={}){const{width:n,height:r}=xm(e,t),i=await po(e,t,!0);return await V2(i,t),await Cm(i,t),N2(i,t),await s2(i,n,r)}async function Dm(e,t={}){const{width:n,height:r}=xm(e,t),i=await F2(e,t),a=await ho(i),s=document.createElement("canvas"),o=s.getContext("2d"),l=t.pixelRatio||r2(),c=t.canvasWidth||n,u=t.canvasHeight||r;return s.width=c*l,s.height=u*l,t.skipAutoScale||i2(s),s.style.width=`${c}`,s.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(a,0,0,s.width,s.height),s}async function G2(e,t={}){return(await Dm(e,t)).toDataURL()}async function z2(e,t={}){return(await Dm(e,t)).toDataURL("image/jpeg",t.quality||1)}let qn=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 j2="DONT_STYLE_ME_css_styles_verifier";let U=class zh extends qn{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=P(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)}})},a={width:t.attr("width"),height:t.attr("height")},s=t.node();let o,l,c,u;try{typeof s.getBBox=="function"&&(o=s.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(s==null?void 0:s.getBoundingClientRect)=="function"&&(c=s.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(s instanceof SVGSVGElement&&(d={width:s.clientWidth,height:s.clientHeight}),n){if(n.useAttrs&&(i(a),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:_(t.node(),"width","baseVal","value"),height:_(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(a)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),a,s;return i.length===2?(a=i[0],i=i[1].split("."),s=i[0]):(i=n.split("."),a=i[0]),t.append(a).attr("id",s).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(),a=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-a.left,r.top=i.top-a.top}catch(s){console.error(s)}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=_(t,"style","prefix"),r=P(this.getHolder()).append("div").classed(`${Ce}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",j2),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),P(this.getHolder()).classed(`${Ce}--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=P(r);i.classed("filled",!0),z2(this.getMainContainer(),{quality:1,filter:a=>!(a.classList&&a.classList.contains("cds--cc--toolbar"))}).then(function(a){var s;let o="myChart";const l=_(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(s=t.services.files)==null||s.downloadImage(a,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=P(r);i.classed("filled",!0),G2(this.getMainContainer(),{quality:1,filter:a=>!(a.classList&&a.classList.contains("cds--cc--toolbar"))}).then(function(a){var s;let o="myChart";const l=_(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(s=t.services.files)==null||s.downloadImage(a,`${o}.png`),i.classed("filled",!1)}).catch(function(a){console.error("oops, something went wrong!",a)})}isFullScreenMode(){return P(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();P(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=P(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=zh.getSVGElementSize(P(this.mainContainer),{useBBox:!0}),n=P(this.mainContainer).attr("class"),r=P(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(a){i+=Number(zh.getSVGElementSize(P(a),{useBBox:!0}).height)}),i<=t?P(this.mainContainer).attr("height",i):P(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&P(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(w.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(w.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=no(()=>{var a;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(a=this.services.events)==null||a.dispatchEvent(w.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},pu=class _1 extends qn{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:_1.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Im(e){const t=W2(Nm(e),360);return or(t,[0,10])||or(t,[350,0])?{textAnchor:bn.START,dominantBaseline:_n.MIDDLE}:or(t,[10,80])?{textAnchor:bn.START,dominantBaseline:_n.HANGING}:or(t,[80,100])?{textAnchor:bn.MIDDLE,dominantBaseline:_n.HANGING}:or(t,[100,170])?{textAnchor:bn.END,dominantBaseline:_n.HANGING}:or(t,[170,190])?{textAnchor:bn.END,dominantBaseline:_n.MIDDLE}:or(t,[190,260])?{textAnchor:bn.END,dominantBaseline:_n.BASELINE}:or(t,[260,280])?{textAnchor:bn.MIDDLE,dominantBaseline:_n.BASELINE}:{textAnchor:bn.START,dominantBaseline:_n.BASELINE}}function W2(e,t){return(e%t+t)%t}function or(e,[t,n]){return e>=t&&e<=n}function Nm(e){return e*(180/Math.PI)}function Kt(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 q2(e,t){return t*Math.sin(e-Math.PI/2)}function Y2(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;)n=t(n,e[i],i,e);return n}function Z2(e){return function(t){return e==null?void 0:e[t]}}var X2={À:"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"},K2=Z2(X2),Q2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,J2="\\u0300-\\u036f",tA="\\ufe20-\\ufe2f",eA="\\u20d0-\\u20ff",nA=J2+tA+eA,rA="["+nA+"]",iA=RegExp(rA,"g");function aA(e){return e=la(e),e&&e.replace(Q2,K2).replace(iA,"")}var sA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function oA(e){return e.match(sA)||[]}var lA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cA(e){return lA.test(e)}var Pm="\\ud800-\\udfff",uA="\\u0300-\\u036f",hA="\\ufe20-\\ufe2f",dA="\\u20d0-\\u20ff",pA=uA+hA+dA,Um="\\u2700-\\u27bf",Bm="a-z\\xdf-\\xf6\\xf8-\\xff",fA="\\xac\\xb1\\xd7\\xf7",mA="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gA="\\u2000-\\u206f",vA=" \\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",Hm="A-Z\\xc0-\\xd6\\xd8-\\xde",yA="\\ufe0e\\ufe0f",Vm=fA+mA+gA+vA,Fm="['’]",Gm="["+Vm+"]",bA="["+pA+"]",zm="\\d+",_A="["+Um+"]",jm="["+Bm+"]",Wm="[^"+Pm+Vm+zm+Um+Bm+Hm+"]",xA="\\ud83c[\\udffb-\\udfff]",EA="(?:"+bA+"|"+xA+")",OA="[^"+Pm+"]",qm="(?:\\ud83c[\\udde6-\\uddff]){2}",Ym="[\\ud800-\\udbff][\\udc00-\\udfff]",Ei="["+Hm+"]",TA="\\u200d",Zm="(?:"+jm+"|"+Wm+")",SA="(?:"+Ei+"|"+Wm+")",Xm="(?:"+Fm+"(?:d|ll|m|re|s|t|ve))?",Km="(?:"+Fm+"(?:D|LL|M|RE|S|T|VE))?",Qm=EA+"?",Jm="["+yA+"]?",wA="(?:"+TA+"(?:"+[OA,qm,Ym].join("|")+")"+Jm+Qm+")*",$A="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",CA=Jm+Qm+wA,AA="(?:"+[_A,qm,Ym].join("|")+")"+CA,kA=RegExp([Ei+"?"+jm+"+"+Xm+"(?="+[Gm,Ei,"$"].join("|")+")",SA+"+"+Km+"(?="+[Gm,Ei+Zm,"$"].join("|")+")",Ei+"?"+Zm+"+"+Xm,Ei+"+"+Km,MA,$A,zm,AA].join("|"),"g");function RA(e){return e.match(kA)||[]}function LA(e,t,n){return e=la(e),t=t,t===void 0?cA(e)?RA(e):oA(e):e.match(t)||[]}var DA="['’]",IA=RegExp(DA,"g");function tg(e){return function(t){return Y2(LA(aA(t).replace(IA,"")),e,"")}}function NA(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function eg(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=gi(n),n=n===n?n:0),t!==void 0&&(t=gi(t),t=t===t?t:0),NA(gi(e),t,n)}var PA="Expected a function";function UA(e,t,n){if(typeof e!="function")throw new TypeError(PA);return setTimeout(function(){e.apply(void 0,n)},t)}var BA=Xl(function(e,t,n){return UA(e,gi(t)||0,n)});function HA(e,t){var n=-1,r=Or(e)?Array(e.length):[];return qc(e,function(i,a,s){r[++n]=t(i,a,s)}),r}function VA(e,t){var n=fe(e)?zl:HA;return n(e,Cs(t))}var FA=1/0;function GA(e,t){return Ss(VA(e,t),FA)}function ng(e,t){return Ms(e,t)}var Oi=tg(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function zA(e,t){var n;return qc(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}function jA(e,t,n){var r=fe(e)?Jd:zA;return r(e,Cs(t))}class Br{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 a=n[i],s=t+a,o=Math.abs(t)<Math.abs(a)?t-(s-a):a-(s-t);o&&(n[r++]=o),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,a,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,a=i-(s-r),!a););n>0&&(a<0&&t[n-1]<0||a>0&&t[n-1]>0)&&(i=a*2,r=s+i,i==r-s&&(s=r))}return s}}function*WA(e){for(const t of e)yield*t}function rg(e){return Array.from(WA(e))}function qA(e){return e}var mo=1,go=2,fu=3,Ia=4,ig=1e-6;function YA(e){return"translate("+e+",0)"}function ZA(e){return"translate(0,"+e+")"}function XA(e){return t=>+e(t)}function KA(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function QA(){return!this.__axis}function vo(e,t){var n=[],r=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===mo||e===Ia?-1:1,u=e===Ia||e===go?"x":"y",d=e===mo||e===fu?YA:ZA;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):qA),m=Math.max(a,0)+o,y=t.range(),v=+y[0]+l,x=+y[y.length-1]+l,T=(t.bandwidth?KA:XA)(t.copy(),l),E=p.selection?p.selection():p,S=E.selectAll(".domain").data([null]),L=E.selectAll(".tick").data(f,t).order(),N=L.exit(),D=L.enter().append("g").attr("class","tick"),I=L.select("line"),M=L.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),L=L.merge(D),I=I.merge(D.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),M=M.merge(D.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===mo?"0em":e===fu?"0.71em":"0.32em")),p!==E&&(S=S.transition(p),L=L.transition(p),I=I.transition(p),M=M.transition(p),N=N.transition(p).attr("opacity",ig).attr("transform",function(q){return isFinite(q=T(q))?d(q+l):this.getAttribute("transform")}),D.attr("opacity",ig).attr("transform",function(q){var H=this.parentNode.__axis;return d((H&&isFinite(H=H(q))?H:T(q))+l)})),N.remove(),S.attr("d",e===Ia||e===go?s?"M"+c*s+","+v+"H"+l+"V"+x+"H"+c*s:"M"+l+","+v+"V"+x:s?"M"+v+","+c*s+"V"+l+"H"+x+"V"+c*s:"M"+v+","+l+"H"+x),L.attr("opacity",1).attr("transform",function(q){return d(T(q)+l)}),I.attr(u+"2",c*a),M.attr(u,c*m).text(g),E.filter(QA).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===go?"start":e===Ia?"end":"middle"),E.each(function(){this.__axis=T})}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?(a=s=+p,h):a},h.tickSizeInner=function(p){return arguments.length?(a=+p,h):a},h.tickSizeOuter=function(p){return arguments.length?(s=+p,h):s},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function JA(e){return vo(mo,e)}function tk(e){return vo(go,e)}function mu(e){return vo(fu,e)}function ag(e){return vo(Ia,e)}const gu={capture:!0,passive:!1};function vu(e){e.preventDefault(),e.stopImmediatePropagation()}function ek(e){var t=e.document.documentElement,n=P(e).on("dragstart.drag",vu,gu);"onselectstart"in t?n.on("selectstart.drag",vu,gu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function nk(e,t){var n=e.document.documentElement,r=P(e).on("dragstart.drag",null);t&&(r.on("click.drag",vu,gu),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 rk(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const ik=e=>+e,yu=e=>()=>e;function ak(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:a}){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:a}})}function sk(e){e.stopImmediatePropagation()}function bu(e){e.preventDefault(),e.stopImmediatePropagation()}var sg={name:"drag"},_u={name:"space"},Ti={name:"handle"},Si={name:"center"};const{abs:og,max:xe,min:Ee}=Math;function lg(e){return[+e[0],+e[1]]}function cg(e){return[lg(e[0]),lg(e[1])]}var yo={name:"x",handles:["w","e"].map(bo),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]]}},xu={name:"y",handles:["n","s"].map(bo),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},Yn={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"},ug={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},hg={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ok={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},lk={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function bo(e){return{type:e}}function ck(e){return!e.ctrlKey&&!e.button}function uk(){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 hk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Eu(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function dk(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function dg(){return pk(yo)}function pk(e){var t=uk,n=ck,r=hk,i=!0,a=yc("start","brush","end"),s=6,o;function l(m){var y=m.property("__brush",g).selectAll(".overlay").data([bo("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Yn.overlay).merge(y).each(function(){var x=Eu(this).extent;P(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),m.selectAll(".selection").data([bo("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Yn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var v=m.selectAll(".handle").data(e.handles,function(x){return x.type});v.exit().remove(),v.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return Yn[x.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,y,v){m.tween?m.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,T=x.__brush,E=u(x,arguments),S=T.selection,L=e.input(typeof y=="function"?y.apply(this,arguments):y,T.extent),N=va(S,L);function D(I){T.selection=I===1&&L===null?null:N(I),c.call(x),E.brush()}return S!==null&&L!==null?D:D(1)}):m.each(function(){var x=this,T=arguments,E=x.__brush,S=e.input(typeof y=="function"?y.apply(x,T):y,E.extent),L=u(x,T).beforestart();Lc(x),E.selection=S===null?null:S,c.call(x),L.start(v).brush(v).end(v)})},l.clear=function(m,y){l.move(m,null,y)};function c(){var m=P(this),y=Eu(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(v){return v.type[v.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(v){return v.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(v){return v.type==="n"||v.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(v){return v.type==="e"||v.type==="w"?y[1][1]-y[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,y,v){var x=m.__brush.emitter;return x&&(!v||!x.clean)?x:new d(m,y,v)}function d(m,y,v){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=v}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,v){var x=P(this.that).datum();a.call(m,this.that,new ak(m,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:v,dispatch:a}),x)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var y=this,v=m.target.__data__.type,x=(i&&m.metaKey?v="overlay":v)==="selection"?sg:i&&m.altKey?Si:Ti,T=e===xu?null:ok[v],E=e===yo?null:lk[v],S=Eu(y),L=S.extent,N=S.selection,D=L[0][0],I,M,q=L[0][1],H,G,O=L[1][0],k,$,B=L[1][1],F,et,C=0,z=0,Q,at=T&&E&&i&&m.shiftKey,tt,K,nt=Array.from(m.touches||[m],ct=>{const Nt=ct.identifier;return ct=$r(ct,y),ct.point0=ct.slice(),ct.identifier=Nt,ct});Lc(y);var ht=u(y,arguments,!0).beforestart();if(v==="overlay"){N&&(Q=!0);const ct=[nt[0],nt[1]||nt[0]];S.selection=N=[[I=e===xu?D:Ee(ct[0][0],ct[1][0]),H=e===yo?q:Ee(ct[0][1],ct[1][1])],[k=e===xu?O:xe(ct[0][0],ct[1][0]),F=e===yo?B:xe(ct[0][1],ct[1][1])]],nt.length>1&&Ct(m)}else I=N[0][0],H=N[0][1],k=N[1][0],F=N[1][1];M=I,G=H,$=k,et=F;var W=P(y).attr("pointer-events","none"),it=W.selectAll(".overlay").attr("cursor",Yn[v]);if(m.touches)ht.moved=X,ht.ended=_t;else{var gt=P(m.view).on("mousemove.brush",X,!0).on("mouseup.brush",_t,!0);i&>.on("keydown.brush",ne,!0).on("keyup.brush",Jt,!0),ek(m.view)}c.call(y),ht.start(m,x.name);function X(ct){for(const Nt of ct.changedTouches||[ct])for(const ze of nt)ze.identifier===Nt.identifier&&(ze.cur=$r(Nt,y));if(at&&!tt&&!K&&nt.length===1){const Nt=nt[0];og(Nt.cur[0]-Nt[0])>og(Nt.cur[1]-Nt[1])?K=!0:tt=!0}for(const Nt of nt)Nt.cur&&(Nt[0]=Nt.cur[0],Nt[1]=Nt.cur[1]);Q=!0,bu(ct),Ct(ct)}function Ct(ct){const Nt=nt[0],ze=Nt.point0;var oe;switch(C=Nt[0]-ze[0],z=Nt[1]-ze[1],x){case _u:case sg:{T&&(C=xe(D-I,Ee(O-k,C)),M=I+C,$=k+C),E&&(z=xe(q-H,Ee(B-F,z)),G=H+z,et=F+z);break}case Ti:{nt[1]?(T&&(M=xe(D,Ee(O,nt[0][0])),$=xe(D,Ee(O,nt[1][0])),T=1),E&&(G=xe(q,Ee(B,nt[0][1])),et=xe(q,Ee(B,nt[1][1])),E=1)):(T<0?(C=xe(D-I,Ee(O-I,C)),M=I+C,$=k):T>0&&(C=xe(D-k,Ee(O-k,C)),M=I,$=k+C),E<0?(z=xe(q-H,Ee(B-H,z)),G=H+z,et=F):E>0&&(z=xe(q-F,Ee(B-F,z)),G=H,et=F+z));break}case Si:{T&&(M=xe(D,Ee(O,I-C*T)),$=xe(D,Ee(O,k+C*T))),E&&(G=xe(q,Ee(B,H-z*E)),et=xe(q,Ee(B,F+z*E)));break}}$<M&&(T*=-1,oe=I,I=k,k=oe,oe=M,M=$,$=oe,v in ug&&it.attr("cursor",Yn[v=ug[v]])),et<G&&(E*=-1,oe=H,H=F,F=oe,oe=G,G=et,et=oe,v in hg&&it.attr("cursor",Yn[v=hg[v]])),S.selection&&(N=S.selection),tt&&(M=N[0][0],$=N[1][0]),K&&(G=N[0][1],et=N[1][1]),(N[0][0]!==M||N[0][1]!==G||N[1][0]!==$||N[1][1]!==et)&&(S.selection=[[M,G],[$,et]],c.call(y),ht.brush(ct,x.name))}function _t(ct){if(sk(ct),ct.touches){if(ct.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else nk(ct.view,Q),gt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);W.attr("pointer-events","all"),it.attr("cursor",Yn.overlay),S.selection&&(N=S.selection),dk(N)&&(S.selection=null,c.call(y)),ht.end(ct,x.name)}function ne(ct){switch(ct.keyCode){case 16:{at=T&&E;break}case 18:{x===Ti&&(T&&(k=$-C*T,I=M+C*T),E&&(F=et-z*E,H=G+z*E),x=Si,Ct(ct));break}case 32:{(x===Ti||x===Si)&&(T<0?k=$-C:T>0&&(I=M-C),E<0?F=et-z:E>0&&(H=G-z),x=_u,it.attr("cursor",Yn.selection),Ct(ct));break}default:return}bu(ct)}function Jt(ct){switch(ct.keyCode){case 16:{at&&(tt=K=at=!1,Ct(ct));break}case 18:{x===Si&&(T<0?k=$:T>0&&(I=M),E<0?F=et:E>0&&(H=G),x=Ti,Ct(ct));break}case 32:{x===_u&&(ct.altKey?(T&&(k=$-C*T,I=M+C*T),E&&(F=et-z*E,H=G+z*E),x=Si):(T<0?k=$:T>0&&(I=M),E<0?F=et:E>0&&(H=G),x=Ti),it.attr("cursor",Yn[v]),Ct(ct));break}default:return}bu(ct)}}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=cg(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:yu(cg(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:yu(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:yu(!!m),l):r},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=a.on.apply(a,arguments);return m===a?l:m},l}const Ou=Math.PI,Tu=2*Ou,Hr=1e-6,fk=Tu-Hr;function pg(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function mk(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return pg;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let Su=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?pg:mk(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,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,l=r-t,c=i-n,u=s-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>Hr)if(!(Math.abs(d*l-c*u)>Hr)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-s,f=i-o,g=l*l+c*c,m=p*p+f*f,y=Math.sqrt(g),v=Math.sqrt(h),x=a*Math.tan((Ou-Math.acos((g+h-m)/(2*y*v)))/2),T=x/v,E=x/y;Math.abs(T-1)>Hr&&this._append`L${t+T*u},${n+T*d}`,this._append`A${a},${a},0,0,${+(d*p>u*f)},${this._x1=t+E*l},${this._y1=n+E*c}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,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^s,h=s?i-a:a-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Hr||Math.abs(this._y1-u)>Hr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Tu+Tu),h>fk?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>Hr&&this._append`A${r},${r},0,${+(h>=Ou)},${d},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}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 fg(){return new Su}fg.prototype=Su.prototype;var Dt=1e-6,mg=1e-12,Et=Math.PI,ke=Et/2,gg=Et/4,He=Et*2,Te=180/Et,Qt=Et/180,It=Math.abs,vg=Math.atan,Vr=Math.atan2,Pt=Math.cos,gk=Math.exp,vk=Math.log,Rt=Math.sin,lr=Math.sign||function(e){return e>0?1:e<0?-1:0},pn=Math.sqrt,yk=Math.tan;function bk(e){return e>1?0:e<-1?Et:Math.acos(e)}function Zn(e){return e>1?ke:e<-1?-ke:Math.asin(e)}function Je(){}function _o(e,t){e&&bg.hasOwnProperty(e.type)&&bg[e.type](e,t)}var yg={Feature:function(e,t){_o(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)_o(n[r].geometry,t)}},bg={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){wu(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)wu(n[r],t,0)},Polygon:function(e,t){_g(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)_g(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)_o(n[r],t)}};function wu(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function _g(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)wu(e[n],t,1);t.polygonEnd()}function wi(e,t){e&&yg.hasOwnProperty(e.type)?yg[e.type](e,t):_o(e,t)}function $u(e){return[Vr(e[1],e[0]),Zn(e[2])]}function $i(e){var t=e[0],n=e[1],r=Pt(n);return[r*Pt(t),r*Rt(t),Rt(n)]}function xo(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Eo(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 Mu(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Oo(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Cu(e){var t=pn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Au(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 ku(e,t){return It(e)>Et&&(e-=Math.round(e/He)*He),[e,t]}ku.invert=ku;function xg(e,t,n){return(e%=He)?t||n?Au(Og(e),Tg(t,n)):Og(e):t||n?Tg(t,n):ku}function Eg(e){return function(t,n){return t+=e,It(t)>Et&&(t-=Math.round(t/He)*He),[t,n]}}function Og(e){var t=Eg(e);return t.invert=Eg(-e),t}function Tg(e,t){var n=Pt(e),r=Rt(e),i=Pt(t),a=Rt(t);function s(o,l){var c=Pt(l),u=Pt(o)*c,d=Rt(o)*c,h=Rt(l),p=h*n+u*r;return[Vr(d*i-p*a,u*n-h*r),Zn(p*i+d*a)]}return s.invert=function(o,l){var c=Pt(l),u=Pt(o)*c,d=Rt(o)*c,h=Rt(l),p=h*i-d*a;return[Vr(d*i+h*a,u*n+p*r),Zn(p*n-u*r)]},s}function _k(e){e=xg(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]*=Te,n[1]*=Te,n}return t.invert=function(n){return n=e.invert(n[0]*Qt,n[1]*Qt),n[0]*=Te,n[1]*=Te,n},t}function xk(e,t,n,r,i,a){if(n){var s=Pt(t),o=Rt(t),l=r*n;i==null?(i=t+r*He,a=t-l/2):(i=Sg(s,i),a=Sg(s,a),(r>0?i<a:i>a)&&(i+=r*He));for(var c,u=i;r>0?u>a:u<a;u-=l)c=$u([s,-o*Pt(u),-o*Rt(u)]),e.point(c[0],c[1])}}function Sg(e,t){t=$i(t),t[0]-=e,Cu(t);var n=bk(-t[1]);return((-t[2]<0?-n:n)+He-Dt)%He}function wg(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Je,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function To(e,t){return It(e[0]-t[0])<Dt&&It(e[1]-t[1])<Dt}function So(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 $g(e,t,n,r,i){var a=[],s=[],o,l;if(e.forEach(function(f){if(!((g=f.length-1)<=0)){var g,m=f[0],y=f[g],v;if(To(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=f[o])[0],m[1]);i.lineEnd();return}y[0]+=2*Dt}a.push(v=new So(m,f,null,!0)),s.push(v.o=new So(m,null,v,!1)),a.push(v=new So(y,f,null,!1)),s.push(v.o=new So(y,null,v,!0))}}),!!a.length){for(s.sort(t),Mg(a),Mg(s),o=0,l=s.length;o<l;++o)s[o].e=n=!n;for(var c=a[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 Mg(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 Ru(e){return It(e[0])<=Et?e[0]:lr(e[0])*((It(e[0])+Et)%He-Et)}function Ek(e,t){var n=Ru(t),r=t[1],i=Rt(r),a=[Rt(n),-Pt(n),0],s=0,o=0,l=new Br;i===1?r=ke+Dt:i===-1&&(r=-ke-Dt);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=Ru(p),g=p[1]/2+gg,m=Rt(g),y=Pt(g),v=0;v<h;++v,f=T,m=S,y=L,p=x){var x=d[v],T=Ru(x),E=x[1]/2+gg,S=Rt(E),L=Pt(E),N=T-f,D=N>=0?1:-1,I=D*N,M=I>Et,q=m*S;if(l.add(Vr(q*D*Rt(I),y*L+q*Pt(I))),s+=M?N+D*He:N,M^f>=n^T>=n){var H=Eo($i(p),$i(x));Cu(H);var G=Eo(a,H);Cu(G);var O=(M^N>=0?-1:1)*Zn(G[2]);(r>O||r===O&&(H[0]||H[1]))&&(o+=M^N>=0?1:-1)}}return(s<-Dt||s<Dt&&l<-mg)^o&1}function Cg(e,t,n,r){return function(i){var a=t(i),s=wg(),o=t(s),l=!1,c,u,d,h={point:p,lineStart:g,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=v,h.lineEnd=x,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,u=rg(u);var T=Ek(c,r);u.length?(l||(i.polygonStart(),l=!0),$g(u,Tk,T,n,i)):T&&(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(T,E){e(T,E)&&i.point(T,E)}function f(T,E){a.point(T,E)}function g(){h.point=f,a.lineStart()}function m(){h.point=p,a.lineEnd()}function y(T,E){d.push([T,E]),o.point(T,E)}function v(){o.lineStart(),d=[]}function x(){y(d[0][0],d[0][1]),o.lineEnd();var T=o.clean(),E=s.result(),S,L=E.length,N,D,I;if(d.pop(),c.push(d),d=null,!!L){if(T&1){if(D=E[0],(N=D.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<N;++S)i.point((I=D[S])[0],I[1]);i.lineEnd()}return}L>1&&T&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(Ok))}}return h}}function Ok(e){return e.length>1}function Tk(e,t){return((e=e.x)[0]<0?e[1]-ke-Dt:ke-e[1])-((t=t.x)[0]<0?t[1]-ke-Dt:ke-t[1])}const Ag=Cg(function(){return!0},Sk,$k,[-Et,-ke]);function Sk(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,s){var o=a>0?Et:-Et,l=It(a-t);It(l-Et)<Dt?(e.point(t,n=(n+s)/2>0?ke:-ke),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(a,n),i=0):r!==o&&l>=Et&&(It(t-r)<Dt&&(t-=r*Dt),It(a-o)<Dt&&(a-=o*Dt),n=wk(t,n,a,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=a,n=s),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function wk(e,t,n,r){var i,a,s=Rt(e-n);return It(s)>Dt?vg((Rt(t)*(a=Pt(r))*Rt(n)-Rt(r)*(i=Pt(t))*Rt(e))/(i*a*s)):(t+r)/2}function $k(e,t,n,r){var i;if(e==null)i=n*ke,r.point(-Et,i),r.point(0,i),r.point(Et,i),r.point(Et,0),r.point(Et,-i),r.point(0,-i),r.point(-Et,-i),r.point(-Et,0),r.point(-Et,i);else if(It(e[0]-t[0])>Dt){var a=e[0]<t[0]?Et:-Et;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(t[0],t[1])}function Mk(e){var t=Pt(e),n=2*Qt,r=t>0,i=It(t)>Dt;function a(u,d,h,p){xk(p,e,n,h,u,d)}function s(u,d){return Pt(u)*Pt(d)>t}function o(u){var d,h,p,f,g;return{lineStart:function(){f=p=!1,g=1},point:function(m,y){var v=[m,y],x,T=s(m,y),E=r?T?0:c(m,y):T?c(m+(m<0?Et:-Et),y):0;if(!d&&(f=p=T)&&u.lineStart(),T!==p&&(x=l(d,v),(!x||To(d,x)||To(v,x))&&(v[2]=1)),T!==p)g=0,T?(u.lineStart(),x=l(v,d),u.point(x[0],x[1])):(x=l(d,v),u.point(x[0],x[1],2),u.lineEnd()),d=x;else if(i&&d&&r^T){var S;!(E&h)&&(S=l(v,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)))}T&&(!d||!To(d,v))&&u.point(v[0],v[1]),d=v,p=T,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return g|(f&&p)<<1}}}function l(u,d,h){var p=$i(u),f=$i(d),g=[1,0,0],m=Eo(p,f),y=xo(m,m),v=m[0],x=y-v*v;if(!x)return!h&&u;var T=t*y/x,E=-t*v/x,S=Eo(g,m),L=Oo(g,T),N=Oo(m,E);Mu(L,N);var D=S,I=xo(L,D),M=xo(D,D),q=I*I-M*(xo(L,L)-1);if(!(q<0)){var H=pn(q),G=Oo(D,(-I-H)/M);if(Mu(G,L),G=$u(G),!h)return G;var O=u[0],k=d[0],$=u[1],B=d[1],F;k<O&&(F=O,O=k,k=F);var et=k-O,C=It(et-Et)<Dt,z=C||et<Dt;if(!C&&B<$&&(F=$,$=B,B=F),z?C?$+B>0^G[1]<(It(G[0]-O)<Dt?$:B):$<=G[1]&&G[1]<=B:et>Et^(O<=G[0]&&G[0]<=k)){var Q=Oo(D,(-I+H)/M);return Mu(Q,L),[G,$u(Q)]}}}function c(u,d){var h=r?e:Et-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return Cg(s,o,a,r?[0,-e]:[-Et,e-Et])}function Ck(e,t,n,r,i,a){var s=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-s,p=c-o,f;if(f=n-s,!(!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-s,!(!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=a-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]=s+u*h,e[1]=o+u*p),d<1&&(t[0]=s+d*h,t[1]=o+d*p),!0}}}}}var Na=1e9,wo=-Na;function Ak(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function a(c,u,d,h){var p=0,f=0;if(c==null||(p=s(c,d))!==(f=s(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 s(c,u){return It(c[0]-e)<Dt?u>0?0:3:It(c[0]-n)<Dt?u>0?2:1:It(c[1]-t)<Dt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),h=s(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=wg(),h,p,f,g,m,y,v,x,T,E,S,L={point:N,lineStart:q,lineEnd:H,polygonStart:I,polygonEnd:M};function N(O,k){i(O,k)&&u.point(O,k)}function D(){for(var O=0,k=0,$=p.length;k<$;++k)for(var B=p[k],F=1,et=B.length,C=B[0],z,Q,at=C[0],tt=C[1];F<et;++F)z=at,Q=tt,C=B[F],at=C[0],tt=C[1],Q<=r?tt>r&&(at-z)*(r-Q)>(tt-Q)*(e-z)&&++O:tt<=r&&(at-z)*(r-Q)<(tt-Q)*(e-z)&&--O;return O}function I(){u=d,h=[],p=[],S=!0}function M(){var O=D(),k=S&&O,$=(h=rg(h)).length;(k||$)&&(c.polygonStart(),k&&(c.lineStart(),a(null,null,1,c),c.lineEnd()),$&&$g(h,o,O,a,c),c.polygonEnd()),u=c,h=p=f=null}function q(){L.point=G,p&&p.push(f=[]),E=!0,T=!1,v=x=NaN}function H(){h&&(G(g,m),y&&T&&d.rejoin(),h.push(d.result())),L.point=N,T&&u.lineEnd()}function G(O,k){var $=i(O,k);if(p&&f.push([O,k]),E)g=O,m=k,y=$,E=!1,$&&(u.lineStart(),u.point(O,k));else if($&&T)u.point(O,k);else{var B=[v=Math.max(wo,Math.min(Na,v)),x=Math.max(wo,Math.min(Na,x))],F=[O=Math.max(wo,Math.min(Na,O)),k=Math.max(wo,Math.min(Na,k))];Ck(B,F,e,t,n,r)?(T||(u.lineStart(),u.point(B[0],B[1])),u.point(F[0],F[1]),$||u.lineEnd(),S=!1):$&&(u.lineStart(),u.point(O,k),S=!1)}v=O,x=k,T=$}return L}}const Lu=e=>e;var Du=new Br,Iu=new Br,kg,Rg,Nu,Pu,Xn={point:Je,lineStart:Je,lineEnd:Je,polygonStart:function(){Xn.lineStart=kk,Xn.lineEnd=Lk},polygonEnd:function(){Xn.lineStart=Xn.lineEnd=Xn.point=Je,Du.add(It(Iu)),Iu=new Br},result:function(){var e=Du/2;return Du=new Br,e}};function kk(){Xn.point=Rk}function Rk(e,t){Xn.point=Lg,kg=Nu=e,Rg=Pu=t}function Lg(e,t){Iu.add(Pu*e-Nu*t),Nu=e,Pu=t}function Lk(){Lg(kg,Rg)}var Mi=1/0,$o=Mi,Pa=-Mi,Mo=Pa,Co={point:Dk,lineStart:Je,lineEnd:Je,polygonStart:Je,polygonEnd:Je,result:function(){var e=[[Mi,$o],[Pa,Mo]];return Pa=Mo=-($o=Mi=1/0),e}};function Dk(e,t){e<Mi&&(Mi=e),e>Pa&&(Pa=e),t<$o&&($o=t),t>Mo&&(Mo=t)}var Uu=0,Bu=0,Ua=0,Ao=0,ko=0,Ci=0,Hu=0,Vu=0,Ba=0,Dg,Ig,$n,Mn,tn={point:Fr,lineStart:Ng,lineEnd:Pg,polygonStart:function(){tn.lineStart=Pk,tn.lineEnd=Uk},polygonEnd:function(){tn.point=Fr,tn.lineStart=Ng,tn.lineEnd=Pg},result:function(){var e=Ba?[Hu/Ba,Vu/Ba]:Ci?[Ao/Ci,ko/Ci]:Ua?[Uu/Ua,Bu/Ua]:[NaN,NaN];return Uu=Bu=Ua=Ao=ko=Ci=Hu=Vu=Ba=0,e}};function Fr(e,t){Uu+=e,Bu+=t,++Ua}function Ng(){tn.point=Ik}function Ik(e,t){tn.point=Nk,Fr($n=e,Mn=t)}function Nk(e,t){var n=e-$n,r=t-Mn,i=pn(n*n+r*r);Ao+=i*($n+e)/2,ko+=i*(Mn+t)/2,Ci+=i,Fr($n=e,Mn=t)}function Pg(){tn.point=Fr}function Pk(){tn.point=Bk}function Uk(){Ug(Dg,Ig)}function Bk(e,t){tn.point=Ug,Fr(Dg=$n=e,Ig=Mn=t)}function Ug(e,t){var n=e-$n,r=t-Mn,i=pn(n*n+r*r);Ao+=i*($n+e)/2,ko+=i*(Mn+t)/2,Ci+=i,i=Mn*e-$n*t,Hu+=i*($n+e),Vu+=i*(Mn+t),Ba+=i*3,Fr($n=e,Mn=t)}function Bg(e){this._context=e}Bg.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,He);break}}},result:Je};var Fu=new Br,Gu,Hg,Vg,Ha,Va,Fa={point:Je,lineStart:function(){Fa.point=Hk},lineEnd:function(){Gu&&Fg(Hg,Vg),Fa.point=Je},polygonStart:function(){Gu=!0},polygonEnd:function(){Gu=null},result:function(){var e=+Fu;return Fu=new Br,e}};function Hk(e,t){Fa.point=Fg,Hg=Ha=e,Vg=Va=t}function Fg(e,t){Ha-=e,Va-=t,Fu.add(pn(Ha*Ha+Va*Va)),Ha=e,Va=t}let Gg,Ro,zg,jg;class Wg{constructor(t){this._append=t==null?qg:Vk(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!==zg||this._append!==Ro){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`,zg=r,Ro=this._append,jg=this._,this._=i}this._+=jg;break}}}result(){const t=this._;return this._="",t.length?t:null}}function qg(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Vk(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return qg;if(t!==Gg){const n=10**t;Gg=t,Ro=function(r){let i=1;this._+=r[0];for(const a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}return Ro}function Fk(e,t){let n=3,r=4.5,i,a;function s(o){return o&&(typeof r=="function"&&a.pointRadius(+r.apply(this,arguments)),wi(o,i(a))),a.result()}return s.area=function(o){return wi(o,i(Xn)),Xn.result()},s.measure=function(o){return wi(o,i(Fa)),Fa.result()},s.bounds=function(o){return wi(o,i(Co)),Co.result()},s.centroid=function(o){return wi(o,i(tn)),tn.result()},s.projection=function(o){return arguments.length?(i=o==null?(e=null,Lu):(e=o).stream,s):e},s.context=function(o){return arguments.length?(a=o==null?(t=null,new Wg(n)):new Bg(t=o),typeof r!="function"&&a.pointRadius(r),s):t},s.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(a.pointRadius(+o),+o),s):r},s.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&&(a=new Wg(n)),s},s.projection(e).digits(n).context(t)}function zu(e){return function(t){var n=new ju;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ju(){}ju.prototype={constructor:ju,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 Wu(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),wi(n,e.stream(Co)),t(Co.result()),r!=null&&e.clipExtent(r),e}function Yg(e,t,n){return Wu(e,function(r){var i=t[1][0]-t[0][0],a=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(a-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([o,l])},n)}function Gk(e,t,n){return Yg(e,[[0,0],t],n)}function zk(e,t,n){return Wu(e,function(r){var i=+t,a=i/(r[1][0]-r[0][0]),s=(i-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];e.scale(150*a).translate([s,o])},n)}function jk(e,t,n){return Wu(e,function(r){var i=+t,a=i/(r[1][1]-r[0][1]),s=-a*r[0][0],o=(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,o])},n)}var Zg=16,Wk=Pt(30*Qt);function Xg(e,t){return+t?Yk(e,t):qk(e)}function qk(e){return zu({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Yk(e,t){function n(r,i,a,s,o,l,c,u,d,h,p,f,g,m){var y=c-r,v=u-i,x=y*y+v*v;if(x>4*t&&g--){var T=s+h,E=o+p,S=l+f,L=pn(T*T+E*E+S*S),N=Zn(S/=L),D=It(It(S)-1)<Dt||It(a-d)<Dt?(a+d)/2:Vr(E,T),I=e(D,N),M=I[0],q=I[1],H=M-r,G=q-i,O=v*H-y*G;(O*O/x>t||It((y*H+v*G)/x-.5)>.3||s*h+o*p+l*f<Wk)&&(n(r,i,a,s,o,l,M,q,D,T/=L,E/=L,S,g,m),m.point(M,q),n(M,q,D,T,E,S,c,u,d,h,p,f,g,m))}}return function(r){var i,a,s,o,l,c,u,d,h,p,f,g,m={point:y,lineStart:v,lineEnd:T,polygonStart:function(){r.polygonStart(),m.lineStart=E},polygonEnd:function(){r.polygonEnd(),m.lineStart=v}};function y(N,D){N=e(N,D),r.point(N[0],N[1])}function v(){d=NaN,m.point=x,r.lineStart()}function x(N,D){var I=$i([N,D]),M=e(N,D);n(d,h,u,p,f,g,d=M[0],h=M[1],u=N,p=I[0],f=I[1],g=I[2],Zg,r),r.point(d,h)}function T(){m.point=y,r.lineEnd()}function E(){v(),m.point=S,m.lineEnd=L}function S(N,D){x(i=N,D),a=d,s=h,o=p,l=f,c=g,m.point=x}function L(){n(d,h,u,p,f,g,a,s,i,o,l,c,Zg,r),m.lineEnd=T,T()}return m}}var Zk=zu({point:function(e,t){this.stream.point(e*Qt,t*Qt)}});function Xk(e){return zu({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Kk(e,t,n,r,i){function a(s,o){return s*=r,o*=i,[t+e*s,n-e*o]}return a.invert=function(s,o){return[(s-t)/e*r,(n-o)/e*i]},a}function Kg(e,t,n,r,i,a){if(!a)return Kk(e,t,n,r,i);var s=Pt(a),o=Rt(a),l=s*e,c=o*e,u=s/e,d=o/e,h=(o*n-s*t)/e,p=(o*t+s*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 Lo(e){return Qg(function(){return e})()}function Qg(e){var t,n=150,r=480,i=250,a=0,s=0,o=0,l=0,c=0,u,d=0,h=1,p=1,f=null,g=Ag,m=null,y,v,x,T=Lu,E=.5,S,L,N,D,I;function M(O){return N(O[0]*Qt,O[1]*Qt)}function q(O){return O=N.invert(O[0],O[1]),O&&[O[0]*Te,O[1]*Te]}M.stream=function(O){return D&&I===O?D:D=Zk(Xk(u)(g(S(T(I=O)))))},M.preclip=function(O){return arguments.length?(g=O,f=void 0,G()):g},M.postclip=function(O){return arguments.length?(T=O,m=y=v=x=null,G()):T},M.clipAngle=function(O){return arguments.length?(g=+O?Mk(f=O*Qt):(f=null,Ag),G()):f*Te},M.clipExtent=function(O){return arguments.length?(T=O==null?(m=y=v=x=null,Lu):Ak(m=+O[0][0],y=+O[0][1],v=+O[1][0],x=+O[1][1]),G()):m==null?null:[[m,y],[v,x]]},M.scale=function(O){return arguments.length?(n=+O,H()):n},M.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],H()):[r,i]},M.center=function(O){return arguments.length?(a=O[0]%360*Qt,s=O[1]%360*Qt,H()):[a*Te,s*Te]},M.rotate=function(O){return arguments.length?(o=O[0]%360*Qt,l=O[1]%360*Qt,c=O.length>2?O[2]%360*Qt:0,H()):[o*Te,l*Te,c*Te]},M.angle=function(O){return arguments.length?(d=O%360*Qt,H()):d*Te},M.reflectX=function(O){return arguments.length?(h=O?-1:1,H()):h<0},M.reflectY=function(O){return arguments.length?(p=O?-1:1,H()):p<0},M.precision=function(O){return arguments.length?(S=Xg(L,E=O*O),G()):pn(E)},M.fitExtent=function(O,k){return Yg(M,O,k)},M.fitSize=function(O,k){return Gk(M,O,k)},M.fitWidth=function(O,k){return zk(M,O,k)},M.fitHeight=function(O,k){return jk(M,O,k)};function H(){var O=Kg(n,0,0,h,p,d).apply(null,t(a,s)),k=Kg(n,r-O[0],i-O[1],h,p,d);return u=xg(o,l,c),L=Au(t,k),N=Au(u,L),S=Xg(L,E),G()}function G(){return D=I=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&q,H()}}function Jg(e){var t=0,n=Et/3,r=Qg(e),i=r(t,n);return i.parallels=function(a){return arguments.length?r(t=a[0]*Qt,n=a[1]*Qt):[t*Te,n*Te]},i}function Qk(e){var t=Pt(e);function n(r,i){return[r*t,Rt(i)/t]}return n.invert=function(r,i){return[r/t,Zn(i*t)]},n}function Jk(e,t){var n=Rt(e),r=(n+Rt(t))/2;if(It(r)<Dt)return Qk(e);var i=1+n*(2*r-n),a=pn(i)/r;function s(o,l){var c=pn(i-2*r*Rt(l))/r;return[c*Rt(o*=r),a-c*Pt(o)]}return s.invert=function(o,l){var c=a-l,u=Vr(o,It(c))*lr(c);return c*r<0&&(u-=Et*lr(o)*lr(c)),[u/r,Zn((i-(o*o+c*c)*r*r)/(2*r))]},s}function tv(){return Jg(Jk).scale(155.424).center([0,33.6442])}function tR(){return tv().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function qu(e,t){return[e,vk(yk((ke+t)/2))]}qu.invert=function(e,t){return[e,2*vg(gk(t))-ke]};function eR(){return nR(qu).scale(961/He)}function nR(e){var t=Lo(e),n=t.center,r=t.scale,i=t.translate,a=t.clipExtent,s=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?s=o=l=c=null:(s=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,o],[l,c]]};function u(){var d=Et*r(),h=t(_k(t.rotate()).invert([0,0]));return a(s==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===qu?[[Math.max(h[0]-d,s),o],[Math.min(h[0]+d,l),c]]:[[s,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function Do(e,t){return[e,t]}Do.invert=Do;function rR(){return Lo(Do).scale(152.63)}function iR(e,t){var n=Pt(e),r=e===t?Rt(e):(n-Pt(t))/(t-e),i=n/r+e;if(It(r)<Dt)return Do;function a(s,o){var l=i-o,c=r*s;return[l*Rt(c),i-l*Pt(c)]}return a.invert=function(s,o){var l=i-o,c=Vr(s,It(l))*lr(l);return l*r<0&&(c-=Et*lr(s)*lr(l)),[c/r,i-lr(r)*pn(s*s+l*l)]},a}function aR(){return Jg(iR).scale(131.154).center([0,13.9389])}var Ga=1.340264,za=-.081106,ja=893e-6,Wa=.003796,Io=pn(3)/2,sR=12;function ev(e,t){var n=Zn(Io*Rt(t)),r=n*n,i=r*r*r;return[e*Pt(n)/(Io*(Ga+3*za*r+i*(7*ja+9*Wa*r))),n*(Ga+za*r+i*(ja+Wa*r))]}ev.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,a=0,s,o,l;a<sR&&(o=n*(Ga+za*r+i*(ja+Wa*r))-t,l=Ga+3*za*r+i*(7*ja+9*Wa*r),n-=s=o/l,r=n*n,i=r*r*r,!(It(s)<mg));++a);return[Io*e*(Ga+3*za*r+i*(7*ja+9*Wa*r))/Pt(n),Zn(Rt(n)/Io)]};function oR(){return Lo(ev).scale(177.158)}function nv(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)))]}nv.invert=function(e,t){var n=t,r=25,i;do{var a=n*n,s=a*a;n-=i=(n*(1.007226+a*(.015085+s*(-.044475+.028874*a-.005916*s)))-t)/(1.007226+a*(.015085*3+s*(-.044475*7+.028874*9*a-.005916*11*s)))}while(It(i)>Dt&&--r>0);return[e/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]};function lR(){return Lo(nv).scale(175.295)}function cR(e,t){return e.parent===t.parent?1:2}function uR(e){return e.reduce(hR,0)/e.length}function hR(e,t){return e+t.x}function dR(e){return 1+e.reduce(pR,0)}function pR(e,t){return Math.max(e,t.y)}function fR(e){for(var t;t=e.children;)e=t[0];return e}function mR(e){for(var t;t=e.children;)e=t[t.length-1];return e}function gR(){var e=cR,t=1,n=1,r=!1;function i(a){var s,o=0;a.eachAfter(function(h){var p=h.children;p?(h.x=uR(p),h.y=dR(p)):(h.x=s?o+=e(h,s):0,h.y=0,s=h)});var l=fR(a),c=mR(a),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return a.eachAfter(r?function(h){h.x=(h.x-a.x)*t,h.y=(a.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(a.y?h.y/a.y:1))*n})}return i.separation=function(a){return arguments.length?(e=a,i):e},i.size=function(a){return arguments.length?(r=!1,t=+a[0],n=+a[1],i):r?null:[t,n]},i.nodeSize=function(a){return arguments.length?(r=!0,t=+a[0],n=+a[1],i):r?[t,n]:null},i}function vR(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 yR(){return this.eachAfter(vR)}function bR(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function _R(e,t){for(var n=this,r=[n],i,a,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function xR(e,t){for(var n=this,r=[n],i=[],a,s,o,l=-1;n=r.pop();)if(i.push(n),a=n.children)for(s=0,o=a.length;s<o;++s)r.push(a[s]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function ER(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function OR(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 TR(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function SR(e){for(var t=this,n=wR(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 wR(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 $R(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function MR(){return Array.from(this)}function CR(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function AR(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*kR(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function qa(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=DR)):t===void 0&&(t=LR);for(var n=new Ya(e),r,i=[n],a,s,o,l;r=i.pop();)if((s=t(r.data))&&(l=(s=Array.from(s)).length))for(r.children=s,o=l-1;o>=0;--o)i.push(a=s[o]=new Ya(s[o])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(NR)}function RR(){return qa(this).eachBefore(IR)}function LR(e){return e.children}function DR(e){return Array.isArray(e)?e[1]:null}function IR(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function NR(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ya(e){this.data=e,this.depth=this.height=0,this.parent=null}Ya.prototype=qa.prototype={constructor:Ya,count:yR,each:bR,eachAfter:xR,eachBefore:_R,find:ER,sum:OR,sort:TR,path:SR,ancestors:$R,descendants:MR,leaves:CR,links:AR,copy:RR,[Symbol.iterator]:kR};function PR(e){return e==null?null:rv(e)}function rv(e){if(typeof e!="function")throw new Error;return e}function Gr(){return 0}function Ai(e){return function(){return e}}const UR=1664525,BR=1013904223,iv=4294967296;function HR(){let e=1;return()=>(e=(UR*e+BR)%iv)/iv}function VR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function FR(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 GR(e,t){for(var n=0,r=(e=FR(Array.from(e),t)).length,i=[],a,s;n<r;)a=e[n],s&&av(s,a)?++n:(s=jR(i=zR(i,a)),n=0);return s}function zR(e,t){var n,r;if(Yu(t,e))return[t];for(n=0;n<e.length;++n)if(No(t,e[n])&&Yu(Za(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(No(Za(e[n],e[r]),t)&&No(Za(e[n],t),e[r])&&No(Za(e[r],t),e[n])&&Yu(sv(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function No(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 av(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 Yu(e,t){for(var n=0;n<t.length;++n)if(!av(e,t[n]))return!1;return!0}function jR(e){switch(e.length){case 1:return WR(e[0]);case 2:return Za(e[0],e[1]);case 3:return sv(e[0],e[1],e[2])}}function WR(e){return{x:e.x,y:e.y,r:e.r}}function Za(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,s=t.y,o=t.r,l=a-n,c=s-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+a+l/d*u)/2,y:(r+s+c/d*u)/2,r:(d+i+o)/2}}function sv(e,t,n){var r=e.x,i=e.y,a=e.r,s=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-s,p=r-c,f=i-o,g=i-u,m=l-a,y=d-a,v=r*r+i*i-a*a,x=v-s*s-o*o+l*l,T=v-c*c-u*u+d*d,E=p*f-h*g,S=(f*T-g*x)/(E*2)-r,L=(g*m-f*y)/E,N=(p*x-h*T)/(E*2)-i,D=(h*y-p*m)/E,I=L*L+D*D-1,M=2*(a+S*L+N*D),q=S*S+N*N-a*a,H=-(Math.abs(I)>1e-6?(M+Math.sqrt(M*M-4*I*q))/(2*I):q/M);return{x:r+S+L*H,y:i+N+D*H,r:H}}function ov(e,t,n){var r=e.x-t.x,i,a,s=e.y-t.y,o,l,c=r*r+s*s;c?(a=t.r+n.r,a*=a,l=e.r+n.r,l*=l,a>l?(i=(c+l-a)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*s,n.y=e.y-i*s+o*r):(i=(c+a-l)/(2*c),o=Math.sqrt(Math.max(0,a/c-i*i)),n.x=t.x+i*r-o*s,n.y=t.y+i*s+o*r)):(n.x=t.x+n.r,n.y=t.y)}function lv(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 cv(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function Po(e){this._=e,this.next=null,this.previous=null}function qR(e,t){if(!(a=(e=VR(e)).length))return 0;var n,r,i,a,s,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(a>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(a>2))return n.r+r.r;ov(r,n,i=e[2]),n=new Po(n),r=new Po(r),i=new Po(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<a;++l){ov(n._,r._,i=e[l]),i=new Po(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(lv(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(lv(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,s=cv(n);(i=i.next)!==r;)(o=cv(i))<s&&(n=i,s=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=GR(n,t),l=0;l<a;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function YR(e){return Math.sqrt(e.value)}function ZR(){var e=null,t=1,n=1,r=Gr;function i(a){const s=HR();return a.x=t/2,a.y=n/2,e?a.eachBefore(uv(e)).eachAfter(Zu(r,.5,s)).eachBefore(hv(1)):a.eachBefore(uv(YR)).eachAfter(Zu(Gr,1,s)).eachAfter(Zu(r,a.r/Math.min(t,n),s)).eachBefore(hv(Math.min(t,n)/(2*a.r))),a}return i.radius=function(a){return arguments.length?(e=PR(a),i):e},i.size=function(a){return arguments.length?(t=+a[0],n=+a[1],i):[t,n]},i.padding=function(a){return arguments.length?(r=typeof a=="function"?a:Ai(+a),i):r},i}function uv(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Zu(e,t,n){return function(r){if(i=r.children){var i,a,s=i.length,o=e(r)*t||0,l;if(o)for(a=0;a<s;++a)i[a].r+=o;if(l=qR(i,n),o)for(a=0;a<s;++a)i[a].r-=o;r.r=l+o}}}function hv(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 XR(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 KR(e,t,n,r,i){for(var a=e.children,s,o=-1,l=a.length,c=e.value&&(r-t)/e.value;++o<l;)s=a[o],s.y0=n,s.y1=i,s.x0=t,s.x1=t+=s.value*c}function QR(e,t){return e.parent===t.parent?1:2}function Xu(e){var t=e.children;return t?t[0]:e.t}function Ku(e){var t=e.children;return t?t[t.length-1]:e.t}function JR(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 tL(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function eL(e,t,n){return e.a.parent===t.parent?e.a:n}function Uo(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}Uo.prototype=Object.create(Ya.prototype);function nL(e){for(var t=new Uo(e,0),n,r=[t],i,a,s,o;n=r.pop();)if(a=n._.children)for(n.children=new Array(o=a.length),s=o-1;s>=0;--s)r.push(i=n.children[s]=new Uo(a[s],s)),i.parent=n;return(t.parent=new Uo(null,0)).children=[t],t}function rL(){var e=QR,t=1,n=1,r=null;function i(c){var u=nL(c);if(u.eachAfter(a),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var d=c,h=c,p=c;c.eachBefore(function(v){v.x<d.x&&(d=v),v.x>h.x&&(h=v),v.depth>p.depth&&(p=v)});var f=d===h?1:e(d,h)/2,g=f-d.x,m=t/(h.x+f+g),y=n/(p.depth||1);c.eachBefore(function(v){v.x=(v.x+g)*m,v.y=v.depth*y})}return c}function a(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){tL(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 s(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,y=p.m,v=f.m,x=g.m,T;f=Ku(f),h=Xu(h),f&&h;)g=Xu(g),p=Ku(p),p.a=c,T=f.z+v-h.z-m+e(f._,h._),T>0&&(JR(eL(f,c,d),c,T),m+=T,y+=T),v+=f.m,m+=h.m,x+=g.m,y+=p.m;f&&!Ku(p)&&(p.t=f,p.m+=v-y),h&&!Xu(g)&&(g.t=h,g.m+=m-x,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 iL(e,t,n,r,i){for(var a=e.children,s,o=-1,l=a.length,c=e.value&&(i-n)/e.value;++o<l;)s=a[o],s.x0=t,s.x1=r,s.y0=n,s.y1=n+=s.value*c}var aL=(1+Math.sqrt(5))/2;function sL(e,t,n,r,i,a){for(var s=[],o=t.children,l,c,u=0,d=0,h=o.length,p,f,g=t.value,m,y,v,x,T,E,S;u<h;){p=i-n,f=a-r;do m=o[d++].value;while(!m&&d<h);for(y=v=m,E=Math.max(f/p,p/f)/(g*e),S=m*m*E,T=Math.max(v/S,S/y);d<h;++d){if(m+=c=o[d].value,c<y&&(y=c),c>v&&(v=c),S=m*m*E,x=Math.max(v/S,S/y),x>T){m-=c;break}T=x}s.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?KR(l,n,r,i,g?r+=f*m/g:a):iL(l,n,r,g?n+=p*m/g:i,a),g-=m,u=d}return s}const oL=function e(t){function n(r,i,a,s,o){sL(t,r,i,a,s,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(aL);function lL(){var e=oL,t=!1,n=1,r=1,i=[0],a=Gr,s=Gr,o=Gr,l=Gr,c=Gr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(XR),h}function d(h){var p=i[h.depth],f=h.x0+p,g=h.y0+p,m=h.x1-p,y=h.y1-p;m<f&&(f=m=(f+m)/2),y<g&&(g=y=(g+y)/2),h.x0=f,h.y0=g,h.x1=m,h.y1=y,h.children&&(p=i[h.depth+1]=a(h)/2,f+=c(h)-p,g+=s(h)-p,m-=o(h)-p,y-=l(h)-p,m<f&&(f=m=(f+m)/2),y<g&&(g=y=(g+y)/2),e(h,f,g,m,y))}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=rv(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(a=typeof h=="function"?h:Ai(+h),u):a},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?(s=typeof h=="function"?h:Ai(+h),u):s},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Ai(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Ai(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Ai(+h),u):c},u}function Bo(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 Su(t)}function cL(e){return e.innerRadius}function uL(e){return e.outerRadius}function hL(e){return e.startAngle}function dL(e){return e.endAngle}function pL(e){return e&&e.padAngle}function fL(e,t,n,r,i,a,s,o){var l=n-e,c=r-t,u=s-i,d=o-a,h=d*l-u*c;if(!(h*h<_e))return h=(u*(t-a)-d*(e-i))/h,[e+h*l,t+h*c]}function Ho(e,t,n,r,i,a,s){var o=e-n,l=t-r,c=(s?a:-a)/xi(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,y=(p+g)/2,v=f-h,x=g-p,T=v*v+x*x,E=i-a,S=h*g-f*p,L=(x<0?-1:1)*xi(KC(0,E*E*T-S*S)),N=(S*x-v*L)/T,D=(-S*v-x*L)/T,I=(S*x+v*L)/T,M=(-S*v+x*L)/T,q=N-m,H=D-y,G=I-m,O=M-y;return q*q+H*H>G*G+O*O&&(N=I,D=M),{cx:N,cy:D,x01:-u,y01:-d,x11:N*(i/E-1),y11:D*(i/E-1)}}function Xa(){var e=cL,t=uL,n=bt(0),r=null,i=hL,a=dL,s=pL,o=null,l=Bo(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-oo,g=a.apply(this,arguments)-oo,m=gm(g-f),y=g>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>_e))o.moveTo(0,0);else if(m>lo-_e)o.moveTo(p*Ur(f),p*wn(f)),o.arc(0,0,p,f,g,!y),h>_e&&(o.moveTo(h*Ur(g),h*wn(g)),o.arc(0,0,h,g,f,y));else{var v=f,x=g,T=f,E=g,S=m,L=m,N=s.apply(this,arguments)/2,D=N>_e&&(r?+r.apply(this,arguments):xi(h*h+p*p)),I=lu(gm(p-h)/2,+n.apply(this,arguments)),M=I,q=I,H,G;if(D>_e){var O=vm(D/h*wn(N)),k=vm(D/p*wn(N));(S-=O*2)>_e?(O*=y?1:-1,T+=O,E-=O):(S=0,T=E=(f+g)/2),(L-=k*2)>_e?(k*=y?1:-1,v+=k,x-=k):(L=0,v=x=(f+g)/2)}var $=p*Ur(v),B=p*wn(v),F=h*Ur(E),et=h*wn(E);if(I>_e){var C=p*Ur(x),z=p*wn(x),Q=h*Ur(T),at=h*wn(T),tt;if(m<Da)if(tt=fL($,B,Q,at,C,z,F,et)){var K=$-tt[0],nt=B-tt[1],ht=C-tt[0],W=z-tt[1],it=1/wn(QC((K*ht+nt*W)/(xi(K*K+nt*nt)*xi(ht*ht+W*W)))/2),gt=xi(tt[0]*tt[0]+tt[1]*tt[1]);M=lu(I,(h-gt)/(it-1)),q=lu(I,(p-gt)/(it+1))}else M=q=0}L>_e?q>_e?(H=Ho(Q,at,$,B,p,q,y),G=Ho(C,z,F,et,p,q,y),o.moveTo(H.cx+H.x01,H.cy+H.y01),q<I?o.arc(H.cx,H.cy,q,be(H.y01,H.x01),be(G.y01,G.x01),!y):(o.arc(H.cx,H.cy,q,be(H.y01,H.x01),be(H.y11,H.x11),!y),o.arc(0,0,p,be(H.cy+H.y11,H.cx+H.x11),be(G.cy+G.y11,G.cx+G.x11),!y),o.arc(G.cx,G.cy,q,be(G.y11,G.x11),be(G.y01,G.x01),!y))):(o.moveTo($,B),o.arc(0,0,p,v,x,!y)):o.moveTo($,B),!(h>_e)||!(S>_e)?o.lineTo(F,et):M>_e?(H=Ho(F,et,C,z,h,-M,y),G=Ho($,B,Q,at,h,-M,y),o.lineTo(H.cx+H.x01,H.cy+H.y01),M<I?o.arc(H.cx,H.cy,M,be(H.y01,H.x01),be(G.y01,G.x01),!y):(o.arc(H.cx,H.cy,M,be(H.y01,H.x01),be(H.y11,H.x11),!y),o.arc(0,0,h,be(H.cy+H.y11,H.cx+H.x11),be(G.cy+G.y11,G.cx+G.x11),y),o.arc(G.cx,G.cy,M,be(G.y11,G.x11),be(G.y01,G.x01),!y))):o.arc(0,0,h,E,T,y)}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)+ +a.apply(this,arguments))/2-Da/2;return[Ur(d)*u,wn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:bt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:bt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:bt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:bt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:bt(+u),c):i},c.endAngle=function(u){return arguments.length?(a=typeof u=="function"?u:bt(+u),c):a},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:bt(+u),c):s},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function Qu(e){return e[0]}function Ju(e){return e[1]}function Ka(e,t){var n=bt(!0),r=null,i=co,a=null,s=Bo(o);e=typeof e=="function"?e:e===void 0?Qu:bt(e),t=typeof t=="function"?t:t===void 0?Ju:bt(t);function o(l){var c,u=(l=eo(l)).length,d,h=!1,p;for(r==null&&(a=i(p=s())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(d,c,l),+t(d,c,l));if(p)return a=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:bt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:bt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:bt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(a=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=a=null:a=i(r=l),o):r},o}function th(e,t,n){var r=null,i=bt(!0),a=null,s=co,o=null,l=Bo(c);e=typeof e=="function"?e:e===void 0?Qu:bt(+e),t=typeof t=="function"?t:bt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Ju:bt(+n);function c(d){var h,p,f,g=(d=eo(d)).length,m,y=!1,v,x=new Array(g),T=new Array(g);for(a==null&&(o=s(v=l())),h=0;h<=g;++h){if(!(h<g&&i(m=d[h],h,d))===y)if(y=!y)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=h-1;f>=p;--f)o.point(x[f],T[f]);o.lineEnd(),o.areaEnd()}y&&(x[h]=+e(m,h,d),T[h]=+t(m,h,d),o.point(r?+r(m,h,d):x[h],n?+n(m,h,d):T[h]))}if(v)return o=null,v+""||null}function u(){return Ka().defined(i).curve(s).context(a)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:bt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:bt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:bt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:bt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:bt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:bt(+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:bt(!!d),c):i},c.curve=function(d){return arguments.length?(s=d,a!=null&&(o=s(a)),c):s},c.context=function(d){return arguments.length?(d==null?a=o=null:o=s(a=d),c):a},c}function mL(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function gL(e){return e}function vL(){var e=gL,t=mL,n=null,r=bt(0),i=bt(lo),a=bt(0);function s(o){var l,c=(o=eo(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),g=+r.apply(this,arguments),m=Math.min(lo,Math.max(-lo,i.apply(this,arguments)-g)),y,v=Math.min(Math.abs(m)/c,a.apply(this,arguments)),x=v*(m<0?-1:1),T;for(l=0;l<c;++l)(T=f[p[l]=l]=+e(o[l],l,o))>0&&(h+=T);for(t!=null?p.sort(function(E,S){return t(f[E],f[S])}):n!=null&&p.sort(function(E,S){return n(o[E],o[S])}),l=0,d=h?(m-c*x)/h:0;l<c;++l,g=y)u=p[l],T=f[u],y=g+(T>0?T*d:0)+x,f[u]={data:o[u],index:l,value:T,startAngle:g,endAngle:y,padAngle:v};return f}return s.value=function(o){return arguments.length?(e=typeof o=="function"?o:bt(+o),s):e},s.sortValues=function(o){return arguments.length?(t=o,n=null,s):t},s.sort=function(o){return arguments.length?(n=o,t=null,s):n},s.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:bt(+o),s):r},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:bt(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:bt(+o),s):a},s}var yL=pv(co);function dv(e){this._curve=e}dv.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 pv(e){function t(n){return new dv(e(n))}return t._curve=e,t}function bL(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(pv(n)):t()._curve},e}function _L(){return bL(Ka().curve(yL))}class xL{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 EL(e){return new xL(e,!0)}function OL(e){return e.source}function TL(e){return e.target}function SL(e){let t=OL,n=TL,r=Qu,i=Ju,a=null,s=null,o=Bo(l);function l(){let c;const u=j$.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(a==null&&(s=e(c=o())),s.lineStart(),u[0]=d,s.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,s.point(+r.apply(this,u),+i.apply(this,u)),s.lineEnd(),c)return s=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:bt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:bt(+c),l):i},l.context=function(c){return arguments.length?(c==null?a=s=null:s=e(a=c),l):a},l}function wL(){return SL(EL)}let Ot=class{constructor(t,n,r){if(this.type="",this.renderType=ut.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=_(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(P(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=_(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${Ce}--${i}--${this.type}`,!0),r&&r.classed(`${Ce}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=_(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=U.appendOrSelect(this.parent,`${this.renderType===ut.SVG?"svg":"div"}${r}.${Ce}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const a=this.model.get("chartClipId");if(a){const s=P(`#${a}`).select("rect");s.size()!==0&&parseFloat(s.attr("height"))>0&&i.attr("clip-path",`url(#${a})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?pt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.2.1 | (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.1/LICENSE */const{entries:fv,setPrototypeOf:mv,isFrozen:$L,getPrototypeOf:ML,getOwnPropertyDescriptor:CL}=Object;let{freeze:Se,seal:en,create:gv}=Object,{apply:eh,construct:nh}=typeof Reflect<"u"&&Reflect;Se||(Se=function(e){return e}),en||(en=function(e){return e}),eh||(eh=function(e,t,n){return e.apply(t,n)}),nh||(nh=function(e,t){return new e(...t)});const Vo=Ve(Array.prototype.forEach),vv=Ve(Array.prototype.pop),Qa=Ve(Array.prototype.push),Fo=Ve(String.prototype.toLowerCase),rh=Ve(String.prototype.toString),yv=Ve(String.prototype.match),Ja=Ve(String.prototype.replace),AL=Ve(String.prototype.indexOf),kL=Ve(String.prototype.trim),fn=Ve(Object.prototype.hasOwnProperty),we=Ve(RegExp.prototype.test),ts=RL(TypeError);function Ve(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 eh(e,t,r)}}function RL(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return nh(e,n)}}function Tt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fo;mv&&mv(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&($L(t)||(t[r]=a),i=a)}e[i]=!0}return e}function LL(e){for(let t=0;t<e.length;t++)fn(e,t)||(e[t]=null);return e}function zr(e){const t=gv(null);for(const[n,r]of fv(e))fn(e,n)&&(Array.isArray(r)?t[n]=LL(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=zr(r):t[n]=r);return t}function es(e,t){for(;e!==null;){const r=CL(e,t);if(r){if(r.get)return Ve(r.get);if(typeof r.value=="function")return Ve(r.value)}e=ML(e)}function n(){return null}return n}const bv=Se(["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"]),ih=Se(["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"]),ah=Se(["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"]),DL=Se(["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"]),sh=Se(["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"]),IL=Se(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_v=Se(["#text"]),xv=Se(["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"]),oh=Se(["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"]),Ev=Se(["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"]),Go=Se(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),NL=en(/\{\{[\w\W]*|[\w\W]*\}\}/gm),PL=en(/<%[\w\W]*|[\w\W]*%>/gm),UL=en(/\${[\w\W]*}/gm),BL=en(/^data-[\-\w.\u00B7-\uFFFF]/),HL=en(/^aria-[\-\w]+$/),Ov=en(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),VL=en(/^(?:\w+script|data):/i),FL=en(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Tv=en(/^html$/i),GL=en(/^[a-z][.\w]*(-[.\w]+)+$/i);var Sv=Object.freeze({__proto__:null,ARIA_ATTR:HL,ATTR_WHITESPACE:FL,CUSTOM_ELEMENT:GL,DATA_ATTR:BL,DOCTYPE_NAME:Tv,ERB_EXPR:PL,IS_ALLOWED_URI:Ov,IS_SCRIPT_OR_DATA:VL,MUSTACHE_EXPR:NL,TMPLIT_EXPR:UL});const ns={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zL=function(){return typeof window>"u"?null:window},jL=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(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function wv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zL();const t=R=>wv(R);if(t.version="3.2.1",t.removed=[],!e||!e.document||e.document.nodeType!==ns.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,f=l.prototype,g=es(f,"cloneNode"),m=es(f,"remove"),y=es(f,"nextSibling"),v=es(f,"childNodes"),x=es(f,"parentNode");if(typeof s=="function"){const R=n.createElement("template");R.content&&R.content.ownerDocument&&(n=R.content.ownerDocument)}let T,E="";const{implementation:S,createNodeIterator:L,createDocumentFragment:N,getElementsByTagName:D}=n,{importNode:I}=r;let M={};t.isSupported=typeof fv=="function"&&typeof x=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:H,TMPLIT_EXPR:G,DATA_ATTR:O,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:B,CUSTOM_ELEMENT:F}=Sv;let{IS_ALLOWED_URI:et}=Sv,C=null;const z=Tt({},[...bv,...ih,...ah,...sh,..._v]);let Q=null;const at=Tt({},[...xv,...oh,...Ev,...Go]);let tt=Object.seal(gv(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}})),K=null,nt=null,ht=!0,W=!0,it=!1,gt=!0,X=!1,Ct=!0,_t=!1,ne=!1,Jt=!1,ct=!1,Nt=!1,ze=!1,oe=!0,pr=!1;const il="user-content-";let Ii=!0,fr=!1,kn={},Qn=null;const os=Tt({},["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 al=null;const sl=Tt({},["audio","video","img","source","image","track"]);let ls=null;const Ni=Tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pi="http://www.w3.org/1998/Math/MathML",Ui="http://www.w3.org/2000/svg",gn="http://www.w3.org/1999/xhtml";let je=gn,Bi=!1,cs=null;const Rh=Tt({},[Pi,Ui,gn],rh);let qr=Tt({},["mi","mo","mn","ms","mtext"]),Hi=Tt({},["annotation-xml"]);const ol=Tt({},["title","style","font","a","script"]);let Jn=null;const Vi=["application/xhtml+xml","text/html"],Fi="text/html";let le=null,mr=null;const Lh=n.createElement("form"),ll=function(R){return R instanceof RegExp||R instanceof Function},us=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(mr&&mr===R)){if((!R||typeof R!="object")&&(R={}),R=zr(R),Jn=Vi.indexOf(R.PARSER_MEDIA_TYPE)===-1?Fi:R.PARSER_MEDIA_TYPE,le=Jn==="application/xhtml+xml"?rh:Fo,C=fn(R,"ALLOWED_TAGS")?Tt({},R.ALLOWED_TAGS,le):z,Q=fn(R,"ALLOWED_ATTR")?Tt({},R.ALLOWED_ATTR,le):at,cs=fn(R,"ALLOWED_NAMESPACES")?Tt({},R.ALLOWED_NAMESPACES,rh):Rh,ls=fn(R,"ADD_URI_SAFE_ATTR")?Tt(zr(Ni),R.ADD_URI_SAFE_ATTR,le):Ni,al=fn(R,"ADD_DATA_URI_TAGS")?Tt(zr(sl),R.ADD_DATA_URI_TAGS,le):sl,Qn=fn(R,"FORBID_CONTENTS")?Tt({},R.FORBID_CONTENTS,le):os,K=fn(R,"FORBID_TAGS")?Tt({},R.FORBID_TAGS,le):{},nt=fn(R,"FORBID_ATTR")?Tt({},R.FORBID_ATTR,le):{},kn=fn(R,"USE_PROFILES")?R.USE_PROFILES:!1,ht=R.ALLOW_ARIA_ATTR!==!1,W=R.ALLOW_DATA_ATTR!==!1,it=R.ALLOW_UNKNOWN_PROTOCOLS||!1,gt=R.ALLOW_SELF_CLOSE_IN_ATTR!==!1,X=R.SAFE_FOR_TEMPLATES||!1,Ct=R.SAFE_FOR_XML!==!1,_t=R.WHOLE_DOCUMENT||!1,ct=R.RETURN_DOM||!1,Nt=R.RETURN_DOM_FRAGMENT||!1,ze=R.RETURN_TRUSTED_TYPE||!1,Jt=R.FORCE_BODY||!1,oe=R.SANITIZE_DOM!==!1,pr=R.SANITIZE_NAMED_PROPS||!1,Ii=R.KEEP_CONTENT!==!1,fr=R.IN_PLACE||!1,et=R.ALLOWED_URI_REGEXP||Ov,je=R.NAMESPACE||gn,qr=R.MATHML_TEXT_INTEGRATION_POINTS||qr,Hi=R.HTML_INTEGRATION_POINTS||Hi,tt=R.CUSTOM_ELEMENT_HANDLING||{},R.CUSTOM_ELEMENT_HANDLING&&ll(R.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(tt.tagNameCheck=R.CUSTOM_ELEMENT_HANDLING.tagNameCheck),R.CUSTOM_ELEMENT_HANDLING&&ll(R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(tt.attributeNameCheck=R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),R.CUSTOM_ELEMENT_HANDLING&&typeof R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(tt.allowCustomizedBuiltInElements=R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),Nt&&(ct=!0),kn&&(C=Tt({},_v),Q=[],kn.html===!0&&(Tt(C,bv),Tt(Q,xv)),kn.svg===!0&&(Tt(C,ih),Tt(Q,oh),Tt(Q,Go)),kn.svgFilters===!0&&(Tt(C,ah),Tt(Q,oh),Tt(Q,Go)),kn.mathMl===!0&&(Tt(C,sh),Tt(Q,Ev),Tt(Q,Go))),R.ADD_TAGS&&(C===z&&(C=zr(C)),Tt(C,R.ADD_TAGS,le)),R.ADD_ATTR&&(Q===at&&(Q=zr(Q)),Tt(Q,R.ADD_ATTR,le)),R.ADD_URI_SAFE_ATTR&&Tt(ls,R.ADD_URI_SAFE_ATTR,le),R.FORBID_CONTENTS&&(Qn===os&&(Qn=zr(Qn)),Tt(Qn,R.FORBID_CONTENTS,le)),Ii&&(C["#text"]=!0),_t&&Tt(C,["html","head","body"]),C.table&&(Tt(C,["tbody"]),delete K.tbody),R.TRUSTED_TYPES_POLICY){if(typeof R.TRUSTED_TYPES_POLICY.createHTML!="function")throw ts('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof R.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ts('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=R.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=jL(p,i)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));Se&&Se(R),mr=R}},gr=Tt({},[...ih,...ah,...DL]),Gi=Tt({},[...sh,...IL]),cl=function(R){let st=x(R);(!st||!st.tagName)&&(st={namespaceURI:je,tagName:"template"});const rt=Fo(R.tagName),At=Fo(st.tagName);return cs[R.namespaceURI]?R.namespaceURI===Ui?st.namespaceURI===gn?rt==="svg":st.namespaceURI===Pi?rt==="svg"&&(At==="annotation-xml"||qr[At]):!!gr[rt]:R.namespaceURI===Pi?st.namespaceURI===gn?rt==="math":st.namespaceURI===Ui?rt==="math"&&Hi[At]:!!Gi[rt]:R.namespaceURI===gn?st.namespaceURI===Ui&&!Hi[At]||st.namespaceURI===Pi&&!qr[At]?!1:!Gi[rt]&&(ol[rt]||!gr[rt]):!!(Jn==="application/xhtml+xml"&&cs[R.namespaceURI]):!1},tr=function(R){Qa(t.removed,{element:R});try{x(R).removeChild(R)}catch{m(R)}},zi=function(R,st){try{Qa(t.removed,{attribute:st.getAttributeNode(R),from:st})}catch{Qa(t.removed,{attribute:null,from:st})}if(st.removeAttribute(R),R==="is"&&!Q[R])if(ct||Nt)try{tr(st)}catch{}else try{st.setAttribute(R,"")}catch{}},ul=function(R){let st=null,rt=null;if(Jt)R="<remove></remove>"+R;else{const te=yv(R,/^[\r\n\t ]+/);rt=te&&te[0]}Jn==="application/xhtml+xml"&&je===gn&&(R='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+R+"</body></html>");const At=T?T.createHTML(R):R;if(je===gn)try{st=new h().parseFromString(At,Jn)}catch{}if(!st||!st.documentElement){st=S.createDocument(je,"template",null);try{st.documentElement.innerHTML=Bi?E:At}catch{}}const he=st.body||st.documentElement;return R&&rt&&he.insertBefore(n.createTextNode(rt),he.childNodes[0]||null),je===gn?D.call(st,_t?"html":"body")[0]:_t?st.documentElement:he},hl=function(R){return L.call(R.ownerDocument||R,R,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},hs=function(R){return R instanceof d&&(typeof R.nodeName!="string"||typeof R.textContent!="string"||typeof R.removeChild!="function"||!(R.attributes instanceof u)||typeof R.removeAttribute!="function"||typeof R.setAttribute!="function"||typeof R.namespaceURI!="string"||typeof R.insertBefore!="function"||typeof R.hasChildNodes!="function")},ds=function(R){return typeof o=="function"&&R instanceof o};function vn(R,st,rt){M[R]&&Vo(M[R],At=>{At.call(t,st,rt,mr)})}const pe=function(R){let st=null;if(vn("beforeSanitizeElements",R,null),hs(R))return tr(R),!0;const rt=le(R.nodeName);if(vn("uponSanitizeElement",R,{tagName:rt,allowedTags:C}),R.hasChildNodes()&&!ds(R.firstElementChild)&&we(/<[/\w]/g,R.innerHTML)&&we(/<[/\w]/g,R.textContent)||R.nodeType===ns.progressingInstruction||Ct&&R.nodeType===ns.comment&&we(/<[/\w]/g,R.data))return tr(R),!0;if(!C[rt]||K[rt]){if(!K[rt]&&pl(rt)&&(tt.tagNameCheck instanceof RegExp&&we(tt.tagNameCheck,rt)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(rt)))return!1;if(Ii&&!Qn[rt]){const At=x(R)||R.parentNode,he=v(R)||R.childNodes;if(he&&At){const te=he.length;for(let yn=te-1;yn>=0;--yn){const De=g(he[yn],!0);De.__removalCount=(R.__removalCount||0)+1,At.insertBefore(De,y(R))}}}return tr(R),!0}return R instanceof l&&!cl(R)||(rt==="noscript"||rt==="noembed"||rt==="noframes")&&we(/<\/no(script|embed|frames)/i,R.innerHTML)?(tr(R),!0):(X&&R.nodeType===ns.text&&(st=R.textContent,Vo([q,H,G],At=>{st=Ja(st,At," ")}),R.textContent!==st&&(Qa(t.removed,{element:R.cloneNode()}),R.textContent=st)),vn("afterSanitizeElements",R,null),!1)},dl=function(R,st,rt){if(oe&&(st==="id"||st==="name")&&(rt in n||rt in Lh))return!1;if(!(W&&!nt[st]&&we(O,st))&&!(ht&&we(k,st))){if(!Q[st]||nt[st]){if(!(pl(R)&&(tt.tagNameCheck instanceof RegExp&&we(tt.tagNameCheck,R)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(R))&&(tt.attributeNameCheck instanceof RegExp&&we(tt.attributeNameCheck,st)||tt.attributeNameCheck instanceof Function&&tt.attributeNameCheck(st))||st==="is"&&tt.allowCustomizedBuiltInElements&&(tt.tagNameCheck instanceof RegExp&&we(tt.tagNameCheck,rt)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(rt))))return!1}else if(!ls[st]&&!we(et,Ja(rt,B,""))&&!((st==="src"||st==="xlink:href"||st==="href")&&R!=="script"&&AL(rt,"data:")===0&&al[R])&&!(it&&!we($,Ja(rt,B,"")))&&rt)return!1}return!0},pl=function(R){return R!=="annotation-xml"&&yv(R,F)},fl=function(R){vn("beforeSanitizeAttributes",R,null);const{attributes:st}=R;if(!st)return;const rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let At=st.length;for(;At--;){const he=st[At],{name:te,namespaceURI:yn,value:De}=he,nn=le(te);let ge=te==="value"?De:kL(De);if(rt.attrName=nn,rt.attrValue=ge,rt.keepAttr=!0,rt.forceKeepAttr=void 0,vn("uponSanitizeAttribute",R,rt),ge=rt.attrValue,pr&&(nn==="id"||nn==="name")&&(zi(te,R),ge=il+ge),Ct&&we(/((--!?|])>)|<\/(style|title)/i,ge)){zi(te,R);continue}if(rt.forceKeepAttr||(zi(te,R),!rt.keepAttr))continue;if(!gt&&we(/\/>/i,ge)){zi(te,R);continue}X&&Vo([q,H,G],Yr=>{ge=Ja(ge,Yr," ")});const ml=le(R.nodeName);if(dl(ml,nn,ge)){if(T&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!yn)switch(p.getAttributeType(ml,nn)){case"TrustedHTML":{ge=T.createHTML(ge);break}case"TrustedScriptURL":{ge=T.createScriptURL(ge);break}}try{yn?R.setAttributeNS(yn,te,ge):R.setAttribute(te,ge),hs(R)?tr(R):vv(t.removed)}catch{}}}vn("afterSanitizeAttributes",R,null)},Dh=function R(st){let rt=null;const At=hl(st);for(vn("beforeSanitizeShadowDOM",st,null);rt=At.nextNode();)vn("uponSanitizeShadowNode",rt,null),!pe(rt)&&(rt.content instanceof a&&R(rt.content),fl(rt));vn("afterSanitizeShadowDOM",st,null)};return t.sanitize=function(R){let st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,At=null,he=null,te=null;if(Bi=!R,Bi&&(R="<!-->"),typeof R!="string"&&!ds(R))if(typeof R.toString=="function"){if(R=R.toString(),typeof R!="string")throw ts("dirty is not a string, aborting")}else throw ts("toString is not a function");if(!t.isSupported)return R;if(ne||us(st),t.removed=[],typeof R=="string"&&(fr=!1),fr){if(R.nodeName){const nn=le(R.nodeName);if(!C[nn]||K[nn])throw ts("root node is forbidden and cannot be sanitized in-place")}}else if(R instanceof o)rt=ul("<!---->"),At=rt.ownerDocument.importNode(R,!0),At.nodeType===ns.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?rt=At:rt.appendChild(At);else{if(!ct&&!X&&!_t&&R.indexOf("<")===-1)return T&&ze?T.createHTML(R):R;if(rt=ul(R),!rt)return ct?null:ze?E:""}rt&&Jt&&tr(rt.firstChild);const yn=hl(fr?R:rt);for(;he=yn.nextNode();)pe(he)||(he.content instanceof a&&Dh(he.content),fl(he));if(fr)return R;if(ct){if(Nt)for(te=N.call(rt.ownerDocument);rt.firstChild;)te.appendChild(rt.firstChild);else te=rt;return(Q.shadowroot||Q.shadowrootmode)&&(te=I.call(r,te,!0)),te}let De=_t?rt.outerHTML:rt.innerHTML;return _t&&C["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&we(Tv,rt.ownerDocument.doctype.name)&&(De="<!DOCTYPE "+rt.ownerDocument.doctype.name+`>
|
|
4
|
+
`+De),X&&Vo([q,H,G],nn=>{De=Ja(De,nn," ")}),T&&ze?T.createHTML(De):De},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};us(R),ne=!0},t.clearConfig=function(){mr=null,ne=!1},t.isValidAttribute=function(R,st,rt){mr||us({});const At=le(R),he=le(st);return dl(At,he,rt)},t.addHook=function(R,st){typeof st=="function"&&(M[R]=M[R]||[],Qa(M[R],st))},t.removeHook=function(R){if(M[R])return vv(M[R])},t.removeHooks=function(R){M[R]&&(M[R]=[])},t.removeAllHooks=function(){M={}},t}var lh=wv();const zo=e=>lh.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),WL=e=>lh.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),Cn=e=>lh.sanitize(e,{ALLOWED_TAGS:[]}),$v=class x1 extends Ot{constructor(){super(...arguments),this.type="toolbar",this.renderType=ut.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(w.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(w.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(_(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 a=n.selectAll("div.toolbar-control").data(r,l=>l.id);a.exit().remove();const s=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;s.merge(a).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-${
|
|
7
|
+
aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${Cn(l.id)}`)}" aria-label="${Cn(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
|
-
${
|
|
9
|
+
${WL(l.iconSVG.content)}
|
|
10
10
|
</svg>
|
|
11
|
-
</button>`).each(function(l,c){
|
|
11
|
+
</button>`).each(function(l,c){P(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"),P(this).select("button").on("mouseover focus",function(u){const d=P(this);d.classed("hovered",!0),o.services.events.dispatchEvent(w.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(w.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=>_(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),P(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(w.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(w.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=P(`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=P(`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=P(`#${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=P(`#${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 a=P(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(r,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",s=>{s&&s.key==="Enter"?n.triggerFunctionAndEvent(r,t,a.node()):s&&s.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):s&&s.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):s&&s.key==="Escape"&&n.updateOverflowMenu(!1),s.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(w.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=_(this.getOptions(),"toolbar","numberOfIcons")-1,n=_(this.getOptions(),"toolbar","controls"),r=[],i=[],a=[];return n.forEach(s=>{let o=null;if(s.type===kt.CUSTOM)_(s,"id")===null&&(s.id=`toolbar-button-${x1.buttonID++}`),_(s,"shouldBeDisabled")===null&&(s.shouldBeDisabled=()=>!1),o=s;else{const l=this.services.domUtils.isFullScreenMode();s.type===kt.MAKE_FULLSCREEN&&l?s.type=kt.EXIT_FULLSCREEN:s.type===kt.EXIT_FULLSCREEN&&!l&&(s.type=kt.MAKE_FULLSCREEN),o=this.getControlConfigByType(s.type)}o&&(o.text=s.text?s.text:s.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?_(o,"iconSVG","content")===null?a.push(o):i.push(o):a.push(o))}),a.push(...r),a.length?{buttonList:i,overflowMenuItemList:a}:{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}=_(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:
|
|
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
|
|
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
|
|
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:a,exportAsJPG:s,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:p}=_(i,"locale","translations","toolbar");let f;switch(t){case kt.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 kt.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 kt.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 kt.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 kt.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 kt.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:p,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(w.Modal.SHOW)};break;case kt.EXPORT_CSV:f={id:"toolbar-export-CSV",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case kt.EXPORT_PNG:f={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case kt.EXPORT_JPG:f={id:"toolbar-export-JPG",title:s,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 kt.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 kt.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 kt.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 kt.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 kt.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 kt.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 kt.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 kt.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 kt.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)}}};$v.buttonID=0;let jo=$v;const Mv=class E1 extends Ot{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=E1.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=_(r,"growth");return i===mt.PREFERRED||i===mt.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>_(t,"growth")===mt.STRETCH).size()}render(t=!0){const n=this.model.getOptions(),r=this.parent,{width:i,height:a}=U.getHTMLElementSize(r.node()),s=this.configs.direction===Ut.ROW||this.configs.direction===Ut.ROW_REVERSE,o=_(this.model.getOptions(),"style","prefix"),l=r.classed(`${Ce}--${o}--layout-row`,this.configs.direction===Ut.ROW).classed(`${Ce}--${o}--layout-row-reverse`,this.configs.direction===Ut.ROW_REVERSE).classed(`${Ce}--${o}--layout-column`,this.configs.direction===Ut.COLUMN).classed(`${Ce}--${o}--layout-column-reverse`,this.configs.direction===Ut.COLUMN_REVERSE).classed(`${Ce}--${o}--layout-alignitems-center`,this.configs.alignItems===vr.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=P(this),f=_(u,"renderType")===ut.SVG;d.setParent(f?U.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=_(u,"growth");(g===mt.PREFERRED||g===mt.FIXED)&&d.render(t)})}),r.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const d=_(u,"growth"),h=_(u,"renderType")===ut.SVG?U.getSVGElementSize(P(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):U.getHTMLElementSize(this);if(d===mt.PREFERRED){const p=s?h.width:h.height,f=s?i:a;u.size=p/f*100}}),l.exit().remove(),this.children.filter(u=>_(u,"growth")===mt.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);s?c.style("width",u=>`${u.size/100*i}px`).style("height","100%"):c.style("height",u=>`${u.size/100*a}px`).style("width","100%"),c.each(function(u){u.components.forEach(d=>{_(u,"growth")===mt.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())})}};Mv.instanceID=Math.floor(Math.random()*99999999999);let Fe=Mv;class Kn extends Ot{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||bf.default.size}px`).style("height",`${this.configs.size||bf.default.size}px`).attr("opacity",0)}}class Wo extends Ot{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",a=>{a.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(w.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(w.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=_(n,"locale","translations","tabularRep"),a=_(n,"style","prefix"),s=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">${
|
|
21
|
+
<p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${Cn(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
|
-
${
|
|
35
|
-
<div class="cds--table-header-label">${
|
|
34
|
+
${wt(s,0).map(o=>`<th scope="col">
|
|
35
|
+
<div class="cds--table-header-label">${Cn(o)}</div>
|
|
36
36
|
</th>`).join("")}
|
|
37
37
|
</tr>
|
|
38
38
|
</thead>
|
|
39
39
|
|
|
40
|
-
<tbody>${
|
|
40
|
+
<tbody>${s.slice(1).map(o=>`
|
|
41
41
|
<tr>
|
|
42
|
-
${o.map(l=>`<td>${
|
|
42
|
+
${o.map(l=>`<td>${Cn(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="${
|
|
49
|
+
<div class="${Ce}--${a}-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=D(this.services.domUtils.getHolder()),i=x(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${Ee}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Vs extends yt{constructor(){super(...arguments),this.type="title",this.renderType=rt.HTML}render(t=!1){const n=this.getComponentContainer(),r=x(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=>yn(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(S.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(S.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(S.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(S.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 Hu extends yt{constructor(){super(...arguments),this.type="legend",this.renderType=rt.HTML}render(t=!1){const n=this.getOptions(),r=x(n,"legend"),i=x(r,"alignment"),s=x(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=qt.items.status,l=a.some(g=>g.status===o),c=x(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Jt.CENTER).classed("right-aligned",i===Jt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",pt.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,g=>g.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(g){return g.status===qt.items.status.ACTIVE});const p=x(this.getOptions(),"legend","clickable");u.classed("clickable",p&&a.length>1);const f=qt.checkbox.radius,v=h.append("div").classed("checkbox",!0),m=v.merge(d.select("div.checkbox")).attr("role",pt.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(g,b)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${b}-title`)).attr("aria-checked",({status:g})=>g===qt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",g=>this.model.getColorClassName({classNameTypes:[at.BACKGROUND],dataGroupName:g.name,originalClassName:"checkbox"})).style("background",g=>g.status===qt.items.status.ACTIVE?this.model.getFillColor(g.name)||this.model.getStrokeColor(g.name):null).classed("active",function(g){return g.status===qt.items.status.ACTIVE});v.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 y=x(n,"legend","additionalItems");if(y&&a.length){const g=this,b=u.selectAll("div.additional-item").data(y);b.exit().remove();const T=b.enter().append("div").merge(b).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(A,I)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+I}-title`));T.selectAll("*").remove();let E,O=1;T.append("svg").classed("icon",!0).each(function(A){const I=D(this);!E||E!=A.type?(E=A.type,O=1):O++,g.addAdditionalItem(I,A,O)}),T.append("p").merge(T.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}=qt.area;if(n.type===ee.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===ee.RADIUS){const{iconData:a,fill:o,stroke:l}=qt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",pt.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===ee.LINE){const a=qt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",pt.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===ee.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",pt.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?qt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===ee.SIZE){const{iconData:a,fill:o,stroke:l}=qt.size;t.attr("fill","none").attr("role",pt.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===ee.QUARTILE){const{iconData:a}=qt.quartile;t.selectAll("rect").attr("role",pt.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===ee.ZOOM){const{iconData:a,color:o}=x(qt,"zoom"),l=t.attr("role",pt.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=x(this.getOptions(),"legend","truncation"),r=x(n,"type"),i=x(n,"threshold"),s=x(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!==Ue.NONE?a.html(function(o){const l=yn(o.name);return l.length>i&&l.length!==s?us(l,r,s):l}):a.html(o=>yn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=x(r,"legend"),s=x(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(S.Legend.ITEM_HOVER,{hoveredElement:D(this)});const o=D(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){D(this).datum().name.length>s.threshold&&s.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(S.Legend.ITEM_CLICK,{clickedElement:D(this)});const a=D(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=D(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.HIDE),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,{hoveredElement:D(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(S.Legend.ITEM_MOUSEOUT,{hoveredElement:D(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=D(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class Kg extends yt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=rt.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 GL extends Kg{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 _i,Kt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Kt||(Kt={}));var Qg=(_i={},_i[Kt.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)}},_i[Kt.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)}},_i[Kt.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)}},_i[Kt.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)}},_i),Jg=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Ro=function(){function e(t){t===void 0&&(t={}),this.positions=Qg,this.positions=Object.assign({},Qg,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,v=d*h,m=f-v,y=m/f;return{placement:l,weight:y}});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:Jg.innerHeight,width:Jg.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 Ro;class Vu extends yt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new Ro,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=D(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${Ao(i.detail.content)}</p></div>`:o=Ao(this.getTooltipHTML(l));const c=N.appendOrSelect(this.tooltip,"div.content-box");if(x(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${Ao(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${Ao(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&&D(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(S.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==S.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(S.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(S.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(S.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(S.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(S.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(S.Tooltip.MOVE,null),this.services.events.removeEventListener(S.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(S.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(S.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(S.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(S.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=x(n,"tooltip","truncation","type"),i=x(n,"tooltip","truncation","threshold"),s=x(n,"tooltip","truncation","numCharacter");return r!==Ue.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=us(a.label,r,s)),a.value&&a.value.length>i&&(a.value=us(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=P(this.services.domUtils.getHolder()),i=_(n,"style","prefix");this.modal=U.appendOrSelect(r,`div.${Ce}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class rs extends Ot{constructor(){super(...arguments),this.type="title",this.renderType=ut.HTML}render(t=!1){const n=this.getComponentContainer(),r=_(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(a=>Cn(a)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const a=this;i.on("mouseover",function(s){a.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:i,content:i.text()})}).on("mousemove",function(s){a.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("mouseout",function(){a.services.events.dispatchEvent(w.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=U.appendOrSelect(t,"tspan").node().getComputedTextLength(),a=t.text(),s=this.getSubstringIndex(t.node(),0,a.length-1,n-i);t.html(a.substring(0,s-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(w.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(w.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(w.Tooltip.HIDE)})}}getMaxTitleWidth(){return U.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const a=Math.floor((r+n)/2);return t.getSubStringLength(0,a)>i?this.getSubstringIndex(t,n,a,i):t.getSubStringLength(0,a)<i?t.getSubStringLength(0,a+1)>i?a:this.getSubstringIndex(t,a,r,i):a}}class ch extends Ot{constructor(){super(...arguments),this.type="legend",this.renderType=ut.HTML}render(t=!1){const n=this.getOptions(),r=_(n,"legend"),i=_(r,"alignment"),a=_(n,"legend","orientation");let s=this.model.getDataGroups();const{DISABLED:o}=Yt.items.status,l=s.some(v=>v.status===o),c=_(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===ie.CENTER).classed("right-aligned",i===ie.RIGHT).classed(a,!0).classed("has-deactivated-items",l).attr("role",yt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(s=this.sortDataGroups(s,c));const d=u.selectAll("div.legend-item").data(s,v=>v.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(v){return v.status===Yt.items.status.ACTIVE});const p=_(this.getOptions(),"legend","clickable");u.classed("clickable",p&&s.length>1);const f=Yt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",yt.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(v,x)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${x}-title`)).attr("aria-checked",({status:v})=>v===Yt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",v=>this.model.getColorClassName({classNameTypes:[dt.BACKGROUND],dataGroupName:v.name,originalClassName:"checkbox"})).style("background",v=>v.status===Yt.items.status.ACTIVE?this.model.getFillColor(v.name)||this.model.getStrokeColor(v.name):null).classed("active",function(v){return v.status===Yt.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 y=_(n,"legend","additionalItems");if(y&&s.length){const v=this,x=u.selectAll("div.additional-item").data(y);x.exit().remove();const T=x.enter().append("div").merge(x).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(L,N)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+N}-title`));T.selectAll("*").remove();let E,S=1;T.append("svg").classed("icon",!0).each(function(L){const N=P(this);!E||E!=L.type?(E=L.type,S=1):S++,v.addAdditionalItem(N,L,S)}),T.append("p").merge(T.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:a}=Yt.area;if(n.type===se.RADIUS?t.style("width",`${a}px`).style("height",`${a}px`):t.style("width",`${i}px`).style("height",`${a}px`),n.type===se.RADIUS){const{iconData:s,fill:o,stroke:l}=Yt.radius;t.attr("fill","none").selectAll("circle").data(s).enter().append("circle").classed("radius",!0).attr("role",yt.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===se.LINE){const s=Yt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",yt.IMG).attr("aria-label","line").attr("x1",0).attr("y1",s.yPosition).attr("x2",i).attr("y2",s.yPosition).style("stroke",n.stroke?n.stroke:s.stroke).style("stroke-width",s.strokeWidth)}else if(n.type===se.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",yt.IMG).attr("aria-label","area").attr("width",i).attr("height",a).style("fill",r>3&&!n.fill?Yt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===se.SIZE){const{iconData:s,fill:o,stroke:l}=Yt.size;t.attr("fill","none").attr("role",yt.IMG).attr("aria-label","size").selectAll("rect").data(s).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===se.QUARTILE){const{iconData:s}=Yt.quartile;t.selectAll("rect").attr("role",yt.IMG).attr("aria-label","quartile").data(s).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===se.ZOOM){const{iconData:s,color:o}=_(Yt,"zoom"),l=t.attr("role",yt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(s).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=_(this.getOptions(),"legend","truncation"),r=_(n,"type"),i=_(n,"threshold"),a=_(n,"numCharacter"),s=t.selectAll("div.legend-item p");s.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==We.NONE?s.html(function(o){const l=Cn(o.name);return l.length>i&&l.length!==a?wa(l,r,a):l}):s.html(o=>Cn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=_(r,"legend"),a=_(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(s){t.services.events.dispatchEvent(w.Legend.ITEM_HOVER,{hoveredElement:P(this)});const o=P(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>a.threshold&&a.numCharacter<l.name.length&&a.type!==We.NONE&&t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,content:l.name})}).on("mousemove",function(s){P(this).datum().name.length>a.threshold&&a.type!==We.NONE&&t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(){t.services.events.dispatchEvent(w.Legend.ITEM_CLICK,{clickedElement:P(this)});const s=P(this).datum();t.model.toggleDataLabel(s.name)}).on("mouseout",function(){const s=P(this);s.select("div.checkbox").classed("hovered",!1),s.datum().name.length>a.threshold&&a.type!==We.NONE&&t.services.events.dispatchEvent(w.Tooltip.HIDE),t.services.events.dispatchEvent(w.Legend.ITEM_MOUSEOUT,{hoveredElement:s})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(s){s.key&&s.key==="Tab"&&t.services.events.dispatchEvent(w.Legend.ITEM_HOVER,{hoveredElement:P(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(s,o){s.key&&s.key===" "?(s.preventDefault(),t.model.toggleDataLabel(o.name)):s.key&&s.key==="Tab"&&t.services.events.dispatchEvent(w.Legend.ITEM_MOUSEOUT,{hoveredElement:P(this)})}),n.selectAll("g.additional-item").on("mouseover",function(s){const o=P(this),l=o.datum();l.name.length>a.threshold&&t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,content:l.name})})}}class Cv extends Ot{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=ut.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(),[a,s]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=U.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=U.appendOrSelect(this.chartClipPath,`rect.${this.type}`);s-a>0&&c.attr("x",a).attr("y",l).attr("width",s-a).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class qL extends Cv{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}=U.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=U.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=U.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 ki,ee;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(ee||(ee={}));var Av=(ki={},ki[ee.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)}},ki[ee.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)}},ki[ee.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)}},ki[ee.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)}},ki),kv=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},qo=function(){function e(t){t===void 0&&(t={}),this.positions=Av,this.positions=Object.assign({},Av,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 a=t.getBoundingClientRect(),s=document.body.getBoundingClientRect();return{top:a.top-s.top+r.top,left:a.left-s.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),a=t.getBoundingClientRect();return this.calculatePosition(i,a,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),a=t.getBoundingClientRect();return this.calculatePosition(i,a,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var a=i(t),s=t.getBoundingClientRect();return this.calculatePosition(a,s,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,a){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),a===void 0&&(a=this.findPosition.bind(this));var o=r.map(function(l){var c=a(t,n,l),u=s.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,y=m/f;return{placement:l,weight:y}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var s=function(o,l,c){return a.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,s)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:kv.innerHeight,width:kv.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 qo;class uh extends Ot{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=ut.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new qo,this.handleShowTooltip=i=>{const a=i.detail.data||i.detail.items,s=P(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${zo(i.detail.content)}</p></div>`:o=zo(this.getTooltipHTML(l));const c=U.appendOrSelect(this.tooltip,"div.content-box");if(_(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${zo(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${zo(this.model.getOptions().tooltip.customHTML(a,o,s))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&P(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(w.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==w.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(w.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(w.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(w.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(w.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(w.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(w.Tooltip.MOVE,null),this.services.events.removeEventListener(w.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(w.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(w.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(w.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(w.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=_(n,"tooltip","truncation","type"),i=_(n,"tooltip","truncation","threshold"),a=_(n,"tooltip","truncation","numCharacter");return r!==We.NONE?t.map(s=>{const o=s.labelIcon?12:0;return s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s.label&&s.label.length+o>i&&(s.label=wa(s.label,r,a)),s.value&&s.value.length>i&&(s.value=wa(s.value,r,a)),s}):t.map(s=>(s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s))}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,50 +58,59 @@
|
|
|
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=x(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=x(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=x(n,"tooltip","enabled");if(r){const i=D(this.services.domUtils.getHolder()),s=x(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${Ee}--${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==Kt.LEFT?i.left-=r:n==Kt.RIGHT?i.left+=r:n==Kt.TOP?i.top-=r:n==Kt.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=x(a,"zoomBar","top","enabled"),l=!!x(t,"detail","noWrap"),c=Array.isArray(x(t,"detail","placements")),u=c?x(t,"detail","placements"):[Kt.RIGHT,Kt.LEFT,Kt.TOP,Kt.BOTTOM];let d,{horizontalOffset:h}=Vp;const{defaultOffset:p}=Vp;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=x(t,"detail","event","target"),y=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(y,s,u,()=>({top:0,left:0,width:r,height:i}));let g=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));g=this.addOffsetByPlacement(g,d,p),this.positionService.setElement(s,g);return}let f=x(t,"detail","mousePosition");if(!f)f=vr(x(t,"detail","event"),n);else{const m=x(a,"zoomBar","top","type"),y=ke.height[m];o&&(f[1]+=y+ke.spacerHeight)}f[0]/r>.9?d=Kt.LEFT:f[0]/r<.1?d=Kt.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Kt.LEFT&&(h*=-1);const v=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},s,d);this.positionService.setElement(s,v)}}const tv=class tl extends yt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=rt.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===tt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const v=E=>{const O=E[1]-E[0];let A="0,"+O.toString();const I=Math.floor(l/tl.DASH_LENGTH),L=I*tl.DASH_LENGTH;for(let R=0;R<I;R++)A+=","+tl.DASH_LENGTH;A+=","+(l-L),I%2===1&&(A+=",0"),A+=","+O.toString(),A+=","+l.toString(),p.attr("stroke-dasharray",A)},m=E=>{const O=E.selection;O===null||O[0]===O[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),v(O))},y=(E,O)=>{const A=Pf().range([0,o]).domain(f);let I=[A.invert(E),A.invert(O)];I[0].valueOf()===I[1].valueOf()&&(I=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==I[0].valueOf()||f[1].valueOf()!==I[1].valueOf())&&this.services.zoom.handleDomainChange(I)};let g;const b=E=>{const O=E.selection;O!==null&&(y(O[0],O[1]),s.call(g.move,null),p.style("display","none"))};l!=0&&o!=0&&(g=Dm().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",b),s.call(g));const T=this.services.zoom.getZoomRatio();i.on("click",function(E){if(E.shiftKey){const O=this.services.domUtils.getHolder(),A=vr(s.node(),O)[0];let I=A-o*T/2;I<0&&(I=0);let L=A+o*T/2;L>o&&(L=o),y(I,L)}})}}};tv.DASH_LENGTH=4;let zL=tv;class jL extends yt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=rt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Dm(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(S.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",G.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(G.TOP),i=this.services.zoom.isZoomBarLocked(G.TOP),s=x(this.getOptions(),"zoomBar",G.TOP,"type"),a=x(this.getOptions(),"axes",G.BOTTOM,"highlights"),o=ke.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",ke.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ye.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===Ye.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(),v=h.getMainXScaleType();if(p&&v===tt.TIME){let m=this.services.zoom.getZoomBarData();if(Ke(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const y=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,y);const g=this.model.get("initialZoomDomain"),b=x(this.getOptions(),"zoomBar",G.TOP,"initialZoomDomain");b&&b[0]&&b[1]&&(b[0]=new Date(b[0]),b[1]=new Date(b[1])),b&&!(g&&g[0].valueOf()===b[0].valueOf()&&g[1].valueOf()===b[1].valueOf())?this.model.set({initialZoomDomain:ct([],b),zoomDomain:b?ct([],b):y},{skipUpdate:!0}):b===null&&g!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],y)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(y),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Qe(m,O=>O.value));const T=this.model.get("zoomDomain");if(s===Ye.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 O=a.highlightStartMapsTo,A=a.highlightEndMapsTo,I=a.color,L=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[O])).attr("width",this.xScale(R[A])-this.xScale(R[O])).style("fill",I&&I.scale[R[L]]?I.scale[R[L]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[R[L]]?I.scale[R[L]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(T,c,l);const E=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(T!==void 0)if(T[0].valueOf()===T[1].valueOf())E.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const O=T.map(A=>this.xScale(A));O[1]-O[0]<this.MIN_SELECTION_DIFF||(E.call(this.brush.move,O),this.updateBrushHandle(this.getComponentContainer(),O))}i&&(this.brush.filter(()=>!1),E.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=x(this.getOptions(),"zoomBar",G.TOP,"type"),a=ke.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=S.ZoomBar.SELECTION_START:t.type==="brush"?a=S.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=S.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=ke.handleWidth,s=x(this.getOptions(),"zoomBar",G.TOP,"type"),a=ke.height[s],o=-i/2,l=ke.handleBarWidth,c=s===Ye.GRAPH_VIEW?ke.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===Ye.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=x(this.getOptions(),"zoomBar",G.TOP,"type"),r=ke.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=(y,g,b)=>T=>s.getValueFromScale(y,g,b,T),d=u(this.xScale,l,a),h=u(this.yScale,c,o),p=x(this.getOptions(),"zoomBar",G.TOP,"type"),f=ke.height[p],v=ku().x(y=>d(y)).y0(f).y1(y=>f-h(y)),m=N.appendOrSelect(t,n).datum(r).attr("d",v);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=Tn(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=x(this.model.getOptions(),"zoomBar",G.TOP,"type"),a=ke.height[s],o=Is()([[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),x(this.getOptions(),"zoomBar",G.TOP,"type")===Ye.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(S.ZoomBar.UPDATE,this.render.bind(this))}}class WL extends yt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new Ro}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).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===G.LEFT||c===G.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===tt.LABELS,[v,m]=h.range(),[y,g]=p.range(),{cartesianScales:b}=l.services,T=b.getOrientation(),E=R=>b.getDomainValue(R),O=R=>b.getRangeValue(R),[A,I]=An(E,O,T),L=D(this);c===G.TOP||c===G.BOTTOM?(L.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",g).attr("y2",y).attr("x1",({datum:R})=>A(R)+(f?u.step()/2:0)).attr("x2",({datum:R})=>A(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-A(R)).attr("width",Math.abs(y-g)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",v).attr("x2",m).attr("y1",({datum:R})=>I(R)+(f?u.step()/2:0)).attr("y2",({datum:R})=>I(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),L.selectAll("rect.threshold-hoverable-area").attr("x",v).attr("y",({datum:R})=>I(R)).attr("width",Math.abs(m-v)).classed("rotate",!1))}),this.services.events.addEventListener(S.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(S.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}=x(i,"locale");if(s===tt.TIME){const l=[G.LEFT,G.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=x(i,"timeScale"),p=Tc(d.ticks(),x(h,"timeInterval"));return Ec(n,0,d.ticks(),p,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${Ee}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=vr(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(yn(`${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,[Kt.RIGHT,Kt.LEFT,Kt.TOP,Kt.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=x(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){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(S.Threshold.SHOW,{event:n,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(S.Threshold.HIDE,{event:n,hoveredElement:D(this),datum:D(this).datum()})})}}class qL extends yt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new Ro,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).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,v]=d.range(),{cartesianScales:m}=l.services,y=m.getOrientation(),g=A=>m.getDomainValue(A),b=A=>m.getRangeValue(A),[T,E]=An(g,b,y),O=D(this);c===G.TOP||c===G.BOTTOM?O.selectAll("rect.highlight-bar").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"highlight-bar-update",animate:t})).attr("y",Math.max(v+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:A,...I})=>T(I[A])).attr("width",({highlightStartMapsTo:A,highlightEndMapsTo:I,...L})=>Math.max(T(L[I])-T(L[A]),0)).style("stroke",({color:A,labelMapsTo:I,...L})=>A&&A.scale[L[I]]?A.scale[L[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:A,labelMapsTo:I,...L})=>A&&A.scale[L[I]]?A.scale[L[I]]:null):O.selectAll("rect.highlight-bar").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:A,...I})=>E(I[A])).attr("height",({highlightStartMapsTo:A,highlightEndMapsTo:I,...L})=>Math.max(E(L[A])-E(L[I]),0)).style("stroke",({color:A,labelMapsTo:I,...L})=>A&&A.scale[L[I]]?A.scale[L[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:A,labelMapsTo:I,...L})=>A&&A.scale[L[I]]?A.scale[L[I]]:null)})}}class ev extends Vu{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 v=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(v)}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(v=>d.push({label:v.label,value:v.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:[at.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:[at.TOOLTIP],dataGroupName:h[o]})}}).sort((h,p)=>p.value-h.value)),!a&&x(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 nv(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 YL(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 Fu(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 ZL(e){return e.depth}function XL(e,t){return t-1-e.height}function rv(e,t){return e.sourceLinks.length?e.depth:t-1}function Do(e){return function(){return e}}function iv(e,t){return Io(e.source,t.source)||e.index-t.index}function sv(e,t){return Io(e.target,t.target)||e.index-t.index}function Io(e,t){return e.y0-t.y0}function Gu(e){return e.value}function KL(e){return e.index}function QL(e){return e.nodes}function JL(e){return e.links}function av(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function ov({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 tR(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=KL,l=rv,c,u,d=QL,h=JL,p=6;function f(){const _={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return v(_),m(_),y(_),g(_),E(_),ov(_),_}f.update=function(_){return ov(_),_},f.nodeId=function(_){return arguments.length?(o=typeof _=="function"?_:Do(_),f):o},f.nodeAlign=function(_){return arguments.length?(l=typeof _=="function"?_:Do(_),f):l},f.nodeSort=function(_){return arguments.length?(c=_,f):c},f.nodeWidth=function(_){return arguments.length?(i=+_,f):i},f.nodePadding=function(_){return arguments.length?(s=a=+_,f):s},f.nodes=function(_){return arguments.length?(d=typeof _=="function"?_:Do(_),f):d},f.links=function(_){return arguments.length?(h=typeof _=="function"?_:Do(_),f):h},f.linkSort=function(_){return arguments.length?(u=_,f):u},f.size=function(_){return arguments.length?(e=t=0,n=+_[0],r=+_[1],f):[n-e,r-t]},f.extent=function(_){return arguments.length?(e=+_[0][0],n=+_[1][0],t=+_[0][1],r=+_[1][1],f):[[e,t],[n,r]]},f.iterations=function(_){return arguments.length?(p=+_,f):p};function v({nodes:_,links:C}){for(const[U,B]of _.entries())B.index=U,B.sourceLinks=[],B.targetLinks=[];const k=new Map(_.map((U,B)=>[o(U,B,_),U]));for(const[U,B]of C.entries()){B.index=U;let{source:X,target:Y}=B;typeof X!="object"&&(X=B.source=av(k,X)),typeof Y!="object"&&(Y=B.target=av(k,Y)),X.sourceLinks.push(B),Y.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:U,targetLinks:B}of _)U.sort(u),B.sort(u)}function m({nodes:_}){for(const C of _)C.value=C.fixedValue===void 0?Math.max(Fu(C.sourceLinks,Gu),Fu(C.targetLinks,Gu)):C.fixedValue}function y({nodes:_}){const C=_.length;let k=new Set(_),U=new Set,B=0;for(;k.size;){for(const X of k){X.depth=B;for(const{target:Y}of X.sourceLinks)U.add(Y)}if(++B>C)throw new Error("circular link");k=U,U=new Set}}function g({nodes:_}){const C=_.length;let k=new Set(_),U=new Set,B=0;for(;k.size;){for(const X of k){X.height=B;for(const{source:Y}of X.targetLinks)U.add(Y)}if(++B>C)throw new Error("circular link");k=U,U=new Set}}function b({nodes:_}){const C=nv(_,B=>B.depth)+1,k=(n-e-i)/(C-1),U=new Array(C);for(const B of _){const X=Math.max(0,Math.min(C-1,Math.floor(l.call(null,B,C))));B.layer=X,B.x0=e+X*k,B.x1=B.x0+i,U[X]?U[X].push(B):U[X]=[B]}if(c)for(const B of U)B.sort(c);return U}function T(_){const C=YL(_,k=>(r-t-(k.length-1)*a)/Fu(k,Gu));for(const k of _){let U=t;for(const B of k){B.y0=U,B.y1=U+B.value*C,U=B.y1+a;for(const X of B.sourceLinks)X.width=X.value*C}U=(r-U+a)/(k.length+1);for(let B=0;B<k.length;++B){const X=k[B];X.y0+=U*(B+1),X.y1+=U*(B+1)}F(k)}}function E(_){const C=b(_);a=Math.min(s,(r-t)/(nv(C,k=>k.length)-1)),T(C);for(let k=0;k<p;++k){const U=Math.pow(.99,k),B=Math.max(1-U,(k+1)/p);A(C,U,B),O(C,U,B)}}function O(_,C,k){for(let U=1,B=_.length;U<B;++U){const X=_[U];for(const Y of X){let ot=0,it=0;for(const{source:st,value:K}of Y.targetLinks){let et=K*(Y.layer-st.layer);ot+=P(st,Y)*et,it+=et}if(!(it>0))continue;let bt=(ot/it-Y.y0)*C;Y.y0+=bt,Y.y1+=bt,$(Y)}c===void 0&&X.sort(Io),I(X,k)}}function A(_,C,k){for(let U=_.length,B=U-2;B>=0;--B){const X=_[B];for(const Y of X){let ot=0,it=0;for(const{target:st,value:K}of Y.sourceLinks){let et=K*(st.layer-Y.layer);ot+=H(Y,st)*et,it+=et}if(!(it>0))continue;let bt=(ot/it-Y.y0)*C;Y.y0+=bt,Y.y1+=bt,$(Y)}c===void 0&&X.sort(Io),I(X,k)}}function I(_,C){const k=_.length>>1,U=_[k];R(_,U.y0-a,k-1,C),L(_,U.y1+a,k+1,C),R(_,r,_.length-1,C),L(_,t,0,C)}function L(_,C,k,U){for(;k<_.length;++k){const B=_[k],X=(C-B.y0)*U;X>1e-6&&(B.y0+=X,B.y1+=X),C=B.y1+a}}function R(_,C,k,U){for(;k>=0;--k){const B=_[k],X=(B.y1-C)*U;X>1e-6&&(B.y0-=X,B.y1-=X),C=B.y0-a}}function $({sourceLinks:_,targetLinks:C}){if(u===void 0){for(const{source:{sourceLinks:k}}of C)k.sort(sv);for(const{target:{targetLinks:k}}of _)k.sort(iv)}}function F(_){if(u===void 0)for(const{sourceLinks:C,targetLinks:k}of _)C.sort(sv),k.sort(iv)}function P(_,C){let k=_.y0-(_.sourceLinks.length-1)*a/2;for(const{target:U,width:B}of _.sourceLinks){if(U===C)break;k+=B+a}for(const{source:U,width:B}of C.targetLinks){if(U===_)break;k-=B}return k}function H(_,C){let k=C.y0-(C.targetLinks.length-1)*a/2;for(const{source:U,width:B}of C.targetLinks){if(U===_)break;k+=B+a}for(const{target:U,width:B}of _.sourceLinks){if(U===C)break;k-=B}return k}return f}var zu=Math.PI,ju=2*zu,Ir=1e-6,eR=ju-Ir;function Wu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function lv(){return new Wu}Wu.prototype=lv.prototype={constructor:Wu,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>Ir)if(!(Math.abs(u*o-l*c)>Ir)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,f=o*o+l*l,v=h*h+p*p,m=Math.sqrt(f),y=Math.sqrt(d),g=i*Math.tan((zu-Math.acos((f+d-v)/(2*m*y)))/2),b=g/y,T=g/m;Math.abs(b-1)>Ir&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+T*o)+","+(this._y1=t+T*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)>Ir||Math.abs(this._y1-c)>Ir)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%ju+ju),d>eR?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>Ir&&(this._+="A"+n+","+n+",0,"+ +(d>=zu)+","+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 cv(e){return function(){return e}}function nR(e){return e[0]}function rR(e){return e[1]}var iR=Array.prototype.slice;function sR(e){return e.source}function aR(e){return e.target}function oR(e){var t=sR,n=aR,r=nR,i=rR,s=null;function a(){var o,l=iR.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=lv()),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:cv(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:cv(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function lR(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function cR(){return oR(lR)}function uR(e){return[e.source.x1,e.y0]}function hR(e){return[e.target.x0,e.y1]}function dR(){return cR().source(uR).target(hR)}class pR extends yt{constructor(){super(...arguments),this.type="alluvial",this.renderType=rt.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=x(this.getOptions(),"color","gradient","enabled");let l=nn.minNodePadding;s.alluvial.nodePadding>nn.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=rv;c===Jt.LEFT?u=ZL:c===Jt.RIGHT&&(u=XL);const d=tR().nodeId(g=>g.name).nodeWidth(nn.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const h={};this.graph.nodes.forEach(g=>{const b=g.x0;g.category&&(h[b]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,b)=>this.services.domUtils.generateElementIDString(`alluvial-category-${b}`)).style("font-size","14px").text(g=>h[g]?h[g]:"").attr("y",20).attr("x",(g,b)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-category-${b}`),{width:E}=N.getSVGElementSize(D(`text#${T}`),{useBBox:!0});let O=0;return g+O>=E&&(O=-E+4),O});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const g=x(this.getOptions(),"color","scale");g&&p.enter().append("linearGradient").attr("id",b=>`${this.gradient_id}-link-${b.index}`).attr("gradientUnits","userSpaceOnUse").call(b=>b.append("stop").attr("offset","0%").attr("stop-color",T=>g[T.source.name])).call(b=>b.append("stop").attr("offset","100%").attr("stop-color",T=>g[T.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",dR()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name,null,{...g,source:g.source.name,target:g.target.name})).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",nn.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);f.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const v=f.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`)),{code:m,number:y}=x(s,"locale");v.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${y(g.value,m)})`).attr("aria-label",g=>`${g.name} (${g.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(g,b)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:E}=N.getSVGElementSize(D(`text#${T}`),{useBBox:!0});return E+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(g,b)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:E}=N.getSVGElementSize(D(`text#${T}`),{useBBox:!0}),O=(g.y1-g.y0)/2-9;let A=g.x1-g.x0;return g.x1>=E?A=A-(E+16):A+=4,`translate(${A}, ${O})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=x(this.getOptions(),"locale"),s=Fa((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"?(D(a).lower(),l.style("stroke-opacity",nn.opacity.default)):l.style("stroke-opacity",function(){return a===this?(D(this).raise(),nn.opacity.selected):nn.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=D(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(S.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(S.Alluvial.LINE_MOUSEMOVE,{event:a,element:D(this),datum:o}),n.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(S.Alluvial.LINE_CLICK,{event:a,element:D(this),datum:o})}).on("mouseout",function(a,o){const l=D(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(S.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=Fa((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",nn.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)?(D(this).classed("link-hovered",!0).raise(),nn.opacity.selected):nn.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=D(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=cs(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=cs(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(S.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(S.Alluvial.NODE_MOUSEMOVE,{event:r,element:D(this),datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Alluvial.NODE_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=cs(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",nn.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=cs(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(S.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.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=_(r,"tooltip","valueFormatter"),{code:a,number:s,date:o}=_(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,a,{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,a,{month:"short",day:"numeric",year:"numeric"})}}catch{}return s(t,a)}render(t=!1){const n=this.getOptions(),r=_(n,"tooltip","enabled");if(r){const i=P(this.services.domUtils.getHolder()),a=_(n,"style","prefix");this.tooltip=U.appendOrSelect(i,`div.${Ce}--${a}--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==ee.LEFT?i.left-=r:n==ee.RIGHT?i.left+=r:n==ee.TOP?i.top-=r:n==ee.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,a=this.tooltip.node(),s=this.getOptions(),o=_(s,"zoomBar","top","enabled"),l=!!_(t,"detail","noWrap"),c=Array.isArray(_(t,"detail","placements")),u=c?_(t,"detail","placements"):[ee.RIGHT,ee.LEFT,ee.TOP,ee.BOTTOM];let d,{horizontalOffset:h}=_f;const{defaultOffset:p}=_f;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=_(t,"detail","event","target"),y=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(y,a,u,()=>({top:0,left:0,width:r,height:i}));let v=this.positionService.findPosition(m,a,d,()=>this.services.domUtils.getElementOffset(m));v=this.addOffsetByPlacement(v,d,p),this.positionService.setElement(a,v);return}let f=_(t,"detail","mousePosition");if(!f)f=$r(_(t,"detail","event"),n);else{const m=_(s,"zoomBar","top","type"),y=Ue.height[m];o&&(f[1]+=y+Ue.spacerHeight)}f[0]/r>.9?d=ee.LEFT:f[0]/r<.1?d=ee.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},a,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===ee.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},a,d);this.positionService.setElement(a,g)}}const Rv=class Ol extends Ot{constructor(){super(...arguments),this.type="grid-brush",this.renderType=ut.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=U.appendOrSelect(n,"svg.chart-grid-backdrop"),a=U.appendOrSelect(i,`g.${this.type}`),s=U.appendOrSelect(a,this.selectionSelector),{width:o,height:l}=U.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=U.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===lt.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=E=>{const S=E[1]-E[0];let L="0,"+S.toString();const N=Math.floor(l/Ol.DASH_LENGTH),D=N*Ol.DASH_LENGTH;for(let I=0;I<N;I++)L+=","+Ol.DASH_LENGTH;L+=","+(l-D),N%2===1&&(L+=",0"),L+=","+S.toString(),L+=","+l.toString(),p.attr("stroke-dasharray",L)},m=E=>{const S=E.selection;S===null||S[0]===S[1]||(p.attr("x",parseFloat(s.attr("x"))+parseFloat(i.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),g(S))},y=(E,S)=>{const L=mm().range([0,o]).domain(f);let N=[L.invert(E),L.invert(S)];N[0].valueOf()===N[1].valueOf()&&(N=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==N[0].valueOf()||f[1].valueOf()!==N[1].valueOf())&&this.services.zoom.handleDomainChange(N)};let v;const x=E=>{const S=E.selection;S!==null&&(y(S[0],S[1]),a.call(v.move,null),p.style("display","none"))};l!=0&&o!=0&&(v=dg().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",x),a.call(v));const T=this.services.zoom.getZoomRatio();i.on("click",function(E){if(E.shiftKey){const S=this.services.domUtils.getHolder(),L=$r(a.node(),S)[0];let N=L-o*T/2;N<0&&(N=0);let D=L+o*T/2;D>o&&(D=o),y(N,D)}})}}};Rv.DASH_LENGTH=4;let YL=Rv;class ZL extends Ot{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=ut.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=dg(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(w.ZoomBar.UPDATE,this.render.bind(this));const t=_(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),a=_(this.getOptions(),"zoomBar",Z.TOP,"type"),s=_(this.getOptions(),"axes",Z.BOTTOM,"highlights"),o=Ue.height[a],{width:l}=U.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=U.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(U.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Ue.spacerHeight).attr("opacity",1).attr("fill","none"),a===rn.GRAPH_VIEW?U.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):a===rn.SLIDER_VIEW&&U.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===lt.TIME){let m=this.services.zoom.getZoomBarData();if(on(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const y=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,y);const v=this.model.get("initialZoomDomain"),x=_(this.getOptions(),"zoomBar",Z.TOP,"initialZoomDomain");x&&x[0]&&x[1]&&(x[0]=new Date(x[0]),x[1]=new Date(x[1])),x&&!(v&&v[0].valueOf()===x[0].valueOf()&&v[1].valueOf()===x[1].valueOf())?this.model.set({initialZoomDomain:pt([],x),zoomDomain:x?pt([],x):y},{skipUpdate:!0}):x===null&&v!==null&&this.model.set({initialZoomDomain:null,zoomDomain:pt([],y)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(y),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(ln(m,S=>S.value));const T=this.model.get("zoomDomain");if(a===rn.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),s)){const S=s.highlightStartMapsTo,L=s.highlightEndMapsTo,N=s.color,D=s.labelMapsTo;s.data.forEach((I,M)=>{U.appendOrSelect(d,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(I[S])).attr("width",this.xScale(I[L])-this.xScale(I[S])).style("fill",N&&N.scale[I[D]]?N.scale[I[D]]:null).style("fill-opacity",.1).style("stroke",N&&N.scale[I[D]]?N.scale[I[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(T,c,l);const E=U.appendOrSelect(n,this.brushSelector).call(this.brush);if(T!==void 0)if(T[0].valueOf()===T[1].valueOf())E.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const S=T.map(L=>this.xScale(L));S[1]-S[0]<this.MIN_SELECTION_DIFF||(E.call(this.brush.move,S),this.updateBrushHandle(this.getComponentContainer(),S))}i&&(this.brush.filter(()=>!1),E.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)},a=_(this.getOptions(),"zoomBar",Z.TOP,"type"),s=Ue.height[a];this.brush.extent([[n,0],[r,s]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const a=[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]!==a[0]||n[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let s;t.type==="start"?s=w.ZoomBar.SELECTION_START:t.type==="brush"?s=w.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(s=w.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(w.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(s,{selection:i,newDomain:a})}}updateBrushHandle(t,n){const r=this,i=Ue.handleWidth,a=_(this.getOptions(),"zoomBar",Z.TOP,"type"),s=Ue.height[a],o=-i/2,l=Ue.handleBarWidth,c=a===rn.GRAPH_VIEW?Ue.handleBarHeight:6,u=-l/2,d=(s-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",s).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"),a===rn.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],s)}updateSliderSelectedArea(t){const n=_(this.getOptions(),"zoomBar",Z.TOP,"type"),r=Ue.height[n],i=this.getComponentContainer().select("svg.zoom-container");U.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:a}=this.services,s=a.getMainXAxisPosition(),o=a.getMainYAxisPosition(),l=a.getMainXScaleType(),c=a.getMainYScaleType(),u=(y,v,x)=>T=>a.getValueFromScale(y,v,x,T),d=u(this.xScale,l,s),h=u(this.yScale,c,o),p=_(this.getOptions(),"zoomBar",Z.TOP,"type"),f=Ue.height[p],g=th().x(y=>d(y)).y0(f).y1(y=>f-h(y)),m=U.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,a,s){const o=U.appendOrSelect(t,"clipPath").attr("id",n);U.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",a).attr("height",s)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=Dn(t),i=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const s={};s[i]=n[0],s[a]=0,r.unshift(s)}if(Number(n[1])>Number(r[r.length-1][i])){const s={};s[i]=n[1],s[a]=0,r.push(s)}return r}renderZoomBarBaseline(t,n,r,i=!1){const a=_(this.model.getOptions(),"zoomBar",Z.TOP,"type"),s=Ue.height[a],o=Ka()([[n,s],[r,s]]);U.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),U.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),_(this.getOptions(),"zoomBar",Z.TOP,"type")===rn.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(w.ZoomBar.UPDATE,this.render.bind(this))}}class XL extends Ot{constructor(t,n){super(t,n),this.type="threshold",this.renderType=ut.SVG,this.positionService=new qo}render(t=!1){const n=_(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 a=i.enter().append("g").merge(i);a.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const s=a.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(s).attr("class","threshold-group");const l=this;a.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===lt.LABELS,[g,m]=h.range(),[y,v]=p.range(),{cartesianScales:x}=l.services,T=x.getOrientation(),E=I=>x.getDomainValue(I),S=I=>x.getRangeValue(I),[L,N]=Vn(E,S,T),D=P(this);c===Z.TOP||c===Z.BOTTOM?(D.selectAll("line.threshold-line").transition().call(I=>l.services.transitions.setupTransition({transition:I,name:"threshold-line-update",animate:t})).attr("y1",v).attr("y2",y).attr("x1",({datum:I})=>L(I)+(f?u.step()/2:0)).attr("x2",({datum:I})=>L(I)+(f?u.step()/2:0)).style("stroke",({fillColor:I})=>I),D.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:I})=>-L(I)).attr("width",Math.abs(y-v)).classed("rotate",!0)):(D.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})=>N(I)+(f?u.step()/2:0)).attr("y2",({datum:I})=>N(I)+(f?u.step()/2:0)).style("stroke",({fillColor:I})=>I),D.selectAll("rect.threshold-hoverable-area").attr("x",g).attr("y",({datum:I})=>N(I)).attr("width",Math.abs(m-g)).classed("rotate",!1))}),this.services.events.addEventListener(w.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(w.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),a=this.services.cartesianScales.getScaleTypeByPosition(r),{code:s,number:o}=_(i,"locale");if(a===lt.TIME){const l=[Z.LEFT,Z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=_(i,"timeScale"),p=Wc(d.ticks(),_(h,"timeInterval"));return jc(n,0,d.ticks(),p,h,i.locale)}return o(n,s)}appendThresholdLabel(){const t=P(this.services.domUtils.getHolder()),n=_(this.getOptions(),"style","prefix");this.label=U.appendOrSelect(t,`div.${Ce}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=$r(t,r),a=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(Cn(`${n.label||"Threshold"}: ${a}`)).style("background-color",n.fillColor);const s=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[ee.RIGHT,ee.LEFT,ee.TOP,ee.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},s,o);this.positionService.setElement(s,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=_(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){P(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(w.Threshold.SHOW,{event:n,hoveredElement:P(this),datum:P(this).datum()})}).on("mouseout",function(n){P(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(w.Threshold.HIDE,{event:n,hoveredElement:P(this),datum:P(this).datum()})})}}class KL extends Ot{constructor(t,n){super(t,n),this.type="highlight",this.renderType=ut.SVG,this.positionService=new qo,this.highlightStrokeWidth=1}render(t=!1){const n=_(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 a=i.enter().append("g").merge(i);a.attr("class",c=>`axis-highlight ${c.axisPosition}`);const s=a.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)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(s).attr("class","highlight-group");const l=this;a.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,y=m.getOrientation(),v=L=>m.getDomainValue(L),x=L=>m.getRangeValue(L),[T,E]=Vn(v,x,y),S=P(this);c===Z.TOP||c===Z.BOTTOM?S.selectAll("rect.highlight-bar").transition().call(L=>l.services.transitions.setupTransition({transition:L,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:L,...N})=>T(N[L])).attr("width",({highlightStartMapsTo:L,highlightEndMapsTo:N,...D})=>Math.max(T(D[N])-T(D[L]),0)).style("stroke",({color:L,labelMapsTo:N,...D})=>L&&L.scale[D[N]]?L.scale[D[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:L,labelMapsTo:N,...D})=>L&&L.scale[D[N]]?L.scale[D[N]]:null):S.selectAll("rect.highlight-bar").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:L,...N})=>E(N[L])).attr("height",({highlightStartMapsTo:L,highlightEndMapsTo:N,...D})=>Math.max(E(D[L])-E(D[N]),0)).style("stroke",({color:L,labelMapsTo:N,...D})=>L&&L.scale[D[N]]?L.scale[D[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:L,labelMapsTo:N,...D})=>L&&L.scale[D[N]]?L.scale[D[N]]:null)})}}class Lv extends uh{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,a=i.getDomainIdentifier(),s=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][a];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(s){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:wt(r,"locale.translations.group")||wt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[dt.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:[dt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,p)=>p.value-h.value)),!s&&_(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:wt(r,"locale.translations.total")||wt(r,"tooltip.totalLabel")||"Total",value:n.reduce((p,f)=>p+f[h],0),bold:!0})}return d}}function Dv(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 QL(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 hh(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 JL(e){return e.depth}function tD(e,t){return t-1-e.height}function Iv(e,t){return e.sourceLinks.length?e.depth:t-1}function Yo(e){return function(){return e}}function Nv(e,t){return Zo(e.source,t.source)||e.index-t.index}function Pv(e,t){return Zo(e.target,t.target)||e.index-t.index}function Zo(e,t){return e.y0-t.y0}function dh(e){return e.value}function eD(e){return e.index}function nD(e){return e.nodes}function rD(e){return e.links}function Uv(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Bv({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 iD(){let e=0,t=0,n=1,r=1,i=24,a=8,s,o=eD,l=Iv,c,u,d=nD,h=rD,p=6;function f(){const O={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(O),m(O),y(O),v(O),E(O),Bv(O),O}f.update=function(O){return Bv(O),O},f.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:Yo(O),f):o},f.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:Yo(O),f):l},f.nodeSort=function(O){return arguments.length?(c=O,f):c},f.nodeWidth=function(O){return arguments.length?(i=+O,f):i},f.nodePadding=function(O){return arguments.length?(a=s=+O,f):a},f.nodes=function(O){return arguments.length?(d=typeof O=="function"?O:Yo(O),f):d},f.links=function(O){return arguments.length?(h=typeof O=="function"?O:Yo(O),f):h},f.linkSort=function(O){return arguments.length?(u=O,f):u},f.size=function(O){return arguments.length?(e=t=0,n=+O[0],r=+O[1],f):[n-e,r-t]},f.extent=function(O){return arguments.length?(e=+O[0][0],n=+O[1][0],t=+O[0][1],r=+O[1][1],f):[[e,t],[n,r]]},f.iterations=function(O){return arguments.length?(p=+O,f):p};function g({nodes:O,links:k}){for(const[B,F]of O.entries())F.index=B,F.sourceLinks=[],F.targetLinks=[];const $=new Map(O.map((B,F)=>[o(B,F,O),B]));for(const[B,F]of k.entries()){F.index=B;let{source:et,target:C}=F;typeof et!="object"&&(et=F.source=Uv($,et)),typeof C!="object"&&(C=F.target=Uv($,C)),et.sourceLinks.push(F),C.targetLinks.push(F)}if(u!=null)for(const{sourceLinks:B,targetLinks:F}of O)B.sort(u),F.sort(u)}function m({nodes:O}){for(const k of O)k.value=k.fixedValue===void 0?Math.max(hh(k.sourceLinks,dh),hh(k.targetLinks,dh)):k.fixedValue}function y({nodes:O}){const k=O.length;let $=new Set(O),B=new Set,F=0;for(;$.size;){for(const et of $){et.depth=F;for(const{target:C}of et.sourceLinks)B.add(C)}if(++F>k)throw new Error("circular link");$=B,B=new Set}}function v({nodes:O}){const k=O.length;let $=new Set(O),B=new Set,F=0;for(;$.size;){for(const et of $){et.height=F;for(const{source:C}of et.targetLinks)B.add(C)}if(++F>k)throw new Error("circular link");$=B,B=new Set}}function x({nodes:O}){const k=Dv(O,F=>F.depth)+1,$=(n-e-i)/(k-1),B=new Array(k);for(const F of O){const et=Math.max(0,Math.min(k-1,Math.floor(l.call(null,F,k))));F.layer=et,F.x0=e+et*$,F.x1=F.x0+i,B[et]?B[et].push(F):B[et]=[F]}if(c)for(const F of B)F.sort(c);return B}function T(O){const k=QL(O,$=>(r-t-($.length-1)*s)/hh($,dh));for(const $ of O){let B=t;for(const F of $){F.y0=B,F.y1=B+F.value*k,B=F.y1+s;for(const et of F.sourceLinks)et.width=et.value*k}B=(r-B+s)/($.length+1);for(let F=0;F<$.length;++F){const et=$[F];et.y0+=B*(F+1),et.y1+=B*(F+1)}q($)}}function E(O){const k=x(O);s=Math.min(a,(r-t)/(Dv(k,$=>$.length)-1)),T(k);for(let $=0;$<p;++$){const B=Math.pow(.99,$),F=Math.max(1-B,($+1)/p);L(k,B,F),S(k,B,F)}}function S(O,k,$){for(let B=1,F=O.length;B<F;++B){const et=O[B];for(const C of et){let z=0,Q=0;for(const{source:tt,value:K}of C.targetLinks){let nt=K*(C.layer-tt.layer);z+=H(tt,C)*nt,Q+=nt}if(!(Q>0))continue;let at=(z/Q-C.y0)*k;C.y0+=at,C.y1+=at,M(C)}c===void 0&&et.sort(Zo),N(et,$)}}function L(O,k,$){for(let B=O.length,F=B-2;F>=0;--F){const et=O[F];for(const C of et){let z=0,Q=0;for(const{target:tt,value:K}of C.sourceLinks){let nt=K*(tt.layer-C.layer);z+=G(C,tt)*nt,Q+=nt}if(!(Q>0))continue;let at=(z/Q-C.y0)*k;C.y0+=at,C.y1+=at,M(C)}c===void 0&&et.sort(Zo),N(et,$)}}function N(O,k){const $=O.length>>1,B=O[$];I(O,B.y0-s,$-1,k),D(O,B.y1+s,$+1,k),I(O,r,O.length-1,k),D(O,t,0,k)}function D(O,k,$,B){for(;$<O.length;++$){const F=O[$],et=(k-F.y0)*B;et>1e-6&&(F.y0+=et,F.y1+=et),k=F.y1+s}}function I(O,k,$,B){for(;$>=0;--$){const F=O[$],et=(F.y1-k)*B;et>1e-6&&(F.y0-=et,F.y1-=et),k=F.y0-s}}function M({sourceLinks:O,targetLinks:k}){if(u===void 0){for(const{source:{sourceLinks:$}}of k)$.sort(Pv);for(const{target:{targetLinks:$}}of O)$.sort(Nv)}}function q(O){if(u===void 0)for(const{sourceLinks:k,targetLinks:$}of O)k.sort(Pv),$.sort(Nv)}function H(O,k){let $=O.y0-(O.sourceLinks.length-1)*s/2;for(const{target:B,width:F}of O.sourceLinks){if(B===k)break;$+=F+s}for(const{source:B,width:F}of k.targetLinks){if(B===O)break;$-=F}return $}function G(O,k){let $=k.y0-(k.targetLinks.length-1)*s/2;for(const{source:B,width:F}of k.targetLinks){if(B===O)break;$+=F+s}for(const{target:B,width:F}of O.sourceLinks){if(B===k)break;$-=F}return $}return f}var ph=Math.PI,fh=2*ph,jr=1e-6,aD=fh-jr;function mh(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Hv(){return new mh}mh.prototype=Hv.prototype={constructor:mh,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,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,s=this._y1,o=n-e,l=r-t,c=a-e,u=s-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>jr)if(!(Math.abs(u*o-l*c)>jr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-a,p=r-s,f=o*o+l*l,g=h*h+p*p,m=Math.sqrt(f),y=Math.sqrt(d),v=i*Math.tan((ph-Math.acos((f+d-g)/(2*m*y)))/2),x=v/y,T=v/m;Math.abs(x-1)>jr&&(this._+="L"+(e+x*c)+","+(t+x*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+T*o)+","+(this._y1=t+T*l)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var s=n*Math.cos(r),o=n*Math.sin(r),l=e+s,c=t+o,u=1^a,d=a?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)>jr||Math.abs(this._y1-c)>jr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%fh+fh),d>aD?this._+="A"+n+","+n+",0,1,"+u+","+(e-s)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>jr&&(this._+="A"+n+","+n+",0,"+ +(d>=ph)+","+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 Vv(e){return function(){return e}}function sD(e){return e[0]}function oD(e){return e[1]}var lD=Array.prototype.slice;function cD(e){return e.source}function uD(e){return e.target}function hD(e){var t=cD,n=uD,r=sD,i=oD,a=null;function s(){var o,l=lD.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(a||(a=o=Hv()),e(a,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(t=o,s):t},s.target=function(o){return arguments.length?(n=o,s):n},s.x=function(o){return arguments.length?(r=typeof o=="function"?o:Vv(+o),s):r},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Vv(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function dD(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function pD(){return hD(dD)}function fD(e){return[e.source.x1,e.y0]}function mD(e){return[e.target.x0,e.y1]}function gD(){return pD().source(fD).target(mD)}class vD extends Ot{constructor(){super(...arguments),this.type="alluvial",this.renderType=ut.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}=U.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const a=this.model.getOptions(),s=this.model.getDisplayData(),o=_(this.getOptions(),"color","gradient","enabled");let l=dn.minNodePadding;a.alluvial.nodePadding>dn.minNodePadding&&(l=a.alluvial.nodePadding);const c=_(a,"alluvial","nodeAlignment");let u=Iv;c===ie.LEFT?u=JL:c===ie.RIGHT&&(u=tD);const d=iD().nodeId(v=>v.name).nodeWidth(dn.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:a.alluvial.nodes.map(v=>Object.assign({},v)),links:s.map(v=>Object.assign({},v))}),this.graph.nodes=this.graph.nodes.filter(v=>v.value!==0);const h={};this.graph.nodes.forEach(v=>{const x=v.x0;v.category&&(h[x]=v==null?void 0:v.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",v=>`translate(${v}, 0)`).append("text").attr("id",(v,x)=>this.services.domUtils.generateElementIDString(`alluvial-category-${x}`)).style("font-size","14px").text(v=>h[v]?h[v]:"").attr("y",20).attr("x",(v,x)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-category-${x}`),{width:E}=U.getSVGElementSize(P(`text#${T}`),{useBBox:!0});let S=0;return v+S>=E&&(S=-E+4),S});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const v=_(this.getOptions(),"color","scale");v&&p.enter().append("linearGradient").attr("id",x=>`${this.gradient_id}-link-${x.index}`).attr("gradientUnits","userSpaceOnUse").call(x=>x.append("stop").attr("offset","0%").attr("stop-color",T=>v[T.source.name])).call(x=>x.append("stop").attr("offset","100%").attr("stop-color",T=>v[T.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",gD()).attr("id",v=>this.services.domUtils.generateElementIDString(`alluvial-line-${v.index}`)).attr("class",v=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[dt.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[dt.STROKE],dataGroupName:v.source.index,originalClassName:"link"})).style("stroke",v=>o?`url(#${this.gradient_id}-link-${v.index})`:this.model.getFillColor(v.source.name,null,{...v,source:v.source.name,target:v.target.name})).attr("stroke-width",v=>Math.max(1,v.width)).style("stroke-opacity",dn.opacity.default).attr("aria-label",v=>`${v.source.name} → ${v.target.name} (${v.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",v=>this.services.domUtils.generateElementIDString(`alluvial-node-${v.index}`)).classed("node-group",!0).attr("transform",v=>`translate(${v.x0}, ${v.y0})`);f.append("rect").classed("node",!0).attr("height",v=>v.y1-v.y0).attr("width",v=>v.x1-v.x0).attr("fill","black");const g=f.append("g").attr("id",v=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${v.index}`)),{code:m,number:y}=_(a,"locale");g.append("text").attr("id",v=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${v.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(v=>`${v.name} (${y(v.value,m)})`).attr("aria-label",v=>`${v.name} (${v.value})`),g.append("rect").classed("node-text-bg",!0).attr("width",(v,x)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:E}=U.getSVGElementSize(P(`text#${T}`),{useBBox:!0});return E+8}).attr("height",18).attr("stroke-width",2).lower(),g.attr("transform",(v,x)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:E}=U.getSVGElementSize(P(`text#${T}`),{useBBox:!0}),S=(v.y1-v.y0)/2-9;let L=v.x1-v.x0;return v.x1>=E?L=L-(E+16):L+=4,`translate(${L}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=_(this.getOptions(),"locale"),a=no((s,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"?(P(s).lower(),l.style("stroke-opacity",dn.opacity.default)):l.style("stroke-opacity",function(){return s===this?(P(this).raise(),dn.opacity.selected):dn.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(s,o){const l=P(this);a(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(w.Alluvial.LINE_MOUSEOVER,{event:s,element:l,datum:o}),n.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,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(s,o){n.services.events.dispatchEvent(w.Alluvial.LINE_MOUSEMOVE,{event:s,element:P(this),datum:o}),n.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,o){n.services.events.dispatchEvent(w.Alluvial.LINE_CLICK,{event:s,element:P(this),datum:o})}).on("mouseout",function(s,o){const l=P(this);a(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(w.Alluvial.LINE_MOUSEOUT,{event:s,element:l,datum:o}),n.services.events.dispatchEvent(w.Tooltip.HIDE,{event:s,hoveredElement:l})})}addNodeEventListener(){const t=this,n=no((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,a=>a.index).order().style("stroke-opacity",dn.opacity.default);return}t.parent.selectAll("path.link").transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(a){return r.some(s=>s===a.index)?(P(this).classed("link-hovered",!0).raise(),dn.opacity.selected):dn.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const a=P(this),s=[];if(t.traverse({link:"sourceLinks",node:"target"},i,s),t.traverse({link:"targetLinks",node:"source"},i,s),s.length){const o=Sa(a.attr("transform"));if(a.attr("transform",`translate(${o.x-2}, ${o.y})`),a.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=Sa(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(s,"mouseover"),t.services.events.dispatchEvent(w.Alluvial.NODE_MOUSEOVER,{event:r,element:a,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(w.Alluvial.NODE_MOUSEMOVE,{event:r,element:P(this),datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.Alluvial.NODE_CLICK,{event:r,element:P(this),datum:i})}).on("mouseout",function(r,i){const a=P(this),s=Sa(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${s.x+2}, ${s.y})`).select("rect.node").attr("width",dn.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Sa(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(w.Alluvial.NODE_MOUSEOUT,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:a})})}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 Ne extends yt{constructor(){super(...arguments),this.type="grid",this.renderType=rt.SVG}render(t=!0){const n=x(this.getOptions(),"grid","x","enabled"),r=x(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=Wc(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(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=$m(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(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(Cn(u).tx)-Number(Cn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Cn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Cn(o).tx;else if(o)l=+Cn(o).tx-+Cn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+Cn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=x(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=Cn(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 uv extends yt{constructor(){super(...arguments),this.type="area",this.renderType=rt.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?$n.opacity.unselected:$n.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",$n.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=ku().curve(this.services.curves.getD3Curve()).defined(E=>{const O=s.getRangeIdentifier();return E[O]!=null}),l=this.model.getGroupedData(this.configs.groups),c=x(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=(E,O)=>{x(r,"axes",E,"includeZero")===!1&&O[0]>0&&O[1]>0&&(d=O[0])},p=E=>u?s.getBoundedScaledValues(E)[0]:s.getRangeValue(d),f=E=>u?s.getBoundedScaledValues(E)[1]:s.getRangeValue(E);a===Qt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(E=>s.getDomainValue(E)).y0(E=>p(E)).y1(E=>f(E))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(E=>p(E)).x1(E=>f(E)).y(E=>s.getDomainValue(E)));const v=x(r,"color","gradient","enabled"),m=l&&l.length===1&&v;l.length>1&&v&&console.error("Gradients can only be enabled when having 1 single dataset");const y=n.selectAll("path.area").data(l,E=>E.name),g=D(this.services.domUtils.getMainContainer());if(y.exit().attr("opacity",0).remove(),!l.length)return;if(m){const E=g.select(`path.${this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:l[0].name})}`).node();let O;if(E)O=getComputedStyle(E,null).getPropertyValue("stroke");else{const A=x(this.model.getOptions(),"color","scale");if(A!==null){const I=Object.keys(A);O=A[I[0]]}}zc.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:zc.getStops(i,O)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const b=this,T=y.enter().append("path");m?T.merge(y).style("fill",E=>`url(#${this.services.domUtils.generateElementIDString(`${E.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:E.name,originalClassName:"area"})).attr("d",E=>{const{data:O}=E;return o(O)}):(T.attr("opacity",0).merge(y).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:E.name,originalClassName:"area"})).style("fill",E=>b.model.getFillColor(E.name,null,E.data)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"area-update-enter",animate:t})).attr("opacity",u?1:$n.opacity.selected).attr("d",E=>{const{data:O}=E;return o(O)}),u&&T.attr("fill-opacity",$n.opacity.selected).style("stroke",E=>b.model.getStrokeColor(E.name,null,E.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ei extends yt{constructor(){super(...arguments),this.type="line",this.renderType=rt.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?Mn.opacity.unselected:Mn.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",Mn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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]=An(s,a,r.getOrientation()),c=this.getOptions(),u=Is().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(v=>c.axes[v].percentage),{groupMapsTo:f}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const m=this.services.cartesianScales.getDomainIdentifier(v),y=this.services.cartesianScales.getRangeIdentifier(v);return{name:x(v,0,f),data:v.map(g=>({[m]:g.data.sharedStackKey,[f]:g[f],[y]:g[1]})),hidden:!VC(v,g=>g[0]!==g[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:[at.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:f}=p;return f.map(v=>{const m=this.services.cartesianScales.getRangeIdentifier(v);return v[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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const hv=5;function fR(e,t){return e>t-hv&&e<t+hv}class Jn extends yt{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.SVG,this.isXGridEnabled=x(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=x(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=x(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===Qt.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=>fR(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(S.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const v=this.pointsWithinLine.reduce((m,y)=>{if(m.length===0)return m.push(y),m;const g=m[0].domainValue,b=Math.abs(u-y.domainValue),T=Math.abs(u-g);return b>T||(b<T?m=[y]:m.push(y)),m},[]);if(v.length>0){const m=v.map(T=>T.originalData).filter(T=>{const E=this.services.cartesianScales.getRangeIdentifier(T);return T[E]!=null}),y=v.map(T=>T.domainValue),g=p.filter(T=>{const E=this.services.cartesianScales.getDomainValue(T);return y.includes(E)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Om(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g,this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const b=v[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",b.domainValue).attr("y2",b.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",b.domainValue).attr("x2",b.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(S.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=vr(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=pw(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 xn=class extends yt{constructor(){super(...arguments),this.type="scatter",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(S.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(S.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(!(x(this.getOptions(),"points","enabled")||x(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]=An(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=An(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]=An(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=a.getDomainIdentifier(p),v=this.model.getIsFilled(p[o],p[f],p,i)?[at.FILL,at.STROKE]:[at.STROKE];return this.model.getColorClassName({classNameTypes:v,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",pt.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=D(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[at.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(S.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(S.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=D(this);(s=t.services.events)==null||s.dispatchEvent(S.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(S.Scatter.SCATTER_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=D(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(S.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(S.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(S.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}};class dv extends yt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=rt.SVG,this.truncation={[G.LEFT]:!1,[G.RIGHT]:!1,[G.TOP]:!1,[G.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=x(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===G.BOTTOM||n===G.TOP?(c=this.configs.axes[G.LEFT]?this.margins.left:0,u=this.configs.axes[G.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===tt.LABELS||this.scaleType===tt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case G.LEFT:h=$m;break;case G.BOTTOM:h=Wc;break;case G.RIGHT:h=XC;break;case G.TOP:h=ZC;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",`${pt.GRAPHICS_OBJECT} ${pt.GROUP}`),f.attr("aria-label",`${n} ticks`));const v=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=x(r,"axes",n),y=this.scaleType===tt.TIME||m.scaleType===tt.TIME,g=n===G.LEFT||n===G.RIGHT,b=this.model.get("zoomDomain");if(b&&y&&!g&&d.domain(b),!i){f.attr("aria-hidden",!0);return}const T=x(m,"scaleType"),E=x(r,"data","loading"),O=x(m,"ticks","number"),A=x(m,"ticks","values"),I=x(m,"truncation","type"),L=x(m,"truncation","threshold"),R=x(m,"truncation","numCharacter"),$=O!==null,F=x(r,"timeScale"),P=N.appendOrSelect(v,"g.tick"),H=N.appendOrSelect(P,"text").text("0"),_=N.getSVGElementSize(H.node(),{useBBox:!0}).height;P.remove();const C=this.scaleType||m.scaleType||tt.LINEAR,k=h(d).tickSizeOuter(0);if(d.ticks){let K;if($?K=O:(K=qn.ticks.number,g&&(K=this.getNumberOfFittingTicks(o,_,qn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),k.ticks(K),y)if(!d.ticks(K).length)k.tickValues([]);else{const et=x(r,"timeScale","addSpaceOnEdges"),mt=x(r,"axes",n,"domain"),q=d.copy();et&&!mt&&q.nice(K);const J=q.ticks(K);et&&J.length>2&&!mt&&(J.splice(J.length-1,1),J.splice(0,1)),k.tickValues(J)}}let U;const B=x(m,"ticks","formatter"),{code:X,number:Y}=x(r,"locale");if(y){const K=Tc(k.tickValues(),x(r,"timeScale","timeInterval"));B===null?U=(et,mt)=>Ec(et,mt,k.tickValues(),K,F,r.locale):U=(et,mt)=>{const q=Ec(et,mt,k.tickValues(),K,F,r.locale);return B(et,mt,q)}}else B===null?C===tt.LINEAR&&(U=K=>Y(K,X)):U=B;k.tickFormat(U);const[ot,it]=this.services.cartesianScales.getScaleByPosition(n).domain();let bt;if(A){if(y)A.forEach((K,et)=>{K.getTime===void 0&&(A[et]=new Date(K))}),bt=A.filter(K=>{const et=K.getTime();return et>=new Date(ot).getTime()&&et<=new Date(it).getTime()});else if(T===tt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();bt=A.filter(et=>K.includes(et))}else bt=A.filter(K=>K>=ot&&K<=it);k.tickValues(bt)}switch(n){case G.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case G.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case G.RIGHT:f.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case G.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const st=this.model.isDataEmpty();if(m.title){const K=N.appendOrSelect(l,"text.axis-title").html(st||E?"":yn(m.title)),et=x(m,"titleOrientation");let mt;switch(n){case G.LEFT:et===ea.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case G.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case G.RIGHT:et===ea.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case G.TOP:mt=N.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${mt/2})`).style("text-anchor","middle");break}}if(y){const K=Tc(k.tickValues(),x(r,"timeScale","timeInterval")),et=F.showDayName,mt=f;t&&(f=f.transition().call(q=>this.services.transitions.setupTransition({transition:q,name:"axis-update",animate:t}))),f=f.call(k),mt.selectAll(".tick").data(k.tickValues(),d).order().select("text").attr("class",(q,J)=>cf(q,J,k.tickValues(),K,et)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call(k):f=f.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(k);if(v.call(k),n===G.BOTTOM||n===G.TOP){let K=!1;const et=x(m,"ticks","rotation");if(et===Ri.ALWAYS)K=!0;else if(et===Ri.NEVER)K=!1;else if(!et||et===Ri.AUTO)if(d.step)K=v.selectAll("g.tick text").nodes().some(mt=>N.getSVGElementSize(mt,{useBBox:!0}).width>=d.step());else{K=!1;const mt=v.append("text").text("A"),q=N.getSVGElementSize(mt.node(),{useBBox:!0}).width;let J;v.selectAll("g.tick").each(function(){const dt=D(this),z=parseFloat(x(Cn(this),"tx"));z!==null&&J+dt.text().length*q*.8>=z&&(K=!0),J=z}),mt.remove()}K?($||(k.ticks(this.getNumberOfFittingTicks(a,_,qn.ticks.horizontalSpaceRatio)),v.call(k),f.call(k)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===G.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(E?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",K=>K),v.selectAll("g.tick").attr("aria-label",K=>K),I!==Ue.NONE&&T===tt.LABELS&&!A){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const mt=this;l.selectAll("g.tick text").data(K).text(function(q){return q.length>L?(mt.truncation[n]=!0,us(q,I,R)):q}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(q){return q.length>L?us(q,I,R):q}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOVER,{event:c,element:D(this),datum:u}),a===tt.LABELS&&u.length>o&&l.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),a===tt.LABELS&&u.length>o&&l.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),a===tt.LABELS&&l.services.events.dispatchEvent(S.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 Tm(i,2,qn.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 mR extends dv{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=D(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 G.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case G.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case G.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,s.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case G.BOTTOM:p=-(u/2),f=d/2-2,s.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-qn.hover.rectanglePadding).attr("y",f).attr("width",u+qn.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=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===tt.LABELS&&d.length>o&&l.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_CLICK,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),a===tt.LABELS&&l.services.events.dispatchEvent(S.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(S.Axis.LABEL_FOCUS,{event:{...c,...u},element:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(S.Tooltip.HIDE),l.services.events.dispatchEvent(S.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})),n===G.LEFT||n===G.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 Se extends yt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=rt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(G),i=x(this.getOptions(),"axes");r.forEach(a=>{i[G[a]]&&(n[G[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=G[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Ii.DEFAULT?new dv(this.model,this.services,l):new mR(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===G.LEFT||l===G.RIGHT)&&(h+=5)),l){case G.TOP:s.top=d+h;break;case G.BOTTOM:s.bottom=d+h;break;case G.LEFT:s.left=u+h;break;case G.RIGHT:s.right=u+h;break}}),this.services.events.dispatchEvent(S.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(S.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class xe extends yt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=x(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===te.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===te.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===te.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===te.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===Qt.VERTICAL&&this.drawYGrid(t),n===Qt.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=en().domain([0,1]).range(t),this.yScale=en().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=x(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=x(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=x(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ds().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Ht.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+Ht.xOffset;c===Jt.CENTER?f=s/2:c===Jt.RIGHT&&(f=s-t-Ht.xOffset);const v=t+Ht.yOffset;p.attr("transform",`translate(${f}, ${v})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Ht.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
|
-
<stop class="${n}" offset="${
|
|
67
|
-
<stop class="${r}" offset="${
|
|
68
|
-
<stop class="${n}" offset="${
|
|
69
|
-
`;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(tA).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class gR extends yt{constructor(){super(...arguments),this.type="boxplot",this.renderType=rt.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,v=f.getOrientation(),m=v===Qt.VERTICAL,[y,g]=An($=>this.services.cartesianScales.getDomainValue($),$=>this.services.cartesianScales.getRangeValue($),v),b=Math.floor((m?h:p)/s.length),T=Math.min(b/2,16),E=this.model.getBoxplotData(),O=n.selectAll(".box-group").data(E);O.exit().remove();const A=O.enter().append("g").attr("class","box-group"),I=O.merge(A);A.append("path").merge(O.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ge.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalstartline",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i]),P=F,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.quartiles.q_25);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(O.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ge.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalendline",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i]),P=F,H=f.getRangeValue($.whiskers.max),_=f.getRangeValue($.quartiles.q_75);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(O.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],originalClassName:"box"})).attr("fill-opacity",Ge.box.opacity.default).attr("stroke-width",Ge.strokeWidth.default).attr("role",pt.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 F=f.getDomainValue($[i])-T/2,P=F+T,H=f.getRangeValue(Math[m?"max":"min"]($.quartiles.q_75,$.quartiles.q_25)),_=H+Math.abs(f.getRangeValue($.quartiles.q_75)-f.getRangeValue($.quartiles.q_25));return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(O.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",$=>{const F=f.getDomainValue($[i])-T/2,P=F+T,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.whiskers.max);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(O.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ge.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-startingwhisker",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i])-T/4,P=F+T/2,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.whiskers.min);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(O.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-median",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i])-T/2,P=F+T,H=f.getRangeValue($.quartiles.q_50);return me({x0:F,x1:P,y0:H,y1:H},v)}),A.append("path").merge(O.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ge.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-endingwhisker",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i])-T/4,P=F+T/2,H=f.getRangeValue($.whiskers.max),_=f.getRangeValue($.whiskers.max);return me({x0:F,x1:P,y0:H,y1:_},v)});const L=I.selectAll("circle.outlier").data($=>$.outliers.map(F=>({min:$.whiskers.min,max:$.whiskers.max,[i]:$[i],value:F})));L.exit().remove();const R=L.enter().append("circle");L.merge(R).attr("r",Ge.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ge.circle.opacity.default).attr("cx",y).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-circles",animate:t})).attr("cy",g),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=D(this);D(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ge.box.opacity.hovered),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[at.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(S.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=D(this);t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(S.Boxplot.BOX_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ge.box.opacity.default),t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(S.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=D(this);o.classed("hovered",!0).attr("fill-opacity",Ge.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=D(this);t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(S.Boxplot.OUTLIER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1).attr("fill-opacity",Ge.circle.opacity.default),t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class Ti extends yt{constructor(){super(...arguments),this.type="zero-line",this.renderType=rt.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=Kp({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 vR extends xn{constructor(){super(...arguments),this.type="bubble",this.renderType=rt.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?Qe(s):[1,1];return en().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]=An(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",pt.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:[at.FILL,at.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=x(this.getOptions(),"bubble");return[{label:x(n,"radiusLabel"),value:t[x(n,"radiusMapsTo")]}]}}class yR extends yt{constructor(){super(...arguments),this.type="bullet",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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 v=[];s.forEach(y=>{y.ranges?y.ranges.forEach((g,b)=>{g!=null&&g<u&&v.push({datum:y,value:g,order:b+1})}):v.push({datum:y,order:1})});const m=N.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(v,y=>`${y[r]}-${y.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`range-box order-${y.order}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-range-box-update-enter",animate:t})).attr("d",y=>{let g,b,T,E;return y.order===1?(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,b=g+16,T=c-2,E=l+1):(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,b=g+16,T=this.services.cartesianScales.getRangeValue(y.value),E=c),me({x0:g,x1:b,y0:T,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const v=N.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).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:[at.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const y=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[y],m)}).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-4,g=y+8,b=this.services.cartesianScales.getRangeValue(0)+1,T=this.services.cartesianScales.getRangeValue(m);return me({x0:y,x1:g,y0:b,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const v=N.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>x(m,"marker")!==null),m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-12,g=y+24,b=this.services.cartesianScales.getRangeValue(m.marker);return me({x0:y,x1:g,y0:b,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let v=[];s.filter(y=>x(y,"marker")!==null).forEach(y=>{const g=y.marker,b=y[o];v=v.concat([{datum:y,value:g*.25,barValue:b},{datum:y,value:g*.5,barValue:b},{datum:y,value:g*.75,barValue:b}])});const m=N.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(v,y=>y[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`quartile ${y.value<=y.barValue?"over-bar":""}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:y,value:g})=>{let b=4;y.ranges&&y.ranges.indexOf(g)!==-1&&(b=8);const T=this.services.cartesianScales.getDomainValue(y)-b/2,E=T+b,O=this.services.cartesianScales.getRangeValue(g);return me({x0:T,x1:E,y0:O,y1:O},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}=x(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=D(this);c.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=x(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[at.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(S.Bar.BAR_MOUSEMOVE,{event:o,element:D(this),datum:l}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:o,element:D(this),datum:l})}).on("mouseout",function(o,l){const c=D(this);c.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function xR(e){return e}function bR(e){if(e==null)return xR;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 _R(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function ER(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return pv(e,n)})}:pv(e,t)}function pv(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=qu(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 qu(e,t){var n=bR(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&&_R(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 TR(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 v=f===p?p:p.concat(f);r[v.start=p.start]=i[v.end=f.end]=v}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 OR(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 SR(e){return qu(e,wR.apply(this,arguments))}function wR(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 OR(qu(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(v){v.forEach(function(m){m.forEach(function(y){n[y<0?~y:y].length<2&&c.push(y)})})}),c=TR(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 $R extends Jn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=rt.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===Qt.VERTICAL?n:r),p=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=N.appendOrSelect(p,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(Et(m,"data.x0"))<=h&&parseFloat(Et(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Om(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=D(v.nodes()[0]).datum(),y=parseFloat(Et(m,"data.x0")),g=parseFloat(Et(m,"data.x1")),b=this.model.getActiveDataGroupNames(),T=b.reverse().map(E=>({label:E,value:Et(m,`data.${E}`),class:this.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:E})})).filter(E=>E.value!==0);if(T.length>0){this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:f,items:[{label:Et(s,"bins.rangeLabel")||"Range",value:`${y} – ${g}`},...T,...x(s,"tooltip","showTotal")===!0?[{label:Et(s,"locale.translations.total")||Et(s,"tooltip.totalLabel")||"Total",value:b.reduce((O,A)=>O+parseFloat(Et(m,`data.${A}`)),0)}]:[]]}),p.attr("opacity",1);const E=d((y+g)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",E).attr("y2",E):f.attr("y1",u).attr("y2",c).attr("x1",E).attr("x2",E)}else this.hideRuler()}else this.hideRuler()}}class No extends Jn{formatTooltipData(t){return t.reverse()}}const MR=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=Nm();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},CR={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},AR={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},kR={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},LR={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},RR={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},DR={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class fv extends Hu{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=rt.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=x(this.getOptions(),"data","loading");if(s>qt.color.barWidth&&!a){const o=x(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(S.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=x(n,"color","gradient","colors"),a=x(n,this.chartType,"colorLegend","type");let o=x(n,"color","pairing","option");const l=x(n,"heatmap","colorLegend","title");if(x(this.getOptions(),"data","loading")){r.html("");return}const c=!Ke(s),u=hf(this.model.getDisplayData()),d=!(i<=qt.color.barWidth),h=d?qt.color.barWidth:i,p=N.appendOrSelect(r,"g.legend"),f=N.appendOrSelect(p,"g.legend-axis");if(l){const L=N.appendOrSelect(r,"g.legend-title");N.appendOrSelect(L,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const v=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&v==="mono"||o<1&&o>2&&v==="diverge")&&(o=1);let m=[];const y=v==="diverge"?17:11;if(c)m=s;else for(let L=1;L<y+1;L++)m.push(a===Di.LINEAR?`stop-color-${v}-${o}-${L}`:`fill-${v}-${o}-${L}`);const g=Ae(u[0],u[1]),b=JC(g,3),T=en().domain(u).range([0,h]),E=Wc(T).tickSize(0).tickValues(b),{code:O,number:A}=x(n,"locale");E.tickFormat(L=>A(L,O));let I;switch(a){case Di.LINEAR:this.drawLinear(m,p,h);break;case Di.QUANTIZE:I=this.drawQuantize(m,v,c,p,h),T.range([I,h]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${qt.color.axisYTranslation})`).call(E),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",qt.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=ps().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",qt.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(S.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class IR extends Vs{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=x(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(x(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=x(n,"meter","proportional","total"),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=x(n,"meter","proportional","breakdownFormatter"),{code:h,number:p}=x(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=x(n,"meter","proportional","total"),i=r?x(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"",a=x(n,"meter","proportional","totalFormatter"),{code:o,number:l}=x(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-ae.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=ae.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=x(this.model.getDisplayData(),0,"value"),{code:n,number:r}=x(this.getOptions(),"locale"),i=this.getComponentContainer(),s=N.appendOrSelect(i,"text.meter-title"),a=x(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=ae.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=ae.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=x(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-ae.total.paddingLeft}else{const r=N.appendOrSelect(this.parent,"text.percent-value"),i=ae.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=N.appendOrSelect(this.parent,"g.status-indicator").node(),o=N.getSVGElementSize(a,{useBBox:!0}).width+ae.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case Li.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 Li.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Li.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 yt{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=x(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 NR extends yt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=rt.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:ri.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=x(l,"canvasZoom","enabled");a&&x(s,0,"children")&&(s=x(s,0,"children"));const u=ks({children:s}).sum(f=>f.value).sort((f,v)=>v.value-f.value),d=jk().size([r,i]).padding(f=>f.depth>=1?ri.padding.children+3:ri.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 v=c&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${v}`:`node node-leaf ${v}`})}).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",ri.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,ni),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",ri.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){D(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=D(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,ni)})}getZoomIcon(){return`
|
|
65
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Ge extends Ot{constructor(){super(...arguments),this.type="grid",this.renderType=ut.SVG}render(t=!0){const n=_(this.getOptions(),"grid","x","enabled"),r=_(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(U.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(U.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(),a=mu(i).tickSizeInner(-r).tickSizeOuter(0);if(_(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=_(this.getOptions(),"axes",o,"ticks","values");l&&a.tickValues(l)}else{const o=_(this.getOptions(),"grid","x","numberOfTicks");a.ticks(o)}const s=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(a):s.call(a),this.cleanGrid(s)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),a=ag(i).tickSizeInner(-r).tickSizeOuter(0);if(_(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=_(this.getOptions(),"axes",o,"ticks","values");l&&a.tickValues(l)}else{const o=_(this.getOptions(),"grid","y","numberOfTicks");a.ticks(o)}const s=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(a):s.call(a),this.cleanGrid(s)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Hn(u).tx)-Number(Hn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Hn(u).tx&&i++});const a=i+1<r.length?i+1:r.length,s=r[i],o=r[a];let l;if(!s)l=+Hn(o).tx;else if(o)l=+Hn(o).tx-+Hn(s).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=U.getSVGElementSize(u).width-+Hn(s).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=_(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=Hn(this),a={min:Number(i.tx)-r,max:Number(i.tx)+r};return a.min<=t[0]&&t[0]<=a.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),a=this.services.cartesianScales.getMainYScale(),[s,o]=i.range(),[l,c]=a.range();this.backdrop=U.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=U.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",s).attr("y",c).attr("width",Math.abs(o-s)).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 Fv extends Ot{constructor(){super(...arguments),this.type="area",this.renderType=ut.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?Un.opacity.unselected:Un.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",Un.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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:a}=this.services,s=a.getOrientation(),o=th().curve(this.services.curves.getD3Curve()).defined(E=>{const S=a.getRangeIdentifier();return E[S]!=null}),l=this.model.getGroupedData(this.configs.groups),c=_(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=(E,S)=>{_(r,"axes",E,"includeZero")===!1&&S[0]>0&&S[1]>0&&(d=S[0])},p=E=>u?a.getBoundedScaledValues(E)[0]:a.getRangeValue(d),f=E=>u?a.getBoundedScaledValues(E)[1]:a.getRangeValue(E);s===re.VERTICAL?(i=a.getMainYScale().domain(),h(a.getMainYAxisPosition(),i),o.x(E=>a.getDomainValue(E)).y0(E=>p(E)).y1(E=>f(E))):(i=a.getMainXScale().domain(),h(a.getMainXAxisPosition(),i),o.x0(E=>p(E)).x1(E=>f(E)).y(E=>a.getDomainValue(E)));const g=_(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 y=n.selectAll("path.area").data(l,E=>E.name),v=P(this.services.domUtils.getMainContainer());if(y.exit().attr("opacity",0).remove(),!l.length)return;if(m){const E=v.select(`path.${this.model.getColorClassName({classNameTypes:[dt.STROKE],dataGroupName:l[0].name})}`).node();let S;if(E)S=getComputedStyle(E,null).getPropertyValue("stroke");else{const L=_(this.model.getOptions(),"color","scale");if(L!==null){const N=Object.keys(L);S=L[N[0]]}}pu.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:pu.getStops(i,S)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const x=this,T=y.enter().append("path");m?T.merge(y).style("fill",E=>`url(#${this.services.domUtils.generateElementIDString(`${E.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[dt.FILL],dataGroupName:E.name,originalClassName:"area"})).attr("d",E=>{const{data:S}=E;return o(S)}):(T.attr("opacity",0).merge(y).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[dt.FILL,dt.STROKE],dataGroupName:E.name,originalClassName:"area"})).style("fill",E=>x.model.getFillColor(E.name,null,E.data)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"area-update-enter",animate:t})).attr("opacity",u?1:Un.opacity.selected).attr("d",E=>{const{data:S}=E;return o(S)}),u&&T.attr("fill-opacity",Un.opacity.selected).style("stroke",E=>x.model.getStrokeColor(E.name,null,E.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ri extends Ot{constructor(){super(...arguments),this.type="line",this.renderType=ut.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?Bn.opacity.unselected:Bn.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",Bn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,a=p=>r.getDomainValue(p),s=p=>r.getRangeValue(p),[o,l]=Vn(a,s,r.getOrientation()),c=this.getOptions(),u=Ka().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),y=this.services.cartesianScales.getRangeIdentifier(g);return{name:_(g,0,f),data:g.map(v=>({[m]:v.data.sharedStackKey,[f]:v[f],[y]:v[1]})),hidden:!jA(g,v=>v[0]!==v[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:[dt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",yt.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Gv=5;function yD(e,t){return e>t-Gv&&e<t+Gv}class cr extends Ot{constructor(){super(...arguments),this.type="ruler",this.renderType=ut.SVG,this.isXGridEnabled=_(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=_(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=_(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,a=this.services.cartesianScales.getOrientation(),s=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=a===re.HORIZONTAL?r:n,d=U.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=U.appendOrSelect(d,"line.ruler-line"),p=i.selectAll("[role=graphics-symbol]"),f=s.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>yD(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(w.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const g=this.pointsWithinLine.reduce((m,y)=>{if(m.length===0)return m.push(y),m;const v=m[0].domainValue,x=Math.abs(u-y.domainValue),T=Math.abs(u-v);return x>T||(x<T?m=[y]:m.push(y)),m},[]);if(g.length>0){const m=g.map(T=>T.originalData).filter(T=>{const E=this.services.cartesianScales.getRangeIdentifier(T);return T[E]!=null}),y=g.map(T=>T.domainValue),v=p.filter(T=>{const E=this.services.cartesianScales.getDomainValue(T);return y.includes(E)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!ng(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v,this.services.events.dispatchEvent(w.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const x=g[0];a==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",x.domainValue).attr("y2",x.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",x.domainValue).attr("x2",x.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=U.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(w.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(a){const s=$r(a,t.parent.node());t.showRuler(a,s)};if(r.length>100){const a=r.length%50*12.5;i=v$(function(s){const{mousePosition:o}=this;t.showRuler(s,o)},a,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=U.appendOrSelect(t,"svg.chart-grid-backdrop")}}let An=class extends Ot{constructor(){super(...arguments),this.type="scatter",this.renderType=ut.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 a;return(a=this.services.transitions)==null?void 0:a.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(w.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(w.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(a=>a[r].getTime()>=i[0].getTime()&&a[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(a=>t.axes[a].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(a=>{const s=i.getRangeIdentifier(a);return a[s]!==void 0&&a[s]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(_(this.getOptions(),"points","enabled")||_(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const s=a.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[s]}`);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(),[a,s]=Vn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Vn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return s&&a?u<=s.scaleValue&&c>=a.scaleValue:s?u<=s.scaleValue:a?c>=a.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:a}=r.points,{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=p=>s.getDomainValue(p),c=p=>s.getRangeValue(p),[u,d]=Vn(l,c,s.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=s.getDomainIdentifier(p),g=this.model.getIsFilled(p[o],p[f],p,i)?[dt.FILL,dt.STROKE]:[dt.STROKE];return this.model.getColorClassName({classNameTypes:g,dataGroupName:p[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",p=>this.isDatapointThresholdAnomaly(p)).classed("filled",p=>{const f=s.getDomainIdentifier(p);return this.model.getIsFilled(p[o],p[f],p,i)}).classed("unfilled",p=>{const f=s.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=s.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=s.getDomainIdentifier(p);return this.model.getStrokeColor(p[o],p[f],p)}).attr("fill-opacity",i?a:1).attr("opacity",h?0:1).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",p=>{const f=s.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 a,s;const o=P(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[dt.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),(a=t.services.events)==null||a.dispatchEvent(w.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(s=t.services.events)==null||s.dispatchEvent(w.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var a,s;const o=P(this);(a=t.services.events)==null||a.dispatchEvent(w.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(s=t.services.events)==null||s.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var a;(a=t.services.events)==null||a.dispatchEvent(w.Scatter.SCATTER_CLICK,{event:r,element:P(this),datum:i})}).on("mouseout",function(r,i){var a,s,o;const l=P(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.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)}(s=t.services.events)==null||s.dispatchEvent(w.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(w.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(w.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}};class zv extends Ot{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=ut.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=_(r,"axes",n,"visible"),a=this.getComponentContainer({ariaLabel:"axes"}),{width:s,height:o}=U.getSVGElementSize(a,{useAttrs:!0}),l=U.appendOrSelect(a,`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]?s-this.margins.right:s):(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===lt.LABELS||this.scaleType===lt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case Z.LEFT:h=ag;break;case Z.BOTTOM:h=mu;break;case Z.RIGHT:h=tk;break;case Z.TOP:h=JA;break}l.attr("aria-label",`${n} axis`);const p=!l.select("g.ticks").empty();let f=U.appendOrSelect(l,"g.ticks");p||(f.attr("role",`${yt.GRAPHICS_OBJECT} ${yt.GROUP}`),f.attr("aria-label",`${n} ticks`));const g=U.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=_(r,"axes",n),y=this.scaleType===lt.TIME||m.scaleType===lt.TIME,v=n===Z.LEFT||n===Z.RIGHT,x=this.model.get("zoomDomain");if(x&&y&&!v&&d.domain(x),!i){f.attr("aria-hidden",!0);return}const T=_(m,"scaleType"),E=_(r,"data","loading"),S=_(m,"ticks","number"),L=_(m,"ticks","values"),N=_(m,"truncation","type"),D=_(m,"truncation","threshold"),I=_(m,"truncation","numCharacter"),M=S!==null,q=_(r,"timeScale"),H=U.appendOrSelect(g,"g.tick"),G=U.appendOrSelect(H,"text").text("0"),O=U.getSVGElementSize(G.node(),{useBBox:!0}).height;H.remove();const k=this.scaleType||m.scaleType||lt.LINEAR,$=h(d).tickSizeOuter(0);if(d.ticks){let K;if(M?K=S:(K=rr.ticks.number,v&&(K=this.getNumberOfFittingTicks(o,O,rr.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),$.ticks(K),y)if(!d.ticks(K).length)$.tickValues([]);else{const nt=_(r,"timeScale","addSpaceOnEdges"),ht=_(r,"axes",n,"domain"),W=d.copy();nt&&!ht&&W.nice(K);const it=W.ticks(K);nt&&it.length>2&&!ht&&(it.splice(it.length-1,1),it.splice(0,1)),$.tickValues(it)}}let B;const F=_(m,"ticks","formatter"),{code:et,number:C}=_(r,"locale");if(y){const K=Wc($.tickValues(),_(r,"timeScale","timeInterval"));F===null?B=(nt,ht)=>jc(nt,ht,$.tickValues(),K,q,r.locale):B=(nt,ht)=>{const W=jc(nt,ht,$.tickValues(),K,q,r.locale);return F(nt,ht,W)}}else F===null?k===lt.LINEAR&&(B=K=>C(K,et)):B=F;$.tickFormat(B);const[z,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let at;if(L){if(y)L.forEach((K,nt)=>{K.getTime===void 0&&(L[nt]=new Date(K))}),at=L.filter(K=>{const nt=K.getTime();return nt>=new Date(z).getTime()&&nt<=new Date(Q).getTime()});else if(T===lt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();at=L.filter(nt=>K.includes(nt))}else at=L.filter(K=>K>=z&&K<=Q);$.tickValues(at)}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(${s-this.margins.right}, 0)`);break;case Z.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const tt=this.model.isDataEmpty();if(m.title){const K=U.appendOrSelect(l,"text.axis-title").html(tt||E?"":Cn(m.title)),nt=_(m,"titleOrientation");let ht;switch(n){case Z.LEFT:nt===ms.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.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:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case Z.RIGHT:nt===ms.LEFT?K.attr("transform","rotate(-90)").attr("y",s).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-s).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case Z.TOP:ht=U.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(y){const K=Wc($.tickValues(),_(r,"timeScale","timeInterval")),nt=q.showDayName,ht=f;t&&(f=f.transition().call(W=>this.services.transitions.setupTransition({transition:W,name:"axis-update",animate:t}))),f=f.call($),ht.selectAll(".tick").data($.tickValues(),d).order().select("text").attr("class",(W,it)=>Vf(W,it,$.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call($):f=f.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call($);if(g.call($),n===Z.BOTTOM||n===Z.TOP){let K=!1;const nt=_(m,"ticks","rotation");if(nt===Zi.ALWAYS)K=!0;else if(nt===Zi.NEVER)K=!1;else if(!nt||nt===Zi.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(ht=>U.getSVGElementSize(ht,{useBBox:!0}).width>=d.step());else{K=!1;const ht=g.append("text").text("A"),W=U.getSVGElementSize(ht.node(),{useBBox:!0}).width;let it;g.selectAll("g.tick").each(function(){const gt=P(this),X=parseFloat(_(Hn(this),"tx"));X!==null&&it+gt.text().length*W*.8>=X&&(K=!0),it=X}),ht.remove()}K?(M||($.ticks(this.getNumberOfFittingTicks(s,O,rr.ticks.horizontalSpaceRatio)),g.call($),f.call($)),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(E?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),N!==We.NONE&&T===lt.LABELS&&!L){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=a.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const ht=this;l.selectAll("g.tick text").data(K).text(function(W){return W.length>D?(ht.truncation[n]=!0,wa(W,N,I)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>D?wa(W,N,I):W}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=U.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),a=_(i,"axes",n),s=_(a,"scaleType"),o=_(a,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOVER,{event:c,element:P(this),datum:u}),s===lt.LABELS&&u.length>o&&l.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,hoveredElement:P(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEMOVE,{event:c,element:P(this),datum:u}),s===lt.LABELS&&u.length>o&&l.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_CLICK,{event:c,element:P(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOUT,{event:c,element:P(this),datum:u}),s===lt.LABELS&&l.services.events.dispatchEvent(w.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 eg(i,2,rr.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;U.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class bD extends zv{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=U.appendOrSelect(r,`g.axis.${n}`),a=this;i.selectAll("g.tick").each(function(s,o){const l=P(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=U.getSVGElementSize(c,{useBBox:!0}),h=U.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,a.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case Z.BOTTOM:p=-(u/2),f=d/2-2,a.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-rr.hover.rectanglePadding).attr("y",f).attr("width",u+rr.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=U.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),a=_(i,"axes",n),s=_(a,"scaleType"),o=_(a,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=P(this).select("text"),d=u.datum();l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),s===lt.LABELS&&d.length>o&&l.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=P(this).select("text"),d=u.datum();l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(w.Axis.LABEL_CLICK,{event:c,element:P(this).select("text"),datum:P(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOUT,{event:c,element:P(this).select("text"),datum:P(this).select("text").datum()}),s===lt.LABELS&&l.services.events.dispatchEvent(w.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(w.Axis.LABEL_FOCUS,{event:{...c,...u},element:P(this),datum:P(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(w.Axis.LABEL_BLUR,{event:c,element:P(this),datum:P(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(w.Tooltip.HIDE),l.services.events.dispatchEvent(w.Axis.LABEL_BLUR,{event:c,element:P(this),datum:P(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;U.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 Re extends Ot{constructor(){super(...arguments),this.type="2D-axes",this.renderType=ut.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=_(this.getOptions(),"axes");r.forEach(s=>{i[Z[s]]&&(n[Z[s]]=!0)}),this.configs.axes=n,r.forEach(s=>{const o=Z[s];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Ki.DEFAULT?new zv(this.model,this.services,l):new bD(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(s=>{this.children[s].render(t)});const a={};Object.keys(this.children).forEach(s=>{const o=this.children[s],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:d}=U.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=U.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===Z.LEFT||l===Z.RIGHT)&&(h+=5)),l){case Z.TOP:a.top=d+h;break;case Z.BOTTOM:a.bottom=d+h;break;case Z.LEFT:a.left=u+h;break;case Z.RIGHT:a.right=u+h;break}}),this.services.events.dispatchEvent(w.Axis.RENDER_COMPLETE),Object.keys(a).some(s=>this.margins[s]!==a[s])&&(this.margins=Object.assign(this.margins,a),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(w.ZoomBar.UPDATE),Object.keys(this.children).forEach(s=>{const o=this.children[s];o.margins=this.margins}),this.render(!0))}}class $e extends Ot{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=_(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===ae.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===ae.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===ae.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===ae.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===re.VERTICAL&&this.drawYGrid(t),n===re.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=hn().domain([0,1]).range(t),this.yScale=hn().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=U.getSVGElementSize(n,{useAttrs:!0});this.backdrop=U.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const a=U.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");a.attr("width","100%").attr("height","100%");const[s]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(a).attr("x",s).attr("y",o),a.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=_(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),a=U.appendOrSelect(this.backdrop,"g.x.skeleton"),s=a.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),a.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=_(this.getOptions(),"grid","y","numberOfTicks"),a=this.xScale.ticks(i).map(l=>l*n),s=U.appendOrSelect(this.backdrop,"g.y.skeleton"),o=s.selectAll("line").data(a);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),s.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:a,height:s}=U.getSVGElementSize(i,{useAttrs:!0}),o=U.appendOrSelect(i,"svg.chart-skeleton").attr("width",a).attr("height",s),l=n===0?"pie":"donut",c=_(this.getOptions(),l,"alignment");U.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",a).attr("height",s).attr("fill","none");const u=Xa().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Ft.radiusOffset),h=t+(Math.min(a,s)-t*2)/2,p=U.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+Ft.xOffset;c===ie.CENTER?f=a/2:c===ie.RIGHT&&(f=a-t-Ft.xOffset);const g=t+Ft.yOffset;p.attr("transform",`translate(${f}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=U.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Ft.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:a}=U.getSVGElementSize(this.parent,{useAttrs:!0}),s=0,o=a,l=U.appendOrSelect(i,"defs").lower(),c=U.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",s-3*.2*a).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
|
|
66
|
+
<stop class="${n}" offset="${s}"></stop>
|
|
67
|
+
<stop class="${r}" offset="${s+.2}"></stop>
|
|
68
|
+
<stop class="${n}" offset="${s+2*.2}"></stop>
|
|
69
|
+
`;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${s-3*.2*a}, 0)`).transition().duration(2e3).delay(1e3).ease(ik).attr("gradientTransform",`translate(${o+3*.2*a}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class _D extends Ot{constructor(){super(...arguments),this.type="boxplot",this.renderType=ut.SVG}render(t){const n=this.getComponentContainer({ariaLabel:"box plots",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.model.getDataGroupNames(),s=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=s.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===re.VERTICAL,[y,v]=Vn(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),g),x=Math.floor((m?h:p)/a.length),T=Math.min(x/2,16),E=this.model.getBoxplotData(),S=n.selectAll(".box-group").data(E);S.exit().remove();const L=S.enter().append("g").attr("class","box-group"),N=S.merge(L);L.append("path").merge(S.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[dt.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ke.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const q=f.getDomainValue(M[i]),H=q,G=f.getRangeValue(M.whiskers.min),O=f.getRangeValue(M.quartiles.q_25);return Oe({x0:q,x1:H,y0:G,y1:O},g)}),L.append("path").merge(S.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[dt.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ke.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const q=f.getDomainValue(M[i]),H=q,G=f.getRangeValue(M.whiskers.max),O=f.getRangeValue(M.quartiles.q_75);return Oe({x0:q,x1:H,y0:G,y1:O},g)}),L.append("path").merge(S.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[dt.FILL,dt.STROKE],originalClassName:"box"})).attr("fill-opacity",Ke.box.opacity.default).attr("stroke-width",Ke.strokeWidth.default).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",M=>M[i]).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-quartiles",animate:t})).attr("d",M=>{const q=f.getDomainValue(M[i])-T/2,H=q+T,G=f.getRangeValue(Math[m?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),O=G+Math.abs(f.getRangeValue(M.quartiles.q_75)-f.getRangeValue(M.quartiles.q_25));return Oe({x0:q,x1:H,y0:G,y1:O},g)}),L.append("path").merge(S.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const q=f.getDomainValue(M[i])-T/2,H=q+T,G=f.getRangeValue(M.whiskers.min),O=f.getRangeValue(M.whiskers.max);return Oe({x0:q,x1:H,y0:G,y1:O},g)}),L.append("path").merge(S.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[dt.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ke.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const q=f.getDomainValue(M[i])-T/4,H=q+T/2,G=f.getRangeValue(M.whiskers.min),O=f.getRangeValue(M.whiskers.min);return Oe({x0:q,x1:H,y0:G,y1:O},g)}),L.append("path").merge(S.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[dt.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-median",animate:t})).attr("d",M=>{const q=f.getDomainValue(M[i])-T/2,H=q+T,G=f.getRangeValue(M.quartiles.q_50);return Oe({x0:q,x1:H,y0:G,y1:G},g)}),L.append("path").merge(S.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[dt.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ke.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const q=f.getDomainValue(M[i])-T/4,H=q+T/2,G=f.getRangeValue(M.whiskers.max),O=f.getRangeValue(M.whiskers.max);return Oe({x0:q,x1:H,y0:G,y1:O},g)});const D=N.selectAll("circle.outlier").data(M=>M.outliers.map(q=>({min:M.whiskers.min,max:M.whiskers.max,[i]:M[i],value:q})));D.exit().remove();const I=D.enter().append("circle");D.merge(I).attr("r",Ke.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[dt.FILL,dt.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ke.circle.opacity.default).attr("cx",y).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",v),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,a){const s=P(this);P(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ke.box.opacity.hovered),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:s,items:[{label:_(n,"locale","translations","group")||_(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[dt.TOOLTIP]})},{label:"Minimum",value:a.whiskers.min},{label:"Q1",value:a.quartiles.q_25},{label:"Median",value:a.quartiles.q_50},{label:"Q3",value:a.quartiles.q_75},{label:"Maximum",value:a.whiskers.max},{label:"IQR",value:a.quartiles.q_75-a.quartiles.q_25}]}),t.services.events.dispatchEvent(w.Boxplot.BOX_MOUSEOVER,{event:i,element:s,datum:a})}).on("mousemove",function(i,a){const s=P(this);t.services.events.dispatchEvent(w.Boxplot.BOX_MOUSEMOVE,{event:i,element:s,datum:a}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,a){t.services.events.dispatchEvent(w.Boxplot.BOX_CLICK,{event:i,element:P(this),datum:a})}).on("mouseout",function(i,a){const s=P(this);P(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ke.box.opacity.default),t.services.events.dispatchEvent(w.Boxplot.BOX_MOUSEOUT,{event:i,element:s,datum:a}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:s})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(a,s){const o=P(this);o.classed("hovered",!0).attr("fill-opacity",Ke.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:_(n,"locale","translations","group")||_(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[dt.TOOLTIP]})},{label:"Outlier",value:s[i]}]}),t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEOVER,{event:a,element:o,datum:s})}).on("mousemove",function(a,s){const o=P(this);t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEMOVE,{event:a,element:o,datum:s}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:a})}).on("click",function(a,s){t.services.events.dispatchEvent(w.Boxplot.OUTLIER_CLICK,{event:a,element:P(this),datum:s})}).on("mouseout",function(a,s){const o=P(this);o.classed("hovered",!1).attr("fill-opacity",Ke.circle.opacity.default),t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEOUT,{event:a,element:o,datum:s}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class Li extends Ot{constructor(){super(...arguments),this.type="zero-line",this.renderType=ut.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,a]=r.domain(),s=i>0&&a<0||i<0&&a>0,o=this.getComponentContainer({isPresentational:!0});if(!s){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=Af({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());U.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 xD extends An{constructor(){super(...arguments),this.type="bubble",this.renderType=ut.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),a=i.map(c=>c[r]).filter(c=>c),s=U.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=a.length>0,l=o?ln(a):[1,1];return hn().domain(l).range(o?n.bubble.radiusRange(s,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,a=this.getRadiusScale(t),{groupMapsTo:s}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=Vn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",yt.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=>a(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[dt.FILL,dt.STROKE],dataGroupName:h[s],originalClassName:"dot"})).style("fill",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[s],h[p],h)}).style("stroke",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[s],h[p],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=_(this.getOptions(),"bubble");return[{label:_(n,"radiusLabel"),value:t[_(n,"radiusMapsTo")]}]}}class ED extends Ot{constructor(){super(...arguments),this.type="bullet",this.renderType=ut.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bullet graphs",withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=s.range(),[,u]=s.domain(),d=()=>{const g=[];a.forEach(y=>{y.ranges?y.ranges.forEach((v,x)=>{v!=null&&v<u&&g.push({datum:y,value:v,order:x+1})}):g.push({datum:y,order:1})});const m=U.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,y=>`${y[r]}-${y.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`range-box order-${y.order}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-range-box-update-enter",animate:t})).attr("d",y=>{let v,x,T,E;return y.order===1?(v=this.services.cartesianScales.getDomainValue(y.datum)-16/2,x=v+16,T=c-2,E=l+1):(v=this.services.cartesianScales.getDomainValue(y.datum)-16/2,x=v+16,T=this.services.cartesianScales.getRangeValue(y.value),E=c),Oe({x0:v,x1:x,y0:T,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=U.appendOrSelect(i,"g.bars").selectAll("path.bar").data(a,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:[dt.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const y=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[y],m)}).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-4,v=y+8,x=this.services.cartesianScales.getRangeValue(0)+1,T=this.services.cartesianScales.getRangeValue(m);return Oe({x0:y,x1:v,y0:x,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const g=U.appendOrSelect(i,"g.markers").selectAll("path.marker").data(a.filter(m=>_(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 y=this.services.cartesianScales.getDomainValue(m)-12,v=y+24,x=this.services.cartesianScales.getRangeValue(m.marker);return Oe({x0:y,x1:v,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let g=[];a.filter(y=>_(y,"marker")!==null).forEach(y=>{const v=y.marker,x=y[o];g=g.concat([{datum:y,value:v*.25,barValue:x},{datum:y,value:v*.5,barValue:x},{datum:y,value:v*.75,barValue:x}])});const m=U.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,y=>y[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`quartile ${y.value<=y.barValue?"over-bar":""}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:y,value:v})=>{let x=4;y.ranges&&y.ranges.indexOf(v)!==-1&&(x=8);const T=this.services.cartesianScales.getDomainValue(y)-x/2,E=T+x,S=this.services.cartesianScales.getRangeValue(v);return Oe({x0:T,x1:E,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:a,number:s}=_(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=P(this);c.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=_(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:_(n,"locale","translations","group")||_(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[dt.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${s(Math.floor(l[i]/l.marker*100),a)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:o,element:P(this),datum:l}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:o,element:P(this),datum:l})}).on("mouseout",function(o,l){const c=P(this);c.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function OD(e){return e}function TD(e){if(e==null)return OD;var t,n,r=e.scale[0],i=e.scale[1],a=e.translate[0],s=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+a,d[1]=(n+=o[1])*i+s;c<u;)d[c]=o[c],++c;return d}}function SD(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function wD(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return jv(e,n)})}:jv(e,t)}function jv(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,a=gh(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:a}:r==null?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function gh(e,t){var n=TD(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&&SD(d,f)}function a(u){return n(u)}function s(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=s(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=a(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(a);break;case"LineString":h=s(u.arcs);break;case"MultiLineString":h=u.arcs.map(s);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 $D(e,t){var n={},r={},i={},a=[],s=-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[++s],t[s]=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}),a.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||a.push([c])}),a}function MD(e){for(var t=-1,n=e.length,r,i=e[n-1],a=0;++t<n;)r=i,i=e[t],a+=r[0]*i[1]-r[1]*i[0];return Math.abs(a)}function CD(e){return gh(e,AD.apply(this,arguments))}function AD(e,t){var n={},r=[],i=[];t.forEach(a);function a(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(a);break;case"Polygon":s(l.arcs);break;case"MultiPolygon":l.arcs.forEach(s);break}}function s(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 MD(gh(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(y){n[y<0?~y:y].length<2&&c.push(y)})})}),c=$D(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 kD extends cr{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=ut.SVG}showRuler(t,[n,r]){const i=this.parent,a=this.model.getOptions(),{cartesianScales:s}=this.services,o=s.getOrientation(),l=s.getRangeScale(),[c,u]=l.range(),d=s.getDomainScale(),h=d.invert(o===re.VERTICAL?n:r),p=U.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=U.appendOrSelect(p,"line.ruler-line"),g=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(wt(m,"data.x0"))<=h&&parseFloat(wt(m,"data.x1"))>=h)return!0});if(g.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!ng(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g;const m=P(g.nodes()[0]).datum(),y=parseFloat(wt(m,"data.x0")),v=parseFloat(wt(m,"data.x1")),x=this.model.getActiveDataGroupNames(),T=x.reverse().map(E=>({label:E,value:wt(m,`data.${E}`),class:this.model.getColorClassName({classNameTypes:[dt.TOOLTIP],dataGroupName:E})})).filter(E=>E.value!==0);if(T.length>0){this.services.events.dispatchEvent(w.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:f,items:[{label:wt(a,"bins.rangeLabel")||"Range",value:`${y} – ${v}`},...T,..._(a,"tooltip","showTotal")===!0?[{label:wt(a,"locale.translations.total")||wt(a,"tooltip.totalLabel")||"Total",value:x.reduce((S,L)=>S+parseFloat(wt(m,`data.${L}`)),0)}]:[]]}),p.attr("opacity",1);const E=d((y+v)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",E).attr("y2",E):f.attr("y1",u).attr("y2",c).attr("x1",E).attr("x2",E)}else this.hideRuler()}else this.hideRuler()}}class Xo extends cr{formatTooltipData(t){return t.reverse()}}const RD=(e,t)=>{const n=e.x,r=e.y,i=t.x,a=t.y,s=fg();return s.moveTo(n,r),s.lineTo(i,a),s.toString()},LD={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},DD={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},ID={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},ND={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},PD={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},UD={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class Wv extends ch{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=ut.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:a}=U.getSVGElementSize(i,{useAttrs:!0}),s=_(this.getOptions(),"data","loading");if(a>Yt.color.barWidth&&!s){const o=_(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}=U.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(w.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer({ariaLabel:"legend"}),{width:i}=U.getSVGElementSize(r,{useAttrs:!0}),a=_(n,"color","gradient","colors"),s=_(n,this.chartType,"colorLegend","type");let o=_(n,"color","pairing","option");const l=_(n,"heatmap","colorLegend","title");if(_(this.getOptions(),"data","loading")){r.html("");return}const c=!on(a),u=Gf(this.model.getDisplayData()),d=!(i<=Yt.color.barWidth),h=d?Yt.color.barWidth:i,p=U.appendOrSelect(r,"g.legend"),f=U.appendOrSelect(p,"g.legend-axis");if(l){const D=U.appendOrSelect(r,"g.legend-title");U.appendOrSelect(D,"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 y=g==="diverge"?17:11;if(c)m=a;else for(let D=1;D<y+1;D++)m.push(s===Xi.LINEAR?`stop-color-${g}-${o}-${D}`:`fill-${g}-${o}-${D}`);const v=Pe(u[0],u[1]),x=rk(v,3),T=hn().domain(u).range([0,h]),E=mu(T).tickSize(0).tickValues(x),{code:S,number:L}=_(n,"locale");E.tickFormat(D=>L(D,S));let N;switch(s){case Xi.LINEAR:this.drawLinear(m,p,h);break;case Xi.QUANTIZE:N=this.drawQuantize(m,g,c,p,h),T.range([N,h]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${Yt.color.axisYTranslation})`).call(E),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);U.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(a,s)=>`${s*i}%`).attr("class",(a,s)=>t[s]).attr("stop-color",a=>a),U.appendOrSelect(n,"rect").attr("width",r).attr("height",Yt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,a){!r&&n==="diverge"&&t.splice(t.length/2,1);const s=Ca().domain(t).range([0,a]);return U.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(s.domain()).join("rect").attr("x",o=>s(o)).attr("y",0).attr("width",Math.max(0,s.bandwidth()-1)).attr("height",Yt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?s.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(w.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class BD extends rs{constructor(){super(...arguments),this.type="meter-title",this.renderType=ut.SVG}render(t=!1){const n=_(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:a}=r.data,s=r.locale.translations.meter.title;if(_(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(s?[s]:[n[a]]);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=U.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=_(n,"meter","proportional","total"),a=_(n,"meter","proportional","unit")?_(n,"meter","proportional","unit"):"";let s;if(r===i)s=null;else{const u=i!==null?i-r:r,d=_(n,"meter","proportional","breakdownFormatter"),{code:h,number:p}=_(n,"locale");s=d!==null?d({datasetsTotal:r,total:i}):`${p(r,h)} ${a} used (${p(u,h)} ${a} available)`}const o=t.selectAll("text.proportional-meter-title").data([s]);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=U.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=_(n,"meter","proportional","total"),i=r?_(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),a=_(n,"meter","proportional","unit")?_(n,"meter","proportional","unit"):"",s=_(n,"meter","proportional","totalFormatter"),{code:o,number:l}=_(n,"locale"),c=s!==null?s(i):`${l(r,o)} ${a} total`,u=U.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-me.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=U.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),a=me.status.indicatorSize/2,s=U.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-a}, 0)`),o=i?[i]:[],l=s.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const c=s.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=_(this.model.getDisplayData(),0,"value"),{code:n,number:r}=_(this.getOptions(),"locale"),i=this.getComponentContainer(),a=U.appendOrSelect(i,"text.meter-title"),s=_(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(s),l=me.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+a.attr("x")+a.node().getComputedTextLength()+l).attr("y",a.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=U.appendOrSelect(this.parent,"tspan"),i=me.statusBar.paddingRight,a=Math.ceil(r.node().getComputedTextLength());U.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+a+i)}getMaxTitleWidth(){const t=_(this.getOptions(),"meter","proportional"),n=U.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=U.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=U.getSVGElementSize(r,{useBBox:!0}).width;return n-i-me.total.paddingLeft}else{const r=U.appendOrSelect(this.parent,"text.percent-value"),i=me.statusBar.paddingRight,a=r.node().getComputedTextLength(),s=U.appendOrSelect(this.parent,"g.status-indicator").node(),o=U.getSVGElementSize(s,{useBBox:!0}).width+me.status.paddingLeft;return n-a-i-o}}getStatusIconPathString(t){switch(t){case Yi.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 Yi.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Yi.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 vh extends Ot{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=U.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const a=_(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*a/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 HD extends Ot{constructor(){super(...arguments),this.type="circle-pack",this.renderType=ut.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:pi.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}=U.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let a=this.model.getDisplayData();const s=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=_(l,"canvasZoom","enabled");s&&_(a,0,"children")&&(a=_(a,0,"children"));const u=qa({children:a}).sum(f=>f.value).sort((f,g)=>g.value-f.value),d=ZR().size([r,i]).padding(f=>f.depth>=1?pi.padding.children+3:pi.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:[dt.FILL,dt.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",pi.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,di),this.setBackgroundListeners()),s||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",pi.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){P(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=P(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,di)})}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=D(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(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(S.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(S.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=D(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,ni)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,ni),n.stopPropagation()}t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function PR(e,t){const n=es(this._current,e);return r=>(this._current=n(r),t(this._current))}class mv extends yt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Ht.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(L=>L[a]>0),l=this.computeRadius();this.arc=Ds().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ds().innerRadius(this.getInnerRadius()).outerRadius(l+Ht.hoverArc.outerRadiusOffset);const c=pL().value(L=>L[a]).sort(x(i,"pie","sortFunction")).padAngle(Ht.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",pt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,L=>L.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",L=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:L.data[s],originalClassName:"slice"})).style("fill",L=>n.model.getFillColor(L.data[s],null,L.data)).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[a]}, ${yc(L.data[a],o,a)+"%"}`).attrTween("d",function(L){return PR.bind(this)(L,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=x(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(L=>L.data[a]>0):[],v=N.appendOrSelect(r,"g.labels").attr("role",pt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,L=>L.data[s]);v.exit().attr("opacity",0).remove();const m=v.enter().append("text").classed("pie-label",!0),y=[];m.merge(v).style("text-anchor","middle").text(L=>i.pie.labels.formatter?i.pie.labels.formatter({...L,percentageValue:yc(L.data[a],o,a,!0)}):h(yc(L.data[a],o,a),d)+"%").datum(function(L){const R=l+7,$=(L.endAngle-L.startAngle)/2+L.startAngle,F=$/Math.PI*180,P=this.getComputedTextLength();return L.textOffsetX=P/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+R)*Math.sin($),L.yPosition=(L.textOffsetY+R)*-Math.cos($),L}).attr("transform",function(L,R){const $=f.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(R>=$-2&&F<Ht.callout.minSliceDegree){let P,H;return L.index===$-1?(P=L.xPosition+Ht.callout.offsetX+Ht.callout.textMargin+L.textOffsetX,H=L.yPosition-Ht.callout.offsetY,L.direction=ki.RIGHT,y.push(L)):(P=L.xPosition-Ht.callout.offsetX-L.textOffsetX-Ht.callout.textMargin,H=L.yPosition-Ht.callout.offsetY,L.direction=ki.LEFT,y.push(L)),`translate(${P}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(y);const g=x(i,"donut")?"donut":"pie",b=x(i,g,"alignment"),{width:T}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),E=p?Ht.xOffset:0,O=p?Ht.yOffset:0;let A=l+E;b===Jt.CENTER?A=T/2:b===Jt.RIGHT&&(A=T-l-Ht.xOffset);let I=l+O;y.length>0&&(I+=Ht.yOffsetCallout),r.attr("x",A+7).attr("y",I),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",pt.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",pt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===ki.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Ht.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Ht.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(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 D(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=D(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(S.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Pie.SLICE_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);IC(()=>{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(S.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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+Ht.radiusOffset:i}}class UR extends mv{constructor(){super(...arguments),this.type="donut",this.renderType=rt.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=x(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(D(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=x(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=cp:s=Ae;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}=x(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const gv="4,10 8,6 12,10",vv="12,6 8,10 4,6";class BR extends yt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Tm(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 x(t,"gauge","type")===lr.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(x(n,"gauge","deltaArrow","direction")){case ta.UP:return gv;case ta.DOWN:return vv;default:return t>0?gv:vv}}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=Ds().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ds().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:[at.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=x(r,"gauge","alignment"),{width:v}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===Jt.CENTER?m=v/2:f===Jt.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===lr.FULL&&!s?d=l(a):r===lr.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:v,number:m}=x(n,"locale"),y=x(n,"gauge","numberFormatter"),g=f.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${p}px`).attr("text-anchor","middle").text(L=>{let R;return L!=null?R=Number(L.toFixed(2))%1!==0?L.toFixed(2):L.toFixed():R=0,y?y(R):m(Number(R),v)});const{width:b}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),T=p/2,E=u?"%":"",O=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${T}px`).attr("x",b/2).text(E),{width:A,height:I}=N.getSVGElementSize(O,{useBBox:!0});O.attr("y",`-${I/2}px`),f.attr("transform",`translate(-${A/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=x(r,"locale");if(i){const o=this.computeRadius(),l=i?x(r,"gauge","deltaFontSize"):()=>0,c=i?x(r,"gauge","numberFormatter"):()=>null,u=x(r,"gauge","deltaArrow","size"),d=x(r,"gauge","numberSpacing"),h=x(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),v=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";v.data(i===null?[]:[i]),v.enter().append("text").classed("gauge-delta-number",!0).merge(v).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(T=>{let E;return T!=null?E=Number(T.toFixed(2))%1!==0?T.toFixed(2):T.toFixed():E=0,c?`${c(E)}${m}`:`${a(Number(E),s)}${m}`});const{width:y}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=x(r,"gauge","deltaArrow","enabled"),b=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);b.enter().append("svg").merge(b).attr("class","gauge-delta-arrow").attr("x",-u(o)-y/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 T=D(this);N.appendOrSelect(T,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const E=x(r,"gauge","status");N.appendOrSelect(T,"polygon.gauge-delta-arrow").attr("class",E!==null?`gauge-delta-arrow status--${E}`:"").attr("points",t.getArrow(i))}),b.exit().remove(),v.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(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(S.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class yv extends Yu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=Xi(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",pt.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()===Qt.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:[at.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,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,m),g=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-h/2,T=b+h;if(!this.isOutsideZoomedDomain(b,T))return me({x0:p,x1:f,y0:y,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.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=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.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=x(t,"bars","width"),r=x(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=ps().domain(t).rangeRound([0,this.getGroupWidth()])}}class HR extends yt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.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 v=this.matrix[r][f].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})):(u=o,s.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const v=this.matrix[f][r].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Wn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Wn(l.range())},${c(r)})`),this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n.event,hoveredElement:D(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(S.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(S.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(S.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(S.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(""),x(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",v=>`heat-${v.index}`).classed("cell",!0).attr("transform",v=>`translate(${i(v[a])}, ${s(v[o])})`).append("rect").attr("class",v=>this.model.getColorClassName({value:v.value,originalClassName:`heat-${v.index}`})).classed("heat",!0).classed("null-state",v=>v.index===-1||v.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",v=>{const m=this.services.cartesianScales.getDomainIdentifier(v);return v.index===-1||v.value===null?`url(#${p})`:this.model.getFillColor(Number(v.value),v[m],v)}).attr("aria-label",v=>v.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=x(this.getOptions(),"heatmap","divider","state");return t!==Gr.OFF&&(t===Gr.AUTO&&Bp.minCellDividerDimension<=this.xBandwidth&&Bp.minCellDividerDimension<=this.yBandwidth||t===Gr.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=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=cs(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(S.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(S.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(S.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const d=D(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class VR extends yt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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",pt.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:[at.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,v=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-v)>0&&Math.abs(m-v)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?m+=1:m-=1),me({x0:p,x1:f,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=x(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=D(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(S.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:[at.TOOLTIP],dataGroupName:o[n]})},{label:h,value:Et(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("mouseout",function(){D(this).classed("hovered",!1),s.services.events.dispatchEvent(S.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class FR extends xn{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.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]?Mn.weight.unselected:Mn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Mn.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?Mn.opacity.unselected:Mn.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",Mn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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]=An(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const v=f.enter().append("line").attr("opacity",0).merge(f).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[at.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===Qt.HORIZONTAL?v.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.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(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class GR extends yt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.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)-ae.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-ae.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;x(i,"meter","proportional")===null?u=100:u=x(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=en().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),p=x(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?ae.height.proportional:ae.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?ae.height.proportional:ae.height.default));const f=r.selectAll("rect.value").data(h),v=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",b=>b.x).attr("y",0).attr("height",()=>p||(s?ae.height.proportional:ae.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:b[c],originalClassName:v})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):Math.max(b.width,2)).style("fill",b=>n.model.getFillColor(b[c],null,b)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),f.exit().remove();const m=x(i,"meter","peak");let y=m;m!==null&&(m>u?y=u:m<0&&(y=0));const g=r.selectAll("line.peak").data(y==null?[]:[y]);g.enter().append("line").classed("peak",!0).merge(g).attr("y1",0).attr("y2",()=>p||(s?ae.height.proportional:ae.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),g.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(S.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class zR extends yt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.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}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=BC(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(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:ct(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?_r.opacity.unselected:_r.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?_r.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",_r.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:v,xAxisRectHeight:m}=_r;this.uniqueKeys=Array.from(new Set(s.map(_=>_[u]))),this.uniqueGroups=Array.from(new Set(s.map(_=>_[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),g=(Math.min(r,i)-y)/2;if(g<=0)return;const b=ps().domain(this.fullDataNormalized.map(_=>_[u])).range([0,2*Math.PI].map(_=>_-Math.PI/2)),T=Wn(this.fullDataNormalized.map(_=>_[d])),E=en().domain([T>=0?0:T,gr(this.fullDataNormalized.map(_=>_[d]))]).range([v,g]).nice(f),O=E.ticks(f),A=(_,C,k)=>this.model.getFillColor(_,C,k),I=gL().angle(_=>b(_[u])+Math.PI/2).radius(_=>E(_[d])).curve(Ff),L=this.uniqueKeys.map(_=>{const C=this.getLabelDimensions(_).width,k=G2(b(_),g);return C+k}),R={x:gr(L)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",pt.GROUP).selectAll("path").data(O,_=>_),F=_=>this.uniqueKeys.map(C=>({[u]:C,[d]:_}));$.join(_=>_.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_exit",animate:t})).attr("d",k=>I(F(k))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",pt.GROUP).selectAll("line").data(this.uniqueKeys,_=>_).join(_=>_.append("line").attr("opacity",0).attr("class",C=>`x-axis-${pi(C)}`).attr("stroke-dasharray","0").attr("x1",C=>Zt(b(C),0,R).x).attr("y1",C=>Zt(b(C),0,R).y).attr("x2",C=>Zt(b(C),0,R).x).attr("y2",C=>Zt(b(C),0,R).y).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",k=>Zt(b(k),E.range()[0],R).x).attr("y1",k=>Zt(b(k),E.range()[0],R).y).attr("x2",k=>Zt(b(k),E.range()[1],R).x).attr("y2",k=>Zt(b(k),E.range()[1],R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",k=>Zt(b(k),E.range()[0],R).x).attr("y1",k=>Zt(b(k),E.range()[0],R).y).attr("x2",k=>Zt(b(k),E.range()[1],R).x).attr("y2",k=>Zt(b(k),E.range()[1],R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",pt.GROUP).selectAll("text").data(this.uniqueKeys).join(_=>_.append("text").text(C=>C).attr("opacity",0).attr("x",C=>Zt(b(C),E.range()[1]+h,R).x).attr("y",C=>Zt(b(C),E.range()[1]+h,R).y).style("text-anchor",C=>rm(b(C)).textAnchor).style("dominant-baseline",C=>rm(b(C)).dominantBaseline).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",k=>Zt(b(k),E.range()[1]+h,R).x).attr("y",k=>Zt(b(k),E.range()[1]+h,R).y).end().finally(()=>{const k=x(o,"radar","alignment"),U=this.getAlignmentXOffset(k,n,this.getParent());n.attr("x",U)})),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",pt.GROUP).selectAll("path").data(this.groupedDataNormalized,_=>_.name).join(_=>_.append("path").attr("class",C=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:C.name,originalClassName:"blob"})).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",C=>A(C.name,null,C.data)).style("fill-opacity",_r.opacity.selected).style("stroke",C=>A(C.name,null,C.data)).call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_enter",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),k.attr("opacity",1).attr("d",U=>I(U.data))}),_=>(_.attr("class",C=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:C.name,originalClassName:"blob"})).style("fill",C=>A(C.name,null,C.data)).style("stroke",C=>A(C.name,null,C.data)),_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>I(k.data))),_),_=>_.call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_exit",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),k.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",pt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(_=>x(_,d)!==null)).join(_=>_.append("circle").attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C[c]),_=>_,_=>_.remove()).attr("class",_=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:_[l],originalClassName:pi(_[u])})).attr("cx",_=>Zt(b(_[u]),E(_[d]),R).x).attr("cy",_=>Zt(b(_[u]),E(_[d]),R).y).attr("r",0).attr("opacity",0).style("fill",_=>A(_[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",pt.GROUP).selectAll("rect").data(this.uniqueKeys).join(_=>_.append("rect"),_=>_,_=>_.remove()).attr("x",R.x).attr("y",R.y-m/2).attr("width",E.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",_=>`rotate(${im(b(_))}, ${R.x}, ${R.y})`);const{code:P,number:H}=x(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",pt.GROUP).selectAll("text").data(Qe(O)).join(_=>_.append("text").attr("opacity",0).text(C=>H(C,P)).attr("x",C=>Zt(-Math.PI/2,E(C),R).x+p).attr("y",C=>Zt(-Math.PI/2,E(C),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_update",animate:t})).text(k=>k).attr("opacity",1).attr("x",k=>Zt(-Math.PI/2,E(k),R).x+p).attr("y",k=>Zt(-Math.PI/2,E(k),R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,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===Jt.CENTER?a=Math.floor((s-i.width)/2):t===Jt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${pi(i)}`),o=t.parent.selectAll(`.dots circle.${pi(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(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",_r.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(S.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:[at.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Radar.X_AXIS_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=t.parent.select(`.x-axes .x-axis-${pi(i)}`),o=t.parent.selectAll(`.dots circle.${pi(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE)})}}class xv extends Yu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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:[at.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,v;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),v=this.services.cartesianScales.getRangeValue(d[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,y)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-f);if(m!==0&&m<2&&(d>0&&a===Qt.VERTICAL||d<0&&a===Qt.HORIZONTAL?v=f-2:v=f+2),!this.isOutsideZoomedDomain(h,p))return me({x0:h,x1:p,y0:f,y1:v},a)}).attr("opacity",1).attr("role",pt.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=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class jR extends xe{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(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 bv extends yt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.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=>x(s,0,i)!==n.datum().name?$n.opacity.unselected:$n.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",$n.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=x(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=>x(p,0,s));this.areaGenerator=ku().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=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s),null,p)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",$n.opacity.selected).attr("d",this.areaGenerator)}}class _v extends Yu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",pt.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:[at.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 v=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(v-f)>0&&Math.abs(v-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Qt.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?v+=1:v-=1)}return me({x0:h,x1:p,y0:f,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",pt.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=D(this);a.classed("hovered",!0),r.services.events.dispatchEvent(S.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(S.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);a.classed("hovered",!1),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(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=x(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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ev extends xn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!x(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=>x(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",pt.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 v=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),y=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(v)&&(s&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[y]: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 Oi=6;class WR extends yt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.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=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+Oi:30-Oi},h=ks({name:o,children:a}),p=10,f=r/6,v=O=>{const A=h.descendants().reverse(),I=h.links();let L=h,R=h;h.eachBefore(U=>{U.x<L.x&&(L=U),U.x>R.x&&(R=U)});const $=R.x-L.x,F=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,L.x,r,$].join(" ")),P=E.selectAll("g").data(A,U=>U.id),H=this,_=P.enter().append("g").attr("transform",()=>`translate(${O.y0},${O.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOVER,{event:U,element:D(this),datum:B})}).on("click",function(U,B){B.depth!==0&&(B.children=B.children?null:B._children,v(B)),H.services.events.dispatchEvent(S.Tree.NODE_CLICK,{event:U,element:D(this),datum:B})}).on("mouseout",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOUT,{event:U,element:D(this),datum:B})});_.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),_.append("text").attr("dy","0.31em").attr("x",U=>U._children?-Oi:Oi).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(_).transition(F).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(F).remove().attr("transform",()=>`translate(${O.y},${O.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const C=T.selectAll("path").data(I,U=>U.target.id),k=C.enter().append("path").attr("d",()=>{const U={x:O.x0,y:O.y0};return b({source:U,target:U})});C.merge(k).transition(F).attr("d",b),C.exit().transition(F).remove().attr("d",()=>{const U={x:O.x,y:O.y};return b({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},m=h.descendants(),y=m[m.length-1].depth,g=x(s,"tree","type")===Js.DENDROGRAM?dk().size([i,r-u-y*Oi-l]):Jk().nodeSize([p,f]).size([i,r-u-y*Oi-l]),b=EL().x(O=>O.y).y(O=>O.x);h.x0=f/2,h.y0=0,h.descendants().forEach((O,A)=>{O.id=A,O._children=O.children}),g(h),n.attr("viewBox",[-d.left,-d.top,r,p]).style("user-select","none");const T=n.append("g").attr("class","links"),E=n.append("g").attr("class","nodes");v(h)}}var qR="#000000",YR="#ffffff",ZR="#fcf4d6",XR="#fddc69",KR="#f1c21b",QR="#d2a106",JR="#b28600",tD="#8e6a00",eD="#684e00",nD="#483700",rD="#302400",iD="#1c1500",sD={10:ZR,20:XR,30:KR,40:QR,50:JR,60:tD,70:eD,80:nD,90:rD,100:iD},aD="#fff2e8",oD="#ffd9be",lD="#ffb784",cD="#ff832b",uD="#eb6200",hD="#ba4e00",dD="#8a3800",pD="#5e2900",fD="#3e1a00",mD="#231000",gD={10:aD,20:oD,30:lD,40:cD,50:uD,60:hD,70:dD,80:pD,90:fD,100:mD},vD="#fff1f1",yD="#ffd7d9",xD="#ffb3b8",bD="#ff8389",_D="#fa4d56",ED="#da1e28",TD="#a2191f",OD="#750e13",SD="#520408",wD="#2d0709",$D={10:vD,20:yD,30:xD,40:bD,50:_D,60:ED,70:TD,80:OD,90:SD,100:wD},MD="#fff0f7",CD="#ffd6e8",AD="#ffafd2",kD="#ff7eb6",LD="#ee5396",RD="#d02670",DD="#9f1853",ID="#740937",ND="#510224",PD="#2a0a18",UD={10:MD,20:CD,30:AD,40:kD,50:LD,60:RD,70:DD,80:ID,90:ND,100:PD},BD="#f6f2ff",HD="#e8daff",VD="#d4bbff",FD="#be95ff",GD="#a56eff",zD="#8a3ffc",jD="#6929c4",WD="#491d8b",qD="#31135e",YD="#1c0f30",ZD={10:BD,20:HD,30:VD,40:FD,50:GD,60:zD,70:jD,80:WD,90:qD,100:YD},XD="#edf5ff",KD="#d0e2ff",QD="#a6c8ff",JD="#78a9ff",tI="#4589ff",eI="#0f62fe",nI="#0043ce",rI="#002d9c",iI="#001d6c",sI="#001141",aI={10:XD,20:KD,30:QD,40:JD,50:tI,60:eI,70:nI,80:rI,90:iI,100:sI},oI="#e5f6ff",lI="#bae6ff",cI="#82cfff",uI="#33b1ff",hI="#1192e8",dI="#0072c3",pI="#00539a",fI="#003a6d",mI="#012749",gI="#061727",vI={10:oI,20:lI,30:cI,40:uI,50:hI,60:dI,70:pI,80:fI,90:mI,100:gI},yI="#d9fbfb",xI="#9ef0f0",bI="#3ddbd9",_I="#08bdba",EI="#009d9a",TI="#007d79",OI="#005d5d",SI="#004144",wI="#022b30",$I="#081a1c",MI={10:yI,20:xI,30:bI,40:_I,50:EI,60:TI,70:OI,80:SI,90:wI,100:$I},CI="#defbe6",AI="#a7f0ba",kI="#6fdc8c",LI="#42be65",RI="#24a148",DI="#198038",II="#0e6027",NI="#044317",PI="#022d0d",UI="#071908",BI={10:CI,20:AI,30:kI,40:LI,50:RI,60:DI,70:II,80:NI,90:PI,100:UI},HI="#f2f4f8",VI="#dde1e6",FI="#c1c7cd",GI="#a2a9b0",zI="#878d96",jI="#697077",WI="#4d5358",qI="#343a3f",YI="#21272a",ZI="#121619",XI={10:HI,20:VI,30:FI,40:GI,50:zI,60:jI,70:WI,80:qI,90:YI,100:ZI},KI="#f4f4f4",QI="#e0e0e0",JI="#c6c6c6",tN="#a8a8a8",eN="#8d8d8d",nN="#6f6f6f",rN="#525252",iN="#393939",sN="#262626",aN="#161616",oN={10:KI,20:QI,30:JI,40:tN,50:eN,60:nN,70:rN,80:iN,90:sN,100:aN},lN="#f7f3f2",cN="#e5e0df",uN="#cac5c4",hN="#ada8a8",dN="#8f8b8b",pN="#726e6e",fN="#565151",mN="#3c3838",gN="#272525",vN="#171414",yN={10:lN,20:cN,30:uN,40:hN,50:dN,60:pN,70:fN,80:mN,90:gN,100:vN},Tv={black:{100:qR},blue:aI,coolGray:XI,cyan:vI,gray:oN,green:BI,magenta:UD,orange:gD,purple:ZD,red:$D,teal:MI,warmGray:yN,white:{0:YR},yellow:sD};const xN=e=>{if(!e)return null;for(const t of Object.keys(Tv)){const n=Tv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Ov=function(e){const t=D(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=On(n);let i;if(r&&(i=xN(r?r.hex():null)),i==null){const s=sp(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let bN=0;class _N extends yt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=x(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=ks({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=iL().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",()=>bN++).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=D(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:[at.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=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=D(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${f}`;return new URL(`#${v}`,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(v=>v.text).style("fill",Ov).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const v=D(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${m}`,s)+""})`}),f},p=>p.text(f=>f.text).style("fill",Ov),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=D(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),On(s).darker(.7).toString()}),t.services.events.dispatchEvent(S.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(S.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(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(S.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}}function EN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function TN(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 ON={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 Po(n)}function Po(e){this._=e}function SN(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}})}Po.prototype=Sv.prototype={constructor:Po,on:function(e,t){var n=this._,r=SN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=wN(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]=wv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=wv(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 Po(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 wN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function wv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ON,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const $N=Object.freeze(Object.defineProperty({__proto__:null,dispatch:Sv},Symbol.toStringTag,{value:"Module"})),MN=TN($N),CN=MN.dispatch,Zu=Math.PI/180,AN={archimedean:Mv,rectangular:VN},Fs=64,Uo=2048;var kN=function(){var e=[256,256],t=LN,n=RN,r=DN,i=$v,s=$v,a=IN,o=NN,l=Mv,c=[],u=1/0,d=CN("word","end"),h=null,p=Math.random,f={},v=GN;f.canvas=function(g){return arguments.length?(v=tr(g),f):v},f.start=function(){var g=m(v()),b=FN((e[0]>>5)*e[1]),T=null,E=c.length,O=-1,A=[],I=c.map(function(R,$){return R.text=t.call(this,R,$),R.font=n.call(this,R,$),R.style=i.call(this,R,$),R.weight=s.call(this,R,$),R.rotate=a.call(this,R,$),R.size=~~r.call(this,R,$),R.padding=o.call(this,R,$),R}).sort(function(R,$){return $.size-R.size});return h&&clearInterval(h),h=setInterval(L,0),L(),f;function L(){for(var R=Date.now();Date.now()-R<u&&++O<E&&h;){var $=I[O];$.x=e[0]*(p()+.5)>>1,$.y=e[1]*(p()+.5)>>1,PN(g,$,I,O),$.hasText&&y(b,$,T)&&(A.push($),d.call("word",f,$),T?BN(T,$):T=[{x:$.x+$.x0,y:$.y+$.y0},{x:$.x+$.x1,y:$.y+$.y1}],$.x-=e[0]>>1,$.y-=e[1]>>1)}O>=E&&(f.stop(),d.call("end",f,A,T))}},f.stop=function(){h&&(clearInterval(h),h=null);for(const g of c)delete g.sprite;return f};function m(g){const b=g.getContext("2d",{willReadFrequently:!0});g.width=g.height=1;const T=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return g.width=(Fs<<5)/T,g.height=Uo/T,b.fillStyle=b.strokeStyle="red",{context:b,ratio:T}}function y(g,b,T){e[0],e[1];for(var E=b.x,O=b.y,A=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),L=p()<.5?1:-1,R=-L,$,F,P;($=I(R+=L))&&(F=~~$[0],P=~~$[1],!(Math.min(Math.abs(F),Math.abs(P))>=A));)if(b.x=E+F,b.y=O+P,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!T||HN(b,T))&&!UN(b,g,e[0])){for(var H=b.sprite,_=b.width>>5,C=e[0]>>5,k=b.x-(_<<4),U=k&127,B=32-U,X=b.y1-b.y0,Y=(b.y+b.y0)*C+(k>>5),ot,it=0;it<X;it++){ot=0;for(var bt=0;bt<=_;bt++)g[Y+bt]|=ot<<B|(bt<_?(ot=H[it*_+bt])>>>U:0);Y+=C}return!0}return!1}return f.timeInterval=function(g){return arguments.length?(u=g??1/0,f):u},f.words=function(g){return arguments.length?(c=g,f):c},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=tr(g),f):n},f.fontStyle=function(g){return arguments.length?(i=tr(g),f):i},f.fontWeight=function(g){return arguments.length?(s=tr(g),f):s},f.rotate=function(g){return arguments.length?(a=tr(g),f):a},f.text=function(g){return arguments.length?(t=tr(g),f):t},f.spiral=function(g){return arguments.length?(l=AN[g]||g,f):l},f.fontSize=function(g){return arguments.length?(r=tr(g),f):r},f.padding=function(g){return arguments.length?(o=tr(g),f):o},f.random=function(g){return arguments.length?(p=g,f):p},f.on=function(){var g=d.on.apply(d,arguments);return g===d?f:g},f};function LN(e){return e.text}function RN(){return"serif"}function $v(){return"normal"}function DN(e){return Math.sqrt(e.value)}function IN(){return(~~(random()*6)-3)*30}function NN(){return 1}function PN(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Fs<<5)/s,Uo/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const $=i.measureText(t.text),F=-Math.floor($.width/2);let P=($.width+1)*s,H=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Zu),d=Math.cos(t.rotate*Zu),h=P*d,p=P*u,f=H*d,v=H*u;P=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,H=~~Math.max(Math.abs(p+f),Math.abs(p-f))}else P=P+31>>5<<5;if(H>l&&(l=H),a+P>=Fs<<5&&(a=0,o+=l,l=0),o+H>=Uo)break;i.translate((a+(P>>1))/s,(o+(H>>1))/s),t.rotate&&i.rotate(t.rotate*Zu),i.fillText(t.text,F,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,F,0)),i.restore(),t.width=P,t.height=H,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=H>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(Fs<<5)/s,Uo/s).data,y=[];--r>=0;)if(t=n[r],!!t.hasText){for(var g=t.width,b=g>>5,T=t.y1-t.y0,E=0;E<T*b;E++)y[E]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var O=0,A=-1,I=0;I<T;I++){for(var E=0;E<g;E++){var L=b*I+(E>>5),R=m[(o+I)*(Fs<<5)+(a+E)<<2]?1<<31-E%32:0;y[L]|=R,O|=R}O?A=I:(t.y0++,T--,I--,o++)}t.y1=t.y0+A,t.sprite=y.slice(0,(t.y1-t.y0)*b)}}}function UN(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function BN(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function HN(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function Mv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function VN(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function FN(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function GN(){return document.createElement("canvas")}function tr(e){return typeof e=="function"?e:function(){return e}}const zN=EN(kN);class jN extends yt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=zN().size([u,d]).words(i.map(function(f){const v=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:v,value:v}})).padding(5).rotate(0).fontSize(f=>s(f.size)).on("end",p);h.start();function p(f){const v=N.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(f,y=>`${y[c]}-${y.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.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?Qe(i):[1,1];return en().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Fa(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(S.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(S.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:[at.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(S.WordCloud.WORD_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);i(null),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class WN extends yt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.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=x(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=SR(s,Object.values(l)),u=ER(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=UA().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",Is()([[0,0],[0,10]]));const v=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case un.geoEqualEarth:t=rk();break;case un.geoAlbers:t=XA();break;case un.geoConicEqualArea:t=Eg();break;case un.geoConicEquidistant:t=ek();break;case un.geoEquirectangular:t=JA();break;case un.geoMercator:t=KA();break;case un.geoNaturalEarth1:t=ik();break;default:throw new Error("Projection is not supported.")}return t}}class qN extends WN{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=D(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.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(Hr.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Hr.CHOROPLETH_CLICK,{event:r,element:D(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=D(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.HIDE,{event:r,hoveredElement:s})})}}function Xu(e){var t=e==null?0:e.length;return t?ha(e,1):[]}function YN(e){return Dh(Ph(e,void 0,Xu),e+"")}function Cv(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 ZN(e,t){return t.length<2?e:Rl(e,Cv(t,0,-1))}function XN(e,t){return t=ua(t,e),e=ZN(e,t),e==null||delete e[qi(Ld(t))]}function KN(e){return Xh(e)?void 0:e}var QN=1,JN=2,tP=4,eP=YN(function(e,t){var n={};if(e==null)return n;var r=!1;t=_l(t,function(s){return s=ua(s,e),r||(r=s.length>1),s}),zr(e,ad(e),n),r&&(n=Yi(n,QN|JN|tP,KN));for(var i=t.length;i--;)XN(n,t[i]);return n});function Av(e){return Math.log(e)}function kv(e){return Math.exp(e)}function nP(e){return-Math.log(-e)}function rP(e){return-Math.exp(-e)}function iP(e){return isFinite(e)?+("1e"+e):e<0?0:e}function sP(e){return e===10?iP:e===Math.E?Math.exp:t=>Math.pow(e,t)}function aP(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 Lv(e){return(t,n)=>-e(-t,n)}function oP(e){const t=e(Av,kv),n=t.domain;let r=10,i,s;function a(){return i=aP(r),s=sP(r),n()[0]<0?(i=Lv(i),s=Lv(s),e(nP,rP)):e(Av,kv),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,v;const m=o==null?10:+o;let y=[];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(v=h<0?f/s(-h):f*s(h),!(v<c)){if(v>u)break;y.push(v)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(v=h>0?f/s(-h):f*s(h),!(v<c)){if(v>u)break;y.push(v)}y.length*2<m&&(y=va(c,u,m))}else y=va(h,p,Math.min(p-h,m)).map(s);return d?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=as(l)).precision==null&&(l.trim=!0),l=pc(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(yf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Rv(){const e=oP(Ip()).domain([1,10]);return e.copy=()=>mc(e,Rv()).base(e.base()),ti.apply(e,arguments),e}function Bo(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 Ho(e){this._context=e}Ho.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:Bo(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:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lP(e){return new Ho(e)}function Dv(e){this._context=e}Dv.prototype={areaStart:Xn,areaEnd:Xn,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:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cP(e){return new Dv(e)}function Iv(e){this._context=e}Iv.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:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uP(e){return new Iv(e)}function Nv(e,t){this._basis=new Ho(e),this._beta=t}Nv.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 hP=function e(t){function n(r){return t===1?new Ho(r):new Nv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Vo(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 Ku(e,t){this._context=e,this._k=(1-t)/6}Ku.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:Vo(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:Vo(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 dP=function e(t){function n(r){return new Ku(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Qu(e,t){this._context=e,this._k=(1-t)/6}Qu.prototype={areaStart:Xn,areaEnd:Xn,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:Vo(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 pP=function e(t){function n(r){return new Qu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ju(e,t){this._context=e,this._k=(1-t)/6}Ju.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:Vo(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 fP=function e(t){function n(r){return new Ju(r,t)}return n.tension=function(r){return e(+r)},n}(0);function th(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>de){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>de){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 Pv(e,t){this._context=e,this._alpha=t}Pv.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:th(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 mP=function e(t){function n(r){return t?new Pv(r,t):new Ku(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Uv(e,t){this._context=e,this._alpha=t}Uv.prototype={areaStart:Xn,areaEnd:Xn,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:th(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 gP=function e(t){function n(r){return t?new Uv(r,t):new Qu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Bv(e,t){this._context=e,this._alpha=t}Bv.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:th(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 vP=function e(t){function n(r){return t?new Bv(r,t):new Ju(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Hv(e){return e<0?-1:1}function Vv(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(Hv(s)+Hv(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Fv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function eh(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 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=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:eh(this,this._t0,Fv(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,eh(this,Fv(this,n=Vv(this,e,t)),n);break;default:eh(this,this._t0,n=Vv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Gv(e){this._context=new zv(e)}(Gv.prototype=Object.create(Fo.prototype)).point=function(e,t){Fo.prototype.point.call(this,t,e)};function zv(e){this._context=e}zv.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 yP(e){return new Fo(e)}function xP(e){return new Gv(e)}function jv(e){this._context=e}jv.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=Wv(e),i=Wv(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 Wv(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 bP(e){return new jv(e)}function Go(e,t){this._context=e,this._t=t}Go.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 _P(e){return new Go(e,.5)}function EP(e){return new Go(e,0)}function TP(e){return new Go(e,1)}class OP extends Nn{zoomIn(t,n,r){let i,s,a;const o=r||ni;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(S.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||ni;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_OUT)}}class SP extends Nn{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 wP extends Nn{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 $P extends Nn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(S.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(x(Fp,n,"duration")||Fp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Gs(e,t){const n=+Yt(e)-+Yt(t);return n<0?-1:n>0?1:n}function MP(e,t,n){const[r,i]=cr(void 0,e,t);return r.getFullYear()-i.getFullYear()}function CP(e,t,n){const[r,i]=cr(void 0,e,t),s=Gs(r,i),a=Math.abs(MP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Gs(r,i)===-s,l=s*(a-+o);return l===0?0:l}function nh(e,t,n){const r=Yt(e,void 0);if(isNaN(t))return Be(e,NaN);if(!t)return r;const i=r.getDate(),s=Be(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 qv(e,t,n){return nh(e,t*12)}function AP(e,t,n){return qv(e,-t)}function kP(e,t,n){const[r,i]=cr(void 0,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function LP(e,t){const n=Yt(e,void 0);return n.setHours(23,59,59,999),n}function RP(e,t){const n=Yt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function DP(e,t){const n=Yt(e,void 0);return+LP(n)==+RP(n)}function IP(e,t,n){const[r,i,s]=cr(void 0,e,e,t),a=Gs(i,s),o=Math.abs(kP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Gs(i,s)===-a;DP(r)&&o===1&&Gs(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function NP(e,t,n){return nh(e,-t)}function PP(e,t,n){const[r,i]=cr(void 0,e,t),s=Yv(r,i),a=Math.abs(tf(r,i));r.setDate(r.getDate()-s*a);const o=+(Yv(r,i)===-s),l=s*(a-o);return l===0?0:l}function Yv(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 Zv(e,t,n){const r=Yt(e,void 0);return isNaN(t)?Be(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function UP(e,t,n){return Zv(e,-t)}function rh(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function BP(e,t,n){const[r,i]=cr(void 0,e,t),s=(+r-+i)/Eh;return rh(void 0)(s)}function Xv(e,t,n){return Be(e,+Yt(e)+t)}function Kv(e,t,n){return Xv(e,t*Eh)}function HP(e,t,n){return Kv(e,-t)}function Qv(e,t){return+Yt(e)-+Yt(t)}function Jv(e,t,n){const r=Qv(e,t)/_h;return rh(void 0)(r)}function ih(e,t,n){const r=Yt(e,void 0);return r.setTime(r.getTime()+t*_h),r}function t0(e,t,n){return ih(e,-t)}function e0(e,t,n){const r=Qv(e,t)/1e3;return rh(void 0)(r)}function sh(e,t,n){return Xv(e,t*1e3)}function n0(e,t,n){return sh(e,-t)}class VP extends Nn{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=x(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=x(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 x(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===G.BOTTOM||t===G.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(G).map(t=>G[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===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=Qt.VERTICAL:this.orientation=Qt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=x(s,"axes");((t=a[G.LEFT])!=null&&t.correspondingDatasets&&a[G.RIGHT]||(n=a[G.RIGHT])!=null&&n.correspondingDatasets&&a[G.LEFT]||(r=a[G.TOP])!=null&&r.correspondingDatasets&&a[G.BOTTOM]||(i=a[G.BOTTOM])!=null&&i.correspondingDatasets&&a[G.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=x(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]===tt.LINEAR||this.scaleTypes[t]===tt.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=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.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=x(s,"axes")[r],{mapsTo:o}=a,l=x(i,o)!==null?i[o]:i;let c;switch(n){case tt.LABELS:c=t(l)+t.step()/2;break;case tt.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=x(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(x(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 x(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=x(r,"axes",t);if(i.scaleType===tt.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return FP(n,s)}else return GP(n,qn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,G.LEFT)===null&&x(n,G.RIGHT)!==null||x(n,G.RIGHT,"main")===!0||r&&x(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,G.BOTTOM)===null&&x(n,G.TOP)!==null||x(n,G.TOP,"main")===!0||r&&x(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||tt.LINEAR,o=s.scaleType||tt.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===tt.LABELS||o===tt.TIME)&&a===tt.LABELS||a===tt.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=x(n,"axes",t),i=x(n,"bounds"),{includeZero:s}=r,a=x(r,"scaleType")||tt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:y}=this.model.getBinConfigurations();return[0,gr(y,g=>g.length)]}else if(r.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),g=this.model.getStackKeys({bins:y});return[g[0].split(":")[0],g[g.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=qn.ratio;if(r.domain)return a===tt.LABELS?r.domain:(a===tt.TIME&&(r.domain=r.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===tt.LABELS)return Xi(o.map(y=>y[c]));let f,v;const m=this.model.getDataGroupNames();if(a===tt.LABELS_RATIO)return o.map(y=>`${y[h]}/${y[p]}`);if(a===tt.TIME)v=o.map(y=>+new Date(y[c]));else if(i&&n.axes)v=[],o.forEach(y=>{v.push(y[c]),y[i.upperBoundMapsTo]&&v.push(y[i.upperBoundMapsTo]),y[i.lowerBoundMapsTo]&&v.push(y[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,g=this.model.getDataValuesGroupedByKeys({groups:m}),b=o.filter(E=>!m.includes(E[y])),T=[];g.forEach(E=>{const{...O}=E;let A=0,I=0;Object.values(eP(O,"sharedStackKey")).forEach(L=>{isNaN(L)||(L<0?I+=L:A+=L)}),T.push([I,A])}),v=[...Xu(T),...b.map(E=>E[c])]}else v=[],o.forEach(y=>{const g=y[c];Array.isArray(g)&&g.length===2?(v.push(g[0]),v.push(g[1])):(l&&v.push(Math.max(y[c],y[l])),v.push(g))});return a!==tt.TIME&&a!==tt.LOG&&s&&v.push(0),d&&d.length>0&&d.forEach(y=>{const g=x(y,"value");g!==null&&v.push(g)}),f=Qe(v),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=x(n,"axes",t);if(!r)return null;const i=x(r,"scaleType")||tt.LINEAR;this.scaleTypes[t]=i;let s;return i===tt.TIME?s=Pf():i===tt.LOG?s=Rv().base(r.base||10):i===tt.LABELS||i===tt.LABELS_RATIO?s=ps():s=en(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Qt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),x(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=x(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)===tt.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=x(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 FP(e,t){const n=new Date(e[0]),r=new Date(e[1]);return CP(r,n)>1?[AP(n,t),qv(r,t)]:IP(r,n)>1?[NP(n,t),nh(r,t)]:PP(r,n)>1?[UP(n,t),Zv(r,t)]:BP(r,n)>1?[HP(n,t),Kv(r,t)]:Jv(r,n)>30?[t0(n,t*30),ih(r,t*30)]:Jv(r,n)>1?[t0(n,t),ih(r,t)]:e0(r,n)>15?[n0(n,t*15),sh(r,t*15)]:e0(r,n)>1?[n0(n,t),sh(r,t)]:[n,r]}function GP([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===tt.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 zP extends Nn{constructor(){super(...arguments),this.curveTypes={curveLinear:Za,curveLinearClosed:Ff,curveBasis:lP,curveBasisClosed:cP,curveBasisOpen:uP,curveBundle:hP,curveCardinal:dP,curveCardinalClosed:pP,curveCardinalOpen:fP,curveCatmullRom:mP,curveCatmullRomClosed:gP,curveCatmullRomOpen:vP,curveMonotoneX:yP,curveMonotoneY:xP,curveNatural:bP,curveStep:_P,curveStepAfter:TP,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 jP extends Nn{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===G.BOTTOM&&n===tt.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=x(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,Qe(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(S.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=x(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=ke.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=x(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 x(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return x(this.model.getOptions(),"zoomBar",t,"locked")}}function WP(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Cv(e,t,n)}var qP="\\ud800-\\udfff",YP="\\u0300-\\u036f",ZP="\\ufe20-\\ufe2f",XP="\\u20d0-\\u20ff",KP=YP+ZP+XP,QP="\\ufe0e\\ufe0f",JP="\\u200d",t3=RegExp("["+JP+qP+KP+QP+"]");function r0(e){return t3.test(e)}function e3(e){return e.split("")}var i0="\\ud800-\\udfff",n3="\\u0300-\\u036f",r3="\\ufe20-\\ufe2f",i3="\\u20d0-\\u20ff",s3=n3+r3+i3,a3="\\ufe0e\\ufe0f",o3="["+i0+"]",ah="["+s3+"]",oh="\\ud83c[\\udffb-\\udfff]",l3="(?:"+ah+"|"+oh+")",s0="[^"+i0+"]",a0="(?:\\ud83c[\\udde6-\\uddff]){2}",o0="[\\ud800-\\udbff][\\udc00-\\udfff]",c3="\\u200d",l0=l3+"?",c0="["+a3+"]?",u3="(?:"+c3+"(?:"+[s0,a0,o0].join("|")+")"+c0+l0+")*",h3=c0+l0+u3,d3="(?:"+[s0+ah+"?",ah,a0,o0,o3].join("|")+")",p3=RegExp(oh+"(?="+oh+")|"+d3+h3,"g");function f3(e){return e.match(p3)||[]}function m3(e){return r0(e)?f3(e):e3(e)}function g3(e){return function(t){t=Wi(t);var n=r0(t)?m3(t):void 0,r=n?n[0]:t.charAt(0),i=n?WP(n,1).join(""):t.slice(1);return r[e]()+i}}var v3=g3("toUpperCase");function y3(e){return v3(Wi(e).toLowerCase())}var x3=Em(function(e,t,n){return t=t.toLowerCase(),e+(n?y3(t):t)});class an{constructor(t,n){this.components=[],this.services={canvasZoom:OP,domUtils:N,events:SP,files:wP,gradientUtils:zc,transitions:$P},this.model=new fn(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(S.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(S.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(S.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=x(r,"toolbar","enabled"),s={id:"legend",components:[new Hu(this.model,this.services)],growth:ht.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new GL(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new Ie(this.model,this.services,[l,...i?[c]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:x(n,"graphFrameRenderType")||rt.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=It.COLUMN;if(h){const y=x(r,"legend","position");y==="left"?(p=It.ROW,r.legend.orientation||(r.legend.orientation=Fr.VERTICAL)):y==="right"?(p=It.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Fr.VERTICAL)):y==="bottom"&&(p=It.COLUMN_REVERSE)}const f={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new Ie(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const y={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(y)}return m.push(v),[new Vu(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,m,{direction:It.COLUMN})]}}class we extends an{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:VP,curves:zP,zoom:jP}),this.model=new Or(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",G.TOP,"enabled"),s=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=x(r,"axes",a,"scaleType"),l=i&&a===G.BOTTOM&&o===tt.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},p={id:"header",components:[new Ie(this.model,this.services,[d,...s?[h]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},f={id:"legend",components:[new Hu(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new Kg(this.model,this.services),new zL(this.model,this.services)),t.push(new WL(this.model,this.services)),t.push(new qL(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=It.COLUMN;if(m){const O=x(this.model.getOptions(),"legend","position");O===Vr.LEFT?(y=It.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Fr.VERTICAL)):O===Vr.RIGHT?(y=It.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Fr.VERTICAL)):O===Vr.BOTTOM&&(y=It.COLUMN_REVERSE)}const g={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},b={id:"full-frame",components:[new Ie(this.model,this.services,[...m?[f]:[],...m?[g]:[],v],{direction:y})],growth:ht.STRETCH},T={id:"zoom-bar",components:[new jL(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},E=[];if(u||s){E.push(p);const O={id:"spacer",components:[new Hn(this.model,this.services,s?{size:15}:void 0)],growth:ht.PREFERRED};E.push(O)}return l&&E.push(T),E.push(b),[new ev(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,E,{direction:It.COLUMN})]}}class b3 extends an{constructor(t,n){super(t,n),this.model=new o$(this.services),this.model.setOptions(zt(Nt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new pR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class _3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Tn(Nt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new Ei(this.model,this.services),new uv(this.model,this.services),new xn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class E3 extends we{constructor(t,n){super(t,n),this.model=new l$(this.services),this.model.setOptions(zt(Nt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new gR(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class T3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new vR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class O3 extends we{constructor(t,n){super(t,n),this.model=new c$(this.services),this.model.setOptions(zt(Nt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new yR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class S3 extends an{constructor(t,n){super(t,n),this.model=new u$(this.services),this.model.setOptions(zt(Nt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[a,...i?[o]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new fv(this.model,this.services,{chartType:"choropleth"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=It.COLUMN_REVERSE,p={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new Vu(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,v,{direction:It.COLUMN})]}getComponents(){const t=[new qN(this.model,this.services)];return this.getChartComponents(t)}}class w3 extends an{constructor(t,n){super(t,n),this.model=new h$(this.services),this.model.setOptions(zt(Nt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new NR(this.model,this.services)];return this.getChartComponents(t)}}const u0={[Me.LINE]:[Ei,xn],[Me.SCATTER]:[xn],[Me.AREA]:[uv,Ei,xn],[Me.STACKED_AREA]:[bv,Ei,Ev,No],[Me.SIMPLE_BAR]:[xv],[Me.GROUPED_BAR]:[yv,Ti],[Me.STACKED_BAR]:[_v,No]};class $3 extends we{constructor(t,n){super(t,n);const r=zt(Nt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Me.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(u0).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=`${x3(i.type)}Chart`;return a=ct({},Nt[l],this.model.getOptions(),i.options),i.type===Me.STACKED_AREA&&(o=!0),u0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Xu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Me.STACKED_BAR||i.type===Me.STACKED_AREA),r=[new Se(this.model,this.services),new Ne(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID}),...n?[]:[new Jn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class h0 extends an{constructor(t,n,r=!1){super(t,n),this.model=new d$(this.services),!r&&(this.model.setOptions(zt(Nt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new mv(this.model,this.services),new xe(this.model,this.services,{skeleton:te.PIE})];return this.getChartComponents(t)}}class M3 extends h0{constructor(t,n){super(t,n,!0),this.model.setOptions(zt(Nt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new UR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.DONUT})];return this.getChartComponents(t)}}class C3 extends an{constructor(t,n){super(t,n),this.model=new p$(this.services),this.model.setOptions(zt(Nt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new BR(this.model,this.services)];return this.getChartComponents(t)}}class A3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new yv(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class k3 extends we{constructor(t,n){super(t,n),this.model=new f$(this.services),this.model.setOptions(zt(Nt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(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 Vs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[a,...i?[o]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new fv(this.model,this.services,{chartType:"heatmap"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=It.COLUMN_REVERSE,p={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new ev(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,v,{direction:It.COLUMN})]}getComponents(){const t=[new Se(this.model,this.services),new HR(this.model,this.services)];return this.getAxisChartComponents(t)}}class L3 extends we{constructor(t,n){super(t,n),this.model=new m$(this.services),this.model.setOptions(zt(Nt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new $R(this.model,this.services),new VR(this.model,this.services)];return this.getAxisChartComponents(t)}}class R3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new Ei(this.model,this.services),new xn(this.model,this.services,{handleThresholds:!0}),new jR(this.model,this.services),new Ti(this.model,this.services)];return this.getAxisChartComponents(t)}}class D3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new FR(this.model,this.services),new xn(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class I3 extends an{constructor(t,n){var r;super(t,n),this.model=new g$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?ct(Tn(Nt.proportionalMeterChart),n.options):ct(Tn(Nt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new IR(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Hn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new GR(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new Ie(this.model,this.services,t,{direction:It.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class N3 extends an{constructor(t,n){super(t,n),this.model=new v$(this.services),this.model.setOptions(zt(Nt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new zR(this.model,this.services)];return this.getChartComponents(t)}}class P3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new xn(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class U3 extends an{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(zt(Nt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new WR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class B3 extends an{constructor(t,n){super(t,n),this.model=new x$(this.services),this.model.setOptions(zt(Nt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new _N(this.model,this.services)];return this.getChartComponents(t)}}class H3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new xv(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class V3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new No(this.model,this.services),new bv(this.model,this.services),new Ei(this.model,this.services,{stacked:!0}),new Ev(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class F3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new No(this.model,this.services),new _v(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ}),new Ti(this.model,this.services)];return this.getAxisChartComponents(t)}}class G3 extends an{constructor(t,n){super(t,n),this.model=new b$(this.services),this.model.setOptions(zt(Nt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new jN(this.model,this.services),new xe(this.model,this.services,{skeleton:te.PIE})];return this.getChartComponents(t)}}function z3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lh={exports:{}},zs={};/**
|
|
73
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=P(this);i.classed("hovered",!0);const a=t.model.getHierarchyLevel(),s=a>2&&!i.classed("focal"),o=_(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!s){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&&a<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:wt(p,"locale.translations.total")||wt(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(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&a<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=P(this);t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=P(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=P(this),a=i.classed("non-focal"),s=_(t.model.getOptions(),"canvasZoom","enabled");if(s&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");P(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,di)}else if(r.depth===2&&r.children&&!a&&s){const o=t.parent.selectAll("circle.node");P(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,di),n.stopPropagation()}t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function VD(e,t){const n=va(this._current,e);return r=>(this._current=n(r),t(this._current))}class qv extends Ot{constructor(){super(...arguments),this.type="pie",this.renderType=ut.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Ft.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:a}=i.data,{valueMapsTo:s}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(D=>D[s]>0),l=this.computeRadius();this.arc=Xa().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Xa().innerRadius(this.getInnerRadius()).outerRadius(l+Ft.hoverArc.outerRadiusOffset);const c=vL().value(D=>D[s]).sort(_(i,"pie","sortFunction")).padAngle(Ft.padAngle)(o),u=U.appendOrSelect(r,"g.slices").attr("role",yt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,D=>D.data[a]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",D=>this.model.getColorClassName({classNameTypes:[dt.FILL],dataGroupName:D.data[a],originalClassName:"slice"})).style("fill",D=>n.model.getFillColor(D.data[a],null,D.data)).attr("d",this.arc).transition().call(D=>this.services.transitions.setupTransition({transition:D,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",D=>`${D[s]}, ${Vc(D.data[s],o,s)+"%"}`).attrTween("d",function(D){return VD.bind(this)(D,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=_(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(D=>D.data[s]>0):[],g=U.appendOrSelect(r,"g.labels").attr("role",yt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,D=>D.data[a]);g.exit().attr("opacity",0).remove();const m=g.enter().append("text").classed("pie-label",!0),y=[];m.merge(g).style("text-anchor","middle").text(D=>i.pie.labels.formatter?i.pie.labels.formatter({...D,percentageValue:Vc(D.data[s],o,s,!0)}):h(Vc(D.data[s],o,s),d)+"%").datum(function(D){const I=l+7,M=(D.endAngle-D.startAngle)/2+D.startAngle,q=M/Math.PI*180,H=this.getComputedTextLength();return D.textOffsetX=H/2,D.textOffsetY=q>90&&q<270?10:0,D.xPosition=(D.textOffsetX+I)*Math.sin(M),D.yPosition=(D.textOffsetY+I)*-Math.cos(M),D}).attr("transform",function(D,I){const M=f.length,q=(D.endAngle-D.startAngle)*(180/Math.PI);if(I>=M-2&&q<Ft.callout.minSliceDegree){let H,G;return D.index===M-1?(H=D.xPosition+Ft.callout.offsetX+Ft.callout.textMargin+D.textOffsetX,G=D.yPosition-Ft.callout.offsetY,D.direction=qi.RIGHT,y.push(D)):(H=D.xPosition-Ft.callout.offsetX-D.textOffsetX-Ft.callout.textMargin,G=D.yPosition-Ft.callout.offsetY,D.direction=qi.LEFT,y.push(D)),`translate(${H}, ${G})`}return`translate(${D.xPosition}, ${D.yPosition})`}),this.renderCallouts(y);const v=_(i,"donut")?"donut":"pie",x=_(i,v,"alignment"),{width:T}=U.getSVGElementSize(this.getParent(),{useAttrs:!0}),E=p?Ft.xOffset:0,S=p?Ft.yOffset:0;let L=l+E;x===ie.CENTER?L=T/2:x===ie.RIGHT&&(L=T-l-Ft.xOffset);let N=l+S;y.length>0&&(N+=Ft.yOffsetCallout),r.attr("x",L+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=U.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",yt.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",yt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(a){const{xPosition:s,yPosition:o,direction:l}=a;return l===qi.RIGHT?(a.startPos={x:s,y:o+a.textOffsetY},a.endPos={x:s+Ft.callout.offsetX,y:o-Ft.callout.offsetY+a.textOffsetY},a.intersectPointX=a.endPos.x-Ft.callout.horizontalLineLength):(a.startPos={x:s,y:o+a.textOffsetY},a.endPos={x:s-Ft.callout.offsetX,y:o-Ft.callout.offsetY+a.textOffsetY},a.intersectPointX=a.endPos.x+Ft.callout.horizontalLineLength),a}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return P(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",a=>a.startPos.x).attr("y1",a=>a.startPos.y).attr("x2",a=>a.intersectPointX).attr("y2",a=>a.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return P(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",a=>a.intersectPointX).attr("y1",a=>a.endPos.y).attr("x2",a=>a.endPos.x).attr("y2",a=>a.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=P(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(w.Pie.SLICE_MOUSEOVER,{event:n,element:P(this),datum:r});const{groupMapsTo:a}=t.getOptions().data,{valueMapsTo:s}=t.getOptions().pie;t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[a],value:r.data[s]}]})}).on("mousemove",function(n,r){const i=P(this);t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Pie.SLICE_CLICK,{event:n,element:P(this),datum:r})}).on("mouseout",function(n,r){const i=P(this);BA(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(a=>t.services.transitions.setupTransition({transition:a,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=U.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Ft.radiusOffset:i}}class FD extends qv{constructor(){super(...arguments),this.type="donut",this.renderType=ut.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=U.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),a=this.computeRadius(),s=_(i,"donut","center","label");U.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>s===null||s===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(a)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(P(this))}),s!==null&&s!==""&&U.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(a)).attr("y",i.donut.center.titleYPosition(a)).text(s)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=_(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 a;i%1===0&&r%1===0?a=Vp:a=Pe;const s=a(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(s(o)));else{const{code:c,number:u}=_(n,"locale");t.text(u(Math.floor(s(o)),c))}}}}const Yv="4,10 8,6 12,10",Zv="12,6 8,10 4,6";class GD extends Ot{constructor(){super(...arguments),this.type="gauge",this.renderType=ut.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return eg(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 _(t,"gauge","type")===yr.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(_(n,"gauge","deltaArrow","direction")){case fs.UP:return Yv;case fs.DOWN:return Zv;default:return t>0?Yv:Zv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),a=this.getValueRatio(),s=this.getArcSize(),o=this.getStartAngle(),l=a*s,c=o+l,u=o+s,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Xa().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Xa().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),U.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:[dt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>_(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=_(r,"gauge","alignment"),{width:g}=U.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===ie.CENTER?m=g/2:f===ie.RIGHT&&(m=g-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=_(n,"gauge","type"),i=this.getValue(),a=this.getDelta(),s=this.computeRadius(),o=_(n,"gauge","valueFontSize"),l=_(n,"gauge","deltaFontSize"),c=_(n,"gauge","numberSpacing"),u=_(n,"gauge","showPercentageSymbol");let d=0;r===yr.FULL&&!a?d=l(s):r===yr.SEMI&&a&&(d=-(l(s)+c));const h=U.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(s),f=U.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=_(n,"locale"),y=_(n,"gauge","numberFormatter"),v=f.selectAll("text.gauge-value-number").data([i]);v.enter().append("text").attr("class","gauge-value-number").merge(v).style("font-size",`${p}px`).attr("text-anchor","middle").text(D=>{let I;return D!=null?I=Number(D.toFixed(2))%1!==0?D.toFixed(2):D.toFixed():I=0,y?y(I):m(Number(I),g)});const{width:x}=U.getSVGElementSize(U.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),T=p/2,E=u?"%":"",S=U.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${T}px`).attr("x",x/2).text(E),{width:L,height:N}=U.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${N/2}px`),f.attr("transform",`translate(-${L/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:a,number:s}=_(r,"locale");if(i){const o=this.computeRadius(),l=i?_(r,"gauge","deltaFontSize"):()=>0,c=i?_(r,"gauge","numberFormatter"):()=>null,u=_(r,"gauge","deltaArrow","size"),d=_(r,"gauge","numberSpacing"),h=_(r,"gauge","showPercentageSymbol"),p=U.appendOrSelect(n,"g.gauge-numbers"),f=U.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=U.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(T=>{let E;return T!=null?E=Number(T.toFixed(2))%1!==0?T.toFixed(2):T.toFixed():E=0,c?`${c(E)}${m}`:`${s(Number(E),a)}${m}`});const{width:y}=U.getSVGElementSize(U.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),v=_(r,"gauge","deltaArrow","enabled"),x=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&v?[i]:[]);x.enter().append("svg").merge(x).attr("class","gauge-delta-arrow").attr("x",-u(o)-y/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 T=P(this);U.appendOrSelect(T,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const E=_(r,"gauge","status");U.appendOrSelect(T,"polygon.gauge-delta-arrow").attr("class",E!==null?`gauge-delta-arrow status--${E}`:"").attr("points",t.getArrow(i))}),x.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=_(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(w.Gauge.ARC_MOUSEOVER,{event:n,element:P(this),datum:r})}).on("mousemove",function(n,r){const i=P(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Gauge.ARC_CLICK,{event:n,element:P(this),datum:r})}).on("mouseout",function(n,r){const i=P(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=_(t,"gauge","type"),{width:r,height:i}=U.getSVGElementSize(this.parent,{useAttrs:!0});return n===yr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Xv extends vh{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=ut.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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 a=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),s=da(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=a.selectAll("g.bars").data(s,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",yt.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()===re.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:[dt.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),y=this.services.cartesianScales.getValueThroughAxisPosition(g,m),v=this.services.cartesianScales.getRangeValue(u),x=this.services.cartesianScales.getDomainValue(u)-h/2,T=x+h;if(!this.isOutsideZoomedDomain(x,T))return Oe({x0:p,x1:f,y0:y,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",yt.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=P(this);i.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=P(this);t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:n,element:P(this),datum:r})}).on("mouseout",function(n,r){const i=P(this);i.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.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(a=>{var s;return((s=a.data)==null?void 0:s.length)>1});if(i){const a=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][a])-t(i.data[0][a]))}}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=_(t,"bars","width"),r=_(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ca().domain(t).rangeRound([0,this.getGroupWidth()])}}class zD extends Ot{constructor(){super(...arguments),this.type="heatmap",this.renderType=ut.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(),a=this.model.getUniqueDomain(),s=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=s,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,a.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)}, ${nr(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${nr(l.range())},${c(r)})`),this.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n.event,hoveredElement:P(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/a.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(w.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(w.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(w.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(w.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(""),_(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),a=r.getMainYScale(),s=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=a.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[s])}, ${a(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=U.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);U.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),U.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),U.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),U.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=_(this.getOptions(),"heatmap","divider","state");return t!==Jr.OFF&&(t===Jr.AUTO&&yf.minCellDividerDimension<=this.xBandwidth&&yf.minCellDividerDimension<=this.yBandwidth||t===Jr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=wt(r,"locale.translations.total")||wt(r,"tooltip.totalLabel")||"Total",a=n.getDomainIdentifier(),s=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=P(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=Sa(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(w.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,items:[{label:o,value:u[a]},{label:l,value:u[s]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:P(this),datum:u}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_CLICK,{event:c,element:P(this),datum:u})}).on("mouseout",function(c,u){const d=P(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class jD extends Ot{constructor(){super(...arguments),this.type="histogram",this.renderType=ut.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-bar"})).attr("opacity",a=>a[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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:a}=r.data,s=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(s,u=>wt(u,`0.${a}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",yt.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:[dt.FILL],dataGroupName:u[a],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[a],null,u)).attr("d",u=>{const d=wt(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()===re.VERTICAL?m+=1:m-=1),Oe({x0:p,x1:f,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>_(u,"data",u[a])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=_(t,"locale"),a=this;this.parent.selectAll("path.bar").on("mouseover",function(s,o){const l=P(this);l.classed("hovered",!0);const c=i(parseFloat(wt(o,"data.x0")),r),u=i(parseFloat(wt(o,"data.x1")),r),d=a.services.cartesianScales.getRangeAxisPosition(),h=a.services.cartesianScales.getScaleLabel(d);a.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:l,items:[{label:wt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:a.model.getColorClassName({classNameTypes:[dt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:wt(o,`data.${o[n]}`)}]})}).on("mousemove",function(s){a.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("mouseout",function(){P(this).classed("hovered",!1),a.services.events.dispatchEvent(w.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class WD extends An{constructor(){super(...arguments),this.type="lollipop",this.renderType=ut.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",a=>a[i]!==n.datum[i]?Bn.weight.unselected:Bn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Bn.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-line"})).attr("opacity",a=>a[i]!==n.datum().name?Bn.opacity.unselected:Bn.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",Bn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:a}=this.services,s=a.getMainXScale(),o=a.getMainYScale(),l=a.getDomainIdentifier(),c=m=>a.getDomainValue(m),u=m=>a.getRangeValue(m),d=a.getOrientation(),[h,p]=Vn(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:[dt.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===re.HORIZONTAL?g.attr("y1",p).attr("y2",p).attr("x1",s.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(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class qD extends Ot{constructor(){super(...arguments),this.type="meter",this.renderType=ut.SVG}getStackedBounds(t,n){let r=0;return t.map((i,a)=>a!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-me.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-me.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),a=_(i,"meter","proportional"),s=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=U.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;_(i,"meter","proportional")===null?u=100:u=_(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=hn().domain([0,u]).range([0,l]),h=this.getStackedBounds(s,d),p=_(i,"meter","height");U.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(a?me.height.proportional:me.height.default)),U.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(a?me.height.proportional:me.height.default));const f=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!a?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",x=>x.x).attr("y",0).attr("height",()=>p||(a?me.height.proportional:me.height.default)).attr("class",x=>this.model.getColorClassName({classNameTypes:[dt.FILL],dataGroupName:x[c],originalClassName:g})).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"meter-bar-update",animate:t})).attr("width",x=>x.value>u?d(u):Math.max(x.width,2)).style("fill",x=>n.model.getFillColor(x[c],null,x)).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x.value),f.exit().remove();const m=_(i,"meter","peak");let y=m;m!==null&&(m>u?y=u:m<0&&(y=0));const v=r.selectAll("line.peak").data(y==null?[]:[y]);v.enter().append("line").classed("peak",!0).merge(v).attr("y1",0).attr("y2",()=>p||(a?me.height.proportional:me.height.default)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"peak-line-update",animate:t})).attr("x1",x=>d(x)).attr("x2",x=>d(x)).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",x=>x),v.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=_(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(a,s){const o=P(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOVER,{event:a,element:o,datum:s}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:s[n],value:s.value}]}))}).on("mousemove",function(a,s){const o=P(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEMOVE,{event:a,element:o,datum:s}),i&&r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:a})}).on("click",function(a,s){r.services.events.dispatchEvent(w.Meter.METER_CLICK,{event:a,element:P(this),datum:s})}).on("mouseout",function(a,s){const o=P(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOUT,{event:a,element:o,datum:s}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class YD extends Ot{constructor(){super(...arguments),this.type="radar",this.renderType=ut.SVG,this.getLabelDimensions=t=>{const n=U.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=U.appendOrSelect(n,"text").text(t),{width:i,height:a}=U.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:a}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=_(n,"radar","axes"),a=_(n,"data","groupMapsTo"),s=GA(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[a]:l,[i]:null}))));return pt(s,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=_(n,"radar","axes"),a=_(n,"data","groupMapsTo");return t.map(({name:s,data:o})=>{const l=this.uniqueKeys.map(c=>({[a]:s,[r]:c,[i]:null}));return{name:s,data:pt(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?kr.opacity.unselected:kr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?kr.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",kr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=U.getSVGElementSize(n,{useAttrs:!0}),a=this.model.getData(),s=this.model.getGroupedData(),o=this.getOptions(),l=_(o,"data","groupMapsTo"),c=_(o,"radar","axes","value"),{angle:u,value:d}=_(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:g,xAxisRectHeight:m}=kr;this.uniqueKeys=Array.from(new Set(a.map(O=>O[u]))),this.uniqueGroups=Array.from(new Set(a.map(O=>O[l]))),this.fullDataNormalized=this.normalizeFlatData(a),this.groupedDataNormalized=this.normalizeGroupedData(s);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),v=(Math.min(r,i)-y)/2;if(v<=0)return;const x=Ca().domain(this.fullDataNormalized.map(O=>O[u])).range([0,2*Math.PI].map(O=>O-Math.PI/2)),T=nr(this.fullDataNormalized.map(O=>O[d])),E=hn().domain([T>=0?0:T,wr(this.fullDataNormalized.map(O=>O[d]))]).range([g,v]).nice(f),S=E.ticks(f),L=(O,k,$)=>this.model.getFillColor(O,k,$),N=_L().angle(O=>x(O[u])+Math.PI/2).radius(O=>E(O[d])).curve(_m),D=this.uniqueKeys.map(O=>{const k=this.getLabelDimensions(O).width,$=q2(x(O),v);return k+$}),I={x:wr(D)+h,y:i/2},M=U.appendOrSelect(n,"g.y-axes").attr("role",yt.GROUP).selectAll("path").data(S,O=>O),q=O=>this.uniqueKeys.map(k=>({[u]:k,[d]:O}));M.join(O=>O.append("path").attr("opacity",0).attr("transform",`translate(${I.x}, ${I.y})`).attr("fill","none").call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>N(q($)))),O=>O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${I.x}, ${I.y})`).attr("d",$=>N(q($)))),O=>O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>N(q($))).attr("opacity",0).remove())),U.appendOrSelect(n,"g.x-axes").attr("role",yt.GROUP).selectAll("line").data(this.uniqueKeys,O=>O).join(O=>O.append("line").attr("opacity",0).attr("class",k=>`x-axis-${Oi(k)}`).attr("stroke-dasharray","0").attr("x1",k=>Kt(x(k),0,I).x).attr("y1",k=>Kt(x(k),0,I).y).attr("x2",k=>Kt(x(k),0,I).x).attr("y2",k=>Kt(x(k),0,I).y).call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Kt(x($),E.range()[0],I).x).attr("y1",$=>Kt(x($),E.range()[0],I).y).attr("x2",$=>Kt(x($),E.range()[1],I).x).attr("y2",$=>Kt(x($),E.range()[1],I).y)),O=>O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Kt(x($),E.range()[0],I).x).attr("y1",$=>Kt(x($),E.range()[0],I).y).attr("x2",$=>Kt(x($),E.range()[1],I).x).attr("y2",$=>Kt(x($),E.range()[1],I).y)),O=>O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),U.appendOrSelect(n,"g.x-labels").attr("role",yt.GROUP).selectAll("text").data(this.uniqueKeys).join(O=>O.append("text").text(k=>k).attr("opacity",0).attr("x",k=>Kt(x(k),E.range()[1]+h,I).x).attr("y",k=>Kt(x(k),E.range()[1]+h,I).y).style("text-anchor",k=>Im(x(k)).textAnchor).style("dominant-baseline",k=>Im(x(k)).dominantBaseline).call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),O=>O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Kt(x($),E.range()[1]+h,I).x).attr("y",$=>Kt(x($),E.range()[1]+h,I).y).end().finally(()=>{const $=_(o,"radar","alignment"),B=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",B)})),O=>O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),U.appendOrSelect(n,"g.blobs").attr("role",yt.GROUP).selectAll("path").data(this.groupedDataNormalized,O=>O.name).join(O=>O.append("path").attr("class",k=>this.model.getColorClassName({classNameTypes:[dt.FILL,dt.STROKE],dataGroupName:k.name,originalClassName:"blob"})).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-label",k=>k.name).attr("opacity",0).attr("transform",t?()=>`translate(${I.x}, ${I.y}) scale(${1+Math.random()*.35})`:`translate(${I.x}, ${I.y})`).style("fill",k=>L(k.name,null,k.data)).style("fill-opacity",kr.opacity.selected).style("stroke",k=>L(k.name,null,k.data)).call(k=>{const $=k.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${I.x}, ${I.y})`),$.attr("opacity",1).attr("d",B=>N(B.data))}),O=>(O.attr("class",k=>this.model.getColorClassName({classNameTypes:[dt.FILL,dt.STROKE],dataGroupName:k.name,originalClassName:"blob"})).style("fill",k=>L(k.name,null,k.data)).style("stroke",k=>L(k.name,null,k.data)),O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${I.x}, ${I.y})`).attr("d",$=>N($.data))),O),O=>O.call(k=>{const $=k.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${I.x}, ${I.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),U.appendOrSelect(n,"g.dots").attr("role",yt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(O=>_(O,d)!==null)).join(O=>O.append("circle").attr("role",yt.GRAPHICS_SYMBOL).attr("aria-label",k=>k[c]),O=>O,O=>O.remove()).attr("class",O=>this.model.getColorClassName({classNameTypes:[dt.FILL],dataGroupName:O[l],originalClassName:Oi(O[u])})).attr("cx",O=>Kt(x(O[u]),E(O[d]),I).x).attr("cy",O=>Kt(x(O[u]),E(O[d]),I).y).attr("r",0).attr("opacity",0).style("fill",O=>L(O[l])),U.appendOrSelect(n,"g.x-axes-rect").attr("role",yt.GROUP).selectAll("rect").data(this.uniqueKeys).join(O=>O.append("rect"),O=>O,O=>O.remove()).attr("x",I.x).attr("y",I.y-m/2).attr("width",E.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",O=>`rotate(${Nm(x(O))}, ${I.x}, ${I.y})`);const{code:H,number:G}=_(o,"locale");U.appendOrSelect(n,"g.y-labels").attr("role",yt.GROUP).selectAll("text").data(ln(S)).join(O=>O.append("text").attr("opacity",0).text(k=>G(k,H)).attr("x",k=>Kt(-Math.PI/2,E(k),I).x+p).attr("y",k=>Kt(-Math.PI/2,E(k),I).y).style("text-anchor","start").style("dominant-baseline","middle").call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),O=>O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Kt(-Math.PI/2,E($),I).x+p).attr("y",$=>Kt(-Math.PI/2,E($),I).y)),O=>O.call(k=>k.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=U.getSVGElementSize(n,{useBBox:!0}),{width:a}=U.getSVGElementSize(r,{useAttrs:!0});let s=0;return t===ie.CENTER?s=Math.floor((a-i.width)/2):t===ie.RIGHT&&(s=a-i.width),s}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=_(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const a=P(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOVER,{event:r,element:a,datum:i});const s=t.parent.select(`.x-axes .x-axis-${Oi(i)}`),o=t.parent.selectAll(`.dots circle.${Oi(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=_(c,"radar","axes","value");s.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",kr.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:r,hoveredElement:a,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:[dt.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const a=P(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEMOVE,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.Radar.X_AXIS_CLICK,{event:r,element:P(this),datum:i})}).on("mouseout",function(r,i){const a=P(this),s=t.parent.select(`.x-axes .x-axis-${Oi(i)}`),o=t.parent.selectAll(`.dots circle.${Oi(i)}`);s.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOUT,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE)})}}class Kv extends vh{constructor(){super(...arguments),this.type="simple-bar",this.renderType=ut.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(a,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:[dt.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 y=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,y)),g=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(g-f);if(m!==0&&m<2&&(d>0&&s===re.VERTICAL||d<0&&s===re.HORIZONTAL?g=f-2:g=f+2),!this.isOutsideZoomedDomain(h,p))return Oe({x0:h,x1:p,y0:f,y1:g},s)}).attr("opacity",1).attr("role",yt.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=P(this);i.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:P(this),datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:n,element:P(this),datum:r})}).on("mouseout",function(n,r){const i=P(this);i.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ZD extends $e{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=_(this.getOptions(),"data","loading"),r=!_(this.getOptions(),"grid","x","enabled")&&!_(this.getOptions(),"grid","y","enabled")&&!_(this.getOptions(),"axes","bottom","visible")&&!_(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=U.appendOrSelect(this.backdrop,"g.y.skeleton"),a=i.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",0).attr("x2",n).attr("y1",s=>s).attr("y2",s=>s),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=U.appendOrSelect(t,"svg.chart-skeleton.DAII"),U.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Qv extends Ot{constructor(){super(...arguments),this.type="area-stacked",this.renderType=ut.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-area"})).attr("opacity",a=>_(a,0,i)!==n.datum().name?Un.opacity.unselected:Un.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",Un.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:a}=i.data,s=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:s,groups:this.configs.groups}),l=_(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=>_(p,0,a));this.areaGenerator=th().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=>_(p,0,a)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[dt.FILL],dataGroupName:_(p,0,a),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(_(p,0,a),null,p)).attr("role",yt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>_(p,0,a)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Un.opacity.selected).attr("d",this.areaGenerator)}}class Jv extends vh{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=ut.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),s=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(a,c=>_(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",yt.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:[dt.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&&s.length>1?this.services.cartesianScales.getOrientation()===re.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===re.VERTICAL?g+=1:g-=1)}return Oe({x0:h,x1:p,y0:f,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",yt.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,a){const s=P(this);s.classed("hovered",!0),r.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:i,element:s,datum:a});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]===a.data[a[n]]&&l[c].toString()===a.data.sharedStackKey&&l[n]===a[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:a.data.sharedStackKey,[c]:a.data[a[n]],[n]:a[n]}}r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:s,data:[o]})}).on("mousemove",function(i,a){const s=P(this);r.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:i,element:s,datum:a}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,a){r.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:i,element:P(this),datum:a})}).on("mouseout",function(i,a){const s=P(this);s.classed("hovered",!1),r.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:i,element:s,datum:a}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:s})})}getBarWidth(){const t=this.getOptions();if(_(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=U.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,a=_(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*a/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class t0 extends An{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=ut.SVG}render(t){if(!_(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=Object.keys(r.axes).some(u=>r.axes[u].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:a}),o=n.selectAll("g.dots").data(s,u=>_(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",yt.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,a=Object.keys(r.axes).some(l=>r.axes[l].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:a}),o=[];return s.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),y=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(g)&&(a&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[y]: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 Di=6;class XD extends Ot{constructor(){super(...arguments),this.type="tree",this.renderType=ut.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}=U.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}=U.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const a=this.model.getOptions(),s=this.model.getDisplayData(),o=_(a,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(s),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+Di:30-Di},h=qa({name:o,children:s}),p=10,f=r/6,g=S=>{const L=h.descendants().reverse(),N=h.links();let D=h,I=h;h.eachBefore(B=>{B.x<D.x&&(D=B),B.x>I.x&&(I=B)});const M=I.x-D.x,q=n.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,D.x,r,M].join(" ")),H=E.selectAll("g").data(L,B=>B.id),G=this,O=H.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",B=>B.depth!==0&&B.children&&B.children.length>0?"clickable":null).on("mouseover",function(B,F){G.services.events.dispatchEvent(w.Tree.NODE_MOUSEOVER,{event:B,element:P(this),datum:F})}).on("click",function(B,F){F.depth!==0&&(F.children=F.children?null:F._children,g(F)),G.services.events.dispatchEvent(w.Tree.NODE_CLICK,{event:B,element:P(this),datum:F})}).on("mouseout",function(B,F){G.services.events.dispatchEvent(w.Tree.NODE_MOUSEOUT,{event:B,element:P(this),datum:F})});O.append("circle").attr("r",2.5).attr("class",B=>B._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",B=>B._children?-Di:Di).attr("text-anchor",B=>B._children?"end":"start").text(B=>B.data.name).clone(!0).attr("class","text-stroke").lower(),H.merge(O).transition(q).attr("transform",B=>`translate(${B.y},${B.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),H.exit().transition(q).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const k=T.selectAll("path").data(N,B=>B.target.id),$=k.enter().append("path").attr("d",()=>{const B={x:S.x0,y:S.y0};return x({source:B,target:B})});k.merge($).transition(q).attr("d",x),k.exit().transition(q).remove().attr("d",()=>{const B={x:S.x,y:S.y};return x({source:B,target:B})}),h.eachBefore(B=>{B.x0=B.x,B.y0=B.y})},m=h.descendants(),y=m[m.length-1].depth,v=_(a,"tree","type")===ps.DENDROGRAM?gR().size([i,r-u-y*Di-l]):rL().nodeSize([p,f]).size([i,r-u-y*Di-l]),x=wL().x(S=>S.y).y(S=>S.x);h.x0=f/2,h.y0=0,h.descendants().forEach((S,L)=>{S.id=L,S._children=S.children}),v(h),n.attr("viewBox",[-d.left,-d.top,r,p]).style("user-select","none");const T=n.append("g").attr("class","links"),E=n.append("g").attr("class","nodes");g(h)}}var KD="#000000",QD="#ffffff",JD="#fcf4d6",tI="#fddc69",eI="#f1c21b",nI="#d2a106",rI="#b28600",iI="#8e6a00",aI="#684e00",sI="#483700",oI="#302400",lI="#1c1500",cI={10:JD,20:tI,30:eI,40:nI,50:rI,60:iI,70:aI,80:sI,90:oI,100:lI},uI="#fff2e8",hI="#ffd9be",dI="#ffb784",pI="#ff832b",fI="#eb6200",mI="#ba4e00",gI="#8a3800",vI="#5e2900",yI="#3e1a00",bI="#231000",_I={10:uI,20:hI,30:dI,40:pI,50:fI,60:mI,70:gI,80:vI,90:yI,100:bI},xI="#fff1f1",EI="#ffd7d9",OI="#ffb3b8",TI="#ff8389",SI="#fa4d56",wI="#da1e28",$I="#a2191f",MI="#750e13",CI="#520408",AI="#2d0709",kI={10:xI,20:EI,30:OI,40:TI,50:SI,60:wI,70:$I,80:MI,90:CI,100:AI},RI="#fff0f7",LI="#ffd6e8",DI="#ffafd2",II="#ff7eb6",NI="#ee5396",PI="#d02670",UI="#9f1853",BI="#740937",HI="#510224",VI="#2a0a18",FI={10:RI,20:LI,30:DI,40:II,50:NI,60:PI,70:UI,80:BI,90:HI,100:VI},GI="#f6f2ff",zI="#e8daff",jI="#d4bbff",WI="#be95ff",qI="#a56eff",YI="#8a3ffc",ZI="#6929c4",XI="#491d8b",KI="#31135e",QI="#1c0f30",JI={10:GI,20:zI,30:jI,40:WI,50:qI,60:YI,70:ZI,80:XI,90:KI,100:QI},tN="#edf5ff",eN="#d0e2ff",nN="#a6c8ff",rN="#78a9ff",iN="#4589ff",aN="#0f62fe",sN="#0043ce",oN="#002d9c",lN="#001d6c",cN="#001141",uN={10:tN,20:eN,30:nN,40:rN,50:iN,60:aN,70:sN,80:oN,90:lN,100:cN},hN="#e5f6ff",dN="#bae6ff",pN="#82cfff",fN="#33b1ff",mN="#1192e8",gN="#0072c3",vN="#00539a",yN="#003a6d",bN="#012749",_N="#061727",xN={10:hN,20:dN,30:pN,40:fN,50:mN,60:gN,70:vN,80:yN,90:bN,100:_N},EN="#d9fbfb",ON="#9ef0f0",TN="#3ddbd9",SN="#08bdba",wN="#009d9a",$N="#007d79",MN="#005d5d",CN="#004144",AN="#022b30",kN="#081a1c",RN={10:EN,20:ON,30:TN,40:SN,50:wN,60:$N,70:MN,80:CN,90:AN,100:kN},LN="#defbe6",DN="#a7f0ba",IN="#6fdc8c",NN="#42be65",PN="#24a148",UN="#198038",BN="#0e6027",HN="#044317",VN="#022d0d",FN="#071908",GN={10:LN,20:DN,30:IN,40:NN,50:PN,60:UN,70:BN,80:HN,90:VN,100:FN},zN="#f2f4f8",jN="#dde1e6",WN="#c1c7cd",qN="#a2a9b0",YN="#878d96",ZN="#697077",XN="#4d5358",KN="#343a3f",QN="#21272a",JN="#121619",tP={10:zN,20:jN,30:WN,40:qN,50:YN,60:ZN,70:XN,80:KN,90:QN,100:JN},eP="#f4f4f4",nP="#e0e0e0",rP="#c6c6c6",iP="#a8a8a8",aP="#8d8d8d",sP="#6f6f6f",oP="#525252",lP="#393939",cP="#262626",uP="#161616",hP={10:eP,20:nP,30:rP,40:iP,50:aP,60:sP,70:oP,80:lP,90:cP,100:uP},dP="#f7f3f2",pP="#e5e0df",fP="#cac5c4",mP="#ada8a8",gP="#8f8b8b",vP="#726e6e",yP="#565151",bP="#3c3838",_P="#272525",xP="#171414",EP={10:dP,20:pP,30:fP,40:mP,50:gP,60:vP,70:yP,80:bP,90:_P,100:xP},e0={black:{100:KD},blue:uN,coolGray:tP,cyan:xN,gray:hP,green:GN,magenta:FI,orange:_I,purple:JI,red:kI,teal:RN,warmGray:EP,white:{0:QD},yellow:cI};const OP=e=>{if(!e)return null;for(const t of Object.keys(e0)){const n=e0[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},n0=function(e){const t=P(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=In(n);let i;if(r&&(i=OP(r?r.hex():null)),i==null){const a=Pp(r).l;i=Math.abs(a*100-100)}return i>50?"white":"black"};let TP=0;class SP extends Ot{constructor(){super(...arguments),this.type="treemap",this.renderType=ut.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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(),a=_(window,"location"),{width:s,height:o}=U.getSVGElementSize(n,{useAttrs:!0}),l=qa({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=lL().size([s,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",()=>TP++).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=P(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:[dt.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=P(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=P(this.parentNode.parentNode).attr("data-uid"),g=`${i.style.prefix}-leaf-${f}`;return new URL(`#${g}`,a)+""}),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",n0).attr("x",7).attr("y",18);return a&&f.attr("clip-path",function(){const g=P(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${g}`;return`url(${new URL(`#${m}`,a)+""})`}),f},p=>p.text(f=>f.text).style("fill",n0),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=P(this);let a=getComputedStyle(this,null).getPropertyValue("fill"),s=r;for(;s.depth>1;)s=s.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&&(a=l),In(a).darker(.7).toString()}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:a,label:s.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=P(this);t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Treemap.LEAF_CLICK,{event:n,element:P(this),datum:r})}).on("mouseout",function(n,r){const i=P(this);i.classed("hovered",!1);let a=r;for(;a.depth>1;)a=a.parent;i.transition().call(s=>t.services.transitions.setupTransition({transition:s,name:"graph_element_mouseout_fill_update"})).style("fill",s=>t.model.getFillColor(s.parent.data.name,null,s.data)),t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}}function wP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $P(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 MP={value:function(){}};function r0(){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 Ko(n)}function Ko(e){this._=e}function CP(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}})}Ko.prototype=r0.prototype={constructor:Ko,on:function(e,t){var n=this._,r=CP(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=AP(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=i0(n[i],e.name,t);else if(t==null)for(i in n)n[i]=i0(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 Ko(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[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,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function AP(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function i0(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=MP,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const kP=Object.freeze(Object.defineProperty({__proto__:null,dispatch:r0},Symbol.toStringTag,{value:"Module"})),RP=$P(kP),LP=RP.dispatch,yh=Math.PI/180,DP={archimedean:s0,rectangular:jP},is=64,Qo=2048;var IP=function(){var e=[256,256],t=NP,n=PP,r=UP,i=a0,a=a0,s=BP,o=HP,l=s0,c=[],u=1/0,d=LP("word","end"),h=null,p=Math.random,f={},g=qP;f.canvas=function(v){return arguments.length?(g=ur(v),f):g},f.start=function(){var v=m(g()),x=WP((e[0]>>5)*e[1]),T=null,E=c.length,S=-1,L=[],N=c.map(function(I,M){return I.text=t.call(this,I,M),I.font=n.call(this,I,M),I.style=i.call(this,I,M),I.weight=a.call(this,I,M),I.rotate=s.call(this,I,M),I.size=~~r.call(this,I,M),I.padding=o.call(this,I,M),I}).sort(function(I,M){return M.size-I.size});return h&&clearInterval(h),h=setInterval(D,0),D(),f;function D(){for(var I=Date.now();Date.now()-I<u&&++S<E&&h;){var M=N[S];M.x=e[0]*(p()+.5)>>1,M.y=e[1]*(p()+.5)>>1,VP(v,M,N,S),M.hasText&&y(x,M,T)&&(L.push(M),d.call("word",f,M),T?GP(T,M):T=[{x:M.x+M.x0,y:M.y+M.y0},{x:M.x+M.x1,y:M.y+M.y1}],M.x-=e[0]>>1,M.y-=e[1]>>1)}S>=E&&(f.stop(),d.call("end",f,L,T))}},f.stop=function(){h&&(clearInterval(h),h=null);for(const v of c)delete v.sprite;return f};function m(v){const x=v.getContext("2d",{willReadFrequently:!0});v.width=v.height=1;const T=Math.sqrt(x.getImageData(0,0,1,1).data.length>>2);return v.width=(is<<5)/T,v.height=Qo/T,x.fillStyle=x.strokeStyle="red",{context:x,ratio:T}}function y(v,x,T){e[0],e[1];for(var E=x.x,S=x.y,L=Math.sqrt(e[0]*e[0]+e[1]*e[1]),N=l(e),D=p()<.5?1:-1,I=-D,M,q,H;(M=N(I+=D))&&(q=~~M[0],H=~~M[1],!(Math.min(Math.abs(q),Math.abs(H))>=L));)if(x.x=E+q,x.y=S+H,!(x.x+x.x0<0||x.y+x.y0<0||x.x+x.x1>e[0]||x.y+x.y1>e[1])&&(!T||zP(x,T))&&!FP(x,v,e[0])){for(var G=x.sprite,O=x.width>>5,k=e[0]>>5,$=x.x-(O<<4),B=$&127,F=32-B,et=x.y1-x.y0,C=(x.y+x.y0)*k+($>>5),z,Q=0;Q<et;Q++){z=0;for(var at=0;at<=O;at++)v[C+at]|=z<<F|(at<O?(z=G[Q*O+at])>>>B:0);C+=k}return!0}return!1}return f.timeInterval=function(v){return arguments.length?(u=v??1/0,f):u},f.words=function(v){return arguments.length?(c=v,f):c},f.size=function(v){return arguments.length?(e=[+v[0],+v[1]],f):e},f.font=function(v){return arguments.length?(n=ur(v),f):n},f.fontStyle=function(v){return arguments.length?(i=ur(v),f):i},f.fontWeight=function(v){return arguments.length?(a=ur(v),f):a},f.rotate=function(v){return arguments.length?(s=ur(v),f):s},f.text=function(v){return arguments.length?(t=ur(v),f):t},f.spiral=function(v){return arguments.length?(l=DP[v]||v,f):l},f.fontSize=function(v){return arguments.length?(r=ur(v),f):r},f.padding=function(v){return arguments.length?(o=ur(v),f):o},f.random=function(v){return arguments.length?(p=v,f):p},f.on=function(){var v=d.on.apply(d,arguments);return v===d?f:v},f};function NP(e){return e.text}function PP(){return"serif"}function a0(){return"normal"}function UP(e){return Math.sqrt(e.value)}function BP(){return(~~(random()*6)-3)*30}function HP(){return 1}function VP(e,t,n,r){if(!t.sprite){var i=e.context,a=e.ratio;i.clearRect(0,0,(is<<5)/a,Qo/a);var s=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/a)+"px "+t.font;const M=i.measureText(t.text),q=-Math.floor(M.width/2);let H=(M.width+1)*a,G=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*yh),d=Math.cos(t.rotate*yh),h=H*d,p=H*u,f=G*d,g=G*u;H=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,G=~~Math.max(Math.abs(p+f),Math.abs(p-f))}else H=H+31>>5<<5;if(G>l&&(l=G),s+H>=is<<5&&(s=0,o+=l,l=0),o+G>=Qo)break;i.translate((s+(H>>1))/a,(o+(G>>1))/a),t.rotate&&i.rotate(t.rotate*yh),i.fillText(t.text,q,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,q,0)),i.restore(),t.width=H,t.height=G,t.xoff=s,t.yoff=o,t.x1=H>>1,t.y1=G>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=H}for(var m=i.getImageData(0,0,(is<<5)/a,Qo/a).data,y=[];--r>=0;)if(t=n[r],!!t.hasText){for(var v=t.width,x=v>>5,T=t.y1-t.y0,E=0;E<T*x;E++)y[E]=0;if(s=t.xoff,s==null)return;o=t.yoff;for(var S=0,L=-1,N=0;N<T;N++){for(var E=0;E<v;E++){var D=x*N+(E>>5),I=m[(o+N)*(is<<5)+(s+E)<<2]?1<<31-E%32:0;y[D]|=I,S|=I}S?L=N:(t.y0++,T--,N--,o++)}t.y1=t.y0+L,t.sprite=y.slice(0,(t.y1-t.y0)*x)}}}function FP(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,a=e.x-(i<<4),s=a&127,o=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>s:0))&t[c+h])return!0;c+=n}return!1}function GP(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function zP(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function s0(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function jP(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(a){var s=a<0?-1:1;switch(Math.sqrt(1+4*s*a)-s&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function WP(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function qP(){return document.createElement("canvas")}function ur(e){return typeof e=="function"?e:function(){return e}}const YP=wP(IP);class ZP extends Ot{constructor(){super(...arguments),this.type="wordcloud",this.renderType=ut.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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(),a=this.getFontSizeScale(i),s=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=s.wordCloud,{groupMapsTo:c}=s.data,{width:u,height:d}=U.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=YP().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=>a(f.size)).on("end",p);h.start();function p(f){const g=U.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(f,y=>`${y[c]}-${y.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[dt.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.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),a=U.getHTMLElementSize(this.services.domUtils.getMainContainer()),s=i.length>0,o=s?ln(i):[1,1];return hn().domain(o).range(s?n.wordCloud.fontSizeRange(a,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=no(a=>{const s=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));a===null?s.attr("opacity",1):s.attr("opacity",function(){return a===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(a,s){const o=this;i(o),r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEOVER,{event:a,element:P(this),datum:s}),r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:s.text},{label:t.tooltip.valueLabel,value:s.value},{label:wt(t,"locale.translations.group")||wt(t,"tooltip.groupLabel")||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[dt.TOOLTIP],dataGroupName:s[n]})}]})}).on("mousemove",function(a,s){const o=P(this);r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEMOVE,{element:o,datum:s}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:a})}).on("click",function(a,s){r.services.events.dispatchEvent(w.WordCloud.WORD_CLICK,{event:a,element:P(this),datum:s})}).on("mouseout",function(a,s){const o=P(this);i(null),r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEOUT,{event:a,element:o,datum:s}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class XP extends Ot{constructor(){super(...arguments),this.type="geo",this.renderType=ut.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=U.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),a=_(this.getOptions(),"geoData"),s=this.model.getCombinedData(),o={},l={};Object.keys(s).forEach(m=>{typeof s[m].value=="number"?o[m]=s[m]:l[m]=s[m]});const c=CD(a,Object.values(l)),u=wD(a,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Fk().projection(d);U.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=U.appendOrSelect(t,"defs");U.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",Ka()([[0,0],[0,10]]));const g=U.appendOrSelect(t,"g.missing-data");U.appendOrSelect(g,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(_(this.getOptions(),"thematic","projection")){case xn.geoEqualEarth:t=oR();break;case xn.geoAlbers:t=tR();break;case xn.geoConicEqualArea:t=tv();break;case xn.geoConicEquidistant:t=aR();break;case xn.geoEquirectangular:t=rR();break;case xn.geoMercator:t=eR();break;case xn.geoNaturalEarth1:t=lR();break;default:throw new Error("Projection is not supported.")}return t}}class KP extends XP{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 a=P(this);t.services.events.dispatchEvent(Xr.CHOROPLETH_MOUSEOVER,{event:r,element:a,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Zr.SHOW,{event:r,hoveredElement:a,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Xr.CHOROPLETH_MOUSEMOVE,{event:r,element:P(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Zr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Xr.CHOROPLETH_CLICK,{event:r,element:P(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const a=P(this);t.services.events.dispatchEvent(Xr.CHOROPLETH_MOUSEOUT,{event:r,element:a,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Zr.HIDE,{event:r,hoveredElement:a})})}}function bh(e){var t=e==null?0:e.length;return t?Ss(e,1):[]}function QP(e){return dd(md(e,void 0,bh),e+"")}function o0(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 a=Array(i);++r<i;)a[r]=e[r+t];return a}function JP(e,t){return t.length<2?e:nc(e,o0(t,0,-1))}function t3(e,t){return t=Ts(t,e),e=JP(e,t),e==null||delete e[ca(up(t))]}function e3(e){return Md(e)?void 0:e}var n3=1,r3=2,i3=4,a3=QP(function(e,t){var n={};if(e==null)return n;var r=!1;t=zl(t,function(a){return a=Ts(a,e),r||(r=a.length>1),a}),ti(e,Ud(e),n),r&&(n=ua(n,n3|r3|i3,e3));for(var i=t.length;i--;)t3(n,t[i]);return n});function l0(e){return Math.log(e)}function c0(e){return Math.exp(e)}function s3(e){return-Math.log(-e)}function o3(e){return-Math.exp(-e)}function l3(e){return isFinite(e)?+("1e"+e):e<0?0:e}function c3(e){return e===10?l3:e===Math.E?Math.exp:t=>Math.pow(e,t)}function u3(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 u0(e){return(t,n)=>-e(-t,n)}function h3(e){const t=e(l0,c0),n=t.domain;let r=10,i,a;function s(){return i=u3(r),a=c3(r),n()[0]<0?(i=u0(i),a=u0(a),e(s3,o3)):e(l0,c0),t}return t.base=function(o){return arguments.length?(r=+o,s()):r},t.domain=function(o){return arguments.length?(n(o),s()):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 y=[];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/a(-h):f*a(h),!(g<c)){if(g>u)break;y.push(g)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(g=h>0?f/a(-h):f*a(h),!(g<c)){if(g>u)break;y.push(g)}y.length*2<m&&(y=ks(c,u,m))}else y=ks(h,p,Math.min(p-h,m)).map(a);return d?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Ea(l)).precision==null&&(l.trim=!0),l=Nc(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/a(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(Xf(n(),{floor:o=>a(Math.floor(i(o))),ceil:o=>a(Math.ceil(i(o)))})),t}function h0(){const e=h3(ff()).domain([1,10]);return e.copy=()=>Uc(e,h0()).base(e.base()),ui.apply(e,arguments),e}function Jo(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 tl(e){this._context=e}tl.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:Jo(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:Jo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function d3(e){return new tl(e)}function d0(e){this._context=e}d0.prototype={areaStart:sr,areaEnd:sr,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:Jo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function p3(e){return new d0(e)}function p0(e){this._context=e}p0.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:Jo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function f3(e){return new p0(e)}function f0(e,t){this._basis=new tl(e),this._beta=t}f0.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],a=e[n]-r,s=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*a),this._beta*t[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const m3=function e(t){function n(r){return t===1?new tl(r):new f0(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function el(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 _h(e,t){this._context=e,this._k=(1-t)/6}_h.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:el(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:el(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 g3=function e(t){function n(r){return new _h(r,t)}return n.tension=function(r){return e(+r)},n}(0);function xh(e,t){this._context=e,this._k=(1-t)/6}xh.prototype={areaStart:sr,areaEnd:sr,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:el(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 v3=function e(t){function n(r){return new xh(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Eh(e,t){this._context=e,this._k=(1-t)/6}Eh.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:el(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 y3=function e(t){function n(r){return new Eh(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Oh(e,t,n){var r=e._x1,i=e._y1,a=e._x2,s=e._y2;if(e._l01_a>_e){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>_e){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);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,s,e._x2,e._y2)}function m0(e,t){this._context=e,this._alpha=t}m0.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:Oh(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 b3=function e(t){function n(r){return t?new m0(r,t):new _h(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function g0(e,t){this._context=e,this._alpha=t}g0.prototype={areaStart:sr,areaEnd:sr,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:Oh(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 _3=function e(t){function n(r){return t?new g0(r,t):new xh(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function v0(e,t){this._context=e,this._alpha=t}v0.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:Oh(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 x3=function e(t){function n(r){return t?new v0(r,t):new Eh(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function y0(e){return e<0?-1:1}function b0(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(y0(a)+y0(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function _0(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Th(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function nl(e){this._context=e}nl.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:Th(this,this._t0,_0(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,Th(this,_0(this,n=b0(this,e,t)),n);break;default:Th(this,this._t0,n=b0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function x0(e){this._context=new E0(e)}(x0.prototype=Object.create(nl.prototype)).point=function(e,t){nl.prototype.point.call(this,t,e)};function E0(e){this._context=e}E0.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,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function E3(e){return new nl(e)}function O3(e){return new x0(e)}function O0(e){this._context=e}O0.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=T0(e),i=T0(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(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 T0(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function T3(e){return new O0(e)}function rl(e,t){this._context=e,this._t=t}rl.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 S3(e){return new rl(e,.5)}function w3(e){return new rl(e,0)}function $3(e){return new rl(e,1)}class M3 extends qn{zoomIn(t,n,r){let i,a,s;const o=r||di;t&&(i=t.x,a=t.y,s=2);const{width:l,height:c}=U.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${s}) translate(${-i},${-a})`),this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_IN,{element:P(t)})}zoomOut(t,n){const r=n||di;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_OUT)}}class C3 extends qn{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 A3 extends qn{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 a=URL.createObjectURL(new Blob([t],{type:i}));r.href=a,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}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 k3 extends qn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(w.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(_(xf,n,"duration")||xf.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function as(e,t){const n=+Xt(e)-+Xt(t);return n<0?-1:n>0?1:n}function R3(e,t,n){const[r,i]=br(void 0,e,t);return r.getFullYear()-i.getFullYear()}function L3(e,t,n){const[r,i]=br(void 0,e,t),a=as(r,i),s=Math.abs(R3(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=as(r,i)===-a,l=a*(s-+o);return l===0?0:l}function Sh(e,t,n){const r=Xt(e,void 0);if(isNaN(t))return qe(e,NaN);if(!t)return r;const i=r.getDate(),a=qe(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const s=a.getDate();return i>=s?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}function S0(e,t,n){return Sh(e,t*12)}function D3(e,t,n){return S0(e,-t)}function I3(e,t,n){const[r,i]=br(void 0,e,t),a=r.getFullYear()-i.getFullYear(),s=r.getMonth()-i.getMonth();return a*12+s}function N3(e,t){const n=Xt(e,void 0);return n.setHours(23,59,59,999),n}function P3(e,t){const n=Xt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function U3(e,t){const n=Xt(e,void 0);return+N3(n)==+P3(n)}function B3(e,t,n){const[r,i,a]=br(void 0,e,e,t),s=as(i,a),o=Math.abs(I3(i,a));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-s*o);let l=as(i,a)===-s;U3(r)&&o===1&&as(r,a)===1&&(l=!1);const c=s*(o-+l);return c===0?0:c}function H3(e,t,n){return Sh(e,-t)}function V3(e,t,n){const[r,i]=br(void 0,e,t),a=w0(r,i),s=Math.abs(Lf(r,i));r.setDate(r.getDate()-a*s);const o=+(w0(r,i)===-a),l=a*(s-o);return l===0?0:l}function w0(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 $0(e,t,n){const r=Xt(e,void 0);return isNaN(t)?qe(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function F3(e,t,n){return $0(e,-t)}function wh(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function G3(e,t,n){const[r,i]=br(void 0,e,t),a=(+r-+i)/td;return wh(void 0)(a)}function M0(e,t,n){return qe(e,+Xt(e)+t)}function C0(e,t,n){return M0(e,t*td)}function z3(e,t,n){return C0(e,-t)}function A0(e,t){return+Xt(e)-+Xt(t)}function k0(e,t,n){const r=A0(e,t)/Jh;return wh(void 0)(r)}function $h(e,t,n){const r=Xt(e,void 0);return r.setTime(r.getTime()+t*Jh),r}function R0(e,t,n){return $h(e,-t)}function L0(e,t,n){const r=A0(e,t)/1e3;return wh(void 0)(r)}function Mh(e,t,n){return M0(e,t*1e3)}function D0(e,t,n){return Mh(e,-t)}class j3 extends qn{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=_(n,"axes",this.secondaryDomainAxisPosition),a=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(a))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,a=_(r,"axes",this.secondaryRangeAxisPosition);let s;if(t!==null?s=t[i]:n&&n.length>0&&(s=n[0]),a!=null&&a.correspondingDatasets&&a.correspondingDatasets.includes(s))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return _(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=re.VERTICAL:this.orientation=re.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const a=this.model.getOptions(),s=_(a,"axes");((t=s[Z.LEFT])!=null&&t.correspondingDatasets&&s[Z.RIGHT]||(n=s[Z.RIGHT])!=null&&n.correspondingDatasets&&s[Z.LEFT]||(r=s[Z.TOP])!=null&&r.correspondingDatasets&&s[Z.BOTTOM]||(i=s[Z.BOTTOM])!=null&&i.correspondingDatasets&&s[Z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=_(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]===lt.LINEAR||this.scaleTypes[t]===lt.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 a=this.model.getOptions(),s=_(a,"axes")[r],{mapsTo:o}=s,l=_(i,o)!==null?i[o]:i;let c;switch(n){case lt.LABELS:c=t(l)+t.step()/2;break;case lt.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],a=this.model.getOptions(),s=_(a,"axes")[r],{mapsTo:o}=s,l=t[o]!==void 0?t[o]:t;return[i(_(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(_(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 _(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return _(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=_(r,"axes",t);if(i.scaleType===lt.TIME){const a=_(r,"timeScale","addSpaceOnEdges");return W3(n,a)}else return q3(n,rr.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=_(t,"axes"),r=this.isDualAxes();return _(n,Z.LEFT)===null&&_(n,Z.RIGHT)!==null||_(n,Z.RIGHT,"main")===!0||r&&_(n,Z.LEFT,"correspondingDatasets")?{primary:Z.RIGHT,secondary:Z.LEFT}:{primary:Z.LEFT,secondary:Z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=_(t,"axes"),r=this.isDualAxes();return _(n,Z.BOTTOM)===null&&_(n,Z.TOP)!==null||_(n,Z.TOP,"main")===!0||r&&_(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=_(r,"axes",t.primary),a=_(r,"axes",n.primary),s=i.scaleType||lt.LINEAR,o=a.scaleType||lt.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===lt.LABELS||o===lt.TIME)&&s===lt.LABELS||s===lt.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=_(n,"axes",t),i=_(n,"bounds"),{includeZero:a}=r,s=_(r,"scaleType")||lt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:y}=this.model.getBinConfigurations();return[0,wr(y,v=>v.length)]}else if(r.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),v=this.model.getStackKeys({bins:y});return[v[0].split(":")[0],v[v.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=rr.ratio;if(r.domain)return s===lt.LABELS?r.domain:(s===lt.TIME&&(r.domain=r.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&s===lt.LABELS)return da(o.map(y=>y[c]));let f,g;const m=this.model.getDataGroupNames();if(s===lt.LABELS_RATIO)return o.map(y=>`${y[h]}/${y[p]}`);if(s===lt.TIME)g=o.map(y=>+new Date(y[c]));else if(i&&n.axes)g=[],o.forEach(y=>{g.push(y[c]),y[i.upperBoundMapsTo]&&g.push(y[i.upperBoundMapsTo]),y[i.lowerBoundMapsTo]&&g.push(y[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,v=this.model.getDataValuesGroupedByKeys({groups:m}),x=o.filter(E=>!m.includes(E[y])),T=[];v.forEach(E=>{const{...S}=E;let L=0,N=0;Object.values(a3(S,"sharedStackKey")).forEach(D=>{isNaN(D)||(D<0?N+=D:L+=D)}),T.push([N,L])}),g=[...bh(T),...x.map(E=>E[c])]}else g=[],o.forEach(y=>{const v=y[c];Array.isArray(v)&&v.length===2?(g.push(v[0]),g.push(v[1])):(l&&g.push(Math.max(y[c],y[l])),g.push(v))});return s!==lt.TIME&&s!==lt.LOG&&a&&g.push(0),d&&d.length>0&&d.forEach(y=>{const v=_(y,"value");v!==null&&g.push(v)}),f=ln(g),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=_(n,"axes",t);if(!r)return null;const i=_(r,"scaleType")||lt.LINEAR;this.scaleTypes[t]=i;let a;return i===lt.TIME?a=mm():i===lt.LOG?a=h0().base(r.base||10):i===lt.LABELS||i===lt.LABELS_RATIO?a=Ca():a=hn(),a.domain(this.getScaleDomain(t)),a}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===re.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),_(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=_(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(),a=r.sort((s,o)=>o.value-s.value)[0];return this.getScaleTypeByPosition(n)===lt.TIME&&(typeof a.value=="string"||a.value.getTime===void 0)&&(a.value=new Date(a.value)),{threshold:a,scaleValue:i(a.value)}}getHighestRangeThreshold(){const t=_(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(),a=r.sort((s,o)=>o.value-s.value)[0];return{threshold:a,scaleValue:i(a.value)}}}function W3(e,t){const n=new Date(e[0]),r=new Date(e[1]);return L3(r,n)>1?[D3(n,t),S0(r,t)]:B3(r,n)>1?[H3(n,t),Sh(r,t)]:V3(r,n)>1?[F3(n,t),$0(r,t)]:G3(r,n)>1?[z3(n,t),C0(r,t)]:k0(r,n)>30?[R0(n,t*30),$h(r,t*30)]:k0(r,n)>1?[R0(n,t),$h(r,t)]:L0(r,n)>15?[D0(n,t*15),Mh(r,t*15)]:L0(r,n)>1?[D0(n,t),Mh(r,t)]:[n,r]}function q3([e,t],n,r){const i=(t-e)*n,a=t<=0&&t+i>0?0:t+i;let s=e>=0&&e-i<0?0:e-i;if(r===lt.LOG&&s<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=e}return[s,a]}class Y3 extends qn{constructor(){super(...arguments),this.curveTypes={curveLinear:co,curveLinearClosed:_m,curveBasis:d3,curveBasisClosed:p3,curveBasisOpen:f3,curveBundle:m3,curveCardinal:g3,curveCardinalClosed:v3,curveCardinalOpen:y3,curveCatmullRom:b3,curveCatmullRomClosed:_3,curveCatmullRomOpen:x3,curveMonotoneX:E3,curveMonotoneY:O3,curveNatural:T3,curveStep:S3,curveStepAfter:$3,curveStepBefore:w3}}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 Z3 extends qn{isZoomBarEnabled(){if(!this.services.cartesianScales||!_(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=_(this.model.getOptions(),"axes",t,"scaleType");return t===Z.BOTTOM&&n===lt.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(),a=r.getDomainIdentifier(),s=_(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(s)&&s.length===2)return s;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,ln(n,o=>o[a]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(w.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return _(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),a=Object.assign({stacked:!1},n),s=_(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&i){const o=a.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=Ue.handleWidth,a=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();a.domain(this.getDefaultZoomBarDomain());const s=a(r[0]),o=a(r[1]);if(o-s<i+1)return;const l=a.range(),c=o-s,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=s+u,h=o-u;d>=h&&(d=s+c/2-i/2,h=o-c/2+i/2);const p=[a.invert(d),a.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]),a=r(n[1]),s=r.range(),o=(s[1]-s[0])/2*(t/2),l=Math.max(i-o,s[0]),c=Math.min(a+o,s[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(),a=_(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<a}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 _(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return _(this.model.getOptions(),"zoomBar",t,"locked")}}function X3(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:o0(e,t,n)}var K3="\\ud800-\\udfff",Q3="\\u0300-\\u036f",J3="\\ufe20-\\ufe2f",tU="\\u20d0-\\u20ff",eU=Q3+J3+tU,nU="\\ufe0e\\ufe0f",rU="\\u200d",iU=RegExp("["+rU+K3+eU+nU+"]");function I0(e){return iU.test(e)}function aU(e){return e.split("")}var N0="\\ud800-\\udfff",sU="\\u0300-\\u036f",oU="\\ufe20-\\ufe2f",lU="\\u20d0-\\u20ff",cU=sU+oU+lU,uU="\\ufe0e\\ufe0f",hU="["+N0+"]",Ch="["+cU+"]",Ah="\\ud83c[\\udffb-\\udfff]",dU="(?:"+Ch+"|"+Ah+")",P0="[^"+N0+"]",U0="(?:\\ud83c[\\udde6-\\uddff]){2}",B0="[\\ud800-\\udbff][\\udc00-\\udfff]",pU="\\u200d",H0=dU+"?",V0="["+uU+"]?",fU="(?:"+pU+"(?:"+[P0,U0,B0].join("|")+")"+V0+H0+")*",mU=V0+H0+fU,gU="(?:"+[P0+Ch+"?",Ch,U0,B0,hU].join("|")+")",vU=RegExp(Ah+"(?="+Ah+")|"+gU+mU,"g");function yU(e){return e.match(vU)||[]}function bU(e){return I0(e)?yU(e):aU(e)}function _U(e){return function(t){t=la(t);var n=I0(t)?bU(t):void 0,r=n?n[0]:t.charAt(0),i=n?X3(n,1).join(""):t.slice(1);return r[e]()+i}}var xU=_U("toUpperCase");function EU(e){return xU(la(e).toLowerCase())}var OU=tg(function(e,t,n){return t=t.toLowerCase(),e+(n?EU(t):t)});class mn{constructor(t,n){this.components=[],this.services={canvasZoom:M3,domUtils:U,events:C3,files:A3,gradientUtils:pu,transitions:k3},this.model=new Sn(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(w.Model.UPDATE,r=>{const i=!!_(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(w.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(a=>a));Promise.all(r).then(()=>this.services.events.dispatchEvent(w.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=_(r,"toolbar","enabled"),a={id:"legend",components:[new ch(this.model,this.services)],growth:mt.PREFERRED},s=_(r,"canvasZoom","enabled");s&&s===!0&&t.push(new qL(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new rs(this.model,this.services)],growth:mt.STRETCH},c={id:"toolbar",components:[new jo(this.model,this.services)],growth:mt.PREFERRED},u={id:"header",components:[new Fe(this.model,this.services,[l,...i?[c]:[]],{direction:Ut.ROW,alignItems:vr.CENTER})],growth:mt.PREFERRED},d={id:"graph-frame",components:t,growth:mt.STRETCH,renderType:_(n,"graphFrameRenderType")||ut.SVG},h=_(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Ut.COLUMN;if(h){const y=_(r,"legend","position");y==="left"?(p=Ut.ROW,r.legend.orientation||(r.legend.orientation=Qr.VERTICAL)):y==="right"?(p=Ut.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Qr.VERTICAL)):y==="bottom"&&(p=Ut.COLUMN_REVERSE)}const f={id:"spacer",components:[new Kn(this.model,this.services)],growth:mt.PREFERRED},g={id:"full-frame",components:[new Fe(this.model,this.services,[...h?[a]:[],...h?[f]:[],d],{direction:p})],growth:mt.STRETCH},m=[];if(o||i){m.push(u);const y={id:"spacer",components:[new Kn(this.model,this.services,i?{size:15}:void 0)],growth:mt.PREFERRED};m.push(y)}return m.push(g),[new uh(this.model,this.services),new Wo(this.model,this.services),new Fe(this.model,this.services,m,{direction:Ut.COLUMN})]}}class Le extends mn{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:j3,curves:Y3,zoom:Z3}),this.model=new Dr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=_(r,"zoomBar",Z.TOP,"enabled"),a=_(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=this.services.cartesianScales.getMainXAxisPosition(),o=_(r,"axes",s,"scaleType"),l=i&&s===Z.BOTTOM&&o===lt.TIME,c=this.services.zoom.isZoomBarLocked(Z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new rs(this.model,this.services)],growth:mt.STRETCH},h={id:"toolbar",components:[new jo(this.model,this.services)],growth:mt.PREFERRED},p={id:"header",components:[new Fe(this.model,this.services,[d,...a?[h]:[]],{direction:Ut.ROW,alignItems:vr.CENTER})],growth:mt.PREFERRED},f={id:"legend",components:[new ch(this.model,this.services)],growth:mt.PREFERRED};l&&!c&&t.push(new Cv(this.model,this.services),new YL(this.model,this.services)),t.push(new XL(this.model,this.services)),t.push(new KL(this.model,this.services));const g={id:"graph-frame",components:t,growth:mt.STRETCH,renderType:ut.SVG},m=_(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=Ut.COLUMN;if(m){const S=_(this.model.getOptions(),"legend","position");S===Kr.LEFT?(y=Ut.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Qr.VERTICAL)):S===Kr.RIGHT?(y=Ut.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Qr.VERTICAL)):S===Kr.BOTTOM&&(y=Ut.COLUMN_REVERSE)}const v={id:"spacer",components:[new Kn(this.model,this.services)],growth:mt.PREFERRED},x={id:"full-frame",components:[new Fe(this.model,this.services,[...m?[f]:[],...m?[v]:[],g],{direction:y})],growth:mt.STRETCH},T={id:"zoom-bar",components:[new ZL(this.model,this.services)],growth:mt.PREFERRED,renderType:ut.SVG},E=[];if(u||a){E.push(p);const S={id:"spacer",components:[new Kn(this.model,this.services,a?{size:15}:void 0)],growth:mt.PREFERRED};E.push(S)}return l&&E.push(T),E.push(x),[new Lv(this.model,this.services),new Wo(this.model,this.services),new Fe(this.model,this.services,E,{direction:Ut.COLUMN})]}}class TU extends mn{constructor(t,n){super(t,n),this.model=new hM(this.services),this.model.setOptions(jt(Bt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new vD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class SU extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Dn(Bt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new cr(this.model,this.services),new Ri(this.model,this.services),new Fv(this.model,this.services),new An(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new $e(this.model,this.services,{skeleton:ae.GRID})];return this.getAxisChartComponents(t)}}class wU extends Le{constructor(t,n){super(t,n),this.model=new dM(this.services),this.model.setOptions(jt(Bt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new _D(this.model,this.services),new Li(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class $U extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Bt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new cr(this.model,this.services),new xD(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.GRID})];return this.getAxisChartComponents(t)}}class MU extends Le{constructor(t,n){super(t,n),this.model=new pM(this.services),this.model.setOptions(jt(Bt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new ED(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.GRID})];return this.getAxisChartComponents(t)}}class CU extends mn{constructor(t,n){super(t,n),this.model=new fM(this.services),this.model.setOptions(jt(Bt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=_(r,"toolbar","enabled"),a=!!this.model.getOptions().title,s={id:"title",components:[new rs(this.model,this.services)],growth:mt.STRETCH},o={id:"toolbar",components:[new jo(this.model,this.services)],growth:mt.PREFERRED},l={id:"header",components:[new Fe(this.model,this.services,[s,...i?[o]:[]],{direction:Ut.ROW,alignItems:vr.CENTER})],growth:mt.PREFERRED},c={id:"legend",components:[new Wv(this.model,this.services,{chartType:"choropleth"})],growth:mt.PREFERRED,renderType:ut.SVG},u={id:"graph-frame",components:t,growth:mt.STRETCH,renderType:ut.SVG},d=_(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ut.COLUMN_REVERSE,p={id:"spacer",components:[new Kn(this.model,this.services,{size:15})],growth:mt.PREFERRED},f={id:"full-frame",components:[new Fe(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:mt.STRETCH},g=[];if(a||i){g.push(l);const m={id:"spacer",components:[new Kn(this.model,this.services,i?{size:15}:void 0)],growth:mt.PREFERRED};g.push(m)}return g.push(f),[new uh(this.model,this.services),new Wo(this.model,this.services),new Fe(this.model,this.services,g,{direction:Ut.COLUMN})]}getComponents(){const t=[new KP(this.model,this.services)];return this.getChartComponents(t)}}class AU extends mn{constructor(t,n){super(t,n),this.model=new mM(this.services),this.model.setOptions(jt(Bt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new HD(this.model,this.services)];return this.getChartComponents(t)}}const F0={[Ie.LINE]:[Ri,An],[Ie.SCATTER]:[An],[Ie.AREA]:[Fv,Ri,An],[Ie.STACKED_AREA]:[Qv,Ri,t0,Xo],[Ie.SIMPLE_BAR]:[Kv],[Ie.GROUPED_BAR]:[Xv,Li],[Ie.STACKED_BAR]:[Jv,Xo]};class kU extends Le{constructor(t,n){super(t,n);const r=jt(Bt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Ie.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 a=i.type;let s;if(typeof i.type=="string"){if(!Object.keys(F0).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=`${OU(i.type)}Chart`;return s=pt({},Bt[l],this.model.getOptions(),i.options),i.type===Ie.STACKED_AREA&&(o=!0),F0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:s,stacked:o}))}else return s=pt({},this.model.getOptions(),i.options),new a(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:s})}).filter(i=>i!==null);return bh(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Ie.STACKED_BAR||i.type===Ie.STACKED_AREA),r=[new Re(this.model,this.services),new Ge(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.GRID}),...n?[]:[new cr(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class G0 extends mn{constructor(t,n,r=!1){super(t,n),this.model=new gM(this.services),!r&&(this.model.setOptions(jt(Bt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new qv(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.PIE})];return this.getChartComponents(t)}}class RU extends G0{constructor(t,n){super(t,n,!0),this.model.setOptions(jt(Bt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new FD(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.DONUT})];return this.getChartComponents(t)}}class LU extends mn{constructor(t,n){super(t,n),this.model=new vM(this.services),this.model.setOptions(jt(Bt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new GD(this.model,this.services)];return this.getChartComponents(t)}}class DU extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Bt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new Xv(this.model,this.services),new Li(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class IU extends Le{constructor(t,n){super(t,n),this.model=new yM(this.services),this.model.setOptions(jt(Bt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=_(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=!!this.model.getOptions().title,s={id:"title",components:[new rs(this.model,this.services)],growth:mt.STRETCH},o={id:"toolbar",components:[new jo(this.model,this.services)],growth:mt.PREFERRED},l={id:"header",components:[new Fe(this.model,this.services,[s,...i?[o]:[]],{direction:Ut.ROW,alignItems:vr.CENTER})],growth:mt.PREFERRED},c={id:"legend",components:[new Wv(this.model,this.services,{chartType:"heatmap"})],growth:mt.PREFERRED,renderType:ut.SVG},u={id:"graph-frame",components:t,growth:mt.STRETCH,renderType:ut.SVG},d=_(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ut.COLUMN_REVERSE,p={id:"spacer",components:[new Kn(this.model,this.services,{size:15})],growth:mt.PREFERRED},f={id:"full-frame",components:[new Fe(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:mt.STRETCH},g=[];if(a||i){g.push(l);const m={id:"spacer",components:[new Kn(this.model,this.services,i?{size:15}:void 0)],growth:mt.PREFERRED};g.push(m)}return g.push(f),[new Lv(this.model,this.services),new Wo(this.model,this.services),new Fe(this.model,this.services,g,{direction:Ut.COLUMN})]}getComponents(){const t=[new Re(this.model,this.services),new zD(this.model,this.services)];return this.getAxisChartComponents(t)}}class NU extends Le{constructor(t,n){super(t,n),this.model=new bM(this.services),this.model.setOptions(jt(Bt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new kD(this.model,this.services),new jD(this.model,this.services)];return this.getAxisChartComponents(t)}}class PU extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Bt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new cr(this.model,this.services),new Ri(this.model,this.services),new An(this.model,this.services,{handleThresholds:!0}),new ZD(this.model,this.services),new Li(this.model,this.services)];return this.getAxisChartComponents(t)}}class UU extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Bt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new cr(this.model,this.services),new WD(this.model,this.services),new An(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.GRID})];return this.getAxisChartComponents(t)}}class BU extends mn{constructor(t,n){var r;super(t,n),this.model=new _M(this.services);const i=(r=n.options.meter)!=null&&r.proportional?pt(Dn(Bt.proportionalMeterChart),n.options):pt(Dn(Bt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[..._(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new BD(this.model,this.services)],growth:mt.STRETCH,renderType:ut.SVG},{id:"spacer",components:[new Kn(this.model,this.services,{size:8})],growth:mt.STRETCH}]:[],{id:"meter-graph",components:[new qD(this.model,this.services)],growth:mt.STRETCH,renderType:ut.SVG}],n=[new Fe(this.model,this.services,t,{direction:Ut.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:ut.HTML})}}class HU extends mn{constructor(t,n){super(t,n),this.model=new xM(this.services),this.model.setOptions(jt(Bt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new YD(this.model,this.services)];return this.getChartComponents(t)}}class VU extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Bt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new cr(this.model,this.services),new An(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.GRID})];return this.getAxisChartComponents(t)}}class FU extends mn{constructor(t,n){super(t,n),this.model=new EM(this.services),this.model.setOptions(jt(Bt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new XD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class GU extends mn{constructor(t,n){super(t,n),this.model=new OM(this.services),this.model.setOptions(jt(Bt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new SP(this.model,this.services)];return this.getChartComponents(t)}}class zU extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Bt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new Kv(this.model,this.services),new Li(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class jU extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Bt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new Xo(this.model,this.services),new Qv(this.model,this.services),new Ri(this.model,this.services,{stacked:!0}),new t0(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new $e(this.model,this.services,{skeleton:ae.GRID})];return this.getAxisChartComponents(t)}}class WU extends Le{constructor(t,n){super(t,n),this.model.setOptions(jt(Bt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Re(this.model,this.services),new Ge(this.model,this.services),new Xo(this.model,this.services),new Jv(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.VERT_OR_HORIZ}),new Li(this.model,this.services)];return this.getAxisChartComponents(t)}}class qU extends mn{constructor(t,n){super(t,n),this.model=new TM(this.services),this.model.setOptions(jt(Bt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new ZP(this.model,this.services),new $e(this.model,this.services,{skeleton:ae.PIE})];return this.getChartComponents(t)}}function z0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kh={exports:{}},xt={};/**
|
|
74
74
|
* @license React
|
|
75
|
-
* react
|
|
75
|
+
* react.production.min.js
|
|
76
76
|
*
|
|
77
77
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the MIT license found in the
|
|
80
80
|
* LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/var
|
|
81
|
+
*/var j0;function YU(){if(j0)return xt;j0=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;function h(C){return C===null||typeof C!="object"?null:(C=d&&C[d]||C["@@iterator"],typeof C=="function"?C:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function m(C,z,Q){this.props=C,this.context=z,this.refs=g,this.updater=Q||p}m.prototype.isReactComponent={},m.prototype.setState=function(C,z){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,z,"setState")},m.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function y(){}y.prototype=m.prototype;function v(C,z,Q){this.props=C,this.context=z,this.refs=g,this.updater=Q||p}var x=v.prototype=new y;x.constructor=v,f(x,m.prototype),x.isPureReactComponent=!0;var T=Array.isArray,E=Object.prototype.hasOwnProperty,S={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function N(C,z,Q){var at,tt={},K=null,nt=null;if(z!=null)for(at in z.ref!==void 0&&(nt=z.ref),z.key!==void 0&&(K=""+z.key),z)E.call(z,at)&&!L.hasOwnProperty(at)&&(tt[at]=z[at]);var ht=arguments.length-2;if(ht===1)tt.children=Q;else if(1<ht){for(var W=Array(ht),it=0;it<ht;it++)W[it]=arguments[it+2];tt.children=W}if(C&&C.defaultProps)for(at in ht=C.defaultProps,ht)tt[at]===void 0&&(tt[at]=ht[at]);return{$$typeof:e,type:C,key:K,ref:nt,props:tt,_owner:S.current}}function D(C,z){return{$$typeof:e,type:C.type,key:z,ref:C.ref,props:C.props,_owner:C._owner}}function I(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function M(C){var z={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(Q){return z[Q]})}var q=/\/+/g;function H(C,z){return typeof C=="object"&&C!==null&&C.key!=null?M(""+C.key):z.toString(36)}function G(C,z,Q,at,tt){var K=typeof C;(K==="undefined"||K==="boolean")&&(C=null);var nt=!1;if(C===null)nt=!0;else switch(K){case"string":case"number":nt=!0;break;case"object":switch(C.$$typeof){case e:case t:nt=!0}}if(nt)return nt=C,tt=tt(nt),C=at===""?"."+H(nt,0):at,T(tt)?(Q="",C!=null&&(Q=C.replace(q,"$&/")+"/"),G(tt,z,Q,"",function(it){return it})):tt!=null&&(I(tt)&&(tt=D(tt,Q+(!tt.key||nt&&nt.key===tt.key?"":(""+tt.key).replace(q,"$&/")+"/")+C)),z.push(tt)),1;if(nt=0,at=at===""?".":at+":",T(C))for(var ht=0;ht<C.length;ht++){K=C[ht];var W=at+H(K,ht);nt+=G(K,z,Q,W,tt)}else if(W=h(C),typeof W=="function")for(C=W.call(C),ht=0;!(K=C.next()).done;)K=K.value,W=at+H(K,ht++),nt+=G(K,z,Q,W,tt);else if(K==="object")throw z=String(C),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return nt}function O(C,z,Q){if(C==null)return C;var at=[],tt=0;return G(C,at,"","",function(K){return z.call(Q,K,tt++)}),at}function k(C){if(C._status===-1){var z=C._result;z=z(),z.then(function(Q){(C._status===0||C._status===-1)&&(C._status=1,C._result=Q)},function(Q){(C._status===0||C._status===-1)&&(C._status=2,C._result=Q)}),C._status===-1&&(C._status=0,C._result=z)}if(C._status===1)return C._result.default;throw C._result}var $={current:null},B={transition:null},F={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:B,ReactCurrentOwner:S};function et(){throw Error("act(...) is not supported in production builds of React.")}return xt.Children={map:O,forEach:function(C,z,Q){O(C,function(){z.apply(this,arguments)},Q)},count:function(C){var z=0;return O(C,function(){z++}),z},toArray:function(C){return O(C,function(z){return z})||[]},only:function(C){if(!I(C))throw Error("React.Children.only expected to receive a single React element child.");return C}},xt.Component=m,xt.Fragment=n,xt.Profiler=i,xt.PureComponent=v,xt.StrictMode=r,xt.Suspense=l,xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,xt.act=et,xt.cloneElement=function(C,z,Q){if(C==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+C+".");var at=f({},C.props),tt=C.key,K=C.ref,nt=C._owner;if(z!=null){if(z.ref!==void 0&&(K=z.ref,nt=S.current),z.key!==void 0&&(tt=""+z.key),C.type&&C.type.defaultProps)var ht=C.type.defaultProps;for(W in z)E.call(z,W)&&!L.hasOwnProperty(W)&&(at[W]=z[W]===void 0&&ht!==void 0?ht[W]:z[W])}var W=arguments.length-2;if(W===1)at.children=Q;else if(1<W){ht=Array(W);for(var it=0;it<W;it++)ht[it]=arguments[it+2];at.children=ht}return{$$typeof:e,type:C.type,key:tt,ref:K,props:at,_owner:nt}},xt.createContext=function(C){return C={$$typeof:s,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},C.Provider={$$typeof:a,_context:C},C.Consumer=C},xt.createElement=N,xt.createFactory=function(C){var z=N.bind(null,C);return z.type=C,z},xt.createRef=function(){return{current:null}},xt.forwardRef=function(C){return{$$typeof:o,render:C}},xt.isValidElement=I,xt.lazy=function(C){return{$$typeof:u,_payload:{_status:-1,_result:C},_init:k}},xt.memo=function(C,z){return{$$typeof:c,type:C,compare:z===void 0?null:z}},xt.startTransition=function(C){var z=B.transition;B.transition={};try{C()}finally{B.transition=z}},xt.unstable_act=et,xt.useCallback=function(C,z){return $.current.useCallback(C,z)},xt.useContext=function(C){return $.current.useContext(C)},xt.useDebugValue=function(){},xt.useDeferredValue=function(C){return $.current.useDeferredValue(C)},xt.useEffect=function(C,z){return $.current.useEffect(C,z)},xt.useId=function(){return $.current.useId()},xt.useImperativeHandle=function(C,z,Q){return $.current.useImperativeHandle(C,z,Q)},xt.useInsertionEffect=function(C,z){return $.current.useInsertionEffect(C,z)},xt.useLayoutEffect=function(C,z){return $.current.useLayoutEffect(C,z)},xt.useMemo=function(C,z){return $.current.useMemo(C,z)},xt.useReducer=function(C,z,Q){return $.current.useReducer(C,z,Q)},xt.useRef=function(C){return $.current.useRef(C)},xt.useState=function(C){return $.current.useState(C)},xt.useSyncExternalStore=function(C,z,Q){return $.current.useSyncExternalStore(C,z,Q)},xt.useTransition=function(){return $.current.useTransition()},xt.version="18.3.1",xt}var ss={exports:{}};/**
|
|
82
82
|
* @license React
|
|
83
|
-
* react
|
|
83
|
+
* react.development.js
|
|
84
84
|
*
|
|
85
85
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
86
86
|
*
|
|
87
87
|
* This source code is licensed under the MIT license found in the
|
|
88
88
|
* LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/var p0;function W3(){return p0||(p0=1,process.env.NODE_ENV!=="production"&&function(){var e=ce,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),f=Symbol.iterator,v="@@iterator";function m(M){if(M===null||typeof M!="object")return null;var j=f&&M[f]||M[v];return typeof j=="function"?j:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(M){{for(var j=arguments.length,Q=new Array(j>1?j-1:0),ut=1;ut<j;ut++)Q[ut-1]=arguments[ut];b("error",M,Q)}}function b(M,j,Q){{var ut=y.ReactDebugCurrentFrame,Tt=ut.getStackAddendum();Tt!==""&&(j+="%s",Q=Q.concat([Tt]));var Mt=Q.map(function(_t){return String(_t)});Mt.unshift("Warning: "+j),Function.prototype.apply.call(console[M],console,Mt)}}var T=!1,E=!1,O=!1,A=!1,I=!1,L;L=Symbol.for("react.module.reference");function R(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===s||I||M===i||M===c||M===u||A||M===p||T||E||O||typeof M=="object"&&M!==null&&(M.$$typeof===h||M.$$typeof===d||M.$$typeof===a||M.$$typeof===o||M.$$typeof===l||M.$$typeof===L||M.getModuleId!==void 0))}function $(M,j,Q){var ut=M.displayName;if(ut)return ut;var Tt=j.displayName||j.name||"";return Tt!==""?Q+"("+Tt+")":Q}function F(M){return M.displayName||"Context"}function P(M){if(M==null)return null;if(typeof M.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case o:var j=M;return F(j)+".Consumer";case a:var Q=M;return F(Q._context)+".Provider";case l:return $(M,M.render,"ForwardRef");case d:var ut=M.displayName||null;return ut!==null?ut:P(M.type)||"Memo";case h:{var Tt=M,Mt=Tt._payload,_t=Tt._init;try{return P(_t(Mt))}catch{return null}}}return null}var H=Object.assign,_=0,C,k,U,B,X,Y,ot;function it(){}it.__reactDisabledLog=!0;function bt(){{if(_===0){C=console.log,k=console.info,U=console.warn,B=console.error,X=console.group,Y=console.groupCollapsed,ot=console.groupEnd;var M={configurable:!0,enumerable:!0,value:it,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}_++}}function st(){{if(_--,_===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},M,{value:C}),info:H({},M,{value:k}),warn:H({},M,{value:U}),error:H({},M,{value:B}),group:H({},M,{value:X}),groupCollapsed:H({},M,{value:Y}),groupEnd:H({},M,{value:ot})})}_<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=y.ReactCurrentDispatcher,et;function mt(M,j,Q){{if(et===void 0)try{throw Error()}catch(Tt){var ut=Tt.stack.trim().match(/\n( *(at )?)/);et=ut&&ut[1]||""}return`
|
|
90
|
-
`+et+M}}var q=!1,J;{var dt=typeof WeakMap=="function"?WeakMap:Map;J=new dt}function z(M,j){if(!M||q)return"";{var Q=J.get(M);if(Q!==void 0)return Q}var ut;q=!0;var Tt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Mt;Mt=K.current,K.current=null,bt();try{if(j){var _t=function(){throw Error()};if(Object.defineProperty(_t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_t,[])}catch(Ut){ut=Ut}Reflect.construct(M,[],_t)}else{try{_t.call()}catch(Ut){ut=Ut}M.call(_t.prototype)}}else{try{throw Error()}catch(Ut){ut=Ut}M()}}catch(Ut){if(Ut&&ut&&typeof Ut.stack=="string"){for(var w=Ut.stack.split(`
|
|
91
|
-
`),Z=ut.stack.split(`
|
|
92
|
-
`),W=w.length-1,lt=Z.length-1;W>=1&<>=0&&w[W]!==Z[lt];)lt--;for(;W>=1&<>=0;W--,lt--)if(w[W]!==Z[lt]){if(W!==1||lt!==1)do if(W--,lt--,lt<0||w[W]!==Z[lt]){var Ct=`
|
|
93
|
-
`+w[W].replace(" at new "," at ");return M.displayName&&Ct.includes("<anonymous>")&&(Ct=Ct.replace("<anonymous>",M.displayName)),typeof M=="function"&&J.set(M,Ct),Ct}while(W>=1&<>=0);break}}}finally{q=!1,K.current=Mt,st(),Error.prepareStackTrace=Tt}var Pt=M?M.displayName||M.name:"",oe=Pt?mt(Pt):"";return typeof M=="function"&&J.set(M,oe),oe}function Dt(M,j,Q){return z(M,!1)}function gt(M){var j=M.prototype;return!!(j&&j.isReactComponent)}function Wt(M,j,Q){if(M==null)return"";if(typeof M=="function")return z(M,gt(M));if(typeof M=="string")return mt(M);switch(M){case c:return mt("Suspense");case u:return mt("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Dt(M.render);case d:return Wt(M.type,j,Q);case h:{var ut=M,Tt=ut._payload,Mt=ut._init;try{return Wt(Mt(Tt),j,Q)}catch{}}}return""}var Gt=Object.prototype.hasOwnProperty,nt={},$t=y.ReactDebugCurrentFrame;function be(M){if(M){var j=M._owner,Q=Wt(M.type,M._source,j?j.type:null);$t.setExtraStackFrame(Q)}else $t.setExtraStackFrame(null)}function Pe(M,j,Q,ut,Tt){{var Mt=Function.call.bind(Gt);for(var _t in M)if(Mt(M,_t)){var w=void 0;try{if(typeof M[_t]!="function"){var Z=Error((ut||"React class")+": "+Q+" type `"+_t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[_t]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Z.name="Invariant Violation",Z}w=M[_t](j,_t,ut,Q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(W){w=W}w&&!(w instanceof Error)&&(be(Tt),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ut||"React class",Q,_t,typeof w),be(null)),w instanceof Error&&!(w.message in nt)&&(nt[w.message]=!0,be(Tt),g("Failed %s type: %s",Q,w.message),be(null))}}}var zo=Array.isArray;function Ws(M){return zo(M)}function qs(M){{var j=typeof Symbol=="function"&&Symbol.toStringTag,Q=j&&M[Symbol.toStringTag]||M.constructor.name||"Object";return Q}}function Pr(M){try{return Vn(M),!1}catch{return!0}}function Vn(M){return""+M}function Fn(M){if(Pr(M))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qs(M)),Vn(M)}var rr=y.ReactCurrentOwner,jo={key:!0,ref:!0,__self:!0,__source:!0},Ys,Si,wi;wi={};function $i(M){if(Gt.call(M,"ref")){var j=Object.getOwnPropertyDescriptor(M,"ref").get;if(j&&j.isReactWarning)return!1}return M.ref!==void 0}function Mi(M){if(Gt.call(M,"key")){var j=Object.getOwnPropertyDescriptor(M,"key").get;if(j&&j.isReactWarning)return!1}return M.key!==void 0}function on(M,j){if(typeof M.ref=="string"&&rr.current&&j&&rr.current.stateNode!==j){var Q=P(rr.current.type);wi[Q]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',P(rr.current.type),M.ref),wi[Q]=!0)}}function ir(M,j){{var Q=function(){Ys||(Ys=!0,g("%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://reactjs.org/link/special-props)",j))};Q.isReactWarning=!0,Object.defineProperty(M,"key",{get:Q,configurable:!0})}}function Zs(M,j){{var Q=function(){Si||(Si=!0,g("%s: `ref` 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://reactjs.org/link/special-props)",j))};Q.isReactWarning=!0,Object.defineProperty(M,"ref",{get:Q,configurable:!0})}}var Xs=function(M,j,Q,ut,Tt,Mt,_t){var w={$$typeof:t,type:M,key:j,ref:Q,props:_t,_owner:Mt};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ut}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Tt}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function ch(M,j,Q,ut,Tt){{var Mt,_t={},w=null,Z=null;Q!==void 0&&(Fn(Q),w=""+Q),Mi(j)&&(Fn(j.key),w=""+j.key),$i(j)&&(Z=j.ref,on(j,Tt));for(Mt in j)Gt.call(j,Mt)&&!jo.hasOwnProperty(Mt)&&(_t[Mt]=j[Mt]);if(M&&M.defaultProps){var W=M.defaultProps;for(Mt in W)_t[Mt]===void 0&&(_t[Mt]=W[Mt])}if(w||Z){var lt=typeof M=="function"?M.displayName||M.name||"Unknown":M;w&&ir(_t,lt),Z&&Zs(_t,lt)}return Xs(M,w,Z,Tt,ut,rr.current,_t)}}var sr=y.ReactCurrentOwner,Ur=y.ReactDebugCurrentFrame;function ar(M){if(M){var j=M._owner,Q=Wt(M.type,M._source,j?j.type:null);Ur.setExtraStackFrame(Q)}else Ur.setExtraStackFrame(null)}var Gn;Gn=!1;function Ks(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Wo(){{if(sr.current){var M=P(sr.current.type);if(M)return`
|
|
89
|
+
*/ss.exports;var W0;function ZU(){return W0||(W0=1,function(e,t){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.3.1",r=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,y="@@iterator";function v(b){if(b===null||typeof b!="object")return null;var A=m&&b[m]||b[y];return typeof A=="function"?A:null}var x={current:null},T={transition:null},E={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},S={current:null},L={},N=null;function D(b){N=b}L.setExtraStackFrame=function(b){N=b},L.getCurrentStack=null,L.getStackAddendum=function(){var b="";N&&(b+=N);var A=L.getCurrentStack;return A&&(b+=A()||""),b};var I=!1,M=!1,q=!1,H=!1,G=!1,O={ReactCurrentDispatcher:x,ReactCurrentBatchConfig:T,ReactCurrentOwner:S};O.ReactDebugCurrentFrame=L,O.ReactCurrentActQueue=E;function k(b){{for(var A=arguments.length,V=new Array(A>1?A-1:0),j=1;j<A;j++)V[j-1]=arguments[j];B("warn",b,V)}}function $(b){{for(var A=arguments.length,V=new Array(A>1?A-1:0),j=1;j<A;j++)V[j-1]=arguments[j];B("error",b,V)}}function B(b,A,V){{var j=O.ReactDebugCurrentFrame,J=j.getStackAddendum();J!==""&&(A+="%s",V=V.concat([J]));var ft=V.map(function(ot){return String(ot)});ft.unshift("Warning: "+A),Function.prototype.apply.call(console[b],console,ft)}}var F={};function et(b,A){{var V=b.constructor,j=V&&(V.displayName||V.name)||"ReactClass",J=j+"."+A;if(F[J])return;$("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",A,j),F[J]=!0}}var C={isMounted:function(b){return!1},enqueueForceUpdate:function(b,A,V){et(b,"forceUpdate")},enqueueReplaceState:function(b,A,V,j){et(b,"replaceState")},enqueueSetState:function(b,A,V,j){et(b,"setState")}},z=Object.assign,Q={};Object.freeze(Q);function at(b,A,V){this.props=b,this.context=A,this.refs=Q,this.updater=V||C}at.prototype.isReactComponent={},at.prototype.setState=function(b,A){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,A,"setState")},at.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};{var tt={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},K=function(b,A){Object.defineProperty(at.prototype,b,{get:function(){k("%s(...) is deprecated in plain JavaScript React classes. %s",A[0],A[1])}})};for(var nt in tt)tt.hasOwnProperty(nt)&&K(nt,tt[nt])}function ht(){}ht.prototype=at.prototype;function W(b,A,V){this.props=b,this.context=A,this.refs=Q,this.updater=V||C}var it=W.prototype=new ht;it.constructor=W,z(it,at.prototype),it.isPureReactComponent=!0;function gt(){var b={current:null};return Object.seal(b),b}var X=Array.isArray;function Ct(b){return X(b)}function _t(b){{var A=typeof Symbol=="function"&&Symbol.toStringTag,V=A&&b[Symbol.toStringTag]||b.constructor.name||"Object";return V}}function ne(b){try{return Jt(b),!1}catch{return!0}}function Jt(b){return""+b}function ct(b){if(ne(b))return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_t(b)),Jt(b)}function Nt(b,A,V){var j=b.displayName;if(j)return j;var J=A.displayName||A.name||"";return J!==""?V+"("+J+")":V}function ze(b){return b.displayName||"Context"}function oe(b){if(b==null)return null;if(typeof b.tag=="number"&&$("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case a:return"Fragment";case i:return"Portal";case o:return"Profiler";case s:return"StrictMode";case d:return"Suspense";case h:return"SuspenseList"}if(typeof b=="object")switch(b.$$typeof){case c:var A=b;return ze(A)+".Consumer";case l:var V=b;return ze(V._context)+".Provider";case u:return Nt(b,b.render,"ForwardRef");case p:var j=b.displayName||null;return j!==null?j:oe(b.type)||"Memo";case f:{var J=b,ft=J._payload,ot=J._init;try{return oe(ot(ft))}catch{return null}}}return null}var pr=Object.prototype.hasOwnProperty,il={key:!0,ref:!0,__self:!0,__source:!0},Ii,fr,kn;kn={};function Qn(b){if(pr.call(b,"ref")){var A=Object.getOwnPropertyDescriptor(b,"ref").get;if(A&&A.isReactWarning)return!1}return b.ref!==void 0}function os(b){if(pr.call(b,"key")){var A=Object.getOwnPropertyDescriptor(b,"key").get;if(A&&A.isReactWarning)return!1}return b.key!==void 0}function al(b,A){var V=function(){Ii||(Ii=!0,$("%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://reactjs.org/link/special-props)",A))};V.isReactWarning=!0,Object.defineProperty(b,"key",{get:V,configurable:!0})}function sl(b,A){var V=function(){fr||(fr=!0,$("%s: `ref` 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://reactjs.org/link/special-props)",A))};V.isReactWarning=!0,Object.defineProperty(b,"ref",{get:V,configurable:!0})}function ls(b){if(typeof b.ref=="string"&&S.current&&b.__self&&S.current.stateNode!==b.__self){var A=oe(S.current.type);kn[A]||($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',A,b.ref),kn[A]=!0)}}var Ni=function(b,A,V,j,J,ft,ot){var vt={$$typeof:r,type:b,key:A,ref:V,props:ot,_owner:ft};return vt._store={},Object.defineProperty(vt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(vt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:j}),Object.defineProperty(vt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:J}),Object.freeze&&(Object.freeze(vt.props),Object.freeze(vt)),vt};function Pi(b,A,V){var j,J={},ft=null,ot=null,vt=null,$t=null;if(A!=null){Qn(A)&&(ot=A.ref,ls(A)),os(A)&&(ct(A.key),ft=""+A.key),vt=A.__self===void 0?null:A.__self,$t=A.__source===void 0?null:A.__source;for(j in A)pr.call(A,j)&&!il.hasOwnProperty(j)&&(J[j]=A[j])}var Ht=arguments.length-2;if(Ht===1)J.children=V;else if(Ht>1){for(var Wt=Array(Ht),qt=0;qt<Ht;qt++)Wt[qt]=arguments[qt+2];Object.freeze&&Object.freeze(Wt),J.children=Wt}if(b&&b.defaultProps){var Zt=b.defaultProps;for(j in Zt)J[j]===void 0&&(J[j]=Zt[j])}if(ft||ot){var ce=typeof b=="function"?b.displayName||b.name||"Unknown":b;ft&&al(J,ce),ot&&sl(J,ce)}return Ni(b,ft,ot,vt,$t,S.current,J)}function Ui(b,A){var V=Ni(b.type,A,b.ref,b._self,b._source,b._owner,b.props);return V}function gn(b,A,V){if(b==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+b+".");var j,J=z({},b.props),ft=b.key,ot=b.ref,vt=b._self,$t=b._source,Ht=b._owner;if(A!=null){Qn(A)&&(ot=A.ref,Ht=S.current),os(A)&&(ct(A.key),ft=""+A.key);var Wt;b.type&&b.type.defaultProps&&(Wt=b.type.defaultProps);for(j in A)pr.call(A,j)&&!il.hasOwnProperty(j)&&(A[j]===void 0&&Wt!==void 0?J[j]=Wt[j]:J[j]=A[j])}var qt=arguments.length-2;if(qt===1)J.children=V;else if(qt>1){for(var Zt=Array(qt),ce=0;ce<qt;ce++)Zt[ce]=arguments[ce+2];J.children=Zt}return Ni(b.type,ft,ot,vt,$t,Ht,J)}function je(b){return typeof b=="object"&&b!==null&&b.$$typeof===r}var Bi=".",cs=":";function Rh(b){var A=/[=:]/g,V={"=":"=0",":":"=2"},j=b.replace(A,function(J){return V[J]});return"$"+j}var qr=!1,Hi=/\/+/g;function ol(b){return b.replace(Hi,"$&/")}function Jn(b,A){return typeof b=="object"&&b!==null&&b.key!=null?(ct(b.key),Rh(""+b.key)):A.toString(36)}function Vi(b,A,V,j,J){var ft=typeof b;(ft==="undefined"||ft==="boolean")&&(b=null);var ot=!1;if(b===null)ot=!0;else switch(ft){case"string":case"number":ot=!0;break;case"object":switch(b.$$typeof){case r:case i:ot=!0}}if(ot){var vt=b,$t=J(vt),Ht=j===""?Bi+Jn(vt,0):j;if(Ct($t)){var Wt="";Ht!=null&&(Wt=ol(Ht)+"/"),Vi($t,A,Wt,"",function(eH){return eH})}else $t!=null&&(je($t)&&($t.key&&(!vt||vt.key!==$t.key)&&ct($t.key),$t=Ui($t,V+($t.key&&(!vt||vt.key!==$t.key)?ol(""+$t.key)+"/":"")+Ht)),A.push($t));return 1}var qt,Zt,ce=0,ve=j===""?Bi:j+cs;if(Ct(b))for(var El=0;El<b.length;El++)qt=b[El],Zt=ve+Jn(qt,El),ce+=Vi(qt,A,V,Zt,J);else{var Fh=v(b);if(typeof Fh=="function"){var v1=b;Fh===v1.entries&&(qr||k("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),qr=!0);for(var JB=Fh.call(v1),y1,tH=0;!(y1=JB.next()).done;)qt=y1.value,Zt=ve+Jn(qt,tH++),ce+=Vi(qt,A,V,Zt,J)}else if(ft==="object"){var b1=String(b);throw new Error("Objects are not valid as a React child (found: "+(b1==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":b1)+"). If you meant to render a collection of children, use an array instead.")}}return ce}function Fi(b,A,V){if(b==null)return b;var j=[],J=0;return Vi(b,j,"","",function(ft){return A.call(V,ft,J++)}),j}function le(b){var A=0;return Fi(b,function(){A++}),A}function mr(b,A,V){Fi(b,function(){A.apply(this,arguments)},V)}function Lh(b){return Fi(b,function(A){return A})||[]}function ll(b){if(!je(b))throw new Error("React.Children.only expected to receive a single React element child.");return b}function us(b){var A={$$typeof:c,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};A.Provider={$$typeof:l,_context:A};var V=!1,j=!1,J=!1;{var ft={$$typeof:c,_context:A};Object.defineProperties(ft,{Provider:{get:function(){return j||(j=!0,$("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),A.Provider},set:function(ot){A.Provider=ot}},_currentValue:{get:function(){return A._currentValue},set:function(ot){A._currentValue=ot}},_currentValue2:{get:function(){return A._currentValue2},set:function(ot){A._currentValue2=ot}},_threadCount:{get:function(){return A._threadCount},set:function(ot){A._threadCount=ot}},Consumer:{get:function(){return V||(V=!0,$("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),A.Consumer}},displayName:{get:function(){return A.displayName},set:function(ot){J||(k("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",ot),J=!0)}}}),A.Consumer=ft}return A._currentRenderer=null,A._currentRenderer2=null,A}var gr=-1,Gi=0,cl=1,tr=2;function zi(b){if(b._status===gr){var A=b._result,V=A();if(V.then(function(ft){if(b._status===Gi||b._status===gr){var ot=b;ot._status=cl,ot._result=ft}},function(ft){if(b._status===Gi||b._status===gr){var ot=b;ot._status=tr,ot._result=ft}}),b._status===gr){var j=b;j._status=Gi,j._result=V}}if(b._status===cl){var J=b._result;return J===void 0&&$(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
94
90
|
|
|
95
|
-
|
|
91
|
+
Your code should look like:
|
|
92
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
96
93
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
React
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
Did you accidentally put curly braces around the import?`,J),"default"in J||$(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
95
|
+
|
|
96
|
+
Your code should look like:
|
|
97
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,J),J.default}else throw b._result}function ul(b){var A={_status:gr,_result:b},V={$$typeof:f,_payload:A,_init:zi};{var j,J;Object.defineProperties(V,{defaultProps:{configurable:!0,get:function(){return j},set:function(ft){$("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),j=ft,Object.defineProperty(V,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return J},set:function(ft){$("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),J=ft,Object.defineProperty(V,"propTypes",{enumerable:!0})}}})}return V}function hl(b){b!=null&&b.$$typeof===p?$("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof b!="function"?$("forwardRef requires a render function but was given %s.",b===null?"null":typeof b):b.length!==0&&b.length!==2&&$("forwardRef render functions accept exactly two parameters: props and ref. %s",b.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),b!=null&&(b.defaultProps!=null||b.propTypes!=null)&&$("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var A={$$typeof:u,render:b};{var V;Object.defineProperty(A,"displayName",{enumerable:!1,configurable:!0,get:function(){return V},set:function(j){V=j,!b.name&&!b.displayName&&(b.displayName=j)}})}return A}var hs;hs=Symbol.for("react.module.reference");function ds(b){return!!(typeof b=="string"||typeof b=="function"||b===a||b===o||G||b===s||b===d||b===h||H||b===g||I||M||q||typeof b=="object"&&b!==null&&(b.$$typeof===f||b.$$typeof===p||b.$$typeof===l||b.$$typeof===c||b.$$typeof===u||b.$$typeof===hs||b.getModuleId!==void 0))}function vn(b,A){ds(b)||$("memo: The first argument must be a component. Instead received: %s",b===null?"null":typeof b);var V={$$typeof:p,type:b,compare:A===void 0?null:A};{var j;Object.defineProperty(V,"displayName",{enumerable:!1,configurable:!0,get:function(){return j},set:function(J){j=J,!b.name&&!b.displayName&&(b.displayName=J)}})}return V}function pe(){var b=x.current;return b===null&&$(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
98
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
99
|
+
2. You might be breaking the Rules of Hooks
|
|
100
|
+
3. You might have more than one copy of React in the same app
|
|
101
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),b}function dl(b){var A=pe();if(b._context!==void 0){var V=b._context;V.Consumer===b?$("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):V.Provider===b&&$("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return A.useContext(b)}function pl(b){var A=pe();return A.useState(b)}function fl(b,A,V){var j=pe();return j.useReducer(b,A,V)}function Dh(b){var A=pe();return A.useRef(b)}function R(b,A){var V=pe();return V.useEffect(b,A)}function st(b,A){var V=pe();return V.useInsertionEffect(b,A)}function rt(b,A){var V=pe();return V.useLayoutEffect(b,A)}function At(b,A){var V=pe();return V.useCallback(b,A)}function he(b,A){var V=pe();return V.useMemo(b,A)}function te(b,A,V){var j=pe();return j.useImperativeHandle(b,A,V)}function yn(b,A){{var V=pe();return V.useDebugValue(b,A)}}function De(){var b=pe();return b.useTransition()}function nn(b){var A=pe();return A.useDeferredValue(b)}function ge(){var b=pe();return b.useId()}function ml(b,A,V){var j=pe();return j.useSyncExternalStore(b,A,V)}var Yr=0,X0,K0,Q0,J0,t1,e1,n1;function r1(){}r1.__reactDisabledLog=!0;function IB(){{if(Yr===0){X0=console.log,K0=console.info,Q0=console.warn,J0=console.error,t1=console.group,e1=console.groupCollapsed,n1=console.groupEnd;var b={configurable:!0,enumerable:!0,value:r1,writable:!0};Object.defineProperties(console,{info:b,log:b,warn:b,error:b,group:b,groupCollapsed:b,groupEnd:b})}Yr++}}function NB(){{if(Yr--,Yr===0){var b={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},b,{value:X0}),info:z({},b,{value:K0}),warn:z({},b,{value:Q0}),error:z({},b,{value:J0}),group:z({},b,{value:t1}),groupCollapsed:z({},b,{value:e1}),groupEnd:z({},b,{value:n1})})}Yr<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ih=O.ReactCurrentDispatcher,Nh;function gl(b,A,V){{if(Nh===void 0)try{throw Error()}catch(J){var j=J.stack.trim().match(/\n( *(at )?)/);Nh=j&&j[1]||""}return`
|
|
102
|
+
`+Nh+b}}var Ph=!1,vl;{var PB=typeof WeakMap=="function"?WeakMap:Map;vl=new PB}function i1(b,A){if(!b||Ph)return"";{var V=vl.get(b);if(V!==void 0)return V}var j;Ph=!0;var J=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ft;ft=Ih.current,Ih.current=null,IB();try{if(A){var ot=function(){throw Error()};if(Object.defineProperty(ot.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ot,[])}catch(ve){j=ve}Reflect.construct(b,[],ot)}else{try{ot.call()}catch(ve){j=ve}b.call(ot.prototype)}}else{try{throw Error()}catch(ve){j=ve}b()}}catch(ve){if(ve&&j&&typeof ve.stack=="string"){for(var vt=ve.stack.split(`
|
|
103
|
+
`),$t=j.stack.split(`
|
|
104
|
+
`),Ht=vt.length-1,Wt=$t.length-1;Ht>=1&&Wt>=0&&vt[Ht]!==$t[Wt];)Wt--;for(;Ht>=1&&Wt>=0;Ht--,Wt--)if(vt[Ht]!==$t[Wt]){if(Ht!==1||Wt!==1)do if(Ht--,Wt--,Wt<0||vt[Ht]!==$t[Wt]){var qt=`
|
|
105
|
+
`+vt[Ht].replace(" at new "," at ");return b.displayName&&qt.includes("<anonymous>")&&(qt=qt.replace("<anonymous>",b.displayName)),typeof b=="function"&&vl.set(b,qt),qt}while(Ht>=1&&Wt>=0);break}}}finally{Ph=!1,Ih.current=ft,NB(),Error.prepareStackTrace=J}var Zt=b?b.displayName||b.name:"",ce=Zt?gl(Zt):"";return typeof b=="function"&&vl.set(b,ce),ce}function UB(b,A,V){return i1(b,!1)}function BB(b){var A=b.prototype;return!!(A&&A.isReactComponent)}function yl(b,A,V){if(b==null)return"";if(typeof b=="function")return i1(b,BB(b));if(typeof b=="string")return gl(b);switch(b){case d:return gl("Suspense");case h:return gl("SuspenseList")}if(typeof b=="object")switch(b.$$typeof){case u:return UB(b.render);case p:return yl(b.type,A,V);case f:{var j=b,J=j._payload,ft=j._init;try{return yl(ft(J),A,V)}catch{}}}return""}var a1={},s1=O.ReactDebugCurrentFrame;function bl(b){if(b){var A=b._owner,V=yl(b.type,b._source,A?A.type:null);s1.setExtraStackFrame(V)}else s1.setExtraStackFrame(null)}function HB(b,A,V,j,J){{var ft=Function.call.bind(pr);for(var ot in b)if(ft(b,ot)){var vt=void 0;try{if(typeof b[ot]!="function"){var $t=Error((j||"React class")+": "+V+" type `"+ot+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof b[ot]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw $t.name="Invariant Violation",$t}vt=b[ot](A,ot,j,V,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ht){vt=Ht}vt&&!(vt instanceof Error)&&(bl(J),$("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",j||"React class",V,ot,typeof vt),bl(null)),vt instanceof Error&&!(vt.message in a1)&&(a1[vt.message]=!0,bl(J),$("Failed %s type: %s",V,vt.message),bl(null))}}}function ji(b){if(b){var A=b._owner,V=yl(b.type,b._source,A?A.type:null);D(V)}else D(null)}var Uh;Uh=!1;function o1(){if(S.current){var b=oe(S.current.type);if(b)return`
|
|
106
|
+
|
|
107
|
+
Check the render method of \``+b+"`."}return""}function VB(b){if(b!==void 0){var A=b.fileName.replace(/^.*[\\\/]/,""),V=b.lineNumber;return`
|
|
108
|
+
|
|
109
|
+
Check your code at `+A+":"+V+"."}return""}function FB(b){return b!=null?VB(b.__source):""}var l1={};function GB(b){var A=o1();if(!A){var V=typeof b=="string"?b:b.displayName||b.name;V&&(A=`
|
|
110
|
+
|
|
111
|
+
Check the top-level render call using <`+V+">.")}return A}function c1(b,A){if(!(!b._store||b._store.validated||b.key!=null)){b._store.validated=!0;var V=GB(A);if(!l1[V]){l1[V]=!0;var j="";b&&b._owner&&b._owner!==S.current&&(j=" It was passed a child from "+oe(b._owner.type)+"."),ji(b),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',V,j),ji(null)}}}function u1(b,A){if(typeof b=="object"){if(Ct(b))for(var V=0;V<b.length;V++){var j=b[V];je(j)&&c1(j,A)}else if(je(b))b._store&&(b._store.validated=!0);else if(b){var J=v(b);if(typeof J=="function"&&J!==b.entries)for(var ft=J.call(b),ot;!(ot=ft.next()).done;)je(ot.value)&&c1(ot.value,A)}}}function h1(b){{var A=b.type;if(A==null||typeof A=="string")return;var V;if(typeof A=="function")V=A.propTypes;else if(typeof A=="object"&&(A.$$typeof===u||A.$$typeof===p))V=A.propTypes;else return;if(V){var j=oe(A);HB(V,b.props,"prop",j,b)}else if(A.PropTypes!==void 0&&!Uh){Uh=!0;var J=oe(A);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",J||"Unknown")}typeof A.getDefaultProps=="function"&&!A.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zB(b){{for(var A=Object.keys(b.props),V=0;V<A.length;V++){var j=A[V];if(j!=="children"&&j!=="key"){ji(b),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",j),ji(null);break}}b.ref!==null&&(ji(b),$("Invalid attribute `ref` supplied to `React.Fragment`."),ji(null))}}function d1(b,A,V){var j=ds(b);if(!j){var J="";(b===void 0||typeof b=="object"&&b!==null&&Object.keys(b).length===0)&&(J+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ft=FB(A);ft?J+=ft:J+=o1();var ot;b===null?ot="null":Ct(b)?ot="array":b!==void 0&&b.$$typeof===r?(ot="<"+(oe(b.type)||"Unknown")+" />",J=" Did you accidentally export a JSX literal instead of a component?"):ot=typeof b,$("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ot,J)}var vt=Pi.apply(this,arguments);if(vt==null)return vt;if(j)for(var $t=2;$t<arguments.length;$t++)u1(arguments[$t],b);return b===a?zB(vt):h1(vt),vt}var p1=!1;function jB(b){var A=d1.bind(null,b);return A.type=b,p1||(p1=!0,k("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(A,"type",{enumerable:!1,get:function(){return k("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:b}),b}}),A}function WB(b,A,V){for(var j=gn.apply(this,arguments),J=2;J<arguments.length;J++)u1(arguments[J],j.type);return h1(j),j}function qB(b,A){var V=T.transition;T.transition={};var j=T.transition;T.transition._updatedFibers=new Set;try{b()}finally{if(T.transition=V,V===null&&j._updatedFibers){var J=j._updatedFibers.size;J>10&&k("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),j._updatedFibers.clear()}}}var f1=!1,_l=null;function YB(b){if(_l===null)try{var A=("require"+Math.random()).slice(0,7),V=e&&e[A];_l=V.call(e,"timers").setImmediate}catch{_l=function(J){f1===!1&&(f1=!0,typeof MessageChannel>"u"&&$("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var ft=new MessageChannel;ft.port1.onmessage=J,ft.port2.postMessage(void 0)}}return _l(b)}var Wi=0,m1=!1;function g1(b){{var A=Wi;Wi++,E.current===null&&(E.current=[]);var V=E.isBatchingLegacy,j;try{if(E.isBatchingLegacy=!0,j=b(),!V&&E.didScheduleLegacyUpdate){var J=E.current;J!==null&&(E.didScheduleLegacyUpdate=!1,Vh(J))}}catch(Zt){throw xl(A),Zt}finally{E.isBatchingLegacy=V}if(j!==null&&typeof j=="object"&&typeof j.then=="function"){var ft=j,ot=!1,vt={then:function(Zt,ce){ot=!0,ft.then(function(ve){xl(A),Wi===0?Bh(ve,Zt,ce):Zt(ve)},function(ve){xl(A),ce(ve)})}};return!m1&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){ot||(m1=!0,$("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),vt}else{var $t=j;if(xl(A),Wi===0){var Ht=E.current;Ht!==null&&(Vh(Ht),E.current=null);var Wt={then:function(Zt,ce){E.current===null?(E.current=[],Bh($t,Zt,ce)):Zt($t)}};return Wt}else{var qt={then:function(Zt,ce){Zt($t)}};return qt}}}}function xl(b){b!==Wi-1&&$("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Wi=b}function Bh(b,A,V){{var j=E.current;if(j!==null)try{Vh(j),YB(function(){j.length===0?(E.current=null,A(b)):Bh(b,A,V)})}catch(J){V(J)}else A(b)}}var Hh=!1;function Vh(b){if(!Hh){Hh=!0;var A=0;try{for(;A<b.length;A++){var V=b[A];do V=V(!0);while(V!==null)}b.length=0}catch(j){throw b=b.slice(A+1),j}finally{Hh=!1}}}var ZB=d1,XB=WB,KB=jB,QB={map:Fi,forEach:mr,count:le,toArray:Lh,only:ll};t.Children=QB,t.Component=at,t.Fragment=a,t.Profiler=o,t.PureComponent=W,t.StrictMode=s,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,t.act=g1,t.cloneElement=XB,t.createContext=us,t.createElement=ZB,t.createFactory=KB,t.createRef=gt,t.forwardRef=hl,t.isValidElement=je,t.lazy=ul,t.memo=vn,t.startTransition=qB,t.unstable_act=g1,t.useCallback=At,t.useContext=dl,t.useDebugValue=yn,t.useDeferredValue=nn,t.useEffect=R,t.useId=ge,t.useImperativeHandle=te,t.useInsertionEffect=st,t.useLayoutEffect=rt,t.useMemo=he,t.useReducer=fl,t.useRef=Dh,t.useState=pl,t.useSyncExternalStore=ml,t.useTransition=De,t.version=n,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(ss,ss.exports)),ss.exports}process.env.NODE_ENV==="production"?kh.exports=YU():kh.exports=ZU();var XU=kh.exports;const q0=z0(XU);class zt extends q0.PureComponent{constructor(){super(...arguments);Gh(this,"chart");Gh(this,"chartRef",q0.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 St.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class KU extends zt{createChart(t,n,r){return new TU(t,{data:n,options:r})}}class QU extends zt{createChart(t,n,r){return new SU(t,{data:n,options:r})}}class JU extends zt{createChart(t,n,r){return new wU(t,{data:n,options:r})}}class tB extends zt{createChart(t,n,r){return new $U(t,{data:n,options:r})}}class eB extends zt{createChart(t,n,r){return new MU(t,{data:n,options:r})}}class Y0 extends zt{createChart(t,n,r){return new CU(t,{data:n,options:r})}}class nB extends zt{createChart(t,n,r){return new AU(t,{data:n,options:r})}}class rB extends zt{createChart(t,n,r){return new kU(t,{data:n,options:r})}}class iB extends zt{createChart(t,n,r){return new RU(t,{data:n,options:r})}}class aB extends zt{createChart(t,n,r){return new LU(t,{data:n,options:r})}}class sB extends zt{createChart(t,n,r){return new DU(t,{data:n,options:r})}}class oB extends zt{createChart(t,n,r){return new IU(t,{data:n,options:r})}}class lB extends zt{createChart(t,n,r){return new NU(t,{data:n,options:r})}}class cB extends zt{createChart(t,n,r){return new PU(t,{data:n,options:r})}}class uB extends zt{createChart(t,n,r){return new UU(t,{data:n,options:r})}}class hB extends zt{createChart(t,n,r){return new BU(t,{data:n,options:r})}}class dB extends zt{createChart(t,n,r){return new G0(t,{data:n,options:r})}}class pB extends zt{createChart(t,n,r){return new HU(t,{data:n,options:r})}}class fB extends zt{createChart(t,n,r){return new VU(t,{data:n,options:r})}}class mB extends zt{createChart(t,n,r){return new zU(t,{data:n,options:r})}}class gB extends zt{createChart(t,n,r){return new jU(t,{data:n,options:r})}}class vB extends zt{createChart(t,n,r){return new WU(t,{data:n,options:r})}}class yB extends zt{createChart(t,n,r){return new FU(t,{data:n,options:r})}}class bB extends zt{createChart(t,n,r){return new GU(t,{data:n,options:r})}}class _B extends zt{createChart(t,n,r){return new qU(t,{data:n,options:r})}}var Z0={exports:{}};/*!
|
|
103
112
|
Copyright (c) 2018 Jed Watson.
|
|
104
113
|
Licensed under the MIT License (MIT), see
|
|
105
114
|
http://jedwatson.github.io/classnames
|
|
106
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var
|
|
115
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var a="",s=0;s<arguments.length;s++){var o=arguments[s];o&&(a=i(a,r(o)))}return a}function r(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return n.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var s="";for(var o in a)t.call(a,o)&&a[o]&&(s=i(s,o));return s}function i(a,s){return s?a?a+" "+s:a+s:a}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Z0);var xB=Z0.exports;const hr=z0(xB),dr="cds",EB=({tag:e="div",className:t,children:n,color:r,href:i,position:a="static",stacked:s,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${dr}--cc--card-node`,u=hr(c,{[`${c}--stacked`]:s,[`${c}--${l}`]:l,[t]:t});return St.jsx(l,{className:u,style:{borderColor:r,position:a},tabIndex:0,...o,children:n})},OB=({children:e,farsideColumn:t=!1,...n})=>{const r=`${dr}--cc--card-node`,i=hr(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return St.jsx("div",{className:i,...n,children:e})},TB=({children:e,...t})=>{const n=`${dr}--cc--card-node`,r=hr(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return St.jsx("label",{className:r,...t,children:e})},SB=({children:e,...t})=>{const n=`${dr}--cc--card-node`,r=hr(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return St.jsx("div",{className:r,...t,children:e})},wB=({children:e,...t})=>{const n=`${dr}--cc--card-node`,r=hr(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return St.jsx("div",{className:r,...t,children:e})},$B=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:a,variant:s=null,...o})=>{const l=`${dr}--cc--edge`,c=hr(l,{[`${l}--${s}`]:s,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&a&&(u=RD(i,a)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return St.jsxs("g",{className:c,...o,children:[St.jsx("path",{d:u,className:`${l}__container`}),St.jsx("path",{d:u,className:`${l}__outer`}),St.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},Wr=({color:e,d:t,id:n,orient:r="auto",height:i,width:a,position:s="end",className:o,refX:l,refY:c,...u})=>{const d=`${dr}--cc--marker`,h=hr(d,o),p=s==="end"?(a||0)/2+.5:.5,f=(i||0)/2;return St.jsx("marker",{className:h,markerHeight:i,markerWidth:a,orient:r,id:n,refX:l||p,refY:c||f,markerUnits:"userSpaceOnUse",...u,children:St.jsx("path",{d:t,style:{fill:e}})})},MB=e=>St.jsx(Wr,{d:LD.d,...e}),CB=e=>St.jsx(Wr,{d:DD.d,...e}),AB=e=>St.jsx(Wr,{d:ID.d,...e}),kB=e=>St.jsx(Wr,{d:ND.d,...e}),RB=e=>St.jsx(Wr,{d:PD.d,...e}),LB=e=>St.jsx(Wr,{d:UD.d,...e}),DB=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:a,renderIcon:s,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const p=o?"a":h.onClick?"button":t,f=`${dr}--cc--shape-node`,g=hr(f,{[`${f}--stacked`]:c,[`${f}--${e}`]:e,[`${f}--${p}`]:p,[r]:r}),m=n?St.jsx("div",{className:`${f}__title`,children:n}):null,y=i?St.jsx("div",{className:`${f}__subtitle`,children:i}):null,v=a?St.jsx("div",{className:`${f}__description`,children:a}):null;return St.jsxs(p,{className:g,style:{height:l,width:l,position:u},tabIndex:0,...h,children:[St.jsx("div",{className:`${f}__icon`,children:s}),St.jsxs("div",{className:`${f}__body`,style:{position:d},children:[m,y,v]})]})};Y.Alignments=ie,Y.AlluvialChart=KU,Y.AreaChart=QU,Y.AreaEvent=Al,Y.ArrowDirections=fs,Y.ArrowLeftMarker=MB,Y.ArrowRightMarker=CB,Y.AxisEvent=Cl,Y.AxisFlavor=Ki,Y.AxisPositions=Z,Y.AxisTitleOrientations=ms,Y.BarEvent=Dl,Y.BoxplotChart=JU,Y.BoxplotEvent=Il,Y.BubbleChart=tB,Y.BulletChart=eB,Y.CalloutDirections=qi,Y.CanvasZoomEvent=Ml,Y.CardNode=EB,Y.CardNodeColumn=OB,Y.CardNodeLabel=TB,Y.CardNodeSubtitle=SB,Y.CardNodeTitle=wB,Y.CartesianOrientations=re,Y.ChartEvent=er,Y.ChartTheme=Fl,Y.ChartTypes=Ie,Y.ChoroplethChart=Y0,Y.CircleMarker=AB,Y.CirclePackChart=nB,Y.ColorClassNameTypes=dt,Y.ColorLegendType=Xi,Y.ComboChart=rB,Y.DiamondMarker=kB,Y.DividerStatus=Jr,Y.DominantBaseline=_n,Y.DonutChart=iB,Y.Edge=$B,Y.ExperimentalChoroplethChart=Y0,Y.GaugeChart=aB,Y.GaugeEvent=Ll,Y.GaugeTypes=yr,Y.GroupedBarChart=sB,Y.HeatmapChart=oB,Y.HistogramChart=lB,Y.LayoutAlignItems=vr,Y.LayoutDirection=Ut,Y.LayoutGrowth=mt,Y.LegendItemType=se,Y.LegendOrientations=Qr,Y.LegendPositions=Kr,Y.LineChart=cB,Y.LineEvent=Pl,Y.LollipopChart=uB,Y.Marker=Wr,Y.MeterChart=hB,Y.ModalEvent=Tl,Y.ModelEvent=Sl,Y.PieChart=dB,Y.PieEvent=Rl,Y.Projection=xn,Y.RadarChart=pB,Y.RadarEvent=Ul,Y.RenderTypes=ut,Y.ScaleTypes=lt,Y.ScatterChart=fB,Y.ScatterEvent=Nl,Y.ShapeNode=DB,Y.SimpleBarChart=mB,Y.Skeletons=ae,Y.SquareMarker=RB,Y.StackedAreaChart=gB,Y.StackedBarChart=vB,Y.Statuses=Yi,Y.TeeMarker=LB,Y.TextAnchor=bn,Y.ThresholdEvent=Vl,Y.TickRotations=Zi,Y.ToolbarControlTypes=kt,Y.TooltipEvent=Zr,Y.TreeChart=yB,Y.TreeEvent=Bl,Y.TreeTypes=ps,Y.TreemapChart=bB,Y.TreemapEvent=Hl,Y.TruncationTypes=We,Y.WordCloudChart=_B,Y.WordCloudEvent=kl,Y.ZoomBarTypes=rn,Y.ZoomDomainEvent=$l,Y.ZoombarEvent=wl,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|
|
107
116
|
//# sourceMappingURL=index.umd.cjs.map
|