dash-ant-design 0.1.1 → 0.1.2

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.
Files changed (73) hide show
  1. package/dash_antd_components/async-chart-ava.js +1 -1
  2. package/dash_antd_components/async-chart.js +1 -1
  3. package/dash_antd_components/async-form-upload.js +1 -1
  4. package/dash_antd_components/async-icon-outlined.js +1 -1
  5. package/dash_antd_components/async-locale-ar.js +1 -1
  6. package/dash_antd_components/async-locale-az.js +1 -1
  7. package/dash_antd_components/async-locale-bg.js +1 -1
  8. package/dash_antd_components/async-locale-bn.js +1 -1
  9. package/dash_antd_components/async-locale-by.js +1 -1
  10. package/dash_antd_components/async-locale-ca.js +1 -1
  11. package/dash_antd_components/async-locale-cs.js +1 -1
  12. package/dash_antd_components/async-locale-da.js +1 -1
  13. package/dash_antd_components/async-locale-de.js +1 -1
  14. package/dash_antd_components/async-locale-el.js +1 -1
  15. package/dash_antd_components/async-locale-en.js +1 -1
  16. package/dash_antd_components/async-locale-es.js +1 -1
  17. package/dash_antd_components/async-locale-et.js +1 -1
  18. package/dash_antd_components/async-locale-eu.js +1 -1
  19. package/dash_antd_components/async-locale-fa.js +1 -1
  20. package/dash_antd_components/async-locale-fi.js +1 -1
  21. package/dash_antd_components/async-locale-fr.js +1 -1
  22. package/dash_antd_components/async-locale-ga.js +1 -1
  23. package/dash_antd_components/async-locale-gl.js +1 -1
  24. package/dash_antd_components/async-locale-he.js +1 -1
  25. package/dash_antd_components/async-locale-hi.js +1 -1
  26. package/dash_antd_components/async-locale-hr.js +1 -1
  27. package/dash_antd_components/async-locale-hu.js +1 -1
  28. package/dash_antd_components/async-locale-id.js +1 -1
  29. package/dash_antd_components/async-locale-is.js +1 -1
  30. package/dash_antd_components/async-locale-it.js +1 -1
  31. package/dash_antd_components/async-locale-ja.js +1 -1
  32. package/dash_antd_components/async-locale-ka.js +1 -1
  33. package/dash_antd_components/async-locale-kk.js +1 -1
  34. package/dash_antd_components/async-locale-km.js +1 -1
  35. package/dash_antd_components/async-locale-kmr.js +1 -1
  36. package/dash_antd_components/async-locale-kn.js +1 -1
  37. package/dash_antd_components/async-locale-ko.js +1 -1
  38. package/dash_antd_components/async-locale-ku.js +1 -1
  39. package/dash_antd_components/async-locale-lt.js +1 -1
  40. package/dash_antd_components/async-locale-lv.js +1 -1
  41. package/dash_antd_components/async-locale-mk.js +1 -1
  42. package/dash_antd_components/async-locale-ml.js +1 -1
  43. package/dash_antd_components/async-locale-mn.js +1 -1
  44. package/dash_antd_components/async-locale-mr.js +1 -1
  45. package/dash_antd_components/async-locale-ms.js +1 -1
  46. package/dash_antd_components/async-locale-my.js +1 -1
  47. package/dash_antd_components/async-locale-nb.js +1 -1
  48. package/dash_antd_components/async-locale-nl.js +1 -1
  49. package/dash_antd_components/async-locale-pl.js +1 -1
  50. package/dash_antd_components/async-locale-pt.js +1 -1
  51. package/dash_antd_components/async-locale-ro.js +1 -1
  52. package/dash_antd_components/async-locale-ru.js +1 -1
  53. package/dash_antd_components/async-locale-si.js +1 -1
  54. package/dash_antd_components/async-locale-sk.js +1 -1
  55. package/dash_antd_components/async-locale-sr.js +1 -1
  56. package/dash_antd_components/async-locale-sv.js +1 -1
  57. package/dash_antd_components/async-locale-ta.js +1 -1
  58. package/dash_antd_components/async-locale-th.js +1 -1
  59. package/dash_antd_components/async-locale-tk.js +1 -1
  60. package/dash_antd_components/async-locale-tr.js +1 -1
  61. package/dash_antd_components/async-locale-uk.js +1 -1
  62. package/dash_antd_components/async-locale-ur.js +1 -1
  63. package/dash_antd_components/async-locale-uz.js +1 -1
  64. package/dash_antd_components/async-locale-vi.js +1 -1
  65. package/dash_antd_components/async-locale-zh.js +1 -1
  66. package/dash_antd_components/async-markdown.js +1 -1
  67. package/dash_antd_components/async-navigation.js +1 -1
  68. package/dash_antd_components/async-picker.js +1 -1
  69. package/dash_antd_components/async-sheet.js +1 -1
  70. package/dash_antd_components/async-table.js +1 -1
  71. package/dash_antd_components/async-viz-shared.js +1 -1
  72. package/dash_antd_components/dash_antd_components.js +1 -1
  73. package/package.json +2 -2
@@ -1 +1 @@
1
- (self.webpackChunkdash_antd_components=self.webpackChunkdash_antd_components||[]).push([["async-chart-ava"],{"./node_modules/.pnpm/@antv+g2-extension-ava@0.2.0_@antv+g2@5.4.8_@antv+g2plot@2.3.27_@antv+g6@4.3.11/node_modules/@antv/g2-extension-ava/esm/index.js"(e,t,n){"use strict";n.d(t,{Auto:()=>co});var r=n("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),a={line_chart:{id:"line_chart",name:"Line Chart",alias:["Lines"],family:["LineCharts"],def:"A line chart uses lines with segments to show changes in data in a ordinal dimension.",purpose:["Comparison","Trend","Anomaly"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position","Direction"],recRate:"Recommended"},step_line_chart:{id:"step_line_chart",name:"Step Line Chart",alias:["Step Lines"],family:["LineCharts"],def:"A step line chart is a line chart in which points of each line are connected by horizontal and vertical line segments, looking like steps of a staircase.",purpose:["Comparison","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position","Direction"],recRate:"Recommended"},area_chart:{id:"area_chart",name:"Area Chart",alias:[],family:["AreaCharts"],def:"An area chart uses series of line segments with overlapped areas to show the change in data in a ordinal dimension.",purpose:["Comparison","Trend","Anomaly"],coord:["Cartesian2D"],category:["Statistic"],shape:["Area"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Position"],recRate:"Recommended"},stacked_area_chart:{id:"stacked_area_chart",name:"Stacked Area Chart",alias:[],family:["AreaCharts"],def:"A stacked area chart uses layered line segments with different styles of padding regions to display how multiple sets of data change in the same ordinal dimension, and the endpoint heights of the segments on the same dimension tick are accumulated by value.",purpose:["Composition","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Area"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Length"],recRate:"Recommended"},percent_stacked_area_chart:{id:"percent_stacked_area_chart",name:"Percent Stacked Area Chart",alias:["Percent Stacked Area","% Stacked Area","100% Stacked Area"],family:["AreaCharts"],def:"A percent stacked area chart is an extented stacked area chart in which the height of the endpoints of the line segment on the same dimension tick is the accumulated proportion of the ratio, which is 100% of the total.",purpose:["Comparison","Composition","Proportion","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Area"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Length"],recRate:"Recommended"},column_chart:{id:"column_chart",name:"Column Chart",alias:["Columns"],family:["ColumnCharts"],def:"A column chart uses series of columns to display the value of the dimension. The horizontal axis shows the classification dimension and the vertical axis shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position","Color"],recRate:"Recommended"},grouped_column_chart:{id:"grouped_column_chart",name:"Grouped Column Chart",alias:["Grouped Column"],family:["ColumnCharts"],def:"A grouped column chart uses columns of different colors to form a group to display the values of dimensions. The horizontal axis indicates the grouping of categories, the color indicates the categories, and the vertical axis shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Position"],recRate:"Recommended"},stacked_column_chart:{id:"stacked_column_chart",name:"Stacked Column Chart",alias:["Stacked Column"],family:["ColumnCharts"],def:"A stacked column chart uses stacked bars of different colors to display the values for each dimension. The horizontal axis indicates the first classification dimension, the color indicates the second classification dimension, and the vertical axis shows the corresponding value.",purpose:["Comparison","Composition","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length","Position"],recRate:"Recommended"},percent_stacked_column_chart:{id:"percent_stacked_column_chart",name:"Percent Stacked Column Chart",alias:["Percent Stacked Column","% Stacked Column","100% Stacked Column"],family:["ColumnCharts"],def:"A percent stacked column chart uses stacked bars of different colors to display the values for each dimension. The horizontal axis indicates the first classification dimension, the color indicates the second classification dimension, and the vertical axis shows the percentage of the corresponding classification.",purpose:["Comparison","Composition","Distribution","Proportion"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length"],recRate:"Recommended"},range_column_chart:{id:"range_column_chart",name:"Range Column Chart",alias:[],family:["ColumnCharts"],def:"A column chart that does not have to start from zero axis.",purpose:["Comparison"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Interval","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Length"],recRate:"Recommended"},waterfall_chart:{id:"waterfall_chart",name:"Waterfall Chart",alias:["Flying Bricks Chart","Mario Chart","Bridge Chart","Cascade Chart"],family:["ColumnCharts"],def:"A waterfall chart is used to portray how an initial value is affected by a series of intermediate positive or negative values",purpose:["Comparison","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Ordinal","Time","Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length","Position"],recRate:"Recommended"},histogram:{id:"histogram",name:"Histogram",alias:[],family:["ColumnCharts"],def:"A histogram is an accurate representation of the distribution of numerical data.",purpose:["Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position"],recRate:"Recommended"},bar_chart:{id:"bar_chart",name:"Bar Chart",alias:["Bars"],family:["BarCharts"],def:"A bar chart uses series of bars to display the value of the dimension. The vertical axis shows the classification dimension and the horizontal axis shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position","Color"],recRate:"Recommended"},stacked_bar_chart:{id:"stacked_bar_chart",name:"Stacked Bar Chart",alias:["Stacked Bar"],family:["BarCharts"],def:"A stacked bar chart uses stacked bars of different colors to display the values for each dimension. The vertical axis indicates the first classification dimension, the color indicates the second classification dimension, and the horizontal axis shows the corresponding value.",purpose:["Comparison","Composition","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length","Position"],recRate:"Recommended"},percent_stacked_bar_chart:{id:"percent_stacked_bar_chart",name:"Percent Stacked Bar Chart",alias:["Percent Stacked Bar","% Stacked Bar","100% Stacked Bar"],family:["BarCharts"],def:"A percent stacked column chart uses stacked bars of different colors to display the values for each dimension. The vertical axis indicates the first classification dimension, the color indicates the second classification dimension, and the horizontal axis shows the percentage of the corresponding classification.",purpose:["Comparison","Composition","Distribution","Proportion"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length"],recRate:"Recommended"},grouped_bar_chart:{id:"grouped_bar_chart",name:"Grouped Bar Chart",alias:["Grouped Bar"],family:["BarCharts"],def:"A grouped bar chart uses bars of different colors to form a group to display the values of the dimensions. The vertical axis indicates the grouping of categories, the color indicates the categories, and the horizontal axis shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Position"],recRate:"Recommended"},range_bar_chart:{id:"range_bar_chart",name:"Range Bar Chart",alias:[],family:["BarCharts"],def:"A bar chart that does not have to start from zero axis.",purpose:["Comparison"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]}],channel:["Length"],recRate:"Recommended"},radial_bar_chart:{id:"radial_bar_chart",name:"Radial Bar Chart",alias:["Radial Column Chart"],family:["BarCharts"],def:"A bar chart that is plotted in the polar coordinate system. The axis along radius shows the classification dimension and the angle shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Angle","Color"],recRate:"Recommended"},bullet_chart:{id:"bullet_chart",name:"Bullet Chart",alias:[],family:["BarCharts"],def:"A bullet graph is a variation of a bar graph developed by Stephen Few. Seemingly inspired by the traditional thermometer charts and progress bars found in many dashboards, the bullet graph serves as a replacement for dashboard gauges and meters.",purpose:["Proportion"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:3,maxQty:3,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]}],channel:["Position","Color"],recRate:"Recommended"},pie_chart:{id:"pie_chart",name:"Pie Chart",alias:["Circle Chart","Pie"],family:["PieCharts"],def:"A pie chart is a chart that the classification and proportion of data are represented by the color and arc length (angle, area) of the sector.",purpose:["Comparison","Composition","Proportion"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Angle","Area","Color"],recRate:"Use with Caution"},donut_chart:{id:"donut_chart",name:"Donut Chart",alias:["Donut","Doughnut","Doughnut Chart","Ring Chart"],family:["PieCharts"],def:"A donut chart is a variation on a Pie chart except it has a round hole in the center which makes it look like a donut.",purpose:["Comparison","Composition","Proportion"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["ArcLength"],recRate:"Recommended"},nested_pie_chart:{id:"nested_pie_chart",name:"Nested Pie Chart",alias:["Nested Circle Chart","Nested Pie","Nested Donut Chart"],family:["PieCharts"],def:"A nested pie chart is a chart that contains several donut charts, where all the donut charts share the same center in position.",purpose:["Comparison","Composition","Proportion"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:"*",fieldConditions:["Interval"]}],channel:["Angle","Area","Color","Position"],recRate:"Use with Caution"},rose_chart:{id:"rose_chart",name:"Rose Chart",alias:["Nightingale Chart","Polar Area Chart","Coxcomb Chart"],family:["PieCharts"],def:"Nightingale Rose Chart is a peculiar combination of the Radar Chart and Stacked Column Chart types of data visualization.",purpose:["Comparison","Composition","Proportion"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Angle","Color","Length"],recRate:"Use with Caution"},scatter_plot:{id:"scatter_plot",name:"Scatter Plot",alias:["Scatter Chart","Scatterplot"],family:["ScatterCharts"],def:"A scatter plot is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for series of data.",purpose:["Comparison","Distribution","Anomaly"],coord:["Cartesian2D"],category:["Statistic"],shape:["Scatter"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Interval"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Position"],recRate:"Recommended"},bubble_chart:{id:"bubble_chart",name:"Bubble Chart",alias:["Bubble Chart"],family:["ScatterCharts"],def:"A bubble chart is a type of chart that displays four dimensions of data with x, y positions, circle size and circle color.",purpose:["Comparison","Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Scatter"],dataPres:[{minQty:3,maxQty:3,fieldConditions:["Interval"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Position","Size"],recRate:"Recommended"},non_ribbon_chord_diagram:{id:"non_ribbon_chord_diagram",name:"Non-Ribbon Chord Diagram",alias:[],family:["GeneralGraph"],def:"A stripped-down version of a Chord Diagram, with only the connection lines showing. This provides more emphasis on the connections within the data.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},arc_diagram:{id:"arc_diagram",name:"Arc Diagram",alias:[],family:["GeneralGraph"],def:"A graph where the edges are represented as arcs.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},chord_diagram:{id:"chord_diagram",name:"Chord Diagram",alias:[],family:["GeneralGraph"],def:"A graphical method of displaying the inter-relationships between data in a matrix. The data are arranged radially around a circle with the relationships between the data points typically drawn as arcs connecting the data.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},treemap:{id:"treemap",name:"Treemap",alias:[],family:["TreeGraph"],def:"A visual representation of a data tree with nodes. Each node is displayed as a rectangle, sized and colored according to values that you assign.",purpose:["Composition","Comparison","Hierarchy"],coord:["Cartesian2D"],category:["Statistic"],shape:["Square"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Area"],recRate:"Recommended"},sankey_diagram:{id:"sankey_diagram",name:"Sankey Diagram",alias:[],family:["GeneralGraph"],def:"A graph shows the flows with weights between objects.",purpose:["Flow","Trend","Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},funnel_chart:{id:"funnel_chart",name:"Funnel Chart",alias:[],family:["FunnelCharts"],def:"A funnel chart is often used to represent stages in a sales process and show the amount of potential revenue for each stage.",purpose:["Trend"],coord:["SymmetricCartesian"],category:["Statistic"],shape:["Symmetric"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length"],recRate:"Recommended"},mirror_funnel_chart:{id:"mirror_funnel_chart",name:"Mirror Funnel Chart",alias:["Contrast Funnel Chart"],family:["FunnelCharts"],def:"A mirror funnel chart is a funnel chart divided into two series by a central axis.",purpose:["Comparison","Trend"],coord:["SymmetricCartesian"],category:["Statistic"],shape:["Symmetric"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Length","Direction"],recRate:"Recommended"},box_plot:{id:"box_plot",name:"Box Plot",alias:["Box and Whisker Plot","boxplot"],family:["BarCharts"],def:"A box plot is often used to graphically depict groups of numerical data through their quartiles. Box plots may also have lines extending from the boxes indicating variability outside the upper and lower quartiles. Outliers may be plotted as individual points.",purpose:["Distribution","Anomaly"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position"],recRate:"Recommended"},heatmap:{id:"heatmap",name:"Heatmap",alias:[],family:["HeatmapCharts"],def:"A heatmap is a graphical representation of data where the individual values contained in a matrix are represented as colors.",purpose:["Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Square"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Position"],recRate:"Recommended"},density_heatmap:{id:"density_heatmap",name:"Density Heatmap",alias:["Heatmap"],family:["HeatmapCharts"],def:"A density heatmap is a heatmap for representing the density of dots.",purpose:["Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Area"],dataPres:[{minQty:3,maxQty:3,fieldConditions:["Interval"]}],channel:["Color","Position","Area"],recRate:"Recommended"},radar_chart:{id:"radar_chart",name:"Radar Chart",alias:["Web Chart","Spider Chart","Star Chart","Cobweb Chart","Irregular Polygon","Kiviat diagram"],family:["RadarCharts"],def:"A radar chart maps series of data volume of multiple dimensions onto the axes. Starting at the same center point, usually ending at the edge of the circle, connecting the same set of points using lines.",purpose:["Comparison"],coord:["Radar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:2,fieldConditions:["Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Position"],recRate:"Recommended"},wordcloud:{id:"wordcloud",name:"Word Cloud",alias:["Wordle","Tag Cloud","Text Cloud"],family:["Others"],def:"A word cloud is a collection, or cluster, of words depicted in different sizes, colors, and shapes, which takes a piece of text as input. Typically, the font size in the word cloud is encoded as the word frequency in the input text.",purpose:["Proportion"],coord:["Cartesian2D"],category:["Diagram"],shape:["Scatter"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal"]},{minQty:0,maxQty:1,fieldConditions:["Interval"]}],channel:["Size","Position","Color"],recRate:"Recommended"},candlestick_chart:{id:"candlestick_chart",name:"Candlestick Chart",alias:["Japanese Candlestick Chart)"],family:["BarCharts"],def:"A candlestick chart is a specific version of box plot, which is a style of financial chart used to describe price movements of a security, derivative, or currency.",purpose:["Trend","Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position"],recRate:"Recommended"},compact_box_tree:{id:"compact_box_tree",name:"CompactBox Tree",alias:[],family:["TreeGraph"],def:"A type of tree graph layout which arranges the nodes with same depth on the same level.",purpose:["Relation","Hierarchy"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},dendrogram:{id:"dendrogram",name:"Dendrogram",alias:[],family:["TreeGraph"],def:"A type of tree graph layout which arranges the leaves on the same level.",purpose:["Relation","Hierarchy"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},indented_tree:{id:"indented_tree",name:"Indented Tree Layout",alias:[],family:["TreeGraph"],def:"A type of tree graph layout where the hierarchy of tree is represented by the horizontal indentation, and each element will occupy one row/column. It is commonly used to represent the file directory structure.",purpose:["Relation","Hierarchy"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},radial_tree:{id:"radial_tree",name:"Radial Tree Layout",alias:[],family:["TreeGraph"],def:"A type of tree graph layout which places the root at the center, and the branches around the root radially.",purpose:["Relation","Hierarchy"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},flow_diagram:{id:"flow_diagram",name:"Flow Diagram",alias:["Dagre Graph Layout","Dagre","Flow Chart"],family:["GeneralGraph"],def:"Directed flow graph.",purpose:["Relation","Flow"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},fruchterman_layout_graph:{id:"fruchterman_layout_graph",name:"Fruchterman Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of force directed graph layout.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},force_directed_layout_graph:{id:"force_directed_layout_graph",name:"Force Directed Graph Layout",alias:[],family:["GeneralGraph"],def:"The classical force directed graph layout.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},fa2_layout_graph:{id:"fa2_layout_graph",name:"Force Atlas 2 Graph Layout",alias:["FA2 Layout"],family:["GeneralGraph"],def:"A type of force directed graph layout algorithm. It focuses more on the degree of the node when calculating the force than the classical force-directed algorithm .",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},mds_layout_graph:{id:"mds_layout_graph",name:"Multi-Dimensional Scaling Layout",alias:["MDS Layout"],family:["GeneralGraph"],def:"A type of dimension reduction algorithm that could be used for calculating graph layout. MDS (Multidimensional scaling) is used for project high dimensional data onto low dimensional space.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},circular_layout_graph:{id:"circular_layout_graph",name:"Circular Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout which arranges all the nodes on a circle.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},spiral_layout_graph:{id:"spiral_layout_graph",name:"Spiral Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout which arranges all the nodes along a spiral line.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},radial_layout_graph:{id:"radial_layout_graph",name:"Radial Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout which places a focus node on the center and the others on the concentrics centered at the focus node according to the shortest path length to the it.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},concentric_layout_graph:{id:"concentric_layout_graph",name:"Concentric Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout which arranges the nodes on concentrics.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},grid_layout_graph:{id:"grid_layout_graph",name:"Grid Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout arranges the nodes on grids.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"}};function o(){return JSON.parse(JSON.stringify(a))}function i(e){var t=o();return e?function(e,t){var n=e,a=t.exclude,o=t.include,i=t.custom;return a&&a.forEach(function(e){Object.keys(n).includes(e)&&delete n[e]}),o&&Object.keys(n).forEach(function(e){o.includes(e)||delete n[e]}),(0,r.Cl)((0,r.Cl)({},n),i)}(t,e):t}function l(e,t){return t.every(function(t){return e.includes(t)})}var s=10,c=["bar_chart","grouped_bar_chart","stacked_bar_chart","percent_stacked_bar_chart","column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart"],u={id:"bar-series-qty",type:"SOFT",docs:{lintText:"Bar chart should has proper number of bars or bar groups."},trigger:function(e){return c.includes(e.chartType)},validator:function(e){var t=1,n=e.dataProps;if(n&&e.chartType){var r=n.find(function(e){return l(e.levelOfMeasurements,["Nominal"])}),a=r&&r.count?r.count:0;a>20&&(t=20/a)}return t=t<.1?.1:t}},d=["bar_chart","grouped_bar_chart","stacked_bar_chart","percent_stacked_bar_chart","column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart"],f={id:"bar-without-axis-min",type:"DESIGN",docs:{lintText:"It is not recommended to set the minimum value of axis for the bar or column chart.",fixText:"Remove the minimum value config of axis."},trigger:function(e){return d.includes(e.chartType)},optimizer:function(e,t){var n,r,a=t.scale;if(!a)return{};var o=null===(n=a.x)||void 0===n?void 0:n.domainMin,i=null===(r=a.y)||void 0===r?void 0:r.domainMin;if(o||i){var l=JSON.parse(JSON.stringify(a));return o&&(l.x.domainMin=0),i&&(l.y.domainMin=0),{scale:l}}return{}}};function h(e,t){return t.some(function(t){return e.includes(t)})}function m(e,t){return e.distinct<t.distinct?1:e.distinct>t.distinct?-1:0}var p={"bar-series-qty":.5,"data-check":1,"data-field-qty":1,"diff-pie-sector":.5,"landscape-or-portrait":.3,"limit-series":1,"line-field-time-ordinal":1,"no-redundant-field":1,"nominal-enum-combinatorial":1,"purpose-check":1,"series-qty-limit":.8},g=function(e,t,n,a,o,i){var l=1;return Object.values(n).filter(function(n){var i,l,s,c=(null===(i=n.option)||void 0===i?void 0:i.weight)||p[n.id]||1,u=null===(l=n.option)||void 0===l?void 0:l.extra;return n.type===a&&n.trigger((0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},o),{weight:c}),u),{chartType:e,chartWIKI:t}))&&!(null===(s=n.option)||void 0===s?void 0:s.off)}).forEach(function(n){var s,c,u=(null===(s=n.option)||void 0===s?void 0:s.weight)||p[n.id]||1,d=null===(c=n.option)||void 0===c?void 0:c.extra,f=n.validator((0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},o),{weight:u}),d),{chartType:e,chartWIKI:t})),h=u*f;l*=h,i.push({phase:"ADVISE",ruleId:n.id,score:h,base:f,weight:u,ruleType:a})}),l},b={id:"data-check",type:"HARD",docs:{lintText:"Data must satisfy the data prerequisites."},trigger:function(){return!0},validator:function(e){var t=0,n=e.dataProps,r=e.chartType,a=e.chartWIKI;if(n&&r&&a[r]){t=1;var o=a[r].dataPres||[];o.forEach(function(e){(function(e,t){var n=t.map(function(e){return e.levelOfMeasurements});if(n){var r=0;if(n.forEach(function(t){t&&h(t,e.fieldConditions)&&(r+=1)}),r>=e.minQty&&(r<=e.maxQty||"*"===e.maxQty))return!0}return!1})(e,n)||(t=0)}),n.map(function(e){return e.levelOfMeasurements}).forEach(function(e){var n=!1;o.forEach(function(t){e&&h(e,t.fieldConditions)&&(n=!0)}),n||(t=0)})}return t}},y=["pie_chart","donut_chart"],v={id:"diff-pie-sector",type:"SOFT",docs:{lintText:"The difference between sectors of a pie chart should be large enough."},trigger:function(e){return y.includes(e.chartType)},validator:function(e){var t=1,n=e.dataProps;if(n){var r=n.find(function(e){return l(e.levelOfMeasurements,["Interval"])});if(r&&r.sum&&r.rawData){var a=1/r.sum,o=r.rawData.map(function(e){return e*a}).reduce(function(e,t){return e*t}),i=r.rawData.length,s=Math.pow(1/i,i);t=Math.abs(s-Math.abs(o))/s*2}}return t=t<.1?.1:t}},_=["bar_chart","grouped_bar_chart","stacked_bar_chart","percent_stacked_bar_chart","column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart"];function x(e){var t=e.preferences;return!!(e.dataProps&&e.chartType&&t&&t.canvasLayout)}var C={id:"landscape-or-portrait",type:"SOFT",docs:{lintText:"Recommend column charts for landscape layout and bar charts for portrait layout."},trigger:function(e){return _.includes(e.chartType)&&x(e)},validator:function(e){var t=1,n=e.chartType,r=e.preferences;return x(e)&&("portrait"===r.canvasLayout&&["bar_chart","grouped_bar_chart","stacked_bar_chart","percent_stacked_bar_chart"].includes(n)||"landscape"===r.canvasLayout&&["column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart"].includes(n))&&(t=5),t}};var w={id:"limit-series",type:"SOFT",docs:{lintText:"Avoid too many values in one series."},trigger:function(e){return function(e){return e.filter(function(e){return h(e.levelOfMeasurements,["Nominal","Ordinal"])}).length>=2}(e.dataProps)},validator:function(e){var t=1,n=e.dataProps,r=e.chartType;if(n){var a=n.filter(function(e){return h(e.levelOfMeasurements,["Nominal","Ordinal"])});if(a.length>=2){var o=a.sort(m)[1];o.distinct&&(t=o.distinct>s?.1:1/o.distinct,o.distinct>6&&"heatmap"===r?t=5:"heatmap"===r&&(t=1))}}return t}},k=["line_chart","area_chart","stacked_area_chart","percent_stacked_area_chart"],M={id:"line-field-time-ordinal",type:"SOFT",docs:{lintText:"Data containing time or ordinal fields are suitable for line or area charts."},trigger:function(e){return k.includes(e.chartType)},validator:function(e){var t=1,n=e.dataProps;n&&(n.find(function(e){return h(e.levelOfMeasurements,["Ordinal","Time"])})&&(t=5));return t}},R=["bar_chart","column_chart","grouped_bar_chart","grouped_column_chart","stacked_bar_chart","stacked_column_chart"];function O(e){return e.filter(function(e){return l(e.levelOfMeasurements,["Nominal"])})}var N={id:"nominal-enum-combinatorial",type:"SOFT",docs:{lintText:"Single (Basic) and Multi (Stacked, Grouped,...) charts should be optimized recommended by nominal enums combinatorial numbers."},trigger:function(e){var t=e.dataProps;return R.includes(e.chartType)&&O(t).length>=2},validator:function(e){var t=1,n=e.dataProps,r=e.chartType;if(n){var a=O(n);if(a.length>=2){var o=a.sort(m),i=o[0],l=o[1];if(i.distinct===i.count&&["bar_chart","column_chart"].includes(r)&&(t=5),i.count&&i.distinct&&l.distinct&&i.count>i.distinct){["grouped_bar_chart","grouped_column_chart","stacked_bar_chart","stacked_column_chart"].includes(r)&&(t=5)}}}return t}},S=["pie_chart","donut_chart","radar_chart","rose_chart"],A={id:"series-qty-limit",type:"SOFT",docs:{lintText:"Some charts should has at most N values for the series."},trigger:function(e){return S.includes(e.chartType)},validator:function(e){var t=1,n=e.dataProps,r=e.chartType,a=e.limit;if((!Number.isInteger(a)||a<=0)&&(a=6,"pie_chart"!==r&&"donut_chart"!==r&&"rose_chart"!==r||(a=6),"radar_chart"===r&&(a=8)),n){var o=n.find(function(e){return l(e.levelOfMeasurements,["Nominal"])}),i=o&&o.count?o.count:0;i>=2&&i<=a&&(t=5+2/i)}return t}},Q=n("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");function D(e){return"number"==typeof e}function P(e){return"string"==typeof e||"boolean"==typeof e}function T(e){return e instanceof Date}function j(e,t,n){if(void 0!==n)return function(e){switch(e){case"linear":case"log":case"pow":case"sqrt":case"qunatile":case"threshold":case"quantize":case"sequential":return"quantitative";case"time":return"temporal";case"ordinal":case"point":case"band":return"categorical";default:throw new Error("Unkonwn scale type: ".concat(e,"."))}}(n);var r=function(e,t){return function(e){return"function"==typeof e}(t)?e.map(t):function(e,t){return"string"==typeof t&&e.some(function(e){return void 0!==e[t]})}(e,t)?e.map(function(e){return e[t]}):e.map(function(){return t})}(e,t);return function(e){if(e.some(D))return"quantitative";if(e.some(P))return"categorical";if(e.some(T))return"temporal";throw new Error("Unknown type: ".concat(typeof e[0]))}(r)}function L(e){var t=e.data,n=e.scale,a=(0,Q.mapValues)(e.encode,function(e,r){return{field:e,type:j(t,e,null==n?void 0:n[r].type)}});return(0,r.Cl)((0,r.Cl)({},e),{encode:a})}var G=["line_chart"],z={id:"x-axis-line-fading",type:"DESIGN",docs:{lintText:"Adjust axis to make it prettier"},trigger:function(e){return G.includes(e.chartType)},optimizer:function(e,t){var n,r=L(t).encode;if(r&&"quantitative"===(null===(n=r.y)||void 0===n?void 0:n.type)){var a=e.find(function(e){var t;return e.name===(null===(t=r.y)||void 0===t?void 0:t.field)});if(a){var o=a.maximum-a.minimum;if(a.minimum&&a.maximum&&o<2*a.maximum/3){var i=Math.floor(a.minimum-o/5);return{axis:{x:{tick:!1}},scale:{y:{domainMin:i>0?i:0}},clip:!0}}}}return{}}},I={"bar-series-qty":u,"bar-without-axis-min":f,"data-check":b,"data-field-qty":{id:"data-field-qty",type:"HARD",docs:{lintText:"Data must have at least the min qty of the prerequisite."},trigger:function(){return!0},validator:function(e){var t=0,n=e.dataProps,r=e.chartType,a=e.chartWIKI;if(n&&r&&a[r]){t=1;var o=(a[r].dataPres||[]).map(function(e){return e.minQty}).reduce(function(e,t){return e+t});if(n.length)n.length>=o&&(t=1)}return t}},"diff-pie-sector":v,"landscape-or-portrait":C,"limit-series":w,"line-field-time-ordinal":M,"no-redundant-field":{id:"no-redundant-field",type:"HARD",docs:{lintText:"No redundant field."},trigger:function(){return!0},validator:function(e){var t=0,n=e.dataProps,r=e.chartType,a=e.chartWIKI;if(n&&r&&a[r]){var o=(a[r].dataPres||[]).map(function(e){return"*"===e.maxQty?99:e.maxQty}).reduce(function(e,t){return e+t});if(n.length)n.length<=o&&(t=1)}return t}},"nominal-enum-combinatorial":N,"purpose-check":{id:"purpose-check",type:"HARD",docs:{lintText:"Choose chart types that satisfy the purpose, if purpose is defined."},trigger:function(){return!0},validator:function(e){var t=0,n=e.chartType,r=e.purpose,a=e.chartWIKI;if(!r)return t=1;if(n&&a[n]&&r&&(a[n].purpose||"").includes(r))return t=1;return t}},"series-qty-limit":A,"x-axis-line-fading":z},B=Object.keys(I),E=function(e){var t={};return e.forEach(function(e){Object.keys(I).includes(e)&&(t[e]=I[e])}),t},q=[[!0,!1],[0,1],["true","false"],["Yes","No"],["True","False"],["0","1"],["是","否"]],Y="([-_./\\s])",F="(18|19|20)\\d{2}",$="(0?[1-9]|1[012])",W="(0?[1-9]|[12]\\d|3[01])",H="(0?\\d|1\\d|2[0-4])",X="(0?\\d|[012345]\\d)",V=X,Z="(Z|[+-]".concat(H,"(:").concat(X,")?)");function K(e){return null==e||""===e||Number.isNaN(e)||"null"===e}function J(e){return"string"==typeof e}function U(e){return"number"==typeof e}function ee(e){if(J(e)){var t=!1,n=e;/^[+-]/.test(n)&&(n=n.slice(1));for(var r=0;r<n.length;r+=1){var a=n[r];if("."===a){if(!1!==t)return!1;t=!0}if("."!==a&&!/[0-9]/.test(a))return!1}return""!==n.trim()}return!1}function te(e){return"number"==typeof e&&Number.isInteger(e)}function ne(e){return!(!J(e)||!ee(e))&&!e.includes(".")}function re(e){return!(!J(e)||!ee(e))&&e.includes(".")}function ae(e){return!(!e||Object.getPrototypeOf(e)!==Date.prototype)}function oe(e,t){return t?q.some(function(t){return e.every(function(e){return t.includes(e)})}):"boolean"==typeof e}function ie(e){return e&&Object.getPrototypeOf(e)===Object.prototype}function le(e){return Array.isArray(e)}function se(e){return!le(e)&&!ie(e)}function ce(e){return(0,r.fX)([],(0,r.zs)(Array(e).keys()),!1)}function ue(e,t){if(!e)throw new Error(t)}var de=new WeakMap;function fe(e,t,n){return de.get(e)||de.set(e,new Map),de.get(e).set(t,n),n}function he(e,t){var n=de.get(e);if(n)return n.get(t)}function me(e){var t=he(e,"min");return void 0!==t?t:fe(e,"min",Math.min.apply(Math,(0,r.fX)([],(0,r.zs)(e),!1)))}function pe(e){var t=he(e,"minIndex");return void 0!==t?t:fe(e,"minIndex",function(e){for(var t=e[0],n=0,r=0;r<e.length;r+=1)e[r]<t&&(n=r,t=e[r]);return n}(e))}function ge(e){var t=he(e,"max");return void 0!==t?t:fe(e,"max",Math.max.apply(Math,(0,r.fX)([],(0,r.zs)(e),!1)))}function be(e){var t=he(e,"maxIndex");return void 0!==t?t:fe(e,"maxIndex",function(e){for(var t=e[0],n=0,r=0;r<e.length;r+=1)e[r]>t&&(n=r,t=e[r]);return n}(e))}function ye(e){var t=he(e,"sum");return void 0!==t?t:fe(e,"sum",e.reduce(function(e,t){return t+e},0))}function ve(e){return ye(e)/e.length}function _e(e){return e.sort(function(e,t){return e>t?1:-1})}function xe(e,t,n){return void 0===n&&(n=!1),ue(t>0&&t<100,"The percent cannot be between (0, 100)."),(n?e:_e(e))[Math.ceil(e.length*t/100)-1]}function Ce(e){var t=ve(e),n=he(e,"variance");return void 0!==n?n:fe(e,"variance",e.reduce(function(e,n){return e+Math.pow(n-t,2)},0)/e.length)}function we(e){return Math.sqrt(Ce(e))}function ke(e,t){var n=function(e,t){return ue(e.length===t.length,"The x and y must has same length."),ve(e.map(function(e,n){return e*t[n]}))-ve(e)*ve(t)}(e,t);return n/(we(e)*we(t))}function Me(e){var t={};return e.forEach(function(e){var n="".concat(e);t[n]?t[n]+=1:t[n]=1}),t}var Re=function(e){var t,n=(void 0===(t=e)&&(t=!0),["".concat(F),"".concat(F).concat(Y).concat(t?"":"?","W").concat("([0-4]\\d|5[0-2])","(").concat(Y).concat(t?"":"?").concat("([1-7])",")?"),"".concat($).concat(Y).concat(t?"":"?").concat(W).concat(Y).concat(t?"":"?").concat(F),"".concat(F).concat(Y).concat(t?"":"?").concat($).concat(Y).concat(t?"":"?").concat(W),"".concat(F).concat(Y).concat(t?"":"?").concat($),"".concat(F).concat(Y).concat(t?"":"?").concat("((([0-2]\\d|3[0-5])\\d)|36[0-6])")]),a=function(e){return void 0===e&&(e=!0),["".concat(H,":").concat(e?"":"?").concat(X,":").concat(e?"":"?").concat(V,"([.,]").concat("\\d{1,4}",")?").concat(Z,"?"),"".concat(H,":").concat(e?"":"?").concat(X,"?").concat(Z)]}(e),o=(0,r.fX)((0,r.fX)([],(0,r.zs)(n),!1),(0,r.zs)(a),!1);return n.forEach(function(e){a.forEach(function(t){o.push("".concat(e,"[T\\s]").concat(t))})}),o.map(function(e){return new RegExp("^".concat(e,"$"))})};function Oe(e,t){if(J(e))for(var n=Re(t),r=0;r<n.length;r+=1){if(n[r].test(e.trim()))return!0}return!1}function Ne(e){var t=e.rawData;if("string"!==e.recommendation)return!1;if(function(e){return 1===e.distinct}(e))return!1;var n=t.filter(function(e){return!K(e)&&se(e)});if(0===n.length)return!1;for(var r=null,a=null,o=-1,i=-1,l=!0;l;){for(var s=!0,c=0;c<n.length;c+=1){var u=(f=n[c])[o+1];if(null!==r&&0!==c||(r=u),u!==r){s=!1;break}}if(!s)break;o+=1}for(l=!0;l;){var d=!0;for(c=0;c<n.length;c+=1){var f;u=(f=n[c])[f.length-1-(i+1)];if(null!==a&&0!==c||(a=u),u!==a){d=!1;break}}if(!d)break;i+=1}var h=[/\d+/,/(零|一|二|三|四|五|六|七|八|九|十)+/,/(一|二|三|四|五|六|日)/,/^[a-z]$/,/^[A-Z]$/];if(-1===o&&-1===i)return!1;var m=n.map(function(e){return e.slice(-1===o?0:o+1,-1===i?void 0:e.length-i-1)}),p=function(e){var t=h[e],n=m.some(function(e){return!t.test(e)});if(!n)return{value:!0}};for(c=0;c<h.length;c+=1){var g=p(c);if("object"==typeof g)return g.value}return!1}function Se(e,t){return K(e)?"null":U(e)?te(e)?"integer":"float":ae(e)||Oe(e,t)?"date":J(e)&&ee(e)?e.includes(".")?"float":"integer":"string"}function Ae(e,t){var n,r=e.map(function(e){return K(e)?null:e}),a=Me(r),o=a.null?r.filter(function(e){return null!==e}):r,i=r.map(function(e){return Se(e,t)}),l=Object.keys(Me(i)).filter(function(e){return"null"!==e});switch(l.length){case 0:n="null";break;case 1:if("integer"===(n=l[0]))r.filter(function(e){return null!==e}).map(function(e){return"".concat(e)}).every(function(e){return Oe(e)})&&(n="date");break;case 2:if(l.includes("integer")&&l.includes("float")){n="float";break}if(l.includes("integer")&&l.includes("date"))if(r.filter(function(e){return null!==e}).map(function(e){return"".concat(e)}).every(function(e){return Oe(e)})){n="date";break}n="string";break;default:n="string"}var s=function(e){return Array.from(new Set(e))}(o),c={count:e.length,distinct:s.length,type:l.length<=1?l[0]||"null":"mixed",recommendation:n,missing:a.null||0,rawData:e,valueMap:a};if(l.length>1){var u={},d=o;l.forEach(function(e){"date"===e?(u.date=Ae(d.filter(function(e){return Oe(e)}),t),d=d.filter(function(e){return!Oe(e)})):"integer"===e?(u.integer=Ae(d.filter(function(e){return ne(e)}),t),d=d.filter(function(e){return!ne(e)})):"float"===e?(u.float=Ae(d.filter(function(e){return re(e)}),t),d=d.filter(function(e){return!re(e)})):"string"===e&&(u.string=Ae(d.filter(function(e){return"string"===Se(e,t)})),d=d.filter(function(e){return"string"!==Se(e,t)}))}),c.meta=u}2===c.distinct&&"date"!==c.recommendation&&(r.length>=100||oe(s,!0))&&(c.recommendation="boolean"),"string"===n&&Object.assign(c,function(e){var t=e.map(function(e){return e.length});return{maxLength:ge(t),minLength:me(t),meanLength:ve(t),containsChar:e.some(function(e){return/[A-z]/.test(e)}),containsDigit:e.some(function(e){return/[0-9]/.test(e)}),containsSpace:e.some(function(e){return/\s/.test(e)})}}(o.map(function(e){return"".concat(e)}))),"integer"!==n&&"float"!==n||Object.assign(c,function(e){return{minimum:me(e),maximum:ge(e),mean:ve(e),percentile5:xe(e,5),percentile25:xe(e,25),percentile50:xe(e,50),percentile75:xe(e,75),percentile95:xe(e,95),sum:ye(e),variance:Ce(e),standardDeviation:we(e),zeros:e.filter(function(e){return 0===e}).length}}(o.map(function(e){return 1*e}))),"date"===n&&Object.assign(c,function(e,t){void 0===t&&(t=!1);var n=e.map(function(e){if(t){var n="".concat(e);if(8===n.length)return new Date("".concat(n.substring(0,4),"/").concat(n.substring(4,2),"/").concat(n.substring(6,2))).getTime()}return new Date(e).getTime()});return{minimum:e[pe(n)],maximum:e[be(n)]}}(o,"integer"===c.type));var f,h=[];return("boolean"===(f=c).recommendation||"string"===f.recommendation&&!Ne(f))&&h.push("Nominal"),Ne(c)&&h.push("Ordinal"),function(e){return"integer"===e.recommendation||"float"===e.recommendation}(c)&&h.push("Interval"),function(e){return"integer"===e.recommendation}(c)&&h.push("Discrete"),function(e){return"float"===e.recommendation}(c)&&h.push("Continuous"),function(e){return"date"===e.recommendation}(c)&&h.push("Time"),c.levelOfMeasurements=h,c}function Qe(e){return U(e)||J(e)}function De(e,t){return ue(le(e),"Data must be an array"),t?(ue((null==t?void 0:t.length)===e.length,"Index length is ".concat(null==t?void 0:t.length,", but data size is ").concat(e.length)),t):ce(e.length)}function Pe(e,t){return!e&&JSON.stringify(t)?t:e}function Te(e){return Array(U(e)?e:0).fill(" ").concat(" ").join("")}function je(e){var t,n,r,a,o,i;return(null===(i=null===(o=null===(a=null===(r=null===(n=null===(t=JSON.stringify(e))||void 0===t?void 0:t.replace(/\\n/g,""))||void 0===n?void 0:n.replace(/\\/g,""))||void 0===r?void 0:r.replace(/"\[/g,"["))||void 0===a?void 0:a.replace(/\]"/g,"]"))||void 0===o?void 0:o.replace(/"\{/g,"{"))||void 0===i?void 0:i.replace(/\}"/g," }"))||"undefined"}function Le(e){var t;return null===(t=je(e))||void 0===t?void 0:t.length}function Ge(e,t){try{if("string"===t&&!J(e))return"".concat(e);if("boolean"===t&&!oe(e))return Boolean(e);if("null"===t&&!K(e))return null;if(("integer"===t||"float"===t)&&!U(e))return+e;if("date"===t&&!ae(e)&&(U(e)||J(e)))return new Date(e)}catch(e){throw new Error(e)}return e}const ze=function(){function e(e,t){var n,r,a,o,i;if(this.axes=[[]],this.data=[],ue(!t||ie(t),"If extra exists, it must be an object."),se(e))(null==t?void 0:t.indexes)?(this.setAxis(0,null==t?void 0:t.indexes),this.data=Array(null==t?void 0:t.indexes.length).fill(Ge(Pe(e,null==t?void 0:t.fillValue),null===(n=null==t?void 0:t.columnTypes)||void 0===n?void 0:n[0]))):(this.data=[Ge(Pe(e,null==t?void 0:t.fillValue),null===(r=null==t?void 0:t.columnTypes)||void 0===r?void 0:r[0])],this.setAxis(0,[0]));else if(le(e)){for(var l=!0,s=0;s<e.length;s+=1){if(!se(e[s])){l=!1;break}}if(this.setAxis(0,De(e,null==t?void 0:t.indexes)),l&&((null==t?void 0:t.indexes)&&(ue((null===(a=null==t?void 0:t.indexes)||void 0===a?void 0:a.length)===e.length,"Index length is ".concat(null==t?void 0:t.indexes.length,", but data size ").concat(e.length)),this.setAxis(0,null==t?void 0:t.indexes)),this.data=(null==t?void 0:t.fillValue)?e.map(function(e){return Pe(e,null==t?void 0:t.fillValue)}):e,null===(o=null==t?void 0:t.columnTypes)||void 0===o?void 0:o.length))for(s=0;s<this.data.length;s+=1)this.data[s]=Ge(this.data[s],null===(i=null==t?void 0:t.columnTypes)||void 0===i?void 0:i[0])}}return Object.defineProperty(e.prototype,"indexes",{get:function(){return this.getAxis(0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this.getAxis(1)},enumerable:!1,configurable:!0}),e.prototype.getAxis=function(e){return this.axes[e]},e.prototype.setAxis=function(e,t){ue(le(t),"Index or columns must be Axis array."),this.axes[e]=t},e}();const Ie=function(e){function t(t,n){var a,o,i,l,s=this;if(s=e.call(this,t,n)||this,ue(ie(t)||se(t)||le(t),"Data type is illegal"),ie(t)){var c=Object.keys(t);if(null==n?void 0:n.indexes){ue((null===(a=null==n?void 0:n.indexes)||void 0===a?void 0:a.length)<=c.length,"Index length ".concat(null===(o=null==n?void 0:n.indexes)||void 0===o?void 0:o.length," is greater than data size ").concat(c.length));for(var u=0;u<(null==n?void 0:n.indexes.length);u+=1){var d=null==n?void 0:n.indexes[u];c.includes(d)&&s.data.push(Ge(Pe(t[d],null==n?void 0:n.fillValue),null===(i=null==n?void 0:n.columnTypes)||void 0===i?void 0:i[0]))}s.setAxis(0,null==n?void 0:n.indexes)}else s.data=Object.values(t).map(function(e){var t;return Ge(Pe(e,null==n?void 0:n.fillValue),null===(t=null==n?void 0:n.columnTypes)||void 0===t?void 0:t[0])}),s.setAxis(0,c)}else if(le(t)){se((0,r.zs)(t,1)[0])||((null==n?void 0:n.indexes)&&(ue((null===(l=null==n?void 0:n.indexes)||void 0===l?void 0:l.length)===t.length,"Index length is ".concat(null==n?void 0:n.indexes.length,", but data size ").concat(t.length)),s.setAxis(0,null==n?void 0:n.indexes)),s.data=t)}return s}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"shape",{get:function(){return[this.axes[0].length]},enumerable:!1,configurable:!0}),t.prototype.get=function(e){if(ue(U(e)||J(e)&&!e.includes(":")||le(e)||J(e)&&e.includes(":"),"The rowLoc is illegal"),U(e)||J(e)&&!e.includes(":")){if(ue(this.indexes.includes(e),"The rowLoc is not found in the indexes."),U(e))return this.data[e];if(J(e)){var n=this.indexes.indexOf(e);return this.data[n]}}if(le(e)){for(var r=[],a=[],o=0;o<e.length;o+=1){var i=e[o];ue(this.indexes.includes(i),"The rowLoc is not found in the indexes.");var l=this.indexes.indexOf(i);r.push(this.data[l]),a.push(this.indexes[l])}return new t(r,{indexes:a})}if(J(e)&&e.includes(":")){var s=e.split(":");ue(2===s.length,"The rowLoc is not found in the indexes.");var c=s[0],u=s[1];if(te(Number(c))&&te(Number(u))){var d=Number(c),f=Number(u);return new t(r=this.data.slice(d,f),{indexes:a=this.indexes.slice(d,f)})}if(J(c)&&J(u)){d=this.indexes.indexOf(c),f=this.indexes.indexOf(u);return new t(r=this.data.slice(d,f),{indexes:a=this.indexes.slice(d,f)})}}throw new Error("The rowLoc is illegal")},t.prototype.getByIndex=function(e){if(ue(te(e)||le(e)||J(e)&&e.includes(":"),"The rowLoc is illegal"),te(e)&&(ue(ce(this.indexes.length).includes(e),"The rowLoc is not found in the indexes."),ce(this.indexes.length).includes(e)))return this.data[e];if(le(e)){for(var n=[],r=[],a=0;a<e.length;a+=1){var o=e[a];ue(ce(this.indexes.length).includes(o),"The rowLoc is not found in the indexes."),n.push(this.data[o]),r.push(this.indexes[o])}return new t(n,{indexes:r})}if(J(e)&&e.includes(":")){var i=e.split(":");if(2===i.length){var l=Number(i[0]),s=Number(i[1]);return ue(te(l)&&te(s),"The rowLoc is not found in the indexes."),new t(n=this.data.slice(l,s),{indexes:r=this.indexes.slice(l,s)})}}throw new Error("The rowLoc is illegal")},t}(ze);const Be=function(e){function t(t,n){var a,o,i,l,s,c,u,d,f=this;if((f=e.call(this,t,n)||this).colData=[],f.extra=n||{},ue(se(t)||le(t)||ie(t),"Data type is illegal"),se(t)){if(null==n?void 0:n.columnTypes)for(var h=0;h<(null===(a=null==n?void 0:n.indexes)||void 0===a?void 0:a.length);h+=1)f.data[h]=Ge(f.data[h],null===(o=null==n?void 0:n.columnTypes)||void 0===o?void 0:o[h]);(null==n?void 0:n.indexes)&&(null==n?void 0:n.columns)?(f.setAxis(1,null==n?void 0:n.columns),f.data=Array(null==n?void 0:n.columns.length).fill(f.data)):(null==n?void 0:n.columns)?(null==n?void 0:n.indexes)||(ue(le(null==n?void 0:n.columns),"Index or columns must be Axis array."),ue(1===(null==n?void 0:n.columns.length),"When the length of extra.columns is larger than 1, extra.indexes is required.")):(f.setAxis(1,[0]),f.data=[f.data]),f.colData=f.data}if(le(t)){var m=(0,r.zs)(t,1)[0];if(f.data.length>0&&(f.generateColumns([0],null==n?void 0:n.columns),f.colData=[f.data],f.data=f.data.map(function(e){return[e]})),le(m)){var p=ce(m.length);f.generateDataAndColDataFromArray(!1,t,p,null==n?void 0:n.fillValue,null==n?void 0:n.columnTypes),f.generateColumns(p,null==n?void 0:n.columns)}if(ie(m)){var g=[];for(h=0;h<t.length;h+=1){var b=t[h];g.push.apply(g,(0,r.fX)([],(0,r.zs)(Object.keys(b)),!1))}for(p=(0,r.fX)([],(0,r.zs)(new Set(g)),!1),h=0;h<t.length;h+=1){if(ue(ie(b=t[h]),"The data is not standard object array."),null==n?void 0:n.columns){f.data[h]=[];for(var y=0;y<(null==n?void 0:n.columns.length);y+=1){ue(p.includes(x=null==n?void 0:n.columns[y]),"There is no column ".concat(x," in data."));var v=Ge(Pe(b[x],n.fillValue),null===(i=null==n?void 0:n.columnTypes)||void 0===i?void 0:i[y]);f.data[h].push(v),f.colData[y]?f.colData[y].push(v):f.colData[y]=[v]}f.setAxis(1,null==n?void 0:n.columns)}}(null==n?void 0:n.columns)||(f.generateDataAndColDataFromArray(!0,t,p,null==n?void 0:n.fillValue,null==n?void 0:n.columnTypes),f.setAxis(1,p))}}if(ie(t)){var _=Object.values(t);if(se(m=(0,r.zs)(_,1)[0])){p=Object.keys(t);if((null==n?void 0:n.indexes)?(ue(le(n.indexes),"extra.indexes must be an array."),ue(1===n.indexes.length,"The length of extra.indexes must be 1."),f.setAxis(0,n.indexes)):f.setAxis(0,[0]),null==n?void 0:n.columns){for(h=0;h<(null==n?void 0:n.columns.length);h+=1){var x;ue(p.includes(x=null==n?void 0:n.columns[h]),"There is no column ".concat(x," in data.")),f.data.push(Ge(Pe(t[x],null==n?void 0:n.fillValue),null===(l=null==n?void 0:n.columnTypes)||void 0===l?void 0:l[h]))}f.colData=f.data.map(function(e){return[e]}),f.data=[f.data],f.setAxis(1,null==n?void 0:n.columns)}else{for(h=0;h<p.length;h+=1){ue(se(b=t[p[h]]),"Data type is illegal"),f.data.push(Ge(Pe(b,null==n?void 0:n.fillValue),null===(s=null==n?void 0:n.columnTypes)||void 0===s?void 0:s[h]))}f.data=[f.data],f.colData=_.map(function(e){var t;return[Ge(Pe(e,null==n?void 0:n.fillValue),null===(t=null==n?void 0:n.columnTypes)||void 0===t?void 0:t[0])]}),f.generateColumns(p)}}if(le(m)){f.setAxis(0,De(m,null==n?void 0:n.indexes));p=Object.keys(t);f.generateColumns(p,null==n?void 0:n.columns);var C=function(e){var r=t[w.columns[e]];if(ue(le(r),"Data type is illegal"),r.length<w.indexes.length){var a=r.concat(Array(w.indexes.length-r.length).fill(Ge(Pe(void 0,null==n?void 0:n.fillValue),null===(c=null==n?void 0:n.columnTypes)||void 0===c?void 0:c[e])));w.colData.push(a)}else w.colData.push(r.map(function(t){var r;return Ge(Pe(t,null==n?void 0:n.fillValue),null===(r=null==n?void 0:n.columnTypes)||void 0===r?void 0:r[e])}));for(var o=0;o<w.indexes.length;o+=1)w.data[o]?w.data[o].push(Ge(Pe(r[o],null==n?void 0:n.fillValue),null===(u=null==n?void 0:n.columnTypes)||void 0===u?void 0:u[e])):w.data[o]=[Ge(Pe(r[o],null==n?void 0:n.fillValue),null===(d=null==n?void 0:n.columnTypes)||void 0===d?void 0:d[e])]},w=this;for(h=0;h<f.columns.length;h+=1)C(h)}}return f}return(0,r.C6)(t,e),t.prototype.generateColumns=function(e,t){t?(ue((null==t?void 0:t.length)===e.length,"Columns length is ".concat(null==t?void 0:t.length,", but data column is ").concat(e.length)),this.setAxis(1,t)):this.setAxis(1,e)},t.prototype.generateDataAndColDataFromArray=function(e,t,n,r,a){for(var o=0;o<t.length;o+=1){var i=t[o];ue(e?ie(i):le(i),"Data type is illegal"),e&&JSON.stringify(Object.keys(i))===JSON.stringify(n)?this.data.push(Object.values(i).map(function(e,t){return Ge(Pe(e,r),null==a?void 0:a[t])})):e||this.data.push(i.map(function(e,t){return Ge(Pe(e,r),null==a?void 0:a[t])}));for(var l=0;l<n.length;l+=1){var s=Ge(Pe(i[n[l]],r),null==a?void 0:a[l]);e&&JSON.stringify(Object.keys(i))!==JSON.stringify(n)&&(this.data[o]?this.data[o].push(s):this.data[o]=[s]),this.colData[l]?this.colData[l].push(s):this.colData[l]=[s]}}},Object.defineProperty(t.prototype,"shape",{get:function(){return[this.axes[0].length,this.axes[1].length]},enumerable:!1,configurable:!0}),t.prototype.get=function(e,n){if(ue(Qe(e)||le(e),"The rowLoc is illegal"),void 0===n)if(U(e)){if(ue(this.indexes.includes(e),"The rowLoc is not found in the indexes."),this.indexes.includes(e))return new Ie(this.data[e],{indexes:this.columns})}else{if(le(e)){for(var r=[],a=[],o=0;o<e.length;o+=1){var i=e[o];ue(this.indexes.includes(i),"The rowLoc is not found in the indexes.");var l=this.indexes.indexOf(i);r.push(this.data[l]),a.push(this.indexes[l])}return new t(r,{indexes:a,columns:this.columns})}if(J(e)&&e.includes(":")&&2===(u=e.split(":")).length){var s=Number(u[0]),c=Number(u[1]);return ue(U(s)&&U(c),"The rowLoc is not found in the indexes."),new t(this.data.slice(s,c),{indexes:this.indexes.slice(s,c),columns:this.columns})}}var u,d=-1,f=-1,h=[],m=-1,p=-1,g=[];if(Qe(e)&&this.indexes.includes(e)&&(f=(d=this.indexes.indexOf(e))+1),le(e))for(o=0;o<e.length;o+=1){ue(this.indexes.includes(C=e[o]),"The rowLoc is not found in the indexes."),h.push(this.indexes.indexOf(C))}if(J(e)&&e.includes(":")&&2===(u=e.split(":")).length){var b=Number(u[0]),y=Number(u[1]);ue(U(b)&&U(y),"The rowLoc is not found in the indexes."),d=b,f=y}if(Qe(n)&&this.columns.includes(n)&&(p=(m=this.columns.indexOf(n))+1),le(n))for(o=0;o<n.length;o+=1){ue(this.columns.includes(R=n[o]),"The colLoc is not found in the columns."),g.push(this.columns.indexOf(R))}if(J(n)&&n.includes(":")){var v=n.split(":");if(2===v.length){b=this.columns.indexOf(v[0]),y=this.columns.indexOf(v[1]);ue(U(b)&&U(y),"The colLoc is not found in the columns."),m=b,p=y}}var _=[],x=[];if(ue(d>=0&&f>=0||h.length>0,"The rowLoc is not found in the indexes."),d>=0&&f>=0&&(_=this.data.slice(d,f),x=this.indexes.slice(d,f)),h.length>0)for(o=0;o<h.length;o+=1){var C;_.push(this.data[C=h[o]]),x.push(this.indexes[C])}if(m>=0&&p>=0){for(o=0;o<_.length;o+=1)_[o]=_[o].slice(m,p);return new t(_,{indexes:x,columns:w=this.columns.slice(m,p)})}if(g.length>0){var w=[],k=_.slice();for(o=0;o<_.length;o+=1){_[o]=[],w=[];for(var M=0;M<g.length;M+=1){var R;_[o].push(k[o][R=g[M]]),w.push(this.columns[R])}}return new t(_,{indexes:x,columns:w})}throw new Error("The colLoc is illegal.")},t.prototype.getByIndex=function(e,n){if(ue(te(e)||le(e)||J(e),"The rowLoc is illegal"),void 0===n){if(te(e))return ue(ce(this.indexes.length).includes(e),"The rowLoc is not found in the indexes."),new Ie(this.data[e],{indexes:this.columns});if(le(e)){for(var r=[],a=[],o=0;o<e.length;o+=1){var i=e[o];ue(ce(this.indexes.length).includes(i),"The rowLoc is not found in the indexes."),r.push(this.data[i]),a.push(this.indexes[i])}return new t(r,{indexes:a,columns:this.columns})}if(J(e)&&e.includes(":"))if(2===(c=e.split(":")).length){var l=Number(c[0]),s=Number(c[1]);return ue(te(l)&&te(s),"The rowLoc is not found in the indexes."),new t(this.data.slice(l,s),{indexes:this.indexes.slice(l,s),columns:this.columns})}}var c,u=-1,d=-1,f=[],h=-1,m=-1,p=[];if(te(e)&&(ue(ce(this.indexes.length).includes(e),"The rowLoc is not found in the indexes."),u=e,d=e+1),le(e))for(o=0;o<e.length;o+=1){var g=e[o];ue(ce(this.indexes.length).includes(g),"The rowLoc is not found in the indexes."),f.push(g)}if(J(e)&&e.includes(":")&&2===(c=e.split(":")).length){var b=Number(c[0]),y=Number(c[1]);ue(te(b)&&te(y),"The rowLoc is not found in the indexes."),u=b,d=y}if(ue(u>=0&&d>=0||f.length>0,"The colLoc is illegal"),te(n)&&ce(this.columns.length).includes(n)&&(h=n,m=n+1),le(n))for(o=0;o<n.length;o+=1){var v=n[o];ue(ce(this.columns.length).includes(v),"The colLoc is not found in the columns index."),p.push(v)}if(J(n)&&n.includes(":")){var _=n.split(":");if(2===_.length){b=Number(_[0]),y=Number(_[1]);ue(te(b)&&te(y),"The colLoc is not found in the columns index."),h=b,m=y}}ue(u>=0&&d>=0||f.length>0,"The rowLoc is not found in the indexes.");var x=[],C=[];if(u>=0&&d>=0)x=this.data.slice(u,d),C=this.indexes.slice(u,d);else if(f.length>0)for(o=0;o<f.length;o+=1){x.push(this.data[g=f[o]]),C.push(this.indexes[g])}if(ue(h>=0&&m>=0||p.length>0,"The colLoc is not found in the columns index."),h>=0&&m>=0){for(o=0;o<x.length;o+=1)x[o]=x[o].slice(h,m);return new t(x,{indexes:C,columns:w=this.columns.slice(h,m)})}if(p.length>0){var w=[],k=x.slice();for(o=0;o<x.length;o+=1){x[o]=[],w=[];for(var M=0;M<p.length;M+=1){x[o].push(k[o][v=p[M]]),w.push(this.columns[v])}}return new t(x,{indexes:C,columns:w})}throw new Error("The colLoc is illegal.")},t.prototype.getByColumn=function(e){ue(this.columns.includes(e),"The col is illegal");var t=this.columns.indexOf(e);return new Ie(this.colData[t],{indexes:this.indexes})},t.prototype.info=function(){for(var e,t=[],n=0;n<(null===(e=this.columns)||void 0===e?void 0:e.length);n+=1){var a=this.columns[n];t.push((0,r.Cl)((0,r.Cl)({},Ae(this.colData[n],this.extra.strictDatePattern)),{name:String(a)}))}return t},t.prototype.toString=function(){for(var e=this,t=Array(this.columns.length+1).fill(0),n=0;n<this.indexes.length;n+=1){(a=Le(this.indexes[n]))>t[0]&&(t[0]=a)}for(n=0;n<this.columns.length;n+=1){(a=Le(this.columns[n]))>t[n+1]&&(t[n+1]=a)}for(n=0;n<this.colData.length;n+=1)for(var r=0;r<this.colData[n].length;r+=1){var a;(a=Le(this.colData[n][r]))>t[n+1]&&(t[n+1]=a)}return"".concat(Te(t[0])).concat(this.columns.map(function(n,r){return"".concat(n).concat(r!==e.columns.length?Te(t[r+1]-Le(n)+2):"")}).join(""),"\n").concat(this.indexes.map(function(n,r){var a;return"".concat(n).concat(Te(t[0]-Le(n))).concat(null===(a=e.data[r])||void 0===a?void 0:a.map(function(n,r){return"".concat(je(n)).concat(r!==e.columns.length?Te(t[r+1]-Le(n)):"")}).join("")).concat(r!==e.indexes.length?"\n":"")}).join(""))},t}(ze);var Ee=function(e){if("object"!=typeof e||null===e)return e;var t;if(Array.isArray(e)){t=[];for(var n=0,r=e.length;n<r;n+=1)t[n]="object"==typeof e[n]&&null!=e[n]?Ee(e[n]):e[n]}else{t={};var a=Object.keys(e);for(n=0;n<a.length;n+=1){var o=a[n];t[o]="object"==typeof e[o]&&null!=e[o]?Ee(e[o]):e[o]}}return t};const qe=Ee,Ye={model:"rgb",value:{r:255,g:255,b:255}},Fe=["normal","darken","multiply","colorBurn","linearBurn","lighten","screen","colorDodge","linearDodge","overlay","softLight","hardLight","vividLight","linearLight","pinLight","difference","exclusion"],$e=(e,t=0,n=1)=>Je(Ue(t,e),n),We=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=$e(e[t],0,255)):3===t&&(e[t]=$e(e[t],0,1));return e},He={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])He[`[object ${e}]`]=e.toLowerCase();function Xe(e){return He[Object.prototype.toString.call(e)]||"object"}const Ve=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):"object"==Xe(e[0])&&t?t.split("").filter(t=>void 0!==e[0][t]).map(t=>e[0][t]):e[0],Ze=e=>{if(e.length<2)return null;const t=e.length-1;return"string"==Xe(e[t])?e[t].toLowerCase():null},{PI:Ke,min:Je,max:Ue}=Math,et=2*Ke,tt=Ke/3,nt=Ke/180,rt=180/Ke,at={format:{},autodetect:[]};const ot=class{constructor(...e){const t=this;if("object"===Xe(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=Ze(e),r=!1;if(!n){r=!0,at.sorted||(at.autodetect=at.autodetect.sort((e,t)=>t.p-e.p),at.sorted=!0);for(let t of at.autodetect)if(n=t.test(...e),n)break}if(!at.format[n])throw new Error("unknown format: "+e);{const a=at.format[n].apply(null,r?e:e.slice(0,-1));t._rgb=We(a)}3===t._rgb.length&&t._rgb.push(1)}toString(){return"function"==Xe(this.hex)?this.hex():`[${this._rgb.join(",")}]`}},it=(...e)=>new it.Color(...e);it.Color=ot,it.version="2.6.0";const lt=it,st=(...e)=>{e=Ve(e,"cmyk");const[t,n,r,a]=e,o=e.length>4?e[4]:1;return 1===a?[0,0,0,o]:[t>=1?0:255*(1-t)*(1-a),n>=1?0:255*(1-n)*(1-a),r>=1?0:255*(1-r)*(1-a),o]},{max:ct}=Math,ut=(...e)=>{let[t,n,r]=Ve(e,"rgb");t/=255,n/=255,r/=255;const a=1-ct(t,ct(n,r)),o=a<1?1/(1-a):0;return[(1-t-a)*o,(1-n-a)*o,(1-r-a)*o,a]};ot.prototype.cmyk=function(){return ut(this._rgb)},lt.cmyk=(...e)=>new ot(...e,"cmyk"),at.format.cmyk=st,at.autodetect.push({p:2,test:(...e)=>{if("array"===Xe(e=Ve(e,"cmyk"))&&4===e.length)return"cmyk"}});const dt=e=>Math.round(100*e)/100,ft=(...e)=>{const t=Ve(e,"hsla");let n=Ze(e)||"lsa";return t[0]=dt(t[0]||0),t[1]=dt(100*t[1])+"%",t[2]=dt(100*t[2])+"%","hsla"===n||t.length>3&&t[3]<1?(t[3]=t.length>3?t[3]:1,n="hsla"):t.length=3,`${n}(${t.join(",")})`},ht=(...e)=>{e=Ve(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const a=Je(t,n,r),o=Ue(t,n,r),i=(o+a)/2;let l,s;return o===a?(l=0,s=Number.NaN):l=i<.5?(o-a)/(o+a):(o-a)/(2-o-a),t==o?s=(n-r)/(o-a):n==o?s=2+(r-t)/(o-a):r==o&&(s=4+(t-n)/(o-a)),s*=60,s<0&&(s+=360),e.length>3&&void 0!==e[3]?[s,l,i,e[3]]:[s,l,i]},{round:mt}=Math,pt=(...e)=>{const t=Ve(e,"rgba");let n=Ze(e)||"rgb";return"hsl"==n.substr(0,3)?ft(ht(t),n):(t[0]=mt(t[0]),t[1]=mt(t[1]),t[2]=mt(t[2]),("rgba"===n||t.length>3&&t[3]<1)&&(t[3]=t.length>3?t[3]:1,n="rgba"),`${n}(${t.slice(0,"rgb"===n?3:4).join(",")})`)},{round:gt}=Math,bt=(...e)=>{e=Ve(e,"hsl");const[t,n,r]=e;let a,o,i;if(0===n)a=o=i=255*r;else{const e=[0,0,0],l=[0,0,0],s=r<.5?r*(1+n):r+n-r*n,c=2*r-s,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&(e[t]-=1),l[t]=6*e[t]<1?c+6*(s-c)*e[t]:2*e[t]<1?s:3*e[t]<2?c+(s-c)*(2/3-e[t])*6:c;[a,o,i]=[gt(255*l[0]),gt(255*l[1]),gt(255*l[2])]}return e.length>3?[a,o,i,e[3]]:[a,o,i,1]},yt=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,vt=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,_t=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,xt=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Ct=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,wt=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,{round:kt}=Math,Mt=e=>{let t;if(e=e.toLowerCase().trim(),at.format.named)try{return at.format.named(e)}catch(e){}if(t=e.match(yt)){const e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+e[t];return e[3]=1,e}if(t=e.match(vt)){const e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+e[t];return e}if(t=e.match(_t)){const e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=kt(2.55*e[t]);return e[3]=1,e}if(t=e.match(xt)){const e=t.slice(1,5);for(let t=0;t<3;t++)e[t]=kt(2.55*e[t]);return e[3]=+e[3],e}if(t=e.match(Ct)){const e=t.slice(1,4);e[1]*=.01,e[2]*=.01;const n=bt(e);return n[3]=1,n}if(t=e.match(wt)){const e=t.slice(1,4);e[1]*=.01,e[2]*=.01;const n=bt(e);return n[3]=+t[4],n}};Mt.test=e=>yt.test(e)||vt.test(e)||_t.test(e)||xt.test(e)||Ct.test(e)||wt.test(e);const Rt=Mt;ot.prototype.css=function(e){return pt(this._rgb,e)},lt.css=(...e)=>new ot(...e,"css"),at.format.css=Rt,at.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&"string"===Xe(e)&&Rt.test(e))return"css"}}),at.format.gl=(...e)=>{const t=Ve(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t},lt.gl=(...e)=>new ot(...e,"gl"),ot.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};const{floor:Ot}=Math,Nt=(...e)=>{e=Ve(e,"hcg");let t,n,r,[a,o,i]=e;i*=255;const l=255*o;if(0===o)t=n=r=i;else{360===a&&(a=0),a>360&&(a-=360),a<0&&(a+=360),a/=60;const e=Ot(a),s=a-e,c=i*(1-o),u=c+l*(1-s),d=c+l*s,f=c+l;switch(e){case 0:[t,n,r]=[f,d,c];break;case 1:[t,n,r]=[u,f,c];break;case 2:[t,n,r]=[c,f,d];break;case 3:[t,n,r]=[c,u,f];break;case 4:[t,n,r]=[d,c,f];break;case 5:[t,n,r]=[f,c,u]}}return[t,n,r,e.length>3?e[3]:1]},St=(...e)=>{const[t,n,r]=Ve(e,"rgb"),a=Je(t,n,r),o=Ue(t,n,r),i=o-a;let l;return 0===i?l=Number.NaN:(t===o&&(l=(n-r)/i),n===o&&(l=2+(r-t)/i),r===o&&(l=4+(t-n)/i),l*=60,l<0&&(l+=360)),[l,100*i/255,a/(255-i)*100]};ot.prototype.hcg=function(){return St(this._rgb)},lt.hcg=(...e)=>new ot(...e,"hcg"),at.format.hcg=Nt,at.autodetect.push({p:1,test:(...e)=>{if("array"===Xe(e=Ve(e,"hcg"))&&3===e.length)return"hcg"}});const At=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Qt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Dt=e=>{if(e.match(At)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(Qt)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((255&t)/255*100)/100]}throw new Error(`unknown hex color: ${e}`)},{round:Pt}=Math,Tt=(...e)=>{let[t,n,r,a]=Ve(e,"rgba"),o=Ze(e)||"auto";void 0===a&&(a=1),"auto"===o&&(o=a<1?"rgba":"rgb"),t=Pt(t),n=Pt(n),r=Pt(r);let i="000000"+(t<<16|n<<8|r).toString(16);i=i.substr(i.length-6);let l="0"+Pt(255*a).toString(16);switch(l=l.substr(l.length-2),o.toLowerCase()){case"rgba":return`#${i}${l}`;case"argb":return`#${l}${i}`;default:return`#${i}`}};ot.prototype.hex=function(e){return Tt(this._rgb,e)},lt.hex=(...e)=>new ot(...e,"hex"),at.format.hex=Dt,at.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&"string"===Xe(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{cos:jt}=Math,Lt=(...e)=>{e=Ve(e,"hsi");let t,n,r,[a,o,i]=e;return isNaN(a)&&(a=0),isNaN(o)&&(o=0),a>360&&(a-=360),a<0&&(a+=360),a/=360,a<1/3?(r=(1-o)/3,t=(1+o*jt(et*a)/jt(tt-et*a))/3,n=1-(r+t)):a<2/3?(a-=1/3,t=(1-o)/3,n=(1+o*jt(et*a)/jt(tt-et*a))/3,r=1-(t+n)):(a-=2/3,n=(1-o)/3,r=(1+o*jt(et*a)/jt(tt-et*a))/3,t=1-(n+r)),t=$e(i*t*3),n=$e(i*n*3),r=$e(i*r*3),[255*t,255*n,255*r,e.length>3?e[3]:1]},{min:Gt,sqrt:zt,acos:It}=Math,Bt=(...e)=>{let t,[n,r,a]=Ve(e,"rgb");n/=255,r/=255,a/=255;const o=Gt(n,r,a),i=(n+r+a)/3,l=i>0?1-o/i:0;return 0===l?t=NaN:(t=(n-r+(n-a))/2,t/=zt((n-r)*(n-r)+(n-a)*(r-a)),t=It(t),a>r&&(t=et-t),t/=et),[360*t,l,i]};ot.prototype.hsi=function(){return Bt(this._rgb)},lt.hsi=(...e)=>new ot(...e,"hsi"),at.format.hsi=Lt,at.autodetect.push({p:2,test:(...e)=>{if("array"===Xe(e=Ve(e,"hsi"))&&3===e.length)return"hsi"}}),ot.prototype.hsl=function(){return ht(this._rgb)},lt.hsl=(...e)=>new ot(...e,"hsl"),at.format.hsl=bt,at.autodetect.push({p:2,test:(...e)=>{if("array"===Xe(e=Ve(e,"hsl"))&&3===e.length)return"hsl"}});const{floor:Et}=Math,qt=(...e)=>{e=Ve(e,"hsv");let t,n,r,[a,o,i]=e;if(i*=255,0===o)t=n=r=i;else{360===a&&(a=0),a>360&&(a-=360),a<0&&(a+=360),a/=60;const e=Et(a),l=a-e,s=i*(1-o),c=i*(1-o*l),u=i*(1-o*(1-l));switch(e){case 0:[t,n,r]=[i,u,s];break;case 1:[t,n,r]=[c,i,s];break;case 2:[t,n,r]=[s,i,u];break;case 3:[t,n,r]=[s,c,i];break;case 4:[t,n,r]=[u,s,i];break;case 5:[t,n,r]=[i,s,c]}}return[t,n,r,e.length>3?e[3]:1]},{min:Yt,max:Ft}=Math,$t=(...e)=>{e=Ve(e,"rgb");let[t,n,r]=e;const a=Yt(t,n,r),o=Ft(t,n,r),i=o-a;let l,s,c;return c=o/255,0===o?(l=Number.NaN,s=0):(s=i/o,t===o&&(l=(n-r)/i),n===o&&(l=2+(r-t)/i),r===o&&(l=4+(t-n)/i),l*=60,l<0&&(l+=360)),[l,s,c]};ot.prototype.hsv=function(){return $t(this._rgb)},lt.hsv=(...e)=>new ot(...e,"hsv"),at.format.hsv=qt,at.autodetect.push({p:2,test:(...e)=>{if("array"===Xe(e=Ve(e,"hsv"))&&3===e.length)return"hsv"}});const Wt=18,Ht=.95047,Xt=1,Vt=1.08883,Zt=.137931034,Kt=.206896552,Jt=.12841855,Ut=.008856452,{pow:en}=Math,tn=e=>255*(e<=.00304?12.92*e:1.055*en(e,1/2.4)-.055),nn=e=>e>Kt?e*e*e:Jt*(e-Zt),rn=(...e)=>{e=Ve(e,"lab");const[t,n,r]=e;let a,o,i,l,s,c;return o=(t+16)/116,a=isNaN(n)?o:o+n/500,i=isNaN(r)?o:o-r/200,o=Xt*nn(o),a=Ht*nn(a),i=Vt*nn(i),l=tn(3.2404542*a-1.5371385*o-.4985314*i),s=tn(-.969266*a+1.8760108*o+.041556*i),c=tn(.0556434*a-.2040259*o+1.0572252*i),[l,s,c,e.length>3?e[3]:1]},{pow:an}=Math,on=e=>(e/=255)<=.04045?e/12.92:an((e+.055)/1.055,2.4),ln=e=>e>Ut?an(e,1/3):e/Jt+Zt,sn=(e,t,n)=>{e=on(e),t=on(t),n=on(n);return[ln((.4124564*e+.3575761*t+.1804375*n)/Ht),ln((.2126729*e+.7151522*t+.072175*n)/Xt),ln((.0193339*e+.119192*t+.9503041*n)/Vt)]},cn=(...e)=>{const[t,n,r]=Ve(e,"rgb"),[a,o,i]=sn(t,n,r),l=116*o-16;return[l<0?0:l,500*(a-o),200*(o-i)]};ot.prototype.lab=function(){return cn(this._rgb)},lt.lab=(...e)=>new ot(...e,"lab"),at.format.lab=rn,at.autodetect.push({p:2,test:(...e)=>{if("array"===Xe(e=Ve(e,"lab"))&&3===e.length)return"lab"}});const{sin:un,cos:dn}=Math,fn=(...e)=>{let[t,n,r]=Ve(e,"lch");return isNaN(r)&&(r=0),r*=nt,[t,dn(r)*n,un(r)*n]},hn=(...e)=>{e=Ve(e,"lch");const[t,n,r]=e,[a,o,i]=fn(t,n,r),[l,s,c]=rn(a,o,i);return[l,s,c,e.length>3?e[3]:1]},mn=(...e)=>{const t=Ve(e,"hcl").reverse();return hn(...t)},{sqrt:pn,atan2:gn,round:bn}=Math,yn=(...e)=>{const[t,n,r]=Ve(e,"lab"),a=pn(n*n+r*r);let o=(gn(r,n)*rt+360)%360;return 0===bn(1e4*a)&&(o=Number.NaN),[t,a,o]},vn=(...e)=>{const[t,n,r]=Ve(e,"rgb"),[a,o,i]=cn(t,n,r);return yn(a,o,i)};ot.prototype.lch=function(){return vn(this._rgb)},ot.prototype.hcl=function(){return vn(this._rgb).reverse()},lt.lch=(...e)=>new ot(...e,"lch"),lt.hcl=(...e)=>new ot(...e,"hcl"),at.format.lch=hn,at.format.hcl=mn,["lch","hcl"].forEach(e=>at.autodetect.push({p:2,test:(...t)=>{if("array"===Xe(t=Ve(t,e))&&3===t.length)return e}}));const _n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};ot.prototype.name=function(){const e=Tt(this._rgb,"rgb");for(let t of Object.keys(_n))if(_n[t]===e)return t.toLowerCase();return e},at.format.named=e=>{if(e=e.toLowerCase(),_n[e])return Dt(_n[e]);throw new Error("unknown color name: "+e)},at.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&"string"===Xe(e)&&_n[e.toLowerCase()])return"named"}});const xn=e=>{if("number"==Xe(e)&&e>=0&&e<=16777215){return[e>>16,e>>8&255,255&e,1]}throw new Error("unknown num color: "+e)},Cn=(...e)=>{const[t,n,r]=Ve(e,"rgb");return(t<<16)+(n<<8)+r};ot.prototype.num=function(){return Cn(this._rgb)},lt.num=(...e)=>new ot(...e,"num"),at.format.num=xn,at.autodetect.push({p:5,test:(...e)=>{if(1===e.length&&"number"===Xe(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});const{round:wn}=Math;ot.prototype.rgb=function(e=!0){return!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(wn)},ot.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?!1===e?t:wn(t):t)},lt.rgb=(...e)=>new ot(...e,"rgb"),at.format.rgb=(...e)=>{const t=Ve(e,"rgba");return void 0===t[3]&&(t[3]=1),t},at.autodetect.push({p:3,test:(...e)=>{if("array"===Xe(e=Ve(e,"rgba"))&&(3===e.length||4===e.length&&"number"==Xe(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});const{log:kn}=Math,Mn=e=>{const t=e/100;let n,r,a;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*kn(r),a=t<20?0:.8274096064007395*(a=t-10)-254.76935184120902+115.67994401066147*kn(a)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*kn(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*kn(r),a=255),[n,r,a,1]},{round:Rn}=Math,On=(...e)=>{const t=Ve(e,"rgb"),n=t[0],r=t[2];let a=1e3,o=4e4;let i;for(;o-a>.4;){i=.5*(o+a);const e=Mn(i);e[2]/e[0]>=r/n?o=i:a=i}return Rn(i)};ot.prototype.temp=ot.prototype.kelvin=ot.prototype.temperature=function(){return On(this._rgb)},lt.temp=lt.kelvin=lt.temperature=(...e)=>new ot(...e,"temp"),at.format.temp=at.format.kelvin=at.format.temperature=Mn;const{pow:Nn,sign:Sn}=Math,An=(...e)=>{e=Ve(e,"lab");const[t,n,r]=e,a=Nn(t+.3963377774*n+.2158037573*r,3),o=Nn(t-.1055613458*n-.0638541728*r,3),i=Nn(t-.0894841775*n-1.291485548*r,3);return[255*Qn(4.0767416621*a-3.3077115913*o+.2309699292*i),255*Qn(-1.2684380046*a+2.6097574011*o-.3413193965*i),255*Qn(-.0041960863*a-.7034186147*o+1.707614701*i),e.length>3?e[3]:1]};function Qn(e){const t=Math.abs(e);return t>.0031308?(Sn(e)||1)*(1.055*Nn(t,1/2.4)-.055):12.92*e}const{cbrt:Dn,pow:Pn,sign:Tn}=Math,jn=(...e)=>{const[t,n,r]=Ve(e,"rgb"),[a,o,i]=[Ln(t/255),Ln(n/255),Ln(r/255)],l=Dn(.4122214708*a+.5363325363*o+.0514459929*i),s=Dn(.2119034982*a+.6806995451*o+.1073969566*i),c=Dn(.0883024619*a+.2817188376*o+.6299787005*i);return[.2104542553*l+.793617785*s-.0040720468*c,1.9779984951*l-2.428592205*s+.4505937099*c,.0259040371*l+.7827717662*s-.808675766*c]};function Ln(e){const t=Math.abs(e);return t<.04045?e/12.92:(Tn(e)||1)*Pn((t+.055)/1.055,2.4)}ot.prototype.oklab=function(){return jn(this._rgb)},lt.oklab=(...e)=>new ot(...e,"oklab"),at.format.oklab=An,at.autodetect.push({p:3,test:(...e)=>{if("array"===Xe(e=Ve(e,"oklab"))&&3===e.length)return"oklab"}});const Gn=(...e)=>{e=Ve(e,"lch");const[t,n,r]=e,[a,o,i]=fn(t,n,r),[l,s,c]=An(a,o,i);return[l,s,c,e.length>3?e[3]:1]},zn=(...e)=>{const[t,n,r]=Ve(e,"rgb"),[a,o,i]=jn(t,n,r);return yn(a,o,i)};ot.prototype.oklch=function(){return zn(this._rgb)},lt.oklch=(...e)=>new ot(...e,"oklch"),at.format.oklch=Gn,at.autodetect.push({p:3,test:(...e)=>{if("array"===Xe(e=Ve(e,"oklch"))&&3===e.length)return"oklch"}}),ot.prototype.alpha=function(e,t=!1){return void 0!==e&&"number"===Xe(e)?t?(this._rgb[3]=e,this):new ot([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},ot.prototype.clipped=function(){return this._rgb._clipped||!1},ot.prototype.darken=function(e=1){const t=this.lab();return t[0]-=Wt*e,new ot(t,"lab").alpha(this.alpha(),!0)},ot.prototype.brighten=function(e=1){return this.darken(-e)},ot.prototype.darker=ot.prototype.darken,ot.prototype.brighter=ot.prototype.brighten,ot.prototype.get=function(e){const[t,n]=e.split("."),r=this[t]();if(n){const e=t.indexOf(n)-("ok"===t.substr(0,2)?2:0);if(e>-1)return r[e];throw new Error(`unknown channel ${n} in mode ${t}`)}return r};const{pow:In}=Math;ot.prototype.luminance=function(e,t="rgb"){if(void 0!==e&&"number"===Xe(e)){if(0===e)return new ot([0,0,0,this._rgb[3]],"rgb");if(1===e)return new ot([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=20;const a=(n,o)=>{const i=n.interpolate(o,.5,t),l=i.luminance();return Math.abs(e-l)<1e-7||!r--?i:l>e?a(n,i):a(i,o)},o=(n>e?a(new ot([0,0,0]),this):a(this,new ot([255,255,255]))).rgb();return new ot([...o,this._rgb[3]])}return Bn(...this._rgb.slice(0,3))};const Bn=(e,t,n)=>.2126*(e=En(e))+.7152*(t=En(t))+.0722*(n=En(n)),En=e=>(e/=255)<=.03928?e/12.92:In((e+.055)/1.055,2.4),qn={},Yn=(e,t,n=.5,...r)=>{let a=r[0]||"lrgb";if(qn[a]||r.length||(a=Object.keys(qn)[0]),!qn[a])throw new Error(`interpolation mode ${a} is not defined`);return"object"!==Xe(e)&&(e=new ot(e)),"object"!==Xe(t)&&(t=new ot(t)),qn[a](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};ot.prototype.mix=ot.prototype.interpolate=function(e,t=.5,...n){return Yn(this,e,t,...n)},ot.prototype.premultiply=function(e=!1){const t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new ot([t[0]*n,t[1]*n,t[2]*n,n],"rgb")},ot.prototype.saturate=function(e=1){const t=this.lch();return t[1]+=Wt*e,t[1]<0&&(t[1]=0),new ot(t,"lch").alpha(this.alpha(),!0)},ot.prototype.desaturate=function(e=1){return this.saturate(-e)},ot.prototype.set=function(e,t,n=!1){const[r,a]=e.split("."),o=this[r]();if(a){const e=r.indexOf(a)-("ok"===r.substr(0,2)?2:0);if(e>-1){if("string"==Xe(t))switch(t.charAt(0)){case"+":case"-":o[e]+=+t;break;case"*":o[e]*=+t.substr(1);break;case"/":o[e]/=+t.substr(1);break;default:o[e]=+t}else{if("number"!==Xe(t))throw new Error("unsupported value for Color.set");o[e]=t}const a=new ot(o,r);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${a} in mode ${r}`)}return o},ot.prototype.tint=function(e=.5,...t){return Yn(this,"white",e,...t)},ot.prototype.shade=function(e=.5,...t){return Yn(this,"black",e,...t)};const Fn=(e,t,n)=>{const r=e._rgb,a=t._rgb;return new ot(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"rgb")};qn.rgb=Fn;const{sqrt:$n,pow:Wn}=Math,Hn=(e,t,n)=>{const[r,a,o]=e._rgb,[i,l,s]=t._rgb;return new ot($n(Wn(r,2)*(1-n)+Wn(i,2)*n),$n(Wn(a,2)*(1-n)+Wn(l,2)*n),$n(Wn(o,2)*(1-n)+Wn(s,2)*n),"rgb")};qn.lrgb=Hn;const Xn=(e,t,n)=>{const r=e.lab(),a=t.lab();return new ot(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"lab")};qn.lab=Xn;const Vn=(e,t,n,r)=>{let a,o,i,l,s,c,u,d,f,h,m,p;return"hsl"===r?(a=e.hsl(),o=t.hsl()):"hsv"===r?(a=e.hsv(),o=t.hsv()):"hcg"===r?(a=e.hcg(),o=t.hcg()):"hsi"===r?(a=e.hsi(),o=t.hsi()):"lch"===r||"hcl"===r?(r="hcl",a=e.hcl(),o=t.hcl()):"oklch"===r&&(a=e.oklch().reverse(),o=t.oklch().reverse()),"h"!==r.substr(0,1)&&"oklch"!==r||([i,s,u]=a,[l,c,d]=o),isNaN(i)||isNaN(l)?isNaN(i)?isNaN(l)?h=Number.NaN:(h=l,1!=u&&0!=u||"hsv"==r||(f=c)):(h=i,1!=d&&0!=d||"hsv"==r||(f=s)):(p=l>i&&l-i>180?l-(i+360):l<i&&i-l>180?l+360-i:l-i,h=i+n*p),void 0===f&&(f=s+n*(c-s)),m=u+n*(d-u),new ot("oklch"===r?[m,f,h]:[h,f,m],r)},Zn=(e,t,n)=>Vn(e,t,n,"lch");qn.lch=Zn,qn.hcl=Zn;const Kn=(e,t,n)=>{const r=e.num(),a=t.num();return new ot(r+n*(a-r),"num")};qn.num=Kn;const Jn=(e,t,n)=>Vn(e,t,n,"hcg");qn.hcg=Jn;const Un=(e,t,n)=>Vn(e,t,n,"hsi");qn.hsi=Un;const er=(e,t,n)=>Vn(e,t,n,"hsl");qn.hsl=er;const tr=(e,t,n)=>Vn(e,t,n,"hsv");qn.hsv=tr;const nr=(e,t,n)=>{const r=e.oklab(),a=t.oklab();return new ot(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"oklab")};qn.oklab=nr;const rr=(e,t,n)=>Vn(e,t,n,"oklch");qn.oklch=rr;const{pow:ar,sqrt:or,PI:ir,cos:lr,sin:sr,atan2:cr}=Math,ur=(e,t)=>{const n=e.length,r=[0,0,0,0];for(let a=0;a<e.length;a++){const o=t[a]/n,i=e[a]._rgb;r[0]+=ar(i[0],2)*o,r[1]+=ar(i[1],2)*o,r[2]+=ar(i[2],2)*o,r[3]+=i[3]*o}return r[0]=or(r[0]),r[1]=or(r[1]),r[2]=or(r[2]),r[3]>.9999999&&(r[3]=1),new ot(We(r))},{pow:dr}=Math;function fr(e){let t="rgb",n=lt("#ccc"),r=0,a=[0,1],o=[],i=[0,0],l=!1,s=[],c=!1,u=0,d=1,f=!1,h={},m=!0,p=1;const g=function(e){if((e=e||["#fff","#000"])&&"string"===Xe(e)&&lt.brewer&&lt.brewer[e.toLowerCase()]&&(e=lt.brewer[e.toLowerCase()]),"array"===Xe(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=lt(e[t]);o.length=0;for(let t=0;t<e.length;t++)o.push(t/(e.length-1))}return _(),s=e};let b=e=>e,y=e=>e;const v=function(e,r){let a,c;if(null==r&&(r=!1),isNaN(e)||null===e)return n;if(r)c=e;else if(l&&l.length>2){c=function(e){if(null!=l){const t=l.length-1;let n=0;for(;n<t&&e>=l[n];)n++;return n-1}return 0}(e)/(l.length-2)}else c=d!==u?(e-u)/(d-u):1;c=y(c),r||(c=b(c)),1!==p&&(c=dr(c,p)),c=i[0]+c*(1-i[0]-i[1]),c=$e(c,0,1);const f=Math.floor(1e4*c);if(m&&h[f])a=h[f];else{if("array"===Xe(s))for(let e=0;e<o.length;e++){const n=o[e];if(c<=n){a=s[e];break}if(c>=n&&e===o.length-1){a=s[e];break}if(c>n&&c<o[e+1]){c=(c-n)/(o[e+1]-n),a=lt.interpolate(s[e],s[e+1],c,t);break}}else"function"===Xe(s)&&(a=s(c));m&&(h[f]=a)}return a};var _=()=>h={};g(e);const x=function(e){const t=lt(v(e));return c&&t[c]?t[c]():t};return x.classes=function(e){if(null!=e){if("array"===Xe(e))l=e,a=[e[0],e[e.length-1]];else{const t=lt.analyze(a);l=0===e?[t.min,t.max]:lt.limits(t,"e",e)}return x}return l},x.domain=function(e){if(!arguments.length)return a;u=e[0],d=e[e.length-1],o=[];const t=s.length;if(e.length===t&&u!==d)for(let t of Array.from(e))o.push((t-u)/(d-u));else{for(let e=0;e<t;e++)o.push(e/(t-1));if(e.length>2){const t=e.map((t,n)=>n/(e.length-1)),n=e.map(e=>(e-u)/(d-u));n.every((e,n)=>t[n]===e)||(y=e=>{if(e<=0||e>=1)return e;let r=0;for(;e>=n[r+1];)r++;return t[r]+(e-n[r])/(n[r+1]-n[r])*(t[r+1]-t[r])})}}return a=[u,d],x},x.mode=function(e){return arguments.length?(t=e,_(),x):t},x.range=function(e,t){return g(e),x},x.out=function(e){return c=e,x},x.spread=function(e){return arguments.length?(r=e,x):r},x.correctLightness=function(e){return null==e&&(e=!0),f=e,_(),b=f?function(e){const t=v(0,!0).lab()[0],n=v(1,!0).lab()[0],r=t>n;let a=v(e,!0).lab()[0];const o=t+(n-t)*e;let i=a-o,l=0,s=1,c=20;for(;Math.abs(i)>.01&&c-- >0;)(function(){r&&(i*=-1),i<0?(l=e,e+=.5*(s-e)):(s=e,e+=.5*(l-e)),a=v(e,!0).lab()[0],i=a-o})();return e}:e=>e,x},x.padding=function(e){return null!=e?("number"===Xe(e)&&(e=[e,e]),i=e,x):i},x.colors=function(t,n){arguments.length<2&&(n="hex");let r=[];if(0===arguments.length)r=s.slice(0);else if(1===t)r=[x(.5)];else if(t>1){const e=a[0],n=a[1]-e;r=function(e,t,n){let r=[],a=e<t,o=n?a?t+1:t-1:t;for(let t=e;a?t<o:t>o;a?t++:t--)r.push(t);return r}(0,t,!1).map(r=>x(e+r/(t-1)*n))}else{e=[];let t=[];if(l&&l.length>2)for(let e=1,n=l.length,r=1<=n;r?e<n:e>n;r?e++:e--)t.push(.5*(l[e-1]+l[e]));else t=a;r=t.map(e=>x(e))}return lt[n]&&(r=r.map(e=>e[n]())),r},x.cache=function(e){return null!=e?(m=e,x):m},x.gamma=function(e){return null!=e?(p=e,x):p},x.nodata=function(e){return null!=e?(n=lt(e),x):n},x}const hr=(e,t,n)=>{if(!hr[n])throw new Error("unknown blend mode "+n);return hr[n](e,t)},mr=e=>(t,n)=>{const r=lt(n).rgb(),a=lt(t).rgb();return lt.rgb(e(r,a))},pr=e=>(t,n)=>{const r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r};hr.normal=mr(pr(e=>e)),hr.multiply=mr(pr((e,t)=>e*t/255)),hr.screen=mr(pr((e,t)=>255*(1-(1-e/255)*(1-t/255)))),hr.overlay=mr(pr((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)))),hr.darken=mr(pr((e,t)=>e>t?t:e)),hr.lighten=mr(pr((e,t)=>e>t?e:t)),hr.dodge=mr(pr((e,t)=>255===e||(e=t/255*255/(1-e/255))>255?255:e)),hr.burn=mr(pr((e,t)=>255*(1-(1-t/255)/(e/255))));const gr=hr,{pow:br,sin:yr,cos:vr}=Math;const{floor:_r,random:xr}=Math,{log:Cr,pow:wr,floor:kr,abs:Mr}=Math;function Rr(e,t=null){const n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===Xe(e)&&(e=Object.values(e)),e.forEach(e=>{t&&"object"===Xe(e)&&(e=e[t]),null==e||isNaN(e)||(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(e,t)=>Or(n,e,t),n}function Or(e,t="equal",n=7){"array"==Xe(e)&&(e=Rr(e));const{min:r,max:a}=e,o=e.values.sort((e,t)=>e-t);if(1===n)return[r,a];const i=[];if("c"===t.substr(0,1)&&(i.push(r),i.push(a)),"e"===t.substr(0,1)){i.push(r);for(let e=1;e<n;e++)i.push(r+e/n*(a-r));i.push(a)}else if("l"===t.substr(0,1)){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const e=Math.LOG10E*Cr(r),t=Math.LOG10E*Cr(a);i.push(r);for(let r=1;r<n;r++)i.push(wr(10,e+r/n*(t-e)));i.push(a)}else if("q"===t.substr(0,1)){i.push(r);for(let e=1;e<n;e++){const t=(o.length-1)*e/n,r=kr(t);if(r===t)i.push(o[r]);else{const e=t-r;i.push(o[r]*(1-e)+o[r+1]*e)}}i.push(a)}else if("k"===t.substr(0,1)){let e;const t=o.length,l=new Array(t),s=new Array(n);let c=!0,u=0,d=null;d=[],d.push(r);for(let e=1;e<n;e++)d.push(r+e/n*(a-r));for(d.push(a);c;){for(let e=0;e<n;e++)s[e]=0;for(let e=0;e<t;e++){const t=o[e];let r,a=Number.MAX_VALUE;for(let o=0;o<n;o++){const n=Mr(d[o]-t);n<a&&(a=n,r=o),s[r]++,l[e]=r}}const r=new Array(n);for(let e=0;e<n;e++)r[e]=null;for(let n=0;n<t;n++)e=l[n],null===r[e]?r[e]=o[n]:r[e]+=o[n];for(let e=0;e<n;e++)r[e]*=1/s[e];c=!1;for(let e=0;e<n;e++)if(r[e]!==d[e]){c=!0;break}d=r,u++,u>200&&(c=!1)}const f={};for(let e=0;e<n;e++)f[e]=[];for(let n=0;n<t;n++)e=l[n],f[e].push(o[n]);let h=[];for(let e=0;e<n;e++)h.push(f[e][0]),h.push(f[e][f[e].length-1]);h=h.sort((e,t)=>e-t),i.push(h[0]);for(let e=1;e<h.length;e+=2){const t=h[e];isNaN(t)||-1!==i.indexOf(t)||i.push(t)}}return i}const{sqrt:Nr,pow:Sr,min:Ar,max:Qr,atan2:Dr,abs:Pr,cos:Tr,sin:jr,exp:Lr,PI:Gr}=Math;const zr={cool:()=>fr([lt.hsl(180,1,.9),lt.hsl(250,.7,.4)]),hot:()=>fr(["#000","#f00","#ff0","#fff"]).mode("rgb")},Ir={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(let e of Object.keys(Ir))Ir[e.toLowerCase()]=Ir[e];Object.assign(lt,{average:(e,t="lrgb",n=null)=>{const r=e.length;n||(n=Array.from(new Array(r)).map(()=>1));const a=r/n.reduce(function(e,t){return e+t});if(n.forEach((e,t)=>{n[t]*=a}),e=e.map(e=>new ot(e)),"lrgb"===t)return ur(e,n);const o=e.shift(),i=o.get(t),l=[];let s=0,c=0;for(let e=0;e<i.length;e++)if(i[e]=(i[e]||0)*n[0],l.push(isNaN(i[e])?0:n[0]),"h"===t.charAt(e)&&!isNaN(i[e])){const t=i[e]/180*ir;s+=lr(t)*n[0],c+=sr(t)*n[0]}let u=o.alpha()*n[0];e.forEach((e,r)=>{const a=e.get(t);u+=e.alpha()*n[r+1];for(let e=0;e<i.length;e++)if(!isNaN(a[e]))if(l[e]+=n[r+1],"h"===t.charAt(e)){const t=a[e]/180*ir;s+=lr(t)*n[r+1],c+=sr(t)*n[r+1]}else i[e]+=a[e]*n[r+1]});for(let e=0;e<i.length;e++)if("h"===t.charAt(e)){let t=cr(c/l[e],s/l[e])/ir*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;i[e]=t}else i[e]=i[e]/l[e];return u/=r,new ot(i,t).alpha(u>.99999?1:u,!0)},bezier:e=>{const t=function(e){let t,n,r,a;if(2===(e=e.map(e=>new ot(e))).length)[n,r]=e.map(e=>e.lab()),t=function(e){const t=[0,1,2].map(t=>n[t]+e*(r[t]-n[t]));return new ot(t,"lab")};else if(3===e.length)[n,r,a]=e.map(e=>e.lab()),t=function(e){const t=[0,1,2].map(t=>(1-e)*(1-e)*n[t]+2*(1-e)*e*r[t]+e*e*a[t]);return new ot(t,"lab")};else if(4===e.length){let o;[n,r,a,o]=e.map(e=>e.lab()),t=function(e){const t=[0,1,2].map(t=>(1-e)*(1-e)*(1-e)*n[t]+3*(1-e)*(1-e)*e*r[t]+3*(1-e)*e*e*a[t]+e*e*e*o[t]);return new ot(t,"lab")}}else{if(!(e.length>=5))throw new RangeError("No point in running bezier with only one color.");{let n,r,a;n=e.map(e=>e.lab()),a=e.length-1,r=function(e){let t=[1,1];for(let n=1;n<e;n++){let e=[1];for(let n=1;n<=t.length;n++)e[n]=(t[n]||0)+t[n-1];t=e}return t}(a),t=function(e){const t=1-e,o=[0,1,2].map(o=>n.reduce((n,i,l)=>n+r[l]*t**(a-l)*e**l*i[o],0));return new ot(o,"lab")}}}return t}(e);return t.scale=()=>fr(t),t},blend:gr,cubehelix:function(e=300,t=-1.5,n=1,r=1,a=[0,1]){let o,i=0;"array"===Xe(a)?o=a[1]-a[0]:(o=0,a=[a,a]);const l=function(l){const s=et*((e+120)/360+t*l),c=br(a[0]+o*l,r),u=(0!==i?n[0]+l*i:n)*c*(1-c)/2,d=vr(s),f=yr(s);return lt(We([255*(c+u*(-.14861*d+1.78277*f)),255*(c+u*(-.29227*d-.90649*f)),255*(c+u*(1.97294*d)),1]))};return l.start=function(t){return null==t?e:(e=t,l)},l.rotations=function(e){return null==e?t:(t=e,l)},l.gamma=function(e){return null==e?r:(r=e,l)},l.hue=function(e){return null==e?n:("array"===Xe(n=e)?(i=n[1]-n[0],0===i&&(n=n[1])):i=0,l)},l.lightness=function(e){return null==e?a:("array"===Xe(e)?(a=e,o=e[1]-e[0]):(a=[e,e],o=0),l)},l.scale=()=>lt.scale(l),l.hue(n),l},mix:Yn,interpolate:Yn,random:()=>{let e="#";for(let t=0;t<6;t++)e+="0123456789abcdef".charAt(_r(16*xr()));return new ot(e,"hex")},scale:fr,analyze:Rr,contrast:(e,t)=>{e=new ot(e),t=new ot(t);const n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},deltaE:function(e,t,n=1,r=1,a=1){var o=function(e){return 360*e/(2*Gr)},i=function(e){return 2*Gr*e/360};e=new ot(e),t=new ot(t);const[l,s,c]=Array.from(e.lab()),[u,d,f]=Array.from(t.lab()),h=(l+u)/2,m=(Nr(Sr(s,2)+Sr(c,2))+Nr(Sr(d,2)+Sr(f,2)))/2,p=.5*(1-Nr(Sr(m,7)/(Sr(m,7)+Sr(25,7)))),g=s*(1+p),b=d*(1+p),y=Nr(Sr(g,2)+Sr(c,2)),v=Nr(Sr(b,2)+Sr(f,2)),_=(y+v)/2,x=o(Dr(c,g)),C=o(Dr(f,b)),w=x>=0?x:x+360,k=C>=0?C:C+360,M=Pr(w-k)>180?(w+k+360)/2:(w+k)/2,R=1-.17*Tr(i(M-30))+.24*Tr(i(2*M))+.32*Tr(i(3*M+6))-.2*Tr(i(4*M-63));let O=k-w;O=Pr(O)<=180?O:k<=w?O+360:O-360,O=2*Nr(y*v)*jr(i(O)/2);const N=u-l,S=v-y,A=1+.015*Sr(h-50,2)/Nr(20+Sr(h-50,2)),Q=1+.045*_,D=1+.015*_*R,P=30*Lr(-Sr((M-275)/25,2)),T=-(2*Nr(Sr(_,7)/(Sr(_,7)+Sr(25,7))))*jr(2*i(P)),j=Nr(Sr(N/(n*A),2)+Sr(S/(r*Q),2)+Sr(O/(a*D),2)+T*(S/(r*Q))*(O/(a*D)));return Qr(0,Ar(100,j))},distance:function(e,t,n="lab"){e=new ot(e),t=new ot(t);const r=e.get(n),a=t.get(n);let o=0;for(let e in r){const t=(r[e]||0)-(a[e]||0);o+=t*t}return Math.sqrt(o)},limits:Or,valid:(...e)=>{try{return new ot(...e),!0}catch(e){return!1}},scales:zr,input:at,colors:_n,brewer:Ir});const Br=lt;function Er(e){const{value:t}=e;return(e=>!!Br.valid(e))(t)?Br(t).hex():""}const qr={lab:{l:[0,100],a:[-86.185,98.254],b:[-107.863,94.482]},lch:{l:[0,100],c:[0,100],h:[0,360]},rgb:{r:[0,255],g:[0,255],b:[0,255]},rgba:{r:[0,255],g:[0,255],b:[0,255],a:[0,1]},hsl:{h:[0,360],s:[0,1],l:[0,1]},hsv:{h:[0,360],s:[0,1],v:[0,1]},hsi:{h:[0,360],s:[0,1],i:[0,1]},cmyk:{c:[0,1],m:[0,1],y:[0,1],k:[0,1]}};const Yr=e=>{const{value:t}=e;return(e=>!!Br.valid(e))(t)?Br(t):Br("#000")},Fr=(e,t=e.model)=>{const n=Yr(e);return n?n[t]():[0,0,0]},$r=(e,t=(4===e.length?"rgba":"rgb"))=>{const n={};if(1===e.length){const[r]=e;for(let e=0;e<t.length;e+=1)n[t[e]]=r}else for(let r=0;r<t.length;r+=1)n[t[r]]=e[r];return{model:t,value:n}};function Wr(e){const[t,n,r]=Fr(e,"rgb");return Math.round(.299*t+.587*n+.114*r)}function Hr(e,t=1){return 1===t?{model:"rgb",value:{r:e,g:e,b:e}}:{model:"rgba",value:{r:e,g:e,b:e,a:t}}}function Xr(e){if(/^(#|0x)?[0-9a-fA-F]{3}$/.test(e)||/^(#|0x)?[0-9a-fA-F]{6}$/.test(e)){const t=Br(e).rgb();return $r(t,"rgb")}if(/^(#|0x)?[0-9a-fA-F]{4}$/.test(e)||/^(#|0x)?[0-9a-fA-F]{8}$/.test(e)){const t=Br(e).rgba();return $r(t,"rgba")}return{model:"rgb",value:{r:0,g:0,b:0}}}const Vr=(e,t)=>e*t/255,Zr=(e,t)=>e+t-e*t/255,Kr=(e,t)=>e<128?Vr(2*e,t):Zr(2*e-255,t),Jr={normal:e=>e,darken:(e,t)=>Math.min(e,t),multiply:Vr,colorBurn:(e,t)=>0===e?0:Math.max(0,255*(1-(255-t)/e)),lighten:(e,t)=>Math.max(e,t),screen:Zr,colorDodge:(e,t)=>255===e?255:Math.min(255,t/(255-e)*255),overlay:(e,t)=>Kr(t,e),softLight:(e,t)=>{if(e<128)return t-(1-2*e/255)*t*(1-t/255);return t+255*(2*e/255-1)*((t<64?t/255*(t/255*(t/255*16-12)+4):Math.sqrt(t/255))-t/255)},hardLight:Kr,difference:(e,t)=>Math.abs(e-t),exclusion:(e,t)=>e+t-2*e*t/255,linearBurn:(e,t)=>Math.max(e+t-255,0),linearDodge:(e,t)=>Math.min(255,e+t),linearLight:(e,t)=>Math.max(t+2*e-255,0),vividLight:(e,t)=>e<128?255*(1-(1-t/255)/(2*e/255)):t/2/(255-e)*255,pinLight:(e,t)=>e<128?Math.min(t,2*e):Math.max(t,2*e-255)},Ur=e=>.3*e[0]+.58*e[1]+.11*e[2],ea=(e,t)=>{const n=t-Ur(e);return(e=>{const t=Ur(e),n=Math.min(...e),r=Math.max(...e);let a=[...e];return n<0&&(a=a.map(e=>t+(e-t)*t/(t-n))),r>255&&(a=a.map(e=>t+(e-t)*(255-t)/(r-t))),a})(e.map(e=>e+n))},ta=e=>Math.max(...e)-Math.min(...e),na=(e,t)=>{const n=e.map((e,t)=>({value:e,index:t}));n.sort((e,t)=>e.value-t.value);const r=n[0].index,a=n[1].index,o=n[2].index,i=[...e];return i[o]>i[r]?(i[a]=(i[a]-i[r])*t/(i[o]-i[r]),i[o]=t):(i[a]=0,i[o]=0),i[r]=0,i},ra={hue:(e,t)=>ea(na(e,ta(t)),Ur(t)),saturation:(e,t)=>ea(na(t,ta(e)),Ur(t)),color:(e,t)=>ea(e,Ur(t)),luminosity:(e,t)=>ea(t,Ur(e))},aa=(e,t,n="normal")=>{const[r,a,o,i]=Fr(e,"rgba"),[l,s,c,u]=Fr(t,"rgba"),d=[r,a,o],f=[l,s,c];let h;if(Fe.includes(n)){const e=Jr[n];h=d.map((t,n)=>Math.floor(e(t,f[n])))}else h=ra[n](d,f);const m=i+u*(1-i),p=Math.round((i*(1-u)*r+i*u*h[0]+(1-i)*u*l)/m),g=Math.round((i*(1-u)*a+i*u*h[1]+(1-i)*u*s)/m),b=Math.round((i*(1-u)*o+i*u*h[2]+(1-i)*u*c)/m);return 1===m?{model:"rgb",value:{r:p,g,b}}:{model:"rgba",value:{r:p,g,b,a:m}}};const oa=(e,t)=>{let n=(e+t)%360;return n<0?n+=360:n>=360&&(n-=360),n},ia=(e=1,t=0)=>{const n=Math.min(e,t),r=Math.max(e,t);return n+Math.random()*(r-n)},la=(e=1,t=0)=>{const n=Math.ceil(Math.min(e,t)),r=Math.floor(Math.max(e,t));return Math.floor(n+Math.random()*(r-n+1))},sa=e=>{if(e&&"object"==typeof e){if(Array.isArray(e)){return e.map(e=>sa(e))}const t={};return Object.keys(e).forEach(n=>{t[n]=sa(e[n])}),t}return e};function ca(e){return e*(Math.PI/180)}var ua=n("./node_modules/.pnpm/color-blind@0.1.3/node_modules/color-blind/lib/color-blind.js"),da=n.n(ua);const fa=(e,t="normal")=>"grayscale"===t?(e=>{const t=Wr(e),[,,,n=1]=Fr(e,"rgba");return Hr(t,n)})(e):((e,t="normal")=>{if("normal"===t)return{...e};const n=Er(e);return Xr(da()[t](n))})(e,t),ha=(e,t,n=[la(5,10),la(90,95)])=>{const[r,a,o]=Fr(e,"lab"),i=r<=15?r:n[0];let l=((r>=85?r:n[1])-i)/(t-1);const s=Math.ceil((r-i)/l);return l=0===s?l:(r-i)/s,new Array(t).fill(0).map((e,t)=>$r([l*t+i,a,o],"lab"))},ma=e=>{const{count:t,color:n,tendency:r}=e,a="tint"===r,o=ha(n,t);return{name:"monochromatic",semantic:null,type:"discrete-scale",colors:a?o:o.reverse()}},pa={model:"rgb",value:{r:0,g:0,b:0}},ga={model:"rgb",value:{r:255,g:255,b:255}},ba=(e,t,n="lab")=>Br.distance(Yr(e),Yr(t),n),ya=(e,t)=>{const n=Math.atan2(e,t)*(180/Math.PI);return n>=0?n:n+360},va=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},_a=e=>{const[t,n,r]=Fr(e);return.2126*va(t)+.7152*va(n)+.0722*va(r)},xa=(e,t,n={measure:"euclidean"})=>{const{measure:r="euclidean",backgroundColor:a=Ye}=n,o=aa(e,a),i=aa(t,a);switch(r){case"CIEDE2000":return((e,t)=>{const[n,r,a]=Fr(e,"lab"),[o,i,l]=Fr(t,"lab"),s=(Math.sqrt(r**2+a**2)+Math.sqrt(i**2+l**2))/2,c=.5*(1-Math.sqrt(s**7/(s**7+25**7))),u=(1+c)*r,d=(1+c)*i,f=Math.sqrt(u**2+a**2),h=Math.sqrt(d**2+l**2),m=ya(a,u),p=ya(l,d),g=o-n,b=h-f;let y;y=Math.abs(p-m)<=180?p-m:p-m<-180?p-m+360:p-m-360;const v=2*Math.sqrt(f*h)*Math.sin(ca(y)/2);let _;_=Math.abs(m-p)<=180?(m+p)/2:Math.abs(m-p)>180&&m+p<360?(m+p+360)/2:(m+p-360)/2;const x=(n+o)/2,C=(f+h)/2,w=1-.17*Math.cos(ca(_-30))+.24*Math.cos(ca(2*_))+.32*Math.cos(ca(3*_+6))-.2*Math.cos(ca(4*_-63)),k=1+.015*(x-50)**2/Math.sqrt(20+(x-50)**2),M=1+.045*C,R=1+.015*C*w,O=-2*Math.sqrt(C**7/(C**7+25**7))*Math.sin(ca(60*Math.exp(-(((_-275)/25)**2))));return Math.sqrt((g/(1*k))**2+(b/(1*M))**2+(v/(1*R))**2+O*(b/(1*M))*(v/(1*R)))})(o,i);case"euclidean":return ba(o,i,n.colorModel);case"contrastRatio":return((e,t)=>{const n=_a(e),r=_a(t);return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)})(o,i);default:return ba(o,i)}};const Ca=[.8,1.2],wa={rouletteWheel:e=>{const t=e.reduce((e,t)=>e+t);let n=0;const r=ia(t);let a=0;for(let t=0;t<e.length;t+=1)a+=e[t],r<a&&(n=+t);return n},tournament:e=>{let t=-1,n=0;for(let r=0;r<3;r+=1){const a=la(e.length-1);e[a]>n&&(t=r,n=e[a])}return t}},ka=(e,t="tournament")=>wa[t](e),Ma=(e,t)=>{const n=sa(e),r=sa(t);for(let a=1;a<e.length;a+=2)n[a]=t[a],r[a]=e[a];return[n,r]},Ra=(e,t,n,r)=>{const a=sa(e),o=t[la(t.length-1)],i=la(e[0].length-1);let l=a[o][i]*ia(...Ca),s=[15,240];"grayscale"!==n&&(s=qr[r][r.split("")[i]]);const[c,u]=s;return l<c?l=c:l>u&&(l=u),a[o][i]=l,a},Oa=(e,t,n,r,a,o)=>{let i;i=e.map("grayscale"===n?([e])=>Hr(e):e=>fa($r(e,r),n));let l=1/0;for(let e=0;e<i.length;e+=1)for(let n=e+1;n<i.length;n+=1)t[e]&&t[n]||(l=Math.min(l,xa(i[e],i[n],{measure:a,backgroundColor:o})));return l},Na=(e,t,n,r,a,o,i)=>{if(Math.round(Oa(e,t,n,a,o,i))>r)return e;const l=new Array(e.length).fill(0).map((e,t)=>t).filter((e,n)=>!t[n]);let s=new Array(50).fill(0).map(()=>Ra(e,l,n,a)),c=s.map(e=>Oa(e,t,n,a,o,i)),u=Math.max(...c),d=s[c.findIndex(e=>e===u)],f=1;for(;f<100&&Math.round(u)<r;){const e=[d];for(let t=1;t<50;t+=2){const t=s[ka(c)],r=s[ka(c)];let o=ia()<.9?Ma(t,r):[t,r];o=o.map(e=>ia()<.1?Ra(e,l,n,a):e),e.push(...o)}s=e,c=s.map(e=>Oa(e,t,n,a,o,i));const r=Math.max(...c);u=r,d=s[c.findIndex(e=>e===r)],f+=1}return d},Sa={euclidean:30,CIEDE2000:20,contrastRatio:4.5},Aa={euclidean:291.48,CIEDE2000:100,contrastRatio:21},Qa=(e,t={})=>{const{locked:n=[],simulationType:r="normal",threshold:a,colorModel:o="hsv",colorDifferenceMeasure:i="euclidean",backgroundColor:l=Ye}=t;let s=a;if(s||(s=Sa[i]),"grayscale"===r){s=Math.min(s,Aa[i]/e.colors.length)}const c=sa(e);if(!function(e){return"matrix"===e.type}(c)&&!function(e){return"continuous-scale"===e.type}(c))if("grayscale"===r){const e=c.colors.map(e=>[Wr(e)]),t=Na(e,n,r,s,o,i,l);c.colors.forEach((e,n)=>Object.assign(e,function(e,t){const[,n,r]=Fr(t,"lab"),[,,,a=1]=Fr(t,"rgba"),o=100*e;let i,l=Math.round(o),s=Wr($r([l,n,r],"lab")),c=25;for(;Math.round(o)!==Math.round(s/255*100)&&c>0;)o>s/255*100?l+=1:l-=1,c-=1,s=Wr($r([l,n,r],"lab"));if(Math.round(o)<Math.round(s/255*100)&&(l-=1),1===a)i=$r([l,n,r],"lab");else{const e=Fr($r([l,n,r],"lab"),"rgb");i=$r([...e,a],"rgba")}return{...t,...i}}(t[n][0]/255,e)))}else{const e=c.colors.map(e=>Fr(e,o)),t=Na(e,n,r,s,o,i,l);c.colors.forEach((e,n)=>{Object.assign(e,$r(t[n],o))})}return c},Da=[.3,.9],Pa=[.5,1],Ta=(e,t,n,r=[])=>{const[a]=Fr(e,"hsv"),o=new Array(n).fill(!1);let i=-1===r.findIndex(t=>t&&t.model===e.model&&t.value===e.value);return{newColors:new Array(n).fill(0).map((n,l)=>{const s=r[l];return s?(o[l]=!0,s):i?(i=!1,o[l]=!0,e):$r([oa(a,t*l),ia(...Da),ia(...Pa)],"hsv")}),locked:o}};function ja(){const e=la(255),t=la(255),n=la(255);return $r([e,t,n],"rgb")}const La=e=>{const{count:t,colors:n}=e,r=[],a={name:"random",semantic:null,type:"categorical",colors:new Array(t).fill(0).map((e,t)=>{const a=n[t];return a?(r[t]=!0,a):ja()})};return Qa(a,{locked:r})},Ga=["monochromatic"],za={monochromatic:ma,analogous:e=>{const{count:t,color:n,tendency:r}=e,a="tint"===r,[o,i,l]=Fr(n,"hsv"),s=Math.floor(t/2);let c=60/(t-1);o>=60&&o<=240&&(c=-c);const u=(i-.1)/3/(t-s-1),d=(l-.4)/3/s,f=new Array(t).fill(0).map((e,t)=>{const n=oa(o,c*(t-s)),r=t<=s?Math.min(i+u*(s-t),1):i+3*u*(s-t),a=t<=s?l-3*d*(s-t):Math.min(l-d*(s-t),1);return $r([n,r,a],"hsv")});return{name:"analogous",semantic:null,type:"discrete-scale",colors:a?f:f.reverse()}},achromatic:e=>{const{tendency:t}=e,n={...e,color:"tint"===t?pa:ga};return{...ma(n),name:"achromatic"}},complementary:e=>{const{count:t,color:n}=e,[r,a,o]=Fr(n,"hsv"),i=$r([oa(r,180),a,o],"hsv"),l=la(80,90),s=la(15,25),c=Math.floor(t/2),u=ha(n,c,[s,l]),d=ha(i,c,[s,l]).reverse();let f;if(t%2==1){const e=$r([(oa(r,180)+r)/2,ia(.05,.1),ia(.9,.95)],"hsv");f=[...u,e,...d]}else f=[...u,...d];return{name:"complementary",semantic:null,type:"discrete-scale",colors:f}},"split-complementary":e=>{const{count:t,color:n,colors:r}=e,{newColors:a,locked:o}=Ta(n,180,t,r);return Qa({name:"tetradic",semantic:null,type:"categorical",colors:a},{locked:o})},triadic:e=>{const{count:t,color:n,colors:r}=e,{newColors:a,locked:o}=Ta(n,120,t,r);return Qa({name:"tetradic",semantic:null,type:"categorical",colors:a},{locked:o})},tetradic:e=>{const{count:t,color:n,colors:r}=e,{newColors:a,locked:o}=Ta(n,90,t,r);return Qa({name:"tetradic",semantic:null,type:"categorical",colors:a},{locked:o})},polychromatic:e=>{const{count:t,color:n,colors:r}=e,a=360/t,{newColors:o,locked:i}=Ta(n,a,t,r);return Qa({name:"tetradic",semantic:null,type:"categorical",colors:o},{locked:i})},customized:La},Ia=(e="monochromatic",t={})=>{const n=((e,t)=>{const{count:n=8,tendency:r="tint"}=t;let{colors:a=[],color:o}=t;return o||(o=a.find(e=>!!e&&!!e.model&&!!e.value)||ja()),Ga.includes(e)&&(a=[]),{color:o,colors:a,count:n,tendency:r}})(e,t);try{return za[e](n)}catch(e){return La(n)}};n("./node_modules/.pnpm/quantize@1.0.2/node_modules/quantize/quantize.js");var Ba={}.toString,Ea=function(e,t){return Ba.call(e)==="[object ".concat(t,"]")},qa=function(e){if(!function(e){return"object"==typeof e&&null!==e}(e)||!Ea(e,"Object"))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function Ya(e,t,n,r){var a=n||0,o=r||5,i=e;Object.keys(t).forEach(function(e){if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e];null!==n&&qa(n)?(qa(i[e])||(i[e]={}),a<o?Ya(i[e],n,a+1,o):i[e]=t[e]):!function(e){return Array.isArray?Array.isArray(e):Ea(e,"Array")}(n)?void 0!==n&&(i[e]=n):(i[e]=[],i[e]=i[e].concat(n))}})}const Fa=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r+=1)Ya(e,t[r]);return e};var $a=["line_chart","step_line_chart","area_chart","stacked_area_chart","percent_stacked_area_chart","column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart","range_column_chart","waterfall_chart","histogram","bar_chart","stacked_bar_chart","percent_stacked_bar_chart","grouped_bar_chart","range_bar_chart","radial_bar_chart","bullet_chart","pie_chart","donut_chart","nested_pie_chart","rose_chart","scatter_plot","bubble_chart","non_ribbon_chord_diagram","arc_diagram","chord_diagram","treemap","sankey_diagram","funnel_chart","mirror_funnel_chart","box_plot","heatmap","density_heatmap","radar_chart","wordcloud","candlestick_chart","compact_box_tree","dendrogram","indented_tree","radial_tree","flow_diagram","fruchterman_layout_graph","force_directed_layout_graph","fa2_layout_graph","mds_layout_graph","circular_layout_graph","spiral_layout_graph","radial_layout_graph","concentric_layout_graph","grid_layout_graph"];const Wa=function(e){return null===e};const Ha=function(e,t){return Wa(e.distinct)||Wa(t.distinct)?e.distinct<t.distinct?1:e.distinct>t.distinct?-1:0:0};function Xa(e){return[e.find(function(e){return l(e.levelOfMeasurements,["Nominal"])}),e.find(function(e){return l(e.levelOfMeasurements,["Interval"])})]}function Va(e){return[e.find(function(e){return h(e.levelOfMeasurements,["Time","Ordinal"])}),e.find(function(e){return l(e.levelOfMeasurements,["Interval"])}),e.find(function(e){return l(e.levelOfMeasurements,["Nominal"])})]}function Za(e){var t=e.find(function(e){return h(e.levelOfMeasurements,["Time","Ordinal"])}),n=e.find(function(e){return l(e.levelOfMeasurements,["Nominal"])});return[t,e.find(function(e){return l(e.levelOfMeasurements,["Interval"])}),n]}function Ka(e){var t=e.filter(function(e){return l(e.levelOfMeasurements,["Nominal"])}).sort(Ha),n=t[0],r=t[1];return[e.find(function(e){return l(e.levelOfMeasurements,["Interval"])}),n,r]}function Ja(e){var t,n,a,o,i,s,c=e.filter(function(e){return l(e.levelOfMeasurements,["Nominal"])}).sort(Ha);return!function(e,t){if(!le(e)||0===e.length||!le(t)||0===t.length||e.length!==t.length)return!1;for(var n={},r=0;r<t.length;r+=1){var a=t[r],o=e[r];if(n[a]){if(n[a]!==o)return!1}else n[a]=o}return!0}(null===(a=c[1])||void 0===a?void 0:a.rawData,null===(o=c[0])||void 0===o?void 0:o.rawData)?(i=(n=(0,r.zs)(c,2))[0],s=n[1]):(s=(t=(0,r.zs)(c,2))[0],i=t[1]),[i,e.find(function(e){return l(e.levelOfMeasurements,["Interval"])}),s]}function Ua(e,t,n,a){if(!$a.includes(e)&&a)return a.toSpec?a.toSpec(t,n):null;switch(e){case"pie_chart":return function(e,t){var n=(0,r.zs)(Xa(t),2),a=n[0],o=n[1];return o&&a?{type:"interval",data:e,encode:{color:a.name,y:o.name},transform:[{type:"stackY"}],coordinate:{type:"theta"}}:null}(t,n);case"donut_chart":return function(e,t){var n=(0,r.zs)(Xa(t),2),a=n[0],o=n[1];return o&&a?{type:"interval",data:e,encode:{color:a.name,y:o.name},transform:[{type:"stackY"}],coordinate:{type:"theta",innerRadius:.6}}:null}(t,n);case"line_chart":return function(e,t){var n=(0,r.zs)(Va(t),3),a=n[0],o=n[1],i=n[2];if(!a||!o)return null;var l={type:"line",data:e,encode:{x:a.name,y:o.name}};return i&&(l.encode.color=i.name),l}(t,n);case"step_line_chart":return function(e,t){var n=(0,r.zs)(Va(t),3),a=n[0],o=n[1],i=n[2];if(!a||!o)return null;var l={type:"line",data:e,encode:{x:a.name,y:o.name,shape:"hvh"}};return i&&(l.encode.color=i.name),l}(t,n);case"area_chart":return function(e,t){var n=t.find(function(e){return h(e.levelOfMeasurements,["Time","Ordinal"])}),r=t.find(function(e){return l(e.levelOfMeasurements,["Interval"])});return n&&r?{type:"area",data:e,encode:{x:n.name,y:r.name}}:null}(t,n);case"stacked_area_chart":return function(e,t){var n=(0,r.zs)(Za(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"area",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"stackY"}]}:null}(t,n);case"percent_stacked_area_chart":return function(e,t){var n=(0,r.zs)(Za(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"area",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"stackY"},{type:"normalizeY"}]}:null}(t,n);case"bar_chart":return function(e,t){var n=(0,r.zs)(Ka(t),3),a=n[0],o=n[1],i=n[2];if(!a||!o)return null;var l={type:"interval",data:e,encode:{x:o.name,y:a.name},coordinate:{transform:[{type:"transpose"}]}};return i&&(l.encode.color=i.name,l.transform=[{type:"stackY"}]),l}(t,n);case"grouped_bar_chart":return function(e,t){var n=(0,r.zs)(Ka(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:o.name,y:a.name,color:i.name},transform:[{type:"dodgeX"}],coordinate:{transform:[{type:"transpose"}]}}:null}(t,n);case"stacked_bar_chart":return function(e,t){var n=(0,r.zs)(Ka(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:o.name,y:a.name,color:i.name},transform:[{type:"stackY"}],coordinate:{transform:[{type:"transpose"}]}}:null}(t,n);case"percent_stacked_bar_chart":return function(e,t){var n=(0,r.zs)(Ka(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:o.name,y:a.name,color:i.name},transform:[{type:"stackY"},{type:"normalizeY"}],coordinate:{transform:[{type:"transpose"}]}}:null}(t,n);case"column_chart":return function(e,t){var n=t.filter(function(e){return l(e.levelOfMeasurements,["Nominal"])}).sort(Ha),r=n[0],a=n[1],o=t.find(function(e){return l(e.levelOfMeasurements,["Interval"])});if(!r||!o)return null;var i={type:"interval",data:e,encode:{x:r.name,y:o.name}};return a&&(i.encode.color=a.name,i.transform=[{type:"stackY"}]),i}(t,n);case"grouped_column_chart":return function(e,t){var n=(0,r.zs)(Ja(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"dodgeX"}]}:null}(t,n);case"stacked_column_chart":return function(e,t){var n=(0,r.zs)(Ja(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"stackY"}]}:null}(t,n);case"percent_stacked_column_chart":return function(e,t){var n=(0,r.zs)(Ja(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"stackY"},{type:"normalizeY"}]}:null}(t,n);case"scatter_plot":return function(e,t){var n=t.filter(function(e){return l(e.levelOfMeasurements,["Interval"])}).sort(Ha),r=n[0],a=n[1],o=t.find(function(e){return l(e.levelOfMeasurements,["Nominal"])});if(!r||!a)return null;var i={type:"point",data:e,encode:{x:r.name,y:a.name}};return o&&(i.encode.color=o.name),i}(t,n);case"bubble_chart":return function(e,t){for(var n=t.filter(function(e){return l(e.levelOfMeasurements,["Interval"])}),a={x:n[0],y:n[1],corr:0,size:n[2]},o=function(e){for(var t=function(t){var o=ke(n[e].rawData,n[t].rawData);Math.abs(o)>a.corr&&(a.x=n[e],a.y=n[t],a.corr=o,a.size=n[(0,r.fX)([],(0,r.zs)(Array(n.length).keys()),!1).find(function(n){return n!==e&&n!==t})||0])},o=e+1;o<n.length;o+=1)t(o)},i=0;i<n.length;i+=1)o(i);var s=a.x,c=a.y,u=a.size,d=t.find(function(e){return h(e.levelOfMeasurements,["Nominal"])});if(!s||!c||!u)return null;var f={type:"point",data:e,encode:{x:s.name,y:c.name,size:u.name}};return d&&(f.encode.color=d.name),f}(t,n);case"histogram":return function(e,t){var n=t.find(function(e){return l(e.levelOfMeasurements,["Interval"])});return n?{type:"rect",data:e,encode:{x:n.name},transform:[{type:"binX",y:"count"}]}:null}(t,n);case"heatmap":return function(e,t){var n=t.filter(function(e){return h(e.levelOfMeasurements,["Nominal","Ordinal"])}).sort(Ha),r=n[0],a=n[1],o=t.find(function(e){return l(e.levelOfMeasurements,["Interval"])});return r&&a&&o?{type:"cell",data:e,encode:{x:r.name,y:a.name,color:o.name}}:null}(t,n);default:return null}}var eo=["monochromatic","analogous"],to=["polychromatic","split-complementary","triadic","tetradic"];function no(e,t,n,r,a,o,i){var l=void 0!==(null==o?void 0:o.refine)&&o.refine,s=a,c=null==o?void 0:o.theme,u=void 0===(null==o?void 0:o.requireSpec)||o.requireSpec,d=n,f=Object.keys(d),h=[],m=f.map(function(a){var u,f=function(e,t,n,r,a){var o=[],i={dataProps:n,chartType:e,purpose:a?a.purpose:"",preferences:a?a.preferences:void 0},l=g(e,t,r,"HARD",i,o);return 0===l?{chartType:e,score:0,log:o}:{chartType:e,score:l*g(e,t,r,"SOFT",i,o),log:o}}(a,d,t,r,o);h.push(f);var m=f.score;if(m<=0)return{type:a,spec:null,score:m};var p=Ua(a,e,t,n[a]);if(!["kpi_panel","table"].includes(a)&&!p)return{type:a,spec:null,score:m};if(p&&l){var b=function(e,t,n,r){return Object.values(n).filter(function(r){var a;return"DESIGN"===r.type&&r.trigger({dataProps:t,chartType:e})&&!(null===(a=n[r.id].option)||void 0===a?void 0:a.off)}).reduce(function(e,n){var a=n.optimizer(t,r);return Fa(e,a)},{})}(a,t,r,p);Fa(p,b)}if(p)if(c&&!s){b=function(e,t,n){var r,a=L(t),o=n.primaryColor,i=a.encode;if(o&&i){var l=Xr(o);if(i.color){var s=i.color,c=s.field,u=void 0;u="quantitative"===s.type?eo[Math.floor(Math.random()*eo.length)]:to[Math.floor(Math.random()*to.length)];var d=null===(r=e.find(function(e){return e.name===c}))||void 0===r?void 0:r.count;return{scale:{color:{range:Ia(u,{color:l,count:d}).colors.map(function(e){return Er(e)})}}}}return"line"===t.type?{style:{stroke:Er(l)}}:{style:{fill:Er(l)}}}return{}}(t,p,c);Fa(p,b)}else if(s){var y=null!==(u=null==i?void 0:i.themeColor)&&void 0!==u?u:"#678ef2";b=function(e,t,n,r,a){var o,i=L(t).encode;if(n&&i){var l=Xr(n);if(i.color){var s=i.color,c=s.field,u=r;u||(u="quantitative"===s.type?"monochromatic":"polychromatic");var d=null===(o=e.find(function(e){return e.name===c}))||void 0===o?void 0:o.count;return{scale:{color:{range:Ia(u,{color:l,count:d}).colors.map(function(e){return Er(a?fa(e,a):e)})}}}}return"line"===t.type?{style:{stroke:Er(l)}}:{style:{fill:Er(l)}}}return{}}(t,p,y,null==i?void 0:i.colorSchemeType,null==i?void 0:i.simulationType);Fa(p,b)}return{type:a,spec:p,score:m}});return{advices:m.filter(function(e){return e.score>0&&(!u||e.spec)}).sort(function(e,t){return e.score<t.score?1:e.score>t.score?-1:0}),log:h}}function ro(e,t,n){var a=e.data,o=e.dataProps,i=e.smartColor,l=e.options,s=e.colorOptions,c=e.fields;try{var u=qe(a),d=function(e,t,n){var a=(t?new Be(e,{columns:t}):new Be(e)).info();return n?a.map(function(e){var t=n.find(function(t){return t.name===e.name});return(0,r.Cl)((0,r.Cl)({},e),t)}):a}(u,c,o);return no(c?u.map(function(e){var t=e;return Object.keys(t).forEach(function(e){c.includes(e)||delete t[e]}),e}):u,d,t,n,i,l,s)}catch(e){return console.error("error: ",e),null}}function ao(e,t,n,a,o,i,l){Object.values(e).filter(function(e){var a,o=e.option||{},l=o.weight,s=o.extra;return function(e){return"DESIGN"===t?"DESIGN"===e:"DESIGN"!==e}(e.type)&&!(null===(a=e.option)||void 0===a?void 0:a.off)&&e.trigger((0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},n),{weight:l}),s),{chartWIKI:i}))}).forEach(function(e){var s,c=e.type,u=e.id,d=e.docs;if("DESIGN"===t){var f=e.optimizer(n.dataProps,l);s=0===Object.keys(f).length?1:0,o.push({type:c,id:u,score:s,fix:f,docs:d})}else{var h=e.option||{},m=h.weight,p=h.extra;s=e.validator((0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},n),{weight:m}),p),{chartWIKI:i})),o.push({type:c,id:u,score:s,docs:d})}a.push({phase:"LINT",ruleId:u,score:s,base:s,weight:1,ruleType:c})})}function oo(e,t,n){var r=e.spec,a=e.options,o=e.dataProps,i=null==a?void 0:a.purpose,l=null==a?void 0:a.preferences,s=function(e){var t,n=e;switch(n.type){case"area":t=function(e){var t=e.transform,n=null==t?void 0:t.some(function(e){return"stackY"===e.type}),r=null==t?void 0:t.some(function(e){return"normalizeY"===e.type});return n?r?"percent_stacked_area_chart":"stacked_area_chart":"area_chart"}(n);break;case"interval":t=function(e){var t,n=e.coordinate;if("theta"===(null==n?void 0:n.type))return(null==n?void 0:n.innerRadius)?"donut_chart":"pie_chart";var r=e.transform,a=null===(t=null==n?void 0:n.transform)||void 0===t?void 0:t.some(function(e){return"transpose"===e.type}),o=null==r?void 0:r.some(function(e){return"normalizeY"===e.type}),i=null==r?void 0:r.some(function(e){return"stackY"===e.type}),l=null==r?void 0:r.some(function(e){return"dodgeX"===e.type});return a?l?"grouped_bar_chart":o?"stacked_bar_chart":i?"percent_stacked_bar_chart":"bar_chart":l?"grouped_column_chart":o?"stacked_column_chart":i?"percent_stacked_column_chart":"column_chart"}(n);break;case"line":t=function(e){var t=e.encode;return t.shape&&"hvh"===t.shape?"step_line_chart":"line_chart"}(n);break;case"point":t=function(e){return e.encode.size?"bubble_chart":"scatter_plot"}(n);break;case"rect":t="histogram";break;case"cell":t="heatmap";break;default:t=""}return t}(r),c=[],u=[];if(!r||!s)return{lints:c,log:u};if(!o||!o.length){try{o=new Be(r.data).info()}catch(e){return console.error("error: ",e),{lints:c,log:u}}}var d={dataProps:o,chartType:s,purpose:i,preferences:l};return ao(t,"notDESIGN",d,u,c,n),ao(t,"DESIGN",d,u,c,n,r),{lints:c=c.filter(function(e){return e.score<1}),log:u}}var io=function(){function e(e){void 0===e&&(e={}),this.ckb=i(e.ckbCfg),this.ruleBase=function(e){if(!e)return E(B);var t=E(B);if(e.exclude&&e.exclude.forEach(function(e){Object.keys(t).includes(e)&&delete t[e]}),e.include){var n=e.include;Object.keys(t).forEach(function(e){n.includes(e)||delete t[e]})}var a=(0,r.Cl)((0,r.Cl)({},t),e.custom),o=e.options;return o&&Object.keys(o).forEach(function(e){if(Object.keys(a).includes(e)){var t=o[e];a[e]=(0,r.Cl)((0,r.Cl)({},a[e]),{option:t})}}),a}(e.ruleCfg)}return e.prototype.advise=function(e){return ro(e,this.ckb,this.ruleBase).advices},e.prototype.adviseWithLog=function(e){return ro(e,this.ckb,this.ruleBase)},e.prototype.lint=function(e){return oo(e,this.ruleBase,this.ckb).lints},e.prototype.lintWithLog=function(e){return oo(e,this.ruleBase,this.ckb)},e}(),lo=n("./node_modules/.pnpm/@antv+util@3.3.11/node_modules/@antv/util/esm/lodash/deep-mix.js"),so=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n};const co=e=>{const t=new io,{data:n,dataProps:r,fields:a,options:o,colorOptions:i}=e,l=so(e,["data","dataProps","fields","options","colorOptions"]),s=t.advise({data:n,dataProps:r,fields:a,options:o,colorOptions:i});return(0,lo.A)({},l,null==s?void 0:s[0].spec)}},"./node_modules/.pnpm/color-blind@0.1.3/node_modules/color-blind/lib/blind.js"(e,t){"use strict";var n=2.2,r=[3.240712470389558,-.969259258688888,.05563600315398933,-1.5372626602963142,1.875996969313966,-.2039948802843549,-.49857440415943116,.041556132211625726,1.0570636917433989],a=[.41242371206635076,.21265606784927693,.019331987577444885,.3575793401363035,.715157818248362,.11919267420354762,.1804662232369621,.0721864539171564,.9504491124870351],o={protan:{x:.7465,y:.2535,m:1.273463,yi:-.073894},deutan:{x:1.4,y:-.4,m:.968437,yi:.003331},tritan:{x:.1748,y:0,m:.062921,yi:.292119},custom:{x:.735,y:.265,m:-1.059259,yi:1.026914}};t.e=function(e,t,i){var l,s,c,u,d,f,h,m,p,g,b,y,v,_,x,C,w,k,M;return"achroma"===t?(l={R:l=.212656*e.R+.715158*e.G+.072186*e.B,G:l,B:l},i&&(l.R=((s=1.75)*l.R+e.R)/(c=s+1),l.G=(s*l.G+e.G)/c,l.B=(s*l.B+e.B)/c),l):(u=o[t],d=function(e){var t=e.X+e.Y+e.Z;return 0===t?{x:0,y:0,Y:e.Y}:{x:e.X/t,y:e.Y/t,Y:e.Y}}(function(e){var t=a,n={},r=e.R/255,o=e.G/255,i=e.B/255;return r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,o=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,n.X=r*t[0]+o*t[3]+i*t[6],n.Y=r*t[1]+o*t[4]+i*t[7],n.Z=r*t[2]+o*t[5]+i*t[8],n}(e)),(l={}).X=(m=(u.yi-(h=d.y-d.x*(f=(d.y-u.y)/(d.x-u.x))))/(f-u.m))*d.Y/(p=f*m+h),l.Y=d.Y,l.Z=(1-(m+p))*d.Y/p,y=(g=.312713*d.Y/.329016-l.X)*(k=r)[0]+0*k[3]+(b=.358271*d.Y/.329016-l.Z)*k[6],v=g*k[1]+0*k[4]+b*k[7],_=g*k[2]+0*k[5]+b*k[8],l.R=l.X*k[0]+l.Y*k[3]+l.Z*k[6],l.G=l.X*k[1]+l.Y*k[4]+l.Z*k[7],l.B=l.X*k[2]+l.Y*k[5]+l.Z*k[8],(w=(w=((l.B<0?0:1)-l.B)/_)>1||w<0?0:w)>(M=(x=(x=((l.R<0?0:1)-l.R)/y)>1||x<0?0:x)>(C=(C=((l.G<0?0:1)-l.G)/v)>1||C<0?0:C)?x:C)&&(M=w),l.R+=M*y,l.G+=M*v,l.B+=M*_,l.R=255*(l.R<=0?0:l.R>=1?1:Math.pow(l.R,1/n)),l.G=255*(l.G<=0?0:l.G>=1?1:Math.pow(l.G,1/n)),l.B=255*(l.B<=0?0:l.B>=1?1:Math.pow(l.B,1/n)),i&&(l.R=((s=1.75)*l.R+e.R)/(c=s+1),l.G=(s*l.G+e.G)/c,l.B=(s*l.B+e.B)/c),l)}},"./node_modules/.pnpm/color-blind@0.1.3/node_modules/color-blind/lib/color-blind.js"(e,t,n){"use strict";var r=n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/index.js"),a=n("./node_modules/.pnpm/color-blind@0.1.3/node_modules/color-blind/lib/blind.js").e,o={protanomaly:{type:"protan",anomalize:!0},protanopia:{type:"protan"},deuteranomaly:{type:"deutan",anomalize:!0},deuteranopia:{type:"deutan"},tritanomaly:{type:"tritan",anomalize:!0},tritanopia:{type:"tritan"},achromatomaly:{type:"achroma",anomalize:!0},achromatopsia:{type:"achroma"}},i=function(e){return Math.round(255*e)},l=function(e){return function(t,n){var l=r(t);if(!l)return n?{R:0,G:0,B:0}:"#000000";var s=new a({R:i(l.red()||0),G:i(l.green()||0),B:i(l.blue()||0)},o[e].type,o[e].anomalize);return s.R=s.R||0,s.G=s.G||0,s.B=s.B||0,n?(delete s.X,delete s.Y,delete s.Z,s):new r.RGB(s.R%256/255,s.G%256/255,s.B%256/255,1).hex()}};for(var s in o)t[s]=l(s)},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/index.js"(e,t,n){e.exports=n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/color.js").use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/XYZ.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/LAB.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSV.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/CMYK.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/namedColors.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/clearer.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/contrast.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/darken.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/desaturate.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/grayscale.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isDark.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isLight.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/lighten.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/luminance.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/mix.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/negate.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/opaquer.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/rotate.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/saturate.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/toAlpha.js"))},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/CMYK.js"(e){e.exports=function(e){e.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new e.RGB(1-this._cyan*(1-this._black)-this._black,1-this._magenta*(1-this._black)-this._black,1-this._yellow*(1-this._black)-this._black,this._alpha)},fromRgb:function(){var t=this._red,n=this._green,r=this._blue,a=1-t,o=1-n,i=1-r,l=1;return t||n||r?(a=(a-(l=Math.min(a,Math.min(o,i))))/(1-l),o=(o-l)/(1-l),i=(i-l)/(1-l)):l=1,new e.CMYK(a,o,i,l,this._alpha)}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSV.js")),e.installColorSpace("HSL",["hue","saturation","lightness","alpha"],{hsv:function(){var t=2*this._lightness,n=this._saturation*(t<=1?t:2-t);return new e.HSV(this._hue,t+n<1e-9?0:2*n/(t+n),(t+n)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSV.js"(e){e.exports=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t,n,r,a=this._hue,o=this._saturation,i=this._value,l=Math.min(5,Math.floor(6*a)),s=6*a-l,c=i*(1-o),u=i*(1-s*o),d=i*(1-(1-s)*o);switch(l){case 0:t=i,n=d,r=c;break;case 1:t=u,n=i,r=c;break;case 2:t=c,n=i,r=d;break;case 3:t=c,n=u,r=i;break;case 4:t=d,n=c,r=i;break;case 5:t=i,n=c,r=u}return new e.RGB(t,n,r,this._alpha)},hsl:function(){var t=(2-this._saturation)*this._value,n=t<=1?t:2-t;return new e.HSL(this._hue,n<1e-9?0:this._saturation*this._value/n,t/2,this._alpha)},fromRgb:function(){var t,n=this._red,r=this._green,a=this._blue,o=Math.max(n,r,a),i=o-Math.min(n,r,a),l=0===o?0:i/o,s=o;if(0===i)t=0;else switch(o){case n:t=(r-a)/i/6+(r<a?1:0);break;case r:t=(a-n)/i/6+1/3;break;case a:t=(n-r)/i/6+2/3}return new e.HSV(t,l,s,this._alpha)}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/LAB.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/XYZ.js")),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var t=function(e){var t=Math.pow(e,3);return t>.008856?t:(e-16/116)/7.87},n=(this._l+16)/116,r=n-this._b/200;return new e.XYZ(95.047*t(this._a/500+n),100*t(n),108.883*t(r),this._alpha)}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/XYZ.js"(e){e.exports=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},n=t(this._red),r=t(this._green),a=t(this._blue);return new e.XYZ(.4124564*n+.3575761*r+.1804375*a,.2126729*n+.7151522*r+.072175*a,.0193339*n+.119192*r+.9503041*a,this._alpha)},rgb:function(){var t=this._x,n=this._y,r=this._z,a=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(a(3.2404542*t+-1.5371385*n+-.4985314*r),a(-.969266*t+1.8760108*n+.041556*r),a(.0556434*t+-.2040259*n+1.0572252*r),this._alpha)},lab:function(){var t=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},n=t(this._x/95.047),r=t(this._y/100),a=t(this._z/108.883);return new e.LAB(116*r-16,500*(n-r),200*(r-a),this._alpha)}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/color.js"(e){var t=[],n=function(e){return void 0===e},r=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,a=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,o=new RegExp("^(rgb|hsl|hsv)a?\\("+r.source+","+r.source+","+r.source+"(?:,"+/\s*(\.\d+|\d+(?:\.\d+)?)\s*/.source+")?\\)$","i");function i(e){if(Array.isArray(e)){if("string"==typeof e[0]&&"function"==typeof i[e[0]])return new i[e[0]](e.slice(1,e.length));if(4===e.length)return new i.RGB(e[0]/255,e[1]/255,e[2]/255,e[3]/255)}else if("string"==typeof e){var t=e.toLowerCase();i.namedColors[t]&&(e="#"+i.namedColors[t]),"transparent"===t&&(e="rgba(0,0,0,0)");var r=e.match(o);if(r){var l=r[1].toUpperCase(),s=n(r[8])?r[8]:parseFloat(r[8]),c="H"===l[0],u=r[3]?100:c?360:255,d=r[5]||c?100:255,f=r[7]||c?100:255;if(n(i[l]))throw new Error("color."+l+" is not installed.");return new i[l](parseFloat(r[2])/u,parseFloat(r[4])/d,parseFloat(r[6])/f,s)}e.length<6&&(e=e.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var h=e.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(h)return new i.RGB(parseInt(h[1],16)/255,parseInt(h[2],16)/255,parseInt(h[3],16)/255);if(i.CMYK){var m=e.match(new RegExp("^cmyk\\("+a.source+","+a.source+","+a.source+","+a.source+"\\)$","i"));if(m)return new i.CMYK(parseFloat(m[1])/100,parseFloat(m[2])/100,parseFloat(m[3])/100,parseFloat(m[4])/100)}}else if("object"==typeof e&&e.isColor)return e;return!1}i.namedColors={},i.installColorSpace=function(e,r,a){i[e]=function(t){var n=Array.isArray(t)?t:arguments;r.forEach(function(t,a){var o=n[a];if("alpha"===t)this._alpha=isNaN(o)||o>1?1:o<0?0:o;else{if(isNaN(o))throw new Error("["+e+"]: Invalid color: ("+r.join(",")+")");"hue"===t?this._hue=o<0?o-Math.floor(o):o%1:this["_"+t]=o<0?0:o>1?1:o}},this)},i[e].propertyNames=r;var o=i[e].prototype;for(var l in["valueOf","hex","hexa","css","cssa"].forEach(function(t){o[t]=o[t]||("RGB"===e?o.hex:function(){return this.rgb()[t]()})}),o.isColor=!0,o.equals=function(t,a){n(a)&&(a=1e-10),t=t[e.toLowerCase()]();for(var o=0;o<r.length;o+=1)if(Math.abs(this["_"+r[o]]-t["_"+r[o]])>a)return!1;return!0},o.toJSON=function(){return[e].concat(r.map(function(e){return this["_"+e]},this))},a)if(a.hasOwnProperty(l)){var s=l.match(/^from(.*)$/);s?i[s[1].toUpperCase()].prototype[e.toLowerCase()]=a[l]:o[l]=a[l]}function c(e,t){var n={};for(var r in n[t.toLowerCase()]=function(){return this.rgb()[t.toLowerCase()]()},i[t].propertyNames.forEach(function(e){var r="black"===e?"k":e.charAt(0);n[e]=n[r]=function(n,r){return this[t.toLowerCase()]()[e](n,r)}}),n)n.hasOwnProperty(r)&&void 0===i[e].prototype[r]&&(i[e].prototype[r]=n[r])}return o[e.toLowerCase()]=function(){return this},o.toString=function(){return"["+e+" "+r.map(function(e){return this["_"+e]},this).join(", ")+"]"},r.forEach(function(e){var t="black"===e?"k":e.charAt(0);o[e]=o[t]=function(t,n){return void 0===t?this["_"+e]:new this.constructor(r.map(n?function(n){return this["_"+n]+(e===n?t:0)}:function(n){return e===n?t:this["_"+n]},this))}}),t.forEach(function(t){c(e,t),c(t,e)}),t.push(e),i},i.pluginList=[],i.use=function(e){return-1===i.pluginList.indexOf(e)&&(this.pluginList.push(e),e(i)),i},i.installMethod=function(e,n){return t.forEach(function(t){i[t].prototype[e]=n}),this},i.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-e.length)+e+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}}),e.exports=i},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/clearer.js"(e){e.exports=function(e){e.installMethod("clearer",function(e){return this.alpha(isNaN(e)?-.1:-e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/contrast.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/luminance.js")),e.installMethod("contrast",function(e){var t=this.luminance(),n=e.luminance();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/darken.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("darken",function(e){return this.lightness(isNaN(e)?-.1:-e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/desaturate.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("desaturate",function(e){return this.saturation(isNaN(e)?-.1:-e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/grayscale.js"(e){e.exports=function(e){function t(){var t=this.rgb(),n=.3*t._red+.59*t._green+.11*t._blue;return new e.RGB(n,n,n,t._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isDark.js"(e){e.exports=function(e){e.installMethod("isDark",function(){var e=this.rgb();return(255*e._red*299+255*e._green*587+255*e._blue*114)/1e3<128})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isLight.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isDark.js")),e.installMethod("isLight",function(){return!this.isDark()})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/lighten.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("lighten",function(e){return this.lightness(isNaN(e)?.1:e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/luminance.js"(e){e.exports=function(e){function t(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}e.installMethod("luminance",function(){var e=this.rgb();return.2126*t(e._red)+.7152*t(e._green)+.0722*t(e._blue)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/mix.js"(e){e.exports=function(e){e.installMethod("mix",function(t,n){t=e(t).rgb();var r=2*(n=1-(isNaN(n)?.5:n))-1,a=this._alpha-t._alpha,o=((r*a===-1?r:(r+a)/(1+r*a))+1)/2,i=1-o,l=this.rgb();return new e.RGB(l._red*o+t._red*i,l._green*o+t._green*i,l._blue*o+t._blue*i,l._alpha*n+t._alpha*(1-n))})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/namedColors.js"(e){e.exports=function(e){e.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/negate.js"(e){e.exports=function(e){e.installMethod("negate",function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/opaquer.js"(e){e.exports=function(e){e.installMethod("opaquer",function(e){return this.alpha(isNaN(e)?.1:e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/rotate.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("rotate",function(e){return this.hue((e||0)/360,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/saturate.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("saturate",function(e){return this.saturation(isNaN(e)?.1:e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/toAlpha.js"(e){e.exports=function(e){e.installMethod("toAlpha",function(e){var t=this.rgb(),n=e(e).rgb(),r=new e.RGB(0,0,0,t._alpha),a=["_red","_green","_blue"];return a.forEach(function(e){r[e]=t[e]<1e-10?t[e]:t[e]>n[e]?(t[e]-n[e])/(1-n[e]):t[e]>n[e]?(n[e]-t[e])/n[e]:0}),t._alpha=r._red>r._green?r._red>r._blue?r._red:r._blue:r._green>r._blue?r._green:r._blue,t._alpha<1e-10||(a.forEach(function(e){t[e]=(t[e]-n[e])/t._alpha+n[e]}),t._alpha*=r._alpha),t})}},"./node_modules/.pnpm/quantize@1.0.2/node_modules/quantize/quantize.js"(e){if(!t)var t={map:function(e,t){var n={};return t?e.map(function(e,r){return n.index=r,t.call(n,e)}):e.slice()},naturalOrder:function(e,t){return e<t?-1:e>t?1:0},sum:function(e,t){var n={};return e.reduce(t?function(e,r,a){return n.index=a,e+t.call(n,r)}:function(e,t){return e+t},0)},max:function(e,n){return Math.max.apply(null,n?t.map(e,n):e)}};var n=function(){function e(e,t,n){return(e<<10)+(t<<5)+n}function n(e){var t=[],n=!1;function r(){t.sort(e),n=!0}return{push:function(e){t.push(e),n=!1},peek:function(e){return n||r(),void 0===e&&(e=t.length-1),t[e]},pop:function(){return n||r(),t.pop()},size:function(){return t.length},map:function(e){return t.map(e)},debug:function(){return n||r(),t}}}function r(e,t,n,r,a,o,i){var l=this;l.r1=e,l.r2=t,l.g1=n,l.g2=r,l.b1=a,l.b2=o,l.histo=i}function a(){this.vboxes=new n(function(e,n){return t.naturalOrder(e.vbox.count()*e.vbox.volume(),n.vbox.count()*n.vbox.volume())})}function o(n,r){if(r.count()){var a=r.r2-r.r1+1,o=r.g2-r.g1+1,i=t.max([a,o,r.b2-r.b1+1]);if(1==r.count())return[r.copy()];var l,s,c,u,d=0,f=[],h=[];if(i==a)for(l=r.r1;l<=r.r2;l++){for(u=0,s=r.g1;s<=r.g2;s++)for(c=r.b1;c<=r.b2;c++)u+=n[e(l,s,c)]||0;f[l]=d+=u}else if(i==o)for(l=r.g1;l<=r.g2;l++){for(u=0,s=r.r1;s<=r.r2;s++)for(c=r.b1;c<=r.b2;c++)u+=n[e(s,l,c)]||0;f[l]=d+=u}else for(l=r.b1;l<=r.b2;l++){for(u=0,s=r.r1;s<=r.r2;s++)for(c=r.g1;c<=r.g2;c++)u+=n[e(s,c,l)]||0;f[l]=d+=u}return f.forEach(function(e,t){h[t]=d-e}),m(i==a?"r":i==o?"g":"b")}function m(e){var t,n,a,o,i,s=e+"1",c=e+"2",u=0;for(l=r[s];l<=r[c];l++)if(f[l]>d/2){for(a=r.copy(),o=r.copy(),i=(t=l-r[s])<=(n=r[c]-l)?Math.min(r[c]-1,~~(l+n/2)):Math.max(r[s],~~(l-1-t/2));!f[i];)i++;for(u=h[i];!u&&f[i-1];)u=h[--i];return a[c]=i,o[s]=a[c]+1,[a,o]}}}return r.prototype={volume:function(e){var t=this;return t._volume&&!e||(t._volume=(t.r2-t.r1+1)*(t.g2-t.g1+1)*(t.b2-t.b1+1)),t._volume},count:function(t){var n=this,r=n.histo;if(!n._count_set||t){var a,o,i,l=0;for(a=n.r1;a<=n.r2;a++)for(o=n.g1;o<=n.g2;o++)for(i=n.b1;i<=n.b2;i++)l+=r[e(a,o,i)]||0;n._count=l,n._count_set=!0}return n._count},copy:function(){var e=this;return new r(e.r1,e.r2,e.g1,e.g2,e.b1,e.b2,e.histo)},avg:function(t){var n=this,r=n.histo;if(!n._avg||t){var a,o,i,l,s=0,c=0,u=0,d=0;for(o=n.r1;o<=n.r2;o++)for(i=n.g1;i<=n.g2;i++)for(l=n.b1;l<=n.b2;l++)s+=a=r[e(o,i,l)]||0,c+=a*(o+.5)*8,u+=a*(i+.5)*8,d+=a*(l+.5)*8;n._avg=s?[~~(c/s),~~(u/s),~~(d/s)]:[~~(8*(n.r1+n.r2+1)/2),~~(8*(n.g1+n.g2+1)/2),~~(8*(n.b1+n.b2+1)/2)]}return n._avg},contains:function(e){var t=this,n=e[0]>>3;return gval=e[1]>>3,bval=e[2]>>3,n>=t.r1&&n<=t.r2&&gval>=t.g1&&gval<=t.g2&&bval>=t.b1&&bval<=t.b2}},a.prototype={push:function(e){this.vboxes.push({vbox:e,color:e.avg()})},palette:function(){return this.vboxes.map(function(e){return e.color})},size:function(){return this.vboxes.size()},map:function(e){for(var t=this.vboxes,n=0;n<t.size();n++)if(t.peek(n).vbox.contains(e))return t.peek(n).color;return this.nearest(e)},nearest:function(e){for(var t,n,r,a=this.vboxes,o=0;o<a.size();o++)((n=Math.sqrt(Math.pow(e[0]-a.peek(o).color[0],2)+Math.pow(e[1]-a.peek(o).color[1],2)+Math.pow(e[2]-a.peek(o).color[2],2)))<t||void 0===t)&&(t=n,r=a.peek(o).color);return r},forcebw:function(){var e=this.vboxes;e.sort(function(e,n){return t.naturalOrder(t.sum(e.color),t.sum(n.color))});var n=e[0].color;n[0]<5&&n[1]<5&&n[2]<5&&(e[0].color=[0,0,0]);var r=e.length-1,a=e[r].color;a[0]>251&&a[1]>251&&a[2]>251&&(e[r].color=[255,255,255])}},{quantize:function(i,l){if(!i.length||l<2||l>256)return!1;var s=function(t){var n,r=new Array(32768);return t.forEach(function(t){n=e(t[0]>>3,t[1]>>3,t[2]>>3),r[n]=(r[n]||0)+1}),r}(i);s.forEach(function(){0});var c=function(e,t){var n,a,o,i=1e6,l=0,s=1e6,c=0,u=1e6,d=0;return e.forEach(function(e){(n=e[0]>>3)<i?i=n:n>l&&(l=n),(a=e[1]>>3)<s?s=a:a>c&&(c=a),(o=e[2]>>3)<u?u=o:o>d&&(d=o)}),new r(i,l,s,c,u,d,t)}(i,s),u=new n(function(e,n){return t.naturalOrder(e.count(),n.count())});function d(e,t){for(var n,r=1,a=0;a<1e3;)if((n=e.pop()).count()){var i=o(s,n),l=i[0],c=i[1];if(!l)return;if(e.push(l),c&&(e.push(c),r++),r>=t)return;if(a++>1e3)return}else e.push(n),a++}u.push(c),d(u,.75*l);for(var f=new n(function(e,n){return t.naturalOrder(e.count()*e.volume(),n.count()*n.volume())});u.size();)f.push(u.pop());d(f,l-f.size());for(var h=new a;f.size();)h.push(f.pop());return h}}}();e.exports=n.quantize}}]);
1
+ (self.webpackChunkdash_antd_components=self.webpackChunkdash_antd_components||[]).push([["async-chart-ava"],{"./node_modules/.pnpm/@antv+g2-extension-ava@0.2.0_@antv+g2@5.4.8_@antv+g2plot@2.4.35_@antv+g6@4.8.25/node_modules/@antv/g2-extension-ava/esm/index.js"(e,t,n){"use strict";n.d(t,{Auto:()=>uo});var r=n("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),a={line_chart:{id:"line_chart",name:"Line Chart",alias:["Lines"],family:["LineCharts"],def:"A line chart uses lines with segments to show changes in data in a ordinal dimension.",purpose:["Comparison","Trend","Anomaly"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position","Direction"],recRate:"Recommended"},step_line_chart:{id:"step_line_chart",name:"Step Line Chart",alias:["Step Lines"],family:["LineCharts"],def:"A step line chart is a line chart in which points of each line are connected by horizontal and vertical line segments, looking like steps of a staircase.",purpose:["Comparison","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Lines"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position","Direction"],recRate:"Recommended"},area_chart:{id:"area_chart",name:"Area Chart",alias:[],family:["AreaCharts"],def:"An area chart uses series of line segments with overlapped areas to show the change in data in a ordinal dimension.",purpose:["Comparison","Trend","Anomaly"],coord:["Cartesian2D"],category:["Statistic"],shape:["Area"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Position"],recRate:"Recommended"},stacked_area_chart:{id:"stacked_area_chart",name:"Stacked Area Chart",alias:[],family:["AreaCharts"],def:"A stacked area chart uses layered line segments with different styles of padding regions to display how multiple sets of data change in the same ordinal dimension, and the endpoint heights of the segments on the same dimension tick are accumulated by value.",purpose:["Composition","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Area"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Length"],recRate:"Recommended"},percent_stacked_area_chart:{id:"percent_stacked_area_chart",name:"Percent Stacked Area Chart",alias:["Percent Stacked Area","% Stacked Area","100% Stacked Area"],family:["AreaCharts"],def:"A percent stacked area chart is an extented stacked area chart in which the height of the endpoints of the line segment on the same dimension tick is the accumulated proportion of the ratio, which is 100% of the total.",purpose:["Comparison","Composition","Proportion","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Area"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Length"],recRate:"Recommended"},column_chart:{id:"column_chart",name:"Column Chart",alias:["Columns"],family:["ColumnCharts"],def:"A column chart uses series of columns to display the value of the dimension. The horizontal axis shows the classification dimension and the vertical axis shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position","Color"],recRate:"Recommended"},grouped_column_chart:{id:"grouped_column_chart",name:"Grouped Column Chart",alias:["Grouped Column"],family:["ColumnCharts"],def:"A grouped column chart uses columns of different colors to form a group to display the values of dimensions. The horizontal axis indicates the grouping of categories, the color indicates the categories, and the vertical axis shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Position"],recRate:"Recommended"},stacked_column_chart:{id:"stacked_column_chart",name:"Stacked Column Chart",alias:["Stacked Column"],family:["ColumnCharts"],def:"A stacked column chart uses stacked bars of different colors to display the values for each dimension. The horizontal axis indicates the first classification dimension, the color indicates the second classification dimension, and the vertical axis shows the corresponding value.",purpose:["Comparison","Composition","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length","Position"],recRate:"Recommended"},percent_stacked_column_chart:{id:"percent_stacked_column_chart",name:"Percent Stacked Column Chart",alias:["Percent Stacked Column","% Stacked Column","100% Stacked Column"],family:["ColumnCharts"],def:"A percent stacked column chart uses stacked bars of different colors to display the values for each dimension. The horizontal axis indicates the first classification dimension, the color indicates the second classification dimension, and the vertical axis shows the percentage of the corresponding classification.",purpose:["Comparison","Composition","Distribution","Proportion"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length"],recRate:"Recommended"},range_column_chart:{id:"range_column_chart",name:"Range Column Chart",alias:[],family:["ColumnCharts"],def:"A column chart that does not have to start from zero axis.",purpose:["Comparison"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Interval","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Length"],recRate:"Recommended"},waterfall_chart:{id:"waterfall_chart",name:"Waterfall Chart",alias:["Flying Bricks Chart","Mario Chart","Bridge Chart","Cascade Chart"],family:["ColumnCharts"],def:"A waterfall chart is used to portray how an initial value is affected by a series of intermediate positive or negative values",purpose:["Comparison","Trend"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Ordinal","Time","Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length","Position"],recRate:"Recommended"},histogram:{id:"histogram",name:"Histogram",alias:[],family:["ColumnCharts"],def:"A histogram is an accurate representation of the distribution of numerical data.",purpose:["Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position"],recRate:"Recommended"},bar_chart:{id:"bar_chart",name:"Bar Chart",alias:["Bars"],family:["BarCharts"],def:"A bar chart uses series of bars to display the value of the dimension. The vertical axis shows the classification dimension and the horizontal axis shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position","Color"],recRate:"Recommended"},stacked_bar_chart:{id:"stacked_bar_chart",name:"Stacked Bar Chart",alias:["Stacked Bar"],family:["BarCharts"],def:"A stacked bar chart uses stacked bars of different colors to display the values for each dimension. The vertical axis indicates the first classification dimension, the color indicates the second classification dimension, and the horizontal axis shows the corresponding value.",purpose:["Comparison","Composition","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length","Position"],recRate:"Recommended"},percent_stacked_bar_chart:{id:"percent_stacked_bar_chart",name:"Percent Stacked Bar Chart",alias:["Percent Stacked Bar","% Stacked Bar","100% Stacked Bar"],family:["BarCharts"],def:"A percent stacked column chart uses stacked bars of different colors to display the values for each dimension. The vertical axis indicates the first classification dimension, the color indicates the second classification dimension, and the horizontal axis shows the percentage of the corresponding classification.",purpose:["Comparison","Composition","Distribution","Proportion"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length"],recRate:"Recommended"},grouped_bar_chart:{id:"grouped_bar_chart",name:"Grouped Bar Chart",alias:["Grouped Bar"],family:["BarCharts"],def:"A grouped bar chart uses bars of different colors to form a group to display the values of the dimensions. The vertical axis indicates the grouping of categories, the color indicates the categories, and the horizontal axis shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Position"],recRate:"Recommended"},range_bar_chart:{id:"range_bar_chart",name:"Range Bar Chart",alias:[],family:["BarCharts"],def:"A bar chart that does not have to start from zero axis.",purpose:["Comparison"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]}],channel:["Length"],recRate:"Recommended"},radial_bar_chart:{id:"radial_bar_chart",name:"Radial Bar Chart",alias:["Radial Column Chart"],family:["BarCharts"],def:"A bar chart that is plotted in the polar coordinate system. The axis along radius shows the classification dimension and the angle shows the corresponding value.",purpose:["Comparison","Distribution","Rank"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Angle","Color"],recRate:"Recommended"},bullet_chart:{id:"bullet_chart",name:"Bullet Chart",alias:[],family:["BarCharts"],def:"A bullet graph is a variation of a bar graph developed by Stephen Few. Seemingly inspired by the traditional thermometer charts and progress bars found in many dashboards, the bullet graph serves as a replacement for dashboard gauges and meters.",purpose:["Proportion"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:3,maxQty:3,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]}],channel:["Position","Color"],recRate:"Recommended"},pie_chart:{id:"pie_chart",name:"Pie Chart",alias:["Circle Chart","Pie"],family:["PieCharts"],def:"A pie chart is a chart that the classification and proportion of data are represented by the color and arc length (angle, area) of the sector.",purpose:["Comparison","Composition","Proportion"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Angle","Area","Color"],recRate:"Use with Caution"},donut_chart:{id:"donut_chart",name:"Donut Chart",alias:["Donut","Doughnut","Doughnut Chart","Ring Chart"],family:["PieCharts"],def:"A donut chart is a variation on a Pie chart except it has a round hole in the center which makes it look like a donut.",purpose:["Comparison","Composition","Proportion"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["ArcLength"],recRate:"Recommended"},nested_pie_chart:{id:"nested_pie_chart",name:"Nested Pie Chart",alias:["Nested Circle Chart","Nested Pie","Nested Donut Chart"],family:["PieCharts"],def:"A nested pie chart is a chart that contains several donut charts, where all the donut charts share the same center in position.",purpose:["Comparison","Composition","Proportion"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:"*",fieldConditions:["Interval"]}],channel:["Angle","Area","Color","Position"],recRate:"Use with Caution"},rose_chart:{id:"rose_chart",name:"Rose Chart",alias:["Nightingale Chart","Polar Area Chart","Coxcomb Chart"],family:["PieCharts"],def:"Nightingale Rose Chart is a peculiar combination of the Radar Chart and Stacked Column Chart types of data visualization.",purpose:["Comparison","Composition","Proportion"],coord:["Polar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Angle","Color","Length"],recRate:"Use with Caution"},scatter_plot:{id:"scatter_plot",name:"Scatter Plot",alias:["Scatter Chart","Scatterplot"],family:["ScatterCharts"],def:"A scatter plot is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for series of data.",purpose:["Comparison","Distribution","Anomaly"],coord:["Cartesian2D"],category:["Statistic"],shape:["Scatter"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Interval"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Position"],recRate:"Recommended"},bubble_chart:{id:"bubble_chart",name:"Bubble Chart",alias:["Bubble Chart"],family:["ScatterCharts"],def:"A bubble chart is a type of chart that displays four dimensions of data with x, y positions, circle size and circle color.",purpose:["Comparison","Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Scatter"],dataPres:[{minQty:3,maxQty:3,fieldConditions:["Interval"]},{minQty:0,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Position","Size"],recRate:"Recommended"},non_ribbon_chord_diagram:{id:"non_ribbon_chord_diagram",name:"Non-Ribbon Chord Diagram",alias:[],family:["GeneralGraph"],def:"A stripped-down version of a Chord Diagram, with only the connection lines showing. This provides more emphasis on the connections within the data.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},arc_diagram:{id:"arc_diagram",name:"Arc Diagram",alias:[],family:["GeneralGraph"],def:"A graph where the edges are represented as arcs.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},chord_diagram:{id:"chord_diagram",name:"Chord Diagram",alias:[],family:["GeneralGraph"],def:"A graphical method of displaying the inter-relationships between data in a matrix. The data are arranged radially around a circle with the relationships between the data points typically drawn as arcs connecting the data.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},treemap:{id:"treemap",name:"Treemap",alias:[],family:["TreeGraph"],def:"A visual representation of a data tree with nodes. Each node is displayed as a rectangle, sized and colored according to values that you assign.",purpose:["Composition","Comparison","Hierarchy"],coord:["Cartesian2D"],category:["Statistic"],shape:["Square"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Area"],recRate:"Recommended"},sankey_diagram:{id:"sankey_diagram",name:"Sankey Diagram",alias:[],family:["GeneralGraph"],def:"A graph shows the flows with weights between objects.",purpose:["Flow","Trend","Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},funnel_chart:{id:"funnel_chart",name:"Funnel Chart",alias:[],family:["FunnelCharts"],def:"A funnel chart is often used to represent stages in a sales process and show the amount of potential revenue for each stage.",purpose:["Trend"],coord:["SymmetricCartesian"],category:["Statistic"],shape:["Symmetric"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Length"],recRate:"Recommended"},mirror_funnel_chart:{id:"mirror_funnel_chart",name:"Mirror Funnel Chart",alias:["Contrast Funnel Chart"],family:["FunnelCharts"],def:"A mirror funnel chart is a funnel chart divided into two series by a central axis.",purpose:["Comparison","Trend"],coord:["SymmetricCartesian"],category:["Statistic"],shape:["Symmetric"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]},{minQty:1,maxQty:1,fieldConditions:["Nominal"]}],channel:["Color","Length","Direction"],recRate:"Recommended"},box_plot:{id:"box_plot",name:"Box Plot",alias:["Box and Whisker Plot","boxplot"],family:["BarCharts"],def:"A box plot is often used to graphically depict groups of numerical data through their quartiles. Box plots may also have lines extending from the boxes indicating variability outside the upper and lower quartiles. Outliers may be plotted as individual points.",purpose:["Distribution","Anomaly"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position"],recRate:"Recommended"},heatmap:{id:"heatmap",name:"Heatmap",alias:[],family:["HeatmapCharts"],def:"A heatmap is a graphical representation of data where the individual values contained in a matrix are represented as colors.",purpose:["Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Square"],dataPres:[{minQty:2,maxQty:2,fieldConditions:["Nominal","Ordinal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Position"],recRate:"Recommended"},density_heatmap:{id:"density_heatmap",name:"Density Heatmap",alias:["Heatmap"],family:["HeatmapCharts"],def:"A density heatmap is a heatmap for representing the density of dots.",purpose:["Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Area"],dataPres:[{minQty:3,maxQty:3,fieldConditions:["Interval"]}],channel:["Color","Position","Area"],recRate:"Recommended"},radar_chart:{id:"radar_chart",name:"Radar Chart",alias:["Web Chart","Spider Chart","Star Chart","Cobweb Chart","Irregular Polygon","Kiviat diagram"],family:["RadarCharts"],def:"A radar chart maps series of data volume of multiple dimensions onto the axes. Starting at the same center point, usually ending at the edge of the circle, connecting the same set of points using lines.",purpose:["Comparison"],coord:["Radar"],category:["Statistic"],shape:["Round"],dataPres:[{minQty:1,maxQty:2,fieldConditions:["Nominal"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Color","Position"],recRate:"Recommended"},wordcloud:{id:"wordcloud",name:"Word Cloud",alias:["Wordle","Tag Cloud","Text Cloud"],family:["Others"],def:"A word cloud is a collection, or cluster, of words depicted in different sizes, colors, and shapes, which takes a piece of text as input. Typically, the font size in the word cloud is encoded as the word frequency in the input text.",purpose:["Proportion"],coord:["Cartesian2D"],category:["Diagram"],shape:["Scatter"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Nominal"]},{minQty:0,maxQty:1,fieldConditions:["Interval"]}],channel:["Size","Position","Color"],recRate:"Recommended"},candlestick_chart:{id:"candlestick_chart",name:"Candlestick Chart",alias:["Japanese Candlestick Chart)"],family:["BarCharts"],def:"A candlestick chart is a specific version of box plot, which is a style of financial chart used to describe price movements of a security, derivative, or currency.",purpose:["Trend","Distribution"],coord:["Cartesian2D"],category:["Statistic"],shape:["Bars"],dataPres:[{minQty:1,maxQty:1,fieldConditions:["Time"]},{minQty:1,maxQty:1,fieldConditions:["Interval"]}],channel:["Position"],recRate:"Recommended"},compact_box_tree:{id:"compact_box_tree",name:"CompactBox Tree",alias:[],family:["TreeGraph"],def:"A type of tree graph layout which arranges the nodes with same depth on the same level.",purpose:["Relation","Hierarchy"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},dendrogram:{id:"dendrogram",name:"Dendrogram",alias:[],family:["TreeGraph"],def:"A type of tree graph layout which arranges the leaves on the same level.",purpose:["Relation","Hierarchy"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},indented_tree:{id:"indented_tree",name:"Indented Tree Layout",alias:[],family:["TreeGraph"],def:"A type of tree graph layout where the hierarchy of tree is represented by the horizontal indentation, and each element will occupy one row/column. It is commonly used to represent the file directory structure.",purpose:["Relation","Hierarchy"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},radial_tree:{id:"radial_tree",name:"Radial Tree Layout",alias:[],family:["TreeGraph"],def:"A type of tree graph layout which places the root at the center, and the branches around the root radially.",purpose:["Relation","Hierarchy"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},flow_diagram:{id:"flow_diagram",name:"Flow Diagram",alias:["Dagre Graph Layout","Dagre","Flow Chart"],family:["GeneralGraph"],def:"Directed flow graph.",purpose:["Relation","Flow"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},fruchterman_layout_graph:{id:"fruchterman_layout_graph",name:"Fruchterman Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of force directed graph layout.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},force_directed_layout_graph:{id:"force_directed_layout_graph",name:"Force Directed Graph Layout",alias:[],family:["GeneralGraph"],def:"The classical force directed graph layout.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},fa2_layout_graph:{id:"fa2_layout_graph",name:"Force Atlas 2 Graph Layout",alias:["FA2 Layout"],family:["GeneralGraph"],def:"A type of force directed graph layout algorithm. It focuses more on the degree of the node when calculating the force than the classical force-directed algorithm .",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},mds_layout_graph:{id:"mds_layout_graph",name:"Multi-Dimensional Scaling Layout",alias:["MDS Layout"],family:["GeneralGraph"],def:"A type of dimension reduction algorithm that could be used for calculating graph layout. MDS (Multidimensional scaling) is used for project high dimensional data onto low dimensional space.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},circular_layout_graph:{id:"circular_layout_graph",name:"Circular Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout which arranges all the nodes on a circle.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},spiral_layout_graph:{id:"spiral_layout_graph",name:"Spiral Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout which arranges all the nodes along a spiral line.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},radial_layout_graph:{id:"radial_layout_graph",name:"Radial Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout which places a focus node on the center and the others on the concentrics centered at the focus node according to the shortest path length to the it.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},concentric_layout_graph:{id:"concentric_layout_graph",name:"Concentric Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout which arranges the nodes on concentrics.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"},grid_layout_graph:{id:"grid_layout_graph",name:"Grid Graph Layout",alias:[],family:["GeneralGraph"],def:"A type of graph layout arranges the nodes on grids.",purpose:["Relation"],coord:["Cartesian2D"],category:["Graph"],shape:["Network"],dataPres:[{minQty:1,maxQty:"*",fieldConditions:["Nominal"]}],channel:["Color","Size","Opacity","Stroke","LineWidth"],recRate:"Recommended"}};function o(){return JSON.parse(JSON.stringify(a))}function i(e){var t=o();return e?function(e,t){var n=e,a=t.exclude,o=t.include,i=t.custom;return a&&a.forEach(function(e){Object.keys(n).includes(e)&&delete n[e]}),o&&Object.keys(n).forEach(function(e){o.includes(e)||delete n[e]}),(0,r.Cl)((0,r.Cl)({},n),i)}(t,e):t}function l(e,t){return t.every(function(t){return e.includes(t)})}var s=10,c=["bar_chart","grouped_bar_chart","stacked_bar_chart","percent_stacked_bar_chart","column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart"],u={id:"bar-series-qty",type:"SOFT",docs:{lintText:"Bar chart should has proper number of bars or bar groups."},trigger:function(e){return c.includes(e.chartType)},validator:function(e){var t=1,n=e.dataProps;if(n&&e.chartType){var r=n.find(function(e){return l(e.levelOfMeasurements,["Nominal"])}),a=r&&r.count?r.count:0;a>20&&(t=20/a)}return t=t<.1?.1:t}},d=["bar_chart","grouped_bar_chart","stacked_bar_chart","percent_stacked_bar_chart","column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart"],f={id:"bar-without-axis-min",type:"DESIGN",docs:{lintText:"It is not recommended to set the minimum value of axis for the bar or column chart.",fixText:"Remove the minimum value config of axis."},trigger:function(e){return d.includes(e.chartType)},optimizer:function(e,t){var n,r,a=t.scale;if(!a)return{};var o=null===(n=a.x)||void 0===n?void 0:n.domainMin,i=null===(r=a.y)||void 0===r?void 0:r.domainMin;if(o||i){var l=JSON.parse(JSON.stringify(a));return o&&(l.x.domainMin=0),i&&(l.y.domainMin=0),{scale:l}}return{}}};function h(e,t){return t.some(function(t){return e.includes(t)})}function m(e,t){return e.distinct<t.distinct?1:e.distinct>t.distinct?-1:0}var p={"bar-series-qty":.5,"data-check":1,"data-field-qty":1,"diff-pie-sector":.5,"landscape-or-portrait":.3,"limit-series":1,"line-field-time-ordinal":1,"no-redundant-field":1,"nominal-enum-combinatorial":1,"purpose-check":1,"series-qty-limit":.8},g=function(e,t,n,a,o,i){var l=1;return Object.values(n).filter(function(n){var i,l,s,c=(null===(i=n.option)||void 0===i?void 0:i.weight)||p[n.id]||1,u=null===(l=n.option)||void 0===l?void 0:l.extra;return n.type===a&&n.trigger((0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},o),{weight:c}),u),{chartType:e,chartWIKI:t}))&&!(null===(s=n.option)||void 0===s?void 0:s.off)}).forEach(function(n){var s,c,u=(null===(s=n.option)||void 0===s?void 0:s.weight)||p[n.id]||1,d=null===(c=n.option)||void 0===c?void 0:c.extra,f=n.validator((0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},o),{weight:u}),d),{chartType:e,chartWIKI:t})),h=u*f;l*=h,i.push({phase:"ADVISE",ruleId:n.id,score:h,base:f,weight:u,ruleType:a})}),l},b={id:"data-check",type:"HARD",docs:{lintText:"Data must satisfy the data prerequisites."},trigger:function(){return!0},validator:function(e){var t=0,n=e.dataProps,r=e.chartType,a=e.chartWIKI;if(n&&r&&a[r]){t=1;var o=a[r].dataPres||[];o.forEach(function(e){(function(e,t){var n=t.map(function(e){return e.levelOfMeasurements});if(n){var r=0;if(n.forEach(function(t){t&&h(t,e.fieldConditions)&&(r+=1)}),r>=e.minQty&&(r<=e.maxQty||"*"===e.maxQty))return!0}return!1})(e,n)||(t=0)}),n.map(function(e){return e.levelOfMeasurements}).forEach(function(e){var n=!1;o.forEach(function(t){e&&h(e,t.fieldConditions)&&(n=!0)}),n||(t=0)})}return t}},y=["pie_chart","donut_chart"],v={id:"diff-pie-sector",type:"SOFT",docs:{lintText:"The difference between sectors of a pie chart should be large enough."},trigger:function(e){return y.includes(e.chartType)},validator:function(e){var t=1,n=e.dataProps;if(n){var r=n.find(function(e){return l(e.levelOfMeasurements,["Interval"])});if(r&&r.sum&&r.rawData){var a=1/r.sum,o=r.rawData.map(function(e){return e*a}).reduce(function(e,t){return e*t}),i=r.rawData.length,s=Math.pow(1/i,i);t=Math.abs(s-Math.abs(o))/s*2}}return t=t<.1?.1:t}},_=["bar_chart","grouped_bar_chart","stacked_bar_chart","percent_stacked_bar_chart","column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart"];function x(e){var t=e.preferences;return!!(e.dataProps&&e.chartType&&t&&t.canvasLayout)}var w={id:"landscape-or-portrait",type:"SOFT",docs:{lintText:"Recommend column charts for landscape layout and bar charts for portrait layout."},trigger:function(e){return _.includes(e.chartType)&&x(e)},validator:function(e){var t=1,n=e.chartType,r=e.preferences;return x(e)&&("portrait"===r.canvasLayout&&["bar_chart","grouped_bar_chart","stacked_bar_chart","percent_stacked_bar_chart"].includes(n)||"landscape"===r.canvasLayout&&["column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart"].includes(n))&&(t=5),t}};var C={id:"limit-series",type:"SOFT",docs:{lintText:"Avoid too many values in one series."},trigger:function(e){return function(e){return e.filter(function(e){return h(e.levelOfMeasurements,["Nominal","Ordinal"])}).length>=2}(e.dataProps)},validator:function(e){var t=1,n=e.dataProps,r=e.chartType;if(n){var a=n.filter(function(e){return h(e.levelOfMeasurements,["Nominal","Ordinal"])});if(a.length>=2){var o=a.sort(m)[1];o.distinct&&(t=o.distinct>s?.1:1/o.distinct,o.distinct>6&&"heatmap"===r?t=5:"heatmap"===r&&(t=1))}}return t}},k=["line_chart","area_chart","stacked_area_chart","percent_stacked_area_chart"],M={id:"line-field-time-ordinal",type:"SOFT",docs:{lintText:"Data containing time or ordinal fields are suitable for line or area charts."},trigger:function(e){return k.includes(e.chartType)},validator:function(e){var t=1,n=e.dataProps;n&&(n.find(function(e){return h(e.levelOfMeasurements,["Ordinal","Time"])})&&(t=5));return t}},R=["bar_chart","column_chart","grouped_bar_chart","grouped_column_chart","stacked_bar_chart","stacked_column_chart"];function O(e){return e.filter(function(e){return l(e.levelOfMeasurements,["Nominal"])})}var N={id:"nominal-enum-combinatorial",type:"SOFT",docs:{lintText:"Single (Basic) and Multi (Stacked, Grouped,...) charts should be optimized recommended by nominal enums combinatorial numbers."},trigger:function(e){var t=e.dataProps;return R.includes(e.chartType)&&O(t).length>=2},validator:function(e){var t=1,n=e.dataProps,r=e.chartType;if(n){var a=O(n);if(a.length>=2){var o=a.sort(m),i=o[0],l=o[1];if(i.distinct===i.count&&["bar_chart","column_chart"].includes(r)&&(t=5),i.count&&i.distinct&&l.distinct&&i.count>i.distinct){["grouped_bar_chart","grouped_column_chart","stacked_bar_chart","stacked_column_chart"].includes(r)&&(t=5)}}}return t}},S=["pie_chart","donut_chart","radar_chart","rose_chart"],A={id:"series-qty-limit",type:"SOFT",docs:{lintText:"Some charts should has at most N values for the series."},trigger:function(e){return S.includes(e.chartType)},validator:function(e){var t=1,n=e.dataProps,r=e.chartType,a=e.limit;if((!Number.isInteger(a)||a<=0)&&(a=6,"pie_chart"!==r&&"donut_chart"!==r&&"rose_chart"!==r||(a=6),"radar_chart"===r&&(a=8)),n){var o=n.find(function(e){return l(e.levelOfMeasurements,["Nominal"])}),i=o&&o.count?o.count:0;i>=2&&i<=a&&(t=5+2/i)}return t}},Q=n("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");function D(e){return"number"==typeof e}function P(e){return"string"==typeof e||"boolean"==typeof e}function T(e){return e instanceof Date}function j(e,t,n){if(void 0!==n)return function(e){switch(e){case"linear":case"log":case"pow":case"sqrt":case"qunatile":case"threshold":case"quantize":case"sequential":return"quantitative";case"time":return"temporal";case"ordinal":case"point":case"band":return"categorical";default:throw new Error("Unkonwn scale type: ".concat(e,"."))}}(n);var r=function(e,t){return function(e){return"function"==typeof e}(t)?e.map(t):function(e,t){return"string"==typeof t&&e.some(function(e){return void 0!==e[t]})}(e,t)?e.map(function(e){return e[t]}):e.map(function(){return t})}(e,t);return function(e){if(e.some(D))return"quantitative";if(e.some(P))return"categorical";if(e.some(T))return"temporal";throw new Error("Unknown type: ".concat(typeof e[0]))}(r)}function L(e){var t=e.data,n=e.scale,a=(0,Q.mapValues)(e.encode,function(e,r){return{field:e,type:j(t,e,null==n?void 0:n[r].type)}});return(0,r.Cl)((0,r.Cl)({},e),{encode:a})}var G=["line_chart"],z={id:"x-axis-line-fading",type:"DESIGN",docs:{lintText:"Adjust axis to make it prettier"},trigger:function(e){return G.includes(e.chartType)},optimizer:function(e,t){var n,r=L(t).encode;if(r&&"quantitative"===(null===(n=r.y)||void 0===n?void 0:n.type)){var a=e.find(function(e){var t;return e.name===(null===(t=r.y)||void 0===t?void 0:t.field)});if(a){var o=a.maximum-a.minimum;if(a.minimum&&a.maximum&&o<2*a.maximum/3){var i=Math.floor(a.minimum-o/5);return{axis:{x:{tick:!1}},scale:{y:{domainMin:i>0?i:0}},clip:!0}}}}return{}}},I=((0,r.fX)((0,r.fX)([],(0,r.zs)(["data-check","data-field-qty","no-redundant-field","purpose-check"]),!1),(0,r.zs)(["series-qty-limit","bar-series-qty","line-field-time-ordinal","landscape-or-portrait","diff-pie-sector","nominal-enum-combinatorial","limit-series"]),!1),{"data-check":b,"data-field-qty":{id:"data-field-qty",type:"HARD",docs:{lintText:"Data must have at least the min qty of the prerequisite."},trigger:function(){return!0},validator:function(e){var t=0,n=e.dataProps,r=e.chartType,a=e.chartWIKI;if(n&&r&&a[r]){t=1;var o=(a[r].dataPres||[]).map(function(e){return e.minQty}).reduce(function(e,t){return e+t});if(n.length)n.length>=o&&(t=1)}return t}},"no-redundant-field":{id:"no-redundant-field",type:"HARD",docs:{lintText:"No redundant field."},trigger:function(){return!0},validator:function(e){var t=0,n=e.dataProps,r=e.chartType,a=e.chartWIKI;if(n&&r&&a[r]){var o=(a[r].dataPres||[]).map(function(e){return"*"===e.maxQty?99:e.maxQty}).reduce(function(e,t){return e+t});if(n.length)n.length<=o&&(t=1)}return t}},"purpose-check":{id:"purpose-check",type:"HARD",docs:{lintText:"Choose chart types that satisfy the purpose, if purpose is defined."},trigger:function(){return!0},validator:function(e){var t=0,n=e.chartType,r=e.purpose,a=e.chartWIKI;if(!r)return t=1;if(n&&a[n]&&r&&(a[n].purpose||"").includes(r))return t=1;return t}},"bar-series-qty":u,"diff-pie-sector":v,"landscape-or-portrait":w,"limit-series":C,"line-field-time-ordinal":M,"nominal-enum-combinatorial":N,"series-qty-limit":A,"x-axis-line-fading":z,"bar-without-axis-min":f}),B=Object.keys(I),E=function(e){var t={};return e.forEach(function(e){Object.keys(I).includes(e)&&(t[e]=I[e])}),t},q=[[!0,!1],[0,1],["true","false"],["Yes","No"],["True","False"],["0","1"],["是","否"]],Y="([-_./\\s])",F="(?<year>(18|19|20)\\d{2})",$="(?<month>0?[1-9]|1[012])",W="(?<day>0?[1-9]|[12]\\d|3[01])",H="(0?\\d|[012345]\\d)",X="(?<hour>".concat(H,")"),V="(?<minute>".concat(H,")"),Z="(?<second>".concat(H,")"),K="(?<offset>Z|[+-]".concat("(0?\\d|1\\d|2[0-4])","(:").concat(H,")?)");function J(e){return null==e||""===e||Number.isNaN(e)||"null"===e}function U(e){return"string"==typeof e}function ee(e){return"number"==typeof e}function te(e){if(U(e)){var t=!1,n=e;/^[+-]/.test(n)&&(n=n.slice(1));for(var r=0;r<n.length;r+=1){var a=n[r];if("."===a){if(!1!==t)return!1;t=!0}if("."!==a&&!/[0-9]/.test(a))return!1}return""!==n.trim()}return!1}function ne(e){return"number"==typeof e&&Number.isInteger(e)}function re(e){return!(!U(e)||!te(e))&&!e.includes(".")}function ae(e){return!(!U(e)||!te(e))&&e.includes(".")}function oe(e){return!(!e||Object.getPrototypeOf(e)!==Date.prototype)}function ie(e,t){return t?q.some(function(t){return e.every(function(e){return t.includes(e)})}):"boolean"==typeof e}function le(e){return e&&Object.getPrototypeOf(e)===Object.prototype}function se(e){return Array.isArray(e)}function ce(e){return!se(e)&&!le(e)}function ue(e){return(0,r.fX)([],(0,r.zs)(Array(e).keys()),!1)}function de(e,t){if(!e)throw new Error(t)}var fe=new WeakMap;function he(e,t,n){return fe.get(e)||fe.set(e,new Map),fe.get(e).set(t,n),n}function me(e,t){var n=fe.get(e);if(n)return n.get(t)}function pe(e){var t=me(e,"min");return void 0!==t?t:he(e,"min",Math.min.apply(Math,(0,r.fX)([],(0,r.zs)(e),!1)))}function ge(e){var t=me(e,"minIndex");return void 0!==t?t:he(e,"minIndex",function(e){for(var t=e[0],n=0,r=0;r<e.length;r+=1)e[r]<t&&(n=r,t=e[r]);return n}(e))}function be(e){var t=me(e,"max");return void 0!==t?t:he(e,"max",Math.max.apply(Math,(0,r.fX)([],(0,r.zs)(e),!1)))}function ye(e){var t=me(e,"maxIndex");return void 0!==t?t:he(e,"maxIndex",function(e){for(var t=e[0],n=0,r=0;r<e.length;r+=1)e[r]>t&&(n=r,t=e[r]);return n}(e))}function ve(e){var t=me(e,"sum");return void 0!==t?t:he(e,"sum",e.reduce(function(e,t){return t+e},0))}function _e(e){return ve(e)/e.length}function xe(e){return e.sort(function(e,t){return e>t?1:-1})}function we(e,t,n){return void 0===n&&(n=!1),de(t>0&&t<100,"The percent cannot be between (0, 100)."),(n?e:xe(e))[Math.ceil(e.length*t/100)-1]}function Ce(e){var t=_e(e),n=me(e,"variance");return void 0!==n?n:he(e,"variance",e.reduce(function(e,n){return e+Math.pow(n-t,2)},0)/e.length)}function ke(e){return Math.sqrt(Ce(e))}function Me(e,t){var n=function(e,t){return de(e.length===t.length,"The x and y must has same length."),_e(e.map(function(e,n){return e*t[n]}))-_e(e)*_e(t)}(e,t);return n/(ke(e)*ke(t))}function Re(e){var t={};return e.forEach(function(e){var n="".concat(e);t[n]?t[n]+=1:t[n]=1}),t}var Oe=function(e){var t,n=(void 0===(t=e)&&(t=!0),["".concat(F),"".concat(F).concat(Y).concat(t?"":"?","W").concat("(?<week>[0-4]\\d|5[0-2])","(").concat(Y).concat(t?"":"?").concat("(?<weekday>[1-7])",")?"),"".concat($).concat(Y).concat(t?"":"?").concat(W).concat(Y).concat(t?"":"?").concat(F),"".concat(F).concat(Y).concat(t?"":"?").concat($).concat(Y).concat(t?"":"?").concat(W),"".concat(F).concat(Y).concat(t?"":"?").concat($),"".concat(F).concat(Y).concat(t?"":"?").concat("(?<yearDay>(([0-2]\\d|3[0-5])\\d)|36[0-6])")]),a=function(e){return void 0===e&&(e=!0),["".concat(X,":").concat(e?"":"?").concat(V,":").concat(e?"":"?").concat(Z,"([.,]").concat("(?<millisecond>\\d{1,4})",")?").concat(K,"?"),"".concat(X,":").concat(e?"":"?").concat(V,"?").concat(K)]}(e),o=(0,r.fX)((0,r.fX)([],(0,r.zs)(n),!1),(0,r.zs)(a),!1);return n.forEach(function(e){a.forEach(function(t){o.push("".concat(e,"[T\\s]").concat(t))})}),o.map(function(e){return new RegExp("^".concat(e,"$"))})};function Ne(e,t){if(U(e))for(var n=Oe(t),r=0;r<n.length;r+=1){if(n[r].test(e.trim()))return!0}return!1}function Se(e){var t=e.rawData;if("string"!==e.recommendation)return!1;if(function(e){return 1===e.distinct}(e))return!1;var n=t.filter(function(e){return!J(e)&&ce(e)});if(0===n.length)return!1;for(var r=null,a=null,o=-1,i=-1,l=!0;l;){for(var s=!0,c=0;c<n.length;c+=1){var u=(f=n[c])[o+1];if(null!==r&&0!==c||(r=u),u!==r){s=!1;break}}if(!s)break;o+=1}for(l=!0;l;){var d=!0;for(c=0;c<n.length;c+=1){var f;u=(f=n[c])[f.length-1-(i+1)];if(null!==a&&0!==c||(a=u),u!==a){d=!1;break}}if(!d)break;i+=1}var h=[/\d+/,/(零|一|二|三|四|五|六|七|八|九|十)+/,/(一|二|三|四|五|六|日)/,/^[a-z]$/,/^[A-Z]$/];if(-1===o&&-1===i)return!1;var m=n.map(function(e){return e.slice(-1===o?0:o+1,-1===i?void 0:e.length-i-1)}),p=function(e){var t=h[e],n=m.some(function(e){return!t.test(e)});if(!n)return{value:!0}};for(c=0;c<h.length;c+=1){var g=p(c);if("object"==typeof g)return g.value}return!1}function Ae(e,t){return J(e)?"null":ee(e)?ne(e)?"integer":"float":oe(e)||Ne(e,t)?"date":U(e)&&te(e)?e.includes(".")?"float":"integer":"string"}function Qe(e,t){var n,r=e.map(function(e){return J(e)?null:e}),a=Re(r),o=a.null?r.filter(function(e){return null!==e}):r,i=r.map(function(e){return Ae(e,t)}),l=Object.keys(Re(i)).filter(function(e){return"null"!==e});switch(l.length){case 0:n="null";break;case 1:if("integer"===(n=l[0]))r.filter(function(e){return null!==e}).map(function(e){return"".concat(e)}).every(function(e){return Ne(e)})&&(n="date");break;case 2:if((l.includes("integer")||l.includes("date"))&&l.includes("float")){n="float";break}if(l.includes("integer")&&l.includes("date")){n=r.filter(function(e){return null!==e}).map(function(e){return"".concat(e)}).every(function(e){return Ne(e)})?"date":"integer";break}n="string";break;default:n="string"}var s=function(e){return Array.from(new Set(e))}(o),c={count:e.length,distinct:s.length,type:l.length<=1?l[0]||"null":"mixed",recommendation:n,missing:a.null||0,rawData:e,valueMap:a};if(l.length>1){var u={},d=o;l.forEach(function(e){"date"===e?(u.date=Qe(d.filter(function(e){return Ne(e)}),t),d=d.filter(function(e){return!Ne(e)})):"integer"===e?(u.integer=Qe(d.filter(function(e){return re(e)&&!Ne(e)}),t),d=d.filter(function(e){return!re(e)})):"float"===e?(u.float=Qe(d.filter(function(e){return ae(e)&&!Ne(e)}),t),d=d.filter(function(e){return!ae(e)})):"string"===e&&(u.string=Qe(d.filter(function(e){return"string"===Ae(e,t)})),d=d.filter(function(e){return"string"!==Ae(e,t)}))}),c.meta=u}2===c.distinct&&"date"!==c.recommendation&&(r.length>=100||ie(s,!0))&&(c.recommendation="boolean"),"string"===n&&Object.assign(c,function(e){var t=e.map(function(e){return e.length});return{maxLength:be(t),minLength:pe(t),meanLength:_e(t),containsChar:e.some(function(e){return/[A-z]/.test(e)}),containsDigit:e.some(function(e){return/[0-9]/.test(e)}),containsSpace:e.some(function(e){return/\s/.test(e)})}}(o.map(function(e){return"".concat(e)}))),"integer"!==n&&"float"!==n||Object.assign(c,function(e){return{minimum:pe(e),maximum:be(e),mean:_e(e),percentile5:we(e,5),percentile25:we(e,25),percentile50:we(e,50),percentile75:we(e,75),percentile95:we(e,95),sum:ve(e),variance:Ce(e),standardDeviation:ke(e),zeros:e.filter(function(e){return 0===e}).length}}(o.map(function(e){return 1*e}))),"date"===n&&Object.assign(c,function(e,t){void 0===t&&(t=!1);var n=e.map(function(e){if(t){var n="".concat(e);if(8===n.length)return new Date("".concat(n.substring(0,4),"/").concat(n.substring(4,2),"/").concat(n.substring(6,2))).getTime()}return new Date(e).getTime()});return{minimum:e[ge(n)],maximum:e[ye(n)]}}(o,"integer"===c.type));var f,h=[];return("boolean"===(f=c).recommendation||"string"===f.recommendation&&!Se(f))&&h.push("Nominal"),Se(c)&&h.push("Ordinal"),function(e){return"integer"===e.recommendation||"float"===e.recommendation}(c)&&h.push("Interval"),function(e){return"integer"===e.recommendation}(c)&&h.push("Discrete"),function(e){return"float"===e.recommendation}(c)&&h.push("Continuous"),function(e){return"date"===e.recommendation}(c)&&h.push("Time"),c.levelOfMeasurements=h,c}function De(e){return ee(e)||U(e)}function Pe(e,t){return de(se(e),"Data must be an array"),t?(de((null==t?void 0:t.length)===e.length,"Index length is ".concat(null==t?void 0:t.length,", but data size is ").concat(e.length)),t):ue(e.length)}function Te(e,t){return!e&&JSON.stringify(t)?t:e}function je(e){return Array(ee(e)?e:0).fill(" ").concat(" ").join("")}function Le(e){var t,n,r,a,o,i;return(null===(i=null===(o=null===(a=null===(r=null===(n=null===(t=JSON.stringify(e))||void 0===t?void 0:t.replace(/\\n/g,""))||void 0===n?void 0:n.replace(/\\/g,""))||void 0===r?void 0:r.replace(/"\[/g,"["))||void 0===a?void 0:a.replace(/\]"/g,"]"))||void 0===o?void 0:o.replace(/"\{/g,"{"))||void 0===i?void 0:i.replace(/\}"/g," }"))||"undefined"}function Ge(e){var t;return null===(t=Le(e))||void 0===t?void 0:t.length}function ze(e,t){try{if("string"===t&&!U(e))return"".concat(e);if("boolean"===t&&!ie(e))return Boolean(e);if("null"===t&&!J(e))return null;if(("integer"===t||"float"===t)&&!ee(e))return+e;if("date"===t&&!oe(e)&&(ee(e)||U(e)))return new Date(e)}catch(e){throw new Error(e)}return e}const Ie=function(){function e(e,t){var n,r,a,o,i;if(this.axes=[[]],this.data=[],de(!t||le(t),"If extra exists, it must be an object."),ce(e))(null==t?void 0:t.indexes)?(this.setAxis(0,null==t?void 0:t.indexes),this.data=Array(null==t?void 0:t.indexes.length).fill(ze(Te(e,null==t?void 0:t.fillValue),null===(n=null==t?void 0:t.columnTypes)||void 0===n?void 0:n[0]))):(this.data=[ze(Te(e,null==t?void 0:t.fillValue),null===(r=null==t?void 0:t.columnTypes)||void 0===r?void 0:r[0])],this.setAxis(0,[0]));else if(se(e)){for(var l=!0,s=0;s<e.length;s+=1){if(!ce(e[s])){l=!1;break}}if(this.setAxis(0,Pe(e,null==t?void 0:t.indexes)),l&&((null==t?void 0:t.indexes)&&(de((null===(a=null==t?void 0:t.indexes)||void 0===a?void 0:a.length)===e.length,"Index length is ".concat(null==t?void 0:t.indexes.length,", but data size ").concat(e.length)),this.setAxis(0,null==t?void 0:t.indexes)),this.data=(null==t?void 0:t.fillValue)?e.map(function(e){return Te(e,null==t?void 0:t.fillValue)}):e,null===(o=null==t?void 0:t.columnTypes)||void 0===o?void 0:o.length))for(s=0;s<this.data.length;s+=1)this.data[s]=ze(this.data[s],null===(i=null==t?void 0:t.columnTypes)||void 0===i?void 0:i[0])}}return Object.defineProperty(e.prototype,"indexes",{get:function(){return this.getAxis(0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this.getAxis(1)},enumerable:!1,configurable:!0}),e.prototype.getAxis=function(e){return this.axes[e]},e.prototype.setAxis=function(e,t){de(se(t),"Index or columns must be Axis array."),this.axes[e]=t},e}();const Be=function(e){function t(t,n){var a,o,i,l,s=this;if(s=e.call(this,t,n)||this,de(le(t)||ce(t)||se(t),"Data type is illegal"),le(t)){var c=Object.keys(t);if(null==n?void 0:n.indexes){de((null===(a=null==n?void 0:n.indexes)||void 0===a?void 0:a.length)<=c.length,"Index length ".concat(null===(o=null==n?void 0:n.indexes)||void 0===o?void 0:o.length," is greater than data size ").concat(c.length));for(var u=0;u<(null==n?void 0:n.indexes.length);u+=1){var d=null==n?void 0:n.indexes[u];c.includes(d)&&s.data.push(ze(Te(t[d],null==n?void 0:n.fillValue),null===(i=null==n?void 0:n.columnTypes)||void 0===i?void 0:i[0]))}s.setAxis(0,null==n?void 0:n.indexes)}else s.data=Object.values(t).map(function(e){var t;return ze(Te(e,null==n?void 0:n.fillValue),null===(t=null==n?void 0:n.columnTypes)||void 0===t?void 0:t[0])}),s.setAxis(0,c)}else if(se(t)){ce((0,r.zs)(t,1)[0])||((null==n?void 0:n.indexes)&&(de((null===(l=null==n?void 0:n.indexes)||void 0===l?void 0:l.length)===t.length,"Index length is ".concat(null==n?void 0:n.indexes.length,", but data size ").concat(t.length)),s.setAxis(0,null==n?void 0:n.indexes)),s.data=t)}return s}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"shape",{get:function(){return[this.axes[0].length]},enumerable:!1,configurable:!0}),t.prototype.get=function(e){if(de(ee(e)||U(e)&&!e.includes(":")||se(e)||U(e)&&e.includes(":"),"The rowLoc is illegal"),ee(e)||U(e)&&!e.includes(":")){if(de(this.indexes.includes(e),"The rowLoc is not found in the indexes."),ee(e))return this.data[e];if(U(e)){var n=this.indexes.indexOf(e);return this.data[n]}}if(se(e)){for(var r=[],a=[],o=0;o<e.length;o+=1){var i=e[o];de(this.indexes.includes(i),"The rowLoc is not found in the indexes.");var l=this.indexes.indexOf(i);r.push(this.data[l]),a.push(this.indexes[l])}return new t(r,{indexes:a})}if(U(e)&&e.includes(":")){var s=e.split(":");de(2===s.length,"The rowLoc is not found in the indexes.");var c=s[0],u=s[1];if(ne(Number(c))&&ne(Number(u))){var d=Number(c),f=Number(u);return new t(r=this.data.slice(d,f),{indexes:a=this.indexes.slice(d,f)})}if(U(c)&&U(u)){d=this.indexes.indexOf(c),f=this.indexes.indexOf(u);return new t(r=this.data.slice(d,f),{indexes:a=this.indexes.slice(d,f)})}}throw new Error("The rowLoc is illegal")},t.prototype.getByIndex=function(e){if(de(ne(e)||se(e)||U(e)&&e.includes(":"),"The rowLoc is illegal"),ne(e)&&(de(ue(this.indexes.length).includes(e),"The rowLoc is not found in the indexes."),ue(this.indexes.length).includes(e)))return this.data[e];if(se(e)){for(var n=[],r=[],a=0;a<e.length;a+=1){var o=e[a];de(ue(this.indexes.length).includes(o),"The rowLoc is not found in the indexes."),n.push(this.data[o]),r.push(this.indexes[o])}return new t(n,{indexes:r})}if(U(e)&&e.includes(":")){var i=e.split(":");if(2===i.length){var l=Number(i[0]),s=Number(i[1]);return de(ne(l)&&ne(s),"The rowLoc is not found in the indexes."),new t(n=this.data.slice(l,s),{indexes:r=this.indexes.slice(l,s)})}}throw new Error("The rowLoc is illegal")},t}(Ie);const Ee=function(e){function t(t,n){var a,o,i,l,s,c,u,d,f=this;if((f=e.call(this,t,n)||this).colData=[],f.extra=n||{},de(ce(t)||se(t)||le(t),"Data type is illegal"),ce(t)){if(null==n?void 0:n.columnTypes)for(var h=0;h<(null===(a=null==n?void 0:n.indexes)||void 0===a?void 0:a.length);h+=1)f.data[h]=ze(f.data[h],null===(o=null==n?void 0:n.columnTypes)||void 0===o?void 0:o[h]);(null==n?void 0:n.indexes)&&(null==n?void 0:n.columns)?(f.setAxis(1,null==n?void 0:n.columns),f.data=Array(null==n?void 0:n.columns.length).fill(f.data)):(null==n?void 0:n.columns)?(null==n?void 0:n.indexes)||(de(se(null==n?void 0:n.columns),"Index or columns must be Axis array."),de(1===(null==n?void 0:n.columns.length),"When the length of extra.columns is larger than 1, extra.indexes is required.")):(f.setAxis(1,[0]),f.data=[f.data]),f.colData=f.data}if(se(t)){var m=(0,r.zs)(t,1)[0];if(f.data.length>0&&(f.generateColumns([0],null==n?void 0:n.columns),f.colData=[f.data],f.data=f.data.map(function(e){return[e]})),se(m)){var p=ue(m.length);f.generateDataAndColDataFromArray(!1,t,p,null==n?void 0:n.fillValue,null==n?void 0:n.columnTypes),f.generateColumns(p,null==n?void 0:n.columns)}if(le(m)){var g=[];for(h=0;h<t.length;h+=1){var b=t[h];g.push.apply(g,(0,r.fX)([],(0,r.zs)(Object.keys(b)),!1))}for(p=(0,r.fX)([],(0,r.zs)(new Set(g)),!1),h=0;h<t.length;h+=1){if(de(le(b=t[h]),"The data is not standard object array."),null==n?void 0:n.columns){f.data[h]=[];for(var y=0;y<(null==n?void 0:n.columns.length);y+=1){de(p.includes(x=null==n?void 0:n.columns[y]),"There is no column ".concat(x," in data."));var v=ze(Te(b[x],n.fillValue),null===(i=null==n?void 0:n.columnTypes)||void 0===i?void 0:i[y]);f.data[h].push(v),f.colData[y]?f.colData[y].push(v):f.colData[y]=[v]}f.setAxis(1,null==n?void 0:n.columns)}}(null==n?void 0:n.columns)||(f.generateDataAndColDataFromArray(!0,t,p,null==n?void 0:n.fillValue,null==n?void 0:n.columnTypes),f.setAxis(1,p))}}if(le(t)){var _=Object.values(t);if(ce(m=(0,r.zs)(_,1)[0])){p=Object.keys(t);if((null==n?void 0:n.indexes)?(de(se(n.indexes),"extra.indexes must be an array."),de(1===n.indexes.length,"The length of extra.indexes must be 1."),f.setAxis(0,n.indexes)):f.setAxis(0,[0]),null==n?void 0:n.columns){for(h=0;h<(null==n?void 0:n.columns.length);h+=1){var x;de(p.includes(x=null==n?void 0:n.columns[h]),"There is no column ".concat(x," in data.")),f.data.push(ze(Te(t[x],null==n?void 0:n.fillValue),null===(l=null==n?void 0:n.columnTypes)||void 0===l?void 0:l[h]))}f.colData=f.data.map(function(e){return[e]}),f.data=[f.data],f.setAxis(1,null==n?void 0:n.columns)}else{for(h=0;h<p.length;h+=1){de(ce(b=t[p[h]]),"Data type is illegal"),f.data.push(ze(Te(b,null==n?void 0:n.fillValue),null===(s=null==n?void 0:n.columnTypes)||void 0===s?void 0:s[h]))}f.data=[f.data],f.colData=_.map(function(e){var t;return[ze(Te(e,null==n?void 0:n.fillValue),null===(t=null==n?void 0:n.columnTypes)||void 0===t?void 0:t[0])]}),f.generateColumns(p)}}if(se(m)){f.setAxis(0,Pe(m,null==n?void 0:n.indexes));p=Object.keys(t);f.generateColumns(p,null==n?void 0:n.columns);var w=function(e){var r=t[C.columns[e]];if(de(se(r),"Data type is illegal"),r.length<C.indexes.length){var a=r.concat(Array(C.indexes.length-r.length).fill(ze(Te(void 0,null==n?void 0:n.fillValue),null===(c=null==n?void 0:n.columnTypes)||void 0===c?void 0:c[e])));C.colData.push(a)}else C.colData.push(r.map(function(t){var r;return ze(Te(t,null==n?void 0:n.fillValue),null===(r=null==n?void 0:n.columnTypes)||void 0===r?void 0:r[e])}));for(var o=0;o<C.indexes.length;o+=1)C.data[o]?C.data[o].push(ze(Te(r[o],null==n?void 0:n.fillValue),null===(u=null==n?void 0:n.columnTypes)||void 0===u?void 0:u[e])):C.data[o]=[ze(Te(r[o],null==n?void 0:n.fillValue),null===(d=null==n?void 0:n.columnTypes)||void 0===d?void 0:d[e])]},C=this;for(h=0;h<f.columns.length;h+=1)w(h)}}return f}return(0,r.C6)(t,e),t.prototype.generateColumns=function(e,t){t?(de((null==t?void 0:t.length)===e.length,"Columns length is ".concat(null==t?void 0:t.length,", but data column is ").concat(e.length)),this.setAxis(1,t)):this.setAxis(1,e)},t.prototype.generateDataAndColDataFromArray=function(e,t,n,r,a){for(var o=0;o<t.length;o+=1){var i=t[o];de(e?le(i):se(i),"Data type is illegal"),e&&JSON.stringify(Object.keys(i))===JSON.stringify(n)?this.data.push(Object.values(i).map(function(e,t){return ze(Te(e,r),null==a?void 0:a[t])})):e||this.data.push(i.map(function(e,t){return ze(Te(e,r),null==a?void 0:a[t])}));for(var l=0;l<n.length;l+=1){var s=ze(Te(i[n[l]],r),null==a?void 0:a[l]);e&&JSON.stringify(Object.keys(i))!==JSON.stringify(n)&&(this.data[o]?this.data[o].push(s):this.data[o]=[s]),this.colData[l]?this.colData[l].push(s):this.colData[l]=[s]}}},Object.defineProperty(t.prototype,"shape",{get:function(){return[this.axes[0].length,this.axes[1].length]},enumerable:!1,configurable:!0}),t.prototype.get=function(e,n){if(de(De(e)||se(e),"The rowLoc is illegal"),void 0===n)if(ee(e)){if(de(this.indexes.includes(e),"The rowLoc is not found in the indexes."),this.indexes.includes(e))return new Be(this.data[e],{indexes:this.columns})}else{if(se(e)){for(var r=[],a=[],o=0;o<e.length;o+=1){var i=e[o];de(this.indexes.includes(i),"The rowLoc is not found in the indexes.");var l=this.indexes.indexOf(i);r.push(this.data[l]),a.push(this.indexes[l])}return new t(r,{indexes:a,columns:this.columns})}if(U(e)&&e.includes(":")&&2===(u=e.split(":")).length){var s=Number(u[0]),c=Number(u[1]);return de(ee(s)&&ee(c),"The rowLoc is not found in the indexes."),new t(this.data.slice(s,c),{indexes:this.indexes.slice(s,c),columns:this.columns})}}var u,d=-1,f=-1,h=[],m=-1,p=-1,g=[];if(De(e)&&this.indexes.includes(e)&&(f=(d=this.indexes.indexOf(e))+1),se(e))for(o=0;o<e.length;o+=1){de(this.indexes.includes(w=e[o]),"The rowLoc is not found in the indexes."),h.push(this.indexes.indexOf(w))}if(U(e)&&e.includes(":")&&2===(u=e.split(":")).length){var b=Number(u[0]),y=Number(u[1]);de(ee(b)&&ee(y),"The rowLoc is not found in the indexes."),d=b,f=y}if(De(n)&&this.columns.includes(n)&&(p=(m=this.columns.indexOf(n))+1),se(n))for(o=0;o<n.length;o+=1){de(this.columns.includes(R=n[o]),"The colLoc is not found in the columns."),g.push(this.columns.indexOf(R))}if(U(n)&&n.includes(":")){var v=n.split(":");if(2===v.length){b=this.columns.indexOf(v[0]),y=this.columns.indexOf(v[1]);de(ee(b)&&ee(y),"The colLoc is not found in the columns."),m=b,p=y}}var _=[],x=[];if(de(d>=0&&f>=0||h.length>0,"The rowLoc is not found in the indexes."),d>=0&&f>=0&&(_=this.data.slice(d,f),x=this.indexes.slice(d,f)),h.length>0)for(o=0;o<h.length;o+=1){var w;_.push(this.data[w=h[o]]),x.push(this.indexes[w])}if(m>=0&&p>=0){for(o=0;o<_.length;o+=1)_[o]=_[o].slice(m,p);return new t(_,{indexes:x,columns:C=this.columns.slice(m,p)})}if(g.length>0){var C=[],k=_.slice();for(o=0;o<_.length;o+=1){_[o]=[],C=[];for(var M=0;M<g.length;M+=1){var R;_[o].push(k[o][R=g[M]]),C.push(this.columns[R])}}return new t(_,{indexes:x,columns:C})}throw new Error("The colLoc is illegal.")},t.prototype.getByIndex=function(e,n){if(de(ne(e)||se(e)||U(e),"The rowLoc is illegal"),void 0===n){if(ne(e))return de(ue(this.indexes.length).includes(e),"The rowLoc is not found in the indexes."),new Be(this.data[e],{indexes:this.columns});if(se(e)){for(var r=[],a=[],o=0;o<e.length;o+=1){var i=e[o];de(ue(this.indexes.length).includes(i),"The rowLoc is not found in the indexes."),r.push(this.data[i]),a.push(this.indexes[i])}return new t(r,{indexes:a,columns:this.columns})}if(U(e)&&e.includes(":"))if(2===(c=e.split(":")).length){var l=Number(c[0]),s=Number(c[1]);return de(ne(l)&&ne(s),"The rowLoc is not found in the indexes."),new t(this.data.slice(l,s),{indexes:this.indexes.slice(l,s),columns:this.columns})}}var c,u=-1,d=-1,f=[],h=-1,m=-1,p=[];if(ne(e)&&(de(ue(this.indexes.length).includes(e),"The rowLoc is not found in the indexes."),u=e,d=e+1),se(e))for(o=0;o<e.length;o+=1){var g=e[o];de(ue(this.indexes.length).includes(g),"The rowLoc is not found in the indexes."),f.push(g)}if(U(e)&&e.includes(":")&&2===(c=e.split(":")).length){var b=Number(c[0]),y=Number(c[1]);de(ne(b)&&ne(y),"The rowLoc is not found in the indexes."),u=b,d=y}if(de(u>=0&&d>=0||f.length>0,"The colLoc is illegal"),ne(n)&&ue(this.columns.length).includes(n)&&(h=n,m=n+1),se(n))for(o=0;o<n.length;o+=1){var v=n[o];de(ue(this.columns.length).includes(v),"The colLoc is not found in the columns index."),p.push(v)}if(U(n)&&n.includes(":")){var _=n.split(":");if(2===_.length){b=Number(_[0]),y=Number(_[1]);de(ne(b)&&ne(y),"The colLoc is not found in the columns index."),h=b,m=y}}de(u>=0&&d>=0||f.length>0,"The rowLoc is not found in the indexes.");var x=[],w=[];if(u>=0&&d>=0)x=this.data.slice(u,d),w=this.indexes.slice(u,d);else if(f.length>0)for(o=0;o<f.length;o+=1){x.push(this.data[g=f[o]]),w.push(this.indexes[g])}if(de(h>=0&&m>=0||p.length>0,"The colLoc is not found in the columns index."),h>=0&&m>=0){for(o=0;o<x.length;o+=1)x[o]=x[o].slice(h,m);return new t(x,{indexes:w,columns:C=this.columns.slice(h,m)})}if(p.length>0){var C=[],k=x.slice();for(o=0;o<x.length;o+=1){x[o]=[],C=[];for(var M=0;M<p.length;M+=1){x[o].push(k[o][v=p[M]]),C.push(this.columns[v])}}return new t(x,{indexes:w,columns:C})}throw new Error("The colLoc is illegal.")},t.prototype.getByColumn=function(e){de(this.columns.includes(e),"The col is illegal");var t=this.columns.indexOf(e);return new Be(this.colData[t],{indexes:this.indexes})},t.prototype.info=function(){for(var e,t=[],n=0;n<(null===(e=this.columns)||void 0===e?void 0:e.length);n+=1){var a=this.columns[n];t.push((0,r.Cl)((0,r.Cl)({},Qe(this.colData[n],this.extra.strictDatePattern)),{name:String(a)}))}return t},t.prototype.toString=function(){for(var e=this,t=Array(this.columns.length+1).fill(0),n=0;n<this.indexes.length;n+=1){(a=Ge(this.indexes[n]))>t[0]&&(t[0]=a)}for(n=0;n<this.columns.length;n+=1){(a=Ge(this.columns[n]))>t[n+1]&&(t[n+1]=a)}for(n=0;n<this.colData.length;n+=1)for(var r=0;r<this.colData[n].length;r+=1){var a;(a=Ge(this.colData[n][r]))>t[n+1]&&(t[n+1]=a)}return"".concat(je(t[0])).concat(this.columns.map(function(n,r){return"".concat(n).concat(r!==e.columns.length?je(t[r+1]-Ge(n)+2):"")}).join(""),"\n").concat(this.indexes.map(function(n,r){var a;return"".concat(n).concat(je(t[0]-Ge(n))).concat(null===(a=e.data[r])||void 0===a?void 0:a.map(function(n,r){return"".concat(Le(n)).concat(r!==e.columns.length?je(t[r+1]-Ge(n)):"")}).join("")).concat(r!==e.indexes.length?"\n":"")}).join(""))},t}(Ie);var qe=function(e){if("object"!=typeof e||null===e)return e;var t;if(Array.isArray(e)){t=[];for(var n=0,r=e.length;n<r;n+=1)t[n]="object"==typeof e[n]&&null!=e[n]?qe(e[n]):e[n]}else{t={};var a=Object.keys(e);for(n=0;n<a.length;n+=1){var o=a[n];t[o]="object"==typeof e[o]&&null!=e[o]?qe(e[o]):e[o]}}return t};const Ye=qe,Fe={model:"rgb",value:{r:255,g:255,b:255}},$e=["normal","darken","multiply","colorBurn","linearBurn","lighten","screen","colorDodge","linearDodge","overlay","softLight","hardLight","vividLight","linearLight","pinLight","difference","exclusion"],We=(e,t=0,n=1)=>Ue(et(t,e),n),He=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=We(e[t],0,255)):3===t&&(e[t]=We(e[t],0,1));return e},Xe={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Xe[`[object ${e}]`]=e.toLowerCase();function Ve(e){return Xe[Object.prototype.toString.call(e)]||"object"}const Ze=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):"object"==Ve(e[0])&&t?t.split("").filter(t=>void 0!==e[0][t]).map(t=>e[0][t]):e[0],Ke=e=>{if(e.length<2)return null;const t=e.length-1;return"string"==Ve(e[t])?e[t].toLowerCase():null},{PI:Je,min:Ue,max:et}=Math,tt=2*Je,nt=Je/3,rt=Je/180,at=180/Je,ot={format:{},autodetect:[]};const it=class{constructor(...e){const t=this;if("object"===Ve(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=Ke(e),r=!1;if(!n){r=!0,ot.sorted||(ot.autodetect=ot.autodetect.sort((e,t)=>t.p-e.p),ot.sorted=!0);for(let t of ot.autodetect)if(n=t.test(...e),n)break}if(!ot.format[n])throw new Error("unknown format: "+e);{const a=ot.format[n].apply(null,r?e:e.slice(0,-1));t._rgb=He(a)}3===t._rgb.length&&t._rgb.push(1)}toString(){return"function"==Ve(this.hex)?this.hex():`[${this._rgb.join(",")}]`}},lt=(...e)=>new lt.Color(...e);lt.Color=it,lt.version="2.6.0";const st=lt,ct=(...e)=>{e=Ze(e,"cmyk");const[t,n,r,a]=e,o=e.length>4?e[4]:1;return 1===a?[0,0,0,o]:[t>=1?0:255*(1-t)*(1-a),n>=1?0:255*(1-n)*(1-a),r>=1?0:255*(1-r)*(1-a),o]},{max:ut}=Math,dt=(...e)=>{let[t,n,r]=Ze(e,"rgb");t/=255,n/=255,r/=255;const a=1-ut(t,ut(n,r)),o=a<1?1/(1-a):0;return[(1-t-a)*o,(1-n-a)*o,(1-r-a)*o,a]};it.prototype.cmyk=function(){return dt(this._rgb)},st.cmyk=(...e)=>new it(...e,"cmyk"),ot.format.cmyk=ct,ot.autodetect.push({p:2,test:(...e)=>{if("array"===Ve(e=Ze(e,"cmyk"))&&4===e.length)return"cmyk"}});const ft=e=>Math.round(100*e)/100,ht=(...e)=>{const t=Ze(e,"hsla");let n=Ke(e)||"lsa";return t[0]=ft(t[0]||0),t[1]=ft(100*t[1])+"%",t[2]=ft(100*t[2])+"%","hsla"===n||t.length>3&&t[3]<1?(t[3]=t.length>3?t[3]:1,n="hsla"):t.length=3,`${n}(${t.join(",")})`},mt=(...e)=>{e=Ze(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const a=Ue(t,n,r),o=et(t,n,r),i=(o+a)/2;let l,s;return o===a?(l=0,s=Number.NaN):l=i<.5?(o-a)/(o+a):(o-a)/(2-o-a),t==o?s=(n-r)/(o-a):n==o?s=2+(r-t)/(o-a):r==o&&(s=4+(t-n)/(o-a)),s*=60,s<0&&(s+=360),e.length>3&&void 0!==e[3]?[s,l,i,e[3]]:[s,l,i]},{round:pt}=Math,gt=(...e)=>{const t=Ze(e,"rgba");let n=Ke(e)||"rgb";return"hsl"==n.substr(0,3)?ht(mt(t),n):(t[0]=pt(t[0]),t[1]=pt(t[1]),t[2]=pt(t[2]),("rgba"===n||t.length>3&&t[3]<1)&&(t[3]=t.length>3?t[3]:1,n="rgba"),`${n}(${t.slice(0,"rgb"===n?3:4).join(",")})`)},{round:bt}=Math,yt=(...e)=>{e=Ze(e,"hsl");const[t,n,r]=e;let a,o,i;if(0===n)a=o=i=255*r;else{const e=[0,0,0],l=[0,0,0],s=r<.5?r*(1+n):r+n-r*n,c=2*r-s,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&(e[t]-=1),l[t]=6*e[t]<1?c+6*(s-c)*e[t]:2*e[t]<1?s:3*e[t]<2?c+(s-c)*(2/3-e[t])*6:c;[a,o,i]=[bt(255*l[0]),bt(255*l[1]),bt(255*l[2])]}return e.length>3?[a,o,i,e[3]]:[a,o,i,1]},vt=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,_t=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,xt=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,wt=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Ct=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,kt=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,{round:Mt}=Math,Rt=e=>{let t;if(e=e.toLowerCase().trim(),ot.format.named)try{return ot.format.named(e)}catch(e){}if(t=e.match(vt)){const e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+e[t];return e[3]=1,e}if(t=e.match(_t)){const e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+e[t];return e}if(t=e.match(xt)){const e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=Mt(2.55*e[t]);return e[3]=1,e}if(t=e.match(wt)){const e=t.slice(1,5);for(let t=0;t<3;t++)e[t]=Mt(2.55*e[t]);return e[3]=+e[3],e}if(t=e.match(Ct)){const e=t.slice(1,4);e[1]*=.01,e[2]*=.01;const n=yt(e);return n[3]=1,n}if(t=e.match(kt)){const e=t.slice(1,4);e[1]*=.01,e[2]*=.01;const n=yt(e);return n[3]=+t[4],n}};Rt.test=e=>vt.test(e)||_t.test(e)||xt.test(e)||wt.test(e)||Ct.test(e)||kt.test(e);const Ot=Rt;it.prototype.css=function(e){return gt(this._rgb,e)},st.css=(...e)=>new it(...e,"css"),ot.format.css=Ot,ot.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&"string"===Ve(e)&&Ot.test(e))return"css"}}),ot.format.gl=(...e)=>{const t=Ze(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t},st.gl=(...e)=>new it(...e,"gl"),it.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};const{floor:Nt}=Math,St=(...e)=>{e=Ze(e,"hcg");let t,n,r,[a,o,i]=e;i*=255;const l=255*o;if(0===o)t=n=r=i;else{360===a&&(a=0),a>360&&(a-=360),a<0&&(a+=360),a/=60;const e=Nt(a),s=a-e,c=i*(1-o),u=c+l*(1-s),d=c+l*s,f=c+l;switch(e){case 0:[t,n,r]=[f,d,c];break;case 1:[t,n,r]=[u,f,c];break;case 2:[t,n,r]=[c,f,d];break;case 3:[t,n,r]=[c,u,f];break;case 4:[t,n,r]=[d,c,f];break;case 5:[t,n,r]=[f,c,u]}}return[t,n,r,e.length>3?e[3]:1]},At=(...e)=>{const[t,n,r]=Ze(e,"rgb"),a=Ue(t,n,r),o=et(t,n,r),i=o-a;let l;return 0===i?l=Number.NaN:(t===o&&(l=(n-r)/i),n===o&&(l=2+(r-t)/i),r===o&&(l=4+(t-n)/i),l*=60,l<0&&(l+=360)),[l,100*i/255,a/(255-i)*100]};it.prototype.hcg=function(){return At(this._rgb)},st.hcg=(...e)=>new it(...e,"hcg"),ot.format.hcg=St,ot.autodetect.push({p:1,test:(...e)=>{if("array"===Ve(e=Ze(e,"hcg"))&&3===e.length)return"hcg"}});const Qt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Dt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Pt=e=>{if(e.match(Qt)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(Dt)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((255&t)/255*100)/100]}throw new Error(`unknown hex color: ${e}`)},{round:Tt}=Math,jt=(...e)=>{let[t,n,r,a]=Ze(e,"rgba"),o=Ke(e)||"auto";void 0===a&&(a=1),"auto"===o&&(o=a<1?"rgba":"rgb"),t=Tt(t),n=Tt(n),r=Tt(r);let i="000000"+(t<<16|n<<8|r).toString(16);i=i.substr(i.length-6);let l="0"+Tt(255*a).toString(16);switch(l=l.substr(l.length-2),o.toLowerCase()){case"rgba":return`#${i}${l}`;case"argb":return`#${l}${i}`;default:return`#${i}`}};it.prototype.hex=function(e){return jt(this._rgb,e)},st.hex=(...e)=>new it(...e,"hex"),ot.format.hex=Pt,ot.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&"string"===Ve(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{cos:Lt}=Math,Gt=(...e)=>{e=Ze(e,"hsi");let t,n,r,[a,o,i]=e;return isNaN(a)&&(a=0),isNaN(o)&&(o=0),a>360&&(a-=360),a<0&&(a+=360),a/=360,a<1/3?(r=(1-o)/3,t=(1+o*Lt(tt*a)/Lt(nt-tt*a))/3,n=1-(r+t)):a<2/3?(a-=1/3,t=(1-o)/3,n=(1+o*Lt(tt*a)/Lt(nt-tt*a))/3,r=1-(t+n)):(a-=2/3,n=(1-o)/3,r=(1+o*Lt(tt*a)/Lt(nt-tt*a))/3,t=1-(n+r)),t=We(i*t*3),n=We(i*n*3),r=We(i*r*3),[255*t,255*n,255*r,e.length>3?e[3]:1]},{min:zt,sqrt:It,acos:Bt}=Math,Et=(...e)=>{let t,[n,r,a]=Ze(e,"rgb");n/=255,r/=255,a/=255;const o=zt(n,r,a),i=(n+r+a)/3,l=i>0?1-o/i:0;return 0===l?t=NaN:(t=(n-r+(n-a))/2,t/=It((n-r)*(n-r)+(n-a)*(r-a)),t=Bt(t),a>r&&(t=tt-t),t/=tt),[360*t,l,i]};it.prototype.hsi=function(){return Et(this._rgb)},st.hsi=(...e)=>new it(...e,"hsi"),ot.format.hsi=Gt,ot.autodetect.push({p:2,test:(...e)=>{if("array"===Ve(e=Ze(e,"hsi"))&&3===e.length)return"hsi"}}),it.prototype.hsl=function(){return mt(this._rgb)},st.hsl=(...e)=>new it(...e,"hsl"),ot.format.hsl=yt,ot.autodetect.push({p:2,test:(...e)=>{if("array"===Ve(e=Ze(e,"hsl"))&&3===e.length)return"hsl"}});const{floor:qt}=Math,Yt=(...e)=>{e=Ze(e,"hsv");let t,n,r,[a,o,i]=e;if(i*=255,0===o)t=n=r=i;else{360===a&&(a=0),a>360&&(a-=360),a<0&&(a+=360),a/=60;const e=qt(a),l=a-e,s=i*(1-o),c=i*(1-o*l),u=i*(1-o*(1-l));switch(e){case 0:[t,n,r]=[i,u,s];break;case 1:[t,n,r]=[c,i,s];break;case 2:[t,n,r]=[s,i,u];break;case 3:[t,n,r]=[s,c,i];break;case 4:[t,n,r]=[u,s,i];break;case 5:[t,n,r]=[i,s,c]}}return[t,n,r,e.length>3?e[3]:1]},{min:Ft,max:$t}=Math,Wt=(...e)=>{e=Ze(e,"rgb");let[t,n,r]=e;const a=Ft(t,n,r),o=$t(t,n,r),i=o-a;let l,s,c;return c=o/255,0===o?(l=Number.NaN,s=0):(s=i/o,t===o&&(l=(n-r)/i),n===o&&(l=2+(r-t)/i),r===o&&(l=4+(t-n)/i),l*=60,l<0&&(l+=360)),[l,s,c]};it.prototype.hsv=function(){return Wt(this._rgb)},st.hsv=(...e)=>new it(...e,"hsv"),ot.format.hsv=Yt,ot.autodetect.push({p:2,test:(...e)=>{if("array"===Ve(e=Ze(e,"hsv"))&&3===e.length)return"hsv"}});const Ht=18,Xt=.95047,Vt=1,Zt=1.08883,Kt=.137931034,Jt=.206896552,Ut=.12841855,en=.008856452,{pow:tn}=Math,nn=e=>255*(e<=.00304?12.92*e:1.055*tn(e,1/2.4)-.055),rn=e=>e>Jt?e*e*e:Ut*(e-Kt),an=(...e)=>{e=Ze(e,"lab");const[t,n,r]=e;let a,o,i,l,s,c;return o=(t+16)/116,a=isNaN(n)?o:o+n/500,i=isNaN(r)?o:o-r/200,o=Vt*rn(o),a=Xt*rn(a),i=Zt*rn(i),l=nn(3.2404542*a-1.5371385*o-.4985314*i),s=nn(-.969266*a+1.8760108*o+.041556*i),c=nn(.0556434*a-.2040259*o+1.0572252*i),[l,s,c,e.length>3?e[3]:1]},{pow:on}=Math,ln=e=>(e/=255)<=.04045?e/12.92:on((e+.055)/1.055,2.4),sn=e=>e>en?on(e,1/3):e/Ut+Kt,cn=(e,t,n)=>{e=ln(e),t=ln(t),n=ln(n);return[sn((.4124564*e+.3575761*t+.1804375*n)/Xt),sn((.2126729*e+.7151522*t+.072175*n)/Vt),sn((.0193339*e+.119192*t+.9503041*n)/Zt)]},un=(...e)=>{const[t,n,r]=Ze(e,"rgb"),[a,o,i]=cn(t,n,r),l=116*o-16;return[l<0?0:l,500*(a-o),200*(o-i)]};it.prototype.lab=function(){return un(this._rgb)},st.lab=(...e)=>new it(...e,"lab"),ot.format.lab=an,ot.autodetect.push({p:2,test:(...e)=>{if("array"===Ve(e=Ze(e,"lab"))&&3===e.length)return"lab"}});const{sin:dn,cos:fn}=Math,hn=(...e)=>{let[t,n,r]=Ze(e,"lch");return isNaN(r)&&(r=0),r*=rt,[t,fn(r)*n,dn(r)*n]},mn=(...e)=>{e=Ze(e,"lch");const[t,n,r]=e,[a,o,i]=hn(t,n,r),[l,s,c]=an(a,o,i);return[l,s,c,e.length>3?e[3]:1]},pn=(...e)=>{const t=Ze(e,"hcl").reverse();return mn(...t)},{sqrt:gn,atan2:bn,round:yn}=Math,vn=(...e)=>{const[t,n,r]=Ze(e,"lab"),a=gn(n*n+r*r);let o=(bn(r,n)*at+360)%360;return 0===yn(1e4*a)&&(o=Number.NaN),[t,a,o]},_n=(...e)=>{const[t,n,r]=Ze(e,"rgb"),[a,o,i]=un(t,n,r);return vn(a,o,i)};it.prototype.lch=function(){return _n(this._rgb)},it.prototype.hcl=function(){return _n(this._rgb).reverse()},st.lch=(...e)=>new it(...e,"lch"),st.hcl=(...e)=>new it(...e,"hcl"),ot.format.lch=mn,ot.format.hcl=pn,["lch","hcl"].forEach(e=>ot.autodetect.push({p:2,test:(...t)=>{if("array"===Ve(t=Ze(t,e))&&3===t.length)return e}}));const xn={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};it.prototype.name=function(){const e=jt(this._rgb,"rgb");for(let t of Object.keys(xn))if(xn[t]===e)return t.toLowerCase();return e},ot.format.named=e=>{if(e=e.toLowerCase(),xn[e])return Pt(xn[e]);throw new Error("unknown color name: "+e)},ot.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&"string"===Ve(e)&&xn[e.toLowerCase()])return"named"}});const wn=e=>{if("number"==Ve(e)&&e>=0&&e<=16777215){return[e>>16,e>>8&255,255&e,1]}throw new Error("unknown num color: "+e)},Cn=(...e)=>{const[t,n,r]=Ze(e,"rgb");return(t<<16)+(n<<8)+r};it.prototype.num=function(){return Cn(this._rgb)},st.num=(...e)=>new it(...e,"num"),ot.format.num=wn,ot.autodetect.push({p:5,test:(...e)=>{if(1===e.length&&"number"===Ve(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});const{round:kn}=Math;it.prototype.rgb=function(e=!0){return!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(kn)},it.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?!1===e?t:kn(t):t)},st.rgb=(...e)=>new it(...e,"rgb"),ot.format.rgb=(...e)=>{const t=Ze(e,"rgba");return void 0===t[3]&&(t[3]=1),t},ot.autodetect.push({p:3,test:(...e)=>{if("array"===Ve(e=Ze(e,"rgba"))&&(3===e.length||4===e.length&&"number"==Ve(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});const{log:Mn}=Math,Rn=e=>{const t=e/100;let n,r,a;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*Mn(r),a=t<20?0:.8274096064007395*(a=t-10)-254.76935184120902+115.67994401066147*Mn(a)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*Mn(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*Mn(r),a=255),[n,r,a,1]},{round:On}=Math,Nn=(...e)=>{const t=Ze(e,"rgb"),n=t[0],r=t[2];let a=1e3,o=4e4;let i;for(;o-a>.4;){i=.5*(o+a);const e=Rn(i);e[2]/e[0]>=r/n?o=i:a=i}return On(i)};it.prototype.temp=it.prototype.kelvin=it.prototype.temperature=function(){return Nn(this._rgb)},st.temp=st.kelvin=st.temperature=(...e)=>new it(...e,"temp"),ot.format.temp=ot.format.kelvin=ot.format.temperature=Rn;const{pow:Sn,sign:An}=Math,Qn=(...e)=>{e=Ze(e,"lab");const[t,n,r]=e,a=Sn(t+.3963377774*n+.2158037573*r,3),o=Sn(t-.1055613458*n-.0638541728*r,3),i=Sn(t-.0894841775*n-1.291485548*r,3);return[255*Dn(4.0767416621*a-3.3077115913*o+.2309699292*i),255*Dn(-1.2684380046*a+2.6097574011*o-.3413193965*i),255*Dn(-.0041960863*a-.7034186147*o+1.707614701*i),e.length>3?e[3]:1]};function Dn(e){const t=Math.abs(e);return t>.0031308?(An(e)||1)*(1.055*Sn(t,1/2.4)-.055):12.92*e}const{cbrt:Pn,pow:Tn,sign:jn}=Math,Ln=(...e)=>{const[t,n,r]=Ze(e,"rgb"),[a,o,i]=[Gn(t/255),Gn(n/255),Gn(r/255)],l=Pn(.4122214708*a+.5363325363*o+.0514459929*i),s=Pn(.2119034982*a+.6806995451*o+.1073969566*i),c=Pn(.0883024619*a+.2817188376*o+.6299787005*i);return[.2104542553*l+.793617785*s-.0040720468*c,1.9779984951*l-2.428592205*s+.4505937099*c,.0259040371*l+.7827717662*s-.808675766*c]};function Gn(e){const t=Math.abs(e);return t<.04045?e/12.92:(jn(e)||1)*Tn((t+.055)/1.055,2.4)}it.prototype.oklab=function(){return Ln(this._rgb)},st.oklab=(...e)=>new it(...e,"oklab"),ot.format.oklab=Qn,ot.autodetect.push({p:3,test:(...e)=>{if("array"===Ve(e=Ze(e,"oklab"))&&3===e.length)return"oklab"}});const zn=(...e)=>{e=Ze(e,"lch");const[t,n,r]=e,[a,o,i]=hn(t,n,r),[l,s,c]=Qn(a,o,i);return[l,s,c,e.length>3?e[3]:1]},In=(...e)=>{const[t,n,r]=Ze(e,"rgb"),[a,o,i]=Ln(t,n,r);return vn(a,o,i)};it.prototype.oklch=function(){return In(this._rgb)},st.oklch=(...e)=>new it(...e,"oklch"),ot.format.oklch=zn,ot.autodetect.push({p:3,test:(...e)=>{if("array"===Ve(e=Ze(e,"oklch"))&&3===e.length)return"oklch"}}),it.prototype.alpha=function(e,t=!1){return void 0!==e&&"number"===Ve(e)?t?(this._rgb[3]=e,this):new it([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},it.prototype.clipped=function(){return this._rgb._clipped||!1},it.prototype.darken=function(e=1){const t=this.lab();return t[0]-=Ht*e,new it(t,"lab").alpha(this.alpha(),!0)},it.prototype.brighten=function(e=1){return this.darken(-e)},it.prototype.darker=it.prototype.darken,it.prototype.brighter=it.prototype.brighten,it.prototype.get=function(e){const[t,n]=e.split("."),r=this[t]();if(n){const e=t.indexOf(n)-("ok"===t.substr(0,2)?2:0);if(e>-1)return r[e];throw new Error(`unknown channel ${n} in mode ${t}`)}return r};const{pow:Bn}=Math;it.prototype.luminance=function(e,t="rgb"){if(void 0!==e&&"number"===Ve(e)){if(0===e)return new it([0,0,0,this._rgb[3]],"rgb");if(1===e)return new it([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=20;const a=(n,o)=>{const i=n.interpolate(o,.5,t),l=i.luminance();return Math.abs(e-l)<1e-7||!r--?i:l>e?a(n,i):a(i,o)},o=(n>e?a(new it([0,0,0]),this):a(this,new it([255,255,255]))).rgb();return new it([...o,this._rgb[3]])}return En(...this._rgb.slice(0,3))};const En=(e,t,n)=>.2126*(e=qn(e))+.7152*(t=qn(t))+.0722*(n=qn(n)),qn=e=>(e/=255)<=.03928?e/12.92:Bn((e+.055)/1.055,2.4),Yn={},Fn=(e,t,n=.5,...r)=>{let a=r[0]||"lrgb";if(Yn[a]||r.length||(a=Object.keys(Yn)[0]),!Yn[a])throw new Error(`interpolation mode ${a} is not defined`);return"object"!==Ve(e)&&(e=new it(e)),"object"!==Ve(t)&&(t=new it(t)),Yn[a](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};it.prototype.mix=it.prototype.interpolate=function(e,t=.5,...n){return Fn(this,e,t,...n)},it.prototype.premultiply=function(e=!1){const t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new it([t[0]*n,t[1]*n,t[2]*n,n],"rgb")},it.prototype.saturate=function(e=1){const t=this.lch();return t[1]+=Ht*e,t[1]<0&&(t[1]=0),new it(t,"lch").alpha(this.alpha(),!0)},it.prototype.desaturate=function(e=1){return this.saturate(-e)},it.prototype.set=function(e,t,n=!1){const[r,a]=e.split("."),o=this[r]();if(a){const e=r.indexOf(a)-("ok"===r.substr(0,2)?2:0);if(e>-1){if("string"==Ve(t))switch(t.charAt(0)){case"+":case"-":o[e]+=+t;break;case"*":o[e]*=+t.substr(1);break;case"/":o[e]/=+t.substr(1);break;default:o[e]=+t}else{if("number"!==Ve(t))throw new Error("unsupported value for Color.set");o[e]=t}const a=new it(o,r);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${a} in mode ${r}`)}return o},it.prototype.tint=function(e=.5,...t){return Fn(this,"white",e,...t)},it.prototype.shade=function(e=.5,...t){return Fn(this,"black",e,...t)};const $n=(e,t,n)=>{const r=e._rgb,a=t._rgb;return new it(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"rgb")};Yn.rgb=$n;const{sqrt:Wn,pow:Hn}=Math,Xn=(e,t,n)=>{const[r,a,o]=e._rgb,[i,l,s]=t._rgb;return new it(Wn(Hn(r,2)*(1-n)+Hn(i,2)*n),Wn(Hn(a,2)*(1-n)+Hn(l,2)*n),Wn(Hn(o,2)*(1-n)+Hn(s,2)*n),"rgb")};Yn.lrgb=Xn;const Vn=(e,t,n)=>{const r=e.lab(),a=t.lab();return new it(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"lab")};Yn.lab=Vn;const Zn=(e,t,n,r)=>{let a,o,i,l,s,c,u,d,f,h,m,p;return"hsl"===r?(a=e.hsl(),o=t.hsl()):"hsv"===r?(a=e.hsv(),o=t.hsv()):"hcg"===r?(a=e.hcg(),o=t.hcg()):"hsi"===r?(a=e.hsi(),o=t.hsi()):"lch"===r||"hcl"===r?(r="hcl",a=e.hcl(),o=t.hcl()):"oklch"===r&&(a=e.oklch().reverse(),o=t.oklch().reverse()),"h"!==r.substr(0,1)&&"oklch"!==r||([i,s,u]=a,[l,c,d]=o),isNaN(i)||isNaN(l)?isNaN(i)?isNaN(l)?h=Number.NaN:(h=l,1!=u&&0!=u||"hsv"==r||(f=c)):(h=i,1!=d&&0!=d||"hsv"==r||(f=s)):(p=l>i&&l-i>180?l-(i+360):l<i&&i-l>180?l+360-i:l-i,h=i+n*p),void 0===f&&(f=s+n*(c-s)),m=u+n*(d-u),new it("oklch"===r?[m,f,h]:[h,f,m],r)},Kn=(e,t,n)=>Zn(e,t,n,"lch");Yn.lch=Kn,Yn.hcl=Kn;const Jn=(e,t,n)=>{const r=e.num(),a=t.num();return new it(r+n*(a-r),"num")};Yn.num=Jn;const Un=(e,t,n)=>Zn(e,t,n,"hcg");Yn.hcg=Un;const er=(e,t,n)=>Zn(e,t,n,"hsi");Yn.hsi=er;const tr=(e,t,n)=>Zn(e,t,n,"hsl");Yn.hsl=tr;const nr=(e,t,n)=>Zn(e,t,n,"hsv");Yn.hsv=nr;const rr=(e,t,n)=>{const r=e.oklab(),a=t.oklab();return new it(r[0]+n*(a[0]-r[0]),r[1]+n*(a[1]-r[1]),r[2]+n*(a[2]-r[2]),"oklab")};Yn.oklab=rr;const ar=(e,t,n)=>Zn(e,t,n,"oklch");Yn.oklch=ar;const{pow:or,sqrt:ir,PI:lr,cos:sr,sin:cr,atan2:ur}=Math,dr=(e,t)=>{const n=e.length,r=[0,0,0,0];for(let a=0;a<e.length;a++){const o=t[a]/n,i=e[a]._rgb;r[0]+=or(i[0],2)*o,r[1]+=or(i[1],2)*o,r[2]+=or(i[2],2)*o,r[3]+=i[3]*o}return r[0]=ir(r[0]),r[1]=ir(r[1]),r[2]=ir(r[2]),r[3]>.9999999&&(r[3]=1),new it(He(r))},{pow:fr}=Math;function hr(e){let t="rgb",n=st("#ccc"),r=0,a=[0,1],o=[],i=[0,0],l=!1,s=[],c=!1,u=0,d=1,f=!1,h={},m=!0,p=1;const g=function(e){if((e=e||["#fff","#000"])&&"string"===Ve(e)&&st.brewer&&st.brewer[e.toLowerCase()]&&(e=st.brewer[e.toLowerCase()]),"array"===Ve(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=st(e[t]);o.length=0;for(let t=0;t<e.length;t++)o.push(t/(e.length-1))}return _(),s=e};let b=e=>e,y=e=>e;const v=function(e,r){let a,c;if(null==r&&(r=!1),isNaN(e)||null===e)return n;if(r)c=e;else if(l&&l.length>2){c=function(e){if(null!=l){const t=l.length-1;let n=0;for(;n<t&&e>=l[n];)n++;return n-1}return 0}(e)/(l.length-2)}else c=d!==u?(e-u)/(d-u):1;c=y(c),r||(c=b(c)),1!==p&&(c=fr(c,p)),c=i[0]+c*(1-i[0]-i[1]),c=We(c,0,1);const f=Math.floor(1e4*c);if(m&&h[f])a=h[f];else{if("array"===Ve(s))for(let e=0;e<o.length;e++){const n=o[e];if(c<=n){a=s[e];break}if(c>=n&&e===o.length-1){a=s[e];break}if(c>n&&c<o[e+1]){c=(c-n)/(o[e+1]-n),a=st.interpolate(s[e],s[e+1],c,t);break}}else"function"===Ve(s)&&(a=s(c));m&&(h[f]=a)}return a};var _=()=>h={};g(e);const x=function(e){const t=st(v(e));return c&&t[c]?t[c]():t};return x.classes=function(e){if(null!=e){if("array"===Ve(e))l=e,a=[e[0],e[e.length-1]];else{const t=st.analyze(a);l=0===e?[t.min,t.max]:st.limits(t,"e",e)}return x}return l},x.domain=function(e){if(!arguments.length)return a;u=e[0],d=e[e.length-1],o=[];const t=s.length;if(e.length===t&&u!==d)for(let t of Array.from(e))o.push((t-u)/(d-u));else{for(let e=0;e<t;e++)o.push(e/(t-1));if(e.length>2){const t=e.map((t,n)=>n/(e.length-1)),n=e.map(e=>(e-u)/(d-u));n.every((e,n)=>t[n]===e)||(y=e=>{if(e<=0||e>=1)return e;let r=0;for(;e>=n[r+1];)r++;return t[r]+(e-n[r])/(n[r+1]-n[r])*(t[r+1]-t[r])})}}return a=[u,d],x},x.mode=function(e){return arguments.length?(t=e,_(),x):t},x.range=function(e,t){return g(e),x},x.out=function(e){return c=e,x},x.spread=function(e){return arguments.length?(r=e,x):r},x.correctLightness=function(e){return null==e&&(e=!0),f=e,_(),b=f?function(e){const t=v(0,!0).lab()[0],n=v(1,!0).lab()[0],r=t>n;let a=v(e,!0).lab()[0];const o=t+(n-t)*e;let i=a-o,l=0,s=1,c=20;for(;Math.abs(i)>.01&&c-- >0;)(function(){r&&(i*=-1),i<0?(l=e,e+=.5*(s-e)):(s=e,e+=.5*(l-e)),a=v(e,!0).lab()[0],i=a-o})();return e}:e=>e,x},x.padding=function(e){return null!=e?("number"===Ve(e)&&(e=[e,e]),i=e,x):i},x.colors=function(t,n){arguments.length<2&&(n="hex");let r=[];if(0===arguments.length)r=s.slice(0);else if(1===t)r=[x(.5)];else if(t>1){const e=a[0],n=a[1]-e;r=function(e,t,n){let r=[],a=e<t,o=n?a?t+1:t-1:t;for(let t=e;a?t<o:t>o;a?t++:t--)r.push(t);return r}(0,t,!1).map(r=>x(e+r/(t-1)*n))}else{e=[];let t=[];if(l&&l.length>2)for(let e=1,n=l.length,r=1<=n;r?e<n:e>n;r?e++:e--)t.push(.5*(l[e-1]+l[e]));else t=a;r=t.map(e=>x(e))}return st[n]&&(r=r.map(e=>e[n]())),r},x.cache=function(e){return null!=e?(m=e,x):m},x.gamma=function(e){return null!=e?(p=e,x):p},x.nodata=function(e){return null!=e?(n=st(e),x):n},x}const mr=(e,t,n)=>{if(!mr[n])throw new Error("unknown blend mode "+n);return mr[n](e,t)},pr=e=>(t,n)=>{const r=st(n).rgb(),a=st(t).rgb();return st.rgb(e(r,a))},gr=e=>(t,n)=>{const r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r};mr.normal=pr(gr(e=>e)),mr.multiply=pr(gr((e,t)=>e*t/255)),mr.screen=pr(gr((e,t)=>255*(1-(1-e/255)*(1-t/255)))),mr.overlay=pr(gr((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)))),mr.darken=pr(gr((e,t)=>e>t?t:e)),mr.lighten=pr(gr((e,t)=>e>t?e:t)),mr.dodge=pr(gr((e,t)=>255===e||(e=t/255*255/(1-e/255))>255?255:e)),mr.burn=pr(gr((e,t)=>255*(1-(1-t/255)/(e/255))));const br=mr,{pow:yr,sin:vr,cos:_r}=Math;const{floor:xr,random:wr}=Math,{log:Cr,pow:kr,floor:Mr,abs:Rr}=Math;function Or(e,t=null){const n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===Ve(e)&&(e=Object.values(e)),e.forEach(e=>{t&&"object"===Ve(e)&&(e=e[t]),null==e||isNaN(e)||(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(e,t)=>Nr(n,e,t),n}function Nr(e,t="equal",n=7){"array"==Ve(e)&&(e=Or(e));const{min:r,max:a}=e,o=e.values.sort((e,t)=>e-t);if(1===n)return[r,a];const i=[];if("c"===t.substr(0,1)&&(i.push(r),i.push(a)),"e"===t.substr(0,1)){i.push(r);for(let e=1;e<n;e++)i.push(r+e/n*(a-r));i.push(a)}else if("l"===t.substr(0,1)){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const e=Math.LOG10E*Cr(r),t=Math.LOG10E*Cr(a);i.push(r);for(let r=1;r<n;r++)i.push(kr(10,e+r/n*(t-e)));i.push(a)}else if("q"===t.substr(0,1)){i.push(r);for(let e=1;e<n;e++){const t=(o.length-1)*e/n,r=Mr(t);if(r===t)i.push(o[r]);else{const e=t-r;i.push(o[r]*(1-e)+o[r+1]*e)}}i.push(a)}else if("k"===t.substr(0,1)){let e;const t=o.length,l=new Array(t),s=new Array(n);let c=!0,u=0,d=null;d=[],d.push(r);for(let e=1;e<n;e++)d.push(r+e/n*(a-r));for(d.push(a);c;){for(let e=0;e<n;e++)s[e]=0;for(let e=0;e<t;e++){const t=o[e];let r,a=Number.MAX_VALUE;for(let o=0;o<n;o++){const n=Rr(d[o]-t);n<a&&(a=n,r=o),s[r]++,l[e]=r}}const r=new Array(n);for(let e=0;e<n;e++)r[e]=null;for(let n=0;n<t;n++)e=l[n],null===r[e]?r[e]=o[n]:r[e]+=o[n];for(let e=0;e<n;e++)r[e]*=1/s[e];c=!1;for(let e=0;e<n;e++)if(r[e]!==d[e]){c=!0;break}d=r,u++,u>200&&(c=!1)}const f={};for(let e=0;e<n;e++)f[e]=[];for(let n=0;n<t;n++)e=l[n],f[e].push(o[n]);let h=[];for(let e=0;e<n;e++)h.push(f[e][0]),h.push(f[e][f[e].length-1]);h=h.sort((e,t)=>e-t),i.push(h[0]);for(let e=1;e<h.length;e+=2){const t=h[e];isNaN(t)||-1!==i.indexOf(t)||i.push(t)}}return i}const{sqrt:Sr,pow:Ar,min:Qr,max:Dr,atan2:Pr,abs:Tr,cos:jr,sin:Lr,exp:Gr,PI:zr}=Math;const Ir={cool:()=>hr([st.hsl(180,1,.9),st.hsl(250,.7,.4)]),hot:()=>hr(["#000","#f00","#ff0","#fff"]).mode("rgb")},Br={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(let e of Object.keys(Br))Br[e.toLowerCase()]=Br[e];Object.assign(st,{average:(e,t="lrgb",n=null)=>{const r=e.length;n||(n=Array.from(new Array(r)).map(()=>1));const a=r/n.reduce(function(e,t){return e+t});if(n.forEach((e,t)=>{n[t]*=a}),e=e.map(e=>new it(e)),"lrgb"===t)return dr(e,n);const o=e.shift(),i=o.get(t),l=[];let s=0,c=0;for(let e=0;e<i.length;e++)if(i[e]=(i[e]||0)*n[0],l.push(isNaN(i[e])?0:n[0]),"h"===t.charAt(e)&&!isNaN(i[e])){const t=i[e]/180*lr;s+=sr(t)*n[0],c+=cr(t)*n[0]}let u=o.alpha()*n[0];e.forEach((e,r)=>{const a=e.get(t);u+=e.alpha()*n[r+1];for(let e=0;e<i.length;e++)if(!isNaN(a[e]))if(l[e]+=n[r+1],"h"===t.charAt(e)){const t=a[e]/180*lr;s+=sr(t)*n[r+1],c+=cr(t)*n[r+1]}else i[e]+=a[e]*n[r+1]});for(let e=0;e<i.length;e++)if("h"===t.charAt(e)){let t=ur(c/l[e],s/l[e])/lr*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;i[e]=t}else i[e]=i[e]/l[e];return u/=r,new it(i,t).alpha(u>.99999?1:u,!0)},bezier:e=>{const t=function(e){let t,n,r,a;if(2===(e=e.map(e=>new it(e))).length)[n,r]=e.map(e=>e.lab()),t=function(e){const t=[0,1,2].map(t=>n[t]+e*(r[t]-n[t]));return new it(t,"lab")};else if(3===e.length)[n,r,a]=e.map(e=>e.lab()),t=function(e){const t=[0,1,2].map(t=>(1-e)*(1-e)*n[t]+2*(1-e)*e*r[t]+e*e*a[t]);return new it(t,"lab")};else if(4===e.length){let o;[n,r,a,o]=e.map(e=>e.lab()),t=function(e){const t=[0,1,2].map(t=>(1-e)*(1-e)*(1-e)*n[t]+3*(1-e)*(1-e)*e*r[t]+3*(1-e)*e*e*a[t]+e*e*e*o[t]);return new it(t,"lab")}}else{if(!(e.length>=5))throw new RangeError("No point in running bezier with only one color.");{let n,r,a;n=e.map(e=>e.lab()),a=e.length-1,r=function(e){let t=[1,1];for(let n=1;n<e;n++){let e=[1];for(let n=1;n<=t.length;n++)e[n]=(t[n]||0)+t[n-1];t=e}return t}(a),t=function(e){const t=1-e,o=[0,1,2].map(o=>n.reduce((n,i,l)=>n+r[l]*t**(a-l)*e**l*i[o],0));return new it(o,"lab")}}}return t}(e);return t.scale=()=>hr(t),t},blend:br,cubehelix:function(e=300,t=-1.5,n=1,r=1,a=[0,1]){let o,i=0;"array"===Ve(a)?o=a[1]-a[0]:(o=0,a=[a,a]);const l=function(l){const s=tt*((e+120)/360+t*l),c=yr(a[0]+o*l,r),u=(0!==i?n[0]+l*i:n)*c*(1-c)/2,d=_r(s),f=vr(s);return st(He([255*(c+u*(-.14861*d+1.78277*f)),255*(c+u*(-.29227*d-.90649*f)),255*(c+u*(1.97294*d)),1]))};return l.start=function(t){return null==t?e:(e=t,l)},l.rotations=function(e){return null==e?t:(t=e,l)},l.gamma=function(e){return null==e?r:(r=e,l)},l.hue=function(e){return null==e?n:("array"===Ve(n=e)?(i=n[1]-n[0],0===i&&(n=n[1])):i=0,l)},l.lightness=function(e){return null==e?a:("array"===Ve(e)?(a=e,o=e[1]-e[0]):(a=[e,e],o=0),l)},l.scale=()=>st.scale(l),l.hue(n),l},mix:Fn,interpolate:Fn,random:()=>{let e="#";for(let t=0;t<6;t++)e+="0123456789abcdef".charAt(xr(16*wr()));return new it(e,"hex")},scale:hr,analyze:Or,contrast:(e,t)=>{e=new it(e),t=new it(t);const n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},deltaE:function(e,t,n=1,r=1,a=1){var o=function(e){return 360*e/(2*zr)},i=function(e){return 2*zr*e/360};e=new it(e),t=new it(t);const[l,s,c]=Array.from(e.lab()),[u,d,f]=Array.from(t.lab()),h=(l+u)/2,m=(Sr(Ar(s,2)+Ar(c,2))+Sr(Ar(d,2)+Ar(f,2)))/2,p=.5*(1-Sr(Ar(m,7)/(Ar(m,7)+Ar(25,7)))),g=s*(1+p),b=d*(1+p),y=Sr(Ar(g,2)+Ar(c,2)),v=Sr(Ar(b,2)+Ar(f,2)),_=(y+v)/2,x=o(Pr(c,g)),w=o(Pr(f,b)),C=x>=0?x:x+360,k=w>=0?w:w+360,M=Tr(C-k)>180?(C+k+360)/2:(C+k)/2,R=1-.17*jr(i(M-30))+.24*jr(i(2*M))+.32*jr(i(3*M+6))-.2*jr(i(4*M-63));let O=k-C;O=Tr(O)<=180?O:k<=C?O+360:O-360,O=2*Sr(y*v)*Lr(i(O)/2);const N=u-l,S=v-y,A=1+.015*Ar(h-50,2)/Sr(20+Ar(h-50,2)),Q=1+.045*_,D=1+.015*_*R,P=30*Gr(-Ar((M-275)/25,2)),T=-(2*Sr(Ar(_,7)/(Ar(_,7)+Ar(25,7))))*Lr(2*i(P)),j=Sr(Ar(N/(n*A),2)+Ar(S/(r*Q),2)+Ar(O/(a*D),2)+T*(S/(r*Q))*(O/(a*D)));return Dr(0,Qr(100,j))},distance:function(e,t,n="lab"){e=new it(e),t=new it(t);const r=e.get(n),a=t.get(n);let o=0;for(let e in r){const t=(r[e]||0)-(a[e]||0);o+=t*t}return Math.sqrt(o)},limits:Nr,valid:(...e)=>{try{return new it(...e),!0}catch(e){return!1}},scales:Ir,input:ot,colors:xn,brewer:Br});const Er=st;function qr(e){const{value:t}=e;return(e=>!!Er.valid(e))(t)?Er(t).hex():""}const Yr={lab:{l:[0,100],a:[-86.185,98.254],b:[-107.863,94.482]},lch:{l:[0,100],c:[0,100],h:[0,360]},rgb:{r:[0,255],g:[0,255],b:[0,255]},rgba:{r:[0,255],g:[0,255],b:[0,255],a:[0,1]},hsl:{h:[0,360],s:[0,1],l:[0,1]},hsv:{h:[0,360],s:[0,1],v:[0,1]},hsi:{h:[0,360],s:[0,1],i:[0,1]},cmyk:{c:[0,1],m:[0,1],y:[0,1],k:[0,1]}};const Fr=e=>{const{value:t}=e;return(e=>!!Er.valid(e))(t)?Er(t):Er("#000")},$r=(e,t=e.model)=>{const n=Fr(e);return n?n[t]():[0,0,0]},Wr=(e,t=(4===e.length?"rgba":"rgb"))=>{const n={};if(1===e.length){const[r]=e;for(let e=0;e<t.length;e+=1)n[t[e]]=r}else for(let r=0;r<t.length;r+=1)n[t[r]]=e[r];return{model:t,value:n}};function Hr(e){const[t,n,r]=$r(e,"rgb");return Math.round(.299*t+.587*n+.114*r)}function Xr(e,t=1){return 1===t?{model:"rgb",value:{r:e,g:e,b:e}}:{model:"rgba",value:{r:e,g:e,b:e,a:t}}}function Vr(e){if(/^(#|0x)?[0-9a-fA-F]{3}$/.test(e)||/^(#|0x)?[0-9a-fA-F]{6}$/.test(e)){const t=Er(e).rgb();return Wr(t,"rgb")}if(/^(#|0x)?[0-9a-fA-F]{4}$/.test(e)||/^(#|0x)?[0-9a-fA-F]{8}$/.test(e)){const t=Er(e).rgba();return Wr(t,"rgba")}return{model:"rgb",value:{r:0,g:0,b:0}}}const Zr=(e,t)=>e*t/255,Kr=(e,t)=>e+t-e*t/255,Jr=(e,t)=>e<128?Zr(2*e,t):Kr(2*e-255,t),Ur={normal:e=>e,darken:(e,t)=>Math.min(e,t),multiply:Zr,colorBurn:(e,t)=>0===e?0:Math.max(0,255*(1-(255-t)/e)),lighten:(e,t)=>Math.max(e,t),screen:Kr,colorDodge:(e,t)=>255===e?255:Math.min(255,t/(255-e)*255),overlay:(e,t)=>Jr(t,e),softLight:(e,t)=>{if(e<128)return t-(1-2*e/255)*t*(1-t/255);return t+255*(2*e/255-1)*((t<64?t/255*(t/255*(t/255*16-12)+4):Math.sqrt(t/255))-t/255)},hardLight:Jr,difference:(e,t)=>Math.abs(e-t),exclusion:(e,t)=>e+t-2*e*t/255,linearBurn:(e,t)=>Math.max(e+t-255,0),linearDodge:(e,t)=>Math.min(255,e+t),linearLight:(e,t)=>Math.max(t+2*e-255,0),vividLight:(e,t)=>e<128?255*(1-(1-t/255)/(2*e/255)):t/2/(255-e)*255,pinLight:(e,t)=>e<128?Math.min(t,2*e):Math.max(t,2*e-255)},ea=e=>.3*e[0]+.58*e[1]+.11*e[2],ta=(e,t)=>{const n=t-ea(e);return(e=>{const t=ea(e),n=Math.min(...e),r=Math.max(...e);let a=[...e];return n<0&&(a=a.map(e=>t+(e-t)*t/(t-n))),r>255&&(a=a.map(e=>t+(e-t)*(255-t)/(r-t))),a})(e.map(e=>e+n))},na=e=>Math.max(...e)-Math.min(...e),ra=(e,t)=>{const n=e.map((e,t)=>({value:e,index:t}));n.sort((e,t)=>e.value-t.value);const r=n[0].index,a=n[1].index,o=n[2].index,i=[...e];return i[o]>i[r]?(i[a]=(i[a]-i[r])*t/(i[o]-i[r]),i[o]=t):(i[a]=0,i[o]=0),i[r]=0,i},aa={hue:(e,t)=>ta(ra(e,na(t)),ea(t)),saturation:(e,t)=>ta(ra(t,na(e)),ea(t)),color:(e,t)=>ta(e,ea(t)),luminosity:(e,t)=>ta(t,ea(e))},oa=(e,t,n="normal")=>{const[r,a,o,i]=$r(e,"rgba"),[l,s,c,u]=$r(t,"rgba"),d=[r,a,o],f=[l,s,c];let h;if($e.includes(n)){const e=Ur[n];h=d.map((t,n)=>Math.floor(e(t,f[n])))}else h=aa[n](d,f);const m=i+u*(1-i),p=Math.round((i*(1-u)*r+i*u*h[0]+(1-i)*u*l)/m),g=Math.round((i*(1-u)*a+i*u*h[1]+(1-i)*u*s)/m),b=Math.round((i*(1-u)*o+i*u*h[2]+(1-i)*u*c)/m);return 1===m?{model:"rgb",value:{r:p,g,b}}:{model:"rgba",value:{r:p,g,b,a:m}}};const ia=(e,t)=>{let n=(e+t)%360;return n<0?n+=360:n>=360&&(n-=360),n},la=(e=1,t=0)=>{const n=Math.min(e,t),r=Math.max(e,t);return n+Math.random()*(r-n)},sa=(e=1,t=0)=>{const n=Math.ceil(Math.min(e,t)),r=Math.floor(Math.max(e,t));return Math.floor(n+Math.random()*(r-n+1))},ca=e=>{if(e&&"object"==typeof e){if(Array.isArray(e)){return e.map(e=>ca(e))}const t={};return Object.keys(e).forEach(n=>{t[n]=ca(e[n])}),t}return e};function ua(e){return e*(Math.PI/180)}var da=n("./node_modules/.pnpm/color-blind@0.1.3/node_modules/color-blind/lib/color-blind.js"),fa=n.n(da);const ha=(e,t="normal")=>"grayscale"===t?(e=>{const t=Hr(e),[,,,n=1]=$r(e,"rgba");return Xr(t,n)})(e):((e,t="normal")=>{if("normal"===t)return{...e};const n=qr(e);return Vr(fa()[t](n))})(e,t),ma=(e,t,n=[sa(5,10),sa(90,95)])=>{const[r,a,o]=$r(e,"lab"),i=r<=15?r:n[0];let l=((r>=85?r:n[1])-i)/(t-1);const s=Math.ceil((r-i)/l);return l=0===s?l:(r-i)/s,new Array(t).fill(0).map((e,t)=>Wr([l*t+i,a,o],"lab"))},pa=e=>{const{count:t,color:n,tendency:r}=e,a="tint"===r,o=ma(n,t);return{name:"monochromatic",semantic:null,type:"discrete-scale",colors:a?o:o.reverse()}},ga={model:"rgb",value:{r:0,g:0,b:0}},ba={model:"rgb",value:{r:255,g:255,b:255}},ya=(e,t,n="lab")=>Er.distance(Fr(e),Fr(t),n),va=(e,t)=>{const n=Math.atan2(e,t)*(180/Math.PI);return n>=0?n:n+360},_a=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},xa=e=>{const[t,n,r]=$r(e);return.2126*_a(t)+.7152*_a(n)+.0722*_a(r)},wa=(e,t,n={measure:"euclidean"})=>{const{measure:r="euclidean",backgroundColor:a=Fe}=n,o=oa(e,a),i=oa(t,a);switch(r){case"CIEDE2000":return((e,t)=>{const[n,r,a]=$r(e,"lab"),[o,i,l]=$r(t,"lab"),s=(Math.sqrt(r**2+a**2)+Math.sqrt(i**2+l**2))/2,c=.5*(1-Math.sqrt(s**7/(s**7+25**7))),u=(1+c)*r,d=(1+c)*i,f=Math.sqrt(u**2+a**2),h=Math.sqrt(d**2+l**2),m=va(a,u),p=va(l,d),g=o-n,b=h-f;let y;y=Math.abs(p-m)<=180?p-m:p-m<-180?p-m+360:p-m-360;const v=2*Math.sqrt(f*h)*Math.sin(ua(y)/2);let _;_=Math.abs(m-p)<=180?(m+p)/2:Math.abs(m-p)>180&&m+p<360?(m+p+360)/2:(m+p-360)/2;const x=(n+o)/2,w=(f+h)/2,C=1-.17*Math.cos(ua(_-30))+.24*Math.cos(ua(2*_))+.32*Math.cos(ua(3*_+6))-.2*Math.cos(ua(4*_-63)),k=1+.015*(x-50)**2/Math.sqrt(20+(x-50)**2),M=1+.045*w,R=1+.015*w*C,O=-2*Math.sqrt(w**7/(w**7+25**7))*Math.sin(ua(60*Math.exp(-(((_-275)/25)**2))));return Math.sqrt((g/(1*k))**2+(b/(1*M))**2+(v/(1*R))**2+O*(b/(1*M))*(v/(1*R)))})(o,i);case"euclidean":return ya(o,i,n.colorModel);case"contrastRatio":return((e,t)=>{const n=xa(e),r=xa(t);return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)})(o,i);default:return ya(o,i)}};const Ca=[.8,1.2],ka={rouletteWheel:e=>{const t=e.reduce((e,t)=>e+t);let n=0;const r=la(t);let a=0;for(let t=0;t<e.length;t+=1)a+=e[t],r<a&&(n=+t);return n},tournament:e=>{let t=-1,n=0;for(let r=0;r<3;r+=1){const a=sa(e.length-1);e[a]>n&&(t=r,n=e[a])}return t}},Ma=(e,t="tournament")=>ka[t](e),Ra=(e,t)=>{const n=ca(e),r=ca(t);for(let a=1;a<e.length;a+=2)n[a]=t[a],r[a]=e[a];return[n,r]},Oa=(e,t,n,r)=>{const a=ca(e),o=t[sa(t.length-1)],i=sa(e[0].length-1);let l=a[o][i]*la(...Ca),s=[15,240];"grayscale"!==n&&(s=Yr[r][r.split("")[i]]);const[c,u]=s;return l<c?l=c:l>u&&(l=u),a[o][i]=l,a},Na=(e,t,n,r,a,o)=>{let i;i=e.map("grayscale"===n?([e])=>Xr(e):e=>ha(Wr(e,r),n));let l=1/0;for(let e=0;e<i.length;e+=1)for(let n=e+1;n<i.length;n+=1)t[e]&&t[n]||(l=Math.min(l,wa(i[e],i[n],{measure:a,backgroundColor:o})));return l},Sa=(e,t,n,r,a,o,i)=>{if(Math.round(Na(e,t,n,a,o,i))>r)return e;const l=new Array(e.length).fill(0).map((e,t)=>t).filter((e,n)=>!t[n]);let s=new Array(50).fill(0).map(()=>Oa(e,l,n,a)),c=s.map(e=>Na(e,t,n,a,o,i)),u=Math.max(...c),d=s[c.findIndex(e=>e===u)],f=1;for(;f<100&&Math.round(u)<r;){const e=[d];for(let t=1;t<50;t+=2){const t=s[Ma(c)],r=s[Ma(c)];let o=la()<.9?Ra(t,r):[t,r];o=o.map(e=>la()<.1?Oa(e,l,n,a):e),e.push(...o)}s=e,c=s.map(e=>Na(e,t,n,a,o,i));const r=Math.max(...c);u=r,d=s[c.findIndex(e=>e===r)],f+=1}return d},Aa={euclidean:30,CIEDE2000:20,contrastRatio:4.5},Qa={euclidean:291.48,CIEDE2000:100,contrastRatio:21},Da=(e,t={})=>{const{locked:n=[],simulationType:r="normal",threshold:a,colorModel:o="hsv",colorDifferenceMeasure:i="euclidean",backgroundColor:l=Fe}=t;let s=a;if(s||(s=Aa[i]),"grayscale"===r){s=Math.min(s,Qa[i]/e.colors.length)}const c=ca(e);if(!function(e){return"matrix"===e.type}(c)&&!function(e){return"continuous-scale"===e.type}(c))if("grayscale"===r){const e=c.colors.map(e=>[Hr(e)]),t=Sa(e,n,r,s,o,i,l);c.colors.forEach((e,n)=>Object.assign(e,function(e,t){const[,n,r]=$r(t,"lab"),[,,,a=1]=$r(t,"rgba"),o=100*e;let i,l=Math.round(o),s=Hr(Wr([l,n,r],"lab")),c=25;for(;Math.round(o)!==Math.round(s/255*100)&&c>0;)o>s/255*100?l+=1:l-=1,c-=1,s=Hr(Wr([l,n,r],"lab"));if(Math.round(o)<Math.round(s/255*100)&&(l-=1),1===a)i=Wr([l,n,r],"lab");else{const e=$r(Wr([l,n,r],"lab"),"rgb");i=Wr([...e,a],"rgba")}return{...t,...i}}(t[n][0]/255,e)))}else{const e=c.colors.map(e=>$r(e,o)),t=Sa(e,n,r,s,o,i,l);c.colors.forEach((e,n)=>{Object.assign(e,Wr(t[n],o))})}return c},Pa=[.3,.9],Ta=[.5,1],ja=(e,t,n,r=[])=>{const[a]=$r(e,"hsv"),o=new Array(n).fill(!1);let i=-1===r.findIndex(t=>t&&t.model===e.model&&t.value===e.value);return{newColors:new Array(n).fill(0).map((n,l)=>{const s=r[l];return s?(o[l]=!0,s):i?(i=!1,o[l]=!0,e):Wr([ia(a,t*l),la(...Pa),la(...Ta)],"hsv")}),locked:o}};function La(){const e=sa(255),t=sa(255),n=sa(255);return Wr([e,t,n],"rgb")}const Ga=e=>{const{count:t,colors:n}=e,r=[],a={name:"random",semantic:null,type:"categorical",colors:new Array(t).fill(0).map((e,t)=>{const a=n[t];return a?(r[t]=!0,a):La()})};return Da(a,{locked:r})},za=["monochromatic"],Ia={monochromatic:pa,analogous:e=>{const{count:t,color:n,tendency:r}=e,a="tint"===r,[o,i,l]=$r(n,"hsv"),s=Math.floor(t/2);let c=60/(t-1);o>=60&&o<=240&&(c=-c);const u=(i-.1)/3/(t-s-1),d=(l-.4)/3/s,f=new Array(t).fill(0).map((e,t)=>{const n=ia(o,c*(t-s)),r=t<=s?Math.min(i+u*(s-t),1):i+3*u*(s-t),a=t<=s?l-3*d*(s-t):Math.min(l-d*(s-t),1);return Wr([n,r,a],"hsv")});return{name:"analogous",semantic:null,type:"discrete-scale",colors:a?f:f.reverse()}},achromatic:e=>{const{tendency:t}=e,n={...e,color:"tint"===t?ga:ba};return{...pa(n),name:"achromatic"}},complementary:e=>{const{count:t,color:n}=e,[r,a,o]=$r(n,"hsv"),i=Wr([ia(r,180),a,o],"hsv"),l=sa(80,90),s=sa(15,25),c=Math.floor(t/2),u=ma(n,c,[s,l]),d=ma(i,c,[s,l]).reverse();let f;if(t%2==1){const e=Wr([(ia(r,180)+r)/2,la(.05,.1),la(.9,.95)],"hsv");f=[...u,e,...d]}else f=[...u,...d];return{name:"complementary",semantic:null,type:"discrete-scale",colors:f}},"split-complementary":e=>{const{count:t,color:n,colors:r}=e,{newColors:a,locked:o}=ja(n,180,t,r);return Da({name:"tetradic",semantic:null,type:"categorical",colors:a},{locked:o})},triadic:e=>{const{count:t,color:n,colors:r}=e,{newColors:a,locked:o}=ja(n,120,t,r);return Da({name:"tetradic",semantic:null,type:"categorical",colors:a},{locked:o})},tetradic:e=>{const{count:t,color:n,colors:r}=e,{newColors:a,locked:o}=ja(n,90,t,r);return Da({name:"tetradic",semantic:null,type:"categorical",colors:a},{locked:o})},polychromatic:e=>{const{count:t,color:n,colors:r}=e,a=360/t,{newColors:o,locked:i}=ja(n,a,t,r);return Da({name:"tetradic",semantic:null,type:"categorical",colors:o},{locked:i})},customized:Ga},Ba=(e="monochromatic",t={})=>{const n=((e,t)=>{const{count:n=8,tendency:r="tint"}=t;let{colors:a=[],color:o}=t;return o||(o=a.find(e=>!!e&&!!e.model&&!!e.value)||La()),za.includes(e)&&(a=[]),{color:o,colors:a,count:n,tendency:r}})(e,t);try{return Ia[e](n)}catch(e){return Ga(n)}};n("./node_modules/.pnpm/quantize@1.0.2/node_modules/quantize/quantize.js");var Ea={}.toString,qa=function(e,t){return Ea.call(e)==="[object ".concat(t,"]")},Ya=function(e){if(!function(e){return"object"==typeof e&&null!==e}(e)||!qa(e,"Object"))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function Fa(e,t,n,r){var a=n||0,o=r||5,i=e;Object.keys(t).forEach(function(e){if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e];null!==n&&Ya(n)?(Ya(i[e])||(i[e]={}),a<o?Fa(i[e],n,a+1,o):i[e]=t[e]):!function(e){return Array.isArray?Array.isArray(e):qa(e,"Array")}(n)?void 0!==n&&(i[e]=n):(i[e]=[],i[e]=i[e].concat(n))}})}const $a=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r+=1)Fa(e,t[r]);return e};var Wa=["line_chart","step_line_chart","area_chart","stacked_area_chart","percent_stacked_area_chart","column_chart","grouped_column_chart","stacked_column_chart","percent_stacked_column_chart","range_column_chart","waterfall_chart","histogram","bar_chart","stacked_bar_chart","percent_stacked_bar_chart","grouped_bar_chart","range_bar_chart","radial_bar_chart","bullet_chart","pie_chart","donut_chart","nested_pie_chart","rose_chart","scatter_plot","bubble_chart","non_ribbon_chord_diagram","arc_diagram","chord_diagram","treemap","sankey_diagram","funnel_chart","mirror_funnel_chart","box_plot","heatmap","density_heatmap","radar_chart","wordcloud","candlestick_chart","compact_box_tree","dendrogram","indented_tree","radial_tree","flow_diagram","fruchterman_layout_graph","force_directed_layout_graph","fa2_layout_graph","mds_layout_graph","circular_layout_graph","spiral_layout_graph","radial_layout_graph","concentric_layout_graph","grid_layout_graph"];const Ha=function(e){return null===e};const Xa=function(e,t){return Ha(e.distinct)||Ha(t.distinct)?e.distinct<t.distinct?1:e.distinct>t.distinct?-1:0:0};function Va(e){return[e.find(function(e){return l(e.levelOfMeasurements,["Nominal"])}),e.find(function(e){return l(e.levelOfMeasurements,["Interval"])})]}function Za(e){return[e.find(function(e){return h(e.levelOfMeasurements,["Time","Ordinal"])}),e.find(function(e){return l(e.levelOfMeasurements,["Interval"])}),e.find(function(e){return l(e.levelOfMeasurements,["Nominal"])})]}function Ka(e){var t=e.find(function(e){return h(e.levelOfMeasurements,["Time","Ordinal"])}),n=e.find(function(e){return l(e.levelOfMeasurements,["Nominal"])});return[t,e.find(function(e){return l(e.levelOfMeasurements,["Interval"])}),n]}function Ja(e){var t=e.filter(function(e){return l(e.levelOfMeasurements,["Nominal"])}).sort(Xa),n=t[0],r=t[1];return[e.find(function(e){return l(e.levelOfMeasurements,["Interval"])}),n,r]}function Ua(e){var t,n,a,o,i,s,c=e.filter(function(e){return l(e.levelOfMeasurements,["Nominal"])}).sort(Xa);return!function(e,t){if(!se(e)||0===e.length||!se(t)||0===t.length||e.length!==t.length)return!1;for(var n={},r=0;r<t.length;r+=1){var a=t[r],o=e[r];if(n[a]){if(n[a]!==o)return!1}else n[a]=o}return!0}(null===(a=c[1])||void 0===a?void 0:a.rawData,null===(o=c[0])||void 0===o?void 0:o.rawData)?(i=(n=(0,r.zs)(c,2))[0],s=n[1]):(s=(t=(0,r.zs)(c,2))[0],i=t[1]),[i,e.find(function(e){return l(e.levelOfMeasurements,["Interval"])}),s]}function eo(e,t,n,a){if(!Wa.includes(e)&&a)return a.toSpec?a.toSpec(t,n):null;switch(e){case"pie_chart":return function(e,t){var n=(0,r.zs)(Va(t),2),a=n[0],o=n[1];return o&&a?{type:"interval",data:e,encode:{color:a.name,y:o.name},transform:[{type:"stackY"}],coordinate:{type:"theta"}}:null}(t,n);case"donut_chart":return function(e,t){var n=(0,r.zs)(Va(t),2),a=n[0],o=n[1];return o&&a?{type:"interval",data:e,encode:{color:a.name,y:o.name},transform:[{type:"stackY"}],coordinate:{type:"theta",innerRadius:.6}}:null}(t,n);case"line_chart":return function(e,t){var n=(0,r.zs)(Za(t),3),a=n[0],o=n[1],i=n[2];if(!a||!o)return null;var l={type:"line",data:e,encode:{x:a.name,y:o.name}};return i&&(l.encode.color=i.name),l}(t,n);case"step_line_chart":return function(e,t){var n=(0,r.zs)(Za(t),3),a=n[0],o=n[1],i=n[2];if(!a||!o)return null;var l={type:"line",data:e,encode:{x:a.name,y:o.name,shape:"hvh"}};return i&&(l.encode.color=i.name),l}(t,n);case"area_chart":return function(e,t){var n=t.find(function(e){return h(e.levelOfMeasurements,["Time","Ordinal"])}),r=t.find(function(e){return l(e.levelOfMeasurements,["Interval"])});return n&&r?{type:"area",data:e,encode:{x:n.name,y:r.name}}:null}(t,n);case"stacked_area_chart":return function(e,t){var n=(0,r.zs)(Ka(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"area",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"stackY"}]}:null}(t,n);case"percent_stacked_area_chart":return function(e,t){var n=(0,r.zs)(Ka(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"area",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"stackY"},{type:"normalizeY"}]}:null}(t,n);case"bar_chart":return function(e,t){var n=(0,r.zs)(Ja(t),3),a=n[0],o=n[1],i=n[2];if(!a||!o)return null;var l={type:"interval",data:e,encode:{x:o.name,y:a.name},coordinate:{transform:[{type:"transpose"}]}};return i&&(l.encode.color=i.name,l.transform=[{type:"stackY"}]),l}(t,n);case"grouped_bar_chart":return function(e,t){var n=(0,r.zs)(Ja(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:o.name,y:a.name,color:i.name},transform:[{type:"dodgeX"}],coordinate:{transform:[{type:"transpose"}]}}:null}(t,n);case"stacked_bar_chart":return function(e,t){var n=(0,r.zs)(Ja(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:o.name,y:a.name,color:i.name},transform:[{type:"stackY"}],coordinate:{transform:[{type:"transpose"}]}}:null}(t,n);case"percent_stacked_bar_chart":return function(e,t){var n=(0,r.zs)(Ja(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:o.name,y:a.name,color:i.name},transform:[{type:"stackY"},{type:"normalizeY"}],coordinate:{transform:[{type:"transpose"}]}}:null}(t,n);case"column_chart":return function(e,t){var n=t.filter(function(e){return l(e.levelOfMeasurements,["Nominal"])}).sort(Xa),r=n[0],a=n[1],o=t.find(function(e){return l(e.levelOfMeasurements,["Interval"])});if(!r||!o)return null;var i={type:"interval",data:e,encode:{x:r.name,y:o.name}};return a&&(i.encode.color=a.name,i.transform=[{type:"stackY"}]),i}(t,n);case"grouped_column_chart":return function(e,t){var n=(0,r.zs)(Ua(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"dodgeX"}]}:null}(t,n);case"stacked_column_chart":return function(e,t){var n=(0,r.zs)(Ua(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"stackY"}]}:null}(t,n);case"percent_stacked_column_chart":return function(e,t){var n=(0,r.zs)(Ua(t),3),a=n[0],o=n[1],i=n[2];return a&&o&&i?{type:"interval",data:e,encode:{x:a.name,y:o.name,color:i.name},transform:[{type:"stackY"},{type:"normalizeY"}]}:null}(t,n);case"scatter_plot":return function(e,t){var n=t.filter(function(e){return l(e.levelOfMeasurements,["Interval"])}).sort(Xa),r=n[0],a=n[1],o=t.find(function(e){return l(e.levelOfMeasurements,["Nominal"])});if(!r||!a)return null;var i={type:"point",data:e,encode:{x:r.name,y:a.name}};return o&&(i.encode.color=o.name),i}(t,n);case"bubble_chart":return function(e,t){for(var n=t.filter(function(e){return l(e.levelOfMeasurements,["Interval"])}),a={x:n[0],y:n[1],corr:0,size:n[2]},o=function(e){for(var t=function(t){var o=Me(n[e].rawData,n[t].rawData);Math.abs(o)>a.corr&&(a.x=n[e],a.y=n[t],a.corr=o,a.size=n[(0,r.fX)([],(0,r.zs)(Array(n.length).keys()),!1).find(function(n){return n!==e&&n!==t})||0])},o=e+1;o<n.length;o+=1)t(o)},i=0;i<n.length;i+=1)o(i);var s=a.x,c=a.y,u=a.size,d=t.find(function(e){return h(e.levelOfMeasurements,["Nominal"])});if(!s||!c||!u)return null;var f={type:"point",data:e,encode:{x:s.name,y:c.name,size:u.name}};return d&&(f.encode.color=d.name),f}(t,n);case"histogram":return function(e,t){var n=t.find(function(e){return l(e.levelOfMeasurements,["Interval"])});return n?{type:"rect",data:e,encode:{x:n.name},transform:[{type:"binX",y:"count"}]}:null}(t,n);case"heatmap":return function(e,t){var n=t.filter(function(e){return h(e.levelOfMeasurements,["Nominal","Ordinal"])}).sort(Xa),r=n[0],a=n[1],o=t.find(function(e){return l(e.levelOfMeasurements,["Interval"])});return r&&a&&o?{type:"cell",data:e,encode:{x:r.name,y:a.name,color:o.name}}:null}(t,n);default:return null}}var to=["monochromatic","analogous"],no=["polychromatic","split-complementary","triadic","tetradic"];function ro(e,t,n,r,a,o,i){var l=void 0!==(null==o?void 0:o.refine)&&o.refine,s=a,c=null==o?void 0:o.theme,u=void 0===(null==o?void 0:o.requireSpec)||o.requireSpec,d=n,f=Object.keys(d),h=[],m=f.map(function(a){var u,f=function(e,t,n,r,a){var o=[],i={dataProps:n,chartType:e,purpose:a?a.purpose:"",preferences:a?a.preferences:void 0},l=g(e,t,r,"HARD",i,o);return 0===l?{chartType:e,score:0,log:o}:{chartType:e,score:l*g(e,t,r,"SOFT",i,o),log:o}}(a,d,t,r,o);h.push(f);var m=f.score;if(m<=0)return{type:a,spec:null,score:m};var p=eo(a,e,t,n[a]);if(!["kpi_panel","table"].includes(a)&&!p)return{type:a,spec:null,score:m};if(p&&l){var b=function(e,t,n,r){return Object.values(n).filter(function(r){var a;return"DESIGN"===r.type&&r.trigger({dataProps:t,chartType:e})&&!(null===(a=n[r.id].option)||void 0===a?void 0:a.off)}).reduce(function(e,n){var a=n.optimizer(t,r);return $a(e,a)},{})}(a,t,r,p);$a(p,b)}if(p)if(c&&!s){b=function(e,t,n){var r,a=L(t),o=n.primaryColor,i=a.encode;if(o&&i){var l=Vr(o);if(i.color){var s=i.color,c=s.field,u=void 0;u="quantitative"===s.type?to[Math.floor(Math.random()*to.length)]:no[Math.floor(Math.random()*no.length)];var d=null===(r=e.find(function(e){return e.name===c}))||void 0===r?void 0:r.count;return{scale:{color:{range:Ba(u,{color:l,count:d}).colors.map(function(e){return qr(e)})}}}}return"line"===t.type?{style:{stroke:qr(l)}}:{style:{fill:qr(l)}}}return{}}(t,p,c);$a(p,b)}else if(s){var y=null!==(u=null==i?void 0:i.themeColor)&&void 0!==u?u:"#678ef2";b=function(e,t,n,r,a){var o,i=L(t).encode;if(n&&i){var l=Vr(n);if(i.color){var s=i.color,c=s.field,u=r;u||(u="quantitative"===s.type?"monochromatic":"polychromatic");var d=null===(o=e.find(function(e){return e.name===c}))||void 0===o?void 0:o.count;return{scale:{color:{range:Ba(u,{color:l,count:d}).colors.map(function(e){return qr(a?ha(e,a):e)})}}}}return"line"===t.type?{style:{stroke:qr(l)}}:{style:{fill:qr(l)}}}return{}}(t,p,y,null==i?void 0:i.colorSchemeType,null==i?void 0:i.simulationType);$a(p,b)}return{type:a,spec:p,score:m}});return{advices:m.filter(function(e){return e.score>0&&(!u||e.spec)}).sort(function(e,t){return e.score<t.score?1:e.score>t.score?-1:0}),log:h}}function ao(e,t,n){var a=e.data,o=e.dataProps,i=e.smartColor,l=e.options,s=e.colorOptions,c=e.fields;try{var u=Ye(a),d=function(e,t,n){var a=(t?new Ee(e,{columns:t}):new Ee(e)).info();return n?a.map(function(e){var t=n.find(function(t){return t.name===e.name});return(0,r.Cl)((0,r.Cl)({},e),t)}):a}(u,c,o);return ro(c?u.map(function(e){var t=e;return Object.keys(t).forEach(function(e){c.includes(e)||delete t[e]}),e}):u,d,t,n,i,l,s)}catch(e){return console.error("error: ",e),{advices:[],log:[]}}}function oo(e,t,n,a,o,i,l){Object.values(e).filter(function(e){var a,o=e.option||{},l=o.weight,s=o.extra;return function(e){return"DESIGN"===t?"DESIGN"===e:"DESIGN"!==e}(e.type)&&!(null===(a=e.option)||void 0===a?void 0:a.off)&&e.trigger((0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},n),{weight:l}),s),{chartWIKI:i}))}).forEach(function(e){var s,c=e.type,u=e.id,d=e.docs;if("DESIGN"===t){var f=e.optimizer(n.dataProps,l);s=0===Object.keys(f).length?1:0,o.push({type:c,id:u,score:s,fix:f,docs:d})}else{var h=e.option||{},m=h.weight,p=h.extra;s=e.validator((0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},n),{weight:m}),p),{chartWIKI:i})),o.push({type:c,id:u,score:s,docs:d})}a.push({phase:"LINT",ruleId:u,score:s,base:s,weight:1,ruleType:c})})}function io(e,t,n){var r=e.spec,a=e.options,o=e.dataProps,i=null==a?void 0:a.purpose,l=null==a?void 0:a.preferences,s=function(e){var t,n=e;switch(n.type){case"area":t=function(e){var t=e.transform,n=null==t?void 0:t.some(function(e){return"stackY"===e.type}),r=null==t?void 0:t.some(function(e){return"normalizeY"===e.type});return n?r?"percent_stacked_area_chart":"stacked_area_chart":"area_chart"}(n);break;case"interval":t=function(e){var t,n=e.coordinate;if("theta"===(null==n?void 0:n.type))return(null==n?void 0:n.innerRadius)?"donut_chart":"pie_chart";var r=e.transform,a=null===(t=null==n?void 0:n.transform)||void 0===t?void 0:t.some(function(e){return"transpose"===e.type}),o=null==r?void 0:r.some(function(e){return"normalizeY"===e.type}),i=null==r?void 0:r.some(function(e){return"stackY"===e.type}),l=null==r?void 0:r.some(function(e){return"dodgeX"===e.type});return a?l?"grouped_bar_chart":o?"stacked_bar_chart":i?"percent_stacked_bar_chart":"bar_chart":l?"grouped_column_chart":o?"stacked_column_chart":i?"percent_stacked_column_chart":"column_chart"}(n);break;case"line":t=function(e){var t=e.encode;return t.shape&&"hvh"===t.shape?"step_line_chart":"line_chart"}(n);break;case"point":t=function(e){return e.encode.size?"bubble_chart":"scatter_plot"}(n);break;case"rect":t="histogram";break;case"cell":t="heatmap";break;default:t=""}return t}(r),c=[],u=[];if(!r||!s)return{lints:c,log:u};if(!o||!o.length){try{o=new Ee(r.data).info()}catch(e){return console.error("error: ",e),{lints:c,log:u}}}var d={dataProps:o,chartType:s,purpose:i,preferences:l};return oo(t,"notDESIGN",d,u,c,n),oo(t,"DESIGN",d,u,c,n,r),{lints:c=c.filter(function(e){return e.score<1}),log:u}}var lo=function(){function e(e){void 0===e&&(e={}),this.ckb=i(e.ckbCfg),this.ruleBase=function(e){if(!e)return E(B);var t=E(B);if(e.exclude&&e.exclude.forEach(function(e){Object.keys(t).includes(e)&&delete t[e]}),e.include){var n=e.include;Object.keys(t).forEach(function(e){n.includes(e)||delete t[e]})}var a=(0,r.Cl)((0,r.Cl)({},t),e.custom),o=e.options;return o&&Object.keys(o).forEach(function(e){if(Object.keys(a).includes(e)){var t=o[e];a[e]=(0,r.Cl)((0,r.Cl)({},a[e]),{option:t})}}),a}(e.ruleCfg)}return e.prototype.advise=function(e){return ao(e,this.ckb,this.ruleBase).advices},e.prototype.adviseWithLog=function(e){return ao(e,this.ckb,this.ruleBase)},e.prototype.lint=function(e){return io(e,this.ruleBase,this.ckb).lints},e.prototype.lintWithLog=function(e){return io(e,this.ruleBase,this.ckb)},e}(),so=n("./node_modules/.pnpm/@antv+util@3.3.11/node_modules/@antv/util/esm/lodash/deep-mix.js"),co=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n};const uo=e=>{const t=new lo,{data:n,dataProps:r,fields:a,options:o,colorOptions:i}=e,l=co(e,["data","dataProps","fields","options","colorOptions"]),s=t.advise({data:n,dataProps:r,fields:a,options:o,colorOptions:i});return(0,so.A)({},l,null==s?void 0:s[0].spec)}},"./node_modules/.pnpm/color-blind@0.1.3/node_modules/color-blind/lib/blind.js"(e,t){"use strict";var n=2.2,r=[3.240712470389558,-.969259258688888,.05563600315398933,-1.5372626602963142,1.875996969313966,-.2039948802843549,-.49857440415943116,.041556132211625726,1.0570636917433989],a=[.41242371206635076,.21265606784927693,.019331987577444885,.3575793401363035,.715157818248362,.11919267420354762,.1804662232369621,.0721864539171564,.9504491124870351],o={protan:{x:.7465,y:.2535,m:1.273463,yi:-.073894},deutan:{x:1.4,y:-.4,m:.968437,yi:.003331},tritan:{x:.1748,y:0,m:.062921,yi:.292119},custom:{x:.735,y:.265,m:-1.059259,yi:1.026914}};t.e=function(e,t,i){var l,s,c,u,d,f,h,m,p,g,b,y,v,_,x,w,C,k,M;return"achroma"===t?(l={R:l=.212656*e.R+.715158*e.G+.072186*e.B,G:l,B:l},i&&(l.R=((s=1.75)*l.R+e.R)/(c=s+1),l.G=(s*l.G+e.G)/c,l.B=(s*l.B+e.B)/c),l):(u=o[t],d=function(e){var t=e.X+e.Y+e.Z;return 0===t?{x:0,y:0,Y:e.Y}:{x:e.X/t,y:e.Y/t,Y:e.Y}}(function(e){var t=a,n={},r=e.R/255,o=e.G/255,i=e.B/255;return r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,o=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,n.X=r*t[0]+o*t[3]+i*t[6],n.Y=r*t[1]+o*t[4]+i*t[7],n.Z=r*t[2]+o*t[5]+i*t[8],n}(e)),(l={}).X=(m=(u.yi-(h=d.y-d.x*(f=(d.y-u.y)/(d.x-u.x))))/(f-u.m))*d.Y/(p=f*m+h),l.Y=d.Y,l.Z=(1-(m+p))*d.Y/p,y=(g=.312713*d.Y/.329016-l.X)*(k=r)[0]+0*k[3]+(b=.358271*d.Y/.329016-l.Z)*k[6],v=g*k[1]+0*k[4]+b*k[7],_=g*k[2]+0*k[5]+b*k[8],l.R=l.X*k[0]+l.Y*k[3]+l.Z*k[6],l.G=l.X*k[1]+l.Y*k[4]+l.Z*k[7],l.B=l.X*k[2]+l.Y*k[5]+l.Z*k[8],(C=(C=((l.B<0?0:1)-l.B)/_)>1||C<0?0:C)>(M=(x=(x=((l.R<0?0:1)-l.R)/y)>1||x<0?0:x)>(w=(w=((l.G<0?0:1)-l.G)/v)>1||w<0?0:w)?x:w)&&(M=C),l.R+=M*y,l.G+=M*v,l.B+=M*_,l.R=255*(l.R<=0?0:l.R>=1?1:Math.pow(l.R,1/n)),l.G=255*(l.G<=0?0:l.G>=1?1:Math.pow(l.G,1/n)),l.B=255*(l.B<=0?0:l.B>=1?1:Math.pow(l.B,1/n)),i&&(l.R=((s=1.75)*l.R+e.R)/(c=s+1),l.G=(s*l.G+e.G)/c,l.B=(s*l.B+e.B)/c),l)}},"./node_modules/.pnpm/color-blind@0.1.3/node_modules/color-blind/lib/color-blind.js"(e,t,n){"use strict";var r=n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/index.js"),a=n("./node_modules/.pnpm/color-blind@0.1.3/node_modules/color-blind/lib/blind.js").e,o={protanomaly:{type:"protan",anomalize:!0},protanopia:{type:"protan"},deuteranomaly:{type:"deutan",anomalize:!0},deuteranopia:{type:"deutan"},tritanomaly:{type:"tritan",anomalize:!0},tritanopia:{type:"tritan"},achromatomaly:{type:"achroma",anomalize:!0},achromatopsia:{type:"achroma"}},i=function(e){return Math.round(255*e)},l=function(e){return function(t,n){var l=r(t);if(!l)return n?{R:0,G:0,B:0}:"#000000";var s=new a({R:i(l.red()||0),G:i(l.green()||0),B:i(l.blue()||0)},o[e].type,o[e].anomalize);return s.R=s.R||0,s.G=s.G||0,s.B=s.B||0,n?(delete s.X,delete s.Y,delete s.Z,s):new r.RGB(s.R%256/255,s.G%256/255,s.B%256/255,1).hex()}};for(var s in o)t[s]=l(s)},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/index.js"(e,t,n){e.exports=n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/color.js").use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/XYZ.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/LAB.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSV.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/CMYK.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/namedColors.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/clearer.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/contrast.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/darken.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/desaturate.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/grayscale.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isDark.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isLight.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/lighten.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/luminance.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/mix.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/negate.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/opaquer.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/rotate.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/saturate.js")).use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/toAlpha.js"))},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/CMYK.js"(e){e.exports=function(e){e.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new e.RGB(1-this._cyan*(1-this._black)-this._black,1-this._magenta*(1-this._black)-this._black,1-this._yellow*(1-this._black)-this._black,this._alpha)},fromRgb:function(){var t=this._red,n=this._green,r=this._blue,a=1-t,o=1-n,i=1-r,l=1;return t||n||r?(a=(a-(l=Math.min(a,Math.min(o,i))))/(1-l),o=(o-l)/(1-l),i=(i-l)/(1-l)):l=1,new e.CMYK(a,o,i,l,this._alpha)}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSV.js")),e.installColorSpace("HSL",["hue","saturation","lightness","alpha"],{hsv:function(){var t=2*this._lightness,n=this._saturation*(t<=1?t:2-t);return new e.HSV(this._hue,t+n<1e-9?0:2*n/(t+n),(t+n)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSV.js"(e){e.exports=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t,n,r,a=this._hue,o=this._saturation,i=this._value,l=Math.min(5,Math.floor(6*a)),s=6*a-l,c=i*(1-o),u=i*(1-s*o),d=i*(1-(1-s)*o);switch(l){case 0:t=i,n=d,r=c;break;case 1:t=u,n=i,r=c;break;case 2:t=c,n=i,r=d;break;case 3:t=c,n=u,r=i;break;case 4:t=d,n=c,r=i;break;case 5:t=i,n=c,r=u}return new e.RGB(t,n,r,this._alpha)},hsl:function(){var t=(2-this._saturation)*this._value,n=t<=1?t:2-t;return new e.HSL(this._hue,n<1e-9?0:this._saturation*this._value/n,t/2,this._alpha)},fromRgb:function(){var t,n=this._red,r=this._green,a=this._blue,o=Math.max(n,r,a),i=o-Math.min(n,r,a),l=0===o?0:i/o,s=o;if(0===i)t=0;else switch(o){case n:t=(r-a)/i/6+(r<a?1:0);break;case r:t=(a-n)/i/6+1/3;break;case a:t=(n-r)/i/6+2/3}return new e.HSV(t,l,s,this._alpha)}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/LAB.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/XYZ.js")),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var t=function(e){var t=Math.pow(e,3);return t>.008856?t:(e-16/116)/7.87},n=(this._l+16)/116,r=n-this._b/200;return new e.XYZ(95.047*t(this._a/500+n),100*t(n),108.883*t(r),this._alpha)}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/XYZ.js"(e){e.exports=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},n=t(this._red),r=t(this._green),a=t(this._blue);return new e.XYZ(.4124564*n+.3575761*r+.1804375*a,.2126729*n+.7151522*r+.072175*a,.0193339*n+.119192*r+.9503041*a,this._alpha)},rgb:function(){var t=this._x,n=this._y,r=this._z,a=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(a(3.2404542*t+-1.5371385*n+-.4985314*r),a(-.969266*t+1.8760108*n+.041556*r),a(.0556434*t+-.2040259*n+1.0572252*r),this._alpha)},lab:function(){var t=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},n=t(this._x/95.047),r=t(this._y/100),a=t(this._z/108.883);return new e.LAB(116*r-16,500*(n-r),200*(r-a),this._alpha)}})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/color.js"(e){var t=[],n=function(e){return void 0===e},r=/\s*(\.\d+|\d+(?:\.\d+)?)(%)?\s*/,a=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,o=new RegExp("^(rgb|hsl|hsv)a?\\("+r.source+","+r.source+","+r.source+"(?:,"+/\s*(\.\d+|\d+(?:\.\d+)?)\s*/.source+")?\\)$","i");function i(e){if(Array.isArray(e)){if("string"==typeof e[0]&&"function"==typeof i[e[0]])return new i[e[0]](e.slice(1,e.length));if(4===e.length)return new i.RGB(e[0]/255,e[1]/255,e[2]/255,e[3]/255)}else if("string"==typeof e){var t=e.toLowerCase();i.namedColors[t]&&(e="#"+i.namedColors[t]),"transparent"===t&&(e="rgba(0,0,0,0)");var r=e.match(o);if(r){var l=r[1].toUpperCase(),s=n(r[8])?r[8]:parseFloat(r[8]),c="H"===l[0],u=r[3]?100:c?360:255,d=r[5]||c?100:255,f=r[7]||c?100:255;if(n(i[l]))throw new Error("color."+l+" is not installed.");return new i[l](parseFloat(r[2])/u,parseFloat(r[4])/d,parseFloat(r[6])/f,s)}e.length<6&&(e=e.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var h=e.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(h)return new i.RGB(parseInt(h[1],16)/255,parseInt(h[2],16)/255,parseInt(h[3],16)/255);if(i.CMYK){var m=e.match(new RegExp("^cmyk\\("+a.source+","+a.source+","+a.source+","+a.source+"\\)$","i"));if(m)return new i.CMYK(parseFloat(m[1])/100,parseFloat(m[2])/100,parseFloat(m[3])/100,parseFloat(m[4])/100)}}else if("object"==typeof e&&e.isColor)return e;return!1}i.namedColors={},i.installColorSpace=function(e,r,a){i[e]=function(t){var n=Array.isArray(t)?t:arguments;r.forEach(function(t,a){var o=n[a];if("alpha"===t)this._alpha=isNaN(o)||o>1?1:o<0?0:o;else{if(isNaN(o))throw new Error("["+e+"]: Invalid color: ("+r.join(",")+")");"hue"===t?this._hue=o<0?o-Math.floor(o):o%1:this["_"+t]=o<0?0:o>1?1:o}},this)},i[e].propertyNames=r;var o=i[e].prototype;for(var l in["valueOf","hex","hexa","css","cssa"].forEach(function(t){o[t]=o[t]||("RGB"===e?o.hex:function(){return this.rgb()[t]()})}),o.isColor=!0,o.equals=function(t,a){n(a)&&(a=1e-10),t=t[e.toLowerCase()]();for(var o=0;o<r.length;o+=1)if(Math.abs(this["_"+r[o]]-t["_"+r[o]])>a)return!1;return!0},o.toJSON=function(){return[e].concat(r.map(function(e){return this["_"+e]},this))},a)if(a.hasOwnProperty(l)){var s=l.match(/^from(.*)$/);s?i[s[1].toUpperCase()].prototype[e.toLowerCase()]=a[l]:o[l]=a[l]}function c(e,t){var n={};for(var r in n[t.toLowerCase()]=function(){return this.rgb()[t.toLowerCase()]()},i[t].propertyNames.forEach(function(e){var r="black"===e?"k":e.charAt(0);n[e]=n[r]=function(n,r){return this[t.toLowerCase()]()[e](n,r)}}),n)n.hasOwnProperty(r)&&void 0===i[e].prototype[r]&&(i[e].prototype[r]=n[r])}return o[e.toLowerCase()]=function(){return this},o.toString=function(){return"["+e+" "+r.map(function(e){return this["_"+e]},this).join(", ")+"]"},r.forEach(function(e){var t="black"===e?"k":e.charAt(0);o[e]=o[t]=function(t,n){return void 0===t?this["_"+e]:new this.constructor(r.map(n?function(n){return this["_"+n]+(e===n?t:0)}:function(n){return e===n?t:this["_"+n]},this))}}),t.forEach(function(t){c(e,t),c(t,e)}),t.push(e),i},i.pluginList=[],i.use=function(e){return-1===i.pluginList.indexOf(e)&&(this.pluginList.push(e),e(i)),i},i.installMethod=function(e,n){return t.forEach(function(t){i[t].prototype[e]=n}),this},i.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return"#"+"00".substr(0,2-e.length)+e+this.hex().substr(1,6)},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}}),e.exports=i},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/clearer.js"(e){e.exports=function(e){e.installMethod("clearer",function(e){return this.alpha(isNaN(e)?-.1:-e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/contrast.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/luminance.js")),e.installMethod("contrast",function(e){var t=this.luminance(),n=e.luminance();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/darken.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("darken",function(e){return this.lightness(isNaN(e)?-.1:-e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/desaturate.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("desaturate",function(e){return this.saturation(isNaN(e)?-.1:-e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/grayscale.js"(e){e.exports=function(e){function t(){var t=this.rgb(),n=.3*t._red+.59*t._green+.11*t._blue;return new e.RGB(n,n,n,t._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isDark.js"(e){e.exports=function(e){e.installMethod("isDark",function(){var e=this.rgb();return(255*e._red*299+255*e._green*587+255*e._blue*114)/1e3<128})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isLight.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/isDark.js")),e.installMethod("isLight",function(){return!this.isDark()})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/lighten.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("lighten",function(e){return this.lightness(isNaN(e)?.1:e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/luminance.js"(e){e.exports=function(e){function t(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}e.installMethod("luminance",function(){var e=this.rgb();return.2126*t(e._red)+.7152*t(e._green)+.0722*t(e._blue)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/mix.js"(e){e.exports=function(e){e.installMethod("mix",function(t,n){t=e(t).rgb();var r=2*(n=1-(isNaN(n)?.5:n))-1,a=this._alpha-t._alpha,o=((r*a===-1?r:(r+a)/(1+r*a))+1)/2,i=1-o,l=this.rgb();return new e.RGB(l._red*o+t._red*i,l._green*o+t._green*i,l._blue*o+t._blue*i,l._alpha*n+t._alpha*(1-n))})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/namedColors.js"(e){e.exports=function(e){e.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/negate.js"(e){e.exports=function(e){e.installMethod("negate",function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/opaquer.js"(e){e.exports=function(e){e.installMethod("opaquer",function(e){return this.alpha(isNaN(e)?.1:e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/rotate.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("rotate",function(e){return this.hue((e||0)/360,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/saturate.js"(e,t,n){e.exports=function(e){e.use(n("./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/HSL.js")),e.installMethod("saturate",function(e){return this.saturation(isNaN(e)?.1:e,!0)})}},"./node_modules/.pnpm/onecolor@3.1.0/node_modules/onecolor/lib/plugins/toAlpha.js"(e){e.exports=function(e){e.installMethod("toAlpha",function(e){var t=this.rgb(),n=e(e).rgb(),r=new e.RGB(0,0,0,t._alpha),a=["_red","_green","_blue"];return a.forEach(function(e){r[e]=t[e]<1e-10?t[e]:t[e]>n[e]?(t[e]-n[e])/(1-n[e]):t[e]>n[e]?(n[e]-t[e])/n[e]:0}),t._alpha=r._red>r._green?r._red>r._blue?r._red:r._blue:r._green>r._blue?r._green:r._blue,t._alpha<1e-10||(a.forEach(function(e){t[e]=(t[e]-n[e])/t._alpha+n[e]}),t._alpha*=r._alpha),t})}},"./node_modules/.pnpm/quantize@1.0.2/node_modules/quantize/quantize.js"(e){if(!t)var t={map:function(e,t){var n={};return t?e.map(function(e,r){return n.index=r,t.call(n,e)}):e.slice()},naturalOrder:function(e,t){return e<t?-1:e>t?1:0},sum:function(e,t){var n={};return e.reduce(t?function(e,r,a){return n.index=a,e+t.call(n,r)}:function(e,t){return e+t},0)},max:function(e,n){return Math.max.apply(null,n?t.map(e,n):e)}};var n=function(){function e(e,t,n){return(e<<10)+(t<<5)+n}function n(e){var t=[],n=!1;function r(){t.sort(e),n=!0}return{push:function(e){t.push(e),n=!1},peek:function(e){return n||r(),void 0===e&&(e=t.length-1),t[e]},pop:function(){return n||r(),t.pop()},size:function(){return t.length},map:function(e){return t.map(e)},debug:function(){return n||r(),t}}}function r(e,t,n,r,a,o,i){var l=this;l.r1=e,l.r2=t,l.g1=n,l.g2=r,l.b1=a,l.b2=o,l.histo=i}function a(){this.vboxes=new n(function(e,n){return t.naturalOrder(e.vbox.count()*e.vbox.volume(),n.vbox.count()*n.vbox.volume())})}function o(n,r){if(r.count()){var a=r.r2-r.r1+1,o=r.g2-r.g1+1,i=t.max([a,o,r.b2-r.b1+1]);if(1==r.count())return[r.copy()];var l,s,c,u,d=0,f=[],h=[];if(i==a)for(l=r.r1;l<=r.r2;l++){for(u=0,s=r.g1;s<=r.g2;s++)for(c=r.b1;c<=r.b2;c++)u+=n[e(l,s,c)]||0;f[l]=d+=u}else if(i==o)for(l=r.g1;l<=r.g2;l++){for(u=0,s=r.r1;s<=r.r2;s++)for(c=r.b1;c<=r.b2;c++)u+=n[e(s,l,c)]||0;f[l]=d+=u}else for(l=r.b1;l<=r.b2;l++){for(u=0,s=r.r1;s<=r.r2;s++)for(c=r.g1;c<=r.g2;c++)u+=n[e(s,c,l)]||0;f[l]=d+=u}return f.forEach(function(e,t){h[t]=d-e}),m(i==a?"r":i==o?"g":"b")}function m(e){var t,n,a,o,i,s=e+"1",c=e+"2",u=0;for(l=r[s];l<=r[c];l++)if(f[l]>d/2){for(a=r.copy(),o=r.copy(),i=(t=l-r[s])<=(n=r[c]-l)?Math.min(r[c]-1,~~(l+n/2)):Math.max(r[s],~~(l-1-t/2));!f[i];)i++;for(u=h[i];!u&&f[i-1];)u=h[--i];return a[c]=i,o[s]=a[c]+1,[a,o]}}}return r.prototype={volume:function(e){var t=this;return t._volume&&!e||(t._volume=(t.r2-t.r1+1)*(t.g2-t.g1+1)*(t.b2-t.b1+1)),t._volume},count:function(t){var n=this,r=n.histo;if(!n._count_set||t){var a,o,i,l=0;for(a=n.r1;a<=n.r2;a++)for(o=n.g1;o<=n.g2;o++)for(i=n.b1;i<=n.b2;i++)l+=r[e(a,o,i)]||0;n._count=l,n._count_set=!0}return n._count},copy:function(){var e=this;return new r(e.r1,e.r2,e.g1,e.g2,e.b1,e.b2,e.histo)},avg:function(t){var n=this,r=n.histo;if(!n._avg||t){var a,o,i,l,s=0,c=0,u=0,d=0;for(o=n.r1;o<=n.r2;o++)for(i=n.g1;i<=n.g2;i++)for(l=n.b1;l<=n.b2;l++)s+=a=r[e(o,i,l)]||0,c+=a*(o+.5)*8,u+=a*(i+.5)*8,d+=a*(l+.5)*8;n._avg=s?[~~(c/s),~~(u/s),~~(d/s)]:[~~(8*(n.r1+n.r2+1)/2),~~(8*(n.g1+n.g2+1)/2),~~(8*(n.b1+n.b2+1)/2)]}return n._avg},contains:function(e){var t=this,n=e[0]>>3;return gval=e[1]>>3,bval=e[2]>>3,n>=t.r1&&n<=t.r2&&gval>=t.g1&&gval<=t.g2&&bval>=t.b1&&bval<=t.b2}},a.prototype={push:function(e){this.vboxes.push({vbox:e,color:e.avg()})},palette:function(){return this.vboxes.map(function(e){return e.color})},size:function(){return this.vboxes.size()},map:function(e){for(var t=this.vboxes,n=0;n<t.size();n++)if(t.peek(n).vbox.contains(e))return t.peek(n).color;return this.nearest(e)},nearest:function(e){for(var t,n,r,a=this.vboxes,o=0;o<a.size();o++)((n=Math.sqrt(Math.pow(e[0]-a.peek(o).color[0],2)+Math.pow(e[1]-a.peek(o).color[1],2)+Math.pow(e[2]-a.peek(o).color[2],2)))<t||void 0===t)&&(t=n,r=a.peek(o).color);return r},forcebw:function(){var e=this.vboxes;e.sort(function(e,n){return t.naturalOrder(t.sum(e.color),t.sum(n.color))});var n=e[0].color;n[0]<5&&n[1]<5&&n[2]<5&&(e[0].color=[0,0,0]);var r=e.length-1,a=e[r].color;a[0]>251&&a[1]>251&&a[2]>251&&(e[r].color=[255,255,255])}},{quantize:function(i,l){if(!i.length||l<2||l>256)return!1;var s=function(t){var n,r=new Array(32768);return t.forEach(function(t){n=e(t[0]>>3,t[1]>>3,t[2]>>3),r[n]=(r[n]||0)+1}),r}(i);s.forEach(function(){0});var c=function(e,t){var n,a,o,i=1e6,l=0,s=1e6,c=0,u=1e6,d=0;return e.forEach(function(e){(n=e[0]>>3)<i?i=n:n>l&&(l=n),(a=e[1]>>3)<s?s=a:a>c&&(c=a),(o=e[2]>>3)<u?u=o:o>d&&(d=o)}),new r(i,l,s,c,u,d,t)}(i,s),u=new n(function(e,n){return t.naturalOrder(e.count(),n.count())});function d(e,t){for(var n,r=1,a=0;a<1e3;)if((n=e.pop()).count()){var i=o(s,n),l=i[0],c=i[1];if(!l)return;if(e.push(l),c&&(e.push(c),r++),r>=t)return;if(a++>1e3)return}else e.push(n),a++}u.push(c),d(u,.75*l);for(var f=new n(function(e,n){return t.naturalOrder(e.count()*e.volume(),n.count()*n.volume())});u.size();)f.push(u.pop());d(f,l-f.size());for(var h=new a;f.size();)h.push(f.pop());return h}}}();e.exports=n.quantize}}]);